From ff3fc3470f90e42c540498a7e539cf3f60cf7975 Mon Sep 17 00:00:00 2001 From: echoorchid Date: Fri, 2 Sep 2022 15:24:04 +0800 Subject: [PATCH 001/379] add fullscreen event Signed-off-by: echoorchid Change-Id: I1cf68c1e8efe5107b859e80c5883eb21a4bcdcac --- compiler/components/web.json | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/components/web.json b/compiler/components/web.json index 0a7def4..e020b85 100644 --- a/compiler/components/web.json +++ b/compiler/components/web.json @@ -7,6 +7,7 @@ "onPageEnd", "onPageBegin", "onProgressChange", "onTitleReceive", "onGeolocationHide", "onGeolocationShow", "onRequestSelected", "javaScriptAccess", "fileAccess", "onAlert", "onBeforeUnload", "onlineImageAccess", "domStorageAccess", "imageAccess", "mixedMode", "zoomAccess", "geolocationAccess", "javaScriptProxy", + "onFullScreenExit", "onFullScreenEnter", "userAgent", "onConfirm", "onConsole", "onErrorReceive", "onHttpErrorReceive", "onDownloadStart", "fileFromUrlAccess", "webDebuggingAccess", "onShowFileSelector", "initialScale", "onResourceLoad", "onScaleChange", "onHttpAuthRequest", "onPermissionRequest", "onContextMenuShow", "textZoomRatio", "onScroll" -- Gitee From 3494ad7b1105e76b10a9acb8421a31508dabf664 Mon Sep 17 00:00:00 2001 From: lizhouze Date: Fri, 9 Sep 2022 15:00:53 +0800 Subject: [PATCH 002/379] lizhouze@huawei.com Signed-off-by: lizhouze --- compiler/webpack.config.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 0dadde6..3ac0b54 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -284,6 +284,17 @@ function setCopyPluginConfig(config) { config.plugins.push(new CopyPlugin({ patterns: copyPluginPattrens })); } +function addResourceTableWatch(config, appResource) { + if (appResource && fs.existsSync(appResource) && !projectConfig.xtsMode) { + const copyPluginPattrens = []; + copyPluginPattrens.push({ + from: path.resolve(__dirname, appResource), + to: path.resolve(__dirname, projectConfig.cache) + }); + config.plugins.push(new CopyPlugin({ patterns: copyPluginPattrens })); + } +} + function excludeWorker(workerFile, name) { if (workerFile) { return Object.keys(workerFile).includes(name); @@ -415,6 +426,9 @@ module.exports = (env, argv) => { const appResourcePath = env.appResource || process.env.appResource; checkAppResourcePath(appResourcePath, config); + if (env.isPreview == 'true') { + addResourceTableWatch(config); + } addSDKBuildDependencies(config); config.output.library = projectConfig.hashProjectPath; return config; -- Gitee From 4376cc8d77474d220ad89fbcb360d9e3992d5e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 9 Sep 2022 07:12:37 +0000 Subject: [PATCH 003/379] update compiler/webpack.config.js. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 3ac0b54..9cddb2e 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -429,7 +429,7 @@ module.exports = (env, argv) => { if (env.isPreview == 'true') { addResourceTableWatch(config); } - addSDKBuildDependencies(config); + addSDKBuildDependencies(config, appResource); config.output.library = projectConfig.hashProjectPath; return config; } -- Gitee From 668d4ebde527f69a0d813d86772a75612dcc5373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 9 Sep 2022 07:31:17 +0000 Subject: [PATCH 004/379] update compiler/webpack.config.js. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 9cddb2e..452021b 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -289,7 +289,7 @@ function addResourceTableWatch(config, appResource) { const copyPluginPattrens = []; copyPluginPattrens.push({ from: path.resolve(__dirname, appResource), - to: path.resolve(__dirname, projectConfig.cache) + to: path.resolve(__dirname, projectConfig.cachePath) }); config.plugins.push(new CopyPlugin({ patterns: copyPluginPattrens })); } -- Gitee From 95dde85fe09cbd04ee92b306954b54e18cf54a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Tue, 13 Sep 2022 06:28:33 +0000 Subject: [PATCH 005/379] update compiler/webpack.config.js. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 452021b..267710c 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -429,7 +429,7 @@ module.exports = (env, argv) => { if (env.isPreview == 'true') { addResourceTableWatch(config); } - addSDKBuildDependencies(config, appResource); + addSDKBuildDependencies(config, appResourcePath); config.output.library = projectConfig.hashProjectPath; return config; } -- Gitee From 557184c4ea6f32f1ab25e7df745309d701d1d89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Tue, 13 Sep 2022 06:30:17 +0000 Subject: [PATCH 006/379] update compiler/webpack.config.js. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 267710c..c25f619 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -429,7 +429,7 @@ module.exports = (env, argv) => { if (env.isPreview == 'true') { addResourceTableWatch(config); } - addSDKBuildDependencies(config, appResourcePath); + addSDKBuildDependencies(config); config.output.library = projectConfig.hashProjectPath; return config; } -- Gitee From 4ff46616d8623fa1a575a202e9001c917d3b9d0f Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Wed, 14 Sep 2022 11:13:19 +0800 Subject: [PATCH 007/379] Modify log level of ark Signed-off-by: zhangrengao Change-Id: I40be20ba3a25da392e96c25e85f0ee1fe9ee911e --- compiler/src/gen_abc.ts | 6 +++--- compiler/src/gen_abc_plugin.ts | 6 +++--- compiler/src/gen_merged_abc.ts | 4 ++-- compiler/src/gen_module_abc.ts | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/compiler/src/gen_abc.ts b/compiler/src/gen_abc.ts index 0ba2c02..ca42ce1 100644 --- a/compiler/src/gen_abc.ts +++ b/compiler/src/gen_abc.ts @@ -38,7 +38,7 @@ function js2abcByWorkers(jsonInput: string, cmd: string): Promise { try { childProcess.execSync(singleCmd); } catch (e) { - logger.error(red, `ETS:ERROR Failed to convert file ${input} to abc `, reset); + logger.debug(red, `ETS:ERROR Failed to convert file ${input} to abc `, reset); process.exit(FAIL); } } @@ -57,7 +57,7 @@ function es2abcByWorkers(jsonInput: string, cmd: string): Promise { try { childProcess.execSync(singleCmd); } catch (e) { - logger.error(red, `ETS:ERROR Failed to convert file ${input} to abc `, reset); + logger.debug(red, `ETS:ERROR Failed to convert file ${input} to abc `, reset); process.exit(FAIL); } } @@ -74,7 +74,7 @@ if (cluster.isWorker && process.env['inputs'] !== undefined && process.env['cmd' } else if (process.env.panda === ES2ABC || process.env.panda === 'undefined' || process.env.panda === undefined) { es2abcByWorkers(process.env['inputs'], process.env['cmd']); } else { - logger.error(red, `ETS:ERROR please set panda module`, reset); + logger.debug(red, `ETS:ERROR please set panda module`, reset); process.exit(FAIL); } process.exit(SUCCESS); diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 1c25854..f60924d 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -438,7 +438,7 @@ function writeFileSync(inputString: string, buildPath: string, keyPath: string, cacheOutputPath = toUnixPath(cacheOutputPath); intermediateJsBundle.push({path: output, size: fileSize, cacheOutputPath: cacheOutputPath}); } else { - logger.error(red, `ETS:ERROR Failed to convert file ${jsBundleFile} to bin. ${output} is lost`, reset); + logger.debug(red, `ETS:ERROR Failed to convert file ${jsBundleFile} to bin. ${output} is lost`, reset); process.exitCode = FAIL; } } @@ -765,7 +765,7 @@ function filterIntermediateModuleByHashJson(buildPath: string, moduleInfos: Arra const input: string = moduleInfos[i].tempFilePath; let outputPath: string = moduleInfos[i].abcFilePath; if (!fs.existsSync(input)) { - logger.error(red, `ETS:ERROR ${input} is lost`, reset); + logger.debug(red, `ETS:ERROR ${input} is lost`, reset); process.exitCode = FAIL; break; } @@ -950,7 +950,7 @@ function copyFileCachePathToBuildPath() { const cacheOutputPath: string = intermediateJsBundle[i].cacheOutputPath; const cacheAbcFilePath: string = intermediateJsBundle[i].cacheOutputPath.replace(/\.temp\.js$/, ".abc"); if (!fs.existsSync(cacheAbcFilePath)) { - logger.error(red, `ETS:ERROR ${cacheAbcFilePath} is lost`, reset); + logger.debug(red, `ETS:ERROR ${cacheAbcFilePath} is lost`, reset); break; } let parent: string = path.join(abcFile, '..'); diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index 14d5ffe..757ad41 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -85,7 +85,7 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma const child = childProcess.exec(gen_abc_cmd); child.on('exit', (code: any) => { if (code === 1) { - logger.error(red, "ETS:ERROR failed to execute es2abc", reset); + logger.debug(red, "ETS:ERROR failed to execute es2abc", reset); } }); @@ -93,7 +93,7 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma logger.error(red, err.toString(), reset); }); } catch (e) { - logger.error(red, `ETS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); + logger.debug(red, `ETS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); process.exit(FAIL); } } \ No newline at end of file diff --git a/compiler/src/gen_module_abc.ts b/compiler/src/gen_module_abc.ts index 1426cee..76aac81 100644 --- a/compiler/src/gen_module_abc.ts +++ b/compiler/src/gen_module_abc.ts @@ -47,7 +47,7 @@ function js2abcByWorkers(jsonInput: string, cmd: string): Promise { try { childProcess.execSync(singleCmd); } catch (e) { - logger.error(red, `ETS:ERROR Failed to convert file ${inputsStr} to abc `, reset); + logger.debug(red, `ETS:ERROR Failed to convert file ${inputsStr} to abc `, reset); process.exit(FAIL); } } @@ -65,7 +65,7 @@ function es2abcByWorkers(jsonInput: string, cmd: string): Promise { try { childProcess.execSync(singleCmd); } catch (e) { - logger.error(red, `ETS:ERROR Failed to convert file ${input} to abc `, reset); + logger.debug(red, `ETS:ERROR Failed to convert file ${input} to abc `, reset); process.exit(FAIL); } } -- Gitee From 23961346e175f3af35ffc23d0662c597f2f56b73 Mon Sep 17 00:00:00 2001 From: laibo102 Date: Wed, 14 Sep 2022 15:29:41 +0800 Subject: [PATCH 008/379] Update: deleted the transform of 'markDependexxxDirty' Signed-off-by: laibo102 Change-Id: I11e32b4075c6135c83453808c22f894215d7f157 --- compiler/src/process_component_class.ts | 8 ++---- compiler/src/process_component_member.ts | 26 ------------------- .../render_component/foreach/foreach.ts | 1 - .../render_component/if/if.ts | 3 --- .../@link/@link.ts | 2 -- .../@objectLink/@objectLink.ts | 2 -- .../@prop/@prop.ts | 2 -- .../@state/@state.ts | 1 - 8 files changed, 2 insertions(+), 43 deletions(-) diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index eef49ba..d8c68a1 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -187,7 +187,7 @@ function processMembers(members: ts.NodeArray, parentComponentN if (result.getControllerSet()) { newMembers.push(result.getControllerSet()); } - processPropertyUnchanged(result, purgeVariableDepStatements, rerenderStatements); + processPropertyUnchanged(result, purgeVariableDepStatements); } } if (ts.isMethodDeclaration(item) && item.name) { @@ -225,16 +225,12 @@ function validateDecorators(item: ts.ClassElement, log: LogInfo[]): void { function processPropertyUnchanged( result: UpdateResult, - purgeVariableDepStatements: ts.Statement[], - rerenderStatements: ts.Statement[] + purgeVariableDepStatements: ts.Statement[] ): void { if (partialUpdateConfig.partialUpdateMode) { if(result.getPurgeVariableDepStatement()) { purgeVariableDepStatements.push(result.getPurgeVariableDepStatement()); } - if(result.getRerenderStatement()) { - rerenderStatements.push(result.getRerenderStatement()); - } } } diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 7923364..95baa23 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -144,7 +144,6 @@ export class UpdateResult { private deleteParams: boolean = false; private controllerSet: ts.MethodDeclaration; private purgeVariableDepStatement: ts.Statement; - private rerenderStatement: ts.Statement; private decoratorName: string; public setProperity(updateItem: ts.PropertyDeclaration) { @@ -185,10 +184,6 @@ export class UpdateResult { this.purgeVariableDepStatement = purgeVariableDepStatement; } - public setRerenderStatement(rerenderStatement: ts.Statement) { - this.rerenderStatement = rerenderStatement; - } - public setDecoratorName(decoratorName: string) { this.decoratorName = decoratorName; } @@ -217,10 +212,6 @@ export class UpdateResult { return this.purgeVariableDepStatement; } - public getRerenderStatement(): ts.Statement { - return this.rerenderStatement; - } - public getVariableGet(): ts.GetAccessorDeclaration { return this.variableGet; } @@ -365,7 +356,6 @@ function processStateDecorators(node: ts.PropertyDeclaration, decorator: string, const variableWithUnderLink: string = '__' + name.escapedText.toString(); updateResult.setDecoratorName(decorator); updateResult.setPurgeVariableDepStatement(createPurgeVariableDepStatement(variableWithUnderLink)); - updateResult.setRerenderStatement(createRerenderStatement(variableWithUnderLink)); } } @@ -385,22 +375,6 @@ function createPurgeVariableDepStatement(variableWithUnderLink: string): ts.Stat ); } -function createRerenderStatement(variableWithUnderLink: string): ts.Statement { - return ts.factory.createExpressionStatement( - ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression( - ts.factory.createPropertyAccessExpression( - ts.factory.createThis(), - ts.factory.createIdentifier(variableWithUnderLink) - ), - ts.factory.createIdentifier(MARKDEPENDENTELEMENTSDIRTY) - ), - undefined, - [ts.factory.createThis()] - ) - ); -} - function processWatch(node: ts.PropertyDeclaration, decorator: ts.Decorator, watchMap: Map, log: LogInfo[]): void { if (node.name) { diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts index 09e3232..c572f06 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts @@ -92,7 +92,6 @@ class ParentView extends ViewPU { List.pop(); } rerender() { - this.__arr.markDependentElementsDirty(this); this.updateDirtyElements(); } } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts index 6a79a06..48971c3 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts @@ -156,9 +156,6 @@ class IFView extends ViewPU { Column.pop(); } rerender() { - this.__toggle1.markDependentElementsDirty(this); - this.__toggle2.markDependentElementsDirty(this); - this.__toggle3.markDependentElementsDirty(this); this.updateDirtyElements(); } } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts index aaef837..023742b 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts @@ -69,7 +69,6 @@ class LinkComponent extends ViewPU { Text.pop(); } rerender() { - this.__counter.markDependentElementsDirty(this); this.updateDirtyElements(); } } @@ -116,7 +115,6 @@ class ParentComponent extends ViewPU { Column.pop(); } rerender() { - this.__value.markDependentElementsDirty(this); this.updateDirtyElements(); } } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts index 1b92a88..e597bab 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts @@ -112,7 +112,6 @@ class CustomText extends ViewPU { Row.pop(); } rerender() { - this.__model.markDependentElementsDirty(this); this.updateDirtyElements(); } } @@ -178,7 +177,6 @@ class Parent extends ViewPU { Column.pop(); } rerender() { - this.__models.markDependentElementsDirty(this); this.updateDirtyElements(); } } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts index a74de3a..35a9414 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts @@ -69,7 +69,6 @@ class PropComponent extends ViewPU { Text.pop(); } rerender() { - this.__counter.markDependentElementsDirty(this); this.updateDirtyElements(); } } @@ -116,7 +115,6 @@ class ParentComponent extends ViewPU { Column.pop(); } rerender() { - this.__value.markDependentElementsDirty(this); this.updateDirtyElements(); } } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@state/@state.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@state/@state.ts index c895d07..4ed4329 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@state/@state.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@state/@state.ts @@ -73,7 +73,6 @@ class StatePage extends ViewPU { Column.pop(); } rerender() { - this.__counter.markDependentElementsDirty(this); this.updateDirtyElements(); } } -- Gitee From 5403eb5fdc820a40d0004b15fefee64002f4e110 Mon Sep 17 00:00:00 2001 From: bojiang Date: Tue, 13 Sep 2022 17:30:56 +0800 Subject: [PATCH 009/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I50405aa3467d5ee6f17bbc149773b70237b37290 --- compiler/src/process_component_build.ts | 33 ++++++------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index f74c70e..58e82b1 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1270,7 +1270,7 @@ interface AnimationInfo { export function bindComponentAttr(node: ts.ExpressionStatement, identifierNode: ts.Identifier, newStatements: ts.Statement[], log: LogInfo[], reverse: boolean = true, - isStylesAttr: boolean = false, isGlobalStyles: boolean = false): void { + isStylesAttr: boolean = false): void { let temp: any = node.expression; const statements: ts.Statement[] = []; const lastStatement: AnimationInfo = { statement: null, kind: false }; @@ -1307,7 +1307,7 @@ export function bindComponentAttr(node: ts.ExpressionStatement, identifierNode: temp.expression.name && ts.isIdentifier(temp.expression.name) && !componentCollection.customComponents.has(temp.expression.name.getText())) { addComponentAttr(temp, temp.expression.name, lastStatement, statements, identifierNode, log, - isStylesAttr, isGlobalStyles); + isStylesAttr); temp = temp.expression.expression; flag = true; } else if (ts.isIdentifier(temp.expression)) { @@ -1315,7 +1315,7 @@ export function bindComponentAttr(node: ts.ExpressionStatement, identifierNode: !GESTURE_TYPE_NAMES.has(temp.expression.getText()) && !componentCollection.customComponents.has(temp.expression.getText())) { addComponentAttr(temp, temp.expression, lastStatement, statements, identifierNode, log, - isStylesAttr, isGlobalStyles); + isStylesAttr); } break; } @@ -1580,7 +1580,7 @@ function verifyComponentId(temp: any, node: ts.Identifier, propName: string, function addComponentAttr(temp: any, node: ts.Identifier, lastStatement: any, statements: ts.Statement[], identifierNode: ts.Identifier, log: LogInfo[], - isStylesAttr: boolean, isGlobalStyles: boolean): void { + isStylesAttr: boolean): void { const propName: string = node.getText(); verifyComponentId(temp, node, propName, log); if (propName === ATTRIBUTE_ANIMATION) { @@ -1617,13 +1617,8 @@ function addComponentAttr(temp: any, node: ts.Identifier, lastStatement: any, } else if (GLOBAL_STYLE_FUNCTION.has(propName) || INNER_STYLE_FUNCTION.has(propName)) { const styleBlock: ts.Block = GLOBAL_STYLE_FUNCTION.get(propName) || INNER_STYLE_FUNCTION.get(propName); - if (GLOBAL_STYLE_FUNCTION.has(propName)) { - bindComponentAttr(styleBlock.statements[0] as ts.ExpressionStatement, identifierNode, - statements, log, false, true, true); - } else { - bindComponentAttr(styleBlock.statements[0] as ts.ExpressionStatement, identifierNode, - statements, log, false, true, false); - } + bindComponentAttr(styleBlock.statements[0] as ts.ExpressionStatement, identifierNode, + statements, log, false, true); lastStatement.kind = true; } else if (isDoubleDollarToChange(isStylesAttr, identifierNode, propName, temp)) { const argumentsArr: ts.Expression[] = []; @@ -1637,7 +1632,7 @@ function addComponentAttr(temp: any, node: ts.Identifier, lastStatement: any, validateStateStyleSyntax(temp, log); } } - temp = loopEtscomponent(temp, isStylesAttr, isGlobalStyles); + temp = loopEtscomponent(temp, isStylesAttr); statements.push(ts.factory.createExpressionStatement( createFunction(identifierNode, node, temp.arguments))); lastStatement.kind = true; @@ -1675,11 +1670,8 @@ function isHaveDoubleDollar(param: ts.PropertyAssignment, name: string): boolean param.initializer.getText().startsWith($$); } -function loopEtscomponent(node: any, isStylesAttr: boolean, isGlobalStyles: boolean): ts.Node { +function loopEtscomponent(node: any, isStylesAttr: boolean): ts.Node { node.arguments.forEach((item: ts.Node, index: number) => { - if (isStylesAttr && isGlobalStyles) { - node.arguments[index] = traverseStylesAttr(item); - } if (ts.isEtsComponentExpression(item)) { node.arguments[index] = ts.factory.createCallExpression( item.expression, undefined, item.arguments); @@ -1712,15 +1704,6 @@ function classifyArgumentsNum(args: any, argumentsArr: ts.Expression[], propName } } -function traverseStylesAttr(node: ts.Node): ts.Node { - if (ts.isStringLiteral(node)) { - node = ts.factory.createStringLiteral(node.text); - } else if (ts.isNumericLiteral(node)) { - node = ts.factory.createNumericLiteral(node.text); - } - return ts.visitEachChild(node, childNode => traverseStylesAttr(childNode), contextGlobal); -} - function generateObjectFor$$(varExp: ts.Expression): ts.ObjectLiteralExpression { return ts.factory.createObjectLiteralExpression( [ -- Gitee From 514ed10f44eaba89d446d3f22535ae4eaf57ff69 Mon Sep 17 00:00:00 2001 From: bojiang Date: Thu, 15 Sep 2022 17:07:26 +0800 Subject: [PATCH 010/379] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 低代码支持自定义组件的基础功能,包括编译,预览,调试 Signed-off-by: bojiang Change-Id: I7968aa9a00b37b4e0f7b4c37c76f6c751483488e --- compiler/src/pre_process.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/src/pre_process.ts b/compiler/src/pre_process.ts index b42751d..8347e85 100644 --- a/compiler/src/pre_process.ts +++ b/compiler/src/pre_process.ts @@ -61,7 +61,7 @@ function preProcess(source: string): string { function parseVisual(resourcePath: string, resourceQuery: string, content: string, log: LogInfo[], source: string): string { - if (!componentCollection.entryComponent || !projectConfig.aceSuperVisualPath) { + if (!(componentCollection.entryComponent || componentCollection.customComponents) || !projectConfig.aceSuperVisualPath) { return content; } const visualPath: string = findVisualFile(resourcePath); @@ -100,8 +100,7 @@ function parseVisual(resourcePath: string, resourceQuery: string, content: strin function parseStatement(statement: ts.Statement, content: string, log: LogInfo[], visualContent: any): string { - if (statement.kind === ts.SyntaxKind.StructDeclaration && - statement.name && statement.name.getText() === componentCollection.entryComponent) { + if (statement.kind === ts.SyntaxKind.StructDeclaration && statement.name) { if (statement.members) { statement.members.forEach(member => { if (member.kind && member.kind === ts.SyntaxKind.MethodDeclaration) { @@ -260,7 +259,7 @@ function generateSourceMapForNewAndOriEtsFile(resourcePath: string, content: str const visualDirPath: string = path.parse(resourcePath).dir; const etsDirPath: string = path.parse(projectConfig.projectPath).dir; const visualMapDirPath: string = path.resolve(process.env.cachePath, SUPERVISUAL + - visualDirPath.replace(etsDirPath, '')); + (visualDirPath.includes(etsDirPath) ? visualDirPath.replace(etsDirPath, '') : '')); if (!(fs.existsSync(visualMapDirPath) && fs.statSync(visualMapDirPath).isDirectory())) { mkDir(visualMapDirPath); } @@ -274,7 +273,7 @@ function generateSourceMapForNewAndOriEtsFile(resourcePath: string, content: str function findVisualFile(filePath: string): string { const visualPath: string = filePath.replace(projectConfig.projectPath, projectConfig.aceSuperVisualPath).replace('.ets', '.visual'); - return visualPath; + return visualPath.replace('ets', 'supervisual'); } function getVisualContent(visualPath: string, log: LogInfo[]): any { -- Gitee From f1f103c38d3c9d8f9e15d81388d63ce62c516f1f Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Wed, 14 Sep 2022 11:15:18 +0800 Subject: [PATCH 011/379] Implement different page of incre compile Signed-off-by: zhangrengao Change-Id: I4118c2b1e76ef4631c8fec1526a1cb76b584d3d8 --- compiler/src/gen_abc_plugin.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index f60924d..86fb24c 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -423,7 +423,9 @@ function writeFileSync(inputString: string, buildPath: string, keyPath: string, } let cacheOutputPath: string = ""; if (process.env.cachePath) { - cacheOutputPath = path.join(process.env.cachePath, TEMPORARY, keyPath); + let buildDirArr = projectConfig.buildPath.split(path.sep); + let buildDirPath = buildDirArr[buildDirArr.length - 1]; + cacheOutputPath = path.join(process.env.cachePath, TEMPORARY, buildDirPath, keyPath); } else { cacheOutputPath = output; } @@ -910,7 +912,11 @@ function genHashJsonPath(buildPath: string): string { logger.debug(red, `ETS:ERROR hash path does not exist`, reset); return ''; } - return path.join(process.env.cachePath, hashFile); + let buildDirArr = projectConfig.buildPath.split(path.sep); + let buildDirPath = buildDirArr[buildDirArr.length - 1]; + let hashJsonPath = path.join(process.env.cachePath, TEMPORARY, buildDirPath, hashFile); + mkdirsSync(path.dirname(hashJsonPath)); + return hashJsonPath; } else if (buildPath.indexOf(ARK) >= 0) { const dataTmps: string[] = buildPath.split(ARK); const hashPath: string = path.join(dataTmps[0], ARK); @@ -951,6 +957,7 @@ function copyFileCachePathToBuildPath() { const cacheAbcFilePath: string = intermediateJsBundle[i].cacheOutputPath.replace(/\.temp\.js$/, ".abc"); if (!fs.existsSync(cacheAbcFilePath)) { logger.debug(red, `ETS:ERROR ${cacheAbcFilePath} is lost`, reset); + process.exitCode = FAIL; break; } let parent: string = path.join(abcFile, '..'); -- Gitee From 3c4fecbbc74a99cc3026424b778360dd5e839c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 16 Sep 2022 02:03:17 +0000 Subject: [PATCH 012/379] update compiler/webpack.config.js. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/webpack.config.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index c25f619..9b3fd95 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -236,7 +236,7 @@ function setReleaseConfig(config) { }; } -function setCopyPluginConfig(config) { +function setCopyPluginConfig(config, appResource, isPreview) { const copyPluginPattrens = []; copyPluginPattrens.push({ from: '**/*', @@ -281,20 +281,18 @@ function setCopyPluginConfig(config) { }); } } - config.plugins.push(new CopyPlugin({ patterns: copyPluginPattrens })); -} - -function addResourceTableWatch(config, appResource) { - if (appResource && fs.existsSync(appResource) && !projectConfig.xtsMode) { - const copyPluginPattrens = []; + if (appResource && fs.existsSync(appResource) && !projectConfig.xtsMode && + isPreview == 'true') { copyPluginPattrens.push({ from: path.resolve(__dirname, appResource), to: path.resolve(__dirname, projectConfig.cachePath) }); - config.plugins.push(new CopyPlugin({ patterns: copyPluginPattrens })); } + config.plugins.push(new CopyPlugin({ patterns: copyPluginPattrens })); } + + function excludeWorker(workerFile, name) { if (workerFile) { return Object.keys(workerFile).includes(name); @@ -393,7 +391,7 @@ module.exports = (env, argv) => { initConfig(config); const workerFile = readWorkerFile(); setOptimizationConfig(config, workerFile); - setCopyPluginConfig(config); + setCleanWebpackPlugin(workerFile, config); if (env.isPreview !== "true") { @@ -426,9 +424,7 @@ module.exports = (env, argv) => { const appResourcePath = env.appResource || process.env.appResource; checkAppResourcePath(appResourcePath, config); - if (env.isPreview == 'true') { - addResourceTableWatch(config); - } + setCopyPluginConfig(config, appResourcePath, env.isPreview); addSDKBuildDependencies(config); config.output.library = projectConfig.hashProjectPath; return config; -- Gitee From 5edb37ab581f7b0c383fdc6f4db6a0ba81f8e796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 16 Sep 2022 02:05:24 +0000 Subject: [PATCH 013/379] update compiler/webpack.config.js. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/webpack.config.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 9b3fd95..94db056 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -291,8 +291,6 @@ function setCopyPluginConfig(config, appResource, isPreview) { config.plugins.push(new CopyPlugin({ patterns: copyPluginPattrens })); } - - function excludeWorker(workerFile, name) { if (workerFile) { return Object.keys(workerFile).includes(name); @@ -391,7 +389,6 @@ module.exports = (env, argv) => { initConfig(config); const workerFile = readWorkerFile(); setOptimizationConfig(config, workerFile); - setCleanWebpackPlugin(workerFile, config); if (env.isPreview !== "true") { -- Gitee From 0265b39a255ec6449ee44d87cd22a3f0f942a728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 16 Sep 2022 02:33:36 +0000 Subject: [PATCH 014/379] update compiler/webpack.config.js. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 94db056..19b296c 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -282,7 +282,7 @@ function setCopyPluginConfig(config, appResource, isPreview) { } } if (appResource && fs.existsSync(appResource) && !projectConfig.xtsMode && - isPreview == 'true') { + isPreview === 'true') { copyPluginPattrens.push({ from: path.resolve(__dirname, appResource), to: path.resolve(__dirname, projectConfig.cachePath) -- Gitee From 767662b5057b737cbd03536b73512b099dde724d Mon Sep 17 00:00:00 2001 From: laibo102 Date: Fri, 16 Sep 2022 10:37:21 +0800 Subject: [PATCH 015/379] Bugfix: fixed lazyForEach without key parameter Signed-off-by: laibo102 Change-Id: I8a66e9756cd2a12fc2b11b162b359b2e5ef39278 --- compiler/src/process_component_build.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 58e82b1..ac03436 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1044,6 +1044,15 @@ function addForEachIdFuncParameter(argumentsArray: ts.Expression[]): ts.Identifi } function createLazyForEachStatement(argumentsArray: ts.Expression[]): ts.ExpressionStatement { + const parameterList: ts.Expression[] = [ + ts.factory.createStringLiteral(componentInfo.id.toString()), + ts.factory.createThis(), + argumentsArray[0], + ts.factory.createIdentifier(__LAZYFOREACHITEMGENFUNCTION) + ]; + if (argumentsArray.length >= 3 && argumentsArray[2]) { + parameterList.push(ts.factory.createIdentifier(__LAZYFOREACHITEMIDFUNC)); + } return ts.factory.createExpressionStatement( ts.factory.createCallExpression( ts.factory.createPropertyAccessExpression( @@ -1051,12 +1060,7 @@ function createLazyForEachStatement(argumentsArray: ts.Expression[]): ts.Express ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION) ), undefined, - [ts.factory.createStringLiteral(componentInfo.id.toString()), - ts.factory.createThis(), - argumentsArray[0], - ts.factory.createIdentifier(__LAZYFOREACHITEMGENFUNCTION), - ts.factory.createIdentifier(__LAZYFOREACHITEMIDFUNC) - ] + parameterList ) ); } -- Gitee From afb7974408e07609c3fcec609856a4920bb56ee3 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Fri, 9 Sep 2022 01:24:19 +0800 Subject: [PATCH 016/379] houhaoyu@huawei.com watch all files Signed-off-by: houhaoyu Change-Id: I1eeb6ea4c45009adfe141203c421c9ebae5b2ad0 --- compiler/main.js | 14 +++++++------- compiler/src/compile_info.ts | 29 +++++++++++++++++------------ compiler/webpack.config.js | 5 +---- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 0e33922..0d4fdb0 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -65,17 +65,11 @@ function initProjectConfig(projectConfig) { projectConfig.cachePath = projectConfig.cachePath || process.env.cachePath || path.resolve(__dirname, 'node_modules/.cache'); projectConfig.aceSoPath = projectConfig.aceSoPath || process.env.aceSoPath; - projectConfig.outChangedFileList = getChangedFileList(projectConfig); projectConfig.xtsMode = /ets_loader_ark$/.test(__dirname); projectConfig.localPropertiesPath = projectConfig.localPropertiesPath || process.env.localPropertiesPath projectConfig.projectProfilePath = projectConfig.projectProfilePath || process.env.projectProfilePath } -function getChangedFileList(projectConfig) { - return (projectConfig.hotReloadWatch && projectConfig.hotReloadWatch.outChangedFileList) ? - projectConfig.hotReloadWatch.outChangedFileList : path.join(projectConfig.cachePath, 'changedFileList.json'); -} - function loadEntryObj(projectConfig) { let manifest = {}; initProjectConfig(projectConfig); @@ -299,7 +293,7 @@ function loadWorker(projectConfig, workerFileEntry) { } } -function readWorkerFile() { +function readWorkerFile(isPreview) { const workerFileEntry = {}; if (projectConfig.aceBuildJson && fs.existsSync(projectConfig.aceBuildJson)) { const workerConfig = JSON.parse(fs.readFileSync(projectConfig.aceBuildJson).toString()); @@ -315,6 +309,12 @@ function readWorkerFile() { }); return workerFileEntry; } + if (workerConfig.patchConfig) { + projectConfig.hotReload = process.env.watchMode === 'true' && isPreview !== 'true'; + projectConfig.patchAbcPath = workerConfig.patchConfig.patchAbcPath; + projectConfig.changedFileList = workerConfig.patchConfig.changedFileList ? + workerConfig.patchConfig.changedFileList : path.join(projectConfig.cachePath, 'changedFileList.json'); + } } return null; } diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 8915de3..b913cc4 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -70,6 +70,11 @@ interface Info { }; } +interface filesObj { + modifiedFiles: string[], + removedFiles: string[] +} + export interface CacheFileName { mtimeMs: number, children: string[], @@ -84,6 +89,7 @@ interface NeedUpdateFlag { export let cache: Cache = {}; export const shouldResolvedFiles: Set = new Set() type Cache = Record; +let allModifiedFiles: Set = new Set(); export class ResultStates { private mStats: Stats; @@ -231,7 +237,7 @@ export class ResultStates { comp.modifiedFiles = comp.modifiedFiles || []; comp.removedFiles = comp.removedFiles || []; const watchModifiedFiles: string[] = [...comp.modifiedFiles]; - const watchRemovedFiles: string[] = [...comp.removedFiles]; + let watchRemovedFiles: string[] = [...comp.removedFiles]; if (watchModifiedFiles.length) { const isTsAndEtsFile: boolean = watchModifiedFiles.some((item: string) => { return /.(ts|ets)$/.test(item); @@ -241,17 +247,16 @@ export class ResultStates { } } if (this.shouldWriteChangedList(watchModifiedFiles, watchRemovedFiles)) { - interface filesObj { - modifiedFiles: string[], - removedFiles: string[] - } + watchRemovedFiles = watchRemovedFiles.map(file => path.relative(projectConfig.projectPath, file)); + allModifiedFiles = new Set([...allModifiedFiles, ...watchModifiedFiles + .filter(file => fs.statSync(file).isFile()) + .map(file => path.relative(projectConfig.projectPath, file))] + .filter(file => !watchRemovedFiles.includes(file))); const filesObj: filesObj = { - modifiedFiles: watchModifiedFiles.filter((file) => { - return fs.statSync(file).isFile(); - }), - removedFiles: watchRemovedFiles + modifiedFiles: [...allModifiedFiles], + removedFiles: [...watchRemovedFiles] }; - writeFileSync(projectConfig.outChangedFileList, JSON.stringify(filesObj)); + writeFileSync(projectConfig.changedFileList, JSON.stringify(filesObj)); } const changedFiles: string[] = [...watchModifiedFiles, ...watchRemovedFiles]; if (changedFiles.length) { @@ -282,8 +287,8 @@ export class ResultStates { private shouldWriteChangedList(watchModifiedFiles: string[], watchRemovedFiles: string[]): boolean { return projectConfig.compileMode === ESMODULE && process.env.watchMode === 'true' && !projectConfig.isPreview && - projectConfig.outChangedFileList && (watchRemovedFiles.length + watchModifiedFiles.length) && - !(watchModifiedFiles.length === 1 && watchModifiedFiles[0] == projectConfig.projectPath); + projectConfig.changedFileList && (watchRemovedFiles.length + watchModifiedFiles.length) && + !(watchModifiedFiles.length === 1 && watchModifiedFiles[0] == projectConfig.projectPath && !watchRemovedFiles.length); } private judgeFileShouldResolved(file: string, shouldResolvedFiles: Set): void { diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 0dadde6..7659937 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -199,9 +199,6 @@ function setProjectConfig(envArgs) { if (envArgs.cachePath) { projectConfig.cachePath = envArgs.cachePath; } - if (envArgs.watchMode) { - projectConfig.hotReloadWatch = envArgs.watchMode; - } } function setReleaseConfig(config) { @@ -380,7 +377,7 @@ module.exports = (env, argv) => { loadModuleInfo(projectConfig, env); setTsConfigFile(); initConfig(config); - const workerFile = readWorkerFile(); + const workerFile = readWorkerFile(env.isPreview); setOptimizationConfig(config, workerFile); setCopyPluginConfig(config); setCleanWebpackPlugin(workerFile, config); -- Gitee From a771ddbcde825d3495db1820acd87407d5023858 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Thu, 15 Sep 2022 17:24:24 +0800 Subject: [PATCH 017/379] fixed 31be517 from https://gitee.com/houhaoyu/developtools_ace-ets2bundle/pulls/1125 houhaoyu@huawei.com fix this.$ Signed-off-by: houhaoyu Change-Id: Ic7abb7de415cda68fb07b18b63f695619d1f00cb --- compiler/src/process_component_class.ts | 4 ++++ compiler/src/process_custom_component.ts | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index d8c68a1..666119e 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -508,6 +508,10 @@ export function createReference(node: ts.PropertyAssignment, log: LogInfo[]): ts if (ts.isIdentifier(initExpression) && initExpression.escapedText.toString().match(LINK_REG)) { initText = initExpression.escapedText.toString().replace(LINK_REG, ''); + } else if (ts.isPropertyAccessExpression(initExpression) && initExpression.expression && + initExpression.expression.kind === ts.SyntaxKind.ThisKeyword && + ts.isIdentifier(initExpression.name) && initExpression.name.escapedText.toString().match(LINK_REG)) { + initText = initExpression.name.escapedText.toString().replace(LINK_REG, ''); } else if (isMatchInitExpression(initExpression) && linkParentComponent.includes(propertyName.escapedText.toString())) { initText = initExpression.name.escapedText.toString().replace(LINK_REG, ''); diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 7f6eeac..36545a3 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -289,7 +289,10 @@ function isThisProperty(node: ts.ObjectLiteralElementLike, propertySet: Set): boolean { if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && - node.initializer.escapedText && node.initializer.escapedText.includes('$')) { + (node.initializer.escapedText && node.initializer.escapedText.includes('$') || + ts.isPropertyAccessExpression(node.initializer) && node.initializer.expression && + node.initializer.expression.kind === ts.SyntaxKind.ThisKeyword && + ts.isIdentifier(node.initializer.name) && node.initializer.name.escapedText.toString().includes('$'))) { return false; } if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && -- Gitee From 5a7324d786646bf667ad722b366783d5715f7730 Mon Sep 17 00:00:00 2001 From: hufeng Date: Mon, 19 Sep 2022 09:39:58 +0800 Subject: [PATCH 018/379] Change the filesInfo's moduleType name Signed-off-by: hufeng Change-Id: I0896ee6d9d38967da36e7ca52909614814973315 --- compiler/src/gen_merged_abc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index 14d5ffe..559165b 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -49,7 +49,7 @@ function generateCompileFilesInfo(moduleInfos: Array) { const filesInfoPath: string = path.join(process.env.cachePath, FILESINFO_TXT); let filesInfo: string = ''; moduleInfos.forEach(info => { - const moduleType: string = info.isCommonJs ? 'cjs' : 'esm'; + const moduleType: string = info.isCommonJs ? 'commonjs' : 'esm'; filesInfo += `${info.tempFilePath};${info.recordName};${moduleType}\n`; }); fs.writeFileSync(filesInfoPath, filesInfo, 'utf-8'); -- Gitee From 6f30d6e6d50d41b2b2f0ab7cbceb3c90c411cde2 Mon Sep 17 00:00:00 2001 From: laibo102 Date: Mon, 19 Sep 2022 11:05:07 +0800 Subject: [PATCH 019/379] Update: updated IF component transform Signed-off-by: laibo102 Change-Id: Iaec2fc22b4052bd3e6f684e98283c0ccc0e79f47 --- compiler/src/pre_define.ts | 1 + compiler/src/process_component_build.ts | 24 +++++- .../render_component/if/if.ts | 76 ++++++++++--------- 3 files changed, 62 insertions(+), 39 deletions(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index e7aa6ee..e8e531b 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -325,3 +325,4 @@ export const SYNCHED_PROPERTY_NESED_OBJECT_PU: string = 'SynchedPropertyNesedObj export const OBSERVED_PROPERTY_ABSTRACT_PU:string = 'ObservedPropertyAbstractPU'; export const COMPONENT_CONSTRUCTOR_LOCALSTORAGE_PU: string = '__localStorage'; export const COMPONENT_CONSTRUCTOR_LOCALSTORAGE_TYPE_PU: string = 'LocalStorage'; +export const IFELSEBRANCHUPDATEFUNCTION = 'ifElseBranchUpdateFunction'; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index ac03436..f306837 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -85,7 +85,8 @@ import { GRID_COMPONENT, WILLUSEPROXY, TABCONTENT_COMPONENT, - GLOBAL_THIS + GLOBAL_THIS, + IFELSEBRANCHUPDATEFUNCTION } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -1170,7 +1171,11 @@ function processThenStatement(thenStatement: ts.Statement, id: number, } else if (ts.isIfStatement(thenStatement)) { thenStatement = processInnerIfStatement(thenStatement, 0, log, isInnerBuilder); thenStatement = ts.factory.createBlock( - [createIfCreate(), createIfBranchId(id), thenStatement, createIfPop()], true); + partialUpdateConfig.partialUpdateMode + ? [createIfCreate(), createIfBranchFunc(id, [thenStatement]), createIfPop()] + : [createIfCreate(), createIfBranchId(id), thenStatement, createIfPop()], + true + ); } else { thenStatement = ts.factory.createBlock([thenStatement], true); thenStatement = processIfBlock(thenStatement as ts.Block, id, log, isInnerBuilder); @@ -1199,7 +1204,13 @@ function processIfBlock(block: ts.Block, id: number, log: LogInfo[], isInnerBuil } function addIfBranchId(id: number, container: ts.Block): ts.Block { - return ts.factory.updateBlock(container, [createIfBranchId(id), ...container.statements]); + let containerStatements: ts.Statement[]; + if (partialUpdateConfig.partialUpdateMode) { + containerStatements = [createIfBranchFunc(id, [...container.statements])]; + } else { + containerStatements = [createIfBranchId(id), ...container.statements]; + } + return ts.factory.updateBlock(container, containerStatements); } function createIf(): ts.Identifier { @@ -1222,6 +1233,13 @@ function createIfBranchId(id: number): ts.ExpressionStatement { ts.factory.createNodeArray([ts.factory.createNumericLiteral(id)]))); } +function createIfBranchFunc(id: number, innerStatements: ts.Statement[]): ts.ExpressionStatement { + return ts.factory.createExpressionStatement(ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression( + ts.factory.createThis(), ts.factory.createIdentifier(IFELSEBRANCHUPDATEFUNCTION)), undefined, + [ts.factory.createNumericLiteral(id), ts.factory.createArrowFunction(undefined, undefined, [], undefined, + ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), ts.factory.createBlock(innerStatements, true))])); +} + interface CreateResult { newNode: ts.ExpressionStatement; identifierNode: ts.Identifier; diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts index 48971c3..8d6d2e0 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts @@ -100,52 +100,56 @@ class IFView extends ViewPU { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); If.create(); if (this.toggle1) { - If.branchId(0); - this.observeComponentCreation((elmtId, isInitialRender) => { - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - Text.create('toggle1'); - if (!isInitialRender) { - Text.pop(); - } - ViewStackProcessor.StopGetAccessRecording(); + this.ifElseBranchUpdateFunction(0, () => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('toggle1'); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); }); - Text.pop(); } else if (this.toggle2) { - If.branchId(1); - this.observeComponentCreation((elmtId, isInitialRender) => { - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - Text.create('toggle2'); - if (!isInitialRender) { - Text.pop(); - } - ViewStackProcessor.StopGetAccessRecording(); + this.ifElseBranchUpdateFunction(1, () => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('toggle2'); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); }); - Text.pop(); } else if (this.toggle3) { - If.branchId(2); - this.observeComponentCreation((elmtId, isInitialRender) => { - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - Text.create('toggle3'); - if (!isInitialRender) { - Text.pop(); - } - ViewStackProcessor.StopGetAccessRecording(); + this.ifElseBranchUpdateFunction(2, () => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('toggle3'); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); }); - Text.pop(); } else { - If.branchId(3); - this.observeComponentCreation((elmtId, isInitialRender) => { - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - Text.create('toggle no thing'); - if (!isInitialRender) { - Text.pop(); - } - ViewStackProcessor.StopGetAccessRecording(); + this.ifElseBranchUpdateFunction(3, () => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('toggle no thing'); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); }); - Text.pop(); } if (!isInitialRender) { If.pop(); -- Gitee From fabbcc836457f463b0b45a242898160348231f28 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 19 Sep 2022 11:30:30 +0800 Subject: [PATCH 020/379] houhaoyu@huawei.com update codegen Signed-off-by: houhaoyu Change-Id: I5700883f3d09d5ddc6ae268af480a79accf43f19 --- compiler/codegen/codegen_ets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/codegen/codegen_ets.js b/compiler/codegen/codegen_ets.js index 2a21775..7bfd28c 100644 --- a/compiler/codegen/codegen_ets.js +++ b/compiler/codegen/codegen_ets.js @@ -13,4 +13,4 @@ * limitations under the License. */ -(()=>{var e={486:function(e,t,r){var n;e=r.nmd(e),function(){var o,i="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",c=32,u=128,l=1/0,p=9007199254740991,f=NaN,d=4294967295,y=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",c],["partialRight",64],["rearg",256]],h="[object Arguments]",m="[object Array]",g="[object Boolean]",E="[object Date]",v="[object Error]",T="[object Function]",S="[object GeneratorFunction]",_="[object Map]",N="[object Number]",A="[object Object]",C="[object Promise]",w="[object RegExp]",b="[object Set]",R="[object String]",O="[object Symbol]",I="[object WeakMap]",M="[object ArrayBuffer]",P="[object DataView]",x="[object Float32Array]",L="[object Float64Array]",k="[object Int8Array]",F="[object Int16Array]",D="[object Int32Array]",U="[object Uint8Array]",B="[object Uint8ClampedArray]",G="[object Uint16Array]",z="[object Uint32Array]",j=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,H=RegExp($.source),Y=RegExp(q.source),Q=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,oe=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ae=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,pe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,ye=/^0b[01]+$/i,he=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,Ee=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,Te=/['\n\r\u2028\u2029\\]/g,Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="a-z\\xdf-\\xf6\\xf8-\\xff",Ne="A-Z\\xc0-\\xd6\\xd8-\\xde",Ae="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ce="["+Ae+"]",we="["+Se+"]",be="\\d+",Re="["+_e+"]",Oe="[^\\ud800-\\udfff"+Ae+be+"\\u2700-\\u27bf"+_e+Ne+"]",Ie="\\ud83c[\\udffb-\\udfff]",Me="[^\\ud800-\\udfff]",Pe="(?:\\ud83c[\\udde6-\\uddff]){2}",xe="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Ne+"]",ke="(?:"+Re+"|"+Oe+")",Fe="(?:"+Le+"|"+Oe+")",De="(?:['’](?:d|ll|m|re|s|t|ve))?",Ue="(?:['’](?:D|LL|M|RE|S|T|VE))?",Be="(?:"+we+"|"+Ie+")?",Ge="[\\ufe0e\\ufe0f]?",ze=Ge+Be+"(?:\\u200d(?:"+[Me,Pe,xe].join("|")+")"+Ge+Be+")*",je="(?:"+["[\\u2700-\\u27bf]",Pe,xe].join("|")+")"+ze,Ve="(?:"+[Me+we+"?",we,Pe,xe,"[\\ud800-\\udfff]"].join("|")+")",We=RegExp("['’]","g"),$e=RegExp(we,"g"),qe=RegExp(Ie+"(?="+Ie+")|"+Ve+ze,"g"),He=RegExp([Le+"?"+Re+"+"+De+"(?="+[Ce,Le,"$"].join("|")+")",Fe+"+"+Ue+"(?="+[Ce,Le+ke,"$"].join("|")+")",Le+"?"+ke+"+"+De,Le+"+"+Ue,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",be,je].join("|"),"g"),Ye=RegExp("[\\u200d\\ud800-\\udfff"+Se+"\\ufe0e\\ufe0f]"),Qe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Xe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Je=-1,Ke={};Ke[x]=Ke[L]=Ke[k]=Ke[F]=Ke[D]=Ke[U]=Ke[B]=Ke[G]=Ke[z]=!0,Ke[h]=Ke[m]=Ke[M]=Ke[g]=Ke[P]=Ke[E]=Ke[v]=Ke[T]=Ke[_]=Ke[N]=Ke[A]=Ke[w]=Ke[b]=Ke[R]=Ke[I]=!1;var Ze={};Ze[h]=Ze[m]=Ze[M]=Ze[P]=Ze[g]=Ze[E]=Ze[x]=Ze[L]=Ze[k]=Ze[F]=Ze[D]=Ze[_]=Ze[N]=Ze[A]=Ze[w]=Ze[b]=Ze[R]=Ze[O]=Ze[U]=Ze[B]=Ze[G]=Ze[z]=!0,Ze[v]=Ze[T]=Ze[I]=!1;var et={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tt=parseFloat,rt=parseInt,nt="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,ot="object"==typeof self&&self&&self.Object===Object&&self,it=nt||ot||Function("return this")(),at=t&&!t.nodeType&&t,st=at&&e&&!e.nodeType&&e,ct=st&&st.exports===at,ut=ct&&nt.process,lt=function(){try{return st&&st.require&&st.require("util").types||ut&&ut.binding&&ut.binding("util")}catch(e){}}(),pt=lt&<.isArrayBuffer,ft=lt&<.isDate,dt=lt&<.isMap,yt=lt&<.isRegExp,ht=lt&<.isSet,mt=lt&<.isTypedArray;function gt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Et(e,t,r,n){for(var o=-1,i=null==e?0:e.length;++o-1}function At(e,t,r){for(var n=-1,o=null==e?0:e.length;++n-1;);return r}function Ht(e,t){for(var r=e.length;r--&&xt(t,e[r],0)>-1;);return r}function Yt(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var Qt=Ut({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Xt=Ut({"&":"&","<":"<",">":">",'"':""","'":"'"});function Jt(e){return"\\"+et[e]}function Kt(e){return Ye.test(e)}function Zt(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function er(e,t){return function(r){return e(t(r))}}function tr(e,t){for(var r=-1,n=e.length,o=0,i=[];++r",""":'"',"'":"'"}),cr=function e(t){var r,n=(t=null==t?it:cr.defaults(it.Object(),t,cr.pick(it,Xe))).Array,oe=t.Date,Se=t.Error,_e=t.Function,Ne=t.Math,Ae=t.Object,Ce=t.RegExp,we=t.String,be=t.TypeError,Re=n.prototype,Oe=_e.prototype,Ie=Ae.prototype,Me=t["__core-js_shared__"],Pe=Oe.toString,xe=Ie.hasOwnProperty,Le=0,ke=(r=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Fe=Ie.toString,De=Pe.call(Ae),Ue=it._,Be=Ce("^"+Pe.call(xe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ge=ct?t.Buffer:o,ze=t.Symbol,je=t.Uint8Array,Ve=Ge?Ge.allocUnsafe:o,qe=er(Ae.getPrototypeOf,Ae),Ye=Ae.create,et=Ie.propertyIsEnumerable,nt=Re.splice,ot=ze?ze.isConcatSpreadable:o,at=ze?ze.iterator:o,st=ze?ze.toStringTag:o,ut=function(){try{var e=li(Ae,"defineProperty");return e({},"",{}),e}catch(e){}}(),lt=t.clearTimeout!==it.clearTimeout&&t.clearTimeout,It=oe&&oe.now!==it.Date.now&&oe.now,Ut=t.setTimeout!==it.setTimeout&&t.setTimeout,ur=Ne.ceil,lr=Ne.floor,pr=Ae.getOwnPropertySymbols,fr=Ge?Ge.isBuffer:o,dr=t.isFinite,yr=Re.join,hr=er(Ae.keys,Ae),mr=Ne.max,gr=Ne.min,Er=oe.now,vr=t.parseInt,Tr=Ne.random,Sr=Re.reverse,_r=li(t,"DataView"),Nr=li(t,"Map"),Ar=li(t,"Promise"),Cr=li(t,"Set"),wr=li(t,"WeakMap"),br=li(Ae,"create"),Rr=wr&&new wr,Or={},Ir=Bi(_r),Mr=Bi(Nr),Pr=Bi(Ar),xr=Bi(Cr),Lr=Bi(wr),kr=ze?ze.prototype:o,Fr=kr?kr.valueOf:o,Dr=kr?kr.toString:o;function Ur(e){if(rs(e)&&!$a(e)&&!(e instanceof jr)){if(e instanceof zr)return e;if(xe.call(e,"__wrapped__"))return Gi(e)}return new zr(e)}var Br=function(){function e(){}return function(t){if(!ts(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=o,r}}();function Gr(){}function zr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function jr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Vr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sn(e,t,r,n,i,a){var s,c=1&t,u=2&t,l=4&t;if(r&&(s=i?r(e,n,i,a):r(e)),s!==o)return s;if(!ts(e))return e;var p=$a(e);if(p){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&xe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!c)return Ro(e,s)}else{var f=di(e),d=f==T||f==S;if(Qa(e))return _o(e,c);if(f==A||f==h||d&&!i){if(s=u||d?{}:hi(e),!c)return u?function(e,t){return Oo(e,fi(e),t)}(e,function(e,t){return e&&Oo(t,xs(t),e)}(s,e)):function(e,t){return Oo(e,pi(e),t)}(e,rn(s,e))}else{if(!Ze[f])return i?e:{};s=function(e,t,r){var n,o=e.constructor;switch(t){case M:return No(e);case g:case E:return new o(+e);case P:return function(e,t){var r=t?No(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case x:case L:case k:case F:case D:case U:case B:case G:case z:return Ao(e,r);case _:return new o;case N:case R:return new o(e);case w:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return new o;case O:return n=e,Fr?Ae(Fr.call(n)):{}}}(e,f,c)}}a||(a=new Hr);var y=a.get(e);if(y)return y;a.set(e,s),ss(e)?e.forEach((function(n){s.add(sn(n,t,r,n,e,a))})):ns(e)&&e.forEach((function(n,o){s.set(o,sn(n,t,r,o,e,a))}));var m=p?o:(l?u?ni:ri:u?xs:Ps)(e);return vt(m||e,(function(n,o){m&&(n=e[o=n]),Zr(s,o,sn(n,t,r,o,e,a))})),s}function cn(e,t,r){var n=r.length;if(null==e)return!n;for(e=Ae(e);n--;){var i=r[n],a=t[i],s=e[i];if(s===o&&!(i in e)||!a(s))return!1}return!0}function un(e,t,r){if("function"!=typeof e)throw new be(i);return Ii((function(){e.apply(o,r)}),t)}function ln(e,t,r,n){var o=-1,i=Nt,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;r&&(t=Ct(t,Vt(r))),n?(i=At,a=!1):t.length>=200&&(i=$t,a=!1,t=new qr(t));e:for(;++o-1},Wr.prototype.set=function(e,t){var r=this.__data__,n=en(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new Vr,map:new(Nr||Wr),string:new Vr}},$r.prototype.delete=function(e){var t=ci(this,e).delete(e);return this.size-=t?1:0,t},$r.prototype.get=function(e){return ci(this,e).get(e)},$r.prototype.has=function(e){return ci(this,e).has(e)},$r.prototype.set=function(e,t){var r=ci(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},qr.prototype.add=qr.prototype.push=function(e){return this.__data__.set(e,a),this},qr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Hr.prototype.get=function(e){return this.__data__.get(e)},Hr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var n=r.__data__;if(!Nr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new $r(n)}return r.set(e,t),this.size=r.size,this};var pn=Po(vn),fn=Po(Tn,!0);function dn(e,t){var r=!0;return pn(e,(function(e,n,o){return r=!!t(e,n,o)})),r}function yn(e,t,r){for(var n=-1,i=e.length;++n0&&r(s)?t>1?mn(s,t-1,r,n,o):wt(o,s):n||(o[o.length]=s)}return o}var gn=xo(),En=xo(!0);function vn(e,t){return e&&gn(e,t,Ps)}function Tn(e,t){return e&&En(e,t,Ps)}function Sn(e,t){return _t(t,(function(t){return Ka(e[t])}))}function _n(e,t){for(var r=0,n=(t=Eo(t,e)).length;null!=e&&rt}function wn(e,t){return null!=e&&xe.call(e,t)}function bn(e,t){return null!=e&&t in Ae(e)}function Rn(e,t,r){for(var i=r?At:Nt,a=e[0].length,s=e.length,c=s,u=n(s),l=1/0,p=[];c--;){var f=e[c];c&&t&&(f=Ct(f,Vt(t))),l=gr(f.length,l),u[c]=!r&&(t||a>=120&&f.length>=120)?new qr(c&&f):o}f=e[0];var d=-1,y=u[0];e:for(;++d=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(Dn(e,(function(e,r,o){return{criteria:Ct(t,(function(t){return t(e)})),index:++n,value:e}})))}function Vn(e,t,r){for(var n=-1,o=t.length,i={};++n-1;)s!==e&&nt.call(s,c,1),nt.call(e,c,1);return e}function $n(e,t){for(var r=e?t.length:0,n=r-1;r--;){var o=t[r];if(r==n||o!==i){var i=o;gi(o)?nt.call(e,o,1):uo(e,o)}}return e}function qn(e,t){return e+lr(Tr()*(t-e+1))}function Hn(e,t){var r="";if(!e||t<1||t>p)return r;do{t%2&&(r+=e),(t=lr(t/2))&&(e+=e)}while(t);return r}function Yn(e,t){return Mi(Ci(e,t,oc),e+"")}function Qn(e){return Qr(zs(e))}function Xn(e,t){var r=zs(e);return Li(r,an(t,0,r.length))}function Jn(e,t,r,n){if(!ts(e))return e;for(var i=-1,a=(t=Eo(t,e)).length,s=a-1,c=e;null!=c&&++ii?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=n(i);++o>>1,a=e[i];null!==a&&!us(a)&&(r?a<=t:a=200){var u=t?null:Yo(e);if(u)return rr(u);a=!1,o=$t,c=new qr}else c=t?[]:s;e:for(;++n=n?e:to(e,t,r)}var So=lt||function(e){return it.clearTimeout(e)};function _o(e,t){if(t)return e.slice();var r=e.length,n=Ve?Ve(r):new e.constructor(r);return e.copy(n),n}function No(e){var t=new e.constructor(e.byteLength);return new je(t).set(new je(e)),t}function Ao(e,t){var r=t?No(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Co(e,t){if(e!==t){var r=e!==o,n=null===e,i=e==e,a=us(e),s=t!==o,c=null===t,u=t==t,l=us(t);if(!c&&!l&&!a&&e>t||a&&s&&u&&!c&&!l||n&&s&&u||!r&&u||!i)return 1;if(!n&&!a&&!l&&e1?r[i-1]:o,s=i>2?r[2]:o;for(a=e.length>3&&"function"==typeof a?(i--,a):o,s&&Ei(r[0],r[1],s)&&(a=i<3?o:a,i=1),t=Ae(t);++n-1?i[a?t[s]:s]:o}}function Uo(e){return ti((function(t){var r=t.length,n=r,a=zr.prototype.thru;for(e&&t.reverse();n--;){var s=t[n];if("function"!=typeof s)throw new be(i);if(a&&!c&&"wrapper"==ii(s))var c=new zr([],!0)}for(n=c?n:r;++n1&&v.reverse(),d&&pc))return!1;var l=a.get(e),p=a.get(t);if(l&&p)return l==t&&p==e;var f=-1,d=!0,y=2&r?new qr:o;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ie,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return vt(y,(function(r){var n="_."+r[0];t&r[1]&&!Nt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ae);return t?t[1].split(se):[]}(n),r)))}function xi(e){var t=0,r=0;return function(){var n=Er(),i=16-(n-r);if(r=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function Li(e,t){var r=-1,n=e.length,i=n-1;for(t=t===o?n:t;++r1?e[t-1]:o;return r="function"==typeof r?(e.pop(),r):o,aa(e,r)}));function da(e){var t=Ur(e);return t.__chain__=!0,t}function ya(e,t){return t(e)}var ha=ti((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,i=function(t){return on(t,e)};return!(t>1||this.__actions__.length)&&n instanceof jr&&gi(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:ya,args:[i],thisArg:o}),new zr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(o),e}))):this.thru(i)})),ma=Io((function(e,t,r){xe.call(e,r)?++e[r]:nn(e,r,1)})),ga=Do(Wi),Ea=Do($i);function va(e,t){return($a(e)?vt:pn)(e,si(t,3))}function Ta(e,t){return($a(e)?Tt:fn)(e,si(t,3))}var Sa=Io((function(e,t,r){xe.call(e,r)?e[r].push(t):nn(e,r,[t])})),_a=Yn((function(e,t,r){var o=-1,i="function"==typeof t,a=Ha(e)?n(e.length):[];return pn(e,(function(e){a[++o]=i?gt(t,e,r):On(e,t,r)})),a})),Na=Io((function(e,t,r){nn(e,r,t)}));function Aa(e,t){return($a(e)?Ct:Dn)(e,si(t,3))}var Ca=Io((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),wa=Yn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ei(e,t[0],t[1])?t=[]:r>2&&Ei(t[0],t[1],t[2])&&(t=[t[0]]),jn(e,mn(t,1),[])})),ba=It||function(){return it.Date.now()};function Ra(e,t,r){return t=r?o:t,t=e&&null==t?e.length:t,Xo(e,u,o,o,o,o,t)}function Oa(e,t){var r;if("function"!=typeof t)throw new be(i);return e=hs(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=o),r}}var Ia=Yn((function(e,t,r){var n=1;if(r.length){var o=tr(r,ai(Ia));n|=c}return Xo(e,n,t,r,o)})),Ma=Yn((function(e,t,r){var n=3;if(r.length){var o=tr(r,ai(Ma));n|=c}return Xo(t,n,e,r,o)}));function Pa(e,t,r){var n,a,s,c,u,l,p=0,f=!1,d=!1,y=!0;if("function"!=typeof e)throw new be(i);function h(t){var r=n,i=a;return n=a=o,p=t,c=e.apply(i,r)}function m(e){return p=e,u=Ii(E,t),f?h(e):c}function g(e){var r=e-l;return l===o||r>=t||r<0||d&&e-p>=s}function E(){var e=ba();if(g(e))return v(e);u=Ii(E,function(e){var r=t-(e-l);return d?gr(r,s-(e-p)):r}(e))}function v(e){return u=o,y&&n?h(e):(n=a=o,c)}function T(){var e=ba(),r=g(e);if(n=arguments,a=this,l=e,r){if(u===o)return m(l);if(d)return So(u),u=Ii(E,t),h(l)}return u===o&&(u=Ii(E,t)),c}return t=gs(t)||0,ts(r)&&(f=!!r.leading,s=(d="maxWait"in r)?mr(gs(r.maxWait)||0,t):s,y="trailing"in r?!!r.trailing:y),T.cancel=function(){u!==o&&So(u),p=0,n=l=a=u=o},T.flush=function(){return u===o?c:v(ba())},T}var xa=Yn((function(e,t){return un(e,1,t)})),La=Yn((function(e,t,r){return un(e,gs(t)||0,r)}));function ka(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new be(i);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(ka.Cache||$r),r}function Fa(e){if("function"!=typeof e)throw new be(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ka.Cache=$r;var Da=vo((function(e,t){var r=(t=1==t.length&&$a(t[0])?Ct(t[0],Vt(si())):Ct(mn(t,1),Vt(si()))).length;return Yn((function(n){for(var o=-1,i=gr(n.length,r);++o=t})),Wa=In(function(){return arguments}())?In:function(e){return rs(e)&&xe.call(e,"callee")&&!et.call(e,"callee")},$a=n.isArray,qa=pt?Vt(pt):function(e){return rs(e)&&An(e)==M};function Ha(e){return null!=e&&es(e.length)&&!Ka(e)}function Ya(e){return rs(e)&&Ha(e)}var Qa=fr||gc,Xa=ft?Vt(ft):function(e){return rs(e)&&An(e)==E};function Ja(e){if(!rs(e))return!1;var t=An(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!is(e)}function Ka(e){if(!ts(e))return!1;var t=An(e);return t==T||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Za(e){return"number"==typeof e&&e==hs(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=p}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var ns=dt?Vt(dt):function(e){return rs(e)&&di(e)==_};function os(e){return"number"==typeof e||rs(e)&&An(e)==N}function is(e){if(!rs(e)||An(e)!=A)return!1;var t=qe(e);if(null===t)return!0;var r=xe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Pe.call(r)==De}var as=yt?Vt(yt):function(e){return rs(e)&&An(e)==w},ss=ht?Vt(ht):function(e){return rs(e)&&di(e)==b};function cs(e){return"string"==typeof e||!$a(e)&&rs(e)&&An(e)==R}function us(e){return"symbol"==typeof e||rs(e)&&An(e)==O}var ls=mt?Vt(mt):function(e){return rs(e)&&es(e.length)&&!!Ke[An(e)]},ps=$o(Fn),fs=$o((function(e,t){return e<=t}));function ds(e){if(!e)return[];if(Ha(e))return cs(e)?ir(e):Ro(e);if(at&&e[at])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[at]());var t=di(e);return(t==_?Zt:t==b?rr:zs)(e)}function ys(e){return e?(e=gs(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function hs(e){var t=ys(e),r=t%1;return t==t?r?t-r:t:0}function ms(e){return e?an(hs(e),0,d):0}function gs(e){if("number"==typeof e)return e;if(us(e))return f;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=jt(e);var r=ye.test(e);return r||me.test(e)?rt(e.slice(2),r?2:8):de.test(e)?f:+e}function Es(e){return Oo(e,xs(e))}function vs(e){return null==e?"":so(e)}var Ts=Mo((function(e,t){if(_i(t)||Ha(t))Oo(t,Ps(t),e);else for(var r in t)xe.call(t,r)&&Zr(e,r,t[r])})),Ss=Mo((function(e,t){Oo(t,xs(t),e)})),_s=Mo((function(e,t,r,n){Oo(t,xs(t),e,n)})),Ns=Mo((function(e,t,r,n){Oo(t,Ps(t),e,n)})),As=ti(on),Cs=Yn((function(e,t){e=Ae(e);var r=-1,n=t.length,i=n>2?t[2]:o;for(i&&Ei(t[0],t[1],i)&&(n=1);++r1),t})),Oo(e,ni(e),r),n&&(r=sn(r,7,Zo));for(var o=t.length;o--;)uo(r,t[o]);return r})),Ds=ti((function(e,t){return null==e?{}:function(e,t){return Vn(e,t,(function(t,r){return Rs(e,r)}))}(e,t)}));function Us(e,t){if(null==e)return{};var r=Ct(ni(e),(function(e){return[e]}));return t=si(t),Vn(e,r,(function(e,r){return t(e,r[0])}))}var Bs=Qo(Ps),Gs=Qo(xs);function zs(e){return null==e?[]:Wt(e,Ps(e))}var js=ko((function(e,t,r){return t=t.toLowerCase(),e+(r?Vs(t):t)}));function Vs(e){return Js(vs(e).toLowerCase())}function Ws(e){return(e=vs(e))&&e.replace(Ee,Qt).replace($e,"")}var $s=ko((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),qs=ko((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Hs=Lo("toLowerCase"),Ys=ko((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Qs=ko((function(e,t,r){return e+(r?" ":"")+Js(t)})),Xs=ko((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Js=Lo("toUpperCase");function Ks(e,t,r){return e=vs(e),(t=r?o:t)===o?function(e){return Qe.test(e)}(e)?function(e){return e.match(He)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Zs=Yn((function(e,t){try{return gt(e,o,t)}catch(e){return Ja(e)?e:new Se(e)}})),ec=ti((function(e,t){return vt(t,(function(t){t=Ui(t),nn(e,t,Ia(e[t],e))})),e}));function tc(e){return function(){return e}}var rc=Uo(),nc=Uo(!0);function oc(e){return e}function ic(e){return Ln("function"==typeof e?e:sn(e,1))}var ac=Yn((function(e,t){return function(r){return On(r,e,t)}})),sc=Yn((function(e,t){return function(r){return On(e,r,t)}}));function cc(e,t,r){var n=Ps(t),o=Sn(t,n);null!=r||ts(t)&&(o.length||!n.length)||(r=t,t=e,e=this,o=Sn(t,Ps(t)));var i=!(ts(r)&&"chain"in r&&!r.chain),a=Ka(e);return vt(o,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(i||t){var r=e(this.__wrapped__),o=r.__actions__=Ro(this.__actions__);return o.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,wt([this.value()],arguments))})})),e}function uc(){}var lc=jo(Ct),pc=jo(St),fc=jo(Ot);function dc(e){return vi(e)?Dt(Ui(e)):function(e){return function(t){return _n(t,e)}}(e)}var yc=Wo(),hc=Wo(!0);function mc(){return[]}function gc(){return!1}var Ec,vc=zo((function(e,t){return e+t}),0),Tc=Ho("ceil"),Sc=zo((function(e,t){return e/t}),1),_c=Ho("floor"),Nc=zo((function(e,t){return e*t}),1),Ac=Ho("round"),Cc=zo((function(e,t){return e-t}),0);return Ur.after=function(e,t){if("function"!=typeof t)throw new be(i);return e=hs(e),function(){if(--e<1)return t.apply(this,arguments)}},Ur.ary=Ra,Ur.assign=Ts,Ur.assignIn=Ss,Ur.assignInWith=_s,Ur.assignWith=Ns,Ur.at=As,Ur.before=Oa,Ur.bind=Ia,Ur.bindAll=ec,Ur.bindKey=Ma,Ur.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $a(e)?e:[e]},Ur.chain=da,Ur.chunk=function(e,t,r){t=(r?Ei(e,t,r):t===o)?1:mr(hs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,s=0,c=n(ur(i/t));ai?0:i+r),(n=n===o||n>i?i:hs(n))<0&&(n+=i),n=r>n?0:ms(n);r>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!as(t))&&!(t=so(t))&&Kt(e)?To(ir(e),0,r):e.split(t,r):[]},Ur.spread=function(e,t){if("function"!=typeof e)throw new be(i);return t=null==t?0:mr(hs(t),0),Yn((function(r){var n=r[t],o=To(r,0,t);return n&&wt(o,n),gt(e,this,o)}))},Ur.tail=function(e){var t=null==e?0:e.length;return t?to(e,1,t):[]},Ur.take=function(e,t,r){return e&&e.length?to(e,0,(t=r||t===o?1:hs(t))<0?0:t):[]},Ur.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?to(e,(t=n-(t=r||t===o?1:hs(t)))<0?0:t,n):[]},Ur.takeRightWhile=function(e,t){return e&&e.length?po(e,si(t,3),!1,!0):[]},Ur.takeWhile=function(e,t){return e&&e.length?po(e,si(t,3)):[]},Ur.tap=function(e,t){return t(e),e},Ur.throttle=function(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new be(i);return ts(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),Pa(e,t,{leading:n,maxWait:t,trailing:o})},Ur.thru=ya,Ur.toArray=ds,Ur.toPairs=Bs,Ur.toPairsIn=Gs,Ur.toPath=function(e){return $a(e)?Ct(e,Ui):us(e)?[e]:Ro(Di(vs(e)))},Ur.toPlainObject=Es,Ur.transform=function(e,t,r){var n=$a(e),o=n||Qa(e)||ls(e);if(t=si(t,4),null==r){var i=e&&e.constructor;r=o?n?new i:[]:ts(e)&&Ka(i)?Br(qe(e)):{}}return(o?vt:vn)(e,(function(e,n,o){return t(r,e,n,o)})),r},Ur.unary=function(e){return Ra(e,1)},Ur.union=ra,Ur.unionBy=na,Ur.unionWith=oa,Ur.uniq=function(e){return e&&e.length?co(e):[]},Ur.uniqBy=function(e,t){return e&&e.length?co(e,si(t,2)):[]},Ur.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?co(e,o,t):[]},Ur.unset=function(e,t){return null==e||uo(e,t)},Ur.unzip=ia,Ur.unzipWith=aa,Ur.update=function(e,t,r){return null==e?e:lo(e,t,go(r))},Ur.updateWith=function(e,t,r,n){return n="function"==typeof n?n:o,null==e?e:lo(e,t,go(r),n)},Ur.values=zs,Ur.valuesIn=function(e){return null==e?[]:Wt(e,xs(e))},Ur.without=sa,Ur.words=Ks,Ur.wrap=function(e,t){return Ua(go(t),e)},Ur.xor=ca,Ur.xorBy=ua,Ur.xorWith=la,Ur.zip=pa,Ur.zipObject=function(e,t){return ho(e||[],t||[],Zr)},Ur.zipObjectDeep=function(e,t){return ho(e||[],t||[],Jn)},Ur.zipWith=fa,Ur.entries=Bs,Ur.entriesIn=Gs,Ur.extend=Ss,Ur.extendWith=_s,cc(Ur,Ur),Ur.add=vc,Ur.attempt=Zs,Ur.camelCase=js,Ur.capitalize=Vs,Ur.ceil=Tc,Ur.clamp=function(e,t,r){return r===o&&(r=t,t=o),r!==o&&(r=(r=gs(r))==r?r:0),t!==o&&(t=(t=gs(t))==t?t:0),an(gs(e),t,r)},Ur.clone=function(e){return sn(e,4)},Ur.cloneDeep=function(e){return sn(e,5)},Ur.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:o)},Ur.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:o)},Ur.conformsTo=function(e,t){return null==t||cn(e,t,Ps(t))},Ur.deburr=Ws,Ur.defaultTo=function(e,t){return null==e||e!=e?t:e},Ur.divide=Sc,Ur.endsWith=function(e,t,r){e=vs(e),t=so(t);var n=e.length,i=r=r===o?n:an(hs(r),0,n);return(r-=t.length)>=0&&e.slice(r,i)==t},Ur.eq=za,Ur.escape=function(e){return(e=vs(e))&&Y.test(e)?e.replace(q,Xt):e},Ur.escapeRegExp=function(e){return(e=vs(e))&&re.test(e)?e.replace(te,"\\$&"):e},Ur.every=function(e,t,r){var n=$a(e)?St:dn;return r&&Ei(e,t,r)&&(t=o),n(e,si(t,3))},Ur.find=ga,Ur.findIndex=Wi,Ur.findKey=function(e,t){return Mt(e,si(t,3),vn)},Ur.findLast=Ea,Ur.findLastIndex=$i,Ur.findLastKey=function(e,t){return Mt(e,si(t,3),Tn)},Ur.floor=_c,Ur.forEach=va,Ur.forEachRight=Ta,Ur.forIn=function(e,t){return null==e?e:gn(e,si(t,3),xs)},Ur.forInRight=function(e,t){return null==e?e:En(e,si(t,3),xs)},Ur.forOwn=function(e,t){return e&&vn(e,si(t,3))},Ur.forOwnRight=function(e,t){return e&&Tn(e,si(t,3))},Ur.get=bs,Ur.gt=ja,Ur.gte=Va,Ur.has=function(e,t){return null!=e&&yi(e,t,wn)},Ur.hasIn=Rs,Ur.head=Hi,Ur.identity=oc,Ur.includes=function(e,t,r,n){e=Ha(e)?e:zs(e),r=r&&!n?hs(r):0;var o=e.length;return r<0&&(r=mr(o+r,0)),cs(e)?r<=o&&e.indexOf(t,r)>-1:!!o&&xt(e,t,r)>-1},Ur.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=null==r?0:hs(r);return o<0&&(o=mr(n+o,0)),xt(e,t,o)},Ur.inRange=function(e,t,r){return t=ys(t),r===o?(r=t,t=0):r=ys(r),function(e,t,r){return e>=gr(t,r)&&e=-9007199254740991&&e<=p},Ur.isSet=ss,Ur.isString=cs,Ur.isSymbol=us,Ur.isTypedArray=ls,Ur.isUndefined=function(e){return e===o},Ur.isWeakMap=function(e){return rs(e)&&di(e)==I},Ur.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==An(e)},Ur.join=function(e,t){return null==e?"":yr.call(e,t)},Ur.kebabCase=$s,Ur.last=Ji,Ur.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=n;return r!==o&&(i=(i=hs(r))<0?mr(n+i,0):gr(i,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,i):Pt(e,kt,i,!0)},Ur.lowerCase=qs,Ur.lowerFirst=Hs,Ur.lt=ps,Ur.lte=fs,Ur.max=function(e){return e&&e.length?yn(e,oc,Cn):o},Ur.maxBy=function(e,t){return e&&e.length?yn(e,si(t,2),Cn):o},Ur.mean=function(e){return Ft(e,oc)},Ur.meanBy=function(e,t){return Ft(e,si(t,2))},Ur.min=function(e){return e&&e.length?yn(e,oc,Fn):o},Ur.minBy=function(e,t){return e&&e.length?yn(e,si(t,2),Fn):o},Ur.stubArray=mc,Ur.stubFalse=gc,Ur.stubObject=function(){return{}},Ur.stubString=function(){return""},Ur.stubTrue=function(){return!0},Ur.multiply=Nc,Ur.nth=function(e,t){return e&&e.length?zn(e,hs(t)):o},Ur.noConflict=function(){return it._===this&&(it._=Ue),this},Ur.noop=uc,Ur.now=ba,Ur.pad=function(e,t,r){e=vs(e);var n=(t=hs(t))?or(e):0;if(!t||n>=t)return e;var o=(t-n)/2;return Vo(lr(o),r)+e+Vo(ur(o),r)},Ur.padEnd=function(e,t,r){e=vs(e);var n=(t=hs(t))?or(e):0;return t&&nt){var n=e;e=t,t=n}if(r||e%1||t%1){var i=Tr();return gr(e+i*(t-e+tt("1e-"+((i+"").length-1))),t)}return qn(e,t)},Ur.reduce=function(e,t,r){var n=$a(e)?bt:Bt,o=arguments.length<3;return n(e,si(t,4),r,o,pn)},Ur.reduceRight=function(e,t,r){var n=$a(e)?Rt:Bt,o=arguments.length<3;return n(e,si(t,4),r,o,fn)},Ur.repeat=function(e,t,r){return t=(r?Ei(e,t,r):t===o)?1:hs(t),Hn(vs(e),t)},Ur.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Ur.result=function(e,t,r){var n=-1,i=(t=Eo(t,e)).length;for(i||(i=1,e=o);++np)return[];var r=d,n=gr(e,d);t=si(t),e-=d;for(var o=zt(n,t);++r=a)return e;var c=r-or(n);if(c<1)return n;var u=s?To(s,0,c).join(""):e.slice(0,c);if(i===o)return u+n;if(s&&(c+=u.length-c),as(i)){if(e.slice(c).search(i)){var l,p=u;for(i.global||(i=Ce(i.source,vs(fe.exec(i))+"g")),i.lastIndex=0;l=i.exec(p);)var f=l.index;u=u.slice(0,f===o?c:f)}}else if(e.indexOf(so(i),c)!=c){var d=u.lastIndexOf(i);d>-1&&(u=u.slice(0,d))}return u+n},Ur.unescape=function(e){return(e=vs(e))&&H.test(e)?e.replace($,sr):e},Ur.uniqueId=function(e){var t=++Le;return vs(e)+t},Ur.upperCase=Xs,Ur.upperFirst=Js,Ur.each=va,Ur.eachRight=Ta,Ur.first=Hi,cc(Ur,(Ec={},vn(Ur,(function(e,t){xe.call(Ur.prototype,t)||(Ec[t]=e)})),Ec),{chain:!1}),Ur.VERSION="4.17.21",vt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Ur[e].placeholder=Ur})),vt(["drop","take"],(function(e,t){jr.prototype[e]=function(r){r=r===o?1:mr(hs(r),0);var n=this.__filtered__&&!t?new jr(this):this.clone();return n.__filtered__?n.__takeCount__=gr(r,n.__takeCount__):n.__views__.push({size:gr(r,d),type:e+(n.__dir__<0?"Right":"")}),n},jr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),vt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;jr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:si(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),vt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");jr.prototype[e]=function(){return this[r](1).value()[0]}})),vt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");jr.prototype[e]=function(){return this.__filtered__?new jr(this):this[r](1)}})),jr.prototype.compact=function(){return this.filter(oc)},jr.prototype.find=function(e){return this.filter(e).head()},jr.prototype.findLast=function(e){return this.reverse().find(e)},jr.prototype.invokeMap=Yn((function(e,t){return"function"==typeof e?new jr(this):this.map((function(r){return On(r,e,t)}))})),jr.prototype.reject=function(e){return this.filter(Fa(si(e)))},jr.prototype.slice=function(e,t){e=hs(e);var r=this;return r.__filtered__&&(e>0||t<0)?new jr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==o&&(r=(t=hs(t))<0?r.dropRight(-t):r.take(t-e)),r)},jr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},jr.prototype.toArray=function(){return this.take(d)},vn(jr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=Ur[n?"take"+("last"==t?"Right":""):t],a=n||/^find/.test(t);i&&(Ur.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,c=t instanceof jr,u=s[0],l=c||$a(t),p=function(e){var t=i.apply(Ur,wt([e],s));return n&&f?t[0]:t};l&&r&&"function"==typeof u&&1!=u.length&&(c=l=!1);var f=this.__chain__,d=!!this.__actions__.length,y=a&&!f,h=c&&!d;if(!a&&l){t=h?t:new jr(this);var m=e.apply(t,s);return m.__actions__.push({func:ya,args:[p],thisArg:o}),new zr(m,f)}return y&&h?e.apply(this,s):(m=this.thru(p),y?n?m.value()[0]:m.value():m)})})),vt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Re[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Ur.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var o=this.value();return t.apply($a(o)?o:[],e)}return this[r]((function(r){return t.apply($a(r)?r:[],e)}))}})),vn(jr.prototype,(function(e,t){var r=Ur[t];if(r){var n=r.name+"";xe.call(Or,n)||(Or[n]=[]),Or[n].push({name:t,func:r})}})),Or[Bo(o,2).name]=[{name:"wrapper",func:o}],jr.prototype.clone=function(){var e=new jr(this.__wrapped__);return e.__actions__=Ro(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ro(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ro(this.__views__),e},jr.prototype.reverse=function(){if(this.__filtered__){var e=new jr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},jr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=$a(e),n=t<0,o=r?e.length:0,i=function(e,t,r){for(var n=-1,o=r.length;++n=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},Ur.prototype.plant=function(e){for(var t,r=this;r instanceof Gr;){var n=Gi(r);n.__index__=0,n.__values__=o,t?i.__wrapped__=n:t=n;var i=n;r=r.__wrapped__}return i.__wrapped__=e,t},Ur.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof jr){var t=e;return this.__actions__.length&&(t=new jr(this)),(t=t.reverse()).__actions__.push({func:ya,args:[ta],thisArg:o}),new zr(t,this.__chain__)}return this.thru(ta)},Ur.prototype.toJSON=Ur.prototype.valueOf=Ur.prototype.value=function(){return fo(this.__wrapped__,this.__actions__)},Ur.prototype.first=Ur.prototype.head,at&&(Ur.prototype[at]=function(){return this}),Ur}();it._=cr,(n=function(){return cr}.call(t,r,t,e))===o||(e.exports=n)}.call(this)},904:(e,t)=>{"use strict";var r;let n;Object.defineProperty(t,"__esModule",{value:!0}),t.setDomain=t.getDomain=t.Domain=void 0,function(e){e[e.FA=0]="FA",e[e.FORM=1]="FORM",e[e.ETS=2]="ETS"}(r||(r={})),t.Domain=r,t.setDomain=e=>{n=e},t.getDomain=()=>null!=n?n:r.FA},784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMap=void 0,t.errorMap=new Map([["fileError","Visual file is damaged"],["versionError","Version number of visual file does not match"],["modelError","Visual model in visual file is damaged"],["codegenError","Codegen visual file failed"]])},117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNode=void 0,t.ASTNode=class{accept(e){return e.visit(this)}}},862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0,t.Cache=class{constructor(e,t=0){this.value="",this.indent=t,this.flag=!0,this.INDENT=e}indentOn(){this.flag=!0}indentOff(){this.flag=!1}incIndent(){this.indent++}decIndent(){this.indent--}checkIndent(){return this.indent<0}getIndents(){if(this.flag){let e="";for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const n=r(117);class o extends n.ASTNode{constructor(e,t,r,n,o){super(),this.defaultValue=new Map,this.mediaParams=new Map,this.mediaProperties=new Map,this.mediaKeyProperty=new Map,this.tagName=e,this.params=t,this.content=r,this.properties=n,this.forEachObj=o,this.ifBoolean=null}setMediaParams(e){this.mediaParams=e}setParams(e){this.params=e}setIfBoolean(e){this.ifBoolean=e}setTagName(e){this.tagName=e}setForEachObj(e){this.forEachObj=e}setMediaProperty(e,t){t.forEach(((t,r)=>{var n;this.mediaKeyProperty.has(r)||this.mediaKeyProperty.set(r,new Map),null===(n=this.mediaKeyProperty.get(r))||void 0===n||n.set(e,t)}))}setDefaultValue(e,t,r="undefined"){this.defaultValue.set(e,[r,t])}}t.Tag=o},623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const n=r(519),o=r(862),i=r(51),a=r(294);class s{constructor(e){this.cache=e,this.etsImport=new o.Cache(" ",1),this.etsVariable=new o.Cache(" ",1),this.etsFunction=new o.Cache(" ",1),this.aboutToAppear=new o.Cache(" ",2),this.needMediaQuery=!0}visit(e){e instanceof n.Tag&&(this.needMediaQuery&&this.genMediaQuery(e),this.genTag(e))}static getMethodGen(e){return void 0===s.instance?s.instance=new s(e):s.instance.setCache(e),s.instance}setCache(e){this.cache=e,this.etsImport=new o.Cache(" ",1),this.etsVariable=new o.Cache(" ",1),this.etsFunction=new o.Cache(" ",1),this.aboutToAppear=new o.Cache(" ",2),this.needMediaQuery=!0}genParams(e){if("string"==typeof e)this.cache.concat(e);else if(e.size>0){this.cache.concat(i.TokenClass.LBRA,i.TokenClass.SPACE);let t=0;e.forEach(((r,n)=>{this.cache.concat(n,i.TokenClass.COLON,i.TokenClass.SPACE,r),t++,t{this.cache.concat(n,i.TokenClass.COLON,i.TokenClass.SPACE,r),t++,t{e.accept(this),this.cache.indentOff(),this.cache.concat(i.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.decIndent(),this.cache.indentOn()),this.cache.indentOn(),this.cache.concat(i.TokenClass.RBRA)),(null!==e.properties||null!==e.mediaProperties)&&(null!==e.content&&0!==e.content.length||this.cache.incIndent(),this.getProperties(e).forEach(((e,t)=>{this.cache.concat(i.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(i.TokenClass.PROPERTY_START,t,i.TokenClass.TAG_START),this.cache.indentOff(),"string"==typeof e?this.cache.concat(e,i.TokenClass.TAG_END):this.genObjectProperty(e)})),null!==e.content&&0!==e.content.length||this.cache.decIndent()),this.genEnd(e)}genStart(e){this.genIfStart(e),this.genForTagStart(e)}genEnd(e){this.genForTagEnd(e),this.genIfEnd(e)}genForTagStart(e){var t;void 0!==(null===(t=e.forEachObj)||void 0===t?void 0:t.for)&&(this.cache.concat("ForEach",i.TokenClass.TAG_START,e.forEachObj.for.toString(),i.TokenClass.COMMA,i.TokenClass.NEW_LINE),this.cache.concat(i.TokenClass.TAG_START,e.forEachObj.item,i.TokenClass.COLON," any",i.TokenClass.COMMA," ",e.forEachObj.idx,i.TokenClass.COLON," number",i.TokenClass.TAG_END," => ",i.TokenClass.LBRA,i.TokenClass.NEW_LINE))}genForTagEnd(e){null!==e.forEachObj&&(this.cache.concat(i.TokenClass.RBRA),void 0!==e.forEachObj.key&&""!==e.forEachObj.key&&(this.cache.concat(i.TokenClass.COMMA,i.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(i.TokenClass.TAG_START,e.forEachObj.item,i.TokenClass.COLON," any",i.TokenClass.COMMA," ",e.forEachObj.idx,i.TokenClass.COLON," number",i.TokenClass.TAG_END," => ",i.TokenClass.LBRA,i.TokenClass.NEW_LINE),this.cache.concat("return ",e.forEachObj.key.toString(),i.TokenClass.TAG_START,e.forEachObj.item,i.TokenClass.COMMA," ",e.forEachObj.idx,i.TokenClass.TAG_END,i.TokenClass.RBRA),this.cache.indentOff()),this.cache.concat(i.TokenClass.TAG_END))}genIfStart(e){null!==e.ifBoolean&&(this.cache.concat("if",i.TokenClass.SPACE,i.TokenClass.TAG_START,e.ifBoolean.toString(),i.TokenClass.TAG_END,i.TokenClass.SPACE,i.TokenClass.LBRA,i.TokenClass.NEW_LINE),this.cache.incIndent())}genIfEnd(e){null!==e.ifBoolean&&(this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(i.TokenClass.NEW_LINE),this.cache.concat(i.TokenClass.RBRA),this.cache.indentOff())}genMediaQuery(e){const t=new Map,r=new Map;if(this.collectMediaQueryMap(e,t),this.collectDefaultValueMap(e,r),0===t.size&&0===r.size)return;const n=a.getUniqueName("mediaQuery"),s=a.getUniqueName("initForMediaQuery"),c=a.getUniqueName("mediaQueryCb"),u=a.getUniqueName("saveMediaQueryResult"),l=a.getUniqueName("updateForMediaQuery"),p=new o.Cache(i.TokenClass.INDENT,1),f=new o.Cache(i.TokenClass.INDENT,1),d=new o.Cache(i.TokenClass.INDENT,1),y=new o.Cache(i.TokenClass.INDENT,1),h=new o.Cache(i.TokenClass.INDENT,1),m=new o.Cache(i.TokenClass.INDENT,1),g=new o.Cache(i.TokenClass.INDENT,1),E=new o.Cache(i.TokenClass.INDENT,2);this.genVariableDeclare(r,p),this.genMediaQueryCb(c,f),this.genMediaQueryListener(t,d,y),this.genInitFuc(s,r,h),this.genMediaQueryCbFnc(u,l,t,m),this.genUpdateFnc(l,s,t,g),this.genAboutToAppear(c,u,t,E),this.etsImport.indentOff(),this.aboutToAppear.indentOff(),this.etsVariable.indentOff(),this.etsFunction.indentOff(),this.etsImport.indentOff(),this.etsImport.concat("import ",n," from '@ohos.mediaquery'"),this.aboutToAppear.concat(E.toString()),this.etsVariable.concat(p.toString(),f.toString(),d.toString(),y.toString()),this.etsFunction.concat(m.toString(),i.TokenClass.NEW_LINE,h.toString(),i.TokenClass.NEW_LINE,g.toString()),this.etsImport.indentOn(),this.aboutToAppear.indentOn(),this.etsVariable.indentOn(),this.etsFunction.indentOn(),this.needMediaQuery=!1}genVariableDeclare(e,t){e.forEach(((e,r)=>{t.concat(i.TokenClass.DECORATOR_STATE,i.TokenClass.SPACE,r.slice(5),i.TokenClass.COLON,i.TokenClass.SPACE,e[1],i.TokenClass.SPACE,i.TokenClass.ASSIGN,i.TokenClass.SPACE,i.TokenClass.UNDEFINED,i.TokenClass.NEW_LINE)}))}genMediaQueryCb(e,t){t.concat(e,i.TokenClass.SPACE,i.TokenClass.ASSIGN,i.TokenClass.SPACE,i.TokenClass.NULL,i.TokenClass.NEW_LINE)}genMediaQueryListener(e,t,r){const n=a.getUniqueName("mediaQuery");e.forEach(((e,o)=>{const s=a.getUniqueName(this.getMediaQueryVariableName(o));t.concat(s,i.TokenClass.COLON,i.TokenClass.SPACE,i.TokenClass.BOOLEAN,i.TokenClass.SPACE,i.TokenClass.ASSIGN,i.TokenClass.SPACE,i.TokenClass.FALSE,i.TokenClass.NEW_LINE),r.concat(`listener_${s}`,i.TokenClass.SPACE,i.TokenClass.ASSIGN,i.TokenClass.SPACE,n,i.TokenClass.PROPERTY_START,"matchMediaSync",i.TokenClass.TAG_START,`'${o}'`,i.TokenClass.TAG_END,i.TokenClass.NEW_LINE)}))}genInitFuc(e,t,r){r.concat(e,i.TokenClass.TAG_START,i.TokenClass.TAG_END,i.TokenClass.SPACE,i.TokenClass.LBRA,i.TokenClass.NEW_LINE),r.indentOn(),r.incIndent(),t.forEach(((e,t)=>{r.concat(t,i.TokenClass.SPACE,i.TokenClass.ASSIGN,i.TokenClass.SPACE,e[0],i.TokenClass.NEW_LINE)})),r.decIndent(),r.concat(i.TokenClass.RBRA,i.TokenClass.NEW_LINE)}genMediaQueryCbFnc(e,t,r,n){const o=Array.from(r.entries());n.concat(e,i.TokenClass.TAG_START,"mediaQueryResult",i.TokenClass.TAG_END,i.TokenClass.SPACE,i.TokenClass.LBRA,i.TokenClass.NEW_LINE),n.incIndent(),n.concat(i.TokenClass.SWITCH,i.TokenClass.SPACE,i.TokenClass.TAG_START,"mediaQueryResult.media",i.TokenClass.TAG_END,i.TokenClass.SPACE,i.TokenClass.LBRA,i.TokenClass.NEW_LINE),n.incIndent();for(let e=0;e{const r=a.getUniqueName(this.getMediaQueryVariableName(t));n.concat(i.TokenClass.IF,i.TokenClass.SPACE,i.TokenClass.TAG_START,i.TokenClass.THIS,i.TokenClass.PROPERTY_START,r,i.TokenClass.TAG_END,i.TokenClass.SPACE,i.TokenClass.LBRA,i.TokenClass.NEW_LINE),n.incIndent(),e.forEach(((e,t)=>{n.concat(t,i.TokenClass.SPACE,i.TokenClass.ASSIGN,i.TokenClass.SPACE,e,i.TokenClass.NEW_LINE)})),n.decIndent(),n.concat(i.TokenClass.RBRA,i.TokenClass.NEW_LINE)})),n.decIndent(),n.concat(i.TokenClass.RBRA,i.TokenClass.NEW_LINE)}genAboutToAppear(e,t,r,n){let o=1;n.concat(i.TokenClass.THIS,i.TokenClass.PROPERTY_START,e,i.TokenClass.SPACE,i.TokenClass.ASSIGN,i.TokenClass.SPACE,i.TokenClass.THIS,i.TokenClass.PROPERTY_START,`${t}.bind(this)`,i.TokenClass.NEW_LINE),r.forEach(((t,s)=>{const c=`listener_${a.getUniqueName(this.getMediaQueryVariableName(s))}`;n.indentOn(),n.concat(i.TokenClass.THIS,i.TokenClass.PROPERTY_START,c,i.TokenClass.PROPERTY_START,`on('change', this.${e})`),o0?e.mediaParams:e.params}getProperties(e){const t=new Map;return e.properties.forEach(((e,r)=>{t.set(r,e)})),e.mediaProperties.forEach(((e,r)=>{t.set(r,e)})),t}collectDefaultValueMap(e,t){void 0!==e.defaultValue&&e.defaultValue.forEach(((e,r)=>{t.set(r,e)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectDefaultValueMap(e,t)}))}collectMediaQueryMap(e,t){void 0!==e.mediaKeyProperty&&e.mediaKeyProperty.forEach(((e,r)=>{var n;const o=null!==(n=t.get(r))&&void 0!==n?n:new Map;e.forEach(((e,t)=>{o.set(t,e)})),t.set(r,o)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectMediaQueryMap(e,t)}))}getMediaQueryVariableName(e){const t="device-type: ",r="orientation: ",n=e.substring(e.indexOf(t),e.length),o=n.substring(t.length,n.indexOf(")")),i=e.substring(e.indexOf(r),e.length),a=i.substring(r.length,i.indexOf(")"));return`${o}${a.slice(0,1).toUpperCase()+a.slice(1).toLowerCase()}`}}t.ASTNodeGenerator=s,s.instance=void 0},413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ETSBridge=void 0;const n=r(519),o=r(973),i=r(497);t.ETSBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map;let r=null;const a=new Map,s=new n.Tag(e.type,t,r,a,null);if(o.parseVisualModel(e,s),i.parseMediaVisualModel(e,s),e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}return s.content=r,s}}},459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genETS=void 0;const n=r(623),o=r(862);t.genETS=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" ",2));return e.accept(t),{build:t.cache.toString(),etsImport:t.etsImport.toString(),etsVariable:t.etsVariable.toString(),etsFunction:t.etsFunction.toString(),aboutToAppear:t.aboutToAppear.toString()}}},435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;const n=r(459);t.StringWriter=class{genETS(e){return n.genETS(e)}}},51:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.INDENT=" ",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.SPACE=" ",r.LQUOTE="'",r.RQUOTE="'",r.TAG_START="(",r.TAG_END=")",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMediaProperty=t.parseMediaVisualModel=void 0;const n=r(294),o=r(973),i=r(290),a=o.curry(((e,t)=>t.hasMediaProperty(e))),s=o.curry(((e,t,r)=>r.type===e&&r.hasMediaProperty(t)));function c(e){const t=e+"-visual",r=i.etsPropertyList;let n="";for(const e of r)void 0!==e.propertySet.properties&&(n=u(t,e.propertySet.properties)),e.propertySet.property===t&&(n=e.propertySet.etsType);return function(e=""){const t=new Map([["ETSBoolean","boolean"],["ETSNumber","number"],["ETSString","string"],["Rfloat","Resource"],["Rstring","Resource"],["Rcolor","Resource"],["Rmedia","Resource"],["Rrawfile","Resource"],["ETSArray","any[]"]]),r=new Array;return e.split("|").forEach((e=>{const n=t.get(e);"Resource"!==n&&r.push(null!=n?n:e)})),r.join(" | ")}(n)}function u(e,t){for(const r of t)if(r.property===e)return r.etsType;return""}function l(e,t,r){const n=t.get(r);return void 0!==n&&n.has(e)}function p(e){return isNaN(Number(e))?o.getEtsEnumValue("FontWeight.",e):e}function f(e){let t=o.getEtsEnumValue("FlexAlign.",e);return"flex-start"===e?t="FlexAlign.Start":"flex-end"===e&&(t="FlexAlign.End"),t}function d(e){return"TextOverflow."+o.firstUpperCase(e)}function y(e,t,r){var n,i;const a=new Map,s=null!==(n=e.mediaProperty)&&void 0!==n?n:new Map,c=null!==(i=e.dynamicMediaProperty)&&void 0!==i?i:new Map;return s.forEach(((e,n)=>{let i=e.get(t);const s=e.get(r);o.isEmptyOrUndefined(i)&&o.isEmptyOrUndefined(s)||(i="0"===i||o.isEmptyOrUndefined(i)?"0":i.substring(0,i.length-2),a.set(n,i))})),c.forEach(((e,r)=>{const n=e.get(t);o.isEmptyOrUndefined(n)||a.set(r,n)})),a}function h(e,t,r){var n,i,a,s;const c=null!==(n=e.property.get("left"))&&void 0!==n?n:e.dynamicProperty.get("left"),u=null!==(i=e.property.get("top"))&&void 0!==i?i:e.dynamicProperty.get("top"),l=t.get("left"),p=t.get("top"),f=r.get("left"),d=r.get("top");let y="undefined",h="undefined";return o.isEmptyOrUndefined(l)&&o.isEmptyOrUndefined(p)||(y=o.quoteString(null!==(a=null!=l?l:c)&&void 0!==a?a:"0"),h=o.quoteString(null!==(s=null!=p?p:u)&&void 0!==s?s:"0")),o.isEmptyOrUndefined(f)&&o.isEmptyOrUndefined(d)||(y=null!=f?f:y,h=null!=d?d:h),{leftValue:y,topValue:h}}function m(e,t){e.forEach(((e,r)=>{"undefined"!==e&&t.set(r,"undefined")}))}function g(e,t){var r,n;const i=new Map,a=t.split("-")[0];return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((r,n)=>{var s,c,u,l;const p=r.get(a),f=null===(c=null===(s=e.dynamicMediaProperty)||void 0===s?void 0:s.get(n))||void 0===c?void 0:c.get(a),d=null!==(l=null!==(u=r.get(t))&&void 0!==u?u:f)&&void 0!==l?l:p;void 0!==d&&i.set(n,o.quoteString(d))})),(null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map).forEach(((e,r)=>{var n;const o=e.get(a),s=null!==(n=e.get(t))&&void 0!==n?n:o;void 0!==s&&i.set(r,s)})),i}function E(e,t,r){var n,i;const a=new Map;return(null!==(n=e.mediaProperty)&&void 0!==n?n:new Map).forEach(((e,n)=>{let i=e.get(t);o.isEmptyOrUndefined(i)||("function"==typeof r&&(i=r(i)),o.isEmptyOrUndefined(i)||a.set(n,i))})),(null!==(i=e.dynamicMediaProperty)&&void 0!==i?i:new Map).forEach(((e,r)=>{let n=e.get(t);void 0===n||"content"!==t&&"label"!==t||(n=o.getContentName(n)),o.isEmptyOrUndefined(n)||a.set(r,n)})),a}function v(e,t){const r=`this.${o.getEtsPropName(e)}${o.firstUpperCase(o.getEtsPropName(t))}`;return`${r}_${n.getUniqueId(r)}`}function T(e,t,r){var n;const i=e.property.get(t),a=e.dynamicProperty.get(t);let s=null!==(n=new Map([["if","true"],["auto-play","false"],["interval","3000"]]).get(t))&&void 0!==n?n:"undefined";return o.isEmptyOrUndefined(i)||(s="function"==typeof r?r(i):i,s=o.isEmptyOrUndefined(s)?"undefined":s),o.isEmptyOrUndefined(a)||(s=a),s}const S=o.curry(((e,t,r)=>{const n=E(t,e,o.quoteString);if(0===n.size)return;const i=T(t,e,o.quoteString),a=v(t.id,e);r.setDefaultValue(a,c(e),i),r.setMediaProperty(a,n),r.mediaProperties.set(o.getEtsPropName(e),a)})),_=o.curry(((e,t,r)=>{const n=E(t,e);if(0===n.size)return;const i=T(t,e),a=v(t.id,e);r.setDefaultValue(a,c(e),i),r.setMediaProperty(a,n),r.mediaProperties.set(o.getEtsPropName(e),a)})),N=o.curry(((e,t,r)=>{const n=E(t,e);if(0===n.size)return;const i=T(t,e),a=v(t.id,e);r.setDefaultValue(a,c(e),i),r.setMediaProperty(a,n),r.mediaProperties.set(o.getEtsPropName(e),a)})),A=o.curry(((e,t,r,n)=>{const i=E(r,e,o.curry(o.getEtsEnumValue)(t));if(0===i.size)return;const a=T(r,e,o.curry(o.getEtsEnumValue)(t)),s=v(r.id,e);n.setDefaultValue(s,c(e),a),n.setMediaProperty(s,i),n.mediaProperties.set(o.getEtsPropName(e),s)})),C=o.curry(((e,t,r)=>{const n=E(t,e,o.quoteString);if(!(r.mediaParams instanceof Map)||0===n.size)return;const i=T(t,e,o.quoteString),a=v(t.id,e);r.setDefaultValue(a,c(e),i),r.setMediaProperty(a,n),r.mediaParams.set(o.getEtsPropName(e),a)})),w=o.curry(((e,t,r)=>{const n=E(t,e);if(!(r.mediaParams instanceof Map)||0===n.size)return;const i=T(t,e),a=v(t.id,e);r.setDefaultValue(a,c(e),i),r.setMediaProperty(a,n),r.mediaParams.set(o.getEtsPropName(e),a)})),b=o.curry(((e,t,r,n)=>{const i=E(r,e,o.curry(o.getEtsEnumValue)(t));if(!(n.mediaParams instanceof Map)||0===i.size)return;const a=T(r,e,o.curry(o.getEtsEnumValue)(t)),s=v(r.id,e);n.setDefaultValue(s,c(e),a),n.setMediaProperty(s,i),n.mediaParams.set(o.getEtsPropName(e),s)})),R=o.curry(((e,t,r)=>{const n=E(t,e,o.dealWithColor);if(0===n.size)return;const i=T(t,e,o.dealWithColor),a=v(t.id,e);r.setDefaultValue(a,c(e),i),r.setMediaProperty(a,n),r.mediaProperties.set(o.getEtsPropName(e),a)}));function O(e,t,r,n=!1){o.isEmptyOrUndefined(t)||r.set(e,n?t:o.quoteString(t))}t.parseMediaVisualModel=function(e,t){!function(e,t){var r,n,o;const i=null!==(r=e.dynamicProperty.get("for"))&&void 0!==r?r:"[1]",a=null!==(n=e.property.get("item"))&&void 0!==n?n:"item",s=null!==(o=e.property.get("idx"))&&void 0!==o?o:"idx",u=e.dynamicProperty.get("keyGenerator"),l=E(e,"for");if(0===l.size)return;const p=v(e.id,"for"),f={for:p,key:u,item:a,idx:s};t.setDefaultValue(p,c("for"),i),t.setMediaProperty(p,l),t.setForEachObj(f)}(e,t),function(e,t){const r=E(e,"if");if(0===r.size)return;const n=T(e,"if"),o=v(e.id,"if");t.setDefaultValue(o,c("if"),n),t.setMediaProperty(o,r),t.setIfBoolean(o)}(e,t);for(const r of V)("boolean"==typeof r[0]||r[0](e))&&r[1](e,t)};const I=o.curry(((e,t,r)=>{const n=new Map,i=t.property.get(e),a=t.dynamicProperty.get(e),s=null!=a?a:i,u=["top","bottom","left","right"];let l=0;for(const i of u){const a=`${e}-${i}`,u=t.property.get(a),p=t.dynamicProperty.get(a),f=g(t,a);let d=o.isEmptyOrUndefined(s)?"undefined":o.quoteString(s);if(o.isEmptyOrUndefined(u)||(d=o.quoteString(u)),o.isEmptyOrUndefined(p)||(d=p),f.size>0){const e=v(t.id,a);r.setDefaultValue(e,c(a),d),r.setMediaProperty(e,f),O(i,e,n,!0),l++}else O(i,d,n,!0)}l>0&&r.mediaProperties.set(e,n)}));function M(e){return new Set(["Cover","Contain","Auto"]).has(e)?o.getEtsEnumValue("ImageSize.",e):"undefined"}function P(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null===t?"undefined":void 0!==t[5]?`{ width: ${o.quoteString(t[1])}, height: ${o.quoteString(t[5])} }`:`{ width: ${o.quoteString(t[1])} }`}function x(e,t){var r,n;const i=new Map,a=new Map,s=k(t),c=F(t);return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((e,r)=>{const n=e.get(t);o.isEmptyOrUndefined(n)||(i.set(r,s(n)),a.set(r,c(n)))})),(null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map).forEach(((e,r)=>{const n=e.get(t);o.isEmptyOrUndefined(n)||(i.set(r,n),a.set(r,"undefined"))})),{enumValueMap:i,objValueMap:a}}function L(e,t){const r=e.property.get(t),n=e.dynamicProperty.get(t),i=k(t),a=F(t);let s="undefined",c="undefined";return o.isEmptyOrUndefined(r)||(s=i(r),c=a(r)),o.isEmptyOrUndefined(n)||(s=n,c="undefined"),{enumDefault:s,objDefault:c}}function k(e){return new Map([["background-image-size",M],["background-image-position",D]]).get(e)}function F(e){return new Map([["background-image-size",P],["background-image-position",U]]).get(e)}function D(e){return new Set(["TopStart","Top","TopEnd","Start","Center","End","BottomStart","Bottom","BottomEnd"]).has(e)?"Alignment."+e:"undefined"}function U(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null===t?"undefined":`{ x: ${o.quoteString(t[1])}, y: ${o.quoteString(t[4])} }`}const B=o.curry(((e,t,r,n)=>{const o=E(r,e,f);if(!(n.mediaProperties instanceof Map)||0===o.size)return;const i=T(r,e,f),a=v(r.id,e);n.setDefaultValue(a,c(e),i),n.setMediaProperty(a,o),n.mediaProperties.set("justifyContent",a)})),G=o.curry(((e,t,r,n)=>{const i=E(r,e,f);if(!(n.mediaParams instanceof Map)||0===i.size)return;const a=T(r,e,f),s=v(r.id,e);n.setDefaultValue(s,c(e),a),n.setMediaProperty(s,i),n.mediaParams.set(o.getEtsPropName(e),s)})),z=o.curry(((e,t)=>t.type===e));t.isMediaProperty=function(e,t){return!l(e,j,"common")&&!l(e,j,t)&&!l(e,j,"events")};const j=new Map([["common",new Set(["keyGenerator","item","idx"])],["events",new Set([...o.events])]]),V=[[a("width"),S("width")],[a("height"),S("height")],[function(e){return e.hasMediaProperty("constraint-size-min-width")||e.hasMediaProperty("constraint-size-max-width")||e.hasMediaProperty("constraint-size-min-height")||e.hasMediaProperty("constraint-size-min-height")},function(e,t){const r=new Map,n=["min-width","max-width","min-height","max-height"];for(const i of n){const n=`constraint-size-${i}`,a=E(e,n,o.quoteString),s=T(e,n,o.quoteString);if(a.size>0){const u=v(e.id,n);t.setDefaultValue(u,c(n),s),t.setMediaProperty(u,a),O(o.getEtsPropName(i),u,r,!0)}}r.size>0&&t.mediaProperties.set("constraintSize",r)}],[a("align"),A("align","Alignment.")],[a("direction"),A("direction","Direction.")],[function(e){return e.hasMediaProperty("left")||e.hasMediaProperty("top")},function(e,t){var r;const n=null!==(r=e.property.get("position"))&&void 0!==r?r:"relative",{leftValue:o,topValue:i}=h(e,e.property,e.dynamicProperty),{mediaPositionLeft:a,mediaPositionTop:s,mediaOffsetLeft:u,mediaOffsetTop:l}=function(e){var t,r;const n=new Map,o=new Map,i=new Map,a=new Map,s=null!==(t=e.mediaProperty)&&void 0!==t?t:new Map,c=null!==(r=e.dynamicMediaProperty)&&void 0!==r?r:new Map,u=new Set;for(const[e]of s)u.add(e);for(const[e]of c)u.add(e);return u.forEach((t=>{var r,s,c,u;const l=null!==(s=null===(r=e.mediaProperty)||void 0===r?void 0:r.get(t))&&void 0!==s?s:new Map,p=null!==(u=null===(c=e.dynamicMediaProperty)||void 0===c?void 0:c.get(t))&&void 0!==u?u:new Map,f=l.get("position"),{leftValue:d,topValue:y}=h(e,l,p);"absolute"===f?("undefined"!==d&&n.set(t,d),"undefined"!==y&&o.set(t,y)):("undefined"!==d&&i.set(t,d),"undefined"!==y&&a.set(t,y))})),{mediaPositionLeft:n,mediaPositionTop:o,mediaOffsetLeft:i,mediaOffsetTop:a}}(e),p=a.size>0||s.size>0||"absolute"===n,f=u.size>0||l.size>0||"relative"===n,d=v(e.id,"positionLeft"),y=v(e.id,"positionTop"),g=v(e.id,"offsetLeft"),E=v(e.id,"offsetTop");if(0!==a.size||0!==s.size||0!==l.size||0!==u.size){if(p&&f&&(m(a,u),m(u,a),m(s,l),m(l,s)),p){const e="absolute"===n?o:"undefined",r="absolute"===n?i:"undefined";t.setDefaultValue(d,c("left"),e),t.setDefaultValue(y,c("top"),r),t.setMediaProperty(d,a),t.setMediaProperty(y,s),t.mediaProperties.set("position",new Map([["x",d],["y",y]]))}if(f){const e="relative"===n?o:"undefined",r="relative"===n?i:"undefined";t.setDefaultValue(g,c("left"),e),t.setDefaultValue(E,c("top"),r),t.setMediaProperty(g,u),t.setMediaProperty(E,l),t.mediaProperties.set("offset",new Map([["x",g],["y",E]]))}}}],[a("aspect-ratio"),_("aspect-ratio")],[a("display-priority"),_("display-priority")],[a("flex-basis"),S("flex-basis")],[a("flex-grow"),_("flex-grow")],[a("flex-shrink"),_("flex-shrink")],[a("align-self"),function(e,t){const r=E(e,"align-self",o.dealWithAlignSelf);if(0===r.size)return;const n=T(e,"align-self",o.dealWithAlignSelf),i=v(e.id,"align-self");t.setDefaultValue(i,c("align-self"),n),t.setMediaProperty(i,r),t.mediaProperties.set("alignSelf",i)}],[a("border-style"),A("border-style","BorderStyle.")],[a("border-width"),S("border-width")],[a("border-color"),R("border-color")],[a("border-radius"),S("border-radius")],[a("background-color"),R("background-color")],[function(e){return e.hasMediaProperty("background-image-src")||e.hasMediaProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),n=e.property.get("background-image-repeat"),i=e.dynamicProperty.get("background-image-src"),a=e.dynamicProperty.get("background-image-repeat"),s=E(e,"background-image-src",o.dealWithSrc),u=E(e,"background-image-repeat",o.dealWithBackgroundRepeat);if(0===s.size&&0===u.size)return;let l=o.dealWithSrc(null!=r?r:"");if(o.isEmptyOrUndefined(i)||(l=i),s.size>0){const r=v(e.id,"background-image-src");t.setDefaultValue(r,c("background-image-src"),l),t.setMediaProperty(r,s),l=r}let p="undefined";if(!o.isEmptyOrUndefined(n)){const e=o.dealWithBackgroundRepeat(n);null!=e&&""!==e&&(p=e)}if(o.isEmptyOrUndefined(a)||(p=a),u.size>0){const r=v(e.id,"background-image-repeat");t.setDefaultValue(r,c("background-image-repeat"),p),t.setMediaProperty(r,u),p=r}t.mediaProperties.set("backgroundImage",l+", "+p)}],[a("background-image-size"),function(e,t){const{enumValueMap:r,objValueMap:n}=x(e,"background-image-size");if(0===r.size&&0===n.size)return;const{enumDefault:o,objDefault:i}=L(e,"background-image-size"),a=v(e.id,"background-image-size-enum"),s=v(e.id,"background-image-size-obj");t.setDefaultValue(a,"ImageSize",o),t.setDefaultValue(s,"SizeOptions",i),t.setMediaProperty(a,r),t.setMediaProperty(s,n),t.mediaProperties.set("backgroundImageSize",`${a} !== undefined ? ${a} : ${s}`)}],[a("background-image-position"),function(e,t){const{enumValueMap:r,objValueMap:n}=x(e,"background-image-position");if(0===r.size&&0===n.size)return;const{enumDefault:o,objDefault:i}=L(e,"background-image-position"),a=v(e.id,"background-image-position-enum"),s=v(e.id,"background-image-position-obj");t.setDefaultValue(a,"Alignment",o),t.setDefaultValue(s,"Position",i),t.setMediaProperty(a,r),t.setMediaProperty(s,n),t.mediaProperties.set("backgroundImagePosition",`${a} !== undefined ? ${a} : ${s}`)}],[a("opacity"),_("opacity")],[a("visibility"),A("visibility","Visibility.")],[a("enabled"),N("enabled")],[a("font-color"),R("font-color")],[a("font-size"),S("font-size")],[a("font-style"),A("font-style","FontStyle.")],[a("font-weight"),function(e,t){const r=E(e,"font-weight",o.dealWithFontWeight);if(0===r.size)return;const n=T(e,"font-weight",o.dealWithFontWeight),i=v(e.id,"font-weight");t.setDefaultValue(i,c("font-weight"),n),t.setMediaProperty(i,r),t.mediaProperties.set("fontWeight",i)}],[a("font-family"),S("font-family")],[function(e){return e.hasMediaProperty("margin")||e.hasMediaProperty("margin-left")||e.hasMediaProperty("margin-top")||e.hasMediaProperty("margin-right")||e.hasMediaProperty("margin-bottom")},I("margin")],[function(e){return e.hasMediaProperty("padding")||e.hasMediaProperty("padding-left")||e.hasMediaProperty("padding-top")||e.hasMediaProperty("padding-right")||e.hasMediaProperty("padding-bottom")},I("padding")],[s("button","label"),function(e,t){const r=e.property.get("label"),n=e.dynamicProperty.get("label"),i=E(e,"label",o.quoteString);if(0===i.size)return;let a="''";o.isEmptyOrUndefined(r)||(a=o.quoteString(r)),o.isEmptyOrUndefined(n)||(a=o.getContentName(n));const s=v(e.id,"label");t.setDefaultValue(s,c("label"),a),t.setMediaProperty(s,i),t.setMediaParams(s)}],[s("button","type"),A("type","ButtonType.")],[s("button","state-effect"),N("state-effect")],[s("divider","vertical"),N("vertical")],[s("divider","color"),R("color")],[s("divider","stroke-width"),S("stroke-width")],[s("divider","line-cap"),A("line-cap","LineCapStyle.")],[z("image"),function(e,t){var r;const n=null!==(r=e.property.get("src"))&&void 0!==r?r:"",i=e.dynamicProperty.get("src"),a=E(e,"src",o.quoteString);if(0===a.size)return;let s=o.dealWithSrc(n);o.isEmptyOrUndefined(i)||(s=i);const u=v(e.id,"src");t.setDefaultValue(u,c("src"),s),t.setMediaProperty(u,a),t.setMediaParams(u)}],[s("image","alt"),S("alt")],[s("image","object-fit"),A("object-fit","ImageFit.")],[s("image","object-repeat"),A("object-repeat","ImageRepeat.")],[s("image","interpolation"),A("interpolation","ImageInterpolation.")],[s("image","render-mode"),A("render-mode","ImageRenderMode.")],[function(e){return e.hasMediaProperty("source-size-width")||e.hasMediaProperty("source-size-height")},function(e,t){let r=e.property.get("source-size-width"),n=e.property.get("source-size-height");const i=e.dynamicProperty.get("source-size-width"),a=e.dynamicProperty.get("source-size-height"),s=y(e,"source-size-width","source-size-height"),u=y(e,"source-size-height","source-size-width");if(0===s.size)return;r="0"===r||o.isEmptyOrUndefined(r)?"0":r.substring(0,r.length-2),n="0"===n||o.isEmptyOrUndefined(n)?"0":n.substring(0,n.length-2),o.isEmptyOrUndefined(i)||(r=i),o.isEmptyOrUndefined(a)||(n=a);const l=v(e.id,"source-size-width"),p=v(e.id,"source-size-height");t.setDefaultValue(l,c("source-size-width"),r),t.setDefaultValue(p,c("source-size-height"),n),t.setMediaProperty(l,s),t.setMediaProperty(p,u);const f=new Map([["width",l],["height",p]]);t.mediaProperties.set("sourceSize",f)}],[function(e){return"progress"===e.type&&(e.hasMediaProperty("value")||e.hasMediaProperty("total")||e.hasMediaProperty("style"))},function(e,t){const r=e.property.get("value"),n=e.dynamicProperty.get("value"),i=E(e,"value");if(!(t.mediaParams instanceof Map)||0===i.size)return;let a=null!=r?r:"0";o.isEmptyOrUndefined(n)||(a=n);const s=v(e.id,"value");t.setDefaultValue(s,c("value"),a),t.setMediaProperty(s,i),t.mediaParams.set("value",s)}],[s("progress","total"),w("total")],[s("progress","style"),b("style","ProgressStyle.")],[s("progress","color"),R("color")],[s("slider","value"),w("value")],[s("slider","min"),w("min")],[s("slider","max"),w("max")],[s("slider","step"),w("step")],[s("slider","style"),b("style","SliderStyle.")],[s("slider","block-color"),R("block-color")],[s("slider","track-color"),R("track-color")],[s("slider","selected-color"),R("selected-color")],[s("slider","show-steps"),N("show-steps")],[s("slider","show-tips"),N("show-tips")],[s("text","content"),function(e,t){const r=e.property.get("content"),n=e.dynamicProperty.get("content"),i=E(e,"content",o.quoteString);if(0===i.size)return;let a="''";o.isEmptyOrUndefined(r)||(a=o.quoteString(r)),o.isEmptyOrUndefined(n)||(a=o.getContentName(n));const s=v(e.id,"content");t.setDefaultValue(s,c("content"),a),t.setMediaProperty(s,i),t.setMediaParams(s)}],[s("text","text-align"),A("text-align","TextAlign.")],[s("text","text-overflow"),function(e,t){const r=E(e,"text-overflow",d);if(0===r.size)return;const n=T(e,"text-overflow",d),o=v(e.id,"text-overflow");t.setDefaultValue(o,c("text-overflow"),n),t.setMediaProperty(o,r),t.mediaProperties.set("textOverflow",new Map([["overflow",o]]))}],[s("text","max-lines"),_("max-lines")],[s("text","line-height"),S("line-height")],[function(e){return"text"===e.type&&(e.hasMediaProperty("decoration-type")||e.hasMediaProperty("decoration-color"))},function(e,t){const r=E(e,"decoration-type",o.curry(o.getEtsEnumValue)("TextDecorationType.")),n=E(e,"decoration-color",o.dealWithColor);if(0===r.size&&0===n.size)return;let i=T(e,"decoration-type",o.curry(o.getEtsEnumValue)("TextDecorationType.")),a=T(e,"decoration-color",o.dealWithColor);if(r.size>0){const n=v(e.id,"decoration-type");t.setDefaultValue(n,c("decoration-type"),i),t.setMediaProperty(n,r),i=n}if(n.size>0){const r=v(e.id,"decoration-color");t.setDefaultValue(r,c("decoration-color"),a),t.setMediaProperty(r,n),a=r}const s=new Map([["type",i]]);t.mediaProperties.set("decoration",s),"undefined"!==a&&s.set("color",a)}],[s("text","baseline-offset"),S("baseline-offset")],[s("text","text-case"),A("text-case","TextCase.")],[s("column","space"),C("space")],[s("column","align-items-column"),function(e,t){const r=E(e,"align-items-column",o.dealWithColumnAlignItems);if(0===r.size)return;const n=T(e,"align-items-column",o.dealWithColumnAlignItems),i=v(e.id,"align-items-column");t.setDefaultValue(i,c("align-items-column"),n),t.setMediaProperty(i,r),t.mediaProperties.set("alignItems",i)}],[s("column","justify-content-rc"),B("justify-content-rc","FlexAlign.")],[s("row","space"),C("space")],[s("row","align-items-row"),function(e,t){const r=E(e,"align-items-row",o.dealWithRowAlignItems);if(0===r.size)return;const n=T(e,"align-items-row",o.dealWithRowAlignItems),i=v(e.id,"align-items-row");t.setDefaultValue(i,c("align-items-row"),n),t.setMediaProperty(i,r),t.mediaProperties.set("alignItems",i)}],[s("row","justify-content-rc"),B("justify-content-rc","FlexAlign.")],[s("flex","flex-direction"),function(e,t){const r=E(e,"flex-direction",o.curry(o.getEtsEnumValue)("FlexDirection."));if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=T(e,"flex-direction",o.curry(o.getEtsEnumValue)("FlexDirection.")),i=v(e.id,"flex-direction");t.setDefaultValue(i,c("flex-direction"),n),t.setMediaProperty(i,r),t.mediaParams.set("direction",i)}],[s("flex","wrap"),function(e,t){const r=E(e,"wrap",o.dealWithWrap);if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=T(e,"wrap",o.dealWithWrap),i=v(e.id,"wrap");t.setDefaultValue(i,c("wrap"),n),t.setMediaProperty(i,r),t.mediaParams.set("wrap",i)}],[s("flex","justify-content"),G("justify-content","FlexAlign.")],[s("flex","align-items-flex"),function(e,t){const r=E(e,"align-items-flex",o.dealWithFlexAlignItems);if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=T(e,"align-items-flex",o.dealWithFlexAlignItems),i=v(e.id,"align-items-flex");t.setDefaultValue(i,c("align-items-flex"),n),t.setMediaProperty(i,r),t.mediaParams.set("alignItems",i)}],[s("flex","align-content"),G("align-content","FlexAlign.")],[s("list","space-list"),function(e,t){const r=E(e,"space-list");if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=T(e,"space-list"),o=v(e.id,"space-list");t.setDefaultValue(o,c("space-list"),n),t.setMediaProperty(o,r),t.mediaParams.set("space",o)}],[s("list","initial-index"),w("initial-index")],[s("list","list-direction"),A("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasMediaProperty("divider-stroke-width")||e.hasMediaProperty("divider-color")||e.hasMediaProperty("divider-start-margin")||e.hasMediaProperty("divider-end-margin"))},function(e,t){const r=[["divider-stroke-width",o.quoteString],["divider-color",o.dealWithColor],["divider-start-margin",o.quoteString],["divider-end-margin",o.quoteString]];let n=0;const i=new Map;for(const[a,s]of r){const r=E(e,a,s),u=o.getEtsPropName(a.replace("divider-",""));let l=T(e,a,s);if("undefined"===l&&"divider-stroke-width"===a&&(l="0"),r.size>0){const o=v(e.id,a);t.setDefaultValue(o,c(a),l),t.setMediaProperty(o,r),l=o,n++}i.set(u,l)}n>0&&t.mediaProperties.set("divider",i)}],[s("list","edit-mode"),N("edit-mode")],[s("list","edge-effect"),A("edge-effect","EdgeEffect.")],[s("list","chain-animation"),N("chain-animation")],[s("list-item","sticky"),A("sticky","Sticky.")],[s("list-item","editable"),N("editable")],[s("swiper","index"),_("index")],[s("swiper","auto-play"),N("auto-play")],[s("swiper","interval"),_("interval")],[s("swiper","indicator"),N("indicator")],[s("swiper","loop"),N("loop")],[s("swiper","duration"),_("duration")],[s("swiper","vertical"),N("vertical")],[s("swiper","item-space"),S("item-space")],[s("swiper","cached-count"),_("cached-count")],[s("swiper","disable-swipe"),N("disable-swipe")],[s("text-input","placeholder"),C("placeholder")],[s("text-input","textInput-type"),function(e,t){const r=E(e,"textInput-type",o.curry(o.getEtsEnumValue)("InputType."));if(0===r.size)return;const n=T(e,"textInput-type",o.curry(o.getEtsEnumValue)("InputType.")),i=v(e.id,"textInput-type");t.setDefaultValue(i,c("textInput-type"),n),t.setMediaProperty(i,r),t.mediaProperties.set("type",i)}],[s("text-input","placeholderColor"),R("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasMediaProperty("placeholderFont-size")||e.hasMediaProperty("placeholderFont-weight")||e.hasMediaProperty("placeholderFont-family")||e.hasMediaProperty("placeholderFont-style"))},function(e,t){const r=[["size",o.quoteString],["weight",p],["family",o.quoteString],["style",o.curry(o.getEtsEnumValue)("FontStyle.")]];let n=0;const i=new Map;for(const[o,a]of r){const r=`placeholderFont-${o}`,s=E(e,r,a);let u=T(e,r,a);if(s.size>0){const o=v(e.id,r);t.setDefaultValue(o,c(r),u),t.setMediaProperty(o,s),u=o,n++}i.set(o,u)}n>0&&t.mediaProperties.set("placeholderFont",i)}],[s("text-input","enterKeyType"),A("enterKeyType","EnterKeyType.")],[s("text-input","caretColor"),R("caretColor")],[s("text-input","maxLength"),_("maxLength")]]},973:(e,t)=>{"use strict";function r(e){return(...t)=>t.lengtht.property.has(e)||t.dynamicProperty.has(e))),o=r(((e,t,r)=>r.type===e&&(r.property.has(t)||r.dynamicProperty.has(t))));function i(e){return JSON.stringify(e)}function a(e,t,r){const n=t.dynamicProperty.get(e);return void 0!==n&&""!==n.trim()&&(r.properties.set(E(e),n),!0)}t.quoteString=i;const s=r(((e,t,r)=>{if(a(e,t,r))return;const n=t.property.get(e);void 0!==n&&r.properties.set(E(e),i(n))}));function c(e){return void 0===e||""===e}t.isEmptyOrUndefined=c;const u=r(((e,t,r)=>{if(a(e,t,r))return;const n=t.property.get(e);c(n)||r.properties.set(E(e),n)})),l=r(((e,t,r)=>{if(a(e,t,r))return;const n=t.property.get(e);c(n)||r.properties.set(E(e),n)})),p=r(((e,t,r,n)=>{if(a(e,r,n))return;const o=r.property.get(e);c(o)||n.properties.set(E(e),v(t,o))}));function f(e,t,r){const n=t.dynamicProperty.get(e);return void 0!==n&&""!==n.trim()&&r.params instanceof Map&&(r.params.set(E(e),n),!0)}const d=r(((e,t,r)=>{if(f(e,t,r))return;const n=t.property.get(e);void 0!==n&&r.params instanceof Map&&r.params.set(E(e),i(n))})),y=r(((e,t,r)=>{if(f(e,t,r))return;const n=t.property.get(e);!c(n)&&r.params instanceof Map&&r.params.set(E(e),n)})),h=r(((e,t,r,n)=>{if(f(e,r,n))return;const o=r.property.get(e);!c(o)&&n.params instanceof Map&&n.params.set(E(e),v(t,o))})),m=r(((e,t,r)=>{if(a(e,t,r))return;let n=t.property.get(e);c(n)||(n=T(n),r.properties.set(E(e),n))}));function g([e,...t]){return(null==e?void 0:e.toUpperCase())+t.join("")}function E(e){const t=e.split("-");let r=t[0];for(let e=1;ee[0].toUpperCase()+e.slice(1))).join(""));const n=function(e){var t,r;const n=e.dynamicProperty.get("for"),o=e.dynamicProperty.get("keyGenerator"),i=null!==(t=e.property.get("item"))&&void 0!==t?t:"item",a=null!==(r=e.property.get("idx"))&&void 0!==r?r:"idx";return void 0!==e.dynamicProperty.get("for")?{for:n,key:o,item:i,idx:a}:null}(e);r.setForEachObj(n);const o=void 0!==e.dynamicProperty.get("if")?e.dynamicProperty.get("if"):e.property.get("if");void 0===o?r.setIfBoolean(null):r.setIfBoolean(o);for(const t of L)("boolean"==typeof t[0]||t[0](e))&&t[1](e,r);!function(e,r){for(let n of t.events){const t=e.property.get(n);"onDisappear"===n&&(n="onDisAppear");const o=".bind(this)";void 0!==t&&""!==t&&("this"===t.split(".")[0]?r.properties.set(n,t+o):r.properties.set(n,t))}}(e,r)},t.events=["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange","onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop","onComplete","onError","onFinish","onChange","onSubmit","onEditChanged"],t.firstUpperCase=g,t.getEtsPropName=E,t.getEtsEnumValue=v,t.dealWithColor=T;const _=r(((e,t,r,n)=>{if(!(n.params instanceof Map))return;const o=r.dynamicProperty.get(e);if(!c(o))return void n.params.set(E(e),o);const i=r.property.get(e);if(c(i))return;let a=v(t,i);"flex-start"===i?a=t+"Start":"flex-end"===i&&(a=t+"End"),n.params.set(E(e),a)})),N=r(((e,t,r,n)=>{if(!(n.properties instanceof Map))return;const o=r.dynamicProperty.get(e);if(!c(o))return void n.properties.set("justifyContent",o);const i=r.property.get(e);if(c(i))return;let a=v(t,i);"flex-start"===i?a=t+"Start":"flex-end"===i&&(a=t+"End"),n.properties.set("justifyContent",a)})),A=r(((e,t)=>t.type===e));function C(e){return null===e.match(/\$(r|rawfile)\('(.*)'\)$/)?i(e):e}function w(e){let t=v("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}function b(e){let t=v("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}function R(e){let t=v("FlexWrap.",e);return"nowrap"===e&&(t="FlexWrap.NoWrap"),t}function O(e){let t=v("VerticalAlign.",e);return"flex-start"===e?t="VerticalAlign.Top":"flex-end"===e&&(t="VerticalAlign.Bottom"),t}function I(e){let t=v("HorizontalAlign.",e);return"flex-start"===e?t="HorizontalAlign.Start":"flex-end"===e&&(t="HorizontalAlign.End"),t}function M(e){return["lighter","normal","regular","medium","bold","bolder"].includes(e)?v("FontWeight.",e):e}function P(e){const t=new Map([["repeat-x","X"],["repeat-y","Y"],["repeat","XY"],["no-repeat","NoRepeat"]]).get(e);if(null!=t&&""!==t)return v("ImageRepeat.",t)}function x(e){return e.startsWith("$r(")?e:`\`\${${e}}\``}t.dealWithSrc=C,t.dealWithAlignSelf=w,t.dealWithFlexAlignItems=b,t.dealWithWrap=R,t.dealWithRowAlignItems=O,t.dealWithColumnAlignItems=I,t.dealWithFontWeight=M,t.dealWithBackgroundImagePosition=function(e){if(new Set(["TopStart","Top","TopEnd","Start","Center","End","BottomStart","Bottom","BottomEnd"]).has(e))return"Alignment."+e;const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null!==t?`{ x: ${i(t[1])}, y: ${i(t[4])} }`:void 0},t.dealWithBackgroundImageSize=function(e){if(new Set(["Cover","Contain","Auto"]).has(e))return v("ImageSize.",e);const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null!==t?void 0!==t[5]?`{ width: ${i(t[1])}, height: ${i(t[5])} }`:`{ width: ${i(t[1])} }`:void 0},t.dealWithBackgroundRepeat=P,t.getContentName=x;const L=[[n("width"),s("width")],[n("height"),s("height")],[function(e){return e.hasProperty("constraint-size-min-width")||e.hasProperty("constraint-size-max-width")||e.hasProperty("constraint-size-min-height")||e.hasProperty("constraint-size-max-height")},function(e,t){const r=new Map,n=e.getProperty("constraint-size-min-width"),o=e.getProperty("constraint-size-max-width"),i=e.getProperty("constraint-size-min-height"),a=e.getProperty("constraint-size-max-height");S("minWidth",n,r,e.dynamicProperty.has("constraint-size-min-width")),S("maxWidth",o,r,e.dynamicProperty.has("constraint-size-max-width")),S("minHeight",i,r,e.dynamicProperty.has("constraint-size-min-height")),S("maxHeight",a,r,e.dynamicProperty.has("constraint-size-max-height")),r.size>0&&t.properties.set("constraintSize",r)}],[n("align"),p("align","Alignment.")],[n("direction"),p("direction","Direction.")],[function(e){return e.hasProperty("left")||e.hasProperty("top")},function(e,t){const r="absolute"===e.property.get("position")?"position":"offset",n=e.property.get("left"),o=e.property.get("top"),a=e.dynamicProperty.get("left"),s=e.dynamicProperty.get("top");if(c(a)&&c(s)&&c(n)&&c(o))return;const u=new Map([["x",i(null!=n?n:"0")],["y",i(null!=o?o:"0")]]);c(a)||u.set("x",a),c(s)||u.set("y",s),t.properties.set(r,u)}],[n("aspect-ratio"),u("aspect-ratio")],[n("display-priority"),u("display-priority")],[n("flex-basis"),s("flex-basis")],[n("flex-grow"),u("flex-grow")],[n("flex-shrink"),u("flex-shrink")],[n("align-self"),function(e,t){const r=e.dynamicProperty.get("align-self");if(!c(r))return void t.properties.set("alignSelf",r);const n=e.property.get("align-self");if(c(n))return;const o=w(n);t.properties.set("alignSelf",o)}],[n("border-style"),p("border-style","BorderStyle.")],[n("border-width"),s("border-width")],[n("border-color"),m("border-color")],[n("border-radius"),s("border-radius")],[n("background-color"),m("background-color")],[function(e){return e.hasProperty("background-image-src")||e.hasProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),n=e.property.get("background-image-repeat"),o=e.dynamicProperty.get("background-image-src"),i=e.dynamicProperty.get("background-image-repeat");if(c(r)&&c(n)&&c(o)&&c(i))return;let a=C(null!=r?r:"");if(c(o)||(a=o),c(i)){if(!c(n)){const e=P(n);null!=e&&""!==e&&(a=a+", "+e)}}else a=a+", "+i;t.properties.set("backgroundImage",a)}],[n("background-image-size"),function(e,t){const r=e.dynamicProperty.get("background-image-size");if(!c(r))return void t.properties.set("backgroundImageSize",r);const n=e.property.get("background-image-size");if(c(n))return;if(new Set(["Cover","Contain","Auto"]).has(n))return void t.properties.set("backgroundImageSize",v("ImageSize.",n));const o=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);null!==o&&(void 0!==o[5]?t.properties.set("backgroundImageSize",new Map([["width",i(o[1])],["height",i(o[5])]])):t.properties.set("backgroundImageSize",new Map([["width",i(o[1])]])))}],[n("background-image-position"),function(e,t){const r=e.dynamicProperty.get("background-image-position");if(!c(r))return void t.properties.set("backgroundImagePosition",r);const n=e.property.get("background-image-position");if(c(n))return;if(new Set(["TopStart","Top","TopEnd","Start","Center","End","BottomStart","Bottom","BottomEnd"]).has(n))return void t.properties.set("backgroundImagePosition","Alignment."+n);const o=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);null!==o&&t.properties.set("backgroundImagePosition",new Map([["x",i(o[1])],["y",i(o[4])]]))}],[n("opacity"),u("opacity")],[n("visibility"),p("visibility","Visibility.")],[n("enabled"),l("enabled")],[n("font-color"),m("font-color")],[n("font-size"),s("font-size")],[n("font-style"),p("font-style","FontStyle.")],[n("font-weight"),function(e,t){const r=e.getProperty("font-weight");if(c(r))return;const n=M(r);t.properties.set("fontWeight",n)}],[n("font-family"),s("font-family")],[function(e){return e.hasProperty("margin")||e.hasProperty("margin-left")||e.hasProperty("margin-top")||e.hasProperty("margin-right")||e.hasProperty("margin-bottom")},function(e,t){var r,n,o,i;const a=new Map,s=e.getProperty("margin"),c=null!==(r=e.getProperty("margin-top"))&&void 0!==r?r:s,u=null!==(n=e.getProperty("margin-bottom"))&&void 0!==n?n:s,l=null!==(o=e.getProperty("margin-left"))&&void 0!==o?o:s,p=null!==(i=e.getProperty("margin-right"))&&void 0!==i?i:s,f=e.property.has("margin-top"),d=e.property.has("margin-bottom"),y=e.property.has("margin-left"),h=e.property.has("margin-right"),m=e.dynamicProperty.has("margin"),g=e.dynamicProperty.has("margin-top"),E=e.dynamicProperty.has("margin-bottom"),v=e.dynamicProperty.has("margin-left"),T=e.dynamicProperty.has("margin-right");S("top",c,a,g||!f&&m),S("bottom",u,a,E||!d&&m),S("left",l,a,v||!y&&m),S("right",p,a,T||!h&&m),a.size>0&&t.properties.set("margin",a)}],[function(e){return e.hasProperty("padding")||e.hasProperty("padding-left")||e.hasProperty("padding-top")||e.hasProperty("padding-right")||e.hasProperty("padding-bottom")},function(e,t){var r,n,o,i;const a=new Map,s=e.getProperty("padding"),c=null!==(r=e.getProperty("padding-top"))&&void 0!==r?r:s,u=null!==(n=e.getProperty("padding-bottom"))&&void 0!==n?n:s,l=null!==(o=e.getProperty("padding-left"))&&void 0!==o?o:s,p=null!==(i=e.getProperty("padding-right"))&&void 0!==i?i:s,f=e.property.has("padding-top"),d=e.property.has("padding-bottom"),y=e.property.has("padding-left"),h=e.property.has("padding-right"),m=e.dynamicProperty.has("padding"),g=e.dynamicProperty.has("padding-top"),E=e.dynamicProperty.has("padding-bottom"),v=e.dynamicProperty.has("padding-left"),T=e.dynamicProperty.has("padding-right");S("top",c,a,g||!f&&m),S("bottom",u,a,E||!d&&m),S("left",l,a,v||!y&&m),S("right",p,a,T||!h&&m),a.size>0&&t.properties.set("padding",a)}],[o("button","label"),function(e,t){const r=e.dynamicProperty.get("label");if(!c(r))return void t.setParams(x(r));const n=e.property.get("label");"string"==typeof n&&t.setParams(i(n))}],[o("button","type"),p("type","ButtonType.")],[o("button","state-effect"),l("state-effect")],[o("divider","vertical"),l("vertical")],[o("divider","color"),m("color")],[o("divider","stroke-width"),s("stroke-width")],[o("divider","line-cap"),p("line-cap","LineCapStyle.")],[A("image"),function(e,t){var r;const n=e.dynamicProperty.get("src");if(!c(n))return void t.setParams(n);const o=null!==(r=e.property.get("src"))&&void 0!==r?r:"";t.setParams(C(o))}],[o("image","alt"),s("alt")],[o("image","object-fit"),p("object-fit","ImageFit.")],[o("image","object-repeat"),p("object-repeat","ImageRepeat.")],[o("image","interpolation"),p("interpolation","ImageInterpolation.")],[o("image","render-mode"),p("render-mode","ImageRenderMode.")],[function(e){return e.hasProperty("source-size-width")||e.hasProperty("source-size-height")},function(e,t){let r=e.getProperty("source-size-width"),n=e.getProperty("source-size-height");if(c(r)&&c(n))return;const o=e.dynamicProperty.has("source-size-width"),i=e.dynamicProperty.has("source-size-height");r="0"===r||c(r)?"0":o?r:r.substring(0,r.length-2),n="0"===n||c(n)?"0":i?n:n.substring(0,n.length-2);const a=new Map([["width",r],["height",n]]);t.properties.set("sourceSize",a)}],[function(e){return"progress"===e.type&&(e.hasProperty("value")||e.hasProperty("total")||e.hasProperty("style"))},function(e,t){var r;f("value",e,t)||t.params instanceof Map&&t.params.set("value",null!==(r=e.getProperty("value"))&&void 0!==r?r:"0")}],[o("progress","total"),y("total")],[o("progress","style"),h("style","ProgressStyle.")],[o("progress","color"),m("color")],[o("slider","value"),y("value")],[o("slider","min"),y("min")],[o("slider","max"),y("max")],[o("slider","step"),y("step")],[o("slider","style"),h("style","SliderStyle.")],[o("slider","block-color"),m("block-color")],[o("slider","track-color"),m("track-color")],[o("slider","selected-color"),m("selected-color")],[o("slider","show-steps"),l("show-steps")],[o("slider","show-tips"),l("show-tips")],[o("text","content"),function(e,t){const r=e.property.get("content"),n=e.dynamicProperty.get("content");c(n)?"string"==typeof r&&t.setParams(i(r)):t.setParams(x(n))}],[o("text","text-align"),p("text-align","TextAlign.")],[o("text","text-overflow"),function(e,t){const r=e.dynamicProperty.get("text-overflow");if(!c(r))return void t.properties.set("textOverflow",new Map([["overflow",r]]));const n=e.property.get("text-overflow");c(n)||t.properties.set("textOverflow",new Map([["overflow","TextOverflow."+g(n)]]))}],[o("text","max-lines"),u("max-lines")],[o("text","line-height"),s("line-height")],[function(e){return"text"===e.type&&(e.hasProperty("decoration-type")||e.hasProperty("decoration-color"))},function(e,t){const r=e.property.get("decoration-type"),n=e.dynamicProperty.get("decoration-type"),o=e.property.get("decoration-color"),i=e.dynamicProperty.get("decoration-color");if(c(r)&&c(o)&&c(n)&&c(i))return;const a=new Map;c(n)?a.set("type",c(r)?"TextDecorationType.None":v("TextDecorationType.",r)):a.set("type",n),t.properties.set("decoration",a),c(i)?c(o)||a.set("color",T(o)):a.set("color",i)}],[o("text","baseline-offset"),s("baseline-offset")],[o("text","text-case"),p("text-case","TextCase.")],[o("column","space"),d("space")],[o("column","align-items-column"),function(e,t){const r=e.dynamicProperty.get("align-items-column");if(!c(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-column");if(c(n))return;const o=I(n);t.properties.set("alignItems",o)}],[o("column","justify-content-rc"),N("justify-content-rc","FlexAlign.")],[o("row","space"),d("space")],[o("row","align-items-row"),function(e,t){const r=e.dynamicProperty.get("align-items-row");if(!c(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-row");if(c(n))return;const o=O(n);t.properties.set("alignItems",o)}],[o("row","justify-content-rc"),N("justify-content-rc","FlexAlign.")],[o("flex","flex-direction"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("flex-direction");if(!c(r))return void t.params.set("direction",r);const n=e.property.get("flex-direction");c(n)||t.params.set("direction",v("FlexDirection.",n))}],[o("flex","wrap"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("wrap");if(!c(r))return void t.params.set("wrap",r);const n=e.property.get("wrap");if(c(n))return;const o=R(n);t.params.set("wrap",o)}],[o("flex","justify-content"),_("justify-content","FlexAlign.")],[o("flex","align-items-flex"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-items-flex");if(!c(r))return void t.params.set("alignItems",r);const n=e.property.get("align-items-flex");if(c(n))return;const o=b(n);t.params.set("alignItems",o)}],[o("flex","align-content"),_("align-content","FlexAlign.")],[o("list","space-list"),function(e,t){const r=e.dynamicProperty.get("space-list");if(void 0!==r&&""!==r.trim()&&t.params instanceof Map)return void t.params.set("space",r);const n=e.getProperty("space-list");!c(n)&&t.params instanceof Map&&t.params.set("space",n)}],[o("list","initial-index"),y("initial-index")],[o("list","list-direction"),p("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasProperty("divider-stroke-width")||e.hasProperty("divider-color")||e.hasProperty("divider-start-margin")||e.hasProperty("divider-end-margin"))},function(e,t){const r=e.property.get("divider-stroke-width"),n=e.dynamicProperty.get("divider-stroke-width"),o=new Map([["strokeWidth",i(null!=r?r:"0")]]);c(n)||o.set("strokeWidth",n);const a=e.property.get("divider-color"),s=e.dynamicProperty.get("divider-color"),u=e.property.get("divider-start-margin"),l=e.dynamicProperty.get("divider-start-margin"),p=e.property.get("divider-end-margin"),f=e.dynamicProperty.get("divider-end-margin");c(s)?c(a)||o.set("color",T(a)):o.set("color",s),c(l)?c(u)||o.set("startMargin",i(u)):o.set("startMargin",l),c(f)?c(p)||o.set("endMargin",i(p)):o.set("endMargin",f),t.properties.set("divider",o)}],[o("list","edit-mode"),l("edit-mode")],[o("list","edge-effect"),p("edge-effect","EdgeEffect.")],[o("list","chain-animation"),l("chain-animation")],[o("list-item","sticky"),p("sticky","Sticky.")],[o("list-item","editable"),l("editable")],[o("swiper","index"),u("index")],[o("swiper","auto-play"),l("auto-play")],[o("swiper","interval"),u("interval")],[o("swiper","indicator"),l("indicator")],[o("swiper","loop"),l("loop")],[o("swiper","duration"),u("duration")],[o("swiper","vertical"),l("vertical")],[o("swiper","item-space"),s("item-space")],[o("swiper","cached-count"),u("cached-count")],[o("swiper","disable-swipe"),l("disable-swipe")],[o("text-input","placeholder"),d("placeholder")],[o("text-input","textInput-type"),function(e,t){const r=e.dynamicProperty.get("textInput-type");if(!c(r))return void t.properties.set("type",r);const n=e.property.get("textInput-type");c(n)||t.properties.set("type","InputType."+n)}],[o("text-input","placeholderColor"),m("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasProperty("placeholderFont-size")||e.hasProperty("placeholderFont-weight")||e.hasProperty("placeholderFont-family")||e.hasProperty("placeholderFont-style"))},function(e,t){const r=e.property.get("placeholderFont-size"),n=e.dynamicProperty.get("placeholderFont-size"),o=e.property.get("placeholderFont-weight"),a=e.dynamicProperty.get("placeholderFont-weight"),s=e.property.get("placeholderFont-family"),u=e.dynamicProperty.get("placeholderFont-family"),l=e.property.get("placeholderFont-style"),p=e.dynamicProperty.get("placeholderFont-style"),f=new Map;c(n)?c(r)||f.set("size",parseInt(r)):f.set("size",n),c(a)?c(o)||f.set("weight",isNaN(Number(o))?v("FontWeight.",o):o):f.set("weight",a),c(u)?c(s)||f.set("family",i(s)):f.set("family",u),c(p)?c(l)||f.set("style",v("FontStyle.",l)):f.set("style",p),t.properties.set("placeholderFont",f)}],[o("text-input","enterKeyType"),p("enterKeyType","EnterKeyType.")],[o("text-input","caretColor"),m("caretColor")],[o("text-input","maxLength"),u("maxLength")]]},243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Style=t.Tag=void 0;const n=r(117);class o extends n.ASTNode{constructor(e,t,r){super(),this.tagName=e,this.attributes=t,this.content=r}}t.Tag=o;class i extends n.ASTNode{constructor(e,t,r,n){super(),this.mediaQuery=void 0,this.kind=e,this.name=t,this.content=r,this.mediaQuery=n}}t.Style=i},573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const n=r(243),o=r(334);class i{constructor(e){this.cache=e}visit(e){e instanceof n.Tag?this.genTag(e):e instanceof n.Style&&this.genStyle(e)}static getMethodGen(e){return void 0===i.instance?i.instance=new i(e):i.instance.setCache(e),i.instance}setCache(e){this.cache=e}genTag(e){if(this.cache.concat(o.TokenClass.TAG_START,e.tagName),this.cache.indentOff(),e.attributes.forEach(((e,t)=>{let r="";for(const t of e)r+='"'===t?""":"\n"===t?" ":t;this.cache.concat(o.TokenClass.SPACE,t,o.TokenClass.ASSIGN,o.TokenClass.LQUOTE,r,o.TokenClass.RQUOTE)})),null===e.content)this.cache.concat(o.TokenClass.EMPTY_TAG_END);else{if(this.cache.concat(o.TokenClass.TAG_END),"string"==typeof e.content){let t="";for(const r of e.content)t+="<"===r?"<":r;this.cache.concat(t)}else 0!==e.content.length&&(this.cache.concat(o.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent(),e.content.forEach((e=>{e.accept(this),this.cache.indentOff(),this.cache.concat(o.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.decIndent(),this.cache.indentOn());this.cache.concat(o.TokenClass.END_TAG_START,e.tagName,o.TokenClass.TAG_END)}}genStyle(e){void 0!==e.mediaQuery&&(this.cache.concat("@media"),this.cache.indentOff(),this.cache.concat(o.TokenClass.SPACE,e.mediaQuery,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent()),"IDStyle"===e.kind&&(this.cache.concat(o.TokenClass.ID_STYLE_START),this.cache.indentOff()),this.cache.concat(e.name,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent(),e.content.forEach(((e,t)=>{this.cache.concat(t,o.TokenClass.COLON,o.TokenClass.SPACE,e,o.TokenClass.SEMICOLON,o.TokenClass.NEW_LINE)})),this.cache.decIndent(),this.cache.concat(o.TokenClass.RBRA,o.TokenClass.NEW_LINE),void 0!==e.mediaQuery&&(this.cache.decIndent(),this.cache.concat(o.TokenClass.RBRA,o.TokenClass.NEW_LINE)),this.cache.concat(o.TokenClass.NEW_LINE)}}t.ASTNodeGenerator=i,i.instance=void 0},844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CSSBridge=t.HMLBridge=void 0;const n=r(243),o=r(571);t.HMLBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map([["id",e.id]]);let r="";for(let[n,i]of e.property)o.isAttribute(n,e.type)?("string"!=typeof i&&(i=JSON.stringify(i)),t.set(n,i)):o.isContent(n)&&(r=i);if(e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}const i=new n.Tag(e.type,t,r);return"wrapper"===t.get("id")?new n.Tag("div",new Map,[i]):i}},t.CSSBridge=class{constructor(){this.errors=0,this.styles=[]}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}genIDStyle(e){var t;const r=t=>{const r=new Map;for(const[n,i]of t)o.isStyle(n,e.type)&&r.set(n,i);return r},i=r(e.property);i.size>0&&this.styles.push(new n.Style("IDStyle",e.id,i)),(null!==(t=e.mediaProperty)&&void 0!==t?t:new Map).forEach(((t,o)=>{const i=r(t);i.size>0&&this.styles.push(new n.Style("IDStyle",e.id,i,o))}));for(const t of e.children)t.accept(this)}visit(e){return this.genIDStyle(e),this.styles}}},55:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genFACSS=t.genFAHML=void 0;const n=r(573),o=r(862);t.genFAHML=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" "));return e.accept(t),t.cache.toString()},t.genFACSS=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" "));return e.forEach((e=>{e.accept(t)})),t.cache.toString()}},571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEvent=t.isData=t.isUnknown=t.isContent=t.isAttribute=t.isStyle=t.styleMap=void 0;const n=r(904),o=["width","height","min-width","min-height","max-width","max-height","padding","padding-start","padding-end","padding-top","padding-right","padding-bottom","padding-left","margin","margin-start","margin-end","margin-top","margin-right","margin-bottom","margin-left","border-width","border-style","border-color","border-radius","border-top-width","border-top-style","border-top-color","border-top-left-radius","border-right-width","border-right-style","border-right-color","border-top-right-radius","border-bottom-width","border-bottom-style","border-bottom-color","border-bottom-right-radius","border-left-width","border-left-style","border-left-color","border-bottom-left-radius","background-color","background","background-image","background-size","background-position","background-repeat","display","opacity","visibility","flex","flex-grow","flex-shrink","flex-basis","position","display","top","right","bottom","left","display-index","flex-weight","aspect-ratio"],i=["font-size","font-family","font-style","font-weight"],a=["text-align","line-height","text-decoration","letter-spacing","max-lines","text-overflow","allow-scale","min-font-size","max-font-size","font-size-step","prefer-font-sizes","color",...i],s=["allow-scale","text-decoration","color",...i],c=["text-color","allow-scale","icon-width","icon-height","radius",...i],u=["texton-color","textoff-color","text-padding","allow-scale",...i],l=["column-height","text-color","allow-scale","letter-spacing","text-decoration","line-height","opacity",...i],p=["text-color","allow-scale","letter-spacing",...i];t.styleMap=new Map([["common",new Set([...o])],["div",new Set(["flex-direction","overflow","flex-wrap","justify-content","align-items","align-content","grid-template-columns","grid-template-rows","grid-row-start","grid-row-end","grid-column-start","grid-column-end","grid-gap","grid-columns-gap","grid-rows-gap"])],["text",new Set([...a])],["image",new Set(["object-fit","match-text-direction","fit-original-size"])],["span",new Set([...s])],["input",new Set(["font-size","font-family","font-weight","color","placeholder-color","allow-scale"])],["button",new Set([...c])],["switch",new Set([...u])],["refresh",new Set(["progress-color"])],["divider",new Set(["stroke-width","line-cap","color"])],["chart",new Set(["stroke-width","radius","start-angle","total-angle","center-x","center-y","colors","weights"])],["picker",new Set([...l])],["picker-view",new Set(["color","font-size","selected-color","selected-font-size","focus-color","focus-font-size","disappear-color","disappear-font-size","font-family"])],["slider",new Set(["color","selected-color","block-color"])],["swiper",new Set(["indicator-color","indicator-selected-color","indicator-size","indicator-top","indicator-right","indicator-bottom","indicator-left"])],["list",new Set(["flex-direction","columns","item-extent","fade-color"])],["list-item",new Set(["column-span"])],["progress",new Set(["color","stroke-width","background-color","secondary-color","scale-width","scale-number","start-angle","total-angle","center-x","center-y","radius"])],["select",new Set(["font-family"])],["menu",new Set([...p])],["option",new Set(["color","font-family","allow-scale","font-size","font-weight","text-decoration"])],["video",new Set(["object-fit"])],["clock",new Set(["font-family"])]]);const f=new Map([["common",new Set(["id","ref","disabled","focusable","data","if","for"])],["image",new Set(["src","alt"])],["button",new Set(["type","value","icon","waiting"])],["refresh",new Set(["offset","refreshing","type","lasttime","friction"])],["input",new Set(["type","checked","name","value","placeholder","maxlength","enterkeytype","headericon"])],["switch",new Set(["checked","showtext","texton","textoff"])],["option",new Set(["value","selected","icon"])],["chart",new Set(["type","percent","datasets","options"])],["picker",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","value","vibrate"])],["picker-view",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","indicatorprefix","indicatorsuffix","vibrate"])],["slider",new Set(["min","max","step","showtips","showsteps","mode","value"])],["divider",new Set(["vertical"])],["list",new Set(["scrollpage","cachedcount","scrollbar","scrolleffect","shapemode","indexer","itemscale","itemcenter","updateeffect","scrollvibrate","initialindex","initialoffset"])],["list-item",new Set(["type","primary","section","sticky","stickyradius","clickeffect"])],["swiper",new Set(["index","autoplay","interval","indicator","digital","indicatordisabled","loop","duration","vertical"])],["progress",new Set(["type","percent","secondarypercent","clockwise"])],["menu",new Set(["target","title","type"])],["clock",new Set(["clockconfig","showdigit","hourswest"])],["badge",new Set(["placement","count","visible","maxcount","config","label"])],["video",new Set(["muted","src","autoplay","poster","controls","loop","starttime","direction","speed"])],["tabs",new Set(["index","vertical"])],["tab-bar",new Set(["mode"])],["tab-content",new Set(["scrollable"])]]),d=new Map([["common",new Set(["ontouchstart","ontouchmove","ontouchcancel","ontouchend","onclick","onlongpress","onfocus","onblur","onkey","onswipe"])],["image",new Set(["oncomplete","onerror"])],["input",new Set(["onchange","onenterkeyclick"])],["select",new Set(["onchange"])],["refresh",new Set(["onrefresh","onpulldown"])],["swiper",new Set(["onchange","onrotation"])],["list",new Set(["onindexerchange","onscroll","onscrollbottom","onscrolltop","onscrollend","onscrolltouchup","onrequestitem"])],["list-item",new Set(["onsticky"])],["menu",new Set(["onselected","oncancel"])],["picker",new Set(["oncolumnchange","onchange","oncancel"])],["picker-view",new Set(["oncolumnchange","onchange"])],["video",new Set(["onprepared","onstart","onpause","onfinish","onerror","onseeking","onseeked","ontimeupdate","onfullscreenchange","onstop"])],["tabs",new Set(["onchange"])],["switch",new Set(["onchange"])],["dialog",new Set(["oncancel"])]]),y=new Map([["common",new Set(["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange"])],["image",new Set(["onComplete","onError","onFinish"])],["swiper",new Set(["onChange"])],["list",new Set(["onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop"])],["text-input",new Set(["onChange","onSubmit","onEditChanged"])]]);function h(e,t,r){const n=t.get(r);return void 0!==n&&n.has(e)}function m(e,r){return h(e,t.styleMap,"common")||h(e,t.styleMap,r)}function g(e,t){return n.getDomain()===n.Domain.ETS?h(e,y,"common")||h(e,y,t):E(e,t)||v(e,t)}function E(e,t){return h(e,f,"common")||h(e,f,t)}function v(e,t){return h(e,d,"common")||h(e,d,t)}t.isStyle=m,t.isAttribute=g,t.isContent=function(e){return"content"===e},t.isUnknown=function(e,t){return!m(e,t)&&!g(e,t)},t.isData=E,t.isEvent=v},334:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.INDENT=" ",r.SPACE=" ",r.LQUOTE='"',r.RQUOTE='"',r.TAG_START="<",r.TAG_END=">",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.etsPropertyList=void 0;const n=r(958),o=r(513),i=["vp","px","%","lpx"],a=[{propertySector:o.Sector.FEATURE,propertySet:{name:"FontSize",property:"font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontStyle",property:"font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontColor",property:"font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontWeight",property:"font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},{value:"100"},{value:"200"},{value:"300"},{value:"400"},{value:"500"},{value:"600"},{value:"700"},{value:"800"},{value:"900"}],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextAlign",property:"text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"LineHeight",property:"line-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextOverflow",property:"text-overflow-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_OVERFLOW,list:[o.CLEAN_VALUE_NODE,{name:"Clip",value:"clip"},{name:"Ellipsis",value:"ellipsis"},{name:"None",value:"none"}],defaults:"clip"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"BaselineOffset",property:"baseline-offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DecorationType",property:"decoration-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_DECORATION_TYPE,list:[o.CLEAN_VALUE_NODE,{name:"Underline",value:"underline"},{name:"LineThrough",value:"line-through"},{name:"Overline",value:"overline"},{name:"None",value:"none"}],defaults:"none"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DecorationColor",property:"decoration-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextCase",property:"text-case-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_CASE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"LowerCase"},{value:"UpperCase"}],defaults:"Normal"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"ForEach",property:"for-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"KeyGenerator",property:"keyGenerator-visual",type:o.TypeName.BASE,etsType:"Event",supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Item",property:"item-visual",type:o.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Item of ForEach Array"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Idx",property:"idx-visual",type:o.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Index of Corresponding Item In ForEach Array"}}],s=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Placeholder",property:"placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Type",property:"textInput-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.INPUT_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Password"},{value:"Email"},{value:"Number"}],defaults:"Normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderColor",property:"placeholderColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontSize",property:"placeholderFont-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["fp"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontWeight",property:"placeholderFont-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Lighter"},{value:"Regular"},{value:"Medium"},{value:"Bold"},{value:"Bolder"},{value:"100"},{value:"200"},{value:"300"},{value:"400"},{value:"500"},{value:"600"},{value:"700"},{value:"800"},{value:"900"}],defaults:"400"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontFamily",property:"placeholderFont-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontStyle",property:"placeholderFont-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Italic"}],defaults:"Normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EnterKeyType",property:"enterKeyType-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ENTER_KEY_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Go"},{value:"Search"},{value:"Send"},{value:"Next"},{value:"Done"}],defaults:"Done"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CaretColor",property:"caretColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"MaxLength",property:"maxLength-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}}],c={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["vp","px","lpx"],placeholder:"0"},u=[{propertySector:o.Sector.GENERAL,propertySet:{name:"Width",property:"width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:i}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Height",property:"height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:i}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MinWidth",property:"constraint-size-min-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:i}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MinHeight",property:"constraint-size-min-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:i}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MaxWidth",property:"constraint-size-max-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:i}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MaxHeight",property:"constraint-size-max-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:i}},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"Margin",property:"margin-visual"},c)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"Padding",property:"padding-visual"},c)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginTop",property:"margin-top-visual"},c)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginRight",property:"margin-right-visual"},c)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginBottom",property:"margin-bottom-visual"},c)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginLeft",property:"margin-left-visual"},c)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingTop",property:"padding-top-visual"},c)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingRight",property:"padding-right-visual"},c)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingBottom",property:"padding-bottom-visual"},c)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingLeft",property:"padding-left-visual"},c)}],l={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:i},p={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:i},f=[{propertySector:o.Sector.DIMENSION,propertySet:{name:"Border",property:"border-visual",type:o.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-width-visual"},l),Object.assign({name:"Style",property:"border-style-visual"},o.commonParamsForBorder),{name:"Color",property:"border-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR},Object.assign({name:"Radius",property:"border-radius-visual"},p)]}}],d=[{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"Vertical",property:"vertical-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"LineCap",property:"line-cap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.LINE_CAP_STYLE,defaults:"butt",list:[o.CLEAN_VALUE_NODE,{name:"Butt",value:"butt"},{name:"Round",value:"round"},{name:"Square",value:"square"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StrokeWidth",property:"stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:i}}],y=[{propertySector:o.Sector.FEATURE,propertySet:{name:"InitialIndex",property:"initial-index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ListDirection",property:"list-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.AXIS,list:[o.CLEAN_VALUE_NODE,{name:"Vertical",value:"vertical"},{name:"Horizontal",value:"horizontal"}],defaults:"vertical"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Color",property:"divider-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StrokeWidth",property:"divider-stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:i}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StartMargin",property:"divider-start-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:i}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EndMargin",property:"divider-end-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:i}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EditMode",property:"edit-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EdgeEffect",property:"edge-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{name:"Spring",value:"spring"},{name:"None",value:"none"}],defaults:"spring"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ChainAnimation",property:"chain-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}],h=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Sticky",property:"sticky-visual",type:o.TypeName.SELECT,etsType:o.EtsType.STICKY,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"Normal",value:"normal"}],defaults:"none"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Editable",property:"editable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}],m=[{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageSrc",property:"background-image-src-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageRepeat",property:"background-image-repeat-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_REPERT,list:[o.CLEAN_VALUE_NODE,{name:"X",value:"repeat-x"},{name:"Y",value:"repeat-y"},{name:"XY",value:"repeat"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageSize",property:"background-image-size-visual",type:o.TypeName.DATA_SELECT_INPUT,etsType:`${o.EtsType.IMAGE_SIZE}|${o.EtsType.STRING}`,list:[o.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Auto",value:"auto"}],defaults:"Auto"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImagePosition",property:"background-image-position-visual",type:o.TypeName.DATA_SELECT_INPUT,etsType:`${o.EtsType.ALIGNMENT}|${o.EtsType.STRING}`,list:[o.CLEAN_VALUE_NODE,{name:"TopStart",value:"top left"},{name:"Top",value:"top center"},{name:"TopEnd",value:"top right"},{name:"Start",value:"center left"},{name:"Center",value:"center center"},{name:"End",value:"center right"},{name:"BottomStart",value:"bottom left"},{name:"Bottom",value:"bottom center"},{name:"BottomEnd",value:"bottom right"}],defaults:"0 0"}}],g=[{propertySector:o.Sector.GENERAL,propertySet:{name:"Location",property:"position-visual",type:o.TypeName.SELECT,defaults:"offset",supportDynamicProperty:!1,list:[o.CLEAN_VALUE_NODE,{name:"offset",value:"relative"},{name:"position",value:"absolute"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"X",property:"left-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Y",property:"top-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}}],E=[{propertySector:o.Sector.FLEX,propertySet:{name:"FlexBasis",property:"flex-basis-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:i,defaults:"auto",fixedValues:["auto"],info:"The initial main size of a flex item. It sets the size of the content box otherwise set with box-sizing."}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignSelf",property:"align-self-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"auto",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FLEX,propertySet:{name:"Direction",property:"flex-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_DIRECTION,defaults:"row",list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"RowReverse",value:"row-reverse"},{name:"Column",value:"column"},{name:"ColumnReverse",value:"column-reverse"}],info:"The direction of flex."}},{propertySector:o.Sector.FLEX,propertySet:{name:"Wrap",property:"wrap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_WRAP,defaults:"nowrap",list:[o.CLEAN_VALUE_NODE,{name:"NoWrap",value:"nowrap"},{name:"Wrap",value:"wrap"},{name:"WrapReverse",value:"wrap-reverse"}],info:"Whether flex items are forced onto one line or multiple lines."}},{propertySector:o.Sector.FLEX,propertySet:{name:"JustifyContent",property:"justify-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"JustifyContent",property:"justify-content-rc-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignItems",property:"align-items-flex-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"stretch",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignContent",property:"align-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Set the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis."}}],v=[{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"AutoPlay",property:"auto-play-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"Interval",property:"interval-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER,defaults:3e3}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"Loop",property:"loop-visual"},o.commonParamsForJudge),{defaults:!0})},{propertySector:o.Sector.FEATURE,propertySet:{name:"Duration",property:"duration-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER,defaults:400}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ItemSpace",property:"item-space-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_LENGTH,defaults:"0"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CachedCount",property:"cached-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER,defaults:1}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"DisableSwipe",property:"disable-swipe-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"Index",property:"index-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER,defaults:0}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"Indicator",property:"indicator-visual"},o.commonParamsForJudge),{defaults:!0})}];t.etsPropertyList=[...f,...u,...a,...s,...d,...g,...y,...h,...E,...v,...n.commonPropertyList,...m,{propertySector:o.Sector.ATOMIC,propertySet:{name:"DisplayPriority",property:"display-priority-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Visibility",property:"visibility-visual",type:o.TypeName.SELECT,etsType:o.EtsType.VISIBILITY,defaults:"visible",list:[o.CLEAN_VALUE_NODE,{name:"Visible",value:"visible"},{name:"Hidden",value:"hidden"},{name:"None",value:"none"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Enabled",property:"enabled-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"true",list:[{value:"true"},{value:"false"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Align",property:"align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ALIGNMENT,defaults:"center",list:[o.CLEAN_VALUE_NODE,{name:"TopStart",value:"top-start"},{name:"Top",value:"top"},{name:"TopEnd",value:"top-end"},{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"},{name:"BottomStart",value:"bottom-start"},{name:"Bottom",value:"bottom"},{name:"BottomEnd",value:"bottom-end"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"If",property:"if-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Space",property:"space-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["vp","px","lpx"],requires:{"display-visual":["flex","cleanValue"]},info:"Space between any two adjacent child components."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Space",property:"space-list-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,requires:{"display-visual":["flex","cleanValue"]},info:"Space between any two adjacent child components."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"AlignItems",property:"align-items-row-visual",type:o.TypeName.SELECT,etsType:o.EtsType.VERTICAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[o.CLEAN_VALUE_NODE,{value:"flex-start",name:"top",etsEnumValue:"Top"},{value:"flex-end",name:"bottom",etsEnumValue:"Bottom"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the vertical direction."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"AlignItems",property:"align-items-column-visual",type:o.TypeName.SELECT,etsType:o.EtsType.HORIZONTAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[o.CLEAN_VALUE_NODE,{value:"flex-start",name:"start",etsEnumValue:"Start"},{value:"flex-end",name:"end",etsEnumValue:"End"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the horizontal direction."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Src",property:"src-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_SRC}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Alt",property:"alt-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT}},{propertySector:o.Sector.FEATURE,propertySet:{name:"RenderMode",property:"render-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_RENDER_MODE,defaults:"original",list:[o.CLEAN_VALUE_NODE,{name:"Original",value:"original"},{name:"Template",value:"template"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ObjectRepeat",property:"object-repeat-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_REPERT,defaults:"no-repeat",list:[o.CLEAN_VALUE_NODE,{name:"X",value:"X"},{name:"Y",value:"Y"},{name:"XY",value:"XY"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ObjectFit",property:"object-fit-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_FIT,defaults:"cover",list:[o.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Fill",value:"fill"},{name:"None",value:"none"},{name:"ScaleDown",value:"scale-down"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"InterPolation",property:"interpolation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_INTERPOLATION,defaults:"none",list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"High",value:"high"},{name:"Medium",value:"medium"},{name:"Low",value:"low"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SourceSizeWidth",property:"source-size-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SourceSizeHeight",property:"source-size-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Type",property:"type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BUTTON_TYPE,defaults:"capsule",list:[{name:"Normal",value:"normal"},{name:"Capsule",value:"capsule"},{name:"Circle",value:"circle"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StateEffect",property:"state-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"true",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Content",property:"content-visual",type:o.TypeName.ADJUSTABLE,etsType:o.EtsType.COMB_CONTENT}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Label",property:"label-visual",type:o.TypeName.ADJUSTABLE,etsType:o.EtsType.COMB_CONTENT}}]},958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonPropertyList=void 0;const n=r(513);t.commonPropertyList=[{propertySector:n.Sector.GENERAL,propertySet:{name:"BackgroundColor",property:"background-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Display",property:"display-visual",type:n.TypeName.SELECT,defaults:"flex",list:[n.CLEAN_VALUE_NODE,{value:"flex"},{value:"none"}]}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Opacity",property:"opacity-visual",type:n.TypeName.SLIDER,etsType:n.EtsType.COMB_R_NUMBER,defaults:"1",step:.01,max:1,min:0}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Overflow",property:"overflow-visual",type:n.TypeName.SELECT,defaults:"visible",list:[n.CLEAN_VALUE_NODE,{value:"visible"},{value:"hidden"},{value:"scroll"}]}},{propertySector:n.Sector.FLEX,propertySet:{name:"FlexGrow",property:"flex-grow-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:"0",requiresParent:{display:["flex","cleanValue"]},info:"The flex grow factor of a flex item's main size"}},{propertySector:n.Sector.FLEX,propertySet:{name:"FlexShrink",property:"flex-shrink-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:"1",requiresParent:{display:["flex","cleanValue"]},info:"The flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items will shrink"}},{propertySector:n.Sector.FLEX,propertySet:{name:"Columns",property:"columns-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:1,info:"The column number of flex."}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Header Logo",property:"headerLogo-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Title",property:"title-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Status",property:"status-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Logo",property:"logo-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Color",property:"color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FontFamily",property:"font-family-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_CONTENT,defaults:"sans-serif"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"MaxLines",property:"max-lines-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextColor",property:"text-color-visual",type:n.TypeName.COLOR,defaults:"rgba(0,0,0,0.9)"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FocusColor",property:"focus-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"DisappearColor",property:"disappear-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorColor",property:"indicator-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorSelectedColor",property:"indicator-selected-color-visual",type:n.TypeName.COLOR,defaults:"#ff007dff"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorSize",property:"indicator-size-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorTop",property:"indicator-top-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorRight",property:"indicator-right-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorBottom",property:"indicator-bottom-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorLeft",property:"indicator-left-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:{name:"AllowScale",property:"allow-scale-visual",type:n.TypeName.SELECT,defaults:"true",list:[n.CLEAN_VALUE_NODE,{value:"true"},{value:"false"}]}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowStart",property:"grid-row-start-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its row in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnStart",property:"grid-column-start-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its column in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowEnd",property:"grid-row-end-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its row in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnEnd",property:"grid-column-end-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its column in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridTemplateRows",property:"grid-template-rows-visual",type:n.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid rows."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridTemplateColumns",property:"grid-template-columns-visual",type:n.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid columns."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowsGap",property:"grid-rows-gap-visual",type:n.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's grid rows."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnsGap",property:"grid-columns-gap-visual",type:n.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's columns."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridGap",property:"grid-gap-visual",type:n.TypeName.INTEGER,units:["px"],requires:{"display-visual":["grid"]},info:"The gaps between rows and columns. It is a shorthand for row-gap and column-gap."}},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"MatchTextDirection",property:"match-text-direction-visual"},n.commonParamsForJudge)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"FitOriginalSize",property:"fit-original-size-visual"},n.commonParamsForJudge)},{propertySector:n.Sector.FEATURE,propertySet:{name:"IconWidth",property:"icon-width-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IconHeight",property:"icon-height-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextonColor",property:"texton-color-visual",type:n.TypeName.COLOR,defaults:"#000000"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextoffColor",property:"textoff-color-visual",type:n.TypeName.COLOR,defaults:"#000000"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextPadding",property:"text-padding-visual",type:n.TypeName.INTEGER,defaults:0,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"SelectedColor",property:"selected-color-visual",type:n.TypeName.COLOR,defaults:"rgba(0,125,255,1)"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"BlockColor",property:"block-color-visual",type:n.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Radius",property:"radius-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"StartAngle",property:"start-angle-visual",type:n.TypeName.INTEGER,defaults:240}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TotalAngle",property:"total-angle-visual",type:n.TypeName.INTEGER,defaults:240}},{propertySector:n.Sector.FEATURE,propertySet:{name:"CenterX",property:"center-x-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"CenterY",property:"center-y-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Colors",property:"colors-visual",type:n.TypeName.BASE}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Weights",property:"weights-visual",type:n.TypeName.BASE}},{propertySector:n.Sector.FEATURE,propertySet:{name:"PlaceHolderColor",property:"placeholder-color-visual",type:n.TypeName.COLOR,defaults:"gray"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ProgressColor",property:"progress-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR,defaults:"black"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ItemExtent",property:"item-extent-visual",type:n.TypeName.INTEGER,units:["px","%"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FadeColor",property:"fade-color-visual",type:n.TypeName.COLOR,defaults:"grey"}},{propertySector:n.Sector.FLEX,propertySet:{name:"ColumnSpan",property:"column-span-visual",type:n.TypeName.INTEGER,defaults:1,min:1,info:"The number of span."}},{propertySector:n.Sector.ATOMIC,propertySet:{name:"FlexWeight",property:"flex-weight-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.ATOMIC,propertySet:{name:"AspectRatio",property:"aspect-ratio-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"SecondaryColor",property:"secondary-color-visual",type:n.TypeName.COLOR,requires:{type:["horizontal","ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ScaleWidth",property:"scale-width-visual",type:n.TypeName.INTEGER,requires:{type:["ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ScaleNumber",property:"scale-number-visual",type:n.TypeName.INTEGER,defaults:120,requires:{type:["ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Value",property:"value-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:0}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Total",property:"total-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:100}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Style",property:"style-visual",type:n.TypeName.SELECT,etsType:n.EtsType.PROGRESS_STYLE,defaults:"Linear",list:[{value:"Linear"}]}}]},513:(e,t)=>{"use strict";var r,n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.EtsType=t.commonParamsForBorderRadius=t.commonParamsForIndicator=t.commonParamsForInteger=t.commonParamsForJudge=t.commonParamsForBorder=t.CLEAN_VALUE_NODE=t.TypeName=t.Sector=void 0,function(e){e.GENERAL="general",e.DIMENSION="dimension",e.FEATURE="feature",e.FLEX="flex",e.GRID="grid",e.ATOMIC="atomic"}(r||(r={})),t.Sector=r,function(e){e.BASE="base",e.INTEGER="integer",e.SELECT="select",e.COLOR="color",e.COMPOSITE="composite",e.SLIDER="slider",e.DATA_SELECT_INPUT="dataSelectInput",e.ADJUSTABLE="adjustable"}(n||(n={})),t.TypeName=n,function(e){e.ARRAY="ETSArray",e.BOOLEAN="ETSBoolean",e.NUMBER="ETSNumber",e.OBJECT="ETSObject",e.STRING="ETSString",e.R_FLOAT="Rfloat",e.R_STRING="Rstring",e.R_COLOR="Rcolor",e.R_MEDIA="Rmedia",e.R_RAWFILE="Rrawfile",e.ALIGNMENT="Alignment",e.AXIS="Axis",e.BORDER_STYLE="BorderStyle",e.BUTTON_TYPE="ButtonType",e.COLOR="Color",e.DIRECTION="Direction",e.EDGE_EFFECT="EdgeEffect",e.ENTER_KEY_TYPE="EnterKeyType",e.FLEX_ALIGN="FlexAlign",e.FLEX_DIRECTION="FlexDirection",e.FLEX_WRAP="FlexWrap",e.FONT_STYLE="FontStyle",e.FONT_WEIGHT="FontWeight",e.HORIZONTAL_ALIGN="HorizontalAlign",e.IMAGE_FIT="ImageFit",e.IMAGE_INTERPOLATION="ImageInterpolation",e.IMAGE_RENDER_MODE="ImageRenderMode",e.IMAGE_REPERT="ImageRepeat",e.IMAGE_SIZE="ImageSize",e.INPUT_TYPE="InputType",e.ITEM_ALIGN="ItemAlign",e.LINE_CAP_STYLE="LineCapStyle",e.PROGRESS_STYLE="ProgressStyle",e.STICKY="Sticky",e.TEXT_ALIGN="TextAlign",e.TEXT_OVERFLOW="TextOverflow",e.TEXT_DECORATION_TYPE="TextDecorationType",e.TEXT_CASE="TextCase",e.VERTICAL_ALIGN="VerticalAlign",e.VISIBILITY="Visibility",e.COMB_COLOR="ETSString|ETSNumber|Color|Rcolor",e.COMB_LENGTH="ETSString|ETSNumber",e.COMB_R_NUMBER="ETSNumber|Rfloat",e.COMB_R_LENGTH="ETSString|ETSNumber|Rfloat",e.COMB_CONTENT="ETSString|Rstring",e.COMB_SRC="ETSString|Rmedia|Rrawfile"}(o||(o={})),t.EtsType=o;const i={value:"cleanValue",name:"---Clean Value---"};t.CLEAN_VALUE_NODE=i;const a={type:n.SELECT,etsType:o.BORDER_STYLE,list:[i,{value:"dotted",etsEnumValue:"Dotted"},{value:"dashed",etsEnumValue:"Dashed"},{value:"solid",etsEnumValue:"Solid"}]};t.commonParamsForBorder=a;const s={type:n.SELECT,etsType:o.BOOLEAN,defaults:"false",list:[i,{value:"true"},{value:"false"}]};t.commonParamsForJudge=s;const c={type:n.INTEGER,units:["px"],placeholder:"0px"};t.commonParamsForInteger=c;const u={type:n.INTEGER,units:["px","%"]};t.commonParamsForIndicator=u;const l={type:n.INTEGER,units:["px"]};t.commonParamsForBorderRadius=l},282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TagTypeMap=void 0,t.TagTypeMap=new Map([["button","TextContent"],["span","TextContent"],["divider","TextContent"],["picker","TextContent"],["option","TextContent"],["clock","TextContent"],["image","Base"],["input","Base"],["chart","Base"],["slider","Base"],["progress","Base"],["text","Text"],["div","Container"],["list","Container"],["list-item","Container"],["list-item-group","Container"],["refresh","Container"],["dialog","Container"],["stack","Container"],["menu","Container"],["select","Container"],["tabs","Container"],["tab-bar","Container"],["tab-content","Container"]])},294:(e,t)=>{"use strict";function r(e){let t=function(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");let r="";for(let t=0;t=4&&(t=t.substr(t.length/2-2,4)),t}Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueName=t.getUniqueId=t.removeFromArray=t.getDataName=void 0,t.getDataName=function(e){if("string"==typeof e&&e.startsWith("{{")&&e.endsWith("}}"))return e.substring(2,e.length-2)},t.removeFromArray=function(e,t){const r=[...e];return t.forEach((e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)})),r},t.getUniqueId=r,t.getUniqueName=function(e){return`${e}_${r(e)}`}},207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formManager=void 0;const n=r(891),o=r(945);t.formManager={removeData(e){this.getFormModel().data.delete(e)},addData(e){e instanceof Map?e.forEach(((e,t)=>{this.getFormModel().data.set(t,e)})):Object.keys(e).forEach((t=>{this.getFormModel().data.set(t,e[t])}))},updateAllData(e){this.getFormModel().data.clear(),this.addData(e)},addAction(e,t,r,n){const i=new Map;void 0!==r&&Object.keys(r).forEach((e=>{i.set(e,r[e])}));const a=new Map;void 0!==n&&Object.keys(n).forEach((e=>{a.set(e,n[e])})),this.getFormModel().actions.set(e,new o.FormAction(t,i,a))},updateAllActions(e){this.getFormModel().actions.clear(),e.forEach(((e,t)=>{const r=void 0===e.params?e.params:this.objectToMap(e.params),n=void 0===e.want?e.want:this.objectToMap(e.want),i=new o.FormAction(e.actionType,r,n);this.getFormModel().actions.set(t,i)}))},removeAction(e){this.getFormModel().actions.delete(e)},addActionParams(e,t){var r,n;const i=null!==(r=this.getFormModel().actions.get(e))&&void 0!==r?r:new o.FormAction(e),a=null!==(n=i.params)&&void 0!==n?n:new Map;Object.keys(t).forEach((e=>{a.set(e,t[e])})),i.params=a},removeActionParam(e,t){var r;const n=this.getFormModel().actions.get(e);null===(r=null==n?void 0:n.params)||void 0===r||r.delete(t)},getFormModel:()=>n.getInstance().formData,codegenToJson:function(){const e=n.getInstance().formData,t=this.mapToObject(e.data),r={actions:{},data:{}};return r.data=t,e.actions.forEach(((e,t)=>{r.actions[t]={},r.actions[t].action=e.action,e.params instanceof Map&&e.params.size>0&&(r.actions[t].params=this.mapToObject(e.params)),e.want instanceof Map&&e.want.size>0&&(r.actions[t].want=this.mapToObject(e.want))})),JSON.stringify(r,null,4)},clear(){n.getInstance().formData.data.clear(),n.getInstance().formData.actions.clear()},mapToObject:e=>void 0===e?{}:Array.from(e.entries()).reduce(((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r})),{}),objectToMap(e){const t=new Map;return Object.keys(e).forEach(((r,n)=>{t.set(r,e[r])})),t}}},945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormAction=t.FormModel=void 0,t.FormModel=class{constructor(){this.data=new Map,this.actions=new Map}},t.FormAction=class{constructor(e,t,r){this.action=e,this.params=t,this.want=r}}},509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeForVersion1=t.rootToVisualContent=t.visualToRootContent=t.serializeForVersion1=void 0;const n=r(891),o=r(933),i=r(571),a=r(282),s=r(945),c=r(977),u=new Map;function l(e){u.set("textMap",new Map);const t=p(null!=e?e:n.getInstance().visualModel);return JSON.stringify({VisualVersion:"1",content:JSON.stringify(t),extraData:JSON.stringify(y(u))})}function p(e){const t=Array.from(e.property).filter((t=>i.isAttribute(t[0],e.type)));t.push(["id",e.id]);const r=Array.from(e.property).filter((t=>i.isStyle(t[0],e.type)));let n=a.TagTypeMap.get(e.type);void 0===n&&(n="Base");let o=e.property.has("content")?e.property.get("content"):[];if(e.children.length>0){if("string"==typeof o){const t=u.get("textMap");t instanceof Map&&t.set(e.id,o)}o=e.children.map((e=>p(e)))}return{id:e.id,tagName:e.type,attributes:t,idStyle:r,type:n,content:o}}function f(e,t){let r;if(t instanceof Map){const n=t.get("textMap");n instanceof Map&&(r=n.get(e.id))}const n=new o.VisualModel({id:e.id,type:e.tagName,property:new Map([...e.attributes,...e.idStyle])});return"string"==typeof r&&n.property.set("content",r),n.property.delete("id"),"string"==typeof e.content&&n.property.set("content",e.content),Array.isArray(e.content)&&(n.children=e.content.map((e=>f(e,t)))),n}function d(e){if(e instanceof Array&&e.length>0&&"$$map"===e[0]){e.shift();const t=new Map;for(const[r,n]of e)t.set(r,d(n));return t}return e}function y(e){if(e instanceof Map){const t=["$$map"];for(const[r,n]of e)t.push([r,y(n)]);return t}return e}t.serializeForVersion1=l,t.visualToRootContent=function(e){try{return l(JSON.parse(e,c.reviver).visualModel)}catch(e){console.error("convert visual model to root model failed")}return e},t.rootToVisualContent=function(e){const t=JSON.parse(e),r=JSON.parse(t.content);let n='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(n=JSON.parse(t.extraData));const o=f(r,d(n));return o.property.has("flex-direction")||o.property.set("flex-direction","column"),JSON.stringify({document:{VisualVersion:"12",type:"FA"},visualModel:o,formData:new s.FormModel},c.replacer)},t.deserializeForVersion1=function(e){try{const t=JSON.parse(e),r=JSON.parse(t.content);let o='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(o=JSON.parse(t.extraData)),n.getInstance().visualModel=f(r,d(o)),n.getInstance().visualModel.property.has("flex-direction")||n.getInstance().visualModel.property.set("flex-direction","column")}catch(e){console.error("convert error")}}},891:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setInstance=t.getInstance=void 0;const n=r(933),o=r(945),i=r(904),a={document:{VisualVersion:"12",type:"FA"},visualModel:new n.VisualModel({type:"div",id:"wrapper"}),formData:new o.FormModel};t.getInstance=function(){return a},t.setInstance=function(e){for(const t in a)Object.prototype.hasOwnProperty.call(e,t)&&(a[t]=e[t]);const t=a.document.type;i.setDomain("ETS"===t?i.Domain.ETS:"FORM"===t?i.Domain.FORM:i.Domain.FA)}},977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviver=t.replacer=t.deserialize=t.serialize=void 0;const n=r(933),o=r(891),i=r(509);function a(e,t){if(t instanceof Map)return{dataType:"Map",value:Object.fromEntries(t.entries())};if(t instanceof Set)return{dataType:"Set",value:Array.from(t.entries())};if(t instanceof n.VisualModel){const e=new n.VisualModel({type:"none"}),r={};for(const n in e)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return{dataType:"VisualModel",value:r}}return t}function s(e,t){if("object"==typeof t&&null!=t){if("Map"===t.dataType)return new Map(Object.entries(t.value));if("Set"===t.dataType)return new Set(t.value);if("VisualModel"===t.dataType){const e=new n.VisualModel({type:""});Object.assign(e,t.value),t=e}}return t}t.serialize=function(e,t){return 1===e?i.serializeForVersion1(t):JSON.stringify(null!=t?t:o.getInstance(),a,4)},t.deserialize=function(e){if("1"===JSON.parse(e).VisualVersion)return i.deserializeForVersion1(e);const t=JSON.parse(e,s);o.setInstance(t)},t.replacer=a,t.reviver=s},933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VisualModel=void 0;const r="-visual";t.VisualModel=class{constructor(e){if(this.propertyStorage=void 0,this.dynamicPropertyStorage=void 0,this.mediaProperty=void 0,this.dynamicMediaProperty=void 0,this.mediaPropertyStorage=void 0,this.dynamicMediaPropertyStorage=void 0,this.property=void 0!==e.property?e.property:new Map,this.dynamicProperty=void 0!==e.dynamicProperty?e.dynamicProperty:new Map,this.children=void 0!==e.children?e.children:[],"wrapper"===e.type)return this.id="wrapper",void(this.type="div");e.type.endsWith(r)&&(e.type=e.type.substring(0,e.type.length-r.length)),this.id=void 0!==e.id?e.id:"",this.type=e.type}getProperty(e){const t=this.dynamicProperty.get(e);return void 0!==t&&""!==t?t:this.property.get(e)}hasMediaProperty(e){if(void 0!==this.mediaProperty)for(const[,t]of this.mediaProperty)if(null==t?void 0:t.has(e))return!0;if(void 0!==this.dynamicMediaProperty)for(const[,t]of this.dynamicMediaProperty)if(null==t?void 0:t.has(e))return!0;return!1}hasProperty(e){return this.dynamicProperty.has(e)||this.property.has(e)}accept(e){return e.visit(this)}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";var e=n;Object.defineProperty(e,"__esModule",{value:!0});const t=r(784),o=r(891),i=r(977),a=r(844),s=r(55),c=r(207),u=r(413),l=r(435),p=r(486),f={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""};function d(e,r){var n;try{i.deserialize(e);const t=o.getInstance().document.VisualVersion,n=/^([1-9]+[0-9]*)$/;if(void 0===t)r.errorType="versionError";else{const e=t.match(n);(null===e||parseInt(e[1])>12)&&(r.errorType="versionError")}}catch(e){r.errorType="fileError"}""!==r.errorType&&(r.errorMessage=null!==(n=t.errorMap.get(r.errorType))&&void 0!==n?n:"Codegen visual file failed")}e.genHmlAndCss=function(e){const r={hmlCss:{hml:"",css:"",json:""},errorType:"",errorMessage:""};if(d(e,r),""!==r.errorType)return r.hmlCss.hml="",r.hmlCss.css="",r;try{const e=function(e){const t={hml:"",css:"",json:""},r=new a.HMLBridge,n=e.accept(r),o=s.genFAHML(n);t.hml=r.getErrorCount()>0?"error":o;const i=new a.CSSBridge,c=e.accept(i),u=s.genFACSS(c);return t.css=i.getErrorCount()>0?"error":u,t}(o.getInstance().visualModel);"error"!==e.hml&&"error"!==e.css||(r.errorType="codegenError"),r.hmlCss=e,"FORM"===o.getInstance().document.type&&(r.hmlCss.json=c.formManager.codegenToJson())}catch(e){r.errorType="modelError"}return""!==r.errorType&&(r.errorMessage=t.errorMap.get(r.errorType),r.hmlCss.hml="",r.hmlCss.css=""),r},e.genETS=function(e){var r;const n={ets:p.cloneDeep(f),errorType:"",errorMessage:""};if(d(e,n),""!==n.errorType)return n.ets=p.cloneDeep(f),n;try{const e=function(e){const t=new u.ETSBridge,r=e.accept(t),n=(new l.StringWriter).genETS(r);return t.getErrorCount()>0?"error":n}(o.getInstance().visualModel);"error"===e&&(n.errorType="codegenError"),n.ets=e}catch(e){n.errorType="modelError"}return""!==n.errorType&&(n.errorMessage=null!==(r=t.errorMap.get(n.errorType))&&void 0!==r?r:"Codegen visual file failed",n.ets=p.cloneDeep(f)),n}})();var o=exports;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{var e={486:function(e,t,r){var n;e=r.nmd(e),function(){var o,a="Expected a function",i="__lodash_hash_undefined__",s="__lodash_placeholder__",l=32,p=128,c=1/0,u=9007199254740991,f=NaN,y=4294967295,d=[["ary",p],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",h="[object Boolean]",E="[object Date]",T="[object Error]",v="[object Function]",S="[object GeneratorFunction]",_="[object Map]",N="[object Number]",C="[object Object]",A="[object Promise]",P="[object RegExp]",b="[object Set]",M="[object String]",w="[object Symbol]",R="[object WeakMap]",O="[object ArrayBuffer]",I="[object DataView]",x="[object Float32Array]",L="[object Float64Array]",k="[object Int8Array]",D="[object Int16Array]",F="[object Int32Array]",V="[object Uint8Array]",U="[object Uint8ClampedArray]",B="[object Uint16Array]",z="[object Uint32Array]",G=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,H=RegExp($.source),Y=RegExp(q.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,oe=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,pe=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,ye=/^[-+]0x[0-9a-f]+$/i,de=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,he=/^(?:0|[1-9]\d*)$/,Ee=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Te=/($^)/,ve=/['\n\r\u2028\u2029\\]/g,Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="a-z\\xdf-\\xf6\\xf8-\\xff",Ne="A-Z\\xc0-\\xd6\\xd8-\\xde",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ae="["+Ce+"]",Pe="["+Se+"]",be="\\d+",Me="["+_e+"]",we="[^\\ud800-\\udfff"+Ce+be+"\\u2700-\\u27bf"+_e+Ne+"]",Re="\\ud83c[\\udffb-\\udfff]",Oe="[^\\ud800-\\udfff]",Ie="(?:\\ud83c[\\udde6-\\uddff]){2}",xe="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Ne+"]",ke="(?:"+Me+"|"+we+")",De="(?:"+Le+"|"+we+")",Fe="(?:['’](?:d|ll|m|re|s|t|ve))?",Ve="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ue="(?:"+Pe+"|"+Re+")?",Be="[\\ufe0e\\ufe0f]?",ze=Be+Ue+"(?:\\u200d(?:"+[Oe,Ie,xe].join("|")+")"+Be+Ue+")*",Ge="(?:"+["[\\u2700-\\u27bf]",Ie,xe].join("|")+")"+ze,je="(?:"+[Oe+Pe+"?",Pe,Ie,xe,"[\\ud800-\\udfff]"].join("|")+")",We=RegExp("['’]","g"),$e=RegExp(Pe,"g"),qe=RegExp(Re+"(?="+Re+")|"+je+ze,"g"),He=RegExp([Le+"?"+Me+"+"+Fe+"(?="+[Ae,Le,"$"].join("|")+")",De+"+"+Ve+"(?="+[Ae,Le+ke,"$"].join("|")+")",Le+"?"+ke+"+"+Fe,Le+"+"+Ve,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",be,Ge].join("|"),"g"),Ye=RegExp("[\\u200d\\ud800-\\udfff"+Se+"\\ufe0e\\ufe0f]"),Je=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Qe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Xe=-1,Ke={};Ke[x]=Ke[L]=Ke[k]=Ke[D]=Ke[F]=Ke[V]=Ke[U]=Ke[B]=Ke[z]=!0,Ke[m]=Ke[g]=Ke[O]=Ke[h]=Ke[I]=Ke[E]=Ke[T]=Ke[v]=Ke[_]=Ke[N]=Ke[C]=Ke[P]=Ke[b]=Ke[M]=Ke[R]=!1;var Ze={};Ze[m]=Ze[g]=Ze[O]=Ze[I]=Ze[h]=Ze[E]=Ze[x]=Ze[L]=Ze[k]=Ze[D]=Ze[F]=Ze[_]=Ze[N]=Ze[C]=Ze[P]=Ze[b]=Ze[M]=Ze[w]=Ze[V]=Ze[U]=Ze[B]=Ze[z]=!0,Ze[T]=Ze[v]=Ze[R]=!1;var et={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tt=parseFloat,rt=parseInt,nt="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,ot="object"==typeof self&&self&&self.Object===Object&&self,at=nt||ot||Function("return this")(),it=t&&!t.nodeType&&t,st=it&&e&&!e.nodeType&&e,lt=st&&st.exports===it,pt=lt&&nt.process,ct=function(){try{return st&&st.require&&st.require("util").types||pt&&pt.binding&&pt.binding("util")}catch(e){}}(),ut=ct&&ct.isArrayBuffer,ft=ct&&ct.isDate,yt=ct&&ct.isMap,dt=ct&&ct.isRegExp,mt=ct&&ct.isSet,gt=ct&&ct.isTypedArray;function ht(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Et(e,t,r,n){for(var o=-1,a=null==e?0:e.length;++o-1}function Ct(e,t,r){for(var n=-1,o=null==e?0:e.length;++n-1;);return r}function Ht(e,t){for(var r=e.length;r--&&xt(t,e[r],0)>-1;);return r}function Yt(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var Jt=Vt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Qt=Vt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Xt(e){return"\\"+et[e]}function Kt(e){return Ye.test(e)}function Zt(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function er(e,t){return function(r){return e(t(r))}}function tr(e,t){for(var r=-1,n=e.length,o=0,a=[];++r",""":'"',"'":"'"}),lr=function e(t){var r,n=(t=null==t?at:lr.defaults(at.Object(),t,lr.pick(at,Qe))).Array,oe=t.Date,Se=t.Error,_e=t.Function,Ne=t.Math,Ce=t.Object,Ae=t.RegExp,Pe=t.String,be=t.TypeError,Me=n.prototype,we=_e.prototype,Re=Ce.prototype,Oe=t["__core-js_shared__"],Ie=we.toString,xe=Re.hasOwnProperty,Le=0,ke=(r=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",De=Re.toString,Fe=Ie.call(Ce),Ve=at._,Ue=Ae("^"+Ie.call(xe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=lt?t.Buffer:o,ze=t.Symbol,Ge=t.Uint8Array,je=Be?Be.allocUnsafe:o,qe=er(Ce.getPrototypeOf,Ce),Ye=Ce.create,et=Re.propertyIsEnumerable,nt=Me.splice,ot=ze?ze.isConcatSpreadable:o,it=ze?ze.iterator:o,st=ze?ze.toStringTag:o,pt=function(){try{var e=ca(Ce,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==at.clearTimeout&&t.clearTimeout,Rt=oe&&oe.now!==at.Date.now&&oe.now,Vt=t.setTimeout!==at.setTimeout&&t.setTimeout,pr=Ne.ceil,cr=Ne.floor,ur=Ce.getOwnPropertySymbols,fr=Be?Be.isBuffer:o,yr=t.isFinite,dr=Me.join,mr=er(Ce.keys,Ce),gr=Ne.max,hr=Ne.min,Er=oe.now,Tr=t.parseInt,vr=Ne.random,Sr=Me.reverse,_r=ca(t,"DataView"),Nr=ca(t,"Map"),Cr=ca(t,"Promise"),Ar=ca(t,"Set"),Pr=ca(t,"WeakMap"),br=ca(Ce,"create"),Mr=Pr&&new Pr,wr={},Rr=Ua(_r),Or=Ua(Nr),Ir=Ua(Cr),xr=Ua(Ar),Lr=Ua(Pr),kr=ze?ze.prototype:o,Dr=kr?kr.valueOf:o,Fr=kr?kr.toString:o;function Vr(e){if(rs(e)&&!$i(e)&&!(e instanceof Gr)){if(e instanceof zr)return e;if(xe.call(e,"__wrapped__"))return Ba(e)}return new zr(e)}var Ur=function(){function e(){}return function(t){if(!ts(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=o,r}}();function Br(){}function zr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function Gr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=y,this.__views__=[]}function jr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sn(e,t,r,n,a,i){var s,l=1&t,p=2&t,c=4&t;if(r&&(s=a?r(e,n,a,i):r(e)),s!==o)return s;if(!ts(e))return e;var u=$i(e);if(u){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&xe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!l)return Mo(e,s)}else{var f=ya(e),y=f==v||f==S;if(Ji(e))return _o(e,l);if(f==C||f==m||y&&!a){if(s=p||y?{}:ma(e),!l)return p?function(e,t){return wo(e,fa(e),t)}(e,function(e,t){return e&&wo(t,xs(t),e)}(s,e)):function(e,t){return wo(e,ua(e),t)}(e,rn(s,e))}else{if(!Ze[f])return a?e:{};s=function(e,t,r){var n,o=e.constructor;switch(t){case O:return No(e);case h:case E:return new o(+e);case I:return function(e,t){var r=t?No(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case x:case L:case k:case D:case F:case V:case U:case B:case z:return Co(e,r);case _:return new o;case N:case M:return new o(e);case P:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return new o;case w:return n=e,Dr?Ce(Dr.call(n)):{}}}(e,f,l)}}i||(i=new Hr);var d=i.get(e);if(d)return d;i.set(e,s),ss(e)?e.forEach((function(n){s.add(sn(n,t,r,n,e,i))})):ns(e)&&e.forEach((function(n,o){s.set(o,sn(n,t,r,o,e,i))}));var g=u?o:(c?p?na:ra:p?xs:Is)(e);return Tt(g||e,(function(n,o){g&&(n=e[o=n]),Zr(s,o,sn(n,t,r,o,e,i))})),s}function ln(e,t,r){var n=r.length;if(null==e)return!n;for(e=Ce(e);n--;){var a=r[n],i=t[a],s=e[a];if(s===o&&!(a in e)||!i(s))return!1}return!0}function pn(e,t,r){if("function"!=typeof e)throw new be(a);return Ra((function(){e.apply(o,r)}),t)}function cn(e,t,r,n){var o=-1,a=Nt,i=!0,s=e.length,l=[],p=t.length;if(!s)return l;r&&(t=At(t,jt(r))),n?(a=Ct,i=!1):t.length>=200&&(a=$t,i=!1,t=new qr(t));e:for(;++o-1},Wr.prototype.set=function(e,t){var r=this.__data__,n=en(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new jr,map:new(Nr||Wr),string:new jr}},$r.prototype.delete=function(e){var t=la(this,e).delete(e);return this.size-=t?1:0,t},$r.prototype.get=function(e){return la(this,e).get(e)},$r.prototype.has=function(e){return la(this,e).has(e)},$r.prototype.set=function(e,t){var r=la(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},qr.prototype.add=qr.prototype.push=function(e){return this.__data__.set(e,i),this},qr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Hr.prototype.get=function(e){return this.__data__.get(e)},Hr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var n=r.__data__;if(!Nr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new $r(n)}return r.set(e,t),this.size=r.size,this};var un=Io(Tn),fn=Io(vn,!0);function yn(e,t){var r=!0;return un(e,(function(e,n,o){return r=!!t(e,n,o)})),r}function dn(e,t,r){for(var n=-1,a=e.length;++n0&&r(s)?t>1?gn(s,t-1,r,n,o):Pt(o,s):n||(o[o.length]=s)}return o}var hn=xo(),En=xo(!0);function Tn(e,t){return e&&hn(e,t,Is)}function vn(e,t){return e&&En(e,t,Is)}function Sn(e,t){return _t(t,(function(t){return Ki(e[t])}))}function _n(e,t){for(var r=0,n=(t=Eo(t,e)).length;null!=e&&rt}function Pn(e,t){return null!=e&&xe.call(e,t)}function bn(e,t){return null!=e&&t in Ce(e)}function Mn(e,t,r){for(var a=r?Ct:Nt,i=e[0].length,s=e.length,l=s,p=n(s),c=1/0,u=[];l--;){var f=e[l];l&&t&&(f=At(f,jt(t))),c=hr(f.length,c),p[l]=!r&&(t||i>=120&&f.length>=120)?new qr(l&&f):o}f=e[0];var y=-1,d=p[0];e:for(;++y=s?l:l*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(o)}function jn(e,t,r){for(var n=-1,o=t.length,a={};++n-1;)s!==e&&nt.call(s,l,1),nt.call(e,l,1);return e}function $n(e,t){for(var r=e?t.length:0,n=r-1;r--;){var o=t[r];if(r==n||o!==a){var a=o;ha(o)?nt.call(e,o,1):po(e,o)}}return e}function qn(e,t){return e+cr(vr()*(t-e+1))}function Hn(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=cr(t/2))&&(e+=e)}while(t);return r}function Yn(e,t){return Oa(Aa(e,t,ol),e+"")}function Jn(e){return Jr(zs(e))}function Qn(e,t){var r=zs(e);return La(r,an(t,0,r.length))}function Xn(e,t,r,n){if(!ts(e))return e;for(var a=-1,i=(t=Eo(t,e)).length,s=i-1,l=e;null!=l&&++aa?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=n(a);++o>>1,i=e[a];null!==i&&!ps(i)&&(r?i<=t:i=200){var p=t?null:Yo(e);if(p)return rr(p);i=!1,o=$t,l=new qr}else l=t?[]:s;e:for(;++n=n?e:to(e,t,r)}var So=ct||function(e){return at.clearTimeout(e)};function _o(e,t){if(t)return e.slice();var r=e.length,n=je?je(r):new e.constructor(r);return e.copy(n),n}function No(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function Co(e,t){var r=t?No(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ao(e,t){if(e!==t){var r=e!==o,n=null===e,a=e==e,i=ps(e),s=t!==o,l=null===t,p=t==t,c=ps(t);if(!l&&!c&&!i&&e>t||i&&s&&p&&!l&&!c||n&&s&&p||!r&&p||!a)return 1;if(!n&&!i&&!c&&e1?r[a-1]:o,s=a>2?r[2]:o;for(i=e.length>3&&"function"==typeof i?(a--,i):o,s&&Ea(r[0],r[1],s)&&(i=a<3?o:i,a=1),t=Ce(t);++n-1?a[i?t[s]:s]:o}}function Vo(e){return ta((function(t){var r=t.length,n=r,i=zr.prototype.thru;for(e&&t.reverse();n--;){var s=t[n];if("function"!=typeof s)throw new be(a);if(i&&!l&&"wrapper"==aa(s))var l=new zr([],!0)}for(n=l?n:r;++n1&&T.reverse(),y&&ul))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var f=-1,y=!0,d=2&r?new qr:o;for(i.set(e,t),i.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Tt(d,(function(r){var n="_."+r[0];t&r[1]&&!Nt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(se):[]}(n),r)))}function xa(e){var t=0,r=0;return function(){var n=Er(),a=16-(n-r);if(r=n,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function La(e,t){var r=-1,n=e.length,a=n-1;for(t=t===o?n:t;++r1?e[t-1]:o;return r="function"==typeof r?(e.pop(),r):o,ii(e,r)}));function yi(e){var t=Vr(e);return t.__chain__=!0,t}function di(e,t){return t(e)}var mi=ta((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,a=function(t){return on(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Gr&&ha(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:di,args:[a],thisArg:o}),new zr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(o),e}))):this.thru(a)})),gi=Ro((function(e,t,r){xe.call(e,r)?++e[r]:nn(e,r,1)})),hi=Fo(Wa),Ei=Fo($a);function Ti(e,t){return($i(e)?Tt:un)(e,sa(t,3))}function vi(e,t){return($i(e)?vt:fn)(e,sa(t,3))}var Si=Ro((function(e,t,r){xe.call(e,r)?e[r].push(t):nn(e,r,[t])})),_i=Yn((function(e,t,r){var o=-1,a="function"==typeof t,i=Hi(e)?n(e.length):[];return un(e,(function(e){i[++o]=a?ht(t,e,r):wn(e,t,r)})),i})),Ni=Ro((function(e,t,r){nn(e,r,t)}));function Ci(e,t){return($i(e)?At:Fn)(e,sa(t,3))}var Ai=Ro((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Pi=Yn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ea(e,t[0],t[1])?t=[]:r>2&&Ea(t[0],t[1],t[2])&&(t=[t[0]]),Gn(e,gn(t,1),[])})),bi=Rt||function(){return at.Date.now()};function Mi(e,t,r){return t=r?o:t,t=e&&null==t?e.length:t,Qo(e,p,o,o,o,o,t)}function wi(e,t){var r;if("function"!=typeof t)throw new be(a);return e=ms(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=o),r}}var Ri=Yn((function(e,t,r){var n=1;if(r.length){var o=tr(r,ia(Ri));n|=l}return Qo(e,n,t,r,o)})),Oi=Yn((function(e,t,r){var n=3;if(r.length){var o=tr(r,ia(Oi));n|=l}return Qo(t,n,e,r,o)}));function Ii(e,t,r){var n,i,s,l,p,c,u=0,f=!1,y=!1,d=!0;if("function"!=typeof e)throw new be(a);function m(t){var r=n,a=i;return n=i=o,u=t,l=e.apply(a,r)}function g(e){return u=e,p=Ra(E,t),f?m(e):l}function h(e){var r=e-c;return c===o||r>=t||r<0||y&&e-u>=s}function E(){var e=bi();if(h(e))return T(e);p=Ra(E,function(e){var r=t-(e-c);return y?hr(r,s-(e-u)):r}(e))}function T(e){return p=o,d&&n?m(e):(n=i=o,l)}function v(){var e=bi(),r=h(e);if(n=arguments,i=this,c=e,r){if(p===o)return g(c);if(y)return So(p),p=Ra(E,t),m(c)}return p===o&&(p=Ra(E,t)),l}return t=hs(t)||0,ts(r)&&(f=!!r.leading,s=(y="maxWait"in r)?gr(hs(r.maxWait)||0,t):s,d="trailing"in r?!!r.trailing:d),v.cancel=function(){p!==o&&So(p),u=0,n=c=i=p=o},v.flush=function(){return p===o?l:T(bi())},v}var xi=Yn((function(e,t){return pn(e,1,t)})),Li=Yn((function(e,t,r){return pn(e,hs(t)||0,r)}));function ki(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new be(a);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(ki.Cache||$r),r}function Di(e){if("function"!=typeof e)throw new be(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ki.Cache=$r;var Fi=To((function(e,t){var r=(t=1==t.length&&$i(t[0])?At(t[0],jt(sa())):At(gn(t,1),jt(sa()))).length;return Yn((function(n){for(var o=-1,a=hr(n.length,r);++o=t})),Wi=Rn(function(){return arguments}())?Rn:function(e){return rs(e)&&xe.call(e,"callee")&&!et.call(e,"callee")},$i=n.isArray,qi=ut?jt(ut):function(e){return rs(e)&&Cn(e)==O};function Hi(e){return null!=e&&es(e.length)&&!Ki(e)}function Yi(e){return rs(e)&&Hi(e)}var Ji=fr||hl,Qi=ft?jt(ft):function(e){return rs(e)&&Cn(e)==E};function Xi(e){if(!rs(e))return!1;var t=Cn(e);return t==T||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function Ki(e){if(!ts(e))return!1;var t=Cn(e);return t==v||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zi(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var ns=yt?jt(yt):function(e){return rs(e)&&ya(e)==_};function os(e){return"number"==typeof e||rs(e)&&Cn(e)==N}function as(e){if(!rs(e)||Cn(e)!=C)return!1;var t=qe(e);if(null===t)return!0;var r=xe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Ie.call(r)==Fe}var is=dt?jt(dt):function(e){return rs(e)&&Cn(e)==P},ss=mt?jt(mt):function(e){return rs(e)&&ya(e)==b};function ls(e){return"string"==typeof e||!$i(e)&&rs(e)&&Cn(e)==M}function ps(e){return"symbol"==typeof e||rs(e)&&Cn(e)==w}var cs=gt?jt(gt):function(e){return rs(e)&&es(e.length)&&!!Ke[Cn(e)]},us=$o(Dn),fs=$o((function(e,t){return e<=t}));function ys(e){if(!e)return[];if(Hi(e))return ls(e)?ar(e):Mo(e);if(it&&e[it])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[it]());var t=ya(e);return(t==_?Zt:t==b?rr:zs)(e)}function ds(e){return e?(e=hs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=ds(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?an(ms(e),0,y):0}function hs(e){if("number"==typeof e)return e;if(ps(e))return f;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Gt(e);var r=de.test(e);return r||ge.test(e)?rt(e.slice(2),r?2:8):ye.test(e)?f:+e}function Es(e){return wo(e,xs(e))}function Ts(e){return null==e?"":so(e)}var vs=Oo((function(e,t){if(_a(t)||Hi(t))wo(t,Is(t),e);else for(var r in t)xe.call(t,r)&&Zr(e,r,t[r])})),Ss=Oo((function(e,t){wo(t,xs(t),e)})),_s=Oo((function(e,t,r,n){wo(t,xs(t),e,n)})),Ns=Oo((function(e,t,r,n){wo(t,Is(t),e,n)})),Cs=ta(on),As=Yn((function(e,t){e=Ce(e);var r=-1,n=t.length,a=n>2?t[2]:o;for(a&&Ea(t[0],t[1],a)&&(n=1);++r1),t})),wo(e,na(e),r),n&&(r=sn(r,7,Zo));for(var o=t.length;o--;)po(r,t[o]);return r})),Fs=ta((function(e,t){return null==e?{}:function(e,t){return jn(e,t,(function(t,r){return Ms(e,r)}))}(e,t)}));function Vs(e,t){if(null==e)return{};var r=At(na(e),(function(e){return[e]}));return t=sa(t),jn(e,r,(function(e,r){return t(e,r[0])}))}var Us=Jo(Is),Bs=Jo(xs);function zs(e){return null==e?[]:Wt(e,Is(e))}var Gs=ko((function(e,t,r){return t=t.toLowerCase(),e+(r?js(t):t)}));function js(e){return Xs(Ts(e).toLowerCase())}function Ws(e){return(e=Ts(e))&&e.replace(Ee,Jt).replace($e,"")}var $s=ko((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),qs=ko((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Hs=Lo("toLowerCase"),Ys=ko((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Js=ko((function(e,t,r){return e+(r?" ":"")+Xs(t)})),Qs=ko((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Xs=Lo("toUpperCase");function Ks(e,t,r){return e=Ts(e),(t=r?o:t)===o?function(e){return Je.test(e)}(e)?function(e){return e.match(He)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Zs=Yn((function(e,t){try{return ht(e,o,t)}catch(e){return Xi(e)?e:new Se(e)}})),el=ta((function(e,t){return Tt(t,(function(t){t=Va(t),nn(e,t,Ri(e[t],e))})),e}));function tl(e){return function(){return e}}var rl=Vo(),nl=Vo(!0);function ol(e){return e}function al(e){return Ln("function"==typeof e?e:sn(e,1))}var il=Yn((function(e,t){return function(r){return wn(r,e,t)}})),sl=Yn((function(e,t){return function(r){return wn(e,r,t)}}));function ll(e,t,r){var n=Is(t),o=Sn(t,n);null!=r||ts(t)&&(o.length||!n.length)||(r=t,t=e,e=this,o=Sn(t,Is(t)));var a=!(ts(r)&&"chain"in r&&!r.chain),i=Ki(e);return Tt(o,(function(r){var n=t[r];e[r]=n,i&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__),o=r.__actions__=Mo(this.__actions__);return o.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Pt([this.value()],arguments))})})),e}function pl(){}var cl=Go(At),ul=Go(St),fl=Go(wt);function yl(e){return Ta(e)?Ft(Va(e)):function(e){return function(t){return _n(t,e)}}(e)}var dl=Wo(),ml=Wo(!0);function gl(){return[]}function hl(){return!1}var El,Tl=zo((function(e,t){return e+t}),0),vl=Ho("ceil"),Sl=zo((function(e,t){return e/t}),1),_l=Ho("floor"),Nl=zo((function(e,t){return e*t}),1),Cl=Ho("round"),Al=zo((function(e,t){return e-t}),0);return Vr.after=function(e,t){if("function"!=typeof t)throw new be(a);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},Vr.ary=Mi,Vr.assign=vs,Vr.assignIn=Ss,Vr.assignInWith=_s,Vr.assignWith=Ns,Vr.at=Cs,Vr.before=wi,Vr.bind=Ri,Vr.bindAll=el,Vr.bindKey=Oi,Vr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $i(e)?e:[e]},Vr.chain=yi,Vr.chunk=function(e,t,r){t=(r?Ea(e,t,r):t===o)?1:gr(ms(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var i=0,s=0,l=n(pr(a/t));ia?0:a+r),(n=n===o||n>a?a:ms(n))<0&&(n+=a),n=r>n?0:gs(n);r>>0)?(e=Ts(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=so(t))&&Kt(e)?vo(ar(e),0,r):e.split(t,r):[]},Vr.spread=function(e,t){if("function"!=typeof e)throw new be(a);return t=null==t?0:gr(ms(t),0),Yn((function(r){var n=r[t],o=vo(r,0,t);return n&&Pt(o,n),ht(e,this,o)}))},Vr.tail=function(e){var t=null==e?0:e.length;return t?to(e,1,t):[]},Vr.take=function(e,t,r){return e&&e.length?to(e,0,(t=r||t===o?1:ms(t))<0?0:t):[]},Vr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?to(e,(t=n-(t=r||t===o?1:ms(t)))<0?0:t,n):[]},Vr.takeRightWhile=function(e,t){return e&&e.length?uo(e,sa(t,3),!1,!0):[]},Vr.takeWhile=function(e,t){return e&&e.length?uo(e,sa(t,3)):[]},Vr.tap=function(e,t){return t(e),e},Vr.throttle=function(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new be(a);return ts(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),Ii(e,t,{leading:n,maxWait:t,trailing:o})},Vr.thru=di,Vr.toArray=ys,Vr.toPairs=Us,Vr.toPairsIn=Bs,Vr.toPath=function(e){return $i(e)?At(e,Va):ps(e)?[e]:Mo(Fa(Ts(e)))},Vr.toPlainObject=Es,Vr.transform=function(e,t,r){var n=$i(e),o=n||Ji(e)||cs(e);if(t=sa(t,4),null==r){var a=e&&e.constructor;r=o?n?new a:[]:ts(e)&&Ki(a)?Ur(qe(e)):{}}return(o?Tt:Tn)(e,(function(e,n,o){return t(r,e,n,o)})),r},Vr.unary=function(e){return Mi(e,1)},Vr.union=ri,Vr.unionBy=ni,Vr.unionWith=oi,Vr.uniq=function(e){return e&&e.length?lo(e):[]},Vr.uniqBy=function(e,t){return e&&e.length?lo(e,sa(t,2)):[]},Vr.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?lo(e,o,t):[]},Vr.unset=function(e,t){return null==e||po(e,t)},Vr.unzip=ai,Vr.unzipWith=ii,Vr.update=function(e,t,r){return null==e?e:co(e,t,ho(r))},Vr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:o,null==e?e:co(e,t,ho(r),n)},Vr.values=zs,Vr.valuesIn=function(e){return null==e?[]:Wt(e,xs(e))},Vr.without=si,Vr.words=Ks,Vr.wrap=function(e,t){return Vi(ho(t),e)},Vr.xor=li,Vr.xorBy=pi,Vr.xorWith=ci,Vr.zip=ui,Vr.zipObject=function(e,t){return mo(e||[],t||[],Zr)},Vr.zipObjectDeep=function(e,t){return mo(e||[],t||[],Xn)},Vr.zipWith=fi,Vr.entries=Us,Vr.entriesIn=Bs,Vr.extend=Ss,Vr.extendWith=_s,ll(Vr,Vr),Vr.add=Tl,Vr.attempt=Zs,Vr.camelCase=Gs,Vr.capitalize=js,Vr.ceil=vl,Vr.clamp=function(e,t,r){return r===o&&(r=t,t=o),r!==o&&(r=(r=hs(r))==r?r:0),t!==o&&(t=(t=hs(t))==t?t:0),an(hs(e),t,r)},Vr.clone=function(e){return sn(e,4)},Vr.cloneDeep=function(e){return sn(e,5)},Vr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:o)},Vr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:o)},Vr.conformsTo=function(e,t){return null==t||ln(e,t,Is(t))},Vr.deburr=Ws,Vr.defaultTo=function(e,t){return null==e||e!=e?t:e},Vr.divide=Sl,Vr.endsWith=function(e,t,r){e=Ts(e),t=so(t);var n=e.length,a=r=r===o?n:an(ms(r),0,n);return(r-=t.length)>=0&&e.slice(r,a)==t},Vr.eq=zi,Vr.escape=function(e){return(e=Ts(e))&&Y.test(e)?e.replace(q,Qt):e},Vr.escapeRegExp=function(e){return(e=Ts(e))&&re.test(e)?e.replace(te,"\\$&"):e},Vr.every=function(e,t,r){var n=$i(e)?St:yn;return r&&Ea(e,t,r)&&(t=o),n(e,sa(t,3))},Vr.find=hi,Vr.findIndex=Wa,Vr.findKey=function(e,t){return Ot(e,sa(t,3),Tn)},Vr.findLast=Ei,Vr.findLastIndex=$a,Vr.findLastKey=function(e,t){return Ot(e,sa(t,3),vn)},Vr.floor=_l,Vr.forEach=Ti,Vr.forEachRight=vi,Vr.forIn=function(e,t){return null==e?e:hn(e,sa(t,3),xs)},Vr.forInRight=function(e,t){return null==e?e:En(e,sa(t,3),xs)},Vr.forOwn=function(e,t){return e&&Tn(e,sa(t,3))},Vr.forOwnRight=function(e,t){return e&&vn(e,sa(t,3))},Vr.get=bs,Vr.gt=Gi,Vr.gte=ji,Vr.has=function(e,t){return null!=e&&da(e,t,Pn)},Vr.hasIn=Ms,Vr.head=Ha,Vr.identity=ol,Vr.includes=function(e,t,r,n){e=Hi(e)?e:zs(e),r=r&&!n?ms(r):0;var o=e.length;return r<0&&(r=gr(o+r,0)),ls(e)?r<=o&&e.indexOf(t,r)>-1:!!o&&xt(e,t,r)>-1},Vr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=null==r?0:ms(r);return o<0&&(o=gr(n+o,0)),xt(e,t,o)},Vr.inRange=function(e,t,r){return t=ds(t),r===o?(r=t,t=0):r=ds(r),function(e,t,r){return e>=hr(t,r)&&e=-9007199254740991&&e<=u},Vr.isSet=ss,Vr.isString=ls,Vr.isSymbol=ps,Vr.isTypedArray=cs,Vr.isUndefined=function(e){return e===o},Vr.isWeakMap=function(e){return rs(e)&&ya(e)==R},Vr.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==Cn(e)},Vr.join=function(e,t){return null==e?"":dr.call(e,t)},Vr.kebabCase=$s,Vr.last=Xa,Vr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var a=n;return r!==o&&(a=(a=ms(r))<0?gr(n+a,0):hr(a,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,a):It(e,kt,a,!0)},Vr.lowerCase=qs,Vr.lowerFirst=Hs,Vr.lt=us,Vr.lte=fs,Vr.max=function(e){return e&&e.length?dn(e,ol,An):o},Vr.maxBy=function(e,t){return e&&e.length?dn(e,sa(t,2),An):o},Vr.mean=function(e){return Dt(e,ol)},Vr.meanBy=function(e,t){return Dt(e,sa(t,2))},Vr.min=function(e){return e&&e.length?dn(e,ol,Dn):o},Vr.minBy=function(e,t){return e&&e.length?dn(e,sa(t,2),Dn):o},Vr.stubArray=gl,Vr.stubFalse=hl,Vr.stubObject=function(){return{}},Vr.stubString=function(){return""},Vr.stubTrue=function(){return!0},Vr.multiply=Nl,Vr.nth=function(e,t){return e&&e.length?zn(e,ms(t)):o},Vr.noConflict=function(){return at._===this&&(at._=Ve),this},Vr.noop=pl,Vr.now=bi,Vr.pad=function(e,t,r){e=Ts(e);var n=(t=ms(t))?or(e):0;if(!t||n>=t)return e;var o=(t-n)/2;return jo(cr(o),r)+e+jo(pr(o),r)},Vr.padEnd=function(e,t,r){e=Ts(e);var n=(t=ms(t))?or(e):0;return t&&nt){var n=e;e=t,t=n}if(r||e%1||t%1){var a=vr();return hr(e+a*(t-e+tt("1e-"+((a+"").length-1))),t)}return qn(e,t)},Vr.reduce=function(e,t,r){var n=$i(e)?bt:Ut,o=arguments.length<3;return n(e,sa(t,4),r,o,un)},Vr.reduceRight=function(e,t,r){var n=$i(e)?Mt:Ut,o=arguments.length<3;return n(e,sa(t,4),r,o,fn)},Vr.repeat=function(e,t,r){return t=(r?Ea(e,t,r):t===o)?1:ms(t),Hn(Ts(e),t)},Vr.replace=function(){var e=arguments,t=Ts(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Vr.result=function(e,t,r){var n=-1,a=(t=Eo(t,e)).length;for(a||(a=1,e=o);++nu)return[];var r=y,n=hr(e,y);t=sa(t),e-=y;for(var o=zt(n,t);++r=i)return e;var l=r-or(n);if(l<1)return n;var p=s?vo(s,0,l).join(""):e.slice(0,l);if(a===o)return p+n;if(s&&(l+=p.length-l),is(a)){if(e.slice(l).search(a)){var c,u=p;for(a.global||(a=Ae(a.source,Ts(fe.exec(a))+"g")),a.lastIndex=0;c=a.exec(u);)var f=c.index;p=p.slice(0,f===o?l:f)}}else if(e.indexOf(so(a),l)!=l){var y=p.lastIndexOf(a);y>-1&&(p=p.slice(0,y))}return p+n},Vr.unescape=function(e){return(e=Ts(e))&&H.test(e)?e.replace($,sr):e},Vr.uniqueId=function(e){var t=++Le;return Ts(e)+t},Vr.upperCase=Qs,Vr.upperFirst=Xs,Vr.each=Ti,Vr.eachRight=vi,Vr.first=Ha,ll(Vr,(El={},Tn(Vr,(function(e,t){xe.call(Vr.prototype,t)||(El[t]=e)})),El),{chain:!1}),Vr.VERSION="4.17.21",Tt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Vr[e].placeholder=Vr})),Tt(["drop","take"],(function(e,t){Gr.prototype[e]=function(r){r=r===o?1:gr(ms(r),0);var n=this.__filtered__&&!t?new Gr(this):this.clone();return n.__filtered__?n.__takeCount__=hr(r,n.__takeCount__):n.__views__.push({size:hr(r,y),type:e+(n.__dir__<0?"Right":"")}),n},Gr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Tt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Gr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:sa(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Tt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Gr.prototype[e]=function(){return this[r](1).value()[0]}})),Tt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Gr.prototype[e]=function(){return this.__filtered__?new Gr(this):this[r](1)}})),Gr.prototype.compact=function(){return this.filter(ol)},Gr.prototype.find=function(e){return this.filter(e).head()},Gr.prototype.findLast=function(e){return this.reverse().find(e)},Gr.prototype.invokeMap=Yn((function(e,t){return"function"==typeof e?new Gr(this):this.map((function(r){return wn(r,e,t)}))})),Gr.prototype.reject=function(e){return this.filter(Di(sa(e)))},Gr.prototype.slice=function(e,t){e=ms(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Gr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==o&&(r=(t=ms(t))<0?r.dropRight(-t):r.take(t-e)),r)},Gr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gr.prototype.toArray=function(){return this.take(y)},Tn(Gr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),a=Vr[n?"take"+("last"==t?"Right":""):t],i=n||/^find/.test(t);a&&(Vr.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,l=t instanceof Gr,p=s[0],c=l||$i(t),u=function(e){var t=a.apply(Vr,Pt([e],s));return n&&f?t[0]:t};c&&r&&"function"==typeof p&&1!=p.length&&(l=c=!1);var f=this.__chain__,y=!!this.__actions__.length,d=i&&!f,m=l&&!y;if(!i&&c){t=m?t:new Gr(this);var g=e.apply(t,s);return g.__actions__.push({func:di,args:[u],thisArg:o}),new zr(g,f)}return d&&m?e.apply(this,s):(g=this.thru(u),d?n?g.value()[0]:g.value():g)})})),Tt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Me[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Vr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var o=this.value();return t.apply($i(o)?o:[],e)}return this[r]((function(r){return t.apply($i(r)?r:[],e)}))}})),Tn(Gr.prototype,(function(e,t){var r=Vr[t];if(r){var n=r.name+"";xe.call(wr,n)||(wr[n]=[]),wr[n].push({name:t,func:r})}})),wr[Uo(o,2).name]=[{name:"wrapper",func:o}],Gr.prototype.clone=function(){var e=new Gr(this.__wrapped__);return e.__actions__=Mo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Mo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Mo(this.__views__),e},Gr.prototype.reverse=function(){if(this.__filtered__){var e=new Gr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=$i(e),n=t<0,o=r?e.length:0,a=function(e,t,r){for(var n=-1,o=r.length;++n=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},Vr.prototype.plant=function(e){for(var t,r=this;r instanceof Br;){var n=Ba(r);n.__index__=0,n.__values__=o,t?a.__wrapped__=n:t=n;var a=n;r=r.__wrapped__}return a.__wrapped__=e,t},Vr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gr){var t=e;return this.__actions__.length&&(t=new Gr(this)),(t=t.reverse()).__actions__.push({func:di,args:[ti],thisArg:o}),new zr(t,this.__chain__)}return this.thru(ti)},Vr.prototype.toJSON=Vr.prototype.valueOf=Vr.prototype.value=function(){return fo(this.__wrapped__,this.__actions__)},Vr.prototype.first=Vr.prototype.head,it&&(Vr.prototype[it]=function(){return this}),Vr}();at._=lr,(n=function(){return lr}.call(t,r,t,e))===o||(e.exports=n)}.call(this)},904:(e,t)=>{"use strict";var r;let n;Object.defineProperty(t,"__esModule",{value:!0}),t.setDomain=t.getDomain=t.Domain=void 0,function(e){e[e.FA=0]="FA",e[e.FORM=1]="FORM",e[e.ETS=2]="ETS"}(r||(r={})),t.Domain=r,t.setDomain=e=>{n=e},t.getDomain=()=>null!=n?n:r.ETS},784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMap=void 0,t.errorMap=new Map([["fileError","Visual file is damaged"],["versionError","Version number of visual file does not match"],["modelError","Visual model in visual file is damaged"],["codegenError","Codegen visual file failed"]])},117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNode=void 0,t.ASTNode=class{accept(e){return e.visit(this)}}},862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0,t.Cache=class{constructor(e,t=0){this.value="",this.indent=t,this.flag=!0,this.INDENT=e}indentOn(){this.flag=!0}indentOff(){this.flag=!1}incIndent(){this.indent++}decIndent(){this.indent--}checkIndent(){return this.indent<0}getIndents(){if(this.flag){let e="";for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const n=r(117);class o extends n.ASTNode{constructor(e,t,r,n,o){super(),this.defaultValue=new Map,this.mediaParams=new Map,this.mediaProperties=new Map,this.mediaKeyProperty=new Map,this.tagName=e,this.params=t,this.content=r,this.properties=n,this.forEachObj=o,this.ifBoolean=null,this.isCustomTag=!1}setMediaParams(e){this.mediaParams=e}setParams(e){this.params=e}setIfBoolean(e){this.ifBoolean=e}setTagName(e){this.tagName=e}setForEachObj(e){this.forEachObj=e}setMediaProperty(e,t){t.forEach(((t,r)=>{var n;this.mediaKeyProperty.has(r)||this.mediaKeyProperty.set(r,new Map),null===(n=this.mediaKeyProperty.get(r))||void 0===n||n.set(e,t)}))}setDefaultValue(e,t,r="undefined",n=""){this.defaultValue.set(e,[r,t,n])}}t.Tag=o},623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const n=r(519),o=r(862),a=r(51),i=r(294),s=r(486);class l{constructor(e){this.cache=e,this.etsImport=new o.Cache(" ",0),this.etsVariable=new o.Cache(" ",1),this.etsFunction=new o.Cache(" ",1),this.aboutToAppear=new o.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}visit(e){e instanceof n.Tag&&(e.isCustomTag?this.genCustomTag(e):(this.needMediaQuery&&this.genMediaQuery(e),this.genTag(e)))}static getMethodGen(e){return void 0===l.instance?l.instance=new l(e):l.instance.setCache(e),l.instance}setCache(e){this.cache=e,this.etsImport=new o.Cache(" ",0),this.etsVariable=new o.Cache(" ",1),this.etsFunction=new o.Cache(" ",1),this.aboutToAppear=new o.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}genParams(e){const t=this.getParams(e);this.isCustomComponent(e)?this.genCustomParams(t):this.genCommonParams(t)}genCommonParams(e){if("string"==typeof e)this.cache.concat(e);else if(e.size>0){this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE);let t=0;e.forEach(((r,n)=>{this.cache.concat(n,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(t,a.TokenClass.COLON,a.TokenClass.SPACE,e,a.TokenClass.COMMA)})),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genObjectProperty(e){let t=0;this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE),e.forEach(((r,n)=>{this.cache.concat(n,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{e.accept(this),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.decIndent(),this.cache.indentOn()),this.cache.indentOn(),this.cache.concat(a.TokenClass.RBRA)),(null!==e.properties||null!==e.mediaProperties)&&(null!==e.content&&0!==e.content.length||this.cache.incIndent(),this.getProperties(e).forEach(((e,t)=>{this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.PROPERTY_START,t,a.TokenClass.TAG_START),this.cache.indentOff(),"string"==typeof e?this.cache.concat(e,a.TokenClass.TAG_END):this.genObjectProperty(e)})),null!==e.content&&0!==e.content.length||this.cache.decIndent()),this.genEnd(e)}genStart(e){this.genIfStart(e),this.genForTagStart(e),this.genCustomImport(e)}genEnd(e){this.genForTagEnd(e),this.genIfEnd(e)}genForTagStart(e){var t;void 0!==(null===(t=e.forEachObj)||void 0===t?void 0:t.for)&&(this.cache.concat("ForEach",a.TokenClass.TAG_START,e.forEachObj.for.toString(),a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE))}genForTagEnd(e){null!==e.forEachObj&&(this.cache.concat(a.TokenClass.RBRA),void 0!==e.forEachObj.key&&""!==e.forEachObj.key&&(this.cache.concat(a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.concat("return ",e.forEachObj.key.toString(),a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.TAG_END,a.TokenClass.RBRA),this.cache.indentOff()),this.cache.concat(a.TokenClass.TAG_END))}genIfStart(e){null!==e.ifBoolean&&(this.cache.concat("if",a.TokenClass.SPACE,a.TokenClass.TAG_START,e.ifBoolean.toString(),a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.incIndent())}genIfEnd(e){null!==e.ifBoolean&&(this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genMediaQuery(e){const t=new Map,r=new Map;if(this.collectMediaQueryMap(e,t),this.collectDefaultValueMap(e,r),0===t.size&&0===r.size)return;const n=(0,i.getUniqueName)("mediaQuery"),s=(0,i.getUniqueName)("initForMediaQuery"),l=(0,i.getUniqueName)("mediaQueryCb"),p=(0,i.getUniqueName)("saveMediaQueryResult"),c=(0,i.getUniqueName)("updateForMediaQuery"),u=new o.Cache(a.TokenClass.INDENT,1),f=new o.Cache(a.TokenClass.INDENT,1),y=new o.Cache(a.TokenClass.INDENT,1),d=new o.Cache(a.TokenClass.INDENT,1),m=new o.Cache(a.TokenClass.INDENT,1),g=new o.Cache(a.TokenClass.INDENT,1),h=new o.Cache(a.TokenClass.INDENT,1),E=new o.Cache(a.TokenClass.INDENT,2);this.genVariableDeclare(r,u,a.TokenClass.UNDEFINED),this.genMediaQueryCb(l,f),this.genMediaQueryListener(t,y,d),this.genInitFuc(s,r,m),this.genMediaQueryCbFnc(p,c,t,g),this.genUpdateFnc(c,s,t,h),this.genAboutToAppear(l,p,t,E),this.etsImport.indentOff(),this.aboutToAppear.indentOff(),this.etsVariable.indentOff(),this.etsFunction.indentOff(),this.etsImport.indentOff(),this.etsImport.concat("import ",n," from '@ohos.mediaquery'",a.TokenClass.NEW_LINE),this.aboutToAppear.concat(E.toString()),this.etsVariable.concat(u.toString(),f.toString(),y.toString(),d.toString()),this.etsFunction.concat(g.toString(),a.TokenClass.NEW_LINE,m.toString(),a.TokenClass.NEW_LINE,h.toString()),this.etsImport.indentOn(),this.aboutToAppear.indentOn(),this.etsVariable.indentOn(),this.etsFunction.indentOn(),this.needMediaQuery=!1}genCustomTag(e){this.genVariableDeclare(e.defaultValue,this.cache)}genVariableDeclare(e,t,r){t.indentOn(),e.forEach(((e,n)=>{const o=e[2];""!==o&&(t.concat(o,a.TokenClass.SPACE),t.indentOff()),t.concat(n.slice(5),a.TokenClass.COLON,a.TokenClass.SPACE,e[1]),t.indentOff();const i=null!=r?r:e[0];null!=i&&t.concat(a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,i,a.TokenClass.NEW_LINE),t.indentOn()}))}genMediaQueryCb(e,t){t.concat(e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.NULL,a.TokenClass.NEW_LINE)}genMediaQueryListener(e,t,r){const n=(0,i.getUniqueName)("mediaQuery");e.forEach(((e,o)=>{const s=(0,i.getUniqueName)(this.getMediaQueryVariableName(o));t.concat(s,a.TokenClass.COLON,a.TokenClass.SPACE,a.TokenClass.BOOLEAN,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.FALSE,a.TokenClass.NEW_LINE),r.concat(`listener_${s}`,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,n,a.TokenClass.PROPERTY_START,"matchMediaSync",a.TokenClass.TAG_START,`'${o}'`,a.TokenClass.TAG_END,a.TokenClass.NEW_LINE)}))}genInitFuc(e,t,r){r.concat(e,a.TokenClass.TAG_START,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),r.indentOn(),r.incIndent(),t.forEach(((e,t)=>{r.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e[0],a.TokenClass.NEW_LINE)})),r.decIndent(),r.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genMediaQueryCbFnc(e,t,r,n){const o=Array.from(r.entries());n.concat(e,a.TokenClass.TAG_START,"mediaQueryResult",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),n.incIndent(),n.concat(a.TokenClass.SWITCH,a.TokenClass.SPACE,a.TokenClass.TAG_START,"mediaQueryResult.media",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),n.incIndent();for(let e=0;e{const r=(0,i.getUniqueName)(this.getMediaQueryVariableName(t));n.concat(a.TokenClass.IF,a.TokenClass.SPACE,a.TokenClass.TAG_START,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,r,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),n.incIndent(),e.forEach(((e,t)=>{n.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e,a.TokenClass.NEW_LINE)})),n.decIndent(),n.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)})),n.decIndent(),n.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genAboutToAppear(e,t,r,n){let o=1;n.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,`${t}.bind(this)`,a.TokenClass.NEW_LINE),r.forEach(((t,s)=>{const l=`listener_${(0,i.getUniqueName)(this.getMediaQueryVariableName(s))}`;n.indentOn(),n.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,l,a.TokenClass.PROPERTY_START,`on('change', this.${e})`),o0&&e.mediaParams.forEach(((e,r)=>{t.set(r,e)})),t}getProperties(e){const t=new Map;return e.properties.forEach(((e,r)=>{t.set(r,e)})),e.mediaProperties.forEach(((e,r)=>{t.set(r,e)})),t}collectDefaultValueMap(e,t){void 0!==e.defaultValue&&e.defaultValue.forEach(((e,r)=>{t.set(r,e)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectDefaultValueMap(e,t)}))}collectMediaQueryMap(e,t){void 0!==e.mediaKeyProperty&&e.mediaKeyProperty.forEach(((e,r)=>{var n;const o=null!==(n=t.get(r))&&void 0!==n?n:new Map;e.forEach(((e,t)=>{o.set(t,e)})),t.set(r,o)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectMediaQueryMap(e,t)}))}getMediaQueryVariableName(e){const t="device-type: ",r="orientation: ",n=e.substring(e.indexOf(t),e.length),o=n.substring(t.length,n.indexOf(")")),a=e.substring(e.indexOf(r),e.length),i=a.substring(r.length,a.indexOf(")"));return`${o}${i.slice(0,1).toUpperCase()+i.slice(1).toLowerCase()}`}}t.ASTNodeGenerator=l,l.instance=void 0},413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ETSBridge=void 0;const n=r(519),o=r(973),a=r(729),i=r(125),s=r(366);t.ETSBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map;let r=null;const l=new Map,p=new n.Tag(e.type,t,r,l,null);if((0,o.parseVisualModel)(e,p),(0,a.parseMediaVisualModel)(e,p),(0,i.parseCustomVisualModel)(e,p),(0,s.parseCustomMediaVisualModel)(e,p),e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}return p.content=r,p}}},459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genCustomEts=t.genETS=t.EMPTY=void 0;const n=r(623),o=r(862);t.EMPTY={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""},t.genETS=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" ",2));return e.accept(t),{build:t.cache.toString(),etsImport:t.etsImport.toString(),etsVariable:t.etsVariable.toString(),etsFunction:t.etsFunction.toString(),aboutToAppear:t.aboutToAppear.toString()}},t.genCustomEts=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" ",1));return e.accept(t),t.cache.toString()}},435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;const n=r(459);t.StringWriter=class{genETS(e){return(0,n.genETS)(e)}}},51:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.INDENT=" ",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.SPACE=" ",r.LQUOTE="'",r.RQUOTE="'",r.TAG_START="(",r.TAG_END=")",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDynamicValueByDecorator=t.getMediaVariableDecorator=t.getCustomAttrType=t.getCustomAttributeMap=t.setCustomAttribute=void 0;const n=r(891),o=new Map;function a(){return o}function i(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.decorator)&&void 0!==r?r:"normal"}t.setCustomAttribute=function(e){var t,r;const a=e.type;(null!==(r=null===(t=(0,n.getInstance)().customData)||void 0===t?void 0:t.property.get(a))&&void 0!==r?r:new Map).forEach(((e,t)=>{const r=`${t}-${a.replace(/\//g,"-")}`;o.set(r,e)}))},t.getCustomAttributeMap=a,t.getCustomAttrType=function(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.type)&&void 0!==r?r:""},t.getMediaVariableDecorator=function(e){const t=i(e);let r="";return"@Link"!==t&&"@Prop"!==t||(r="@State"),r},t.getDynamicValueByDecorator=function(e,t){let r=t;return"@Link"===i(e)&&(r=t.replace("this.","$")),r}},125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumParserMap=t.genCustomEvent=t.parseCustomVisualModel=void 0;const n=r(891),o=r(973),a=r(135),i=r(195);function s(e,t){if(!(t.params instanceof Map))return;const r=function(e){var t,r;const o=e.type;return[...null!==(r=null===(t=(0,n.getInstance)().customData)||void 0===t?void 0:t.event.get(o))&&void 0!==r?r:[]]}(e);for(const n of r){const r=e.property.get(n);void 0!==r&&""!==r&&("this"===r.split(".")[0]?t.params.set(n,r+".bind(this)"):t.params.set(n,r))}}t.parseCustomVisualModel=function(e,r){(0,i.setCustomAttribute)(e),(0,i.getCustomAttributeMap)().forEach(((n,a)=>{if(function(e,t){return e.property.has(t)||e.dynamicProperty.has(t)}(e,a)){const i=p.get(n.type);"function"==typeof i&&i(a,e,r);const s=t.enumParserMap.get(n.type);"function"==typeof s&&function(e,t,r,n){if((0,o.dynamicParamParser)(e,t,r))return;const a=t.property.get(e);!(0,o.isEmptyOrUndefined)(a)&&r.params instanceof Map&&r.params.set((0,o.getEtsPropName)(e),n(a))}(a,e,r,s)}})),s(e,r)},t.genCustomEvent=s;const l=(0,o.curry)(o.getEtsEnumValue),p=new Map([["string",o.stringParamParser],["boolean",o.rawDataParamParser],["number",o.rawDataParamParser],["any[]",o.rawDataParamParser],["object",o.rawDataParamParser],["Date",function(e,t,r){(0,o.dateParamParser)(e,(0,o.getEtsPropName)(e),t,r)}]]);t.enumParserMap=new Map([["Alignment",function(e){const t=(0,o.getBackgroundImagePositionEnumValue)(e);return""!==t?t:(0,o.getEtsEnumValue)("Alignment.",e)}],["Direction",l("Direction.")],["ItemAlign",o.dealWithAlignSelf],["BorderStyle",l("BorderStyle.")],["ImageRepeat",o.dealWithBackgroundRepeat],["ImageSize",l("ImageSize.")],["Visibility",l("Visibility.")],["FontStyle",l("FontStyle.")],["FontWeight",o.dealWithFontWeight],["ButtonType",l("ButtonType.")],["Color",l("Color.")],["LineCapStyle",l("LineCapStyle.")],["ImageFit",l("ImageFit.")],["ImageInterpolation",l("ImageInterpolation.")],["ImageRenderMode",l("ImageRenderMode.")],["ProgressStyle",l("ProgressStyle.")],["SliderStyle",l("SliderStyle.")],["TextAlign",l("TextAlign.")],["TextOverflow",l("TextOverflow.")],["TextDecorationType",l("TextDecorationType.")],["TextCase",l("TextCase.")],["HorizontalAlign",o.dealWithColumnAlignItems],["FlexAlign",a.dealWithJustifyAlignContent],["VerticalAlign",o.dealWithRowAlignItems],["FlexDirection",l("FlexDirection.")],["FlexWrap",o.dealWithWrap],["Axis",l("Axis.")],["EdgeEffect",l("EdgeEffect.")],["Sticky",l("Sticky.")],["EnterKeyType",l("EnterKeyType.")],["ToggleType",l("ToggleType.")],["InputType",l("InputType.")]])},223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonMediaParserArray=t.ifParser=t.forEachParser=void 0;const n=r(973),o=r(34),a=(0,n.curry)(((e,t)=>t.hasMediaProperty(e)));function i(e,t,r){var o,a,i,s;const l=null!==(o=e.property.get("left"))&&void 0!==o?o:e.dynamicProperty.get("left"),p=null!==(a=e.property.get("top"))&&void 0!==a?a:e.dynamicProperty.get("top"),c=t.get("left"),u=t.get("top"),f=r.get("left"),y=r.get("top");let d="undefined",m="undefined";return(0,n.isEmptyOrUndefined)(c)&&(0,n.isEmptyOrUndefined)(u)||(d=(0,n.quoteString)(null!==(i=null!=c?c:l)&&void 0!==i?i:"0"),m=(0,n.quoteString)(null!==(s=null!=u?u:p)&&void 0!==s?s:"0")),(0,n.isEmptyOrUndefined)(f)&&(0,n.isEmptyOrUndefined)(y)||(d=null!=f?f:d,m=null!=y?y:m),{leftValue:d,topValue:m}}function s(e,t){e.forEach(((e,r)=>{"undefined"!==e&&t.set(r,"undefined")}))}function l(e,t){var r,o;const a=new Map,i=t.split("-")[0];return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((r,o)=>{var s,l,p,c;const u=r.get(i),f=null===(l=null===(s=e.dynamicMediaProperty)||void 0===s?void 0:s.get(o))||void 0===l?void 0:l.get(i),y=null!==(c=null!==(p=r.get(t))&&void 0!==p?p:f)&&void 0!==c?c:u;void 0!==y&&a.set(o,(0,n.quoteString)(y))})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{var n;const o=e.get(i),s=null!==(n=e.get(t))&&void 0!==n?n:o;void 0!==s&&a.set(r,s)})),a}const p=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.quoteString);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.quoteString),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),c=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),u=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),f=(0,n.curry)(((e,t,r,a)=>{const i=(0,o.getMediaProperty)(r,e,(0,n.curry)(n.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,n.curry)(n.getEtsEnumValue)(t)),l=(0,o.getVariableName)(r.id,e);a.setDefaultValue(l,(0,o.getType)(e),s),a.setMediaProperty(l,i),a.mediaProperties.set((0,n.getEtsPropName)(e),l)})),y=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.dealWithColor);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.dealWithColor),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)}));function d(e,t,r,o=!1){(0,n.isEmptyOrUndefined)(t)||r.set(e,o?t:(0,n.quoteString)(t))}t.forEachParser=function(e,t){var r,n,a;const i=null!==(r=e.dynamicProperty.get("for"))&&void 0!==r?r:"[1]",s=null!==(n=e.property.get("item"))&&void 0!==n?n:"item",l=null!==(a=e.property.get("idx"))&&void 0!==a?a:"idx",p=e.dynamicProperty.get("keyGenerator"),c=(0,o.getMediaProperty)(e,"for");if(0===c.size)return;const u=(0,o.getVariableName)(e.id,"for"),f={for:u,key:p,item:s,idx:l};t.setDefaultValue(u,(0,o.getType)("for"),i),t.setMediaProperty(u,c),t.setForEachObj(f)},t.ifParser=function(e,t){const r=(0,o.getMediaProperty)(e,"if");if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"if"),a=(0,o.getVariableName)(e.id,"if");t.setDefaultValue(a,(0,o.getType)("if"),n),t.setMediaProperty(a,r),t.setIfBoolean(a)};const m=(0,n.curry)(((e,t,r)=>{const a=new Map,i=t.property.get(e),s=t.dynamicProperty.get(e),p=null!=s?s:i,c=["top","bottom","left","right"];let u=0;for(const i of c){const s=`${e}-${i}`,c=t.property.get(s),f=t.dynamicProperty.get(s),y=l(t,s);let m=(0,n.isEmptyOrUndefined)(p)?"undefined":(0,n.quoteString)(p);if((0,n.isEmptyOrUndefined)(c)||(m=(0,n.quoteString)(c)),(0,n.isEmptyOrUndefined)(f)||(m=f),y.size>0){const e=(0,o.getVariableName)(t.id,s);r.setDefaultValue(e,(0,o.getType)(s),m),r.setMediaProperty(e,y),d(i,e,a,!0),u++}else d(i,m,a,!0)}u>0&&r.mediaProperties.set(e,a)}));function g(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null===t?"undefined":void 0!==t[5]?`{ width: ${(0,n.quoteString)(t[1])}, height: ${(0,n.quoteString)(t[5])} }`:`{ width: ${(0,n.quoteString)(t[1])} }`}function h(e,t){var r,o;const a=new Map,i=new Map,s=T(t),l=v(t);return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((e,r)=>{const o=e.get(t);if(!(0,n.isEmptyOrUndefined)(o)){let e=s(o);e=""!==e?e:"undefined",a.set(r,e),i.set(r,l(o))}})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{const o=e.get(t);(0,n.isEmptyOrUndefined)(o)||(a.set(r,o),i.set(r,"undefined"))})),{enumValueMap:a,objValueMap:i}}function E(e,t){const r=e.property.get(t),o=e.dynamicProperty.get(t),a=T(t),i=v(t);let s="undefined",l="undefined";if(!(0,n.isEmptyOrUndefined)(r)){const e=a(r);s=""!==e?e:s,l=i(r)}return(0,n.isEmptyOrUndefined)(o)||(s=o,l="undefined"),{enumDefault:s,objDefault:l}}function T(e){return new Map([["background-image-size",n.getBackgroundImageSizeEnumValue],["background-image-position",n.getBackgroundImagePositionEnumValue]]).get(e)}function v(e){return new Map([["background-image-size",g],["background-image-position",S]]).get(e)}function S(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null===t?"undefined":`{ x: ${(0,n.quoteString)(t[1])}, y: ${(0,n.quoteString)(t[4])} }`}t.commonMediaParserArray=[[a("width"),p("width")],[a("height"),p("height")],[function(e){return e.hasMediaProperty("constraint-size-min-width")||e.hasMediaProperty("constraint-size-max-width")||e.hasMediaProperty("constraint-size-min-height")||e.hasMediaProperty("constraint-size-min-height")},function(e,t){const r=new Map,a=["min-width","max-width","min-height","max-height"];for(const i of a){const a=`constraint-size-${i}`,s=(0,o.getMediaProperty)(e,a,n.quoteString),l=(0,o.getMediaDefaultValue)(e,a,n.quoteString);if(s.size>0){const p=(0,o.getVariableName)(e.id,a);t.setDefaultValue(p,(0,o.getType)(a),l),t.setMediaProperty(p,s),d((0,n.getEtsPropName)(i),p,r,!0)}}r.size>0&&t.mediaProperties.set("constraintSize",r)}],[a("align"),f("align","Alignment.")],[a("direction"),f("direction","Direction.")],[function(e){return e.hasMediaProperty("left")||e.hasMediaProperty("top")},function(e,t){var r;const n=null!==(r=e.property.get("position"))&&void 0!==r?r:"relative",{leftValue:a,topValue:l}=i(e,e.property,e.dynamicProperty),{mediaPositionLeft:p,mediaPositionTop:c,mediaOffsetLeft:u,mediaOffsetTop:f}=function(e){var t,r;const n=new Map,o=new Map,a=new Map,s=new Map,l=null!==(t=e.mediaProperty)&&void 0!==t?t:new Map,p=null!==(r=e.dynamicMediaProperty)&&void 0!==r?r:new Map,c=new Set;for(const[e]of l)c.add(e);for(const[e]of p)c.add(e);return c.forEach((t=>{var r,l,p,c;const u=null!==(l=null===(r=e.mediaProperty)||void 0===r?void 0:r.get(t))&&void 0!==l?l:new Map,f=null!==(c=null===(p=e.dynamicMediaProperty)||void 0===p?void 0:p.get(t))&&void 0!==c?c:new Map,y=u.get("position"),{leftValue:d,topValue:m}=i(e,u,f);"absolute"===y?("undefined"!==d&&n.set(t,d),"undefined"!==m&&o.set(t,m)):("undefined"!==d&&a.set(t,d),"undefined"!==m&&s.set(t,m))})),{mediaPositionLeft:n,mediaPositionTop:o,mediaOffsetLeft:a,mediaOffsetTop:s}}(e),y=p.size>0||c.size>0||"absolute"===n,d=u.size>0||f.size>0||"relative"===n,m=(0,o.getVariableName)(e.id,"positionLeft"),g=(0,o.getVariableName)(e.id,"positionTop"),h=(0,o.getVariableName)(e.id,"offsetLeft"),E=(0,o.getVariableName)(e.id,"offsetTop");if(0!==p.size||0!==c.size||0!==f.size||0!==u.size){if(y&&d&&(s(p,u),s(u,p),s(c,f),s(f,c)),y){const e="absolute"===n?a:"undefined",r="absolute"===n?l:"undefined";t.setDefaultValue(m,(0,o.getType)("left"),e),t.setDefaultValue(g,(0,o.getType)("top"),r),t.setMediaProperty(m,p),t.setMediaProperty(g,c),t.mediaProperties.set("position",new Map([["x",m],["y",g]]))}if(d){const e="relative"===n?a:"undefined",r="relative"===n?l:"undefined";t.setDefaultValue(h,(0,o.getType)("left"),e),t.setDefaultValue(E,(0,o.getType)("top"),r),t.setMediaProperty(h,u),t.setMediaProperty(E,f),t.mediaProperties.set("offset",new Map([["x",h],["y",E]]))}}}],[a("aspect-ratio"),c("aspect-ratio")],[a("display-priority"),c("display-priority")],[a("flex-basis"),p("flex-basis")],[a("flex-grow"),c("flex-grow")],[a("flex-shrink"),c("flex-shrink")],[a("align-self"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-self",n.dealWithAlignSelf);if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"align-self",n.dealWithAlignSelf),i=(0,o.getVariableName)(e.id,"align-self");t.setDefaultValue(i,(0,o.getType)("align-self"),a),t.setMediaProperty(i,r),t.mediaProperties.set("alignSelf",i)}],[a("border-style"),f("border-style","BorderStyle.")],[a("border-width"),p("border-width")],[a("border-color"),y("border-color")],[a("border-radius"),p("border-radius")],[a("background-color"),y("background-color")],[function(e){return e.hasMediaProperty("background-image-src")||e.hasMediaProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),a=e.property.get("background-image-repeat"),i=e.dynamicProperty.get("background-image-src"),s=e.dynamicProperty.get("background-image-repeat"),l=(0,o.getMediaProperty)(e,"background-image-src",n.dealWithSrc),p=(0,o.getMediaProperty)(e,"background-image-repeat",n.dealWithBackgroundRepeat);if(0===l.size&&0===p.size)return;let c=(0,n.dealWithSrc)(null!=r?r:"");if((0,n.isEmptyOrUndefined)(i)||(c=i),l.size>0){const r=(0,o.getVariableName)(e.id,"background-image-src");t.setDefaultValue(r,(0,o.getType)("background-image-src"),c),t.setMediaProperty(r,l),c=r}let u="undefined";if(!(0,n.isEmptyOrUndefined)(a)){const e=(0,n.dealWithBackgroundRepeat)(a);null!=e&&""!==e&&(u=e)}if((0,n.isEmptyOrUndefined)(s)||(u=s),p.size>0){const r=(0,o.getVariableName)(e.id,"background-image-repeat");t.setDefaultValue(r,(0,o.getType)("background-image-repeat"),u),t.setMediaProperty(r,p),u=r}t.mediaProperties.set("backgroundImage",c+", "+u)}],[a("background-image-size"),function(e,t){const{enumValueMap:r,objValueMap:n}=h(e,"background-image-size");if(0===r.size&&0===n.size)return;const{enumDefault:a,objDefault:i}=E(e,"background-image-size"),s=(0,o.getVariableName)(e.id,"background-image-size-enum"),l=(0,o.getVariableName)(e.id,"background-image-size-obj");t.setDefaultValue(s,"ImageSize",a),t.setDefaultValue(l,"SizeOptions",i),t.setMediaProperty(s,r),t.setMediaProperty(l,n),t.mediaProperties.set("backgroundImageSize",`${s} !== undefined ? ${s} : ${l}`)}],[a("background-image-position"),function(e,t){const{enumValueMap:r,objValueMap:n}=h(e,"background-image-position");if(0===r.size&&0===n.size)return;const{enumDefault:a,objDefault:i}=E(e,"background-image-position"),s=(0,o.getVariableName)(e.id,"background-image-position-enum"),l=(0,o.getVariableName)(e.id,"background-image-position-obj");t.setDefaultValue(s,"Alignment",a),t.setDefaultValue(l,"Position",i),t.setMediaProperty(s,r),t.setMediaProperty(l,n),t.mediaProperties.set("backgroundImagePosition",`${s} !== undefined ? ${s} : ${l}`)}],[a("opacity"),c("opacity")],[a("visibility"),f("visibility","Visibility.")],[a("enabled"),u("enabled")],[a("font-color"),y("font-color")],[function(e){return e.hasMediaProperty("margin")||e.hasMediaProperty("margin-left")||e.hasMediaProperty("margin-top")||e.hasMediaProperty("margin-right")||e.hasMediaProperty("margin-bottom")},m("margin")],[function(e){return e.hasMediaProperty("padding")||e.hasMediaProperty("padding-left")||e.hasMediaProperty("padding-top")||e.hasMediaProperty("padding-right")||e.hasMediaProperty("padding-bottom")},m("padding")]]},135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.componentsMediaParserArray=t.dateMediaParamParser=t.rawDataMediaParamParser=t.stringMediaParamParser=t.dealWithJustifyAlignContent=void 0;const n=r(973),o=r(34),a=r(195),i=(0,n.curry)(((e,t,r)=>r.type===e&&r.hasMediaProperty(t)));function s(e){return isNaN(Number(e))?(0,n.getEtsEnumValue)("FontWeight.",e):e}function l(e){let t=(0,n.getEtsEnumValue)("FlexAlign.",e);return"flex-start"===e?t="FlexAlign.Start":"flex-end"===e&&(t="FlexAlign.End"),t}function p(e){return"TextOverflow."+(0,n.firstUpperCase)(e)}function c(e,t,r){var o,a;const i=new Map,s=null!==(o=e.mediaProperty)&&void 0!==o?o:new Map,l=null!==(a=e.dynamicMediaProperty)&&void 0!==a?a:new Map;return s.forEach(((e,o)=>{let a=e.get(t);const s=e.get(r);(0,n.isEmptyOrUndefined)(a)&&(0,n.isEmptyOrUndefined)(s)||(a="0"===a||(0,n.isEmptyOrUndefined)(a)?"0":a.substring(0,a.length-2),i.set(o,a))})),l.forEach(((e,r)=>{const o=e.get(t);(0,n.isEmptyOrUndefined)(o)||i.set(r,o)})),i}t.dealWithJustifyAlignContent=l;const u=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.quoteString);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.quoteString),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),f=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),y=(0,n.curry)(((e,t,r)=>{f(e,t,r)})),d=(0,n.curry)(((e,t,r,a)=>{const i=(0,o.getMediaProperty)(r,e,(0,n.curry)(n.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,n.curry)(n.getEtsEnumValue)(t)),l=(0,o.getVariableName)(r.id,e);a.setDefaultValue(l,(0,o.getType)(e),s),a.setMediaProperty(l,i),a.mediaProperties.set((0,n.getEtsPropName)(e),l)}));t.stringMediaParamParser=(0,n.curry)(((e,t,r)=>{const i=(0,o.getMediaProperty)(t,e,n.quoteString);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(t,e,n.quoteString),l=(0,o.getVariableName)(t.id,e),p=(0,a.getMediaVariableDecorator)(e);r.setDefaultValue(l,(0,o.getType)(e),s,p),r.setMediaProperty(l,i),r.mediaParams.set((0,n.getEtsPropName)(e),(0,a.getDynamicValueByDecorator)(e,l))})),t.rawDataMediaParamParser=(0,n.curry)(((e,t,r)=>{const i=(0,o.getMediaProperty)(t,e);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(t,e),l=(0,o.getVariableName)(t.id,e);r.setDefaultValue(l,(0,o.getType)(e),s),r.setMediaProperty(l,i),r.mediaParams.set((0,n.getEtsPropName)(e),(0,a.getDynamicValueByDecorator)(e,l))})),t.dateMediaParamParser=(0,n.curry)(((e,t,r,a,i)=>{const s=e=>void 0===e||""===e?"new Date()":"new Date ("+(0,n.quoteString)(e)+")",l=(0,o.getMediaProperty)(a,e,s);if(!(i.mediaParams instanceof Map)||0===l.size)return;const p=(0,o.getMediaDefaultValue)(a,e,s),c=(0,o.getVariableName)(a.id,e);i.setDefaultValue(c,(0,o.getType)(e),p,r),i.setMediaProperty(c,l),i.mediaParams.set(t,c)}));const m=(0,n.curry)(((e,t,r,n,a)=>{const i=(0,o.getMediaProperty)(n,e);if(!(a.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(n,e),l=(0,o.getVariableName)(n.id,e);a.setDefaultValue(l,(0,o.getType)(e),s,r),a.setMediaProperty(l,i),a.mediaParams.set(t,l)})),g=(0,n.curry)(((e,t,r,a)=>{const i=(0,o.getMediaProperty)(r,e,(0,n.curry)(n.getEtsEnumValue)(t));if(!(a.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,n.curry)(n.getEtsEnumValue)(t)),l=(0,o.getVariableName)(r.id,e);a.setDefaultValue(l,(0,o.getType)(e),s),a.setMediaProperty(l,i),a.mediaParams.set((0,n.getEtsPropName)(e),l)})),h=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.dealWithColor);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.dealWithColor),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),E=(0,n.curry)(((e,t,r,a)=>{const i=(0,o.getMediaProperty)(r,e,l);if(!(a.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,l),p=(0,o.getVariableName)(r.id,e);a.setDefaultValue(p,(0,o.getType)(e),s),a.setMediaProperty(p,i),a.mediaParams.set((0,n.getEtsPropName)(e),p)})),T=(0,n.curry)(((e,t,r,n)=>{const a=(0,o.getMediaProperty)(r,e,l);if(!(n.mediaProperties instanceof Map)||0===a.size)return;const i=(0,o.getMediaDefaultValue)(r,e,l),s=(0,o.getVariableName)(r.id,e);n.setDefaultValue(s,(0,o.getType)(e),i),n.setMediaProperty(s,a),n.mediaProperties.set("justifyContent",s)})),v=(0,n.curry)(((e,t)=>t.type===e));function S(e,t,r){const a=e.property.get(r),i=e.dynamicProperty.get(r),s=(0,o.getMediaProperty)(e,r,n.quoteString);if(0===s.size)return;let l="''";(0,n.isEmptyOrUndefined)(a)||(l=(0,n.quoteString)(a)),(0,n.isEmptyOrUndefined)(i)||(l=(0,n.getContentName)(i));const p=(0,o.getVariableName)(e.id,r);t.setDefaultValue(p,(0,o.getType)(r),l),t.setMediaProperty(p,s),t.setMediaParams(p)}const _=(0,n.curry)(((e,t,r,a)=>{let i=a.mediaProperties.get((0,n.getEtsPropName)(e));void 0===i&&(i=new Map);const l=`${e}-${t}`,p=(0,o.getVariableName)(r.id,l);let c=(0,o.getMediaProperty)(r,l,n.quoteString),u=(0,o.getMediaDefaultValue)(r,l,n.quoteString);if("string"!=typeof i){if((0,n.isEmptyOrUndefined)(u))return;"style"===t&&(c=(0,o.getMediaProperty)(r,l,(0,n.curry)(n.getEtsEnumValue)("FontStyle.")),u=(0,o.getMediaDefaultValue)(r,l,(0,n.curry)(n.getEtsEnumValue)("FontStyle."))),"weight"===t&&(c=(0,o.getMediaProperty)(r,l,s),u=(0,o.getMediaDefaultValue)(r,l,s)),a.setDefaultValue(p,(0,o.getType)(l),u),a.setMediaProperty(p,c),i.set(t,p)}a.mediaProperties.set((0,n.getEtsPropName)(e),i)}));function N(e,t){const r=(0,o.getMediaProperty)(e,"font-weight",n.dealWithFontWeight);if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"font-weight",n.dealWithFontWeight),i=(0,o.getVariableName)(e.id,"font-weight");t.setDefaultValue(i,(0,o.getType)("font-weight"),a),t.setMediaProperty(i,r),t.mediaProperties.set("fontWeight",i)}const C=[[i("button","label"),function(e,t){S(e,t,"label")}],[i("button","type"),d("type","ButtonType.")],[i("button","state-effect"),y("state-effect")],[i("button","font-size"),u("font-size")],[i("button","font-style"),d("font-style","FontStyle.")],[i("button","font-weight"),N],[i("button","font-family"),u("font-family")]],A=[[i("divider","vertical"),y("vertical")],[i("divider","color"),h("color")],[i("divider","stroke-width"),u("stroke-width")],[i("divider","line-cap"),d("line-cap","LineCapStyle.")]],P=[[v("image"),function(e,t){var r;const a=null!==(r=e.property.get("src"))&&void 0!==r?r:"",i=e.dynamicProperty.get("src"),s=(0,o.getMediaProperty)(e,"src",n.dealWithSrc);if(0===s.size)return;let l=(0,n.dealWithSrc)(a);(0,n.isEmptyOrUndefined)(i)||(l=i);const p=(0,o.getVariableName)(e.id,"src");t.setDefaultValue(p,(0,o.getType)("src"),l),t.setMediaProperty(p,s),t.setMediaParams(p)}],[i("image","alt"),u("alt")],[i("image","object-fit"),d("object-fit","ImageFit.")],[i("image","object-repeat"),d("object-repeat","ImageRepeat.")],[i("image","interpolation"),d("interpolation","ImageInterpolation.")],[i("image","render-mode"),d("render-mode","ImageRenderMode.")],[function(e){return e.hasMediaProperty("source-size-width")||e.hasMediaProperty("source-size-height")},function(e,t){let r=e.property.get("source-size-width"),a=e.property.get("source-size-height");const i=e.dynamicProperty.get("source-size-width"),s=e.dynamicProperty.get("source-size-height"),l=c(e,"source-size-width","source-size-height"),p=c(e,"source-size-height","source-size-width");if(0===l.size)return;r="0"===r||(0,n.isEmptyOrUndefined)(r)?"0":r.substring(0,r.length-2),a="0"===a||(0,n.isEmptyOrUndefined)(a)?"0":a.substring(0,a.length-2),(0,n.isEmptyOrUndefined)(i)||(r=i),(0,n.isEmptyOrUndefined)(s)||(a=s);const u=(0,o.getVariableName)(e.id,"source-size-width"),f=(0,o.getVariableName)(e.id,"source-size-height");t.setDefaultValue(u,(0,o.getType)("source-size-width"),r),t.setDefaultValue(f,(0,o.getType)("source-size-height"),a),t.setMediaProperty(u,l),t.setMediaProperty(f,p);const y=new Map([["width",u],["height",f]]);t.mediaProperties.set("sourceSize",y)}]],b=[[function(e){return"progress"===e.type&&(e.hasMediaProperty("value")||e.hasMediaProperty("total")||e.hasMediaProperty("style"))},function(e,t){const r=e.property.get("value"),a=e.dynamicProperty.get("value"),i=(0,o.getMediaProperty)(e,"value");if(!(t.mediaParams instanceof Map)||0===i.size)return;let s=null!=r?r:"0";(0,n.isEmptyOrUndefined)(a)||(s=a);const l=(0,o.getVariableName)(e.id,"value");t.setDefaultValue(l,(0,o.getType)("value"),s),t.setMediaProperty(l,i),t.mediaParams.set("value",l)}],[i("progress","total"),(0,t.rawDataMediaParamParser)("total")],[i("progress","style"),g("style","ProgressStyle.")],[i("progress","color"),h("color")]],M=[[i("slider","value"),(0,t.rawDataMediaParamParser)("value")],[i("slider","min"),(0,t.rawDataMediaParamParser)("min")],[i("slider","max"),(0,t.rawDataMediaParamParser)("max")],[i("slider","step"),(0,t.rawDataMediaParamParser)("step")],[i("slider","style"),g("style","SliderStyle.")],[i("slider","block-color"),h("block-color")],[i("slider","track-color"),h("track-color")],[i("slider","selected-color"),h("selected-color")],[i("slider","show-steps"),y("show-steps")],[i("slider","show-tips"),y("show-tips")]],w=[[i("text","content"),function(e,t){S(e,t,"content")}],[i("text","text-align"),d("text-align","TextAlign.")],[i("text","text-overflow"),function(e,t){const r=(0,o.getMediaProperty)(e,"text-overflow",p);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"text-overflow",p),a=(0,o.getVariableName)(e.id,"text-overflow");t.setDefaultValue(a,(0,o.getType)("text-overflow"),n),t.setMediaProperty(a,r),t.mediaProperties.set("textOverflow",new Map([["overflow",a]]))}],[i("text","max-lines"),f("max-lines")],[i("text","line-height"),u("line-height")],[function(e){return"text"===e.type&&(e.hasMediaProperty("decoration-type")||e.hasMediaProperty("decoration-color"))},function(e,t){const r=(0,o.getMediaProperty)(e,"decoration-type",(0,n.curry)(n.getEtsEnumValue)("TextDecorationType.")),a=(0,o.getMediaProperty)(e,"decoration-color",n.dealWithColor);if(0===r.size&&0===a.size)return;let i=(0,o.getMediaDefaultValue)(e,"decoration-type",(0,n.curry)(n.getEtsEnumValue)("TextDecorationType.")),s=(0,o.getMediaDefaultValue)(e,"decoration-color",n.dealWithColor);if(r.size>0){const n=(0,o.getVariableName)(e.id,"decoration-type");t.setDefaultValue(n,(0,o.getType)("decoration-type"),i),t.setMediaProperty(n,r),i=n}if(a.size>0){const r=(0,o.getVariableName)(e.id,"decoration-color");t.setDefaultValue(r,(0,o.getType)("decoration-color"),s),t.setMediaProperty(r,a),s=r}const l=new Map([["type",i]]);t.mediaProperties.set("decoration",l),"undefined"!==s&&l.set("color",s)}],[i("text","baseline-offset"),u("baseline-offset")],[i("text","text-case"),d("text-case","TextCase.")],[i("text","font-size"),u("font-size")],[i("text","font-style"),d("font-style","FontStyle.")],[i("text","font-weight"),N],[i("text","font-family"),u("font-family")]],R=[[i("column","space"),(0,t.stringMediaParamParser)("space")],[i("column","align-items-column"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-column",n.dealWithColumnAlignItems);if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"align-items-column",n.dealWithColumnAlignItems),i=(0,o.getVariableName)(e.id,"align-items-column");t.setDefaultValue(i,(0,o.getType)("align-items-column"),a),t.setMediaProperty(i,r),t.mediaProperties.set("alignItems",i)}],[i("column","justify-content-rc"),T("justify-content-rc","FlexAlign.")]],O=[[i("row","space"),(0,t.stringMediaParamParser)("space")],[i("row","align-items-row"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-row",n.dealWithRowAlignItems);if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"align-items-row",n.dealWithRowAlignItems),i=(0,o.getVariableName)(e.id,"align-items-row");t.setDefaultValue(i,(0,o.getType)("align-items-row"),a),t.setMediaProperty(i,r),t.mediaProperties.set("alignItems",i)}],[i("row","justify-content-rc"),T("justify-content-rc","FlexAlign.")]],I=[[i("flex","flex-direction"),function(e,t){const r=(0,o.getMediaProperty)(e,"flex-direction",(0,n.curry)(n.getEtsEnumValue)("FlexDirection."));if(!(t.mediaParams instanceof Map)||0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"flex-direction",(0,n.curry)(n.getEtsEnumValue)("FlexDirection.")),i=(0,o.getVariableName)(e.id,"flex-direction");t.setDefaultValue(i,(0,o.getType)("flex-direction"),a),t.setMediaProperty(i,r),t.mediaParams.set("direction",i)}],[i("flex","wrap"),function(e,t){const r=(0,o.getMediaProperty)(e,"wrap",n.dealWithWrap);if(!(t.mediaParams instanceof Map)||0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"wrap",n.dealWithWrap),i=(0,o.getVariableName)(e.id,"wrap");t.setDefaultValue(i,(0,o.getType)("wrap"),a),t.setMediaProperty(i,r),t.mediaParams.set("wrap",i)}],[i("flex","justify-content"),E("justify-content","FlexAlign.")],[i("flex","align-items-flex"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-flex",n.dealWithFlexAlignItems);if(!(t.mediaParams instanceof Map)||0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"align-items-flex",n.dealWithFlexAlignItems),i=(0,o.getVariableName)(e.id,"align-items-flex");t.setDefaultValue(i,(0,o.getType)("align-items-flex"),a),t.setMediaProperty(i,r),t.mediaParams.set("alignItems",i)}],[i("flex","align-content"),E("align-content","FlexAlign.")]],x=[[i("list","space"),(0,t.stringMediaParamParser)("space")],[i("list","initial-index"),(0,t.rawDataMediaParamParser)("initial-index")],[i("list","list-direction"),d("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasMediaProperty("divider-stroke-width")||e.hasMediaProperty("divider-color")||e.hasMediaProperty("divider-start-margin")||e.hasMediaProperty("divider-end-margin"))},function(e,t){const r=[["divider-stroke-width",n.quoteString],["divider-color",n.dealWithColor],["divider-start-margin",n.quoteString],["divider-end-margin",n.quoteString]];let a=0;const i=new Map;for(const[s,l]of r){const r=(0,o.getMediaProperty)(e,s,l),p=(0,n.getEtsPropName)(s.replace("divider-",""));let c=(0,o.getMediaDefaultValue)(e,s,l);if("undefined"===c&&"divider-stroke-width"===s&&(c="0"),r.size>0){const n=(0,o.getVariableName)(e.id,s);t.setDefaultValue(n,(0,o.getType)(s),c),t.setMediaProperty(n,r),c=n,a++}i.set(p,c)}a>0&&t.mediaProperties.set("divider",i)}],[i("list","edit-mode"),y("edit-mode")],[i("list","edge-effect"),d("edge-effect","EdgeEffect.")],[i("list","chain-animation"),y("chain-animation")]],L=[[i("list-item","sticky"),d("sticky","Sticky.")],[i("list-item","editable"),y("editable")]],k=[[i("swiper","index"),f("index")],[i("swiper","auto-play"),y("auto-play")],[i("swiper","interval"),f("interval")],[i("swiper","indicator"),y("indicator")],[i("swiper","loop"),y("loop")],[i("swiper","duration"),f("duration")],[i("swiper","vertical"),y("vertical")],[i("swiper","item-space"),u("item-space")],[i("swiper","cached-count"),f("cached-count")],[i("swiper","disable-swipe"),y("disable-swipe")]],D=[[i("text-input","placeholder"),(0,t.stringMediaParamParser)("placeholder")],[i("text-input","textInput-type"),function(e,t){const r=(0,o.getMediaProperty)(e,"textInput-type",(0,n.curry)(n.getEtsEnumValue)("InputType."));if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"textInput-type",(0,n.curry)(n.getEtsEnumValue)("InputType.")),i=(0,o.getVariableName)(e.id,"textInput-type");t.setDefaultValue(i,(0,o.getType)("textInput-type"),a),t.setMediaProperty(i,r),t.mediaProperties.set("type",i)}],[i("text-input","placeholderColor"),h("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasMediaProperty("placeholderFont-size")||e.hasMediaProperty("placeholderFont-weight")||e.hasMediaProperty("placeholderFont-family")||e.hasMediaProperty("placeholderFont-style"))},function(e,t){const r=[["size",n.quoteString],["weight",s],["family",n.quoteString],["style",(0,n.curry)(n.getEtsEnumValue)("FontStyle.")]];let a=0;const i=new Map;for(const[n,s]of r){const r=`placeholderFont-${n}`,l=(0,o.getMediaProperty)(e,r,s);let p=(0,o.getMediaDefaultValue)(e,r,s);if(l.size>0){const n=(0,o.getVariableName)(e.id,r);t.setDefaultValue(n,(0,o.getType)(r),p),t.setMediaProperty(n,l),p=n,a++}i.set(n,p)}a>0&&t.mediaProperties.set("placeholderFont",i)}],[i("text-input","enterKeyType"),d("enterKeyType","EnterKeyType.")],[i("text-input","caretColor"),h("caretColor")],[i("text-input","maxLength"),f("maxLength")]],F=[[i("refresh","friction"),(0,t.rawDataMediaParamParser)("friction")],[i("refresh","offset"),(0,t.stringMediaParamParser)("offset")],[i("refresh","refreshing"),(0,t.rawDataMediaParamParser)("refreshing")]],V=[[i("timePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[i("timePicker","useMilitaryTime"),y("useMilitaryTime")]],U=[[i("datePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[i("datePicker","start"),(0,t.dateMediaParamParser)("start","start","private")],[i("datePicker","end"),(0,t.dateMediaParamParser)("end","end","private")],[i("datePicker","lunar"),y("lunar")]],B=[[i("textPicker","range"),(0,t.rawDataMediaParamParser)("range")],[i("textPicker","textPicker-selected"),m("textPicker-selected","selected","@State")],[i("textPicker","defaultPickerItemHeight"),u("defaultPickerItemHeight")]],z=[[i("select","select-option"),function(e,t){!function(e,t,r){const a=e.dynamicProperty.get(r),i=(0,o.getMediaProperty)(e,r,n.quoteString);if(0===i.size)return;const s=null!=a?a:'[{value: ""}]',l=(0,o.getVariableName)(e.id,r);t.setDefaultValue(l,(0,o.getType)(r),s),t.setMediaProperty(l,i),t.setMediaParams(l)}(e,t,"select-option")}],[i("select","select-value"),function(e,t){const r="select-value",a=(0,o.getMediaProperty)(e,r,n.quoteString);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(e,r,n.quoteString),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,a),t.mediaProperties.set("value",s)}],[i("select","selected"),f("selected")],[i("select","font-size"),_("font","size")],[i("select","font-style"),_("font","style")],[i("select","font-family"),_("font","family")],[i("select","font-weight"),_("font","weight")],[i("select","selected-option-font-size"),_("selected-option-font","size")],[i("select","selected-option-font-style"),_("selected-option-font","style")],[i("select","selected-option-font-family"),_("selected-option-font","family")],[i("select","selected-option-font-weight"),_("selected-option-font","weight")],[i("select","selected-option-font-color"),h("selected-option-font-color")],[i("select","selected-option-bg-color"),h("selected-option-bg-color")],[i("select","option-font-size"),_("option-font","size")],[i("select","option-font-style"),_("option-font","style")],[i("select","option-font-family"),_("option-font","family")],[i("select","option-font-weight"),_("option-font","weight")],[i("select","option-font-color"),h("option-font-color")],[i("select","option-bg-color"),h("option-bg-color")]],G=[[i("toggle","toggle-type"),function(e,t){const r="ToggleType.",a="toggle-type",i=(0,o.getMediaProperty)(e,a,(0,n.curry)(n.getEtsEnumValue)(r));if(!(t.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(e,a,(0,n.curry)(n.getEtsEnumValue)(r)),l=(0,o.getVariableName)(e.id,a);t.setDefaultValue(l,(0,o.getType)(a),s),t.setMediaProperty(l,i),t.mediaParams.set("type",l)}],[i("toggle","isOn"),(0,t.rawDataMediaParamParser)("isOn")],[i("toggle","selectedColor"),h("selectedColor")],[i("toggle","switchPointColor"),h("switchPointColor")]];t.componentsMediaParserArray=[...C,...A,...P,...b,...M,...w,...R,...O,...I,...x,...L,...k,...D,...G,...F,...V,...B,...z,...U]},366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCustomMediaVisualModel=void 0;const n=r(125),o=r(135),a=r(34),i=r(973),s=r(195);t.parseCustomMediaVisualModel=function(e,t){(0,s.getCustomAttributeMap)().forEach(((r,o)=>{if(function(e,t){return e.hasMediaProperty(t)}(e,o)){const p=l.get(r.type);"function"==typeof p&&p(o,e,t);const c=n.enumParserMap.get(r.type);"function"==typeof c&&function(e,t,r,n){const o=(0,a.getMediaProperty)(t,e,n);if(!(r.mediaParams instanceof Map)||0===o.size)return;const l=(0,a.getMediaDefaultValue)(t,e,n),p=(0,a.getVariableName)(t.id,e);r.setDefaultValue(p,(0,a.getType)(e),l),r.setMediaProperty(p,o),r.mediaParams.set((0,i.getEtsPropName)(e),(0,s.getDynamicValueByDecorator)(e,p))}(o,e,t,c)}}))};const l=new Map([["string",o.stringMediaParamParser],["boolean",o.rawDataMediaParamParser],["number",o.rawDataMediaParamParser],["any[]",o.rawDataMediaParamParser],["object",o.rawDataMediaParamParser],["Date",function(e,t,r){(0,o.dateMediaParamParser)(e,(0,i.getEtsPropName)(e),"private",t,r)}]])},729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMediaProperty=t.parseMediaVisualModel=void 0;const n=r(973),o=r(223),a=r(135);function i(e,t,r){const n=t.get(r);return void 0!==n&&n.has(e)}t.parseMediaVisualModel=function(e,t){(0,o.forEachParser)(e,t),(0,o.ifParser)(e,t);for(const r of l)("boolean"==typeof r[0]||r[0](e))&&r[1](e,t)},t.isMediaProperty=function(e,t){return!i(e,s,"common")&&!i(e,s,t)&&!i(e,s,"events")};const s=new Map([["common",new Set(["keyGenerator","item","idx"])],["events",new Set([...n.events])]]),l=[...o.commonMediaParserArray,...a.componentsMediaParserArray]},34:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMediaDefaultValue=t.getVariableName=t.getMediaProperty=t.getType=void 0;const n=r(294),o=r(973),a=r(290),i=r(195);function s(e,t){for(const r of t)if(r.property===e)return r.etsType;return""}t.getType=function(e){const t=e+"-visual",r=a.etsPropertyList;let n="";for(const e of r)void 0!==e.propertySet.properties&&(n=s(t,e.propertySet.properties)),e.propertySet.property===t&&(n=e.propertySet.etsType);return""!==n?function(e=""){const t=new Map([["Rfloat","Resource"],["Rstring","Resource"],["Rcolor","Resource"],["Rmedia","Resource"],["Rrawfile","Resource"],["Rplural","Resource"],["ETSArray","any[]"]]),r=new Array;return e.split("|").forEach((e=>{const n=t.get(e),o=null!=n?n:e;r.includes(o)||r.push(null!=n?n:e)})),r.join(" | ")}(n):(0,i.getCustomAttrType)(e)},t.getMediaProperty=function(e,t,r){var n,a;const i=new Map;return(null!==(n=e.mediaProperty)&&void 0!==n?n:new Map).forEach(((e,n)=>{let a=e.get(t);(0,o.isEmptyOrUndefined)(a)||("function"==typeof r&&(a=r(a)),(0,o.isEmptyOrUndefined)(a)||i.set(n,a))})),(null!==(a=e.dynamicMediaProperty)&&void 0!==a?a:new Map).forEach(((e,r)=>{let n=e.get(t);void 0===n||"content"!==t&&"label"!==t||(n=(0,o.getContentName)(n)),(0,o.isEmptyOrUndefined)(n)||i.set(r,n)})),i},t.getVariableName=function(e,t){const r=(0,n.getTagName)(e),a=`this.${(0,o.getEtsPropName)(r)}${(0,o.firstUpperCase)((0,o.getEtsPropName)(t))}`;return`${a}_${(0,n.getUniqueId)(a)}`},t.getMediaDefaultValue=function(e,t,r){var n;const a=e.property.get(t),i=e.dynamicProperty.get(t);let s=null!==(n=new Map([["if","true"],["auto-play","false"],["interval","3000"],["select-value","''"]]).get(t))&&void 0!==n?n:"undefined";return(0,o.isEmptyOrUndefined)(a)||(s="function"==typeof r?r(a):a,s=(0,o.isEmptyOrUndefined)(s)?"undefined":s),(0,o.isEmptyOrUndefined)(i)||(s=i),s}},973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getContentName=t.dealWithBackgroundRepeat=t.dealWithBackgroundImageSize=t.dealWithBackgroundImagePosition=t.dealWithFontWeight=t.dealWithColumnAlignItems=t.dealWithRowAlignItems=t.dealWithWrap=t.dealWithFlexAlignItems=t.dealWithAlignSelf=t.dealWithSrc=t.getBackgroundImagePositionEnumValue=t.getBackgroundImageSizeEnumValue=t.dealWithColor=t.getEtsEnumValue=t.getEtsPropName=t.firstUpperCase=t.events=t.parseVisualModel=t.customRawDataParamParser=t.rawDataParamParser=t.dateParamParser=t.stringParamParser=t.dynamicParamParser=t.isEmptyOrUndefined=t.customDynamicParamParser=t.quoteString=t.curry=void 0;const n=r(294),o=r(195);function a(e){return(...t)=>t.lengtht.property.has(e)||t.dynamicProperty.has(e))),s=a(((e,t,r)=>r.type===e&&(r.property.has(t)||r.dynamicProperty.has(t)))),l=a(((e,t,r)=>r.type===e));function p(e){return JSON.stringify(e)}function c(e,t,r){const n=t.dynamicProperty.get(e);return void 0!==n&&""!==n.trim()&&(r.properties.set(N(e),n),!0)}function u(e,t,r,n){const o=r.dynamicProperty.get(e);return void 0!==o&&""!==o.trim()&&n.params instanceof Map&&(n.params.set(t,o),!0)}t.quoteString=p,t.customDynamicParamParser=u;const f=a(((e,t,r)=>{if(c(e,t,r))return;const n=t.property.get(e);void 0!==n&&r.properties.set(N(e),p(n))}));function y(e){return void 0===e||""===e}t.isEmptyOrUndefined=y;const d=a(((e,t,r)=>{if(c(e,t,r))return;const n=t.property.get(e);y(n)||r.properties.set(N(e),n)})),m=a(((e,t,r)=>{if(c(e,t,r))return;const n=t.property.get(e);y(n)||r.properties.set(N(e),n)})),g=a(((e,t,r,n)=>{if(c(e,r,n))return;const o=r.property.get(e);y(o)||n.properties.set(N(e),C(t,o))}));function h(e,t,r){const n=t.dynamicProperty.get(e);if(void 0!==n&&""!==n.trim()&&r.params instanceof Map){const t=(0,o.getDynamicValueByDecorator)(e,n);return r.params.set(N(e),t),!0}return!1}t.dynamicParamParser=h,t.stringParamParser=a(((e,t,r)=>{if(h(e,t,r))return;const n=t.property.get(e);void 0!==n&&r.params instanceof Map&&r.params.set(N(e),p(n))})),t.dateParamParser=a(((e,t,r,n)=>{const o=r.dynamicProperty.get(e);if(void 0!==o&&""!==o.trim()&&n.params instanceof Map)return void n.params.set(t,o);const a=r.property.get(e);void 0!==a&&n.params instanceof Map&&n.params.set(t,(e=>void 0===e||""===e?"new Date()":"new Date ("+p(e)+")")(a))})),t.rawDataParamParser=a(((e,t,r)=>{if(h(e,t,r))return;const n=t.property.get(e);!y(n)&&r.params instanceof Map&&r.params.set(N(e),n)})),t.customRawDataParamParser=a(((e,t,r,n)=>{if(u(e,t,r,n))return;const o=r.property.get(e);!y(o)&&n.params instanceof Map&&n.params.set(t,o)}));const E=a(((e,r,n)=>{(0,t.rawDataParamParser)(e,r,n)})),T=a(((e,r,n)=>{(0,t.rawDataParamParser)(e,r,n)})),v=a(((e,t,r,n)=>{if(h(e,r,n))return;const o=r.property.get(e);!y(o)&&n.params instanceof Map&&n.params.set(N(e),C(t,o))})),S=a(((e,t,r)=>{if(c(e,t,r))return;let n=t.property.get(e);y(n)||(n=A(n),r.properties.set(N(e),n))}));function _([e,...t]){return(null==e?void 0:e.toUpperCase())+t.join("")}function N(e){let t=e;const r=e.indexOf("--");-1!==r&&(t=e.substring(0,r));const n=t.split("-");let o=n[0];for(let e=1;ee[0].toUpperCase()+e.slice(1))).join("")));const a=function(e){var t,r;const n=e.dynamicProperty.get("for"),o=e.dynamicProperty.get("keyGenerator"),a=null!==(t=e.property.get("item"))&&void 0!==t?t:"item",i=null!==(r=e.property.get("idx"))&&void 0!==r?r:"idx";return void 0!==e.dynamicProperty.get("for")?{for:n,key:o,item:a,idx:i}:null}(e);r.setForEachObj(a);const i=void 0!==e.dynamicProperty.get("if")?e.dynamicProperty.get("if"):e.property.get("if");void 0===i?r.setIfBoolean(null):r.setIfBoolean(i);for(const t of ie)("boolean"==typeof t[0]||t[0](e))&&t[1](e,r);!function(e,r){var n;const o="onDisappear",a="onDisAppear";for(let n of t.events){const t=e.property.get(n);n===o&&(n=a),void 0!==t&&""!==t&&("this"===t.split(".")[0]?r.properties.set(n,t+".bind(this)"):r.properties.set(n,t))}if(void 0!==e.property.get("newFunction")){const t=null!==(n=e.property.get("newFunction"))&&void 0!==n?n:"{}",i=JSON.parse(t);Object.keys(i).forEach((e=>{var t;const n=null!==(t=i[e].eventCodeGen)&&void 0!==t?t:"";e===o&&(e=a),r.properties.set(e,n)}))}}(e,r)},t.events=["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange","onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop","onComplete","onError","onFinish","onChange","onSubmit","onEditChanged","onStateChange","onRefreshing","onSelect"],t.firstUpperCase=_,t.getEtsPropName=N,t.getEtsEnumValue=C,t.dealWithColor=A,t.getBackgroundImageSizeEnumValue=M,t.getBackgroundImagePositionEnumValue=w;const R=a(((e,t,r,n)=>{if(!(n.params instanceof Map))return;const o=r.dynamicProperty.get(e);if(!y(o))return void n.params.set(N(e),o);const a=r.property.get(e);if(y(a))return;let i=C(t,a);"flex-start"===a?i=t+"Start":"flex-end"===a&&(i=t+"End"),n.params.set(N(e),i)})),O=a(((e,t,r,n)=>{if(!(n.properties instanceof Map))return;const o=r.dynamicProperty.get(e);if(!y(o))return void n.properties.set("justifyContent",o);const a=r.property.get(e);if(y(a))return;let i=C(t,a);"flex-start"===a?i=t+"Start":"flex-end"===a&&(i=t+"End"),n.properties.set("justifyContent",i)})),I=a(((e,t)=>t.type===e));function x(e){return null===e.match(/\$(r|rawfile)\('(.*)'\)$/)?p(e):e}function L(e){let t=C("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}function k(e){let t=C("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}function D(e){let t=C("FlexWrap.",e);return"nowrap"===e&&(t="FlexWrap.NoWrap"),t}function F(e){let t=C("VerticalAlign.",e);return"flex-start"===e?t="VerticalAlign.Top":"flex-end"===e&&(t="VerticalAlign.Bottom"),t}function V(e){let t=C("HorizontalAlign.",e);return"flex-start"===e?t="HorizontalAlign.Start":"flex-end"===e&&(t="HorizontalAlign.End"),t}function U(e){return["lighter","normal","regular","medium","bold","bolder"].includes(e)?C("FontWeight.",e):e}function B(e){const t=new Map([["repeat-x","X"],["repeat-y","Y"],["repeat","XY"],["no-repeat","NoRepeat"]]).get(e);if(null!=t&&""!==t)return C("ImageRepeat.",t)}t.dealWithSrc=x,t.dealWithAlignSelf=L,t.dealWithFlexAlignItems=k,t.dealWithWrap=D,t.dealWithRowAlignItems=F,t.dealWithColumnAlignItems=V,t.dealWithFontWeight=U,t.dealWithBackgroundImagePosition=function(e){if(new Set(["TopStart","Top","TopEnd","Start","Center","End","BottomStart","Bottom","BottomEnd"]).has(e))return"Alignment."+e;const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null!==t?`{ x: ${p(t[1])}, y: ${p(t[4])} }`:void 0},t.dealWithBackgroundImageSize=function(e){if(new Set(["Cover","Contain","Auto"]).has(e))return C("ImageSize.",e);const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null!==t?void 0!==t[5]?`{ width: ${p(t[1])}, height: ${p(t[5])} }`:`{ width: ${p(t[1])} }`:void 0},t.dealWithBackgroundRepeat=B;const z=a(((e,t,r,n)=>{let o=n.properties.get(N(e));void 0===o&&(o=new Map);const a=`${e}-${t}`,i=r.property.get(a),s=r.dynamicProperty.get(a);"string"!=typeof o&&(y(s)?y(i)||("size"!==t&&"family"!==t||o.set(t,p(i)),"style"===t&&o.set(t,C("FontStyle.",i)),"weight"===t&&o.set(t,U(i))):o.set(t,s)),n.properties.set(N(e),o)}));function G(e){return e.startsWith("$r(")?e:`\`\${${e}}\``}t.getContentName=G;const j=[[i("width"),f("width")],[i("height"),f("height")],[function(e){return e.hasProperty("constraint-size-min-width")||e.hasProperty("constraint-size-max-width")||e.hasProperty("constraint-size-min-height")||e.hasProperty("constraint-size-max-height")},function(e,t){const r=new Map,n=e.getProperty("constraint-size-min-width"),o=e.getProperty("constraint-size-max-width"),a=e.getProperty("constraint-size-min-height"),i=e.getProperty("constraint-size-max-height");b("minWidth",n,r,e.dynamicProperty.has("constraint-size-min-width")),b("maxWidth",o,r,e.dynamicProperty.has("constraint-size-max-width")),b("minHeight",a,r,e.dynamicProperty.has("constraint-size-min-height")),b("maxHeight",i,r,e.dynamicProperty.has("constraint-size-max-height")),r.size>0&&t.properties.set("constraintSize",r)}],[i("align"),g("align","Alignment.")],[i("direction"),g("direction","Direction.")],[function(e){return e.hasProperty("left")||e.hasProperty("top")},function(e,t){const r="absolute"===e.property.get("position")?"position":"offset",n=e.property.get("left"),o=e.property.get("top"),a=e.dynamicProperty.get("left"),i=e.dynamicProperty.get("top");if(y(a)&&y(i)&&y(n)&&y(o))return;const s=new Map([["x",`${p(null!=n?n:"0")}`],["y",`${p(null!=o?o:"0")}`]]);y(a)||s.set("x",a),y(i)||s.set("y",i),t.properties.set(r,s)}],[i("aspect-ratio"),d("aspect-ratio")],[i("display-priority"),d("display-priority")],[i("flex-basis"),f("flex-basis")],[i("flex-grow"),d("flex-grow")],[i("flex-shrink"),d("flex-shrink")],[i("align-self"),function(e,t){const r=e.dynamicProperty.get("align-self");if(!y(r))return void t.properties.set("alignSelf",r);const n=e.property.get("align-self");if(y(n))return;const o=L(n);t.properties.set("alignSelf",o)}],[i("border-style"),g("border-style","BorderStyle.")],[i("border-width"),f("border-width")],[i("border-color"),S("border-color")],[i("border-radius"),f("border-radius")],[i("background-color"),S("background-color")],[function(e){return e.hasProperty("background-image-src")||e.hasProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),n=e.property.get("background-image-repeat"),o=e.dynamicProperty.get("background-image-src"),a=e.dynamicProperty.get("background-image-repeat");if(y(r)&&y(n)&&y(o)&&y(a))return;let i=x(null!=r?r:"");if(y(o)||(i=o),y(a)){if(!y(n)){const e=B(n);null!=e&&""!==e&&(i=i+", "+e)}}else i=i+", "+a;t.properties.set("backgroundImage",i)}],[i("background-image-size"),function(e,t){const r=e.dynamicProperty.get("background-image-size");if(!y(r))return void t.properties.set("backgroundImageSize",r);const n=e.property.get("background-image-size");if(y(n))return;if(""!==M(n))return void t.properties.set("backgroundImageSize",C("ImageSize.",n));const o=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);null!==o&&(void 0!==o[5]?t.properties.set("backgroundImageSize",new Map([["width",`${p(o[1])}`],["height",`${p(o[5])}`]])):t.properties.set("backgroundImageSize",new Map([["width",`${p(o[1])}`]])))}],[i("background-image-position"),function(e,t){const r=e.dynamicProperty.get("background-image-position");if(!y(r))return void t.properties.set("backgroundImagePosition",r);const n=e.property.get("background-image-position");if(y(n))return;const o=w(n);if(""!==o)return void t.properties.set("backgroundImagePosition",o);const a=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);null!==a&&t.properties.set("backgroundImagePosition",new Map([["x",`${p(a[1])}`],["y",`${p(a[4])}`]]))}],[i("opacity"),d("opacity")],[i("visibility"),g("visibility","Visibility.")],[i("enabled"),m("enabled")],[i("font-color"),S("font-color")],[function(e){return e.hasProperty("margin")||e.hasProperty("margin-left")||e.hasProperty("margin-top")||e.hasProperty("margin-right")||e.hasProperty("margin-bottom")},function(e,t){var r,n,o,a;const i=new Map,s=e.getProperty("margin"),l=null!==(r=e.getProperty("margin-top"))&&void 0!==r?r:s,p=null!==(n=e.getProperty("margin-bottom"))&&void 0!==n?n:s,c=null!==(o=e.getProperty("margin-left"))&&void 0!==o?o:s,u=null!==(a=e.getProperty("margin-right"))&&void 0!==a?a:s,f=e.property.has("margin-top"),y=e.property.has("margin-bottom"),d=e.property.has("margin-left"),m=e.property.has("margin-right"),g=e.dynamicProperty.has("margin"),h=e.dynamicProperty.has("margin-top"),E=e.dynamicProperty.has("margin-bottom"),T=e.dynamicProperty.has("margin-left"),v=e.dynamicProperty.has("margin-right");b("top",l,i,h||!f&&g),b("bottom",p,i,E||!y&&g),b("left",c,i,T||!d&&g),b("right",u,i,v||!m&&g),i.size>0&&t.properties.set("margin",i)}],[function(e){return e.hasProperty("padding")||e.hasProperty("padding-left")||e.hasProperty("padding-top")||e.hasProperty("padding-right")||e.hasProperty("padding-bottom")},function(e,t){var r,n,o,a;const i=new Map,s=e.getProperty("padding"),l=null!==(r=e.getProperty("padding-top"))&&void 0!==r?r:s,p=null!==(n=e.getProperty("padding-bottom"))&&void 0!==n?n:s,c=null!==(o=e.getProperty("padding-left"))&&void 0!==o?o:s,u=null!==(a=e.getProperty("padding-right"))&&void 0!==a?a:s,f=e.property.has("padding-top"),y=e.property.has("padding-bottom"),d=e.property.has("padding-left"),m=e.property.has("padding-right"),g=e.dynamicProperty.has("padding"),h=e.dynamicProperty.has("padding-top"),E=e.dynamicProperty.has("padding-bottom"),T=e.dynamicProperty.has("padding-left"),v=e.dynamicProperty.has("padding-right");b("top",l,i,h||!f&&g),b("bottom",p,i,E||!y&&g),b("left",c,i,T||!d&&g),b("right",u,i,v||!m&&g),i.size>0&&t.properties.set("padding",i)}]],W=[[s("button","label"),function(e,t){const r=e.dynamicProperty.get("label");if(!y(r))return void t.setParams(G(r));const n=e.property.get("label");"string"==typeof n&&t.setParams(p(n))}],[s("button","type"),g("type","ButtonType.")],[s("button","state-effect"),m("state-effect")],[s("button","font-size"),f("font-size")],[s("button","font-style"),g("font-style","FontStyle.")],[s("button","font-weight"),P],[s("button","font-family"),f("font-family")]],$=[[s("divider","vertical"),m("vertical")],[s("divider","color"),S("color")],[s("divider","stroke-width"),f("stroke-width")],[s("divider","line-cap"),g("line-cap","LineCapStyle.")]],q=[[I("image"),function(e,t){var r;const n=e.dynamicProperty.get("src");if(!y(n))return void t.setParams(n);const o=null!==(r=e.property.get("src"))&&void 0!==r?r:"";t.setParams(x(o))}],[s("image","alt"),f("alt")],[s("image","object-fit"),g("object-fit","ImageFit.")],[s("image","object-repeat"),g("object-repeat","ImageRepeat.")],[s("image","interpolation"),g("interpolation","ImageInterpolation.")],[s("image","render-mode"),g("render-mode","ImageRenderMode.")],[function(e){return e.hasProperty("source-size-width")||e.hasProperty("source-size-height")},function(e,t){let r=e.getProperty("source-size-width"),n=e.getProperty("source-size-height");if(y(r)&&y(n))return;const o=e.dynamicProperty.has("source-size-width"),a=e.dynamicProperty.has("source-size-height");r="0"===r||y(r)?"0":o?r:r.substring(0,r.length-2),n="0"===n||y(n)?"0":a?n:n.substring(0,n.length-2);const i=new Map([["width",r],["height",n]]);t.properties.set("sourceSize",i)}]],H=[[function(e){return"progress"===e.type&&(e.hasProperty("value")||e.hasProperty("total")||e.hasProperty("style"))},function(e,t){var r;h("value",e,t)||t.params instanceof Map&&t.params.set("value",null!==(r=e.getProperty("value"))&&void 0!==r?r:"0")}],[s("progress","total"),(0,t.rawDataParamParser)("total")],[s("progress","style"),v("style","ProgressStyle.")],[s("progress","color"),S("color")]],Y=[[s("slider","value"),(0,t.rawDataParamParser)("value")],[s("slider","min"),(0,t.rawDataParamParser)("min")],[s("slider","max"),(0,t.rawDataParamParser)("max")],[s("slider","step"),(0,t.rawDataParamParser)("step")],[s("slider","style"),v("style","SliderStyle.")],[s("slider","block-color"),S("block-color")],[s("slider","track-color"),S("track-color")],[s("slider","selected-color"),S("selected-color")],[s("slider","show-steps"),m("show-steps")],[s("slider","show-tips"),m("show-tips")]],J=[[s("text","content"),function(e,t){const r=e.property.get("content"),n=e.dynamicProperty.get("content");y(n)?"string"==typeof r&&t.setParams(p(r)):t.setParams(G(n))}],[s("text","text-align"),g("text-align","TextAlign.")],[s("text","text-overflow"),function(e,t){const r=e.dynamicProperty.get("text-overflow");if(!y(r))return void t.properties.set("textOverflow",new Map([["overflow",r]]));const n=e.property.get("text-overflow");y(n)||t.properties.set("textOverflow",new Map([["overflow","TextOverflow."+_(n)]]))}],[s("text","max-lines"),d("max-lines")],[s("text","line-height"),f("line-height")],[function(e){return"text"===e.type&&(e.hasProperty("decoration-type")||e.hasProperty("decoration-color"))},function(e,t){const r=e.property.get("decoration-type"),n=e.dynamicProperty.get("decoration-type"),o=e.property.get("decoration-color"),a=e.dynamicProperty.get("decoration-color");if(y(r)&&y(o)&&y(n)&&y(a))return;const i=new Map;y(n)?i.set("type",y(r)?"TextDecorationType.None":C("TextDecorationType.",r)):i.set("type",n),t.properties.set("decoration",i),y(a)?y(o)||i.set("color",A(o)):i.set("color",a)}],[s("text","baseline-offset"),f("baseline-offset")],[s("text","text-case"),g("text-case","TextCase.")],[s("text","font-size"),f("font-size")],[s("text","font-style"),g("font-style","FontStyle.")],[s("text","font-weight"),P],[s("text","font-family"),f("font-family")]],Q=[[s("column","space"),(0,t.stringParamParser)("space")],[s("column","align-items-column"),function(e,t){const r=e.dynamicProperty.get("align-items-column");if(!y(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-column");if(y(n))return;const o=V(n);t.properties.set("alignItems",o)}],[s("column","justify-content-rc"),O("justify-content-rc","FlexAlign.")]],X=[[s("row","space"),(0,t.stringParamParser)("space")],[s("row","align-items-row"),function(e,t){const r=e.dynamicProperty.get("align-items-row");if(!y(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-row");if(y(n))return;const o=F(n);t.properties.set("alignItems",o)}],[s("row","justify-content-rc"),O("justify-content-rc","FlexAlign.")]],K=[[s("flex","flex-direction"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("flex-direction");if(!y(r))return void t.params.set("direction",r);const n=e.property.get("flex-direction");y(n)||t.params.set("direction",C("FlexDirection.",n))}],[s("flex","wrap"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("wrap");if(!y(r))return void t.params.set("wrap",r);const n=e.property.get("wrap");if(y(n))return;const o=D(n);t.params.set("wrap",o)}],[s("flex","justify-content"),R("justify-content","FlexAlign.")],[s("flex","align-items-flex"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-items-flex");if(!y(r))return void t.params.set("alignItems",r);const n=e.property.get("align-items-flex");if(y(n))return;const o=k(n);t.params.set("alignItems",o)}],[s("flex","align-content"),R("align-content","FlexAlign.")]],Z=[[s("list","space"),(0,t.stringParamParser)("space")],[s("list","initial-index"),(0,t.rawDataParamParser)("initial-index")],[s("list","list-direction"),g("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasProperty("divider-stroke-width")||e.hasProperty("divider-color")||e.hasProperty("divider-start-margin")||e.hasProperty("divider-end-margin"))},function(e,t){const r=e.property.get("divider-stroke-width"),n=e.dynamicProperty.get("divider-stroke-width"),o=new Map([["strokeWidth",`${p(null!=r?r:"0")}`]]);y(n)||o.set("strokeWidth",n);const a=e.property.get("divider-color"),i=e.dynamicProperty.get("divider-color"),s=e.property.get("divider-start-margin"),l=e.dynamicProperty.get("divider-start-margin"),c=e.property.get("divider-end-margin"),u=e.dynamicProperty.get("divider-end-margin");y(i)?y(a)||o.set("color",A(a)):o.set("color",i),y(l)?y(s)||o.set("startMargin",p(s)):o.set("startMargin",l),y(u)?y(c)||o.set("endMargin",p(c)):o.set("endMargin",u),t.properties.set("divider",o)}],[s("list","edit-mode"),m("edit-mode")],[s("list","edge-effect"),g("edge-effect","EdgeEffect.")],[s("list","chain-animation"),m("chain-animation")]],ee=[[s("list-item","sticky"),g("sticky","Sticky.")],[s("list-item","editable"),m("editable")]],te=[[s("swiper","index"),d("index")],[s("swiper","auto-play"),m("auto-play")],[s("swiper","interval"),d("interval")],[s("swiper","indicator"),m("indicator")],[s("swiper","loop"),m("loop")],[s("swiper","duration"),d("duration")],[s("swiper","vertical"),m("vertical")],[s("swiper","item-space"),f("item-space")],[s("swiper","cached-count"),d("cached-count")],[s("swiper","disable-swipe"),m("disable-swipe")]],re=[[s("text-input","placeholder"),(0,t.stringParamParser)("placeholder")],[s("text-input","textInput-type"),function(e,t){const r=e.dynamicProperty.get("textInput-type");if(!y(r))return void t.properties.set("type",r);const n=e.property.get("textInput-type");y(n)||t.properties.set("type","InputType."+n)}],[s("text-input","placeholderColor"),S("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasProperty("placeholderFont-size")||e.hasProperty("placeholderFont-weight")||e.hasProperty("placeholderFont-family")||e.hasProperty("placeholderFont-style"))},function(e,t){const r=e.property.get("placeholderFont-size"),n=e.dynamicProperty.get("placeholderFont-size"),o=e.property.get("placeholderFont-weight"),a=e.dynamicProperty.get("placeholderFont-weight"),i=e.property.get("placeholderFont-family"),s=e.dynamicProperty.get("placeholderFont-family"),l=e.property.get("placeholderFont-style"),c=e.dynamicProperty.get("placeholderFont-style"),u=new Map;y(n)?y(r)||u.set("size",parseInt(r)):u.set("size",n),y(a)?y(o)||u.set("weight",isNaN(Number(o))?C("FontWeight.",o):o):u.set("weight",a),y(s)?y(i)||u.set("family",p(i)):u.set("family",s),y(c)?y(l)||u.set("style",C("FontStyle.",l)):u.set("style",c),t.properties.set("placeholderFont",u)}],[s("text-input","enterKeyType"),g("enterKeyType","EnterKeyType.")],[s("text-input","caretColor"),S("caretColor")],[s("text-input","maxLength"),d("maxLength")]],ne=[[s("refresh","friction"),(0,t.rawDataParamParser)("friction")],[s("refresh","offset"),(0,t.stringParamParser)("offset")],[s("refresh","refreshing"),E("refreshing")]],oe=[[s("timePicker","datetime-selected"),(0,t.dateParamParser)("datetime-selected","selected")],[s("timePicker","useMilitaryTime"),m("useMilitaryTime")]],ae=[[s("datePicker","datetime-selected"),(0,t.dateParamParser)("datetime-selected","selected")],[s("datePicker","start"),(0,t.dateParamParser)("start","start")],[s("datePicker","end"),(0,t.dateParamParser)("end","end")],[s("datePicker","lunar"),m("lunar")]],ie=[...j,...W,...$,...q,...H,...Y,...J,...Q,...X,...K,...Z,...ee,...te,...re,...oe,[s("textPicker","range"),T("range")],[s("textPicker","textPicker-selected"),(0,t.customRawDataParamParser)("textPicker-selected","selected")],[s("textPicker","defaultPickerItemHeight"),f("defaultPickerItemHeight")],...ne,[s("toggle","toggle-type"),function(e,t){const r="toggle-type";if(u(r,"type",e,t))return;const n=e.property.get(r);!y(n)&&t.params instanceof Map&&t.params.set("type",C("ToggleType.",n))}],[s("toggle","isOn"),E("isOn")],[s("toggle","selectedColor"),S("selectedColor")],[s("toggle","switchPointColor"),S("switchPointColor")],[l("select","select-option"),function(e,t){const r=e.dynamicProperty.get("select-option");t.setParams(null!=r?r:'[{value: ""}]')}],[s("select","select-value"),function(e,t){const r=e.getProperty("select-value"),n=e.dynamicProperty.get("select-value");y(n)?y(r)||t.properties.set("value",p(r)):t.properties.set("value",G(n))}],[s("select","selected"),d("selected")],[s("select","font-size"),z("font","size")],[s("select","font-style"),z("font","style")],[s("select","font-weight"),z("font","weight")],[s("select","font-family"),z("font","family")],[s("select","selected-option-font-size"),z("selected-option-font","size")],[s("select","selected-option-font-style"),z("selected-option-font","style")],[s("select","selected-option-font-weight"),z("selected-option-font","weight")],[s("select","selected-option-font-family"),z("selected-option-font","family")],[s("select","selected-option-font-color"),S("selected-option-font-color")],[s("select","selected-option-bg-color"),S("selected-option-bg-color")],[s("select","option-font-size"),z("option-font","size")],[s("select","option-font-style"),z("option-font","style")],[s("select","option-font-weight"),z("option-font","weight")],[s("select","option-font-family"),z("option-font","family")],[s("select","option-font-color"),S("option-font-color")],[s("select","option-bg-color"),S("option-bg-color")],...ae]},243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Style=t.Tag=void 0;const n=r(117);class o extends n.ASTNode{constructor(e,t,r){super(),this.tagName=e,this.attributes=t,this.content=r}}t.Tag=o;class a extends n.ASTNode{constructor(e,t,r,n){super(),this.mediaQuery=void 0,this.kind=e,this.name=t,this.content=r,this.mediaQuery=n}}t.Style=a},573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const n=r(243),o=r(334);class a{constructor(e){this.cache=e}visit(e){e instanceof n.Tag?this.genTag(e):e instanceof n.Style&&this.genStyle(e)}static getMethodGen(e){return void 0===a.instance?a.instance=new a(e):a.instance.setCache(e),a.instance}setCache(e){this.cache=e}genTag(e){if(this.cache.concat(o.TokenClass.TAG_START,e.tagName),this.cache.indentOff(),e.attributes.forEach(((e,t)=>{let r="";for(const t of e)r+='"'===t?""":"\n"===t?" ":t;this.cache.concat(o.TokenClass.SPACE,t,o.TokenClass.ASSIGN,o.TokenClass.LQUOTE,r,o.TokenClass.RQUOTE)})),null===e.content)this.cache.concat(o.TokenClass.EMPTY_TAG_END);else{if(this.cache.concat(o.TokenClass.TAG_END),"string"==typeof e.content){let t="";for(const r of e.content)t+="<"===r?"<":r;this.cache.concat(t)}else 0!==e.content.length&&(this.cache.concat(o.TokenClass.NEW_LINE),this.cache.incIndent(),this.cache.indentOn(),e.content.forEach((e=>{e.accept(this),this.cache.indentOff(),this.cache.concat(o.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.indentOn(),this.cache.decIndent());this.cache.concat(o.TokenClass.END_TAG_START,e.tagName,o.TokenClass.TAG_END)}}genStyle(e){void 0!==e.mediaQuery&&(this.cache.concat("@media"),this.cache.indentOff(),this.cache.concat(o.TokenClass.SPACE,e.mediaQuery,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent()),"IDStyle"===e.kind&&(this.cache.concat(o.TokenClass.ID_STYLE_START),this.cache.indentOff()),this.cache.concat(e.name,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent(),e.content.forEach(((e,t)=>{this.cache.concat(t,o.TokenClass.COLON,o.TokenClass.SPACE,e,o.TokenClass.SEMICOLON,o.TokenClass.NEW_LINE)})),this.cache.decIndent(),this.cache.concat(o.TokenClass.RBRA,o.TokenClass.NEW_LINE),void 0!==e.mediaQuery&&(this.cache.decIndent(),this.cache.concat(o.TokenClass.RBRA,o.TokenClass.NEW_LINE)),this.cache.concat(o.TokenClass.NEW_LINE)}}t.ASTNodeGenerator=a,a.instance=void 0},844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CSSBridge=t.HMLBridge=void 0;const n=r(243),o=r(571);t.HMLBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map([["id",e.id]]);let r="";for(let[n,a]of e.property)(0,o.isAttribute)(n,e.type)?("string"!=typeof a&&(a=JSON.stringify(a)),t.set(n,a)):(0,o.isContent)(n)&&(r=a);if(e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}const a=new n.Tag(e.type,t,r);return"wrapper"===t.get("id")?new n.Tag("div",new Map,[a]):a}},t.CSSBridge=class{constructor(){this.errors=0,this.styles=[]}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}genIDStyle(e){var t;const r=t=>{const r=new Map;for(const[n,a]of t)(0,o.isStyle)(n,e.type)&&r.set(n,a);return r},a=r(e.property);a.size>0&&this.styles.push(new n.Style("IDStyle",e.id,a)),(null!==(t=e.mediaProperty)&&void 0!==t?t:new Map).forEach(((t,o)=>{const a=r(t);a.size>0&&this.styles.push(new n.Style("IDStyle",e.id,a,o))}));for(const t of e.children)t.accept(this)}visit(e){return this.genIDStyle(e),this.styles}}},55:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genFACSS=t.genFAHML=void 0;const n=r(573),o=r(862);t.genFAHML=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" "));return e.accept(t),t.cache.toString()},t.genFACSS=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" "));return e.forEach((e=>{e.accept(t)})),t.cache.toString()}},571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEvent=t.isData=t.isUnknown=t.isContent=t.isAttribute=t.isStyle=t.styleMap=void 0;const n=r(904),o=["width","height","min-width","min-height","max-width","max-height","padding","padding-start","padding-end","padding-top","padding-right","padding-bottom","padding-left","margin","margin-start","margin-end","margin-top","margin-right","margin-bottom","margin-left","border-width","border-style","border-color","border-radius","border-top-width","border-top-style","border-top-color","border-top-left-radius","border-right-width","border-right-style","border-right-color","border-top-right-radius","border-bottom-width","border-bottom-style","border-bottom-color","border-bottom-right-radius","border-left-width","border-left-style","border-left-color","border-bottom-left-radius","background-color","background","background-image","background-size","background-position","background-repeat","display","opacity","visibility","flex","flex-grow","flex-shrink","flex-basis","position","display","top","right","bottom","left","display-index","flex-weight","aspect-ratio"],a=["font-size","font-family","font-style","font-weight"],i=["text-align","line-height","text-decoration","letter-spacing","max-lines","text-overflow","allow-scale","min-font-size","max-font-size","font-size-step","prefer-font-sizes","color",...a],s=["allow-scale","text-decoration","color",...a],l=["text-color","allow-scale","icon-width","icon-height","radius",...a],p=["texton-color","textoff-color","text-padding","allow-scale",...a],c=["column-height","text-color","allow-scale","letter-spacing","text-decoration","line-height","opacity",...a],u=["text-color","allow-scale","letter-spacing",...a];t.styleMap=new Map([["common",new Set([...o])],["div",new Set(["flex-direction","overflow","flex-wrap","justify-content","align-items","align-content","grid-template-columns","grid-template-rows","grid-row-start","grid-row-end","grid-column-start","grid-column-end","grid-gap","grid-columns-gap","grid-rows-gap"])],["text",new Set([...i])],["image",new Set(["object-fit","match-text-direction","fit-original-size"])],["span",new Set([...s])],["input",new Set(["font-size","font-family","font-weight","color","placeholder-color","allow-scale"])],["button",new Set([...l])],["switch",new Set([...p])],["refresh",new Set(["progress-color"])],["divider",new Set(["stroke-width","line-cap","color"])],["chart",new Set(["stroke-width","radius","start-angle","total-angle","center-x","center-y","colors","weights"])],["picker",new Set([...c])],["picker-view",new Set(["color","font-size","selected-color","selected-font-size","focus-color","focus-font-size","disappear-color","disappear-font-size","font-family"])],["slider",new Set(["color","selected-color","block-color"])],["swiper",new Set(["indicator-color","indicator-selected-color","indicator-size","indicator-top","indicator-right","indicator-bottom","indicator-left"])],["list",new Set(["flex-direction","columns","item-extent","fade-color"])],["list-item",new Set(["column-span"])],["progress",new Set(["color","stroke-width","background-color","secondary-color","scale-width","scale-number","start-angle","total-angle","center-x","center-y","radius"])],["select",new Set(["font-family"])],["menu",new Set([...u])],["option",new Set(["color","font-family","allow-scale","font-size","font-weight","text-decoration"])],["video",new Set(["object-fit"])],["clock",new Set(["font-family"])]]);const f=new Map([["common",new Set(["id","ref","disabled","focusable","data","if","for"])],["image",new Set(["src","alt"])],["button",new Set(["type","value","icon","waiting"])],["refresh",new Set(["offset","refreshing","type","lasttime","friction"])],["input",new Set(["type","checked","name","value","placeholder","maxlength","enterkeytype","headericon"])],["switch",new Set(["checked","showtext","texton","textoff"])],["option",new Set(["value","selected","icon"])],["chart",new Set(["type","percent","datasets","options"])],["picker",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","value","vibrate"])],["picker-view",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","indicatorprefix","indicatorsuffix","vibrate"])],["slider",new Set(["min","max","step","showtips","showsteps","mode","value"])],["divider",new Set(["vertical"])],["list",new Set(["scrollpage","cachedcount","scrollbar","scrolleffect","shapemode","indexer","itemscale","itemcenter","updateeffect","scrollvibrate","initialindex","initialoffset"])],["list-item",new Set(["type","primary","section","sticky","stickyradius","clickeffect"])],["swiper",new Set(["index","autoplay","interval","indicator","digital","indicatordisabled","loop","duration","vertical"])],["progress",new Set(["type","percent","secondarypercent","clockwise"])],["menu",new Set(["target","title","type"])],["clock",new Set(["clockconfig","showdigit","hourswest"])],["badge",new Set(["placement","count","visible","maxcount","config","label"])],["video",new Set(["muted","src","autoplay","poster","controls","loop","starttime","direction","speed"])],["tabs",new Set(["index","vertical"])],["tab-bar",new Set(["mode"])],["tab-content",new Set(["scrollable"])]]),y=new Map([["common",new Set(["ontouchstart","ontouchmove","ontouchcancel","ontouchend","onclick","onlongpress","onfocus","onblur","onkey","onswipe"])],["image",new Set(["oncomplete","onerror"])],["input",new Set(["onchange","onenterkeyclick"])],["select",new Set(["onchange"])],["refresh",new Set(["onrefresh","onpulldown"])],["swiper",new Set(["onchange","onrotation"])],["list",new Set(["onindexerchange","onscroll","onscrollbottom","onscrolltop","onscrollend","onscrolltouchup","onrequestitem"])],["list-item",new Set(["onsticky"])],["menu",new Set(["onselected","oncancel"])],["picker",new Set(["oncolumnchange","onchange","oncancel"])],["picker-view",new Set(["oncolumnchange","onchange"])],["video",new Set(["onprepared","onstart","onpause","onfinish","onerror","onseeking","onseeked","ontimeupdate","onfullscreenchange","onstop"])],["tabs",new Set(["onchange"])],["switch",new Set(["onchange"])],["dialog",new Set(["oncancel"])]]),d=new Map([["common",new Set(["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange"])],["image",new Set(["onComplete","onError","onFinish"])],["swiper",new Set(["onChange"])],["list",new Set(["onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop"])],["text-input",new Set(["onChange","onSubmit","onEditChanged"])],["refresh",new Set(["onStateChange","onRefreshing"])],["toggle",new Set(["onChange"])],["timePicker",new Set(["onChange"])],["textPicker",new Set(["onChange"])],["select",new Set(["onSelect"])],["datePicker",new Set(["onChange"])]]);function m(e,t,r){const n=t.get(r);return void 0!==n&&n.has(e)}function g(e,r){return m(e,t.styleMap,"common")||m(e,t.styleMap,r)}function h(e,t){return(0,n.getDomain)()===n.Domain.ETS?m(e,d,"common")||m(e,d,t):E(e,t)||T(e,t)}function E(e,t){return m(e,f,"common")||m(e,f,t)}function T(e,t){return m(e,y,"common")||m(e,y,t)}t.isStyle=g,t.isAttribute=h,t.isContent=function(e){return"content"===e},t.isUnknown=function(e,t){return!g(e,t)&&!h(e,t)},t.isData=E,t.isEvent=T},334:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.INDENT=" ",r.SPACE=" ",r.LQUOTE='"',r.RQUOTE='"',r.TAG_START="<",r.TAG_END=">",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.etsPropertyList=void 0;const n=r(958),o=r(513),a=["vp","px","%","lpx"],i=[{propertySector:o.Sector.FEATURE,propertySet:{name:"FontSize",property:"font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontStyle",property:"font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontColor",property:"font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontWeight",property:"font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...o.commonFontWeight],defaults:"normal"}}],s={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["vp","px","lpx"],placeholder:"0"},l=[{propertySector:o.Sector.GENERAL,propertySet:{name:"Width",property:"width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a,min:0}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Height",property:"height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a,min:0}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MinWidth",property:"constraint-size-min-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MinHeight",property:"constraint-size-min-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MaxWidth",property:"constraint-size-max-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MaxHeight",property:"constraint-size-max-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"Margin",property:"margin-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"Padding",property:"padding-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginTop",property:"margin-top-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginRight",property:"margin-right-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginBottom",property:"margin-bottom-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginLeft",property:"margin-left-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingTop",property:"padding-top-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingRight",property:"padding-right-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingBottom",property:"padding-bottom-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingLeft",property:"padding-left-visual"},s)}],p={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a},c={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a},u=[{propertySector:o.Sector.GENERAL,propertySet:{name:"CustomString",property:"custom-string-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.GENERAL,propertySet:{name:"CustomNumber",property:"custom-number-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.GENERAL,propertySet:{name:"CustomBoolean",property:"custom-boolean-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}],f=[{propertySector:o.Sector.DIMENSION,propertySet:{name:"Border",property:"border-visual",type:o.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-width-visual"},p),Object.assign({name:"Style",property:"border-style-visual"},o.commonParamsForBorder),{name:"Color",property:"border-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR},Object.assign({name:"Radius",property:"border-radius-visual"},c)]}}],y=[{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageSrc",property:"background-image-src-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_SRC}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageRepeat",property:"background-image-repeat-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_REPERT,list:[o.CLEAN_VALUE_NODE,{name:"X",value:"repeat-x"},{name:"Y",value:"repeat-y"},{name:"XY",value:"repeat"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageSize",property:"background-image-size-visual",type:o.TypeName.DATA_SELECT_INPUT,etsType:`${o.EtsType.IMAGE_SIZE}|${o.EtsType.STRING}`,list:[o.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Auto",value:"auto"}],defaults:"Auto"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImagePosition",property:"background-image-position-visual",type:o.TypeName.DATA_SELECT_INPUT,etsType:`${o.EtsType.ALIGNMENT}|${o.EtsType.STRING}`,list:[o.CLEAN_VALUE_NODE,{name:"TopStart",value:"top left"},{name:"Top",value:"top center"},{name:"TopEnd",value:"top right"},{name:"Start",value:"center left"},{name:"Center",value:"center center"},{name:"End",value:"center right"},{name:"BottomStart",value:"bottom left"},{name:"Bottom",value:"bottom center"},{name:"BottomEnd",value:"bottom right"}],defaults:"0 0"}}],d=[{propertySector:o.Sector.GENERAL,propertySet:{name:"Location",property:"position-visual",type:o.TypeName.SELECT,defaults:"offset",supportDynamicProperty:!1,list:[o.CLEAN_VALUE_NODE,{name:"offset",value:"relative"},{name:"position",value:"absolute"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"X",property:"left-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Y",property:"top-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}}],m=[...i,{propertySector:o.Sector.FEATURE,propertySet:{name:"TextAlign",property:"text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"LineHeight",property:"line-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextOverflow",property:"text-overflow-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_OVERFLOW,list:[o.CLEAN_VALUE_NODE,{name:"Clip",value:"clip"},{name:"Ellipsis",value:"ellipsis"},{name:"None",value:"none"}],defaults:"clip"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"BaselineOffset",property:"baseline-offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DecorationType",property:"decoration-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_DECORATION_TYPE,list:[o.CLEAN_VALUE_NODE,{name:"Underline",value:"underline"},{name:"LineThrough",value:"line-through"},{name:"Overline",value:"overline"},{name:"None",value:"none"}],defaults:"none"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DecorationColor",property:"decoration-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextCase",property:"text-case-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_CASE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"LowerCase"},{value:"UpperCase"}],defaults:"Normal"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"ForEach",property:"for-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"KeyGenerator",property:"keyGenerator-visual",type:o.TypeName.BASE,etsType:"Event",supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Item",property:"item-visual",type:o.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Item of ForEach Array"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Idx",property:"idx-visual",type:o.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Index of Corresponding Item In ForEach Array"}}],g=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Placeholder",property:"placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Type",property:"textInput-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.INPUT_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Password"},{value:"Email"},{value:"Number"}],defaults:"Normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderColor",property:"placeholderColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontSize",property:"placeholderFont-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontWeight",property:"placeholderFont-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Lighter"},{value:"Regular"},{value:"Medium"},{value:"Bold"},{value:"Bolder"},...o.commonFontWeight],defaults:"400"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontFamily",property:"placeholderFont-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontStyle",property:"placeholderFont-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Italic"}],defaults:"Normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EnterKeyType",property:"enterKeyType-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ENTER_KEY_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Go"},{value:"Search"},{value:"Send"},{value:"Next"},{value:"Done"}],defaults:"Done"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CaretColor",property:"caretColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"MaxLength",property:"maxLength-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}}],h=[{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"Vertical",property:"vertical-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"LineCap",property:"line-cap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.LINE_CAP_STYLE,defaults:"butt",list:[o.CLEAN_VALUE_NODE,{name:"Butt",value:"butt"},{name:"Round",value:"round"},{name:"Square",value:"square"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StrokeWidth",property:"stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:a}}],E=[{propertySector:o.Sector.FEATURE,propertySet:{name:"InitialIndex",property:"initial-index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ListDirection",property:"list-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.AXIS,list:[o.CLEAN_VALUE_NODE,{name:"Vertical",value:"vertical"},{name:"Horizontal",value:"horizontal"}],defaults:"vertical"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Color",property:"divider-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StrokeWidth",property:"divider-stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StartMargin",property:"divider-start-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EndMargin",property:"divider-end-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EditMode",property:"edit-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EdgeEffect",property:"edge-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{name:"Spring",value:"spring"},{name:"None",value:"none"}],defaults:"spring"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ChainAnimation",property:"chain-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}],T=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Sticky",property:"sticky-visual",type:o.TypeName.SELECT,etsType:o.EtsType.STICKY,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"Normal",value:"normal"}],defaults:"none"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Editable",property:"editable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}],v=[{propertySector:o.Sector.FLEX,propertySet:{name:"FlexBasis",property:"flex-basis-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:a,defaults:"auto",fixedValues:["auto"],info:"The initial main size of a flex item. It sets the size of the content box otherwise set with box-sizing."}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignSelf",property:"align-self-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"auto",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FLEX,propertySet:{name:"Direction",property:"flex-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_DIRECTION,defaults:"row",list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"RowReverse",value:"row-reverse"},{name:"Column",value:"column"},{name:"ColumnReverse",value:"column-reverse"}],info:"The direction of flex."}},{propertySector:o.Sector.FLEX,propertySet:{name:"Wrap",property:"wrap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_WRAP,defaults:"nowrap",list:[o.CLEAN_VALUE_NODE,{name:"NoWrap",value:"nowrap"},{name:"Wrap",value:"wrap"},{name:"WrapReverse",value:"wrap-reverse"}],info:"Whether flex items are forced onto one line or multiple lines."}},{propertySector:o.Sector.FLEX,propertySet:{name:"JustifyContent",property:"justify-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"JustifyContent",property:"justify-content-rc-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignItems",property:"align-items-flex-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"stretch",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignContent",property:"align-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Set the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis."}}],S=[{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"AutoPlay",property:"auto-play-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"Interval",property:"interval-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"Loop",property:"loop-visual"},o.commonParamsForJudge),{defaults:!0})},{propertySector:o.Sector.FEATURE,propertySet:{name:"Duration",property:"duration-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ItemSpace",property:"item-space-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CachedCount",property:"cached-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"DisableSwipe",property:"disable-swipe-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"Index",property:"index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"Indicator",property:"indicator-visual"},o.commonParamsForJudge),{defaults:!0})}],_=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Type",property:"toggle-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TOGGLE_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Button"},{value:"Checkbox"},{value:"Switch"}],defaults:"Button"}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"IsOn",property:"isOn-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedColor",property:"selectedColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SwitchPointColor",property:"switchPointColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}],N=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Friction",property:"friction-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:62}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Offset",property:"offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:a,defaults:16}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Refreshing",property:"refreshing-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}],C=[{propertySector:o.Sector.FEATURE,propertySet:{name:"TrackColor",property:"track-color-visual",type:o.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ShowSteps",property:"show-steps-visual",type:o.TypeName.ADJUSTABLE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ShowTips",property:"show-tips-visual",type:o.TypeName.ADJUSTABLE}}],A=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Range",property:"range-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Selected",property:"datetime-selected-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Start",property:"start-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"End",property:"end-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"UseMilitaryTime",property:"useMilitaryTime-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE,propertySet:{name:"Selected",property:"textPicker-selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DefaultPickerItemHeight",property:"defaultPickerItemHeight-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["vp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Lunar",property:"lunar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}],P=[{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontSize",property:"selected-option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontStyle",property:"selected-option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontColor",property:"selected-option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontWeight",property:"selected-option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...o.commonFontWeight],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontFamily",property:"selected-option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionBackgroundColor",property:"selected-option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontSize",property:"option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontStyle",property:"option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontColor",property:"option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontWeight",property:"option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...o.commonFontWeight],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontFamily",property:"option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionBackgroundColor",property:"option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Value",property:"select-value-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Selected",property:"selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Options",property:"select-option-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}}];t.etsPropertyList=[...u,...f,...l,..._,...m,...g,...h,...d,...E,...T,...v,...S,...N,...P,...C,...n.commonPropertyList,...y,...A,{propertySector:o.Sector.ATOMIC,propertySet:{name:"DisplayPriority",property:"display-priority-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Visibility",property:"visibility-visual",type:o.TypeName.SELECT,etsType:o.EtsType.VISIBILITY,defaults:"visible",list:[o.CLEAN_VALUE_NODE,{name:"Visible",value:"visible"},{name:"Hidden",value:"hidden"},{name:"None",value:"none"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Enabled",property:"enabled-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"true",list:[{value:"true"},{value:"false"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Align",property:"align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ALIGNMENT,defaults:"center",list:[o.CLEAN_VALUE_NODE,{name:"TopStart",value:"top-start"},{name:"Top",value:"top"},{name:"TopEnd",value:"top-end"},{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"},{name:"BottomStart",value:"bottom-start"},{name:"Bottom",value:"bottom"},{name:"BottomEnd",value:"bottom-end"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"If",property:"if-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Space",property:"space-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["vp","px","lpx"],requires:{"display-visual":["flex","cleanValue"]},info:"Space between any two adjacent child components."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"AlignItems",property:"align-items-row-visual",type:o.TypeName.SELECT,etsType:o.EtsType.VERTICAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[o.CLEAN_VALUE_NODE,{value:"flex-start",name:"top",etsEnumValue:"Top"},{value:"flex-end",name:"bottom",etsEnumValue:"Bottom"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the vertical direction."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"AlignItems",property:"align-items-column-visual",type:o.TypeName.SELECT,etsType:o.EtsType.HORIZONTAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[o.CLEAN_VALUE_NODE,{value:"flex-start",name:"start",etsEnumValue:"Start"},{value:"flex-end",name:"end",etsEnumValue:"End"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the horizontal direction."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Src",property:"src-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_SRC}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Alt",property:"alt-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT}},{propertySector:o.Sector.FEATURE,propertySet:{name:"RenderMode",property:"render-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_RENDER_MODE,defaults:"original",list:[o.CLEAN_VALUE_NODE,{name:"Original",value:"original"},{name:"Template",value:"template"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ObjectRepeat",property:"object-repeat-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_REPERT,defaults:"no-repeat",list:[o.CLEAN_VALUE_NODE,{name:"X",value:"X"},{name:"Y",value:"Y"},{name:"XY",value:"XY"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ObjectFit",property:"object-fit-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_FIT,defaults:"cover",list:[o.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Fill",value:"fill"},{name:"None",value:"none"},{name:"ScaleDown",value:"scale-down"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"InterPolation",property:"interpolation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_INTERPOLATION,defaults:"none",list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"High",value:"high"},{name:"Medium",value:"medium"},{name:"Low",value:"low"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SourceSizeWidth",property:"source-size-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SourceSizeHeight",property:"source-size-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Type",property:"type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BUTTON_TYPE,defaults:"capsule",list:[{name:"Normal",value:"normal"},{name:"Capsule",value:"capsule"},{name:"Circle",value:"circle"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StateEffect",property:"state-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"true",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Content",property:"content-visual",type:o.TypeName.ADJUSTABLE,etsType:o.EtsType.COMB_CONTENT}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Label",property:"label-visual",type:o.TypeName.ADJUSTABLE,etsType:o.EtsType.COMB_CONTENT}}]},958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonPropertyList=void 0;const n=r(513);t.commonPropertyList=[{propertySector:n.Sector.GENERAL,propertySet:{name:"BackgroundColor",property:"background-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Display",property:"display-visual",type:n.TypeName.SELECT,defaults:"flex",list:[n.CLEAN_VALUE_NODE,{value:"flex"},{value:"none"}]}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Opacity",property:"opacity-visual",type:n.TypeName.SLIDER,etsType:n.EtsType.COMB_R_NUMBER,defaults:"1",step:.01,max:1,min:0}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Overflow",property:"overflow-visual",type:n.TypeName.SELECT,defaults:"visible",list:[n.CLEAN_VALUE_NODE,{value:"visible"},{value:"hidden"},{value:"scroll"}]}},{propertySector:n.Sector.FLEX,propertySet:{name:"FlexGrow",property:"flex-grow-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:"0",requiresParent:{display:["flex","cleanValue"]},info:"The flex grow factor of a flex item's main size"}},{propertySector:n.Sector.FLEX,propertySet:{name:"FlexShrink",property:"flex-shrink-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:"1",requiresParent:{display:["flex","cleanValue"]},info:"The flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items will shrink"}},{propertySector:n.Sector.FLEX,propertySet:{name:"Columns",property:"columns-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:1,info:"The column number of flex."}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Header Logo",property:"headerLogo-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Title",property:"title-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Status",property:"status-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Logo",property:"logo-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Color",property:"color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FontFamily",property:"font-family-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_CONTENT,defaults:"sans-serif"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"MaxLines",property:"max-lines-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextColor",property:"text-color-visual",type:n.TypeName.COLOR,defaults:"rgba(0,0,0,0.9)"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FocusColor",property:"focus-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"DisappearColor",property:"disappear-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorColor",property:"indicator-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorSelectedColor",property:"indicator-selected-color-visual",type:n.TypeName.COLOR,defaults:"#ff007dff"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorSize",property:"indicator-size-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorTop",property:"indicator-top-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorRight",property:"indicator-right-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorBottom",property:"indicator-bottom-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorLeft",property:"indicator-left-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:{name:"AllowScale",property:"allow-scale-visual",type:n.TypeName.SELECT,defaults:"true",list:[n.CLEAN_VALUE_NODE,{value:"true"},{value:"false"}]}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowStart",property:"grid-row-start-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its row in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnStart",property:"grid-column-start-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its column in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowEnd",property:"grid-row-end-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its row in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnEnd",property:"grid-column-end-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its column in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridTemplateRows",property:"grid-template-rows-visual",type:n.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid rows."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridTemplateColumns",property:"grid-template-columns-visual",type:n.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid columns."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowsGap",property:"grid-rows-gap-visual",type:n.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's grid rows."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnsGap",property:"grid-columns-gap-visual",type:n.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's columns."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridGap",property:"grid-gap-visual",type:n.TypeName.INTEGER,units:["px"],requires:{"display-visual":["grid"]},info:"The gaps between rows and columns. It is a shorthand for row-gap and column-gap."}},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"MatchTextDirection",property:"match-text-direction-visual"},n.commonParamsForJudge)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"FitOriginalSize",property:"fit-original-size-visual"},n.commonParamsForJudge)},{propertySector:n.Sector.FEATURE,propertySet:{name:"IconWidth",property:"icon-width-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IconHeight",property:"icon-height-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextonColor",property:"texton-color-visual",type:n.TypeName.COLOR,defaults:"#000000"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextoffColor",property:"textoff-color-visual",type:n.TypeName.COLOR,defaults:"#000000"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextPadding",property:"text-padding-visual",type:n.TypeName.INTEGER,defaults:0,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"SelectedColor",property:"selected-color-visual",type:n.TypeName.COLOR,defaults:"rgba(0,125,255,1)"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"BlockColor",property:"block-color-visual",type:n.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Radius",property:"radius-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"StartAngle",property:"start-angle-visual",type:n.TypeName.INTEGER,defaults:240}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TotalAngle",property:"total-angle-visual",type:n.TypeName.INTEGER,defaults:240}},{propertySector:n.Sector.FEATURE,propertySet:{name:"CenterX",property:"center-x-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"CenterY",property:"center-y-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Colors",property:"colors-visual",type:n.TypeName.BASE}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Weights",property:"weights-visual",type:n.TypeName.BASE}},{propertySector:n.Sector.FEATURE,propertySet:{name:"PlaceHolderColor",property:"placeholder-color-visual",type:n.TypeName.COLOR,defaults:"gray"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ProgressColor",property:"progress-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR,defaults:"black"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ItemExtent",property:"item-extent-visual",type:n.TypeName.INTEGER,units:["px","%"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FadeColor",property:"fade-color-visual",type:n.TypeName.COLOR,defaults:"grey"}},{propertySector:n.Sector.FLEX,propertySet:{name:"ColumnSpan",property:"column-span-visual",type:n.TypeName.INTEGER,defaults:1,min:1,info:"The number of span."}},{propertySector:n.Sector.ATOMIC,propertySet:{name:"FlexWeight",property:"flex-weight-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.ATOMIC,propertySet:{name:"AspectRatio",property:"aspect-ratio-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"SecondaryColor",property:"secondary-color-visual",type:n.TypeName.COLOR,requires:{type:["horizontal","ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ScaleWidth",property:"scale-width-visual",type:n.TypeName.INTEGER,requires:{type:["ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ScaleNumber",property:"scale-number-visual",type:n.TypeName.INTEGER,defaults:120,requires:{type:["ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Value",property:"value-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:0}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Total",property:"total-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:100}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Style",property:"style-visual",type:n.TypeName.SELECT,etsType:n.EtsType.PROGRESS_STYLE,defaults:"Linear",list:[{value:"Linear"}]}}]},513:(e,t)=>{"use strict";var r,n,o,a,i,s;Object.defineProperty(t,"__esModule",{value:!0}),t.commonFontWeight=t.commonParamsForBorderRadius=t.commonParamsForIndicator=t.commonParamsForInteger=t.commonParamsForJudge=t.commonParamsForBorder=t.CLEAN_VALUE_NODE=t.EtsCombinationType=t.EtsBasicType=t.EtsEnumType=t.EtsType=t.TypeName=t.Sector=void 0,function(e){e.GENERAL="general",e.DIMENSION="dimension",e.FEATURE="feature",e.FLEX="flex",e.GRID="grid",e.ATOMIC="atomic"}(r||(r={})),t.Sector=r,function(e){e.BASE="base",e.INTEGER="integer",e.SELECT="select",e.COLOR="color",e.COMPOSITE="composite",e.SLIDER="slider",e.DATA_SELECT_INPUT="dataSelectInput",e.ADJUSTABLE="adjustable"}(n||(n={})),t.TypeName=n,function(e){e.ARRAY="ETSArray",e.BOOLEAN="boolean",e.DATE="Date",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(o||(o={})),t.EtsBasicType=o,function(e){e.R_FLOAT="Rfloat",e.R_STRING="Rstring",e.R_COLOR="Rcolor",e.R_PLURAL="Rplural",e.R_MEDIA="Rmedia",e.R_RAWFILE="Rrawfile"}(a||(a={})),function(e){e.ALIGNMENT="Alignment",e.AXIS="Axis",e.BORDER_STYLE="BorderStyle",e.BUTTON_TYPE="ButtonType",e.COLOR="Color",e.DIRECTION="Direction",e.EDGE_EFFECT="EdgeEffect",e.ENTER_KEY_TYPE="EnterKeyType",e.FLEX_ALIGN="FlexAlign",e.FLEX_DIRECTION="FlexDirection",e.FLEX_WRAP="FlexWrap",e.FONT_STYLE="FontStyle",e.FONT_WEIGHT="FontWeight",e.HORIZONTAL_ALIGN="HorizontalAlign",e.IMAGE_FIT="ImageFit",e.IMAGE_INTERPOLATION="ImageInterpolation",e.IMAGE_RENDER_MODE="ImageRenderMode",e.IMAGE_REPERT="ImageRepeat",e.IMAGE_SIZE="ImageSize",e.INPUT_TYPE="InputType",e.ITEM_ALIGN="ItemAlign",e.LINE_CAP_STYLE="LineCapStyle",e.PROGRESS_STYLE="ProgressStyle",e.STICKY="Sticky",e.TEXT_ALIGN="TextAlign",e.TEXT_OVERFLOW="TextOverflow",e.TEXT_DECORATION_TYPE="TextDecorationType",e.TEXT_CASE="TextCase",e.TOGGLE_TYPE="ToggleType",e.VERTICAL_ALIGN="VerticalAlign",e.VISIBILITY="Visibility"}(i||(i={})),t.EtsEnumType=i,function(e){e.COMB_COLOR="string|number|Color|Rcolor",e.COMB_LENGTH="string|number",e.COMB_R_NUMBER="number|Rfloat",e.COMB_R_LENGTH="string|number|Rfloat",e.COMB_CONTENT="string|Rstring|Rplural",e.COMB_SRC="string|Rmedia|Rrawfile"}(s||(s={})),t.EtsCombinationType=s;const l=Object.assign(Object.assign(Object.assign(Object.assign({},o),a),i),s);t.EtsType=l;const p={value:"cleanValue",name:"---Clean Value---"};t.CLEAN_VALUE_NODE=p;const c={type:n.SELECT,etsType:l.BORDER_STYLE,list:[p,{value:"dotted",etsEnumValue:"Dotted"},{value:"dashed",etsEnumValue:"Dashed"},{value:"solid",etsEnumValue:"Solid"}]};t.commonParamsForBorder=c;const u={type:n.SELECT,etsType:l.BOOLEAN,defaults:"false",list:[p,{value:"true"},{value:"false"}]};t.commonParamsForJudge=u;const f={type:n.INTEGER,units:["px"],placeholder:"0px"};t.commonParamsForInteger=f;const y={type:n.INTEGER,units:["px","%"]};t.commonParamsForIndicator=y;const d={type:n.INTEGER,units:["px"]};t.commonParamsForBorderRadius=d,t.commonFontWeight=[{value:"100"},{value:"200"},{value:"300"},{value:"400"},{value:"500"},{value:"600"},{value:"700"},{value:"800"},{value:"900"}]},282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TagTypeMap=void 0,t.TagTypeMap=new Map([["button","TextContent"],["span","TextContent"],["divider","TextContent"],["picker","TextContent"],["option","TextContent"],["clock","TextContent"],["image","Base"],["input","Base"],["chart","Base"],["slider","Base"],["progress","Base"],["text","Text"],["div","Container"],["list","Container"],["list-item","Container"],["list-item-group","Container"],["refresh","Container"],["dialog","Container"],["stack","Container"],["menu","Container"],["select","Container"],["tabs","Container"],["tab-bar","Container"],["tab-content","Container"]])},294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.beforeCodegen=t.getCustomCompRelativePath=t.getRelativePath=t.prepareCustomCompTagName=t.capitalize=t.getTagName=t.strToBase64=t.getUniqueName=t.getUniqueId=t.removeFromArray=t.getDataName=void 0;const n=r(891);function o(e){let t=a(e).replace(/[/=+]/g,"");return t.length>=4&&(t=t.substr(t.length/2-2,4)),t}function a(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");let r="";for(let t=0;t{const t=r.indexOf(e);-1!==t&&r.splice(t,1)})),r},t.getUniqueId=o,t.getUniqueName=function(e){return`${e}_${o(e)}`},t.strToBase64=a;const i=new Map,s=new Map;function l(e){return e[0].toUpperCase()+e.slice(1)}function p(e){const t=(0,n.getInstance)().document.path;if(0===e.size)return;const r=l(t.substring(t.lastIndexOf("/")+1));e.forEach(((e,n)=>{const o=e.length,a=[...e];n===r&&a.push(t);const p=function(e){e.sort();const t=e[0],r=e[e.length-1];let n=0;for(let e=0;e1||n===r)&&(u=l(e[a].substring(p+1).split("/").join("_"))),s.set(e[a],u);const f="/node_modules/";let y=c(e[a],t);e[a].startsWith(f)&&(y=e[a].replace(f,"@"),y=y.replace("src/main/supervisual","src/main/ets")),i.set(u,y)}}))}function c(e,t){const r=e.split("/"),n=t.split("/");let o=0;for(let e=0;e1){const n=l(r[r.length-1]),o=t.get(n);void 0===o?t.set(n,[e.type]):o.push(e.type)}const n=e.children;for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formManager=void 0;const n=r(891),o=r(945);t.formManager={removeData(e){this.getFormModel().data.delete(e)},addData(e){e instanceof Map?e.forEach(((e,t)=>{this.getFormModel().data.set(t,e)})):Object.keys(e).forEach((t=>{this.getFormModel().data.set(t,e[t])}))},updateAllData(e){this.getFormModel().data.clear(),this.addData(e)},addAction(e,t,r,n){const a=new Map;void 0!==r&&Object.keys(r).forEach((e=>{a.set(e,r[e])}));const i=new Map;void 0!==n&&Object.keys(n).forEach((e=>{i.set(e,n[e])})),this.getFormModel().actions.set(e,new o.FormAction(t,a,i))},updateAllActions(e){this.getFormModel().actions.clear(),e.forEach(((e,t)=>{const r=void 0===e.params?e.params:this.objectToMap(e.params),n=void 0===e.want?e.want:this.objectToMap(e.want),a=new o.FormAction(e.actionType,r,n);this.getFormModel().actions.set(t,a)}))},removeAction(e){this.getFormModel().actions.delete(e)},addActionParams(e,t){var r,n;const a=null!==(r=this.getFormModel().actions.get(e))&&void 0!==r?r:new o.FormAction(e),i=null!==(n=a.params)&&void 0!==n?n:new Map;Object.keys(t).forEach((e=>{i.set(e,t[e])})),a.params=i},removeActionParam(e,t){var r;const n=this.getFormModel().actions.get(e);null===(r=null==n?void 0:n.params)||void 0===r||r.delete(t)},getFormModel:()=>(0,n.getInstance)().formData,codegenToJson:function(){const e=(0,n.getInstance)().formData,t=this.mapToObject(e.data),r={actions:{},data:{}};return r.data=t,e.actions.forEach(((e,t)=>{r.actions[t]={},r.actions[t].action=e.action,e.params instanceof Map&&e.params.size>0&&(r.actions[t].params=this.mapToObject(e.params)),e.want instanceof Map&&e.want.size>0&&(r.actions[t].want=this.mapToObject(e.want))})),JSON.stringify(r,null,4)},clear(){(0,n.getInstance)().formData.data.clear(),(0,n.getInstance)().formData.actions.clear()},mapToObject:e=>void 0===e?{}:Array.from(e.entries()).reduce(((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r})),{}),objectToMap(e){const t=new Map;return Object.keys(e).forEach(((r,n)=>{t.set(r,e[r])})),t}}},945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormAction=t.FormModel=void 0,t.FormModel=class{constructor(){this.data=new Map,this.actions=new Map}},t.FormAction=class{constructor(e,t,r){this.action=e,this.params=t,this.want=r}}},509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeForVersion1=t.rootToVisualContent=t.visualToRootContent=t.serializeForVersion1=void 0;const n=r(891),o=r(933),a=r(571),i=r(282),s=r(945),l=r(977),p=new Map;function c(e){p.set("textMap",new Map);const t=u(null!=e?e:(0,n.getInstance)().visualModel);return JSON.stringify({VisualVersion:"1",content:JSON.stringify(t),extraData:JSON.stringify(d(p))})}function u(e){const t=Array.from(e.property).filter((t=>(0,a.isAttribute)(t[0],e.type)));t.push(["id",e.id]);const r=Array.from(e.property).filter((t=>(0,a.isStyle)(t[0],e.type)));let n=i.TagTypeMap.get(e.type);void 0===n&&(n="Base");let o=e.property.has("content")?e.property.get("content"):[];if(e.children.length>0){if("string"==typeof o){const t=p.get("textMap");t instanceof Map&&t.set(e.id,o)}o=e.children.map((e=>u(e)))}return{id:e.id,tagName:e.type,attributes:t,idStyle:r,type:n,content:o}}function f(e,t){let r;if(t instanceof Map){const n=t.get("textMap");n instanceof Map&&(r=n.get(e.id))}const n=new o.VisualModel({id:e.id,type:e.tagName,property:new Map([...e.attributes,...e.idStyle])});return"string"==typeof r&&n.property.set("content",r),n.property.delete("id"),"string"==typeof e.content&&n.property.set("content",e.content),Array.isArray(e.content)&&(n.children=e.content.map((e=>f(e,t)))),n}function y(e){if(e instanceof Array&&e.length>0&&"$$map"===e[0]){e.shift();const t=new Map;for(const[r,n]of e)t.set(r,y(n));return t}return e}function d(e){if(e instanceof Map){const t=["$$map"];for(const[r,n]of e)t.push([r,d(n)]);return t}return e}t.serializeForVersion1=c,t.visualToRootContent=function(e){try{return c(JSON.parse(e,l.reviver).visualModel)}catch(e){console.error("convert visual model to root model failed")}return e},t.rootToVisualContent=function(e){const t=JSON.parse(e),r=JSON.parse(t.content);let n='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(n=JSON.parse(t.extraData));const o=f(r,y(n));return o.property.has("flex-direction")||o.property.set("flex-direction","column"),JSON.stringify({document:{VisualVersion:"12",type:"FA"},visualModel:o,formData:new s.FormModel},l.replacer)},t.deserializeForVersion1=function(e){try{const t=JSON.parse(e),r=JSON.parse(t.content);let o='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(o=JSON.parse(t.extraData)),(0,n.getInstance)().visualModel=f(r,y(o)),(0,n.getInstance)().visualModel.property.has("flex-direction")||(0,n.getInstance)().visualModel.property.set("flex-direction","column")}catch(e){console.error("convert error")}}},891:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setInstance=t.getInstance=t.setVisualPath=t.clearCustomInstance=t.setCustomInstance=t.getInstanceTemplate=t.getCustomInstance=void 0;const n=r(933),o=r(945),a=r(904),i={document:{VisualVersion:"12",type:"FA",custom:!1,path:""},visualModel:new n.VisualModel({type:"div",id:"wrapper"}),formData:new o.FormModel},s=new Map;t.getCustomInstance=function(){return s},t.getInstanceTemplate=function(e){return{document:{VisualVersion:"12",type:"ETS",custom:e},visualModel:new n.VisualModel({type:"column",id:"wrapper"}),imgData:""}},t.setCustomInstance=function(e,t){var r;const o={path:"",document:{VisualVersion:"",type:"",custom:!0},visualModel:new n.VisualModel({type:"",id:""}),methods:[],property:[],imgData:"",originType:[]};o.path=e;for(const e in o)Object.prototype.hasOwnProperty.call(t,e)&&(o[e]=t[e]);o.visualModel=null!==(r=o.visualModel.children[0])&&void 0!==r?r:new n.VisualModel({type:"text"}),s.set(e,o)},t.clearCustomInstance=function(){s.clear()},t.setVisualPath=function(e){i.document.path=e},t.getInstance=function(){return i},t.setInstance=function(e){var t,r,n,o;for(const t in i)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);const s=i.document.type;void 0===i.document.custom&&(i.document.custom=!1),null!==((null!==(r=(null===(t=e.customData)||void 0===t?void 0:t.property.size)>0)&&void 0!==r?r:null)||(null!==(o=(null===(n=e.customData)||void 0===n?void 0:n.event.size)>0)&&void 0!==o?o:null))&&(i.customData=e.customData),(0,a.setDomain)("ETS"===s?a.Domain.ETS:"FORM"===s?a.Domain.FORM:a.Domain.FA)}},977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviver=t.replacer=t.serializeSketchPage=t.serializeCustom=t.deserializeCustom=t.deserialize=t.serialize=void 0;const n=r(933),o=r(891),a=r(509);function i(e,t){if(t instanceof Map)return{dataType:"Map",value:Object.fromEntries(t.entries())};if(t instanceof Set)return{dataType:"Set",value:Array.from(t.entries())};if(t instanceof n.VisualModel){const e=new n.VisualModel({type:"none"}),r={};for(const n in e)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return{dataType:"VisualModel",value:r}}return t}function s(e,t){if("object"==typeof t&&null!=t){if("Map"===t.dataType)return new Map(Object.entries(t.value));if("Set"===t.dataType)return new Set(t.value);if("VisualModel"===t.dataType){const e=new n.VisualModel({type:""});Object.assign(e,t.value),t=e}}return t}t.serialize=function(e,t){return 1===e?(0,a.serializeForVersion1)(t):JSON.stringify(null!=t?t:(0,o.getInstance)(),i,4)},t.deserialize=function(e){if("1"===JSON.parse(e).VisualVersion)return(0,a.deserializeForVersion1)(e);const t=JSON.parse(e,s);(0,o.setInstance)(t)},t.deserializeCustom=function(e,t){const r=JSON.parse(t,s);(0,o.setCustomInstance)(e,r)},t.serializeCustom=function(e){const t=(0,o.getInstanceTemplate)(!0);return t.visualModel.property=new Map([["width","100%"],["height","100%"]]),t.visualModel.children.push(e),JSON.stringify(t,i,4)},t.serializeSketchPage=function(e){const t=(0,o.getInstanceTemplate)(!1);return t.visualModel=e,JSON.stringify(t,i,4)},t.replacer=i,t.reviver=s},933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VisualModel=void 0;const r="-visual";t.VisualModel=class{constructor(e){if(this.propertyStorage=void 0,this.dynamicPropertyStorage=void 0,this.mediaProperty=void 0,this.dynamicMediaProperty=void 0,this.mediaPropertyStorage=void 0,this.dynamicMediaPropertyStorage=void 0,this.property=void 0!==e.property?e.property:new Map,this.dynamicProperty=void 0!==e.dynamicProperty?e.dynamicProperty:new Map,this.children=void 0!==e.children?e.children:[],"wrapper"===e.type)return this.id="wrapper",void(this.type="div");e.type.endsWith(r)&&(e.type=e.type.substring(0,e.type.length-r.length)),this.id=void 0!==e.id?e.id:"",this.type=e.type}getProperty(e){const t=this.dynamicProperty.get(e);return void 0!==t&&""!==t?t:this.property.get(e)}hasMediaProperty(e){if(void 0!==this.mediaProperty)for(const[,t]of this.mediaProperty)if(null==t?void 0:t.has(e))return!0;if(void 0!==this.dynamicMediaProperty)for(const[,t]of this.dynamicMediaProperty)if(null==t?void 0:t.has(e))return!0;return!1}hasProperty(e){return this.dynamicProperty.has(e)||this.property.has(e)}accept(e){return e.visit(this)}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";var e=n;Object.defineProperty(e,"__esModule",{value:!0});const t=r(784),o=r(891),a=r(977),i=r(844),s=r(55),l=r(207),p=r(413),c=r(435),u=r(486),f=r(294),y={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""};function d(e,r){var n;try{(0,a.deserialize)(e);const t=(0,o.getInstance)().document.VisualVersion,n=/^([1-9]+[0-9]*)$/;if(void 0===t)r.errorType="versionError";else{const e=t.match(n);(null===e||parseInt(e[1])>12)&&(r.errorType="versionError")}}catch(e){r.errorType="fileError"}""!==r.errorType&&(r.errorMessage=null!==(n=t.errorMap.get(r.errorType))&&void 0!==n?n:"Codegen visual file failed")}e.genHmlAndCss=function(e){const r={hmlCss:{hml:"",css:"",json:""},errorType:"",errorMessage:""};if(d(e,r),""!==r.errorType)return r.hmlCss.hml="",r.hmlCss.css="",r;try{const e=function(e){const t={hml:"",css:"",json:""},r=new i.HMLBridge,n=e.accept(r),o=(0,s.genFAHML)(n);t.hml=r.getErrorCount()>0?"error":o;const a=new i.CSSBridge,l=e.accept(a),p=(0,s.genFACSS)(l);return t.css=a.getErrorCount()>0?"error":p,t}((0,o.getInstance)().visualModel);"error"!==e.hml&&"error"!==e.css||(r.errorType="codegenError"),r.hmlCss=e,"FORM"===(0,o.getInstance)().document.type&&(r.hmlCss.json=l.formManager.codegenToJson())}catch(e){r.errorType="modelError"}return""!==r.errorType&&(r.errorMessage=t.errorMap.get(r.errorType),r.hmlCss.hml="",r.hmlCss.css=""),r},e.genETS=function(e){var r;const n={ets:(0,u.cloneDeep)(y),errorType:"",errorMessage:""};if(d(e,n),""!==n.errorType)return n.ets=(0,u.cloneDeep)(y),n;try{let e=(0,o.getInstance)().visualModel;(0,o.getInstance)().document.custom&&(e=e.children[0]),(0,f.beforeCodegen)(e);const t=function(e){const t=new p.ETSBridge,r=e.accept(t),n=(new c.StringWriter).genETS(r);return t.getErrorCount()>0?"error":n}(e);"error"===t&&(n.errorType="codegenError"),n.ets=t}catch(e){n.errorType="modelError"}return""!==n.errorType&&(n.errorMessage=null!==(r=t.errorMap.get(n.errorType))&&void 0!==r?r:"Codegen visual file failed",n.ets=(0,u.cloneDeep)(y)),n}})();var o=exports;for(var a in n)o[a]=n[a];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); \ No newline at end of file -- Gitee From 257e22c563ad1c12da7d449cb185ad5da1b18f3d Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Thu, 15 Sep 2022 21:00:24 +0800 Subject: [PATCH 021/379] Fix bug of formAbility incre compile Signed-off-by: zhangrengao Change-Id: I2db80bdcfe9f6e3e1e851391af270ceb75241e10 --- compiler/src/gen_abc_plugin.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 86fb24c..d7a0560 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -197,6 +197,9 @@ export class GenAbcPlugin { if (projectConfig.compileMode === ESMODULE) { return; } + if (intermediateJsBundle.length === 0) { + return; + } buildPathInfo = output; judgeWorkersToGenAbc(invokeWorkersToGenAbc); }); @@ -423,9 +426,9 @@ function writeFileSync(inputString: string, buildPath: string, keyPath: string, } let cacheOutputPath: string = ""; if (process.env.cachePath) { - let buildDirArr = projectConfig.buildPath.split(path.sep); - let buildDirPath = buildDirArr[buildDirArr.length - 1]; - cacheOutputPath = path.join(process.env.cachePath, TEMPORARY, buildDirPath, keyPath); + let buildDirArr: string[] = projectConfig.buildPath.split(path.sep); + let abilityDir: string = buildDirArr[buildDirArr.length - 1]; + cacheOutputPath = path.join(process.env.cachePath, TEMPORARY, abilityDir, keyPath); } else { cacheOutputPath = output; } @@ -912,9 +915,9 @@ function genHashJsonPath(buildPath: string): string { logger.debug(red, `ETS:ERROR hash path does not exist`, reset); return ''; } - let buildDirArr = projectConfig.buildPath.split(path.sep); - let buildDirPath = buildDirArr[buildDirArr.length - 1]; - let hashJsonPath = path.join(process.env.cachePath, TEMPORARY, buildDirPath, hashFile); + let buildDirArr: string[] = projectConfig.buildPath.split(path.sep); + let abilityDir: string = buildDirArr[buildDirArr.length - 1]; + let hashJsonPath: string = path.join(process.env.cachePath, TEMPORARY, abilityDir, hashFile); mkdirsSync(path.dirname(hashJsonPath)); return hashJsonPath; } else if (buildPath.indexOf(ARK) >= 0) { -- Gitee From cc0261018329053dec7f2331c5417745d506e6b7 Mon Sep 17 00:00:00 2001 From: hufeng Date: Tue, 20 Sep 2022 14:29:33 +0800 Subject: [PATCH 022/379] Fix es2abc's SyntaxError representation in ets-loader Signed-off-by: hufeng Change-Id: I93866cdfe6f827136eb9ffe6f39b2bff5d88fbdb --- compiler/src/gen_merged_abc.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index 4d856c6..ef16f6f 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -84,16 +84,22 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma try { const child = childProcess.exec(gen_abc_cmd); child.on('exit', (code: any) => { - if (code === 1) { - logger.debug(red, "ETS:ERROR failed to execute es2abc", reset); - } + if (code === 1) { + logger.error(red, "ETS:ERROR failed to execute es2abc", reset); + process.exit(FAIL); + } }); child.on('error', (err: any) => { - logger.error(red, err.toString(), reset); + logger.error(red, err.toString(), reset); + process.exit(FAIL); + }); + + child.stderr.on('data', (data: any) => { + logger.error(red, data.toString(), reset); }); } catch (e) { logger.debug(red, `ETS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); process.exit(FAIL); } -} \ No newline at end of file +} -- Gitee From b0447fa35a0f377717efa4a730208193166dbc10 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 20 Sep 2022 19:44:45 +0800 Subject: [PATCH 023/379] houhaoyu@huawei.com fix import npm package Signed-off-by: houhaoyu Change-Id: Ia529ea214cce575ca8d9056225403a393a2088be --- compiler/src/process_import.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index b00fd69..cea78a4 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -464,6 +464,9 @@ function getFileResolvePath(fileResolvePath: string, pagesDir: string, filePath: fileResolvePath = fileResolvePath + EXTNAME_ETS; } else if (isPackageJsonEntry(fileResolvePath)) { fileResolvePath = getPackageJsonEntry(fileResolvePath); + if (fs.statSync(fileResolvePath).isDirectory() && fs.existsSync(path.join(fileResolvePath, INDEX_ETS))) { + fileResolvePath = path.join(fileResolvePath, INDEX_ETS); + } } else if (fs.existsSync(path.join(fileResolvePath, INDEX_ETS))) { fileResolvePath = path.join(fileResolvePath, INDEX_ETS); } -- Gitee From 3a2bb36e80cc6a8292a8954503ccd5b12c21de50 Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Tue, 13 Sep 2022 21:21:38 +0800 Subject: [PATCH 024/379] Support hot-reload Change-Id: I7d7b5ca556cbbe230a0679b0b603fefd04d06989 Signed-off-by: chenqy930 --- compiler/src/gen_abc_plugin.ts | 59 ++++++++++++++++++++++++++++++++-- compiler/src/gen_merged_abc.ts | 10 +++--- 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 1c25854..5b15335 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -50,7 +50,8 @@ import { ES2ABC, TEMPORARY, SUCCESS, - MODULELIST_JSON + MODULELIST_JSON, + MODULES_ABC } from './pre_define'; import { getOhmUrlByFilepath } from './resolve_ohm_url'; import { generateMergedAbc } from './gen_merged_abc'; @@ -81,6 +82,7 @@ let hashJsonObject = {}; let moduleHashJsonObject = {}; let buildPathInfo: string = ''; let buildMapFileList: Array = []; +let isHotReloadFirstBuild: boolean = true; const red: string = '\u001b[31m'; const reset: string = '\u001b[39m'; @@ -360,7 +362,7 @@ function eliminateUnusedFiles(moduleList: Array): void{ } } -function handleFinishModules(modules, callback): any { +function handleFullModuleFiles(modules, callback): any { const nodeModulesFile: Array = []; modules.forEach(module => { if (module !== undefined && module.resourceResolveData !== undefined) { @@ -392,7 +394,9 @@ function handleFinishModules(modules, callback): any { eliminateUnusedFiles(buildMapFileList); updateCachedModuleList(buildMapFileList); } - generateMergedAbc(moduleInfos, entryInfos); + + const outputABCPath: string = path.join(projectConfig.buildPath, MODULES_ABC); + generateMergedAbc(moduleInfos, entryInfos, outputABCPath); clearGlobalInfo(); } else { judgeModuleWorkersToGenAbc(invokeWorkersModuleToGenAbc); @@ -972,3 +976,52 @@ function processExtraAssetForBundle() { copyFileCachePathToBuildPath(); clearGlobalInfo(); } + +function handleHotReloadChangedFiles() { + let changedFileListJson: string = fs.readFileSync(projectConfig.changedFileList).toString(); + let changedFileList: Array = JSON.parse(changedFileListJson).modifiedFiles; + + const nodeModulesFile: Array = []; + for (let file of changedFileList) { + let filePath: string = path.join(projectConfig.projectPath, file); + let tempFilePath: string = genTemporaryPath(filePath, projectConfig.projectPath, process.env.cachePath); + if (tempFilePath.length === 0) { + return; + } + let buildFilePath: string = ""; + tempFilePath = toUnixPath(tempFilePath); + + if (file.endsWith(EXTNAME_ETS)) { + processEtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + } else if (file.endsWith(EXTNAME_D_TS)) { + processDtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + } else if (file.endsWith(EXTNAME_TS)) { + processTsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + } else if (file.endsWith(EXTNAME_JS) || file.endsWith(EXTNAME_MJS) || file.endsWith(EXTNAME_CJS)) { + processJsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + } else { + logger.error(red, `ETS:ERROR Cannot find resolve this file path: ${filePath}`, reset); + process.exitCode = FAIL; + } + } + + if (!fs.existsSync(projectConfig.patchAbcPath)) { + mkdirsSync(projectConfig.patchAbcPath); + } + + const outputABCPath: string = path.join(projectConfig.patchAbcPath, MODULES_ABC); + generateMergedAbc(moduleInfos, entryInfos, outputABCPath); +} + +function handleFinishModules(modules, callback) { + if (projectConfig.hotReload && !isHotReloadFirstBuild) { + handleHotReloadChangedFiles(); + return; + } + + handleFullModuleFiles(modules, callback); + + if (projectConfig.hotReload) { + isHotReloadFirstBuild = false; + } +} diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index 14d5ffe..a8b9617 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -23,7 +23,6 @@ import { projectConfig } from '../main'; import { FAIL, FILESINFO_TXT, - MODULES_ABC, MODULES_CACHE, NPMENTRIES_TXT, NODE_MODULES @@ -68,21 +67,20 @@ function generateNpmEntriesInfo(entryInfos: Map) { fs.writeFileSync(npmEntriesInfoPath, entriesInfo, 'utf-8'); } -export function generateMergedAbc(moduleInfos: Array, entryInfos: Map) { +export function generateMergedAbc(moduleInfos: Array, entryInfos: Map, outputABCPath: string) { generateCompileFilesInfo(moduleInfos); generateNpmEntriesInfo(entryInfos); const filesInfoPath: string = path.join(process.env.cachePath, FILESINFO_TXT); const npmEntriesInfoPath: string = path.join(process.env.cachePath, NPMENTRIES_TXT); const cacheFilePath: string = path.join(process.env.cachePath, MODULES_CACHE); - const outputABCPath: string = path.join(projectConfig.buildPath, MODULES_ABC); const fileThreads = os.cpus().length < 16 ? os.cpus().length : 16; mkdirsSync(projectConfig.buildPath); - const gen_abc_cmd: string = + const genAbcCmd: string = `${initAbcEnv().join(' ')} "@${filesInfoPath}" --npm-module-entry-list "${npmEntriesInfoPath}" --cache-file "${cacheFilePath}" --output "${outputABCPath}" --file-threads "${fileThreads}"`; - logger.debug('gen abc cmd is: ', gen_abc_cmd); + logger.debug('gen abc cmd is: ', genAbcCmd); try { - const child = childProcess.exec(gen_abc_cmd); + const child = childProcess.exec(genAbcCmd); child.on('exit', (code: any) => { if (code === 1) { logger.error(red, "ETS:ERROR failed to execute es2abc", reset); -- Gitee From b3b5d39f2659d5a0be186829f972e526929bff81 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Mon, 19 Sep 2022 20:22:33 +0800 Subject: [PATCH 025/379] Fix max listeners of preview mode Signed-off-by: zhangrengao Change-Id: I4b761c2e2ab058db87477fc5b431d458d9ef438c --- compiler/src/gen_abc_plugin.ts | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index d7a0560..aef7a45 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -18,6 +18,7 @@ import * as path from 'path'; import cluster from 'cluster'; import process from 'process'; import os from 'os'; +import events from 'events'; import Compiler from 'webpack/lib/Compiler'; import { logger } from './compile_info'; import { @@ -64,7 +65,8 @@ let isDebug: boolean = false; let arkDir: string; let nodeJs: string; -let delayCount = 0; +let delayCount: number = 0; +let previewCount: number = 0; interface File { path: string, size: number, @@ -158,11 +160,15 @@ export class GenAbcPlugin { } } + // for preview mode max listeners + events.EventEmitter.defaultMaxListeners = 100; + compiler.hooks.compilation.tap('GenAbcPlugin', (compilation) => { if (projectConfig.compileMode === JSBUNDLE || projectConfig.compileMode === undefined) { return; } buildPathInfo = output; + delayCount++; compilation.hooks.finishModules.tap('finishModules', handleFinishModules.bind(this)); }); @@ -201,7 +207,8 @@ export class GenAbcPlugin { return; } buildPathInfo = output; - judgeWorkersToGenAbc(invokeWorkersToGenAbc); + delayCount++; + invokeWorkersToGenAbc(); }); } } @@ -210,13 +217,13 @@ function clearGlobalInfo() { // fix bug of multi trigger if (process.env.watchMode !== 'true') { intermediateJsBundle = []; + moduleInfos = []; + entryInfos = new Map(); } - moduleInfos = []; fileterIntermediateJsBundle = []; filterModuleInfos = []; commonJsModuleInfos = []; ESMModuleInfos = []; - entryInfos = new Map(); hashJsonObject = {}; moduleHashJsonObject = {}; buildMapFileList = []; @@ -398,7 +405,7 @@ function handleFinishModules(modules, callback): any { generateMergedAbc(moduleInfos, entryInfos); clearGlobalInfo(); } else { - judgeModuleWorkersToGenAbc(invokeWorkersModuleToGenAbc); + invokeWorkersModuleToGenAbc(moduleInfos); processEntryToGenAbc(entryInfos); } } @@ -584,8 +591,14 @@ function invokeCluterModuleToAbc(): void { if (count_ === totalWorkerNumber) { writeModuleHashJson(); clearGlobalInfo(); - if (process.env.watchMode === 'true') { + if (process.env.watchMode === 'true' && previewCount < delayCount) { + previewCount++; console.info(blue, 'COMPILE RESULT:SUCCESS ', reset); + if (previewCount >= delayCount) { + return; + } + invokeWorkersModuleToGenAbc(moduleInfos); + processEntryToGenAbc(entryInfos); } } logger.debug(`worker ${worker.process.pid} finished`); @@ -720,9 +733,14 @@ function invokeWorkersToGenAbc(): void { count_++; if (count_ === workerNumber) { // for preview of with incre compile - if (process.env.watchMode === 'true') { + if (process.env.watchMode === 'true' && previewCount < delayCount) { + previewCount++; processExtraAssetForBundle(); console.info(red, 'COMPILE RESULT:SUCCESS ', reset); + if (previewCount >= delayCount) { + return; + } + invokeWorkersToGenAbc(); } } logger.debug(`worker ${worker.process.pid} finished`); -- Gitee From 17aed854ebbbeceb6219fff454be3d6812dd87ec Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Tue, 20 Sep 2022 21:50:32 +0800 Subject: [PATCH 026/379] Add removeAllListener of preview mode Signed-off-by: zhangrengao Change-Id: Ide86aa06579f822a4e2126b77e3e404e74da81c0 --- compiler/src/gen_abc_plugin.ts | 51 ++++++++++++---------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index aef7a45..b4b4f75 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -65,8 +65,8 @@ let isDebug: boolean = false; let arkDir: string; let nodeJs: string; -let delayCount: number = 0; let previewCount: number = 0; +let compileCount: number = 0; interface File { path: string, size: number, @@ -168,7 +168,7 @@ export class GenAbcPlugin { return; } buildPathInfo = output; - delayCount++; + previewCount++; compilation.hooks.finishModules.tap('finishModules', handleFinishModules.bind(this)); }); @@ -207,7 +207,7 @@ export class GenAbcPlugin { return; } buildPathInfo = output; - delayCount++; + previewCount++; invokeWorkersToGenAbc(); }); } @@ -582,6 +582,9 @@ function invokeCluterModuleToAbc(): void { totalWorkerNumber += esmWorkerNumber; let count_ = 0; + if (process.env.watchMode === 'true') { + cluster.removeAllListeners("exit"); + } cluster.on('exit', (worker, code, signal) => { if (code === FAIL || process.exitCode === FAIL) { process.exitCode = FAIL; @@ -591,10 +594,10 @@ function invokeCluterModuleToAbc(): void { if (count_ === totalWorkerNumber) { writeModuleHashJson(); clearGlobalInfo(); - if (process.env.watchMode === 'true' && previewCount < delayCount) { - previewCount++; + if (process.env.watchMode === 'true' && compileCount < previewCount) { + compileCount++; console.info(blue, 'COMPILE RESULT:SUCCESS ', reset); - if (previewCount >= delayCount) { + if (compileCount >= previewCount) { return; } invokeWorkersModuleToGenAbc(moduleInfos); @@ -658,28 +661,6 @@ function splitModulesByNumber(moduleInfos: Array, workerNumber: numb return result; } -function judgeWorkersToGenAbc(callback): void { - const workerNum: number = Object.keys(cluster.workers).length; - if (workerNum === 0) { - callback(); - return; - } else { - delayCount++; - setTimeout(judgeWorkersToGenAbc.bind(null, callback), 50); - } -} - -function judgeModuleWorkersToGenAbc(callback): void { - const workerNum: number = Object.keys(cluster.workers).length; - if (workerNum === 0) { - callback(moduleInfos); - return; - } else { - delayCount++; - setTimeout(judgeModuleWorkersToGenAbc.bind(null, callback), 50); - } -} - function invokeWorkersToGenAbc(): void { if (process.env.watchMode === 'true') { process.exitCode = SUCCESS; @@ -725,6 +706,10 @@ function invokeWorkersToGenAbc(): void { } let count_ = 0; + if (process.env.watchMode === 'true') { + process.removeAllListeners("exit"); + cluster.removeAllListeners("exit"); + } cluster.on('exit', (worker, code, signal) => { if (code === FAIL || process.exitCode === FAIL) { process.exitCode = FAIL; @@ -733,11 +718,11 @@ function invokeWorkersToGenAbc(): void { count_++; if (count_ === workerNumber) { // for preview of with incre compile - if (process.env.watchMode === 'true' && previewCount < delayCount) { - previewCount++; + if (process.env.watchMode === 'true' && compileCount < previewCount) { + compileCount++; processExtraAssetForBundle(); console.info(red, 'COMPILE RESULT:SUCCESS ', reset); - if (previewCount >= delayCount) { + if (compileCount >= previewCount) { return; } invokeWorkersToGenAbc(); @@ -845,7 +830,7 @@ function writeModuleHashJson(): void { return; } // fix bug of multi trigger - if (process.env.watchMode !== 'true' || delayCount < 1) { + if (process.env.watchMode !== 'true' || previewCount < 1) { fs.writeFileSync(hashFilePath, JSON.stringify(moduleHashJsonObject)); } } @@ -921,7 +906,7 @@ function writeHashJson(): void { return; } // fix bug of multi trigger - if (process.env.watchMode !== 'true' || delayCount < 1) { + if (process.env.watchMode !== 'true' || previewCount < 1) { fs.writeFileSync(hashFilePath, JSON.stringify(hashJsonObject)); } } -- Gitee From 1b1d7edd2b1ddba974396b3a28aa361ff0b49b88 Mon Sep 17 00:00:00 2001 From: laibo102 Date: Thu, 22 Sep 2022 15:31:30 +0800 Subject: [PATCH 027/379] Update: close partial-update in preview mode Signed-off-by: laibo102 Change-Id: I9d7acb735127c357781c948a6a399888761ac387 --- compiler/main.js | 9 +++++++-- compiler/webpack.config.js | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 0d4fdb0..d47e50d 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -66,8 +66,10 @@ function initProjectConfig(projectConfig) { path.resolve(__dirname, 'node_modules/.cache'); projectConfig.aceSoPath = projectConfig.aceSoPath || process.env.aceSoPath; projectConfig.xtsMode = /ets_loader_ark$/.test(__dirname); - projectConfig.localPropertiesPath = projectConfig.localPropertiesPath || process.env.localPropertiesPath - projectConfig.projectProfilePath = projectConfig.projectProfilePath || process.env.projectProfilePath + projectConfig.localPropertiesPath = projectConfig.localPropertiesPath || process.env.localPropertiesPath; + projectConfig.projectProfilePath = projectConfig.projectProfilePath || process.env.projectProfilePath; + projectConfig.isPreview = projectConfig.isPreview || + (process.env.isPreview === 'true' ? true : process.env.isPreview); } function loadEntryObj(projectConfig) { @@ -440,6 +442,9 @@ function partialUpdateController(minAPIVersion) { if (partialUpdateConfig.alwaysClose) { return; } + if (projectConfig.isPreview) { + return; + } if (minAPIVersion >= 9) { partialUpdateConfig.partialUpdateMode = true; } diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 2d82851..78876ea 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -199,6 +199,9 @@ function setProjectConfig(envArgs) { if (envArgs.cachePath) { projectConfig.cachePath = envArgs.cachePath; } + if (envArgs.isPreview === "true") { + projectConfig.isPreview = true; + } } function setReleaseConfig(config) { -- Gitee From ea6744568b059860a94eae6e4c65e889bbcc456d Mon Sep 17 00:00:00 2001 From: zhangbingce Date: Thu, 22 Sep 2022 17:44:46 +0800 Subject: [PATCH 028/379] bugfix of crash in debug mode Signed-off-by: zhangbingce Change-Id: I04a310364cb59383cfc183651173f67c5834cbeb --- compiler/src/compile_info.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 8915de3..a7a63ce 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -111,7 +111,7 @@ export class ResultStates { if (map && map.size != 0) { let names: Array = Array.from(map).flat(); let sourcemapObj: any = JSON.parse(assets[key]._value); - sourcemapObj.names = names; + sourcemapObj.nameMap = names; assets[key]._value = JSON.stringify(sourcemapObj); } } -- Gitee From 5023a52cd9c24ffad0cf174cb518ebe15afa7166 Mon Sep 17 00:00:00 2001 From: bojiang Date: Fri, 16 Sep 2022 10:09:52 +0800 Subject: [PATCH 029/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: Id66171daa22f232c0ead8bbd4c33c72691fdd485 --- compiler/src/validate_ui_syntax.ts | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index be89ff1..b5384a1 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -73,8 +73,11 @@ import { getPackageInfo } from './utils'; import { projectConfig, abilityPagesFullPath } from '../main'; -import { collectExtend } from './process_ui_syntax'; -import { isExtendFunction } from './process_ui_syntax'; +import { + collectExtend, + isExtendFunction, + transformLog +} from './process_ui_syntax'; import { isOhmUrl } from './resolve_ohm_url'; import { logger } from './compile_info'; @@ -739,6 +742,7 @@ function traversalComponentProps(node: ts.StructDeclaration, properties: Set Date: Fri, 23 Sep 2022 09:43:00 +0800 Subject: [PATCH 030/379] Fix buildDir's incremental compiling with module compiling Signed-off-by: hufeng Change-Id: If21c62b15b523e2fd6604354609227b0e29e631a --- compiler/src/gen_abc_plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 893ce0d..29cc0ef 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -156,7 +156,7 @@ export class GenAbcPlugin { // | --- es2abc -- release -- removeDir // | --- ts2abc -- removeDir if (projectConfig.compileMode === ESMODULE) { - if ((projectConfig.buildArkMode !== 'debug' && process.env.panda === ES2ABC) || process.env.panda === TS2ABC) { + if ((projectConfig.buildArkMode !== 'debug' && process.env.panda !== TS2ABC) || process.env.panda === TS2ABC) { removeDir(output); removeDir(projectConfig.nodeModulesPath); } -- Gitee From 247b69b2783c16ce715107e0b491a1d0ea0b00dd Mon Sep 17 00:00:00 2001 From: lizhouze Date: Fri, 23 Sep 2022 14:39:52 +0800 Subject: [PATCH 031/379] lizhouze@huawei.com Signed-off-by: lizhouze --- compiler/main.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler/main.js b/compiler/main.js index d47e50d..090b765 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -306,7 +306,15 @@ function readWorkerFile(isPreview) { } const relativePath = path.relative(projectConfig.projectPath, worker); if (filterWorker(relativePath)) { - workerFileEntry[relativePath.replace(/\.(ts|js)$/, '').replace(/\\/g, '/')] = worker; + const workerKey = relativePath.replace(/\.(ts|js)$/, '').replace(/\\/g, '/'); + if (workerFileEntry[workerKey]) { + throw Error( + '\u001b[31m ERROR: The worker file cannot use the same file name: ' + + workerKey + '. \u001b[39m' + ).message; + } else { + workerFileEntry[workerKey] = worker; + } } }); return workerFileEntry; -- Gitee From 8e3a7ba0d6193109331bc735226a193b64ecc172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 23 Sep 2022 07:46:03 +0000 Subject: [PATCH 032/379] update compiler/main.js. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 090b765..c38a5e8 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -309,8 +309,8 @@ function readWorkerFile(isPreview) { const workerKey = relativePath.replace(/\.(ts|js)$/, '').replace(/\\/g, '/'); if (workerFileEntry[workerKey]) { throw Error( - '\u001b[31m ERROR: The worker file cannot use the same file name: ' + - workerKey + '. \u001b[39m' + '\u001b[31m ERROR: The worker file cannot use the same file name: \n' + + workerFileEntry[workerKey] + '\n' + worker + '\u001b[39m' ).message; } else { workerFileEntry[workerKey] = worker; -- Gitee From 0168f396ca23c50ff25fc3bd2202014a57fe2981 Mon Sep 17 00:00:00 2001 From: hufeng Date: Thu, 8 Sep 2022 11:06:59 +0800 Subject: [PATCH 033/379] Merge sourceMaps when compiling as esmodule Signed-off-by: hufeng Change-Id: Id573addf935588411bfcc80c013a8127f068648b --- compiler/src/gen_abc_plugin.ts | 72 +++++++++++++++++++++++++--------- compiler/src/gen_merged_abc.ts | 3 +- compiler/src/pre_define.ts | 2 + compiler/src/utils.ts | 31 ++++----------- 4 files changed, 66 insertions(+), 42 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 893ce0d..88fea71 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -31,7 +31,8 @@ import { genSourceMapFileName, checkNodeModulesFile, compareNodeVersion, - removeDir + removeDir, + newSourceMaps } from './utils'; import { projectConfig } from '../main'; import { @@ -39,20 +40,22 @@ import { JSBUNDLE, NODE_MODULES, ENTRY_TXT, + ES2ABC, EXTNAME_ETS, EXTNAME_JS, EXTNAME_TS, EXTNAME_MJS, EXTNAME_CJS, EXTNAME_D_TS, - FAIL, EXTNAME_JS_MAP, - TS2ABC, - ES2ABC, - TEMPORARY, - SUCCESS, + FAIL, MODULELIST_JSON, - MODULES_ABC + MODULES_ABC, + SUCCESS, + SOURCEMAPS_JSON, + SOURCEMAPS, + TEMPORARY, + TS2ABC } from './pre_define'; import { getOhmUrlByFilepath } from './resolve_ohm_url'; import { generateMergedAbc } from './gen_merged_abc'; @@ -83,7 +86,7 @@ let entryInfos: Map = new Map(); let hashJsonObject = {}; let moduleHashJsonObject = {}; let buildPathInfo: string = ''; -let buildMapFileList: Array = []; +let buildMapFileList: Set = new Set(); let isHotReloadFirstBuild: boolean = true; const red: string = '\u001b[31m'; @@ -228,7 +231,7 @@ function clearGlobalInfo() { ESMModuleInfos = []; hashJsonObject = {}; moduleHashJsonObject = {}; - buildMapFileList = []; + buildMapFileList = new Set(); } function getEntryInfo(tempFilePath: string, resourceResolveData: any): void { @@ -278,7 +281,7 @@ function processNodeModulesFile(filePath: string, tempFilePath: string, buildFil moduleInfos.push(tempModuleInfo); nodeModulesFile.push(tempFilePath); } - buildMapFileList.push(genSourceMapFileName(buildFilePath)); + buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath, ''))); } function processEtsModule(filePath: string, tempFilePath: string, buildFilePath: string, nodeModulesFile: Array, module: any): void { @@ -296,7 +299,7 @@ function processEtsModule(filePath: string, tempFilePath: string, buildFilePath: const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, false); moduleInfos.push(tempModuleInfo); } - buildMapFileList.push(genSourceMapFileName(buildFilePath)); + buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath, ''))); } function processDtsModule(filePath: string, tempFilePath: string, buildFilePath: string, nodeModulesFile: Array, module: any): void { @@ -315,7 +318,7 @@ function processTsModule(filePath: string, tempFilePath: string, buildFilePath: const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, false); moduleInfos.push(tempModuleInfo); } - buildMapFileList.push(genSourceMapFileName(buildFilePath)); + buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath, ''))); } function processJsModule(filePath: string, tempFilePath: string, buildFilePath: string, nodeModulesFile: Array, module: any): void { @@ -333,9 +336,22 @@ function processJsModule(filePath: string, tempFilePath: string, buildFilePath: const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, false); moduleInfos.push(tempModuleInfo); } - buildMapFileList.push(genSourceMapFileName(buildFilePath)); + buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath, ''))); } +var cachedSourceMaps: Object; + +function updateCachedSourceMaps(): void { + const CACHED_SOURCEMAPS: string = path.join(process.env.cachePath, SOURCEMAPS_JSON); + if (!fs.existsSync(CACHED_SOURCEMAPS)) { + cachedSourceMaps = {}; + } else { + cachedSourceMaps = JSON.parse(fs.readFileSync(CACHED_SOURCEMAPS).toString()); + } + Object.keys(newSourceMaps).forEach(key => { + cachedSourceMaps[key] = newSourceMaps[key]; + }); +} function getCachedModuleList(): Array { const CACHED_MODULELIST_FILE: string = path.join(process.env.cachePath, MODULELIST_JSON); @@ -349,6 +365,7 @@ function getCachedModuleList(): Array { function updateCachedModuleList(moduleList: Array): void { const CACHED_MODULELIST_FILE: string = path.join(process.env.cachePath, MODULELIST_JSON); + const CACHED_SOURCEMAPS: string = path.join(process.env.cachePath, SOURCEMAPS_JSON); let cachedJson: Object = {}; cachedJson["list"] = moduleList; fs.writeFile(CACHED_MODULELIST_FILE, JSON.stringify(cachedJson, null, 2), 'utf-8', @@ -358,6 +375,24 @@ function updateCachedModuleList(moduleList: Array): void { } } ); + fs.writeFile(CACHED_SOURCEMAPS, JSON.stringify(cachedSourceMaps, null, 2), 'utf-8', + (err)=>{ + if (err) { + logger.error(red, `ETS:ERROR Failed to write cache sourceMaps json.`, reset); + } + } + ); +} + +function writeSourceMaps(): void { + mkdirsSync(projectConfig.buildPath); + fs.writeFile(path.join(projectConfig.buildPath, SOURCEMAPS), JSON.stringify(cachedSourceMaps, null, 2), 'utf-8', + (err)=>{ + if (err) { + logger.error(red, `ETS:ERROR Failed to write sourceMaps.`, reset); + } + } + ); } function eliminateUnusedFiles(moduleList: Array): void{ @@ -365,9 +400,7 @@ function eliminateUnusedFiles(moduleList: Array): void{ if (cachedModuleList.length !== 0) { const eliminateFiles: Array = cachedModuleList.filter(m => !moduleList.includes(m)); eliminateFiles.forEach((file) => { - if (fs.existsSync(file)) { - fs.unlinkSync(file); - } + delete cachedSourceMaps[file]; }); } } @@ -401,8 +434,11 @@ function handleFullModuleFiles(modules, callback): any { if (projectConfig.compileMode === ESMODULE && process.env.panda !== TS2ABC) { if (projectConfig.buildArkMode === 'debug') { - eliminateUnusedFiles(buildMapFileList); - updateCachedModuleList(buildMapFileList); + const moduleList: Array = Array.from(buildMapFileList); + updateCachedSourceMaps(); + eliminateUnusedFiles(moduleList); + updateCachedModuleList(moduleList); + writeSourceMaps(); } const outputABCPath: string = path.join(projectConfig.buildPath, MODULES_ABC); diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index 61afaee..d0d16f5 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -49,7 +49,8 @@ function generateCompileFilesInfo(moduleInfos: Array) { let filesInfo: string = ''; moduleInfos.forEach(info => { const moduleType: string = info.isCommonJs ? 'commonjs' : 'esm'; - filesInfo += `${info.tempFilePath};${info.recordName};${moduleType}\n`; + const sourceFile: string = info.filePath.replace(projectConfig.projectRootPath, ''); + filesInfo += `${info.tempFilePath};${info.recordName};${moduleType};${toUnixPath(sourceFile)}\n`; }); fs.writeFileSync(filesInfoPath, filesInfo, 'utf-8'); } diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index e8e531b..faff8b8 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -248,6 +248,8 @@ export const NPMENTRIES_TXT: string = 'npmEntries.txt'; export const MODULES_CACHE: string = 'modules.cache'; export const MODULES_ABC: string = 'modules.abc'; export const MODULELIST_JSON: string = 'moduleList.json'; +export const SOURCEMAPS_JSON: string = 'sourceMaps.json'; +export const SOURCEMAPS: string = 'sourceMaps.map'; export const ESMODULE: string = 'esmodule'; export const JSBUNDLE: string = 'jsbundle'; diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 271ef17..9236849 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -406,23 +406,10 @@ function replaceRelativeDependency(item:string, moduleRequest: string, sourcePat return item; } -function generateSourceMap(jsFilePath: string, sourceMapContent: string): void { - let buildFilePath: string = genBuildPath(jsFilePath, projectConfig.projectPath, projectConfig.buildPath); - if (buildFilePath.length === 0) { - return; - } - if (buildFilePath.endsWith(EXTNAME_ETS)) { - buildFilePath = buildFilePath.replace(/\.ets$/, EXTNAME_JS); - } else { - buildFilePath = buildFilePath.replace(/\.ts$/, EXTNAME_JS); - } - let buildSourceMapFile: string = genSourceMapFileName(buildFilePath); - mkdirsSync(path.dirname(buildSourceMapFile)); - fs.writeFileSync(buildSourceMapFile, sourceMapContent); -} +export var newSourceMaps: Object = {}; export function generateSourceFilesToTemporary(node: ts.SourceFile): void { - const mixedInfo: {content: string, sourceMapContent: string} = genContentAndSourceMapInfo(node, false); + const mixedInfo: {content: string, sourceMapJson: any} = genContentAndSourceMapInfo(node, false); let jsFilePath: string = genTemporaryPath(node.fileName, projectConfig.projectPath, process.env.cachePath); if (jsFilePath.length === 0) { return; @@ -435,8 +422,7 @@ export function generateSourceFilesToTemporary(node: ts.SourceFile): void { let sourceMapFile: string = genSourceMapFileName(jsFilePath); mkdirsSync(path.dirname(jsFilePath)); if (sourceMapFile.length > 0 && projectConfig.buildArkMode === 'debug') { - mixedInfo.content += '\n' + "//# sourceMappingURL=" + path.basename(sourceMapFile); - generateSourceMap(node.fileName, mixedInfo.sourceMapContent); + newSourceMaps[node.fileName.replace(toUnixPath(projectConfig.projectRootPath) + '/', '')] = mixedInfo.sourceMapJson; } // replace relative moduleSpecifier with ohmURl const REG_RELATIVE_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]((?:\.\/|\.\.\/).*)['"]/g; @@ -458,8 +444,8 @@ export function writeFileSyncByNode(node: ts.SourceFile, toTsFile: boolean): voi node = ts.factory.updateSourceFile(node, newStatements); } - const mixedInfo: {content: string, sourceMapContent: string} = genContentAndSourceMapInfo(node, toTsFile); - let temporaryFile: string = genTemporaryPath(node.fileName, projectConfig.projectPath, process.env.cachePath, toTsFile); + const mixedInfo: {content: string, sourceMapJson: any} = genContentAndSourceMapInfo(node, toTsFile); + let temporaryFile: string = genTemporaryPath(node.fileName, projectConfig.projectPath, process.env.cachePath); if (temporaryFile.length === 0) { return; } @@ -480,7 +466,7 @@ export function writeFileSyncByNode(node: ts.SourceFile, toTsFile: boolean): voi mkdirsSync(path.dirname(temporaryFile)); if (temporarySourceMapFile.length > 0 && projectConfig.buildArkMode === 'debug') { mixedInfo.content += '\n' + "//# sourceMappingURL=" + path.basename(temporarySourceMapFile); - fs.writeFileSync(temporarySourceMapFile, mixedInfo.sourceMapContent); + fs.writeFileSync(temporarySourceMapFile, JSON.stringify(mixedInfo.sourceMapJson)); } fs.writeFileSync(temporaryFile, mixedInfo.content); } @@ -515,18 +501,17 @@ function genContentAndSourceMapInfo(node: ts.SourceFile, toTsFile: boolean): any ts.getNewLineCharacter({newLine: ts.NewLineKind.LineFeed, removeComments: false})); printer['writeFile'](node, writer, sourceMapGenerator); const sourceMapJson: any = sourceMapGenerator.toJSON(); - sourceMapJson['sources'] = [fileName]; + sourceMapJson['sources'] = [fileName.replace(toUnixPath(projectConfig.projectRootPath) + '/', '')]; const result: string = writer.getText(); let content: string = result; content = processSystemApi(content, true); if (toTsFile) { content = result.replace(`${TS_NOCHECK};`, TS_NOCHECK); } - const sourceMapContent: string = JSON.stringify(sourceMapJson); return { content: content, - sourceMapContent: sourceMapContent + sourceMapJson: sourceMapJson }; } -- Gitee From 77bd7db0bd2601cf129e4364f9ef5bee91afa71f Mon Sep 17 00:00:00 2001 From: bojiang Date: Fri, 23 Sep 2022 15:03:06 +0800 Subject: [PATCH 034/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: Ie104f86bc5bceb4416fcf3cd9b701d7b49b4126c --- compiler/src/pre_process.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/compiler/src/pre_process.ts b/compiler/src/pre_process.ts index 8347e85..a961471 100644 --- a/compiler/src/pre_process.ts +++ b/compiler/src/pre_process.ts @@ -259,7 +259,7 @@ function generateSourceMapForNewAndOriEtsFile(resourcePath: string, content: str const visualDirPath: string = path.parse(resourcePath).dir; const etsDirPath: string = path.parse(projectConfig.projectPath).dir; const visualMapDirPath: string = path.resolve(process.env.cachePath, SUPERVISUAL + - (visualDirPath.includes(etsDirPath) ? visualDirPath.replace(etsDirPath, '') : '')); + visualDirPath.replace(etsDirPath, '')); if (!(fs.existsSync(visualMapDirPath) && fs.statSync(visualMapDirPath).isDirectory())) { mkDir(visualMapDirPath); } @@ -271,9 +271,11 @@ function generateSourceMapForNewAndOriEtsFile(resourcePath: string, content: str } function findVisualFile(filePath: string): string { - const visualPath: string = filePath.replace(projectConfig.projectPath, - projectConfig.aceSuperVisualPath).replace('.ets', '.visual'); - return visualPath.replace('ets', 'supervisual'); + const etsDirPath: string = path.parse(projectConfig.projectPath).dir; + const visualDirPath: string = path.parse(projectConfig.aceSuperVisualPath).dir; + return filePath + .replace(projectConfig.projectPath, projectConfig.aceSuperVisualPath) + .replace(etsDirPath, visualDirPath).replace(/\.ets$/, '.visual'); } function getVisualContent(visualPath: string, log: LogInfo[]): any { -- Gitee From 70c4cc5df147b59cd660ba52e8aa536c462dac1a Mon Sep 17 00:00:00 2001 From: laibo102 Date: Fri, 23 Sep 2022 18:15:37 +0800 Subject: [PATCH 035/379] Bugfixed: fixed import/export module name validate Signed-off-by: laibo102 Change-Id: Ibcf7751b0aa32015c9e013c1e4edbf807df90b46 --- compiler/src/process_import.ts | 27 ++++++++++++++++++++++++++- compiler/src/utils.ts | 2 +- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index cea78a4..c53aab3 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -48,7 +48,7 @@ import { import { hasDecorator, LogInfo, LogType, repeatLog } from './utils'; import { projectConfig } from '../main'; import { isOhmUrl, resolveSourceFile } from './resolve_ohm_url'; -import { CUSTOM_BUILDER_METHOD } from './component_map'; +import { CUSTOM_BUILDER_METHOD, INNER_COMPONENT_NAMES } from './component_map'; const IMPORT_FILE_ASTCACHE: Map = new Map(); @@ -71,6 +71,7 @@ isEntryPage: boolean = true, pathCollection: Set = new Set()): void { node.importClause.namedBindings.elements && isEntryPage) { node.importClause.namedBindings.elements.forEach(item => { if (item.name && ts.isIdentifier(item.name)) { + validateModuleName(item.name, log); if (item.propertyName && ts.isIdentifier(item.propertyName) && asName) { asName.set(item.propertyName.escapedText.toString(), item.name.escapedText.toString()); } else { @@ -199,6 +200,7 @@ function visitAllNode(node: ts.Node, sourceFile: ts.SourceFile, defaultNameFromP if (!item.propertyName) { asExportCollection.set(item.name.escapedText.toString(), item.name.escapedText.toString()); } else if (item.propertyName && ts.isIdentifier(item.propertyName)) { + validateModuleName(item.name, log, sourceFile, fileResolvePath); if (hasCollection(item.propertyName)) { let asExportName: string = item.name.escapedText.toString(); const asExportPropertyName: string = item.propertyName.escapedText.toString(); @@ -477,3 +479,26 @@ function getFileResolvePath(fileResolvePath: string, pagesDir: string, filePath: } return fileResolvePath; } + +function validateModuleName(moduleNode: ts.Identifier, log: LogInfo[], sourceFile?: ts.SourceFile, + fileResolvePath?: string): void { + const moduleName: string = moduleNode.escapedText.toString(); + if (INNER_COMPONENT_NAMES.has(moduleName)) { + const error: LogInfo = { + type: LogType.ERROR, + message: `The module name '${moduleName}' can not be the same as the inner component name.`, + pos: moduleNode.getStart() + } + if (sourceFile && fileResolvePath) { + const posOfNode: ts.LineAndCharacter = sourceFile.getLineAndCharacterOfPosition(moduleNode.getStart()); + const line: number = posOfNode.line + 1; + const column: number = posOfNode.character + 1; + Object.assign(error, { + fileName: fileResolvePath, + line: line, + column: column + }) + } + log.push(error); + } +} diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 271ef17..8487dde 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -84,7 +84,7 @@ export function emitLogInfo(loader: any, infos: LogInfo[]) { infos.forEach((item) => { switch (item.type) { case LogType.ERROR: - loader.emitError(getMessage(loader.resourcePath, item)); + loader.emitError(getMessage(item.fileName || loader.resourcePath, item)); break; case LogType.WARN: loader.emitWarning(getMessage(item.fileName || loader.resourcePath, item)); -- Gitee From b3e62f36e98a1007fed2214ca2e718ba0b9e9b64 Mon Sep 17 00:00:00 2001 From: hufeng Date: Thu, 18 Aug 2022 10:30:27 +0800 Subject: [PATCH 036/379] Disable webpack's symlinks Issue:https://gitee.com/openharmony/developtools_ace-ets2bundle/issues/I5MURF Signed-off-by: hufeng Change-Id: Ib427f40ab7ebc81154288b8725555d4e1dfb5c2e --- compiler/webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 793cb95..3e37342 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -119,6 +119,7 @@ function initConfig(config) { }, resolve: { plugins: [new OHMResolverPlugin()], + symlinks: projectConfig.compileMode === 'esmodule' ? false : true, extensions: ['.js', '.ets', '.ts', '.d.ts'], modules: [ projectPath, -- Gitee From 45c39348f6ceff7a26330827c19c6efee5763166 Mon Sep 17 00:00:00 2001 From: hufeng Date: Sat, 24 Sep 2022 16:59:05 +0800 Subject: [PATCH 037/379] Remove build-dir when compiling as module Signed-off-by: hufeng Change-Id: I99b0542a2b8d31b7eb0ae288ffb72ab9f4d79332 --- compiler/src/gen_abc_plugin.ts | 11 ----------- compiler/webpack.config.js | 3 --- 2 files changed, 14 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 9e3b092..9c3a2a7 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -154,17 +154,6 @@ export class GenAbcPlugin { return; } - // case ESMODULE - // | --- es2abc -- debug -- not removeDir - // | --- es2abc -- release -- removeDir - // | --- ts2abc -- removeDir - if (projectConfig.compileMode === ESMODULE) { - if ((projectConfig.buildArkMode !== 'debug' && process.env.panda !== TS2ABC) || process.env.panda === TS2ABC) { - removeDir(output); - removeDir(projectConfig.nodeModulesPath); - } - } - // for preview mode max listeners events.EventEmitter.defaultMaxListeners = 100; diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 78876ea..eed5baf 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -359,9 +359,6 @@ function setGenAbcPlugin(env, config) { } function setCleanWebpackPlugin(workerFile, config) { - if (projectConfig.compileMode === 'esmodule') { - return; - } let cleanPath = []; cleanPath.push(projectConfig.buildPath); if (workerFile) { -- Gitee From 20073a3680be8f4bb26e2fd94e494caa367500b9 Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Mon, 26 Sep 2022 10:12:02 +0800 Subject: [PATCH 038/379] Add merge sourcemap for hotreload files Issue:https://gitee.com/openharmony/developtools_ace_ets2bundle/issues/I5T23I Signed-off-by: chenqy930 Change-Id: I3714ecea3cdb6ade5f01d476d656f0b4235f6473 --- compiler/src/gen_abc_plugin.ts | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 9c3a2a7..0927ae7 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -1018,8 +1018,12 @@ function processExtraAssetForBundle() { function handleHotReloadChangedFiles() { let changedFileListJson: string = fs.readFileSync(projectConfig.changedFileList).toString(); let changedFileList: Array = JSON.parse(changedFileListJson).modifiedFiles; + let relativeProjectPath = projectConfig.projectPath.slice(projectConfig.projectRootPath.length + path.sep.length); const nodeModulesFile: Array = []; + let hotReloadSourceMap: Object = {}; + moduleInfos = []; + for (let file of changedFileList) { let filePath: string = path.join(projectConfig.projectPath, file); let tempFilePath: string = genTemporaryPath(filePath, projectConfig.projectPath, process.env.cachePath); @@ -1030,17 +1034,20 @@ function handleHotReloadChangedFiles() { tempFilePath = toUnixPath(tempFilePath); if (file.endsWith(EXTNAME_ETS)) { - processEtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + processEtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); } else if (file.endsWith(EXTNAME_D_TS)) { - processDtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + processDtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); } else if (file.endsWith(EXTNAME_TS)) { - processTsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + processTsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); } else if (file.endsWith(EXTNAME_JS) || file.endsWith(EXTNAME_MJS) || file.endsWith(EXTNAME_CJS)) { - processJsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + processJsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); } else { logger.error(red, `ETS:ERROR Cannot find resolve this file path: ${filePath}`, reset); process.exitCode = FAIL; } + + let sourceMapPath: string = toUnixPath(path.join(relativeProjectPath, file)); + hotReloadSourceMap[sourceMapPath] = newSourceMaps[sourceMapPath]; } if (!fs.existsSync(projectConfig.patchAbcPath)) { @@ -1049,6 +1056,15 @@ function handleHotReloadChangedFiles() { const outputABCPath: string = path.join(projectConfig.patchAbcPath, MODULES_ABC); generateMergedAbc(moduleInfos, entryInfos, outputABCPath); + + // write source maps + fs.writeFile(path.join(projectConfig.patchAbcPath, SOURCEMAPS), JSON.stringify(hotReloadSourceMap, null, 2), 'utf-8', + (err)=>{ + if (err) { + logger.error(red, `ETS:ERROR Failed to write sourceMaps.`, reset); + } + } + ); } function handleFinishModules(modules, callback) { -- Gitee From 9947df44947067cbee865c321ba44c7e20ebd562 Mon Sep 17 00:00:00 2001 From: hufeng Date: Mon, 26 Sep 2022 10:32:20 +0800 Subject: [PATCH 039/379] Fix module compiling's build_Dir & log output type Signed-off-by: hufeng Change-Id: Ie893b2ebe904c603dc5e0360587b02355419d294 --- compiler/src/gen_abc_plugin.ts | 5 +++++ compiler/src/gen_merged_abc.ts | 6 +++--- compiler/webpack.config.js | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 9c3a2a7..f71be6d 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -154,6 +154,11 @@ export class GenAbcPlugin { return; } + if (projectConfig.compileMode === ESMODULE) { + removeDir(output); + removeDir(projectConfig.nodeModulesPath); + } + // for preview mode max listeners events.EventEmitter.defaultMaxListeners = 100; diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index d0d16f5..222bd91 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -84,18 +84,18 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma const child = childProcess.exec(genAbcCmd); child.on('exit', (code: any) => { if (code === 1) { - logger.error(red, "ETS:ERROR failed to execute es2abc", reset); + logger.debug(red, "ETS:ERROR failed to execute es2abc", reset); process.exit(FAIL); } }); child.on('error', (err: any) => { - logger.error(red, err.toString(), reset); + logger.debug(red, err.toString(), reset); process.exit(FAIL); }); child.stderr.on('data', (data: any) => { - logger.error(red, data.toString(), reset); + logger.debug(red, data.toString(), reset); }); } catch (e) { logger.debug(red, `ETS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 7e74a61..8ffdee9 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -360,6 +360,9 @@ function setGenAbcPlugin(env, config) { } function setCleanWebpackPlugin(workerFile, config) { + if (projectConfig.compileMode === 'esmodule') { + return; + } let cleanPath = []; cleanPath.push(projectConfig.buildPath); if (workerFile) { -- Gitee From 27e9ce651d340ad3d1377aa3abfa6eec4c4d0562 Mon Sep 17 00:00:00 2001 From: yfwang6 Date: Tue, 20 Sep 2022 14:30:54 +0800 Subject: [PATCH 040/379] wangyongfei6@huawei.com remove syntax_parser peg file Signed-off-by: yfwang6 Change-Id: Icc8a3e713cf17d096433aaeb7e701bc48937e0c6 --- BUILD.gn | 29 ----- build_ets_loader_library.py | 20 +-- compiler/build_parser.js | 48 ------- compiler/package-lock.json | 6 - compiler/package.json | 4 +- .../syntax_parser/src/exclude_comment.peg | 37 ------ compiler/syntax_parser/src/parse_extend.peg | 27 ---- compiler/syntax_parser/src/syntax_parser.peg | 123 ------------------ 8 files changed, 4 insertions(+), 290 deletions(-) delete mode 100644 compiler/build_parser.js delete mode 100644 compiler/syntax_parser/src/exclude_comment.peg delete mode 100644 compiler/syntax_parser/src/parse_extend.peg delete mode 100644 compiler/syntax_parser/src/syntax_parser.peg diff --git a/BUILD.gn b/BUILD.gn index 9296e50..6f7b703 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -23,8 +23,6 @@ if (sdk_build_public) { ets_loader_lib_dir = get_label_info(":build_ets_loader_library", "target_out_dir") + "/lib" -ets_loader_syntax_dir = get_label_info(":build_ets_loader_library", - "target_out_dir") + "/syntax_parser/dist" ets_loader_declarations_dir = get_label_info(":build_ets_loader_library", "target_out_dir") + "/declarations" ets_loader_component_config_file = @@ -42,7 +40,6 @@ action("build_ets_loader_library") { depfile = "$target_gen_dir/$target_name.d" outputs = [ ets_loader_lib_dir, - ets_loader_syntax_dir, ets_loader_declarations_dir, ets_loader_component_config_file, ] @@ -62,14 +59,12 @@ action("build_ets_loader_library") { _babel_js = _ace_config_dir + "/node_modules/@babel/cli/bin/babel.js" _babel_config_js = _ace_config_dir + "/babel.config.js" _uglify_source_js = _ace_config_dir + "/uglify-source.js" - _build_parser_js = _ace_config_dir + "/build_parser.js" _build_declarations_file_js = _ace_config_dir + "/build_declarations_file.js" inputs = [ _babel_config_js, _babel_js, _uglify_source_js, - _build_parser_js, _build_declarations_file_js, ] @@ -101,18 +96,12 @@ action("build_ets_loader_library") { rebase_path(_babel_js, root_build_dir), "--ets-loader-src-dir", rebase_path(_ets_loader_dir + "/src", root_build_dir), - "--ets-loader-syntax-src-dir", - rebase_path(_ets_loader_dir + "/syntax_parser/src", root_build_dir), "--babel-config-js", rebase_path(_babel_config_js, root_build_dir), "--uglify-source-js", rebase_path(_uglify_source_js, root_build_dir), - "--build-parser-js", - rebase_path(_build_parser_js, root_build_dir), "--output-dir", rebase_path(ets_loader_lib_dir, root_build_dir), - "--output-syntax-dir", - rebase_path(ets_loader_syntax_dir, root_build_dir), "--declarations-file-dir", rebase_path(_declarations_file_dir, root_build_dir), "--build-declarations-file-js", @@ -193,14 +182,6 @@ ohos_copy("ets_loader_library") { module_install_name = "" } -ohos_copy("ets_loader_syntax") { - deps = [ ":build_ets_loader_library" ] - sources = [ ets_loader_syntax_dir ] - outputs = [ target_out_dir + "/$target_name" ] - module_source_dir = target_out_dir + "/$target_name" - module_install_name = "" -} - ohos_copy("components") { sources = [ "compiler/components" ] outputs = [ target_out_dir + "/$target_name" ] @@ -256,15 +237,6 @@ ohos_copy("ets_loader_ark_declaration") { outputs = [ target_out_dir + "/ets_loader_ark/declarations" ] } -ohos_copy("ets_loader_ark_syntax") { - deps = [ - ":build_ets_loader_library", - ":ets_loader_ark", - ] - sources = [ ets_loader_syntax_dir ] - outputs = [ target_out_dir + "/ets_loader_ark/syntax_parser/dist" ] -} - ohos_copy("ets_loader_ark_components") { deps = [ ":build_ets_loader_library", @@ -321,7 +293,6 @@ ohos_copy("ets_loader_node_modules") { ":ets_loader_ark_declaration", ":ets_loader_ark_lib", ":ets_loader_ark_server", - ":ets_loader_ark_syntax", ] sources = [ "//developtools/ace_ets2bundle/compiler/node_modules" ] outputs = [ target_out_dir + "/ets_loader_ark/node_modules" ] diff --git a/build_ets_loader_library.py b/build_ets_loader_library.py index 592f315..d160556 100755 --- a/build_ets_loader_library.py +++ b/build_ets_loader_library.py @@ -39,14 +39,9 @@ def parse_args(): parser.add_argument('--node', help='path to nodejs exetuable') parser.add_argument('--babel-js', help='path to babel.js') parser.add_argument('--ets-loader-src-dir', help='path to compiler/src') - parser.add_argument('--ets-loader-syntax-src-dir', - help='path to compiler/syntax_parser/src') parser.add_argument('--babel-config-js', help='path babel.config.js') parser.add_argument('--uglify-source-js', help='path uglify-source.js') - parser.add_argument('--build-parser-js', help='path build_parser.js') parser.add_argument('--output-dir', help='path to output') - parser.add_argument('--output-syntax-dir', - help='path syntax file to output') parser.add_argument('--declarations-file-dir', help='path declarations file') parser.add_argument('--build-declarations-file-js', @@ -60,9 +55,8 @@ def parse_args(): return options -def do_build(build_cmd, uglify_cmd, syntax_cmd, build_declarations_file_cmd): - for cmd in [build_cmd, uglify_cmd, syntax_cmd, - build_declarations_file_cmd]: +def do_build(build_cmd, uglify_cmd, build_declarations_file_cmd): + for cmd in [build_cmd, uglify_cmd, build_declarations_file_cmd]: build_utils.check_output(cmd) @@ -76,16 +70,10 @@ def main(): build_cmd.extend(['--config-file', options.babel_config_js]) depfile_deps = [options.node, options.babel_js, options.babel_config_js] depfile_deps.extend(build_utils.get_all_files(options.ets_loader_src_dir)) - depfile_deps.extend( - build_utils.get_all_files(options.ets_loader_syntax_src_dir)) uglify_cmd = [options.node, options.uglify_source_js, options.output_dir] depfile_deps.append(options.uglify_source_js) - syntax_cmd = [options.node, options.build_parser_js, - options.output_syntax_dir, options.ets_loader_src_dir] - depfile_deps.append(options.build_parser_js) - build_declarations_file_cmd = [options.node, options.build_declarations_file_js, options.declarations_file_dir, @@ -94,14 +82,12 @@ def main(): depfile_deps.append(options.build_declarations_file_js) build_utils.call_and_write_depfile_if_stale( - lambda: do_build(build_cmd, uglify_cmd, - syntax_cmd, build_declarations_file_cmd), + lambda: do_build(build_cmd, uglify_cmd, build_declarations_file_cmd), options, depfile_deps=depfile_deps, input_paths=depfile_deps, output_paths=([ options.output_dir, - options.output_syntax_dir, options.output_declarations_dir, options.output_component_config_file])) diff --git a/compiler/build_parser.js b/compiler/build_parser.js deleted file mode 100644 index fd83200..0000000 --- a/compiler/build_parser.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 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 util = require('util'); -const childProcess = require('child_process'); -const exec = util.promisify(childProcess.exec); -const fs = require('fs'); -const path = require('path'); - -function generateSyntaxParser(inputFile, nodePath) { - const readDirPath = path.resolve(__dirname, './syntax_parser/src'); - const readDirSubFiles = fs.readdirSync(readDirPath); - const catalogPath = path.resolve(inputFile, '..'); - const catalogSubFiles = fs.readdirSync(catalogPath) - const parserPath = path.resolve(__dirname, './node_modules/pegjs/bin/pegjs'); - - if (catalogSubFiles.includes('dist')) { - exec('rm -rf ' + catalogPath + '/dist/*.js'); - } else { - exec('mkdir ' + catalogPath + '/dist'); - } - - ;(async function transJs () { - if (readDirSubFiles.length) { - for (let item of readDirSubFiles) { - let name = path.basename(item, '.peg'); - if (name){ - await exec(nodePath + ' ' + parserPath + ' -o ' + - catalogPath + '/dist/' + name + '.js ' + readDirPath + '/' + item); - } - } - } - })() -} - -generateSyntaxParser(process.argv[2], process.argv[0]); diff --git a/compiler/package-lock.json b/compiler/package-lock.json index 37da748..b5ff443 100644 --- a/compiler/package-lock.json +++ b/compiler/package-lock.json @@ -3592,12 +3592,6 @@ "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true }, - "pegjs": { - "version": "0.10.0", - "resolved": "https://repo.huaweicloud.com/repository/npm/pegjs/-/pegjs-0.10.0.tgz", - "integrity": "sha512-qI5+oFNEGi3L5HAxDwN2LA4Gg7irF70Zs25edhjld9QemOgp0CbvMtbFcMvFtEo1OityPrcCzkQFB8JP/hxgow==", - "dev": true - }, "picocolors": { "version": "1.0.0", "resolved": "https://repo.huaweicloud.com/repository/npm/picocolors/-/picocolors-1.0.0.tgz", diff --git a/compiler/package.json b/compiler/package.json index 8f99725..693d428 100644 --- a/compiler/package.json +++ b/compiler/package.json @@ -10,12 +10,11 @@ ], "scripts": { "lint": "eslint --fix ./src --ext .ts", - "build": "npm run generateSyntaxParser && npm run generateDeclarations && ./node_modules/.bin/babel ./src --out-dir lib --extensions .ts && node uglify-source.js lib", + "build": "npm run generateDeclarations && ./node_modules/.bin/babel ./src --out-dir lib --extensions .ts && node uglify-source.js lib", "create": "node ./lib/create.js --env projectName", "compile": "webpack --config webpack.config.js --env buildMode=debug projectName", "test": "npm run build && mocha -r mocha-context/register test/test.js && mocha -r mocha-context/register test/test.js --partialUpdate", "generateDeclarations": "node ./build_declarations_file.js ../../../interface/sdk-js/api/@internal/component/ets ./declarations ./lib", - "generateSyntaxParser": "node build_parser.js ./syntax_parser/dist", "postinstall": "node npm-install.js" }, "devDependencies": { @@ -32,7 +31,6 @@ "file-loader": "^6.2.0", "mocha": "^8.2.1", "mocha-context": "^0.1.5", - "pegjs": "^0.10.0", "ts-node": "^9.1.1", "uglify-js": "^3.13.0", "url-loader": "^4.1.1" diff --git a/compiler/syntax_parser/src/exclude_comment.peg b/compiler/syntax_parser/src/exclude_comment.peg deleted file mode 100644 index d3ac07f..0000000 --- a/compiler/syntax_parser/src/exclude_comment.peg +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021 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 syntax_parser = require('./syntax_parser.js'); -} - -start = blocks: block* -{ - return syntax_parser.parse(blocks.join('')); -} - -block = comments/notComment - -comments = comment:$("/*" (!"*/" .)* "*/") { - let num = comment.split("\n").length-1; - let result = ''; - while (num>0) { - result += '\n'; - num -= 1; - } - return result; -} - -notComment = $((!comments .)+) diff --git a/compiler/syntax_parser/src/parse_extend.peg b/compiler/syntax_parser/src/parse_extend.peg deleted file mode 100644 index fc1459b..0000000 --- a/compiler/syntax_parser/src/parse_extend.peg +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ - -start = extendAttributes:whiteSpace extendAttribute+ -{ - return {location: location()}; -} - -extendAttribute = (whiteSpace '.' whiteSpace attribute item)/(comment) -attribute = attr_head attr_tail -attr_head = $ [a-zA-Z_$]+ -attr_tail = $ [a-zA-Z0-9_$]* -item = whiteSpace '(' [^()]* item* [^()]* ')' whiteSpace -comment = "//" (![\r\n] .)* whiteSpace -whiteSpace = [ \t\r\n]* diff --git a/compiler/syntax_parser/src/syntax_parser.peg b/compiler/syntax_parser/src/syntax_parser.peg deleted file mode 100644 index 309860e..0000000 --- a/compiler/syntax_parser/src/syntax_parser.peg +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2021 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 parse_extend = require('./parse_extend.js'); - - const error_otherParsers = []; - let singleError = function(errMessage, line, column) { - this.errMessage = errMessage; - this.errPosition = { - line: line, - column: column - }; - }; - const collect_extend = { - component: [], - functionName: [], - parameters: [] - }; -} - -start = blocks: block+ -{ - let newContent = ""; - for (let item in blocks) { - if (Array.isArray(blocks[item])) { - newContent += blocks[item].join(''); - } else { - newContent += blocks[item]; - } - } - return { - content: newContent, - location: location(), - collect_extend: collect_extend, - error_otherParsers: error_otherParsers - }; -} - -block = extend/(prefix extend?) -prefix = $((!prefix_extend .)+) -extend = - whiteSpace1:whiteSpace prefix_extend:prefix_extend funcBody_extend:funcBody_extend - whiteSpace2: whiteSpace right:'}' whiteSpace3:whiteSpace -{ - return whiteSpace1 + prefix_extend + funcBody_extend + whiteSpace2 + right + whiteSpace3; -} - -prefix_extend = prefix_extend_one/prefix_extend_another - -//match a kind of extend component -prefix_extend_one = - '@Extend' whiteSpace1:whiteSpace '(' component:component ')' whiteSpace2:whiteSpace 'function' - whiteSpace3:whiteSpace function_name:function_name whiteSpace4:whiteSpace '(' parameters:parameters - ')' whiteSpace5:whiteSpace left:'{' -{ - collect_extend.component.push(component); - collect_extend.functionName.push(function_name); - collect_extend.parameters.push(parameters); - return '@Extend' + whiteSpace1 + whiteSpace2 + 'function' + whiteSpace3 + '__' + component + - '__' + function_name + whiteSpace4 + '(' + parameters + ')' + whiteSpace5 + left + component; -} - -//match another kind of extend component -prefix_extend_another = - '@Extend' whiteSpace1:whiteSpace component:component '.' function_name:function_name - whiteSpace2:whiteSpace '(' parameters:parameters ')' whiteSpace3:whiteSpace left:'{' -{ - collect_extend.component.push(component); - collect_extend.functionName.push(function_name); - collect_extend.parameters.push(parameters); - return '@Extend' + ' function' + whiteSpace1 + '__' + component + '__' + function_name + - whiteSpace2 + '(' + parameters + ')' + whiteSpace3 + left + component; -} - -component = $ [a-zA-Z_]+ -function_name = $ (function_name_head function_name_tail) -function_name_head = $ [a-zA-Z_$]+ -function_name_tail = $ [a-zA-Z0-9_$]* -parameters = $ ([^()]* item* [^()]*) - -//extract Extend internal attribute SyntaxError -funcBody_extend = body:$([^{}]* item* [^{}]*) -{ - try { - parse_extend.parse(body); - return body; - } catch (err) { - let countLines = location().end.line - location().start.line; - if (err.location.start.line === 1) { - err.location.start.column += location().start.column; - } - let supportMessage = " Our rule is .attribute(value) , for example: .width(50) . And you'd better have at least one attribute in Extend Component"; - error_otherParsers.push( - new singleError( - parse_extend.SyntaxError.buildMessage(err.expected, err.found) + supportMessage, - err.location.start.line + location().start.line - 1, - err.location.start.column - ) - ); - let placeHolders = ''; - while (countLines>0) { - placeHolders += '\r\n'; - countLines -= 1; - } - return '()' + placeHolders; - } -} - -item = $ (whiteSpace '{' [^{}]* item* [^{}]* '}' whiteSpace) -whiteSpace = $ [ \t\r\n]* -- Gitee From 42e2e3fd05e42314dee09aa7c2a987c189a2e55e Mon Sep 17 00:00:00 2001 From: zhuoli Date: Sun, 25 Sep 2022 22:01:42 +0800 Subject: [PATCH 041/379] Use api8 ark compiler when set compatible for api8 on api9 SDK Signed-off-by: zhuoli Change-Id: If971ec0ee32278df6e0a03f276804f53092fea70 --- compiler/main.js | 3 ++- compiler/npm-install.js | 9 +++++++++ compiler/src/gen_abc_plugin.ts | 19 ++++++++++++++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index d47e50d..979aa58 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -93,6 +93,7 @@ function loadEntryObj(projectConfig) { manifest = JSON.parse(jsonString); if (manifest && manifest.minPlatformVersion) { partialUpdateController(manifest.minPlatformVersion); + process.env.minPlatformVersion = manifest.minPlatformVersion; } projectConfig.pagesJsonFileName = 'config.json'; } else if (projectConfig.aceModuleJsonPath && fs.existsSync(projectConfig.aceModuleJsonPath)) { @@ -473,4 +474,4 @@ exports.loadModuleInfo = loadModuleInfo; exports.systemModules = systemModules; exports.checkAppResourcePath = checkAppResourcePath; exports.addSDKBuildDependencies = addSDKBuildDependencies; -exports.partialUpdateConfig = partialUpdateConfig; \ No newline at end of file +exports.partialUpdateConfig = partialUpdateConfig; diff --git a/compiler/npm-install.js b/compiler/npm-install.js index 32ae7ec..799f7ac 100644 --- a/compiler/npm-install.js +++ b/compiler/npm-install.js @@ -49,3 +49,12 @@ exec('npm install', { cwd: cwd }, function(err, stdout, stderr) { console.error('[31m', `npm install filed: ${err}`, '[39m'); } }); + +cwd = path.join(cwd, "legacy_api8"); + +exec('npm install', { cwd: cwd }, function(err, stdout, stderr) { + console.log('[31m', stdout, '[39m'); + if (err !== null) { + console.error('[31m', `npm install filed: ${err}`, '[39m'); + } +}); \ No newline at end of file diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 9e3b092..20f9033 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -546,7 +546,24 @@ function invokeWorkersModuleToGenAbc(moduleInfos: Array): void { export function initAbcEnv() : string[] { let args: string[] = []; - if (process.env.panda === TS2ABC) { + if (process.env.minPlatformVersion === "8") { + process.env.panda = TS2ABC; + let js2abc: string = path.join(arkDir, 'build', 'legacy_api8', 'src', 'index.js'); + if (isWin) { + js2abc = path.join(arkDir, 'build-win', 'legacy_api8', 'src', 'index.js'); + } else if (isMac) { + js2abc = path.join(arkDir, 'build-mac', 'legacy_api8', 'src', 'index.js'); + } + + js2abc = '"' + js2abc + '"'; + args = [ + '--expose-gc', + js2abc + ]; + if (isDebug) { + args.push('--debug'); + } + } else if (process.env.panda === TS2ABC) { let js2abc: string = path.join(arkDir, 'build', 'src', 'index.js'); if (isWin) { js2abc = path.join(arkDir, 'build-win', 'src', 'index.js'); -- Gitee From b78e142466ce87ed508b3eb683f5b5d220735ee4 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 27 Sep 2022 16:19:20 +0800 Subject: [PATCH 042/379] fixed 6e272f3 from https://gitee.com/houhaoyu/developtools_ace-ets2bundle/pulls/1204 fixed e2bbfbf from https://gitee.com/houhaoyu/developtools_ace-ets2bundle/pulls/1203 houhaoyu@huawei.com fix source code error Signed-off-by: houhaoyu Change-Id: Ic5c37e52f18ac707000f69c1c9dfd3c15b3dbace --- compiler/src/process_component_member.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 95baa23..ee4f1e9 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -760,6 +760,7 @@ function isForbiddenUseStateType(typeNode: ts.TypeNode): boolean { } export function isSimpleType(typeNode: ts.TypeNode, program: ts.Program, log?: LogInfo[]): boolean { + typeNode = typeNode || ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword); let checker: ts.TypeChecker; if (globalProgram.program) { checker = globalProgram.program.getTypeChecker(); @@ -796,6 +797,7 @@ function getEnumType(typeNode: ts.TypeNode, checker: ts.TypeChecker): ts.SyntaxK if (!checker) { return; } + typeNode = typeNode || ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword); if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName)) { const type: ts.Type = checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(typeNode.typeName)); -- Gitee From 31f34791bd824d2780795ba524b19bb7147e7fe3 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 26 Sep 2022 18:01:41 +0800 Subject: [PATCH 043/379] fixed 2c89cc7 from https://gitee.com/houhaoyu/developtools_ace-ets2bundle/pulls/1195 houhaoyu@huawei.com fix storage initialization Signed-off-by: houhaoyu Change-Id: Ie3b4b1bd7bd0f672f6df9ae34cdc45994512d525 --- compiler/package-lock.json | 2 +- compiler/tsconfig.esm.json | 18 ++++++++++++++++++ compiler/tsconfig.json | 18 ++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/compiler/package-lock.json b/compiler/package-lock.json index b5ff443..f4c62b7 100644 --- a/compiler/package-lock.json +++ b/compiler/package-lock.json @@ -4156,7 +4156,7 @@ }, "typescript": { "version": "file:deps/ohos-typescript-4.2.3-r2.tgz", - "integrity": "sha512-jBZS5mCU3BP1lfQpS2thP5uIRNObHEmH2cqJgEzpmh0H5Hgn4XZVMCCzyfUPbze6Gm+qEwAXWOL4ljcwbjZDEA==" + "integrity": "sha512-SC1JQo/4ePCET0IswzbLoHIdaVc/fWHaoRbKu68ikdaZ0PZLDpqaawrfs4JivrT+yu4ch/0ksjIhiBKwplzFsg==" }, "uglify-js": { "version": "3.16.1", diff --git a/compiler/tsconfig.esm.json b/compiler/tsconfig.esm.json index 0e29e51..388ce0c 100644 --- a/compiler/tsconfig.esm.json +++ b/compiler/tsconfig.esm.json @@ -2,6 +2,24 @@ "compileOnSave": false, "compilerOptions": { "ets": { + "propertyDecorators": [ + { + "name": "Link", + "needInitialization": false + }, + { + "name": "Prop", + "needInitialization": false + }, + { + "name": "ObjectLink", + "needInitialization": false + }, + { + "name": "Consume", + "needInitialization": false + } + ], "render": { "method": ["build", "pageTransition"], "decorator": "Builder" diff --git a/compiler/tsconfig.json b/compiler/tsconfig.json index 65cd87b..195152a 100644 --- a/compiler/tsconfig.json +++ b/compiler/tsconfig.json @@ -2,6 +2,24 @@ "compileOnSave": false, "compilerOptions": { "ets": { + "propertyDecorators": [ + { + "name": "Link", + "needInitialization": false + }, + { + "name": "Prop", + "needInitialization": false + }, + { + "name": "ObjectLink", + "needInitialization": false + }, + { + "name": "Consume", + "needInitialization": false + } + ], "render": { "method": ["build", "pageTransition"], "decorator": "Builder" -- Gitee From ba667bc18fbef01d767059f3ca339a932f3ad78e Mon Sep 17 00:00:00 2001 From: limeng Date: Tue, 27 Sep 2022 17:11:39 +0800 Subject: [PATCH 044/379] initial commit for WaterFlow component Signed-off-by: limeng --- compiler/build_declarations_file.js | 2 +- compiler/components/flow_item.json | 8 ++++++++ compiler/components/water_flow.json | 16 ++++++++++++++++ compiler/tsconfig.esm.json | 16 ++++++++++++++-- compiler/tsconfig.json | 16 ++++++++++++++-- 5 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 compiler/components/flow_item.json create mode 100644 compiler/components/water_flow.json diff --git a/compiler/build_declarations_file.js b/compiler/build_declarations_file.js index 8fd2559..7b4f4c1 100644 --- a/compiler/build_declarations_file.js +++ b/compiler/build_declarations_file.js @@ -28,7 +28,7 @@ const addTSAttributeSet = ['AlphabetIndexer', 'Animator', 'Badge', 'Blank', 'But 'QRCode', 'Radio', 'Rating', 'Rect', 'Refresh', 'Row', 'RowSplit', 'Scroll', 'ScrollBar', 'Search', 'Select', 'Shape', 'Sheet', 'Slider', 'Span', 'Stack', 'Stepper', 'StepperItem', 'Swiper', 'TabContent', 'Tabs', 'Text', 'TextArea', 'TextClock', 'TextInput', 'TextPicker', 'TextTimer', - 'Toggle', 'Video', 'Web', 'XComponent', 'RichText', 'RemoteWindow']; + 'Toggle', 'Video', 'Web', 'XComponent', 'RichText', 'RemoteWindow', 'WaterFlow', 'FlowItem']; generateTargetFile(process.argv[2], process.argv[3]); function generateTargetFile(filePath, output) { diff --git a/compiler/components/flow_item.json b/compiler/components/flow_item.json new file mode 100644 index 0000000..5ea4437 --- /dev/null +++ b/compiler/components/flow_item.json @@ -0,0 +1,8 @@ +{ + "name": "FlowItem", + "parents": [ + "WaterFlow" + ], + "single": true, + "attrs": [] +} \ No newline at end of file diff --git a/compiler/components/water_flow.json b/compiler/components/water_flow.json new file mode 100644 index 0000000..5c41e69 --- /dev/null +++ b/compiler/components/water_flow.json @@ -0,0 +1,16 @@ +{ + "name": "WaterFlow", + "children": [ + "FlowItem" + ], + "attrs": [ + "onReachEnd", + "onReachStart", + "itemConstraintSize", + "rowsTemplate", + "columnsTemplate", + "columnsGap", + "rowsGap", + "layoutDirection" + ] +} \ No newline at end of file diff --git a/compiler/tsconfig.esm.json b/compiler/tsconfig.esm.json index 0e29e51..fab0298 100644 --- a/compiler/tsconfig.esm.json +++ b/compiler/tsconfig.esm.json @@ -96,7 +96,9 @@ "Web", "XComponent", "GridRow", - "GridCol" + "GridCol", + "WaterFlow", + "FlowItem" ], "extend": { "decorator": "Extend", @@ -550,6 +552,16 @@ "name": "GridCol", "type": "GridColAttribute", "instance": "GridColInterface" + }, + { + "name": "WaterFlow", + "type": "WaterFlowAttribute", + "instance": "WaterFlowInterface" + }, + { + "name": "FlowItem", + "type": "FlowItemAttribute", + "instance": "FlowItemInterface" } ] }, @@ -588,4 +600,4 @@ "exclude": [ "node_modules" ] -} \ No newline at end of file +} diff --git a/compiler/tsconfig.json b/compiler/tsconfig.json index 65cd87b..5b977a3 100644 --- a/compiler/tsconfig.json +++ b/compiler/tsconfig.json @@ -96,7 +96,9 @@ "Web", "XComponent", "GridRow", - "GridCol" + "GridCol", + "WaterFlow", + "FlowItem" ], "extend": { "decorator": "Extend", @@ -550,6 +552,16 @@ "name": "GridCol", "type": "GridColAttribute", "instance": "GridColInterface" + }, + { + "name": "WaterFlow", + "type": "WaterFlowAttribute", + "instance": "WaterFlowInterface" + }, + { + "name": "FlowItem", + "type": "FlowItemAttribute", + "instance": "FlowItemInterface" } ] }, @@ -588,4 +600,4 @@ "exclude": [ "node_modules" ] -} \ No newline at end of file +} -- Gitee From a6166cd413a78a34a467b6cecfde9d6743c2dac9 Mon Sep 17 00:00:00 2001 From: huangjie Date: Sat, 24 Sep 2022 10:34:44 +0800 Subject: [PATCH 045/379] =?UTF-8?q?=E3=80=90developtools=5Face-ets2bundle?= =?UTF-8?q?=E3=80=91=E7=B3=BB=E7=BB=9F=E8=B5=84=E6=BA=90=E4=BB=93=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangjie --- BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.gn b/BUILD.gn index 9296e50..c3a678d 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -132,7 +132,7 @@ action("build_ets_sysResource") { } outputs = [ ets_sysResource ] - _id_defined_json = "//utils/system_resources/systemres/main/resources/base/element/id_defined.json" + _id_defined_json = "//base/global/system_resources/systemres/main/resources/base/element/id_defined.json" inputs = [ _id_defined_json ] args = [ -- Gitee From 5b0df2a9a5360c49c80598d0d30b04781c5a1797 Mon Sep 17 00:00:00 2001 From: hufeng Date: Mon, 5 Sep 2022 20:16:29 +0800 Subject: [PATCH 046/379] Minimize the sourcecode when compling release modules Signed-off-by: hufeng Change-Id: Icb9df9bd07988c032d2e905d0998d314268db8d9 --- compiler/src/gen_abc_plugin.ts | 22 +++++++++++++--- compiler/src/pre_define.ts | 1 + compiler/src/utils.ts | 47 ++++++++++++++++++++++++++++++---- compiler/webpack.config.js | 26 ++++++++++++++++--- 4 files changed, 84 insertions(+), 12 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 4c1ba90..c75a800 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -51,6 +51,7 @@ import { FAIL, MODULELIST_JSON, MODULES_ABC, + PREBUILDMODE_JSON, SUCCESS, SOURCEMAPS_JSON, SOURCEMAPS, @@ -155,6 +156,19 @@ export class GenAbcPlugin { } if (projectConfig.compileMode === ESMODULE) { + if (projectConfig.cachePath && !projectConfig.xtsMode) { + let cachedJson: any = {}; + const CACHED_BUILDMODE: string = path.join(projectConfig.cachePath, PREBUILDMODE_JSON); + cachedJson["buildMode"] = projectConfig.buildArkMode; + fs.writeFile(CACHED_BUILDMODE, JSON.stringify(cachedJson, null, 2), 'utf-8', + (err) => { + if (err) { + logger.error(red, `ETS:ERROR Failed to write buildMode.`, reset); + } + }); + } + + // clear output dir removeDir(output); removeDir(projectConfig.nodeModulesPath); } @@ -363,14 +377,14 @@ function updateCachedModuleList(moduleList: Array): void { let cachedJson: Object = {}; cachedJson["list"] = moduleList; fs.writeFile(CACHED_MODULELIST_FILE, JSON.stringify(cachedJson, null, 2), 'utf-8', - (err)=>{ + (err) => { if (err) { logger.error(red, `ETS:ERROR Failed to write module list.`, reset); } } ); fs.writeFile(CACHED_SOURCEMAPS, JSON.stringify(cachedSourceMaps, null, 2), 'utf-8', - (err)=>{ + (err) => { if (err) { logger.error(red, `ETS:ERROR Failed to write cache sourceMaps json.`, reset); } @@ -381,7 +395,7 @@ function updateCachedModuleList(moduleList: Array): void { function writeSourceMaps(): void { mkdirsSync(projectConfig.buildPath); fs.writeFile(path.join(projectConfig.buildPath, SOURCEMAPS), JSON.stringify(cachedSourceMaps, null, 2), 'utf-8', - (err)=>{ + (err) => { if (err) { logger.error(red, `ETS:ERROR Failed to write sourceMaps.`, reset); } @@ -1064,7 +1078,7 @@ function handleHotReloadChangedFiles() { // write source maps fs.writeFile(path.join(projectConfig.patchAbcPath, SOURCEMAPS), JSON.stringify(hotReloadSourceMap, null, 2), 'utf-8', - (err)=>{ + (err) => { if (err) { logger.error(red, `ETS:ERROR Failed to write sourceMaps.`, reset); } diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index faff8b8..95ca3a0 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -248,6 +248,7 @@ export const NPMENTRIES_TXT: string = 'npmEntries.txt'; export const MODULES_CACHE: string = 'modules.cache'; export const MODULES_ABC: string = 'modules.abc'; export const MODULELIST_JSON: string = 'moduleList.json'; +export const PREBUILDMODE_JSON: string = 'preBuildMode.json'; export const SOURCEMAPS_JSON: string = 'sourceMaps.json'; export const SOURCEMAPS: string = 'sourceMaps.map'; diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index e45ed73..437a645 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -19,6 +19,7 @@ import fs from 'fs'; import { projectConfig } from '../main'; import { createHash } from 'crypto'; import { processSystemApi } from './validate_ui_syntax'; +import { logger } from './compile_info'; import { NODE_MODULES, TEMPORARY, @@ -34,8 +35,10 @@ import { EXTNAME_ETS, EXTNAME_TS_MAP, EXTNAME_JS_MAP, - ESMODULE + ESMODULE, + FAIL } from './pre_define'; +import { minify, MinifyOutput } from 'terser'; export enum LogType { ERROR = 'ERROR', @@ -47,6 +50,9 @@ export const BUILD: string = 'build'; export const SRC_MAIN: string = 'src/main'; const TS_NOCHECK: string = '// @ts-nocheck'; +const red: string = '\u001b[31m'; +const reset: string = '\u001b[39m'; + export interface LogInfo { type: LogType, message: string, @@ -364,14 +370,40 @@ export function mkdirsSync(dirname: string): boolean { return false; } +async function writeMinimizedSourceCode(content: string, filePath: string): Promise { + let result: MinifyOutput; + try { + result = await minify(content, { + compress: { + join_vars: false, + sequences: 0 + }, + format: { + semicolons: false, + beautify: true, + indent_level: 2 + } + }); + } catch { + logger.error(red, `ETS:ERROR Failed to source code obfuscation.`, reset); + process.exit(FAIL); + } + fs.writeFileSync(filePath, result.code); +} + export function writeFileSyncByString(sourcePath: string, sourceCode: string): void { const jsFilePath: string = genTemporaryPath(sourcePath, projectConfig.projectPath, process.env.cachePath); if (jsFilePath.length === 0) { return; } + mkdirsSync(path.dirname(jsFilePath)); - fs.writeFileSync(jsFilePath, sourceCode); - return; + if (projectConfig.buildArkMode === 'debug') { + fs.writeFileSync(jsFilePath, sourceCode); + return; + } + + writeMinimizedSourceCode(sourceCode, jsFilePath); } export const packageCollection: Map> = new Map(); @@ -420,7 +452,6 @@ export function generateSourceFilesToTemporary(node: ts.SourceFile): void { jsFilePath = jsFilePath.replace(/\.ts$/, EXTNAME_JS); } let sourceMapFile: string = genSourceMapFileName(jsFilePath); - mkdirsSync(path.dirname(jsFilePath)); if (sourceMapFile.length > 0 && projectConfig.buildArkMode === 'debug') { newSourceMaps[node.fileName.replace(toUnixPath(projectConfig.projectRootPath) + '/', '')] = mixedInfo.sourceMapJson; } @@ -430,7 +461,13 @@ export function generateSourceFilesToTemporary(node: ts.SourceFile): void { return replaceRelativeDependency(item, moduleRequest, node.fileName); }); - fs.writeFileSync(jsFilePath, mixedInfo.content); + mkdirsSync(path.dirname(jsFilePath)); + if (projectConfig.buildArkMode === 'debug') { + fs.writeFileSync(jsFilePath, mixedInfo.content); + return; + } + + writeMinimizedSourceCode(mixedInfo.content, jsFilePath); } export function writeFileSyncByNode(node: ts.SourceFile, toTsFile: boolean): void { diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 8ffdee9..c894317 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -34,8 +34,8 @@ const { } = require('./main'); const { ResultStates } = require('./lib/compile_info'); const { processUISyntax } = require('./lib/process_ui_syntax'); -const { IGNORE_ERROR_CODE } = require('./lib/utils'); -const { BUILD_SHARE_PATH } = require('./lib/pre_define'); +const { IGNORE_ERROR_CODE, removeDir } = require('./lib/utils'); +const { BUILD_SHARE_PATH, PREBUILDMODE_JSON } = require('./lib/pre_define'); const { processJs } = require('./lib/process_js_ast'); process.env.watchMode = (process.env.watchMode && process.env.watchMode === 'true') || 'false'; @@ -381,12 +381,32 @@ function setCleanWebpackPlugin(workerFile, config) { ); } +function clearWebpackCacheByBuildMode() { + if (projectConfig.compileMode === 'jsbundle') { + return; + } + + if (!projectConfig.cachePath || projectConfig.xtsMode) { + return; + } + + // clear&update cache dir when buildMode is different from last time + const CACHED_BUILDMODE = path.join(projectConfig.cachePath, PREBUILDMODE_JSON); + if (fs.existsSync(CACHED_BUILDMODE)) { + let cachedBuildMode = JSON.parse(fs.readFileSync(CACHED_BUILDMODE).toString()).buildMode; + if (cachedBuildMode !== projectConfig.buildArkMode) { + removeDir(path.resolve(projectConfig.cachePath, '.ets_cache')); + } + } +} + module.exports = (env, argv) => { const config = {}; setProjectConfig(env); loadEntryObj(projectConfig); loadModuleInfo(projectConfig, env); setTsConfigFile(); + clearWebpackCacheByBuildMode(); initConfig(config); const workerFile = readWorkerFile(env.isPreview); setOptimizationConfig(config, workerFile); @@ -416,7 +436,7 @@ module.exports = (env, argv) => { config.devtool = false; } - if (env.buildMode === 'release') { + if (env.buildMode === 'release' && projectConfig.compileMode === 'jsbundle') { setReleaseConfig(config); } -- Gitee From 87658a070b539406ac2050297c333b758717c833 Mon Sep 17 00:00:00 2001 From: hufeng Date: Thu, 29 Sep 2022 13:30:28 +0800 Subject: [PATCH 047/379] Change the condiftion of esmodule Signed-off-by: hufeng Change-Id: Id638ed49c1c01336e6b8ba76b135d1c51ad86a54 --- compiler/webpack.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index c894317..b395d25 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -382,7 +382,7 @@ function setCleanWebpackPlugin(workerFile, config) { } function clearWebpackCacheByBuildMode() { - if (projectConfig.compileMode === 'jsbundle') { + if (projectConfig.compileMode !== 'esmodule') { return; } @@ -436,7 +436,7 @@ module.exports = (env, argv) => { config.devtool = false; } - if (env.buildMode === 'release' && projectConfig.compileMode === 'jsbundle') { + if (env.buildMode === 'release' && projectConfig.compileMode !== 'esmodule') { setReleaseConfig(config); } -- Gitee From 25b392dc03dd4f0ae731a6bb00ed052f9133aeef Mon Sep 17 00:00:00 2001 From: wuliubao Date: Fri, 30 Sep 2022 15:36:01 +0800 Subject: [PATCH 048/379] =?UTF-8?q?IssueNo:#I5TYYV=20Description:web?= =?UTF-8?q?=E7=A7=BB=E9=99=A4fileFromUrlAccess=E6=8E=A5=E5=8F=A3=20Sig:=20?= =?UTF-8?q?SIG=5FApplicationFramework=20Feature=20or=20Bugfix:=20Feature?= =?UTF-8?q?=20Binary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wuliubao --- compiler/components/web.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/components/web.json b/compiler/components/web.json index ae26341..05087de 100644 --- a/compiler/components/web.json +++ b/compiler/components/web.json @@ -8,7 +8,7 @@ "onRequestSelected", "javaScriptAccess", "fileAccess", "onAlert", "onBeforeUnload", "onlineImageAccess", "domStorageAccess", "imageAccess", "mixedMode", "zoomAccess", "geolocationAccess", "javaScriptProxy", "onFullScreenExit", "onFullScreenEnter", - "userAgent", "onConfirm", "onConsole", "onErrorReceive", "onHttpErrorReceive", "onDownloadStart", "fileFromUrlAccess", + "userAgent", "onConfirm", "onConsole", "onErrorReceive", "onHttpErrorReceive", "onDownloadStart", "webDebuggingAccess", "onShowFileSelector", "initialScale", "onResourceLoad", "onScaleChange", "onHttpAuthRequest", "onPermissionRequest", "onContextMenuShow", "textZoomRatio", "onScroll", "mediaPlayGestureAccess", "onSslErrorEventReceive", "onClientAuthenticationRequest" -- Gitee From 815436f1f455005559f74cbdb4af1f164950bf24 Mon Sep 17 00:00:00 2001 From: lihong Date: Sat, 8 Oct 2022 11:48:23 +0800 Subject: [PATCH 049/379] lihong67@huawei.com fix @Prop value validate, add index in ForEach and import module in ForEach. Signed-off-by: lihong Change-Id: I95e29d449113a18b39778a26d76d75f956eae9f1 --- compiler/src/process_component_build.ts | 33 ++++++++++--------- compiler/src/process_custom_component.ts | 2 +- .../@objectLink/@objectLink.ts | 2 +- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index f306837..01f41f6 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -960,8 +960,7 @@ function createItemGenFunctionStatement( undefined, undefined, ts.factory.createArrowFunction( undefined, undefined, - [ts.factory.createParameterDeclaration( - undefined, undefined, undefined, ts.factory.createIdentifier(_ITEM))], + getParameters(argumentsArray[1]), undefined, ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), ts.factory.createBlock( [ts.factory.createVariableStatement( @@ -990,6 +989,17 @@ function createItemGenFunctionStatement( } } +function getParameters(node: ts.ArrowFunction): ts.ParameterDeclaration[] { + const parameterArr: ts.ParameterDeclaration[] = [ + ts.factory.createParameterDeclaration( + undefined, undefined, undefined, ts.factory.createIdentifier(_ITEM)) + ]; + if (node.parameters && node.parameters.length > 1) { + parameterArr.push(node.parameters[1]); + } + return parameterArr; +} + function createItemIdFuncStatement( node: ts.CallExpression, argumentsArray: ts.Expression[] @@ -1001,16 +1011,7 @@ function createItemIdFuncStatement( [ts.factory.createVariableDeclaration( ts.factory.createIdentifier(node.expression.getText() === COMPONENT_FOREACH ? FOREACHITEMIDFUNC : __LAZYFOREACHITEMIDFUNC), undefined, undefined, - ts.factory.createArrowFunction( - undefined, undefined, - [ts.factory.createParameterDeclaration(undefined, undefined, undefined, - ts.factory.createIdentifier( - argumentsArray[2].parameters[0] ? argumentsArray[2].parameters[0].name.escapedText : '' - ) - )], undefined, - ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), - ts.factory.createIdentifier(argumentsArray[2].body ? argumentsArray[2].body.getText() : '') - ) + argumentsArray[2] )], ts.NodeFlags.Const ) @@ -1031,13 +1032,13 @@ function createUpdateFunctionStatement(argumentsArray: ts.Expression[]): ts.Expr ); } -function addForEachIdFuncParameter(argumentsArray: ts.Expression[]): ts.Identifier[] { - const addForEachIdFuncParameterArr: ts.Identifier[] = []; +function addForEachIdFuncParameter(argumentsArray: ts.Expression[]): ts.Expression[] { + const addForEachIdFuncParameterArr: ts.Expression[] = []; addForEachIdFuncParameterArr.push( ts.factory.createIdentifier(ELMTID), - ts.factory.createIdentifier(argumentsArray[0] && argumentsArray[0].getText()) + argumentsArray[0], + ts.factory.createIdentifier(FOREACHITEMGENFUNCTION) ); - addForEachIdFuncParameterArr.push(ts.factory.createIdentifier(FOREACHITEMGENFUNCTION)); if (argumentsArray[2]) { addForEachIdFuncParameterArr.push(ts.factory.createIdentifier(FOREACHITEMIDFUNC)); } diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 36545a3..4f18d7b 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -74,7 +74,7 @@ import { bindComponentAttr } from './process_component_build'; import { partialUpdateConfig } from '../main'; const localArray: string[] = [...observedPropertyDecorators, COMPONENT_NON_DECORATOR, - COMPONENT_PROP_DECORATOR, COMPONENT_OBJECT_LINK_DECORATOR]; + COMPONENT_OBJECT_LINK_DECORATOR]; const decoractorMap: Map>> = new Map( [[COMPONENT_STATE_DECORATOR, stateCollection], diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts index e597bab..35775e6 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts @@ -166,7 +166,7 @@ class Parent extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); } }; - const forEachItemIdFunc = item => item.text; + const forEachItemIdFunc = (item) => item.text; this.forEachUpdateFunction(elmtId, this.models, forEachItemGenFunction, forEachItemIdFunc); if (!isInitialRender) { ForEach.pop(); -- Gitee From caaf2162a1c6e6df20a7734206411b6bec8bc016 Mon Sep 17 00:00:00 2001 From: laibo102 Date: Sat, 8 Oct 2022 17:29:10 +0800 Subject: [PATCH 050/379] Update: Updated If Component transform Signed-off-by: laibo102 Change-Id: If681cfeb1f070ae8036a3edd1357cf5d92847a43 --- compiler/src/process_component_build.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 01f41f6..212d1ec 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1196,6 +1196,22 @@ function processElseStatement(elseStatement: ts.Statement, id: number, elseStatement = ts.factory.createBlock([elseStatement], true); elseStatement = processIfBlock(elseStatement as ts.Block, id + 1, log, isInnerBuilder); } + } else if (partialUpdateConfig.partialUpdateMode && id === 0) { + elseStatement = ts.factory.createBlock( + [ + ts.factory.createExpressionStatement( + ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + ts.factory.createIdentifier(COMPONENT_IF), + ts.factory.createIdentifier(COMPONENT_IF_BRANCH_ID_FUNCTION) + ), + undefined, + [ts.factory.createNumericLiteral(++id)] + ) + ), + ], + true + ); } return elseStatement; } -- Gitee From 1891b108736c66bdcbcecc055b00244eaa3919a7 Mon Sep 17 00:00:00 2001 From: laibo102 Date: Sat, 8 Oct 2022 17:45:16 +0800 Subject: [PATCH 051/379] Update: updated IF component UT Signed-off-by: laibo102 Change-Id: I802da2acbbc7e8b533ab894d10d1bd571b91c863 --- .../render_component/if/if.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts index 8d6d2e0..a9e777b 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts @@ -32,6 +32,9 @@ struct IFView { } else { Text('toggle no thing') } + if (this.toggle1) { + Text('toggle1 Single') + } } } } @@ -157,6 +160,31 @@ class IFView extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); If.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + If.create(); + if (this.toggle1) { + this.ifElseBranchUpdateFunction(0, () => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('toggle1 Single'); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + }); + } + else { + If.branchId(1); + } + if (!isInitialRender) { + If.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + If.pop(); Column.pop(); } rerender() { -- Gitee From 82b41fb0aba4eef8fb527cc068bfbfd9db5ad271 Mon Sep 17 00:00:00 2001 From: lizhouze Date: Sat, 8 Oct 2022 10:46:11 +0800 Subject: [PATCH 052/379] lizhouze@huawei.com Signed-off-by: lizhouze --- compiler/main.js | 40 +++++++++++++ compiler/src/pre_define.ts | 9 +++ compiler/src/pre_process.ts | 3 + compiler/src/process_component_build.ts | 11 +++- compiler/src/process_import.ts | 16 +++++- compiler/src/process_ui_syntax.ts | 76 +++++++++++++++---------- compiler/src/validate_ui_syntax.ts | 12 +++- 7 files changed, 133 insertions(+), 34 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index e6259e8..490afd0 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -49,6 +49,7 @@ const abilityPagesFullPath = []; function initProjectConfig(projectConfig) { projectConfig.entryObj = {}; + projectConfig.cardObj = {}; projectConfig.projectPath = projectConfig.projectPath || process.env.aceModuleRoot || path.join(process.cwd(), 'sample'); projectConfig.buildPath = projectConfig.buildPath || process.env.aceModuleBuild || @@ -251,6 +252,7 @@ function readAbilityEntrance(moduleJson) { } if (moduleJson.module.extensionAbilities && moduleJson.module.extensionAbilities.length > 0) { setEntrance(moduleJson.module.extensionAbilities, abilityPages); + setCardPages(moduleJson.module.extensionAbilities); } } return abilityPages; @@ -267,6 +269,44 @@ function setEntrance(abilityConfig, abilityPages) { } } +function setCardPages(extensionAbilities) { + if (extensionAbilities && extensionAbilities.length > 0) { + extensionAbilities.forEach(extensionAbility => { + if (extensionAbility.metadata) { + extensionAbility.metadata.forEach(metadata => { + if (metadata.resource) { + readCardResource(metadata.resource); + } + }) + } + }); + } +} + +function readCardResource(resource) { + const cardJsonFileName = `${resource.replace(/\$profile\:/, '')}.json`; + const modulePagePath = path.resolve(projectConfig.aceProfilePath, cardJsonFileName); + if (fs.existsSync(modulePagePath)) { + const cardConfig = JSON.parse(fs.readFileSync(modulePagePath, 'utf-8')); + if (cardConfig.forms) { + cardConfig.forms.forEach(form => { + readCardForm(form); + }) + } + } +} + +function readCardForm(form) { + if (form.type && form.type ==='eTS') { + const sourcePath = form.src.replace(/\.ets$/,''); + const cardPath = path.resolve(projectConfig.projectPath, '..', sourcePath + '.ets'); + if (cardPath && fs.existsSync(cardPath)) { + projectConfig.entryObj['../' + sourcePath] = cardPath + '?entry'; + projectConfig.cardObj[cardPath] = sourcePath.replace(/^\.\//, ''); + } + } +} + function getAbilityFullPath(projectPath, abilityPath) { let finalPath = path.resolve(path.resolve(projectPath, '../'), abilityPath); finalPath = finalPath.replace(/\\/g, '/'); diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 95ca3a0..4a477a0 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -329,3 +329,12 @@ export const OBSERVED_PROPERTY_ABSTRACT_PU:string = 'ObservedPropertyAbstractPU' export const COMPONENT_CONSTRUCTOR_LOCALSTORAGE_PU: string = '__localStorage'; export const COMPONENT_CONSTRUCTOR_LOCALSTORAGE_TYPE_PU: string = 'LocalStorage'; export const IFELSEBRANCHUPDATEFUNCTION = 'ifElseBranchUpdateFunction'; + +export const CARD_ENTRY_FUNCTION_NAME: string = 'loadEtsCard'; +export const CARD_ENABLE_DECORATORS: Set = new Set([ + '@StorageLink', '@StorageProp', '@LocalStorageLink', '@LocalStorageProp' +]); +export const CARD_ENABLE_COMPONENTS: Set = new Set([ + 'AbilityComponent', 'PluginComponent', 'FormComponent', 'RemoteWindow', + 'XComponent', 'Web', 'RichText' +]); \ No newline at end of file diff --git a/compiler/src/pre_process.ts b/compiler/src/pre_process.ts index a961471..ea9e353 100644 --- a/compiler/src/pre_process.ts +++ b/compiler/src/pre_process.ts @@ -42,8 +42,11 @@ import { genETS } from '../codegen/codegen_ets.js'; const visualMap: Map = new Map(); const slotMap: Map = new Map(); +export let pageResourcePath: string = ''; + function preProcess(source: string): string { process.env.compiler = BUILD_ON; + pageResourcePath = path.resolve(this.resourcePath); if (/\.ets$/.test(this.resourcePath)) { const result: ReplaceResult = sourceReplace(source, this.resourcePath); let newContent: string = result.content; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index f306837..a9b05e6 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -86,7 +86,8 @@ import { WILLUSEPROXY, TABCONTENT_COMPONENT, GLOBAL_THIS, - IFELSEBRANCHUPDATEFUNCTION + IFELSEBRANCHUPDATEFUNCTION, + CARD_ENABLE_COMPONENTS } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -121,6 +122,7 @@ import { partialUpdateConfig, projectConfig } from '../main'; import { transformLog, contextGlobal } from './process_ui_syntax'; import { props } from './compile_info'; import { CUSTOM_COMPONENT } from '../lib/pre_define'; +import { pageResourcePath } from './pre_process'; export function processComponentBuild(node: ts.MethodDeclaration, log: LogInfo[]): ts.MethodDeclaration { @@ -261,6 +263,13 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme if (ts.isExpressionStatement(item)) { checkEtsComponent(item, log); const name: string = getName(item); + if (pageResourcePath && projectConfig.cardObj[pageResourcePath] && CARD_ENABLE_COMPONENTS.has(name)) { + log.push({ + type: LogType.ERROR, + message: `Card page cannot use the component ${name}.`, + pos: item.getStart() + }); + } switch (getComponentType(item, log, name, parent)) { case ComponentType.innerComponent: const etsExpression: ts.EtsComponentExpression = getEtsComponentExpression(item); diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index c53aab3..7a27cac 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -45,10 +45,16 @@ import { IComponentSet, builderParamObjectCollection } from './validate_ui_syntax'; -import { hasDecorator, LogInfo, LogType, repeatLog } from './utils'; +import { + hasDecorator, + LogInfo, + LogType, + repeatLog +} from './utils'; import { projectConfig } from '../main'; import { isOhmUrl, resolveSourceFile } from './resolve_ohm_url'; import { CUSTOM_BUILDER_METHOD, INNER_COMPONENT_NAMES } from './component_map'; +import { pageResourcePath } from './pre_process'; const IMPORT_FILE_ASTCACHE: Map = new Map(); @@ -100,6 +106,14 @@ isEntryPage: boolean = true, pathCollection: Set = new Set()): void { } } + if (pageResourcePath && projectConfig.cardObj[pageResourcePath] && filePath) { + log.push({ + type: LogType.ERROR, + message: `Card page cannot use import.`, + pos: node.getStart() + }); + } + try { let fileResolvePath: string; if (isOhmUrl(filePath) && filePath.indexOf(NODE_MODULES) < 0) { diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 7c170d3..dab90b9 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -58,7 +58,8 @@ import { VIEWSTACKPROCESSOR, STARTGETACCESSRECORDINGFOR, ALLOCATENEWELMETIDFORNEXTCOMPONENT, - STOPGETACCESSRECORDING + STOPGETACCESSRECORDING, + CARD_ENTRY_FUNCTION_NAME } from './pre_define'; import { componentInfo, @@ -92,6 +93,7 @@ import { partialUpdateConfig } from '../main'; import { createCustomComponentNewExpression, createViewCreate } from './process_component_member'; +import { pageResourcePath } from './pre_process'; export const transformLog: FileLog = new FileLog(); export let contextGlobal: ts.TransformationContext; @@ -586,15 +588,18 @@ export function isExtendFunction(node: ts.FunctionDeclaration): string { } function createEntryNode(node: ts.SourceFile, context: ts.TransformationContext): ts.SourceFile { + const cardRelativePath: string = projectConfig.cardObj[pageResourcePath]; if (componentCollection.previewComponent.size === 0 || !projectConfig.isPreview) { if (componentCollection.entryComponent) { if (!partialUpdateConfig.partialUpdateMode) { const entryNode: ts.ExpressionStatement = - createEntryFunction(componentCollection.entryComponent, context) as ts.ExpressionStatement; + createEntryFunction(componentCollection.entryComponent, context, + cardRelativePath) as ts.ExpressionStatement; return context.factory.updateSourceFile(node, [...node.statements, entryNode]); } else { const entryNodes: ts.ExpressionStatement[] = - createEntryFunction(componentCollection.entryComponent, context) as ts.ExpressionStatement[]; + createEntryFunction(componentCollection.entryComponent, context, + cardRelativePath) as ts.ExpressionStatement[]; return context.factory.updateSourceFile(node, [...node.statements, ...entryNodes]); } } else { @@ -602,12 +607,12 @@ function createEntryNode(node: ts.SourceFile, context: ts.TransformationContext) } } else { const statementsArray: ts.Statement = - createPreviewComponentFunction(componentCollection.entryComponent, context); + createPreviewComponentFunction(componentCollection.entryComponent, context, cardRelativePath); return context.factory.updateSourceFile(node, [...node.statements, statementsArray]); } } -function createEntryFunction(name: string, context: ts.TransformationContext) +function createEntryFunction(name: string, context: ts.TransformationContext, cardRelativePath: string) : ts.ExpressionStatement | ts.ExpressionStatement[] { let localStorageName: string; const localStorageNum: number = localStorageLinkCollection.get(name).size + @@ -632,17 +637,20 @@ function createEntryFunction(name: string, context: ts.TransformationContext) if (localStorageName) { newArray.push(context.factory.createIdentifier(localStorageName)); } + const newExpressionParams: any[] = [ + context.factory.createNewExpression( + context.factory.createIdentifier(name),undefined, newArray)]; + addCardStringliteral(newExpressionParams, context, cardRelativePath); if (!partialUpdateConfig.partialUpdateMode) { const newExpressionStatement: ts.ExpressionStatement = context.factory.createExpressionStatement(context.factory.createCallExpression( - context.factory.createIdentifier(PAGE_ENTRY_FUNCTION_NAME), undefined, - [context.factory.createNewExpression(context.factory.createIdentifier(name), - undefined, newArray)])); + context.factory.createIdentifier(cardRelativePath ? CARD_ENTRY_FUNCTION_NAME : + PAGE_ENTRY_FUNCTION_NAME), undefined, newExpressionParams)); return newExpressionStatement; } else { return [ createStartGetAccessRecording(context), - createLoadDocument(context, name), + createLoadDocument(context, name, cardRelativePath), createStopGetAccessRecording(context) ]; } @@ -668,21 +676,19 @@ function createStartGetAccessRecording(context: ts.TransformationContext): ts.Ex ); } -function createLoadDocument(context: ts.TransformationContext, name: string): ts.ExpressionStatement { +function createLoadDocument(context: ts.TransformationContext, name: string, + cardRelativePath: string): ts.ExpressionStatement { + const newExpressionParams: any[] = [ + context.factory.createNewExpression( + context.factory.createIdentifier(name), + undefined, + [context.factory.createIdentifier('undefined'), + context.factory.createObjectLiteralExpression([], false)])]; + addCardStringliteral(newExpressionParams, context, cardRelativePath); return context.factory.createExpressionStatement( context.factory.createCallExpression( - context.factory.createIdentifier(PAGE_ENTRY_FUNCTION_NAME), - undefined, - [context.factory.createNewExpression( - context.factory.createIdentifier(name), - undefined, - [context.factory.createIdentifier('undefined'), - context.factory.createObjectLiteralExpression( - [], - false - )] - )] - ) + context.factory.createIdentifier(cardRelativePath ? CARD_ENTRY_FUNCTION_NAME : + PAGE_ENTRY_FUNCTION_NAME), undefined, newExpressionParams) ); } @@ -699,8 +705,8 @@ function createStopGetAccessRecording(context: ts.TransformationContext): ts.Exp ); } -function createPreviewComponentFunction(name: string, context: ts.TransformationContext) - : ts.Statement { +function createPreviewComponentFunction(name: string, context: ts.TransformationContext, + cardRelativePath: string): ts.Statement { const newArray: ts.Expression[] = [ context.factory.createStringLiteral((++componentInfo.id).toString()), context.factory.createIdentifier(COMPONENT_CONSTRUCTOR_UNDEFINED), @@ -716,6 +722,10 @@ function createPreviewComponentFunction(name: string, context: ts.Transformation argsArr.push(context.factory.createStringLiteral(componentName)); argsArr.push(newExpression); }); + const newExpressionParams: any[] = [ + context.factory.createNewExpression( + context.factory.createIdentifier(name), undefined, newArray)]; + addCardStringliteral(newExpressionParams, context, cardRelativePath); const ifStatement: ts.Statement = context.factory.createIfStatement( context.factory.createCallExpression( context.factory.createIdentifier(GET_PREVIEW_FLAG_FUNCTION_NAME), @@ -741,13 +751,8 @@ function createPreviewComponentFunction(name: string, context: ts.Transformation ] )), name ? context.factory.createExpressionStatement(context.factory.createCallExpression( - context.factory.createIdentifier(PAGE_ENTRY_FUNCTION_NAME), - undefined, - [context.factory.createNewExpression( - context.factory.createIdentifier(name), - undefined, - newArray - )] + context.factory.createIdentifier(cardRelativePath ? CARD_ENTRY_FUNCTION_NAME : + PAGE_ENTRY_FUNCTION_NAME),undefined,newExpressionParams )) : undefined ], true @@ -759,3 +764,12 @@ function createPreviewComponentFunction(name: string, context: ts.Transformation export function resetLog(): void { transformLog.errors = []; } + +function addCardStringliteral(newExpressionParams: any[], context: ts.TransformationContext, + cardRelativePath: string): void { + if (cardRelativePath) { + newExpressionParams.push(context.factory.createStringLiteral( + projectConfig.bundleName + '/' + projectConfig.moduleName + '/' + + cardRelativePath)); + } +} diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index b5384a1..e6b07b4 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -51,7 +51,8 @@ import { COMPONENT_BUTTON, COMPONENT_TOGGLE, COMPONENT_BUILDERPARAM_DECORATOR, - ESMODULE + ESMODULE, + CARD_ENABLE_DECORATORS } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -80,6 +81,7 @@ import { } from './process_ui_syntax'; import { isOhmUrl } from './resolve_ohm_url'; import { logger } from './compile_info'; +import { pageResourcePath } from './pre_process'; export interface ComponentCollection { localStorageName: string; @@ -1100,6 +1102,14 @@ function validateStateVariable(node: ts.MethodDeclaration): void { if (node.decorators && node.decorators.length) { for (let i = 0; i < node.decorators.length; i++) { const decoratorName: string = node.decorators[i].getText().replace(/\(.*\)$/,'').trim(); + if (pageResourcePath && projectConfig.cardObj[pageResourcePath] && + CARD_ENABLE_DECORATORS[decoratorName]) { + transformLog.errors.push({ + type: LogType.ERROR, + message: `Card page cannot use ${decoratorName}`, + pos: node.decorators[i].getStart() + }); + } if (INNER_COMPONENT_MEMBER_DECORATORS.has(decoratorName)) { transformLog.errors.push({ type: LogType.ERROR, -- Gitee From b0950ce8f343748517a844398868a2eb763e9712 Mon Sep 17 00:00:00 2001 From: lihong Date: Sat, 8 Oct 2022 18:58:32 +0800 Subject: [PATCH 053/379] lihong67@huawei.com add bundleName,moduleName in libso. Signed-off-by: lihong Change-Id: I3f78089f23f77736c985b95383057753822d4902 --- compiler/src/validate_ui_syntax.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index b5384a1..6af2b51 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -864,7 +864,9 @@ function replaceLibSo(importValue: string, libSoKey: string, sourcePath: string if (sourcePath) { useOSFiles.add(sourcePath); } - return `var ${importValue} = globalThis.requireNapi("${libSoKey}", true);`; + return projectConfig.bundleName && projectConfig.moduleName + ? `var ${importValue} = globalThis.requireNapi("${libSoKey}", true, "${projectConfig.bundleName}/${projectConfig.moduleName}");` + : `var ${importValue} = globalThis.requireNapi("${libSoKey}", true);`; } function replaceOhmStartsWithBundle(url: string, item: string, importValue: string, moduleRequest: string, sourcePath: string): string { -- Gitee From 4a39c6e00e3d7cbcfb0e4609c3a31daf607407de Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sat, 8 Oct 2022 20:07:45 +0800 Subject: [PATCH 054/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 动态化适配xcomponent Signed-off-by: houhaoyu Change-Id: I138171212c6da9072cfedbf8bfffd1906737a7c8 --- compiler/src/process_component_build.ts | 32 +++++++++++++++++++++---- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index f74c70e..8ca88e6 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -197,9 +197,13 @@ function validateFirstNode(node: ts.Statement): boolean { function validateContainerComponent(node: ts.Statement): boolean { if (ts.isExpressionStatement(node) && node.expression && (ts.isEtsComponentExpression(node.expression) || ts.isCallExpression(node.expression))) { - const nameResult: NameResult = { name: null }; + const nameResult: NameResult = { name: null, node: null }; validateEtsComponentNode(node.expression, nameResult); - if (nameResult.name && BUILDIN_CONTAINER_COMPONENT.has(nameResult.name)) { + if (nameResult.name && BUILDIN_CONTAINER_COMPONENT.has(nameResult.name) && (nameResult.name !== 'XComponent' || + (nameResult.name === 'XComponent' && nameResult.node.arguments && nameResult.node.arguments.length && + ts.isObjectLiteralExpression(nameResult.node.arguments[0]) && nameResult.node.arguments[0].properties && + // @ts-ignore + checkComponentType(nameResult.node.arguments[0].properties)))) { return true; } } @@ -221,7 +225,8 @@ let newsupplement: supplementType = { }; type NameResult = { - name: string + name: string, + node?: ts.Node } function validateEtsComponentNode(node: ts.CallExpression | ts.EtsComponentExpression, result?: NameResult) { @@ -234,6 +239,7 @@ function validateEtsComponentNode(node: ts.CallExpression | ts.EtsComponentExpre if (ts.isEtsComponentExpression(childNode)) { if (ts.isIdentifier(childNode.expression)) { result.name = childNode.expression.getText(); + result.node = childNode; } return true; } else { @@ -1250,7 +1256,11 @@ function createComponent(node: ts.ExpressionStatement, type: string): CreateResu if (NEEDPOP_COMPONENT.has(temp.getText())) { res.needPop = true; } - if (BUILDIN_CONTAINER_COMPONENT.has(temp.getText())) { + if (BUILDIN_CONTAINER_COMPONENT.has(temp.getText()) && (temp.getText() !== 'XComponent' || + (temp.getText() === 'XComponent' && temp.parent.arguments && temp.parent.arguments.length && + ts.isObjectLiteralExpression(temp.parent.arguments[0]) && temp.parent.arguments[0].properties && + // @ts-ignore + checkComponentType(temp.parent.arguments[0].properties)))) { res.isContainerComponent = true; } res.newNode = type === COMPONENT_POP_FUNCTION @@ -1263,6 +1273,18 @@ function createComponent(node: ts.ExpressionStatement, type: string): CreateResu return res; } +function checkComponentType(properties: ts.PropertyAssignment[]): boolean { + let flag = false; + properties.forEach(item => { + if (item.name && ts.isIdentifier(item.name) && item.name.getText() === 'type' && item.initializer && + ts.isStringLiteral(item.initializer) && + (item.initializer.getText() == '"Component"' || item.initializer.getText() == "'Component'")) { + flag = true; + } + }) + return flag; +} + interface AnimationInfo { statement: ts.Statement, kind: boolean @@ -1945,7 +1967,7 @@ function getComponentType(node: ts.ExpressionStatement, log: LogInfo[], } else if (builderParamObjectCollection.get(componentCollection.currentClassName) && builderParamObjectCollection.get(componentCollection.currentClassName).has(name)) { return ComponentType.builderParamMethod; - } else if ((['Column', 'XComponent'].includes(parent) || CUSTOM_BUILDER_METHOD.has(parent)) && + } else if ((['XComponent'].includes(parent) || CUSTOM_BUILDER_METHOD.has(parent)) && ts.isCallExpression(node.expression) && ts.isIdentifier(node.expression.expression)) { return ComponentType.function; } else if (!isAttributeNode(node)) { -- Gitee From 474bb3289ed10c0940b5aaa28f9f3115ff7501d6 Mon Sep 17 00:00:00 2001 From: lizhouze Date: Sun, 9 Oct 2022 10:11:39 +0800 Subject: [PATCH 055/379] lizhouze@huawei.com Signed-off-by: lizhouze --- compiler/webpack.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index b395d25..a8483c4 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -143,7 +143,8 @@ function initConfig(config) { if (!projectConfig.xtsMode) { config.cache = { type: "filesystem", - cacheDirectory: path.resolve(projectConfig.cachePath, '.ets_cache') + cacheDirectory: path.resolve(projectConfig.cachePath, '.ets_cache', + path.basename(projectConfig.projectPath)) }; } if (!projectConfig.aceModuleJsonPath) { -- Gitee From f09fd7b46ae96a94b341d6d0988140cd4887f00e Mon Sep 17 00:00:00 2001 From: laibo102 Date: Sun, 9 Oct 2022 15:16:56 +0800 Subject: [PATCH 056/379] Bugfix: fixed custom decorator bug Signed-off-by: laibo102 Change-Id: I04f3d541e178aba5933821be43d6bbdc1b1cb93f --- compiler/src/pre_define.ts | 1 + compiler/src/process_component_member.ts | 32 +++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 95ca3a0..f82787d 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -39,6 +39,7 @@ export const COMPONENT_WATCH_DECORATOR: string = '@Watch'; export const COMPONENT_BUILDERPARAM_DECORATOR: string = '@BuilderParam'; export const COMPONENT_LOCAL_STORAGE_LINK_DECORATOR: string = '@LocalStorageLink'; export const COMPONENT_LOCAL_STORAGE_PROP_DECORATOR: string = '@LocalStorageProp'; +export const COMPONENT_CUSTOM_DECORATOR: string = 'COMPONENT_CUSTOM_DECORATOR'; export const COMPONENT_DECORATORS_PARAMS: Set = new Set([COMPONENT_CONSUME_DECORATOR, COMPONENT_STORAGE_PROP_DECORATOR, COMPONENT_STORAGE_LINK_DECORATOR, COMPONENT_PROVIDE_DECORATOR, diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index ee4f1e9..a4d0a09 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -67,7 +67,8 @@ import { SYNCHED_PROPERTY_SIMPLE_TWO_WAY_PU, SYNCHED_PROPERTY_OBJECT_TWO_WAY_PU, SYNCHED_PROPERTY_SIMPLE_ONE_WAY_PU, - SYNCHED_PROPERTY_NESED_OBJECT_PU + SYNCHED_PROPERTY_NESED_OBJECT_PU, + COMPONENT_CUSTOM_DECORATOR } from './pre_define'; import { forbiddenUseStateType, @@ -251,6 +252,8 @@ export function processMemberVariableDecorators(parentName: ts.Identifier, } else if (!item.type) { validatePropertyNonType(name, log); return updateResult; + } else if (validateCustomDecorator(item.decorators, log)) { + updateResult.setUpdateParams(createUpdateParams(name, COMPONENT_CUSTOM_DECORATOR)); } else { processPropertyNodeDecorator(parentName, item, updateResult, ctorNode, name, watchMap, log, program, context, hasPreview, interfaceNode); @@ -481,6 +484,7 @@ function createUpdateParams(name: ts.Identifier, decorator: string): ts.Statemen case COMPONENT_NON_DECORATOR: case COMPONENT_STATE_DECORATOR: case COMPONENT_PROVIDE_DECORATOR: + case COMPONENT_CUSTOM_DECORATOR: updateParamsNode = createUpdateParamsWithIf(name); break; case COMPONENT_PROP_DECORATOR: @@ -1015,3 +1019,29 @@ function updateSynchedPropertyNesedObjectPU(nameIdentifier: ts.Identifier, validateNonObservedClassType(nameIdentifier, decoractor, log); } } + +function validateCustomDecorator(decorators: ts.NodeArray, log: LogInfo[]): boolean { + let hasInnerDecorator: boolean = false; + let hasCustomDecorator: boolean = false; + let innerDecorator: ts.Decorator; + for(let i = 0; i < decorators.length; i++) { + let decorator: ts.Decorator = decorators[i]; + const decoratorName: string = decorator.getText().replace(/\(.*\)$/, '').trim(); + if (INNER_COMPONENT_MEMBER_DECORATORS.has(decoratorName)) { + hasInnerDecorator = true; + innerDecorator = innerDecorator ? innerDecorator : decorator; + } else { + hasCustomDecorator = true; + } + } + if (hasCustomDecorator && hasInnerDecorator) { + log.push({ + type: LogType.ERROR, + message: `The inner decorator ${innerDecorator.getText()} cannot be used together with custom decorator.`, + pos: innerDecorator.getStart() + }); + } else if(!hasInnerDecorator) { + return true; + } + return false; +} -- Gitee From 5bea086b53c9e016bc998ce78ba103787a424a53 Mon Sep 17 00:00:00 2001 From: bojiang Date: Tue, 27 Sep 2022 16:24:11 +0800 Subject: [PATCH 057/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I7cb5464bd73692bbc78de43a0d9966c9b7493832 --- compiler/src/process_component_build.ts | 35 ++++++++++++++++++------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index e1dc455..03b4f62 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -147,10 +147,11 @@ export function processComponentBuild(node: ts.MethodDeclaration, } export function processComponentBlock(node: ts.Block, isLazy: boolean, log: LogInfo[], - isTransition: boolean = false, isInnerBuilder: boolean = false, parent: string = undefined): ts.Block { + isTransition: boolean = false, isInnerBuilder: boolean = false, parent: string = undefined, + forEachParameters: ts.NodeArray = undefined): ts.Block { const newStatements: ts.Statement[] = []; processComponentChild(node, newStatements, log, - {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, isInnerBuilder, parent); + {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, isInnerBuilder, parent, forEachParameters); if (isLazy && !partialUpdateConfig.partialUpdateMode) { newStatements.unshift(createRenderingInProgress(true)); } @@ -248,7 +249,8 @@ let sourceNode: ts.SourceFile; export function processComponentChild(node: ts.Block | ts.SourceFile, newStatements: ts.Statement[], log: LogInfo[], supplement: supplementType = {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, - isInnerBuilder: boolean = false, parent: string = undefined): void { + isInnerBuilder: boolean = false, parent: string = undefined, + forEachParameters: ts.NodeArray = undefined): void { if (supplement.isAcceleratePreview) { newsupplement = supplement; const compilerOptions = ts.readConfigFile( @@ -270,7 +272,7 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme pos: item.getStart() }); } - switch (getComponentType(item, log, name, parent)) { + switch (getComponentType(item, log, name, parent, forEachParameters)) { case ComponentType.innerComponent: const etsExpression: ts.EtsComponentExpression = getEtsComponentExpression(item); if (ts.isIdentifier(etsExpression.expression)) { @@ -1104,7 +1106,8 @@ function processForEachBlock(node: ts.CallExpression, log: LogInfo[], if (!partialUpdateConfig.partialUpdateMode) { return ts.factory.updateArrowFunction( arrowNode, arrowNode.modifiers, arrowNode.typeParameters, arrowNode.parameters, - arrowNode.type, arrowNode.equalsGreaterThanToken, processComponentBlock(blockNode, isLazy, log)); + arrowNode.type, arrowNode.equalsGreaterThanToken, + processComponentBlock(blockNode, isLazy, log, false, false, undefined, arrowNode.parameters)); } else { return processComponentBlock(blockNode, isLazy, log).statements; } @@ -1113,7 +1116,7 @@ function processForEachBlock(node: ts.CallExpression, log: LogInfo[], return ts.factory.updateArrowFunction( arrowNode, arrowNode.modifiers, arrowNode.typeParameters, arrowNode.parameters, arrowNode.type, arrowNode.equalsGreaterThanToken, - processComponentBlock(body, isLazy, log, false, isInnerBuilder)); + processComponentBlock(body, isLazy, log, false, isInnerBuilder, undefined, arrowNode.parameters)); } else { return processComponentBlock(body, isLazy, log).statements; } @@ -1959,8 +1962,22 @@ function isEtsComponent(node: ts.ExpressionStatement): boolean { return isEtsComponent; } -function getComponentType(node: ts.ExpressionStatement, log: LogInfo[], - name: string, parent: string): ComponentType { +function isSomeName(forEachParameters: ts.NodeArray, name: string): boolean { + return Array.isArray(forEachParameters) && + forEachParameters.some((item)=>{ return item.name.escapedText.toString() === name}); +} + +function isParamFunction(node: ts.ExpressionStatement): boolean { + return node.expression && ts.isCallExpression(node.expression) && + node.expression.expression && ts.isIdentifier(node.expression.expression); +} + +function getComponentType(node: ts.ExpressionStatement, log: LogInfo[], name: string, + parent: string, forEachParameters: ts.NodeArray = undefined): ComponentType { + let isBuilderName: boolean = true; + if(forEachParameters && isSomeName(forEachParameters, name) && isParamFunction(node)) { + isBuilderName = false; + } if (isEtsComponent(node)) { if (componentCollection.customComponents.has(name)) { return ComponentType.customComponent; @@ -1971,7 +1988,7 @@ function getComponentType(node: ts.ExpressionStatement, log: LogInfo[], return ComponentType.customComponent; } else if (name === COMPONENT_FOREACH || name === COMPONENT_LAZYFOREACH) { return ComponentType.forEachComponent; - } else if (CUSTOM_BUILDER_METHOD.has(name)) { + } else if (CUSTOM_BUILDER_METHOD.has(name) && isBuilderName) { return ComponentType.customBuilderMethod; } else if (builderParamObjectCollection.get(componentCollection.currentClassName) && builderParamObjectCollection.get(componentCollection.currentClassName).has(name)) { -- Gitee From a4381a998efb17752695e052f02aec7e002404fa Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Thu, 29 Sep 2022 19:43:17 +0800 Subject: [PATCH 058/379] Fix preview mode of import problem Signed-off-by: zhangrengao Change-Id: Ib9f61781ffb51385606a24ff29ff3c151498d570 --- compiler/src/gen_abc_plugin.ts | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index fa46288..4693de8 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -549,7 +549,7 @@ function splitJsBundlesBySize(bundleArray: Array, groupNumber: number): an } function invokeWorkersModuleToGenAbc(moduleInfos: Array): void { - invokeCluterModuleToAbc(); + invokeClusterModuleToAbc(); } export function initAbcEnv() : string[] { @@ -611,7 +611,7 @@ export function initAbcEnv() : string[] { return args; } -function invokeCluterModuleToAbc(): void { +function invokeClusterModuleToAbc(): void { if (process.env.watchMode === 'true') { process.exitCode = SUCCESS; } @@ -653,7 +653,6 @@ function invokeCluterModuleToAbc(): void { cluster.on('exit', (worker, code, signal) => { if (code === FAIL || process.exitCode === FAIL) { process.exitCode = FAIL; - return; } count_++; if (count_ === totalWorkerNumber) { @@ -661,7 +660,11 @@ function invokeCluterModuleToAbc(): void { clearGlobalInfo(); if (process.env.watchMode === 'true' && compileCount < previewCount) { compileCount++; - console.info(blue, 'COMPILE RESULT:SUCCESS ', reset); + if (process.exitCode === SUCCESS) { + console.info(blue, 'COMPILE RESULT:SUCCESS ', reset); + } else { + console.info(blue, 'COMPILE RESULT:FAIL ', reset); + } if (compileCount >= previewCount) { return; } @@ -778,7 +781,6 @@ function invokeWorkersToGenAbc(): void { cluster.on('exit', (worker, code, signal) => { if (code === FAIL || process.exitCode === FAIL) { process.exitCode = FAIL; - return; } count_++; if (count_ === workerNumber) { @@ -786,7 +788,11 @@ function invokeWorkersToGenAbc(): void { if (process.env.watchMode === 'true' && compileCount < previewCount) { compileCount++; processExtraAssetForBundle(); - console.info(red, 'COMPILE RESULT:SUCCESS ', reset); + if (process.exitCode === SUCCESS) { + console.info(blue, 'COMPILE RESULT:SUCCESS ', reset); + } else { + console.info(blue, 'COMPILE RESULT:FAIL ', reset); + } if (compileCount >= previewCount) { return; } @@ -873,7 +879,7 @@ function writeModuleHashJson(): void { const input: string = filterModuleInfos[i].tempFilePath; let outputPath: string = filterModuleInfos[i].abcFilePath; if (!fs.existsSync(input) || !fs.existsSync(outputPath)) { - logger.error(red, `ETS:ERROR ${input} is lost`, reset); + logger.debug(red, `ETS:ERROR ${input} is lost`, reset); process.exitCode = FAIL; break; } @@ -930,7 +936,7 @@ function filterIntermediateJsBundleByHashJson(buildPath: string, inputPaths: Fil const cacheOutputPath: string = inputPaths[i].cacheOutputPath; const cacheAbcFilePath: string = cacheOutputPath.replace(/\.temp\.js$/, '.abc'); if (!fs.existsSync(cacheOutputPath)) { - logger.error(red, `ETS:ERROR ${cacheOutputPath} is lost`, reset); + logger.debug(red, `ETS:ERROR ${cacheOutputPath} is lost`, reset); process.exitCode = FAIL; break; } @@ -957,7 +963,7 @@ function writeHashJson(): void { const cacheOutputPath: string = fileterIntermediateJsBundle[i].cacheOutputPath; const cacheAbcFilePath: string = cacheOutputPath.replace(/\.temp\.js$/, '.abc'); if (!fs.existsSync(cacheOutputPath) || !fs.existsSync(cacheAbcFilePath)) { - logger.error(red, `ETS:ERROR ${cacheOutputPath} is lost`, reset); + logger.debug(red, `ETS:ERROR ${cacheOutputPath} is lost`, reset); process.exitCode = FAIL; break; } @@ -1078,7 +1084,7 @@ function handleHotReloadChangedFiles() { } else if (file.endsWith(EXTNAME_JS) || file.endsWith(EXTNAME_MJS) || file.endsWith(EXTNAME_CJS)) { processJsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); } else { - logger.error(red, `ETS:ERROR Cannot find resolve this file path: ${filePath}`, reset); + logger.debug(red, `ETS:ERROR Cannot find resolve this file path: ${filePath}`, reset); process.exitCode = FAIL; } @@ -1097,7 +1103,7 @@ function handleHotReloadChangedFiles() { fs.writeFile(path.join(projectConfig.patchAbcPath, SOURCEMAPS), JSON.stringify(hotReloadSourceMap, null, 2), 'utf-8', (err) => { if (err) { - logger.error(red, `ETS:ERROR Failed to write sourceMaps.`, reset); + logger.debug(red, `ETS:ERROR Failed to write sourceMaps.`, reset); } } ); -- Gitee From fa75078d1ec1e59d3cf2e22245072c2aaf7c948b Mon Sep 17 00:00:00 2001 From: lizhouze Date: Mon, 10 Oct 2022 11:10:07 +0800 Subject: [PATCH 059/379] lizhouze@huawei.com Signed-off-by: lizhouze --- compiler/main.js | 4 ++-- compiler/src/pre_define.ts | 5 ++++- compiler/src/pre_process.ts | 3 --- compiler/src/process_component_build.ts | 15 +++++-------- compiler/src/process_import.ts | 15 +++++-------- compiler/src/process_ui_syntax.ts | 15 +++++++------ compiler/src/utils.ts | 29 ++++++++++++++++++++++++- compiler/src/validate_ui_syntax.ts | 17 ++++++--------- 8 files changed, 61 insertions(+), 42 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 490afd0..f6be94e 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -297,8 +297,8 @@ function readCardResource(resource) { } function readCardForm(form) { - if (form.type && form.type ==='eTS') { - const sourcePath = form.src.replace(/\.ets$/,''); + if (form.type && form.type === 'eTS') { + const sourcePath = form.src.replace(/\.ets$/, ''); const cardPath = path.resolve(projectConfig.projectPath, '..', sourcePath + '.ets'); if (cardPath && fs.existsSync(cardPath)) { projectConfig.entryObj['../' + sourcePath] = cardPath + '?entry'; diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index a50c571..e0397bf 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -338,4 +338,7 @@ export const CARD_ENABLE_DECORATORS: Set = new Set([ export const CARD_ENABLE_COMPONENTS: Set = new Set([ 'AbilityComponent', 'PluginComponent', 'FormComponent', 'RemoteWindow', 'XComponent', 'Web', 'RichText' -]); \ No newline at end of file +]); +export const CARD_LOG_TYPE_DECORATORS = 1; +export const CARD_LOG_TYPE_COMPONENTS = 2; +export const CARD_LOG_TYPE_IMPORT = 3; \ No newline at end of file diff --git a/compiler/src/pre_process.ts b/compiler/src/pre_process.ts index ea9e353..a961471 100644 --- a/compiler/src/pre_process.ts +++ b/compiler/src/pre_process.ts @@ -42,11 +42,8 @@ import { genETS } from '../codegen/codegen_ets.js'; const visualMap: Map = new Map(); const slotMap: Map = new Map(); -export let pageResourcePath: string = ''; - function preProcess(source: string): string { process.env.compiler = BUILD_ON; - pageResourcePath = path.resolve(this.resourcePath); if (/\.ets$/.test(this.resourcePath)) { const result: ReplaceResult = sourceReplace(source, this.resourcePath); let newContent: string = result.content; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 03b4f62..715eb04 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -87,7 +87,8 @@ import { TABCONTENT_COMPONENT, GLOBAL_THIS, IFELSEBRANCHUPDATEFUNCTION, - CARD_ENABLE_COMPONENTS + CARD_ENABLE_COMPONENTS, + CARD_LOG_TYPE_COMPONENTS } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -116,13 +117,13 @@ import { LogType, LogInfo, componentInfo, - createFunction + createFunction, + validatorCard } from './utils'; import { partialUpdateConfig, projectConfig } from '../main'; import { transformLog, contextGlobal } from './process_ui_syntax'; import { props } from './compile_info'; import { CUSTOM_COMPONENT } from '../lib/pre_define'; -import { pageResourcePath } from './pre_process'; export function processComponentBuild(node: ts.MethodDeclaration, log: LogInfo[]): ts.MethodDeclaration { @@ -265,12 +266,8 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme if (ts.isExpressionStatement(item)) { checkEtsComponent(item, log); const name: string = getName(item); - if (pageResourcePath && projectConfig.cardObj[pageResourcePath] && CARD_ENABLE_COMPONENTS.has(name)) { - log.push({ - type: LogType.ERROR, - message: `Card page cannot use the component ${name}.`, - pos: item.getStart() - }); + if (CARD_ENABLE_COMPONENTS.has(name)) { + validatorCard(log, CARD_LOG_TYPE_COMPONENTS, item.getStart(), name); } switch (getComponentType(item, log, name, parent, forEachParameters)) { case ComponentType.innerComponent: diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index 7a27cac..7cd8c73 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -27,7 +27,8 @@ import { CUSTOM_COMPONENT_DEFAULT, CUSTOM_DECORATOR_NAME, COMPONENT_DECORATOR_ENTRY, - COMPONENT_BUILDER_DECORATOR + COMPONENT_BUILDER_DECORATOR, + CARD_LOG_TYPE_IMPORT } from './pre_define'; import { propertyCollection, @@ -49,12 +50,12 @@ import { hasDecorator, LogInfo, LogType, - repeatLog + repeatLog, + validatorCard } from './utils'; import { projectConfig } from '../main'; import { isOhmUrl, resolveSourceFile } from './resolve_ohm_url'; import { CUSTOM_BUILDER_METHOD, INNER_COMPONENT_NAMES } from './component_map'; -import { pageResourcePath } from './pre_process'; const IMPORT_FILE_ASTCACHE: Map = new Map(); @@ -106,12 +107,8 @@ isEntryPage: boolean = true, pathCollection: Set = new Set()): void { } } - if (pageResourcePath && projectConfig.cardObj[pageResourcePath] && filePath) { - log.push({ - type: LogType.ERROR, - message: `Card page cannot use import.`, - pos: node.getStart() - }); + if (filePath) { + validatorCard(log, CARD_LOG_TYPE_IMPORT, node.getStart()); } try { diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index dab90b9..3001263 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -93,10 +93,10 @@ import { partialUpdateConfig } from '../main'; import { createCustomComponentNewExpression, createViewCreate } from './process_component_member'; -import { pageResourcePath } from './pre_process'; export const transformLog: FileLog = new FileLog(); export let contextGlobal: ts.TransformationContext; +export let resourceFileName: string = ''; export function processUISyntax(program: ts.Program, ut = false): Function { return (context: ts.TransformationContext) => { @@ -104,6 +104,7 @@ export function processUISyntax(program: ts.Program, ut = false): Function { let pagesDir: string; return (node: ts.SourceFile) => { pagesDir = path.resolve(path.dirname(node.fileName)); + resourceFileName = path.resolve(node.fileName); if (process.env.compiler === BUILD_ON) { transformLog.sourceFile = node; preprocessIdAttrs(node.fileName); @@ -588,18 +589,18 @@ export function isExtendFunction(node: ts.FunctionDeclaration): string { } function createEntryNode(node: ts.SourceFile, context: ts.TransformationContext): ts.SourceFile { - const cardRelativePath: string = projectConfig.cardObj[pageResourcePath]; + const cardRelativePath: string = projectConfig.cardObj[resourceFileName]; if (componentCollection.previewComponent.size === 0 || !projectConfig.isPreview) { if (componentCollection.entryComponent) { if (!partialUpdateConfig.partialUpdateMode) { const entryNode: ts.ExpressionStatement = createEntryFunction(componentCollection.entryComponent, context, - cardRelativePath) as ts.ExpressionStatement; + cardRelativePath) as ts.ExpressionStatement; return context.factory.updateSourceFile(node, [...node.statements, entryNode]); } else { const entryNodes: ts.ExpressionStatement[] = createEntryFunction(componentCollection.entryComponent, context, - cardRelativePath) as ts.ExpressionStatement[]; + cardRelativePath) as ts.ExpressionStatement[]; return context.factory.updateSourceFile(node, [...node.statements, ...entryNodes]); } } else { @@ -639,7 +640,7 @@ function createEntryFunction(name: string, context: ts.TransformationContext, ca } const newExpressionParams: any[] = [ context.factory.createNewExpression( - context.factory.createIdentifier(name),undefined, newArray)]; + context.factory.createIdentifier(name),undefined, newArray)]; addCardStringliteral(newExpressionParams, context, cardRelativePath); if (!partialUpdateConfig.partialUpdateMode) { const newExpressionStatement: ts.ExpressionStatement = @@ -724,7 +725,7 @@ function createPreviewComponentFunction(name: string, context: ts.Transformation }); const newExpressionParams: any[] = [ context.factory.createNewExpression( - context.factory.createIdentifier(name), undefined, newArray)]; + context.factory.createIdentifier(name), undefined, newArray)]; addCardStringliteral(newExpressionParams, context, cardRelativePath); const ifStatement: ts.Statement = context.factory.createIfStatement( context.factory.createCallExpression( @@ -752,7 +753,7 @@ function createPreviewComponentFunction(name: string, context: ts.Transformation )), name ? context.factory.createExpressionStatement(context.factory.createCallExpression( context.factory.createIdentifier(cardRelativePath ? CARD_ENTRY_FUNCTION_NAME : - PAGE_ENTRY_FUNCTION_NAME),undefined,newExpressionParams + PAGE_ENTRY_FUNCTION_NAME),undefined,newExpressionParams )) : undefined ], true diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 437a645..09ba9a1 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -36,9 +36,13 @@ import { EXTNAME_TS_MAP, EXTNAME_JS_MAP, ESMODULE, - FAIL + FAIL, + CARD_LOG_TYPE_COMPONENTS, + CARD_LOG_TYPE_DECORATORS, + CARD_LOG_TYPE_IMPORT } from './pre_define'; import { minify, MinifyOutput } from 'terser'; +import { resourceFileName } from './process_ui_syntax'; export enum LogType { ERROR = 'ERROR', @@ -589,4 +593,27 @@ export function removeDir(dirName: string): void { fs.rmdirSync(dirName, { recursive: true}); } } +} + +export function validatorCard(log: any[], type: number, pos: number, + name: string = ''): void { + if (resourceFileName && projectConfig.cardObj[resourceFileName]) { + const logInfo: object = { + type: LogType.ERROR, + message: '', + pos: pos + } + switch(type) { + case CARD_LOG_TYPE_COMPONENTS: + logInfo.message = `Card page cannot use the component ${name}.`; + break; + case CARD_LOG_TYPE_DECORATORS: + logInfo.message = `Card page cannot use ${name}`; + break; + case CARD_LOG_TYPE_IMPORT: + logInfo.message = `Card page cannot use import.`; + break; + } + log.push(logInfo); + } } \ No newline at end of file diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index e6b07b4..e563317 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -52,7 +52,8 @@ import { COMPONENT_TOGGLE, COMPONENT_BUILDERPARAM_DECORATOR, ESMODULE, - CARD_ENABLE_DECORATORS + CARD_ENABLE_DECORATORS, + CARD_LOG_TYPE_DECORATORS } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -71,7 +72,8 @@ import { componentInfo, addLog, hasDecorator, - getPackageInfo + getPackageInfo, + validatorCard } from './utils'; import { projectConfig, abilityPagesFullPath } from '../main'; import { @@ -81,7 +83,6 @@ import { } from './process_ui_syntax'; import { isOhmUrl } from './resolve_ohm_url'; import { logger } from './compile_info'; -import { pageResourcePath } from './pre_process'; export interface ComponentCollection { localStorageName: string; @@ -1102,13 +1103,9 @@ function validateStateVariable(node: ts.MethodDeclaration): void { if (node.decorators && node.decorators.length) { for (let i = 0; i < node.decorators.length; i++) { const decoratorName: string = node.decorators[i].getText().replace(/\(.*\)$/,'').trim(); - if (pageResourcePath && projectConfig.cardObj[pageResourcePath] && - CARD_ENABLE_DECORATORS[decoratorName]) { - transformLog.errors.push({ - type: LogType.ERROR, - message: `Card page cannot use ${decoratorName}`, - pos: node.decorators[i].getStart() - }); + if (CARD_ENABLE_DECORATORS[decoratorName]) { + validatorCard(transformLog.errors, CARD_LOG_TYPE_DECORATORS, + node.decorators[i].getStart(), decoratorName); } if (INNER_COMPONENT_MEMBER_DECORATORS.has(decoratorName)) { transformLog.errors.push({ -- Gitee From 5ee08c1f2a20f7e1c6835c790e0fefa5d6741d8b Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 10 Oct 2022 10:50:31 +0800 Subject: [PATCH 060/379] houhaoyu@huawei.com preview resource and variable Signed-off-by: houhaoyu Change-Id: I5b04708395a85b7a936cfd8c0bc0b9d4c8e594d4 --- compiler/server/build_pipe_server.js | 87 ++++++++++++++++++++++------ compiler/src/process_ui_syntax.ts | 4 +- 2 files changed, 70 insertions(+), 21 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index 1d13c0a..b22b934 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-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 @@ -24,6 +24,10 @@ const { createWatchCompilerHost } = require('../lib/ets_checker'); const { writeFileSync } = require('../lib/utils'); const { projectConfig } = require('../main'); const { props } = require('../lib/compile_info'); +const { + isResource, + processResourceData +} = require('../lib/process_ui_syntax'); const WebSocketServer = WebSocket.Server; @@ -50,6 +54,8 @@ let compileStatus = false; let receivedMsg_; let errorInfo; let compileWithCheck; +let globalVariable = []; +let propertyVariable = []; function init(port) { previewCacheFilePath = @@ -90,7 +96,7 @@ function handlePluginCompileComponent(jsonData) { } else if (messages.length > 0){ jsonData = messages[0]; } else { - return + return; } start = true; const receivedMsg = jsonData; @@ -103,10 +109,7 @@ function handlePluginCompileComponent(jsonData) { 'struct preview{build(){' + receivedMsg.data.script + '}}', ts.ScriptTarget.Latest, true, ts.ScriptKind.ETS, compilerOptions); compileWithCheck = jsonData.data.compileWithCheck || 'true'; - if (previewCacheFilePath && fs.existsSync(previewCacheFilePath) - && compileWithCheck === 'true') { - writeFileSync(previewCacheFilePath, 'struct preview{build(){' + receivedMsg.data.script + '}}'); - } + checkPreparation(receivedMsg); const previewStatements = []; const log = []; supplement = { @@ -118,9 +121,65 @@ function handlePluginCompileComponent(jsonData) { processComponentChild(sourceNode.statements[0].members[1].body, previewStatements, log, supplement); supplement.isAcceleratePreview = false; const newSource = ts.factory.updateSourceFile(sourceNode, previewStatements); + const transformedSourceFile = transformResourceNode(newSource); const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); - const result = printer.printNode(ts.EmitHint.Unspecified, newSource, newSource); + const result = printer.printNode(ts.EmitHint.Unspecified, transformedSourceFile, transformedSourceFile); receivedMsg.data.script = ts.transpileModule(result, {}).outputText; + processOffset(receivedMsg, log, sourceNode); + receivedMsg.data.log = log; + if (receivedMsg.data.viewID) { + receivedMsg.data.script = `function quickPreview(context) { + const fastPreview = function build(){ + ${receivedMsg.data.script} + }.bind(context); + } + quickPreview(GetRootView(${receivedMsg.data.viewID}))` + } + callEs2abc(receivedMsg); +} + +function transformResourceNode(newSource) { + const transformerFactory = (context) => { + return (rootNode) => { + function visit(node) { + node = ts.visitEachChild(node, visit, context); + return processResourceNode(node); + } + return ts.visitNode(rootNode, visit); + } + } + const transformationResult = ts.transform(newSource, [transformerFactory]); + return transformationResult.transformed[0]; +} + +function processResourceNode(node) { + if (isResource(node)) { + return processResourceData(node); + } else { + return node; + } +} + +function checkPreparation(receivedMsg) { + if (previewCacheFilePath && fs.existsSync(previewCacheFilePath) && compileWithCheck === 'true') { + globalVariable = receivedMsg.data.globalVariable || globalVariable; + propertyVariable = receivedMsg.data.propertyVariable || propertyVariable; + writeFileSync(previewCacheFilePath, 'struct preview{build(){' + receivedMsg.data.script + '}}'); + } +} + +function callEs2abc(receivedMsg) { + if (fs.existsSync(es2abcFilePath + '.exe') || fs.existsSync(es2abcFilePath)){ + es2abc(receivedMsg); + } else { + es2abcFilePath = path.join(__dirname, '../bin/ark/build-mac/bin/es2abc'); + if (fs.existsSync(es2abcFilePath)) { + es2abc(receivedMsg); + } + } +} + +function processOffset(receivedMsg, log, sourceNode) { if (receivedMsg.data.offset) { for (let i = 0; i < log.length; i++) { let line = parseInt(sourceNode.getLineAndCharacterOfPosition(log[i].pos).line); @@ -134,18 +193,8 @@ function handlePluginCompileComponent(jsonData) { } } } - receivedMsg.data.log = log; - if (fs.existsSync(es2abcFilePath + '.exe') || fs.existsSync(es2abcFilePath)){ - es2abc(receivedMsg); - } else { - es2abcFilePath = path.join(__dirname, '../bin/ark/build-mac/bin/es2abc'); - if (fs.existsSync(es2abcFilePath)) { - es2abc(receivedMsg); - } - } } - function es2abc(receivedMsg) { const cmd = es2abcFilePath + ' --base64Input ' + Buffer.from(receivedMsg.data.script).toString('base64') + ' --base64Output'; @@ -212,8 +261,8 @@ function responseToPlugin() { function validateError(message) { const propInfoReg = /Cannot find name\s*'(\$?\$?[_a-zA-Z0-9]+)'/; const stateInfoReg = /Property\s*'(\$?[_a-zA-Z0-9]+)' does not exist on type/; - if (matchMessage(message, props, propInfoReg) || - matchMessage(message, props, stateInfoReg)) { + if (matchMessage(message, [...globalVariable, ...props], propInfoReg) || + matchMessage(message, [...propertyVariable, ...props], stateInfoReg)) { return false; } return true; diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 7c170d3..c4f9474 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -348,7 +348,7 @@ function createCustomComponentBuilderArrowFunction(parent: ts.Expression, ); } -function isResource(node: ts.Node): boolean { +export function isResource(node: ts.Node): boolean { return ts.isCallExpression(node) && ts.isIdentifier(node.expression) && (node.expression.escapedText.toString() === RESOURCE || node.expression.escapedText.toString() === RESOURCE_RAWFILE) && node.arguments.length > 0; @@ -359,7 +359,7 @@ function isAnimateTo(node: ts.Node): boolean { node.expression.escapedText.toString() === ATTRIBUTE_ANIMATETO; } -function processResourceData(node: ts.CallExpression): ts.Node { +export function processResourceData(node: ts.CallExpression): ts.Node { if (ts.isStringLiteral(node.arguments[0])) { if (node.expression.getText() === RESOURCE_RAWFILE) { return createResourceParam(0, RESOURCE_TYPE.rawfile, [node.arguments[0]]); -- Gitee From d4139c33077c9c255d5d011a6df77938a1ab778c Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sun, 9 Oct 2022 12:08:16 +0800 Subject: [PATCH 061/379] houhaoyu@huawei.com XComponent container Signed-off-by: houhaoyu Change-Id: I83390c7c58ea1ada8babfeb892a2581e268106be --- compiler/src/process_component_build.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 8ca88e6..2f6a16c 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -199,11 +199,7 @@ function validateContainerComponent(node: ts.Statement): boolean { (ts.isEtsComponentExpression(node.expression) || ts.isCallExpression(node.expression))) { const nameResult: NameResult = { name: null, node: null }; validateEtsComponentNode(node.expression, nameResult); - if (nameResult.name && BUILDIN_CONTAINER_COMPONENT.has(nameResult.name) && (nameResult.name !== 'XComponent' || - (nameResult.name === 'XComponent' && nameResult.node.arguments && nameResult.node.arguments.length && - ts.isObjectLiteralExpression(nameResult.node.arguments[0]) && nameResult.node.arguments[0].properties && - // @ts-ignore - checkComponentType(nameResult.node.arguments[0].properties)))) { + if (nameResult.name && checkContainer(nameResult.name, nameResult.node)) { return true; } } @@ -1256,11 +1252,7 @@ function createComponent(node: ts.ExpressionStatement, type: string): CreateResu if (NEEDPOP_COMPONENT.has(temp.getText())) { res.needPop = true; } - if (BUILDIN_CONTAINER_COMPONENT.has(temp.getText()) && (temp.getText() !== 'XComponent' || - (temp.getText() === 'XComponent' && temp.parent.arguments && temp.parent.arguments.length && - ts.isObjectLiteralExpression(temp.parent.arguments[0]) && temp.parent.arguments[0].properties && - // @ts-ignore - checkComponentType(temp.parent.arguments[0].properties)))) { + if (checkContainer(temp.getText(), temp.parent)) { res.isContainerComponent = true; } res.newNode = type === COMPONENT_POP_FUNCTION @@ -1273,12 +1265,19 @@ function createComponent(node: ts.ExpressionStatement, type: string): CreateResu return res; } +function checkContainer(name: string, node: ts.Node): boolean { + return BUILDIN_CONTAINER_COMPONENT.has(name) && (name !== 'XComponent' || + (node && node.arguments && node.arguments.length && + ts.isObjectLiteralExpression(node.arguments[0]) && node.arguments[0].properties && + checkComponentType(node.arguments[0].properties))); +} + function checkComponentType(properties: ts.PropertyAssignment[]): boolean { - let flag = false; + let flag: boolean = false; properties.forEach(item => { if (item.name && ts.isIdentifier(item.name) && item.name.getText() === 'type' && item.initializer && ts.isStringLiteral(item.initializer) && - (item.initializer.getText() == '"Component"' || item.initializer.getText() == "'Component'")) { + (item.initializer.getText() == '"component"' || item.initializer.getText() == "'component'")) { flag = true; } }) -- Gitee From 6b34ebb22fd3599283255216c1099443e33c4b9a Mon Sep 17 00:00:00 2001 From: lizhouze Date: Mon, 10 Oct 2022 18:04:42 +0800 Subject: [PATCH 062/379] lizhouze@huawei.com Signed-off-by: lizhouze --- compiler/src/process_ui_syntax.ts | 5 ++++- compiler/src/utils.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 3001263..ddbff0c 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -589,7 +589,10 @@ export function isExtendFunction(node: ts.FunctionDeclaration): string { } function createEntryNode(node: ts.SourceFile, context: ts.TransformationContext): ts.SourceFile { - const cardRelativePath: string = projectConfig.cardObj[resourceFileName]; + let cardRelativePath: string = undefined; + if (projectConfig && projectConfig.cardObj) { + cardRelativePath = projectConfig.cardObj[resourceFileName]; + } if (componentCollection.previewComponent.size === 0 || !projectConfig.isPreview) { if (componentCollection.entryComponent) { if (!partialUpdateConfig.partialUpdateMode) { diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 09ba9a1..12cd91d 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -597,7 +597,8 @@ export function removeDir(dirName: string): void { export function validatorCard(log: any[], type: number, pos: number, name: string = ''): void { - if (resourceFileName && projectConfig.cardObj[resourceFileName]) { + if (projectConfig && projectConfig.cardObj && resourceFileName + && projectConfig.cardObj[resourceFileName]) { const logInfo: object = { type: LogType.ERROR, message: '', -- Gitee From 10920758b5909f93828e91e4aaf03bfc18330dfe Mon Sep 17 00:00:00 2001 From: yfwang6 Date: Mon, 10 Oct 2022 20:54:23 +0800 Subject: [PATCH 063/379] wangyongfei6@huawei.com fix pagetransition on partial update mode Signed-off-by: yfwang6 Change-Id: Id771d5ca158c60dea41cbaf28d586cd70517a72a --- compiler/src/process_component_build.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 03b4f62..d4f56ef 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -156,12 +156,21 @@ export function processComponentBlock(node: ts.Block, isLazy: boolean, log: LogI newStatements.unshift(createRenderingInProgress(true)); } if (isTransition) { - newStatements.unshift(ts.factory.createExpressionStatement( - createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), - ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))); - newStatements.push(ts.factory.createExpressionStatement( - createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), - ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null))); + if (!partialUpdateConfig.partialUpdateMode) { + newStatements.unshift(ts.factory.createExpressionStatement( + createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), + ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))); + newStatements.push(ts.factory.createExpressionStatement( + createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), + ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null))); + } else { + newStatements.unshift(createComponentCreationStatement(node, [ts.factory.createExpressionStatement( + createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), + ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))])); + newStatements.push(createComponentCreationStatement(node, [ts.factory.createExpressionStatement( + createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), + ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null))])); + } } if (isLazy && !partialUpdateConfig.partialUpdateMode) { newStatements.push(createRenderingInProgress(false)); -- Gitee From 0cd31b9cb7f2bd909a129f517beb51b99399345f Mon Sep 17 00:00:00 2001 From: yfwang6 Date: Mon, 10 Oct 2022 21:14:47 +0800 Subject: [PATCH 064/379] wangyongfei6@huawei.com fix pagetransition on partial update mode Signed-off-by: yfwang6 Change-Id: Ia2e438a478bf638f59b4a8326e52dc76383aeeb4 --- compiler/src/process_component_build.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index d4f56ef..9e65c51 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -156,21 +156,16 @@ export function processComponentBlock(node: ts.Block, isLazy: boolean, log: LogI newStatements.unshift(createRenderingInProgress(true)); } if (isTransition) { - if (!partialUpdateConfig.partialUpdateMode) { + !partialUpdateConfig.partialUpdateMode ? newStatements.unshift(ts.factory.createExpressionStatement( createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), - ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))); - newStatements.push(ts.factory.createExpressionStatement( - createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), - ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null))); - } else { + ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))) : newStatements.unshift(createComponentCreationStatement(node, [ts.factory.createExpressionStatement( createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))])); - newStatements.push(createComponentCreationStatement(node, [ts.factory.createExpressionStatement( - createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), - ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null))])); - } + newStatements.push(ts.factory.createExpressionStatement( + createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), + ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null))); } if (isLazy && !partialUpdateConfig.partialUpdateMode) { newStatements.push(createRenderingInProgress(false)); -- Gitee From c35a05c621e6af7c4c514f373454511eb7646678 Mon Sep 17 00:00:00 2001 From: yfwang6 Date: Mon, 10 Oct 2022 22:20:27 +0800 Subject: [PATCH 065/379] wangyongfei6@huawei.com fix pagetransition on partial update mode Signed-off-by: yfwang6 Change-Id: I7781f26fb4baacd2761276ec09d07d59eb9b039d --- compiler/src/process_component_build.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 9e65c51..1164a37 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -160,7 +160,9 @@ export function processComponentBlock(node: ts.Block, isLazy: boolean, log: LogI newStatements.unshift(ts.factory.createExpressionStatement( createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))) : - newStatements.unshift(createComponentCreationStatement(node, [ts.factory.createExpressionStatement( + newStatements.unshift(createComponentCreationStatement(ts.factory.createExpressionStatement( + createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), + ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null)), [ts.factory.createExpressionStatement( createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))])); newStatements.push(ts.factory.createExpressionStatement( -- Gitee From 4b2af46b30e42681285f6fb951ea9b7d82be42d4 Mon Sep 17 00:00:00 2001 From: wangzezhen Date: Mon, 10 Oct 2022 22:57:36 +0800 Subject: [PATCH 066/379] navigation api Signed-off-by: wangzezhen Change-Id: Ifbabedbbfc73f7b88f95872fdccdbf28b1e3f8ce --- compiler/components/nav_destination.json | 4 ++++ compiler/components/nav_router.json | 4 ++++ compiler/components/navigation.json | 3 ++- compiler/tsconfig.esm.json | 12 ++++++++++++ compiler/tsconfig.json | 12 ++++++++++++ 5 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 compiler/components/nav_destination.json create mode 100644 compiler/components/nav_router.json diff --git a/compiler/components/nav_destination.json b/compiler/components/nav_destination.json new file mode 100644 index 0000000..85fe4f2 --- /dev/null +++ b/compiler/components/nav_destination.json @@ -0,0 +1,4 @@ +{ + "name": "NavDestination", + "attrs": ["title", "hideTitleBar"] +} \ No newline at end of file diff --git a/compiler/components/nav_router.json b/compiler/components/nav_router.json new file mode 100644 index 0000000..9b9caee --- /dev/null +++ b/compiler/components/nav_router.json @@ -0,0 +1,4 @@ +{ + "name": "NavRouter", + "attrs": ["onStateChange"] +} \ No newline at end of file diff --git a/compiler/components/navigation.json b/compiler/components/navigation.json index 0caa487..62c60a2 100644 --- a/compiler/components/navigation.json +++ b/compiler/components/navigation.json @@ -1,5 +1,6 @@ { "name": "Navigation", "attrs": ["title", "subTitle", "hideTitleBar", "hideBackButton", "titleMode", "menus", "menuCount", - "toolBar", "hideToolBar", "onTitleModeChange"] + "toolBar", "hideToolBar", "onTitleModeChange", "onNavBarStateChange", "navBarWidth", "navBarPosition", + "mode", "backButtonIcon", "hideNavBar"] } \ No newline at end of file diff --git a/compiler/tsconfig.esm.json b/compiler/tsconfig.esm.json index 388ce0c..47de545 100644 --- a/compiler/tsconfig.esm.json +++ b/compiler/tsconfig.esm.json @@ -63,6 +63,8 @@ "LoadingProgress", "Marquee", "Menu", + "NavDestination", + "NavRouter", "Navigation", "Navigator", "Option", @@ -309,6 +311,16 @@ "type": "MenuAttribute", "instance": "MenuInstance" }, + { + "name": "NavDestination", + "type": "NavDestinationAttribute", + "instance": "NavDestinationInstance" + }, + { + "name": "NavRouter", + "type": "NavRouterAttribute", + "instance": "NavRouterInstance" + }, { "name": "Navigation", "type": "NavigationAttribute", diff --git a/compiler/tsconfig.json b/compiler/tsconfig.json index 195152a..7eb91fc 100644 --- a/compiler/tsconfig.json +++ b/compiler/tsconfig.json @@ -63,6 +63,8 @@ "LoadingProgress", "Marquee", "Menu", + "NavDestination", + "NavRouter", "Navigation", "Navigator", "Option", @@ -309,6 +311,16 @@ "type": "MenuAttribute", "instance": "MenuInstance" }, + { + "name": "NavDestination", + "type": "NavDestinationAttribute", + "instance": "NavDestinationInstance" + }, + { + "name": "NavRouter", + "type": "NavRouterAttribute", + "instance": "NavRouterInstance" + }, { "name": "Navigation", "type": "NavigationAttribute", -- Gitee From 7d2178a8934db4dc25830fd0e5de33376b3d5fd3 Mon Sep 17 00:00:00 2001 From: hufeng Date: Sun, 9 Oct 2022 16:35:36 +0800 Subject: [PATCH 067/379] =?UTF-8?q?Fix=20esmodule=20preview=E2=80=98s=20co?= =?UTF-8?q?mpiling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hufeng Change-Id: I240fd99260ce80c9ed9f383dee4070614e5623db --- compiler/src/gen_abc_plugin.ts | 9 ++------- compiler/src/gen_merged_abc.ts | 32 ++++++++++++++++++-------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 4693de8..540f818 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -1100,13 +1100,8 @@ function handleHotReloadChangedFiles() { generateMergedAbc(moduleInfos, entryInfos, outputABCPath); // write source maps - fs.writeFile(path.join(projectConfig.patchAbcPath, SOURCEMAPS), JSON.stringify(hotReloadSourceMap, null, 2), 'utf-8', - (err) => { - if (err) { - logger.debug(red, `ETS:ERROR Failed to write sourceMaps.`, reset); - } - } - ); + fs.writeFileSync(path.join(projectConfig.patchAbcPath, SOURCEMAPS), + JSON.stringify(hotReloadSourceMap, null, 2), 'utf-8'); } function handleFinishModules(modules, callback) { diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index 222bd91..ca8073a 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -81,22 +81,26 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma `${initAbcEnv().join(' ')} "@${filesInfoPath}" --npm-module-entry-list "${npmEntriesInfoPath}" --cache-file "${cacheFilePath}" --output "${outputABCPath}" --file-threads "${fileThreads}"`; logger.debug('gen abc cmd is: ', genAbcCmd); try { - const child = childProcess.exec(genAbcCmd); - child.on('exit', (code: any) => { - if (code === 1) { - logger.debug(red, "ETS:ERROR failed to execute es2abc", reset); - process.exit(FAIL); - } - }); + if (process.env.watchMode === 'true') { + childProcess.execSync(genAbcCmd); + } else { + const child = childProcess.exec(genAbcCmd); + child.on('exit', (code: any) => { + if (code === 1) { + logger.debug(red, "ETS:ERROR failed to execute es2abc", reset); + process.exit(FAIL); + } + }); - child.on('error', (err: any) => { - logger.debug(red, err.toString(), reset); - process.exit(FAIL); - }); + child.on('error', (err: any) => { + logger.debug(red, err.toString(), reset); + process.exit(FAIL); + }); - child.stderr.on('data', (data: any) => { - logger.debug(red, data.toString(), reset); - }); + child.stderr.on('data', (data: any) => { + logger.debug(red, data.toString(), reset); + }); + } } catch (e) { logger.debug(red, `ETS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); process.exit(FAIL); -- Gitee From 377b2c13e7161aaec6d033243b96f4e6d9423a4a Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 11 Oct 2022 16:04:25 +0800 Subject: [PATCH 068/379] houhaoyu@huawei.com fix variable Signed-off-by: houhaoyu Change-Id: Ib4b04741194a404cdc9ae07dd80479c5c46c84b3 --- compiler/server/build_pipe_server.js | 5 +++-- compiler/src/pre_define.ts | 2 ++ compiler/src/process_component_build.ts | 12 ++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index b22b934..cde4873 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -132,8 +132,9 @@ function handlePluginCompileComponent(jsonData) { const fastPreview = function build(){ ${receivedMsg.data.script} }.bind(context); + fastPreview(); } - quickPreview(GetRootView(${receivedMsg.data.viewID}))` + quickPreview(GetRootView().findChildByIdForPreview(${receivedMsg.data.viewID}))` } callEs2abc(receivedMsg); } @@ -280,4 +281,4 @@ function matchMessage(message, nameArr, reg) { module.exports = { init -}; \ No newline at end of file +}; diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index e0397bf..4784e86 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -78,6 +78,8 @@ export const PREVIEW_COMPONENT_FUNCTION_NAME: string = 'previewComponent'; export const GET_PREVIEW_FLAG_FUNCTION_NAME: string = 'getPreviewComponentFlag'; export const COMPONENT_DECORATOR_NAME_COMPONENT: string = 'Component'; +export const XCOMPONENT_SINGLE_QUOTATION: string = `'component'`; +export const XCOMPONENT_DOUBLE_QUOTATION: string = `"component"`; export const COMPONENT_DECORATOR_NAME_CUSTOMDIALOG: string = 'CustomDialog'; export const CUSTOM_DECORATOR_NAME: Set = new Set([ COMPONENT_DECORATOR_NAME_COMPONENT, COMPONENT_DECORATOR_NAME_CUSTOMDIALOG diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 31f3663..32b161b 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -88,7 +88,10 @@ import { GLOBAL_THIS, IFELSEBRANCHUPDATEFUNCTION, CARD_ENABLE_COMPONENTS, - CARD_LOG_TYPE_COMPONENTS + CARD_LOG_TYPE_COMPONENTS, + RESOURCE_NAME_TYPE, + XCOMPONENT_SINGLE_QUOTATION, + XCOMPONENT_DOUBLE_QUOTATION } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -1323,9 +1326,10 @@ function checkContainer(name: string, node: ts.Node): boolean { function checkComponentType(properties: ts.PropertyAssignment[]): boolean { let flag: boolean = false; properties.forEach(item => { - if (item.name && ts.isIdentifier(item.name) && item.name.getText() === 'type' && item.initializer && - ts.isStringLiteral(item.initializer) && - (item.initializer.getText() == '"component"' || item.initializer.getText() == "'component'")) { + if (item.name && ts.isIdentifier(item.name) && item.name.getText() === RESOURCE_NAME_TYPE && + item.initializer && ts.isStringLiteral(item.initializer) && + (item.initializer.getText() == XCOMPONENT_SINGLE_QUOTATION || + item.initializer.getText() == XCOMPONENT_DOUBLE_QUOTATION)) { flag = true; } }) -- Gitee From c111020d89cf6289bfe58ee6cdc2ec9c9e66cc25 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 12 Oct 2022 16:00:02 +0800 Subject: [PATCH 069/379] houhaoyu@huawei.com fix partal update builder bug Signed-off-by: houhaoyu Change-Id: I25023106df555e998da6e56cbba927006dc838ab --- compiler/src/process_component_build.ts | 107 +++++++++++++---------- compiler/src/process_component_member.ts | 10 +-- compiler/src/process_custom_component.ts | 30 +++---- compiler/src/process_ui_syntax.ts | 3 +- 4 files changed, 82 insertions(+), 68 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 31f3663..bd4b56b 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -88,7 +88,8 @@ import { GLOBAL_THIS, IFELSEBRANCHUPDATEFUNCTION, CARD_ENABLE_COMPONENTS, - CARD_LOG_TYPE_COMPONENTS + CARD_LOG_TYPE_COMPONENTS, + COMPONENT_CONSTRUCTOR_PARENT } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -148,11 +149,11 @@ export function processComponentBuild(node: ts.MethodDeclaration, } export function processComponentBlock(node: ts.Block, isLazy: boolean, log: LogInfo[], - isTransition: boolean = false, isInnerBuilder: boolean = false, parent: string = undefined, - forEachParameters: ts.NodeArray = undefined): ts.Block { + isTransition: boolean = false, isBuilder: boolean = false, parent: string = undefined, + forEachParameters: ts.NodeArray = undefined, isGlobalBuilder: boolean = false): ts.Block { const newStatements: ts.Statement[] = []; - processComponentChild(node, newStatements, log, - {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, isInnerBuilder, parent, forEachParameters); + processComponentChild(node, newStatements, log, {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, + isBuilder, parent, forEachParameters, isGlobalBuilder); if (isLazy && !partialUpdateConfig.partialUpdateMode) { newStatements.unshift(createRenderingInProgress(true)); } @@ -252,8 +253,8 @@ let sourceNode: ts.SourceFile; export function processComponentChild(node: ts.Block | ts.SourceFile, newStatements: ts.Statement[], log: LogInfo[], supplement: supplementType = {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, - isInnerBuilder: boolean = false, parent: string = undefined, - forEachParameters: ts.NodeArray = undefined): void { + isBuilder: boolean = false, parent: string = undefined, + forEachParameters: ts.NodeArray = undefined, isGlobalBuilder: boolean = false): void { if (supplement.isAcceleratePreview) { newsupplement = supplement; const compilerOptions = ts.readConfigFile( @@ -277,7 +278,7 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme if (ts.isIdentifier(etsExpression.expression)) { parent = etsExpression.expression.escapedText.toString(); } - processInnerComponent(item, newStatements, log, parent); + processInnerComponent(item, newStatements, log, parent, isGlobalBuilder); break; case ComponentType.customComponent: parent = undefined; @@ -289,15 +290,15 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme item = expressionResult; } } - processCustomComponent(item as ts.ExpressionStatement, newStatements, log, name, isInnerBuilder); + processCustomComponent(item as ts.ExpressionStatement, newStatements, log, name, isBuilder); } break; case ComponentType.forEachComponent: parent = undefined; if (!partialUpdateConfig.partialUpdateMode) { - processForEachComponent(item, newStatements, log, isInnerBuilder); + processForEachComponent(item, newStatements, log, isBuilder); } else { - processForEachComponentNew(item, newStatements, log); + processForEachComponentNew(item, newStatements, log, isGlobalBuilder); } break; case ComponentType.customBuilderMethod: @@ -318,7 +319,7 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme break; } } else if (ts.isIfStatement(item)) { - processIfStatement(item, newStatements, log, isInnerBuilder); + processIfStatement(item, newStatements, log, isBuilder, isGlobalBuilder); } else if (!ts.isBlock(item)) { log.push({ type: LogType.ERROR, @@ -419,7 +420,7 @@ function parseEtsComponentExpression(node: ts.ExpressionStatement): EtsComponent } function processInnerComponent(node: ts.ExpressionStatement, innerCompStatements: ts.Statement[], - log: LogInfo[], parent: string = undefined): void { + log: LogInfo[], parent: string = undefined, isGlobalBuilder: boolean = false): void { const newStatements: ts.Statement[] = []; const res: CreateResult = createComponent(node, COMPONENT_CREATE_FUNCTION); newStatements.push(res.newNode); @@ -428,14 +429,15 @@ function processInnerComponent(node: ts.ExpressionStatement, innerCompStatements if (partialUpdateConfig.partialUpdateMode && ItemComponents.includes(nameResult.name)) { processItemComponent(node, nameResult, innerCompStatements, log); } else if (partialUpdateConfig.partialUpdateMode && TABCONTENT_COMPONENT.includes(nameResult.name)) { - processTabContent(node, innerCompStatements, log); + processTabContent(node, innerCompStatements, log, isGlobalBuilder); } else { - processNormalComponent(node, nameResult, innerCompStatements, log, parent); + processNormalComponent(node, nameResult, innerCompStatements, log, parent, isGlobalBuilder); } } function processNormalComponent(node: ts.ExpressionStatement, nameResult: NameResult, - innerCompStatements: ts.Statement[], log: LogInfo[], parent: string = undefined): void { + innerCompStatements: ts.Statement[], log: LogInfo[], parent: string = undefined, + isGlobalBuilder: boolean = false): void { const newStatements: ts.Statement[] = []; const res: CreateResult = createComponent(node, COMPONENT_CREATE_FUNCTION); newStatements.push(res.newNode); @@ -458,12 +460,12 @@ function processNormalComponent(node: ts.ExpressionStatement, nameResult: NameRe if (etsComponentResult.hasAttr) { bindComponentAttr(node, res.identifierNode, newStatements, log); } - processInnerCompStatements(innerCompStatements, newStatements, node); + processInnerCompStatements(innerCompStatements, newStatements, node, isGlobalBuilder); processComponentChild(etsComponentResult.etsComponentNode.body, innerCompStatements, log, - {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, false, parent); + {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, false, parent, undefined, isGlobalBuilder); } else { bindComponentAttr(node, res.identifierNode, newStatements, log); - processInnerCompStatements(innerCompStatements, newStatements, node); + processInnerCompStatements(innerCompStatements, newStatements, node, isGlobalBuilder); } if (res.isContainerComponent || res.needPop) { innerCompStatements.push(createComponent(node, COMPONENT_POP_FUNCTION).newNode); @@ -501,20 +503,27 @@ function processDebug(node: ts.Statement, nameResult: NameResult, newStatements: function processInnerCompStatements( innerCompStatements: ts.Statement[], newStatements: ts.Statement[], - node: ts.Statement + node: ts.Statement, + isGlobalBuilder: boolean = false ): void { if (!partialUpdateConfig.partialUpdateMode) { innerCompStatements.push(...newStatements); } else { - innerCompStatements.push(createComponentCreationStatement(node, newStatements)); + innerCompStatements.push(createComponentCreationStatement(node, newStatements, isGlobalBuilder)); } } -function createComponentCreationStatement(node: ts.Statement, innerStatements: ts.Statement[]): ts.Statement { +function createComponentCreationStatement(node: ts.Statement, innerStatements: ts.Statement[], + isGlobalBuilder: boolean = false): ts.Statement { return ts.factory.createExpressionStatement( ts.factory.createCallExpression( ts.factory.createPropertyAccessExpression( - ts.factory.createThis(), + isGlobalBuilder ? ts.factory.createConditionalExpression( + ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), + ts.factory.createToken(ts.SyntaxKind.QuestionToken), + ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), + ts.factory.createToken(ts.SyntaxKind.ColonToken), ts.factory.createThis() + ) : ts.factory.createThis(), ts.factory.createIdentifier(OBSERVECOMPONENTCREATION) ), undefined, [ts.factory.createArrowFunction(undefined, undefined, @@ -849,7 +858,8 @@ function createObservedDeepRender( ); } -function processTabContent(node: ts.ExpressionStatement, innerCompStatements: ts.Statement[], log: LogInfo[]): void { +function processTabContent(node: ts.ExpressionStatement, innerCompStatements: ts.Statement[], + log: LogInfo[], isGlobalBuilder: boolean = false): void { const TabContentComp: ts.EtsComponentExpression = getEtsComponentExpression(node); const TabContentBody: ts.Block = TabContentComp.body; let tabContentCreation: ts.Statement; @@ -867,13 +877,13 @@ function processTabContent(node: ts.ExpressionStatement, innerCompStatements: ts ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), ts.factory.createBlock([...newTabContentChildren], true))])); bindComponentAttr(node, ts.factory.createIdentifier(TABCONTENT_COMPONENT), tabAttrs, log); - processInnerCompStatements(innerCompStatements, [tabContentCreation, ...tabAttrs], node); + processInnerCompStatements(innerCompStatements, [tabContentCreation, ...tabAttrs], node, isGlobalBuilder); } else { tabContentCreation = ts.factory.createExpressionStatement(ts.factory.createCallExpression( ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(TABCONTENT_COMPONENT), ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION)), undefined, [])); bindComponentAttr(node, ts.factory.createIdentifier(TABCONTENT_COMPONENT), tabAttrs, log); - processInnerCompStatements(innerCompStatements, [tabContentCreation, ...tabAttrs], node); + processInnerCompStatements(innerCompStatements, [tabContentCreation, ...tabAttrs], node, isGlobalBuilder); } innerCompStatements.push(tabContentPop); } @@ -889,7 +899,7 @@ function getRealNodePos(node: ts.Node): number { } function processForEachComponent(node: ts.ExpressionStatement, newStatements: ts.Statement[], - log: LogInfo[], isInnerBuilder: boolean = false): void { + log: LogInfo[], isBuilder: boolean = false): void { const popNode: ts.ExpressionStatement = ts.factory.createExpressionStatement(createFunction( // @ts-ignore node.expression.expression as ts.Identifier, @@ -908,7 +918,7 @@ function processForEachComponent(node: ts.ExpressionStatement, newStatements: ts } argumentsArray.splice(0, 1, arrayObserveredObject); const newArrowNode: ts.ArrowFunction = - processForEachBlock(node.expression, log, isInnerBuilder) as ts.ArrowFunction; + processForEachBlock(node.expression, log, isBuilder) as ts.ArrowFunction; if (newArrowNode) { argumentsArray.splice(1, 1, newArrowNode); } @@ -919,7 +929,7 @@ function processForEachComponent(node: ts.ExpressionStatement, newStatements: ts } function processForEachComponentNew(node: ts.ExpressionStatement, newStatements: ts.Statement[], - log: LogInfo[]): void { + log: LogInfo[], isGlobalBuilder: boolean = false): void { const newForEachStatements: ts.Statement[] = []; const popNode: ts.ExpressionStatement = ts.factory.createExpressionStatement(createFunction( (node.expression as ts.CallExpression).expression as ts.Identifier, @@ -931,7 +941,7 @@ function processForEachComponentNew(node: ts.ExpressionStatement, newStatements: node.expression.expression as ts.Identifier, ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION)), undefined, [])); const newArrowNode: ts.NodeArray = - processForEachBlock(node.expression, log) as ts.NodeArray; + processForEachBlock(node.expression, log, false, isGlobalBuilder) as ts.NodeArray; const itemGenFunctionStatement: ts.VariableStatement = createItemGenFunctionStatement(node.expression, argumentsArray, newArrowNode); const itemIdFuncStatement: ts.VariableStatement = createItemIdFuncStatement(node.expression, argumentsArray); @@ -1086,7 +1096,7 @@ function addForEachId(node: ts.ExpressionStatement): ts.ExpressionStatement { } function processForEachBlock(node: ts.CallExpression, log: LogInfo[], - isInnerBuilder: boolean = false): ts.NodeArray | ts.ArrowFunction { + isBuilder: boolean = false, isGlobalBuilder: boolean = false): ts.NodeArray | ts.ArrowFunction { if (node.arguments.length > 1 && ts.isArrowFunction(node.arguments[1])) { const isLazy: boolean = node.expression.getText() === COMPONENT_LAZYFOREACH; const arrowNode: ts.ArrowFunction = node.arguments[1] as ts.ArrowFunction; @@ -1106,7 +1116,8 @@ function processForEachBlock(node: ts.CallExpression, log: LogInfo[], return ts.factory.updateArrowFunction( arrowNode, arrowNode.modifiers, arrowNode.typeParameters, arrowNode.parameters, arrowNode.type, arrowNode.equalsGreaterThanToken, - processComponentBlock(blockNode, isLazy, log, false, false, undefined, arrowNode.parameters)); + processComponentBlock(blockNode, isLazy, log, false, false, undefined, + arrowNode.parameters, isGlobalBuilder)); } else { return processComponentBlock(blockNode, isLazy, log).statements; } @@ -1115,7 +1126,7 @@ function processForEachBlock(node: ts.CallExpression, log: LogInfo[], return ts.factory.updateArrowFunction( arrowNode, arrowNode.modifiers, arrowNode.typeParameters, arrowNode.parameters, arrowNode.type, arrowNode.equalsGreaterThanToken, - processComponentBlock(body, isLazy, log, false, isInnerBuilder, undefined, arrowNode.parameters)); + processComponentBlock(body, isLazy, log, false, isBuilder, undefined, arrowNode.parameters)); } else { return processComponentBlock(body, isLazy, log).statements; } @@ -1136,9 +1147,9 @@ function createRenderingInProgress(isTrue: boolean): ts.ExpressionStatement { } function processIfStatement(node: ts.IfStatement, newStatements: ts.Statement[], - log: LogInfo[], isInnerBuilder: boolean = false): void { + log: LogInfo[], isBuilder: boolean = false, isGlobalBuilder: boolean = false): void { const ifCreate: ts.ExpressionStatement = createIfCreate(); - const newIfNode: ts.IfStatement = processInnerIfStatement(node, 0, log, isInnerBuilder); + const newIfNode: ts.IfStatement = processInnerIfStatement(node, 0, log, isBuilder, isGlobalBuilder); const ifPop: ts.ExpressionStatement = createIfPop(); if (!partialUpdateConfig.partialUpdateMode) { newStatements.push(ifCreate, newIfNode, ifPop); @@ -1148,7 +1159,7 @@ function processIfStatement(node: ts.IfStatement, newStatements: ts.Statement[], } function processInnerIfStatement(node: ts.IfStatement, id: number, log: LogInfo[], - isInnerBuilder: boolean = false): ts.IfStatement { + isBuilder: boolean = false, isGlobalBuilder: boolean = false): ts.IfStatement { if (ts.isIdentifier(node.expression) && node.expression.originalKeywordKind === undefined && !node.expression.escapedText) { log.push({ @@ -1159,15 +1170,15 @@ function processInnerIfStatement(node: ts.IfStatement, id: number, log: LogInfo[ node = ts.factory.updateIfStatement(node, ts.factory.createIdentifier(COMPONENT_IF_UNDEFINED), node.thenStatement, node.elseStatement); } - const newThenStatement: ts.Statement = processThenStatement(node.thenStatement, id, log, isInnerBuilder); - const newElseStatement: ts.Statement = processElseStatement(node.elseStatement, id, log, isInnerBuilder); + const newThenStatement: ts.Statement = processThenStatement(node.thenStatement, id, log, isBuilder, isGlobalBuilder); + const newElseStatement: ts.Statement = processElseStatement(node.elseStatement, id, log, isBuilder, isGlobalBuilder); const newIfNode: ts.IfStatement = ts.factory.updateIfStatement( node, node.expression, newThenStatement, newElseStatement); return newIfNode; } function processThenStatement(thenStatement: ts.Statement, id: number, - log: LogInfo[], isInnerBuilder: boolean = false): ts.Statement { + log: LogInfo[], isBuilder: boolean = false, isGlobalBuilder: boolean = false): ts.Statement { if (ts.isExpressionStatement(thenStatement) && ts.isIdentifier(thenStatement.expression) && thenStatement.expression.originalKeywordKind === undefined && !thenStatement.expression.escapedText) { @@ -1179,9 +1190,9 @@ function processThenStatement(thenStatement: ts.Statement, id: number, } if (thenStatement) { if (ts.isBlock(thenStatement)) { - thenStatement = processIfBlock(thenStatement, id, log, isInnerBuilder); + thenStatement = processIfBlock(thenStatement, id, log, isBuilder, isGlobalBuilder); } else if (ts.isIfStatement(thenStatement)) { - thenStatement = processInnerIfStatement(thenStatement, 0, log, isInnerBuilder); + thenStatement = processInnerIfStatement(thenStatement, 0, log, isBuilder, isGlobalBuilder); thenStatement = ts.factory.createBlock( partialUpdateConfig.partialUpdateMode ? [createIfCreate(), createIfBranchFunc(id, [thenStatement]), createIfPop()] @@ -1190,22 +1201,22 @@ function processThenStatement(thenStatement: ts.Statement, id: number, ); } else { thenStatement = ts.factory.createBlock([thenStatement], true); - thenStatement = processIfBlock(thenStatement as ts.Block, id, log, isInnerBuilder); + thenStatement = processIfBlock(thenStatement as ts.Block, id, log, isBuilder, isGlobalBuilder); } } return thenStatement; } function processElseStatement(elseStatement: ts.Statement, id: number, - log: LogInfo[], isInnerBuilder: boolean = false): ts.Statement { + log: LogInfo[], isBuilder: boolean = false, isGlobalBuilder: boolean = false): ts.Statement { if (elseStatement) { if (ts.isBlock(elseStatement)) { elseStatement = processIfBlock(elseStatement, id + 1, log); } else if (ts.isIfStatement(elseStatement)) { - elseStatement = processInnerIfStatement(elseStatement, id + 1, log, isInnerBuilder); + elseStatement = processInnerIfStatement(elseStatement, id + 1, log, isBuilder, isGlobalBuilder); } else { elseStatement = ts.factory.createBlock([elseStatement], true); - elseStatement = processIfBlock(elseStatement as ts.Block, id + 1, log, isInnerBuilder); + elseStatement = processIfBlock(elseStatement as ts.Block, id + 1, log, isBuilder, isGlobalBuilder); } } else if (partialUpdateConfig.partialUpdateMode && id === 0) { elseStatement = ts.factory.createBlock( @@ -1227,8 +1238,10 @@ function processElseStatement(elseStatement: ts.Statement, id: number, return elseStatement; } -function processIfBlock(block: ts.Block, id: number, log: LogInfo[], isInnerBuilder: boolean = false): ts.Block { - return addIfBranchId(id, processComponentBlock(block, false, log, false, isInnerBuilder)); +function processIfBlock(block: ts.Block, id: number, log: LogInfo[], isBuilder: boolean = false, + isGlobalBuilder: boolean = false): ts.Block { + return addIfBranchId(id, + processComponentBlock(block, false, log, false, isBuilder, undefined, undefined, isGlobalBuilder)); } function addIfBranchId(id: number, container: ts.Block): ts.Block { diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index a4d0a09..20a7c34 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -649,14 +649,14 @@ export function createViewCreate(node: ts.NewExpression | ts.Identifier): ts.Cal } export function createCustomComponentNewExpression(node: ts.CallExpression, name: string, - isInnerBuilder: boolean = false): ts.NewExpression { + isBuilder: boolean = false): ts.NewExpression { const newNode: ts.NewExpression = ts.factory.createNewExpression(node.expression, node.typeArguments, node.arguments.length ? node.arguments : []); - return addCustomComponentId(newNode, name, isInnerBuilder); + return addCustomComponentId(newNode, name, isBuilder); } function addCustomComponentId(node: ts.NewExpression, componentName: string, - isInnerBuilder: boolean = false): ts.NewExpression { + isBuilder: boolean = false): ts.NewExpression { for (const item of componentCollection.customComponents) { componentInfo.componentNames.add(item); } @@ -671,11 +671,11 @@ function addCustomComponentId(node: ts.NewExpression, componentName: string, } if (!partialUpdateConfig.partialUpdateMode) { ++componentInfo.id; - argumentsArray.unshift(isInnerBuilder ? ts.factory.createBinaryExpression( + argumentsArray.unshift(isBuilder ? ts.factory.createBinaryExpression( ts.factory.createStringLiteral(path.basename(transformLog.sourceFile.fileName, EXTNAME_ETS) + '_'), ts.factory.createToken(ts.SyntaxKind.PlusToken), ts.factory.createIdentifier(_GENERATE_ID)) : ts.factory.createStringLiteral(componentInfo.id.toString()), - isInnerBuilder ? ts.factory.createConditionalExpression( + isBuilder ? ts.factory.createConditionalExpression( ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), ts.factory.createToken(ts.SyntaxKind.QuestionToken), ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 4f18d7b..b64b8a4 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -85,14 +85,14 @@ const decoractorMap: Map>> = new Map( [COMPONENT_OBJECT_LINK_DECORATOR, objectLinkCollection]]); export function processCustomComponent(node: ts.ExpressionStatement, newStatements: ts.Statement[], - log: LogInfo[], name: string, isInnerBuilder: boolean = false): void { + log: LogInfo[], name: string, isBuilder: boolean = false): void { const componentNode: ts.CallExpression = getCustomComponentNode(node); if (componentNode) { const hasChainCall: boolean = componentNode.parent && ts.isPropertyAccessExpression(componentNode.parent); let ischangeNode: boolean = false; let customComponentNewExpression: ts.NewExpression = createCustomComponentNewExpression( - componentNode, name, isInnerBuilder); + componentNode, name, isBuilder); let argumentsArray: ts.PropertyAssignment[]; if (isHasChild(componentNode)) { // @ts-ignore @@ -110,7 +110,7 @@ export function processCustomComponent(node: ts.ExpressionStatement, newStatemen ts.factory.createNewExpression(componentNode.expression, componentNode.typeArguments, [ts.factory.createObjectLiteralExpression(argumentsArray, true)])); customComponentNewExpression = createCustomComponentNewExpression( - newNode.expression as ts.CallExpression, name, isInnerBuilder); + newNode.expression as ts.CallExpression, name, isBuilder); } } if (hasChainCall) { @@ -120,7 +120,7 @@ export function processCustomComponent(node: ts.ExpressionStatement, newStatemen bindComponentAttr(node, ts.factory.createIdentifier(COMPONENT_COMMON), newStatements, log); } addCustomComponent(node, newStatements, customComponentNewExpression, log, name, componentNode, - isInnerBuilder); + isBuilder); if (hasChainCall) { newStatements.push(ts.factory.createExpressionStatement( createFunction(ts.factory.createIdentifier(COMPONENT_COMMON), @@ -152,20 +152,20 @@ function changeNodeFromCallToArrow(node: ts.CallExpression): ts.ArrowFunction { function addCustomComponent(node: ts.ExpressionStatement, newStatements: ts.Statement[], newNode: ts.NewExpression, log: LogInfo[], name: string, componentNode: ts.CallExpression, - isInnerBuilder: boolean = false): void { + isBuilder: boolean = false): void { if (ts.isNewExpression(newNode)) { const propertyArray: ts.ObjectLiteralElementLike[] = []; validateCustomComponentPrams(componentNode, name, propertyArray, log); - addCustomComponentStatements(node, newStatements, newNode, name, propertyArray, isInnerBuilder); + addCustomComponentStatements(node, newStatements, newNode, name, propertyArray, isBuilder); } } function addCustomComponentStatements(node: ts.ExpressionStatement, newStatements: ts.Statement[], newNode: ts.NewExpression, name: string, props: ts.ObjectLiteralElementLike[], - isInnerBuilder: boolean = false): void { + isBuilder: boolean = false): void { if (!partialUpdateConfig.partialUpdateMode) { const id: string = componentInfo.id.toString(); - newStatements.push(createFindChildById(id, name, isInnerBuilder), createCustomComponentIfStatement(id, + newStatements.push(createFindChildById(id, name, isBuilder), createCustomComponentIfStatement(id, ts.factory.updateExpressionStatement(node, createViewCreate(newNode)), ts.factory.createObjectLiteralExpression(props, true), name)); } else { @@ -424,7 +424,7 @@ function getPropertyDecoratorKind(propertyName: string, customComponentName: str } } -function createFindChildById(id: string, name: string, isInnerBuilder: boolean = false): ts.VariableStatement { +function createFindChildById(id: string, name: string, isBuilder: boolean = false): ts.VariableStatement { return ts.factory.createVariableStatement(undefined, ts.factory.createVariableDeclarationList( [ts.factory.createVariableDeclaration(ts.factory.createIdentifier( `${CUSTOM_COMPONENT_EARLIER_CREATE_CHILD}${id}`), undefined, ts.factory.createTypeReferenceNode( @@ -432,24 +432,24 @@ function createFindChildById(id: string, name: string, isInnerBuilder: boolean = ts.factory.createConditionalExpression( ts.factory.createParenthesizedExpression( ts.factory.createBinaryExpression( - createConditionParent(isInnerBuilder), + createConditionParent(isBuilder), ts.factory.createToken(ts.SyntaxKind.AmpersandAmpersandToken), ts.factory.createPropertyAccessExpression( - createConditionParent(isInnerBuilder), + createConditionParent(isBuilder), ts.factory.createIdentifier(CUSTOM_COMPONENT_FUNCTION_FIND_CHILD_BY_ID) ))), ts.factory.createToken(ts.SyntaxKind.QuestionToken), ts.factory.createAsExpression(ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression(createConditionParent(isInnerBuilder), + ts.factory.createPropertyAccessExpression(createConditionParent(isBuilder), ts.factory.createIdentifier(`${CUSTOM_COMPONENT_FUNCTION_FIND_CHILD_BY_ID}`)), undefined, - [isInnerBuilder ? ts.factory.createCallExpression(ts.factory.createIdentifier(GENERATE_ID), + [isBuilder ? ts.factory.createCallExpression(ts.factory.createIdentifier(GENERATE_ID), undefined, []) : ts.factory.createStringLiteral(id)]), ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(name))), ts.factory.createToken(ts.SyntaxKind.ColonToken), ts.factory.createIdentifier('undefined')))], ts.NodeFlags.Let)); } -function createConditionParent(isInnerBuilder: boolean): ts.ParenthesizedExpression | ts.ThisExpression { - return isInnerBuilder ? ts.factory.createParenthesizedExpression(ts.factory.createConditionalExpression( +function createConditionParent(isBuilder: boolean): ts.ParenthesizedExpression | ts.ThisExpression { + return isBuilder ? ts.factory.createParenthesizedExpression(ts.factory.createConditionalExpression( ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), ts.factory.createToken(ts.SyntaxKind.QuestionToken), ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), ts.factory.createToken(ts.SyntaxKind.ColonToken), ts.factory.createThis())) : ts.factory.createThis(); diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 48dfa1c..6aab1c8 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -161,7 +161,8 @@ export function processUISyntax(program: ts.Program, ut = false): Function { node.parameters.push(createParentParameter()); node = ts.factory.updateFunctionDeclaration(node, undefined, node.modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, - processComponentBlock(node.body, false, transformLog.errors, false, true, node.name.getText())); + processComponentBlock(node.body, false, transformLog.errors, false, true, + node.name.getText(), undefined, true)); } else if (hasDecorator(node, COMPONENT_STYLES_DECORATOR)) { if (node.parameters.length === 0) { node = undefined; -- Gitee From 740de279882dfdc116747e45ac1258a39012156f Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Thu, 13 Oct 2022 20:14:41 +0800 Subject: [PATCH 070/379] houhaoyu@huawei.com this->parent Signed-off-by: houhaoyu Change-Id: Ia15addab1ee089b7d6c7d6e79239f0b62da187c8 --- compiler/src/process_component_build.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 7bcacca..bdeb622 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -520,13 +520,8 @@ function createComponentCreationStatement(node: ts.Statement, innerStatements: t isGlobalBuilder: boolean = false): ts.Statement { return ts.factory.createExpressionStatement( ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression( - isGlobalBuilder ? ts.factory.createConditionalExpression( - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), - ts.factory.createToken(ts.SyntaxKind.QuestionToken), - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), - ts.factory.createToken(ts.SyntaxKind.ColonToken), ts.factory.createThis() - ) : ts.factory.createThis(), + ts.factory.createPropertyAccessExpression(isGlobalBuilder ? + ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT) : ts.factory.createThis(), ts.factory.createIdentifier(OBSERVECOMPONENTCREATION) ), undefined, [ts.factory.createArrowFunction(undefined, undefined, -- Gitee From cb92794ce009709981869004d635154d25898ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 14 Oct 2022 09:39:26 +0800 Subject: [PATCH 071/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/compile_info.ts | 16 +++++++++------- compiler/src/utils.ts | 11 +++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 994c651..81b7f05 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -35,7 +35,8 @@ import { import { circularFile, mkDir, - writeFileSync + writeFileSync, + parseErrorMessage } from './utils'; import { MODULE_ETS_PATH, @@ -275,9 +276,6 @@ export class ResultStates { this.mStats = stats; this.warningCount = 0; this.noteCount = 0; - if (this.mStats.compilation.errors) { - this.mErrorCount += this.mStats.compilation.errors.length; - } if (this.mStats.compilation.warnings) { this.mWarningCount = this.mStats.compilation.warnings.length; } @@ -438,10 +436,11 @@ export class ResultStates { } private printError(): void { - if (this.mErrorCount > 0) { + if (this.mStats.compilation.errors.length > 0) { const errors: Info[] = [...this.mStats.compilation.errors]; for (let index = 0; index < errors.length; index++) { if (errors[index].issue) { + this.mErrorCount++; const position: string = errors[index].issue.location ? `:${errors[index].issue.location.start.line}:${errors[index].issue.location.start.column}` : ''; @@ -450,17 +449,20 @@ export class ResultStates { logger.error(this.red, 'ETS:ERROR File: ' + location, this.reset); logger.error(this.red, detail, this.reset, '\n'); } else if (/BUILDERROR/.test(errors[index].message)) { + this.mErrorCount++; const errorMessage: string = errors[index].message.replace(/^Module Error\s*.*:\n/, '') .replace(/\(Emitted value instead of an instance of Error\) BUILD/, '') .replace(/^ERROR/, 'ETS:ERROR'); this.printErrorMessage(errorMessage, true, errors[index]); - } else if (!/TS[0-9]+:/.test(errors[index].message.toString())) { + } else if (!/TS[0-9]+:/.test(errors[index].message.toString()) && + !/Module parse failed/.test(errors[index].message.toString())) { + this.mErrorCount++; let errorMessage: string = `${errors[index].message.replace(/\[tsl\]\s*/, '') .replace(/\u001b\[.*?m/g, '').replace(/\.ets\.ts/g, '.ets').trim()}\n`; errorMessage = this.filterModuleError(errorMessage) .replace(/^ERROR in /, 'ETS:ERROR File: ').replace(/\s{6}TS/g, ' TS') .replace(/\(([0-9]+),([0-9]+)\)/, ':$1:$2'); - this.printErrorMessage(errorMessage, false, errors[index]); + this.printErrorMessage(parseErrorMessage(errorMessage), false, errors[index]); } } } diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 12cd91d..2641809 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -617,4 +617,15 @@ export function validatorCard(log: any[], type: number, pos: number, } log.push(logInfo); } +} + +export function parseErrorMessage(message: string): string { + const messageArrary: string[] = message.split('\n'); + let logContent: string = ''; + messageArrary.forEach(element => { + if (!(/^at/.test(element.trim()))) { + logContent = logContent + element + '\n'; + } + }); + return logContent; } \ No newline at end of file -- Gitee From 718b37ad972c4fce583a4bb83d1914f4a597580b Mon Sep 17 00:00:00 2001 From: hufeng Date: Fri, 14 Oct 2022 17:17:33 +0800 Subject: [PATCH 072/379] Fix debugging sourceMap info on MacOS Signed-off-by: hufeng Change-Id: I6b64c18df7b08330a5622bb63f5566f103500893 --- compiler/src/gen_abc_plugin.ts | 8 ++++---- compiler/src/gen_merged_abc.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 540f818..d52c350 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -289,7 +289,7 @@ function processNodeModulesFile(filePath: string, tempFilePath: string, buildFil moduleInfos.push(tempModuleInfo); nodeModulesFile.push(tempFilePath); } - buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath, ''))); + buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath + path.sep, ''))); } function processEtsModule(filePath: string, tempFilePath: string, buildFilePath: string, nodeModulesFile: Array, module: any): void { @@ -307,7 +307,7 @@ function processEtsModule(filePath: string, tempFilePath: string, buildFilePath: const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, false); moduleInfos.push(tempModuleInfo); } - buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath, ''))); + buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath + path.sep, ''))); } function processDtsModule(filePath: string, tempFilePath: string, buildFilePath: string, nodeModulesFile: Array, module: any): void { @@ -326,7 +326,7 @@ function processTsModule(filePath: string, tempFilePath: string, buildFilePath: const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, false); moduleInfos.push(tempModuleInfo); } - buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath, ''))); + buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath + path.sep, ''))); } function processJsModule(filePath: string, tempFilePath: string, buildFilePath: string, nodeModulesFile: Array, module: any): void { @@ -344,7 +344,7 @@ function processJsModule(filePath: string, tempFilePath: string, buildFilePath: const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, false); moduleInfos.push(tempModuleInfo); } - buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath, ''))); + buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath + path.sep, ''))); } var cachedSourceMaps: Object; diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index ca8073a..ea1004c 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -49,7 +49,7 @@ function generateCompileFilesInfo(moduleInfos: Array) { let filesInfo: string = ''; moduleInfos.forEach(info => { const moduleType: string = info.isCommonJs ? 'commonjs' : 'esm'; - const sourceFile: string = info.filePath.replace(projectConfig.projectRootPath, ''); + const sourceFile: string = info.filePath.replace(projectConfig.projectRootPath + path.sep, ''); filesInfo += `${info.tempFilePath};${info.recordName};${moduleType};${toUnixPath(sourceFile)}\n`; }); fs.writeFileSync(filesInfoPath, filesInfo, 'utf-8'); -- Gitee From 300d2a5658ff04dc7433623d490c711578bc84ff Mon Sep 17 00:00:00 2001 From: lihong Date: Fri, 14 Oct 2022 18:46:40 +0800 Subject: [PATCH 073/379] lihong67@huawei.com update storage link/prop transform in partialUpdateMode. Signed-off-by: lihong Change-Id: I53fc6bd380a9c9c094575e3f4db4d8bfc808a845 --- compiler/src/pre_define.ts | 8 +++-- compiler/src/process_component_class.ts | 40 +++++++++++++++--------- compiler/src/process_component_member.ts | 36 +++++++++++++++------ 3 files changed, 58 insertions(+), 26 deletions(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 4784e86..dd11dc5 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -332,6 +332,10 @@ export const OBSERVED_PROPERTY_ABSTRACT_PU:string = 'ObservedPropertyAbstractPU' export const COMPONENT_CONSTRUCTOR_LOCALSTORAGE_PU: string = '__localStorage'; export const COMPONENT_CONSTRUCTOR_LOCALSTORAGE_TYPE_PU: string = 'LocalStorage'; export const IFELSEBRANCHUPDATEFUNCTION = 'ifElseBranchUpdateFunction'; +export const CREATE_STORAGE_LINK = 'createStorageLink'; +export const CREATE_STORAGE_PROP = 'createStorageProp'; +export const CREATE_LOCAL_STORAGE_LINK = 'createLocalStorageLink'; +export const CREATE_LOCAL_STORAGE_PROP = 'createLocalStorageProp'; export const CARD_ENTRY_FUNCTION_NAME: string = 'loadEtsCard'; export const CARD_ENABLE_DECORATORS: Set = new Set([ @@ -341,6 +345,6 @@ export const CARD_ENABLE_COMPONENTS: Set = new Set([ 'AbilityComponent', 'PluginComponent', 'FormComponent', 'RemoteWindow', 'XComponent', 'Web', 'RichText' ]); -export const CARD_LOG_TYPE_DECORATORS = 1; -export const CARD_LOG_TYPE_COMPONENTS = 2; +export const CARD_LOG_TYPE_DECORATORS = 1; +export const CARD_LOG_TYPE_COMPONENTS = 2; export const CARD_LOG_TYPE_IMPORT = 3; \ No newline at end of file diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index 666119e..05a03d9 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -73,7 +73,9 @@ import { SYNCHED_PROPERTY_SIMPLE_TWO_WAY_PU, SYNCHED_PROPERTY_SIMPLE_ONE_WAY_PU, SYNCHED_PROPERTY_NESED_OBJECT_PU, - OBSERVED_PROPERTY_ABSTRACT_PU + OBSERVED_PROPERTY_ABSTRACT_PU, + CREATE_LOCAL_STORAGE_LINK, + CREATE_LOCAL_STORAGE_PROP } from './pre_define'; import { BUILDIN_STYLE_NAMES, @@ -308,23 +310,33 @@ function createLocalStroageCallExpression(node: ts.PropertyDeclaration, name: st parentComponentName: string): ts.CallExpression { const localStorageLink: Set = localStorageLinkCollection.get(parentComponentName).get(name); const localStorageProp: Set = localStoragePropCollection.get(parentComponentName).get(name); + let localFuncName: string; + const localValue: ts.Expression[] = [ + ts.factory.createStringLiteral(localStorageLink && !localStorageProp ? + Array.from(localStorageLink)[0] : !localStorageLink && localStorageProp ? + Array.from(localStorageProp)[0] : COMPONENT_CONSTRUCTOR_UNDEFINED), + node.initializer ? node.initializer : ts.factory.createNumericLiteral(COMPONENT_CONSTRUCTOR_UNDEFINED), + ts.factory.createThis(), ts.factory.createStringLiteral(name || COMPONENT_CONSTRUCTOR_UNDEFINED) + ]; + if (!partialUpdateConfig.partialUpdateMode) { + localFuncName = localStorageLink && !localStorageProp ? COMPONENT_SET_AND_LINK : + COMPONENT_SET_AND_PROP; + } else { + localFuncName = localStorageLink && !localStorageProp ? CREATE_LOCAL_STORAGE_LINK : + CREATE_LOCAL_STORAGE_PROP; + localValue.splice(-2, 1); + } return ts.factory.createCallExpression( ts.factory.createPropertyAccessExpression( - ts.factory.createPropertyAccessExpression( - ts.factory.createThis(), - ts.factory.createIdentifier(`${COMPONENT_CONSTRUCTOR_LOCALSTORAGE}_`) - ), - ts.factory.createIdentifier(localStorageLink && !localStorageProp ? COMPONENT_SET_AND_LINK : - COMPONENT_SET_AND_PROP) + !partialUpdateConfig.partialUpdateMode ? + ts.factory.createPropertyAccessExpression( + ts.factory.createThis(), + ts.factory.createIdentifier(`${COMPONENT_CONSTRUCTOR_LOCALSTORAGE}_`) + ) : ts.factory.createThis(), + ts.factory.createIdentifier(localFuncName) ), [node.type], - [ - ts.factory.createStringLiteral(localStorageLink && !localStorageProp ? - Array.from(localStorageLink)[0] : !localStorageLink && localStorageProp ? - Array.from(localStorageProp)[0] : COMPONENT_CONSTRUCTOR_UNDEFINED), - node.initializer ? node.initializer : ts.factory.createNumericLiteral(COMPONENT_CONSTRUCTOR_UNDEFINED), - ts.factory.createThis(), ts.factory.createStringLiteral(name || COMPONENT_CONSTRUCTOR_UNDEFINED) - ] + localValue ); } diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index a4d0a09..51172e1 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -56,10 +56,8 @@ import { COMPONENT_CONSTRUCTOR_PARENT, EXTNAME_ETS, _GENERATE_ID, - MARKDEPENDENTELEMENTSDIRTY, RMELMTID, PURGEDEPENDENCYONELMTID, - SETPROPERTYUNCHANGED, BASICDECORATORS, BASE_COMPONENT_NAME_PU, OBSERVED_PROPERTY_SIMPLE_PU, @@ -68,7 +66,10 @@ import { SYNCHED_PROPERTY_OBJECT_TWO_WAY_PU, SYNCHED_PROPERTY_SIMPLE_ONE_WAY_PU, SYNCHED_PROPERTY_NESED_OBJECT_PU, - COMPONENT_CUSTOM_DECORATOR + COMPONENT_CUSTOM_DECORATOR, + THIS, + CREATE_STORAGE_LINK, + CREATE_STORAGE_PROP } from './pre_define'; import { forbiddenUseStateType, @@ -443,9 +444,7 @@ function createVariableInitStatement(node: ts.PropertyDeclaration, decorator: st break; case COMPONENT_STORAGE_PROP_DECORATOR: case COMPONENT_STORAGE_LINK_DECORATOR: - const setFuncName: string = decorator === COMPONENT_STORAGE_PROP_DECORATOR ? - APP_STORAGE_SET_AND_PROP : APP_STORAGE_SET_AND_LINK; - updateState = updateStoragePropAndLinkProperty(node, name, setFuncName, log); + updateState = updateStoragePropAndLinkProperty(node, name, decorator, log); break; case COMPONENT_OBJECT_LINK_DECORATOR: updateState = !partialUpdateConfig.partialUpdateMode @@ -573,14 +572,31 @@ function updateSynchedPropertyOneWay(nameIdentifier: ts.Identifier, type: ts.Typ } function updateStoragePropAndLinkProperty(node: ts.PropertyDeclaration, name: ts.Identifier, - setFuncName: string, log: LogInfo[]): ts.ExpressionStatement { + decorator: string, log: LogInfo[]): ts.ExpressionStatement { if (isSingleKey(node)) { + let setFuncName: string; + let storageFuncName: string; + const storageValue: ts.Expression[] = [ + node.decorators[0].expression.arguments[0], + node.initializer, + ts.factory.createThis(), + ts.factory.createStringLiteral(name.getText()) + ]; + if (!partialUpdateConfig.partialUpdateMode) { + setFuncName = decorator === COMPONENT_STORAGE_PROP_DECORATOR ? + APP_STORAGE_SET_AND_PROP : APP_STORAGE_SET_AND_LINK; + storageFuncName = APP_STORAGE; + } else { + setFuncName = decorator === COMPONENT_STORAGE_PROP_DECORATOR ? + CREATE_STORAGE_PROP : CREATE_STORAGE_LINK; + storageFuncName = THIS; + storageValue.splice(2, 1); + } return ts.factory.createExpressionStatement(ts.factory.createBinaryExpression( createPropertyAccessExpressionWithThis(`__${name.getText()}`), ts.factory.createToken(ts.SyntaxKind.EqualsToken), ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(APP_STORAGE), - ts.factory.createIdentifier(setFuncName)), undefined, [node.decorators[0].expression.arguments[0], - node.initializer, ts.factory.createThis(), ts.factory.createStringLiteral(name.getText())]))); + ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(storageFuncName), + ts.factory.createIdentifier(setFuncName)), undefined, storageValue))); } else { validateAppStorageDecoractorsNonSingleKey(node, log); } -- Gitee From 10f93f1d94478259d5f095bf13c9c790e22aa06f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 17 Oct 2022 14:29:55 +0800 Subject: [PATCH 074/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/server/build_pipe_server.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index cde4873..e1fb523 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -67,7 +67,11 @@ function init(port) { rootFileNames.push(previewCacheFilePath); ts.createWatchProgram( createWatchCompilerHost(rootFileNames, resolveDiagnostic, delayPrintLogCount, true)); - const wss = new WebSocketServer({port: port}); + const wss = new WebSocketServer({ + port: port, + host: '127.0.0.1', + backlog: 5 + }); wss.on('connection', function(ws) { pluginSocket = ws; handlePluginConnect(ws); -- Gitee From 1799f5dbf6a3a20b306ac92f9ccdace369560f08 Mon Sep 17 00:00:00 2001 From: yfwang6 Date: Mon, 17 Oct 2022 15:06:33 +0800 Subject: [PATCH 075/379] wangyongfei6@huawei.com update ut for partialUpdate Signed-off-by: yfwang6 Change-Id: I6cafdc584ccf37f0210840011b71d37a91a987d1 --- .../utForPartialUpdate/import/importAllEts.ts | 233 +++++++ .../utForPartialUpdate/import/importEts.ts | 306 +++++++++ .../import/importExportEts.ts | 172 +++++ .../import/importExportNest.ts | 260 ++++++++ .../utForPartialUpdate/import/importTs.ts | 172 +++++ .../$$_component/$$_component.ts | 299 +++++++++ .../gesture_component/longPressGesture.ts | 110 +++ .../gesture_component/panGestrue.ts | 142 ++++ .../gesture_component/pinchGesture.ts | 116 ++++ .../gesture_component/rotationGesture.ts | 116 ++++ .../gesture_component/swipeGesture.ts | 128 ++++ .../gesture_component/tapGesture.ts | 112 ++++ .../simple_component/button/button.ts | 137 ++++ .../animateTo/animateTo.ts | 215 ++++++ .../pageTransition/pageTransition.ts | 177 +++++ .../render_decorator/@builder/@builder.ts | 625 ++++++++++++++++++ .../@builder/@builderWithLinkData.ts | 131 ++++ .../@builderParam/@builderParam.ts | 374 +++++++++++ .../@customDialog/@customDialog.ts | 375 +++++++++++ .../render_decorator/@extend/@extend.ts | 164 +++++ .../render_decorator/@preview/@preview.ts | 112 ++++ .../render_decorator/@styles/@styles.ts | 154 +++++ .../render_decorator/@styles/@stylesExport.ts | 158 +++++ .../@storageLink/@storageLink.ts | 136 ++++ .../@storageProp/@storageProp.ts | 136 ++++ .../appStorage/appStorage.ts | 136 ++++ .../localStorage/localStorage.ts | 117 ++++ .../@consume_@provide/@consume_@provide.ts | 227 +++++++ .../@observed_@objectLink.ts | 196 ++++++ .../others/@watch/@watch.ts | 218 ++++++ 30 files changed, 5954 insertions(+) create mode 100644 compiler/test/utForPartialUpdate/import/importAllEts.ts create mode 100644 compiler/test/utForPartialUpdate/import/importEts.ts create mode 100644 compiler/test/utForPartialUpdate/import/importExportEts.ts create mode 100644 compiler/test/utForPartialUpdate/import/importExportNest.ts create mode 100644 compiler/test/utForPartialUpdate/import/importTs.ts create mode 100644 compiler/test/utForPartialUpdate/inner_component_transform/$$_component/$$_component.ts create mode 100644 compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/longPressGesture.ts create mode 100644 compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/panGestrue.ts create mode 100644 compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/pinchGesture.ts create mode 100644 compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/rotationGesture.ts create mode 100644 compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/swipeGesture.ts create mode 100644 compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/tapGesture.ts create mode 100644 compiler/test/utForPartialUpdate/inner_component_transform/simple_component/button/button.ts create mode 100644 compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts create mode 100644 compiler/test/utForPartialUpdate/inner_component_transform/transition_component/pageTransition/pageTransition.ts create mode 100644 compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts create mode 100644 compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts create mode 100644 compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts create mode 100644 compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts create mode 100644 compiler/test/utForPartialUpdate/render_decorator/@extend/@extend.ts create mode 100644 compiler/test/utForPartialUpdate/render_decorator/@preview/@preview.ts create mode 100644 compiler/test/utForPartialUpdate/render_decorator/@styles/@styles.ts create mode 100644 compiler/test/utForPartialUpdate/render_decorator/@styles/@stylesExport.ts create mode 100644 compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts create mode 100644 compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts create mode 100644 compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts create mode 100644 compiler/test/utForPartialUpdate/ui_state_management/application_state_management/localStorage/localStorage.ts create mode 100644 compiler/test/utForPartialUpdate/ui_state_management/others/@consume_@provide/@consume_@provide.ts create mode 100644 compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts create mode 100644 compiler/test/utForPartialUpdate/ui_state_management/others/@watch/@watch.ts diff --git a/compiler/test/utForPartialUpdate/import/importAllEts.ts b/compiler/test/utForPartialUpdate/import/importAllEts.ts new file mode 100644 index 0000000..7b7837e --- /dev/null +++ b/compiler/test/utForPartialUpdate/import/importAllEts.ts @@ -0,0 +1,233 @@ +/* + * 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. + */ + +exports.source = ` +import * as AllComponent from './test/pages/NamespaceComponent' +import TsModule from './test/pages/TsModule' + +@Entry +@Component +struct ImportTest { + @State myState1: any = new TsModule(1).method() + @State myState2: number = 0 + @State myState3: boolean = false + @State myState4: string = 'ImportTest' + + build() { + Column() { + AllComponent.NamespaceComponent1({ + NamespaceComponent1Link1: $myState1, + NamespaceComponent1Link2: $myState2, + NamespaceComponent1Link3: $myState3, + NamespaceComponent1Link4: $myState4, + myVar: 100, + myVar2: 80 + }) + AllComponent.NamespaceComponent1({ + NamespaceComponent1Link1: $myState1, + NamespaceComponent1Link2: $myState2, + NamespaceComponent1Link3: $myState3, + NamespaceComponent1Link4: $myState4, + myVar: 100, + myVar2: 80 + }) + .width(100) + AllComponent.default({ + NamespaceComponent3Link1: $myState1, + NamespaceComponent3Link2: $myState2, + NamespaceComponent3Link3: $myState3, + NamespaceComponent3Link4: $myState4, + myVar: 100, + myVar2: 80 + }) + AllComponent.default({ + NamespaceComponent3Link1: $myState1, + NamespaceComponent3Link2: $myState2, + NamespaceComponent3Link3: $myState3, + NamespaceComponent3Link4: $myState4, + myVar: 100, + myVar2: 80 + }) + .height(200) + } + } +} +` + +exports.expectResult = +`"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const AllComponent = __importStar(require("./test/pages/NamespaceComponent")); +const TsModule_1 = __importDefault(require("./test/pages/TsModule")); +class ImportTest extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__myState1 = new ObservedPropertyObjectPU(new TsModule_1.default(1).method(), this, "myState1"); + this.__myState2 = new ObservedPropertySimplePU(0, this, "myState2"); + this.__myState3 = new ObservedPropertySimplePU(false, this, "myState3"); + this.__myState4 = new ObservedPropertySimplePU('ImportTest', this, "myState4"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.myState1 !== undefined) { + this.myState1 = params.myState1; + } + if (params.myState2 !== undefined) { + this.myState2 = params.myState2; + } + if (params.myState3 !== undefined) { + this.myState3 = params.myState3; + } + if (params.myState4 !== undefined) { + this.myState4 = params.myState4; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__myState1.purgeDependencyOnElmtId(rmElmtId); + this.__myState2.purgeDependencyOnElmtId(rmElmtId); + this.__myState3.purgeDependencyOnElmtId(rmElmtId); + this.__myState4.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__myState1.aboutToBeDeleted(); + this.__myState2.aboutToBeDeleted(); + this.__myState3.aboutToBeDeleted(); + this.__myState4.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get myState1() { + return this.__myState1.get(); + } + set myState1(newValue) { + this.__myState1.set(newValue); + } + get myState2() { + return this.__myState2.get(); + } + set myState2(newValue) { + this.__myState2.set(newValue); + } + get myState3() { + return this.__myState3.get(); + } + set myState3(newValue) { + this.__myState3.set(newValue); + } + get myState4() { + return this.__myState4.get(); + } + set myState4(newValue) { + this.__myState4.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new AllComponent.NamespaceComponent1(this, { + NamespaceComponent1Link1: this.__myState1, + NamespaceComponent1Link2: this.__myState2, + NamespaceComponent1Link3: this.__myState3, + NamespaceComponent1Link4: this.__myState4, + myVar: 100, + myVar2: 80 + })); + ViewStackProcessor.StopGetAccessRecording(); + } + __Common__.create(); + __Common__.width(100); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new AllComponent.NamespaceComponent1(this, { + NamespaceComponent1Link1: this.__myState1, + NamespaceComponent1Link2: this.__myState2, + NamespaceComponent1Link3: this.__myState3, + NamespaceComponent1Link4: this.__myState4, + myVar: 100, + myVar2: 80 + })); + ViewStackProcessor.StopGetAccessRecording(); + } + __Common__.pop(); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new AllComponent.default(this, { + NamespaceComponent3Link1: this.__myState1, + NamespaceComponent3Link2: this.__myState2, + NamespaceComponent3Link3: this.__myState3, + NamespaceComponent3Link4: this.__myState4, + myVar: 100, + myVar2: 80 + })); + ViewStackProcessor.StopGetAccessRecording(); + } + __Common__.create(); + __Common__.height(200); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new AllComponent.default(this, { + NamespaceComponent3Link1: this.__myState1, + NamespaceComponent3Link2: this.__myState2, + NamespaceComponent3Link3: this.__myState3, + NamespaceComponent3Link4: this.__myState4, + myVar: 100, + myVar2: 80 + })); + ViewStackProcessor.StopGetAccessRecording(); + } + __Common__.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new ImportTest(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/import/importEts.ts b/compiler/test/utForPartialUpdate/import/importEts.ts new file mode 100644 index 0000000..27d2ed5 --- /dev/null +++ b/compiler/test/utForPartialUpdate/import/importEts.ts @@ -0,0 +1,306 @@ +/* + * 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. + */ + +exports.source = ` +import +LinkComponentDefault, { + LinkComponent as LinkComponent1Ref, + LinkComponent2 as LinkComponent2Ref, + LinkComponent3 +} from './test/pages/LinkComponent' +import DefaultComponent from "./test/pages/DefaultComponent" +import AMDComponentDefault = require('./test/pages/AMDComponent') +import TsModule from './test/pages/TsModule' + +@Entry +@Component +struct ImportTest { + @State myState1: any = new TsModule(1).method() + @State myState2: number = 0 + @State myState3: boolean = false + @State myState4: string = 'ImportTest' + + build() { + Column() { + LinkComponent2Ref({ + LinkComponent2Link1: $myState1, + LinkComponent2Link2: $myState2, + LinkComponent2Link3: $myState3, + LinkComponent2Link4: $myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent2' + }) + Text('space') + .fontSize(20) + .fontColor(Color.Red) + LinkComponent1Ref({ + LinkComponent1Link1: $myState1, + LinkComponent1Link2: $myState2, + LinkComponent1Link3: $myState3, + LinkComponent1Link4: $myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent1' + }) + DefaultComponent({ + DefaultComponentLink1: $myState1, + DefaultComponentLink2: $myState2, + DefaultComponentLink3: $myState3, + DefaultComponentLink4: $myState4, + myVar: 100, + myVar2: 100 + }) + LinkComponentDefault({ + LinkComponent3Link1: $myState1, + LinkComponent3Link2: $myState2, + LinkComponent3Link3: $myState3, + LinkComponent3Link4: $myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent3' + }) + AMDComponentDefault({ + AMDComponentLink1: $myState1, + AMDComponentLink2: $myState2, + AMDComponentLink3: $myState3, + AMDComponentLink4: $myState4, + myVar: 100, + myVar2: 100 + }) + LinkComponent3({ + LinkComponent3Link1: $myState1, + LinkComponent3Link2: $myState2, + LinkComponent3Link3: $myState3, + LinkComponent3Link4: $myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent1' + }) + } + } +} +` + +exports.expectResult = +`"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const LinkComponent_1 = __importStar(require("./test/pages/LinkComponent")); +const DefaultComponent_1 = __importDefault(require("./test/pages/DefaultComponent")); +const AMDComponentDefault = require("./test/pages/AMDComponent"); +const TsModule_1 = __importDefault(require("./test/pages/TsModule")); +class ImportTest extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__myState1 = new ObservedPropertyObjectPU(new TsModule_1.default(1).method(), this, "myState1"); + this.__myState2 = new ObservedPropertySimplePU(0, this, "myState2"); + this.__myState3 = new ObservedPropertySimplePU(false, this, "myState3"); + this.__myState4 = new ObservedPropertySimplePU('ImportTest', this, "myState4"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.myState1 !== undefined) { + this.myState1 = params.myState1; + } + if (params.myState2 !== undefined) { + this.myState2 = params.myState2; + } + if (params.myState3 !== undefined) { + this.myState3 = params.myState3; + } + if (params.myState4 !== undefined) { + this.myState4 = params.myState4; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__myState1.purgeDependencyOnElmtId(rmElmtId); + this.__myState2.purgeDependencyOnElmtId(rmElmtId); + this.__myState3.purgeDependencyOnElmtId(rmElmtId); + this.__myState4.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__myState1.aboutToBeDeleted(); + this.__myState2.aboutToBeDeleted(); + this.__myState3.aboutToBeDeleted(); + this.__myState4.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get myState1() { + return this.__myState1.get(); + } + set myState1(newValue) { + this.__myState1.set(newValue); + } + get myState2() { + return this.__myState2.get(); + } + set myState2(newValue) { + this.__myState2.set(newValue); + } + get myState3() { + return this.__myState3.get(); + } + set myState3(newValue) { + this.__myState3.set(newValue); + } + get myState4() { + return this.__myState4.get(); + } + set myState4(newValue) { + this.__myState4.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new LinkComponent_1.LinkComponent2(this, { + LinkComponent2Link1: this.__myState1, + LinkComponent2Link2: this.__myState2, + LinkComponent2Link3: this.__myState3, + LinkComponent2Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent2' + })); + ViewStackProcessor.StopGetAccessRecording(); + } + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('space'); + Text.fontSize(20); + Text.fontColor(Color.Red); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new LinkComponent_1.LinkComponent(this, { + LinkComponent1Link1: this.__myState1, + LinkComponent1Link2: this.__myState2, + LinkComponent1Link3: this.__myState3, + LinkComponent1Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent1' + })); + ViewStackProcessor.StopGetAccessRecording(); + } + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new DefaultComponent_1.default(this, { + DefaultComponentLink1: this.__myState1, + DefaultComponentLink2: this.__myState2, + DefaultComponentLink3: this.__myState3, + DefaultComponentLink4: this.__myState4, + myVar: 100, + myVar2: 100 + })); + ViewStackProcessor.StopGetAccessRecording(); + } + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new LinkComponent_1.default(this, { + LinkComponent3Link1: this.__myState1, + LinkComponent3Link2: this.__myState2, + LinkComponent3Link3: this.__myState3, + LinkComponent3Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent3' + })); + ViewStackProcessor.StopGetAccessRecording(); + } + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new AMDComponentDefault(this, { + AMDComponentLink1: this.__myState1, + AMDComponentLink2: this.__myState2, + AMDComponentLink3: this.__myState3, + AMDComponentLink4: this.__myState4, + myVar: 100, + myVar2: 100 + })); + ViewStackProcessor.StopGetAccessRecording(); + } + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new LinkComponent_1.LinkComponent3(this, { + LinkComponent3Link1: this.__myState1, + LinkComponent3Link2: this.__myState2, + LinkComponent3Link3: this.__myState3, + LinkComponent3Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent1' + })); + ViewStackProcessor.StopGetAccessRecording(); + } + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new ImportTest(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/import/importExportEts.ts b/compiler/test/utForPartialUpdate/import/importExportEts.ts new file mode 100644 index 0000000..e8470fa --- /dev/null +++ b/compiler/test/utForPartialUpdate/import/importExportEts.ts @@ -0,0 +1,172 @@ +/* + * 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. + */ + +exports.source = ` +import { AllStarComponent } from './test/pages/ExportStarComponent' +import TsModule from './test/pages/TsModule' + +@Entry +@Component +struct ImportTest { + @State myState1: any = new TsModule(1).method() + @State myState2: number = 0 + @State myState3: boolean = false + @State myState4: string = 'ImportTest' + + build() { + Column() { + AllStarComponent.ExportComponent({ + ExportComponent1Link1: $myState1, + ExportComponent1Link2: $myState2, + ExportComponent1Link3: $myState3, + ExportComponent1Link4: $myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent1' + }) + AllStarComponent.default({ + ExportComponent4Link1: $myState1, + ExportComponent4Link2: $myState2, + ExportComponent4Link3: $myState3, + ExportComponent4Link4: $myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent4' + }) + } + } +} +` + +exports.expectResult = +`"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ExportStarComponent_1 = require("./test/pages/ExportStarComponent"); +const TsModule_1 = __importDefault(require("./test/pages/TsModule")); +class ImportTest extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__myState1 = new ObservedPropertyObjectPU(new TsModule_1.default(1).method(), this, "myState1"); + this.__myState2 = new ObservedPropertySimplePU(0, this, "myState2"); + this.__myState3 = new ObservedPropertySimplePU(false, this, "myState3"); + this.__myState4 = new ObservedPropertySimplePU('ImportTest', this, "myState4"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.myState1 !== undefined) { + this.myState1 = params.myState1; + } + if (params.myState2 !== undefined) { + this.myState2 = params.myState2; + } + if (params.myState3 !== undefined) { + this.myState3 = params.myState3; + } + if (params.myState4 !== undefined) { + this.myState4 = params.myState4; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__myState1.purgeDependencyOnElmtId(rmElmtId); + this.__myState2.purgeDependencyOnElmtId(rmElmtId); + this.__myState3.purgeDependencyOnElmtId(rmElmtId); + this.__myState4.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__myState1.aboutToBeDeleted(); + this.__myState2.aboutToBeDeleted(); + this.__myState3.aboutToBeDeleted(); + this.__myState4.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get myState1() { + return this.__myState1.get(); + } + set myState1(newValue) { + this.__myState1.set(newValue); + } + get myState2() { + return this.__myState2.get(); + } + set myState2(newValue) { + this.__myState2.set(newValue); + } + get myState3() { + return this.__myState3.get(); + } + set myState3(newValue) { + this.__myState3.set(newValue); + } + get myState4() { + return this.__myState4.get(); + } + set myState4(newValue) { + this.__myState4.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new ExportStarComponent_1.AllStarComponent.ExportComponent(this, { + ExportComponent1Link1: this.__myState1, + ExportComponent1Link2: this.__myState2, + ExportComponent1Link3: this.__myState3, + ExportComponent1Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent1' + })); + ViewStackProcessor.StopGetAccessRecording(); + } + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new ExportStarComponent_1.AllStarComponent.default(this, { + ExportComponent4Link1: this.__myState1, + ExportComponent4Link2: this.__myState2, + ExportComponent4Link3: this.__myState3, + ExportComponent4Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent4' + })); + ViewStackProcessor.StopGetAccessRecording(); + } + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new ImportTest(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/import/importExportNest.ts b/compiler/test/utForPartialUpdate/import/importExportNest.ts new file mode 100644 index 0000000..1378ff0 --- /dev/null +++ b/compiler/test/utForPartialUpdate/import/importExportNest.ts @@ -0,0 +1,260 @@ +/* + * 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. + */ + +exports.source = ` +import { tExtend, tStyles, DivideTest, Base } from './test/pages/ImportNestAll'; + +@Entry +@Component +struct ImportTest { + @State testText1: string = 'Hello' + @State testText2: string = 'World' + @State testText3: string = 'Test' + @State testText4: string = 'Component' + + @State testState1: string = 'Base' + @State testState2: number = 0 + @State testState3: object = { name: 'Base' } + @State testState4: number = 3 + @State testState5: number = 10 + + build() { + Column() { + Text(this.testText1) + .fontSize(50) + tExtend(20) + Text(this.testText2) + tStyles() + Button(this.testText3) + Text(this.testText4) + .fontSize(50) + + Base({ + testStr: $testState1, + testNum: $testState2, + testObj: $testState3 + }) + DivideTest({ + testNum1: $testState4, + testNum2: $testState5 + }) + } + } +} +` + +exports.expectResult = +`"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const ImportNestAll_1 = require("./test/pages/ImportNestAll"); +class ImportTest extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__testText1 = new ObservedPropertySimplePU('Hello', this, "testText1"); + this.__testText2 = new ObservedPropertySimplePU('World', this, "testText2"); + this.__testText3 = new ObservedPropertySimplePU('Test', this, "testText3"); + this.__testText4 = new ObservedPropertySimplePU('Component', this, "testText4"); + this.__testState1 = new ObservedPropertySimplePU('Base', this, "testState1"); + this.__testState2 = new ObservedPropertySimplePU(0, this, "testState2"); + this.__testState3 = new ObservedPropertyObjectPU({ name: 'Base' }, this, "testState3"); + this.__testState4 = new ObservedPropertySimplePU(3, this, "testState4"); + this.__testState5 = new ObservedPropertySimplePU(10, this, "testState5"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.testText1 !== undefined) { + this.testText1 = params.testText1; + } + if (params.testText2 !== undefined) { + this.testText2 = params.testText2; + } + if (params.testText3 !== undefined) { + this.testText3 = params.testText3; + } + if (params.testText4 !== undefined) { + this.testText4 = params.testText4; + } + if (params.testState1 !== undefined) { + this.testState1 = params.testState1; + } + if (params.testState2 !== undefined) { + this.testState2 = params.testState2; + } + if (params.testState3 !== undefined) { + this.testState3 = params.testState3; + } + if (params.testState4 !== undefined) { + this.testState4 = params.testState4; + } + if (params.testState5 !== undefined) { + this.testState5 = params.testState5; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__testText1.purgeDependencyOnElmtId(rmElmtId); + this.__testText2.purgeDependencyOnElmtId(rmElmtId); + this.__testText3.purgeDependencyOnElmtId(rmElmtId); + this.__testText4.purgeDependencyOnElmtId(rmElmtId); + this.__testState1.purgeDependencyOnElmtId(rmElmtId); + this.__testState2.purgeDependencyOnElmtId(rmElmtId); + this.__testState3.purgeDependencyOnElmtId(rmElmtId); + this.__testState4.purgeDependencyOnElmtId(rmElmtId); + this.__testState5.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__testText1.aboutToBeDeleted(); + this.__testText2.aboutToBeDeleted(); + this.__testText3.aboutToBeDeleted(); + this.__testText4.aboutToBeDeleted(); + this.__testState1.aboutToBeDeleted(); + this.__testState2.aboutToBeDeleted(); + this.__testState3.aboutToBeDeleted(); + this.__testState4.aboutToBeDeleted(); + this.__testState5.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get testText1() { + return this.__testText1.get(); + } + set testText1(newValue) { + this.__testText1.set(newValue); + } + get testText2() { + return this.__testText2.get(); + } + set testText2(newValue) { + this.__testText2.set(newValue); + } + get testText3() { + return this.__testText3.get(); + } + set testText3(newValue) { + this.__testText3.set(newValue); + } + get testText4() { + return this.__testText4.get(); + } + set testText4(newValue) { + this.__testText4.set(newValue); + } + get testState1() { + return this.__testState1.get(); + } + set testState1(newValue) { + this.__testState1.set(newValue); + } + get testState2() { + return this.__testState2.get(); + } + set testState2(newValue) { + this.__testState2.set(newValue); + } + get testState3() { + return this.__testState3.get(); + } + set testState3(newValue) { + this.__testState3.set(newValue); + } + get testState4() { + return this.__testState4.get(); + } + set testState4(newValue) { + this.__testState4.set(newValue); + } + get testState5() { + return this.__testState5.get(); + } + set testState5(newValue) { + this.__testState5.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(this.testText1); + Text.fontSize(50); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + ImportNestAll_1.tExtend(20, this); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(this.testText2); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + ImportNestAll_1.tStyles(this); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel(this.testText3); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(this.testText4); + Text.fontSize(50); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new ImportNestAll_1.Base(this, { + testStr: this.__testState1, + testNum: this.__testState2, + testObj: this.__testState3 + })); + ViewStackProcessor.StopGetAccessRecording(); + } + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new ImportNestAll_1.DivideTest(this, { + testNum1: this.__testState4, + testNum2: this.__testState5 + })); + ViewStackProcessor.StopGetAccessRecording(); + } + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new ImportTest(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/import/importTs.ts b/compiler/test/utForPartialUpdate/import/importTs.ts new file mode 100644 index 0000000..3551136 --- /dev/null +++ b/compiler/test/utForPartialUpdate/import/importTs.ts @@ -0,0 +1,172 @@ +/* + * 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. + */ + +exports.source = ` +import { AllStarComponent } from './test/pages/ExportStarComponent' +import TsModule from './test/pages/TsModule' + +@Entry +@Component +struct ImportTest { + @State myState1: any = new TsModule(1).method(); + @State myState2: number = 0 + @State myState3: boolean = false + @State myState4: string = 'ImportTest' + + build() { + Column() { + AllStarComponent.ExportComponent({ + ExportComponent1Link1: $myState1, + ExportComponent1Link2: $myState2, + ExportComponent1Link3: $myState3, + ExportComponent1Link4: $myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent1' + }) + AllStarComponent.default({ + ExportComponent4Link1: $myState1, + ExportComponent4Link2: $myState2, + ExportComponent4Link3: $myState3, + ExportComponent4Link4: $myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent4' + }) + } + } +} +` + +exports.expectResult = +`"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ExportStarComponent_1 = require("./test/pages/ExportStarComponent"); +const TsModule_1 = __importDefault(require("./test/pages/TsModule")); +class ImportTest extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__myState1 = new ObservedPropertyObjectPU(new TsModule_1.default(1).method(), this, "myState1"); + this.__myState2 = new ObservedPropertySimplePU(0, this, "myState2"); + this.__myState3 = new ObservedPropertySimplePU(false, this, "myState3"); + this.__myState4 = new ObservedPropertySimplePU('ImportTest', this, "myState4"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.myState1 !== undefined) { + this.myState1 = params.myState1; + } + if (params.myState2 !== undefined) { + this.myState2 = params.myState2; + } + if (params.myState3 !== undefined) { + this.myState3 = params.myState3; + } + if (params.myState4 !== undefined) { + this.myState4 = params.myState4; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__myState1.purgeDependencyOnElmtId(rmElmtId); + this.__myState2.purgeDependencyOnElmtId(rmElmtId); + this.__myState3.purgeDependencyOnElmtId(rmElmtId); + this.__myState4.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__myState1.aboutToBeDeleted(); + this.__myState2.aboutToBeDeleted(); + this.__myState3.aboutToBeDeleted(); + this.__myState4.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get myState1() { + return this.__myState1.get(); + } + set myState1(newValue) { + this.__myState1.set(newValue); + } + get myState2() { + return this.__myState2.get(); + } + set myState2(newValue) { + this.__myState2.set(newValue); + } + get myState3() { + return this.__myState3.get(); + } + set myState3(newValue) { + this.__myState3.set(newValue); + } + get myState4() { + return this.__myState4.get(); + } + set myState4(newValue) { + this.__myState4.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new ExportStarComponent_1.AllStarComponent.ExportComponent(this, { + ExportComponent1Link1: this.__myState1, + ExportComponent1Link2: this.__myState2, + ExportComponent1Link3: this.__myState3, + ExportComponent1Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent1' + })); + ViewStackProcessor.StopGetAccessRecording(); + } + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new ExportStarComponent_1.AllStarComponent.default(this, { + ExportComponent4Link1: this.__myState1, + ExportComponent4Link2: this.__myState2, + ExportComponent4Link3: this.__myState3, + ExportComponent4Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent4' + })); + ViewStackProcessor.StopGetAccessRecording(); + } + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new ImportTest(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/$$_component/$$_component.ts b/compiler/test/utForPartialUpdate/inner_component_transform/$$_component/$$_component.ts new file mode 100644 index 0000000..fa4c40f --- /dev/null +++ b/compiler/test/utForPartialUpdate/inner_component_transform/$$_component/$$_component.ts @@ -0,0 +1,299 @@ +/* + * 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. + */ + +exports.source = ` +const value5: boolean[] = [true, false] +let value6: {item1: boolean} = {item1: true} +let isCountDown: boolean = false + +@Entry +@Component +struct HomeComponent { + private value1: string = "hello world 1" + private value2: string = "hello world 2" + private value3: string = "hello world 3" + private value4: boolean = false + private count: number = 1000; + myTimeController: TextTimerController = new TextTimerController(); + @State format: string = "hh:mm:ss:ms" + + build() { + Column() { + Row() { + Text(this.value1) + Radio({value: "Radio", group: "1"}) + .checked($$this.value4) + } + Row() { + Button() { + Text(this.value1) + .bindPopup($$value5[0], {message: "This is $$ for Array"}) + } + .bindPopup($$this.value4, {message: "This is $$ for regular"}) + .width(100) + .height(20) + Text(this.value2) + .fontSize(100) + .bindPopup($$value6.item1, {message: "This is $$ for Obj"}) + Text(this.value3) + Radio({value: "Radio", group: "1"}) + .checked($$value5[0]) + } + .width(20) + Row(){ + TextTimer({controller: this.myTimeController, isCountDown: $$isCountDown, count: $$this.count}) + .format($$this.format) + Button("start") + .onClick(()=>{ + this.myTimeController.start(); + }) + Button("pause") + .onClick(()=>{ + this.myTimeController.pause(); + }) + Button("reset") + .onClick(()=>{ + this.myTimeController.reset(); + }) + } + } + .height(500) + } +} +` + +exports.expectResult = +`"use strict"; +const value5 = [true, false]; +let value6 = { item1: true }; +let isCountDown = false; +class HomeComponent extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.value1 = "hello world 1"; + this.value2 = "hello world 2"; + this.value3 = "hello world 3"; + this.value4 = false; + this.count = 1000; + this.myTimeController = new TextTimerController(); + this.__format = new ObservedPropertySimplePU("hh:mm:ss:ms", this, "format"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.value1 !== undefined) { + this.value1 = params.value1; + } + if (params.value2 !== undefined) { + this.value2 = params.value2; + } + if (params.value3 !== undefined) { + this.value3 = params.value3; + } + if (params.value4 !== undefined) { + this.value4 = params.value4; + } + if (params.count !== undefined) { + this.count = params.count; + } + if (params.myTimeController !== undefined) { + this.myTimeController = params.myTimeController; + } + if (params.format !== undefined) { + this.format = params.format; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__format.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.value1 = undefined; + this.value2 = undefined; + this.value3 = undefined; + this.value4 = undefined; + this.count = undefined; + this.myTimeController = undefined; + this.__format.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get format() { + return this.__format.get(); + } + set format(newValue) { + this.__format.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + Column.height(500); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(this.value1); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Radio.create({ value: "Radio", group: "1" }); + Radio.checked(this.value4, newValue => { this.value4 = newValue; }); + if (!isInitialRender) { + Radio.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Row.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + Row.width(20); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithChild(); + Button.bindPopup({ value: this.value4, changeEvent: newValue => { this.value4 = newValue; } }, { message: "This is $$ for regular" }); + Button.width(100); + Button.height(20); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(this.value1); + Text.bindPopup({ value: value5[0], changeEvent: newValue => { value5[0] = newValue; } }, { message: "This is $$ for Array" }); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(this.value2); + Text.fontSize(100); + Text.bindPopup({ value: value6.item1, changeEvent: newValue => { value6.item1 = newValue; } }, { message: "This is $$ for Obj" }); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(this.value3); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Radio.create({ value: "Radio", group: "1" }); + Radio.checked(value5[0], newValue => { value5[0] = newValue; }); + if (!isInitialRender) { + Radio.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Row.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + TextTimer.create({ controller: this.myTimeController, isCountDown: { value: isCountDown, changeEvent: newValue => { isCountDown = newValue; } }, count: { value: this.count, changeEvent: newValue => { this.count = newValue; } } }); + TextTimer.format(this.format, newValue => { this.format = newValue; }); + if (!isInitialRender) { + TextTimer.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + TextTimer.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel("start"); + Button.onClick(() => { + this.myTimeController.start(); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel("pause"); + Button.onClick(() => { + this.myTimeController.pause(); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel("reset"); + Button.onClick(() => { + this.myTimeController.reset(); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Row.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new HomeComponent(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/longPressGesture.ts b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/longPressGesture.ts new file mode 100644 index 0000000..7201999 --- /dev/null +++ b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/longPressGesture.ts @@ -0,0 +1,110 @@ +/* + * 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. + */ + +exports.source = ` +@Entry +@Component +struct LongPressGestureExample { + @State count: number = 0 + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Text('LongPress onAction:' + this.count) + } + .height(200).width(300).padding(60).border({ width:1 }).margin(30) + .gesture( + LongPressGesture({ repeat: true }) + .onAction((event: GestureEvent) => { + if (event.repeat) { this.count++ } + }) + .onActionEnd(() => { + this.count = 0 + }) + ) + } +}` + +exports.expectResult = +`"use strict"; +class LongPressGestureExample extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__count = new ObservedPropertySimplePU(0, this, "count"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.count !== undefined) { + this.count = params.count; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__count.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__count.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get count() { + return this.__count.get(); + } + set count(newValue) { + this.__count.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Flex.create({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }); + Flex.height(200); + Flex.width(300); + Flex.padding(60); + Flex.border({ width: 1 }); + Flex.margin(30); + Gesture.create(GesturePriority.Low); + LongPressGesture.create({ repeat: true }); + LongPressGesture.onAction((event) => { + if (event.repeat) { + this.count++; + } + }); + LongPressGesture.onActionEnd(() => { + this.count = 0; + }); + LongPressGesture.pop(); + Gesture.pop(); + if (!isInitialRender) { + Flex.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('LongPress onAction:' + this.count); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Flex.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new LongPressGestureExample(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/panGestrue.ts b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/panGestrue.ts new file mode 100644 index 0000000..ee9870e --- /dev/null +++ b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/panGestrue.ts @@ -0,0 +1,142 @@ +/* + * 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. + */ + +exports.source = ` +@Entry +@Component +struct PanGestureExample { + @State offsetX: number = 0 + @State offsetY: number = 0 + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Text('PanGesture offset X: ' + this.offsetX) + Text('PanGesture offset Y: ' + this.offsetY) + } + .height(100).width(200).padding(20).border({ width: 1 }).margin(80) + .translate({ x: this.offsetX, y: this.offsetY, z: 5 }) + .gesture( + PanGesture({}) + .onActionStart((event: GestureEvent) => { + console.info('Pan start') + }) + .onActionUpdate((event: GestureEvent) => { + this.offsetX = event.offsetX + this.offsetY = event.offsetY + }) + .onActionEnd(() => { + console.info('Pan end') + }) + ) + } +} +` + +exports.expectResult = +`"use strict"; +class PanGestureExample extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__offsetX = new ObservedPropertySimplePU(0, this, "offsetX"); + this.__offsetY = new ObservedPropertySimplePU(0, this, "offsetY"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.offsetX !== undefined) { + this.offsetX = params.offsetX; + } + if (params.offsetY !== undefined) { + this.offsetY = params.offsetY; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__offsetX.purgeDependencyOnElmtId(rmElmtId); + this.__offsetY.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__offsetX.aboutToBeDeleted(); + this.__offsetY.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get offsetX() { + return this.__offsetX.get(); + } + set offsetX(newValue) { + this.__offsetX.set(newValue); + } + get offsetY() { + return this.__offsetY.get(); + } + set offsetY(newValue) { + this.__offsetY.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Flex.create({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }); + Flex.height(100); + Flex.width(200); + Flex.padding(20); + Flex.border({ width: 1 }); + Flex.margin(80); + Flex.translate({ x: this.offsetX, y: this.offsetY, z: 5 }); + Gesture.create(GesturePriority.Low); + PanGesture.create({}); + PanGesture.onActionStart((event) => { + console.info('Pan start'); + }); + PanGesture.onActionUpdate((event) => { + this.offsetX = event.offsetX; + this.offsetY = event.offsetY; + }); + PanGesture.onActionEnd(() => { + console.info('Pan end'); + }); + PanGesture.pop(); + Gesture.pop(); + if (!isInitialRender) { + Flex.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('PanGesture offset X: ' + this.offsetX); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('PanGesture offset Y: ' + this.offsetY); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Flex.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new PanGestureExample(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/pinchGesture.ts b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/pinchGesture.ts new file mode 100644 index 0000000..9438267 --- /dev/null +++ b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/pinchGesture.ts @@ -0,0 +1,116 @@ +/* + * 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. + */ + +exports.source = ` +@Entry +@Component +struct PinchGestureExample { + @State scale2: number = 1 + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Text('PinchGesture scale:' + this.scale2) + } + .height(100).width(200).padding(20).border({ width: 1 }).margin(80) + .scale({ x: this.scale2, y: this.scale2, z: this.scale2 }) + .gesture( + PinchGesture() + .onActionStart((event: GestureEvent) => { + console.info('Pinch start') + }) + .onActionUpdate((event: GestureEvent) => { + this.scale2 = event.scale + }) + .onActionEnd(() => { + console.info('Pinch end') + }) + ) + } +}` + +exports.expectResult = +`"use strict"; +class PinchGestureExample extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__scale2 = new ObservedPropertySimplePU(1, this, "scale2"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.scale2 !== undefined) { + this.scale2 = params.scale2; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__scale2.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__scale2.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get scale2() { + return this.__scale2.get(); + } + set scale2(newValue) { + this.__scale2.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Flex.create({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }); + Flex.height(100); + Flex.width(200); + Flex.padding(20); + Flex.border({ width: 1 }); + Flex.margin(80); + Flex.scale({ x: this.scale2, y: this.scale2, z: this.scale2 }); + Gesture.create(GesturePriority.Low); + PinchGesture.create(); + PinchGesture.onActionStart((event) => { + console.info('Pinch start'); + }); + PinchGesture.onActionUpdate((event) => { + this.scale2 = event.scale; + }); + PinchGesture.onActionEnd(() => { + console.info('Pinch end'); + }); + PinchGesture.pop(); + Gesture.pop(); + if (!isInitialRender) { + Flex.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('PinchGesture scale:' + this.scale2); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Flex.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new PinchGestureExample(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/rotationGesture.ts b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/rotationGesture.ts new file mode 100644 index 0000000..352ff46 --- /dev/null +++ b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/rotationGesture.ts @@ -0,0 +1,116 @@ +/* + * 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. + */ + +exports.source = ` +@Entry +@Component +struct RotationGestureExample { + @State angle: number = 0 + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Text('RotationGesture angle:' + this.angle) + } + .height(100).width(200).padding(20).border({ width:1 }) + .margin(80).rotate({ x:1, y:2, z:3, angle: this.angle }) + .gesture( + RotationGesture() + .onActionStart((event: GestureEvent) => { + console.log('Rotation start') + }) + .onActionUpdate((event: GestureEvent) => { + this.angle = event.angle + }) + .onActionEnd(() => { + console.log('Rotation end') + }) + ) + } +}` + +exports.expectResult = +`"use strict"; +class RotationGestureExample extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__angle = new ObservedPropertySimplePU(0, this, "angle"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.angle !== undefined) { + this.angle = params.angle; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__angle.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__angle.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get angle() { + return this.__angle.get(); + } + set angle(newValue) { + this.__angle.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Flex.create({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }); + Flex.height(100); + Flex.width(200); + Flex.padding(20); + Flex.border({ width: 1 }); + Flex.margin(80); + Flex.rotate({ x: 1, y: 2, z: 3, angle: this.angle }); + Gesture.create(GesturePriority.Low); + RotationGesture.create(); + RotationGesture.onActionStart((event) => { + console.log('Rotation start'); + }); + RotationGesture.onActionUpdate((event) => { + this.angle = event.angle; + }); + RotationGesture.onActionEnd(() => { + console.log('Rotation end'); + }); + RotationGesture.pop(); + Gesture.pop(); + if (!isInitialRender) { + Flex.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('RotationGesture angle:' + this.angle); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Flex.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new RotationGestureExample(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/swipeGesture.ts b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/swipeGesture.ts new file mode 100644 index 0000000..206a910 --- /dev/null +++ b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/swipeGesture.ts @@ -0,0 +1,128 @@ +/* + * 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. + */ + +exports.source = ` +@Entry +@Component +struct SwipeGestureExample { + @State rotateAngle : number = 0 + @State speed : number = 1 + + build() { + Column() { + Text("SwipGesture speed : " + this.speed) + Text("SwipGesture angle : " + this.rotateAngle) + } + .border({width:2}) + .width(260).height(260) + .rotate({x: 0, y: 0, z: 1, angle: this.rotateAngle}) + .gesture( + SwipeGesture({fingers: 1, direction:SwipeDirection.Vertical}) + .onAction((event: GestureEvent) => { + this.speed = event.speed + this.rotateAngle = event.angle + }) + ) + } +}` + +exports.expectResult = +`"use strict"; +class SwipeGestureExample extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__rotateAngle = new ObservedPropertySimplePU(0, this, "rotateAngle"); + this.__speed = new ObservedPropertySimplePU(1, this, "speed"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.rotateAngle !== undefined) { + this.rotateAngle = params.rotateAngle; + } + if (params.speed !== undefined) { + this.speed = params.speed; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__rotateAngle.purgeDependencyOnElmtId(rmElmtId); + this.__speed.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__rotateAngle.aboutToBeDeleted(); + this.__speed.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get rotateAngle() { + return this.__rotateAngle.get(); + } + set rotateAngle(newValue) { + this.__rotateAngle.set(newValue); + } + get speed() { + return this.__speed.get(); + } + set speed(newValue) { + this.__speed.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + Column.border({ width: 2 }); + Column.width(260); + Column.height(260); + Column.rotate({ x: 0, y: 0, z: 1, angle: this.rotateAngle }); + Gesture.create(GesturePriority.Low); + SwipeGesture.create({ fingers: 1, direction: SwipeDirection.Vertical }); + SwipeGesture.onAction((event) => { + this.speed = event.speed; + this.rotateAngle = event.angle; + }); + SwipeGesture.pop(); + Gesture.pop(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create("SwipGesture speed : " + this.speed); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create("SwipGesture angle : " + this.rotateAngle); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new SwipeGestureExample(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/tapGesture.ts b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/tapGesture.ts new file mode 100644 index 0000000..afce034 --- /dev/null +++ b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/tapGesture.ts @@ -0,0 +1,112 @@ +/* + * 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. + */ + +exports.source = ` +@Entry +@Component +struct TapGestureExample { + @State value: string = '' + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Text('Click twice') + Text(this.value) + } + .height(200).width(300).padding(60).border({ width: 1 }).margin(30) + .gesture( + TapGesture({ count: 2 }) + .onAction(() => { + this.value = 'TapGesture onAction' + }) + ) + } +}` + +exports.expectResult = +`"use strict"; +class TapGestureExample extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__value = new ObservedPropertySimplePU('', this, "value"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.value !== undefined) { + this.value = params.value; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__value.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__value.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get value() { + return this.__value.get(); + } + set value(newValue) { + this.__value.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Flex.create({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }); + Flex.height(200); + Flex.width(300); + Flex.padding(60); + Flex.border({ width: 1 }); + Flex.margin(30); + Gesture.create(GesturePriority.Low); + TapGesture.create({ count: 2 }); + TapGesture.onAction(() => { + this.value = 'TapGesture onAction'; + }); + TapGesture.pop(); + Gesture.pop(); + if (!isInitialRender) { + Flex.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('Click twice'); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(this.value); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Flex.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new TapGestureExample(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/simple_component/button/button.ts b/compiler/test/utForPartialUpdate/inner_component_transform/simple_component/button/button.ts new file mode 100644 index 0000000..25d93a4 --- /dev/null +++ b/compiler/test/utForPartialUpdate/inner_component_transform/simple_component/button/button.ts @@ -0,0 +1,137 @@ +/* + * 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. + */ + +exports.source = ` +@Entry +@Component +struct ButtonExample { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceBetween }) { + Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Button('Ok', { type: ButtonType.Normal, stateEffect: true }).borderRadius(8).backgroundColor(0x317aff).width(90) + Button({ type: ButtonType.Normal, stateEffect: true }) { + Row() { + Text('loading').fontSize(12).fontColor(0xffffff).margin({ left: 5, right: 12 }) + }.alignItems(VerticalAlign.Center) + }.borderRadius(8).backgroundColor(0x317aff).width(90) + Button('Disable', { type: ButtonType.Normal, stateEffect: false }).opacity(0.5) + .borderRadius(8).backgroundColor(0x317aff).width(90) + } + } + } +} +` +exports.expectResult = +`"use strict"; +class ButtonExample extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Flex.create({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceBetween }); + if (!isInitialRender) { + Flex.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Flex.create({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }); + if (!isInitialRender) { + Flex.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel('Ok', { type: ButtonType.Normal, stateEffect: true }); + Button.borderRadius(8); + Button.backgroundColor(0x317aff); + Button.width(90); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithChild({ type: ButtonType.Normal, stateEffect: true }); + Button.borderRadius(8); + Button.backgroundColor(0x317aff); + Button.width(90); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + Row.alignItems(VerticalAlign.Center); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('loading'); + Text.fontSize(12); + Text.fontColor(0xffffff); + Text.margin({ left: 5, right: 12 }); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Row.pop(); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel('Disable', { type: ButtonType.Normal, stateEffect: false }); + Button.opacity(0.5); + Button.borderRadius(8); + Button.backgroundColor(0x317aff); + Button.width(90); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Flex.pop(); + Flex.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new ButtonExample(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts b/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts new file mode 100644 index 0000000..991ac0d --- /dev/null +++ b/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts @@ -0,0 +1,215 @@ +/* + * 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. + */ + +exports.source = ` +@Entry +@Component +struct TransitionExample { + @State btnW: number = 50 + @State btnH: number = 50 + @State btn1: boolean = false + @State show: string = "show" + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,}) { + Button(this.show) + .onClick(() => { + animateTo({ duration: 1000 }, () => { + this.btn1 = !this.btn1 + if(this.btn1){ + this.show = "hide" + }else{ + this.show = "show" + } + }) + }) + if (this.btn1) { + Button() + .width("80%").height(30) + .transition({ type: TransitionType.Insert, scale: {x:0,y:1.0}}) + .transition({ type: TransitionType.Delete, scale: { x: 1.0, y: 0.0 }}) + } + Button('animation') + .width(this.btnW).height(this.btnH) + .onClick(() => { + this.btnW += 50 + }) + .animation({ + duration: 1000, // 动画时长 + curve: Curve.EaseOut, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal // 动画模式 + }) + }.height(400).width("100%").padding({top:100}) + } +} +` + +exports.expectResult = +`"use strict"; +class TransitionExample extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__btnW = new ObservedPropertySimplePU(50, this, "btnW"); + this.__btnH = new ObservedPropertySimplePU(50, this, "btnH"); + this.__btn1 = new ObservedPropertySimplePU(false, this, "btn1"); + this.__show = new ObservedPropertySimplePU("show", this, "show"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.btnW !== undefined) { + this.btnW = params.btnW; + } + if (params.btnH !== undefined) { + this.btnH = params.btnH; + } + if (params.btn1 !== undefined) { + this.btn1 = params.btn1; + } + if (params.show !== undefined) { + this.show = params.show; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__btnW.purgeDependencyOnElmtId(rmElmtId); + this.__btnH.purgeDependencyOnElmtId(rmElmtId); + this.__btn1.purgeDependencyOnElmtId(rmElmtId); + this.__show.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__btnW.aboutToBeDeleted(); + this.__btnH.aboutToBeDeleted(); + this.__btn1.aboutToBeDeleted(); + this.__show.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get btnW() { + return this.__btnW.get(); + } + set btnW(newValue) { + this.__btnW.set(newValue); + } + get btnH() { + return this.__btnH.get(); + } + set btnH(newValue) { + this.__btnH.set(newValue); + } + get btn1() { + return this.__btn1.get(); + } + set btn1(newValue) { + this.__btn1.set(newValue); + } + get show() { + return this.__show.get(); + } + set show(newValue) { + this.__show.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Flex.create({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, }); + Flex.height(400); + Flex.width("100%"); + Flex.padding({ top: 100 }); + if (!isInitialRender) { + Flex.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel(this.show); + Button.onClick(() => { + Context.animateTo({ duration: 1000 }, () => { + this.btn1 = !this.btn1; + if (this.btn1) { + this.show = "hide"; + } + else { + this.show = "show"; + } + }); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + If.create(); + if (this.btn1) { + this.ifElseBranchUpdateFunction(0, () => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel(); + Button.width("80%"); + Button.height(30); + Button.transition({ type: TransitionType.Insert, scale: { x: 0, y: 1.0 } }); + Button.transition({ type: TransitionType.Delete, scale: { x: 1.0, y: 0.0 } }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + }); + } + else { + If.branchId(1); + } + if (!isInitialRender) { + If.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + If.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel('animation'); + Context.animation({ + duration: 1000, + curve: Curve.EaseOut, + delay: 200, + iterations: 1, + playMode: PlayMode.Normal // 动画模式 + }); + Button.width(this.btnW); + Button.height(this.btnH); + Button.onClick(() => { + this.btnW += 50; + }); + Context.animation(null); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Flex.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new TransitionExample(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/pageTransition/pageTransition.ts b/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/pageTransition/pageTransition.ts new file mode 100644 index 0000000..3f7d41c --- /dev/null +++ b/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/pageTransition/pageTransition.ts @@ -0,0 +1,177 @@ +/* + * 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. + */ + +exports.source = ` +@Entry +@Component +struct PageTransitionExample1 { + @State scale2: number = 1 + @State opacity2: number = 1 + @State active: boolean = false + build() { + Column() { + Navigator({ target: 'pages/page1', type: NavigationType.Push }) { + Text('page transition').width("100%").height("100%") + } + .onClick(() => { + this.active = true + }) + }.scale({ x: this.scale2 }).opacity(this.opacity2) + } + pageTransition() { + PageTransitionEnter({ duration: 1200, curve: Curve.Linear }) + .onEnter((type: RouteType, progress: number) => { + this.scale2 = 1 + this.opacity2 = progress + }) + PageTransitionExit({ duration: 1500, curve: Curve.Ease }) + .onExit((type: RouteType, progress: number) => { + this.scale2 = 1 - progress + this.opacity2 = 1 + }) + } +} +` + +exports.expectResult = +`"use strict"; +class PageTransitionExample1 extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__scale2 = new ObservedPropertySimplePU(1, this, "scale2"); + this.__opacity2 = new ObservedPropertySimplePU(1, this, "opacity2"); + this.__active = new ObservedPropertySimplePU(false, this, "active"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.scale2 !== undefined) { + this.scale2 = params.scale2; + } + if (params.opacity2 !== undefined) { + this.opacity2 = params.opacity2; + } + if (params.active !== undefined) { + this.active = params.active; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__scale2.purgeDependencyOnElmtId(rmElmtId); + this.__opacity2.purgeDependencyOnElmtId(rmElmtId); + this.__active.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__scale2.aboutToBeDeleted(); + this.__opacity2.aboutToBeDeleted(); + this.__active.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get scale2() { + return this.__scale2.get(); + } + set scale2(newValue) { + this.__scale2.set(newValue); + } + get opacity2() { + return this.__opacity2.get(); + } + set opacity2(newValue) { + this.__opacity2.set(newValue); + } + get active() { + return this.__active.get(); + } + set active(newValue) { + this.__active.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + Column.scale({ x: this.scale2 }); + Column.opacity(this.opacity2); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Navigator.create({ target: 'pages/page1', type: NavigationType.Push }); + Navigator.onClick(() => { + this.active = true; + }); + if (!isInitialRender) { + Navigator.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('page transition'); + Text.width("100%"); + Text.height("100%"); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Navigator.pop(); + Column.pop(); + } + pageTransition() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + PageTransition.create(); + if (!isInitialRender) { + PageTransition.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + PageTransitionEnter.create({ duration: 1200, curve: Curve.Linear }); + PageTransitionEnter.onEnter((type, progress) => { + this.scale2 = 1; + this.opacity2 = progress; + }); + if (!isInitialRender) { + PageTransitionEnter.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + PageTransitionExit.create({ duration: 1500, curve: Curve.Ease }); + PageTransitionExit.onExit((type, progress) => { + this.scale2 = 1 - progress; + this.opacity2 = 1; + }); + if (!isInitialRender) { + PageTransitionExit.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + PageTransition.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new PageTransitionExample1(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts new file mode 100644 index 0000000..5547e58 --- /dev/null +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts @@ -0,0 +1,625 @@ +/* + * 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. + */ + +exports.source = ` +@Builder function noParam(){ + Row(){ + Text('this is a no param builder') + } +} +@Builder function specificParam(label1: string, label2: string) { + Column() { + Text(label1) + Text(label2) + } +} +@Entry +@Component +struct MyComponent { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + private controller: TabsController = new TabsController() + @State hideBar: boolean = true + @Builder textBuilder() { + Text("文本") + .fontSize(30) + } + @Builder NavigationTitlePara(label:string) { + Column() { + Text(label) + .width(80) + .bindMenu(this.textBuilder) + } + } + @Builder MenuBuilder() { + Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + Text('Test menu item 1') + .fontSize(20) + Divider().height(10) + Text('Test menu item 2') + .fontSize(20) + }.width(100) + } + + build() { + Column() { + Row(){ + Text("Drag Me") + .onDragStart((event: DragEvent, extraParams: string) => { + console.log('Text onDragStarts, ' + extraParams) + }) + specificParam('test1', 'test2') + } + .padding(10) + .bindMenu(this.NavigationTitlePara("111")) + Row(){ + Text('Test Text') + } + .padding(10) + .bindPopup(false, { + builder: this.MenuBuilder, + onStateChange: (e) => { + if(!e.isVisible){ + console.warn(JSON.stringify(e.isVisible)) + } + } + }) + Row() { + Text('rightclick for menu') + } + .padding(10) + .bindContextMenu(this.MenuBuilder, ResponseType.RightClick) + Row(){ + Navigation() { + List({ space: 5, initialIndex: 0 }) { + ForEach(this.arr, (item) => { + ListItem() { + Text('' + item) + .width('90%') + .height(80) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + }.editable(true) + }, item => item) + } + .listDirection(Axis.Vertical) + .height(300) + .margin({ top: 10, left: 18 }) + .width('100%') + Button(this.hideBar ? "tool bar" : "hide bar") + .onClick(() => { + this.hideBar = !this.hideBar + }) + .margin({ left: 135, top: 60 }) + } + .title(noParam) + .menus(this.textBuilder) + .toolBar({ items: [ + { value: 'app', text: 'Grid', action: () => { + console.log("app") + } }, + { value: 'add', text: 'Add', action: () => { + console.log("add") + } }, + { value: 'collect', text: 'Collect', action: () => { + console.log("collect") + } }] }) + .hideToolBar(this.hideBar) + } + .padding(10) + Row(){ + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Text('111').width('100%').height('20').backgroundColor(Color.Pink) + } + .tabBar('pink') + TabContent() { + Text('222').width('100%').height('20').backgroundColor(Color.Yellow) + } + .tabBar('yellow') + TabContent() { + Text('333').width('100%').height('20').backgroundColor(Color.Blue) + } + .tabBar('blue') + } + } + .padding(10) + } + } +} +` +exports.expectResult = +`"use strict"; +function noParam(parent = undefined) { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('this is a no param builder'); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Row.pop(); +} +function specificParam(label1, label2, parent = undefined) { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(label1); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(label2); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Column.pop(); +} +class MyComponent extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + this.controller = new TabsController(); + this.__hideBar = new ObservedPropertySimplePU(true, this, "hideBar"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.arr !== undefined) { + this.arr = params.arr; + } + if (params.controller !== undefined) { + this.controller = params.controller; + } + if (params.hideBar !== undefined) { + this.hideBar = params.hideBar; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__hideBar.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.arr = undefined; + this.controller = undefined; + this.__hideBar.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get hideBar() { + return this.__hideBar.get(); + } + set hideBar(newValue) { + this.__hideBar.set(newValue); + } + textBuilder(parent = undefined) { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create("文本"); + Text.fontSize(30); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + } + NavigationTitlePara(label, parent = undefined) { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(label); + Text.width(80); + Text.bindMenu({ builder: this.textBuilder.bind(this) }); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Column.pop(); + } + MenuBuilder(parent = undefined) { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Flex.create({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }); + Flex.width(100); + if (!isInitialRender) { + Flex.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('Test menu item 1'); + Text.fontSize(20); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Divider.create(); + Divider.height(10); + if (!isInitialRender) { + Divider.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('Test menu item 2'); + Text.fontSize(20); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Flex.pop(); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + Row.padding(10); + Row.bindMenu({ builder: () => { + this.NavigationTitlePara("111"); + } }); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create("Drag Me"); + Text.onDragStart((event, extraParams) => { + console.log('Text onDragStarts, ' + extraParams); + }); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + specificParam('test1', 'test2', this); + Row.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + Row.padding(10); + Row.bindPopup(false, { + builder: { builder: this.MenuBuilder.bind(this) }, + onStateChange: (e) => { + if (!e.isVisible) { + console.warn(JSON.stringify(e.isVisible)); + } + } + }); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('Test Text'); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Row.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + Row.padding(10); + Row.bindContextMenu({ builder: this.MenuBuilder.bind(this) }, ResponseType.RightClick); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('rightclick for menu'); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Row.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + Row.padding(10); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Navigation.create(); + Navigation.title({ builder: noParam }); + Navigation.menus({ builder: this.textBuilder.bind(this) }); + Navigation.toolBar({ items: [ + { value: 'app', text: 'Grid', action: () => { + console.log("app"); + } }, + { value: 'add', text: 'Add', action: () => { + console.log("add"); + } }, + { value: 'collect', text: 'Collect', action: () => { + console.log("collect"); + } } + ] }); + Navigation.hideToolBar(this.hideBar); + if (!isInitialRender) { + Navigation.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + List.create({ space: 5, initialIndex: 0 }); + List.listDirection(Axis.Vertical); + List.height(300); + List.margin({ top: 10, left: 18 }); + List.width('100%'); + if (!isInitialRender) { + List.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ForEach.create(); + const forEachItemGenFunction = _item => { + const item = _item; + { + const isLazyCreate = true; + const itemCreation = (elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ListItem.create(deepRenderFunction, isLazyCreate); + ListItem.editable(true); + if (!isInitialRender) { + ListItem.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }; + const observedShallowRender = () => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ListItem.create(deepRenderFunction, isLazyCreate); + if (!isInitialRender) { + ListItem.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + ListItem.pop(); + }; + const observedDeepRender = () => { + this.observeComponentCreation(itemCreation); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('' + item); + Text.width('90%'); + Text.height(80); + Text.backgroundColor('#3366CC'); + Text.borderRadius(15); + Text.fontSize(16); + Text.textAlign(TextAlign.Center); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + ListItem.pop(); + }; + const deepRenderFunction = (elmtId, isInitialRender) => { + itemCreation(elmtId, isInitialRender); + this.updateFuncByElmtId.set(elmtId, itemCreation); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('' + item); + Text.width('90%'); + Text.height(80); + Text.backgroundColor('#3366CC'); + Text.borderRadius(15); + Text.fontSize(16); + Text.textAlign(TextAlign.Center); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + ListItem.pop(); + }; + if (isLazyCreate) { + observedShallowRender(); + } + else { + observedDeepRender(); + } + } + }; + const forEachItemIdFunc = item => item; + this.forEachUpdateFunction(elmtId, this.arr, forEachItemGenFunction, forEachItemIdFunc); + if (!isInitialRender) { + ForEach.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + ForEach.pop(); + List.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel(this.hideBar ? "tool bar" : "hide bar"); + Button.onClick(() => { + this.hideBar = !this.hideBar; + }); + Button.margin({ left: 135, top: 60 }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Navigation.pop(); + Row.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + Row.padding(10); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Tabs.create({ barPosition: BarPosition.Start, controller: this.controller }); + if (!isInitialRender) { + Tabs.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + TabContent.create(() => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('111'); + Text.width('100%'); + Text.height('20'); + Text.backgroundColor(Color.Pink); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + }); + TabContent.tabBar('pink'); + if (!isInitialRender) { + TabContent.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + TabContent.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + TabContent.create(() => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('222'); + Text.width('100%'); + Text.height('20'); + Text.backgroundColor(Color.Yellow); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + }); + TabContent.tabBar('yellow'); + if (!isInitialRender) { + TabContent.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + TabContent.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + TabContent.create(() => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('333'); + Text.width('100%'); + Text.height('20'); + Text.backgroundColor(Color.Blue); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + }); + TabContent.tabBar('blue'); + if (!isInitialRender) { + TabContent.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + TabContent.pop(); + Tabs.pop(); + Row.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new MyComponent(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts new file mode 100644 index 0000000..858eff4 --- /dev/null +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts @@ -0,0 +1,131 @@ +/* + * 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. + */ + +exports.source = ` +@Component +struct TitleComp { + @Link title: string + build() { + Text(this.title) + } +} + +@Entry +@Component +struct TestPage{ + @State value: string = 'hello world' + @Builder + TitleCompView() { + TitleComp({title: $value}) + } + build() { + Flex() { + this.TitleCompView() + } + } +} +` +exports.expectResult = +`"use strict"; +class TitleComp extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__title = new SynchedPropertySimpleTwoWayPU(params.title, this, "title"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__title.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__title.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get title() { + return this.__title.get(); + } + set title(newValue) { + this.__title.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(this.title); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class TestPage extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__value = new ObservedPropertySimplePU('hello world', this, "value"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.value !== undefined) { + this.value = params.value; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__value.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__value.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get value() { + return this.__value.get(); + } + set value(newValue) { + this.__value.set(newValue); + } + TitleCompView(parent = undefined) { + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new TitleComp(this, { title: this.__value })); + ViewStackProcessor.StopGetAccessRecording(); + } + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Flex.create(); + if (!isInitialRender) { + Flex.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.TitleCompView(this); + Flex.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new TestPage(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts b/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts new file mode 100644 index 0000000..0439dfa --- /dev/null +++ b/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts @@ -0,0 +1,374 @@ +/* + * 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. + */ + +exports.source = ` +import { CustomContainerExport } from './test/pages/TestComponent'; +@Component +struct CustomContainer { + header: string = ""; + @BuilderParam content: () => void; + @BuilderParam callContent: any; + footer: string = ""; + build() { + Column() { + Text(this.header) + this.content() + this.callContent() + Text(this.footer) + } + } +} + +@Component +struct CustomContainer2 { + header: string = ""; + @BuilderParam content: () => void; + build() { + Column() { + Text(this.header) + this.content() + } + } +} + +@Entry +@Component +struct CustomContainerUser { + @State text: string = 'header' + @Builder specificParam() { + Column() { + Text("content").fontSize(50) + } + } + @Builder callSpecificParam(label1: string, label2: string) { + Column() { + Text(label1).fontSize(50) + Text(label2).fontSize(50) + } + } + + build() { + Column() { + CustomContainerExport({ + header: this.text, + }){ + Column(){ + specificParam("111", "22") + }.onClick(()=>{ + this.text = "changeHeader" + }) + } + Row(){ + CustomContainer({ + header: this.text, + content: this.specificParam, + callContent: this.callSpecificParam("callContent1", 'callContent2'), + footer: "Footer", + }) + } + Row(){ + CustomContainer2({ + header: this.text, + }){ + Column(){ + this.callSpecificParam("111", '222') + }.onClick(()=>{ + this.text = "changeHeader" + }) + } + } + } + } +} +` +exports.expectResult = +`"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const TestComponent_1 = require("./test/pages/TestComponent"); +class CustomContainer extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.header = ""; + this.footer = ""; + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.header !== undefined) { + this.header = params.header; + } + this.content = params.content; + this.callContent = params.callContent; + if (params.footer !== undefined) { + this.footer = params.footer; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + this.header = undefined; + this.footer = undefined; + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(this.header); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.content(this); + this.callContent(this); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(this.footer); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class CustomContainer2 extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.header = ""; + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.header !== undefined) { + this.header = params.header; + } + this.content = params.content; + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + this.header = undefined; + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(this.header); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.content(this); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class CustomContainerUser extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__text = new ObservedPropertySimplePU('header', this, "text"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.text !== undefined) { + this.text = params.text; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__text.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__text.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get text() { + return this.__text.get(); + } + set text(newValue) { + this.__text.set(newValue); + } + specificParam(parent = undefined) { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create("content"); + Text.fontSize(50); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Column.pop(); + } + callSpecificParam(label1, label2, parent = undefined) { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(label1); + Text.fontSize(50); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(label2); + Text.fontSize(50); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Column.pop(); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new TestComponent_1.CustomContainerExport(this, { + header: this.text, + closer: () => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + Column.onClick(() => { + this.text = "changeHeader"; + }); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + specificParam("111", "22", this); + Column.pop(); + } + })); + ViewStackProcessor.StopGetAccessRecording(); + } + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new CustomContainer(this, { + header: this.text, + content: this.specificParam, + callContent: this.callSpecificParam("callContent1", 'callContent2'), + footer: "Footer", + })); + ViewStackProcessor.StopGetAccessRecording(); + } + Row.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new CustomContainer2(this, { + header: this.text, + content: () => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + Column.onClick(() => { + this.text = "changeHeader"; + }); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.callSpecificParam("111", '222', this); + Column.pop(); + } + })); + ViewStackProcessor.StopGetAccessRecording(); + } + Row.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new CustomContainerUser(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts b/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts new file mode 100644 index 0000000..e50a4a4 --- /dev/null +++ b/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts @@ -0,0 +1,375 @@ +/* + * 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. + */ + +exports.source = ` +@CustomDialog +struct DialogExample { + @Prop count: number + @Link isPlaying: boolean + controller: CustomDialogController; + termsToAccept: string = "" + action1: () => void; + action2: (x: number, s: string) => void; + + build() { + Column(){ + Row(){ + Button('current count is: ' + this.count) + .onClick(() => { + this.count++; + }) + } + Row(){ + Button(this.isPlaying ? 'play' : 'pause') + .onClick(() => { + this.isPlaying = !this.isPlaying; + }) + } + Row() { + Button ("Option A") + .onClick(() => { + this.controller.close(); + this.action1(); + }) + Button ("Option B") + .onClick(() => { + this.controller.close(); + this.action2(47, "Option B is great choice"); + }) + } + } + } +} + +@Entry +@Component +struct CustomDialogUser { + @State countInitValue: number = 10; + @State playingInitValue: boolean = false; + dialogController : CustomDialogController = new CustomDialogController({ + builder: DialogExample({ + termsToAccept: "Please accept the terms.", + action1: this.onAccept, + action2: this.existApp, + count: this.countInitValue, + isPlaying: $playingInitValue + }), + cancel: this.existApp, + autoCancel: false + }); + + onAccept() { + console.log("onAccept"); + } + existApp() { + console.log("Cancel dialog!"); + } + + build() { + Column() { + Text('current countInitValue is: ' + this.countInitValue) + .fontSize(20) + Text('current playingInitValue is: ' + this.playingInitValue) + .fontSize(20) + Button("Click to open Dialog -1") + .onClick(() => { + this.countInitValue--; + this.dialogController.open() + }) + Button("Click to close Dialog +1") + .onClick(() => { + this.countInitValue++; + this.dialogController.close() + }) + } + } +} +` + +exports.expectResult = +`"use strict"; +class DialogExample extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__count = new SynchedPropertySimpleOneWayPU(params.count, this, "count"); + this.__isPlaying = new SynchedPropertySimpleTwoWayPU(params.isPlaying, this, "isPlaying"); + this.controller = undefined; + this.termsToAccept = ""; + this.action1 = undefined; + this.action2 = undefined; + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.controller !== undefined) { + this.controller = params.controller; + } + if (params.termsToAccept !== undefined) { + this.termsToAccept = params.termsToAccept; + } + if (params.action1 !== undefined) { + this.action1 = params.action1; + } + if (params.action2 !== undefined) { + this.action2 = params.action2; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__count.purgeDependencyOnElmtId(rmElmtId); + this.__isPlaying.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__count.aboutToBeDeleted(); + this.__isPlaying.aboutToBeDeleted(); + this.controller = undefined; + this.termsToAccept = undefined; + this.action1 = undefined; + this.action2 = undefined; + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get count() { + return this.__count.get(); + } + set count(newValue) { + this.__count.set(newValue); + } + get isPlaying() { + return this.__isPlaying.get(); + } + set isPlaying(newValue) { + this.__isPlaying.set(newValue); + } + setController(ctr) { + this.controller = ctr; + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel('current count is: ' + this.count); + Button.onClick(() => { + this.count++; + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Row.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel(this.isPlaying ? 'play' : 'pause'); + Button.onClick(() => { + this.isPlaying = !this.isPlaying; + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Row.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel("Option A"); + Button.onClick(() => { + this.controller.close(); + this.action1(); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel("Option B"); + Button.onClick(() => { + this.controller.close(); + this.action2(47, "Option B is great choice"); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Row.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class CustomDialogUser extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__countInitValue = new ObservedPropertySimplePU(10, this, "countInitValue"); + this.__playingInitValue = new ObservedPropertySimplePU(false, this, "playingInitValue"); + this.dialogController = new CustomDialogController({ + builder: () => { + let jsDialog = new DialogExample(this, { + termsToAccept: "Please accept the terms.", + action1: this.onAccept, + action2: this.existApp, + count: this.__countInitValue, + isPlaying: this.__playingInitValue + }); + jsDialog.setController(this.dialogController); + ViewPU.create(jsDialog); + }, + cancel: this.existApp, + autoCancel: false + }, this); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.countInitValue !== undefined) { + this.countInitValue = params.countInitValue; + } + if (params.playingInitValue !== undefined) { + this.playingInitValue = params.playingInitValue; + } + if (params.dialogController !== undefined) { + this.dialogController = params.dialogController; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__countInitValue.purgeDependencyOnElmtId(rmElmtId); + this.__playingInitValue.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__countInitValue.aboutToBeDeleted(); + this.__playingInitValue.aboutToBeDeleted(); + this.dialogController = undefined; + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get countInitValue() { + return this.__countInitValue.get(); + } + set countInitValue(newValue) { + this.__countInitValue.set(newValue); + } + get playingInitValue() { + return this.__playingInitValue.get(); + } + set playingInitValue(newValue) { + this.__playingInitValue.set(newValue); + } + onAccept() { + console.log("onAccept"); + } + existApp() { + console.log("Cancel dialog!"); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('current countInitValue is: ' + this.countInitValue); + Text.fontSize(20); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('current playingInitValue is: ' + this.playingInitValue); + Text.fontSize(20); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel("Click to open Dialog -1"); + Button.onClick(() => { + this.countInitValue--; + this.dialogController.open(); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel("Click to close Dialog +1"); + Button.onClick(() => { + this.countInitValue++; + this.dialogController.close(); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new CustomDialogUser(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/render_decorator/@extend/@extend.ts b/compiler/test/utForPartialUpdate/render_decorator/@extend/@extend.ts new file mode 100644 index 0000000..58bea9d --- /dev/null +++ b/compiler/test/utForPartialUpdate/render_decorator/@extend/@extend.ts @@ -0,0 +1,164 @@ +/* + * 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. + */ + +exports.source = ` +@Extend Text.fancy(color:string){ + .backgroundColor(color) +} + +@Extend Text.superFancy(size:number){ + .fontSize(size) + .fancy(Color.Red) +} + +@Extend(Button) function fancybut(color:string|Color){ + .backgroundColor(color) + .width(200) + .height(100) +} + +@Entry +@Component +struct FancyUse { + build() { + Column(){ + Row() { + Text("Just Fancy").fancy(Color.Yellow) + Text("Super Fancy Text").superFancy(24) + Button("Fancy Button").fancybut(Color.Green) + } + Row({ space: 10 }) { + Text("Fancy") + .fancytext(24) + } + } + } +} + +@Extend(Text) function fancytext(fontSize: number) { + .fontColor(Color.Red) + .fontSize(fontSize) + .fontStyle(FontStyle.Italic) +} +` +exports.expectResult = +`"use strict"; +function __Text__fancy(color) { + Text.backgroundColor(color); +} +function __Text__superFancy(size) { + Text.fontSize(size); + __Text__fancy(Color.Red); +} +function __Button__fancybut(color) { + Button.backgroundColor(color); + Button.width(200); + Button.height(100); +} +class FancyUse extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create("Just Fancy"); + __Text__fancy(Color.Yellow); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create("Super Fancy Text"); + __Text__superFancy(24); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel("Fancy Button"); + __Button__fancybut(Color.Green); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Row.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create({ space: 10 }); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create("Fancy"); + __Text__fancytext(24); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Row.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +function __Text__fancytext(fontSize) { + Text.fontColor(Color.Red); + Text.fontSize(fontSize); + Text.fontStyle(FontStyle.Italic); +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new FancyUse(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/render_decorator/@preview/@preview.ts b/compiler/test/utForPartialUpdate/render_decorator/@preview/@preview.ts new file mode 100644 index 0000000..d0dbb0e --- /dev/null +++ b/compiler/test/utForPartialUpdate/render_decorator/@preview/@preview.ts @@ -0,0 +1,112 @@ +/* + * 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. + */ + +exports.source = ` +@Entry +@Component +struct HomePreviewComponent { + private value: string = "hello world" + + build() { + Text(this.value) + .fontSize(50) + } +} + +@Preview +@Component +struct HomePreviewComponent_Preview { + build() { + Column() { + HomePreviewComponent(); + } + } +} +` + +exports.expectResult = +`"use strict"; +class HomePreviewComponent extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.value = "hello world"; + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.value !== undefined) { + this.value = params.value; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + this.value = undefined; + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(this.value); + Text.fontSize(50); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class HomePreviewComponent_Preview extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new HomePreviewComponent(this, {})); + ViewStackProcessor.StopGetAccessRecording(); + } + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new HomePreviewComponent(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/render_decorator/@styles/@styles.ts b/compiler/test/utForPartialUpdate/render_decorator/@styles/@styles.ts new file mode 100644 index 0000000..90b8dd2 --- /dev/null +++ b/compiler/test/utForPartialUpdate/render_decorator/@styles/@styles.ts @@ -0,0 +1,154 @@ +/* + * 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. + */ + +exports.source = ` +@Styles function globalFancy() { + .backgroundColor(Color.Red) +} + +@Entry +@Component +struct FancyUse { + @State enable: boolean = true + @Styles componentFancy() { + .backgroundColor(Color.Blue) + } + build() { + Column({ space: 10 }) { + Text("Fancy") + .globalFancy() + .width(100) + .height(100) + Text("Fancy") + .componentFancy() + .width(100) + .height(100) + Button() { + Text("Fancy") + } + .enabled(this.enable) + .onClick(() => { + this.enable = false + }) + .stateStyles({ + normal: { + .backgroundColor(Color.Green) + }, + disabled: this.componentFancy, + pressed: globalFancy + }) + } + } +}` + +exports.expectResult = +`"use strict"; +class FancyUse extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__enable = new ObservedPropertySimplePU(true, this, "enable"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.enable !== undefined) { + this.enable = params.enable; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__enable.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__enable.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get enable() { + return this.__enable.get(); + } + set enable(newValue) { + this.__enable.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create({ space: 10 }); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create("Fancy"); + Text.backgroundColor(Color.Red); + Text.width(100); + Text.height(100); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create("Fancy"); + Text.backgroundColor(Color.Blue); + Text.width(100); + Text.height(100); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithChild(); + Button.enabled(this.enable); + Button.onClick(() => { + this.enable = false; + }); + ViewStackProcessor.visualState("normal"); + Button.backgroundColor(Color.Green); + ViewStackProcessor.visualState("disabled"); + Button.backgroundColor(Color.Blue); + ViewStackProcessor.visualState("pressed"); + Button.backgroundColor(Color.Red); + ViewStackProcessor.visualState(); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create("Fancy"); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Button.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new FancyUse(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/render_decorator/@styles/@stylesExport.ts b/compiler/test/utForPartialUpdate/render_decorator/@styles/@stylesExport.ts new file mode 100644 index 0000000..1eec293 --- /dev/null +++ b/compiler/test/utForPartialUpdate/render_decorator/@styles/@stylesExport.ts @@ -0,0 +1,158 @@ +/* + * 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. + */ + +exports.source = ` +@Styles function globalFancy() { + .backgroundColor(Color.Red) +} + +@Entry +@Component +export struct FancyUseExp { + @State enable: boolean = true + @Styles componentFancy() { + .backgroundColor(Color.Blue) + } + build() { + Column({ space: 10 }) { + Text("Fancy") + .globalFancy() + .width(100) + .height(100) + Text("Fancy") + .componentFancy() + .width(100) + .height(100) + Button() { + Text("Fancy") + } + .enabled(this.enable) + .onClick(() => { + this.enable = false + }) + .stateStyles({ + normal: { + .backgroundColor(Color.Green) + }, + disabled: this.componentFancy, + pressed: globalFancy + }) + } + } +} +` + +exports.expectResult = +`"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FancyUseExp = void 0; +class FancyUseExp extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__enable = new ObservedPropertySimplePU(true, this, "enable"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.enable !== undefined) { + this.enable = params.enable; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__enable.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__enable.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get enable() { + return this.__enable.get(); + } + set enable(newValue) { + this.__enable.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create({ space: 10 }); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create("Fancy"); + Text.backgroundColor(Color.Red); + Text.width(100); + Text.height(100); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create("Fancy"); + Text.backgroundColor(Color.Blue); + Text.width(100); + Text.height(100); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithChild(); + Button.enabled(this.enable); + Button.onClick(() => { + this.enable = false; + }); + ViewStackProcessor.visualState("normal"); + Button.backgroundColor(Color.Green); + ViewStackProcessor.visualState("disabled"); + Button.backgroundColor(Color.Blue); + ViewStackProcessor.visualState("pressed"); + Button.backgroundColor(Color.Red); + ViewStackProcessor.visualState(); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create("Fancy"); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Button.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +exports.FancyUseExp = FancyUseExp; +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new FancyUseExp(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts new file mode 100644 index 0000000..f08ba61 --- /dev/null +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts @@ -0,0 +1,136 @@ +/* + * 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. + */ + +exports.source = ` +let varA = AppStorage.Link('varA') +let envLang = AppStorage.Prop('languageCode') + +@Entry +@Component +struct MyComponent { + @StorageLink('varA') varA: number = 2 + @StorageProp('languageCode') lang: string = 'en' + private label: string = 'count' + + private aboutToAppear() { + this.label = (this.lang === 'zh') ? '数' : 'Count' + } + + build() { + Row({ space: 20 }) { + Button(this.label + ': ' + this.varA) + .onClick(() => { + AppStorage.Set('varA', AppStorage.Get('varA') + 1) + }) + Button('lang: ' + this.lang) + .onClick(() => { + if (this.lang === 'zh') { + AppStorage.Set('languageCode', 'en') + } else { + AppStorage.Set('languageCode', 'zh') + } + this.label = (this.lang === 'zh') ? '数' : 'Count' + }) + } + } +} +` +exports.expectResult = +`"use strict"; +let varA = AppStorage.Link('varA'); +let envLang = AppStorage.Prop('languageCode'); +class MyComponent extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__varA = this.createStorageLink('varA', 2, "varA"); + this.__lang = this.createStorageProp('languageCode', 'en', "lang"); + this.label = 'count'; + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.label !== undefined) { + this.label = params.label; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + this.__varA.aboutToBeDeleted(); + this.__lang.aboutToBeDeleted(); + this.label = undefined; + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get varA() { + return this.__varA.get(); + } + set varA(newValue) { + this.__varA.set(newValue); + } + get lang() { + return this.__lang.get(); + } + aboutToAppear() { + this.label = (this.lang === 'zh') ? '数' : 'Count'; + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create({ space: 20 }); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel(this.label + ': ' + this.varA); + Button.onClick(() => { + AppStorage.Set('varA', AppStorage.Get('varA') + 1); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel('lang: ' + this.lang); + Button.onClick(() => { + if (this.lang === 'zh') { + AppStorage.Set('languageCode', 'en'); + } + else { + AppStorage.Set('languageCode', 'zh'); + } + this.label = (this.lang === 'zh') ? '数' : 'Count'; + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Row.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new MyComponent(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts new file mode 100644 index 0000000..f08ba61 --- /dev/null +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts @@ -0,0 +1,136 @@ +/* + * 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. + */ + +exports.source = ` +let varA = AppStorage.Link('varA') +let envLang = AppStorage.Prop('languageCode') + +@Entry +@Component +struct MyComponent { + @StorageLink('varA') varA: number = 2 + @StorageProp('languageCode') lang: string = 'en' + private label: string = 'count' + + private aboutToAppear() { + this.label = (this.lang === 'zh') ? '数' : 'Count' + } + + build() { + Row({ space: 20 }) { + Button(this.label + ': ' + this.varA) + .onClick(() => { + AppStorage.Set('varA', AppStorage.Get('varA') + 1) + }) + Button('lang: ' + this.lang) + .onClick(() => { + if (this.lang === 'zh') { + AppStorage.Set('languageCode', 'en') + } else { + AppStorage.Set('languageCode', 'zh') + } + this.label = (this.lang === 'zh') ? '数' : 'Count' + }) + } + } +} +` +exports.expectResult = +`"use strict"; +let varA = AppStorage.Link('varA'); +let envLang = AppStorage.Prop('languageCode'); +class MyComponent extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__varA = this.createStorageLink('varA', 2, "varA"); + this.__lang = this.createStorageProp('languageCode', 'en', "lang"); + this.label = 'count'; + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.label !== undefined) { + this.label = params.label; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + this.__varA.aboutToBeDeleted(); + this.__lang.aboutToBeDeleted(); + this.label = undefined; + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get varA() { + return this.__varA.get(); + } + set varA(newValue) { + this.__varA.set(newValue); + } + get lang() { + return this.__lang.get(); + } + aboutToAppear() { + this.label = (this.lang === 'zh') ? '数' : 'Count'; + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create({ space: 20 }); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel(this.label + ': ' + this.varA); + Button.onClick(() => { + AppStorage.Set('varA', AppStorage.Get('varA') + 1); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel('lang: ' + this.lang); + Button.onClick(() => { + if (this.lang === 'zh') { + AppStorage.Set('languageCode', 'en'); + } + else { + AppStorage.Set('languageCode', 'zh'); + } + this.label = (this.lang === 'zh') ? '数' : 'Count'; + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Row.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new MyComponent(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts new file mode 100644 index 0000000..f08ba61 --- /dev/null +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts @@ -0,0 +1,136 @@ +/* + * 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. + */ + +exports.source = ` +let varA = AppStorage.Link('varA') +let envLang = AppStorage.Prop('languageCode') + +@Entry +@Component +struct MyComponent { + @StorageLink('varA') varA: number = 2 + @StorageProp('languageCode') lang: string = 'en' + private label: string = 'count' + + private aboutToAppear() { + this.label = (this.lang === 'zh') ? '数' : 'Count' + } + + build() { + Row({ space: 20 }) { + Button(this.label + ': ' + this.varA) + .onClick(() => { + AppStorage.Set('varA', AppStorage.Get('varA') + 1) + }) + Button('lang: ' + this.lang) + .onClick(() => { + if (this.lang === 'zh') { + AppStorage.Set('languageCode', 'en') + } else { + AppStorage.Set('languageCode', 'zh') + } + this.label = (this.lang === 'zh') ? '数' : 'Count' + }) + } + } +} +` +exports.expectResult = +`"use strict"; +let varA = AppStorage.Link('varA'); +let envLang = AppStorage.Prop('languageCode'); +class MyComponent extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__varA = this.createStorageLink('varA', 2, "varA"); + this.__lang = this.createStorageProp('languageCode', 'en', "lang"); + this.label = 'count'; + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.label !== undefined) { + this.label = params.label; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + this.__varA.aboutToBeDeleted(); + this.__lang.aboutToBeDeleted(); + this.label = undefined; + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get varA() { + return this.__varA.get(); + } + set varA(newValue) { + this.__varA.set(newValue); + } + get lang() { + return this.__lang.get(); + } + aboutToAppear() { + this.label = (this.lang === 'zh') ? '数' : 'Count'; + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create({ space: 20 }); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel(this.label + ': ' + this.varA); + Button.onClick(() => { + AppStorage.Set('varA', AppStorage.Get('varA') + 1); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel('lang: ' + this.lang); + Button.onClick(() => { + if (this.lang === 'zh') { + AppStorage.Set('languageCode', 'en'); + } + else { + AppStorage.Set('languageCode', 'zh'); + } + this.label = (this.lang === 'zh') ? '数' : 'Count'; + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Row.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new MyComponent(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/localStorage/localStorage.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/localStorage/localStorage.ts new file mode 100644 index 0000000..378f8e8 --- /dev/null +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/localStorage/localStorage.ts @@ -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. + */ + +exports.source = ` +let storage = LocalStorage.GetShared(); + +class ClassA { + public id: number = 1; + public type: number = 2; + public a: string = "aaa"; + constructor(a: string){ + this.a = a; + } +} + +@Entry(storage) +@Component +struct LocalStorageComponent { + @LocalStorageLink("storageSimpleProp") simpleVarName: number = 0; + @LocalStorageProp("storageObjectProp") objectName: ClassA = new ClassA("x"); + build() { + Column() { + Text(this.objectName.a) + .onClick(()=>{ + this.simpleVarName +=1; + this.objectName.a = this.objectName.a === 'x' ? 'yex' : 'no'; + }) + } + .height(500) + } +} +` +exports.expectResult = +`"use strict"; +let storage = LocalStorage.GetShared(); +class ClassA { + constructor(a) { + this.id = 1; + this.type = 2; + this.a = "aaa"; + this.a = a; + } +} +class LocalStorageComponent extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__simpleVarName = this.createLocalStorageLink("storageSimpleProp", 0, "simpleVarName"); + this.__objectName = this.createLocalStorageProp("storageObjectProp", new ClassA("x"), "objectName"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + this.__simpleVarName.aboutToBeDeleted(); + this.__objectName.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get simpleVarName() { + return this.__simpleVarName.get(); + } + set simpleVarName(newValue) { + this.__simpleVarName.set(newValue); + } + get objectName() { + return this.__objectName.get(); + } + set objectName(newValue) { + this.__objectName.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + Column.height(500); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(this.objectName.a); + Text.onClick(() => { + this.simpleVarName += 1; + this.objectName.a = this.objectName.a === 'x' ? 'yex' : 'no'; + }); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new LocalStorageComponent(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/ui_state_management/others/@consume_@provide/@consume_@provide.ts b/compiler/test/utForPartialUpdate/ui_state_management/others/@consume_@provide/@consume_@provide.ts new file mode 100644 index 0000000..279c53f --- /dev/null +++ b/compiler/test/utForPartialUpdate/ui_state_management/others/@consume_@provide/@consume_@provide.ts @@ -0,0 +1,227 @@ +/* + * 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. + */ + +exports.source = ` +@Entry +@Component +struct CompA { + @Provide("reviewVote") reviewVotes : number = 0; + + build() { + Column() { + CompB() + Button() { + Text('' + this.reviewVotes) + .fontSize(30) + } + .onClick(() => { + this.reviewVotes += 1; + }) + } + } +} + +@Component +struct CompB { + build() { + Column() { + CompC() + } + } +} + +@Component +struct CompC { + @Consume("reviewVote") reviewVotes : number; + build() { + Column() { + Button() { + Text('' + this.reviewVotes) + .fontSize(30) + } + .onClick(() => { + this.reviewVotes += 1; + }) + } + } +} +` +exports.expectResult = +`"use strict"; +class CompA extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__reviewVotes = new ObservedPropertySimplePU(0, this, "reviewVotes"); + this.addProvidedVar("reviewVote", this.__reviewVotes); + this.addProvidedVar("reviewVotes", this.__reviewVotes); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.reviewVotes !== undefined) { + this.reviewVotes = params.reviewVotes; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + this.__reviewVotes.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get reviewVotes() { + return this.__reviewVotes.get(); + } + set reviewVotes(newValue) { + this.__reviewVotes.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new CompB(this, {})); + ViewStackProcessor.StopGetAccessRecording(); + } + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithChild(); + Button.onClick(() => { + this.reviewVotes += 1; + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('' + this.reviewVotes); + Text.fontSize(30); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Button.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class CompB extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new CompC(this, {})); + ViewStackProcessor.StopGetAccessRecording(); + } + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class CompC extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__reviewVotes = this.initializeConsume("reviewVote", "reviewVotes"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + this.__reviewVotes.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get reviewVotes() { + return this.__reviewVotes.get(); + } + set reviewVotes(newValue) { + this.__reviewVotes.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithChild(); + Button.onClick(() => { + this.reviewVotes += 1; + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('' + this.reviewVotes); + Text.fontSize(30); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Button.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new CompA(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts new file mode 100644 index 0000000..9d8175e --- /dev/null +++ b/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts @@ -0,0 +1,196 @@ +/* + * 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. + */ + +exports.source = ` +let NextID : number = 0; + +@Observed class ClassA { + public id : number; + public c: number; + constructor(c: number) { + this.id = NextID++; + this.c = c; + } +} + +@Observed class ClassB { + public a: ClassA; + constructor(a: ClassA) { + this.a = a; + } +} + +@Component +struct ViewA { + @ObjectLink varA : ClassA; + build() { + Row() { + Text('ViewA-' + this.varA.id) + } + } +} + +@Entry +@Component +struct ViewB { + @State varB : ClassB = new ClassB(new ClassA(0)); + build() { + Column() { + Row() { + ViewA({ varA: this.varB.a }) + Text('ViewB') + } + } + } +} +` +exports.expectResult = +`"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +let NextID = 0; +let ClassA = class ClassA { + constructor(c) { + this.id = NextID++; + this.c = c; + } +}; +ClassA = __decorate([ + Observed +], ClassA); +let ClassB = class ClassB { + constructor(a) { + this.a = a; + } +}; +ClassB = __decorate([ + Observed +], ClassB); +class ViewA extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__varA = new SynchedPropertyNesedObjectPU(params.varA, this, "varA"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + this.__varA.set(params.varA); + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__varA.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__varA.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get varA() { + return this.__varA.get(); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('ViewA-' + this.varA.id); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Row.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class ViewB extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__varB = new ObservedPropertyObjectPU(new ClassB(new ClassA(0)), this, "varB"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.varB !== undefined) { + this.varB = params.varB; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__varB.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__varB.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get varB() { + return this.__varB.get(); + } + set varB(newValue) { + this.__varB.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + { + const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ViewPU.create(new ViewA(this, { varA: this.varB.a })); + ViewStackProcessor.StopGetAccessRecording(); + } + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('ViewB'); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Row.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new ViewB(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/ui_state_management/others/@watch/@watch.ts b/compiler/test/utForPartialUpdate/ui_state_management/others/@watch/@watch.ts new file mode 100644 index 0000000..1ff88a0 --- /dev/null +++ b/compiler/test/utForPartialUpdate/ui_state_management/others/@watch/@watch.ts @@ -0,0 +1,218 @@ +/* + * 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. + */ + +exports.source = ` +@Entry +@Component +struct CompA { + @State @Watch("onBasketUpdated") shopBasket: Array = [ 7, 12, 47, 3 ]; + @State totalPurchase: number = 0; + @State @Watch('onPutItem') defArray: Array = ['c', 'g', 't', 'z']; + @State resultTip: string = ''; + + updateTotal() : number { + let sum = 0; + this.shopBasket.forEach((i) => { sum += i; }); + this.totalPurchase = (sum < 100) ? sum : 0.9 * sum; + return this.totalPurchase; + } + + onBasketUpdated(propName: string) : void { + animateTo({duration: 1000}, () => { + this.updateTotal(); + }) + } + + updateTip() : string { + let tempArray = this.defArray.slice(0, -1); + let addItem = this.defArray[this.defArray.length -1]; + this.resultTip = tempArray.includes(addItem) ? + 'add item invalid' : + 'congratulations! add item success'; + return this.resultTip; + } + + onPutItem(propName: string) : void { + this.updateTip(); + } + + build() { + Column(){ + Button("add to basket").onClick(() => { + this.shopBasket.push(Math.round(100 * Math.random())) + }) + Text('totalPurchase: ' + this.totalPurchase).fontSize(20) + Button("put item").onClick(() => { + let alList = 'abcdefghijklmnopqrstuvwxyz'; + let ranItem = alList[Math.floor(Math.random() * 26)]; + this.defArray.push(ranItem) + }) + Text('tips: ' + this.resultTip).fontSize(20) + } + } +} +` +exports.expectResult = +`"use strict"; +class CompA extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__shopBasket = new ObservedPropertyObjectPU([7, 12, 47, 3], this, "shopBasket"); + this.__totalPurchase = new ObservedPropertySimplePU(0, this, "totalPurchase"); + this.__defArray = new ObservedPropertyObjectPU(['c', 'g', 't', 'z'], this, "defArray"); + this.__resultTip = new ObservedPropertySimplePU('', this, "resultTip"); + this.declareWatch("shopBasket", this.onBasketUpdated); + this.declareWatch("defArray", this.onPutItem); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.shopBasket !== undefined) { + this.shopBasket = params.shopBasket; + } + if (params.totalPurchase !== undefined) { + this.totalPurchase = params.totalPurchase; + } + if (params.defArray !== undefined) { + this.defArray = params.defArray; + } + if (params.resultTip !== undefined) { + this.resultTip = params.resultTip; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__shopBasket.purgeDependencyOnElmtId(rmElmtId); + this.__totalPurchase.purgeDependencyOnElmtId(rmElmtId); + this.__defArray.purgeDependencyOnElmtId(rmElmtId); + this.__resultTip.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__shopBasket.aboutToBeDeleted(); + this.__totalPurchase.aboutToBeDeleted(); + this.__defArray.aboutToBeDeleted(); + this.__resultTip.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get shopBasket() { + return this.__shopBasket.get(); + } + set shopBasket(newValue) { + this.__shopBasket.set(newValue); + } + get totalPurchase() { + return this.__totalPurchase.get(); + } + set totalPurchase(newValue) { + this.__totalPurchase.set(newValue); + } + get defArray() { + return this.__defArray.get(); + } + set defArray(newValue) { + this.__defArray.set(newValue); + } + get resultTip() { + return this.__resultTip.get(); + } + set resultTip(newValue) { + this.__resultTip.set(newValue); + } + updateTotal() { + let sum = 0; + this.shopBasket.forEach((i) => { sum += i; }); + this.totalPurchase = (sum < 100) ? sum : 0.9 * sum; + return this.totalPurchase; + } + onBasketUpdated(propName) { + Context.animateTo({ duration: 1000 }, () => { + this.updateTotal(); + }); + } + updateTip() { + let tempArray = this.defArray.slice(0, -1); + let addItem = this.defArray[this.defArray.length - 1]; + this.resultTip = tempArray.includes(addItem) ? + 'add item invalid' : + 'congratulations! add item success'; + return this.resultTip; + } + onPutItem(propName) { + this.updateTip(); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel("add to basket"); + Button.onClick(() => { + this.shopBasket.push(Math.round(100 * Math.random())); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('totalPurchase: ' + this.totalPurchase); + Text.fontSize(20); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel("put item"); + Button.onClick(() => { + let alList = 'abcdefghijklmnopqrstuvwxyz'; + let ranItem = alList[Math.floor(Math.random() * 26)]; + this.defArray.push(ranItem); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('tips: ' + this.resultTip); + Text.fontSize(20); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new CompA(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` -- Gitee From fe0318980d1a2b7d4d8630cad4fb91eff046ca27 Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Thu, 13 Oct 2022 20:46:33 +0800 Subject: [PATCH 076/379] Fix hot reload failed when changeFileList not exist Issue:https://gitee.com/openharmony/developtools_ace_ets2bundle/issues/I5VMCV Signed-off-by: chenqy930 Change-Id: Iee4f808ef03624a2730e29d32d0729639fb6f61c --- compiler/src/gen_abc_plugin.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 540f818..6687ced 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -1058,10 +1058,19 @@ function processExtraAssetForBundle() { } function handleHotReloadChangedFiles() { + if (!fs.existsSync(projectConfig.changedFileList)) { + logger.info(blue, `ETS: Cannot find file: ${projectConfig.changedFileList}, skip hot reload build`, reset); + return; + } + let changedFileListJson: string = fs.readFileSync(projectConfig.changedFileList).toString(); let changedFileList: Array = JSON.parse(changedFileListJson).modifiedFiles; - let relativeProjectPath = projectConfig.projectPath.slice(projectConfig.projectRootPath.length + path.sep.length); + if (typeof(changedFileList) == "undefined" || changedFileList.length == 0) { + logger.info(blue, `ETS: No changed files found, skip hot reload build`, reset); + return; + } + let relativeProjectPath = projectConfig.projectPath.slice(projectConfig.projectRootPath.length + path.sep.length); const nodeModulesFile: Array = []; let hotReloadSourceMap: Object = {}; moduleInfos = []; @@ -1084,8 +1093,8 @@ function handleHotReloadChangedFiles() { } else if (file.endsWith(EXTNAME_JS) || file.endsWith(EXTNAME_MJS) || file.endsWith(EXTNAME_CJS)) { processJsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); } else { - logger.debug(red, `ETS:ERROR Cannot find resolve this file path: ${filePath}`, reset); - process.exitCode = FAIL; + logger.debug(red, `ETS:ERROR Cannot resolve file path: ${filePath}, stop hot reload build`, reset); + return; } let sourceMapPath: string = toUnixPath(path.join(relativeProjectPath, file)); -- Gitee From 9152e27017d25ec17cf5122633532bfc0848ead6 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 17 Oct 2022 17:45:50 +0800 Subject: [PATCH 077/379] houhaoyu@huawei.com hot reload bugfix Signed-off-by: houhaoyu Change-Id: I952c050a5071a1aab168fab39a916da4a7b1b1b2 --- compiler/main.js | 11 ++++++++++- compiler/src/compile_info.ts | 11 +++++++++-- compiler/src/ets_checker.ts | 11 ++++++++--- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index f6be94e..7064cee 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -17,7 +17,10 @@ const fs = require('fs'); const path = require('path'); const md5 = require('md5'); -const { readFile } = require('./lib/utils'); +const { + readFile, + writeFileSync +} = require('./lib/utils'); const { WORKERS_DIR } = require('./lib/pre_define'); const { @@ -365,6 +368,12 @@ function readWorkerFile(isPreview) { projectConfig.patchAbcPath = workerConfig.patchConfig.patchAbcPath; projectConfig.changedFileList = workerConfig.patchConfig.changedFileList ? workerConfig.patchConfig.changedFileList : path.join(projectConfig.cachePath, 'changedFileList.json'); + if (projectConfig.hotReload) { + writeFileSync(projectConfig.changedFileList, JSON.stringify({ + modifiedFiles: [], + removedFiles: [] + })); + } } } return null; diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 81b7f05..2bc6f95 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -46,7 +46,8 @@ import { } from './pre_define'; import { createLanguageService, - createWatchCompilerHost + createWatchCompilerHost, + readDeaclareFiles } from './ets_checker'; import { globalProgram, @@ -87,6 +88,7 @@ interface NeedUpdateFlag { flag: boolean; } +export let hotReloadSupportFiles: Set = new Set(); export let cache: Cache = {}; export const shouldResolvedFiles: Set = new Set() type Cache = Record; @@ -206,6 +208,11 @@ export class ResultStates { rootFileNames.push(fileName.replace('?entry', '')); }); if (process.env.watchMode === 'true') { + if (projectConfig.hotReload) { + [...rootFileNames, ...readDeaclareFiles()].forEach(fileName => { + hotReloadSupportFiles.add(path.resolve(fileName)); + }) + } globalProgram.watchProgram = ts.createWatchProgram( createWatchCompilerHost(rootFileNames, this.printDiagnostic.bind(this), this.delayPrintLogCount.bind(this))); @@ -250,7 +257,7 @@ export class ResultStates { if (this.shouldWriteChangedList(watchModifiedFiles, watchRemovedFiles)) { watchRemovedFiles = watchRemovedFiles.map(file => path.relative(projectConfig.projectPath, file)); allModifiedFiles = new Set([...allModifiedFiles, ...watchModifiedFiles - .filter(file => fs.statSync(file).isFile()) + .filter(file => fs.statSync(file).isFile() && hotReloadSupportFiles.has(file)) .map(file => path.relative(projectConfig.projectPath, file))] .filter(file => !watchRemovedFiles.includes(file))); const filesObj: filesObj = { diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index d5ad3e7..7efc042 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -43,12 +43,13 @@ import { resolveSourceFile } from './resolve_ohm_url'; import { CacheFileName, cache, - shouldResolvedFiles + shouldResolvedFiles, + hotReloadSupportFiles } from './compile_info'; import { hasDecorator } from './utils'; import { isExtendFunction, isOriginalExtend } from './process_ui_syntax'; -function readDeaclareFiles(): string[] { +export function readDeaclareFiles(): string[] { const declarationsFileNames: string[] = []; fs.readdirSync(path.resolve(__dirname, '../declarations')) .forEach((fileName: string) => { @@ -198,11 +199,15 @@ function resolveModuleNames(moduleNames: string[], containingFile: string): ts.R resolvedModules.push(null); } } + if (projectConfig.hotReload && resolvedModules.length && + resolvedModules[resolvedModules.length - 1]) { + hotReloadSupportFiles.add(path.resolve(resolvedModules[resolvedModules.length - 1].resolvedFileName)); + } } if (!projectConfig.xtsMode) { createOrUpdateCache(resolvedModules, containingFile); } - resolvedModulesCache[path.resolve(containingFile)] = resolvedModules + resolvedModulesCache[path.resolve(containingFile)] = resolvedModules; return resolvedModules; } return resolvedModulesCache[path.resolve(containingFile)]; -- Gitee From 4046f63c6c84821428c4d63f1e7856b84423587f Mon Sep 17 00:00:00 2001 From: lihong Date: Tue, 18 Oct 2022 21:10:49 +0800 Subject: [PATCH 078/379] lihong67@huawei.com fix localStorage init problem in partialUpdateMode. Signed-off-by: lihong Change-Id: Ie7b8745ea53d303fd6fa6821552e5cf2fb9a0493 --- compiler/src/process_ui_syntax.ts | 19 +++++++++++++------ compiler/src/validate_ui_syntax.ts | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 1469357..1d712bb 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -605,7 +605,9 @@ function createEntryNode(node: ts.SourceFile, context: ts.TransformationContext) const entryNodes: ts.ExpressionStatement[] = createEntryFunction(componentCollection.entryComponent, context, cardRelativePath) as ts.ExpressionStatement[]; - return context.factory.updateSourceFile(node, [...node.statements, ...entryNodes]); + return entryNodes ? + context.factory.updateSourceFile(node, [...node.statements, ...entryNodes]) : + context.factory.updateSourceFile(node, [...node.statements]); } } else { return node; @@ -655,7 +657,7 @@ function createEntryFunction(name: string, context: ts.TransformationContext, ca } else { return [ createStartGetAccessRecording(context), - createLoadDocument(context, name, cardRelativePath), + createLoadDocument(context, name, cardRelativePath, localStorageName), createStopGetAccessRecording(context) ]; } @@ -682,13 +684,18 @@ function createStartGetAccessRecording(context: ts.TransformationContext): ts.Ex } function createLoadDocument(context: ts.TransformationContext, name: string, - cardRelativePath: string): ts.ExpressionStatement { + cardRelativePath: string, localStorageName: string): ts.ExpressionStatement { + const newArray: ts.Expression[] = [ + context.factory.createIdentifier('undefined'), + context.factory.createObjectLiteralExpression([], false) + ]; + if (localStorageName) { + newArray.push(context.factory.createIdentifier(localStorageName)); + } const newExpressionParams: any[] = [ context.factory.createNewExpression( context.factory.createIdentifier(name), - undefined, - [context.factory.createIdentifier('undefined'), - context.factory.createObjectLiteralExpression([], false)])]; + undefined, newArray)]; addCardStringliteral(newExpressionParams, context, cardRelativePath); return context.factory.createExpressionStatement( context.factory.createCallExpression( diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 2c20a6c..f2649c9 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -278,6 +278,7 @@ function checkDecorators(decorators: ts.NodeArray, result: Decorat checkEntryComponent(node, log); result.entryCount++; componentCollection.entryComponent = componentName; + componentCollection.entryComponentPos = node.getStart(); collectLocalStorageName(element); break; case COMPONENT_DECORATOR_PREVIEW: @@ -316,7 +317,6 @@ function checkDecorators(decorators: ts.NodeArray, result: Decorat function collectLocalStorageName(node: ts.Decorator): void { if (node && node.expression && ts.isCallExpression(node.expression)) { - componentCollection.entryComponentPos = node.expression.pos; if (node.expression.arguments && node.expression.arguments.length) { node.expression.arguments.forEach((item: ts.Node, index: number) => { if (ts.isIdentifier(item) && index === 0) { -- Gitee From c34a8ddff19fb85ec7dc8d56326e590f76c2833f Mon Sep 17 00:00:00 2001 From: hufeng Date: Tue, 18 Oct 2022 21:21:33 +0800 Subject: [PATCH 079/379] Fix node_modules's module entry info Signed-off-by: hufeng Change-Id: Ic5ca38d10ac6e1854d7ab75a5c8a9b53ede939fb --- compiler/src/gen_abc_plugin.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index c41630a..08de8de 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -242,13 +242,18 @@ function clearGlobalInfo() { buildMapFileList = new Set(); } -function getEntryInfo(tempFilePath: string, resourceResolveData: any): void { +function getEntryInfo(filePath: string, tempFilePath: string, resourceResolveData: any): void { if (!resourceResolveData.descriptionFilePath) { return; } - const packageName: string = resourceResolveData.descriptionFileData['name']; const packageJsonPath: string = resourceResolveData.descriptionFilePath; let npmInfoPath: string = path.resolve(packageJsonPath, '..'); + + let entry: string = toUnixPath(filePath.replace(npmInfoPath, '')); + if (entry.startsWith('/')) { + entry = entry.slice(1, entry.length); + } + const fakeEntryPath: string = path.resolve(npmInfoPath, 'fake.js'); const tempFakeEntryPath: string = genTemporaryPath(fakeEntryPath, projectConfig.projectPath, process.env.cachePath); const buildFakeEntryPath: string = genBuildPath(fakeEntryPath, projectConfig.projectPath, projectConfig.buildPath); @@ -263,18 +268,12 @@ function getEntryInfo(tempFilePath: string, resourceResolveData: any): void { abcFileName = [NODE_MODULES, abcFilePaths[abcFilePaths.length - 1]].join(path.sep); abcFileName = toUnixPath(abcFileName); - const packagePaths: string[] = tempFilePath.split(NODE_MODULES); - const entryPaths: string[] = packagePaths[packagePaths.length - 1].split(packageName); - let entry: string = toUnixPath(entryPaths[entryPaths.length - 1]); - if (entry.startsWith('/')) { - entry = entry.slice(1, entry.length); - } const entryInfo: EntryInfo = new EntryInfo(npmInfoPath, abcFileName, buildNpmInfoPath, entry); entryInfos.set(npmInfoPath, entryInfo); } function processNodeModulesFile(filePath: string, tempFilePath: string, buildFilePath: string, abcFilePath: string, nodeModulesFile: Array, module: any): void { - getEntryInfo(tempFilePath, module.resourceResolveData); + getEntryInfo(filePath, tempFilePath, module.resourceResolveData); const descriptionFileData: any = module.resourceResolveData.descriptionFileData; if (descriptionFileData && descriptionFileData['type'] && descriptionFileData['type'] === 'module') { const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, false); -- Gitee From 594d89e0af93637b2b1e83c14fc3ebc8b8e651a5 Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Wed, 19 Oct 2022 11:52:23 +0800 Subject: [PATCH 080/379] Keep watchmode alive when compile failed Issue:https://gitee.com/openharmony/developtools_ace_ets2bundle/issues/I5WIEO Signed-off-by: chenqy930 Change-Id: Ia4146e4674dcef8d5e0dc7148bcb31d7cb0b5e2b --- compiler/src/gen_merged_abc.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index ea1004c..f9b0b89 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -103,6 +103,8 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma } } catch (e) { logger.debug(red, `ETS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); - process.exit(FAIL); + if (process.env.watchMode !== 'true') { + process.exit(FAIL); + } } } -- Gitee From 519eb5902a9df6be184782ba783534e8e5187ea4 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Tue, 27 Sep 2022 19:08:46 +0800 Subject: [PATCH 081/379] Adapter merge abc of ts2abc Signed-off-by: zhangrengao Change-Id: I5f07f85225a4c18020843351dc62fd958b92701b --- compiler/src/gen_abc_plugin.ts | 99 +++++++++++++++++++++++++++------- compiler/src/gen_merged_abc.ts | 2 +- compiler/src/gen_module_abc.ts | 26 ++++----- compiler/src/utils.ts | 39 +++++++++++++- 4 files changed, 129 insertions(+), 37 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index c41630a..bd61e83 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -21,6 +21,7 @@ import os from 'os'; import events from 'events'; import Compiler from 'webpack/lib/Compiler'; import { logger } from './compile_info'; +import * as childProcess from 'child_process'; import { toUnixPath, toHashData, @@ -32,7 +33,9 @@ import { checkNodeModulesFile, compareNodeVersion, removeDir, - newSourceMaps + newSourceMaps, + genProtoFileName, + genMergeProtoFileName } from './utils'; import { projectConfig } from '../main'; import { @@ -56,10 +59,16 @@ import { SOURCEMAPS_JSON, SOURCEMAPS, TEMPORARY, - TS2ABC + TS2ABC, + FILESINFO_TXT } from './pre_define'; -import { getOhmUrlByFilepath } from './resolve_ohm_url'; -import { generateMergedAbc } from './gen_merged_abc'; +import { + getOhmUrlByFilepath +} from './resolve_ohm_url'; +import { + generateMergedAbc, + generateNpmEntriesInfo +} from './gen_merged_abc'; const genAbcScript: string = 'gen_abc.js'; const genModuleAbcScript: string = 'gen_module_abc.js'; @@ -89,6 +98,7 @@ let moduleHashJsonObject = {}; let buildPathInfo: string = ''; let buildMapFileList: Set = new Set(); let isHotReloadFirstBuild: boolean = true; +let protoFilePath: string = ''; const red: string = '\u001b[31m'; const reset: string = '\u001b[39m'; @@ -660,6 +670,7 @@ function invokeClusterModuleToAbc(): void { clearGlobalInfo(); if (process.env.watchMode === 'true' && compileCount < previewCount) { compileCount++; + processExtraAssetForBundle(); if (process.exitCode === SUCCESS) { console.info(blue, 'COMPILE RESULT:SUCCESS ', reset); } else { @@ -674,6 +685,16 @@ function invokeClusterModuleToAbc(): void { } logger.debug(`worker ${worker.process.pid} finished`); }); + + process.on('exit', (code) => { + // for build options + processExtraAssetForBundle(); + }); + + // for preview of without incre compile + if (totalWorkerNumber === 0 && process.env.watchMode === 'true') { + processExtraAssetForBundle(); + } } } @@ -842,7 +863,7 @@ function filterIntermediateModuleByHashJson(buildPath: string, moduleInfos: Arra filterModuleInfos = []; for (let i = 0; i < moduleInfos.length; ++i) { const input: string = moduleInfos[i].tempFilePath; - let outputPath: string = moduleInfos[i].abcFilePath; + let outputPath: string = genProtoFileName(moduleInfos[i].tempFilePath); if (!fs.existsSync(input)) { logger.debug(red, `ETS:ERROR ${input} is lost`, reset); process.exitCode = FAIL; @@ -858,7 +879,10 @@ function filterIntermediateModuleByHashJson(buildPath: string, moduleInfos: Arra if (projectConfig.buildArkMode === 'debug' && fs.existsSync(moduleInfos[i].tempFilePath)) { fs.copyFileSync(moduleInfos[i].tempFilePath, moduleInfos[i].buildFilePath); } - fs.copyFileSync(genAbcFileName(moduleInfos[i].tempFilePath), genAbcFileName(moduleInfos[i].buildFilePath)); + let protoTempPath: string = genProtoFileName(moduleInfos[i].tempFilePath); + let protoBuildPath: string = genMergeProtoFileName(protoTempPath); + mkdirsSync(path.dirname(protoBuildPath)); + fs.copyFileSync(protoTempPath, protoBuildPath); if (projectConfig.buildArkMode === 'debug' && fs.existsSync(genSourceMapFileName(moduleInfos[i].tempFilePath))) { fs.copyFileSync(genSourceMapFileName(moduleInfos[i].tempFilePath), genSourceMapFileName(moduleInfos[i].buildFilePath)); } @@ -877,24 +901,16 @@ function filterIntermediateModuleByHashJson(buildPath: string, moduleInfos: Arra function writeModuleHashJson(): void { for (let i = 0; i < filterModuleInfos.length; ++i) { const input: string = filterModuleInfos[i].tempFilePath; - let outputPath: string = filterModuleInfos[i].abcFilePath; + let outputPath: string = genProtoFileName(filterModuleInfos[i].tempFilePath);; if (!fs.existsSync(input) || !fs.existsSync(outputPath)) { logger.debug(red, `ETS:ERROR ${input} is lost`, reset); process.exitCode = FAIL; break; } const hashInputContentData: any = toHashData(input); - const hashAbcContentData: any = toHashData(outputPath); + const hashOutputContentData: any = toHashData(outputPath); moduleHashJsonObject[input] = hashInputContentData; - moduleHashJsonObject[outputPath] = hashAbcContentData; - mkdirsSync(path.dirname(filterModuleInfos[i].buildFilePath)); - if (projectConfig.buildArkMode === 'debug' && fs.existsSync(filterModuleInfos[i].tempFilePath)) { - fs.copyFileSync(filterModuleInfos[i].tempFilePath, filterModuleInfos[i].buildFilePath); - } - fs.copyFileSync(genAbcFileName(filterModuleInfos[i].tempFilePath), genAbcFileName(filterModuleInfos[i].buildFilePath)); - if (projectConfig.buildArkMode === 'debug' && fs.existsSync(genSourceMapFileName(filterModuleInfos[i].tempFilePath))) { - fs.copyFileSync(genSourceMapFileName(filterModuleInfos[i].tempFilePath), genSourceMapFileName(filterModuleInfos[i].buildFilePath)); - } + moduleHashJsonObject[outputPath] = hashOutputContentData; } const hashFilePath: string = genHashJsonPath(buildPathInfo); if (hashFilePath.length === 0) { @@ -1052,8 +1068,15 @@ function copyFileCachePathToBuildPath() { } function processExtraAssetForBundle() { - writeHashJson(); - copyFileCachePathToBuildPath(); + if (projectConfig.compileMode === JSBUNDLE || projectConfig.compileMode === undefined) { + writeHashJson(); + copyFileCachePathToBuildPath(); + } else if (projectConfig.compileMode === ESMODULE) { + writeModuleHashJson(); + copyModuleFileCachePathToBuildPath(); + mergeProtoToAbc(); + generateNpmEntriesInfo(entryInfos); + } clearGlobalInfo(); } @@ -1125,3 +1148,41 @@ function handleFinishModules(modules, callback) { isHotReloadFirstBuild = false; } } + +function copyModuleFileCachePathToBuildPath(): void { + protoFilePath = path.join(path.join(process.env.cachePath, "protos", FILESINFO_TXT)); + removeDir(path.dirname(protoFilePath)); + mkdirsSync(path.dirname(protoFilePath)); + let entriesInfo: string = ''; + for (let i = 0; i < moduleInfos.length; ++i) { + mkdirsSync(path.dirname(moduleInfos[i].buildFilePath)); + if (projectConfig.buildArkMode === 'debug' && fs.existsSync(moduleInfos[i].tempFilePath)) { + fs.copyFileSync(moduleInfos[i].tempFilePath, moduleInfos[i].buildFilePath); + } + let protoTempPath: string = genProtoFileName(moduleInfos[i].tempFilePath); + let protoBuildPath: string = genMergeProtoFileName(protoTempPath); + entriesInfo += `${toUnixPath(protoBuildPath)}\n`; + mkdirsSync(path.dirname(protoBuildPath)); + fs.copyFileSync(protoTempPath, protoBuildPath); + if (projectConfig.buildArkMode === 'debug' && fs.existsSync(genSourceMapFileName(moduleInfos[i].tempFilePath))) { + fs.copyFileSync(genSourceMapFileName(moduleInfos[i].tempFilePath), genSourceMapFileName(moduleInfos[i].buildFilePath)); + } + } + fs.writeFileSync(protoFilePath, entriesInfo, 'utf-8'); +} + +function mergeProtoToAbc(): void { + let mergeAbc: string = path.join(arkDir, 'build', 'bin', 'merge_abc'); + if (isWin) { + mergeAbc = path.join(arkDir, 'build-win', 'bin', 'merge_abc.exe'); + } else if (isMac) { + mergeAbc = path.join(arkDir, 'build-mac', 'bin', 'merge_abc'); + } + let mergeAbcName = "modules.abc"; + const singleCmd: any = `"${mergeAbc}" --input "@${protoFilePath}" --outputFilePath "${projectConfig.buildPath}" --output ${mergeAbcName} --suffix protoBin`; + try { + childProcess.execSync(singleCmd); + } catch (e) { + logger.debug(red, `ETS:ERROR Failed to merge proto file to abc`, reset); + } +} diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index ea1004c..9dec234 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -55,7 +55,7 @@ function generateCompileFilesInfo(moduleInfos: Array) { fs.writeFileSync(filesInfoPath, filesInfo, 'utf-8'); } -function generateNpmEntriesInfo(entryInfos: Map) { +export function generateNpmEntriesInfo(entryInfos: Map) { const npmEntriesInfoPath: string = path.join(process.env.cachePath, NPMENTRIES_TXT); let entriesInfo: string = ''; for (const value of entryInfos.values()) { diff --git a/compiler/src/gen_module_abc.ts b/compiler/src/gen_module_abc.ts index 76aac81..7ea65f2 100644 --- a/compiler/src/gen_module_abc.ts +++ b/compiler/src/gen_module_abc.ts @@ -23,31 +23,27 @@ import { TS2ABC, ES2ABC } from './pre_define'; +import { + genProtoFileName, +} from './utils'; +import { projectConfig } from '../main'; const red: string = '\u001b[31m'; const reset: string = '\u001b[39m'; function js2abcByWorkers(jsonInput: string, cmd: string): Promise { const inputPaths: any = JSON.parse(jsonInput); - const result: any[] = []; - const chunkSize = 5; - for (let i = 0; i < inputPaths.length; i += chunkSize) { - result.push(inputPaths.slice(i, i + chunkSize)); - } - - for (let i = 0; i < result.length; i++) { - const inputs = []; - for (let j = 0; j < result[i].length; j++) { - const input: string = result[i][j].tempFilePath; - inputs.push('"' + input + '"'); - } - const inputsStr: string = inputs.join(' '); - const singleCmd: any = `${cmd} ${inputsStr}`; + for (let i = 0; i < inputPaths.length; ++i) { + const input: string = inputPaths[i].tempFilePath; + const ohmURL: string = inputPaths[i].recordName; + const protoFileName: string = genProtoFileName(input); + const sourceFile: string = inputPaths[i].filePath.replace(projectConfig.projectRootPath, ''); + const singleCmd: any = `${cmd} "${input}" --record-name "${ohmURL}" --source-file "${sourceFile}" --output-proto "${protoFileName}"`; logger.debug('gen abc cmd is: ', singleCmd); try { childProcess.execSync(singleCmd); } catch (e) { - logger.debug(red, `ETS:ERROR Failed to convert file ${inputsStr} to abc `, reset); + logger.debug(red, `ETS:ERROR Failed to convert file ${input} to proto `, reset); process.exit(FAIL); } } diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 2641809..3457666 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -39,7 +39,10 @@ import { FAIL, CARD_LOG_TYPE_COMPONENTS, CARD_LOG_TYPE_DECORATORS, - CARD_LOG_TYPE_IMPORT + CARD_LOG_TYPE_IMPORT, + TS2ABC, + ES2ABC, + EXTNAME_PROTO_BIN } from './pre_define'; import { minify, MinifyOutput } from 'terser'; import { resourceFileName } from './process_ui_syntax'; @@ -628,4 +631,36 @@ export function parseErrorMessage(message: string): string { } }); return logContent; -} \ No newline at end of file +} + +export function isEs2Abc(): boolean { + if (process.env.panda === ES2ABC || process.env.panda === 'undefined' || process.env.panda === undefined) { + return true; + } + return false; +} + +export function isTs2Abc(): boolean { + if (process.env.panda === TS2ABC) { + return true; + } + return false; +} + +export function genProtoFileName(temporaryFile: string): string { + let protoFile: string = temporaryFile; + if (temporaryFile.endsWith(EXTNAME_TS)) { + protoFile = temporaryFile.replace(/\.ts$/, EXTNAME_PROTO_BIN); + } else { + protoFile = temporaryFile.replace(/\.js$/, EXTNAME_PROTO_BIN); + } + return protoFile; +} + +export function genMergeProtoFileName(temporaryFile: string): string { + let protoTempPathArr: string[] = temporaryFile.split(TEMPORARY); + const sufStr: string = protoTempPathArr[protoTempPathArr.length - 1]; + let protoBuildPath: string = path.join(process.env.cachePath, "protos", sufStr); + + return protoBuildPath; +} -- Gitee From bd3a6b8da0584ca54c69772fbe30f43fb63606b9 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Thu, 29 Sep 2022 15:29:17 +0800 Subject: [PATCH 082/379] Adapter merge abc of ts2abc sourcemap Signed-off-by: zhangrengao Change-Id: I21daba3199b9ae9f3f1611713c29c3f3a0a65e52 --- compiler/src/gen_abc_plugin.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index bd61e83..dc8363d 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -450,15 +450,16 @@ function handleFullModuleFiles(modules, callback): any { } }); - if (projectConfig.compileMode === ESMODULE && process.env.panda !== TS2ABC) { - if (projectConfig.buildArkMode === 'debug') { - const moduleList: Array = Array.from(buildMapFileList); - updateCachedSourceMaps(); - eliminateUnusedFiles(moduleList); - updateCachedModuleList(moduleList); - writeSourceMaps(); - } + // for mergeabc source maps + if (projectConfig.buildArkMode === 'debug') { + const moduleList: Array = Array.from(buildMapFileList); + updateCachedSourceMaps(); + eliminateUnusedFiles(moduleList); + updateCachedModuleList(moduleList); + writeSourceMaps(); + } + if (projectConfig.compileMode === ESMODULE && process.env.panda !== TS2ABC) { const outputABCPath: string = path.join(projectConfig.buildPath, MODULES_ABC); generateMergedAbc(moduleInfos, entryInfos, outputABCPath); clearGlobalInfo(); @@ -666,8 +667,6 @@ function invokeClusterModuleToAbc(): void { } count_++; if (count_ === totalWorkerNumber) { - writeModuleHashJson(); - clearGlobalInfo(); if (process.env.watchMode === 'true' && compileCount < previewCount) { compileCount++; processExtraAssetForBundle(); -- Gitee From 855a559dea1f1dbdcc88ca21d89eb011187162ee Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Fri, 30 Sep 2022 11:17:39 +0800 Subject: [PATCH 083/379] remove js file to build path Signed-off-by: zhangrengao Change-Id: I225b662484840ceda8546db28c24c4edaf0a53ed --- compiler/src/gen_abc_plugin.ts | 16 +--------------- compiler/src/gen_module_abc.ts | 2 +- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index dc8363d..1edc7b7 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -874,17 +874,6 @@ function filterIntermediateModuleByHashJson(buildPath: string, moduleInfos: Arra if (jsonObject[input] === hashInputContentData && jsonObject[outputPath] === hashAbcContentData) { updateJsonObject[input] = hashInputContentData; updateJsonObject[outputPath] = hashAbcContentData; - mkdirsSync(path.dirname(moduleInfos[i].buildFilePath)); - if (projectConfig.buildArkMode === 'debug' && fs.existsSync(moduleInfos[i].tempFilePath)) { - fs.copyFileSync(moduleInfos[i].tempFilePath, moduleInfos[i].buildFilePath); - } - let protoTempPath: string = genProtoFileName(moduleInfos[i].tempFilePath); - let protoBuildPath: string = genMergeProtoFileName(protoTempPath); - mkdirsSync(path.dirname(protoBuildPath)); - fs.copyFileSync(protoTempPath, protoBuildPath); - if (projectConfig.buildArkMode === 'debug' && fs.existsSync(genSourceMapFileName(moduleInfos[i].tempFilePath))) { - fs.copyFileSync(genSourceMapFileName(moduleInfos[i].tempFilePath), genSourceMapFileName(moduleInfos[i].buildFilePath)); - } } else { filterModuleInfos.push(moduleInfos[i]); } @@ -1154,10 +1143,6 @@ function copyModuleFileCachePathToBuildPath(): void { mkdirsSync(path.dirname(protoFilePath)); let entriesInfo: string = ''; for (let i = 0; i < moduleInfos.length; ++i) { - mkdirsSync(path.dirname(moduleInfos[i].buildFilePath)); - if (projectConfig.buildArkMode === 'debug' && fs.existsSync(moduleInfos[i].tempFilePath)) { - fs.copyFileSync(moduleInfos[i].tempFilePath, moduleInfos[i].buildFilePath); - } let protoTempPath: string = genProtoFileName(moduleInfos[i].tempFilePath); let protoBuildPath: string = genMergeProtoFileName(protoTempPath); entriesInfo += `${toUnixPath(protoBuildPath)}\n`; @@ -1178,6 +1163,7 @@ function mergeProtoToAbc(): void { mergeAbc = path.join(arkDir, 'build-mac', 'bin', 'merge_abc'); } let mergeAbcName = "modules.abc"; + mkdirsSync(projectConfig.buildPath); const singleCmd: any = `"${mergeAbc}" --input "@${protoFilePath}" --outputFilePath "${projectConfig.buildPath}" --output ${mergeAbcName} --suffix protoBin`; try { childProcess.execSync(singleCmd); diff --git a/compiler/src/gen_module_abc.ts b/compiler/src/gen_module_abc.ts index 7ea65f2..b5ab42e 100644 --- a/compiler/src/gen_module_abc.ts +++ b/compiler/src/gen_module_abc.ts @@ -38,7 +38,7 @@ function js2abcByWorkers(jsonInput: string, cmd: string): Promise { const ohmURL: string = inputPaths[i].recordName; const protoFileName: string = genProtoFileName(input); const sourceFile: string = inputPaths[i].filePath.replace(projectConfig.projectRootPath, ''); - const singleCmd: any = `${cmd} "${input}" --record-name "${ohmURL}" --source-file "${sourceFile}" --output-proto "${protoFileName}"`; + const singleCmd: any = `${cmd} "${input}" --record-name "${ohmURL}" --source-file "${sourceFile}" --output-proto`; logger.debug('gen abc cmd is: ', singleCmd); try { childProcess.execSync(singleCmd); -- Gitee From 4c4e2ae88e84fc8f5a13a3570ae0d4d5c14a94a4 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Fri, 14 Oct 2022 09:29:29 +0800 Subject: [PATCH 084/379] Adapater npm entries of js2abc Signed-off-by: zhangrengao Change-Id: I47d23b2ae24ad4b9d3492d636df9435fb40925f5 --- compiler/src/gen_abc_plugin.ts | 58 ++++++++++++++++++---------------- compiler/src/gen_module_abc.ts | 3 +- compiler/src/pre_define.ts | 1 + 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 1edc7b7..4ad5a11 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -60,7 +60,9 @@ import { SOURCEMAPS, TEMPORARY, TS2ABC, - FILESINFO_TXT + PROTO_FILESINFO_TXT, + NPMENTRIES_TXT, + EXTNAME_PROTO_BIN } from './pre_define'; import { getOhmUrlByFilepath @@ -470,17 +472,24 @@ function handleFullModuleFiles(modules, callback): any { } function processEntryToGenAbc(entryInfos: Map): void { - for (const value of entryInfos.values()) { - const tempAbcFilePath: string = toUnixPath(path.resolve(value.npmInfo, ENTRY_TXT)); - const buildAbcFilePath: string = toUnixPath(path.resolve(value.buildPath, ENTRY_TXT)); - fs.writeFileSync(tempAbcFilePath, value.entry, 'utf-8'); - if (!fs.existsSync(buildAbcFilePath)) { - const parent: string = path.join(buildAbcFilePath, '..'); - if (!(fs.existsSync(parent) && fs.statSync(parent).isDirectory())) { - mkDir(parent); - } - } - fs.copyFileSync(tempAbcFilePath, buildAbcFilePath); + if (entryInfos.size <= 0) { + return; + } + generateNpmEntriesInfo(entryInfos); + const npmEntriesInfoPath: string = path.join(process.env.cachePath, NPMENTRIES_TXT); + let npmEntriesProtoFileName: string = "npm_entries" + EXTNAME_PROTO_BIN; + const npmEntriesProtoFilePath = path.join(path.join(process.env.cachePath, "protos", "npm_entries", npmEntriesProtoFileName)); + let js2Abc: string = path.join(arkDir, 'build', 'bin', 'js2abc'); + if (isWin) { + js2Abc = path.join(arkDir, 'build-win', 'bin', 'js2abc.exe'); + } else if (isMac) { + js2Abc = path.join(arkDir, 'build-mac', 'bin', 'js2abc'); + } + const singleCmd: any = `"${js2Abc}" --compile-npm-entries "${npmEntriesInfoPath}" "${npmEntriesProtoFilePath}`; + try { + childProcess.execSync(singleCmd); + } catch (e) { + logger.debug(red, `ETS:ERROR Failed to generate npm proto file to abc`, reset); } } @@ -669,7 +678,7 @@ function invokeClusterModuleToAbc(): void { if (count_ === totalWorkerNumber) { if (process.env.watchMode === 'true' && compileCount < previewCount) { compileCount++; - processExtraAssetForBundle(); + processExtraAsset(); if (process.exitCode === SUCCESS) { console.info(blue, 'COMPILE RESULT:SUCCESS ', reset); } else { @@ -687,12 +696,12 @@ function invokeClusterModuleToAbc(): void { process.on('exit', (code) => { // for build options - processExtraAssetForBundle(); + processExtraAsset(); }); // for preview of without incre compile if (totalWorkerNumber === 0 && process.env.watchMode === 'true') { - processExtraAssetForBundle(); + processExtraAsset(); } } } @@ -807,7 +816,7 @@ function invokeWorkersToGenAbc(): void { // for preview of with incre compile if (process.env.watchMode === 'true' && compileCount < previewCount) { compileCount++; - processExtraAssetForBundle(); + processExtraAsset(); if (process.exitCode === SUCCESS) { console.info(blue, 'COMPILE RESULT:SUCCESS ', reset); } else { @@ -824,12 +833,12 @@ function invokeWorkersToGenAbc(): void { process.on('exit', (code) => { // for build options - processExtraAssetForBundle(); + processExtraAsset(); }); // for preview of without incre compile if (workerNumber === 0 && process.env.watchMode === 'true') { - processExtraAssetForBundle(); + processExtraAsset(); } } } @@ -1055,7 +1064,7 @@ function copyFileCachePathToBuildPath() { } } -function processExtraAssetForBundle() { +function processExtraAsset() { if (projectConfig.compileMode === JSBUNDLE || projectConfig.compileMode === undefined) { writeHashJson(); copyFileCachePathToBuildPath(); @@ -1138,19 +1147,12 @@ function handleFinishModules(modules, callback) { } function copyModuleFileCachePathToBuildPath(): void { - protoFilePath = path.join(path.join(process.env.cachePath, "protos", FILESINFO_TXT)); - removeDir(path.dirname(protoFilePath)); + protoFilePath = path.join(path.join(process.env.cachePath, "protos", PROTO_FILESINFO_TXT)); mkdirsSync(path.dirname(protoFilePath)); let entriesInfo: string = ''; for (let i = 0; i < moduleInfos.length; ++i) { let protoTempPath: string = genProtoFileName(moduleInfos[i].tempFilePath); - let protoBuildPath: string = genMergeProtoFileName(protoTempPath); - entriesInfo += `${toUnixPath(protoBuildPath)}\n`; - mkdirsSync(path.dirname(protoBuildPath)); - fs.copyFileSync(protoTempPath, protoBuildPath); - if (projectConfig.buildArkMode === 'debug' && fs.existsSync(genSourceMapFileName(moduleInfos[i].tempFilePath))) { - fs.copyFileSync(genSourceMapFileName(moduleInfos[i].tempFilePath), genSourceMapFileName(moduleInfos[i].buildFilePath)); - } + entriesInfo += `${toUnixPath(protoTempPath)}\n`; } fs.writeFileSync(protoFilePath, entriesInfo, 'utf-8'); } diff --git a/compiler/src/gen_module_abc.ts b/compiler/src/gen_module_abc.ts index b5ab42e..13c59e2 100644 --- a/compiler/src/gen_module_abc.ts +++ b/compiler/src/gen_module_abc.ts @@ -25,6 +25,7 @@ import { } from './pre_define'; import { genProtoFileName, + toUnixPath } from './utils'; import { projectConfig } from '../main'; @@ -37,7 +38,7 @@ function js2abcByWorkers(jsonInput: string, cmd: string): Promise { const input: string = inputPaths[i].tempFilePath; const ohmURL: string = inputPaths[i].recordName; const protoFileName: string = genProtoFileName(input); - const sourceFile: string = inputPaths[i].filePath.replace(projectConfig.projectRootPath, ''); + const sourceFile: string = toUnixPath(inputPaths[i].filePath.replace(projectConfig.projectRootPath, '')); const singleCmd: any = `${cmd} "${input}" --record-name "${ohmURL}" --source-file "${sourceFile}" --output-proto`; logger.debug('gen abc cmd is: ', singleCmd); try { diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index dd11dc5..e356f09 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -254,6 +254,7 @@ export const MODULELIST_JSON: string = 'moduleList.json'; export const PREBUILDMODE_JSON: string = 'preBuildMode.json'; export const SOURCEMAPS_JSON: string = 'sourceMaps.json'; export const SOURCEMAPS: string = 'sourceMaps.map'; +export const PROTO_FILESINFO_TXT: string = 'protoFilesInfo.txt'; export const ESMODULE: string = 'esmodule'; export const JSBUNDLE: string = 'jsbundle'; -- Gitee From f79ca4ac31af847bdfdca225594ba551291dd9ef Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Sat, 15 Oct 2022 21:22:43 +0800 Subject: [PATCH 085/379] remove duplicate info of entry Signed-off-by: zhangrengao Change-Id: I98e9b4ebe63bcab97e0a83badcf91ad96e31ffe3 --- compiler/src/gen_abc_plugin.ts | 14 ++++++++++---- compiler/src/gen_module_abc.ts | 2 +- compiler/src/utils.ts | 15 +++++++++++++++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 4ad5a11..12380d8 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -35,7 +35,8 @@ import { removeDir, newSourceMaps, genProtoFileName, - genMergeProtoFileName + genMergeProtoFileName, + removeDuplicateInfo } from './utils'; import { projectConfig } from '../main'; import { @@ -461,7 +462,7 @@ function handleFullModuleFiles(modules, callback): any { writeSourceMaps(); } - if (projectConfig.compileMode === ESMODULE && process.env.panda !== TS2ABC) { + if (process.env.panda !== TS2ABC) { const outputABCPath: string = path.join(projectConfig.buildPath, MODULES_ABC); generateMergedAbc(moduleInfos, entryInfos, outputABCPath); clearGlobalInfo(); @@ -478,7 +479,7 @@ function processEntryToGenAbc(entryInfos: Map): void { generateNpmEntriesInfo(entryInfos); const npmEntriesInfoPath: string = path.join(process.env.cachePath, NPMENTRIES_TXT); let npmEntriesProtoFileName: string = "npm_entries" + EXTNAME_PROTO_BIN; - const npmEntriesProtoFilePath = path.join(path.join(process.env.cachePath, "protos", "npm_entries", npmEntriesProtoFileName)); + const npmEntriesProtoFilePath: string = path.join(path.join(process.env.cachePath, "protos", "npm_entries", npmEntriesProtoFileName)); let js2Abc: string = path.join(arkDir, 'build', 'bin', 'js2abc'); if (isWin) { js2Abc = path.join(arkDir, 'build-win', 'bin', 'js2abc.exe'); @@ -1072,7 +1073,6 @@ function processExtraAsset() { writeModuleHashJson(); copyModuleFileCachePathToBuildPath(); mergeProtoToAbc(); - generateNpmEntriesInfo(entryInfos); } clearGlobalInfo(); } @@ -1150,10 +1150,16 @@ function copyModuleFileCachePathToBuildPath(): void { protoFilePath = path.join(path.join(process.env.cachePath, "protos", PROTO_FILESINFO_TXT)); mkdirsSync(path.dirname(protoFilePath)); let entriesInfo: string = ''; + moduleInfos = removeDuplicateInfo(moduleInfos); for (let i = 0; i < moduleInfos.length; ++i) { let protoTempPath: string = genProtoFileName(moduleInfos[i].tempFilePath); entriesInfo += `${toUnixPath(protoTempPath)}\n`; } + if (entryInfos.size > 0) { + let npmEntriesProtoFileName: string = "npm_entries" + EXTNAME_PROTO_BIN; + const npmEntriesProtoFilePath: string = path.join(path.join(process.env.cachePath, "protos", "npm_entries", npmEntriesProtoFileName)); + entriesInfo += `${toUnixPath(npmEntriesProtoFilePath)}\n`; + } fs.writeFileSync(protoFilePath, entriesInfo, 'utf-8'); } diff --git a/compiler/src/gen_module_abc.ts b/compiler/src/gen_module_abc.ts index 13c59e2..2544ad2 100644 --- a/compiler/src/gen_module_abc.ts +++ b/compiler/src/gen_module_abc.ts @@ -39,7 +39,7 @@ function js2abcByWorkers(jsonInput: string, cmd: string): Promise { const ohmURL: string = inputPaths[i].recordName; const protoFileName: string = genProtoFileName(input); const sourceFile: string = toUnixPath(inputPaths[i].filePath.replace(projectConfig.projectRootPath, '')); - const singleCmd: any = `${cmd} "${input}" --record-name "${ohmURL}" --source-file "${sourceFile}" --output-proto`; + const singleCmd: any = `${cmd} "${input}" --record-name "${ohmURL}" --source-file "${sourceFile}" --output-proto --merge-abc`; logger.debug('gen abc cmd is: ', singleCmd); try { childProcess.execSync(singleCmd); diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 3457666..d85ee6f 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -664,3 +664,18 @@ export function genMergeProtoFileName(temporaryFile: string): string { return protoBuildPath; } + +export function removeDuplicateInfo(moduleInfos: Array): Array { + const tempModuleInfos: any[] = Array(); + moduleInfos.forEach((item) => { + let check: boolean = tempModuleInfos.every((newItem) => { + return item.tempFilePath !== newItem.tempFilePath; + }); + if (check) { + tempModuleInfos.push(item); + } + }); + moduleInfos = tempModuleInfos; + + return moduleInfos; +} \ No newline at end of file -- Gitee From 44df421d17a3f3c6f140e1a6edf4cba3ca3583aa Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Tue, 18 Oct 2022 21:27:36 +0800 Subject: [PATCH 086/379] Add sdk validateFilePathLength check Signed-off-by: zhangrengao Change-Id: I2c2fa4ebedf45a3c5e21ce426b7ea1fd51c59575 --- compiler/src/gen_abc_plugin.ts | 43 ++++++++++++++++++++++++----- compiler/src/gen_merged_abc.ts | 15 +++++++++-- compiler/src/utils.ts | 49 +++++++++++++++++++++++++++++++++- 3 files changed, 98 insertions(+), 9 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 953f41a..ccbeedf 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -36,7 +36,8 @@ import { newSourceMaps, genProtoFileName, genMergeProtoFileName, - removeDuplicateInfo + removeDuplicateInfo, + validateFilePathLength } from './utils'; import { projectConfig } from '../main'; import { @@ -172,6 +173,7 @@ export class GenAbcPlugin { if (projectConfig.cachePath && !projectConfig.xtsMode) { let cachedJson: any = {}; const CACHED_BUILDMODE: string = path.join(projectConfig.cachePath, PREBUILDMODE_JSON); + validateFilePathLength(CACHED_BUILDMODE); cachedJson["buildMode"] = projectConfig.buildArkMode; fs.writeFile(CACHED_BUILDMODE, JSON.stringify(cachedJson, null, 2), 'utf-8', (err) => { @@ -363,6 +365,7 @@ var cachedSourceMaps: Object; function updateCachedSourceMaps(): void { const CACHED_SOURCEMAPS: string = path.join(process.env.cachePath, SOURCEMAPS_JSON); + validateFilePathLength(CACHED_SOURCEMAPS); if (!fs.existsSync(CACHED_SOURCEMAPS)) { cachedSourceMaps = {}; } else { @@ -375,6 +378,7 @@ function updateCachedSourceMaps(): void { function getCachedModuleList(): Array { const CACHED_MODULELIST_FILE: string = path.join(process.env.cachePath, MODULELIST_JSON); + validateFilePathLength(CACHED_MODULELIST_FILE); if (!fs.existsSync(CACHED_MODULELIST_FILE)) { return []; } @@ -385,7 +389,9 @@ function getCachedModuleList(): Array { function updateCachedModuleList(moduleList: Array): void { const CACHED_MODULELIST_FILE: string = path.join(process.env.cachePath, MODULELIST_JSON); + validateFilePathLength(CACHED_MODULELIST_FILE); const CACHED_SOURCEMAPS: string = path.join(process.env.cachePath, SOURCEMAPS_JSON); + validateFilePathLength(CACHED_SOURCEMAPS); let cachedJson: Object = {}; cachedJson["list"] = moduleList; fs.writeFile(CACHED_MODULELIST_FILE, JSON.stringify(cachedJson, null, 2), 'utf-8', @@ -406,7 +412,9 @@ function updateCachedModuleList(moduleList: Array): void { function writeSourceMaps(): void { mkdirsSync(projectConfig.buildPath); - fs.writeFile(path.join(projectConfig.buildPath, SOURCEMAPS), JSON.stringify(cachedSourceMaps, null, 2), 'utf-8', + let sourceMapFilePath: string = path.join(projectConfig.buildPath, SOURCEMAPS); + validateFilePathLength(sourceMapFilePath); + fs.writeFile(sourceMapFilePath, JSON.stringify(cachedSourceMaps, null, 2), 'utf-8', (err) => { if (err) { logger.error(red, `ETS:ERROR Failed to write sourceMaps.`, reset); @@ -431,10 +439,12 @@ function handleFullModuleFiles(modules, callback): any { if (module !== undefined && module.resourceResolveData !== undefined) { const filePath: string = module.resourceResolveData.path; let tempFilePath = genTemporaryPath(filePath, projectConfig.projectPath, process.env.cachePath); + validateFilePathLength(tempFilePath); if (tempFilePath.length === 0) { return; } let buildFilePath: string = genBuildPath(filePath, projectConfig.projectPath, projectConfig.buildPath); + validateFilePathLength(buildFilePath); tempFilePath = toUnixPath(tempFilePath); buildFilePath = toUnixPath(buildFilePath); if (filePath.endsWith(EXTNAME_ETS)) { @@ -463,6 +473,7 @@ function handleFullModuleFiles(modules, callback): any { if (process.env.panda !== TS2ABC) { const outputABCPath: string = path.join(projectConfig.buildPath, MODULES_ABC); + validateFilePathLength(outputABCPath); generateMergedAbc(moduleInfos, entryInfos, outputABCPath); clearGlobalInfo(); } else { @@ -477,14 +488,18 @@ function processEntryToGenAbc(entryInfos: Map): void { } generateNpmEntriesInfo(entryInfos); const npmEntriesInfoPath: string = path.join(process.env.cachePath, NPMENTRIES_TXT); + validateFilePathLength(npmEntriesInfoPath); let npmEntriesProtoFileName: string = "npm_entries" + EXTNAME_PROTO_BIN; - const npmEntriesProtoFilePath: string = path.join(path.join(process.env.cachePath, "protos", "npm_entries", npmEntriesProtoFileName)); + const npmEntriesProtoFilePath: string = path.join(process.env.cachePath, "protos", "npm_entries", npmEntriesProtoFileName); + validateFilePathLength(npmEntriesInfoPath); + mkdirsSync(npmEntriesProtoFilePath); let js2Abc: string = path.join(arkDir, 'build', 'bin', 'js2abc'); if (isWin) { js2Abc = path.join(arkDir, 'build-win', 'bin', 'js2abc.exe'); } else if (isMac) { js2Abc = path.join(arkDir, 'build-mac', 'bin', 'js2abc'); } + validateFilePathLength(js2Abc); const singleCmd: any = `"${js2Abc}" --compile-npm-entries "${npmEntriesInfoPath}" "${npmEntriesProtoFilePath}`; try { childProcess.execSync(singleCmd); @@ -495,6 +510,7 @@ function processEntryToGenAbc(entryInfos: Map): void { function writeFileSync(inputString: string, buildPath: string, keyPath: string, jsBundleFile: string): void { let output = path.resolve(buildPath, keyPath); + validateFilePathLength(output); let parent: string = path.join(output, '..'); if (!(fs.existsSync(parent) && fs.statSync(parent).isDirectory())) { mkDir(parent); @@ -507,6 +523,7 @@ function writeFileSync(inputString: string, buildPath: string, keyPath: string, } else { cacheOutputPath = output; } + validateFilePathLength(cacheOutputPath); parent = path.join(cacheOutputPath, '..'); if (!(fs.existsSync(parent) && fs.statSync(parent).isDirectory())) { mkDir(parent); @@ -582,6 +599,7 @@ export function initAbcEnv() : string[] { } else if (isMac) { js2abc = path.join(arkDir, 'build-mac', 'legacy_api8', 'src', 'index.js'); } + validateFilePathLength(js2abc); js2abc = '"' + js2abc + '"'; args = [ @@ -598,6 +616,7 @@ export function initAbcEnv() : string[] { } else if (isMac) { js2abc = path.join(arkDir, 'build-mac', 'src', 'index.js'); } + validateFilePathLength(js2abc); js2abc = '"' + js2abc + '"'; args = [ @@ -614,6 +633,7 @@ export function initAbcEnv() : string[] { } else if (isMac) { es2abc = path.join(arkDir, 'build-mac', 'bin', 'es2abc'); } + validateFilePathLength(es2abc); args = [ '"' + es2abc + '"' @@ -1005,6 +1025,7 @@ function genHashJsonPath(buildPath: string): string { let buildDirArr: string[] = projectConfig.buildPath.split(path.sep); let abilityDir: string = buildDirArr[buildDirArr.length - 1]; let hashJsonPath: string = path.join(process.env.cachePath, TEMPORARY, abilityDir, hashFile); + validateFilePathLength(hashJsonPath) mkdirsSync(path.dirname(hashJsonPath)); return hashJsonPath; } else if (buildPath.indexOf(ARK) >= 0) { @@ -1014,7 +1035,9 @@ function genHashJsonPath(buildPath: string): string { logger.debug(red, `ETS:ERROR hash path does not exist`, reset); return ''; } - return path.join(hashPath, hashFile); + let hashJsonPath: string = path.join(hashPath, hashFile); + validateFilePathLength(hashJsonPath); + return hashJsonPath; } else { logger.debug(red, `ETS:ERROR not cache exist`, reset); return ''; @@ -1030,6 +1053,7 @@ function checkNodeModules() { arkEntryPath = path.join(arkDir, 'build-mac'); } let nodeModulesPath: string = path.join(arkEntryPath, NODE_MODULES); + validateFilePathLength(nodeModulesPath); if (!(fs.existsSync(nodeModulesPath) && fs.statSync(nodeModulesPath).isDirectory())) { logger.error(red, `ERROR: node_modules for ark compiler not found. Please make sure switch to non-root user before runing "npm install" for safity requirements and try re-run "npm install" under ${arkEntryPath}`, reset); @@ -1096,7 +1120,9 @@ function handleHotReloadChangedFiles() { for (let file of changedFileList) { let filePath: string = path.join(projectConfig.projectPath, file); + validateFilePathLength(filePath); let tempFilePath: string = genTemporaryPath(filePath, projectConfig.projectPath, process.env.cachePath); + validateFilePathLength(tempFilePath); if (tempFilePath.length === 0) { return; } @@ -1117,6 +1143,7 @@ function handleHotReloadChangedFiles() { } let sourceMapPath: string = toUnixPath(path.join(relativeProjectPath, file)); + validateFilePathLength(sourceMapPath); hotReloadSourceMap[sourceMapPath] = newSourceMaps[sourceMapPath]; } @@ -1125,10 +1152,13 @@ function handleHotReloadChangedFiles() { } const outputABCPath: string = path.join(projectConfig.patchAbcPath, MODULES_ABC); + validateFilePathLength(outputABCPath); generateMergedAbc(moduleInfos, entryInfos, outputABCPath); // write source maps - fs.writeFileSync(path.join(projectConfig.patchAbcPath, SOURCEMAPS), + let sourceMapFilePath: string = path.join(projectConfig.patchAbcPath, SOURCEMAPS); + validateFilePathLength(sourceMapFilePath); + fs.writeFileSync(sourceMapFilePath, JSON.stringify(hotReloadSourceMap, null, 2), 'utf-8'); } @@ -1147,6 +1177,7 @@ function handleFinishModules(modules, callback) { function copyModuleFileCachePathToBuildPath(): void { protoFilePath = path.join(path.join(process.env.cachePath, "protos", PROTO_FILESINFO_TXT)); + validateFilePathLength(protoFilePath); mkdirsSync(path.dirname(protoFilePath)); let entriesInfo: string = ''; moduleInfos = removeDuplicateInfo(moduleInfos); @@ -1156,7 +1187,7 @@ function copyModuleFileCachePathToBuildPath(): void { } if (entryInfos.size > 0) { let npmEntriesProtoFileName: string = "npm_entries" + EXTNAME_PROTO_BIN; - const npmEntriesProtoFilePath: string = path.join(path.join(process.env.cachePath, "protos", "npm_entries", npmEntriesProtoFileName)); + const npmEntriesProtoFilePath: string = path.join(process.env.cachePath, "protos", "npm_entries", npmEntriesProtoFileName); entriesInfo += `${toUnixPath(npmEntriesProtoFilePath)}\n`; } fs.writeFileSync(protoFilePath, entriesInfo, 'utf-8'); diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index 3e12ecc..c847d2e 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -27,8 +27,16 @@ import { NPMENTRIES_TXT, NODE_MODULES } from './pre_define'; -import { EntryInfo, ModuleInfo, initAbcEnv } from './gen_abc_plugin'; -import { mkdirsSync, toUnixPath } from './utils'; +import { + EntryInfo, + ModuleInfo, + initAbcEnv +} from './gen_abc_plugin'; +import { + mkdirsSync, + toUnixPath, + validateFilePathLength +} from './utils'; const red: string = '\u001b[31m'; const reset: string = '\u001b[39m'; @@ -46,6 +54,7 @@ function generateCompileFilesInfo(moduleInfos: Array) { moduleInfos = tempModuleInfos; const filesInfoPath: string = path.join(process.env.cachePath, FILESINFO_TXT); + validateFilePathLength(filesInfoPath); let filesInfo: string = ''; moduleInfos.forEach(info => { const moduleType: string = info.isCommonJs ? 'commonjs' : 'esm'; @@ -57,6 +66,7 @@ function generateCompileFilesInfo(moduleInfos: Array) { export function generateNpmEntriesInfo(entryInfos: Map) { const npmEntriesInfoPath: string = path.join(process.env.cachePath, NPMENTRIES_TXT); + validateFilePathLength(npmEntriesInfoPath); let entriesInfo: string = ''; for (const value of entryInfos.values()) { const buildPath: string = value.buildPath.replace(toUnixPath(projectConfig.nodeModulesPath), ''); @@ -75,6 +85,7 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma const filesInfoPath: string = path.join(process.env.cachePath, FILESINFO_TXT); const npmEntriesInfoPath: string = path.join(process.env.cachePath, NPMENTRIES_TXT); const cacheFilePath: string = path.join(process.env.cachePath, MODULES_CACHE); + validateFilePathLength(cacheFilePath); const fileThreads = os.cpus().length < 16 ? os.cpus().length : 16; mkdirsSync(projectConfig.buildPath); const genAbcCmd: string = diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index d85ee6f..245e6dc 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -16,6 +16,7 @@ import path from 'path'; import ts from 'typescript'; import fs from 'fs'; +import os from 'os'; import { projectConfig } from '../main'; import { createHash } from 'crypto'; import { processSystemApi } from './validate_ui_syntax'; @@ -60,6 +61,10 @@ const TS_NOCHECK: string = '// @ts-nocheck'; const red: string = '\u001b[31m'; const reset: string = '\u001b[39m'; +const WINDOWS: string = 'Windows_NT'; +const LINUX: string = 'Linux'; +const MAC: string = 'Drawin'; + export interface LogInfo { type: LogType, message: string, @@ -678,4 +683,46 @@ export function removeDuplicateInfo(moduleInfos: Array): Array { moduleInfos = tempModuleInfos; return moduleInfos; -} \ No newline at end of file +} + +export function isWindows(): boolean { + return os.type() === WINDOWS; +} + +export function isLinux(): boolean { + return os.type() === LINUX; +} + +export function isMac(): boolean { + return os.type() === MAC; +} + +export function maxFilePathLength(): number { + if (isWindows()) { + return 259; + } else if (isLinux()) { + return 4095; + } else if (isMac()) { + return 1016; + } else { + return -1; + } +} + +export function validateFilePathLength(filePath: string): boolean { + if (maxFilePathLength() < 0) { + logger.error("Unknown OS platform"); + process.exitCode = FAIL; + return false; + } else if (filePath.length > 0 && filePath.length <= maxFilePathLength()) { + return true; + } else if (filePath.length > maxFilePathLength()) { + logger.error("The length of path exceeds the maximum length: " + maxFilePathLength()); + process.exitCode = FAIL; + return false; + } else { + logger.error("Validate file path failed"); + process.exitCode = FAIL; + return false; + } +} -- Gitee From 8587fc565e1078e59e3b8c40ae48f5c5b841ccb6 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Fri, 21 Oct 2022 11:56:02 +0800 Subject: [PATCH 087/379] houhaoyu@huawei.com ets->arkts Signed-off-by: houhaoyu Change-Id: I2cb6b8062cb667f10b058a7b0490be8a7f03c487 --- compiler/src/compile_info.ts | 12 ++++---- compiler/src/gen_abc.ts | 6 ++-- compiler/src/gen_abc_plugin.ts | 46 +++++++++++++++--------------- compiler/src/gen_merged_abc.ts | 4 +-- compiler/src/gen_module_abc.ts | 6 ++-- compiler/src/resolve_ohm_url.ts | 10 +++---- compiler/src/utils.ts | 2 +- compiler/src/validate_ui_syntax.ts | 2 +- 8 files changed, 44 insertions(+), 44 deletions(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 2bc6f95..95102a9 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -326,9 +326,9 @@ export class ResultStates { const { line, character }: ts.LineAndCharacter = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start!); logger.error(this.red, - `ETS:ERROR File: ${diagnostic.file.fileName}:${line + 1}:${character + 1}\n ${message}\n`); + `ArkTS:ERROR File: ${diagnostic.file.fileName}:${line + 1}:${character + 1}\n ${message}\n`); } else { - logger.error(this.red, `ETS:ERROR: ${message}`); + logger.error(this.red, `ArkTS:ERROR: ${message}`); } } } @@ -433,7 +433,7 @@ export class ResultStates { logger.info(this.blue, message, this.reset, '\n'); } else { this.warningCount++; - logger.warn(this.yellow, message.replace(/^WARN/, 'ETS:WARN'), this.reset, '\n'); + logger.warn(this.yellow, message.replace(/^WARN/, 'ArkTS:WARN'), this.reset, '\n'); } } if (this.mWarningCount > length) { @@ -453,13 +453,13 @@ export class ResultStates { : ''; const location: string = errors[index].issue.file.replace(/\\/g, '/') + position; const detail: string = errors[index].issue.message; - logger.error(this.red, 'ETS:ERROR File: ' + location, this.reset); + logger.error(this.red, 'ArkTS:ERROR File: ' + location, this.reset); logger.error(this.red, detail, this.reset, '\n'); } else if (/BUILDERROR/.test(errors[index].message)) { this.mErrorCount++; const errorMessage: string = errors[index].message.replace(/^Module Error\s*.*:\n/, '') .replace(/\(Emitted value instead of an instance of Error\) BUILD/, '') - .replace(/^ERROR/, 'ETS:ERROR'); + .replace(/^ERROR/, 'ArkTS:ERROR'); this.printErrorMessage(errorMessage, true, errors[index]); } else if (!/TS[0-9]+:/.test(errors[index].message.toString()) && !/Module parse failed/.test(errors[index].message.toString())) { @@ -467,7 +467,7 @@ export class ResultStates { let errorMessage: string = `${errors[index].message.replace(/\[tsl\]\s*/, '') .replace(/\u001b\[.*?m/g, '').replace(/\.ets\.ts/g, '.ets').trim()}\n`; errorMessage = this.filterModuleError(errorMessage) - .replace(/^ERROR in /, 'ETS:ERROR File: ').replace(/\s{6}TS/g, ' TS') + .replace(/^ERROR in /, 'ArkTS:ERROR File: ').replace(/\s{6}TS/g, ' TS') .replace(/\(([0-9]+),([0-9]+)\)/, ':$1:$2'); this.printErrorMessage(parseErrorMessage(errorMessage), false, errors[index]); } diff --git a/compiler/src/gen_abc.ts b/compiler/src/gen_abc.ts index ca42ce1..9b859a5 100644 --- a/compiler/src/gen_abc.ts +++ b/compiler/src/gen_abc.ts @@ -38,7 +38,7 @@ function js2abcByWorkers(jsonInput: string, cmd: string): Promise { try { childProcess.execSync(singleCmd); } catch (e) { - logger.debug(red, `ETS:ERROR Failed to convert file ${input} to abc `, reset); + logger.debug(red, `ArkTS:ERROR Failed to convert file ${input} to abc `, reset); process.exit(FAIL); } } @@ -57,7 +57,7 @@ function es2abcByWorkers(jsonInput: string, cmd: string): Promise { try { childProcess.execSync(singleCmd); } catch (e) { - logger.debug(red, `ETS:ERROR Failed to convert file ${input} to abc `, reset); + logger.debug(red, `ArkTS:ERROR Failed to convert file ${input} to abc `, reset); process.exit(FAIL); } } @@ -74,7 +74,7 @@ if (cluster.isWorker && process.env['inputs'] !== undefined && process.env['cmd' } else if (process.env.panda === ES2ABC || process.env.panda === 'undefined' || process.env.panda === undefined) { es2abcByWorkers(process.env['inputs'], process.env['cmd']); } else { - logger.debug(red, `ETS:ERROR please set panda module`, reset); + logger.debug(red, `ArkTS:ERROR please set panda module`, reset); process.exit(FAIL); } process.exit(SUCCESS); diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 953f41a..ea0ef0c 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -156,7 +156,7 @@ export class GenAbcPlugin { isMac = true; } else { if (!fs.existsSync(path.resolve(arkDir, 'build'))) { - logger.error(red, 'ETS:ERROR find build fail', reset); + logger.error(red, 'ArkTS:ERROR find build fail', reset); process.exitCode = FAIL; return; } @@ -176,7 +176,7 @@ export class GenAbcPlugin { fs.writeFile(CACHED_BUILDMODE, JSON.stringify(cachedJson, null, 2), 'utf-8', (err) => { if (err) { - logger.error(red, `ETS:ERROR Failed to write buildMode.`, reset); + logger.error(red, `ArkTS:ERROR Failed to write buildMode.`, reset); } }); } @@ -391,14 +391,14 @@ function updateCachedModuleList(moduleList: Array): void { fs.writeFile(CACHED_MODULELIST_FILE, JSON.stringify(cachedJson, null, 2), 'utf-8', (err) => { if (err) { - logger.error(red, `ETS:ERROR Failed to write module list.`, reset); + logger.error(red, `ArkTS:ERROR Failed to write module list.`, reset); } } ); fs.writeFile(CACHED_SOURCEMAPS, JSON.stringify(cachedSourceMaps, null, 2), 'utf-8', (err) => { if (err) { - logger.error(red, `ETS:ERROR Failed to write cache sourceMaps json.`, reset); + logger.error(red, `ArkTS:ERROR Failed to write cache sourceMaps json.`, reset); } } ); @@ -409,7 +409,7 @@ function writeSourceMaps(): void { fs.writeFile(path.join(projectConfig.buildPath, SOURCEMAPS), JSON.stringify(cachedSourceMaps, null, 2), 'utf-8', (err) => { if (err) { - logger.error(red, `ETS:ERROR Failed to write sourceMaps.`, reset); + logger.error(red, `ArkTS:ERROR Failed to write sourceMaps.`, reset); } } ); @@ -446,7 +446,7 @@ function handleFullModuleFiles(modules, callback): any { } else if (filePath.endsWith(EXTNAME_JS) || filePath.endsWith(EXTNAME_MJS) || filePath.endsWith(EXTNAME_CJS)) { processJsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); } else { - logger.error(red, `ETS:ERROR Cannot find resolve this file path: ${filePath}`, reset); + logger.error(red, `ArkTS:ERROR Cannot find resolve this file path: ${filePath}`, reset); process.exitCode = FAIL; } } @@ -489,7 +489,7 @@ function processEntryToGenAbc(entryInfos: Map): void { try { childProcess.execSync(singleCmd); } catch (e) { - logger.debug(red, `ETS:ERROR Failed to generate npm proto file to abc`, reset); + logger.debug(red, `ArkTS:ERROR Failed to generate npm proto file to abc`, reset); } } @@ -518,7 +518,7 @@ function writeFileSync(inputString: string, buildPath: string, keyPath: string, cacheOutputPath = toUnixPath(cacheOutputPath); intermediateJsBundle.push({path: output, size: fileSize, cacheOutputPath: cacheOutputPath}); } else { - logger.debug(red, `ETS:ERROR Failed to convert file ${jsBundleFile} to bin. ${output} is lost`, reset); + logger.debug(red, `ArkTS:ERROR Failed to convert file ${jsBundleFile} to bin. ${output} is lost`, reset); process.exitCode = FAIL; } } @@ -625,7 +625,7 @@ export function initAbcEnv() : string[] { args.push('--merge-abc'); } } else { - logger.error(red, `ETS:ERROR please set panda module`, reset); + logger.error(red, `ArkTS:ERROR please set panda module`, reset); } return args; @@ -721,7 +721,7 @@ function invokeClusterByModule(abcArgs:string[], moduleInfos: Array, isModule ? tempAbcArgs.push('--module') : tempAbcArgs.push('--commonjs'); cmdPrefix = `${tempAbcArgs.join(' ')}`; } else { - logger.error(red, `ETS:ERROR please set panda module`, reset); + logger.error(red, `ArkTS:ERROR please set panda module`, reset); } const splitedModules: any[] = splitModulesByNumber(moduleInfos, workerNumber); workerNumber = splitedModules.length; @@ -772,7 +772,7 @@ function invokeWorkersToGenAbc(): void { maxWorkerNumber = os.cpus().length; cmdPrefix = `${abcArgs.join(' ')}`; } else { - logger.error(red, `ETS:ERROR please set panda module`, reset); + logger.error(red, `ArkTS:ERROR please set panda module`, reset); } filterIntermediateJsBundleByHashJson(buildPathInfo, intermediateJsBundle); @@ -873,7 +873,7 @@ function filterIntermediateModuleByHashJson(buildPath: string, moduleInfos: Arra const input: string = moduleInfos[i].tempFilePath; let outputPath: string = genProtoFileName(moduleInfos[i].tempFilePath); if (!fs.existsSync(input)) { - logger.debug(red, `ETS:ERROR ${input} is lost`, reset); + logger.debug(red, `ArkTS:ERROR ${input} is lost`, reset); process.exitCode = FAIL; break; } @@ -900,7 +900,7 @@ function writeModuleHashJson(): void { const input: string = filterModuleInfos[i].tempFilePath; let outputPath: string = genProtoFileName(filterModuleInfos[i].tempFilePath);; if (!fs.existsSync(input) || !fs.existsSync(outputPath)) { - logger.debug(red, `ETS:ERROR ${input} is lost`, reset); + logger.debug(red, `ArkTS:ERROR ${input} is lost`, reset); process.exitCode = FAIL; break; } @@ -949,7 +949,7 @@ function filterIntermediateJsBundleByHashJson(buildPath: string, inputPaths: Fil const cacheOutputPath: string = inputPaths[i].cacheOutputPath; const cacheAbcFilePath: string = cacheOutputPath.replace(/\.temp\.js$/, '.abc'); if (!fs.existsSync(cacheOutputPath)) { - logger.debug(red, `ETS:ERROR ${cacheOutputPath} is lost`, reset); + logger.debug(red, `ArkTS:ERROR ${cacheOutputPath} is lost`, reset); process.exitCode = FAIL; break; } @@ -976,7 +976,7 @@ function writeHashJson(): void { const cacheOutputPath: string = fileterIntermediateJsBundle[i].cacheOutputPath; const cacheAbcFilePath: string = cacheOutputPath.replace(/\.temp\.js$/, '.abc'); if (!fs.existsSync(cacheOutputPath) || !fs.existsSync(cacheAbcFilePath)) { - logger.debug(red, `ETS:ERROR ${cacheOutputPath} is lost`, reset); + logger.debug(red, `ArkTS:ERROR ${cacheOutputPath} is lost`, reset); process.exitCode = FAIL; break; } @@ -999,7 +999,7 @@ function genHashJsonPath(buildPath: string): string { buildPath = toUnixPath(buildPath); if (process.env.cachePath) { if (!fs.existsSync(process.env.cachePath) || !fs.statSync(process.env.cachePath).isDirectory()) { - logger.debug(red, `ETS:ERROR hash path does not exist`, reset); + logger.debug(red, `ArkTS:ERROR hash path does not exist`, reset); return ''; } let buildDirArr: string[] = projectConfig.buildPath.split(path.sep); @@ -1011,12 +1011,12 @@ function genHashJsonPath(buildPath: string): string { const dataTmps: string[] = buildPath.split(ARK); const hashPath: string = path.join(dataTmps[0], ARK); if (!fs.existsSync(hashPath) || !fs.statSync(hashPath).isDirectory()) { - logger.debug(red, `ETS:ERROR hash path does not exist`, reset); + logger.debug(red, `ArkTS:ERROR hash path does not exist`, reset); return ''; } return path.join(hashPath, hashFile); } else { - logger.debug(red, `ETS:ERROR not cache exist`, reset); + logger.debug(red, `ArkTS:ERROR not cache exist`, reset); return ''; } } @@ -1046,7 +1046,7 @@ function copyFileCachePathToBuildPath() { const cacheOutputPath: string = intermediateJsBundle[i].cacheOutputPath; const cacheAbcFilePath: string = intermediateJsBundle[i].cacheOutputPath.replace(/\.temp\.js$/, ".abc"); if (!fs.existsSync(cacheAbcFilePath)) { - logger.debug(red, `ETS:ERROR ${cacheAbcFilePath} is lost`, reset); + logger.debug(red, `ArkTS:ERROR ${cacheAbcFilePath} is lost`, reset); process.exitCode = FAIL; break; } @@ -1078,14 +1078,14 @@ function processExtraAsset() { function handleHotReloadChangedFiles() { if (!fs.existsSync(projectConfig.changedFileList)) { - logger.info(blue, `ETS: Cannot find file: ${projectConfig.changedFileList}, skip hot reload build`, reset); + logger.info(blue, `ArkTS: Cannot find file: ${projectConfig.changedFileList}, skip hot reload build`, reset); return; } let changedFileListJson: string = fs.readFileSync(projectConfig.changedFileList).toString(); let changedFileList: Array = JSON.parse(changedFileListJson).modifiedFiles; if (typeof(changedFileList) == "undefined" || changedFileList.length == 0) { - logger.info(blue, `ETS: No changed files found, skip hot reload build`, reset); + logger.info(blue, `ArkTS: No changed files found, skip hot reload build`, reset); return; } @@ -1112,7 +1112,7 @@ function handleHotReloadChangedFiles() { } else if (file.endsWith(EXTNAME_JS) || file.endsWith(EXTNAME_MJS) || file.endsWith(EXTNAME_CJS)) { processJsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); } else { - logger.debug(red, `ETS:ERROR Cannot resolve file path: ${filePath}, stop hot reload build`, reset); + logger.debug(red, `ArkTS:ERROR Cannot resolve file path: ${filePath}, stop hot reload build`, reset); return; } @@ -1175,6 +1175,6 @@ function mergeProtoToAbc(): void { try { childProcess.execSync(singleCmd); } catch (e) { - logger.debug(red, `ETS:ERROR Failed to merge proto file to abc`, reset); + logger.debug(red, `ArkTS:ERROR Failed to merge proto file to abc`, reset); } } diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index 3e12ecc..939b0dd 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -87,7 +87,7 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma const child = childProcess.exec(genAbcCmd); child.on('exit', (code: any) => { if (code === 1) { - logger.debug(red, "ETS:ERROR failed to execute es2abc", reset); + logger.debug(red, "ArkTS:ERROR failed to execute es2abc", reset); process.exit(FAIL); } }); @@ -102,7 +102,7 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma }); } } catch (e) { - logger.debug(red, `ETS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); + logger.debug(red, `ArkTS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); if (process.env.watchMode !== 'true') { process.exit(FAIL); } diff --git a/compiler/src/gen_module_abc.ts b/compiler/src/gen_module_abc.ts index 2544ad2..f683714 100644 --- a/compiler/src/gen_module_abc.ts +++ b/compiler/src/gen_module_abc.ts @@ -44,7 +44,7 @@ function js2abcByWorkers(jsonInput: string, cmd: string): Promise { try { childProcess.execSync(singleCmd); } catch (e) { - logger.debug(red, `ETS:ERROR Failed to convert file ${input} to proto `, reset); + logger.debug(red, `ArkTS:ERROR Failed to convert file ${input} to proto `, reset); process.exit(FAIL); } } @@ -62,7 +62,7 @@ function es2abcByWorkers(jsonInput: string, cmd: string): Promise { try { childProcess.execSync(singleCmd); } catch (e) { - logger.debug(red, `ETS:ERROR Failed to convert file ${input} to abc `, reset); + logger.debug(red, `ArkTS:ERROR Failed to convert file ${input} to abc `, reset); process.exit(FAIL); } } @@ -81,7 +81,7 @@ if (cluster.isWorker && process.env['inputs'] !== undefined && process.env['cmd' } else if (process.env.panda === ES2ABC || process.env.panda === 'undefined' || process.env.panda === undefined) { es2abcByWorkers(process.env['inputs'], process.env['cmd']); } else { - logger.error(red, `ETS:ERROR please set panda module`, reset); + logger.error(red, `ArkTS:ERROR please set panda module`, reset); process.exit(FAIL); } process.exit(SUCCESS); diff --git a/compiler/src/resolve_ohm_url.ts b/compiler/src/resolve_ohm_url.ts index 7951602..447f1a2 100644 --- a/compiler/src/resolve_ohm_url.ts +++ b/compiler/src/resolve_ohm_url.ts @@ -45,13 +45,13 @@ function addExtension(file: string, srcPath: string): string { } if (fs.existsSync(file + '.ts') && fs.statSync(file + '.ts').isFile()) { if (extension !== '.d.ts') { - logger.error(red, `ETS:ERROR Failed to compile with files with same name ${srcPath} in the same directory`, reset); + logger.error(red, `ArkTS:ERROR Failed to compile with files with same name ${srcPath} in the same directory`, reset); } extension = '.ts'; } if (fs.existsSync(file + '.js') && fs.statSync(file + '.js').isFile()) { if (extension !== '.d.ts') { - logger.error(red, `ETS:ERROR Failed to compile with files with same name ${srcPath} in the same directory`, reset); + logger.error(red, `ArkTS:ERROR Failed to compile with files with same name ${srcPath} in the same directory`, reset); } extension = '.js'; } @@ -60,7 +60,7 @@ function addExtension(file: string, srcPath: string): string { export function resolveSourceFile(ohmUrl: string): string { if (!projectConfig.aceBuildJson) { - logger.error(red, `ETS:ERROR Failed to resolve OhmUrl because of aceBuildJson not existing `, reset); + logger.error(red, `ArkTS:ERROR Failed to resolve OhmUrl because of aceBuildJson not existing `, reset); return ohmUrl; } @@ -83,7 +83,7 @@ export function resolveSourceFile(ohmUrl: string): string { } } - logger.error(red, `ETS:ERROR Failed to resolve existed file by this ohm url ${ohmUrl} `, reset); + logger.error(red, `ArkTS:ERROR Failed to resolve existed file by this ohm url ${ohmUrl} `, reset); } return file; @@ -121,6 +121,6 @@ export function getOhmUrlByFilepath(filePath: string): string { } } - logger.error(red, `ETS:ERROR Failed to get an resolved OhmUrl by filepath "${filePath}"`, reset); + logger.error(red, `ArkTS:ERROR Failed to get an resolved OhmUrl by filepath "${filePath}"`, reset); return filePath; } \ No newline at end of file diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index d85ee6f..faaaf61 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -392,7 +392,7 @@ async function writeMinimizedSourceCode(content: string, filePath: string): Prom } }); } catch { - logger.error(red, `ETS:ERROR Failed to source code obfuscation.`, reset); + logger.error(red, `ArkTS:ERROR Failed to source code obfuscation.`, reset); process.exit(FAIL); } fs.writeFileSync(filePath, result.code); diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index f2649c9..24e360d 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -960,7 +960,7 @@ function replaceOhmUrl(isSystemModule: boolean, item: string, importValue: strin break; } default: - logger.error('\u001b[31m', `ETS:ERROR Incorrect OpenHarmony module kind: ${urlType}`, '\u001b[39m'); + logger.error('\u001b[31m', `ArkTS:ERROR Incorrect OpenHarmony module kind: ${urlType}`, '\u001b[39m'); } return item; } -- Gitee From 325a24a9cc886f5c987dfc4db7d29f36505e6f8b Mon Sep 17 00:00:00 2001 From: bojiang Date: Sun, 23 Oct 2022 10:38:11 +0800 Subject: [PATCH 088/379] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改@builder和@LocalStorage ut Signed-off-by: bojiang Change-Id: I35bcb6f2aa830eb450c18150a990e8e1461505e8 --- .../render_decorator/@builder/@builder.ts | 10 +++++----- .../localStorage/localStorage.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts index 5547e58..95b7f03 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts @@ -144,7 +144,7 @@ struct MyComponent { exports.expectResult = `"use strict"; function noParam(parent = undefined) { - this.observeComponentCreation((elmtId, isInitialRender) => { + parent.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Row.create(); if (!isInitialRender) { @@ -152,7 +152,7 @@ function noParam(parent = undefined) { } ViewStackProcessor.StopGetAccessRecording(); }); - this.observeComponentCreation((elmtId, isInitialRender) => { + parent.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Text.create('this is a no param builder'); if (!isInitialRender) { @@ -164,7 +164,7 @@ function noParam(parent = undefined) { Row.pop(); } function specificParam(label1, label2, parent = undefined) { - this.observeComponentCreation((elmtId, isInitialRender) => { + parent.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Column.create(); if (!isInitialRender) { @@ -172,7 +172,7 @@ function specificParam(label1, label2, parent = undefined) { } ViewStackProcessor.StopGetAccessRecording(); }); - this.observeComponentCreation((elmtId, isInitialRender) => { + parent.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Text.create(label1); if (!isInitialRender) { @@ -181,7 +181,7 @@ function specificParam(label1, label2, parent = undefined) { ViewStackProcessor.StopGetAccessRecording(); }); Text.pop(); - this.observeComponentCreation((elmtId, isInitialRender) => { + parent.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Text.create(label2); if (!isInitialRender) { diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/localStorage/localStorage.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/localStorage/localStorage.ts index 378f8e8..ff65f47 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/localStorage/localStorage.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/localStorage/localStorage.ts @@ -112,6 +112,6 @@ class LocalStorageComponent extends ViewPU { } } ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); -loadDocument(new LocalStorageComponent(undefined, {})); +loadDocument(new LocalStorageComponent(undefined, {}, storage)); ViewStackProcessor.StopGetAccessRecording(); ` -- Gitee From a74269bcce89858489d6226b912ed9d156670721 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sun, 23 Oct 2022 18:31:12 +0800 Subject: [PATCH 089/379] houhaoyu@huawei.com fix ForEach in Builder Signed-off-by: houhaoyu Change-Id: I30e465db983800cdbb6878c8f768fb3b58af47ee --- compiler/src/process_component_build.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index aea6e12..7dc7867 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -307,7 +307,7 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme case ComponentType.forEachComponent: parent = undefined; if (!partialUpdateConfig.partialUpdateMode) { - processForEachComponent(item, newStatements, log, isBuilder); + processForEachComponent(item, newStatements, log, isBuilder, isGlobalBuilder); } else { processForEachComponentNew(item, newStatements, log, isGlobalBuilder); } @@ -905,7 +905,7 @@ function getRealNodePos(node: ts.Node): number { } function processForEachComponent(node: ts.ExpressionStatement, newStatements: ts.Statement[], - log: LogInfo[], isBuilder: boolean = false): void { + log: LogInfo[], isBuilder: boolean = false, isGlobalBuilder: boolean = false): void { const popNode: ts.ExpressionStatement = ts.factory.createExpressionStatement(createFunction( // @ts-ignore node.expression.expression as ts.Identifier, @@ -929,7 +929,7 @@ function processForEachComponent(node: ts.ExpressionStatement, newStatements: ts argumentsArray.splice(1, 1, newArrowNode); } node = addForEachId(ts.factory.updateExpressionStatement(node, ts.factory.updateCallExpression( - node.expression, propertyNode, node.expression.typeArguments, argumentsArray))); + node.expression, propertyNode, node.expression.typeArguments, argumentsArray)), isGlobalBuilder); } newStatements.push(node, popNode); } @@ -1093,11 +1093,12 @@ function createLazyForEachStatement(argumentsArray: ts.Expression[]): ts.Express ); } -function addForEachId(node: ts.ExpressionStatement): ts.ExpressionStatement { +function addForEachId(node: ts.ExpressionStatement, isGlobalBuilder: boolean = false): ts.ExpressionStatement { const forEachComponent: ts.CallExpression = node.expression as ts.CallExpression; return ts.factory.updateExpressionStatement(node, ts.factory.updateCallExpression( forEachComponent, forEachComponent.expression, forEachComponent.typeArguments, - [ts.factory.createStringLiteral((++componentInfo.id).toString()), ts.factory.createThis(), + [ts.factory.createStringLiteral((++componentInfo.id).toString()), + isGlobalBuilder ? ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT) : ts.factory.createThis(), ...forEachComponent.arguments])); } -- Gitee From 2554c648c0d10f291c70b0b92771ad441b279df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 24 Oct 2022 03:10:39 +0000 Subject: [PATCH 090/379] update compiler/server/build_pipe_server.js. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/server/build_pipe_server.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index e1fb523..795daab 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -56,7 +56,8 @@ let errorInfo; let compileWithCheck; let globalVariable = []; let propertyVariable = []; - +const maxConnectNum = 5; +let connectNum = 0; function init(port) { previewCacheFilePath = path.join(projectConfig.cachePath || projectConfig.buildPath, 'preview.ets'); @@ -69,17 +70,27 @@ function init(port) { createWatchCompilerHost(rootFileNames, resolveDiagnostic, delayPrintLogCount, true)); const wss = new WebSocketServer({ port: port, - host: '127.0.0.1', - backlog: 5 + host: '127.0.0.1' }); wss.on('connection', function(ws) { - pluginSocket = ws; - handlePluginConnect(ws); + if (connectNum < maxConnectNum) { + connectNum++; + handlePluginConnect(ws); + } else { + disconnect(ws); + } }); } +function disconnect(ws) { + ws.on('close', function() { + connectNum--; + }); + ws.terminate(); +} function handlePluginConnect(ws) { ws.on('message', function(message) { + pluginSocket = ws; const jsonData = JSON.parse(message); handlePluginCommand(jsonData); }); -- Gitee From 33e3f2e58c126046ecbc1eb625e5dc084716e1f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 24 Oct 2022 03:12:11 +0000 Subject: [PATCH 091/379] update compiler/server/build_pipe_server.js. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/server/build_pipe_server.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index 795daab..fb9485d 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -56,8 +56,9 @@ let errorInfo; let compileWithCheck; let globalVariable = []; let propertyVariable = []; -const maxConnectNum = 5; let connectNum = 0; +const maxConnectNum = 8; + function init(port) { previewCacheFilePath = path.join(projectConfig.cachePath || projectConfig.buildPath, 'preview.ets'); @@ -77,17 +78,11 @@ function init(port) { connectNum++; handlePluginConnect(ws); } else { - disconnect(ws); + ws.terminate(); } }); } -function disconnect(ws) { - ws.on('close', function() { - connectNum--; - }); - ws.terminate(); -} function handlePluginConnect(ws) { ws.on('message', function(message) { pluginSocket = ws; -- Gitee From 40c970461983c41dfb8008651f8aca4eba1b1051 Mon Sep 17 00:00:00 2001 From: lihong Date: Mon, 24 Oct 2022 11:12:32 +0800 Subject: [PATCH 092/379] lihong67@huawei.com fix set type module in Library. Signed-off-by: lihong Change-Id: I4af043a79afb263465dfae09efb9f0be224be309 --- compiler/main.js | 1 + compiler/webpack.config.js | 40 ++++++++++++++++++++++---------------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 7064cee..397502b 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -74,6 +74,7 @@ function initProjectConfig(projectConfig) { projectConfig.projectProfilePath = projectConfig.projectProfilePath || process.env.projectProfilePath; projectConfig.isPreview = projectConfig.isPreview || (process.env.isPreview === 'true' ? true : process.env.isPreview); + projectConfig.compileMode = projectConfig.compileMode || 'jsbundle'; } function loadEntryObj(projectConfig) { diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index a8483c4..2173d06 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -97,23 +97,7 @@ function initConfig(config) { { loader: path.resolve(__dirname, 'lib/pre_process.js') } ] }, - { - test: /\.js$/, - use: [ - { - loader: 'babel-loader', - options: { - plugins: [ - '@babel/plugin-transform-modules-commonjs', - '@babel/plugin-proposal-class-properties' - ], - compact: false - }, - }, - { loader: path.resolve(__dirname, 'lib/process_js_file.js')}, - { loader: path.resolve(__dirname, 'lib/process_system_module.js') } - ] - } + setJsConfigRule() ] }, node: { @@ -164,6 +148,28 @@ function initConfig(config) { } } +function setJsConfigRule() { + const jsRule = { + test: /\.js$/, + use: [ + { + loader: 'babel-loader', + options: { + plugins: ['@babel/plugin-proposal-class-properties'], + compact: false + } + }, + { loader: path.resolve(__dirname, 'lib/process_js_file.js')}, + { loader: path.resolve(__dirname, 'lib/process_system_module.js') } + ] + }; + if (projectConfig.compileMode !== 'esmodule') { + jsRule.type = 'javascript/auto'; + jsRule.use[0].options.plugins.unshift('@babel/plugin-transform-modules-commonjs'); + } + return jsRule; +} + function existsPackageJson(config, rootPackageJsonPath, modulePackageJsonPath) { if (config.cache) { config.cache.buildDependencies = { -- Gitee From 90fcc8afb69e11da060f13e7413889fb4de444f2 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 24 Oct 2022 19:20:59 +0800 Subject: [PATCH 093/379] houhaoyu@huawei.com check foreach parameter Signed-off-by: houhaoyu Change-Id: I38c3e50fc6537cfe32d14f1a05fa92b150d86095 --- compiler/src/process_component_build.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index aea6e12..20763b7 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -2002,7 +2002,9 @@ function isEtsComponent(node: ts.ExpressionStatement): boolean { function isSomeName(forEachParameters: ts.NodeArray, name: string): boolean { return Array.isArray(forEachParameters) && - forEachParameters.some((item)=>{ return item.name.escapedText.toString() === name}); + forEachParameters.some((item)=>{ + return ts.isIdentifier(item.name) ? item.name.escapedText.toString() === name : false; + }); } function isParamFunction(node: ts.ExpressionStatement): boolean { -- Gitee From 9cc95a00df8f3596a49d14800d8665897207811b Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 19 Oct 2022 18:57:29 +0800 Subject: [PATCH 094/379] houhaoyu@huawei.com add bundle&module name Signed-off-by: houhaoyu Change-Id: I2f284fedaf9ca7ff7f280781f3b90c1d8bedc8be --- compiler/src/process_component_build.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index aea6e12..0fd3ca0 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1326,12 +1326,21 @@ function createComponent(node: ts.ExpressionStatement, type: string): CreateResu ? ts.factory.updateExpressionStatement(node, createFunction(temp, identifierNode, null)) : ts.factory.updateExpressionStatement(node, - createFunction(temp, identifierNode, temp.parent.arguments)); + createFunction(temp, identifierNode, checkArguments(temp, type))); res.identifierNode = temp; } return res; } +function checkArguments(temp: ts.Identifier, type: string): ts.NodeArray { + return temp.getText() === 'XComponent' && type === COMPONENT_CREATE_FUNCTION && + projectConfig.moduleName && projectConfig.bundleName ? + // @ts-ignore + temp.parent.arguments.concat([ + ts.factory.createStringLiteral(`${projectConfig.bundleName}/${projectConfig.moduleName}`) + ]) : temp.parent.arguments +} + function checkContainer(name: string, node: ts.Node): boolean { return BUILDIN_CONTAINER_COMPONENT.has(name) && (name !== 'XComponent' || (node && node.arguments && node.arguments.length && -- Gitee From 0112d2b6a4935eff17277a88c73666ba3bd74e27 Mon Sep 17 00:00:00 2001 From: bojiang Date: Tue, 25 Oct 2022 16:10:13 +0800 Subject: [PATCH 095/379] jiangbo91@huawei,com updata foreach ut Signed-off-by: bojiang Change-Id: Id8a34948e635f1ddc8c67302514a4456356b5845 --- .../render_component/forEach/forEachTwo.ts | 92 +++++++++++++ .../render_component/foreach/forEachTwo.ts | 129 ++++++++++++++++++ 2 files changed, 221 insertions(+) create mode 100644 compiler/test/ut/inner_commponent_transform/render_component/forEach/forEachTwo.ts create mode 100644 compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/forEachTwo.ts diff --git a/compiler/test/ut/inner_commponent_transform/render_component/forEach/forEachTwo.ts b/compiler/test/ut/inner_commponent_transform/render_component/forEach/forEachTwo.ts new file mode 100644 index 0000000..0ff8506 --- /dev/null +++ b/compiler/test/ut/inner_commponent_transform/render_component/forEach/forEachTwo.ts @@ -0,0 +1,92 @@ +/* + * 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. + */ + +exports.source = ` +@Entry +@Component +struct Index { + @State WIDTH_AND_HEIGHT: Array<{ w: number, h: number }> = [ + { w: 10, h: 10 }, + { w: 20, h: 20 }, + { w: 30, h: 30 }, + { w: 40, h: 40 }, + { w: 50, h: 50 } + ] + build() { + Row() { + Column() { + ForEach(this.WIDTH_AND_HEIGHT, ({ w, h }) => { + Button() + .width(w) + .height(h) + }, item => item.toString()) + } + .width('100%') + } + .height('100%') + } +}` + +exports.expectResult = +`"use strict"; +let __generate__Id = 0; +function generateId() { + return "forEachTwo_" + ++__generate__Id; +} +class Index extends View { + constructor(compilerAssignedUniqueChildId, parent, params) { + super(compilerAssignedUniqueChildId, parent); + this.__WIDTH_AND_HEIGHT = new ObservedPropertyObject([ + { w: 10, h: 10 }, + { w: 20, h: 20 }, + { w: 30, h: 30 }, + { w: 40, h: 40 }, + { w: 50, h: 50 } + ], this, "WIDTH_AND_HEIGHT"); + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + if (params.WIDTH_AND_HEIGHT !== undefined) { + this.WIDTH_AND_HEIGHT = params.WIDTH_AND_HEIGHT; + } + } + aboutToBeDeleted() { + this.__WIDTH_AND_HEIGHT.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id()); + } + get WIDTH_AND_HEIGHT() { + return this.__WIDTH_AND_HEIGHT.get(); + } + set WIDTH_AND_HEIGHT(newValue) { + this.__WIDTH_AND_HEIGHT.set(newValue); + } + render() { + Row.create(); + Row.height('100%'); + Column.create(); + Column.width('100%'); + ForEach.create("2", this, ObservedObject.GetRawObject(this.WIDTH_AND_HEIGHT), ({ w, h }) => { + Button.createWithLabel(); + Button.width(w); + Button.height(h); + Button.pop(); + }, item => item.toString()); + ForEach.pop(); + Column.pop(); + Row.pop(); + } +} +loadDocument(new Index("1", undefined, {})); +` diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/forEachTwo.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/forEachTwo.ts new file mode 100644 index 0000000..9126c42 --- /dev/null +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/forEachTwo.ts @@ -0,0 +1,129 @@ +/* + * 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. + */ + +exports.source = ` +@Entry +@Component +struct Index { + @State WIDTH_AND_HEIGHT: Array<{ w: number, h: number }> = [ + { w: 10, h: 10 }, + { w: 20, h: 20 }, + { w: 30, h: 30 }, + { w: 40, h: 40 }, + { w: 50, h: 50 } + ] + build() { + Row() { + Column() { + ForEach(this.WIDTH_AND_HEIGHT, ({ w, h }) => { + Button() + .width(w) + .height(h) + }, item => item.toString()) + } + .width('100%') + } + .height('100%') + } +}` + +exports.expectResult = +`"use strict"; +class Index extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__WIDTH_AND_HEIGHT = new ObservedPropertyObjectPU([ + { w: 10, h: 10 }, + { w: 20, h: 20 }, + { w: 30, h: 30 }, + { w: 40, h: 40 }, + { w: 50, h: 50 } + ], this, "WIDTH_AND_HEIGHT"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.WIDTH_AND_HEIGHT !== undefined) { + this.WIDTH_AND_HEIGHT = params.WIDTH_AND_HEIGHT; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__WIDTH_AND_HEIGHT.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__WIDTH_AND_HEIGHT.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get WIDTH_AND_HEIGHT() { + return this.__WIDTH_AND_HEIGHT.get(); + } + set WIDTH_AND_HEIGHT(newValue) { + this.__WIDTH_AND_HEIGHT.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + Row.height('100%'); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + Column.width('100%'); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ForEach.create(); + const forEachItemGenFunction = _item => { + const { w, h } = _item; + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel(); + Button.width(w); + Button.height(h); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + }; + const forEachItemIdFunc = item => item.toString(); + this.forEachUpdateFunction(elmtId, this.WIDTH_AND_HEIGHT, forEachItemGenFunction, forEachItemIdFunc); + if (!isInitialRender) { + ForEach.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + ForEach.pop(); + Column.pop(); + Row.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new Index(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` -- Gitee From f177da52fd03d6a2c9e9d5d2bd969fe6490f1ecd Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Tue, 25 Oct 2022 15:53:32 +0000 Subject: [PATCH 096/379] Fix mac name spell Signed-off-by: zhangrengao Change-Id: I286a1b8d13405ab86d4db9c3dcc686ad78c16e73 --- compiler/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 245e6dc..0a219ff 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -63,7 +63,7 @@ const reset: string = '\u001b[39m'; const WINDOWS: string = 'Windows_NT'; const LINUX: string = 'Linux'; -const MAC: string = 'Drawin'; +const MAC: string = 'Darwin'; export interface LogInfo { type: LogType, -- Gitee From d96f8bdc8d238d2f4198e13ee94c65e22a575418 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 26 Oct 2022 15:19:04 +0800 Subject: [PATCH 097/379] houhaoyu@huawei.com transform object builder Signed-off-by: houhaoyu Change-Id: I8c70abfbb92c6f8dd32e2db3182b4bd797345327 --- compiler/src/pre_define.ts | 1 + compiler/src/process_component_build.ts | 40 +++++++++++++++++++++---- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index e356f09..6092a83 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -212,6 +212,7 @@ export const VIEW_STACK_PROCESSOR: string = 'ViewStackProcessor'; export const BIND_POPUP: string = 'bindPopup'; export const BIND_POPUP_SET: Set = new Set(['bindPopup']); export const BIND_DRAG_SET: Set = new Set(['onDragStart', 'onItemDragStart']); +export const BIND_OBJECT_PROPERTY: Map> = new Map([['Navigation', new Set(['title'])]]); export const CHECKED: string = 'checked'; export const RADIO: string = 'Radio'; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index a7c9a40..baa45d7 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -92,7 +92,8 @@ import { COMPONENT_CONSTRUCTOR_PARENT, RESOURCE_NAME_TYPE, XCOMPONENT_SINGLE_QUOTATION, - XCOMPONENT_DOUBLE_QUOTATION + XCOMPONENT_DOUBLE_QUOTATION, + BIND_OBJECT_PROPERTY } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -1398,7 +1399,7 @@ export function bindComponentAttr(node: ts.ExpressionStatement, identifierNode: temp = processDragStartBuilder(temp); break; default: - temp = processCustomBuilderProperty(temp); + temp = processCustomBuilderProperty(temp, identifierNode, propertyName); } flag = true; } @@ -1430,10 +1431,11 @@ export function bindComponentAttr(node: ts.ExpressionStatement, identifierNode: } } -function processCustomBuilderProperty(node: ts.CallExpression): ts.CallExpression { +function processCustomBuilderProperty(node: ts.CallExpression, identifierNode: ts.Identifier, + propertyName: string): ts.CallExpression { const newArguments: ts.Expression[] = []; node.arguments.forEach((argument: ts.Expression | ts.Identifier, index: number) => { - if (index === 0 && isBuilderChangeNode(argument)) { + if (index === 0 && isBuilderChangeNode(argument, identifierNode, propertyName)) { newArguments.push(parseBuilderNode(argument)); } else { newArguments.push(argument); @@ -1443,13 +1445,15 @@ function processCustomBuilderProperty(node: ts.CallExpression): ts.CallExpressio return node; } -function isBuilderChangeNode(argument: ts.Node): boolean { +function isBuilderChangeNode(argument: ts.Node, identifierNode: ts.Identifier, propertyName: string): boolean { return ts.isPropertyAccessExpression(argument) && argument.name && ts.isIdentifier(argument.name) && CUSTOM_BUILDER_METHOD.has(argument.name.getText()) || ts.isCallExpression(argument) && argument.expression && argument.expression.name && ts.isIdentifier(argument.expression.name) && CUSTOM_BUILDER_METHOD.has(argument.expression.name.getText()) || ts.isIdentifier(argument) && - argument.escapedText && CUSTOM_BUILDER_METHOD.has(argument.escapedText.toString()); + argument.escapedText && CUSTOM_BUILDER_METHOD.has(argument.escapedText.toString()) || + ts.isObjectLiteralExpression(argument) && BIND_OBJECT_PROPERTY.get(identifierNode.escapedText.toString()) && + BIND_OBJECT_PROPERTY.get(identifierNode.escapedText.toString()).has(propertyName); } function parseBuilderNode(node: ts.Node): ts.ObjectLiteralExpression { @@ -1459,9 +1463,33 @@ function parseBuilderNode(node: ts.Node): ts.ObjectLiteralExpression { return processIdentifierBuilder(node); } else if (ts.isCallExpression(node)) { return getParsedBuilderAttrArgumentWithParams(node); + } else if (ts.isObjectLiteralExpression(node)) { + return processObjectPropertyBuilder(node); } } +function processObjectPropertyBuilder(node: ts.ObjectLiteralExpression): ts.ObjectLiteralExpression { + const newProperties: ts.PropertyAssignment[] = []; + node.properties.forEach((property: ts.PropertyAssignment) => { + if (property.name && ts.isIdentifier(property.name) && + property.name.escapedText.toString() === CUSTOM_DIALOG_CONTROLLER_BUILDER && + property.initializer && isPropertyAccessExpressionNode(property.initializer)) { + newProperties.push(ts.factory.updatePropertyAssignment(property, property.name, + ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + property.initializer, + ts.factory.createIdentifier(BUILDER_ATTR_BIND) + ), + undefined, + [ts.factory.createThis()] + ))); + } else { + newProperties.push(property); + } + }); + return ts.factory.updateObjectLiteralExpression(node, newProperties); +} + function isPropertyAccessExpressionNode(node: ts.Node): boolean { return ts.isPropertyAccessExpression(node) && node.expression && node.expression.kind === ts.SyntaxKind.ThisKeyword && node.name && ts.isIdentifier(node.name) && -- Gitee From 179b02f939547c37af1fff96b57fc7189b0b8374 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 26 Oct 2022 19:48:07 +0800 Subject: [PATCH 098/379] houhaoyu@huawei.com ets->arkts Signed-off-by: houhaoyu Change-Id: I037aaeeeb5de8a969824b9fdbc3c524b40a8ce87 --- compiler/main.js | 2 +- compiler/server/build_pipe_server.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 397502b..a4fdb8d 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -428,7 +428,7 @@ function processResourceArr(resourceArr, resourceMap, filePath) { resourceMap.set(resourceData[0], obj); } } else { - logger.warn(`\u001b[31m ETS:WARN The format of file '${filePath}' is incorrect. \u001b[39m`); + logger.warn(`\u001b[31m ArkTS:WARN The format of file '${filePath}' is incorrect. \u001b[39m`); break; } } diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index fb9485d..30bb358 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -232,9 +232,9 @@ function resolveDiagnostic(diagnostic) { const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); errorInfo.push( - `ETS:ERROR File: ${diagnostic.file.fileName}:${line + 1}:${character + 1}\n ${message}\n`); + `ArkTS:ERROR File: ${diagnostic.file.fileName}:${line + 1}:${character + 1}\n ${message}\n`); } else { - errorInfo.push(`ETS:ERROR: ${message}`); + errorInfo.push(`ArkTS:ERROR: ${message}`); } } } -- Gitee From d540e1134be1c9c3c1b1fb9b1af4954a3a00350f Mon Sep 17 00:00:00 2001 From: hufeng Date: Thu, 27 Oct 2022 15:16:38 +0800 Subject: [PATCH 099/379] =?UTF-8?q?Revert=20OhmUrl=20from=20developer?= =?UTF-8?q?=E2=80=99s=20perspective?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hufeng Change-Id: Ibbc117c3e93b176b17f40bc15f6fdc96bc02bdf1 --- compiler/src/ets_checker.ts | 25 ++++--------------------- compiler/src/process_import.ts | 7 ++----- compiler/src/validate_ui_syntax.ts | 4 +--- compiler/webpack.config.js | 2 -- 4 files changed, 7 insertions(+), 31 deletions(-) diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index 7efc042..ce35dff 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -108,7 +108,7 @@ export function createLanguageService(rootFileNames: string[]): ts.LanguageServi return undefined; } if (/(? = new Map(); function resolveModuleNames(moduleNames: string[], containingFile: string): ts.ResolvedModuleFull[] { @@ -155,13 +145,6 @@ function resolveModuleNames(moduleNames: string[], containingFile: string): ts.R }); if (result.resolvedModule) { resolvedModules.push(result.resolvedModule); - } else if (/^@bundle:/.test(moduleName.trim())) { - const module: {modulePath: string, suffix: string} = getOhmUrlFile(moduleName.trim()); - if (ts.sys.fileExists(module.modulePath)) { - resolvedModules.push(getResolveModule(module.modulePath, module.suffix)); - } else { - resolvedModules.push(null); - } } else if (/^@(system|ohos)\./i.test(moduleName.trim())) { const modulePath: string = path.resolve(__dirname, '../../../api', moduleName + '.d.ts'); if (systemModules.includes(moduleName + '.d.ts') && ts.sys.fileExists(modulePath)) { @@ -260,7 +243,7 @@ export function createWatchCompilerHost(rootFileNames: string[], return undefined; } if (/(? = new Map(); @@ -97,7 +96,7 @@ isEntryPage: boolean = true, pathCollection: Set = new Set()): void { } } } - if (filePath && path.extname(filePath) !== EXTNAME_ETS && !isModule(filePath) && !isOhmUrl(filePath)) { + if (filePath && path.extname(filePath) !== EXTNAME_ETS && !isModule(filePath)) { const dirIndexPath: string = path.resolve(path.resolve(pagesDir, filePath), INDEX_ETS); if (/^(\.|\.\.)\//.test(filePath) && !fs.existsSync(path.resolve(pagesDir, filePath + EXTNAME_ETS)) && fs.existsSync(dirIndexPath)) { @@ -113,9 +112,7 @@ isEntryPage: boolean = true, pathCollection: Set = new Set()): void { try { let fileResolvePath: string; - if (isOhmUrl(filePath) && filePath.indexOf(NODE_MODULES) < 0) { - fileResolvePath = resolveSourceFile(filePath); - } else if (/^(\.|\.\.)\//.test(filePath) && filePath.indexOf(NODE_MODULES) < 0) { + if (/^(\.|\.\.)\//.test(filePath) && filePath.indexOf(NODE_MODULES) < 0) { fileResolvePath = path.resolve(pagesDir, filePath); } else if (/^\//.test(filePath) && filePath.indexOf(NODE_MODULES) < 0 || fs.existsSync(filePath) && fs.statSync(filePath).isFile()) { diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 24e360d..b76cb6d 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -995,9 +995,7 @@ export function processSystemApi(content: string, isProcessAllowList: boolean = } const moduleRequest: string = item4 || item6; - if (isOhmUrl(moduleRequest)) { // ohmURL - return replaceOhmUrl(isSystemModule, item, importValue, moduleRequest, sourcePath); - } else if (/^@(system|ohos)\./.test(moduleRequest)) { // ohos/system.api + if (/^@(system|ohos)\./.test(moduleRequest)) { // ohos/system.api // ets & ts file need compile with .d.ts, so do not replace at the phase of pre_process if (!isSystemModule) { return item; diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 2173d06..0cb4ce6 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -19,7 +19,6 @@ const CopyPlugin = require('copy-webpack-plugin'); const Webpack = require('webpack'); const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const { GenAbcPlugin } = require('./lib/gen_abc_plugin'); -const { OHMResolverPlugin } = require('./lib/resolve_ohm_url'); const buildPipeServer = require('./server/build_pipe_server'); const { @@ -104,7 +103,6 @@ function initConfig(config) { global: false }, resolve: { - plugins: [new OHMResolverPlugin()], symlinks: projectConfig.compileMode === 'esmodule' ? false : true, extensions: ['.js', '.ets', '.ts', '.d.ts'], modules: [ -- Gitee From 30ddff9cdf7b32f449f25c98dcb040deeb1d8f73 Mon Sep 17 00:00:00 2001 From: lihong Date: Thu, 27 Oct 2022 16:35:28 +0800 Subject: [PATCH 100/379] lihong67@huawei.com fix pages validate log info in stage mode. Signed-off-by: lihong Change-Id: I12258d45bb41bfc41645b47b91c60583982e0845 --- compiler/main.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index a4fdb8d..d3f9515 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -143,8 +143,12 @@ function buildManifest(manifest, aceConfigPath) { '\u001b[39m').message; } } catch (e) { - throw Error("\x1B[31m" + 'ERROR: the module.json file is lost or format is invalid.' + - "\x1B[39m").message; + if (/BUIDERROR/.test(e)) { + throw Error(e.replace('BUIDERROR', 'ERROR')).message; + } else { + throw Error("\x1B[31m" + 'ERROR: the module.json file is lost or format is invalid.' + + "\x1B[39m").message; + } } } @@ -153,10 +157,15 @@ function getPages(configJson) { const pagesJsonFileName = `${configJson.module.pages.replace(/\$profile\:/, '')}.json`; const modulePagePath = path.resolve(projectConfig.aceProfilePath, pagesJsonFileName); if (fs.existsSync(modulePagePath)) { - const pagesConfig = JSON.parse(fs.readFileSync(modulePagePath, 'utf-8')); - if (pagesConfig && pagesConfig.src) { - projectConfig.pagesJsonFileName = pagesJsonFileName; - return pagesConfig.src; + try { + const pagesConfig = JSON.parse(fs.readFileSync(modulePagePath, 'utf-8')); + if (pagesConfig && pagesConfig.src) { + projectConfig.pagesJsonFileName = pagesJsonFileName; + return pagesConfig.src; + } + } catch (e) { + throw Error("\x1B[31m" + `BUIDERROR: the ${modulePagePath} file format is invalid.` + + "\x1B[39m").message; } } return pages; -- Gitee From 7d397ebc715ffb61be11837ae9d4f2814765ef2e Mon Sep 17 00:00:00 2001 From: bojiang Date: Fri, 28 Oct 2022 10:47:41 +0800 Subject: [PATCH 101/379] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Providejsbundle修改 Signed-off-by: bojiang Change-Id: I4ae7bdf5d88c6bdf48cd9e92ebf65ac8ed1930eb --- compiler/src/process_component_member.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 4f5379a..11bcde9 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -732,10 +732,14 @@ function createPropertyAccessExpressionWithThis(propertyName: string): ts.Proper function addAddProvidedVar(node: ts.PropertyDeclaration, name: ts.Identifier, decoratorName: string, updateState: ts.Statement[]): void { if (decoratorName === COMPONENT_PROVIDE_DECORATOR) { + let parameterName: string; if (isSingleKey(node)) { - updateState.push(createAddProvidedVar(getDecoratorKey(node), name)); + parameterName = getDecoratorKey(node); + updateState.push(createAddProvidedVar(parameterName, name)); + } + if (parameterName !== name.getText()) { + updateState.push(createAddProvidedVar(name.getText(), name)); } - updateState.push(createAddProvidedVar(name.getText(), name)); } } -- Gitee From 2c5ac70c6936bbdc7a31df7fd0c0fcdf623de1ee Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sun, 30 Oct 2022 15:50:15 +0800 Subject: [PATCH 102/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 极速预览bug修复 Signed-off-by: houhaoyu Change-Id: Icc97bd53d163120f0462eb1f9d96e54925889479 --- compiler/server/build_pipe_server.js | 27 +++++------------------ compiler/src/process_component_build.ts | 21 ++++++++++-------- compiler/src/process_ui_syntax.ts | 29 +++++++++++++++++-------- 3 files changed, 37 insertions(+), 40 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index 30bb358..6886f33 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -131,11 +131,10 @@ function handlePluginCompileComponent(jsonData) { processComponentChild(sourceNode.statements[0].members[1].body, previewStatements, log, supplement); supplement.isAcceleratePreview = false; const newSource = ts.factory.updateSourceFile(sourceNode, previewStatements); - const transformedSourceFile = transformResourceNode(newSource); + const transformedSourceFile = transformResourceNode(newSource, log); const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); const result = printer.printNode(ts.EmitHint.Unspecified, transformedSourceFile, transformedSourceFile); receivedMsg.data.script = ts.transpileModule(result, {}).outputText; - processOffset(receivedMsg, log, sourceNode); receivedMsg.data.log = log; if (receivedMsg.data.viewID) { receivedMsg.data.script = `function quickPreview(context) { @@ -149,12 +148,12 @@ function handlePluginCompileComponent(jsonData) { callEs2abc(receivedMsg); } -function transformResourceNode(newSource) { +function transformResourceNode(newSource, log) { const transformerFactory = (context) => { return (rootNode) => { function visit(node) { node = ts.visitEachChild(node, visit, context); - return processResourceNode(node); + return processResourceNode(node, log); } return ts.visitNode(rootNode, visit); } @@ -163,9 +162,9 @@ function transformResourceNode(newSource) { return transformationResult.transformed[0]; } -function processResourceNode(node) { +function processResourceNode(node, log) { if (isResource(node)) { - return processResourceData(node); + return processResourceData(node, {isAcceleratePreview: true, log: log}); } else { return node; } @@ -190,22 +189,6 @@ function callEs2abc(receivedMsg) { } } -function processOffset(receivedMsg, log, sourceNode) { - if (receivedMsg.data.offset) { - for (let i = 0; i < log.length; i++) { - let line = parseInt(sourceNode.getLineAndCharacterOfPosition(log[i].pos).line); - let column = parseInt(sourceNode.getLineAndCharacterOfPosition(log[i].pos).character); - if (line === 0) { - log[i].line = parseInt(JSON.parse(receivedMsg.data.offset).line); - log[i].column = parseInt(JSON.parse(receivedMsg.data.offset).column) + column - 15; - } else { - log[i].line = parseInt(JSON.parse(receivedMsg.data.offset).line) + line; - log[i].column = column; - } - } - } -} - function es2abc(receivedMsg) { const cmd = es2abcFilePath + ' --base64Input ' + Buffer.from(receivedMsg.data.script).toString('base64') + ' --base64Output'; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index baa45d7..88a9dd4 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -341,12 +341,14 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme } }); } - newsupplement = { - isAcceleratePreview: false, - line: 0, - column: 0, - fileName: '' - }; + if (supplement.isAcceleratePreview) { + newsupplement = { + isAcceleratePreview: false, + line: 0, + column: 0, + fileName: '' + }; + } } function addInnerBuilderParameter(node: ts.ExpressionStatement): ts.ExpressionStatement { @@ -491,10 +493,10 @@ function processDebug(node: ts.Statement, nameResult: NameResult, newStatements: let line: number = 1; let col: number = 1; if (sourceNode && newsupplement.isAcceleratePreview) { - posOfNode = sourceNode.getLineAndCharacterOfPosition(getRealNodePos(node)); + posOfNode = sourceNode.getLineAndCharacterOfPosition(getRealNodePos(node) - 22); curFileName = newsupplement.fileName; if (posOfNode.line === 0) { - col = newsupplement.column - 15; + col = newsupplement.column - 1; } line = newsupplement.line; } else { @@ -1802,7 +1804,8 @@ function loopEtscomponent(node: any, isStylesAttr: boolean): ts.Node { if (ts.isEtsComponentExpression(item)) { node.arguments[index] = ts.factory.createCallExpression( item.expression, undefined, item.arguments); - } else if (ts.isCallExpression(item) || ts.isNewExpression(item)) { + } else if ((ts.isCallExpression(item) || ts.isNewExpression(item)) && + !newsupplement.isAcceleratePreview) { node.arguments[index] = ts.visitEachChild(item, changeEtsComponentKind, contextGlobal); } diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 1d712bb..e655558 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -363,20 +363,22 @@ function isAnimateTo(node: ts.Node): boolean { node.expression.escapedText.toString() === ATTRIBUTE_ANIMATETO; } -export function processResourceData(node: ts.CallExpression): ts.Node { +export function processResourceData(node: ts.CallExpression, + previewLog: {isAcceleratePreview: boolean, log: LogInfo[]} = {isAcceleratePreview: false, log: []}): ts.Node { if (ts.isStringLiteral(node.arguments[0])) { if (node.expression.getText() === RESOURCE_RAWFILE) { return createResourceParam(0, RESOURCE_TYPE.rawfile, [node.arguments[0]]); } else { - return getResourceDataNode(node); + return getResourceDataNode(node, previewLog); } } return node; } -function getResourceDataNode(node: ts.CallExpression): ts.Node { +function getResourceDataNode(node: ts.CallExpression, + previewLog: {isAcceleratePreview: boolean, log: LogInfo[]}): ts.Node { const resourceData: string[] = (node.arguments[0] as ts.StringLiteral).text.trim().split('.'); - if (validateResourceData(resourceData, resources, node.arguments[0].getStart())) { + if (preCheckResourceData(resourceData, resources, node.arguments[0].getStart(), previewLog)) { const resourceType: number = RESOURCE_TYPE[resourceData[1]]; if (resourceType === undefined) { transformLog.errors.push({ @@ -429,27 +431,36 @@ function createResourceParam(resourceValue: number, resourceType: number, argsAr return resourceParams; } -function validateResourceData(resourceData: string[], resources: object, pos: number): boolean { +function preCheckResourceData(resourceData: string[], resources: object, pos: number, + previewLog: {isAcceleratePreview: boolean, log: LogInfo[]}): boolean { + if (previewLog.isAcceleratePreview) { + return validateResourceData(resourceData, resources, pos, previewLog.log); + } else { + return validateResourceData(resourceData, resources, pos, transformLog.errors); + } +} + +function validateResourceData(resourceData: string[], resources: object, pos: number, log: LogInfo[]): boolean { if (resourceData.length !== 3) { - transformLog.errors.push({ + log.push({ type: LogType.ERROR, message: 'The input parameter is not supported.', pos: pos }); } else if (!resources[resourceData[0]]) { - transformLog.errors.push({ + log.push({ type: LogType.ERROR, message: `The value of '${resourceData[0]}' is invalid.`, pos: pos }); } else if (!resources[resourceData[0]][resourceData[1]]) { - transformLog.errors.push({ + log.push({ type: LogType.ERROR, message: `Value '${resourceData[1]}' does not exist on type 'typeof ${resourceData[0]}'.`, pos: pos }); } else if (!resources[resourceData[0]][resourceData[1]][resourceData[2]]) { - transformLog.errors.push({ + log.push({ type: LogType.ERROR, message: `Value '${resourceData[2]}' does not exist on type 'typeof ${resourceData[1]}'.`, pos: pos -- Gitee From a04166d21ec9a16836f15acf3ffb664c47febb90 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 31 Oct 2022 15:26:22 +0800 Subject: [PATCH 103/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 极速预览问题修复 Signed-off-by: houhaoyu Change-Id: Id28290d0a9dd885a54b20276e0863c1188c8a725 --- compiler/package-lock.json | 5 +++++ compiler/package.json | 1 + compiler/server/build_pipe_server.js | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler/package-lock.json b/compiler/package-lock.json index f4c62b7..1f1bccb 100644 --- a/compiler/package-lock.json +++ b/compiler/package-lock.json @@ -3119,6 +3119,11 @@ "p-locate": "^4.1.0" } }, + "lodash": { + "version": "4.17.21", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "lodash.debounce": { "version": "4.0.8", "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.debounce/-/lodash.debounce-4.0.8.tgz", diff --git a/compiler/package.json b/compiler/package.json index 693d428..32824c6 100644 --- a/compiler/package.json +++ b/compiler/package.json @@ -41,6 +41,7 @@ "deccjsunit": "^1.0.8", "hypium": "^1.0.0", "ignore-loader": "^0.1.2", + "lodash": "^4.17.21", "log4js": "^6.3.0", "md5": "^2.3.0", "ts-loader": "^8.0.12", diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index 6886f33..2b4438e 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -18,6 +18,7 @@ const ts = require('typescript'); const path = require('path'); const fs = require('fs'); const pipeProcess = require('child_process'); +const _ = require('lodash'); const { processComponentChild } = require('../lib/process_component_build'); const { createWatchCompilerHost } = require('../lib/ets_checker'); @@ -109,7 +110,7 @@ function handlePluginCompileComponent(jsonData) { return; } start = true; - const receivedMsg = jsonData; + const receivedMsg = _.cloneDeep(jsonData); const compilerOptions = ts.readConfigFile( path.resolve(__dirname, '../tsconfig.json'), ts.sys.readFile).config.compilerOptions; Object.assign(compilerOptions, { -- Gitee From ec36bd1db36fddf9bcbba4eabd49a6588d9506f0 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 1 Nov 2022 20:05:36 +0800 Subject: [PATCH 104/379] houhaoyu@huawei.com ListItemGroup bind this Signed-off-by: houhaoyu Change-Id: I8b7a5dfc4579d3c98a2c7f8505e297cab04eea05 --- compiler/src/pre_define.ts | 3 ++ compiler/src/process_component_build.ts | 8 +++-- compiler/src/utils.ts | 40 +++++++++++++++++++++++-- 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 6092a83..166a5f9 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -213,6 +213,9 @@ export const BIND_POPUP: string = 'bindPopup'; export const BIND_POPUP_SET: Set = new Set(['bindPopup']); export const BIND_DRAG_SET: Set = new Set(['onDragStart', 'onItemDragStart']); export const BIND_OBJECT_PROPERTY: Map> = new Map([['Navigation', new Set(['title'])]]); +export const CREATE_BIND_COMPONENT: Set = new Set(['ListItemGroup']); +export const HEADER: string = 'header'; +export const FOOTER: string = 'footer'; export const CHECKED: string = 'checked'; export const RADIO: string = 'Radio'; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 88a9dd4..983d211 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -93,7 +93,9 @@ import { RESOURCE_NAME_TYPE, XCOMPONENT_SINGLE_QUOTATION, XCOMPONENT_DOUBLE_QUOTATION, - BIND_OBJECT_PROPERTY + BIND_OBJECT_PROPERTY, + HEADER, + FOOTER } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -1470,11 +1472,11 @@ function parseBuilderNode(node: ts.Node): ts.ObjectLiteralExpression { } } -function processObjectPropertyBuilder(node: ts.ObjectLiteralExpression): ts.ObjectLiteralExpression { +export function processObjectPropertyBuilder(node: ts.ObjectLiteralExpression): ts.ObjectLiteralExpression { const newProperties: ts.PropertyAssignment[] = []; node.properties.forEach((property: ts.PropertyAssignment) => { if (property.name && ts.isIdentifier(property.name) && - property.name.escapedText.toString() === CUSTOM_DIALOG_CONTROLLER_BUILDER && + [CUSTOM_DIALOG_CONTROLLER_BUILDER, HEADER, FOOTER].includes(property.name.escapedText.toString()) && property.initializer && isPropertyAccessExpressionNode(property.initializer)) { newProperties.push(ts.factory.updatePropertyAssignment(property, property.name, ts.factory.createCallExpression( diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 3bd3ba1..b93f418 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -43,10 +43,13 @@ import { CARD_LOG_TYPE_IMPORT, TS2ABC, ES2ABC, - EXTNAME_PROTO_BIN + EXTNAME_PROTO_BIN, + COMPONENT_CREATE_FUNCTION, + CREATE_BIND_COMPONENT } from './pre_define'; import { minify, MinifyOutput } from 'terser'; import { resourceFileName } from './process_ui_syntax'; +import { processObjectPropertyBuilder } from './process_component_build'; export enum LogType { ERROR = 'ERROR', @@ -195,16 +198,49 @@ export function readFile(dir: string, utFiles: string[]) { export function createFunction(node: ts.Identifier, attrNode: ts.Identifier, argumentsArr: ts.NodeArray): ts.CallExpression { + if (argumentsArr && argumentsArr.length) { + if (checkCreateArgumentBuilder(node, attrNode)) { + argumentsArr = transformBuilder(argumentsArr); + } + } else { + //@ts-ignore + argumentsArr = []; + } return ts.factory.createCallExpression( ts.factory.createPropertyAccessExpression( node, attrNode ), undefined, - argumentsArr && argumentsArr.length ? argumentsArr : [] + argumentsArr ); } +function checkCreateArgumentBuilder(node: ts.Identifier, attrNode: ts.Identifier): boolean { + if (attrNode.escapedText.toString() === COMPONENT_CREATE_FUNCTION && + CREATE_BIND_COMPONENT.has(node.escapedText.toString())) { + return true; + } + return false; +} + +function transformBuilder(argumentsArr: ts.NodeArray): ts.NodeArray { + const newArguments: ts.Expression[] = []; + argumentsArr.forEach((argument: ts.Expression) => { + newArguments.push(parseCreateParameterBuilder(argument)); + }) + //@ts-ignore + return newArguments; +} + +function parseCreateParameterBuilder(argument: ts.Expression):ts.Expression { + if (ts.isObjectLiteralExpression(argument)) { + return processObjectPropertyBuilder(argument); + } else { + return argument; + } +} + export function circularFile(inputPath: string, outputPath: string): void { if (!inputPath || !outputPath) { return; -- Gitee From 2a5d4ac98391fe158efb62a58ee7d2fcf15092e0 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 1 Nov 2022 21:05:30 +0800 Subject: [PATCH 105/379] houhaoyu2huawei.com parent->parent?parent:this in builder Signed-off-by: houhaoyu Change-Id: Ic97fd536ab8950e89af6b8a8270d20047833921f --- compiler/src/process_component_build.ts | 11 +++++++---- compiler/src/process_component_member.ts | 11 +++++++---- compiler/src/process_custom_component.ts | 6 +++--- .../render_decorator/@builder/@builder.ts | 10 +++++----- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 88a9dd4..0d667f1 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -117,7 +117,10 @@ import { builderParamObjectCollection, checkAllNode } from './validate_ui_syntax'; -import { processCustomComponent } from './process_custom_component'; +import { + processCustomComponent, + createConditionParent +} from './process_custom_component'; import { LogType, LogInfo, @@ -302,7 +305,8 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme item = expressionResult; } } - processCustomComponent(item as ts.ExpressionStatement, newStatements, log, name, isBuilder); + processCustomComponent(item as ts.ExpressionStatement, newStatements, log, name, + isBuilder, isGlobalBuilder); } break; case ComponentType.forEachComponent: @@ -531,8 +535,7 @@ function createComponentCreationStatement(node: ts.Statement, innerStatements: t isGlobalBuilder: boolean = false): ts.Statement { return ts.factory.createExpressionStatement( ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression(isGlobalBuilder ? - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT) : ts.factory.createThis(), + ts.factory.createPropertyAccessExpression(createConditionParent(isGlobalBuilder), ts.factory.createIdentifier(OBSERVECOMPONENTCREATION) ), undefined, [ts.factory.createArrowFunction(undefined, undefined, diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 11bcde9..622b298 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -665,14 +665,14 @@ export function createViewCreate(node: ts.NewExpression | ts.Identifier): ts.Cal } export function createCustomComponentNewExpression(node: ts.CallExpression, name: string, - isBuilder: boolean = false): ts.NewExpression { + isBuilder: boolean = false, isGlobalBuilder: boolean = false): ts.NewExpression { const newNode: ts.NewExpression = ts.factory.createNewExpression(node.expression, node.typeArguments, node.arguments.length ? node.arguments : []); - return addCustomComponentId(newNode, name, isBuilder); + return addCustomComponentId(newNode, name, isBuilder, isGlobalBuilder); } function addCustomComponentId(node: ts.NewExpression, componentName: string, - isBuilder: boolean = false): ts.NewExpression { + isBuilder: boolean = false, isGlobalBuilder: boolean = false): ts.NewExpression { for (const item of componentCollection.customComponents) { componentInfo.componentNames.add(item); } @@ -698,7 +698,10 @@ function addCustomComponentId(node: ts.NewExpression, componentName: string, ts.factory.createToken(ts.SyntaxKind.ColonToken), ts.factory.createThis() ) : ts.factory.createThis()); } else { - argumentsArray.unshift(ts.factory.createThis()); + argumentsArray.unshift(isGlobalBuilder ? ts.factory.createConditionalExpression( + ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), ts.factory.createToken(ts.SyntaxKind.QuestionToken), + ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), ts.factory.createToken(ts.SyntaxKind.ColonToken), + ts.factory.createThis()) : ts.factory.createThis()); } node = ts.factory.updateNewExpression(node, node.expression, node.typeArguments, argumentsArray); diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index b64b8a4..1847361 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -85,14 +85,14 @@ const decoractorMap: Map>> = new Map( [COMPONENT_OBJECT_LINK_DECORATOR, objectLinkCollection]]); export function processCustomComponent(node: ts.ExpressionStatement, newStatements: ts.Statement[], - log: LogInfo[], name: string, isBuilder: boolean = false): void { + log: LogInfo[], name: string, isBuilder: boolean = false, isGlobalBuilder: boolean = false): void { const componentNode: ts.CallExpression = getCustomComponentNode(node); if (componentNode) { const hasChainCall: boolean = componentNode.parent && ts.isPropertyAccessExpression(componentNode.parent); let ischangeNode: boolean = false; let customComponentNewExpression: ts.NewExpression = createCustomComponentNewExpression( - componentNode, name, isBuilder); + componentNode, name, isBuilder, isGlobalBuilder); let argumentsArray: ts.PropertyAssignment[]; if (isHasChild(componentNode)) { // @ts-ignore @@ -448,7 +448,7 @@ function createFindChildById(id: string, name: string, isBuilder: boolean = fals ts.factory.createIdentifier('undefined')))], ts.NodeFlags.Let)); } -function createConditionParent(isBuilder: boolean): ts.ParenthesizedExpression | ts.ThisExpression { +export function createConditionParent(isBuilder: boolean): ts.ParenthesizedExpression | ts.ThisExpression { return isBuilder ? ts.factory.createParenthesizedExpression(ts.factory.createConditionalExpression( ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), ts.factory.createToken(ts.SyntaxKind.QuestionToken), ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), ts.factory.createToken(ts.SyntaxKind.ColonToken), diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts index 95b7f03..be5bbdb 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts @@ -144,7 +144,7 @@ struct MyComponent { exports.expectResult = `"use strict"; function noParam(parent = undefined) { - parent.observeComponentCreation((elmtId, isInitialRender) => { + (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Row.create(); if (!isInitialRender) { @@ -152,7 +152,7 @@ function noParam(parent = undefined) { } ViewStackProcessor.StopGetAccessRecording(); }); - parent.observeComponentCreation((elmtId, isInitialRender) => { + (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Text.create('this is a no param builder'); if (!isInitialRender) { @@ -164,7 +164,7 @@ function noParam(parent = undefined) { Row.pop(); } function specificParam(label1, label2, parent = undefined) { - parent.observeComponentCreation((elmtId, isInitialRender) => { + (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Column.create(); if (!isInitialRender) { @@ -172,7 +172,7 @@ function specificParam(label1, label2, parent = undefined) { } ViewStackProcessor.StopGetAccessRecording(); }); - parent.observeComponentCreation((elmtId, isInitialRender) => { + (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Text.create(label1); if (!isInitialRender) { @@ -181,7 +181,7 @@ function specificParam(label1, label2, parent = undefined) { ViewStackProcessor.StopGetAccessRecording(); }); Text.pop(); - parent.observeComponentCreation((elmtId, isInitialRender) => { + (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Text.create(label2); if (!isInitialRender) { -- Gitee From f54416002bf194093437603788e2eb86cad6b81c Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Tue, 1 Nov 2022 03:51:45 +0000 Subject: [PATCH 106/379] Fix performance optimization of preview mode Signed-off-by: zhangrengao Change-Id: I8e16363481618472c874d44dc87dd8e3d1a77807 --- compiler/src/gen_abc_plugin.ts | 102 +++++++++++++++++---------------- 1 file changed, 53 insertions(+), 49 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 5072991..18204c3 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -235,8 +235,12 @@ export class GenAbcPlugin { return; } buildPathInfo = output; - previewCount++; - invokeWorkersToGenAbc(); + if (previewCount == compileCount) { + previewCount++; + invokeWorkersToGenAbc(); + } else { + previewCount++; + } }); } } @@ -814,51 +818,56 @@ function invokeWorkersToGenAbc(): void { }); } - for (let i = 0; i < workerNumber; ++i) { - const workerData: any = { - 'inputs': JSON.stringify(splitedBundles[i]), - 'cmd': cmdPrefix - }; - cluster.fork(workerData); - } + if (workerNumber === 0) { + if (process.env.watchMode === 'true' && compileCount < previewCount) { + compileCount++; + processExtraAsset(); + if (compileCount >= previewCount) { + return; + } + invokeWorkersToGenAbc(); + } + } else { + for (let i = 0; i < workerNumber; ++i) { + const workerData: any = { + 'inputs': JSON.stringify(splitedBundles[i]), + 'cmd': cmdPrefix + }; + cluster.fork(workerData); + } - let count_ = 0; - if (process.env.watchMode === 'true') { - process.removeAllListeners("exit"); - cluster.removeAllListeners("exit"); - } - cluster.on('exit', (worker, code, signal) => { - if (code === FAIL || process.exitCode === FAIL) { - process.exitCode = FAIL; + let count_ = 0; + if (process.env.watchMode === 'true') { + process.removeAllListeners("exit"); + cluster.removeAllListeners("exit"); } - count_++; - if (count_ === workerNumber) { - // for preview of with incre compile - if (process.env.watchMode === 'true' && compileCount < previewCount) { - compileCount++; - processExtraAsset(); - if (process.exitCode === SUCCESS) { - console.info(blue, 'COMPILE RESULT:SUCCESS ', reset); - } else { - console.info(blue, 'COMPILE RESULT:FAIL ', reset); - } - if (compileCount >= previewCount) { - return; + cluster.on('exit', (worker, code, signal) => { + count_++; + if (count_ === workerNumber) { + // for preview of with incre compile + if (process.env.watchMode === 'true' && compileCount < previewCount) { + compileCount++; + processExtraAsset(); + if (code === SUCCESS) { + console.info(blue, 'COMPILE RESULT:SUCCESS ', reset); + } else { + console.info(blue, 'COMPILE RESULT:FAIL ', reset); + } + if (compileCount >= previewCount) { + return; + } + invokeWorkersToGenAbc(); } - invokeWorkersToGenAbc(); } - } - logger.debug(`worker ${worker.process.pid} finished`); - }); - - process.on('exit', (code) => { - // for build options - processExtraAsset(); - }); + logger.debug(`worker ${worker.process.pid} finished`); + }); + } - // for preview of without incre compile - if (workerNumber === 0 && process.env.watchMode === 'true') { - processExtraAsset(); + if (process.env.watchMode !== 'true') { + process.on('exit', (code) => { + // for build options + processExtraAsset(); + }); } } } @@ -934,9 +943,7 @@ function writeModuleHashJson(): void { return; } // fix bug of multi trigger - if (process.env.watchMode !== 'true' || previewCount < 1) { - fs.writeFileSync(hashFilePath, JSON.stringify(moduleHashJsonObject)); - } + fs.writeFileSync(hashFilePath, JSON.stringify(moduleHashJsonObject)); } function filterIntermediateJsBundleByHashJson(buildPath: string, inputPaths: File[]): void { @@ -1009,10 +1016,7 @@ function writeHashJson(): void { if (hashFilePath.length === 0) { return; } - // fix bug of multi trigger - if (process.env.watchMode !== 'true' || previewCount < 1) { - fs.writeFileSync(hashFilePath, JSON.stringify(hashJsonObject)); - } + fs.writeFileSync(hashFilePath, JSON.stringify(hashJsonObject)); } function genHashJsonPath(buildPath: string): string { -- Gitee From 9edf6e2d87e3acec560c92936f0efbbe9f526249 Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Wed, 26 Oct 2022 17:41:16 +0800 Subject: [PATCH 107/379] Enable hotfix Related issue:https://gitee.com/open_harmony/dashboard?issue_id=I5XPTY Change-Id: I96ca9db9bb63c10d842675d37eeb67848bbb60e1 Signed-off-by: chenqy930 --- compiler/src/gen_merged_abc.ts | 33 +++++++++++++++++++++++++++++---- compiler/src/pre_define.ts | 1 + 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index c847d2e..cd67da5 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -25,7 +25,8 @@ import { FILESINFO_TXT, MODULES_CACHE, NPMENTRIES_TXT, - NODE_MODULES + NODE_MODULES, + PATCH_SYMBOL_TABLE } from './pre_define'; import { EntryInfo, @@ -41,6 +42,9 @@ import { const red: string = '\u001b[31m'; const reset: string = '\u001b[39m'; +projectConfig.patch = false +projectConfig.enableMap = false + function generateCompileFilesInfo(moduleInfos: Array) { const tempModuleInfos: ModuleInfo[] = Array(); moduleInfos.forEach((item) => { @@ -88,8 +92,23 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma validateFilePathLength(cacheFilePath); const fileThreads = os.cpus().length < 16 ? os.cpus().length : 16; mkdirsSync(projectConfig.buildPath); - const genAbcCmd: string = - `${initAbcEnv().join(' ')} "@${filesInfoPath}" --npm-module-entry-list "${npmEntriesInfoPath}" --cache-file "${cacheFilePath}" --output "${outputABCPath}" --file-threads "${fileThreads}"`; + let genAbcCmd: string = + `${initAbcEnv().join(' ')} "@${filesInfoPath}" --npm-module-entry-list "${npmEntriesInfoPath}" --output "${outputABCPath}" --file-threads "${fileThreads}"`; + + projectConfig.inOldSymbolTablePath = projectConfig.projectRootPath; // temp symbol table path for hot patch + if (projectConfig.patch) { + let oldHapSymbolTable = path.join(projectConfig.inOldSymbolTablePath, PATCH_SYMBOL_TABLE); + genAbcCmd += ` --input-symbol-table "${oldHapSymbolTable}" --generate-patch`; + } + + if (!projectConfig.enableMap) { + genAbcCmd += ` --cache-file "${cacheFilePath}"`; + } else { + // when generating map, cache is forbiden to avoid uncomplete symbol table + let oldHapSymbolTable = path.join(projectConfig.inOldSymbolTablePath, PATCH_SYMBOL_TABLE); + genAbcCmd += ` --dump-symbol-table "${oldHapSymbolTable}"`; + } + logger.debug('gen abc cmd is: ', genAbcCmd); try { if (process.env.watchMode === 'true') { @@ -109,7 +128,13 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma }); child.stderr.on('data', (data: any) => { - logger.debug(red, data.toString(), reset); + if (projectConfig.patch) { + let patchErr :string[] = + data.split(os.EOL).filter(line => line.includes("[Patch]") || line.includes("Error:")); + logger.error(red, patchErr.join(os.EOL), reset); + } else { + logger.debug(red, data.toString(), reset); + } }); } } catch (e) { diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index e356f09..804579e 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -273,6 +273,7 @@ export const EXTNAME_CJS: string = '.cjs'; export const EXTNAME_D_TS: string = '.d.ts'; export const EXTNAME_ABC: string = '.abc'; export const EXTNAME_PROTO_BIN: string = '.protoBin'; +export const PATCH_SYMBOL_TABLE: string = "symbol.txt"; export const SUCCESS: number = 0; export const FAIL: number = 1; -- Gitee From c2cdff5718a9bbbf6e8390e52056cc390f616bf7 Mon Sep 17 00:00:00 2001 From: bojiang Date: Tue, 1 Nov 2022 19:59:21 +0800 Subject: [PATCH 108/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I6fca7884de8acdf81ee2c134eb3fb368018607a8 --- compiler/src/pre_define.ts | 2 + compiler/src/process_component_build.ts | 34 +- .../render_component/foreach/forEachTwo.ts | 3 +- .../render_component/foreach/foreach.ts | 386 +++++++++++++++++- .../render_decorator/@builder/@builder.ts | 3 +- .../@objectLink/@objectLink.ts | 3 +- 6 files changed, 415 insertions(+), 16 deletions(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 6092a83..2431e74 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -114,6 +114,8 @@ export const ATTRIBUTE_ANIMATION: string = 'animation'; export const ATTRIBUTE_ANIMATETO: string = 'animateTo'; export const ATTRIBUTE_STATESTYLES: string = 'stateStyles'; export const ATTRIBUTE_ID: string = 'id'; +export const TRUE: string = 'true'; +export const FALSE: string = 'false'; export const COMPONENT_CONSTRUCTOR_ID: string = 'compilerAssignedUniqueChildId'; export const COMPONENT_CONSTRUCTOR_PARENT: string = 'parent'; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 88a9dd4..b1795fe 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -93,7 +93,11 @@ import { RESOURCE_NAME_TYPE, XCOMPONENT_SINGLE_QUOTATION, XCOMPONENT_DOUBLE_QUOTATION, - BIND_OBJECT_PROPERTY + BIND_OBJECT_PROPERTY, + TRUE, + FALSE, + HEADER, + FOOTER } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -957,11 +961,7 @@ function processForEachComponentNew(node: ts.ExpressionStatement, newStatements: const updateFunctionStatement: ts.ExpressionStatement = createUpdateFunctionStatement(argumentsArray); const lazyForEachStatement: ts.ExpressionStatement = createLazyForEachStatement(argumentsArray); if (node.expression.expression.getText() === COMPONENT_FOREACH) { - if (argumentsArray[2]) { - newForEachStatements.push(propertyNode, itemGenFunctionStatement, itemIdFuncStatement, updateFunctionStatement); - } else { - newForEachStatements.push(propertyNode, itemGenFunctionStatement, updateFunctionStatement); - } + newForEachStatements.push(propertyNode, itemGenFunctionStatement, updateFunctionStatement); newStatements.push(createComponentCreationStatement(node, newForEachStatements), popNode); } else { if (argumentsArray[2]) { @@ -1068,12 +1068,30 @@ function addForEachIdFuncParameter(argumentsArray: ts.Expression[]): ts.Expressi argumentsArray[0], ts.factory.createIdentifier(FOREACHITEMGENFUNCTION) ); - if (argumentsArray[2]) { - addForEachIdFuncParameterArr.push(ts.factory.createIdentifier(FOREACHITEMIDFUNC)); + // @ts-ignore + if (argumentsArray[1] && argumentsArray[1].parameters[1]) { + if (!argumentsArray[2]) { + addForEachIdFuncParameterArr.push(...addForEachParameter(ts.factory.createIdentifier(COMPONENT_IF_UNDEFINED), TRUE, FALSE)); + } else { + //@ts-ignore + argumentsArray[2].parameters[1] ? addForEachIdFuncParameterArr.push(...addForEachParameter(argumentsArray[2], TRUE, TRUE)) : + addForEachIdFuncParameterArr.push(...addForEachParameter(argumentsArray[2], TRUE, FALSE)); + } + } + //@ts-ignore + if (argumentsArray[1] && !argumentsArray[1].parameters[1] && argumentsArray[2]) { + //@ts-ignore + argumentsArray[2].parameters[1] ? addForEachIdFuncParameterArr.push(...addForEachParameter(argumentsArray[2], FALSE, TRUE)) : + addForEachIdFuncParameterArr.push(...addForEachParameter(argumentsArray[2], FALSE, FALSE)); } return addForEachIdFuncParameterArr; } +function addForEachParameter(forEachItemIdContent: ts.Expression, forEachItemGen: string, forEachItemId: string): ts.Expression[] { + return [forEachItemIdContent, ts.factory.createIdentifier(forEachItemGen), + ts.factory.createIdentifier(forEachItemId)]; +} + function createLazyForEachStatement(argumentsArray: ts.Expression[]): ts.ExpressionStatement { const parameterList: ts.Expression[] = [ ts.factory.createStringLiteral(componentInfo.id.toString()), diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/forEachTwo.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/forEachTwo.ts index 9126c42..74307ff 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/forEachTwo.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/forEachTwo.ts @@ -108,8 +108,7 @@ class Index extends ViewPU { }); Button.pop(); }; - const forEachItemIdFunc = item => item.toString(); - this.forEachUpdateFunction(elmtId, this.WIDTH_AND_HEIGHT, forEachItemGenFunction, forEachItemIdFunc); + this.forEachUpdateFunction(elmtId, this.WIDTH_AND_HEIGHT, forEachItemGenFunction, item => item.toString(), false, false); if (!isInitialRender) { ForEach.pop(); } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts index c572f06..4b587fe 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts @@ -17,6 +17,79 @@ exports.source = ` @Entry @Component struct ParentView { + @State arr: string[] = ['1', '2', '3']; + build() { + List() { + ForEach(this.arr, + item => { + Text(item) + } + ) + } + } +} + +@Component +struct ParentView1 { + @State arr: string[] = ['1', '2', '3']; + build() { + List() { + ForEach(this.arr, + (item, index) => { + Text(item) + } + ) + } + } +} + +@Component +struct ParentView2 { + @State arr: string[] = ['1', '2', '3']; + build() { + List() { + ForEach(this.arr, + (item, index) => { + Text(item) + }, + item => item.toString() + ) + } + } +} + +@Component +struct ParentView3 { + @State arr: string[] = ['1', '2', '3']; + build() { + List() { + ForEach(this.arr, + (item, index) => { + Text(item) + }, + (item, index) => item.toString() + ) + } + } +} + +@Component +struct ParentView4 { + @State arr: string[] = ['1', '2', '3']; + build() { + List() { + ForEach(this.arr, + item => { + Text(item) + }, + (item, index) => item.toString() + ) + } + } +} + +@Component +struct ParentView5 { @State arr: string[] = ['1', '2', '3']; build() { List() { @@ -81,8 +154,317 @@ class ParentView extends ViewPU { }); Text.pop(); }; - const forEachItemIdFunc = item => item.toString(); - this.forEachUpdateFunction(elmtId, this.arr, forEachItemGenFunction, forEachItemIdFunc); + this.forEachUpdateFunction(elmtId, this.arr, forEachItemGenFunction); + if (!isInitialRender) { + ForEach.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + ForEach.pop(); + List.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class ParentView1 extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__arr = new ObservedPropertyObjectPU(['1', '2', '3'], this, "arr"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.arr !== undefined) { + this.arr = params.arr; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__arr.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__arr.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get arr() { + return this.__arr.get(); + } + set arr(newValue) { + this.__arr.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + List.create(); + if (!isInitialRender) { + List.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ForEach.create(); + const forEachItemGenFunction = (_item, index) => { + const item = _item; + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(item); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + }; + this.forEachUpdateFunction(elmtId, this.arr, forEachItemGenFunction, undefined, true, false); + if (!isInitialRender) { + ForEach.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + ForEach.pop(); + List.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class ParentView2 extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__arr = new ObservedPropertyObjectPU(['1', '2', '3'], this, "arr"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.arr !== undefined) { + this.arr = params.arr; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__arr.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__arr.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get arr() { + return this.__arr.get(); + } + set arr(newValue) { + this.__arr.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + List.create(); + if (!isInitialRender) { + List.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ForEach.create(); + const forEachItemGenFunction = (_item, index) => { + const item = _item; + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(item); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + }; + this.forEachUpdateFunction(elmtId, this.arr, forEachItemGenFunction, item => item.toString(), true, false); + if (!isInitialRender) { + ForEach.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + ForEach.pop(); + List.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class ParentView3 extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__arr = new ObservedPropertyObjectPU(['1', '2', '3'], this, "arr"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.arr !== undefined) { + this.arr = params.arr; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__arr.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__arr.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get arr() { + return this.__arr.get(); + } + set arr(newValue) { + this.__arr.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + List.create(); + if (!isInitialRender) { + List.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ForEach.create(); + const forEachItemGenFunction = (_item, index) => { + const item = _item; + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(item); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + }; + this.forEachUpdateFunction(elmtId, this.arr, forEachItemGenFunction, (item, index) => item.toString(), true, true); + if (!isInitialRender) { + ForEach.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + ForEach.pop(); + List.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class ParentView4 extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__arr = new ObservedPropertyObjectPU(['1', '2', '3'], this, "arr"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.arr !== undefined) { + this.arr = params.arr; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__arr.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__arr.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get arr() { + return this.__arr.get(); + } + set arr(newValue) { + this.__arr.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + List.create(); + if (!isInitialRender) { + List.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ForEach.create(); + const forEachItemGenFunction = _item => { + const item = _item; + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(item); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + }; + this.forEachUpdateFunction(elmtId, this.arr, forEachItemGenFunction, (item, index) => item.toString(), false, true); + if (!isInitialRender) { + ForEach.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + ForEach.pop(); + List.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class ParentView5 extends ViewPU { + constructor(parent, params, __localStorage) { + super(parent, __localStorage); + this.__arr = new ObservedPropertyObjectPU(['1', '2', '3'], this, "arr"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.arr !== undefined) { + this.arr = params.arr; + } + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__arr.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__arr.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get arr() { + return this.__arr.get(); + } + set arr(newValue) { + this.__arr.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + List.create(); + if (!isInitialRender) { + List.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ForEach.create(); + const forEachItemGenFunction = _item => { + const item = _item; + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(item); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + }; + this.forEachUpdateFunction(elmtId, this.arr, forEachItemGenFunction, item => item.toString(), false, false); if (!isInitialRender) { ForEach.pop(); } diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts index 95b7f03..e8c9d29 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts @@ -501,8 +501,7 @@ class MyComponent extends ViewPU { } } }; - const forEachItemIdFunc = item => item; - this.forEachUpdateFunction(elmtId, this.arr, forEachItemGenFunction, forEachItemIdFunc); + this.forEachUpdateFunction(elmtId, this.arr, forEachItemGenFunction, item => item, false, false); if (!isInitialRender) { ForEach.pop(); } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts index 35775e6..1bdff6b 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts @@ -166,8 +166,7 @@ class Parent extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); } }; - const forEachItemIdFunc = (item) => item.text; - this.forEachUpdateFunction(elmtId, this.models, forEachItemGenFunction, forEachItemIdFunc); + this.forEachUpdateFunction(elmtId, this.models, forEachItemGenFunction, (item) => item.text, false, false); if (!isInitialRender) { ForEach.pop(); } -- Gitee From 1e610904a239432091b316936e531e526f232655 Mon Sep 17 00:00:00 2001 From: yfwang6 Date: Thu, 3 Nov 2022 17:17:49 +0800 Subject: [PATCH 109/379] wangyongfei6@huawei.com @Extend compile do not use Call expression immediately Signed-off-by: yfwang6 Change-Id: I64ee1fd535111381eed2806120899d1986f4390e --- compiler/src/process_ui_syntax.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index e655558..e76e7d8 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -527,10 +527,7 @@ function processExtend(node: ts.FunctionDeclaration, log: LogInfo[]): ts.Functio ts.factory.createExpressionStatement(processExtendBody(node.expression, componentName)); const statementArray: ts.Statement[] = []; bindComponentAttr(changeCompName, ts.factory.createIdentifier(componentName), statementArray, []); - return ts.factory.createCallExpression( - ts.factory.createParenthesizedExpression(ts.factory.createFunctionExpression( - undefined, undefined, undefined, undefined, [], undefined, - ts.factory.createBlock(statementArray, true))), undefined, []); + return ts.factory.createBlock(statementArray, true); } return ts.visitEachChild(node, traverseExtendExpression, contextGlobal); } -- Gitee From c18cb5dbf1a86683c8d1c6a7f23ef1fbed78f3f9 Mon Sep 17 00:00:00 2001 From: bojiang Date: Fri, 4 Nov 2022 14:54:24 +0800 Subject: [PATCH 110/379] jiangbo91@huawei.com fix forEach no itemGeneratorParam error Signed-off-by: bojiang Change-Id: I86595d84288c5b0f57e73819a6a4629b7fc24c52 --- compiler/src/process_component_build.ts | 48 ++++++++++++++----------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index ba245c4..a69bb6d 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -992,24 +992,13 @@ function createItemGenFunctionStatement( undefined, undefined, ts.factory.createArrowFunction( undefined, undefined, - getParameters(argumentsArray[1]), + argumentsArray[1].parameters && argumentsArray[1].parameters.length >= 1 ? + getParameters(argumentsArray[1]) : [], undefined, ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), ts.factory.createBlock( - [ts.factory.createVariableStatement( - undefined, - ts.factory.createVariableDeclarationList( - [ts.factory.createVariableDeclaration( - ts.factory.createIdentifier( - argumentsArray[1].parameters[0] && argumentsArray[1].parameters[0].name.getText()), - undefined, - undefined, - ts.factory.createIdentifier(_ITEM) - )], - ts.NodeFlags.Const - ) - ), - ...newArrowNode - ], + argumentsArray[1].parameters && argumentsArray[1].parameters.length >= 1 ? + isForEachItemGeneratorParam(argumentsArray, newArrowNode) : + [...newArrowNode], true ) ) @@ -1021,6 +1010,25 @@ function createItemGenFunctionStatement( } } +function isForEachItemGeneratorParam(argumentsArray: ts.Expression[], newArrowNode: ts.NodeArray): ts.Statement[] { + return [ + ts.factory.createVariableStatement( + undefined, + ts.factory.createVariableDeclarationList( + [ts.factory.createVariableDeclaration( + ts.factory.createIdentifier( + argumentsArray[1].parameters[0] && argumentsArray[1].parameters[0].name.getText()), + undefined, + undefined, + ts.factory.createIdentifier(_ITEM) + )], + ts.NodeFlags.Const + ) + ), + ...newArrowNode + ]; +} + function getParameters(node: ts.ArrowFunction): ts.ParameterDeclaration[] { const parameterArr: ts.ParameterDeclaration[] = [ ts.factory.createParameterDeclaration( @@ -1071,19 +1079,19 @@ function addForEachIdFuncParameter(argumentsArray: ts.Expression[]): ts.Expressi argumentsArray[0], ts.factory.createIdentifier(FOREACHITEMGENFUNCTION) ); - // @ts-ignore + // @ts-ignore if (argumentsArray[1] && argumentsArray[1].parameters[1]) { if (!argumentsArray[2]) { addForEachIdFuncParameterArr.push(...addForEachParameter(ts.factory.createIdentifier(COMPONENT_IF_UNDEFINED), TRUE, FALSE)); } else { - //@ts-ignore + // @ts-ignore argumentsArray[2].parameters[1] ? addForEachIdFuncParameterArr.push(...addForEachParameter(argumentsArray[2], TRUE, TRUE)) : addForEachIdFuncParameterArr.push(...addForEachParameter(argumentsArray[2], TRUE, FALSE)); } } - //@ts-ignore + // @ts-ignore if (argumentsArray[1] && !argumentsArray[1].parameters[1] && argumentsArray[2]) { - //@ts-ignore + // @ts-ignore argumentsArray[2].parameters[1] ? addForEachIdFuncParameterArr.push(...addForEachParameter(argumentsArray[2], FALSE, TRUE)) : addForEachIdFuncParameterArr.push(...addForEachParameter(argumentsArray[2], FALSE, FALSE)); } -- Gitee From 55fd146db3174153ffc3bd21db57e45bf475391f Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sun, 6 Nov 2022 19:02:26 +0800 Subject: [PATCH 111/379] houhaoyu@huawei.com fix globalbuilder Signed-off-by: houhaoyu Change-Id: I22de877596e9aff26a1b3f8966cd33904019d6f5 --- compiler/src/process_component_build.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index ba245c4..75b3626 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -449,7 +449,7 @@ function processInnerComponent(node: ts.ExpressionStatement, innerCompStatements const nameResult: NameResult = { name: null }; validateEtsComponentNode(node.expression as ts.EtsComponentExpression, nameResult); if (partialUpdateConfig.partialUpdateMode && ItemComponents.includes(nameResult.name)) { - processItemComponent(node, nameResult, innerCompStatements, log); + processItemComponent(node, nameResult, innerCompStatements, log, isGlobalBuilder); } else if (partialUpdateConfig.partialUpdateMode && TABCONTENT_COMPONENT.includes(nameResult.name)) { processTabContent(node, innerCompStatements, log, isGlobalBuilder); } else { @@ -594,7 +594,7 @@ function createInitRenderStatement(node: ts.Statement): ts.Statement { } function processItemComponent(node: ts.ExpressionStatement, nameResult: NameResult, innerCompStatements: ts.Statement[], - log: LogInfo[]): void { + log: LogInfo[], isGlobalBuilder: boolean = false): void { const itemRenderInnerStatements: ts.Statement[] = []; const deepItemRenderInnerStatements: ts.Statement[] = []; const res: CreateResult = createComponent(node, COMPONENT_CREATE_FUNCTION); @@ -606,7 +606,8 @@ function processItemComponent(node: ts.ExpressionStatement, nameResult: NameResu if (etsComponentResult.hasAttr) { bindComponentAttr(node, res.identifierNode, itemRenderInnerStatements, log); } - processComponentChild(etsComponentResult.etsComponentNode.body, deepItemRenderInnerStatements, log); + processComponentChild(etsComponentResult.etsComponentNode.body, deepItemRenderInnerStatements, log, + {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, false, undefined, undefined, isGlobalBuilder); } else { bindComponentAttr(node, res.identifierNode, itemRenderInnerStatements, log); } -- Gitee From 5ac83b526a843abeeabac7a16084d4eb3dc80991 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 7 Nov 2022 11:02:33 +0800 Subject: [PATCH 112/379] houhaoyu@huawei.com fix tsloader error Signed-off-by: houhaoyu Change-Id: Ia899dd1c46c008504815447ed7482a7530ac6696 --- compiler/src/process_ui_syntax.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index e76e7d8..caf3ba1 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -742,9 +742,8 @@ function createPreviewComponentFunction(name: string, context: ts.Transformation argsArr.push(context.factory.createStringLiteral(componentName)); argsArr.push(newExpression); }); - const newExpressionParams: any[] = [ - context.factory.createNewExpression( - context.factory.createIdentifier(name), undefined, newArray)]; + const newExpressionParams: any[] = name ? [context.factory.createNewExpression( + context.factory.createIdentifier(name), undefined, newArray)] : []; addCardStringliteral(newExpressionParams, context, cardRelativePath); const ifStatement: ts.Statement = context.factory.createIfStatement( context.factory.createCallExpression( -- Gitee From 6b05eee7c346b44a428b436cc62205028c1907d2 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 7 Nov 2022 11:49:49 +0800 Subject: [PATCH 113/379] houhaoyu@huawei.com fix globalbuilder Signed-off-by: houhaoyu Change-Id: Ia76d3d58bbcec08ce18d6dfabf03f8daf2f605d3 --- compiler/src/process_component_build.ts | 11 ++++++++++- compiler/src/process_component_member.ts | 21 ++++++++------------- compiler/src/process_custom_component.ts | 10 +++++----- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 75b3626..67db200 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1123,10 +1123,19 @@ function addForEachId(node: ts.ExpressionStatement, isGlobalBuilder: boolean = f return ts.factory.updateExpressionStatement(node, ts.factory.updateCallExpression( forEachComponent, forEachComponent.expression, forEachComponent.typeArguments, [ts.factory.createStringLiteral((++componentInfo.id).toString()), - isGlobalBuilder ? ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT) : ts.factory.createThis(), + isGlobalBuilder ? parentConditionalExpression() : ts.factory.createThis(), ...forEachComponent.arguments])); } +export function parentConditionalExpression(): ts.ConditionalExpression { + return ts.factory.createConditionalExpression( + ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), + ts.factory.createToken(ts.SyntaxKind.QuestionToken), + ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), + ts.factory.createToken(ts.SyntaxKind.ColonToken), + ts.factory.createThis()); +} + function processForEachBlock(node: ts.CallExpression, log: LogInfo[], isBuilder: boolean = false, isGlobalBuilder: boolean = false): ts.NodeArray | ts.ArrowFunction { if (node.arguments.length > 1 && ts.isArrowFunction(node.arguments[1])) { diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 622b298..b6e314e 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -93,9 +93,12 @@ import { isProperty } from './process_component_class'; import { transformLog } from './process_ui_syntax'; -import { globalProgram, projectConfig } from '../main'; - -import { partialUpdateConfig } from '../main'; +import { + globalProgram, + projectConfig, + partialUpdateConfig +} from '../main'; +import { parentConditionalExpression } from './process_component_build' export type ControllerType = { hasController: boolean @@ -691,17 +694,9 @@ function addCustomComponentId(node: ts.NewExpression, componentName: string, ts.factory.createStringLiteral(path.basename(transformLog.sourceFile.fileName, EXTNAME_ETS) + '_'), ts.factory.createToken(ts.SyntaxKind.PlusToken), ts.factory.createIdentifier(_GENERATE_ID)) : ts.factory.createStringLiteral(componentInfo.id.toString()), - isBuilder ? ts.factory.createConditionalExpression( - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), - ts.factory.createToken(ts.SyntaxKind.QuestionToken), - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), - ts.factory.createToken(ts.SyntaxKind.ColonToken), ts.factory.createThis() - ) : ts.factory.createThis()); + isBuilder ? parentConditionalExpression() : ts.factory.createThis()); } else { - argumentsArray.unshift(isGlobalBuilder ? ts.factory.createConditionalExpression( - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), ts.factory.createToken(ts.SyntaxKind.QuestionToken), - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), ts.factory.createToken(ts.SyntaxKind.ColonToken), - ts.factory.createThis()) : ts.factory.createThis()); + argumentsArray.unshift(isGlobalBuilder ? parentConditionalExpression() : ts.factory.createThis()); } node = ts.factory.updateNewExpression(node, node.expression, node.typeArguments, argumentsArray); diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 1847361..5931688 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -70,7 +70,10 @@ import { componentInfo, createFunction } from './utils'; -import { bindComponentAttr } from './process_component_build'; +import { + bindComponentAttr, + parentConditionalExpression +} from './process_component_build'; import { partialUpdateConfig } from '../main'; const localArray: string[] = [...observedPropertyDecorators, COMPONENT_NON_DECORATOR, @@ -449,10 +452,7 @@ function createFindChildById(id: string, name: string, isBuilder: boolean = fals } export function createConditionParent(isBuilder: boolean): ts.ParenthesizedExpression | ts.ThisExpression { - return isBuilder ? ts.factory.createParenthesizedExpression(ts.factory.createConditionalExpression( - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), ts.factory.createToken(ts.SyntaxKind.QuestionToken), - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), ts.factory.createToken(ts.SyntaxKind.ColonToken), - ts.factory.createThis())) : ts.factory.createThis(); + return isBuilder ? ts.factory.createParenthesizedExpression(parentConditionalExpression()) : ts.factory.createThis(); } function createCustomComponentIfStatement(id: string, node: ts.ExpressionStatement, -- Gitee From 9b163349344e3a5c41dc3b14be9163fbbf2f722e Mon Sep 17 00:00:00 2001 From: bojiang Date: Tue, 8 Nov 2022 10:32:40 +0800 Subject: [PATCH 114/379] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix 最小化更新forEach param or @Builder 重名 no error Signed-off-by: bojiang Change-Id: Icb291c01d2bbb34ddd9fe1a8f3792162843975c9 --- compiler/src/process_component_build.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 47f6c53..5b26f6e 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1168,7 +1168,7 @@ function processForEachBlock(node: ts.CallExpression, log: LogInfo[], processComponentBlock(blockNode, isLazy, log, false, false, undefined, arrowNode.parameters, isGlobalBuilder)); } else { - return processComponentBlock(blockNode, isLazy, log).statements; + return processComponentBlock(blockNode, isLazy, log, false, false, undefined, arrowNode.parameters).statements; } } else { if (!partialUpdateConfig.partialUpdateMode) { @@ -1177,7 +1177,7 @@ function processForEachBlock(node: ts.CallExpression, log: LogInfo[], arrowNode.type, arrowNode.equalsGreaterThanToken, processComponentBlock(body, isLazy, log, false, isBuilder, undefined, arrowNode.parameters)); } else { - return processComponentBlock(body, isLazy, log).statements; + return processComponentBlock(body, isLazy, log, false, false, undefined, arrowNode.parameters).statements; } } } -- Gitee From c805ab267fb7220fe71b7a659d2dbf371fd1672f Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 8 Nov 2022 15:19:31 +0800 Subject: [PATCH 115/379] houhaoyu@huawei.com fix @Styles empty bug Signed-off-by: houhaoyu Change-Id: Ia572c30891122cfc2f79b3aff1a691e2089a6334 --- compiler/src/process_component_class.ts | 10 ++++++---- compiler/src/validate_ui_syntax.ts | 8 +++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index 05a03d9..7a3c878 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -372,10 +372,12 @@ function processComponentMethod(node: ts.MethodDeclaration, parentComponentName: updateItem = processBuildMember(builderNode, context, log); } else if (hasDecorator(node, COMPONENT_STYLES_DECORATOR)) { if (node.parameters && node.parameters.length === 0) { - INNER_STYLE_FUNCTION.set(name, node.body); - STYLES_ATTRIBUTE.add(name); - BUILDIN_STYLE_NAMES.add(name); - decoratorParamSet.add(STYLES); + if (ts.isBlock(node.body) && node.body.statements && node.body.statements.length) { + INNER_STYLE_FUNCTION.set(name, node.body); + STYLES_ATTRIBUTE.add(name); + BUILDIN_STYLE_NAMES.add(name); + decoratorParamSet.add(STYLES); + } } else { log.push({ type: LogType.ERROR, diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index b76cb6d..2ad9fc9 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -349,9 +349,11 @@ function visitAllNode(node: ts.Node, sourceFileNode: ts.SourceFile, allComponent const componentName: string = isExtendFunction(node); collectExtend(EXTEND_ATTRIBUTE, componentName, node.name.getText()); } else if (ts.isFunctionDeclaration(node) && hasDecorator(node, COMPONENT_STYLES_DECORATOR)) { - GLOBAL_STYLE_FUNCTION.set(node.name.getText(), node.body); - STYLES_ATTRIBUTE.add(node.name.getText()); - BUILDIN_STYLE_NAMES.add(node.name.getText()); + if (ts.isBlock(node.body) && node.body.statements && node.body.statements.length) { + GLOBAL_STYLE_FUNCTION.set(node.name.getText(), node.body); + STYLES_ATTRIBUTE.add(node.name.getText()); + BUILDIN_STYLE_NAMES.add(node.name.getText()); + } } node.getChildren().forEach((item: ts.Node) => visitAllNode(item, sourceFileNode, allComponentNames, log)); } -- Gitee From f857c0b7924b4318cd414549b312155bcc63adc1 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 9 Nov 2022 20:25:28 +0800 Subject: [PATCH 116/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Builder内@Styles属后wu无法添加其它属性 Signed-off-by: houhaoyu Change-Id: Id2cccb45cddfc3c02702400cd8a8de0c4e87b7c8 --- compiler/package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/package-lock.json b/compiler/package-lock.json index 1f1bccb..a2fe414 100644 --- a/compiler/package-lock.json +++ b/compiler/package-lock.json @@ -4161,7 +4161,7 @@ }, "typescript": { "version": "file:deps/ohos-typescript-4.2.3-r2.tgz", - "integrity": "sha512-SC1JQo/4ePCET0IswzbLoHIdaVc/fWHaoRbKu68ikdaZ0PZLDpqaawrfs4JivrT+yu4ch/0ksjIhiBKwplzFsg==" + "integrity": "sha512-D6ax1YhPEqZq9fuvp+5au9t6h+0iRD09CWqU4WGJ3qnQw22TnhafH8jdjCZ2VRSxXr+NH7503c4KA58QKerbzA==" }, "uglify-js": { "version": "3.16.1", -- Gitee From f4d67d18e0f84cf832d0edc59a94ee53333bc7e2 Mon Sep 17 00:00:00 2001 From: bojiang Date: Thu, 10 Nov 2022 14:29:36 +0800 Subject: [PATCH 117/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I3def7f8c06826ec2d20d8f5ffb67376c281b4b26 --- compiler/src/validate_ui_syntax.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 2ad9fc9..714d3ff 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -275,7 +275,7 @@ function checkDecorators(decorators: ts.NodeArray, result: Decorat componentCollection.customComponents.add(componentName); switch (name) { case COMPONENT_DECORATOR_ENTRY: - checkEntryComponent(node, log); + checkEntryComponent(node, log, sourceFile); result.entryCount++; componentCollection.entryComponent = componentName; componentCollection.entryComponentPos = node.getStart(); @@ -1085,16 +1085,13 @@ export function resetComponentCollection() { componentCollection.previewComponent = new Set([]); } -function checkEntryComponent(node: ts.StructDeclaration, log: LogInfo[]): void { +function checkEntryComponent(node: ts.StructDeclaration, log: LogInfo[], sourceFile: ts.SourceFile): void { if (node.modifiers) { for (let i = 0; i < node.modifiers.length; i++) { if (node.modifiers[i].kind === ts.SyntaxKind.ExportKeyword) { - log.push({ - type: LogType.WARN, - message: `It's not a recommended way to export struct with @Entry decorator, ` + - `which may cause ACE Engine error in component preview mode.`, - pos: node.getStart() - }); + const message: string = `It's not a recommended way to export struct with @Entry decorator, ` + + `which may cause ACE Engine error in component preview mode.`; + addLog(LogType.WARN, message, node.getStart(), log, sourceFile); break; } } -- Gitee From 5845055ad66d99e32e8ed9c282b12be3e93e4dcb Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sat, 12 Nov 2022 19:41:49 +0800 Subject: [PATCH 118/379] houhaoyu@huawei.com fix error collect not complete Signed-off-by: houhaoyu Change-Id: I45030678c0c551b91aecf9d4c49439b82c415f20 --- compiler/server/build_pipe_server.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index 2b4438e..8d1fff6 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -53,7 +53,7 @@ let start = false; let checkStatus = false; let compileStatus = false; let receivedMsg_; -let errorInfo; +let errorInfo = []; let compileWithCheck; let globalVariable = []; let propertyVariable = []; @@ -64,9 +64,7 @@ function init(port) { previewCacheFilePath = path.join(projectConfig.cachePath || projectConfig.buildPath, 'preview.ets'); const rootFileNames = []; - if (!fs.existsSync(previewCacheFilePath)) { - writeFileSync(previewCacheFilePath, ''); - } + writeFileSync(previewCacheFilePath, ''); rootFileNames.push(previewCacheFilePath); ts.createWatchProgram( createWatchCompilerHost(rootFileNames, resolveDiagnostic, delayPrintLogCount, true)); @@ -209,7 +207,6 @@ function es2abc(receivedMsg) { } function resolveDiagnostic(diagnostic) { - errorInfo = []; const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); if (validateError(message)) { if (diagnostic.file) { @@ -234,7 +231,7 @@ function responseToPlugin() { if ((compileWithCheck !== "true" && compileStatus == true) || (compileWithCheck === "true" && compileStatus == true && checkStatus == true) ) { if (receivedMsg_) { - if (errorInfo) { + if (errorInfo && errorInfo.length) { receivedMsg_.data.log = receivedMsg_.data.log || []; receivedMsg_.data.log.push(...errorInfo); } @@ -242,7 +239,7 @@ function responseToPlugin() { start = false; checkStatus = false; compileStatus = false; - errorInfo = undefined; + errorInfo = []; receivedMsg_ = undefined; messages.shift(); if (messages.length > 0) { -- Gitee From 691d962f64c682306888c2594464dbea9ef4294f Mon Sep 17 00:00:00 2001 From: yfwang6 Date: Mon, 14 Nov 2022 15:36:30 +0800 Subject: [PATCH 119/379] wangyongfei6@huawei.com add builder decorator global function Signed-off-by: yfwang6 Change-Id: I041763799e069c07b9e9ca4909dee22ad3d7fc29 --- .../@builderParam/@builderParam.ts | 23 ++++++++-- .../@builderParam/@builderParam.ts | 42 ++++++++++++++++++- 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts b/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts index 0f28ad6..9ba90ed 100644 --- a/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts +++ b/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts @@ -43,6 +43,13 @@ struct CustomContainer2 { } } +@Builder function specificWithParam(label1: string, label2: string) { + Column() { + Text(label1).fontSize(50) + Text(label2).fontSize(50) + } +} + @Entry @Component struct CustomContainerUser { @@ -65,7 +72,7 @@ struct CustomContainerUser { header: this.text, }){ Column(){ - specificParam("111", "22") + specificWithParam("111", "22") }.onClick(()=>{ this.text = "changeHeader" }) @@ -155,6 +162,16 @@ class CustomContainer2 extends View { Column.pop(); } } +function specificWithParam(label1, label2, parent = undefined) { + Column.create(); + Text.create(label1); + Text.fontSize(50); + Text.pop(); + Text.create(label2); + Text.fontSize(50); + Text.pop(); + Column.pop(); +} class CustomContainerUser extends View { constructor(compilerAssignedUniqueChildId, parent, params) { super(compilerAssignedUniqueChildId, parent); @@ -204,7 +221,7 @@ class CustomContainerUser extends View { Column.onClick(() => { this.text = "changeHeader"; }); - specificParam("111", "22", this); + specificWithParam("111", "22", this); Column.pop(); } })); @@ -217,7 +234,7 @@ class CustomContainerUser extends View { Column.onClick(() => { this.text = "changeHeader"; }); - specificParam("111", "22", this); + specificWithParam("111", "22", this); Column.pop(); } }); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts b/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts index 0439dfa..b2f6bd9 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts @@ -43,6 +43,13 @@ struct CustomContainer2 { } } +@Builder function specificWithParam(label1: string, label2: string) { + Column() { + Text(label1).fontSize(50) + Text(label2).fontSize(50) + } +} + @Entry @Component struct CustomContainerUser { @@ -65,7 +72,7 @@ struct CustomContainerUser { header: this.text, }){ Column(){ - specificParam("111", "22") + specificWithParam("111", "22") }.onClick(()=>{ this.text = "changeHeader" }) @@ -201,6 +208,37 @@ class CustomContainer2 extends ViewPU { this.updateDirtyElements(); } } +function specificWithParam(label1, label2, parent = undefined) { + (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(label1); + Text.fontSize(50); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(label2); + Text.fontSize(50); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Column.pop(); +} class CustomContainerUser extends ViewPU { constructor(parent, params, __localStorage) { super(parent, __localStorage); @@ -304,7 +342,7 @@ class CustomContainerUser extends ViewPU { } ViewStackProcessor.StopGetAccessRecording(); }); - specificParam("111", "22", this); + specificWithParam("111", "22", this); Column.pop(); } })); -- Gitee From c81e573cb57a7571718fd6393c9d48586da18341 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 14 Nov 2022 21:24:16 +0800 Subject: [PATCH 120/379] houhaoyu@huawei.com fix Extend return type Signed-off-by: houhaoyu Change-Id: I6b0f804f3eb0d397cef2e60ba845a4d23f5c972a --- compiler/src/process_ui_syntax.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index caf3ba1..11d7b0d 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -518,7 +518,7 @@ function processExtend(node: ts.FunctionDeclaration, log: LogInfo[]): ts.Functio } return ts.factory.updateFunctionDeclaration(node, undefined, node.modifiers, node.asteriskToken, ts.factory.createIdentifier(extendFunctionName), node.typeParameters, - node.parameters, node.type, isOriginalExtend(node.body) ? + node.parameters, ts.factory.createToken(ts.SyntaxKind.VoidKeyword), isOriginalExtend(node.body) ? ts.factory.updateBlock(node.body, statementArray) : bodynode); } function traverseExtendExpression(node: ts.Node): ts.Node { -- Gitee From e7f56ad1524130a9fdf1616c1a763ede09360402 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Tue, 15 Nov 2022 01:45:13 +0000 Subject: [PATCH 121/379] Fix exit code fail Signed-off-by: zhangrengao Change-Id: I168b106e34d3f8b5eba3981459f255a2c067203a --- compiler/src/gen_abc_plugin.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 18204c3..6af9351 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -443,10 +443,10 @@ function handleFullModuleFiles(modules, callback): any { if (module !== undefined && module.resourceResolveData !== undefined) { const filePath: string = module.resourceResolveData.path; let tempFilePath = genTemporaryPath(filePath, projectConfig.projectPath, process.env.cachePath); - validateFilePathLength(tempFilePath); if (tempFilePath.length === 0) { return; } + validateFilePathLength(tempFilePath); let buildFilePath: string = genBuildPath(filePath, projectConfig.projectPath, projectConfig.buildPath); validateFilePathLength(buildFilePath); tempFilePath = toUnixPath(tempFilePath); @@ -842,6 +842,9 @@ function invokeWorkersToGenAbc(): void { cluster.removeAllListeners("exit"); } cluster.on('exit', (worker, code, signal) => { + if (code === FAIL) { + process.exitCode = FAIL; + } count_++; if (count_ === workerNumber) { // for preview of with incre compile @@ -1126,10 +1129,10 @@ function handleHotReloadChangedFiles() { let filePath: string = path.join(projectConfig.projectPath, file); validateFilePathLength(filePath); let tempFilePath: string = genTemporaryPath(filePath, projectConfig.projectPath, process.env.cachePath); - validateFilePathLength(tempFilePath); if (tempFilePath.length === 0) { return; } + validateFilePathLength(tempFilePath); let buildFilePath: string = ""; tempFilePath = toUnixPath(tempFilePath); -- Gitee From 3e34586eefe921ea0a00f91b4e5bfdd88c93369a Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Sat, 29 Oct 2022 07:53:57 +0000 Subject: [PATCH 122/379] Opt multi file of ark compiler Signed-off-by: zhangrengao Change-Id: Ief6edbe35d9b5ddb81decb8504f7c05c0a68bc93 --- compiler/src/gen_abc_plugin.ts | 12 ++++++---- compiler/src/gen_module_abc.ts | 39 +++++++++++++++++++-------------- compiler/src/process_js_file.ts | 4 ++-- compiler/src/utils.ts | 7 +++--- 4 files changed, 36 insertions(+), 26 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 18204c3..b43945d 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -117,6 +117,7 @@ export class ModuleInfo { abcFilePath: string; isCommonJs: boolean; recordName: string; + sourceFile: string; constructor(filePath: string, tempFilePath: string, buildFilePath: string, abcFilePath: string, isCommonJs: boolean) { this.filePath = filePath; @@ -125,6 +126,7 @@ export class ModuleInfo { this.abcFilePath = abcFilePath; this.isCommonJs = isCommonJs; this.recordName = getOhmUrlByFilepath(filePath); + this.sourceFile = filePath.replace(projectConfig.projectRootPath + path.sep, ''); } } @@ -495,8 +497,8 @@ function processEntryToGenAbc(entryInfos: Map): void { validateFilePathLength(npmEntriesInfoPath); let npmEntriesProtoFileName: string = "npm_entries" + EXTNAME_PROTO_BIN; const npmEntriesProtoFilePath: string = path.join(process.env.cachePath, "protos", "npm_entries", npmEntriesProtoFileName); - validateFilePathLength(npmEntriesInfoPath); - mkdirsSync(npmEntriesProtoFilePath); + validateFilePathLength(npmEntriesProtoFilePath); + mkdirsSync(path.dirname(npmEntriesProtoFilePath)); let js2Abc: string = path.join(arkDir, 'build', 'bin', 'js2abc'); if (isWin) { js2Abc = path.join(arkDir, 'build-win', 'bin', 'js2abc.exe'); @@ -738,7 +740,6 @@ function invokeClusterByModule(abcArgs:string[], moduleInfos: Array, const tempAbcArgs: string[] = abcArgs.slice(0); if (process.env.panda === TS2ABC) { workerNumber = 3; - isModule ? tempAbcArgs.push('-m') : tempAbcArgs.push('-c'); cmdPrefix = `${nodeJs} ${tempAbcArgs.join(' ')}`; } else if (process.env.panda === ES2ABC || process.env.panda === 'undefined' || process.env.panda === undefined) { workerNumber = os.cpus().length; @@ -750,9 +751,12 @@ function invokeClusterByModule(abcArgs:string[], moduleInfos: Array, const splitedModules: any[] = splitModulesByNumber(moduleInfos, workerNumber); workerNumber = splitedModules.length; for (let i = 0; i < workerNumber; i++) { + let sn: number = i + 1; + let workerFileName: string = `filesInfo_${sn}.txt`; const workerData: any = { 'inputs': JSON.stringify(splitedModules[i]), - 'cmd': cmdPrefix + 'cmd': cmdPrefix, + 'workerFileName': workerFileName }; cluster.fork(workerData); } diff --git a/compiler/src/gen_module_abc.ts b/compiler/src/gen_module_abc.ts index f683714..4e671e9 100644 --- a/compiler/src/gen_module_abc.ts +++ b/compiler/src/gen_module_abc.ts @@ -15,6 +15,8 @@ import * as childProcess from 'child_process'; import * as process from 'process'; +import * as fs from 'fs'; +import * as path from 'path'; import cluster from 'cluster'; import { logger } from './compile_info'; import { @@ -24,30 +26,34 @@ import { ES2ABC } from './pre_define'; import { - genProtoFileName, toUnixPath } from './utils'; -import { projectConfig } from '../main'; const red: string = '\u001b[31m'; const reset: string = '\u001b[39m'; -function js2abcByWorkers(jsonInput: string, cmd: string): Promise { +function js2abcByWorkers(jsonInput: string, cmd: string, workerFileName: string): Promise { const inputPaths: any = JSON.parse(jsonInput); + // cmd `${cmd} --input-file xx --output-proto --merge-abc` + let filePath: string = path.join(process.env.cachePath, workerFileName); + let content: string = ""; for (let i = 0; i < inputPaths.length; ++i) { - const input: string = inputPaths[i].tempFilePath; - const ohmURL: string = inputPaths[i].recordName; - const protoFileName: string = genProtoFileName(input); - const sourceFile: string = toUnixPath(inputPaths[i].filePath.replace(projectConfig.projectRootPath, '')); - const singleCmd: any = `${cmd} "${input}" --record-name "${ohmURL}" --source-file "${sourceFile}" --output-proto --merge-abc`; - logger.debug('gen abc cmd is: ', singleCmd); - try { - childProcess.execSync(singleCmd); - } catch (e) { - logger.debug(red, `ArkTS:ERROR Failed to convert file ${input} to proto `, reset); - process.exit(FAIL); + let info: any = inputPaths[i]; + const moduleType: string = info.isCommonJs ? 'commonjs' : 'esm'; + content += `${info.tempFilePath};${info.recordName};${moduleType};${toUnixPath(info.sourceFile)}`; + if (i < inputPaths.length - 1) { + content += "\n" } } + fs.writeFileSync(filePath, content, "utf-8"); + const singleCmd: any = `${cmd} --input-file "${filePath}" --output-proto --merge-abc`; + logger.debug('gen abc cmd is: ', singleCmd); + try { + childProcess.execSync(singleCmd); + } catch (e) { + logger.debug(red, `ArkTS:ERROR Failed to convert file to proto `, reset); + process.exit(FAIL); + } return; } @@ -73,11 +79,12 @@ function es2abcByWorkers(jsonInput: string, cmd: string): Promise { logger.debug('worker data is: ', JSON.stringify(process.env)); logger.debug('gen_abc isWorker is: ', cluster.isWorker); -if (cluster.isWorker && process.env['inputs'] !== undefined && process.env['cmd'] !== undefined) { +if (cluster.isWorker && process.env['inputs'] !== undefined && process.env['cmd'] !== undefined + && process.env['workerFileName'] !== undefined) { logger.debug('==>worker #', cluster.worker.id, 'started!'); if (process.env.panda === TS2ABC) { - js2abcByWorkers(process.env['inputs'], process.env['cmd']); + js2abcByWorkers(process.env['inputs'], process.env['cmd'], process.env['workerFileName']); } else if (process.env.panda === ES2ABC || process.env.panda === 'undefined' || process.env.panda === undefined) { es2abcByWorkers(process.env['inputs'], process.env['cmd']); } else { diff --git a/compiler/src/process_js_file.ts b/compiler/src/process_js_file.ts index 982bfd2..8aff181 100644 --- a/compiler/src/process_js_file.ts +++ b/compiler/src/process_js_file.ts @@ -6,8 +6,8 @@ import { } from './pre_define'; module.exports = function processjs2file(source: string): string { - if (projectConfig.compileMode === ESMODULE && projectConfig.processTs === false - && process.env.compilerType && process.env.compilerType === ARK) { + if (projectConfig.compileMode === ESMODULE && process.env.compilerType + && process.env.compilerType === ARK) { writeFileSyncByString(this.resourcePath, source); } return source; diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index b93f418..290c9b0 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -587,12 +587,11 @@ function genContentAndSourceMapInfo(node: ts.SourceFile, toTsFile: boolean): any printer['writeFile'](node, writer, sourceMapGenerator); const sourceMapJson: any = sourceMapGenerator.toJSON(); sourceMapJson['sources'] = [fileName.replace(toUnixPath(projectConfig.projectRootPath) + '/', '')]; - const result: string = writer.getText(); - let content: string = result; - content = processSystemApi(content, true); + let content: string = writer.getText(); if (toTsFile) { - content = result.replace(`${TS_NOCHECK};`, TS_NOCHECK); + content = content.replace(`${TS_NOCHECK};`, TS_NOCHECK); } + content = processSystemApi(content, true); return { content: content, -- Gitee From 69fbd997c65f6dc654c56a888a6f6667a397308e Mon Sep 17 00:00:00 2001 From: hufeng Date: Wed, 16 Nov 2022 01:31:14 +0000 Subject: [PATCH 123/379] remove imported types when compiling modules Signed-off-by: hufeng Change-Id: Iae9219728335579cc1c536fe691809900722d76f --- compiler/tsconfig.esm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/tsconfig.esm.json b/compiler/tsconfig.esm.json index 8084a35..04c2dd3 100644 --- a/compiler/tsconfig.esm.json +++ b/compiler/tsconfig.esm.json @@ -609,7 +609,7 @@ "allowJs": true, "allowSyntheticDefaultImports": true, "esModuleInterop": true, - "importsNotUsedAsValues": "preserve", + "importsNotUsedAsValues": "remove", "noImplicitAny": false, "noUnusedLocals": false, "noUnusedParameters": false, -- Gitee From fba05d31d4e4db1edfb0493f733eb3361068683a Mon Sep 17 00:00:00 2001 From: lihong Date: Mon, 14 Nov 2022 11:51:12 +0800 Subject: [PATCH 124/379] lihong67@huawei.com add updateStateVars for objectLink. Signed-off-by: lihong Change-Id: I6d1202a2aac66e29c8f2c7ecf783ca1de77d77d4 --- compiler/src/pre_define.ts | 2 + compiler/src/process_component_class.ts | 19 ++- compiler/src/process_component_constructor.ts | 30 +++-- compiler/src/process_component_member.ts | 28 ++++- compiler/src/process_custom_component.ts | 113 +++++++++++------- 5 files changed, 131 insertions(+), 61 deletions(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 163560a..54c76db 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -291,6 +291,7 @@ export const GENERATE_ID = 'generateId'; export const _GENERATE_ID = '__generate__Id'; export const COMPONENT_CONSTRUCTOR_INITIAL_PARAMS: string = 'setInitiallyProvidedValue'; +export const COMPONENT_UPDATE_STATE_VARS: string = 'updateStateVars'; export const COMPONENT_RERENDER_FUNCTION: string = 'rerender'; export const COMPONENT_CONSTRUCTOR_PURGE_VARIABLE_DEP: string = 'purgeVariableDependenciesOnElmtId'; export const MARKDEPENDENTELEMENTSDIRTY: string = 'markDependentElementsDirty'; @@ -307,6 +308,7 @@ export const ISINITIALRENDER: string = 'isInitialRender'; export const ELMTID: string = 'elmtId'; export const STARTGETACCESSRECORDINGFOR: string = 'StartGetAccessRecordingFor'; export const STOPGETACCESSRECORDING: string = 'StopGetAccessRecording'; +export const UPDATE_STATE_VARS_OF_CHIND_BY_ELMTID: string = 'updateStateVarsOfChildByElmtId'; export const VIEWSTACKPROCESSOR: string = 'ViewStackProcessor'; export const OBSERVECOMPONENTCREATION: string = 'observeComponentCreation'; export const ISLAZYCREATE: string = 'isLazyCreate'; diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index 7a3c878..c0835a7 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -75,7 +75,8 @@ import { SYNCHED_PROPERTY_NESED_OBJECT_PU, OBSERVED_PROPERTY_ABSTRACT_PU, CREATE_LOCAL_STORAGE_LINK, - CREATE_LOCAL_STORAGE_PROP + CREATE_LOCAL_STORAGE_PROP, + COMPONENT_UPDATE_STATE_VARS } from './pre_define'; import { BUILDIN_STYLE_NAMES, @@ -149,6 +150,7 @@ function processMembers(members: ts.NodeArray, parentComponentN const newMembers: ts.ClassElement[] = []; const watchMap: Map = new Map(); const updateParamsStatements: ts.Statement[] = []; + const stateVarsStatements: ts.Statement[] = []; const purgeVariableDepStatements: ts.Statement[] = []; const rerenderStatements: ts.Statement[] = []; const deleteParamsStatements: ts.PropertyDeclaration[] = []; @@ -183,6 +185,9 @@ function processMembers(members: ts.NodeArray, parentComponentN if (result.getUpdateParams()) { updateParamsStatements.push(result.getUpdateParams()); } + if (result.getStateVarsParams()) { + stateVarsStatements.push(result.getStateVarsParams()); + } if (result.isDeleteParams()) { deleteParamsStatements.push(item); } @@ -205,7 +210,7 @@ function processMembers(members: ts.NodeArray, parentComponentN validateHasController(parentComponentName, checkController, log); newMembers.unshift(addDeleteParamsFunc(deleteParamsStatements)); addIntoNewMembers(newMembers, parentComponentName, updateParamsStatements, - purgeVariableDepStatements, rerenderStatements); + purgeVariableDepStatements, rerenderStatements, stateVarsStatements); newMembers.unshift(addConstructor(ctorNode, watchMap, parentComponentName)); return newMembers; } @@ -241,13 +246,15 @@ function addIntoNewMembers( parentComponentName: ts.Identifier, updateParamsStatements: ts.Statement[], purgeVariableDepStatements: ts.Statement[], - rerenderStatements: ts.Statement[] + rerenderStatements: ts.Statement[], + stateVarsStatements: ts.Statement[] ): void { if (partialUpdateConfig.partialUpdateMode) { newMembers.unshift( addInitialParamsFunc(updateParamsStatements, parentComponentName), + addUpdateStateVarsFunc(stateVarsStatements, parentComponentName), addPurgeVariableDepFunc(purgeVariableDepStatements) - ); + ); newMembers.push(addRerenderFunc(rerenderStatements)); } else { newMembers.unshift(addUpdateParamsFunc(updateParamsStatements, parentComponentName)); @@ -590,6 +597,10 @@ function addInitialParamsFunc(statements: ts.Statement[], parentComponentName: t return createParamsInitBlock(COMPONENT_CONSTRUCTOR_INITIAL_PARAMS, statements, parentComponentName); } +function addUpdateStateVarsFunc(statements: ts.Statement[], parentComponentName: ts.Identifier): ts.MethodDeclaration { + return createParamsInitBlock(COMPONENT_UPDATE_STATE_VARS, statements, parentComponentName); +} + function addPurgeVariableDepFunc(statements: ts.Statement[]): ts.MethodDeclaration { return ts.factory.createMethodDeclaration( undefined, undefined, undefined, diff --git a/compiler/src/process_component_constructor.ts b/compiler/src/process_component_constructor.ts index 27bcb78..7db8179 100644 --- a/compiler/src/process_component_constructor.ts +++ b/compiler/src/process_component_constructor.ts @@ -27,7 +27,8 @@ import { COMPONENT_CONSTRUCTOR_LOCALSTORAGE, BASE_COMPONENT_NAME_PU, COMPONENT_CONSTRUCTOR_LOCALSTORAGE_PU, - COMPONENT_CONSTRUCTOR_LOCALSTORAGE_TYPE_PU + COMPONENT_CONSTRUCTOR_LOCALSTORAGE_TYPE_PU, + ELMTID } from './pre_define'; import { @@ -97,7 +98,8 @@ function initConstructorParams(node: ts.ConstructorDeclaration, parentComponentN ]) : new Set([ COMPONENT_CONSTRUCTOR_PARENT, COMPONENT_CONSTRUCTOR_PARAMS, - COMPONENT_CONSTRUCTOR_LOCALSTORAGE_PU + COMPONENT_CONSTRUCTOR_LOCALSTORAGE_PU, + ELMTID ]); const newParameters: ts.ParameterDeclaration[] = Array.from(node.parameters); if (newParameters.length !== 0) { @@ -105,9 +107,10 @@ function initConstructorParams(node: ts.ConstructorDeclaration, parentComponentN newParameters.splice(0, newParameters.length); } paramNames.forEach((paramName: string) => { - // @ts-ignore newParameters.push(ts.factory.createParameterDeclaration(undefined, undefined, undefined, - ts.factory.createIdentifier(paramName), undefined, undefined, undefined)); + ts.factory.createIdentifier(paramName), undefined, undefined, + paramName === ELMTID ? ts.factory.createPrefixUnaryExpression( + ts.SyntaxKind.MinusToken, ts.factory.createNumericLiteral('1')) : undefined)); }); return ts.factory.updateConstructorDeclaration(node, undefined, node.modifiers, newParameters, @@ -179,20 +182,21 @@ export function addConstructor(ctorNode: any, watchMap: Map, [...watchStatements, updateWithValueParamsStatement], false, true, parentComponentName); } -function createCallSuperStatement(localStorageNum: number): ts.Statement{ +function createCallSuperStatement(localStorageNum: number): ts.Statement { if (!partialUpdateConfig.partialUpdateMode) { return ts.factory.createExpressionStatement(ts.factory.createCallExpression( - ts.factory.createSuper(), undefined, - localStorageNum ? [ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_ID), - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_LOCALSTORAGE)] : - [ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_ID), - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT)])); + ts.factory.createSuper(), undefined, + localStorageNum ? [ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_ID), + ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), + ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_LOCALSTORAGE)] : + [ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_ID), + ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT)])); } else { - return (ts.factory.createExpressionStatement( + return ts.factory.createExpressionStatement( ts.factory.createCallExpression(ts.factory.createSuper(), undefined, [ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_LOCALSTORAGE_PU)]))); + ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_LOCALSTORAGE_PU), + ts.factory.createIdentifier(ELMTID)])); } } diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index b6e314e..163bf8c 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -69,7 +69,8 @@ import { COMPONENT_CUSTOM_DECORATOR, THIS, CREATE_STORAGE_LINK, - CREATE_STORAGE_PROP + CREATE_STORAGE_PROP, + ELMTID } from './pre_define'; import { forbiddenUseStateType, @@ -128,6 +129,8 @@ export const setUpdateParamsDecorators: Set = COMPONENT_BUILDERPARAM_DECORATOR ]); +export const setStateVarsDecorators: Set = new Set([COMPONENT_OBJECT_LINK_DECORATOR]); + export const immutableDecorators: Set = new Set([COMPONENT_STORAGE_PROP_DECORATOR, COMPONENT_OBJECT_LINK_DECORATOR, COMPONENT_BUILDERPARAM_DECORATOR]); @@ -150,6 +153,7 @@ export class UpdateResult { private controllerSet: ts.MethodDeclaration; private purgeVariableDepStatement: ts.Statement; private decoratorName: string; + private stateVarsParams: ts.Statement; public setProperity(updateItem: ts.PropertyDeclaration) { this.itemUpdate = true; @@ -181,6 +185,10 @@ export class UpdateResult { this.updateParams = updateParams; } + public setStateVarsParams(stateVarsParams: ts.Statement) { + this.stateVarsParams = stateVarsParams; + } + public setDeleteParams(deleteParams: boolean) { this.deleteParams = deleteParams; } @@ -213,6 +221,10 @@ export class UpdateResult { return this.updateParams; } + public getStateVarsParams(): ts.Statement { + return this.stateVarsParams; + } + public getPurgeVariableDepStatement(): ts.Statement { return this.purgeVariableDepStatement; } @@ -359,6 +371,9 @@ function processStateDecorators(node: ts.PropertyDeclaration, decorator: string, if (setUpdateParamsDecorators.has(decorator)) { updateResult.setUpdateParams(createUpdateParams(name, decorator)); } + if (setStateVarsDecorators.has(decorator)) { + updateResult.setStateVarsParams(createStateVarsParams(name, decorator)); + } if (partialUpdateConfig.partialUpdateMode && BASICDECORATORS.has(decorator)) { const variableWithUnderLink: string = '__' + name.escapedText.toString(); updateResult.setDecoratorName(decorator); @@ -504,6 +519,16 @@ function createUpdateParams(name: ts.Identifier, decorator: string): ts.Statemen return updateParamsNode; } +function createStateVarsParams(name: ts.Identifier, decorator: string): ts.Statement { + let updateParamsNode: ts.Statement; + switch (decorator) { + case COMPONENT_OBJECT_LINK_DECORATOR: + updateParamsNode = createUpdateParamsWithSet(name); + break; + } + return updateParamsNode; +} + function createUpdateParamsWithIf(name: ts.Identifier): ts.IfStatement { return ts.factory.createIfStatement(ts.factory.createBinaryExpression( ts.factory.createPropertyAccessExpression( @@ -697,6 +722,7 @@ function addCustomComponentId(node: ts.NewExpression, componentName: string, isBuilder ? parentConditionalExpression() : ts.factory.createThis()); } else { argumentsArray.unshift(isGlobalBuilder ? parentConditionalExpression() : ts.factory.createThis()); + argumentsArray.push(ts.factory.createIdentifier(ELMTID)); } node = ts.factory.updateNewExpression(node, node.expression, node.typeArguments, argumentsArray); diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 5931688..cb1a083 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -41,7 +41,10 @@ import { STOPGETACCESSRECORDING, ALLOCATENEWELMETIDFORNEXTCOMPONENT, STATE_OBJECTLINK_DECORATORS, - BASE_COMPONENT_NAME_PU + BASE_COMPONENT_NAME_PU, + OBSERVECOMPONENTCREATION, + ISINITIALRENDER, + UPDATE_STATE_VARS_OF_CHIND_BY_ELMTID } from './pre_define'; import { propertyCollection, @@ -172,53 +175,77 @@ function addCustomComponentStatements(node: ts.ExpressionStatement, newStatement ts.factory.updateExpressionStatement(node, createViewCreate(newNode)), ts.factory.createObjectLiteralExpression(props, true), name)); } else { - newStatements.push(createCustomComponent(newNode)); + newStatements.push(createCustomComponent(node, newNode)); } } -function createCustomComponent(newNode: ts.NewExpression): ts.Block { +function createCustomComponent(node: ts.ExpressionStatement, newNode: ts.NewExpression): ts.Block { + let componentParameter: ts.ObjectLiteralExpression; + if (node.expression && node.expression.arguments && node.expression.arguments.length) { + componentParameter = node.expression.arguments[0]; + } else { + componentParameter = ts.factory.createObjectLiteralExpression([], false); + } return ts.factory.createBlock( [ - ts.factory.createVariableStatement(undefined, - ts.factory.createVariableDeclarationList( - [ts.factory.createVariableDeclaration( - ts.factory.createIdentifier(ELMTID), undefined, undefined, - ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression( - ts.factory.createIdentifier(VIEWSTACKPROCESSOR), - ts.factory.createIdentifier(ALLOCATENEWELMETIDFORNEXTCOMPONENT) - ), undefined, []))], - ts.NodeFlags.Const - ) - ), - ts.factory.createExpressionStatement( - ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression( - ts.factory.createIdentifier(VIEWSTACKPROCESSOR), - ts.factory.createIdentifier(STARTGETACCESSRECORDINGFOR) - ), undefined, - [ts.factory.createIdentifier(ELMTID)] - ) - ), - ts.factory.createExpressionStatement( - ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression( - ts.factory.createIdentifier(BASE_COMPONENT_NAME_PU), - ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION) - ), undefined, - [newNode] - ) - ), - ts.factory.createExpressionStatement( - ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression( - ts.factory.createIdentifier(VIEWSTACKPROCESSOR), - ts.factory.createIdentifier(STOPGETACCESSRECORDING) - ), undefined, [] - ) - ) - ], - true + ts.factory.createExpressionStatement(ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + ts.factory.createThis(), + ts.factory.createIdentifier(OBSERVECOMPONENTCREATION) + ), undefined, + [ts.factory.createArrowFunction(undefined, undefined, + [ + ts.factory.createParameterDeclaration(undefined, undefined, undefined, + ts.factory.createIdentifier(ELMTID) + ), + ts.factory.createParameterDeclaration(undefined, undefined, undefined, + ts.factory.createIdentifier(ISINITIALRENDER) + ) + ], undefined, + ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), + ts.factory.createBlock( + [ + ts.factory.createExpressionStatement( + ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + ts.factory.createIdentifier(VIEWSTACKPROCESSOR), + ts.factory.createIdentifier(STARTGETACCESSRECORDINGFOR) + ), undefined, + [ts.factory.createIdentifier(ELMTID)] + )), + createIfCustomComponent(newNode, componentParameter), + ts.factory.createExpressionStatement(ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + ts.factory.createIdentifier(VIEWSTACKPROCESSOR), + ts.factory.createIdentifier(STOPGETACCESSRECORDING) + ), + undefined, + [] + )) + ], true))])) + ], true); +} + +function createIfCustomComponent(newNode: ts.NewExpression, + componentParameter: ts.ObjectLiteralExpression): ts.IfStatement { + return ts.factory.createIfStatement( + ts.factory.createIdentifier(ISINITIALRENDER), + ts.factory.createBlock( + [ + ts.factory.createExpressionStatement( + ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + ts.factory.createIdentifier(BASE_COMPONENT_NAME_PU), + ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION) + ), undefined, [newNode])) + ], true), + ts.factory.createBlock( + [ts.factory.createExpressionStatement(ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + ts.factory.createThis(), + ts.factory.createIdentifier(UPDATE_STATE_VARS_OF_CHIND_BY_ELMTID) + ), undefined, + [ts.factory.createIdentifier(ELMTID), componentParameter]))], true) ); } -- Gitee From 109a6a7eeb033a3a612debed9dad0601afc42a01 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Thu, 17 Nov 2022 17:03:51 +0800 Subject: [PATCH 125/379] houhaoyu@huawei.com fix custom component in @Builder Signed-off-by: houhaoyu Change-Id: Iadd4d773ccfcd0545aac55b503c476df0956ce48 --- compiler/src/process_custom_component.ts | 27 ++++++++++++------------ 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index cb1a083..d08615d 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -126,7 +126,7 @@ export function processCustomComponent(node: ts.ExpressionStatement, newStatemen bindComponentAttr(node, ts.factory.createIdentifier(COMPONENT_COMMON), newStatements, log); } addCustomComponent(node, newStatements, customComponentNewExpression, log, name, componentNode, - isBuilder); + isBuilder, isGlobalBuilder); if (hasChainCall) { newStatements.push(ts.factory.createExpressionStatement( createFunction(ts.factory.createIdentifier(COMPONENT_COMMON), @@ -158,28 +158,29 @@ function changeNodeFromCallToArrow(node: ts.CallExpression): ts.ArrowFunction { function addCustomComponent(node: ts.ExpressionStatement, newStatements: ts.Statement[], newNode: ts.NewExpression, log: LogInfo[], name: string, componentNode: ts.CallExpression, - isBuilder: boolean = false): void { + isBuilder: boolean = false, isGlobalBuilder: boolean = false): void { if (ts.isNewExpression(newNode)) { const propertyArray: ts.ObjectLiteralElementLike[] = []; validateCustomComponentPrams(componentNode, name, propertyArray, log); - addCustomComponentStatements(node, newStatements, newNode, name, propertyArray, isBuilder); + addCustomComponentStatements(node, newStatements, newNode, name, propertyArray, isBuilder, isGlobalBuilder); } } function addCustomComponentStatements(node: ts.ExpressionStatement, newStatements: ts.Statement[], newNode: ts.NewExpression, name: string, props: ts.ObjectLiteralElementLike[], - isBuilder: boolean = false): void { + isBuilder: boolean = false, isGlobalBuilder: boolean = false): void { if (!partialUpdateConfig.partialUpdateMode) { const id: string = componentInfo.id.toString(); newStatements.push(createFindChildById(id, name, isBuilder), createCustomComponentIfStatement(id, ts.factory.updateExpressionStatement(node, createViewCreate(newNode)), ts.factory.createObjectLiteralExpression(props, true), name)); } else { - newStatements.push(createCustomComponent(node, newNode)); + newStatements.push(createCustomComponent(node, newNode, isGlobalBuilder)); } } -function createCustomComponent(node: ts.ExpressionStatement, newNode: ts.NewExpression): ts.Block { +function createCustomComponent(node: ts.ExpressionStatement, newNode: ts.NewExpression, + isGlobalBuilder: boolean = false): ts.Block { let componentParameter: ts.ObjectLiteralExpression; if (node.expression && node.expression.arguments && node.expression.arguments.length) { componentParameter = node.expression.arguments[0]; @@ -189,8 +190,8 @@ function createCustomComponent(node: ts.ExpressionStatement, newNode: ts.NewExpr return ts.factory.createBlock( [ ts.factory.createExpressionStatement(ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression( - ts.factory.createThis(), + ts.factory.createPropertyAccessExpression(isGlobalBuilder ? + ts.factory.createParenthesizedExpression(parentConditionalExpression()) : ts.factory.createThis(), ts.factory.createIdentifier(OBSERVECOMPONENTCREATION) ), undefined, [ts.factory.createArrowFunction(undefined, undefined, @@ -213,7 +214,7 @@ function createCustomComponent(node: ts.ExpressionStatement, newNode: ts.NewExpr ), undefined, [ts.factory.createIdentifier(ELMTID)] )), - createIfCustomComponent(newNode, componentParameter), + createIfCustomComponent(newNode, componentParameter, isGlobalBuilder), ts.factory.createExpressionStatement(ts.factory.createCallExpression( ts.factory.createPropertyAccessExpression( ts.factory.createIdentifier(VIEWSTACKPROCESSOR), @@ -226,8 +227,8 @@ function createCustomComponent(node: ts.ExpressionStatement, newNode: ts.NewExpr ], true); } -function createIfCustomComponent(newNode: ts.NewExpression, - componentParameter: ts.ObjectLiteralExpression): ts.IfStatement { +function createIfCustomComponent(newNode: ts.NewExpression, componentParameter: ts.ObjectLiteralExpression, + isGlobalBuilder: boolean = false): ts.IfStatement { return ts.factory.createIfStatement( ts.factory.createIdentifier(ISINITIALRENDER), ts.factory.createBlock( @@ -241,8 +242,8 @@ function createIfCustomComponent(newNode: ts.NewExpression, ], true), ts.factory.createBlock( [ts.factory.createExpressionStatement(ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression( - ts.factory.createThis(), + ts.factory.createPropertyAccessExpression(isGlobalBuilder ? + ts.factory.createParenthesizedExpression(parentConditionalExpression()) : ts.factory.createThis(), ts.factory.createIdentifier(UPDATE_STATE_VARS_OF_CHIND_BY_ELMTID) ), undefined, [ts.factory.createIdentifier(ELMTID), componentParameter]))], true) -- Gitee From 58ca1b8e55e3a716e6c2e31c25679230c7bb9d17 Mon Sep 17 00:00:00 2001 From: hufeng Date: Thu, 17 Nov 2022 14:16:37 +0000 Subject: [PATCH 126/379] Generate module package name Signed-off-by: hufeng Change-Id: I7a3ed7036bea97c7d571c4ee405d909fb4335a07 --- compiler/src/gen_abc_plugin.ts | 45 ++++++++++++++++++---------------- compiler/src/gen_merged_abc.ts | 2 +- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 369cb96..f007ff1 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -28,6 +28,7 @@ import { genTemporaryPath, genBuildPath, genAbcFileName, + getPackageInfo, mkdirsSync, genSourceMapFileName, checkNodeModulesFile, @@ -118,12 +119,15 @@ export class ModuleInfo { isCommonJs: boolean; recordName: string; sourceFile: string; + packageName: string; - constructor(filePath: string, tempFilePath: string, buildFilePath: string, abcFilePath: string, isCommonJs: boolean) { + constructor(filePath: string, tempFilePath: string, buildFilePath: string, + abcFilePath: string, packageName: string, isCommonJs: boolean) { this.filePath = filePath; this.tempFilePath = tempFilePath; this.buildFilePath = buildFilePath; this.abcFilePath = abcFilePath; + this.packageName = packageName; this.isCommonJs = isCommonJs; this.recordName = getOhmUrlByFilepath(filePath); this.sourceFile = filePath.replace(projectConfig.projectRootPath + path.sep, ''); @@ -132,13 +136,11 @@ export class ModuleInfo { export class EntryInfo { npmInfo: string; - abcFileName: string; buildPath: string; entry: string; - constructor(npmInfo: string, abcFileName: string, buildPath: string, entry: string) { + constructor(npmInfo: string, buildPath: string, entry: string) { this.npmInfo = npmInfo; - this.abcFileName = abcFileName; this.buildPath = buildPath; this.entry = entry; } @@ -263,7 +265,7 @@ function clearGlobalInfo() { buildMapFileList = new Set(); } -function getEntryInfo(filePath: string, tempFilePath: string, resourceResolveData: any): void { +function getEntryInfo(filePath: string, resourceResolveData: any): string { if (!resourceResolveData.descriptionFilePath) { return; } @@ -280,32 +282,30 @@ function getEntryInfo(filePath: string, tempFilePath: string, resourceResolveDat const buildFakeEntryPath: string = genBuildPath(fakeEntryPath, projectConfig.projectPath, projectConfig.buildPath); npmInfoPath = toUnixPath(path.resolve(tempFakeEntryPath, '..')); const buildNpmInfoPath: string = toUnixPath(path.resolve(buildFakeEntryPath, '..')); - if (entryInfos.has(npmInfoPath)) { - return; + if (!entryInfos.has(npmInfoPath)) { + const entryInfo: EntryInfo = new EntryInfo(npmInfoPath, buildNpmInfoPath, entry); + entryInfos.set(npmInfoPath, entryInfo); } - let abcFileName: string = genAbcFileName(tempFilePath); - const abcFilePaths: string[] = abcFileName.split(NODE_MODULES); - abcFileName = [NODE_MODULES, abcFilePaths[abcFilePaths.length - 1]].join(path.sep); - abcFileName = toUnixPath(abcFileName); - - const entryInfo: EntryInfo = new EntryInfo(npmInfoPath, abcFileName, buildNpmInfoPath, entry); - entryInfos.set(npmInfoPath, entryInfo); + return buildNpmInfoPath; } function processNodeModulesFile(filePath: string, tempFilePath: string, buildFilePath: string, abcFilePath: string, nodeModulesFile: Array, module: any): void { - getEntryInfo(filePath, tempFilePath, module.resourceResolveData); + let npmPkgPath: string = getEntryInfo(filePath, module.resourceResolveData); + const buildNpmPkgPath: string = npmPkgPath.replace(toUnixPath(projectConfig.nodeModulesPath), ''); + const npmPkgName: string = toUnixPath(path.join(NODE_MODULES, buildNpmPkgPath)); + const descriptionFileData: any = module.resourceResolveData.descriptionFileData; if (descriptionFileData && descriptionFileData['type'] && descriptionFileData['type'] === 'module') { - const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, false); + const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, npmPkgName, false); moduleInfos.push(tempModuleInfo); nodeModulesFile.push(tempFilePath); } else if (filePath.endsWith(EXTNAME_MJS)) { - const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, false); + const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, npmPkgName, false); moduleInfos.push(tempModuleInfo); nodeModulesFile.push(tempFilePath); } else { - const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, true); + const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, npmPkgName, true); moduleInfos.push(tempModuleInfo); nodeModulesFile.push(tempFilePath); } @@ -324,7 +324,8 @@ function processEtsModule(filePath: string, tempFilePath: string, buildFilePath: if (checkNodeModulesFile(filePath, projectConfig.projectPath)) { processNodeModulesFile(filePath, tempFilePath, buildFilePath, abcFilePath, nodeModulesFile, module); } else { - const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, false); + const moduleName: string = getPackageInfo(projectConfig.aceModuleJsonPath)[1]; + const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, moduleName, false); moduleInfos.push(tempModuleInfo); } buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath + path.sep, ''))); @@ -343,7 +344,8 @@ function processTsModule(filePath: string, tempFilePath: string, buildFilePath: if (checkNodeModulesFile(filePath, projectConfig.projectPath)) { processNodeModulesFile(filePath, tempFilePath, buildFilePath, abcFilePath, nodeModulesFile, module); } else { - const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, false); + const moduleName: string = getPackageInfo(projectConfig.aceModuleJsonPath)[1]; + const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, moduleName, false); moduleInfos.push(tempModuleInfo); } buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath + path.sep, ''))); @@ -361,7 +363,8 @@ function processJsModule(filePath: string, tempFilePath: string, buildFilePath: if (checkNodeModulesFile(filePath, projectConfig.projectPath)) { processNodeModulesFile(filePath, tempFilePath, buildFilePath, abcFilePath, nodeModulesFile, module); } else { - const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, false); + const moduleName: string = getPackageInfo(projectConfig.aceModuleJsonPath)[1]; + const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, moduleName, false); moduleInfos.push(tempModuleInfo); } buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath + path.sep, ''))); diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index ac3f5c9..a1f3c45 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -63,7 +63,7 @@ function generateCompileFilesInfo(moduleInfos: Array) { moduleInfos.forEach(info => { const moduleType: string = info.isCommonJs ? 'commonjs' : 'esm'; const sourceFile: string = info.filePath.replace(projectConfig.projectRootPath + path.sep, ''); - filesInfo += `${info.tempFilePath};${info.recordName};${moduleType};${toUnixPath(sourceFile)}\n`; + filesInfo += `${info.tempFilePath};${info.recordName};${moduleType};${toUnixPath(sourceFile)};${info.packageName}\n`; }); fs.writeFileSync(filesInfoPath, filesInfo, 'utf-8'); } -- Gitee From 6adf9550c42e976892861b93d5bc248bc1d592c2 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Tue, 15 Nov 2022 12:37:45 +0000 Subject: [PATCH 127/379] opt cluster fork time cost Signed-off-by: zhangrengao Change-Id: I69d72bf2fb51e45afa06223d363334d74fa5a29a --- compiler/src/gen_abc_plugin.ts | 113 ++++++++++++++++++++++++++++----- compiler/src/pre_define.ts | 1 + compiler/src/utils.ts | 24 ++++--- 3 files changed, 114 insertions(+), 24 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 18204c3..c135d6b 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -37,7 +37,11 @@ import { genProtoFileName, genMergeProtoFileName, removeDuplicateInfo, - validateFilePathLength + validateFilePathLength, + isTs2Abc, + isEs2Abc, + buildCachePath, + unlinkSync } from './utils'; import { projectConfig } from '../main'; import { @@ -64,7 +68,9 @@ import { TS2ABC, PROTO_FILESINFO_TXT, NPMENTRIES_TXT, - EXTNAME_PROTO_BIN + EXTNAME_PROTO_BIN, + FILESINFO_TXT, + BUNDLE_CACHE } from './pre_define'; import { getOhmUrlByFilepath @@ -235,11 +241,17 @@ export class GenAbcPlugin { return; } buildPathInfo = output; - if (previewCount == compileCount) { - previewCount++; - invokeWorkersToGenAbc(); + if (isTs2Abc()) { + if (previewCount == compileCount) { + previewCount++; + invokeWorkersToGenAbc(); + } else { + previewCount++; + } + } else if (isEs2Abc()){ + generateAbcByEs2AbcOfBundleMode(intermediateJsBundle); } else { - previewCount++; + logger.error(red, `ArkTS:ERROR please set panda module`, reset); } }); } @@ -947,16 +959,7 @@ function writeModuleHashJson(): void { } function filterIntermediateJsBundleByHashJson(buildPath: string, inputPaths: File[]): void { - const tempInputPaths = Array(); - inputPaths.forEach((item) => { - const check = tempInputPaths.every((newItem) => { - return item.path !== newItem.path; - }); - if (check) { - tempInputPaths.push(item); - } - }); - inputPaths = tempInputPaths; + inputPaths = removeDuplicateInfoOfBundleList(inputPaths); for (let i = 0; i < inputPaths.length; ++i) { fileterIntermediateJsBundle.push(inputPaths[i]); @@ -1213,3 +1216,81 @@ function mergeProtoToAbc(): void { logger.debug(red, `ArkTS:ERROR Failed to merge proto file to abc`, reset); } } + +function generateAbcByEs2AbcOfBundleMode(inputPaths: File[]) { + let [filesInfoPath, cacheFilePath] = generateFileOfBundle(inputPaths); + const fileThreads = os.cpus().length < 16 ? os.cpus().length : 16; + let genAbcCmd: string = + `${initAbcEnv().join(' ')} "@${filesInfoPath}" --file-threads "${fileThreads}" --cache-file "${cacheFilePath}"`; + logger.debug('gen abc cmd is: ', genAbcCmd); + try { + if (process.env.watchMode === 'true') { + childProcess.execSync(genAbcCmd); + } else { + const child = childProcess.exec(genAbcCmd); + child.on('exit', (code: any) => { + if (process.env.cachePath === undefined) { + unlinkSync(filesInfoPath); + unlinkSync(cacheFilePath); + } + if (code === 1) { + logger.debug(red, "ArkTS:ERROR failed to execute es2abc", reset); + process.exit(FAIL); + } + }); + + child.on('error', (err: any) => { + logger.debug(red, err.toString(), reset); + process.exit(FAIL); + }); + + child.stderr.on('data', (data: any) => { + logger.debug(red, data.toString(), reset); + }); + } + } catch (e) { + logger.debug(red, `ArkTS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); + if (process.env.watchMode !== 'true') { + process.exit(FAIL); + } + } finally { + if (process.env.watchMode === 'true' && process.env.cachePath === undefined) { + unlinkSync(filesInfoPath); + unlinkSync(cacheFilePath); + } + } +} + +function generateFileOfBundle(inputPaths: File[]) { + let filesInfoPath: string = buildCachePath(FILESINFO_TXT); + let cacheFilePath: string = buildCachePath(BUNDLE_CACHE); + inputPaths = removeDuplicateInfoOfBundleList(inputPaths); + + let filesInfo: string = ''; + inputPaths.forEach(info => { + const cacheOutputPath: string = info.cacheOutputPath; + const recordName: string = 'null_recordName'; + const moduleType: string = 'script'; + const sourceFile: string = info.path.replace(/\.temp\.js$/, "_.js"); + const abcFilePath: string = info.path.replace(/\.temp\.js$/, ".abc"); + filesInfo += `${cacheOutputPath};${recordName};${moduleType};${sourceFile};${abcFilePath}\n`; + }); + fs.writeFileSync(filesInfoPath, filesInfo, 'utf-8'); + + return [filesInfoPath, cacheFilePath]; +} + +function removeDuplicateInfoOfBundleList(inputPaths: File[]) { + const tempInputPaths = Array(); + inputPaths.forEach((item) => { + const check = tempInputPaths.every((newItem) => { + return item.path !== newItem.path; + }); + if (check) { + tempInputPaths.push(item); + } + }); + inputPaths = tempInputPaths; + + return inputPaths; +} \ No newline at end of file diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 163560a..c6af35c 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -261,6 +261,7 @@ export const PREBUILDMODE_JSON: string = 'preBuildMode.json'; export const SOURCEMAPS_JSON: string = 'sourceMaps.json'; export const SOURCEMAPS: string = 'sourceMaps.map'; export const PROTO_FILESINFO_TXT: string = 'protoFilesInfo.txt'; +export const BUNDLE_CACHE: string = 'bundle.cache'; export const ESMODULE: string = 'esmodule'; export const JSBUNDLE: string = 'jsbundle'; diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index b93f418..fb3eddf 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -675,17 +675,11 @@ export function parseErrorMessage(message: string): string { } export function isEs2Abc(): boolean { - if (process.env.panda === ES2ABC || process.env.panda === 'undefined' || process.env.panda === undefined) { - return true; - } - return false; + return process.env.panda === ES2ABC || process.env.panda === 'undefined' || process.env.panda === undefined; } export function isTs2Abc(): boolean { - if (process.env.panda === TS2ABC) { - return true; - } - return false; + return process.env.panda === TS2ABC; } export function genProtoFileName(temporaryFile: string): string { @@ -762,3 +756,17 @@ export function validateFilePathLength(filePath: string): boolean { return false; } } + +export function buildCachePath(tailName: string): string { + let pathName: string = process.env.cachePath !== undefined ? + path.join(process.env.cachePath, tailName) : path.join(projectConfig.buildPath, tailName); + validateFilePathLength(pathName); + + return pathName; +} + +export function unlinkSync(filePath: string): void { + if (fs.existsSync(filePath)) { + fs.unlinkSync(filePath); + } +} \ No newline at end of file -- Gitee From 06c2790f6d4ce04b589a0bad24f057328e56d668 Mon Sep 17 00:00:00 2001 From: bojiang Date: Fri, 18 Nov 2022 16:56:32 +0800 Subject: [PATCH 128/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I1e5788082e8ddbad9f0015bd0693e45bf8d8fc12 --- compiler/webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 0cb4ce6..6629f8c 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -75,6 +75,7 @@ function initConfig(config) { { loader: 'ts-loader', options: { + reportFiles: ['*.js'], onlyCompileBundledFiles: true, transpileOnly: true, configFile: path.resolve(__dirname, 'tsconfig.json'), -- Gitee From 0eaa3fe6918841baf2f997bde77723a2ccb2e428 Mon Sep 17 00:00:00 2001 From: bojiang Date: Fri, 18 Nov 2022 17:01:49 +0800 Subject: [PATCH 129/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I96eedf0e59d69ab518875df0c9d1c10b8e36f70c --- .../render_component/tab/tab.ts | 6 +- .../simple_component/button/button.ts | 6 +- .../animateTo/animateTo.ts | 6 +- .../pageTransition/pageTransition.ts | 6 +- .../render_decorator/@builder/@builder.ts | 6 +- .../@builder/@builderWithComponent.ts | 152 +++++++++++++++++ .../@builder/@builderWithLinkData.ts | 26 ++- .../@builderParam/@builderParam.ts | 161 ++++++++++++------ .../@customDialog/@customDialog.ts | 14 +- .../render_decorator/@extend/@extend.ts | 6 +- .../render_decorator/@preview/@preview.ts | 26 ++- .../render_decorator/@styles/@styles.ts | 6 +- .../render_decorator/@styles/@stylesExport.ts | 6 +- .../@storageLink/@storageLink.ts | 6 +- .../@storageProp/@storageProp.ts | 6 +- .../appStorage/appStorage.ts | 6 +- .../localStorage/localStorage.ts | 6 +- .../@link/@link.ts | 26 ++- .../@objectLink/@objectLink.ts | 27 ++- .../@prop/@prop.ts | 26 ++- .../@state/@state.ts | 6 +- .../@consume_@provide/@consume_@provide.ts | 46 +++-- .../@observed_@objectLink.ts | 27 ++- .../others/@watch/@watch.ts | 6 +- 24 files changed, 471 insertions(+), 144 deletions(-) create mode 100644 compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/tab/tab.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/tab/tab.ts index f531e56..e16d50c 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/tab/tab.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/tab/tab.ts @@ -54,8 +54,8 @@ struct TabSimple { exports.expectResult = `"use strict"; class TabSimple extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.controller = new TabsController(); this.setInitiallyProvidedValue(params); } @@ -64,6 +64,8 @@ class TabSimple extends ViewPU { this.controller = params.controller; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/simple_component/button/button.ts b/compiler/test/utForPartialUpdate/inner_component_transform/simple_component/button/button.ts index 25d93a4..fd23281 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/simple_component/button/button.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/simple_component/button/button.ts @@ -36,12 +36,14 @@ struct ButtonExample { exports.expectResult = `"use strict"; class ButtonExample extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts b/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts index 991ac0d..38adff4 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts @@ -60,8 +60,8 @@ struct TransitionExample { exports.expectResult = `"use strict"; class TransitionExample extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__btnW = new ObservedPropertySimplePU(50, this, "btnW"); this.__btnH = new ObservedPropertySimplePU(50, this, "btnH"); this.__btn1 = new ObservedPropertySimplePU(false, this, "btn1"); @@ -82,6 +82,8 @@ class TransitionExample extends ViewPU { this.show = params.show; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__btnW.purgeDependencyOnElmtId(rmElmtId); this.__btnH.purgeDependencyOnElmtId(rmElmtId); diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/pageTransition/pageTransition.ts b/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/pageTransition/pageTransition.ts index 3f7d41c..866fdc0 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/pageTransition/pageTransition.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/pageTransition/pageTransition.ts @@ -48,8 +48,8 @@ struct PageTransitionExample1 { exports.expectResult = `"use strict"; class PageTransitionExample1 extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__scale2 = new ObservedPropertySimplePU(1, this, "scale2"); this.__opacity2 = new ObservedPropertySimplePU(1, this, "opacity2"); this.__active = new ObservedPropertySimplePU(false, this, "active"); @@ -66,6 +66,8 @@ class PageTransitionExample1 extends ViewPU { this.active = params.active; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__scale2.purgeDependencyOnElmtId(rmElmtId); this.__opacity2.purgeDependencyOnElmtId(rmElmtId); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts index ca3e6cf..47ab215 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts @@ -193,8 +193,8 @@ function specificParam(label1, label2, parent = undefined) { Column.pop(); } class MyComponent extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; this.controller = new TabsController(); this.__hideBar = new ObservedPropertySimplePU(true, this, "hideBar"); @@ -211,6 +211,8 @@ class MyComponent extends ViewPU { this.hideBar = params.hideBar; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__hideBar.purgeDependencyOnElmtId(rmElmtId); } diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts new file mode 100644 index 0000000..5624188 --- /dev/null +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts @@ -0,0 +1,152 @@ +/* + * 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. + */ + +exports.source = ` +@Builder +function myBuilder() { + child(); +} + +@Entry +@Component +struct Index { + @Builder Builder1() { + child() + } + build() { + Row() { + myBuilder(); + this.Builder1(); + child(); + } + } +} + +@Component +struct child{ + build() { + Text('Hello') + } +} +` + +exports.expectResult = +`"use strict"; +function myBuilder(parent = undefined) { + { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new child(parent ? parent : this, {}, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, {}); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + } +} +class Index extends ViewPU { + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + } + updateStateVars(params) { + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + Builder1(parent = undefined) { + { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new child(this, {}, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, {}); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + } + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + myBuilder(this); + this.Builder1(this); + { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new child(this, {}, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, {}); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + } + Row.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class child extends ViewPU { + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + } + updateStateVars(params) { + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('Hello'); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new Index(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` \ No newline at end of file diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts index 858eff4..aca166c 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts @@ -40,13 +40,15 @@ struct TestPage{ exports.expectResult = `"use strict"; class TitleComp extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__title = new SynchedPropertySimpleTwoWayPU(params.title, this, "title"); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__title.purgeDependencyOnElmtId(rmElmtId); } @@ -77,8 +79,8 @@ class TitleComp extends ViewPU { } } class TestPage extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__value = new ObservedPropertySimplePU('hello world', this, "value"); this.setInitiallyProvidedValue(params); } @@ -87,6 +89,8 @@ class TestPage extends ViewPU { this.value = params.value; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__value.purgeDependencyOnElmtId(rmElmtId); } @@ -103,10 +107,16 @@ class TestPage extends ViewPU { } TitleCompView(parent = undefined) { { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new TitleComp(this, { title: this.__value })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new TitleComp(this, { title: this.__value }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { title: this.__value }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } } initialRender() { diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts b/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts index b2f6bd9..65c6107 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts @@ -105,8 +105,8 @@ exports.expectResult = Object.defineProperty(exports, "__esModule", { value: true }); const TestComponent_1 = require("./test/pages/TestComponent"); class CustomContainer extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.header = ""; this.footer = ""; this.setInitiallyProvidedValue(params); @@ -121,6 +121,8 @@ class CustomContainer extends ViewPU { this.footer = params.footer; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { @@ -165,8 +167,8 @@ class CustomContainer extends ViewPU { } } class CustomContainer2 extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.header = ""; this.setInitiallyProvidedValue(params); } @@ -176,6 +178,8 @@ class CustomContainer2 extends ViewPU { } this.content = params.content; } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { @@ -240,8 +244,8 @@ function specificWithParam(label1, label2, parent = undefined) { Column.pop(); } class CustomContainerUser extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__text = new ObservedPropertySimplePU('header', this, "text"); this.setInitiallyProvidedValue(params); } @@ -250,6 +254,8 @@ class CustomContainerUser extends ViewPU { this.text = params.text; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__text.purgeDependencyOnElmtId(rmElmtId); } @@ -326,27 +332,50 @@ class CustomContainerUser extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new TestComponent_1.CustomContainerExport(this, { - header: this.text, - closer: () => { - this.observeComponentCreation((elmtId, isInitialRender) => { - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - Column.create(); - Column.onClick(() => { - this.text = "changeHeader"; - }); - if (!isInitialRender) { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new TestComponent_1.CustomContainerExport(this, { + header: this.text, + closer: () => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + Column.onClick(() => { + this.text = "changeHeader"; + }); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + specificWithParam("111", "22", this); + Column.pop(); + } + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + header: this.text, + closer: () => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + Column.onClick(() => { + this.text = "changeHeader"; + }); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + specificWithParam("111", "22", this); Column.pop(); } - ViewStackProcessor.StopGetAccessRecording(); }); - specificWithParam("111", "22", this); - Column.pop(); } - })); - ViewStackProcessor.StopGetAccessRecording(); + ViewStackProcessor.StopGetAccessRecording(); + }); } this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); @@ -357,15 +386,26 @@ class CustomContainerUser extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new CustomContainer(this, { - header: this.text, - content: this.specificParam, - callContent: this.callSpecificParam("callContent1", 'callContent2'), - footer: "Footer", - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new CustomContainer(this, { + header: this.text, + content: this.specificParam, + callContent: this.callSpecificParam("callContent1", 'callContent2'), + footer: "Footer", + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + header: this.text, + content: this.specificParam, + callContent: this.callSpecificParam("callContent1", 'callContent2'), + footer: "Footer", + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } Row.pop(); this.observeComponentCreation((elmtId, isInitialRender) => { @@ -377,27 +417,50 @@ class CustomContainerUser extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new CustomContainer2(this, { - header: this.text, - content: () => { - this.observeComponentCreation((elmtId, isInitialRender) => { - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - Column.create(); - Column.onClick(() => { - this.text = "changeHeader"; - }); - if (!isInitialRender) { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new CustomContainer2(this, { + header: this.text, + content: () => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + Column.onClick(() => { + this.text = "changeHeader"; + }); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.callSpecificParam("111", '222', this); + Column.pop(); + } + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + header: this.text, + content: () => { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + Column.onClick(() => { + this.text = "changeHeader"; + }); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.callSpecificParam("111", '222', this); Column.pop(); } - ViewStackProcessor.StopGetAccessRecording(); }); - this.callSpecificParam("111", '222', this); - Column.pop(); } - })); - ViewStackProcessor.StopGetAccessRecording(); + ViewStackProcessor.StopGetAccessRecording(); + }); } Row.pop(); Column.pop(); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts b/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts index e50a4a4..cbe7c6e 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts @@ -101,8 +101,8 @@ struct CustomDialogUser { exports.expectResult = `"use strict"; class DialogExample extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__count = new SynchedPropertySimpleOneWayPU(params.count, this, "count"); this.__isPlaying = new SynchedPropertySimpleTwoWayPU(params.isPlaying, this, "isPlaying"); this.controller = undefined; @@ -125,6 +125,8 @@ class DialogExample extends ViewPU { this.action2 = params.action2; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__count.purgeDependencyOnElmtId(rmElmtId); this.__isPlaying.purgeDependencyOnElmtId(rmElmtId); @@ -247,8 +249,8 @@ class DialogExample extends ViewPU { } } class CustomDialogUser extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__countInitValue = new ObservedPropertySimplePU(10, this, "countInitValue"); this.__playingInitValue = new ObservedPropertySimplePU(false, this, "playingInitValue"); this.dialogController = new CustomDialogController({ @@ -259,7 +261,7 @@ class CustomDialogUser extends ViewPU { action2: this.existApp, count: this.__countInitValue, isPlaying: this.__playingInitValue - }); + }, elmtId); jsDialog.setController(this.dialogController); ViewPU.create(jsDialog); }, @@ -279,6 +281,8 @@ class CustomDialogUser extends ViewPU { this.dialogController = params.dialogController; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__countInitValue.purgeDependencyOnElmtId(rmElmtId); this.__playingInitValue.purgeDependencyOnElmtId(rmElmtId); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@extend/@extend.ts b/compiler/test/utForPartialUpdate/render_decorator/@extend/@extend.ts index 58bea9d..277c6df 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@extend/@extend.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@extend/@extend.ts @@ -68,12 +68,14 @@ function __Button__fancybut(color) { Button.height(100); } class FancyUse extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { diff --git a/compiler/test/utForPartialUpdate/render_decorator/@preview/@preview.ts b/compiler/test/utForPartialUpdate/render_decorator/@preview/@preview.ts index d0dbb0e..c3e5e5a 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@preview/@preview.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@preview/@preview.ts @@ -39,8 +39,8 @@ struct HomePreviewComponent_Preview { exports.expectResult = `"use strict"; class HomePreviewComponent extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.value = "hello world"; this.setInitiallyProvidedValue(params); } @@ -49,6 +49,8 @@ class HomePreviewComponent extends ViewPU { this.value = params.value; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { @@ -73,12 +75,14 @@ class HomePreviewComponent extends ViewPU { } } class HomePreviewComponent_Preview extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { @@ -95,10 +99,16 @@ class HomePreviewComponent_Preview extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new HomePreviewComponent(this, {})); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new HomePreviewComponent(this, {}, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, {}); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } Column.pop(); } diff --git a/compiler/test/utForPartialUpdate/render_decorator/@styles/@styles.ts b/compiler/test/utForPartialUpdate/render_decorator/@styles/@styles.ts index 90b8dd2..8f96dc3 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@styles/@styles.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@styles/@styles.ts @@ -56,8 +56,8 @@ struct FancyUse { exports.expectResult = `"use strict"; class FancyUse extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__enable = new ObservedPropertySimplePU(true, this, "enable"); this.setInitiallyProvidedValue(params); } @@ -66,6 +66,8 @@ class FancyUse extends ViewPU { this.enable = params.enable; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__enable.purgeDependencyOnElmtId(rmElmtId); } diff --git a/compiler/test/utForPartialUpdate/render_decorator/@styles/@stylesExport.ts b/compiler/test/utForPartialUpdate/render_decorator/@styles/@stylesExport.ts index 1eec293..1388e7f 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@styles/@stylesExport.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@styles/@stylesExport.ts @@ -59,8 +59,8 @@ exports.expectResult = Object.defineProperty(exports, "__esModule", { value: true }); exports.FancyUseExp = void 0; class FancyUseExp extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__enable = new ObservedPropertySimplePU(true, this, "enable"); this.setInitiallyProvidedValue(params); } @@ -69,6 +69,8 @@ class FancyUseExp extends ViewPU { this.enable = params.enable; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__enable.purgeDependencyOnElmtId(rmElmtId); } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts index f08ba61..9c49c48 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts @@ -52,8 +52,8 @@ exports.expectResult = let varA = AppStorage.Link('varA'); let envLang = AppStorage.Prop('languageCode'); class MyComponent extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__varA = this.createStorageLink('varA', 2, "varA"); this.__lang = this.createStorageProp('languageCode', 'en', "lang"); this.label = 'count'; @@ -64,6 +64,8 @@ class MyComponent extends ViewPU { this.label = params.label; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts index f08ba61..9c49c48 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts @@ -52,8 +52,8 @@ exports.expectResult = let varA = AppStorage.Link('varA'); let envLang = AppStorage.Prop('languageCode'); class MyComponent extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__varA = this.createStorageLink('varA', 2, "varA"); this.__lang = this.createStorageProp('languageCode', 'en', "lang"); this.label = 'count'; @@ -64,6 +64,8 @@ class MyComponent extends ViewPU { this.label = params.label; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts index f08ba61..9c49c48 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts @@ -52,8 +52,8 @@ exports.expectResult = let varA = AppStorage.Link('varA'); let envLang = AppStorage.Prop('languageCode'); class MyComponent extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__varA = this.createStorageLink('varA', 2, "varA"); this.__lang = this.createStorageProp('languageCode', 'en', "lang"); this.label = 'count'; @@ -64,6 +64,8 @@ class MyComponent extends ViewPU { this.label = params.label; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/localStorage/localStorage.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/localStorage/localStorage.ts index ff65f47..daaaeb1 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/localStorage/localStorage.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/localStorage/localStorage.ts @@ -54,14 +54,16 @@ class ClassA { } } class LocalStorageComponent extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__simpleVarName = this.createLocalStorageLink("storageSimpleProp", 0, "simpleVarName"); this.__objectName = this.createLocalStorageProp("storageObjectProp", new ClassA("x"), "objectName"); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts index 023742b..e8ccd7f 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts @@ -36,13 +36,15 @@ struct ParentComponent { exports.expectResult = `"use strict"; class LinkComponent extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__counter = new SynchedPropertySimpleTwoWayPU(params.counter, this, "counter"); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__counter.purgeDependencyOnElmtId(rmElmtId); } @@ -73,8 +75,8 @@ class LinkComponent extends ViewPU { } } class ParentComponent extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__value = new ObservedPropertySimplePU('first init content', this, "value"); this.setInitiallyProvidedValue(params); } @@ -83,6 +85,8 @@ class ParentComponent extends ViewPU { this.value = params.value; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__value.purgeDependencyOnElmtId(rmElmtId); } @@ -107,10 +111,16 @@ class ParentComponent extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new LinkComponent(this, { counter: this.__value })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new LinkComponent(this, { counter: this.__value }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { counter: this.__value }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } Column.pop(); } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts index 1bdff6b..c7da5f8 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts @@ -72,14 +72,17 @@ Model = __decorate([ Observed ], Model); class CustomText extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__model = new SynchedPropertyNesedObjectPU(params.model, this, "model"); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { this.__model.set(params.model); } + updateStateVars(params) { + this.__model.set(params.model); + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__model.purgeDependencyOnElmtId(rmElmtId); } @@ -116,8 +119,8 @@ class CustomText extends ViewPU { } } class Parent extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.nextId = 1; this.__models = new ObservedPropertyObjectPU([new Model('0', '#ffffff'), new Model('1', '#fff456')], this, "models"); this.setInitiallyProvidedValue(params); @@ -130,6 +133,8 @@ class Parent extends ViewPU { this.models = params.models; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__models.purgeDependencyOnElmtId(rmElmtId); } @@ -160,10 +165,16 @@ class Parent extends ViewPU { const forEachItemGenFunction = _item => { const item = _item; { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new CustomText(this, { model: item })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new CustomText(this, { model: item }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { model: item }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } }; this.forEachUpdateFunction(elmtId, this.models, forEachItemGenFunction, (item) => item.text, false, false); diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts index 35a9414..b86c1a3 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts @@ -36,13 +36,15 @@ struct ParentComponent { exports.expectResult = `"use strict"; class PropComponent extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__counter = new SynchedPropertySimpleOneWayPU(params.counter, this, "counter"); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__counter.purgeDependencyOnElmtId(rmElmtId); } @@ -73,8 +75,8 @@ class PropComponent extends ViewPU { } } class ParentComponent extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__value = new ObservedPropertySimplePU('first init content', this, "value"); this.setInitiallyProvidedValue(params); } @@ -83,6 +85,8 @@ class ParentComponent extends ViewPU { this.value = params.value; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__value.purgeDependencyOnElmtId(rmElmtId); } @@ -107,10 +111,16 @@ class ParentComponent extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new PropComponent(this, { counter: this.__value })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new PropComponent(this, { counter: this.__value }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { counter: this.__value }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } Column.pop(); } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@state/@state.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@state/@state.ts index 4ed4329..a6dc74c 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@state/@state.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@state/@state.ts @@ -28,8 +28,8 @@ struct StatePage { exports.expectResult = `"use strict"; class StatePage extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__counter = new ObservedPropertySimplePU(0, this, "counter"); this.setInitiallyProvidedValue(params); } @@ -38,6 +38,8 @@ class StatePage extends ViewPU { this.counter = params.counter; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__counter.purgeDependencyOnElmtId(rmElmtId); } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/others/@consume_@provide/@consume_@provide.ts b/compiler/test/utForPartialUpdate/ui_state_management/others/@consume_@provide/@consume_@provide.ts index 279c53f..8e6140a 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/others/@consume_@provide/@consume_@provide.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/others/@consume_@provide/@consume_@provide.ts @@ -61,8 +61,8 @@ struct CompC { exports.expectResult = `"use strict"; class CompA extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__reviewVotes = new ObservedPropertySimplePU(0, this, "reviewVotes"); this.addProvidedVar("reviewVote", this.__reviewVotes); this.addProvidedVar("reviewVotes", this.__reviewVotes); @@ -73,6 +73,8 @@ class CompA extends ViewPU { this.reviewVotes = params.reviewVotes; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { @@ -96,10 +98,16 @@ class CompA extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new CompB(this, {})); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new CompB(this, {}, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, {}); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); @@ -130,12 +138,14 @@ class CompA extends ViewPU { } } class CompB extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { @@ -152,10 +162,16 @@ class CompB extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new CompC(this, {})); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new CompC(this, {}, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, {}); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } Column.pop(); } @@ -164,13 +180,15 @@ class CompB extends ViewPU { } } class CompC extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__reviewVotes = this.initializeConsume("reviewVote", "reviewVotes"); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { diff --git a/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts index 9d8175e..e57e054 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts @@ -83,14 +83,17 @@ ClassB = __decorate([ Observed ], ClassB); class ViewA extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__varA = new SynchedPropertyNesedObjectPU(params.varA, this, "varA"); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { this.__varA.set(params.varA); } + updateStateVars(params) { + this.__varA.set(params.varA); + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__varA.purgeDependencyOnElmtId(rmElmtId); } @@ -127,8 +130,8 @@ class ViewA extends ViewPU { } } class ViewB extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__varB = new ObservedPropertyObjectPU(new ClassB(new ClassA(0)), this, "varB"); this.setInitiallyProvidedValue(params); } @@ -137,6 +140,8 @@ class ViewB extends ViewPU { this.varB = params.varB; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__varB.purgeDependencyOnElmtId(rmElmtId); } @@ -169,10 +174,16 @@ class ViewB extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new ViewA(this, { varA: this.varB.a })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new ViewA(this, { varA: this.varB.a }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { varA: this.varB.a }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); diff --git a/compiler/test/utForPartialUpdate/ui_state_management/others/@watch/@watch.ts b/compiler/test/utForPartialUpdate/ui_state_management/others/@watch/@watch.ts index 1ff88a0..4ed0ce7 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/others/@watch/@watch.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/others/@watch/@watch.ts @@ -67,8 +67,8 @@ struct CompA { exports.expectResult = `"use strict"; class CompA extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__shopBasket = new ObservedPropertyObjectPU([7, 12, 47, 3], this, "shopBasket"); this.__totalPurchase = new ObservedPropertySimplePU(0, this, "totalPurchase"); this.__defArray = new ObservedPropertyObjectPU(['c', 'g', 't', 'z'], this, "defArray"); @@ -91,6 +91,8 @@ class CompA extends ViewPU { this.resultTip = params.resultTip; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__shopBasket.purgeDependencyOnElmtId(rmElmtId); this.__totalPurchase.purgeDependencyOnElmtId(rmElmtId); -- Gitee From 1fc81172e90aa129f0d2f3c11d9b4d0828749339 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sun, 20 Nov 2022 18:59:16 +0800 Subject: [PATCH 130/379] houhaoyu@huawei.com fix check special rule Signed-off-by: houhaoyu Change-Id: I6e00b83bf2de0649bbebb3d972c9e6fd120be515 --- compiler/src/validate_ui_syntax.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 714d3ff..42e028c 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -447,7 +447,7 @@ function hasNonSingleChild(node: ts.EtsComponentExpression, allComponentNames: S isCheckType: ParamType): boolean { const nodeName: ts.Identifier = node.expression as ts.Identifier; const BlockNode: ts.Block = getNextNode(node); - if ((SINGLE_CHILD_COMPONENT.has(nodeName.escapedText.toString()) || !judgeComponentType(nodeName, node, isCheckType)) + if (SINGLE_CHILD_COMPONENT.has(nodeName.escapedText.toString()) || !judgeComponentType(nodeName, node, isCheckType) && isCheckType.value === COMPONENT_BUTTON) { if (!BlockNode) { return false; @@ -580,7 +580,7 @@ function isNonspecificChildBlock(blockNode: ts.Block, specificChildSet: Set, allComponentNames: Set): boolean { - if (ts.isEtsComponentExpression(node) && node.arguments && + if (ts.isCallExpression(node) && node.arguments && node.arguments.length > 1 && ts.isArrowFunction(node.arguments[1])) { const arrowFunction: ts.ArrowFunction = node.arguments[1] as ts.ArrowFunction; const body: ts.Block | ts.EtsComponentExpression | ts.IfStatement = -- Gitee From 3d95e766be9c9e80842ae51e58cac5f48e355d2b Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Fri, 18 Nov 2022 09:53:57 +0000 Subject: [PATCH 131/379] Add hash info by es2abc of build mode Signed-off-by: zhangrengao Change-Id: I364581cd8d208f9908ecc36fecb25efa005e37b3 --- compiler/src/gen_abc_plugin.ts | 31 ++++++++++++++++--------------- compiler/src/pre_define.ts | 1 - 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index c135d6b..e53b862 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -69,8 +69,7 @@ import { PROTO_FILESINFO_TXT, NPMENTRIES_TXT, EXTNAME_PROTO_BIN, - FILESINFO_TXT, - BUNDLE_CACHE + FILESINFO_TXT } from './pre_define'; import { getOhmUrlByFilepath @@ -1218,10 +1217,11 @@ function mergeProtoToAbc(): void { } function generateAbcByEs2AbcOfBundleMode(inputPaths: File[]) { - let [filesInfoPath, cacheFilePath] = generateFileOfBundle(inputPaths); + filterIntermediateJsBundleByHashJson(buildPathInfo, inputPaths); + let filesInfoPath = generateFileOfBundle(fileterIntermediateJsBundle); const fileThreads = os.cpus().length < 16 ? os.cpus().length : 16; let genAbcCmd: string = - `${initAbcEnv().join(' ')} "@${filesInfoPath}" --file-threads "${fileThreads}" --cache-file "${cacheFilePath}"`; + `${initAbcEnv().join(' ')} "@${filesInfoPath}" --file-threads "${fileThreads}"`; logger.debug('gen abc cmd is: ', genAbcCmd); try { if (process.env.watchMode === 'true') { @@ -1229,14 +1229,14 @@ function generateAbcByEs2AbcOfBundleMode(inputPaths: File[]) { } else { const child = childProcess.exec(genAbcCmd); child.on('exit', (code: any) => { - if (process.env.cachePath === undefined) { - unlinkSync(filesInfoPath); - unlinkSync(cacheFilePath); - } if (code === 1) { logger.debug(red, "ArkTS:ERROR failed to execute es2abc", reset); process.exit(FAIL); } + if (process.env.cachePath === undefined) { + unlinkSync(filesInfoPath); + } + processExtraAsset(); }); child.on('error', (err: any) => { @@ -1254,16 +1254,17 @@ function generateAbcByEs2AbcOfBundleMode(inputPaths: File[]) { process.exit(FAIL); } } finally { - if (process.env.watchMode === 'true' && process.env.cachePath === undefined) { - unlinkSync(filesInfoPath); - unlinkSync(cacheFilePath); + if (process.env.watchMode === 'true') { + if (process.env.cachePath === undefined) { + unlinkSync(filesInfoPath); + } + processExtraAsset(); } } } -function generateFileOfBundle(inputPaths: File[]) { +function generateFileOfBundle(inputPaths: File[]): string { let filesInfoPath: string = buildCachePath(FILESINFO_TXT); - let cacheFilePath: string = buildCachePath(BUNDLE_CACHE); inputPaths = removeDuplicateInfoOfBundleList(inputPaths); let filesInfo: string = ''; @@ -1272,12 +1273,12 @@ function generateFileOfBundle(inputPaths: File[]) { const recordName: string = 'null_recordName'; const moduleType: string = 'script'; const sourceFile: string = info.path.replace(/\.temp\.js$/, "_.js"); - const abcFilePath: string = info.path.replace(/\.temp\.js$/, ".abc"); + const abcFilePath: string = cacheOutputPath.replace(/\.temp\.js$/, ".abc"); filesInfo += `${cacheOutputPath};${recordName};${moduleType};${sourceFile};${abcFilePath}\n`; }); fs.writeFileSync(filesInfoPath, filesInfo, 'utf-8'); - return [filesInfoPath, cacheFilePath]; + return filesInfoPath; } function removeDuplicateInfoOfBundleList(inputPaths: File[]) { diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index c6af35c..163560a 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -261,7 +261,6 @@ export const PREBUILDMODE_JSON: string = 'preBuildMode.json'; export const SOURCEMAPS_JSON: string = 'sourceMaps.json'; export const SOURCEMAPS: string = 'sourceMaps.map'; export const PROTO_FILESINFO_TXT: string = 'protoFilesInfo.txt'; -export const BUNDLE_CACHE: string = 'bundle.cache'; export const ESMODULE: string = 'esmodule'; export const JSBUNDLE: string = 'jsbundle'; -- Gitee From 20719cf0f5bfbee6e023a3449fdf9b829bd8e1b3 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sun, 20 Nov 2022 19:45:10 +0800 Subject: [PATCH 132/379] houhaoyu@huawei.com fix emptystatement caused error Signed-off-by: houhaoyu Change-Id: I08bd187663034346ff40dba7bab3eba5117b1c06 --- compiler/package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/package-lock.json b/compiler/package-lock.json index a2fe414..8bee087 100644 --- a/compiler/package-lock.json +++ b/compiler/package-lock.json @@ -4161,7 +4161,7 @@ }, "typescript": { "version": "file:deps/ohos-typescript-4.2.3-r2.tgz", - "integrity": "sha512-D6ax1YhPEqZq9fuvp+5au9t6h+0iRD09CWqU4WGJ3qnQw22TnhafH8jdjCZ2VRSxXr+NH7503c4KA58QKerbzA==" + "integrity": "sha512-lAFSMdoRBbkoaCwyDQrKIEK/dcxJnAzKWzDpFcJR39aAe6UHYo2FO5IY5aDPA3nkCqO1yVmeuMamiRF+ehfj8Q==" }, "uglify-js": { "version": "3.16.1", -- Gitee From a22fd1f14083430786f80959cb2175841d0ba59c Mon Sep 17 00:00:00 2001 From: yfwang6 Date: Tue, 22 Nov 2022 09:58:50 +0800 Subject: [PATCH 133/379] wangyongfei6@huawei.com update partial ut for elmId Signed-off-by: yfwang6 Change-Id: I239f90228c2d16c9aa9bedd7ca97cf8da4103e56 --- .../utForPartialUpdate/import/importAllEts.ts | 132 ++++++---- .../utForPartialUpdate/import/importEts.ts | 240 ++++++++++++------ .../import/importExportEts.ts | 88 +++++-- .../import/importExportNest.ts | 55 ++-- .../utForPartialUpdate/import/importTs.ts | 88 +++++-- .../$$_component/$$_component.ts | 6 +- .../custom_component/custom_component.ts | 96 +++++-- .../gesture_component/longPressGesture.ts | 6 +- .../gesture_component/panGestrue.ts | 6 +- .../gesture_component/pinchGesture.ts | 6 +- .../gesture_component/rotationGesture.ts | 6 +- .../gesture_component/swipeGesture.ts | 6 +- .../gesture_component/tapGesture.ts | 6 +- .../render_component/foreach/forEachTwo.ts | 6 +- .../render_component/foreach/foreach.ts | 36 ++- .../render_component/if/if.ts | 6 +- .../render_component/item/GridItem.ts | 6 +- .../render_component/item/ListItem.ts | 6 +- .../lazyforeach/lazyforeach.ts | 6 +- 19 files changed, 548 insertions(+), 259 deletions(-) diff --git a/compiler/test/utForPartialUpdate/import/importAllEts.ts b/compiler/test/utForPartialUpdate/import/importAllEts.ts index 7b7837e..baf7ffd 100644 --- a/compiler/test/utForPartialUpdate/import/importAllEts.ts +++ b/compiler/test/utForPartialUpdate/import/importAllEts.ts @@ -94,8 +94,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); const AllComponent = __importStar(require("./test/pages/NamespaceComponent")); const TsModule_1 = __importDefault(require("./test/pages/TsModule")); class ImportTest extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__myState1 = new ObservedPropertyObjectPU(new TsModule_1.default(1).method(), this, "myState1"); this.__myState2 = new ObservedPropertySimplePU(0, this, "myState2"); this.__myState3 = new ObservedPropertySimplePU(false, this, "myState3"); @@ -116,6 +116,8 @@ class ImportTest extends ViewPU { this.myState4 = params.myState4; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__myState1.purgeDependencyOnElmtId(rmElmtId); this.__myState2.purgeDependencyOnElmtId(rmElmtId); @@ -164,61 +166,99 @@ class ImportTest extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new AllComponent.NamespaceComponent1(this, { - NamespaceComponent1Link1: this.__myState1, - NamespaceComponent1Link2: this.__myState2, - NamespaceComponent1Link3: this.__myState3, - NamespaceComponent1Link4: this.__myState4, - myVar: 100, - myVar2: 80 - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new AllComponent.NamespaceComponent1(this, { + NamespaceComponent1Link1: this.__myState1, + NamespaceComponent1Link2: this.__myState2, + NamespaceComponent1Link3: this.__myState3, + NamespaceComponent1Link4: this.__myState4, + myVar: 100, + myVar2: 80 + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + NamespaceComponent1Link1: this.__myState1, + NamespaceComponent1Link2: this.__myState2, + NamespaceComponent1Link3: this.__myState3, + NamespaceComponent1Link4: this.__myState4, + myVar: 100, + myVar2: 80 + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } __Common__.create(); __Common__.width(100); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new AllComponent.NamespaceComponent1(this, { - NamespaceComponent1Link1: this.__myState1, - NamespaceComponent1Link2: this.__myState2, - NamespaceComponent1Link3: this.__myState3, - NamespaceComponent1Link4: this.__myState4, - myVar: 100, - myVar2: 80 - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new AllComponent.NamespaceComponent1(this, { + NamespaceComponent1Link1: this.__myState1, + NamespaceComponent1Link2: this.__myState2, + NamespaceComponent1Link3: this.__myState3, + NamespaceComponent1Link4: this.__myState4, + myVar: 100, + myVar2: 80 + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, 100); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } __Common__.pop(); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new AllComponent.default(this, { - NamespaceComponent3Link1: this.__myState1, - NamespaceComponent3Link2: this.__myState2, - NamespaceComponent3Link3: this.__myState3, - NamespaceComponent3Link4: this.__myState4, - myVar: 100, - myVar2: 80 - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new AllComponent.default(this, { + NamespaceComponent3Link1: this.__myState1, + NamespaceComponent3Link2: this.__myState2, + NamespaceComponent3Link3: this.__myState3, + NamespaceComponent3Link4: this.__myState4, + myVar: 100, + myVar2: 80 + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + NamespaceComponent3Link1: this.__myState1, + NamespaceComponent3Link2: this.__myState2, + NamespaceComponent3Link3: this.__myState3, + NamespaceComponent3Link4: this.__myState4, + myVar: 100, + myVar2: 80 + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } __Common__.create(); __Common__.height(200); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new AllComponent.default(this, { - NamespaceComponent3Link1: this.__myState1, - NamespaceComponent3Link2: this.__myState2, - NamespaceComponent3Link3: this.__myState3, - NamespaceComponent3Link4: this.__myState4, - myVar: 100, - myVar2: 80 - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new AllComponent.default(this, { + NamespaceComponent3Link1: this.__myState1, + NamespaceComponent3Link2: this.__myState2, + NamespaceComponent3Link3: this.__myState3, + NamespaceComponent3Link4: this.__myState4, + myVar: 100, + myVar2: 80 + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, 200); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } __Common__.pop(); Column.pop(); diff --git a/compiler/test/utForPartialUpdate/import/importEts.ts b/compiler/test/utForPartialUpdate/import/importEts.ts index 27d2ed5..807c197 100644 --- a/compiler/test/utForPartialUpdate/import/importEts.ts +++ b/compiler/test/utForPartialUpdate/import/importEts.ts @@ -128,8 +128,8 @@ const DefaultComponent_1 = __importDefault(require("./test/pages/DefaultComponen const AMDComponentDefault = require("./test/pages/AMDComponent"); const TsModule_1 = __importDefault(require("./test/pages/TsModule")); class ImportTest extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__myState1 = new ObservedPropertyObjectPU(new TsModule_1.default(1).method(), this, "myState1"); this.__myState2 = new ObservedPropertySimplePU(0, this, "myState2"); this.__myState3 = new ObservedPropertySimplePU(false, this, "myState3"); @@ -150,6 +150,8 @@ class ImportTest extends ViewPU { this.myState4 = params.myState4; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__myState1.purgeDependencyOnElmtId(rmElmtId); this.__myState2.purgeDependencyOnElmtId(rmElmtId); @@ -198,19 +200,34 @@ class ImportTest extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new LinkComponent_1.LinkComponent2(this, { - LinkComponent2Link1: this.__myState1, - LinkComponent2Link2: this.__myState2, - LinkComponent2Link3: this.__myState3, - LinkComponent2Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'LinkComponent2' - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new LinkComponent_1.LinkComponent2(this, { + LinkComponent2Link1: this.__myState1, + LinkComponent2Link2: this.__myState2, + LinkComponent2Link3: this.__myState3, + LinkComponent2Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent2' + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + LinkComponent2Link1: this.__myState1, + LinkComponent2Link2: this.__myState2, + LinkComponent2Link3: this.__myState3, + LinkComponent2Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent2' + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); @@ -224,75 +241,146 @@ class ImportTest extends ViewPU { }); Text.pop(); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new LinkComponent_1.LinkComponent(this, { - LinkComponent1Link1: this.__myState1, - LinkComponent1Link2: this.__myState2, - LinkComponent1Link3: this.__myState3, - LinkComponent1Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'LinkComponent1' - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new LinkComponent_1.LinkComponent(this, { + LinkComponent1Link1: this.__myState1, + LinkComponent1Link2: this.__myState2, + LinkComponent1Link3: this.__myState3, + LinkComponent1Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent1' + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + LinkComponent1Link1: this.__myState1, + LinkComponent1Link2: this.__myState2, + LinkComponent1Link3: this.__myState3, + LinkComponent1Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent1' + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new DefaultComponent_1.default(this, { - DefaultComponentLink1: this.__myState1, - DefaultComponentLink2: this.__myState2, - DefaultComponentLink3: this.__myState3, - DefaultComponentLink4: this.__myState4, - myVar: 100, - myVar2: 100 - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new DefaultComponent_1.default(this, { + DefaultComponentLink1: this.__myState1, + DefaultComponentLink2: this.__myState2, + DefaultComponentLink3: this.__myState3, + DefaultComponentLink4: this.__myState4, + myVar: 100, + myVar2: 100 + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + DefaultComponentLink1: this.__myState1, + DefaultComponentLink2: this.__myState2, + DefaultComponentLink3: this.__myState3, + DefaultComponentLink4: this.__myState4, + myVar: 100, + myVar2: 100 + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new LinkComponent_1.default(this, { - LinkComponent3Link1: this.__myState1, - LinkComponent3Link2: this.__myState2, - LinkComponent3Link3: this.__myState3, - LinkComponent3Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'LinkComponent3' - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new LinkComponent_1.default(this, { + LinkComponent3Link1: this.__myState1, + LinkComponent3Link2: this.__myState2, + LinkComponent3Link3: this.__myState3, + LinkComponent3Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent3' + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + LinkComponent3Link1: this.__myState1, + LinkComponent3Link2: this.__myState2, + LinkComponent3Link3: this.__myState3, + LinkComponent3Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent3' + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new AMDComponentDefault(this, { - AMDComponentLink1: this.__myState1, - AMDComponentLink2: this.__myState2, - AMDComponentLink3: this.__myState3, - AMDComponentLink4: this.__myState4, - myVar: 100, - myVar2: 100 - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new AMDComponentDefault(this, { + AMDComponentLink1: this.__myState1, + AMDComponentLink2: this.__myState2, + AMDComponentLink3: this.__myState3, + AMDComponentLink4: this.__myState4, + myVar: 100, + myVar2: 100 + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + AMDComponentLink1: this.__myState1, + AMDComponentLink2: this.__myState2, + AMDComponentLink3: this.__myState3, + AMDComponentLink4: this.__myState4, + myVar: 100, + myVar2: 100 + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new LinkComponent_1.LinkComponent3(this, { - LinkComponent3Link1: this.__myState1, - LinkComponent3Link2: this.__myState2, - LinkComponent3Link3: this.__myState3, - LinkComponent3Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'LinkComponent1' - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new LinkComponent_1.LinkComponent3(this, { + LinkComponent3Link1: this.__myState1, + LinkComponent3Link2: this.__myState2, + LinkComponent3Link3: this.__myState3, + LinkComponent3Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent1' + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + LinkComponent3Link1: this.__myState1, + LinkComponent3Link2: this.__myState2, + LinkComponent3Link3: this.__myState3, + LinkComponent3Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'LinkComponent1' + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } Column.pop(); } diff --git a/compiler/test/utForPartialUpdate/import/importExportEts.ts b/compiler/test/utForPartialUpdate/import/importExportEts.ts index e8470fa..4c07fc5 100644 --- a/compiler/test/utForPartialUpdate/import/importExportEts.ts +++ b/compiler/test/utForPartialUpdate/import/importExportEts.ts @@ -61,8 +61,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); const ExportStarComponent_1 = require("./test/pages/ExportStarComponent"); const TsModule_1 = __importDefault(require("./test/pages/TsModule")); class ImportTest extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__myState1 = new ObservedPropertyObjectPU(new TsModule_1.default(1).method(), this, "myState1"); this.__myState2 = new ObservedPropertySimplePU(0, this, "myState2"); this.__myState3 = new ObservedPropertySimplePU(false, this, "myState3"); @@ -83,6 +83,8 @@ class ImportTest extends ViewPU { this.myState4 = params.myState4; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__myState1.purgeDependencyOnElmtId(rmElmtId); this.__myState2.purgeDependencyOnElmtId(rmElmtId); @@ -131,34 +133,64 @@ class ImportTest extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new ExportStarComponent_1.AllStarComponent.ExportComponent(this, { - ExportComponent1Link1: this.__myState1, - ExportComponent1Link2: this.__myState2, - ExportComponent1Link3: this.__myState3, - ExportComponent1Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'ExportComponent1' - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new ExportStarComponent_1.AllStarComponent.ExportComponent(this, { + ExportComponent1Link1: this.__myState1, + ExportComponent1Link2: this.__myState2, + ExportComponent1Link3: this.__myState3, + ExportComponent1Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent1' + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + ExportComponent1Link1: this.__myState1, + ExportComponent1Link2: this.__myState2, + ExportComponent1Link3: this.__myState3, + ExportComponent1Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent1' + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new ExportStarComponent_1.AllStarComponent.default(this, { - ExportComponent4Link1: this.__myState1, - ExportComponent4Link2: this.__myState2, - ExportComponent4Link3: this.__myState3, - ExportComponent4Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'ExportComponent4' - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new ExportStarComponent_1.AllStarComponent.default(this, { + ExportComponent4Link1: this.__myState1, + ExportComponent4Link2: this.__myState2, + ExportComponent4Link3: this.__myState3, + ExportComponent4Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent4' + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + ExportComponent4Link1: this.__myState1, + ExportComponent4Link2: this.__myState2, + ExportComponent4Link3: this.__myState3, + ExportComponent4Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent4' + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } Column.pop(); } diff --git a/compiler/test/utForPartialUpdate/import/importExportNest.ts b/compiler/test/utForPartialUpdate/import/importExportNest.ts index 1378ff0..0480539 100644 --- a/compiler/test/utForPartialUpdate/import/importExportNest.ts +++ b/compiler/test/utForPartialUpdate/import/importExportNest.ts @@ -60,8 +60,8 @@ exports.expectResult = Object.defineProperty(exports, "__esModule", { value: true }); const ImportNestAll_1 = require("./test/pages/ImportNestAll"); class ImportTest extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__testText1 = new ObservedPropertySimplePU('Hello', this, "testText1"); this.__testText2 = new ObservedPropertySimplePU('World', this, "testText2"); this.__testText3 = new ObservedPropertySimplePU('Test', this, "testText3"); @@ -102,6 +102,8 @@ class ImportTest extends ViewPU { this.testState5 = params.testState5; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__testText1.purgeDependencyOnElmtId(rmElmtId); this.__testText2.purgeDependencyOnElmtId(rmElmtId); @@ -230,23 +232,42 @@ class ImportTest extends ViewPU { }); Text.pop(); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new ImportNestAll_1.Base(this, { - testStr: this.__testState1, - testNum: this.__testState2, - testObj: this.__testState3 - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new ImportNestAll_1.Base(this, { + testStr: this.__testState1, + testNum: this.__testState2, + testObj: this.__testState3 + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + testStr: this.__testState1, + testNum: this.__testState2, + testObj: this.__testState3 + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new ImportNestAll_1.DivideTest(this, { - testNum1: this.__testState4, - testNum2: this.__testState5 - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new ImportNestAll_1.DivideTest(this, { + testNum1: this.__testState4, + testNum2: this.__testState5 + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + testNum1: this.__testState4, + testNum2: this.__testState5 + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } Column.pop(); } diff --git a/compiler/test/utForPartialUpdate/import/importTs.ts b/compiler/test/utForPartialUpdate/import/importTs.ts index 3551136..ab4248e 100644 --- a/compiler/test/utForPartialUpdate/import/importTs.ts +++ b/compiler/test/utForPartialUpdate/import/importTs.ts @@ -61,8 +61,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); const ExportStarComponent_1 = require("./test/pages/ExportStarComponent"); const TsModule_1 = __importDefault(require("./test/pages/TsModule")); class ImportTest extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__myState1 = new ObservedPropertyObjectPU(new TsModule_1.default(1).method(), this, "myState1"); this.__myState2 = new ObservedPropertySimplePU(0, this, "myState2"); this.__myState3 = new ObservedPropertySimplePU(false, this, "myState3"); @@ -83,6 +83,8 @@ class ImportTest extends ViewPU { this.myState4 = params.myState4; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__myState1.purgeDependencyOnElmtId(rmElmtId); this.__myState2.purgeDependencyOnElmtId(rmElmtId); @@ -131,34 +133,64 @@ class ImportTest extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new ExportStarComponent_1.AllStarComponent.ExportComponent(this, { - ExportComponent1Link1: this.__myState1, - ExportComponent1Link2: this.__myState2, - ExportComponent1Link3: this.__myState3, - ExportComponent1Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'ExportComponent1' - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new ExportStarComponent_1.AllStarComponent.ExportComponent(this, { + ExportComponent1Link1: this.__myState1, + ExportComponent1Link2: this.__myState2, + ExportComponent1Link3: this.__myState3, + ExportComponent1Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent1' + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + ExportComponent1Link1: this.__myState1, + ExportComponent1Link2: this.__myState2, + ExportComponent1Link3: this.__myState3, + ExportComponent1Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent1' + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new ExportStarComponent_1.AllStarComponent.default(this, { - ExportComponent4Link1: this.__myState1, - ExportComponent4Link2: this.__myState2, - ExportComponent4Link3: this.__myState3, - ExportComponent4Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'ExportComponent4' - })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new ExportStarComponent_1.AllStarComponent.default(this, { + ExportComponent4Link1: this.__myState1, + ExportComponent4Link2: this.__myState2, + ExportComponent4Link3: this.__myState3, + ExportComponent4Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent4' + }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + ExportComponent4Link1: this.__myState1, + ExportComponent4Link2: this.__myState2, + ExportComponent4Link3: this.__myState3, + ExportComponent4Link4: this.__myState4, + indexState1: { count: 1 }, + indexState2: 1, + indexState3: true, + indexState4: 'ExportComponent4' + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } Column.pop(); } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/$$_component/$$_component.ts b/compiler/test/utForPartialUpdate/inner_component_transform/$$_component/$$_component.ts index fa4c40f..bc380dd 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/$$_component/$$_component.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/$$_component/$$_component.ts @@ -80,8 +80,8 @@ const value5 = [true, false]; let value6 = { item1: true }; let isCountDown = false; class HomeComponent extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.value1 = "hello world 1"; this.value2 = "hello world 2"; this.value3 = "hello world 3"; @@ -114,6 +114,8 @@ class HomeComponent extends ViewPU { this.format = params.format; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__format.purgeDependencyOnElmtId(rmElmtId); } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/custom_component/custom_component.ts b/compiler/test/utForPartialUpdate/inner_component_transform/custom_component/custom_component.ts index 598d2a4..fefd1a2 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/custom_component/custom_component.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/custom_component/custom_component.ts @@ -48,12 +48,14 @@ struct Banner { exports.expectResult = `"use strict"; class MyComponent extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { @@ -70,53 +72,89 @@ class MyComponent extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new Banner(this, {})); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new Banner(this, {}, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, {}); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } __Common__.create(); __Common__.width(100); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new Banner(this, {})); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new Banner(this, {}, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, 100); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } __Common__.pop(); __Common__.create(); __Common__.width(100); __Common__.height(200); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new Banner(this, {})); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new Banner(this, {}, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, 200); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } __Common__.pop(); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new Banner(this, { value: "Hello" })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new Banner(this, { value: "Hello" }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { value: "Hello" }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } __Common__.create(); __Common__.width(100); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new Banner(this, { value: "Hello" })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new Banner(this, { value: "Hello" }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, 100); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } __Common__.pop(); __Common__.create(); __Common__.width(100); __Common__.height(200); { - const elmtId = ViewStackProcessor.AllocateNewElmetIdForNextComponent(); - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ViewPU.create(new Banner(this, { value: "Hello" })); - ViewStackProcessor.StopGetAccessRecording(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new Banner(this, { value: "Hello" }, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, 200); + } + ViewStackProcessor.StopGetAccessRecording(); + }); } __Common__.pop(); Column.pop(); @@ -126,8 +164,8 @@ class MyComponent extends ViewPU { } } class Banner extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.value = "Hello"; this.setInitiallyProvidedValue(params); } @@ -136,6 +174,8 @@ class Banner extends ViewPU { this.value = params.value; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/longPressGesture.ts b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/longPressGesture.ts index 7201999..967d429 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/longPressGesture.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/longPressGesture.ts @@ -39,8 +39,8 @@ struct LongPressGestureExample { exports.expectResult = `"use strict"; class LongPressGestureExample extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__count = new ObservedPropertySimplePU(0, this, "count"); this.setInitiallyProvidedValue(params); } @@ -49,6 +49,8 @@ class LongPressGestureExample extends ViewPU { this.count = params.count; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__count.purgeDependencyOnElmtId(rmElmtId); } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/panGestrue.ts b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/panGestrue.ts index ee9870e..771e389 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/panGestrue.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/panGestrue.ts @@ -47,8 +47,8 @@ struct PanGestureExample { exports.expectResult = `"use strict"; class PanGestureExample extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__offsetX = new ObservedPropertySimplePU(0, this, "offsetX"); this.__offsetY = new ObservedPropertySimplePU(0, this, "offsetY"); this.setInitiallyProvidedValue(params); @@ -61,6 +61,8 @@ class PanGestureExample extends ViewPU { this.offsetY = params.offsetY; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__offsetX.purgeDependencyOnElmtId(rmElmtId); this.__offsetY.purgeDependencyOnElmtId(rmElmtId); diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/pinchGesture.ts b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/pinchGesture.ts index 9438267..63a7941 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/pinchGesture.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/pinchGesture.ts @@ -43,8 +43,8 @@ struct PinchGestureExample { exports.expectResult = `"use strict"; class PinchGestureExample extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__scale2 = new ObservedPropertySimplePU(1, this, "scale2"); this.setInitiallyProvidedValue(params); } @@ -53,6 +53,8 @@ class PinchGestureExample extends ViewPU { this.scale2 = params.scale2; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__scale2.purgeDependencyOnElmtId(rmElmtId); } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/rotationGesture.ts b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/rotationGesture.ts index 352ff46..0f5a982 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/rotationGesture.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/rotationGesture.ts @@ -43,8 +43,8 @@ struct RotationGestureExample { exports.expectResult = `"use strict"; class RotationGestureExample extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__angle = new ObservedPropertySimplePU(0, this, "angle"); this.setInitiallyProvidedValue(params); } @@ -53,6 +53,8 @@ class RotationGestureExample extends ViewPU { this.angle = params.angle; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__angle.purgeDependencyOnElmtId(rmElmtId); } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/swipeGesture.ts b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/swipeGesture.ts index 206a910..5e661bd 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/swipeGesture.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/swipeGesture.ts @@ -41,8 +41,8 @@ struct SwipeGestureExample { exports.expectResult = `"use strict"; class SwipeGestureExample extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__rotateAngle = new ObservedPropertySimplePU(0, this, "rotateAngle"); this.__speed = new ObservedPropertySimplePU(1, this, "speed"); this.setInitiallyProvidedValue(params); @@ -55,6 +55,8 @@ class SwipeGestureExample extends ViewPU { this.speed = params.speed; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__rotateAngle.purgeDependencyOnElmtId(rmElmtId); this.__speed.purgeDependencyOnElmtId(rmElmtId); diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/tapGesture.ts b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/tapGesture.ts index afce034..8802fc8 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/tapGesture.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/gesture_component/tapGesture.ts @@ -37,8 +37,8 @@ struct TapGestureExample { exports.expectResult = `"use strict"; class TapGestureExample extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__value = new ObservedPropertySimplePU('', this, "value"); this.setInitiallyProvidedValue(params); } @@ -47,6 +47,8 @@ class TapGestureExample extends ViewPU { this.value = params.value; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__value.purgeDependencyOnElmtId(rmElmtId); } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/forEachTwo.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/forEachTwo.ts index 74307ff..8a4a386 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/forEachTwo.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/forEachTwo.ts @@ -42,8 +42,8 @@ struct Index { exports.expectResult = `"use strict"; class Index extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__WIDTH_AND_HEIGHT = new ObservedPropertyObjectPU([ { w: 10, h: 10 }, { w: 20, h: 20 }, @@ -58,6 +58,8 @@ class Index extends ViewPU { this.WIDTH_AND_HEIGHT = params.WIDTH_AND_HEIGHT; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__WIDTH_AND_HEIGHT.purgeDependencyOnElmtId(rmElmtId); } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts index 4b587fe..3c1de01 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts @@ -106,8 +106,8 @@ struct ParentView5 { exports.expectResult = `"use strict"; class ParentView extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__arr = new ObservedPropertyObjectPU(['1', '2', '3'], this, "arr"); this.setInitiallyProvidedValue(params); } @@ -116,6 +116,8 @@ class ParentView extends ViewPU { this.arr = params.arr; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__arr.purgeDependencyOnElmtId(rmElmtId); } @@ -168,8 +170,8 @@ class ParentView extends ViewPU { } } class ParentView1 extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__arr = new ObservedPropertyObjectPU(['1', '2', '3'], this, "arr"); this.setInitiallyProvidedValue(params); } @@ -178,6 +180,8 @@ class ParentView1 extends ViewPU { this.arr = params.arr; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__arr.purgeDependencyOnElmtId(rmElmtId); } @@ -230,8 +234,8 @@ class ParentView1 extends ViewPU { } } class ParentView2 extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__arr = new ObservedPropertyObjectPU(['1', '2', '3'], this, "arr"); this.setInitiallyProvidedValue(params); } @@ -240,6 +244,8 @@ class ParentView2 extends ViewPU { this.arr = params.arr; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__arr.purgeDependencyOnElmtId(rmElmtId); } @@ -292,8 +298,8 @@ class ParentView2 extends ViewPU { } } class ParentView3 extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__arr = new ObservedPropertyObjectPU(['1', '2', '3'], this, "arr"); this.setInitiallyProvidedValue(params); } @@ -302,6 +308,8 @@ class ParentView3 extends ViewPU { this.arr = params.arr; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__arr.purgeDependencyOnElmtId(rmElmtId); } @@ -354,8 +362,8 @@ class ParentView3 extends ViewPU { } } class ParentView4 extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__arr = new ObservedPropertyObjectPU(['1', '2', '3'], this, "arr"); this.setInitiallyProvidedValue(params); } @@ -364,6 +372,8 @@ class ParentView4 extends ViewPU { this.arr = params.arr; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__arr.purgeDependencyOnElmtId(rmElmtId); } @@ -416,8 +426,8 @@ class ParentView4 extends ViewPU { } } class ParentView5 extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__arr = new ObservedPropertyObjectPU(['1', '2', '3'], this, "arr"); this.setInitiallyProvidedValue(params); } @@ -426,6 +436,8 @@ class ParentView5 extends ViewPU { this.arr = params.arr; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__arr.purgeDependencyOnElmtId(rmElmtId); } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts index a9e777b..ee59966 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/if/if.ts @@ -42,8 +42,8 @@ struct IFView { exports.expectResult = `"use strict"; class IFView extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.__toggle1 = new ObservedPropertySimplePU(false, this, "toggle1"); this.__toggle2 = new ObservedPropertySimplePU(false, this, "toggle2"); this.__toggle3 = new ObservedPropertySimplePU(false, this, "toggle3"); @@ -60,6 +60,8 @@ class IFView extends ViewPU { this.toggle3 = params.toggle3; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__toggle1.purgeDependencyOnElmtId(rmElmtId); this.__toggle2.purgeDependencyOnElmtId(rmElmtId); diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/item/GridItem.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/item/GridItem.ts index 2988c7f..3c148a3 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/item/GridItem.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/item/GridItem.ts @@ -29,12 +29,14 @@ struct ParentView { exports.expectResult = `"use strict"; class ParentView extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/item/ListItem.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/item/ListItem.ts index ae8cbcd..6a612e6 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/item/ListItem.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/item/ListItem.ts @@ -29,12 +29,14 @@ struct ParentView { exports.expectResult = `"use strict"; class ParentView extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/lazyforeach/lazyforeach.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/lazyforeach/lazyforeach.ts index 102dd68..be5c2c3 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/lazyforeach/lazyforeach.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/lazyforeach/lazyforeach.ts @@ -174,8 +174,8 @@ class MyDataSource extends BasicDataSource { } } class Test extends ViewPU { - constructor(parent, params, __localStorage) { - super(parent, __localStorage); + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); this.data = new MyDataSource(); this.setInitiallyProvidedValue(params); } @@ -184,6 +184,8 @@ class Test extends ViewPU { this.data = params.data; } } + updateStateVars(params) { + } purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { -- Gitee From 48c6b068d331d617a4f17f6143537d3c261af15f Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 22 Nov 2022 09:19:51 +0800 Subject: [PATCH 134/379] houhaoyu@huawei.com fix callexpression for Builder Signed-off-by: houhaoyu Change-Id: I2b1f41b077f7dcfc57d207c5d54051eb5803a5df --- compiler/src/process_component_build.ts | 48 +++++++++++++++++++------ 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 5b26f6e..b58c9ac 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1514,16 +1514,23 @@ export function processObjectPropertyBuilder(node: ts.ObjectLiteralExpression): node.properties.forEach((property: ts.PropertyAssignment) => { if (property.name && ts.isIdentifier(property.name) && [CUSTOM_DIALOG_CONTROLLER_BUILDER, HEADER, FOOTER].includes(property.name.escapedText.toString()) && - property.initializer && isPropertyAccessExpressionNode(property.initializer)) { - newProperties.push(ts.factory.updatePropertyAssignment(property, property.name, - ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression( - property.initializer, - ts.factory.createIdentifier(BUILDER_ATTR_BIND) - ), - undefined, - [ts.factory.createThis()] - ))); + property.initializer) { + if (isPropertyAccessExpressionNode(property.initializer)) { + newProperties.push(ts.factory.updatePropertyAssignment(property, property.name, + ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + property.initializer, + ts.factory.createIdentifier(BUILDER_ATTR_BIND) + ), + undefined, + [ts.factory.createThis()] + ))); + } else if (isGlobalBuilderCallExpressionNode(property.initializer) || + isInnerBuilderCallExpressionNode(property.initializer)) { + newProperties.push(transformBuilderCallExpression(property)); + } else { + newProperties.push(property); + } } else { newProperties.push(property); } @@ -1531,6 +1538,27 @@ export function processObjectPropertyBuilder(node: ts.ObjectLiteralExpression): return ts.factory.updateObjectLiteralExpression(node, newProperties); } +function transformBuilderCallExpression(property: ts.PropertyAssignment): ts.PropertyAssignment { + return ts.factory.updatePropertyAssignment(property, property.name, + ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + property.initializer.expression, + ts.factory.createIdentifier(BUILDER_ATTR_BIND) + ), + undefined, + [ts.factory.createThis(), ...(property.initializer.arguments || [])] + )) +} + +function isInnerBuilderCallExpressionNode(node: ts.Node): boolean { + return ts.isCallExpression(node) && node.expression && isPropertyAccessExpressionNode(node.expression); +} + +function isGlobalBuilderCallExpressionNode(node: ts.Node): boolean { + return ts.isCallExpression(node) && node.expression && ts.isIdentifier(node.expression) && + CUSTOM_BUILDER_METHOD.has(node.expression.escapedText.toString()); +} + function isPropertyAccessExpressionNode(node: ts.Node): boolean { return ts.isPropertyAccessExpression(node) && node.expression && node.expression.kind === ts.SyntaxKind.ThisKeyword && node.name && ts.isIdentifier(node.name) && -- Gitee From 8e76f15b011ee246213946029b16249015d93fda Mon Sep 17 00:00:00 2001 From: bojiang Date: Tue, 22 Nov 2022 11:17:23 +0800 Subject: [PATCH 135/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: Ie8549397906cba35e480650cf3f5287b89b929c3 --- compiler/src/process_component_class.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index c0835a7..afb7b6e 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -615,9 +615,7 @@ function addDeleteParamsFunc(statements: ts.PropertyDeclaration[]): ts.MethodDec statements.forEach((statement: ts.PropertyDeclaration) => { const name: ts.Identifier = statement.name as ts.Identifier; let paramsStatement: ts.ExpressionStatement; - if (partialUpdateConfig.partialUpdateMode && !statement.decorators) { - paramsStatement = createParamsStatement(name); - } else { + if (!partialUpdateConfig.partialUpdateMode || statement.decorators) { paramsStatement = createParamsWithUnderlineStatement(name); } deleteStatements.push(paramsStatement); @@ -644,17 +642,6 @@ function addDeleteParamsFunc(statements: ts.PropertyDeclaration[]): ts.MethodDec return deleteParamsMethod; } -function createParamsStatement(name: ts.Identifier): ts.ExpressionStatement { - return ts.factory.createExpressionStatement(ts.factory.createBinaryExpression( - ts.factory.createPropertyAccessExpression( - ts.factory.createThis(), - ts.factory.createIdentifier(`${name.escapedText.toString()}`) - ), - ts.factory.createToken(ts.SyntaxKind.EqualsToken), - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_UNDEFINED) - )); -} - function createParamsWithUnderlineStatement(name: ts.Identifier): ts.ExpressionStatement { return ts.factory.createExpressionStatement( ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression( -- Gitee From 7223636bd73ee773950588c505adafe24d3fec38 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Mon, 21 Nov 2022 13:34:37 +0000 Subject: [PATCH 136/379] Store abc status Signed-off-by: zhangrengao Change-Id: Ie23815994dc01593930be566606ec5ab64b55c4b --- compiler/src/compile_info.ts | 8 ++++++++ compiler/src/gen_abc_plugin.ts | 11 ++++++++++- compiler/src/gen_merged_abc.ts | 3 ++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 95102a9..a402c04 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -366,6 +366,7 @@ export class ResultStates { } private printLogCount(): void { + this.updateCountWithArkCompile(); if (this.mErrorCount + this.warningCount + this.noteCount > 0) { let result: string; let resultInfo: string = ''; @@ -397,10 +398,17 @@ export class ResultStates { this.clearCount(); } + private updateCountWithArkCompile(): void { + if (process.env.abcCompileSuccess === 'false') { + this.mErrorCount += 1; + } + } + private clearCount(): void { this.mErrorCount = 0; this.warningCount = 0; this.noteCount = 0; + process.env.abcCompileSuccess = 'true'; } private printPreviewResult(resultInfo: string = ''): void { diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index e53b862..bfd5c53 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -811,6 +811,10 @@ function invokeWorkersToGenAbc(): void { } filterIntermediateJsBundleByHashJson(buildPathInfo, intermediateJsBundle); + if (fileterIntermediateJsBundle.length === 0) { + processExtraAsset(); + return; + } const splitedBundles: any[] = splitJsBundlesBySize(fileterIntermediateJsBundle, maxWorkerNumber); const workerNumber: number = maxWorkerNumber < splitedBundles.length ? maxWorkerNumber : splitedBundles.length; @@ -1218,6 +1222,10 @@ function mergeProtoToAbc(): void { function generateAbcByEs2AbcOfBundleMode(inputPaths: File[]) { filterIntermediateJsBundleByHashJson(buildPathInfo, inputPaths); + if (fileterIntermediateJsBundle.length === 0) { + processExtraAsset(); + return; + } let filesInfoPath = generateFileOfBundle(fileterIntermediateJsBundle); const fileThreads = os.cpus().length < 16 ? os.cpus().length : 16; let genAbcCmd: string = @@ -1249,7 +1257,8 @@ function generateAbcByEs2AbcOfBundleMode(inputPaths: File[]) { }); } } catch (e) { - logger.debug(red, `ArkTS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); + logger.error(red, `ArkTS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); + process.env.abcCompileSuccess = 'false'; if (process.env.watchMode !== 'true') { process.exit(FAIL); } diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index ac3f5c9..d558567 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -138,7 +138,8 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma }); } } catch (e) { - logger.debug(red, `ArkTS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); + logger.error(red, `ArkTS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); + process.env.abcCompileSuccess = 'false'; if (process.env.watchMode !== 'true') { process.exit(FAIL); } -- Gitee From 7a6067e03232fb332bc68c87435d7c92230cc9dd Mon Sep 17 00:00:00 2001 From: bojiang Date: Mon, 21 Nov 2022 22:35:05 +0800 Subject: [PATCH 137/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I6b5bd93da71e1b483ef326955d90ab93fac1a670 --- compiler/src/process_component_build.ts | 2 +- compiler/src/process_custom_component.ts | 28 ++++++++++++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 5b26f6e..e793991 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -535,7 +535,7 @@ function processInnerCompStatements( } } -function createComponentCreationStatement(node: ts.Statement, innerStatements: ts.Statement[], +export function createComponentCreationStatement(node: ts.Statement, innerStatements: ts.Statement[], isGlobalBuilder: boolean = false): ts.Statement { return ts.factory.createExpressionStatement( ts.factory.createCallExpression( diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index d08615d..d85c312 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -75,7 +75,8 @@ import { } from './utils'; import { bindComponentAttr, - parentConditionalExpression + parentConditionalExpression, + createComponentCreationStatement } from './process_component_build'; import { partialUpdateConfig } from '../main'; @@ -120,10 +121,19 @@ export function processCustomComponent(node: ts.ExpressionStatement, newStatemen } } if (hasChainCall) { - newStatements.push(ts.factory.createExpressionStatement( - createFunction(ts.factory.createIdentifier(COMPONENT_COMMON), + if (partialUpdateConfig.partialUpdateMode) { + const commomComponentNode: ts.Statement[] = [ts.factory.createExpressionStatement( + createFunction(ts.factory.createIdentifier(COMPONENT_COMMON), + ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))]; + bindComponentAttr(node, ts.factory.createIdentifier(COMPONENT_COMMON), commomComponentNode, log); + newStatements.push(createComponentCreationStatement(componentAttributes(), commomComponentNode)); + } else { + newStatements.push(ts.factory.createExpressionStatement( + createFunction(ts.factory.createIdentifier(COMPONENT_COMMON), ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))); - bindComponentAttr(node, ts.factory.createIdentifier(COMPONENT_COMMON), newStatements, log); + bindComponentAttr(node, ts.factory.createIdentifier(COMPONENT_COMMON), newStatements, log); + } + } addCustomComponent(node, newStatements, customComponentNewExpression, log, name, componentNode, isBuilder, isGlobalBuilder); @@ -135,6 +145,16 @@ export function processCustomComponent(node: ts.ExpressionStatement, newStatemen } } +function componentAttributes(): ts.Statement { + return ts.factory.createExpressionStatement( + ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + ts.factory.createIdentifier(COMPONENT_COMMON), + ts.factory.createIdentifier(COMPONENT_POP_FUNCTION) + ), undefined, [] + )); +} + function isHasChild(node: ts.CallExpression): boolean { return node.arguments && node.arguments[0] && ts.isObjectLiteralExpression(node.arguments[0]) && node.arguments[0].properties && node.arguments[0].properties.length > 0; -- Gitee From 36207e1c1a4d76de2a83643d0684fbb63efac4bd Mon Sep 17 00:00:00 2001 From: xiexiyun Date: Tue, 22 Nov 2022 20:31:31 +0800 Subject: [PATCH 138/379] =?UTF-8?q?textInput=E4=BB=A5=E5=8F=8AtextArea=20c?= =?UTF-8?q?ontroller=E7=99=BD=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiexiyun Change-Id: Ib9cf7a72c8fa814a668d62ab3807808fd95e2504 --- compiler/src/component_map.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/component_map.ts b/compiler/src/component_map.ts index a7a0f5b..2ee65cc 100644 --- a/compiler/src/component_map.ts +++ b/compiler/src/component_map.ts @@ -24,7 +24,7 @@ export let COMMON_ATTRS: Set = new Set([]); (function readComponents() { const componentsFile: string = path.join(__dirname, '../components'); const files: string[] = fs.readdirSync(componentsFile); - files.forEach(function(item) { + files.forEach(function (item) { const fPath: string = path.join(componentsFile, item); const json: any = require(fPath); const stat: any = fs.statSync(fPath); @@ -53,7 +53,7 @@ export const forbiddenUseStateType: Set = new Set(['Scroller', 'SwiperSc 'VideoController', 'WebController', 'CustomDialogController', 'SwiperController', 'TabsController', 'CalendarController', 'AbilityController', 'XComponentController', 'CanvasRenderingContext2D', 'CanvasGradient', 'ImageBitmap', 'ImageData', 'Path2D', - 'RenderingContextSettings', 'OffscreenCanvasRenderingContext2D', 'PatternLockController' + 'RenderingContextSettings', 'OffscreenCanvasRenderingContext2D', 'PatternLockController', 'TextAreaController', 'TextInputController' ]); export const INNER_COMPONENT_NAMES: Set = new Set(); -- Gitee From fe454356d050390a47d60e1c68da6f4228b3ae59 Mon Sep 17 00:00:00 2001 From: bojiang Date: Wed, 23 Nov 2022 15:21:50 +0800 Subject: [PATCH 139/379] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ‘最小化更新自定义传参add参数’ Signed-off-by: bojiang Change-Id: I4ec6c9ce046e333472a2bc2769a955da22eb43a6 --- compiler/src/process_component_member.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 163bf8c..d48e76a 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -70,7 +70,8 @@ import { THIS, CREATE_STORAGE_LINK, CREATE_STORAGE_PROP, - ELMTID + ELMTID, + COMPONENT_IF_UNDEFINED } from './pre_define'; import { forbiddenUseStateType, @@ -722,7 +723,7 @@ function addCustomComponentId(node: ts.NewExpression, componentName: string, isBuilder ? parentConditionalExpression() : ts.factory.createThis()); } else { argumentsArray.unshift(isGlobalBuilder ? parentConditionalExpression() : ts.factory.createThis()); - argumentsArray.push(ts.factory.createIdentifier(ELMTID)); + argumentsArray.push(ts.factory.createIdentifier(COMPONENT_IF_UNDEFINED), ts.factory.createIdentifier(ELMTID)); } node = ts.factory.updateNewExpression(node, node.expression, node.typeArguments, argumentsArray); -- Gitee From d3641b645d33160f03a2c6f94d3574da4fed9b2d Mon Sep 17 00:00:00 2001 From: bojiang Date: Wed, 23 Nov 2022 16:12:23 +0800 Subject: [PATCH 140/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I6802db1456580f245202d3cfb0ce63f22b021ef4 --- compiler/src/process_component_member.ts | 5 +- .../utForPartialUpdate/import/importAllEts.ts | 30 ++++++--- .../utForPartialUpdate/import/importEts.ts | 12 ++-- .../import/importExportEts.ts | 4 +- .../import/importExportNest.ts | 4 +- .../utForPartialUpdate/import/importTs.ts | 4 +- .../$$_component/$$_component.ts | 6 -- .../custom_component/custom_component.ts | 61 +++++++++++++------ .../lazyforeach/lazyforeach.ts | 1 - .../render_component/tab/tab.ts | 1 - .../render_decorator/@builder/@builder.ts | 2 - .../@builder/@builderWithComponent.ts | 6 +- .../@builder/@builderWithLinkData.ts | 2 +- .../@builderParam/@builderParam.ts | 9 +-- .../@customDialog/@customDialog.ts | 7 +-- .../render_decorator/@preview/@preview.ts | 3 +- .../@storageLink/@storageLink.ts | 1 - .../@storageProp/@storageProp.ts | 1 - .../appStorage/appStorage.ts | 1 - .../@link/@link.ts | 2 +- .../@objectLink/@objectLink.ts | 3 +- .../@prop/@prop.ts | 2 +- .../@consume_@provide/@consume_@provide.ts | 4 +- .../@observed_@objectLink.ts | 2 +- 24 files changed, 95 insertions(+), 78 deletions(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index d48e76a..163bf8c 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -70,8 +70,7 @@ import { THIS, CREATE_STORAGE_LINK, CREATE_STORAGE_PROP, - ELMTID, - COMPONENT_IF_UNDEFINED + ELMTID } from './pre_define'; import { forbiddenUseStateType, @@ -723,7 +722,7 @@ function addCustomComponentId(node: ts.NewExpression, componentName: string, isBuilder ? parentConditionalExpression() : ts.factory.createThis()); } else { argumentsArray.unshift(isGlobalBuilder ? parentConditionalExpression() : ts.factory.createThis()); - argumentsArray.push(ts.factory.createIdentifier(COMPONENT_IF_UNDEFINED), ts.factory.createIdentifier(ELMTID)); + argumentsArray.push(ts.factory.createIdentifier(ELMTID)); } node = ts.factory.updateNewExpression(node, node.expression, node.typeArguments, argumentsArray); diff --git a/compiler/test/utForPartialUpdate/import/importAllEts.ts b/compiler/test/utForPartialUpdate/import/importAllEts.ts index baf7ffd..b49f8a0 100644 --- a/compiler/test/utForPartialUpdate/import/importAllEts.ts +++ b/compiler/test/utForPartialUpdate/import/importAllEts.ts @@ -176,7 +176,7 @@ class ImportTest extends ViewPU { NamespaceComponent1Link4: this.__myState4, myVar: 100, myVar2: 80 - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { @@ -191,8 +191,15 @@ class ImportTest extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); } - __Common__.create(); - __Common__.width(100); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + __Common__.create(); + __Common__.width(100); + if (!isInitialRender) { + __Common__.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); @@ -204,7 +211,7 @@ class ImportTest extends ViewPU { NamespaceComponent1Link4: this.__myState4, myVar: 100, myVar2: 80 - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, 100); @@ -224,7 +231,7 @@ class ImportTest extends ViewPU { NamespaceComponent3Link4: this.__myState4, myVar: 100, myVar2: 80 - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { @@ -239,8 +246,15 @@ class ImportTest extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); } - __Common__.create(); - __Common__.height(200); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + __Common__.create(); + __Common__.height(200); + if (!isInitialRender) { + __Common__.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); @@ -252,7 +266,7 @@ class ImportTest extends ViewPU { NamespaceComponent3Link4: this.__myState4, myVar: 100, myVar2: 80 - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, 200); diff --git a/compiler/test/utForPartialUpdate/import/importEts.ts b/compiler/test/utForPartialUpdate/import/importEts.ts index 807c197..6b39811 100644 --- a/compiler/test/utForPartialUpdate/import/importEts.ts +++ b/compiler/test/utForPartialUpdate/import/importEts.ts @@ -212,7 +212,7 @@ class ImportTest extends ViewPU { indexState2: 1, indexState3: true, indexState4: 'LinkComponent2' - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { @@ -253,7 +253,7 @@ class ImportTest extends ViewPU { indexState2: 1, indexState3: true, indexState4: 'LinkComponent1' - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { @@ -281,7 +281,7 @@ class ImportTest extends ViewPU { DefaultComponentLink4: this.__myState4, myVar: 100, myVar2: 100 - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { @@ -309,7 +309,7 @@ class ImportTest extends ViewPU { indexState2: 1, indexState3: true, indexState4: 'LinkComponent3' - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { @@ -337,7 +337,7 @@ class ImportTest extends ViewPU { AMDComponentLink4: this.__myState4, myVar: 100, myVar2: 100 - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { @@ -365,7 +365,7 @@ class ImportTest extends ViewPU { indexState2: 1, indexState3: true, indexState4: 'LinkComponent1' - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { diff --git a/compiler/test/utForPartialUpdate/import/importExportEts.ts b/compiler/test/utForPartialUpdate/import/importExportEts.ts index 4c07fc5..311e8c1 100644 --- a/compiler/test/utForPartialUpdate/import/importExportEts.ts +++ b/compiler/test/utForPartialUpdate/import/importExportEts.ts @@ -145,7 +145,7 @@ class ImportTest extends ViewPU { indexState2: 1, indexState3: true, indexState4: 'ExportComponent1' - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { @@ -175,7 +175,7 @@ class ImportTest extends ViewPU { indexState2: 1, indexState3: true, indexState4: 'ExportComponent4' - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { diff --git a/compiler/test/utForPartialUpdate/import/importExportNest.ts b/compiler/test/utForPartialUpdate/import/importExportNest.ts index 0480539..63f19da 100644 --- a/compiler/test/utForPartialUpdate/import/importExportNest.ts +++ b/compiler/test/utForPartialUpdate/import/importExportNest.ts @@ -239,7 +239,7 @@ class ImportTest extends ViewPU { testStr: this.__testState1, testNum: this.__testState2, testObj: this.__testState3 - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { @@ -258,7 +258,7 @@ class ImportTest extends ViewPU { ViewPU.create(new ImportNestAll_1.DivideTest(this, { testNum1: this.__testState4, testNum2: this.__testState5 - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { diff --git a/compiler/test/utForPartialUpdate/import/importTs.ts b/compiler/test/utForPartialUpdate/import/importTs.ts index ab4248e..55e24ea 100644 --- a/compiler/test/utForPartialUpdate/import/importTs.ts +++ b/compiler/test/utForPartialUpdate/import/importTs.ts @@ -145,7 +145,7 @@ class ImportTest extends ViewPU { indexState2: 1, indexState3: true, indexState4: 'ExportComponent1' - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { @@ -175,7 +175,7 @@ class ImportTest extends ViewPU { indexState2: 1, indexState3: true, indexState4: 'ExportComponent4' - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/$$_component/$$_component.ts b/compiler/test/utForPartialUpdate/inner_component_transform/$$_component/$$_component.ts index bc380dd..73a20b7 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/$$_component/$$_component.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/$$_component/$$_component.ts @@ -120,12 +120,6 @@ class HomeComponent extends ViewPU { this.__format.purgeDependencyOnElmtId(rmElmtId); } aboutToBeDeleted() { - this.value1 = undefined; - this.value2 = undefined; - this.value3 = undefined; - this.value4 = undefined; - this.count = undefined; - this.myTimeController = undefined; this.__format.aboutToBeDeleted(); SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/custom_component/custom_component.ts b/compiler/test/utForPartialUpdate/inner_component_transform/custom_component/custom_component.ts index fefd1a2..c9150b2 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/custom_component/custom_component.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/custom_component/custom_component.ts @@ -75,7 +75,7 @@ class MyComponent extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new Banner(this, {}, elmtId)); + ViewPU.create(new Banner(this, {}, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, {}); @@ -83,13 +83,20 @@ class MyComponent extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); } - __Common__.create(); - __Common__.width(100); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + __Common__.create(); + __Common__.width(100); + if (!isInitialRender) { + __Common__.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new Banner(this, {}, elmtId)); + ViewPU.create(new Banner(this, {}, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, 100); @@ -98,14 +105,21 @@ class MyComponent extends ViewPU { }); } __Common__.pop(); - __Common__.create(); - __Common__.width(100); - __Common__.height(200); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + __Common__.create(); + __Common__.width(100); + __Common__.height(200); + if (!isInitialRender) { + __Common__.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new Banner(this, {}, elmtId)); + ViewPU.create(new Banner(this, {}, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, 200); @@ -118,7 +132,7 @@ class MyComponent extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new Banner(this, { value: "Hello" }, elmtId)); + ViewPU.create(new Banner(this, { value: "Hello" }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { value: "Hello" }); @@ -126,13 +140,20 @@ class MyComponent extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); } - __Common__.create(); - __Common__.width(100); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + __Common__.create(); + __Common__.width(100); + if (!isInitialRender) { + __Common__.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new Banner(this, { value: "Hello" }, elmtId)); + ViewPU.create(new Banner(this, { value: "Hello" }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, 100); @@ -141,14 +162,21 @@ class MyComponent extends ViewPU { }); } __Common__.pop(); - __Common__.create(); - __Common__.width(100); - __Common__.height(200); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + __Common__.create(); + __Common__.width(100); + __Common__.height(200); + if (!isInitialRender) { + __Common__.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new Banner(this, { value: "Hello" }, elmtId)); + ViewPU.create(new Banner(this, { value: "Hello" }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, 200); @@ -179,7 +207,6 @@ class Banner extends ViewPU { purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { - this.value = undefined; SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/lazyforeach/lazyforeach.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/lazyforeach/lazyforeach.ts index be5c2c3..1c7a747 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/lazyforeach/lazyforeach.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/lazyforeach/lazyforeach.ts @@ -189,7 +189,6 @@ class Test extends ViewPU { purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { - this.data = undefined; SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/tab/tab.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/tab/tab.ts index e16d50c..750b231 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/tab/tab.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/tab/tab.ts @@ -69,7 +69,6 @@ class TabSimple extends ViewPU { purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { - this.controller = undefined; SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts index 47ab215..0493462 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts @@ -217,8 +217,6 @@ class MyComponent extends ViewPU { this.__hideBar.purgeDependencyOnElmtId(rmElmtId); } aboutToBeDeleted() { - this.arr = undefined; - this.controller = undefined; this.__hideBar.aboutToBeDeleted(); SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts index 2daa6a9..b7b7afd 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts @@ -49,7 +49,7 @@ function myBuilder(parent = undefined) { (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new child(parent ? parent : this, {}, elmtId)); + ViewPU.create(new child(parent ? parent : this, {}, undefined, elmtId)); } else { (parent ? parent : this).updateStateVarsOfChildByElmtId(elmtId, {}); @@ -78,7 +78,7 @@ class Index extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new child(this, {}, elmtId)); + ViewPU.create(new child(this, {}, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, {}); @@ -102,7 +102,7 @@ class Index extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new child(this, {}, elmtId)); + ViewPU.create(new child(this, {}, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, {}); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts index aca166c..8226736 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts @@ -110,7 +110,7 @@ class TestPage extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new TitleComp(this, { title: this.__value }, elmtId)); + ViewPU.create(new TitleComp(this, { title: this.__value }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { title: this.__value }); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts b/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts index 65c6107..98cf502 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts @@ -126,8 +126,6 @@ class CustomContainer extends ViewPU { purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { - this.header = undefined; - this.footer = undefined; SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } @@ -183,7 +181,6 @@ class CustomContainer2 extends ViewPU { purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { - this.header = undefined; SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } @@ -352,7 +349,7 @@ class CustomContainerUser extends ViewPU { specificWithParam("111", "22", this); Column.pop(); } - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { @@ -394,7 +391,7 @@ class CustomContainerUser extends ViewPU { content: this.specificParam, callContent: this.callSpecificParam("callContent1", 'callContent2'), footer: "Footer", - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { @@ -437,7 +434,7 @@ class CustomContainerUser extends ViewPU { this.callSpecificParam("111", '222', this); Column.pop(); } - }, elmtId)); + }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { diff --git a/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts b/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts index cbe7c6e..6668cf0 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts @@ -134,10 +134,6 @@ class DialogExample extends ViewPU { aboutToBeDeleted() { this.__count.aboutToBeDeleted(); this.__isPlaying.aboutToBeDeleted(); - this.controller = undefined; - this.termsToAccept = undefined; - this.action1 = undefined; - this.action2 = undefined; SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } @@ -261,7 +257,7 @@ class CustomDialogUser extends ViewPU { action2: this.existApp, count: this.__countInitValue, isPlaying: this.__playingInitValue - }, elmtId); + }, undefined, elmtId); jsDialog.setController(this.dialogController); ViewPU.create(jsDialog); }, @@ -290,7 +286,6 @@ class CustomDialogUser extends ViewPU { aboutToBeDeleted() { this.__countInitValue.aboutToBeDeleted(); this.__playingInitValue.aboutToBeDeleted(); - this.dialogController = undefined; SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } diff --git a/compiler/test/utForPartialUpdate/render_decorator/@preview/@preview.ts b/compiler/test/utForPartialUpdate/render_decorator/@preview/@preview.ts index c3e5e5a..e04a568 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@preview/@preview.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@preview/@preview.ts @@ -54,7 +54,6 @@ class HomePreviewComponent extends ViewPU { purgeVariableDependenciesOnElmtId(rmElmtId) { } aboutToBeDeleted() { - this.value = undefined; SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } @@ -102,7 +101,7 @@ class HomePreviewComponent_Preview extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new HomePreviewComponent(this, {}, elmtId)); + ViewPU.create(new HomePreviewComponent(this, {}, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, {}); diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts index 9c49c48..3366b8d 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts @@ -71,7 +71,6 @@ class MyComponent extends ViewPU { aboutToBeDeleted() { this.__varA.aboutToBeDeleted(); this.__lang.aboutToBeDeleted(); - this.label = undefined; SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts index 9c49c48..3366b8d 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts @@ -71,7 +71,6 @@ class MyComponent extends ViewPU { aboutToBeDeleted() { this.__varA.aboutToBeDeleted(); this.__lang.aboutToBeDeleted(); - this.label = undefined; SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts index 9c49c48..3366b8d 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts @@ -71,7 +71,6 @@ class MyComponent extends ViewPU { aboutToBeDeleted() { this.__varA.aboutToBeDeleted(); this.__lang.aboutToBeDeleted(); - this.label = undefined; SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts index e8ccd7f..b72c669 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts @@ -114,7 +114,7 @@ class ParentComponent extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new LinkComponent(this, { counter: this.__value }, elmtId)); + ViewPU.create(new LinkComponent(this, { counter: this.__value }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { counter: this.__value }); diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts index c7da5f8..b35c5c4 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts @@ -139,7 +139,6 @@ class Parent extends ViewPU { this.__models.purgeDependencyOnElmtId(rmElmtId); } aboutToBeDeleted() { - this.nextId = undefined; this.__models.aboutToBeDeleted(); SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); @@ -168,7 +167,7 @@ class Parent extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new CustomText(this, { model: item }, elmtId)); + ViewPU.create(new CustomText(this, { model: item }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { model: item }); diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts index b86c1a3..b5a5f00 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts @@ -114,7 +114,7 @@ class ParentComponent extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new PropComponent(this, { counter: this.__value }, elmtId)); + ViewPU.create(new PropComponent(this, { counter: this.__value }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { counter: this.__value }); diff --git a/compiler/test/utForPartialUpdate/ui_state_management/others/@consume_@provide/@consume_@provide.ts b/compiler/test/utForPartialUpdate/ui_state_management/others/@consume_@provide/@consume_@provide.ts index 8e6140a..97f905a 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/others/@consume_@provide/@consume_@provide.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/others/@consume_@provide/@consume_@provide.ts @@ -101,7 +101,7 @@ class CompA extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new CompB(this, {}, elmtId)); + ViewPU.create(new CompB(this, {}, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, {}); @@ -165,7 +165,7 @@ class CompB extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new CompC(this, {}, elmtId)); + ViewPU.create(new CompC(this, {}, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, {}); diff --git a/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts index e57e054..fe62540 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts @@ -177,7 +177,7 @@ class ViewB extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new ViewA(this, { varA: this.varB.a }, elmtId)); + ViewPU.create(new ViewA(this, { varA: this.varB.a }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { varA: this.varB.a }); -- Gitee From 317ebcae712d96ddc1ef6bb88f0623c28f96070e Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 23 Nov 2022 17:54:26 +0800 Subject: [PATCH 141/379] houhaoyu@huawei.com doesn't support extend Signed-off-by: houhaoyu Change-Id: I917a36fb8cc85ee6717d21f19b35caf0b0f714d0 --- compiler/src/process_component_build.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 63b077b..65a2e54 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1798,6 +1798,13 @@ function addComponentAttr(temp: any, node: ts.Identifier, lastStatement: any, parseGesture(temp, propName, statements, log); lastStatement.kind = true; } else if (isExtendFunctionNode(identifierNode, propName)) { + if (newsupplement.isAcceleratePreview) { + log.push({ + type: LogType.ERROR, + message: `Doesn't support Extend function now`, + pos: temp.getStart() + }) + } statements.push(ts.factory.createExpressionStatement(ts.factory.createCallExpression( ts.factory.createIdentifier(`__${identifierNode.escapedText.toString()}__${propName}`), undefined, temp.arguments))); -- Gitee From ca39fb853e92f512f051eee99c8a0fbb5287e9cf Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 23 Nov 2022 17:37:36 +0800 Subject: [PATCH 142/379] houhaoyu@huawei.com fix error count not correct Signed-off-by: houhaoyu Change-Id: Ie8691ae123da29b695620e8f9b9b64a291741290 --- compiler/server/build_pipe_server.js | 2 +- compiler/src/compile_info.ts | 12 ++++++++++-- compiler/src/ets_checker.ts | 10 ++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index 8d1fff6..0cfd471 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -67,7 +67,7 @@ function init(port) { writeFileSync(previewCacheFilePath, ''); rootFileNames.push(previewCacheFilePath); ts.createWatchProgram( - createWatchCompilerHost(rootFileNames, resolveDiagnostic, delayPrintLogCount, true)); + createWatchCompilerHost(rootFileNames, resolveDiagnostic, delayPrintLogCount, ()=>{}, true)); const wss = new WebSocketServer({ port: port, host: '127.0.0.1' diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index a402c04..689b29b 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -97,6 +97,7 @@ let allModifiedFiles: Set = new Set(); export class ResultStates { private mStats: Stats; private mErrorCount: number = 0; + private tsErrorCount: number = 0; private mWarningCount: number = 0; private warningCount: number = 0; private noteCount: number = 0; @@ -215,7 +216,7 @@ export class ResultStates { } globalProgram.watchProgram = ts.createWatchProgram( createWatchCompilerHost(rootFileNames, this.printDiagnostic.bind(this), - this.delayPrintLogCount.bind(this))); + this.delayPrintLogCount.bind(this), this.resetTsErrorCount.bind(this))); } else { let languageService: ts.LanguageService = null; let cacheFile: string = null; @@ -246,6 +247,7 @@ export class ResultStates { comp.removedFiles = comp.removedFiles || []; const watchModifiedFiles: string[] = [...comp.modifiedFiles]; let watchRemovedFiles: string[] = [...comp.removedFiles]; + this.clearCount(); if (watchModifiedFiles.length) { const isTsAndEtsFile: boolean = watchModifiedFiles.some((item: string) => { return /.(ts|ets)$/.test(item); @@ -321,7 +323,7 @@ export class ResultStates { if (process.env.watchMode !== 'true' && !projectConfig.xtsMode) { updateErrorFileCache(diagnostic); } - this.mErrorCount += 1; + this.tsErrorCount += 1; if (diagnostic.file) { const { line, character }: ts.LineAndCharacter = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start!); @@ -333,6 +335,10 @@ export class ResultStates { } } + private resetTsErrorCount(): void { + this.tsErrorCount = 0; + } + private writeUseOSFiles(): void { let info: string = ''; if (!fs.existsSync(projectConfig.aceSoPath)) { @@ -367,6 +373,7 @@ export class ResultStates { private printLogCount(): void { this.updateCountWithArkCompile(); + this.mErrorCount += this.tsErrorCount; if (this.mErrorCount + this.warningCount + this.noteCount > 0) { let result: string; let resultInfo: string = ''; @@ -396,6 +403,7 @@ export class ResultStates { } } this.clearCount(); + this.resetTsErrorCount(); } private updateCountWithArkCompile(): void { diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index ce35dff..4c1d69b 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -222,14 +222,20 @@ function createOrUpdateCache(resolvedModules: ts.ResolvedModuleFull[], containin } export function createWatchCompilerHost(rootFileNames: string[], - reportDiagnostic: ts.DiagnosticReporter, delayPrintLogCount: Function, isPipe: boolean = false -): ts.WatchCompilerHostOfFilesAndCompilerOptions { + reportDiagnostic: ts.DiagnosticReporter, delayPrintLogCount: Function, resetErrorCount: Function, + isPipe: boolean = false): ts.WatchCompilerHostOfFilesAndCompilerOptions { setCompilerOptions(); const createProgram = ts.createSemanticDiagnosticsBuilderProgram; const host = ts.createWatchCompilerHost( [...rootFileNames, ...readDeaclareFiles()], compilerOptions, ts.sys, createProgram, reportDiagnostic, (diagnostic: ts.Diagnostic) => { + if ([6031, 6032].includes(diagnostic.code)) { + if (!isPipe) { + process.env.watchTs = 'start'; + resetErrorCount(); + } + } // End of compilation in watch mode flag. if ([6193, 6194].includes(diagnostic.code)) { if (!isPipe) { -- Gitee From 172e4c979e34e421e85dfcfe6d5c36068c72ca9a Mon Sep 17 00:00:00 2001 From: bojiang Date: Thu, 24 Nov 2022 15:30:35 +0800 Subject: [PATCH 143/379] jiangbo91@huawei.com add updateStateVars for objectLink. Signed-off-by: bojiang Change-Id: I760df048db687019514076de356dac0371177ee6 --- compiler/src/process_component_member.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 163bf8c..ec49cef 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -722,7 +722,7 @@ function addCustomComponentId(node: ts.NewExpression, componentName: string, isBuilder ? parentConditionalExpression() : ts.factory.createThis()); } else { argumentsArray.unshift(isGlobalBuilder ? parentConditionalExpression() : ts.factory.createThis()); - argumentsArray.push(ts.factory.createIdentifier(ELMTID)); + argumentsArray.push(ts.factory.createIdentifier('undefined'), ts.factory.createIdentifier(ELMTID)); } node = ts.factory.updateNewExpression(node, node.expression, node.typeArguments, argumentsArray); -- Gitee From fa086b34f8be3b9bbd2970ce446c3677f01b13ef Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 21 Nov 2022 16:24:16 +0800 Subject: [PATCH 144/379] houhaoyu@huawei.com add hotreload timestamp Signed-off-by: houhaoyu Change-Id: Ic70eefebc4f299a4fa6c22070b7073b284ef0c99 --- compiler/src/compile_info.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 95102a9..9de25c5 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -84,6 +84,11 @@ export interface CacheFileName { error: boolean } +interface hotReloadIncrementalTime { + hotReloadIncrementalStartTime: string; + hotReloadIncrementalEndTime: string; +} + interface NeedUpdateFlag { flag: boolean; } @@ -105,6 +110,10 @@ export class ResultStates { private blue: string = '\u001b[34m'; private reset: string = '\u001b[39m'; private moduleSharePaths: Set = new Set([]); + private hotReloadIncrementalTime: hotReloadIncrementalTime = { + hotReloadIncrementalStartTime: '', + hotReloadIncrementalEndTime: '' + } public apply(compiler: Compiler): void { compiler.hooks.compilation.tap('SourcemapFixer', compilation => { @@ -255,6 +264,7 @@ export class ResultStates { } } if (this.shouldWriteChangedList(watchModifiedFiles, watchRemovedFiles)) { + this.hotReloadIncrementalTime.hotReloadIncrementalStartTime = new Date().toLocaleString(); watchRemovedFiles = watchRemovedFiles.map(file => path.relative(projectConfig.projectPath, file)); allModifiedFiles = new Set([...allModifiedFiles, ...watchModifiedFiles .filter(file => fs.statSync(file).isFile() && hotReloadSupportFiles.has(file)) @@ -405,15 +415,19 @@ export class ResultStates { private printPreviewResult(resultInfo: string = ''): void { const workerNum: number = Object.keys(cluster.workers).length; - const printSuccessInfo = this.printSuccessInfo; const blue: string = this.blue; const reset: string = this.reset; if (workerNum === 0) { - printSuccessInfo(blue, reset, resultInfo); + this.printSuccessInfo(blue, reset, resultInfo); } } private printSuccessInfo(blue: string, reset: string, resultInfo: string): void { + if (projectConfig.hotReload) { + this.hotReloadIncrementalTime.hotReloadIncrementalEndTime = new Date().toLocaleString(); + console.info(blue, 'Incremental build start: ' + this.hotReloadIncrementalTime.hotReloadIncrementalStartTime + +'\n' + 'Incremental build end: ' + this.hotReloadIncrementalTime.hotReloadIncrementalEndTime); + } if (resultInfo.length === 0) { console.info(blue, 'COMPILE RESULT:SUCCESS ', reset); } else { -- Gitee From 68d228cb4461f82c031ec97a98b39965b56957d9 Mon Sep 17 00:00:00 2001 From: bojiang Date: Thu, 24 Nov 2022 11:55:59 +0800 Subject: [PATCH 145/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I09f6b9ee93124bd7ee4e21693edf6d714a5dbc44 --- compiler/main.js | 25 ++++++++++++++++-------- compiler/src/process_custom_component.ts | 3 +-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index d3f9515..83b4f91 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -97,7 +97,6 @@ function loadEntryObj(projectConfig) { const jsonString = fs.readFileSync(projectConfig.manifestFilePath).toString(); manifest = JSON.parse(jsonString); if (manifest && manifest.minPlatformVersion) { - partialUpdateController(manifest.minPlatformVersion); process.env.minPlatformVersion = manifest.minPlatformVersion; } projectConfig.pagesJsonFileName = 'config.json'; @@ -132,8 +131,10 @@ function buildManifest(manifest, aceConfigPath) { try { const moduleConfigJson = JSON.parse(fs.readFileSync(aceConfigPath).toString()); manifest.type = process.env.abilityType; - if (moduleConfigJson && moduleConfigJson.app && moduleConfigJson.app.minAPIVersion) { - partialUpdateController(moduleConfigJson.app.minAPIVersion); + if (moduleConfigJson && moduleConfigJson.module && moduleConfigJson.module.metadata && + moduleConfigJson.app && moduleConfigJson.app.minAPIVersion) { + partialUpdateController(moduleConfigJson.module.metadata, + moduleConfigJson.app.minAPIVersion); } if (moduleConfigJson.module) { manifest.pages = getPages(moduleConfigJson); @@ -506,15 +507,24 @@ function addSDKBuildDependencies(config) { } } -function partialUpdateController(minAPIVersion) { - if (partialUpdateConfig.alwaysClose) { - return; +function isPartialUpdate(metadata) { + if (Array.isArray(metadata) && metadata.length) { + metadata.some(item => { + if (item.name && item.name === 'ArkTSPartialUpdate' && + item.value && item.value === 'true') { + partialUpdateConfig.partialUpdateMode = true; + return true; + } + }); } +} + +function partialUpdateController(metadata, minAPIVersion) { if (projectConfig.isPreview) { return; } if (minAPIVersion >= 9) { - partialUpdateConfig.partialUpdateMode = true; + isPartialUpdate(metadata); } } @@ -524,7 +534,6 @@ const globalProgram = { }; const partialUpdateConfig = { - alwaysClose: true, partialUpdateMode: false }; diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index d85c312..6db75a2 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -130,10 +130,9 @@ export function processCustomComponent(node: ts.ExpressionStatement, newStatemen } else { newStatements.push(ts.factory.createExpressionStatement( createFunction(ts.factory.createIdentifier(COMPONENT_COMMON), - ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))); + ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))); bindComponentAttr(node, ts.factory.createIdentifier(COMPONENT_COMMON), newStatements, log); } - } addCustomComponent(node, newStatements, customComponentNewExpression, log, name, componentNode, isBuilder, isGlobalBuilder); -- Gitee From 11b9204de8da3322c5aca30ecd023a9c6be381b8 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Thu, 24 Nov 2022 20:38:47 +0800 Subject: [PATCH 146/379] houhaoyu@huawei.com @Builder adapt partial update Signed-off-by: houhaoyu Change-Id: Iaaf9720fe064a3444df49a7b193dcae878a3d2a4 --- compiler/src/pre_define.ts | 4 +++- compiler/src/process_component_build.ts | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 54c76db..271ea74 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -357,4 +357,6 @@ export const CARD_ENABLE_COMPONENTS: Set = new Set([ ]); export const CARD_LOG_TYPE_DECORATORS = 1; export const CARD_LOG_TYPE_COMPONENTS = 2; -export const CARD_LOG_TYPE_IMPORT = 3; \ No newline at end of file +export const CARD_LOG_TYPE_IMPORT = 3; + +export const CALL = 'call'; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 65a2e54..8445ed3 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -97,7 +97,8 @@ import { TRUE, FALSE, HEADER, - FOOTER + FOOTER, + CALL } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -1494,7 +1495,9 @@ function isBuilderChangeNode(argument: ts.Node, identifierNode: ts.Identifier, p CUSTOM_BUILDER_METHOD.has(argument.expression.name.getText()) || ts.isIdentifier(argument) && argument.escapedText && CUSTOM_BUILDER_METHOD.has(argument.escapedText.toString()) || ts.isObjectLiteralExpression(argument) && BIND_OBJECT_PROPERTY.get(identifierNode.escapedText.toString()) && - BIND_OBJECT_PROPERTY.get(identifierNode.escapedText.toString()).has(propertyName); + BIND_OBJECT_PROPERTY.get(identifierNode.escapedText.toString()).has(propertyName) || + ts.isCallExpression(argument) && argument.expression && ts.isIdentifier(argument.expression) && + CUSTOM_BUILDER_METHOD.has(argument.expression.escapedText.toString()); } function parseBuilderNode(node: ts.Node): ts.ObjectLiteralExpression { @@ -1670,7 +1673,10 @@ function processIdentifierBuilder(node: ts.Identifier): ts.ObjectLiteralExpressi return ts.factory.createObjectLiteralExpression([ ts.factory.createPropertyAssignment( ts.factory.createIdentifier(BUILDER_ATTR_NAME), - node + ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression(node, ts.factory.createIdentifier(BUILDER_ATTR_BIND)), + undefined, [ts.factory.createThis()] + ) ) ]); } @@ -1687,7 +1693,9 @@ function getParsedBuilderAttrArgumentWithParams(node: ts.CallExpression): undefined, ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), ts.factory.createBlock( - [ts.factory.createExpressionStatement(node)], + [ts.factory.createExpressionStatement(ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression(node.expression, ts.factory.createIdentifier(CALL) + ), undefined, [ts.factory.createThis(), ...node.arguments]))], true ) ) -- Gitee From 7ee54b58f9692eddb0a548e38f9269db44e9eb54 Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Thu, 24 Nov 2022 13:46:59 +0000 Subject: [PATCH 147/379] Adjust gen_abc plugin log level Issue:https://gitee.com/openharmony/developtools_ace_js2bundle/issues/I630Q3 Signed-off-by: chenqy930 Change-Id: Ic631402833e0ae8cbd2039699f07412d991a8aaa --- compiler/src/compile_info.ts | 10 +++------- compiler/src/gen_abc.ts | 30 ++---------------------------- compiler/src/gen_abc_plugin.ts | 15 +++++++-------- compiler/src/gen_merged_abc.ts | 4 ++-- compiler/src/gen_module_abc.ts | 29 +---------------------------- 5 files changed, 15 insertions(+), 73 deletions(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 689b29b..e88c39c 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -372,7 +372,6 @@ export class ResultStates { } private printLogCount(): void { - this.updateCountWithArkCompile(); this.mErrorCount += this.tsErrorCount; if (this.mErrorCount + this.warningCount + this.noteCount > 0) { let result: string; @@ -384,6 +383,9 @@ export class ResultStates { } else { result = 'SUCCESS '; } + if (process.env.abcCompileSuccess === 'false') { + result = 'FAIL '; + } if (this.warningCount > 0) { resultInfo += ` WARN:${this.warningCount}`; } @@ -406,12 +408,6 @@ export class ResultStates { this.resetTsErrorCount(); } - private updateCountWithArkCompile(): void { - if (process.env.abcCompileSuccess === 'false') { - this.mErrorCount += 1; - } - } - private clearCount(): void { this.mErrorCount = 0; this.warningCount = 0; diff --git a/compiler/src/gen_abc.ts b/compiler/src/gen_abc.ts index 9b859a5..cbbb185 100644 --- a/compiler/src/gen_abc.ts +++ b/compiler/src/gen_abc.ts @@ -38,26 +38,7 @@ function js2abcByWorkers(jsonInput: string, cmd: string): Promise { try { childProcess.execSync(singleCmd); } catch (e) { - logger.debug(red, `ArkTS:ERROR Failed to convert file ${input} to abc `, reset); - process.exit(FAIL); - } - } - - return; -} - -function es2abcByWorkers(jsonInput: string, cmd: string): Promise { - const inputPaths: any = JSON.parse(jsonInput); - for (let i = 0; i < inputPaths.length; ++i) { - const input: string = inputPaths[i].path.replace(/\.temp\.js$/, "_.js"); - const cacheOutputPath: string = inputPaths[i].cacheOutputPath; - const cacheAbcFilePath: string = cacheOutputPath.replace(/\.temp\.js$/, ".abc"); - const singleCmd: any = `${cmd} "${cacheOutputPath}" --output "${cacheAbcFilePath}" --source-file "${input}"`; - logger.debug('gen abc cmd is: ', singleCmd, ' ,file size is:', inputPaths[i].size, ' byte'); - try { - childProcess.execSync(singleCmd); - } catch (e) { - logger.debug(red, `ArkTS:ERROR Failed to convert file ${input} to abc `, reset); + logger.debug(red, `ArkTS:ERROR Failed to convert file ${input} to abc. Error message: ${e} `, reset); process.exit(FAIL); } } @@ -69,13 +50,6 @@ logger.debug('worker data is: ', JSON.stringify(process.env)); logger.debug('gen_abc isWorker is: ', cluster.isWorker); if (cluster.isWorker && process.env['inputs'] !== undefined && process.env['cmd'] !== undefined) { logger.debug('==>worker #', cluster.worker.id, 'started!'); - if (process.env.panda === TS2ABC) { - js2abcByWorkers(process.env['inputs'], process.env['cmd']); - } else if (process.env.panda === ES2ABC || process.env.panda === 'undefined' || process.env.panda === undefined) { - es2abcByWorkers(process.env['inputs'], process.env['cmd']); - } else { - logger.debug(red, `ArkTS:ERROR please set panda module`, reset); - process.exit(FAIL); - } + js2abcByWorkers(process.env['inputs'], process.env['cmd']); process.exit(SUCCESS); } diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 14a8849..094f55c 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -521,7 +521,7 @@ function processEntryToGenAbc(entryInfos: Map): void { try { childProcess.execSync(singleCmd); } catch (e) { - logger.debug(red, `ArkTS:ERROR Failed to generate npm proto file to abc`, reset); + logger.debug(red, `ArkTS:ERROR Failed to generate npm proto file to abc, Error message: ${e}`, reset); } } @@ -1119,14 +1119,14 @@ function processExtraAsset() { function handleHotReloadChangedFiles() { if (!fs.existsSync(projectConfig.changedFileList)) { - logger.info(blue, `ArkTS: Cannot find file: ${projectConfig.changedFileList}, skip hot reload build`, reset); + logger.debug(blue, `ArkTS: Cannot find file: ${projectConfig.changedFileList}, skip hot reload build`, reset); return; } let changedFileListJson: string = fs.readFileSync(projectConfig.changedFileList).toString(); let changedFileList: Array = JSON.parse(changedFileListJson).modifiedFiles; if (typeof(changedFileList) == "undefined" || changedFileList.length == 0) { - logger.info(blue, `ArkTS: No changed files found, skip hot reload build`, reset); + logger.debug(blue, `ArkTS: No changed files found, skip hot reload build`, reset); return; } @@ -1217,13 +1217,12 @@ function mergeProtoToAbc(): void { } else if (isMac) { mergeAbc = path.join(arkDir, 'build-mac', 'bin', 'merge_abc'); } - let mergeAbcName = "modules.abc"; mkdirsSync(projectConfig.buildPath); - const singleCmd: any = `"${mergeAbc}" --input "@${protoFilePath}" --outputFilePath "${projectConfig.buildPath}" --output ${mergeAbcName} --suffix protoBin`; + const singleCmd: any = `"${mergeAbc}" --input "@${protoFilePath}" --outputFilePath "${projectConfig.buildPath}" --output ${MODULES_ABC} --suffix protoBin`; try { childProcess.execSync(singleCmd); } catch (e) { - logger.debug(red, `ArkTS:ERROR Failed to merge proto file to abc`, reset); + logger.debug(red, `ArkTS:ERROR Failed to merge proto file to abc. Error message: ${e}`, reset); } } @@ -1260,11 +1259,11 @@ function generateAbcByEs2AbcOfBundleMode(inputPaths: File[]) { }); child.stderr.on('data', (data: any) => { - logger.debug(red, data.toString(), reset); + logger.error(red, data.toString(), reset); }); } } catch (e) { - logger.error(red, `ArkTS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); + logger.debug(red, `ArkTS:ERROR failed to generate abc with filesInfo ${filesInfoPath}. Error message: ${e} `, reset); process.env.abcCompileSuccess = 'false'; if (process.env.watchMode !== 'true') { process.exit(FAIL); diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index d558567..4828779 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -133,12 +133,12 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma data.split(os.EOL).filter(line => line.includes("[Patch]") || line.includes("Error:")); logger.error(red, patchErr.join(os.EOL), reset); } else { - logger.debug(red, data.toString(), reset); + logger.error(red, data.toString(), reset); } }); } } catch (e) { - logger.error(red, `ArkTS:ERROR failed to generate abc with filesInfo ${filesInfoPath} `, reset); + logger.debug(red, `ArkTS:ERROR failed to generate abc with filesInfo ${filesInfoPath}. Error message: ${e}`, reset); process.env.abcCompileSuccess = 'false'; if (process.env.watchMode !== 'true') { process.exit(FAIL); diff --git a/compiler/src/gen_module_abc.ts b/compiler/src/gen_module_abc.ts index 4e671e9..2d2b2c8 100644 --- a/compiler/src/gen_module_abc.ts +++ b/compiler/src/gen_module_abc.ts @@ -58,38 +58,11 @@ function js2abcByWorkers(jsonInput: string, cmd: string, workerFileName: string) return; } -function es2abcByWorkers(jsonInput: string, cmd: string): Promise { - const inputPaths: any = JSON.parse(jsonInput); - for (let i = 0; i < inputPaths.length; ++i) { - const input: string = inputPaths[i].tempFilePath; - const abcFile: string = input.replace(/\.js$/, '.abc'); - const singleCmd: any = `${cmd} "${input}" --output "${abcFile}" --source-file "${input}"`; - logger.debug('gen abc cmd is: ', singleCmd); - try { - childProcess.execSync(singleCmd); - } catch (e) { - logger.debug(red, `ArkTS:ERROR Failed to convert file ${input} to abc `, reset); - process.exit(FAIL); - } - } - - return; -} - - logger.debug('worker data is: ', JSON.stringify(process.env)); logger.debug('gen_abc isWorker is: ', cluster.isWorker); if (cluster.isWorker && process.env['inputs'] !== undefined && process.env['cmd'] !== undefined && process.env['workerFileName'] !== undefined) { logger.debug('==>worker #', cluster.worker.id, 'started!'); - - if (process.env.panda === TS2ABC) { - js2abcByWorkers(process.env['inputs'], process.env['cmd'], process.env['workerFileName']); - } else if (process.env.panda === ES2ABC || process.env.panda === 'undefined' || process.env.panda === undefined) { - es2abcByWorkers(process.env['inputs'], process.env['cmd']); - } else { - logger.error(red, `ArkTS:ERROR please set panda module`, reset); - process.exit(FAIL); - } + js2abcByWorkers(process.env['inputs'], process.env['cmd'], process.env['workerFileName']); process.exit(SUCCESS); } -- Gitee From 0000798270ba921418742ccf1f3d8597c6b4d4a2 Mon Sep 17 00:00:00 2001 From: bojiang Date: Sat, 26 Nov 2022 10:04:23 +0800 Subject: [PATCH 148/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: Ie18e8aeeac67766d183d89de3628a6c6e0707dc7 --- compiler/src/process_component_constructor.ts | 2 +- compiler/test/ut/ui_state_management/others/@watch/@watch.ts | 2 +- .../ui_state_management/others/@watch/@watch.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/src/process_component_constructor.ts b/compiler/src/process_component_constructor.ts index 7db8179..2bec20d 100644 --- a/compiler/src/process_component_constructor.ts +++ b/compiler/src/process_component_constructor.ts @@ -179,7 +179,7 @@ export function addConstructor(ctorNode: any, watchMap: Map, const callSuperStatement: ts.Statement = createCallSuperStatement(localStorageNum); const updateWithValueParamsStatement: ts.Statement = createUPdWithValStatement(); return updateConstructor(updateConstructor(ctorNode, [], [callSuperStatement], true), [], - [...watchStatements, updateWithValueParamsStatement], false, true, parentComponentName); + [updateWithValueParamsStatement, ...watchStatements], false, true, parentComponentName); } function createCallSuperStatement(localStorageNum: number): ts.Statement { diff --git a/compiler/test/ut/ui_state_management/others/@watch/@watch.ts b/compiler/test/ut/ui_state_management/others/@watch/@watch.ts index 7d246a6..3598c0b 100644 --- a/compiler/test/ut/ui_state_management/others/@watch/@watch.ts +++ b/compiler/test/ut/ui_state_management/others/@watch/@watch.ts @@ -77,9 +77,9 @@ class CompA extends View { this.__totalPurchase = new ObservedPropertySimple(0, this, "totalPurchase"); this.__defArray = new ObservedPropertyObject(['c', 'g', 't', 'z'], this, "defArray"); this.__resultTip = new ObservedPropertySimple('', this, "resultTip"); + this.updateWithValueParams(params); this.declareWatch("shopBasket", this.onBasketUpdated); this.declareWatch("defArray", this.onPutItem); - this.updateWithValueParams(params); } updateWithValueParams(params) { if (params.shopBasket !== undefined) { diff --git a/compiler/test/utForPartialUpdate/ui_state_management/others/@watch/@watch.ts b/compiler/test/utForPartialUpdate/ui_state_management/others/@watch/@watch.ts index 4ed0ce7..cbbe23c 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/others/@watch/@watch.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/others/@watch/@watch.ts @@ -73,9 +73,9 @@ class CompA extends ViewPU { this.__totalPurchase = new ObservedPropertySimplePU(0, this, "totalPurchase"); this.__defArray = new ObservedPropertyObjectPU(['c', 'g', 't', 'z'], this, "defArray"); this.__resultTip = new ObservedPropertySimplePU('', this, "resultTip"); + this.setInitiallyProvidedValue(params); this.declareWatch("shopBasket", this.onBasketUpdated); this.declareWatch("defArray", this.onPutItem); - this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { if (params.shopBasket !== undefined) { -- Gitee From 41bb3240478969a5bbd54958980ae82e1b55b5c0 Mon Sep 17 00:00:00 2001 From: lihong Date: Sun, 27 Nov 2022 15:22:58 +0800 Subject: [PATCH 149/379] lihong67@huawei.com fix customDialog id update. Signed-off-by: lihong Change-Id: Ideacaf720cdfc7a8bd9d338ff85e98984b1cbf02 --- compiler/src/process_component_member.ts | 12 ++++++++---- compiler/src/process_ui_syntax.ts | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index ec49cef..03e3346 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -693,14 +693,16 @@ export function createViewCreate(node: ts.NewExpression | ts.Identifier): ts.Cal } export function createCustomComponentNewExpression(node: ts.CallExpression, name: string, - isBuilder: boolean = false, isGlobalBuilder: boolean = false): ts.NewExpression { + isBuilder: boolean = false, isGlobalBuilder: boolean = false, + isCutomDialog: boolean = false): ts.NewExpression { const newNode: ts.NewExpression = ts.factory.createNewExpression(node.expression, node.typeArguments, node.arguments.length ? node.arguments : []); - return addCustomComponentId(newNode, name, isBuilder, isGlobalBuilder); + return addCustomComponentId(newNode, name, isBuilder, isGlobalBuilder, isCutomDialog); } function addCustomComponentId(node: ts.NewExpression, componentName: string, - isBuilder: boolean = false, isGlobalBuilder: boolean = false): ts.NewExpression { + isBuilder: boolean = false, isGlobalBuilder: boolean = false, + isCutomDialog: boolean = false): ts.NewExpression { for (const item of componentCollection.customComponents) { componentInfo.componentNames.add(item); } @@ -722,7 +724,9 @@ function addCustomComponentId(node: ts.NewExpression, componentName: string, isBuilder ? parentConditionalExpression() : ts.factory.createThis()); } else { argumentsArray.unshift(isGlobalBuilder ? parentConditionalExpression() : ts.factory.createThis()); - argumentsArray.push(ts.factory.createIdentifier('undefined'), ts.factory.createIdentifier(ELMTID)); + if (!isCutomDialog) { + argumentsArray.push(ts.factory.createIdentifier('undefined'), ts.factory.createIdentifier(ELMTID)); + } } node = ts.factory.updateNewExpression(node, node.expression, node.typeArguments, argumentsArray); diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 11d7b0d..83e3cd4 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -306,7 +306,7 @@ function processCustomDialogControllerPropertyAssignment(parent: ts.Expression, function processCustomDialogControllerBuilder(parent: ts.Expression, node: ts.CallExpression, componentName: string): ts.ArrowFunction { - const newExp: ts.Expression = createCustomComponentNewExpression(node, componentName); + const newExp: ts.Expression = createCustomComponentNewExpression(node, componentName, false, false, true); const jsDialog: ts.Identifier = ts.factory.createIdentifier(JS_DIALOG); return createCustomComponentBuilderArrowFunction(parent, jsDialog, newExp); } -- Gitee From df65e2db04ee4376aa712bdcf19a7728eb9a7d52 Mon Sep 17 00:00:00 2001 From: bojiang Date: Fri, 25 Nov 2022 17:00:45 +0800 Subject: [PATCH 150/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: Ia9c154305dc8639c6dda164d240134e94e1bd92e --- compiler/main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/main.js b/compiler/main.js index 83b4f91..eab7102 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -513,8 +513,13 @@ function isPartialUpdate(metadata) { if (item.name && item.name === 'ArkTSPartialUpdate' && item.value && item.value === 'true') { partialUpdateConfig.partialUpdateMode = true; - return true; } + if (item.name && item.name === 'partialUpdateStrictCheck' && + item.value && item.value === 'true') { + partialUpdateConfig.strictCheck = true; + } + return partialUpdateConfig.partialUpdateMode && + partialUpdateConfig.strictCheck; }); } } @@ -534,6 +539,7 @@ const globalProgram = { }; const partialUpdateConfig = { + strictCheck: false, partialUpdateMode: false }; -- Gitee From b3a810d93f1ebeaec8dd74d00301ebc623b9df4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Sun, 27 Nov 2022 14:39:53 +0800 Subject: [PATCH 151/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_build.ts | 38 ++++++++++++++++++++++++- compiler/src/validate_ui_syntax.ts | 28 ++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 8445ed3..37d3041 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -120,7 +120,8 @@ import { import { componentCollection, builderParamObjectCollection, - checkAllNode + checkAllNode, + getObservedPropertyCollection } from './validate_ui_syntax'; import { processCustomComponent, @@ -1198,6 +1199,7 @@ function createRenderingInProgress(isTrue: boolean): ts.ExpressionStatement { function processIfStatement(node: ts.IfStatement, newStatements: ts.Statement[], log: LogInfo[], isBuilder: boolean = false, isGlobalBuilder: boolean = false): void { + checkHasThisKeyword(node, log); const ifCreate: ts.ExpressionStatement = createIfCreate(); const newIfNode: ts.IfStatement = processInnerIfStatement(node, 0, log, isBuilder, isGlobalBuilder); const ifPop: ts.ExpressionStatement = createIfPop(); @@ -1259,6 +1261,7 @@ function processThenStatement(thenStatement: ts.Statement, id: number, function processElseStatement(elseStatement: ts.Statement, id: number, log: LogInfo[], isBuilder: boolean = false, isGlobalBuilder: boolean = false): ts.Statement { + checkHasThisKeyword(elseStatement, log); if (elseStatement) { if (ts.isBlock(elseStatement)) { elseStatement = processIfBlock(elseStatement, id + 1, log); @@ -1288,6 +1291,39 @@ function processElseStatement(elseStatement: ts.Statement, id: number, return elseStatement; } +function checkHasThisKeyword(node: ts.Statement, log: LogInfo[]): void { + if (partialUpdateConfig.partialUpdateMode && node && node.getText() && + node.getText().indexOf(THIS) >= 0) { + const currentObservedPropertyCollection: Set = getObservedPropertyCollection( + componentCollection.currentClassName); + let hasObservedKeyword: boolean = false; + const realKeywords: Set = new Set(); + const traverse: Function = (node: ts.Node) => { + if (node && ts.isPropertyAccessExpression(node) && node.expression && + node.expression.kind === ts.SyntaxKind.ThisKeyword) { + const keyword: string = node.expression.escapedText.toString(); + if (currentObservedPropertyCollection.has(keyword)) { + hasObservedKeyword = true; + return; + } else { + realKeywords.add(keyword); + } + } + if (node) { + ts.forEachChild(node, node => traverse(node)); + } + } + traverse(node); + if (!hasObservedKeyword && node && realKeywords.size > 0) { + log.push({ + type: LogType.WARN, + message: `Only state variables can be used for condition judgment of the IF component.`, + pos: node.getStart() || node.pos + }); + } + } +} + function processIfBlock(block: ts.Block, id: number, log: LogInfo[], isBuilder: boolean = false, isGlobalBuilder: boolean = false): ts.Block { return addIfBranchId(id, diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 42e028c..fe55e09 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -145,6 +145,8 @@ export const useOSFiles: Set = new Set(); export const sourcemapNamesCollection: Map> = new Map(); export const originalImportNamesMap: Map = new Map(); +const observedProperthCollection: Map> = new Map(); + export function validateUISyntax(source: string, content: string, filePath: string, fileQuery: string): LogInfo[] { let log: LogInfo[] = []; @@ -1116,3 +1118,29 @@ function validateStateVariable(node: ts.MethodDeclaration): void { } } } + +export function getObservedPropertyCollection(className: string): Set { + if (observedProperthCollection.get(className)) { + return observedProperthCollection.get(className); + } else { + observedProperthCollection.set(className, new Set([ + ...stateCollection.get(className), + ...linkCollection.get(className), + ...propCollection.get(className), + ...storageLinkCollection.get(className), + ...storageLinkCollection.get(className), + ...provideCollection.get(className), + ...consumeCollection.get(className), + ...objectLinkCollection.get(className), + ])); + for(const key of + localStorageLinkCollection.get(className).keys()){ + observedProperthCollection.get(className).add(key); + } + for(const key of + localStoragePropCollection.get(className).keys()){ + observedProperthCollection.get(className).add(key); + } + return observedProperthCollection.get(className); + } +} -- Gitee From d765074889ae8fcf57a00f46b0eb2d299dff3d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Sun, 27 Nov 2022 17:27:48 +0800 Subject: [PATCH 152/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_member.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index ec49cef..4067dc8 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -80,7 +80,8 @@ import { observedClassCollection, enumCollection, componentCollection, - classMethodCollection + classMethodCollection, + stateCollection } from './validate_ui_syntax'; import { updateConstructor } from './process_component_constructor'; import { @@ -838,6 +839,14 @@ export function isSimpleType(typeNode: ts.TypeNode, program: ts.Program, log?: L } return true; } + if (stateCollection.has(typeNode.getText().toString()) && + typeNode.kind === ts.SyntaxKind.AnyKeyword && log) { + log.push({ + type: LogType.WARN, + message: `Please define an explicit type, not any.`, + pos: typeNode.getStart() + }); + } return false; } -- Gitee From 4092760405634bef580cfaad112a3f559467b7ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Sun, 27 Nov 2022 10:51:02 +0000 Subject: [PATCH 153/379] update compiler/src/process_component_build.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 37d3041..41be360 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1292,7 +1292,7 @@ function processElseStatement(elseStatement: ts.Statement, id: number, } function checkHasThisKeyword(node: ts.Statement, log: LogInfo[]): void { - if (partialUpdateConfig.partialUpdateMode && node && node.getText() && + if (partialUpdateConfig.strictCheck && node && node.getText() && node.getText().indexOf(THIS) >= 0) { const currentObservedPropertyCollection: Set = getObservedPropertyCollection( componentCollection.currentClassName); -- Gitee From 275705001e34f6973f774ed45a7d3bedf36a76bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 28 Nov 2022 01:10:17 +0000 Subject: [PATCH 154/379] update compiler/src/process_component_member.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_member.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 4067dc8..140fe88 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -842,7 +842,7 @@ export function isSimpleType(typeNode: ts.TypeNode, program: ts.Program, log?: L if (stateCollection.has(typeNode.getText().toString()) && typeNode.kind === ts.SyntaxKind.AnyKeyword && log) { log.push({ - type: LogType.WARN, + type: LogType.ERROR, message: `Please define an explicit type, not any.`, pos: typeNode.getStart() }); -- Gitee From 2df463f3113912bc1151fb855c8e6ee1bf21f9bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 28 Nov 2022 02:56:58 +0000 Subject: [PATCH 155/379] update compiler/src/process_component_member.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_member.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 140fe88..2017531 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -839,7 +839,8 @@ export function isSimpleType(typeNode: ts.TypeNode, program: ts.Program, log?: L } return true; } - if (stateCollection.has(typeNode.getText().toString()) && + if (typeNode.parent && typeNode.parent.escapedText && + stateCollection.has(typeNode.parent.escapedText.toString()) && typeNode.kind === ts.SyntaxKind.AnyKeyword && log) { log.push({ type: LogType.ERROR, -- Gitee From ce4d54a86f5df24ffbc367d4e9ead81e37474a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 28 Nov 2022 02:58:28 +0000 Subject: [PATCH 156/379] update compiler/src/process_component_build.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_build.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 41be360..aceb7ea 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1292,8 +1292,8 @@ function processElseStatement(elseStatement: ts.Statement, id: number, } function checkHasThisKeyword(node: ts.Statement, log: LogInfo[]): void { - if (partialUpdateConfig.strictCheck && node && node.getText() && - node.getText().indexOf(THIS) >= 0) { + if (partialUpdateConfig.strictCheck && partialUpdateConfig.partialUpdateMode && + node && node.getText() && node.getText().indexOf(THIS) >= 0) { const currentObservedPropertyCollection: Set = getObservedPropertyCollection( componentCollection.currentClassName); let hasObservedKeyword: boolean = false; -- Gitee From 64fa9d3513e83b203e2590536a4ddab0161f559c Mon Sep 17 00:00:00 2001 From: yfwang6 Date: Mon, 28 Nov 2022 15:13:26 +0800 Subject: [PATCH 157/379] wangyongfei6@huawei.com modify ut for @builder bind this Signed-off-by: yfwang6 Change-Id: I9bf0d3f9ac14c4fd3e8a7402985c56daaab30509 --- compiler/test/ut/render_decorator/@builder/@builder.ts | 4 ++-- .../utForPartialUpdate/render_decorator/@builder/@builder.ts | 4 ++-- .../render_decorator/@customDialog/@customDialog.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/test/ut/render_decorator/@builder/@builder.ts b/compiler/test/ut/render_decorator/@builder/@builder.ts index 39bce30..d6e2abf 100644 --- a/compiler/test/ut/render_decorator/@builder/@builder.ts +++ b/compiler/test/ut/render_decorator/@builder/@builder.ts @@ -221,7 +221,7 @@ class MyComponent extends View { Row.create(); Row.padding(10); Row.bindMenu({ builder: () => { - this.NavigationTitlePara("111"); + this.NavigationTitlePara.call(this, "111"); } }); Text.create("Drag Me"); Text.onDragStart((event, extraParams) => { @@ -252,7 +252,7 @@ class MyComponent extends View { Row.create(); Row.padding(10); Navigation.create(); - Navigation.title({ builder: noParam }); + Navigation.title({ builder: noParam.bind(this) }); Navigation.menus({ builder: this.textBuilder.bind(this) }); Navigation.toolBar({ items: [ { value: 'app', text: 'Grid', action: () => { diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts index 0493462..ff93496 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts @@ -316,7 +316,7 @@ class MyComponent extends ViewPU { Row.create(); Row.padding(10); Row.bindMenu({ builder: () => { - this.NavigationTitlePara("111"); + this.NavigationTitlePara.call(this, "111"); } }); if (!isInitialRender) { Row.pop(); @@ -396,7 +396,7 @@ class MyComponent extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Navigation.create(); - Navigation.title({ builder: noParam }); + Navigation.title({ builder: noParam.bind(this) }); Navigation.menus({ builder: this.textBuilder.bind(this) }); Navigation.toolBar({ items: [ { value: 'app', text: 'Grid', action: () => { diff --git a/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts b/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts index 6668cf0..8e84f4a 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts @@ -257,7 +257,7 @@ class CustomDialogUser extends ViewPU { action2: this.existApp, count: this.__countInitValue, isPlaying: this.__playingInitValue - }, undefined, elmtId); + }); jsDialog.setController(this.dialogController); ViewPU.create(jsDialog); }, -- Gitee From 0b0cbfbc1ffa9b1a67d49bcd8ac346bab7a74751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 28 Nov 2022 07:50:17 +0000 Subject: [PATCH 158/379] update compiler/src/validate_ui_syntax.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/validate_ui_syntax.ts | 42 +++++++++++++----------------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index fe55e09..a0308e1 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -145,8 +145,6 @@ export const useOSFiles: Set = new Set(); export const sourcemapNamesCollection: Map> = new Map(); export const originalImportNamesMap: Map = new Map(); -const observedProperthCollection: Map> = new Map(); - export function validateUISyntax(source: string, content: string, filePath: string, fileQuery: string): LogInfo[] { let log: LogInfo[] = []; @@ -1120,27 +1118,23 @@ function validateStateVariable(node: ts.MethodDeclaration): void { } export function getObservedPropertyCollection(className: string): Set { - if (observedProperthCollection.get(className)) { - return observedProperthCollection.get(className); - } else { - observedProperthCollection.set(className, new Set([ - ...stateCollection.get(className), - ...linkCollection.get(className), - ...propCollection.get(className), - ...storageLinkCollection.get(className), - ...storageLinkCollection.get(className), - ...provideCollection.get(className), - ...consumeCollection.get(className), - ...objectLinkCollection.get(className), - ])); - for(const key of - localStorageLinkCollection.get(className).keys()){ - observedProperthCollection.get(className).add(key); - } - for(const key of - localStoragePropCollection.get(className).keys()){ - observedProperthCollection.get(className).add(key); - } - return observedProperthCollection.get(className); + const observedProperthCollection: Set = new Set([ + ...stateCollection.get(className), + ...linkCollection.get(className), + ...propCollection.get(className), + ...storageLinkCollection.get(className), + ...storageLinkCollection.get(className), + ...provideCollection.get(className), + ...consumeCollection.get(className), + ...objectLinkCollection.get(className), + ]) + for(const key of + localStorageLinkCollection.get(className).keys()){ + observedProperthCollection.add(key); + } + for(const key of + localStoragePropCollection.get(className).keys()){ + observedProperthCollection.add(key); } + return observedProperthCollection; } -- Gitee From 4088f545f70294300c15d1eccce5e042a3fe3bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 28 Nov 2022 07:50:55 +0000 Subject: [PATCH 159/379] update compiler/src/validate_ui_syntax.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/validate_ui_syntax.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index a0308e1..9a29a65 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -1128,12 +1128,10 @@ export function getObservedPropertyCollection(className: string): Set { ...consumeCollection.get(className), ...objectLinkCollection.get(className), ]) - for(const key of - localStorageLinkCollection.get(className).keys()){ + for(const key of localStorageLinkCollection.get(className).keys()){ observedProperthCollection.add(key); } - for(const key of - localStoragePropCollection.get(className).keys()){ + for(const key of localStoragePropCollection.get(className).keys()){ observedProperthCollection.add(key); } return observedProperthCollection; -- Gitee From 423cf7e14d9676e9a5f0d5499b66af30b97da2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 28 Nov 2022 07:54:23 +0000 Subject: [PATCH 160/379] update compiler/src/process_component_build.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index aceb7ea..014aacc 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1301,7 +1301,7 @@ function checkHasThisKeyword(node: ts.Statement, log: LogInfo[]): void { const traverse: Function = (node: ts.Node) => { if (node && ts.isPropertyAccessExpression(node) && node.expression && node.expression.kind === ts.SyntaxKind.ThisKeyword) { - const keyword: string = node.expression.escapedText.toString(); + const keyword: string = node.name.escapedText.toString(); if (currentObservedPropertyCollection.has(keyword)) { hasObservedKeyword = true; return; -- Gitee From fdd3c95c6ca240b665da24d8838dead1677f5810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 28 Nov 2022 07:59:21 +0000 Subject: [PATCH 161/379] update compiler/src/validate_ui_syntax.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/validate_ui_syntax.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 9a29a65..cae3962 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -1127,7 +1127,7 @@ export function getObservedPropertyCollection(className: string): Set { ...provideCollection.get(className), ...consumeCollection.get(className), ...objectLinkCollection.get(className), - ]) + ]); for(const key of localStorageLinkCollection.get(className).keys()){ observedProperthCollection.add(key); } -- Gitee From 0b8b76edb70228f24e150ff858fc65b5b064b9a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 28 Nov 2022 09:31:32 +0000 Subject: [PATCH 162/379] update compiler/src/process_component_member.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_member.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 2017531..67ec25e 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -839,8 +839,8 @@ export function isSimpleType(typeNode: ts.TypeNode, program: ts.Program, log?: L } return true; } - if (typeNode.parent && typeNode.parent.escapedText && - stateCollection.has(typeNode.parent.escapedText.toString()) && + if (typeNode.parent && typeNode.parent.name && stateCollection.get( + componentCollection.currentClassName).has(typeNode.parent.name.escapedText.toString()) && typeNode.kind === ts.SyntaxKind.AnyKeyword && log) { log.push({ type: LogType.ERROR, -- Gitee From 4168ccd1193177eb7dda0256f1fbceb67ab4274f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 28 Nov 2022 10:11:29 +0000 Subject: [PATCH 163/379] update compiler/src/process_component_member.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_member.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 67ec25e..7ab9e26 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -843,7 +843,8 @@ export function isSimpleType(typeNode: ts.TypeNode, program: ts.Program, log?: L componentCollection.currentClassName).has(typeNode.parent.name.escapedText.toString()) && typeNode.kind === ts.SyntaxKind.AnyKeyword && log) { log.push({ - type: LogType.ERROR, + type: partialUpdateConfig.strictCheck && partialUpdateConfig.partialUpdateMode ? + LogType.ERROR : LogType.WARN, message: `Please define an explicit type, not any.`, pos: typeNode.getStart() }); -- Gitee From deddc8585d41a9bf132dd6d9a9e4835f0339f5fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 28 Nov 2022 12:51:28 +0000 Subject: [PATCH 164/379] update compiler/src/process_component_build.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 014aacc..6bb24ac 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1309,7 +1309,7 @@ function checkHasThisKeyword(node: ts.Statement, log: LogInfo[]): void { realKeywords.add(keyword); } } - if (node) { + if (node && !ts.isBlock(node)) { ts.forEachChild(node, node => traverse(node)); } } -- Gitee From 625d5c432965425bd6b1d9d119875744fead08a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 28 Nov 2022 13:10:27 +0000 Subject: [PATCH 165/379] update compiler/src/process_component_build.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_build.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 6bb24ac..1c2f627 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1261,7 +1261,6 @@ function processThenStatement(thenStatement: ts.Statement, id: number, function processElseStatement(elseStatement: ts.Statement, id: number, log: LogInfo[], isBuilder: boolean = false, isGlobalBuilder: boolean = false): ts.Statement { - checkHasThisKeyword(elseStatement, log); if (elseStatement) { if (ts.isBlock(elseStatement)) { elseStatement = processIfBlock(elseStatement, id + 1, log); -- Gitee From 82a30031fd489f3f3a8947e31b44f7dfbdad5e42 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sun, 27 Nov 2022 20:54:56 +0800 Subject: [PATCH 166/379] houhaoyu@huawei.com adapt prop foreach custom component Signed-off-by: houhaoyu Change-Id: I6eea86580855a87dc25fd17a1b547b0e3b894300 --- compiler/src/pre_define.ts | 1 + compiler/src/process_component_class.ts | 3 -- compiler/src/process_component_member.ts | 35 ++++++++++++++++++- .../ut/render_decorator/@builder/@builder.ts | 4 +-- .../render_decorator/@builder/@builder.ts | 4 +-- .../@customDialog/@customDialog.ts | 3 +- .../@prop/@prop.ts | 5 +-- 7 files changed, 44 insertions(+), 11 deletions(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 271ea74..5bf7a18 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -360,3 +360,4 @@ export const CARD_LOG_TYPE_COMPONENTS = 2; export const CARD_LOG_TYPE_IMPORT = 3; export const CALL = 'call'; +export const RESERT = 'reset'; diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index afb7b6e..544e0bc 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -543,9 +543,6 @@ export function createReference(node: ts.PropertyAssignment, log: LogInfo[]): ts pos: initExpression.getStart() }); } - } else if (partialUpdateConfig.partialUpdateMode && isMatchInitExpression(initExpression) && - propParentComponent.includes(propertyName.escapedText.toString())) { - initText = initExpression.name.escapedText.toString(); } if (initText) { node = addDoubleUnderline(node, propertyName, initText); diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index ec49cef..10a5beb 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -70,7 +70,9 @@ import { THIS, CREATE_STORAGE_LINK, CREATE_STORAGE_PROP, - ELMTID + ELMTID, + COMPONENT_CONSTRUCTOR_PARAMS, + RESERT } from './pre_define'; import { forbiddenUseStateType, @@ -274,9 +276,29 @@ export function processMemberVariableDecorators(parentName: ts.Identifier, processPropertyNodeDecorator(parentName, item, updateResult, ctorNode, name, watchMap, log, program, context, hasPreview, interfaceNode); } + if (item.decorators && item.decorators.length && validatePropDecorator(item.decorators)) { + updateResult.setStateVarsParams(createStateVarsBody(name)); + } return updateResult; } +function createStateVarsBody(name: ts.Identifier): ts.ExpressionStatement { + return ts.factory.createExpressionStatement(ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + ts.factory.createPropertyAccessExpression( + ts.factory.createThis(), + ts.factory.createIdentifier("__"+name.escapedText.toString()) + ), + ts.factory.createIdentifier(RESERT) + ), + undefined, + [ts.factory.createPropertyAccessExpression( + ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARAMS), + name + )] + )) +} + function createControllerSet(node: ts.PropertyDeclaration, componentName: ts.Identifier, name: ts.Identifier, checkController: ControllerType): ts.MethodDeclaration { if (componentCollection.customDialogs.has(componentName.getText()) && node.type && @@ -1089,3 +1111,14 @@ function validateCustomDecorator(decorators: ts.NodeArray, log: Lo } return false; } + +function validatePropDecorator(decorators: ts.NodeArray): boolean { + for(let i = 0; i < decorators.length; i++) { + let decorator: ts.Decorator = decorators[i]; + const decoratorName: string = decorator.getText().replace(/\(.*\)$/, '').trim(); + if (COMPONENT_PROP_DECORATOR === decoratorName) { + return true; + } + } + return false; +} diff --git a/compiler/test/ut/render_decorator/@builder/@builder.ts b/compiler/test/ut/render_decorator/@builder/@builder.ts index 39bce30..d6e2abf 100644 --- a/compiler/test/ut/render_decorator/@builder/@builder.ts +++ b/compiler/test/ut/render_decorator/@builder/@builder.ts @@ -221,7 +221,7 @@ class MyComponent extends View { Row.create(); Row.padding(10); Row.bindMenu({ builder: () => { - this.NavigationTitlePara("111"); + this.NavigationTitlePara.call(this, "111"); } }); Text.create("Drag Me"); Text.onDragStart((event, extraParams) => { @@ -252,7 +252,7 @@ class MyComponent extends View { Row.create(); Row.padding(10); Navigation.create(); - Navigation.title({ builder: noParam }); + Navigation.title({ builder: noParam.bind(this) }); Navigation.menus({ builder: this.textBuilder.bind(this) }); Navigation.toolBar({ items: [ { value: 'app', text: 'Grid', action: () => { diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts index 0493462..ff93496 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts @@ -316,7 +316,7 @@ class MyComponent extends ViewPU { Row.create(); Row.padding(10); Row.bindMenu({ builder: () => { - this.NavigationTitlePara("111"); + this.NavigationTitlePara.call(this, "111"); } }); if (!isInitialRender) { Row.pop(); @@ -396,7 +396,7 @@ class MyComponent extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Navigation.create(); - Navigation.title({ builder: noParam }); + Navigation.title({ builder: noParam.bind(this) }); Navigation.menus({ builder: this.textBuilder.bind(this) }); Navigation.toolBar({ items: [ { value: 'app', text: 'Grid', action: () => { diff --git a/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts b/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts index 6668cf0..719ef14 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@customDialog/@customDialog.ts @@ -126,6 +126,7 @@ class DialogExample extends ViewPU { } } updateStateVars(params) { + this.__count.reset(params.count); } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__count.purgeDependencyOnElmtId(rmElmtId); @@ -255,7 +256,7 @@ class CustomDialogUser extends ViewPU { termsToAccept: "Please accept the terms.", action1: this.onAccept, action2: this.existApp, - count: this.__countInitValue, + count: this.countInitValue, isPlaying: this.__playingInitValue }, undefined, elmtId); jsDialog.setController(this.dialogController); diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts index b5a5f00..11f5e7a 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts @@ -44,6 +44,7 @@ class PropComponent extends ViewPU { setInitiallyProvidedValue(params) { } updateStateVars(params) { + this.__counter.reset(params.counter); } purgeVariableDependenciesOnElmtId(rmElmtId) { this.__counter.purgeDependencyOnElmtId(rmElmtId); @@ -114,10 +115,10 @@ class ParentComponent extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new PropComponent(this, { counter: this.__value }, undefined, elmtId)); + ViewPU.create(new PropComponent(this, { counter: this.value }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { counter: this.__value }); + this.updateStateVarsOfChildByElmtId(elmtId, { counter: this.value }); } ViewStackProcessor.StopGetAccessRecording(); }); -- Gitee From e44104952c7c7b27a9853060a5a410bccd286695 Mon Sep 17 00:00:00 2001 From: hufeng Date: Tue, 29 Nov 2022 10:48:54 +0800 Subject: [PATCH 167/379] Fix file-gen with ets/ts files by esmodule compiling Signed-off-by: hufeng Change-Id: If7aa57e2c4898586567b7652518208424652fddc --- compiler/src/process_js_ast.ts | 33 --------------------------------- compiler/src/result_process.ts | 12 +++++++++--- compiler/src/utils.ts | 17 +++++++++-------- compiler/webpack.config.js | 5 ----- 4 files changed, 18 insertions(+), 49 deletions(-) delete mode 100644 compiler/src/process_js_ast.ts diff --git a/compiler/src/process_js_ast.ts b/compiler/src/process_js_ast.ts deleted file mode 100644 index 5407024..0000000 --- a/compiler/src/process_js_ast.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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 ts from 'typescript'; -import { - BUILD_ON -} from './pre_define'; -import { generateSourceFilesToTemporary } from './utils'; - -export function processJs(program: ts.Program, ut = false): Function { - return (context: ts.TransformationContext) => { - return (node: ts.SourceFile) => { - if (process.env.compiler === BUILD_ON) { - generateSourceFilesToTemporary(node); - return node; - } else { - return node; - } - }; - }; -} diff --git a/compiler/src/result_process.ts b/compiler/src/result_process.ts index c3914e9..e935826 100644 --- a/compiler/src/result_process.ts +++ b/compiler/src/result_process.ts @@ -15,7 +15,7 @@ import ts from 'typescript'; -import { BUILD_OFF } from './pre_define'; +import { BUILD_OFF, ESMODULE } from './pre_define'; import { resetLog, transformLog @@ -28,10 +28,11 @@ import { import { LogInfo, emitLogInfo, - componentInfo + componentInfo, + generateSourceFilesToTemporary } from './utils'; import { resetComponentCollection } from './validate_ui_syntax'; -import { abilityConfig } from '../main'; +import { abilityConfig, projectConfig } from '../main'; module.exports = function resultProcess(source: string, map: any): void { process.env.compiler = BUILD_OFF; @@ -67,5 +68,10 @@ module.exports = function resultProcess(source: string, map: any): void { source = source.replace(/exports\.default/, 'globalThis.exports.default'); } + if (projectConfig.compileMode == ESMODULE && projectConfig.processTs === false + && process.env.compilerType && process.env.compilerType === 'ark') { + generateSourceFilesToTemporary(this.resourcePath, source, map); + } + this.callback(null, source, map); }; diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 80947c4..097b06d 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -488,9 +488,8 @@ function replaceRelativeDependency(item:string, moduleRequest: string, sourcePat export var newSourceMaps: Object = {}; -export function generateSourceFilesToTemporary(node: ts.SourceFile): void { - const mixedInfo: {content: string, sourceMapJson: any} = genContentAndSourceMapInfo(node, false); - let jsFilePath: string = genTemporaryPath(node.fileName, projectConfig.projectPath, process.env.cachePath); +export function generateSourceFilesToTemporary(sourcePath: string, sourceContent: string, sourceMap: any): void { + let jsFilePath: string = genTemporaryPath(sourcePath, projectConfig.projectPath, process.env.cachePath); if (jsFilePath.length === 0) { return; } @@ -501,21 +500,23 @@ export function generateSourceFilesToTemporary(node: ts.SourceFile): void { } let sourceMapFile: string = genSourceMapFileName(jsFilePath); if (sourceMapFile.length > 0 && projectConfig.buildArkMode === 'debug') { - newSourceMaps[node.fileName.replace(toUnixPath(projectConfig.projectRootPath) + '/', '')] = mixedInfo.sourceMapJson; + let source = toUnixPath(sourcePath).replace(toUnixPath(projectConfig.projectRootPath) + '/', ''); + sourceMap['sources'] = [source]; + newSourceMaps[source] = sourceMap; } // replace relative moduleSpecifier with ohmURl const REG_RELATIVE_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]((?:\.\/|\.\.\/).*)['"]/g; - mixedInfo.content = mixedInfo.content.replace(REG_RELATIVE_DEPENDENCY, (item, moduleRequest)=>{ - return replaceRelativeDependency(item, moduleRequest, node.fileName); + sourceContent = sourceContent.replace(REG_RELATIVE_DEPENDENCY, (item, moduleRequest)=>{ + return replaceRelativeDependency(item, moduleRequest, toUnixPath(sourcePath)); }); mkdirsSync(path.dirname(jsFilePath)); if (projectConfig.buildArkMode === 'debug') { - fs.writeFileSync(jsFilePath, mixedInfo.content); + fs.writeFileSync(jsFilePath, sourceContent); return; } - writeMinimizedSourceCode(mixedInfo.content, jsFilePath); + writeMinimizedSourceCode(sourceContent, jsFilePath); } export function writeFileSyncByNode(node: ts.SourceFile, toTsFile: boolean): void { diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 6629f8c..09550bd 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -35,7 +35,6 @@ const { ResultStates } = require('./lib/compile_info'); const { processUISyntax } = require('./lib/process_ui_syntax'); const { IGNORE_ERROR_CODE, removeDir } = require('./lib/utils'); const { BUILD_SHARE_PATH, PREBUILDMODE_JSON } = require('./lib/pre_define'); -const { processJs } = require('./lib/process_js_ast'); process.env.watchMode = (process.env.watchMode && process.env.watchMode === 'true') || 'false'; function initConfig(config) { @@ -84,10 +83,6 @@ function initConfig(config) { before: [processUISyntax(program)], after: [] }; - if (projectConfig.compileMode === 'esmodule' && projectConfig.processTs === false - && process.env.compilerType && process.env.compilerType === 'ark') { - transformerOperation.after.push(processJs(program)); - } return transformerOperation; }, -- Gitee From 75812accbc5c920953a3eee1d08d1647624518c1 Mon Sep 17 00:00:00 2001 From: congjiye Date: Tue, 29 Nov 2022 11:16:37 +0800 Subject: [PATCH 168/379] fix supervisual custom component cannot codegen when visual canvas has no component Signed-off-by: congjiye --- compiler/codegen/codegen_ets.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/codegen/codegen_ets.js b/compiler/codegen/codegen_ets.js index 7bfd28c..bc26b7f 100644 --- a/compiler/codegen/codegen_ets.js +++ b/compiler/codegen/codegen_ets.js @@ -12,5 +12,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -(()=>{var e={486:function(e,t,r){var n;e=r.nmd(e),function(){var o,a="Expected a function",i="__lodash_hash_undefined__",s="__lodash_placeholder__",l=32,p=128,c=1/0,u=9007199254740991,f=NaN,y=4294967295,d=[["ary",p],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",h="[object Boolean]",E="[object Date]",T="[object Error]",v="[object Function]",S="[object GeneratorFunction]",_="[object Map]",N="[object Number]",C="[object Object]",A="[object Promise]",P="[object RegExp]",b="[object Set]",M="[object String]",w="[object Symbol]",R="[object WeakMap]",O="[object ArrayBuffer]",I="[object DataView]",x="[object Float32Array]",L="[object Float64Array]",k="[object Int8Array]",D="[object Int16Array]",F="[object Int32Array]",V="[object Uint8Array]",U="[object Uint8ClampedArray]",B="[object Uint16Array]",z="[object Uint32Array]",G=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,H=RegExp($.source),Y=RegExp(q.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,oe=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,pe=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,ye=/^[-+]0x[0-9a-f]+$/i,de=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,he=/^(?:0|[1-9]\d*)$/,Ee=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Te=/($^)/,ve=/['\n\r\u2028\u2029\\]/g,Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="a-z\\xdf-\\xf6\\xf8-\\xff",Ne="A-Z\\xc0-\\xd6\\xd8-\\xde",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ae="["+Ce+"]",Pe="["+Se+"]",be="\\d+",Me="["+_e+"]",we="[^\\ud800-\\udfff"+Ce+be+"\\u2700-\\u27bf"+_e+Ne+"]",Re="\\ud83c[\\udffb-\\udfff]",Oe="[^\\ud800-\\udfff]",Ie="(?:\\ud83c[\\udde6-\\uddff]){2}",xe="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Ne+"]",ke="(?:"+Me+"|"+we+")",De="(?:"+Le+"|"+we+")",Fe="(?:['’](?:d|ll|m|re|s|t|ve))?",Ve="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ue="(?:"+Pe+"|"+Re+")?",Be="[\\ufe0e\\ufe0f]?",ze=Be+Ue+"(?:\\u200d(?:"+[Oe,Ie,xe].join("|")+")"+Be+Ue+")*",Ge="(?:"+["[\\u2700-\\u27bf]",Ie,xe].join("|")+")"+ze,je="(?:"+[Oe+Pe+"?",Pe,Ie,xe,"[\\ud800-\\udfff]"].join("|")+")",We=RegExp("['’]","g"),$e=RegExp(Pe,"g"),qe=RegExp(Re+"(?="+Re+")|"+je+ze,"g"),He=RegExp([Le+"?"+Me+"+"+Fe+"(?="+[Ae,Le,"$"].join("|")+")",De+"+"+Ve+"(?="+[Ae,Le+ke,"$"].join("|")+")",Le+"?"+ke+"+"+Fe,Le+"+"+Ve,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",be,Ge].join("|"),"g"),Ye=RegExp("[\\u200d\\ud800-\\udfff"+Se+"\\ufe0e\\ufe0f]"),Je=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Qe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Xe=-1,Ke={};Ke[x]=Ke[L]=Ke[k]=Ke[D]=Ke[F]=Ke[V]=Ke[U]=Ke[B]=Ke[z]=!0,Ke[m]=Ke[g]=Ke[O]=Ke[h]=Ke[I]=Ke[E]=Ke[T]=Ke[v]=Ke[_]=Ke[N]=Ke[C]=Ke[P]=Ke[b]=Ke[M]=Ke[R]=!1;var Ze={};Ze[m]=Ze[g]=Ze[O]=Ze[I]=Ze[h]=Ze[E]=Ze[x]=Ze[L]=Ze[k]=Ze[D]=Ze[F]=Ze[_]=Ze[N]=Ze[C]=Ze[P]=Ze[b]=Ze[M]=Ze[w]=Ze[V]=Ze[U]=Ze[B]=Ze[z]=!0,Ze[T]=Ze[v]=Ze[R]=!1;var et={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tt=parseFloat,rt=parseInt,nt="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,ot="object"==typeof self&&self&&self.Object===Object&&self,at=nt||ot||Function("return this")(),it=t&&!t.nodeType&&t,st=it&&e&&!e.nodeType&&e,lt=st&&st.exports===it,pt=lt&&nt.process,ct=function(){try{return st&&st.require&&st.require("util").types||pt&&pt.binding&&pt.binding("util")}catch(e){}}(),ut=ct&&ct.isArrayBuffer,ft=ct&&ct.isDate,yt=ct&&ct.isMap,dt=ct&&ct.isRegExp,mt=ct&&ct.isSet,gt=ct&&ct.isTypedArray;function ht(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Et(e,t,r,n){for(var o=-1,a=null==e?0:e.length;++o-1}function Ct(e,t,r){for(var n=-1,o=null==e?0:e.length;++n-1;);return r}function Ht(e,t){for(var r=e.length;r--&&xt(t,e[r],0)>-1;);return r}function Yt(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var Jt=Vt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Qt=Vt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Xt(e){return"\\"+et[e]}function Kt(e){return Ye.test(e)}function Zt(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function er(e,t){return function(r){return e(t(r))}}function tr(e,t){for(var r=-1,n=e.length,o=0,a=[];++r",""":'"',"'":"'"}),lr=function e(t){var r,n=(t=null==t?at:lr.defaults(at.Object(),t,lr.pick(at,Qe))).Array,oe=t.Date,Se=t.Error,_e=t.Function,Ne=t.Math,Ce=t.Object,Ae=t.RegExp,Pe=t.String,be=t.TypeError,Me=n.prototype,we=_e.prototype,Re=Ce.prototype,Oe=t["__core-js_shared__"],Ie=we.toString,xe=Re.hasOwnProperty,Le=0,ke=(r=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",De=Re.toString,Fe=Ie.call(Ce),Ve=at._,Ue=Ae("^"+Ie.call(xe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=lt?t.Buffer:o,ze=t.Symbol,Ge=t.Uint8Array,je=Be?Be.allocUnsafe:o,qe=er(Ce.getPrototypeOf,Ce),Ye=Ce.create,et=Re.propertyIsEnumerable,nt=Me.splice,ot=ze?ze.isConcatSpreadable:o,it=ze?ze.iterator:o,st=ze?ze.toStringTag:o,pt=function(){try{var e=ca(Ce,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==at.clearTimeout&&t.clearTimeout,Rt=oe&&oe.now!==at.Date.now&&oe.now,Vt=t.setTimeout!==at.setTimeout&&t.setTimeout,pr=Ne.ceil,cr=Ne.floor,ur=Ce.getOwnPropertySymbols,fr=Be?Be.isBuffer:o,yr=t.isFinite,dr=Me.join,mr=er(Ce.keys,Ce),gr=Ne.max,hr=Ne.min,Er=oe.now,Tr=t.parseInt,vr=Ne.random,Sr=Me.reverse,_r=ca(t,"DataView"),Nr=ca(t,"Map"),Cr=ca(t,"Promise"),Ar=ca(t,"Set"),Pr=ca(t,"WeakMap"),br=ca(Ce,"create"),Mr=Pr&&new Pr,wr={},Rr=Ua(_r),Or=Ua(Nr),Ir=Ua(Cr),xr=Ua(Ar),Lr=Ua(Pr),kr=ze?ze.prototype:o,Dr=kr?kr.valueOf:o,Fr=kr?kr.toString:o;function Vr(e){if(rs(e)&&!$i(e)&&!(e instanceof Gr)){if(e instanceof zr)return e;if(xe.call(e,"__wrapped__"))return Ba(e)}return new zr(e)}var Ur=function(){function e(){}return function(t){if(!ts(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=o,r}}();function Br(){}function zr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function Gr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=y,this.__views__=[]}function jr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sn(e,t,r,n,a,i){var s,l=1&t,p=2&t,c=4&t;if(r&&(s=a?r(e,n,a,i):r(e)),s!==o)return s;if(!ts(e))return e;var u=$i(e);if(u){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&xe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!l)return Mo(e,s)}else{var f=ya(e),y=f==v||f==S;if(Ji(e))return _o(e,l);if(f==C||f==m||y&&!a){if(s=p||y?{}:ma(e),!l)return p?function(e,t){return wo(e,fa(e),t)}(e,function(e,t){return e&&wo(t,xs(t),e)}(s,e)):function(e,t){return wo(e,ua(e),t)}(e,rn(s,e))}else{if(!Ze[f])return a?e:{};s=function(e,t,r){var n,o=e.constructor;switch(t){case O:return No(e);case h:case E:return new o(+e);case I:return function(e,t){var r=t?No(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case x:case L:case k:case D:case F:case V:case U:case B:case z:return Co(e,r);case _:return new o;case N:case M:return new o(e);case P:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return new o;case w:return n=e,Dr?Ce(Dr.call(n)):{}}}(e,f,l)}}i||(i=new Hr);var d=i.get(e);if(d)return d;i.set(e,s),ss(e)?e.forEach((function(n){s.add(sn(n,t,r,n,e,i))})):ns(e)&&e.forEach((function(n,o){s.set(o,sn(n,t,r,o,e,i))}));var g=u?o:(c?p?na:ra:p?xs:Is)(e);return Tt(g||e,(function(n,o){g&&(n=e[o=n]),Zr(s,o,sn(n,t,r,o,e,i))})),s}function ln(e,t,r){var n=r.length;if(null==e)return!n;for(e=Ce(e);n--;){var a=r[n],i=t[a],s=e[a];if(s===o&&!(a in e)||!i(s))return!1}return!0}function pn(e,t,r){if("function"!=typeof e)throw new be(a);return Ra((function(){e.apply(o,r)}),t)}function cn(e,t,r,n){var o=-1,a=Nt,i=!0,s=e.length,l=[],p=t.length;if(!s)return l;r&&(t=At(t,jt(r))),n?(a=Ct,i=!1):t.length>=200&&(a=$t,i=!1,t=new qr(t));e:for(;++o-1},Wr.prototype.set=function(e,t){var r=this.__data__,n=en(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new jr,map:new(Nr||Wr),string:new jr}},$r.prototype.delete=function(e){var t=la(this,e).delete(e);return this.size-=t?1:0,t},$r.prototype.get=function(e){return la(this,e).get(e)},$r.prototype.has=function(e){return la(this,e).has(e)},$r.prototype.set=function(e,t){var r=la(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},qr.prototype.add=qr.prototype.push=function(e){return this.__data__.set(e,i),this},qr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Hr.prototype.get=function(e){return this.__data__.get(e)},Hr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var n=r.__data__;if(!Nr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new $r(n)}return r.set(e,t),this.size=r.size,this};var un=Io(Tn),fn=Io(vn,!0);function yn(e,t){var r=!0;return un(e,(function(e,n,o){return r=!!t(e,n,o)})),r}function dn(e,t,r){for(var n=-1,a=e.length;++n0&&r(s)?t>1?gn(s,t-1,r,n,o):Pt(o,s):n||(o[o.length]=s)}return o}var hn=xo(),En=xo(!0);function Tn(e,t){return e&&hn(e,t,Is)}function vn(e,t){return e&&En(e,t,Is)}function Sn(e,t){return _t(t,(function(t){return Ki(e[t])}))}function _n(e,t){for(var r=0,n=(t=Eo(t,e)).length;null!=e&&rt}function Pn(e,t){return null!=e&&xe.call(e,t)}function bn(e,t){return null!=e&&t in Ce(e)}function Mn(e,t,r){for(var a=r?Ct:Nt,i=e[0].length,s=e.length,l=s,p=n(s),c=1/0,u=[];l--;){var f=e[l];l&&t&&(f=At(f,jt(t))),c=hr(f.length,c),p[l]=!r&&(t||i>=120&&f.length>=120)?new qr(l&&f):o}f=e[0];var y=-1,d=p[0];e:for(;++y=s?l:l*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(o)}function jn(e,t,r){for(var n=-1,o=t.length,a={};++n-1;)s!==e&&nt.call(s,l,1),nt.call(e,l,1);return e}function $n(e,t){for(var r=e?t.length:0,n=r-1;r--;){var o=t[r];if(r==n||o!==a){var a=o;ha(o)?nt.call(e,o,1):po(e,o)}}return e}function qn(e,t){return e+cr(vr()*(t-e+1))}function Hn(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=cr(t/2))&&(e+=e)}while(t);return r}function Yn(e,t){return Oa(Aa(e,t,ol),e+"")}function Jn(e){return Jr(zs(e))}function Qn(e,t){var r=zs(e);return La(r,an(t,0,r.length))}function Xn(e,t,r,n){if(!ts(e))return e;for(var a=-1,i=(t=Eo(t,e)).length,s=i-1,l=e;null!=l&&++aa?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=n(a);++o>>1,i=e[a];null!==i&&!ps(i)&&(r?i<=t:i=200){var p=t?null:Yo(e);if(p)return rr(p);i=!1,o=$t,l=new qr}else l=t?[]:s;e:for(;++n=n?e:to(e,t,r)}var So=ct||function(e){return at.clearTimeout(e)};function _o(e,t){if(t)return e.slice();var r=e.length,n=je?je(r):new e.constructor(r);return e.copy(n),n}function No(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function Co(e,t){var r=t?No(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ao(e,t){if(e!==t){var r=e!==o,n=null===e,a=e==e,i=ps(e),s=t!==o,l=null===t,p=t==t,c=ps(t);if(!l&&!c&&!i&&e>t||i&&s&&p&&!l&&!c||n&&s&&p||!r&&p||!a)return 1;if(!n&&!i&&!c&&e1?r[a-1]:o,s=a>2?r[2]:o;for(i=e.length>3&&"function"==typeof i?(a--,i):o,s&&Ea(r[0],r[1],s)&&(i=a<3?o:i,a=1),t=Ce(t);++n-1?a[i?t[s]:s]:o}}function Vo(e){return ta((function(t){var r=t.length,n=r,i=zr.prototype.thru;for(e&&t.reverse();n--;){var s=t[n];if("function"!=typeof s)throw new be(a);if(i&&!l&&"wrapper"==aa(s))var l=new zr([],!0)}for(n=l?n:r;++n1&&T.reverse(),y&&ul))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var f=-1,y=!0,d=2&r?new qr:o;for(i.set(e,t),i.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Tt(d,(function(r){var n="_."+r[0];t&r[1]&&!Nt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(se):[]}(n),r)))}function xa(e){var t=0,r=0;return function(){var n=Er(),a=16-(n-r);if(r=n,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function La(e,t){var r=-1,n=e.length,a=n-1;for(t=t===o?n:t;++r1?e[t-1]:o;return r="function"==typeof r?(e.pop(),r):o,ii(e,r)}));function yi(e){var t=Vr(e);return t.__chain__=!0,t}function di(e,t){return t(e)}var mi=ta((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,a=function(t){return on(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Gr&&ha(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:di,args:[a],thisArg:o}),new zr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(o),e}))):this.thru(a)})),gi=Ro((function(e,t,r){xe.call(e,r)?++e[r]:nn(e,r,1)})),hi=Fo(Wa),Ei=Fo($a);function Ti(e,t){return($i(e)?Tt:un)(e,sa(t,3))}function vi(e,t){return($i(e)?vt:fn)(e,sa(t,3))}var Si=Ro((function(e,t,r){xe.call(e,r)?e[r].push(t):nn(e,r,[t])})),_i=Yn((function(e,t,r){var o=-1,a="function"==typeof t,i=Hi(e)?n(e.length):[];return un(e,(function(e){i[++o]=a?ht(t,e,r):wn(e,t,r)})),i})),Ni=Ro((function(e,t,r){nn(e,r,t)}));function Ci(e,t){return($i(e)?At:Fn)(e,sa(t,3))}var Ai=Ro((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Pi=Yn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ea(e,t[0],t[1])?t=[]:r>2&&Ea(t[0],t[1],t[2])&&(t=[t[0]]),Gn(e,gn(t,1),[])})),bi=Rt||function(){return at.Date.now()};function Mi(e,t,r){return t=r?o:t,t=e&&null==t?e.length:t,Qo(e,p,o,o,o,o,t)}function wi(e,t){var r;if("function"!=typeof t)throw new be(a);return e=ms(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=o),r}}var Ri=Yn((function(e,t,r){var n=1;if(r.length){var o=tr(r,ia(Ri));n|=l}return Qo(e,n,t,r,o)})),Oi=Yn((function(e,t,r){var n=3;if(r.length){var o=tr(r,ia(Oi));n|=l}return Qo(t,n,e,r,o)}));function Ii(e,t,r){var n,i,s,l,p,c,u=0,f=!1,y=!1,d=!0;if("function"!=typeof e)throw new be(a);function m(t){var r=n,a=i;return n=i=o,u=t,l=e.apply(a,r)}function g(e){return u=e,p=Ra(E,t),f?m(e):l}function h(e){var r=e-c;return c===o||r>=t||r<0||y&&e-u>=s}function E(){var e=bi();if(h(e))return T(e);p=Ra(E,function(e){var r=t-(e-c);return y?hr(r,s-(e-u)):r}(e))}function T(e){return p=o,d&&n?m(e):(n=i=o,l)}function v(){var e=bi(),r=h(e);if(n=arguments,i=this,c=e,r){if(p===o)return g(c);if(y)return So(p),p=Ra(E,t),m(c)}return p===o&&(p=Ra(E,t)),l}return t=hs(t)||0,ts(r)&&(f=!!r.leading,s=(y="maxWait"in r)?gr(hs(r.maxWait)||0,t):s,d="trailing"in r?!!r.trailing:d),v.cancel=function(){p!==o&&So(p),u=0,n=c=i=p=o},v.flush=function(){return p===o?l:T(bi())},v}var xi=Yn((function(e,t){return pn(e,1,t)})),Li=Yn((function(e,t,r){return pn(e,hs(t)||0,r)}));function ki(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new be(a);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(ki.Cache||$r),r}function Di(e){if("function"!=typeof e)throw new be(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ki.Cache=$r;var Fi=To((function(e,t){var r=(t=1==t.length&&$i(t[0])?At(t[0],jt(sa())):At(gn(t,1),jt(sa()))).length;return Yn((function(n){for(var o=-1,a=hr(n.length,r);++o=t})),Wi=Rn(function(){return arguments}())?Rn:function(e){return rs(e)&&xe.call(e,"callee")&&!et.call(e,"callee")},$i=n.isArray,qi=ut?jt(ut):function(e){return rs(e)&&Cn(e)==O};function Hi(e){return null!=e&&es(e.length)&&!Ki(e)}function Yi(e){return rs(e)&&Hi(e)}var Ji=fr||hl,Qi=ft?jt(ft):function(e){return rs(e)&&Cn(e)==E};function Xi(e){if(!rs(e))return!1;var t=Cn(e);return t==T||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function Ki(e){if(!ts(e))return!1;var t=Cn(e);return t==v||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zi(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var ns=yt?jt(yt):function(e){return rs(e)&&ya(e)==_};function os(e){return"number"==typeof e||rs(e)&&Cn(e)==N}function as(e){if(!rs(e)||Cn(e)!=C)return!1;var t=qe(e);if(null===t)return!0;var r=xe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Ie.call(r)==Fe}var is=dt?jt(dt):function(e){return rs(e)&&Cn(e)==P},ss=mt?jt(mt):function(e){return rs(e)&&ya(e)==b};function ls(e){return"string"==typeof e||!$i(e)&&rs(e)&&Cn(e)==M}function ps(e){return"symbol"==typeof e||rs(e)&&Cn(e)==w}var cs=gt?jt(gt):function(e){return rs(e)&&es(e.length)&&!!Ke[Cn(e)]},us=$o(Dn),fs=$o((function(e,t){return e<=t}));function ys(e){if(!e)return[];if(Hi(e))return ls(e)?ar(e):Mo(e);if(it&&e[it])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[it]());var t=ya(e);return(t==_?Zt:t==b?rr:zs)(e)}function ds(e){return e?(e=hs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=ds(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?an(ms(e),0,y):0}function hs(e){if("number"==typeof e)return e;if(ps(e))return f;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Gt(e);var r=de.test(e);return r||ge.test(e)?rt(e.slice(2),r?2:8):ye.test(e)?f:+e}function Es(e){return wo(e,xs(e))}function Ts(e){return null==e?"":so(e)}var vs=Oo((function(e,t){if(_a(t)||Hi(t))wo(t,Is(t),e);else for(var r in t)xe.call(t,r)&&Zr(e,r,t[r])})),Ss=Oo((function(e,t){wo(t,xs(t),e)})),_s=Oo((function(e,t,r,n){wo(t,xs(t),e,n)})),Ns=Oo((function(e,t,r,n){wo(t,Is(t),e,n)})),Cs=ta(on),As=Yn((function(e,t){e=Ce(e);var r=-1,n=t.length,a=n>2?t[2]:o;for(a&&Ea(t[0],t[1],a)&&(n=1);++r1),t})),wo(e,na(e),r),n&&(r=sn(r,7,Zo));for(var o=t.length;o--;)po(r,t[o]);return r})),Fs=ta((function(e,t){return null==e?{}:function(e,t){return jn(e,t,(function(t,r){return Ms(e,r)}))}(e,t)}));function Vs(e,t){if(null==e)return{};var r=At(na(e),(function(e){return[e]}));return t=sa(t),jn(e,r,(function(e,r){return t(e,r[0])}))}var Us=Jo(Is),Bs=Jo(xs);function zs(e){return null==e?[]:Wt(e,Is(e))}var Gs=ko((function(e,t,r){return t=t.toLowerCase(),e+(r?js(t):t)}));function js(e){return Xs(Ts(e).toLowerCase())}function Ws(e){return(e=Ts(e))&&e.replace(Ee,Jt).replace($e,"")}var $s=ko((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),qs=ko((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Hs=Lo("toLowerCase"),Ys=ko((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Js=ko((function(e,t,r){return e+(r?" ":"")+Xs(t)})),Qs=ko((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Xs=Lo("toUpperCase");function Ks(e,t,r){return e=Ts(e),(t=r?o:t)===o?function(e){return Je.test(e)}(e)?function(e){return e.match(He)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Zs=Yn((function(e,t){try{return ht(e,o,t)}catch(e){return Xi(e)?e:new Se(e)}})),el=ta((function(e,t){return Tt(t,(function(t){t=Va(t),nn(e,t,Ri(e[t],e))})),e}));function tl(e){return function(){return e}}var rl=Vo(),nl=Vo(!0);function ol(e){return e}function al(e){return Ln("function"==typeof e?e:sn(e,1))}var il=Yn((function(e,t){return function(r){return wn(r,e,t)}})),sl=Yn((function(e,t){return function(r){return wn(e,r,t)}}));function ll(e,t,r){var n=Is(t),o=Sn(t,n);null!=r||ts(t)&&(o.length||!n.length)||(r=t,t=e,e=this,o=Sn(t,Is(t)));var a=!(ts(r)&&"chain"in r&&!r.chain),i=Ki(e);return Tt(o,(function(r){var n=t[r];e[r]=n,i&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__),o=r.__actions__=Mo(this.__actions__);return o.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Pt([this.value()],arguments))})})),e}function pl(){}var cl=Go(At),ul=Go(St),fl=Go(wt);function yl(e){return Ta(e)?Ft(Va(e)):function(e){return function(t){return _n(t,e)}}(e)}var dl=Wo(),ml=Wo(!0);function gl(){return[]}function hl(){return!1}var El,Tl=zo((function(e,t){return e+t}),0),vl=Ho("ceil"),Sl=zo((function(e,t){return e/t}),1),_l=Ho("floor"),Nl=zo((function(e,t){return e*t}),1),Cl=Ho("round"),Al=zo((function(e,t){return e-t}),0);return Vr.after=function(e,t){if("function"!=typeof t)throw new be(a);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},Vr.ary=Mi,Vr.assign=vs,Vr.assignIn=Ss,Vr.assignInWith=_s,Vr.assignWith=Ns,Vr.at=Cs,Vr.before=wi,Vr.bind=Ri,Vr.bindAll=el,Vr.bindKey=Oi,Vr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $i(e)?e:[e]},Vr.chain=yi,Vr.chunk=function(e,t,r){t=(r?Ea(e,t,r):t===o)?1:gr(ms(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var i=0,s=0,l=n(pr(a/t));ia?0:a+r),(n=n===o||n>a?a:ms(n))<0&&(n+=a),n=r>n?0:gs(n);r>>0)?(e=Ts(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=so(t))&&Kt(e)?vo(ar(e),0,r):e.split(t,r):[]},Vr.spread=function(e,t){if("function"!=typeof e)throw new be(a);return t=null==t?0:gr(ms(t),0),Yn((function(r){var n=r[t],o=vo(r,0,t);return n&&Pt(o,n),ht(e,this,o)}))},Vr.tail=function(e){var t=null==e?0:e.length;return t?to(e,1,t):[]},Vr.take=function(e,t,r){return e&&e.length?to(e,0,(t=r||t===o?1:ms(t))<0?0:t):[]},Vr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?to(e,(t=n-(t=r||t===o?1:ms(t)))<0?0:t,n):[]},Vr.takeRightWhile=function(e,t){return e&&e.length?uo(e,sa(t,3),!1,!0):[]},Vr.takeWhile=function(e,t){return e&&e.length?uo(e,sa(t,3)):[]},Vr.tap=function(e,t){return t(e),e},Vr.throttle=function(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new be(a);return ts(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),Ii(e,t,{leading:n,maxWait:t,trailing:o})},Vr.thru=di,Vr.toArray=ys,Vr.toPairs=Us,Vr.toPairsIn=Bs,Vr.toPath=function(e){return $i(e)?At(e,Va):ps(e)?[e]:Mo(Fa(Ts(e)))},Vr.toPlainObject=Es,Vr.transform=function(e,t,r){var n=$i(e),o=n||Ji(e)||cs(e);if(t=sa(t,4),null==r){var a=e&&e.constructor;r=o?n?new a:[]:ts(e)&&Ki(a)?Ur(qe(e)):{}}return(o?Tt:Tn)(e,(function(e,n,o){return t(r,e,n,o)})),r},Vr.unary=function(e){return Mi(e,1)},Vr.union=ri,Vr.unionBy=ni,Vr.unionWith=oi,Vr.uniq=function(e){return e&&e.length?lo(e):[]},Vr.uniqBy=function(e,t){return e&&e.length?lo(e,sa(t,2)):[]},Vr.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?lo(e,o,t):[]},Vr.unset=function(e,t){return null==e||po(e,t)},Vr.unzip=ai,Vr.unzipWith=ii,Vr.update=function(e,t,r){return null==e?e:co(e,t,ho(r))},Vr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:o,null==e?e:co(e,t,ho(r),n)},Vr.values=zs,Vr.valuesIn=function(e){return null==e?[]:Wt(e,xs(e))},Vr.without=si,Vr.words=Ks,Vr.wrap=function(e,t){return Vi(ho(t),e)},Vr.xor=li,Vr.xorBy=pi,Vr.xorWith=ci,Vr.zip=ui,Vr.zipObject=function(e,t){return mo(e||[],t||[],Zr)},Vr.zipObjectDeep=function(e,t){return mo(e||[],t||[],Xn)},Vr.zipWith=fi,Vr.entries=Us,Vr.entriesIn=Bs,Vr.extend=Ss,Vr.extendWith=_s,ll(Vr,Vr),Vr.add=Tl,Vr.attempt=Zs,Vr.camelCase=Gs,Vr.capitalize=js,Vr.ceil=vl,Vr.clamp=function(e,t,r){return r===o&&(r=t,t=o),r!==o&&(r=(r=hs(r))==r?r:0),t!==o&&(t=(t=hs(t))==t?t:0),an(hs(e),t,r)},Vr.clone=function(e){return sn(e,4)},Vr.cloneDeep=function(e){return sn(e,5)},Vr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:o)},Vr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:o)},Vr.conformsTo=function(e,t){return null==t||ln(e,t,Is(t))},Vr.deburr=Ws,Vr.defaultTo=function(e,t){return null==e||e!=e?t:e},Vr.divide=Sl,Vr.endsWith=function(e,t,r){e=Ts(e),t=so(t);var n=e.length,a=r=r===o?n:an(ms(r),0,n);return(r-=t.length)>=0&&e.slice(r,a)==t},Vr.eq=zi,Vr.escape=function(e){return(e=Ts(e))&&Y.test(e)?e.replace(q,Qt):e},Vr.escapeRegExp=function(e){return(e=Ts(e))&&re.test(e)?e.replace(te,"\\$&"):e},Vr.every=function(e,t,r){var n=$i(e)?St:yn;return r&&Ea(e,t,r)&&(t=o),n(e,sa(t,3))},Vr.find=hi,Vr.findIndex=Wa,Vr.findKey=function(e,t){return Ot(e,sa(t,3),Tn)},Vr.findLast=Ei,Vr.findLastIndex=$a,Vr.findLastKey=function(e,t){return Ot(e,sa(t,3),vn)},Vr.floor=_l,Vr.forEach=Ti,Vr.forEachRight=vi,Vr.forIn=function(e,t){return null==e?e:hn(e,sa(t,3),xs)},Vr.forInRight=function(e,t){return null==e?e:En(e,sa(t,3),xs)},Vr.forOwn=function(e,t){return e&&Tn(e,sa(t,3))},Vr.forOwnRight=function(e,t){return e&&vn(e,sa(t,3))},Vr.get=bs,Vr.gt=Gi,Vr.gte=ji,Vr.has=function(e,t){return null!=e&&da(e,t,Pn)},Vr.hasIn=Ms,Vr.head=Ha,Vr.identity=ol,Vr.includes=function(e,t,r,n){e=Hi(e)?e:zs(e),r=r&&!n?ms(r):0;var o=e.length;return r<0&&(r=gr(o+r,0)),ls(e)?r<=o&&e.indexOf(t,r)>-1:!!o&&xt(e,t,r)>-1},Vr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=null==r?0:ms(r);return o<0&&(o=gr(n+o,0)),xt(e,t,o)},Vr.inRange=function(e,t,r){return t=ds(t),r===o?(r=t,t=0):r=ds(r),function(e,t,r){return e>=hr(t,r)&&e=-9007199254740991&&e<=u},Vr.isSet=ss,Vr.isString=ls,Vr.isSymbol=ps,Vr.isTypedArray=cs,Vr.isUndefined=function(e){return e===o},Vr.isWeakMap=function(e){return rs(e)&&ya(e)==R},Vr.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==Cn(e)},Vr.join=function(e,t){return null==e?"":dr.call(e,t)},Vr.kebabCase=$s,Vr.last=Xa,Vr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var a=n;return r!==o&&(a=(a=ms(r))<0?gr(n+a,0):hr(a,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,a):It(e,kt,a,!0)},Vr.lowerCase=qs,Vr.lowerFirst=Hs,Vr.lt=us,Vr.lte=fs,Vr.max=function(e){return e&&e.length?dn(e,ol,An):o},Vr.maxBy=function(e,t){return e&&e.length?dn(e,sa(t,2),An):o},Vr.mean=function(e){return Dt(e,ol)},Vr.meanBy=function(e,t){return Dt(e,sa(t,2))},Vr.min=function(e){return e&&e.length?dn(e,ol,Dn):o},Vr.minBy=function(e,t){return e&&e.length?dn(e,sa(t,2),Dn):o},Vr.stubArray=gl,Vr.stubFalse=hl,Vr.stubObject=function(){return{}},Vr.stubString=function(){return""},Vr.stubTrue=function(){return!0},Vr.multiply=Nl,Vr.nth=function(e,t){return e&&e.length?zn(e,ms(t)):o},Vr.noConflict=function(){return at._===this&&(at._=Ve),this},Vr.noop=pl,Vr.now=bi,Vr.pad=function(e,t,r){e=Ts(e);var n=(t=ms(t))?or(e):0;if(!t||n>=t)return e;var o=(t-n)/2;return jo(cr(o),r)+e+jo(pr(o),r)},Vr.padEnd=function(e,t,r){e=Ts(e);var n=(t=ms(t))?or(e):0;return t&&nt){var n=e;e=t,t=n}if(r||e%1||t%1){var a=vr();return hr(e+a*(t-e+tt("1e-"+((a+"").length-1))),t)}return qn(e,t)},Vr.reduce=function(e,t,r){var n=$i(e)?bt:Ut,o=arguments.length<3;return n(e,sa(t,4),r,o,un)},Vr.reduceRight=function(e,t,r){var n=$i(e)?Mt:Ut,o=arguments.length<3;return n(e,sa(t,4),r,o,fn)},Vr.repeat=function(e,t,r){return t=(r?Ea(e,t,r):t===o)?1:ms(t),Hn(Ts(e),t)},Vr.replace=function(){var e=arguments,t=Ts(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Vr.result=function(e,t,r){var n=-1,a=(t=Eo(t,e)).length;for(a||(a=1,e=o);++nu)return[];var r=y,n=hr(e,y);t=sa(t),e-=y;for(var o=zt(n,t);++r=i)return e;var l=r-or(n);if(l<1)return n;var p=s?vo(s,0,l).join(""):e.slice(0,l);if(a===o)return p+n;if(s&&(l+=p.length-l),is(a)){if(e.slice(l).search(a)){var c,u=p;for(a.global||(a=Ae(a.source,Ts(fe.exec(a))+"g")),a.lastIndex=0;c=a.exec(u);)var f=c.index;p=p.slice(0,f===o?l:f)}}else if(e.indexOf(so(a),l)!=l){var y=p.lastIndexOf(a);y>-1&&(p=p.slice(0,y))}return p+n},Vr.unescape=function(e){return(e=Ts(e))&&H.test(e)?e.replace($,sr):e},Vr.uniqueId=function(e){var t=++Le;return Ts(e)+t},Vr.upperCase=Qs,Vr.upperFirst=Xs,Vr.each=Ti,Vr.eachRight=vi,Vr.first=Ha,ll(Vr,(El={},Tn(Vr,(function(e,t){xe.call(Vr.prototype,t)||(El[t]=e)})),El),{chain:!1}),Vr.VERSION="4.17.21",Tt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Vr[e].placeholder=Vr})),Tt(["drop","take"],(function(e,t){Gr.prototype[e]=function(r){r=r===o?1:gr(ms(r),0);var n=this.__filtered__&&!t?new Gr(this):this.clone();return n.__filtered__?n.__takeCount__=hr(r,n.__takeCount__):n.__views__.push({size:hr(r,y),type:e+(n.__dir__<0?"Right":"")}),n},Gr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Tt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Gr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:sa(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Tt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Gr.prototype[e]=function(){return this[r](1).value()[0]}})),Tt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Gr.prototype[e]=function(){return this.__filtered__?new Gr(this):this[r](1)}})),Gr.prototype.compact=function(){return this.filter(ol)},Gr.prototype.find=function(e){return this.filter(e).head()},Gr.prototype.findLast=function(e){return this.reverse().find(e)},Gr.prototype.invokeMap=Yn((function(e,t){return"function"==typeof e?new Gr(this):this.map((function(r){return wn(r,e,t)}))})),Gr.prototype.reject=function(e){return this.filter(Di(sa(e)))},Gr.prototype.slice=function(e,t){e=ms(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Gr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==o&&(r=(t=ms(t))<0?r.dropRight(-t):r.take(t-e)),r)},Gr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gr.prototype.toArray=function(){return this.take(y)},Tn(Gr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),a=Vr[n?"take"+("last"==t?"Right":""):t],i=n||/^find/.test(t);a&&(Vr.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,l=t instanceof Gr,p=s[0],c=l||$i(t),u=function(e){var t=a.apply(Vr,Pt([e],s));return n&&f?t[0]:t};c&&r&&"function"==typeof p&&1!=p.length&&(l=c=!1);var f=this.__chain__,y=!!this.__actions__.length,d=i&&!f,m=l&&!y;if(!i&&c){t=m?t:new Gr(this);var g=e.apply(t,s);return g.__actions__.push({func:di,args:[u],thisArg:o}),new zr(g,f)}return d&&m?e.apply(this,s):(g=this.thru(u),d?n?g.value()[0]:g.value():g)})})),Tt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Me[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Vr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var o=this.value();return t.apply($i(o)?o:[],e)}return this[r]((function(r){return t.apply($i(r)?r:[],e)}))}})),Tn(Gr.prototype,(function(e,t){var r=Vr[t];if(r){var n=r.name+"";xe.call(wr,n)||(wr[n]=[]),wr[n].push({name:t,func:r})}})),wr[Uo(o,2).name]=[{name:"wrapper",func:o}],Gr.prototype.clone=function(){var e=new Gr(this.__wrapped__);return e.__actions__=Mo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Mo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Mo(this.__views__),e},Gr.prototype.reverse=function(){if(this.__filtered__){var e=new Gr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=$i(e),n=t<0,o=r?e.length:0,a=function(e,t,r){for(var n=-1,o=r.length;++n=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},Vr.prototype.plant=function(e){for(var t,r=this;r instanceof Br;){var n=Ba(r);n.__index__=0,n.__values__=o,t?a.__wrapped__=n:t=n;var a=n;r=r.__wrapped__}return a.__wrapped__=e,t},Vr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gr){var t=e;return this.__actions__.length&&(t=new Gr(this)),(t=t.reverse()).__actions__.push({func:di,args:[ti],thisArg:o}),new zr(t,this.__chain__)}return this.thru(ti)},Vr.prototype.toJSON=Vr.prototype.valueOf=Vr.prototype.value=function(){return fo(this.__wrapped__,this.__actions__)},Vr.prototype.first=Vr.prototype.head,it&&(Vr.prototype[it]=function(){return this}),Vr}();at._=lr,(n=function(){return lr}.call(t,r,t,e))===o||(e.exports=n)}.call(this)},904:(e,t)=>{"use strict";var r;let n;Object.defineProperty(t,"__esModule",{value:!0}),t.setDomain=t.getDomain=t.Domain=void 0,function(e){e[e.FA=0]="FA",e[e.FORM=1]="FORM",e[e.ETS=2]="ETS"}(r||(r={})),t.Domain=r,t.setDomain=e=>{n=e},t.getDomain=()=>null!=n?n:r.ETS},784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMap=void 0,t.errorMap=new Map([["fileError","Visual file is damaged"],["versionError","Version number of visual file does not match"],["modelError","Visual model in visual file is damaged"],["codegenError","Codegen visual file failed"]])},117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNode=void 0,t.ASTNode=class{accept(e){return e.visit(this)}}},862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0,t.Cache=class{constructor(e,t=0){this.value="",this.indent=t,this.flag=!0,this.INDENT=e}indentOn(){this.flag=!0}indentOff(){this.flag=!1}incIndent(){this.indent++}decIndent(){this.indent--}checkIndent(){return this.indent<0}getIndents(){if(this.flag){let e="";for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const n=r(117);class o extends n.ASTNode{constructor(e,t,r,n,o){super(),this.defaultValue=new Map,this.mediaParams=new Map,this.mediaProperties=new Map,this.mediaKeyProperty=new Map,this.tagName=e,this.params=t,this.content=r,this.properties=n,this.forEachObj=o,this.ifBoolean=null,this.isCustomTag=!1}setMediaParams(e){this.mediaParams=e}setParams(e){this.params=e}setIfBoolean(e){this.ifBoolean=e}setTagName(e){this.tagName=e}setForEachObj(e){this.forEachObj=e}setMediaProperty(e,t){t.forEach(((t,r)=>{var n;this.mediaKeyProperty.has(r)||this.mediaKeyProperty.set(r,new Map),null===(n=this.mediaKeyProperty.get(r))||void 0===n||n.set(e,t)}))}setDefaultValue(e,t,r="undefined",n=""){this.defaultValue.set(e,[r,t,n])}}t.Tag=o},623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const n=r(519),o=r(862),a=r(51),i=r(294),s=r(486);class l{constructor(e){this.cache=e,this.etsImport=new o.Cache(" ",0),this.etsVariable=new o.Cache(" ",1),this.etsFunction=new o.Cache(" ",1),this.aboutToAppear=new o.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}visit(e){e instanceof n.Tag&&(e.isCustomTag?this.genCustomTag(e):(this.needMediaQuery&&this.genMediaQuery(e),this.genTag(e)))}static getMethodGen(e){return void 0===l.instance?l.instance=new l(e):l.instance.setCache(e),l.instance}setCache(e){this.cache=e,this.etsImport=new o.Cache(" ",0),this.etsVariable=new o.Cache(" ",1),this.etsFunction=new o.Cache(" ",1),this.aboutToAppear=new o.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}genParams(e){const t=this.getParams(e);this.isCustomComponent(e)?this.genCustomParams(t):this.genCommonParams(t)}genCommonParams(e){if("string"==typeof e)this.cache.concat(e);else if(e.size>0){this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE);let t=0;e.forEach(((r,n)=>{this.cache.concat(n,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(t,a.TokenClass.COLON,a.TokenClass.SPACE,e,a.TokenClass.COMMA)})),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genObjectProperty(e){let t=0;this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE),e.forEach(((r,n)=>{this.cache.concat(n,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{e.accept(this),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.decIndent(),this.cache.indentOn()),this.cache.indentOn(),this.cache.concat(a.TokenClass.RBRA)),(null!==e.properties||null!==e.mediaProperties)&&(null!==e.content&&0!==e.content.length||this.cache.incIndent(),this.getProperties(e).forEach(((e,t)=>{this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.PROPERTY_START,t,a.TokenClass.TAG_START),this.cache.indentOff(),"string"==typeof e?this.cache.concat(e,a.TokenClass.TAG_END):this.genObjectProperty(e)})),null!==e.content&&0!==e.content.length||this.cache.decIndent()),this.genEnd(e)}genStart(e){this.genIfStart(e),this.genForTagStart(e),this.genCustomImport(e)}genEnd(e){this.genForTagEnd(e),this.genIfEnd(e)}genForTagStart(e){var t;void 0!==(null===(t=e.forEachObj)||void 0===t?void 0:t.for)&&(this.cache.concat("ForEach",a.TokenClass.TAG_START,e.forEachObj.for.toString(),a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE))}genForTagEnd(e){null!==e.forEachObj&&(this.cache.concat(a.TokenClass.RBRA),void 0!==e.forEachObj.key&&""!==e.forEachObj.key&&(this.cache.concat(a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.concat("return ",e.forEachObj.key.toString(),a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.TAG_END,a.TokenClass.RBRA),this.cache.indentOff()),this.cache.concat(a.TokenClass.TAG_END))}genIfStart(e){null!==e.ifBoolean&&(this.cache.concat("if",a.TokenClass.SPACE,a.TokenClass.TAG_START,e.ifBoolean.toString(),a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.incIndent())}genIfEnd(e){null!==e.ifBoolean&&(this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genMediaQuery(e){const t=new Map,r=new Map;if(this.collectMediaQueryMap(e,t),this.collectDefaultValueMap(e,r),0===t.size&&0===r.size)return;const n=(0,i.getUniqueName)("mediaQuery"),s=(0,i.getUniqueName)("initForMediaQuery"),l=(0,i.getUniqueName)("mediaQueryCb"),p=(0,i.getUniqueName)("saveMediaQueryResult"),c=(0,i.getUniqueName)("updateForMediaQuery"),u=new o.Cache(a.TokenClass.INDENT,1),f=new o.Cache(a.TokenClass.INDENT,1),y=new o.Cache(a.TokenClass.INDENT,1),d=new o.Cache(a.TokenClass.INDENT,1),m=new o.Cache(a.TokenClass.INDENT,1),g=new o.Cache(a.TokenClass.INDENT,1),h=new o.Cache(a.TokenClass.INDENT,1),E=new o.Cache(a.TokenClass.INDENT,2);this.genVariableDeclare(r,u,a.TokenClass.UNDEFINED),this.genMediaQueryCb(l,f),this.genMediaQueryListener(t,y,d),this.genInitFuc(s,r,m),this.genMediaQueryCbFnc(p,c,t,g),this.genUpdateFnc(c,s,t,h),this.genAboutToAppear(l,p,t,E),this.etsImport.indentOff(),this.aboutToAppear.indentOff(),this.etsVariable.indentOff(),this.etsFunction.indentOff(),this.etsImport.indentOff(),this.etsImport.concat("import ",n," from '@ohos.mediaquery'",a.TokenClass.NEW_LINE),this.aboutToAppear.concat(E.toString()),this.etsVariable.concat(u.toString(),f.toString(),y.toString(),d.toString()),this.etsFunction.concat(g.toString(),a.TokenClass.NEW_LINE,m.toString(),a.TokenClass.NEW_LINE,h.toString()),this.etsImport.indentOn(),this.aboutToAppear.indentOn(),this.etsVariable.indentOn(),this.etsFunction.indentOn(),this.needMediaQuery=!1}genCustomTag(e){this.genVariableDeclare(e.defaultValue,this.cache)}genVariableDeclare(e,t,r){t.indentOn(),e.forEach(((e,n)=>{const o=e[2];""!==o&&(t.concat(o,a.TokenClass.SPACE),t.indentOff()),t.concat(n.slice(5),a.TokenClass.COLON,a.TokenClass.SPACE,e[1]),t.indentOff();const i=null!=r?r:e[0];null!=i&&t.concat(a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,i,a.TokenClass.NEW_LINE),t.indentOn()}))}genMediaQueryCb(e,t){t.concat(e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.NULL,a.TokenClass.NEW_LINE)}genMediaQueryListener(e,t,r){const n=(0,i.getUniqueName)("mediaQuery");e.forEach(((e,o)=>{const s=(0,i.getUniqueName)(this.getMediaQueryVariableName(o));t.concat(s,a.TokenClass.COLON,a.TokenClass.SPACE,a.TokenClass.BOOLEAN,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.FALSE,a.TokenClass.NEW_LINE),r.concat(`listener_${s}`,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,n,a.TokenClass.PROPERTY_START,"matchMediaSync",a.TokenClass.TAG_START,`'${o}'`,a.TokenClass.TAG_END,a.TokenClass.NEW_LINE)}))}genInitFuc(e,t,r){r.concat(e,a.TokenClass.TAG_START,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),r.indentOn(),r.incIndent(),t.forEach(((e,t)=>{r.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e[0],a.TokenClass.NEW_LINE)})),r.decIndent(),r.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genMediaQueryCbFnc(e,t,r,n){const o=Array.from(r.entries());n.concat(e,a.TokenClass.TAG_START,"mediaQueryResult",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),n.incIndent(),n.concat(a.TokenClass.SWITCH,a.TokenClass.SPACE,a.TokenClass.TAG_START,"mediaQueryResult.media",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),n.incIndent();for(let e=0;e{const r=(0,i.getUniqueName)(this.getMediaQueryVariableName(t));n.concat(a.TokenClass.IF,a.TokenClass.SPACE,a.TokenClass.TAG_START,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,r,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),n.incIndent(),e.forEach(((e,t)=>{n.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e,a.TokenClass.NEW_LINE)})),n.decIndent(),n.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)})),n.decIndent(),n.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genAboutToAppear(e,t,r,n){let o=1;n.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,`${t}.bind(this)`,a.TokenClass.NEW_LINE),r.forEach(((t,s)=>{const l=`listener_${(0,i.getUniqueName)(this.getMediaQueryVariableName(s))}`;n.indentOn(),n.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,l,a.TokenClass.PROPERTY_START,`on('change', this.${e})`),o0&&e.mediaParams.forEach(((e,r)=>{t.set(r,e)})),t}getProperties(e){const t=new Map;return e.properties.forEach(((e,r)=>{t.set(r,e)})),e.mediaProperties.forEach(((e,r)=>{t.set(r,e)})),t}collectDefaultValueMap(e,t){void 0!==e.defaultValue&&e.defaultValue.forEach(((e,r)=>{t.set(r,e)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectDefaultValueMap(e,t)}))}collectMediaQueryMap(e,t){void 0!==e.mediaKeyProperty&&e.mediaKeyProperty.forEach(((e,r)=>{var n;const o=null!==(n=t.get(r))&&void 0!==n?n:new Map;e.forEach(((e,t)=>{o.set(t,e)})),t.set(r,o)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectMediaQueryMap(e,t)}))}getMediaQueryVariableName(e){const t="device-type: ",r="orientation: ",n=e.substring(e.indexOf(t),e.length),o=n.substring(t.length,n.indexOf(")")),a=e.substring(e.indexOf(r),e.length),i=a.substring(r.length,a.indexOf(")"));return`${o}${i.slice(0,1).toUpperCase()+i.slice(1).toLowerCase()}`}}t.ASTNodeGenerator=l,l.instance=void 0},413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ETSBridge=void 0;const n=r(519),o=r(973),a=r(729),i=r(125),s=r(366);t.ETSBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map;let r=null;const l=new Map,p=new n.Tag(e.type,t,r,l,null);if((0,o.parseVisualModel)(e,p),(0,a.parseMediaVisualModel)(e,p),(0,i.parseCustomVisualModel)(e,p),(0,s.parseCustomMediaVisualModel)(e,p),e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}return p.content=r,p}}},459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genCustomEts=t.genETS=t.EMPTY=void 0;const n=r(623),o=r(862);t.EMPTY={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""},t.genETS=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" ",2));return e.accept(t),{build:t.cache.toString(),etsImport:t.etsImport.toString(),etsVariable:t.etsVariable.toString(),etsFunction:t.etsFunction.toString(),aboutToAppear:t.aboutToAppear.toString()}},t.genCustomEts=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" ",1));return e.accept(t),t.cache.toString()}},435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;const n=r(459);t.StringWriter=class{genETS(e){return(0,n.genETS)(e)}}},51:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.INDENT=" ",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.SPACE=" ",r.LQUOTE="'",r.RQUOTE="'",r.TAG_START="(",r.TAG_END=")",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDynamicValueByDecorator=t.getMediaVariableDecorator=t.getCustomAttrType=t.getCustomAttributeMap=t.setCustomAttribute=void 0;const n=r(891),o=new Map;function a(){return o}function i(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.decorator)&&void 0!==r?r:"normal"}t.setCustomAttribute=function(e){var t,r;const a=e.type;(null!==(r=null===(t=(0,n.getInstance)().customData)||void 0===t?void 0:t.property.get(a))&&void 0!==r?r:new Map).forEach(((e,t)=>{const r=`${t}-${a.replace(/\//g,"-")}`;o.set(r,e)}))},t.getCustomAttributeMap=a,t.getCustomAttrType=function(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.type)&&void 0!==r?r:""},t.getMediaVariableDecorator=function(e){const t=i(e);let r="";return"@Link"!==t&&"@Prop"!==t||(r="@State"),r},t.getDynamicValueByDecorator=function(e,t){let r=t;return"@Link"===i(e)&&(r=t.replace("this.","$")),r}},125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumParserMap=t.genCustomEvent=t.parseCustomVisualModel=void 0;const n=r(891),o=r(973),a=r(135),i=r(195);function s(e,t){if(!(t.params instanceof Map))return;const r=function(e){var t,r;const o=e.type;return[...null!==(r=null===(t=(0,n.getInstance)().customData)||void 0===t?void 0:t.event.get(o))&&void 0!==r?r:[]]}(e);for(const n of r){const r=e.property.get(n);void 0!==r&&""!==r&&("this"===r.split(".")[0]?t.params.set(n,r+".bind(this)"):t.params.set(n,r))}}t.parseCustomVisualModel=function(e,r){(0,i.setCustomAttribute)(e),(0,i.getCustomAttributeMap)().forEach(((n,a)=>{if(function(e,t){return e.property.has(t)||e.dynamicProperty.has(t)}(e,a)){const i=p.get(n.type);"function"==typeof i&&i(a,e,r);const s=t.enumParserMap.get(n.type);"function"==typeof s&&function(e,t,r,n){if((0,o.dynamicParamParser)(e,t,r))return;const a=t.property.get(e);!(0,o.isEmptyOrUndefined)(a)&&r.params instanceof Map&&r.params.set((0,o.getEtsPropName)(e),n(a))}(a,e,r,s)}})),s(e,r)},t.genCustomEvent=s;const l=(0,o.curry)(o.getEtsEnumValue),p=new Map([["string",o.stringParamParser],["boolean",o.rawDataParamParser],["number",o.rawDataParamParser],["any[]",o.rawDataParamParser],["object",o.rawDataParamParser],["Date",function(e,t,r){(0,o.dateParamParser)(e,(0,o.getEtsPropName)(e),t,r)}]]);t.enumParserMap=new Map([["Alignment",function(e){const t=(0,o.getBackgroundImagePositionEnumValue)(e);return""!==t?t:(0,o.getEtsEnumValue)("Alignment.",e)}],["Direction",l("Direction.")],["ItemAlign",o.dealWithAlignSelf],["BorderStyle",l("BorderStyle.")],["ImageRepeat",o.dealWithBackgroundRepeat],["ImageSize",l("ImageSize.")],["Visibility",l("Visibility.")],["FontStyle",l("FontStyle.")],["FontWeight",o.dealWithFontWeight],["ButtonType",l("ButtonType.")],["Color",l("Color.")],["LineCapStyle",l("LineCapStyle.")],["ImageFit",l("ImageFit.")],["ImageInterpolation",l("ImageInterpolation.")],["ImageRenderMode",l("ImageRenderMode.")],["ProgressStyle",l("ProgressStyle.")],["SliderStyle",l("SliderStyle.")],["TextAlign",l("TextAlign.")],["TextOverflow",l("TextOverflow.")],["TextDecorationType",l("TextDecorationType.")],["TextCase",l("TextCase.")],["HorizontalAlign",o.dealWithColumnAlignItems],["FlexAlign",a.dealWithJustifyAlignContent],["VerticalAlign",o.dealWithRowAlignItems],["FlexDirection",l("FlexDirection.")],["FlexWrap",o.dealWithWrap],["Axis",l("Axis.")],["EdgeEffect",l("EdgeEffect.")],["Sticky",l("Sticky.")],["EnterKeyType",l("EnterKeyType.")],["ToggleType",l("ToggleType.")],["InputType",l("InputType.")]])},223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonMediaParserArray=t.ifParser=t.forEachParser=void 0;const n=r(973),o=r(34),a=(0,n.curry)(((e,t)=>t.hasMediaProperty(e)));function i(e,t,r){var o,a,i,s;const l=null!==(o=e.property.get("left"))&&void 0!==o?o:e.dynamicProperty.get("left"),p=null!==(a=e.property.get("top"))&&void 0!==a?a:e.dynamicProperty.get("top"),c=t.get("left"),u=t.get("top"),f=r.get("left"),y=r.get("top");let d="undefined",m="undefined";return(0,n.isEmptyOrUndefined)(c)&&(0,n.isEmptyOrUndefined)(u)||(d=(0,n.quoteString)(null!==(i=null!=c?c:l)&&void 0!==i?i:"0"),m=(0,n.quoteString)(null!==(s=null!=u?u:p)&&void 0!==s?s:"0")),(0,n.isEmptyOrUndefined)(f)&&(0,n.isEmptyOrUndefined)(y)||(d=null!=f?f:d,m=null!=y?y:m),{leftValue:d,topValue:m}}function s(e,t){e.forEach(((e,r)=>{"undefined"!==e&&t.set(r,"undefined")}))}function l(e,t){var r,o;const a=new Map,i=t.split("-")[0];return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((r,o)=>{var s,l,p,c;const u=r.get(i),f=null===(l=null===(s=e.dynamicMediaProperty)||void 0===s?void 0:s.get(o))||void 0===l?void 0:l.get(i),y=null!==(c=null!==(p=r.get(t))&&void 0!==p?p:f)&&void 0!==c?c:u;void 0!==y&&a.set(o,(0,n.quoteString)(y))})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{var n;const o=e.get(i),s=null!==(n=e.get(t))&&void 0!==n?n:o;void 0!==s&&a.set(r,s)})),a}const p=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.quoteString);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.quoteString),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),c=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),u=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),f=(0,n.curry)(((e,t,r,a)=>{const i=(0,o.getMediaProperty)(r,e,(0,n.curry)(n.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,n.curry)(n.getEtsEnumValue)(t)),l=(0,o.getVariableName)(r.id,e);a.setDefaultValue(l,(0,o.getType)(e),s),a.setMediaProperty(l,i),a.mediaProperties.set((0,n.getEtsPropName)(e),l)})),y=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.dealWithColor);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.dealWithColor),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)}));function d(e,t,r,o=!1){(0,n.isEmptyOrUndefined)(t)||r.set(e,o?t:(0,n.quoteString)(t))}t.forEachParser=function(e,t){var r,n,a;const i=null!==(r=e.dynamicProperty.get("for"))&&void 0!==r?r:"[1]",s=null!==(n=e.property.get("item"))&&void 0!==n?n:"item",l=null!==(a=e.property.get("idx"))&&void 0!==a?a:"idx",p=e.dynamicProperty.get("keyGenerator"),c=(0,o.getMediaProperty)(e,"for");if(0===c.size)return;const u=(0,o.getVariableName)(e.id,"for"),f={for:u,key:p,item:s,idx:l};t.setDefaultValue(u,(0,o.getType)("for"),i),t.setMediaProperty(u,c),t.setForEachObj(f)},t.ifParser=function(e,t){const r=(0,o.getMediaProperty)(e,"if");if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"if"),a=(0,o.getVariableName)(e.id,"if");t.setDefaultValue(a,(0,o.getType)("if"),n),t.setMediaProperty(a,r),t.setIfBoolean(a)};const m=(0,n.curry)(((e,t,r)=>{const a=new Map,i=t.property.get(e),s=t.dynamicProperty.get(e),p=null!=s?s:i,c=["top","bottom","left","right"];let u=0;for(const i of c){const s=`${e}-${i}`,c=t.property.get(s),f=t.dynamicProperty.get(s),y=l(t,s);let m=(0,n.isEmptyOrUndefined)(p)?"undefined":(0,n.quoteString)(p);if((0,n.isEmptyOrUndefined)(c)||(m=(0,n.quoteString)(c)),(0,n.isEmptyOrUndefined)(f)||(m=f),y.size>0){const e=(0,o.getVariableName)(t.id,s);r.setDefaultValue(e,(0,o.getType)(s),m),r.setMediaProperty(e,y),d(i,e,a,!0),u++}else d(i,m,a,!0)}u>0&&r.mediaProperties.set(e,a)}));function g(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null===t?"undefined":void 0!==t[5]?`{ width: ${(0,n.quoteString)(t[1])}, height: ${(0,n.quoteString)(t[5])} }`:`{ width: ${(0,n.quoteString)(t[1])} }`}function h(e,t){var r,o;const a=new Map,i=new Map,s=T(t),l=v(t);return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((e,r)=>{const o=e.get(t);if(!(0,n.isEmptyOrUndefined)(o)){let e=s(o);e=""!==e?e:"undefined",a.set(r,e),i.set(r,l(o))}})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{const o=e.get(t);(0,n.isEmptyOrUndefined)(o)||(a.set(r,o),i.set(r,"undefined"))})),{enumValueMap:a,objValueMap:i}}function E(e,t){const r=e.property.get(t),o=e.dynamicProperty.get(t),a=T(t),i=v(t);let s="undefined",l="undefined";if(!(0,n.isEmptyOrUndefined)(r)){const e=a(r);s=""!==e?e:s,l=i(r)}return(0,n.isEmptyOrUndefined)(o)||(s=o,l="undefined"),{enumDefault:s,objDefault:l}}function T(e){return new Map([["background-image-size",n.getBackgroundImageSizeEnumValue],["background-image-position",n.getBackgroundImagePositionEnumValue]]).get(e)}function v(e){return new Map([["background-image-size",g],["background-image-position",S]]).get(e)}function S(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null===t?"undefined":`{ x: ${(0,n.quoteString)(t[1])}, y: ${(0,n.quoteString)(t[4])} }`}t.commonMediaParserArray=[[a("width"),p("width")],[a("height"),p("height")],[function(e){return e.hasMediaProperty("constraint-size-min-width")||e.hasMediaProperty("constraint-size-max-width")||e.hasMediaProperty("constraint-size-min-height")||e.hasMediaProperty("constraint-size-min-height")},function(e,t){const r=new Map,a=["min-width","max-width","min-height","max-height"];for(const i of a){const a=`constraint-size-${i}`,s=(0,o.getMediaProperty)(e,a,n.quoteString),l=(0,o.getMediaDefaultValue)(e,a,n.quoteString);if(s.size>0){const p=(0,o.getVariableName)(e.id,a);t.setDefaultValue(p,(0,o.getType)(a),l),t.setMediaProperty(p,s),d((0,n.getEtsPropName)(i),p,r,!0)}}r.size>0&&t.mediaProperties.set("constraintSize",r)}],[a("align"),f("align","Alignment.")],[a("direction"),f("direction","Direction.")],[function(e){return e.hasMediaProperty("left")||e.hasMediaProperty("top")},function(e,t){var r;const n=null!==(r=e.property.get("position"))&&void 0!==r?r:"relative",{leftValue:a,topValue:l}=i(e,e.property,e.dynamicProperty),{mediaPositionLeft:p,mediaPositionTop:c,mediaOffsetLeft:u,mediaOffsetTop:f}=function(e){var t,r;const n=new Map,o=new Map,a=new Map,s=new Map,l=null!==(t=e.mediaProperty)&&void 0!==t?t:new Map,p=null!==(r=e.dynamicMediaProperty)&&void 0!==r?r:new Map,c=new Set;for(const[e]of l)c.add(e);for(const[e]of p)c.add(e);return c.forEach((t=>{var r,l,p,c;const u=null!==(l=null===(r=e.mediaProperty)||void 0===r?void 0:r.get(t))&&void 0!==l?l:new Map,f=null!==(c=null===(p=e.dynamicMediaProperty)||void 0===p?void 0:p.get(t))&&void 0!==c?c:new Map,y=u.get("position"),{leftValue:d,topValue:m}=i(e,u,f);"absolute"===y?("undefined"!==d&&n.set(t,d),"undefined"!==m&&o.set(t,m)):("undefined"!==d&&a.set(t,d),"undefined"!==m&&s.set(t,m))})),{mediaPositionLeft:n,mediaPositionTop:o,mediaOffsetLeft:a,mediaOffsetTop:s}}(e),y=p.size>0||c.size>0||"absolute"===n,d=u.size>0||f.size>0||"relative"===n,m=(0,o.getVariableName)(e.id,"positionLeft"),g=(0,o.getVariableName)(e.id,"positionTop"),h=(0,o.getVariableName)(e.id,"offsetLeft"),E=(0,o.getVariableName)(e.id,"offsetTop");if(0!==p.size||0!==c.size||0!==f.size||0!==u.size){if(y&&d&&(s(p,u),s(u,p),s(c,f),s(f,c)),y){const e="absolute"===n?a:"undefined",r="absolute"===n?l:"undefined";t.setDefaultValue(m,(0,o.getType)("left"),e),t.setDefaultValue(g,(0,o.getType)("top"),r),t.setMediaProperty(m,p),t.setMediaProperty(g,c),t.mediaProperties.set("position",new Map([["x",m],["y",g]]))}if(d){const e="relative"===n?a:"undefined",r="relative"===n?l:"undefined";t.setDefaultValue(h,(0,o.getType)("left"),e),t.setDefaultValue(E,(0,o.getType)("top"),r),t.setMediaProperty(h,u),t.setMediaProperty(E,f),t.mediaProperties.set("offset",new Map([["x",h],["y",E]]))}}}],[a("aspect-ratio"),c("aspect-ratio")],[a("display-priority"),c("display-priority")],[a("flex-basis"),p("flex-basis")],[a("flex-grow"),c("flex-grow")],[a("flex-shrink"),c("flex-shrink")],[a("align-self"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-self",n.dealWithAlignSelf);if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"align-self",n.dealWithAlignSelf),i=(0,o.getVariableName)(e.id,"align-self");t.setDefaultValue(i,(0,o.getType)("align-self"),a),t.setMediaProperty(i,r),t.mediaProperties.set("alignSelf",i)}],[a("border-style"),f("border-style","BorderStyle.")],[a("border-width"),p("border-width")],[a("border-color"),y("border-color")],[a("border-radius"),p("border-radius")],[a("background-color"),y("background-color")],[function(e){return e.hasMediaProperty("background-image-src")||e.hasMediaProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),a=e.property.get("background-image-repeat"),i=e.dynamicProperty.get("background-image-src"),s=e.dynamicProperty.get("background-image-repeat"),l=(0,o.getMediaProperty)(e,"background-image-src",n.dealWithSrc),p=(0,o.getMediaProperty)(e,"background-image-repeat",n.dealWithBackgroundRepeat);if(0===l.size&&0===p.size)return;let c=(0,n.dealWithSrc)(null!=r?r:"");if((0,n.isEmptyOrUndefined)(i)||(c=i),l.size>0){const r=(0,o.getVariableName)(e.id,"background-image-src");t.setDefaultValue(r,(0,o.getType)("background-image-src"),c),t.setMediaProperty(r,l),c=r}let u="undefined";if(!(0,n.isEmptyOrUndefined)(a)){const e=(0,n.dealWithBackgroundRepeat)(a);null!=e&&""!==e&&(u=e)}if((0,n.isEmptyOrUndefined)(s)||(u=s),p.size>0){const r=(0,o.getVariableName)(e.id,"background-image-repeat");t.setDefaultValue(r,(0,o.getType)("background-image-repeat"),u),t.setMediaProperty(r,p),u=r}t.mediaProperties.set("backgroundImage",c+", "+u)}],[a("background-image-size"),function(e,t){const{enumValueMap:r,objValueMap:n}=h(e,"background-image-size");if(0===r.size&&0===n.size)return;const{enumDefault:a,objDefault:i}=E(e,"background-image-size"),s=(0,o.getVariableName)(e.id,"background-image-size-enum"),l=(0,o.getVariableName)(e.id,"background-image-size-obj");t.setDefaultValue(s,"ImageSize",a),t.setDefaultValue(l,"SizeOptions",i),t.setMediaProperty(s,r),t.setMediaProperty(l,n),t.mediaProperties.set("backgroundImageSize",`${s} !== undefined ? ${s} : ${l}`)}],[a("background-image-position"),function(e,t){const{enumValueMap:r,objValueMap:n}=h(e,"background-image-position");if(0===r.size&&0===n.size)return;const{enumDefault:a,objDefault:i}=E(e,"background-image-position"),s=(0,o.getVariableName)(e.id,"background-image-position-enum"),l=(0,o.getVariableName)(e.id,"background-image-position-obj");t.setDefaultValue(s,"Alignment",a),t.setDefaultValue(l,"Position",i),t.setMediaProperty(s,r),t.setMediaProperty(l,n),t.mediaProperties.set("backgroundImagePosition",`${s} !== undefined ? ${s} : ${l}`)}],[a("opacity"),c("opacity")],[a("visibility"),f("visibility","Visibility.")],[a("enabled"),u("enabled")],[a("font-color"),y("font-color")],[function(e){return e.hasMediaProperty("margin")||e.hasMediaProperty("margin-left")||e.hasMediaProperty("margin-top")||e.hasMediaProperty("margin-right")||e.hasMediaProperty("margin-bottom")},m("margin")],[function(e){return e.hasMediaProperty("padding")||e.hasMediaProperty("padding-left")||e.hasMediaProperty("padding-top")||e.hasMediaProperty("padding-right")||e.hasMediaProperty("padding-bottom")},m("padding")]]},135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.componentsMediaParserArray=t.dateMediaParamParser=t.rawDataMediaParamParser=t.stringMediaParamParser=t.dealWithJustifyAlignContent=void 0;const n=r(973),o=r(34),a=r(195),i=(0,n.curry)(((e,t,r)=>r.type===e&&r.hasMediaProperty(t)));function s(e){return isNaN(Number(e))?(0,n.getEtsEnumValue)("FontWeight.",e):e}function l(e){let t=(0,n.getEtsEnumValue)("FlexAlign.",e);return"flex-start"===e?t="FlexAlign.Start":"flex-end"===e&&(t="FlexAlign.End"),t}function p(e){return"TextOverflow."+(0,n.firstUpperCase)(e)}function c(e,t,r){var o,a;const i=new Map,s=null!==(o=e.mediaProperty)&&void 0!==o?o:new Map,l=null!==(a=e.dynamicMediaProperty)&&void 0!==a?a:new Map;return s.forEach(((e,o)=>{let a=e.get(t);const s=e.get(r);(0,n.isEmptyOrUndefined)(a)&&(0,n.isEmptyOrUndefined)(s)||(a="0"===a||(0,n.isEmptyOrUndefined)(a)?"0":a.substring(0,a.length-2),i.set(o,a))})),l.forEach(((e,r)=>{const o=e.get(t);(0,n.isEmptyOrUndefined)(o)||i.set(r,o)})),i}t.dealWithJustifyAlignContent=l;const u=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.quoteString);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.quoteString),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),f=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),y=(0,n.curry)(((e,t,r)=>{f(e,t,r)})),d=(0,n.curry)(((e,t,r,a)=>{const i=(0,o.getMediaProperty)(r,e,(0,n.curry)(n.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,n.curry)(n.getEtsEnumValue)(t)),l=(0,o.getVariableName)(r.id,e);a.setDefaultValue(l,(0,o.getType)(e),s),a.setMediaProperty(l,i),a.mediaProperties.set((0,n.getEtsPropName)(e),l)}));t.stringMediaParamParser=(0,n.curry)(((e,t,r)=>{const i=(0,o.getMediaProperty)(t,e,n.quoteString);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(t,e,n.quoteString),l=(0,o.getVariableName)(t.id,e),p=(0,a.getMediaVariableDecorator)(e);r.setDefaultValue(l,(0,o.getType)(e),s,p),r.setMediaProperty(l,i),r.mediaParams.set((0,n.getEtsPropName)(e),(0,a.getDynamicValueByDecorator)(e,l))})),t.rawDataMediaParamParser=(0,n.curry)(((e,t,r)=>{const i=(0,o.getMediaProperty)(t,e);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(t,e),l=(0,o.getVariableName)(t.id,e);r.setDefaultValue(l,(0,o.getType)(e),s),r.setMediaProperty(l,i),r.mediaParams.set((0,n.getEtsPropName)(e),(0,a.getDynamicValueByDecorator)(e,l))})),t.dateMediaParamParser=(0,n.curry)(((e,t,r,a,i)=>{const s=e=>void 0===e||""===e?"new Date()":"new Date ("+(0,n.quoteString)(e)+")",l=(0,o.getMediaProperty)(a,e,s);if(!(i.mediaParams instanceof Map)||0===l.size)return;const p=(0,o.getMediaDefaultValue)(a,e,s),c=(0,o.getVariableName)(a.id,e);i.setDefaultValue(c,(0,o.getType)(e),p,r),i.setMediaProperty(c,l),i.mediaParams.set(t,c)}));const m=(0,n.curry)(((e,t,r,n,a)=>{const i=(0,o.getMediaProperty)(n,e);if(!(a.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(n,e),l=(0,o.getVariableName)(n.id,e);a.setDefaultValue(l,(0,o.getType)(e),s,r),a.setMediaProperty(l,i),a.mediaParams.set(t,l)})),g=(0,n.curry)(((e,t,r,a)=>{const i=(0,o.getMediaProperty)(r,e,(0,n.curry)(n.getEtsEnumValue)(t));if(!(a.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,n.curry)(n.getEtsEnumValue)(t)),l=(0,o.getVariableName)(r.id,e);a.setDefaultValue(l,(0,o.getType)(e),s),a.setMediaProperty(l,i),a.mediaParams.set((0,n.getEtsPropName)(e),l)})),h=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.dealWithColor);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.dealWithColor),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),E=(0,n.curry)(((e,t,r,a)=>{const i=(0,o.getMediaProperty)(r,e,l);if(!(a.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,l),p=(0,o.getVariableName)(r.id,e);a.setDefaultValue(p,(0,o.getType)(e),s),a.setMediaProperty(p,i),a.mediaParams.set((0,n.getEtsPropName)(e),p)})),T=(0,n.curry)(((e,t,r,n)=>{const a=(0,o.getMediaProperty)(r,e,l);if(!(n.mediaProperties instanceof Map)||0===a.size)return;const i=(0,o.getMediaDefaultValue)(r,e,l),s=(0,o.getVariableName)(r.id,e);n.setDefaultValue(s,(0,o.getType)(e),i),n.setMediaProperty(s,a),n.mediaProperties.set("justifyContent",s)})),v=(0,n.curry)(((e,t)=>t.type===e));function S(e,t,r){const a=e.property.get(r),i=e.dynamicProperty.get(r),s=(0,o.getMediaProperty)(e,r,n.quoteString);if(0===s.size)return;let l="''";(0,n.isEmptyOrUndefined)(a)||(l=(0,n.quoteString)(a)),(0,n.isEmptyOrUndefined)(i)||(l=(0,n.getContentName)(i));const p=(0,o.getVariableName)(e.id,r);t.setDefaultValue(p,(0,o.getType)(r),l),t.setMediaProperty(p,s),t.setMediaParams(p)}const _=(0,n.curry)(((e,t,r,a)=>{let i=a.mediaProperties.get((0,n.getEtsPropName)(e));void 0===i&&(i=new Map);const l=`${e}-${t}`,p=(0,o.getVariableName)(r.id,l);let c=(0,o.getMediaProperty)(r,l,n.quoteString),u=(0,o.getMediaDefaultValue)(r,l,n.quoteString);if("string"!=typeof i){if((0,n.isEmptyOrUndefined)(u))return;"style"===t&&(c=(0,o.getMediaProperty)(r,l,(0,n.curry)(n.getEtsEnumValue)("FontStyle.")),u=(0,o.getMediaDefaultValue)(r,l,(0,n.curry)(n.getEtsEnumValue)("FontStyle."))),"weight"===t&&(c=(0,o.getMediaProperty)(r,l,s),u=(0,o.getMediaDefaultValue)(r,l,s)),a.setDefaultValue(p,(0,o.getType)(l),u),a.setMediaProperty(p,c),i.set(t,p)}a.mediaProperties.set((0,n.getEtsPropName)(e),i)}));function N(e,t){const r=(0,o.getMediaProperty)(e,"font-weight",n.dealWithFontWeight);if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"font-weight",n.dealWithFontWeight),i=(0,o.getVariableName)(e.id,"font-weight");t.setDefaultValue(i,(0,o.getType)("font-weight"),a),t.setMediaProperty(i,r),t.mediaProperties.set("fontWeight",i)}const C=[[i("button","label"),function(e,t){S(e,t,"label")}],[i("button","type"),d("type","ButtonType.")],[i("button","state-effect"),y("state-effect")],[i("button","font-size"),u("font-size")],[i("button","font-style"),d("font-style","FontStyle.")],[i("button","font-weight"),N],[i("button","font-family"),u("font-family")]],A=[[i("divider","vertical"),y("vertical")],[i("divider","color"),h("color")],[i("divider","stroke-width"),u("stroke-width")],[i("divider","line-cap"),d("line-cap","LineCapStyle.")]],P=[[v("image"),function(e,t){var r;const a=null!==(r=e.property.get("src"))&&void 0!==r?r:"",i=e.dynamicProperty.get("src"),s=(0,o.getMediaProperty)(e,"src",n.dealWithSrc);if(0===s.size)return;let l=(0,n.dealWithSrc)(a);(0,n.isEmptyOrUndefined)(i)||(l=i);const p=(0,o.getVariableName)(e.id,"src");t.setDefaultValue(p,(0,o.getType)("src"),l),t.setMediaProperty(p,s),t.setMediaParams(p)}],[i("image","alt"),u("alt")],[i("image","object-fit"),d("object-fit","ImageFit.")],[i("image","object-repeat"),d("object-repeat","ImageRepeat.")],[i("image","interpolation"),d("interpolation","ImageInterpolation.")],[i("image","render-mode"),d("render-mode","ImageRenderMode.")],[function(e){return e.hasMediaProperty("source-size-width")||e.hasMediaProperty("source-size-height")},function(e,t){let r=e.property.get("source-size-width"),a=e.property.get("source-size-height");const i=e.dynamicProperty.get("source-size-width"),s=e.dynamicProperty.get("source-size-height"),l=c(e,"source-size-width","source-size-height"),p=c(e,"source-size-height","source-size-width");if(0===l.size)return;r="0"===r||(0,n.isEmptyOrUndefined)(r)?"0":r.substring(0,r.length-2),a="0"===a||(0,n.isEmptyOrUndefined)(a)?"0":a.substring(0,a.length-2),(0,n.isEmptyOrUndefined)(i)||(r=i),(0,n.isEmptyOrUndefined)(s)||(a=s);const u=(0,o.getVariableName)(e.id,"source-size-width"),f=(0,o.getVariableName)(e.id,"source-size-height");t.setDefaultValue(u,(0,o.getType)("source-size-width"),r),t.setDefaultValue(f,(0,o.getType)("source-size-height"),a),t.setMediaProperty(u,l),t.setMediaProperty(f,p);const y=new Map([["width",u],["height",f]]);t.mediaProperties.set("sourceSize",y)}]],b=[[function(e){return"progress"===e.type&&(e.hasMediaProperty("value")||e.hasMediaProperty("total")||e.hasMediaProperty("style"))},function(e,t){const r=e.property.get("value"),a=e.dynamicProperty.get("value"),i=(0,o.getMediaProperty)(e,"value");if(!(t.mediaParams instanceof Map)||0===i.size)return;let s=null!=r?r:"0";(0,n.isEmptyOrUndefined)(a)||(s=a);const l=(0,o.getVariableName)(e.id,"value");t.setDefaultValue(l,(0,o.getType)("value"),s),t.setMediaProperty(l,i),t.mediaParams.set("value",l)}],[i("progress","total"),(0,t.rawDataMediaParamParser)("total")],[i("progress","style"),g("style","ProgressStyle.")],[i("progress","color"),h("color")]],M=[[i("slider","value"),(0,t.rawDataMediaParamParser)("value")],[i("slider","min"),(0,t.rawDataMediaParamParser)("min")],[i("slider","max"),(0,t.rawDataMediaParamParser)("max")],[i("slider","step"),(0,t.rawDataMediaParamParser)("step")],[i("slider","style"),g("style","SliderStyle.")],[i("slider","block-color"),h("block-color")],[i("slider","track-color"),h("track-color")],[i("slider","selected-color"),h("selected-color")],[i("slider","show-steps"),y("show-steps")],[i("slider","show-tips"),y("show-tips")]],w=[[i("text","content"),function(e,t){S(e,t,"content")}],[i("text","text-align"),d("text-align","TextAlign.")],[i("text","text-overflow"),function(e,t){const r=(0,o.getMediaProperty)(e,"text-overflow",p);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"text-overflow",p),a=(0,o.getVariableName)(e.id,"text-overflow");t.setDefaultValue(a,(0,o.getType)("text-overflow"),n),t.setMediaProperty(a,r),t.mediaProperties.set("textOverflow",new Map([["overflow",a]]))}],[i("text","max-lines"),f("max-lines")],[i("text","line-height"),u("line-height")],[function(e){return"text"===e.type&&(e.hasMediaProperty("decoration-type")||e.hasMediaProperty("decoration-color"))},function(e,t){const r=(0,o.getMediaProperty)(e,"decoration-type",(0,n.curry)(n.getEtsEnumValue)("TextDecorationType.")),a=(0,o.getMediaProperty)(e,"decoration-color",n.dealWithColor);if(0===r.size&&0===a.size)return;let i=(0,o.getMediaDefaultValue)(e,"decoration-type",(0,n.curry)(n.getEtsEnumValue)("TextDecorationType.")),s=(0,o.getMediaDefaultValue)(e,"decoration-color",n.dealWithColor);if(r.size>0){const n=(0,o.getVariableName)(e.id,"decoration-type");t.setDefaultValue(n,(0,o.getType)("decoration-type"),i),t.setMediaProperty(n,r),i=n}if(a.size>0){const r=(0,o.getVariableName)(e.id,"decoration-color");t.setDefaultValue(r,(0,o.getType)("decoration-color"),s),t.setMediaProperty(r,a),s=r}const l=new Map([["type",i]]);t.mediaProperties.set("decoration",l),"undefined"!==s&&l.set("color",s)}],[i("text","baseline-offset"),u("baseline-offset")],[i("text","text-case"),d("text-case","TextCase.")],[i("text","font-size"),u("font-size")],[i("text","font-style"),d("font-style","FontStyle.")],[i("text","font-weight"),N],[i("text","font-family"),u("font-family")]],R=[[i("column","space"),(0,t.stringMediaParamParser)("space")],[i("column","align-items-column"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-column",n.dealWithColumnAlignItems);if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"align-items-column",n.dealWithColumnAlignItems),i=(0,o.getVariableName)(e.id,"align-items-column");t.setDefaultValue(i,(0,o.getType)("align-items-column"),a),t.setMediaProperty(i,r),t.mediaProperties.set("alignItems",i)}],[i("column","justify-content-rc"),T("justify-content-rc","FlexAlign.")]],O=[[i("row","space"),(0,t.stringMediaParamParser)("space")],[i("row","align-items-row"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-row",n.dealWithRowAlignItems);if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"align-items-row",n.dealWithRowAlignItems),i=(0,o.getVariableName)(e.id,"align-items-row");t.setDefaultValue(i,(0,o.getType)("align-items-row"),a),t.setMediaProperty(i,r),t.mediaProperties.set("alignItems",i)}],[i("row","justify-content-rc"),T("justify-content-rc","FlexAlign.")]],I=[[i("flex","flex-direction"),function(e,t){const r=(0,o.getMediaProperty)(e,"flex-direction",(0,n.curry)(n.getEtsEnumValue)("FlexDirection."));if(!(t.mediaParams instanceof Map)||0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"flex-direction",(0,n.curry)(n.getEtsEnumValue)("FlexDirection.")),i=(0,o.getVariableName)(e.id,"flex-direction");t.setDefaultValue(i,(0,o.getType)("flex-direction"),a),t.setMediaProperty(i,r),t.mediaParams.set("direction",i)}],[i("flex","wrap"),function(e,t){const r=(0,o.getMediaProperty)(e,"wrap",n.dealWithWrap);if(!(t.mediaParams instanceof Map)||0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"wrap",n.dealWithWrap),i=(0,o.getVariableName)(e.id,"wrap");t.setDefaultValue(i,(0,o.getType)("wrap"),a),t.setMediaProperty(i,r),t.mediaParams.set("wrap",i)}],[i("flex","justify-content"),E("justify-content","FlexAlign.")],[i("flex","align-items-flex"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-flex",n.dealWithFlexAlignItems);if(!(t.mediaParams instanceof Map)||0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"align-items-flex",n.dealWithFlexAlignItems),i=(0,o.getVariableName)(e.id,"align-items-flex");t.setDefaultValue(i,(0,o.getType)("align-items-flex"),a),t.setMediaProperty(i,r),t.mediaParams.set("alignItems",i)}],[i("flex","align-content"),E("align-content","FlexAlign.")]],x=[[i("list","space"),(0,t.stringMediaParamParser)("space")],[i("list","initial-index"),(0,t.rawDataMediaParamParser)("initial-index")],[i("list","list-direction"),d("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasMediaProperty("divider-stroke-width")||e.hasMediaProperty("divider-color")||e.hasMediaProperty("divider-start-margin")||e.hasMediaProperty("divider-end-margin"))},function(e,t){const r=[["divider-stroke-width",n.quoteString],["divider-color",n.dealWithColor],["divider-start-margin",n.quoteString],["divider-end-margin",n.quoteString]];let a=0;const i=new Map;for(const[s,l]of r){const r=(0,o.getMediaProperty)(e,s,l),p=(0,n.getEtsPropName)(s.replace("divider-",""));let c=(0,o.getMediaDefaultValue)(e,s,l);if("undefined"===c&&"divider-stroke-width"===s&&(c="0"),r.size>0){const n=(0,o.getVariableName)(e.id,s);t.setDefaultValue(n,(0,o.getType)(s),c),t.setMediaProperty(n,r),c=n,a++}i.set(p,c)}a>0&&t.mediaProperties.set("divider",i)}],[i("list","edit-mode"),y("edit-mode")],[i("list","edge-effect"),d("edge-effect","EdgeEffect.")],[i("list","chain-animation"),y("chain-animation")]],L=[[i("list-item","sticky"),d("sticky","Sticky.")],[i("list-item","editable"),y("editable")]],k=[[i("swiper","index"),f("index")],[i("swiper","auto-play"),y("auto-play")],[i("swiper","interval"),f("interval")],[i("swiper","indicator"),y("indicator")],[i("swiper","loop"),y("loop")],[i("swiper","duration"),f("duration")],[i("swiper","vertical"),y("vertical")],[i("swiper","item-space"),u("item-space")],[i("swiper","cached-count"),f("cached-count")],[i("swiper","disable-swipe"),y("disable-swipe")]],D=[[i("text-input","placeholder"),(0,t.stringMediaParamParser)("placeholder")],[i("text-input","textInput-type"),function(e,t){const r=(0,o.getMediaProperty)(e,"textInput-type",(0,n.curry)(n.getEtsEnumValue)("InputType."));if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"textInput-type",(0,n.curry)(n.getEtsEnumValue)("InputType.")),i=(0,o.getVariableName)(e.id,"textInput-type");t.setDefaultValue(i,(0,o.getType)("textInput-type"),a),t.setMediaProperty(i,r),t.mediaProperties.set("type",i)}],[i("text-input","placeholderColor"),h("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasMediaProperty("placeholderFont-size")||e.hasMediaProperty("placeholderFont-weight")||e.hasMediaProperty("placeholderFont-family")||e.hasMediaProperty("placeholderFont-style"))},function(e,t){const r=[["size",n.quoteString],["weight",s],["family",n.quoteString],["style",(0,n.curry)(n.getEtsEnumValue)("FontStyle.")]];let a=0;const i=new Map;for(const[n,s]of r){const r=`placeholderFont-${n}`,l=(0,o.getMediaProperty)(e,r,s);let p=(0,o.getMediaDefaultValue)(e,r,s);if(l.size>0){const n=(0,o.getVariableName)(e.id,r);t.setDefaultValue(n,(0,o.getType)(r),p),t.setMediaProperty(n,l),p=n,a++}i.set(n,p)}a>0&&t.mediaProperties.set("placeholderFont",i)}],[i("text-input","enterKeyType"),d("enterKeyType","EnterKeyType.")],[i("text-input","caretColor"),h("caretColor")],[i("text-input","maxLength"),f("maxLength")]],F=[[i("refresh","friction"),(0,t.rawDataMediaParamParser)("friction")],[i("refresh","offset"),(0,t.stringMediaParamParser)("offset")],[i("refresh","refreshing"),(0,t.rawDataMediaParamParser)("refreshing")]],V=[[i("timePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[i("timePicker","useMilitaryTime"),y("useMilitaryTime")]],U=[[i("datePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[i("datePicker","start"),(0,t.dateMediaParamParser)("start","start","private")],[i("datePicker","end"),(0,t.dateMediaParamParser)("end","end","private")],[i("datePicker","lunar"),y("lunar")]],B=[[i("textPicker","range"),(0,t.rawDataMediaParamParser)("range")],[i("textPicker","textPicker-selected"),m("textPicker-selected","selected","@State")],[i("textPicker","defaultPickerItemHeight"),u("defaultPickerItemHeight")]],z=[[i("select","select-option"),function(e,t){!function(e,t,r){const a=e.dynamicProperty.get(r),i=(0,o.getMediaProperty)(e,r,n.quoteString);if(0===i.size)return;const s=null!=a?a:'[{value: ""}]',l=(0,o.getVariableName)(e.id,r);t.setDefaultValue(l,(0,o.getType)(r),s),t.setMediaProperty(l,i),t.setMediaParams(l)}(e,t,"select-option")}],[i("select","select-value"),function(e,t){const r="select-value",a=(0,o.getMediaProperty)(e,r,n.quoteString);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(e,r,n.quoteString),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,a),t.mediaProperties.set("value",s)}],[i("select","selected"),f("selected")],[i("select","font-size"),_("font","size")],[i("select","font-style"),_("font","style")],[i("select","font-family"),_("font","family")],[i("select","font-weight"),_("font","weight")],[i("select","selected-option-font-size"),_("selected-option-font","size")],[i("select","selected-option-font-style"),_("selected-option-font","style")],[i("select","selected-option-font-family"),_("selected-option-font","family")],[i("select","selected-option-font-weight"),_("selected-option-font","weight")],[i("select","selected-option-font-color"),h("selected-option-font-color")],[i("select","selected-option-bg-color"),h("selected-option-bg-color")],[i("select","option-font-size"),_("option-font","size")],[i("select","option-font-style"),_("option-font","style")],[i("select","option-font-family"),_("option-font","family")],[i("select","option-font-weight"),_("option-font","weight")],[i("select","option-font-color"),h("option-font-color")],[i("select","option-bg-color"),h("option-bg-color")]],G=[[i("toggle","toggle-type"),function(e,t){const r="ToggleType.",a="toggle-type",i=(0,o.getMediaProperty)(e,a,(0,n.curry)(n.getEtsEnumValue)(r));if(!(t.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(e,a,(0,n.curry)(n.getEtsEnumValue)(r)),l=(0,o.getVariableName)(e.id,a);t.setDefaultValue(l,(0,o.getType)(a),s),t.setMediaProperty(l,i),t.mediaParams.set("type",l)}],[i("toggle","isOn"),(0,t.rawDataMediaParamParser)("isOn")],[i("toggle","selectedColor"),h("selectedColor")],[i("toggle","switchPointColor"),h("switchPointColor")]];t.componentsMediaParserArray=[...C,...A,...P,...b,...M,...w,...R,...O,...I,...x,...L,...k,...D,...G,...F,...V,...B,...z,...U]},366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCustomMediaVisualModel=void 0;const n=r(125),o=r(135),a=r(34),i=r(973),s=r(195);t.parseCustomMediaVisualModel=function(e,t){(0,s.getCustomAttributeMap)().forEach(((r,o)=>{if(function(e,t){return e.hasMediaProperty(t)}(e,o)){const p=l.get(r.type);"function"==typeof p&&p(o,e,t);const c=n.enumParserMap.get(r.type);"function"==typeof c&&function(e,t,r,n){const o=(0,a.getMediaProperty)(t,e,n);if(!(r.mediaParams instanceof Map)||0===o.size)return;const l=(0,a.getMediaDefaultValue)(t,e,n),p=(0,a.getVariableName)(t.id,e);r.setDefaultValue(p,(0,a.getType)(e),l),r.setMediaProperty(p,o),r.mediaParams.set((0,i.getEtsPropName)(e),(0,s.getDynamicValueByDecorator)(e,p))}(o,e,t,c)}}))};const l=new Map([["string",o.stringMediaParamParser],["boolean",o.rawDataMediaParamParser],["number",o.rawDataMediaParamParser],["any[]",o.rawDataMediaParamParser],["object",o.rawDataMediaParamParser],["Date",function(e,t,r){(0,o.dateMediaParamParser)(e,(0,i.getEtsPropName)(e),"private",t,r)}]])},729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMediaProperty=t.parseMediaVisualModel=void 0;const n=r(973),o=r(223),a=r(135);function i(e,t,r){const n=t.get(r);return void 0!==n&&n.has(e)}t.parseMediaVisualModel=function(e,t){(0,o.forEachParser)(e,t),(0,o.ifParser)(e,t);for(const r of l)("boolean"==typeof r[0]||r[0](e))&&r[1](e,t)},t.isMediaProperty=function(e,t){return!i(e,s,"common")&&!i(e,s,t)&&!i(e,s,"events")};const s=new Map([["common",new Set(["keyGenerator","item","idx"])],["events",new Set([...n.events])]]),l=[...o.commonMediaParserArray,...a.componentsMediaParserArray]},34:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMediaDefaultValue=t.getVariableName=t.getMediaProperty=t.getType=void 0;const n=r(294),o=r(973),a=r(290),i=r(195);function s(e,t){for(const r of t)if(r.property===e)return r.etsType;return""}t.getType=function(e){const t=e+"-visual",r=a.etsPropertyList;let n="";for(const e of r)void 0!==e.propertySet.properties&&(n=s(t,e.propertySet.properties)),e.propertySet.property===t&&(n=e.propertySet.etsType);return""!==n?function(e=""){const t=new Map([["Rfloat","Resource"],["Rstring","Resource"],["Rcolor","Resource"],["Rmedia","Resource"],["Rrawfile","Resource"],["Rplural","Resource"],["ETSArray","any[]"]]),r=new Array;return e.split("|").forEach((e=>{const n=t.get(e),o=null!=n?n:e;r.includes(o)||r.push(null!=n?n:e)})),r.join(" | ")}(n):(0,i.getCustomAttrType)(e)},t.getMediaProperty=function(e,t,r){var n,a;const i=new Map;return(null!==(n=e.mediaProperty)&&void 0!==n?n:new Map).forEach(((e,n)=>{let a=e.get(t);(0,o.isEmptyOrUndefined)(a)||("function"==typeof r&&(a=r(a)),(0,o.isEmptyOrUndefined)(a)||i.set(n,a))})),(null!==(a=e.dynamicMediaProperty)&&void 0!==a?a:new Map).forEach(((e,r)=>{let n=e.get(t);void 0===n||"content"!==t&&"label"!==t||(n=(0,o.getContentName)(n)),(0,o.isEmptyOrUndefined)(n)||i.set(r,n)})),i},t.getVariableName=function(e,t){const r=(0,n.getTagName)(e),a=`this.${(0,o.getEtsPropName)(r)}${(0,o.firstUpperCase)((0,o.getEtsPropName)(t))}`;return`${a}_${(0,n.getUniqueId)(a)}`},t.getMediaDefaultValue=function(e,t,r){var n;const a=e.property.get(t),i=e.dynamicProperty.get(t);let s=null!==(n=new Map([["if","true"],["auto-play","false"],["interval","3000"],["select-value","''"]]).get(t))&&void 0!==n?n:"undefined";return(0,o.isEmptyOrUndefined)(a)||(s="function"==typeof r?r(a):a,s=(0,o.isEmptyOrUndefined)(s)?"undefined":s),(0,o.isEmptyOrUndefined)(i)||(s=i),s}},973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getContentName=t.dealWithBackgroundRepeat=t.dealWithBackgroundImageSize=t.dealWithBackgroundImagePosition=t.dealWithFontWeight=t.dealWithColumnAlignItems=t.dealWithRowAlignItems=t.dealWithWrap=t.dealWithFlexAlignItems=t.dealWithAlignSelf=t.dealWithSrc=t.getBackgroundImagePositionEnumValue=t.getBackgroundImageSizeEnumValue=t.dealWithColor=t.getEtsEnumValue=t.getEtsPropName=t.firstUpperCase=t.events=t.parseVisualModel=t.customRawDataParamParser=t.rawDataParamParser=t.dateParamParser=t.stringParamParser=t.dynamicParamParser=t.isEmptyOrUndefined=t.customDynamicParamParser=t.quoteString=t.curry=void 0;const n=r(294),o=r(195);function a(e){return(...t)=>t.lengtht.property.has(e)||t.dynamicProperty.has(e))),s=a(((e,t,r)=>r.type===e&&(r.property.has(t)||r.dynamicProperty.has(t)))),l=a(((e,t,r)=>r.type===e));function p(e){return JSON.stringify(e)}function c(e,t,r){const n=t.dynamicProperty.get(e);return void 0!==n&&""!==n.trim()&&(r.properties.set(N(e),n),!0)}function u(e,t,r,n){const o=r.dynamicProperty.get(e);return void 0!==o&&""!==o.trim()&&n.params instanceof Map&&(n.params.set(t,o),!0)}t.quoteString=p,t.customDynamicParamParser=u;const f=a(((e,t,r)=>{if(c(e,t,r))return;const n=t.property.get(e);void 0!==n&&r.properties.set(N(e),p(n))}));function y(e){return void 0===e||""===e}t.isEmptyOrUndefined=y;const d=a(((e,t,r)=>{if(c(e,t,r))return;const n=t.property.get(e);y(n)||r.properties.set(N(e),n)})),m=a(((e,t,r)=>{if(c(e,t,r))return;const n=t.property.get(e);y(n)||r.properties.set(N(e),n)})),g=a(((e,t,r,n)=>{if(c(e,r,n))return;const o=r.property.get(e);y(o)||n.properties.set(N(e),C(t,o))}));function h(e,t,r){const n=t.dynamicProperty.get(e);if(void 0!==n&&""!==n.trim()&&r.params instanceof Map){const t=(0,o.getDynamicValueByDecorator)(e,n);return r.params.set(N(e),t),!0}return!1}t.dynamicParamParser=h,t.stringParamParser=a(((e,t,r)=>{if(h(e,t,r))return;const n=t.property.get(e);void 0!==n&&r.params instanceof Map&&r.params.set(N(e),p(n))})),t.dateParamParser=a(((e,t,r,n)=>{const o=r.dynamicProperty.get(e);if(void 0!==o&&""!==o.trim()&&n.params instanceof Map)return void n.params.set(t,o);const a=r.property.get(e);void 0!==a&&n.params instanceof Map&&n.params.set(t,(e=>void 0===e||""===e?"new Date()":"new Date ("+p(e)+")")(a))})),t.rawDataParamParser=a(((e,t,r)=>{if(h(e,t,r))return;const n=t.property.get(e);!y(n)&&r.params instanceof Map&&r.params.set(N(e),n)})),t.customRawDataParamParser=a(((e,t,r,n)=>{if(u(e,t,r,n))return;const o=r.property.get(e);!y(o)&&n.params instanceof Map&&n.params.set(t,o)}));const E=a(((e,r,n)=>{(0,t.rawDataParamParser)(e,r,n)})),T=a(((e,r,n)=>{(0,t.rawDataParamParser)(e,r,n)})),v=a(((e,t,r,n)=>{if(h(e,r,n))return;const o=r.property.get(e);!y(o)&&n.params instanceof Map&&n.params.set(N(e),C(t,o))})),S=a(((e,t,r)=>{if(c(e,t,r))return;let n=t.property.get(e);y(n)||(n=A(n),r.properties.set(N(e),n))}));function _([e,...t]){return(null==e?void 0:e.toUpperCase())+t.join("")}function N(e){let t=e;const r=e.indexOf("--");-1!==r&&(t=e.substring(0,r));const n=t.split("-");let o=n[0];for(let e=1;ee[0].toUpperCase()+e.slice(1))).join("")));const a=function(e){var t,r;const n=e.dynamicProperty.get("for"),o=e.dynamicProperty.get("keyGenerator"),a=null!==(t=e.property.get("item"))&&void 0!==t?t:"item",i=null!==(r=e.property.get("idx"))&&void 0!==r?r:"idx";return void 0!==e.dynamicProperty.get("for")?{for:n,key:o,item:a,idx:i}:null}(e);r.setForEachObj(a);const i=void 0!==e.dynamicProperty.get("if")?e.dynamicProperty.get("if"):e.property.get("if");void 0===i?r.setIfBoolean(null):r.setIfBoolean(i);for(const t of ie)("boolean"==typeof t[0]||t[0](e))&&t[1](e,r);!function(e,r){var n;const o="onDisappear",a="onDisAppear";for(let n of t.events){const t=e.property.get(n);n===o&&(n=a),void 0!==t&&""!==t&&("this"===t.split(".")[0]?r.properties.set(n,t+".bind(this)"):r.properties.set(n,t))}if(void 0!==e.property.get("newFunction")){const t=null!==(n=e.property.get("newFunction"))&&void 0!==n?n:"{}",i=JSON.parse(t);Object.keys(i).forEach((e=>{var t;const n=null!==(t=i[e].eventCodeGen)&&void 0!==t?t:"";e===o&&(e=a),r.properties.set(e,n)}))}}(e,r)},t.events=["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange","onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop","onComplete","onError","onFinish","onChange","onSubmit","onEditChanged","onStateChange","onRefreshing","onSelect"],t.firstUpperCase=_,t.getEtsPropName=N,t.getEtsEnumValue=C,t.dealWithColor=A,t.getBackgroundImageSizeEnumValue=M,t.getBackgroundImagePositionEnumValue=w;const R=a(((e,t,r,n)=>{if(!(n.params instanceof Map))return;const o=r.dynamicProperty.get(e);if(!y(o))return void n.params.set(N(e),o);const a=r.property.get(e);if(y(a))return;let i=C(t,a);"flex-start"===a?i=t+"Start":"flex-end"===a&&(i=t+"End"),n.params.set(N(e),i)})),O=a(((e,t,r,n)=>{if(!(n.properties instanceof Map))return;const o=r.dynamicProperty.get(e);if(!y(o))return void n.properties.set("justifyContent",o);const a=r.property.get(e);if(y(a))return;let i=C(t,a);"flex-start"===a?i=t+"Start":"flex-end"===a&&(i=t+"End"),n.properties.set("justifyContent",i)})),I=a(((e,t)=>t.type===e));function x(e){return null===e.match(/\$(r|rawfile)\('(.*)'\)$/)?p(e):e}function L(e){let t=C("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}function k(e){let t=C("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}function D(e){let t=C("FlexWrap.",e);return"nowrap"===e&&(t="FlexWrap.NoWrap"),t}function F(e){let t=C("VerticalAlign.",e);return"flex-start"===e?t="VerticalAlign.Top":"flex-end"===e&&(t="VerticalAlign.Bottom"),t}function V(e){let t=C("HorizontalAlign.",e);return"flex-start"===e?t="HorizontalAlign.Start":"flex-end"===e&&(t="HorizontalAlign.End"),t}function U(e){return["lighter","normal","regular","medium","bold","bolder"].includes(e)?C("FontWeight.",e):e}function B(e){const t=new Map([["repeat-x","X"],["repeat-y","Y"],["repeat","XY"],["no-repeat","NoRepeat"]]).get(e);if(null!=t&&""!==t)return C("ImageRepeat.",t)}t.dealWithSrc=x,t.dealWithAlignSelf=L,t.dealWithFlexAlignItems=k,t.dealWithWrap=D,t.dealWithRowAlignItems=F,t.dealWithColumnAlignItems=V,t.dealWithFontWeight=U,t.dealWithBackgroundImagePosition=function(e){if(new Set(["TopStart","Top","TopEnd","Start","Center","End","BottomStart","Bottom","BottomEnd"]).has(e))return"Alignment."+e;const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null!==t?`{ x: ${p(t[1])}, y: ${p(t[4])} }`:void 0},t.dealWithBackgroundImageSize=function(e){if(new Set(["Cover","Contain","Auto"]).has(e))return C("ImageSize.",e);const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null!==t?void 0!==t[5]?`{ width: ${p(t[1])}, height: ${p(t[5])} }`:`{ width: ${p(t[1])} }`:void 0},t.dealWithBackgroundRepeat=B;const z=a(((e,t,r,n)=>{let o=n.properties.get(N(e));void 0===o&&(o=new Map);const a=`${e}-${t}`,i=r.property.get(a),s=r.dynamicProperty.get(a);"string"!=typeof o&&(y(s)?y(i)||("size"!==t&&"family"!==t||o.set(t,p(i)),"style"===t&&o.set(t,C("FontStyle.",i)),"weight"===t&&o.set(t,U(i))):o.set(t,s)),n.properties.set(N(e),o)}));function G(e){return e.startsWith("$r(")?e:`\`\${${e}}\``}t.getContentName=G;const j=[[i("width"),f("width")],[i("height"),f("height")],[function(e){return e.hasProperty("constraint-size-min-width")||e.hasProperty("constraint-size-max-width")||e.hasProperty("constraint-size-min-height")||e.hasProperty("constraint-size-max-height")},function(e,t){const r=new Map,n=e.getProperty("constraint-size-min-width"),o=e.getProperty("constraint-size-max-width"),a=e.getProperty("constraint-size-min-height"),i=e.getProperty("constraint-size-max-height");b("minWidth",n,r,e.dynamicProperty.has("constraint-size-min-width")),b("maxWidth",o,r,e.dynamicProperty.has("constraint-size-max-width")),b("minHeight",a,r,e.dynamicProperty.has("constraint-size-min-height")),b("maxHeight",i,r,e.dynamicProperty.has("constraint-size-max-height")),r.size>0&&t.properties.set("constraintSize",r)}],[i("align"),g("align","Alignment.")],[i("direction"),g("direction","Direction.")],[function(e){return e.hasProperty("left")||e.hasProperty("top")},function(e,t){const r="absolute"===e.property.get("position")?"position":"offset",n=e.property.get("left"),o=e.property.get("top"),a=e.dynamicProperty.get("left"),i=e.dynamicProperty.get("top");if(y(a)&&y(i)&&y(n)&&y(o))return;const s=new Map([["x",`${p(null!=n?n:"0")}`],["y",`${p(null!=o?o:"0")}`]]);y(a)||s.set("x",a),y(i)||s.set("y",i),t.properties.set(r,s)}],[i("aspect-ratio"),d("aspect-ratio")],[i("display-priority"),d("display-priority")],[i("flex-basis"),f("flex-basis")],[i("flex-grow"),d("flex-grow")],[i("flex-shrink"),d("flex-shrink")],[i("align-self"),function(e,t){const r=e.dynamicProperty.get("align-self");if(!y(r))return void t.properties.set("alignSelf",r);const n=e.property.get("align-self");if(y(n))return;const o=L(n);t.properties.set("alignSelf",o)}],[i("border-style"),g("border-style","BorderStyle.")],[i("border-width"),f("border-width")],[i("border-color"),S("border-color")],[i("border-radius"),f("border-radius")],[i("background-color"),S("background-color")],[function(e){return e.hasProperty("background-image-src")||e.hasProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),n=e.property.get("background-image-repeat"),o=e.dynamicProperty.get("background-image-src"),a=e.dynamicProperty.get("background-image-repeat");if(y(r)&&y(n)&&y(o)&&y(a))return;let i=x(null!=r?r:"");if(y(o)||(i=o),y(a)){if(!y(n)){const e=B(n);null!=e&&""!==e&&(i=i+", "+e)}}else i=i+", "+a;t.properties.set("backgroundImage",i)}],[i("background-image-size"),function(e,t){const r=e.dynamicProperty.get("background-image-size");if(!y(r))return void t.properties.set("backgroundImageSize",r);const n=e.property.get("background-image-size");if(y(n))return;if(""!==M(n))return void t.properties.set("backgroundImageSize",C("ImageSize.",n));const o=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);null!==o&&(void 0!==o[5]?t.properties.set("backgroundImageSize",new Map([["width",`${p(o[1])}`],["height",`${p(o[5])}`]])):t.properties.set("backgroundImageSize",new Map([["width",`${p(o[1])}`]])))}],[i("background-image-position"),function(e,t){const r=e.dynamicProperty.get("background-image-position");if(!y(r))return void t.properties.set("backgroundImagePosition",r);const n=e.property.get("background-image-position");if(y(n))return;const o=w(n);if(""!==o)return void t.properties.set("backgroundImagePosition",o);const a=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);null!==a&&t.properties.set("backgroundImagePosition",new Map([["x",`${p(a[1])}`],["y",`${p(a[4])}`]]))}],[i("opacity"),d("opacity")],[i("visibility"),g("visibility","Visibility.")],[i("enabled"),m("enabled")],[i("font-color"),S("font-color")],[function(e){return e.hasProperty("margin")||e.hasProperty("margin-left")||e.hasProperty("margin-top")||e.hasProperty("margin-right")||e.hasProperty("margin-bottom")},function(e,t){var r,n,o,a;const i=new Map,s=e.getProperty("margin"),l=null!==(r=e.getProperty("margin-top"))&&void 0!==r?r:s,p=null!==(n=e.getProperty("margin-bottom"))&&void 0!==n?n:s,c=null!==(o=e.getProperty("margin-left"))&&void 0!==o?o:s,u=null!==(a=e.getProperty("margin-right"))&&void 0!==a?a:s,f=e.property.has("margin-top"),y=e.property.has("margin-bottom"),d=e.property.has("margin-left"),m=e.property.has("margin-right"),g=e.dynamicProperty.has("margin"),h=e.dynamicProperty.has("margin-top"),E=e.dynamicProperty.has("margin-bottom"),T=e.dynamicProperty.has("margin-left"),v=e.dynamicProperty.has("margin-right");b("top",l,i,h||!f&&g),b("bottom",p,i,E||!y&&g),b("left",c,i,T||!d&&g),b("right",u,i,v||!m&&g),i.size>0&&t.properties.set("margin",i)}],[function(e){return e.hasProperty("padding")||e.hasProperty("padding-left")||e.hasProperty("padding-top")||e.hasProperty("padding-right")||e.hasProperty("padding-bottom")},function(e,t){var r,n,o,a;const i=new Map,s=e.getProperty("padding"),l=null!==(r=e.getProperty("padding-top"))&&void 0!==r?r:s,p=null!==(n=e.getProperty("padding-bottom"))&&void 0!==n?n:s,c=null!==(o=e.getProperty("padding-left"))&&void 0!==o?o:s,u=null!==(a=e.getProperty("padding-right"))&&void 0!==a?a:s,f=e.property.has("padding-top"),y=e.property.has("padding-bottom"),d=e.property.has("padding-left"),m=e.property.has("padding-right"),g=e.dynamicProperty.has("padding"),h=e.dynamicProperty.has("padding-top"),E=e.dynamicProperty.has("padding-bottom"),T=e.dynamicProperty.has("padding-left"),v=e.dynamicProperty.has("padding-right");b("top",l,i,h||!f&&g),b("bottom",p,i,E||!y&&g),b("left",c,i,T||!d&&g),b("right",u,i,v||!m&&g),i.size>0&&t.properties.set("padding",i)}]],W=[[s("button","label"),function(e,t){const r=e.dynamicProperty.get("label");if(!y(r))return void t.setParams(G(r));const n=e.property.get("label");"string"==typeof n&&t.setParams(p(n))}],[s("button","type"),g("type","ButtonType.")],[s("button","state-effect"),m("state-effect")],[s("button","font-size"),f("font-size")],[s("button","font-style"),g("font-style","FontStyle.")],[s("button","font-weight"),P],[s("button","font-family"),f("font-family")]],$=[[s("divider","vertical"),m("vertical")],[s("divider","color"),S("color")],[s("divider","stroke-width"),f("stroke-width")],[s("divider","line-cap"),g("line-cap","LineCapStyle.")]],q=[[I("image"),function(e,t){var r;const n=e.dynamicProperty.get("src");if(!y(n))return void t.setParams(n);const o=null!==(r=e.property.get("src"))&&void 0!==r?r:"";t.setParams(x(o))}],[s("image","alt"),f("alt")],[s("image","object-fit"),g("object-fit","ImageFit.")],[s("image","object-repeat"),g("object-repeat","ImageRepeat.")],[s("image","interpolation"),g("interpolation","ImageInterpolation.")],[s("image","render-mode"),g("render-mode","ImageRenderMode.")],[function(e){return e.hasProperty("source-size-width")||e.hasProperty("source-size-height")},function(e,t){let r=e.getProperty("source-size-width"),n=e.getProperty("source-size-height");if(y(r)&&y(n))return;const o=e.dynamicProperty.has("source-size-width"),a=e.dynamicProperty.has("source-size-height");r="0"===r||y(r)?"0":o?r:r.substring(0,r.length-2),n="0"===n||y(n)?"0":a?n:n.substring(0,n.length-2);const i=new Map([["width",r],["height",n]]);t.properties.set("sourceSize",i)}]],H=[[function(e){return"progress"===e.type&&(e.hasProperty("value")||e.hasProperty("total")||e.hasProperty("style"))},function(e,t){var r;h("value",e,t)||t.params instanceof Map&&t.params.set("value",null!==(r=e.getProperty("value"))&&void 0!==r?r:"0")}],[s("progress","total"),(0,t.rawDataParamParser)("total")],[s("progress","style"),v("style","ProgressStyle.")],[s("progress","color"),S("color")]],Y=[[s("slider","value"),(0,t.rawDataParamParser)("value")],[s("slider","min"),(0,t.rawDataParamParser)("min")],[s("slider","max"),(0,t.rawDataParamParser)("max")],[s("slider","step"),(0,t.rawDataParamParser)("step")],[s("slider","style"),v("style","SliderStyle.")],[s("slider","block-color"),S("block-color")],[s("slider","track-color"),S("track-color")],[s("slider","selected-color"),S("selected-color")],[s("slider","show-steps"),m("show-steps")],[s("slider","show-tips"),m("show-tips")]],J=[[s("text","content"),function(e,t){const r=e.property.get("content"),n=e.dynamicProperty.get("content");y(n)?"string"==typeof r&&t.setParams(p(r)):t.setParams(G(n))}],[s("text","text-align"),g("text-align","TextAlign.")],[s("text","text-overflow"),function(e,t){const r=e.dynamicProperty.get("text-overflow");if(!y(r))return void t.properties.set("textOverflow",new Map([["overflow",r]]));const n=e.property.get("text-overflow");y(n)||t.properties.set("textOverflow",new Map([["overflow","TextOverflow."+_(n)]]))}],[s("text","max-lines"),d("max-lines")],[s("text","line-height"),f("line-height")],[function(e){return"text"===e.type&&(e.hasProperty("decoration-type")||e.hasProperty("decoration-color"))},function(e,t){const r=e.property.get("decoration-type"),n=e.dynamicProperty.get("decoration-type"),o=e.property.get("decoration-color"),a=e.dynamicProperty.get("decoration-color");if(y(r)&&y(o)&&y(n)&&y(a))return;const i=new Map;y(n)?i.set("type",y(r)?"TextDecorationType.None":C("TextDecorationType.",r)):i.set("type",n),t.properties.set("decoration",i),y(a)?y(o)||i.set("color",A(o)):i.set("color",a)}],[s("text","baseline-offset"),f("baseline-offset")],[s("text","text-case"),g("text-case","TextCase.")],[s("text","font-size"),f("font-size")],[s("text","font-style"),g("font-style","FontStyle.")],[s("text","font-weight"),P],[s("text","font-family"),f("font-family")]],Q=[[s("column","space"),(0,t.stringParamParser)("space")],[s("column","align-items-column"),function(e,t){const r=e.dynamicProperty.get("align-items-column");if(!y(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-column");if(y(n))return;const o=V(n);t.properties.set("alignItems",o)}],[s("column","justify-content-rc"),O("justify-content-rc","FlexAlign.")]],X=[[s("row","space"),(0,t.stringParamParser)("space")],[s("row","align-items-row"),function(e,t){const r=e.dynamicProperty.get("align-items-row");if(!y(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-row");if(y(n))return;const o=F(n);t.properties.set("alignItems",o)}],[s("row","justify-content-rc"),O("justify-content-rc","FlexAlign.")]],K=[[s("flex","flex-direction"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("flex-direction");if(!y(r))return void t.params.set("direction",r);const n=e.property.get("flex-direction");y(n)||t.params.set("direction",C("FlexDirection.",n))}],[s("flex","wrap"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("wrap");if(!y(r))return void t.params.set("wrap",r);const n=e.property.get("wrap");if(y(n))return;const o=D(n);t.params.set("wrap",o)}],[s("flex","justify-content"),R("justify-content","FlexAlign.")],[s("flex","align-items-flex"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-items-flex");if(!y(r))return void t.params.set("alignItems",r);const n=e.property.get("align-items-flex");if(y(n))return;const o=k(n);t.params.set("alignItems",o)}],[s("flex","align-content"),R("align-content","FlexAlign.")]],Z=[[s("list","space"),(0,t.stringParamParser)("space")],[s("list","initial-index"),(0,t.rawDataParamParser)("initial-index")],[s("list","list-direction"),g("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasProperty("divider-stroke-width")||e.hasProperty("divider-color")||e.hasProperty("divider-start-margin")||e.hasProperty("divider-end-margin"))},function(e,t){const r=e.property.get("divider-stroke-width"),n=e.dynamicProperty.get("divider-stroke-width"),o=new Map([["strokeWidth",`${p(null!=r?r:"0")}`]]);y(n)||o.set("strokeWidth",n);const a=e.property.get("divider-color"),i=e.dynamicProperty.get("divider-color"),s=e.property.get("divider-start-margin"),l=e.dynamicProperty.get("divider-start-margin"),c=e.property.get("divider-end-margin"),u=e.dynamicProperty.get("divider-end-margin");y(i)?y(a)||o.set("color",A(a)):o.set("color",i),y(l)?y(s)||o.set("startMargin",p(s)):o.set("startMargin",l),y(u)?y(c)||o.set("endMargin",p(c)):o.set("endMargin",u),t.properties.set("divider",o)}],[s("list","edit-mode"),m("edit-mode")],[s("list","edge-effect"),g("edge-effect","EdgeEffect.")],[s("list","chain-animation"),m("chain-animation")]],ee=[[s("list-item","sticky"),g("sticky","Sticky.")],[s("list-item","editable"),m("editable")]],te=[[s("swiper","index"),d("index")],[s("swiper","auto-play"),m("auto-play")],[s("swiper","interval"),d("interval")],[s("swiper","indicator"),m("indicator")],[s("swiper","loop"),m("loop")],[s("swiper","duration"),d("duration")],[s("swiper","vertical"),m("vertical")],[s("swiper","item-space"),f("item-space")],[s("swiper","cached-count"),d("cached-count")],[s("swiper","disable-swipe"),m("disable-swipe")]],re=[[s("text-input","placeholder"),(0,t.stringParamParser)("placeholder")],[s("text-input","textInput-type"),function(e,t){const r=e.dynamicProperty.get("textInput-type");if(!y(r))return void t.properties.set("type",r);const n=e.property.get("textInput-type");y(n)||t.properties.set("type","InputType."+n)}],[s("text-input","placeholderColor"),S("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasProperty("placeholderFont-size")||e.hasProperty("placeholderFont-weight")||e.hasProperty("placeholderFont-family")||e.hasProperty("placeholderFont-style"))},function(e,t){const r=e.property.get("placeholderFont-size"),n=e.dynamicProperty.get("placeholderFont-size"),o=e.property.get("placeholderFont-weight"),a=e.dynamicProperty.get("placeholderFont-weight"),i=e.property.get("placeholderFont-family"),s=e.dynamicProperty.get("placeholderFont-family"),l=e.property.get("placeholderFont-style"),c=e.dynamicProperty.get("placeholderFont-style"),u=new Map;y(n)?y(r)||u.set("size",parseInt(r)):u.set("size",n),y(a)?y(o)||u.set("weight",isNaN(Number(o))?C("FontWeight.",o):o):u.set("weight",a),y(s)?y(i)||u.set("family",p(i)):u.set("family",s),y(c)?y(l)||u.set("style",C("FontStyle.",l)):u.set("style",c),t.properties.set("placeholderFont",u)}],[s("text-input","enterKeyType"),g("enterKeyType","EnterKeyType.")],[s("text-input","caretColor"),S("caretColor")],[s("text-input","maxLength"),d("maxLength")]],ne=[[s("refresh","friction"),(0,t.rawDataParamParser)("friction")],[s("refresh","offset"),(0,t.stringParamParser)("offset")],[s("refresh","refreshing"),E("refreshing")]],oe=[[s("timePicker","datetime-selected"),(0,t.dateParamParser)("datetime-selected","selected")],[s("timePicker","useMilitaryTime"),m("useMilitaryTime")]],ae=[[s("datePicker","datetime-selected"),(0,t.dateParamParser)("datetime-selected","selected")],[s("datePicker","start"),(0,t.dateParamParser)("start","start")],[s("datePicker","end"),(0,t.dateParamParser)("end","end")],[s("datePicker","lunar"),m("lunar")]],ie=[...j,...W,...$,...q,...H,...Y,...J,...Q,...X,...K,...Z,...ee,...te,...re,...oe,[s("textPicker","range"),T("range")],[s("textPicker","textPicker-selected"),(0,t.customRawDataParamParser)("textPicker-selected","selected")],[s("textPicker","defaultPickerItemHeight"),f("defaultPickerItemHeight")],...ne,[s("toggle","toggle-type"),function(e,t){const r="toggle-type";if(u(r,"type",e,t))return;const n=e.property.get(r);!y(n)&&t.params instanceof Map&&t.params.set("type",C("ToggleType.",n))}],[s("toggle","isOn"),E("isOn")],[s("toggle","selectedColor"),S("selectedColor")],[s("toggle","switchPointColor"),S("switchPointColor")],[l("select","select-option"),function(e,t){const r=e.dynamicProperty.get("select-option");t.setParams(null!=r?r:'[{value: ""}]')}],[s("select","select-value"),function(e,t){const r=e.getProperty("select-value"),n=e.dynamicProperty.get("select-value");y(n)?y(r)||t.properties.set("value",p(r)):t.properties.set("value",G(n))}],[s("select","selected"),d("selected")],[s("select","font-size"),z("font","size")],[s("select","font-style"),z("font","style")],[s("select","font-weight"),z("font","weight")],[s("select","font-family"),z("font","family")],[s("select","selected-option-font-size"),z("selected-option-font","size")],[s("select","selected-option-font-style"),z("selected-option-font","style")],[s("select","selected-option-font-weight"),z("selected-option-font","weight")],[s("select","selected-option-font-family"),z("selected-option-font","family")],[s("select","selected-option-font-color"),S("selected-option-font-color")],[s("select","selected-option-bg-color"),S("selected-option-bg-color")],[s("select","option-font-size"),z("option-font","size")],[s("select","option-font-style"),z("option-font","style")],[s("select","option-font-weight"),z("option-font","weight")],[s("select","option-font-family"),z("option-font","family")],[s("select","option-font-color"),S("option-font-color")],[s("select","option-bg-color"),S("option-bg-color")],...ae]},243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Style=t.Tag=void 0;const n=r(117);class o extends n.ASTNode{constructor(e,t,r){super(),this.tagName=e,this.attributes=t,this.content=r}}t.Tag=o;class a extends n.ASTNode{constructor(e,t,r,n){super(),this.mediaQuery=void 0,this.kind=e,this.name=t,this.content=r,this.mediaQuery=n}}t.Style=a},573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const n=r(243),o=r(334);class a{constructor(e){this.cache=e}visit(e){e instanceof n.Tag?this.genTag(e):e instanceof n.Style&&this.genStyle(e)}static getMethodGen(e){return void 0===a.instance?a.instance=new a(e):a.instance.setCache(e),a.instance}setCache(e){this.cache=e}genTag(e){if(this.cache.concat(o.TokenClass.TAG_START,e.tagName),this.cache.indentOff(),e.attributes.forEach(((e,t)=>{let r="";for(const t of e)r+='"'===t?""":"\n"===t?" ":t;this.cache.concat(o.TokenClass.SPACE,t,o.TokenClass.ASSIGN,o.TokenClass.LQUOTE,r,o.TokenClass.RQUOTE)})),null===e.content)this.cache.concat(o.TokenClass.EMPTY_TAG_END);else{if(this.cache.concat(o.TokenClass.TAG_END),"string"==typeof e.content){let t="";for(const r of e.content)t+="<"===r?"<":r;this.cache.concat(t)}else 0!==e.content.length&&(this.cache.concat(o.TokenClass.NEW_LINE),this.cache.incIndent(),this.cache.indentOn(),e.content.forEach((e=>{e.accept(this),this.cache.indentOff(),this.cache.concat(o.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.indentOn(),this.cache.decIndent());this.cache.concat(o.TokenClass.END_TAG_START,e.tagName,o.TokenClass.TAG_END)}}genStyle(e){void 0!==e.mediaQuery&&(this.cache.concat("@media"),this.cache.indentOff(),this.cache.concat(o.TokenClass.SPACE,e.mediaQuery,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent()),"IDStyle"===e.kind&&(this.cache.concat(o.TokenClass.ID_STYLE_START),this.cache.indentOff()),this.cache.concat(e.name,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent(),e.content.forEach(((e,t)=>{this.cache.concat(t,o.TokenClass.COLON,o.TokenClass.SPACE,e,o.TokenClass.SEMICOLON,o.TokenClass.NEW_LINE)})),this.cache.decIndent(),this.cache.concat(o.TokenClass.RBRA,o.TokenClass.NEW_LINE),void 0!==e.mediaQuery&&(this.cache.decIndent(),this.cache.concat(o.TokenClass.RBRA,o.TokenClass.NEW_LINE)),this.cache.concat(o.TokenClass.NEW_LINE)}}t.ASTNodeGenerator=a,a.instance=void 0},844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CSSBridge=t.HMLBridge=void 0;const n=r(243),o=r(571);t.HMLBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map([["id",e.id]]);let r="";for(let[n,a]of e.property)(0,o.isAttribute)(n,e.type)?("string"!=typeof a&&(a=JSON.stringify(a)),t.set(n,a)):(0,o.isContent)(n)&&(r=a);if(e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}const a=new n.Tag(e.type,t,r);return"wrapper"===t.get("id")?new n.Tag("div",new Map,[a]):a}},t.CSSBridge=class{constructor(){this.errors=0,this.styles=[]}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}genIDStyle(e){var t;const r=t=>{const r=new Map;for(const[n,a]of t)(0,o.isStyle)(n,e.type)&&r.set(n,a);return r},a=r(e.property);a.size>0&&this.styles.push(new n.Style("IDStyle",e.id,a)),(null!==(t=e.mediaProperty)&&void 0!==t?t:new Map).forEach(((t,o)=>{const a=r(t);a.size>0&&this.styles.push(new n.Style("IDStyle",e.id,a,o))}));for(const t of e.children)t.accept(this)}visit(e){return this.genIDStyle(e),this.styles}}},55:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genFACSS=t.genFAHML=void 0;const n=r(573),o=r(862);t.genFAHML=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" "));return e.accept(t),t.cache.toString()},t.genFACSS=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" "));return e.forEach((e=>{e.accept(t)})),t.cache.toString()}},571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEvent=t.isData=t.isUnknown=t.isContent=t.isAttribute=t.isStyle=t.styleMap=void 0;const n=r(904),o=["width","height","min-width","min-height","max-width","max-height","padding","padding-start","padding-end","padding-top","padding-right","padding-bottom","padding-left","margin","margin-start","margin-end","margin-top","margin-right","margin-bottom","margin-left","border-width","border-style","border-color","border-radius","border-top-width","border-top-style","border-top-color","border-top-left-radius","border-right-width","border-right-style","border-right-color","border-top-right-radius","border-bottom-width","border-bottom-style","border-bottom-color","border-bottom-right-radius","border-left-width","border-left-style","border-left-color","border-bottom-left-radius","background-color","background","background-image","background-size","background-position","background-repeat","display","opacity","visibility","flex","flex-grow","flex-shrink","flex-basis","position","display","top","right","bottom","left","display-index","flex-weight","aspect-ratio"],a=["font-size","font-family","font-style","font-weight"],i=["text-align","line-height","text-decoration","letter-spacing","max-lines","text-overflow","allow-scale","min-font-size","max-font-size","font-size-step","prefer-font-sizes","color",...a],s=["allow-scale","text-decoration","color",...a],l=["text-color","allow-scale","icon-width","icon-height","radius",...a],p=["texton-color","textoff-color","text-padding","allow-scale",...a],c=["column-height","text-color","allow-scale","letter-spacing","text-decoration","line-height","opacity",...a],u=["text-color","allow-scale","letter-spacing",...a];t.styleMap=new Map([["common",new Set([...o])],["div",new Set(["flex-direction","overflow","flex-wrap","justify-content","align-items","align-content","grid-template-columns","grid-template-rows","grid-row-start","grid-row-end","grid-column-start","grid-column-end","grid-gap","grid-columns-gap","grid-rows-gap"])],["text",new Set([...i])],["image",new Set(["object-fit","match-text-direction","fit-original-size"])],["span",new Set([...s])],["input",new Set(["font-size","font-family","font-weight","color","placeholder-color","allow-scale"])],["button",new Set([...l])],["switch",new Set([...p])],["refresh",new Set(["progress-color"])],["divider",new Set(["stroke-width","line-cap","color"])],["chart",new Set(["stroke-width","radius","start-angle","total-angle","center-x","center-y","colors","weights"])],["picker",new Set([...c])],["picker-view",new Set(["color","font-size","selected-color","selected-font-size","focus-color","focus-font-size","disappear-color","disappear-font-size","font-family"])],["slider",new Set(["color","selected-color","block-color"])],["swiper",new Set(["indicator-color","indicator-selected-color","indicator-size","indicator-top","indicator-right","indicator-bottom","indicator-left"])],["list",new Set(["flex-direction","columns","item-extent","fade-color"])],["list-item",new Set(["column-span"])],["progress",new Set(["color","stroke-width","background-color","secondary-color","scale-width","scale-number","start-angle","total-angle","center-x","center-y","radius"])],["select",new Set(["font-family"])],["menu",new Set([...u])],["option",new Set(["color","font-family","allow-scale","font-size","font-weight","text-decoration"])],["video",new Set(["object-fit"])],["clock",new Set(["font-family"])]]);const f=new Map([["common",new Set(["id","ref","disabled","focusable","data","if","for"])],["image",new Set(["src","alt"])],["button",new Set(["type","value","icon","waiting"])],["refresh",new Set(["offset","refreshing","type","lasttime","friction"])],["input",new Set(["type","checked","name","value","placeholder","maxlength","enterkeytype","headericon"])],["switch",new Set(["checked","showtext","texton","textoff"])],["option",new Set(["value","selected","icon"])],["chart",new Set(["type","percent","datasets","options"])],["picker",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","value","vibrate"])],["picker-view",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","indicatorprefix","indicatorsuffix","vibrate"])],["slider",new Set(["min","max","step","showtips","showsteps","mode","value"])],["divider",new Set(["vertical"])],["list",new Set(["scrollpage","cachedcount","scrollbar","scrolleffect","shapemode","indexer","itemscale","itemcenter","updateeffect","scrollvibrate","initialindex","initialoffset"])],["list-item",new Set(["type","primary","section","sticky","stickyradius","clickeffect"])],["swiper",new Set(["index","autoplay","interval","indicator","digital","indicatordisabled","loop","duration","vertical"])],["progress",new Set(["type","percent","secondarypercent","clockwise"])],["menu",new Set(["target","title","type"])],["clock",new Set(["clockconfig","showdigit","hourswest"])],["badge",new Set(["placement","count","visible","maxcount","config","label"])],["video",new Set(["muted","src","autoplay","poster","controls","loop","starttime","direction","speed"])],["tabs",new Set(["index","vertical"])],["tab-bar",new Set(["mode"])],["tab-content",new Set(["scrollable"])]]),y=new Map([["common",new Set(["ontouchstart","ontouchmove","ontouchcancel","ontouchend","onclick","onlongpress","onfocus","onblur","onkey","onswipe"])],["image",new Set(["oncomplete","onerror"])],["input",new Set(["onchange","onenterkeyclick"])],["select",new Set(["onchange"])],["refresh",new Set(["onrefresh","onpulldown"])],["swiper",new Set(["onchange","onrotation"])],["list",new Set(["onindexerchange","onscroll","onscrollbottom","onscrolltop","onscrollend","onscrolltouchup","onrequestitem"])],["list-item",new Set(["onsticky"])],["menu",new Set(["onselected","oncancel"])],["picker",new Set(["oncolumnchange","onchange","oncancel"])],["picker-view",new Set(["oncolumnchange","onchange"])],["video",new Set(["onprepared","onstart","onpause","onfinish","onerror","onseeking","onseeked","ontimeupdate","onfullscreenchange","onstop"])],["tabs",new Set(["onchange"])],["switch",new Set(["onchange"])],["dialog",new Set(["oncancel"])]]),d=new Map([["common",new Set(["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange"])],["image",new Set(["onComplete","onError","onFinish"])],["swiper",new Set(["onChange"])],["list",new Set(["onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop"])],["text-input",new Set(["onChange","onSubmit","onEditChanged"])],["refresh",new Set(["onStateChange","onRefreshing"])],["toggle",new Set(["onChange"])],["timePicker",new Set(["onChange"])],["textPicker",new Set(["onChange"])],["select",new Set(["onSelect"])],["datePicker",new Set(["onChange"])]]);function m(e,t,r){const n=t.get(r);return void 0!==n&&n.has(e)}function g(e,r){return m(e,t.styleMap,"common")||m(e,t.styleMap,r)}function h(e,t){return(0,n.getDomain)()===n.Domain.ETS?m(e,d,"common")||m(e,d,t):E(e,t)||T(e,t)}function E(e,t){return m(e,f,"common")||m(e,f,t)}function T(e,t){return m(e,y,"common")||m(e,y,t)}t.isStyle=g,t.isAttribute=h,t.isContent=function(e){return"content"===e},t.isUnknown=function(e,t){return!g(e,t)&&!h(e,t)},t.isData=E,t.isEvent=T},334:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.INDENT=" ",r.SPACE=" ",r.LQUOTE='"',r.RQUOTE='"',r.TAG_START="<",r.TAG_END=">",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.etsPropertyList=void 0;const n=r(958),o=r(513),a=["vp","px","%","lpx"],i=[{propertySector:o.Sector.FEATURE,propertySet:{name:"FontSize",property:"font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontStyle",property:"font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontColor",property:"font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontWeight",property:"font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...o.commonFontWeight],defaults:"normal"}}],s={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["vp","px","lpx"],placeholder:"0"},l=[{propertySector:o.Sector.GENERAL,propertySet:{name:"Width",property:"width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a,min:0}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Height",property:"height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a,min:0}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MinWidth",property:"constraint-size-min-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MinHeight",property:"constraint-size-min-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MaxWidth",property:"constraint-size-max-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MaxHeight",property:"constraint-size-max-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"Margin",property:"margin-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"Padding",property:"padding-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginTop",property:"margin-top-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginRight",property:"margin-right-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginBottom",property:"margin-bottom-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginLeft",property:"margin-left-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingTop",property:"padding-top-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingRight",property:"padding-right-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingBottom",property:"padding-bottom-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingLeft",property:"padding-left-visual"},s)}],p={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a},c={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a},u=[{propertySector:o.Sector.GENERAL,propertySet:{name:"CustomString",property:"custom-string-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.GENERAL,propertySet:{name:"CustomNumber",property:"custom-number-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.GENERAL,propertySet:{name:"CustomBoolean",property:"custom-boolean-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}],f=[{propertySector:o.Sector.DIMENSION,propertySet:{name:"Border",property:"border-visual",type:o.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-width-visual"},p),Object.assign({name:"Style",property:"border-style-visual"},o.commonParamsForBorder),{name:"Color",property:"border-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR},Object.assign({name:"Radius",property:"border-radius-visual"},c)]}}],y=[{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageSrc",property:"background-image-src-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_SRC}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageRepeat",property:"background-image-repeat-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_REPERT,list:[o.CLEAN_VALUE_NODE,{name:"X",value:"repeat-x"},{name:"Y",value:"repeat-y"},{name:"XY",value:"repeat"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageSize",property:"background-image-size-visual",type:o.TypeName.DATA_SELECT_INPUT,etsType:`${o.EtsType.IMAGE_SIZE}|${o.EtsType.STRING}`,list:[o.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Auto",value:"auto"}],defaults:"Auto"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImagePosition",property:"background-image-position-visual",type:o.TypeName.DATA_SELECT_INPUT,etsType:`${o.EtsType.ALIGNMENT}|${o.EtsType.STRING}`,list:[o.CLEAN_VALUE_NODE,{name:"TopStart",value:"top left"},{name:"Top",value:"top center"},{name:"TopEnd",value:"top right"},{name:"Start",value:"center left"},{name:"Center",value:"center center"},{name:"End",value:"center right"},{name:"BottomStart",value:"bottom left"},{name:"Bottom",value:"bottom center"},{name:"BottomEnd",value:"bottom right"}],defaults:"0 0"}}],d=[{propertySector:o.Sector.GENERAL,propertySet:{name:"Location",property:"position-visual",type:o.TypeName.SELECT,defaults:"offset",supportDynamicProperty:!1,list:[o.CLEAN_VALUE_NODE,{name:"offset",value:"relative"},{name:"position",value:"absolute"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"X",property:"left-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Y",property:"top-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}}],m=[...i,{propertySector:o.Sector.FEATURE,propertySet:{name:"TextAlign",property:"text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"LineHeight",property:"line-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextOverflow",property:"text-overflow-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_OVERFLOW,list:[o.CLEAN_VALUE_NODE,{name:"Clip",value:"clip"},{name:"Ellipsis",value:"ellipsis"},{name:"None",value:"none"}],defaults:"clip"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"BaselineOffset",property:"baseline-offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DecorationType",property:"decoration-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_DECORATION_TYPE,list:[o.CLEAN_VALUE_NODE,{name:"Underline",value:"underline"},{name:"LineThrough",value:"line-through"},{name:"Overline",value:"overline"},{name:"None",value:"none"}],defaults:"none"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DecorationColor",property:"decoration-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextCase",property:"text-case-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_CASE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"LowerCase"},{value:"UpperCase"}],defaults:"Normal"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"ForEach",property:"for-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"KeyGenerator",property:"keyGenerator-visual",type:o.TypeName.BASE,etsType:"Event",supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Item",property:"item-visual",type:o.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Item of ForEach Array"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Idx",property:"idx-visual",type:o.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Index of Corresponding Item In ForEach Array"}}],g=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Placeholder",property:"placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Type",property:"textInput-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.INPUT_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Password"},{value:"Email"},{value:"Number"}],defaults:"Normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderColor",property:"placeholderColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontSize",property:"placeholderFont-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontWeight",property:"placeholderFont-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Lighter"},{value:"Regular"},{value:"Medium"},{value:"Bold"},{value:"Bolder"},...o.commonFontWeight],defaults:"400"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontFamily",property:"placeholderFont-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontStyle",property:"placeholderFont-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Italic"}],defaults:"Normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EnterKeyType",property:"enterKeyType-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ENTER_KEY_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Go"},{value:"Search"},{value:"Send"},{value:"Next"},{value:"Done"}],defaults:"Done"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CaretColor",property:"caretColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"MaxLength",property:"maxLength-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}}],h=[{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"Vertical",property:"vertical-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"LineCap",property:"line-cap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.LINE_CAP_STYLE,defaults:"butt",list:[o.CLEAN_VALUE_NODE,{name:"Butt",value:"butt"},{name:"Round",value:"round"},{name:"Square",value:"square"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StrokeWidth",property:"stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:a}}],E=[{propertySector:o.Sector.FEATURE,propertySet:{name:"InitialIndex",property:"initial-index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ListDirection",property:"list-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.AXIS,list:[o.CLEAN_VALUE_NODE,{name:"Vertical",value:"vertical"},{name:"Horizontal",value:"horizontal"}],defaults:"vertical"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Color",property:"divider-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StrokeWidth",property:"divider-stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StartMargin",property:"divider-start-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EndMargin",property:"divider-end-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EditMode",property:"edit-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EdgeEffect",property:"edge-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{name:"Spring",value:"spring"},{name:"None",value:"none"}],defaults:"spring"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ChainAnimation",property:"chain-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}],T=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Sticky",property:"sticky-visual",type:o.TypeName.SELECT,etsType:o.EtsType.STICKY,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"Normal",value:"normal"}],defaults:"none"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Editable",property:"editable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}],v=[{propertySector:o.Sector.FLEX,propertySet:{name:"FlexBasis",property:"flex-basis-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:a,defaults:"auto",fixedValues:["auto"],info:"The initial main size of a flex item. It sets the size of the content box otherwise set with box-sizing."}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignSelf",property:"align-self-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"auto",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FLEX,propertySet:{name:"Direction",property:"flex-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_DIRECTION,defaults:"row",list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"RowReverse",value:"row-reverse"},{name:"Column",value:"column"},{name:"ColumnReverse",value:"column-reverse"}],info:"The direction of flex."}},{propertySector:o.Sector.FLEX,propertySet:{name:"Wrap",property:"wrap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_WRAP,defaults:"nowrap",list:[o.CLEAN_VALUE_NODE,{name:"NoWrap",value:"nowrap"},{name:"Wrap",value:"wrap"},{name:"WrapReverse",value:"wrap-reverse"}],info:"Whether flex items are forced onto one line or multiple lines."}},{propertySector:o.Sector.FLEX,propertySet:{name:"JustifyContent",property:"justify-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"JustifyContent",property:"justify-content-rc-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignItems",property:"align-items-flex-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"stretch",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignContent",property:"align-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Set the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis."}}],S=[{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"AutoPlay",property:"auto-play-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"Interval",property:"interval-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"Loop",property:"loop-visual"},o.commonParamsForJudge),{defaults:!0})},{propertySector:o.Sector.FEATURE,propertySet:{name:"Duration",property:"duration-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ItemSpace",property:"item-space-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CachedCount",property:"cached-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"DisableSwipe",property:"disable-swipe-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"Index",property:"index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"Indicator",property:"indicator-visual"},o.commonParamsForJudge),{defaults:!0})}],_=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Type",property:"toggle-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TOGGLE_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Button"},{value:"Checkbox"},{value:"Switch"}],defaults:"Button"}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"IsOn",property:"isOn-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedColor",property:"selectedColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SwitchPointColor",property:"switchPointColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}],N=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Friction",property:"friction-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:62}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Offset",property:"offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:a,defaults:16}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Refreshing",property:"refreshing-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}],C=[{propertySector:o.Sector.FEATURE,propertySet:{name:"TrackColor",property:"track-color-visual",type:o.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ShowSteps",property:"show-steps-visual",type:o.TypeName.ADJUSTABLE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ShowTips",property:"show-tips-visual",type:o.TypeName.ADJUSTABLE}}],A=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Range",property:"range-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Selected",property:"datetime-selected-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Start",property:"start-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"End",property:"end-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"UseMilitaryTime",property:"useMilitaryTime-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE,propertySet:{name:"Selected",property:"textPicker-selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DefaultPickerItemHeight",property:"defaultPickerItemHeight-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["vp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Lunar",property:"lunar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}],P=[{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontSize",property:"selected-option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontStyle",property:"selected-option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontColor",property:"selected-option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontWeight",property:"selected-option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...o.commonFontWeight],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontFamily",property:"selected-option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionBackgroundColor",property:"selected-option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontSize",property:"option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontStyle",property:"option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontColor",property:"option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontWeight",property:"option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...o.commonFontWeight],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontFamily",property:"option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionBackgroundColor",property:"option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Value",property:"select-value-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Selected",property:"selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Options",property:"select-option-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}}];t.etsPropertyList=[...u,...f,...l,..._,...m,...g,...h,...d,...E,...T,...v,...S,...N,...P,...C,...n.commonPropertyList,...y,...A,{propertySector:o.Sector.ATOMIC,propertySet:{name:"DisplayPriority",property:"display-priority-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Visibility",property:"visibility-visual",type:o.TypeName.SELECT,etsType:o.EtsType.VISIBILITY,defaults:"visible",list:[o.CLEAN_VALUE_NODE,{name:"Visible",value:"visible"},{name:"Hidden",value:"hidden"},{name:"None",value:"none"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Enabled",property:"enabled-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"true",list:[{value:"true"},{value:"false"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Align",property:"align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ALIGNMENT,defaults:"center",list:[o.CLEAN_VALUE_NODE,{name:"TopStart",value:"top-start"},{name:"Top",value:"top"},{name:"TopEnd",value:"top-end"},{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"},{name:"BottomStart",value:"bottom-start"},{name:"Bottom",value:"bottom"},{name:"BottomEnd",value:"bottom-end"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"If",property:"if-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Space",property:"space-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["vp","px","lpx"],requires:{"display-visual":["flex","cleanValue"]},info:"Space between any two adjacent child components."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"AlignItems",property:"align-items-row-visual",type:o.TypeName.SELECT,etsType:o.EtsType.VERTICAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[o.CLEAN_VALUE_NODE,{value:"flex-start",name:"top",etsEnumValue:"Top"},{value:"flex-end",name:"bottom",etsEnumValue:"Bottom"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the vertical direction."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"AlignItems",property:"align-items-column-visual",type:o.TypeName.SELECT,etsType:o.EtsType.HORIZONTAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[o.CLEAN_VALUE_NODE,{value:"flex-start",name:"start",etsEnumValue:"Start"},{value:"flex-end",name:"end",etsEnumValue:"End"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the horizontal direction."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Src",property:"src-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_SRC}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Alt",property:"alt-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT}},{propertySector:o.Sector.FEATURE,propertySet:{name:"RenderMode",property:"render-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_RENDER_MODE,defaults:"original",list:[o.CLEAN_VALUE_NODE,{name:"Original",value:"original"},{name:"Template",value:"template"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ObjectRepeat",property:"object-repeat-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_REPERT,defaults:"no-repeat",list:[o.CLEAN_VALUE_NODE,{name:"X",value:"X"},{name:"Y",value:"Y"},{name:"XY",value:"XY"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ObjectFit",property:"object-fit-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_FIT,defaults:"cover",list:[o.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Fill",value:"fill"},{name:"None",value:"none"},{name:"ScaleDown",value:"scale-down"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"InterPolation",property:"interpolation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_INTERPOLATION,defaults:"none",list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"High",value:"high"},{name:"Medium",value:"medium"},{name:"Low",value:"low"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SourceSizeWidth",property:"source-size-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SourceSizeHeight",property:"source-size-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Type",property:"type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BUTTON_TYPE,defaults:"capsule",list:[{name:"Normal",value:"normal"},{name:"Capsule",value:"capsule"},{name:"Circle",value:"circle"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StateEffect",property:"state-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"true",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Content",property:"content-visual",type:o.TypeName.ADJUSTABLE,etsType:o.EtsType.COMB_CONTENT}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Label",property:"label-visual",type:o.TypeName.ADJUSTABLE,etsType:o.EtsType.COMB_CONTENT}}]},958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonPropertyList=void 0;const n=r(513);t.commonPropertyList=[{propertySector:n.Sector.GENERAL,propertySet:{name:"BackgroundColor",property:"background-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Display",property:"display-visual",type:n.TypeName.SELECT,defaults:"flex",list:[n.CLEAN_VALUE_NODE,{value:"flex"},{value:"none"}]}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Opacity",property:"opacity-visual",type:n.TypeName.SLIDER,etsType:n.EtsType.COMB_R_NUMBER,defaults:"1",step:.01,max:1,min:0}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Overflow",property:"overflow-visual",type:n.TypeName.SELECT,defaults:"visible",list:[n.CLEAN_VALUE_NODE,{value:"visible"},{value:"hidden"},{value:"scroll"}]}},{propertySector:n.Sector.FLEX,propertySet:{name:"FlexGrow",property:"flex-grow-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:"0",requiresParent:{display:["flex","cleanValue"]},info:"The flex grow factor of a flex item's main size"}},{propertySector:n.Sector.FLEX,propertySet:{name:"FlexShrink",property:"flex-shrink-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:"1",requiresParent:{display:["flex","cleanValue"]},info:"The flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items will shrink"}},{propertySector:n.Sector.FLEX,propertySet:{name:"Columns",property:"columns-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:1,info:"The column number of flex."}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Header Logo",property:"headerLogo-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Title",property:"title-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Status",property:"status-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Logo",property:"logo-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Color",property:"color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FontFamily",property:"font-family-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_CONTENT,defaults:"sans-serif"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"MaxLines",property:"max-lines-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextColor",property:"text-color-visual",type:n.TypeName.COLOR,defaults:"rgba(0,0,0,0.9)"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FocusColor",property:"focus-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"DisappearColor",property:"disappear-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorColor",property:"indicator-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorSelectedColor",property:"indicator-selected-color-visual",type:n.TypeName.COLOR,defaults:"#ff007dff"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorSize",property:"indicator-size-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorTop",property:"indicator-top-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorRight",property:"indicator-right-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorBottom",property:"indicator-bottom-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorLeft",property:"indicator-left-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:{name:"AllowScale",property:"allow-scale-visual",type:n.TypeName.SELECT,defaults:"true",list:[n.CLEAN_VALUE_NODE,{value:"true"},{value:"false"}]}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowStart",property:"grid-row-start-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its row in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnStart",property:"grid-column-start-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its column in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowEnd",property:"grid-row-end-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its row in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnEnd",property:"grid-column-end-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its column in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridTemplateRows",property:"grid-template-rows-visual",type:n.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid rows."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridTemplateColumns",property:"grid-template-columns-visual",type:n.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid columns."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowsGap",property:"grid-rows-gap-visual",type:n.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's grid rows."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnsGap",property:"grid-columns-gap-visual",type:n.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's columns."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridGap",property:"grid-gap-visual",type:n.TypeName.INTEGER,units:["px"],requires:{"display-visual":["grid"]},info:"The gaps between rows and columns. It is a shorthand for row-gap and column-gap."}},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"MatchTextDirection",property:"match-text-direction-visual"},n.commonParamsForJudge)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"FitOriginalSize",property:"fit-original-size-visual"},n.commonParamsForJudge)},{propertySector:n.Sector.FEATURE,propertySet:{name:"IconWidth",property:"icon-width-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IconHeight",property:"icon-height-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextonColor",property:"texton-color-visual",type:n.TypeName.COLOR,defaults:"#000000"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextoffColor",property:"textoff-color-visual",type:n.TypeName.COLOR,defaults:"#000000"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextPadding",property:"text-padding-visual",type:n.TypeName.INTEGER,defaults:0,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"SelectedColor",property:"selected-color-visual",type:n.TypeName.COLOR,defaults:"rgba(0,125,255,1)"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"BlockColor",property:"block-color-visual",type:n.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Radius",property:"radius-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"StartAngle",property:"start-angle-visual",type:n.TypeName.INTEGER,defaults:240}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TotalAngle",property:"total-angle-visual",type:n.TypeName.INTEGER,defaults:240}},{propertySector:n.Sector.FEATURE,propertySet:{name:"CenterX",property:"center-x-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"CenterY",property:"center-y-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Colors",property:"colors-visual",type:n.TypeName.BASE}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Weights",property:"weights-visual",type:n.TypeName.BASE}},{propertySector:n.Sector.FEATURE,propertySet:{name:"PlaceHolderColor",property:"placeholder-color-visual",type:n.TypeName.COLOR,defaults:"gray"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ProgressColor",property:"progress-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR,defaults:"black"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ItemExtent",property:"item-extent-visual",type:n.TypeName.INTEGER,units:["px","%"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FadeColor",property:"fade-color-visual",type:n.TypeName.COLOR,defaults:"grey"}},{propertySector:n.Sector.FLEX,propertySet:{name:"ColumnSpan",property:"column-span-visual",type:n.TypeName.INTEGER,defaults:1,min:1,info:"The number of span."}},{propertySector:n.Sector.ATOMIC,propertySet:{name:"FlexWeight",property:"flex-weight-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.ATOMIC,propertySet:{name:"AspectRatio",property:"aspect-ratio-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"SecondaryColor",property:"secondary-color-visual",type:n.TypeName.COLOR,requires:{type:["horizontal","ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ScaleWidth",property:"scale-width-visual",type:n.TypeName.INTEGER,requires:{type:["ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ScaleNumber",property:"scale-number-visual",type:n.TypeName.INTEGER,defaults:120,requires:{type:["ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Value",property:"value-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:0}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Total",property:"total-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:100}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Style",property:"style-visual",type:n.TypeName.SELECT,etsType:n.EtsType.PROGRESS_STYLE,defaults:"Linear",list:[{value:"Linear"}]}}]},513:(e,t)=>{"use strict";var r,n,o,a,i,s;Object.defineProperty(t,"__esModule",{value:!0}),t.commonFontWeight=t.commonParamsForBorderRadius=t.commonParamsForIndicator=t.commonParamsForInteger=t.commonParamsForJudge=t.commonParamsForBorder=t.CLEAN_VALUE_NODE=t.EtsCombinationType=t.EtsBasicType=t.EtsEnumType=t.EtsType=t.TypeName=t.Sector=void 0,function(e){e.GENERAL="general",e.DIMENSION="dimension",e.FEATURE="feature",e.FLEX="flex",e.GRID="grid",e.ATOMIC="atomic"}(r||(r={})),t.Sector=r,function(e){e.BASE="base",e.INTEGER="integer",e.SELECT="select",e.COLOR="color",e.COMPOSITE="composite",e.SLIDER="slider",e.DATA_SELECT_INPUT="dataSelectInput",e.ADJUSTABLE="adjustable"}(n||(n={})),t.TypeName=n,function(e){e.ARRAY="ETSArray",e.BOOLEAN="boolean",e.DATE="Date",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(o||(o={})),t.EtsBasicType=o,function(e){e.R_FLOAT="Rfloat",e.R_STRING="Rstring",e.R_COLOR="Rcolor",e.R_PLURAL="Rplural",e.R_MEDIA="Rmedia",e.R_RAWFILE="Rrawfile"}(a||(a={})),function(e){e.ALIGNMENT="Alignment",e.AXIS="Axis",e.BORDER_STYLE="BorderStyle",e.BUTTON_TYPE="ButtonType",e.COLOR="Color",e.DIRECTION="Direction",e.EDGE_EFFECT="EdgeEffect",e.ENTER_KEY_TYPE="EnterKeyType",e.FLEX_ALIGN="FlexAlign",e.FLEX_DIRECTION="FlexDirection",e.FLEX_WRAP="FlexWrap",e.FONT_STYLE="FontStyle",e.FONT_WEIGHT="FontWeight",e.HORIZONTAL_ALIGN="HorizontalAlign",e.IMAGE_FIT="ImageFit",e.IMAGE_INTERPOLATION="ImageInterpolation",e.IMAGE_RENDER_MODE="ImageRenderMode",e.IMAGE_REPERT="ImageRepeat",e.IMAGE_SIZE="ImageSize",e.INPUT_TYPE="InputType",e.ITEM_ALIGN="ItemAlign",e.LINE_CAP_STYLE="LineCapStyle",e.PROGRESS_STYLE="ProgressStyle",e.STICKY="Sticky",e.TEXT_ALIGN="TextAlign",e.TEXT_OVERFLOW="TextOverflow",e.TEXT_DECORATION_TYPE="TextDecorationType",e.TEXT_CASE="TextCase",e.TOGGLE_TYPE="ToggleType",e.VERTICAL_ALIGN="VerticalAlign",e.VISIBILITY="Visibility"}(i||(i={})),t.EtsEnumType=i,function(e){e.COMB_COLOR="string|number|Color|Rcolor",e.COMB_LENGTH="string|number",e.COMB_R_NUMBER="number|Rfloat",e.COMB_R_LENGTH="string|number|Rfloat",e.COMB_CONTENT="string|Rstring|Rplural",e.COMB_SRC="string|Rmedia|Rrawfile"}(s||(s={})),t.EtsCombinationType=s;const l=Object.assign(Object.assign(Object.assign(Object.assign({},o),a),i),s);t.EtsType=l;const p={value:"cleanValue",name:"---Clean Value---"};t.CLEAN_VALUE_NODE=p;const c={type:n.SELECT,etsType:l.BORDER_STYLE,list:[p,{value:"dotted",etsEnumValue:"Dotted"},{value:"dashed",etsEnumValue:"Dashed"},{value:"solid",etsEnumValue:"Solid"}]};t.commonParamsForBorder=c;const u={type:n.SELECT,etsType:l.BOOLEAN,defaults:"false",list:[p,{value:"true"},{value:"false"}]};t.commonParamsForJudge=u;const f={type:n.INTEGER,units:["px"],placeholder:"0px"};t.commonParamsForInteger=f;const y={type:n.INTEGER,units:["px","%"]};t.commonParamsForIndicator=y;const d={type:n.INTEGER,units:["px"]};t.commonParamsForBorderRadius=d,t.commonFontWeight=[{value:"100"},{value:"200"},{value:"300"},{value:"400"},{value:"500"},{value:"600"},{value:"700"},{value:"800"},{value:"900"}]},282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TagTypeMap=void 0,t.TagTypeMap=new Map([["button","TextContent"],["span","TextContent"],["divider","TextContent"],["picker","TextContent"],["option","TextContent"],["clock","TextContent"],["image","Base"],["input","Base"],["chart","Base"],["slider","Base"],["progress","Base"],["text","Text"],["div","Container"],["list","Container"],["list-item","Container"],["list-item-group","Container"],["refresh","Container"],["dialog","Container"],["stack","Container"],["menu","Container"],["select","Container"],["tabs","Container"],["tab-bar","Container"],["tab-content","Container"]])},294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.beforeCodegen=t.getCustomCompRelativePath=t.getRelativePath=t.prepareCustomCompTagName=t.capitalize=t.getTagName=t.strToBase64=t.getUniqueName=t.getUniqueId=t.removeFromArray=t.getDataName=void 0;const n=r(891);function o(e){let t=a(e).replace(/[/=+]/g,"");return t.length>=4&&(t=t.substr(t.length/2-2,4)),t}function a(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");let r="";for(let t=0;t{const t=r.indexOf(e);-1!==t&&r.splice(t,1)})),r},t.getUniqueId=o,t.getUniqueName=function(e){return`${e}_${o(e)}`},t.strToBase64=a;const i=new Map,s=new Map;function l(e){return e[0].toUpperCase()+e.slice(1)}function p(e){const t=(0,n.getInstance)().document.path;if(0===e.size)return;const r=l(t.substring(t.lastIndexOf("/")+1));e.forEach(((e,n)=>{const o=e.length,a=[...e];n===r&&a.push(t);const p=function(e){e.sort();const t=e[0],r=e[e.length-1];let n=0;for(let e=0;e1||n===r)&&(u=l(e[a].substring(p+1).split("/").join("_"))),s.set(e[a],u);const f="/node_modules/";let y=c(e[a],t);e[a].startsWith(f)&&(y=e[a].replace(f,"@"),y=y.replace("src/main/supervisual","src/main/ets")),i.set(u,y)}}))}function c(e,t){const r=e.split("/"),n=t.split("/");let o=0;for(let e=0;e1){const n=l(r[r.length-1]),o=t.get(n);void 0===o?t.set(n,[e.type]):o.push(e.type)}const n=e.children;for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formManager=void 0;const n=r(891),o=r(945);t.formManager={removeData(e){this.getFormModel().data.delete(e)},addData(e){e instanceof Map?e.forEach(((e,t)=>{this.getFormModel().data.set(t,e)})):Object.keys(e).forEach((t=>{this.getFormModel().data.set(t,e[t])}))},updateAllData(e){this.getFormModel().data.clear(),this.addData(e)},addAction(e,t,r,n){const a=new Map;void 0!==r&&Object.keys(r).forEach((e=>{a.set(e,r[e])}));const i=new Map;void 0!==n&&Object.keys(n).forEach((e=>{i.set(e,n[e])})),this.getFormModel().actions.set(e,new o.FormAction(t,a,i))},updateAllActions(e){this.getFormModel().actions.clear(),e.forEach(((e,t)=>{const r=void 0===e.params?e.params:this.objectToMap(e.params),n=void 0===e.want?e.want:this.objectToMap(e.want),a=new o.FormAction(e.actionType,r,n);this.getFormModel().actions.set(t,a)}))},removeAction(e){this.getFormModel().actions.delete(e)},addActionParams(e,t){var r,n;const a=null!==(r=this.getFormModel().actions.get(e))&&void 0!==r?r:new o.FormAction(e),i=null!==(n=a.params)&&void 0!==n?n:new Map;Object.keys(t).forEach((e=>{i.set(e,t[e])})),a.params=i},removeActionParam(e,t){var r;const n=this.getFormModel().actions.get(e);null===(r=null==n?void 0:n.params)||void 0===r||r.delete(t)},getFormModel:()=>(0,n.getInstance)().formData,codegenToJson:function(){const e=(0,n.getInstance)().formData,t=this.mapToObject(e.data),r={actions:{},data:{}};return r.data=t,e.actions.forEach(((e,t)=>{r.actions[t]={},r.actions[t].action=e.action,e.params instanceof Map&&e.params.size>0&&(r.actions[t].params=this.mapToObject(e.params)),e.want instanceof Map&&e.want.size>0&&(r.actions[t].want=this.mapToObject(e.want))})),JSON.stringify(r,null,4)},clear(){(0,n.getInstance)().formData.data.clear(),(0,n.getInstance)().formData.actions.clear()},mapToObject:e=>void 0===e?{}:Array.from(e.entries()).reduce(((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r})),{}),objectToMap(e){const t=new Map;return Object.keys(e).forEach(((r,n)=>{t.set(r,e[r])})),t}}},945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormAction=t.FormModel=void 0,t.FormModel=class{constructor(){this.data=new Map,this.actions=new Map}},t.FormAction=class{constructor(e,t,r){this.action=e,this.params=t,this.want=r}}},509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeForVersion1=t.rootToVisualContent=t.visualToRootContent=t.serializeForVersion1=void 0;const n=r(891),o=r(933),a=r(571),i=r(282),s=r(945),l=r(977),p=new Map;function c(e){p.set("textMap",new Map);const t=u(null!=e?e:(0,n.getInstance)().visualModel);return JSON.stringify({VisualVersion:"1",content:JSON.stringify(t),extraData:JSON.stringify(d(p))})}function u(e){const t=Array.from(e.property).filter((t=>(0,a.isAttribute)(t[0],e.type)));t.push(["id",e.id]);const r=Array.from(e.property).filter((t=>(0,a.isStyle)(t[0],e.type)));let n=i.TagTypeMap.get(e.type);void 0===n&&(n="Base");let o=e.property.has("content")?e.property.get("content"):[];if(e.children.length>0){if("string"==typeof o){const t=p.get("textMap");t instanceof Map&&t.set(e.id,o)}o=e.children.map((e=>u(e)))}return{id:e.id,tagName:e.type,attributes:t,idStyle:r,type:n,content:o}}function f(e,t){let r;if(t instanceof Map){const n=t.get("textMap");n instanceof Map&&(r=n.get(e.id))}const n=new o.VisualModel({id:e.id,type:e.tagName,property:new Map([...e.attributes,...e.idStyle])});return"string"==typeof r&&n.property.set("content",r),n.property.delete("id"),"string"==typeof e.content&&n.property.set("content",e.content),Array.isArray(e.content)&&(n.children=e.content.map((e=>f(e,t)))),n}function y(e){if(e instanceof Array&&e.length>0&&"$$map"===e[0]){e.shift();const t=new Map;for(const[r,n]of e)t.set(r,y(n));return t}return e}function d(e){if(e instanceof Map){const t=["$$map"];for(const[r,n]of e)t.push([r,d(n)]);return t}return e}t.serializeForVersion1=c,t.visualToRootContent=function(e){try{return c(JSON.parse(e,l.reviver).visualModel)}catch(e){console.error("convert visual model to root model failed")}return e},t.rootToVisualContent=function(e){const t=JSON.parse(e),r=JSON.parse(t.content);let n='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(n=JSON.parse(t.extraData));const o=f(r,y(n));return o.property.has("flex-direction")||o.property.set("flex-direction","column"),JSON.stringify({document:{VisualVersion:"12",type:"FA"},visualModel:o,formData:new s.FormModel},l.replacer)},t.deserializeForVersion1=function(e){try{const t=JSON.parse(e),r=JSON.parse(t.content);let o='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(o=JSON.parse(t.extraData)),(0,n.getInstance)().visualModel=f(r,y(o)),(0,n.getInstance)().visualModel.property.has("flex-direction")||(0,n.getInstance)().visualModel.property.set("flex-direction","column")}catch(e){console.error("convert error")}}},891:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setInstance=t.getInstance=t.setVisualPath=t.clearCustomInstance=t.setCustomInstance=t.getInstanceTemplate=t.getCustomInstance=void 0;const n=r(933),o=r(945),a=r(904),i={document:{VisualVersion:"12",type:"FA",custom:!1,path:""},visualModel:new n.VisualModel({type:"div",id:"wrapper"}),formData:new o.FormModel},s=new Map;t.getCustomInstance=function(){return s},t.getInstanceTemplate=function(e){return{document:{VisualVersion:"12",type:"ETS",custom:e},visualModel:new n.VisualModel({type:"column",id:"wrapper"}),imgData:""}},t.setCustomInstance=function(e,t){var r;const o={path:"",document:{VisualVersion:"",type:"",custom:!0},visualModel:new n.VisualModel({type:"",id:""}),methods:[],property:[],imgData:"",originType:[]};o.path=e;for(const e in o)Object.prototype.hasOwnProperty.call(t,e)&&(o[e]=t[e]);o.visualModel=null!==(r=o.visualModel.children[0])&&void 0!==r?r:new n.VisualModel({type:"text"}),s.set(e,o)},t.clearCustomInstance=function(){s.clear()},t.setVisualPath=function(e){i.document.path=e},t.getInstance=function(){return i},t.setInstance=function(e){var t,r,n,o;for(const t in i)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);const s=i.document.type;void 0===i.document.custom&&(i.document.custom=!1),null!==((null!==(r=(null===(t=e.customData)||void 0===t?void 0:t.property.size)>0)&&void 0!==r?r:null)||(null!==(o=(null===(n=e.customData)||void 0===n?void 0:n.event.size)>0)&&void 0!==o?o:null))&&(i.customData=e.customData),(0,a.setDomain)("ETS"===s?a.Domain.ETS:"FORM"===s?a.Domain.FORM:a.Domain.FA)}},977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviver=t.replacer=t.serializeSketchPage=t.serializeCustom=t.deserializeCustom=t.deserialize=t.serialize=void 0;const n=r(933),o=r(891),a=r(509);function i(e,t){if(t instanceof Map)return{dataType:"Map",value:Object.fromEntries(t.entries())};if(t instanceof Set)return{dataType:"Set",value:Array.from(t.entries())};if(t instanceof n.VisualModel){const e=new n.VisualModel({type:"none"}),r={};for(const n in e)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return{dataType:"VisualModel",value:r}}return t}function s(e,t){if("object"==typeof t&&null!=t){if("Map"===t.dataType)return new Map(Object.entries(t.value));if("Set"===t.dataType)return new Set(t.value);if("VisualModel"===t.dataType){const e=new n.VisualModel({type:""});Object.assign(e,t.value),t=e}}return t}t.serialize=function(e,t){return 1===e?(0,a.serializeForVersion1)(t):JSON.stringify(null!=t?t:(0,o.getInstance)(),i,4)},t.deserialize=function(e){if("1"===JSON.parse(e).VisualVersion)return(0,a.deserializeForVersion1)(e);const t=JSON.parse(e,s);(0,o.setInstance)(t)},t.deserializeCustom=function(e,t){const r=JSON.parse(t,s);(0,o.setCustomInstance)(e,r)},t.serializeCustom=function(e){const t=(0,o.getInstanceTemplate)(!0);return t.visualModel.property=new Map([["width","100%"],["height","100%"]]),t.visualModel.children.push(e),JSON.stringify(t,i,4)},t.serializeSketchPage=function(e){const t=(0,o.getInstanceTemplate)(!1);return t.visualModel=e,JSON.stringify(t,i,4)},t.replacer=i,t.reviver=s},933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VisualModel=void 0;const r="-visual";t.VisualModel=class{constructor(e){if(this.propertyStorage=void 0,this.dynamicPropertyStorage=void 0,this.mediaProperty=void 0,this.dynamicMediaProperty=void 0,this.mediaPropertyStorage=void 0,this.dynamicMediaPropertyStorage=void 0,this.property=void 0!==e.property?e.property:new Map,this.dynamicProperty=void 0!==e.dynamicProperty?e.dynamicProperty:new Map,this.children=void 0!==e.children?e.children:[],"wrapper"===e.type)return this.id="wrapper",void(this.type="div");e.type.endsWith(r)&&(e.type=e.type.substring(0,e.type.length-r.length)),this.id=void 0!==e.id?e.id:"",this.type=e.type}getProperty(e){const t=this.dynamicProperty.get(e);return void 0!==t&&""!==t?t:this.property.get(e)}hasMediaProperty(e){if(void 0!==this.mediaProperty)for(const[,t]of this.mediaProperty)if(null==t?void 0:t.has(e))return!0;if(void 0!==this.dynamicMediaProperty)for(const[,t]of this.dynamicMediaProperty)if(null==t?void 0:t.has(e))return!0;return!1}hasProperty(e){return this.dynamicProperty.has(e)||this.property.has(e)}accept(e){return e.visit(this)}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";var e=n;Object.defineProperty(e,"__esModule",{value:!0});const t=r(784),o=r(891),a=r(977),i=r(844),s=r(55),l=r(207),p=r(413),c=r(435),u=r(486),f=r(294),y={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""};function d(e,r){var n;try{(0,a.deserialize)(e);const t=(0,o.getInstance)().document.VisualVersion,n=/^([1-9]+[0-9]*)$/;if(void 0===t)r.errorType="versionError";else{const e=t.match(n);(null===e||parseInt(e[1])>12)&&(r.errorType="versionError")}}catch(e){r.errorType="fileError"}""!==r.errorType&&(r.errorMessage=null!==(n=t.errorMap.get(r.errorType))&&void 0!==n?n:"Codegen visual file failed")}e.genHmlAndCss=function(e){const r={hmlCss:{hml:"",css:"",json:""},errorType:"",errorMessage:""};if(d(e,r),""!==r.errorType)return r.hmlCss.hml="",r.hmlCss.css="",r;try{const e=function(e){const t={hml:"",css:"",json:""},r=new i.HMLBridge,n=e.accept(r),o=(0,s.genFAHML)(n);t.hml=r.getErrorCount()>0?"error":o;const a=new i.CSSBridge,l=e.accept(a),p=(0,s.genFACSS)(l);return t.css=a.getErrorCount()>0?"error":p,t}((0,o.getInstance)().visualModel);"error"!==e.hml&&"error"!==e.css||(r.errorType="codegenError"),r.hmlCss=e,"FORM"===(0,o.getInstance)().document.type&&(r.hmlCss.json=l.formManager.codegenToJson())}catch(e){r.errorType="modelError"}return""!==r.errorType&&(r.errorMessage=t.errorMap.get(r.errorType),r.hmlCss.hml="",r.hmlCss.css=""),r},e.genETS=function(e){var r;const n={ets:(0,u.cloneDeep)(y),errorType:"",errorMessage:""};if(d(e,n),""!==n.errorType)return n.ets=(0,u.cloneDeep)(y),n;try{let e=(0,o.getInstance)().visualModel;(0,o.getInstance)().document.custom&&(e=e.children[0]),(0,f.beforeCodegen)(e);const t=function(e){const t=new p.ETSBridge,r=e.accept(t),n=(new c.StringWriter).genETS(r);return t.getErrorCount()>0?"error":n}(e);"error"===t&&(n.errorType="codegenError"),n.ets=t}catch(e){n.errorType="modelError"}return""!==n.errorType&&(n.errorMessage=null!==(r=t.errorMap.get(n.errorType))&&void 0!==r?r:"Codegen visual file failed",n.ets=(0,u.cloneDeep)(y)),n}})();var o=exports;for(var a in n)o[a]=n[a];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{var e={6486:function(e,t,r){var n;e=r.nmd(e),function(){var o,a="Expected a function",i="__lodash_hash_undefined__",s="__lodash_placeholder__",p=32,l=128,c=1/0,u=9007199254740991,y=NaN,d=4294967295,f=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",p],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",h="[object Boolean]",E="[object Date]",T="[object Error]",P="[object Function]",v="[object GeneratorFunction]",S="[object Map]",b="[object Number]",_="[object Object]",N="[object Promise]",C="[object RegExp]",A="[object Set]",M="[object String]",w="[object Symbol]",O="[object WeakMap]",R="[object ArrayBuffer]",x="[object DataView]",I="[object Float32Array]",F="[object Float64Array]",k="[object Int8Array]",L="[object Int16Array]",D="[object Int32Array]",U="[object Uint8Array]",V="[object Uint8ClampedArray]",B="[object Uint16Array]",z="[object Uint32Array]",G=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,H=RegExp($.source),Y=RegExp(q.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,oe=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,pe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ye=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,he=/^(?:0|[1-9]\d*)$/,Ee=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Te=/($^)/,Pe=/['\n\r\u2028\u2029\\]/g,ve="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="a-z\\xdf-\\xf6\\xf8-\\xff",be="A-Z\\xc0-\\xd6\\xd8-\\xde",_e="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ne="["+_e+"]",Ce="["+ve+"]",Ae="\\d+",Me="["+Se+"]",we="[^\\ud800-\\udfff"+_e+Ae+"\\u2700-\\u27bf"+Se+be+"]",Oe="\\ud83c[\\udffb-\\udfff]",Re="[^\\ud800-\\udfff]",xe="(?:\\ud83c[\\udde6-\\uddff]){2}",Ie="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+be+"]",ke="(?:"+Me+"|"+we+")",Le="(?:"+Fe+"|"+we+")",De="(?:['’](?:d|ll|m|re|s|t|ve))?",Ue="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ve="(?:"+Ce+"|"+Oe+")?",Be="[\\ufe0e\\ufe0f]?",ze=Be+Ve+"(?:\\u200d(?:"+[Re,xe,Ie].join("|")+")"+Be+Ve+")*",Ge="(?:"+["[\\u2700-\\u27bf]",xe,Ie].join("|")+")"+ze,je="(?:"+[Re+Ce+"?",Ce,xe,Ie,"[\\ud800-\\udfff]"].join("|")+")",We=RegExp("['’]","g"),$e=RegExp(Ce,"g"),qe=RegExp(Oe+"(?="+Oe+")|"+je+ze,"g"),He=RegExp([Fe+"?"+Me+"+"+De+"(?="+[Ne,Fe,"$"].join("|")+")",Le+"+"+Ue+"(?="+[Ne,Fe+ke,"$"].join("|")+")",Fe+"?"+ke+"+"+De,Fe+"+"+Ue,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,Ge].join("|"),"g"),Ye=RegExp("[\\u200d\\ud800-\\udfff"+ve+"\\ufe0e\\ufe0f]"),Je=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Qe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Xe=-1,Ke={};Ke[I]=Ke[F]=Ke[k]=Ke[L]=Ke[D]=Ke[U]=Ke[V]=Ke[B]=Ke[z]=!0,Ke[m]=Ke[g]=Ke[R]=Ke[h]=Ke[x]=Ke[E]=Ke[T]=Ke[P]=Ke[S]=Ke[b]=Ke[_]=Ke[C]=Ke[A]=Ke[M]=Ke[O]=!1;var Ze={};Ze[m]=Ze[g]=Ze[R]=Ze[x]=Ze[h]=Ze[E]=Ze[I]=Ze[F]=Ze[k]=Ze[L]=Ze[D]=Ze[S]=Ze[b]=Ze[_]=Ze[C]=Ze[A]=Ze[M]=Ze[w]=Ze[U]=Ze[V]=Ze[B]=Ze[z]=!0,Ze[T]=Ze[P]=Ze[O]=!1;var et={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tt=parseFloat,rt=parseInt,nt="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,ot="object"==typeof self&&self&&self.Object===Object&&self,at=nt||ot||Function("return this")(),it=t&&!t.nodeType&&t,st=it&&e&&!e.nodeType&&e,pt=st&&st.exports===it,lt=pt&&nt.process,ct=function(){try{return st&&st.require&&st.require("util").types||lt&<.binding&<.binding("util")}catch(e){}}(),ut=ct&&ct.isArrayBuffer,yt=ct&&ct.isDate,dt=ct&&ct.isMap,ft=ct&&ct.isRegExp,mt=ct&&ct.isSet,gt=ct&&ct.isTypedArray;function ht(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Et(e,t,r,n){for(var o=-1,a=null==e?0:e.length;++o-1}function _t(e,t,r){for(var n=-1,o=null==e?0:e.length;++n-1;);return r}function Ht(e,t){for(var r=e.length;r--&&It(t,e[r],0)>-1;);return r}function Yt(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var Jt=Ut({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Qt=Ut({"&":"&","<":"<",">":">",'"':""","'":"'"});function Xt(e){return"\\"+et[e]}function Kt(e){return Ye.test(e)}function Zt(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function er(e,t){return function(r){return e(t(r))}}function tr(e,t){for(var r=-1,n=e.length,o=0,a=[];++r",""":'"',"'":"'"}),pr=function e(t){var r,n=(t=null==t?at:pr.defaults(at.Object(),t,pr.pick(at,Qe))).Array,oe=t.Date,ve=t.Error,Se=t.Function,be=t.Math,_e=t.Object,Ne=t.RegExp,Ce=t.String,Ae=t.TypeError,Me=n.prototype,we=Se.prototype,Oe=_e.prototype,Re=t["__core-js_shared__"],xe=we.toString,Ie=Oe.hasOwnProperty,Fe=0,ke=(r=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Le=Oe.toString,De=xe.call(_e),Ue=at._,Ve=Ne("^"+xe.call(Ie).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=pt?t.Buffer:o,ze=t.Symbol,Ge=t.Uint8Array,je=Be?Be.allocUnsafe:o,qe=er(_e.getPrototypeOf,_e),Ye=_e.create,et=Oe.propertyIsEnumerable,nt=Me.splice,ot=ze?ze.isConcatSpreadable:o,it=ze?ze.iterator:o,st=ze?ze.toStringTag:o,lt=function(){try{var e=ca(_e,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==at.clearTimeout&&t.clearTimeout,Ot=oe&&oe.now!==at.Date.now&&oe.now,Ut=t.setTimeout!==at.setTimeout&&t.setTimeout,lr=be.ceil,cr=be.floor,ur=_e.getOwnPropertySymbols,yr=Be?Be.isBuffer:o,dr=t.isFinite,fr=Me.join,mr=er(_e.keys,_e),gr=be.max,hr=be.min,Er=oe.now,Tr=t.parseInt,Pr=be.random,vr=Me.reverse,Sr=ca(t,"DataView"),br=ca(t,"Map"),_r=ca(t,"Promise"),Nr=ca(t,"Set"),Cr=ca(t,"WeakMap"),Ar=ca(_e,"create"),Mr=Cr&&new Cr,wr={},Or=Va(Sr),Rr=Va(br),xr=Va(_r),Ir=Va(Nr),Fr=Va(Cr),kr=ze?ze.prototype:o,Lr=kr?kr.valueOf:o,Dr=kr?kr.toString:o;function Ur(e){if(rs(e)&&!$i(e)&&!(e instanceof Gr)){if(e instanceof zr)return e;if(Ie.call(e,"__wrapped__"))return Ba(e)}return new zr(e)}var Vr=function(){function e(){}return function(t){if(!ts(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=o,r}}();function Br(){}function zr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function Gr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function jr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sn(e,t,r,n,a,i){var s,p=1&t,l=2&t,c=4&t;if(r&&(s=a?r(e,n,a,i):r(e)),s!==o)return s;if(!ts(e))return e;var u=$i(e);if(u){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Ie.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!p)return Mo(e,s)}else{var y=da(e),d=y==P||y==v;if(Ji(e))return So(e,p);if(y==_||y==m||d&&!a){if(s=l||d?{}:ma(e),!p)return l?function(e,t){return wo(e,ya(e),t)}(e,function(e,t){return e&&wo(t,Is(t),e)}(s,e)):function(e,t){return wo(e,ua(e),t)}(e,rn(s,e))}else{if(!Ze[y])return a?e:{};s=function(e,t,r){var n,o=e.constructor;switch(t){case R:return bo(e);case h:case E:return new o(+e);case x:return function(e,t){var r=t?bo(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case I:case F:case k:case L:case D:case U:case V:case B:case z:return _o(e,r);case S:return new o;case b:case M:return new o(e);case C:return function(e){var t=new e.constructor(e.source,ye.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new o;case w:return n=e,Lr?_e(Lr.call(n)):{}}}(e,y,p)}}i||(i=new Hr);var f=i.get(e);if(f)return f;i.set(e,s),ss(e)?e.forEach((function(n){s.add(sn(n,t,r,n,e,i))})):ns(e)&&e.forEach((function(n,o){s.set(o,sn(n,t,r,o,e,i))}));var g=u?o:(c?l?na:ra:l?Is:xs)(e);return Tt(g||e,(function(n,o){g&&(n=e[o=n]),Zr(s,o,sn(n,t,r,o,e,i))})),s}function pn(e,t,r){var n=r.length;if(null==e)return!n;for(e=_e(e);n--;){var a=r[n],i=t[a],s=e[a];if(s===o&&!(a in e)||!i(s))return!1}return!0}function ln(e,t,r){if("function"!=typeof e)throw new Ae(a);return Oa((function(){e.apply(o,r)}),t)}function cn(e,t,r,n){var o=-1,a=bt,i=!0,s=e.length,p=[],l=t.length;if(!s)return p;r&&(t=Nt(t,jt(r))),n?(a=_t,i=!1):t.length>=200&&(a=$t,i=!1,t=new qr(t));e:for(;++o-1},Wr.prototype.set=function(e,t){var r=this.__data__,n=en(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new jr,map:new(br||Wr),string:new jr}},$r.prototype.delete=function(e){var t=pa(this,e).delete(e);return this.size-=t?1:0,t},$r.prototype.get=function(e){return pa(this,e).get(e)},$r.prototype.has=function(e){return pa(this,e).has(e)},$r.prototype.set=function(e,t){var r=pa(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},qr.prototype.add=qr.prototype.push=function(e){return this.__data__.set(e,i),this},qr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Hr.prototype.get=function(e){return this.__data__.get(e)},Hr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var n=r.__data__;if(!br||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new $r(n)}return r.set(e,t),this.size=r.size,this};var un=xo(Tn),yn=xo(Pn,!0);function dn(e,t){var r=!0;return un(e,(function(e,n,o){return r=!!t(e,n,o)})),r}function fn(e,t,r){for(var n=-1,a=e.length;++n0&&r(s)?t>1?gn(s,t-1,r,n,o):Ct(o,s):n||(o[o.length]=s)}return o}var hn=Io(),En=Io(!0);function Tn(e,t){return e&&hn(e,t,xs)}function Pn(e,t){return e&&En(e,t,xs)}function vn(e,t){return St(t,(function(t){return Ki(e[t])}))}function Sn(e,t){for(var r=0,n=(t=Eo(t,e)).length;null!=e&&rt}function Cn(e,t){return null!=e&&Ie.call(e,t)}function An(e,t){return null!=e&&t in _e(e)}function Mn(e,t,r){for(var a=r?_t:bt,i=e[0].length,s=e.length,p=s,l=n(s),c=1/0,u=[];p--;){var y=e[p];p&&t&&(y=Nt(y,jt(t))),c=hr(y.length,c),l[p]=!r&&(t||i>=120&&y.length>=120)?new qr(p&&y):o}y=e[0];var d=-1,f=l[0];e:for(;++d=s?p:p*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(o)}function jn(e,t,r){for(var n=-1,o=t.length,a={};++n-1;)s!==e&&nt.call(s,p,1),nt.call(e,p,1);return e}function $n(e,t){for(var r=e?t.length:0,n=r-1;r--;){var o=t[r];if(r==n||o!==a){var a=o;ha(o)?nt.call(e,o,1):lo(e,o)}}return e}function qn(e,t){return e+cr(Pr()*(t-e+1))}function Hn(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=cr(t/2))&&(e+=e)}while(t);return r}function Yn(e,t){return Ra(Na(e,t,op),e+"")}function Jn(e){return Jr(zs(e))}function Qn(e,t){var r=zs(e);return Fa(r,an(t,0,r.length))}function Xn(e,t,r,n){if(!ts(e))return e;for(var a=-1,i=(t=Eo(t,e)).length,s=i-1,p=e;null!=p&&++aa?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=n(a);++o>>1,i=e[a];null!==i&&!ls(i)&&(r?i<=t:i=200){var l=t?null:Yo(e);if(l)return rr(l);i=!1,o=$t,p=new qr}else p=t?[]:s;e:for(;++n=n?e:to(e,t,r)}var vo=ct||function(e){return at.clearTimeout(e)};function So(e,t){if(t)return e.slice();var r=e.length,n=je?je(r):new e.constructor(r);return e.copy(n),n}function bo(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function _o(e,t){var r=t?bo(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function No(e,t){if(e!==t){var r=e!==o,n=null===e,a=e==e,i=ls(e),s=t!==o,p=null===t,l=t==t,c=ls(t);if(!p&&!c&&!i&&e>t||i&&s&&l&&!p&&!c||n&&s&&l||!r&&l||!a)return 1;if(!n&&!i&&!c&&e1?r[a-1]:o,s=a>2?r[2]:o;for(i=e.length>3&&"function"==typeof i?(a--,i):o,s&&Ea(r[0],r[1],s)&&(i=a<3?o:i,a=1),t=_e(t);++n-1?a[i?t[s]:s]:o}}function Uo(e){return ta((function(t){var r=t.length,n=r,i=zr.prototype.thru;for(e&&t.reverse();n--;){var s=t[n];if("function"!=typeof s)throw new Ae(a);if(i&&!p&&"wrapper"==aa(s))var p=new zr([],!0)}for(n=p?n:r;++n1&&T.reverse(),d&&up))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var y=-1,d=!0,f=2&r?new qr:o;for(i.set(e,t),i.set(t,e);++y-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Tt(f,(function(r){var n="_."+r[0];t&r[1]&&!bt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(se):[]}(n),r)))}function Ia(e){var t=0,r=0;return function(){var n=Er(),a=16-(n-r);if(r=n,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function Fa(e,t){var r=-1,n=e.length,a=n-1;for(t=t===o?n:t;++r1?e[t-1]:o;return r="function"==typeof r?(e.pop(),r):o,ii(e,r)}));function di(e){var t=Ur(e);return t.__chain__=!0,t}function fi(e,t){return t(e)}var mi=ta((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,a=function(t){return on(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Gr&&ha(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:fi,args:[a],thisArg:o}),new zr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(o),e}))):this.thru(a)})),gi=Oo((function(e,t,r){Ie.call(e,r)?++e[r]:nn(e,r,1)})),hi=Do(Wa),Ei=Do($a);function Ti(e,t){return($i(e)?Tt:un)(e,sa(t,3))}function Pi(e,t){return($i(e)?Pt:yn)(e,sa(t,3))}var vi=Oo((function(e,t,r){Ie.call(e,r)?e[r].push(t):nn(e,r,[t])})),Si=Yn((function(e,t,r){var o=-1,a="function"==typeof t,i=Hi(e)?n(e.length):[];return un(e,(function(e){i[++o]=a?ht(t,e,r):wn(e,t,r)})),i})),bi=Oo((function(e,t,r){nn(e,r,t)}));function _i(e,t){return($i(e)?Nt:Dn)(e,sa(t,3))}var Ni=Oo((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Ci=Yn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ea(e,t[0],t[1])?t=[]:r>2&&Ea(t[0],t[1],t[2])&&(t=[t[0]]),Gn(e,gn(t,1),[])})),Ai=Ot||function(){return at.Date.now()};function Mi(e,t,r){return t=r?o:t,t=e&&null==t?e.length:t,Qo(e,l,o,o,o,o,t)}function wi(e,t){var r;if("function"!=typeof t)throw new Ae(a);return e=ms(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=o),r}}var Oi=Yn((function(e,t,r){var n=1;if(r.length){var o=tr(r,ia(Oi));n|=p}return Qo(e,n,t,r,o)})),Ri=Yn((function(e,t,r){var n=3;if(r.length){var o=tr(r,ia(Ri));n|=p}return Qo(t,n,e,r,o)}));function xi(e,t,r){var n,i,s,p,l,c,u=0,y=!1,d=!1,f=!0;if("function"!=typeof e)throw new Ae(a);function m(t){var r=n,a=i;return n=i=o,u=t,p=e.apply(a,r)}function g(e){return u=e,l=Oa(E,t),y?m(e):p}function h(e){var r=e-c;return c===o||r>=t||r<0||d&&e-u>=s}function E(){var e=Ai();if(h(e))return T(e);l=Oa(E,function(e){var r=t-(e-c);return d?hr(r,s-(e-u)):r}(e))}function T(e){return l=o,f&&n?m(e):(n=i=o,p)}function P(){var e=Ai(),r=h(e);if(n=arguments,i=this,c=e,r){if(l===o)return g(c);if(d)return vo(l),l=Oa(E,t),m(c)}return l===o&&(l=Oa(E,t)),p}return t=hs(t)||0,ts(r)&&(y=!!r.leading,s=(d="maxWait"in r)?gr(hs(r.maxWait)||0,t):s,f="trailing"in r?!!r.trailing:f),P.cancel=function(){l!==o&&vo(l),u=0,n=c=i=l=o},P.flush=function(){return l===o?p:T(Ai())},P}var Ii=Yn((function(e,t){return ln(e,1,t)})),Fi=Yn((function(e,t,r){return ln(e,hs(t)||0,r)}));function ki(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ae(a);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(ki.Cache||$r),r}function Li(e){if("function"!=typeof e)throw new Ae(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ki.Cache=$r;var Di=To((function(e,t){var r=(t=1==t.length&&$i(t[0])?Nt(t[0],jt(sa())):Nt(gn(t,1),jt(sa()))).length;return Yn((function(n){for(var o=-1,a=hr(n.length,r);++o=t})),Wi=On(function(){return arguments}())?On:function(e){return rs(e)&&Ie.call(e,"callee")&&!et.call(e,"callee")},$i=n.isArray,qi=ut?jt(ut):function(e){return rs(e)&&_n(e)==R};function Hi(e){return null!=e&&es(e.length)&&!Ki(e)}function Yi(e){return rs(e)&&Hi(e)}var Ji=yr||hp,Qi=yt?jt(yt):function(e){return rs(e)&&_n(e)==E};function Xi(e){if(!rs(e))return!1;var t=_n(e);return t==T||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function Ki(e){if(!ts(e))return!1;var t=_n(e);return t==P||t==v||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zi(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var ns=dt?jt(dt):function(e){return rs(e)&&da(e)==S};function os(e){return"number"==typeof e||rs(e)&&_n(e)==b}function as(e){if(!rs(e)||_n(e)!=_)return!1;var t=qe(e);if(null===t)return!0;var r=Ie.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&xe.call(r)==De}var is=ft?jt(ft):function(e){return rs(e)&&_n(e)==C},ss=mt?jt(mt):function(e){return rs(e)&&da(e)==A};function ps(e){return"string"==typeof e||!$i(e)&&rs(e)&&_n(e)==M}function ls(e){return"symbol"==typeof e||rs(e)&&_n(e)==w}var cs=gt?jt(gt):function(e){return rs(e)&&es(e.length)&&!!Ke[_n(e)]},us=$o(Ln),ys=$o((function(e,t){return e<=t}));function ds(e){if(!e)return[];if(Hi(e))return ps(e)?ar(e):Mo(e);if(it&&e[it])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[it]());var t=da(e);return(t==S?Zt:t==A?rr:zs)(e)}function fs(e){return e?(e=hs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=fs(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?an(ms(e),0,d):0}function hs(e){if("number"==typeof e)return e;if(ls(e))return y;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Gt(e);var r=fe.test(e);return r||ge.test(e)?rt(e.slice(2),r?2:8):de.test(e)?y:+e}function Es(e){return wo(e,Is(e))}function Ts(e){return null==e?"":so(e)}var Ps=Ro((function(e,t){if(Sa(t)||Hi(t))wo(t,xs(t),e);else for(var r in t)Ie.call(t,r)&&Zr(e,r,t[r])})),vs=Ro((function(e,t){wo(t,Is(t),e)})),Ss=Ro((function(e,t,r,n){wo(t,Is(t),e,n)})),bs=Ro((function(e,t,r,n){wo(t,xs(t),e,n)})),_s=ta(on),Ns=Yn((function(e,t){e=_e(e);var r=-1,n=t.length,a=n>2?t[2]:o;for(a&&Ea(t[0],t[1],a)&&(n=1);++r1),t})),wo(e,na(e),r),n&&(r=sn(r,7,Zo));for(var o=t.length;o--;)lo(r,t[o]);return r})),Ds=ta((function(e,t){return null==e?{}:function(e,t){return jn(e,t,(function(t,r){return Ms(e,r)}))}(e,t)}));function Us(e,t){if(null==e)return{};var r=Nt(na(e),(function(e){return[e]}));return t=sa(t),jn(e,r,(function(e,r){return t(e,r[0])}))}var Vs=Jo(xs),Bs=Jo(Is);function zs(e){return null==e?[]:Wt(e,xs(e))}var Gs=ko((function(e,t,r){return t=t.toLowerCase(),e+(r?js(t):t)}));function js(e){return Xs(Ts(e).toLowerCase())}function Ws(e){return(e=Ts(e))&&e.replace(Ee,Jt).replace($e,"")}var $s=ko((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),qs=ko((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Hs=Fo("toLowerCase"),Ys=ko((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Js=ko((function(e,t,r){return e+(r?" ":"")+Xs(t)})),Qs=ko((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Xs=Fo("toUpperCase");function Ks(e,t,r){return e=Ts(e),(t=r?o:t)===o?function(e){return Je.test(e)}(e)?function(e){return e.match(He)||[]}(e):function(e){return e.match(pe)||[]}(e):e.match(t)||[]}var Zs=Yn((function(e,t){try{return ht(e,o,t)}catch(e){return Xi(e)?e:new ve(e)}})),ep=ta((function(e,t){return Tt(t,(function(t){t=Ua(t),nn(e,t,Oi(e[t],e))})),e}));function tp(e){return function(){return e}}var rp=Uo(),np=Uo(!0);function op(e){return e}function ap(e){return Fn("function"==typeof e?e:sn(e,1))}var ip=Yn((function(e,t){return function(r){return wn(r,e,t)}})),sp=Yn((function(e,t){return function(r){return wn(e,r,t)}}));function pp(e,t,r){var n=xs(t),o=vn(t,n);null!=r||ts(t)&&(o.length||!n.length)||(r=t,t=e,e=this,o=vn(t,xs(t)));var a=!(ts(r)&&"chain"in r&&!r.chain),i=Ki(e);return Tt(o,(function(r){var n=t[r];e[r]=n,i&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__),o=r.__actions__=Mo(this.__actions__);return o.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Ct([this.value()],arguments))})})),e}function lp(){}var cp=Go(Nt),up=Go(vt),yp=Go(wt);function dp(e){return Ta(e)?Dt(Ua(e)):function(e){return function(t){return Sn(t,e)}}(e)}var fp=Wo(),mp=Wo(!0);function gp(){return[]}function hp(){return!1}var Ep,Tp=zo((function(e,t){return e+t}),0),Pp=Ho("ceil"),vp=zo((function(e,t){return e/t}),1),Sp=Ho("floor"),bp=zo((function(e,t){return e*t}),1),_p=Ho("round"),Np=zo((function(e,t){return e-t}),0);return Ur.after=function(e,t){if("function"!=typeof t)throw new Ae(a);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},Ur.ary=Mi,Ur.assign=Ps,Ur.assignIn=vs,Ur.assignInWith=Ss,Ur.assignWith=bs,Ur.at=_s,Ur.before=wi,Ur.bind=Oi,Ur.bindAll=ep,Ur.bindKey=Ri,Ur.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $i(e)?e:[e]},Ur.chain=di,Ur.chunk=function(e,t,r){t=(r?Ea(e,t,r):t===o)?1:gr(ms(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var i=0,s=0,p=n(lr(a/t));ia?0:a+r),(n=n===o||n>a?a:ms(n))<0&&(n+=a),n=r>n?0:gs(n);r>>0)?(e=Ts(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=so(t))&&Kt(e)?Po(ar(e),0,r):e.split(t,r):[]},Ur.spread=function(e,t){if("function"!=typeof e)throw new Ae(a);return t=null==t?0:gr(ms(t),0),Yn((function(r){var n=r[t],o=Po(r,0,t);return n&&Ct(o,n),ht(e,this,o)}))},Ur.tail=function(e){var t=null==e?0:e.length;return t?to(e,1,t):[]},Ur.take=function(e,t,r){return e&&e.length?to(e,0,(t=r||t===o?1:ms(t))<0?0:t):[]},Ur.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?to(e,(t=n-(t=r||t===o?1:ms(t)))<0?0:t,n):[]},Ur.takeRightWhile=function(e,t){return e&&e.length?uo(e,sa(t,3),!1,!0):[]},Ur.takeWhile=function(e,t){return e&&e.length?uo(e,sa(t,3)):[]},Ur.tap=function(e,t){return t(e),e},Ur.throttle=function(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new Ae(a);return ts(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),xi(e,t,{leading:n,maxWait:t,trailing:o})},Ur.thru=fi,Ur.toArray=ds,Ur.toPairs=Vs,Ur.toPairsIn=Bs,Ur.toPath=function(e){return $i(e)?Nt(e,Ua):ls(e)?[e]:Mo(Da(Ts(e)))},Ur.toPlainObject=Es,Ur.transform=function(e,t,r){var n=$i(e),o=n||Ji(e)||cs(e);if(t=sa(t,4),null==r){var a=e&&e.constructor;r=o?n?new a:[]:ts(e)&&Ki(a)?Vr(qe(e)):{}}return(o?Tt:Tn)(e,(function(e,n,o){return t(r,e,n,o)})),r},Ur.unary=function(e){return Mi(e,1)},Ur.union=ri,Ur.unionBy=ni,Ur.unionWith=oi,Ur.uniq=function(e){return e&&e.length?po(e):[]},Ur.uniqBy=function(e,t){return e&&e.length?po(e,sa(t,2)):[]},Ur.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?po(e,o,t):[]},Ur.unset=function(e,t){return null==e||lo(e,t)},Ur.unzip=ai,Ur.unzipWith=ii,Ur.update=function(e,t,r){return null==e?e:co(e,t,ho(r))},Ur.updateWith=function(e,t,r,n){return n="function"==typeof n?n:o,null==e?e:co(e,t,ho(r),n)},Ur.values=zs,Ur.valuesIn=function(e){return null==e?[]:Wt(e,Is(e))},Ur.without=si,Ur.words=Ks,Ur.wrap=function(e,t){return Ui(ho(t),e)},Ur.xor=pi,Ur.xorBy=li,Ur.xorWith=ci,Ur.zip=ui,Ur.zipObject=function(e,t){return mo(e||[],t||[],Zr)},Ur.zipObjectDeep=function(e,t){return mo(e||[],t||[],Xn)},Ur.zipWith=yi,Ur.entries=Vs,Ur.entriesIn=Bs,Ur.extend=vs,Ur.extendWith=Ss,pp(Ur,Ur),Ur.add=Tp,Ur.attempt=Zs,Ur.camelCase=Gs,Ur.capitalize=js,Ur.ceil=Pp,Ur.clamp=function(e,t,r){return r===o&&(r=t,t=o),r!==o&&(r=(r=hs(r))==r?r:0),t!==o&&(t=(t=hs(t))==t?t:0),an(hs(e),t,r)},Ur.clone=function(e){return sn(e,4)},Ur.cloneDeep=function(e){return sn(e,5)},Ur.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:o)},Ur.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:o)},Ur.conformsTo=function(e,t){return null==t||pn(e,t,xs(t))},Ur.deburr=Ws,Ur.defaultTo=function(e,t){return null==e||e!=e?t:e},Ur.divide=vp,Ur.endsWith=function(e,t,r){e=Ts(e),t=so(t);var n=e.length,a=r=r===o?n:an(ms(r),0,n);return(r-=t.length)>=0&&e.slice(r,a)==t},Ur.eq=zi,Ur.escape=function(e){return(e=Ts(e))&&Y.test(e)?e.replace(q,Qt):e},Ur.escapeRegExp=function(e){return(e=Ts(e))&&re.test(e)?e.replace(te,"\\$&"):e},Ur.every=function(e,t,r){var n=$i(e)?vt:dn;return r&&Ea(e,t,r)&&(t=o),n(e,sa(t,3))},Ur.find=hi,Ur.findIndex=Wa,Ur.findKey=function(e,t){return Rt(e,sa(t,3),Tn)},Ur.findLast=Ei,Ur.findLastIndex=$a,Ur.findLastKey=function(e,t){return Rt(e,sa(t,3),Pn)},Ur.floor=Sp,Ur.forEach=Ti,Ur.forEachRight=Pi,Ur.forIn=function(e,t){return null==e?e:hn(e,sa(t,3),Is)},Ur.forInRight=function(e,t){return null==e?e:En(e,sa(t,3),Is)},Ur.forOwn=function(e,t){return e&&Tn(e,sa(t,3))},Ur.forOwnRight=function(e,t){return e&&Pn(e,sa(t,3))},Ur.get=As,Ur.gt=Gi,Ur.gte=ji,Ur.has=function(e,t){return null!=e&&fa(e,t,Cn)},Ur.hasIn=Ms,Ur.head=Ha,Ur.identity=op,Ur.includes=function(e,t,r,n){e=Hi(e)?e:zs(e),r=r&&!n?ms(r):0;var o=e.length;return r<0&&(r=gr(o+r,0)),ps(e)?r<=o&&e.indexOf(t,r)>-1:!!o&&It(e,t,r)>-1},Ur.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=null==r?0:ms(r);return o<0&&(o=gr(n+o,0)),It(e,t,o)},Ur.inRange=function(e,t,r){return t=fs(t),r===o?(r=t,t=0):r=fs(r),function(e,t,r){return e>=hr(t,r)&&e=-9007199254740991&&e<=u},Ur.isSet=ss,Ur.isString=ps,Ur.isSymbol=ls,Ur.isTypedArray=cs,Ur.isUndefined=function(e){return e===o},Ur.isWeakMap=function(e){return rs(e)&&da(e)==O},Ur.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==_n(e)},Ur.join=function(e,t){return null==e?"":fr.call(e,t)},Ur.kebabCase=$s,Ur.last=Xa,Ur.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var a=n;return r!==o&&(a=(a=ms(r))<0?gr(n+a,0):hr(a,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,a):xt(e,kt,a,!0)},Ur.lowerCase=qs,Ur.lowerFirst=Hs,Ur.lt=us,Ur.lte=ys,Ur.max=function(e){return e&&e.length?fn(e,op,Nn):o},Ur.maxBy=function(e,t){return e&&e.length?fn(e,sa(t,2),Nn):o},Ur.mean=function(e){return Lt(e,op)},Ur.meanBy=function(e,t){return Lt(e,sa(t,2))},Ur.min=function(e){return e&&e.length?fn(e,op,Ln):o},Ur.minBy=function(e,t){return e&&e.length?fn(e,sa(t,2),Ln):o},Ur.stubArray=gp,Ur.stubFalse=hp,Ur.stubObject=function(){return{}},Ur.stubString=function(){return""},Ur.stubTrue=function(){return!0},Ur.multiply=bp,Ur.nth=function(e,t){return e&&e.length?zn(e,ms(t)):o},Ur.noConflict=function(){return at._===this&&(at._=Ue),this},Ur.noop=lp,Ur.now=Ai,Ur.pad=function(e,t,r){e=Ts(e);var n=(t=ms(t))?or(e):0;if(!t||n>=t)return e;var o=(t-n)/2;return jo(cr(o),r)+e+jo(lr(o),r)},Ur.padEnd=function(e,t,r){e=Ts(e);var n=(t=ms(t))?or(e):0;return t&&nt){var n=e;e=t,t=n}if(r||e%1||t%1){var a=Pr();return hr(e+a*(t-e+tt("1e-"+((a+"").length-1))),t)}return qn(e,t)},Ur.reduce=function(e,t,r){var n=$i(e)?At:Vt,o=arguments.length<3;return n(e,sa(t,4),r,o,un)},Ur.reduceRight=function(e,t,r){var n=$i(e)?Mt:Vt,o=arguments.length<3;return n(e,sa(t,4),r,o,yn)},Ur.repeat=function(e,t,r){return t=(r?Ea(e,t,r):t===o)?1:ms(t),Hn(Ts(e),t)},Ur.replace=function(){var e=arguments,t=Ts(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Ur.result=function(e,t,r){var n=-1,a=(t=Eo(t,e)).length;for(a||(a=1,e=o);++nu)return[];var r=d,n=hr(e,d);t=sa(t),e-=d;for(var o=zt(n,t);++r=i)return e;var p=r-or(n);if(p<1)return n;var l=s?Po(s,0,p).join(""):e.slice(0,p);if(a===o)return l+n;if(s&&(p+=l.length-p),is(a)){if(e.slice(p).search(a)){var c,u=l;for(a.global||(a=Ne(a.source,Ts(ye.exec(a))+"g")),a.lastIndex=0;c=a.exec(u);)var y=c.index;l=l.slice(0,y===o?p:y)}}else if(e.indexOf(so(a),p)!=p){var d=l.lastIndexOf(a);d>-1&&(l=l.slice(0,d))}return l+n},Ur.unescape=function(e){return(e=Ts(e))&&H.test(e)?e.replace($,sr):e},Ur.uniqueId=function(e){var t=++Fe;return Ts(e)+t},Ur.upperCase=Qs,Ur.upperFirst=Xs,Ur.each=Ti,Ur.eachRight=Pi,Ur.first=Ha,pp(Ur,(Ep={},Tn(Ur,(function(e,t){Ie.call(Ur.prototype,t)||(Ep[t]=e)})),Ep),{chain:!1}),Ur.VERSION="4.17.21",Tt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Ur[e].placeholder=Ur})),Tt(["drop","take"],(function(e,t){Gr.prototype[e]=function(r){r=r===o?1:gr(ms(r),0);var n=this.__filtered__&&!t?new Gr(this):this.clone();return n.__filtered__?n.__takeCount__=hr(r,n.__takeCount__):n.__views__.push({size:hr(r,d),type:e+(n.__dir__<0?"Right":"")}),n},Gr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Tt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Gr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:sa(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Tt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Gr.prototype[e]=function(){return this[r](1).value()[0]}})),Tt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Gr.prototype[e]=function(){return this.__filtered__?new Gr(this):this[r](1)}})),Gr.prototype.compact=function(){return this.filter(op)},Gr.prototype.find=function(e){return this.filter(e).head()},Gr.prototype.findLast=function(e){return this.reverse().find(e)},Gr.prototype.invokeMap=Yn((function(e,t){return"function"==typeof e?new Gr(this):this.map((function(r){return wn(r,e,t)}))})),Gr.prototype.reject=function(e){return this.filter(Li(sa(e)))},Gr.prototype.slice=function(e,t){e=ms(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Gr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==o&&(r=(t=ms(t))<0?r.dropRight(-t):r.take(t-e)),r)},Gr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gr.prototype.toArray=function(){return this.take(d)},Tn(Gr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),a=Ur[n?"take"+("last"==t?"Right":""):t],i=n||/^find/.test(t);a&&(Ur.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,p=t instanceof Gr,l=s[0],c=p||$i(t),u=function(e){var t=a.apply(Ur,Ct([e],s));return n&&y?t[0]:t};c&&r&&"function"==typeof l&&1!=l.length&&(p=c=!1);var y=this.__chain__,d=!!this.__actions__.length,f=i&&!y,m=p&&!d;if(!i&&c){t=m?t:new Gr(this);var g=e.apply(t,s);return g.__actions__.push({func:fi,args:[u],thisArg:o}),new zr(g,y)}return f&&m?e.apply(this,s):(g=this.thru(u),f?n?g.value()[0]:g.value():g)})})),Tt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Me[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Ur.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var o=this.value();return t.apply($i(o)?o:[],e)}return this[r]((function(r){return t.apply($i(r)?r:[],e)}))}})),Tn(Gr.prototype,(function(e,t){var r=Ur[t];if(r){var n=r.name+"";Ie.call(wr,n)||(wr[n]=[]),wr[n].push({name:t,func:r})}})),wr[Vo(o,2).name]=[{name:"wrapper",func:o}],Gr.prototype.clone=function(){var e=new Gr(this.__wrapped__);return e.__actions__=Mo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Mo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Mo(this.__views__),e},Gr.prototype.reverse=function(){if(this.__filtered__){var e=new Gr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=$i(e),n=t<0,o=r?e.length:0,a=function(e,t,r){for(var n=-1,o=r.length;++n=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},Ur.prototype.plant=function(e){for(var t,r=this;r instanceof Br;){var n=Ba(r);n.__index__=0,n.__values__=o,t?a.__wrapped__=n:t=n;var a=n;r=r.__wrapped__}return a.__wrapped__=e,t},Ur.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gr){var t=e;return this.__actions__.length&&(t=new Gr(this)),(t=t.reverse()).__actions__.push({func:fi,args:[ti],thisArg:o}),new zr(t,this.__chain__)}return this.thru(ti)},Ur.prototype.toJSON=Ur.prototype.valueOf=Ur.prototype.value=function(){return yo(this.__wrapped__,this.__actions__)},Ur.prototype.first=Ur.prototype.head,it&&(Ur.prototype[it]=function(){return this}),Ur}();at._=pr,(n=function(){return pr}.call(t,r,t,e))===o||(e.exports=n)}.call(this)},904:(e,t)=>{"use strict";var r;let n;Object.defineProperty(t,"__esModule",{value:!0}),t.setDomain=t.getDomain=t.Domain=void 0,function(e){e[e.FA=0]="FA",e[e.FORM=1]="FORM",e[e.ETS=2]="ETS"}(r||(r={})),t.Domain=r,t.setDomain=e=>{n=e},t.getDomain=()=>null!=n?n:r.FA},3784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMap=void 0,t.errorMap=new Map([["fileError","Visual file is damaged"],["versionError","Version number of visual file does not match"],["modelError","Visual model in visual file is damaged"],["codegenError","Codegen visual file failed"]])},4117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNode=void 0,t.ASTNode=class{accept(e){return e.visit(this)}}},1862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0,t.Cache=class{constructor(e,t=0){this.value="",this.indent=t,this.flag=!0,this.INDENT=e}indentOn(){this.flag=!0}indentOff(){this.flag=!1}incIndent(){this.indent++}decIndent(){this.indent--}checkIndent(){return this.indent<0}getIndents(){if(this.flag){let e="";for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const n=r(4117);class o extends n.ASTNode{constructor(e,t,r,n,o){super(),this.defaultValue=new Map,this.mediaParams=new Map,this.mediaProperties=new Map,this.mediaKeyProperty=new Map,this.tagName=e,this.params=t,this.content=r,this.properties=n,this.forEachObj=o,this.ifBoolean=null,this.isCustomTag=!1}setMediaParams(e){this.mediaParams=e}setParams(e){this.params=e}setIfBoolean(e){this.ifBoolean=e}setTagName(e){this.tagName=e}setForEachObj(e){this.forEachObj=e}setMediaProperty(e,t){t.forEach(((t,r)=>{var n;this.mediaKeyProperty.has(r)||this.mediaKeyProperty.set(r,new Map),null===(n=this.mediaKeyProperty.get(r))||void 0===n||n.set(e,t)}))}setDefaultValue(e,t,r="undefined",n=""){this.defaultValue.set(e,[r,t,n])}}t.Tag=o},5623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const n=r(9519),o=r(1862),a=r(5051),i=r(4294),s=r(6486);class p{constructor(e){this.cache=e,this.etsImport=new o.Cache(" ",0),this.etsVariable=new o.Cache(" ",1),this.etsFunction=new o.Cache(" ",1),this.aboutToAppear=new o.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}visit(e){e instanceof n.Tag&&(e.isCustomTag?this.genCustomTag(e):(this.needMediaQuery&&this.genMediaQuery(e),this.genTag(e)))}static getMethodGen(e){return void 0===p.instance?p.instance=new p(e):p.instance.setCache(e),p.instance}setCache(e){this.cache=e,this.etsImport=new o.Cache(" ",0),this.etsVariable=new o.Cache(" ",1),this.etsFunction=new o.Cache(" ",1),this.aboutToAppear=new o.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}genParams(e){const t=this.getParams(e);this.isCustomComponent(e)?this.genCustomParams(t):this.genCommonParams(t)}genCommonParams(e){if("string"==typeof e)this.cache.concat(e);else if(e.size>0){this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE);let t=0;e.forEach(((r,n)=>{this.cache.concat(n,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(t,a.TokenClass.COLON,a.TokenClass.SPACE,e,a.TokenClass.COMMA)})),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genObjectProperty(e){let t=0;this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE),e.forEach(((r,n)=>{this.cache.concat(n,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{e.accept(this),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.decIndent(),this.cache.indentOn()),this.cache.indentOn(),this.cache.concat(a.TokenClass.RBRA)),(null!==e.properties||null!==e.mediaProperties)&&(null!==e.content&&0!==e.content.length||this.cache.incIndent(),this.getProperties(e).forEach(((e,t)=>{this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.PROPERTY_START,t,a.TokenClass.TAG_START),this.cache.indentOff(),"string"==typeof e?this.cache.concat(e,a.TokenClass.TAG_END):this.genObjectProperty(e)})),null!==e.content&&0!==e.content.length||this.cache.decIndent()),this.genEnd(e)}genStart(e){this.genIfStart(e),this.genForTagStart(e),this.genCustomImport(e)}genEnd(e){this.genForTagEnd(e),this.genIfEnd(e)}genForTagStart(e){var t;void 0!==(null===(t=e.forEachObj)||void 0===t?void 0:t.for)&&(this.cache.concat("ForEach",a.TokenClass.TAG_START,e.forEachObj.for.toString(),a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE))}genForTagEnd(e){null!==e.forEachObj&&(this.cache.concat(a.TokenClass.RBRA),void 0!==e.forEachObj.key&&""!==e.forEachObj.key&&(this.cache.concat(a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.concat("return ",e.forEachObj.key.toString(),a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.TAG_END,a.TokenClass.RBRA),this.cache.indentOff()),this.cache.concat(a.TokenClass.TAG_END))}genIfStart(e){null!==e.ifBoolean&&(this.cache.concat("if",a.TokenClass.SPACE,a.TokenClass.TAG_START,e.ifBoolean.toString(),a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.incIndent())}genIfEnd(e){null!==e.ifBoolean&&(this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genMediaQuery(e){const t=new Map,r=new Map;if(this.collectMediaQueryMap(e,t),this.collectDefaultValueMap(e,r),0===t.size&&0===r.size)return;const n=(0,i.getUniqueName)("mediaQuery"),s=(0,i.getUniqueName)("initForMediaQuery"),p=(0,i.getUniqueName)("mediaQueryCb"),l=(0,i.getUniqueName)("saveMediaQueryResult"),c=(0,i.getUniqueName)("updateForMediaQuery"),u=new o.Cache(a.TokenClass.INDENT,1),y=new o.Cache(a.TokenClass.INDENT,1),d=new o.Cache(a.TokenClass.INDENT,1),f=new o.Cache(a.TokenClass.INDENT,1),m=new o.Cache(a.TokenClass.INDENT,1),g=new o.Cache(a.TokenClass.INDENT,1),h=new o.Cache(a.TokenClass.INDENT,1),E=new o.Cache(a.TokenClass.INDENT,2);this.genVariableDeclare(r,u,a.TokenClass.UNDEFINED),this.genMediaQueryCb(p,y),this.genMediaQueryListener(t,d,f),this.genInitFuc(s,r,m),this.genMediaQueryCbFnc(l,c,t,g),this.genUpdateFnc(c,s,t,h),this.genAboutToAppear(p,l,t,E),this.etsImport.indentOff(),this.aboutToAppear.indentOff(),this.etsVariable.indentOff(),this.etsFunction.indentOff(),this.etsImport.indentOff(),this.etsImport.concat("import ",n," from '@ohos.mediaquery'",a.TokenClass.NEW_LINE),this.aboutToAppear.concat(E.toString()),this.etsVariable.concat(u.toString(),y.toString(),d.toString(),f.toString()),this.etsFunction.concat(g.toString(),a.TokenClass.NEW_LINE,m.toString(),a.TokenClass.NEW_LINE,h.toString()),this.etsImport.indentOn(),this.aboutToAppear.indentOn(),this.etsVariable.indentOn(),this.etsFunction.indentOn(),this.needMediaQuery=!1}genCustomTag(e){this.genVariableDeclare(e.defaultValue,this.cache)}genVariableDeclare(e,t,r){t.indentOn(),e.forEach(((e,n)=>{const o=e[2];""!==o&&(t.concat(o,a.TokenClass.SPACE),t.indentOff()),t.concat(n.slice(5),a.TokenClass.COLON,a.TokenClass.SPACE,e[1]),t.indentOff();const i=null!=r?r:e[0];null!=i&&t.concat(a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,i,a.TokenClass.NEW_LINE),t.indentOn()}))}genMediaQueryCb(e,t){t.concat(e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.NULL,a.TokenClass.NEW_LINE)}genMediaQueryListener(e,t,r){const n=(0,i.getUniqueName)("mediaQuery");e.forEach(((e,o)=>{const s=(0,i.getUniqueName)(this.getMediaQueryVariableName(o));t.concat(s,a.TokenClass.COLON,a.TokenClass.SPACE,a.TokenClass.BOOLEAN,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.FALSE,a.TokenClass.NEW_LINE),r.concat(`listener_${s}`,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,n,a.TokenClass.PROPERTY_START,"matchMediaSync",a.TokenClass.TAG_START,`'${o}'`,a.TokenClass.TAG_END,a.TokenClass.NEW_LINE)}))}genInitFuc(e,t,r){r.concat(e,a.TokenClass.TAG_START,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),r.indentOn(),r.incIndent(),t.forEach(((e,t)=>{r.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e[0],a.TokenClass.NEW_LINE)})),r.decIndent(),r.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genMediaQueryCbFnc(e,t,r,n){const o=Array.from(r.entries());n.concat(e,a.TokenClass.TAG_START,"mediaQueryResult",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),n.incIndent(),n.concat(a.TokenClass.SWITCH,a.TokenClass.SPACE,a.TokenClass.TAG_START,"mediaQueryResult.media",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),n.incIndent();for(let e=0;e{const r=(0,i.getUniqueName)(this.getMediaQueryVariableName(t));n.concat(a.TokenClass.IF,a.TokenClass.SPACE,a.TokenClass.TAG_START,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,r,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),n.incIndent(),e.forEach(((e,t)=>{n.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e,a.TokenClass.NEW_LINE)})),n.decIndent(),n.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)})),n.decIndent(),n.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genAboutToAppear(e,t,r,n){let o=1;n.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,`${t}.bind(this)`,a.TokenClass.NEW_LINE),r.forEach(((t,s)=>{const p=`listener_${(0,i.getUniqueName)(this.getMediaQueryVariableName(s))}`;n.indentOn(),n.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,p,a.TokenClass.PROPERTY_START,`on('change', this.${e})`),o0&&e.mediaParams.forEach(((e,r)=>{t.set(r,e)})),t}getProperties(e){const t=new Map;return e.properties.forEach(((e,r)=>{t.set(r,e)})),e.mediaProperties.forEach(((e,r)=>{t.set(r,e)})),t}collectDefaultValueMap(e,t){void 0!==e.defaultValue&&e.defaultValue.forEach(((e,r)=>{t.set(r,e)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectDefaultValueMap(e,t)}))}collectMediaQueryMap(e,t){void 0!==e.mediaKeyProperty&&e.mediaKeyProperty.forEach(((e,r)=>{var n;const o=null!==(n=t.get(r))&&void 0!==n?n:new Map;e.forEach(((e,t)=>{o.set(t,e)})),t.set(r,o)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectMediaQueryMap(e,t)}))}getMediaQueryVariableName(e){const t="device-type: ",r="orientation: ",n=e.substring(e.indexOf(t),e.length),o=n.substring(t.length,n.indexOf(")")),a=e.substring(e.indexOf(r),e.length),i=a.substring(r.length,a.indexOf(")"));return`${o}${i.slice(0,1).toUpperCase()+i.slice(1).toLowerCase()}`}}t.ASTNodeGenerator=p,p.instance=void 0},8413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ETSBridge=void 0;const n=r(9519),o=r(1912),a=r(3729),i=r(6125),s=r(366);t.ETSBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map;let r=null;const p=new Map,l=new n.Tag(e.type,t,r,p,null);if((0,o.parseVisualModel)(e,l),(0,a.parseMediaVisualModel)(e,l),(0,i.parseCustomVisualModel)(e,l),(0,s.parseCustomMediaVisualModel)(e,l),e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}return l.content=r,l}}},9459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genCustomEts=t.genETS=t.EMPTY=void 0;const n=r(5623),o=r(1862);t.EMPTY={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""},t.genETS=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" ",2));return e.accept(t),{build:t.cache.toString(),etsImport:t.etsImport.toString(),etsVariable:t.etsVariable.toString(),etsFunction:t.etsFunction.toString(),aboutToAppear:t.aboutToAppear.toString()}},t.genCustomEts=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" ",1));return e.accept(t),t.cache.toString()}},4435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;const n=r(9459);t.StringWriter=class{genETS(e){return(0,n.genETS)(e)}}},5051:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.INDENT=" ",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.SPACE=" ",r.LQUOTE="'",r.RQUOTE="'",r.TAG_START="(",r.TAG_END=")",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDynamicValueByDecorator=t.getMediaVariableDecorator=t.getCustomAttrType=t.getCustomAttributeMap=t.setCustomAttribute=void 0;const n=r(2891),o=new Map;function a(){return o}function i(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.decorator)&&void 0!==r?r:"normal"}t.setCustomAttribute=function(e){var t,r;const a=e.type;(null!==(r=null===(t=(0,n.getInstance)().customData)||void 0===t?void 0:t.property.get(a))&&void 0!==r?r:new Map).forEach(((e,t)=>{const r=`${t}-${a.replace(/\//g,"-")}`;o.set(r,e)}))},t.getCustomAttributeMap=a,t.getCustomAttrType=function(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.type)&&void 0!==r?r:""},t.getMediaVariableDecorator=function(e){const t=i(e);let r="";return"@Link"!==t&&"@Prop"!==t||(r="@State"),r},t.getDynamicValueByDecorator=function(e,t){let r=t;return"@Link"===i(e)&&(r=t.replace("this.","$")),r}},6125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumParserMap=t.genCustomEvent=t.parseCustomVisualModel=void 0;const n=r(2891),o=r(3135),a=r(1195),i=r(8122),s=r(1790);function p(e,t){if(!(t.params instanceof Map))return;const r=function(e){var t,r;const o=e.type;return[...null!==(r=null===(t=(0,n.getInstance)().customData)||void 0===t?void 0:t.event.get(o))&&void 0!==r?r:[]]}(e);for(const n of r){const r=e.property.get(n);void 0!==r&&""!==r&&("this"===r.split(".")[0]?t.params.set(n,r+".bind(this)"):t.params.set(n,r))}}t.parseCustomVisualModel=function(e,r){(0,a.setCustomAttribute)(e),(0,a.getCustomAttributeMap)().forEach(((n,o)=>{if(function(e,t){return e.property.has(t)||e.dynamicProperty.has(t)}(e,o)){const a=c.get(n.type);"function"==typeof a&&a(o,e,r);const s=t.enumParserMap.get(n.type);"function"==typeof s&&function(e,t,r,n){if((0,i.dynamicParamParser)(e,t,r))return;const o=t.property.get(e);!(0,i.isEmptyOrUndefined)(o)&&r.params instanceof Map&&r.params.set((0,i.getEtsPropName)(e),n(o))}(o,e,r,s)}})),p(e,r)},t.genCustomEvent=p;const l=(0,i.curry)(i.getEtsEnumValue),c=new Map([["string",i.stringParamParser],["boolean",i.rawDataParamParser],["number",i.rawDataParamParser],["any[]",i.rawDataParamParser],["object",i.rawDataParamParser],["Date",function(e,t,r){(0,i.dateParamParser)(e,(0,i.getEtsPropName)(e),t,r)}]]);t.enumParserMap=new Map([["Alignment",function(e){const t=(0,i.getBackgroundImagePositionEnumValue)(e);return""!==t?t:(0,i.getEtsEnumValue)("Alignment.",e)}],["Direction",l("Direction.")],["ItemAlign",i.dealWithAlignSelf],["BorderStyle",l("BorderStyle.")],["ImageRepeat",i.dealWithBackgroundRepeat],["ImageSize",l("ImageSize.")],["Visibility",l("Visibility.")],["FontStyle",l("FontStyle.")],["FontWeight",i.dealWithFontWeight],["ButtonType",l("ButtonType.")],["Color",l("Color.")],["LineCapStyle",l("LineCapStyle.")],["ImageFit",l("ImageFit.")],["ImageInterpolation",l("ImageInterpolation.")],["ImageRenderMode",l("ImageRenderMode.")],["ProgressStyle",l("ProgressStyle.")],["SliderStyle",l("SliderStyle.")],["TextAlign",l("TextAlign.")],["TextOverflow",l("TextOverflow.")],["TextDecorationType",l("TextDecorationType.")],["TextCase",l("TextCase.")],["HorizontalAlign",s.dealWithColumnAlignItems],["FlexAlign",o.dealWithJustifyAlignContent],["VerticalAlign",s.dealWithRowAlignItems],["FlexDirection",l("FlexDirection.")],["FlexWrap",i.dealWithWrap],["Axis",l("Axis.")],["EdgeEffect",l("EdgeEffect.")],["Sticky",l("Sticky.")],["EnterKeyType",l("EnterKeyType.")],["ToggleType",l("ToggleType.")],["InputType",l("InputType.")],["ScrollDirection",l("ScrollDirection.")],["EdgeEffect",l("EdgeEffect.")],["GridDirection",l("GridDirection.")],["BarState",l("BarState.")],["NavigationTitleMode",l("NavigationTitleMode.")],["CopyOption",l("CopyOption.")],["BarPosition",l("BarPosition.")],["BarMode",l("BarMode.")]])},9223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonMediaParserArray=t.ifParser=t.forEachParser=void 0;const n=r(6282),o=r(8122),a=r(9248),i=(0,o.curry)(((e,t)=>t.hasMediaProperty(e)));function s(e,t,r){var n,a,i,s;const p=null!==(n=e.property.get("left"))&&void 0!==n?n:e.dynamicProperty.get("left"),l=null!==(a=e.property.get("top"))&&void 0!==a?a:e.dynamicProperty.get("top"),c=t.get("left"),u=t.get("top"),y=r.get("left"),d=r.get("top");let f="undefined",m="undefined";return(0,o.isEmptyOrUndefined)(c)&&(0,o.isEmptyOrUndefined)(u)||(f=(0,o.quoteString)(null!==(i=null!=c?c:p)&&void 0!==i?i:"0"),m=(0,o.quoteString)(null!==(s=null!=u?u:l)&&void 0!==s?s:"0")),(0,o.isEmptyOrUndefined)(y)&&(0,o.isEmptyOrUndefined)(d)||(f=null!=y?y:f,m=null!=d?d:m),{leftValue:f,topValue:m}}function p(e,t){e.forEach(((e,r)=>{"undefined"!==e&&t.set(r,"undefined")}))}function l(e,t){var r,n;const a=new Map,i=t.split("-")[0];return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((r,n)=>{var s,p,l,c;const u=r.get(i),y=null===(p=null===(s=e.dynamicMediaProperty)||void 0===s?void 0:s.get(n))||void 0===p?void 0:p.get(i),d=null!==(c=null!==(l=r.get(t))&&void 0!==l?l:y)&&void 0!==c?c:u;void 0!==d&&a.set(n,(0,o.quoteString)(d))})),(null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map).forEach(((e,r)=>{var n;const o=e.get(i),s=null!==(n=e.get(t))&&void 0!==n?n:o;void 0!==s&&a.set(r,s)})),a}const c=(0,o.curry)(((e,t,r)=>{const a=(0,n.getMediaProperty)(t,e,o.quoteString);if(0===a.size)return;const i=(0,n.getMediaDefaultValue)(t,e,o.quoteString),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,o.getEtsPropName)(e),s)})),u=(0,o.curry)(((e,t,r)=>{const a=(0,n.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,n.getMediaDefaultValue)(t,e),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,o.getEtsPropName)(e),s)})),y=(0,o.curry)(((e,t,r)=>{const a=(0,n.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,n.getMediaDefaultValue)(t,e),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,o.getEtsPropName)(e),s)})),d=(0,o.curry)(((e,t,r,a)=>{const i=(0,n.getMediaProperty)(r,e,(0,o.curry)(o.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,n.getMediaDefaultValue)(r,e,(0,o.curry)(o.getEtsEnumValue)(t)),p=(0,n.getVariableName)(r.id,e);a.setDefaultValue(p,(0,n.getType)(e),s),a.setMediaProperty(p,i),a.mediaProperties.set((0,o.getEtsPropName)(e),p)})),f=(0,o.curry)(((e,t,r)=>{const a=(0,n.getMediaProperty)(t,e,o.dealWithColor);if(0===a.size)return;const i=(0,n.getMediaDefaultValue)(t,e,o.dealWithColor),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,o.getEtsPropName)(e),s)}));function m(e,t,r,n=!1){(0,o.isEmptyOrUndefined)(t)||r.set(e,n?t:(0,o.quoteString)(t))}t.forEachParser=function(e,t){var r,o,a;const i=null!==(r=e.dynamicProperty.get("for"))&&void 0!==r?r:"[1]",s=null!==(o=e.property.get("item"))&&void 0!==o?o:"item",p=null!==(a=e.property.get("idx"))&&void 0!==a?a:"idx",l=e.dynamicProperty.get("keyGenerator"),c=(0,n.getMediaProperty)(e,"for");if(0===c.size)return;const u=(0,n.getVariableName)(e.id,"for"),y={for:u,key:l,item:s,idx:p};t.setDefaultValue(u,(0,n.getType)("for"),i),t.setMediaProperty(u,c),t.setForEachObj(y)},t.ifParser=function(e,t){const r=(0,n.getMediaProperty)(e,"if");if(0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"if"),a=(0,n.getVariableName)(e.id,"if");t.setDefaultValue(a,(0,n.getType)("if"),o),t.setMediaProperty(a,r),t.setIfBoolean(a)};const g=(0,o.curry)(((e,t,r)=>{const a=new Map,i=t.property.get(e),s=t.dynamicProperty.get(e),p=null!=s?s:i,c=["top","bottom","left","right"];let u=0;for(const i of c){const s=`${e}-${i}`,c=t.property.get(s),y=t.dynamicProperty.get(s),d=l(t,s);let f=(0,o.isEmptyOrUndefined)(p)?"undefined":(0,o.quoteString)(p);if((0,o.isEmptyOrUndefined)(c)||(f=(0,o.quoteString)(c)),(0,o.isEmptyOrUndefined)(y)||(f=y),d.size>0){const e=(0,n.getVariableName)(t.id,s);r.setDefaultValue(e,(0,n.getType)(s),f),r.setMediaProperty(e,d),m(i,e,a,!0),u++}else m(i,f,a,!0)}u>0&&r.mediaProperties.set(e,a)}));function h(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null===t?"undefined":void 0!==t[5]?`{ width: ${(0,o.quoteString)(t[1])}, height: ${(0,o.quoteString)(t[5])} }`:`{ width: ${(0,o.quoteString)(t[1])} }`}function E(e,t){var r,n;const a=new Map,i=new Map,s=P(t),p=v(t);return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((e,r)=>{const n=e.get(t);if(!(0,o.isEmptyOrUndefined)(n)){let e=s(n);e=""!==e?e:"undefined",a.set(r,e),i.set(r,p(n))}})),(null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map).forEach(((e,r)=>{const n=e.get(t);(0,o.isEmptyOrUndefined)(n)||(a.set(r,n),i.set(r,"undefined"))})),{enumValueMap:a,objValueMap:i}}function T(e,t){const r=e.property.get(t),n=e.dynamicProperty.get(t),a=P(t),i=v(t);let s="undefined",p="undefined";if(!(0,o.isEmptyOrUndefined)(r)){const e=a(r);s=""!==e?e:s,p=i(r)}return(0,o.isEmptyOrUndefined)(n)||(s=n,p="undefined"),{enumDefault:s,objDefault:p}}function P(e){return new Map([["background-image-size",o.getBackgroundImageSizeEnumValue],["background-image-position",o.getBackgroundImagePositionEnumValue]]).get(e)}function v(e){return new Map([["background-image-size",h],["background-image-position",S]]).get(e)}function S(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null===t?"undefined":`{ x: ${(0,o.quoteString)(t[1])}, y: ${(0,o.quoteString)(t[4])} }`}const b=(0,o.curry)(((e,t,r,a)=>{const i=(0,o.getBorderDirections)(e),s=new Map;let p=r.property.get(e);(0,o.isEmptyOrUndefined)(p)||(p=t(p));const l=r.dynamicProperty.get(e),c=null!=l?l:p,u=(0,n.getMediaProperty)(r,e,t);let y=0;for(const e of i){const i=(0,o.getEdgeBorderDirection)(e),p=r.property.get(e),l=r.dynamicProperty.get(e),d=(0,n.getMediaProperty)(r,e,t);let f=(0,o.isEmptyOrUndefined)(c)?"undefined":c;if((0,o.isEmptyOrUndefined)(p)||(f=t(p)),(0,o.isEmptyOrUndefined)(l)||(f=l),d.size>0){const t=(0,n.getVariableName)(r.id,e);a.setDefaultValue(t,(0,n.getType)(e),f),a.setMediaProperty(t,d),s.set(i,t),y++}else{const t=(0,n.getVariableName)(r.id,e);a.setDefaultValue(t,(0,n.getType)(e),f),a.setMediaProperty(t,u),s.set(i,t)}}y>0&&a.mediaProperties.set((0,o.getEtsPropName)(e),s)}));t.commonMediaParserArray=[[i("width"),c("width")],[i("height"),c("height")],[function(e){return e.hasMediaProperty("constraint-size-min-width")||e.hasMediaProperty("constraint-size-max-width")||e.hasMediaProperty("constraint-size-min-height")||e.hasMediaProperty("constraint-size-min-height")},function(e,t){const r=new Map,a=["min-width","max-width","min-height","max-height"];for(const i of a){const a=`constraint-size-${i}`,s=(0,n.getMediaProperty)(e,a,o.quoteString),p=(0,n.getMediaDefaultValue)(e,a,o.quoteString);if(s.size>0){const l=(0,n.getVariableName)(e.id,a);t.setDefaultValue(l,(0,n.getType)(a),p),t.setMediaProperty(l,s),m((0,o.getEtsPropName)(i),l,r,!0)}}r.size>0&&t.mediaProperties.set("constraintSize",r)}],[i("align"),d("align","Alignment.")],[i("direction"),d("direction","Direction.")],[function(e){return e.hasMediaProperty("left")||e.hasMediaProperty("top")},function(e,t){var r;const o=null!==(r=e.property.get("position"))&&void 0!==r?r:"relative",{leftValue:a,topValue:i}=s(e,e.property,e.dynamicProperty),{mediaPositionLeft:l,mediaPositionTop:c,mediaOffsetLeft:u,mediaOffsetTop:y}=function(e){var t,r;const n=new Map,o=new Map,a=new Map,i=new Map,p=null!==(t=e.mediaProperty)&&void 0!==t?t:new Map,l=null!==(r=e.dynamicMediaProperty)&&void 0!==r?r:new Map,c=new Set;for(const[e]of p)c.add(e);for(const[e]of l)c.add(e);return c.forEach((t=>{var r,p,l,c;const u=null!==(p=null===(r=e.mediaProperty)||void 0===r?void 0:r.get(t))&&void 0!==p?p:new Map,y=null!==(c=null===(l=e.dynamicMediaProperty)||void 0===l?void 0:l.get(t))&&void 0!==c?c:new Map,d=u.get("position"),{leftValue:f,topValue:m}=s(e,u,y);"absolute"===d?("undefined"!==f&&n.set(t,f),"undefined"!==m&&o.set(t,m)):("undefined"!==f&&a.set(t,f),"undefined"!==m&&i.set(t,m))})),{mediaPositionLeft:n,mediaPositionTop:o,mediaOffsetLeft:a,mediaOffsetTop:i}}(e),d=l.size>0||c.size>0||"absolute"===o,f=u.size>0||y.size>0||"relative"===o,m=(0,n.getVariableName)(e.id,"positionLeft"),g=(0,n.getVariableName)(e.id,"positionTop"),h=(0,n.getVariableName)(e.id,"offsetLeft"),E=(0,n.getVariableName)(e.id,"offsetTop");if(0!==l.size||0!==c.size||0!==y.size||0!==u.size){if(d&&f&&(p(l,u),p(u,l),p(c,y),p(y,c)),d){const e="absolute"===o?a:"undefined",r="absolute"===o?i:"undefined";t.setDefaultValue(m,(0,n.getType)("left"),e),t.setDefaultValue(g,(0,n.getType)("top"),r),t.setMediaProperty(m,l),t.setMediaProperty(g,c),t.mediaProperties.set("position",new Map([["x",m],["y",g]]))}if(f){const e="relative"===o?a:"undefined",r="relative"===o?i:"undefined";t.setDefaultValue(h,(0,n.getType)("left"),e),t.setDefaultValue(E,(0,n.getType)("top"),r),t.setMediaProperty(h,u),t.setMediaProperty(E,y),t.mediaProperties.set("offset",new Map([["x",h],["y",E]]))}}}],[i("aspect-ratio"),u("aspect-ratio")],[i("display-priority"),u("display-priority")],[i("flex-basis"),c("flex-basis")],[i("flex-grow"),u("flex-grow")],[i("flex-shrink"),u("flex-shrink")],[i("align-self"),function(e,t){const r=(0,n.getMediaProperty)(e,"align-self",o.dealWithAlignSelf);if(0===r.size)return;const a=(0,n.getMediaDefaultValue)(e,"align-self",o.dealWithAlignSelf),i=(0,n.getVariableName)(e.id,"align-self");t.setDefaultValue(i,(0,n.getType)("align-self"),a),t.setMediaProperty(i,r),t.mediaProperties.set("alignSelf",i)}],[i("border-style"),d("border-style","BorderStyle.")],[function(e){return e.hasMediaProperty("border-top-style")||e.hasMediaProperty("border-bottom-style")||e.hasMediaProperty("border-left-style")||e.hasMediaProperty("border-right-style")},b("border-style",(0,o.curry)(o.getEtsEnumValue)("BorderStyle."))],[i("border-width"),c("border-width")],[function(e){return e.hasMediaProperty("border-top-width")||e.hasMediaProperty("border-bottom-width")||e.hasMediaProperty("border-left-width")||e.hasMediaProperty("border-right-width")},b("border-width",o.quoteString)],[i("border-color"),f("border-color")],[function(e){return e.hasMediaProperty("border-top-color")||e.hasMediaProperty("border-bottom-color")||e.hasMediaProperty("border-left-color")||e.hasMediaProperty("border-right-color")},b("border-color",o.dealWithColor)],[i("border-radius"),c("border-radius")],[function(e){return e.hasMediaProperty("border-top-left-radius")||e.hasMediaProperty("border-bottom-right-radius")||e.hasMediaProperty("border-bottom-left-radius")||e.hasMediaProperty("border-top-right-radius")},b("border-radius",o.quoteString)],[i("background-color"),f("background-color")],[function(e){return e.hasMediaProperty("background-image-src")||e.hasMediaProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),i=e.property.get("background-image-repeat"),s=e.dynamicProperty.get("background-image-src"),p=e.dynamicProperty.get("background-image-repeat"),l=(0,n.getMediaProperty)(e,"background-image-src",a.dealWithSrc),c=(0,n.getMediaProperty)(e,"background-image-repeat",o.dealWithBackgroundRepeat);if(0===l.size&&0===c.size)return;let u=(0,a.dealWithSrc)(null!=r?r:"");if((0,o.isEmptyOrUndefined)(s)||(u=s),l.size>0){const r=(0,n.getVariableName)(e.id,"background-image-src");t.setDefaultValue(r,(0,n.getType)("background-image-src"),u),t.setMediaProperty(r,l),u=r}let y="undefined";if(!(0,o.isEmptyOrUndefined)(i)){const e=(0,o.dealWithBackgroundRepeat)(i);null!=e&&""!==e&&(y=e)}if((0,o.isEmptyOrUndefined)(p)||(y=p),c.size>0){const r=(0,n.getVariableName)(e.id,"background-image-repeat");t.setDefaultValue(r,(0,n.getType)("background-image-repeat"),y),t.setMediaProperty(r,c),y=r}t.mediaProperties.set("backgroundImage",u+", "+y)}],[i("background-image-size"),function(e,t){const{enumValueMap:r,objValueMap:o}=E(e,"background-image-size");if(0===r.size&&0===o.size)return;const{enumDefault:a,objDefault:i}=T(e,"background-image-size"),s=(0,n.getVariableName)(e.id,"background-image-size-enum"),p=(0,n.getVariableName)(e.id,"background-image-size-obj");t.setDefaultValue(s,"ImageSize",a),t.setDefaultValue(p,"SizeOptions",i),t.setMediaProperty(s,r),t.setMediaProperty(p,o),t.mediaProperties.set("backgroundImageSize",`${s} !== undefined ? ${s} : ${p}`)}],[i("background-image-position"),function(e,t){const{enumValueMap:r,objValueMap:o}=E(e,"background-image-position");if(0===r.size&&0===o.size)return;const{enumDefault:a,objDefault:i}=T(e,"background-image-position"),s=(0,n.getVariableName)(e.id,"background-image-position-enum"),p=(0,n.getVariableName)(e.id,"background-image-position-obj");t.setDefaultValue(s,"Alignment",a),t.setDefaultValue(p,"Position",i),t.setMediaProperty(s,r),t.setMediaProperty(p,o),t.mediaProperties.set("backgroundImagePosition",`${s} !== undefined ? ${s} : ${p}`)}],[i("opacity"),u("opacity")],[i("visibility"),d("visibility","Visibility.")],[i("enabled"),y("enabled")],[i("font-color"),f("font-color")],[function(e){return e.hasMediaProperty("margin")||e.hasMediaProperty("margin-left")||e.hasMediaProperty("margin-top")||e.hasMediaProperty("margin-right")||e.hasMediaProperty("margin-bottom")},g("margin")],[function(e){return e.hasMediaProperty("padding")||e.hasMediaProperty("padding-left")||e.hasMediaProperty("padding-top")||e.hasMediaProperty("padding-right")||e.hasMediaProperty("padding-bottom")},g("padding")]]},3135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.componentsMediaParserArray=t.dateMediaParamParser=t.rawDataMediaParamParser=t.stringMediaParamParser=t.dealWithJustifyAlignContent=void 0;const n=r(6282),o=r(1195),a=r(8122),i=r(9248),s=r(1790),p=r(5264),l=(0,a.curry)(((e,t,r)=>r.type===e&&r.hasMediaProperty(t)));function c(e){return isNaN(Number(e))?(0,a.getEtsEnumValue)("FontWeight.",e):e}function u(e){let t=(0,a.getEtsEnumValue)("FlexAlign.",e);return"flex-start"===e?t="FlexAlign.Start":"flex-end"===e&&(t="FlexAlign.End"),t}function y(e){return"TextOverflow."+(0,a.firstUpperCase)(e)}function d(e,t,r){var n,o;const i=new Map,s=null!==(n=e.mediaProperty)&&void 0!==n?n:new Map,p=null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map;return s.forEach(((e,n)=>{let o=e.get(t);const s=e.get(r);(0,a.isEmptyOrUndefined)(o)&&(0,a.isEmptyOrUndefined)(s)||(o="0"===o||(0,a.isEmptyOrUndefined)(o)?"0":o.substring(0,o.length-2),i.set(n,o))})),p.forEach(((e,r)=>{const n=e.get(t);(0,a.isEmptyOrUndefined)(n)||i.set(r,n)})),i}t.dealWithJustifyAlignContent=u;const f=(0,a.curry)(((e,t,r)=>{const o=(0,n.getMediaProperty)(t,e,a.quoteString);if(0===o.size)return;const i=(0,n.getMediaDefaultValue)(t,e,a.quoteString),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,o),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),m=(0,a.curry)(((e,t,r)=>{const o=(0,n.getMediaProperty)(t,e);if(0===o.size)return;const i=(0,n.getMediaDefaultValue)(t,e),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,o),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),g=(0,a.curry)(((e,t,r)=>{m(e,t,r)})),h=(0,a.curry)(((e,t,r,o)=>{const i=(0,n.getMediaProperty)(r,e,(0,a.curry)(a.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,n.getMediaDefaultValue)(r,e,(0,a.curry)(a.getEtsEnumValue)(t)),p=(0,n.getVariableName)(r.id,e);o.setDefaultValue(p,(0,n.getType)(e),s),o.setMediaProperty(p,i),o.mediaProperties.set((0,a.getEtsPropName)(e),p)}));t.stringMediaParamParser=(0,a.curry)(((e,t,r)=>{const i=(0,n.getMediaProperty)(t,e,a.quoteString);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,n.getMediaDefaultValue)(t,e,a.quoteString),p=(0,n.getVariableName)(t.id,e),l=(0,o.getMediaVariableDecorator)(e);r.setDefaultValue(p,(0,n.getType)(e),s,l),r.setMediaProperty(p,i),r.mediaParams.set((0,a.getEtsPropName)(e),(0,o.getDynamicValueByDecorator)(e,p))})),t.rawDataMediaParamParser=(0,a.curry)(((e,t,r)=>{const i=(0,n.getMediaProperty)(t,e);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,n.getMediaDefaultValue)(t,e),p=(0,n.getVariableName)(t.id,e);r.setDefaultValue(p,(0,n.getType)(e),s),r.setMediaProperty(p,i),r.mediaParams.set((0,a.getEtsPropName)(e),(0,o.getDynamicValueByDecorator)(e,p))})),t.dateMediaParamParser=(0,a.curry)(((e,t,r,o,i)=>{const s=e=>void 0===e||""===e?"new Date()":"new Date ("+(0,a.quoteString)(e)+")",p=(0,n.getMediaProperty)(o,e,s);if(!(i.mediaParams instanceof Map)||0===p.size)return;const l=(0,n.getMediaDefaultValue)(o,e,s),c=(0,n.getVariableName)(o.id,e);i.setDefaultValue(c,(0,n.getType)(e),l,r),i.setMediaProperty(c,p),i.mediaParams.set(t,c)}));const E=(0,a.curry)(((e,t,r,o,a)=>{const i=(0,n.getMediaProperty)(o,e);if(!(a.mediaParams instanceof Map)||0===i.size)return;const s=(0,n.getMediaDefaultValue)(o,e),p=(0,n.getVariableName)(o.id,e);a.setDefaultValue(p,(0,n.getType)(e),s,r),a.setMediaProperty(p,i),a.mediaParams.set(t,p)})),T=(0,a.curry)(((e,t,r,o)=>{const i=(0,n.getMediaProperty)(r,e,(0,a.curry)(a.getEtsEnumValue)(t));if(!(o.mediaParams instanceof Map)||0===i.size)return;const s=(0,n.getMediaDefaultValue)(r,e,(0,a.curry)(a.getEtsEnumValue)(t)),p=(0,n.getVariableName)(r.id,e);o.setDefaultValue(p,(0,n.getType)(e),s),o.setMediaProperty(p,i),o.mediaParams.set((0,a.getEtsPropName)(e),p)})),P=(0,a.curry)(((e,t,r)=>{const o=(0,n.getMediaProperty)(t,e,a.dealWithColor);if(0===o.size)return;const i=(0,n.getMediaDefaultValue)(t,e,a.dealWithColor),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,o),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),v=(0,a.curry)(((e,t,r)=>{const o=(0,n.getMediaProperty)(t,e);if(0===o.size)return;const i=(0,n.getMediaDefaultValue)(t,e),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,o),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),S=(0,a.curry)(((e,t,r,o)=>{const i=(0,n.getMediaProperty)(r,e,a.quoteString);if(0===i.size)return;const s=(0,n.getMediaDefaultValue)(r,e,a.quoteString),p=(0,n.getVariableName)(r.id,e);o.setDefaultValue(p,(0,n.getType)(e),s),o.setMediaProperty(p,i),o.mediaProperties.set((0,a.getEtsPropName)(t),p)})),b=(0,a.curry)(((e,t,r,o)=>{const i=(0,n.getMediaProperty)(r,e,u);if(!(o.mediaParams instanceof Map)||0===i.size)return;const s=(0,n.getMediaDefaultValue)(r,e,u),p=(0,n.getVariableName)(r.id,e);o.setDefaultValue(p,(0,n.getType)(e),s),o.setMediaProperty(p,i),o.mediaParams.set((0,a.getEtsPropName)(e),p)})),_=(0,a.curry)(((e,t,r,o)=>{const a=(0,n.getMediaProperty)(r,e,u);if(!(o.mediaProperties instanceof Map)||0===a.size)return;const i=(0,n.getMediaDefaultValue)(r,e,u),s=(0,n.getVariableName)(r.id,e);o.setDefaultValue(s,(0,n.getType)(e),i),o.setMediaProperty(s,a),o.mediaProperties.set("justifyContent",s)})),N=(0,a.curry)(((e,t)=>t.type===e));function C(e,t,r){const o=e.property.get(r),i=e.dynamicProperty.get(r),s=(0,n.getMediaProperty)(e,r,a.quoteString);if(0===s.size)return;let p="''";(0,a.isEmptyOrUndefined)(o)||(p=(0,a.quoteString)(o)),(0,a.isEmptyOrUndefined)(i)||(p=(0,a.getContentName)(i));const l=(0,n.getVariableName)(e.id,r);t.setDefaultValue(l,(0,n.getType)(r),p),t.setMediaProperty(l,s),t.setMediaParams(l)}const A=(0,a.curry)(((e,t,r,o)=>{let i=o.mediaProperties.get((0,a.getEtsPropName)(e));void 0===i&&(i=new Map);const s=`${e}-${t}`,p=(0,n.getVariableName)(r.id,s);let l=(0,n.getMediaProperty)(r,s,a.quoteString),u=(0,n.getMediaDefaultValue)(r,s,a.quoteString);if("string"!=typeof i){if((0,a.isEmptyOrUndefined)(u))return;"style"===t&&(l=(0,n.getMediaProperty)(r,s,(0,a.curry)(a.getEtsEnumValue)("FontStyle.")),u=(0,n.getMediaDefaultValue)(r,s,(0,a.curry)(a.getEtsEnumValue)("FontStyle."))),"weight"===t&&(l=(0,n.getMediaProperty)(r,s,c),u=(0,n.getMediaDefaultValue)(r,s,c)),o.setDefaultValue(p,(0,n.getType)(s),u),o.setMediaProperty(p,l),i.set(t,p)}o.mediaProperties.set((0,a.getEtsPropName)(e),i)}));function M(e,t){const r=(0,n.getMediaProperty)(e,"font-weight",a.dealWithFontWeight);if(0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"font-weight",a.dealWithFontWeight),i=(0,n.getVariableName)(e.id,"font-weight");t.setDefaultValue(i,(0,n.getType)("font-weight"),o),t.setMediaProperty(i,r),t.mediaProperties.set("fontWeight",i)}function w(e,t,r,o){const i=new Map([["value","search-value"],["placeholder","placeholder"],["icon","icon"]]).get(e);if(void 0===i)return;const s=r.getProperty(i),p=r.dynamicProperty.get(i),l=(0,n.getMediaProperty)(r,i,a.quoteString),c=(0,n.getVariableName)(r.id,i);let u="''";0!==l.size&&((0,a.isEmptyOrUndefined)(s)||(u=(0,a.quoteString)(s)),(0,a.isEmptyOrUndefined)(p)||(u=(0,a.getContentName)(p)),o.setDefaultValue(c,(0,n.getType)(i),u),o.setMediaProperty(c,l),t.push(`${e}: ${(0,a.getContentName)(c)}`))}const O=[[l("button","label"),function(e,t){C(e,t,"label")}],[l("button","type"),h("type","ButtonType.")],[l("button","state-effect"),g("state-effect")],[l("button","font-size"),f("font-size")],[l("button","font-style"),h("font-style","FontStyle.")],[l("button","font-weight"),M],[l("button","font-family"),f("font-family")]],R=[[l("divider","vertical"),g("vertical")],[l("divider","color"),P("color")],[l("divider","stroke-width"),f("stroke-width")],[l("divider","line-cap"),h("line-cap","LineCapStyle.")]],x=[[N("image"),function(e,t){var r;const o=null!==(r=e.property.get("src"))&&void 0!==r?r:"",s=e.dynamicProperty.get("src"),p=(0,n.getMediaProperty)(e,"src",i.dealWithSrc);if(0===p.size)return;let l=(0,i.dealWithSrc)(o);(0,a.isEmptyOrUndefined)(s)||(l=s);const c=(0,n.getVariableName)(e.id,"src");t.setDefaultValue(c,(0,n.getType)("src"),l),t.setMediaProperty(c,p),t.setMediaParams(c)}],[l("image","alt"),f("alt")],[l("image","object-fit"),h("object-fit","ImageFit.")],[l("image","object-repeat"),h("object-repeat","ImageRepeat.")],[l("image","interpolation"),h("interpolation","ImageInterpolation.")],[l("image","render-mode"),h("render-mode","ImageRenderMode.")],[function(e){return e.hasMediaProperty("source-size-width")||e.hasMediaProperty("source-size-height")},function(e,t){let r=e.property.get("source-size-width"),o=e.property.get("source-size-height");const i=e.dynamicProperty.get("source-size-width"),s=e.dynamicProperty.get("source-size-height"),p=d(e,"source-size-width","source-size-height"),l=d(e,"source-size-height","source-size-width");if(0===p.size)return;r="0"===r||(0,a.isEmptyOrUndefined)(r)?"0":r.substring(0,r.length-2),o="0"===o||(0,a.isEmptyOrUndefined)(o)?"0":o.substring(0,o.length-2),(0,a.isEmptyOrUndefined)(i)||(r=i),(0,a.isEmptyOrUndefined)(s)||(o=s);const c=(0,n.getVariableName)(e.id,"source-size-width"),u=(0,n.getVariableName)(e.id,"source-size-height");t.setDefaultValue(c,(0,n.getType)("source-size-width"),r),t.setDefaultValue(u,(0,n.getType)("source-size-height"),o),t.setMediaProperty(c,p),t.setMediaProperty(u,l);const y=new Map([["width",c],["height",u]]);t.mediaProperties.set("sourceSize",y)}]],I=[[function(e){return"progress"===e.type&&(e.hasMediaProperty("value")||e.hasMediaProperty("total")||e.hasMediaProperty("style"))},function(e,t){const r=e.property.get("value"),o=e.dynamicProperty.get("value"),i=(0,n.getMediaProperty)(e,"value");if(!(t.mediaParams instanceof Map)||0===i.size)return;let s=null!=r?r:"0";(0,a.isEmptyOrUndefined)(o)||(s=o);const p=(0,n.getVariableName)(e.id,"value");t.setDefaultValue(p,(0,n.getType)("value"),s),t.setMediaProperty(p,i),t.mediaParams.set("value",p)}],[l("progress","total"),(0,t.rawDataMediaParamParser)("total")],[l("progress","style"),T("style","ProgressStyle.")],[l("progress","color"),P("color")]],F=[[l("slider","value"),(0,t.rawDataMediaParamParser)("value")],[l("slider","min"),(0,t.rawDataMediaParamParser)("min")],[l("slider","max"),(0,t.rawDataMediaParamParser)("max")],[l("slider","step"),(0,t.rawDataMediaParamParser)("step")],[l("slider","style"),T("style","SliderStyle.")],[l("slider","block-color"),P("block-color")],[l("slider","track-color"),P("track-color")],[l("slider","selected-color"),P("selected-color")],[l("slider","show-steps"),g("show-steps")],[l("slider","show-tips"),g("show-tips")]],k=[[l("text","content"),function(e,t){C(e,t,"content")}],[l("text","text-align"),h("text-align","TextAlign.")],[l("text","text-overflow"),function(e,t){const r=(0,n.getMediaProperty)(e,"text-overflow",y);if(0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"text-overflow",y),a=(0,n.getVariableName)(e.id,"text-overflow");t.setDefaultValue(a,(0,n.getType)("text-overflow"),o),t.setMediaProperty(a,r),t.mediaProperties.set("textOverflow",new Map([["overflow",a]]))}],[l("text","max-lines"),m("max-lines")],[l("text","line-height"),f("line-height")],[function(e){return"text"===e.type&&(e.hasMediaProperty("decoration-type")||e.hasMediaProperty("decoration-color"))},function(e,t){const r=(0,n.getMediaProperty)(e,"decoration-type",(0,a.curry)(a.getEtsEnumValue)("TextDecorationType.")),o=(0,n.getMediaProperty)(e,"decoration-color",a.dealWithColor);if(0===r.size&&0===o.size)return;let i=(0,n.getMediaDefaultValue)(e,"decoration-type",(0,a.curry)(a.getEtsEnumValue)("TextDecorationType.")),s=(0,n.getMediaDefaultValue)(e,"decoration-color",a.dealWithColor);if(r.size>0){const o=(0,n.getVariableName)(e.id,"decoration-type");t.setDefaultValue(o,(0,n.getType)("decoration-type"),i),t.setMediaProperty(o,r),i=o}if(o.size>0){const r=(0,n.getVariableName)(e.id,"decoration-color");t.setDefaultValue(r,(0,n.getType)("decoration-color"),s),t.setMediaProperty(r,o),s=r}const p=new Map([["type",i]]);t.mediaProperties.set("decoration",p),"undefined"!==s&&p.set("color",s)}],[l("text","baseline-offset"),f("baseline-offset")],[l("text","text-case"),h("text-case","TextCase.")],[l("text","font-size"),f("font-size")],[l("text","font-style"),h("font-style","FontStyle.")],[l("text","font-weight"),M],[l("text","font-family"),f("font-family")]],L=[[l("column","space"),(0,t.stringMediaParamParser)("space")],[l("column","align-items-column"),function(e,t){const r=(0,n.getMediaProperty)(e,"align-items-column",s.dealWithColumnAlignItems);if(0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"align-items-column",s.dealWithColumnAlignItems),a=(0,n.getVariableName)(e.id,"align-items-column");t.setDefaultValue(a,(0,n.getType)("align-items-column"),o),t.setMediaProperty(a,r),t.mediaProperties.set("alignItems",a)}],[l("column","justify-content-rc"),_("justify-content-rc","FlexAlign.")]],D=[[l("row","space"),(0,t.stringMediaParamParser)("space")],[l("row","align-items-row"),function(e,t){const r=(0,n.getMediaProperty)(e,"align-items-row",s.dealWithRowAlignItems);if(0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"align-items-row",s.dealWithRowAlignItems),a=(0,n.getVariableName)(e.id,"align-items-row");t.setDefaultValue(a,(0,n.getType)("align-items-row"),o),t.setMediaProperty(a,r),t.mediaProperties.set("alignItems",a)}],[l("row","justify-content-rc"),_("justify-content-rc","FlexAlign.")]],U=[[l("flex","flex-direction"),function(e,t){const r=(0,n.getMediaProperty)(e,"flex-direction",(0,a.curry)(a.getEtsEnumValue)("FlexDirection."));if(!(t.mediaParams instanceof Map)||0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"flex-direction",(0,a.curry)(a.getEtsEnumValue)("FlexDirection.")),i=(0,n.getVariableName)(e.id,"flex-direction");t.setDefaultValue(i,(0,n.getType)("flex-direction"),o),t.setMediaProperty(i,r),t.mediaParams.set("direction",i)}],[l("flex","wrap"),function(e,t){const r=(0,n.getMediaProperty)(e,"wrap",a.dealWithWrap);if(!(t.mediaParams instanceof Map)||0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"wrap",a.dealWithWrap),i=(0,n.getVariableName)(e.id,"wrap");t.setDefaultValue(i,(0,n.getType)("wrap"),o),t.setMediaProperty(i,r),t.mediaParams.set("wrap",i)}],[l("flex","justify-content"),b("justify-content","FlexAlign.")],[l("flex","align-items-flex"),function(e,t){const r=(0,n.getMediaProperty)(e,"align-items-flex",p.dealWithFlexAlignItems);if(!(t.mediaParams instanceof Map)||0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"align-items-flex",p.dealWithFlexAlignItems),a=(0,n.getVariableName)(e.id,"align-items-flex");t.setDefaultValue(a,(0,n.getType)("align-items-flex"),o),t.setMediaProperty(a,r),t.mediaParams.set("alignItems",a)}],[l("flex","align-content"),b("align-content","FlexAlign.")]],V=[[l("list","space"),(0,t.stringMediaParamParser)("space")],[l("list","initial-index"),(0,t.rawDataMediaParamParser)("initial-index")],[l("list","list-direction"),h("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasMediaProperty("divider-stroke-width")||e.hasMediaProperty("divider-color")||e.hasMediaProperty("divider-start-margin")||e.hasMediaProperty("divider-end-margin"))},function(e,t){const r=[["divider-stroke-width",a.quoteString],["divider-color",a.dealWithColor],["divider-start-margin",a.quoteString],["divider-end-margin",a.quoteString]];let o=0;const i=new Map;for(const[s,p]of r){const r=(0,n.getMediaProperty)(e,s,p),l=(0,a.getEtsPropName)(s.replace("divider-",""));let c=(0,n.getMediaDefaultValue)(e,s,p);if("undefined"===c&&"divider-stroke-width"===s&&(c="0"),r.size>0){const a=(0,n.getVariableName)(e.id,s);t.setDefaultValue(a,(0,n.getType)(s),c),t.setMediaProperty(a,r),c=a,o++}i.set(l,c)}o>0&&t.mediaProperties.set("divider",i)}],[l("list","edit-mode"),g("edit-mode")],[l("list","edge-effect"),h("edge-effect","EdgeEffect.")],[l("list","chain-animation"),g("chain-animation")]],B=[[l("list-item","sticky"),h("sticky","Sticky.")],[l("list-item","editable"),g("editable")]],z=[[l("swiper","index"),m("index")],[l("swiper","auto-play"),g("auto-play")],[l("swiper","interval"),m("interval")],[l("swiper","indicator"),g("indicator")],[l("swiper","loop"),g("loop")],[l("swiper","duration"),m("duration")],[l("swiper","vertical"),g("vertical")],[l("swiper","item-space"),f("item-space")],[l("swiper","cached-count"),m("cached-count")],[l("swiper","disable-swipe"),g("disable-swipe")]],G=[[l("text-input","placeholder"),(0,t.stringMediaParamParser)("placeholder")],[l("text-input","textInput-type"),function(e,t){const r=(0,n.getMediaProperty)(e,"textInput-type",(0,a.curry)(a.getEtsEnumValue)("InputType."));if(0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"textInput-type",(0,a.curry)(a.getEtsEnumValue)("InputType.")),i=(0,n.getVariableName)(e.id,"textInput-type");t.setDefaultValue(i,(0,n.getType)("textInput-type"),o),t.setMediaProperty(i,r),t.mediaProperties.set("type",i)}],[l("text-input","placeholderColor"),P("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasMediaProperty("placeholderFont-size")||e.hasMediaProperty("placeholderFont-weight")||e.hasMediaProperty("placeholderFont-family")||e.hasMediaProperty("placeholderFont-style"))},function(e,t){const r=[["size",a.quoteString],["weight",c],["family",a.quoteString],["style",(0,a.curry)(a.getEtsEnumValue)("FontStyle.")]];let o=0;const i=new Map;for(const[a,s]of r){const r=`placeholderFont-${a}`,p=(0,n.getMediaProperty)(e,r,s);let l=(0,n.getMediaDefaultValue)(e,r,s);if(p.size>0){const a=(0,n.getVariableName)(e.id,r);t.setDefaultValue(a,(0,n.getType)(r),l),t.setMediaProperty(a,p),l=a,o++}i.set(a,l)}o>0&&t.mediaProperties.set("placeholderFont",i)}],[l("text-input","enterKeyType"),h("enterKeyType","EnterKeyType.")],[l("text-input","caretColor"),P("caretColor")],[l("text-input","maxLength"),m("maxLength")]],j=[[l("refresh","friction"),(0,t.rawDataMediaParamParser)("friction")],[l("refresh","offset"),(0,t.stringMediaParamParser)("offset")],[l("refresh","refreshing"),(0,t.rawDataMediaParamParser)("refreshing")]],W=[[l("timePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[l("timePicker","useMilitaryTime"),g("useMilitaryTime")]],$=[[l("datePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[l("datePicker","start"),(0,t.dateMediaParamParser)("start","start","private")],[l("datePicker","end"),(0,t.dateMediaParamParser)("end","end","private")],[l("datePicker","lunar"),g("lunar")]],q=[[l("textPicker","range"),(0,t.rawDataMediaParamParser)("range")],[l("textPicker","textPicker-selected"),E("textPicker-selected","selected","@State")],[l("textPicker","defaultPickerItemHeight"),f("defaultPickerItemHeight")]],H=[[l("select","select-option"),function(e,t){!function(e,t,r){const o=e.dynamicProperty.get(r),i=(0,n.getMediaProperty)(e,r,a.quoteString);if(0===i.size)return;const s=null!=o?o:'[{value: ""}]',p=(0,n.getVariableName)(e.id,r);t.setDefaultValue(p,(0,n.getType)(r),s),t.setMediaProperty(p,i),t.setMediaParams(p)}(e,t,"select-option")}],[l("select","select-value"),function(e,t){const r="select-value",o=(0,n.getMediaProperty)(e,r,a.quoteString);if(0===o.size)return;const i=(0,n.getMediaDefaultValue)(e,r,a.quoteString),s=(0,n.getVariableName)(e.id,r);t.setDefaultValue(s,(0,n.getType)(r),i),t.setMediaProperty(s,o),t.mediaProperties.set("value",s)}],[l("select","selected"),m("selected")],[l("select","font-size"),A("font","size")],[l("select","font-style"),A("font","style")],[l("select","font-family"),A("font","family")],[l("select","font-weight"),A("font","weight")],[l("select","selected-option-font-size"),A("selected-option-font","size")],[l("select","selected-option-font-style"),A("selected-option-font","style")],[l("select","selected-option-font-family"),A("selected-option-font","family")],[l("select","selected-option-font-weight"),A("selected-option-font","weight")],[l("select","selected-option-font-color"),P("selected-option-font-color")],[l("select","selected-option-bg-color"),P("selected-option-bg-color")],[l("select","option-font-size"),A("option-font","size")],[l("select","option-font-style"),A("option-font","style")],[l("select","option-font-family"),A("option-font","family")],[l("select","option-font-weight"),A("option-font","weight")],[l("select","option-font-color"),P("option-font-color")],[l("select","option-bg-color"),P("option-bg-color")]],Y=[[l("toggle","toggle-type"),function(e,t){const r="ToggleType.",o="toggle-type",i=(0,n.getMediaProperty)(e,o,(0,a.curry)(a.getEtsEnumValue)(r));if(!(t.mediaParams instanceof Map)||0===i.size)return;const s=(0,n.getMediaDefaultValue)(e,o,(0,a.curry)(a.getEtsEnumValue)(r)),p=(0,n.getVariableName)(e.id,o);t.setDefaultValue(p,(0,n.getType)(o),s),t.setMediaProperty(p,i),t.mediaParams.set("type",p)}],[l("toggle","isOn"),(0,t.rawDataMediaParamParser)("isOn")],[l("toggle","selectedColor"),P("selectedColor")],[l("toggle","switchPointColor"),P("switchPointColor")]],J=[[l("checkbox","select"),g("select")],[l("checkbox","selectedColor"),P("selectedColor")],[l("checkbox","name"),(0,t.stringMediaParamParser)("name")],[l("checkbox","group"),(0,t.stringMediaParamParser)("group")]],Q=[[l("checkboxGroup","selectAll"),g("selectAll")],[l("checkboxGroup","selectedColor"),P("selectedColor")],[l("checkboxGroup","group"),(0,t.stringMediaParamParser)("group")]],X=[[l("scroll","scrollable"),h("scrollable","ScrollDirection.")],[l("scroll","scroll-bar"),h("scroll-bar","BarState.")],[l("scroll","scroll-bar-color"),P("scroll-bar-color")],[l("scroll","scroll-bar-width"),f("scroll-bar-width")],[l("scroll","edge-effect-scroll"),function(e,t){const r="edge-effect-scroll",o=(0,n.getMediaProperty)(e,r,a.dealWithScrollEdgeEffect);if(0===o.size)return;const i=(0,n.getMediaDefaultValue)(e,r,a.dealWithScrollEdgeEffect),s=(0,n.getVariableName)(e.id,r);t.setDefaultValue(s,(0,n.getType)(r),i),t.setMediaProperty(s,o),t.mediaProperties.set("edgeEffect",s)}]],K=[[l("grid","columns-template"),f("columns-template")],[l("grid","rows-template"),f("rows-template")],[l("grid","columns-gap"),f("columns-gap")],[l("grid","rows-gap"),f("rows-gap")],[l("grid","scroll-bar"),h("scroll-bar","BarState.")],[l("grid","scroll-bar-color"),P("scroll-bar-color")],[l("grid","scroll-bar-width"),f("scroll-bar-width")],[l("grid","cached-count"),m("cached-count")],[l("grid","edit-mode"),g("edit-mode")],[l("grid","layout-direction"),h("layout-direction","GridDirection.")],[l("grid","max-count"),m("max-count")],[l("grid","min-count"),m("min-count")],[l("grid","cell-length"),m("cell-length")],[l("grid","multi-selectable"),g("multi-selectable")],[l("grid","support-animation"),g("support-animation")]],Z=[[l("grid-item","row-start"),m("row-start")],[l("grid-item","row-end"),m("row-end")],[l("grid-item","column-start"),m("column-start")],[l("grid-item","column-end"),m("column-end")],[l("grid-item","force-rebuild"),g("force-rebuild")],[l("grid-item","selectable"),g("selectable")]],ee=[[l("stack","align-content-stack"),function(e,t){const r="align-content-stack",o=(0,n.getMediaProperty)(e,r,(0,a.curry)(a.getEtsEnumValue)("Alignment."));if(!(t.mediaParams instanceof Map)||0===o.size)return;const i=(0,n.getMediaDefaultValue)(e,r,(0,a.curry)(a.getEtsEnumValue)("Alignment.")),s=(0,n.getVariableName)(e.id,r);t.setDefaultValue(s,(0,n.getType)(r),i),t.setMediaProperty(s,o),t.mediaParams.set("alignContent",s)}]],te=[[l("navigation","navigation-title"),S("navigation-title","title")],[l("navigation","subTitle"),f("subTitle")],[l("navigation","menus"),v("menus")],[l("navigation","titleMode"),h("titleMode","NavigationTitleMode.")],[l("navigation","toolBar"),v("toolBar")],[l("navigation","hideToolBar"),g("hideToolBar")],[l("navigation","hideTitleBar"),g("hideTitleBar")],[l("navigation","hideBackButton"),g("hideBackButton")]],re=[[function(e){return"search"===e.type},function(e,t){const r=[];w("value",r,e,t),w("placeholder",r,e,t),w("icon",r,e,t),0!==r.length&&t.setParams(`{${r.join(", ")}}`)}],[l("search","text-font-size"),A("text-font","size")],[l("search","text-font-style"),A("text-font","style")],[l("search","text-font-weight"),A("text-font","weight")],[l("search","text-font-family"),A("text-font","family")],[l("search","placeholder-font-size"),A("placeholder-font","size")],[l("search","placeholder-font-style"),A("placeholder-font","style")],[l("search","placeholder-font-weight"),A("placeholder-font","weight")],[l("search","placeholder-font-family"),A("placeholder-font","family")],[l("search","placeholderColor"),P("placeholderColor")],[l("search","text-align"),h("text-align","TextAlign.")],[l("search","search-button"),f("search-button")],[l("search","copy-option"),h("copy-option","CopyOptions.")]],ne=[[l("tabs","bar-position"),T("bar-position","BarPosition.")],[l("tabs","index"),(0,t.rawDataMediaParamParser)("index")],[l("tabs","controller"),(0,t.rawDataMediaParamParser)("controller")],[l("tabs","vertical"),g("vertical")],[l("tabs","scrollable"),g("scrollable")],[l("tabs","bar-mode"),h("bar-mode","BarMode.")],[l("tabs","bar-width"),f("bar-width")],[l("tabs","bar-height"),f("bar-height")],[l("tabs","animation-duration"),m("animation-duration")]],oe=[[function(e){return"tab-content"===e.type&&(e.hasMediaProperty("tabBar-icon")||e.hasMediaProperty("tabBar-text"))},function(e,t){const r=(0,n.getMediaProperty)(e,"tabBar-text",a.quoteString),o=(0,n.getMediaProperty)(e,"tabBar-icon",i.dealWithSrc),s=(0,n.getMediaDefaultValue)(e,"tabBar-text",a.quoteString),p=(0,n.getMediaDefaultValue)(e,"tabBar-icon",i.dealWithSrc),l=(0,n.getVariableName)(e.id,"tabBar-text"),c=(0,n.getVariableName)(e.id,"tabBar-icon"),u=new Map([["text",s],["icon",p]]);r.size>0&&(t.setDefaultValue(l,(0,n.getType)("tabBar-text"),s),t.setMediaProperty(l,r),u.set("text",l)),o.size>0&&(t.setDefaultValue(c,(0,n.getType)("tabBar-icon"),p),t.setMediaProperty(c,o),u.set("icon",c)),t.mediaProperties.set("tabBar",u)}]];t.componentsMediaParserArray=[...O,...R,...x,...I,...F,...k,...L,...D,...U,...V,...B,...z,...G,...Y,...j,...W,...q,...H,...$,...ee,...X,...K,...Z,...te,...re,...ne,...oe,...J,...Q]},366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCustomMediaVisualModel=void 0;const n=r(6125),o=r(3135),a=r(6282),i=r(1195),s=r(8122);t.parseCustomMediaVisualModel=function(e,t){(0,i.getCustomAttributeMap)().forEach(((r,o)=>{if(function(e,t){return e.hasMediaProperty(t)}(e,o)){const l=p.get(r.type);"function"==typeof l&&l(o,e,t);const c=n.enumParserMap.get(r.type);"function"==typeof c&&function(e,t,r,n){const o=(0,a.getMediaProperty)(t,e,n);if(!(r.mediaParams instanceof Map)||0===o.size)return;const p=(0,a.getMediaDefaultValue)(t,e,n),l=(0,a.getVariableName)(t.id,e);r.setDefaultValue(l,(0,a.getType)(e),p),r.setMediaProperty(l,o),r.mediaParams.set((0,s.getEtsPropName)(e),(0,i.getDynamicValueByDecorator)(e,l))}(o,e,t,c)}}))};const p=new Map([["string",o.stringMediaParamParser],["boolean",o.rawDataMediaParamParser],["number",o.rawDataMediaParamParser],["any[]",o.rawDataMediaParamParser],["object",o.rawDataMediaParamParser],["Date",function(e,t,r){(0,o.dateMediaParamParser)(e,(0,s.getEtsPropName)(e),"private",t,r)}]])},3729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMediaProperty=t.parseMediaVisualModel=void 0;const n=r(1912),o=r(9223),a=r(3135);function i(e,t,r){const n=t.get(r);return void 0!==n&&n.has(e)}t.parseMediaVisualModel=function(e,t){(0,o.forEachParser)(e,t),(0,o.ifParser)(e,t);for(const r of p)("boolean"==typeof r[0]||r[0](e))&&r[1](e,t)},t.isMediaProperty=function(e,t){return!i(e,s,"common")&&!i(e,s,t)&&!i(e,s,"events")};const s=new Map([["common",new Set(["keyGenerator","item","idx"])],["events",new Set([...n.events])]]),p=[...o.commonMediaParserArray,...a.componentsMediaParserArray]},6282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMediaDefaultValue=t.getVariableName=t.getMediaProperty=t.getType=void 0;const n=r(4294),o=r(1290),a=r(1195),i=r(8122);function s(e,t){for(const r of t)if(r.property===e)return r.etsType;return""}t.getType=function(e){const t=e+"-visual",r=o.etsPropertyList;let n="";for(const e of r)if(void 0!==e.propertySet.properties&&(n=s(t,e.propertySet.properties)),e.propertySet.property===t&&(n=e.propertySet.etsType),""!==n)break;return""!==n?function(e=""){const t=new Map([["Rfloat","Resource"],["Rstring","Resource"],["Rcolor","Resource"],["Rmedia","Resource"],["Rrawfile","Resource"],["Rplural","Resource"],["ETSArray","any[]"]]),r=new Array;return e.split("|").forEach((e=>{const n=t.get(e),o=null!=n?n:e;r.includes(o)||r.push(null!=n?n:e)})),r.join(" | ")}(n):(0,a.getCustomAttrType)(e)},t.getMediaProperty=function(e,t,r){var n,o;const a=new Map;return(null!==(n=e.mediaProperty)&&void 0!==n?n:new Map).forEach(((e,n)=>{let o=e.get(t);(0,i.isEmptyOrUndefined)(o)||("function"==typeof r&&(o=r(o)),(0,i.isEmptyOrUndefined)(o)||a.set(n,o))})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{let n=e.get(t);void 0===n||"content"!==t&&"label"!==t||(n=(0,i.getContentName)(n)),(0,i.isEmptyOrUndefined)(n)||a.set(r,n)})),a},t.getVariableName=function(e,t){const r=(0,n.getTagName)(e),o=`this.${(0,i.getEtsPropName)(r)}${(0,i.firstUpperCase)((0,i.getEtsPropName)(t))}`;return`${o}_${(0,n.getUniqueId)(o)}`},t.getMediaDefaultValue=function(e,t,r){var n;const o=e.property.get(t),a=e.dynamicProperty.get(t);let s=null!==(n=new Map([["if","true"],["auto-play","false"],["interval","3000"],["select-value","''"],["columns-template","''"],["rows-template","''"],["tabBar-icon","''"],["tabBar-text","'TabBar'"]]).get(t))&&void 0!==n?n:"undefined";return(0,i.isEmptyOrUndefined)(o)||(s="function"==typeof r?r(o):o,s=(0,i.isEmptyOrUndefined)(s)?"undefined":s),(0,i.isEmptyOrUndefined)(a)||(s=a),s}},8916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buttonParserArray=void 0;const n=r(8122);t.buttonParserArray=[[(0,n.hasFeatureProperty)("button","label"),n.labelParamParser],[(0,n.hasFeatureProperty)("button","type"),(0,n.enumPropertyParser)("type","ButtonType.")],[(0,n.hasFeatureProperty)("button","state-effect"),(0,n.booleanPropertyParser)("state-effect")],[(0,n.hasFeatureProperty)("button","font-size"),(0,n.stringPropertyParser)("font-size")],[(0,n.hasFeatureProperty)("button","font-style"),(0,n.enumPropertyParser)("font-style","FontStyle.")],[(0,n.hasFeatureProperty)("button","font-weight"),n.fontWeightPropertyParser],[(0,n.hasFeatureProperty)("button","font-family"),(0,n.stringPropertyParser)("font-family")]]},1147:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxGroupParseArray=void 0;const n=r(8122);t.checkboxGroupParseArray=[[(0,n.hasFeatureProperty)("checkboxGroup","selectAll"),(0,n.booleanPropertyParser)("selectAll")],[(0,n.hasFeatureProperty)("checkboxGroup","selectedColor"),(0,n.colorPropertyParser)("selectedColor")],[(0,n.hasFeatureProperty)("checkboxGroup","group"),(0,n.stringParamParser)("group")]]},2218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxParseArray=void 0;const n=r(8122);t.checkboxParseArray=[[(0,n.hasFeatureProperty)("checkbox","select"),(0,n.booleanPropertyParser)("select")],[(0,n.hasFeatureProperty)("checkbox","selectedColor"),(0,n.colorPropertyParser)("selectedColor")],[(0,n.hasFeatureProperty)("checkbox","name"),(0,n.stringParamParser)("name")],[(0,n.hasFeatureProperty)("checkbox","group"),(0,n.stringParamParser)("group")]]},7150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonParserArray=void 0;const n=r(8122),o=r(9248);function a(e,t,r,o=!1){(0,n.isEmptyOrUndefined)(t)||r.set(e,o?t:(0,n.quoteString)(t))}function i(e,t,r,o,a){const i=e.getProperty(t),s=e.getProperty(r),p=e.dynamicProperty.has(t),l=e.dynamicProperty.has(r),c=(0,n.getEdgeBorderDirection)(r);(0,n.isEmptyOrUndefined)(s)?(0,n.isEmptyOrUndefined)(i)||o.set(c,p?i:a(i)):o.set(c,l?s:a(s))}t.commonParserArray=[[(0,n.hasCommonProperty)("width"),(0,n.stringPropertyParser)("width")],[(0,n.hasCommonProperty)("height"),(0,n.stringPropertyParser)("height")],[function(e){return e.hasProperty("constraint-size-min-width")||e.hasProperty("constraint-size-max-width")||e.hasProperty("constraint-size-min-height")||e.hasProperty("constraint-size-max-height")},function(e,t){const r=new Map,n=e.getProperty("constraint-size-min-width"),o=e.getProperty("constraint-size-max-width"),i=e.getProperty("constraint-size-min-height"),s=e.getProperty("constraint-size-max-height");a("minWidth",n,r,e.dynamicProperty.has("constraint-size-min-width")),a("maxWidth",o,r,e.dynamicProperty.has("constraint-size-max-width")),a("minHeight",i,r,e.dynamicProperty.has("constraint-size-min-height")),a("maxHeight",s,r,e.dynamicProperty.has("constraint-size-max-height")),r.size>0&&t.properties.set("constraintSize",r)}],[(0,n.hasCommonProperty)("align"),(0,n.enumPropertyParser)("align","Alignment.")],[(0,n.hasCommonProperty)("direction"),(0,n.enumPropertyParser)("direction","Direction.")],[function(e){return e.hasProperty("left")||e.hasProperty("top")},function(e,t){const r="absolute"===e.property.get("position")?"position":"offset",o=e.property.get("left"),a=e.property.get("top"),i=e.dynamicProperty.get("left"),s=e.dynamicProperty.get("top");if((0,n.isEmptyOrUndefined)(i)&&(0,n.isEmptyOrUndefined)(s)&&(0,n.isEmptyOrUndefined)(o)&&(0,n.isEmptyOrUndefined)(a))return;const p=new Map([["x",`${(0,n.quoteString)(null!=o?o:"0")}`],["y",`${(0,n.quoteString)(null!=a?a:"0")}`]]);(0,n.isEmptyOrUndefined)(i)||p.set("x",i),(0,n.isEmptyOrUndefined)(s)||p.set("y",s),t.properties.set(r,p)}],[(0,n.hasCommonProperty)("aspect-ratio"),(0,n.numberPropertyParser)("aspect-ratio")],[(0,n.hasCommonProperty)("display-priority"),(0,n.numberPropertyParser)("display-priority")],[(0,n.hasCommonProperty)("flex-basis"),(0,n.stringPropertyParser)("flex-basis")],[(0,n.hasCommonProperty)("flex-grow"),(0,n.numberPropertyParser)("flex-grow")],[(0,n.hasCommonProperty)("flex-shrink"),(0,n.numberPropertyParser)("flex-shrink")],[(0,n.hasCommonProperty)("align-self"),function(e,t){const r=e.dynamicProperty.get("align-self");if(!(0,n.isEmptyOrUndefined)(r))return void t.properties.set("alignSelf",r);const o=e.property.get("align-self");if((0,n.isEmptyOrUndefined)(o))return;const a=(0,n.dealWithAlignSelf)(o);t.properties.set("alignSelf",a)}],[function(e){return e.hasProperty("border-style")||e.hasProperty("border-top-style")||e.hasProperty("border-right-style")||e.hasProperty("border-bottom-style")||e.hasProperty("border-left-style")},function(e,t){const r=new Map,o=e.getProperty("border-style"),a=e.getProperty("border-top-style"),s=e.getProperty("border-bottom-style"),p=e.getProperty("border-left-style"),l=e.getProperty("border-right-style"),c=e.dynamicProperty.has("border-style"),u=(0,n.getBorderDirections)("border-style");for(const t of u)i(e,"border-style",t,r,(0,n.curry)(n.getEtsEnumValue)("BorderStyle."));(0,n.isEmptyOrUndefined)(a)&&(0,n.isEmptyOrUndefined)(s)&&(0,n.isEmptyOrUndefined)(p)&&(0,n.isEmptyOrUndefined)(l)?(0,n.isEmptyOrUndefined)(o)||t.properties.set((0,n.getEtsPropName)("border-style"),c?o:(0,n.getEtsEnumValue)("BorderStyle.",o)):r.size>0&&t.properties.set((0,n.getEtsPropName)("border-style"),r)}],[function(e){return e.hasProperty("border-width")||e.hasProperty("border-top-width")||e.hasProperty("border-right-width")||e.hasProperty("border-bottom-width")||e.hasProperty("border-left-width")},function(e,t){const r=new Map,o=e.getProperty("border-width"),i=e.getProperty("border-top-width"),s=e.getProperty("border-bottom-width"),p=e.getProperty("border-left-width"),l=e.getProperty("border-right-width"),c=e.property.has("border-top-width"),u=e.property.has("border-bottom-width"),y=e.property.has("border-left-width"),d=e.property.has("border-right-width"),f=e.dynamicProperty.has("border-width"),m=e.dynamicProperty.has("border-top-width"),g=e.dynamicProperty.has("border-bottom-width"),h=e.dynamicProperty.has("border-left-width"),E=e.dynamicProperty.has("border-right-width");(0,n.isEmptyOrUndefined)(i)&&(0,n.isEmptyOrUndefined)(s)&&(0,n.isEmptyOrUndefined)(p)&&(0,n.isEmptyOrUndefined)(l)?(0,n.isEmptyOrUndefined)(o)||t.properties.set((0,n.getEtsPropName)("border-width"),f?o:(0,n.quoteString)(o)):(a("top",null!=i?i:o,r,m||!c&&f),a("bottom",null!=s?s:o,r,g||!u&&f),a("left",null!=p?p:o,r,h||!y&&f),a("right",null!=l?l:o,r,E||!d&&f),r.size>0&&t.properties.set((0,n.getEtsPropName)("border-width"),r))}],[function(e){return e.hasProperty("border-color")||e.hasProperty("border-top-color")||e.hasProperty("border-right-color")||e.hasProperty("border-bottom-color")||e.hasProperty("border-left-color")},function(e,t){const r=new Map,o=e.getProperty("border-color"),a=e.getProperty("border-top-color"),s=e.getProperty("border-bottom-color"),p=e.getProperty("border-left-color"),l=e.getProperty("border-right-color"),c=e.dynamicProperty.has("border-color"),u=(0,n.getBorderDirections)("border-color");for(const t of u)i(e,"border-color",t,r,n.dealWithColor);(0,n.isEmptyOrUndefined)(a)&&(0,n.isEmptyOrUndefined)(s)&&(0,n.isEmptyOrUndefined)(p)&&(0,n.isEmptyOrUndefined)(l)?(0,n.isEmptyOrUndefined)(o)||t.properties.set((0,n.getEtsPropName)("border-color"),c?o:(0,n.dealWithColor)(o)):r.size>0&&t.properties.set((0,n.getEtsPropName)("border-color"),r)}],[function(e){return e.hasProperty("border-radius")||e.hasProperty("border-top-left-radius")||e.hasProperty("border-top-right-radius")||e.hasProperty("border-bottom-right-radius")||e.hasProperty("border-bottom-left-radius")},function(e,t){const r=new Map,o=e.getProperty("border-radius"),a=e.getProperty("border-top-left-radius"),s=e.getProperty("border-top-right-radius"),p=e.getProperty("border-bottom-left-radius"),l=e.getProperty("border-bottom-right-radius"),c=e.dynamicProperty.has("border-radius"),u=(0,n.getBorderDirections)("border-radius");for(const t of u)i(e,"border-radius",t,r,n.quoteString);(0,n.isEmptyOrUndefined)(a)&&(0,n.isEmptyOrUndefined)(s)&&(0,n.isEmptyOrUndefined)(p)&&(0,n.isEmptyOrUndefined)(l)?(0,n.isEmptyOrUndefined)(o)||t.properties.set((0,n.getEtsPropName)("border-radius"),c?o:(0,n.quoteString)(o)):r.size>0&&t.properties.set((0,n.getEtsPropName)("border-radius"),r)}],[(0,n.hasCommonProperty)("background-color"),(0,n.colorPropertyParser)("background-color")],[function(e){return e.hasProperty("background-image-src")||e.hasProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),a=e.property.get("background-image-repeat"),i=e.dynamicProperty.get("background-image-src"),s=e.dynamicProperty.get("background-image-repeat");if((0,n.isEmptyOrUndefined)(r)&&(0,n.isEmptyOrUndefined)(a)&&(0,n.isEmptyOrUndefined)(i)&&(0,n.isEmptyOrUndefined)(s))return;let p=(0,o.dealWithSrc)(null!=r?r:"");if((0,n.isEmptyOrUndefined)(i)||(p=i),(0,n.isEmptyOrUndefined)(s)){if(!(0,n.isEmptyOrUndefined)(a)){const e=(0,n.dealWithBackgroundRepeat)(a);null!=e&&""!==e&&(p=p+", "+e)}}else p=p+", "+s;t.properties.set("backgroundImage",p)}],[(0,n.hasCommonProperty)("background-image-size"),function(e,t){const r=e.dynamicProperty.get("background-image-size");if(!(0,n.isEmptyOrUndefined)(r))return void t.properties.set("backgroundImageSize",r);const o=e.property.get("background-image-size");if((0,n.isEmptyOrUndefined)(o))return;if(""!==(0,n.getBackgroundImageSizeEnumValue)(o))return void t.properties.set("backgroundImageSize",(0,n.getEtsEnumValue)("ImageSize.",o));const a=o.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);null!==a&&(void 0!==a[5]?t.properties.set("backgroundImageSize",new Map([["width",`${(0,n.quoteString)(a[1])}`],["height",`${(0,n.quoteString)(a[5])}`]])):t.properties.set("backgroundImageSize",new Map([["width",`${(0,n.quoteString)(a[1])}`]])))}],[(0,n.hasCommonProperty)("background-image-position"),function(e,t){const r=e.dynamicProperty.get("background-image-position");if(!(0,n.isEmptyOrUndefined)(r))return void t.properties.set("backgroundImagePosition",r);const o=e.property.get("background-image-position");if((0,n.isEmptyOrUndefined)(o))return;const a=(0,n.getBackgroundImagePositionEnumValue)(o);if(""!==a)return void t.properties.set("backgroundImagePosition",a);const i=o.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);null!==i&&t.properties.set("backgroundImagePosition",new Map([["x",`${(0,n.quoteString)(i[1])}`],["y",`${(0,n.quoteString)(i[4])}`]]))}],[(0,n.hasCommonProperty)("opacity"),(0,n.numberPropertyParser)("opacity")],[(0,n.hasCommonProperty)("visibility"),(0,n.enumPropertyParser)("visibility","Visibility.")],[(0,n.hasCommonProperty)("enabled"),(0,n.booleanPropertyParser)("enabled")],[(0,n.hasCommonProperty)("font-color"),(0,n.colorPropertyParser)("font-color")],[function(e){return e.hasProperty("margin")||e.hasProperty("margin-left")||e.hasProperty("margin-top")||e.hasProperty("margin-right")||e.hasProperty("margin-bottom")},function(e,t){var r,n,o,i;const s=new Map,p=e.getProperty("margin"),l=null!==(r=e.getProperty("margin-top"))&&void 0!==r?r:p,c=null!==(n=e.getProperty("margin-bottom"))&&void 0!==n?n:p,u=null!==(o=e.getProperty("margin-left"))&&void 0!==o?o:p,y=null!==(i=e.getProperty("margin-right"))&&void 0!==i?i:p,d=e.property.has("margin-top"),f=e.property.has("margin-bottom"),m=e.property.has("margin-left"),g=e.property.has("margin-right"),h=e.dynamicProperty.has("margin"),E=e.dynamicProperty.has("margin-top"),T=e.dynamicProperty.has("margin-bottom"),P=e.dynamicProperty.has("margin-left"),v=e.dynamicProperty.has("margin-right");a("top",l,s,E||!d&&h),a("bottom",c,s,T||!f&&h),a("left",u,s,P||!m&&h),a("right",y,s,v||!g&&h),s.size>0&&t.properties.set("margin",s)}],[function(e){return e.hasProperty("padding")||e.hasProperty("padding-left")||e.hasProperty("padding-top")||e.hasProperty("padding-right")||e.hasProperty("padding-bottom")},function(e,t){var r,n,o,i;const s=new Map,p=e.getProperty("padding"),l=null!==(r=e.getProperty("padding-top"))&&void 0!==r?r:p,c=null!==(n=e.getProperty("padding-bottom"))&&void 0!==n?n:p,u=null!==(o=e.getProperty("padding-left"))&&void 0!==o?o:p,y=null!==(i=e.getProperty("padding-right"))&&void 0!==i?i:p,d=e.property.has("padding-top"),f=e.property.has("padding-bottom"),m=e.property.has("padding-left"),g=e.property.has("padding-right"),h=e.dynamicProperty.has("padding"),E=e.dynamicProperty.has("padding-top"),T=e.dynamicProperty.has("padding-bottom"),P=e.dynamicProperty.has("padding-left"),v=e.dynamicProperty.has("padding-right");a("top",l,s,E||!d&&h),a("bottom",c,s,T||!f&&h),a("left",u,s,P||!m&&h),a("right",y,s,v||!g&&h),s.size>0&&t.properties.set("padding",s)}]]},1778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dividerParserArray=void 0;const n=r(8122);t.dividerParserArray=[[(0,n.hasFeatureProperty)("divider","vertical"),(0,n.booleanPropertyParser)("vertical")],[(0,n.hasFeatureProperty)("divider","color"),(0,n.colorPropertyParser)("color")],[(0,n.hasFeatureProperty)("divider","stroke-width"),(0,n.stringPropertyParser)("stroke-width")],[(0,n.hasFeatureProperty)("divider","line-cap"),(0,n.enumPropertyParser)("line-cap","LineCapStyle.")]]},5264:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithFlexAlignItems=t.flexParserArray=void 0;const n=r(8122),o=(0,n.curry)(((e,t,r,o)=>{if(!(o.params instanceof Map))return;const a=r.dynamicProperty.get(e);if(!(0,n.isEmptyOrUndefined)(a))return void o.params.set((0,n.getEtsPropName)(e),a);const i=r.property.get(e);if((0,n.isEmptyOrUndefined)(i))return;let s=(0,n.getEtsEnumValue)(t,i);"flex-start"===i?s=t+"Start":"flex-end"===i&&(s=t+"End"),o.params.set((0,n.getEtsPropName)(e),s)}));function a(e){let t=(0,n.getEtsEnumValue)("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}t.flexParserArray=[[(0,n.hasFeatureProperty)("flex","flex-direction"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("flex-direction");if(!(0,n.isEmptyOrUndefined)(r))return void t.params.set("direction",r);const o=e.property.get("flex-direction");(0,n.isEmptyOrUndefined)(o)||t.params.set("direction",(0,n.getEtsEnumValue)("FlexDirection.",o))}],[(0,n.hasFeatureProperty)("flex","wrap"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("wrap");if(!(0,n.isEmptyOrUndefined)(r))return void t.params.set("wrap",r);const o=e.property.get("wrap");if((0,n.isEmptyOrUndefined)(o))return;const a=(0,n.dealWithWrap)(o);t.params.set("wrap",a)}],[(0,n.hasFeatureProperty)("flex","justify-content"),o("justify-content","FlexAlign.")],[(0,n.hasFeatureProperty)("flex","align-items-flex"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-items-flex");if(!(0,n.isEmptyOrUndefined)(r))return void t.params.set("alignItems",r);const o=e.property.get("align-items-flex");if((0,n.isEmptyOrUndefined)(o))return;const i=a(o);t.params.set("alignItems",i)}],[(0,n.hasFeatureProperty)("flex","align-content"),o("align-content","FlexAlign.")]],t.dealWithFlexAlignItems=a},2153:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridItemParserArray=t.gridParserArray=void 0;const n=r(8122);t.gridParserArray=[[(0,n.hasFeatureProperty)("grid","scroller"),n.scrollerParamParser],[(0,n.hasFeatureProperty)("grid","columns-template"),(0,n.stringPropertyParser)("columns-template")],[(0,n.hasFeatureProperty)("grid","rows-template"),(0,n.stringPropertyParser)("rows-template")],[(0,n.hasFeatureProperty)("grid","columns-gap"),(0,n.stringPropertyParser)("columns-gap")],[(0,n.hasFeatureProperty)("grid","rows-gap"),(0,n.stringPropertyParser)("rows-gap")],[(0,n.hasFeatureProperty)("grid","scroll-bar"),(0,n.enumPropertyParser)("scroll-bar","BarState.")],[(0,n.hasFeatureProperty)("grid","scroll-bar-color"),(0,n.colorPropertyParser)("scroll-bar-color")],[(0,n.hasFeatureProperty)("grid","scroll-bar-width"),(0,n.stringPropertyParser)("scroll-bar-width")],[(0,n.hasFeatureProperty)("grid","cached-count"),(0,n.numberPropertyParser)("cached-count")],[(0,n.hasFeatureProperty)("grid","edit-mode"),(0,n.booleanPropertyParser)("edit-mode")],[(0,n.hasFeatureProperty)("grid","layout-direction"),(0,n.enumPropertyParser)("layout-direction","GridDirection.")],[(0,n.hasFeatureProperty)("grid","max-count"),(0,n.numberPropertyParser)("max-count")],[(0,n.hasFeatureProperty)("grid","min-count"),(0,n.numberPropertyParser)("min-count")],[(0,n.hasFeatureProperty)("grid","cell-length"),(0,n.numberPropertyParser)("cell-length")],[(0,n.hasFeatureProperty)("grid","multi-selectable"),(0,n.booleanPropertyParser)("multi-selectable")],[(0,n.hasFeatureProperty)("grid","support-animation"),(0,n.booleanPropertyParser)("support-animation")]],t.gridItemParserArray=[[(0,n.hasFeatureProperty)("grid-item","row-start"),(0,n.numberPropertyParser)("row-start")],[(0,n.hasFeatureProperty)("grid-item","row-end"),(0,n.numberPropertyParser)("row-end")],[(0,n.hasFeatureProperty)("grid-item","column-start"),(0,n.numberPropertyParser)("column-start")],[(0,n.hasFeatureProperty)("grid-item","column-end"),(0,n.numberPropertyParser)("column-end")],[(0,n.hasFeatureProperty)("grid-item","force-rebuild"),(0,n.booleanPropertyParser)("force-rebuild")],[(0,n.hasFeatureProperty)("grid-item","selectable"),(0,n.booleanPropertyParser)("selectable")]]},9248:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithSrc=t.imageParserArray=t.isTargetComponent=void 0;const n=r(8122);function o(e){return null===e.match(/\$(r|rawfile)\('(.*)'\)$/)?(0,n.quoteString)(e):e}t.isTargetComponent=(0,n.curry)(((e,t)=>t.type===e)),t.imageParserArray=[[(0,t.isTargetComponent)("image"),function(e,t){var r;const a=e.dynamicProperty.get("src");if(!(0,n.isEmptyOrUndefined)(a))return void t.setParams(a);const i=null!==(r=e.property.get("src"))&&void 0!==r?r:"";t.setParams(o(i))}],[(0,n.hasFeatureProperty)("image","alt"),(0,n.stringPropertyParser)("alt")],[(0,n.hasFeatureProperty)("image","object-fit"),(0,n.enumPropertyParser)("object-fit","ImageFit.")],[(0,n.hasFeatureProperty)("image","object-repeat"),(0,n.enumPropertyParser)("object-repeat","ImageRepeat.")],[(0,n.hasFeatureProperty)("image","interpolation"),(0,n.enumPropertyParser)("interpolation","ImageInterpolation.")],[(0,n.hasFeatureProperty)("image","render-mode"),(0,n.enumPropertyParser)("render-mode","ImageRenderMode.")],[function(e){return e.hasProperty("source-size-width")||e.hasProperty("source-size-height")},function(e,t){let r=e.getProperty("source-size-width"),o=e.getProperty("source-size-height");if((0,n.isEmptyOrUndefined)(r)&&(0,n.isEmptyOrUndefined)(o))return;const a=e.dynamicProperty.has("source-size-width"),i=e.dynamicProperty.has("source-size-height");r="0"===r||(0,n.isEmptyOrUndefined)(r)?"0":a?r:r.substring(0,r.length-2),o="0"===o||(0,n.isEmptyOrUndefined)(o)?"0":i?o:o.substring(0,o.length-2);const s=new Map([["width",r],["height",o]]);t.properties.set("sourceSize",s)}]],t.dealWithSrc=o},7907:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemParserArray=t.listParserArray=void 0;const n=r(8122);t.listParserArray=[[(0,n.hasFeatureProperty)("list","space"),(0,n.stringParamParser)("space")],[(0,n.hasFeatureProperty)("list","initial-index"),(0,n.rawDataParamParser)("initial-index")],[(0,n.hasFeatureProperty)("list","list-direction"),(0,n.enumPropertyParser)("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasProperty("divider-stroke-width")||e.hasProperty("divider-color")||e.hasProperty("divider-start-margin")||e.hasProperty("divider-end-margin"))},function(e,t){const r=e.property.get("divider-stroke-width"),o=e.dynamicProperty.get("divider-stroke-width"),a=new Map([["strokeWidth",`${(0,n.quoteString)(null!=r?r:"0")}`]]);(0,n.isEmptyOrUndefined)(o)||a.set("strokeWidth",o);const i=e.property.get("divider-color"),s=e.dynamicProperty.get("divider-color"),p=e.property.get("divider-start-margin"),l=e.dynamicProperty.get("divider-start-margin"),c=e.property.get("divider-end-margin"),u=e.dynamicProperty.get("divider-end-margin");(0,n.isEmptyOrUndefined)(s)?(0,n.isEmptyOrUndefined)(i)||a.set("color",(0,n.dealWithColor)(i)):a.set("color",s),(0,n.isEmptyOrUndefined)(l)?(0,n.isEmptyOrUndefined)(p)||a.set("startMargin",(0,n.quoteString)(p)):a.set("startMargin",l),(0,n.isEmptyOrUndefined)(u)?(0,n.isEmptyOrUndefined)(c)||a.set("endMargin",(0,n.quoteString)(c)):a.set("endMargin",u),t.properties.set("divider",a)}],[(0,n.hasFeatureProperty)("list","edit-mode"),(0,n.booleanPropertyParser)("edit-mode")],[(0,n.hasFeatureProperty)("list","edge-effect"),(0,n.enumPropertyParser)("edge-effect","EdgeEffect.")],[(0,n.hasFeatureProperty)("list","chain-animation"),(0,n.booleanPropertyParser)("chain-animation")]],t.listItemParserArray=[[(0,n.hasFeatureProperty)("list-item","sticky"),(0,n.enumPropertyParser)("sticky","Sticky.")],[(0,n.hasFeatureProperty)("list-item","editable"),(0,n.booleanPropertyParser)("editable")]]},8191:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.navigationParserArray=void 0;const n=r(8122);t.navigationParserArray=[[(0,n.hasFeatureProperty)("navigation","navigation-title"),function(e,t){const r=e.getProperty("navigation-title"),o=e.dynamicProperty.get("navigation-title");(0,n.isEmptyOrUndefined)(o)?(0,n.isEmptyOrUndefined)(r)||t.properties.set("title",(0,n.quoteString)(r)):t.properties.set("title",o)}],[(0,n.hasFeatureProperty)("navigation","subTitle"),(0,n.stringPropertyParser)("subTitle")],[(0,n.hasFeatureProperty)("navigation","menus"),(0,n.objectPropertyParser)("menus")],[(0,n.hasFeatureProperty)("navigation","titleMode"),(0,n.enumPropertyParser)("titleMode","NavigationTitleMode.")],[(0,n.hasFeatureProperty)("navigation","toolBar"),(0,n.objectPropertyParser)("toolBar")],[(0,n.hasFeatureProperty)("navigation","hideToolBar"),(0,n.booleanPropertyParser)("hideToolBar")],[(0,n.hasFeatureProperty)("navigation","hideTitleBar"),(0,n.booleanPropertyParser)("hideTitleBar")],[(0,n.hasFeatureProperty)("navigation","hideBackButton"),(0,n.booleanPropertyParser)("hideBackButton")]]},2565:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textPickerParserArray=t.datePickerParserArray=t.timePickerParserArray=void 0;const n=r(8122);t.timePickerParserArray=[[(0,n.hasFeatureProperty)("timePicker","datetime-selected"),(0,n.dateParamParser)("datetime-selected","selected")],[(0,n.hasFeatureProperty)("timePicker","useMilitaryTime"),(0,n.booleanPropertyParser)("useMilitaryTime")]],t.datePickerParserArray=[[(0,n.hasFeatureProperty)("datePicker","datetime-selected"),(0,n.dateParamParser)("datetime-selected","selected")],[(0,n.hasFeatureProperty)("datePicker","start"),(0,n.dateParamParser)("start","start")],[(0,n.hasFeatureProperty)("datePicker","end"),(0,n.dateParamParser)("end","end")],[(0,n.hasFeatureProperty)("datePicker","lunar"),(0,n.booleanPropertyParser)("lunar")]],t.textPickerParserArray=[[(0,n.hasFeatureProperty)("textPicker","range"),(0,n.arrayParamParser)("range")],[(0,n.hasFeatureProperty)("textPicker","textPicker-selected"),(0,n.customRawDataParamParser)("textPicker-selected","selected")],[(0,n.hasFeatureProperty)("textPicker","defaultPickerItemHeight"),(0,n.stringPropertyParser)("defaultPickerItemHeight")]]},8483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.progressParserArray=void 0;const n=r(8122);t.progressParserArray=[[function(e){return"progress"===e.type&&(e.hasProperty("value")||e.hasProperty("total")||e.hasProperty("style"))},function(e,t){var r;(0,n.dynamicParamParser)("value",e,t)||t.params instanceof Map&&t.params.set("value",null!==(r=e.getProperty("value"))&&void 0!==r?r:"0")}],[(0,n.hasFeatureProperty)("progress","total"),(0,n.rawDataParamParser)("total")],[(0,n.hasFeatureProperty)("progress","style"),(0,n.enumParamParser)("style","ProgressStyle.")],[(0,n.hasFeatureProperty)("progress","color"),(0,n.colorPropertyParser)("color")]]},4925:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshParserArray=void 0;const n=r(8122);t.refreshParserArray=[[(0,n.hasFeatureProperty)("refresh","friction"),(0,n.rawDataParamParser)("friction")],[(0,n.hasFeatureProperty)("refresh","offset"),(0,n.stringParamParser)("offset")],[(0,n.hasFeatureProperty)("refresh","refreshing"),(0,n.booleanParamParser)("refreshing")]]},1790:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithRowAlignItems=t.dealWithColumnAlignItems=t.rowParserArray=t.columnParserArray=void 0;const n=r(8122),o=(0,n.curry)(((e,t,r,o)=>{if(!(o.properties instanceof Map))return;const a=r.dynamicProperty.get(e);if(!(0,n.isEmptyOrUndefined)(a))return void o.properties.set("justifyContent",a);const i=r.property.get(e);if((0,n.isEmptyOrUndefined)(i))return;let s=(0,n.getEtsEnumValue)(t,i);"flex-start"===i?s=t+"Start":"flex-end"===i&&(s=t+"End"),o.properties.set("justifyContent",s)}));function a(e){let t=(0,n.getEtsEnumValue)("HorizontalAlign.",e);return"flex-start"===e?t="HorizontalAlign.Start":"flex-end"===e&&(t="HorizontalAlign.End"),t}function i(e){let t=(0,n.getEtsEnumValue)("VerticalAlign.",e);return"flex-start"===e?t="VerticalAlign.Top":"flex-end"===e&&(t="VerticalAlign.Bottom"),t}t.columnParserArray=[[(0,n.hasFeatureProperty)("column","space"),(0,n.stringParamParser)("space")],[(0,n.hasFeatureProperty)("column","align-items-column"),function(e,t){const r=e.dynamicProperty.get("align-items-column");if(!(0,n.isEmptyOrUndefined)(r))return void t.properties.set("alignItems",r);const o=e.property.get("align-items-column");if((0,n.isEmptyOrUndefined)(o))return;const i=a(o);t.properties.set("alignItems",i)}],[(0,n.hasFeatureProperty)("column","justify-content-rc"),o("justify-content-rc","FlexAlign.")]],t.rowParserArray=[[(0,n.hasFeatureProperty)("row","space"),(0,n.stringParamParser)("space")],[(0,n.hasFeatureProperty)("row","align-items-row"),function(e,t){const r=e.dynamicProperty.get("align-items-row");if(!(0,n.isEmptyOrUndefined)(r))return void t.properties.set("alignItems",r);const o=e.property.get("align-items-row");if((0,n.isEmptyOrUndefined)(o))return;const a=i(o);t.properties.set("alignItems",a)}],[(0,n.hasFeatureProperty)("row","justify-content-rc"),o("justify-content-rc","FlexAlign.")]],t.dealWithColumnAlignItems=a,t.dealWithRowAlignItems=i},7375:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollParserArray=void 0;const n=r(8122);t.scrollParserArray=[[(0,n.hasFeatureProperty)("scroll","scrollable"),(0,n.enumPropertyParser)("scrollable","ScrollDirection.")],[(0,n.hasFeatureProperty)("scroll","scroll-bar"),(0,n.enumPropertyParser)("scroll-bar","BarState.")],[(0,n.hasFeatureProperty)("scroll","scroll-bar-color"),(0,n.colorPropertyParser)("scroll-bar-color")],[(0,n.hasFeatureProperty)("scroll","scroll-bar-width"),(0,n.stringPropertyParser)("scroll-bar-width")],[(0,n.hasFeatureProperty)("scroll","edge-effect-scroll"),function(e,t){const r="edge-effect-scroll";if((0,n.dynamicPropertyParser)(r,e,t))return;const o=e.property.get(r);(0,n.isEmptyOrUndefined)(o)||t.properties.set("edgeEffect",(0,n.getEtsEnumValue)("EdgeEffect.",o))}],[(0,n.hasFeatureProperty)("scroll","scroller"),n.scrollerParamParser]]},9284:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchParserArray=void 0;const n=r(8122),o=r(8014);function a(e,t,r,o){const a=new Map([["value","search-value"],["placeholder","placeholder"],["icon","icon"]]).get(e);if(void 0===a)return;const i=r.getProperty(a),s=r.dynamicProperty.get(a);(0,n.isEmptyOrUndefined)(s)?(0,n.isEmptyOrUndefined)(i)||t.push(`${e}: ${(0,n.quoteString)(i)}`):t.push(`${e}: ${(0,n.getContentName)(s)}`)}t.searchParserArray=[[(0,n.hasFeatureProperty)("search","text-font-size"),(0,o.selectFontParser)("text-font","size")],[(0,n.hasFeatureProperty)("search","text-font-style"),(0,o.selectFontParser)("text-font","style")],[(0,n.hasFeatureProperty)("search","text-font-weight"),(0,o.selectFontParser)("text-font","weight")],[(0,n.hasFeatureProperty)("search","text-font-family"),(0,o.selectFontParser)("text-font","family")],[(0,n.hasFeatureProperty)("search","placeholder-font-size"),(0,o.selectFontParser)("placeholder-font","size")],[(0,n.hasFeatureProperty)("search","placeholder-font-style"),(0,o.selectFontParser)("placeholder-font","style")],[(0,n.hasFeatureProperty)("search","placeholder-font-weight"),(0,o.selectFontParser)("placeholder-font","weight")],[(0,n.hasFeatureProperty)("search","placeholder-font-family"),(0,o.selectFontParser)("placeholder-font","family")],[(0,n.hasFeatureProperty)("search","placeholderColor"),(0,n.colorPropertyParser)("placeholderColor")],[(0,n.hasFeatureProperty)("search","text-align"),(0,n.enumPropertyParser)("text-align","TextAlign.")],[function(e){return"search"===e.type},function(e,t){const r=[];a("value",r,e),a("placeholder",r,e),a("icon",r,e),t.setParams(`{${r.join(", ")}}`)}],[(0,n.hasFeatureProperty)("search","search-button"),(0,n.stringPropertyParser)("search-button")],[(0,n.hasFeatureProperty)("search","copy-option"),(0,n.enumPropertyParser)("copy-option","CopyOptions.")]]},8014:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectParserArray=t.selectFontParser=void 0;const n=r(8122);t.selectFontParser=(0,n.curry)(((e,t,r,o)=>{let a=o.properties.get((0,n.getEtsPropName)(e));void 0===a&&(a=new Map);const i=`${e}-${t}`,s=r.property.get(i),p=r.dynamicProperty.get(i);"string"!=typeof a&&((0,n.isEmptyOrUndefined)(p)?(0,n.isEmptyOrUndefined)(s)||("size"!==t&&"family"!==t||a.set(t,(0,n.quoteString)(s)),"style"===t&&a.set(t,(0,n.getEtsEnumValue)("FontStyle.",s)),"weight"===t&&a.set(t,(0,n.dealWithFontWeight)(s))):a.set(t,p)),o.properties.set((0,n.getEtsPropName)(e),a)})),t.selectParserArray=[[(0,n.hasSelectOption)("select","select-option"),function(e,t){const r=e.dynamicProperty.get("select-option");t.setParams(null!=r?r:'[{value: ""}]')}],[(0,n.hasFeatureProperty)("select","select-value"),function(e,t){const r=e.getProperty("select-value"),o=e.dynamicProperty.get("select-value");(0,n.isEmptyOrUndefined)(o)?(0,n.isEmptyOrUndefined)(r)||t.properties.set("value",(0,n.quoteString)(r)):t.properties.set("value",(0,n.getContentName)(o))}],[(0,n.hasFeatureProperty)("select","selected"),(0,n.numberPropertyParser)("selected")],[(0,n.hasFeatureProperty)("select","font-size"),(0,t.selectFontParser)("font","size")],[(0,n.hasFeatureProperty)("select","font-style"),(0,t.selectFontParser)("font","style")],[(0,n.hasFeatureProperty)("select","font-weight"),(0,t.selectFontParser)("font","weight")],[(0,n.hasFeatureProperty)("select","font-family"),(0,t.selectFontParser)("font","family")],[(0,n.hasFeatureProperty)("select","selected-option-font-size"),(0,t.selectFontParser)("selected-option-font","size")],[(0,n.hasFeatureProperty)("select","selected-option-font-style"),(0,t.selectFontParser)("selected-option-font","style")],[(0,n.hasFeatureProperty)("select","selected-option-font-weight"),(0,t.selectFontParser)("selected-option-font","weight")],[(0,n.hasFeatureProperty)("select","selected-option-font-family"),(0,t.selectFontParser)("selected-option-font","family")],[(0,n.hasFeatureProperty)("select","selected-option-font-color"),(0,n.colorPropertyParser)("selected-option-font-color")],[(0,n.hasFeatureProperty)("select","selected-option-bg-color"),(0,n.colorPropertyParser)("selected-option-bg-color")],[(0,n.hasFeatureProperty)("select","option-font-size"),(0,t.selectFontParser)("option-font","size")],[(0,n.hasFeatureProperty)("select","option-font-style"),(0,t.selectFontParser)("option-font","style")],[(0,n.hasFeatureProperty)("select","option-font-weight"),(0,t.selectFontParser)("option-font","weight")],[(0,n.hasFeatureProperty)("select","option-font-family"),(0,t.selectFontParser)("option-font","family")],[(0,n.hasFeatureProperty)("select","option-font-color"),(0,n.colorPropertyParser)("option-font-color")],[(0,n.hasFeatureProperty)("select","option-bg-color"),(0,n.colorPropertyParser)("option-bg-color")]]},2563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sliderParserArray=void 0;const n=r(8122);t.sliderParserArray=[[(0,n.hasFeatureProperty)("slider","value"),(0,n.rawDataParamParser)("value")],[(0,n.hasFeatureProperty)("slider","min"),(0,n.rawDataParamParser)("min")],[(0,n.hasFeatureProperty)("slider","max"),(0,n.rawDataParamParser)("max")],[(0,n.hasFeatureProperty)("slider","step"),(0,n.rawDataParamParser)("step")],[(0,n.hasFeatureProperty)("slider","style"),(0,n.enumParamParser)("style","SliderStyle.")],[(0,n.hasFeatureProperty)("slider","block-color"),(0,n.colorPropertyParser)("block-color")],[(0,n.hasFeatureProperty)("slider","track-color"),(0,n.colorPropertyParser)("track-color")],[(0,n.hasFeatureProperty)("slider","selected-color"),(0,n.colorPropertyParser)("selected-color")],[(0,n.hasFeatureProperty)("slider","show-steps"),(0,n.booleanPropertyParser)("show-steps")],[(0,n.hasFeatureProperty)("slider","show-tips"),(0,n.booleanPropertyParser)("show-tips")]]},8936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackParserArray=void 0;const n=r(8122);t.stackParserArray=[[(0,n.hasFeatureProperty)("stack","align-content-stack"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-content-stack");if(!(0,n.isEmptyOrUndefined)(r))return void t.params.set("alignContent",r);const o=e.property.get("align-content-stack");if((0,n.isEmptyOrUndefined)(o))return;const a=(0,n.getEtsEnumValue)("Alignment.",o);t.params.set((0,n.getEtsPropName)("alignContent"),a)}]]},780:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.swiperParserArray=void 0;const n=r(8122);t.swiperParserArray=[[(0,n.hasFeatureProperty)("swiper","index"),(0,n.numberPropertyParser)("index")],[(0,n.hasFeatureProperty)("swiper","auto-play"),(0,n.booleanPropertyParser)("auto-play")],[(0,n.hasFeatureProperty)("swiper","interval"),(0,n.numberPropertyParser)("interval")],[(0,n.hasFeatureProperty)("swiper","indicator"),(0,n.booleanPropertyParser)("indicator")],[(0,n.hasFeatureProperty)("swiper","loop"),(0,n.booleanPropertyParser)("loop")],[(0,n.hasFeatureProperty)("swiper","duration"),(0,n.numberPropertyParser)("duration")],[(0,n.hasFeatureProperty)("swiper","vertical"),(0,n.booleanPropertyParser)("vertical")],[(0,n.hasFeatureProperty)("swiper","item-space"),(0,n.stringPropertyParser)("item-space")],[(0,n.hasFeatureProperty)("swiper","cached-count"),(0,n.numberPropertyParser)("cached-count")],[(0,n.hasFeatureProperty)("swiper","disable-swipe"),(0,n.booleanPropertyParser)("disable-swipe")]]},7036:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabContentParserArray=void 0;const n=r(8122),o=r(9248);t.tabContentParserArray=[[function(e){return"tab-content"===e.type&&(e.hasProperty("tabBar-icon")||e.hasProperty("tabBar-text"))},function(e,t){var r,a;const i=new Map,s=null!==(r=e.getProperty("tabBar-icon"))&&void 0!==r?r:"",p=null!==(a=e.getProperty("tabBar-text"))&&void 0!==a?a:"TabBar",l=e.dynamicProperty.has("tabBar-text"),c=e.dynamicProperty.has("tabBar-icon");(0,n.isEmptyOrUndefined)(s)||i.set("icon",c?s:(0,o.dealWithSrc)(s)),void 0!==p&&i.set("text",l?p:(0,n.quoteString)(p)),i.size>0&&t.properties.set("tabBar",i)}]]},2973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabsParserArray=void 0;const n=r(8122);t.tabsParserArray=[[(0,n.hasFeatureProperty)("tabs","bar-position"),(0,n.enumParamParser)("bar-position","BarPosition.")],[(0,n.hasFeatureProperty)("tabs","index"),(0,n.rawDataParamParser)("index")],[(0,n.hasFeatureProperty)("tabs","controller"),(0,n.rawDataParamParser)("controller")],[(0,n.hasFeatureProperty)("tabs","vertical"),(0,n.booleanPropertyParser)("vertical")],[(0,n.hasFeatureProperty)("tabs","scrollable"),(0,n.booleanPropertyParser)("scrollable")],[(0,n.hasFeatureProperty)("tabs","bar-mode"),(0,n.enumPropertyParser)("bar-mode","BarMode.")],[(0,n.hasFeatureProperty)("tabs","bar-width"),(0,n.stringPropertyParser)("bar-width")],[(0,n.hasFeatureProperty)("tabs","bar-height"),(0,n.stringPropertyParser)("bar-height")],[(0,n.hasFeatureProperty)("tabs","animation-duration"),(0,n.numberPropertyParser)("animation-duration")]]},1162:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textInputParserArray=void 0;const n=r(8122);t.textInputParserArray=[[(0,n.hasFeatureProperty)("text-input","placeholder"),(0,n.stringParamParser)("placeholder")],[(0,n.hasFeatureProperty)("text-input","textInput-type"),function(e,t){const r=e.dynamicProperty.get("textInput-type");if(!(0,n.isEmptyOrUndefined)(r))return void t.properties.set("type",r);const o=e.property.get("textInput-type");(0,n.isEmptyOrUndefined)(o)||t.properties.set("type","InputType."+o)}],[(0,n.hasFeatureProperty)("text-input","placeholderColor"),(0,n.colorPropertyParser)("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasProperty("placeholderFont-size")||e.hasProperty("placeholderFont-weight")||e.hasProperty("placeholderFont-family")||e.hasProperty("placeholderFont-style"))},function(e,t){const r=e.property.get("placeholderFont-size"),o=e.dynamicProperty.get("placeholderFont-size"),a=e.property.get("placeholderFont-weight"),i=e.dynamicProperty.get("placeholderFont-weight"),s=e.property.get("placeholderFont-family"),p=e.dynamicProperty.get("placeholderFont-family"),l=e.property.get("placeholderFont-style"),c=e.dynamicProperty.get("placeholderFont-style"),u=new Map;(0,n.isEmptyOrUndefined)(o)?(0,n.isEmptyOrUndefined)(r)||u.set("size",parseInt(r)):u.set("size",o),(0,n.isEmptyOrUndefined)(i)?(0,n.isEmptyOrUndefined)(a)||u.set("weight",isNaN(Number(a))?(0,n.getEtsEnumValue)("FontWeight.",a):a):u.set("weight",i),(0,n.isEmptyOrUndefined)(p)?(0,n.isEmptyOrUndefined)(s)||u.set("family",(0,n.quoteString)(s)):u.set("family",p),(0,n.isEmptyOrUndefined)(c)?(0,n.isEmptyOrUndefined)(l)||u.set("style",(0,n.getEtsEnumValue)("FontStyle.",l)):u.set("style",c),t.properties.set("placeholderFont",u)}],[(0,n.hasFeatureProperty)("text-input","enterKeyType"),(0,n.enumPropertyParser)("enterKeyType","EnterKeyType.")],[(0,n.hasFeatureProperty)("text-input","caretColor"),(0,n.colorPropertyParser)("caretColor")],[(0,n.hasFeatureProperty)("text-input","maxLength"),(0,n.numberPropertyParser)("maxLength")]]},8681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textParserArray=void 0;const n=r(8122);t.textParserArray=[[(0,n.hasFeatureProperty)("text","content"),n.contentParamParser],[(0,n.hasFeatureProperty)("text","text-align"),(0,n.enumPropertyParser)("text-align","TextAlign.")],[(0,n.hasFeatureProperty)("text","text-overflow"),function(e,t){const r=e.dynamicProperty.get("text-overflow");if(!(0,n.isEmptyOrUndefined)(r))return void t.properties.set("textOverflow",new Map([["overflow",r]]));const o=e.property.get("text-overflow");(0,n.isEmptyOrUndefined)(o)||t.properties.set("textOverflow",new Map([["overflow","TextOverflow."+(0,n.firstUpperCase)(o)]]))}],[(0,n.hasFeatureProperty)("text","max-lines"),(0,n.numberPropertyParser)("max-lines")],[(0,n.hasFeatureProperty)("text","line-height"),(0,n.stringPropertyParser)("line-height")],[function(e){return"text"===e.type&&(e.hasProperty("decoration-type")||e.hasProperty("decoration-color"))},function(e,t){const r=e.property.get("decoration-type"),o=e.dynamicProperty.get("decoration-type"),a=e.property.get("decoration-color"),i=e.dynamicProperty.get("decoration-color");if((0,n.isEmptyOrUndefined)(r)&&(0,n.isEmptyOrUndefined)(a)&&(0,n.isEmptyOrUndefined)(o)&&(0,n.isEmptyOrUndefined)(i))return;const s=new Map;(0,n.isEmptyOrUndefined)(o)?s.set("type",(0,n.isEmptyOrUndefined)(r)?"TextDecorationType.None":(0,n.getEtsEnumValue)("TextDecorationType.",r)):s.set("type",o),t.properties.set("decoration",s),(0,n.isEmptyOrUndefined)(i)?(0,n.isEmptyOrUndefined)(a)||s.set("color",(0,n.dealWithColor)(a)):s.set("color",i)}],[(0,n.hasFeatureProperty)("text","baseline-offset"),(0,n.stringPropertyParser)("baseline-offset")],[(0,n.hasFeatureProperty)("text","text-case"),(0,n.enumPropertyParser)("text-case","TextCase.")],[(0,n.hasFeatureProperty)("text","font-size"),(0,n.stringPropertyParser)("font-size")],[(0,n.hasFeatureProperty)("text","font-style"),(0,n.enumPropertyParser)("font-style","FontStyle.")],[(0,n.hasFeatureProperty)("text","font-weight"),n.fontWeightPropertyParser],[(0,n.hasFeatureProperty)("text","font-family"),(0,n.stringPropertyParser)("font-family")]]},4313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleParseArray=void 0;const n=r(8122);t.toggleParseArray=[[(0,n.hasFeatureProperty)("toggle","toggle-type"),function(e,t){const r="toggle-type";if((0,n.customDynamicParamParser)(r,"type",e,t))return;const o=e.property.get(r);!(0,n.isEmptyOrUndefined)(o)&&t.params instanceof Map&&t.params.set("type",(0,n.getEtsEnumValue)("ToggleType.",o))}],[(0,n.hasFeatureProperty)("toggle","isOn"),(0,n.booleanParamParser)("isOn")],[(0,n.hasFeatureProperty)("toggle","selectedColor"),(0,n.colorPropertyParser)("selectedColor")],[(0,n.hasFeatureProperty)("toggle","switchPointColor"),(0,n.colorPropertyParser)("switchPointColor")]]},8122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEdgeBorderDirection=t.getBorderDirections=t.dealWithAlignSelf=t.dealWithScrollEdgeEffect=t.dealWithBackgroundRepeat=t.dealWithBackgroundImageSize=t.dealWithBackgroundImagePosition=t.dealWithFontWeight=t.getContentName=t.scrollerParamParser=t.dealWithWrap=t.getBackgroundImageSizeEnumValue=t.getBackgroundImagePositionEnumValue=t.contentParamParser=t.labelParamParser=t.fontWeightPropertyParser=t.dealWithColor=t.getEtsEnumValue=t.getEtsPropName=t.parseTagName=t.firstUpperCase=t.getForEachObj=t.colorPropertyParser=t.enumParamParser=t.arrayParamParser=t.booleanParamParser=t.customRawDataParamParser=t.rawDataParamParser=t.dateParamParser=t.stringParamParser=t.dynamicParamParser=t.enumPropertyParser=t.booleanPropertyParser=t.numberPropertyParser=t.isEmptyOrUndefined=t.objectPropertyParser=t.stringPropertyParser=t.customDynamicParamParser=t.dynamicPropertyParser=t.quoteString=t.hasSelectOption=t.hasFeatureProperty=t.hasCommonProperty=t.curry=void 0;const n=r(1195),o=r(4294);function a(e){return(...t)=>t.lengtht.property.has(e)||t.dynamicProperty.has(e))),t.hasFeatureProperty=a(((e,t,r)=>r.type===e&&(r.property.has(t)||r.dynamicProperty.has(t)))),t.hasSelectOption=a(((e,t,r)=>r.type===e)),t.quoteString=i,t.dynamicPropertyParser=s,t.customDynamicParamParser=p,t.stringPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const n=t.property.get(e);void 0!==n&&r.properties.set(y(e),i(n))})),t.objectPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const n=t.property.get(e);void 0!==n&&r.properties.set(y(e),n)})),t.isEmptyOrUndefined=l,t.numberPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const n=t.property.get(e);l(n)||r.properties.set(y(e),n)})),t.booleanPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const n=t.property.get(e);l(n)||r.properties.set(y(e),n)})),t.enumPropertyParser=a(((e,t,r,n)=>{if(s(e,r,n))return;const o=r.property.get(e);l(o)||n.properties.set(y(e),d(t,o))})),t.dynamicParamParser=c,t.stringParamParser=a(((e,t,r)=>{if(c(e,t,r))return;const n=t.property.get(e);void 0!==n&&r.params instanceof Map&&r.params.set(y(e),i(n))})),t.dateParamParser=a(((e,t,r,n)=>{const o=r.dynamicProperty.get(e);if(void 0!==o&&""!==o.trim()&&n.params instanceof Map)return void n.params.set(t,o);const a=r.property.get(e);void 0!==a&&n.params instanceof Map&&n.params.set(t,(e=>void 0===e||""===e?"new Date()":"new Date ("+i(e)+")")(a))})),t.rawDataParamParser=a(((e,t,r)=>{if(c(e,t,r))return;const n=t.property.get(e);!l(n)&&r.params instanceof Map&&r.params.set(y(e),n)})),t.customRawDataParamParser=a(((e,t,r,n)=>{if(p(e,t,r,n))return;const o=r.property.get(e);!l(o)&&n.params instanceof Map&&n.params.set(t,o)})),t.booleanParamParser=a(((e,r,n)=>{(0,t.rawDataParamParser)(e,r,n)})),t.arrayParamParser=a(((e,r,n)=>{(0,t.rawDataParamParser)(e,r,n)})),t.enumParamParser=a(((e,t,r,n)=>{if(c(e,r,n))return;const o=r.property.get(e);!l(o)&&n.params instanceof Map&&n.params.set(y(e),d(t,o))})),t.colorPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;let n=t.property.get(e);l(n)||(n=f(n),r.properties.set(y(e),n))})),t.getForEachObj=function(e){var t,r;const n=e.dynamicProperty.get("for"),o=e.dynamicProperty.get("keyGenerator"),a=null!==(t=e.property.get("item"))&&void 0!==t?t:"item",i=null!==(r=e.property.get("idx"))&&void 0!==r?r:"idx";return void 0!==e.dynamicProperty.get("for")?{for:n,key:o,item:a,idx:i}:null},t.firstUpperCase=u,t.parseTagName=function(e){return(0,o.getTagName)(e).split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")},t.getEtsPropName=y,t.getEtsEnumValue=d,t.dealWithColor=f,t.fontWeightPropertyParser=function(e,t){const r=e.getProperty("font-weight");if(l(r))return;const n=g(r);t.properties.set("fontWeight",n)},t.labelParamParser=function(e,t){const r=e.dynamicProperty.get("label");if(!l(r))return void t.setParams(m(r));const n=e.property.get("label");"string"==typeof n&&t.setParams(i(n))},t.contentParamParser=function(e,t){const r=e.property.get("content"),n=e.dynamicProperty.get("content");l(n)?"string"==typeof r&&t.setParams(i(r)):t.setParams(m(n))},t.getBackgroundImagePositionEnumValue=function(e){const t=new Map([["top left","TopStart"],["top center","Top"],["top right","TopEnd"],["center left","Start"],["center center","Center"],["center right","End"],["bottom left","BottomStart"],["bottom center","Bottom"],["bottom right","BottomEnd"]]);return t.has(e)?`Alignment.${String(t.get(e))}`:""},t.getBackgroundImageSizeEnumValue=function(e){return new Set(["cover","contain","auto"]).has(e)?d("ImageSize.",e):""},t.dealWithWrap=function(e){let t=d("FlexWrap.",e);return"nowrap"===e&&(t="FlexWrap.NoWrap"),t},t.scrollerParamParser=function(e,t){const r=e.dynamicProperty.get("scroller");l(r)||t.setParams(r)},t.getContentName=m,t.dealWithFontWeight=g,t.dealWithBackgroundImagePosition=function(e){if(new Set(["TopStart","Top","TopEnd","Start","Center","End","BottomStart","Bottom","BottomEnd"]).has(e))return"Alignment."+e;const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null!==t?`{ x: ${i(t[1])}, y: ${i(t[4])} }`:void 0},t.dealWithBackgroundImageSize=function(e){if(new Set(["Cover","Contain","Auto"]).has(e))return d("ImageSize.",e);const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null!==t?void 0!==t[5]?`{ width: ${i(t[1])}, height: ${i(t[5])} }`:`{ width: ${i(t[1])} }`:void 0},t.dealWithBackgroundRepeat=function(e){const t=new Map([["repeat-x","X"],["repeat-y","Y"],["repeat","XY"],["no-repeat","NoRepeat"]]).get(e);if(null!=t&&""!==t)return d("ImageRepeat.",t)},t.dealWithScrollEdgeEffect=function(e){var t;const r=d("EdgeEffect.",e);return null!==(t=new Map([["Spring","EdgeEffect.Spring"],["Fade","EdgeEffect.Fade"],["None","EdgeEffect.None"]]).get(r))&&void 0!==t?t:r},t.dealWithAlignSelf=function(e){let t=d("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t},t.getBorderDirections=function(e){return"border-width"===e?["border-top-width","border-bottom-width","border-left-width","border-right-width"]:"border-color"===e?["border-top-color","border-bottom-color","border-left-color","border-right-color"]:"border-style"===e?["border-top-style","border-bottom-style","border-left-style","border-right-style"]:["border-top-left-radius","border-bottom-right-radius","border-bottom-left-radius","border-top-right-radius"]},t.getEdgeBorderDirection=function(e){var t;return e.includes("radius")?null!==(t=new Map([["border-top-left-radius","topLeft"],["border-top-right-radius","topRight"],["border-bottom-left-radius","bottomLeft"],["border-bottom-right-radius","bottomRight"]]).get(e))&&void 0!==t?t:e:e.split("-")[1]}},1912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.events=t.parseVisualModel=void 0;const n=r(8122),o=r(7150),a=r(1778),i=r(8916),s=r(9248),p=r(8483),l=r(2563),c=r(8681),u=r(1790),y=r(8191),d=r(2153),f=r(780),m=r(2565),g=r(4313),h=r(5264),E=r(7907),T=r(7375),P=r(8014),v=r(4925),S=r(1162),b=r(9284),_=r(8936),N=r(2973),C=r(7036),A=r(2218),M=r(1147);t.parseVisualModel=function(e,r){r.setTagName((0,n.parseTagName)(e.type));const o=(0,n.getForEachObj)(e);r.setForEachObj(o);const a=void 0!==e.dynamicProperty.get("if")?e.dynamicProperty.get("if"):e.property.get("if");void 0===a?r.setIfBoolean(null):r.setIfBoolean(a);for(const t of w)("boolean"==typeof t[0]||t[0](e))&&t[1](e,r);!function(e,r){var n;const o="onDisappear",a="onDisAppear";for(let n of t.events){const t=e.property.get(n);n===o&&(n=a),void 0!==t&&""!==t&&("this"===t.split(".")[0]?r.properties.set(n,t+".bind(this)"):r.properties.set(n,t))}if(void 0!==e.property.get("newFunction")){const t=null!==(n=e.property.get("newFunction"))&&void 0!==n?n:"{}",i=JSON.parse(t);Object.keys(i).forEach((e=>{var t;const n=null!==(t=i[e].eventCodeGen)&&void 0!==t?t:"";e===o&&(e=a),r.properties.set(e,n)}))}}(e,r)},t.events=["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange","onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop","onComplete","onError","onFinish","onChange","onSubmit","onEditChanged","onStateChange","onRefreshing","onSelect","onScroll","onScrollEdge","onScrollEnd","onScrollBegin","onTitleModeChange"];const w=[...o.commonParserArray,...i.buttonParserArray,...a.dividerParserArray,...s.imageParserArray,...p.progressParserArray,...l.sliderParserArray,...c.textParserArray,...u.columnParserArray,...u.rowParserArray,...h.flexParserArray,...E.listParserArray,...E.listItemParserArray,...f.swiperParserArray,...S.textInputParserArray,...y.navigationParserArray,...m.timePickerParserArray,...m.textPickerParserArray,...v.refreshParserArray,...g.toggleParseArray,...P.selectParserArray,...m.datePickerParserArray,...T.scrollParserArray,...d.gridParserArray,...d.gridItemParserArray,...b.searchParserArray,..._.stackParserArray,...N.tabsParserArray,...C.tabContentParserArray,...A.checkboxParseArray,...M.checkboxGroupParseArray]},3243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Style=t.Tag=void 0;const n=r(4117);class o extends n.ASTNode{constructor(e,t,r){super(),this.tagName=e,this.attributes=t,this.content=r}}t.Tag=o;class a extends n.ASTNode{constructor(e,t,r,n){super(),this.mediaQuery=void 0,this.kind=e,this.name=t,this.content=r,this.mediaQuery=n}}t.Style=a},3573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const n=r(3243),o=r(2334);class a{constructor(e){this.cache=e}visit(e){e instanceof n.Tag?this.genTag(e):e instanceof n.Style&&this.genStyle(e)}static getMethodGen(e){return void 0===a.instance?a.instance=new a(e):a.instance.setCache(e),a.instance}setCache(e){this.cache=e}genTag(e){if(this.cache.concat(o.TokenClass.TAG_START,e.tagName),this.cache.indentOff(),e.attributes.forEach(((e,t)=>{let r="";for(const t of e)r+='"'===t?""":"\n"===t?" ":t;this.cache.concat(o.TokenClass.SPACE,t,o.TokenClass.ASSIGN,o.TokenClass.LQUOTE,r,o.TokenClass.RQUOTE)})),null===e.content)this.cache.concat(o.TokenClass.EMPTY_TAG_END);else{if(this.cache.concat(o.TokenClass.TAG_END),"string"==typeof e.content){let t="";for(const r of e.content)t+="<"===r?"<":r;this.cache.concat(t)}else 0!==e.content.length&&(this.cache.concat(o.TokenClass.NEW_LINE),this.cache.incIndent(),this.cache.indentOn(),e.content.forEach((e=>{e.accept(this),this.cache.indentOff(),this.cache.concat(o.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.indentOn(),this.cache.decIndent());this.cache.concat(o.TokenClass.END_TAG_START,e.tagName,o.TokenClass.TAG_END)}}genStyle(e){void 0!==e.mediaQuery&&(this.cache.concat("@media"),this.cache.indentOff(),this.cache.concat(o.TokenClass.SPACE,e.mediaQuery,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent()),"IDStyle"===e.kind&&(this.cache.concat(o.TokenClass.ID_STYLE_START),this.cache.indentOff()),this.cache.concat(e.name,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent(),e.content.forEach(((e,t)=>{this.cache.concat(t,o.TokenClass.COLON,o.TokenClass.SPACE,e,o.TokenClass.SEMICOLON,o.TokenClass.NEW_LINE)})),this.cache.decIndent(),this.cache.concat(o.TokenClass.RBRA,o.TokenClass.NEW_LINE),void 0!==e.mediaQuery&&(this.cache.decIndent(),this.cache.concat(o.TokenClass.RBRA,o.TokenClass.NEW_LINE)),this.cache.concat(o.TokenClass.NEW_LINE)}}t.ASTNodeGenerator=a,a.instance=void 0},8844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CSSBridge=t.HMLBridge=void 0;const n=r(3243),o=r(7571);t.HMLBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map([["id",e.id]]);let r="";for(let[n,a]of e.property)(0,o.isAttribute)(n,e.type)?("string"!=typeof a&&(a=JSON.stringify(a)),t.set(n,a)):(0,o.isContent)(n)&&(r=a);if(e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}const a=new n.Tag(e.type,t,r);return"wrapper"===t.get("id")?new n.Tag("div",new Map,[a]):a}},t.CSSBridge=class{constructor(){this.errors=0,this.styles=[]}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}genIDStyle(e){var t;const r=t=>{const r=new Map;for(const[n,a]of t)(0,o.isStyle)(n,e.type)&&r.set(n,a);return r},a=r(e.property);a.size>0&&this.styles.push(new n.Style("IDStyle",e.id,a)),(null!==(t=e.mediaProperty)&&void 0!==t?t:new Map).forEach(((t,o)=>{const a=r(t);a.size>0&&this.styles.push(new n.Style("IDStyle",e.id,a,o))}));for(const t of e.children)t.accept(this)}visit(e){return this.genIDStyle(e),this.styles}}},1055:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genFACSS=t.genFAHML=void 0;const n=r(3573),o=r(1862);t.genFAHML=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" "));return e.accept(t),t.cache.toString()},t.genFACSS=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" "));return e.forEach((e=>{e.accept(t)})),t.cache.toString()}},7571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEvent=t.isData=t.isUnknown=t.isContent=t.isAttribute=t.isStyle=t.styleMap=void 0;const n=r(904),o=["width","height","min-width","min-height","max-width","max-height","padding","padding-start","padding-end","padding-top","padding-right","padding-bottom","padding-left","margin","margin-start","margin-end","margin-top","margin-right","margin-bottom","margin-left","border-width","border-style","border-color","border-radius","border-top-width","border-top-style","border-top-color","border-top-left-radius","border-right-width","border-right-style","border-right-color","border-top-right-radius","border-bottom-width","border-bottom-style","border-bottom-color","border-bottom-right-radius","border-left-width","border-left-style","border-left-color","border-bottom-left-radius","background-color","background","background-image","background-size","background-position","background-repeat","display","opacity","visibility","flex","flex-grow","flex-shrink","flex-basis","position","display","top","right","bottom","left","display-index","flex-weight","aspect-ratio"],a=["font-size","font-family","font-style","font-weight"],i=["text-align","line-height","text-decoration","letter-spacing","max-lines","text-overflow","allow-scale","min-font-size","max-font-size","font-size-step","prefer-font-sizes","color",...a],s=["allow-scale","text-decoration","color",...a],p=["text-color","allow-scale","icon-width","icon-height","radius",...a],l=["texton-color","textoff-color","text-padding","allow-scale",...a],c=["column-height","text-color","allow-scale","letter-spacing","text-decoration","line-height","opacity",...a],u=["text-color","allow-scale","letter-spacing",...a];t.styleMap=new Map([["common",new Set([...o])],["div",new Set(["flex-direction","overflow","flex-wrap","justify-content","align-items","align-content","grid-template-columns","grid-template-rows","grid-row-start","grid-row-end","grid-column-start","grid-column-end","grid-gap","grid-columns-gap","grid-rows-gap"])],["text",new Set([...i])],["image",new Set(["object-fit","match-text-direction","fit-original-size"])],["span",new Set([...s])],["input",new Set(["font-size","font-family","font-weight","color","placeholder-color","allow-scale"])],["button",new Set([...p])],["switch",new Set([...l])],["refresh",new Set(["progress-color"])],["divider",new Set(["stroke-width","line-cap","color"])],["chart",new Set(["stroke-width","radius","start-angle","total-angle","center-x","center-y","colors","weights"])],["picker",new Set([...c])],["picker-view",new Set(["color","font-size","selected-color","selected-font-size","focus-color","focus-font-size","disappear-color","disappear-font-size","font-family"])],["slider",new Set(["color","selected-color","block-color"])],["swiper",new Set(["indicator-color","indicator-selected-color","indicator-size","indicator-top","indicator-right","indicator-bottom","indicator-left"])],["list",new Set(["flex-direction","columns","item-extent","fade-color"])],["list-item",new Set(["column-span"])],["progress",new Set(["color","stroke-width","background-color","secondary-color","scale-width","scale-number","start-angle","total-angle","center-x","center-y","radius"])],["select",new Set(["font-family"])],["menu",new Set([...u])],["option",new Set(["color","font-family","allow-scale","font-size","font-weight","text-decoration"])],["video",new Set(["object-fit"])],["clock",new Set(["font-family"])]]);const y=new Map([["common",new Set(["id","ref","disabled","focusable","data","if","for"])],["image",new Set(["src","alt"])],["button",new Set(["type","value","icon","waiting"])],["refresh",new Set(["offset","refreshing","type","lasttime","friction"])],["input",new Set(["type","checked","name","value","placeholder","maxlength","enterkeytype","headericon"])],["switch",new Set(["checked","showtext","texton","textoff"])],["option",new Set(["value","selected","icon"])],["chart",new Set(["type","percent","datasets","options"])],["picker",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","value","vibrate"])],["picker-view",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","indicatorprefix","indicatorsuffix","vibrate"])],["slider",new Set(["min","max","step","showtips","showsteps","mode","value"])],["divider",new Set(["vertical"])],["list",new Set(["scrollpage","cachedcount","scrollbar","scrolleffect","shapemode","indexer","itemscale","itemcenter","updateeffect","scrollvibrate","initialindex","initialoffset"])],["list-item",new Set(["type","primary","section","sticky","stickyradius","clickeffect"])],["swiper",new Set(["index","autoplay","interval","indicator","digital","indicatordisabled","loop","duration","vertical"])],["progress",new Set(["type","percent","secondarypercent","clockwise"])],["menu",new Set(["target","title","type"])],["clock",new Set(["clockconfig","showdigit","hourswest"])],["badge",new Set(["placement","count","visible","maxcount","config","label"])],["video",new Set(["muted","src","autoplay","poster","controls","loop","starttime","direction","speed"])],["tabs",new Set(["index","vertical"])],["tab-bar",new Set(["mode"])],["tab-content",new Set(["scrollable"])]]),d=new Map([["common",new Set(["ontouchstart","ontouchmove","ontouchcancel","ontouchend","onclick","onlongpress","onfocus","onblur","onkey","onswipe"])],["image",new Set(["oncomplete","onerror"])],["input",new Set(["onchange","onenterkeyclick"])],["select",new Set(["onchange"])],["refresh",new Set(["onrefresh","onpulldown"])],["swiper",new Set(["onchange","onrotation"])],["list",new Set(["onindexerchange","onscroll","onscrollbottom","onscrolltop","onscrollend","onscrolltouchup","onrequestitem"])],["list-item",new Set(["onsticky"])],["menu",new Set(["onselected","oncancel"])],["picker",new Set(["oncolumnchange","onchange","oncancel"])],["picker-view",new Set(["oncolumnchange","onchange"])],["video",new Set(["onprepared","onstart","onpause","onfinish","onerror","onseeking","onseeked","ontimeupdate","onfullscreenchange","onstop"])],["tabs",new Set(["onchange"])],["switch",new Set(["onchange"])],["dialog",new Set(["oncancel"])],["slider",new Set(["onchange"])]]),f=new Map([["common",new Set(["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange"])],["image",new Set(["onComplete","onError","onFinish"])],["swiper",new Set(["onChange"])],["list",new Set(["onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop"])],["text-input",new Set(["onChange","onSubmit","onEditChanged"])],["refresh",new Set(["onStateChange","onRefreshing"])],["toggle",new Set(["onChange"])],["timePicker",new Set(["onChange"])],["textPicker",new Set(["onChange"])],["select",new Set(["onSelect"])],["datePicker",new Set(["onChange"])],["search",new Set(["onSubmit","onChange","onCopy","onCut","onPaste"])],["grid",new Set(["onScrollIndex","onItemDragStart","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDrop"])],["grid-item",new Set(["onSelect"])],["navigation",new Set(["onTitleModeChange"])],["tabs",new Set(["onChange"])],["checkBox",new Set(["onChange"])],["checkboxGroup",new Set(["onChange"])]]);function m(e,t,r){const n=t.get(r);return void 0!==n&&n.has(e)}function g(e,r){return m(e,t.styleMap,"common")||m(e,t.styleMap,r)}function h(e,t){return(0,n.getDomain)()===n.Domain.ETS?m(e,f,"common")||m(e,f,t):E(e,t)||T(e,t)}function E(e,t){return m(e,y,"common")||m(e,y,t)}function T(e,t){return m(e,d,"common")||m(e,d,t)}t.isStyle=g,t.isAttribute=h,t.isContent=function(e){return"content"===e},t.isUnknown=function(e,t){return!g(e,t)&&!h(e,t)},t.isData=E,t.isEvent=T},2334:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.INDENT=" ",r.SPACE=" ",r.LQUOTE='"',r.RQUOTE='"',r.TAG_START="<",r.TAG_END=">",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.etsPropertyList=void 0;const n=r(5958),o=r(1513),a=["vp","px","%","lpx"],i=[{propertySector:o.Sector.FEATURE,propertySet:{name:"FontSize",property:"font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontStyle",property:"font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontColor",property:"font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontWeight",property:"font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...o.commonFontWeight],defaults:"normal"}}],s={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["vp","px","lpx"],placeholder:"0"},p=[{propertySector:o.Sector.GENERAL,propertySet:{name:"Width",property:"width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a,min:0}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Height",property:"height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a,min:0}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MinWidth",property:"constraint-size-min-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MinHeight",property:"constraint-size-min-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MaxWidth",property:"constraint-size-max-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MaxHeight",property:"constraint-size-max-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"Margin",property:"margin-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"Padding",property:"padding-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginTop",property:"margin-top-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginRight",property:"margin-right-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginBottom",property:"margin-bottom-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginLeft",property:"margin-left-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingTop",property:"padding-top-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingRight",property:"padding-right-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingBottom",property:"padding-bottom-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingLeft",property:"padding-left-visual"},s)}],l={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a},c={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a},u=[{propertySector:o.Sector.CUSTOM,propertySet:{name:"CustomString",property:"custom-string-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.CUSTOM,propertySet:{name:"CustomNumber",property:"custom-number-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.CUSTOM,propertySet:{name:"CustomBoolean",property:"custom-boolean-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}],y=[{propertySector:o.Sector.DIMENSION,propertySet:{name:"Border",property:"border-visual",type:o.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-width-visual"},l),Object.assign({name:"Style",property:"border-style-visual"},o.commonParamsForBorder),{name:"Color",property:"border-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR},Object.assign({name:"Radius",property:"border-radius-visual"},c)]}}],d=[{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageSrc",property:"background-image-src-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_SRC}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageRepeat",property:"background-image-repeat-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_REPERT,list:[o.CLEAN_VALUE_NODE,{name:"X",value:"repeat-x"},{name:"Y",value:"repeat-y"},{name:"XY",value:"repeat"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageSize",property:"background-image-size-visual",type:o.TypeName.DATA_SELECT_INPUT,etsType:`${o.EtsType.IMAGE_SIZE}|${o.EtsType.STRING}`,list:[o.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Auto",value:"auto"}],defaults:"Auto"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImagePosition",property:"background-image-position-visual",type:o.TypeName.DATA_SELECT_INPUT,etsType:`${o.EtsType.ALIGNMENT}|${o.EtsType.STRING}`,list:[o.CLEAN_VALUE_NODE,{name:"TopStart",value:"top left"},{name:"Top",value:"top center"},{name:"TopEnd",value:"top right"},{name:"Start",value:"center left"},{name:"Center",value:"center center"},{name:"End",value:"center right"},{name:"BottomStart",value:"bottom left"},{name:"Bottom",value:"bottom center"},{name:"BottomEnd",value:"bottom right"}],defaults:"0 0"}}],f=[{propertySector:o.Sector.GENERAL,propertySet:{name:"Location",property:"position-visual",type:o.TypeName.SELECT,defaults:"offset",supportDynamicProperty:!1,list:[o.CLEAN_VALUE_NODE,{name:"offset",value:"relative"},{name:"position",value:"absolute"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"X",property:"left-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Y",property:"top-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}}],m=[...i,{propertySector:o.Sector.FEATURE,propertySet:{name:"TextAlign",property:"text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"LineHeight",property:"line-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextOverflow",property:"text-overflow-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_OVERFLOW,list:[o.CLEAN_VALUE_NODE,{name:"Clip",value:"clip"},{name:"Ellipsis",value:"ellipsis"},{name:"None",value:"none"}],defaults:"clip"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"BaselineOffset",property:"baseline-offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DecorationType",property:"decoration-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_DECORATION_TYPE,list:[o.CLEAN_VALUE_NODE,{name:"Underline",value:"underline"},{name:"LineThrough",value:"line-through"},{name:"Overline",value:"overline"},{name:"None",value:"none"}],defaults:"none"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DecorationColor",property:"decoration-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextCase",property:"text-case-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_CASE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"LowerCase"},{value:"UpperCase"}],defaults:"Normal"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"ForEach",property:"for-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"KeyGenerator",property:"keyGenerator-visual",type:o.TypeName.BASE,etsType:"Event",supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Item",property:"item-visual",type:o.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Item of ForEach Array"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Idx",property:"idx-visual",type:o.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Index of Corresponding Item In ForEach Array"}}],g=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Placeholder",property:"placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Type",property:"textInput-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.INPUT_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Password"},{value:"Email"},{value:"Number"}],defaults:"Normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderColor",property:"placeholderColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontSize",property:"placeholderFont-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontWeight",property:"placeholderFont-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Lighter"},{value:"Regular"},{value:"Medium"},{value:"Bold"},{value:"Bolder"},...o.commonFontWeight],defaults:"400"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontFamily",property:"placeholderFont-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontStyle",property:"placeholderFont-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Italic"}],defaults:"Normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EnterKeyType",property:"enterKeyType-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ENTER_KEY_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Go"},{value:"Search"},{value:"Send"},{value:"Next"},{value:"Done"}],defaults:"Done"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CaretColor",property:"caretColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"MaxLength",property:"maxLength-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}}],h=[{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"Vertical",property:"vertical-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"LineCap",property:"line-cap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.LINE_CAP_STYLE,defaults:"butt",list:[o.CLEAN_VALUE_NODE,{name:"Butt",value:"butt"},{name:"Round",value:"round"},{name:"Square",value:"square"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StrokeWidth",property:"stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:a}}],E=[{propertySector:o.Sector.FEATURE,propertySet:{name:"InitialIndex",property:"initial-index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ListDirection",property:"list-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.AXIS,list:[o.CLEAN_VALUE_NODE,{name:"Vertical",value:"vertical"},{name:"Horizontal",value:"horizontal"}],defaults:"vertical"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Color",property:"divider-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StrokeWidth",property:"divider-stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StartMargin",property:"divider-start-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EndMargin",property:"divider-end-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EditMode",property:"edit-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EdgeEffect",property:"edge-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{name:"Spring",value:"spring"},{name:"None",value:"none"}],defaults:"spring"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ChainAnimation",property:"chain-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}],T=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Sticky",property:"sticky-visual",type:o.TypeName.SELECT,etsType:o.EtsType.STICKY,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"Normal",value:"normal"}],defaults:"none"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Editable",property:"editable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}],P=[{propertySector:o.Sector.FLEX,propertySet:{name:"FlexBasis",property:"flex-basis-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:a,defaults:"auto",fixedValues:["auto"],info:"The initial main size of a flex item. It sets the size of the content box otherwise set with box-sizing."}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignSelf",property:"align-self-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"auto",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FLEX,propertySet:{name:"Direction",property:"flex-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_DIRECTION,defaults:"row",list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"RowReverse",value:"row-reverse"},{name:"Column",value:"column"},{name:"ColumnReverse",value:"column-reverse"}],info:"The direction of flex."}},{propertySector:o.Sector.FLEX,propertySet:{name:"Wrap",property:"wrap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_WRAP,defaults:"nowrap",list:[o.CLEAN_VALUE_NODE,{name:"NoWrap",value:"nowrap"},{name:"Wrap",value:"wrap"},{name:"WrapReverse",value:"wrap-reverse"}],info:"Whether flex items are forced onto one line or multiple lines."}},{propertySector:o.Sector.FLEX,propertySet:{name:"JustifyContent",property:"justify-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"JustifyContent",property:"justify-content-rc-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignItems",property:"align-items-flex-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"stretch",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignContent",property:"align-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Set the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis."}}],v=[{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"AutoPlay",property:"auto-play-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"Interval",property:"interval-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"Loop",property:"loop-visual"},o.commonParamsForJudge),{defaults:!0})},{propertySector:o.Sector.FEATURE,propertySet:{name:"Duration",property:"duration-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ItemSpace",property:"item-space-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CachedCount",property:"cached-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"DisableSwipe",property:"disable-swipe-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"Index",property:"index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"Indicator",property:"indicator-visual"},o.commonParamsForJudge),{defaults:!0})}],S=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Type",property:"toggle-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TOGGLE_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Button"},{value:"Checkbox"},{value:"Switch"}],defaults:"Button"}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"IsOn",property:"isOn-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedColor",property:"selectedColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SwitchPointColor",property:"switchPointColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}],b=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Friction",property:"friction-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:62}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Offset",property:"offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:a,defaults:16}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Refreshing",property:"refreshing-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}],_=[{propertySector:o.Sector.FEATURE,propertySet:{name:"TrackColor",property:"track-color-visual",type:o.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ShowSteps",property:"show-steps-visual",type:o.TypeName.ADJUSTABLE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ShowTips",property:"show-tips-visual",type:o.TypeName.ADJUSTABLE}}],N=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Range",property:"range-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Selected",property:"datetime-selected-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Start",property:"start-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"End",property:"end-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"UseMilitaryTime",property:"useMilitaryTime-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE,propertySet:{name:"Selected",property:"textPicker-selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DefaultPickerItemHeight",property:"defaultPickerItemHeight-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["vp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Lunar",property:"lunar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}],C=[{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontSize",property:"selected-option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontStyle",property:"selected-option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontColor",property:"selected-option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontWeight",property:"selected-option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...o.commonFontWeight],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontFamily",property:"selected-option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionBackgroundColor",property:"selected-option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontSize",property:"option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontStyle",property:"option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontColor",property:"option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontWeight",property:"option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...o.commonFontWeight],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontFamily",property:"option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionBackgroundColor",property:"option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Value",property:"select-value-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Selected",property:"selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Options",property:"select-option-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}}];t.etsPropertyList=[...u,...y,...p,...S,...m,...g,...h,...f,...E,...T,...P,...v,...b,...C,..._,...n.commonPropertyList,...d,...N,{propertySector:o.Sector.ATOMIC,propertySet:{name:"DisplayPriority",property:"display-priority-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Visibility",property:"visibility-visual",type:o.TypeName.SELECT,etsType:o.EtsType.VISIBILITY,defaults:"visible",list:[o.CLEAN_VALUE_NODE,{name:"Visible",value:"visible"},{name:"Hidden",value:"hidden"},{name:"None",value:"none"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Enabled",property:"enabled-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"true",list:[{value:"true"},{value:"false"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Align",property:"align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ALIGNMENT,defaults:"center",list:[o.CLEAN_VALUE_NODE,{name:"TopStart",value:"top-start"},{name:"Top",value:"top"},{name:"TopEnd",value:"top-end"},{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"},{name:"BottomStart",value:"bottom-start"},{name:"Bottom",value:"bottom"},{name:"BottomEnd",value:"bottom-end"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"If",property:"if-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Space",property:"space-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["vp","px","lpx"],requires:{"display-visual":["flex","cleanValue"]},info:"Space between any two adjacent child components."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"AlignItems",property:"align-items-row-visual",type:o.TypeName.SELECT,etsType:o.EtsType.VERTICAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[o.CLEAN_VALUE_NODE,{value:"flex-start",name:"top",etsEnumValue:"Top"},{value:"flex-end",name:"bottom",etsEnumValue:"Bottom"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the vertical direction."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"AlignItems",property:"align-items-column-visual",type:o.TypeName.SELECT,etsType:o.EtsType.HORIZONTAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[o.CLEAN_VALUE_NODE,{value:"flex-start",name:"start",etsEnumValue:"Start"},{value:"flex-end",name:"end",etsEnumValue:"End"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the horizontal direction."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Src",property:"src-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_SRC}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Alt",property:"alt-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT}},{propertySector:o.Sector.FEATURE,propertySet:{name:"RenderMode",property:"render-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_RENDER_MODE,defaults:"original",list:[o.CLEAN_VALUE_NODE,{name:"Original",value:"original"},{name:"Template",value:"template"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ObjectRepeat",property:"object-repeat-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_REPERT,defaults:"no-repeat",list:[o.CLEAN_VALUE_NODE,{name:"X",value:"X"},{name:"Y",value:"Y"},{name:"XY",value:"XY"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ObjectFit",property:"object-fit-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_FIT,defaults:"cover",list:[o.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Fill",value:"fill"},{name:"None",value:"none"},{name:"ScaleDown",value:"scale-down"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"InterPolation",property:"interpolation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_INTERPOLATION,defaults:"none",list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"High",value:"high"},{name:"Medium",value:"medium"},{name:"Low",value:"low"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SourceSizeWidth",property:"source-size-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SourceSizeHeight",property:"source-size-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Type",property:"type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BUTTON_TYPE,defaults:"capsule",list:[{name:"Normal",value:"normal"},{name:"Capsule",value:"capsule"},{name:"Circle",value:"circle"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StateEffect",property:"state-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"true",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Content",property:"content-visual",type:o.TypeName.ADJUSTABLE,etsType:o.EtsType.COMB_CONTENT}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Label",property:"label-visual",type:o.TypeName.ADJUSTABLE,etsType:o.EtsType.COMB_CONTENT}}]},5958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonPropertyList=void 0;const n=r(1513);t.commonPropertyList=[{propertySector:n.Sector.GENERAL,propertySet:{name:"BackgroundColor",property:"background-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Display",property:"display-visual",type:n.TypeName.SELECT,defaults:"flex",list:[n.CLEAN_VALUE_NODE,{value:"flex"},{value:"none"}]}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Opacity",property:"opacity-visual",type:n.TypeName.SLIDER,etsType:n.EtsType.COMB_R_NUMBER,defaults:"1",step:.01,max:1,min:0}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Overflow",property:"overflow-visual",type:n.TypeName.SELECT,defaults:"visible",list:[n.CLEAN_VALUE_NODE,{value:"visible"},{value:"hidden"},{value:"scroll"}]}},{propertySector:n.Sector.FLEX,propertySet:{name:"FlexGrow",property:"flex-grow-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:"0",requiresParent:{display:["flex","cleanValue"]},info:"The flex grow factor of a flex item's main size"}},{propertySector:n.Sector.FLEX,propertySet:{name:"FlexShrink",property:"flex-shrink-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:"1",requiresParent:{display:["flex","cleanValue"]},info:"The flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items will shrink"}},{propertySector:n.Sector.FLEX,propertySet:{name:"Columns",property:"columns-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:1,info:"The column number of flex."}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Header Logo",property:"headerLogo-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Title",property:"title-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Status",property:"status-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Logo",property:"logo-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Color",property:"color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FontFamily",property:"font-family-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_CONTENT,defaults:"sans-serif"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"MaxLines",property:"max-lines-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextColor",property:"text-color-visual",type:n.TypeName.COLOR,defaults:"rgba(0,0,0,0.9)"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FocusColor",property:"focus-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"DisappearColor",property:"disappear-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorColor",property:"indicator-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorSelectedColor",property:"indicator-selected-color-visual",type:n.TypeName.COLOR,defaults:"#ff007dff"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorSize",property:"indicator-size-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorTop",property:"indicator-top-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorRight",property:"indicator-right-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorBottom",property:"indicator-bottom-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorLeft",property:"indicator-left-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:{name:"AllowScale",property:"allow-scale-visual",type:n.TypeName.SELECT,defaults:"true",list:[n.CLEAN_VALUE_NODE,{value:"true"},{value:"false"}]}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowStart",property:"grid-row-start-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its row in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnStart",property:"grid-column-start-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its column in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowEnd",property:"grid-row-end-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its row in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnEnd",property:"grid-column-end-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its column in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridTemplateRows",property:"grid-template-rows-visual",type:n.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid rows."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridTemplateColumns",property:"grid-template-columns-visual",type:n.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid columns."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowsGap",property:"grid-rows-gap-visual",type:n.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's grid rows."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnsGap",property:"grid-columns-gap-visual",type:n.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's columns."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridGap",property:"grid-gap-visual",type:n.TypeName.INTEGER,units:["px"],requires:{"display-visual":["grid"]},info:"The gaps between rows and columns. It is a shorthand for row-gap and column-gap."}},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"MatchTextDirection",property:"match-text-direction-visual"},n.commonParamsForJudge)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"FitOriginalSize",property:"fit-original-size-visual"},n.commonParamsForJudge)},{propertySector:n.Sector.FEATURE,propertySet:{name:"IconWidth",property:"icon-width-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IconHeight",property:"icon-height-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextonColor",property:"texton-color-visual",type:n.TypeName.COLOR,defaults:"#000000"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextoffColor",property:"textoff-color-visual",type:n.TypeName.COLOR,defaults:"#000000"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextPadding",property:"text-padding-visual",type:n.TypeName.INTEGER,defaults:0,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"SelectedColor",property:"selected-color-visual",type:n.TypeName.COLOR,defaults:"rgba(0,125,255,1)"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"BlockColor",property:"block-color-visual",type:n.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Radius",property:"radius-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"StartAngle",property:"start-angle-visual",type:n.TypeName.INTEGER,defaults:240}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TotalAngle",property:"total-angle-visual",type:n.TypeName.INTEGER,defaults:240}},{propertySector:n.Sector.FEATURE,propertySet:{name:"CenterX",property:"center-x-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"CenterY",property:"center-y-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Colors",property:"colors-visual",type:n.TypeName.BASE}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Weights",property:"weights-visual",type:n.TypeName.BASE}},{propertySector:n.Sector.FEATURE,propertySet:{name:"PlaceHolderColor",property:"placeholder-color-visual",type:n.TypeName.COLOR,defaults:"gray"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ProgressColor",property:"progress-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR,defaults:"black"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ItemExtent",property:"item-extent-visual",type:n.TypeName.INTEGER,units:["px","%"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FadeColor",property:"fade-color-visual",type:n.TypeName.COLOR,defaults:"grey"}},{propertySector:n.Sector.FLEX,propertySet:{name:"ColumnSpan",property:"column-span-visual",type:n.TypeName.INTEGER,defaults:1,min:1,info:"The number of span."}},{propertySector:n.Sector.ATOMIC,propertySet:{name:"FlexWeight",property:"flex-weight-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.ATOMIC,propertySet:{name:"AspectRatio",property:"aspect-ratio-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"SecondaryColor",property:"secondary-color-visual",type:n.TypeName.COLOR,requires:{type:["horizontal","ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ScaleWidth",property:"scale-width-visual",type:n.TypeName.INTEGER,requires:{type:["ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ScaleNumber",property:"scale-number-visual",type:n.TypeName.INTEGER,defaults:120,requires:{type:["ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Value",property:"value-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:0}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Total",property:"total-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:100}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Style",property:"style-visual",type:n.TypeName.SELECT,etsType:n.EtsType.PROGRESS_STYLE,defaults:"Linear",list:[{value:"Linear"}]}}]},1513:(e,t)=>{"use strict";var r,n,o,a,i,s;Object.defineProperty(t,"__esModule",{value:!0}),t.commonFontWeight=t.commonParamsForBorderRadius=t.commonParamsForIndicator=t.commonParamsForInteger=t.commonParamsForJudge=t.commonParamsForBorder=t.CLEAN_VALUE_NODE=t.EtsCombinationType=t.EtsBasicType=t.EtsEnumType=t.EtsType=t.TypeName=t.Sector=void 0,function(e){e.GENERAL="general",e.DIMENSION="dimension",e.FEATURE="feature",e.FLEX="flex",e.GRID="grid",e.ATOMIC="atomic",e.CUSTOM="custom"}(r||(r={})),t.Sector=r,function(e){e.BASE="base",e.INTEGER="integer",e.SELECT="select",e.COLOR="color",e.COMPOSITE="composite",e.SLIDER="slider",e.DATA_SELECT_INPUT="dataSelectInput",e.ADJUSTABLE="adjustable"}(n||(n={})),t.TypeName=n,function(e){e.ARRAY="ETSArray",e.BOOLEAN="boolean",e.DATE="Date",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(o||(o={})),t.EtsBasicType=o,function(e){e.R_FLOAT="Rfloat",e.R_STRING="Rstring",e.R_COLOR="Rcolor",e.R_PLURAL="Rplural",e.R_MEDIA="Rmedia",e.R_RAWFILE="Rrawfile"}(a||(a={})),function(e){e.ALIGNMENT="Alignment",e.AXIS="Axis",e.BORDER_STYLE="BorderStyle",e.BUTTON_TYPE="ButtonType",e.COLOR="Color",e.DIRECTION="Direction",e.EDGE_EFFECT="EdgeEffect",e.ENTER_KEY_TYPE="EnterKeyType",e.FLEX_ALIGN="FlexAlign",e.FLEX_DIRECTION="FlexDirection",e.FLEX_WRAP="FlexWrap",e.FONT_STYLE="FontStyle",e.FONT_WEIGHT="FontWeight",e.HORIZONTAL_ALIGN="HorizontalAlign",e.IMAGE_FIT="ImageFit",e.IMAGE_INTERPOLATION="ImageInterpolation",e.IMAGE_RENDER_MODE="ImageRenderMode",e.IMAGE_REPERT="ImageRepeat",e.IMAGE_SIZE="ImageSize",e.INPUT_TYPE="InputType",e.ITEM_ALIGN="ItemAlign",e.LINE_CAP_STYLE="LineCapStyle",e.PROGRESS_STYLE="ProgressStyle",e.STICKY="Sticky",e.TEXT_ALIGN="TextAlign",e.TEXT_OVERFLOW="TextOverflow",e.TEXT_DECORATION_TYPE="TextDecorationType",e.TEXT_CASE="TextCase",e.TOGGLE_TYPE="ToggleType",e.VERTICAL_ALIGN="VerticalAlign",e.VISIBILITY="Visibility"}(i||(i={})),t.EtsEnumType=i,function(e){e.COMB_COLOR="string|number|Color|Rcolor",e.COMB_LENGTH="string|number",e.COMB_R_NUMBER="number|Rfloat",e.COMB_R_LENGTH="string|number|Rfloat",e.COMB_CONTENT="string|Rstring|Rplural",e.COMB_SRC="string|Rmedia|Rrawfile"}(s||(s={})),t.EtsCombinationType=s;const p=Object.assign(Object.assign(Object.assign(Object.assign({},o),a),i),s);t.EtsType=p;const l={value:"cleanValue",name:"---Clean Value---"};t.CLEAN_VALUE_NODE=l;const c={type:n.SELECT,etsType:p.BORDER_STYLE,list:[l,{value:"dotted",etsEnumValue:"Dotted"},{value:"dashed",etsEnumValue:"Dashed"},{value:"solid",etsEnumValue:"Solid"}]};t.commonParamsForBorder=c;const u={type:n.SELECT,etsType:p.BOOLEAN,defaults:"false",list:[l,{value:"true"},{value:"false"}]};t.commonParamsForJudge=u;const y={type:n.INTEGER,units:["px"],placeholder:"0px"};t.commonParamsForInteger=y;const d={type:n.INTEGER,units:["px","%"]};t.commonParamsForIndicator=d;const f={type:n.INTEGER,units:["px"]};t.commonParamsForBorderRadius=f,t.commonFontWeight=[{value:"100"},{value:"200"},{value:"300"},{value:"400"},{value:"500"},{value:"600"},{value:"700"},{value:"800"},{value:"900"}]},9282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TagTypeMap=void 0,t.TagTypeMap=new Map([["button","TextContent"],["span","TextContent"],["divider","TextContent"],["picker","TextContent"],["option","TextContent"],["clock","TextContent"],["image","Base"],["input","Base"],["chart","Base"],["slider","Base"],["progress","Base"],["text","Text"],["div","Container"],["list","Container"],["list-item","Container"],["list-item-group","Container"],["refresh","Container"],["dialog","Container"],["stack","Container"],["menu","Container"],["select","Container"],["tabs","Container"],["tab-bar","Container"],["tab-content","Container"]])},4294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.beforeCodegen=t.getCustomCompRelativePath=t.getRelativePath=t.prepareCustomCompTagName=t.capitalize=t.getTagName=t.strToBase64=t.getUniqueName=t.getUniqueId=t.removeFromArray=t.getDataName=void 0;const n=r(2891);function o(e){let t=a(e).replace(/[/=+]/g,"");const r=t.length;return r>=4&&(t=t.substring(r/2-2,r/2+2)),t}function a(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");let r="";for(let t=0;t{const t=r.indexOf(e);-1!==t&&r.splice(t,1)})),r},t.getUniqueId=o,t.getUniqueName=function(e){return`${e}_${o(e)}`},t.strToBase64=a;const i=new Map,s=new Map;function p(e){return e[0].toUpperCase()+e.slice(1)}function l(e){const t=(0,n.getInstance)().document.path;if(0===e.size)return;const r=p(t.substring(t.lastIndexOf("/")+1));e.forEach(((e,n)=>{const o=e.length,a=[...e];n===r&&a.push(t);const l=function(e){e.sort();const t=e[0],r=e[e.length-1];let n=0;for(let e=0;e1||n===r)&&(u=p(e[a].substring(l+1).split("/").join("_"))),s.set(e[a],u);const y="/node_modules/";let d=c(e[a],t);e[a].startsWith(y)&&(d=e[a].replace(y,"@"),d=d.replace("src/main/supervisual","src/main/ets")),i.set(u,d)}}))}function c(e,t){const r=e.split("/"),n=t.split("/");let o=0;for(let e=0;e1){const n=p(r[r.length-1]),o=t.get(n);void 0===o?t.set(n,[e.type]):o.push(e.type)}const n=e.children;for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formManager=void 0;const n=r(2891),o=r(5945);t.formManager={removeData(e){this.getFormModel().data.delete(e)},addData(e){e instanceof Map?e.forEach(((e,t)=>{this.getFormModel().data.set(t,e)})):Object.keys(e).forEach((t=>{this.getFormModel().data.set(t,e[t])}))},updateAllData(e){this.getFormModel().data.clear(),this.addData(e)},addAction(e,t,r,n,a){const i=new Map;void 0!==r&&Object.keys(r).forEach((e=>{i.set(e,r[e])}));const s=new Map;void 0!==n&&Object.keys(n).forEach((e=>{s.set(e,n[e])})),this.getFormModel().actions.set(e,new o.FormAction(t,i,s,a))},updateAllActions(e){this.getFormModel().actions.clear(),e.forEach(((e,t)=>{const r=void 0===e.params?e.params:this.objectToMap(e.params),n=void 0===e.want?e.want:this.objectToMap(e.want),a=new o.FormAction(e.actionType,r,n);this.getFormModel().actions.set(t,a)}))},removeAction(e){this.getFormModel().actions.delete(e)},addActionParams(e,t){var r,n;const a=null!==(r=this.getFormModel().actions.get(e))&&void 0!==r?r:new o.FormAction(e),i=null!==(n=a.params)&&void 0!==n?n:new Map;Object.keys(t).forEach((e=>{i.set(e,t[e])})),a.params=i},removeActionParam(e,t){var r;const n=this.getFormModel().actions.get(e);null===(r=null==n?void 0:n.params)||void 0===r||r.delete(t)},getFormModel:()=>(0,n.getInstance)().formData,codegenToJson:function(){const e=(0,n.getInstance)().formData,t=this.mapToObject(e.data),r={actions:{},data:{}};return r.data=t,e.actions.forEach(((e,t)=>{r.actions[t]={},r.actions[t].action=e.action,e.params instanceof Map&&e.params.size>0&&(r.actions[t].params=this.mapToObject(e.params)),e.want instanceof Map&&e.want.size>0&&(r.actions[t].abilityName=e.abilityName,r.actions[t].want=this.mapToObject(e.want))})),JSON.stringify(r,null,4)},clear(){(0,n.getInstance)().formData.data.clear(),(0,n.getInstance)().formData.actions.clear()},mapToObject:e=>void 0===e?{}:Array.from(e.entries()).reduce(((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r})),{}),objectToMap(e){const t=new Map;return Object.keys(e).forEach(((r,n)=>{t.set(r,e[r])})),t}}},5945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormAction=t.FormModel=void 0,t.FormModel=class{constructor(){this.data=new Map,this.actions=new Map}},t.FormAction=class{constructor(e,t,r,n){this.action=e,this.abilityName=n,this.want=r,this.params=t}}},1509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeForVersion1=t.rootToVisualContent=t.visualToRootContent=t.serializeForVersion1=void 0;const n=r(2891),o=r(1933),a=r(7571),i=r(9282),s=r(5945),p=r(7977),l=new Map;function c(e){l.set("textMap",new Map);const t=u(null!=e?e:(0,n.getInstance)().visualModel);return JSON.stringify({VisualVersion:"1",content:JSON.stringify(t),extraData:JSON.stringify(f(l))})}function u(e){const t=Array.from(e.property).filter((t=>(0,a.isAttribute)(t[0],e.type)));t.push(["id",e.id]);const r=Array.from(e.property).filter((t=>(0,a.isStyle)(t[0],e.type)));let n=i.TagTypeMap.get(e.type);void 0===n&&(n="Base");let o=e.property.has("content")?e.property.get("content"):[];if(e.children.length>0){if("string"==typeof o){const t=l.get("textMap");t instanceof Map&&t.set(e.id,o)}o=e.children.map((e=>u(e)))}return{id:e.id,tagName:e.type,attributes:t,idStyle:r,type:n,content:o}}function y(e,t){let r;if(t instanceof Map){const n=t.get("textMap");n instanceof Map&&(r=n.get(e.id))}const n=new o.VisualModel({id:e.id,type:e.tagName,property:new Map([...e.attributes,...e.idStyle])});return"string"==typeof r&&n.property.set("content",r),n.property.delete("id"),"string"==typeof e.content&&n.property.set("content",e.content),Array.isArray(e.content)&&(n.children=e.content.map((e=>y(e,t)))),n}function d(e){if(e instanceof Array&&e.length>0&&"$$map"===e[0]){e.shift();const t=new Map;for(const[r,n]of e)t.set(r,d(n));return t}return e}function f(e){if(e instanceof Map){const t=["$$map"];for(const[r,n]of e)t.push([r,f(n)]);return t}return e}t.serializeForVersion1=c,t.visualToRootContent=function(e){try{return c(JSON.parse(e,p.reviver).visualModel)}catch(e){console.error("convert visual model to root model failed")}return e},t.rootToVisualContent=function(e){const t=JSON.parse(e),r=JSON.parse(t.content);let n='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(n=JSON.parse(t.extraData));const o=y(r,d(n));return o.property.has("flex-direction")||o.property.set("flex-direction","column"),JSON.stringify({document:{VisualVersion:"12",type:"FA"},visualModel:o,formData:new s.FormModel},p.replacer)},t.deserializeForVersion1=function(e){try{const t=JSON.parse(e),r=JSON.parse(t.content);let o='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(o=JSON.parse(t.extraData)),(0,n.getInstance)().visualModel=y(r,d(o)),(0,n.getInstance)().visualModel.property.has("flex-direction")||(0,n.getInstance)().visualModel.property.set("flex-direction","column")}catch(e){console.error("convert error")}}},2891:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setInstance=t.getInstance=t.setVisualPath=t.clearCustomInstance=t.setCustomInstance=t.getInstanceTemplate=t.getCustomInstance=void 0;const n=r(1933),o=r(5945),a=r(904),i={document:{VisualVersion:"12",type:"FA",custom:!1,path:""},visualModel:new n.VisualModel({type:"div",id:"wrapper"}),formData:new o.FormModel},s=new Map;t.getCustomInstance=function(){return s},t.getInstanceTemplate=function(e){return{document:{VisualVersion:"12",type:"ETS",custom:e,path:"&path"},visualModel:new n.VisualModel({type:"column",id:"wrapper"}),imgData:""}},t.setCustomInstance=function(e,t){var r;const o={path:"",document:{VisualVersion:"",type:"",custom:!0},visualModel:new n.VisualModel({type:"",id:""}),methods:[],property:[],imgData:"",originType:[]};o.path=e;for(const e in o)Object.prototype.hasOwnProperty.call(t,e)&&(o[e]=t[e]);o.visualModel=null!==(r=o.visualModel.children[0])&&void 0!==r?r:new n.VisualModel({type:"text"}),s.set(e,o)},t.clearCustomInstance=function(){s.clear()},t.setVisualPath=function(e){i.document.path=e},t.getInstance=function(){return i},t.setInstance=function(e){var t,r,n,o;for(const t in i)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);const s=i.document.type;void 0===i.document.custom&&(i.document.custom=!1),null!==((null!==(r=(null===(t=e.customData)||void 0===t?void 0:t.property.size)>0)&&void 0!==r?r:null)||(null!==(o=(null===(n=e.customData)||void 0===n?void 0:n.event.size)>0)&&void 0!==o?o:null))&&(i.customData=e.customData),(0,a.setDomain)("ETS"===s?a.Domain.ETS:"FORM"===s?a.Domain.FORM:a.Domain.FA)}},7977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviver=t.replacer=t.serializeSketchPage=t.serializeCustom=t.deserializeCustom=t.deserialize=t.serialize=void 0;const n=r(1933),o=r(2891),a=r(1509);function i(e,t){if(t instanceof Map)return{dataType:"Map",value:Object.fromEntries(t.entries())};if(t instanceof Set)return{dataType:"Set",value:Array.from(t.entries())};if(t instanceof n.VisualModel){const e=new n.VisualModel({type:"none"}),r={};for(const n in e)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return{dataType:"VisualModel",value:r}}return t}function s(e,t){if("object"==typeof t&&null!=t){if("Map"===t.dataType)return new Map(Object.entries(t.value));if("Set"===t.dataType)return new Set(t.value);if("VisualModel"===t.dataType){const e=new n.VisualModel({type:""});Object.assign(e,t.value),t=e}}return t}t.serialize=function(e,t){return 1===e?(0,a.serializeForVersion1)(t):JSON.stringify(null!=t?t:(0,o.getInstance)(),i,4)},t.deserialize=function(e){if("1"===JSON.parse(e).VisualVersion)return(0,a.deserializeForVersion1)(e);const t=JSON.parse(e,s);(0,o.setInstance)(t)},t.deserializeCustom=function(e,t){const r=JSON.parse(t,s);(0,o.setCustomInstance)(e,r)},t.serializeCustom=function(e){const t=(0,o.getInstanceTemplate)(!0);return t.visualModel.property=new Map([["width","100%"],["height","100%"]]),t.visualModel.children.push(e),JSON.stringify(t,i,4)},t.serializeSketchPage=function(e){const t=(0,o.getInstanceTemplate)(!1);return t.visualModel=e,JSON.stringify(t,i,4)},t.replacer=i,t.reviver=s},1933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VisualModel=void 0;const r="-visual";t.VisualModel=class{constructor(e){if(this.propertyStorage=void 0,this.dynamicPropertyStorage=void 0,this.mediaProperty=void 0,this.dynamicMediaProperty=void 0,this.mediaPropertyStorage=void 0,this.dynamicMediaPropertyStorage=void 0,this.property=void 0!==e.property?e.property:new Map,this.dynamicProperty=void 0!==e.dynamicProperty?e.dynamicProperty:new Map,this.children=void 0!==e.children?e.children:[],"wrapper"===e.type)return this.id="wrapper",void(this.type="div");e.type.endsWith(r)&&(e.type=e.type.substring(0,e.type.length-r.length)),this.id=void 0!==e.id?e.id:"",this.type=e.type}getProperty(e){const t=this.dynamicProperty.get(e);return void 0!==t&&""!==t?t:this.property.get(e)}hasMediaProperty(e){if(void 0!==this.mediaProperty)for(const[,t]of this.mediaProperty)if(null==t?void 0:t.has(e))return!0;if(void 0!==this.dynamicMediaProperty)for(const[,t]of this.dynamicMediaProperty)if(null==t?void 0:t.has(e))return!0;return!1}hasProperty(e){return this.dynamicProperty.has(e)||this.property.has(e)}accept(e){return e.visit(this)}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";var e=n;Object.defineProperty(e,"__esModule",{value:!0});const t=r(3784),o=r(2891),a=r(7977),i=r(8844),s=r(1055),p=r(3207),l=r(8413),c=r(4435),u=r(6486),y=r(4294),d={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""};function f(e,r){var n;try{(0,a.deserialize)(e);const t=(0,o.getInstance)().document.VisualVersion,n=/^([1-9]+[0-9]*)$/;if(void 0===t)r.errorType="versionError";else{const e=t.match(n);(null===e||parseInt(e[1])>12)&&(r.errorType="versionError")}}catch(e){r.errorType="fileError"}""!==r.errorType&&(r.errorMessage=null!==(n=t.errorMap.get(r.errorType))&&void 0!==n?n:"Codegen visual file failed")}e.genHmlAndCss=function(e){const r={hmlCss:{hml:"",css:"",json:""},errorType:"",errorMessage:""};if(f(e,r),""!==r.errorType)return r.hmlCss.hml="",r.hmlCss.css="",r;try{const e=function(e){const t={hml:"",css:"",json:""},r=new i.HMLBridge,n=e.accept(r),o=(0,s.genFAHML)(n);t.hml=r.getErrorCount()>0?"error":o;const a=new i.CSSBridge,p=e.accept(a),l=(0,s.genFACSS)(p);return t.css=a.getErrorCount()>0?"error":l,t}((0,o.getInstance)().visualModel);"error"!==e.hml&&"error"!==e.css||(r.errorType="codegenError"),r.hmlCss=e,"FORM"===(0,o.getInstance)().document.type&&(r.hmlCss.json=p.formManager.codegenToJson())}catch(e){r.errorType="modelError"}return""!==r.errorType&&(r.errorMessage=t.errorMap.get(r.errorType),r.hmlCss.hml="",r.hmlCss.css=""),r},e.genETS=function(e){var r;const n={ets:(0,u.cloneDeep)(d),errorType:"",errorMessage:""};if(f(e,n),""!==n.errorType)return n.ets=(0,u.cloneDeep)(d),n;try{let e=(0,o.getInstance)().visualModel;if((0,o.getInstance)().document.custom&&(e=e.children[0],void 0===e))return n;(0,y.beforeCodegen)(e);const t=function(e){const t=new l.ETSBridge,r=e.accept(t),n=(new c.StringWriter).genETS(r);return t.getErrorCount()>0?"error":n}(e);"error"===t&&(n.errorType="codegenError"),n.ets=t}catch(e){n.errorType="modelError"}return""!==n.errorType&&(n.errorMessage=null!==(r=t.errorMap.get(n.errorType))&&void 0!==r?r:"Codegen visual file failed",n.ets=(0,u.cloneDeep)(d)),n}})();var o=exports;for(var a in n)o[a]=n[a];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); \ No newline at end of file -- Gitee From 28f0b948f8b69bcba4f78acc63d0c6cccf1a8201 Mon Sep 17 00:00:00 2001 From: bojiang Date: Tue, 29 Nov 2022 20:50:53 +0800 Subject: [PATCH 169/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: Ie87d65d616c29d9dd0902a3972bfb5247516caf2 --- compiler/src/process_custom_component.ts | 25 +++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 6db75a2..85b6ba3 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -194,15 +194,34 @@ function addCustomComponentStatements(node: ts.ExpressionStatement, newStatement ts.factory.updateExpressionStatement(node, createViewCreate(newNode)), ts.factory.createObjectLiteralExpression(props, true), name)); } else { - newStatements.push(createCustomComponent(node, newNode, isGlobalBuilder)); + newStatements.push(createCustomComponent(node, newNode, name, isGlobalBuilder)); } } -function createCustomComponent(node: ts.ExpressionStatement, newNode: ts.NewExpression, +function createChildElmtId(node: ts.ExpressionStatement, name: string): ts.PropertyAssignment[] { + const propsAndObjectLinks: string[] = []; + const childParam: ts.PropertyAssignment[] = []; + if (propCollection.get(name)) { + propsAndObjectLinks.push(...propCollection.get(name)); + } + if (objectLinkCollection.get(name)) { + propsAndObjectLinks.push(...objectLinkCollection.get(name)); + } + if (node.expression.arguments[0].properties) { + node.expression.arguments[0].properties.forEach(item => { + if (item.name && item.name.escapedText.toString() && propsAndObjectLinks.includes(item.name.escapedText)) { + childParam.push(item); + } + }) + } + return childParam; +} + +function createCustomComponent(node: ts.ExpressionStatement, newNode: ts.NewExpression, name: string, isGlobalBuilder: boolean = false): ts.Block { let componentParameter: ts.ObjectLiteralExpression; if (node.expression && node.expression.arguments && node.expression.arguments.length) { - componentParameter = node.expression.arguments[0]; + componentParameter = ts.factory.createObjectLiteralExpression(createChildElmtId(node, name), true); } else { componentParameter = ts.factory.createObjectLiteralExpression([], false); } -- Gitee From 0e3af6f09a517ae76ae3a093f944e1aafb56bf48 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 29 Nov 2022 17:54:14 +0800 Subject: [PATCH 170/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit foreach id机制提醒 Signed-off-by: houhaoyu Change-Id: Id3d18e0110890aff4276785c10fcc4473a87035e --- compiler/src/pre_define.ts | 3 + compiler/src/process_component_build.ts | 216 +++++++++++++++++++++++- 2 files changed, 217 insertions(+), 2 deletions(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 271ea74..437e41e 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -360,3 +360,6 @@ export const CARD_LOG_TYPE_COMPONENTS = 2; export const CARD_LOG_TYPE_IMPORT = 3; export const CALL = 'call'; +export const ARRAY = 'Array'; +export const JSON = 'JSON'; +export const STRINGIFY = 'stringify'; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 8445ed3..eb8a0d2 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -98,7 +98,10 @@ import { FALSE, HEADER, FOOTER, - CALL + CALL, + ARRAY, + JSON, + STRINGIFY } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -133,7 +136,11 @@ import { createFunction, validatorCard } from './utils'; -import { partialUpdateConfig, projectConfig } from '../main'; +import { + partialUpdateConfig, + projectConfig, + globalProgram +} from '../main'; import { transformLog, contextGlobal } from './process_ui_syntax'; import { props } from './compile_info'; import { CUSTOM_COMPONENT } from '../lib/pre_define'; @@ -316,6 +323,9 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme break; case ComponentType.forEachComponent: parent = undefined; + if (partialUpdateConfig.strictCheck && partialUpdateConfig.partialUpdateMode) { + checkoutForEachSameId(item, log); + } if (!partialUpdateConfig.partialUpdateMode) { processForEachComponent(item, newStatements, log, isBuilder, isGlobalBuilder); } else { @@ -2239,3 +2249,205 @@ function createIsLazyWithValue(value: boolean): ts.VariableStatement { undefined, undefined, ts.factory.createFalse())], ts.NodeFlags.Const)); } } + +enum ReturnType { + notDefined, + notCompatible, + simple, + complex +} + +function checkoutForEachSameId(node: ts.ExpressionStatement, log: LogInfo[]): void { + if (node.expression && ts.isCallExpression(node.expression) && node.expression.arguments && + node.expression.arguments.length) { + let targetArray: ts.Node = node.expression.arguments[0]; + if (globalProgram.program && node.expression.arguments.length === 3 && + !isReturnStringify(node.expression.arguments[2], log)) { + let TypeChecker: ts.TypeChecker = globalProgram.program.getTypeChecker(true) + judgeTargetArrayType(targetArray, log, TypeChecker); + } + } +} + +function judgeTargetArrayType(targetArray: ts.Node, log: LogInfo[], TypeChecker: ts.TypeChecker): void { + if (ts.isIdentifier(targetArray) && TypeChecker.getSymbolAtLocation(targetArray)) { + let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(targetArray).declarations; + if (declarations && declarations.length) { + let declaration: ts.Node = declarations[0]; + if (ts.isVariableDeclaration(declaration)) { + judgeDeclaration(declaration, targetArray, log); + } + } + } else if (ts.isPropertyAccessExpression(targetArray) && targetArray.expression && + targetArray.expression.kind === ts.SyntaxKind.ThisKeyword && TypeChecker.getSymbolAtLocation(targetArray)) { + let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(targetArray).declarations; + if (declarations && declarations.length) { + let declaration: ts.Node = declarations[0]; + if (ts.isPropertyDeclaration(declaration)) { + judgeDeclaration(declaration, targetArray, log); + } + } + } else if (ts.isCallExpression(targetArray) && targetArray.expression && + ts.isIdentifier(targetArray.expression) && TypeChecker.getSymbolAtLocation(targetArray.expression)) { + let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(targetArray.expression).declarations; + if (declarations && declarations.length) { + let declaration: ts.Node = declarations[0]; + if (ts.isFunctionDeclaration(declaration)) { + judgeDeclaration(declaration, targetArray, log); + } + } + } else if (ts.isCallExpression(targetArray) && targetArray.expression && + ts.isPropertyAccessExpression(targetArray.expression) && targetArray.expression.expression && + targetArray.expression.expression.kind === ts.SyntaxKind.ThisKeyword && + TypeChecker.getSymbolAtLocation(targetArray.expression)) { + let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(targetArray.expression).declarations; + if (declarations && declarations.length) { + let declaration: ts.Node = declarations[0]; + if (ts.isMethodDeclaration(declaration)) { + judgeDeclaration(declaration, targetArray, log); + } + } + } else { + log.push({ + type: LogType.WARN, + message: `If the type of array's each item is not a simple type, ` + + `use JSON.stringify to serialize the key generator in 3rd parameter of ForEach Component`, + pos: targetArray.getStart(), + }) + } +} + +function isReturnStringify(node: ts.Node, log: LogInfo[]): boolean { + return functionWithBlock(node, log) || functionWithoutBlock(node, log); +} + +function hasJsonStringify(node: ts.Node): boolean { + return ts.isPropertyAccessExpression(node) && node.expression && ts.isIdentifier(node.expression) && + node.expression.escapedText.toString() === JSON && node.name && ts.isIdentifier(node.name) && + node.name.escapedText.toString() === STRINGIFY; +} + +function functionWithoutBlock(node: ts.Node, log: LogInfo[]): boolean { + if (ts.isArrowFunction(node)) { + if (judgeReturnType(node.type) === ReturnType.notDefined) { + log.push({ + type: LogType.WARN, + message: "Better allocate a type of key generator function", + pos: node.getStart(), + }) + } else if (judgeReturnType(node.type) === ReturnType.complex) { + log.push({ + type: LogType.WARN, + message: "Return complex type, please use JSON.stringify to serialize it", + pos: node.getStart(), + }) + } + } + return ts.isArrowFunction(node) && node.body && ts.isCallExpression(node.body) && + node.body.expression && hasJsonStringify(node.body.expression); +} + +function functionWithBlock(node: ts.Node, log: LogInfo[]): boolean { + if (ts.isArrowFunction(node) || ts.isFunctionExpression(node)) { + if (judgeReturnType(node.type) === ReturnType.notDefined) { + let useStringify = []; + if (node.body && ts.isBlock(node.body)) { + ts.forEachChild(node, (node)=>{traverseReturnStatement(node, useStringify)}) + } + log.push({ + type: LogType.WARN, + message: "Better allocate a type of key generator function", + pos: node.getStart(), + }) + return useStringify.length && useStringify[useStringify.length-1]; + } else if (judgeReturnType(node.type) === ReturnType.complex) { + log.push({ + type: LogType.WARN, + message: "Return complex type, please use JSON.stringify to serialize it", + pos: node.getStart(), + }) + return false; + } else { + return true; + } + } +} + +function traverseReturnStatement(childNode, useStringify): void { + if (useStringify.length && !useStringify[useStringify.length-1]) { + return; + } + if (ts.isReturnStatement(childNode) && childNode.expression) { + if (childNode.expression.expression && hasJsonStringify(childNode.expression.expression)) { + useStringify.push(true); + } else { + useStringify.push(false); + } + } + ts.forEachChild(childNode, (childNode)=>{traverseReturnStatement(childNode, useStringify)}) +} + +function judgeReturnType(type: ts.TypeNode): ReturnType { + if (type) { + return judgeType(type); + } else { + return ReturnType.notDefined; + } +} + +function judgeDeclaration(declaration: ts.Node, targetArray: ts.Node, log: LogInfo[]): void { + switch (judgeArrayType(declaration.type)) { + case ReturnType.notDefined: + log.push({ + type: LogType.WARN, + message: "Variable/function which used for ForEach component's 1st parameter should allocate a type", + pos: declaration.getStart(), + }) + break; + case ReturnType.notCompatible: + log.push({ + type: LogType.WARN, + message: "The first parameter in ForEach component should be an array", + pos: targetArray.getStart(), + }) + break; + case ReturnType.complex: + log.push({ + type: LogType.WARN, + message: "if key generator(return type of ForEach's 3rd parameter) is a complex type, " + + "should use JSON.stringify to serialize it", + pos: targetArray.getStart(), + }) + break; + } +} + +function judgeArrayType(type: ts.TypeNode): ReturnType { + if (type) { + if (ts.isTypeReferenceNode(type) && type.typeName && ts.isIdentifier(type.typeName) && + type.typeName.escapedText.toString() === ARRAY && type.typeArguments && type.typeArguments.length) { + return judgeType(type.typeArguments[0]); + } else if (ts.isArrayTypeNode(type) && type.elementType) { + return judgeType(type.elementType); + } else { + return ReturnType.notCompatible; + } + } else { + return ReturnType.notDefined; + } +} + +function judgeType(type: ts.TypeNode): ReturnType { + switch (type.kind) { + case ts.SyntaxKind.StringKeyword: + case ts.SyntaxKind.NumberKeyword: + case ts.SyntaxKind.BooleanKeyword: + case ts.SyntaxKind.SymbolKeyword: + case ts.SyntaxKind.BigIntKeyword: + case ts.SyntaxKind.UndefinedKeyword: + case ts.SyntaxKind.NullKeyword: + return ReturnType.simple; + default: + return ReturnType.complex; + } +} -- Gitee From 96ac33a8a924585065460a54cf3cc306f14ec351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Tue, 29 Nov 2022 22:03:04 +0800 Subject: [PATCH 171/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_build.ts | 50 ++++++++++++++++++++++-- compiler/src/process_component_member.ts | 8 ++-- compiler/src/process_custom_component.ts | 8 ++-- compiler/src/utils.ts | 46 ---------------------- 4 files changed, 56 insertions(+), 56 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 1c2f627..ce52a1c 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -98,7 +98,8 @@ import { FALSE, HEADER, FOOTER, - CALL + CALL, + CREATE_BIND_COMPONENT } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -131,13 +132,11 @@ import { LogType, LogInfo, componentInfo, - createFunction, validatorCard } from './utils'; import { partialUpdateConfig, projectConfig } from '../main'; import { transformLog, contextGlobal } from './process_ui_syntax'; import { props } from './compile_info'; -import { CUSTOM_COMPONENT } from '../lib/pre_define'; export function processComponentBuild(node: ts.MethodDeclaration, log: LogInfo[]): ts.MethodDeclaration { @@ -2274,3 +2273,48 @@ function createIsLazyWithValue(value: boolean): ts.VariableStatement { undefined, undefined, ts.factory.createFalse())], ts.NodeFlags.Const)); } } + +export function createFunction(node: ts.Identifier, attrNode: ts.Identifier, + argumentsArr: ts.NodeArray): ts.CallExpression { + if (argumentsArr && argumentsArr.length) { + if (checkCreateArgumentBuilder(node, attrNode)) { + argumentsArr = transformBuilder(argumentsArr); + } + } else { + //@ts-ignore + argumentsArr = []; + } + return ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + node, + attrNode + ), + undefined, + argumentsArr + ); +} + +function checkCreateArgumentBuilder(node: ts.Identifier, attrNode: ts.Identifier): boolean { + if (attrNode.escapedText.toString() === COMPONENT_CREATE_FUNCTION && + CREATE_BIND_COMPONENT.has(node.escapedText.toString())) { + return true; + } + return false; +} + +function transformBuilder(argumentsArr: ts.NodeArray): ts.NodeArray { + const newArguments: ts.Expression[] = []; + argumentsArr.forEach((argument: ts.Expression) => { + newArguments.push(parseCreateParameterBuilder(argument)); + }) + //@ts-ignore + return newArguments; +} + +function parseCreateParameterBuilder(argument: ts.Expression):ts.Expression { + if (ts.isObjectLiteralExpression(argument)) { + return processObjectPropertyBuilder(argument); + } else { + return argument; + } +} \ No newline at end of file diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index d574838..d1da413 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -87,8 +87,7 @@ import { updateConstructor } from './process_component_constructor'; import { LogType, LogInfo, - componentInfo, - createFunction + componentInfo } from './utils'; import { createReference, @@ -100,7 +99,10 @@ import { projectConfig, partialUpdateConfig } from '../main'; -import { parentConditionalExpression } from './process_component_build' +import { + parentConditionalExpression, + createFunction +} from './process_component_build' export type ControllerType = { hasController: boolean diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 6db75a2..999725f 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -70,13 +70,13 @@ import { import { LogType, LogInfo, - componentInfo, - createFunction + componentInfo } from './utils'; import { bindComponentAttr, parentConditionalExpression, - createComponentCreationStatement + createComponentCreationStatement, + createFunction } from './process_component_build'; import { partialUpdateConfig } from '../main'; @@ -610,7 +610,7 @@ function validateIllegalInitFromParent(node: ts.ObjectLiteralElementLike, proper curPropertyKind: string, parentPropertyName: string, parentPropertyKind: string, log: LogInfo[]): void { log.push({ - type: LogType.ERROR, + type: curPropertyKind === COMPONENT_STATE_DECORATOR ? LogType.WARN : LogType.ERROR, message: `The ${parentPropertyKind} property '${parentPropertyName}' cannot be assigned to ` + `the ${curPropertyKind} property '${propertyName}'.`, // @ts-ignore diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 80947c4..8564d80 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -49,7 +49,6 @@ import { } from './pre_define'; import { minify, MinifyOutput } from 'terser'; import { resourceFileName } from './process_ui_syntax'; -import { processObjectPropertyBuilder } from './process_component_build'; export enum LogType { ERROR = 'ERROR', @@ -196,51 +195,6 @@ export function readFile(dir: string, utFiles: string[]) { } } -export function createFunction(node: ts.Identifier, attrNode: ts.Identifier, - argumentsArr: ts.NodeArray): ts.CallExpression { - if (argumentsArr && argumentsArr.length) { - if (checkCreateArgumentBuilder(node, attrNode)) { - argumentsArr = transformBuilder(argumentsArr); - } - } else { - //@ts-ignore - argumentsArr = []; - } - return ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression( - node, - attrNode - ), - undefined, - argumentsArr - ); -} - -function checkCreateArgumentBuilder(node: ts.Identifier, attrNode: ts.Identifier): boolean { - if (attrNode.escapedText.toString() === COMPONENT_CREATE_FUNCTION && - CREATE_BIND_COMPONENT.has(node.escapedText.toString())) { - return true; - } - return false; -} - -function transformBuilder(argumentsArr: ts.NodeArray): ts.NodeArray { - const newArguments: ts.Expression[] = []; - argumentsArr.forEach((argument: ts.Expression) => { - newArguments.push(parseCreateParameterBuilder(argument)); - }) - //@ts-ignore - return newArguments; -} - -function parseCreateParameterBuilder(argument: ts.Expression):ts.Expression { - if (ts.isObjectLiteralExpression(argument)) { - return processObjectPropertyBuilder(argument); - } else { - return argument; - } -} - export function circularFile(inputPath: string, outputPath: string): void { if (!inputPath || !outputPath) { return; -- Gitee From cb4234ac207f4bfcec54cab37a8db88ba4aa91d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Tue, 29 Nov 2022 14:09:59 +0000 Subject: [PATCH 172/379] update compiler/src/process_custom_component.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 999725f..05dfd7c 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -610,7 +610,7 @@ function validateIllegalInitFromParent(node: ts.ObjectLiteralElementLike, proper curPropertyKind: string, parentPropertyName: string, parentPropertyKind: string, log: LogInfo[]): void { log.push({ - type: curPropertyKind === COMPONENT_STATE_DECORATOR ? LogType.WARN : LogType.ERROR, + type: curPropertyKind === COMPONENT_PROP_DECORATOR ? LogType.WARN : LogType.ERROR, message: `The ${parentPropertyKind} property '${parentPropertyName}' cannot be assigned to ` + `the ${curPropertyKind} property '${propertyName}'.`, // @ts-ignore -- Gitee From c3e49d9172cb90ddc9e1c4b64871da28a3838ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Tue, 29 Nov 2022 14:28:00 +0000 Subject: [PATCH 173/379] update compiler/src/process_custom_component.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 05dfd7c..9b754e8 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -80,8 +80,8 @@ import { } from './process_component_build'; import { partialUpdateConfig } from '../main'; -const localArray: string[] = [...observedPropertyDecorators, COMPONENT_NON_DECORATOR, - COMPONENT_OBJECT_LINK_DECORATOR]; +const localArray: string[] = [COMPONENT_STATE_DECORATOR, COMPONENT_PROVIDE_DECORATOR, + COMPONENT_NON_DECORATOR, COMPONENT_OBJECT_LINK_DECORATOR]; const decoractorMap: Map>> = new Map( [[COMPONENT_STATE_DECORATOR, stateCollection], -- Gitee From 03bef89a7c5912f1039d97aa81e234a1537b1537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Tue, 29 Nov 2022 14:29:01 +0000 Subject: [PATCH 174/379] update compiler/src/process_custom_component.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 9b754e8..8f9166c 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -63,7 +63,6 @@ import { import { propAndLinkDecorators, curPropMap, - observedPropertyDecorators, createViewCreate, createCustomComponentNewExpression } from './process_component_member'; -- Gitee From 3f7d00171ee607b0474daa412760679f41990b55 Mon Sep 17 00:00:00 2001 From: hufeng Date: Tue, 29 Nov 2022 14:55:59 +0800 Subject: [PATCH 175/379] Adjust sourceMap info Signed-off-by: hufeng Change-Id: If6555ca90af5e1843248fbf46bf112f82c2d828b --- compiler/src/result_process.ts | 5 +++-- compiler/src/utils.ts | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/compiler/src/result_process.ts b/compiler/src/result_process.ts index e935826..094ae07 100644 --- a/compiler/src/result_process.ts +++ b/compiler/src/result_process.ts @@ -15,7 +15,7 @@ import ts from 'typescript'; -import { BUILD_OFF, ESMODULE } from './pre_define'; +import { BUILD_OFF, ESMODULE, JSBUNDLE } from './pre_define'; import { resetLog, transformLog @@ -64,7 +64,8 @@ module.exports = function resultProcess(source: string, map: any): void { resetLog(); } } - if ([abilityConfig.abilityEntryFile].concat(abilityConfig.projectAbilityPath).concat(abilityConfig.testRunnerFile).includes(this.resourcePath)) { + if (projectConfig.compileMode == JSBUNDLE && + [abilityConfig.abilityEntryFile].concat(abilityConfig.projectAbilityPath).concat(abilityConfig.testRunnerFile).includes(this.resourcePath)) { source = source.replace(/exports\.default/, 'globalThis.exports.default'); } diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 097b06d..442f2f8 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -501,7 +501,10 @@ export function generateSourceFilesToTemporary(sourcePath: string, sourceContent let sourceMapFile: string = genSourceMapFileName(jsFilePath); if (sourceMapFile.length > 0 && projectConfig.buildArkMode === 'debug') { let source = toUnixPath(sourcePath).replace(toUnixPath(projectConfig.projectRootPath) + '/', ''); - sourceMap['sources'] = [source]; + // adjust sourceMap info + sourceMap.sources = [source]; + sourceMap.file = path.basename(sourceMap.file); + delete sourceMap.sourcesContent; newSourceMaps[source] = sourceMap; } // replace relative moduleSpecifier with ohmURl -- Gitee From 1d2d6b2797a2d253133ff7f7000a5ff7ad403aca Mon Sep 17 00:00:00 2001 From: hufeng Date: Wed, 30 Nov 2022 11:42:15 +0800 Subject: [PATCH 176/379] Revert the recordName with bundlename_modulename Signed-off-by: hufeng Change-Id: I74f7e4ee689a86c8592e10fe1a953297e0e7ffca --- compiler/src/resolve_ohm_url.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/resolve_ohm_url.ts b/compiler/src/resolve_ohm_url.ts index 447f1a2..d4129c1 100644 --- a/compiler/src/resolve_ohm_url.ts +++ b/compiler/src/resolve_ohm_url.ts @@ -95,6 +95,7 @@ export function getOhmUrlByFilepath(filePath: string): string { const REG_PROJECT_SRC: RegExp = /(\S+)\/src\/(?:main|ohosTest)\/(ets|js)\/(\S+)/; const packageInfo: string[] = getPackageInfo(projectConfig.aceModuleJsonPath); + const bundleName: string = packageInfo[0]; const moduleName: string = packageInfo[1]; const moduleRootPath: string = toUnixPath(projectConfig.modulePathMap[moduleName]); const projectRootPath: string = toUnixPath(projectConfig.projectRootPath); @@ -105,7 +106,7 @@ export function getOhmUrlByFilepath(filePath: string): string { const result: RegExpMatchArray | null = projectFilePath.match(REG_PROJECT_SRC); if (result && result[1].indexOf(NODE_MODULES) === -1) { - return `${result[2]}/${result[3]}`; + return `${bundleName}/${moduleName}/${result[2]}/${result[3]}`; } if (projectFilePath.indexOf(NODE_MODULES) !== -1) { -- Gitee From 88791ef8cd09765c2633f739d4fc28b6bcc8727e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Wed, 30 Nov 2022 08:09:53 +0000 Subject: [PATCH 177/379] update compiler/src/process_component_build.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 6771a68..270c054 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -99,7 +99,7 @@ import { HEADER, FOOTER, CALL, - CREATE_BIND_COMPONENT + CREATE_BIND_COMPONENT, ARRAY, JSON, STRINGIFY -- Gitee From 3eb4e671584d521ab106f1f78ae71e88412f53c6 Mon Sep 17 00:00:00 2001 From: hufeng Date: Thu, 17 Nov 2022 03:27:14 +0000 Subject: [PATCH 178/379] Set sourceFile as relative when compiling jsbundle Signed-off-by: hufeng Change-Id: I3471411c50c6fc2caeca9b87b238d7392b3bc702 --- compiler/src/gen_abc.ts | 7 +++---- compiler/src/gen_abc_plugin.ts | 14 +++++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/compiler/src/gen_abc.ts b/compiler/src/gen_abc.ts index cbbb185..ecbe0d8 100644 --- a/compiler/src/gen_abc.ts +++ b/compiler/src/gen_abc.ts @@ -19,9 +19,7 @@ import cluster from 'cluster'; import { logger } from './compile_info'; import { SUCCESS, - FAIL, - TS2ABC, - ES2ABC + FAIL } from './pre_define'; const red: string = '\u001b[31m'; @@ -33,7 +31,8 @@ function js2abcByWorkers(jsonInput: string, cmd: string): Promise { const input: string = inputPaths[i].path.replace(/\.temp\.js$/, "_.js"); const cacheOutputPath: string = inputPaths[i].cacheOutputPath; const cacheAbcFilePath: string = cacheOutputPath.replace(/\.temp\.js$/, ".abc"); - const singleCmd: any = `${cmd} "${cacheOutputPath}" -o "${cacheAbcFilePath}" --source-file "${input}"`; + const sourceFile: string = inputPaths[i].sourceFile; + const singleCmd: any = `${cmd} "${cacheOutputPath}" -o "${cacheAbcFilePath}" --source-file "${sourceFile}"`; logger.debug('gen abc cmd is: ', singleCmd, ' ,file size is:', inputPaths[i].size, ' byte'); try { childProcess.execSync(singleCmd); diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 094f55c..858eeb2 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -93,7 +93,8 @@ let compileCount: number = 0; interface File { path: string, size: number, - cacheOutputPath: string + cacheOutputPath: string, + sourceFile: string } let intermediateJsBundle: Array = []; let fileterIntermediateJsBundle: Array = []; @@ -548,9 +549,16 @@ function writeFileSync(inputString: string, buildPath: string, keyPath: string, fs.writeFileSync(cacheOutputPath, inputString); if (fs.existsSync(cacheOutputPath)) { const fileSize: any = fs.statSync(cacheOutputPath).size; + let sourceFile: string = output.replace(/\.temp\.js$/, "_.js"); + if (!isDebug && projectConfig.projectRootPath) { + sourceFile = toUnixPath(sourceFile.replace(projectConfig.projectRootPath + path.sep, '')); + } else { + sourceFile = toUnixPath(sourceFile); + } output = toUnixPath(output); cacheOutputPath = toUnixPath(cacheOutputPath); - intermediateJsBundle.push({path: output, size: fileSize, cacheOutputPath: cacheOutputPath}); + + intermediateJsBundle.push({path: output, size: fileSize, cacheOutputPath: cacheOutputPath, sourceFile: sourceFile}); } else { logger.debug(red, `ArkTS:ERROR Failed to convert file ${jsBundleFile} to bin. ${output} is lost`, reset); process.exitCode = FAIL; @@ -1287,7 +1295,7 @@ function generateFileOfBundle(inputPaths: File[]): string { const cacheOutputPath: string = info.cacheOutputPath; const recordName: string = 'null_recordName'; const moduleType: string = 'script'; - const sourceFile: string = info.path.replace(/\.temp\.js$/, "_.js"); + const sourceFile: string = info.sourceFile; const abcFilePath: string = cacheOutputPath.replace(/\.temp\.js$/, ".abc"); filesInfo += `${cacheOutputPath};${recordName};${moduleType};${sourceFile};${abcFilePath}\n`; }); -- Gitee From 30447b54484992728f172bbc559a391092c79d48 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Thu, 1 Dec 2022 11:38:21 +0800 Subject: [PATCH 179/379] houhaoyu@huawei.com process exit cide Signed-off-by: houhaoyu Change-Id: If21226d97b88a7d52285e842c4420591a815eab5 --- compiler/src/compile_info.ts | 5 ++- compiler/src/process_component_build.ts | 48 ++++++++++++++----------- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index e88c39c..291a758 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -51,6 +51,7 @@ import { } from './ets_checker'; import { globalProgram, + partialUpdateConfig, projectConfig } from '../main'; import cluster from 'cluster'; @@ -379,7 +380,9 @@ export class ResultStates { if (this.mErrorCount > 0) { resultInfo += `ERROR:${this.mErrorCount}`; result = 'FAIL '; - process.exitCode = 1; + if (!partialUpdateConfig.strictCheck && !partialUpdateConfig.partialUpdateMode) { + process.exitCode = 1; + } } else { result = 'SUCCESS '; } diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 270c054..88bb22c 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1301,31 +1301,39 @@ function processElseStatement(elseStatement: ts.Statement, id: number, function checkHasThisKeyword(node: ts.Statement, log: LogInfo[]): void { if (partialUpdateConfig.strictCheck && partialUpdateConfig.partialUpdateMode && - node && node.getText() && node.getText().indexOf(THIS) >= 0) { - const currentObservedPropertyCollection: Set = getObservedPropertyCollection( - componentCollection.currentClassName); - let hasObservedKeyword: boolean = false; - const realKeywords: Set = new Set(); - const traverse: Function = (node: ts.Node) => { - if (node && ts.isPropertyAccessExpression(node) && node.expression && - node.expression.kind === ts.SyntaxKind.ThisKeyword) { - const keyword: string = node.name.escapedText.toString(); - if (currentObservedPropertyCollection.has(keyword)) { - hasObservedKeyword = true; - return; - } else { - realKeywords.add(keyword); + node && node.getText()) { + if (node.getText().indexOf(THIS) >= 0) { + const currentObservedPropertyCollection: Set = getObservedPropertyCollection( + componentCollection.currentClassName); + let hasObservedKeyword: boolean = false; + const realKeywords: Set = new Set(); + const traverse: Function = (node: ts.Node) => { + if (node && ts.isPropertyAccessExpression(node) && node.expression && + node.expression.kind === ts.SyntaxKind.ThisKeyword) { + const keyword: string = node.name.escapedText.toString(); + if (currentObservedPropertyCollection.has(keyword)) { + hasObservedKeyword = true; + return; + } else { + realKeywords.add(keyword); + } + } + if (node && !ts.isBlock(node)) { + ts.forEachChild(node, node => traverse(node)); } } - if (node && !ts.isBlock(node)) { - ts.forEachChild(node, node => traverse(node)); + traverse(node); + if (!hasObservedKeyword && node && realKeywords.size > 0) { + log.push({ + type: LogType.WARN, + message: `It is recommended to use the state variable for condition judgment of the IF component.`, + pos: node.getStart() || node.pos + }); } - } - traverse(node); - if (!hasObservedKeyword && node && realKeywords.size > 0) { + } else { log.push({ type: LogType.WARN, - message: `Only state variables can be used for condition judgment of the IF component.`, + message: `It is recommended to use the state variable for condition judgment of the IF component.`, pos: node.getStart() || node.pos }); } -- Gitee From 096540f29885aea8a89e4715b7ad25642ff37d8f Mon Sep 17 00:00:00 2001 From: bojiang Date: Thu, 1 Dec 2022 19:43:19 +0800 Subject: [PATCH 180/379] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ut修改 Signed-off-by: bojiang Change-Id: I3d44a5f417ba8f0e632dbbcae3536472c8188191 --- .../utForPartialUpdate/import/importAllEts.ts | 22 ++----- .../utForPartialUpdate/import/importEts.ts | 62 ++----------------- .../import/importExportEts.ts | 22 +------ .../import/importExportNest.ts | 11 +--- .../utForPartialUpdate/import/importTs.ts | 22 +------ .../custom_component/custom_component.ts | 10 +-- .../@builder/@builderWithLinkData.ts | 2 +- .../@builderParam/@builderParam.ts | 45 +------------- .../@link/@link.ts | 2 +- .../@objectLink/@objectLink.ts | 4 +- .../@prop/@prop.ts | 4 +- .../@observed_@objectLink.ts | 4 +- 12 files changed, 35 insertions(+), 175 deletions(-) diff --git a/compiler/test/utForPartialUpdate/import/importAllEts.ts b/compiler/test/utForPartialUpdate/import/importAllEts.ts index b49f8a0..2375614 100644 --- a/compiler/test/utForPartialUpdate/import/importAllEts.ts +++ b/compiler/test/utForPartialUpdate/import/importAllEts.ts @@ -179,14 +179,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - NamespaceComponent1Link1: this.__myState1, - NamespaceComponent1Link2: this.__myState2, - NamespaceComponent1Link3: this.__myState3, - NamespaceComponent1Link4: this.__myState4, - myVar: 100, - myVar2: 80 - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -214,7 +207,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, 100); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -234,14 +227,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - NamespaceComponent3Link1: this.__myState1, - NamespaceComponent3Link2: this.__myState2, - NamespaceComponent3Link3: this.__myState3, - NamespaceComponent3Link4: this.__myState4, - myVar: 100, - myVar2: 80 - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -269,7 +255,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, 200); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); diff --git a/compiler/test/utForPartialUpdate/import/importEts.ts b/compiler/test/utForPartialUpdate/import/importEts.ts index 6b39811..4497813 100644 --- a/compiler/test/utForPartialUpdate/import/importEts.ts +++ b/compiler/test/utForPartialUpdate/import/importEts.ts @@ -215,16 +215,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - LinkComponent2Link1: this.__myState1, - LinkComponent2Link2: this.__myState2, - LinkComponent2Link3: this.__myState3, - LinkComponent2Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'LinkComponent2' - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -256,16 +247,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - LinkComponent1Link1: this.__myState1, - LinkComponent1Link2: this.__myState2, - LinkComponent1Link3: this.__myState3, - LinkComponent1Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'LinkComponent1' - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -284,14 +266,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - DefaultComponentLink1: this.__myState1, - DefaultComponentLink2: this.__myState2, - DefaultComponentLink3: this.__myState3, - DefaultComponentLink4: this.__myState4, - myVar: 100, - myVar2: 100 - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -312,16 +287,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - LinkComponent3Link1: this.__myState1, - LinkComponent3Link2: this.__myState2, - LinkComponent3Link3: this.__myState3, - LinkComponent3Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'LinkComponent3' - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -340,14 +306,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - AMDComponentLink1: this.__myState1, - AMDComponentLink2: this.__myState2, - AMDComponentLink3: this.__myState3, - AMDComponentLink4: this.__myState4, - myVar: 100, - myVar2: 100 - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -368,16 +327,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - LinkComponent3Link1: this.__myState1, - LinkComponent3Link2: this.__myState2, - LinkComponent3Link3: this.__myState3, - LinkComponent3Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'LinkComponent1' - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); diff --git a/compiler/test/utForPartialUpdate/import/importExportEts.ts b/compiler/test/utForPartialUpdate/import/importExportEts.ts index 311e8c1..0410d7e 100644 --- a/compiler/test/utForPartialUpdate/import/importExportEts.ts +++ b/compiler/test/utForPartialUpdate/import/importExportEts.ts @@ -148,16 +148,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - ExportComponent1Link1: this.__myState1, - ExportComponent1Link2: this.__myState2, - ExportComponent1Link3: this.__myState3, - ExportComponent1Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'ExportComponent1' - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -178,16 +169,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - ExportComponent4Link1: this.__myState1, - ExportComponent4Link2: this.__myState2, - ExportComponent4Link3: this.__myState3, - ExportComponent4Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'ExportComponent4' - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); diff --git a/compiler/test/utForPartialUpdate/import/importExportNest.ts b/compiler/test/utForPartialUpdate/import/importExportNest.ts index 63f19da..bf28f43 100644 --- a/compiler/test/utForPartialUpdate/import/importExportNest.ts +++ b/compiler/test/utForPartialUpdate/import/importExportNest.ts @@ -242,11 +242,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - testStr: this.__testState1, - testNum: this.__testState2, - testObj: this.__testState3 - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -261,10 +257,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - testNum1: this.__testState4, - testNum2: this.__testState5 - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); diff --git a/compiler/test/utForPartialUpdate/import/importTs.ts b/compiler/test/utForPartialUpdate/import/importTs.ts index 55e24ea..600b2d5 100644 --- a/compiler/test/utForPartialUpdate/import/importTs.ts +++ b/compiler/test/utForPartialUpdate/import/importTs.ts @@ -148,16 +148,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - ExportComponent1Link1: this.__myState1, - ExportComponent1Link2: this.__myState2, - ExportComponent1Link3: this.__myState3, - ExportComponent1Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'ExportComponent1' - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -178,16 +169,7 @@ class ImportTest extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - ExportComponent4Link1: this.__myState1, - ExportComponent4Link2: this.__myState2, - ExportComponent4Link3: this.__myState3, - ExportComponent4Link4: this.__myState4, - indexState1: { count: 1 }, - indexState2: 1, - indexState3: true, - indexState4: 'ExportComponent4' - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/custom_component/custom_component.ts b/compiler/test/utForPartialUpdate/inner_component_transform/custom_component/custom_component.ts index c9150b2..3a36ebb 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/custom_component/custom_component.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/custom_component/custom_component.ts @@ -99,7 +99,7 @@ class MyComponent extends ViewPU { ViewPU.create(new Banner(this, {}, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, 100); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -122,7 +122,7 @@ class MyComponent extends ViewPU { ViewPU.create(new Banner(this, {}, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, 200); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -135,7 +135,7 @@ class MyComponent extends ViewPU { ViewPU.create(new Banner(this, { value: "Hello" }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { value: "Hello" }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -156,7 +156,7 @@ class MyComponent extends ViewPU { ViewPU.create(new Banner(this, { value: "Hello" }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, 100); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -179,7 +179,7 @@ class MyComponent extends ViewPU { ViewPU.create(new Banner(this, { value: "Hello" }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, 200); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts index 8226736..245b6f4 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts @@ -113,7 +113,7 @@ class TestPage extends ViewPU { ViewPU.create(new TitleComp(this, { title: this.__value }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { title: this.__value }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts b/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts index 98cf502..ef18ed7 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts @@ -352,24 +352,7 @@ class CustomContainerUser extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - header: this.text, - closer: () => { - this.observeComponentCreation((elmtId, isInitialRender) => { - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - Column.create(); - Column.onClick(() => { - this.text = "changeHeader"; - }); - if (!isInitialRender) { - Column.pop(); - } - ViewStackProcessor.StopGetAccessRecording(); - }); - specificWithParam("111", "22", this); - Column.pop(); - } - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -394,12 +377,7 @@ class CustomContainerUser extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - header: this.text, - content: this.specificParam, - callContent: this.callSpecificParam("callContent1", 'callContent2'), - footer: "Footer", - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -437,24 +415,7 @@ class CustomContainerUser extends ViewPU { }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { - header: this.text, - content: () => { - this.observeComponentCreation((elmtId, isInitialRender) => { - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - Column.create(); - Column.onClick(() => { - this.text = "changeHeader"; - }); - if (!isInitialRender) { - Column.pop(); - } - ViewStackProcessor.StopGetAccessRecording(); - }); - this.callSpecificParam("111", '222', this); - Column.pop(); - } - }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts index b72c669..b471546 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@link/@link.ts @@ -117,7 +117,7 @@ class ParentComponent extends ViewPU { ViewPU.create(new LinkComponent(this, { counter: this.__value }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { counter: this.__value }); + this.updateStateVarsOfChildByElmtId(elmtId, {}); } ViewStackProcessor.StopGetAccessRecording(); }); diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts index b35c5c4..c519833 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts @@ -170,7 +170,9 @@ class Parent extends ViewPU { ViewPU.create(new CustomText(this, { model: item }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { model: item }); + this.updateStateVarsOfChildByElmtId(elmtId, { + model: item + }); } ViewStackProcessor.StopGetAccessRecording(); }); diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts index 11f5e7a..e7d0576 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts @@ -118,7 +118,9 @@ class ParentComponent extends ViewPU { ViewPU.create(new PropComponent(this, { counter: this.value }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { counter: this.value }); + this.updateStateVarsOfChildByElmtId(elmtId, { + counter: this.value + }); } ViewStackProcessor.StopGetAccessRecording(); }); diff --git a/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts index fe62540..b9347bc 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts @@ -180,7 +180,9 @@ class ViewB extends ViewPU { ViewPU.create(new ViewA(this, { varA: this.varB.a }, undefined, elmtId)); } else { - this.updateStateVarsOfChildByElmtId(elmtId, { varA: this.varB.a }); + this.updateStateVarsOfChildByElmtId(elmtId, { + varA: this.varB.a + }); } ViewStackProcessor.StopGetAccessRecording(); }); -- Gitee From a8ddb9c2a27329be9b3f4bb884160fea8533881c Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Thu, 1 Dec 2022 20:20:33 +0800 Subject: [PATCH 181/379] houhaoyu@huawei.com remind lazyforeach in partialupdate Signed-off-by: houhaoyu Change-Id: Ie77ba43b0ba72f1c45ab1fb952de2e07ab17da25 --- compiler/src/pre_define.ts | 1 + compiler/src/process_component_build.ts | 230 ++++++++++++++++++------ 2 files changed, 176 insertions(+), 55 deletions(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index a955162..2053c57 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -364,3 +364,4 @@ export const RESERT = 'reset'; export const ARRAY = 'Array'; export const JSON = 'JSON'; export const STRINGIFY = 'stringify'; +export const GETDATA = 'getData'; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 270c054..28d29e3 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -102,7 +102,8 @@ import { CREATE_BIND_COMPONENT, ARRAY, JSON, - STRINGIFY + STRINGIFY, + GETDATA } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -324,7 +325,7 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme case ComponentType.forEachComponent: parent = undefined; if (partialUpdateConfig.strictCheck && partialUpdateConfig.partialUpdateMode) { - checkoutForEachSameId(item, log); + checkoutForEachSameId(item, log, name); } if (!partialUpdateConfig.partialUpdateMode) { processForEachComponent(item, newStatements, log, isBuilder, isGlobalBuilder); @@ -2335,68 +2336,76 @@ enum ReturnType { complex } -function checkoutForEachSameId(node: ts.ExpressionStatement, log: LogInfo[]): void { +function checkoutForEachSameId(node: ts.ExpressionStatement, log: LogInfo[], name: string): void { if (node.expression && ts.isCallExpression(node.expression) && node.expression.arguments && node.expression.arguments.length) { - let targetArray: ts.Node = node.expression.arguments[0]; + let target: ts.Node = node.expression.arguments[0]; if (globalProgram.program && node.expression.arguments.length === 3 && !isReturnStringify(node.expression.arguments[2], log)) { - let TypeChecker: ts.TypeChecker = globalProgram.program.getTypeChecker(true) - judgeTargetArrayType(targetArray, log, TypeChecker); + let TypeChecker: ts.TypeChecker = globalProgram.program.getTypeChecker(true); + judgeTargetType(target, log, TypeChecker, name); } } } -function judgeTargetArrayType(targetArray: ts.Node, log: LogInfo[], TypeChecker: ts.TypeChecker): void { - if (ts.isIdentifier(targetArray) && TypeChecker.getSymbolAtLocation(targetArray)) { - let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(targetArray).declarations; +function judgeTargetType(target: ts.Node, log: LogInfo[], TypeChecker: ts.TypeChecker, name: string): void { + if (ts.isIdentifier(target) && TypeChecker.getSymbolAtLocation(target)) { + let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(target).declarations; if (declarations && declarations.length) { let declaration: ts.Node = declarations[0]; if (ts.isVariableDeclaration(declaration)) { - judgeDeclaration(declaration, targetArray, log); + judgeDeclaration(declaration, target, log, name, TypeChecker); } } - } else if (ts.isPropertyAccessExpression(targetArray) && targetArray.expression && - targetArray.expression.kind === ts.SyntaxKind.ThisKeyword && TypeChecker.getSymbolAtLocation(targetArray)) { - let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(targetArray).declarations; + } else if (ts.isPropertyAccessExpression(target) && target.expression && + target.expression.kind === ts.SyntaxKind.ThisKeyword && TypeChecker.getSymbolAtLocation(target)) { + let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(target).declarations; if (declarations && declarations.length) { let declaration: ts.Node = declarations[0]; if (ts.isPropertyDeclaration(declaration)) { - judgeDeclaration(declaration, targetArray, log); + judgeDeclaration(declaration, target, log, name, TypeChecker); } } - } else if (ts.isCallExpression(targetArray) && targetArray.expression && - ts.isIdentifier(targetArray.expression) && TypeChecker.getSymbolAtLocation(targetArray.expression)) { - let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(targetArray.expression).declarations; + } else if (ts.isCallExpression(target) && target.expression && + ts.isIdentifier(target.expression) && TypeChecker.getSymbolAtLocation(target.expression)) { + let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(target.expression).declarations; if (declarations && declarations.length) { let declaration: ts.Node = declarations[0]; if (ts.isFunctionDeclaration(declaration)) { - judgeDeclaration(declaration, targetArray, log); + judgeDeclaration(declaration, target, log, name, TypeChecker); } } - } else if (ts.isCallExpression(targetArray) && targetArray.expression && - ts.isPropertyAccessExpression(targetArray.expression) && targetArray.expression.expression && - targetArray.expression.expression.kind === ts.SyntaxKind.ThisKeyword && - TypeChecker.getSymbolAtLocation(targetArray.expression)) { - let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(targetArray.expression).declarations; + } else if (ts.isCallExpression(target) && target.expression && + ts.isPropertyAccessExpression(target.expression) && target.expression.expression && + target.expression.expression.kind === ts.SyntaxKind.ThisKeyword && + TypeChecker.getSymbolAtLocation(target.expression)) { + let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(target.expression).declarations; if (declarations && declarations.length) { let declaration: ts.Node = declarations[0]; if (ts.isMethodDeclaration(declaration)) { - judgeDeclaration(declaration, targetArray, log); + judgeDeclaration(declaration, target, log, name, TypeChecker); } } } else { - log.push({ - type: LogType.WARN, - message: `If the type of array's each item is not a simple type, ` + - `use JSON.stringify to serialize the key generator in 3rd parameter of ForEach Component`, - pos: targetArray.getStart(), - }) + if (name === COMPONENT_FOREACH) { + notRecognizeArrayType(log, target); + } else { + notRecognizeObjectType(log, target); + } + } +} + +function judgeDeclaration(declaration: ts.Node, target: ts.Node, log: LogInfo[], name: string, + TypeChecker: ts.TypeChecker): void { + if (name === COMPONENT_FOREACH) { + judgeArrayDeclaration(declaration, target, log); + } else { + judgeClassDeclaration(declaration, target, log, TypeChecker); } } function isReturnStringify(node: ts.Node, log: LogInfo[]): boolean { - return functionWithBlock(node, log) || functionWithoutBlock(node, log); + return functionWithoutBlock(node, log) || functionWithBlock(node, log); } function hasJsonStringify(node: ts.Node): boolean { @@ -2406,23 +2415,16 @@ function hasJsonStringify(node: ts.Node): boolean { } function functionWithoutBlock(node: ts.Node, log: LogInfo[]): boolean { - if (ts.isArrowFunction(node)) { + let withoutBlock: boolean = ts.isArrowFunction(node) && node.body && ts.isCallExpression(node.body) && + node.body.expression && hasJsonStringify(node.body.expression); + if (ts.isArrowFunction(node) && withoutBlock) { if (judgeReturnType(node.type) === ReturnType.notDefined) { - log.push({ - type: LogType.WARN, - message: "Better allocate a type of key generator function", - pos: node.getStart(), - }) + allocateKeyGeneratorType(log, node); } else if (judgeReturnType(node.type) === ReturnType.complex) { - log.push({ - type: LogType.WARN, - message: "Return complex type, please use JSON.stringify to serialize it", - pos: node.getStart(), - }) + remindComplexOfKeyGeneratorType(log, node); } } - return ts.isArrowFunction(node) && node.body && ts.isCallExpression(node.body) && - node.body.expression && hasJsonStringify(node.body.expression); + return withoutBlock; } function functionWithBlock(node: ts.Node, log: LogInfo[]): boolean { @@ -2432,18 +2434,10 @@ function functionWithBlock(node: ts.Node, log: LogInfo[]): boolean { if (node.body && ts.isBlock(node.body)) { ts.forEachChild(node, (node)=>{traverseReturnStatement(node, useStringify)}) } - log.push({ - type: LogType.WARN, - message: "Better allocate a type of key generator function", - pos: node.getStart(), - }) + allocateKeyGeneratorType(log, node); return useStringify.length && useStringify[useStringify.length-1]; } else if (judgeReturnType(node.type) === ReturnType.complex) { - log.push({ - type: LogType.WARN, - message: "Return complex type, please use JSON.stringify to serialize it", - pos: node.getStart(), - }) + remindComplexOfKeyGeneratorType(log, node); return false; } else { return true; @@ -2473,7 +2467,7 @@ function judgeReturnType(type: ts.TypeNode): ReturnType { } } -function judgeDeclaration(declaration: ts.Node, targetArray: ts.Node, log: LogInfo[]): void { +function judgeArrayDeclaration(declaration: ts.Node, targetArray: ts.Node, log: LogInfo[]): void { switch (judgeArrayType(declaration.type)) { case ReturnType.notDefined: log.push({ @@ -2500,6 +2494,81 @@ function judgeDeclaration(declaration: ts.Node, targetArray: ts.Node, log: LogIn } } +function judgeClassDeclaration(declaration: ts.Node, targetClass: ts.Node, log: LogInfo[], + TypeChecker: ts.TypeChecker): void { + if (declaration.type) { + if (ts.isTypeReferenceNode(declaration.type) && declaration.type.typeName && + ts.isIdentifier(declaration.type.typeName)) { + let tsSymbol: ts.Symbol = TypeChecker.getSymbolAtLocation(declaration.type.typeName); + if (tsSymbol && tsSymbol.declarations && tsSymbol.declarations[0]) { + checkClassGetDataReturnType(tsSymbol.declarations[0], log, targetClass, TypeChecker); + } + } else if (ts.isTypeLiteralNode(declaration.type) && declaration.type.members && + declaration.type.members.length) { + checkObjectGetDataReturnType(declaration.type, log); + } else { + notRecognizeObjectType(log, targetClass); + } + } else { + log.push({ + type: LogType.WARN, + message: `Better allocate a type of this Object/Function/Method`, + pos: declaration.getStart(), + }) + notRecognizeObjectType(log, targetClass); + } +} + +function checkClassGetDataReturnType(declaration: ts.Node, log: LogInfo[], targetClass: ts.Node, + TypeChecker: ts.TypeChecker): void { + if ((ts.isInterfaceDeclaration(declaration) || ts.isClassDeclaration(declaration)) && + declaration.members && declaration.members.length) { + let hasGetData: boolean = checkObjectGetDataReturnType(declaration, log); + if (!hasGetData && declaration.heritageClauses && declaration.heritageClauses.length && + declaration.heritageClauses[0] && declaration.heritageClauses[0].types && + declaration.heritageClauses[0].types.length && declaration.heritageClauses[0].types[0] && + ts.isExpressionWithTypeArguments(declaration.heritageClauses[0].types[0]) && + declaration.heritageClauses[0].types[0].expression && + ts.isIdentifier(declaration.heritageClauses[0].types[0].expression)) { + let classSymbol: ts.Symbol = TypeChecker.getSymbolAtLocation(declaration.heritageClauses[0].types[0].expression); + if (classSymbol && classSymbol.declarations && classSymbol.declarations[0]) { + checkClassGetDataReturnType(classSymbol.declarations[0], log, targetClass, TypeChecker); + } + } + } else { + notRecognizeObjectType(log, targetClass); + } +} + +function checkObjectGetDataReturnType(objectType: ts.TypeLiteralNode|ts.InterfaceDeclaration|ts.ClassDeclaration, + log: LogInfo[]): boolean { + let hasGetData: boolean = false; + objectType.members.forEach(member => { + if ((ts.isMethodSignature(member) || ts.isMethodDeclaration(member)) && member.name && + ts.isIdentifier(member.name) && member.name.escapedText.toString() === GETDATA) { + hasGetData = true; + if (member.type) { + if (judgeType(member.type) === ReturnType.complex) { + remindComplexOfGetDataType(log, member); + } + } else { + allocateGetDataType(log, member); + } + } else if (ts.isPropertySignature(member) && member.name && ts.isIdentifier(member.name) && + member.name.escapedText.toString() === GETDATA && member.type && ts.isFunctionTypeNode(member.type)) { + hasGetData = true; + if (member.type.type) { + if (judgeType(member.type.type) === ReturnType.complex) { + remindComplexOfGetDataType(log, member); + } + } else { + allocateGetDataType(log, member); + } + } + }); + return hasGetData; +} + function judgeArrayType(type: ts.TypeNode): ReturnType { if (type) { if (ts.isTypeReferenceNode(type) && type.typeName && ts.isIdentifier(type.typeName) && @@ -2529,3 +2598,54 @@ function judgeType(type: ts.TypeNode): ReturnType { return ReturnType.complex; } } + +function notRecognizeArrayType(log: LogInfo[], target: ts.Node): void { + log.push({ + type: LogType.WARN, + message: `If the type of array's each item is not a simple type, ` + + `use JSON.stringify to serialize the key generator in 3rd parameter of ForEach Component`, + pos: target.getStart(), + }) +} + +function notRecognizeObjectType(log: LogInfo[], target: ts.Node): void { + log.push({ + type: LogType.WARN, + message: `If the return type of Object's method getData is not a simple type, ` + + `use JSON.stringify to serialize the key generator in 3rd parameter of LazyForEach Component`, + pos: target.getStart(), + }) +} + +function allocateGetDataType(log: LogInfo[], target: ts.Node): void { + log.push({ + type: LogType.WARN, + message: `Should allocate a type of getData`, + pos: target.getStart(), + }) +} + +function allocateKeyGeneratorType(log: LogInfo[], target: ts.Node): void { + log.push({ + type: LogType.WARN, + message: "Better allocate a type of key generator function", + pos: target.getStart(), + }) +} + +function remindComplexOfKeyGeneratorType(log: LogInfo[], target: ts.Node): void { + log.push({ + type: LogType.WARN, + message: "Return complex type, please use JSON.stringify to serialize it", + pos: target.getStart(), + }) +} + +function remindComplexOfGetDataType(log: LogInfo[], target: ts.Node): void { + log.push({ + type: LogType.WARN, + message: `If return type of getData is a complex type, ` + + `use JSON.stringify to serialize the key generator in 3rd parameter of LazyForEach Component`, + pos: target.getStart(), + }) +} -- Gitee From 68d1ad1a69fb0dee6b1b468668e61b53bb34707e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 2 Dec 2022 11:26:28 +0800 Subject: [PATCH 182/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 36 ++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index cee374d..f477d46 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -58,7 +58,9 @@ import { consumeCollection, objectLinkCollection, isStaticViewCollection, - builderParamObjectCollection + builderParamObjectCollection, + getObservedPropertyCollection, + componentCollection } from './validate_ui_syntax'; import { propAndLinkDecorators, @@ -296,11 +298,12 @@ function validateCustomComponentPrams(node: ts.CallExpression, name: string, if (nodeArguments && nodeArguments.length === 1 && ts.isObjectLiteralExpression(nodeArguments[0])) { const nodeArgument: ts.ObjectLiteralExpression = nodeArguments[0] as ts.ObjectLiteralExpression; + const checkArray: string[] = []; nodeArgument.properties.forEach(item => { if (item.name && ts.isIdentifier(item.name)) { curChildProps.add(item.name.escapedText.toString()); } - validateStateManagement(item, name, log); + validateStateManagement(item, name, log, checkArray); if (isNonThisProperty(item, linkSet)) { if (isToChange(item as ts.PropertyAssignment, name)) { item = ts.factory.updatePropertyAssignment(item as ts.PropertyAssignment, @@ -309,6 +312,13 @@ function validateCustomComponentPrams(node: ts.CallExpression, name: string, props.push(item); } }); + if (checkArray.length === nodeArgument.properties.length) { + log.push({ + type: LogType.ERROR, + message: `This component without state variable, UI of the component will not be update.`, + pos: node.getStart() || node.pos + }); + } } validateMandatoryToAssignmentViaParam(node, name, curChildProps, log); } @@ -371,13 +381,29 @@ function isNonThisProperty(node: ts.ObjectLiteralElementLike, propertySet: Set = + getObservedPropertyCollection(componentCollection.currentClassName); + if (!observedPropertyCollection.has(name)) { + checkArray.push("warn"); + } + } + let propertyName: string; if (node.name && node.name.escapedText) { // @ts-ignore -- Gitee From a16a07450a8e5c23d2047b6b16d624ab2c348a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 2 Dec 2022 03:29:45 +0000 Subject: [PATCH 183/379] update compiler/src/process_custom_component.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index f477d46..bb4c949 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -314,7 +314,7 @@ function validateCustomComponentPrams(node: ts.CallExpression, name: string, }); if (checkArray.length === nodeArgument.properties.length) { log.push({ - type: LogType.ERROR, + type: LogType.WARN, message: `This component without state variable, UI of the component will not be update.`, pos: node.getStart() || node.pos }); -- Gitee From d36d277181e2267841f1b2b76913a2e02d2cafee Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Fri, 2 Dec 2022 13:41:21 +0800 Subject: [PATCH 184/379] houhaoyu@huawei.com getsymbol error in @Builder Signed-off-by: houhaoyu Change-Id: I6a8c246ccaeecd17932992d83482d0478883b084 --- compiler/package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/package-lock.json b/compiler/package-lock.json index 8bee087..5f0f071 100644 --- a/compiler/package-lock.json +++ b/compiler/package-lock.json @@ -4161,7 +4161,7 @@ }, "typescript": { "version": "file:deps/ohos-typescript-4.2.3-r2.tgz", - "integrity": "sha512-lAFSMdoRBbkoaCwyDQrKIEK/dcxJnAzKWzDpFcJR39aAe6UHYo2FO5IY5aDPA3nkCqO1yVmeuMamiRF+ehfj8Q==" + "integrity": "sha512-gxr6vSrPdDve0VfW5RjrRYQKlRXHiMti6lTAPpGwLh/ZOE0ChZAmo8G6JEVmMzBw/KMbENku2YbUIS1rKIExfg==" }, "uglify-js": { "version": "3.16.1", -- Gitee From 0431788fd6d7ec76313d116b9d8fc44d7e296494 Mon Sep 17 00:00:00 2001 From: hufeng Date: Fri, 2 Dec 2022 16:17:21 +0800 Subject: [PATCH 185/379] Fix ohmUrl with suffix Signed-off-by: hufeng Change-Id: I6f5fba8244b7406b4bd2e1999903d37057392e87 --- compiler/src/utils.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 387b904..3f8840a 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -399,6 +399,12 @@ export function writeFileSyncByString(sourcePath: string, sourceCode: string): v return; } + // replace relative moduleSpecifier with ohmURl + const REG_RELATIVE_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]((?:\.\/|\.\.\/).*)['"]/g; + sourceCode = sourceCode.replace(REG_RELATIVE_DEPENDENCY, (item, moduleRequest)=>{ + return replaceRelativeDependency(item, moduleRequest, toUnixPath(sourcePath)); + }); + mkdirsSync(path.dirname(jsFilePath)); if (projectConfig.buildArkMode === 'debug') { fs.writeFileSync(jsFilePath, sourceCode); @@ -422,9 +428,12 @@ export function getPackageInfo(configFile: string): Array { } function replaceRelativeDependency(item:string, moduleRequest: string, sourcePath: string): string { + const SUFFIX_REG: RegExp = /\.(?:[cm]?js|[e]?ts|json)$/; if (sourcePath && projectConfig.compileMode === ESMODULE) { const filePath: string = path.resolve(path.dirname(sourcePath), moduleRequest); - const result: RegExpMatchArray | null = filePath.match(/(\S+)(\/|\\)src(\/|\\)(?:main|ohosTest)(\/|\\)(ets|js)(\/|\\)(\S+)/); + const filePathWithoutSuffix: string = filePath.replace(SUFFIX_REG, ''); + const result: RegExpMatchArray | null = + filePathWithoutSuffix.match(/(\S+)(\/|\\)src(\/|\\)(?:main|ohosTest)(\/|\\)(ets|js)(\/|\\)(\S+)/); if (result && projectConfig.aceModuleJsonPath) { const npmModuleIdx: number = result[1].search(/(\/|\\)node_modules(\/|\\)/); const projectRootPath: string = projectConfig.projectRootPath; -- Gitee From 691819879c49bb28a68887305ff2f5405f9266c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 2 Dec 2022 15:47:15 +0800 Subject: [PATCH 186/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_member.ts | 6 +- compiler/src/process_custom_component.ts | 72 ++++++++++-------------- 2 files changed, 33 insertions(+), 45 deletions(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 33c2de0..d31760b 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -867,12 +867,10 @@ export function isSimpleType(typeNode: ts.TypeNode, program: ts.Program, log?: L } return true; } - if (typeNode.parent && typeNode.parent.name && stateCollection.get( - componentCollection.currentClassName).has(typeNode.parent.name.escapedText.toString()) && + if (typeNode.parent && typeNode.parent.name && typeNode.kind === ts.SyntaxKind.AnyKeyword && log) { log.push({ - type: partialUpdateConfig.strictCheck && partialUpdateConfig.partialUpdateMode ? - LogType.ERROR : LogType.WARN, + type: partialUpdateConfig.partialUpdateMode ? LogType.ERROR : LogType.WARN, message: `Please define an explicit type, not any.`, pos: typeNode.getStart() }); diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index bb4c949..8d7d7c3 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -58,9 +58,7 @@ import { consumeCollection, objectLinkCollection, isStaticViewCollection, - builderParamObjectCollection, - getObservedPropertyCollection, - componentCollection + builderParamObjectCollection } from './validate_ui_syntax'; import { propAndLinkDecorators, @@ -298,12 +296,11 @@ function validateCustomComponentPrams(node: ts.CallExpression, name: string, if (nodeArguments && nodeArguments.length === 1 && ts.isObjectLiteralExpression(nodeArguments[0])) { const nodeArgument: ts.ObjectLiteralExpression = nodeArguments[0] as ts.ObjectLiteralExpression; - const checkArray: string[] = []; nodeArgument.properties.forEach(item => { if (item.name && ts.isIdentifier(item.name)) { curChildProps.add(item.name.escapedText.toString()); } - validateStateManagement(item, name, log, checkArray); + validateStateManagement(item, name, log); if (isNonThisProperty(item, linkSet)) { if (isToChange(item as ts.PropertyAssignment, name)) { item = ts.factory.updatePropertyAssignment(item as ts.PropertyAssignment, @@ -312,13 +309,6 @@ function validateCustomComponentPrams(node: ts.CallExpression, name: string, props.push(item); } }); - if (checkArray.length === nodeArgument.properties.length) { - log.push({ - type: LogType.WARN, - message: `This component without state variable, UI of the component will not be update.`, - pos: node.getStart() || node.pos - }); - } } validateMandatoryToAssignmentViaParam(node, name, curChildProps, log); } @@ -381,43 +371,27 @@ function isNonThisProperty(node: ts.ObjectLiteralElementLike, propertySet: Set = - getObservedPropertyCollection(componentCollection.currentClassName); - if (!observedPropertyCollection.has(name)) { - checkArray.push("warn"); - } - } - + log: LogInfo[]): void { let propertyName: string; - if (node.name && node.name.escapedText) { - // @ts-ignore + if (ts.isIdentifier(node.name)) { propertyName = node.name.escapedText.toString(); } const curPropertyKind: string = getPropertyDecoratorKind(propertyName, customComponentName); + let parentPropertyName: string; if (curPropertyKind) { if (isInitFromParent(node)) { - const parentPropertyName: string = + parentPropertyName = getParentPropertyName(node as ts.PropertyAssignment, curPropertyKind, log); - if (!parentPropertyName) { - return; + let parentPropertyKind: string = curPropMap.get(parentPropertyName); + if (!parentPropertyKind) { + parentPropertyKind = COMPONENT_NON_DECORATOR; } - const parentPropertyKind: string = curPropMap.get(parentPropertyName); if (parentPropertyKind && !isCorrectInitFormParent(parentPropertyKind, curPropertyKind)) { validateIllegalInitFromParent( node, propertyName, curPropertyKind, parentPropertyName, parentPropertyKind, log); @@ -427,6 +401,14 @@ function checkFromParentToChild(node: ts.ObjectLiteralElementLike, customCompone validateIllegalInitFromParent(node, propertyName, curPropertyKind, node.initializer.getText(), COMPONENT_NON_DECORATOR, log); } + } else { + parentPropertyName = + getParentPropertyName(node as ts.PropertyAssignment, curPropertyKind, log);; + const parentPropertyKind = COMPONENT_NON_DECORATOR; + if (!isCorrectInitFormParent(parentPropertyKind, curPropertyKind)) { + validateIllegalInitFromParent( + node, propertyName, curPropertyKind, parentPropertyName, parentPropertyKind, log); + } } } } @@ -453,8 +435,8 @@ function isInitFromLocal(node: ts.ObjectLiteralElementLike): boolean { function getParentPropertyName(node: ts.PropertyAssignment, curPropertyKind: string, log: LogInfo[]): string { - let parentPropertyName: string; const initExpression: ts.Expression = node.initializer; + let parentPropertyName: string = initExpression.getText(); if (curPropertyKind === COMPONENT_LINK_DECORATOR) { if (hasDollar(initExpression)) { // @ts-ignore @@ -467,10 +449,13 @@ function getParentPropertyName(node: ts.PropertyAssignment, curPropertyKind: str if (hasDollar(initExpression)) { validateNonLinkWithDollar(node, log); } else { - // @ts-ignore - parentPropertyName = node.initializer.name.getText(); + // @ts-ignore + if (node.initializer && node.initializer.name) { + parentPropertyName = node.initializer.name.getText(); + } } } + return parentPropertyName; } @@ -653,8 +638,13 @@ function validateMandatoryToInitViaParam(node: ts.ExpressionStatement, customCom function validateIllegalInitFromParent(node: ts.ObjectLiteralElementLike, propertyName: string, curPropertyKind: string, parentPropertyName: string, parentPropertyKind: string, log: LogInfo[]): void { + let type: LogType = LogType.ERROR; + if ((parentPropertyKind === COMPONENT_NON_DECORATOR && !partialUpdateConfig.partialUpdateMode) || + curPropertyKind === COMPONENT_PROP_DECORATOR) { + type = LogType.WARN; + } log.push({ - type: curPropertyKind === COMPONENT_PROP_DECORATOR ? LogType.WARN : LogType.ERROR, + type: type, message: `The ${parentPropertyKind} property '${parentPropertyName}' cannot be assigned to ` + `the ${curPropertyKind} property '${propertyName}'.`, // @ts-ignore -- Gitee From b6cdd15546dc561826e3fa2f799bff9015a4dc78 Mon Sep 17 00:00:00 2001 From: lihong Date: Fri, 2 Dec 2022 10:18:23 +0800 Subject: [PATCH 187/379] lihong67@huawei.com add prop and localStorage validate, JSON.stringify of state variable. Signed-off-by: lihong Change-Id: Iae40c07fa6de78ce25301489b23567ead977d247 --- compiler/src/process_component_class.ts | 30 +++++++++++++++++++++++- compiler/src/process_component_member.ts | 2 +- compiler/src/process_custom_component.ts | 7 ++++-- compiler/src/validate_ui_syntax.ts | 20 +++++++++++----- 4 files changed, 49 insertions(+), 10 deletions(-) diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index 544e0bc..2d2a02a 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -91,7 +91,8 @@ import { linkCollection, localStorageLinkCollection, localStoragePropCollection, - propCollection + propCollection, + getObservedPropertyCollection } from './validate_ui_syntax'; import { addConstructor, @@ -422,6 +423,9 @@ function processBuildMember(node: ts.MethodDeclaration, context: ts.Transformati ts.factory.createIdentifier(FOREACH_OBSERVED_OBJECT), ts.factory.createIdentifier(FOREACH_GET_RAW_OBJECT)), undefined, [node]); } + if (partialUpdateConfig.partialUpdateMode && partialUpdateConfig.strictCheck) { + checkJsonStringifyNode(node, log); + } return ts.visitEachChild(node, visitBuild, context); } function checkStateName(node: ts.PropertyAccessExpression): string { @@ -432,6 +436,30 @@ function processBuildMember(node: ts.MethodDeclaration, context: ts.Transformati } } +function checkJsonStringifyNode(node: ts.Node, log: LogInfo[]): void { + if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) && + isJsonStringifyNode(node.expression) && node.arguments.length) { + const currentObservedPropertyCollection: Set = getObservedPropertyCollection( + componentCollection.currentClassName); + node.arguments.forEach((property: ts.Node) => { + if (ts.isPropertyAccessExpression(property) && + property.expression.kind === ts.SyntaxKind.ThisKeyword && ts.isIdentifier(property.name) && + currentObservedPropertyCollection.has(property.name.escapedText.toString())) { + log.push({ + type: LogType.WARN, + message: 'If the state variable is used as the parameter of the JSON.stringify method, UI is not refreshed.', + pos: property.getStart() || property.pos + }); + } + }); + } +} + +function isJsonStringifyNode(node: ts.PropertyAccessExpression): boolean { + return ts.isIdentifier(node.expression) && node.expression.escapedText.toString() === 'JSON' && + ts.isIdentifier(node.name) && node.name.escapedText.toString() === 'stringify'; +} + function isGeometryView(node: ts.Node): boolean { if (ts.isExpressionStatement(node) && ts.isCallExpression(node.expression)) { const call: ts.CallExpression = node.expression; diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index d31760b..3a1f4b9 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -1083,7 +1083,7 @@ function updateSynchedPropertyTwoWayPU(nameIdentifier: ts.Identifier, type: ts.T function updateSynchedPropertyOneWayPU(nameIdentifier: ts.Identifier, type: ts.TypeNode, decoractor: string, log: LogInfo[], program: ts.Program): ts.ExpressionStatement { const name: string = nameIdentifier.escapedText.toString(); - if (isSimpleType(type, program)) { + if (isSimpleType(type, program, log)) { return createInitExpressionStatementForDecorator(name, SYNCHED_PROPERTY_SIMPLE_ONE_WAY_PU, createPropertyAccessExpressionWithParams(name)); } else { diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 8d7d7c3..05877fb 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -58,7 +58,8 @@ import { consumeCollection, objectLinkCollection, isStaticViewCollection, - builderParamObjectCollection + builderParamObjectCollection, + getLocalStorageCollection } from './validate_ui_syntax'; import { propAndLinkDecorators, @@ -581,7 +582,9 @@ function validateForbiddenToInitViaParam(node: ts.ObjectLiteralElementLike, const forbiddenToInitViaParamSet: Set = new Set([ ...getCollectionSet(customComponentName, storageLinkCollection), ...getCollectionSet(customComponentName, storagePropCollection), - ...getCollectionSet(customComponentName, consumeCollection)]); + ...getCollectionSet(customComponentName, consumeCollection) + ]); + getLocalStorageCollection(customComponentName, forbiddenToInitViaParamSet); if (isThisProperty(node, forbiddenToInitViaParamSet)) { log.push({ type: LogType.ERROR, diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index cae3962..34a01a9 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -1126,13 +1126,21 @@ export function getObservedPropertyCollection(className: string): Set { ...storageLinkCollection.get(className), ...provideCollection.get(className), ...consumeCollection.get(className), - ...objectLinkCollection.get(className), + ...objectLinkCollection.get(className) ]); - for(const key of localStorageLinkCollection.get(className).keys()){ - observedProperthCollection.add(key); + getLocalStorageCollection(className, observedProperthCollection); + return observedProperthCollection; +} + +export function getLocalStorageCollection(componentName: string, collection: Set): void { + if (localStorageLinkCollection.get(componentName)) { + for (const key of localStorageLinkCollection.get(componentName).keys()) { + collection.add(key); + } } - for(const key of localStoragePropCollection.get(className).keys()){ - observedProperthCollection.add(key); + if (localStoragePropCollection.get(componentName)) { + for (const key of localStoragePropCollection.get(componentName).keys()) { + collection.add(key); + } } - return observedProperthCollection; } -- Gitee From b8206f3c848a4e1134b8d460fe4a20e6d4c5e7db Mon Sep 17 00:00:00 2001 From: bojiang Date: Fri, 2 Dec 2022 17:20:58 +0800 Subject: [PATCH 188/379] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 最小化更新自定义组件传参节点判断修改 Signed-off-by: bojiang Change-Id: I301c8b055514ab8701efb2385752d5d4704a2c1a --- compiler/src/process_custom_component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 8d7d7c3..8d7da5a 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -208,7 +208,7 @@ function createChildElmtId(node: ts.ExpressionStatement, name: string): ts.Prope } if (node.expression.arguments[0].properties) { node.expression.arguments[0].properties.forEach(item => { - if (item.name && item.name.escapedText.toString() && propsAndObjectLinks.includes(item.name.escapedText)) { + if (ts.isIdentifier(item.name) && propsAndObjectLinks.includes(item.name.escapedText.toString())) { childParam.push(item); } }) -- Gitee From cdcc2bfc9a60401f350a5ee3e6f45d179ed21bfb Mon Sep 17 00:00:00 2001 From: bojiang Date: Fri, 2 Dec 2022 17:40:17 +0800 Subject: [PATCH 189/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I0c33e83d324c1aede03a7f48a19627f2d6032ccf --- compiler/src/pre_define.ts | 3 ++- compiler/src/process_component_build.ts | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 2053c57..aa43dce 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -329,7 +329,6 @@ export const COMPONENT_INITIAl_RENDER_FUNCTION: string = 'initialRender'; export const GRID_COMPONENT: string = 'Grid'; export const GRIDITEM_COMPONENT: string = 'GridItem'; export const WILLUSEPROXY: string = 'willUseProxy'; -export const TABCONTENT_COMPONENT: string = 'TabContent'; export const BASE_COMPONENT_NAME_PU: string = 'ViewPU'; export const GLOBAL_THIS: string = 'globalThis'; export const OBSERVED_PROPERTY_SIMPLE_PU: string = 'ObservedPropertySimplePU'; @@ -355,6 +354,8 @@ export const CARD_ENABLE_COMPONENTS: Set = new Set([ 'AbilityComponent', 'PluginComponent', 'FormComponent', 'RemoteWindow', 'XComponent', 'Web', 'RichText' ]); +export const TabContentAndNavDestination: Set = new Set(['TabContent', + 'NavDestination']); export const CARD_LOG_TYPE_DECORATORS = 1; export const CARD_LOG_TYPE_COMPONENTS = 2; export const CARD_LOG_TYPE_IMPORT = 3; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 39a114c..d4b1379 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -84,7 +84,6 @@ import { GRIDITEM_COMPONENT, GRID_COMPONENT, WILLUSEPROXY, - TABCONTENT_COMPONENT, GLOBAL_THIS, IFELSEBRANCHUPDATEFUNCTION, CARD_ENABLE_COMPONENTS, @@ -103,7 +102,8 @@ import { ARRAY, JSON, STRINGIFY, - GETDATA + GETDATA, + TabContentAndNavDestination } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -462,8 +462,8 @@ function processInnerComponent(node: ts.ExpressionStatement, innerCompStatements validateEtsComponentNode(node.expression as ts.EtsComponentExpression, nameResult); if (partialUpdateConfig.partialUpdateMode && ItemComponents.includes(nameResult.name)) { processItemComponent(node, nameResult, innerCompStatements, log, isGlobalBuilder); - } else if (partialUpdateConfig.partialUpdateMode && TABCONTENT_COMPONENT.includes(nameResult.name)) { - processTabContent(node, innerCompStatements, log, isGlobalBuilder); + } else if (partialUpdateConfig.partialUpdateMode && TabContentAndNavDestination.has(nameResult.name)) { + processTabAndNav(node, innerCompStatements, nameResult.name, log, isGlobalBuilder); } else { processNormalComponent(node, nameResult, innerCompStatements, log, parent, isGlobalBuilder); } @@ -887,13 +887,13 @@ function createObservedDeepRender( ); } -function processTabContent(node: ts.ExpressionStatement, innerCompStatements: ts.Statement[], - log: LogInfo[], isGlobalBuilder: boolean = false): void { +function processTabAndNav(node: ts.ExpressionStatement, innerCompStatements: ts.Statement[], + name: string, log: LogInfo[], isGlobalBuilder: boolean = false): void { const TabContentComp: ts.EtsComponentExpression = getEtsComponentExpression(node); const TabContentBody: ts.Block = TabContentComp.body; let tabContentCreation: ts.Statement; const tabContentPop: ts.Statement = ts.factory.createExpressionStatement(ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(TABCONTENT_COMPONENT), + ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(name), ts.factory.createIdentifier(COMPONENT_POP_FUNCTION)), undefined, [])); const tabAttrs: ts.Statement[] = []; if (TabContentBody && TabContentBody.statements.length) { @@ -901,17 +901,17 @@ function processTabContent(node: ts.ExpressionStatement, innerCompStatements: ts processComponentChild(TabContentBody, newTabContentChildren, log); tabContentCreation = ts.factory.createExpressionStatement( ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression( - ts.factory.createIdentifier(TABCONTENT_COMPONENT), ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION)), + ts.factory.createIdentifier(name), ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION)), undefined, [ts.factory.createArrowFunction(undefined, undefined, [], undefined, ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), ts.factory.createBlock([...newTabContentChildren], true))])); - bindComponentAttr(node, ts.factory.createIdentifier(TABCONTENT_COMPONENT), tabAttrs, log); + bindComponentAttr(node, ts.factory.createIdentifier(name), tabAttrs, log); processInnerCompStatements(innerCompStatements, [tabContentCreation, ...tabAttrs], node, isGlobalBuilder); } else { tabContentCreation = ts.factory.createExpressionStatement(ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(TABCONTENT_COMPONENT), + ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(name), ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION)), undefined, [])); - bindComponentAttr(node, ts.factory.createIdentifier(TABCONTENT_COMPONENT), tabAttrs, log); + bindComponentAttr(node, ts.factory.createIdentifier(name), tabAttrs, log); processInnerCompStatements(innerCompStatements, [tabContentCreation, ...tabAttrs], node, isGlobalBuilder); } innerCompStatements.push(tabContentPop); -- Gitee From 90235a6c5a112c14cea3517f690d70fda73236d2 Mon Sep 17 00:00:00 2001 From: hufeng Date: Sat, 3 Dec 2022 12:21:57 +0800 Subject: [PATCH 190/379] Set pkgName to ts2abc Signed-off-by: hufeng Change-Id: I9808432442c7c08cab57dabfdabd285a03517695 --- compiler/src/gen_module_abc.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/gen_module_abc.ts b/compiler/src/gen_module_abc.ts index 2d2b2c8..ca78107 100644 --- a/compiler/src/gen_module_abc.ts +++ b/compiler/src/gen_module_abc.ts @@ -40,7 +40,8 @@ function js2abcByWorkers(jsonInput: string, cmd: string, workerFileName: string) for (let i = 0; i < inputPaths.length; ++i) { let info: any = inputPaths[i]; const moduleType: string = info.isCommonJs ? 'commonjs' : 'esm'; - content += `${info.tempFilePath};${info.recordName};${moduleType};${toUnixPath(info.sourceFile)}`; + content += + `${info.tempFilePath};${info.recordName};${moduleType};${toUnixPath(info.sourceFile)};${info.packageName}`; if (i < inputPaths.length - 1) { content += "\n" } -- Gitee From 089b382b7b05023bdcf868462a9e44c02be46317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Sat, 3 Dec 2022 20:08:19 +0800 Subject: [PATCH 191/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 38 ++++++- compiler/src/process_import.ts | 125 ++++++++++++++++++++--- 2 files changed, 143 insertions(+), 20 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 05877fb..4a0066a 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -78,7 +78,10 @@ import { createComponentCreationStatement, createFunction } from './process_component_build'; -import { partialUpdateConfig } from '../main'; +import { + partialUpdateConfig, + projectConfig +} from '../main'; const localArray: string[] = [COMPONENT_STATE_DECORATOR, COMPONENT_PROVIDE_DECORATOR, COMPONENT_NON_DECORATOR, COMPONENT_OBJECT_LINK_DECORATOR]; @@ -297,11 +300,12 @@ function validateCustomComponentPrams(node: ts.CallExpression, name: string, if (nodeArguments && nodeArguments.length === 1 && ts.isObjectLiteralExpression(nodeArguments[0])) { const nodeArgument: ts.ObjectLiteralExpression = nodeArguments[0] as ts.ObjectLiteralExpression; + const propertyObservedKinds: string[] = []; nodeArgument.properties.forEach(item => { if (item.name && ts.isIdentifier(item.name)) { curChildProps.add(item.name.escapedText.toString()); } - validateStateManagement(item, name, log); + validateStateManagement(item, name, log, propertyObservedKinds); if (isNonThisProperty(item, linkSet)) { if (isToChange(item as ts.PropertyAssignment, name)) { item = ts.factory.updatePropertyAssignment(item as ts.PropertyAssignment, @@ -309,7 +313,24 @@ function validateCustomComponentPrams(node: ts.CallExpression, name: string, } props.push(item); } + if (partialUpdateConfig.partialUpdateMode && partialUpdateConfig.strictCheck && + item.initializer && ts.isCallExpression(item.initializer)) { + log.push({ + type: LogType.WARN, + message: 'If method assignment is used here, the UI may not be updated.', + pos: item.initializer.getStart() + }); + } }); + if (propertyObservedKinds.length == 0 && nodeArgument.properties.length > 0 && + partialUpdateConfig.partialUpdateMode && partialUpdateConfig.strictCheck) { + log.push({ + type: LogType.WARN, + message: `You do not use any state variables for the component '${name}', ` + + `UI of the component will not be update.`, + pos: node.getStart() + }); + } } validateMandatoryToAssignmentViaParam(node, name, curChildProps, log); } @@ -372,13 +393,13 @@ function isNonThisProperty(node: ts.ObjectLiteralElementLike, propertySet: Set>>, name: string) + : Map> { + let localStorageLinkMap: Map> = new Map(); + if (collection.has(CUSTOM_COMPONENT_DEFAULT)) { + const tempSet: Set = new Set(); + if (collection.get(CUSTOM_COMPONENT_DEFAULT)) { + for (const key of collection.get(CUSTOM_COMPONENT_DEFAULT).keys()) { + tempSet.add(key); + } + } + if (collection.get(name)) { + for (const key of collection.get(name).keys()) { + tempSet.add(key); + } + } + localStorageLinkMap.set(name, tempSet); + } else { + localStorageLinkMap = collection.get(name); + } + return localStorageLinkMap; } function setDependencies(component: string, linkArray: Set, propertyArray: Set, - propArray: Set, builderParamArray: Set): void { + propArray: Set, builderParamArray: Set, stateArray: Set, + regularArray: Set, storagePropsArray: Set, storageLinksArray: Set, + providesArray: Set, consumesArray: Set, objectLinksArray: Set, + localStorageLinkMap: Map>, localStoragePropMap: Map>): void { linkCollection.set(component, linkArray); propertyCollection.set(component, propertyArray); propCollection.set(component, propArray); builderParamObjectCollection.set(component, builderParamArray); componentCollection.customComponents.add(component); + stateCollection.set(component, stateArray); + regularCollection.set(component, regularArray); + storagePropCollection.set(component, storagePropsArray); + storageLinkCollection.set(component, storageLinksArray); + provideCollection.set(component, providesArray); + consumeCollection.set(component, consumesArray); + objectLinkCollection.set(component, objectLinksArray); + localStorageLinkCollection.set(component, localStorageLinkMap); + localStoragePropCollection.set(component, localStoragePropMap); } function hasCollection(node: ts.Identifier): boolean { - return linkCollection.has(node.escapedText.toString()) || - propCollection.has(node.escapedText.toString()) || - propertyCollection.has(node.escapedText.toString()); + const name: string = node.escapedText.toString(); + return linkCollection.has(name) || + propCollection.has(name) || + propertyCollection.has(name) || + builderParamObjectCollection.has(name) || + stateCollection.has(name) || + regularCollection.has(name) || + storagePropCollection.has(name) || + storageLinkCollection.has(name) || + provideCollection.has(name) || + consumeCollection.has(name) || + objectLinkCollection.has(name) || + localStorageLinkCollection.has(name) || + localStoragePropCollection.has(name) } function isModule(filePath: string): boolean { -- Gitee From 978a73742888bd3be949bf2c5c007bcb8a2604bf Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sat, 3 Dec 2022 19:37:25 +0800 Subject: [PATCH 192/379] houhaoyu@huawei.com remind Array with observed in partialupdaye Signed-off-by: houhaoyu Change-Id: Ibea16b387a571ec770680665d0fb07547cc9d109 --- compiler/src/process_component_member.ts | 100 ++++++++++++++++++++++- 1 file changed, 98 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 33c2de0..5d9ddbc 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -72,7 +72,8 @@ import { CREATE_STORAGE_PROP, ELMTID, COMPONENT_CONSTRUCTOR_PARAMS, - RESERT + RESERT, + ARRAY } from './pre_define'; import { forbiddenUseStateType, @@ -89,7 +90,8 @@ import { updateConstructor } from './process_component_constructor'; import { LogType, LogInfo, - componentInfo + componentInfo, + hasDecorator } from './utils'; import { createReference, @@ -389,6 +391,9 @@ function processStateDecorators(node: ts.PropertyDeclaration, decorator: string, if (decorator !== COMPONENT_BUILDERPARAM_DECORATOR) { updateResult.setVariableGet(createGetAccessor(name, CREATE_GET_METHOD)); updateResult.setDeleteParams(true); + if (partialUpdateConfig.strictCheck && partialUpdateConfig.partialUpdateMode) { + checkStatePropertyType(node, log); + } } if (!immutableDecorators.has(decorator)) { updateResult.setVariableSet(createSetAccessor(name, CREATE_SET_METHOD, node.type)); @@ -406,6 +411,97 @@ function processStateDecorators(node: ts.PropertyDeclaration, decorator: string, } } +function checkStatePropertyType(node: ts.PropertyDeclaration, log: LogInfo[]): void { + switch (isArrayTypeNode(node.type, log, true)) { + case 'TypeReference': + if (ts.isTypeReferenceNode(node.type.typeArguments[0]) && node.type.typeArguments[0].typeName && + ts.isIdentifier(node.type.typeArguments[0].typeName)) { + judgeArrayType(node.type.typeArguments[0], log); + } else if (!isExactArrayType(node.type.typeArguments[0])) { + remindObserved(log, node.type.typeArguments[0]); + } + break; + case 'ArrayType': + if (ts.isArrayTypeNode(node.type) && node.type.elementType && + ts.isTypeReferenceNode(node.type.elementType) && node.type.elementType.typeName && + ts.isIdentifier(node.type.elementType.typeName)) { + judgeArrayType(node.type.elementType, log); + } else if (!isExactArrayType(node.type.elementType)) { + remindObserved(log, node.type.elementType); + } + break; + } +} + +function judgeArrayType(node: ts.Node, log: LogInfo[]): void { + if (!observedClassCollection.has(node.typeName.escapedText.toString())) { + remindObserved(log, node); + } +} + +function remindObserved(log: LogInfo[], node: ts.Node): void { + log.push({ + type: LogType.WARN, + message: `Make sure this type is a Class with @Observed decorator, ` + + `or it's property may not update when you change this state variable`, + pos: node.getStart() + }) +} + +function isArrayTypeNode(type: ts.Node, log: LogInfo[], isSurface: boolean): string { + let isArrayType: string; + if (type) { + if (ts.isTypeReferenceNode(type) && type.typeName && ts.isIdentifier(type.typeName) && + type.typeName.escapedText.toString() === ARRAY && type.typeArguments && type.typeArguments.length) { + isArrayType = 'TypeReference'; + isArrayTypeNodeCommon(isSurface, type.typeArguments[0], log); + } else if (ts.isArrayTypeNode(type) && type.elementType) { + isArrayType = 'ArrayType'; + isArrayTypeNodeCommon(isSurface, type.elementType, log); + } + } + return isArrayType; +} + +function isArrayTypeNodeCommon(isSurface: boolean, node: ts.Node, log: LogInfo[]): void { + if (isSurface) { + isObscureArrayType(node, log); + isArrayTypeNode(node, log, false); + } else { + log.push({ + type: LogType.WARN, + message: `Better not nested Array in Array`, + pos: node.getStart() + }) + } +} + +function isExactArrayType(type: ts.Node): boolean { + switch(type.kind) { + case ts.SyntaxKind.StringKeyword: + case ts.SyntaxKind.NumberKeyword: + case ts.SyntaxKind.BooleanKeyword: + case ts.SyntaxKind.SymbolKeyword: + case ts.SyntaxKind.BigIntKeyword: + return true; + default: + return false; + } +} + +function isObscureArrayType(type: ts.Node, log: LogInfo[]): void { + switch(type.kind) { + case ts.SyntaxKind.AnyKeyword: + case ts.SyntaxKind.TupleType: + case ts.SyntaxKind.VoidKeyword: + log.push({ + type: LogType.WARN, + message: `Please give a exact type of Array`, + pos: type.getStart() + }) + } +} + function createPurgeVariableDepStatement(variableWithUnderLink: string): ts.Statement { return ts.factory.createExpressionStatement( ts.factory.createCallExpression( -- Gitee From 6c1ca583b13df9020cc3f168b4f27a4cefd5b99e Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sun, 4 Dec 2022 16:47:00 +0800 Subject: [PATCH 193/379] houhaoyu@huawei.com fix error warning Signed-off-by: houhaoyu Change-Id: I2f68668a62603ca2e47976706a93798c5b0ddbf1 --- compiler/src/compile_info.ts | 2 +- compiler/src/process_component_build.ts | 44 +++++++++--------------- compiler/src/process_component_class.ts | 25 +------------- compiler/src/process_component_member.ts | 4 +-- compiler/src/process_custom_component.ts | 4 +-- 5 files changed, 23 insertions(+), 56 deletions(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 291a758..bf5a504 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -445,7 +445,7 @@ export class ResultStates { .replace(/\(Emitted value instead of an instance of Error\) BUILD/, ''); if (/^NOTE/.test(message)) { this.noteCount++; - logger.info(this.blue, message, this.reset, '\n'); + logger.info(this.blue, message.replace(/^NOTE/, 'ArkTS:NOTE'), this.reset, '\n'); } else { this.warningCount++; logger.warn(this.yellow, message.replace(/^WARN/, 'ArkTS:WARN'), this.reset, '\n'); diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 39a114c..82610ed 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1326,14 +1326,14 @@ function checkHasThisKeyword(node: ts.Statement, log: LogInfo[]): void { traverse(node); if (!hasObservedKeyword && node && realKeywords.size > 0) { log.push({ - type: LogType.WARN, + type: LogType.NOTE, message: `It is recommended to use the state variable for condition judgment of the IF component.`, pos: node.getStart() || node.pos }); } } else { log.push({ - type: LogType.WARN, + type: LogType.NOTE, message: `It is recommended to use the state variable for condition judgment of the IF component.`, pos: node.getStart() || node.pos }); @@ -2367,6 +2367,14 @@ function judgeTargetType(target: ts.Node, log: LogInfo[], TypeChecker: ts.TypeCh } } else if (ts.isPropertyAccessExpression(target) && target.expression && target.expression.kind === ts.SyntaxKind.ThisKeyword && TypeChecker.getSymbolAtLocation(target)) { + if (name === COMPONENT_LAZYFOREACH && target.name && ts.isIdentifier(target.name) && + getObservedPropertyCollection(componentCollection.currentClassName).has(target.name.escapedText.toString())) { + log.push({ + type: LogType.WARN, + message: "LazyForEach's first parameter should not be state variable", + pos: target.getStart(), + }) + } let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(target).declarations; if (declarations && declarations.length) { let declaration: ts.Node = declarations[0]; @@ -2426,9 +2434,7 @@ function functionWithoutBlock(node: ts.Node, log: LogInfo[]): boolean { let withoutBlock: boolean = ts.isArrowFunction(node) && node.body && ts.isCallExpression(node.body) && node.body.expression && hasJsonStringify(node.body.expression); if (ts.isArrowFunction(node) && withoutBlock) { - if (judgeReturnType(node.type) === ReturnType.notDefined) { - allocateKeyGeneratorType(log, node); - } else if (judgeReturnType(node.type) === ReturnType.complex) { + if (judgeReturnType(node.type) === ReturnType.complex) { remindComplexOfKeyGeneratorType(log, node); } } @@ -2442,7 +2448,6 @@ function functionWithBlock(node: ts.Node, log: LogInfo[]): boolean { if (node.body && ts.isBlock(node.body)) { ts.forEachChild(node, (node)=>{traverseReturnStatement(node, useStringify)}) } - allocateKeyGeneratorType(log, node); return useStringify.length && useStringify[useStringify.length-1]; } else if (judgeReturnType(node.type) === ReturnType.complex) { remindComplexOfKeyGeneratorType(log, node); @@ -2484,13 +2489,6 @@ function judgeArrayDeclaration(declaration: ts.Node, targetArray: ts.Node, log: pos: declaration.getStart(), }) break; - case ReturnType.notCompatible: - log.push({ - type: LogType.WARN, - message: "The first parameter in ForEach component should be an array", - pos: targetArray.getStart(), - }) - break; case ReturnType.complex: log.push({ type: LogType.WARN, @@ -2609,18 +2607,18 @@ function judgeType(type: ts.TypeNode): ReturnType { function notRecognizeArrayType(log: LogInfo[], target: ts.Node): void { log.push({ - type: LogType.WARN, - message: `If the type of array's each item is not a simple type, ` + - `use JSON.stringify to serialize the key generator in 3rd parameter of ForEach Component`, + type: LogType.NOTE, + message: `Make sure the key generator in 3rd parameter of ForEach Component is different when item needs to be updated, ` + + `If the type of the key generator is not a simple type, use JSON.stringify to serialize it instead of object.toString()`, pos: target.getStart(), }) } function notRecognizeObjectType(log: LogInfo[], target: ts.Node): void { log.push({ - type: LogType.WARN, - message: `If the return type of Object's method getData is not a simple type, ` + - `use JSON.stringify to serialize the key generator in 3rd parameter of LazyForEach Component`, + type: LogType.NOTE, + message: `Make sure the key generator in 3rd parameter of LazyForEach Component is different when item needs to be updated, ` + + `If the type of the key generator is not a simple type, use JSON.stringify to serialize it instead of object.toString()`, pos: target.getStart(), }) } @@ -2633,14 +2631,6 @@ function allocateGetDataType(log: LogInfo[], target: ts.Node): void { }) } -function allocateKeyGeneratorType(log: LogInfo[], target: ts.Node): void { - log.push({ - type: LogType.WARN, - message: "Better allocate a type of key generator function", - pos: target.getStart(), - }) -} - function remindComplexOfKeyGeneratorType(log: LogInfo[], target: ts.Node): void { log.push({ type: LogType.WARN, diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index 2d2a02a..fb051e1 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -91,8 +91,7 @@ import { linkCollection, localStorageLinkCollection, localStoragePropCollection, - propCollection, - getObservedPropertyCollection + propCollection } from './validate_ui_syntax'; import { addConstructor, @@ -423,9 +422,6 @@ function processBuildMember(node: ts.MethodDeclaration, context: ts.Transformati ts.factory.createIdentifier(FOREACH_OBSERVED_OBJECT), ts.factory.createIdentifier(FOREACH_GET_RAW_OBJECT)), undefined, [node]); } - if (partialUpdateConfig.partialUpdateMode && partialUpdateConfig.strictCheck) { - checkJsonStringifyNode(node, log); - } return ts.visitEachChild(node, visitBuild, context); } function checkStateName(node: ts.PropertyAccessExpression): string { @@ -436,25 +432,6 @@ function processBuildMember(node: ts.MethodDeclaration, context: ts.Transformati } } -function checkJsonStringifyNode(node: ts.Node, log: LogInfo[]): void { - if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) && - isJsonStringifyNode(node.expression) && node.arguments.length) { - const currentObservedPropertyCollection: Set = getObservedPropertyCollection( - componentCollection.currentClassName); - node.arguments.forEach((property: ts.Node) => { - if (ts.isPropertyAccessExpression(property) && - property.expression.kind === ts.SyntaxKind.ThisKeyword && ts.isIdentifier(property.name) && - currentObservedPropertyCollection.has(property.name.escapedText.toString())) { - log.push({ - type: LogType.WARN, - message: 'If the state variable is used as the parameter of the JSON.stringify method, UI is not refreshed.', - pos: property.getStart() || property.pos - }); - } - }); - } -} - function isJsonStringifyNode(node: ts.PropertyAccessExpression): boolean { return ts.isIdentifier(node.expression) && node.expression.escapedText.toString() === 'JSON' && ts.isIdentifier(node.name) && node.name.escapedText.toString() === 'stringify'; diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index be03fdf..b0a4bf7 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -441,7 +441,7 @@ function judgeArrayType(node: ts.Node, log: LogInfo[]): void { function remindObserved(log: LogInfo[], node: ts.Node): void { log.push({ - type: LogType.WARN, + type: LogType.NOTE, message: `Make sure this type is a Class with @Observed decorator, ` + `or it's property may not update when you change this state variable`, pos: node.getStart() @@ -495,7 +495,7 @@ function isObscureArrayType(type: ts.Node, log: LogInfo[]): void { case ts.SyntaxKind.TupleType: case ts.SyntaxKind.VoidKeyword: log.push({ - type: LogType.WARN, + type: LogType.NOTE, message: `Please give a exact type of Array`, pos: type.getStart() }) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index a0a74ba..5c52107 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -316,7 +316,7 @@ function validateCustomComponentPrams(node: ts.CallExpression, name: string, if (partialUpdateConfig.partialUpdateMode && partialUpdateConfig.strictCheck && item.initializer && ts.isCallExpression(item.initializer)) { log.push({ - type: LogType.WARN, + type: LogType.NOTE, message: 'If method assignment is used here, the UI may not be updated.', pos: item.initializer.getStart() }); @@ -325,7 +325,7 @@ function validateCustomComponentPrams(node: ts.CallExpression, name: string, if (propertyObservedKinds.length == 0 && nodeArgument.properties.length > 0 && partialUpdateConfig.partialUpdateMode && partialUpdateConfig.strictCheck) { log.push({ - type: LogType.WARN, + type: LogType.NOTE, message: `You do not use any state variables for the component '${name}', ` + `UI of the component will not be update.`, pos: node.getStart() -- Gitee From 427894dfb99bfe93626cca51efcd60c34a7664b4 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 5 Dec 2022 16:23:59 +0800 Subject: [PATCH 194/379] houhaoyu@huawei.com @Prop support Object Signed-off-by: houhaoyu Change-Id: Ie72ef0d10019eec40f4878fd415ec4a858c408ed --- compiler/src/pre_define.ts | 1 + compiler/src/process_component_member.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 2053c57..10507b3 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -335,6 +335,7 @@ export const GLOBAL_THIS: string = 'globalThis'; export const OBSERVED_PROPERTY_SIMPLE_PU: string = 'ObservedPropertySimplePU'; export const OBSERVED_PROPERTY_OBJECT_PU: string = 'ObservedPropertyObjectPU'; export const SYNCHED_PROPERTY_SIMPLE_ONE_WAY_PU: string = 'SynchedPropertySimpleOneWayPU'; +export const SYNCHED_PROPERTY_OBJECT_ONE_WAY_PU: string = 'SynchedPropertyObjectOneWayPU'; export const SYNCHED_PROPERTY_SIMPLE_TWO_WAY_PU: string = 'SynchedPropertySimpleTwoWayPU'; export const SYNCHED_PROPERTY_OBJECT_TWO_WAY_PU: string = 'SynchedPropertyObjectTwoWayPU'; export const SYNCHED_PROPERTY_NESED_OBJECT_PU: string = 'SynchedPropertyNesedObjectPU'; diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index b0a4bf7..52f7a0c 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -65,6 +65,7 @@ import { SYNCHED_PROPERTY_SIMPLE_TWO_WAY_PU, SYNCHED_PROPERTY_OBJECT_TWO_WAY_PU, SYNCHED_PROPERTY_SIMPLE_ONE_WAY_PU, + SYNCHED_PROPERTY_OBJECT_ONE_WAY_PU, SYNCHED_PROPERTY_NESED_OBJECT_PU, COMPONENT_CUSTOM_DECORATOR, THIS, @@ -1183,7 +1184,8 @@ function updateSynchedPropertyOneWayPU(nameIdentifier: ts.Identifier, type: ts.T return createInitExpressionStatementForDecorator(name, SYNCHED_PROPERTY_SIMPLE_ONE_WAY_PU, createPropertyAccessExpressionWithParams(name)); } else { - validateNonSimpleType(nameIdentifier, decoractor, log); + return createInitExpressionStatementForDecorator(name, SYNCHED_PROPERTY_OBJECT_ONE_WAY_PU, + createPropertyAccessExpressionWithParams(name)); } } -- Gitee From 1bbec553789b4814a7e7d655cb375104db3039b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 5 Dec 2022 17:19:11 +0800 Subject: [PATCH 195/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/main.js | 9 ++--- compiler/src/process_component_build.ts | 51 +++++++++++++++++++++++- compiler/src/process_component_class.ts | 5 --- compiler/src/process_component_member.ts | 4 +- compiler/src/process_custom_component.ts | 8 ++-- 5 files changed, 59 insertions(+), 18 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index eab7102..68d4404 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -514,12 +514,11 @@ function isPartialUpdate(metadata) { item.value && item.value === 'true') { partialUpdateConfig.partialUpdateMode = true; } - if (item.name && item.name === 'partialUpdateStrictCheck' && - item.value && item.value === 'true') { - partialUpdateConfig.strictCheck = true; + if (item.name && item.name === 'partialUpdateStrictCheck' && item.value) { + partialUpdateConfig.strictCheck = item.value; } return partialUpdateConfig.partialUpdateMode && - partialUpdateConfig.strictCheck; + partialUpdateConfig.strictCheck; }); } } @@ -539,7 +538,7 @@ const globalProgram = { }; const partialUpdateConfig = { - strictCheck: false, + strictCheck: undefined, partialUpdateMode: false }; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 82610ed..52e4ed9 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -146,6 +146,10 @@ import { import { transformLog, contextGlobal } from './process_ui_syntax'; import { props } from './compile_info'; +const checkComponents: Set = new Set([ + "TextArea", "TextInput", "GridContainer" +]); + export function processComponentBuild(node: ts.MethodDeclaration, log: LogInfo[]): ts.MethodDeclaration { let newNode: ts.MethodDeclaration; @@ -1301,7 +1305,7 @@ function processElseStatement(elseStatement: ts.Statement, id: number, } function checkHasThisKeyword(node: ts.Statement, log: LogInfo[]): void { - if (partialUpdateConfig.strictCheck && partialUpdateConfig.partialUpdateMode && + if (partialUpdateConfig.strictCheck === 'all' && partialUpdateConfig.partialUpdateMode && node && node.getText()) { if (node.getText().indexOf(THIS) >= 0) { const currentObservedPropertyCollection: Set = getObservedPropertyCollection( @@ -1524,6 +1528,49 @@ export function bindComponentAttr(node: ts.ExpressionStatement, identifierNode: if (statements.length) { reverse ? newStatements.push(...statements.reverse()) : newStatements.push(...statements); } + if (partialUpdateConfig.strictCheck === 'all' && partialUpdateConfig.partialUpdateMode && + checkComponents.has(identifierNode.escapedText.toString())) { + checkComponentInitializer(identifierNode.escapedText.toString(), node, log); + } +} + +function checkComponentInitializer(name: string, node: ts.ExpressionStatement, log: LogInfo[]): void { + let textLogFlag: boolean = false; + if (name === 'TextArea' || name === 'TextInput') { + textLogFlag = true; + } + if (node.expression && node.expression.arguments && node.expression.arguments.length && + ts.isObjectLiteralExpression(node.expression.arguments[0])) { + node.expression.arguments[0].properties.forEach(property => { + if ((name === 'TextArea' || name === 'TextInput') && property.name && + ts.isIdentifier(property.name) && property.name.escapedText.toString() === 'text' && + property.initializer && ts.isPropertyAccessExpression(property.initializer) && + property.initializer.expression && + property.initializer.expression.kind === ts.SyntaxKind.ThisKeyword && + property.initializer.name.escapedText) { + const observedPropertyCollection: Set = getObservedPropertyCollection( + componentCollection.currentClassName); + if (observedPropertyCollection.has(property.initializer.name.escapedText.tostring())) { + textLogFlag = false; + } + } else if (name === 'GridContainer' && property.name && ts.isIdentifier(property.name) && + property.name.escapedText === 'margin') { + log.push({ + type: LogType.NOTE, + message: `In API9, the margin attribute of GridContainer takes effect.`, + pos: node.getStart() + }) + } + }); + } + if (textLogFlag) { + log.push({ + type: LogType.NOTE, + message: `If the text property value does not use the state variable,` + + ` the text content will not be updated.`, + pos: node.getStart() + }) + } } function processCustomBuilderProperty(node: ts.CallExpression, identifierNode: ts.Identifier, @@ -2402,7 +2449,7 @@ function judgeTargetType(target: ts.Node, log: LogInfo[], TypeChecker: ts.TypeCh judgeDeclaration(declaration, target, log, name, TypeChecker); } } - } else { + } else if (partialUpdateConfig.strictCheck === 'all') { if (name === COMPONENT_FOREACH) { notRecognizeArrayType(log, target); } else { diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index fb051e1..544e0bc 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -432,11 +432,6 @@ function processBuildMember(node: ts.MethodDeclaration, context: ts.Transformati } } -function isJsonStringifyNode(node: ts.PropertyAccessExpression): boolean { - return ts.isIdentifier(node.expression) && node.expression.escapedText.toString() === 'JSON' && - ts.isIdentifier(node.name) && node.name.escapedText.toString() === 'stringify'; -} - function isGeometryView(node: ts.Node): boolean { if (ts.isExpressionStatement(node) && ts.isCallExpression(node.expression)) { const call: ts.CallExpression = node.expression; diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index b0a4bf7..36a88a6 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -391,7 +391,7 @@ function processStateDecorators(node: ts.PropertyDeclaration, decorator: string, if (decorator !== COMPONENT_BUILDERPARAM_DECORATOR) { updateResult.setVariableGet(createGetAccessor(name, CREATE_GET_METHOD)); updateResult.setDeleteParams(true); - if (partialUpdateConfig.strictCheck && partialUpdateConfig.partialUpdateMode) { + if (partialUpdateConfig.strictCheck === 'all' && partialUpdateConfig.partialUpdateMode) { checkStatePropertyType(node, log); } } @@ -966,7 +966,7 @@ export function isSimpleType(typeNode: ts.TypeNode, program: ts.Program, log?: L if (typeNode.parent && typeNode.parent.name && typeNode.kind === ts.SyntaxKind.AnyKeyword && log) { log.push({ - type: partialUpdateConfig.partialUpdateMode ? LogType.ERROR : LogType.WARN, + type: LogType.WARN, message: `Please define an explicit type, not any.`, pos: typeNode.getStart() }); diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 5c52107..f300905 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -313,7 +313,7 @@ function validateCustomComponentPrams(node: ts.CallExpression, name: string, } props.push(item); } - if (partialUpdateConfig.partialUpdateMode && partialUpdateConfig.strictCheck && + if (partialUpdateConfig.strictCheck === 'all' && partialUpdateConfig.partialUpdateMode && item.initializer && ts.isCallExpression(item.initializer)) { log.push({ type: LogType.NOTE, @@ -322,8 +322,8 @@ function validateCustomComponentPrams(node: ts.CallExpression, name: string, }); } }); - if (propertyObservedKinds.length == 0 && nodeArgument.properties.length > 0 && - partialUpdateConfig.partialUpdateMode && partialUpdateConfig.strictCheck) { + if (partialUpdateConfig.strictCheck === 'all' && partialUpdateConfig.partialUpdateMode && + propertyObservedKinds.length === 0 && nodeArgument.properties.length > 0) { log.push({ type: LogType.NOTE, message: `You do not use any state variables for the component '${name}', ` + @@ -670,7 +670,7 @@ function validateIllegalInitFromParent(node: ts.ObjectLiteralElementLike, proper curPropertyKind === COMPONENT_PROP_DECORATOR) { type = LogType.WARN; } - if (projectConfig.xtsMode && parentPropertyKind === COMPONENT_STATE_DECORATOR && + if (parentPropertyKind === COMPONENT_STATE_DECORATOR && curPropertyKind === COMPONENT_STATE_DECORATOR) { type = LogType.WARN; } -- Gitee From 175bced796b7cce1505482c54ffddb3f346bb7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 5 Dec 2022 09:38:06 +0000 Subject: [PATCH 196/379] update compiler/src/process_component_build.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_build.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 52e4ed9..67eaf98 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1528,21 +1528,23 @@ export function bindComponentAttr(node: ts.ExpressionStatement, identifierNode: if (statements.length) { reverse ? newStatements.push(...statements.reverse()) : newStatements.push(...statements); } + const componentName: string = identifierNode.escapedText.toString(); if (partialUpdateConfig.strictCheck === 'all' && partialUpdateConfig.partialUpdateMode && - checkComponents.has(identifierNode.escapedText.toString())) { - checkComponentInitializer(identifierNode.escapedText.toString(), node, log); + checkComponents.has(componentName)) { + checkComponentInitializer(componentName, node, log); } } function checkComponentInitializer(name: string, node: ts.ExpressionStatement, log: LogInfo[]): void { let textLogFlag: boolean = false; - if (name === 'TextArea' || name === 'TextInput') { + const textList: Set = new Set(['TextArea', 'TextInput']); + if (textList.has(name)) { textLogFlag = true; } if (node.expression && node.expression.arguments && node.expression.arguments.length && ts.isObjectLiteralExpression(node.expression.arguments[0])) { node.expression.arguments[0].properties.forEach(property => { - if ((name === 'TextArea' || name === 'TextInput') && property.name && + if (textList.has(name) && property.name && ts.isIdentifier(property.name) && property.name.escapedText.toString() === 'text' && property.initializer && ts.isPropertyAccessExpression(property.initializer) && property.initializer.expression && -- Gitee From ef34b36c678eae561117ec789858f89f647d4c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 5 Dec 2022 09:39:23 +0000 Subject: [PATCH 197/379] update compiler/src/process_component_build.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_build.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 67eaf98..543fa95 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1561,7 +1561,8 @@ function checkComponentInitializer(name: string, node: ts.ExpressionStatement, l type: LogType.NOTE, message: `In API9, the margin attribute of GridContainer takes effect.`, pos: node.getStart() - }) + }); + return; } }); } -- Gitee From 16fddd626562dfa5a46bed0561738a2f0f1bef28 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 5 Dec 2022 18:19:37 +0800 Subject: [PATCH 198/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit import正则解析错误修复 Signed-off-by: houhaoyu Change-Id: Ie16b9c9f4dfbdddcd0d8665a9f1df0ddf51dc8f0 --- compiler/src/process_import.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index 170455c..39d9931 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -167,7 +167,8 @@ function visitAllNode(node: ts.Node, sourceFile: ts.SourceFile, defaultNameFromP if (ts.isEnumDeclaration(node) && node.name) { enumCollection.add(node.name.getText()); } - if (ts.isClassDeclaration(node) && ts.isIdentifier(node.name) && isCustomComponent(node)) { + if ((ts.isClassDeclaration(node) || ts.isStructDeclaration(node)) && ts.isIdentifier(node.name) && + isCustomComponent(node)) { addDependencies(node, defaultNameFromParent, asNameFromParent); isExportEntry(node, log, entryCollection, exportCollection, defaultCollection, fileResolvePath, sourceFile); if (asExportCollection.has(node.name.getText())) { @@ -497,7 +498,7 @@ function isModule(filePath: string): boolean { return !/^(\.|\.\.)?\//.test(filePath) || filePath.indexOf(NODE_MODULES) > -1; } -function isCustomComponent(node: ts.ClassDeclaration): boolean { +function isCustomComponent(node: ts.ClassDeclaration | ts.StructDeclaration): boolean { if (node.decorators && node.decorators.length) { for (let i = 0; i < node.decorators.length; ++i) { const decoratorName: ts.Identifier = node.decorators[i].expression as ts.Identifier; -- Gitee From d11ebcd668286d811b73b19e728eb68443d657d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 5 Dec 2022 10:41:00 +0000 Subject: [PATCH 199/379] update compiler/src/process_component_build.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 543fa95..25e3d01 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1552,7 +1552,7 @@ function checkComponentInitializer(name: string, node: ts.ExpressionStatement, l property.initializer.name.escapedText) { const observedPropertyCollection: Set = getObservedPropertyCollection( componentCollection.currentClassName); - if (observedPropertyCollection.has(property.initializer.name.escapedText.tostring())) { + if (observedPropertyCollection.has(property.initializer.name.escapedText.toString())) { textLogFlag = false; } } else if (name === 'GridContainer' && property.name && ts.isIdentifier(property.name) && -- Gitee From c39ec573442c737d7beeb45b3be4a88de813dfe3 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Mon, 5 Dec 2022 11:16:55 +0800 Subject: [PATCH 200/379] Fix compatible version 8 Signed-off-by: zhangrengao Change-Id: I7adf92b9785a107822a0ce1323b000e2aa9a4b58 --- compiler/src/gen_abc_plugin.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 11b9072..0ed24b1 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -244,7 +244,7 @@ export class GenAbcPlugin { return; } buildPathInfo = output; - if (isTs2Abc()) { + if (isTs2Abc() || process.env.minPlatformVersion === "8") { if (previewCount == compileCount) { previewCount++; invokeWorkersToGenAbc(); @@ -818,10 +818,6 @@ function invokeWorkersToGenAbc(): void { } filterIntermediateJsBundleByHashJson(buildPathInfo, intermediateJsBundle); - if (fileterIntermediateJsBundle.length === 0) { - processExtraAsset(); - return; - } const splitedBundles: any[] = splitJsBundlesBySize(fileterIntermediateJsBundle, maxWorkerNumber); const workerNumber: number = maxWorkerNumber < splitedBundles.length ? maxWorkerNumber : splitedBundles.length; -- Gitee From bc96a991c82ace414755de34e1b3a1b8be874cc7 Mon Sep 17 00:00:00 2001 From: bojiang Date: Mon, 5 Dec 2022 20:32:36 +0800 Subject: [PATCH 201/379] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 最小化更新自定义组件属性场景加入 Signed-off-by: bojiang Change-Id: I65ea9383cf0902582417f8cbfa32d4bfd088b06d --- compiler/src/process_custom_component.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 5c52107..dcd05ef 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -184,24 +184,24 @@ function addCustomComponent(node: ts.ExpressionStatement, newStatements: ts.Stat if (ts.isNewExpression(newNode)) { const propertyArray: ts.ObjectLiteralElementLike[] = []; validateCustomComponentPrams(componentNode, name, propertyArray, log); - addCustomComponentStatements(node, newStatements, newNode, name, propertyArray, isBuilder, isGlobalBuilder); + addCustomComponentStatements(node, newStatements, newNode, name, propertyArray, componentNode, isBuilder, isGlobalBuilder); } } function addCustomComponentStatements(node: ts.ExpressionStatement, newStatements: ts.Statement[], newNode: ts.NewExpression, name: string, props: ts.ObjectLiteralElementLike[], - isBuilder: boolean = false, isGlobalBuilder: boolean = false): void { + componentNode: ts.CallExpression, isBuilder: boolean = false, isGlobalBuilder: boolean = false): void { if (!partialUpdateConfig.partialUpdateMode) { const id: string = componentInfo.id.toString(); newStatements.push(createFindChildById(id, name, isBuilder), createCustomComponentIfStatement(id, ts.factory.updateExpressionStatement(node, createViewCreate(newNode)), ts.factory.createObjectLiteralExpression(props, true), name)); } else { - newStatements.push(createCustomComponent(node, newNode, name, isGlobalBuilder)); + newStatements.push(createCustomComponent(node, newNode, name, componentNode, isGlobalBuilder)); } } -function createChildElmtId(node: ts.ExpressionStatement, name: string): ts.PropertyAssignment[] { +function createChildElmtId(node: ts.CallExpression, name: string): ts.PropertyAssignment[] { const propsAndObjectLinks: string[] = []; const childParam: ts.PropertyAssignment[] = []; if (propCollection.get(name)) { @@ -210,8 +210,8 @@ function createChildElmtId(node: ts.ExpressionStatement, name: string): ts.Prope if (objectLinkCollection.get(name)) { propsAndObjectLinks.push(...objectLinkCollection.get(name)); } - if (node.expression.arguments[0].properties) { - node.expression.arguments[0].properties.forEach(item => { + if (node.arguments[0].properties) { + node.arguments[0].properties.forEach(item => { if (ts.isIdentifier(item.name) && propsAndObjectLinks.includes(item.name.escapedText.toString())) { childParam.push(item); } @@ -221,10 +221,10 @@ function createChildElmtId(node: ts.ExpressionStatement, name: string): ts.Prope } function createCustomComponent(node: ts.ExpressionStatement, newNode: ts.NewExpression, name: string, - isGlobalBuilder: boolean = false): ts.Block { + componentNode: ts.CallExpression, isGlobalBuilder: boolean = false): ts.Block { let componentParameter: ts.ObjectLiteralExpression; - if (node.expression && node.expression.arguments && node.expression.arguments.length) { - componentParameter = ts.factory.createObjectLiteralExpression(createChildElmtId(node, name), true); + if (componentNode.arguments && componentNode.arguments.length) { + componentParameter = ts.factory.createObjectLiteralExpression(createChildElmtId(componentNode, name), true); } else { componentParameter = ts.factory.createObjectLiteralExpression([], false); } -- Gitee From fc18b490aa41fa53416161958b58444e4cbe571b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 5 Dec 2022 13:47:47 +0000 Subject: [PATCH 202/379] update compiler/src/process_component_build.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_build.ts | 41 ++++++++++++------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 25e3d01..3e0643d 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1536,25 +1536,32 @@ export function bindComponentAttr(node: ts.ExpressionStatement, identifierNode: } function checkComponentInitializer(name: string, node: ts.ExpressionStatement, log: LogInfo[]): void { - let textLogFlag: boolean = false; const textList: Set = new Set(['TextArea', 'TextInput']); - if (textList.has(name)) { - textLogFlag = true; - } if (node.expression && node.expression.arguments && node.expression.arguments.length && ts.isObjectLiteralExpression(node.expression.arguments[0])) { node.expression.arguments[0].properties.forEach(property => { if (textList.has(name) && property.name && - ts.isIdentifier(property.name) && property.name.escapedText.toString() === 'text' && - property.initializer && ts.isPropertyAccessExpression(property.initializer) && - property.initializer.expression && - property.initializer.expression.kind === ts.SyntaxKind.ThisKeyword && - property.initializer.name.escapedText) { - const observedPropertyCollection: Set = getObservedPropertyCollection( - componentCollection.currentClassName); - if (observedPropertyCollection.has(property.initializer.name.escapedText.toString())) { - textLogFlag = false; + ts.isIdentifier(property.name) && property.name.escapedText.toString() === 'text') { + let logFlag: boolean = true; + if (property.initializer && ts.isPropertyAccessExpression(property.initializer) && + property.initializer.expression && + property.initializer.expression.kind === ts.SyntaxKind.ThisKeyword && + property.initializer.name.escapedText) { + const observedPropertyCollection: Set = getObservedPropertyCollection( + componentCollection.currentClassName); + if (observedPropertyCollection.has(property.initializer.name.escapedText.toString())) { + logFlag = false; + } } + if (logFlag) { + log.push({ + type: LogType.NOTE, + message: `If the text property value does not use the state variable,` + + ` the text content will not be updated.`, + pos: node.getStart() + }); + } + return; } else if (name === 'GridContainer' && property.name && ts.isIdentifier(property.name) && property.name.escapedText === 'margin') { log.push({ @@ -1566,14 +1573,6 @@ function checkComponentInitializer(name: string, node: ts.ExpressionStatement, l } }); } - if (textLogFlag) { - log.push({ - type: LogType.NOTE, - message: `If the text property value does not use the state variable,` + - ` the text content will not be updated.`, - pos: node.getStart() - }) - } } function processCustomBuilderProperty(node: ts.CallExpression, identifierNode: ts.Identifier, -- Gitee From e13e35ecc0a737fc011cf5bb7267d15352a13ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 5 Dec 2022 15:00:35 +0000 Subject: [PATCH 203/379] update compiler/src/process_component_build.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_build.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 3e0643d..cc5dc2b 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -481,6 +481,11 @@ function processNormalComponent(node: ts.ExpressionStatement, nameResult: NameRe newStatements.push(res.newNode); processDebug(node, nameResult, newStatements); const etsComponentResult: EtsComponentResult = parseEtsComponentExpression(node); + if (res.identifierNode.escapedText && partialUpdateConfig.strictCheck === 'all' && + partialUpdateConfig.partialUpdateMode) { + checkComponentInitializer( + res.identifierNode.escapedText.toString(), etsComponentResult.etsComponentNode, log); + } if (PROPERTIES_ADD_DOUBLE_DOLLAR.has(res.identifierNode.getText()) && etsComponentResult.etsComponentNode.arguments && etsComponentResult.etsComponentNode.arguments.length) { etsComponentResult.etsComponentNode = processDollarEtsComponent(etsComponentResult.etsComponentNode, @@ -1528,18 +1533,16 @@ export function bindComponentAttr(node: ts.ExpressionStatement, identifierNode: if (statements.length) { reverse ? newStatements.push(...statements.reverse()) : newStatements.push(...statements); } - const componentName: string = identifierNode.escapedText.toString(); - if (partialUpdateConfig.strictCheck === 'all' && partialUpdateConfig.partialUpdateMode && - checkComponents.has(componentName)) { - checkComponentInitializer(componentName, node, log); - } } function checkComponentInitializer(name: string, node: ts.ExpressionStatement, log: LogInfo[]): void { + if (!checkComponents.has(name)) { + return; + } const textList: Set = new Set(['TextArea', 'TextInput']); - if (node.expression && node.expression.arguments && node.expression.arguments.length && - ts.isObjectLiteralExpression(node.expression.arguments[0])) { - node.expression.arguments[0].properties.forEach(property => { + if (node.arguments && node.arguments.length && + ts.isObjectLiteralExpression(node.arguments[0])) { + node.arguments[0].properties.forEach(property => { if (textList.has(name) && property.name && ts.isIdentifier(property.name) && property.name.escapedText.toString() === 'text') { let logFlag: boolean = true; @@ -1563,7 +1566,7 @@ function checkComponentInitializer(name: string, node: ts.ExpressionStatement, l } return; } else if (name === 'GridContainer' && property.name && ts.isIdentifier(property.name) && - property.name.escapedText === 'margin') { + property.name.escapedText && property.name.escapedText.toString() === 'margin') { log.push({ type: LogType.NOTE, message: `In API9, the margin attribute of GridContainer takes effect.`, -- Gitee From ffa77c5638ca331dd6f08f7283000674508a9fd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Tue, 6 Dec 2022 16:39:48 +0800 Subject: [PATCH 204/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index f300905..46b11ff 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -428,11 +428,11 @@ function checkFromParentToChild(node: ts.ObjectLiteralElementLike, customCompone } } else { parentPropertyName = - getParentPropertyName(node as ts.PropertyAssignment, curPropertyKind, log);; + getParentPropertyName(node as ts.PropertyAssignment, curPropertyKind, log); const parentPropertyKind = COMPONENT_NON_DECORATOR; if (!isCorrectInitFormParent(parentPropertyKind, curPropertyKind)) { validateIllegalInitFromParent( - node, propertyName, curPropertyKind, parentPropertyName, parentPropertyKind, log); + node, propertyName, curPropertyKind, parentPropertyName, parentPropertyKind, log, LogType.WARN); } } } @@ -608,10 +608,11 @@ function validateForbiddenToInitViaParam(node: ts.ObjectLiteralElementLike, ...getCollectionSet(customComponentName, storagePropCollection), ...getCollectionSet(customComponentName, consumeCollection) ]); - getLocalStorageCollection(customComponentName, forbiddenToInitViaParamSet); - if (isThisProperty(node, forbiddenToInitViaParamSet)) { + const localStorageSet: Set = new Set(); + getLocalStorageCollection(customComponentName, localStorageSet); + if (isThisProperty(node, forbiddenToInitViaParamSet) || isThisProperty(node, localStorageSet)) { log.push({ - type: LogType.ERROR, + type: localStorageSet.has(node.name.getText()) ? LogType.WARN : LogType.ERROR, message: `Property '${node.name.getText()}' in the custom component '${customComponentName}'` + ` cannot initialize here (forbidden to specify).`, pos: node.name.getStart() @@ -664,13 +665,14 @@ function validateMandatoryToInitViaParam(node: ts.ExpressionStatement, customCom function validateIllegalInitFromParent(node: ts.ObjectLiteralElementLike, propertyName: string, curPropertyKind: string, parentPropertyName: string, parentPropertyKind: string, - log: LogInfo[]): void { + log: LogInfo[], inputType:LogType = undefined): void { let type: LogType = LogType.ERROR; - if ((parentPropertyKind === COMPONENT_NON_DECORATOR && !partialUpdateConfig.partialUpdateMode) || + if (inputType) { + type = inputType; + } else if ((parentPropertyKind === COMPONENT_NON_DECORATOR && !partialUpdateConfig.partialUpdateMode) || curPropertyKind === COMPONENT_PROP_DECORATOR) { type = LogType.WARN; - } - if (parentPropertyKind === COMPONENT_STATE_DECORATOR && + } else if (parentPropertyKind === COMPONENT_STATE_DECORATOR && curPropertyKind === COMPONENT_STATE_DECORATOR) { type = LogType.WARN; } -- Gitee From 2e6297a5641d9f12a7349700b50e623d4d26a16d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Tue, 6 Dec 2022 09:20:55 +0000 Subject: [PATCH 205/379] update compiler/src/process_custom_component.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 46b11ff..cbc464a 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -665,11 +665,11 @@ function validateMandatoryToInitViaParam(node: ts.ExpressionStatement, customCom function validateIllegalInitFromParent(node: ts.ObjectLiteralElementLike, propertyName: string, curPropertyKind: string, parentPropertyName: string, parentPropertyKind: string, - log: LogInfo[], inputType:LogType = undefined): void { + log: LogInfo[], inputType: LogType = undefined): void { let type: LogType = LogType.ERROR; if (inputType) { type = inputType; - } else if ((parentPropertyKind === COMPONENT_NON_DECORATOR && !partialUpdateConfig.partialUpdateMode) || + } else if (parentPropertyKind === COMPONENT_NON_DECORATOR && curPropertyKind === COMPONENT_PROP_DECORATOR) { type = LogType.WARN; } else if (parentPropertyKind === COMPONENT_STATE_DECORATOR && -- Gitee From 55d8954d0e3208ed9cd11b41bc98a3d6e865982a Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 6 Dec 2022 20:07:24 +0800 Subject: [PATCH 206/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复极速预览错误连接报错问题 Signed-off-by: houhaoyu Change-Id: Iedc5dedd857ce8876c8fdfc28eb6e0715a19c255 --- compiler/server/build_pipe_server.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index 0cfd471..cafad2a 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -85,8 +85,11 @@ function init(port) { function handlePluginConnect(ws) { ws.on('message', function(message) { pluginSocket = ws; - const jsonData = JSON.parse(message); - handlePluginCommand(jsonData); + try { + const jsonData = JSON.parse(message); + handlePluginCommand(jsonData); + } catch(e) { + } }); } -- Gitee From 4d665ccc4ec503f120db3098d09a8e0f5b02ad09 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Tue, 6 Dec 2022 15:28:40 +0800 Subject: [PATCH 207/379] Delete filter modules code Signed-off-by: zhangrengao Change-Id: Id47d1f08dfa41c920fbea0078492d3eb2bed6bd4 --- compiler/src/gen_abc_plugin.ts | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 0ed24b1..ab2436e 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -676,13 +676,6 @@ function invokeClusterModuleToAbc(): void { process.exitCode = SUCCESS; } filterIntermediateModuleByHashJson(buildPathInfo, moduleInfos); - filterModuleInfos.forEach(moduleInfo => { - if (moduleInfo.isCommonJs) { - commonJsModuleInfos.push(moduleInfo); - } else { - ESMModuleInfos.push(moduleInfo); - } - }); const abcArgs: string[] = initAbcEnv(); const clusterNewApiVersion: number = 16; @@ -699,12 +692,7 @@ function invokeClusterModuleToAbc(): void { }); } - let totalWorkerNumber = 0; - let commonJsWorkerNumber: number = invokeClusterByModule(abcArgs, commonJsModuleInfos); - totalWorkerNumber += commonJsWorkerNumber; - - let esmWorkerNumber: number = invokeClusterByModule(abcArgs, ESMModuleInfos, true); - totalWorkerNumber += esmWorkerNumber; + let workerNumber: number = invokeClusterByModule(abcArgs, filterModuleInfos); let count_ = 0; if (process.env.watchMode === 'true') { @@ -715,7 +703,7 @@ function invokeClusterModuleToAbc(): void { process.exitCode = FAIL; } count_++; - if (count_ === totalWorkerNumber) { + if (count_ === workerNumber) { if (process.env.watchMode === 'true' && compileCount < previewCount) { compileCount++; processExtraAsset(); @@ -740,7 +728,7 @@ function invokeClusterModuleToAbc(): void { }); // for preview of without incre compile - if (totalWorkerNumber === 0 && process.env.watchMode === 'true') { + if (workerNumber === 0 && process.env.watchMode === 'true') { processExtraAsset(); } } @@ -755,10 +743,6 @@ function invokeClusterByModule(abcArgs:string[], moduleInfos: Array, if (process.env.panda === TS2ABC) { workerNumber = 3; cmdPrefix = `${nodeJs} ${tempAbcArgs.join(' ')}`; - } else if (process.env.panda === ES2ABC || process.env.panda === 'undefined' || process.env.panda === undefined) { - workerNumber = os.cpus().length; - isModule ? tempAbcArgs.push('--module') : tempAbcArgs.push('--commonjs'); - cmdPrefix = `${tempAbcArgs.join(' ')}`; } else { logger.error(red, `ArkTS:ERROR please set panda module`, reset); } -- Gitee From 0d2acc6f9da936a4b604216bda912c979185ab7c Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 7 Dec 2022 15:57:51 +0800 Subject: [PATCH 208/379] houhaoyu@huawei.com change log type Signed-off-by: houhaoyu Change-Id: Ibf7dde99e7dee5c819c6138e54a70ca3462f6c0d --- compiler/src/process_component_build.ts | 12 ++++++------ compiler/src/process_component_member.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index cc5dc2b..349950a 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -2536,14 +2536,14 @@ function judgeArrayDeclaration(declaration: ts.Node, targetArray: ts.Node, log: switch (judgeArrayType(declaration.type)) { case ReturnType.notDefined: log.push({ - type: LogType.WARN, + type: LogType.NOTE, message: "Variable/function which used for ForEach component's 1st parameter should allocate a type", pos: declaration.getStart(), }) break; case ReturnType.complex: log.push({ - type: LogType.WARN, + type: LogType.NOTE, message: "if key generator(return type of ForEach's 3rd parameter) is a complex type, " + "should use JSON.stringify to serialize it", pos: targetArray.getStart(), @@ -2569,7 +2569,7 @@ function judgeClassDeclaration(declaration: ts.Node, targetClass: ts.Node, log: } } else { log.push({ - type: LogType.WARN, + type: LogType.NOTE, message: `Better allocate a type of this Object/Function/Method`, pos: declaration.getStart(), }) @@ -2677,7 +2677,7 @@ function notRecognizeObjectType(log: LogInfo[], target: ts.Node): void { function allocateGetDataType(log: LogInfo[], target: ts.Node): void { log.push({ - type: LogType.WARN, + type: LogType.NOTE, message: `Should allocate a type of getData`, pos: target.getStart(), }) @@ -2685,7 +2685,7 @@ function allocateGetDataType(log: LogInfo[], target: ts.Node): void { function remindComplexOfKeyGeneratorType(log: LogInfo[], target: ts.Node): void { log.push({ - type: LogType.WARN, + type: LogType.NOTE, message: "Return complex type, please use JSON.stringify to serialize it", pos: target.getStart(), }) @@ -2693,7 +2693,7 @@ function remindComplexOfKeyGeneratorType(log: LogInfo[], target: ts.Node): void function remindComplexOfGetDataType(log: LogInfo[], target: ts.Node): void { log.push({ - type: LogType.WARN, + type: LogType.NOTE, message: `If return type of getData is a complex type, ` + `use JSON.stringify to serialize the key generator in 3rd parameter of LazyForEach Component`, pos: target.getStart(), diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index e4fe715..8c07df2 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -470,7 +470,7 @@ function isArrayTypeNodeCommon(isSurface: boolean, node: ts.Node, log: LogInfo[] isArrayTypeNode(node, log, false); } else { log.push({ - type: LogType.WARN, + type: LogType.NOTE, message: `Better not nested Array in Array`, pos: node.getStart() }) -- Gitee From cb1a34c41f721ad2d813d6cb76931f779961b23c Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Wed, 7 Dec 2022 16:51:56 +0800 Subject: [PATCH 209/379] fix source map of ts Signed-off-by: zhangrengao Change-Id: If3aa6f2cdc9f28067da6048cfa939c00e73d6866 --- compiler/src/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 387b904..de8df68 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -508,8 +508,8 @@ export function writeFileSyncByNode(node: ts.SourceFile, toTsFile: boolean): voi } mkdirsSync(path.dirname(temporaryFile)); if (temporarySourceMapFile.length > 0 && projectConfig.buildArkMode === 'debug') { - mixedInfo.content += '\n' + "//# sourceMappingURL=" + path.basename(temporarySourceMapFile); - fs.writeFileSync(temporarySourceMapFile, JSON.stringify(mixedInfo.sourceMapJson)); + let source = toUnixPath(node.fileName).replace(toUnixPath(projectConfig.projectRootPath) + '/', ''); + newSourceMaps[source] = mixedInfo.sourceMapJson; } fs.writeFileSync(temporaryFile, mixedInfo.content); } -- Gitee From 47a48b5c34ba1b3a460ce99c83685d772fd66a7f Mon Sep 17 00:00:00 2001 From: bojiang Date: Mon, 5 Dec 2022 22:04:04 +0800 Subject: [PATCH 210/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I25e24e9e6ca7d6864feb44c35f869c8c527086e4 --- compiler/src/process_component_constructor.ts | 16 +++++----------- compiler/src/process_ui_syntax.ts | 5 ++--- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/compiler/src/process_component_constructor.ts b/compiler/src/process_component_constructor.ts index 2bec20d..cbd4027 100644 --- a/compiler/src/process_component_constructor.ts +++ b/compiler/src/process_component_constructor.ts @@ -88,13 +88,11 @@ function initConstructorParams(node: ts.ConstructorDeclaration, parentComponentN if (!ts.isIdentifier(parentComponentName)) { return; } - const localStorageNum: number = localStorageLinkCollection.get(parentComponentName.getText()).size + - localStoragePropCollection.get(parentComponentName.getText()).size; const paramNames: Set = !partialUpdateConfig.partialUpdateMode ? new Set([ COMPONENT_CONSTRUCTOR_ID, COMPONENT_CONSTRUCTOR_PARENT, COMPONENT_CONSTRUCTOR_PARAMS, - localStorageNum ? COMPONENT_CONSTRUCTOR_LOCALSTORAGE : COMPONENT_CONSTRUCTOR_PARAMS + COMPONENT_CONSTRUCTOR_LOCALSTORAGE ]) : new Set([ COMPONENT_CONSTRUCTOR_PARENT, COMPONENT_CONSTRUCTOR_PARAMS, @@ -157,8 +155,6 @@ function addParamsType(ctorNode: ts.ConstructorDeclaration, modifyPara: ts.Param export function addConstructor(ctorNode: any, watchMap: Map, parentComponentName: ts.Identifier): ts.ConstructorDeclaration { const watchStatements: ts.ExpressionStatement[] = []; - const localStorageNum: number = localStorageLinkCollection.get(parentComponentName.getText()).size + - localStoragePropCollection.get(parentComponentName.getText()).size; watchMap.forEach((value, key) => { const watchNode: ts.ExpressionStatement = ts.factory.createExpressionStatement( ts.factory.createCallExpression( @@ -176,21 +172,19 @@ export function addConstructor(ctorNode: any, watchMap: Map, )); watchStatements.push(watchNode); }); - const callSuperStatement: ts.Statement = createCallSuperStatement(localStorageNum); + const callSuperStatement: ts.Statement = createCallSuperStatement(); const updateWithValueParamsStatement: ts.Statement = createUPdWithValStatement(); return updateConstructor(updateConstructor(ctorNode, [], [callSuperStatement], true), [], [updateWithValueParamsStatement, ...watchStatements], false, true, parentComponentName); } -function createCallSuperStatement(localStorageNum: number): ts.Statement { +function createCallSuperStatement(): ts.Statement { if (!partialUpdateConfig.partialUpdateMode) { return ts.factory.createExpressionStatement(ts.factory.createCallExpression( ts.factory.createSuper(), undefined, - localStorageNum ? [ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_ID), + [ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_ID), ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_LOCALSTORAGE)] : - [ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_ID), - ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT)])); + ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_LOCALSTORAGE)])); } else { return ts.factory.createExpressionStatement( ts.factory.createCallExpression(ts.factory.createSuper(), undefined, diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 83e3cd4..396b1a2 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -632,13 +632,12 @@ function createEntryFunction(name: string, context: ts.TransformationContext, ca let localStorageName: string; const localStorageNum: number = localStorageLinkCollection.get(name).size + localStoragePropCollection.get(name).size; - if (componentCollection.entryComponent === name && componentCollection.localStorageName && - localStorageNum) { + if (componentCollection.entryComponent === name && componentCollection.localStorageName) { localStorageName = componentCollection.localStorageName; } else if (componentCollection.entryComponent === name && !componentCollection.localStorageName && localStorageNum) { transformLog.errors.push({ - type: LogType.ERROR, + type: LogType.WARN, message: `@Entry should have a parameter, like '@Entry (storage)'.`, pos: componentCollection.entryComponentPos }); -- Gitee From 6654dbe7afd4c950ccaeb97c96cb70039ebcc9db Mon Sep 17 00:00:00 2001 From: hufeng Date: Thu, 8 Dec 2022 20:58:06 +0800 Subject: [PATCH 211/379] Polish Code Signed-off-by: hufeng Change-Id: I262702d681ad979e1e9a680abe8ffae1078583f1 --- compiler/src/utils.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 3f8840a..405e23a 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -399,11 +399,7 @@ export function writeFileSyncByString(sourcePath: string, sourceCode: string): v return; } - // replace relative moduleSpecifier with ohmURl - const REG_RELATIVE_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]((?:\.\/|\.\.\/).*)['"]/g; - sourceCode = sourceCode.replace(REG_RELATIVE_DEPENDENCY, (item, moduleRequest)=>{ - return replaceRelativeDependency(item, moduleRequest, toUnixPath(sourcePath)); - }); + sourceCode = transformModuleSpecifier(sourcePath, sourceCode); mkdirsSync(path.dirname(jsFilePath)); if (projectConfig.buildArkMode === 'debug') { @@ -449,6 +445,14 @@ function replaceRelativeDependency(item:string, moduleRequest: string, sourcePat return item; } +function transformModuleSpecifier(sourcePath: string, sourceCode: string): string { + // replace relative moduleSpecifier with ohmURl + const REG_RELATIVE_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]((?:\.\/|\.\.\/).*)['"]/g; + return sourceCode.replace(REG_RELATIVE_DEPENDENCY, (item, moduleRequest)=>{ + return replaceRelativeDependency(item, moduleRequest, toUnixPath(sourcePath)); + }); +} + export var newSourceMaps: Object = {}; export function generateSourceFilesToTemporary(sourcePath: string, sourceContent: string, sourceMap: any): void { @@ -470,11 +474,7 @@ export function generateSourceFilesToTemporary(sourcePath: string, sourceContent delete sourceMap.sourcesContent; newSourceMaps[source] = sourceMap; } - // replace relative moduleSpecifier with ohmURl - const REG_RELATIVE_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]((?:\.\/|\.\.\/).*)['"]/g; - sourceContent = sourceContent.replace(REG_RELATIVE_DEPENDENCY, (item, moduleRequest)=>{ - return replaceRelativeDependency(item, moduleRequest, toUnixPath(sourcePath)); - }); + sourceContent = transformModuleSpecifier(sourcePath, sourceContent); mkdirsSync(path.dirname(jsFilePath)); if (projectConfig.buildArkMode === 'debug') { -- Gitee From 7098c49d38db7a4d1cbd53030acc2fa7f1af7b06 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Fri, 9 Dec 2022 21:31:44 +0800 Subject: [PATCH 212/379] houhaoyu@huawei.com fix error warning Signed-off-by: houhaoyu Change-Id: I6e47051430a1c33170aedef57056d939c212b562 --- compiler/src/process_component_class.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index 544e0bc..f65299c 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -212,6 +212,7 @@ function processMembers(members: ts.NodeArray, parentComponentN addIntoNewMembers(newMembers, parentComponentName, updateParamsStatements, purgeVariableDepStatements, rerenderStatements, stateVarsStatements); newMembers.unshift(addConstructor(ctorNode, watchMap, parentComponentName)); + curPropMap.clear(); return newMembers; } @@ -363,7 +364,6 @@ function processComponentMethod(node: ts.MethodDeclaration, parentComponentName: } const buildNode: ts.MethodDeclaration = processComponentBuild(node, log); updateItem = processBuildMember(buildNode, context, log); - curPropMap.clear(); } else if (node.body && ts.isBlock(node.body)) { if (name === COMPONENT_TRANSITION_FUNCTION) { updateItem = ts.factory.updateMethodDeclaration(node, node.decorators, node.modifiers, -- Gitee From 99cbe491bafd3edf57e5d504c3bd4a3fe74a65ca Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sat, 10 Dec 2022 23:26:57 +0800 Subject: [PATCH 213/379] houhaoyu@huawei.com add ms Signed-off-by: houhaoyu Change-Id: Ib4979a0ecca481506778d79c3339b2151b940ee7 --- compiler/src/compile_info.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 44402dd..043e920 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -267,7 +267,7 @@ export class ResultStates { } } if (this.shouldWriteChangedList(watchModifiedFiles, watchRemovedFiles)) { - this.hotReloadIncrementalTime.hotReloadIncrementalStartTime = new Date().toLocaleString(); + this.hotReloadIncrementalTime.hotReloadIncrementalStartTime = new Date().getTime().toString(); watchRemovedFiles = watchRemovedFiles.map(file => path.relative(projectConfig.projectPath, file)); allModifiedFiles = new Set([...allModifiedFiles, ...watchModifiedFiles .filter(file => fs.statSync(file).isFile() && hotReloadSupportFiles.has(file)) @@ -439,7 +439,7 @@ export class ResultStates { private printSuccessInfo(blue: string, reset: string, resultInfo: string): void { if (projectConfig.hotReload) { - this.hotReloadIncrementalTime.hotReloadIncrementalEndTime = new Date().toLocaleString(); + this.hotReloadIncrementalTime.hotReloadIncrementalEndTime = new Date().getTime().toString(); console.info(blue, 'Incremental build start: ' + this.hotReloadIncrementalTime.hotReloadIncrementalStartTime +'\n' + 'Incremental build end: ' + this.hotReloadIncrementalTime.hotReloadIncrementalEndTime); } -- Gitee From 3a9b10a8645030a07b01af69fed1a8507483dd73 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sat, 10 Dec 2022 23:49:45 +0800 Subject: [PATCH 214/379] houhaoyu@huawei.com remove hot reload no file changed error Signed-off-by: houhaoyu Change-Id: I419dd4c06264d1efdeab2f9860b82e51f6b185d1 --- compiler/src/gen_abc_plugin.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index ab2436e..0a808e2 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -1109,7 +1109,6 @@ function handleHotReloadChangedFiles() { let changedFileListJson: string = fs.readFileSync(projectConfig.changedFileList).toString(); let changedFileList: Array = JSON.parse(changedFileListJson).modifiedFiles; if (typeof(changedFileList) == "undefined" || changedFileList.length == 0) { - logger.debug(blue, `ArkTS: No changed files found, skip hot reload build`, reset); return; } -- Gitee From 9bede6fe9c0b0e98a04423507a29af5cd0223193 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sun, 11 Dec 2022 21:14:11 +0800 Subject: [PATCH 215/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ts编译与检查时序问题修改 Signed-off-by: houhaoyu Change-Id: Ie557b8cf0c8dd9ec012663401c787600e090e634 --- compiler/src/compile_info.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index bf5a504..4446096 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -248,6 +248,7 @@ export class ResultStates { comp.removedFiles = comp.removedFiles || []; const watchModifiedFiles: string[] = [...comp.modifiedFiles]; let watchRemovedFiles: string[] = [...comp.removedFiles]; + process.env.watchEts = 'start'; this.clearCount(); if (watchModifiedFiles.length) { const isTsAndEtsFile: boolean = watchModifiedFiles.some((item: string) => { @@ -367,8 +368,6 @@ export class ResultStates { private delayPrintLogCount() { if (process.env.watchEts === 'end' && process.env.watchTs === 'end') { this.printLogCount(); - process.env.watchEts = 'start'; - process.env.watchTs = 'start'; } } @@ -407,8 +406,6 @@ export class ResultStates { console.info(this.blue, 'COMPILE RESULT:SUCCESS ', this.reset); } } - this.clearCount(); - this.resetTsErrorCount(); } private clearCount(): void { -- Gitee From e80b1faa54584ff5270914523ff2e5a1fc0c3ea1 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sun, 11 Dec 2022 20:32:43 +0800 Subject: [PATCH 216/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 极速预览编译全局变量 Signed-off-by: houhaoyu Change-Id: I6faeac7fa81021f688ecd8e2d165e065147ccdd6 --- compiler/server/build_pipe_server.js | 72 +++++++++++++++++++++------- 1 file changed, 56 insertions(+), 16 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index cafad2a..3fe8d9d 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -57,7 +57,11 @@ let errorInfo = []; let compileWithCheck; let globalVariable = []; let propertyVariable = []; +let globalDeclaration = new Map(); +let variableDoubleCheck = []; +let compileVariable = false; let connectNum = 0; +let script = ''; const maxConnectNum = 8; function init(port) { @@ -146,10 +150,18 @@ function handlePluginCompileComponent(jsonData) { fastPreview(); } quickPreview(GetRootView().findChildByIdForPreview(${receivedMsg.data.viewID}))` + script = receivedMsg.data.script; } callEs2abc(receivedMsg); } +function handlePluginCompileVariable() { + writeFileSync(previewCacheFilePath, receivedMsg_.data.variableScript); + receivedMsg_.data.script = ts.transpileModule(receivedMsg_.data.variableScript, {}).outputText + script; + script = ''; + callEs2abc(receivedMsg_); +} + function transformResourceNode(newSource, log) { const transformerFactory = (context) => { return (rootNode) => { @@ -174,7 +186,10 @@ function processResourceNode(node, log) { function checkPreparation(receivedMsg) { if (previewCacheFilePath && fs.existsSync(previewCacheFilePath) && compileWithCheck === 'true') { - globalVariable = receivedMsg.data.globalVariable || globalVariable; + globalVariable = receivedMsg.data.globalVariable.map((item)=>{ + globalDeclaration[item.identifier] = item.declaration; + return item.identifier; + }) propertyVariable = receivedMsg.data.propertyVariable || propertyVariable; writeFileSync(previewCacheFilePath, 'struct preview{build(){' + receivedMsg.data.script + '}}'); } @@ -196,10 +211,18 @@ function es2abc(receivedMsg) { Buffer.from(receivedMsg.data.script).toString('base64') + ' --base64Output'; try { pipeProcess.exec(cmd, (error, stdout, stderr) => { - if (stdout) { - receivedMsg.data.script = stdout; + if (compileVariable) { + if (stdout) { + receivedMsg.data.script = stdout; + } else { + receivedMsg.data.script = ""; + } } else { - receivedMsg.data.script = ""; + if (stdout) { + receivedMsg.data.script = stdout; + } else { + receivedMsg.data.script = ""; + } } compileStatus = true; receivedMsg_ = receivedMsg; @@ -238,17 +261,31 @@ function responseToPlugin() { receivedMsg_.data.log = receivedMsg_.data.log || []; receivedMsg_.data.log.push(...errorInfo); } - pluginSocket.send(JSON.stringify(receivedMsg_), (err) => { - start = false; + if (!receivedMsg_.data.log.length && variableDoubleCheck.length && !compileVariable) { + compileVariable = true; checkStatus = false; compileStatus = false; - errorInfo = []; - receivedMsg_ = undefined; - messages.shift(); - if (messages.length > 0) { - handlePluginCompileComponent(); - } - }); + let variableContent = ''; + variableDoubleCheck.forEach((item)=>{ + variableContent += globalDeclaration[item] + '\n'; + }) + receivedMsg_.data.variableScript = variableContent; + handlePluginCompileVariable(); + } else { + pluginSocket.send(JSON.stringify(receivedMsg_), (err) => { + start = false; + checkStatus = false; + compileStatus = false; + errorInfo = []; + receivedMsg_ = undefined; + variableDoubleCheck = []; + compileVariable = false; + messages.shift(); + if (messages.length > 0) { + handlePluginCompileComponent(); + } + }); + } } } } @@ -256,17 +293,20 @@ function responseToPlugin() { function validateError(message) { const propInfoReg = /Cannot find name\s*'(\$?\$?[_a-zA-Z0-9]+)'/; const stateInfoReg = /Property\s*'(\$?[_a-zA-Z0-9]+)' does not exist on type/; - if (matchMessage(message, [...globalVariable, ...props], propInfoReg) || - matchMessage(message, [...propertyVariable, ...props], stateInfoReg)) { + if (!compileVariable && (matchMessage(message, [...globalVariable, ...props], propInfoReg, true) || + matchMessage(message, [...propertyVariable, ...props], stateInfoReg))) { return false; } return true; } -function matchMessage(message, nameArr, reg) { +function matchMessage(message, nameArr, reg, isGlobalVariable = false) { if (reg.test(message)) { const match = message.match(reg); if (match[1] && nameArr.includes(match[1])) { + if (isGlobalVariable) { + variableDoubleCheck.push(match[1]); + } return true; } } -- Gitee From e037fdd4c955748b1d2c344c0e31186a9afdcdec Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 12 Dec 2022 18:17:37 +0800 Subject: [PATCH 217/379] houhaoyu@huawei.com fix win11 abc not generate Signed-off-by: houhaoyu Change-Id: I2076238f6ff7709268027c7d376563a6a4ef2c80 --- compiler/server/build_pipe_server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index cafad2a..c67b1ee 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -192,7 +192,7 @@ function callEs2abc(receivedMsg) { } function es2abc(receivedMsg) { - const cmd = es2abcFilePath + ' --base64Input ' + + const cmd = '"' + es2abcFilePath + '"' + ' --base64Input ' + Buffer.from(receivedMsg.data.script).toString('base64') + ' --base64Output'; try { pipeProcess.exec(cmd, (error, stdout, stderr) => { -- Gitee From 972fe82955d005210e4ea10c35cb1fe4a17ae700 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 13 Dec 2022 15:18:15 +0800 Subject: [PATCH 218/379] houhaoyu@huawei.com fix @Builder function use if crash Signed-off-by: houhaoyu Change-Id: Ibd8e3eb955d8f79452af2ddf8cdcc8b1f88c1616 --- compiler/src/process_component_build.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 9375c8a..b330988 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1225,7 +1225,7 @@ function processIfStatement(node: ts.IfStatement, newStatements: ts.Statement[], if (!partialUpdateConfig.partialUpdateMode) { newStatements.push(ifCreate, newIfNode, ifPop); } else { - newStatements.push(createComponentCreationStatement(node, [ifCreate, newIfNode]), ifPop); + newStatements.push(createComponentCreationStatement(node, [ifCreate, newIfNode], isGlobalBuilder), ifPop); } } @@ -1266,7 +1266,7 @@ function processThenStatement(thenStatement: ts.Statement, id: number, thenStatement = processInnerIfStatement(thenStatement, 0, log, isBuilder, isGlobalBuilder); thenStatement = ts.factory.createBlock( partialUpdateConfig.partialUpdateMode - ? [createIfCreate(), createIfBranchFunc(id, [thenStatement]), createIfPop()] + ? [createIfCreate(), createIfBranchFunc(id, [thenStatement], isGlobalBuilder), createIfPop()] : [createIfCreate(), createIfBranchId(id), thenStatement, createIfPop()], true ); @@ -1352,14 +1352,14 @@ function checkHasThisKeyword(node: ts.Statement, log: LogInfo[]): void { function processIfBlock(block: ts.Block, id: number, log: LogInfo[], isBuilder: boolean = false, isGlobalBuilder: boolean = false): ts.Block { - return addIfBranchId(id, + return addIfBranchId(id, isGlobalBuilder, processComponentBlock(block, false, log, false, isBuilder, undefined, undefined, isGlobalBuilder)); } -function addIfBranchId(id: number, container: ts.Block): ts.Block { +function addIfBranchId(id: number, isGlobalBuilder: boolean = false, container: ts.Block): ts.Block { let containerStatements: ts.Statement[]; if (partialUpdateConfig.partialUpdateMode) { - containerStatements = [createIfBranchFunc(id, [...container.statements])]; + containerStatements = [createIfBranchFunc(id, [...container.statements], isGlobalBuilder)]; } else { containerStatements = [createIfBranchId(id), ...container.statements]; } @@ -1386,9 +1386,11 @@ function createIfBranchId(id: number): ts.ExpressionStatement { ts.factory.createNodeArray([ts.factory.createNumericLiteral(id)]))); } -function createIfBranchFunc(id: number, innerStatements: ts.Statement[]): ts.ExpressionStatement { +function createIfBranchFunc(id: number, innerStatements: ts.Statement[], + isGlobalBuilder: boolean = false): ts.ExpressionStatement { return ts.factory.createExpressionStatement(ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression( - ts.factory.createThis(), ts.factory.createIdentifier(IFELSEBRANCHUPDATEFUNCTION)), undefined, + isGlobalBuilder ? parentConditionalExpression() : ts.factory.createThis(), + ts.factory.createIdentifier(IFELSEBRANCHUPDATEFUNCTION)), undefined, [ts.factory.createNumericLiteral(id), ts.factory.createArrowFunction(undefined, undefined, [], undefined, ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), ts.factory.createBlock(innerStatements, true))])); } -- Gitee From 3587151912e3280801e92221d140af399f314fe1 Mon Sep 17 00:00:00 2001 From: bojiang Date: Wed, 14 Dec 2022 14:46:27 +0800 Subject: [PATCH 219/379] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 老框架localStorage UT修改 Signed-off-by: bojiang Change-Id: I2c4047b41e40a5f94cbc5f19e3216c3c5f572c5e --- compiler/test/ut/import/importAllEts.ts | 4 ++-- compiler/test/ut/import/importEts.ts | 4 ++-- compiler/test/ut/import/importExportEts.ts | 4 ++-- compiler/test/ut/import/importExportNest.ts | 4 ++-- compiler/test/ut/import/importTs.ts | 4 ++-- .../$$_component/$$_component.ts | 4 ++-- .../custom_component/custom_component.ts | 8 ++++---- .../gesture_component/longPressGesture.ts | 4 ++-- .../gesture_component/panGestrue.ts | 4 ++-- .../gesture_component/pinchGesture.ts | 4 ++-- .../gesture_component/rotationGesture.ts | 4 ++-- .../gesture_component/swipeGesture.ts | 4 ++-- .../gesture_component/tapGesture.ts | 4 ++-- .../render_component/forEach/forEach.ts | 4 ++-- .../render_component/forEach/forEachTwo.ts | 4 ++-- .../render_component/if/if.ts | 4 ++-- .../render_component/lazyForEach/lazyForEach.ts | 4 ++-- .../simple_component/button/button.ts | 4 ++-- .../transition_component/animateTo/animateTo.ts | 4 ++-- .../pageTransition/pageTransition.ts | 4 ++-- .../test/ut/render_decorator/@builder/@builder.ts | 4 ++-- .../@builder/@builderWithLinkData.ts | 8 ++++---- .../render_decorator/@builderParam/@builderParam.ts | 12 ++++++------ .../render_decorator/@customDialog/@customDialog.ts | 8 ++++---- compiler/test/ut/render_decorator/@extend/@extend.ts | 4 ++-- .../test/ut/render_decorator/@preview/@preview.ts | 8 ++++---- compiler/test/ut/render_decorator/@styles/@styles.ts | 4 ++-- .../ut/render_decorator/@styles/@stylesExport.ts | 4 ++-- .../@storageLink/@storageLink.ts | 4 ++-- .../@storageProp/@storageProp.ts | 4 ++-- .../appStorage/appStorage.ts | 4 ++-- .../inner_struct_state_management/@link/@link.ts | 8 ++++---- .../inner_struct_state_management/@prop/@prop.ts | 8 ++++---- .../inner_struct_state_management/@state/@state.ts | 8 ++++---- .../others/@consume_@provide/@consume_@provide.ts | 12 ++++++------ .../@observed_@objectLink/@observed_@objectLink.ts | 8 ++++---- .../ut/ui_state_management/others/@watch/@watch.ts | 4 ++-- 37 files changed, 98 insertions(+), 98 deletions(-) diff --git a/compiler/test/ut/import/importAllEts.ts b/compiler/test/ut/import/importAllEts.ts index 45adf97..e398ec2 100644 --- a/compiler/test/ut/import/importAllEts.ts +++ b/compiler/test/ut/import/importAllEts.ts @@ -98,8 +98,8 @@ function generateId() { const AllComponent = __importStar(require("./test/pages/NamespaceComponent")); const TsModule_1 = __importDefault(require("./test/pages/TsModule")); class ImportTest extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__myState1 = new ObservedPropertyObject(new TsModule_1.default(1).method(), this, "myState1"); this.__myState2 = new ObservedPropertySimple(0, this, "myState2"); this.__myState3 = new ObservedPropertySimple(false, this, "myState3"); diff --git a/compiler/test/ut/import/importEts.ts b/compiler/test/ut/import/importEts.ts index 4184582..d0b0584 100644 --- a/compiler/test/ut/import/importEts.ts +++ b/compiler/test/ut/import/importEts.ts @@ -132,8 +132,8 @@ const DefaultComponent_1 = __importDefault(require("./test/pages/DefaultComponen const AMDComponentDefault = require("./test/pages/AMDComponent"); const TsModule_1 = __importDefault(require("./test/pages/TsModule")); class ImportTest extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__myState1 = new ObservedPropertyObject(new TsModule_1.default(1).method(), this, "myState1"); this.__myState2 = new ObservedPropertySimple(0, this, "myState2"); this.__myState3 = new ObservedPropertySimple(false, this, "myState3"); diff --git a/compiler/test/ut/import/importExportEts.ts b/compiler/test/ut/import/importExportEts.ts index 87f220c..4b32e3e 100644 --- a/compiler/test/ut/import/importExportEts.ts +++ b/compiler/test/ut/import/importExportEts.ts @@ -65,8 +65,8 @@ function generateId() { const ExportStarComponent_1 = require("./test/pages/ExportStarComponent"); const TsModule_1 = __importDefault(require("./test/pages/TsModule")); class ImportTest extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__myState1 = new ObservedPropertyObject(new TsModule_1.default(1).method(), this, "myState1"); this.__myState2 = new ObservedPropertySimple(0, this, "myState2"); this.__myState3 = new ObservedPropertySimple(false, this, "myState3"); diff --git a/compiler/test/ut/import/importExportNest.ts b/compiler/test/ut/import/importExportNest.ts index 917b262..43cf543 100644 --- a/compiler/test/ut/import/importExportNest.ts +++ b/compiler/test/ut/import/importExportNest.ts @@ -64,8 +64,8 @@ function generateId() { } const ImportNestAll_1 = require("./test/pages/ImportNestAll"); class ImportTest extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__testText1 = new ObservedPropertySimple('Hello', this, "testText1"); this.__testText2 = new ObservedPropertySimple('World', this, "testText2"); this.__testText3 = new ObservedPropertySimple('Test', this, "testText3"); diff --git a/compiler/test/ut/import/importTs.ts b/compiler/test/ut/import/importTs.ts index 96bd6d1..668ab47 100644 --- a/compiler/test/ut/import/importTs.ts +++ b/compiler/test/ut/import/importTs.ts @@ -65,8 +65,8 @@ function generateId() { const ExportStarComponent_1 = require("./test/pages/ExportStarComponent"); const TsModule_1 = __importDefault(require("./test/pages/TsModule")); class ImportTest extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__myState1 = new ObservedPropertyObject(new TsModule_1.default(1).method(), this, "myState1"); this.__myState2 = new ObservedPropertySimple(0, this, "myState2"); this.__myState3 = new ObservedPropertySimple(false, this, "myState3"); diff --git a/compiler/test/ut/inner_commponent_transform/$$_component/$$_component.ts b/compiler/test/ut/inner_commponent_transform/$$_component/$$_component.ts index aca5296..790509a 100644 --- a/compiler/test/ut/inner_commponent_transform/$$_component/$$_component.ts +++ b/compiler/test/ut/inner_commponent_transform/$$_component/$$_component.ts @@ -83,8 +83,8 @@ const value5 = [true, false]; let value6 = { item1: true }; let isCountDown = false; class HomeComponent extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.value1 = "hello world 1"; this.value2 = "hello world 2"; this.value3 = "hello world 3"; diff --git a/compiler/test/ut/inner_commponent_transform/custom_component/custom_component.ts b/compiler/test/ut/inner_commponent_transform/custom_component/custom_component.ts index 4581aed..5e587a6 100644 --- a/compiler/test/ut/inner_commponent_transform/custom_component/custom_component.ts +++ b/compiler/test/ut/inner_commponent_transform/custom_component/custom_component.ts @@ -52,8 +52,8 @@ function generateId() { return "custom_component_" + ++__generate__Id; } class MyComponent extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.updateWithValueParams(params); } updateWithValueParams(params) { @@ -153,8 +153,8 @@ class MyComponent extends View { } } class Banner extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.value = "Hello"; this.updateWithValueParams(params); } diff --git a/compiler/test/ut/inner_commponent_transform/gesture_component/longPressGesture.ts b/compiler/test/ut/inner_commponent_transform/gesture_component/longPressGesture.ts index ec1fc05..53eff00 100644 --- a/compiler/test/ut/inner_commponent_transform/gesture_component/longPressGesture.ts +++ b/compiler/test/ut/inner_commponent_transform/gesture_component/longPressGesture.ts @@ -43,8 +43,8 @@ function generateId() { return "longPressGesture_" + ++__generate__Id; } class LongPressGestureExample extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__count = new ObservedPropertySimple(0, this, "count"); this.updateWithValueParams(params); } diff --git a/compiler/test/ut/inner_commponent_transform/gesture_component/panGestrue.ts b/compiler/test/ut/inner_commponent_transform/gesture_component/panGestrue.ts index b2cf0e2..ce9887e 100644 --- a/compiler/test/ut/inner_commponent_transform/gesture_component/panGestrue.ts +++ b/compiler/test/ut/inner_commponent_transform/gesture_component/panGestrue.ts @@ -51,8 +51,8 @@ function generateId() { return "panGestrue_" + ++__generate__Id; } class PanGestureExample extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__offsetX = new ObservedPropertySimple(0, this, "offsetX"); this.__offsetY = new ObservedPropertySimple(0, this, "offsetY"); this.updateWithValueParams(params); diff --git a/compiler/test/ut/inner_commponent_transform/gesture_component/pinchGesture.ts b/compiler/test/ut/inner_commponent_transform/gesture_component/pinchGesture.ts index 4d2d448..985596e 100644 --- a/compiler/test/ut/inner_commponent_transform/gesture_component/pinchGesture.ts +++ b/compiler/test/ut/inner_commponent_transform/gesture_component/pinchGesture.ts @@ -47,8 +47,8 @@ function generateId() { return "pinchGesture_" + ++__generate__Id; } class PinchGestureExample extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__scale = new ObservedPropertySimple(1, this, "scale"); this.updateWithValueParams(params); } diff --git a/compiler/test/ut/inner_commponent_transform/gesture_component/rotationGesture.ts b/compiler/test/ut/inner_commponent_transform/gesture_component/rotationGesture.ts index 61cc82c..3fb8290 100644 --- a/compiler/test/ut/inner_commponent_transform/gesture_component/rotationGesture.ts +++ b/compiler/test/ut/inner_commponent_transform/gesture_component/rotationGesture.ts @@ -47,8 +47,8 @@ function generateId() { return "rotationGesture_" + ++__generate__Id; } class RotationGestureExample extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__angle = new ObservedPropertySimple(0, this, "angle"); this.updateWithValueParams(params); } diff --git a/compiler/test/ut/inner_commponent_transform/gesture_component/swipeGesture.ts b/compiler/test/ut/inner_commponent_transform/gesture_component/swipeGesture.ts index 92f940e..d48922d 100644 --- a/compiler/test/ut/inner_commponent_transform/gesture_component/swipeGesture.ts +++ b/compiler/test/ut/inner_commponent_transform/gesture_component/swipeGesture.ts @@ -45,8 +45,8 @@ function generateId() { return "swipeGesture_" + ++__generate__Id; } class SwipeGestureExample extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__rotateAngle = new ObservedPropertySimple(0, this, "rotateAngle"); this.__speed = new ObservedPropertySimple(1, this, "speed"); this.updateWithValueParams(params); diff --git a/compiler/test/ut/inner_commponent_transform/gesture_component/tapGesture.ts b/compiler/test/ut/inner_commponent_transform/gesture_component/tapGesture.ts index 2862434..70696e7 100644 --- a/compiler/test/ut/inner_commponent_transform/gesture_component/tapGesture.ts +++ b/compiler/test/ut/inner_commponent_transform/gesture_component/tapGesture.ts @@ -41,8 +41,8 @@ function generateId() { return "tapGesture_" + ++__generate__Id; } class TapGestureExample extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__value = new ObservedPropertySimple('', this, "value"); this.updateWithValueParams(params); } diff --git a/compiler/test/ut/inner_commponent_transform/render_component/forEach/forEach.ts b/compiler/test/ut/inner_commponent_transform/render_component/forEach/forEach.ts index 57b366f..72f3124 100644 --- a/compiler/test/ut/inner_commponent_transform/render_component/forEach/forEach.ts +++ b/compiler/test/ut/inner_commponent_transform/render_component/forEach/forEach.ts @@ -115,8 +115,8 @@ class Month { } } class MyComponent extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.languages = ['ets', 'js', 'java']; this.weekNames = ['日', '一', '二', '三', '四', '五', '六']; this.__calendar = new ObservedPropertyObject([ diff --git a/compiler/test/ut/inner_commponent_transform/render_component/forEach/forEachTwo.ts b/compiler/test/ut/inner_commponent_transform/render_component/forEach/forEachTwo.ts index 0ff8506..7081003 100644 --- a/compiler/test/ut/inner_commponent_transform/render_component/forEach/forEachTwo.ts +++ b/compiler/test/ut/inner_commponent_transform/render_component/forEach/forEachTwo.ts @@ -46,8 +46,8 @@ function generateId() { return "forEachTwo_" + ++__generate__Id; } class Index extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__WIDTH_AND_HEIGHT = new ObservedPropertyObject([ { w: 10, h: 10 }, { w: 20, h: 20 }, diff --git a/compiler/test/ut/inner_commponent_transform/render_component/if/if.ts b/compiler/test/ut/inner_commponent_transform/render_component/if/if.ts index 30ff18c..368413b 100644 --- a/compiler/test/ut/inner_commponent_transform/render_component/if/if.ts +++ b/compiler/test/ut/inner_commponent_transform/render_component/if/if.ts @@ -61,8 +61,8 @@ function generateId() { const TestComponent_1 = require("./test/pages/TestComponent"); const TsModule_1 = require("./test/pages/TsModule"); class MyComponent extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.pass = true; this.count = 10; this.updateWithValueParams(params); diff --git a/compiler/test/ut/inner_commponent_transform/render_component/lazyForEach/lazyForEach.ts b/compiler/test/ut/inner_commponent_transform/render_component/lazyForEach/lazyForEach.ts index 08b7a3a..5e584b1 100644 --- a/compiler/test/ut/inner_commponent_transform/render_component/lazyForEach/lazyForEach.ts +++ b/compiler/test/ut/inner_commponent_transform/render_component/lazyForEach/lazyForEach.ts @@ -182,8 +182,8 @@ class MyDataSource extends BasicDataSource { } } class MyComponent extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.data = new MyDataSource(); this.updateWithValueParams(params); } diff --git a/compiler/test/ut/inner_commponent_transform/simple_component/button/button.ts b/compiler/test/ut/inner_commponent_transform/simple_component/button/button.ts index 885a8ae..6b6d74d 100644 --- a/compiler/test/ut/inner_commponent_transform/simple_component/button/button.ts +++ b/compiler/test/ut/inner_commponent_transform/simple_component/button/button.ts @@ -40,8 +40,8 @@ function generateId() { return "button_" + ++__generate__Id; } class ButtonExample extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.updateWithValueParams(params); } updateWithValueParams(params) { diff --git a/compiler/test/ut/inner_commponent_transform/transition_component/animateTo/animateTo.ts b/compiler/test/ut/inner_commponent_transform/transition_component/animateTo/animateTo.ts index d0cfe72..e683e6a 100644 --- a/compiler/test/ut/inner_commponent_transform/transition_component/animateTo/animateTo.ts +++ b/compiler/test/ut/inner_commponent_transform/transition_component/animateTo/animateTo.ts @@ -64,8 +64,8 @@ function generateId() { return "animateTo_" + ++__generate__Id; } class TransitionExample extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__btnW = new ObservedPropertySimple(50, this, "btnW"); this.__btnH = new ObservedPropertySimple(50, this, "btnH"); this.__btn1 = new ObservedPropertySimple(false, this, "btn1"); diff --git a/compiler/test/ut/inner_commponent_transform/transition_component/pageTransition/pageTransition.ts b/compiler/test/ut/inner_commponent_transform/transition_component/pageTransition/pageTransition.ts index 47d8c97..b5a3cee 100644 --- a/compiler/test/ut/inner_commponent_transform/transition_component/pageTransition/pageTransition.ts +++ b/compiler/test/ut/inner_commponent_transform/transition_component/pageTransition/pageTransition.ts @@ -52,8 +52,8 @@ function generateId() { return "pageTransition_" + ++__generate__Id; } class PageTransitionExample1 extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__scale = new ObservedPropertySimple(1, this, "scale"); this.__opacity = new ObservedPropertySimple(1, this, "opacity"); this.__active = new ObservedPropertySimple(false, this, "active"); diff --git a/compiler/test/ut/render_decorator/@builder/@builder.ts b/compiler/test/ut/render_decorator/@builder/@builder.ts index d6e2abf..ead282e 100644 --- a/compiler/test/ut/render_decorator/@builder/@builder.ts +++ b/compiler/test/ut/render_decorator/@builder/@builder.ts @@ -162,8 +162,8 @@ function specificParam(label1, label2, parent = undefined) { Column.pop(); } class MyComponent extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; this.controller = new TabsController(); this.__hideBar = new ObservedPropertySimple(true, this, "hideBar"); diff --git a/compiler/test/ut/render_decorator/@builder/@builderWithLinkData.ts b/compiler/test/ut/render_decorator/@builder/@builderWithLinkData.ts index 4f00664..88cc765 100644 --- a/compiler/test/ut/render_decorator/@builder/@builderWithLinkData.ts +++ b/compiler/test/ut/render_decorator/@builder/@builderWithLinkData.ts @@ -44,8 +44,8 @@ function generateId() { return "@builderWithLinkData_" + ++__generate__Id; } class TitleComp extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__title = new SynchedPropertySimpleTwoWay(params.title, this, "title"); this.updateWithValueParams(params); } @@ -67,8 +67,8 @@ class TitleComp extends View { } } class TestPage extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__value = new ObservedPropertySimple('hello world', this, "value"); this.updateWithValueParams(params); } diff --git a/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts b/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts index 9ba90ed..e4e191b 100644 --- a/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts +++ b/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts @@ -109,8 +109,8 @@ function generateId() { } const TestComponent_1 = require("./test/pages/TestComponent"); class CustomContainer extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.header = ""; this.footer = ""; this.updateWithValueParams(params); @@ -140,8 +140,8 @@ class CustomContainer extends View { } } class CustomContainer2 extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.header = ""; this.updateWithValueParams(params); } @@ -173,8 +173,8 @@ function specificWithParam(label1, label2, parent = undefined) { Column.pop(); } class CustomContainerUser extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__text = new ObservedPropertySimple('header', this, "text"); this.updateWithValueParams(params); } diff --git a/compiler/test/ut/render_decorator/@customDialog/@customDialog.ts b/compiler/test/ut/render_decorator/@customDialog/@customDialog.ts index b74df8d..c636328 100644 --- a/compiler/test/ut/render_decorator/@customDialog/@customDialog.ts +++ b/compiler/test/ut/render_decorator/@customDialog/@customDialog.ts @@ -105,8 +105,8 @@ function generateId() { return "@customDialog_" + ++__generate__Id; } class DialogExample extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__count = new SynchedPropertySimpleOneWay(params.count, this, "count"); this.__isPlaying = new SynchedPropertySimpleTwoWay(params.isPlaying, this, "isPlaying"); this.controller = undefined; @@ -184,8 +184,8 @@ class DialogExample extends View { } } class CustomDialogUser extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__countInitValue = new ObservedPropertySimple(10, this, "countInitValue"); this.__playingInitValue = new ObservedPropertySimple(false, this, "playingInitValue"); this.dialogController = new CustomDialogController({ diff --git a/compiler/test/ut/render_decorator/@extend/@extend.ts b/compiler/test/ut/render_decorator/@extend/@extend.ts index 20815e5..594d835 100644 --- a/compiler/test/ut/render_decorator/@extend/@extend.ts +++ b/compiler/test/ut/render_decorator/@extend/@extend.ts @@ -72,8 +72,8 @@ function __Button__fancybut(color) { Button.height(100); } class FancyUse extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.updateWithValueParams(params); } updateWithValueParams(params) { diff --git a/compiler/test/ut/render_decorator/@preview/@preview.ts b/compiler/test/ut/render_decorator/@preview/@preview.ts index 40147a2..8f2706b 100644 --- a/compiler/test/ut/render_decorator/@preview/@preview.ts +++ b/compiler/test/ut/render_decorator/@preview/@preview.ts @@ -43,8 +43,8 @@ function generateId() { return "@preview_" + ++__generate__Id; } class HomePreviewComponent extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.value = "hello world"; this.updateWithValueParams(params); } @@ -63,8 +63,8 @@ class HomePreviewComponent extends View { } } class HomePreviewComponent_Preview extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.updateWithValueParams(params); } updateWithValueParams(params) { diff --git a/compiler/test/ut/render_decorator/@styles/@styles.ts b/compiler/test/ut/render_decorator/@styles/@styles.ts index 61708a1..d1c3aac 100644 --- a/compiler/test/ut/render_decorator/@styles/@styles.ts +++ b/compiler/test/ut/render_decorator/@styles/@styles.ts @@ -60,8 +60,8 @@ function generateId() { return "@styles_" + ++__generate__Id; } class FancyUse extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__enable = new ObservedPropertySimple(true, this, "enable"); this.updateWithValueParams(params); } diff --git a/compiler/test/ut/render_decorator/@styles/@stylesExport.ts b/compiler/test/ut/render_decorator/@styles/@stylesExport.ts index 55acdc9..c4a072f 100644 --- a/compiler/test/ut/render_decorator/@styles/@stylesExport.ts +++ b/compiler/test/ut/render_decorator/@styles/@stylesExport.ts @@ -63,8 +63,8 @@ function generateId() { return "@stylesExport_" + ++__generate__Id; } class FancyUseExp extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__enable = new ObservedPropertySimple(true, this, "enable"); this.updateWithValueParams(params); } diff --git a/compiler/test/ut/ui_state_management/application_state_management/@storageLink/@storageLink.ts b/compiler/test/ut/ui_state_management/application_state_management/@storageLink/@storageLink.ts index 3b3983a..3feea88 100644 --- a/compiler/test/ut/ui_state_management/application_state_management/@storageLink/@storageLink.ts +++ b/compiler/test/ut/ui_state_management/application_state_management/@storageLink/@storageLink.ts @@ -56,8 +56,8 @@ function generateId() { let varA = AppStorage.Link('varA'); let envLang = AppStorage.Prop('languageCode'); class MyComponent extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__varA = AppStorage.SetAndLink('varA', 2, this, "varA"); this.__lang = AppStorage.SetAndProp('languageCode', 'en', this, "lang"); this.label = 'count'; diff --git a/compiler/test/ut/ui_state_management/application_state_management/@storageProp/@storageProp.ts b/compiler/test/ut/ui_state_management/application_state_management/@storageProp/@storageProp.ts index 26b0f63..7fe97dc 100644 --- a/compiler/test/ut/ui_state_management/application_state_management/@storageProp/@storageProp.ts +++ b/compiler/test/ut/ui_state_management/application_state_management/@storageProp/@storageProp.ts @@ -56,8 +56,8 @@ function generateId() { let varA = AppStorage.Link('varA'); let envLang = AppStorage.Prop('languageCode'); class MyComponent extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__varA = AppStorage.SetAndLink('varA', 2, this, "varA"); this.__lang = AppStorage.SetAndProp('languageCode', 'en', this, "lang"); this.label = 'count'; diff --git a/compiler/test/ut/ui_state_management/application_state_management/appStorage/appStorage.ts b/compiler/test/ut/ui_state_management/application_state_management/appStorage/appStorage.ts index 3be55c9..8d95801 100644 --- a/compiler/test/ut/ui_state_management/application_state_management/appStorage/appStorage.ts +++ b/compiler/test/ut/ui_state_management/application_state_management/appStorage/appStorage.ts @@ -56,8 +56,8 @@ function generateId() { let varA = AppStorage.Link('varA'); let envLang = AppStorage.Prop('languageCode'); class MyComponent extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__varA = AppStorage.SetAndLink('varA', 2, this, "varA"); this.__lang = AppStorage.SetAndProp('languageCode', 'en', this, "lang"); this.label = 'count'; diff --git a/compiler/test/ut/ui_state_management/inner_struct_state_management/@link/@link.ts b/compiler/test/ut/ui_state_management/inner_struct_state_management/@link/@link.ts index 122b8eb..767b326 100644 --- a/compiler/test/ut/ui_state_management/inner_struct_state_management/@link/@link.ts +++ b/compiler/test/ut/ui_state_management/inner_struct_state_management/@link/@link.ts @@ -74,8 +74,8 @@ function generateId() { return "@link_" + ++__generate__Id; } class linkComp extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__buttonPlaying = new SynchedPropertySimpleTwoWay(params.buttonPlaying, this, "buttonPlaying"); this.__items = new SynchedPropertyObjectTwoWay(params.items, this, "items"); this.__obj = new SynchedPropertyObjectTwoWay(params.obj, this, "obj"); @@ -145,8 +145,8 @@ class linkComp extends View { } } class linkPage extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__isPlaying = new ObservedPropertySimple(false, this, "isPlaying"); this.__itemsArr = new ObservedPropertyObject([1, 2, 3], this, "itemsArr"); this.__peoples = new ObservedPropertyObject([{ name: 'xiaoming', age: 8 }], this, "peoples"); diff --git a/compiler/test/ut/ui_state_management/inner_struct_state_management/@prop/@prop.ts b/compiler/test/ut/ui_state_management/inner_struct_state_management/@prop/@prop.ts index 63fa5a1..1264026 100644 --- a/compiler/test/ut/ui_state_management/inner_struct_state_management/@prop/@prop.ts +++ b/compiler/test/ut/ui_state_management/inner_struct_state_management/@prop/@prop.ts @@ -70,8 +70,8 @@ function generateId() { return "@prop_" + ++__generate__Id; } class ctComponent extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__name = new SynchedPropertySimpleOneWay(params.name, this, "name"); this.__canPlay = new SynchedPropertySimpleOneWay(params.canPlay, this, "canPlay"); this.__count = new SynchedPropertySimpleOneWay(params.count, this, "count"); @@ -145,8 +145,8 @@ class ctComponent extends View { } } class PageComponent extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__countDownStartValue = new ObservedPropertySimple(10, this, "countDownStartValue"); this.updateWithValueParams(params); } diff --git a/compiler/test/ut/ui_state_management/inner_struct_state_management/@state/@state.ts b/compiler/test/ut/ui_state_management/inner_struct_state_management/@state/@state.ts index af6344a..4f07058 100644 --- a/compiler/test/ut/ui_state_management/inner_struct_state_management/@state/@state.ts +++ b/compiler/test/ut/ui_state_management/inner_struct_state_management/@state/@state.ts @@ -67,8 +67,8 @@ class Model { } } class MyComponent extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__title = new ObservedPropertyObject({ value: 'Hello World' }, this, "title"); this.__count = new ObservedPropertySimple(0, this, "count"); this.toggle = 'Hello World'; @@ -128,8 +128,8 @@ class MyComponent extends View { } } class EntryComponent extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.updateWithValueParams(params); } updateWithValueParams(params) { diff --git a/compiler/test/ut/ui_state_management/others/@consume_@provide/@consume_@provide.ts b/compiler/test/ut/ui_state_management/others/@consume_@provide/@consume_@provide.ts index da7a9fb..17ac942 100644 --- a/compiler/test/ut/ui_state_management/others/@consume_@provide/@consume_@provide.ts +++ b/compiler/test/ut/ui_state_management/others/@consume_@provide/@consume_@provide.ts @@ -65,8 +65,8 @@ function generateId() { return "@consume_@provide_" + ++__generate__Id; } class CompA extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__reviewVotes = new ObservedPropertySimple(0, this, "reviewVotes"); this.addProvidedVar("reviewVote", this.__reviewVotes); this.addProvidedVar("reviewVotes", this.__reviewVotes); @@ -112,8 +112,8 @@ class CompA extends View { } } class CompB extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.updateWithValueParams(params); } updateWithValueParams(params) { @@ -135,8 +135,8 @@ class CompB extends View { } } class CompC extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__reviewVotes = this.initializeConsume("reviewVote", "reviewVotes"); this.updateWithValueParams(params); } diff --git a/compiler/test/ut/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts b/compiler/test/ut/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts index ff9d976..70ee4a3 100644 --- a/compiler/test/ut/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts +++ b/compiler/test/ut/ui_state_management/others/@observed_@objectLink/@observed_@objectLink.ts @@ -87,8 +87,8 @@ ClassB = __decorate([ Observed ], ClassB); class ViewA extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__varA = new SynchedPropertyNesedObject(params.varA, this, "varA"); this.updateWithValueParams(params); } @@ -110,8 +110,8 @@ class ViewA extends View { } } class ViewB extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__varB = new ObservedPropertyObject(new ClassB(new ClassA(0)), this, "varB"); this.updateWithValueParams(params); } diff --git a/compiler/test/ut/ui_state_management/others/@watch/@watch.ts b/compiler/test/ut/ui_state_management/others/@watch/@watch.ts index 3598c0b..8d11c8a 100644 --- a/compiler/test/ut/ui_state_management/others/@watch/@watch.ts +++ b/compiler/test/ut/ui_state_management/others/@watch/@watch.ts @@ -71,8 +71,8 @@ function generateId() { return "@watch_" + ++__generate__Id; } class CompA extends View { - constructor(compilerAssignedUniqueChildId, parent, params) { - super(compilerAssignedUniqueChildId, parent); + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); this.__shopBasket = new ObservedPropertyObject([7, 12, 47, 3], this, "shopBasket"); this.__totalPurchase = new ObservedPropertySimple(0, this, "totalPurchase"); this.__defArray = new ObservedPropertyObject(['c', 'g', 't', 'z'], this, "defArray"); -- Gitee From 9fe222e5cdce2d8fee248b3a220c93149bb63dc1 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Thu, 15 Dec 2022 10:43:19 +0800 Subject: [PATCH 220/379] houhaoyu@huawei.com restore top level this Signed-off-by: houhaoyu Change-Id: I327cd0fbd1cab04b3ace003e1e224dd776747618 --- compiler/webpack.config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 09550bd..3109820 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -159,7 +159,12 @@ function setJsConfigRule() { }; if (projectConfig.compileMode !== 'esmodule') { jsRule.type = 'javascript/auto'; - jsRule.use[0].options.plugins.unshift('@babel/plugin-transform-modules-commonjs'); + jsRule.use[0].options.plugins.unshift([ + '@babel/plugin-transform-modules-commonjs', + { + 'allowTopLevelThis': true + } + ]); } return jsRule; } -- Gitee From 2ba3ee9175e2073ddd00aff92a4439012887ade0 Mon Sep 17 00:00:00 2001 From: congjiye Date: Thu, 15 Dec 2022 14:45:40 +0800 Subject: [PATCH 221/379] fix tabcontent background-color doesn't work error Signed-off-by: congjiye --- compiler/codegen/codegen_ets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/codegen/codegen_ets.js b/compiler/codegen/codegen_ets.js index bc26b7f..7300ef2 100644 --- a/compiler/codegen/codegen_ets.js +++ b/compiler/codegen/codegen_ets.js @@ -12,4 +12,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(()=>{var e={6486:function(e,t,r){var n;e=r.nmd(e),function(){var o,a="Expected a function",i="__lodash_hash_undefined__",s="__lodash_placeholder__",p=32,l=128,c=1/0,u=9007199254740991,y=NaN,d=4294967295,f=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",p],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",h="[object Boolean]",E="[object Date]",T="[object Error]",P="[object Function]",v="[object GeneratorFunction]",S="[object Map]",b="[object Number]",_="[object Object]",N="[object Promise]",C="[object RegExp]",A="[object Set]",M="[object String]",w="[object Symbol]",O="[object WeakMap]",R="[object ArrayBuffer]",x="[object DataView]",I="[object Float32Array]",F="[object Float64Array]",k="[object Int8Array]",L="[object Int16Array]",D="[object Int32Array]",U="[object Uint8Array]",V="[object Uint8ClampedArray]",B="[object Uint16Array]",z="[object Uint32Array]",G=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,H=RegExp($.source),Y=RegExp(q.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,oe=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,pe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ye=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,he=/^(?:0|[1-9]\d*)$/,Ee=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Te=/($^)/,Pe=/['\n\r\u2028\u2029\\]/g,ve="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="a-z\\xdf-\\xf6\\xf8-\\xff",be="A-Z\\xc0-\\xd6\\xd8-\\xde",_e="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ne="["+_e+"]",Ce="["+ve+"]",Ae="\\d+",Me="["+Se+"]",we="[^\\ud800-\\udfff"+_e+Ae+"\\u2700-\\u27bf"+Se+be+"]",Oe="\\ud83c[\\udffb-\\udfff]",Re="[^\\ud800-\\udfff]",xe="(?:\\ud83c[\\udde6-\\uddff]){2}",Ie="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+be+"]",ke="(?:"+Me+"|"+we+")",Le="(?:"+Fe+"|"+we+")",De="(?:['’](?:d|ll|m|re|s|t|ve))?",Ue="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ve="(?:"+Ce+"|"+Oe+")?",Be="[\\ufe0e\\ufe0f]?",ze=Be+Ve+"(?:\\u200d(?:"+[Re,xe,Ie].join("|")+")"+Be+Ve+")*",Ge="(?:"+["[\\u2700-\\u27bf]",xe,Ie].join("|")+")"+ze,je="(?:"+[Re+Ce+"?",Ce,xe,Ie,"[\\ud800-\\udfff]"].join("|")+")",We=RegExp("['’]","g"),$e=RegExp(Ce,"g"),qe=RegExp(Oe+"(?="+Oe+")|"+je+ze,"g"),He=RegExp([Fe+"?"+Me+"+"+De+"(?="+[Ne,Fe,"$"].join("|")+")",Le+"+"+Ue+"(?="+[Ne,Fe+ke,"$"].join("|")+")",Fe+"?"+ke+"+"+De,Fe+"+"+Ue,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,Ge].join("|"),"g"),Ye=RegExp("[\\u200d\\ud800-\\udfff"+ve+"\\ufe0e\\ufe0f]"),Je=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Qe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Xe=-1,Ke={};Ke[I]=Ke[F]=Ke[k]=Ke[L]=Ke[D]=Ke[U]=Ke[V]=Ke[B]=Ke[z]=!0,Ke[m]=Ke[g]=Ke[R]=Ke[h]=Ke[x]=Ke[E]=Ke[T]=Ke[P]=Ke[S]=Ke[b]=Ke[_]=Ke[C]=Ke[A]=Ke[M]=Ke[O]=!1;var Ze={};Ze[m]=Ze[g]=Ze[R]=Ze[x]=Ze[h]=Ze[E]=Ze[I]=Ze[F]=Ze[k]=Ze[L]=Ze[D]=Ze[S]=Ze[b]=Ze[_]=Ze[C]=Ze[A]=Ze[M]=Ze[w]=Ze[U]=Ze[V]=Ze[B]=Ze[z]=!0,Ze[T]=Ze[P]=Ze[O]=!1;var et={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tt=parseFloat,rt=parseInt,nt="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,ot="object"==typeof self&&self&&self.Object===Object&&self,at=nt||ot||Function("return this")(),it=t&&!t.nodeType&&t,st=it&&e&&!e.nodeType&&e,pt=st&&st.exports===it,lt=pt&&nt.process,ct=function(){try{return st&&st.require&&st.require("util").types||lt&<.binding&<.binding("util")}catch(e){}}(),ut=ct&&ct.isArrayBuffer,yt=ct&&ct.isDate,dt=ct&&ct.isMap,ft=ct&&ct.isRegExp,mt=ct&&ct.isSet,gt=ct&&ct.isTypedArray;function ht(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Et(e,t,r,n){for(var o=-1,a=null==e?0:e.length;++o-1}function _t(e,t,r){for(var n=-1,o=null==e?0:e.length;++n-1;);return r}function Ht(e,t){for(var r=e.length;r--&&It(t,e[r],0)>-1;);return r}function Yt(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var Jt=Ut({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Qt=Ut({"&":"&","<":"<",">":">",'"':""","'":"'"});function Xt(e){return"\\"+et[e]}function Kt(e){return Ye.test(e)}function Zt(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function er(e,t){return function(r){return e(t(r))}}function tr(e,t){for(var r=-1,n=e.length,o=0,a=[];++r",""":'"',"'":"'"}),pr=function e(t){var r,n=(t=null==t?at:pr.defaults(at.Object(),t,pr.pick(at,Qe))).Array,oe=t.Date,ve=t.Error,Se=t.Function,be=t.Math,_e=t.Object,Ne=t.RegExp,Ce=t.String,Ae=t.TypeError,Me=n.prototype,we=Se.prototype,Oe=_e.prototype,Re=t["__core-js_shared__"],xe=we.toString,Ie=Oe.hasOwnProperty,Fe=0,ke=(r=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Le=Oe.toString,De=xe.call(_e),Ue=at._,Ve=Ne("^"+xe.call(Ie).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=pt?t.Buffer:o,ze=t.Symbol,Ge=t.Uint8Array,je=Be?Be.allocUnsafe:o,qe=er(_e.getPrototypeOf,_e),Ye=_e.create,et=Oe.propertyIsEnumerable,nt=Me.splice,ot=ze?ze.isConcatSpreadable:o,it=ze?ze.iterator:o,st=ze?ze.toStringTag:o,lt=function(){try{var e=ca(_e,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==at.clearTimeout&&t.clearTimeout,Ot=oe&&oe.now!==at.Date.now&&oe.now,Ut=t.setTimeout!==at.setTimeout&&t.setTimeout,lr=be.ceil,cr=be.floor,ur=_e.getOwnPropertySymbols,yr=Be?Be.isBuffer:o,dr=t.isFinite,fr=Me.join,mr=er(_e.keys,_e),gr=be.max,hr=be.min,Er=oe.now,Tr=t.parseInt,Pr=be.random,vr=Me.reverse,Sr=ca(t,"DataView"),br=ca(t,"Map"),_r=ca(t,"Promise"),Nr=ca(t,"Set"),Cr=ca(t,"WeakMap"),Ar=ca(_e,"create"),Mr=Cr&&new Cr,wr={},Or=Va(Sr),Rr=Va(br),xr=Va(_r),Ir=Va(Nr),Fr=Va(Cr),kr=ze?ze.prototype:o,Lr=kr?kr.valueOf:o,Dr=kr?kr.toString:o;function Ur(e){if(rs(e)&&!$i(e)&&!(e instanceof Gr)){if(e instanceof zr)return e;if(Ie.call(e,"__wrapped__"))return Ba(e)}return new zr(e)}var Vr=function(){function e(){}return function(t){if(!ts(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=o,r}}();function Br(){}function zr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function Gr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function jr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sn(e,t,r,n,a,i){var s,p=1&t,l=2&t,c=4&t;if(r&&(s=a?r(e,n,a,i):r(e)),s!==o)return s;if(!ts(e))return e;var u=$i(e);if(u){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Ie.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!p)return Mo(e,s)}else{var y=da(e),d=y==P||y==v;if(Ji(e))return So(e,p);if(y==_||y==m||d&&!a){if(s=l||d?{}:ma(e),!p)return l?function(e,t){return wo(e,ya(e),t)}(e,function(e,t){return e&&wo(t,Is(t),e)}(s,e)):function(e,t){return wo(e,ua(e),t)}(e,rn(s,e))}else{if(!Ze[y])return a?e:{};s=function(e,t,r){var n,o=e.constructor;switch(t){case R:return bo(e);case h:case E:return new o(+e);case x:return function(e,t){var r=t?bo(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case I:case F:case k:case L:case D:case U:case V:case B:case z:return _o(e,r);case S:return new o;case b:case M:return new o(e);case C:return function(e){var t=new e.constructor(e.source,ye.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new o;case w:return n=e,Lr?_e(Lr.call(n)):{}}}(e,y,p)}}i||(i=new Hr);var f=i.get(e);if(f)return f;i.set(e,s),ss(e)?e.forEach((function(n){s.add(sn(n,t,r,n,e,i))})):ns(e)&&e.forEach((function(n,o){s.set(o,sn(n,t,r,o,e,i))}));var g=u?o:(c?l?na:ra:l?Is:xs)(e);return Tt(g||e,(function(n,o){g&&(n=e[o=n]),Zr(s,o,sn(n,t,r,o,e,i))})),s}function pn(e,t,r){var n=r.length;if(null==e)return!n;for(e=_e(e);n--;){var a=r[n],i=t[a],s=e[a];if(s===o&&!(a in e)||!i(s))return!1}return!0}function ln(e,t,r){if("function"!=typeof e)throw new Ae(a);return Oa((function(){e.apply(o,r)}),t)}function cn(e,t,r,n){var o=-1,a=bt,i=!0,s=e.length,p=[],l=t.length;if(!s)return p;r&&(t=Nt(t,jt(r))),n?(a=_t,i=!1):t.length>=200&&(a=$t,i=!1,t=new qr(t));e:for(;++o-1},Wr.prototype.set=function(e,t){var r=this.__data__,n=en(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new jr,map:new(br||Wr),string:new jr}},$r.prototype.delete=function(e){var t=pa(this,e).delete(e);return this.size-=t?1:0,t},$r.prototype.get=function(e){return pa(this,e).get(e)},$r.prototype.has=function(e){return pa(this,e).has(e)},$r.prototype.set=function(e,t){var r=pa(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},qr.prototype.add=qr.prototype.push=function(e){return this.__data__.set(e,i),this},qr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Hr.prototype.get=function(e){return this.__data__.get(e)},Hr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var n=r.__data__;if(!br||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new $r(n)}return r.set(e,t),this.size=r.size,this};var un=xo(Tn),yn=xo(Pn,!0);function dn(e,t){var r=!0;return un(e,(function(e,n,o){return r=!!t(e,n,o)})),r}function fn(e,t,r){for(var n=-1,a=e.length;++n0&&r(s)?t>1?gn(s,t-1,r,n,o):Ct(o,s):n||(o[o.length]=s)}return o}var hn=Io(),En=Io(!0);function Tn(e,t){return e&&hn(e,t,xs)}function Pn(e,t){return e&&En(e,t,xs)}function vn(e,t){return St(t,(function(t){return Ki(e[t])}))}function Sn(e,t){for(var r=0,n=(t=Eo(t,e)).length;null!=e&&rt}function Cn(e,t){return null!=e&&Ie.call(e,t)}function An(e,t){return null!=e&&t in _e(e)}function Mn(e,t,r){for(var a=r?_t:bt,i=e[0].length,s=e.length,p=s,l=n(s),c=1/0,u=[];p--;){var y=e[p];p&&t&&(y=Nt(y,jt(t))),c=hr(y.length,c),l[p]=!r&&(t||i>=120&&y.length>=120)?new qr(p&&y):o}y=e[0];var d=-1,f=l[0];e:for(;++d=s?p:p*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(o)}function jn(e,t,r){for(var n=-1,o=t.length,a={};++n-1;)s!==e&&nt.call(s,p,1),nt.call(e,p,1);return e}function $n(e,t){for(var r=e?t.length:0,n=r-1;r--;){var o=t[r];if(r==n||o!==a){var a=o;ha(o)?nt.call(e,o,1):lo(e,o)}}return e}function qn(e,t){return e+cr(Pr()*(t-e+1))}function Hn(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=cr(t/2))&&(e+=e)}while(t);return r}function Yn(e,t){return Ra(Na(e,t,op),e+"")}function Jn(e){return Jr(zs(e))}function Qn(e,t){var r=zs(e);return Fa(r,an(t,0,r.length))}function Xn(e,t,r,n){if(!ts(e))return e;for(var a=-1,i=(t=Eo(t,e)).length,s=i-1,p=e;null!=p&&++aa?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=n(a);++o>>1,i=e[a];null!==i&&!ls(i)&&(r?i<=t:i=200){var l=t?null:Yo(e);if(l)return rr(l);i=!1,o=$t,p=new qr}else p=t?[]:s;e:for(;++n=n?e:to(e,t,r)}var vo=ct||function(e){return at.clearTimeout(e)};function So(e,t){if(t)return e.slice();var r=e.length,n=je?je(r):new e.constructor(r);return e.copy(n),n}function bo(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function _o(e,t){var r=t?bo(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function No(e,t){if(e!==t){var r=e!==o,n=null===e,a=e==e,i=ls(e),s=t!==o,p=null===t,l=t==t,c=ls(t);if(!p&&!c&&!i&&e>t||i&&s&&l&&!p&&!c||n&&s&&l||!r&&l||!a)return 1;if(!n&&!i&&!c&&e1?r[a-1]:o,s=a>2?r[2]:o;for(i=e.length>3&&"function"==typeof i?(a--,i):o,s&&Ea(r[0],r[1],s)&&(i=a<3?o:i,a=1),t=_e(t);++n-1?a[i?t[s]:s]:o}}function Uo(e){return ta((function(t){var r=t.length,n=r,i=zr.prototype.thru;for(e&&t.reverse();n--;){var s=t[n];if("function"!=typeof s)throw new Ae(a);if(i&&!p&&"wrapper"==aa(s))var p=new zr([],!0)}for(n=p?n:r;++n1&&T.reverse(),d&&up))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var y=-1,d=!0,f=2&r?new qr:o;for(i.set(e,t),i.set(t,e);++y-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Tt(f,(function(r){var n="_."+r[0];t&r[1]&&!bt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(se):[]}(n),r)))}function Ia(e){var t=0,r=0;return function(){var n=Er(),a=16-(n-r);if(r=n,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function Fa(e,t){var r=-1,n=e.length,a=n-1;for(t=t===o?n:t;++r1?e[t-1]:o;return r="function"==typeof r?(e.pop(),r):o,ii(e,r)}));function di(e){var t=Ur(e);return t.__chain__=!0,t}function fi(e,t){return t(e)}var mi=ta((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,a=function(t){return on(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Gr&&ha(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:fi,args:[a],thisArg:o}),new zr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(o),e}))):this.thru(a)})),gi=Oo((function(e,t,r){Ie.call(e,r)?++e[r]:nn(e,r,1)})),hi=Do(Wa),Ei=Do($a);function Ti(e,t){return($i(e)?Tt:un)(e,sa(t,3))}function Pi(e,t){return($i(e)?Pt:yn)(e,sa(t,3))}var vi=Oo((function(e,t,r){Ie.call(e,r)?e[r].push(t):nn(e,r,[t])})),Si=Yn((function(e,t,r){var o=-1,a="function"==typeof t,i=Hi(e)?n(e.length):[];return un(e,(function(e){i[++o]=a?ht(t,e,r):wn(e,t,r)})),i})),bi=Oo((function(e,t,r){nn(e,r,t)}));function _i(e,t){return($i(e)?Nt:Dn)(e,sa(t,3))}var Ni=Oo((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Ci=Yn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ea(e,t[0],t[1])?t=[]:r>2&&Ea(t[0],t[1],t[2])&&(t=[t[0]]),Gn(e,gn(t,1),[])})),Ai=Ot||function(){return at.Date.now()};function Mi(e,t,r){return t=r?o:t,t=e&&null==t?e.length:t,Qo(e,l,o,o,o,o,t)}function wi(e,t){var r;if("function"!=typeof t)throw new Ae(a);return e=ms(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=o),r}}var Oi=Yn((function(e,t,r){var n=1;if(r.length){var o=tr(r,ia(Oi));n|=p}return Qo(e,n,t,r,o)})),Ri=Yn((function(e,t,r){var n=3;if(r.length){var o=tr(r,ia(Ri));n|=p}return Qo(t,n,e,r,o)}));function xi(e,t,r){var n,i,s,p,l,c,u=0,y=!1,d=!1,f=!0;if("function"!=typeof e)throw new Ae(a);function m(t){var r=n,a=i;return n=i=o,u=t,p=e.apply(a,r)}function g(e){return u=e,l=Oa(E,t),y?m(e):p}function h(e){var r=e-c;return c===o||r>=t||r<0||d&&e-u>=s}function E(){var e=Ai();if(h(e))return T(e);l=Oa(E,function(e){var r=t-(e-c);return d?hr(r,s-(e-u)):r}(e))}function T(e){return l=o,f&&n?m(e):(n=i=o,p)}function P(){var e=Ai(),r=h(e);if(n=arguments,i=this,c=e,r){if(l===o)return g(c);if(d)return vo(l),l=Oa(E,t),m(c)}return l===o&&(l=Oa(E,t)),p}return t=hs(t)||0,ts(r)&&(y=!!r.leading,s=(d="maxWait"in r)?gr(hs(r.maxWait)||0,t):s,f="trailing"in r?!!r.trailing:f),P.cancel=function(){l!==o&&vo(l),u=0,n=c=i=l=o},P.flush=function(){return l===o?p:T(Ai())},P}var Ii=Yn((function(e,t){return ln(e,1,t)})),Fi=Yn((function(e,t,r){return ln(e,hs(t)||0,r)}));function ki(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ae(a);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(ki.Cache||$r),r}function Li(e){if("function"!=typeof e)throw new Ae(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ki.Cache=$r;var Di=To((function(e,t){var r=(t=1==t.length&&$i(t[0])?Nt(t[0],jt(sa())):Nt(gn(t,1),jt(sa()))).length;return Yn((function(n){for(var o=-1,a=hr(n.length,r);++o=t})),Wi=On(function(){return arguments}())?On:function(e){return rs(e)&&Ie.call(e,"callee")&&!et.call(e,"callee")},$i=n.isArray,qi=ut?jt(ut):function(e){return rs(e)&&_n(e)==R};function Hi(e){return null!=e&&es(e.length)&&!Ki(e)}function Yi(e){return rs(e)&&Hi(e)}var Ji=yr||hp,Qi=yt?jt(yt):function(e){return rs(e)&&_n(e)==E};function Xi(e){if(!rs(e))return!1;var t=_n(e);return t==T||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function Ki(e){if(!ts(e))return!1;var t=_n(e);return t==P||t==v||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zi(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var ns=dt?jt(dt):function(e){return rs(e)&&da(e)==S};function os(e){return"number"==typeof e||rs(e)&&_n(e)==b}function as(e){if(!rs(e)||_n(e)!=_)return!1;var t=qe(e);if(null===t)return!0;var r=Ie.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&xe.call(r)==De}var is=ft?jt(ft):function(e){return rs(e)&&_n(e)==C},ss=mt?jt(mt):function(e){return rs(e)&&da(e)==A};function ps(e){return"string"==typeof e||!$i(e)&&rs(e)&&_n(e)==M}function ls(e){return"symbol"==typeof e||rs(e)&&_n(e)==w}var cs=gt?jt(gt):function(e){return rs(e)&&es(e.length)&&!!Ke[_n(e)]},us=$o(Ln),ys=$o((function(e,t){return e<=t}));function ds(e){if(!e)return[];if(Hi(e))return ps(e)?ar(e):Mo(e);if(it&&e[it])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[it]());var t=da(e);return(t==S?Zt:t==A?rr:zs)(e)}function fs(e){return e?(e=hs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=fs(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?an(ms(e),0,d):0}function hs(e){if("number"==typeof e)return e;if(ls(e))return y;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Gt(e);var r=fe.test(e);return r||ge.test(e)?rt(e.slice(2),r?2:8):de.test(e)?y:+e}function Es(e){return wo(e,Is(e))}function Ts(e){return null==e?"":so(e)}var Ps=Ro((function(e,t){if(Sa(t)||Hi(t))wo(t,xs(t),e);else for(var r in t)Ie.call(t,r)&&Zr(e,r,t[r])})),vs=Ro((function(e,t){wo(t,Is(t),e)})),Ss=Ro((function(e,t,r,n){wo(t,Is(t),e,n)})),bs=Ro((function(e,t,r,n){wo(t,xs(t),e,n)})),_s=ta(on),Ns=Yn((function(e,t){e=_e(e);var r=-1,n=t.length,a=n>2?t[2]:o;for(a&&Ea(t[0],t[1],a)&&(n=1);++r1),t})),wo(e,na(e),r),n&&(r=sn(r,7,Zo));for(var o=t.length;o--;)lo(r,t[o]);return r})),Ds=ta((function(e,t){return null==e?{}:function(e,t){return jn(e,t,(function(t,r){return Ms(e,r)}))}(e,t)}));function Us(e,t){if(null==e)return{};var r=Nt(na(e),(function(e){return[e]}));return t=sa(t),jn(e,r,(function(e,r){return t(e,r[0])}))}var Vs=Jo(xs),Bs=Jo(Is);function zs(e){return null==e?[]:Wt(e,xs(e))}var Gs=ko((function(e,t,r){return t=t.toLowerCase(),e+(r?js(t):t)}));function js(e){return Xs(Ts(e).toLowerCase())}function Ws(e){return(e=Ts(e))&&e.replace(Ee,Jt).replace($e,"")}var $s=ko((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),qs=ko((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Hs=Fo("toLowerCase"),Ys=ko((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Js=ko((function(e,t,r){return e+(r?" ":"")+Xs(t)})),Qs=ko((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Xs=Fo("toUpperCase");function Ks(e,t,r){return e=Ts(e),(t=r?o:t)===o?function(e){return Je.test(e)}(e)?function(e){return e.match(He)||[]}(e):function(e){return e.match(pe)||[]}(e):e.match(t)||[]}var Zs=Yn((function(e,t){try{return ht(e,o,t)}catch(e){return Xi(e)?e:new ve(e)}})),ep=ta((function(e,t){return Tt(t,(function(t){t=Ua(t),nn(e,t,Oi(e[t],e))})),e}));function tp(e){return function(){return e}}var rp=Uo(),np=Uo(!0);function op(e){return e}function ap(e){return Fn("function"==typeof e?e:sn(e,1))}var ip=Yn((function(e,t){return function(r){return wn(r,e,t)}})),sp=Yn((function(e,t){return function(r){return wn(e,r,t)}}));function pp(e,t,r){var n=xs(t),o=vn(t,n);null!=r||ts(t)&&(o.length||!n.length)||(r=t,t=e,e=this,o=vn(t,xs(t)));var a=!(ts(r)&&"chain"in r&&!r.chain),i=Ki(e);return Tt(o,(function(r){var n=t[r];e[r]=n,i&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__),o=r.__actions__=Mo(this.__actions__);return o.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Ct([this.value()],arguments))})})),e}function lp(){}var cp=Go(Nt),up=Go(vt),yp=Go(wt);function dp(e){return Ta(e)?Dt(Ua(e)):function(e){return function(t){return Sn(t,e)}}(e)}var fp=Wo(),mp=Wo(!0);function gp(){return[]}function hp(){return!1}var Ep,Tp=zo((function(e,t){return e+t}),0),Pp=Ho("ceil"),vp=zo((function(e,t){return e/t}),1),Sp=Ho("floor"),bp=zo((function(e,t){return e*t}),1),_p=Ho("round"),Np=zo((function(e,t){return e-t}),0);return Ur.after=function(e,t){if("function"!=typeof t)throw new Ae(a);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},Ur.ary=Mi,Ur.assign=Ps,Ur.assignIn=vs,Ur.assignInWith=Ss,Ur.assignWith=bs,Ur.at=_s,Ur.before=wi,Ur.bind=Oi,Ur.bindAll=ep,Ur.bindKey=Ri,Ur.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $i(e)?e:[e]},Ur.chain=di,Ur.chunk=function(e,t,r){t=(r?Ea(e,t,r):t===o)?1:gr(ms(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var i=0,s=0,p=n(lr(a/t));ia?0:a+r),(n=n===o||n>a?a:ms(n))<0&&(n+=a),n=r>n?0:gs(n);r>>0)?(e=Ts(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=so(t))&&Kt(e)?Po(ar(e),0,r):e.split(t,r):[]},Ur.spread=function(e,t){if("function"!=typeof e)throw new Ae(a);return t=null==t?0:gr(ms(t),0),Yn((function(r){var n=r[t],o=Po(r,0,t);return n&&Ct(o,n),ht(e,this,o)}))},Ur.tail=function(e){var t=null==e?0:e.length;return t?to(e,1,t):[]},Ur.take=function(e,t,r){return e&&e.length?to(e,0,(t=r||t===o?1:ms(t))<0?0:t):[]},Ur.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?to(e,(t=n-(t=r||t===o?1:ms(t)))<0?0:t,n):[]},Ur.takeRightWhile=function(e,t){return e&&e.length?uo(e,sa(t,3),!1,!0):[]},Ur.takeWhile=function(e,t){return e&&e.length?uo(e,sa(t,3)):[]},Ur.tap=function(e,t){return t(e),e},Ur.throttle=function(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new Ae(a);return ts(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),xi(e,t,{leading:n,maxWait:t,trailing:o})},Ur.thru=fi,Ur.toArray=ds,Ur.toPairs=Vs,Ur.toPairsIn=Bs,Ur.toPath=function(e){return $i(e)?Nt(e,Ua):ls(e)?[e]:Mo(Da(Ts(e)))},Ur.toPlainObject=Es,Ur.transform=function(e,t,r){var n=$i(e),o=n||Ji(e)||cs(e);if(t=sa(t,4),null==r){var a=e&&e.constructor;r=o?n?new a:[]:ts(e)&&Ki(a)?Vr(qe(e)):{}}return(o?Tt:Tn)(e,(function(e,n,o){return t(r,e,n,o)})),r},Ur.unary=function(e){return Mi(e,1)},Ur.union=ri,Ur.unionBy=ni,Ur.unionWith=oi,Ur.uniq=function(e){return e&&e.length?po(e):[]},Ur.uniqBy=function(e,t){return e&&e.length?po(e,sa(t,2)):[]},Ur.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?po(e,o,t):[]},Ur.unset=function(e,t){return null==e||lo(e,t)},Ur.unzip=ai,Ur.unzipWith=ii,Ur.update=function(e,t,r){return null==e?e:co(e,t,ho(r))},Ur.updateWith=function(e,t,r,n){return n="function"==typeof n?n:o,null==e?e:co(e,t,ho(r),n)},Ur.values=zs,Ur.valuesIn=function(e){return null==e?[]:Wt(e,Is(e))},Ur.without=si,Ur.words=Ks,Ur.wrap=function(e,t){return Ui(ho(t),e)},Ur.xor=pi,Ur.xorBy=li,Ur.xorWith=ci,Ur.zip=ui,Ur.zipObject=function(e,t){return mo(e||[],t||[],Zr)},Ur.zipObjectDeep=function(e,t){return mo(e||[],t||[],Xn)},Ur.zipWith=yi,Ur.entries=Vs,Ur.entriesIn=Bs,Ur.extend=vs,Ur.extendWith=Ss,pp(Ur,Ur),Ur.add=Tp,Ur.attempt=Zs,Ur.camelCase=Gs,Ur.capitalize=js,Ur.ceil=Pp,Ur.clamp=function(e,t,r){return r===o&&(r=t,t=o),r!==o&&(r=(r=hs(r))==r?r:0),t!==o&&(t=(t=hs(t))==t?t:0),an(hs(e),t,r)},Ur.clone=function(e){return sn(e,4)},Ur.cloneDeep=function(e){return sn(e,5)},Ur.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:o)},Ur.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:o)},Ur.conformsTo=function(e,t){return null==t||pn(e,t,xs(t))},Ur.deburr=Ws,Ur.defaultTo=function(e,t){return null==e||e!=e?t:e},Ur.divide=vp,Ur.endsWith=function(e,t,r){e=Ts(e),t=so(t);var n=e.length,a=r=r===o?n:an(ms(r),0,n);return(r-=t.length)>=0&&e.slice(r,a)==t},Ur.eq=zi,Ur.escape=function(e){return(e=Ts(e))&&Y.test(e)?e.replace(q,Qt):e},Ur.escapeRegExp=function(e){return(e=Ts(e))&&re.test(e)?e.replace(te,"\\$&"):e},Ur.every=function(e,t,r){var n=$i(e)?vt:dn;return r&&Ea(e,t,r)&&(t=o),n(e,sa(t,3))},Ur.find=hi,Ur.findIndex=Wa,Ur.findKey=function(e,t){return Rt(e,sa(t,3),Tn)},Ur.findLast=Ei,Ur.findLastIndex=$a,Ur.findLastKey=function(e,t){return Rt(e,sa(t,3),Pn)},Ur.floor=Sp,Ur.forEach=Ti,Ur.forEachRight=Pi,Ur.forIn=function(e,t){return null==e?e:hn(e,sa(t,3),Is)},Ur.forInRight=function(e,t){return null==e?e:En(e,sa(t,3),Is)},Ur.forOwn=function(e,t){return e&&Tn(e,sa(t,3))},Ur.forOwnRight=function(e,t){return e&&Pn(e,sa(t,3))},Ur.get=As,Ur.gt=Gi,Ur.gte=ji,Ur.has=function(e,t){return null!=e&&fa(e,t,Cn)},Ur.hasIn=Ms,Ur.head=Ha,Ur.identity=op,Ur.includes=function(e,t,r,n){e=Hi(e)?e:zs(e),r=r&&!n?ms(r):0;var o=e.length;return r<0&&(r=gr(o+r,0)),ps(e)?r<=o&&e.indexOf(t,r)>-1:!!o&&It(e,t,r)>-1},Ur.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=null==r?0:ms(r);return o<0&&(o=gr(n+o,0)),It(e,t,o)},Ur.inRange=function(e,t,r){return t=fs(t),r===o?(r=t,t=0):r=fs(r),function(e,t,r){return e>=hr(t,r)&&e=-9007199254740991&&e<=u},Ur.isSet=ss,Ur.isString=ps,Ur.isSymbol=ls,Ur.isTypedArray=cs,Ur.isUndefined=function(e){return e===o},Ur.isWeakMap=function(e){return rs(e)&&da(e)==O},Ur.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==_n(e)},Ur.join=function(e,t){return null==e?"":fr.call(e,t)},Ur.kebabCase=$s,Ur.last=Xa,Ur.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var a=n;return r!==o&&(a=(a=ms(r))<0?gr(n+a,0):hr(a,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,a):xt(e,kt,a,!0)},Ur.lowerCase=qs,Ur.lowerFirst=Hs,Ur.lt=us,Ur.lte=ys,Ur.max=function(e){return e&&e.length?fn(e,op,Nn):o},Ur.maxBy=function(e,t){return e&&e.length?fn(e,sa(t,2),Nn):o},Ur.mean=function(e){return Lt(e,op)},Ur.meanBy=function(e,t){return Lt(e,sa(t,2))},Ur.min=function(e){return e&&e.length?fn(e,op,Ln):o},Ur.minBy=function(e,t){return e&&e.length?fn(e,sa(t,2),Ln):o},Ur.stubArray=gp,Ur.stubFalse=hp,Ur.stubObject=function(){return{}},Ur.stubString=function(){return""},Ur.stubTrue=function(){return!0},Ur.multiply=bp,Ur.nth=function(e,t){return e&&e.length?zn(e,ms(t)):o},Ur.noConflict=function(){return at._===this&&(at._=Ue),this},Ur.noop=lp,Ur.now=Ai,Ur.pad=function(e,t,r){e=Ts(e);var n=(t=ms(t))?or(e):0;if(!t||n>=t)return e;var o=(t-n)/2;return jo(cr(o),r)+e+jo(lr(o),r)},Ur.padEnd=function(e,t,r){e=Ts(e);var n=(t=ms(t))?or(e):0;return t&&nt){var n=e;e=t,t=n}if(r||e%1||t%1){var a=Pr();return hr(e+a*(t-e+tt("1e-"+((a+"").length-1))),t)}return qn(e,t)},Ur.reduce=function(e,t,r){var n=$i(e)?At:Vt,o=arguments.length<3;return n(e,sa(t,4),r,o,un)},Ur.reduceRight=function(e,t,r){var n=$i(e)?Mt:Vt,o=arguments.length<3;return n(e,sa(t,4),r,o,yn)},Ur.repeat=function(e,t,r){return t=(r?Ea(e,t,r):t===o)?1:ms(t),Hn(Ts(e),t)},Ur.replace=function(){var e=arguments,t=Ts(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Ur.result=function(e,t,r){var n=-1,a=(t=Eo(t,e)).length;for(a||(a=1,e=o);++nu)return[];var r=d,n=hr(e,d);t=sa(t),e-=d;for(var o=zt(n,t);++r=i)return e;var p=r-or(n);if(p<1)return n;var l=s?Po(s,0,p).join(""):e.slice(0,p);if(a===o)return l+n;if(s&&(p+=l.length-p),is(a)){if(e.slice(p).search(a)){var c,u=l;for(a.global||(a=Ne(a.source,Ts(ye.exec(a))+"g")),a.lastIndex=0;c=a.exec(u);)var y=c.index;l=l.slice(0,y===o?p:y)}}else if(e.indexOf(so(a),p)!=p){var d=l.lastIndexOf(a);d>-1&&(l=l.slice(0,d))}return l+n},Ur.unescape=function(e){return(e=Ts(e))&&H.test(e)?e.replace($,sr):e},Ur.uniqueId=function(e){var t=++Fe;return Ts(e)+t},Ur.upperCase=Qs,Ur.upperFirst=Xs,Ur.each=Ti,Ur.eachRight=Pi,Ur.first=Ha,pp(Ur,(Ep={},Tn(Ur,(function(e,t){Ie.call(Ur.prototype,t)||(Ep[t]=e)})),Ep),{chain:!1}),Ur.VERSION="4.17.21",Tt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Ur[e].placeholder=Ur})),Tt(["drop","take"],(function(e,t){Gr.prototype[e]=function(r){r=r===o?1:gr(ms(r),0);var n=this.__filtered__&&!t?new Gr(this):this.clone();return n.__filtered__?n.__takeCount__=hr(r,n.__takeCount__):n.__views__.push({size:hr(r,d),type:e+(n.__dir__<0?"Right":"")}),n},Gr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Tt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Gr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:sa(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Tt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Gr.prototype[e]=function(){return this[r](1).value()[0]}})),Tt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Gr.prototype[e]=function(){return this.__filtered__?new Gr(this):this[r](1)}})),Gr.prototype.compact=function(){return this.filter(op)},Gr.prototype.find=function(e){return this.filter(e).head()},Gr.prototype.findLast=function(e){return this.reverse().find(e)},Gr.prototype.invokeMap=Yn((function(e,t){return"function"==typeof e?new Gr(this):this.map((function(r){return wn(r,e,t)}))})),Gr.prototype.reject=function(e){return this.filter(Li(sa(e)))},Gr.prototype.slice=function(e,t){e=ms(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Gr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==o&&(r=(t=ms(t))<0?r.dropRight(-t):r.take(t-e)),r)},Gr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gr.prototype.toArray=function(){return this.take(d)},Tn(Gr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),a=Ur[n?"take"+("last"==t?"Right":""):t],i=n||/^find/.test(t);a&&(Ur.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,p=t instanceof Gr,l=s[0],c=p||$i(t),u=function(e){var t=a.apply(Ur,Ct([e],s));return n&&y?t[0]:t};c&&r&&"function"==typeof l&&1!=l.length&&(p=c=!1);var y=this.__chain__,d=!!this.__actions__.length,f=i&&!y,m=p&&!d;if(!i&&c){t=m?t:new Gr(this);var g=e.apply(t,s);return g.__actions__.push({func:fi,args:[u],thisArg:o}),new zr(g,y)}return f&&m?e.apply(this,s):(g=this.thru(u),f?n?g.value()[0]:g.value():g)})})),Tt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Me[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Ur.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var o=this.value();return t.apply($i(o)?o:[],e)}return this[r]((function(r){return t.apply($i(r)?r:[],e)}))}})),Tn(Gr.prototype,(function(e,t){var r=Ur[t];if(r){var n=r.name+"";Ie.call(wr,n)||(wr[n]=[]),wr[n].push({name:t,func:r})}})),wr[Vo(o,2).name]=[{name:"wrapper",func:o}],Gr.prototype.clone=function(){var e=new Gr(this.__wrapped__);return e.__actions__=Mo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Mo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Mo(this.__views__),e},Gr.prototype.reverse=function(){if(this.__filtered__){var e=new Gr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=$i(e),n=t<0,o=r?e.length:0,a=function(e,t,r){for(var n=-1,o=r.length;++n=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},Ur.prototype.plant=function(e){for(var t,r=this;r instanceof Br;){var n=Ba(r);n.__index__=0,n.__values__=o,t?a.__wrapped__=n:t=n;var a=n;r=r.__wrapped__}return a.__wrapped__=e,t},Ur.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gr){var t=e;return this.__actions__.length&&(t=new Gr(this)),(t=t.reverse()).__actions__.push({func:fi,args:[ti],thisArg:o}),new zr(t,this.__chain__)}return this.thru(ti)},Ur.prototype.toJSON=Ur.prototype.valueOf=Ur.prototype.value=function(){return yo(this.__wrapped__,this.__actions__)},Ur.prototype.first=Ur.prototype.head,it&&(Ur.prototype[it]=function(){return this}),Ur}();at._=pr,(n=function(){return pr}.call(t,r,t,e))===o||(e.exports=n)}.call(this)},904:(e,t)=>{"use strict";var r;let n;Object.defineProperty(t,"__esModule",{value:!0}),t.setDomain=t.getDomain=t.Domain=void 0,function(e){e[e.FA=0]="FA",e[e.FORM=1]="FORM",e[e.ETS=2]="ETS"}(r||(r={})),t.Domain=r,t.setDomain=e=>{n=e},t.getDomain=()=>null!=n?n:r.FA},3784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMap=void 0,t.errorMap=new Map([["fileError","Visual file is damaged"],["versionError","Version number of visual file does not match"],["modelError","Visual model in visual file is damaged"],["codegenError","Codegen visual file failed"]])},4117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNode=void 0,t.ASTNode=class{accept(e){return e.visit(this)}}},1862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0,t.Cache=class{constructor(e,t=0){this.value="",this.indent=t,this.flag=!0,this.INDENT=e}indentOn(){this.flag=!0}indentOff(){this.flag=!1}incIndent(){this.indent++}decIndent(){this.indent--}checkIndent(){return this.indent<0}getIndents(){if(this.flag){let e="";for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const n=r(4117);class o extends n.ASTNode{constructor(e,t,r,n,o){super(),this.defaultValue=new Map,this.mediaParams=new Map,this.mediaProperties=new Map,this.mediaKeyProperty=new Map,this.tagName=e,this.params=t,this.content=r,this.properties=n,this.forEachObj=o,this.ifBoolean=null,this.isCustomTag=!1}setMediaParams(e){this.mediaParams=e}setParams(e){this.params=e}setIfBoolean(e){this.ifBoolean=e}setTagName(e){this.tagName=e}setForEachObj(e){this.forEachObj=e}setMediaProperty(e,t){t.forEach(((t,r)=>{var n;this.mediaKeyProperty.has(r)||this.mediaKeyProperty.set(r,new Map),null===(n=this.mediaKeyProperty.get(r))||void 0===n||n.set(e,t)}))}setDefaultValue(e,t,r="undefined",n=""){this.defaultValue.set(e,[r,t,n])}}t.Tag=o},5623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const n=r(9519),o=r(1862),a=r(5051),i=r(4294),s=r(6486);class p{constructor(e){this.cache=e,this.etsImport=new o.Cache(" ",0),this.etsVariable=new o.Cache(" ",1),this.etsFunction=new o.Cache(" ",1),this.aboutToAppear=new o.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}visit(e){e instanceof n.Tag&&(e.isCustomTag?this.genCustomTag(e):(this.needMediaQuery&&this.genMediaQuery(e),this.genTag(e)))}static getMethodGen(e){return void 0===p.instance?p.instance=new p(e):p.instance.setCache(e),p.instance}setCache(e){this.cache=e,this.etsImport=new o.Cache(" ",0),this.etsVariable=new o.Cache(" ",1),this.etsFunction=new o.Cache(" ",1),this.aboutToAppear=new o.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}genParams(e){const t=this.getParams(e);this.isCustomComponent(e)?this.genCustomParams(t):this.genCommonParams(t)}genCommonParams(e){if("string"==typeof e)this.cache.concat(e);else if(e.size>0){this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE);let t=0;e.forEach(((r,n)=>{this.cache.concat(n,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(t,a.TokenClass.COLON,a.TokenClass.SPACE,e,a.TokenClass.COMMA)})),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genObjectProperty(e){let t=0;this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE),e.forEach(((r,n)=>{this.cache.concat(n,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{e.accept(this),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.decIndent(),this.cache.indentOn()),this.cache.indentOn(),this.cache.concat(a.TokenClass.RBRA)),(null!==e.properties||null!==e.mediaProperties)&&(null!==e.content&&0!==e.content.length||this.cache.incIndent(),this.getProperties(e).forEach(((e,t)=>{this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.PROPERTY_START,t,a.TokenClass.TAG_START),this.cache.indentOff(),"string"==typeof e?this.cache.concat(e,a.TokenClass.TAG_END):this.genObjectProperty(e)})),null!==e.content&&0!==e.content.length||this.cache.decIndent()),this.genEnd(e)}genStart(e){this.genIfStart(e),this.genForTagStart(e),this.genCustomImport(e)}genEnd(e){this.genForTagEnd(e),this.genIfEnd(e)}genForTagStart(e){var t;void 0!==(null===(t=e.forEachObj)||void 0===t?void 0:t.for)&&(this.cache.concat("ForEach",a.TokenClass.TAG_START,e.forEachObj.for.toString(),a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE))}genForTagEnd(e){null!==e.forEachObj&&(this.cache.concat(a.TokenClass.RBRA),void 0!==e.forEachObj.key&&""!==e.forEachObj.key&&(this.cache.concat(a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.concat("return ",e.forEachObj.key.toString(),a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.TAG_END,a.TokenClass.RBRA),this.cache.indentOff()),this.cache.concat(a.TokenClass.TAG_END))}genIfStart(e){null!==e.ifBoolean&&(this.cache.concat("if",a.TokenClass.SPACE,a.TokenClass.TAG_START,e.ifBoolean.toString(),a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.incIndent())}genIfEnd(e){null!==e.ifBoolean&&(this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genMediaQuery(e){const t=new Map,r=new Map;if(this.collectMediaQueryMap(e,t),this.collectDefaultValueMap(e,r),0===t.size&&0===r.size)return;const n=(0,i.getUniqueName)("mediaQuery"),s=(0,i.getUniqueName)("initForMediaQuery"),p=(0,i.getUniqueName)("mediaQueryCb"),l=(0,i.getUniqueName)("saveMediaQueryResult"),c=(0,i.getUniqueName)("updateForMediaQuery"),u=new o.Cache(a.TokenClass.INDENT,1),y=new o.Cache(a.TokenClass.INDENT,1),d=new o.Cache(a.TokenClass.INDENT,1),f=new o.Cache(a.TokenClass.INDENT,1),m=new o.Cache(a.TokenClass.INDENT,1),g=new o.Cache(a.TokenClass.INDENT,1),h=new o.Cache(a.TokenClass.INDENT,1),E=new o.Cache(a.TokenClass.INDENT,2);this.genVariableDeclare(r,u,a.TokenClass.UNDEFINED),this.genMediaQueryCb(p,y),this.genMediaQueryListener(t,d,f),this.genInitFuc(s,r,m),this.genMediaQueryCbFnc(l,c,t,g),this.genUpdateFnc(c,s,t,h),this.genAboutToAppear(p,l,t,E),this.etsImport.indentOff(),this.aboutToAppear.indentOff(),this.etsVariable.indentOff(),this.etsFunction.indentOff(),this.etsImport.indentOff(),this.etsImport.concat("import ",n," from '@ohos.mediaquery'",a.TokenClass.NEW_LINE),this.aboutToAppear.concat(E.toString()),this.etsVariable.concat(u.toString(),y.toString(),d.toString(),f.toString()),this.etsFunction.concat(g.toString(),a.TokenClass.NEW_LINE,m.toString(),a.TokenClass.NEW_LINE,h.toString()),this.etsImport.indentOn(),this.aboutToAppear.indentOn(),this.etsVariable.indentOn(),this.etsFunction.indentOn(),this.needMediaQuery=!1}genCustomTag(e){this.genVariableDeclare(e.defaultValue,this.cache)}genVariableDeclare(e,t,r){t.indentOn(),e.forEach(((e,n)=>{const o=e[2];""!==o&&(t.concat(o,a.TokenClass.SPACE),t.indentOff()),t.concat(n.slice(5),a.TokenClass.COLON,a.TokenClass.SPACE,e[1]),t.indentOff();const i=null!=r?r:e[0];null!=i&&t.concat(a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,i,a.TokenClass.NEW_LINE),t.indentOn()}))}genMediaQueryCb(e,t){t.concat(e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.NULL,a.TokenClass.NEW_LINE)}genMediaQueryListener(e,t,r){const n=(0,i.getUniqueName)("mediaQuery");e.forEach(((e,o)=>{const s=(0,i.getUniqueName)(this.getMediaQueryVariableName(o));t.concat(s,a.TokenClass.COLON,a.TokenClass.SPACE,a.TokenClass.BOOLEAN,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.FALSE,a.TokenClass.NEW_LINE),r.concat(`listener_${s}`,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,n,a.TokenClass.PROPERTY_START,"matchMediaSync",a.TokenClass.TAG_START,`'${o}'`,a.TokenClass.TAG_END,a.TokenClass.NEW_LINE)}))}genInitFuc(e,t,r){r.concat(e,a.TokenClass.TAG_START,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),r.indentOn(),r.incIndent(),t.forEach(((e,t)=>{r.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e[0],a.TokenClass.NEW_LINE)})),r.decIndent(),r.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genMediaQueryCbFnc(e,t,r,n){const o=Array.from(r.entries());n.concat(e,a.TokenClass.TAG_START,"mediaQueryResult",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),n.incIndent(),n.concat(a.TokenClass.SWITCH,a.TokenClass.SPACE,a.TokenClass.TAG_START,"mediaQueryResult.media",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),n.incIndent();for(let e=0;e{const r=(0,i.getUniqueName)(this.getMediaQueryVariableName(t));n.concat(a.TokenClass.IF,a.TokenClass.SPACE,a.TokenClass.TAG_START,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,r,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),n.incIndent(),e.forEach(((e,t)=>{n.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e,a.TokenClass.NEW_LINE)})),n.decIndent(),n.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)})),n.decIndent(),n.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genAboutToAppear(e,t,r,n){let o=1;n.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,`${t}.bind(this)`,a.TokenClass.NEW_LINE),r.forEach(((t,s)=>{const p=`listener_${(0,i.getUniqueName)(this.getMediaQueryVariableName(s))}`;n.indentOn(),n.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,p,a.TokenClass.PROPERTY_START,`on('change', this.${e})`),o0&&e.mediaParams.forEach(((e,r)=>{t.set(r,e)})),t}getProperties(e){const t=new Map;return e.properties.forEach(((e,r)=>{t.set(r,e)})),e.mediaProperties.forEach(((e,r)=>{t.set(r,e)})),t}collectDefaultValueMap(e,t){void 0!==e.defaultValue&&e.defaultValue.forEach(((e,r)=>{t.set(r,e)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectDefaultValueMap(e,t)}))}collectMediaQueryMap(e,t){void 0!==e.mediaKeyProperty&&e.mediaKeyProperty.forEach(((e,r)=>{var n;const o=null!==(n=t.get(r))&&void 0!==n?n:new Map;e.forEach(((e,t)=>{o.set(t,e)})),t.set(r,o)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectMediaQueryMap(e,t)}))}getMediaQueryVariableName(e){const t="device-type: ",r="orientation: ",n=e.substring(e.indexOf(t),e.length),o=n.substring(t.length,n.indexOf(")")),a=e.substring(e.indexOf(r),e.length),i=a.substring(r.length,a.indexOf(")"));return`${o}${i.slice(0,1).toUpperCase()+i.slice(1).toLowerCase()}`}}t.ASTNodeGenerator=p,p.instance=void 0},8413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ETSBridge=void 0;const n=r(9519),o=r(1912),a=r(3729),i=r(6125),s=r(366);t.ETSBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map;let r=null;const p=new Map,l=new n.Tag(e.type,t,r,p,null);if((0,o.parseVisualModel)(e,l),(0,a.parseMediaVisualModel)(e,l),(0,i.parseCustomVisualModel)(e,l),(0,s.parseCustomMediaVisualModel)(e,l),e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}return l.content=r,l}}},9459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genCustomEts=t.genETS=t.EMPTY=void 0;const n=r(5623),o=r(1862);t.EMPTY={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""},t.genETS=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" ",2));return e.accept(t),{build:t.cache.toString(),etsImport:t.etsImport.toString(),etsVariable:t.etsVariable.toString(),etsFunction:t.etsFunction.toString(),aboutToAppear:t.aboutToAppear.toString()}},t.genCustomEts=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" ",1));return e.accept(t),t.cache.toString()}},4435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;const n=r(9459);t.StringWriter=class{genETS(e){return(0,n.genETS)(e)}}},5051:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.INDENT=" ",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.SPACE=" ",r.LQUOTE="'",r.RQUOTE="'",r.TAG_START="(",r.TAG_END=")",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDynamicValueByDecorator=t.getMediaVariableDecorator=t.getCustomAttrType=t.getCustomAttributeMap=t.setCustomAttribute=void 0;const n=r(2891),o=new Map;function a(){return o}function i(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.decorator)&&void 0!==r?r:"normal"}t.setCustomAttribute=function(e){var t,r;const a=e.type;(null!==(r=null===(t=(0,n.getInstance)().customData)||void 0===t?void 0:t.property.get(a))&&void 0!==r?r:new Map).forEach(((e,t)=>{const r=`${t}-${a.replace(/\//g,"-")}`;o.set(r,e)}))},t.getCustomAttributeMap=a,t.getCustomAttrType=function(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.type)&&void 0!==r?r:""},t.getMediaVariableDecorator=function(e){const t=i(e);let r="";return"@Link"!==t&&"@Prop"!==t||(r="@State"),r},t.getDynamicValueByDecorator=function(e,t){let r=t;return"@Link"===i(e)&&(r=t.replace("this.","$")),r}},6125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumParserMap=t.genCustomEvent=t.parseCustomVisualModel=void 0;const n=r(2891),o=r(3135),a=r(1195),i=r(8122),s=r(1790);function p(e,t){if(!(t.params instanceof Map))return;const r=function(e){var t,r;const o=e.type;return[...null!==(r=null===(t=(0,n.getInstance)().customData)||void 0===t?void 0:t.event.get(o))&&void 0!==r?r:[]]}(e);for(const n of r){const r=e.property.get(n);void 0!==r&&""!==r&&("this"===r.split(".")[0]?t.params.set(n,r+".bind(this)"):t.params.set(n,r))}}t.parseCustomVisualModel=function(e,r){(0,a.setCustomAttribute)(e),(0,a.getCustomAttributeMap)().forEach(((n,o)=>{if(function(e,t){return e.property.has(t)||e.dynamicProperty.has(t)}(e,o)){const a=c.get(n.type);"function"==typeof a&&a(o,e,r);const s=t.enumParserMap.get(n.type);"function"==typeof s&&function(e,t,r,n){if((0,i.dynamicParamParser)(e,t,r))return;const o=t.property.get(e);!(0,i.isEmptyOrUndefined)(o)&&r.params instanceof Map&&r.params.set((0,i.getEtsPropName)(e),n(o))}(o,e,r,s)}})),p(e,r)},t.genCustomEvent=p;const l=(0,i.curry)(i.getEtsEnumValue),c=new Map([["string",i.stringParamParser],["boolean",i.rawDataParamParser],["number",i.rawDataParamParser],["any[]",i.rawDataParamParser],["object",i.rawDataParamParser],["Date",function(e,t,r){(0,i.dateParamParser)(e,(0,i.getEtsPropName)(e),t,r)}]]);t.enumParserMap=new Map([["Alignment",function(e){const t=(0,i.getBackgroundImagePositionEnumValue)(e);return""!==t?t:(0,i.getEtsEnumValue)("Alignment.",e)}],["Direction",l("Direction.")],["ItemAlign",i.dealWithAlignSelf],["BorderStyle",l("BorderStyle.")],["ImageRepeat",i.dealWithBackgroundRepeat],["ImageSize",l("ImageSize.")],["Visibility",l("Visibility.")],["FontStyle",l("FontStyle.")],["FontWeight",i.dealWithFontWeight],["ButtonType",l("ButtonType.")],["Color",l("Color.")],["LineCapStyle",l("LineCapStyle.")],["ImageFit",l("ImageFit.")],["ImageInterpolation",l("ImageInterpolation.")],["ImageRenderMode",l("ImageRenderMode.")],["ProgressStyle",l("ProgressStyle.")],["SliderStyle",l("SliderStyle.")],["TextAlign",l("TextAlign.")],["TextOverflow",l("TextOverflow.")],["TextDecorationType",l("TextDecorationType.")],["TextCase",l("TextCase.")],["HorizontalAlign",s.dealWithColumnAlignItems],["FlexAlign",o.dealWithJustifyAlignContent],["VerticalAlign",s.dealWithRowAlignItems],["FlexDirection",l("FlexDirection.")],["FlexWrap",i.dealWithWrap],["Axis",l("Axis.")],["EdgeEffect",l("EdgeEffect.")],["Sticky",l("Sticky.")],["EnterKeyType",l("EnterKeyType.")],["ToggleType",l("ToggleType.")],["InputType",l("InputType.")],["ScrollDirection",l("ScrollDirection.")],["EdgeEffect",l("EdgeEffect.")],["GridDirection",l("GridDirection.")],["BarState",l("BarState.")],["NavigationTitleMode",l("NavigationTitleMode.")],["CopyOption",l("CopyOption.")],["BarPosition",l("BarPosition.")],["BarMode",l("BarMode.")]])},9223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonMediaParserArray=t.ifParser=t.forEachParser=void 0;const n=r(6282),o=r(8122),a=r(9248),i=(0,o.curry)(((e,t)=>t.hasMediaProperty(e)));function s(e,t,r){var n,a,i,s;const p=null!==(n=e.property.get("left"))&&void 0!==n?n:e.dynamicProperty.get("left"),l=null!==(a=e.property.get("top"))&&void 0!==a?a:e.dynamicProperty.get("top"),c=t.get("left"),u=t.get("top"),y=r.get("left"),d=r.get("top");let f="undefined",m="undefined";return(0,o.isEmptyOrUndefined)(c)&&(0,o.isEmptyOrUndefined)(u)||(f=(0,o.quoteString)(null!==(i=null!=c?c:p)&&void 0!==i?i:"0"),m=(0,o.quoteString)(null!==(s=null!=u?u:l)&&void 0!==s?s:"0")),(0,o.isEmptyOrUndefined)(y)&&(0,o.isEmptyOrUndefined)(d)||(f=null!=y?y:f,m=null!=d?d:m),{leftValue:f,topValue:m}}function p(e,t){e.forEach(((e,r)=>{"undefined"!==e&&t.set(r,"undefined")}))}function l(e,t){var r,n;const a=new Map,i=t.split("-")[0];return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((r,n)=>{var s,p,l,c;const u=r.get(i),y=null===(p=null===(s=e.dynamicMediaProperty)||void 0===s?void 0:s.get(n))||void 0===p?void 0:p.get(i),d=null!==(c=null!==(l=r.get(t))&&void 0!==l?l:y)&&void 0!==c?c:u;void 0!==d&&a.set(n,(0,o.quoteString)(d))})),(null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map).forEach(((e,r)=>{var n;const o=e.get(i),s=null!==(n=e.get(t))&&void 0!==n?n:o;void 0!==s&&a.set(r,s)})),a}const c=(0,o.curry)(((e,t,r)=>{const a=(0,n.getMediaProperty)(t,e,o.quoteString);if(0===a.size)return;const i=(0,n.getMediaDefaultValue)(t,e,o.quoteString),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,o.getEtsPropName)(e),s)})),u=(0,o.curry)(((e,t,r)=>{const a=(0,n.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,n.getMediaDefaultValue)(t,e),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,o.getEtsPropName)(e),s)})),y=(0,o.curry)(((e,t,r)=>{const a=(0,n.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,n.getMediaDefaultValue)(t,e),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,o.getEtsPropName)(e),s)})),d=(0,o.curry)(((e,t,r,a)=>{const i=(0,n.getMediaProperty)(r,e,(0,o.curry)(o.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,n.getMediaDefaultValue)(r,e,(0,o.curry)(o.getEtsEnumValue)(t)),p=(0,n.getVariableName)(r.id,e);a.setDefaultValue(p,(0,n.getType)(e),s),a.setMediaProperty(p,i),a.mediaProperties.set((0,o.getEtsPropName)(e),p)})),f=(0,o.curry)(((e,t,r)=>{const a=(0,n.getMediaProperty)(t,e,o.dealWithColor);if(0===a.size)return;const i=(0,n.getMediaDefaultValue)(t,e,o.dealWithColor),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,o.getEtsPropName)(e),s)}));function m(e,t,r,n=!1){(0,o.isEmptyOrUndefined)(t)||r.set(e,n?t:(0,o.quoteString)(t))}t.forEachParser=function(e,t){var r,o,a;const i=null!==(r=e.dynamicProperty.get("for"))&&void 0!==r?r:"[1]",s=null!==(o=e.property.get("item"))&&void 0!==o?o:"item",p=null!==(a=e.property.get("idx"))&&void 0!==a?a:"idx",l=e.dynamicProperty.get("keyGenerator"),c=(0,n.getMediaProperty)(e,"for");if(0===c.size)return;const u=(0,n.getVariableName)(e.id,"for"),y={for:u,key:l,item:s,idx:p};t.setDefaultValue(u,(0,n.getType)("for"),i),t.setMediaProperty(u,c),t.setForEachObj(y)},t.ifParser=function(e,t){const r=(0,n.getMediaProperty)(e,"if");if(0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"if"),a=(0,n.getVariableName)(e.id,"if");t.setDefaultValue(a,(0,n.getType)("if"),o),t.setMediaProperty(a,r),t.setIfBoolean(a)};const g=(0,o.curry)(((e,t,r)=>{const a=new Map,i=t.property.get(e),s=t.dynamicProperty.get(e),p=null!=s?s:i,c=["top","bottom","left","right"];let u=0;for(const i of c){const s=`${e}-${i}`,c=t.property.get(s),y=t.dynamicProperty.get(s),d=l(t,s);let f=(0,o.isEmptyOrUndefined)(p)?"undefined":(0,o.quoteString)(p);if((0,o.isEmptyOrUndefined)(c)||(f=(0,o.quoteString)(c)),(0,o.isEmptyOrUndefined)(y)||(f=y),d.size>0){const e=(0,n.getVariableName)(t.id,s);r.setDefaultValue(e,(0,n.getType)(s),f),r.setMediaProperty(e,d),m(i,e,a,!0),u++}else m(i,f,a,!0)}u>0&&r.mediaProperties.set(e,a)}));function h(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null===t?"undefined":void 0!==t[5]?`{ width: ${(0,o.quoteString)(t[1])}, height: ${(0,o.quoteString)(t[5])} }`:`{ width: ${(0,o.quoteString)(t[1])} }`}function E(e,t){var r,n;const a=new Map,i=new Map,s=P(t),p=v(t);return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((e,r)=>{const n=e.get(t);if(!(0,o.isEmptyOrUndefined)(n)){let e=s(n);e=""!==e?e:"undefined",a.set(r,e),i.set(r,p(n))}})),(null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map).forEach(((e,r)=>{const n=e.get(t);(0,o.isEmptyOrUndefined)(n)||(a.set(r,n),i.set(r,"undefined"))})),{enumValueMap:a,objValueMap:i}}function T(e,t){const r=e.property.get(t),n=e.dynamicProperty.get(t),a=P(t),i=v(t);let s="undefined",p="undefined";if(!(0,o.isEmptyOrUndefined)(r)){const e=a(r);s=""!==e?e:s,p=i(r)}return(0,o.isEmptyOrUndefined)(n)||(s=n,p="undefined"),{enumDefault:s,objDefault:p}}function P(e){return new Map([["background-image-size",o.getBackgroundImageSizeEnumValue],["background-image-position",o.getBackgroundImagePositionEnumValue]]).get(e)}function v(e){return new Map([["background-image-size",h],["background-image-position",S]]).get(e)}function S(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null===t?"undefined":`{ x: ${(0,o.quoteString)(t[1])}, y: ${(0,o.quoteString)(t[4])} }`}const b=(0,o.curry)(((e,t,r,a)=>{const i=(0,o.getBorderDirections)(e),s=new Map;let p=r.property.get(e);(0,o.isEmptyOrUndefined)(p)||(p=t(p));const l=r.dynamicProperty.get(e),c=null!=l?l:p,u=(0,n.getMediaProperty)(r,e,t);let y=0;for(const e of i){const i=(0,o.getEdgeBorderDirection)(e),p=r.property.get(e),l=r.dynamicProperty.get(e),d=(0,n.getMediaProperty)(r,e,t);let f=(0,o.isEmptyOrUndefined)(c)?"undefined":c;if((0,o.isEmptyOrUndefined)(p)||(f=t(p)),(0,o.isEmptyOrUndefined)(l)||(f=l),d.size>0){const t=(0,n.getVariableName)(r.id,e);a.setDefaultValue(t,(0,n.getType)(e),f),a.setMediaProperty(t,d),s.set(i,t),y++}else{const t=(0,n.getVariableName)(r.id,e);a.setDefaultValue(t,(0,n.getType)(e),f),a.setMediaProperty(t,u),s.set(i,t)}}y>0&&a.mediaProperties.set((0,o.getEtsPropName)(e),s)}));t.commonMediaParserArray=[[i("width"),c("width")],[i("height"),c("height")],[function(e){return e.hasMediaProperty("constraint-size-min-width")||e.hasMediaProperty("constraint-size-max-width")||e.hasMediaProperty("constraint-size-min-height")||e.hasMediaProperty("constraint-size-min-height")},function(e,t){const r=new Map,a=["min-width","max-width","min-height","max-height"];for(const i of a){const a=`constraint-size-${i}`,s=(0,n.getMediaProperty)(e,a,o.quoteString),p=(0,n.getMediaDefaultValue)(e,a,o.quoteString);if(s.size>0){const l=(0,n.getVariableName)(e.id,a);t.setDefaultValue(l,(0,n.getType)(a),p),t.setMediaProperty(l,s),m((0,o.getEtsPropName)(i),l,r,!0)}}r.size>0&&t.mediaProperties.set("constraintSize",r)}],[i("align"),d("align","Alignment.")],[i("direction"),d("direction","Direction.")],[function(e){return e.hasMediaProperty("left")||e.hasMediaProperty("top")},function(e,t){var r;const o=null!==(r=e.property.get("position"))&&void 0!==r?r:"relative",{leftValue:a,topValue:i}=s(e,e.property,e.dynamicProperty),{mediaPositionLeft:l,mediaPositionTop:c,mediaOffsetLeft:u,mediaOffsetTop:y}=function(e){var t,r;const n=new Map,o=new Map,a=new Map,i=new Map,p=null!==(t=e.mediaProperty)&&void 0!==t?t:new Map,l=null!==(r=e.dynamicMediaProperty)&&void 0!==r?r:new Map,c=new Set;for(const[e]of p)c.add(e);for(const[e]of l)c.add(e);return c.forEach((t=>{var r,p,l,c;const u=null!==(p=null===(r=e.mediaProperty)||void 0===r?void 0:r.get(t))&&void 0!==p?p:new Map,y=null!==(c=null===(l=e.dynamicMediaProperty)||void 0===l?void 0:l.get(t))&&void 0!==c?c:new Map,d=u.get("position"),{leftValue:f,topValue:m}=s(e,u,y);"absolute"===d?("undefined"!==f&&n.set(t,f),"undefined"!==m&&o.set(t,m)):("undefined"!==f&&a.set(t,f),"undefined"!==m&&i.set(t,m))})),{mediaPositionLeft:n,mediaPositionTop:o,mediaOffsetLeft:a,mediaOffsetTop:i}}(e),d=l.size>0||c.size>0||"absolute"===o,f=u.size>0||y.size>0||"relative"===o,m=(0,n.getVariableName)(e.id,"positionLeft"),g=(0,n.getVariableName)(e.id,"positionTop"),h=(0,n.getVariableName)(e.id,"offsetLeft"),E=(0,n.getVariableName)(e.id,"offsetTop");if(0!==l.size||0!==c.size||0!==y.size||0!==u.size){if(d&&f&&(p(l,u),p(u,l),p(c,y),p(y,c)),d){const e="absolute"===o?a:"undefined",r="absolute"===o?i:"undefined";t.setDefaultValue(m,(0,n.getType)("left"),e),t.setDefaultValue(g,(0,n.getType)("top"),r),t.setMediaProperty(m,l),t.setMediaProperty(g,c),t.mediaProperties.set("position",new Map([["x",m],["y",g]]))}if(f){const e="relative"===o?a:"undefined",r="relative"===o?i:"undefined";t.setDefaultValue(h,(0,n.getType)("left"),e),t.setDefaultValue(E,(0,n.getType)("top"),r),t.setMediaProperty(h,u),t.setMediaProperty(E,y),t.mediaProperties.set("offset",new Map([["x",h],["y",E]]))}}}],[i("aspect-ratio"),u("aspect-ratio")],[i("display-priority"),u("display-priority")],[i("flex-basis"),c("flex-basis")],[i("flex-grow"),u("flex-grow")],[i("flex-shrink"),u("flex-shrink")],[i("align-self"),function(e,t){const r=(0,n.getMediaProperty)(e,"align-self",o.dealWithAlignSelf);if(0===r.size)return;const a=(0,n.getMediaDefaultValue)(e,"align-self",o.dealWithAlignSelf),i=(0,n.getVariableName)(e.id,"align-self");t.setDefaultValue(i,(0,n.getType)("align-self"),a),t.setMediaProperty(i,r),t.mediaProperties.set("alignSelf",i)}],[i("border-style"),d("border-style","BorderStyle.")],[function(e){return e.hasMediaProperty("border-top-style")||e.hasMediaProperty("border-bottom-style")||e.hasMediaProperty("border-left-style")||e.hasMediaProperty("border-right-style")},b("border-style",(0,o.curry)(o.getEtsEnumValue)("BorderStyle."))],[i("border-width"),c("border-width")],[function(e){return e.hasMediaProperty("border-top-width")||e.hasMediaProperty("border-bottom-width")||e.hasMediaProperty("border-left-width")||e.hasMediaProperty("border-right-width")},b("border-width",o.quoteString)],[i("border-color"),f("border-color")],[function(e){return e.hasMediaProperty("border-top-color")||e.hasMediaProperty("border-bottom-color")||e.hasMediaProperty("border-left-color")||e.hasMediaProperty("border-right-color")},b("border-color",o.dealWithColor)],[i("border-radius"),c("border-radius")],[function(e){return e.hasMediaProperty("border-top-left-radius")||e.hasMediaProperty("border-bottom-right-radius")||e.hasMediaProperty("border-bottom-left-radius")||e.hasMediaProperty("border-top-right-radius")},b("border-radius",o.quoteString)],[i("background-color"),f("background-color")],[function(e){return e.hasMediaProperty("background-image-src")||e.hasMediaProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),i=e.property.get("background-image-repeat"),s=e.dynamicProperty.get("background-image-src"),p=e.dynamicProperty.get("background-image-repeat"),l=(0,n.getMediaProperty)(e,"background-image-src",a.dealWithSrc),c=(0,n.getMediaProperty)(e,"background-image-repeat",o.dealWithBackgroundRepeat);if(0===l.size&&0===c.size)return;let u=(0,a.dealWithSrc)(null!=r?r:"");if((0,o.isEmptyOrUndefined)(s)||(u=s),l.size>0){const r=(0,n.getVariableName)(e.id,"background-image-src");t.setDefaultValue(r,(0,n.getType)("background-image-src"),u),t.setMediaProperty(r,l),u=r}let y="undefined";if(!(0,o.isEmptyOrUndefined)(i)){const e=(0,o.dealWithBackgroundRepeat)(i);null!=e&&""!==e&&(y=e)}if((0,o.isEmptyOrUndefined)(p)||(y=p),c.size>0){const r=(0,n.getVariableName)(e.id,"background-image-repeat");t.setDefaultValue(r,(0,n.getType)("background-image-repeat"),y),t.setMediaProperty(r,c),y=r}t.mediaProperties.set("backgroundImage",u+", "+y)}],[i("background-image-size"),function(e,t){const{enumValueMap:r,objValueMap:o}=E(e,"background-image-size");if(0===r.size&&0===o.size)return;const{enumDefault:a,objDefault:i}=T(e,"background-image-size"),s=(0,n.getVariableName)(e.id,"background-image-size-enum"),p=(0,n.getVariableName)(e.id,"background-image-size-obj");t.setDefaultValue(s,"ImageSize",a),t.setDefaultValue(p,"SizeOptions",i),t.setMediaProperty(s,r),t.setMediaProperty(p,o),t.mediaProperties.set("backgroundImageSize",`${s} !== undefined ? ${s} : ${p}`)}],[i("background-image-position"),function(e,t){const{enumValueMap:r,objValueMap:o}=E(e,"background-image-position");if(0===r.size&&0===o.size)return;const{enumDefault:a,objDefault:i}=T(e,"background-image-position"),s=(0,n.getVariableName)(e.id,"background-image-position-enum"),p=(0,n.getVariableName)(e.id,"background-image-position-obj");t.setDefaultValue(s,"Alignment",a),t.setDefaultValue(p,"Position",i),t.setMediaProperty(s,r),t.setMediaProperty(p,o),t.mediaProperties.set("backgroundImagePosition",`${s} !== undefined ? ${s} : ${p}`)}],[i("opacity"),u("opacity")],[i("visibility"),d("visibility","Visibility.")],[i("enabled"),y("enabled")],[i("font-color"),f("font-color")],[function(e){return e.hasMediaProperty("margin")||e.hasMediaProperty("margin-left")||e.hasMediaProperty("margin-top")||e.hasMediaProperty("margin-right")||e.hasMediaProperty("margin-bottom")},g("margin")],[function(e){return e.hasMediaProperty("padding")||e.hasMediaProperty("padding-left")||e.hasMediaProperty("padding-top")||e.hasMediaProperty("padding-right")||e.hasMediaProperty("padding-bottom")},g("padding")]]},3135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.componentsMediaParserArray=t.dateMediaParamParser=t.rawDataMediaParamParser=t.stringMediaParamParser=t.dealWithJustifyAlignContent=void 0;const n=r(6282),o=r(1195),a=r(8122),i=r(9248),s=r(1790),p=r(5264),l=(0,a.curry)(((e,t,r)=>r.type===e&&r.hasMediaProperty(t)));function c(e){return isNaN(Number(e))?(0,a.getEtsEnumValue)("FontWeight.",e):e}function u(e){let t=(0,a.getEtsEnumValue)("FlexAlign.",e);return"flex-start"===e?t="FlexAlign.Start":"flex-end"===e&&(t="FlexAlign.End"),t}function y(e){return"TextOverflow."+(0,a.firstUpperCase)(e)}function d(e,t,r){var n,o;const i=new Map,s=null!==(n=e.mediaProperty)&&void 0!==n?n:new Map,p=null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map;return s.forEach(((e,n)=>{let o=e.get(t);const s=e.get(r);(0,a.isEmptyOrUndefined)(o)&&(0,a.isEmptyOrUndefined)(s)||(o="0"===o||(0,a.isEmptyOrUndefined)(o)?"0":o.substring(0,o.length-2),i.set(n,o))})),p.forEach(((e,r)=>{const n=e.get(t);(0,a.isEmptyOrUndefined)(n)||i.set(r,n)})),i}t.dealWithJustifyAlignContent=u;const f=(0,a.curry)(((e,t,r)=>{const o=(0,n.getMediaProperty)(t,e,a.quoteString);if(0===o.size)return;const i=(0,n.getMediaDefaultValue)(t,e,a.quoteString),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,o),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),m=(0,a.curry)(((e,t,r)=>{const o=(0,n.getMediaProperty)(t,e);if(0===o.size)return;const i=(0,n.getMediaDefaultValue)(t,e),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,o),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),g=(0,a.curry)(((e,t,r)=>{m(e,t,r)})),h=(0,a.curry)(((e,t,r,o)=>{const i=(0,n.getMediaProperty)(r,e,(0,a.curry)(a.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,n.getMediaDefaultValue)(r,e,(0,a.curry)(a.getEtsEnumValue)(t)),p=(0,n.getVariableName)(r.id,e);o.setDefaultValue(p,(0,n.getType)(e),s),o.setMediaProperty(p,i),o.mediaProperties.set((0,a.getEtsPropName)(e),p)}));t.stringMediaParamParser=(0,a.curry)(((e,t,r)=>{const i=(0,n.getMediaProperty)(t,e,a.quoteString);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,n.getMediaDefaultValue)(t,e,a.quoteString),p=(0,n.getVariableName)(t.id,e),l=(0,o.getMediaVariableDecorator)(e);r.setDefaultValue(p,(0,n.getType)(e),s,l),r.setMediaProperty(p,i),r.mediaParams.set((0,a.getEtsPropName)(e),(0,o.getDynamicValueByDecorator)(e,p))})),t.rawDataMediaParamParser=(0,a.curry)(((e,t,r)=>{const i=(0,n.getMediaProperty)(t,e);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,n.getMediaDefaultValue)(t,e),p=(0,n.getVariableName)(t.id,e);r.setDefaultValue(p,(0,n.getType)(e),s),r.setMediaProperty(p,i),r.mediaParams.set((0,a.getEtsPropName)(e),(0,o.getDynamicValueByDecorator)(e,p))})),t.dateMediaParamParser=(0,a.curry)(((e,t,r,o,i)=>{const s=e=>void 0===e||""===e?"new Date()":"new Date ("+(0,a.quoteString)(e)+")",p=(0,n.getMediaProperty)(o,e,s);if(!(i.mediaParams instanceof Map)||0===p.size)return;const l=(0,n.getMediaDefaultValue)(o,e,s),c=(0,n.getVariableName)(o.id,e);i.setDefaultValue(c,(0,n.getType)(e),l,r),i.setMediaProperty(c,p),i.mediaParams.set(t,c)}));const E=(0,a.curry)(((e,t,r,o,a)=>{const i=(0,n.getMediaProperty)(o,e);if(!(a.mediaParams instanceof Map)||0===i.size)return;const s=(0,n.getMediaDefaultValue)(o,e),p=(0,n.getVariableName)(o.id,e);a.setDefaultValue(p,(0,n.getType)(e),s,r),a.setMediaProperty(p,i),a.mediaParams.set(t,p)})),T=(0,a.curry)(((e,t,r,o)=>{const i=(0,n.getMediaProperty)(r,e,(0,a.curry)(a.getEtsEnumValue)(t));if(!(o.mediaParams instanceof Map)||0===i.size)return;const s=(0,n.getMediaDefaultValue)(r,e,(0,a.curry)(a.getEtsEnumValue)(t)),p=(0,n.getVariableName)(r.id,e);o.setDefaultValue(p,(0,n.getType)(e),s),o.setMediaProperty(p,i),o.mediaParams.set((0,a.getEtsPropName)(e),p)})),P=(0,a.curry)(((e,t,r)=>{const o=(0,n.getMediaProperty)(t,e,a.dealWithColor);if(0===o.size)return;const i=(0,n.getMediaDefaultValue)(t,e,a.dealWithColor),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,o),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),v=(0,a.curry)(((e,t,r)=>{const o=(0,n.getMediaProperty)(t,e);if(0===o.size)return;const i=(0,n.getMediaDefaultValue)(t,e),s=(0,n.getVariableName)(t.id,e);r.setDefaultValue(s,(0,n.getType)(e),i),r.setMediaProperty(s,o),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),S=(0,a.curry)(((e,t,r,o)=>{const i=(0,n.getMediaProperty)(r,e,a.quoteString);if(0===i.size)return;const s=(0,n.getMediaDefaultValue)(r,e,a.quoteString),p=(0,n.getVariableName)(r.id,e);o.setDefaultValue(p,(0,n.getType)(e),s),o.setMediaProperty(p,i),o.mediaProperties.set((0,a.getEtsPropName)(t),p)})),b=(0,a.curry)(((e,t,r,o)=>{const i=(0,n.getMediaProperty)(r,e,u);if(!(o.mediaParams instanceof Map)||0===i.size)return;const s=(0,n.getMediaDefaultValue)(r,e,u),p=(0,n.getVariableName)(r.id,e);o.setDefaultValue(p,(0,n.getType)(e),s),o.setMediaProperty(p,i),o.mediaParams.set((0,a.getEtsPropName)(e),p)})),_=(0,a.curry)(((e,t,r,o)=>{const a=(0,n.getMediaProperty)(r,e,u);if(!(o.mediaProperties instanceof Map)||0===a.size)return;const i=(0,n.getMediaDefaultValue)(r,e,u),s=(0,n.getVariableName)(r.id,e);o.setDefaultValue(s,(0,n.getType)(e),i),o.setMediaProperty(s,a),o.mediaProperties.set("justifyContent",s)})),N=(0,a.curry)(((e,t)=>t.type===e));function C(e,t,r){const o=e.property.get(r),i=e.dynamicProperty.get(r),s=(0,n.getMediaProperty)(e,r,a.quoteString);if(0===s.size)return;let p="''";(0,a.isEmptyOrUndefined)(o)||(p=(0,a.quoteString)(o)),(0,a.isEmptyOrUndefined)(i)||(p=(0,a.getContentName)(i));const l=(0,n.getVariableName)(e.id,r);t.setDefaultValue(l,(0,n.getType)(r),p),t.setMediaProperty(l,s),t.setMediaParams(l)}const A=(0,a.curry)(((e,t,r,o)=>{let i=o.mediaProperties.get((0,a.getEtsPropName)(e));void 0===i&&(i=new Map);const s=`${e}-${t}`,p=(0,n.getVariableName)(r.id,s);let l=(0,n.getMediaProperty)(r,s,a.quoteString),u=(0,n.getMediaDefaultValue)(r,s,a.quoteString);if("string"!=typeof i){if((0,a.isEmptyOrUndefined)(u))return;"style"===t&&(l=(0,n.getMediaProperty)(r,s,(0,a.curry)(a.getEtsEnumValue)("FontStyle.")),u=(0,n.getMediaDefaultValue)(r,s,(0,a.curry)(a.getEtsEnumValue)("FontStyle."))),"weight"===t&&(l=(0,n.getMediaProperty)(r,s,c),u=(0,n.getMediaDefaultValue)(r,s,c)),o.setDefaultValue(p,(0,n.getType)(s),u),o.setMediaProperty(p,l),i.set(t,p)}o.mediaProperties.set((0,a.getEtsPropName)(e),i)}));function M(e,t){const r=(0,n.getMediaProperty)(e,"font-weight",a.dealWithFontWeight);if(0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"font-weight",a.dealWithFontWeight),i=(0,n.getVariableName)(e.id,"font-weight");t.setDefaultValue(i,(0,n.getType)("font-weight"),o),t.setMediaProperty(i,r),t.mediaProperties.set("fontWeight",i)}function w(e,t,r,o){const i=new Map([["value","search-value"],["placeholder","placeholder"],["icon","icon"]]).get(e);if(void 0===i)return;const s=r.getProperty(i),p=r.dynamicProperty.get(i),l=(0,n.getMediaProperty)(r,i,a.quoteString),c=(0,n.getVariableName)(r.id,i);let u="''";0!==l.size&&((0,a.isEmptyOrUndefined)(s)||(u=(0,a.quoteString)(s)),(0,a.isEmptyOrUndefined)(p)||(u=(0,a.getContentName)(p)),o.setDefaultValue(c,(0,n.getType)(i),u),o.setMediaProperty(c,l),t.push(`${e}: ${(0,a.getContentName)(c)}`))}const O=[[l("button","label"),function(e,t){C(e,t,"label")}],[l("button","type"),h("type","ButtonType.")],[l("button","state-effect"),g("state-effect")],[l("button","font-size"),f("font-size")],[l("button","font-style"),h("font-style","FontStyle.")],[l("button","font-weight"),M],[l("button","font-family"),f("font-family")]],R=[[l("divider","vertical"),g("vertical")],[l("divider","color"),P("color")],[l("divider","stroke-width"),f("stroke-width")],[l("divider","line-cap"),h("line-cap","LineCapStyle.")]],x=[[N("image"),function(e,t){var r;const o=null!==(r=e.property.get("src"))&&void 0!==r?r:"",s=e.dynamicProperty.get("src"),p=(0,n.getMediaProperty)(e,"src",i.dealWithSrc);if(0===p.size)return;let l=(0,i.dealWithSrc)(o);(0,a.isEmptyOrUndefined)(s)||(l=s);const c=(0,n.getVariableName)(e.id,"src");t.setDefaultValue(c,(0,n.getType)("src"),l),t.setMediaProperty(c,p),t.setMediaParams(c)}],[l("image","alt"),f("alt")],[l("image","object-fit"),h("object-fit","ImageFit.")],[l("image","object-repeat"),h("object-repeat","ImageRepeat.")],[l("image","interpolation"),h("interpolation","ImageInterpolation.")],[l("image","render-mode"),h("render-mode","ImageRenderMode.")],[function(e){return e.hasMediaProperty("source-size-width")||e.hasMediaProperty("source-size-height")},function(e,t){let r=e.property.get("source-size-width"),o=e.property.get("source-size-height");const i=e.dynamicProperty.get("source-size-width"),s=e.dynamicProperty.get("source-size-height"),p=d(e,"source-size-width","source-size-height"),l=d(e,"source-size-height","source-size-width");if(0===p.size)return;r="0"===r||(0,a.isEmptyOrUndefined)(r)?"0":r.substring(0,r.length-2),o="0"===o||(0,a.isEmptyOrUndefined)(o)?"0":o.substring(0,o.length-2),(0,a.isEmptyOrUndefined)(i)||(r=i),(0,a.isEmptyOrUndefined)(s)||(o=s);const c=(0,n.getVariableName)(e.id,"source-size-width"),u=(0,n.getVariableName)(e.id,"source-size-height");t.setDefaultValue(c,(0,n.getType)("source-size-width"),r),t.setDefaultValue(u,(0,n.getType)("source-size-height"),o),t.setMediaProperty(c,p),t.setMediaProperty(u,l);const y=new Map([["width",c],["height",u]]);t.mediaProperties.set("sourceSize",y)}]],I=[[function(e){return"progress"===e.type&&(e.hasMediaProperty("value")||e.hasMediaProperty("total")||e.hasMediaProperty("style"))},function(e,t){const r=e.property.get("value"),o=e.dynamicProperty.get("value"),i=(0,n.getMediaProperty)(e,"value");if(!(t.mediaParams instanceof Map)||0===i.size)return;let s=null!=r?r:"0";(0,a.isEmptyOrUndefined)(o)||(s=o);const p=(0,n.getVariableName)(e.id,"value");t.setDefaultValue(p,(0,n.getType)("value"),s),t.setMediaProperty(p,i),t.mediaParams.set("value",p)}],[l("progress","total"),(0,t.rawDataMediaParamParser)("total")],[l("progress","style"),T("style","ProgressStyle.")],[l("progress","color"),P("color")]],F=[[l("slider","value"),(0,t.rawDataMediaParamParser)("value")],[l("slider","min"),(0,t.rawDataMediaParamParser)("min")],[l("slider","max"),(0,t.rawDataMediaParamParser)("max")],[l("slider","step"),(0,t.rawDataMediaParamParser)("step")],[l("slider","style"),T("style","SliderStyle.")],[l("slider","block-color"),P("block-color")],[l("slider","track-color"),P("track-color")],[l("slider","selected-color"),P("selected-color")],[l("slider","show-steps"),g("show-steps")],[l("slider","show-tips"),g("show-tips")]],k=[[l("text","content"),function(e,t){C(e,t,"content")}],[l("text","text-align"),h("text-align","TextAlign.")],[l("text","text-overflow"),function(e,t){const r=(0,n.getMediaProperty)(e,"text-overflow",y);if(0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"text-overflow",y),a=(0,n.getVariableName)(e.id,"text-overflow");t.setDefaultValue(a,(0,n.getType)("text-overflow"),o),t.setMediaProperty(a,r),t.mediaProperties.set("textOverflow",new Map([["overflow",a]]))}],[l("text","max-lines"),m("max-lines")],[l("text","line-height"),f("line-height")],[function(e){return"text"===e.type&&(e.hasMediaProperty("decoration-type")||e.hasMediaProperty("decoration-color"))},function(e,t){const r=(0,n.getMediaProperty)(e,"decoration-type",(0,a.curry)(a.getEtsEnumValue)("TextDecorationType.")),o=(0,n.getMediaProperty)(e,"decoration-color",a.dealWithColor);if(0===r.size&&0===o.size)return;let i=(0,n.getMediaDefaultValue)(e,"decoration-type",(0,a.curry)(a.getEtsEnumValue)("TextDecorationType.")),s=(0,n.getMediaDefaultValue)(e,"decoration-color",a.dealWithColor);if(r.size>0){const o=(0,n.getVariableName)(e.id,"decoration-type");t.setDefaultValue(o,(0,n.getType)("decoration-type"),i),t.setMediaProperty(o,r),i=o}if(o.size>0){const r=(0,n.getVariableName)(e.id,"decoration-color");t.setDefaultValue(r,(0,n.getType)("decoration-color"),s),t.setMediaProperty(r,o),s=r}const p=new Map([["type",i]]);t.mediaProperties.set("decoration",p),"undefined"!==s&&p.set("color",s)}],[l("text","baseline-offset"),f("baseline-offset")],[l("text","text-case"),h("text-case","TextCase.")],[l("text","font-size"),f("font-size")],[l("text","font-style"),h("font-style","FontStyle.")],[l("text","font-weight"),M],[l("text","font-family"),f("font-family")]],L=[[l("column","space"),(0,t.stringMediaParamParser)("space")],[l("column","align-items-column"),function(e,t){const r=(0,n.getMediaProperty)(e,"align-items-column",s.dealWithColumnAlignItems);if(0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"align-items-column",s.dealWithColumnAlignItems),a=(0,n.getVariableName)(e.id,"align-items-column");t.setDefaultValue(a,(0,n.getType)("align-items-column"),o),t.setMediaProperty(a,r),t.mediaProperties.set("alignItems",a)}],[l("column","justify-content-rc"),_("justify-content-rc","FlexAlign.")]],D=[[l("row","space"),(0,t.stringMediaParamParser)("space")],[l("row","align-items-row"),function(e,t){const r=(0,n.getMediaProperty)(e,"align-items-row",s.dealWithRowAlignItems);if(0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"align-items-row",s.dealWithRowAlignItems),a=(0,n.getVariableName)(e.id,"align-items-row");t.setDefaultValue(a,(0,n.getType)("align-items-row"),o),t.setMediaProperty(a,r),t.mediaProperties.set("alignItems",a)}],[l("row","justify-content-rc"),_("justify-content-rc","FlexAlign.")]],U=[[l("flex","flex-direction"),function(e,t){const r=(0,n.getMediaProperty)(e,"flex-direction",(0,a.curry)(a.getEtsEnumValue)("FlexDirection."));if(!(t.mediaParams instanceof Map)||0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"flex-direction",(0,a.curry)(a.getEtsEnumValue)("FlexDirection.")),i=(0,n.getVariableName)(e.id,"flex-direction");t.setDefaultValue(i,(0,n.getType)("flex-direction"),o),t.setMediaProperty(i,r),t.mediaParams.set("direction",i)}],[l("flex","wrap"),function(e,t){const r=(0,n.getMediaProperty)(e,"wrap",a.dealWithWrap);if(!(t.mediaParams instanceof Map)||0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"wrap",a.dealWithWrap),i=(0,n.getVariableName)(e.id,"wrap");t.setDefaultValue(i,(0,n.getType)("wrap"),o),t.setMediaProperty(i,r),t.mediaParams.set("wrap",i)}],[l("flex","justify-content"),b("justify-content","FlexAlign.")],[l("flex","align-items-flex"),function(e,t){const r=(0,n.getMediaProperty)(e,"align-items-flex",p.dealWithFlexAlignItems);if(!(t.mediaParams instanceof Map)||0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"align-items-flex",p.dealWithFlexAlignItems),a=(0,n.getVariableName)(e.id,"align-items-flex");t.setDefaultValue(a,(0,n.getType)("align-items-flex"),o),t.setMediaProperty(a,r),t.mediaParams.set("alignItems",a)}],[l("flex","align-content"),b("align-content","FlexAlign.")]],V=[[l("list","space"),(0,t.stringMediaParamParser)("space")],[l("list","initial-index"),(0,t.rawDataMediaParamParser)("initial-index")],[l("list","list-direction"),h("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasMediaProperty("divider-stroke-width")||e.hasMediaProperty("divider-color")||e.hasMediaProperty("divider-start-margin")||e.hasMediaProperty("divider-end-margin"))},function(e,t){const r=[["divider-stroke-width",a.quoteString],["divider-color",a.dealWithColor],["divider-start-margin",a.quoteString],["divider-end-margin",a.quoteString]];let o=0;const i=new Map;for(const[s,p]of r){const r=(0,n.getMediaProperty)(e,s,p),l=(0,a.getEtsPropName)(s.replace("divider-",""));let c=(0,n.getMediaDefaultValue)(e,s,p);if("undefined"===c&&"divider-stroke-width"===s&&(c="0"),r.size>0){const a=(0,n.getVariableName)(e.id,s);t.setDefaultValue(a,(0,n.getType)(s),c),t.setMediaProperty(a,r),c=a,o++}i.set(l,c)}o>0&&t.mediaProperties.set("divider",i)}],[l("list","edit-mode"),g("edit-mode")],[l("list","edge-effect"),h("edge-effect","EdgeEffect.")],[l("list","chain-animation"),g("chain-animation")]],B=[[l("list-item","sticky"),h("sticky","Sticky.")],[l("list-item","editable"),g("editable")]],z=[[l("swiper","index"),m("index")],[l("swiper","auto-play"),g("auto-play")],[l("swiper","interval"),m("interval")],[l("swiper","indicator"),g("indicator")],[l("swiper","loop"),g("loop")],[l("swiper","duration"),m("duration")],[l("swiper","vertical"),g("vertical")],[l("swiper","item-space"),f("item-space")],[l("swiper","cached-count"),m("cached-count")],[l("swiper","disable-swipe"),g("disable-swipe")]],G=[[l("text-input","placeholder"),(0,t.stringMediaParamParser)("placeholder")],[l("text-input","textInput-type"),function(e,t){const r=(0,n.getMediaProperty)(e,"textInput-type",(0,a.curry)(a.getEtsEnumValue)("InputType."));if(0===r.size)return;const o=(0,n.getMediaDefaultValue)(e,"textInput-type",(0,a.curry)(a.getEtsEnumValue)("InputType.")),i=(0,n.getVariableName)(e.id,"textInput-type");t.setDefaultValue(i,(0,n.getType)("textInput-type"),o),t.setMediaProperty(i,r),t.mediaProperties.set("type",i)}],[l("text-input","placeholderColor"),P("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasMediaProperty("placeholderFont-size")||e.hasMediaProperty("placeholderFont-weight")||e.hasMediaProperty("placeholderFont-family")||e.hasMediaProperty("placeholderFont-style"))},function(e,t){const r=[["size",a.quoteString],["weight",c],["family",a.quoteString],["style",(0,a.curry)(a.getEtsEnumValue)("FontStyle.")]];let o=0;const i=new Map;for(const[a,s]of r){const r=`placeholderFont-${a}`,p=(0,n.getMediaProperty)(e,r,s);let l=(0,n.getMediaDefaultValue)(e,r,s);if(p.size>0){const a=(0,n.getVariableName)(e.id,r);t.setDefaultValue(a,(0,n.getType)(r),l),t.setMediaProperty(a,p),l=a,o++}i.set(a,l)}o>0&&t.mediaProperties.set("placeholderFont",i)}],[l("text-input","enterKeyType"),h("enterKeyType","EnterKeyType.")],[l("text-input","caretColor"),P("caretColor")],[l("text-input","maxLength"),m("maxLength")]],j=[[l("refresh","friction"),(0,t.rawDataMediaParamParser)("friction")],[l("refresh","offset"),(0,t.stringMediaParamParser)("offset")],[l("refresh","refreshing"),(0,t.rawDataMediaParamParser)("refreshing")]],W=[[l("timePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[l("timePicker","useMilitaryTime"),g("useMilitaryTime")]],$=[[l("datePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[l("datePicker","start"),(0,t.dateMediaParamParser)("start","start","private")],[l("datePicker","end"),(0,t.dateMediaParamParser)("end","end","private")],[l("datePicker","lunar"),g("lunar")]],q=[[l("textPicker","range"),(0,t.rawDataMediaParamParser)("range")],[l("textPicker","textPicker-selected"),E("textPicker-selected","selected","@State")],[l("textPicker","defaultPickerItemHeight"),f("defaultPickerItemHeight")]],H=[[l("select","select-option"),function(e,t){!function(e,t,r){const o=e.dynamicProperty.get(r),i=(0,n.getMediaProperty)(e,r,a.quoteString);if(0===i.size)return;const s=null!=o?o:'[{value: ""}]',p=(0,n.getVariableName)(e.id,r);t.setDefaultValue(p,(0,n.getType)(r),s),t.setMediaProperty(p,i),t.setMediaParams(p)}(e,t,"select-option")}],[l("select","select-value"),function(e,t){const r="select-value",o=(0,n.getMediaProperty)(e,r,a.quoteString);if(0===o.size)return;const i=(0,n.getMediaDefaultValue)(e,r,a.quoteString),s=(0,n.getVariableName)(e.id,r);t.setDefaultValue(s,(0,n.getType)(r),i),t.setMediaProperty(s,o),t.mediaProperties.set("value",s)}],[l("select","selected"),m("selected")],[l("select","font-size"),A("font","size")],[l("select","font-style"),A("font","style")],[l("select","font-family"),A("font","family")],[l("select","font-weight"),A("font","weight")],[l("select","selected-option-font-size"),A("selected-option-font","size")],[l("select","selected-option-font-style"),A("selected-option-font","style")],[l("select","selected-option-font-family"),A("selected-option-font","family")],[l("select","selected-option-font-weight"),A("selected-option-font","weight")],[l("select","selected-option-font-color"),P("selected-option-font-color")],[l("select","selected-option-bg-color"),P("selected-option-bg-color")],[l("select","option-font-size"),A("option-font","size")],[l("select","option-font-style"),A("option-font","style")],[l("select","option-font-family"),A("option-font","family")],[l("select","option-font-weight"),A("option-font","weight")],[l("select","option-font-color"),P("option-font-color")],[l("select","option-bg-color"),P("option-bg-color")]],Y=[[l("toggle","toggle-type"),function(e,t){const r="ToggleType.",o="toggle-type",i=(0,n.getMediaProperty)(e,o,(0,a.curry)(a.getEtsEnumValue)(r));if(!(t.mediaParams instanceof Map)||0===i.size)return;const s=(0,n.getMediaDefaultValue)(e,o,(0,a.curry)(a.getEtsEnumValue)(r)),p=(0,n.getVariableName)(e.id,o);t.setDefaultValue(p,(0,n.getType)(o),s),t.setMediaProperty(p,i),t.mediaParams.set("type",p)}],[l("toggle","isOn"),(0,t.rawDataMediaParamParser)("isOn")],[l("toggle","selectedColor"),P("selectedColor")],[l("toggle","switchPointColor"),P("switchPointColor")]],J=[[l("checkbox","select"),g("select")],[l("checkbox","selectedColor"),P("selectedColor")],[l("checkbox","name"),(0,t.stringMediaParamParser)("name")],[l("checkbox","group"),(0,t.stringMediaParamParser)("group")]],Q=[[l("checkboxGroup","selectAll"),g("selectAll")],[l("checkboxGroup","selectedColor"),P("selectedColor")],[l("checkboxGroup","group"),(0,t.stringMediaParamParser)("group")]],X=[[l("scroll","scrollable"),h("scrollable","ScrollDirection.")],[l("scroll","scroll-bar"),h("scroll-bar","BarState.")],[l("scroll","scroll-bar-color"),P("scroll-bar-color")],[l("scroll","scroll-bar-width"),f("scroll-bar-width")],[l("scroll","edge-effect-scroll"),function(e,t){const r="edge-effect-scroll",o=(0,n.getMediaProperty)(e,r,a.dealWithScrollEdgeEffect);if(0===o.size)return;const i=(0,n.getMediaDefaultValue)(e,r,a.dealWithScrollEdgeEffect),s=(0,n.getVariableName)(e.id,r);t.setDefaultValue(s,(0,n.getType)(r),i),t.setMediaProperty(s,o),t.mediaProperties.set("edgeEffect",s)}]],K=[[l("grid","columns-template"),f("columns-template")],[l("grid","rows-template"),f("rows-template")],[l("grid","columns-gap"),f("columns-gap")],[l("grid","rows-gap"),f("rows-gap")],[l("grid","scroll-bar"),h("scroll-bar","BarState.")],[l("grid","scroll-bar-color"),P("scroll-bar-color")],[l("grid","scroll-bar-width"),f("scroll-bar-width")],[l("grid","cached-count"),m("cached-count")],[l("grid","edit-mode"),g("edit-mode")],[l("grid","layout-direction"),h("layout-direction","GridDirection.")],[l("grid","max-count"),m("max-count")],[l("grid","min-count"),m("min-count")],[l("grid","cell-length"),m("cell-length")],[l("grid","multi-selectable"),g("multi-selectable")],[l("grid","support-animation"),g("support-animation")]],Z=[[l("grid-item","row-start"),m("row-start")],[l("grid-item","row-end"),m("row-end")],[l("grid-item","column-start"),m("column-start")],[l("grid-item","column-end"),m("column-end")],[l("grid-item","force-rebuild"),g("force-rebuild")],[l("grid-item","selectable"),g("selectable")]],ee=[[l("stack","align-content-stack"),function(e,t){const r="align-content-stack",o=(0,n.getMediaProperty)(e,r,(0,a.curry)(a.getEtsEnumValue)("Alignment."));if(!(t.mediaParams instanceof Map)||0===o.size)return;const i=(0,n.getMediaDefaultValue)(e,r,(0,a.curry)(a.getEtsEnumValue)("Alignment.")),s=(0,n.getVariableName)(e.id,r);t.setDefaultValue(s,(0,n.getType)(r),i),t.setMediaProperty(s,o),t.mediaParams.set("alignContent",s)}]],te=[[l("navigation","navigation-title"),S("navigation-title","title")],[l("navigation","subTitle"),f("subTitle")],[l("navigation","menus"),v("menus")],[l("navigation","titleMode"),h("titleMode","NavigationTitleMode.")],[l("navigation","toolBar"),v("toolBar")],[l("navigation","hideToolBar"),g("hideToolBar")],[l("navigation","hideTitleBar"),g("hideTitleBar")],[l("navigation","hideBackButton"),g("hideBackButton")]],re=[[function(e){return"search"===e.type},function(e,t){const r=[];w("value",r,e,t),w("placeholder",r,e,t),w("icon",r,e,t),0!==r.length&&t.setParams(`{${r.join(", ")}}`)}],[l("search","text-font-size"),A("text-font","size")],[l("search","text-font-style"),A("text-font","style")],[l("search","text-font-weight"),A("text-font","weight")],[l("search","text-font-family"),A("text-font","family")],[l("search","placeholder-font-size"),A("placeholder-font","size")],[l("search","placeholder-font-style"),A("placeholder-font","style")],[l("search","placeholder-font-weight"),A("placeholder-font","weight")],[l("search","placeholder-font-family"),A("placeholder-font","family")],[l("search","placeholderColor"),P("placeholderColor")],[l("search","text-align"),h("text-align","TextAlign.")],[l("search","search-button"),f("search-button")],[l("search","copy-option"),h("copy-option","CopyOptions.")]],ne=[[l("tabs","bar-position"),T("bar-position","BarPosition.")],[l("tabs","index"),(0,t.rawDataMediaParamParser)("index")],[l("tabs","controller"),(0,t.rawDataMediaParamParser)("controller")],[l("tabs","vertical"),g("vertical")],[l("tabs","scrollable"),g("scrollable")],[l("tabs","bar-mode"),h("bar-mode","BarMode.")],[l("tabs","bar-width"),f("bar-width")],[l("tabs","bar-height"),f("bar-height")],[l("tabs","animation-duration"),m("animation-duration")]],oe=[[function(e){return"tab-content"===e.type&&(e.hasMediaProperty("tabBar-icon")||e.hasMediaProperty("tabBar-text"))},function(e,t){const r=(0,n.getMediaProperty)(e,"tabBar-text",a.quoteString),o=(0,n.getMediaProperty)(e,"tabBar-icon",i.dealWithSrc),s=(0,n.getMediaDefaultValue)(e,"tabBar-text",a.quoteString),p=(0,n.getMediaDefaultValue)(e,"tabBar-icon",i.dealWithSrc),l=(0,n.getVariableName)(e.id,"tabBar-text"),c=(0,n.getVariableName)(e.id,"tabBar-icon"),u=new Map([["text",s],["icon",p]]);r.size>0&&(t.setDefaultValue(l,(0,n.getType)("tabBar-text"),s),t.setMediaProperty(l,r),u.set("text",l)),o.size>0&&(t.setDefaultValue(c,(0,n.getType)("tabBar-icon"),p),t.setMediaProperty(c,o),u.set("icon",c)),t.mediaProperties.set("tabBar",u)}]];t.componentsMediaParserArray=[...O,...R,...x,...I,...F,...k,...L,...D,...U,...V,...B,...z,...G,...Y,...j,...W,...q,...H,...$,...ee,...X,...K,...Z,...te,...re,...ne,...oe,...J,...Q]},366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCustomMediaVisualModel=void 0;const n=r(6125),o=r(3135),a=r(6282),i=r(1195),s=r(8122);t.parseCustomMediaVisualModel=function(e,t){(0,i.getCustomAttributeMap)().forEach(((r,o)=>{if(function(e,t){return e.hasMediaProperty(t)}(e,o)){const l=p.get(r.type);"function"==typeof l&&l(o,e,t);const c=n.enumParserMap.get(r.type);"function"==typeof c&&function(e,t,r,n){const o=(0,a.getMediaProperty)(t,e,n);if(!(r.mediaParams instanceof Map)||0===o.size)return;const p=(0,a.getMediaDefaultValue)(t,e,n),l=(0,a.getVariableName)(t.id,e);r.setDefaultValue(l,(0,a.getType)(e),p),r.setMediaProperty(l,o),r.mediaParams.set((0,s.getEtsPropName)(e),(0,i.getDynamicValueByDecorator)(e,l))}(o,e,t,c)}}))};const p=new Map([["string",o.stringMediaParamParser],["boolean",o.rawDataMediaParamParser],["number",o.rawDataMediaParamParser],["any[]",o.rawDataMediaParamParser],["object",o.rawDataMediaParamParser],["Date",function(e,t,r){(0,o.dateMediaParamParser)(e,(0,s.getEtsPropName)(e),"private",t,r)}]])},3729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMediaProperty=t.parseMediaVisualModel=void 0;const n=r(1912),o=r(9223),a=r(3135);function i(e,t,r){const n=t.get(r);return void 0!==n&&n.has(e)}t.parseMediaVisualModel=function(e,t){(0,o.forEachParser)(e,t),(0,o.ifParser)(e,t);for(const r of p)("boolean"==typeof r[0]||r[0](e))&&r[1](e,t)},t.isMediaProperty=function(e,t){return!i(e,s,"common")&&!i(e,s,t)&&!i(e,s,"events")};const s=new Map([["common",new Set(["keyGenerator","item","idx"])],["events",new Set([...n.events])]]),p=[...o.commonMediaParserArray,...a.componentsMediaParserArray]},6282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMediaDefaultValue=t.getVariableName=t.getMediaProperty=t.getType=void 0;const n=r(4294),o=r(1290),a=r(1195),i=r(8122);function s(e,t){for(const r of t)if(r.property===e)return r.etsType;return""}t.getType=function(e){const t=e+"-visual",r=o.etsPropertyList;let n="";for(const e of r)if(void 0!==e.propertySet.properties&&(n=s(t,e.propertySet.properties)),e.propertySet.property===t&&(n=e.propertySet.etsType),""!==n)break;return""!==n?function(e=""){const t=new Map([["Rfloat","Resource"],["Rstring","Resource"],["Rcolor","Resource"],["Rmedia","Resource"],["Rrawfile","Resource"],["Rplural","Resource"],["ETSArray","any[]"]]),r=new Array;return e.split("|").forEach((e=>{const n=t.get(e),o=null!=n?n:e;r.includes(o)||r.push(null!=n?n:e)})),r.join(" | ")}(n):(0,a.getCustomAttrType)(e)},t.getMediaProperty=function(e,t,r){var n,o;const a=new Map;return(null!==(n=e.mediaProperty)&&void 0!==n?n:new Map).forEach(((e,n)=>{let o=e.get(t);(0,i.isEmptyOrUndefined)(o)||("function"==typeof r&&(o=r(o)),(0,i.isEmptyOrUndefined)(o)||a.set(n,o))})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{let n=e.get(t);void 0===n||"content"!==t&&"label"!==t||(n=(0,i.getContentName)(n)),(0,i.isEmptyOrUndefined)(n)||a.set(r,n)})),a},t.getVariableName=function(e,t){const r=(0,n.getTagName)(e),o=`this.${(0,i.getEtsPropName)(r)}${(0,i.firstUpperCase)((0,i.getEtsPropName)(t))}`;return`${o}_${(0,n.getUniqueId)(o)}`},t.getMediaDefaultValue=function(e,t,r){var n;const o=e.property.get(t),a=e.dynamicProperty.get(t);let s=null!==(n=new Map([["if","true"],["auto-play","false"],["interval","3000"],["select-value","''"],["columns-template","''"],["rows-template","''"],["tabBar-icon","''"],["tabBar-text","'TabBar'"]]).get(t))&&void 0!==n?n:"undefined";return(0,i.isEmptyOrUndefined)(o)||(s="function"==typeof r?r(o):o,s=(0,i.isEmptyOrUndefined)(s)?"undefined":s),(0,i.isEmptyOrUndefined)(a)||(s=a),s}},8916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buttonParserArray=void 0;const n=r(8122);t.buttonParserArray=[[(0,n.hasFeatureProperty)("button","label"),n.labelParamParser],[(0,n.hasFeatureProperty)("button","type"),(0,n.enumPropertyParser)("type","ButtonType.")],[(0,n.hasFeatureProperty)("button","state-effect"),(0,n.booleanPropertyParser)("state-effect")],[(0,n.hasFeatureProperty)("button","font-size"),(0,n.stringPropertyParser)("font-size")],[(0,n.hasFeatureProperty)("button","font-style"),(0,n.enumPropertyParser)("font-style","FontStyle.")],[(0,n.hasFeatureProperty)("button","font-weight"),n.fontWeightPropertyParser],[(0,n.hasFeatureProperty)("button","font-family"),(0,n.stringPropertyParser)("font-family")]]},1147:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxGroupParseArray=void 0;const n=r(8122);t.checkboxGroupParseArray=[[(0,n.hasFeatureProperty)("checkboxGroup","selectAll"),(0,n.booleanPropertyParser)("selectAll")],[(0,n.hasFeatureProperty)("checkboxGroup","selectedColor"),(0,n.colorPropertyParser)("selectedColor")],[(0,n.hasFeatureProperty)("checkboxGroup","group"),(0,n.stringParamParser)("group")]]},2218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxParseArray=void 0;const n=r(8122);t.checkboxParseArray=[[(0,n.hasFeatureProperty)("checkbox","select"),(0,n.booleanPropertyParser)("select")],[(0,n.hasFeatureProperty)("checkbox","selectedColor"),(0,n.colorPropertyParser)("selectedColor")],[(0,n.hasFeatureProperty)("checkbox","name"),(0,n.stringParamParser)("name")],[(0,n.hasFeatureProperty)("checkbox","group"),(0,n.stringParamParser)("group")]]},7150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonParserArray=void 0;const n=r(8122),o=r(9248);function a(e,t,r,o=!1){(0,n.isEmptyOrUndefined)(t)||r.set(e,o?t:(0,n.quoteString)(t))}function i(e,t,r,o,a){const i=e.getProperty(t),s=e.getProperty(r),p=e.dynamicProperty.has(t),l=e.dynamicProperty.has(r),c=(0,n.getEdgeBorderDirection)(r);(0,n.isEmptyOrUndefined)(s)?(0,n.isEmptyOrUndefined)(i)||o.set(c,p?i:a(i)):o.set(c,l?s:a(s))}t.commonParserArray=[[(0,n.hasCommonProperty)("width"),(0,n.stringPropertyParser)("width")],[(0,n.hasCommonProperty)("height"),(0,n.stringPropertyParser)("height")],[function(e){return e.hasProperty("constraint-size-min-width")||e.hasProperty("constraint-size-max-width")||e.hasProperty("constraint-size-min-height")||e.hasProperty("constraint-size-max-height")},function(e,t){const r=new Map,n=e.getProperty("constraint-size-min-width"),o=e.getProperty("constraint-size-max-width"),i=e.getProperty("constraint-size-min-height"),s=e.getProperty("constraint-size-max-height");a("minWidth",n,r,e.dynamicProperty.has("constraint-size-min-width")),a("maxWidth",o,r,e.dynamicProperty.has("constraint-size-max-width")),a("minHeight",i,r,e.dynamicProperty.has("constraint-size-min-height")),a("maxHeight",s,r,e.dynamicProperty.has("constraint-size-max-height")),r.size>0&&t.properties.set("constraintSize",r)}],[(0,n.hasCommonProperty)("align"),(0,n.enumPropertyParser)("align","Alignment.")],[(0,n.hasCommonProperty)("direction"),(0,n.enumPropertyParser)("direction","Direction.")],[function(e){return e.hasProperty("left")||e.hasProperty("top")},function(e,t){const r="absolute"===e.property.get("position")?"position":"offset",o=e.property.get("left"),a=e.property.get("top"),i=e.dynamicProperty.get("left"),s=e.dynamicProperty.get("top");if((0,n.isEmptyOrUndefined)(i)&&(0,n.isEmptyOrUndefined)(s)&&(0,n.isEmptyOrUndefined)(o)&&(0,n.isEmptyOrUndefined)(a))return;const p=new Map([["x",`${(0,n.quoteString)(null!=o?o:"0")}`],["y",`${(0,n.quoteString)(null!=a?a:"0")}`]]);(0,n.isEmptyOrUndefined)(i)||p.set("x",i),(0,n.isEmptyOrUndefined)(s)||p.set("y",s),t.properties.set(r,p)}],[(0,n.hasCommonProperty)("aspect-ratio"),(0,n.numberPropertyParser)("aspect-ratio")],[(0,n.hasCommonProperty)("display-priority"),(0,n.numberPropertyParser)("display-priority")],[(0,n.hasCommonProperty)("flex-basis"),(0,n.stringPropertyParser)("flex-basis")],[(0,n.hasCommonProperty)("flex-grow"),(0,n.numberPropertyParser)("flex-grow")],[(0,n.hasCommonProperty)("flex-shrink"),(0,n.numberPropertyParser)("flex-shrink")],[(0,n.hasCommonProperty)("align-self"),function(e,t){const r=e.dynamicProperty.get("align-self");if(!(0,n.isEmptyOrUndefined)(r))return void t.properties.set("alignSelf",r);const o=e.property.get("align-self");if((0,n.isEmptyOrUndefined)(o))return;const a=(0,n.dealWithAlignSelf)(o);t.properties.set("alignSelf",a)}],[function(e){return e.hasProperty("border-style")||e.hasProperty("border-top-style")||e.hasProperty("border-right-style")||e.hasProperty("border-bottom-style")||e.hasProperty("border-left-style")},function(e,t){const r=new Map,o=e.getProperty("border-style"),a=e.getProperty("border-top-style"),s=e.getProperty("border-bottom-style"),p=e.getProperty("border-left-style"),l=e.getProperty("border-right-style"),c=e.dynamicProperty.has("border-style"),u=(0,n.getBorderDirections)("border-style");for(const t of u)i(e,"border-style",t,r,(0,n.curry)(n.getEtsEnumValue)("BorderStyle."));(0,n.isEmptyOrUndefined)(a)&&(0,n.isEmptyOrUndefined)(s)&&(0,n.isEmptyOrUndefined)(p)&&(0,n.isEmptyOrUndefined)(l)?(0,n.isEmptyOrUndefined)(o)||t.properties.set((0,n.getEtsPropName)("border-style"),c?o:(0,n.getEtsEnumValue)("BorderStyle.",o)):r.size>0&&t.properties.set((0,n.getEtsPropName)("border-style"),r)}],[function(e){return e.hasProperty("border-width")||e.hasProperty("border-top-width")||e.hasProperty("border-right-width")||e.hasProperty("border-bottom-width")||e.hasProperty("border-left-width")},function(e,t){const r=new Map,o=e.getProperty("border-width"),i=e.getProperty("border-top-width"),s=e.getProperty("border-bottom-width"),p=e.getProperty("border-left-width"),l=e.getProperty("border-right-width"),c=e.property.has("border-top-width"),u=e.property.has("border-bottom-width"),y=e.property.has("border-left-width"),d=e.property.has("border-right-width"),f=e.dynamicProperty.has("border-width"),m=e.dynamicProperty.has("border-top-width"),g=e.dynamicProperty.has("border-bottom-width"),h=e.dynamicProperty.has("border-left-width"),E=e.dynamicProperty.has("border-right-width");(0,n.isEmptyOrUndefined)(i)&&(0,n.isEmptyOrUndefined)(s)&&(0,n.isEmptyOrUndefined)(p)&&(0,n.isEmptyOrUndefined)(l)?(0,n.isEmptyOrUndefined)(o)||t.properties.set((0,n.getEtsPropName)("border-width"),f?o:(0,n.quoteString)(o)):(a("top",null!=i?i:o,r,m||!c&&f),a("bottom",null!=s?s:o,r,g||!u&&f),a("left",null!=p?p:o,r,h||!y&&f),a("right",null!=l?l:o,r,E||!d&&f),r.size>0&&t.properties.set((0,n.getEtsPropName)("border-width"),r))}],[function(e){return e.hasProperty("border-color")||e.hasProperty("border-top-color")||e.hasProperty("border-right-color")||e.hasProperty("border-bottom-color")||e.hasProperty("border-left-color")},function(e,t){const r=new Map,o=e.getProperty("border-color"),a=e.getProperty("border-top-color"),s=e.getProperty("border-bottom-color"),p=e.getProperty("border-left-color"),l=e.getProperty("border-right-color"),c=e.dynamicProperty.has("border-color"),u=(0,n.getBorderDirections)("border-color");for(const t of u)i(e,"border-color",t,r,n.dealWithColor);(0,n.isEmptyOrUndefined)(a)&&(0,n.isEmptyOrUndefined)(s)&&(0,n.isEmptyOrUndefined)(p)&&(0,n.isEmptyOrUndefined)(l)?(0,n.isEmptyOrUndefined)(o)||t.properties.set((0,n.getEtsPropName)("border-color"),c?o:(0,n.dealWithColor)(o)):r.size>0&&t.properties.set((0,n.getEtsPropName)("border-color"),r)}],[function(e){return e.hasProperty("border-radius")||e.hasProperty("border-top-left-radius")||e.hasProperty("border-top-right-radius")||e.hasProperty("border-bottom-right-radius")||e.hasProperty("border-bottom-left-radius")},function(e,t){const r=new Map,o=e.getProperty("border-radius"),a=e.getProperty("border-top-left-radius"),s=e.getProperty("border-top-right-radius"),p=e.getProperty("border-bottom-left-radius"),l=e.getProperty("border-bottom-right-radius"),c=e.dynamicProperty.has("border-radius"),u=(0,n.getBorderDirections)("border-radius");for(const t of u)i(e,"border-radius",t,r,n.quoteString);(0,n.isEmptyOrUndefined)(a)&&(0,n.isEmptyOrUndefined)(s)&&(0,n.isEmptyOrUndefined)(p)&&(0,n.isEmptyOrUndefined)(l)?(0,n.isEmptyOrUndefined)(o)||t.properties.set((0,n.getEtsPropName)("border-radius"),c?o:(0,n.quoteString)(o)):r.size>0&&t.properties.set((0,n.getEtsPropName)("border-radius"),r)}],[(0,n.hasCommonProperty)("background-color"),(0,n.colorPropertyParser)("background-color")],[function(e){return e.hasProperty("background-image-src")||e.hasProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),a=e.property.get("background-image-repeat"),i=e.dynamicProperty.get("background-image-src"),s=e.dynamicProperty.get("background-image-repeat");if((0,n.isEmptyOrUndefined)(r)&&(0,n.isEmptyOrUndefined)(a)&&(0,n.isEmptyOrUndefined)(i)&&(0,n.isEmptyOrUndefined)(s))return;let p=(0,o.dealWithSrc)(null!=r?r:"");if((0,n.isEmptyOrUndefined)(i)||(p=i),(0,n.isEmptyOrUndefined)(s)){if(!(0,n.isEmptyOrUndefined)(a)){const e=(0,n.dealWithBackgroundRepeat)(a);null!=e&&""!==e&&(p=p+", "+e)}}else p=p+", "+s;t.properties.set("backgroundImage",p)}],[(0,n.hasCommonProperty)("background-image-size"),function(e,t){const r=e.dynamicProperty.get("background-image-size");if(!(0,n.isEmptyOrUndefined)(r))return void t.properties.set("backgroundImageSize",r);const o=e.property.get("background-image-size");if((0,n.isEmptyOrUndefined)(o))return;if(""!==(0,n.getBackgroundImageSizeEnumValue)(o))return void t.properties.set("backgroundImageSize",(0,n.getEtsEnumValue)("ImageSize.",o));const a=o.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);null!==a&&(void 0!==a[5]?t.properties.set("backgroundImageSize",new Map([["width",`${(0,n.quoteString)(a[1])}`],["height",`${(0,n.quoteString)(a[5])}`]])):t.properties.set("backgroundImageSize",new Map([["width",`${(0,n.quoteString)(a[1])}`]])))}],[(0,n.hasCommonProperty)("background-image-position"),function(e,t){const r=e.dynamicProperty.get("background-image-position");if(!(0,n.isEmptyOrUndefined)(r))return void t.properties.set("backgroundImagePosition",r);const o=e.property.get("background-image-position");if((0,n.isEmptyOrUndefined)(o))return;const a=(0,n.getBackgroundImagePositionEnumValue)(o);if(""!==a)return void t.properties.set("backgroundImagePosition",a);const i=o.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);null!==i&&t.properties.set("backgroundImagePosition",new Map([["x",`${(0,n.quoteString)(i[1])}`],["y",`${(0,n.quoteString)(i[4])}`]]))}],[(0,n.hasCommonProperty)("opacity"),(0,n.numberPropertyParser)("opacity")],[(0,n.hasCommonProperty)("visibility"),(0,n.enumPropertyParser)("visibility","Visibility.")],[(0,n.hasCommonProperty)("enabled"),(0,n.booleanPropertyParser)("enabled")],[(0,n.hasCommonProperty)("font-color"),(0,n.colorPropertyParser)("font-color")],[function(e){return e.hasProperty("margin")||e.hasProperty("margin-left")||e.hasProperty("margin-top")||e.hasProperty("margin-right")||e.hasProperty("margin-bottom")},function(e,t){var r,n,o,i;const s=new Map,p=e.getProperty("margin"),l=null!==(r=e.getProperty("margin-top"))&&void 0!==r?r:p,c=null!==(n=e.getProperty("margin-bottom"))&&void 0!==n?n:p,u=null!==(o=e.getProperty("margin-left"))&&void 0!==o?o:p,y=null!==(i=e.getProperty("margin-right"))&&void 0!==i?i:p,d=e.property.has("margin-top"),f=e.property.has("margin-bottom"),m=e.property.has("margin-left"),g=e.property.has("margin-right"),h=e.dynamicProperty.has("margin"),E=e.dynamicProperty.has("margin-top"),T=e.dynamicProperty.has("margin-bottom"),P=e.dynamicProperty.has("margin-left"),v=e.dynamicProperty.has("margin-right");a("top",l,s,E||!d&&h),a("bottom",c,s,T||!f&&h),a("left",u,s,P||!m&&h),a("right",y,s,v||!g&&h),s.size>0&&t.properties.set("margin",s)}],[function(e){return e.hasProperty("padding")||e.hasProperty("padding-left")||e.hasProperty("padding-top")||e.hasProperty("padding-right")||e.hasProperty("padding-bottom")},function(e,t){var r,n,o,i;const s=new Map,p=e.getProperty("padding"),l=null!==(r=e.getProperty("padding-top"))&&void 0!==r?r:p,c=null!==(n=e.getProperty("padding-bottom"))&&void 0!==n?n:p,u=null!==(o=e.getProperty("padding-left"))&&void 0!==o?o:p,y=null!==(i=e.getProperty("padding-right"))&&void 0!==i?i:p,d=e.property.has("padding-top"),f=e.property.has("padding-bottom"),m=e.property.has("padding-left"),g=e.property.has("padding-right"),h=e.dynamicProperty.has("padding"),E=e.dynamicProperty.has("padding-top"),T=e.dynamicProperty.has("padding-bottom"),P=e.dynamicProperty.has("padding-left"),v=e.dynamicProperty.has("padding-right");a("top",l,s,E||!d&&h),a("bottom",c,s,T||!f&&h),a("left",u,s,P||!m&&h),a("right",y,s,v||!g&&h),s.size>0&&t.properties.set("padding",s)}]]},1778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dividerParserArray=void 0;const n=r(8122);t.dividerParserArray=[[(0,n.hasFeatureProperty)("divider","vertical"),(0,n.booleanPropertyParser)("vertical")],[(0,n.hasFeatureProperty)("divider","color"),(0,n.colorPropertyParser)("color")],[(0,n.hasFeatureProperty)("divider","stroke-width"),(0,n.stringPropertyParser)("stroke-width")],[(0,n.hasFeatureProperty)("divider","line-cap"),(0,n.enumPropertyParser)("line-cap","LineCapStyle.")]]},5264:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithFlexAlignItems=t.flexParserArray=void 0;const n=r(8122),o=(0,n.curry)(((e,t,r,o)=>{if(!(o.params instanceof Map))return;const a=r.dynamicProperty.get(e);if(!(0,n.isEmptyOrUndefined)(a))return void o.params.set((0,n.getEtsPropName)(e),a);const i=r.property.get(e);if((0,n.isEmptyOrUndefined)(i))return;let s=(0,n.getEtsEnumValue)(t,i);"flex-start"===i?s=t+"Start":"flex-end"===i&&(s=t+"End"),o.params.set((0,n.getEtsPropName)(e),s)}));function a(e){let t=(0,n.getEtsEnumValue)("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}t.flexParserArray=[[(0,n.hasFeatureProperty)("flex","flex-direction"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("flex-direction");if(!(0,n.isEmptyOrUndefined)(r))return void t.params.set("direction",r);const o=e.property.get("flex-direction");(0,n.isEmptyOrUndefined)(o)||t.params.set("direction",(0,n.getEtsEnumValue)("FlexDirection.",o))}],[(0,n.hasFeatureProperty)("flex","wrap"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("wrap");if(!(0,n.isEmptyOrUndefined)(r))return void t.params.set("wrap",r);const o=e.property.get("wrap");if((0,n.isEmptyOrUndefined)(o))return;const a=(0,n.dealWithWrap)(o);t.params.set("wrap",a)}],[(0,n.hasFeatureProperty)("flex","justify-content"),o("justify-content","FlexAlign.")],[(0,n.hasFeatureProperty)("flex","align-items-flex"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-items-flex");if(!(0,n.isEmptyOrUndefined)(r))return void t.params.set("alignItems",r);const o=e.property.get("align-items-flex");if((0,n.isEmptyOrUndefined)(o))return;const i=a(o);t.params.set("alignItems",i)}],[(0,n.hasFeatureProperty)("flex","align-content"),o("align-content","FlexAlign.")]],t.dealWithFlexAlignItems=a},2153:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridItemParserArray=t.gridParserArray=void 0;const n=r(8122);t.gridParserArray=[[(0,n.hasFeatureProperty)("grid","scroller"),n.scrollerParamParser],[(0,n.hasFeatureProperty)("grid","columns-template"),(0,n.stringPropertyParser)("columns-template")],[(0,n.hasFeatureProperty)("grid","rows-template"),(0,n.stringPropertyParser)("rows-template")],[(0,n.hasFeatureProperty)("grid","columns-gap"),(0,n.stringPropertyParser)("columns-gap")],[(0,n.hasFeatureProperty)("grid","rows-gap"),(0,n.stringPropertyParser)("rows-gap")],[(0,n.hasFeatureProperty)("grid","scroll-bar"),(0,n.enumPropertyParser)("scroll-bar","BarState.")],[(0,n.hasFeatureProperty)("grid","scroll-bar-color"),(0,n.colorPropertyParser)("scroll-bar-color")],[(0,n.hasFeatureProperty)("grid","scroll-bar-width"),(0,n.stringPropertyParser)("scroll-bar-width")],[(0,n.hasFeatureProperty)("grid","cached-count"),(0,n.numberPropertyParser)("cached-count")],[(0,n.hasFeatureProperty)("grid","edit-mode"),(0,n.booleanPropertyParser)("edit-mode")],[(0,n.hasFeatureProperty)("grid","layout-direction"),(0,n.enumPropertyParser)("layout-direction","GridDirection.")],[(0,n.hasFeatureProperty)("grid","max-count"),(0,n.numberPropertyParser)("max-count")],[(0,n.hasFeatureProperty)("grid","min-count"),(0,n.numberPropertyParser)("min-count")],[(0,n.hasFeatureProperty)("grid","cell-length"),(0,n.numberPropertyParser)("cell-length")],[(0,n.hasFeatureProperty)("grid","multi-selectable"),(0,n.booleanPropertyParser)("multi-selectable")],[(0,n.hasFeatureProperty)("grid","support-animation"),(0,n.booleanPropertyParser)("support-animation")]],t.gridItemParserArray=[[(0,n.hasFeatureProperty)("grid-item","row-start"),(0,n.numberPropertyParser)("row-start")],[(0,n.hasFeatureProperty)("grid-item","row-end"),(0,n.numberPropertyParser)("row-end")],[(0,n.hasFeatureProperty)("grid-item","column-start"),(0,n.numberPropertyParser)("column-start")],[(0,n.hasFeatureProperty)("grid-item","column-end"),(0,n.numberPropertyParser)("column-end")],[(0,n.hasFeatureProperty)("grid-item","force-rebuild"),(0,n.booleanPropertyParser)("force-rebuild")],[(0,n.hasFeatureProperty)("grid-item","selectable"),(0,n.booleanPropertyParser)("selectable")]]},9248:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithSrc=t.imageParserArray=t.isTargetComponent=void 0;const n=r(8122);function o(e){return null===e.match(/\$(r|rawfile)\('(.*)'\)$/)?(0,n.quoteString)(e):e}t.isTargetComponent=(0,n.curry)(((e,t)=>t.type===e)),t.imageParserArray=[[(0,t.isTargetComponent)("image"),function(e,t){var r;const a=e.dynamicProperty.get("src");if(!(0,n.isEmptyOrUndefined)(a))return void t.setParams(a);const i=null!==(r=e.property.get("src"))&&void 0!==r?r:"";t.setParams(o(i))}],[(0,n.hasFeatureProperty)("image","alt"),(0,n.stringPropertyParser)("alt")],[(0,n.hasFeatureProperty)("image","object-fit"),(0,n.enumPropertyParser)("object-fit","ImageFit.")],[(0,n.hasFeatureProperty)("image","object-repeat"),(0,n.enumPropertyParser)("object-repeat","ImageRepeat.")],[(0,n.hasFeatureProperty)("image","interpolation"),(0,n.enumPropertyParser)("interpolation","ImageInterpolation.")],[(0,n.hasFeatureProperty)("image","render-mode"),(0,n.enumPropertyParser)("render-mode","ImageRenderMode.")],[function(e){return e.hasProperty("source-size-width")||e.hasProperty("source-size-height")},function(e,t){let r=e.getProperty("source-size-width"),o=e.getProperty("source-size-height");if((0,n.isEmptyOrUndefined)(r)&&(0,n.isEmptyOrUndefined)(o))return;const a=e.dynamicProperty.has("source-size-width"),i=e.dynamicProperty.has("source-size-height");r="0"===r||(0,n.isEmptyOrUndefined)(r)?"0":a?r:r.substring(0,r.length-2),o="0"===o||(0,n.isEmptyOrUndefined)(o)?"0":i?o:o.substring(0,o.length-2);const s=new Map([["width",r],["height",o]]);t.properties.set("sourceSize",s)}]],t.dealWithSrc=o},7907:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemParserArray=t.listParserArray=void 0;const n=r(8122);t.listParserArray=[[(0,n.hasFeatureProperty)("list","space"),(0,n.stringParamParser)("space")],[(0,n.hasFeatureProperty)("list","initial-index"),(0,n.rawDataParamParser)("initial-index")],[(0,n.hasFeatureProperty)("list","list-direction"),(0,n.enumPropertyParser)("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasProperty("divider-stroke-width")||e.hasProperty("divider-color")||e.hasProperty("divider-start-margin")||e.hasProperty("divider-end-margin"))},function(e,t){const r=e.property.get("divider-stroke-width"),o=e.dynamicProperty.get("divider-stroke-width"),a=new Map([["strokeWidth",`${(0,n.quoteString)(null!=r?r:"0")}`]]);(0,n.isEmptyOrUndefined)(o)||a.set("strokeWidth",o);const i=e.property.get("divider-color"),s=e.dynamicProperty.get("divider-color"),p=e.property.get("divider-start-margin"),l=e.dynamicProperty.get("divider-start-margin"),c=e.property.get("divider-end-margin"),u=e.dynamicProperty.get("divider-end-margin");(0,n.isEmptyOrUndefined)(s)?(0,n.isEmptyOrUndefined)(i)||a.set("color",(0,n.dealWithColor)(i)):a.set("color",s),(0,n.isEmptyOrUndefined)(l)?(0,n.isEmptyOrUndefined)(p)||a.set("startMargin",(0,n.quoteString)(p)):a.set("startMargin",l),(0,n.isEmptyOrUndefined)(u)?(0,n.isEmptyOrUndefined)(c)||a.set("endMargin",(0,n.quoteString)(c)):a.set("endMargin",u),t.properties.set("divider",a)}],[(0,n.hasFeatureProperty)("list","edit-mode"),(0,n.booleanPropertyParser)("edit-mode")],[(0,n.hasFeatureProperty)("list","edge-effect"),(0,n.enumPropertyParser)("edge-effect","EdgeEffect.")],[(0,n.hasFeatureProperty)("list","chain-animation"),(0,n.booleanPropertyParser)("chain-animation")]],t.listItemParserArray=[[(0,n.hasFeatureProperty)("list-item","sticky"),(0,n.enumPropertyParser)("sticky","Sticky.")],[(0,n.hasFeatureProperty)("list-item","editable"),(0,n.booleanPropertyParser)("editable")]]},8191:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.navigationParserArray=void 0;const n=r(8122);t.navigationParserArray=[[(0,n.hasFeatureProperty)("navigation","navigation-title"),function(e,t){const r=e.getProperty("navigation-title"),o=e.dynamicProperty.get("navigation-title");(0,n.isEmptyOrUndefined)(o)?(0,n.isEmptyOrUndefined)(r)||t.properties.set("title",(0,n.quoteString)(r)):t.properties.set("title",o)}],[(0,n.hasFeatureProperty)("navigation","subTitle"),(0,n.stringPropertyParser)("subTitle")],[(0,n.hasFeatureProperty)("navigation","menus"),(0,n.objectPropertyParser)("menus")],[(0,n.hasFeatureProperty)("navigation","titleMode"),(0,n.enumPropertyParser)("titleMode","NavigationTitleMode.")],[(0,n.hasFeatureProperty)("navigation","toolBar"),(0,n.objectPropertyParser)("toolBar")],[(0,n.hasFeatureProperty)("navigation","hideToolBar"),(0,n.booleanPropertyParser)("hideToolBar")],[(0,n.hasFeatureProperty)("navigation","hideTitleBar"),(0,n.booleanPropertyParser)("hideTitleBar")],[(0,n.hasFeatureProperty)("navigation","hideBackButton"),(0,n.booleanPropertyParser)("hideBackButton")]]},2565:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textPickerParserArray=t.datePickerParserArray=t.timePickerParserArray=void 0;const n=r(8122);t.timePickerParserArray=[[(0,n.hasFeatureProperty)("timePicker","datetime-selected"),(0,n.dateParamParser)("datetime-selected","selected")],[(0,n.hasFeatureProperty)("timePicker","useMilitaryTime"),(0,n.booleanPropertyParser)("useMilitaryTime")]],t.datePickerParserArray=[[(0,n.hasFeatureProperty)("datePicker","datetime-selected"),(0,n.dateParamParser)("datetime-selected","selected")],[(0,n.hasFeatureProperty)("datePicker","start"),(0,n.dateParamParser)("start","start")],[(0,n.hasFeatureProperty)("datePicker","end"),(0,n.dateParamParser)("end","end")],[(0,n.hasFeatureProperty)("datePicker","lunar"),(0,n.booleanPropertyParser)("lunar")]],t.textPickerParserArray=[[(0,n.hasFeatureProperty)("textPicker","range"),(0,n.arrayParamParser)("range")],[(0,n.hasFeatureProperty)("textPicker","textPicker-selected"),(0,n.customRawDataParamParser)("textPicker-selected","selected")],[(0,n.hasFeatureProperty)("textPicker","defaultPickerItemHeight"),(0,n.stringPropertyParser)("defaultPickerItemHeight")]]},8483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.progressParserArray=void 0;const n=r(8122);t.progressParserArray=[[function(e){return"progress"===e.type&&(e.hasProperty("value")||e.hasProperty("total")||e.hasProperty("style"))},function(e,t){var r;(0,n.dynamicParamParser)("value",e,t)||t.params instanceof Map&&t.params.set("value",null!==(r=e.getProperty("value"))&&void 0!==r?r:"0")}],[(0,n.hasFeatureProperty)("progress","total"),(0,n.rawDataParamParser)("total")],[(0,n.hasFeatureProperty)("progress","style"),(0,n.enumParamParser)("style","ProgressStyle.")],[(0,n.hasFeatureProperty)("progress","color"),(0,n.colorPropertyParser)("color")]]},4925:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshParserArray=void 0;const n=r(8122);t.refreshParserArray=[[(0,n.hasFeatureProperty)("refresh","friction"),(0,n.rawDataParamParser)("friction")],[(0,n.hasFeatureProperty)("refresh","offset"),(0,n.stringParamParser)("offset")],[(0,n.hasFeatureProperty)("refresh","refreshing"),(0,n.booleanParamParser)("refreshing")]]},1790:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithRowAlignItems=t.dealWithColumnAlignItems=t.rowParserArray=t.columnParserArray=void 0;const n=r(8122),o=(0,n.curry)(((e,t,r,o)=>{if(!(o.properties instanceof Map))return;const a=r.dynamicProperty.get(e);if(!(0,n.isEmptyOrUndefined)(a))return void o.properties.set("justifyContent",a);const i=r.property.get(e);if((0,n.isEmptyOrUndefined)(i))return;let s=(0,n.getEtsEnumValue)(t,i);"flex-start"===i?s=t+"Start":"flex-end"===i&&(s=t+"End"),o.properties.set("justifyContent",s)}));function a(e){let t=(0,n.getEtsEnumValue)("HorizontalAlign.",e);return"flex-start"===e?t="HorizontalAlign.Start":"flex-end"===e&&(t="HorizontalAlign.End"),t}function i(e){let t=(0,n.getEtsEnumValue)("VerticalAlign.",e);return"flex-start"===e?t="VerticalAlign.Top":"flex-end"===e&&(t="VerticalAlign.Bottom"),t}t.columnParserArray=[[(0,n.hasFeatureProperty)("column","space"),(0,n.stringParamParser)("space")],[(0,n.hasFeatureProperty)("column","align-items-column"),function(e,t){const r=e.dynamicProperty.get("align-items-column");if(!(0,n.isEmptyOrUndefined)(r))return void t.properties.set("alignItems",r);const o=e.property.get("align-items-column");if((0,n.isEmptyOrUndefined)(o))return;const i=a(o);t.properties.set("alignItems",i)}],[(0,n.hasFeatureProperty)("column","justify-content-rc"),o("justify-content-rc","FlexAlign.")]],t.rowParserArray=[[(0,n.hasFeatureProperty)("row","space"),(0,n.stringParamParser)("space")],[(0,n.hasFeatureProperty)("row","align-items-row"),function(e,t){const r=e.dynamicProperty.get("align-items-row");if(!(0,n.isEmptyOrUndefined)(r))return void t.properties.set("alignItems",r);const o=e.property.get("align-items-row");if((0,n.isEmptyOrUndefined)(o))return;const a=i(o);t.properties.set("alignItems",a)}],[(0,n.hasFeatureProperty)("row","justify-content-rc"),o("justify-content-rc","FlexAlign.")]],t.dealWithColumnAlignItems=a,t.dealWithRowAlignItems=i},7375:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollParserArray=void 0;const n=r(8122);t.scrollParserArray=[[(0,n.hasFeatureProperty)("scroll","scrollable"),(0,n.enumPropertyParser)("scrollable","ScrollDirection.")],[(0,n.hasFeatureProperty)("scroll","scroll-bar"),(0,n.enumPropertyParser)("scroll-bar","BarState.")],[(0,n.hasFeatureProperty)("scroll","scroll-bar-color"),(0,n.colorPropertyParser)("scroll-bar-color")],[(0,n.hasFeatureProperty)("scroll","scroll-bar-width"),(0,n.stringPropertyParser)("scroll-bar-width")],[(0,n.hasFeatureProperty)("scroll","edge-effect-scroll"),function(e,t){const r="edge-effect-scroll";if((0,n.dynamicPropertyParser)(r,e,t))return;const o=e.property.get(r);(0,n.isEmptyOrUndefined)(o)||t.properties.set("edgeEffect",(0,n.getEtsEnumValue)("EdgeEffect.",o))}],[(0,n.hasFeatureProperty)("scroll","scroller"),n.scrollerParamParser]]},9284:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchParserArray=void 0;const n=r(8122),o=r(8014);function a(e,t,r,o){const a=new Map([["value","search-value"],["placeholder","placeholder"],["icon","icon"]]).get(e);if(void 0===a)return;const i=r.getProperty(a),s=r.dynamicProperty.get(a);(0,n.isEmptyOrUndefined)(s)?(0,n.isEmptyOrUndefined)(i)||t.push(`${e}: ${(0,n.quoteString)(i)}`):t.push(`${e}: ${(0,n.getContentName)(s)}`)}t.searchParserArray=[[(0,n.hasFeatureProperty)("search","text-font-size"),(0,o.selectFontParser)("text-font","size")],[(0,n.hasFeatureProperty)("search","text-font-style"),(0,o.selectFontParser)("text-font","style")],[(0,n.hasFeatureProperty)("search","text-font-weight"),(0,o.selectFontParser)("text-font","weight")],[(0,n.hasFeatureProperty)("search","text-font-family"),(0,o.selectFontParser)("text-font","family")],[(0,n.hasFeatureProperty)("search","placeholder-font-size"),(0,o.selectFontParser)("placeholder-font","size")],[(0,n.hasFeatureProperty)("search","placeholder-font-style"),(0,o.selectFontParser)("placeholder-font","style")],[(0,n.hasFeatureProperty)("search","placeholder-font-weight"),(0,o.selectFontParser)("placeholder-font","weight")],[(0,n.hasFeatureProperty)("search","placeholder-font-family"),(0,o.selectFontParser)("placeholder-font","family")],[(0,n.hasFeatureProperty)("search","placeholderColor"),(0,n.colorPropertyParser)("placeholderColor")],[(0,n.hasFeatureProperty)("search","text-align"),(0,n.enumPropertyParser)("text-align","TextAlign.")],[function(e){return"search"===e.type},function(e,t){const r=[];a("value",r,e),a("placeholder",r,e),a("icon",r,e),t.setParams(`{${r.join(", ")}}`)}],[(0,n.hasFeatureProperty)("search","search-button"),(0,n.stringPropertyParser)("search-button")],[(0,n.hasFeatureProperty)("search","copy-option"),(0,n.enumPropertyParser)("copy-option","CopyOptions.")]]},8014:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectParserArray=t.selectFontParser=void 0;const n=r(8122);t.selectFontParser=(0,n.curry)(((e,t,r,o)=>{let a=o.properties.get((0,n.getEtsPropName)(e));void 0===a&&(a=new Map);const i=`${e}-${t}`,s=r.property.get(i),p=r.dynamicProperty.get(i);"string"!=typeof a&&((0,n.isEmptyOrUndefined)(p)?(0,n.isEmptyOrUndefined)(s)||("size"!==t&&"family"!==t||a.set(t,(0,n.quoteString)(s)),"style"===t&&a.set(t,(0,n.getEtsEnumValue)("FontStyle.",s)),"weight"===t&&a.set(t,(0,n.dealWithFontWeight)(s))):a.set(t,p)),o.properties.set((0,n.getEtsPropName)(e),a)})),t.selectParserArray=[[(0,n.hasSelectOption)("select","select-option"),function(e,t){const r=e.dynamicProperty.get("select-option");t.setParams(null!=r?r:'[{value: ""}]')}],[(0,n.hasFeatureProperty)("select","select-value"),function(e,t){const r=e.getProperty("select-value"),o=e.dynamicProperty.get("select-value");(0,n.isEmptyOrUndefined)(o)?(0,n.isEmptyOrUndefined)(r)||t.properties.set("value",(0,n.quoteString)(r)):t.properties.set("value",(0,n.getContentName)(o))}],[(0,n.hasFeatureProperty)("select","selected"),(0,n.numberPropertyParser)("selected")],[(0,n.hasFeatureProperty)("select","font-size"),(0,t.selectFontParser)("font","size")],[(0,n.hasFeatureProperty)("select","font-style"),(0,t.selectFontParser)("font","style")],[(0,n.hasFeatureProperty)("select","font-weight"),(0,t.selectFontParser)("font","weight")],[(0,n.hasFeatureProperty)("select","font-family"),(0,t.selectFontParser)("font","family")],[(0,n.hasFeatureProperty)("select","selected-option-font-size"),(0,t.selectFontParser)("selected-option-font","size")],[(0,n.hasFeatureProperty)("select","selected-option-font-style"),(0,t.selectFontParser)("selected-option-font","style")],[(0,n.hasFeatureProperty)("select","selected-option-font-weight"),(0,t.selectFontParser)("selected-option-font","weight")],[(0,n.hasFeatureProperty)("select","selected-option-font-family"),(0,t.selectFontParser)("selected-option-font","family")],[(0,n.hasFeatureProperty)("select","selected-option-font-color"),(0,n.colorPropertyParser)("selected-option-font-color")],[(0,n.hasFeatureProperty)("select","selected-option-bg-color"),(0,n.colorPropertyParser)("selected-option-bg-color")],[(0,n.hasFeatureProperty)("select","option-font-size"),(0,t.selectFontParser)("option-font","size")],[(0,n.hasFeatureProperty)("select","option-font-style"),(0,t.selectFontParser)("option-font","style")],[(0,n.hasFeatureProperty)("select","option-font-weight"),(0,t.selectFontParser)("option-font","weight")],[(0,n.hasFeatureProperty)("select","option-font-family"),(0,t.selectFontParser)("option-font","family")],[(0,n.hasFeatureProperty)("select","option-font-color"),(0,n.colorPropertyParser)("option-font-color")],[(0,n.hasFeatureProperty)("select","option-bg-color"),(0,n.colorPropertyParser)("option-bg-color")]]},2563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sliderParserArray=void 0;const n=r(8122);t.sliderParserArray=[[(0,n.hasFeatureProperty)("slider","value"),(0,n.rawDataParamParser)("value")],[(0,n.hasFeatureProperty)("slider","min"),(0,n.rawDataParamParser)("min")],[(0,n.hasFeatureProperty)("slider","max"),(0,n.rawDataParamParser)("max")],[(0,n.hasFeatureProperty)("slider","step"),(0,n.rawDataParamParser)("step")],[(0,n.hasFeatureProperty)("slider","style"),(0,n.enumParamParser)("style","SliderStyle.")],[(0,n.hasFeatureProperty)("slider","block-color"),(0,n.colorPropertyParser)("block-color")],[(0,n.hasFeatureProperty)("slider","track-color"),(0,n.colorPropertyParser)("track-color")],[(0,n.hasFeatureProperty)("slider","selected-color"),(0,n.colorPropertyParser)("selected-color")],[(0,n.hasFeatureProperty)("slider","show-steps"),(0,n.booleanPropertyParser)("show-steps")],[(0,n.hasFeatureProperty)("slider","show-tips"),(0,n.booleanPropertyParser)("show-tips")]]},8936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackParserArray=void 0;const n=r(8122);t.stackParserArray=[[(0,n.hasFeatureProperty)("stack","align-content-stack"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-content-stack");if(!(0,n.isEmptyOrUndefined)(r))return void t.params.set("alignContent",r);const o=e.property.get("align-content-stack");if((0,n.isEmptyOrUndefined)(o))return;const a=(0,n.getEtsEnumValue)("Alignment.",o);t.params.set((0,n.getEtsPropName)("alignContent"),a)}]]},780:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.swiperParserArray=void 0;const n=r(8122);t.swiperParserArray=[[(0,n.hasFeatureProperty)("swiper","index"),(0,n.numberPropertyParser)("index")],[(0,n.hasFeatureProperty)("swiper","auto-play"),(0,n.booleanPropertyParser)("auto-play")],[(0,n.hasFeatureProperty)("swiper","interval"),(0,n.numberPropertyParser)("interval")],[(0,n.hasFeatureProperty)("swiper","indicator"),(0,n.booleanPropertyParser)("indicator")],[(0,n.hasFeatureProperty)("swiper","loop"),(0,n.booleanPropertyParser)("loop")],[(0,n.hasFeatureProperty)("swiper","duration"),(0,n.numberPropertyParser)("duration")],[(0,n.hasFeatureProperty)("swiper","vertical"),(0,n.booleanPropertyParser)("vertical")],[(0,n.hasFeatureProperty)("swiper","item-space"),(0,n.stringPropertyParser)("item-space")],[(0,n.hasFeatureProperty)("swiper","cached-count"),(0,n.numberPropertyParser)("cached-count")],[(0,n.hasFeatureProperty)("swiper","disable-swipe"),(0,n.booleanPropertyParser)("disable-swipe")]]},7036:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabContentParserArray=void 0;const n=r(8122),o=r(9248);t.tabContentParserArray=[[function(e){return"tab-content"===e.type&&(e.hasProperty("tabBar-icon")||e.hasProperty("tabBar-text"))},function(e,t){var r,a;const i=new Map,s=null!==(r=e.getProperty("tabBar-icon"))&&void 0!==r?r:"",p=null!==(a=e.getProperty("tabBar-text"))&&void 0!==a?a:"TabBar",l=e.dynamicProperty.has("tabBar-text"),c=e.dynamicProperty.has("tabBar-icon");(0,n.isEmptyOrUndefined)(s)||i.set("icon",c?s:(0,o.dealWithSrc)(s)),void 0!==p&&i.set("text",l?p:(0,n.quoteString)(p)),i.size>0&&t.properties.set("tabBar",i)}]]},2973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabsParserArray=void 0;const n=r(8122);t.tabsParserArray=[[(0,n.hasFeatureProperty)("tabs","bar-position"),(0,n.enumParamParser)("bar-position","BarPosition.")],[(0,n.hasFeatureProperty)("tabs","index"),(0,n.rawDataParamParser)("index")],[(0,n.hasFeatureProperty)("tabs","controller"),(0,n.rawDataParamParser)("controller")],[(0,n.hasFeatureProperty)("tabs","vertical"),(0,n.booleanPropertyParser)("vertical")],[(0,n.hasFeatureProperty)("tabs","scrollable"),(0,n.booleanPropertyParser)("scrollable")],[(0,n.hasFeatureProperty)("tabs","bar-mode"),(0,n.enumPropertyParser)("bar-mode","BarMode.")],[(0,n.hasFeatureProperty)("tabs","bar-width"),(0,n.stringPropertyParser)("bar-width")],[(0,n.hasFeatureProperty)("tabs","bar-height"),(0,n.stringPropertyParser)("bar-height")],[(0,n.hasFeatureProperty)("tabs","animation-duration"),(0,n.numberPropertyParser)("animation-duration")]]},1162:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textInputParserArray=void 0;const n=r(8122);t.textInputParserArray=[[(0,n.hasFeatureProperty)("text-input","placeholder"),(0,n.stringParamParser)("placeholder")],[(0,n.hasFeatureProperty)("text-input","textInput-type"),function(e,t){const r=e.dynamicProperty.get("textInput-type");if(!(0,n.isEmptyOrUndefined)(r))return void t.properties.set("type",r);const o=e.property.get("textInput-type");(0,n.isEmptyOrUndefined)(o)||t.properties.set("type","InputType."+o)}],[(0,n.hasFeatureProperty)("text-input","placeholderColor"),(0,n.colorPropertyParser)("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasProperty("placeholderFont-size")||e.hasProperty("placeholderFont-weight")||e.hasProperty("placeholderFont-family")||e.hasProperty("placeholderFont-style"))},function(e,t){const r=e.property.get("placeholderFont-size"),o=e.dynamicProperty.get("placeholderFont-size"),a=e.property.get("placeholderFont-weight"),i=e.dynamicProperty.get("placeholderFont-weight"),s=e.property.get("placeholderFont-family"),p=e.dynamicProperty.get("placeholderFont-family"),l=e.property.get("placeholderFont-style"),c=e.dynamicProperty.get("placeholderFont-style"),u=new Map;(0,n.isEmptyOrUndefined)(o)?(0,n.isEmptyOrUndefined)(r)||u.set("size",parseInt(r)):u.set("size",o),(0,n.isEmptyOrUndefined)(i)?(0,n.isEmptyOrUndefined)(a)||u.set("weight",isNaN(Number(a))?(0,n.getEtsEnumValue)("FontWeight.",a):a):u.set("weight",i),(0,n.isEmptyOrUndefined)(p)?(0,n.isEmptyOrUndefined)(s)||u.set("family",(0,n.quoteString)(s)):u.set("family",p),(0,n.isEmptyOrUndefined)(c)?(0,n.isEmptyOrUndefined)(l)||u.set("style",(0,n.getEtsEnumValue)("FontStyle.",l)):u.set("style",c),t.properties.set("placeholderFont",u)}],[(0,n.hasFeatureProperty)("text-input","enterKeyType"),(0,n.enumPropertyParser)("enterKeyType","EnterKeyType.")],[(0,n.hasFeatureProperty)("text-input","caretColor"),(0,n.colorPropertyParser)("caretColor")],[(0,n.hasFeatureProperty)("text-input","maxLength"),(0,n.numberPropertyParser)("maxLength")]]},8681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textParserArray=void 0;const n=r(8122);t.textParserArray=[[(0,n.hasFeatureProperty)("text","content"),n.contentParamParser],[(0,n.hasFeatureProperty)("text","text-align"),(0,n.enumPropertyParser)("text-align","TextAlign.")],[(0,n.hasFeatureProperty)("text","text-overflow"),function(e,t){const r=e.dynamicProperty.get("text-overflow");if(!(0,n.isEmptyOrUndefined)(r))return void t.properties.set("textOverflow",new Map([["overflow",r]]));const o=e.property.get("text-overflow");(0,n.isEmptyOrUndefined)(o)||t.properties.set("textOverflow",new Map([["overflow","TextOverflow."+(0,n.firstUpperCase)(o)]]))}],[(0,n.hasFeatureProperty)("text","max-lines"),(0,n.numberPropertyParser)("max-lines")],[(0,n.hasFeatureProperty)("text","line-height"),(0,n.stringPropertyParser)("line-height")],[function(e){return"text"===e.type&&(e.hasProperty("decoration-type")||e.hasProperty("decoration-color"))},function(e,t){const r=e.property.get("decoration-type"),o=e.dynamicProperty.get("decoration-type"),a=e.property.get("decoration-color"),i=e.dynamicProperty.get("decoration-color");if((0,n.isEmptyOrUndefined)(r)&&(0,n.isEmptyOrUndefined)(a)&&(0,n.isEmptyOrUndefined)(o)&&(0,n.isEmptyOrUndefined)(i))return;const s=new Map;(0,n.isEmptyOrUndefined)(o)?s.set("type",(0,n.isEmptyOrUndefined)(r)?"TextDecorationType.None":(0,n.getEtsEnumValue)("TextDecorationType.",r)):s.set("type",o),t.properties.set("decoration",s),(0,n.isEmptyOrUndefined)(i)?(0,n.isEmptyOrUndefined)(a)||s.set("color",(0,n.dealWithColor)(a)):s.set("color",i)}],[(0,n.hasFeatureProperty)("text","baseline-offset"),(0,n.stringPropertyParser)("baseline-offset")],[(0,n.hasFeatureProperty)("text","text-case"),(0,n.enumPropertyParser)("text-case","TextCase.")],[(0,n.hasFeatureProperty)("text","font-size"),(0,n.stringPropertyParser)("font-size")],[(0,n.hasFeatureProperty)("text","font-style"),(0,n.enumPropertyParser)("font-style","FontStyle.")],[(0,n.hasFeatureProperty)("text","font-weight"),n.fontWeightPropertyParser],[(0,n.hasFeatureProperty)("text","font-family"),(0,n.stringPropertyParser)("font-family")]]},4313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleParseArray=void 0;const n=r(8122);t.toggleParseArray=[[(0,n.hasFeatureProperty)("toggle","toggle-type"),function(e,t){const r="toggle-type";if((0,n.customDynamicParamParser)(r,"type",e,t))return;const o=e.property.get(r);!(0,n.isEmptyOrUndefined)(o)&&t.params instanceof Map&&t.params.set("type",(0,n.getEtsEnumValue)("ToggleType.",o))}],[(0,n.hasFeatureProperty)("toggle","isOn"),(0,n.booleanParamParser)("isOn")],[(0,n.hasFeatureProperty)("toggle","selectedColor"),(0,n.colorPropertyParser)("selectedColor")],[(0,n.hasFeatureProperty)("toggle","switchPointColor"),(0,n.colorPropertyParser)("switchPointColor")]]},8122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEdgeBorderDirection=t.getBorderDirections=t.dealWithAlignSelf=t.dealWithScrollEdgeEffect=t.dealWithBackgroundRepeat=t.dealWithBackgroundImageSize=t.dealWithBackgroundImagePosition=t.dealWithFontWeight=t.getContentName=t.scrollerParamParser=t.dealWithWrap=t.getBackgroundImageSizeEnumValue=t.getBackgroundImagePositionEnumValue=t.contentParamParser=t.labelParamParser=t.fontWeightPropertyParser=t.dealWithColor=t.getEtsEnumValue=t.getEtsPropName=t.parseTagName=t.firstUpperCase=t.getForEachObj=t.colorPropertyParser=t.enumParamParser=t.arrayParamParser=t.booleanParamParser=t.customRawDataParamParser=t.rawDataParamParser=t.dateParamParser=t.stringParamParser=t.dynamicParamParser=t.enumPropertyParser=t.booleanPropertyParser=t.numberPropertyParser=t.isEmptyOrUndefined=t.objectPropertyParser=t.stringPropertyParser=t.customDynamicParamParser=t.dynamicPropertyParser=t.quoteString=t.hasSelectOption=t.hasFeatureProperty=t.hasCommonProperty=t.curry=void 0;const n=r(1195),o=r(4294);function a(e){return(...t)=>t.lengtht.property.has(e)||t.dynamicProperty.has(e))),t.hasFeatureProperty=a(((e,t,r)=>r.type===e&&(r.property.has(t)||r.dynamicProperty.has(t)))),t.hasSelectOption=a(((e,t,r)=>r.type===e)),t.quoteString=i,t.dynamicPropertyParser=s,t.customDynamicParamParser=p,t.stringPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const n=t.property.get(e);void 0!==n&&r.properties.set(y(e),i(n))})),t.objectPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const n=t.property.get(e);void 0!==n&&r.properties.set(y(e),n)})),t.isEmptyOrUndefined=l,t.numberPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const n=t.property.get(e);l(n)||r.properties.set(y(e),n)})),t.booleanPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const n=t.property.get(e);l(n)||r.properties.set(y(e),n)})),t.enumPropertyParser=a(((e,t,r,n)=>{if(s(e,r,n))return;const o=r.property.get(e);l(o)||n.properties.set(y(e),d(t,o))})),t.dynamicParamParser=c,t.stringParamParser=a(((e,t,r)=>{if(c(e,t,r))return;const n=t.property.get(e);void 0!==n&&r.params instanceof Map&&r.params.set(y(e),i(n))})),t.dateParamParser=a(((e,t,r,n)=>{const o=r.dynamicProperty.get(e);if(void 0!==o&&""!==o.trim()&&n.params instanceof Map)return void n.params.set(t,o);const a=r.property.get(e);void 0!==a&&n.params instanceof Map&&n.params.set(t,(e=>void 0===e||""===e?"new Date()":"new Date ("+i(e)+")")(a))})),t.rawDataParamParser=a(((e,t,r)=>{if(c(e,t,r))return;const n=t.property.get(e);!l(n)&&r.params instanceof Map&&r.params.set(y(e),n)})),t.customRawDataParamParser=a(((e,t,r,n)=>{if(p(e,t,r,n))return;const o=r.property.get(e);!l(o)&&n.params instanceof Map&&n.params.set(t,o)})),t.booleanParamParser=a(((e,r,n)=>{(0,t.rawDataParamParser)(e,r,n)})),t.arrayParamParser=a(((e,r,n)=>{(0,t.rawDataParamParser)(e,r,n)})),t.enumParamParser=a(((e,t,r,n)=>{if(c(e,r,n))return;const o=r.property.get(e);!l(o)&&n.params instanceof Map&&n.params.set(y(e),d(t,o))})),t.colorPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;let n=t.property.get(e);l(n)||(n=f(n),r.properties.set(y(e),n))})),t.getForEachObj=function(e){var t,r;const n=e.dynamicProperty.get("for"),o=e.dynamicProperty.get("keyGenerator"),a=null!==(t=e.property.get("item"))&&void 0!==t?t:"item",i=null!==(r=e.property.get("idx"))&&void 0!==r?r:"idx";return void 0!==e.dynamicProperty.get("for")?{for:n,key:o,item:a,idx:i}:null},t.firstUpperCase=u,t.parseTagName=function(e){return(0,o.getTagName)(e).split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")},t.getEtsPropName=y,t.getEtsEnumValue=d,t.dealWithColor=f,t.fontWeightPropertyParser=function(e,t){const r=e.getProperty("font-weight");if(l(r))return;const n=g(r);t.properties.set("fontWeight",n)},t.labelParamParser=function(e,t){const r=e.dynamicProperty.get("label");if(!l(r))return void t.setParams(m(r));const n=e.property.get("label");"string"==typeof n&&t.setParams(i(n))},t.contentParamParser=function(e,t){const r=e.property.get("content"),n=e.dynamicProperty.get("content");l(n)?"string"==typeof r&&t.setParams(i(r)):t.setParams(m(n))},t.getBackgroundImagePositionEnumValue=function(e){const t=new Map([["top left","TopStart"],["top center","Top"],["top right","TopEnd"],["center left","Start"],["center center","Center"],["center right","End"],["bottom left","BottomStart"],["bottom center","Bottom"],["bottom right","BottomEnd"]]);return t.has(e)?`Alignment.${String(t.get(e))}`:""},t.getBackgroundImageSizeEnumValue=function(e){return new Set(["cover","contain","auto"]).has(e)?d("ImageSize.",e):""},t.dealWithWrap=function(e){let t=d("FlexWrap.",e);return"nowrap"===e&&(t="FlexWrap.NoWrap"),t},t.scrollerParamParser=function(e,t){const r=e.dynamicProperty.get("scroller");l(r)||t.setParams(r)},t.getContentName=m,t.dealWithFontWeight=g,t.dealWithBackgroundImagePosition=function(e){if(new Set(["TopStart","Top","TopEnd","Start","Center","End","BottomStart","Bottom","BottomEnd"]).has(e))return"Alignment."+e;const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null!==t?`{ x: ${i(t[1])}, y: ${i(t[4])} }`:void 0},t.dealWithBackgroundImageSize=function(e){if(new Set(["Cover","Contain","Auto"]).has(e))return d("ImageSize.",e);const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null!==t?void 0!==t[5]?`{ width: ${i(t[1])}, height: ${i(t[5])} }`:`{ width: ${i(t[1])} }`:void 0},t.dealWithBackgroundRepeat=function(e){const t=new Map([["repeat-x","X"],["repeat-y","Y"],["repeat","XY"],["no-repeat","NoRepeat"]]).get(e);if(null!=t&&""!==t)return d("ImageRepeat.",t)},t.dealWithScrollEdgeEffect=function(e){var t;const r=d("EdgeEffect.",e);return null!==(t=new Map([["Spring","EdgeEffect.Spring"],["Fade","EdgeEffect.Fade"],["None","EdgeEffect.None"]]).get(r))&&void 0!==t?t:r},t.dealWithAlignSelf=function(e){let t=d("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t},t.getBorderDirections=function(e){return"border-width"===e?["border-top-width","border-bottom-width","border-left-width","border-right-width"]:"border-color"===e?["border-top-color","border-bottom-color","border-left-color","border-right-color"]:"border-style"===e?["border-top-style","border-bottom-style","border-left-style","border-right-style"]:["border-top-left-radius","border-bottom-right-radius","border-bottom-left-radius","border-top-right-radius"]},t.getEdgeBorderDirection=function(e){var t;return e.includes("radius")?null!==(t=new Map([["border-top-left-radius","topLeft"],["border-top-right-radius","topRight"],["border-bottom-left-radius","bottomLeft"],["border-bottom-right-radius","bottomRight"]]).get(e))&&void 0!==t?t:e:e.split("-")[1]}},1912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.events=t.parseVisualModel=void 0;const n=r(8122),o=r(7150),a=r(1778),i=r(8916),s=r(9248),p=r(8483),l=r(2563),c=r(8681),u=r(1790),y=r(8191),d=r(2153),f=r(780),m=r(2565),g=r(4313),h=r(5264),E=r(7907),T=r(7375),P=r(8014),v=r(4925),S=r(1162),b=r(9284),_=r(8936),N=r(2973),C=r(7036),A=r(2218),M=r(1147);t.parseVisualModel=function(e,r){r.setTagName((0,n.parseTagName)(e.type));const o=(0,n.getForEachObj)(e);r.setForEachObj(o);const a=void 0!==e.dynamicProperty.get("if")?e.dynamicProperty.get("if"):e.property.get("if");void 0===a?r.setIfBoolean(null):r.setIfBoolean(a);for(const t of w)("boolean"==typeof t[0]||t[0](e))&&t[1](e,r);!function(e,r){var n;const o="onDisappear",a="onDisAppear";for(let n of t.events){const t=e.property.get(n);n===o&&(n=a),void 0!==t&&""!==t&&("this"===t.split(".")[0]?r.properties.set(n,t+".bind(this)"):r.properties.set(n,t))}if(void 0!==e.property.get("newFunction")){const t=null!==(n=e.property.get("newFunction"))&&void 0!==n?n:"{}",i=JSON.parse(t);Object.keys(i).forEach((e=>{var t;const n=null!==(t=i[e].eventCodeGen)&&void 0!==t?t:"";e===o&&(e=a),r.properties.set(e,n)}))}}(e,r)},t.events=["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange","onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop","onComplete","onError","onFinish","onChange","onSubmit","onEditChanged","onStateChange","onRefreshing","onSelect","onScroll","onScrollEdge","onScrollEnd","onScrollBegin","onTitleModeChange"];const w=[...o.commonParserArray,...i.buttonParserArray,...a.dividerParserArray,...s.imageParserArray,...p.progressParserArray,...l.sliderParserArray,...c.textParserArray,...u.columnParserArray,...u.rowParserArray,...h.flexParserArray,...E.listParserArray,...E.listItemParserArray,...f.swiperParserArray,...S.textInputParserArray,...y.navigationParserArray,...m.timePickerParserArray,...m.textPickerParserArray,...v.refreshParserArray,...g.toggleParseArray,...P.selectParserArray,...m.datePickerParserArray,...T.scrollParserArray,...d.gridParserArray,...d.gridItemParserArray,...b.searchParserArray,..._.stackParserArray,...N.tabsParserArray,...C.tabContentParserArray,...A.checkboxParseArray,...M.checkboxGroupParseArray]},3243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Style=t.Tag=void 0;const n=r(4117);class o extends n.ASTNode{constructor(e,t,r){super(),this.tagName=e,this.attributes=t,this.content=r}}t.Tag=o;class a extends n.ASTNode{constructor(e,t,r,n){super(),this.mediaQuery=void 0,this.kind=e,this.name=t,this.content=r,this.mediaQuery=n}}t.Style=a},3573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const n=r(3243),o=r(2334);class a{constructor(e){this.cache=e}visit(e){e instanceof n.Tag?this.genTag(e):e instanceof n.Style&&this.genStyle(e)}static getMethodGen(e){return void 0===a.instance?a.instance=new a(e):a.instance.setCache(e),a.instance}setCache(e){this.cache=e}genTag(e){if(this.cache.concat(o.TokenClass.TAG_START,e.tagName),this.cache.indentOff(),e.attributes.forEach(((e,t)=>{let r="";for(const t of e)r+='"'===t?""":"\n"===t?" ":t;this.cache.concat(o.TokenClass.SPACE,t,o.TokenClass.ASSIGN,o.TokenClass.LQUOTE,r,o.TokenClass.RQUOTE)})),null===e.content)this.cache.concat(o.TokenClass.EMPTY_TAG_END);else{if(this.cache.concat(o.TokenClass.TAG_END),"string"==typeof e.content){let t="";for(const r of e.content)t+="<"===r?"<":r;this.cache.concat(t)}else 0!==e.content.length&&(this.cache.concat(o.TokenClass.NEW_LINE),this.cache.incIndent(),this.cache.indentOn(),e.content.forEach((e=>{e.accept(this),this.cache.indentOff(),this.cache.concat(o.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.indentOn(),this.cache.decIndent());this.cache.concat(o.TokenClass.END_TAG_START,e.tagName,o.TokenClass.TAG_END)}}genStyle(e){void 0!==e.mediaQuery&&(this.cache.concat("@media"),this.cache.indentOff(),this.cache.concat(o.TokenClass.SPACE,e.mediaQuery,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent()),"IDStyle"===e.kind&&(this.cache.concat(o.TokenClass.ID_STYLE_START),this.cache.indentOff()),this.cache.concat(e.name,o.TokenClass.SPACE,o.TokenClass.LBRA,o.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent(),e.content.forEach(((e,t)=>{this.cache.concat(t,o.TokenClass.COLON,o.TokenClass.SPACE,e,o.TokenClass.SEMICOLON,o.TokenClass.NEW_LINE)})),this.cache.decIndent(),this.cache.concat(o.TokenClass.RBRA,o.TokenClass.NEW_LINE),void 0!==e.mediaQuery&&(this.cache.decIndent(),this.cache.concat(o.TokenClass.RBRA,o.TokenClass.NEW_LINE)),this.cache.concat(o.TokenClass.NEW_LINE)}}t.ASTNodeGenerator=a,a.instance=void 0},8844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CSSBridge=t.HMLBridge=void 0;const n=r(3243),o=r(7571);t.HMLBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map([["id",e.id]]);let r="";for(let[n,a]of e.property)(0,o.isAttribute)(n,e.type)?("string"!=typeof a&&(a=JSON.stringify(a)),t.set(n,a)):(0,o.isContent)(n)&&(r=a);if(e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}const a=new n.Tag(e.type,t,r);return"wrapper"===t.get("id")?new n.Tag("div",new Map,[a]):a}},t.CSSBridge=class{constructor(){this.errors=0,this.styles=[]}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}genIDStyle(e){var t;const r=t=>{const r=new Map;for(const[n,a]of t)(0,o.isStyle)(n,e.type)&&r.set(n,a);return r},a=r(e.property);a.size>0&&this.styles.push(new n.Style("IDStyle",e.id,a)),(null!==(t=e.mediaProperty)&&void 0!==t?t:new Map).forEach(((t,o)=>{const a=r(t);a.size>0&&this.styles.push(new n.Style("IDStyle",e.id,a,o))}));for(const t of e.children)t.accept(this)}visit(e){return this.genIDStyle(e),this.styles}}},1055:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genFACSS=t.genFAHML=void 0;const n=r(3573),o=r(1862);t.genFAHML=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" "));return e.accept(t),t.cache.toString()},t.genFACSS=function(e){const t=n.ASTNodeGenerator.getMethodGen(new o.Cache(" "));return e.forEach((e=>{e.accept(t)})),t.cache.toString()}},7571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEvent=t.isData=t.isUnknown=t.isContent=t.isAttribute=t.isStyle=t.styleMap=void 0;const n=r(904),o=["width","height","min-width","min-height","max-width","max-height","padding","padding-start","padding-end","padding-top","padding-right","padding-bottom","padding-left","margin","margin-start","margin-end","margin-top","margin-right","margin-bottom","margin-left","border-width","border-style","border-color","border-radius","border-top-width","border-top-style","border-top-color","border-top-left-radius","border-right-width","border-right-style","border-right-color","border-top-right-radius","border-bottom-width","border-bottom-style","border-bottom-color","border-bottom-right-radius","border-left-width","border-left-style","border-left-color","border-bottom-left-radius","background-color","background","background-image","background-size","background-position","background-repeat","display","opacity","visibility","flex","flex-grow","flex-shrink","flex-basis","position","display","top","right","bottom","left","display-index","flex-weight","aspect-ratio"],a=["font-size","font-family","font-style","font-weight"],i=["text-align","line-height","text-decoration","letter-spacing","max-lines","text-overflow","allow-scale","min-font-size","max-font-size","font-size-step","prefer-font-sizes","color",...a],s=["allow-scale","text-decoration","color",...a],p=["text-color","allow-scale","icon-width","icon-height","radius",...a],l=["texton-color","textoff-color","text-padding","allow-scale",...a],c=["column-height","text-color","allow-scale","letter-spacing","text-decoration","line-height","opacity",...a],u=["text-color","allow-scale","letter-spacing",...a];t.styleMap=new Map([["common",new Set([...o])],["div",new Set(["flex-direction","overflow","flex-wrap","justify-content","align-items","align-content","grid-template-columns","grid-template-rows","grid-row-start","grid-row-end","grid-column-start","grid-column-end","grid-gap","grid-columns-gap","grid-rows-gap"])],["text",new Set([...i])],["image",new Set(["object-fit","match-text-direction","fit-original-size"])],["span",new Set([...s])],["input",new Set(["font-size","font-family","font-weight","color","placeholder-color","allow-scale"])],["button",new Set([...p])],["switch",new Set([...l])],["refresh",new Set(["progress-color"])],["divider",new Set(["stroke-width","line-cap","color"])],["chart",new Set(["stroke-width","radius","start-angle","total-angle","center-x","center-y","colors","weights"])],["picker",new Set([...c])],["picker-view",new Set(["color","font-size","selected-color","selected-font-size","focus-color","focus-font-size","disappear-color","disappear-font-size","font-family"])],["slider",new Set(["color","selected-color","block-color"])],["swiper",new Set(["indicator-color","indicator-selected-color","indicator-size","indicator-top","indicator-right","indicator-bottom","indicator-left"])],["list",new Set(["flex-direction","columns","item-extent","fade-color"])],["list-item",new Set(["column-span"])],["progress",new Set(["color","stroke-width","background-color","secondary-color","scale-width","scale-number","start-angle","total-angle","center-x","center-y","radius"])],["select",new Set(["font-family"])],["menu",new Set([...u])],["option",new Set(["color","font-family","allow-scale","font-size","font-weight","text-decoration"])],["video",new Set(["object-fit"])],["clock",new Set(["font-family"])]]);const y=new Map([["common",new Set(["id","ref","disabled","focusable","data","if","for"])],["image",new Set(["src","alt"])],["button",new Set(["type","value","icon","waiting"])],["refresh",new Set(["offset","refreshing","type","lasttime","friction"])],["input",new Set(["type","checked","name","value","placeholder","maxlength","enterkeytype","headericon"])],["switch",new Set(["checked","showtext","texton","textoff"])],["option",new Set(["value","selected","icon"])],["chart",new Set(["type","percent","datasets","options"])],["picker",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","value","vibrate"])],["picker-view",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","indicatorprefix","indicatorsuffix","vibrate"])],["slider",new Set(["min","max","step","showtips","showsteps","mode","value"])],["divider",new Set(["vertical"])],["list",new Set(["scrollpage","cachedcount","scrollbar","scrolleffect","shapemode","indexer","itemscale","itemcenter","updateeffect","scrollvibrate","initialindex","initialoffset"])],["list-item",new Set(["type","primary","section","sticky","stickyradius","clickeffect"])],["swiper",new Set(["index","autoplay","interval","indicator","digital","indicatordisabled","loop","duration","vertical"])],["progress",new Set(["type","percent","secondarypercent","clockwise"])],["menu",new Set(["target","title","type"])],["clock",new Set(["clockconfig","showdigit","hourswest"])],["badge",new Set(["placement","count","visible","maxcount","config","label"])],["video",new Set(["muted","src","autoplay","poster","controls","loop","starttime","direction","speed"])],["tabs",new Set(["index","vertical"])],["tab-bar",new Set(["mode"])],["tab-content",new Set(["scrollable"])]]),d=new Map([["common",new Set(["ontouchstart","ontouchmove","ontouchcancel","ontouchend","onclick","onlongpress","onfocus","onblur","onkey","onswipe"])],["image",new Set(["oncomplete","onerror"])],["input",new Set(["onchange","onenterkeyclick"])],["select",new Set(["onchange"])],["refresh",new Set(["onrefresh","onpulldown"])],["swiper",new Set(["onchange","onrotation"])],["list",new Set(["onindexerchange","onscroll","onscrollbottom","onscrolltop","onscrollend","onscrolltouchup","onrequestitem"])],["list-item",new Set(["onsticky"])],["menu",new Set(["onselected","oncancel"])],["picker",new Set(["oncolumnchange","onchange","oncancel"])],["picker-view",new Set(["oncolumnchange","onchange"])],["video",new Set(["onprepared","onstart","onpause","onfinish","onerror","onseeking","onseeked","ontimeupdate","onfullscreenchange","onstop"])],["tabs",new Set(["onchange"])],["switch",new Set(["onchange"])],["dialog",new Set(["oncancel"])],["slider",new Set(["onchange"])]]),f=new Map([["common",new Set(["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange"])],["image",new Set(["onComplete","onError","onFinish"])],["swiper",new Set(["onChange"])],["list",new Set(["onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop"])],["text-input",new Set(["onChange","onSubmit","onEditChanged"])],["refresh",new Set(["onStateChange","onRefreshing"])],["toggle",new Set(["onChange"])],["timePicker",new Set(["onChange"])],["textPicker",new Set(["onChange"])],["select",new Set(["onSelect"])],["datePicker",new Set(["onChange"])],["search",new Set(["onSubmit","onChange","onCopy","onCut","onPaste"])],["grid",new Set(["onScrollIndex","onItemDragStart","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDrop"])],["grid-item",new Set(["onSelect"])],["navigation",new Set(["onTitleModeChange"])],["tabs",new Set(["onChange"])],["checkBox",new Set(["onChange"])],["checkboxGroup",new Set(["onChange"])]]);function m(e,t,r){const n=t.get(r);return void 0!==n&&n.has(e)}function g(e,r){return m(e,t.styleMap,"common")||m(e,t.styleMap,r)}function h(e,t){return(0,n.getDomain)()===n.Domain.ETS?m(e,f,"common")||m(e,f,t):E(e,t)||T(e,t)}function E(e,t){return m(e,y,"common")||m(e,y,t)}function T(e,t){return m(e,d,"common")||m(e,d,t)}t.isStyle=g,t.isAttribute=h,t.isContent=function(e){return"content"===e},t.isUnknown=function(e,t){return!g(e,t)&&!h(e,t)},t.isData=E,t.isEvent=T},2334:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.INDENT=" ",r.SPACE=" ",r.LQUOTE='"',r.RQUOTE='"',r.TAG_START="<",r.TAG_END=">",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.etsPropertyList=void 0;const n=r(5958),o=r(1513),a=["vp","px","%","lpx"],i=[{propertySector:o.Sector.FEATURE,propertySet:{name:"FontSize",property:"font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontStyle",property:"font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontColor",property:"font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontWeight",property:"font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...o.commonFontWeight],defaults:"normal"}}],s={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["vp","px","lpx"],placeholder:"0"},p=[{propertySector:o.Sector.GENERAL,propertySet:{name:"Width",property:"width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a,min:0}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Height",property:"height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a,min:0}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MinWidth",property:"constraint-size-min-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MinHeight",property:"constraint-size-min-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MaxWidth",property:"constraint-size-max-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.GENERAL,propertySet:{name:"MaxHeight",property:"constraint-size-max-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"Margin",property:"margin-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"Padding",property:"padding-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginTop",property:"margin-top-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginRight",property:"margin-right-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginBottom",property:"margin-bottom-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"MarginLeft",property:"margin-left-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingTop",property:"padding-top-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingRight",property:"padding-right-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingBottom",property:"padding-bottom-visual"},s)},{propertySector:o.Sector.DIMENSION,propertySet:Object.assign({name:"PaddingLeft",property:"padding-left-visual"},s)}],l={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a},c={type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a},u=[{propertySector:o.Sector.CUSTOM,propertySet:{name:"CustomString",property:"custom-string-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.CUSTOM,propertySet:{name:"CustomNumber",property:"custom-number-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.CUSTOM,propertySet:{name:"CustomBoolean",property:"custom-boolean-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}],y=[{propertySector:o.Sector.DIMENSION,propertySet:{name:"Border",property:"border-visual",type:o.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-width-visual"},l),Object.assign({name:"Style",property:"border-style-visual"},o.commonParamsForBorder),{name:"Color",property:"border-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR},Object.assign({name:"Radius",property:"border-radius-visual"},c)]}}],d=[{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageSrc",property:"background-image-src-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_SRC}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageRepeat",property:"background-image-repeat-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_REPERT,list:[o.CLEAN_VALUE_NODE,{name:"X",value:"repeat-x"},{name:"Y",value:"repeat-y"},{name:"XY",value:"repeat"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImageSize",property:"background-image-size-visual",type:o.TypeName.DATA_SELECT_INPUT,etsType:`${o.EtsType.IMAGE_SIZE}|${o.EtsType.STRING}`,list:[o.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Auto",value:"auto"}],defaults:"Auto"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundImagePosition",property:"background-image-position-visual",type:o.TypeName.DATA_SELECT_INPUT,etsType:`${o.EtsType.ALIGNMENT}|${o.EtsType.STRING}`,list:[o.CLEAN_VALUE_NODE,{name:"TopStart",value:"top left"},{name:"Top",value:"top center"},{name:"TopEnd",value:"top right"},{name:"Start",value:"center left"},{name:"Center",value:"center center"},{name:"End",value:"center right"},{name:"BottomStart",value:"bottom left"},{name:"Bottom",value:"bottom center"},{name:"BottomEnd",value:"bottom right"}],defaults:"0 0"}}],f=[{propertySector:o.Sector.GENERAL,propertySet:{name:"Location",property:"position-visual",type:o.TypeName.SELECT,defaults:"offset",supportDynamicProperty:!1,list:[o.CLEAN_VALUE_NODE,{name:"offset",value:"relative"},{name:"position",value:"absolute"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"X",property:"left-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Y",property:"top-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}}],m=[...i,{propertySector:o.Sector.FEATURE,propertySet:{name:"TextAlign",property:"text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"LineHeight",property:"line-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextOverflow",property:"text-overflow-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_OVERFLOW,list:[o.CLEAN_VALUE_NODE,{name:"Clip",value:"clip"},{name:"Ellipsis",value:"ellipsis"},{name:"None",value:"none"}],defaults:"clip"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"BaselineOffset",property:"baseline-offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DecorationType",property:"decoration-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_DECORATION_TYPE,list:[o.CLEAN_VALUE_NODE,{name:"Underline",value:"underline"},{name:"LineThrough",value:"line-through"},{name:"Overline",value:"overline"},{name:"None",value:"none"}],defaults:"none"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DecorationColor",property:"decoration-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextCase",property:"text-case-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_CASE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"LowerCase"},{value:"UpperCase"}],defaults:"Normal"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"ForEach",property:"for-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"KeyGenerator",property:"keyGenerator-visual",type:o.TypeName.BASE,etsType:"Event",supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Item",property:"item-visual",type:o.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Item of ForEach Array"}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Idx",property:"idx-visual",type:o.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Index of Corresponding Item In ForEach Array"}}],g=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Placeholder",property:"placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Type",property:"textInput-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.INPUT_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Password"},{value:"Email"},{value:"Number"}],defaults:"Normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderColor",property:"placeholderColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontSize",property:"placeholderFont-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontWeight",property:"placeholderFont-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Lighter"},{value:"Regular"},{value:"Medium"},{value:"Bold"},{value:"Bolder"},...o.commonFontWeight],defaults:"400"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontFamily",property:"placeholderFont-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceholderFontStyle",property:"placeholderFont-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Italic"}],defaults:"Normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EnterKeyType",property:"enterKeyType-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ENTER_KEY_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Go"},{value:"Search"},{value:"Send"},{value:"Next"},{value:"Done"}],defaults:"Done"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CaretColor",property:"caretColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"MaxLength",property:"maxLength-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}}],h=[{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"Vertical",property:"vertical-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"LineCap",property:"line-cap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.LINE_CAP_STYLE,defaults:"butt",list:[o.CLEAN_VALUE_NODE,{name:"Butt",value:"butt"},{name:"Round",value:"round"},{name:"Square",value:"square"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StrokeWidth",property:"stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:a}}],E=[{propertySector:o.Sector.FEATURE,propertySet:{name:"InitialIndex",property:"initial-index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ListDirection",property:"list-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.AXIS,list:[o.CLEAN_VALUE_NODE,{name:"Vertical",value:"vertical"},{name:"Horizontal",value:"horizontal"}],defaults:"vertical"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Color",property:"divider-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StrokeWidth",property:"divider-stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StartMargin",property:"divider-start-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EndMargin",property:"divider-end-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:a}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EditMode",property:"edit-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"EdgeEffect",property:"edge-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{name:"Spring",value:"spring"},{name:"None",value:"none"}],defaults:"spring"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ChainAnimation",property:"chain-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}],T=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Sticky",property:"sticky-visual",type:o.TypeName.SELECT,etsType:o.EtsType.STICKY,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"Normal",value:"normal"}],defaults:"none"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Editable",property:"editable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}],P=[{propertySector:o.Sector.FLEX,propertySet:{name:"FlexBasis",property:"flex-basis-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:a,defaults:"auto",fixedValues:["auto"],info:"The initial main size of a flex item. It sets the size of the content box otherwise set with box-sizing."}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignSelf",property:"align-self-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"auto",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FLEX,propertySet:{name:"Direction",property:"flex-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_DIRECTION,defaults:"row",list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"RowReverse",value:"row-reverse"},{name:"Column",value:"column"},{name:"ColumnReverse",value:"column-reverse"}],info:"The direction of flex."}},{propertySector:o.Sector.FLEX,propertySet:{name:"Wrap",property:"wrap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_WRAP,defaults:"nowrap",list:[o.CLEAN_VALUE_NODE,{name:"NoWrap",value:"nowrap"},{name:"Wrap",value:"wrap"},{name:"WrapReverse",value:"wrap-reverse"}],info:"Whether flex items are forced onto one line or multiple lines."}},{propertySector:o.Sector.FLEX,propertySet:{name:"JustifyContent",property:"justify-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"JustifyContent",property:"justify-content-rc-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignItems",property:"align-items-flex-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"stretch",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FLEX,propertySet:{name:"AlignContent",property:"align-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Set the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis."}}],v=[{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"AutoPlay",property:"auto-play-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"Interval",property:"interval-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"Loop",property:"loop-visual"},o.commonParamsForJudge),{defaults:!0})},{propertySector:o.Sector.FEATURE,propertySet:{name:"Duration",property:"duration-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ItemSpace",property:"item-space-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CachedCount",property:"cached-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"DisableSwipe",property:"disable-swipe-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"Index",property:"index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"Indicator",property:"indicator-visual"},o.commonParamsForJudge),{defaults:!0})}],S=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Type",property:"toggle-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TOGGLE_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Button"},{value:"Checkbox"},{value:"Switch"}],defaults:"Button"}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"IsOn",property:"isOn-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedColor",property:"selectedColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SwitchPointColor",property:"switchPointColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}],b=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Friction",property:"friction-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:62}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Offset",property:"offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:a,defaults:16}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Refreshing",property:"refreshing-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}],_=[{propertySector:o.Sector.FEATURE,propertySet:{name:"TrackColor",property:"track-color-visual",type:o.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ShowSteps",property:"show-steps-visual",type:o.TypeName.ADJUSTABLE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ShowTips",property:"show-tips-visual",type:o.TypeName.ADJUSTABLE}}],N=[{propertySector:o.Sector.FEATURE,propertySet:{name:"Range",property:"range-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Selected",property:"datetime-selected-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Start",property:"start-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"End",property:"end-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign(Object.assign({name:"UseMilitaryTime",property:"useMilitaryTime-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE,propertySet:{name:"Selected",property:"textPicker-selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DefaultPickerItemHeight",property:"defaultPickerItemHeight-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["vp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Lunar",property:"lunar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}],C=[{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontSize",property:"selected-option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontStyle",property:"selected-option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontColor",property:"selected-option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontWeight",property:"selected-option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...o.commonFontWeight],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionFontFamily",property:"selected-option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedOptionBackgroundColor",property:"selected-option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontSize",property:"option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontStyle",property:"option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontColor",property:"option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontWeight",property:"option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...o.commonFontWeight],defaults:"normal"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionFontFamily",property:"option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"OptionBackgroundColor",property:"option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Value",property:"select-value-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Selected",property:"selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Options",property:"select-option-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}}];t.etsPropertyList=[...u,...y,...p,...S,...m,...g,...h,...f,...E,...T,...P,...v,...b,...C,..._,...n.commonPropertyList,...d,...N,{propertySector:o.Sector.ATOMIC,propertySet:{name:"DisplayPriority",property:"display-priority-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Visibility",property:"visibility-visual",type:o.TypeName.SELECT,etsType:o.EtsType.VISIBILITY,defaults:"visible",list:[o.CLEAN_VALUE_NODE,{name:"Visible",value:"visible"},{name:"Hidden",value:"hidden"},{name:"None",value:"none"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Enabled",property:"enabled-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"true",list:[{value:"true"},{value:"false"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Align",property:"align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ALIGNMENT,defaults:"center",list:[o.CLEAN_VALUE_NODE,{name:"TopStart",value:"top-start"},{name:"Top",value:"top"},{name:"TopEnd",value:"top-end"},{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"},{name:"BottomStart",value:"bottom-start"},{name:"Bottom",value:"bottom"},{name:"BottomEnd",value:"bottom-end"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"If",property:"if-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Space",property:"space-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["vp","px","lpx"],requires:{"display-visual":["flex","cleanValue"]},info:"Space between any two adjacent child components."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"AlignItems",property:"align-items-row-visual",type:o.TypeName.SELECT,etsType:o.EtsType.VERTICAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[o.CLEAN_VALUE_NODE,{value:"flex-start",name:"top",etsEnumValue:"Top"},{value:"flex-end",name:"bottom",etsEnumValue:"Bottom"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the vertical direction."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"AlignItems",property:"align-items-column-visual",type:o.TypeName.SELECT,etsType:o.EtsType.HORIZONTAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[o.CLEAN_VALUE_NODE,{value:"flex-start",name:"start",etsEnumValue:"Start"},{value:"flex-end",name:"end",etsEnumValue:"End"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the horizontal direction."}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Src",property:"src-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_SRC}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Alt",property:"alt-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT}},{propertySector:o.Sector.FEATURE,propertySet:{name:"RenderMode",property:"render-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_RENDER_MODE,defaults:"original",list:[o.CLEAN_VALUE_NODE,{name:"Original",value:"original"},{name:"Template",value:"template"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ObjectRepeat",property:"object-repeat-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_REPERT,defaults:"no-repeat",list:[o.CLEAN_VALUE_NODE,{name:"X",value:"X"},{name:"Y",value:"Y"},{name:"XY",value:"XY"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ObjectFit",property:"object-fit-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_FIT,defaults:"cover",list:[o.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Fill",value:"fill"},{name:"None",value:"none"},{name:"ScaleDown",value:"scale-down"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"InterPolation",property:"interpolation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.IMAGE_INTERPOLATION,defaults:"none",list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"High",value:"high"},{name:"Medium",value:"medium"},{name:"Low",value:"low"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SourceSizeWidth",property:"source-size-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SourceSizeHeight",property:"source-size-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Type",property:"type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BUTTON_TYPE,defaults:"capsule",list:[{name:"Normal",value:"normal"},{name:"Capsule",value:"capsule"},{name:"Circle",value:"circle"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StateEffect",property:"state-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"true",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Content",property:"content-visual",type:o.TypeName.ADJUSTABLE,etsType:o.EtsType.COMB_CONTENT}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Label",property:"label-visual",type:o.TypeName.ADJUSTABLE,etsType:o.EtsType.COMB_CONTENT}}]},5958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonPropertyList=void 0;const n=r(1513);t.commonPropertyList=[{propertySector:n.Sector.GENERAL,propertySet:{name:"BackgroundColor",property:"background-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Display",property:"display-visual",type:n.TypeName.SELECT,defaults:"flex",list:[n.CLEAN_VALUE_NODE,{value:"flex"},{value:"none"}]}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Opacity",property:"opacity-visual",type:n.TypeName.SLIDER,etsType:n.EtsType.COMB_R_NUMBER,defaults:"1",step:.01,max:1,min:0}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Overflow",property:"overflow-visual",type:n.TypeName.SELECT,defaults:"visible",list:[n.CLEAN_VALUE_NODE,{value:"visible"},{value:"hidden"},{value:"scroll"}]}},{propertySector:n.Sector.FLEX,propertySet:{name:"FlexGrow",property:"flex-grow-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:"0",requiresParent:{display:["flex","cleanValue"]},info:"The flex grow factor of a flex item's main size"}},{propertySector:n.Sector.FLEX,propertySet:{name:"FlexShrink",property:"flex-shrink-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:"1",requiresParent:{display:["flex","cleanValue"]},info:"The flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items will shrink"}},{propertySector:n.Sector.FLEX,propertySet:{name:"Columns",property:"columns-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:1,info:"The column number of flex."}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Header Logo",property:"headerLogo-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Title",property:"title-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Status",property:"status-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.GENERAL,propertySet:{name:"Logo",property:"logo-visual",type:n.TypeName.BASE,defaults:""}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Color",property:"color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FontFamily",property:"font-family-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_CONTENT,defaults:"sans-serif"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"MaxLines",property:"max-lines-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextColor",property:"text-color-visual",type:n.TypeName.COLOR,defaults:"rgba(0,0,0,0.9)"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FocusColor",property:"focus-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"DisappearColor",property:"disappear-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorColor",property:"indicator-color-visual",type:n.TypeName.COLOR}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorSelectedColor",property:"indicator-selected-color-visual",type:n.TypeName.COLOR,defaults:"#ff007dff"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IndicatorSize",property:"indicator-size-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorTop",property:"indicator-top-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorRight",property:"indicator-right-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorBottom",property:"indicator-bottom-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorLeft",property:"indicator-left-visual"},n.commonParamsForIndicator)},{propertySector:n.Sector.FEATURE,propertySet:{name:"AllowScale",property:"allow-scale-visual",type:n.TypeName.SELECT,defaults:"true",list:[n.CLEAN_VALUE_NODE,{value:"true"},{value:"false"}]}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowStart",property:"grid-row-start-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its row in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnStart",property:"grid-column-start-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its column in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowEnd",property:"grid-row-end-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its row in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnEnd",property:"grid-column-end-visual",type:n.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its column in the grid area."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridTemplateRows",property:"grid-template-rows-visual",type:n.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid rows."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridTemplateColumns",property:"grid-template-columns-visual",type:n.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid columns."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridRowsGap",property:"grid-rows-gap-visual",type:n.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's grid rows."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridColumnsGap",property:"grid-columns-gap-visual",type:n.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's columns."}},{propertySector:n.Sector.GRID,propertySet:{name:"GridGap",property:"grid-gap-visual",type:n.TypeName.INTEGER,units:["px"],requires:{"display-visual":["grid"]},info:"The gaps between rows and columns. It is a shorthand for row-gap and column-gap."}},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"MatchTextDirection",property:"match-text-direction-visual"},n.commonParamsForJudge)},{propertySector:n.Sector.FEATURE,propertySet:Object.assign({name:"FitOriginalSize",property:"fit-original-size-visual"},n.commonParamsForJudge)},{propertySector:n.Sector.FEATURE,propertySet:{name:"IconWidth",property:"icon-width-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"IconHeight",property:"icon-height-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextonColor",property:"texton-color-visual",type:n.TypeName.COLOR,defaults:"#000000"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextoffColor",property:"textoff-color-visual",type:n.TypeName.COLOR,defaults:"#000000"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TextPadding",property:"text-padding-visual",type:n.TypeName.INTEGER,defaults:0,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"SelectedColor",property:"selected-color-visual",type:n.TypeName.COLOR,defaults:"rgba(0,125,255,1)"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"BlockColor",property:"block-color-visual",type:n.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Radius",property:"radius-visual",type:n.TypeName.INTEGER,units:["px"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"StartAngle",property:"start-angle-visual",type:n.TypeName.INTEGER,defaults:240}},{propertySector:n.Sector.FEATURE,propertySet:{name:"TotalAngle",property:"total-angle-visual",type:n.TypeName.INTEGER,defaults:240}},{propertySector:n.Sector.FEATURE,propertySet:{name:"CenterX",property:"center-x-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"CenterY",property:"center-y-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Colors",property:"colors-visual",type:n.TypeName.BASE}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Weights",property:"weights-visual",type:n.TypeName.BASE}},{propertySector:n.Sector.FEATURE,propertySet:{name:"PlaceHolderColor",property:"placeholder-color-visual",type:n.TypeName.COLOR,defaults:"gray"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ProgressColor",property:"progress-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR,defaults:"black"}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ItemExtent",property:"item-extent-visual",type:n.TypeName.INTEGER,units:["px","%"]}},{propertySector:n.Sector.FEATURE,propertySet:{name:"FadeColor",property:"fade-color-visual",type:n.TypeName.COLOR,defaults:"grey"}},{propertySector:n.Sector.FLEX,propertySet:{name:"ColumnSpan",property:"column-span-visual",type:n.TypeName.INTEGER,defaults:1,min:1,info:"The number of span."}},{propertySector:n.Sector.ATOMIC,propertySet:{name:"FlexWeight",property:"flex-weight-visual",type:n.TypeName.INTEGER}},{propertySector:n.Sector.ATOMIC,propertySet:{name:"AspectRatio",property:"aspect-ratio-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.FEATURE,propertySet:{name:"SecondaryColor",property:"secondary-color-visual",type:n.TypeName.COLOR,requires:{type:["horizontal","ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ScaleWidth",property:"scale-width-visual",type:n.TypeName.INTEGER,requires:{type:["ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"ScaleNumber",property:"scale-number-visual",type:n.TypeName.INTEGER,defaults:120,requires:{type:["ring","scale-ring"]}}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Value",property:"value-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:0}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Total",property:"total-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,defaults:100}},{propertySector:n.Sector.FEATURE,propertySet:{name:"Style",property:"style-visual",type:n.TypeName.SELECT,etsType:n.EtsType.PROGRESS_STYLE,defaults:"Linear",list:[{value:"Linear"}]}}]},1513:(e,t)=>{"use strict";var r,n,o,a,i,s;Object.defineProperty(t,"__esModule",{value:!0}),t.commonFontWeight=t.commonParamsForBorderRadius=t.commonParamsForIndicator=t.commonParamsForInteger=t.commonParamsForJudge=t.commonParamsForBorder=t.CLEAN_VALUE_NODE=t.EtsCombinationType=t.EtsBasicType=t.EtsEnumType=t.EtsType=t.TypeName=t.Sector=void 0,function(e){e.GENERAL="general",e.DIMENSION="dimension",e.FEATURE="feature",e.FLEX="flex",e.GRID="grid",e.ATOMIC="atomic",e.CUSTOM="custom"}(r||(r={})),t.Sector=r,function(e){e.BASE="base",e.INTEGER="integer",e.SELECT="select",e.COLOR="color",e.COMPOSITE="composite",e.SLIDER="slider",e.DATA_SELECT_INPUT="dataSelectInput",e.ADJUSTABLE="adjustable"}(n||(n={})),t.TypeName=n,function(e){e.ARRAY="ETSArray",e.BOOLEAN="boolean",e.DATE="Date",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(o||(o={})),t.EtsBasicType=o,function(e){e.R_FLOAT="Rfloat",e.R_STRING="Rstring",e.R_COLOR="Rcolor",e.R_PLURAL="Rplural",e.R_MEDIA="Rmedia",e.R_RAWFILE="Rrawfile"}(a||(a={})),function(e){e.ALIGNMENT="Alignment",e.AXIS="Axis",e.BORDER_STYLE="BorderStyle",e.BUTTON_TYPE="ButtonType",e.COLOR="Color",e.DIRECTION="Direction",e.EDGE_EFFECT="EdgeEffect",e.ENTER_KEY_TYPE="EnterKeyType",e.FLEX_ALIGN="FlexAlign",e.FLEX_DIRECTION="FlexDirection",e.FLEX_WRAP="FlexWrap",e.FONT_STYLE="FontStyle",e.FONT_WEIGHT="FontWeight",e.HORIZONTAL_ALIGN="HorizontalAlign",e.IMAGE_FIT="ImageFit",e.IMAGE_INTERPOLATION="ImageInterpolation",e.IMAGE_RENDER_MODE="ImageRenderMode",e.IMAGE_REPERT="ImageRepeat",e.IMAGE_SIZE="ImageSize",e.INPUT_TYPE="InputType",e.ITEM_ALIGN="ItemAlign",e.LINE_CAP_STYLE="LineCapStyle",e.PROGRESS_STYLE="ProgressStyle",e.STICKY="Sticky",e.TEXT_ALIGN="TextAlign",e.TEXT_OVERFLOW="TextOverflow",e.TEXT_DECORATION_TYPE="TextDecorationType",e.TEXT_CASE="TextCase",e.TOGGLE_TYPE="ToggleType",e.VERTICAL_ALIGN="VerticalAlign",e.VISIBILITY="Visibility"}(i||(i={})),t.EtsEnumType=i,function(e){e.COMB_COLOR="string|number|Color|Rcolor",e.COMB_LENGTH="string|number",e.COMB_R_NUMBER="number|Rfloat",e.COMB_R_LENGTH="string|number|Rfloat",e.COMB_CONTENT="string|Rstring|Rplural",e.COMB_SRC="string|Rmedia|Rrawfile"}(s||(s={})),t.EtsCombinationType=s;const p=Object.assign(Object.assign(Object.assign(Object.assign({},o),a),i),s);t.EtsType=p;const l={value:"cleanValue",name:"---Clean Value---"};t.CLEAN_VALUE_NODE=l;const c={type:n.SELECT,etsType:p.BORDER_STYLE,list:[l,{value:"dotted",etsEnumValue:"Dotted"},{value:"dashed",etsEnumValue:"Dashed"},{value:"solid",etsEnumValue:"Solid"}]};t.commonParamsForBorder=c;const u={type:n.SELECT,etsType:p.BOOLEAN,defaults:"false",list:[l,{value:"true"},{value:"false"}]};t.commonParamsForJudge=u;const y={type:n.INTEGER,units:["px"],placeholder:"0px"};t.commonParamsForInteger=y;const d={type:n.INTEGER,units:["px","%"]};t.commonParamsForIndicator=d;const f={type:n.INTEGER,units:["px"]};t.commonParamsForBorderRadius=f,t.commonFontWeight=[{value:"100"},{value:"200"},{value:"300"},{value:"400"},{value:"500"},{value:"600"},{value:"700"},{value:"800"},{value:"900"}]},9282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TagTypeMap=void 0,t.TagTypeMap=new Map([["button","TextContent"],["span","TextContent"],["divider","TextContent"],["picker","TextContent"],["option","TextContent"],["clock","TextContent"],["image","Base"],["input","Base"],["chart","Base"],["slider","Base"],["progress","Base"],["text","Text"],["div","Container"],["list","Container"],["list-item","Container"],["list-item-group","Container"],["refresh","Container"],["dialog","Container"],["stack","Container"],["menu","Container"],["select","Container"],["tabs","Container"],["tab-bar","Container"],["tab-content","Container"]])},4294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.beforeCodegen=t.getCustomCompRelativePath=t.getRelativePath=t.prepareCustomCompTagName=t.capitalize=t.getTagName=t.strToBase64=t.getUniqueName=t.getUniqueId=t.removeFromArray=t.getDataName=void 0;const n=r(2891);function o(e){let t=a(e).replace(/[/=+]/g,"");const r=t.length;return r>=4&&(t=t.substring(r/2-2,r/2+2)),t}function a(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");let r="";for(let t=0;t{const t=r.indexOf(e);-1!==t&&r.splice(t,1)})),r},t.getUniqueId=o,t.getUniqueName=function(e){return`${e}_${o(e)}`},t.strToBase64=a;const i=new Map,s=new Map;function p(e){return e[0].toUpperCase()+e.slice(1)}function l(e){const t=(0,n.getInstance)().document.path;if(0===e.size)return;const r=p(t.substring(t.lastIndexOf("/")+1));e.forEach(((e,n)=>{const o=e.length,a=[...e];n===r&&a.push(t);const l=function(e){e.sort();const t=e[0],r=e[e.length-1];let n=0;for(let e=0;e1||n===r)&&(u=p(e[a].substring(l+1).split("/").join("_"))),s.set(e[a],u);const y="/node_modules/";let d=c(e[a],t);e[a].startsWith(y)&&(d=e[a].replace(y,"@"),d=d.replace("src/main/supervisual","src/main/ets")),i.set(u,d)}}))}function c(e,t){const r=e.split("/"),n=t.split("/");let o=0;for(let e=0;e1){const n=p(r[r.length-1]),o=t.get(n);void 0===o?t.set(n,[e.type]):o.push(e.type)}const n=e.children;for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formManager=void 0;const n=r(2891),o=r(5945);t.formManager={removeData(e){this.getFormModel().data.delete(e)},addData(e){e instanceof Map?e.forEach(((e,t)=>{this.getFormModel().data.set(t,e)})):Object.keys(e).forEach((t=>{this.getFormModel().data.set(t,e[t])}))},updateAllData(e){this.getFormModel().data.clear(),this.addData(e)},addAction(e,t,r,n,a){const i=new Map;void 0!==r&&Object.keys(r).forEach((e=>{i.set(e,r[e])}));const s=new Map;void 0!==n&&Object.keys(n).forEach((e=>{s.set(e,n[e])})),this.getFormModel().actions.set(e,new o.FormAction(t,i,s,a))},updateAllActions(e){this.getFormModel().actions.clear(),e.forEach(((e,t)=>{const r=void 0===e.params?e.params:this.objectToMap(e.params),n=void 0===e.want?e.want:this.objectToMap(e.want),a=new o.FormAction(e.actionType,r,n);this.getFormModel().actions.set(t,a)}))},removeAction(e){this.getFormModel().actions.delete(e)},addActionParams(e,t){var r,n;const a=null!==(r=this.getFormModel().actions.get(e))&&void 0!==r?r:new o.FormAction(e),i=null!==(n=a.params)&&void 0!==n?n:new Map;Object.keys(t).forEach((e=>{i.set(e,t[e])})),a.params=i},removeActionParam(e,t){var r;const n=this.getFormModel().actions.get(e);null===(r=null==n?void 0:n.params)||void 0===r||r.delete(t)},getFormModel:()=>(0,n.getInstance)().formData,codegenToJson:function(){const e=(0,n.getInstance)().formData,t=this.mapToObject(e.data),r={actions:{},data:{}};return r.data=t,e.actions.forEach(((e,t)=>{r.actions[t]={},r.actions[t].action=e.action,e.params instanceof Map&&e.params.size>0&&(r.actions[t].params=this.mapToObject(e.params)),e.want instanceof Map&&e.want.size>0&&(r.actions[t].abilityName=e.abilityName,r.actions[t].want=this.mapToObject(e.want))})),JSON.stringify(r,null,4)},clear(){(0,n.getInstance)().formData.data.clear(),(0,n.getInstance)().formData.actions.clear()},mapToObject:e=>void 0===e?{}:Array.from(e.entries()).reduce(((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r})),{}),objectToMap(e){const t=new Map;return Object.keys(e).forEach(((r,n)=>{t.set(r,e[r])})),t}}},5945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormAction=t.FormModel=void 0,t.FormModel=class{constructor(){this.data=new Map,this.actions=new Map}},t.FormAction=class{constructor(e,t,r,n){this.action=e,this.abilityName=n,this.want=r,this.params=t}}},1509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeForVersion1=t.rootToVisualContent=t.visualToRootContent=t.serializeForVersion1=void 0;const n=r(2891),o=r(1933),a=r(7571),i=r(9282),s=r(5945),p=r(7977),l=new Map;function c(e){l.set("textMap",new Map);const t=u(null!=e?e:(0,n.getInstance)().visualModel);return JSON.stringify({VisualVersion:"1",content:JSON.stringify(t),extraData:JSON.stringify(f(l))})}function u(e){const t=Array.from(e.property).filter((t=>(0,a.isAttribute)(t[0],e.type)));t.push(["id",e.id]);const r=Array.from(e.property).filter((t=>(0,a.isStyle)(t[0],e.type)));let n=i.TagTypeMap.get(e.type);void 0===n&&(n="Base");let o=e.property.has("content")?e.property.get("content"):[];if(e.children.length>0){if("string"==typeof o){const t=l.get("textMap");t instanceof Map&&t.set(e.id,o)}o=e.children.map((e=>u(e)))}return{id:e.id,tagName:e.type,attributes:t,idStyle:r,type:n,content:o}}function y(e,t){let r;if(t instanceof Map){const n=t.get("textMap");n instanceof Map&&(r=n.get(e.id))}const n=new o.VisualModel({id:e.id,type:e.tagName,property:new Map([...e.attributes,...e.idStyle])});return"string"==typeof r&&n.property.set("content",r),n.property.delete("id"),"string"==typeof e.content&&n.property.set("content",e.content),Array.isArray(e.content)&&(n.children=e.content.map((e=>y(e,t)))),n}function d(e){if(e instanceof Array&&e.length>0&&"$$map"===e[0]){e.shift();const t=new Map;for(const[r,n]of e)t.set(r,d(n));return t}return e}function f(e){if(e instanceof Map){const t=["$$map"];for(const[r,n]of e)t.push([r,f(n)]);return t}return e}t.serializeForVersion1=c,t.visualToRootContent=function(e){try{return c(JSON.parse(e,p.reviver).visualModel)}catch(e){console.error("convert visual model to root model failed")}return e},t.rootToVisualContent=function(e){const t=JSON.parse(e),r=JSON.parse(t.content);let n='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(n=JSON.parse(t.extraData));const o=y(r,d(n));return o.property.has("flex-direction")||o.property.set("flex-direction","column"),JSON.stringify({document:{VisualVersion:"12",type:"FA"},visualModel:o,formData:new s.FormModel},p.replacer)},t.deserializeForVersion1=function(e){try{const t=JSON.parse(e),r=JSON.parse(t.content);let o='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(o=JSON.parse(t.extraData)),(0,n.getInstance)().visualModel=y(r,d(o)),(0,n.getInstance)().visualModel.property.has("flex-direction")||(0,n.getInstance)().visualModel.property.set("flex-direction","column")}catch(e){console.error("convert error")}}},2891:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setInstance=t.getInstance=t.setVisualPath=t.clearCustomInstance=t.setCustomInstance=t.getInstanceTemplate=t.getCustomInstance=void 0;const n=r(1933),o=r(5945),a=r(904),i={document:{VisualVersion:"12",type:"FA",custom:!1,path:""},visualModel:new n.VisualModel({type:"div",id:"wrapper"}),formData:new o.FormModel},s=new Map;t.getCustomInstance=function(){return s},t.getInstanceTemplate=function(e){return{document:{VisualVersion:"12",type:"ETS",custom:e,path:"&path"},visualModel:new n.VisualModel({type:"column",id:"wrapper"}),imgData:""}},t.setCustomInstance=function(e,t){var r;const o={path:"",document:{VisualVersion:"",type:"",custom:!0},visualModel:new n.VisualModel({type:"",id:""}),methods:[],property:[],imgData:"",originType:[]};o.path=e;for(const e in o)Object.prototype.hasOwnProperty.call(t,e)&&(o[e]=t[e]);o.visualModel=null!==(r=o.visualModel.children[0])&&void 0!==r?r:new n.VisualModel({type:"text"}),s.set(e,o)},t.clearCustomInstance=function(){s.clear()},t.setVisualPath=function(e){i.document.path=e},t.getInstance=function(){return i},t.setInstance=function(e){var t,r,n,o;for(const t in i)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);const s=i.document.type;void 0===i.document.custom&&(i.document.custom=!1),null!==((null!==(r=(null===(t=e.customData)||void 0===t?void 0:t.property.size)>0)&&void 0!==r?r:null)||(null!==(o=(null===(n=e.customData)||void 0===n?void 0:n.event.size)>0)&&void 0!==o?o:null))&&(i.customData=e.customData),(0,a.setDomain)("ETS"===s?a.Domain.ETS:"FORM"===s?a.Domain.FORM:a.Domain.FA)}},7977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviver=t.replacer=t.serializeSketchPage=t.serializeCustom=t.deserializeCustom=t.deserialize=t.serialize=void 0;const n=r(1933),o=r(2891),a=r(1509);function i(e,t){if(t instanceof Map)return{dataType:"Map",value:Object.fromEntries(t.entries())};if(t instanceof Set)return{dataType:"Set",value:Array.from(t.entries())};if(t instanceof n.VisualModel){const e=new n.VisualModel({type:"none"}),r={};for(const n in e)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return{dataType:"VisualModel",value:r}}return t}function s(e,t){if("object"==typeof t&&null!=t){if("Map"===t.dataType)return new Map(Object.entries(t.value));if("Set"===t.dataType)return new Set(t.value);if("VisualModel"===t.dataType){const e=new n.VisualModel({type:""});Object.assign(e,t.value),t=e}}return t}t.serialize=function(e,t){return 1===e?(0,a.serializeForVersion1)(t):JSON.stringify(null!=t?t:(0,o.getInstance)(),i,4)},t.deserialize=function(e){if("1"===JSON.parse(e).VisualVersion)return(0,a.deserializeForVersion1)(e);const t=JSON.parse(e,s);(0,o.setInstance)(t)},t.deserializeCustom=function(e,t){const r=JSON.parse(t,s);(0,o.setCustomInstance)(e,r)},t.serializeCustom=function(e){const t=(0,o.getInstanceTemplate)(!0);return t.visualModel.property=new Map([["width","100%"],["height","100%"]]),t.visualModel.children.push(e),JSON.stringify(t,i,4)},t.serializeSketchPage=function(e){const t=(0,o.getInstanceTemplate)(!1);return t.visualModel=e,JSON.stringify(t,i,4)},t.replacer=i,t.reviver=s},1933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VisualModel=void 0;const r="-visual";t.VisualModel=class{constructor(e){if(this.propertyStorage=void 0,this.dynamicPropertyStorage=void 0,this.mediaProperty=void 0,this.dynamicMediaProperty=void 0,this.mediaPropertyStorage=void 0,this.dynamicMediaPropertyStorage=void 0,this.property=void 0!==e.property?e.property:new Map,this.dynamicProperty=void 0!==e.dynamicProperty?e.dynamicProperty:new Map,this.children=void 0!==e.children?e.children:[],"wrapper"===e.type)return this.id="wrapper",void(this.type="div");e.type.endsWith(r)&&(e.type=e.type.substring(0,e.type.length-r.length)),this.id=void 0!==e.id?e.id:"",this.type=e.type}getProperty(e){const t=this.dynamicProperty.get(e);return void 0!==t&&""!==t?t:this.property.get(e)}hasMediaProperty(e){if(void 0!==this.mediaProperty)for(const[,t]of this.mediaProperty)if(null==t?void 0:t.has(e))return!0;if(void 0!==this.dynamicMediaProperty)for(const[,t]of this.dynamicMediaProperty)if(null==t?void 0:t.has(e))return!0;return!1}hasProperty(e){return this.dynamicProperty.has(e)||this.property.has(e)}accept(e){return e.visit(this)}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";var e=n;Object.defineProperty(e,"__esModule",{value:!0});const t=r(3784),o=r(2891),a=r(7977),i=r(8844),s=r(1055),p=r(3207),l=r(8413),c=r(4435),u=r(6486),y=r(4294),d={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""};function f(e,r){var n;try{(0,a.deserialize)(e);const t=(0,o.getInstance)().document.VisualVersion,n=/^([1-9]+[0-9]*)$/;if(void 0===t)r.errorType="versionError";else{const e=t.match(n);(null===e||parseInt(e[1])>12)&&(r.errorType="versionError")}}catch(e){r.errorType="fileError"}""!==r.errorType&&(r.errorMessage=null!==(n=t.errorMap.get(r.errorType))&&void 0!==n?n:"Codegen visual file failed")}e.genHmlAndCss=function(e){const r={hmlCss:{hml:"",css:"",json:""},errorType:"",errorMessage:""};if(f(e,r),""!==r.errorType)return r.hmlCss.hml="",r.hmlCss.css="",r;try{const e=function(e){const t={hml:"",css:"",json:""},r=new i.HMLBridge,n=e.accept(r),o=(0,s.genFAHML)(n);t.hml=r.getErrorCount()>0?"error":o;const a=new i.CSSBridge,p=e.accept(a),l=(0,s.genFACSS)(p);return t.css=a.getErrorCount()>0?"error":l,t}((0,o.getInstance)().visualModel);"error"!==e.hml&&"error"!==e.css||(r.errorType="codegenError"),r.hmlCss=e,"FORM"===(0,o.getInstance)().document.type&&(r.hmlCss.json=p.formManager.codegenToJson())}catch(e){r.errorType="modelError"}return""!==r.errorType&&(r.errorMessage=t.errorMap.get(r.errorType),r.hmlCss.hml="",r.hmlCss.css=""),r},e.genETS=function(e){var r;const n={ets:(0,u.cloneDeep)(d),errorType:"",errorMessage:""};if(f(e,n),""!==n.errorType)return n.ets=(0,u.cloneDeep)(d),n;try{let e=(0,o.getInstance)().visualModel;if((0,o.getInstance)().document.custom&&(e=e.children[0],void 0===e))return n;(0,y.beforeCodegen)(e);const t=function(e){const t=new l.ETSBridge,r=e.accept(t),n=(new c.StringWriter).genETS(r);return t.getErrorCount()>0?"error":n}(e);"error"===t&&(n.errorType="codegenError"),n.ets=t}catch(e){n.errorType="modelError"}return""!==n.errorType&&(n.errorMessage=null!==(r=t.errorMap.get(n.errorType))&&void 0!==r?r:"Codegen visual file failed",n.ets=(0,u.cloneDeep)(d)),n}})();var o=exports;for(var a in n)o[a]=n[a];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{var e={6486:function(e,t,r){var o;e=r.nmd(e),function(){var n,a="Expected a function",i="__lodash_hash_undefined__",s="__lodash_placeholder__",p=32,l=128,c=1/0,u=9007199254740991,y=NaN,d=4294967295,f=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",p],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",h="[object Boolean]",E="[object Date]",T="[object Error]",S="[object Function]",P="[object GeneratorFunction]",v="[object Map]",b="[object Number]",_="[object Object]",N="[object Promise]",C="[object RegExp]",A="[object Set]",O="[object String]",M="[object Symbol]",w="[object WeakMap]",R="[object ArrayBuffer]",I="[object DataView]",x="[object Float32Array]",L="[object Float64Array]",F="[object Int8Array]",k="[object Int16Array]",B="[object Int32Array]",D="[object Uint8Array]",U="[object Uint8ClampedArray]",V="[object Uint16Array]",G="[object Uint32Array]",z=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,H=RegExp($.source),Y=RegExp(q.source),X=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),oe=/^\s+/,ne=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,pe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ye=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,he=/^(?:0|[1-9]\d*)$/,Ee=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Te=/($^)/,Se=/['\n\r\u2028\u2029\\]/g,Pe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ve="a-z\\xdf-\\xf6\\xf8-\\xff",be="A-Z\\xc0-\\xd6\\xd8-\\xde",_e="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ne="["+_e+"]",Ce="["+Pe+"]",Ae="\\d+",Oe="["+ve+"]",Me="[^\\ud800-\\udfff"+_e+Ae+"\\u2700-\\u27bf"+ve+be+"]",we="\\ud83c[\\udffb-\\udfff]",Re="[^\\ud800-\\udfff]",Ie="(?:\\ud83c[\\udde6-\\uddff]){2}",xe="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+be+"]",Fe="(?:"+Oe+"|"+Me+")",ke="(?:"+Le+"|"+Me+")",Be="(?:['’](?:d|ll|m|re|s|t|ve))?",De="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ue="(?:"+Ce+"|"+we+")?",Ve="[\\ufe0e\\ufe0f]?",Ge=Ve+Ue+"(?:\\u200d(?:"+[Re,Ie,xe].join("|")+")"+Ve+Ue+")*",ze="(?:"+["[\\u2700-\\u27bf]",Ie,xe].join("|")+")"+Ge,je="(?:"+[Re+Ce+"?",Ce,Ie,xe,"[\\ud800-\\udfff]"].join("|")+")",We=RegExp("['’]","g"),$e=RegExp(Ce,"g"),qe=RegExp(we+"(?="+we+")|"+je+Ge,"g"),He=RegExp([Le+"?"+Oe+"+"+Be+"(?="+[Ne,Le,"$"].join("|")+")",ke+"+"+De+"(?="+[Ne,Le+Fe,"$"].join("|")+")",Le+"?"+Fe+"+"+Be,Le+"+"+De,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,ze].join("|"),"g"),Ye=RegExp("[\\u200d\\ud800-\\udfff"+Pe+"\\ufe0e\\ufe0f]"),Xe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Je=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Qe=-1,Ke={};Ke[x]=Ke[L]=Ke[F]=Ke[k]=Ke[B]=Ke[D]=Ke[U]=Ke[V]=Ke[G]=!0,Ke[m]=Ke[g]=Ke[R]=Ke[h]=Ke[I]=Ke[E]=Ke[T]=Ke[S]=Ke[v]=Ke[b]=Ke[_]=Ke[C]=Ke[A]=Ke[O]=Ke[w]=!1;var Ze={};Ze[m]=Ze[g]=Ze[R]=Ze[I]=Ze[h]=Ze[E]=Ze[x]=Ze[L]=Ze[F]=Ze[k]=Ze[B]=Ze[v]=Ze[b]=Ze[_]=Ze[C]=Ze[A]=Ze[O]=Ze[M]=Ze[D]=Ze[U]=Ze[V]=Ze[G]=!0,Ze[T]=Ze[S]=Ze[w]=!1;var et={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tt=parseFloat,rt=parseInt,ot="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,nt="object"==typeof self&&self&&self.Object===Object&&self,at=ot||nt||Function("return this")(),it=t&&!t.nodeType&&t,st=it&&e&&!e.nodeType&&e,pt=st&&st.exports===it,lt=pt&&ot.process,ct=function(){try{return st&&st.require&&st.require("util").types||lt&<.binding&<.binding("util")}catch(e){}}(),ut=ct&&ct.isArrayBuffer,yt=ct&&ct.isDate,dt=ct&&ct.isMap,ft=ct&&ct.isRegExp,mt=ct&&ct.isSet,gt=ct&&ct.isTypedArray;function ht(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Et(e,t,r,o){for(var n=-1,a=null==e?0:e.length;++n-1}function _t(e,t,r){for(var o=-1,n=null==e?0:e.length;++o-1;);return r}function Ht(e,t){for(var r=e.length;r--&&xt(t,e[r],0)>-1;);return r}function Yt(e,t){for(var r=e.length,o=0;r--;)e[r]===t&&++o;return o}var Xt=Dt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Jt=Dt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Qt(e){return"\\"+et[e]}function Kt(e){return Ye.test(e)}function Zt(e){var t=-1,r=Array(e.size);return e.forEach((function(e,o){r[++t]=[o,e]})),r}function er(e,t){return function(r){return e(t(r))}}function tr(e,t){for(var r=-1,o=e.length,n=0,a=[];++r",""":'"',"'":"'"}),pr=function e(t){var r,o=(t=null==t?at:pr.defaults(at.Object(),t,pr.pick(at,Je))).Array,ne=t.Date,Pe=t.Error,ve=t.Function,be=t.Math,_e=t.Object,Ne=t.RegExp,Ce=t.String,Ae=t.TypeError,Oe=o.prototype,Me=ve.prototype,we=_e.prototype,Re=t["__core-js_shared__"],Ie=Me.toString,xe=we.hasOwnProperty,Le=0,Fe=(r=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",ke=we.toString,Be=Ie.call(_e),De=at._,Ue=Ne("^"+Ie.call(xe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=pt?t.Buffer:n,Ge=t.Symbol,ze=t.Uint8Array,je=Ve?Ve.allocUnsafe:n,qe=er(_e.getPrototypeOf,_e),Ye=_e.create,et=we.propertyIsEnumerable,ot=Oe.splice,nt=Ge?Ge.isConcatSpreadable:n,it=Ge?Ge.iterator:n,st=Ge?Ge.toStringTag:n,lt=function(){try{var e=ca(_e,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==at.clearTimeout&&t.clearTimeout,wt=ne&&ne.now!==at.Date.now&&ne.now,Dt=t.setTimeout!==at.setTimeout&&t.setTimeout,lr=be.ceil,cr=be.floor,ur=_e.getOwnPropertySymbols,yr=Ve?Ve.isBuffer:n,dr=t.isFinite,fr=Oe.join,mr=er(_e.keys,_e),gr=be.max,hr=be.min,Er=ne.now,Tr=t.parseInt,Sr=be.random,Pr=Oe.reverse,vr=ca(t,"DataView"),br=ca(t,"Map"),_r=ca(t,"Promise"),Nr=ca(t,"Set"),Cr=ca(t,"WeakMap"),Ar=ca(_e,"create"),Or=Cr&&new Cr,Mr={},wr=Ua(vr),Rr=Ua(br),Ir=Ua(_r),xr=Ua(Nr),Lr=Ua(Cr),Fr=Ge?Ge.prototype:n,kr=Fr?Fr.valueOf:n,Br=Fr?Fr.toString:n;function Dr(e){if(rs(e)&&!$i(e)&&!(e instanceof zr)){if(e instanceof Gr)return e;if(xe.call(e,"__wrapped__"))return Va(e)}return new Gr(e)}var Ur=function(){function e(){}return function(t){if(!ts(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Vr(){}function Gr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function zr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function jr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function io(e,t,r,o,a,i){var s,p=1&t,l=2&t,c=4&t;if(r&&(s=a?r(e,o,a,i):r(e)),s!==n)return s;if(!ts(e))return e;var u=$i(e);if(u){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&xe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!p)return On(e,s)}else{var y=da(e),d=y==S||y==P;if(Xi(e))return vn(e,p);if(y==_||y==m||d&&!a){if(s=l||d?{}:ma(e),!p)return l?function(e,t){return Mn(e,ya(e),t)}(e,function(e,t){return e&&Mn(t,xs(t),e)}(s,e)):function(e,t){return Mn(e,ua(e),t)}(e,ro(s,e))}else{if(!Ze[y])return a?e:{};s=function(e,t,r){var o,n=e.constructor;switch(t){case R:return bn(e);case h:case E:return new n(+e);case I:return function(e,t){var r=t?bn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case x:case L:case F:case k:case B:case D:case U:case V:case G:return _n(e,r);case v:return new n;case b:case O:return new n(e);case C:return function(e){var t=new e.constructor(e.source,ye.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new n;case M:return o=e,kr?_e(kr.call(o)):{}}}(e,y,p)}}i||(i=new Hr);var f=i.get(e);if(f)return f;i.set(e,s),ss(e)?e.forEach((function(o){s.add(io(o,t,r,o,e,i))})):os(e)&&e.forEach((function(o,n){s.set(n,io(o,t,r,n,e,i))}));var g=u?n:(c?l?oa:ra:l?xs:Is)(e);return Tt(g||e,(function(o,n){g&&(o=e[n=o]),Zr(s,n,io(o,t,r,n,e,i))})),s}function so(e,t,r){var o=r.length;if(null==e)return!o;for(e=_e(e);o--;){var a=r[o],i=t[a],s=e[a];if(s===n&&!(a in e)||!i(s))return!1}return!0}function po(e,t,r){if("function"!=typeof e)throw new Ae(a);return wa((function(){e.apply(n,r)}),t)}function lo(e,t,r,o){var n=-1,a=bt,i=!0,s=e.length,p=[],l=t.length;if(!s)return p;r&&(t=Nt(t,jt(r))),o?(a=_t,i=!1):t.length>=200&&(a=$t,i=!1,t=new qr(t));e:for(;++n-1},Wr.prototype.set=function(e,t){var r=this.__data__,o=eo(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new jr,map:new(br||Wr),string:new jr}},$r.prototype.delete=function(e){var t=pa(this,e).delete(e);return this.size-=t?1:0,t},$r.prototype.get=function(e){return pa(this,e).get(e)},$r.prototype.has=function(e){return pa(this,e).has(e)},$r.prototype.set=function(e,t){var r=pa(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this},qr.prototype.add=qr.prototype.push=function(e){return this.__data__.set(e,i),this},qr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Hr.prototype.get=function(e){return this.__data__.get(e)},Hr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var o=r.__data__;if(!br||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new $r(o)}return r.set(e,t),this.size=r.size,this};var co=In(To),uo=In(So,!0);function yo(e,t){var r=!0;return co(e,(function(e,o,n){return r=!!t(e,o,n)})),r}function fo(e,t,r){for(var o=-1,a=e.length;++o0&&r(s)?t>1?go(s,t-1,r,o,n):Ct(n,s):o||(n[n.length]=s)}return n}var ho=xn(),Eo=xn(!0);function To(e,t){return e&&ho(e,t,Is)}function So(e,t){return e&&Eo(e,t,Is)}function Po(e,t){return vt(t,(function(t){return Ki(e[t])}))}function vo(e,t){for(var r=0,o=(t=En(t,e)).length;null!=e&&rt}function Co(e,t){return null!=e&&xe.call(e,t)}function Ao(e,t){return null!=e&&t in _e(e)}function Oo(e,t,r){for(var a=r?_t:bt,i=e[0].length,s=e.length,p=s,l=o(s),c=1/0,u=[];p--;){var y=e[p];p&&t&&(y=Nt(y,jt(t))),c=hr(y.length,c),l[p]=!r&&(t||i>=120&&y.length>=120)?new qr(p&&y):n}y=e[0];var d=-1,f=l[0];e:for(;++d=s?p:p*("desc"==r[o]?-1:1)}return e.index-t.index}(e,t,r)}));o--;)e[o]=e[o].value;return e}(n)}function jo(e,t,r){for(var o=-1,n=t.length,a={};++o-1;)s!==e&&ot.call(s,p,1),ot.call(e,p,1);return e}function $o(e,t){for(var r=e?t.length:0,o=r-1;r--;){var n=t[r];if(r==o||n!==a){var a=n;ha(n)?ot.call(e,n,1):cn(e,n)}}return e}function qo(e,t){return e+cr(Sr()*(t-e+1))}function Ho(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=cr(t/2))&&(e+=e)}while(t);return r}function Yo(e,t){return Ra(Na(e,t,np),e+"")}function Xo(e){return Xr(Gs(e))}function Jo(e,t){var r=Gs(e);return La(r,ao(t,0,r.length))}function Qo(e,t,r,o){if(!ts(e))return e;for(var a=-1,i=(t=En(t,e)).length,s=i-1,p=e;null!=p&&++aa?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=o(a);++n>>1,i=e[a];null!==i&&!ls(i)&&(r?i<=t:i=200){var l=t?null:Yn(e);if(l)return rr(l);i=!1,n=$t,p=new qr}else p=t?[]:s;e:for(;++o=o?e:tn(e,t,r)}var Pn=ct||function(e){return at.clearTimeout(e)};function vn(e,t){if(t)return e.slice();var r=e.length,o=je?je(r):new e.constructor(r);return e.copy(o),o}function bn(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function _n(e,t){var r=t?bn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Nn(e,t){if(e!==t){var r=e!==n,o=null===e,a=e==e,i=ls(e),s=t!==n,p=null===t,l=t==t,c=ls(t);if(!p&&!c&&!i&&e>t||i&&s&&l&&!p&&!c||o&&s&&l||!r&&l||!a)return 1;if(!o&&!i&&!c&&e1?r[a-1]:n,s=a>2?r[2]:n;for(i=e.length>3&&"function"==typeof i?(a--,i):n,s&&Ea(r[0],r[1],s)&&(i=a<3?n:i,a=1),t=_e(t);++o-1?a[i?t[s]:s]:n}}function Dn(e){return ta((function(t){var r=t.length,o=r,i=Gr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ae(a);if(i&&!p&&"wrapper"==aa(s))var p=new Gr([],!0)}for(o=p?o:r;++o1&&T.reverse(),d&&up))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var y=-1,d=!0,f=2&r?new qr:n;for(i.set(e,t),i.set(t,e);++y-1&&e%1==0&&e1?"& ":"")+t[o],t=t.join(r>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(o,function(e,t){return Tt(f,(function(r){var o="_."+r[0];t&r[1]&&!bt(e,o)&&e.push(o)})),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(se):[]}(o),r)))}function xa(e){var t=0,r=0;return function(){var o=Er(),a=16-(o-r);if(r=o,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function La(e,t){var r=-1,o=e.length,a=o-1;for(t=t===n?o:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ii(e,r)}));function di(e){var t=Dr(e);return t.__chain__=!0,t}function fi(e,t){return t(e)}var mi=ta((function(e){var t=e.length,r=t?e[0]:0,o=this.__wrapped__,a=function(t){return no(t,e)};return!(t>1||this.__actions__.length)&&o instanceof zr&&ha(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:fi,args:[a],thisArg:n}),new Gr(o,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(a)})),gi=wn((function(e,t,r){xe.call(e,r)?++e[r]:oo(e,r,1)})),hi=Bn(Wa),Ei=Bn($a);function Ti(e,t){return($i(e)?Tt:co)(e,sa(t,3))}function Si(e,t){return($i(e)?St:uo)(e,sa(t,3))}var Pi=wn((function(e,t,r){xe.call(e,r)?e[r].push(t):oo(e,r,[t])})),vi=Yo((function(e,t,r){var n=-1,a="function"==typeof t,i=Hi(e)?o(e.length):[];return co(e,(function(e){i[++n]=a?ht(t,e,r):Mo(e,t,r)})),i})),bi=wn((function(e,t,r){oo(e,r,t)}));function _i(e,t){return($i(e)?Nt:Bo)(e,sa(t,3))}var Ni=wn((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Ci=Yo((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ea(e,t[0],t[1])?t=[]:r>2&&Ea(t[0],t[1],t[2])&&(t=[t[0]]),zo(e,go(t,1),[])})),Ai=wt||function(){return at.Date.now()};function Oi(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Jn(e,l,n,n,n,n,t)}function Mi(e,t){var r;if("function"!=typeof t)throw new Ae(a);return e=ms(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var wi=Yo((function(e,t,r){var o=1;if(r.length){var n=tr(r,ia(wi));o|=p}return Jn(e,o,t,r,n)})),Ri=Yo((function(e,t,r){var o=3;if(r.length){var n=tr(r,ia(Ri));o|=p}return Jn(t,o,e,r,n)}));function Ii(e,t,r){var o,i,s,p,l,c,u=0,y=!1,d=!1,f=!0;if("function"!=typeof e)throw new Ae(a);function m(t){var r=o,a=i;return o=i=n,u=t,p=e.apply(a,r)}function g(e){return u=e,l=wa(E,t),y?m(e):p}function h(e){var r=e-c;return c===n||r>=t||r<0||d&&e-u>=s}function E(){var e=Ai();if(h(e))return T(e);l=wa(E,function(e){var r=t-(e-c);return d?hr(r,s-(e-u)):r}(e))}function T(e){return l=n,f&&o?m(e):(o=i=n,p)}function S(){var e=Ai(),r=h(e);if(o=arguments,i=this,c=e,r){if(l===n)return g(c);if(d)return Pn(l),l=wa(E,t),m(c)}return l===n&&(l=wa(E,t)),p}return t=hs(t)||0,ts(r)&&(y=!!r.leading,s=(d="maxWait"in r)?gr(hs(r.maxWait)||0,t):s,f="trailing"in r?!!r.trailing:f),S.cancel=function(){l!==n&&Pn(l),u=0,o=c=i=l=n},S.flush=function(){return l===n?p:T(Ai())},S}var xi=Yo((function(e,t){return po(e,1,t)})),Li=Yo((function(e,t,r){return po(e,hs(t)||0,r)}));function Fi(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ae(a);var r=function(){var o=arguments,n=t?t.apply(this,o):o[0],a=r.cache;if(a.has(n))return a.get(n);var i=e.apply(this,o);return r.cache=a.set(n,i)||a,i};return r.cache=new(Fi.Cache||$r),r}function ki(e){if("function"!=typeof e)throw new Ae(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Fi.Cache=$r;var Bi=Tn((function(e,t){var r=(t=1==t.length&&$i(t[0])?Nt(t[0],jt(sa())):Nt(go(t,1),jt(sa()))).length;return Yo((function(o){for(var n=-1,a=hr(o.length,r);++n=t})),Wi=wo(function(){return arguments}())?wo:function(e){return rs(e)&&xe.call(e,"callee")&&!et.call(e,"callee")},$i=o.isArray,qi=ut?jt(ut):function(e){return rs(e)&&_o(e)==R};function Hi(e){return null!=e&&es(e.length)&&!Ki(e)}function Yi(e){return rs(e)&&Hi(e)}var Xi=yr||hp,Ji=yt?jt(yt):function(e){return rs(e)&&_o(e)==E};function Qi(e){if(!rs(e))return!1;var t=_o(e);return t==T||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function Ki(e){if(!ts(e))return!1;var t=_o(e);return t==S||t==P||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zi(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var os=dt?jt(dt):function(e){return rs(e)&&da(e)==v};function ns(e){return"number"==typeof e||rs(e)&&_o(e)==b}function as(e){if(!rs(e)||_o(e)!=_)return!1;var t=qe(e);if(null===t)return!0;var r=xe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Ie.call(r)==Be}var is=ft?jt(ft):function(e){return rs(e)&&_o(e)==C},ss=mt?jt(mt):function(e){return rs(e)&&da(e)==A};function ps(e){return"string"==typeof e||!$i(e)&&rs(e)&&_o(e)==O}function ls(e){return"symbol"==typeof e||rs(e)&&_o(e)==M}var cs=gt?jt(gt):function(e){return rs(e)&&es(e.length)&&!!Ke[_o(e)]},us=$n(ko),ys=$n((function(e,t){return e<=t}));function ds(e){if(!e)return[];if(Hi(e))return ps(e)?ar(e):On(e);if(it&&e[it])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[it]());var t=da(e);return(t==v?Zt:t==A?rr:Gs)(e)}function fs(e){return e?(e=hs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=fs(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?ao(ms(e),0,d):0}function hs(e){if("number"==typeof e)return e;if(ls(e))return y;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=zt(e);var r=fe.test(e);return r||ge.test(e)?rt(e.slice(2),r?2:8):de.test(e)?y:+e}function Es(e){return Mn(e,xs(e))}function Ts(e){return null==e?"":pn(e)}var Ss=Rn((function(e,t){if(va(t)||Hi(t))Mn(t,Is(t),e);else for(var r in t)xe.call(t,r)&&Zr(e,r,t[r])})),Ps=Rn((function(e,t){Mn(t,xs(t),e)})),vs=Rn((function(e,t,r,o){Mn(t,xs(t),e,o)})),bs=Rn((function(e,t,r,o){Mn(t,Is(t),e,o)})),_s=ta(no),Ns=Yo((function(e,t){e=_e(e);var r=-1,o=t.length,a=o>2?t[2]:n;for(a&&Ea(t[0],t[1],a)&&(o=1);++r1),t})),Mn(e,oa(e),r),o&&(r=io(r,7,Zn));for(var n=t.length;n--;)cn(r,t[n]);return r})),Bs=ta((function(e,t){return null==e?{}:function(e,t){return jo(e,t,(function(t,r){return Os(e,r)}))}(e,t)}));function Ds(e,t){if(null==e)return{};var r=Nt(oa(e),(function(e){return[e]}));return t=sa(t),jo(e,r,(function(e,r){return t(e,r[0])}))}var Us=Xn(Is),Vs=Xn(xs);function Gs(e){return null==e?[]:Wt(e,Is(e))}var zs=Fn((function(e,t,r){return t=t.toLowerCase(),e+(r?js(t):t)}));function js(e){return Qs(Ts(e).toLowerCase())}function Ws(e){return(e=Ts(e))&&e.replace(Ee,Xt).replace($e,"")}var $s=Fn((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),qs=Fn((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Hs=Ln("toLowerCase"),Ys=Fn((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Xs=Fn((function(e,t,r){return e+(r?" ":"")+Qs(t)})),Js=Fn((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Qs=Ln("toUpperCase");function Ks(e,t,r){return e=Ts(e),(t=r?n:t)===n?function(e){return Xe.test(e)}(e)?function(e){return e.match(He)||[]}(e):function(e){return e.match(pe)||[]}(e):e.match(t)||[]}var Zs=Yo((function(e,t){try{return ht(e,n,t)}catch(e){return Qi(e)?e:new Pe(e)}})),ep=ta((function(e,t){return Tt(t,(function(t){t=Da(t),oo(e,t,wi(e[t],e))})),e}));function tp(e){return function(){return e}}var rp=Dn(),op=Dn(!0);function np(e){return e}function ap(e){return Lo("function"==typeof e?e:io(e,1))}var ip=Yo((function(e,t){return function(r){return Mo(r,e,t)}})),sp=Yo((function(e,t){return function(r){return Mo(e,r,t)}}));function pp(e,t,r){var o=Is(t),n=Po(t,o);null!=r||ts(t)&&(n.length||!o.length)||(r=t,t=e,e=this,n=Po(t,Is(t)));var a=!(ts(r)&&"chain"in r&&!r.chain),i=Ki(e);return Tt(n,(function(r){var o=t[r];e[r]=o,i&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__),n=r.__actions__=On(this.__actions__);return n.push({func:o,args:arguments,thisArg:e}),r.__chain__=t,r}return o.apply(e,Ct([this.value()],arguments))})})),e}function lp(){}var cp=zn(Nt),up=zn(Pt),yp=zn(Mt);function dp(e){return Ta(e)?Bt(Da(e)):function(e){return function(t){return vo(t,e)}}(e)}var fp=Wn(),mp=Wn(!0);function gp(){return[]}function hp(){return!1}var Ep,Tp=Gn((function(e,t){return e+t}),0),Sp=Hn("ceil"),Pp=Gn((function(e,t){return e/t}),1),vp=Hn("floor"),bp=Gn((function(e,t){return e*t}),1),_p=Hn("round"),Np=Gn((function(e,t){return e-t}),0);return Dr.after=function(e,t){if("function"!=typeof t)throw new Ae(a);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},Dr.ary=Oi,Dr.assign=Ss,Dr.assignIn=Ps,Dr.assignInWith=vs,Dr.assignWith=bs,Dr.at=_s,Dr.before=Mi,Dr.bind=wi,Dr.bindAll=ep,Dr.bindKey=Ri,Dr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $i(e)?e:[e]},Dr.chain=di,Dr.chunk=function(e,t,r){t=(r?Ea(e,t,r):t===n)?1:gr(ms(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var i=0,s=0,p=o(lr(a/t));ia?0:a+r),(o=o===n||o>a?a:ms(o))<0&&(o+=a),o=r>o?0:gs(o);r>>0)?(e=Ts(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=pn(t))&&Kt(e)?Sn(ar(e),0,r):e.split(t,r):[]},Dr.spread=function(e,t){if("function"!=typeof e)throw new Ae(a);return t=null==t?0:gr(ms(t),0),Yo((function(r){var o=r[t],n=Sn(r,0,t);return o&&Ct(n,o),ht(e,this,n)}))},Dr.tail=function(e){var t=null==e?0:e.length;return t?tn(e,1,t):[]},Dr.take=function(e,t,r){return e&&e.length?tn(e,0,(t=r||t===n?1:ms(t))<0?0:t):[]},Dr.takeRight=function(e,t,r){var o=null==e?0:e.length;return o?tn(e,(t=o-(t=r||t===n?1:ms(t)))<0?0:t,o):[]},Dr.takeRightWhile=function(e,t){return e&&e.length?yn(e,sa(t,3),!1,!0):[]},Dr.takeWhile=function(e,t){return e&&e.length?yn(e,sa(t,3)):[]},Dr.tap=function(e,t){return t(e),e},Dr.throttle=function(e,t,r){var o=!0,n=!0;if("function"!=typeof e)throw new Ae(a);return ts(r)&&(o="leading"in r?!!r.leading:o,n="trailing"in r?!!r.trailing:n),Ii(e,t,{leading:o,maxWait:t,trailing:n})},Dr.thru=fi,Dr.toArray=ds,Dr.toPairs=Us,Dr.toPairsIn=Vs,Dr.toPath=function(e){return $i(e)?Nt(e,Da):ls(e)?[e]:On(Ba(Ts(e)))},Dr.toPlainObject=Es,Dr.transform=function(e,t,r){var o=$i(e),n=o||Xi(e)||cs(e);if(t=sa(t,4),null==r){var a=e&&e.constructor;r=n?o?new a:[]:ts(e)&&Ki(a)?Ur(qe(e)):{}}return(n?Tt:To)(e,(function(e,o,n){return t(r,e,o,n)})),r},Dr.unary=function(e){return Oi(e,1)},Dr.union=ri,Dr.unionBy=oi,Dr.unionWith=ni,Dr.uniq=function(e){return e&&e.length?ln(e):[]},Dr.uniqBy=function(e,t){return e&&e.length?ln(e,sa(t,2)):[]},Dr.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ln(e,n,t):[]},Dr.unset=function(e,t){return null==e||cn(e,t)},Dr.unzip=ai,Dr.unzipWith=ii,Dr.update=function(e,t,r){return null==e?e:un(e,t,hn(r))},Dr.updateWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:un(e,t,hn(r),o)},Dr.values=Gs,Dr.valuesIn=function(e){return null==e?[]:Wt(e,xs(e))},Dr.without=si,Dr.words=Ks,Dr.wrap=function(e,t){return Di(hn(t),e)},Dr.xor=pi,Dr.xorBy=li,Dr.xorWith=ci,Dr.zip=ui,Dr.zipObject=function(e,t){return mn(e||[],t||[],Zr)},Dr.zipObjectDeep=function(e,t){return mn(e||[],t||[],Qo)},Dr.zipWith=yi,Dr.entries=Us,Dr.entriesIn=Vs,Dr.extend=Ps,Dr.extendWith=vs,pp(Dr,Dr),Dr.add=Tp,Dr.attempt=Zs,Dr.camelCase=zs,Dr.capitalize=js,Dr.ceil=Sp,Dr.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=hs(r))==r?r:0),t!==n&&(t=(t=hs(t))==t?t:0),ao(hs(e),t,r)},Dr.clone=function(e){return io(e,4)},Dr.cloneDeep=function(e){return io(e,5)},Dr.cloneDeepWith=function(e,t){return io(e,5,t="function"==typeof t?t:n)},Dr.cloneWith=function(e,t){return io(e,4,t="function"==typeof t?t:n)},Dr.conformsTo=function(e,t){return null==t||so(e,t,Is(t))},Dr.deburr=Ws,Dr.defaultTo=function(e,t){return null==e||e!=e?t:e},Dr.divide=Pp,Dr.endsWith=function(e,t,r){e=Ts(e),t=pn(t);var o=e.length,a=r=r===n?o:ao(ms(r),0,o);return(r-=t.length)>=0&&e.slice(r,a)==t},Dr.eq=Gi,Dr.escape=function(e){return(e=Ts(e))&&Y.test(e)?e.replace(q,Jt):e},Dr.escapeRegExp=function(e){return(e=Ts(e))&&re.test(e)?e.replace(te,"\\$&"):e},Dr.every=function(e,t,r){var o=$i(e)?Pt:yo;return r&&Ea(e,t,r)&&(t=n),o(e,sa(t,3))},Dr.find=hi,Dr.findIndex=Wa,Dr.findKey=function(e,t){return Rt(e,sa(t,3),To)},Dr.findLast=Ei,Dr.findLastIndex=$a,Dr.findLastKey=function(e,t){return Rt(e,sa(t,3),So)},Dr.floor=vp,Dr.forEach=Ti,Dr.forEachRight=Si,Dr.forIn=function(e,t){return null==e?e:ho(e,sa(t,3),xs)},Dr.forInRight=function(e,t){return null==e?e:Eo(e,sa(t,3),xs)},Dr.forOwn=function(e,t){return e&&To(e,sa(t,3))},Dr.forOwnRight=function(e,t){return e&&So(e,sa(t,3))},Dr.get=As,Dr.gt=zi,Dr.gte=ji,Dr.has=function(e,t){return null!=e&&fa(e,t,Co)},Dr.hasIn=Os,Dr.head=Ha,Dr.identity=np,Dr.includes=function(e,t,r,o){e=Hi(e)?e:Gs(e),r=r&&!o?ms(r):0;var n=e.length;return r<0&&(r=gr(n+r,0)),ps(e)?r<=n&&e.indexOf(t,r)>-1:!!n&&xt(e,t,r)>-1},Dr.indexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var n=null==r?0:ms(r);return n<0&&(n=gr(o+n,0)),xt(e,t,n)},Dr.inRange=function(e,t,r){return t=fs(t),r===n?(r=t,t=0):r=fs(r),function(e,t,r){return e>=hr(t,r)&&e=-9007199254740991&&e<=u},Dr.isSet=ss,Dr.isString=ps,Dr.isSymbol=ls,Dr.isTypedArray=cs,Dr.isUndefined=function(e){return e===n},Dr.isWeakMap=function(e){return rs(e)&&da(e)==w},Dr.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==_o(e)},Dr.join=function(e,t){return null==e?"":fr.call(e,t)},Dr.kebabCase=$s,Dr.last=Qa,Dr.lastIndexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var a=o;return r!==n&&(a=(a=ms(r))<0?gr(o+a,0):hr(a,o-1)),t==t?function(e,t,r){for(var o=r+1;o--;)if(e[o]===t)return o;return o}(e,t,a):It(e,Ft,a,!0)},Dr.lowerCase=qs,Dr.lowerFirst=Hs,Dr.lt=us,Dr.lte=ys,Dr.max=function(e){return e&&e.length?fo(e,np,No):n},Dr.maxBy=function(e,t){return e&&e.length?fo(e,sa(t,2),No):n},Dr.mean=function(e){return kt(e,np)},Dr.meanBy=function(e,t){return kt(e,sa(t,2))},Dr.min=function(e){return e&&e.length?fo(e,np,ko):n},Dr.minBy=function(e,t){return e&&e.length?fo(e,sa(t,2),ko):n},Dr.stubArray=gp,Dr.stubFalse=hp,Dr.stubObject=function(){return{}},Dr.stubString=function(){return""},Dr.stubTrue=function(){return!0},Dr.multiply=bp,Dr.nth=function(e,t){return e&&e.length?Go(e,ms(t)):n},Dr.noConflict=function(){return at._===this&&(at._=De),this},Dr.noop=lp,Dr.now=Ai,Dr.pad=function(e,t,r){e=Ts(e);var o=(t=ms(t))?nr(e):0;if(!t||o>=t)return e;var n=(t-o)/2;return jn(cr(n),r)+e+jn(lr(n),r)},Dr.padEnd=function(e,t,r){e=Ts(e);var o=(t=ms(t))?nr(e):0;return t&&ot){var o=e;e=t,t=o}if(r||e%1||t%1){var a=Sr();return hr(e+a*(t-e+tt("1e-"+((a+"").length-1))),t)}return qo(e,t)},Dr.reduce=function(e,t,r){var o=$i(e)?At:Ut,n=arguments.length<3;return o(e,sa(t,4),r,n,co)},Dr.reduceRight=function(e,t,r){var o=$i(e)?Ot:Ut,n=arguments.length<3;return o(e,sa(t,4),r,n,uo)},Dr.repeat=function(e,t,r){return t=(r?Ea(e,t,r):t===n)?1:ms(t),Ho(Ts(e),t)},Dr.replace=function(){var e=arguments,t=Ts(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dr.result=function(e,t,r){var o=-1,a=(t=En(t,e)).length;for(a||(a=1,e=n);++ou)return[];var r=d,o=hr(e,d);t=sa(t),e-=d;for(var n=Gt(o,t);++r=i)return e;var p=r-nr(o);if(p<1)return o;var l=s?Sn(s,0,p).join(""):e.slice(0,p);if(a===n)return l+o;if(s&&(p+=l.length-p),is(a)){if(e.slice(p).search(a)){var c,u=l;for(a.global||(a=Ne(a.source,Ts(ye.exec(a))+"g")),a.lastIndex=0;c=a.exec(u);)var y=c.index;l=l.slice(0,y===n?p:y)}}else if(e.indexOf(pn(a),p)!=p){var d=l.lastIndexOf(a);d>-1&&(l=l.slice(0,d))}return l+o},Dr.unescape=function(e){return(e=Ts(e))&&H.test(e)?e.replace($,sr):e},Dr.uniqueId=function(e){var t=++Le;return Ts(e)+t},Dr.upperCase=Js,Dr.upperFirst=Qs,Dr.each=Ti,Dr.eachRight=Si,Dr.first=Ha,pp(Dr,(Ep={},To(Dr,(function(e,t){xe.call(Dr.prototype,t)||(Ep[t]=e)})),Ep),{chain:!1}),Dr.VERSION="4.17.21",Tt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Dr[e].placeholder=Dr})),Tt(["drop","take"],(function(e,t){zr.prototype[e]=function(r){r=r===n?1:gr(ms(r),0);var o=this.__filtered__&&!t?new zr(this):this.clone();return o.__filtered__?o.__takeCount__=hr(r,o.__takeCount__):o.__views__.push({size:hr(r,d),type:e+(o.__dir__<0?"Right":"")}),o},zr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Tt(["filter","map","takeWhile"],(function(e,t){var r=t+1,o=1==r||3==r;zr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:sa(e,3),type:r}),t.__filtered__=t.__filtered__||o,t}})),Tt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");zr.prototype[e]=function(){return this[r](1).value()[0]}})),Tt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");zr.prototype[e]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(np)},zr.prototype.find=function(e){return this.filter(e).head()},zr.prototype.findLast=function(e){return this.reverse().find(e)},zr.prototype.invokeMap=Yo((function(e,t){return"function"==typeof e?new zr(this):this.map((function(r){return Mo(r,e,t)}))})),zr.prototype.reject=function(e){return this.filter(ki(sa(e)))},zr.prototype.slice=function(e,t){e=ms(e);var r=this;return r.__filtered__&&(e>0||t<0)?new zr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ms(t))<0?r.dropRight(-t):r.take(t-e)),r)},zr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zr.prototype.toArray=function(){return this.take(d)},To(zr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),a=Dr[o?"take"+("last"==t?"Right":""):t],i=o||/^find/.test(t);a&&(Dr.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,p=t instanceof zr,l=s[0],c=p||$i(t),u=function(e){var t=a.apply(Dr,Ct([e],s));return o&&y?t[0]:t};c&&r&&"function"==typeof l&&1!=l.length&&(p=c=!1);var y=this.__chain__,d=!!this.__actions__.length,f=i&&!y,m=p&&!d;if(!i&&c){t=m?t:new zr(this);var g=e.apply(t,s);return g.__actions__.push({func:fi,args:[u],thisArg:n}),new Gr(g,y)}return f&&m?e.apply(this,s):(g=this.thru(u),f?o?g.value()[0]:g.value():g)})})),Tt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Oe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);Dr.prototype[e]=function(){var e=arguments;if(o&&!this.__chain__){var n=this.value();return t.apply($i(n)?n:[],e)}return this[r]((function(r){return t.apply($i(r)?r:[],e)}))}})),To(zr.prototype,(function(e,t){var r=Dr[t];if(r){var o=r.name+"";xe.call(Mr,o)||(Mr[o]=[]),Mr[o].push({name:t,func:r})}})),Mr[Un(n,2).name]=[{name:"wrapper",func:n}],zr.prototype.clone=function(){var e=new zr(this.__wrapped__);return e.__actions__=On(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=On(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=On(this.__views__),e},zr.prototype.reverse=function(){if(this.__filtered__){var e=new zr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=$i(e),o=t<0,n=r?e.length:0,a=function(e,t,r){for(var o=-1,n=r.length;++o=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Dr.prototype.plant=function(e){for(var t,r=this;r instanceof Vr;){var o=Va(r);o.__index__=0,o.__values__=n,t?a.__wrapped__=o:t=o;var a=o;r=r.__wrapped__}return a.__wrapped__=e,t},Dr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zr){var t=e;return this.__actions__.length&&(t=new zr(this)),(t=t.reverse()).__actions__.push({func:fi,args:[ti],thisArg:n}),new Gr(t,this.__chain__)}return this.thru(ti)},Dr.prototype.toJSON=Dr.prototype.valueOf=Dr.prototype.value=function(){return dn(this.__wrapped__,this.__actions__)},Dr.prototype.first=Dr.prototype.head,it&&(Dr.prototype[it]=function(){return this}),Dr}();at._=pr,(o=function(){return pr}.call(t,r,t,e))===n||(e.exports=o)}.call(this)},904:(e,t)=>{"use strict";var r;let o;Object.defineProperty(t,"__esModule",{value:!0}),t.setDomain=t.getDomain=t.Domain=void 0,function(e){e[e.FA=0]="FA",e[e.FORM=1]="FORM",e[e.ETS=2]="ETS"}(r||(r={})),t.Domain=r,t.setDomain=e=>{o=e},t.getDomain=()=>null!=o?o:r.FA},3784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMap=void 0,t.errorMap=new Map([["fileError","Visual file is damaged"],["versionError","Version number of visual file does not match"],["modelError","Visual model in visual file is damaged"],["codegenError","Codegen visual file failed"]])},4117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNode=void 0,t.ASTNode=class{accept(e){return e.visit(this)}}},1862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0,t.Cache=class{constructor(e,t=0){this.value="",this.indent=t,this.flag=!0,this.INDENT=e}indentOn(){this.flag=!0}indentOff(){this.flag=!1}incIndent(){this.indent++}decIndent(){this.indent--}checkIndent(){return this.indent<0}getIndents(){if(this.flag){let e="";for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const o=r(4117);class n extends o.ASTNode{constructor(e,t,r,o,n){super(),this.builders=new Map,this.defaultValue=new Map,this.mediaParams=new Map,this.mediaProperties=new Map,this.mediaKeyProperty=new Map,this.tagName=e,this.params=t,this.content=r,this.properties=o,this.forEachObj=n,this.ifBoolean=null,this.isCustomTag=!1}setMediaParams(e){this.mediaParams=e}setParams(e){this.params=e}setIfBoolean(e){this.ifBoolean=e}setTagName(e){this.tagName=e}setForEachObj(e){this.forEachObj=e}setMediaProperty(e,t){t.forEach(((t,r)=>{var o;this.mediaKeyProperty.has(r)||this.mediaKeyProperty.set(r,new Map),null===(o=this.mediaKeyProperty.get(r))||void 0===o||o.set(e,t)}))}setDefaultValue(e,t,r="undefined",o=""){this.defaultValue.set(e,[r,t,o])}}t.Tag=n},5623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const o=r(9519),n=r(1862),a=r(5051),i=r(4294),s=r(6486),p=r(9459);class l{constructor(e){this.cache=e,this.etsImport=new n.Cache(" ",0),this.etsVariable=new n.Cache(" ",1),this.etsFunction=new n.Cache(" ",1),this.etsBuilder=new n.Cache(" ",1),this.aboutToAppear=new n.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}visit(e){e instanceof o.Tag&&(e.isCustomTag?this.genCustomTag(e):(this.needMediaQuery&&this.genMediaQuery(e),this.genTag(e)))}static getMethodGen(e){return void 0===l.instance?l.instance=new l(e):l.instance.setCache(e),l.instance}setCache(e){this.cache=e,this.etsImport=new n.Cache(" ",0),this.etsVariable=new n.Cache(" ",1),this.etsFunction=new n.Cache(" ",1),this.etsBuilder=new n.Cache(" ",1),this.aboutToAppear=new n.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}genParams(e){const t=this.getParams(e);this.isCustomComponent(e)?this.genCustomParams(t):this.genCommonParams(t)}genCommonParams(e){if("string"==typeof e)this.cache.concat(e);else if(e.size>0){this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE);let t=0;e.forEach(((r,o)=>{this.cache.concat(o,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(t,a.TokenClass.COLON,a.TokenClass.SPACE,e,a.TokenClass.COMMA)})),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genObjectProperty(e){let t=0;this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE),e.forEach(((r,o)=>{this.cache.concat(o,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{e.accept(this),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.decIndent(),this.cache.indentOn()),this.cache.indentOn(),this.cache.concat(a.TokenClass.RBRA)),(null!==e.properties||null!==e.mediaProperties)&&(null!==e.content&&0!==e.content.length||this.cache.incIndent(),this.getProperties(e).forEach(((e,t)=>{this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.PROPERTY_START,t,a.TokenClass.TAG_START),this.cache.indentOff(),"string"==typeof e?this.cache.concat(e,a.TokenClass.TAG_END):this.genObjectProperty(e)})),null!==e.content&&0!==e.content.length||this.cache.decIndent()),this.genEnd(e),this.genBuildersFunction(e)}genStart(e){this.genIfStart(e),this.genForTagStart(e),this.genCustomImport(e)}genEnd(e){this.genForTagEnd(e),this.genIfEnd(e)}genForTagStart(e){var t;void 0!==(null===(t=e.forEachObj)||void 0===t?void 0:t.for)&&(this.cache.concat("ForEach",a.TokenClass.TAG_START,e.forEachObj.for.toString(),a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE))}genForTagEnd(e){null!==e.forEachObj&&(this.cache.concat(a.TokenClass.RBRA),void 0!==e.forEachObj.key&&""!==e.forEachObj.key&&(this.cache.concat(a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.concat("return ",e.forEachObj.key.toString(),a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.TAG_END,a.TokenClass.RBRA),this.cache.indentOff()),this.cache.concat(a.TokenClass.TAG_END))}genIfStart(e){null!==e.ifBoolean&&(this.cache.concat("if",a.TokenClass.SPACE,a.TokenClass.TAG_START,e.ifBoolean.toString(),a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.incIndent())}genIfEnd(e){null!==e.ifBoolean&&(this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genMediaQuery(e){const t=new Map,r=new Map;if(this.collectMediaQueryMap(e,t),this.collectDefaultValueMap(e,r),0===t.size&&0===r.size)return;const o=(0,i.getUniqueName)("mediaQuery"),s=(0,i.getUniqueName)("initForMediaQuery"),p=(0,i.getUniqueName)("mediaQueryCb"),l=(0,i.getUniqueName)("saveMediaQueryResult"),c=(0,i.getUniqueName)("updateForMediaQuery"),u=new n.Cache(a.TokenClass.INDENT,1),y=new n.Cache(a.TokenClass.INDENT,1),d=new n.Cache(a.TokenClass.INDENT,1),f=new n.Cache(a.TokenClass.INDENT,1),m=new n.Cache(a.TokenClass.INDENT,1),g=new n.Cache(a.TokenClass.INDENT,1),h=new n.Cache(a.TokenClass.INDENT,1),E=new n.Cache(a.TokenClass.INDENT,2);this.genVariableDeclare(r,u,a.TokenClass.UNDEFINED),this.genMediaQueryCb(p,y),this.genMediaQueryListener(t,d,f),this.genInitFuc(s,r,m),this.genMediaQueryCbFnc(l,c,t,g),this.genUpdateFnc(c,s,t,h),this.genAboutToAppear(p,l,t,E),this.etsImport.indentOff(),this.aboutToAppear.indentOff(),this.etsVariable.indentOff(),this.etsFunction.indentOff(),this.etsImport.indentOff(),this.etsImport.concat("import ",o," from '@ohos.mediaquery'",a.TokenClass.NEW_LINE),this.aboutToAppear.concat(E.toString()),this.etsVariable.concat(u.toString(),y.toString(),d.toString(),f.toString()),this.etsFunction.concat(g.toString(),a.TokenClass.NEW_LINE,m.toString(),a.TokenClass.NEW_LINE,h.toString()),this.etsImport.indentOn(),this.aboutToAppear.indentOn(),this.etsVariable.indentOn(),this.etsFunction.indentOn(),this.needMediaQuery=!1}genBuildersFunction(e){e.builders.forEach(((e,t)=>{this.etsBuilder.indentOff(),this.etsBuilder.concat(a.TokenClass.NEW_LINE),this.etsBuilder.indentOn(),this.etsBuilder.concat(a.TokenClass.DECORATOR_Builder,a.TokenClass.SPACE,t,a.TokenClass.TAG_START,a.TokenClass.TAG_END),this.etsBuilder.indentOff();const r=(0,p.genBuilderEts)(e);this.etsBuilder.concat(a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.etsBuilder.indentOn(),this.etsBuilder.concat(r.cache.toString(),a.TokenClass.NEW_LINE),this.etsBuilder.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE),this.etsBuilder.indentOff(),this.etsBuilder.concat(r.etsBuilder.toString())}))}genCustomTag(e){this.genVariableDeclare(e.defaultValue,this.cache)}genVariableDeclare(e,t,r){t.indentOn(),e.forEach(((e,o)=>{const n=e[2];""!==n&&(t.concat(n,a.TokenClass.SPACE),t.indentOff()),t.concat(o.slice(5),a.TokenClass.COLON,a.TokenClass.SPACE,e[1]),t.indentOff();const i=null!=r?r:e[0];null!=i&&t.concat(a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,i),t.concat(a.TokenClass.NEW_LINE),t.indentOn()}))}genMediaQueryCb(e,t){t.concat(e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.NULL,a.TokenClass.NEW_LINE)}genMediaQueryListener(e,t,r){const o=(0,i.getUniqueName)("mediaQuery");e.forEach(((e,n)=>{const s=(0,i.getUniqueName)(this.getMediaQueryVariableName(n));t.concat(s,a.TokenClass.COLON,a.TokenClass.SPACE,a.TokenClass.BOOLEAN,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.FALSE,a.TokenClass.NEW_LINE),r.concat(`listener_${s}`,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,o,a.TokenClass.PROPERTY_START,"matchMediaSync",a.TokenClass.TAG_START,`'${n}'`,a.TokenClass.TAG_END,a.TokenClass.NEW_LINE)}))}genInitFuc(e,t,r){r.concat(e,a.TokenClass.TAG_START,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),r.indentOn(),r.incIndent(),t.forEach(((e,t)=>{r.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e[0],a.TokenClass.NEW_LINE)})),r.decIndent(),r.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genMediaQueryCbFnc(e,t,r,o){const n=Array.from(r.entries());o.concat(e,a.TokenClass.TAG_START,"mediaQueryResult",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent(),o.concat(a.TokenClass.SWITCH,a.TokenClass.SPACE,a.TokenClass.TAG_START,"mediaQueryResult.media",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent();for(let e=0;e{const r=(0,i.getUniqueName)(this.getMediaQueryVariableName(t));o.concat(a.TokenClass.IF,a.TokenClass.SPACE,a.TokenClass.TAG_START,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,r,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent(),e.forEach(((e,t)=>{o.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e,a.TokenClass.NEW_LINE)})),o.decIndent(),o.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)})),o.decIndent(),o.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genAboutToAppear(e,t,r,o){let n=1;o.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,`${t}.bind(this)`,a.TokenClass.NEW_LINE),r.forEach(((t,s)=>{const p=`listener_${(0,i.getUniqueName)(this.getMediaQueryVariableName(s))}`;o.indentOn(),o.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,p,a.TokenClass.PROPERTY_START,`on('change', this.${e})`),n0&&e.mediaParams.forEach(((e,r)=>{t.set(r,e)})),t}getProperties(e){const t=new Map;return e.properties.forEach(((e,r)=>{t.set(r,e)})),e.mediaProperties.forEach(((e,r)=>{t.set(r,e)})),t}collectDefaultValueMap(e,t){void 0!==e.defaultValue&&e.defaultValue.forEach(((e,r)=>{t.set(r,e)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectDefaultValueMap(e,t)}))}collectMediaQueryMap(e,t){void 0!==e.mediaKeyProperty&&e.mediaKeyProperty.forEach(((e,r)=>{var o;const n=null!==(o=t.get(r))&&void 0!==o?o:new Map;e.forEach(((e,t)=>{n.set(t,e)})),t.set(r,n)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectMediaQueryMap(e,t)}))}getMediaQueryVariableName(e){const t="device-type: ",r="orientation: ",o=e.substring(e.indexOf(t),e.length),n=o.substring(t.length,o.indexOf(")")),a=e.substring(e.indexOf(r),e.length),i=a.substring(r.length,a.indexOf(")"));return`${n}${i.slice(0,1).toUpperCase()+i.slice(1).toLowerCase()}`}}t.ASTNodeGenerator=l,l.instance=void 0},8413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ETSBridge=void 0;const o=r(9519),n=r(1912),a=r(3729),i=r(6125),s=r(366),p=r(7893);t.ETSBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map;let r=null;const l=new Map,c=new o.Tag(e.type,t,r,l,null);if((0,n.parseVisualModel)(e,c),(0,a.parseMediaVisualModel)(e,c),(0,i.parseCustomVisualModel)(e,c),(0,s.parseCustomMediaVisualModel)(e,c),(0,p.parseBuildersVisualModel)(e,c,this),e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}return c.content=r,c}}},9459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genBuilderEts=t.genCustomEts=t.genETS=t.EMPTY=void 0;const o=r(5623),n=r(1862);t.EMPTY={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""},t.genETS=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" ",2));return e.accept(t),{build:t.cache.toString(),etsImport:t.etsImport.toString(),etsVariable:t.etsVariable.toString(),etsFunction:t.etsFunction.toString().concat(t.etsBuilder.toString()),aboutToAppear:t.aboutToAppear.toString()}},t.genCustomEts=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" ",1));return e.accept(t),t.cache.toString()},t.genBuilderEts=function(e){const t=new o.ASTNodeGenerator(new n.Cache(" ",1));return e.accept(t),t}},4435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;const o=r(9459);t.StringWriter=class{genETS(e){return(0,o.genETS)(e)}}},5051:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.INDENT=" ",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.SPACE=" ",r.LQUOTE="'",r.RQUOTE="'",r.TAG_START="(",r.TAG_END=")",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDynamicValueByDecorator=t.getMediaVariableDecorator=t.getCustomAttrType=t.getCustomAttributeMap=t.setCustomAttribute=void 0;const o=r(2891),n=new Map;function a(){return n}function i(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.decorator)&&void 0!==r?r:"normal"}t.setCustomAttribute=function(e){var t,r;const a=e.type;(null!==(r=null===(t=(0,o.getInstance)().customData)||void 0===t?void 0:t.property.get(a))&&void 0!==r?r:new Map).forEach(((e,t)=>{const r=`${t}-${a.replace(/\//g,"-")}`;n.set(r,e)}))},t.getCustomAttributeMap=a,t.getCustomAttrType=function(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.type)&&void 0!==r?r:""},t.getMediaVariableDecorator=function(e){const t=i(e);let r="";return"@Link"!==t&&"@Prop"!==t||(r="@State"),r},t.getDynamicValueByDecorator=function(e,t){let r=t;return"@Link"===i(e)&&(r=t.replace("this.","$")),r}},6125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumParserMap=t.genCustomEvent=t.parseCustomVisualModel=void 0;const o=r(2891),n=r(3135),a=r(1195),i=r(8122),s=r(1790);function p(e,t){if(!(t.params instanceof Map))return;const r=function(e){var t,r;const n=e.type;return[...null!==(r=null===(t=(0,o.getInstance)().customData)||void 0===t?void 0:t.event.get(n))&&void 0!==r?r:[]]}(e);for(const o of r){const r=e.property.get(o);void 0!==r&&""!==r&&("this"===r.split(".")[0]?t.params.set(o,r+".bind(this)"):t.params.set(o,r))}}t.parseCustomVisualModel=function(e,r){(0,a.setCustomAttribute)(e),(0,a.getCustomAttributeMap)().forEach(((o,n)=>{if(function(e,t){return e.property.has(t)||e.dynamicProperty.has(t)}(e,n)){const a=c.get(o.type);"function"==typeof a&&a(n,e,r);const s=t.enumParserMap.get(o.type);"function"==typeof s&&function(e,t,r,o){if((0,i.dynamicParamParser)(e,t,r))return;const n=t.property.get(e);!(0,i.isEmptyOrUndefined)(n)&&r.params instanceof Map&&r.params.set((0,i.getEtsPropName)(e),o(n))}(n,e,r,s)}})),p(e,r)},t.genCustomEvent=p;const l=(0,i.curry)(i.getEtsEnumValue),c=new Map([["string",i.stringParamParser],["boolean",i.rawDataParamParser],["number",i.rawDataParamParser],["any[]",i.rawDataParamParser],["object",i.rawDataParamParser],["Date",function(e,t,r){(0,i.dateParamParser)(e,(0,i.getEtsPropName)(e),t,r)}]]);t.enumParserMap=new Map([["Alignment",function(e){const t=(0,i.getBackgroundImagePositionEnumValue)(e);return""!==t?t:(0,i.getEtsEnumValue)("Alignment.",e)}],["Direction",l("Direction.")],["ItemAlign",i.dealWithAlignSelf],["BorderStyle",l("BorderStyle.")],["ImageRepeat",i.dealWithBackgroundRepeat],["ImageSize",l("ImageSize.")],["Visibility",l("Visibility.")],["FontStyle",l("FontStyle.")],["FontWeight",i.dealWithFontWeight],["ButtonType",l("ButtonType.")],["Color",l("Color.")],["LineCapStyle",l("LineCapStyle.")],["ImageFit",l("ImageFit.")],["ImageInterpolation",l("ImageInterpolation.")],["ImageRenderMode",l("ImageRenderMode.")],["ProgressStyle",l("ProgressStyle.")],["SliderStyle",l("SliderStyle.")],["TextAlign",l("TextAlign.")],["TextOverflow",l("TextOverflow.")],["TextDecorationType",l("TextDecorationType.")],["TextCase",l("TextCase.")],["HorizontalAlign",s.dealWithColumnAlignItems],["FlexAlign",n.dealWithJustifyAlignContent],["VerticalAlign",s.dealWithRowAlignItems],["FlexDirection",l("FlexDirection.")],["FlexWrap",i.dealWithWrap],["Axis",l("Axis.")],["EdgeEffect",l("EdgeEffect.")],["Sticky",l("Sticky.")],["EnterKeyType",l("EnterKeyType.")],["ToggleType",l("ToggleType.")],["InputType",l("InputType.")],["ScrollDirection",l("ScrollDirection.")],["EdgeEffect",l("EdgeEffect.")],["GridDirection",l("GridDirection.")],["BarState",l("BarState.")],["NavigationTitleMode",l("NavigationTitleMode.")],["CopyOption",l("CopyOption.")],["BarPosition",l("BarPosition.")],["BarMode",l("BarMode.")]])},9223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonMediaParserArray=t.ifParser=t.forEachParser=void 0;const o=r(6282),n=r(8122),a=r(9248),i=(0,n.curry)(((e,t)=>t.hasMediaProperty(e)));function s(e,t,r){var o,a,i,s;const p=null!==(o=e.property.get("left"))&&void 0!==o?o:e.dynamicProperty.get("left"),l=null!==(a=e.property.get("top"))&&void 0!==a?a:e.dynamicProperty.get("top"),c=t.get("left"),u=t.get("top"),y=r.get("left"),d=r.get("top");let f="undefined",m="undefined";return(0,n.isEmptyOrUndefined)(c)&&(0,n.isEmptyOrUndefined)(u)||(f=(0,n.quoteString)(null!==(i=null!=c?c:p)&&void 0!==i?i:"0"),m=(0,n.quoteString)(null!==(s=null!=u?u:l)&&void 0!==s?s:"0")),(0,n.isEmptyOrUndefined)(y)&&(0,n.isEmptyOrUndefined)(d)||(f=null!=y?y:f,m=null!=d?d:m),{leftValue:f,topValue:m}}function p(e,t){e.forEach(((e,r)=>{"undefined"!==e&&t.set(r,"undefined")}))}function l(e,t){var r,o;const a=new Map,i=t.split("-")[0];return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((r,o)=>{var s,p,l,c;const u=r.get(i),y=null===(p=null===(s=e.dynamicMediaProperty)||void 0===s?void 0:s.get(o))||void 0===p?void 0:p.get(i),d=null!==(c=null!==(l=r.get(t))&&void 0!==l?l:y)&&void 0!==c?c:u;void 0!==d&&a.set(o,(0,n.quoteString)(d))})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{var o;const n=e.get(i),s=null!==(o=e.get(t))&&void 0!==o?o:n;void 0!==s&&a.set(r,s)})),a}const c=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.quoteString);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.quoteString),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),u=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),y=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),d=(0,n.curry)(((e,t,r,a)=>{const i=(0,o.getMediaProperty)(r,e,(0,n.curry)(n.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,n.curry)(n.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);a.setDefaultValue(p,(0,o.getType)(e),s),a.setMediaProperty(p,i),a.mediaProperties.set((0,n.getEtsPropName)(e),p)})),f=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.dealWithColor);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.dealWithColor),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)}));function m(e,t,r,o=!1){(0,n.isEmptyOrUndefined)(t)||r.set(e,o?t:(0,n.quoteString)(t))}t.forEachParser=function(e,t){var r,n,a;const i=null!==(r=e.dynamicProperty.get("for"))&&void 0!==r?r:"[1]",s=null!==(n=e.property.get("item"))&&void 0!==n?n:"item",p=null!==(a=e.property.get("idx"))&&void 0!==a?a:"idx",l=e.dynamicProperty.get("keyGenerator"),c=(0,o.getMediaProperty)(e,"for");if(0===c.size)return;const u=(0,o.getVariableName)(e.id,"for"),y={for:u,key:l,item:s,idx:p};t.setDefaultValue(u,(0,o.getType)("for"),i),t.setMediaProperty(u,c),t.setForEachObj(y)},t.ifParser=function(e,t){const r=(0,o.getMediaProperty)(e,"if");if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"if"),a=(0,o.getVariableName)(e.id,"if");t.setDefaultValue(a,(0,o.getType)("if"),n),t.setMediaProperty(a,r),t.setIfBoolean(a)};const g=(0,n.curry)(((e,t,r)=>{const a=new Map,i=t.property.get(e),s=t.dynamicProperty.get(e),p=null!=s?s:i,c=["top","bottom","left","right"];let u=0;for(const i of c){const s=`${e}-${i}`,c=t.property.get(s),y=t.dynamicProperty.get(s),d=l(t,s);let f=(0,n.isEmptyOrUndefined)(p)?"undefined":(0,n.quoteString)(p);if((0,n.isEmptyOrUndefined)(c)||(f=(0,n.quoteString)(c)),(0,n.isEmptyOrUndefined)(y)||(f=y),d.size>0){const e=(0,o.getVariableName)(t.id,s);r.setDefaultValue(e,(0,o.getType)(s),f),r.setMediaProperty(e,d),m(i,e,a,!0),u++}else m(i,f,a,!0)}u>0&&r.mediaProperties.set(e,a)}));function h(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null===t?"undefined":void 0!==t[5]?`{ width: ${(0,n.quoteString)(t[1])}, height: ${(0,n.quoteString)(t[5])} }`:`{ width: ${(0,n.quoteString)(t[1])} }`}function E(e,t){var r,o;const a=new Map,i=new Map,s=S(t),p=P(t);return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((e,r)=>{const o=e.get(t);if(!(0,n.isEmptyOrUndefined)(o)){let e=s(o);e=""!==e?e:"undefined",a.set(r,e),i.set(r,p(o))}})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{const o=e.get(t);(0,n.isEmptyOrUndefined)(o)||(a.set(r,o),i.set(r,"undefined"))})),{enumValueMap:a,objValueMap:i}}function T(e,t){const r=e.property.get(t),o=e.dynamicProperty.get(t),a=S(t),i=P(t);let s="undefined",p="undefined";if(!(0,n.isEmptyOrUndefined)(r)){const e=a(r);s=""!==e?e:s,p=i(r)}return(0,n.isEmptyOrUndefined)(o)||(s=o,p="undefined"),{enumDefault:s,objDefault:p}}function S(e){return new Map([["background-image-size",n.getBackgroundImageSizeEnumValue],["background-image-position",n.getBackgroundImagePositionEnumValue]]).get(e)}function P(e){return new Map([["background-image-size",h],["background-image-position",v]]).get(e)}function v(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null===t?"undefined":`{ x: ${(0,n.quoteString)(t[1])}, y: ${(0,n.quoteString)(t[4])} }`}const b=(0,n.curry)(((e,t,r,a)=>{const i=(0,n.getBorderDirections)(e),s=new Map;let p=r.property.get(e);(0,n.isEmptyOrUndefined)(p)||(p=t(p));const l=r.dynamicProperty.get(e),c=null!=l?l:p,u=(0,o.getMediaProperty)(r,e,t);let y=0;for(const e of i){const i=(0,n.getEdgeBorderDirection)(e),p=r.property.get(e),l=r.dynamicProperty.get(e),d=(0,o.getMediaProperty)(r,e,t);let f=(0,n.isEmptyOrUndefined)(c)?"undefined":c;if((0,n.isEmptyOrUndefined)(p)||(f=t(p)),(0,n.isEmptyOrUndefined)(l)||(f=l),d.size>0){const t=(0,o.getVariableName)(r.id,e);a.setDefaultValue(t,(0,o.getType)(e),f),a.setMediaProperty(t,d),s.set(i,t),y++}else{const t=(0,o.getVariableName)(r.id,e);a.setDefaultValue(t,(0,o.getType)(e),f),a.setMediaProperty(t,u),s.set(i,t)}}y>0&&a.mediaProperties.set((0,n.getEtsPropName)(e),s)}));t.commonMediaParserArray=[[i("width"),c("width")],[i("height"),c("height")],[function(e){return e.hasMediaProperty("constraint-size-min-width")||e.hasMediaProperty("constraint-size-max-width")||e.hasMediaProperty("constraint-size-min-height")||e.hasMediaProperty("constraint-size-min-height")},function(e,t){const r=new Map,a=["min-width","max-width","min-height","max-height"];for(const i of a){const a=`constraint-size-${i}`,s=(0,o.getMediaProperty)(e,a,n.quoteString),p=(0,o.getMediaDefaultValue)(e,a,n.quoteString);if(s.size>0){const l=(0,o.getVariableName)(e.id,a);t.setDefaultValue(l,(0,o.getType)(a),p),t.setMediaProperty(l,s),m((0,n.getEtsPropName)(i),l,r,!0)}}r.size>0&&t.mediaProperties.set("constraintSize",r)}],[i("align"),d("align","Alignment.")],[i("direction"),d("direction","Direction.")],[function(e){return e.hasMediaProperty("left")||e.hasMediaProperty("top")},function(e,t){var r;const n=null!==(r=e.property.get("position"))&&void 0!==r?r:"relative",{leftValue:a,topValue:i}=s(e,e.property,e.dynamicProperty),{mediaPositionLeft:l,mediaPositionTop:c,mediaOffsetLeft:u,mediaOffsetTop:y}=function(e){var t,r;const o=new Map,n=new Map,a=new Map,i=new Map,p=null!==(t=e.mediaProperty)&&void 0!==t?t:new Map,l=null!==(r=e.dynamicMediaProperty)&&void 0!==r?r:new Map,c=new Set;for(const[e]of p)c.add(e);for(const[e]of l)c.add(e);return c.forEach((t=>{var r,p,l,c;const u=null!==(p=null===(r=e.mediaProperty)||void 0===r?void 0:r.get(t))&&void 0!==p?p:new Map,y=null!==(c=null===(l=e.dynamicMediaProperty)||void 0===l?void 0:l.get(t))&&void 0!==c?c:new Map,d=u.get("position"),{leftValue:f,topValue:m}=s(e,u,y);"absolute"===d?("undefined"!==f&&o.set(t,f),"undefined"!==m&&n.set(t,m)):("undefined"!==f&&a.set(t,f),"undefined"!==m&&i.set(t,m))})),{mediaPositionLeft:o,mediaPositionTop:n,mediaOffsetLeft:a,mediaOffsetTop:i}}(e),d=l.size>0||c.size>0||"absolute"===n,f=u.size>0||y.size>0||"relative"===n,m=(0,o.getVariableName)(e.id,"positionLeft"),g=(0,o.getVariableName)(e.id,"positionTop"),h=(0,o.getVariableName)(e.id,"offsetLeft"),E=(0,o.getVariableName)(e.id,"offsetTop");if(0!==l.size||0!==c.size||0!==y.size||0!==u.size){if(d&&f&&(p(l,u),p(u,l),p(c,y),p(y,c)),d){const e="absolute"===n?a:"undefined",r="absolute"===n?i:"undefined";t.setDefaultValue(m,(0,o.getType)("left"),e),t.setDefaultValue(g,(0,o.getType)("top"),r),t.setMediaProperty(m,l),t.setMediaProperty(g,c),t.mediaProperties.set("position",new Map([["x",m],["y",g]]))}if(f){const e="relative"===n?a:"undefined",r="relative"===n?i:"undefined";t.setDefaultValue(h,(0,o.getType)("left"),e),t.setDefaultValue(E,(0,o.getType)("top"),r),t.setMediaProperty(h,u),t.setMediaProperty(E,y),t.mediaProperties.set("offset",new Map([["x",h],["y",E]]))}}}],[i("aspect-ratio"),u("aspect-ratio")],[i("display-priority"),u("display-priority")],[i("flex-basis"),c("flex-basis")],[i("flex-grow"),u("flex-grow")],[i("flex-shrink"),u("flex-shrink")],[i("align-self"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-self",n.dealWithAlignSelf);if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"align-self",n.dealWithAlignSelf),i=(0,o.getVariableName)(e.id,"align-self");t.setDefaultValue(i,(0,o.getType)("align-self"),a),t.setMediaProperty(i,r),t.mediaProperties.set("alignSelf",i)}],[i("border-style"),d("border-style","BorderStyle.")],[function(e){return e.hasMediaProperty("border-top-style")||e.hasMediaProperty("border-bottom-style")||e.hasMediaProperty("border-left-style")||e.hasMediaProperty("border-right-style")},b("border-style",(0,n.curry)(n.getEtsEnumValue)("BorderStyle."))],[i("border-width"),c("border-width")],[function(e){return e.hasMediaProperty("border-top-width")||e.hasMediaProperty("border-bottom-width")||e.hasMediaProperty("border-left-width")||e.hasMediaProperty("border-right-width")},b("border-width",n.quoteString)],[i("border-color"),f("border-color")],[function(e){return e.hasMediaProperty("border-top-color")||e.hasMediaProperty("border-bottom-color")||e.hasMediaProperty("border-left-color")||e.hasMediaProperty("border-right-color")},b("border-color",n.dealWithColor)],[i("border-radius"),c("border-radius")],[function(e){return e.hasMediaProperty("border-top-left-radius")||e.hasMediaProperty("border-bottom-right-radius")||e.hasMediaProperty("border-bottom-left-radius")||e.hasMediaProperty("border-top-right-radius")},b("border-radius",n.quoteString)],[i("background-color"),f("background-color")],[function(e){return e.hasMediaProperty("background-image-src")||e.hasMediaProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),i=e.property.get("background-image-repeat"),s=e.dynamicProperty.get("background-image-src"),p=e.dynamicProperty.get("background-image-repeat"),l=(0,o.getMediaProperty)(e,"background-image-src",a.dealWithSrc),c=(0,o.getMediaProperty)(e,"background-image-repeat",n.dealWithBackgroundRepeat);if(0===l.size&&0===c.size)return;let u=(0,a.dealWithSrc)(null!=r?r:"");if((0,n.isEmptyOrUndefined)(s)||(u=s),l.size>0){const r=(0,o.getVariableName)(e.id,"background-image-src");t.setDefaultValue(r,(0,o.getType)("background-image-src"),u),t.setMediaProperty(r,l),u=r}let y="undefined";if(!(0,n.isEmptyOrUndefined)(i)){const e=(0,n.dealWithBackgroundRepeat)(i);null!=e&&""!==e&&(y=e)}if((0,n.isEmptyOrUndefined)(p)||(y=p),c.size>0){const r=(0,o.getVariableName)(e.id,"background-image-repeat");t.setDefaultValue(r,(0,o.getType)("background-image-repeat"),y),t.setMediaProperty(r,c),y=r}t.mediaProperties.set("backgroundImage",u+", "+y)}],[i("background-image-size"),function(e,t){const{enumValueMap:r,objValueMap:n}=E(e,"background-image-size");if(0===r.size&&0===n.size)return;const{enumDefault:a,objDefault:i}=T(e,"background-image-size"),s=(0,o.getVariableName)(e.id,"background-image-size-enum"),p=(0,o.getVariableName)(e.id,"background-image-size-obj");t.setDefaultValue(s,"ImageSize",a),t.setDefaultValue(p,"SizeOptions",i),t.setMediaProperty(s,r),t.setMediaProperty(p,n),t.mediaProperties.set("backgroundImageSize",`${s} !== undefined ? ${s} : ${p}`)}],[i("background-image-position"),function(e,t){const{enumValueMap:r,objValueMap:n}=E(e,"background-image-position");if(0===r.size&&0===n.size)return;const{enumDefault:a,objDefault:i}=T(e,"background-image-position"),s=(0,o.getVariableName)(e.id,"background-image-position-enum"),p=(0,o.getVariableName)(e.id,"background-image-position-obj");t.setDefaultValue(s,"Alignment",a),t.setDefaultValue(p,"Position",i),t.setMediaProperty(s,r),t.setMediaProperty(p,n),t.mediaProperties.set("backgroundImagePosition",`${s} !== undefined ? ${s} : ${p}`)}],[i("opacity"),u("opacity")],[i("visibility"),d("visibility","Visibility.")],[i("enabled"),y("enabled")],[i("font-color"),f("font-color")],[function(e){return e.hasMediaProperty("margin")||e.hasMediaProperty("margin-left")||e.hasMediaProperty("margin-top")||e.hasMediaProperty("margin-right")||e.hasMediaProperty("margin-bottom")},g("margin")],[function(e){return e.hasMediaProperty("padding")||e.hasMediaProperty("padding-left")||e.hasMediaProperty("padding-top")||e.hasMediaProperty("padding-right")||e.hasMediaProperty("padding-bottom")},g("padding")]]},3135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.componentsMediaParserArray=t.dateMediaParamParser=t.rawDataMediaParamParser=t.stringMediaParamParser=t.dealWithJustifyAlignContent=void 0;const o=r(6282),n=r(1195),a=r(8122),i=r(9248),s=r(1790),p=r(5264),l=(0,a.curry)(((e,t,r)=>r.type===e&&r.hasMediaProperty(t)));function c(e){return isNaN(Number(e))?(0,a.getEtsEnumValue)("FontWeight.",e):e}function u(e){let t=(0,a.getEtsEnumValue)("FlexAlign.",e);return"flex-start"===e?t="FlexAlign.Start":"flex-end"===e&&(t="FlexAlign.End"),t}function y(e){return"TextOverflow."+(0,a.firstUpperCase)(e)}function d(e,t,r){var o,n;const i=new Map,s=null!==(o=e.mediaProperty)&&void 0!==o?o:new Map,p=null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map;return s.forEach(((e,o)=>{let n=e.get(t);const s=e.get(r);(0,a.isEmptyOrUndefined)(n)&&(0,a.isEmptyOrUndefined)(s)||(n="0"===n||(0,a.isEmptyOrUndefined)(n)?"0":n.substring(0,n.length-2),i.set(o,n))})),p.forEach(((e,r)=>{const o=e.get(t);(0,a.isEmptyOrUndefined)(o)||i.set(r,o)})),i}t.dealWithJustifyAlignContent=u;const f=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e,a.quoteString);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e,a.quoteString),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),m=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),g=(0,a.curry)(((e,t,r)=>{m(e,t,r)})),h=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,(0,a.curry)(a.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,a.curry)(a.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(e),p)}));t.stringMediaParamParser=(0,a.curry)(((e,t,r)=>{const i=(0,o.getMediaProperty)(t,e,a.quoteString);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(t,e,a.quoteString),p=(0,o.getVariableName)(t.id,e),l=(0,n.getMediaVariableDecorator)(e);r.setDefaultValue(p,(0,o.getType)(e),s,l),r.setMediaProperty(p,i),r.mediaParams.set((0,a.getEtsPropName)(e),(0,n.getDynamicValueByDecorator)(e,p))})),t.rawDataMediaParamParser=(0,a.curry)(((e,t,r)=>{const i=(0,o.getMediaProperty)(t,e);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(t,e),p=(0,o.getVariableName)(t.id,e);r.setDefaultValue(p,(0,o.getType)(e),s),r.setMediaProperty(p,i),r.mediaParams.set((0,a.getEtsPropName)(e),(0,n.getDynamicValueByDecorator)(e,p))})),t.dateMediaParamParser=(0,a.curry)(((e,t,r,n,i)=>{const s=e=>void 0===e||""===e?"new Date()":"new Date ("+(0,a.quoteString)(e)+")",p=(0,o.getMediaProperty)(n,e,s);if(!(i.mediaParams instanceof Map)||0===p.size)return;const l=(0,o.getMediaDefaultValue)(n,e,s),c=(0,o.getVariableName)(n.id,e);i.setDefaultValue(c,(0,o.getType)(e),l,r),i.setMediaProperty(c,p),i.mediaParams.set(t,c)}));const E=(0,a.curry)(((e,t,r,n,a)=>{const i=(0,o.getMediaProperty)(n,e);if(!(a.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(n,e),p=(0,o.getVariableName)(n.id,e);a.setDefaultValue(p,(0,o.getType)(e),s,r),a.setMediaProperty(p,i),a.mediaParams.set(t,p)})),T=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,(0,a.curry)(a.getEtsEnumValue)(t));if(!(n.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,a.curry)(a.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaParams.set((0,a.getEtsPropName)(e),p)})),S=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e,a.dealWithColor);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e,a.dealWithColor),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),P=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),v=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,a.quoteString);if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,a.quoteString),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(t),p)})),b=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e);if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(t),p)})),_=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,u);if(!(n.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,u),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaParams.set((0,a.getEtsPropName)(e),p)})),N=(0,a.curry)(((e,t,r,n)=>{const a=(0,o.getMediaProperty)(r,e,u);if(!(n.mediaProperties instanceof Map)||0===a.size)return;const i=(0,o.getMediaDefaultValue)(r,e,u),s=(0,o.getVariableName)(r.id,e);n.setDefaultValue(s,(0,o.getType)(e),i),n.setMediaProperty(s,a),n.mediaProperties.set("justifyContent",s)})),C=(0,a.curry)(((e,t)=>t.type===e));function A(e,t,r){const n=e.property.get(r),i=e.dynamicProperty.get(r),s=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===s.size)return;let p="''";(0,a.isEmptyOrUndefined)(n)||(p=(0,a.quoteString)(n)),(0,a.isEmptyOrUndefined)(i)||(p=(0,a.getContentName)(i));const l=(0,o.getVariableName)(e.id,r);t.setDefaultValue(l,(0,o.getType)(r),p),t.setMediaProperty(l,s),t.setMediaParams(l)}const O=(0,a.curry)(((e,t,r,n)=>{let i=n.mediaProperties.get((0,a.getEtsPropName)(e));void 0===i&&(i=new Map);const s=`${e}-${t}`,p=(0,o.getVariableName)(r.id,s);let l=(0,o.getMediaProperty)(r,s,a.quoteString),u=(0,o.getMediaDefaultValue)(r,s,a.quoteString);if("string"!=typeof i){if((0,a.isEmptyOrUndefined)(u))return;"style"===t&&(l=(0,o.getMediaProperty)(r,s,(0,a.curry)(a.getEtsEnumValue)("FontStyle.")),u=(0,o.getMediaDefaultValue)(r,s,(0,a.curry)(a.getEtsEnumValue)("FontStyle."))),"weight"===t&&(l=(0,o.getMediaProperty)(r,s,c),u=(0,o.getMediaDefaultValue)(r,s,c)),n.setDefaultValue(p,(0,o.getType)(s),u),n.setMediaProperty(p,l),i.set(t,p)}n.mediaProperties.set((0,a.getEtsPropName)(e),i)}));function M(e,t){const r=(0,o.getMediaProperty)(e,"font-weight",a.dealWithFontWeight);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"font-weight",a.dealWithFontWeight),i=(0,o.getVariableName)(e.id,"font-weight");t.setDefaultValue(i,(0,o.getType)("font-weight"),n),t.setMediaProperty(i,r),t.mediaProperties.set("fontWeight",i)}function w(e,t,r,n){const i=new Map([["value","search-value"],["placeholder","search-placeholder"],["icon","icon"],["controller","search-controller"]]).get(e);if(void 0===i)return;const s=r.getProperty(i),p=r.dynamicProperty.get(i),l=(0,o.getMediaProperty)(r,i,a.quoteString),c=(0,o.getVariableName)(r.id,i);let u="''";0!==l.size&&((0,a.isEmptyOrUndefined)(s)||(u=(0,a.quoteString)(s)),(0,a.isEmptyOrUndefined)(p)||(u="controller"===e?p:(0,a.getContentName)(p)),n.setDefaultValue(c,(0,o.getType)(i),u),n.setMediaProperty(c,l),t.push(`${e}: ${(0,a.getContentName)(c)}`))}const R=[[l("button","label"),function(e,t){A(e,t,"label")}],[l("button","type"),h("type","ButtonType.")],[l("button","state-effect"),g("state-effect")],[l("button","font-size"),f("font-size")],[l("button","font-style"),h("font-style","FontStyle.")],[l("button","font-weight"),M],[l("button","font-family"),f("font-family")]],I=[[l("divider","vertical"),g("vertical")],[l("divider","color"),S("color")],[l("divider","stroke-width"),f("stroke-width")],[l("divider","line-cap"),h("line-cap","LineCapStyle.")]],x=[[C("image"),function(e,t){var r;const n=null!==(r=e.property.get("src"))&&void 0!==r?r:"",s=e.dynamicProperty.get("src"),p=(0,o.getMediaProperty)(e,"src",i.dealWithSrc);if(0===p.size)return;let l=(0,i.dealWithSrc)(n);(0,a.isEmptyOrUndefined)(s)||(l=s);const c=(0,o.getVariableName)(e.id,"src");t.setDefaultValue(c,(0,o.getType)("src"),l),t.setMediaProperty(c,p),t.setMediaParams(c)}],[l("image","alt"),f("alt")],[l("image","object-fit"),h("object-fit","ImageFit.")],[l("image","object-repeat"),h("object-repeat","ImageRepeat.")],[l("image","interpolation"),h("interpolation","ImageInterpolation.")],[l("image","render-mode"),h("render-mode","ImageRenderMode.")],[function(e){return e.hasMediaProperty("source-size-width")||e.hasMediaProperty("source-size-height")},function(e,t){let r=e.property.get("source-size-width"),n=e.property.get("source-size-height");const i=e.dynamicProperty.get("source-size-width"),s=e.dynamicProperty.get("source-size-height"),p=d(e,"source-size-width","source-size-height"),l=d(e,"source-size-height","source-size-width");if(0===p.size)return;r="0"===r||(0,a.isEmptyOrUndefined)(r)?"0":r.substring(0,r.length-2),n="0"===n||(0,a.isEmptyOrUndefined)(n)?"0":n.substring(0,n.length-2),(0,a.isEmptyOrUndefined)(i)||(r=i),(0,a.isEmptyOrUndefined)(s)||(n=s);const c=(0,o.getVariableName)(e.id,"source-size-width"),u=(0,o.getVariableName)(e.id,"source-size-height");t.setDefaultValue(c,(0,o.getType)("source-size-width"),r),t.setDefaultValue(u,(0,o.getType)("source-size-height"),n),t.setMediaProperty(c,p),t.setMediaProperty(u,l);const y=new Map([["width",c],["height",u]]);t.mediaProperties.set("sourceSize",y)}]],L=[[function(e){return"progress"===e.type&&(e.hasMediaProperty("value")||e.hasMediaProperty("total")||e.hasMediaProperty("style"))},function(e,t){const r=e.property.get("value"),n=e.dynamicProperty.get("value"),i=(0,o.getMediaProperty)(e,"value");if(!(t.mediaParams instanceof Map)||0===i.size)return;let s=null!=r?r:"0";(0,a.isEmptyOrUndefined)(n)||(s=n);const p=(0,o.getVariableName)(e.id,"value");t.setDefaultValue(p,(0,o.getType)("value"),s),t.setMediaProperty(p,i),t.mediaParams.set("value",p)}],[l("progress","total"),(0,t.rawDataMediaParamParser)("total")],[l("progress","style"),T("style","ProgressStyle.")],[l("progress","color"),S("color")]],F=[[l("slider","value"),(0,t.rawDataMediaParamParser)("value")],[l("slider","min"),(0,t.rawDataMediaParamParser)("min")],[l("slider","max"),(0,t.rawDataMediaParamParser)("max")],[l("slider","step"),(0,t.rawDataMediaParamParser)("step")],[l("slider","style"),T("style","SliderStyle.")],[l("slider","block-color"),S("block-color")],[l("slider","track-color"),S("track-color")],[l("slider","selected-color"),S("selected-color")],[l("slider","show-steps"),g("show-steps")],[l("slider","show-tips"),g("show-tips")]],k=[[l("text","content"),function(e,t){A(e,t,"content")}],[l("text","text-align"),h("text-align","TextAlign.")],[l("text","text-overflow"),function(e,t){const r=(0,o.getMediaProperty)(e,"text-overflow",y);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"text-overflow",y),a=(0,o.getVariableName)(e.id,"text-overflow");t.setDefaultValue(a,(0,o.getType)("text-overflow"),n),t.setMediaProperty(a,r),t.mediaProperties.set("textOverflow",new Map([["overflow",a]]))}],[l("text","max-lines"),m("max-lines")],[l("text","line-height"),f("line-height")],[function(e){return"text"===e.type&&(e.hasMediaProperty("decoration-type")||e.hasMediaProperty("decoration-color"))},function(e,t){const r=(0,o.getMediaProperty)(e,"decoration-type",(0,a.curry)(a.getEtsEnumValue)("TextDecorationType.")),n=(0,o.getMediaProperty)(e,"decoration-color",a.dealWithColor);if(0===r.size&&0===n.size)return;let i=(0,o.getMediaDefaultValue)(e,"decoration-type",(0,a.curry)(a.getEtsEnumValue)("TextDecorationType.")),s=(0,o.getMediaDefaultValue)(e,"decoration-color",a.dealWithColor);if(r.size>0){const n=(0,o.getVariableName)(e.id,"decoration-type");t.setDefaultValue(n,(0,o.getType)("decoration-type"),i),t.setMediaProperty(n,r),i=n}if(n.size>0){const r=(0,o.getVariableName)(e.id,"decoration-color");t.setDefaultValue(r,(0,o.getType)("decoration-color"),s),t.setMediaProperty(r,n),s=r}const p=new Map([["type",i]]);t.mediaProperties.set("decoration",p),"undefined"!==s&&p.set("color",s)}],[l("text","baseline-offset"),f("baseline-offset")],[l("text","text-case"),h("text-case","TextCase.")],[l("text","font-size"),f("font-size")],[l("text","font-style"),h("font-style","FontStyle.")],[l("text","font-weight"),M],[l("text","font-family"),f("font-family")]],B=[[l("column","space"),(0,t.stringMediaParamParser)("space")],[l("column","align-items-column"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-column",s.dealWithColumnAlignItems);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-column",s.dealWithColumnAlignItems),a=(0,o.getVariableName)(e.id,"align-items-column");t.setDefaultValue(a,(0,o.getType)("align-items-column"),n),t.setMediaProperty(a,r),t.mediaProperties.set("alignItems",a)}],[l("column","justify-content-rc"),N("justify-content-rc","FlexAlign.")]],D=[[l("row","space"),(0,t.stringMediaParamParser)("space")],[l("row","align-items-row"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-row",s.dealWithRowAlignItems);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-row",s.dealWithRowAlignItems),a=(0,o.getVariableName)(e.id,"align-items-row");t.setDefaultValue(a,(0,o.getType)("align-items-row"),n),t.setMediaProperty(a,r),t.mediaProperties.set("alignItems",a)}],[l("row","justify-content-rc"),N("justify-content-rc","FlexAlign.")]],U=[[l("flex","flex-direction"),function(e,t){const r=(0,o.getMediaProperty)(e,"flex-direction",(0,a.curry)(a.getEtsEnumValue)("FlexDirection."));if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"flex-direction",(0,a.curry)(a.getEtsEnumValue)("FlexDirection.")),i=(0,o.getVariableName)(e.id,"flex-direction");t.setDefaultValue(i,(0,o.getType)("flex-direction"),n),t.setMediaProperty(i,r),t.mediaParams.set("direction",i)}],[l("flex","wrap"),function(e,t){const r=(0,o.getMediaProperty)(e,"wrap",a.dealWithWrap);if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"wrap",a.dealWithWrap),i=(0,o.getVariableName)(e.id,"wrap");t.setDefaultValue(i,(0,o.getType)("wrap"),n),t.setMediaProperty(i,r),t.mediaParams.set("wrap",i)}],[l("flex","justify-content"),_("justify-content","FlexAlign.")],[l("flex","align-items-flex"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-flex",p.dealWithFlexAlignItems);if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-flex",p.dealWithFlexAlignItems),a=(0,o.getVariableName)(e.id,"align-items-flex");t.setDefaultValue(a,(0,o.getType)("align-items-flex"),n),t.setMediaProperty(a,r),t.mediaParams.set("alignItems",a)}],[l("flex","align-content"),_("align-content","FlexAlign.")]],V=[[l("list","space"),(0,t.stringMediaParamParser)("space")],[l("list","initial-index"),(0,t.rawDataMediaParamParser)("initial-index")],[l("list","list-direction"),h("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasMediaProperty("divider-stroke-width")||e.hasMediaProperty("divider-color")||e.hasMediaProperty("divider-start-margin")||e.hasMediaProperty("divider-end-margin"))},function(e,t){const r=[["divider-stroke-width",a.quoteString],["divider-color",a.dealWithColor],["divider-start-margin",a.quoteString],["divider-end-margin",a.quoteString]];let n=0;const i=new Map;for(const[s,p]of r){const r=(0,o.getMediaProperty)(e,s,p),l=(0,a.getEtsPropName)(s.replace("divider-",""));let c=(0,o.getMediaDefaultValue)(e,s,p);if("undefined"===c&&"divider-stroke-width"===s&&(c="0"),r.size>0){const a=(0,o.getVariableName)(e.id,s);t.setDefaultValue(a,(0,o.getType)(s),c),t.setMediaProperty(a,r),c=a,n++}i.set(l,c)}n>0&&t.mediaProperties.set("divider",i)}],[l("list","edit-mode"),g("edit-mode")],[l("list","edge-effect"),h("edge-effect","EdgeEffect.")],[l("list","chain-animation"),g("chain-animation")]],G=[[l("list-item","sticky"),h("sticky","Sticky.")],[l("list-item","editable"),g("editable")]],z=[[l("swiper","index"),m("index")],[l("swiper","auto-play"),g("auto-play")],[l("swiper","interval"),m("interval")],[l("swiper","indicator"),g("indicator")],[l("swiper","loop"),g("loop")],[l("swiper","duration"),m("duration")],[l("swiper","vertical"),g("vertical")],[l("swiper","item-space"),f("item-space")],[l("swiper","cached-count"),m("cached-count")],[l("swiper","disable-swipe"),g("disable-swipe")]],j=[[l("text-input","placeholder"),(0,t.stringMediaParamParser)("placeholder")],[l("text-input","textInput-type"),function(e,t){const r=(0,o.getMediaProperty)(e,"textInput-type",(0,a.curry)(a.getEtsEnumValue)("InputType."));if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"textInput-type",(0,a.curry)(a.getEtsEnumValue)("InputType.")),i=(0,o.getVariableName)(e.id,"textInput-type");t.setDefaultValue(i,(0,o.getType)("textInput-type"),n),t.setMediaProperty(i,r),t.mediaProperties.set("type",i)}],[l("text-input","placeholderColor"),S("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasMediaProperty("placeholderFont-size")||e.hasMediaProperty("placeholderFont-weight")||e.hasMediaProperty("placeholderFont-family")||e.hasMediaProperty("placeholderFont-style"))},function(e,t){const r=[["size",a.quoteString],["weight",c],["family",a.quoteString],["style",(0,a.curry)(a.getEtsEnumValue)("FontStyle.")]];let n=0;const i=new Map;for(const[a,s]of r){const r=`placeholderFont-${a}`,p=(0,o.getMediaProperty)(e,r,s);let l=(0,o.getMediaDefaultValue)(e,r,s);if(p.size>0){const a=(0,o.getVariableName)(e.id,r);t.setDefaultValue(a,(0,o.getType)(r),l),t.setMediaProperty(a,p),l=a,n++}i.set(a,l)}n>0&&t.mediaProperties.set("placeholderFont",i)}],[l("text-input","enterKeyType"),h("enterKeyType","EnterKeyType.")],[l("text-input","caretColor"),S("caretColor")],[l("text-input","maxLength"),m("maxLength")]],W=[[l("refresh","friction"),(0,t.rawDataMediaParamParser)("friction")],[l("refresh","offset"),(0,t.stringMediaParamParser)("offset")],[l("refresh","refreshing"),(0,t.rawDataMediaParamParser)("refreshing")]],$=[[l("timePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[l("timePicker","useMilitaryTime"),g("useMilitaryTime")]],q=[[l("datePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[l("datePicker","start"),(0,t.dateMediaParamParser)("start","start","private")],[l("datePicker","end"),(0,t.dateMediaParamParser)("end","end","private")],[l("datePicker","lunar"),g("lunar")]],H=[[l("textPicker","range"),(0,t.rawDataMediaParamParser)("range")],[l("textPicker","textPicker-selected"),E("textPicker-selected","selected","@State")],[l("textPicker","defaultPickerItemHeight"),f("defaultPickerItemHeight")]],Y=[[l("select","select-option"),function(e,t){!function(e,t,r){const n=e.dynamicProperty.get(r),i=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===i.size)return;const s=null!=n?n:'[{value: ""}]',p=(0,o.getVariableName)(e.id,r);t.setDefaultValue(p,(0,o.getType)(r),s),t.setMediaProperty(p,i),t.setMediaParams(p)}(e,t,"select-option")}],[l("select","select-value"),function(e,t){const r="select-value",n=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,a.quoteString),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaProperties.set("value",s)}],[l("select","selected"),m("selected")],[l("select","font-size"),O("font","size")],[l("select","font-style"),O("font","style")],[l("select","font-family"),O("font","family")],[l("select","font-weight"),O("font","weight")],[l("select","selected-option-font-size"),O("selected-option-font","size")],[l("select","selected-option-font-style"),O("selected-option-font","style")],[l("select","selected-option-font-family"),O("selected-option-font","family")],[l("select","selected-option-font-weight"),O("selected-option-font","weight")],[l("select","selected-option-font-color"),S("selected-option-font-color")],[l("select","selected-option-bg-color"),S("selected-option-bg-color")],[l("select","option-font-size"),O("option-font","size")],[l("select","option-font-style"),O("option-font","style")],[l("select","option-font-family"),O("option-font","family")],[l("select","option-font-weight"),O("option-font","weight")],[l("select","option-font-color"),S("option-font-color")],[l("select","option-bg-color"),S("option-bg-color")]],X=[[l("toggle","toggle-type"),function(e,t){const r="ToggleType.",n="toggle-type",i=(0,o.getMediaProperty)(e,n,(0,a.curry)(a.getEtsEnumValue)(r));if(!(t.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(e,n,(0,a.curry)(a.getEtsEnumValue)(r)),p=(0,o.getVariableName)(e.id,n);t.setDefaultValue(p,(0,o.getType)(n),s),t.setMediaProperty(p,i),t.mediaParams.set("type",p)}],[l("toggle","isOn"),(0,t.rawDataMediaParamParser)("isOn")],[l("toggle","selectedColor"),S("selectedColor")],[l("toggle","switchPointColor"),S("switchPointColor")]],J=[[l("checkbox","select"),g("select")],[l("checkbox","selectedColor"),S("selectedColor")],[l("checkbox","name"),(0,t.stringMediaParamParser)("name")],[l("checkbox","group"),(0,t.stringMediaParamParser)("group")]],Q=[[l("checkboxGroup","selectAll"),g("selectAll")],[l("checkboxGroup","selectedColor"),S("selectedColor")],[l("checkboxGroup","group"),(0,t.stringMediaParamParser)("group")]],K=[[l("scroll","scrollable"),h("scrollable","ScrollDirection.")],[l("scroll","scroll-bar"),h("scroll-bar","BarState.")],[l("scroll","scroll-bar-color"),S("scroll-bar-color")],[l("scroll","scroll-bar-width"),f("scroll-bar-width")],[l("scroll","edge-effect-scroll"),function(e,t){const r="edge-effect-scroll",n=(0,o.getMediaProperty)(e,r,a.dealWithScrollEdgeEffect);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,a.dealWithScrollEdgeEffect),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaProperties.set("edgeEffect",s)}]],Z=[[l("grid","columns-template"),f("columns-template")],[l("grid","rows-template"),f("rows-template")],[l("grid","columns-gap"),f("columns-gap")],[l("grid","rows-gap"),f("rows-gap")],[l("grid","scroll-bar"),h("scroll-bar","BarState.")],[l("grid","scroll-bar-color"),S("scroll-bar-color")],[l("grid","scroll-bar-width"),f("scroll-bar-width")],[l("grid","cached-count"),m("cached-count")],[l("grid","edit-mode"),g("edit-mode")],[l("grid","layout-direction"),h("layout-direction","GridDirection.")],[l("grid","max-count"),m("max-count")],[l("grid","min-count"),m("min-count")],[l("grid","cell-length"),m("cell-length")],[l("grid","multi-selectable"),g("multi-selectable")],[l("grid","support-animation"),g("support-animation")]],ee=[[l("grid-item","row-start"),m("row-start")],[l("grid-item","row-end"),m("row-end")],[l("grid-item","column-start"),m("column-start")],[l("grid-item","column-end"),m("column-end")],[l("grid-item","force-rebuild"),g("force-rebuild")],[l("grid-item","selectable"),g("selectable")]],te=[[l("stack","align-content-stack"),function(e,t){const r="align-content-stack",n=(0,o.getMediaProperty)(e,r,(0,a.curry)(a.getEtsEnumValue)("Alignment."));if(!(t.mediaParams instanceof Map)||0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,(0,a.curry)(a.getEtsEnumValue)("Alignment.")),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaParams.set("alignContent",s)}]],re=[[l("navigation","navigation-title"),v("navigation-title","title")],[l("navigation","subTitle"),f("subTitle")],[l("navigation","menus"),P("menus")],[l("navigation","titleMode"),h("titleMode","NavigationTitleMode.")],[l("navigation","toolBar"),P("toolBar")],[l("navigation","hideToolBar"),g("hideToolBar")],[l("navigation","hideTitleBar"),g("hideTitleBar")],[l("navigation","hideBackButton"),g("hideBackButton")]],oe=[[function(e){return"search"===e.type},function(e,t){const r=[];w("value",r,e,t),w("placeholder",r,e,t),w("icon",r,e,t),w("controller",r,e,t),0!==r.length&&t.setParams(`{${r.join(", ")}}`)}],[l("search","text-font-size"),O("text-font","size")],[l("search","text-font-style"),O("text-font","style")],[l("search","text-font-weight"),O("text-font","weight")],[l("search","text-font-family"),O("text-font","family")],[l("search","placeholder-font-size"),O("placeholder-font","size")],[l("search","placeholder-font-style"),O("placeholder-font","style")],[l("search","placeholder-font-weight"),O("placeholder-font","weight")],[l("search","placeholder-font-family"),O("placeholder-font","family")],[l("search","placeholderColor"),S("placeholderColor")],[l("search","search-text-align"),function(e,t){const r=(0,o.getMediaProperty)(e,"search-text-align",(0,a.curry)(a.getEtsEnumValue)("TextAlign."));if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"search-text-align",(0,a.curry)(a.getEtsEnumValue)("TextAlign.")),i=(0,o.getVariableName)(e.id,"search-text-align");t.setDefaultValue(i,(0,o.getType)("search-text-align"),n),t.setMediaProperty(i,r),t.mediaProperties.set("textAlign",i)}],[l("search","search-button"),f("search-button")],[l("search","copy-option"),h("copy-option","CopyOptions.")]],ne=[[l("tabs","bar-position"),T("bar-position","BarPosition.")],[l("tabs","index"),(0,t.rawDataMediaParamParser)("index")],[l("tabs","controller"),(0,t.rawDataMediaParamParser)("controller")],[l("tabs","vertical"),g("vertical")],[l("tabs","tabs-scrollable"),b("tabs-scrollable","scrollable")],[l("tabs","bar-mode"),h("bar-mode","BarMode.")],[l("tabs","bar-width"),f("bar-width")],[l("tabs","bar-height"),f("bar-height")],[l("tabs","animation-duration"),m("animation-duration")]],ae=[[function(e){return"tab-content"===e.type&&(e.hasMediaProperty("tabBar-icon")||e.hasMediaProperty("tabBar-text"))},function(e,t){const r=(0,o.getMediaProperty)(e,"tabBar-text",a.quoteString),n=(0,o.getMediaProperty)(e,"tabBar-icon",i.dealWithSrc),s=(0,o.getMediaDefaultValue)(e,"tabBar-text",a.quoteString),p=(0,o.getMediaDefaultValue)(e,"tabBar-icon",i.dealWithSrc),l=(0,o.getVariableName)(e.id,"tabBar-text"),c=(0,o.getVariableName)(e.id,"tabBar-icon"),u=new Map([["text",s],["icon",p]]);r.size>0&&(t.setDefaultValue(l,(0,o.getType)("tabBar-text"),s),t.setMediaProperty(l,r),u.set("text",l)),n.size>0&&(t.setDefaultValue(c,(0,o.getType)("tabBar-icon"),p),t.setMediaProperty(c,n),u.set("icon",c)),t.mediaProperties.set("tabBar",u)}]];t.componentsMediaParserArray=[...R,...I,...x,...L,...F,...k,...B,...D,...U,...V,...G,...z,...j,...X,...W,...$,...H,...Y,...q,...te,...K,...Z,...ee,...re,...oe,...ne,...ae,...J,...Q]},366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCustomMediaVisualModel=void 0;const o=r(6125),n=r(3135),a=r(6282),i=r(1195),s=r(8122);t.parseCustomMediaVisualModel=function(e,t){(0,i.getCustomAttributeMap)().forEach(((r,n)=>{if(function(e,t){return e.hasMediaProperty(t)}(e,n)){const l=p.get(r.type);"function"==typeof l&&l(n,e,t);const c=o.enumParserMap.get(r.type);"function"==typeof c&&function(e,t,r,o){const n=(0,a.getMediaProperty)(t,e,o);if(!(r.mediaParams instanceof Map)||0===n.size)return;const p=(0,a.getMediaDefaultValue)(t,e,o),l=(0,a.getVariableName)(t.id,e);r.setDefaultValue(l,(0,a.getType)(e),p),r.setMediaProperty(l,n),r.mediaParams.set((0,s.getEtsPropName)(e),(0,i.getDynamicValueByDecorator)(e,l))}(n,e,t,c)}}))};const p=new Map([["string",n.stringMediaParamParser],["boolean",n.rawDataMediaParamParser],["number",n.rawDataMediaParamParser],["any[]",n.rawDataMediaParamParser],["object",n.rawDataMediaParamParser],["Date",function(e,t,r){(0,n.dateMediaParamParser)(e,(0,s.getEtsPropName)(e),"private",t,r)}]])},3729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMediaProperty=t.parseMediaVisualModel=void 0;const o=r(1912),n=r(9223),a=r(3135);function i(e,t,r){const o=t.get(r);return void 0!==o&&o.has(e)}t.parseMediaVisualModel=function(e,t){(0,n.forEachParser)(e,t),(0,n.ifParser)(e,t);for(const r of p)("boolean"==typeof r[0]||r[0](e))&&r[1](e,t)},t.isMediaProperty=function(e,t){return!i(e,s,"common")&&!i(e,s,t)&&!i(e,s,"events")};const s=new Map([["common",new Set(["keyGenerator","item","idx"])],["events",new Set([...o.events])]]),p=[...n.commonMediaParserArray,...a.componentsMediaParserArray]},6282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMediaDefaultValue=t.getVariableName=t.getMediaProperty=t.getType=void 0;const o=r(4294),n=r(1290),a=r(1195),i=r(8122);function s(e,t){for(const r of t)if(r.property===e)return r.etsType;return""}t.getType=function(e){const t=e+"-visual",r=n.etsPropertyList;let o="";for(const e of r)if(void 0!==e.propertySet.properties&&(o=s(t,e.propertySet.properties)),e.propertySet.property===t&&(o=e.propertySet.etsType),""!==o)break;return""!==o?function(e=""){const t=new Map([["Rfloat","Resource"],["Rstring","Resource"],["Rcolor","Resource"],["Rmedia","Resource"],["Rrawfile","Resource"],["Rplural","Resource"],["ETSArray","any[]"]]),r=new Array;return e.split("|").forEach((e=>{const o=t.get(e),n=null!=o?o:e;r.includes(n)||r.push(null!=o?o:e)})),r.join(" | ")}(o):(0,a.getCustomAttrType)(e)},t.getMediaProperty=function(e,t,r){var o,n;const a=new Map;return(null!==(o=e.mediaProperty)&&void 0!==o?o:new Map).forEach(((e,o)=>{let n=e.get(t);(0,i.isEmptyOrUndefined)(n)||("function"==typeof r&&(n=r(n)),(0,i.isEmptyOrUndefined)(n)||a.set(o,n))})),(null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map).forEach(((e,r)=>{let o=e.get(t);void 0===o||"content"!==t&&"label"!==t||(o=(0,i.getContentName)(o)),(0,i.isEmptyOrUndefined)(o)||a.set(r,o)})),a},t.getVariableName=function(e,t){const r=(0,o.getTagName)(e),n=`this.${(0,i.getEtsPropName)(r)}${(0,i.firstUpperCase)((0,i.getEtsPropName)(t))}`;return`${n}_${(0,o.getUniqueId)(n)}`},t.getMediaDefaultValue=function(e,t,r){var o;const n=e.property.get(t),a=e.dynamicProperty.get(t);let s=null!==(o=new Map([["if","true"],["auto-play","false"],["interval","3000"],["select-value","''"],["columns-template","''"],["rows-template","''"],["tabBar-icon","''"],["tabBar-text","'TabBar'"]]).get(t))&&void 0!==o?o:"undefined";return(0,i.isEmptyOrUndefined)(n)||(s="function"==typeof r?r(n):n,s=(0,i.isEmptyOrUndefined)(s)?"undefined":s),(0,i.isEmptyOrUndefined)(a)||(s=a),s}},7893:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseBuildersVisualModel=void 0;const o=r(8122);t.parseBuildersVisualModel=function(e,t,r){const n=e.slots;void 0!==n&&0!==n.size&&n.forEach(((n,a)=>{const i=(0,o.getBuilderUniqueName)(e.id,a);t.properties.set(a,`this.${i}`),t.builders.set(i,r.visit(n))}))}},8916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buttonParserArray=void 0;const o=r(8122);t.buttonParserArray=[[(0,o.hasFeatureProperty)("button","label"),o.labelParamParser],[(0,o.hasFeatureProperty)("button","type"),(0,o.enumPropertyParser)("type","ButtonType.")],[(0,o.hasFeatureProperty)("button","state-effect"),(0,o.booleanPropertyParser)("state-effect")],[(0,o.hasFeatureProperty)("button","font-size"),(0,o.stringPropertyParser)("font-size")],[(0,o.hasFeatureProperty)("button","font-style"),(0,o.enumPropertyParser)("font-style","FontStyle.")],[(0,o.hasFeatureProperty)("button","font-weight"),o.fontWeightPropertyParser],[(0,o.hasFeatureProperty)("button","font-family"),(0,o.stringPropertyParser)("font-family")]]},1147:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxGroupParseArray=void 0;const o=r(8122);t.checkboxGroupParseArray=[[(0,o.hasFeatureProperty)("checkboxGroup","selectAll"),(0,o.booleanPropertyParser)("selectAll")],[(0,o.hasFeatureProperty)("checkboxGroup","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("checkboxGroup","group"),(0,o.stringParamParser)("group")]]},2218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxParseArray=void 0;const o=r(8122);t.checkboxParseArray=[[(0,o.hasFeatureProperty)("checkbox","select"),(0,o.booleanPropertyParser)("select")],[(0,o.hasFeatureProperty)("checkbox","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("checkbox","name"),(0,o.stringParamParser)("name")],[(0,o.hasFeatureProperty)("checkbox","group"),(0,o.stringParamParser)("group")]]},7150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonParserArray=void 0;const o=r(8122),n=r(9248);function a(e,t,r,n=!1){(0,o.isEmptyOrUndefined)(t)||r.set(e,n?t:(0,o.quoteString)(t))}function i(e,t,r,n,a){const i=e.getProperty(t),s=e.getProperty(r),p=e.dynamicProperty.has(t),l=e.dynamicProperty.has(r),c=(0,o.getEdgeBorderDirection)(r);(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||n.set(c,p?i:a(i)):n.set(c,l?s:a(s))}t.commonParserArray=[[(0,o.hasCommonProperty)("width"),(0,o.stringPropertyParser)("width")],[(0,o.hasCommonProperty)("height"),(0,o.stringPropertyParser)("height")],[function(e){return e.hasProperty("constraint-size-min-width")||e.hasProperty("constraint-size-max-width")||e.hasProperty("constraint-size-min-height")||e.hasProperty("constraint-size-max-height")},function(e,t){const r=new Map,o=e.getProperty("constraint-size-min-width"),n=e.getProperty("constraint-size-max-width"),i=e.getProperty("constraint-size-min-height"),s=e.getProperty("constraint-size-max-height");a("minWidth",o,r,e.dynamicProperty.has("constraint-size-min-width")),a("maxWidth",n,r,e.dynamicProperty.has("constraint-size-max-width")),a("minHeight",i,r,e.dynamicProperty.has("constraint-size-min-height")),a("maxHeight",s,r,e.dynamicProperty.has("constraint-size-max-height")),r.size>0&&t.properties.set("constraintSize",r)}],[(0,o.hasCommonProperty)("align"),(0,o.enumPropertyParser)("align","Alignment.")],[(0,o.hasCommonProperty)("direction"),(0,o.enumPropertyParser)("direction","Direction.")],[function(e){return e.hasProperty("left")||e.hasProperty("top")},function(e,t){const r="absolute"===e.property.get("position")?"position":"offset",n=e.property.get("left"),a=e.property.get("top"),i=e.dynamicProperty.get("left"),s=e.dynamicProperty.get("top");if((0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(n)&&(0,o.isEmptyOrUndefined)(a))return;const p=new Map([["x",`${(0,o.quoteString)(null!=n?n:"0")}`],["y",`${(0,o.quoteString)(null!=a?a:"0")}`]]);(0,o.isEmptyOrUndefined)(i)||p.set("x",i),(0,o.isEmptyOrUndefined)(s)||p.set("y",s),t.properties.set(r,p)}],[(0,o.hasCommonProperty)("aspect-ratio"),(0,o.numberPropertyParser)("aspect-ratio")],[(0,o.hasCommonProperty)("display-priority"),(0,o.numberPropertyParser)("display-priority")],[(0,o.hasCommonProperty)("flex-basis"),(0,o.stringPropertyParser)("flex-basis")],[(0,o.hasCommonProperty)("flex-grow"),(0,o.numberPropertyParser)("flex-grow")],[(0,o.hasCommonProperty)("flex-shrink"),(0,o.numberPropertyParser)("flex-shrink")],[(0,o.hasCommonProperty)("align-self"),function(e,t){const r=e.dynamicProperty.get("align-self");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignSelf",r);const n=e.property.get("align-self");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.dealWithAlignSelf)(n);t.properties.set("alignSelf",a)}],[function(e){return e.hasProperty("border-style")||e.hasProperty("border-top-style")||e.hasProperty("border-right-style")||e.hasProperty("border-bottom-style")||e.hasProperty("border-left-style")},function(e,t){const r=new Map,n=e.getProperty("border-style"),a=e.getProperty("border-top-style"),s=e.getProperty("border-bottom-style"),p=e.getProperty("border-left-style"),l=e.getProperty("border-right-style"),c=e.dynamicProperty.has("border-style"),u=(0,o.getBorderDirections)("border-style");for(const t of u)i(e,"border-style",t,r,(0,o.curry)(o.getEtsEnumValue)("BorderStyle."));(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-style"),c?n:(0,o.getEtsEnumValue)("BorderStyle.",n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-style"),r)}],[function(e){return e.hasProperty("border-width")||e.hasProperty("border-top-width")||e.hasProperty("border-right-width")||e.hasProperty("border-bottom-width")||e.hasProperty("border-left-width")},function(e,t){const r=new Map,n=e.getProperty("border-width"),i=e.getProperty("border-top-width"),s=e.getProperty("border-bottom-width"),p=e.getProperty("border-left-width"),l=e.getProperty("border-right-width"),c=e.property.has("border-top-width"),u=e.property.has("border-bottom-width"),y=e.property.has("border-left-width"),d=e.property.has("border-right-width"),f=e.dynamicProperty.has("border-width"),m=e.dynamicProperty.has("border-top-width"),g=e.dynamicProperty.has("border-bottom-width"),h=e.dynamicProperty.has("border-left-width"),E=e.dynamicProperty.has("border-right-width");(0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-width"),f?n:(0,o.quoteString)(n)):(a("top",null!=i?i:n,r,m||!c&&f),a("bottom",null!=s?s:n,r,g||!u&&f),a("left",null!=p?p:n,r,h||!y&&f),a("right",null!=l?l:n,r,E||!d&&f),r.size>0&&t.properties.set((0,o.getEtsPropName)("border-width"),r))}],[function(e){return e.hasProperty("border-color")||e.hasProperty("border-top-color")||e.hasProperty("border-right-color")||e.hasProperty("border-bottom-color")||e.hasProperty("border-left-color")},function(e,t){const r=new Map,n=e.getProperty("border-color"),a=e.getProperty("border-top-color"),s=e.getProperty("border-bottom-color"),p=e.getProperty("border-left-color"),l=e.getProperty("border-right-color"),c=e.dynamicProperty.has("border-color"),u=(0,o.getBorderDirections)("border-color");for(const t of u)i(e,"border-color",t,r,o.dealWithColor);(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-color"),c?n:(0,o.dealWithColor)(n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-color"),r)}],[function(e){return e.hasProperty("border-radius")||e.hasProperty("border-top-left-radius")||e.hasProperty("border-top-right-radius")||e.hasProperty("border-bottom-right-radius")||e.hasProperty("border-bottom-left-radius")},function(e,t){const r=new Map,n=e.getProperty("border-radius"),a=e.getProperty("border-top-left-radius"),s=e.getProperty("border-top-right-radius"),p=e.getProperty("border-bottom-left-radius"),l=e.getProperty("border-bottom-right-radius"),c=e.dynamicProperty.has("border-radius"),u=(0,o.getBorderDirections)("border-radius");for(const t of u)i(e,"border-radius",t,r,o.quoteString);(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-radius"),c?n:(0,o.quoteString)(n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-radius"),r)}],[(0,o.hasCommonProperty)("background-color"),(0,o.colorPropertyParser)("background-color")],[function(e){return e.hasProperty("background-image-src")||e.hasProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),a=e.property.get("background-image-repeat"),i=e.dynamicProperty.get("background-image-src"),s=e.dynamicProperty.get("background-image-repeat");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s))return;let p=(0,n.dealWithSrc)(null!=r?r:"");if((0,o.isEmptyOrUndefined)(i)||(p=i),(0,o.isEmptyOrUndefined)(s)){if(!(0,o.isEmptyOrUndefined)(a)){const e=(0,o.dealWithBackgroundRepeat)(a);null!=e&&""!==e&&(p=p+", "+e)}}else p=p+", "+s;t.properties.set("backgroundImage",p)}],[(0,o.hasCommonProperty)("background-image-size"),function(e,t){const r=e.dynamicProperty.get("background-image-size");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("backgroundImageSize",r);const n=e.property.get("background-image-size");if((0,o.isEmptyOrUndefined)(n))return;if(""!==(0,o.getBackgroundImageSizeEnumValue)(n))return void t.properties.set("backgroundImageSize",(0,o.getEtsEnumValue)("ImageSize.",n));const a=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);null!==a&&(void 0!==a[5]?t.properties.set("backgroundImageSize",new Map([["width",`${(0,o.quoteString)(a[1])}`],["height",`${(0,o.quoteString)(a[5])}`]])):t.properties.set("backgroundImageSize",new Map([["width",`${(0,o.quoteString)(a[1])}`]])))}],[(0,o.hasCommonProperty)("background-image-position"),function(e,t){const r=e.dynamicProperty.get("background-image-position");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("backgroundImagePosition",r);const n=e.property.get("background-image-position");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.getBackgroundImagePositionEnumValue)(n);if(""!==a)return void t.properties.set("backgroundImagePosition",a);const i=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);null!==i&&t.properties.set("backgroundImagePosition",new Map([["x",`${(0,o.quoteString)(i[1])}`],["y",`${(0,o.quoteString)(i[4])}`]]))}],[(0,o.hasCommonProperty)("opacity"),(0,o.numberPropertyParser)("opacity")],[(0,o.hasCommonProperty)("visibility"),(0,o.enumPropertyParser)("visibility","Visibility.")],[(0,o.hasCommonProperty)("enabled"),(0,o.booleanPropertyParser)("enabled")],[(0,o.hasCommonProperty)("font-color"),(0,o.colorPropertyParser)("font-color")],[function(e){return e.hasProperty("margin")||e.hasProperty("margin-left")||e.hasProperty("margin-top")||e.hasProperty("margin-right")||e.hasProperty("margin-bottom")},function(e,t){var r,o,n,i;const s=new Map,p=e.getProperty("margin"),l=null!==(r=e.getProperty("margin-top"))&&void 0!==r?r:p,c=null!==(o=e.getProperty("margin-bottom"))&&void 0!==o?o:p,u=null!==(n=e.getProperty("margin-left"))&&void 0!==n?n:p,y=null!==(i=e.getProperty("margin-right"))&&void 0!==i?i:p,d=e.property.has("margin-top"),f=e.property.has("margin-bottom"),m=e.property.has("margin-left"),g=e.property.has("margin-right"),h=e.dynamicProperty.has("margin"),E=e.dynamicProperty.has("margin-top"),T=e.dynamicProperty.has("margin-bottom"),S=e.dynamicProperty.has("margin-left"),P=e.dynamicProperty.has("margin-right");a("top",l,s,E||!d&&h),a("bottom",c,s,T||!f&&h),a("left",u,s,S||!m&&h),a("right",y,s,P||!g&&h),s.size>0&&t.properties.set("margin",s)}],[function(e){return e.hasProperty("padding")||e.hasProperty("padding-left")||e.hasProperty("padding-top")||e.hasProperty("padding-right")||e.hasProperty("padding-bottom")},function(e,t){var r,o,n,i;const s=new Map,p=e.getProperty("padding"),l=null!==(r=e.getProperty("padding-top"))&&void 0!==r?r:p,c=null!==(o=e.getProperty("padding-bottom"))&&void 0!==o?o:p,u=null!==(n=e.getProperty("padding-left"))&&void 0!==n?n:p,y=null!==(i=e.getProperty("padding-right"))&&void 0!==i?i:p,d=e.property.has("padding-top"),f=e.property.has("padding-bottom"),m=e.property.has("padding-left"),g=e.property.has("padding-right"),h=e.dynamicProperty.has("padding"),E=e.dynamicProperty.has("padding-top"),T=e.dynamicProperty.has("padding-bottom"),S=e.dynamicProperty.has("padding-left"),P=e.dynamicProperty.has("padding-right");a("top",l,s,E||!d&&h),a("bottom",c,s,T||!f&&h),a("left",u,s,S||!m&&h),a("right",y,s,P||!g&&h),s.size>0&&t.properties.set("padding",s)}]]},1778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dividerParserArray=void 0;const o=r(8122);t.dividerParserArray=[[(0,o.hasFeatureProperty)("divider","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("divider","color"),(0,o.colorPropertyParser)("color")],[(0,o.hasFeatureProperty)("divider","stroke-width"),(0,o.stringPropertyParser)("stroke-width")],[(0,o.hasFeatureProperty)("divider","line-cap"),(0,o.enumPropertyParser)("line-cap","LineCapStyle.")]]},5264:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithFlexAlignItems=t.flexParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t,r,n)=>{if(!(n.params instanceof Map))return;const a=r.dynamicProperty.get(e);if(!(0,o.isEmptyOrUndefined)(a))return void n.params.set((0,o.getEtsPropName)(e),a);const i=r.property.get(e);if((0,o.isEmptyOrUndefined)(i))return;let s=(0,o.getEtsEnumValue)(t,i);"flex-start"===i?s=t+"Start":"flex-end"===i&&(s=t+"End"),n.params.set((0,o.getEtsPropName)(e),s)}));function a(e){let t=(0,o.getEtsEnumValue)("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}t.flexParserArray=[[(0,o.hasFeatureProperty)("flex","flex-direction"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("flex-direction");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("direction",r);const n=e.property.get("flex-direction");(0,o.isEmptyOrUndefined)(n)||t.params.set("direction",(0,o.getEtsEnumValue)("FlexDirection.",n))}],[(0,o.hasFeatureProperty)("flex","wrap"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("wrap");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("wrap",r);const n=e.property.get("wrap");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.dealWithWrap)(n);t.params.set("wrap",a)}],[(0,o.hasFeatureProperty)("flex","justify-content"),n("justify-content","FlexAlign.")],[(0,o.hasFeatureProperty)("flex","align-items-flex"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-items-flex");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("alignItems",r);const n=e.property.get("align-items-flex");if((0,o.isEmptyOrUndefined)(n))return;const i=a(n);t.params.set("alignItems",i)}],[(0,o.hasFeatureProperty)("flex","align-content"),n("align-content","FlexAlign.")]],t.dealWithFlexAlignItems=a},2153:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridItemParserArray=t.gridParserArray=void 0;const o=r(8122);t.gridParserArray=[[(0,o.hasFeatureProperty)("grid","scroller"),o.scrollerParamParser],[(0,o.hasFeatureProperty)("grid","columns-template"),(0,o.stringPropertyParser)("columns-template")],[(0,o.hasFeatureProperty)("grid","rows-template"),(0,o.stringPropertyParser)("rows-template")],[(0,o.hasFeatureProperty)("grid","columns-gap"),(0,o.stringPropertyParser)("columns-gap")],[(0,o.hasFeatureProperty)("grid","rows-gap"),(0,o.stringPropertyParser)("rows-gap")],[(0,o.hasFeatureProperty)("grid","scroll-bar"),(0,o.enumPropertyParser)("scroll-bar","BarState.")],[(0,o.hasFeatureProperty)("grid","scroll-bar-color"),(0,o.colorPropertyParser)("scroll-bar-color")],[(0,o.hasFeatureProperty)("grid","scroll-bar-width"),(0,o.stringPropertyParser)("scroll-bar-width")],[(0,o.hasFeatureProperty)("grid","cached-count"),(0,o.numberPropertyParser)("cached-count")],[(0,o.hasFeatureProperty)("grid","edit-mode"),(0,o.booleanPropertyParser)("edit-mode")],[(0,o.hasFeatureProperty)("grid","layout-direction"),(0,o.enumPropertyParser)("layout-direction","GridDirection.")],[(0,o.hasFeatureProperty)("grid","max-count"),(0,o.numberPropertyParser)("max-count")],[(0,o.hasFeatureProperty)("grid","min-count"),(0,o.numberPropertyParser)("min-count")],[(0,o.hasFeatureProperty)("grid","cell-length"),(0,o.numberPropertyParser)("cell-length")],[(0,o.hasFeatureProperty)("grid","multi-selectable"),(0,o.booleanPropertyParser)("multi-selectable")],[(0,o.hasFeatureProperty)("grid","support-animation"),(0,o.booleanPropertyParser)("support-animation")]],t.gridItemParserArray=[[(0,o.hasFeatureProperty)("grid-item","row-start"),(0,o.numberPropertyParser)("row-start")],[(0,o.hasFeatureProperty)("grid-item","row-end"),(0,o.numberPropertyParser)("row-end")],[(0,o.hasFeatureProperty)("grid-item","column-start"),(0,o.numberPropertyParser)("column-start")],[(0,o.hasFeatureProperty)("grid-item","column-end"),(0,o.numberPropertyParser)("column-end")],[(0,o.hasFeatureProperty)("grid-item","force-rebuild"),(0,o.booleanPropertyParser)("force-rebuild")],[(0,o.hasFeatureProperty)("grid-item","selectable"),(0,o.booleanPropertyParser)("selectable")]]},9248:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithSrc=t.imageParserArray=t.isTargetComponent=void 0;const o=r(8122);function n(e){return null===e.match(/\$(r|rawfile)\('(.*)'\)$/)?(0,o.quoteString)(e):e}t.isTargetComponent=(0,o.curry)(((e,t)=>t.type===e)),t.imageParserArray=[[(0,t.isTargetComponent)("image"),function(e,t){var r;const a=e.dynamicProperty.get("src");if(!(0,o.isEmptyOrUndefined)(a))return void t.setParams(a);const i=null!==(r=e.property.get("src"))&&void 0!==r?r:"";t.setParams(n(i))}],[(0,o.hasFeatureProperty)("image","alt"),(0,o.stringPropertyParser)("alt")],[(0,o.hasFeatureProperty)("image","object-fit"),(0,o.enumPropertyParser)("object-fit","ImageFit.")],[(0,o.hasFeatureProperty)("image","object-repeat"),(0,o.enumPropertyParser)("object-repeat","ImageRepeat.")],[(0,o.hasFeatureProperty)("image","interpolation"),(0,o.enumPropertyParser)("interpolation","ImageInterpolation.")],[(0,o.hasFeatureProperty)("image","render-mode"),(0,o.enumPropertyParser)("render-mode","ImageRenderMode.")],[function(e){return e.hasProperty("source-size-width")||e.hasProperty("source-size-height")},function(e,t){let r=e.getProperty("source-size-width"),n=e.getProperty("source-size-height");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(n))return;const a=e.dynamicProperty.has("source-size-width"),i=e.dynamicProperty.has("source-size-height");r="0"===r||(0,o.isEmptyOrUndefined)(r)?"0":a?r:r.substring(0,r.length-2),n="0"===n||(0,o.isEmptyOrUndefined)(n)?"0":i?n:n.substring(0,n.length-2);const s=new Map([["width",r],["height",n]]);t.properties.set("sourceSize",s)}]],t.dealWithSrc=n},7907:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemParserArray=t.listParserArray=void 0;const o=r(8122);t.listParserArray=[[(0,o.hasFeatureProperty)("list","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("list","initial-index"),(0,o.rawDataParamParser)("initial-index")],[(0,o.hasFeatureProperty)("list","list-direction"),(0,o.enumPropertyParser)("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasProperty("divider-stroke-width")||e.hasProperty("divider-color")||e.hasProperty("divider-start-margin")||e.hasProperty("divider-end-margin"))},function(e,t){const r=e.property.get("divider-stroke-width"),n=e.dynamicProperty.get("divider-stroke-width"),a=new Map([["strokeWidth",`${(0,o.quoteString)(null!=r?r:"0")}`]]);(0,o.isEmptyOrUndefined)(n)||a.set("strokeWidth",n);const i=e.property.get("divider-color"),s=e.dynamicProperty.get("divider-color"),p=e.property.get("divider-start-margin"),l=e.dynamicProperty.get("divider-start-margin"),c=e.property.get("divider-end-margin"),u=e.dynamicProperty.get("divider-end-margin");(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||a.set("color",(0,o.dealWithColor)(i)):a.set("color",s),(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(p)||a.set("startMargin",(0,o.quoteString)(p)):a.set("startMargin",l),(0,o.isEmptyOrUndefined)(u)?(0,o.isEmptyOrUndefined)(c)||a.set("endMargin",(0,o.quoteString)(c)):a.set("endMargin",u),t.properties.set("divider",a)}],[(0,o.hasFeatureProperty)("list","edit-mode"),(0,o.booleanPropertyParser)("edit-mode")],[(0,o.hasFeatureProperty)("list","edge-effect"),(0,o.enumPropertyParser)("edge-effect","EdgeEffect.")],[(0,o.hasFeatureProperty)("list","chain-animation"),(0,o.booleanPropertyParser)("chain-animation")]],t.listItemParserArray=[[(0,o.hasFeatureProperty)("list-item","sticky"),(0,o.enumPropertyParser)("sticky","Sticky.")],[(0,o.hasFeatureProperty)("list-item","editable"),(0,o.booleanPropertyParser)("editable")]]},8191:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.navigationParserArray=void 0;const o=r(8122);t.navigationParserArray=[[(0,o.hasFeatureProperty)("navigation","navigation-title"),function(e,t){const r=e.getProperty("navigation-title"),n=e.dynamicProperty.get("navigation-title");(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||t.properties.set("title",(0,o.quoteString)(r)):t.properties.set("title",n)}],[(0,o.hasFeatureProperty)("navigation","subTitle"),(0,o.stringPropertyParser)("subTitle")],[(0,o.hasFeatureProperty)("navigation","menus"),(0,o.objectPropertyParser)("menus")],[(0,o.hasFeatureProperty)("navigation","titleMode"),(0,o.enumPropertyParser)("titleMode","NavigationTitleMode.")],[(0,o.hasFeatureProperty)("navigation","toolBar"),(0,o.objectPropertyParser)("toolBar")],[(0,o.hasFeatureProperty)("navigation","hideToolBar"),(0,o.booleanPropertyParser)("hideToolBar")],[(0,o.hasFeatureProperty)("navigation","hideTitleBar"),(0,o.booleanPropertyParser)("hideTitleBar")],[(0,o.hasFeatureProperty)("navigation","hideBackButton"),(0,o.booleanPropertyParser)("hideBackButton")]]},2565:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textPickerParserArray=t.datePickerParserArray=t.timePickerParserArray=void 0;const o=r(8122);t.timePickerParserArray=[[(0,o.hasFeatureProperty)("timePicker","datetime-selected"),(0,o.dateParamParser)("datetime-selected","selected")],[(0,o.hasFeatureProperty)("timePicker","useMilitaryTime"),(0,o.booleanPropertyParser)("useMilitaryTime")]],t.datePickerParserArray=[[(0,o.hasFeatureProperty)("datePicker","datetime-selected"),(0,o.dateParamParser)("datetime-selected","selected")],[(0,o.hasFeatureProperty)("datePicker","start"),(0,o.dateParamParser)("start","start")],[(0,o.hasFeatureProperty)("datePicker","end"),(0,o.dateParamParser)("end","end")],[(0,o.hasFeatureProperty)("datePicker","lunar"),(0,o.booleanPropertyParser)("lunar")]],t.textPickerParserArray=[[(0,o.hasFeatureProperty)("textPicker","range"),(0,o.arrayParamParser)("range")],[(0,o.hasFeatureProperty)("textPicker","textPicker-selected"),(0,o.customRawDataParamParser)("textPicker-selected","selected")],[(0,o.hasFeatureProperty)("textPicker","defaultPickerItemHeight"),(0,o.stringPropertyParser)("defaultPickerItemHeight")]]},8483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.progressParserArray=void 0;const o=r(8122);t.progressParserArray=[[function(e){return"progress"===e.type&&(e.hasProperty("value")||e.hasProperty("total")||e.hasProperty("style"))},function(e,t){var r;(0,o.dynamicParamParser)("value",e,t)||t.params instanceof Map&&t.params.set("value",null!==(r=e.getProperty("value"))&&void 0!==r?r:"0")}],[(0,o.hasFeatureProperty)("progress","total"),(0,o.rawDataParamParser)("total")],[(0,o.hasFeatureProperty)("progress","style"),(0,o.enumParamParser)("style","ProgressStyle.")],[(0,o.hasFeatureProperty)("progress","color"),(0,o.colorPropertyParser)("color")]]},4925:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshParserArray=void 0;const o=r(8122);t.refreshParserArray=[[(0,o.hasFeatureProperty)("refresh","friction"),(0,o.rawDataParamParser)("friction")],[(0,o.hasFeatureProperty)("refresh","offset"),(0,o.stringParamParser)("offset")],[(0,o.hasFeatureProperty)("refresh","refreshing"),(0,o.booleanParamParser)("refreshing")]]},1790:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithRowAlignItems=t.dealWithColumnAlignItems=t.rowParserArray=t.columnParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t,r,n)=>{if(!(n.properties instanceof Map))return;const a=r.dynamicProperty.get(e);if(!(0,o.isEmptyOrUndefined)(a))return void n.properties.set("justifyContent",a);const i=r.property.get(e);if((0,o.isEmptyOrUndefined)(i))return;let s=(0,o.getEtsEnumValue)(t,i);"flex-start"===i?s=t+"Start":"flex-end"===i&&(s=t+"End"),n.properties.set("justifyContent",s)}));function a(e){let t=(0,o.getEtsEnumValue)("HorizontalAlign.",e);return"flex-start"===e?t="HorizontalAlign.Start":"flex-end"===e&&(t="HorizontalAlign.End"),t}function i(e){let t=(0,o.getEtsEnumValue)("VerticalAlign.",e);return"flex-start"===e?t="VerticalAlign.Top":"flex-end"===e&&(t="VerticalAlign.Bottom"),t}t.columnParserArray=[[(0,o.hasFeatureProperty)("column","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("column","align-items-column"),function(e,t){const r=e.dynamicProperty.get("align-items-column");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-column");if((0,o.isEmptyOrUndefined)(n))return;const i=a(n);t.properties.set("alignItems",i)}],[(0,o.hasFeatureProperty)("column","justify-content-rc"),n("justify-content-rc","FlexAlign.")]],t.rowParserArray=[[(0,o.hasFeatureProperty)("row","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("row","align-items-row"),function(e,t){const r=e.dynamicProperty.get("align-items-row");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-row");if((0,o.isEmptyOrUndefined)(n))return;const a=i(n);t.properties.set("alignItems",a)}],[(0,o.hasFeatureProperty)("row","justify-content-rc"),n("justify-content-rc","FlexAlign.")]],t.dealWithColumnAlignItems=a,t.dealWithRowAlignItems=i},7375:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollParserArray=void 0;const o=r(8122);t.scrollParserArray=[[(0,o.hasFeatureProperty)("scroll","scrollable"),(0,o.enumPropertyParser)("scrollable","ScrollDirection.")],[(0,o.hasFeatureProperty)("scroll","scroll-bar"),(0,o.enumPropertyParser)("scroll-bar","BarState.")],[(0,o.hasFeatureProperty)("scroll","scroll-bar-color"),(0,o.colorPropertyParser)("scroll-bar-color")],[(0,o.hasFeatureProperty)("scroll","scroll-bar-width"),(0,o.stringPropertyParser)("scroll-bar-width")],[(0,o.hasFeatureProperty)("scroll","edge-effect-scroll"),function(e,t){const r="edge-effect-scroll";if((0,o.dynamicPropertyParser)(r,e,t))return;const n=e.property.get(r);(0,o.isEmptyOrUndefined)(n)||t.properties.set("edgeEffect",(0,o.getEtsEnumValue)("EdgeEffect.",n))}],[(0,o.hasFeatureProperty)("scroll","scroller"),o.scrollerParamParser]]},9284:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchParserArray=void 0;const o=r(8122),n=r(8014);function a(e,t,r,n){const a=new Map([["value","search-value"],["placeholder","search-placeholder"],["icon","icon"],["controller","search-controller"]]).get(e);if(void 0===a)return;const i=r.getProperty(a),s=r.dynamicProperty.get(a);"controller"!==e||(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||t.push(`${e}: ${(0,o.quoteString)(i)}`):t.push(`${e}: ${(0,o.getContentName)(s)}`):t.push(`${e}: ${s}`)}t.searchParserArray=[[(0,o.hasFeatureProperty)("search","text-font-size"),(0,n.selectFontParser)("text-font","size")],[(0,o.hasFeatureProperty)("search","text-font-style"),(0,n.selectFontParser)("text-font","style")],[(0,o.hasFeatureProperty)("search","text-font-weight"),(0,n.selectFontParser)("text-font","weight")],[(0,o.hasFeatureProperty)("search","text-font-family"),(0,n.selectFontParser)("text-font","family")],[(0,o.hasFeatureProperty)("search","placeholder-font-size"),(0,n.selectFontParser)("placeholder-font","size")],[(0,o.hasFeatureProperty)("search","placeholder-font-style"),(0,n.selectFontParser)("placeholder-font","style")],[(0,o.hasFeatureProperty)("search","placeholder-font-weight"),(0,n.selectFontParser)("placeholder-font","weight")],[(0,o.hasFeatureProperty)("search","placeholder-font-family"),(0,n.selectFontParser)("placeholder-font","family")],[(0,o.hasFeatureProperty)("search","placeholderColor"),(0,o.colorPropertyParser)("placeholderColor")],[(0,o.hasFeatureProperty)("search","search-text-align"),o.searchTextAlign],[function(e){return"search"===e.type},function(e,t){const r=[];a("value",r,e),a("placeholder",r,e),a("icon",r,e),a("controller",r,e),t.setParams(`{${r.join(", ")}}`)}],[(0,o.hasFeatureProperty)("search","search-button"),(0,o.stringPropertyParser)("search-button")],[(0,o.hasFeatureProperty)("search","copy-option"),(0,o.enumPropertyParser)("copy-option","CopyOptions.")]]},8014:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectParserArray=t.selectFontParser=void 0;const o=r(8122);t.selectFontParser=(0,o.curry)(((e,t,r,n)=>{let a=n.properties.get((0,o.getEtsPropName)(e));void 0===a&&(a=new Map);const i=`${e}-${t}`,s=r.property.get(i),p=r.dynamicProperty.get(i);"string"!=typeof a&&((0,o.isEmptyOrUndefined)(p)?(0,o.isEmptyOrUndefined)(s)||("size"!==t&&"family"!==t||a.set(t,(0,o.quoteString)(s)),"style"===t&&a.set(t,(0,o.getEtsEnumValue)("FontStyle.",s)),"weight"===t&&a.set(t,(0,o.dealWithFontWeight)(s))):a.set(t,p)),n.properties.set((0,o.getEtsPropName)(e),a)})),t.selectParserArray=[[(0,o.hasSelectOption)("select","select-option"),function(e,t){const r=e.dynamicProperty.get("select-option");t.setParams(null!=r?r:'[{value: ""}]')}],[(0,o.hasFeatureProperty)("select","select-value"),function(e,t){const r=e.getProperty("select-value"),n=e.dynamicProperty.get("select-value");(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||t.properties.set("value",(0,o.quoteString)(r)):t.properties.set("value",(0,o.getContentName)(n))}],[(0,o.hasFeatureProperty)("select","selected"),(0,o.numberPropertyParser)("selected")],[(0,o.hasFeatureProperty)("select","font-size"),(0,t.selectFontParser)("font","size")],[(0,o.hasFeatureProperty)("select","font-style"),(0,t.selectFontParser)("font","style")],[(0,o.hasFeatureProperty)("select","font-weight"),(0,t.selectFontParser)("font","weight")],[(0,o.hasFeatureProperty)("select","font-family"),(0,t.selectFontParser)("font","family")],[(0,o.hasFeatureProperty)("select","selected-option-font-size"),(0,t.selectFontParser)("selected-option-font","size")],[(0,o.hasFeatureProperty)("select","selected-option-font-style"),(0,t.selectFontParser)("selected-option-font","style")],[(0,o.hasFeatureProperty)("select","selected-option-font-weight"),(0,t.selectFontParser)("selected-option-font","weight")],[(0,o.hasFeatureProperty)("select","selected-option-font-family"),(0,t.selectFontParser)("selected-option-font","family")],[(0,o.hasFeatureProperty)("select","selected-option-font-color"),(0,o.colorPropertyParser)("selected-option-font-color")],[(0,o.hasFeatureProperty)("select","selected-option-bg-color"),(0,o.colorPropertyParser)("selected-option-bg-color")],[(0,o.hasFeatureProperty)("select","option-font-size"),(0,t.selectFontParser)("option-font","size")],[(0,o.hasFeatureProperty)("select","option-font-style"),(0,t.selectFontParser)("option-font","style")],[(0,o.hasFeatureProperty)("select","option-font-weight"),(0,t.selectFontParser)("option-font","weight")],[(0,o.hasFeatureProperty)("select","option-font-family"),(0,t.selectFontParser)("option-font","family")],[(0,o.hasFeatureProperty)("select","option-font-color"),(0,o.colorPropertyParser)("option-font-color")],[(0,o.hasFeatureProperty)("select","option-bg-color"),(0,o.colorPropertyParser)("option-bg-color")]]},2563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sliderParserArray=void 0;const o=r(8122);t.sliderParserArray=[[(0,o.hasFeatureProperty)("slider","value"),(0,o.rawDataParamParser)("value")],[(0,o.hasFeatureProperty)("slider","min"),(0,o.rawDataParamParser)("min")],[(0,o.hasFeatureProperty)("slider","max"),(0,o.rawDataParamParser)("max")],[(0,o.hasFeatureProperty)("slider","step"),(0,o.rawDataParamParser)("step")],[(0,o.hasFeatureProperty)("slider","style"),(0,o.enumParamParser)("style","SliderStyle.")],[(0,o.hasFeatureProperty)("slider","block-color"),(0,o.colorPropertyParser)("block-color")],[(0,o.hasFeatureProperty)("slider","track-color"),(0,o.colorPropertyParser)("track-color")],[(0,o.hasFeatureProperty)("slider","selected-color"),(0,o.colorPropertyParser)("selected-color")],[(0,o.hasFeatureProperty)("slider","show-steps"),(0,o.booleanPropertyParser)("show-steps")],[(0,o.hasFeatureProperty)("slider","show-tips"),(0,o.booleanPropertyParser)("show-tips")]]},8936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackParserArray=void 0;const o=r(8122);t.stackParserArray=[[(0,o.hasFeatureProperty)("stack","align-content-stack"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-content-stack");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("alignContent",r);const n=e.property.get("align-content-stack");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.getEtsEnumValue)("Alignment.",n);t.params.set((0,o.getEtsPropName)("alignContent"),a)}]]},780:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.swiperParserArray=void 0;const o=r(8122);t.swiperParserArray=[[(0,o.hasFeatureProperty)("swiper","index"),(0,o.numberPropertyParser)("index")],[(0,o.hasFeatureProperty)("swiper","auto-play"),(0,o.booleanPropertyParser)("auto-play")],[(0,o.hasFeatureProperty)("swiper","interval"),(0,o.numberPropertyParser)("interval")],[(0,o.hasFeatureProperty)("swiper","indicator"),(0,o.booleanPropertyParser)("indicator")],[(0,o.hasFeatureProperty)("swiper","loop"),(0,o.booleanPropertyParser)("loop")],[(0,o.hasFeatureProperty)("swiper","duration"),(0,o.numberPropertyParser)("duration")],[(0,o.hasFeatureProperty)("swiper","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("swiper","item-space"),(0,o.stringPropertyParser)("item-space")],[(0,o.hasFeatureProperty)("swiper","cached-count"),(0,o.numberPropertyParser)("cached-count")],[(0,o.hasFeatureProperty)("swiper","disable-swipe"),(0,o.booleanPropertyParser)("disable-swipe")]]},7036:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabContentParserArray=void 0;const o=r(8122),n=r(9248);t.tabContentParserArray=[[function(e){return"tab-content"===e.type&&(e.hasProperty("tabBar-icon")||e.hasProperty("tabBar-text"))},function(e,t){var r,a;const i=new Map,s=null!==(r=e.getProperty("tabBar-icon"))&&void 0!==r?r:"",p=null!==(a=e.getProperty("tabBar-text"))&&void 0!==a?a:"TabBar",l=e.dynamicProperty.has("tabBar-text"),c=e.dynamicProperty.has("tabBar-icon");(0,o.isEmptyOrUndefined)(s)||i.set("icon",c?s:(0,n.dealWithSrc)(s)),void 0!==p&&i.set("text",l?p:(0,o.quoteString)(p)),i.size>0&&t.properties.set("tabBar",i)}]]},2973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabsParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t)=>{const r=e.dynamicProperty.get("tabs-scrollable");if(void 0!==r&&""!==r.trim())return void t.properties.set("scrollable",r);const n=e.property.get("tabs-scrollable");(0,o.isEmptyOrUndefined)(n)||t.properties.set("scrollable",n)}));t.tabsParserArray=[[(0,o.hasFeatureProperty)("tabs","bar-position"),(0,o.enumParamParser)("bar-position","BarPosition.")],[(0,o.hasFeatureProperty)("tabs","index"),(0,o.rawDataParamParser)("index")],[(0,o.hasFeatureProperty)("tabs","controller"),(0,o.rawDataParamParser)("controller")],[(0,o.hasFeatureProperty)("tabs","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("tabs","tabs-scrollable"),n],[(0,o.hasFeatureProperty)("tabs","bar-mode"),(0,o.enumPropertyParser)("bar-mode","BarMode.")],[(0,o.hasFeatureProperty)("tabs","bar-width"),(0,o.stringPropertyParser)("bar-width")],[(0,o.hasFeatureProperty)("tabs","bar-height"),(0,o.stringPropertyParser)("bar-height")],[(0,o.hasFeatureProperty)("tabs","animation-duration"),(0,o.numberPropertyParser)("animation-duration")]]},1162:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textInputParserArray=void 0;const o=r(8122);t.textInputParserArray=[[(0,o.hasFeatureProperty)("text-input","placeholder"),(0,o.stringParamParser)("placeholder")],[(0,o.hasFeatureProperty)("text-input","textInput-type"),function(e,t){const r=e.dynamicProperty.get("textInput-type");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("type",r);const n=e.property.get("textInput-type");(0,o.isEmptyOrUndefined)(n)||t.properties.set("type","InputType."+n)}],[(0,o.hasFeatureProperty)("text-input","placeholderColor"),(0,o.colorPropertyParser)("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasProperty("placeholderFont-size")||e.hasProperty("placeholderFont-weight")||e.hasProperty("placeholderFont-family")||e.hasProperty("placeholderFont-style"))},function(e,t){const r=e.property.get("placeholderFont-size"),n=e.dynamicProperty.get("placeholderFont-size"),a=e.property.get("placeholderFont-weight"),i=e.dynamicProperty.get("placeholderFont-weight"),s=e.property.get("placeholderFont-family"),p=e.dynamicProperty.get("placeholderFont-family"),l=e.property.get("placeholderFont-style"),c=e.dynamicProperty.get("placeholderFont-style"),u=new Map;(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||u.set("size",parseInt(r)):u.set("size",n),(0,o.isEmptyOrUndefined)(i)?(0,o.isEmptyOrUndefined)(a)||u.set("weight",isNaN(Number(a))?(0,o.getEtsEnumValue)("FontWeight.",a):a):u.set("weight",i),(0,o.isEmptyOrUndefined)(p)?(0,o.isEmptyOrUndefined)(s)||u.set("family",(0,o.quoteString)(s)):u.set("family",p),(0,o.isEmptyOrUndefined)(c)?(0,o.isEmptyOrUndefined)(l)||u.set("style",(0,o.getEtsEnumValue)("FontStyle.",l)):u.set("style",c),t.properties.set("placeholderFont",u)}],[(0,o.hasFeatureProperty)("text-input","enterKeyType"),(0,o.enumPropertyParser)("enterKeyType","EnterKeyType.")],[(0,o.hasFeatureProperty)("text-input","caretColor"),(0,o.colorPropertyParser)("caretColor")],[(0,o.hasFeatureProperty)("text-input","maxLength"),(0,o.numberPropertyParser)("maxLength")]]},8681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textParserArray=void 0;const o=r(8122);t.textParserArray=[[(0,o.hasFeatureProperty)("text","content"),o.contentParamParser],[(0,o.hasFeatureProperty)("text","text-align"),(0,o.enumPropertyParser)("text-align","TextAlign.")],[(0,o.hasFeatureProperty)("text","text-overflow"),function(e,t){const r=e.dynamicProperty.get("text-overflow");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("textOverflow",new Map([["overflow",r]]));const n=e.property.get("text-overflow");(0,o.isEmptyOrUndefined)(n)||t.properties.set("textOverflow",new Map([["overflow","TextOverflow."+(0,o.firstUpperCase)(n)]]))}],[(0,o.hasFeatureProperty)("text","max-lines"),(0,o.numberPropertyParser)("max-lines")],[(0,o.hasFeatureProperty)("text","line-height"),(0,o.stringPropertyParser)("line-height")],[function(e){return"text"===e.type&&(e.hasProperty("decoration-type")||e.hasProperty("decoration-color"))},function(e,t){const r=e.property.get("decoration-type"),n=e.dynamicProperty.get("decoration-type"),a=e.property.get("decoration-color"),i=e.dynamicProperty.get("decoration-color");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(n)&&(0,o.isEmptyOrUndefined)(i))return;const s=new Map;(0,o.isEmptyOrUndefined)(n)?s.set("type",(0,o.isEmptyOrUndefined)(r)?"TextDecorationType.None":(0,o.getEtsEnumValue)("TextDecorationType.",r)):s.set("type",n),t.properties.set("decoration",s),(0,o.isEmptyOrUndefined)(i)?(0,o.isEmptyOrUndefined)(a)||s.set("color",(0,o.dealWithColor)(a)):s.set("color",i)}],[(0,o.hasFeatureProperty)("text","baseline-offset"),(0,o.stringPropertyParser)("baseline-offset")],[(0,o.hasFeatureProperty)("text","text-case"),(0,o.enumPropertyParser)("text-case","TextCase.")],[(0,o.hasFeatureProperty)("text","font-size"),(0,o.stringPropertyParser)("font-size")],[(0,o.hasFeatureProperty)("text","font-style"),(0,o.enumPropertyParser)("font-style","FontStyle.")],[(0,o.hasFeatureProperty)("text","font-weight"),o.fontWeightPropertyParser],[(0,o.hasFeatureProperty)("text","font-family"),(0,o.stringPropertyParser)("font-family")]]},4313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleParseArray=void 0;const o=r(8122);t.toggleParseArray=[[(0,o.hasFeatureProperty)("toggle","toggle-type"),function(e,t){const r="toggle-type";if((0,o.customDynamicParamParser)(r,"type",e,t))return;const n=e.property.get(r);!(0,o.isEmptyOrUndefined)(n)&&t.params instanceof Map&&t.params.set("type",(0,o.getEtsEnumValue)("ToggleType.",n))}],[(0,o.hasFeatureProperty)("toggle","isOn"),(0,o.booleanParamParser)("isOn")],[(0,o.hasFeatureProperty)("toggle","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("toggle","switchPointColor"),(0,o.colorPropertyParser)("switchPointColor")]]},8122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBuilderUniqueName=t.getEdgeBorderDirection=t.getBorderDirections=t.dealWithAlignSelf=t.dealWithScrollEdgeEffect=t.dealWithBackgroundRepeat=t.dealWithBackgroundImageSize=t.dealWithBackgroundImagePosition=t.dealWithFontWeight=t.getContentName=t.scrollerParamParser=t.dealWithWrap=t.getBackgroundImageSizeEnumValue=t.getBackgroundImagePositionEnumValue=t.contentParamParser=t.labelParamParser=t.fontWeightPropertyParser=t.dealWithColor=t.getEtsEnumValue=t.getEtsPropName=t.parseTagName=t.firstUpperCase=t.getForEachObj=t.colorPropertyParser=t.enumParamParser=t.arrayParamParser=t.booleanParamParser=t.customRawDataParamParser=t.rawDataParamParser=t.dateParamParser=t.stringParamParser=t.dynamicParamParser=t.searchTextAlign=t.enumPropertyParser=t.booleanPropertyParser=t.numberPropertyParser=t.isEmptyOrUndefined=t.objectPropertyParser=t.stringPropertyParser=t.customDynamicParamParser=t.dynamicPropertyParser=t.quoteString=t.hasSelectOption=t.hasFeatureProperty=t.hasCommonProperty=t.curry=void 0;const o=r(1195),n=r(4294);function a(e){return(...t)=>t.lengtht.property.has(e)||t.dynamicProperty.has(e))),t.hasFeatureProperty=a(((e,t,r)=>r.type===e&&(r.property.has(t)||r.dynamicProperty.has(t)))),t.hasSelectOption=a(((e,t,r)=>r.type===e)),t.quoteString=i,t.dynamicPropertyParser=s,t.customDynamicParamParser=p,t.stringPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.properties.set(y(e),i(o))})),t.objectPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.properties.set(y(e),o)})),t.isEmptyOrUndefined=l,t.numberPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);l(o)||r.properties.set(y(e),o)})),t.booleanPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);l(o)||r.properties.set(y(e),o)})),t.enumPropertyParser=a(((e,t,r,o)=>{if(s(e,r,o))return;const n=r.property.get(e);l(n)||o.properties.set(y(e),d(t,n))})),t.searchTextAlign=function(e,t){const r=e.dynamicProperty.get("search-text-align");if(void 0!==r&&""!==r.trim())return void t.properties.set("textAlign",r);const o=e.property.get("search-text-align");l(o)||t.properties.set("textAlign",d("TextAlign.",o))},t.dynamicParamParser=c,t.stringParamParser=a(((e,t,r)=>{if(c(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.params instanceof Map&&r.params.set(y(e),i(o))})),t.dateParamParser=a(((e,t,r,o)=>{const n=r.dynamicProperty.get(e);if(void 0!==n&&""!==n.trim()&&o.params instanceof Map)return void o.params.set(t,n);const a=r.property.get(e);void 0!==a&&o.params instanceof Map&&o.params.set(t,(e=>void 0===e||""===e?"new Date()":"new Date ("+i(e)+")")(a))})),t.rawDataParamParser=a(((e,t,r)=>{if(c(e,t,r))return;const o=t.property.get(e);!l(o)&&r.params instanceof Map&&r.params.set(y(e),o)})),t.customRawDataParamParser=a(((e,t,r,o)=>{if(p(e,t,r,o))return;const n=r.property.get(e);!l(n)&&o.params instanceof Map&&o.params.set(t,n)})),t.booleanParamParser=a(((e,r,o)=>{(0,t.rawDataParamParser)(e,r,o)})),t.arrayParamParser=a(((e,r,o)=>{(0,t.rawDataParamParser)(e,r,o)})),t.enumParamParser=a(((e,t,r,o)=>{if(c(e,r,o))return;const n=r.property.get(e);!l(n)&&o.params instanceof Map&&o.params.set(y(e),d(t,n))})),t.colorPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;let o=t.property.get(e);l(o)||(o=f(o),r.properties.set(y(e),o))})),t.getForEachObj=function(e){var t,r;const o=e.dynamicProperty.get("for"),n=e.dynamicProperty.get("keyGenerator"),a=null!==(t=e.property.get("item"))&&void 0!==t?t:"item",i=null!==(r=e.property.get("idx"))&&void 0!==r?r:"idx";return void 0!==e.dynamicProperty.get("for")?{for:o,key:n,item:a,idx:i}:null},t.firstUpperCase=u,t.parseTagName=function(e){return(0,n.getTagName)(e).split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")},t.getEtsPropName=y,t.getEtsEnumValue=d,t.dealWithColor=f,t.fontWeightPropertyParser=function(e,t){const r=e.getProperty("font-weight");if(l(r))return;const o=g(r);t.properties.set("fontWeight",o)},t.labelParamParser=function(e,t){const r=e.dynamicProperty.get("label");if(!l(r))return void t.setParams(m(r));const o=e.property.get("label");"string"==typeof o&&t.setParams(i(o))},t.contentParamParser=function(e,t){const r=e.property.get("content"),o=e.dynamicProperty.get("content");l(o)?"string"==typeof r&&t.setParams(i(r)):t.setParams(m(o))},t.getBackgroundImagePositionEnumValue=function(e){const t=new Map([["top left","TopStart"],["top center","Top"],["top right","TopEnd"],["center left","Start"],["center center","Center"],["center right","End"],["bottom left","BottomStart"],["bottom center","Bottom"],["bottom right","BottomEnd"]]);return t.has(e)?`Alignment.${String(t.get(e))}`:""},t.getBackgroundImageSizeEnumValue=function(e){return new Set(["cover","contain","auto"]).has(e)?d("ImageSize.",e):""},t.dealWithWrap=function(e){let t=d("FlexWrap.",e);return"nowrap"===e&&(t="FlexWrap.NoWrap"),t},t.scrollerParamParser=function(e,t){const r=e.dynamicProperty.get("scroller");l(r)||t.setParams(r)},t.getContentName=m,t.dealWithFontWeight=g,t.dealWithBackgroundImagePosition=function(e){if(new Set(["TopStart","Top","TopEnd","Start","Center","End","BottomStart","Bottom","BottomEnd"]).has(e))return"Alignment."+e;const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null!==t?`{ x: ${i(t[1])}, y: ${i(t[4])} }`:void 0},t.dealWithBackgroundImageSize=function(e){if(new Set(["Cover","Contain","Auto"]).has(e))return d("ImageSize.",e);const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null!==t?void 0!==t[5]?`{ width: ${i(t[1])}, height: ${i(t[5])} }`:`{ width: ${i(t[1])} }`:void 0},t.dealWithBackgroundRepeat=function(e){const t=new Map([["repeat-x","X"],["repeat-y","Y"],["repeat","XY"],["no-repeat","NoRepeat"]]).get(e);if(null!=t&&""!==t)return d("ImageRepeat.",t)},t.dealWithScrollEdgeEffect=function(e){var t;const r=d("EdgeEffect.",e);return null!==(t=new Map([["Spring","EdgeEffect.Spring"],["Fade","EdgeEffect.Fade"],["None","EdgeEffect.None"]]).get(r))&&void 0!==t?t:r},t.dealWithAlignSelf=function(e){let t=d("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t},t.getBorderDirections=function(e){return"border-width"===e?["border-top-width","border-bottom-width","border-left-width","border-right-width"]:"border-color"===e?["border-top-color","border-bottom-color","border-left-color","border-right-color"]:"border-style"===e?["border-top-style","border-bottom-style","border-left-style","border-right-style"]:["border-top-left-radius","border-bottom-right-radius","border-bottom-left-radius","border-top-right-radius"]},t.getEdgeBorderDirection=function(e){var t;return e.includes("radius")?null!==(t=new Map([["border-top-left-radius","topLeft"],["border-top-right-radius","topRight"],["border-bottom-left-radius","bottomLeft"],["border-bottom-right-radius","bottomRight"]]).get(e))&&void 0!==t?t:e:e.split("-")[1]},t.getBuilderUniqueName=function(e,t){const r=`${y((0,n.getTagName)(e))}${u(y(t))}`;return`${r}_${(0,n.getUniqueId)(r)}`}},1912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.events=t.parseVisualModel=void 0;const o=r(8122),n=r(7150),a=r(1778),i=r(8916),s=r(9248),p=r(8483),l=r(2563),c=r(8681),u=r(1790),y=r(8191),d=r(2153),f=r(780),m=r(2565),g=r(4313),h=r(5264),E=r(7907),T=r(7375),S=r(8014),P=r(4925),v=r(1162),b=r(9284),_=r(8936),N=r(2973),C=r(7036),A=r(2218),O=r(1147);t.parseVisualModel=function(e,r){r.setTagName((0,o.parseTagName)(e.type));const n=(0,o.getForEachObj)(e);r.setForEachObj(n);const a=void 0!==e.dynamicProperty.get("if")?e.dynamicProperty.get("if"):e.property.get("if");void 0===a?r.setIfBoolean(null):r.setIfBoolean(a);for(const t of M)("boolean"==typeof t[0]||t[0](e))&&t[1](e,r);!function(e,r){var o;const n="onDisappear",a="onDisAppear";for(let o of t.events){const t=e.property.get(o);o===n&&(o=a),void 0!==t&&""!==t&&("this"===t.split(".")[0]?r.properties.set(o,t+".bind(this)"):r.properties.set(o,t))}if(void 0!==e.property.get("newFunction")){const t=null!==(o=e.property.get("newFunction"))&&void 0!==o?o:"{}",i=JSON.parse(t);Object.keys(i).forEach((e=>{var t;const o=null!==(t=i[e].eventCodeGen)&&void 0!==t?t:"";e===n&&(e=a),r.properties.set(e,o)}))}}(e,r)},t.events=["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange","onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop","onComplete","onError","onFinish","onChange","onSubmit","onEditChanged","onStateChange","onRefreshing","onSelect","onScroll","onScrollEdge","onScrollEnd","onScrollBegin","onTitleModeChange"];const M=[...n.commonParserArray,...i.buttonParserArray,...a.dividerParserArray,...s.imageParserArray,...p.progressParserArray,...l.sliderParserArray,...c.textParserArray,...u.columnParserArray,...u.rowParserArray,...h.flexParserArray,...E.listParserArray,...E.listItemParserArray,...f.swiperParserArray,...v.textInputParserArray,...y.navigationParserArray,...m.timePickerParserArray,...m.textPickerParserArray,...P.refreshParserArray,...g.toggleParseArray,...S.selectParserArray,...m.datePickerParserArray,...T.scrollParserArray,...d.gridParserArray,...d.gridItemParserArray,...b.searchParserArray,..._.stackParserArray,...N.tabsParserArray,...C.tabContentParserArray,...A.checkboxParseArray,...O.checkboxGroupParseArray]},3243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Style=t.Tag=void 0;const o=r(4117);class n extends o.ASTNode{constructor(e,t,r){super(),this.tagName=e,this.attributes=t,this.content=r}}t.Tag=n;class a extends o.ASTNode{constructor(e,t,r,o){super(),this.mediaQuery=void 0,this.kind=e,this.name=t,this.content=r,this.mediaQuery=o}}t.Style=a},3573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const o=r(3243),n=r(2334);class a{constructor(e){this.cache=e}visit(e){e instanceof o.Tag?this.genTag(e):e instanceof o.Style&&this.genStyle(e)}static getMethodGen(e){return void 0===a.instance?a.instance=new a(e):a.instance.setCache(e),a.instance}setCache(e){this.cache=e}genTag(e){if(this.cache.concat(n.TokenClass.TAG_START,e.tagName),this.cache.indentOff(),e.attributes.forEach(((e,t)=>{let r="";for(const t of e)r+='"'===t?""":"\n"===t?" ":t;this.cache.concat(n.TokenClass.SPACE,t,n.TokenClass.ASSIGN,n.TokenClass.LQUOTE,r,n.TokenClass.RQUOTE)})),null===e.content)this.cache.concat(n.TokenClass.EMPTY_TAG_END);else{if(this.cache.concat(n.TokenClass.TAG_END),"string"==typeof e.content){let t="";for(const r of e.content)t+="<"===r?"<":r;this.cache.concat(t)}else 0!==e.content.length&&(this.cache.concat(n.TokenClass.NEW_LINE),this.cache.incIndent(),this.cache.indentOn(),e.content.forEach((e=>{e.accept(this),this.cache.indentOff(),this.cache.concat(n.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.indentOn(),this.cache.decIndent());this.cache.concat(n.TokenClass.END_TAG_START,e.tagName,n.TokenClass.TAG_END)}}genStyle(e){void 0!==e.mediaQuery&&(this.cache.concat("@media"),this.cache.indentOff(),this.cache.concat(n.TokenClass.SPACE,e.mediaQuery,n.TokenClass.SPACE,n.TokenClass.LBRA,n.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent()),"IDStyle"===e.kind&&(this.cache.concat(n.TokenClass.ID_STYLE_START),this.cache.indentOff()),this.cache.concat(e.name,n.TokenClass.SPACE,n.TokenClass.LBRA,n.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent(),e.content.forEach(((e,t)=>{this.cache.concat(t,n.TokenClass.COLON,n.TokenClass.SPACE,e,n.TokenClass.SEMICOLON,n.TokenClass.NEW_LINE)})),this.cache.decIndent(),this.cache.concat(n.TokenClass.RBRA,n.TokenClass.NEW_LINE),void 0!==e.mediaQuery&&(this.cache.decIndent(),this.cache.concat(n.TokenClass.RBRA,n.TokenClass.NEW_LINE)),this.cache.concat(n.TokenClass.NEW_LINE)}}t.ASTNodeGenerator=a,a.instance=void 0},8844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CSSBridge=t.HMLBridge=void 0;const o=r(3243),n=r(7571);t.HMLBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map([["id",e.id]]);let r="";for(let[o,a]of e.property)(0,n.isAttribute)(o,e.type)?("string"!=typeof a&&(a=JSON.stringify(a)),t.set(o,a)):(0,n.isContent)(o)&&(r=a);if(e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}const a=new o.Tag(e.type,t,r);return"wrapper"===t.get("id")?new o.Tag("div",new Map,[a]):a}},t.CSSBridge=class{constructor(){this.errors=0,this.styles=[]}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}genIDStyle(e){var t;const r=t=>{const r=new Map;for(const[o,a]of t)(0,n.isStyle)(o,e.type)&&r.set(o,a);return r},a=r(e.property);a.size>0&&this.styles.push(new o.Style("IDStyle",e.id,a)),(null!==(t=e.mediaProperty)&&void 0!==t?t:new Map).forEach(((t,n)=>{const a=r(t);a.size>0&&this.styles.push(new o.Style("IDStyle",e.id,a,n))}));for(const t of e.children)t.accept(this)}visit(e){return this.genIDStyle(e),this.styles}}},1055:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genFACSS=t.genFAHML=void 0;const o=r(3573),n=r(1862);t.genFAHML=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" "));return e.accept(t),t.cache.toString()},t.genFACSS=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" "));return e.forEach((e=>{e.accept(t)})),t.cache.toString()}},7571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEvent=t.isData=t.isUnknown=t.isContent=t.isAttribute=t.isStyle=t.styleMap=void 0;const o=r(904),n=["width","height","min-width","min-height","max-width","max-height","padding","padding-start","padding-end","padding-top","padding-right","padding-bottom","padding-left","margin","margin-start","margin-end","margin-top","margin-right","margin-bottom","margin-left","border-width","border-style","border-color","border-radius","border-top-width","border-top-style","border-top-color","border-top-left-radius","border-right-width","border-right-style","border-right-color","border-top-right-radius","border-bottom-width","border-bottom-style","border-bottom-color","border-bottom-right-radius","border-left-width","border-left-style","border-left-color","border-bottom-left-radius","background-color","background","background-image","background-size","background-position","background-repeat","display","opacity","visibility","flex","flex-grow","flex-shrink","flex-basis","position","display","top","right","bottom","left","display-index","flex-weight","aspect-ratio"],a=["font-size","font-family","font-style","font-weight"],i=["text-align","line-height","text-decoration","letter-spacing","max-lines","text-overflow","allow-scale","min-font-size","max-font-size","font-size-step","prefer-font-sizes","color",...a],s=["allow-scale","text-decoration","color",...a],p=["text-color","allow-scale","icon-width","icon-height","radius",...a],l=["texton-color","textoff-color","text-padding","allow-scale",...a],c=["column-height","text-color","allow-scale","letter-spacing","text-decoration","line-height","opacity",...a],u=["text-color","allow-scale","letter-spacing",...a];t.styleMap=new Map([["common",new Set([...n])],["div",new Set(["flex-direction","overflow","flex-wrap","justify-content","align-items","align-content","grid-template-columns","grid-template-rows","grid-row-start","grid-row-end","grid-column-start","grid-column-end","grid-gap","grid-columns-gap","grid-rows-gap"])],["text",new Set([...i])],["image",new Set(["object-fit","match-text-direction","fit-original-size"])],["span",new Set([...s])],["input",new Set(["font-size","font-family","font-weight","color","placeholder-color","allow-scale"])],["button",new Set([...p])],["switch",new Set([...l])],["refresh",new Set(["progress-color"])],["divider",new Set(["stroke-width","line-cap","color"])],["chart",new Set(["stroke-width","radius","start-angle","total-angle","center-x","center-y","colors","weights"])],["picker",new Set([...c])],["picker-view",new Set(["color","font-size","selected-color","selected-font-size","focus-color","focus-font-size","disappear-color","disappear-font-size","font-family"])],["slider",new Set(["color","selected-color","block-color"])],["swiper",new Set(["indicator-color","indicator-selected-color","indicator-size","indicator-top","indicator-right","indicator-bottom","indicator-left"])],["list",new Set(["flex-direction","columns","item-extent","fade-color"])],["list-item",new Set(["column-span"])],["progress",new Set(["color","stroke-width","background-color","secondary-color","scale-width","scale-number","start-angle","total-angle","center-x","center-y","radius"])],["select",new Set(["font-family"])],["menu",new Set([...u])],["option",new Set(["color","font-family","allow-scale","font-size","font-weight","text-decoration"])],["video",new Set(["object-fit"])],["clock",new Set(["font-family"])]]);const y=new Map([["common",new Set(["id","ref","disabled","focusable","data","if","for"])],["image",new Set(["src","alt"])],["button",new Set(["type","value","icon","waiting"])],["refresh",new Set(["offset","refreshing","type","lasttime","friction"])],["input",new Set(["type","checked","name","value","placeholder","maxlength","enterkeytype","headericon"])],["switch",new Set(["checked","showtext","texton","textoff"])],["option",new Set(["value","selected","icon"])],["chart",new Set(["type","percent","datasets","options"])],["picker",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","value","vibrate"])],["picker-view",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","indicatorprefix","indicatorsuffix","vibrate"])],["slider",new Set(["min","max","step","showtips","showsteps","mode","value"])],["divider",new Set(["vertical"])],["list",new Set(["scrollpage","cachedcount","scrollbar","scrolleffect","shapemode","indexer","itemscale","itemcenter","updateeffect","scrollvibrate","initialindex","initialoffset"])],["list-item",new Set(["type","primary","section","sticky","stickyradius","clickeffect"])],["swiper",new Set(["index","autoplay","interval","indicator","digital","indicatordisabled","loop","duration","vertical"])],["progress",new Set(["type","percent","secondarypercent","clockwise"])],["menu",new Set(["target","title","type"])],["clock",new Set(["clockconfig","showdigit","hourswest"])],["badge",new Set(["placement","count","visible","maxcount","config","label"])],["video",new Set(["muted","src","autoplay","poster","controls","loop","starttime","direction","speed"])],["tabs",new Set(["index","vertical"])],["tab-bar",new Set(["mode"])],["tab-content",new Set(["scrollable"])]]),d=new Map([["common",new Set(["ontouchstart","ontouchmove","ontouchcancel","ontouchend","onclick","onlongpress","onfocus","onblur","onkey","onswipe"])],["image",new Set(["oncomplete","onerror"])],["input",new Set(["onchange","onenterkeyclick"])],["select",new Set(["onchange"])],["refresh",new Set(["onrefresh","onpulldown"])],["swiper",new Set(["onchange","onrotation"])],["list",new Set(["onindexerchange","onscroll","onscrollbottom","onscrolltop","onscrollend","onscrolltouchup","onrequestitem"])],["list-item",new Set(["onsticky"])],["menu",new Set(["onselected","oncancel"])],["picker",new Set(["oncolumnchange","onchange","oncancel"])],["picker-view",new Set(["oncolumnchange","onchange"])],["video",new Set(["onprepared","onstart","onpause","onfinish","onerror","onseeking","onseeked","ontimeupdate","onfullscreenchange","onstop"])],["tabs",new Set(["onchange"])],["switch",new Set(["onchange"])],["dialog",new Set(["oncancel"])],["slider",new Set(["onchange"])]]),f=new Map([["common",new Set(["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange"])],["image",new Set(["onComplete","onError","onFinish"])],["swiper",new Set(["onChange"])],["list",new Set(["onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop"])],["text-input",new Set(["onChange","onSubmit","onEditChanged"])],["refresh",new Set(["onStateChange","onRefreshing"])],["toggle",new Set(["onChange"])],["timePicker",new Set(["onChange"])],["textPicker",new Set(["onChange"])],["select",new Set(["onSelect"])],["datePicker",new Set(["onChange"])],["search",new Set(["onSubmit","onChange","onCopy","onCut","onPaste"])],["grid",new Set(["onScrollIndex","onItemDragStart","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDrop"])],["grid-item",new Set(["onSelect"])],["scroll",new Set(["onScroll","onScrollEdge","onScrollEnd","onScrollBegin"])],["navigation",new Set(["onTitleModeChange"])],["tabs",new Set(["onChange"])],["checkBox",new Set(["onChange"])],["checkboxGroup",new Set(["onChange"])]]);function m(e,t,r){const o=t.get(r);return void 0!==o&&o.has(e)}function g(e,r){return m(e,t.styleMap,"common")||m(e,t.styleMap,r)}function h(e,t){return(0,o.getDomain)()===o.Domain.ETS?m(e,f,"common")||m(e,f,t):E(e,t)||T(e,t)}function E(e,t){return m(e,y,"common")||m(e,y,t)}function T(e,t){return m(e,d,"common")||m(e,d,t)}t.isStyle=g,t.isAttribute=h,t.isContent=function(e){return"content"===e},t.isUnknown=function(e,t){return!g(e,t)&&!h(e,t)},t.isData=E,t.isEvent=T},2334:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.INDENT=" ",r.SPACE=" ",r.LQUOTE='"',r.RQUOTE='"',r.TAG_START="<",r.TAG_END=">",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxGroupProperties=t.checkboxProperties=void 0;const o=r(1513);t.checkboxProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"Select",property:"select-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Name",property:"name-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Group",property:"group-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}}],t.checkboxGroupProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"SelectAll",property:"selectAll-visual"},o.commonParamsForJudge),{defaults:!1})}]},3311:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dividerProperties=void 0;const o=r(1513);t.dividerProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign({name:"Vertical",property:"vertical-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"LineCap",property:"line-cap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.LINE_CAP_STYLE,defaults:"butt",list:[o.CLEAN_VALUE_NODE,{name:"Butt",value:"butt"},{name:"Round",value:"round"},{name:"Square",value:"square"}]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"StrokeWidth",property:"stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength}}]},3687:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flexProperties=void 0;const o=r(1513);t.flexProperties=[{propertySector:o.Sector.FLEXCHILD,propertySet:{name:"FlexBasis",property:"flex-basis-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength,defaults:"auto",fixedValues:["auto"],info:"The initial main size of a flex item. It sets the size of the content box otherwise set with box-sizing."}},{propertySector:o.Sector.FLEXCHILD,propertySet:{name:"AlignSelf",property:"align-self-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"auto",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Direction",property:"flex-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_DIRECTION,defaults:"row",list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"RowReverse",value:"row-reverse"},{name:"Column",value:"column"},{name:"ColumnReverse",value:"column-reverse"}],info:"The direction of flex."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Wrap",property:"wrap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_WRAP,defaults:"nowrap",list:[o.CLEAN_VALUE_NODE,{name:"NoWrap",value:"nowrap"},{name:"Wrap",value:"wrap"},{name:"WrapReverse",value:"wrap-reverse"}],info:"Whether flex items are forced onto one line or multiple lines."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"JustifyContent",property:"justify-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"JustifyContent",property:"justify-content-rc-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-flex-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"stretch",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignContent",property:"align-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Set the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis."}}]},4836:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridItemProperties=void 0;const o=r(1513);t.gridItemProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowStart",property:"row-start-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowEnd",property:"row-end-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnStart",property:"column-start-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnEnd",property:"column-end-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ForceRebuild",property:"force-rebuild-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selectable",property:"selectable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"true"}}]},6181:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridProperties=void 0;const o=r(1513);t.gridProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnsTemplate",property:"columns-template-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowsTemplate",property:"rows-template-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnsGap",property:"columns-gap-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength,defaults:0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowsGap",property:"rows-gap-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength,defaults:0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"LayoutDirection",property:"layout-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.GRID_DIRECTION,list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"Column",value:"column"},{name:"RowReverse",value:"row-reverse"},{name:"ColumnReverse",value:"column-reverse"}],defaults:"row"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MaxCount",property:"max-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER,defaults:1/0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MinCount",property:"min-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER,defaults:1}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"CellLength",property:"cell-length-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MultiSelectable",property:"multi-selectable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SupportAnimation",property:"support-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}}]},8840:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemProperties=void 0;const o=r(1513);t.listItemProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Sticky",property:"sticky-visual",type:o.TypeName.SELECT,etsType:o.EtsType.STICKY,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"Normal",value:"normal"}],defaults:"none"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Editable",property:"editable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}]},8124:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listProperties=void 0;const o=r(1513);t.listProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"InitialIndex",property:"initial-index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:{name:"ListDirection",property:"list-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.AXIS,list:[o.CLEAN_VALUE_NODE,{name:"Vertical",value:"vertical"},{name:"Horizontal",value:"horizontal"}],defaults:"vertical"}},{propertySector:o.Sector.MORE,propertySet:{name:"Color",property:"divider-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"StrokeWidth",property:"divider-stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"StartMargin",property:"divider-start-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"EndMargin",property:"divider-end-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"EditMode",property:"edit-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}},{propertySector:o.Sector.MORE,propertySet:{name:"EdgeEffect",property:"edge-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{name:"Spring",value:"spring"},{name:"None",value:"none"}],defaults:"spring"}},{propertySector:o.Sector.MORE,propertySet:{name:"ChainAnimation",property:"chain-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}]},5452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.navigationProperties=void 0;const o=r(1513);t.navigationProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Title",property:"navigation-title-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SubTitle",property:"subTitle-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Menus",property:"menus-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TitleMode",property:"titleMode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.NAVIGATION_TITLEMODE,list:[o.CLEAN_VALUE_NODE,{value:"Free"},{value:"Mini"},{value:"Full"}],defaults:"Mini"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ToolBar",property:"toolBar-visual",type:o.TypeName.BASE,etsType:o.EtsType.OBJECT,supportStaticProperty:!1,defaults:{}}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideToolBar",property:"hideToolBar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideTitleBar",property:"hideTitleBar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideBackButton",property:"hideBackButton-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}}]},4090:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pickerProperties=void 0;const o=r(1513);t.pickerProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Range",property:"range-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selected",property:"datetime-selected-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Start",property:"start-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"End",property:"end-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"UseMilitaryTime",property:"useMilitaryTime-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selected",property:"textPicker-selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"DefaultPickerItemHeight",property:"defaultPickerItemHeight-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["vp","px","lpx"]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Lunar",property:"lunar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}]},5302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshProperties=void 0;const o=r(1513);t.refreshProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Friction",property:"friction-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:62}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Offset",property:"offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength,defaults:16}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Refreshing",property:"refreshing-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}]},4488:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollProperties=void 0;const o=r(1513);t.scrollProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.SCROLL_DIRECTION,list:[o.CLEAN_VALUE_NODE,{value:"Horizontal"},{value:"Vertical"},{value:"None"}],defaults:"Vertical",startApi:"9"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.SCROLL_DIRECTION,list:[o.CLEAN_VALUE_NODE,{value:"Horizontal"},{value:"Vertical"},{value:"None"},{value:"Free"}],defaults:"Vertical",endApi:"9"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBar",property:"scroll-bar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_STATE,list:[o.CLEAN_VALUE_NODE,{value:"Off"},{value:"On"},{value:"Auto"}]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBarColor",property:"scroll-bar-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.NON_R_COLOR}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBarWidth",property:"scroll-bar-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"EdgeEffect",property:"edge-effect-scroll-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{value:"Spring"},{value:"Fade"},{value:"None"}],defaults:"None"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scroller",property:"scroller-visual",type:o.TypeName.BASE,etsType:o.EtsType.SCROLLER,supportStaticProperty:!1}}]},128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchProperties=void 0;const o=r(1513),n=[{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontSize",property:"placeholder-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontStyle",property:"placeholder-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontWeight",property:"placeholder-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontFamily",property:"placeholder-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}}],a=[{propertySector:o.Sector.MORE,propertySet:{name:"TextFontSize",property:"text-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontStyle",property:"text-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontWeight",property:"text-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontFamily",property:"text-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.MORE,propertySet:{name:"TextAlign",property:"search-text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start"}}];t.searchProperties=[...n,...a,{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Controller",property:"search-controller-visual",type:o.TypeName.BASE,etsType:o.EtsType.SEARCH_CONTROLLER,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Icon",property:"icon-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Placeholder",property:"search-placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Value",property:"search-value-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.MORE,propertySet:{name:"SearchButton",property:"search-button-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.MORE,propertySet:{name:"CopyOption",property:"copy-option-visual",type:o.TypeName.SELECT,etsType:o.EtsType.COPY_OPTION,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"None"},{name:"InApp",value:"InApp"},{name:"LocalDevice",value:"LocalDevice"}],defaults:"None",startApi:"9"}}]},1021:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectProperties=void 0;const o=r(1513),n=[{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontSize",property:"selected-option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontStyle",property:"selected-option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontColor",property:"selected-option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontWeight",property:"selected-option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontFamily",property:"selected-option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionBackgroundColor",property:"selected-option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}],a=[{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontSize",property:"option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontStyle",property:"option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontColor",property:"option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontWeight",property:"option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontFamily",property:"option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionBackgroundColor",property:"option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}];t.selectProperties=[...n,...a,{propertySector:o.Sector.SELECT,propertySet:{name:"Value",property:"select-value-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.SELECT,propertySet:{name:"Selected",property:"selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.SELECT,propertySet:{name:"Options",property:"select-option-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}}]},8929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sliderProperties=void 0;const o=r(1513);t.sliderProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TrackColor",property:"track-color-visual",type:o.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ShowSteps",property:"show-steps-visual",type:o.TypeName.ADJUSTABLE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ShowTips",property:"show-tips-visual",type:o.TypeName.ADJUSTABLE}}]},1815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackProperties=void 0;const o=r(1513);t.stackProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignContent",property:"align-content-stack-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ALIGNMENT,defaults:"center",list:o.alignProperties}}]},1492:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.swiperProperties=void 0;const o=r(1513);t.swiperProperties=[{propertySector:o.Sector.MORE,propertySet:Object.assign({name:"AutoPlay",property:"auto-play-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.MORE,propertySet:{name:"Interval",property:"interval-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign(Object.assign({name:"Loop",property:"loop-visual"},o.commonParamsForJudge),{defaults:!0})},{propertySector:o.Sector.MORE,propertySet:{name:"Duration",property:"duration-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:{name:"ItemSpace",property:"item-space-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH}},{propertySector:o.Sector.MORE,propertySet:{name:"CachedCount",property:"cached-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign({name:"DisableSwipe",property:"disable-swipe-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Index",property:"index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign(Object.assign({name:"Indicator",property:"indicator-visual"},o.commonParamsForJudge),{defaults:!0})}]},6153:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabContentProperties=void 0;const o=r(1513);t.tabContentProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TabBar Icon",property:"tabBar-icon-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_SRC}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TabBar Text",property:"tabBar-text-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT}}]},6686:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabsProperties=void 0;const o=r(1513);t.tabsProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Controller",property:"controller-visual",type:o.TypeName.BASE,etsType:o.EtsType.TABS_CONTROLLER,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"tabs-scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"true"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarPosition",property:"bar-position-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_POSITION,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"End",value:"end"}],defaults:"start"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarMode",property:"bar-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_MODE,list:[o.CLEAN_VALUE_NODE,{name:"Scrollable",value:"scrollable"},{name:"Fixed",value:"fixed"}],defaults:"fixed"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarWidth",property:"bar-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarHeight",property:"bar-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AnimationDuration",property:"animation-duration-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:200}}]},3890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textInputProperties=void 0;const o=r(1513);t.textInputProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Placeholder",property:"placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"textInput-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.INPUT_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Password"},{value:"Email"},{value:"Number"}],defaults:"Normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderColor",property:"placeholderColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontSize",property:"placeholderFont-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp"]}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontWeight",property:"placeholderFont-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Lighter"},{value:"Regular"},{value:"Medium"},{value:"Bold"},{value:"Bolder"},...o.commonFontWeight],defaults:"400"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontFamily",property:"placeholderFont-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontStyle",property:"placeholderFont-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Italic"}],defaults:"Normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"EnterKeyType",property:"enterKeyType-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ENTER_KEY_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Go"},{value:"Search"},{value:"Send"},{value:"Next"},{value:"Done"}],defaults:"Done"}},{propertySector:o.Sector.MORE,propertySet:{name:"CaretColor",property:"caretColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"MaxLength",property:"maxLength-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}}]},8271:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textComponentProperties=void 0;const o=r(1513);t.textComponentProperties=[{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextAlign",property:"text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start"}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"LineHeight",property:"line-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextOverflow",property:"text-overflow-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_OVERFLOW,list:[o.CLEAN_VALUE_NODE,{name:"Clip",value:"clip"},{name:"Ellipsis",value:"ellipsis"},{name:"None",value:"none"}],defaults:"clip"}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"BaselineOffset",property:"baseline-offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"DecorationType",property:"decoration-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_DECORATION_TYPE,list:[o.CLEAN_VALUE_NODE,{name:"Underline",value:"underline"},{name:"LineThrough",value:"line-through"},{name:"Overline",value:"overline"},{name:"None",value:"none"}],defaults:"none"}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"DecorationColor",property:"decoration-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextCase",property:"text-case-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_CASE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"LowerCase"},{value:"UpperCase"}],defaults:"Normal"}}]},3460:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleProperties=void 0;const o=r(1513);t.toggleProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"toggle-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TOGGLE_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Button"},{value:"Checkbox"},{value:"Switch"}],defaults:"Button"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"IsOn",property:"isOn-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SelectedColor",property:"selectedColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SwitchPointColor",property:"switchPointColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}]},1290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.etsPropertyList=void 0;const o=r(5958),n=r(1513),a=r(5302),i=r(3460),s=r(8271),p=r(3890),l=r(3311),c=r(8124),u=r(8840),y=r(3687),d=r(1492),f=r(1021),m=r(8929),g=r(4090),h=r(128),E=r(1815),T=r(4836),S=r(6181),P=r(4488),v=r(5452),b=r(6686),_=r(8964),N=r(6153),C=r(6486),A=(()=>{const e=C.cloneDeep(o.commonPropertyList),t=new Map([["color-visual",n.Sector.FEATURE_ETS],["value-visual",n.Sector.FEATURE_ETS],["total-visual",n.Sector.FEATURE_ETS],["style-visual",n.Sector.FEATURE_ETS],["font-family-visual",n.Sector.TEXTSTYLES],["max-lines-visual",n.Sector.TEXTSTYLES],["flex-grow-visual",n.Sector.FLEXCHILD],["flex-shrink-visual",n.Sector.FLEXCHILD],["aspect-ratio-visual",n.Sector.LAYOUT],["opacity-visual",n.Sector.EFFECT],["background-color-visual",n.Sector.BACKGROUND]]);return e.forEach((e=>{const r=e.propertySet.property;t.has(r)&&(e.propertySector=t.get(r))})),e})(),O=[{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontSize",property:"font-size-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.fontSizeUnit}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontStyle",property:"font-style-visual",type:n.TypeName.SELECT,etsType:n.EtsType.FONT_STYLE,list:[n.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontColor",property:"font-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontWeight",property:"font-weight-visual",type:n.TypeName.SELECT,etsType:`${n.EtsType.FONT_WEIGHT}|${n.EtsType.NUMBER}`,list:n.fontWeightList,defaults:"400"}}],M=[{propertySector:n.Sector.RENDER,propertySet:{name:"ForEach",property:"for-visual",type:n.TypeName.BASE,etsType:n.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:n.Sector.RENDER,propertySet:{name:"KeyGenerator",property:"keyGenerator-visual",type:n.TypeName.BASE,etsType:"Event",supportStaticProperty:!1,defaults:""}},{propertySector:n.Sector.RENDER,propertySet:{name:"Item",property:"item-visual",type:n.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Item of ForEach Array"}},{propertySector:n.Sector.RENDER,propertySet:{name:"Idx",property:"idx-visual",type:n.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Index of Corresponding Item In ForEach Array"}}],w={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:["vp","px","lpx"],placeholder:"0"},R=[{propertySector:n.Sector.SIZE,propertySet:{name:"Width",property:"width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SIZE,propertySet:{name:"Height",property:"height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SIZE,propertySet:{name:"MinWidth",property:"constraint-size-min-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength}},{propertySector:n.Sector.SIZE,propertySet:{name:"MinHeight",property:"constraint-size-min-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength}},{propertySector:n.Sector.SIZE,propertySet:{name:"MaxWidth",property:"constraint-size-max-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength}},{propertySector:n.Sector.SIZE,propertySet:{name:"MaxHeight",property:"constraint-size-max-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength}},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"Margin",property:"margin-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"Padding",property:"padding-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginTop",property:"margin-top-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginRight",property:"margin-right-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginBottom",property:"margin-bottom-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginLeft",property:"margin-left-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingTop",property:"padding-top-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingRight",property:"padding-right-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingBottom",property:"padding-bottom-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingLeft",property:"padding-left-visual"},w)}],I={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength},x={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength},L={type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR},F=[{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomString",property:"custom-string-visual",type:n.TypeName.BASE,etsType:n.EtsType.STRING}},{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomNumber",property:"custom-number-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomBoolean",property:"custom-boolean-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,list:n.booleanListWithClean,defaults:"false"}}],k=[{propertySector:n.Sector.BORDER,propertySet:{name:"Border",property:"border-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-width-visual"},I),Object.assign({name:"Style",property:"border-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-color-visual"},L),Object.assign({name:"Radius",property:"border-radius-visual"},x)]}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderTop",property:"border-top-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-top-width-visual"},I),Object.assign({name:"Style",property:"border-top-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-top-color-visual"},L),Object.assign({name:"TopLeftRadius",property:"border-top-left-radius-visual"},x)],startApi:"9"}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderRight",property:"border-right-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-right-width-visual"},I),Object.assign({name:"Style",property:"border-right-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-right-color-visual"},L),Object.assign({name:"TopRightRadius",property:"border-top-right-radius-visual"},x)],startApi:"9"}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderBottom",property:"border-bottom-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-bottom-width-visual"},I),Object.assign({name:"Style",property:"border-bottom-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-bottom-color-visual"},L),Object.assign({name:"BottomRightRadius",property:"border-bottom-right-radius-visual"},x)],startApi:"9"}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderLeft",property:"border-left-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-left-width-visual"},I),Object.assign({name:"Style",property:"border-left-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-left-color-visual"},L),Object.assign({name:"BottomLeftRadius",property:"border-bottom-left-radius-visual"},x)],startApi:"9"}}],B=[{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageSrc",property:"background-image-src-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_SRC}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageRepeat",property:"background-image-repeat-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_REPERT,list:[n.CLEAN_VALUE_NODE,{name:"X",value:"repeat-x"},{name:"Y",value:"repeat-y"},{name:"XY",value:"repeat"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageSize",property:"background-image-size-visual",type:n.TypeName.DATA_SELECT_INPUT,etsType:`${n.EtsType.IMAGE_SIZE}|${n.EtsType.STRING}`,list:[n.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Auto",value:"auto"}],defaults:"Auto"}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImagePosition",property:"background-image-position-visual",type:n.TypeName.DATA_SELECT_INPUT,etsType:`${n.EtsType.ALIGNMENT}|${n.EtsType.STRING}`,list:[n.CLEAN_VALUE_NODE,{name:"TopStart",value:"top left"},{name:"Top",value:"top center"},{name:"TopEnd",value:"top right"},{name:"Start",value:"center left"},{name:"Center",value:"center center"},{name:"End",value:"center right"},{name:"BottomStart",value:"bottom left"},{name:"Bottom",value:"bottom center"},{name:"BottomEnd",value:"bottom right"}],defaults:"0 0"}}],D=[{propertySector:n.Sector.LAYOUT,propertySet:{name:"Location",property:"position-visual",type:n.TypeName.SELECT,defaults:"offset",supportDynamicProperty:!1,list:[n.CLEAN_VALUE_NODE,{name:"offset",value:"relative"},{name:"position",value:"absolute"}]}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"X",property:"left-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"Y",property:"top-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}}],U=[{propertySector:n.Sector.LAYOUT,propertySet:{name:"DisplayPriority",property:"display-priority-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.EFFECT,propertySet:{name:"Visibility",property:"visibility-visual",type:n.TypeName.SELECT,etsType:n.EtsType.VISIBILITY,defaults:"visible",list:[n.CLEAN_VALUE_NODE,{name:"Visible",value:"visible"},{name:"Hidden",value:"hidden"},{name:"None",value:"none"}]}},{propertySector:n.Sector.EFFECT,propertySet:{name:"Enabled",property:"enabled-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"true",list:[{value:"true"},{value:"false"}]}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"Align",property:"align-visual",type:n.TypeName.SELECT,etsType:n.EtsType.ALIGNMENT,defaults:"center",list:n.alignProperties}},{propertySector:n.Sector.RENDER,propertySet:{name:"If",property:"if-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Space",property:"space-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_LENGTH,units:["vp","px","lpx"],requires:{"display-visual":["flex","cleanValue"]},info:"Space between any two adjacent child components."}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-row-visual",type:n.TypeName.SELECT,etsType:n.EtsType.VERTICAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[n.CLEAN_VALUE_NODE,{value:"flex-start",name:"top",etsEnumValue:"Top"},{value:"flex-end",name:"bottom",etsEnumValue:"Bottom"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the vertical direction."}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-column-visual",type:n.TypeName.SELECT,etsType:n.EtsType.HORIZONTAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[n.CLEAN_VALUE_NODE,{value:"flex-start",name:"start",etsEnumValue:"Start"},{value:"flex-end",name:"end",etsEnumValue:"End"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the horizontal direction."}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Src",property:"src-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_SRC}},{propertySector:n.Sector.MORE,propertySet:{name:"Alt",property:"alt-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_CONTENT}},{propertySector:n.Sector.MORE,propertySet:{name:"RenderMode",property:"render-mode-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_RENDER_MODE,defaults:"original",list:[n.CLEAN_VALUE_NODE,{name:"Original",value:"original"},{name:"Template",value:"template"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"ObjectRepeat",property:"object-repeat-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_REPERT,defaults:"no-repeat",list:[n.CLEAN_VALUE_NODE,{name:"X",value:"X"},{name:"Y",value:"Y"},{name:"XY",value:"XY"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"ObjectFit",property:"object-fit-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_FIT,defaults:"cover",list:[n.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Fill",value:"fill"},{name:"None",value:"none"},{name:"ScaleDown",value:"scale-down"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"InterPolation",property:"interpolation-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_INTERPOLATION,defaults:"none",list:[n.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"High",value:"high"},{name:"Medium",value:"medium"},{name:"Low",value:"low"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"SourceSizeWidth",property:"source-size-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,units:["px"]}},{propertySector:n.Sector.MORE,propertySet:{name:"SourceSizeHeight",property:"source-size-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,units:["px"]}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"type-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BUTTON_TYPE,defaults:"capsule",list:[{name:"Normal",value:"normal"},{name:"Capsule",value:"capsule"},{name:"Circle",value:"circle"}]}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"StateEffect",property:"state-effect-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"true",list:n.booleanList}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Content",property:"content-visual",type:n.TypeName.ADJUSTABLE,etsType:n.EtsType.COMB_CONTENT}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Label",property:"label-visual",type:n.TypeName.ADJUSTABLE,etsType:n.EtsType.COMB_CONTENT}}];t.etsPropertyList=[...F,...k,...R,...O,...M,...i.toggleProperties,..._.checkboxProperties,..._.checkboxGroupProperties,...s.textComponentProperties,...p.textInputProperties,...l.dividerProperties,...D,...c.listProperties,...u.listItemProperties,...y.flexProperties,...d.swiperProperties,...a.refreshProperties,...f.selectProperties,...m.sliderProperties,...A,...B,...g.pickerProperties,...h.searchProperties,...P.scrollProperties,...v.navigationProperties,...b.tabsProperties,...N.tabContentProperties,...U,...E.stackProperties,...T.gridItemProperties,...S.gridProperties]},5958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonPropertyList=void 0;const o=r(1513);t.commonPropertyList=[{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundColor",property:"background-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Display",property:"display-visual",type:o.TypeName.SELECT,defaults:"flex",list:[o.CLEAN_VALUE_NODE,{value:"flex"},{value:"none"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Opacity",property:"opacity-visual",type:o.TypeName.SLIDER,etsType:o.EtsType.COMB_R_NUMBER,defaults:"1",step:.01,max:1,min:0}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Overflow",property:"overflow-visual",type:o.TypeName.SELECT,defaults:"visible",list:[o.CLEAN_VALUE_NODE,{value:"visible"},{value:"hidden"},{value:"scroll"}]}},{propertySector:o.Sector.FLEX,propertySet:{name:"FlexGrow",property:"flex-grow-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:"0",requiresParent:{display:["flex","cleanValue"]},info:"The flex grow factor of a flex item's main size"}},{propertySector:o.Sector.FLEX,propertySet:{name:"FlexShrink",property:"flex-shrink-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:"1",requiresParent:{display:["flex","cleanValue"]},info:"The flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items will shrink"}},{propertySector:o.Sector.FLEX,propertySet:{name:"Columns",property:"columns-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:1,info:"The column number of flex."}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Header Logo",property:"headerLogo-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Title",property:"title-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Status",property:"status-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Logo",property:"logo-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Color",property:"color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontFamily",property:"font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:"sans-serif"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"MaxLines",property:"max-lines-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextColor",property:"text-color-visual",type:o.TypeName.COLOR,defaults:"rgba(0,0,0,0.9)"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FocusColor",property:"focus-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DisappearColor",property:"disappear-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorColor",property:"indicator-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorSelectedColor",property:"indicator-selected-color-visual",type:o.TypeName.COLOR,defaults:"#ff007dff"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorSize",property:"indicator-size-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorTop",property:"indicator-top-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorRight",property:"indicator-right-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorBottom",property:"indicator-bottom-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorLeft",property:"indicator-left-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:{name:"AllowScale",property:"allow-scale-visual",type:o.TypeName.SELECT,defaults:"true",list:[o.CLEAN_VALUE_NODE,{value:"true"},{value:"false"}]}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowStart",property:"grid-row-start-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its row in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnStart",property:"grid-column-start-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its column in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowEnd",property:"grid-row-end-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its row in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnEnd",property:"grid-column-end-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its column in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridTemplateRows",property:"grid-template-rows-visual",type:o.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid rows."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridTemplateColumns",property:"grid-template-columns-visual",type:o.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid columns."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowsGap",property:"grid-rows-gap-visual",type:o.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's grid rows."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnsGap",property:"grid-columns-gap-visual",type:o.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's columns."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridGap",property:"grid-gap-visual",type:o.TypeName.INTEGER,units:["px"],requires:{"display-visual":["grid"]},info:"The gaps between rows and columns. It is a shorthand for row-gap and column-gap."}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"MatchTextDirection",property:"match-text-direction-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"FitOriginalSize",property:"fit-original-size-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"IconWidth",property:"icon-width-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IconHeight",property:"icon-height-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextonColor",property:"texton-color-visual",type:o.TypeName.COLOR,defaults:"#000000"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextoffColor",property:"textoff-color-visual",type:o.TypeName.COLOR,defaults:"#000000"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextPadding",property:"text-padding-visual",type:o.TypeName.INTEGER,defaults:0,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedColor",property:"selected-color-visual",type:o.TypeName.COLOR,defaults:"rgba(0,125,255,1)"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"BlockColor",property:"block-color-visual",type:o.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Radius",property:"radius-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StartAngle",property:"start-angle-visual",type:o.TypeName.INTEGER,defaults:240}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TotalAngle",property:"total-angle-visual",type:o.TypeName.INTEGER,defaults:240}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CenterX",property:"center-x-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CenterY",property:"center-y-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Colors",property:"colors-visual",type:o.TypeName.BASE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Weights",property:"weights-visual",type:o.TypeName.BASE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceHolderColor",property:"placeholder-color-visual",type:o.TypeName.COLOR,defaults:"gray"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ProgressColor",property:"progress-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR,defaults:"black"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ItemExtent",property:"item-extent-visual",type:o.TypeName.INTEGER,units:["px","%"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FadeColor",property:"fade-color-visual",type:o.TypeName.COLOR,defaults:"grey"}},{propertySector:o.Sector.FLEX,propertySet:{name:"ColumnSpan",property:"column-span-visual",type:o.TypeName.INTEGER,defaults:1,min:1,info:"The number of span."}},{propertySector:o.Sector.ATOMIC,propertySet:{name:"FlexWeight",property:"flex-weight-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.ATOMIC,propertySet:{name:"AspectRatio",property:"aspect-ratio-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SecondaryColor",property:"secondary-color-visual",type:o.TypeName.COLOR,requires:{type:["horizontal","ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ScaleWidth",property:"scale-width-visual",type:o.TypeName.INTEGER,requires:{type:["ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ScaleNumber",property:"scale-number-visual",type:o.TypeName.INTEGER,defaults:120,requires:{type:["ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Value",property:"value-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:0}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Total",property:"total-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:100}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Style",property:"style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.PROGRESS_STYLE,defaults:"Linear",list:[{value:"Linear"}]}}]},1513:(e,t)=>{"use strict";var r,o,n,a,i,s,p;Object.defineProperty(t,"__esModule",{value:!0}),t.alignProperties=t.booleanListWithClean=t.booleanList=t.fontWeightList=t.fontSizeUnit=t.etsLength=t.commonFontWeight=t.commonParamsForBorderRadius=t.commonParamsForIndicator=t.commonParamsForInteger=t.commonParamsForJudge=t.commonParamsForBorder=t.CLEAN_VALUE_NODE=t.EtsSpecialType=t.EtsCombinationType=t.EtsBasicType=t.EtsEnumType=t.EtsType=t.TypeName=t.Sector=void 0,function(e){e.GENERAL="general",e.DIMENSION="dimension",e.FEATURE="feature",e.FEATURE_ETS="feature_ets",e.SIZE="size",e.SPACING="spacing",e.BORDER="border",e.BACKGROUND="background",e.LAYOUT="layout",e.RENDER="render",e.FLEX="flex",e.FLEXCHILD="flexchild",e.GRID="grid",e.ATOMIC="atomic",e.CUSTOM="custom",e.TEXT="text",e.TEXTSTYLES="textstyles",e.SELECT="select",e.OPTION="option",e.EFFECT="effect",e.MORE="more"}(r||(r={})),t.Sector=r,function(e){e.BASE="base",e.INTEGER="integer",e.SELECT="select",e.COLOR="color",e.COMPOSITE="composite",e.SLIDER="slider",e.DATA_SELECT_INPUT="dataSelectInput",e.ADJUSTABLE="adjustable"}(o||(o={})),t.TypeName=o,function(e){e.ARRAY="ETSArray",e.BOOLEAN="boolean",e.DATE="Date",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(n||(n={})),t.EtsBasicType=n,function(e){e.R_FLOAT="Rfloat",e.R_STRING="Rstring",e.R_COLOR="Rcolor",e.R_PLURAL="Rplural",e.R_MEDIA="Rmedia",e.R_RAWFILE="Rrawfile"}(a||(a={})),function(e){e.ALIGNMENT="Alignment",e.AXIS="Axis",e.BORDER_STYLE="BorderStyle",e.BUTTON_TYPE="ButtonType",e.COLOR="Color",e.DIRECTION="Direction",e.EDGE_EFFECT="EdgeEffect",e.ENTER_KEY_TYPE="EnterKeyType",e.NAVIGATION_TITLEMODE="NavigationTitleMode",e.FLEX_ALIGN="FlexAlign",e.FLEX_DIRECTION="FlexDirection",e.FLEX_WRAP="FlexWrap",e.FONT_STYLE="FontStyle",e.FONT_WEIGHT="FontWeight",e.HORIZONTAL_ALIGN="HorizontalAlign",e.IMAGE_FIT="ImageFit",e.IMAGE_INTERPOLATION="ImageInterpolation",e.IMAGE_RENDER_MODE="ImageRenderMode",e.IMAGE_REPERT="ImageRepeat",e.IMAGE_SIZE="ImageSize",e.INPUT_TYPE="InputType",e.ITEM_ALIGN="ItemAlign",e.LINE_CAP_STYLE="LineCapStyle",e.PROGRESS_STYLE="ProgressStyle",e.STICKY="Sticky",e.TEXT_ALIGN="TextAlign",e.TEXT_OVERFLOW="TextOverflow",e.TEXT_DECORATION_TYPE="TextDecorationType",e.TEXT_CASE="TextCase",e.TOGGLE_TYPE="ToggleType",e.VERTICAL_ALIGN="VerticalAlign",e.VISIBILITY="Visibility",e.COPY_OPTION="CopyOption",e.BAR_STATE="BarState",e.GRID_DIRECTION="GridDirection",e.SCROLL_DIRECTION="ScrollDirection",e.BAR_POSITION="BarPosition",e.BAR_MODE="BarMode"}(i||(i={})),t.EtsEnumType=i,function(e){e.COMB_COLOR="string|number|Color|Rcolor",e.COMB_LENGTH="string|number",e.COMB_R_NUMBER="number|Rfloat",e.COMB_R_LENGTH="string|number|Rfloat",e.COMB_CONTENT="string|Rstring|Rplural",e.COMB_SRC="string|Rmedia|Rrawfile",e.NON_R_COLOR="string|number|Color"}(s||(s={})),t.EtsCombinationType=s,function(e){e.SCROLLER="Scroller",e.TABS_CONTROLLER="TabsController",e.SEARCH_CONTROLLER="SearchController"}(p||(p={})),t.EtsSpecialType=p;const l=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),a),i),s),p);t.EtsType=l;const c={value:"cleanValue",name:"---Clean Value---"};t.CLEAN_VALUE_NODE=c;const u={type:o.SELECT,etsType:l.BORDER_STYLE,list:[c,{value:"dotted",etsEnumValue:"Dotted"},{value:"dashed",etsEnumValue:"Dashed"},{value:"solid",etsEnumValue:"Solid"}]};t.commonParamsForBorder=u;const y={type:o.SELECT,etsType:l.BOOLEAN,defaults:"false",list:[c,{value:"true"},{value:"false"}]};t.commonParamsForJudge=y;const d={type:o.INTEGER,units:["px"],placeholder:"0px"};t.commonParamsForInteger=d;const f={type:o.INTEGER,units:["px","%"]};t.commonParamsForIndicator=f;const m={type:o.INTEGER,units:["px"]};t.commonParamsForBorderRadius=m;const g=[{value:"100"},{value:"200"},{value:"300"},{value:"400"},{value:"500"},{value:"600"},{value:"700"},{value:"800"},{value:"900"}];t.commonFontWeight=g,t.etsLength=["vp","px","%","lpx"],t.fontSizeUnit=["fp","px","lpx"];const h=[c,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...g];t.fontWeightList=h;const E=[{name:"true",value:"true"},{name:"false",value:"false"}];t.booleanList=E;const T=[c,...E];t.booleanListWithClean=T;const S=[c,{name:"TopStart",value:"top-start"},{name:"Top",value:"top"},{name:"TopEnd",value:"top-end"},{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"},{name:"BottomStart",value:"bottom-start"},{name:"Bottom",value:"bottom"},{name:"BottomEnd",value:"bottom-end"}];t.alignProperties=S},9282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TagTypeMap=void 0,t.TagTypeMap=new Map([["button","TextContent"],["span","TextContent"],["divider","TextContent"],["picker","TextContent"],["option","TextContent"],["clock","TextContent"],["image","Base"],["input","Base"],["chart","Base"],["slider","Base"],["progress","Base"],["text","Text"],["div","Container"],["list","Container"],["list-item","Container"],["list-item-group","Container"],["refresh","Container"],["dialog","Container"],["stack","Container"],["menu","Container"],["select","Container"],["tabs","Container"],["tab-bar","Container"],["tab-content","Container"],["scroll","Container"],["navigation","Container"]])},4294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.beforeCodegen=t.getCustomCompRelativePath=t.getRelativePath=t.prepareCustomCompTagName=t.capitalize=t.getTagName=t.strToBase64=t.getUniqueName=t.getUniqueId=t.removeFromArray=t.getDataName=void 0;const o=r(2891);function n(e){let t=a(e).replace(/[/=+]/g,"");const r=t.length;return r>=4&&(t=t.substring(r/2-2,r/2+2)),t}function a(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");let r="";for(let t=0;t{const t=r.indexOf(e);-1!==t&&r.splice(t,1)})),r},t.getUniqueId=n,t.getUniqueName=function(e){return`${e}_${n(e)}`},t.strToBase64=a;const i=new Map,s=new Map;function p(e){return e[0].toUpperCase()+e.slice(1)}function l(e){const t=(0,o.getInstance)().document.path;if(0===e.size)return;const r=p(t.substring(t.lastIndexOf("/")+1));e.forEach(((e,o)=>{const n=e.length,a=[...e];o===r&&a.push(t);const l=function(e){e.sort();const t=e[0],r=e[e.length-1];let o=0;for(let e=0;e1||o===r)&&(u=p(e[a].substring(l+1).split("/").join("_"))),s.set(e[a],u);const y="/node_modules/";let d=c(e[a],t);e[a].startsWith(y)&&(d=e[a].replace(y,"@"),d=d.replace("src/main/supervisual","src/main/ets")),i.set(u,d)}}))}function c(e,t){const r=e.split("/"),o=t.split("/");let n=0;for(let e=0;e1){const o=p(r[r.length-1]),n=t.get(o);void 0===n?t.set(o,[e.type]):n.push(e.type)}const o=e.children;for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formManager=void 0;const o=r(2891),n=r(5945);t.formManager={removeData(e){this.getFormModel().data.delete(e)},addData(e){e instanceof Map?e.forEach(((e,t)=>{this.getFormModel().data.set(t,e)})):Object.keys(e).forEach((t=>{this.getFormModel().data.set(t,e[t])}))},updateAllData(e){this.getFormModel().data.clear(),this.addData(e)},addAction(e,t,r,o,a){const i=new Map;void 0!==r&&Object.keys(r).forEach((e=>{i.set(e,r[e])}));const s=new Map;void 0!==o&&Object.keys(o).forEach((e=>{s.set(e,o[e])})),this.getFormModel().actions.set(e,new n.FormAction(t,i,s,a))},updateAllActions(e){this.getFormModel().actions.clear(),e.forEach(((e,t)=>{const r=void 0===e.params?e.params:this.objectToMap(e.params),o=void 0===e.want?e.want:this.objectToMap(e.want),a=new n.FormAction(e.actionType,r,o);this.getFormModel().actions.set(t,a)}))},removeAction(e){this.getFormModel().actions.delete(e)},addActionParams(e,t){var r,o;const a=null!==(r=this.getFormModel().actions.get(e))&&void 0!==r?r:new n.FormAction(e),i=null!==(o=a.params)&&void 0!==o?o:new Map;Object.keys(t).forEach((e=>{i.set(e,t[e])})),a.params=i},removeActionParam(e,t){var r;const o=this.getFormModel().actions.get(e);null===(r=null==o?void 0:o.params)||void 0===r||r.delete(t)},getFormModel:()=>(0,o.getInstance)().formData,codegenToJson:function(){const e=(0,o.getInstance)().formData,t=this.mapToObject(e.data),r={actions:{},data:{}};return r.data=t,e.actions.forEach(((e,t)=>{r.actions[t]={},r.actions[t].action=e.action,e.params instanceof Map&&e.params.size>0&&(r.actions[t].params=this.mapToObject(e.params)),e.want instanceof Map&&e.want.size>0&&(r.actions[t].abilityName=e.abilityName,r.actions[t].want=this.mapToObject(e.want))})),JSON.stringify(r,null,4)},clear(){(0,o.getInstance)().formData.data.clear(),(0,o.getInstance)().formData.actions.clear()},mapToObject:e=>void 0===e?{}:Array.from(e.entries()).reduce(((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r})),{}),objectToMap(e){const t=new Map;return Object.keys(e).forEach(((r,o)=>{t.set(r,e[r])})),t}}},5945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormAction=t.FormModel=void 0,t.FormModel=class{constructor(){this.data=new Map,this.actions=new Map}},t.FormAction=class{constructor(e,t,r,o){this.action=e,this.abilityName=o,this.want=r,this.params=t}}},1509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeForVersion1=t.rootToVisualContent=t.visualToRootContent=t.serializeForVersion1=void 0;const o=r(2891),n=r(1933),a=r(7571),i=r(9282),s=r(5945),p=r(7977),l=new Map;function c(e){l.set("textMap",new Map);const t=u(null!=e?e:(0,o.getInstance)().visualModel);return JSON.stringify({VisualVersion:"1",content:JSON.stringify(t),extraData:JSON.stringify(f(l))})}function u(e){const t=Array.from(e.property).filter((t=>(0,a.isAttribute)(t[0],e.type)));t.push(["id",e.id]);const r=Array.from(e.property).filter((t=>(0,a.isStyle)(t[0],e.type)));let o=i.TagTypeMap.get(e.type);void 0===o&&(o="Base");let n=e.property.has("content")?e.property.get("content"):[];if(e.children.length>0){if("string"==typeof n){const t=l.get("textMap");t instanceof Map&&t.set(e.id,n)}n=e.children.map((e=>u(e)))}return{id:e.id,tagName:e.type,attributes:t,idStyle:r,type:o,content:n}}function y(e,t){let r;if(t instanceof Map){const o=t.get("textMap");o instanceof Map&&(r=o.get(e.id))}const o=new n.VisualModel({id:e.id,type:e.tagName,property:new Map([...e.attributes,...e.idStyle])});return"string"==typeof r&&o.property.set("content",r),o.property.delete("id"),"string"==typeof e.content&&o.property.set("content",e.content),Array.isArray(e.content)&&(o.children=e.content.map((e=>y(e,t)))),o}function d(e){if(e instanceof Array&&e.length>0&&"$$map"===e[0]){e.shift();const t=new Map;for(const[r,o]of e)t.set(r,d(o));return t}return e}function f(e){if(e instanceof Map){const t=["$$map"];for(const[r,o]of e)t.push([r,f(o)]);return t}return e}t.serializeForVersion1=c,t.visualToRootContent=function(e){try{return c(JSON.parse(e,p.reviver).visualModel)}catch(e){console.error("convert visual model to root model failed")}return e},t.rootToVisualContent=function(e){const t=JSON.parse(e),r=JSON.parse(t.content);let o='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(o=JSON.parse(t.extraData));const n=y(r,d(o));return n.property.has("flex-direction")||n.property.set("flex-direction","column"),JSON.stringify({document:{VisualVersion:"12",type:"FA"},visualModel:n,formData:new s.FormModel},p.replacer)},t.deserializeForVersion1=function(e){try{const t=JSON.parse(e),r=JSON.parse(t.content);let n='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(n=JSON.parse(t.extraData)),(0,o.getInstance)().visualModel=y(r,d(n)),(0,o.getInstance)().visualModel.property.has("flex-direction")||(0,o.getInstance)().visualModel.property.set("flex-direction","column")}catch(e){console.error("convert error")}}},2891:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setInstance=t.getInstance=t.setVisualPath=t.clearCustomInstance=t.setCustomInstance=t.getInstanceTemplate=t.getCustomInstance=void 0;const o=r(1933),n=r(5945),a=r(904),i={document:{VisualVersion:"12",type:"FA",custom:!1,path:""},visualModel:new o.VisualModel({type:"div",id:"wrapper"}),formData:new n.FormModel},s=new Map;t.getCustomInstance=function(){return s},t.getInstanceTemplate=function(e){return{document:{VisualVersion:"12",type:"ETS",custom:e,path:"&path"},visualModel:new o.VisualModel({type:"column",id:"wrapper"}),imgData:""}},t.setCustomInstance=function(e,t){var r;const n={path:"",document:{VisualVersion:"",type:"",custom:!0},visualModel:new o.VisualModel({type:"",id:""}),methods:[],property:[],imgData:"",originType:[]};n.path=e;for(const e in n)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);n.visualModel=null!==(r=n.visualModel.children[0])&&void 0!==r?r:new o.VisualModel({type:"text"}),s.set(e,n)},t.clearCustomInstance=function(){s.clear()},t.setVisualPath=function(e){i.document.path=e},t.getInstance=function(){return i},t.setInstance=function(e){var t,r,o,n;for(const t in i)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);const s=i.document.type;void 0===i.document.custom&&(i.document.custom=!1),null!==((null!==(r=(null===(t=e.customData)||void 0===t?void 0:t.property.size)>0)&&void 0!==r?r:null)||(null!==(n=(null===(o=e.customData)||void 0===o?void 0:o.event.size)>0)&&void 0!==n?n:null))&&(i.customData=e.customData),(0,a.setDomain)("ETS"===s?a.Domain.ETS:"FORM"===s?a.Domain.FORM:a.Domain.FA)}},7977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviver=t.replacer=t.serializeSketchPage=t.serializeCustom=t.deserializeCustom=t.deserialize=t.serialize=void 0;const o=r(1933),n=r(2891),a=r(1509);function i(e,t){if(t instanceof Map)return{dataType:"Map",value:Object.fromEntries(t.entries())};if(t instanceof Set)return{dataType:"Set",value:Array.from(t.entries())};if(t instanceof o.VisualModel){const e=new o.VisualModel({type:"none"}),r={};for(const o in e)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return{dataType:"VisualModel",value:r}}return t}function s(e,t){if("object"==typeof t&&null!=t){if("Map"===t.dataType)return new Map(Object.entries(t.value));if("Set"===t.dataType)return new Set(t.value);if("VisualModel"===t.dataType){const e=new o.VisualModel({type:""});Object.assign(e,t.value),t=e}}return t}t.serialize=function(e,t){return 1===e?(0,a.serializeForVersion1)(t):JSON.stringify(null!=t?t:(0,n.getInstance)(),i,4)},t.deserialize=function(e){if("1"===JSON.parse(e).VisualVersion)return(0,a.deserializeForVersion1)(e);const t=JSON.parse(e,s);(0,n.setInstance)(t)},t.deserializeCustom=function(e,t){const r=JSON.parse(t,s);(0,n.setCustomInstance)(e,r)},t.serializeCustom=function(e){const t=(0,n.getInstanceTemplate)(!0);return t.visualModel.property=new Map([["width","100%"],["height","100%"]]),t.visualModel.children.push(e),JSON.stringify(t,i,4)},t.serializeSketchPage=function(e){const t=(0,n.getInstanceTemplate)(!1);return t.visualModel=e,JSON.stringify(t,i,4)},t.replacer=i,t.reviver=s},1933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VisualModel=void 0;const r="-visual";t.VisualModel=class{constructor(e){if(this.propertyStorage=void 0,this.dynamicPropertyStorage=void 0,this.mediaProperty=void 0,this.dynamicMediaProperty=void 0,this.mediaPropertyStorage=void 0,this.dynamicMediaPropertyStorage=void 0,this.slots=void 0,this.property=void 0!==e.property?e.property:new Map,this.dynamicProperty=void 0!==e.dynamicProperty?e.dynamicProperty:new Map,this.children=void 0!==e.children?e.children:[],"wrapper"===e.type)return this.id="wrapper",void(this.type="div");e.type.endsWith(r)&&(e.type=e.type.substring(0,e.type.length-r.length)),this.id=void 0!==e.id?e.id:"",this.type=e.type,this.slots=e.slots}getProperty(e){const t=this.dynamicProperty.get(e);return void 0!==t&&""!==t?t:this.property.get(e)}hasMediaProperty(e){if(void 0!==this.mediaProperty)for(const[,t]of this.mediaProperty)if(null==t?void 0:t.has(e))return!0;if(void 0!==this.dynamicMediaProperty)for(const[,t]of this.dynamicMediaProperty)if(null==t?void 0:t.has(e))return!0;return!1}hasProperty(e){return this.dynamicProperty.has(e)||this.property.has(e)}getChildren(){var e;const t=[...this.children];for(const[,r]of null!==(e=this.slots)&&void 0!==e?e:new Map)t.push(r);return t}accept(e){return e.visit(this)}}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={id:o,loaded:!1,exports:{}};return e[o].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var o={};(()=>{"use strict";var e=o;Object.defineProperty(e,"__esModule",{value:!0});const t=r(3784),n=r(2891),a=r(7977),i=r(8844),s=r(1055),p=r(3207),l=r(8413),c=r(4435),u=r(6486),y=r(4294),d={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""};function f(e,r){var o;try{(0,a.deserialize)(e);const t=(0,n.getInstance)().document.VisualVersion,o=/^([1-9]+[0-9]*)$/;if(void 0===t)r.errorType="versionError";else{const e=t.match(o);(null===e||parseInt(e[1])>12)&&(r.errorType="versionError")}}catch(e){r.errorType="fileError"}""!==r.errorType&&(r.errorMessage=null!==(o=t.errorMap.get(r.errorType))&&void 0!==o?o:"Codegen visual file failed")}e.genHmlAndCss=function(e){const r={hmlCss:{hml:"",css:"",json:""},errorType:"",errorMessage:""};if(f(e,r),""!==r.errorType)return r.hmlCss.hml="",r.hmlCss.css="",r;try{const e=function(e){const t={hml:"",css:"",json:""},r=new i.HMLBridge,o=e.accept(r),n=(0,s.genFAHML)(o);t.hml=r.getErrorCount()>0?"error":n;const a=new i.CSSBridge,p=e.accept(a),l=(0,s.genFACSS)(p);return t.css=a.getErrorCount()>0?"error":l,t}((0,n.getInstance)().visualModel);"error"!==e.hml&&"error"!==e.css||(r.errorType="codegenError"),r.hmlCss=e,"FORM"===(0,n.getInstance)().document.type&&(r.hmlCss.json=p.formManager.codegenToJson())}catch(e){r.errorType="modelError"}return""!==r.errorType&&(r.errorMessage=t.errorMap.get(r.errorType),r.hmlCss.hml="",r.hmlCss.css=""),r},e.genETS=function(e){var r;const o={ets:(0,u.cloneDeep)(d),errorType:"",errorMessage:""};if(f(e,o),""!==o.errorType)return o.ets=(0,u.cloneDeep)(d),o;try{let e=(0,n.getInstance)().visualModel;if((0,n.getInstance)().document.custom&&(e=e.children[0],void 0===e))return o;(0,y.beforeCodegen)(e);const t=function(e){const t=new l.ETSBridge,r=e.accept(t),o=(new c.StringWriter).genETS(r);return t.getErrorCount()>0?"error":o}(e);"error"===t&&(o.errorType="codegenError"),o.ets=t}catch(e){o.errorType="modelError"}return""!==o.errorType&&(o.errorMessage=null!==(r=t.errorMap.get(o.errorType))&&void 0!==r?r:"Codegen visual file failed",o.ets=(0,u.cloneDeep)(d)),o}})();var n=exports;for(var a in o)n[a]=o[a];o.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})(); \ No newline at end of file -- Gitee From 89cc624ffeaaf5f1d601b4de2605ca84e4489d33 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Thu, 15 Dec 2022 21:25:00 +0800 Subject: [PATCH 222/379] houhaoyu@huawei.com fix errorcount Signed-off-by: houhaoyu Change-Id: I4b4dcec5ed98f989cb7454362c074d67272eee67 --- compiler/src/compile_info.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 746c942..7a937e4 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -382,12 +382,12 @@ export class ResultStates { } private printLogCount(): void { - this.mErrorCount += this.tsErrorCount; - if (this.mErrorCount + this.warningCount + this.noteCount > 0) { + let errorCount: number = this.mErrorCount + this.tsErrorCount; + if (errorCount + this.warningCount + this.noteCount > 0) { let result: string; let resultInfo: string = ''; - if (this.mErrorCount > 0) { - resultInfo += `ERROR:${this.mErrorCount}`; + if (errorCount > 0) { + resultInfo += `ERROR:${errorCount}`; result = 'FAIL '; if (!partialUpdateConfig.strictCheck && !partialUpdateConfig.partialUpdateMode) { process.exitCode = 1; -- Gitee From 9928c8d707aa808e5958b5aaae4fac955c499c96 Mon Sep 17 00:00:00 2001 From: hufeng Date: Fri, 16 Dec 2022 11:54:41 +0800 Subject: [PATCH 223/379] Normalize the reletivePath of moduleRequest Signed-off-by: hufeng Change-Id: I072857456f1d3cc756f9dd4d39a599f39dbcad59 --- compiler/src/utils.ts | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 1c84751..f3a7477 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -424,12 +424,23 @@ export function getPackageInfo(configFile: string): Array { } function replaceRelativeDependency(item:string, moduleRequest: string, sourcePath: string): string { - const SUFFIX_REG: RegExp = /\.(?:[cm]?js|[e]?ts|json)$/; if (sourcePath && projectConfig.compileMode === ESMODULE) { + // remove file extension from moduleRequest + const SUFFIX_REG: RegExp = /\.(?:[cm]?js|[e]?ts|json)$/; + moduleRequest = moduleRequest.replace(SUFFIX_REG, ''); + + // normalize the moduleRequest + item = item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { + let normalizedModuleRequest: string = toUnixPath(path.normalize(moduleRequest)); + if (moduleRequest.startsWith("./")) { + normalizedModuleRequest = "./" + normalizedModuleRequest; + } + return quotation + normalizedModuleRequest + quotation; + }); + const filePath: string = path.resolve(path.dirname(sourcePath), moduleRequest); - const filePathWithoutSuffix: string = filePath.replace(SUFFIX_REG, ''); const result: RegExpMatchArray | null = - filePathWithoutSuffix.match(/(\S+)(\/|\\)src(\/|\\)(?:main|ohosTest)(\/|\\)(ets|js)(\/|\\)(\S+)/); + filePath.match(/(\S+)(\/|\\)src(\/|\\)(?:main|ohosTest)(\/|\\)(ets|js)(\/|\\)(\S+)/); if (result && projectConfig.aceModuleJsonPath) { const npmModuleIdx: number = result[1].search(/(\/|\\)node_modules(\/|\\)/); const projectRootPath: string = projectConfig.projectRootPath; @@ -438,7 +449,9 @@ function replaceRelativeDependency(item:string, moduleRequest: string, sourcePat const bundleName: string = packageInfo[0]; const moduleName: string = packageInfo[1]; moduleRequest = `@bundle:${bundleName}/${moduleName}/${result[5]}/${toUnixPath(result[7])}`; - item = item.replace(/['"](\S+)['"]/, '\"' + moduleRequest + '\"'); + item = item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { + return quotation + moduleRequest + quotation; + }); } } } @@ -447,7 +460,7 @@ function replaceRelativeDependency(item:string, moduleRequest: string, sourcePat function transformModuleSpecifier(sourcePath: string, sourceCode: string): string { // replace relative moduleSpecifier with ohmURl - const REG_RELATIVE_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]((?:\.\/|\.\.\/).*)['"]/g; + const REG_RELATIVE_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]((?:\.\/|\.\.\/)[^'"]+)['"]/g; return sourceCode.replace(REG_RELATIVE_DEPENDENCY, (item, moduleRequest)=>{ return replaceRelativeDependency(item, moduleRequest, toUnixPath(sourcePath)); }); -- Gitee From 90f9313c5602a42fcf36b003bb5fc3b5da0d6bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 16 Dec 2022 16:03:31 +0800 Subject: [PATCH 224/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index b44b92c..fad18a9 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -499,7 +499,8 @@ function isCorrectInitFormParent(parent: string, child: string): boolean { } break; case COMPONENT_PROP_DECORATOR: - if ([COMPONENT_STATE_DECORATOR, ...propAndLinkDecorators].includes(parent)) { + if ([COMPONENT_STATE_DECORATOR, ...propAndLinkDecorators, COMPONENT_NON_DECORATOR + ].includes(parent)) { return true; } break; -- Gitee From 2b61f3c4edf5af96e35c3b4823860d1dc4bba1c2 Mon Sep 17 00:00:00 2001 From: hufeng Date: Thu, 8 Dec 2022 17:30:09 +0800 Subject: [PATCH 225/379] Add errors log when re-export a [type] without type keyword Signed-off-by: hufeng Change-Id: I1df72c35d727666a55674018a50b3c94b3970c55 --- compiler/src/ets_checker.ts | 1 - compiler/src/process_import.ts | 393 ++++++++++++++++++++++++++++-- compiler/src/process_ui_syntax.ts | 9 + 3 files changed, 378 insertions(+), 25 deletions(-) diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index 4c1d69b..e41a178 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -39,7 +39,6 @@ import { import { getName } from './process_component_build'; import { INNER_COMPONENT_NAMES } from './component_map'; import { props } from './compile_info'; -import { resolveSourceFile } from './resolve_ohm_url'; import { CacheFileName, cache, diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index 39d9931..9642986 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -105,30 +105,13 @@ isEntryPage: boolean = true, pathCollection: Set = new Set()): void { } } } - if (filePath && path.extname(filePath) !== EXTNAME_ETS && !isModule(filePath)) { - const dirIndexPath: string = path.resolve(path.resolve(pagesDir, filePath), INDEX_ETS); - if (/^(\.|\.\.)\//.test(filePath) && !fs.existsSync(path.resolve(pagesDir, filePath + EXTNAME_ETS)) && - fs.existsSync(dirIndexPath)) { - filePath = dirIndexPath; - } else { - filePath += EXTNAME_ETS; - } - } if (filePath) { validatorCard(log, CARD_LOG_TYPE_IMPORT, node.getStart()); } try { - let fileResolvePath: string; - if (/^(\.|\.\.)\//.test(filePath) && filePath.indexOf(NODE_MODULES) < 0) { - fileResolvePath = path.resolve(pagesDir, filePath); - } else if (/^\//.test(filePath) && filePath.indexOf(NODE_MODULES) < 0 || - fs.existsSync(filePath) && fs.statSync(filePath).isFile()) { - fileResolvePath = filePath; - } else { - fileResolvePath = getFileResolvePath(fileResolvePath, pagesDir, filePath, projectConfig.projectPath); - } + let fileResolvePath: string = getFileFullPath(filePath, pagesDir); if (fs.existsSync(fileResolvePath) && fs.statSync(fileResolvePath).isFile() && !pathCollection.has(fileResolvePath)) { let sourceFile: ts.SourceFile; @@ -136,12 +119,7 @@ isEntryPage: boolean = true, pathCollection: Set = new Set()): void { if (IMPORT_FILE_ASTCACHE.has(fileResolvePath)) { sourceFile = IMPORT_FILE_ASTCACHE.get(fileResolvePath); } else { - const content: string = preprocessNewExtend(preprocessExtend(processSystemApi( - fs.readFileSync(fileResolvePath, { encoding: 'utf-8' }).replace( - new RegExp('\\b' + STRUCT + '\\b.+\\{', 'g'), item => { - return item.replace(new RegExp('\\b' + STRUCT + '\\b', 'g'), `${CLASS} `); - })))); - sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); + sourceFile = generateSourceFileAST(fileResolvePath, filePath); IMPORT_FILE_ASTCACHE[fileResolvePath] = sourceFile; } visitAllNode(sourceFile, sourceFile, defaultName, asName, path.dirname(fileResolvePath), log, @@ -152,6 +130,16 @@ isEntryPage: boolean = true, pathCollection: Set = new Set()): void { } } +function generateSourceFileAST(fileResolvePath: string, filePath: string): ts.SourceFile { + const originContent: string = fs.readFileSync(fileResolvePath, { encoding: 'utf-8' }); + const content: string = path.extname(fileResolvePath) === EXTNAME_ETS ? + preprocessNewExtend(preprocessExtend(processSystemApi(originContent.replace( + new RegExp('\\b' + STRUCT + '\\b.+\\{', 'g'), item => { + return item.replace(new RegExp('\\b' + STRUCT + '\\b', 'g'), `${CLASS} `); + })))) : originContent; + return ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); +} + function visitAllNode(node: ts.Node, sourceFile: ts.SourceFile, defaultNameFromParent: string, asNameFromParent: Map, pagesDir: string, log: LogInfo[], entryCollection: Set, exportCollection: Set, defaultCollection: Set, asExportCollection: Map, @@ -584,6 +572,42 @@ function getFileResolvePath(fileResolvePath: string, pagesDir: string, filePath: return fileResolvePath; } +function addExtension(filePath: string): string { + if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) { + return ""; + } + + let extension: string = EXTNAME_ETS; + if (fs.existsSync(filePath + '.ts') && fs.statSync(filePath + '.ts').isFile()) { + extension = '.ts'; + } + return extension; +} + +function getFileFullPath(filePath: string, pagesDir: string): string { + if (filePath && path.extname(filePath) !== EXTNAME_ETS && !isModule(filePath)) { + const dirIndexPath: string = path.resolve(path.resolve(pagesDir, filePath), INDEX_ETS); + if (/^(\.|\.\.)\//.test(filePath) && !fs.existsSync(path.resolve(pagesDir, filePath + EXTNAME_ETS)) && + fs.existsSync(dirIndexPath)) { + filePath = dirIndexPath; + } else { + filePath += addExtension(path.resolve(pagesDir, filePath)); + } + } + + let fileResolvePath: string; + if (/^(\.|\.\.)\//.test(filePath) && filePath.indexOf(NODE_MODULES) < 0) { + fileResolvePath = path.resolve(pagesDir, filePath); + } else if (/^\//.test(filePath) && filePath.indexOf(NODE_MODULES) < 0 || + fs.existsSync(filePath) && fs.statSync(filePath).isFile()) { + fileResolvePath = filePath; + } else { + fileResolvePath = getFileResolvePath(fileResolvePath, pagesDir, filePath, projectConfig.projectPath); + } + + return fileResolvePath; +} + function validateModuleName(moduleNode: ts.Identifier, log: LogInfo[], sourceFile?: ts.SourceFile, fileResolvePath?: string): void { const moduleName: string = moduleNode.escapedText.toString(); @@ -606,3 +630,324 @@ function validateModuleName(moduleNode: ts.Identifier, log: LogInfo[], sourceFil log.push(error); } } + +interface ImportName { + name: string, + node: ts.Node, + source: string +} + +function collectNonTypeMarkedReExportName(node: ts.SourceFile, pagesDir: string): Map> { + /* those cases need be validated + * case 1: re-export + * export { externalName as localName } from './xxx' + * + * case 2: indirect re-export nameBindings + * import { externalName as localName } from './xxx' + * export [type] { localName as re-exportName } + * + * case 3: indirect re-export default + * import defaultLocalName from './xxx' + * export [type] { defaultLocalName as re-exportName } + */ + const RE_EXPORT_NAME: Map> = new Map(); + const IMPORT_AS: Map = new Map(); + const EXPORT_LOCAL: Set = new Set(); + + node.statements.forEach(stmt => { + if (ts.isImportDeclaration(stmt) && stmt.importClause && !stmt.importClause.isTypeOnly) { + let fileFullPath: string = getFileFullPath(stmt.moduleSpecifier.getText().replace(/'|"/g, ''), pagesDir); + const importClause: ts.ImportClause = stmt.importClause; + if (importClause.name) { + let localName: string = importClause.name.escapedText.toString(); + let importName: ImportName = {name: 'default', node: stmt, source: fileFullPath}; + IMPORT_AS.set(localName, importName); + } + if (importClause.namedBindings && ts.isNamedImports(importClause.namedBindings)) { + importClause.namedBindings.elements.forEach(elem => { + let localName: string = elem.name.escapedText.toString(); + let importName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : localName; + IMPORT_AS.set(localName, {name: importName, node: stmt, source: fileFullPath}) + }); + } + } + + if (ts.isExportDeclaration(stmt)) { + if (stmt.moduleSpecifier && !stmt.isTypeOnly && stmt.exportClause && ts.isNamedExports(stmt.exportClause)) { + let fileFullPath: string = getFileFullPath(stmt.moduleSpecifier.getText().replace(/'|"/g, ''), pagesDir); + stmt.exportClause.elements.forEach(elem => { + let importName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : + elem.name.escapedText.toString(); + if (RE_EXPORT_NAME.has(fileFullPath)) { + RE_EXPORT_NAME.get(fileFullPath).set(importName, stmt); + } else { + RE_EXPORT_NAME.set(fileFullPath, (new Map()).set(importName, stmt)); + } + }) + } + if (!stmt.moduleSpecifier && stmt.exportClause && ts.isNamedExports(stmt.exportClause)) { + stmt.exportClause.elements.forEach(elem => { + let localName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : + elem.name.escapedText.toString(); + EXPORT_LOCAL.add(localName); + }); + } + } + }); + + EXPORT_LOCAL.forEach(local => { + if (IMPORT_AS.has(local)) { + let importName: ImportName = IMPORT_AS.get(local); + if (RE_EXPORT_NAME.has(importName.source)) { + RE_EXPORT_NAME.get(importName.source).set(importName.name, importName.node); + } else { + RE_EXPORT_NAME.set(importName.source, (new Map()).set(importName.name, importName.node)); + } + } + }); + + return RE_EXPORT_NAME; +} + +function processTypeImportDecl(node: ts.ImportDeclaration, localTypeNames: Set): void { + if (node.importClause && node.importClause.isTypeOnly) { + // import type T from ... + if (node.importClause.name) { + localTypeNames.add(node.importClause.name.escapedText.toString()); + } + // import type * as T from ... + if (node.importClause.namedBindings && ts.isNamespaceImport(node.importClause.namedBindings)) { + localTypeNames.add(node.importClause.namedBindings.name.escapedText.toString()); + } + // import type { e_T as T } from ... + if (node.importClause.namedBindings && ts.isNamedImports(node.importClause.namedBindings)) { + node.importClause.namedBindings.elements.forEach((elem: any) => { + localTypeNames.add(elem.name.escapedText.toString()); + }); + } + } +} + +function processExportDecl(node: ts.ExportDeclaration, typeExportNames: Set, + exportAs: Map): void { + if (node.isTypeOnly) { + if (node.moduleSpecifier && node.exportClause) { + // export type * as T from ... + if (ts.isNamespaceExport(node.exportClause)) { + typeExportNames.add(node.exportClause.name.escapedText.toString()); + } + // export type { e_T as T } from ... + if (ts.isNamedExports(node.exportClause)) { + node.exportClause.elements.forEach((elem: any) => { + typeExportNames.add(elem.name.escapedText.toString()); + + }) + } + } + // export type { e_T as T } + if (!node.moduleSpecifier && node.exportClause && ts.isNamedExports(node.exportClause)) { + node.exportClause.elements.forEach((elem: any) => { + typeExportNames.add(elem.name.escapedText.toString()); + }); + } + } else { + // export { e_T as T } + if (!node.moduleSpecifier && node.exportClause && ts.isNamedExports(node.exportClause)) { + node.exportClause.elements.forEach((elem: any) => { + let exportName: string = elem.name.escapedText.toString(); + let localName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : exportName; + exportAs.set(localName, exportName); + }); + } + } +} + +function processEnum(node: ts.EnumDeclaration, localTypeNames: Set, typeExportNames: Set): void { + // 1. export const enum E{} + // 2. const enum E{} export {E as EE} + // 3. export const enum E{} export {E as EE} + let hasConst: boolean = false, hasExport: boolean = false; + node.modifiers && node.modifiers.forEach(m => { + if (m.kind == ts.SyntaxKind.ConstKeyword) { + hasConst = true; + } + if (m.kind == ts.SyntaxKind.ExportKeyword) { + hasExport = true; + } + }); + if (!hasConst) { + return; + } + if (hasExport) { + typeExportNames.add(node.name.escapedText.toString()); + } + localTypeNames.add(node.name.escapedText.toString()); +} + +function processInterfaceAndTypeAlias(node: ts.InterfaceDeclaration | ts.TypeAliasDeclaration, + localTypeNames: Set, typeExportNames: Set): void { + let hasDefault: boolean = false, hasExport: boolean = false; + node.modifiers && node.modifiers.forEach(m => { + if (m.kind == ts.SyntaxKind.DefaultKeyword) { + hasDefault = true; + } + if (m.kind == ts.SyntaxKind.ExportKeyword) { + hasExport = true; + } + }); + localTypeNames.add(node.name.escapedText.toString()); + + if (hasExport) { + let exportName = hasDefault ? 'default' : node.name.escapedText.toString(); + typeExportNames.add(exportName); + } +} + +function checkTypeModuleDeclIsType(node: ts.ModuleDeclaration): boolean { + if (ts.isIdentifier(node.name) && node.body && ts.isModuleBlock(node.body)) { + for (let idx = 0; idx < node.body.statements.length; idx++) { + let stmt: ts.Statement = node.body.statements[idx]; + if (ts.isModuleDeclaration(stmt)) { + if (!checkTypeModuleDeclIsType(stmt)) { + return false; + } + } else if (ts.isEnumDeclaration(stmt)) { + let hasConst: boolean = false; + stmt.modifiers && stmt.modifiers.forEach(m => { + if (m.kind == ts.SyntaxKind.ConstKeyword) { + hasConst = true; + } + }); + if (!hasConst) { + return false; + } + } else if (ts.isImportEqualsDeclaration(stmt)) { + let hasExport: boolean = false; + stmt.modifiers && stmt.modifiers.forEach(m => { + if (m.kind == ts.SyntaxKind.ExportKeyword) { + hasExport = true; + } + }); + if (hasExport) { + return false; + } + } else if (!ts.isInterfaceDeclaration(stmt) || !ts.isTypeAliasDeclaration(stmt)) { + return false; + } + } + } + return true; +} + +function processNamespace(node: ts.ModuleDeclaration, localTypeNames: Set, typeExportNames: Set): void { + if (ts.isIdentifier(node.name) && node.body && ts.isModuleBlock(node.body)) { + if (!checkTypeModuleDeclIsType(node)) { + return; + } + + let hasExport: boolean = false; + node.modifiers && node.modifiers.forEach(m => { + if (m.kind == ts.SyntaxKind.ExportKeyword) { + hasExport = true; + } + }); + if (hasExport) { + typeExportNames.add(node.name.escapedText.toString()); + } + localTypeNames.add(node.name.escapedText.toString()); + } +} + +function addErrorLogIfReExportType(sourceFile: ts.SourceFile, log: LogInfo[], localTypeNames: Set, + typeExportNames: Set, exportAs: Map, exportNames: Map): void { + localTypeNames.forEach(localName => { + if (exportAs.has(localName)) { + typeExportNames.add(exportAs.get(localName)); + } + }); + let reExportNamesArray: Array = Array.from(exportNames.keys()); + let typeExportNamesArray: Array = Array.from(typeExportNames); + const needWarningNames: Array = reExportNamesArray.filter(name => typeExportNamesArray.includes(name)); + needWarningNames.forEach(name => { + const moduleNode: ts.Node = exportNames.get(name)!; + const posOfNode: ts.LineAndCharacter = sourceFile.getLineAndCharacterOfPosition(moduleNode.getStart()); + const error: LogInfo = { + type: LogType.ERROR, + message: `The re-export name '${name}' need to be marked as type. please use 'export type'`, + pos: moduleNode.getStart(), + fileName: sourceFile.fileName, + line: posOfNode.line + 1, + column: posOfNode.character + 1 + } + log.push(error); + }); +} + +export function validateReExportType(node: ts.SourceFile, pagesDir: string, log: LogInfo[]): void { + /* + * those cases' name should be treat as Type + * case1: + * import type {T} from ... + * import type T from ... + * import type * as T from ... + * case2: + * export type {T} from ... + * export type * as T from ... + * case3: + * export interface T {} + * export Type T = {} + * case4: + * export default interface {} + * case5: + * interface T {} + * export {T} + */ + const RE_EXPORT_NAME: Map> = collectNonTypeMarkedReExportName(node, pagesDir); + RE_EXPORT_NAME.forEach((exportNames: Map, source: string) => { + let importFileAst: ts.SourceFile; + if (IMPORT_FILE_ASTCACHE.has(source)) { + importFileAst = IMPORT_FILE_ASTCACHE.get(source); + } else { + importFileAst = generateSourceFileAST(source, source); + IMPORT_FILE_ASTCACHE[source] = importFileAst; + } + const EXPORT_AS: Map = new Map(); + const LOCAL_TYPE_NAMES: Set = new Set(); + const TYPE_EXPORT_NAMES: Set = new Set(); + importFileAst.statements.forEach(stmt => { + switch(stmt.kind) { + case ts.SyntaxKind.ImportDeclaration: { + processTypeImportDecl(stmt, LOCAL_TYPE_NAMES); + break; + } + case ts.SyntaxKind.ExportDeclaration: { + processExportDecl(stmt, TYPE_EXPORT_NAMES, EXPORT_AS); + break; + } + case ts.SyntaxKind.ExportAssignment: { + if (ts.isIdentifier((stmt).expression) && exportNames.has("default")) { + EXPORT_AS.set(((stmt).expression).escapedText.toString(), "default"); + } + break; + } + case ts.SyntaxKind.EnumDeclaration: { + processEnum(stmt, LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); + break; + } + case ts.SyntaxKind.ModuleDeclaration: { + processNamespace(stmt, LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); + break; + } + case ts.SyntaxKind.InterfaceDeclaration: + case ts.SyntaxKind.TypeAliasDeclaration: { + processInterfaceAndTypeAlias(stmt, + LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); + break; + } + default: + break; + } + }); + addErrorLogIfReExportType(node, log, LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES, EXPORT_AS, exportNames); + }); +} diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 396b1a2..394ccf1 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -22,6 +22,7 @@ import { createParentParameter } from './process_component_class'; import processImport from './process_import'; +import { validateReExportType } from './process_import'; import { PAGE_ENTRY_FUNCTION_NAME, PREVIEW_COMPONENT_FUNCTION_NAME, @@ -110,6 +111,10 @@ export function processUISyntax(program: ts.Program, ut = false): Function { preprocessIdAttrs(node.fileName); if (!ut && (path.basename(node.fileName) === 'app.ets' || /\.ts$/.test(node.fileName))) { node = ts.visitEachChild(node, processResourceNode, context); + if (projectConfig.compileMode === ESMODULE && projectConfig.processTs === false + && process.env.compilerType && process.env.compilerType === ARK) { + validateReExportType(node, pagesDir, transformLog.errors); + } if (projectConfig.compileMode === ESMODULE && projectConfig.processTs === true && process.env.compilerType && process.env.compilerType === ARK) { writeFileSyncByNode(node, true); @@ -118,6 +123,10 @@ export function processUISyntax(program: ts.Program, ut = false): Function { } node = createEntryNode(node, context); node = ts.visitEachChild(node, processAllNodes, context); + if (projectConfig.compileMode === ESMODULE && projectConfig.processTs === false + && process.env.compilerType && process.env.compilerType === ARK) { + validateReExportType(node, pagesDir, transformLog.errors); + } GLOBAL_STYLE_FUNCTION.forEach((block, styleName) => { BUILDIN_STYLE_NAMES.delete(styleName); }); -- Gitee From 4df6369c862174a76dfe40d3519d77e111f2a9bb Mon Sep 17 00:00:00 2001 From: hufeng Date: Fri, 16 Dec 2022 16:21:14 +0800 Subject: [PATCH 226/379] Fix getting extension from .d.ts file Signed-off-by: hufeng Change-Id: I895a07c95a61bcc9ca93cecb307a496de03373ae --- compiler/src/process_import.ts | 63 ++++++++++++++----------------- compiler/src/process_ui_syntax.ts | 15 +++----- compiler/src/utils.ts | 17 +++++++++ 3 files changed, 51 insertions(+), 44 deletions(-) diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index 9642986..bc7ba91 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -56,6 +56,7 @@ import { localStoragePropCollection } from './validate_ui_syntax'; import { + getExtension, hasDecorator, LogInfo, LogType, @@ -572,18 +573,6 @@ function getFileResolvePath(fileResolvePath: string, pagesDir: string, filePath: return fileResolvePath; } -function addExtension(filePath: string): string { - if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) { - return ""; - } - - let extension: string = EXTNAME_ETS; - if (fs.existsSync(filePath + '.ts') && fs.statSync(filePath + '.ts').isFile()) { - extension = '.ts'; - } - return extension; -} - function getFileFullPath(filePath: string, pagesDir: string): string { if (filePath && path.extname(filePath) !== EXTNAME_ETS && !isModule(filePath)) { const dirIndexPath: string = path.resolve(path.resolve(pagesDir, filePath), INDEX_ETS); @@ -591,7 +580,7 @@ function getFileFullPath(filePath: string, pagesDir: string): string { fs.existsSync(dirIndexPath)) { filePath = dirIndexPath; } else { - filePath += addExtension(path.resolve(pagesDir, filePath)); + filePath += getExtension(path.resolve(pagesDir, filePath)); } } @@ -657,33 +646,37 @@ function collectNonTypeMarkedReExportName(node: ts.SourceFile, pagesDir: string) node.statements.forEach(stmt => { if (ts.isImportDeclaration(stmt) && stmt.importClause && !stmt.importClause.isTypeOnly) { let fileFullPath: string = getFileFullPath(stmt.moduleSpecifier.getText().replace(/'|"/g, ''), pagesDir); - const importClause: ts.ImportClause = stmt.importClause; - if (importClause.name) { - let localName: string = importClause.name.escapedText.toString(); - let importName: ImportName = {name: 'default', node: stmt, source: fileFullPath}; - IMPORT_AS.set(localName, importName); - } - if (importClause.namedBindings && ts.isNamedImports(importClause.namedBindings)) { - importClause.namedBindings.elements.forEach(elem => { - let localName: string = elem.name.escapedText.toString(); - let importName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : localName; - IMPORT_AS.set(localName, {name: importName, node: stmt, source: fileFullPath}) - }); + if (fileFullPath.endsWith('.ets') || fileFullPath.endsWith('.ts') || fileFullPath.endsWith('.d.ts')) { + const importClause: ts.ImportClause = stmt.importClause; + if (importClause.name) { + let localName: string = importClause.name.escapedText.toString(); + let importName: ImportName = {name: 'default', node: stmt, source: fileFullPath}; + IMPORT_AS.set(localName, importName); + } + if (importClause.namedBindings && ts.isNamedImports(importClause.namedBindings)) { + importClause.namedBindings.elements.forEach(elem => { + let localName: string = elem.name.escapedText.toString(); + let importName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : localName; + IMPORT_AS.set(localName, {name: importName, node: stmt, source: fileFullPath}) + }); + } } } if (ts.isExportDeclaration(stmt)) { if (stmt.moduleSpecifier && !stmt.isTypeOnly && stmt.exportClause && ts.isNamedExports(stmt.exportClause)) { let fileFullPath: string = getFileFullPath(stmt.moduleSpecifier.getText().replace(/'|"/g, ''), pagesDir); - stmt.exportClause.elements.forEach(elem => { - let importName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : - elem.name.escapedText.toString(); - if (RE_EXPORT_NAME.has(fileFullPath)) { - RE_EXPORT_NAME.get(fileFullPath).set(importName, stmt); - } else { - RE_EXPORT_NAME.set(fileFullPath, (new Map()).set(importName, stmt)); - } - }) + if (fileFullPath.endsWith('.ets') || fileFullPath.endsWith('.ts') || fileFullPath.endsWith('.d.ts')) { + stmt.exportClause.elements.forEach(elem => { + let importName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : + elem.name.escapedText.toString(); + if (RE_EXPORT_NAME.has(fileFullPath)) { + RE_EXPORT_NAME.get(fileFullPath).set(importName, stmt); + } else { + RE_EXPORT_NAME.set(fileFullPath, (new Map()).set(importName, stmt)); + } + }); + } } if (!stmt.moduleSpecifier && stmt.exportClause && ts.isNamedExports(stmt.exportClause)) { stmt.exportClause.elements.forEach(elem => { @@ -873,7 +866,7 @@ function addErrorLogIfReExportType(sourceFile: ts.SourceFile, log: LogInfo[], lo const posOfNode: ts.LineAndCharacter = sourceFile.getLineAndCharacterOfPosition(moduleNode.getStart()); const error: LogInfo = { type: LogType.ERROR, - message: `The re-export name '${name}' need to be marked as type. please use 'export type'`, + message: `The re-export name '${name}' need to be marked as type, please use 'export type'.`, pos: moduleNode.getStart(), fileName: sourceFile.fileName, line: posOfNode.line + 1, diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 394ccf1..73d859d 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -111,21 +111,18 @@ export function processUISyntax(program: ts.Program, ut = false): Function { preprocessIdAttrs(node.fileName); if (!ut && (path.basename(node.fileName) === 'app.ets' || /\.ts$/.test(node.fileName))) { node = ts.visitEachChild(node, processResourceNode, context); - if (projectConfig.compileMode === ESMODULE && projectConfig.processTs === false - && process.env.compilerType && process.env.compilerType === ARK) { + if (projectConfig.compileMode === ESMODULE && process.env.compilerType && process.env.compilerType === ARK) { validateReExportType(node, pagesDir, transformLog.errors); - } - if (projectConfig.compileMode === ESMODULE && projectConfig.processTs === true - && process.env.compilerType && process.env.compilerType === ARK) { - writeFileSyncByNode(node, true); + if (projectConfig.processTs === true) { + writeFileSyncByNode(node, true); + } } return node; } node = createEntryNode(node, context); node = ts.visitEachChild(node, processAllNodes, context); - if (projectConfig.compileMode === ESMODULE && projectConfig.processTs === false - && process.env.compilerType && process.env.compilerType === ARK) { - validateReExportType(node, pagesDir, transformLog.errors); + if (projectConfig.compileMode === ESMODULE && process.env.compilerType && process.env.compilerType === ARK) { + validateReExportType(node, pagesDir, transformLog.errors); } GLOBAL_STYLE_FUNCTION.forEach((block, styleName) => { BUILDIN_STYLE_NAMES.delete(styleName); diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 1c84751..f251c45 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -735,4 +735,21 @@ export function unlinkSync(filePath: string): void { if (fs.existsSync(filePath)) { fs.unlinkSync(filePath); } +} + +export function getExtension(filePath: string): string { + if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) { + return ""; + } + + let extension: string = EXTNAME_ETS; + if (fs.existsSync(filePath + '.ts') && fs.statSync(filePath + '.ts').isFile()) { + extension = '.ts'; + } else if (fs.existsSync(filePath + '.d.ts') && fs.statSync(filePath + '.d.ts').isFile()) { + extension = '.d.ts'; + } else if (fs.existsSync(filePath + '.js') && fs.statSync(filePath + '.js').isFile()) { + extension = '.js'; + } + + return extension; } \ No newline at end of file -- Gitee From c04224bb11e23ca4dc04a9b7e79883511d723c01 Mon Sep 17 00:00:00 2001 From: hufeng Date: Sun, 18 Dec 2022 21:02:19 +0800 Subject: [PATCH 227/379] Optimization with type_export_names cache Signed-off-by: hufeng Change-Id: I8d2d9488b3dd071c4a4d31944f0eb2bf572ab983 --- compiler/src/process_import.ts | 111 ++++++++++++++++++--------------- compiler/src/utils.ts | 2 + 2 files changed, 61 insertions(+), 52 deletions(-) diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index bc7ba91..8e55b36 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -646,7 +646,7 @@ function collectNonTypeMarkedReExportName(node: ts.SourceFile, pagesDir: string) node.statements.forEach(stmt => { if (ts.isImportDeclaration(stmt) && stmt.importClause && !stmt.importClause.isTypeOnly) { let fileFullPath: string = getFileFullPath(stmt.moduleSpecifier.getText().replace(/'|"/g, ''), pagesDir); - if (fileFullPath.endsWith('.ets') || fileFullPath.endsWith('.ts') || fileFullPath.endsWith('.d.ts')) { + if (fileFullPath.endsWith('.ets') || fileFullPath.endsWith('.ts')) { const importClause: ts.ImportClause = stmt.importClause; if (importClause.name) { let localName: string = importClause.name.escapedText.toString(); @@ -666,7 +666,7 @@ function collectNonTypeMarkedReExportName(node: ts.SourceFile, pagesDir: string) if (ts.isExportDeclaration(stmt)) { if (stmt.moduleSpecifier && !stmt.isTypeOnly && stmt.exportClause && ts.isNamedExports(stmt.exportClause)) { let fileFullPath: string = getFileFullPath(stmt.moduleSpecifier.getText().replace(/'|"/g, ''), pagesDir); - if (fileFullPath.endsWith('.ets') || fileFullPath.endsWith('.ts') || fileFullPath.endsWith('.d.ts')) { + if (fileFullPath.endsWith('.ets') || fileFullPath.endsWith('.ts')) { stmt.exportClause.elements.forEach(elem => { let importName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : elem.name.escapedText.toString(); @@ -824,7 +824,7 @@ function checkTypeModuleDeclIsType(node: ts.ModuleDeclaration): boolean { if (hasExport) { return false; } - } else if (!ts.isInterfaceDeclaration(stmt) || !ts.isTypeAliasDeclaration(stmt)) { + } else if (!ts.isInterfaceDeclaration(stmt) && !ts.isTypeAliasDeclaration(stmt)) { return false; } } @@ -851,13 +851,8 @@ function processNamespace(node: ts.ModuleDeclaration, localTypeNames: Set, - typeExportNames: Set, exportAs: Map, exportNames: Map): void { - localTypeNames.forEach(localName => { - if (exportAs.has(localName)) { - typeExportNames.add(exportAs.get(localName)); - } - }); +function addErrorLogIfReExportType(sourceFile: ts.SourceFile, log: LogInfo[], typeExportNames: Set, + exportNames: Map): void { let reExportNamesArray: Array = Array.from(exportNames.keys()); let typeExportNamesArray: Array = Array.from(typeExportNames); const needWarningNames: Array = reExportNamesArray.filter(name => typeExportNamesArray.includes(name)); @@ -876,6 +871,8 @@ function addErrorLogIfReExportType(sourceFile: ts.SourceFile, log: LogInfo[], lo }); } +const FILE_TYPE_EXPORT_NAMES: Map> = new Map(); + export function validateReExportType(node: ts.SourceFile, pagesDir: string, log: LogInfo[]): void { /* * those cases' name should be treat as Type @@ -888,7 +885,7 @@ export function validateReExportType(node: ts.SourceFile, pagesDir: string, log: * export type * as T from ... * case3: * export interface T {} - * export Type T = {} + * export type T = {} * case4: * export default interface {} * case5: @@ -897,50 +894,60 @@ export function validateReExportType(node: ts.SourceFile, pagesDir: string, log: */ const RE_EXPORT_NAME: Map> = collectNonTypeMarkedReExportName(node, pagesDir); RE_EXPORT_NAME.forEach((exportNames: Map, source: string) => { - let importFileAst: ts.SourceFile; - if (IMPORT_FILE_ASTCACHE.has(source)) { - importFileAst = IMPORT_FILE_ASTCACHE.get(source); + if (FILE_TYPE_EXPORT_NAMES.has(source)) { + addErrorLogIfReExportType(node, log, FILE_TYPE_EXPORT_NAMES.get(source), exportNames); } else { - importFileAst = generateSourceFileAST(source, source); - IMPORT_FILE_ASTCACHE[source] = importFileAst; - } - const EXPORT_AS: Map = new Map(); - const LOCAL_TYPE_NAMES: Set = new Set(); - const TYPE_EXPORT_NAMES: Set = new Set(); - importFileAst.statements.forEach(stmt => { - switch(stmt.kind) { - case ts.SyntaxKind.ImportDeclaration: { - processTypeImportDecl(stmt, LOCAL_TYPE_NAMES); - break; - } - case ts.SyntaxKind.ExportDeclaration: { - processExportDecl(stmt, TYPE_EXPORT_NAMES, EXPORT_AS); - break; - } - case ts.SyntaxKind.ExportAssignment: { - if (ts.isIdentifier((stmt).expression) && exportNames.has("default")) { - EXPORT_AS.set(((stmt).expression).escapedText.toString(), "default"); + let importFileAst: ts.SourceFile; + if (IMPORT_FILE_ASTCACHE.has(source)) { + importFileAst = IMPORT_FILE_ASTCACHE.get(source); + } else { + importFileAst = generateSourceFileAST(source, source); + IMPORT_FILE_ASTCACHE[source] = importFileAst; + } + const EXPORT_AS: Map = new Map(); + const LOCAL_TYPE_NAMES: Set = new Set(); + const TYPE_EXPORT_NAMES: Set = new Set(); + importFileAst.statements.forEach(stmt => { + switch(stmt.kind) { + case ts.SyntaxKind.ImportDeclaration: { + processTypeImportDecl(stmt, LOCAL_TYPE_NAMES); + break; } - break; - } - case ts.SyntaxKind.EnumDeclaration: { - processEnum(stmt, LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); - break; - } - case ts.SyntaxKind.ModuleDeclaration: { - processNamespace(stmt, LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); - break; + case ts.SyntaxKind.ExportDeclaration: { + processExportDecl(stmt, TYPE_EXPORT_NAMES, EXPORT_AS); + break; + } + case ts.SyntaxKind.ExportAssignment: { + if (ts.isIdentifier((stmt).expression) && exportNames.has("default")) { + EXPORT_AS.set(((stmt).expression).escapedText.toString(), "default"); + } + break; + } + case ts.SyntaxKind.EnumDeclaration: { + processEnum(stmt, LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); + break; + } + case ts.SyntaxKind.ModuleDeclaration: { + processNamespace(stmt, LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); + break; + } + case ts.SyntaxKind.InterfaceDeclaration: + case ts.SyntaxKind.TypeAliasDeclaration: { + processInterfaceAndTypeAlias(stmt, + LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); + break; + } + default: + break; } - case ts.SyntaxKind.InterfaceDeclaration: - case ts.SyntaxKind.TypeAliasDeclaration: { - processInterfaceAndTypeAlias(stmt, - LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); - break; + }); + LOCAL_TYPE_NAMES.forEach(localName => { + if (EXPORT_AS.has(localName)) { + TYPE_EXPORT_NAMES.add(EXPORT_AS.get(localName)); } - default: - break; - } - }); - addErrorLogIfReExportType(node, log, LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES, EXPORT_AS, exportNames); + }); + FILE_TYPE_EXPORT_NAMES.set(source, TYPE_EXPORT_NAMES); + addErrorLogIfReExportType(node, log, TYPE_EXPORT_NAMES, exportNames); + } }); } diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index f251c45..ea229c1 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -747,6 +747,8 @@ export function getExtension(filePath: string): string { extension = '.ts'; } else if (fs.existsSync(filePath + '.d.ts') && fs.statSync(filePath + '.d.ts').isFile()) { extension = '.d.ts'; + } else if (fs.existsSync(filePath + '.d.ets') && fs.statSync(filePath + '.d.ets').isFile()) { + extension = '.d.ets'; } else if (fs.existsSync(filePath + '.js') && fs.statSync(filePath + '.js').isFile()) { extension = '.js'; } -- Gitee From 240fe9a3a2e5a29e4932b840c7c10b7ffd618010 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 19 Dec 2022 19:46:30 +0800 Subject: [PATCH 228/379] houhaoyu@huawei.com transform nacdestination title builder Signed-off-by: houhaoyu Change-Id: I58a320def9d4633f03b292aaf99913bca4836ffc --- compiler/src/pre_define.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 35882be..819e0fb 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -214,7 +214,8 @@ export const VIEW_STACK_PROCESSOR: string = 'ViewStackProcessor'; export const BIND_POPUP: string = 'bindPopup'; export const BIND_POPUP_SET: Set = new Set(['bindPopup']); export const BIND_DRAG_SET: Set = new Set(['onDragStart', 'onItemDragStart']); -export const BIND_OBJECT_PROPERTY: Map> = new Map([['Navigation', new Set(['title'])]]); +export const BIND_OBJECT_PROPERTY: Map> = + new Map([['Navigation', new Set(['title'])], ['NavDestination', new Set(['title'])]]); export const CREATE_BIND_COMPONENT: Set = new Set(['ListItemGroup']); export const HEADER: string = 'header'; export const FOOTER: string = 'footer'; -- Gitee From dad9719a9b9850aeba78ae9a80c6dd291eebdda0 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 19 Dec 2022 20:04:42 +0800 Subject: [PATCH 229/379] houhaoyu@huawei.com add color of log Signed-off-by: houhaoyu Change-Id: I78f5f4889c087d6b6bd62dc8b5811e98a42ecd7b --- compiler/src/compile_info.ts | 7 ++++--- compiler/src/pre_process.ts | 5 ++++- compiler/src/utils.ts | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 7a937e4..93e7df3 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -340,9 +340,10 @@ export class ResultStates { const { line, character }: ts.LineAndCharacter = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start!); logger.error(this.red, - `ArkTS:ERROR File: ${diagnostic.file.fileName}:${line + 1}:${character + 1}\n ${message}\n`); + `ArkTS:ERROR File: ${diagnostic.file.fileName}:${line + 1}:${character + 1}\n ${message}\n`, + this.reset); } else { - logger.error(this.red, `ArkTS:ERROR: ${message}`); + logger.error(this.red, `ArkTS:ERROR: ${message}`, this.reset); } } } @@ -438,7 +439,7 @@ export class ResultStates { if (projectConfig.hotReload) { this.hotReloadIncrementalTime.hotReloadIncrementalEndTime = new Date().getTime().toString(); console.info(blue, 'Incremental build start: ' + this.hotReloadIncrementalTime.hotReloadIncrementalStartTime - +'\n' + 'Incremental build end: ' + this.hotReloadIncrementalTime.hotReloadIncrementalEndTime); + +'\n' + 'Incremental build end: ' + this.hotReloadIncrementalTime.hotReloadIncrementalEndTime, reset); } if (resultInfo.length === 0) { console.info(blue, 'COMPILE RESULT:SUCCESS ', reset); diff --git a/compiler/src/pre_process.ts b/compiler/src/pre_process.ts index a961471..76f4637 100644 --- a/compiler/src/pre_process.ts +++ b/compiler/src/pre_process.ts @@ -42,6 +42,9 @@ import { genETS } from '../codegen/codegen_ets.js'; const visualMap: Map = new Map(); const slotMap: Map = new Map(); +const red: string = '\u001b[31m'; +const reset: string = '\u001b[39m'; + function preProcess(source: string): string { process.env.compiler = BUILD_ON; if (/\.ets$/.test(this.resourcePath)) { @@ -265,7 +268,7 @@ function generateSourceMapForNewAndOriEtsFile(resourcePath: string, content: str } fs.writeFile(path.resolve(visualMapDirPath, visualMapName), sourcemap.toString(), (err) => { if (err) { - return console.error('ERROR: Failed to write visual.js.map'); + return console.error(red, 'ERROR: Failed to write visual.js.map', reset); } }); } diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 1c84751..06f4d10 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -191,7 +191,7 @@ export function readFile(dir: string, utFiles: string[]) { } }); } catch (e) { - console.error('ETS ERROR: ' + e); + console.error(red, 'ArkTS ERROR: ' + e, reset); } } @@ -707,17 +707,17 @@ export function maxFilePathLength(): number { export function validateFilePathLength(filePath: string): boolean { if (maxFilePathLength() < 0) { - logger.error("Unknown OS platform"); + logger.error(red, "Unknown OS platform", reset); process.exitCode = FAIL; return false; } else if (filePath.length > 0 && filePath.length <= maxFilePathLength()) { return true; } else if (filePath.length > maxFilePathLength()) { - logger.error("The length of path exceeds the maximum length: " + maxFilePathLength()); + logger.error(red, "The length of path exceeds the maximum length: " + maxFilePathLength(), reset); process.exitCode = FAIL; return false; } else { - logger.error("Validate file path failed"); + logger.error(red, "Validate file path failed", reset); process.exitCode = FAIL; return false; } -- Gitee From 6a2eef4137de772ca2cb929cd4932f01c6806db0 Mon Sep 17 00:00:00 2001 From: zhangchen168 Date: Mon, 12 Dec 2022 20:18:36 +0800 Subject: [PATCH 230/379] Support TS compilation in SDK Issue: https://gitee.com/openharmony/developtools_ace_ets2bundle/issues/I65VMU Signed-off-by: zhangchen168 Change-Id: I71bc90a61976fe12e3112e58ace6b7d4c4da8483 --- compiler/main.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 68d4404..ec61d73 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -21,7 +21,11 @@ const { readFile, writeFileSync } = require('./lib/utils'); -const { WORKERS_DIR } = require('./lib/pre_define'); + +const { + WORKERS_DIR, + TS2ABC +} = require('./lib/pre_define'); const { configure, @@ -456,12 +460,18 @@ function loadModuleInfo(projectConfig, envArgs) { projectConfig.projectRootPath = buildJsonInfo.projectRootPath; projectConfig.modulePathMap = buildJsonInfo.modulePathMap; projectConfig.isOhosTest = buildJsonInfo.isOhosTest; - projectConfig.processTs = false; + projectConfig.aotMode = buildJsonInfo.aotMode; + if (projectConfig.aotMode && projectConfig.compileMode === 'esmodule') { + projectConfig.processTs = true; + projectConfig.pandaMode = TS2ABC; + } else { + projectConfig.processTs = false; + projectConfig.pandaMode = buildJsonInfo.pandaMode; + } projectConfig.buildArkMode = envArgs.buildMode; if (buildJsonInfo.compileMode === 'esmodule') { projectConfig.nodeModulesPath = buildJsonInfo.nodeModulesPath; } - projectConfig.pandaMode = buildJsonInfo.pandaMode; } } -- Gitee From b6a51eccdbf4e8cb754a7121c74eba5a521a057b Mon Sep 17 00:00:00 2001 From: hufeng Date: Tue, 20 Dec 2022 20:05:29 +0800 Subject: [PATCH 231/379] Fix compileMode being assigned with undefined Signed-off-by: hufeng Change-Id: Id5a59e6de4a5f24d3126277a19d5460f2dc1ea2b --- compiler/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/main.js b/compiler/main.js index ec61d73..0ce7954 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -456,7 +456,9 @@ function hashProjectPath(projectPath) { function loadModuleInfo(projectConfig, envArgs) { if (projectConfig.aceBuildJson && fs.existsSync(projectConfig.aceBuildJson)) { const buildJsonInfo = JSON.parse(fs.readFileSync(projectConfig.aceBuildJson).toString()); - projectConfig.compileMode = buildJsonInfo.compileMode; + if (buildJsonInfo.compileMode) { + projectConfig.compileMode = buildJsonInfo.compileMode; + } projectConfig.projectRootPath = buildJsonInfo.projectRootPath; projectConfig.modulePathMap = buildJsonInfo.modulePathMap; projectConfig.isOhosTest = buildJsonInfo.isOhosTest; -- Gitee From 76f622746babcb376585a2b85bcb446c957c802d Mon Sep 17 00:00:00 2001 From: hufeng Date: Tue, 20 Dec 2022 21:37:44 +0800 Subject: [PATCH 232/379] Optimize the error log's display Signed-off-by: hufeng Change-Id: If1a905386d420c454dc4e5bd963e63cc30172f27 --- compiler/src/process_import.ts | 54 +++++++--------------------------- 1 file changed, 11 insertions(+), 43 deletions(-) diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index 8e55b36..c043f72 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -755,28 +755,6 @@ function processExportDecl(node: ts.ExportDeclaration, typeExportNames: Set, typeExportNames: Set): void { - // 1. export const enum E{} - // 2. const enum E{} export {E as EE} - // 3. export const enum E{} export {E as EE} - let hasConst: boolean = false, hasExport: boolean = false; - node.modifiers && node.modifiers.forEach(m => { - if (m.kind == ts.SyntaxKind.ConstKeyword) { - hasConst = true; - } - if (m.kind == ts.SyntaxKind.ExportKeyword) { - hasExport = true; - } - }); - if (!hasConst) { - return; - } - if (hasExport) { - typeExportNames.add(node.name.escapedText.toString()); - } - localTypeNames.add(node.name.escapedText.toString()); -} - function processInterfaceAndTypeAlias(node: ts.InterfaceDeclaration | ts.TypeAliasDeclaration, localTypeNames: Set, typeExportNames: Set): void { let hasDefault: boolean = false, hasExport: boolean = false; @@ -800,20 +778,8 @@ function checkTypeModuleDeclIsType(node: ts.ModuleDeclaration): boolean { if (ts.isIdentifier(node.name) && node.body && ts.isModuleBlock(node.body)) { for (let idx = 0; idx < node.body.statements.length; idx++) { let stmt: ts.Statement = node.body.statements[idx]; - if (ts.isModuleDeclaration(stmt)) { - if (!checkTypeModuleDeclIsType(stmt)) { - return false; - } - } else if (ts.isEnumDeclaration(stmt)) { - let hasConst: boolean = false; - stmt.modifiers && stmt.modifiers.forEach(m => { - if (m.kind == ts.SyntaxKind.ConstKeyword) { - hasConst = true; - } - }); - if (!hasConst) { - return false; - } + if (ts.isModuleDeclaration(stmt) && !checkTypeModuleDeclIsType(stmt)) { + return false; } else if (ts.isImportEqualsDeclaration(stmt)) { let hasExport: boolean = false; stmt.modifiers && stmt.modifiers.forEach(m => { @@ -858,10 +824,16 @@ function addErrorLogIfReExportType(sourceFile: ts.SourceFile, log: LogInfo[], ty const needWarningNames: Array = reExportNamesArray.filter(name => typeExportNamesArray.includes(name)); needWarningNames.forEach(name => { const moduleNode: ts.Node = exportNames.get(name)!; + let typeIdentifier: string = name; + if (name === 'default' && ts.isImportDeclaration(moduleNode) && moduleNode.importClause) { + typeIdentifier = moduleNode.importClause.name!.escapedText.toString(); + } const posOfNode: ts.LineAndCharacter = sourceFile.getLineAndCharacterOfPosition(moduleNode.getStart()); + let errorMessage: string = `The re-export name '${typeIdentifier}' need to be marked as type, `; + errorMessage += ts.isImportDeclaration(moduleNode) ? "please use 'import type'." : "please use 'export type'."; const error: LogInfo = { type: LogType.ERROR, - message: `The re-export name '${name}' need to be marked as type, please use 'export type'.`, + message: errorMessage, pos: moduleNode.getStart(), fileName: sourceFile.fileName, line: posOfNode.line + 1, @@ -918,15 +890,11 @@ export function validateReExportType(node: ts.SourceFile, pagesDir: string, log: break; } case ts.SyntaxKind.ExportAssignment: { - if (ts.isIdentifier((stmt).expression) && exportNames.has("default")) { + if (ts.isIdentifier((stmt).expression)) { EXPORT_AS.set(((stmt).expression).escapedText.toString(), "default"); } break; } - case ts.SyntaxKind.EnumDeclaration: { - processEnum(stmt, LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); - break; - } case ts.SyntaxKind.ModuleDeclaration: { processNamespace(stmt, LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); break; @@ -934,7 +902,7 @@ export function validateReExportType(node: ts.SourceFile, pagesDir: string, log: case ts.SyntaxKind.InterfaceDeclaration: case ts.SyntaxKind.TypeAliasDeclaration: { processInterfaceAndTypeAlias(stmt, - LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); + LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); break; } default: -- Gitee From 7df057f38fd26c7098e5b08a4d147cabe676fe91 Mon Sep 17 00:00:00 2001 From: bojiang Date: Wed, 21 Dec 2022 18:16:07 +0800 Subject: [PATCH 233/379] =?UTF-8?q?sourmap=E8=B7=AF=E5=BE=84=E5=8F=98?= =?UTF-8?q?=E6=88=90=E7=9B=B8=E5=AF=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bojiang Change-Id: I78f32edf8a4eb5389dcd91f663ed9cdc82dc35ee --- compiler/webpack.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 3109820..a844dc0 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -237,6 +237,9 @@ function setReleaseConfig(config) { } })] }); + config.output.devtoolModuleFilenameTemplate = (info) => { + return `webpack:///${info.absoluteResourcePath.replace(projectConfig.projectRootPath, '')}`; + }; config.output.sourceMapFilename = '_releaseMap/[name].js.map'; config.performance = { hints: false -- Gitee From 1094a7f5906667c16aa6f0cdc7b6cf9240a6dc53 Mon Sep 17 00:00:00 2001 From: hufeng Date: Wed, 21 Dec 2022 17:03:11 +0800 Subject: [PATCH 234/379] Polish Code Signed-off-by: hufeng Change-Id: I54377ea8308ed43f7909f740d9a040de2ff705cc --- compiler/src/process_import.ts | 106 +++++++++++++++++---------------- 1 file changed, 54 insertions(+), 52 deletions(-) diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index c043f72..62bb2bc 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -664,6 +664,7 @@ function collectNonTypeMarkedReExportName(node: ts.SourceFile, pagesDir: string) } if (ts.isExportDeclaration(stmt)) { + // TD: Check `export * from ...` when tsc supports `export type * from ...`. if (stmt.moduleSpecifier && !stmt.isTypeOnly && stmt.exportClause && ts.isNamedExports(stmt.exportClause)) { let fileFullPath: string = getFileFullPath(stmt.moduleSpecifier.getText().replace(/'|"/g, ''), pagesDir); if (fileFullPath.endsWith('.ets') || fileFullPath.endsWith('.ts')) { @@ -733,7 +734,6 @@ function processExportDecl(node: ts.ExportDeclaration, typeExportNames: Set { typeExportNames.add(elem.name.escapedText.toString()); - }) } } @@ -845,6 +845,56 @@ function addErrorLogIfReExportType(sourceFile: ts.SourceFile, log: LogInfo[], ty const FILE_TYPE_EXPORT_NAMES: Map> = new Map(); +function collectTypeExportNames(source: string): Set { + let importFileAst: ts.SourceFile; + if (IMPORT_FILE_ASTCACHE.has(source)) { + importFileAst = IMPORT_FILE_ASTCACHE.get(source); + } else { + importFileAst = generateSourceFileAST(source, source); + IMPORT_FILE_ASTCACHE[source] = importFileAst; + } + const EXPORT_AS: Map = new Map(); + const LOCAL_TYPE_NAMES: Set = new Set(); + const TYPE_EXPORT_NAMES: Set = new Set(); + importFileAst.statements.forEach(stmt => { + switch(stmt.kind) { + case ts.SyntaxKind.ImportDeclaration: { + processTypeImportDecl(stmt, LOCAL_TYPE_NAMES); + break; + } + case ts.SyntaxKind.ExportDeclaration: { + processExportDecl(stmt, TYPE_EXPORT_NAMES, EXPORT_AS); + break; + } + case ts.SyntaxKind.ExportAssignment: { + if (ts.isIdentifier((stmt).expression)) { + EXPORT_AS.set(((stmt).expression).escapedText.toString(), "default"); + } + break; + } + case ts.SyntaxKind.ModuleDeclaration: { + processNamespace(stmt, LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); + break; + } + case ts.SyntaxKind.InterfaceDeclaration: + case ts.SyntaxKind.TypeAliasDeclaration: { + processInterfaceAndTypeAlias(stmt, + LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); + break; + } + default: + break; + } + }); + LOCAL_TYPE_NAMES.forEach(localName => { + if (EXPORT_AS.has(localName)) { + TYPE_EXPORT_NAMES.add(EXPORT_AS.get(localName)); + } + }); + FILE_TYPE_EXPORT_NAMES.set(source, TYPE_EXPORT_NAMES); + return TYPE_EXPORT_NAMES; +} + export function validateReExportType(node: ts.SourceFile, pagesDir: string, log: LogInfo[]): void { /* * those cases' name should be treat as Type @@ -866,56 +916,8 @@ export function validateReExportType(node: ts.SourceFile, pagesDir: string, log: */ const RE_EXPORT_NAME: Map> = collectNonTypeMarkedReExportName(node, pagesDir); RE_EXPORT_NAME.forEach((exportNames: Map, source: string) => { - if (FILE_TYPE_EXPORT_NAMES.has(source)) { - addErrorLogIfReExportType(node, log, FILE_TYPE_EXPORT_NAMES.get(source), exportNames); - } else { - let importFileAst: ts.SourceFile; - if (IMPORT_FILE_ASTCACHE.has(source)) { - importFileAst = IMPORT_FILE_ASTCACHE.get(source); - } else { - importFileAst = generateSourceFileAST(source, source); - IMPORT_FILE_ASTCACHE[source] = importFileAst; - } - const EXPORT_AS: Map = new Map(); - const LOCAL_TYPE_NAMES: Set = new Set(); - const TYPE_EXPORT_NAMES: Set = new Set(); - importFileAst.statements.forEach(stmt => { - switch(stmt.kind) { - case ts.SyntaxKind.ImportDeclaration: { - processTypeImportDecl(stmt, LOCAL_TYPE_NAMES); - break; - } - case ts.SyntaxKind.ExportDeclaration: { - processExportDecl(stmt, TYPE_EXPORT_NAMES, EXPORT_AS); - break; - } - case ts.SyntaxKind.ExportAssignment: { - if (ts.isIdentifier((stmt).expression)) { - EXPORT_AS.set(((stmt).expression).escapedText.toString(), "default"); - } - break; - } - case ts.SyntaxKind.ModuleDeclaration: { - processNamespace(stmt, LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); - break; - } - case ts.SyntaxKind.InterfaceDeclaration: - case ts.SyntaxKind.TypeAliasDeclaration: { - processInterfaceAndTypeAlias(stmt, - LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); - break; - } - default: - break; - } - }); - LOCAL_TYPE_NAMES.forEach(localName => { - if (EXPORT_AS.has(localName)) { - TYPE_EXPORT_NAMES.add(EXPORT_AS.get(localName)); - } - }); - FILE_TYPE_EXPORT_NAMES.set(source, TYPE_EXPORT_NAMES); - addErrorLogIfReExportType(node, log, TYPE_EXPORT_NAMES, exportNames); - } + let typeExportNames: Set = FILE_TYPE_EXPORT_NAMES.has(source) ? + FILE_TYPE_EXPORT_NAMES.get(source) : collectTypeExportNames(source); + addErrorLogIfReExportType(node, log, typeExportNames, exportNames); }); } -- Gitee From 41410649f4e60a0fc8466f1750db5e400693cc86 Mon Sep 17 00:00:00 2001 From: hufeng Date: Fri, 23 Dec 2022 15:16:17 +0800 Subject: [PATCH 235/379] Add invalid scenarios comment Signed-off-by: hufeng Change-Id: I6d53b48a5ab98740850698ebdc096ae1c73d42d5 --- compiler/src/process_import.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index 62bb2bc..d28145b 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -895,6 +895,31 @@ function collectTypeExportNames(source: string): Set { return TYPE_EXPORT_NAMES; } +/* + * Validate re-export names from ets/ts file whether is a type by compiling with [TranspileOnly]. + * Currently, there are three scenarios as following can not be validated correctly: + * case 1 export some specify type Identifier from one module's export * from ...: + * // A + * export { xx } from 'B' + * // B + * export * from 'C' + * // C + * export interface xx{} + * case 2 export some type Identifier from indirect .d.ts module: + * // A(ts) + * export { xx } from 'B' + * // B(.d.ts) + * export { xx } from 'C' + * // C(.d.ts) + * export interface xx {} + * case 3 export some type Identifier from '/// .d.ts' + * // A(ts) + * export { xx } from 'B' + * // B(.d.ts) + * ///C // extend B with C by using '///' + * // C(.d.ts) + * export interface xx {} + */ export function validateReExportType(node: ts.SourceFile, pagesDir: string, log: LogInfo[]): void { /* * those cases' name should be treat as Type -- Gitee From 03758f9b836389ab1db92424f5b2e3ee1d171a10 Mon Sep 17 00:00:00 2001 From: hufeng Date: Fri, 23 Dec 2022 15:42:53 +0800 Subject: [PATCH 236/379] Adapt to compile ts files Signed-off-by: hufeng Change-Id: I57a53bafba78288ce0ef4c6213db8bb52a438dd2 --- compiler/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index f3a7477..7f433c0 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -571,7 +571,7 @@ function genContentAndSourceMapInfo(node: ts.SourceFile, toTsFile: boolean): any if (toTsFile) { content = content.replace(`${TS_NOCHECK};`, TS_NOCHECK); } - content = processSystemApi(content, true); + content = transformModuleSpecifier(fileName, processSystemApi(content, true)); return { content: content, -- Gitee From 12f14d7d34cb138ef590004b8cc892d7d39d3f6b Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Thu, 22 Dec 2022 14:26:29 +0800 Subject: [PATCH 237/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 极速预览变量问题修复 Signed-off-by: houhaoyu Change-Id: I792ca60ad40a6682c800f7e7d0b1f7fd1237355c --- compiler/server/build_pipe_server.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index 8af9824..fe34896 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -58,7 +58,7 @@ let compileWithCheck; let globalVariable = []; let propertyVariable = []; let globalDeclaration = new Map(); -let variableDoubleCheck = []; +let variableDoubleCheck = new Set(); let compileVariable = false; let connectNum = 0; let script = ''; @@ -187,7 +187,7 @@ function processResourceNode(node, log) { function checkPreparation(receivedMsg) { if (previewCacheFilePath && fs.existsSync(previewCacheFilePath) && compileWithCheck === 'true') { globalVariable = receivedMsg.data.globalVariable.map((item)=>{ - globalDeclaration[item.identifier] = item.declaration; + globalDeclaration.set(item.identifier, item.declaration); return item.identifier; }) propertyVariable = receivedMsg.data.propertyVariable || propertyVariable; @@ -261,13 +261,13 @@ function responseToPlugin() { receivedMsg_.data.log = receivedMsg_.data.log || []; receivedMsg_.data.log.push(...errorInfo); } - if (!receivedMsg_.data.log.length && variableDoubleCheck.length && !compileVariable) { + if (!receivedMsg_.data.log.length && variableDoubleCheck.size && !compileVariable) { compileVariable = true; checkStatus = false; compileStatus = false; let variableContent = ''; variableDoubleCheck.forEach((item)=>{ - variableContent += globalDeclaration[item] + '\n'; + variableContent += globalDeclaration.get(item) + '\n'; }) receivedMsg_.data.variableScript = variableContent; handlePluginCompileVariable(); @@ -278,7 +278,7 @@ function responseToPlugin() { compileStatus = false; errorInfo = []; receivedMsg_ = undefined; - variableDoubleCheck = []; + variableDoubleCheck = new Set(); compileVariable = false; messages.shift(); if (messages.length > 0) { @@ -305,7 +305,7 @@ function matchMessage(message, nameArr, reg, isGlobalVariable = false) { const match = message.match(reg); if (match[1] && nameArr.includes(match[1])) { if (isGlobalVariable) { - variableDoubleCheck.push(match[1]); + variableDoubleCheck.add(match[1]); } return true; } -- Gitee From 53bd59e63b0fc0e6ebd23507c77f95e41d5cc4ad Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Fri, 23 Dec 2022 18:25:13 +0800 Subject: [PATCH 238/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix app.ets白屏 Signed-off-by: houhaoyu Change-Id: Iadf13c4bebca443b7ad66134565cb249cde22c2b --- compiler/src/ets_checker.ts | 3 ++- compiler/src/process_ui_syntax.ts | 4 +++- compiler/src/validate_ui_syntax.ts | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index 4c1d69b..034efec 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -287,7 +287,8 @@ export const importModuleCollection: Set = new Set(); function checkUISyntax(source: string, fileName: string, extendFunctionInfo: extendInfo[]): void { if (/\.ets$/.test(fileName)) { - if (path.basename(fileName) !== 'app.ets') { + if (process.env.compileMode === 'moduleJson' || + path.resolve(fileName) !== path.resolve(projectConfig.projectPath, 'app.ets')) { const sourceFile: ts.SourceFile = ts.createSourceFile(fileName, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.ETS); parseAllNode(sourceFile, sourceFile, extendFunctionInfo); diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 396b1a2..9905e08 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -108,7 +108,9 @@ export function processUISyntax(program: ts.Program, ut = false): Function { if (process.env.compiler === BUILD_ON) { transformLog.sourceFile = node; preprocessIdAttrs(node.fileName); - if (!ut && (path.basename(node.fileName) === 'app.ets' || /\.ts$/.test(node.fileName))) { + if (!ut && (process.env.compileMode !== 'moduleJson' && + path.resolve(node.fileName) === path.resolve(projectConfig.projectPath, 'app.ets') || + /\.ts$/.test(node.fileName))) { node = ts.visitEachChild(node, processResourceNode, context); if (projectConfig.compileMode === ESMODULE && projectConfig.processTs === true && process.env.compilerType && process.env.compilerType === ARK) { diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 34a01a9..14b1b4d 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -148,7 +148,8 @@ export const originalImportNamesMap: Map = new Map(); export function validateUISyntax(source: string, content: string, filePath: string, fileQuery: string): LogInfo[] { let log: LogInfo[] = []; - if (path.basename(filePath) !== 'app.ets') { + if (process.env.compileMode === 'moduleJson' || + path.resolve(filePath) !== path.resolve(projectConfig.projectPath, 'app.ets')) { const res: LogInfo[] = checkComponentDecorator(source, filePath, fileQuery); if (res) { log = log.concat(res); -- Gitee From 42219ddb03149efe9a993f9d602b05370802ab57 Mon Sep 17 00:00:00 2001 From: hufeng Date: Sat, 24 Dec 2022 09:46:09 +0800 Subject: [PATCH 239/379] Move into process_module_syntax Signed-off-by: hufeng Change-Id: I1a65df6226c5c96eca9d465aedf44474f50db5bf --- compiler/src/process_import.ts | 333 +----------------------- compiler/src/process_module_syntax.ts | 347 ++++++++++++++++++++++++++ compiler/src/process_ui_syntax.ts | 2 +- 3 files changed, 351 insertions(+), 331 deletions(-) create mode 100644 compiler/src/process_module_syntax.ts diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index d28145b..aba8db9 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -66,7 +66,7 @@ import { import { projectConfig } from '../main'; import { CUSTOM_BUILDER_METHOD, INNER_COMPONENT_NAMES } from './component_map'; -const IMPORT_FILE_ASTCACHE: Map = new Map(); +export const IMPORT_FILE_ASTCACHE: Map = new Map(); export default function processImport(node: ts.ImportDeclaration | ts.ImportEqualsDeclaration | ts.ExportDeclaration, pagesDir: string, log: LogInfo[], asName: Map = new Map(), @@ -131,7 +131,7 @@ isEntryPage: boolean = true, pathCollection: Set = new Set()): void { } } -function generateSourceFileAST(fileResolvePath: string, filePath: string): ts.SourceFile { +export function generateSourceFileAST(fileResolvePath: string, filePath: string): ts.SourceFile { const originContent: string = fs.readFileSync(fileResolvePath, { encoding: 'utf-8' }); const content: string = path.extname(fileResolvePath) === EXTNAME_ETS ? preprocessNewExtend(preprocessExtend(processSystemApi(originContent.replace( @@ -573,7 +573,7 @@ function getFileResolvePath(fileResolvePath: string, pagesDir: string, filePath: return fileResolvePath; } -function getFileFullPath(filePath: string, pagesDir: string): string { +export function getFileFullPath(filePath: string, pagesDir: string): string { if (filePath && path.extname(filePath) !== EXTNAME_ETS && !isModule(filePath)) { const dirIndexPath: string = path.resolve(path.resolve(pagesDir, filePath), INDEX_ETS); if (/^(\.|\.\.)\//.test(filePath) && !fs.existsSync(path.resolve(pagesDir, filePath + EXTNAME_ETS)) && @@ -619,330 +619,3 @@ function validateModuleName(moduleNode: ts.Identifier, log: LogInfo[], sourceFil log.push(error); } } - -interface ImportName { - name: string, - node: ts.Node, - source: string -} - -function collectNonTypeMarkedReExportName(node: ts.SourceFile, pagesDir: string): Map> { - /* those cases need be validated - * case 1: re-export - * export { externalName as localName } from './xxx' - * - * case 2: indirect re-export nameBindings - * import { externalName as localName } from './xxx' - * export [type] { localName as re-exportName } - * - * case 3: indirect re-export default - * import defaultLocalName from './xxx' - * export [type] { defaultLocalName as re-exportName } - */ - const RE_EXPORT_NAME: Map> = new Map(); - const IMPORT_AS: Map = new Map(); - const EXPORT_LOCAL: Set = new Set(); - - node.statements.forEach(stmt => { - if (ts.isImportDeclaration(stmt) && stmt.importClause && !stmt.importClause.isTypeOnly) { - let fileFullPath: string = getFileFullPath(stmt.moduleSpecifier.getText().replace(/'|"/g, ''), pagesDir); - if (fileFullPath.endsWith('.ets') || fileFullPath.endsWith('.ts')) { - const importClause: ts.ImportClause = stmt.importClause; - if (importClause.name) { - let localName: string = importClause.name.escapedText.toString(); - let importName: ImportName = {name: 'default', node: stmt, source: fileFullPath}; - IMPORT_AS.set(localName, importName); - } - if (importClause.namedBindings && ts.isNamedImports(importClause.namedBindings)) { - importClause.namedBindings.elements.forEach(elem => { - let localName: string = elem.name.escapedText.toString(); - let importName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : localName; - IMPORT_AS.set(localName, {name: importName, node: stmt, source: fileFullPath}) - }); - } - } - } - - if (ts.isExportDeclaration(stmt)) { - // TD: Check `export * from ...` when tsc supports `export type * from ...`. - if (stmt.moduleSpecifier && !stmt.isTypeOnly && stmt.exportClause && ts.isNamedExports(stmt.exportClause)) { - let fileFullPath: string = getFileFullPath(stmt.moduleSpecifier.getText().replace(/'|"/g, ''), pagesDir); - if (fileFullPath.endsWith('.ets') || fileFullPath.endsWith('.ts')) { - stmt.exportClause.elements.forEach(elem => { - let importName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : - elem.name.escapedText.toString(); - if (RE_EXPORT_NAME.has(fileFullPath)) { - RE_EXPORT_NAME.get(fileFullPath).set(importName, stmt); - } else { - RE_EXPORT_NAME.set(fileFullPath, (new Map()).set(importName, stmt)); - } - }); - } - } - if (!stmt.moduleSpecifier && stmt.exportClause && ts.isNamedExports(stmt.exportClause)) { - stmt.exportClause.elements.forEach(elem => { - let localName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : - elem.name.escapedText.toString(); - EXPORT_LOCAL.add(localName); - }); - } - } - }); - - EXPORT_LOCAL.forEach(local => { - if (IMPORT_AS.has(local)) { - let importName: ImportName = IMPORT_AS.get(local); - if (RE_EXPORT_NAME.has(importName.source)) { - RE_EXPORT_NAME.get(importName.source).set(importName.name, importName.node); - } else { - RE_EXPORT_NAME.set(importName.source, (new Map()).set(importName.name, importName.node)); - } - } - }); - - return RE_EXPORT_NAME; -} - -function processTypeImportDecl(node: ts.ImportDeclaration, localTypeNames: Set): void { - if (node.importClause && node.importClause.isTypeOnly) { - // import type T from ... - if (node.importClause.name) { - localTypeNames.add(node.importClause.name.escapedText.toString()); - } - // import type * as T from ... - if (node.importClause.namedBindings && ts.isNamespaceImport(node.importClause.namedBindings)) { - localTypeNames.add(node.importClause.namedBindings.name.escapedText.toString()); - } - // import type { e_T as T } from ... - if (node.importClause.namedBindings && ts.isNamedImports(node.importClause.namedBindings)) { - node.importClause.namedBindings.elements.forEach((elem: any) => { - localTypeNames.add(elem.name.escapedText.toString()); - }); - } - } -} - -function processExportDecl(node: ts.ExportDeclaration, typeExportNames: Set, - exportAs: Map): void { - if (node.isTypeOnly) { - if (node.moduleSpecifier && node.exportClause) { - // export type * as T from ... - if (ts.isNamespaceExport(node.exportClause)) { - typeExportNames.add(node.exportClause.name.escapedText.toString()); - } - // export type { e_T as T } from ... - if (ts.isNamedExports(node.exportClause)) { - node.exportClause.elements.forEach((elem: any) => { - typeExportNames.add(elem.name.escapedText.toString()); - }) - } - } - // export type { e_T as T } - if (!node.moduleSpecifier && node.exportClause && ts.isNamedExports(node.exportClause)) { - node.exportClause.elements.forEach((elem: any) => { - typeExportNames.add(elem.name.escapedText.toString()); - }); - } - } else { - // export { e_T as T } - if (!node.moduleSpecifier && node.exportClause && ts.isNamedExports(node.exportClause)) { - node.exportClause.elements.forEach((elem: any) => { - let exportName: string = elem.name.escapedText.toString(); - let localName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : exportName; - exportAs.set(localName, exportName); - }); - } - } -} - -function processInterfaceAndTypeAlias(node: ts.InterfaceDeclaration | ts.TypeAliasDeclaration, - localTypeNames: Set, typeExportNames: Set): void { - let hasDefault: boolean = false, hasExport: boolean = false; - node.modifiers && node.modifiers.forEach(m => { - if (m.kind == ts.SyntaxKind.DefaultKeyword) { - hasDefault = true; - } - if (m.kind == ts.SyntaxKind.ExportKeyword) { - hasExport = true; - } - }); - localTypeNames.add(node.name.escapedText.toString()); - - if (hasExport) { - let exportName = hasDefault ? 'default' : node.name.escapedText.toString(); - typeExportNames.add(exportName); - } -} - -function checkTypeModuleDeclIsType(node: ts.ModuleDeclaration): boolean { - if (ts.isIdentifier(node.name) && node.body && ts.isModuleBlock(node.body)) { - for (let idx = 0; idx < node.body.statements.length; idx++) { - let stmt: ts.Statement = node.body.statements[idx]; - if (ts.isModuleDeclaration(stmt) && !checkTypeModuleDeclIsType(stmt)) { - return false; - } else if (ts.isImportEqualsDeclaration(stmt)) { - let hasExport: boolean = false; - stmt.modifiers && stmt.modifiers.forEach(m => { - if (m.kind == ts.SyntaxKind.ExportKeyword) { - hasExport = true; - } - }); - if (hasExport) { - return false; - } - } else if (!ts.isInterfaceDeclaration(stmt) && !ts.isTypeAliasDeclaration(stmt)) { - return false; - } - } - } - return true; -} - -function processNamespace(node: ts.ModuleDeclaration, localTypeNames: Set, typeExportNames: Set): void { - if (ts.isIdentifier(node.name) && node.body && ts.isModuleBlock(node.body)) { - if (!checkTypeModuleDeclIsType(node)) { - return; - } - - let hasExport: boolean = false; - node.modifiers && node.modifiers.forEach(m => { - if (m.kind == ts.SyntaxKind.ExportKeyword) { - hasExport = true; - } - }); - if (hasExport) { - typeExportNames.add(node.name.escapedText.toString()); - } - localTypeNames.add(node.name.escapedText.toString()); - } -} - -function addErrorLogIfReExportType(sourceFile: ts.SourceFile, log: LogInfo[], typeExportNames: Set, - exportNames: Map): void { - let reExportNamesArray: Array = Array.from(exportNames.keys()); - let typeExportNamesArray: Array = Array.from(typeExportNames); - const needWarningNames: Array = reExportNamesArray.filter(name => typeExportNamesArray.includes(name)); - needWarningNames.forEach(name => { - const moduleNode: ts.Node = exportNames.get(name)!; - let typeIdentifier: string = name; - if (name === 'default' && ts.isImportDeclaration(moduleNode) && moduleNode.importClause) { - typeIdentifier = moduleNode.importClause.name!.escapedText.toString(); - } - const posOfNode: ts.LineAndCharacter = sourceFile.getLineAndCharacterOfPosition(moduleNode.getStart()); - let errorMessage: string = `The re-export name '${typeIdentifier}' need to be marked as type, `; - errorMessage += ts.isImportDeclaration(moduleNode) ? "please use 'import type'." : "please use 'export type'."; - const error: LogInfo = { - type: LogType.ERROR, - message: errorMessage, - pos: moduleNode.getStart(), - fileName: sourceFile.fileName, - line: posOfNode.line + 1, - column: posOfNode.character + 1 - } - log.push(error); - }); -} - -const FILE_TYPE_EXPORT_NAMES: Map> = new Map(); - -function collectTypeExportNames(source: string): Set { - let importFileAst: ts.SourceFile; - if (IMPORT_FILE_ASTCACHE.has(source)) { - importFileAst = IMPORT_FILE_ASTCACHE.get(source); - } else { - importFileAst = generateSourceFileAST(source, source); - IMPORT_FILE_ASTCACHE[source] = importFileAst; - } - const EXPORT_AS: Map = new Map(); - const LOCAL_TYPE_NAMES: Set = new Set(); - const TYPE_EXPORT_NAMES: Set = new Set(); - importFileAst.statements.forEach(stmt => { - switch(stmt.kind) { - case ts.SyntaxKind.ImportDeclaration: { - processTypeImportDecl(stmt, LOCAL_TYPE_NAMES); - break; - } - case ts.SyntaxKind.ExportDeclaration: { - processExportDecl(stmt, TYPE_EXPORT_NAMES, EXPORT_AS); - break; - } - case ts.SyntaxKind.ExportAssignment: { - if (ts.isIdentifier((stmt).expression)) { - EXPORT_AS.set(((stmt).expression).escapedText.toString(), "default"); - } - break; - } - case ts.SyntaxKind.ModuleDeclaration: { - processNamespace(stmt, LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); - break; - } - case ts.SyntaxKind.InterfaceDeclaration: - case ts.SyntaxKind.TypeAliasDeclaration: { - processInterfaceAndTypeAlias(stmt, - LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); - break; - } - default: - break; - } - }); - LOCAL_TYPE_NAMES.forEach(localName => { - if (EXPORT_AS.has(localName)) { - TYPE_EXPORT_NAMES.add(EXPORT_AS.get(localName)); - } - }); - FILE_TYPE_EXPORT_NAMES.set(source, TYPE_EXPORT_NAMES); - return TYPE_EXPORT_NAMES; -} - -/* - * Validate re-export names from ets/ts file whether is a type by compiling with [TranspileOnly]. - * Currently, there are three scenarios as following can not be validated correctly: - * case 1 export some specify type Identifier from one module's export * from ...: - * // A - * export { xx } from 'B' - * // B - * export * from 'C' - * // C - * export interface xx{} - * case 2 export some type Identifier from indirect .d.ts module: - * // A(ts) - * export { xx } from 'B' - * // B(.d.ts) - * export { xx } from 'C' - * // C(.d.ts) - * export interface xx {} - * case 3 export some type Identifier from '/// .d.ts' - * // A(ts) - * export { xx } from 'B' - * // B(.d.ts) - * ///C // extend B with C by using '///' - * // C(.d.ts) - * export interface xx {} - */ -export function validateReExportType(node: ts.SourceFile, pagesDir: string, log: LogInfo[]): void { - /* - * those cases' name should be treat as Type - * case1: - * import type {T} from ... - * import type T from ... - * import type * as T from ... - * case2: - * export type {T} from ... - * export type * as T from ... - * case3: - * export interface T {} - * export type T = {} - * case4: - * export default interface {} - * case5: - * interface T {} - * export {T} - */ - const RE_EXPORT_NAME: Map> = collectNonTypeMarkedReExportName(node, pagesDir); - RE_EXPORT_NAME.forEach((exportNames: Map, source: string) => { - let typeExportNames: Set = FILE_TYPE_EXPORT_NAMES.has(source) ? - FILE_TYPE_EXPORT_NAMES.get(source) : collectTypeExportNames(source); - addErrorLogIfReExportType(node, log, typeExportNames, exportNames); - }); -} diff --git a/compiler/src/process_module_syntax.ts b/compiler/src/process_module_syntax.ts new file mode 100644 index 0000000..b003c3d --- /dev/null +++ b/compiler/src/process_module_syntax.ts @@ -0,0 +1,347 @@ +/* + * 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 ts from 'typescript'; + +import { LogInfo, LogType } from './utils'; +import { IMPORT_FILE_ASTCACHE, generateSourceFileAST, getFileFullPath } from './process_import' + +const FILE_TYPE_EXPORT_NAMES: Map> = new Map(); + +interface ImportName { + name: string, + node: ts.Node, + source: string +} + +function collectNonTypeMarkedReExportName(node: ts.SourceFile, pagesDir: string): Map> { + /* those cases need be validated + * case 1: re-export + * export { externalName as localName } from './xxx' + * + * case 2: indirect re-export nameBindings + * import { externalName as localName } from './xxx' + * export [type] { localName as re-exportName } + * + * case 3: indirect re-export default + * import defaultLocalName from './xxx' + * export [type] { defaultLocalName as re-exportName } + */ + const RE_EXPORT_NAME: Map> = new Map(); + const IMPORT_AS: Map = new Map(); + const EXPORT_LOCAL: Set = new Set(); + + node.statements.forEach(stmt => { + if (ts.isImportDeclaration(stmt) && stmt.importClause && !stmt.importClause.isTypeOnly) { + let fileFullPath: string = getFileFullPath(stmt.moduleSpecifier.getText().replace(/'|"/g, ''), pagesDir); + if (fileFullPath.endsWith('.ets') || fileFullPath.endsWith('.ts')) { + const importClause: ts.ImportClause = stmt.importClause; + if (importClause.name) { + let localName: string = importClause.name.escapedText.toString(); + let importName: ImportName = {name: 'default', node: stmt, source: fileFullPath}; + IMPORT_AS.set(localName, importName); + } + if (importClause.namedBindings && ts.isNamedImports(importClause.namedBindings)) { + importClause.namedBindings.elements.forEach(elem => { + let localName: string = elem.name.escapedText.toString(); + let importName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : localName; + IMPORT_AS.set(localName, {name: importName, node: stmt, source: fileFullPath}) + }); + } + } + } + + if (ts.isExportDeclaration(stmt)) { + // TD: Check `export * from ...` when tsc supports `export type * from ...`. + if (stmt.moduleSpecifier && !stmt.isTypeOnly && stmt.exportClause && ts.isNamedExports(stmt.exportClause)) { + let fileFullPath: string = getFileFullPath(stmt.moduleSpecifier.getText().replace(/'|"/g, ''), pagesDir); + if (fileFullPath.endsWith('.ets') || fileFullPath.endsWith('.ts')) { + stmt.exportClause.elements.forEach(elem => { + let importName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : + elem.name.escapedText.toString(); + if (RE_EXPORT_NAME.has(fileFullPath)) { + RE_EXPORT_NAME.get(fileFullPath).set(importName, stmt); + } else { + RE_EXPORT_NAME.set(fileFullPath, (new Map()).set(importName, stmt)); + } + }); + } + } + if (!stmt.moduleSpecifier && stmt.exportClause && ts.isNamedExports(stmt.exportClause)) { + stmt.exportClause.elements.forEach(elem => { + let localName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : + elem.name.escapedText.toString(); + EXPORT_LOCAL.add(localName); + }); + } + } + }); + + EXPORT_LOCAL.forEach(local => { + if (IMPORT_AS.has(local)) { + let importName: ImportName = IMPORT_AS.get(local); + if (RE_EXPORT_NAME.has(importName.source)) { + RE_EXPORT_NAME.get(importName.source).set(importName.name, importName.node); + } else { + RE_EXPORT_NAME.set(importName.source, (new Map()).set(importName.name, importName.node)); + } + } + }); + + return RE_EXPORT_NAME; +} + +function processTypeImportDecl(node: ts.ImportDeclaration, localTypeNames: Set): void { + if (node.importClause && node.importClause.isTypeOnly) { + // import type T from ... + if (node.importClause.name) { + localTypeNames.add(node.importClause.name.escapedText.toString()); + } + // import type * as T from ... + if (node.importClause.namedBindings && ts.isNamespaceImport(node.importClause.namedBindings)) { + localTypeNames.add(node.importClause.namedBindings.name.escapedText.toString()); + } + // import type { e_T as T } from ... + if (node.importClause.namedBindings && ts.isNamedImports(node.importClause.namedBindings)) { + node.importClause.namedBindings.elements.forEach((elem: any) => { + localTypeNames.add(elem.name.escapedText.toString()); + }); + } + } +} + +function processExportDecl(node: ts.ExportDeclaration, typeExportNames: Set, + exportAs: Map): void { + if (node.isTypeOnly) { + if (node.moduleSpecifier && node.exportClause) { + // export type * as T from ... + if (ts.isNamespaceExport(node.exportClause)) { + typeExportNames.add(node.exportClause.name.escapedText.toString()); + } + // export type { e_T as T } from ... + if (ts.isNamedExports(node.exportClause)) { + node.exportClause.elements.forEach((elem: any) => { + typeExportNames.add(elem.name.escapedText.toString()); + }) + } + } + // export type { e_T as T } + if (!node.moduleSpecifier && node.exportClause && ts.isNamedExports(node.exportClause)) { + node.exportClause.elements.forEach((elem: any) => { + typeExportNames.add(elem.name.escapedText.toString()); + }); + } + } else { + // export { e_T as T } + if (!node.moduleSpecifier && node.exportClause && ts.isNamedExports(node.exportClause)) { + node.exportClause.elements.forEach((elem: any) => { + let exportName: string = elem.name.escapedText.toString(); + let localName: string = elem.propertyName ? elem.propertyName.escapedText.toString() : exportName; + exportAs.set(localName, exportName); + }); + } + } +} + +function processInterfaceAndTypeAlias(node: ts.InterfaceDeclaration | ts.TypeAliasDeclaration, + localTypeNames: Set, typeExportNames: Set): void { + let hasDefault: boolean = false, hasExport: boolean = false; + node.modifiers && node.modifiers.forEach(m => { + if (m.kind == ts.SyntaxKind.DefaultKeyword) { + hasDefault = true; + } + if (m.kind == ts.SyntaxKind.ExportKeyword) { + hasExport = true; + } + }); + localTypeNames.add(node.name.escapedText.toString()); + + if (hasExport) { + let exportName = hasDefault ? 'default' : node.name.escapedText.toString(); + typeExportNames.add(exportName); + } +} + +function checkTypeModuleDeclIsType(node: ts.ModuleDeclaration): boolean { + if (ts.isIdentifier(node.name) && node.body && ts.isModuleBlock(node.body)) { + for (let idx = 0; idx < node.body.statements.length; idx++) { + let stmt: ts.Statement = node.body.statements[idx]; + if (ts.isModuleDeclaration(stmt) && !checkTypeModuleDeclIsType(stmt)) { + return false; + } else if (ts.isImportEqualsDeclaration(stmt)) { + let hasExport: boolean = false; + stmt.modifiers && stmt.modifiers.forEach(m => { + if (m.kind == ts.SyntaxKind.ExportKeyword) { + hasExport = true; + } + }); + if (hasExport) { + return false; + } + } else if (!ts.isInterfaceDeclaration(stmt) && !ts.isTypeAliasDeclaration(stmt)) { + return false; + } + } + } + return true; +} + +function processNamespace(node: ts.ModuleDeclaration, localTypeNames: Set, typeExportNames: Set): void { + if (ts.isIdentifier(node.name) && node.body && ts.isModuleBlock(node.body)) { + if (!checkTypeModuleDeclIsType(node)) { + return; + } + + let hasExport: boolean = false; + node.modifiers && node.modifiers.forEach(m => { + if (m.kind == ts.SyntaxKind.ExportKeyword) { + hasExport = true; + } + }); + if (hasExport) { + typeExportNames.add(node.name.escapedText.toString()); + } + localTypeNames.add(node.name.escapedText.toString()); + } +} + +function addErrorLogIfReExportType(sourceFile: ts.SourceFile, log: LogInfo[], typeExportNames: Set, + exportNames: Map): void { + let reExportNamesArray: Array = Array.from(exportNames.keys()); + let typeExportNamesArray: Array = Array.from(typeExportNames); + const needWarningNames: Array = reExportNamesArray.filter(name => typeExportNamesArray.includes(name)); + needWarningNames.forEach(name => { + const moduleNode: ts.Node = exportNames.get(name)!; + let typeIdentifier: string = name; + if (name === 'default' && ts.isImportDeclaration(moduleNode) && moduleNode.importClause) { + typeIdentifier = moduleNode.importClause.name!.escapedText.toString(); + } + const posOfNode: ts.LineAndCharacter = sourceFile.getLineAndCharacterOfPosition(moduleNode.getStart()); + let errorMessage: string = `The re-export name '${typeIdentifier}' need to be marked as type, `; + errorMessage += ts.isImportDeclaration(moduleNode) ? "please use 'import type'." : "please use 'export type'."; + const error: LogInfo = { + type: LogType.ERROR, + message: errorMessage, + pos: moduleNode.getStart(), + fileName: sourceFile.fileName, + line: posOfNode.line + 1, + column: posOfNode.character + 1 + } + log.push(error); + }); +} + +function collectTypeExportNames(source: string): Set { + let importFileAst: ts.SourceFile; + if (IMPORT_FILE_ASTCACHE.has(source)) { + importFileAst = IMPORT_FILE_ASTCACHE.get(source); + } else { + importFileAst = generateSourceFileAST(source, source); + IMPORT_FILE_ASTCACHE[source] = importFileAst; + } + const EXPORT_AS: Map = new Map(); + const LOCAL_TYPE_NAMES: Set = new Set(); + const TYPE_EXPORT_NAMES: Set = new Set(); + importFileAst.statements.forEach(stmt => { + switch(stmt.kind) { + case ts.SyntaxKind.ImportDeclaration: { + processTypeImportDecl(stmt, LOCAL_TYPE_NAMES); + break; + } + case ts.SyntaxKind.ExportDeclaration: { + processExportDecl(stmt, TYPE_EXPORT_NAMES, EXPORT_AS); + break; + } + case ts.SyntaxKind.ExportAssignment: { + if (ts.isIdentifier((stmt).expression)) { + EXPORT_AS.set(((stmt).expression).escapedText.toString(), "default"); + } + break; + } + case ts.SyntaxKind.ModuleDeclaration: { + processNamespace(stmt, LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); + break; + } + case ts.SyntaxKind.InterfaceDeclaration: + case ts.SyntaxKind.TypeAliasDeclaration: { + processInterfaceAndTypeAlias(stmt, + LOCAL_TYPE_NAMES, TYPE_EXPORT_NAMES); + break; + } + default: + break; + } + }); + LOCAL_TYPE_NAMES.forEach(localName => { + if (EXPORT_AS.has(localName)) { + TYPE_EXPORT_NAMES.add(EXPORT_AS.get(localName)); + } + }); + FILE_TYPE_EXPORT_NAMES.set(source, TYPE_EXPORT_NAMES); + return TYPE_EXPORT_NAMES; +} + +/* + * Validate re-export names from ets/ts file whether is a type by compiling with [TranspileOnly]. + * Currently, there are three scenarios as following can not be validated correctly: + * case 1 export some specify type Identifier from one module's export * from ...: + * // A + * export { xx } from 'B' + * // B + * export * from 'C' + * // C + * export interface xx{} + * case 2 export some type Identifier from indirect .d.ts module: + * // A(ts) + * export { xx } from 'B' + * // B(.d.ts) + * export { xx } from 'C' + * // C(.d.ts) + * export interface xx {} + * case 3 export some type Identifier from '/// .d.ts' + * // A(ts) + * export { xx } from 'B' + * // B(.d.ts) + * ///C // extend B with C by using '///' + * // C(.d.ts) + * export interface xx {} + */ +export default function validateReExportType(node: ts.SourceFile, pagesDir: string, log: LogInfo[]): void { + /* + * those cases' name should be treat as Type + * case1: + * import type {T} from ... + * import type T from ... + * import type * as T from ... + * case2: + * export type {T} from ... + * export type * as T from ... + * case3: + * export interface T {} + * export type T = {} + * case4: + * export default interface {} + * case5: + * interface T {} + * export {T} + */ + const RE_EXPORT_NAME: Map> = collectNonTypeMarkedReExportName(node, pagesDir); + RE_EXPORT_NAME.forEach((exportNames: Map, source: string) => { + let typeExportNames: Set = FILE_TYPE_EXPORT_NAMES.has(source) ? + FILE_TYPE_EXPORT_NAMES.get(source) : collectTypeExportNames(source); + addErrorLogIfReExportType(node, log, typeExportNames, exportNames); + }); +} + \ No newline at end of file diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 73d859d..54a2a35 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -22,7 +22,7 @@ import { createParentParameter } from './process_component_class'; import processImport from './process_import'; -import { validateReExportType } from './process_import'; +import validateReExportType from './process_module_syntax'; import { PAGE_ENTRY_FUNCTION_NAME, PREVIEW_COMPONENT_FUNCTION_NAME, -- Gitee From 055ef02a3c2444e2c4488374e3a79b4575032450 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Fri, 23 Dec 2022 00:20:42 +0800 Subject: [PATCH 240/379] houhaoyu@huawei.com disable ts cache Signed-off-by: houhaoyu Change-Id: I06ce2b0df804b15fc6a279d630df03ea992999e2 --- compiler/main.js | 2 ++ compiler/src/compile_info.ts | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 0ce7954..a909cec 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -79,6 +79,8 @@ function initProjectConfig(projectConfig) { projectConfig.isPreview = projectConfig.isPreview || (process.env.isPreview === 'true' ? true : process.env.isPreview); projectConfig.compileMode = projectConfig.compileMode || 'jsbundle'; + projectConfig.runtimeOS = projectConfig.runtimeOS || process.env.runtimeOS || 'default'; + projectConfig.sdkInfo = projectConfig.sdkInfo || process.env.sdkInfo || 'default'; } function loadEntryObj(projectConfig) { diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 7a937e4..436ee24 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -99,6 +99,11 @@ export let cache: Cache = {}; export const shouldResolvedFiles: Set = new Set() type Cache = Record; let allModifiedFiles: Set = new Set(); +interface wholeCache { + runtimeOS: string, + sdkInfo: string, + fileList: Cache +} export class ResultStates { private mStats: Stats; @@ -234,7 +239,14 @@ export class ResultStates { languageService = createLanguageService(rootFileNames); } else { cacheFile = path.resolve(projectConfig.cachePath, '../.ts_checker_cache'); - cache = fs.existsSync(cacheFile) ? JSON.parse(fs.readFileSync(cacheFile).toString()) : {}; + let wholeCache: wholeCache = fs.existsSync(cacheFile) ? + JSON.parse(fs.readFileSync(cacheFile).toString()) : + {"runtimeOS": projectConfig.runtimeOS, "sdkInfo": projectConfig.sdkInfo, "fileList": {}}; + if (wholeCache.runtimeOS === projectConfig.runtimeOS && wholeCache.sdkInfo === projectConfig.sdkInfo) { + cache = wholeCache.fileList; + } else { + cache = {}; + } const filterFiles: string[] = filterInput(rootFileNames); languageService = createLanguageService(filterFiles); } @@ -247,7 +259,11 @@ export class ResultStates { this.printDiagnostic(diagnostic); }); if (process.env.watchMode !== 'true' && !projectConfig.xtsMode) { - fs.writeFileSync(cacheFile, JSON.stringify(cache, null, 2)); + fs.writeFileSync(cacheFile, JSON.stringify({ + "runtimeOS": projectConfig.runtimeOS, + "sdkInfo": projectConfig.sdkInfo, + "fileList": cache + }, null, 2)); } } }); -- Gitee From 3b4a971e3bf3888969b9db5646ec5594fe16e7ba Mon Sep 17 00:00:00 2001 From: hufeng Date: Sat, 24 Dec 2022 10:56:35 +0800 Subject: [PATCH 241/379] Rename as validate_module_syntax Signed-off-by: hufeng Change-Id: I6b76f29a04894583f51746b7bdfbbff5e4425a29 --- compiler/src/process_ui_syntax.ts | 2 +- .../src/{process_module_syntax.ts => validate_module_syntax.ts} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename compiler/src/{process_module_syntax.ts => validate_module_syntax.ts} (100%) diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 54a2a35..302ddf0 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -22,7 +22,7 @@ import { createParentParameter } from './process_component_class'; import processImport from './process_import'; -import validateReExportType from './process_module_syntax'; +import validateReExportType from './validate_module_syntax'; import { PAGE_ENTRY_FUNCTION_NAME, PREVIEW_COMPONENT_FUNCTION_NAME, diff --git a/compiler/src/process_module_syntax.ts b/compiler/src/validate_module_syntax.ts similarity index 100% rename from compiler/src/process_module_syntax.ts rename to compiler/src/validate_module_syntax.ts -- Gitee From 1563e1db4379f6737414da9beff0ca478a93abd8 Mon Sep 17 00:00:00 2001 From: bojiang Date: Thu, 8 Dec 2022 16:20:05 +0800 Subject: [PATCH 242/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I09e8590748922e1ea2622be6d1592d660f4c148e --- compiler/src/compile_info.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index bf5a504..df6a2af 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -131,6 +131,21 @@ export class ResultStates { } ); + compilation.hooks.succeedModule.tap('findModule', (module) => { + if (module && module.error) { + const errorLog: string = module.error.toString(); + if (module.resourceResolveData && module.resourceResolveData.path && + /Module parse failed/.test(errorLog) && /Invalid regular expression:/.test(errorLog)) { + this.mErrorCount++; + const errorInfos: string[] = errorLog.split('\n>')[1].split(';'); + if (errorInfos && errorInfos.length > 0 && errorInfos[0]) { + const errorInformation: string = `ERROR in ${module.resourceResolveData.path}\n The following syntax is incorrect.\n > ${errorInfos[0]}`; + this.printErrorMessage(parseErrorMessage(errorInformation), false, module.error); + } + } + } + }); + compilation.hooks.buildModule.tap('findModule', (module) => { if (module.context) { if (module.context.indexOf(projectConfig.projectPath) >= 0) { -- Gitee From 967d1ff26678e7ec89b337f182e29bcbc117c77f Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 27 Dec 2022 12:13:43 +0800 Subject: [PATCH 243/379] houhaoyu@huawei.com fix ut Signed-off-by: houhaoyu Change-Id: I20d6e099a709cc38db8fe16e9067d906165cd30a --- compiler/src/validate_ui_syntax.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 14b1b4d..a0d5dc6 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -149,7 +149,7 @@ export function validateUISyntax(source: string, content: string, filePath: stri fileQuery: string): LogInfo[] { let log: LogInfo[] = []; if (process.env.compileMode === 'moduleJson' || - path.resolve(filePath) !== path.resolve(projectConfig.projectPath, 'app.ets')) { + path.resolve(filePath) !== path.resolve(projectConfig.projectPath || '', 'app.ets')) { const res: LogInfo[] = checkComponentDecorator(source, filePath, fileQuery); if (res) { log = log.concat(res); -- Gitee From 95a6e58748c022a40f68f2c445cfa828a6403234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E6=9D=B0?= Date: Tue, 27 Dec 2022 11:44:50 +0800 Subject: [PATCH 244/379] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsearch=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84oncut,oncopy,onpaste=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E6=97=A0=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 余杰 --- compiler/codegen/codegen_ets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/codegen/codegen_ets.js b/compiler/codegen/codegen_ets.js index 7300ef2..e7d4dfc 100644 --- a/compiler/codegen/codegen_ets.js +++ b/compiler/codegen/codegen_ets.js @@ -12,4 +12,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(()=>{var e={6486:function(e,t,r){var o;e=r.nmd(e),function(){var n,a="Expected a function",i="__lodash_hash_undefined__",s="__lodash_placeholder__",p=32,l=128,c=1/0,u=9007199254740991,y=NaN,d=4294967295,f=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",p],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",h="[object Boolean]",E="[object Date]",T="[object Error]",S="[object Function]",P="[object GeneratorFunction]",v="[object Map]",b="[object Number]",_="[object Object]",N="[object Promise]",C="[object RegExp]",A="[object Set]",O="[object String]",M="[object Symbol]",w="[object WeakMap]",R="[object ArrayBuffer]",I="[object DataView]",x="[object Float32Array]",L="[object Float64Array]",F="[object Int8Array]",k="[object Int16Array]",B="[object Int32Array]",D="[object Uint8Array]",U="[object Uint8ClampedArray]",V="[object Uint16Array]",G="[object Uint32Array]",z=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,H=RegExp($.source),Y=RegExp(q.source),X=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),oe=/^\s+/,ne=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,pe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ye=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,he=/^(?:0|[1-9]\d*)$/,Ee=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Te=/($^)/,Se=/['\n\r\u2028\u2029\\]/g,Pe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ve="a-z\\xdf-\\xf6\\xf8-\\xff",be="A-Z\\xc0-\\xd6\\xd8-\\xde",_e="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ne="["+_e+"]",Ce="["+Pe+"]",Ae="\\d+",Oe="["+ve+"]",Me="[^\\ud800-\\udfff"+_e+Ae+"\\u2700-\\u27bf"+ve+be+"]",we="\\ud83c[\\udffb-\\udfff]",Re="[^\\ud800-\\udfff]",Ie="(?:\\ud83c[\\udde6-\\uddff]){2}",xe="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+be+"]",Fe="(?:"+Oe+"|"+Me+")",ke="(?:"+Le+"|"+Me+")",Be="(?:['’](?:d|ll|m|re|s|t|ve))?",De="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ue="(?:"+Ce+"|"+we+")?",Ve="[\\ufe0e\\ufe0f]?",Ge=Ve+Ue+"(?:\\u200d(?:"+[Re,Ie,xe].join("|")+")"+Ve+Ue+")*",ze="(?:"+["[\\u2700-\\u27bf]",Ie,xe].join("|")+")"+Ge,je="(?:"+[Re+Ce+"?",Ce,Ie,xe,"[\\ud800-\\udfff]"].join("|")+")",We=RegExp("['’]","g"),$e=RegExp(Ce,"g"),qe=RegExp(we+"(?="+we+")|"+je+Ge,"g"),He=RegExp([Le+"?"+Oe+"+"+Be+"(?="+[Ne,Le,"$"].join("|")+")",ke+"+"+De+"(?="+[Ne,Le+Fe,"$"].join("|")+")",Le+"?"+Fe+"+"+Be,Le+"+"+De,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,ze].join("|"),"g"),Ye=RegExp("[\\u200d\\ud800-\\udfff"+Pe+"\\ufe0e\\ufe0f]"),Xe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Je=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Qe=-1,Ke={};Ke[x]=Ke[L]=Ke[F]=Ke[k]=Ke[B]=Ke[D]=Ke[U]=Ke[V]=Ke[G]=!0,Ke[m]=Ke[g]=Ke[R]=Ke[h]=Ke[I]=Ke[E]=Ke[T]=Ke[S]=Ke[v]=Ke[b]=Ke[_]=Ke[C]=Ke[A]=Ke[O]=Ke[w]=!1;var Ze={};Ze[m]=Ze[g]=Ze[R]=Ze[I]=Ze[h]=Ze[E]=Ze[x]=Ze[L]=Ze[F]=Ze[k]=Ze[B]=Ze[v]=Ze[b]=Ze[_]=Ze[C]=Ze[A]=Ze[O]=Ze[M]=Ze[D]=Ze[U]=Ze[V]=Ze[G]=!0,Ze[T]=Ze[S]=Ze[w]=!1;var et={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tt=parseFloat,rt=parseInt,ot="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,nt="object"==typeof self&&self&&self.Object===Object&&self,at=ot||nt||Function("return this")(),it=t&&!t.nodeType&&t,st=it&&e&&!e.nodeType&&e,pt=st&&st.exports===it,lt=pt&&ot.process,ct=function(){try{return st&&st.require&&st.require("util").types||lt&<.binding&<.binding("util")}catch(e){}}(),ut=ct&&ct.isArrayBuffer,yt=ct&&ct.isDate,dt=ct&&ct.isMap,ft=ct&&ct.isRegExp,mt=ct&&ct.isSet,gt=ct&&ct.isTypedArray;function ht(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Et(e,t,r,o){for(var n=-1,a=null==e?0:e.length;++n-1}function _t(e,t,r){for(var o=-1,n=null==e?0:e.length;++o-1;);return r}function Ht(e,t){for(var r=e.length;r--&&xt(t,e[r],0)>-1;);return r}function Yt(e,t){for(var r=e.length,o=0;r--;)e[r]===t&&++o;return o}var Xt=Dt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Jt=Dt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Qt(e){return"\\"+et[e]}function Kt(e){return Ye.test(e)}function Zt(e){var t=-1,r=Array(e.size);return e.forEach((function(e,o){r[++t]=[o,e]})),r}function er(e,t){return function(r){return e(t(r))}}function tr(e,t){for(var r=-1,o=e.length,n=0,a=[];++r",""":'"',"'":"'"}),pr=function e(t){var r,o=(t=null==t?at:pr.defaults(at.Object(),t,pr.pick(at,Je))).Array,ne=t.Date,Pe=t.Error,ve=t.Function,be=t.Math,_e=t.Object,Ne=t.RegExp,Ce=t.String,Ae=t.TypeError,Oe=o.prototype,Me=ve.prototype,we=_e.prototype,Re=t["__core-js_shared__"],Ie=Me.toString,xe=we.hasOwnProperty,Le=0,Fe=(r=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",ke=we.toString,Be=Ie.call(_e),De=at._,Ue=Ne("^"+Ie.call(xe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=pt?t.Buffer:n,Ge=t.Symbol,ze=t.Uint8Array,je=Ve?Ve.allocUnsafe:n,qe=er(_e.getPrototypeOf,_e),Ye=_e.create,et=we.propertyIsEnumerable,ot=Oe.splice,nt=Ge?Ge.isConcatSpreadable:n,it=Ge?Ge.iterator:n,st=Ge?Ge.toStringTag:n,lt=function(){try{var e=ca(_e,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==at.clearTimeout&&t.clearTimeout,wt=ne&&ne.now!==at.Date.now&&ne.now,Dt=t.setTimeout!==at.setTimeout&&t.setTimeout,lr=be.ceil,cr=be.floor,ur=_e.getOwnPropertySymbols,yr=Ve?Ve.isBuffer:n,dr=t.isFinite,fr=Oe.join,mr=er(_e.keys,_e),gr=be.max,hr=be.min,Er=ne.now,Tr=t.parseInt,Sr=be.random,Pr=Oe.reverse,vr=ca(t,"DataView"),br=ca(t,"Map"),_r=ca(t,"Promise"),Nr=ca(t,"Set"),Cr=ca(t,"WeakMap"),Ar=ca(_e,"create"),Or=Cr&&new Cr,Mr={},wr=Ua(vr),Rr=Ua(br),Ir=Ua(_r),xr=Ua(Nr),Lr=Ua(Cr),Fr=Ge?Ge.prototype:n,kr=Fr?Fr.valueOf:n,Br=Fr?Fr.toString:n;function Dr(e){if(rs(e)&&!$i(e)&&!(e instanceof zr)){if(e instanceof Gr)return e;if(xe.call(e,"__wrapped__"))return Va(e)}return new Gr(e)}var Ur=function(){function e(){}return function(t){if(!ts(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Vr(){}function Gr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function zr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function jr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function io(e,t,r,o,a,i){var s,p=1&t,l=2&t,c=4&t;if(r&&(s=a?r(e,o,a,i):r(e)),s!==n)return s;if(!ts(e))return e;var u=$i(e);if(u){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&xe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!p)return On(e,s)}else{var y=da(e),d=y==S||y==P;if(Xi(e))return vn(e,p);if(y==_||y==m||d&&!a){if(s=l||d?{}:ma(e),!p)return l?function(e,t){return Mn(e,ya(e),t)}(e,function(e,t){return e&&Mn(t,xs(t),e)}(s,e)):function(e,t){return Mn(e,ua(e),t)}(e,ro(s,e))}else{if(!Ze[y])return a?e:{};s=function(e,t,r){var o,n=e.constructor;switch(t){case R:return bn(e);case h:case E:return new n(+e);case I:return function(e,t){var r=t?bn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case x:case L:case F:case k:case B:case D:case U:case V:case G:return _n(e,r);case v:return new n;case b:case O:return new n(e);case C:return function(e){var t=new e.constructor(e.source,ye.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new n;case M:return o=e,kr?_e(kr.call(o)):{}}}(e,y,p)}}i||(i=new Hr);var f=i.get(e);if(f)return f;i.set(e,s),ss(e)?e.forEach((function(o){s.add(io(o,t,r,o,e,i))})):os(e)&&e.forEach((function(o,n){s.set(n,io(o,t,r,n,e,i))}));var g=u?n:(c?l?oa:ra:l?xs:Is)(e);return Tt(g||e,(function(o,n){g&&(o=e[n=o]),Zr(s,n,io(o,t,r,n,e,i))})),s}function so(e,t,r){var o=r.length;if(null==e)return!o;for(e=_e(e);o--;){var a=r[o],i=t[a],s=e[a];if(s===n&&!(a in e)||!i(s))return!1}return!0}function po(e,t,r){if("function"!=typeof e)throw new Ae(a);return wa((function(){e.apply(n,r)}),t)}function lo(e,t,r,o){var n=-1,a=bt,i=!0,s=e.length,p=[],l=t.length;if(!s)return p;r&&(t=Nt(t,jt(r))),o?(a=_t,i=!1):t.length>=200&&(a=$t,i=!1,t=new qr(t));e:for(;++n-1},Wr.prototype.set=function(e,t){var r=this.__data__,o=eo(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new jr,map:new(br||Wr),string:new jr}},$r.prototype.delete=function(e){var t=pa(this,e).delete(e);return this.size-=t?1:0,t},$r.prototype.get=function(e){return pa(this,e).get(e)},$r.prototype.has=function(e){return pa(this,e).has(e)},$r.prototype.set=function(e,t){var r=pa(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this},qr.prototype.add=qr.prototype.push=function(e){return this.__data__.set(e,i),this},qr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Hr.prototype.get=function(e){return this.__data__.get(e)},Hr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var o=r.__data__;if(!br||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new $r(o)}return r.set(e,t),this.size=r.size,this};var co=In(To),uo=In(So,!0);function yo(e,t){var r=!0;return co(e,(function(e,o,n){return r=!!t(e,o,n)})),r}function fo(e,t,r){for(var o=-1,a=e.length;++o0&&r(s)?t>1?go(s,t-1,r,o,n):Ct(n,s):o||(n[n.length]=s)}return n}var ho=xn(),Eo=xn(!0);function To(e,t){return e&&ho(e,t,Is)}function So(e,t){return e&&Eo(e,t,Is)}function Po(e,t){return vt(t,(function(t){return Ki(e[t])}))}function vo(e,t){for(var r=0,o=(t=En(t,e)).length;null!=e&&rt}function Co(e,t){return null!=e&&xe.call(e,t)}function Ao(e,t){return null!=e&&t in _e(e)}function Oo(e,t,r){for(var a=r?_t:bt,i=e[0].length,s=e.length,p=s,l=o(s),c=1/0,u=[];p--;){var y=e[p];p&&t&&(y=Nt(y,jt(t))),c=hr(y.length,c),l[p]=!r&&(t||i>=120&&y.length>=120)?new qr(p&&y):n}y=e[0];var d=-1,f=l[0];e:for(;++d=s?p:p*("desc"==r[o]?-1:1)}return e.index-t.index}(e,t,r)}));o--;)e[o]=e[o].value;return e}(n)}function jo(e,t,r){for(var o=-1,n=t.length,a={};++o-1;)s!==e&&ot.call(s,p,1),ot.call(e,p,1);return e}function $o(e,t){for(var r=e?t.length:0,o=r-1;r--;){var n=t[r];if(r==o||n!==a){var a=n;ha(n)?ot.call(e,n,1):cn(e,n)}}return e}function qo(e,t){return e+cr(Sr()*(t-e+1))}function Ho(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=cr(t/2))&&(e+=e)}while(t);return r}function Yo(e,t){return Ra(Na(e,t,np),e+"")}function Xo(e){return Xr(Gs(e))}function Jo(e,t){var r=Gs(e);return La(r,ao(t,0,r.length))}function Qo(e,t,r,o){if(!ts(e))return e;for(var a=-1,i=(t=En(t,e)).length,s=i-1,p=e;null!=p&&++aa?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=o(a);++n>>1,i=e[a];null!==i&&!ls(i)&&(r?i<=t:i=200){var l=t?null:Yn(e);if(l)return rr(l);i=!1,n=$t,p=new qr}else p=t?[]:s;e:for(;++o=o?e:tn(e,t,r)}var Pn=ct||function(e){return at.clearTimeout(e)};function vn(e,t){if(t)return e.slice();var r=e.length,o=je?je(r):new e.constructor(r);return e.copy(o),o}function bn(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function _n(e,t){var r=t?bn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Nn(e,t){if(e!==t){var r=e!==n,o=null===e,a=e==e,i=ls(e),s=t!==n,p=null===t,l=t==t,c=ls(t);if(!p&&!c&&!i&&e>t||i&&s&&l&&!p&&!c||o&&s&&l||!r&&l||!a)return 1;if(!o&&!i&&!c&&e1?r[a-1]:n,s=a>2?r[2]:n;for(i=e.length>3&&"function"==typeof i?(a--,i):n,s&&Ea(r[0],r[1],s)&&(i=a<3?n:i,a=1),t=_e(t);++o-1?a[i?t[s]:s]:n}}function Dn(e){return ta((function(t){var r=t.length,o=r,i=Gr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ae(a);if(i&&!p&&"wrapper"==aa(s))var p=new Gr([],!0)}for(o=p?o:r;++o1&&T.reverse(),d&&up))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var y=-1,d=!0,f=2&r?new qr:n;for(i.set(e,t),i.set(t,e);++y-1&&e%1==0&&e1?"& ":"")+t[o],t=t.join(r>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(o,function(e,t){return Tt(f,(function(r){var o="_."+r[0];t&r[1]&&!bt(e,o)&&e.push(o)})),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(se):[]}(o),r)))}function xa(e){var t=0,r=0;return function(){var o=Er(),a=16-(o-r);if(r=o,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function La(e,t){var r=-1,o=e.length,a=o-1;for(t=t===n?o:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ii(e,r)}));function di(e){var t=Dr(e);return t.__chain__=!0,t}function fi(e,t){return t(e)}var mi=ta((function(e){var t=e.length,r=t?e[0]:0,o=this.__wrapped__,a=function(t){return no(t,e)};return!(t>1||this.__actions__.length)&&o instanceof zr&&ha(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:fi,args:[a],thisArg:n}),new Gr(o,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(a)})),gi=wn((function(e,t,r){xe.call(e,r)?++e[r]:oo(e,r,1)})),hi=Bn(Wa),Ei=Bn($a);function Ti(e,t){return($i(e)?Tt:co)(e,sa(t,3))}function Si(e,t){return($i(e)?St:uo)(e,sa(t,3))}var Pi=wn((function(e,t,r){xe.call(e,r)?e[r].push(t):oo(e,r,[t])})),vi=Yo((function(e,t,r){var n=-1,a="function"==typeof t,i=Hi(e)?o(e.length):[];return co(e,(function(e){i[++n]=a?ht(t,e,r):Mo(e,t,r)})),i})),bi=wn((function(e,t,r){oo(e,r,t)}));function _i(e,t){return($i(e)?Nt:Bo)(e,sa(t,3))}var Ni=wn((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Ci=Yo((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ea(e,t[0],t[1])?t=[]:r>2&&Ea(t[0],t[1],t[2])&&(t=[t[0]]),zo(e,go(t,1),[])})),Ai=wt||function(){return at.Date.now()};function Oi(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Jn(e,l,n,n,n,n,t)}function Mi(e,t){var r;if("function"!=typeof t)throw new Ae(a);return e=ms(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var wi=Yo((function(e,t,r){var o=1;if(r.length){var n=tr(r,ia(wi));o|=p}return Jn(e,o,t,r,n)})),Ri=Yo((function(e,t,r){var o=3;if(r.length){var n=tr(r,ia(Ri));o|=p}return Jn(t,o,e,r,n)}));function Ii(e,t,r){var o,i,s,p,l,c,u=0,y=!1,d=!1,f=!0;if("function"!=typeof e)throw new Ae(a);function m(t){var r=o,a=i;return o=i=n,u=t,p=e.apply(a,r)}function g(e){return u=e,l=wa(E,t),y?m(e):p}function h(e){var r=e-c;return c===n||r>=t||r<0||d&&e-u>=s}function E(){var e=Ai();if(h(e))return T(e);l=wa(E,function(e){var r=t-(e-c);return d?hr(r,s-(e-u)):r}(e))}function T(e){return l=n,f&&o?m(e):(o=i=n,p)}function S(){var e=Ai(),r=h(e);if(o=arguments,i=this,c=e,r){if(l===n)return g(c);if(d)return Pn(l),l=wa(E,t),m(c)}return l===n&&(l=wa(E,t)),p}return t=hs(t)||0,ts(r)&&(y=!!r.leading,s=(d="maxWait"in r)?gr(hs(r.maxWait)||0,t):s,f="trailing"in r?!!r.trailing:f),S.cancel=function(){l!==n&&Pn(l),u=0,o=c=i=l=n},S.flush=function(){return l===n?p:T(Ai())},S}var xi=Yo((function(e,t){return po(e,1,t)})),Li=Yo((function(e,t,r){return po(e,hs(t)||0,r)}));function Fi(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ae(a);var r=function(){var o=arguments,n=t?t.apply(this,o):o[0],a=r.cache;if(a.has(n))return a.get(n);var i=e.apply(this,o);return r.cache=a.set(n,i)||a,i};return r.cache=new(Fi.Cache||$r),r}function ki(e){if("function"!=typeof e)throw new Ae(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Fi.Cache=$r;var Bi=Tn((function(e,t){var r=(t=1==t.length&&$i(t[0])?Nt(t[0],jt(sa())):Nt(go(t,1),jt(sa()))).length;return Yo((function(o){for(var n=-1,a=hr(o.length,r);++n=t})),Wi=wo(function(){return arguments}())?wo:function(e){return rs(e)&&xe.call(e,"callee")&&!et.call(e,"callee")},$i=o.isArray,qi=ut?jt(ut):function(e){return rs(e)&&_o(e)==R};function Hi(e){return null!=e&&es(e.length)&&!Ki(e)}function Yi(e){return rs(e)&&Hi(e)}var Xi=yr||hp,Ji=yt?jt(yt):function(e){return rs(e)&&_o(e)==E};function Qi(e){if(!rs(e))return!1;var t=_o(e);return t==T||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function Ki(e){if(!ts(e))return!1;var t=_o(e);return t==S||t==P||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zi(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var os=dt?jt(dt):function(e){return rs(e)&&da(e)==v};function ns(e){return"number"==typeof e||rs(e)&&_o(e)==b}function as(e){if(!rs(e)||_o(e)!=_)return!1;var t=qe(e);if(null===t)return!0;var r=xe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Ie.call(r)==Be}var is=ft?jt(ft):function(e){return rs(e)&&_o(e)==C},ss=mt?jt(mt):function(e){return rs(e)&&da(e)==A};function ps(e){return"string"==typeof e||!$i(e)&&rs(e)&&_o(e)==O}function ls(e){return"symbol"==typeof e||rs(e)&&_o(e)==M}var cs=gt?jt(gt):function(e){return rs(e)&&es(e.length)&&!!Ke[_o(e)]},us=$n(ko),ys=$n((function(e,t){return e<=t}));function ds(e){if(!e)return[];if(Hi(e))return ps(e)?ar(e):On(e);if(it&&e[it])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[it]());var t=da(e);return(t==v?Zt:t==A?rr:Gs)(e)}function fs(e){return e?(e=hs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=fs(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?ao(ms(e),0,d):0}function hs(e){if("number"==typeof e)return e;if(ls(e))return y;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=zt(e);var r=fe.test(e);return r||ge.test(e)?rt(e.slice(2),r?2:8):de.test(e)?y:+e}function Es(e){return Mn(e,xs(e))}function Ts(e){return null==e?"":pn(e)}var Ss=Rn((function(e,t){if(va(t)||Hi(t))Mn(t,Is(t),e);else for(var r in t)xe.call(t,r)&&Zr(e,r,t[r])})),Ps=Rn((function(e,t){Mn(t,xs(t),e)})),vs=Rn((function(e,t,r,o){Mn(t,xs(t),e,o)})),bs=Rn((function(e,t,r,o){Mn(t,Is(t),e,o)})),_s=ta(no),Ns=Yo((function(e,t){e=_e(e);var r=-1,o=t.length,a=o>2?t[2]:n;for(a&&Ea(t[0],t[1],a)&&(o=1);++r1),t})),Mn(e,oa(e),r),o&&(r=io(r,7,Zn));for(var n=t.length;n--;)cn(r,t[n]);return r})),Bs=ta((function(e,t){return null==e?{}:function(e,t){return jo(e,t,(function(t,r){return Os(e,r)}))}(e,t)}));function Ds(e,t){if(null==e)return{};var r=Nt(oa(e),(function(e){return[e]}));return t=sa(t),jo(e,r,(function(e,r){return t(e,r[0])}))}var Us=Xn(Is),Vs=Xn(xs);function Gs(e){return null==e?[]:Wt(e,Is(e))}var zs=Fn((function(e,t,r){return t=t.toLowerCase(),e+(r?js(t):t)}));function js(e){return Qs(Ts(e).toLowerCase())}function Ws(e){return(e=Ts(e))&&e.replace(Ee,Xt).replace($e,"")}var $s=Fn((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),qs=Fn((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Hs=Ln("toLowerCase"),Ys=Fn((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Xs=Fn((function(e,t,r){return e+(r?" ":"")+Qs(t)})),Js=Fn((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Qs=Ln("toUpperCase");function Ks(e,t,r){return e=Ts(e),(t=r?n:t)===n?function(e){return Xe.test(e)}(e)?function(e){return e.match(He)||[]}(e):function(e){return e.match(pe)||[]}(e):e.match(t)||[]}var Zs=Yo((function(e,t){try{return ht(e,n,t)}catch(e){return Qi(e)?e:new Pe(e)}})),ep=ta((function(e,t){return Tt(t,(function(t){t=Da(t),oo(e,t,wi(e[t],e))})),e}));function tp(e){return function(){return e}}var rp=Dn(),op=Dn(!0);function np(e){return e}function ap(e){return Lo("function"==typeof e?e:io(e,1))}var ip=Yo((function(e,t){return function(r){return Mo(r,e,t)}})),sp=Yo((function(e,t){return function(r){return Mo(e,r,t)}}));function pp(e,t,r){var o=Is(t),n=Po(t,o);null!=r||ts(t)&&(n.length||!o.length)||(r=t,t=e,e=this,n=Po(t,Is(t)));var a=!(ts(r)&&"chain"in r&&!r.chain),i=Ki(e);return Tt(n,(function(r){var o=t[r];e[r]=o,i&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__),n=r.__actions__=On(this.__actions__);return n.push({func:o,args:arguments,thisArg:e}),r.__chain__=t,r}return o.apply(e,Ct([this.value()],arguments))})})),e}function lp(){}var cp=zn(Nt),up=zn(Pt),yp=zn(Mt);function dp(e){return Ta(e)?Bt(Da(e)):function(e){return function(t){return vo(t,e)}}(e)}var fp=Wn(),mp=Wn(!0);function gp(){return[]}function hp(){return!1}var Ep,Tp=Gn((function(e,t){return e+t}),0),Sp=Hn("ceil"),Pp=Gn((function(e,t){return e/t}),1),vp=Hn("floor"),bp=Gn((function(e,t){return e*t}),1),_p=Hn("round"),Np=Gn((function(e,t){return e-t}),0);return Dr.after=function(e,t){if("function"!=typeof t)throw new Ae(a);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},Dr.ary=Oi,Dr.assign=Ss,Dr.assignIn=Ps,Dr.assignInWith=vs,Dr.assignWith=bs,Dr.at=_s,Dr.before=Mi,Dr.bind=wi,Dr.bindAll=ep,Dr.bindKey=Ri,Dr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $i(e)?e:[e]},Dr.chain=di,Dr.chunk=function(e,t,r){t=(r?Ea(e,t,r):t===n)?1:gr(ms(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var i=0,s=0,p=o(lr(a/t));ia?0:a+r),(o=o===n||o>a?a:ms(o))<0&&(o+=a),o=r>o?0:gs(o);r>>0)?(e=Ts(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=pn(t))&&Kt(e)?Sn(ar(e),0,r):e.split(t,r):[]},Dr.spread=function(e,t){if("function"!=typeof e)throw new Ae(a);return t=null==t?0:gr(ms(t),0),Yo((function(r){var o=r[t],n=Sn(r,0,t);return o&&Ct(n,o),ht(e,this,n)}))},Dr.tail=function(e){var t=null==e?0:e.length;return t?tn(e,1,t):[]},Dr.take=function(e,t,r){return e&&e.length?tn(e,0,(t=r||t===n?1:ms(t))<0?0:t):[]},Dr.takeRight=function(e,t,r){var o=null==e?0:e.length;return o?tn(e,(t=o-(t=r||t===n?1:ms(t)))<0?0:t,o):[]},Dr.takeRightWhile=function(e,t){return e&&e.length?yn(e,sa(t,3),!1,!0):[]},Dr.takeWhile=function(e,t){return e&&e.length?yn(e,sa(t,3)):[]},Dr.tap=function(e,t){return t(e),e},Dr.throttle=function(e,t,r){var o=!0,n=!0;if("function"!=typeof e)throw new Ae(a);return ts(r)&&(o="leading"in r?!!r.leading:o,n="trailing"in r?!!r.trailing:n),Ii(e,t,{leading:o,maxWait:t,trailing:n})},Dr.thru=fi,Dr.toArray=ds,Dr.toPairs=Us,Dr.toPairsIn=Vs,Dr.toPath=function(e){return $i(e)?Nt(e,Da):ls(e)?[e]:On(Ba(Ts(e)))},Dr.toPlainObject=Es,Dr.transform=function(e,t,r){var o=$i(e),n=o||Xi(e)||cs(e);if(t=sa(t,4),null==r){var a=e&&e.constructor;r=n?o?new a:[]:ts(e)&&Ki(a)?Ur(qe(e)):{}}return(n?Tt:To)(e,(function(e,o,n){return t(r,e,o,n)})),r},Dr.unary=function(e){return Oi(e,1)},Dr.union=ri,Dr.unionBy=oi,Dr.unionWith=ni,Dr.uniq=function(e){return e&&e.length?ln(e):[]},Dr.uniqBy=function(e,t){return e&&e.length?ln(e,sa(t,2)):[]},Dr.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ln(e,n,t):[]},Dr.unset=function(e,t){return null==e||cn(e,t)},Dr.unzip=ai,Dr.unzipWith=ii,Dr.update=function(e,t,r){return null==e?e:un(e,t,hn(r))},Dr.updateWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:un(e,t,hn(r),o)},Dr.values=Gs,Dr.valuesIn=function(e){return null==e?[]:Wt(e,xs(e))},Dr.without=si,Dr.words=Ks,Dr.wrap=function(e,t){return Di(hn(t),e)},Dr.xor=pi,Dr.xorBy=li,Dr.xorWith=ci,Dr.zip=ui,Dr.zipObject=function(e,t){return mn(e||[],t||[],Zr)},Dr.zipObjectDeep=function(e,t){return mn(e||[],t||[],Qo)},Dr.zipWith=yi,Dr.entries=Us,Dr.entriesIn=Vs,Dr.extend=Ps,Dr.extendWith=vs,pp(Dr,Dr),Dr.add=Tp,Dr.attempt=Zs,Dr.camelCase=zs,Dr.capitalize=js,Dr.ceil=Sp,Dr.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=hs(r))==r?r:0),t!==n&&(t=(t=hs(t))==t?t:0),ao(hs(e),t,r)},Dr.clone=function(e){return io(e,4)},Dr.cloneDeep=function(e){return io(e,5)},Dr.cloneDeepWith=function(e,t){return io(e,5,t="function"==typeof t?t:n)},Dr.cloneWith=function(e,t){return io(e,4,t="function"==typeof t?t:n)},Dr.conformsTo=function(e,t){return null==t||so(e,t,Is(t))},Dr.deburr=Ws,Dr.defaultTo=function(e,t){return null==e||e!=e?t:e},Dr.divide=Pp,Dr.endsWith=function(e,t,r){e=Ts(e),t=pn(t);var o=e.length,a=r=r===n?o:ao(ms(r),0,o);return(r-=t.length)>=0&&e.slice(r,a)==t},Dr.eq=Gi,Dr.escape=function(e){return(e=Ts(e))&&Y.test(e)?e.replace(q,Jt):e},Dr.escapeRegExp=function(e){return(e=Ts(e))&&re.test(e)?e.replace(te,"\\$&"):e},Dr.every=function(e,t,r){var o=$i(e)?Pt:yo;return r&&Ea(e,t,r)&&(t=n),o(e,sa(t,3))},Dr.find=hi,Dr.findIndex=Wa,Dr.findKey=function(e,t){return Rt(e,sa(t,3),To)},Dr.findLast=Ei,Dr.findLastIndex=$a,Dr.findLastKey=function(e,t){return Rt(e,sa(t,3),So)},Dr.floor=vp,Dr.forEach=Ti,Dr.forEachRight=Si,Dr.forIn=function(e,t){return null==e?e:ho(e,sa(t,3),xs)},Dr.forInRight=function(e,t){return null==e?e:Eo(e,sa(t,3),xs)},Dr.forOwn=function(e,t){return e&&To(e,sa(t,3))},Dr.forOwnRight=function(e,t){return e&&So(e,sa(t,3))},Dr.get=As,Dr.gt=zi,Dr.gte=ji,Dr.has=function(e,t){return null!=e&&fa(e,t,Co)},Dr.hasIn=Os,Dr.head=Ha,Dr.identity=np,Dr.includes=function(e,t,r,o){e=Hi(e)?e:Gs(e),r=r&&!o?ms(r):0;var n=e.length;return r<0&&(r=gr(n+r,0)),ps(e)?r<=n&&e.indexOf(t,r)>-1:!!n&&xt(e,t,r)>-1},Dr.indexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var n=null==r?0:ms(r);return n<0&&(n=gr(o+n,0)),xt(e,t,n)},Dr.inRange=function(e,t,r){return t=fs(t),r===n?(r=t,t=0):r=fs(r),function(e,t,r){return e>=hr(t,r)&&e=-9007199254740991&&e<=u},Dr.isSet=ss,Dr.isString=ps,Dr.isSymbol=ls,Dr.isTypedArray=cs,Dr.isUndefined=function(e){return e===n},Dr.isWeakMap=function(e){return rs(e)&&da(e)==w},Dr.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==_o(e)},Dr.join=function(e,t){return null==e?"":fr.call(e,t)},Dr.kebabCase=$s,Dr.last=Qa,Dr.lastIndexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var a=o;return r!==n&&(a=(a=ms(r))<0?gr(o+a,0):hr(a,o-1)),t==t?function(e,t,r){for(var o=r+1;o--;)if(e[o]===t)return o;return o}(e,t,a):It(e,Ft,a,!0)},Dr.lowerCase=qs,Dr.lowerFirst=Hs,Dr.lt=us,Dr.lte=ys,Dr.max=function(e){return e&&e.length?fo(e,np,No):n},Dr.maxBy=function(e,t){return e&&e.length?fo(e,sa(t,2),No):n},Dr.mean=function(e){return kt(e,np)},Dr.meanBy=function(e,t){return kt(e,sa(t,2))},Dr.min=function(e){return e&&e.length?fo(e,np,ko):n},Dr.minBy=function(e,t){return e&&e.length?fo(e,sa(t,2),ko):n},Dr.stubArray=gp,Dr.stubFalse=hp,Dr.stubObject=function(){return{}},Dr.stubString=function(){return""},Dr.stubTrue=function(){return!0},Dr.multiply=bp,Dr.nth=function(e,t){return e&&e.length?Go(e,ms(t)):n},Dr.noConflict=function(){return at._===this&&(at._=De),this},Dr.noop=lp,Dr.now=Ai,Dr.pad=function(e,t,r){e=Ts(e);var o=(t=ms(t))?nr(e):0;if(!t||o>=t)return e;var n=(t-o)/2;return jn(cr(n),r)+e+jn(lr(n),r)},Dr.padEnd=function(e,t,r){e=Ts(e);var o=(t=ms(t))?nr(e):0;return t&&ot){var o=e;e=t,t=o}if(r||e%1||t%1){var a=Sr();return hr(e+a*(t-e+tt("1e-"+((a+"").length-1))),t)}return qo(e,t)},Dr.reduce=function(e,t,r){var o=$i(e)?At:Ut,n=arguments.length<3;return o(e,sa(t,4),r,n,co)},Dr.reduceRight=function(e,t,r){var o=$i(e)?Ot:Ut,n=arguments.length<3;return o(e,sa(t,4),r,n,uo)},Dr.repeat=function(e,t,r){return t=(r?Ea(e,t,r):t===n)?1:ms(t),Ho(Ts(e),t)},Dr.replace=function(){var e=arguments,t=Ts(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dr.result=function(e,t,r){var o=-1,a=(t=En(t,e)).length;for(a||(a=1,e=n);++ou)return[];var r=d,o=hr(e,d);t=sa(t),e-=d;for(var n=Gt(o,t);++r=i)return e;var p=r-nr(o);if(p<1)return o;var l=s?Sn(s,0,p).join(""):e.slice(0,p);if(a===n)return l+o;if(s&&(p+=l.length-p),is(a)){if(e.slice(p).search(a)){var c,u=l;for(a.global||(a=Ne(a.source,Ts(ye.exec(a))+"g")),a.lastIndex=0;c=a.exec(u);)var y=c.index;l=l.slice(0,y===n?p:y)}}else if(e.indexOf(pn(a),p)!=p){var d=l.lastIndexOf(a);d>-1&&(l=l.slice(0,d))}return l+o},Dr.unescape=function(e){return(e=Ts(e))&&H.test(e)?e.replace($,sr):e},Dr.uniqueId=function(e){var t=++Le;return Ts(e)+t},Dr.upperCase=Js,Dr.upperFirst=Qs,Dr.each=Ti,Dr.eachRight=Si,Dr.first=Ha,pp(Dr,(Ep={},To(Dr,(function(e,t){xe.call(Dr.prototype,t)||(Ep[t]=e)})),Ep),{chain:!1}),Dr.VERSION="4.17.21",Tt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Dr[e].placeholder=Dr})),Tt(["drop","take"],(function(e,t){zr.prototype[e]=function(r){r=r===n?1:gr(ms(r),0);var o=this.__filtered__&&!t?new zr(this):this.clone();return o.__filtered__?o.__takeCount__=hr(r,o.__takeCount__):o.__views__.push({size:hr(r,d),type:e+(o.__dir__<0?"Right":"")}),o},zr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Tt(["filter","map","takeWhile"],(function(e,t){var r=t+1,o=1==r||3==r;zr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:sa(e,3),type:r}),t.__filtered__=t.__filtered__||o,t}})),Tt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");zr.prototype[e]=function(){return this[r](1).value()[0]}})),Tt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");zr.prototype[e]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(np)},zr.prototype.find=function(e){return this.filter(e).head()},zr.prototype.findLast=function(e){return this.reverse().find(e)},zr.prototype.invokeMap=Yo((function(e,t){return"function"==typeof e?new zr(this):this.map((function(r){return Mo(r,e,t)}))})),zr.prototype.reject=function(e){return this.filter(ki(sa(e)))},zr.prototype.slice=function(e,t){e=ms(e);var r=this;return r.__filtered__&&(e>0||t<0)?new zr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ms(t))<0?r.dropRight(-t):r.take(t-e)),r)},zr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zr.prototype.toArray=function(){return this.take(d)},To(zr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),a=Dr[o?"take"+("last"==t?"Right":""):t],i=o||/^find/.test(t);a&&(Dr.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,p=t instanceof zr,l=s[0],c=p||$i(t),u=function(e){var t=a.apply(Dr,Ct([e],s));return o&&y?t[0]:t};c&&r&&"function"==typeof l&&1!=l.length&&(p=c=!1);var y=this.__chain__,d=!!this.__actions__.length,f=i&&!y,m=p&&!d;if(!i&&c){t=m?t:new zr(this);var g=e.apply(t,s);return g.__actions__.push({func:fi,args:[u],thisArg:n}),new Gr(g,y)}return f&&m?e.apply(this,s):(g=this.thru(u),f?o?g.value()[0]:g.value():g)})})),Tt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Oe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);Dr.prototype[e]=function(){var e=arguments;if(o&&!this.__chain__){var n=this.value();return t.apply($i(n)?n:[],e)}return this[r]((function(r){return t.apply($i(r)?r:[],e)}))}})),To(zr.prototype,(function(e,t){var r=Dr[t];if(r){var o=r.name+"";xe.call(Mr,o)||(Mr[o]=[]),Mr[o].push({name:t,func:r})}})),Mr[Un(n,2).name]=[{name:"wrapper",func:n}],zr.prototype.clone=function(){var e=new zr(this.__wrapped__);return e.__actions__=On(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=On(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=On(this.__views__),e},zr.prototype.reverse=function(){if(this.__filtered__){var e=new zr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=$i(e),o=t<0,n=r?e.length:0,a=function(e,t,r){for(var o=-1,n=r.length;++o=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Dr.prototype.plant=function(e){for(var t,r=this;r instanceof Vr;){var o=Va(r);o.__index__=0,o.__values__=n,t?a.__wrapped__=o:t=o;var a=o;r=r.__wrapped__}return a.__wrapped__=e,t},Dr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zr){var t=e;return this.__actions__.length&&(t=new zr(this)),(t=t.reverse()).__actions__.push({func:fi,args:[ti],thisArg:n}),new Gr(t,this.__chain__)}return this.thru(ti)},Dr.prototype.toJSON=Dr.prototype.valueOf=Dr.prototype.value=function(){return dn(this.__wrapped__,this.__actions__)},Dr.prototype.first=Dr.prototype.head,it&&(Dr.prototype[it]=function(){return this}),Dr}();at._=pr,(o=function(){return pr}.call(t,r,t,e))===n||(e.exports=o)}.call(this)},904:(e,t)=>{"use strict";var r;let o;Object.defineProperty(t,"__esModule",{value:!0}),t.setDomain=t.getDomain=t.Domain=void 0,function(e){e[e.FA=0]="FA",e[e.FORM=1]="FORM",e[e.ETS=2]="ETS"}(r||(r={})),t.Domain=r,t.setDomain=e=>{o=e},t.getDomain=()=>null!=o?o:r.FA},3784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMap=void 0,t.errorMap=new Map([["fileError","Visual file is damaged"],["versionError","Version number of visual file does not match"],["modelError","Visual model in visual file is damaged"],["codegenError","Codegen visual file failed"]])},4117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNode=void 0,t.ASTNode=class{accept(e){return e.visit(this)}}},1862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0,t.Cache=class{constructor(e,t=0){this.value="",this.indent=t,this.flag=!0,this.INDENT=e}indentOn(){this.flag=!0}indentOff(){this.flag=!1}incIndent(){this.indent++}decIndent(){this.indent--}checkIndent(){return this.indent<0}getIndents(){if(this.flag){let e="";for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const o=r(4117);class n extends o.ASTNode{constructor(e,t,r,o,n){super(),this.builders=new Map,this.defaultValue=new Map,this.mediaParams=new Map,this.mediaProperties=new Map,this.mediaKeyProperty=new Map,this.tagName=e,this.params=t,this.content=r,this.properties=o,this.forEachObj=n,this.ifBoolean=null,this.isCustomTag=!1}setMediaParams(e){this.mediaParams=e}setParams(e){this.params=e}setIfBoolean(e){this.ifBoolean=e}setTagName(e){this.tagName=e}setForEachObj(e){this.forEachObj=e}setMediaProperty(e,t){t.forEach(((t,r)=>{var o;this.mediaKeyProperty.has(r)||this.mediaKeyProperty.set(r,new Map),null===(o=this.mediaKeyProperty.get(r))||void 0===o||o.set(e,t)}))}setDefaultValue(e,t,r="undefined",o=""){this.defaultValue.set(e,[r,t,o])}}t.Tag=n},5623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const o=r(9519),n=r(1862),a=r(5051),i=r(4294),s=r(6486),p=r(9459);class l{constructor(e){this.cache=e,this.etsImport=new n.Cache(" ",0),this.etsVariable=new n.Cache(" ",1),this.etsFunction=new n.Cache(" ",1),this.etsBuilder=new n.Cache(" ",1),this.aboutToAppear=new n.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}visit(e){e instanceof o.Tag&&(e.isCustomTag?this.genCustomTag(e):(this.needMediaQuery&&this.genMediaQuery(e),this.genTag(e)))}static getMethodGen(e){return void 0===l.instance?l.instance=new l(e):l.instance.setCache(e),l.instance}setCache(e){this.cache=e,this.etsImport=new n.Cache(" ",0),this.etsVariable=new n.Cache(" ",1),this.etsFunction=new n.Cache(" ",1),this.etsBuilder=new n.Cache(" ",1),this.aboutToAppear=new n.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}genParams(e){const t=this.getParams(e);this.isCustomComponent(e)?this.genCustomParams(t):this.genCommonParams(t)}genCommonParams(e){if("string"==typeof e)this.cache.concat(e);else if(e.size>0){this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE);let t=0;e.forEach(((r,o)=>{this.cache.concat(o,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(t,a.TokenClass.COLON,a.TokenClass.SPACE,e,a.TokenClass.COMMA)})),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genObjectProperty(e){let t=0;this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE),e.forEach(((r,o)=>{this.cache.concat(o,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{e.accept(this),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.decIndent(),this.cache.indentOn()),this.cache.indentOn(),this.cache.concat(a.TokenClass.RBRA)),(null!==e.properties||null!==e.mediaProperties)&&(null!==e.content&&0!==e.content.length||this.cache.incIndent(),this.getProperties(e).forEach(((e,t)=>{this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.PROPERTY_START,t,a.TokenClass.TAG_START),this.cache.indentOff(),"string"==typeof e?this.cache.concat(e,a.TokenClass.TAG_END):this.genObjectProperty(e)})),null!==e.content&&0!==e.content.length||this.cache.decIndent()),this.genEnd(e),this.genBuildersFunction(e)}genStart(e){this.genIfStart(e),this.genForTagStart(e),this.genCustomImport(e)}genEnd(e){this.genForTagEnd(e),this.genIfEnd(e)}genForTagStart(e){var t;void 0!==(null===(t=e.forEachObj)||void 0===t?void 0:t.for)&&(this.cache.concat("ForEach",a.TokenClass.TAG_START,e.forEachObj.for.toString(),a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE))}genForTagEnd(e){null!==e.forEachObj&&(this.cache.concat(a.TokenClass.RBRA),void 0!==e.forEachObj.key&&""!==e.forEachObj.key&&(this.cache.concat(a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.concat("return ",e.forEachObj.key.toString(),a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.TAG_END,a.TokenClass.RBRA),this.cache.indentOff()),this.cache.concat(a.TokenClass.TAG_END))}genIfStart(e){null!==e.ifBoolean&&(this.cache.concat("if",a.TokenClass.SPACE,a.TokenClass.TAG_START,e.ifBoolean.toString(),a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.incIndent())}genIfEnd(e){null!==e.ifBoolean&&(this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genMediaQuery(e){const t=new Map,r=new Map;if(this.collectMediaQueryMap(e,t),this.collectDefaultValueMap(e,r),0===t.size&&0===r.size)return;const o=(0,i.getUniqueName)("mediaQuery"),s=(0,i.getUniqueName)("initForMediaQuery"),p=(0,i.getUniqueName)("mediaQueryCb"),l=(0,i.getUniqueName)("saveMediaQueryResult"),c=(0,i.getUniqueName)("updateForMediaQuery"),u=new n.Cache(a.TokenClass.INDENT,1),y=new n.Cache(a.TokenClass.INDENT,1),d=new n.Cache(a.TokenClass.INDENT,1),f=new n.Cache(a.TokenClass.INDENT,1),m=new n.Cache(a.TokenClass.INDENT,1),g=new n.Cache(a.TokenClass.INDENT,1),h=new n.Cache(a.TokenClass.INDENT,1),E=new n.Cache(a.TokenClass.INDENT,2);this.genVariableDeclare(r,u,a.TokenClass.UNDEFINED),this.genMediaQueryCb(p,y),this.genMediaQueryListener(t,d,f),this.genInitFuc(s,r,m),this.genMediaQueryCbFnc(l,c,t,g),this.genUpdateFnc(c,s,t,h),this.genAboutToAppear(p,l,t,E),this.etsImport.indentOff(),this.aboutToAppear.indentOff(),this.etsVariable.indentOff(),this.etsFunction.indentOff(),this.etsImport.indentOff(),this.etsImport.concat("import ",o," from '@ohos.mediaquery'",a.TokenClass.NEW_LINE),this.aboutToAppear.concat(E.toString()),this.etsVariable.concat(u.toString(),y.toString(),d.toString(),f.toString()),this.etsFunction.concat(g.toString(),a.TokenClass.NEW_LINE,m.toString(),a.TokenClass.NEW_LINE,h.toString()),this.etsImport.indentOn(),this.aboutToAppear.indentOn(),this.etsVariable.indentOn(),this.etsFunction.indentOn(),this.needMediaQuery=!1}genBuildersFunction(e){e.builders.forEach(((e,t)=>{this.etsBuilder.indentOff(),this.etsBuilder.concat(a.TokenClass.NEW_LINE),this.etsBuilder.indentOn(),this.etsBuilder.concat(a.TokenClass.DECORATOR_Builder,a.TokenClass.SPACE,t,a.TokenClass.TAG_START,a.TokenClass.TAG_END),this.etsBuilder.indentOff();const r=(0,p.genBuilderEts)(e);this.etsBuilder.concat(a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.etsBuilder.indentOn(),this.etsBuilder.concat(r.cache.toString(),a.TokenClass.NEW_LINE),this.etsBuilder.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE),this.etsBuilder.indentOff(),this.etsBuilder.concat(r.etsBuilder.toString())}))}genCustomTag(e){this.genVariableDeclare(e.defaultValue,this.cache)}genVariableDeclare(e,t,r){t.indentOn(),e.forEach(((e,o)=>{const n=e[2];""!==n&&(t.concat(n,a.TokenClass.SPACE),t.indentOff()),t.concat(o.slice(5),a.TokenClass.COLON,a.TokenClass.SPACE,e[1]),t.indentOff();const i=null!=r?r:e[0];null!=i&&t.concat(a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,i),t.concat(a.TokenClass.NEW_LINE),t.indentOn()}))}genMediaQueryCb(e,t){t.concat(e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.NULL,a.TokenClass.NEW_LINE)}genMediaQueryListener(e,t,r){const o=(0,i.getUniqueName)("mediaQuery");e.forEach(((e,n)=>{const s=(0,i.getUniqueName)(this.getMediaQueryVariableName(n));t.concat(s,a.TokenClass.COLON,a.TokenClass.SPACE,a.TokenClass.BOOLEAN,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.FALSE,a.TokenClass.NEW_LINE),r.concat(`listener_${s}`,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,o,a.TokenClass.PROPERTY_START,"matchMediaSync",a.TokenClass.TAG_START,`'${n}'`,a.TokenClass.TAG_END,a.TokenClass.NEW_LINE)}))}genInitFuc(e,t,r){r.concat(e,a.TokenClass.TAG_START,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),r.indentOn(),r.incIndent(),t.forEach(((e,t)=>{r.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e[0],a.TokenClass.NEW_LINE)})),r.decIndent(),r.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genMediaQueryCbFnc(e,t,r,o){const n=Array.from(r.entries());o.concat(e,a.TokenClass.TAG_START,"mediaQueryResult",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent(),o.concat(a.TokenClass.SWITCH,a.TokenClass.SPACE,a.TokenClass.TAG_START,"mediaQueryResult.media",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent();for(let e=0;e{const r=(0,i.getUniqueName)(this.getMediaQueryVariableName(t));o.concat(a.TokenClass.IF,a.TokenClass.SPACE,a.TokenClass.TAG_START,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,r,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent(),e.forEach(((e,t)=>{o.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e,a.TokenClass.NEW_LINE)})),o.decIndent(),o.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)})),o.decIndent(),o.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genAboutToAppear(e,t,r,o){let n=1;o.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,`${t}.bind(this)`,a.TokenClass.NEW_LINE),r.forEach(((t,s)=>{const p=`listener_${(0,i.getUniqueName)(this.getMediaQueryVariableName(s))}`;o.indentOn(),o.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,p,a.TokenClass.PROPERTY_START,`on('change', this.${e})`),n0&&e.mediaParams.forEach(((e,r)=>{t.set(r,e)})),t}getProperties(e){const t=new Map;return e.properties.forEach(((e,r)=>{t.set(r,e)})),e.mediaProperties.forEach(((e,r)=>{t.set(r,e)})),t}collectDefaultValueMap(e,t){void 0!==e.defaultValue&&e.defaultValue.forEach(((e,r)=>{t.set(r,e)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectDefaultValueMap(e,t)}))}collectMediaQueryMap(e,t){void 0!==e.mediaKeyProperty&&e.mediaKeyProperty.forEach(((e,r)=>{var o;const n=null!==(o=t.get(r))&&void 0!==o?o:new Map;e.forEach(((e,t)=>{n.set(t,e)})),t.set(r,n)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectMediaQueryMap(e,t)}))}getMediaQueryVariableName(e){const t="device-type: ",r="orientation: ",o=e.substring(e.indexOf(t),e.length),n=o.substring(t.length,o.indexOf(")")),a=e.substring(e.indexOf(r),e.length),i=a.substring(r.length,a.indexOf(")"));return`${n}${i.slice(0,1).toUpperCase()+i.slice(1).toLowerCase()}`}}t.ASTNodeGenerator=l,l.instance=void 0},8413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ETSBridge=void 0;const o=r(9519),n=r(1912),a=r(3729),i=r(6125),s=r(366),p=r(7893);t.ETSBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map;let r=null;const l=new Map,c=new o.Tag(e.type,t,r,l,null);if((0,n.parseVisualModel)(e,c),(0,a.parseMediaVisualModel)(e,c),(0,i.parseCustomVisualModel)(e,c),(0,s.parseCustomMediaVisualModel)(e,c),(0,p.parseBuildersVisualModel)(e,c,this),e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}return c.content=r,c}}},9459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genBuilderEts=t.genCustomEts=t.genETS=t.EMPTY=void 0;const o=r(5623),n=r(1862);t.EMPTY={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""},t.genETS=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" ",2));return e.accept(t),{build:t.cache.toString(),etsImport:t.etsImport.toString(),etsVariable:t.etsVariable.toString(),etsFunction:t.etsFunction.toString().concat(t.etsBuilder.toString()),aboutToAppear:t.aboutToAppear.toString()}},t.genCustomEts=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" ",1));return e.accept(t),t.cache.toString()},t.genBuilderEts=function(e){const t=new o.ASTNodeGenerator(new n.Cache(" ",1));return e.accept(t),t}},4435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;const o=r(9459);t.StringWriter=class{genETS(e){return(0,o.genETS)(e)}}},5051:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.INDENT=" ",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.SPACE=" ",r.LQUOTE="'",r.RQUOTE="'",r.TAG_START="(",r.TAG_END=")",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDynamicValueByDecorator=t.getMediaVariableDecorator=t.getCustomAttrType=t.getCustomAttributeMap=t.setCustomAttribute=void 0;const o=r(2891),n=new Map;function a(){return n}function i(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.decorator)&&void 0!==r?r:"normal"}t.setCustomAttribute=function(e){var t,r;const a=e.type;(null!==(r=null===(t=(0,o.getInstance)().customData)||void 0===t?void 0:t.property.get(a))&&void 0!==r?r:new Map).forEach(((e,t)=>{const r=`${t}-${a.replace(/\//g,"-")}`;n.set(r,e)}))},t.getCustomAttributeMap=a,t.getCustomAttrType=function(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.type)&&void 0!==r?r:""},t.getMediaVariableDecorator=function(e){const t=i(e);let r="";return"@Link"!==t&&"@Prop"!==t||(r="@State"),r},t.getDynamicValueByDecorator=function(e,t){let r=t;return"@Link"===i(e)&&(r=t.replace("this.","$")),r}},6125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumParserMap=t.genCustomEvent=t.parseCustomVisualModel=void 0;const o=r(2891),n=r(3135),a=r(1195),i=r(8122),s=r(1790);function p(e,t){if(!(t.params instanceof Map))return;const r=function(e){var t,r;const n=e.type;return[...null!==(r=null===(t=(0,o.getInstance)().customData)||void 0===t?void 0:t.event.get(n))&&void 0!==r?r:[]]}(e);for(const o of r){const r=e.property.get(o);void 0!==r&&""!==r&&("this"===r.split(".")[0]?t.params.set(o,r+".bind(this)"):t.params.set(o,r))}}t.parseCustomVisualModel=function(e,r){(0,a.setCustomAttribute)(e),(0,a.getCustomAttributeMap)().forEach(((o,n)=>{if(function(e,t){return e.property.has(t)||e.dynamicProperty.has(t)}(e,n)){const a=c.get(o.type);"function"==typeof a&&a(n,e,r);const s=t.enumParserMap.get(o.type);"function"==typeof s&&function(e,t,r,o){if((0,i.dynamicParamParser)(e,t,r))return;const n=t.property.get(e);!(0,i.isEmptyOrUndefined)(n)&&r.params instanceof Map&&r.params.set((0,i.getEtsPropName)(e),o(n))}(n,e,r,s)}})),p(e,r)},t.genCustomEvent=p;const l=(0,i.curry)(i.getEtsEnumValue),c=new Map([["string",i.stringParamParser],["boolean",i.rawDataParamParser],["number",i.rawDataParamParser],["any[]",i.rawDataParamParser],["object",i.rawDataParamParser],["Date",function(e,t,r){(0,i.dateParamParser)(e,(0,i.getEtsPropName)(e),t,r)}]]);t.enumParserMap=new Map([["Alignment",function(e){const t=(0,i.getBackgroundImagePositionEnumValue)(e);return""!==t?t:(0,i.getEtsEnumValue)("Alignment.",e)}],["Direction",l("Direction.")],["ItemAlign",i.dealWithAlignSelf],["BorderStyle",l("BorderStyle.")],["ImageRepeat",i.dealWithBackgroundRepeat],["ImageSize",l("ImageSize.")],["Visibility",l("Visibility.")],["FontStyle",l("FontStyle.")],["FontWeight",i.dealWithFontWeight],["ButtonType",l("ButtonType.")],["Color",l("Color.")],["LineCapStyle",l("LineCapStyle.")],["ImageFit",l("ImageFit.")],["ImageInterpolation",l("ImageInterpolation.")],["ImageRenderMode",l("ImageRenderMode.")],["ProgressStyle",l("ProgressStyle.")],["SliderStyle",l("SliderStyle.")],["TextAlign",l("TextAlign.")],["TextOverflow",l("TextOverflow.")],["TextDecorationType",l("TextDecorationType.")],["TextCase",l("TextCase.")],["HorizontalAlign",s.dealWithColumnAlignItems],["FlexAlign",n.dealWithJustifyAlignContent],["VerticalAlign",s.dealWithRowAlignItems],["FlexDirection",l("FlexDirection.")],["FlexWrap",i.dealWithWrap],["Axis",l("Axis.")],["EdgeEffect",l("EdgeEffect.")],["Sticky",l("Sticky.")],["EnterKeyType",l("EnterKeyType.")],["ToggleType",l("ToggleType.")],["InputType",l("InputType.")],["ScrollDirection",l("ScrollDirection.")],["EdgeEffect",l("EdgeEffect.")],["GridDirection",l("GridDirection.")],["BarState",l("BarState.")],["NavigationTitleMode",l("NavigationTitleMode.")],["CopyOption",l("CopyOption.")],["BarPosition",l("BarPosition.")],["BarMode",l("BarMode.")]])},9223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonMediaParserArray=t.ifParser=t.forEachParser=void 0;const o=r(6282),n=r(8122),a=r(9248),i=(0,n.curry)(((e,t)=>t.hasMediaProperty(e)));function s(e,t,r){var o,a,i,s;const p=null!==(o=e.property.get("left"))&&void 0!==o?o:e.dynamicProperty.get("left"),l=null!==(a=e.property.get("top"))&&void 0!==a?a:e.dynamicProperty.get("top"),c=t.get("left"),u=t.get("top"),y=r.get("left"),d=r.get("top");let f="undefined",m="undefined";return(0,n.isEmptyOrUndefined)(c)&&(0,n.isEmptyOrUndefined)(u)||(f=(0,n.quoteString)(null!==(i=null!=c?c:p)&&void 0!==i?i:"0"),m=(0,n.quoteString)(null!==(s=null!=u?u:l)&&void 0!==s?s:"0")),(0,n.isEmptyOrUndefined)(y)&&(0,n.isEmptyOrUndefined)(d)||(f=null!=y?y:f,m=null!=d?d:m),{leftValue:f,topValue:m}}function p(e,t){e.forEach(((e,r)=>{"undefined"!==e&&t.set(r,"undefined")}))}function l(e,t){var r,o;const a=new Map,i=t.split("-")[0];return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((r,o)=>{var s,p,l,c;const u=r.get(i),y=null===(p=null===(s=e.dynamicMediaProperty)||void 0===s?void 0:s.get(o))||void 0===p?void 0:p.get(i),d=null!==(c=null!==(l=r.get(t))&&void 0!==l?l:y)&&void 0!==c?c:u;void 0!==d&&a.set(o,(0,n.quoteString)(d))})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{var o;const n=e.get(i),s=null!==(o=e.get(t))&&void 0!==o?o:n;void 0!==s&&a.set(r,s)})),a}const c=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.quoteString);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.quoteString),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),u=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),y=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),d=(0,n.curry)(((e,t,r,a)=>{const i=(0,o.getMediaProperty)(r,e,(0,n.curry)(n.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,n.curry)(n.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);a.setDefaultValue(p,(0,o.getType)(e),s),a.setMediaProperty(p,i),a.mediaProperties.set((0,n.getEtsPropName)(e),p)})),f=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.dealWithColor);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.dealWithColor),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)}));function m(e,t,r,o=!1){(0,n.isEmptyOrUndefined)(t)||r.set(e,o?t:(0,n.quoteString)(t))}t.forEachParser=function(e,t){var r,n,a;const i=null!==(r=e.dynamicProperty.get("for"))&&void 0!==r?r:"[1]",s=null!==(n=e.property.get("item"))&&void 0!==n?n:"item",p=null!==(a=e.property.get("idx"))&&void 0!==a?a:"idx",l=e.dynamicProperty.get("keyGenerator"),c=(0,o.getMediaProperty)(e,"for");if(0===c.size)return;const u=(0,o.getVariableName)(e.id,"for"),y={for:u,key:l,item:s,idx:p};t.setDefaultValue(u,(0,o.getType)("for"),i),t.setMediaProperty(u,c),t.setForEachObj(y)},t.ifParser=function(e,t){const r=(0,o.getMediaProperty)(e,"if");if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"if"),a=(0,o.getVariableName)(e.id,"if");t.setDefaultValue(a,(0,o.getType)("if"),n),t.setMediaProperty(a,r),t.setIfBoolean(a)};const g=(0,n.curry)(((e,t,r)=>{const a=new Map,i=t.property.get(e),s=t.dynamicProperty.get(e),p=null!=s?s:i,c=["top","bottom","left","right"];let u=0;for(const i of c){const s=`${e}-${i}`,c=t.property.get(s),y=t.dynamicProperty.get(s),d=l(t,s);let f=(0,n.isEmptyOrUndefined)(p)?"undefined":(0,n.quoteString)(p);if((0,n.isEmptyOrUndefined)(c)||(f=(0,n.quoteString)(c)),(0,n.isEmptyOrUndefined)(y)||(f=y),d.size>0){const e=(0,o.getVariableName)(t.id,s);r.setDefaultValue(e,(0,o.getType)(s),f),r.setMediaProperty(e,d),m(i,e,a,!0),u++}else m(i,f,a,!0)}u>0&&r.mediaProperties.set(e,a)}));function h(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null===t?"undefined":void 0!==t[5]?`{ width: ${(0,n.quoteString)(t[1])}, height: ${(0,n.quoteString)(t[5])} }`:`{ width: ${(0,n.quoteString)(t[1])} }`}function E(e,t){var r,o;const a=new Map,i=new Map,s=S(t),p=P(t);return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((e,r)=>{const o=e.get(t);if(!(0,n.isEmptyOrUndefined)(o)){let e=s(o);e=""!==e?e:"undefined",a.set(r,e),i.set(r,p(o))}})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{const o=e.get(t);(0,n.isEmptyOrUndefined)(o)||(a.set(r,o),i.set(r,"undefined"))})),{enumValueMap:a,objValueMap:i}}function T(e,t){const r=e.property.get(t),o=e.dynamicProperty.get(t),a=S(t),i=P(t);let s="undefined",p="undefined";if(!(0,n.isEmptyOrUndefined)(r)){const e=a(r);s=""!==e?e:s,p=i(r)}return(0,n.isEmptyOrUndefined)(o)||(s=o,p="undefined"),{enumDefault:s,objDefault:p}}function S(e){return new Map([["background-image-size",n.getBackgroundImageSizeEnumValue],["background-image-position",n.getBackgroundImagePositionEnumValue]]).get(e)}function P(e){return new Map([["background-image-size",h],["background-image-position",v]]).get(e)}function v(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null===t?"undefined":`{ x: ${(0,n.quoteString)(t[1])}, y: ${(0,n.quoteString)(t[4])} }`}const b=(0,n.curry)(((e,t,r,a)=>{const i=(0,n.getBorderDirections)(e),s=new Map;let p=r.property.get(e);(0,n.isEmptyOrUndefined)(p)||(p=t(p));const l=r.dynamicProperty.get(e),c=null!=l?l:p,u=(0,o.getMediaProperty)(r,e,t);let y=0;for(const e of i){const i=(0,n.getEdgeBorderDirection)(e),p=r.property.get(e),l=r.dynamicProperty.get(e),d=(0,o.getMediaProperty)(r,e,t);let f=(0,n.isEmptyOrUndefined)(c)?"undefined":c;if((0,n.isEmptyOrUndefined)(p)||(f=t(p)),(0,n.isEmptyOrUndefined)(l)||(f=l),d.size>0){const t=(0,o.getVariableName)(r.id,e);a.setDefaultValue(t,(0,o.getType)(e),f),a.setMediaProperty(t,d),s.set(i,t),y++}else{const t=(0,o.getVariableName)(r.id,e);a.setDefaultValue(t,(0,o.getType)(e),f),a.setMediaProperty(t,u),s.set(i,t)}}y>0&&a.mediaProperties.set((0,n.getEtsPropName)(e),s)}));t.commonMediaParserArray=[[i("width"),c("width")],[i("height"),c("height")],[function(e){return e.hasMediaProperty("constraint-size-min-width")||e.hasMediaProperty("constraint-size-max-width")||e.hasMediaProperty("constraint-size-min-height")||e.hasMediaProperty("constraint-size-min-height")},function(e,t){const r=new Map,a=["min-width","max-width","min-height","max-height"];for(const i of a){const a=`constraint-size-${i}`,s=(0,o.getMediaProperty)(e,a,n.quoteString),p=(0,o.getMediaDefaultValue)(e,a,n.quoteString);if(s.size>0){const l=(0,o.getVariableName)(e.id,a);t.setDefaultValue(l,(0,o.getType)(a),p),t.setMediaProperty(l,s),m((0,n.getEtsPropName)(i),l,r,!0)}}r.size>0&&t.mediaProperties.set("constraintSize",r)}],[i("align"),d("align","Alignment.")],[i("direction"),d("direction","Direction.")],[function(e){return e.hasMediaProperty("left")||e.hasMediaProperty("top")},function(e,t){var r;const n=null!==(r=e.property.get("position"))&&void 0!==r?r:"relative",{leftValue:a,topValue:i}=s(e,e.property,e.dynamicProperty),{mediaPositionLeft:l,mediaPositionTop:c,mediaOffsetLeft:u,mediaOffsetTop:y}=function(e){var t,r;const o=new Map,n=new Map,a=new Map,i=new Map,p=null!==(t=e.mediaProperty)&&void 0!==t?t:new Map,l=null!==(r=e.dynamicMediaProperty)&&void 0!==r?r:new Map,c=new Set;for(const[e]of p)c.add(e);for(const[e]of l)c.add(e);return c.forEach((t=>{var r,p,l,c;const u=null!==(p=null===(r=e.mediaProperty)||void 0===r?void 0:r.get(t))&&void 0!==p?p:new Map,y=null!==(c=null===(l=e.dynamicMediaProperty)||void 0===l?void 0:l.get(t))&&void 0!==c?c:new Map,d=u.get("position"),{leftValue:f,topValue:m}=s(e,u,y);"absolute"===d?("undefined"!==f&&o.set(t,f),"undefined"!==m&&n.set(t,m)):("undefined"!==f&&a.set(t,f),"undefined"!==m&&i.set(t,m))})),{mediaPositionLeft:o,mediaPositionTop:n,mediaOffsetLeft:a,mediaOffsetTop:i}}(e),d=l.size>0||c.size>0||"absolute"===n,f=u.size>0||y.size>0||"relative"===n,m=(0,o.getVariableName)(e.id,"positionLeft"),g=(0,o.getVariableName)(e.id,"positionTop"),h=(0,o.getVariableName)(e.id,"offsetLeft"),E=(0,o.getVariableName)(e.id,"offsetTop");if(0!==l.size||0!==c.size||0!==y.size||0!==u.size){if(d&&f&&(p(l,u),p(u,l),p(c,y),p(y,c)),d){const e="absolute"===n?a:"undefined",r="absolute"===n?i:"undefined";t.setDefaultValue(m,(0,o.getType)("left"),e),t.setDefaultValue(g,(0,o.getType)("top"),r),t.setMediaProperty(m,l),t.setMediaProperty(g,c),t.mediaProperties.set("position",new Map([["x",m],["y",g]]))}if(f){const e="relative"===n?a:"undefined",r="relative"===n?i:"undefined";t.setDefaultValue(h,(0,o.getType)("left"),e),t.setDefaultValue(E,(0,o.getType)("top"),r),t.setMediaProperty(h,u),t.setMediaProperty(E,y),t.mediaProperties.set("offset",new Map([["x",h],["y",E]]))}}}],[i("aspect-ratio"),u("aspect-ratio")],[i("display-priority"),u("display-priority")],[i("flex-basis"),c("flex-basis")],[i("flex-grow"),u("flex-grow")],[i("flex-shrink"),u("flex-shrink")],[i("align-self"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-self",n.dealWithAlignSelf);if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"align-self",n.dealWithAlignSelf),i=(0,o.getVariableName)(e.id,"align-self");t.setDefaultValue(i,(0,o.getType)("align-self"),a),t.setMediaProperty(i,r),t.mediaProperties.set("alignSelf",i)}],[i("border-style"),d("border-style","BorderStyle.")],[function(e){return e.hasMediaProperty("border-top-style")||e.hasMediaProperty("border-bottom-style")||e.hasMediaProperty("border-left-style")||e.hasMediaProperty("border-right-style")},b("border-style",(0,n.curry)(n.getEtsEnumValue)("BorderStyle."))],[i("border-width"),c("border-width")],[function(e){return e.hasMediaProperty("border-top-width")||e.hasMediaProperty("border-bottom-width")||e.hasMediaProperty("border-left-width")||e.hasMediaProperty("border-right-width")},b("border-width",n.quoteString)],[i("border-color"),f("border-color")],[function(e){return e.hasMediaProperty("border-top-color")||e.hasMediaProperty("border-bottom-color")||e.hasMediaProperty("border-left-color")||e.hasMediaProperty("border-right-color")},b("border-color",n.dealWithColor)],[i("border-radius"),c("border-radius")],[function(e){return e.hasMediaProperty("border-top-left-radius")||e.hasMediaProperty("border-bottom-right-radius")||e.hasMediaProperty("border-bottom-left-radius")||e.hasMediaProperty("border-top-right-radius")},b("border-radius",n.quoteString)],[i("background-color"),f("background-color")],[function(e){return e.hasMediaProperty("background-image-src")||e.hasMediaProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),i=e.property.get("background-image-repeat"),s=e.dynamicProperty.get("background-image-src"),p=e.dynamicProperty.get("background-image-repeat"),l=(0,o.getMediaProperty)(e,"background-image-src",a.dealWithSrc),c=(0,o.getMediaProperty)(e,"background-image-repeat",n.dealWithBackgroundRepeat);if(0===l.size&&0===c.size)return;let u=(0,a.dealWithSrc)(null!=r?r:"");if((0,n.isEmptyOrUndefined)(s)||(u=s),l.size>0){const r=(0,o.getVariableName)(e.id,"background-image-src");t.setDefaultValue(r,(0,o.getType)("background-image-src"),u),t.setMediaProperty(r,l),u=r}let y="undefined";if(!(0,n.isEmptyOrUndefined)(i)){const e=(0,n.dealWithBackgroundRepeat)(i);null!=e&&""!==e&&(y=e)}if((0,n.isEmptyOrUndefined)(p)||(y=p),c.size>0){const r=(0,o.getVariableName)(e.id,"background-image-repeat");t.setDefaultValue(r,(0,o.getType)("background-image-repeat"),y),t.setMediaProperty(r,c),y=r}t.mediaProperties.set("backgroundImage",u+", "+y)}],[i("background-image-size"),function(e,t){const{enumValueMap:r,objValueMap:n}=E(e,"background-image-size");if(0===r.size&&0===n.size)return;const{enumDefault:a,objDefault:i}=T(e,"background-image-size"),s=(0,o.getVariableName)(e.id,"background-image-size-enum"),p=(0,o.getVariableName)(e.id,"background-image-size-obj");t.setDefaultValue(s,"ImageSize",a),t.setDefaultValue(p,"SizeOptions",i),t.setMediaProperty(s,r),t.setMediaProperty(p,n),t.mediaProperties.set("backgroundImageSize",`${s} !== undefined ? ${s} : ${p}`)}],[i("background-image-position"),function(e,t){const{enumValueMap:r,objValueMap:n}=E(e,"background-image-position");if(0===r.size&&0===n.size)return;const{enumDefault:a,objDefault:i}=T(e,"background-image-position"),s=(0,o.getVariableName)(e.id,"background-image-position-enum"),p=(0,o.getVariableName)(e.id,"background-image-position-obj");t.setDefaultValue(s,"Alignment",a),t.setDefaultValue(p,"Position",i),t.setMediaProperty(s,r),t.setMediaProperty(p,n),t.mediaProperties.set("backgroundImagePosition",`${s} !== undefined ? ${s} : ${p}`)}],[i("opacity"),u("opacity")],[i("visibility"),d("visibility","Visibility.")],[i("enabled"),y("enabled")],[i("font-color"),f("font-color")],[function(e){return e.hasMediaProperty("margin")||e.hasMediaProperty("margin-left")||e.hasMediaProperty("margin-top")||e.hasMediaProperty("margin-right")||e.hasMediaProperty("margin-bottom")},g("margin")],[function(e){return e.hasMediaProperty("padding")||e.hasMediaProperty("padding-left")||e.hasMediaProperty("padding-top")||e.hasMediaProperty("padding-right")||e.hasMediaProperty("padding-bottom")},g("padding")]]},3135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.componentsMediaParserArray=t.dateMediaParamParser=t.rawDataMediaParamParser=t.stringMediaParamParser=t.dealWithJustifyAlignContent=void 0;const o=r(6282),n=r(1195),a=r(8122),i=r(9248),s=r(1790),p=r(5264),l=(0,a.curry)(((e,t,r)=>r.type===e&&r.hasMediaProperty(t)));function c(e){return isNaN(Number(e))?(0,a.getEtsEnumValue)("FontWeight.",e):e}function u(e){let t=(0,a.getEtsEnumValue)("FlexAlign.",e);return"flex-start"===e?t="FlexAlign.Start":"flex-end"===e&&(t="FlexAlign.End"),t}function y(e){return"TextOverflow."+(0,a.firstUpperCase)(e)}function d(e,t,r){var o,n;const i=new Map,s=null!==(o=e.mediaProperty)&&void 0!==o?o:new Map,p=null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map;return s.forEach(((e,o)=>{let n=e.get(t);const s=e.get(r);(0,a.isEmptyOrUndefined)(n)&&(0,a.isEmptyOrUndefined)(s)||(n="0"===n||(0,a.isEmptyOrUndefined)(n)?"0":n.substring(0,n.length-2),i.set(o,n))})),p.forEach(((e,r)=>{const o=e.get(t);(0,a.isEmptyOrUndefined)(o)||i.set(r,o)})),i}t.dealWithJustifyAlignContent=u;const f=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e,a.quoteString);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e,a.quoteString),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),m=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),g=(0,a.curry)(((e,t,r)=>{m(e,t,r)})),h=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,(0,a.curry)(a.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,a.curry)(a.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(e),p)}));t.stringMediaParamParser=(0,a.curry)(((e,t,r)=>{const i=(0,o.getMediaProperty)(t,e,a.quoteString);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(t,e,a.quoteString),p=(0,o.getVariableName)(t.id,e),l=(0,n.getMediaVariableDecorator)(e);r.setDefaultValue(p,(0,o.getType)(e),s,l),r.setMediaProperty(p,i),r.mediaParams.set((0,a.getEtsPropName)(e),(0,n.getDynamicValueByDecorator)(e,p))})),t.rawDataMediaParamParser=(0,a.curry)(((e,t,r)=>{const i=(0,o.getMediaProperty)(t,e);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(t,e),p=(0,o.getVariableName)(t.id,e);r.setDefaultValue(p,(0,o.getType)(e),s),r.setMediaProperty(p,i),r.mediaParams.set((0,a.getEtsPropName)(e),(0,n.getDynamicValueByDecorator)(e,p))})),t.dateMediaParamParser=(0,a.curry)(((e,t,r,n,i)=>{const s=e=>void 0===e||""===e?"new Date()":"new Date ("+(0,a.quoteString)(e)+")",p=(0,o.getMediaProperty)(n,e,s);if(!(i.mediaParams instanceof Map)||0===p.size)return;const l=(0,o.getMediaDefaultValue)(n,e,s),c=(0,o.getVariableName)(n.id,e);i.setDefaultValue(c,(0,o.getType)(e),l,r),i.setMediaProperty(c,p),i.mediaParams.set(t,c)}));const E=(0,a.curry)(((e,t,r,n,a)=>{const i=(0,o.getMediaProperty)(n,e);if(!(a.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(n,e),p=(0,o.getVariableName)(n.id,e);a.setDefaultValue(p,(0,o.getType)(e),s,r),a.setMediaProperty(p,i),a.mediaParams.set(t,p)})),T=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,(0,a.curry)(a.getEtsEnumValue)(t));if(!(n.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,a.curry)(a.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaParams.set((0,a.getEtsPropName)(e),p)})),S=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e,a.dealWithColor);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e,a.dealWithColor),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),P=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),v=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,a.quoteString);if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,a.quoteString),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(t),p)})),b=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e);if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(t),p)})),_=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,u);if(!(n.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,u),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaParams.set((0,a.getEtsPropName)(e),p)})),N=(0,a.curry)(((e,t,r,n)=>{const a=(0,o.getMediaProperty)(r,e,u);if(!(n.mediaProperties instanceof Map)||0===a.size)return;const i=(0,o.getMediaDefaultValue)(r,e,u),s=(0,o.getVariableName)(r.id,e);n.setDefaultValue(s,(0,o.getType)(e),i),n.setMediaProperty(s,a),n.mediaProperties.set("justifyContent",s)})),C=(0,a.curry)(((e,t)=>t.type===e));function A(e,t,r){const n=e.property.get(r),i=e.dynamicProperty.get(r),s=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===s.size)return;let p="''";(0,a.isEmptyOrUndefined)(n)||(p=(0,a.quoteString)(n)),(0,a.isEmptyOrUndefined)(i)||(p=(0,a.getContentName)(i));const l=(0,o.getVariableName)(e.id,r);t.setDefaultValue(l,(0,o.getType)(r),p),t.setMediaProperty(l,s),t.setMediaParams(l)}const O=(0,a.curry)(((e,t,r,n)=>{let i=n.mediaProperties.get((0,a.getEtsPropName)(e));void 0===i&&(i=new Map);const s=`${e}-${t}`,p=(0,o.getVariableName)(r.id,s);let l=(0,o.getMediaProperty)(r,s,a.quoteString),u=(0,o.getMediaDefaultValue)(r,s,a.quoteString);if("string"!=typeof i){if((0,a.isEmptyOrUndefined)(u))return;"style"===t&&(l=(0,o.getMediaProperty)(r,s,(0,a.curry)(a.getEtsEnumValue)("FontStyle.")),u=(0,o.getMediaDefaultValue)(r,s,(0,a.curry)(a.getEtsEnumValue)("FontStyle."))),"weight"===t&&(l=(0,o.getMediaProperty)(r,s,c),u=(0,o.getMediaDefaultValue)(r,s,c)),n.setDefaultValue(p,(0,o.getType)(s),u),n.setMediaProperty(p,l),i.set(t,p)}n.mediaProperties.set((0,a.getEtsPropName)(e),i)}));function M(e,t){const r=(0,o.getMediaProperty)(e,"font-weight",a.dealWithFontWeight);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"font-weight",a.dealWithFontWeight),i=(0,o.getVariableName)(e.id,"font-weight");t.setDefaultValue(i,(0,o.getType)("font-weight"),n),t.setMediaProperty(i,r),t.mediaProperties.set("fontWeight",i)}function w(e,t,r,n){const i=new Map([["value","search-value"],["placeholder","search-placeholder"],["icon","icon"],["controller","search-controller"]]).get(e);if(void 0===i)return;const s=r.getProperty(i),p=r.dynamicProperty.get(i),l=(0,o.getMediaProperty)(r,i,a.quoteString),c=(0,o.getVariableName)(r.id,i);let u="''";0!==l.size&&((0,a.isEmptyOrUndefined)(s)||(u=(0,a.quoteString)(s)),(0,a.isEmptyOrUndefined)(p)||(u="controller"===e?p:(0,a.getContentName)(p)),n.setDefaultValue(c,(0,o.getType)(i),u),n.setMediaProperty(c,l),t.push(`${e}: ${(0,a.getContentName)(c)}`))}const R=[[l("button","label"),function(e,t){A(e,t,"label")}],[l("button","type"),h("type","ButtonType.")],[l("button","state-effect"),g("state-effect")],[l("button","font-size"),f("font-size")],[l("button","font-style"),h("font-style","FontStyle.")],[l("button","font-weight"),M],[l("button","font-family"),f("font-family")]],I=[[l("divider","vertical"),g("vertical")],[l("divider","color"),S("color")],[l("divider","stroke-width"),f("stroke-width")],[l("divider","line-cap"),h("line-cap","LineCapStyle.")]],x=[[C("image"),function(e,t){var r;const n=null!==(r=e.property.get("src"))&&void 0!==r?r:"",s=e.dynamicProperty.get("src"),p=(0,o.getMediaProperty)(e,"src",i.dealWithSrc);if(0===p.size)return;let l=(0,i.dealWithSrc)(n);(0,a.isEmptyOrUndefined)(s)||(l=s);const c=(0,o.getVariableName)(e.id,"src");t.setDefaultValue(c,(0,o.getType)("src"),l),t.setMediaProperty(c,p),t.setMediaParams(c)}],[l("image","alt"),f("alt")],[l("image","object-fit"),h("object-fit","ImageFit.")],[l("image","object-repeat"),h("object-repeat","ImageRepeat.")],[l("image","interpolation"),h("interpolation","ImageInterpolation.")],[l("image","render-mode"),h("render-mode","ImageRenderMode.")],[function(e){return e.hasMediaProperty("source-size-width")||e.hasMediaProperty("source-size-height")},function(e,t){let r=e.property.get("source-size-width"),n=e.property.get("source-size-height");const i=e.dynamicProperty.get("source-size-width"),s=e.dynamicProperty.get("source-size-height"),p=d(e,"source-size-width","source-size-height"),l=d(e,"source-size-height","source-size-width");if(0===p.size)return;r="0"===r||(0,a.isEmptyOrUndefined)(r)?"0":r.substring(0,r.length-2),n="0"===n||(0,a.isEmptyOrUndefined)(n)?"0":n.substring(0,n.length-2),(0,a.isEmptyOrUndefined)(i)||(r=i),(0,a.isEmptyOrUndefined)(s)||(n=s);const c=(0,o.getVariableName)(e.id,"source-size-width"),u=(0,o.getVariableName)(e.id,"source-size-height");t.setDefaultValue(c,(0,o.getType)("source-size-width"),r),t.setDefaultValue(u,(0,o.getType)("source-size-height"),n),t.setMediaProperty(c,p),t.setMediaProperty(u,l);const y=new Map([["width",c],["height",u]]);t.mediaProperties.set("sourceSize",y)}]],L=[[function(e){return"progress"===e.type&&(e.hasMediaProperty("value")||e.hasMediaProperty("total")||e.hasMediaProperty("style"))},function(e,t){const r=e.property.get("value"),n=e.dynamicProperty.get("value"),i=(0,o.getMediaProperty)(e,"value");if(!(t.mediaParams instanceof Map)||0===i.size)return;let s=null!=r?r:"0";(0,a.isEmptyOrUndefined)(n)||(s=n);const p=(0,o.getVariableName)(e.id,"value");t.setDefaultValue(p,(0,o.getType)("value"),s),t.setMediaProperty(p,i),t.mediaParams.set("value",p)}],[l("progress","total"),(0,t.rawDataMediaParamParser)("total")],[l("progress","style"),T("style","ProgressStyle.")],[l("progress","color"),S("color")]],F=[[l("slider","value"),(0,t.rawDataMediaParamParser)("value")],[l("slider","min"),(0,t.rawDataMediaParamParser)("min")],[l("slider","max"),(0,t.rawDataMediaParamParser)("max")],[l("slider","step"),(0,t.rawDataMediaParamParser)("step")],[l("slider","style"),T("style","SliderStyle.")],[l("slider","block-color"),S("block-color")],[l("slider","track-color"),S("track-color")],[l("slider","selected-color"),S("selected-color")],[l("slider","show-steps"),g("show-steps")],[l("slider","show-tips"),g("show-tips")]],k=[[l("text","content"),function(e,t){A(e,t,"content")}],[l("text","text-align"),h("text-align","TextAlign.")],[l("text","text-overflow"),function(e,t){const r=(0,o.getMediaProperty)(e,"text-overflow",y);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"text-overflow",y),a=(0,o.getVariableName)(e.id,"text-overflow");t.setDefaultValue(a,(0,o.getType)("text-overflow"),n),t.setMediaProperty(a,r),t.mediaProperties.set("textOverflow",new Map([["overflow",a]]))}],[l("text","max-lines"),m("max-lines")],[l("text","line-height"),f("line-height")],[function(e){return"text"===e.type&&(e.hasMediaProperty("decoration-type")||e.hasMediaProperty("decoration-color"))},function(e,t){const r=(0,o.getMediaProperty)(e,"decoration-type",(0,a.curry)(a.getEtsEnumValue)("TextDecorationType.")),n=(0,o.getMediaProperty)(e,"decoration-color",a.dealWithColor);if(0===r.size&&0===n.size)return;let i=(0,o.getMediaDefaultValue)(e,"decoration-type",(0,a.curry)(a.getEtsEnumValue)("TextDecorationType.")),s=(0,o.getMediaDefaultValue)(e,"decoration-color",a.dealWithColor);if(r.size>0){const n=(0,o.getVariableName)(e.id,"decoration-type");t.setDefaultValue(n,(0,o.getType)("decoration-type"),i),t.setMediaProperty(n,r),i=n}if(n.size>0){const r=(0,o.getVariableName)(e.id,"decoration-color");t.setDefaultValue(r,(0,o.getType)("decoration-color"),s),t.setMediaProperty(r,n),s=r}const p=new Map([["type",i]]);t.mediaProperties.set("decoration",p),"undefined"!==s&&p.set("color",s)}],[l("text","baseline-offset"),f("baseline-offset")],[l("text","text-case"),h("text-case","TextCase.")],[l("text","font-size"),f("font-size")],[l("text","font-style"),h("font-style","FontStyle.")],[l("text","font-weight"),M],[l("text","font-family"),f("font-family")]],B=[[l("column","space"),(0,t.stringMediaParamParser)("space")],[l("column","align-items-column"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-column",s.dealWithColumnAlignItems);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-column",s.dealWithColumnAlignItems),a=(0,o.getVariableName)(e.id,"align-items-column");t.setDefaultValue(a,(0,o.getType)("align-items-column"),n),t.setMediaProperty(a,r),t.mediaProperties.set("alignItems",a)}],[l("column","justify-content-rc"),N("justify-content-rc","FlexAlign.")]],D=[[l("row","space"),(0,t.stringMediaParamParser)("space")],[l("row","align-items-row"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-row",s.dealWithRowAlignItems);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-row",s.dealWithRowAlignItems),a=(0,o.getVariableName)(e.id,"align-items-row");t.setDefaultValue(a,(0,o.getType)("align-items-row"),n),t.setMediaProperty(a,r),t.mediaProperties.set("alignItems",a)}],[l("row","justify-content-rc"),N("justify-content-rc","FlexAlign.")]],U=[[l("flex","flex-direction"),function(e,t){const r=(0,o.getMediaProperty)(e,"flex-direction",(0,a.curry)(a.getEtsEnumValue)("FlexDirection."));if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"flex-direction",(0,a.curry)(a.getEtsEnumValue)("FlexDirection.")),i=(0,o.getVariableName)(e.id,"flex-direction");t.setDefaultValue(i,(0,o.getType)("flex-direction"),n),t.setMediaProperty(i,r),t.mediaParams.set("direction",i)}],[l("flex","wrap"),function(e,t){const r=(0,o.getMediaProperty)(e,"wrap",a.dealWithWrap);if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"wrap",a.dealWithWrap),i=(0,o.getVariableName)(e.id,"wrap");t.setDefaultValue(i,(0,o.getType)("wrap"),n),t.setMediaProperty(i,r),t.mediaParams.set("wrap",i)}],[l("flex","justify-content"),_("justify-content","FlexAlign.")],[l("flex","align-items-flex"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-flex",p.dealWithFlexAlignItems);if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-flex",p.dealWithFlexAlignItems),a=(0,o.getVariableName)(e.id,"align-items-flex");t.setDefaultValue(a,(0,o.getType)("align-items-flex"),n),t.setMediaProperty(a,r),t.mediaParams.set("alignItems",a)}],[l("flex","align-content"),_("align-content","FlexAlign.")]],V=[[l("list","space"),(0,t.stringMediaParamParser)("space")],[l("list","initial-index"),(0,t.rawDataMediaParamParser)("initial-index")],[l("list","list-direction"),h("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasMediaProperty("divider-stroke-width")||e.hasMediaProperty("divider-color")||e.hasMediaProperty("divider-start-margin")||e.hasMediaProperty("divider-end-margin"))},function(e,t){const r=[["divider-stroke-width",a.quoteString],["divider-color",a.dealWithColor],["divider-start-margin",a.quoteString],["divider-end-margin",a.quoteString]];let n=0;const i=new Map;for(const[s,p]of r){const r=(0,o.getMediaProperty)(e,s,p),l=(0,a.getEtsPropName)(s.replace("divider-",""));let c=(0,o.getMediaDefaultValue)(e,s,p);if("undefined"===c&&"divider-stroke-width"===s&&(c="0"),r.size>0){const a=(0,o.getVariableName)(e.id,s);t.setDefaultValue(a,(0,o.getType)(s),c),t.setMediaProperty(a,r),c=a,n++}i.set(l,c)}n>0&&t.mediaProperties.set("divider",i)}],[l("list","edit-mode"),g("edit-mode")],[l("list","edge-effect"),h("edge-effect","EdgeEffect.")],[l("list","chain-animation"),g("chain-animation")]],G=[[l("list-item","sticky"),h("sticky","Sticky.")],[l("list-item","editable"),g("editable")]],z=[[l("swiper","index"),m("index")],[l("swiper","auto-play"),g("auto-play")],[l("swiper","interval"),m("interval")],[l("swiper","indicator"),g("indicator")],[l("swiper","loop"),g("loop")],[l("swiper","duration"),m("duration")],[l("swiper","vertical"),g("vertical")],[l("swiper","item-space"),f("item-space")],[l("swiper","cached-count"),m("cached-count")],[l("swiper","disable-swipe"),g("disable-swipe")]],j=[[l("text-input","placeholder"),(0,t.stringMediaParamParser)("placeholder")],[l("text-input","textInput-type"),function(e,t){const r=(0,o.getMediaProperty)(e,"textInput-type",(0,a.curry)(a.getEtsEnumValue)("InputType."));if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"textInput-type",(0,a.curry)(a.getEtsEnumValue)("InputType.")),i=(0,o.getVariableName)(e.id,"textInput-type");t.setDefaultValue(i,(0,o.getType)("textInput-type"),n),t.setMediaProperty(i,r),t.mediaProperties.set("type",i)}],[l("text-input","placeholderColor"),S("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasMediaProperty("placeholderFont-size")||e.hasMediaProperty("placeholderFont-weight")||e.hasMediaProperty("placeholderFont-family")||e.hasMediaProperty("placeholderFont-style"))},function(e,t){const r=[["size",a.quoteString],["weight",c],["family",a.quoteString],["style",(0,a.curry)(a.getEtsEnumValue)("FontStyle.")]];let n=0;const i=new Map;for(const[a,s]of r){const r=`placeholderFont-${a}`,p=(0,o.getMediaProperty)(e,r,s);let l=(0,o.getMediaDefaultValue)(e,r,s);if(p.size>0){const a=(0,o.getVariableName)(e.id,r);t.setDefaultValue(a,(0,o.getType)(r),l),t.setMediaProperty(a,p),l=a,n++}i.set(a,l)}n>0&&t.mediaProperties.set("placeholderFont",i)}],[l("text-input","enterKeyType"),h("enterKeyType","EnterKeyType.")],[l("text-input","caretColor"),S("caretColor")],[l("text-input","maxLength"),m("maxLength")]],W=[[l("refresh","friction"),(0,t.rawDataMediaParamParser)("friction")],[l("refresh","offset"),(0,t.stringMediaParamParser)("offset")],[l("refresh","refreshing"),(0,t.rawDataMediaParamParser)("refreshing")]],$=[[l("timePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[l("timePicker","useMilitaryTime"),g("useMilitaryTime")]],q=[[l("datePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[l("datePicker","start"),(0,t.dateMediaParamParser)("start","start","private")],[l("datePicker","end"),(0,t.dateMediaParamParser)("end","end","private")],[l("datePicker","lunar"),g("lunar")]],H=[[l("textPicker","range"),(0,t.rawDataMediaParamParser)("range")],[l("textPicker","textPicker-selected"),E("textPicker-selected","selected","@State")],[l("textPicker","defaultPickerItemHeight"),f("defaultPickerItemHeight")]],Y=[[l("select","select-option"),function(e,t){!function(e,t,r){const n=e.dynamicProperty.get(r),i=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===i.size)return;const s=null!=n?n:'[{value: ""}]',p=(0,o.getVariableName)(e.id,r);t.setDefaultValue(p,(0,o.getType)(r),s),t.setMediaProperty(p,i),t.setMediaParams(p)}(e,t,"select-option")}],[l("select","select-value"),function(e,t){const r="select-value",n=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,a.quoteString),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaProperties.set("value",s)}],[l("select","selected"),m("selected")],[l("select","font-size"),O("font","size")],[l("select","font-style"),O("font","style")],[l("select","font-family"),O("font","family")],[l("select","font-weight"),O("font","weight")],[l("select","selected-option-font-size"),O("selected-option-font","size")],[l("select","selected-option-font-style"),O("selected-option-font","style")],[l("select","selected-option-font-family"),O("selected-option-font","family")],[l("select","selected-option-font-weight"),O("selected-option-font","weight")],[l("select","selected-option-font-color"),S("selected-option-font-color")],[l("select","selected-option-bg-color"),S("selected-option-bg-color")],[l("select","option-font-size"),O("option-font","size")],[l("select","option-font-style"),O("option-font","style")],[l("select","option-font-family"),O("option-font","family")],[l("select","option-font-weight"),O("option-font","weight")],[l("select","option-font-color"),S("option-font-color")],[l("select","option-bg-color"),S("option-bg-color")]],X=[[l("toggle","toggle-type"),function(e,t){const r="ToggleType.",n="toggle-type",i=(0,o.getMediaProperty)(e,n,(0,a.curry)(a.getEtsEnumValue)(r));if(!(t.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(e,n,(0,a.curry)(a.getEtsEnumValue)(r)),p=(0,o.getVariableName)(e.id,n);t.setDefaultValue(p,(0,o.getType)(n),s),t.setMediaProperty(p,i),t.mediaParams.set("type",p)}],[l("toggle","isOn"),(0,t.rawDataMediaParamParser)("isOn")],[l("toggle","selectedColor"),S("selectedColor")],[l("toggle","switchPointColor"),S("switchPointColor")]],J=[[l("checkbox","select"),g("select")],[l("checkbox","selectedColor"),S("selectedColor")],[l("checkbox","name"),(0,t.stringMediaParamParser)("name")],[l("checkbox","group"),(0,t.stringMediaParamParser)("group")]],Q=[[l("checkboxGroup","selectAll"),g("selectAll")],[l("checkboxGroup","selectedColor"),S("selectedColor")],[l("checkboxGroup","group"),(0,t.stringMediaParamParser)("group")]],K=[[l("scroll","scrollable"),h("scrollable","ScrollDirection.")],[l("scroll","scroll-bar"),h("scroll-bar","BarState.")],[l("scroll","scroll-bar-color"),S("scroll-bar-color")],[l("scroll","scroll-bar-width"),f("scroll-bar-width")],[l("scroll","edge-effect-scroll"),function(e,t){const r="edge-effect-scroll",n=(0,o.getMediaProperty)(e,r,a.dealWithScrollEdgeEffect);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,a.dealWithScrollEdgeEffect),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaProperties.set("edgeEffect",s)}]],Z=[[l("grid","columns-template"),f("columns-template")],[l("grid","rows-template"),f("rows-template")],[l("grid","columns-gap"),f("columns-gap")],[l("grid","rows-gap"),f("rows-gap")],[l("grid","scroll-bar"),h("scroll-bar","BarState.")],[l("grid","scroll-bar-color"),S("scroll-bar-color")],[l("grid","scroll-bar-width"),f("scroll-bar-width")],[l("grid","cached-count"),m("cached-count")],[l("grid","edit-mode"),g("edit-mode")],[l("grid","layout-direction"),h("layout-direction","GridDirection.")],[l("grid","max-count"),m("max-count")],[l("grid","min-count"),m("min-count")],[l("grid","cell-length"),m("cell-length")],[l("grid","multi-selectable"),g("multi-selectable")],[l("grid","support-animation"),g("support-animation")]],ee=[[l("grid-item","row-start"),m("row-start")],[l("grid-item","row-end"),m("row-end")],[l("grid-item","column-start"),m("column-start")],[l("grid-item","column-end"),m("column-end")],[l("grid-item","force-rebuild"),g("force-rebuild")],[l("grid-item","selectable"),g("selectable")]],te=[[l("stack","align-content-stack"),function(e,t){const r="align-content-stack",n=(0,o.getMediaProperty)(e,r,(0,a.curry)(a.getEtsEnumValue)("Alignment."));if(!(t.mediaParams instanceof Map)||0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,(0,a.curry)(a.getEtsEnumValue)("Alignment.")),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaParams.set("alignContent",s)}]],re=[[l("navigation","navigation-title"),v("navigation-title","title")],[l("navigation","subTitle"),f("subTitle")],[l("navigation","menus"),P("menus")],[l("navigation","titleMode"),h("titleMode","NavigationTitleMode.")],[l("navigation","toolBar"),P("toolBar")],[l("navigation","hideToolBar"),g("hideToolBar")],[l("navigation","hideTitleBar"),g("hideTitleBar")],[l("navigation","hideBackButton"),g("hideBackButton")]],oe=[[function(e){return"search"===e.type},function(e,t){const r=[];w("value",r,e,t),w("placeholder",r,e,t),w("icon",r,e,t),w("controller",r,e,t),0!==r.length&&t.setParams(`{${r.join(", ")}}`)}],[l("search","text-font-size"),O("text-font","size")],[l("search","text-font-style"),O("text-font","style")],[l("search","text-font-weight"),O("text-font","weight")],[l("search","text-font-family"),O("text-font","family")],[l("search","placeholder-font-size"),O("placeholder-font","size")],[l("search","placeholder-font-style"),O("placeholder-font","style")],[l("search","placeholder-font-weight"),O("placeholder-font","weight")],[l("search","placeholder-font-family"),O("placeholder-font","family")],[l("search","placeholderColor"),S("placeholderColor")],[l("search","search-text-align"),function(e,t){const r=(0,o.getMediaProperty)(e,"search-text-align",(0,a.curry)(a.getEtsEnumValue)("TextAlign."));if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"search-text-align",(0,a.curry)(a.getEtsEnumValue)("TextAlign.")),i=(0,o.getVariableName)(e.id,"search-text-align");t.setDefaultValue(i,(0,o.getType)("search-text-align"),n),t.setMediaProperty(i,r),t.mediaProperties.set("textAlign",i)}],[l("search","search-button"),f("search-button")],[l("search","copy-option"),h("copy-option","CopyOptions.")]],ne=[[l("tabs","bar-position"),T("bar-position","BarPosition.")],[l("tabs","index"),(0,t.rawDataMediaParamParser)("index")],[l("tabs","controller"),(0,t.rawDataMediaParamParser)("controller")],[l("tabs","vertical"),g("vertical")],[l("tabs","tabs-scrollable"),b("tabs-scrollable","scrollable")],[l("tabs","bar-mode"),h("bar-mode","BarMode.")],[l("tabs","bar-width"),f("bar-width")],[l("tabs","bar-height"),f("bar-height")],[l("tabs","animation-duration"),m("animation-duration")]],ae=[[function(e){return"tab-content"===e.type&&(e.hasMediaProperty("tabBar-icon")||e.hasMediaProperty("tabBar-text"))},function(e,t){const r=(0,o.getMediaProperty)(e,"tabBar-text",a.quoteString),n=(0,o.getMediaProperty)(e,"tabBar-icon",i.dealWithSrc),s=(0,o.getMediaDefaultValue)(e,"tabBar-text",a.quoteString),p=(0,o.getMediaDefaultValue)(e,"tabBar-icon",i.dealWithSrc),l=(0,o.getVariableName)(e.id,"tabBar-text"),c=(0,o.getVariableName)(e.id,"tabBar-icon"),u=new Map([["text",s],["icon",p]]);r.size>0&&(t.setDefaultValue(l,(0,o.getType)("tabBar-text"),s),t.setMediaProperty(l,r),u.set("text",l)),n.size>0&&(t.setDefaultValue(c,(0,o.getType)("tabBar-icon"),p),t.setMediaProperty(c,n),u.set("icon",c)),t.mediaProperties.set("tabBar",u)}]];t.componentsMediaParserArray=[...R,...I,...x,...L,...F,...k,...B,...D,...U,...V,...G,...z,...j,...X,...W,...$,...H,...Y,...q,...te,...K,...Z,...ee,...re,...oe,...ne,...ae,...J,...Q]},366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCustomMediaVisualModel=void 0;const o=r(6125),n=r(3135),a=r(6282),i=r(1195),s=r(8122);t.parseCustomMediaVisualModel=function(e,t){(0,i.getCustomAttributeMap)().forEach(((r,n)=>{if(function(e,t){return e.hasMediaProperty(t)}(e,n)){const l=p.get(r.type);"function"==typeof l&&l(n,e,t);const c=o.enumParserMap.get(r.type);"function"==typeof c&&function(e,t,r,o){const n=(0,a.getMediaProperty)(t,e,o);if(!(r.mediaParams instanceof Map)||0===n.size)return;const p=(0,a.getMediaDefaultValue)(t,e,o),l=(0,a.getVariableName)(t.id,e);r.setDefaultValue(l,(0,a.getType)(e),p),r.setMediaProperty(l,n),r.mediaParams.set((0,s.getEtsPropName)(e),(0,i.getDynamicValueByDecorator)(e,l))}(n,e,t,c)}}))};const p=new Map([["string",n.stringMediaParamParser],["boolean",n.rawDataMediaParamParser],["number",n.rawDataMediaParamParser],["any[]",n.rawDataMediaParamParser],["object",n.rawDataMediaParamParser],["Date",function(e,t,r){(0,n.dateMediaParamParser)(e,(0,s.getEtsPropName)(e),"private",t,r)}]])},3729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMediaProperty=t.parseMediaVisualModel=void 0;const o=r(1912),n=r(9223),a=r(3135);function i(e,t,r){const o=t.get(r);return void 0!==o&&o.has(e)}t.parseMediaVisualModel=function(e,t){(0,n.forEachParser)(e,t),(0,n.ifParser)(e,t);for(const r of p)("boolean"==typeof r[0]||r[0](e))&&r[1](e,t)},t.isMediaProperty=function(e,t){return!i(e,s,"common")&&!i(e,s,t)&&!i(e,s,"events")};const s=new Map([["common",new Set(["keyGenerator","item","idx"])],["events",new Set([...o.events])]]),p=[...n.commonMediaParserArray,...a.componentsMediaParserArray]},6282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMediaDefaultValue=t.getVariableName=t.getMediaProperty=t.getType=void 0;const o=r(4294),n=r(1290),a=r(1195),i=r(8122);function s(e,t){for(const r of t)if(r.property===e)return r.etsType;return""}t.getType=function(e){const t=e+"-visual",r=n.etsPropertyList;let o="";for(const e of r)if(void 0!==e.propertySet.properties&&(o=s(t,e.propertySet.properties)),e.propertySet.property===t&&(o=e.propertySet.etsType),""!==o)break;return""!==o?function(e=""){const t=new Map([["Rfloat","Resource"],["Rstring","Resource"],["Rcolor","Resource"],["Rmedia","Resource"],["Rrawfile","Resource"],["Rplural","Resource"],["ETSArray","any[]"]]),r=new Array;return e.split("|").forEach((e=>{const o=t.get(e),n=null!=o?o:e;r.includes(n)||r.push(null!=o?o:e)})),r.join(" | ")}(o):(0,a.getCustomAttrType)(e)},t.getMediaProperty=function(e,t,r){var o,n;const a=new Map;return(null!==(o=e.mediaProperty)&&void 0!==o?o:new Map).forEach(((e,o)=>{let n=e.get(t);(0,i.isEmptyOrUndefined)(n)||("function"==typeof r&&(n=r(n)),(0,i.isEmptyOrUndefined)(n)||a.set(o,n))})),(null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map).forEach(((e,r)=>{let o=e.get(t);void 0===o||"content"!==t&&"label"!==t||(o=(0,i.getContentName)(o)),(0,i.isEmptyOrUndefined)(o)||a.set(r,o)})),a},t.getVariableName=function(e,t){const r=(0,o.getTagName)(e),n=`this.${(0,i.getEtsPropName)(r)}${(0,i.firstUpperCase)((0,i.getEtsPropName)(t))}`;return`${n}_${(0,o.getUniqueId)(n)}`},t.getMediaDefaultValue=function(e,t,r){var o;const n=e.property.get(t),a=e.dynamicProperty.get(t);let s=null!==(o=new Map([["if","true"],["auto-play","false"],["interval","3000"],["select-value","''"],["columns-template","''"],["rows-template","''"],["tabBar-icon","''"],["tabBar-text","'TabBar'"]]).get(t))&&void 0!==o?o:"undefined";return(0,i.isEmptyOrUndefined)(n)||(s="function"==typeof r?r(n):n,s=(0,i.isEmptyOrUndefined)(s)?"undefined":s),(0,i.isEmptyOrUndefined)(a)||(s=a),s}},7893:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseBuildersVisualModel=void 0;const o=r(8122);t.parseBuildersVisualModel=function(e,t,r){const n=e.slots;void 0!==n&&0!==n.size&&n.forEach(((n,a)=>{const i=(0,o.getBuilderUniqueName)(e.id,a);t.properties.set(a,`this.${i}`),t.builders.set(i,r.visit(n))}))}},8916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buttonParserArray=void 0;const o=r(8122);t.buttonParserArray=[[(0,o.hasFeatureProperty)("button","label"),o.labelParamParser],[(0,o.hasFeatureProperty)("button","type"),(0,o.enumPropertyParser)("type","ButtonType.")],[(0,o.hasFeatureProperty)("button","state-effect"),(0,o.booleanPropertyParser)("state-effect")],[(0,o.hasFeatureProperty)("button","font-size"),(0,o.stringPropertyParser)("font-size")],[(0,o.hasFeatureProperty)("button","font-style"),(0,o.enumPropertyParser)("font-style","FontStyle.")],[(0,o.hasFeatureProperty)("button","font-weight"),o.fontWeightPropertyParser],[(0,o.hasFeatureProperty)("button","font-family"),(0,o.stringPropertyParser)("font-family")]]},1147:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxGroupParseArray=void 0;const o=r(8122);t.checkboxGroupParseArray=[[(0,o.hasFeatureProperty)("checkboxGroup","selectAll"),(0,o.booleanPropertyParser)("selectAll")],[(0,o.hasFeatureProperty)("checkboxGroup","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("checkboxGroup","group"),(0,o.stringParamParser)("group")]]},2218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxParseArray=void 0;const o=r(8122);t.checkboxParseArray=[[(0,o.hasFeatureProperty)("checkbox","select"),(0,o.booleanPropertyParser)("select")],[(0,o.hasFeatureProperty)("checkbox","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("checkbox","name"),(0,o.stringParamParser)("name")],[(0,o.hasFeatureProperty)("checkbox","group"),(0,o.stringParamParser)("group")]]},7150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonParserArray=void 0;const o=r(8122),n=r(9248);function a(e,t,r,n=!1){(0,o.isEmptyOrUndefined)(t)||r.set(e,n?t:(0,o.quoteString)(t))}function i(e,t,r,n,a){const i=e.getProperty(t),s=e.getProperty(r),p=e.dynamicProperty.has(t),l=e.dynamicProperty.has(r),c=(0,o.getEdgeBorderDirection)(r);(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||n.set(c,p?i:a(i)):n.set(c,l?s:a(s))}t.commonParserArray=[[(0,o.hasCommonProperty)("width"),(0,o.stringPropertyParser)("width")],[(0,o.hasCommonProperty)("height"),(0,o.stringPropertyParser)("height")],[function(e){return e.hasProperty("constraint-size-min-width")||e.hasProperty("constraint-size-max-width")||e.hasProperty("constraint-size-min-height")||e.hasProperty("constraint-size-max-height")},function(e,t){const r=new Map,o=e.getProperty("constraint-size-min-width"),n=e.getProperty("constraint-size-max-width"),i=e.getProperty("constraint-size-min-height"),s=e.getProperty("constraint-size-max-height");a("minWidth",o,r,e.dynamicProperty.has("constraint-size-min-width")),a("maxWidth",n,r,e.dynamicProperty.has("constraint-size-max-width")),a("minHeight",i,r,e.dynamicProperty.has("constraint-size-min-height")),a("maxHeight",s,r,e.dynamicProperty.has("constraint-size-max-height")),r.size>0&&t.properties.set("constraintSize",r)}],[(0,o.hasCommonProperty)("align"),(0,o.enumPropertyParser)("align","Alignment.")],[(0,o.hasCommonProperty)("direction"),(0,o.enumPropertyParser)("direction","Direction.")],[function(e){return e.hasProperty("left")||e.hasProperty("top")},function(e,t){const r="absolute"===e.property.get("position")?"position":"offset",n=e.property.get("left"),a=e.property.get("top"),i=e.dynamicProperty.get("left"),s=e.dynamicProperty.get("top");if((0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(n)&&(0,o.isEmptyOrUndefined)(a))return;const p=new Map([["x",`${(0,o.quoteString)(null!=n?n:"0")}`],["y",`${(0,o.quoteString)(null!=a?a:"0")}`]]);(0,o.isEmptyOrUndefined)(i)||p.set("x",i),(0,o.isEmptyOrUndefined)(s)||p.set("y",s),t.properties.set(r,p)}],[(0,o.hasCommonProperty)("aspect-ratio"),(0,o.numberPropertyParser)("aspect-ratio")],[(0,o.hasCommonProperty)("display-priority"),(0,o.numberPropertyParser)("display-priority")],[(0,o.hasCommonProperty)("flex-basis"),(0,o.stringPropertyParser)("flex-basis")],[(0,o.hasCommonProperty)("flex-grow"),(0,o.numberPropertyParser)("flex-grow")],[(0,o.hasCommonProperty)("flex-shrink"),(0,o.numberPropertyParser)("flex-shrink")],[(0,o.hasCommonProperty)("align-self"),function(e,t){const r=e.dynamicProperty.get("align-self");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignSelf",r);const n=e.property.get("align-self");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.dealWithAlignSelf)(n);t.properties.set("alignSelf",a)}],[function(e){return e.hasProperty("border-style")||e.hasProperty("border-top-style")||e.hasProperty("border-right-style")||e.hasProperty("border-bottom-style")||e.hasProperty("border-left-style")},function(e,t){const r=new Map,n=e.getProperty("border-style"),a=e.getProperty("border-top-style"),s=e.getProperty("border-bottom-style"),p=e.getProperty("border-left-style"),l=e.getProperty("border-right-style"),c=e.dynamicProperty.has("border-style"),u=(0,o.getBorderDirections)("border-style");for(const t of u)i(e,"border-style",t,r,(0,o.curry)(o.getEtsEnumValue)("BorderStyle."));(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-style"),c?n:(0,o.getEtsEnumValue)("BorderStyle.",n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-style"),r)}],[function(e){return e.hasProperty("border-width")||e.hasProperty("border-top-width")||e.hasProperty("border-right-width")||e.hasProperty("border-bottom-width")||e.hasProperty("border-left-width")},function(e,t){const r=new Map,n=e.getProperty("border-width"),i=e.getProperty("border-top-width"),s=e.getProperty("border-bottom-width"),p=e.getProperty("border-left-width"),l=e.getProperty("border-right-width"),c=e.property.has("border-top-width"),u=e.property.has("border-bottom-width"),y=e.property.has("border-left-width"),d=e.property.has("border-right-width"),f=e.dynamicProperty.has("border-width"),m=e.dynamicProperty.has("border-top-width"),g=e.dynamicProperty.has("border-bottom-width"),h=e.dynamicProperty.has("border-left-width"),E=e.dynamicProperty.has("border-right-width");(0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-width"),f?n:(0,o.quoteString)(n)):(a("top",null!=i?i:n,r,m||!c&&f),a("bottom",null!=s?s:n,r,g||!u&&f),a("left",null!=p?p:n,r,h||!y&&f),a("right",null!=l?l:n,r,E||!d&&f),r.size>0&&t.properties.set((0,o.getEtsPropName)("border-width"),r))}],[function(e){return e.hasProperty("border-color")||e.hasProperty("border-top-color")||e.hasProperty("border-right-color")||e.hasProperty("border-bottom-color")||e.hasProperty("border-left-color")},function(e,t){const r=new Map,n=e.getProperty("border-color"),a=e.getProperty("border-top-color"),s=e.getProperty("border-bottom-color"),p=e.getProperty("border-left-color"),l=e.getProperty("border-right-color"),c=e.dynamicProperty.has("border-color"),u=(0,o.getBorderDirections)("border-color");for(const t of u)i(e,"border-color",t,r,o.dealWithColor);(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-color"),c?n:(0,o.dealWithColor)(n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-color"),r)}],[function(e){return e.hasProperty("border-radius")||e.hasProperty("border-top-left-radius")||e.hasProperty("border-top-right-radius")||e.hasProperty("border-bottom-right-radius")||e.hasProperty("border-bottom-left-radius")},function(e,t){const r=new Map,n=e.getProperty("border-radius"),a=e.getProperty("border-top-left-radius"),s=e.getProperty("border-top-right-radius"),p=e.getProperty("border-bottom-left-radius"),l=e.getProperty("border-bottom-right-radius"),c=e.dynamicProperty.has("border-radius"),u=(0,o.getBorderDirections)("border-radius");for(const t of u)i(e,"border-radius",t,r,o.quoteString);(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-radius"),c?n:(0,o.quoteString)(n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-radius"),r)}],[(0,o.hasCommonProperty)("background-color"),(0,o.colorPropertyParser)("background-color")],[function(e){return e.hasProperty("background-image-src")||e.hasProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),a=e.property.get("background-image-repeat"),i=e.dynamicProperty.get("background-image-src"),s=e.dynamicProperty.get("background-image-repeat");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s))return;let p=(0,n.dealWithSrc)(null!=r?r:"");if((0,o.isEmptyOrUndefined)(i)||(p=i),(0,o.isEmptyOrUndefined)(s)){if(!(0,o.isEmptyOrUndefined)(a)){const e=(0,o.dealWithBackgroundRepeat)(a);null!=e&&""!==e&&(p=p+", "+e)}}else p=p+", "+s;t.properties.set("backgroundImage",p)}],[(0,o.hasCommonProperty)("background-image-size"),function(e,t){const r=e.dynamicProperty.get("background-image-size");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("backgroundImageSize",r);const n=e.property.get("background-image-size");if((0,o.isEmptyOrUndefined)(n))return;if(""!==(0,o.getBackgroundImageSizeEnumValue)(n))return void t.properties.set("backgroundImageSize",(0,o.getEtsEnumValue)("ImageSize.",n));const a=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);null!==a&&(void 0!==a[5]?t.properties.set("backgroundImageSize",new Map([["width",`${(0,o.quoteString)(a[1])}`],["height",`${(0,o.quoteString)(a[5])}`]])):t.properties.set("backgroundImageSize",new Map([["width",`${(0,o.quoteString)(a[1])}`]])))}],[(0,o.hasCommonProperty)("background-image-position"),function(e,t){const r=e.dynamicProperty.get("background-image-position");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("backgroundImagePosition",r);const n=e.property.get("background-image-position");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.getBackgroundImagePositionEnumValue)(n);if(""!==a)return void t.properties.set("backgroundImagePosition",a);const i=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);null!==i&&t.properties.set("backgroundImagePosition",new Map([["x",`${(0,o.quoteString)(i[1])}`],["y",`${(0,o.quoteString)(i[4])}`]]))}],[(0,o.hasCommonProperty)("opacity"),(0,o.numberPropertyParser)("opacity")],[(0,o.hasCommonProperty)("visibility"),(0,o.enumPropertyParser)("visibility","Visibility.")],[(0,o.hasCommonProperty)("enabled"),(0,o.booleanPropertyParser)("enabled")],[(0,o.hasCommonProperty)("font-color"),(0,o.colorPropertyParser)("font-color")],[function(e){return e.hasProperty("margin")||e.hasProperty("margin-left")||e.hasProperty("margin-top")||e.hasProperty("margin-right")||e.hasProperty("margin-bottom")},function(e,t){var r,o,n,i;const s=new Map,p=e.getProperty("margin"),l=null!==(r=e.getProperty("margin-top"))&&void 0!==r?r:p,c=null!==(o=e.getProperty("margin-bottom"))&&void 0!==o?o:p,u=null!==(n=e.getProperty("margin-left"))&&void 0!==n?n:p,y=null!==(i=e.getProperty("margin-right"))&&void 0!==i?i:p,d=e.property.has("margin-top"),f=e.property.has("margin-bottom"),m=e.property.has("margin-left"),g=e.property.has("margin-right"),h=e.dynamicProperty.has("margin"),E=e.dynamicProperty.has("margin-top"),T=e.dynamicProperty.has("margin-bottom"),S=e.dynamicProperty.has("margin-left"),P=e.dynamicProperty.has("margin-right");a("top",l,s,E||!d&&h),a("bottom",c,s,T||!f&&h),a("left",u,s,S||!m&&h),a("right",y,s,P||!g&&h),s.size>0&&t.properties.set("margin",s)}],[function(e){return e.hasProperty("padding")||e.hasProperty("padding-left")||e.hasProperty("padding-top")||e.hasProperty("padding-right")||e.hasProperty("padding-bottom")},function(e,t){var r,o,n,i;const s=new Map,p=e.getProperty("padding"),l=null!==(r=e.getProperty("padding-top"))&&void 0!==r?r:p,c=null!==(o=e.getProperty("padding-bottom"))&&void 0!==o?o:p,u=null!==(n=e.getProperty("padding-left"))&&void 0!==n?n:p,y=null!==(i=e.getProperty("padding-right"))&&void 0!==i?i:p,d=e.property.has("padding-top"),f=e.property.has("padding-bottom"),m=e.property.has("padding-left"),g=e.property.has("padding-right"),h=e.dynamicProperty.has("padding"),E=e.dynamicProperty.has("padding-top"),T=e.dynamicProperty.has("padding-bottom"),S=e.dynamicProperty.has("padding-left"),P=e.dynamicProperty.has("padding-right");a("top",l,s,E||!d&&h),a("bottom",c,s,T||!f&&h),a("left",u,s,S||!m&&h),a("right",y,s,P||!g&&h),s.size>0&&t.properties.set("padding",s)}]]},1778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dividerParserArray=void 0;const o=r(8122);t.dividerParserArray=[[(0,o.hasFeatureProperty)("divider","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("divider","color"),(0,o.colorPropertyParser)("color")],[(0,o.hasFeatureProperty)("divider","stroke-width"),(0,o.stringPropertyParser)("stroke-width")],[(0,o.hasFeatureProperty)("divider","line-cap"),(0,o.enumPropertyParser)("line-cap","LineCapStyle.")]]},5264:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithFlexAlignItems=t.flexParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t,r,n)=>{if(!(n.params instanceof Map))return;const a=r.dynamicProperty.get(e);if(!(0,o.isEmptyOrUndefined)(a))return void n.params.set((0,o.getEtsPropName)(e),a);const i=r.property.get(e);if((0,o.isEmptyOrUndefined)(i))return;let s=(0,o.getEtsEnumValue)(t,i);"flex-start"===i?s=t+"Start":"flex-end"===i&&(s=t+"End"),n.params.set((0,o.getEtsPropName)(e),s)}));function a(e){let t=(0,o.getEtsEnumValue)("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}t.flexParserArray=[[(0,o.hasFeatureProperty)("flex","flex-direction"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("flex-direction");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("direction",r);const n=e.property.get("flex-direction");(0,o.isEmptyOrUndefined)(n)||t.params.set("direction",(0,o.getEtsEnumValue)("FlexDirection.",n))}],[(0,o.hasFeatureProperty)("flex","wrap"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("wrap");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("wrap",r);const n=e.property.get("wrap");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.dealWithWrap)(n);t.params.set("wrap",a)}],[(0,o.hasFeatureProperty)("flex","justify-content"),n("justify-content","FlexAlign.")],[(0,o.hasFeatureProperty)("flex","align-items-flex"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-items-flex");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("alignItems",r);const n=e.property.get("align-items-flex");if((0,o.isEmptyOrUndefined)(n))return;const i=a(n);t.params.set("alignItems",i)}],[(0,o.hasFeatureProperty)("flex","align-content"),n("align-content","FlexAlign.")]],t.dealWithFlexAlignItems=a},2153:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridItemParserArray=t.gridParserArray=void 0;const o=r(8122);t.gridParserArray=[[(0,o.hasFeatureProperty)("grid","scroller"),o.scrollerParamParser],[(0,o.hasFeatureProperty)("grid","columns-template"),(0,o.stringPropertyParser)("columns-template")],[(0,o.hasFeatureProperty)("grid","rows-template"),(0,o.stringPropertyParser)("rows-template")],[(0,o.hasFeatureProperty)("grid","columns-gap"),(0,o.stringPropertyParser)("columns-gap")],[(0,o.hasFeatureProperty)("grid","rows-gap"),(0,o.stringPropertyParser)("rows-gap")],[(0,o.hasFeatureProperty)("grid","scroll-bar"),(0,o.enumPropertyParser)("scroll-bar","BarState.")],[(0,o.hasFeatureProperty)("grid","scroll-bar-color"),(0,o.colorPropertyParser)("scroll-bar-color")],[(0,o.hasFeatureProperty)("grid","scroll-bar-width"),(0,o.stringPropertyParser)("scroll-bar-width")],[(0,o.hasFeatureProperty)("grid","cached-count"),(0,o.numberPropertyParser)("cached-count")],[(0,o.hasFeatureProperty)("grid","edit-mode"),(0,o.booleanPropertyParser)("edit-mode")],[(0,o.hasFeatureProperty)("grid","layout-direction"),(0,o.enumPropertyParser)("layout-direction","GridDirection.")],[(0,o.hasFeatureProperty)("grid","max-count"),(0,o.numberPropertyParser)("max-count")],[(0,o.hasFeatureProperty)("grid","min-count"),(0,o.numberPropertyParser)("min-count")],[(0,o.hasFeatureProperty)("grid","cell-length"),(0,o.numberPropertyParser)("cell-length")],[(0,o.hasFeatureProperty)("grid","multi-selectable"),(0,o.booleanPropertyParser)("multi-selectable")],[(0,o.hasFeatureProperty)("grid","support-animation"),(0,o.booleanPropertyParser)("support-animation")]],t.gridItemParserArray=[[(0,o.hasFeatureProperty)("grid-item","row-start"),(0,o.numberPropertyParser)("row-start")],[(0,o.hasFeatureProperty)("grid-item","row-end"),(0,o.numberPropertyParser)("row-end")],[(0,o.hasFeatureProperty)("grid-item","column-start"),(0,o.numberPropertyParser)("column-start")],[(0,o.hasFeatureProperty)("grid-item","column-end"),(0,o.numberPropertyParser)("column-end")],[(0,o.hasFeatureProperty)("grid-item","force-rebuild"),(0,o.booleanPropertyParser)("force-rebuild")],[(0,o.hasFeatureProperty)("grid-item","selectable"),(0,o.booleanPropertyParser)("selectable")]]},9248:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithSrc=t.imageParserArray=t.isTargetComponent=void 0;const o=r(8122);function n(e){return null===e.match(/\$(r|rawfile)\('(.*)'\)$/)?(0,o.quoteString)(e):e}t.isTargetComponent=(0,o.curry)(((e,t)=>t.type===e)),t.imageParserArray=[[(0,t.isTargetComponent)("image"),function(e,t){var r;const a=e.dynamicProperty.get("src");if(!(0,o.isEmptyOrUndefined)(a))return void t.setParams(a);const i=null!==(r=e.property.get("src"))&&void 0!==r?r:"";t.setParams(n(i))}],[(0,o.hasFeatureProperty)("image","alt"),(0,o.stringPropertyParser)("alt")],[(0,o.hasFeatureProperty)("image","object-fit"),(0,o.enumPropertyParser)("object-fit","ImageFit.")],[(0,o.hasFeatureProperty)("image","object-repeat"),(0,o.enumPropertyParser)("object-repeat","ImageRepeat.")],[(0,o.hasFeatureProperty)("image","interpolation"),(0,o.enumPropertyParser)("interpolation","ImageInterpolation.")],[(0,o.hasFeatureProperty)("image","render-mode"),(0,o.enumPropertyParser)("render-mode","ImageRenderMode.")],[function(e){return e.hasProperty("source-size-width")||e.hasProperty("source-size-height")},function(e,t){let r=e.getProperty("source-size-width"),n=e.getProperty("source-size-height");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(n))return;const a=e.dynamicProperty.has("source-size-width"),i=e.dynamicProperty.has("source-size-height");r="0"===r||(0,o.isEmptyOrUndefined)(r)?"0":a?r:r.substring(0,r.length-2),n="0"===n||(0,o.isEmptyOrUndefined)(n)?"0":i?n:n.substring(0,n.length-2);const s=new Map([["width",r],["height",n]]);t.properties.set("sourceSize",s)}]],t.dealWithSrc=n},7907:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemParserArray=t.listParserArray=void 0;const o=r(8122);t.listParserArray=[[(0,o.hasFeatureProperty)("list","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("list","initial-index"),(0,o.rawDataParamParser)("initial-index")],[(0,o.hasFeatureProperty)("list","list-direction"),(0,o.enumPropertyParser)("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasProperty("divider-stroke-width")||e.hasProperty("divider-color")||e.hasProperty("divider-start-margin")||e.hasProperty("divider-end-margin"))},function(e,t){const r=e.property.get("divider-stroke-width"),n=e.dynamicProperty.get("divider-stroke-width"),a=new Map([["strokeWidth",`${(0,o.quoteString)(null!=r?r:"0")}`]]);(0,o.isEmptyOrUndefined)(n)||a.set("strokeWidth",n);const i=e.property.get("divider-color"),s=e.dynamicProperty.get("divider-color"),p=e.property.get("divider-start-margin"),l=e.dynamicProperty.get("divider-start-margin"),c=e.property.get("divider-end-margin"),u=e.dynamicProperty.get("divider-end-margin");(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||a.set("color",(0,o.dealWithColor)(i)):a.set("color",s),(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(p)||a.set("startMargin",(0,o.quoteString)(p)):a.set("startMargin",l),(0,o.isEmptyOrUndefined)(u)?(0,o.isEmptyOrUndefined)(c)||a.set("endMargin",(0,o.quoteString)(c)):a.set("endMargin",u),t.properties.set("divider",a)}],[(0,o.hasFeatureProperty)("list","edit-mode"),(0,o.booleanPropertyParser)("edit-mode")],[(0,o.hasFeatureProperty)("list","edge-effect"),(0,o.enumPropertyParser)("edge-effect","EdgeEffect.")],[(0,o.hasFeatureProperty)("list","chain-animation"),(0,o.booleanPropertyParser)("chain-animation")]],t.listItemParserArray=[[(0,o.hasFeatureProperty)("list-item","sticky"),(0,o.enumPropertyParser)("sticky","Sticky.")],[(0,o.hasFeatureProperty)("list-item","editable"),(0,o.booleanPropertyParser)("editable")]]},8191:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.navigationParserArray=void 0;const o=r(8122);t.navigationParserArray=[[(0,o.hasFeatureProperty)("navigation","navigation-title"),function(e,t){const r=e.getProperty("navigation-title"),n=e.dynamicProperty.get("navigation-title");(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||t.properties.set("title",(0,o.quoteString)(r)):t.properties.set("title",n)}],[(0,o.hasFeatureProperty)("navigation","subTitle"),(0,o.stringPropertyParser)("subTitle")],[(0,o.hasFeatureProperty)("navigation","menus"),(0,o.objectPropertyParser)("menus")],[(0,o.hasFeatureProperty)("navigation","titleMode"),(0,o.enumPropertyParser)("titleMode","NavigationTitleMode.")],[(0,o.hasFeatureProperty)("navigation","toolBar"),(0,o.objectPropertyParser)("toolBar")],[(0,o.hasFeatureProperty)("navigation","hideToolBar"),(0,o.booleanPropertyParser)("hideToolBar")],[(0,o.hasFeatureProperty)("navigation","hideTitleBar"),(0,o.booleanPropertyParser)("hideTitleBar")],[(0,o.hasFeatureProperty)("navigation","hideBackButton"),(0,o.booleanPropertyParser)("hideBackButton")]]},2565:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textPickerParserArray=t.datePickerParserArray=t.timePickerParserArray=void 0;const o=r(8122);t.timePickerParserArray=[[(0,o.hasFeatureProperty)("timePicker","datetime-selected"),(0,o.dateParamParser)("datetime-selected","selected")],[(0,o.hasFeatureProperty)("timePicker","useMilitaryTime"),(0,o.booleanPropertyParser)("useMilitaryTime")]],t.datePickerParserArray=[[(0,o.hasFeatureProperty)("datePicker","datetime-selected"),(0,o.dateParamParser)("datetime-selected","selected")],[(0,o.hasFeatureProperty)("datePicker","start"),(0,o.dateParamParser)("start","start")],[(0,o.hasFeatureProperty)("datePicker","end"),(0,o.dateParamParser)("end","end")],[(0,o.hasFeatureProperty)("datePicker","lunar"),(0,o.booleanPropertyParser)("lunar")]],t.textPickerParserArray=[[(0,o.hasFeatureProperty)("textPicker","range"),(0,o.arrayParamParser)("range")],[(0,o.hasFeatureProperty)("textPicker","textPicker-selected"),(0,o.customRawDataParamParser)("textPicker-selected","selected")],[(0,o.hasFeatureProperty)("textPicker","defaultPickerItemHeight"),(0,o.stringPropertyParser)("defaultPickerItemHeight")]]},8483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.progressParserArray=void 0;const o=r(8122);t.progressParserArray=[[function(e){return"progress"===e.type&&(e.hasProperty("value")||e.hasProperty("total")||e.hasProperty("style"))},function(e,t){var r;(0,o.dynamicParamParser)("value",e,t)||t.params instanceof Map&&t.params.set("value",null!==(r=e.getProperty("value"))&&void 0!==r?r:"0")}],[(0,o.hasFeatureProperty)("progress","total"),(0,o.rawDataParamParser)("total")],[(0,o.hasFeatureProperty)("progress","style"),(0,o.enumParamParser)("style","ProgressStyle.")],[(0,o.hasFeatureProperty)("progress","color"),(0,o.colorPropertyParser)("color")]]},4925:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshParserArray=void 0;const o=r(8122);t.refreshParserArray=[[(0,o.hasFeatureProperty)("refresh","friction"),(0,o.rawDataParamParser)("friction")],[(0,o.hasFeatureProperty)("refresh","offset"),(0,o.stringParamParser)("offset")],[(0,o.hasFeatureProperty)("refresh","refreshing"),(0,o.booleanParamParser)("refreshing")]]},1790:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithRowAlignItems=t.dealWithColumnAlignItems=t.rowParserArray=t.columnParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t,r,n)=>{if(!(n.properties instanceof Map))return;const a=r.dynamicProperty.get(e);if(!(0,o.isEmptyOrUndefined)(a))return void n.properties.set("justifyContent",a);const i=r.property.get(e);if((0,o.isEmptyOrUndefined)(i))return;let s=(0,o.getEtsEnumValue)(t,i);"flex-start"===i?s=t+"Start":"flex-end"===i&&(s=t+"End"),n.properties.set("justifyContent",s)}));function a(e){let t=(0,o.getEtsEnumValue)("HorizontalAlign.",e);return"flex-start"===e?t="HorizontalAlign.Start":"flex-end"===e&&(t="HorizontalAlign.End"),t}function i(e){let t=(0,o.getEtsEnumValue)("VerticalAlign.",e);return"flex-start"===e?t="VerticalAlign.Top":"flex-end"===e&&(t="VerticalAlign.Bottom"),t}t.columnParserArray=[[(0,o.hasFeatureProperty)("column","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("column","align-items-column"),function(e,t){const r=e.dynamicProperty.get("align-items-column");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-column");if((0,o.isEmptyOrUndefined)(n))return;const i=a(n);t.properties.set("alignItems",i)}],[(0,o.hasFeatureProperty)("column","justify-content-rc"),n("justify-content-rc","FlexAlign.")]],t.rowParserArray=[[(0,o.hasFeatureProperty)("row","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("row","align-items-row"),function(e,t){const r=e.dynamicProperty.get("align-items-row");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-row");if((0,o.isEmptyOrUndefined)(n))return;const a=i(n);t.properties.set("alignItems",a)}],[(0,o.hasFeatureProperty)("row","justify-content-rc"),n("justify-content-rc","FlexAlign.")]],t.dealWithColumnAlignItems=a,t.dealWithRowAlignItems=i},7375:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollParserArray=void 0;const o=r(8122);t.scrollParserArray=[[(0,o.hasFeatureProperty)("scroll","scrollable"),(0,o.enumPropertyParser)("scrollable","ScrollDirection.")],[(0,o.hasFeatureProperty)("scroll","scroll-bar"),(0,o.enumPropertyParser)("scroll-bar","BarState.")],[(0,o.hasFeatureProperty)("scroll","scroll-bar-color"),(0,o.colorPropertyParser)("scroll-bar-color")],[(0,o.hasFeatureProperty)("scroll","scroll-bar-width"),(0,o.stringPropertyParser)("scroll-bar-width")],[(0,o.hasFeatureProperty)("scroll","edge-effect-scroll"),function(e,t){const r="edge-effect-scroll";if((0,o.dynamicPropertyParser)(r,e,t))return;const n=e.property.get(r);(0,o.isEmptyOrUndefined)(n)||t.properties.set("edgeEffect",(0,o.getEtsEnumValue)("EdgeEffect.",n))}],[(0,o.hasFeatureProperty)("scroll","scroller"),o.scrollerParamParser]]},9284:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchParserArray=void 0;const o=r(8122),n=r(8014);function a(e,t,r,n){const a=new Map([["value","search-value"],["placeholder","search-placeholder"],["icon","icon"],["controller","search-controller"]]).get(e);if(void 0===a)return;const i=r.getProperty(a),s=r.dynamicProperty.get(a);"controller"!==e||(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||t.push(`${e}: ${(0,o.quoteString)(i)}`):t.push(`${e}: ${(0,o.getContentName)(s)}`):t.push(`${e}: ${s}`)}t.searchParserArray=[[(0,o.hasFeatureProperty)("search","text-font-size"),(0,n.selectFontParser)("text-font","size")],[(0,o.hasFeatureProperty)("search","text-font-style"),(0,n.selectFontParser)("text-font","style")],[(0,o.hasFeatureProperty)("search","text-font-weight"),(0,n.selectFontParser)("text-font","weight")],[(0,o.hasFeatureProperty)("search","text-font-family"),(0,n.selectFontParser)("text-font","family")],[(0,o.hasFeatureProperty)("search","placeholder-font-size"),(0,n.selectFontParser)("placeholder-font","size")],[(0,o.hasFeatureProperty)("search","placeholder-font-style"),(0,n.selectFontParser)("placeholder-font","style")],[(0,o.hasFeatureProperty)("search","placeholder-font-weight"),(0,n.selectFontParser)("placeholder-font","weight")],[(0,o.hasFeatureProperty)("search","placeholder-font-family"),(0,n.selectFontParser)("placeholder-font","family")],[(0,o.hasFeatureProperty)("search","placeholderColor"),(0,o.colorPropertyParser)("placeholderColor")],[(0,o.hasFeatureProperty)("search","search-text-align"),o.searchTextAlign],[function(e){return"search"===e.type},function(e,t){const r=[];a("value",r,e),a("placeholder",r,e),a("icon",r,e),a("controller",r,e),t.setParams(`{${r.join(", ")}}`)}],[(0,o.hasFeatureProperty)("search","search-button"),(0,o.stringPropertyParser)("search-button")],[(0,o.hasFeatureProperty)("search","copy-option"),(0,o.enumPropertyParser)("copy-option","CopyOptions.")]]},8014:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectParserArray=t.selectFontParser=void 0;const o=r(8122);t.selectFontParser=(0,o.curry)(((e,t,r,n)=>{let a=n.properties.get((0,o.getEtsPropName)(e));void 0===a&&(a=new Map);const i=`${e}-${t}`,s=r.property.get(i),p=r.dynamicProperty.get(i);"string"!=typeof a&&((0,o.isEmptyOrUndefined)(p)?(0,o.isEmptyOrUndefined)(s)||("size"!==t&&"family"!==t||a.set(t,(0,o.quoteString)(s)),"style"===t&&a.set(t,(0,o.getEtsEnumValue)("FontStyle.",s)),"weight"===t&&a.set(t,(0,o.dealWithFontWeight)(s))):a.set(t,p)),n.properties.set((0,o.getEtsPropName)(e),a)})),t.selectParserArray=[[(0,o.hasSelectOption)("select","select-option"),function(e,t){const r=e.dynamicProperty.get("select-option");t.setParams(null!=r?r:'[{value: ""}]')}],[(0,o.hasFeatureProperty)("select","select-value"),function(e,t){const r=e.getProperty("select-value"),n=e.dynamicProperty.get("select-value");(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||t.properties.set("value",(0,o.quoteString)(r)):t.properties.set("value",(0,o.getContentName)(n))}],[(0,o.hasFeatureProperty)("select","selected"),(0,o.numberPropertyParser)("selected")],[(0,o.hasFeatureProperty)("select","font-size"),(0,t.selectFontParser)("font","size")],[(0,o.hasFeatureProperty)("select","font-style"),(0,t.selectFontParser)("font","style")],[(0,o.hasFeatureProperty)("select","font-weight"),(0,t.selectFontParser)("font","weight")],[(0,o.hasFeatureProperty)("select","font-family"),(0,t.selectFontParser)("font","family")],[(0,o.hasFeatureProperty)("select","selected-option-font-size"),(0,t.selectFontParser)("selected-option-font","size")],[(0,o.hasFeatureProperty)("select","selected-option-font-style"),(0,t.selectFontParser)("selected-option-font","style")],[(0,o.hasFeatureProperty)("select","selected-option-font-weight"),(0,t.selectFontParser)("selected-option-font","weight")],[(0,o.hasFeatureProperty)("select","selected-option-font-family"),(0,t.selectFontParser)("selected-option-font","family")],[(0,o.hasFeatureProperty)("select","selected-option-font-color"),(0,o.colorPropertyParser)("selected-option-font-color")],[(0,o.hasFeatureProperty)("select","selected-option-bg-color"),(0,o.colorPropertyParser)("selected-option-bg-color")],[(0,o.hasFeatureProperty)("select","option-font-size"),(0,t.selectFontParser)("option-font","size")],[(0,o.hasFeatureProperty)("select","option-font-style"),(0,t.selectFontParser)("option-font","style")],[(0,o.hasFeatureProperty)("select","option-font-weight"),(0,t.selectFontParser)("option-font","weight")],[(0,o.hasFeatureProperty)("select","option-font-family"),(0,t.selectFontParser)("option-font","family")],[(0,o.hasFeatureProperty)("select","option-font-color"),(0,o.colorPropertyParser)("option-font-color")],[(0,o.hasFeatureProperty)("select","option-bg-color"),(0,o.colorPropertyParser)("option-bg-color")]]},2563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sliderParserArray=void 0;const o=r(8122);t.sliderParserArray=[[(0,o.hasFeatureProperty)("slider","value"),(0,o.rawDataParamParser)("value")],[(0,o.hasFeatureProperty)("slider","min"),(0,o.rawDataParamParser)("min")],[(0,o.hasFeatureProperty)("slider","max"),(0,o.rawDataParamParser)("max")],[(0,o.hasFeatureProperty)("slider","step"),(0,o.rawDataParamParser)("step")],[(0,o.hasFeatureProperty)("slider","style"),(0,o.enumParamParser)("style","SliderStyle.")],[(0,o.hasFeatureProperty)("slider","block-color"),(0,o.colorPropertyParser)("block-color")],[(0,o.hasFeatureProperty)("slider","track-color"),(0,o.colorPropertyParser)("track-color")],[(0,o.hasFeatureProperty)("slider","selected-color"),(0,o.colorPropertyParser)("selected-color")],[(0,o.hasFeatureProperty)("slider","show-steps"),(0,o.booleanPropertyParser)("show-steps")],[(0,o.hasFeatureProperty)("slider","show-tips"),(0,o.booleanPropertyParser)("show-tips")]]},8936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackParserArray=void 0;const o=r(8122);t.stackParserArray=[[(0,o.hasFeatureProperty)("stack","align-content-stack"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-content-stack");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("alignContent",r);const n=e.property.get("align-content-stack");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.getEtsEnumValue)("Alignment.",n);t.params.set((0,o.getEtsPropName)("alignContent"),a)}]]},780:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.swiperParserArray=void 0;const o=r(8122);t.swiperParserArray=[[(0,o.hasFeatureProperty)("swiper","index"),(0,o.numberPropertyParser)("index")],[(0,o.hasFeatureProperty)("swiper","auto-play"),(0,o.booleanPropertyParser)("auto-play")],[(0,o.hasFeatureProperty)("swiper","interval"),(0,o.numberPropertyParser)("interval")],[(0,o.hasFeatureProperty)("swiper","indicator"),(0,o.booleanPropertyParser)("indicator")],[(0,o.hasFeatureProperty)("swiper","loop"),(0,o.booleanPropertyParser)("loop")],[(0,o.hasFeatureProperty)("swiper","duration"),(0,o.numberPropertyParser)("duration")],[(0,o.hasFeatureProperty)("swiper","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("swiper","item-space"),(0,o.stringPropertyParser)("item-space")],[(0,o.hasFeatureProperty)("swiper","cached-count"),(0,o.numberPropertyParser)("cached-count")],[(0,o.hasFeatureProperty)("swiper","disable-swipe"),(0,o.booleanPropertyParser)("disable-swipe")]]},7036:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabContentParserArray=void 0;const o=r(8122),n=r(9248);t.tabContentParserArray=[[function(e){return"tab-content"===e.type&&(e.hasProperty("tabBar-icon")||e.hasProperty("tabBar-text"))},function(e,t){var r,a;const i=new Map,s=null!==(r=e.getProperty("tabBar-icon"))&&void 0!==r?r:"",p=null!==(a=e.getProperty("tabBar-text"))&&void 0!==a?a:"TabBar",l=e.dynamicProperty.has("tabBar-text"),c=e.dynamicProperty.has("tabBar-icon");(0,o.isEmptyOrUndefined)(s)||i.set("icon",c?s:(0,n.dealWithSrc)(s)),void 0!==p&&i.set("text",l?p:(0,o.quoteString)(p)),i.size>0&&t.properties.set("tabBar",i)}]]},2973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabsParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t)=>{const r=e.dynamicProperty.get("tabs-scrollable");if(void 0!==r&&""!==r.trim())return void t.properties.set("scrollable",r);const n=e.property.get("tabs-scrollable");(0,o.isEmptyOrUndefined)(n)||t.properties.set("scrollable",n)}));t.tabsParserArray=[[(0,o.hasFeatureProperty)("tabs","bar-position"),(0,o.enumParamParser)("bar-position","BarPosition.")],[(0,o.hasFeatureProperty)("tabs","index"),(0,o.rawDataParamParser)("index")],[(0,o.hasFeatureProperty)("tabs","controller"),(0,o.rawDataParamParser)("controller")],[(0,o.hasFeatureProperty)("tabs","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("tabs","tabs-scrollable"),n],[(0,o.hasFeatureProperty)("tabs","bar-mode"),(0,o.enumPropertyParser)("bar-mode","BarMode.")],[(0,o.hasFeatureProperty)("tabs","bar-width"),(0,o.stringPropertyParser)("bar-width")],[(0,o.hasFeatureProperty)("tabs","bar-height"),(0,o.stringPropertyParser)("bar-height")],[(0,o.hasFeatureProperty)("tabs","animation-duration"),(0,o.numberPropertyParser)("animation-duration")]]},1162:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textInputParserArray=void 0;const o=r(8122);t.textInputParserArray=[[(0,o.hasFeatureProperty)("text-input","placeholder"),(0,o.stringParamParser)("placeholder")],[(0,o.hasFeatureProperty)("text-input","textInput-type"),function(e,t){const r=e.dynamicProperty.get("textInput-type");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("type",r);const n=e.property.get("textInput-type");(0,o.isEmptyOrUndefined)(n)||t.properties.set("type","InputType."+n)}],[(0,o.hasFeatureProperty)("text-input","placeholderColor"),(0,o.colorPropertyParser)("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasProperty("placeholderFont-size")||e.hasProperty("placeholderFont-weight")||e.hasProperty("placeholderFont-family")||e.hasProperty("placeholderFont-style"))},function(e,t){const r=e.property.get("placeholderFont-size"),n=e.dynamicProperty.get("placeholderFont-size"),a=e.property.get("placeholderFont-weight"),i=e.dynamicProperty.get("placeholderFont-weight"),s=e.property.get("placeholderFont-family"),p=e.dynamicProperty.get("placeholderFont-family"),l=e.property.get("placeholderFont-style"),c=e.dynamicProperty.get("placeholderFont-style"),u=new Map;(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||u.set("size",parseInt(r)):u.set("size",n),(0,o.isEmptyOrUndefined)(i)?(0,o.isEmptyOrUndefined)(a)||u.set("weight",isNaN(Number(a))?(0,o.getEtsEnumValue)("FontWeight.",a):a):u.set("weight",i),(0,o.isEmptyOrUndefined)(p)?(0,o.isEmptyOrUndefined)(s)||u.set("family",(0,o.quoteString)(s)):u.set("family",p),(0,o.isEmptyOrUndefined)(c)?(0,o.isEmptyOrUndefined)(l)||u.set("style",(0,o.getEtsEnumValue)("FontStyle.",l)):u.set("style",c),t.properties.set("placeholderFont",u)}],[(0,o.hasFeatureProperty)("text-input","enterKeyType"),(0,o.enumPropertyParser)("enterKeyType","EnterKeyType.")],[(0,o.hasFeatureProperty)("text-input","caretColor"),(0,o.colorPropertyParser)("caretColor")],[(0,o.hasFeatureProperty)("text-input","maxLength"),(0,o.numberPropertyParser)("maxLength")]]},8681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textParserArray=void 0;const o=r(8122);t.textParserArray=[[(0,o.hasFeatureProperty)("text","content"),o.contentParamParser],[(0,o.hasFeatureProperty)("text","text-align"),(0,o.enumPropertyParser)("text-align","TextAlign.")],[(0,o.hasFeatureProperty)("text","text-overflow"),function(e,t){const r=e.dynamicProperty.get("text-overflow");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("textOverflow",new Map([["overflow",r]]));const n=e.property.get("text-overflow");(0,o.isEmptyOrUndefined)(n)||t.properties.set("textOverflow",new Map([["overflow","TextOverflow."+(0,o.firstUpperCase)(n)]]))}],[(0,o.hasFeatureProperty)("text","max-lines"),(0,o.numberPropertyParser)("max-lines")],[(0,o.hasFeatureProperty)("text","line-height"),(0,o.stringPropertyParser)("line-height")],[function(e){return"text"===e.type&&(e.hasProperty("decoration-type")||e.hasProperty("decoration-color"))},function(e,t){const r=e.property.get("decoration-type"),n=e.dynamicProperty.get("decoration-type"),a=e.property.get("decoration-color"),i=e.dynamicProperty.get("decoration-color");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(n)&&(0,o.isEmptyOrUndefined)(i))return;const s=new Map;(0,o.isEmptyOrUndefined)(n)?s.set("type",(0,o.isEmptyOrUndefined)(r)?"TextDecorationType.None":(0,o.getEtsEnumValue)("TextDecorationType.",r)):s.set("type",n),t.properties.set("decoration",s),(0,o.isEmptyOrUndefined)(i)?(0,o.isEmptyOrUndefined)(a)||s.set("color",(0,o.dealWithColor)(a)):s.set("color",i)}],[(0,o.hasFeatureProperty)("text","baseline-offset"),(0,o.stringPropertyParser)("baseline-offset")],[(0,o.hasFeatureProperty)("text","text-case"),(0,o.enumPropertyParser)("text-case","TextCase.")],[(0,o.hasFeatureProperty)("text","font-size"),(0,o.stringPropertyParser)("font-size")],[(0,o.hasFeatureProperty)("text","font-style"),(0,o.enumPropertyParser)("font-style","FontStyle.")],[(0,o.hasFeatureProperty)("text","font-weight"),o.fontWeightPropertyParser],[(0,o.hasFeatureProperty)("text","font-family"),(0,o.stringPropertyParser)("font-family")]]},4313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleParseArray=void 0;const o=r(8122);t.toggleParseArray=[[(0,o.hasFeatureProperty)("toggle","toggle-type"),function(e,t){const r="toggle-type";if((0,o.customDynamicParamParser)(r,"type",e,t))return;const n=e.property.get(r);!(0,o.isEmptyOrUndefined)(n)&&t.params instanceof Map&&t.params.set("type",(0,o.getEtsEnumValue)("ToggleType.",n))}],[(0,o.hasFeatureProperty)("toggle","isOn"),(0,o.booleanParamParser)("isOn")],[(0,o.hasFeatureProperty)("toggle","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("toggle","switchPointColor"),(0,o.colorPropertyParser)("switchPointColor")]]},8122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBuilderUniqueName=t.getEdgeBorderDirection=t.getBorderDirections=t.dealWithAlignSelf=t.dealWithScrollEdgeEffect=t.dealWithBackgroundRepeat=t.dealWithBackgroundImageSize=t.dealWithBackgroundImagePosition=t.dealWithFontWeight=t.getContentName=t.scrollerParamParser=t.dealWithWrap=t.getBackgroundImageSizeEnumValue=t.getBackgroundImagePositionEnumValue=t.contentParamParser=t.labelParamParser=t.fontWeightPropertyParser=t.dealWithColor=t.getEtsEnumValue=t.getEtsPropName=t.parseTagName=t.firstUpperCase=t.getForEachObj=t.colorPropertyParser=t.enumParamParser=t.arrayParamParser=t.booleanParamParser=t.customRawDataParamParser=t.rawDataParamParser=t.dateParamParser=t.stringParamParser=t.dynamicParamParser=t.searchTextAlign=t.enumPropertyParser=t.booleanPropertyParser=t.numberPropertyParser=t.isEmptyOrUndefined=t.objectPropertyParser=t.stringPropertyParser=t.customDynamicParamParser=t.dynamicPropertyParser=t.quoteString=t.hasSelectOption=t.hasFeatureProperty=t.hasCommonProperty=t.curry=void 0;const o=r(1195),n=r(4294);function a(e){return(...t)=>t.lengtht.property.has(e)||t.dynamicProperty.has(e))),t.hasFeatureProperty=a(((e,t,r)=>r.type===e&&(r.property.has(t)||r.dynamicProperty.has(t)))),t.hasSelectOption=a(((e,t,r)=>r.type===e)),t.quoteString=i,t.dynamicPropertyParser=s,t.customDynamicParamParser=p,t.stringPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.properties.set(y(e),i(o))})),t.objectPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.properties.set(y(e),o)})),t.isEmptyOrUndefined=l,t.numberPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);l(o)||r.properties.set(y(e),o)})),t.booleanPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);l(o)||r.properties.set(y(e),o)})),t.enumPropertyParser=a(((e,t,r,o)=>{if(s(e,r,o))return;const n=r.property.get(e);l(n)||o.properties.set(y(e),d(t,n))})),t.searchTextAlign=function(e,t){const r=e.dynamicProperty.get("search-text-align");if(void 0!==r&&""!==r.trim())return void t.properties.set("textAlign",r);const o=e.property.get("search-text-align");l(o)||t.properties.set("textAlign",d("TextAlign.",o))},t.dynamicParamParser=c,t.stringParamParser=a(((e,t,r)=>{if(c(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.params instanceof Map&&r.params.set(y(e),i(o))})),t.dateParamParser=a(((e,t,r,o)=>{const n=r.dynamicProperty.get(e);if(void 0!==n&&""!==n.trim()&&o.params instanceof Map)return void o.params.set(t,n);const a=r.property.get(e);void 0!==a&&o.params instanceof Map&&o.params.set(t,(e=>void 0===e||""===e?"new Date()":"new Date ("+i(e)+")")(a))})),t.rawDataParamParser=a(((e,t,r)=>{if(c(e,t,r))return;const o=t.property.get(e);!l(o)&&r.params instanceof Map&&r.params.set(y(e),o)})),t.customRawDataParamParser=a(((e,t,r,o)=>{if(p(e,t,r,o))return;const n=r.property.get(e);!l(n)&&o.params instanceof Map&&o.params.set(t,n)})),t.booleanParamParser=a(((e,r,o)=>{(0,t.rawDataParamParser)(e,r,o)})),t.arrayParamParser=a(((e,r,o)=>{(0,t.rawDataParamParser)(e,r,o)})),t.enumParamParser=a(((e,t,r,o)=>{if(c(e,r,o))return;const n=r.property.get(e);!l(n)&&o.params instanceof Map&&o.params.set(y(e),d(t,n))})),t.colorPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;let o=t.property.get(e);l(o)||(o=f(o),r.properties.set(y(e),o))})),t.getForEachObj=function(e){var t,r;const o=e.dynamicProperty.get("for"),n=e.dynamicProperty.get("keyGenerator"),a=null!==(t=e.property.get("item"))&&void 0!==t?t:"item",i=null!==(r=e.property.get("idx"))&&void 0!==r?r:"idx";return void 0!==e.dynamicProperty.get("for")?{for:o,key:n,item:a,idx:i}:null},t.firstUpperCase=u,t.parseTagName=function(e){return(0,n.getTagName)(e).split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")},t.getEtsPropName=y,t.getEtsEnumValue=d,t.dealWithColor=f,t.fontWeightPropertyParser=function(e,t){const r=e.getProperty("font-weight");if(l(r))return;const o=g(r);t.properties.set("fontWeight",o)},t.labelParamParser=function(e,t){const r=e.dynamicProperty.get("label");if(!l(r))return void t.setParams(m(r));const o=e.property.get("label");"string"==typeof o&&t.setParams(i(o))},t.contentParamParser=function(e,t){const r=e.property.get("content"),o=e.dynamicProperty.get("content");l(o)?"string"==typeof r&&t.setParams(i(r)):t.setParams(m(o))},t.getBackgroundImagePositionEnumValue=function(e){const t=new Map([["top left","TopStart"],["top center","Top"],["top right","TopEnd"],["center left","Start"],["center center","Center"],["center right","End"],["bottom left","BottomStart"],["bottom center","Bottom"],["bottom right","BottomEnd"]]);return t.has(e)?`Alignment.${String(t.get(e))}`:""},t.getBackgroundImageSizeEnumValue=function(e){return new Set(["cover","contain","auto"]).has(e)?d("ImageSize.",e):""},t.dealWithWrap=function(e){let t=d("FlexWrap.",e);return"nowrap"===e&&(t="FlexWrap.NoWrap"),t},t.scrollerParamParser=function(e,t){const r=e.dynamicProperty.get("scroller");l(r)||t.setParams(r)},t.getContentName=m,t.dealWithFontWeight=g,t.dealWithBackgroundImagePosition=function(e){if(new Set(["TopStart","Top","TopEnd","Start","Center","End","BottomStart","Bottom","BottomEnd"]).has(e))return"Alignment."+e;const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null!==t?`{ x: ${i(t[1])}, y: ${i(t[4])} }`:void 0},t.dealWithBackgroundImageSize=function(e){if(new Set(["Cover","Contain","Auto"]).has(e))return d("ImageSize.",e);const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null!==t?void 0!==t[5]?`{ width: ${i(t[1])}, height: ${i(t[5])} }`:`{ width: ${i(t[1])} }`:void 0},t.dealWithBackgroundRepeat=function(e){const t=new Map([["repeat-x","X"],["repeat-y","Y"],["repeat","XY"],["no-repeat","NoRepeat"]]).get(e);if(null!=t&&""!==t)return d("ImageRepeat.",t)},t.dealWithScrollEdgeEffect=function(e){var t;const r=d("EdgeEffect.",e);return null!==(t=new Map([["Spring","EdgeEffect.Spring"],["Fade","EdgeEffect.Fade"],["None","EdgeEffect.None"]]).get(r))&&void 0!==t?t:r},t.dealWithAlignSelf=function(e){let t=d("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t},t.getBorderDirections=function(e){return"border-width"===e?["border-top-width","border-bottom-width","border-left-width","border-right-width"]:"border-color"===e?["border-top-color","border-bottom-color","border-left-color","border-right-color"]:"border-style"===e?["border-top-style","border-bottom-style","border-left-style","border-right-style"]:["border-top-left-radius","border-bottom-right-radius","border-bottom-left-radius","border-top-right-radius"]},t.getEdgeBorderDirection=function(e){var t;return e.includes("radius")?null!==(t=new Map([["border-top-left-radius","topLeft"],["border-top-right-radius","topRight"],["border-bottom-left-radius","bottomLeft"],["border-bottom-right-radius","bottomRight"]]).get(e))&&void 0!==t?t:e:e.split("-")[1]},t.getBuilderUniqueName=function(e,t){const r=`${y((0,n.getTagName)(e))}${u(y(t))}`;return`${r}_${(0,n.getUniqueId)(r)}`}},1912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.events=t.parseVisualModel=void 0;const o=r(8122),n=r(7150),a=r(1778),i=r(8916),s=r(9248),p=r(8483),l=r(2563),c=r(8681),u=r(1790),y=r(8191),d=r(2153),f=r(780),m=r(2565),g=r(4313),h=r(5264),E=r(7907),T=r(7375),S=r(8014),P=r(4925),v=r(1162),b=r(9284),_=r(8936),N=r(2973),C=r(7036),A=r(2218),O=r(1147);t.parseVisualModel=function(e,r){r.setTagName((0,o.parseTagName)(e.type));const n=(0,o.getForEachObj)(e);r.setForEachObj(n);const a=void 0!==e.dynamicProperty.get("if")?e.dynamicProperty.get("if"):e.property.get("if");void 0===a?r.setIfBoolean(null):r.setIfBoolean(a);for(const t of M)("boolean"==typeof t[0]||t[0](e))&&t[1](e,r);!function(e,r){var o;const n="onDisappear",a="onDisAppear";for(let o of t.events){const t=e.property.get(o);o===n&&(o=a),void 0!==t&&""!==t&&("this"===t.split(".")[0]?r.properties.set(o,t+".bind(this)"):r.properties.set(o,t))}if(void 0!==e.property.get("newFunction")){const t=null!==(o=e.property.get("newFunction"))&&void 0!==o?o:"{}",i=JSON.parse(t);Object.keys(i).forEach((e=>{var t;const o=null!==(t=i[e].eventCodeGen)&&void 0!==t?t:"";e===n&&(e=a),r.properties.set(e,o)}))}}(e,r)},t.events=["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange","onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop","onComplete","onError","onFinish","onChange","onSubmit","onEditChanged","onStateChange","onRefreshing","onSelect","onScroll","onScrollEdge","onScrollEnd","onScrollBegin","onTitleModeChange"];const M=[...n.commonParserArray,...i.buttonParserArray,...a.dividerParserArray,...s.imageParserArray,...p.progressParserArray,...l.sliderParserArray,...c.textParserArray,...u.columnParserArray,...u.rowParserArray,...h.flexParserArray,...E.listParserArray,...E.listItemParserArray,...f.swiperParserArray,...v.textInputParserArray,...y.navigationParserArray,...m.timePickerParserArray,...m.textPickerParserArray,...P.refreshParserArray,...g.toggleParseArray,...S.selectParserArray,...m.datePickerParserArray,...T.scrollParserArray,...d.gridParserArray,...d.gridItemParserArray,...b.searchParserArray,..._.stackParserArray,...N.tabsParserArray,...C.tabContentParserArray,...A.checkboxParseArray,...O.checkboxGroupParseArray]},3243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Style=t.Tag=void 0;const o=r(4117);class n extends o.ASTNode{constructor(e,t,r){super(),this.tagName=e,this.attributes=t,this.content=r}}t.Tag=n;class a extends o.ASTNode{constructor(e,t,r,o){super(),this.mediaQuery=void 0,this.kind=e,this.name=t,this.content=r,this.mediaQuery=o}}t.Style=a},3573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const o=r(3243),n=r(2334);class a{constructor(e){this.cache=e}visit(e){e instanceof o.Tag?this.genTag(e):e instanceof o.Style&&this.genStyle(e)}static getMethodGen(e){return void 0===a.instance?a.instance=new a(e):a.instance.setCache(e),a.instance}setCache(e){this.cache=e}genTag(e){if(this.cache.concat(n.TokenClass.TAG_START,e.tagName),this.cache.indentOff(),e.attributes.forEach(((e,t)=>{let r="";for(const t of e)r+='"'===t?""":"\n"===t?" ":t;this.cache.concat(n.TokenClass.SPACE,t,n.TokenClass.ASSIGN,n.TokenClass.LQUOTE,r,n.TokenClass.RQUOTE)})),null===e.content)this.cache.concat(n.TokenClass.EMPTY_TAG_END);else{if(this.cache.concat(n.TokenClass.TAG_END),"string"==typeof e.content){let t="";for(const r of e.content)t+="<"===r?"<":r;this.cache.concat(t)}else 0!==e.content.length&&(this.cache.concat(n.TokenClass.NEW_LINE),this.cache.incIndent(),this.cache.indentOn(),e.content.forEach((e=>{e.accept(this),this.cache.indentOff(),this.cache.concat(n.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.indentOn(),this.cache.decIndent());this.cache.concat(n.TokenClass.END_TAG_START,e.tagName,n.TokenClass.TAG_END)}}genStyle(e){void 0!==e.mediaQuery&&(this.cache.concat("@media"),this.cache.indentOff(),this.cache.concat(n.TokenClass.SPACE,e.mediaQuery,n.TokenClass.SPACE,n.TokenClass.LBRA,n.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent()),"IDStyle"===e.kind&&(this.cache.concat(n.TokenClass.ID_STYLE_START),this.cache.indentOff()),this.cache.concat(e.name,n.TokenClass.SPACE,n.TokenClass.LBRA,n.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent(),e.content.forEach(((e,t)=>{this.cache.concat(t,n.TokenClass.COLON,n.TokenClass.SPACE,e,n.TokenClass.SEMICOLON,n.TokenClass.NEW_LINE)})),this.cache.decIndent(),this.cache.concat(n.TokenClass.RBRA,n.TokenClass.NEW_LINE),void 0!==e.mediaQuery&&(this.cache.decIndent(),this.cache.concat(n.TokenClass.RBRA,n.TokenClass.NEW_LINE)),this.cache.concat(n.TokenClass.NEW_LINE)}}t.ASTNodeGenerator=a,a.instance=void 0},8844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CSSBridge=t.HMLBridge=void 0;const o=r(3243),n=r(7571);t.HMLBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map([["id",e.id]]);let r="";for(let[o,a]of e.property)(0,n.isAttribute)(o,e.type)?("string"!=typeof a&&(a=JSON.stringify(a)),t.set(o,a)):(0,n.isContent)(o)&&(r=a);if(e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}const a=new o.Tag(e.type,t,r);return"wrapper"===t.get("id")?new o.Tag("div",new Map,[a]):a}},t.CSSBridge=class{constructor(){this.errors=0,this.styles=[]}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}genIDStyle(e){var t;const r=t=>{const r=new Map;for(const[o,a]of t)(0,n.isStyle)(o,e.type)&&r.set(o,a);return r},a=r(e.property);a.size>0&&this.styles.push(new o.Style("IDStyle",e.id,a)),(null!==(t=e.mediaProperty)&&void 0!==t?t:new Map).forEach(((t,n)=>{const a=r(t);a.size>0&&this.styles.push(new o.Style("IDStyle",e.id,a,n))}));for(const t of e.children)t.accept(this)}visit(e){return this.genIDStyle(e),this.styles}}},1055:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genFACSS=t.genFAHML=void 0;const o=r(3573),n=r(1862);t.genFAHML=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" "));return e.accept(t),t.cache.toString()},t.genFACSS=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" "));return e.forEach((e=>{e.accept(t)})),t.cache.toString()}},7571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEvent=t.isData=t.isUnknown=t.isContent=t.isAttribute=t.isStyle=t.styleMap=void 0;const o=r(904),n=["width","height","min-width","min-height","max-width","max-height","padding","padding-start","padding-end","padding-top","padding-right","padding-bottom","padding-left","margin","margin-start","margin-end","margin-top","margin-right","margin-bottom","margin-left","border-width","border-style","border-color","border-radius","border-top-width","border-top-style","border-top-color","border-top-left-radius","border-right-width","border-right-style","border-right-color","border-top-right-radius","border-bottom-width","border-bottom-style","border-bottom-color","border-bottom-right-radius","border-left-width","border-left-style","border-left-color","border-bottom-left-radius","background-color","background","background-image","background-size","background-position","background-repeat","display","opacity","visibility","flex","flex-grow","flex-shrink","flex-basis","position","display","top","right","bottom","left","display-index","flex-weight","aspect-ratio"],a=["font-size","font-family","font-style","font-weight"],i=["text-align","line-height","text-decoration","letter-spacing","max-lines","text-overflow","allow-scale","min-font-size","max-font-size","font-size-step","prefer-font-sizes","color",...a],s=["allow-scale","text-decoration","color",...a],p=["text-color","allow-scale","icon-width","icon-height","radius",...a],l=["texton-color","textoff-color","text-padding","allow-scale",...a],c=["column-height","text-color","allow-scale","letter-spacing","text-decoration","line-height","opacity",...a],u=["text-color","allow-scale","letter-spacing",...a];t.styleMap=new Map([["common",new Set([...n])],["div",new Set(["flex-direction","overflow","flex-wrap","justify-content","align-items","align-content","grid-template-columns","grid-template-rows","grid-row-start","grid-row-end","grid-column-start","grid-column-end","grid-gap","grid-columns-gap","grid-rows-gap"])],["text",new Set([...i])],["image",new Set(["object-fit","match-text-direction","fit-original-size"])],["span",new Set([...s])],["input",new Set(["font-size","font-family","font-weight","color","placeholder-color","allow-scale"])],["button",new Set([...p])],["switch",new Set([...l])],["refresh",new Set(["progress-color"])],["divider",new Set(["stroke-width","line-cap","color"])],["chart",new Set(["stroke-width","radius","start-angle","total-angle","center-x","center-y","colors","weights"])],["picker",new Set([...c])],["picker-view",new Set(["color","font-size","selected-color","selected-font-size","focus-color","focus-font-size","disappear-color","disappear-font-size","font-family"])],["slider",new Set(["color","selected-color","block-color"])],["swiper",new Set(["indicator-color","indicator-selected-color","indicator-size","indicator-top","indicator-right","indicator-bottom","indicator-left"])],["list",new Set(["flex-direction","columns","item-extent","fade-color"])],["list-item",new Set(["column-span"])],["progress",new Set(["color","stroke-width","background-color","secondary-color","scale-width","scale-number","start-angle","total-angle","center-x","center-y","radius"])],["select",new Set(["font-family"])],["menu",new Set([...u])],["option",new Set(["color","font-family","allow-scale","font-size","font-weight","text-decoration"])],["video",new Set(["object-fit"])],["clock",new Set(["font-family"])]]);const y=new Map([["common",new Set(["id","ref","disabled","focusable","data","if","for"])],["image",new Set(["src","alt"])],["button",new Set(["type","value","icon","waiting"])],["refresh",new Set(["offset","refreshing","type","lasttime","friction"])],["input",new Set(["type","checked","name","value","placeholder","maxlength","enterkeytype","headericon"])],["switch",new Set(["checked","showtext","texton","textoff"])],["option",new Set(["value","selected","icon"])],["chart",new Set(["type","percent","datasets","options"])],["picker",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","value","vibrate"])],["picker-view",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","indicatorprefix","indicatorsuffix","vibrate"])],["slider",new Set(["min","max","step","showtips","showsteps","mode","value"])],["divider",new Set(["vertical"])],["list",new Set(["scrollpage","cachedcount","scrollbar","scrolleffect","shapemode","indexer","itemscale","itemcenter","updateeffect","scrollvibrate","initialindex","initialoffset"])],["list-item",new Set(["type","primary","section","sticky","stickyradius","clickeffect"])],["swiper",new Set(["index","autoplay","interval","indicator","digital","indicatordisabled","loop","duration","vertical"])],["progress",new Set(["type","percent","secondarypercent","clockwise"])],["menu",new Set(["target","title","type"])],["clock",new Set(["clockconfig","showdigit","hourswest"])],["badge",new Set(["placement","count","visible","maxcount","config","label"])],["video",new Set(["muted","src","autoplay","poster","controls","loop","starttime","direction","speed"])],["tabs",new Set(["index","vertical"])],["tab-bar",new Set(["mode"])],["tab-content",new Set(["scrollable"])]]),d=new Map([["common",new Set(["ontouchstart","ontouchmove","ontouchcancel","ontouchend","onclick","onlongpress","onfocus","onblur","onkey","onswipe"])],["image",new Set(["oncomplete","onerror"])],["input",new Set(["onchange","onenterkeyclick"])],["select",new Set(["onchange"])],["refresh",new Set(["onrefresh","onpulldown"])],["swiper",new Set(["onchange","onrotation"])],["list",new Set(["onindexerchange","onscroll","onscrollbottom","onscrolltop","onscrollend","onscrolltouchup","onrequestitem"])],["list-item",new Set(["onsticky"])],["menu",new Set(["onselected","oncancel"])],["picker",new Set(["oncolumnchange","onchange","oncancel"])],["picker-view",new Set(["oncolumnchange","onchange"])],["video",new Set(["onprepared","onstart","onpause","onfinish","onerror","onseeking","onseeked","ontimeupdate","onfullscreenchange","onstop"])],["tabs",new Set(["onchange"])],["switch",new Set(["onchange"])],["dialog",new Set(["oncancel"])],["slider",new Set(["onchange"])]]),f=new Map([["common",new Set(["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange"])],["image",new Set(["onComplete","onError","onFinish"])],["swiper",new Set(["onChange"])],["list",new Set(["onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop"])],["text-input",new Set(["onChange","onSubmit","onEditChanged"])],["refresh",new Set(["onStateChange","onRefreshing"])],["toggle",new Set(["onChange"])],["timePicker",new Set(["onChange"])],["textPicker",new Set(["onChange"])],["select",new Set(["onSelect"])],["datePicker",new Set(["onChange"])],["search",new Set(["onSubmit","onChange","onCopy","onCut","onPaste"])],["grid",new Set(["onScrollIndex","onItemDragStart","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDrop"])],["grid-item",new Set(["onSelect"])],["scroll",new Set(["onScroll","onScrollEdge","onScrollEnd","onScrollBegin"])],["navigation",new Set(["onTitleModeChange"])],["tabs",new Set(["onChange"])],["checkBox",new Set(["onChange"])],["checkboxGroup",new Set(["onChange"])]]);function m(e,t,r){const o=t.get(r);return void 0!==o&&o.has(e)}function g(e,r){return m(e,t.styleMap,"common")||m(e,t.styleMap,r)}function h(e,t){return(0,o.getDomain)()===o.Domain.ETS?m(e,f,"common")||m(e,f,t):E(e,t)||T(e,t)}function E(e,t){return m(e,y,"common")||m(e,y,t)}function T(e,t){return m(e,d,"common")||m(e,d,t)}t.isStyle=g,t.isAttribute=h,t.isContent=function(e){return"content"===e},t.isUnknown=function(e,t){return!g(e,t)&&!h(e,t)},t.isData=E,t.isEvent=T},2334:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.INDENT=" ",r.SPACE=" ",r.LQUOTE='"',r.RQUOTE='"',r.TAG_START="<",r.TAG_END=">",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxGroupProperties=t.checkboxProperties=void 0;const o=r(1513);t.checkboxProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"Select",property:"select-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Name",property:"name-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Group",property:"group-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}}],t.checkboxGroupProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"SelectAll",property:"selectAll-visual"},o.commonParamsForJudge),{defaults:!1})}]},3311:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dividerProperties=void 0;const o=r(1513);t.dividerProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign({name:"Vertical",property:"vertical-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"LineCap",property:"line-cap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.LINE_CAP_STYLE,defaults:"butt",list:[o.CLEAN_VALUE_NODE,{name:"Butt",value:"butt"},{name:"Round",value:"round"},{name:"Square",value:"square"}]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"StrokeWidth",property:"stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength}}]},3687:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flexProperties=void 0;const o=r(1513);t.flexProperties=[{propertySector:o.Sector.FLEXCHILD,propertySet:{name:"FlexBasis",property:"flex-basis-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength,defaults:"auto",fixedValues:["auto"],info:"The initial main size of a flex item. It sets the size of the content box otherwise set with box-sizing."}},{propertySector:o.Sector.FLEXCHILD,propertySet:{name:"AlignSelf",property:"align-self-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"auto",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Direction",property:"flex-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_DIRECTION,defaults:"row",list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"RowReverse",value:"row-reverse"},{name:"Column",value:"column"},{name:"ColumnReverse",value:"column-reverse"}],info:"The direction of flex."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Wrap",property:"wrap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_WRAP,defaults:"nowrap",list:[o.CLEAN_VALUE_NODE,{name:"NoWrap",value:"nowrap"},{name:"Wrap",value:"wrap"},{name:"WrapReverse",value:"wrap-reverse"}],info:"Whether flex items are forced onto one line or multiple lines."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"JustifyContent",property:"justify-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"JustifyContent",property:"justify-content-rc-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-flex-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"stretch",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignContent",property:"align-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Set the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis."}}]},4836:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridItemProperties=void 0;const o=r(1513);t.gridItemProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowStart",property:"row-start-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowEnd",property:"row-end-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnStart",property:"column-start-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnEnd",property:"column-end-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ForceRebuild",property:"force-rebuild-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selectable",property:"selectable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"true"}}]},6181:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridProperties=void 0;const o=r(1513);t.gridProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnsTemplate",property:"columns-template-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowsTemplate",property:"rows-template-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnsGap",property:"columns-gap-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength,defaults:0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowsGap",property:"rows-gap-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength,defaults:0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"LayoutDirection",property:"layout-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.GRID_DIRECTION,list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"Column",value:"column"},{name:"RowReverse",value:"row-reverse"},{name:"ColumnReverse",value:"column-reverse"}],defaults:"row"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MaxCount",property:"max-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER,defaults:1/0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MinCount",property:"min-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER,defaults:1}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"CellLength",property:"cell-length-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MultiSelectable",property:"multi-selectable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SupportAnimation",property:"support-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}}]},8840:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemProperties=void 0;const o=r(1513);t.listItemProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Sticky",property:"sticky-visual",type:o.TypeName.SELECT,etsType:o.EtsType.STICKY,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"Normal",value:"normal"}],defaults:"none"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Editable",property:"editable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}]},8124:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listProperties=void 0;const o=r(1513);t.listProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"InitialIndex",property:"initial-index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:{name:"ListDirection",property:"list-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.AXIS,list:[o.CLEAN_VALUE_NODE,{name:"Vertical",value:"vertical"},{name:"Horizontal",value:"horizontal"}],defaults:"vertical"}},{propertySector:o.Sector.MORE,propertySet:{name:"Color",property:"divider-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"StrokeWidth",property:"divider-stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"StartMargin",property:"divider-start-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"EndMargin",property:"divider-end-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"EditMode",property:"edit-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}},{propertySector:o.Sector.MORE,propertySet:{name:"EdgeEffect",property:"edge-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{name:"Spring",value:"spring"},{name:"None",value:"none"}],defaults:"spring"}},{propertySector:o.Sector.MORE,propertySet:{name:"ChainAnimation",property:"chain-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}]},5452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.navigationProperties=void 0;const o=r(1513);t.navigationProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Title",property:"navigation-title-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SubTitle",property:"subTitle-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Menus",property:"menus-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TitleMode",property:"titleMode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.NAVIGATION_TITLEMODE,list:[o.CLEAN_VALUE_NODE,{value:"Free"},{value:"Mini"},{value:"Full"}],defaults:"Mini"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ToolBar",property:"toolBar-visual",type:o.TypeName.BASE,etsType:o.EtsType.OBJECT,supportStaticProperty:!1,defaults:{}}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideToolBar",property:"hideToolBar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideTitleBar",property:"hideTitleBar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideBackButton",property:"hideBackButton-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}}]},4090:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pickerProperties=void 0;const o=r(1513);t.pickerProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Range",property:"range-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selected",property:"datetime-selected-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Start",property:"start-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"End",property:"end-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"UseMilitaryTime",property:"useMilitaryTime-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selected",property:"textPicker-selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"DefaultPickerItemHeight",property:"defaultPickerItemHeight-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["vp","px","lpx"]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Lunar",property:"lunar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}]},5302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshProperties=void 0;const o=r(1513);t.refreshProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Friction",property:"friction-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:62}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Offset",property:"offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength,defaults:16}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Refreshing",property:"refreshing-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}]},4488:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollProperties=void 0;const o=r(1513);t.scrollProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.SCROLL_DIRECTION,list:[o.CLEAN_VALUE_NODE,{value:"Horizontal"},{value:"Vertical"},{value:"None"}],defaults:"Vertical",startApi:"9"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.SCROLL_DIRECTION,list:[o.CLEAN_VALUE_NODE,{value:"Horizontal"},{value:"Vertical"},{value:"None"},{value:"Free"}],defaults:"Vertical",endApi:"9"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBar",property:"scroll-bar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_STATE,list:[o.CLEAN_VALUE_NODE,{value:"Off"},{value:"On"},{value:"Auto"}]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBarColor",property:"scroll-bar-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.NON_R_COLOR}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBarWidth",property:"scroll-bar-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"EdgeEffect",property:"edge-effect-scroll-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{value:"Spring"},{value:"Fade"},{value:"None"}],defaults:"None"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scroller",property:"scroller-visual",type:o.TypeName.BASE,etsType:o.EtsType.SCROLLER,supportStaticProperty:!1}}]},128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchProperties=void 0;const o=r(1513),n=[{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontSize",property:"placeholder-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontStyle",property:"placeholder-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontWeight",property:"placeholder-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontFamily",property:"placeholder-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}}],a=[{propertySector:o.Sector.MORE,propertySet:{name:"TextFontSize",property:"text-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontStyle",property:"text-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontWeight",property:"text-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontFamily",property:"text-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.MORE,propertySet:{name:"TextAlign",property:"search-text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start"}}];t.searchProperties=[...n,...a,{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Controller",property:"search-controller-visual",type:o.TypeName.BASE,etsType:o.EtsType.SEARCH_CONTROLLER,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Icon",property:"icon-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Placeholder",property:"search-placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Value",property:"search-value-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.MORE,propertySet:{name:"SearchButton",property:"search-button-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.MORE,propertySet:{name:"CopyOption",property:"copy-option-visual",type:o.TypeName.SELECT,etsType:o.EtsType.COPY_OPTION,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"None"},{name:"InApp",value:"InApp"},{name:"LocalDevice",value:"LocalDevice"}],defaults:"None",startApi:"9"}}]},1021:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectProperties=void 0;const o=r(1513),n=[{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontSize",property:"selected-option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontStyle",property:"selected-option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontColor",property:"selected-option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontWeight",property:"selected-option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontFamily",property:"selected-option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionBackgroundColor",property:"selected-option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}],a=[{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontSize",property:"option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontStyle",property:"option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontColor",property:"option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontWeight",property:"option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontFamily",property:"option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionBackgroundColor",property:"option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}];t.selectProperties=[...n,...a,{propertySector:o.Sector.SELECT,propertySet:{name:"Value",property:"select-value-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.SELECT,propertySet:{name:"Selected",property:"selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.SELECT,propertySet:{name:"Options",property:"select-option-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}}]},8929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sliderProperties=void 0;const o=r(1513);t.sliderProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TrackColor",property:"track-color-visual",type:o.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ShowSteps",property:"show-steps-visual",type:o.TypeName.ADJUSTABLE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ShowTips",property:"show-tips-visual",type:o.TypeName.ADJUSTABLE}}]},1815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackProperties=void 0;const o=r(1513);t.stackProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignContent",property:"align-content-stack-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ALIGNMENT,defaults:"center",list:o.alignProperties}}]},1492:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.swiperProperties=void 0;const o=r(1513);t.swiperProperties=[{propertySector:o.Sector.MORE,propertySet:Object.assign({name:"AutoPlay",property:"auto-play-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.MORE,propertySet:{name:"Interval",property:"interval-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign(Object.assign({name:"Loop",property:"loop-visual"},o.commonParamsForJudge),{defaults:!0})},{propertySector:o.Sector.MORE,propertySet:{name:"Duration",property:"duration-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:{name:"ItemSpace",property:"item-space-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH}},{propertySector:o.Sector.MORE,propertySet:{name:"CachedCount",property:"cached-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign({name:"DisableSwipe",property:"disable-swipe-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Index",property:"index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign(Object.assign({name:"Indicator",property:"indicator-visual"},o.commonParamsForJudge),{defaults:!0})}]},6153:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabContentProperties=void 0;const o=r(1513);t.tabContentProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TabBar Icon",property:"tabBar-icon-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_SRC}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TabBar Text",property:"tabBar-text-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT}}]},6686:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabsProperties=void 0;const o=r(1513);t.tabsProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Controller",property:"controller-visual",type:o.TypeName.BASE,etsType:o.EtsType.TABS_CONTROLLER,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"tabs-scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"true"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarPosition",property:"bar-position-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_POSITION,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"End",value:"end"}],defaults:"start"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarMode",property:"bar-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_MODE,list:[o.CLEAN_VALUE_NODE,{name:"Scrollable",value:"scrollable"},{name:"Fixed",value:"fixed"}],defaults:"fixed"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarWidth",property:"bar-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarHeight",property:"bar-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AnimationDuration",property:"animation-duration-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:200}}]},3890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textInputProperties=void 0;const o=r(1513);t.textInputProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Placeholder",property:"placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"textInput-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.INPUT_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Password"},{value:"Email"},{value:"Number"}],defaults:"Normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderColor",property:"placeholderColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontSize",property:"placeholderFont-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp"]}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontWeight",property:"placeholderFont-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Lighter"},{value:"Regular"},{value:"Medium"},{value:"Bold"},{value:"Bolder"},...o.commonFontWeight],defaults:"400"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontFamily",property:"placeholderFont-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontStyle",property:"placeholderFont-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Italic"}],defaults:"Normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"EnterKeyType",property:"enterKeyType-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ENTER_KEY_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Go"},{value:"Search"},{value:"Send"},{value:"Next"},{value:"Done"}],defaults:"Done"}},{propertySector:o.Sector.MORE,propertySet:{name:"CaretColor",property:"caretColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"MaxLength",property:"maxLength-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}}]},8271:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textComponentProperties=void 0;const o=r(1513);t.textComponentProperties=[{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextAlign",property:"text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start"}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"LineHeight",property:"line-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextOverflow",property:"text-overflow-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_OVERFLOW,list:[o.CLEAN_VALUE_NODE,{name:"Clip",value:"clip"},{name:"Ellipsis",value:"ellipsis"},{name:"None",value:"none"}],defaults:"clip"}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"BaselineOffset",property:"baseline-offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"DecorationType",property:"decoration-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_DECORATION_TYPE,list:[o.CLEAN_VALUE_NODE,{name:"Underline",value:"underline"},{name:"LineThrough",value:"line-through"},{name:"Overline",value:"overline"},{name:"None",value:"none"}],defaults:"none"}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"DecorationColor",property:"decoration-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextCase",property:"text-case-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_CASE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"LowerCase"},{value:"UpperCase"}],defaults:"Normal"}}]},3460:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleProperties=void 0;const o=r(1513);t.toggleProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"toggle-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TOGGLE_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Button"},{value:"Checkbox"},{value:"Switch"}],defaults:"Button"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"IsOn",property:"isOn-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SelectedColor",property:"selectedColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SwitchPointColor",property:"switchPointColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}]},1290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.etsPropertyList=void 0;const o=r(5958),n=r(1513),a=r(5302),i=r(3460),s=r(8271),p=r(3890),l=r(3311),c=r(8124),u=r(8840),y=r(3687),d=r(1492),f=r(1021),m=r(8929),g=r(4090),h=r(128),E=r(1815),T=r(4836),S=r(6181),P=r(4488),v=r(5452),b=r(6686),_=r(8964),N=r(6153),C=r(6486),A=(()=>{const e=C.cloneDeep(o.commonPropertyList),t=new Map([["color-visual",n.Sector.FEATURE_ETS],["value-visual",n.Sector.FEATURE_ETS],["total-visual",n.Sector.FEATURE_ETS],["style-visual",n.Sector.FEATURE_ETS],["font-family-visual",n.Sector.TEXTSTYLES],["max-lines-visual",n.Sector.TEXTSTYLES],["flex-grow-visual",n.Sector.FLEXCHILD],["flex-shrink-visual",n.Sector.FLEXCHILD],["aspect-ratio-visual",n.Sector.LAYOUT],["opacity-visual",n.Sector.EFFECT],["background-color-visual",n.Sector.BACKGROUND]]);return e.forEach((e=>{const r=e.propertySet.property;t.has(r)&&(e.propertySector=t.get(r))})),e})(),O=[{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontSize",property:"font-size-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.fontSizeUnit}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontStyle",property:"font-style-visual",type:n.TypeName.SELECT,etsType:n.EtsType.FONT_STYLE,list:[n.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontColor",property:"font-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontWeight",property:"font-weight-visual",type:n.TypeName.SELECT,etsType:`${n.EtsType.FONT_WEIGHT}|${n.EtsType.NUMBER}`,list:n.fontWeightList,defaults:"400"}}],M=[{propertySector:n.Sector.RENDER,propertySet:{name:"ForEach",property:"for-visual",type:n.TypeName.BASE,etsType:n.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:n.Sector.RENDER,propertySet:{name:"KeyGenerator",property:"keyGenerator-visual",type:n.TypeName.BASE,etsType:"Event",supportStaticProperty:!1,defaults:""}},{propertySector:n.Sector.RENDER,propertySet:{name:"Item",property:"item-visual",type:n.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Item of ForEach Array"}},{propertySector:n.Sector.RENDER,propertySet:{name:"Idx",property:"idx-visual",type:n.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Index of Corresponding Item In ForEach Array"}}],w={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:["vp","px","lpx"],placeholder:"0"},R=[{propertySector:n.Sector.SIZE,propertySet:{name:"Width",property:"width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SIZE,propertySet:{name:"Height",property:"height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SIZE,propertySet:{name:"MinWidth",property:"constraint-size-min-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength}},{propertySector:n.Sector.SIZE,propertySet:{name:"MinHeight",property:"constraint-size-min-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength}},{propertySector:n.Sector.SIZE,propertySet:{name:"MaxWidth",property:"constraint-size-max-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength}},{propertySector:n.Sector.SIZE,propertySet:{name:"MaxHeight",property:"constraint-size-max-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength}},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"Margin",property:"margin-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"Padding",property:"padding-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginTop",property:"margin-top-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginRight",property:"margin-right-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginBottom",property:"margin-bottom-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginLeft",property:"margin-left-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingTop",property:"padding-top-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingRight",property:"padding-right-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingBottom",property:"padding-bottom-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingLeft",property:"padding-left-visual"},w)}],I={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength},x={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength},L={type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR},F=[{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomString",property:"custom-string-visual",type:n.TypeName.BASE,etsType:n.EtsType.STRING}},{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomNumber",property:"custom-number-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomBoolean",property:"custom-boolean-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,list:n.booleanListWithClean,defaults:"false"}}],k=[{propertySector:n.Sector.BORDER,propertySet:{name:"Border",property:"border-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-width-visual"},I),Object.assign({name:"Style",property:"border-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-color-visual"},L),Object.assign({name:"Radius",property:"border-radius-visual"},x)]}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderTop",property:"border-top-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-top-width-visual"},I),Object.assign({name:"Style",property:"border-top-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-top-color-visual"},L),Object.assign({name:"TopLeftRadius",property:"border-top-left-radius-visual"},x)],startApi:"9"}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderRight",property:"border-right-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-right-width-visual"},I),Object.assign({name:"Style",property:"border-right-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-right-color-visual"},L),Object.assign({name:"TopRightRadius",property:"border-top-right-radius-visual"},x)],startApi:"9"}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderBottom",property:"border-bottom-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-bottom-width-visual"},I),Object.assign({name:"Style",property:"border-bottom-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-bottom-color-visual"},L),Object.assign({name:"BottomRightRadius",property:"border-bottom-right-radius-visual"},x)],startApi:"9"}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderLeft",property:"border-left-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-left-width-visual"},I),Object.assign({name:"Style",property:"border-left-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-left-color-visual"},L),Object.assign({name:"BottomLeftRadius",property:"border-bottom-left-radius-visual"},x)],startApi:"9"}}],B=[{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageSrc",property:"background-image-src-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_SRC}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageRepeat",property:"background-image-repeat-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_REPERT,list:[n.CLEAN_VALUE_NODE,{name:"X",value:"repeat-x"},{name:"Y",value:"repeat-y"},{name:"XY",value:"repeat"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageSize",property:"background-image-size-visual",type:n.TypeName.DATA_SELECT_INPUT,etsType:`${n.EtsType.IMAGE_SIZE}|${n.EtsType.STRING}`,list:[n.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Auto",value:"auto"}],defaults:"Auto"}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImagePosition",property:"background-image-position-visual",type:n.TypeName.DATA_SELECT_INPUT,etsType:`${n.EtsType.ALIGNMENT}|${n.EtsType.STRING}`,list:[n.CLEAN_VALUE_NODE,{name:"TopStart",value:"top left"},{name:"Top",value:"top center"},{name:"TopEnd",value:"top right"},{name:"Start",value:"center left"},{name:"Center",value:"center center"},{name:"End",value:"center right"},{name:"BottomStart",value:"bottom left"},{name:"Bottom",value:"bottom center"},{name:"BottomEnd",value:"bottom right"}],defaults:"0 0"}}],D=[{propertySector:n.Sector.LAYOUT,propertySet:{name:"Location",property:"position-visual",type:n.TypeName.SELECT,defaults:"offset",supportDynamicProperty:!1,list:[n.CLEAN_VALUE_NODE,{name:"offset",value:"relative"},{name:"position",value:"absolute"}]}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"X",property:"left-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"Y",property:"top-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}}],U=[{propertySector:n.Sector.LAYOUT,propertySet:{name:"DisplayPriority",property:"display-priority-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.EFFECT,propertySet:{name:"Visibility",property:"visibility-visual",type:n.TypeName.SELECT,etsType:n.EtsType.VISIBILITY,defaults:"visible",list:[n.CLEAN_VALUE_NODE,{name:"Visible",value:"visible"},{name:"Hidden",value:"hidden"},{name:"None",value:"none"}]}},{propertySector:n.Sector.EFFECT,propertySet:{name:"Enabled",property:"enabled-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"true",list:[{value:"true"},{value:"false"}]}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"Align",property:"align-visual",type:n.TypeName.SELECT,etsType:n.EtsType.ALIGNMENT,defaults:"center",list:n.alignProperties}},{propertySector:n.Sector.RENDER,propertySet:{name:"If",property:"if-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Space",property:"space-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_LENGTH,units:["vp","px","lpx"],requires:{"display-visual":["flex","cleanValue"]},info:"Space between any two adjacent child components."}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-row-visual",type:n.TypeName.SELECT,etsType:n.EtsType.VERTICAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[n.CLEAN_VALUE_NODE,{value:"flex-start",name:"top",etsEnumValue:"Top"},{value:"flex-end",name:"bottom",etsEnumValue:"Bottom"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the vertical direction."}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-column-visual",type:n.TypeName.SELECT,etsType:n.EtsType.HORIZONTAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[n.CLEAN_VALUE_NODE,{value:"flex-start",name:"start",etsEnumValue:"Start"},{value:"flex-end",name:"end",etsEnumValue:"End"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the horizontal direction."}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Src",property:"src-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_SRC}},{propertySector:n.Sector.MORE,propertySet:{name:"Alt",property:"alt-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_CONTENT}},{propertySector:n.Sector.MORE,propertySet:{name:"RenderMode",property:"render-mode-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_RENDER_MODE,defaults:"original",list:[n.CLEAN_VALUE_NODE,{name:"Original",value:"original"},{name:"Template",value:"template"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"ObjectRepeat",property:"object-repeat-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_REPERT,defaults:"no-repeat",list:[n.CLEAN_VALUE_NODE,{name:"X",value:"X"},{name:"Y",value:"Y"},{name:"XY",value:"XY"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"ObjectFit",property:"object-fit-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_FIT,defaults:"cover",list:[n.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Fill",value:"fill"},{name:"None",value:"none"},{name:"ScaleDown",value:"scale-down"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"InterPolation",property:"interpolation-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_INTERPOLATION,defaults:"none",list:[n.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"High",value:"high"},{name:"Medium",value:"medium"},{name:"Low",value:"low"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"SourceSizeWidth",property:"source-size-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,units:["px"]}},{propertySector:n.Sector.MORE,propertySet:{name:"SourceSizeHeight",property:"source-size-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,units:["px"]}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"type-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BUTTON_TYPE,defaults:"capsule",list:[{name:"Normal",value:"normal"},{name:"Capsule",value:"capsule"},{name:"Circle",value:"circle"}]}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"StateEffect",property:"state-effect-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"true",list:n.booleanList}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Content",property:"content-visual",type:n.TypeName.ADJUSTABLE,etsType:n.EtsType.COMB_CONTENT}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Label",property:"label-visual",type:n.TypeName.ADJUSTABLE,etsType:n.EtsType.COMB_CONTENT}}];t.etsPropertyList=[...F,...k,...R,...O,...M,...i.toggleProperties,..._.checkboxProperties,..._.checkboxGroupProperties,...s.textComponentProperties,...p.textInputProperties,...l.dividerProperties,...D,...c.listProperties,...u.listItemProperties,...y.flexProperties,...d.swiperProperties,...a.refreshProperties,...f.selectProperties,...m.sliderProperties,...A,...B,...g.pickerProperties,...h.searchProperties,...P.scrollProperties,...v.navigationProperties,...b.tabsProperties,...N.tabContentProperties,...U,...E.stackProperties,...T.gridItemProperties,...S.gridProperties]},5958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonPropertyList=void 0;const o=r(1513);t.commonPropertyList=[{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundColor",property:"background-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Display",property:"display-visual",type:o.TypeName.SELECT,defaults:"flex",list:[o.CLEAN_VALUE_NODE,{value:"flex"},{value:"none"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Opacity",property:"opacity-visual",type:o.TypeName.SLIDER,etsType:o.EtsType.COMB_R_NUMBER,defaults:"1",step:.01,max:1,min:0}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Overflow",property:"overflow-visual",type:o.TypeName.SELECT,defaults:"visible",list:[o.CLEAN_VALUE_NODE,{value:"visible"},{value:"hidden"},{value:"scroll"}]}},{propertySector:o.Sector.FLEX,propertySet:{name:"FlexGrow",property:"flex-grow-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:"0",requiresParent:{display:["flex","cleanValue"]},info:"The flex grow factor of a flex item's main size"}},{propertySector:o.Sector.FLEX,propertySet:{name:"FlexShrink",property:"flex-shrink-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:"1",requiresParent:{display:["flex","cleanValue"]},info:"The flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items will shrink"}},{propertySector:o.Sector.FLEX,propertySet:{name:"Columns",property:"columns-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:1,info:"The column number of flex."}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Header Logo",property:"headerLogo-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Title",property:"title-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Status",property:"status-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Logo",property:"logo-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Color",property:"color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontFamily",property:"font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:"sans-serif"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"MaxLines",property:"max-lines-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextColor",property:"text-color-visual",type:o.TypeName.COLOR,defaults:"rgba(0,0,0,0.9)"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FocusColor",property:"focus-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DisappearColor",property:"disappear-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorColor",property:"indicator-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorSelectedColor",property:"indicator-selected-color-visual",type:o.TypeName.COLOR,defaults:"#ff007dff"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorSize",property:"indicator-size-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorTop",property:"indicator-top-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorRight",property:"indicator-right-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorBottom",property:"indicator-bottom-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorLeft",property:"indicator-left-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:{name:"AllowScale",property:"allow-scale-visual",type:o.TypeName.SELECT,defaults:"true",list:[o.CLEAN_VALUE_NODE,{value:"true"},{value:"false"}]}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowStart",property:"grid-row-start-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its row in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnStart",property:"grid-column-start-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its column in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowEnd",property:"grid-row-end-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its row in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnEnd",property:"grid-column-end-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its column in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridTemplateRows",property:"grid-template-rows-visual",type:o.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid rows."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridTemplateColumns",property:"grid-template-columns-visual",type:o.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid columns."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowsGap",property:"grid-rows-gap-visual",type:o.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's grid rows."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnsGap",property:"grid-columns-gap-visual",type:o.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's columns."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridGap",property:"grid-gap-visual",type:o.TypeName.INTEGER,units:["px"],requires:{"display-visual":["grid"]},info:"The gaps between rows and columns. It is a shorthand for row-gap and column-gap."}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"MatchTextDirection",property:"match-text-direction-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"FitOriginalSize",property:"fit-original-size-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"IconWidth",property:"icon-width-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IconHeight",property:"icon-height-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextonColor",property:"texton-color-visual",type:o.TypeName.COLOR,defaults:"#000000"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextoffColor",property:"textoff-color-visual",type:o.TypeName.COLOR,defaults:"#000000"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextPadding",property:"text-padding-visual",type:o.TypeName.INTEGER,defaults:0,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedColor",property:"selected-color-visual",type:o.TypeName.COLOR,defaults:"rgba(0,125,255,1)"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"BlockColor",property:"block-color-visual",type:o.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Radius",property:"radius-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StartAngle",property:"start-angle-visual",type:o.TypeName.INTEGER,defaults:240}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TotalAngle",property:"total-angle-visual",type:o.TypeName.INTEGER,defaults:240}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CenterX",property:"center-x-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CenterY",property:"center-y-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Colors",property:"colors-visual",type:o.TypeName.BASE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Weights",property:"weights-visual",type:o.TypeName.BASE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceHolderColor",property:"placeholder-color-visual",type:o.TypeName.COLOR,defaults:"gray"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ProgressColor",property:"progress-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR,defaults:"black"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ItemExtent",property:"item-extent-visual",type:o.TypeName.INTEGER,units:["px","%"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FadeColor",property:"fade-color-visual",type:o.TypeName.COLOR,defaults:"grey"}},{propertySector:o.Sector.FLEX,propertySet:{name:"ColumnSpan",property:"column-span-visual",type:o.TypeName.INTEGER,defaults:1,min:1,info:"The number of span."}},{propertySector:o.Sector.ATOMIC,propertySet:{name:"FlexWeight",property:"flex-weight-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.ATOMIC,propertySet:{name:"AspectRatio",property:"aspect-ratio-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SecondaryColor",property:"secondary-color-visual",type:o.TypeName.COLOR,requires:{type:["horizontal","ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ScaleWidth",property:"scale-width-visual",type:o.TypeName.INTEGER,requires:{type:["ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ScaleNumber",property:"scale-number-visual",type:o.TypeName.INTEGER,defaults:120,requires:{type:["ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Value",property:"value-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:0}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Total",property:"total-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:100}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Style",property:"style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.PROGRESS_STYLE,defaults:"Linear",list:[{value:"Linear"}]}}]},1513:(e,t)=>{"use strict";var r,o,n,a,i,s,p;Object.defineProperty(t,"__esModule",{value:!0}),t.alignProperties=t.booleanListWithClean=t.booleanList=t.fontWeightList=t.fontSizeUnit=t.etsLength=t.commonFontWeight=t.commonParamsForBorderRadius=t.commonParamsForIndicator=t.commonParamsForInteger=t.commonParamsForJudge=t.commonParamsForBorder=t.CLEAN_VALUE_NODE=t.EtsSpecialType=t.EtsCombinationType=t.EtsBasicType=t.EtsEnumType=t.EtsType=t.TypeName=t.Sector=void 0,function(e){e.GENERAL="general",e.DIMENSION="dimension",e.FEATURE="feature",e.FEATURE_ETS="feature_ets",e.SIZE="size",e.SPACING="spacing",e.BORDER="border",e.BACKGROUND="background",e.LAYOUT="layout",e.RENDER="render",e.FLEX="flex",e.FLEXCHILD="flexchild",e.GRID="grid",e.ATOMIC="atomic",e.CUSTOM="custom",e.TEXT="text",e.TEXTSTYLES="textstyles",e.SELECT="select",e.OPTION="option",e.EFFECT="effect",e.MORE="more"}(r||(r={})),t.Sector=r,function(e){e.BASE="base",e.INTEGER="integer",e.SELECT="select",e.COLOR="color",e.COMPOSITE="composite",e.SLIDER="slider",e.DATA_SELECT_INPUT="dataSelectInput",e.ADJUSTABLE="adjustable"}(o||(o={})),t.TypeName=o,function(e){e.ARRAY="ETSArray",e.BOOLEAN="boolean",e.DATE="Date",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(n||(n={})),t.EtsBasicType=n,function(e){e.R_FLOAT="Rfloat",e.R_STRING="Rstring",e.R_COLOR="Rcolor",e.R_PLURAL="Rplural",e.R_MEDIA="Rmedia",e.R_RAWFILE="Rrawfile"}(a||(a={})),function(e){e.ALIGNMENT="Alignment",e.AXIS="Axis",e.BORDER_STYLE="BorderStyle",e.BUTTON_TYPE="ButtonType",e.COLOR="Color",e.DIRECTION="Direction",e.EDGE_EFFECT="EdgeEffect",e.ENTER_KEY_TYPE="EnterKeyType",e.NAVIGATION_TITLEMODE="NavigationTitleMode",e.FLEX_ALIGN="FlexAlign",e.FLEX_DIRECTION="FlexDirection",e.FLEX_WRAP="FlexWrap",e.FONT_STYLE="FontStyle",e.FONT_WEIGHT="FontWeight",e.HORIZONTAL_ALIGN="HorizontalAlign",e.IMAGE_FIT="ImageFit",e.IMAGE_INTERPOLATION="ImageInterpolation",e.IMAGE_RENDER_MODE="ImageRenderMode",e.IMAGE_REPERT="ImageRepeat",e.IMAGE_SIZE="ImageSize",e.INPUT_TYPE="InputType",e.ITEM_ALIGN="ItemAlign",e.LINE_CAP_STYLE="LineCapStyle",e.PROGRESS_STYLE="ProgressStyle",e.STICKY="Sticky",e.TEXT_ALIGN="TextAlign",e.TEXT_OVERFLOW="TextOverflow",e.TEXT_DECORATION_TYPE="TextDecorationType",e.TEXT_CASE="TextCase",e.TOGGLE_TYPE="ToggleType",e.VERTICAL_ALIGN="VerticalAlign",e.VISIBILITY="Visibility",e.COPY_OPTION="CopyOption",e.BAR_STATE="BarState",e.GRID_DIRECTION="GridDirection",e.SCROLL_DIRECTION="ScrollDirection",e.BAR_POSITION="BarPosition",e.BAR_MODE="BarMode"}(i||(i={})),t.EtsEnumType=i,function(e){e.COMB_COLOR="string|number|Color|Rcolor",e.COMB_LENGTH="string|number",e.COMB_R_NUMBER="number|Rfloat",e.COMB_R_LENGTH="string|number|Rfloat",e.COMB_CONTENT="string|Rstring|Rplural",e.COMB_SRC="string|Rmedia|Rrawfile",e.NON_R_COLOR="string|number|Color"}(s||(s={})),t.EtsCombinationType=s,function(e){e.SCROLLER="Scroller",e.TABS_CONTROLLER="TabsController",e.SEARCH_CONTROLLER="SearchController"}(p||(p={})),t.EtsSpecialType=p;const l=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),a),i),s),p);t.EtsType=l;const c={value:"cleanValue",name:"---Clean Value---"};t.CLEAN_VALUE_NODE=c;const u={type:o.SELECT,etsType:l.BORDER_STYLE,list:[c,{value:"dotted",etsEnumValue:"Dotted"},{value:"dashed",etsEnumValue:"Dashed"},{value:"solid",etsEnumValue:"Solid"}]};t.commonParamsForBorder=u;const y={type:o.SELECT,etsType:l.BOOLEAN,defaults:"false",list:[c,{value:"true"},{value:"false"}]};t.commonParamsForJudge=y;const d={type:o.INTEGER,units:["px"],placeholder:"0px"};t.commonParamsForInteger=d;const f={type:o.INTEGER,units:["px","%"]};t.commonParamsForIndicator=f;const m={type:o.INTEGER,units:["px"]};t.commonParamsForBorderRadius=m;const g=[{value:"100"},{value:"200"},{value:"300"},{value:"400"},{value:"500"},{value:"600"},{value:"700"},{value:"800"},{value:"900"}];t.commonFontWeight=g,t.etsLength=["vp","px","%","lpx"],t.fontSizeUnit=["fp","px","lpx"];const h=[c,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...g];t.fontWeightList=h;const E=[{name:"true",value:"true"},{name:"false",value:"false"}];t.booleanList=E;const T=[c,...E];t.booleanListWithClean=T;const S=[c,{name:"TopStart",value:"top-start"},{name:"Top",value:"top"},{name:"TopEnd",value:"top-end"},{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"},{name:"BottomStart",value:"bottom-start"},{name:"Bottom",value:"bottom"},{name:"BottomEnd",value:"bottom-end"}];t.alignProperties=S},9282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TagTypeMap=void 0,t.TagTypeMap=new Map([["button","TextContent"],["span","TextContent"],["divider","TextContent"],["picker","TextContent"],["option","TextContent"],["clock","TextContent"],["image","Base"],["input","Base"],["chart","Base"],["slider","Base"],["progress","Base"],["text","Text"],["div","Container"],["list","Container"],["list-item","Container"],["list-item-group","Container"],["refresh","Container"],["dialog","Container"],["stack","Container"],["menu","Container"],["select","Container"],["tabs","Container"],["tab-bar","Container"],["tab-content","Container"],["scroll","Container"],["navigation","Container"]])},4294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.beforeCodegen=t.getCustomCompRelativePath=t.getRelativePath=t.prepareCustomCompTagName=t.capitalize=t.getTagName=t.strToBase64=t.getUniqueName=t.getUniqueId=t.removeFromArray=t.getDataName=void 0;const o=r(2891);function n(e){let t=a(e).replace(/[/=+]/g,"");const r=t.length;return r>=4&&(t=t.substring(r/2-2,r/2+2)),t}function a(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");let r="";for(let t=0;t{const t=r.indexOf(e);-1!==t&&r.splice(t,1)})),r},t.getUniqueId=n,t.getUniqueName=function(e){return`${e}_${n(e)}`},t.strToBase64=a;const i=new Map,s=new Map;function p(e){return e[0].toUpperCase()+e.slice(1)}function l(e){const t=(0,o.getInstance)().document.path;if(0===e.size)return;const r=p(t.substring(t.lastIndexOf("/")+1));e.forEach(((e,o)=>{const n=e.length,a=[...e];o===r&&a.push(t);const l=function(e){e.sort();const t=e[0],r=e[e.length-1];let o=0;for(let e=0;e1||o===r)&&(u=p(e[a].substring(l+1).split("/").join("_"))),s.set(e[a],u);const y="/node_modules/";let d=c(e[a],t);e[a].startsWith(y)&&(d=e[a].replace(y,"@"),d=d.replace("src/main/supervisual","src/main/ets")),i.set(u,d)}}))}function c(e,t){const r=e.split("/"),o=t.split("/");let n=0;for(let e=0;e1){const o=p(r[r.length-1]),n=t.get(o);void 0===n?t.set(o,[e.type]):n.push(e.type)}const o=e.children;for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formManager=void 0;const o=r(2891),n=r(5945);t.formManager={removeData(e){this.getFormModel().data.delete(e)},addData(e){e instanceof Map?e.forEach(((e,t)=>{this.getFormModel().data.set(t,e)})):Object.keys(e).forEach((t=>{this.getFormModel().data.set(t,e[t])}))},updateAllData(e){this.getFormModel().data.clear(),this.addData(e)},addAction(e,t,r,o,a){const i=new Map;void 0!==r&&Object.keys(r).forEach((e=>{i.set(e,r[e])}));const s=new Map;void 0!==o&&Object.keys(o).forEach((e=>{s.set(e,o[e])})),this.getFormModel().actions.set(e,new n.FormAction(t,i,s,a))},updateAllActions(e){this.getFormModel().actions.clear(),e.forEach(((e,t)=>{const r=void 0===e.params?e.params:this.objectToMap(e.params),o=void 0===e.want?e.want:this.objectToMap(e.want),a=new n.FormAction(e.actionType,r,o);this.getFormModel().actions.set(t,a)}))},removeAction(e){this.getFormModel().actions.delete(e)},addActionParams(e,t){var r,o;const a=null!==(r=this.getFormModel().actions.get(e))&&void 0!==r?r:new n.FormAction(e),i=null!==(o=a.params)&&void 0!==o?o:new Map;Object.keys(t).forEach((e=>{i.set(e,t[e])})),a.params=i},removeActionParam(e,t){var r;const o=this.getFormModel().actions.get(e);null===(r=null==o?void 0:o.params)||void 0===r||r.delete(t)},getFormModel:()=>(0,o.getInstance)().formData,codegenToJson:function(){const e=(0,o.getInstance)().formData,t=this.mapToObject(e.data),r={actions:{},data:{}};return r.data=t,e.actions.forEach(((e,t)=>{r.actions[t]={},r.actions[t].action=e.action,e.params instanceof Map&&e.params.size>0&&(r.actions[t].params=this.mapToObject(e.params)),e.want instanceof Map&&e.want.size>0&&(r.actions[t].abilityName=e.abilityName,r.actions[t].want=this.mapToObject(e.want))})),JSON.stringify(r,null,4)},clear(){(0,o.getInstance)().formData.data.clear(),(0,o.getInstance)().formData.actions.clear()},mapToObject:e=>void 0===e?{}:Array.from(e.entries()).reduce(((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r})),{}),objectToMap(e){const t=new Map;return Object.keys(e).forEach(((r,o)=>{t.set(r,e[r])})),t}}},5945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormAction=t.FormModel=void 0,t.FormModel=class{constructor(){this.data=new Map,this.actions=new Map}},t.FormAction=class{constructor(e,t,r,o){this.action=e,this.abilityName=o,this.want=r,this.params=t}}},1509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeForVersion1=t.rootToVisualContent=t.visualToRootContent=t.serializeForVersion1=void 0;const o=r(2891),n=r(1933),a=r(7571),i=r(9282),s=r(5945),p=r(7977),l=new Map;function c(e){l.set("textMap",new Map);const t=u(null!=e?e:(0,o.getInstance)().visualModel);return JSON.stringify({VisualVersion:"1",content:JSON.stringify(t),extraData:JSON.stringify(f(l))})}function u(e){const t=Array.from(e.property).filter((t=>(0,a.isAttribute)(t[0],e.type)));t.push(["id",e.id]);const r=Array.from(e.property).filter((t=>(0,a.isStyle)(t[0],e.type)));let o=i.TagTypeMap.get(e.type);void 0===o&&(o="Base");let n=e.property.has("content")?e.property.get("content"):[];if(e.children.length>0){if("string"==typeof n){const t=l.get("textMap");t instanceof Map&&t.set(e.id,n)}n=e.children.map((e=>u(e)))}return{id:e.id,tagName:e.type,attributes:t,idStyle:r,type:o,content:n}}function y(e,t){let r;if(t instanceof Map){const o=t.get("textMap");o instanceof Map&&(r=o.get(e.id))}const o=new n.VisualModel({id:e.id,type:e.tagName,property:new Map([...e.attributes,...e.idStyle])});return"string"==typeof r&&o.property.set("content",r),o.property.delete("id"),"string"==typeof e.content&&o.property.set("content",e.content),Array.isArray(e.content)&&(o.children=e.content.map((e=>y(e,t)))),o}function d(e){if(e instanceof Array&&e.length>0&&"$$map"===e[0]){e.shift();const t=new Map;for(const[r,o]of e)t.set(r,d(o));return t}return e}function f(e){if(e instanceof Map){const t=["$$map"];for(const[r,o]of e)t.push([r,f(o)]);return t}return e}t.serializeForVersion1=c,t.visualToRootContent=function(e){try{return c(JSON.parse(e,p.reviver).visualModel)}catch(e){console.error("convert visual model to root model failed")}return e},t.rootToVisualContent=function(e){const t=JSON.parse(e),r=JSON.parse(t.content);let o='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(o=JSON.parse(t.extraData));const n=y(r,d(o));return n.property.has("flex-direction")||n.property.set("flex-direction","column"),JSON.stringify({document:{VisualVersion:"12",type:"FA"},visualModel:n,formData:new s.FormModel},p.replacer)},t.deserializeForVersion1=function(e){try{const t=JSON.parse(e),r=JSON.parse(t.content);let n='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(n=JSON.parse(t.extraData)),(0,o.getInstance)().visualModel=y(r,d(n)),(0,o.getInstance)().visualModel.property.has("flex-direction")||(0,o.getInstance)().visualModel.property.set("flex-direction","column")}catch(e){console.error("convert error")}}},2891:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setInstance=t.getInstance=t.setVisualPath=t.clearCustomInstance=t.setCustomInstance=t.getInstanceTemplate=t.getCustomInstance=void 0;const o=r(1933),n=r(5945),a=r(904),i={document:{VisualVersion:"12",type:"FA",custom:!1,path:""},visualModel:new o.VisualModel({type:"div",id:"wrapper"}),formData:new n.FormModel},s=new Map;t.getCustomInstance=function(){return s},t.getInstanceTemplate=function(e){return{document:{VisualVersion:"12",type:"ETS",custom:e,path:"&path"},visualModel:new o.VisualModel({type:"column",id:"wrapper"}),imgData:""}},t.setCustomInstance=function(e,t){var r;const n={path:"",document:{VisualVersion:"",type:"",custom:!0},visualModel:new o.VisualModel({type:"",id:""}),methods:[],property:[],imgData:"",originType:[]};n.path=e;for(const e in n)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);n.visualModel=null!==(r=n.visualModel.children[0])&&void 0!==r?r:new o.VisualModel({type:"text"}),s.set(e,n)},t.clearCustomInstance=function(){s.clear()},t.setVisualPath=function(e){i.document.path=e},t.getInstance=function(){return i},t.setInstance=function(e){var t,r,o,n;for(const t in i)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);const s=i.document.type;void 0===i.document.custom&&(i.document.custom=!1),null!==((null!==(r=(null===(t=e.customData)||void 0===t?void 0:t.property.size)>0)&&void 0!==r?r:null)||(null!==(n=(null===(o=e.customData)||void 0===o?void 0:o.event.size)>0)&&void 0!==n?n:null))&&(i.customData=e.customData),(0,a.setDomain)("ETS"===s?a.Domain.ETS:"FORM"===s?a.Domain.FORM:a.Domain.FA)}},7977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviver=t.replacer=t.serializeSketchPage=t.serializeCustom=t.deserializeCustom=t.deserialize=t.serialize=void 0;const o=r(1933),n=r(2891),a=r(1509);function i(e,t){if(t instanceof Map)return{dataType:"Map",value:Object.fromEntries(t.entries())};if(t instanceof Set)return{dataType:"Set",value:Array.from(t.entries())};if(t instanceof o.VisualModel){const e=new o.VisualModel({type:"none"}),r={};for(const o in e)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return{dataType:"VisualModel",value:r}}return t}function s(e,t){if("object"==typeof t&&null!=t){if("Map"===t.dataType)return new Map(Object.entries(t.value));if("Set"===t.dataType)return new Set(t.value);if("VisualModel"===t.dataType){const e=new o.VisualModel({type:""});Object.assign(e,t.value),t=e}}return t}t.serialize=function(e,t){return 1===e?(0,a.serializeForVersion1)(t):JSON.stringify(null!=t?t:(0,n.getInstance)(),i,4)},t.deserialize=function(e){if("1"===JSON.parse(e).VisualVersion)return(0,a.deserializeForVersion1)(e);const t=JSON.parse(e,s);(0,n.setInstance)(t)},t.deserializeCustom=function(e,t){const r=JSON.parse(t,s);(0,n.setCustomInstance)(e,r)},t.serializeCustom=function(e){const t=(0,n.getInstanceTemplate)(!0);return t.visualModel.property=new Map([["width","100%"],["height","100%"]]),t.visualModel.children.push(e),JSON.stringify(t,i,4)},t.serializeSketchPage=function(e){const t=(0,n.getInstanceTemplate)(!1);return t.visualModel=e,JSON.stringify(t,i,4)},t.replacer=i,t.reviver=s},1933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VisualModel=void 0;const r="-visual";t.VisualModel=class{constructor(e){if(this.propertyStorage=void 0,this.dynamicPropertyStorage=void 0,this.mediaProperty=void 0,this.dynamicMediaProperty=void 0,this.mediaPropertyStorage=void 0,this.dynamicMediaPropertyStorage=void 0,this.slots=void 0,this.property=void 0!==e.property?e.property:new Map,this.dynamicProperty=void 0!==e.dynamicProperty?e.dynamicProperty:new Map,this.children=void 0!==e.children?e.children:[],"wrapper"===e.type)return this.id="wrapper",void(this.type="div");e.type.endsWith(r)&&(e.type=e.type.substring(0,e.type.length-r.length)),this.id=void 0!==e.id?e.id:"",this.type=e.type,this.slots=e.slots}getProperty(e){const t=this.dynamicProperty.get(e);return void 0!==t&&""!==t?t:this.property.get(e)}hasMediaProperty(e){if(void 0!==this.mediaProperty)for(const[,t]of this.mediaProperty)if(null==t?void 0:t.has(e))return!0;if(void 0!==this.dynamicMediaProperty)for(const[,t]of this.dynamicMediaProperty)if(null==t?void 0:t.has(e))return!0;return!1}hasProperty(e){return this.dynamicProperty.has(e)||this.property.has(e)}getChildren(){var e;const t=[...this.children];for(const[,r]of null!==(e=this.slots)&&void 0!==e?e:new Map)t.push(r);return t}accept(e){return e.visit(this)}}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={id:o,loaded:!1,exports:{}};return e[o].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var o={};(()=>{"use strict";var e=o;Object.defineProperty(e,"__esModule",{value:!0});const t=r(3784),n=r(2891),a=r(7977),i=r(8844),s=r(1055),p=r(3207),l=r(8413),c=r(4435),u=r(6486),y=r(4294),d={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""};function f(e,r){var o;try{(0,a.deserialize)(e);const t=(0,n.getInstance)().document.VisualVersion,o=/^([1-9]+[0-9]*)$/;if(void 0===t)r.errorType="versionError";else{const e=t.match(o);(null===e||parseInt(e[1])>12)&&(r.errorType="versionError")}}catch(e){r.errorType="fileError"}""!==r.errorType&&(r.errorMessage=null!==(o=t.errorMap.get(r.errorType))&&void 0!==o?o:"Codegen visual file failed")}e.genHmlAndCss=function(e){const r={hmlCss:{hml:"",css:"",json:""},errorType:"",errorMessage:""};if(f(e,r),""!==r.errorType)return r.hmlCss.hml="",r.hmlCss.css="",r;try{const e=function(e){const t={hml:"",css:"",json:""},r=new i.HMLBridge,o=e.accept(r),n=(0,s.genFAHML)(o);t.hml=r.getErrorCount()>0?"error":n;const a=new i.CSSBridge,p=e.accept(a),l=(0,s.genFACSS)(p);return t.css=a.getErrorCount()>0?"error":l,t}((0,n.getInstance)().visualModel);"error"!==e.hml&&"error"!==e.css||(r.errorType="codegenError"),r.hmlCss=e,"FORM"===(0,n.getInstance)().document.type&&(r.hmlCss.json=p.formManager.codegenToJson())}catch(e){r.errorType="modelError"}return""!==r.errorType&&(r.errorMessage=t.errorMap.get(r.errorType),r.hmlCss.hml="",r.hmlCss.css=""),r},e.genETS=function(e){var r;const o={ets:(0,u.cloneDeep)(d),errorType:"",errorMessage:""};if(f(e,o),""!==o.errorType)return o.ets=(0,u.cloneDeep)(d),o;try{let e=(0,n.getInstance)().visualModel;if((0,n.getInstance)().document.custom&&(e=e.children[0],void 0===e))return o;(0,y.beforeCodegen)(e);const t=function(e){const t=new l.ETSBridge,r=e.accept(t),o=(new c.StringWriter).genETS(r);return t.getErrorCount()>0?"error":o}(e);"error"===t&&(o.errorType="codegenError"),o.ets=t}catch(e){o.errorType="modelError"}return""!==o.errorType&&(o.errorMessage=null!==(r=t.errorMap.get(o.errorType))&&void 0!==r?r:"Codegen visual file failed",o.ets=(0,u.cloneDeep)(d)),o}})();var n=exports;for(var a in o)n[a]=o[a];o.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{var e={6486:function(e,t,r){var o;e=r.nmd(e),function(){var n,a="Expected a function",i="__lodash_hash_undefined__",s="__lodash_placeholder__",p=32,l=128,c=1/0,u=9007199254740991,y=NaN,d=4294967295,f=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",p],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",h="[object Boolean]",E="[object Date]",T="[object Error]",S="[object Function]",P="[object GeneratorFunction]",v="[object Map]",b="[object Number]",_="[object Object]",N="[object Promise]",C="[object RegExp]",A="[object Set]",O="[object String]",M="[object Symbol]",w="[object WeakMap]",R="[object ArrayBuffer]",I="[object DataView]",x="[object Float32Array]",L="[object Float64Array]",F="[object Int8Array]",k="[object Int16Array]",B="[object Int32Array]",D="[object Uint8Array]",U="[object Uint8ClampedArray]",V="[object Uint16Array]",G="[object Uint32Array]",z=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,H=RegExp($.source),Y=RegExp(q.source),X=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),oe=/^\s+/,ne=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,pe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ye=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,he=/^(?:0|[1-9]\d*)$/,Ee=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Te=/($^)/,Se=/['\n\r\u2028\u2029\\]/g,Pe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ve="a-z\\xdf-\\xf6\\xf8-\\xff",be="A-Z\\xc0-\\xd6\\xd8-\\xde",_e="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ne="["+_e+"]",Ce="["+Pe+"]",Ae="\\d+",Oe="["+ve+"]",Me="[^\\ud800-\\udfff"+_e+Ae+"\\u2700-\\u27bf"+ve+be+"]",we="\\ud83c[\\udffb-\\udfff]",Re="[^\\ud800-\\udfff]",Ie="(?:\\ud83c[\\udde6-\\uddff]){2}",xe="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+be+"]",Fe="(?:"+Oe+"|"+Me+")",ke="(?:"+Le+"|"+Me+")",Be="(?:['’](?:d|ll|m|re|s|t|ve))?",De="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ue="(?:"+Ce+"|"+we+")?",Ve="[\\ufe0e\\ufe0f]?",Ge=Ve+Ue+"(?:\\u200d(?:"+[Re,Ie,xe].join("|")+")"+Ve+Ue+")*",ze="(?:"+["[\\u2700-\\u27bf]",Ie,xe].join("|")+")"+Ge,je="(?:"+[Re+Ce+"?",Ce,Ie,xe,"[\\ud800-\\udfff]"].join("|")+")",We=RegExp("['’]","g"),$e=RegExp(Ce,"g"),qe=RegExp(we+"(?="+we+")|"+je+Ge,"g"),He=RegExp([Le+"?"+Oe+"+"+Be+"(?="+[Ne,Le,"$"].join("|")+")",ke+"+"+De+"(?="+[Ne,Le+Fe,"$"].join("|")+")",Le+"?"+Fe+"+"+Be,Le+"+"+De,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,ze].join("|"),"g"),Ye=RegExp("[\\u200d\\ud800-\\udfff"+Pe+"\\ufe0e\\ufe0f]"),Xe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Je=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Qe=-1,Ke={};Ke[x]=Ke[L]=Ke[F]=Ke[k]=Ke[B]=Ke[D]=Ke[U]=Ke[V]=Ke[G]=!0,Ke[m]=Ke[g]=Ke[R]=Ke[h]=Ke[I]=Ke[E]=Ke[T]=Ke[S]=Ke[v]=Ke[b]=Ke[_]=Ke[C]=Ke[A]=Ke[O]=Ke[w]=!1;var Ze={};Ze[m]=Ze[g]=Ze[R]=Ze[I]=Ze[h]=Ze[E]=Ze[x]=Ze[L]=Ze[F]=Ze[k]=Ze[B]=Ze[v]=Ze[b]=Ze[_]=Ze[C]=Ze[A]=Ze[O]=Ze[M]=Ze[D]=Ze[U]=Ze[V]=Ze[G]=!0,Ze[T]=Ze[S]=Ze[w]=!1;var et={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tt=parseFloat,rt=parseInt,ot="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,nt="object"==typeof self&&self&&self.Object===Object&&self,at=ot||nt||Function("return this")(),it=t&&!t.nodeType&&t,st=it&&e&&!e.nodeType&&e,pt=st&&st.exports===it,lt=pt&&ot.process,ct=function(){try{return st&&st.require&&st.require("util").types||lt&<.binding&<.binding("util")}catch(e){}}(),ut=ct&&ct.isArrayBuffer,yt=ct&&ct.isDate,dt=ct&&ct.isMap,ft=ct&&ct.isRegExp,mt=ct&&ct.isSet,gt=ct&&ct.isTypedArray;function ht(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Et(e,t,r,o){for(var n=-1,a=null==e?0:e.length;++n-1}function _t(e,t,r){for(var o=-1,n=null==e?0:e.length;++o-1;);return r}function Ht(e,t){for(var r=e.length;r--&&xt(t,e[r],0)>-1;);return r}function Yt(e,t){for(var r=e.length,o=0;r--;)e[r]===t&&++o;return o}var Xt=Dt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Jt=Dt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Qt(e){return"\\"+et[e]}function Kt(e){return Ye.test(e)}function Zt(e){var t=-1,r=Array(e.size);return e.forEach((function(e,o){r[++t]=[o,e]})),r}function er(e,t){return function(r){return e(t(r))}}function tr(e,t){for(var r=-1,o=e.length,n=0,a=[];++r",""":'"',"'":"'"}),pr=function e(t){var r,o=(t=null==t?at:pr.defaults(at.Object(),t,pr.pick(at,Je))).Array,ne=t.Date,Pe=t.Error,ve=t.Function,be=t.Math,_e=t.Object,Ne=t.RegExp,Ce=t.String,Ae=t.TypeError,Oe=o.prototype,Me=ve.prototype,we=_e.prototype,Re=t["__core-js_shared__"],Ie=Me.toString,xe=we.hasOwnProperty,Le=0,Fe=(r=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",ke=we.toString,Be=Ie.call(_e),De=at._,Ue=Ne("^"+Ie.call(xe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=pt?t.Buffer:n,Ge=t.Symbol,ze=t.Uint8Array,je=Ve?Ve.allocUnsafe:n,qe=er(_e.getPrototypeOf,_e),Ye=_e.create,et=we.propertyIsEnumerable,ot=Oe.splice,nt=Ge?Ge.isConcatSpreadable:n,it=Ge?Ge.iterator:n,st=Ge?Ge.toStringTag:n,lt=function(){try{var e=ca(_e,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==at.clearTimeout&&t.clearTimeout,wt=ne&&ne.now!==at.Date.now&&ne.now,Dt=t.setTimeout!==at.setTimeout&&t.setTimeout,lr=be.ceil,cr=be.floor,ur=_e.getOwnPropertySymbols,yr=Ve?Ve.isBuffer:n,dr=t.isFinite,fr=Oe.join,mr=er(_e.keys,_e),gr=be.max,hr=be.min,Er=ne.now,Tr=t.parseInt,Sr=be.random,Pr=Oe.reverse,vr=ca(t,"DataView"),br=ca(t,"Map"),_r=ca(t,"Promise"),Nr=ca(t,"Set"),Cr=ca(t,"WeakMap"),Ar=ca(_e,"create"),Or=Cr&&new Cr,Mr={},wr=Ua(vr),Rr=Ua(br),Ir=Ua(_r),xr=Ua(Nr),Lr=Ua(Cr),Fr=Ge?Ge.prototype:n,kr=Fr?Fr.valueOf:n,Br=Fr?Fr.toString:n;function Dr(e){if(rs(e)&&!$i(e)&&!(e instanceof zr)){if(e instanceof Gr)return e;if(xe.call(e,"__wrapped__"))return Va(e)}return new Gr(e)}var Ur=function(){function e(){}return function(t){if(!ts(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Vr(){}function Gr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function zr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function jr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function io(e,t,r,o,a,i){var s,p=1&t,l=2&t,c=4&t;if(r&&(s=a?r(e,o,a,i):r(e)),s!==n)return s;if(!ts(e))return e;var u=$i(e);if(u){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&xe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!p)return On(e,s)}else{var y=da(e),d=y==S||y==P;if(Xi(e))return vn(e,p);if(y==_||y==m||d&&!a){if(s=l||d?{}:ma(e),!p)return l?function(e,t){return Mn(e,ya(e),t)}(e,function(e,t){return e&&Mn(t,xs(t),e)}(s,e)):function(e,t){return Mn(e,ua(e),t)}(e,ro(s,e))}else{if(!Ze[y])return a?e:{};s=function(e,t,r){var o,n=e.constructor;switch(t){case R:return bn(e);case h:case E:return new n(+e);case I:return function(e,t){var r=t?bn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case x:case L:case F:case k:case B:case D:case U:case V:case G:return _n(e,r);case v:return new n;case b:case O:return new n(e);case C:return function(e){var t=new e.constructor(e.source,ye.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new n;case M:return o=e,kr?_e(kr.call(o)):{}}}(e,y,p)}}i||(i=new Hr);var f=i.get(e);if(f)return f;i.set(e,s),ss(e)?e.forEach((function(o){s.add(io(o,t,r,o,e,i))})):os(e)&&e.forEach((function(o,n){s.set(n,io(o,t,r,n,e,i))}));var g=u?n:(c?l?oa:ra:l?xs:Is)(e);return Tt(g||e,(function(o,n){g&&(o=e[n=o]),Zr(s,n,io(o,t,r,n,e,i))})),s}function so(e,t,r){var o=r.length;if(null==e)return!o;for(e=_e(e);o--;){var a=r[o],i=t[a],s=e[a];if(s===n&&!(a in e)||!i(s))return!1}return!0}function po(e,t,r){if("function"!=typeof e)throw new Ae(a);return wa((function(){e.apply(n,r)}),t)}function lo(e,t,r,o){var n=-1,a=bt,i=!0,s=e.length,p=[],l=t.length;if(!s)return p;r&&(t=Nt(t,jt(r))),o?(a=_t,i=!1):t.length>=200&&(a=$t,i=!1,t=new qr(t));e:for(;++n-1},Wr.prototype.set=function(e,t){var r=this.__data__,o=eo(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new jr,map:new(br||Wr),string:new jr}},$r.prototype.delete=function(e){var t=pa(this,e).delete(e);return this.size-=t?1:0,t},$r.prototype.get=function(e){return pa(this,e).get(e)},$r.prototype.has=function(e){return pa(this,e).has(e)},$r.prototype.set=function(e,t){var r=pa(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this},qr.prototype.add=qr.prototype.push=function(e){return this.__data__.set(e,i),this},qr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Hr.prototype.get=function(e){return this.__data__.get(e)},Hr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var o=r.__data__;if(!br||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new $r(o)}return r.set(e,t),this.size=r.size,this};var co=In(To),uo=In(So,!0);function yo(e,t){var r=!0;return co(e,(function(e,o,n){return r=!!t(e,o,n)})),r}function fo(e,t,r){for(var o=-1,a=e.length;++o0&&r(s)?t>1?go(s,t-1,r,o,n):Ct(n,s):o||(n[n.length]=s)}return n}var ho=xn(),Eo=xn(!0);function To(e,t){return e&&ho(e,t,Is)}function So(e,t){return e&&Eo(e,t,Is)}function Po(e,t){return vt(t,(function(t){return Ki(e[t])}))}function vo(e,t){for(var r=0,o=(t=En(t,e)).length;null!=e&&rt}function Co(e,t){return null!=e&&xe.call(e,t)}function Ao(e,t){return null!=e&&t in _e(e)}function Oo(e,t,r){for(var a=r?_t:bt,i=e[0].length,s=e.length,p=s,l=o(s),c=1/0,u=[];p--;){var y=e[p];p&&t&&(y=Nt(y,jt(t))),c=hr(y.length,c),l[p]=!r&&(t||i>=120&&y.length>=120)?new qr(p&&y):n}y=e[0];var d=-1,f=l[0];e:for(;++d=s?p:p*("desc"==r[o]?-1:1)}return e.index-t.index}(e,t,r)}));o--;)e[o]=e[o].value;return e}(n)}function jo(e,t,r){for(var o=-1,n=t.length,a={};++o-1;)s!==e&&ot.call(s,p,1),ot.call(e,p,1);return e}function $o(e,t){for(var r=e?t.length:0,o=r-1;r--;){var n=t[r];if(r==o||n!==a){var a=n;ha(n)?ot.call(e,n,1):cn(e,n)}}return e}function qo(e,t){return e+cr(Sr()*(t-e+1))}function Ho(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=cr(t/2))&&(e+=e)}while(t);return r}function Yo(e,t){return Ra(Na(e,t,np),e+"")}function Xo(e){return Xr(Gs(e))}function Jo(e,t){var r=Gs(e);return La(r,ao(t,0,r.length))}function Qo(e,t,r,o){if(!ts(e))return e;for(var a=-1,i=(t=En(t,e)).length,s=i-1,p=e;null!=p&&++aa?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=o(a);++n>>1,i=e[a];null!==i&&!ls(i)&&(r?i<=t:i=200){var l=t?null:Yn(e);if(l)return rr(l);i=!1,n=$t,p=new qr}else p=t?[]:s;e:for(;++o=o?e:tn(e,t,r)}var Pn=ct||function(e){return at.clearTimeout(e)};function vn(e,t){if(t)return e.slice();var r=e.length,o=je?je(r):new e.constructor(r);return e.copy(o),o}function bn(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function _n(e,t){var r=t?bn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Nn(e,t){if(e!==t){var r=e!==n,o=null===e,a=e==e,i=ls(e),s=t!==n,p=null===t,l=t==t,c=ls(t);if(!p&&!c&&!i&&e>t||i&&s&&l&&!p&&!c||o&&s&&l||!r&&l||!a)return 1;if(!o&&!i&&!c&&e1?r[a-1]:n,s=a>2?r[2]:n;for(i=e.length>3&&"function"==typeof i?(a--,i):n,s&&Ea(r[0],r[1],s)&&(i=a<3?n:i,a=1),t=_e(t);++o-1?a[i?t[s]:s]:n}}function Dn(e){return ta((function(t){var r=t.length,o=r,i=Gr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ae(a);if(i&&!p&&"wrapper"==aa(s))var p=new Gr([],!0)}for(o=p?o:r;++o1&&T.reverse(),d&&up))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var y=-1,d=!0,f=2&r?new qr:n;for(i.set(e,t),i.set(t,e);++y-1&&e%1==0&&e1?"& ":"")+t[o],t=t.join(r>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(o,function(e,t){return Tt(f,(function(r){var o="_."+r[0];t&r[1]&&!bt(e,o)&&e.push(o)})),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(se):[]}(o),r)))}function xa(e){var t=0,r=0;return function(){var o=Er(),a=16-(o-r);if(r=o,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function La(e,t){var r=-1,o=e.length,a=o-1;for(t=t===n?o:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ii(e,r)}));function di(e){var t=Dr(e);return t.__chain__=!0,t}function fi(e,t){return t(e)}var mi=ta((function(e){var t=e.length,r=t?e[0]:0,o=this.__wrapped__,a=function(t){return no(t,e)};return!(t>1||this.__actions__.length)&&o instanceof zr&&ha(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:fi,args:[a],thisArg:n}),new Gr(o,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(a)})),gi=wn((function(e,t,r){xe.call(e,r)?++e[r]:oo(e,r,1)})),hi=Bn(Wa),Ei=Bn($a);function Ti(e,t){return($i(e)?Tt:co)(e,sa(t,3))}function Si(e,t){return($i(e)?St:uo)(e,sa(t,3))}var Pi=wn((function(e,t,r){xe.call(e,r)?e[r].push(t):oo(e,r,[t])})),vi=Yo((function(e,t,r){var n=-1,a="function"==typeof t,i=Hi(e)?o(e.length):[];return co(e,(function(e){i[++n]=a?ht(t,e,r):Mo(e,t,r)})),i})),bi=wn((function(e,t,r){oo(e,r,t)}));function _i(e,t){return($i(e)?Nt:Bo)(e,sa(t,3))}var Ni=wn((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Ci=Yo((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ea(e,t[0],t[1])?t=[]:r>2&&Ea(t[0],t[1],t[2])&&(t=[t[0]]),zo(e,go(t,1),[])})),Ai=wt||function(){return at.Date.now()};function Oi(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Jn(e,l,n,n,n,n,t)}function Mi(e,t){var r;if("function"!=typeof t)throw new Ae(a);return e=ms(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var wi=Yo((function(e,t,r){var o=1;if(r.length){var n=tr(r,ia(wi));o|=p}return Jn(e,o,t,r,n)})),Ri=Yo((function(e,t,r){var o=3;if(r.length){var n=tr(r,ia(Ri));o|=p}return Jn(t,o,e,r,n)}));function Ii(e,t,r){var o,i,s,p,l,c,u=0,y=!1,d=!1,f=!0;if("function"!=typeof e)throw new Ae(a);function m(t){var r=o,a=i;return o=i=n,u=t,p=e.apply(a,r)}function g(e){return u=e,l=wa(E,t),y?m(e):p}function h(e){var r=e-c;return c===n||r>=t||r<0||d&&e-u>=s}function E(){var e=Ai();if(h(e))return T(e);l=wa(E,function(e){var r=t-(e-c);return d?hr(r,s-(e-u)):r}(e))}function T(e){return l=n,f&&o?m(e):(o=i=n,p)}function S(){var e=Ai(),r=h(e);if(o=arguments,i=this,c=e,r){if(l===n)return g(c);if(d)return Pn(l),l=wa(E,t),m(c)}return l===n&&(l=wa(E,t)),p}return t=hs(t)||0,ts(r)&&(y=!!r.leading,s=(d="maxWait"in r)?gr(hs(r.maxWait)||0,t):s,f="trailing"in r?!!r.trailing:f),S.cancel=function(){l!==n&&Pn(l),u=0,o=c=i=l=n},S.flush=function(){return l===n?p:T(Ai())},S}var xi=Yo((function(e,t){return po(e,1,t)})),Li=Yo((function(e,t,r){return po(e,hs(t)||0,r)}));function Fi(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ae(a);var r=function(){var o=arguments,n=t?t.apply(this,o):o[0],a=r.cache;if(a.has(n))return a.get(n);var i=e.apply(this,o);return r.cache=a.set(n,i)||a,i};return r.cache=new(Fi.Cache||$r),r}function ki(e){if("function"!=typeof e)throw new Ae(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Fi.Cache=$r;var Bi=Tn((function(e,t){var r=(t=1==t.length&&$i(t[0])?Nt(t[0],jt(sa())):Nt(go(t,1),jt(sa()))).length;return Yo((function(o){for(var n=-1,a=hr(o.length,r);++n=t})),Wi=wo(function(){return arguments}())?wo:function(e){return rs(e)&&xe.call(e,"callee")&&!et.call(e,"callee")},$i=o.isArray,qi=ut?jt(ut):function(e){return rs(e)&&_o(e)==R};function Hi(e){return null!=e&&es(e.length)&&!Ki(e)}function Yi(e){return rs(e)&&Hi(e)}var Xi=yr||hp,Ji=yt?jt(yt):function(e){return rs(e)&&_o(e)==E};function Qi(e){if(!rs(e))return!1;var t=_o(e);return t==T||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function Ki(e){if(!ts(e))return!1;var t=_o(e);return t==S||t==P||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zi(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var os=dt?jt(dt):function(e){return rs(e)&&da(e)==v};function ns(e){return"number"==typeof e||rs(e)&&_o(e)==b}function as(e){if(!rs(e)||_o(e)!=_)return!1;var t=qe(e);if(null===t)return!0;var r=xe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Ie.call(r)==Be}var is=ft?jt(ft):function(e){return rs(e)&&_o(e)==C},ss=mt?jt(mt):function(e){return rs(e)&&da(e)==A};function ps(e){return"string"==typeof e||!$i(e)&&rs(e)&&_o(e)==O}function ls(e){return"symbol"==typeof e||rs(e)&&_o(e)==M}var cs=gt?jt(gt):function(e){return rs(e)&&es(e.length)&&!!Ke[_o(e)]},us=$n(ko),ys=$n((function(e,t){return e<=t}));function ds(e){if(!e)return[];if(Hi(e))return ps(e)?ar(e):On(e);if(it&&e[it])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[it]());var t=da(e);return(t==v?Zt:t==A?rr:Gs)(e)}function fs(e){return e?(e=hs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=fs(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?ao(ms(e),0,d):0}function hs(e){if("number"==typeof e)return e;if(ls(e))return y;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=zt(e);var r=fe.test(e);return r||ge.test(e)?rt(e.slice(2),r?2:8):de.test(e)?y:+e}function Es(e){return Mn(e,xs(e))}function Ts(e){return null==e?"":pn(e)}var Ss=Rn((function(e,t){if(va(t)||Hi(t))Mn(t,Is(t),e);else for(var r in t)xe.call(t,r)&&Zr(e,r,t[r])})),Ps=Rn((function(e,t){Mn(t,xs(t),e)})),vs=Rn((function(e,t,r,o){Mn(t,xs(t),e,o)})),bs=Rn((function(e,t,r,o){Mn(t,Is(t),e,o)})),_s=ta(no),Ns=Yo((function(e,t){e=_e(e);var r=-1,o=t.length,a=o>2?t[2]:n;for(a&&Ea(t[0],t[1],a)&&(o=1);++r1),t})),Mn(e,oa(e),r),o&&(r=io(r,7,Zn));for(var n=t.length;n--;)cn(r,t[n]);return r})),Bs=ta((function(e,t){return null==e?{}:function(e,t){return jo(e,t,(function(t,r){return Os(e,r)}))}(e,t)}));function Ds(e,t){if(null==e)return{};var r=Nt(oa(e),(function(e){return[e]}));return t=sa(t),jo(e,r,(function(e,r){return t(e,r[0])}))}var Us=Xn(Is),Vs=Xn(xs);function Gs(e){return null==e?[]:Wt(e,Is(e))}var zs=Fn((function(e,t,r){return t=t.toLowerCase(),e+(r?js(t):t)}));function js(e){return Qs(Ts(e).toLowerCase())}function Ws(e){return(e=Ts(e))&&e.replace(Ee,Xt).replace($e,"")}var $s=Fn((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),qs=Fn((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Hs=Ln("toLowerCase"),Ys=Fn((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Xs=Fn((function(e,t,r){return e+(r?" ":"")+Qs(t)})),Js=Fn((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Qs=Ln("toUpperCase");function Ks(e,t,r){return e=Ts(e),(t=r?n:t)===n?function(e){return Xe.test(e)}(e)?function(e){return e.match(He)||[]}(e):function(e){return e.match(pe)||[]}(e):e.match(t)||[]}var Zs=Yo((function(e,t){try{return ht(e,n,t)}catch(e){return Qi(e)?e:new Pe(e)}})),ep=ta((function(e,t){return Tt(t,(function(t){t=Da(t),oo(e,t,wi(e[t],e))})),e}));function tp(e){return function(){return e}}var rp=Dn(),op=Dn(!0);function np(e){return e}function ap(e){return Lo("function"==typeof e?e:io(e,1))}var ip=Yo((function(e,t){return function(r){return Mo(r,e,t)}})),sp=Yo((function(e,t){return function(r){return Mo(e,r,t)}}));function pp(e,t,r){var o=Is(t),n=Po(t,o);null!=r||ts(t)&&(n.length||!o.length)||(r=t,t=e,e=this,n=Po(t,Is(t)));var a=!(ts(r)&&"chain"in r&&!r.chain),i=Ki(e);return Tt(n,(function(r){var o=t[r];e[r]=o,i&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__),n=r.__actions__=On(this.__actions__);return n.push({func:o,args:arguments,thisArg:e}),r.__chain__=t,r}return o.apply(e,Ct([this.value()],arguments))})})),e}function lp(){}var cp=zn(Nt),up=zn(Pt),yp=zn(Mt);function dp(e){return Ta(e)?Bt(Da(e)):function(e){return function(t){return vo(t,e)}}(e)}var fp=Wn(),mp=Wn(!0);function gp(){return[]}function hp(){return!1}var Ep,Tp=Gn((function(e,t){return e+t}),0),Sp=Hn("ceil"),Pp=Gn((function(e,t){return e/t}),1),vp=Hn("floor"),bp=Gn((function(e,t){return e*t}),1),_p=Hn("round"),Np=Gn((function(e,t){return e-t}),0);return Dr.after=function(e,t){if("function"!=typeof t)throw new Ae(a);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},Dr.ary=Oi,Dr.assign=Ss,Dr.assignIn=Ps,Dr.assignInWith=vs,Dr.assignWith=bs,Dr.at=_s,Dr.before=Mi,Dr.bind=wi,Dr.bindAll=ep,Dr.bindKey=Ri,Dr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $i(e)?e:[e]},Dr.chain=di,Dr.chunk=function(e,t,r){t=(r?Ea(e,t,r):t===n)?1:gr(ms(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var i=0,s=0,p=o(lr(a/t));ia?0:a+r),(o=o===n||o>a?a:ms(o))<0&&(o+=a),o=r>o?0:gs(o);r>>0)?(e=Ts(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=pn(t))&&Kt(e)?Sn(ar(e),0,r):e.split(t,r):[]},Dr.spread=function(e,t){if("function"!=typeof e)throw new Ae(a);return t=null==t?0:gr(ms(t),0),Yo((function(r){var o=r[t],n=Sn(r,0,t);return o&&Ct(n,o),ht(e,this,n)}))},Dr.tail=function(e){var t=null==e?0:e.length;return t?tn(e,1,t):[]},Dr.take=function(e,t,r){return e&&e.length?tn(e,0,(t=r||t===n?1:ms(t))<0?0:t):[]},Dr.takeRight=function(e,t,r){var o=null==e?0:e.length;return o?tn(e,(t=o-(t=r||t===n?1:ms(t)))<0?0:t,o):[]},Dr.takeRightWhile=function(e,t){return e&&e.length?yn(e,sa(t,3),!1,!0):[]},Dr.takeWhile=function(e,t){return e&&e.length?yn(e,sa(t,3)):[]},Dr.tap=function(e,t){return t(e),e},Dr.throttle=function(e,t,r){var o=!0,n=!0;if("function"!=typeof e)throw new Ae(a);return ts(r)&&(o="leading"in r?!!r.leading:o,n="trailing"in r?!!r.trailing:n),Ii(e,t,{leading:o,maxWait:t,trailing:n})},Dr.thru=fi,Dr.toArray=ds,Dr.toPairs=Us,Dr.toPairsIn=Vs,Dr.toPath=function(e){return $i(e)?Nt(e,Da):ls(e)?[e]:On(Ba(Ts(e)))},Dr.toPlainObject=Es,Dr.transform=function(e,t,r){var o=$i(e),n=o||Xi(e)||cs(e);if(t=sa(t,4),null==r){var a=e&&e.constructor;r=n?o?new a:[]:ts(e)&&Ki(a)?Ur(qe(e)):{}}return(n?Tt:To)(e,(function(e,o,n){return t(r,e,o,n)})),r},Dr.unary=function(e){return Oi(e,1)},Dr.union=ri,Dr.unionBy=oi,Dr.unionWith=ni,Dr.uniq=function(e){return e&&e.length?ln(e):[]},Dr.uniqBy=function(e,t){return e&&e.length?ln(e,sa(t,2)):[]},Dr.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ln(e,n,t):[]},Dr.unset=function(e,t){return null==e||cn(e,t)},Dr.unzip=ai,Dr.unzipWith=ii,Dr.update=function(e,t,r){return null==e?e:un(e,t,hn(r))},Dr.updateWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:un(e,t,hn(r),o)},Dr.values=Gs,Dr.valuesIn=function(e){return null==e?[]:Wt(e,xs(e))},Dr.without=si,Dr.words=Ks,Dr.wrap=function(e,t){return Di(hn(t),e)},Dr.xor=pi,Dr.xorBy=li,Dr.xorWith=ci,Dr.zip=ui,Dr.zipObject=function(e,t){return mn(e||[],t||[],Zr)},Dr.zipObjectDeep=function(e,t){return mn(e||[],t||[],Qo)},Dr.zipWith=yi,Dr.entries=Us,Dr.entriesIn=Vs,Dr.extend=Ps,Dr.extendWith=vs,pp(Dr,Dr),Dr.add=Tp,Dr.attempt=Zs,Dr.camelCase=zs,Dr.capitalize=js,Dr.ceil=Sp,Dr.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=hs(r))==r?r:0),t!==n&&(t=(t=hs(t))==t?t:0),ao(hs(e),t,r)},Dr.clone=function(e){return io(e,4)},Dr.cloneDeep=function(e){return io(e,5)},Dr.cloneDeepWith=function(e,t){return io(e,5,t="function"==typeof t?t:n)},Dr.cloneWith=function(e,t){return io(e,4,t="function"==typeof t?t:n)},Dr.conformsTo=function(e,t){return null==t||so(e,t,Is(t))},Dr.deburr=Ws,Dr.defaultTo=function(e,t){return null==e||e!=e?t:e},Dr.divide=Pp,Dr.endsWith=function(e,t,r){e=Ts(e),t=pn(t);var o=e.length,a=r=r===n?o:ao(ms(r),0,o);return(r-=t.length)>=0&&e.slice(r,a)==t},Dr.eq=Gi,Dr.escape=function(e){return(e=Ts(e))&&Y.test(e)?e.replace(q,Jt):e},Dr.escapeRegExp=function(e){return(e=Ts(e))&&re.test(e)?e.replace(te,"\\$&"):e},Dr.every=function(e,t,r){var o=$i(e)?Pt:yo;return r&&Ea(e,t,r)&&(t=n),o(e,sa(t,3))},Dr.find=hi,Dr.findIndex=Wa,Dr.findKey=function(e,t){return Rt(e,sa(t,3),To)},Dr.findLast=Ei,Dr.findLastIndex=$a,Dr.findLastKey=function(e,t){return Rt(e,sa(t,3),So)},Dr.floor=vp,Dr.forEach=Ti,Dr.forEachRight=Si,Dr.forIn=function(e,t){return null==e?e:ho(e,sa(t,3),xs)},Dr.forInRight=function(e,t){return null==e?e:Eo(e,sa(t,3),xs)},Dr.forOwn=function(e,t){return e&&To(e,sa(t,3))},Dr.forOwnRight=function(e,t){return e&&So(e,sa(t,3))},Dr.get=As,Dr.gt=zi,Dr.gte=ji,Dr.has=function(e,t){return null!=e&&fa(e,t,Co)},Dr.hasIn=Os,Dr.head=Ha,Dr.identity=np,Dr.includes=function(e,t,r,o){e=Hi(e)?e:Gs(e),r=r&&!o?ms(r):0;var n=e.length;return r<0&&(r=gr(n+r,0)),ps(e)?r<=n&&e.indexOf(t,r)>-1:!!n&&xt(e,t,r)>-1},Dr.indexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var n=null==r?0:ms(r);return n<0&&(n=gr(o+n,0)),xt(e,t,n)},Dr.inRange=function(e,t,r){return t=fs(t),r===n?(r=t,t=0):r=fs(r),function(e,t,r){return e>=hr(t,r)&&e=-9007199254740991&&e<=u},Dr.isSet=ss,Dr.isString=ps,Dr.isSymbol=ls,Dr.isTypedArray=cs,Dr.isUndefined=function(e){return e===n},Dr.isWeakMap=function(e){return rs(e)&&da(e)==w},Dr.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==_o(e)},Dr.join=function(e,t){return null==e?"":fr.call(e,t)},Dr.kebabCase=$s,Dr.last=Qa,Dr.lastIndexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var a=o;return r!==n&&(a=(a=ms(r))<0?gr(o+a,0):hr(a,o-1)),t==t?function(e,t,r){for(var o=r+1;o--;)if(e[o]===t)return o;return o}(e,t,a):It(e,Ft,a,!0)},Dr.lowerCase=qs,Dr.lowerFirst=Hs,Dr.lt=us,Dr.lte=ys,Dr.max=function(e){return e&&e.length?fo(e,np,No):n},Dr.maxBy=function(e,t){return e&&e.length?fo(e,sa(t,2),No):n},Dr.mean=function(e){return kt(e,np)},Dr.meanBy=function(e,t){return kt(e,sa(t,2))},Dr.min=function(e){return e&&e.length?fo(e,np,ko):n},Dr.minBy=function(e,t){return e&&e.length?fo(e,sa(t,2),ko):n},Dr.stubArray=gp,Dr.stubFalse=hp,Dr.stubObject=function(){return{}},Dr.stubString=function(){return""},Dr.stubTrue=function(){return!0},Dr.multiply=bp,Dr.nth=function(e,t){return e&&e.length?Go(e,ms(t)):n},Dr.noConflict=function(){return at._===this&&(at._=De),this},Dr.noop=lp,Dr.now=Ai,Dr.pad=function(e,t,r){e=Ts(e);var o=(t=ms(t))?nr(e):0;if(!t||o>=t)return e;var n=(t-o)/2;return jn(cr(n),r)+e+jn(lr(n),r)},Dr.padEnd=function(e,t,r){e=Ts(e);var o=(t=ms(t))?nr(e):0;return t&&ot){var o=e;e=t,t=o}if(r||e%1||t%1){var a=Sr();return hr(e+a*(t-e+tt("1e-"+((a+"").length-1))),t)}return qo(e,t)},Dr.reduce=function(e,t,r){var o=$i(e)?At:Ut,n=arguments.length<3;return o(e,sa(t,4),r,n,co)},Dr.reduceRight=function(e,t,r){var o=$i(e)?Ot:Ut,n=arguments.length<3;return o(e,sa(t,4),r,n,uo)},Dr.repeat=function(e,t,r){return t=(r?Ea(e,t,r):t===n)?1:ms(t),Ho(Ts(e),t)},Dr.replace=function(){var e=arguments,t=Ts(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dr.result=function(e,t,r){var o=-1,a=(t=En(t,e)).length;for(a||(a=1,e=n);++ou)return[];var r=d,o=hr(e,d);t=sa(t),e-=d;for(var n=Gt(o,t);++r=i)return e;var p=r-nr(o);if(p<1)return o;var l=s?Sn(s,0,p).join(""):e.slice(0,p);if(a===n)return l+o;if(s&&(p+=l.length-p),is(a)){if(e.slice(p).search(a)){var c,u=l;for(a.global||(a=Ne(a.source,Ts(ye.exec(a))+"g")),a.lastIndex=0;c=a.exec(u);)var y=c.index;l=l.slice(0,y===n?p:y)}}else if(e.indexOf(pn(a),p)!=p){var d=l.lastIndexOf(a);d>-1&&(l=l.slice(0,d))}return l+o},Dr.unescape=function(e){return(e=Ts(e))&&H.test(e)?e.replace($,sr):e},Dr.uniqueId=function(e){var t=++Le;return Ts(e)+t},Dr.upperCase=Js,Dr.upperFirst=Qs,Dr.each=Ti,Dr.eachRight=Si,Dr.first=Ha,pp(Dr,(Ep={},To(Dr,(function(e,t){xe.call(Dr.prototype,t)||(Ep[t]=e)})),Ep),{chain:!1}),Dr.VERSION="4.17.21",Tt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Dr[e].placeholder=Dr})),Tt(["drop","take"],(function(e,t){zr.prototype[e]=function(r){r=r===n?1:gr(ms(r),0);var o=this.__filtered__&&!t?new zr(this):this.clone();return o.__filtered__?o.__takeCount__=hr(r,o.__takeCount__):o.__views__.push({size:hr(r,d),type:e+(o.__dir__<0?"Right":"")}),o},zr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Tt(["filter","map","takeWhile"],(function(e,t){var r=t+1,o=1==r||3==r;zr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:sa(e,3),type:r}),t.__filtered__=t.__filtered__||o,t}})),Tt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");zr.prototype[e]=function(){return this[r](1).value()[0]}})),Tt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");zr.prototype[e]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(np)},zr.prototype.find=function(e){return this.filter(e).head()},zr.prototype.findLast=function(e){return this.reverse().find(e)},zr.prototype.invokeMap=Yo((function(e,t){return"function"==typeof e?new zr(this):this.map((function(r){return Mo(r,e,t)}))})),zr.prototype.reject=function(e){return this.filter(ki(sa(e)))},zr.prototype.slice=function(e,t){e=ms(e);var r=this;return r.__filtered__&&(e>0||t<0)?new zr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ms(t))<0?r.dropRight(-t):r.take(t-e)),r)},zr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zr.prototype.toArray=function(){return this.take(d)},To(zr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),a=Dr[o?"take"+("last"==t?"Right":""):t],i=o||/^find/.test(t);a&&(Dr.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,p=t instanceof zr,l=s[0],c=p||$i(t),u=function(e){var t=a.apply(Dr,Ct([e],s));return o&&y?t[0]:t};c&&r&&"function"==typeof l&&1!=l.length&&(p=c=!1);var y=this.__chain__,d=!!this.__actions__.length,f=i&&!y,m=p&&!d;if(!i&&c){t=m?t:new zr(this);var g=e.apply(t,s);return g.__actions__.push({func:fi,args:[u],thisArg:n}),new Gr(g,y)}return f&&m?e.apply(this,s):(g=this.thru(u),f?o?g.value()[0]:g.value():g)})})),Tt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Oe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);Dr.prototype[e]=function(){var e=arguments;if(o&&!this.__chain__){var n=this.value();return t.apply($i(n)?n:[],e)}return this[r]((function(r){return t.apply($i(r)?r:[],e)}))}})),To(zr.prototype,(function(e,t){var r=Dr[t];if(r){var o=r.name+"";xe.call(Mr,o)||(Mr[o]=[]),Mr[o].push({name:t,func:r})}})),Mr[Un(n,2).name]=[{name:"wrapper",func:n}],zr.prototype.clone=function(){var e=new zr(this.__wrapped__);return e.__actions__=On(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=On(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=On(this.__views__),e},zr.prototype.reverse=function(){if(this.__filtered__){var e=new zr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=$i(e),o=t<0,n=r?e.length:0,a=function(e,t,r){for(var o=-1,n=r.length;++o=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Dr.prototype.plant=function(e){for(var t,r=this;r instanceof Vr;){var o=Va(r);o.__index__=0,o.__values__=n,t?a.__wrapped__=o:t=o;var a=o;r=r.__wrapped__}return a.__wrapped__=e,t},Dr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zr){var t=e;return this.__actions__.length&&(t=new zr(this)),(t=t.reverse()).__actions__.push({func:fi,args:[ti],thisArg:n}),new Gr(t,this.__chain__)}return this.thru(ti)},Dr.prototype.toJSON=Dr.prototype.valueOf=Dr.prototype.value=function(){return dn(this.__wrapped__,this.__actions__)},Dr.prototype.first=Dr.prototype.head,it&&(Dr.prototype[it]=function(){return this}),Dr}();at._=pr,(o=function(){return pr}.call(t,r,t,e))===n||(e.exports=o)}.call(this)},904:(e,t)=>{"use strict";var r;let o;Object.defineProperty(t,"__esModule",{value:!0}),t.setDomain=t.getDomain=t.Domain=void 0,function(e){e[e.FA=0]="FA",e[e.FORM=1]="FORM",e[e.ETS=2]="ETS"}(r||(r={})),t.Domain=r,t.setDomain=e=>{o=e},t.getDomain=()=>null!=o?o:r.FA},3784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMap=void 0,t.errorMap=new Map([["fileError","Visual file is damaged"],["versionError","Version number of visual file does not match"],["modelError","Visual model in visual file is damaged"],["codegenError","Codegen visual file failed"]])},4117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNode=void 0,t.ASTNode=class{accept(e){return e.visit(this)}}},1862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0,t.Cache=class{constructor(e,t=0){this.value="",this.indent=t,this.flag=!0,this.INDENT=e}indentOn(){this.flag=!0}indentOff(){this.flag=!1}incIndent(){this.indent++}decIndent(){this.indent--}checkIndent(){return this.indent<0}getIndents(){if(this.flag){let e="";for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const o=r(4117);class n extends o.ASTNode{constructor(e,t,r,o,n){super(),this.builders=new Map,this.defaultValue=new Map,this.mediaParams=new Map,this.mediaProperties=new Map,this.mediaKeyProperty=new Map,this.tagName=e,this.params=t,this.content=r,this.properties=o,this.forEachObj=n,this.ifBoolean=null,this.isCustomTag=!1}setMediaParams(e){this.mediaParams=e}setParams(e){this.params=e}setIfBoolean(e){this.ifBoolean=e}setTagName(e){this.tagName=e}setForEachObj(e){this.forEachObj=e}setMediaProperty(e,t){t.forEach(((t,r)=>{var o;this.mediaKeyProperty.has(r)||this.mediaKeyProperty.set(r,new Map),null===(o=this.mediaKeyProperty.get(r))||void 0===o||o.set(e,t)}))}setDefaultValue(e,t,r="undefined",o=""){this.defaultValue.set(e,[r,t,o])}}t.Tag=n},5623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const o=r(9519),n=r(1862),a=r(5051),i=r(4294),s=r(6486),p=r(9459);class l{constructor(e){this.cache=e,this.etsImport=new n.Cache(" ",0),this.etsVariable=new n.Cache(" ",1),this.etsFunction=new n.Cache(" ",1),this.etsBuilder=new n.Cache(" ",1),this.aboutToAppear=new n.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}visit(e){e instanceof o.Tag&&(e.isCustomTag?this.genCustomTag(e):(this.needMediaQuery&&this.genMediaQuery(e),this.genTag(e)))}static getMethodGen(e){return void 0===l.instance?l.instance=new l(e):l.instance.setCache(e),l.instance}setCache(e){this.cache=e,this.etsImport=new n.Cache(" ",0),this.etsVariable=new n.Cache(" ",1),this.etsFunction=new n.Cache(" ",1),this.etsBuilder=new n.Cache(" ",1),this.aboutToAppear=new n.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}genParams(e){const t=this.getParams(e);this.isCustomComponent(e)?this.genCustomParams(t):this.genCommonParams(t)}genCommonParams(e){if("string"==typeof e)this.cache.concat(e);else if(e.size>0){this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE);let t=0;e.forEach(((r,o)=>{this.cache.concat(o,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(t,a.TokenClass.COLON,a.TokenClass.SPACE,e,a.TokenClass.COMMA)})),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genObjectProperty(e){let t=0;this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE),e.forEach(((r,o)=>{this.cache.concat(o,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{e.accept(this),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.decIndent(),this.cache.indentOn()),this.cache.indentOn(),this.cache.concat(a.TokenClass.RBRA)),(null!==e.properties||null!==e.mediaProperties)&&(null!==e.content&&0!==e.content.length||this.cache.incIndent(),this.getProperties(e).forEach(((e,t)=>{this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.PROPERTY_START,t,a.TokenClass.TAG_START),this.cache.indentOff(),"string"==typeof e?this.cache.concat(e,a.TokenClass.TAG_END):this.genObjectProperty(e)})),null!==e.content&&0!==e.content.length||this.cache.decIndent()),this.genEnd(e),this.genBuildersFunction(e)}genStart(e){this.genIfStart(e),this.genForTagStart(e),this.genCustomImport(e)}genEnd(e){this.genForTagEnd(e),this.genIfEnd(e)}genForTagStart(e){var t;void 0!==(null===(t=e.forEachObj)||void 0===t?void 0:t.for)&&(this.cache.concat("ForEach",a.TokenClass.TAG_START,e.forEachObj.for.toString(),a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE))}genForTagEnd(e){null!==e.forEachObj&&(this.cache.concat(a.TokenClass.RBRA),void 0!==e.forEachObj.key&&""!==e.forEachObj.key&&(this.cache.concat(a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.concat("return ",e.forEachObj.key.toString(),a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.TAG_END,a.TokenClass.RBRA),this.cache.indentOff()),this.cache.concat(a.TokenClass.TAG_END))}genIfStart(e){null!==e.ifBoolean&&(this.cache.concat("if",a.TokenClass.SPACE,a.TokenClass.TAG_START,e.ifBoolean.toString(),a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.incIndent())}genIfEnd(e){null!==e.ifBoolean&&(this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genMediaQuery(e){const t=new Map,r=new Map;if(this.collectMediaQueryMap(e,t),this.collectDefaultValueMap(e,r),0===t.size&&0===r.size)return;const o=(0,i.getUniqueName)("mediaQuery"),s=(0,i.getUniqueName)("initForMediaQuery"),p=(0,i.getUniqueName)("mediaQueryCb"),l=(0,i.getUniqueName)("saveMediaQueryResult"),c=(0,i.getUniqueName)("updateForMediaQuery"),u=new n.Cache(a.TokenClass.INDENT,1),y=new n.Cache(a.TokenClass.INDENT,1),d=new n.Cache(a.TokenClass.INDENT,1),f=new n.Cache(a.TokenClass.INDENT,1),m=new n.Cache(a.TokenClass.INDENT,1),g=new n.Cache(a.TokenClass.INDENT,1),h=new n.Cache(a.TokenClass.INDENT,1),E=new n.Cache(a.TokenClass.INDENT,2);this.genVariableDeclare(r,u,a.TokenClass.UNDEFINED),this.genMediaQueryCb(p,y),this.genMediaQueryListener(t,d,f),this.genInitFuc(s,r,m),this.genMediaQueryCbFnc(l,c,t,g),this.genUpdateFnc(c,s,t,h),this.genAboutToAppear(p,l,t,E),this.etsImport.indentOff(),this.aboutToAppear.indentOff(),this.etsVariable.indentOff(),this.etsFunction.indentOff(),this.etsImport.indentOff(),this.etsImport.concat("import ",o," from '@ohos.mediaquery'",a.TokenClass.NEW_LINE),this.aboutToAppear.concat(E.toString()),this.etsVariable.concat(u.toString(),y.toString(),d.toString(),f.toString()),this.etsFunction.concat(g.toString(),a.TokenClass.NEW_LINE,m.toString(),a.TokenClass.NEW_LINE,h.toString()),this.etsImport.indentOn(),this.aboutToAppear.indentOn(),this.etsVariable.indentOn(),this.etsFunction.indentOn(),this.needMediaQuery=!1}genBuildersFunction(e){e.builders.forEach(((e,t)=>{this.etsBuilder.indentOff(),this.etsBuilder.concat(a.TokenClass.NEW_LINE),this.etsBuilder.indentOn(),this.etsBuilder.concat(a.TokenClass.DECORATOR_Builder,a.TokenClass.SPACE,t,a.TokenClass.TAG_START,a.TokenClass.TAG_END),this.etsBuilder.indentOff();const r=(0,p.genBuilderEts)(e);this.etsBuilder.concat(a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.etsBuilder.indentOn(),this.etsBuilder.concat(r.cache.toString(),a.TokenClass.NEW_LINE),this.etsBuilder.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE),this.etsBuilder.indentOff(),this.etsBuilder.concat(r.etsBuilder.toString())}))}genCustomTag(e){this.genVariableDeclare(e.defaultValue,this.cache)}genVariableDeclare(e,t,r){t.indentOn(),e.forEach(((e,o)=>{const n=e[2];""!==n&&(t.concat(n,a.TokenClass.SPACE),t.indentOff()),t.concat(o.slice(5),a.TokenClass.COLON,a.TokenClass.SPACE,e[1]),t.indentOff();const i=null!=r?r:e[0];null!=i&&t.concat(a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,i),t.concat(a.TokenClass.NEW_LINE),t.indentOn()}))}genMediaQueryCb(e,t){t.concat(e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.NULL,a.TokenClass.NEW_LINE)}genMediaQueryListener(e,t,r){const o=(0,i.getUniqueName)("mediaQuery");e.forEach(((e,n)=>{const s=(0,i.getUniqueName)(this.getMediaQueryVariableName(n));t.concat(s,a.TokenClass.COLON,a.TokenClass.SPACE,a.TokenClass.BOOLEAN,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.FALSE,a.TokenClass.NEW_LINE),r.concat(`listener_${s}`,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,o,a.TokenClass.PROPERTY_START,"matchMediaSync",a.TokenClass.TAG_START,`'${n}'`,a.TokenClass.TAG_END,a.TokenClass.NEW_LINE)}))}genInitFuc(e,t,r){r.concat(e,a.TokenClass.TAG_START,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),r.indentOn(),r.incIndent(),t.forEach(((e,t)=>{r.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e[0],a.TokenClass.NEW_LINE)})),r.decIndent(),r.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genMediaQueryCbFnc(e,t,r,o){const n=Array.from(r.entries());o.concat(e,a.TokenClass.TAG_START,"mediaQueryResult",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent(),o.concat(a.TokenClass.SWITCH,a.TokenClass.SPACE,a.TokenClass.TAG_START,"mediaQueryResult.media",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent();for(let e=0;e{const r=(0,i.getUniqueName)(this.getMediaQueryVariableName(t));o.concat(a.TokenClass.IF,a.TokenClass.SPACE,a.TokenClass.TAG_START,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,r,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent(),e.forEach(((e,t)=>{o.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e,a.TokenClass.NEW_LINE)})),o.decIndent(),o.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)})),o.decIndent(),o.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genAboutToAppear(e,t,r,o){let n=1;o.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,`${t}.bind(this)`,a.TokenClass.NEW_LINE),r.forEach(((t,s)=>{const p=`listener_${(0,i.getUniqueName)(this.getMediaQueryVariableName(s))}`;o.indentOn(),o.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,p,a.TokenClass.PROPERTY_START,`on('change', this.${e})`),n0&&e.mediaParams.forEach(((e,r)=>{t.set(r,e)})),t}getProperties(e){const t=new Map;return e.properties.forEach(((e,r)=>{t.set(r,e)})),e.mediaProperties.forEach(((e,r)=>{t.set(r,e)})),t}collectDefaultValueMap(e,t){void 0!==e.defaultValue&&e.defaultValue.forEach(((e,r)=>{t.set(r,e)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectDefaultValueMap(e,t)}))}collectMediaQueryMap(e,t){void 0!==e.mediaKeyProperty&&e.mediaKeyProperty.forEach(((e,r)=>{var o;const n=null!==(o=t.get(r))&&void 0!==o?o:new Map;e.forEach(((e,t)=>{n.set(t,e)})),t.set(r,n)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectMediaQueryMap(e,t)}))}getMediaQueryVariableName(e){const t="device-type: ",r="orientation: ",o=e.substring(e.indexOf(t),e.length),n=o.substring(t.length,o.indexOf(")")),a=e.substring(e.indexOf(r),e.length),i=a.substring(r.length,a.indexOf(")"));return`${n}${i.slice(0,1).toUpperCase()+i.slice(1).toLowerCase()}`}}t.ASTNodeGenerator=l,l.instance=void 0},8413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ETSBridge=void 0;const o=r(9519),n=r(1912),a=r(3729),i=r(6125),s=r(366),p=r(7893);t.ETSBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map;let r=null;const l=new Map,c=new o.Tag(e.type,t,r,l,null);if((0,n.parseVisualModel)(e,c),(0,a.parseMediaVisualModel)(e,c),(0,i.parseCustomVisualModel)(e,c),(0,s.parseCustomMediaVisualModel)(e,c),(0,p.parseBuildersVisualModel)(e,c,this),e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}return c.content=r,c}}},9459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genBuilderEts=t.genCustomEts=t.genETS=t.EMPTY=void 0;const o=r(5623),n=r(1862);t.EMPTY={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""},t.genETS=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" ",2));return e.accept(t),{build:t.cache.toString(),etsImport:t.etsImport.toString(),etsVariable:t.etsVariable.toString(),etsFunction:t.etsFunction.toString().concat(t.etsBuilder.toString()),aboutToAppear:t.aboutToAppear.toString()}},t.genCustomEts=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" ",1));return e.accept(t),t.cache.toString()},t.genBuilderEts=function(e){const t=new o.ASTNodeGenerator(new n.Cache(" ",1));return e.accept(t),t}},4435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;const o=r(9459);t.StringWriter=class{genETS(e){return(0,o.genETS)(e)}}},5051:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.INDENT=" ",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.SPACE=" ",r.LQUOTE="'",r.RQUOTE="'",r.TAG_START="(",r.TAG_END=")",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDynamicValueByDecorator=t.getMediaVariableDecorator=t.getCustomAttrType=t.getCustomAttributeMap=t.setCustomAttribute=void 0;const o=r(2891),n=new Map;function a(){return n}function i(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.decorator)&&void 0!==r?r:"normal"}t.setCustomAttribute=function(e){var t,r;const a=e.type;(null!==(r=null===(t=(0,o.getInstance)().customData)||void 0===t?void 0:t.property.get(a))&&void 0!==r?r:new Map).forEach(((e,t)=>{const r=`${t}-${a.replace(/\//g,"-")}`;n.set(r,e)}))},t.getCustomAttributeMap=a,t.getCustomAttrType=function(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.type)&&void 0!==r?r:""},t.getMediaVariableDecorator=function(e){const t=i(e);let r="";return"@Link"!==t&&"@Prop"!==t||(r="@State"),r},t.getDynamicValueByDecorator=function(e,t){let r=t;return"@Link"===i(e)&&(r=t.replace("this.","$")),r}},6125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumParserMap=t.genCustomEvent=t.parseCustomVisualModel=void 0;const o=r(2891),n=r(3135),a=r(1195),i=r(8122),s=r(1790);function p(e,t){if(!(t.params instanceof Map))return;const r=function(e){var t,r;const n=e.type;return[...null!==(r=null===(t=(0,o.getInstance)().customData)||void 0===t?void 0:t.event.get(n))&&void 0!==r?r:[]]}(e);for(const o of r){const r=e.property.get(o);void 0!==r&&""!==r&&("this"===r.split(".")[0]?t.params.set(o,r+".bind(this)"):t.params.set(o,r))}}t.parseCustomVisualModel=function(e,r){(0,a.setCustomAttribute)(e),(0,a.getCustomAttributeMap)().forEach(((o,n)=>{if(function(e,t){return e.property.has(t)||e.dynamicProperty.has(t)}(e,n)){const a=c.get(o.type);"function"==typeof a&&a(n,e,r);const s=t.enumParserMap.get(o.type);"function"==typeof s&&function(e,t,r,o){if((0,i.dynamicParamParser)(e,t,r))return;const n=t.property.get(e);!(0,i.isEmptyOrUndefined)(n)&&r.params instanceof Map&&r.params.set((0,i.getEtsPropName)(e),o(n))}(n,e,r,s)}})),p(e,r)},t.genCustomEvent=p;const l=(0,i.curry)(i.getEtsEnumValue),c=new Map([["string",i.stringParamParser],["boolean",i.rawDataParamParser],["number",i.rawDataParamParser],["any[]",i.rawDataParamParser],["object",i.rawDataParamParser],["Date",function(e,t,r){(0,i.dateParamParser)(e,(0,i.getEtsPropName)(e),t,r)}]]);t.enumParserMap=new Map([["Alignment",function(e){const t=(0,i.getBackgroundImagePositionEnumValue)(e);return""!==t?t:(0,i.getEtsEnumValue)("Alignment.",e)}],["Direction",l("Direction.")],["ItemAlign",i.dealWithAlignSelf],["BorderStyle",l("BorderStyle.")],["ImageRepeat",i.dealWithBackgroundRepeat],["ImageSize",l("ImageSize.")],["Visibility",l("Visibility.")],["FontStyle",l("FontStyle.")],["FontWeight",i.dealWithFontWeight],["ButtonType",l("ButtonType.")],["Color",l("Color.")],["LineCapStyle",l("LineCapStyle.")],["ImageFit",l("ImageFit.")],["ImageInterpolation",l("ImageInterpolation.")],["ImageRenderMode",l("ImageRenderMode.")],["ProgressStyle",l("ProgressStyle.")],["SliderStyle",l("SliderStyle.")],["TextAlign",l("TextAlign.")],["TextOverflow",l("TextOverflow.")],["TextDecorationType",l("TextDecorationType.")],["TextCase",l("TextCase.")],["HorizontalAlign",s.dealWithColumnAlignItems],["FlexAlign",n.dealWithJustifyAlignContent],["VerticalAlign",s.dealWithRowAlignItems],["FlexDirection",l("FlexDirection.")],["FlexWrap",i.dealWithWrap],["Axis",l("Axis.")],["EdgeEffect",l("EdgeEffect.")],["Sticky",l("Sticky.")],["EnterKeyType",l("EnterKeyType.")],["ToggleType",l("ToggleType.")],["InputType",l("InputType.")],["ScrollDirection",l("ScrollDirection.")],["EdgeEffect",l("EdgeEffect.")],["GridDirection",l("GridDirection.")],["BarState",l("BarState.")],["NavigationTitleMode",l("NavigationTitleMode.")],["CopyOption",l("CopyOption.")],["BarPosition",l("BarPosition.")],["BarMode",l("BarMode.")]])},9223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonMediaParserArray=t.ifParser=t.forEachParser=void 0;const o=r(6282),n=r(8122),a=r(9248),i=(0,n.curry)(((e,t)=>t.hasMediaProperty(e)));function s(e,t,r){var o,a,i,s;const p=null!==(o=e.property.get("left"))&&void 0!==o?o:e.dynamicProperty.get("left"),l=null!==(a=e.property.get("top"))&&void 0!==a?a:e.dynamicProperty.get("top"),c=t.get("left"),u=t.get("top"),y=r.get("left"),d=r.get("top");let f="undefined",m="undefined";return(0,n.isEmptyOrUndefined)(c)&&(0,n.isEmptyOrUndefined)(u)||(f=(0,n.quoteString)(null!==(i=null!=c?c:p)&&void 0!==i?i:"0"),m=(0,n.quoteString)(null!==(s=null!=u?u:l)&&void 0!==s?s:"0")),(0,n.isEmptyOrUndefined)(y)&&(0,n.isEmptyOrUndefined)(d)||(f=null!=y?y:f,m=null!=d?d:m),{leftValue:f,topValue:m}}function p(e,t){e.forEach(((e,r)=>{"undefined"!==e&&t.set(r,"undefined")}))}function l(e,t){var r,o;const a=new Map,i=t.split("-")[0];return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((r,o)=>{var s,p,l,c;const u=r.get(i),y=null===(p=null===(s=e.dynamicMediaProperty)||void 0===s?void 0:s.get(o))||void 0===p?void 0:p.get(i),d=null!==(c=null!==(l=r.get(t))&&void 0!==l?l:y)&&void 0!==c?c:u;void 0!==d&&a.set(o,(0,n.quoteString)(d))})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{var o;const n=e.get(i),s=null!==(o=e.get(t))&&void 0!==o?o:n;void 0!==s&&a.set(r,s)})),a}const c=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.quoteString);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.quoteString),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),u=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),y=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),d=(0,n.curry)(((e,t,r,a)=>{const i=(0,o.getMediaProperty)(r,e,(0,n.curry)(n.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,n.curry)(n.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);a.setDefaultValue(p,(0,o.getType)(e),s),a.setMediaProperty(p,i),a.mediaProperties.set((0,n.getEtsPropName)(e),p)})),f=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.dealWithColor);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.dealWithColor),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)}));function m(e,t,r,o=!1){(0,n.isEmptyOrUndefined)(t)||r.set(e,o?t:(0,n.quoteString)(t))}t.forEachParser=function(e,t){var r,n,a;const i=null!==(r=e.dynamicProperty.get("for"))&&void 0!==r?r:"[1]",s=null!==(n=e.property.get("item"))&&void 0!==n?n:"item",p=null!==(a=e.property.get("idx"))&&void 0!==a?a:"idx",l=e.dynamicProperty.get("keyGenerator"),c=(0,o.getMediaProperty)(e,"for");if(0===c.size)return;const u=(0,o.getVariableName)(e.id,"for"),y={for:u,key:l,item:s,idx:p};t.setDefaultValue(u,(0,o.getType)("for"),i),t.setMediaProperty(u,c),t.setForEachObj(y)},t.ifParser=function(e,t){const r=(0,o.getMediaProperty)(e,"if");if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"if"),a=(0,o.getVariableName)(e.id,"if");t.setDefaultValue(a,(0,o.getType)("if"),n),t.setMediaProperty(a,r),t.setIfBoolean(a)};const g=(0,n.curry)(((e,t,r)=>{const a=new Map,i=t.property.get(e),s=t.dynamicProperty.get(e),p=null!=s?s:i,c=["top","bottom","left","right"];let u=0;for(const i of c){const s=`${e}-${i}`,c=t.property.get(s),y=t.dynamicProperty.get(s),d=l(t,s);let f=(0,n.isEmptyOrUndefined)(p)?"undefined":(0,n.quoteString)(p);if((0,n.isEmptyOrUndefined)(c)||(f=(0,n.quoteString)(c)),(0,n.isEmptyOrUndefined)(y)||(f=y),d.size>0){const e=(0,o.getVariableName)(t.id,s);r.setDefaultValue(e,(0,o.getType)(s),f),r.setMediaProperty(e,d),m(i,e,a,!0),u++}else m(i,f,a,!0)}u>0&&r.mediaProperties.set(e,a)}));function h(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null===t?"undefined":void 0!==t[5]?`{ width: ${(0,n.quoteString)(t[1])}, height: ${(0,n.quoteString)(t[5])} }`:`{ width: ${(0,n.quoteString)(t[1])} }`}function E(e,t){var r,o;const a=new Map,i=new Map,s=S(t),p=P(t);return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((e,r)=>{const o=e.get(t);if(!(0,n.isEmptyOrUndefined)(o)){let e=s(o);e=""!==e?e:"undefined",a.set(r,e),i.set(r,p(o))}})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{const o=e.get(t);(0,n.isEmptyOrUndefined)(o)||(a.set(r,o),i.set(r,"undefined"))})),{enumValueMap:a,objValueMap:i}}function T(e,t){const r=e.property.get(t),o=e.dynamicProperty.get(t),a=S(t),i=P(t);let s="undefined",p="undefined";if(!(0,n.isEmptyOrUndefined)(r)){const e=a(r);s=""!==e?e:s,p=i(r)}return(0,n.isEmptyOrUndefined)(o)||(s=o,p="undefined"),{enumDefault:s,objDefault:p}}function S(e){return new Map([["background-image-size",n.getBackgroundImageSizeEnumValue],["background-image-position",n.getBackgroundImagePositionEnumValue]]).get(e)}function P(e){return new Map([["background-image-size",h],["background-image-position",v]]).get(e)}function v(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null===t?"undefined":`{ x: ${(0,n.quoteString)(t[1])}, y: ${(0,n.quoteString)(t[4])} }`}const b=(0,n.curry)(((e,t,r,a)=>{const i=(0,n.getBorderDirections)(e),s=new Map;let p=r.property.get(e);(0,n.isEmptyOrUndefined)(p)||(p=t(p));const l=r.dynamicProperty.get(e),c=null!=l?l:p,u=(0,o.getMediaProperty)(r,e,t);let y=0;for(const e of i){const i=(0,n.getEdgeBorderDirection)(e),p=r.property.get(e),l=r.dynamicProperty.get(e),d=(0,o.getMediaProperty)(r,e,t);let f=(0,n.isEmptyOrUndefined)(c)?"undefined":c;if((0,n.isEmptyOrUndefined)(p)||(f=t(p)),(0,n.isEmptyOrUndefined)(l)||(f=l),d.size>0){const t=(0,o.getVariableName)(r.id,e);a.setDefaultValue(t,(0,o.getType)(e),f),a.setMediaProperty(t,d),s.set(i,t),y++}else{const t=(0,o.getVariableName)(r.id,e);a.setDefaultValue(t,(0,o.getType)(e),f),a.setMediaProperty(t,u),s.set(i,t)}}y>0&&a.mediaProperties.set((0,n.getEtsPropName)(e),s)}));t.commonMediaParserArray=[[i("width"),c("width")],[i("height"),c("height")],[function(e){return e.hasMediaProperty("constraint-size-min-width")||e.hasMediaProperty("constraint-size-max-width")||e.hasMediaProperty("constraint-size-min-height")||e.hasMediaProperty("constraint-size-min-height")},function(e,t){const r=new Map,a=["min-width","max-width","min-height","max-height"];for(const i of a){const a=`constraint-size-${i}`,s=(0,o.getMediaProperty)(e,a,n.quoteString),p=(0,o.getMediaDefaultValue)(e,a,n.quoteString);if(s.size>0){const l=(0,o.getVariableName)(e.id,a);t.setDefaultValue(l,(0,o.getType)(a),p),t.setMediaProperty(l,s),m((0,n.getEtsPropName)(i),l,r,!0)}}r.size>0&&t.mediaProperties.set("constraintSize",r)}],[i("align"),d("align","Alignment.")],[i("direction"),d("direction","Direction.")],[function(e){return e.hasMediaProperty("left")||e.hasMediaProperty("top")},function(e,t){var r;const n=null!==(r=e.property.get("position"))&&void 0!==r?r:"relative",{leftValue:a,topValue:i}=s(e,e.property,e.dynamicProperty),{mediaPositionLeft:l,mediaPositionTop:c,mediaOffsetLeft:u,mediaOffsetTop:y}=function(e){var t,r;const o=new Map,n=new Map,a=new Map,i=new Map,p=null!==(t=e.mediaProperty)&&void 0!==t?t:new Map,l=null!==(r=e.dynamicMediaProperty)&&void 0!==r?r:new Map,c=new Set;for(const[e]of p)c.add(e);for(const[e]of l)c.add(e);return c.forEach((t=>{var r,p,l,c;const u=null!==(p=null===(r=e.mediaProperty)||void 0===r?void 0:r.get(t))&&void 0!==p?p:new Map,y=null!==(c=null===(l=e.dynamicMediaProperty)||void 0===l?void 0:l.get(t))&&void 0!==c?c:new Map,d=u.get("position"),{leftValue:f,topValue:m}=s(e,u,y);"absolute"===d?("undefined"!==f&&o.set(t,f),"undefined"!==m&&n.set(t,m)):("undefined"!==f&&a.set(t,f),"undefined"!==m&&i.set(t,m))})),{mediaPositionLeft:o,mediaPositionTop:n,mediaOffsetLeft:a,mediaOffsetTop:i}}(e),d=l.size>0||c.size>0||"absolute"===n,f=u.size>0||y.size>0||"relative"===n,m=(0,o.getVariableName)(e.id,"positionLeft"),g=(0,o.getVariableName)(e.id,"positionTop"),h=(0,o.getVariableName)(e.id,"offsetLeft"),E=(0,o.getVariableName)(e.id,"offsetTop");if(0!==l.size||0!==c.size||0!==y.size||0!==u.size){if(d&&f&&(p(l,u),p(u,l),p(c,y),p(y,c)),d){const e="absolute"===n?a:"undefined",r="absolute"===n?i:"undefined";t.setDefaultValue(m,(0,o.getType)("left"),e),t.setDefaultValue(g,(0,o.getType)("top"),r),t.setMediaProperty(m,l),t.setMediaProperty(g,c),t.mediaProperties.set("position",new Map([["x",m],["y",g]]))}if(f){const e="relative"===n?a:"undefined",r="relative"===n?i:"undefined";t.setDefaultValue(h,(0,o.getType)("left"),e),t.setDefaultValue(E,(0,o.getType)("top"),r),t.setMediaProperty(h,u),t.setMediaProperty(E,y),t.mediaProperties.set("offset",new Map([["x",h],["y",E]]))}}}],[i("aspect-ratio"),u("aspect-ratio")],[i("display-priority"),u("display-priority")],[i("flex-basis"),c("flex-basis")],[i("flex-grow"),u("flex-grow")],[i("flex-shrink"),u("flex-shrink")],[i("align-self"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-self",n.dealWithAlignSelf);if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"align-self",n.dealWithAlignSelf),i=(0,o.getVariableName)(e.id,"align-self");t.setDefaultValue(i,(0,o.getType)("align-self"),a),t.setMediaProperty(i,r),t.mediaProperties.set("alignSelf",i)}],[i("border-style"),d("border-style","BorderStyle.")],[function(e){return e.hasMediaProperty("border-top-style")||e.hasMediaProperty("border-bottom-style")||e.hasMediaProperty("border-left-style")||e.hasMediaProperty("border-right-style")},b("border-style",(0,n.curry)(n.getEtsEnumValue)("BorderStyle."))],[i("border-width"),c("border-width")],[function(e){return e.hasMediaProperty("border-top-width")||e.hasMediaProperty("border-bottom-width")||e.hasMediaProperty("border-left-width")||e.hasMediaProperty("border-right-width")},b("border-width",n.quoteString)],[i("border-color"),f("border-color")],[function(e){return e.hasMediaProperty("border-top-color")||e.hasMediaProperty("border-bottom-color")||e.hasMediaProperty("border-left-color")||e.hasMediaProperty("border-right-color")},b("border-color",n.dealWithColor)],[i("border-radius"),c("border-radius")],[function(e){return e.hasMediaProperty("border-top-left-radius")||e.hasMediaProperty("border-bottom-right-radius")||e.hasMediaProperty("border-bottom-left-radius")||e.hasMediaProperty("border-top-right-radius")},b("border-radius",n.quoteString)],[i("background-color"),f("background-color")],[function(e){return e.hasMediaProperty("background-image-src")||e.hasMediaProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),i=e.property.get("background-image-repeat"),s=e.dynamicProperty.get("background-image-src"),p=e.dynamicProperty.get("background-image-repeat"),l=(0,o.getMediaProperty)(e,"background-image-src",a.dealWithSrc),c=(0,o.getMediaProperty)(e,"background-image-repeat",n.dealWithBackgroundRepeat);if(0===l.size&&0===c.size)return;let u=(0,a.dealWithSrc)(null!=r?r:"");if((0,n.isEmptyOrUndefined)(s)||(u=s),l.size>0){const r=(0,o.getVariableName)(e.id,"background-image-src");t.setDefaultValue(r,(0,o.getType)("background-image-src"),u),t.setMediaProperty(r,l),u=r}let y="undefined";if(!(0,n.isEmptyOrUndefined)(i)){const e=(0,n.dealWithBackgroundRepeat)(i);null!=e&&""!==e&&(y=e)}if((0,n.isEmptyOrUndefined)(p)||(y=p),c.size>0){const r=(0,o.getVariableName)(e.id,"background-image-repeat");t.setDefaultValue(r,(0,o.getType)("background-image-repeat"),y),t.setMediaProperty(r,c),y=r}t.mediaProperties.set("backgroundImage",u+", "+y)}],[i("background-image-size"),function(e,t){const{enumValueMap:r,objValueMap:n}=E(e,"background-image-size");if(0===r.size&&0===n.size)return;const{enumDefault:a,objDefault:i}=T(e,"background-image-size"),s=(0,o.getVariableName)(e.id,"background-image-size-enum"),p=(0,o.getVariableName)(e.id,"background-image-size-obj");t.setDefaultValue(s,"ImageSize",a),t.setDefaultValue(p,"SizeOptions",i),t.setMediaProperty(s,r),t.setMediaProperty(p,n),t.mediaProperties.set("backgroundImageSize",`${s} !== undefined ? ${s} : ${p}`)}],[i("background-image-position"),function(e,t){const{enumValueMap:r,objValueMap:n}=E(e,"background-image-position");if(0===r.size&&0===n.size)return;const{enumDefault:a,objDefault:i}=T(e,"background-image-position"),s=(0,o.getVariableName)(e.id,"background-image-position-enum"),p=(0,o.getVariableName)(e.id,"background-image-position-obj");t.setDefaultValue(s,"Alignment",a),t.setDefaultValue(p,"Position",i),t.setMediaProperty(s,r),t.setMediaProperty(p,n),t.mediaProperties.set("backgroundImagePosition",`${s} !== undefined ? ${s} : ${p}`)}],[i("opacity"),u("opacity")],[i("visibility"),d("visibility","Visibility.")],[i("enabled"),y("enabled")],[i("font-color"),f("font-color")],[function(e){return e.hasMediaProperty("margin")||e.hasMediaProperty("margin-left")||e.hasMediaProperty("margin-top")||e.hasMediaProperty("margin-right")||e.hasMediaProperty("margin-bottom")},g("margin")],[function(e){return e.hasMediaProperty("padding")||e.hasMediaProperty("padding-left")||e.hasMediaProperty("padding-top")||e.hasMediaProperty("padding-right")||e.hasMediaProperty("padding-bottom")},g("padding")]]},3135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.componentsMediaParserArray=t.dateMediaParamParser=t.rawDataMediaParamParser=t.stringMediaParamParser=t.dealWithJustifyAlignContent=void 0;const o=r(6282),n=r(1195),a=r(8122),i=r(9248),s=r(1790),p=r(5264),l=(0,a.curry)(((e,t,r)=>r.type===e&&r.hasMediaProperty(t)));function c(e){return isNaN(Number(e))?(0,a.getEtsEnumValue)("FontWeight.",e):e}function u(e){let t=(0,a.getEtsEnumValue)("FlexAlign.",e);return"flex-start"===e?t="FlexAlign.Start":"flex-end"===e&&(t="FlexAlign.End"),t}function y(e){return"TextOverflow."+(0,a.firstUpperCase)(e)}function d(e,t,r){var o,n;const i=new Map,s=null!==(o=e.mediaProperty)&&void 0!==o?o:new Map,p=null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map;return s.forEach(((e,o)=>{let n=e.get(t);const s=e.get(r);(0,a.isEmptyOrUndefined)(n)&&(0,a.isEmptyOrUndefined)(s)||(n="0"===n||(0,a.isEmptyOrUndefined)(n)?"0":n.substring(0,n.length-2),i.set(o,n))})),p.forEach(((e,r)=>{const o=e.get(t);(0,a.isEmptyOrUndefined)(o)||i.set(r,o)})),i}t.dealWithJustifyAlignContent=u;const f=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e,a.quoteString);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e,a.quoteString),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),m=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),g=(0,a.curry)(((e,t,r)=>{m(e,t,r)})),h=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,(0,a.curry)(a.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,a.curry)(a.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(e),p)}));t.stringMediaParamParser=(0,a.curry)(((e,t,r)=>{const i=(0,o.getMediaProperty)(t,e,a.quoteString);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(t,e,a.quoteString),p=(0,o.getVariableName)(t.id,e),l=(0,n.getMediaVariableDecorator)(e);r.setDefaultValue(p,(0,o.getType)(e),s,l),r.setMediaProperty(p,i),r.mediaParams.set((0,a.getEtsPropName)(e),(0,n.getDynamicValueByDecorator)(e,p))})),t.rawDataMediaParamParser=(0,a.curry)(((e,t,r)=>{const i=(0,o.getMediaProperty)(t,e);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(t,e),p=(0,o.getVariableName)(t.id,e);r.setDefaultValue(p,(0,o.getType)(e),s),r.setMediaProperty(p,i),r.mediaParams.set((0,a.getEtsPropName)(e),(0,n.getDynamicValueByDecorator)(e,p))})),t.dateMediaParamParser=(0,a.curry)(((e,t,r,n,i)=>{const s=e=>void 0===e||""===e?"new Date()":"new Date ("+(0,a.quoteString)(e)+")",p=(0,o.getMediaProperty)(n,e,s);if(!(i.mediaParams instanceof Map)||0===p.size)return;const l=(0,o.getMediaDefaultValue)(n,e,s),c=(0,o.getVariableName)(n.id,e);i.setDefaultValue(c,(0,o.getType)(e),l,r),i.setMediaProperty(c,p),i.mediaParams.set(t,c)}));const E=(0,a.curry)(((e,t,r,n,a)=>{const i=(0,o.getMediaProperty)(n,e);if(!(a.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(n,e),p=(0,o.getVariableName)(n.id,e);a.setDefaultValue(p,(0,o.getType)(e),s,r),a.setMediaProperty(p,i),a.mediaParams.set(t,p)})),T=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,(0,a.curry)(a.getEtsEnumValue)(t));if(!(n.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,a.curry)(a.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaParams.set((0,a.getEtsPropName)(e),p)})),S=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e,a.dealWithColor);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e,a.dealWithColor),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),P=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),v=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,a.quoteString);if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,a.quoteString),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(t),p)})),b=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e);if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(t),p)})),_=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,u);if(!(n.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,u),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaParams.set((0,a.getEtsPropName)(e),p)})),N=(0,a.curry)(((e,t,r,n)=>{const a=(0,o.getMediaProperty)(r,e,u);if(!(n.mediaProperties instanceof Map)||0===a.size)return;const i=(0,o.getMediaDefaultValue)(r,e,u),s=(0,o.getVariableName)(r.id,e);n.setDefaultValue(s,(0,o.getType)(e),i),n.setMediaProperty(s,a),n.mediaProperties.set("justifyContent",s)})),C=(0,a.curry)(((e,t)=>t.type===e));function A(e,t,r){const n=e.property.get(r),i=e.dynamicProperty.get(r),s=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===s.size)return;let p="''";(0,a.isEmptyOrUndefined)(n)||(p=(0,a.quoteString)(n)),(0,a.isEmptyOrUndefined)(i)||(p=(0,a.getContentName)(i));const l=(0,o.getVariableName)(e.id,r);t.setDefaultValue(l,(0,o.getType)(r),p),t.setMediaProperty(l,s),t.setMediaParams(l)}const O=(0,a.curry)(((e,t,r,n)=>{let i=n.mediaProperties.get((0,a.getEtsPropName)(e));void 0===i&&(i=new Map);const s=`${e}-${t}`,p=(0,o.getVariableName)(r.id,s);let l=(0,o.getMediaProperty)(r,s,a.quoteString),u=(0,o.getMediaDefaultValue)(r,s,a.quoteString);if("string"!=typeof i){if((0,a.isEmptyOrUndefined)(u))return;"style"===t&&(l=(0,o.getMediaProperty)(r,s,(0,a.curry)(a.getEtsEnumValue)("FontStyle.")),u=(0,o.getMediaDefaultValue)(r,s,(0,a.curry)(a.getEtsEnumValue)("FontStyle."))),"weight"===t&&(l=(0,o.getMediaProperty)(r,s,c),u=(0,o.getMediaDefaultValue)(r,s,c)),n.setDefaultValue(p,(0,o.getType)(s),u),n.setMediaProperty(p,l),i.set(t,p)}n.mediaProperties.set((0,a.getEtsPropName)(e),i)}));function M(e,t){const r=(0,o.getMediaProperty)(e,"font-weight",a.dealWithFontWeight);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"font-weight",a.dealWithFontWeight),i=(0,o.getVariableName)(e.id,"font-weight");t.setDefaultValue(i,(0,o.getType)("font-weight"),n),t.setMediaProperty(i,r),t.mediaProperties.set("fontWeight",i)}function w(e,t,r,n){const i=new Map([["value","search-value"],["placeholder","search-placeholder"],["icon","icon"],["controller","search-controller"]]).get(e);if(void 0===i)return;const s=r.getProperty(i),p=r.dynamicProperty.get(i),l=(0,o.getMediaProperty)(r,i,a.quoteString),c=(0,o.getVariableName)(r.id,i);let u="''";0!==l.size&&((0,a.isEmptyOrUndefined)(s)||(u=(0,a.quoteString)(s)),(0,a.isEmptyOrUndefined)(p)||(u="controller"===e?p:(0,a.getContentName)(p)),n.setDefaultValue(c,(0,o.getType)(i),u),n.setMediaProperty(c,l),t.push(`${e}: ${(0,a.getContentName)(c)}`))}const R=[[l("button","label"),function(e,t){A(e,t,"label")}],[l("button","type"),h("type","ButtonType.")],[l("button","state-effect"),g("state-effect")],[l("button","font-size"),f("font-size")],[l("button","font-style"),h("font-style","FontStyle.")],[l("button","font-weight"),M],[l("button","font-family"),f("font-family")]],I=[[l("divider","vertical"),g("vertical")],[l("divider","color"),S("color")],[l("divider","stroke-width"),f("stroke-width")],[l("divider","line-cap"),h("line-cap","LineCapStyle.")]],x=[[C("image"),function(e,t){var r;const n=null!==(r=e.property.get("src"))&&void 0!==r?r:"",s=e.dynamicProperty.get("src"),p=(0,o.getMediaProperty)(e,"src",i.dealWithSrc);if(0===p.size)return;let l=(0,i.dealWithSrc)(n);(0,a.isEmptyOrUndefined)(s)||(l=s);const c=(0,o.getVariableName)(e.id,"src");t.setDefaultValue(c,(0,o.getType)("src"),l),t.setMediaProperty(c,p),t.setMediaParams(c)}],[l("image","alt"),f("alt")],[l("image","object-fit"),h("object-fit","ImageFit.")],[l("image","object-repeat"),h("object-repeat","ImageRepeat.")],[l("image","interpolation"),h("interpolation","ImageInterpolation.")],[l("image","render-mode"),h("render-mode","ImageRenderMode.")],[function(e){return e.hasMediaProperty("source-size-width")||e.hasMediaProperty("source-size-height")},function(e,t){let r=e.property.get("source-size-width"),n=e.property.get("source-size-height");const i=e.dynamicProperty.get("source-size-width"),s=e.dynamicProperty.get("source-size-height"),p=d(e,"source-size-width","source-size-height"),l=d(e,"source-size-height","source-size-width");if(0===p.size)return;r="0"===r||(0,a.isEmptyOrUndefined)(r)?"0":r.substring(0,r.length-2),n="0"===n||(0,a.isEmptyOrUndefined)(n)?"0":n.substring(0,n.length-2),(0,a.isEmptyOrUndefined)(i)||(r=i),(0,a.isEmptyOrUndefined)(s)||(n=s);const c=(0,o.getVariableName)(e.id,"source-size-width"),u=(0,o.getVariableName)(e.id,"source-size-height");t.setDefaultValue(c,(0,o.getType)("source-size-width"),r),t.setDefaultValue(u,(0,o.getType)("source-size-height"),n),t.setMediaProperty(c,p),t.setMediaProperty(u,l);const y=new Map([["width",c],["height",u]]);t.mediaProperties.set("sourceSize",y)}]],L=[[function(e){return"progress"===e.type&&(e.hasMediaProperty("value")||e.hasMediaProperty("total")||e.hasMediaProperty("style"))},function(e,t){const r=e.property.get("value"),n=e.dynamicProperty.get("value"),i=(0,o.getMediaProperty)(e,"value");if(!(t.mediaParams instanceof Map)||0===i.size)return;let s=null!=r?r:"0";(0,a.isEmptyOrUndefined)(n)||(s=n);const p=(0,o.getVariableName)(e.id,"value");t.setDefaultValue(p,(0,o.getType)("value"),s),t.setMediaProperty(p,i),t.mediaParams.set("value",p)}],[l("progress","total"),(0,t.rawDataMediaParamParser)("total")],[l("progress","style"),T("style","ProgressStyle.")],[l("progress","color"),S("color")]],F=[[l("slider","value"),(0,t.rawDataMediaParamParser)("value")],[l("slider","min"),(0,t.rawDataMediaParamParser)("min")],[l("slider","max"),(0,t.rawDataMediaParamParser)("max")],[l("slider","step"),(0,t.rawDataMediaParamParser)("step")],[l("slider","style"),T("style","SliderStyle.")],[l("slider","block-color"),S("block-color")],[l("slider","track-color"),S("track-color")],[l("slider","selected-color"),S("selected-color")],[l("slider","show-steps"),g("show-steps")],[l("slider","show-tips"),g("show-tips")]],k=[[l("text","content"),function(e,t){A(e,t,"content")}],[l("text","text-align"),h("text-align","TextAlign.")],[l("text","text-overflow"),function(e,t){const r=(0,o.getMediaProperty)(e,"text-overflow",y);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"text-overflow",y),a=(0,o.getVariableName)(e.id,"text-overflow");t.setDefaultValue(a,(0,o.getType)("text-overflow"),n),t.setMediaProperty(a,r),t.mediaProperties.set("textOverflow",new Map([["overflow",a]]))}],[l("text","max-lines"),m("max-lines")],[l("text","line-height"),f("line-height")],[function(e){return"text"===e.type&&(e.hasMediaProperty("decoration-type")||e.hasMediaProperty("decoration-color"))},function(e,t){const r=(0,o.getMediaProperty)(e,"decoration-type",(0,a.curry)(a.getEtsEnumValue)("TextDecorationType.")),n=(0,o.getMediaProperty)(e,"decoration-color",a.dealWithColor);if(0===r.size&&0===n.size)return;let i=(0,o.getMediaDefaultValue)(e,"decoration-type",(0,a.curry)(a.getEtsEnumValue)("TextDecorationType.")),s=(0,o.getMediaDefaultValue)(e,"decoration-color",a.dealWithColor);if(r.size>0){const n=(0,o.getVariableName)(e.id,"decoration-type");t.setDefaultValue(n,(0,o.getType)("decoration-type"),i),t.setMediaProperty(n,r),i=n}if(n.size>0){const r=(0,o.getVariableName)(e.id,"decoration-color");t.setDefaultValue(r,(0,o.getType)("decoration-color"),s),t.setMediaProperty(r,n),s=r}const p=new Map([["type",i]]);t.mediaProperties.set("decoration",p),"undefined"!==s&&p.set("color",s)}],[l("text","baseline-offset"),f("baseline-offset")],[l("text","text-case"),h("text-case","TextCase.")],[l("text","font-size"),f("font-size")],[l("text","font-style"),h("font-style","FontStyle.")],[l("text","font-weight"),M],[l("text","font-family"),f("font-family")]],B=[[l("column","space"),(0,t.stringMediaParamParser)("space")],[l("column","align-items-column"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-column",s.dealWithColumnAlignItems);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-column",s.dealWithColumnAlignItems),a=(0,o.getVariableName)(e.id,"align-items-column");t.setDefaultValue(a,(0,o.getType)("align-items-column"),n),t.setMediaProperty(a,r),t.mediaProperties.set("alignItems",a)}],[l("column","justify-content-rc"),N("justify-content-rc","FlexAlign.")]],D=[[l("row","space"),(0,t.stringMediaParamParser)("space")],[l("row","align-items-row"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-row",s.dealWithRowAlignItems);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-row",s.dealWithRowAlignItems),a=(0,o.getVariableName)(e.id,"align-items-row");t.setDefaultValue(a,(0,o.getType)("align-items-row"),n),t.setMediaProperty(a,r),t.mediaProperties.set("alignItems",a)}],[l("row","justify-content-rc"),N("justify-content-rc","FlexAlign.")]],U=[[l("flex","flex-direction"),function(e,t){const r=(0,o.getMediaProperty)(e,"flex-direction",(0,a.curry)(a.getEtsEnumValue)("FlexDirection."));if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"flex-direction",(0,a.curry)(a.getEtsEnumValue)("FlexDirection.")),i=(0,o.getVariableName)(e.id,"flex-direction");t.setDefaultValue(i,(0,o.getType)("flex-direction"),n),t.setMediaProperty(i,r),t.mediaParams.set("direction",i)}],[l("flex","wrap"),function(e,t){const r=(0,o.getMediaProperty)(e,"wrap",a.dealWithWrap);if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"wrap",a.dealWithWrap),i=(0,o.getVariableName)(e.id,"wrap");t.setDefaultValue(i,(0,o.getType)("wrap"),n),t.setMediaProperty(i,r),t.mediaParams.set("wrap",i)}],[l("flex","justify-content"),_("justify-content","FlexAlign.")],[l("flex","align-items-flex"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-flex",p.dealWithFlexAlignItems);if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-flex",p.dealWithFlexAlignItems),a=(0,o.getVariableName)(e.id,"align-items-flex");t.setDefaultValue(a,(0,o.getType)("align-items-flex"),n),t.setMediaProperty(a,r),t.mediaParams.set("alignItems",a)}],[l("flex","align-content"),_("align-content","FlexAlign.")]],V=[[l("list","space"),(0,t.stringMediaParamParser)("space")],[l("list","initial-index"),(0,t.rawDataMediaParamParser)("initial-index")],[l("list","list-direction"),h("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasMediaProperty("divider-stroke-width")||e.hasMediaProperty("divider-color")||e.hasMediaProperty("divider-start-margin")||e.hasMediaProperty("divider-end-margin"))},function(e,t){const r=[["divider-stroke-width",a.quoteString],["divider-color",a.dealWithColor],["divider-start-margin",a.quoteString],["divider-end-margin",a.quoteString]];let n=0;const i=new Map;for(const[s,p]of r){const r=(0,o.getMediaProperty)(e,s,p),l=(0,a.getEtsPropName)(s.replace("divider-",""));let c=(0,o.getMediaDefaultValue)(e,s,p);if("undefined"===c&&"divider-stroke-width"===s&&(c="0"),r.size>0){const a=(0,o.getVariableName)(e.id,s);t.setDefaultValue(a,(0,o.getType)(s),c),t.setMediaProperty(a,r),c=a,n++}i.set(l,c)}n>0&&t.mediaProperties.set("divider",i)}],[l("list","edit-mode"),g("edit-mode")],[l("list","edge-effect"),h("edge-effect","EdgeEffect.")],[l("list","chain-animation"),g("chain-animation")]],G=[[l("list-item","sticky"),h("sticky","Sticky.")],[l("list-item","editable"),g("editable")]],z=[[l("swiper","index"),m("index")],[l("swiper","auto-play"),g("auto-play")],[l("swiper","interval"),m("interval")],[l("swiper","indicator"),g("indicator")],[l("swiper","loop"),g("loop")],[l("swiper","duration"),m("duration")],[l("swiper","vertical"),g("vertical")],[l("swiper","item-space"),f("item-space")],[l("swiper","cached-count"),m("cached-count")],[l("swiper","disable-swipe"),g("disable-swipe")]],j=[[l("text-input","placeholder"),(0,t.stringMediaParamParser)("placeholder")],[l("text-input","textInput-type"),function(e,t){const r=(0,o.getMediaProperty)(e,"textInput-type",(0,a.curry)(a.getEtsEnumValue)("InputType."));if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"textInput-type",(0,a.curry)(a.getEtsEnumValue)("InputType.")),i=(0,o.getVariableName)(e.id,"textInput-type");t.setDefaultValue(i,(0,o.getType)("textInput-type"),n),t.setMediaProperty(i,r),t.mediaProperties.set("type",i)}],[l("text-input","placeholderColor"),S("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasMediaProperty("placeholderFont-size")||e.hasMediaProperty("placeholderFont-weight")||e.hasMediaProperty("placeholderFont-family")||e.hasMediaProperty("placeholderFont-style"))},function(e,t){const r=[["size",a.quoteString],["weight",c],["family",a.quoteString],["style",(0,a.curry)(a.getEtsEnumValue)("FontStyle.")]];let n=0;const i=new Map;for(const[a,s]of r){const r=`placeholderFont-${a}`,p=(0,o.getMediaProperty)(e,r,s);let l=(0,o.getMediaDefaultValue)(e,r,s);if(p.size>0){const a=(0,o.getVariableName)(e.id,r);t.setDefaultValue(a,(0,o.getType)(r),l),t.setMediaProperty(a,p),l=a,n++}i.set(a,l)}n>0&&t.mediaProperties.set("placeholderFont",i)}],[l("text-input","enterKeyType"),h("enterKeyType","EnterKeyType.")],[l("text-input","caretColor"),S("caretColor")],[l("text-input","maxLength"),m("maxLength")]],W=[[l("refresh","friction"),(0,t.rawDataMediaParamParser)("friction")],[l("refresh","offset"),(0,t.stringMediaParamParser)("offset")],[l("refresh","refreshing"),(0,t.rawDataMediaParamParser)("refreshing")]],$=[[l("timePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[l("timePicker","useMilitaryTime"),g("useMilitaryTime")]],q=[[l("datePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[l("datePicker","start"),(0,t.dateMediaParamParser)("start","start","private")],[l("datePicker","end"),(0,t.dateMediaParamParser)("end","end","private")],[l("datePicker","lunar"),g("lunar")]],H=[[l("textPicker","range"),(0,t.rawDataMediaParamParser)("range")],[l("textPicker","textPicker-selected"),E("textPicker-selected","selected","@State")],[l("textPicker","defaultPickerItemHeight"),f("defaultPickerItemHeight")]],Y=[[l("select","select-option"),function(e,t){!function(e,t,r){const n=e.dynamicProperty.get(r),i=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===i.size)return;const s=null!=n?n:'[{value: ""}]',p=(0,o.getVariableName)(e.id,r);t.setDefaultValue(p,(0,o.getType)(r),s),t.setMediaProperty(p,i),t.setMediaParams(p)}(e,t,"select-option")}],[l("select","select-value"),function(e,t){const r="select-value",n=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,a.quoteString),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaProperties.set("value",s)}],[l("select","selected"),m("selected")],[l("select","font-size"),O("font","size")],[l("select","font-style"),O("font","style")],[l("select","font-family"),O("font","family")],[l("select","font-weight"),O("font","weight")],[l("select","selected-option-font-size"),O("selected-option-font","size")],[l("select","selected-option-font-style"),O("selected-option-font","style")],[l("select","selected-option-font-family"),O("selected-option-font","family")],[l("select","selected-option-font-weight"),O("selected-option-font","weight")],[l("select","selected-option-font-color"),S("selected-option-font-color")],[l("select","selected-option-bg-color"),S("selected-option-bg-color")],[l("select","option-font-size"),O("option-font","size")],[l("select","option-font-style"),O("option-font","style")],[l("select","option-font-family"),O("option-font","family")],[l("select","option-font-weight"),O("option-font","weight")],[l("select","option-font-color"),S("option-font-color")],[l("select","option-bg-color"),S("option-bg-color")]],X=[[l("toggle","toggle-type"),function(e,t){const r="ToggleType.",n="toggle-type",i=(0,o.getMediaProperty)(e,n,(0,a.curry)(a.getEtsEnumValue)(r));if(!(t.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(e,n,(0,a.curry)(a.getEtsEnumValue)(r)),p=(0,o.getVariableName)(e.id,n);t.setDefaultValue(p,(0,o.getType)(n),s),t.setMediaProperty(p,i),t.mediaParams.set("type",p)}],[l("toggle","isOn"),(0,t.rawDataMediaParamParser)("isOn")],[l("toggle","selectedColor"),S("selectedColor")],[l("toggle","switchPointColor"),S("switchPointColor")]],J=[[l("checkbox","select"),g("select")],[l("checkbox","selectedColor"),S("selectedColor")],[l("checkbox","name"),(0,t.stringMediaParamParser)("name")],[l("checkbox","group"),(0,t.stringMediaParamParser)("group")]],Q=[[l("checkboxGroup","selectAll"),g("selectAll")],[l("checkboxGroup","selectedColor"),S("selectedColor")],[l("checkboxGroup","group"),(0,t.stringMediaParamParser)("group")]],K=[[l("scroll","scrollable"),h("scrollable","ScrollDirection.")],[l("scroll","scroll-bar"),h("scroll-bar","BarState.")],[l("scroll","scroll-bar-color"),S("scroll-bar-color")],[l("scroll","scroll-bar-width"),f("scroll-bar-width")],[l("scroll","edge-effect-scroll"),function(e,t){const r="edge-effect-scroll",n=(0,o.getMediaProperty)(e,r,a.dealWithScrollEdgeEffect);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,a.dealWithScrollEdgeEffect),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaProperties.set("edgeEffect",s)}]],Z=[[l("grid","columns-template"),f("columns-template")],[l("grid","rows-template"),f("rows-template")],[l("grid","columns-gap"),f("columns-gap")],[l("grid","rows-gap"),f("rows-gap")],[l("grid","scroll-bar"),h("scroll-bar","BarState.")],[l("grid","scroll-bar-color"),S("scroll-bar-color")],[l("grid","scroll-bar-width"),f("scroll-bar-width")],[l("grid","cached-count"),m("cached-count")],[l("grid","edit-mode"),g("edit-mode")],[l("grid","layout-direction"),h("layout-direction","GridDirection.")],[l("grid","max-count"),m("max-count")],[l("grid","min-count"),m("min-count")],[l("grid","cell-length"),m("cell-length")],[l("grid","multi-selectable"),g("multi-selectable")],[l("grid","support-animation"),g("support-animation")]],ee=[[l("grid-item","row-start"),m("row-start")],[l("grid-item","row-end"),m("row-end")],[l("grid-item","column-start"),m("column-start")],[l("grid-item","column-end"),m("column-end")],[l("grid-item","force-rebuild"),g("force-rebuild")],[l("grid-item","selectable"),g("selectable")]],te=[[l("stack","align-content-stack"),function(e,t){const r="align-content-stack",n=(0,o.getMediaProperty)(e,r,(0,a.curry)(a.getEtsEnumValue)("Alignment."));if(!(t.mediaParams instanceof Map)||0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,(0,a.curry)(a.getEtsEnumValue)("Alignment.")),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaParams.set("alignContent",s)}]],re=[[l("navigation","navigation-title"),v("navigation-title","title")],[l("navigation","subTitle"),f("subTitle")],[l("navigation","menus"),P("menus")],[l("navigation","titleMode"),h("titleMode","NavigationTitleMode.")],[l("navigation","toolBar"),P("toolBar")],[l("navigation","hideToolBar"),g("hideToolBar")],[l("navigation","hideTitleBar"),g("hideTitleBar")],[l("navigation","hideBackButton"),g("hideBackButton")]],oe=[[function(e){return"search"===e.type},function(e,t){const r=[];w("value",r,e,t),w("placeholder",r,e,t),w("icon",r,e,t),w("controller",r,e,t),0!==r.length&&t.setParams(`{${r.join(", ")}}`)}],[l("search","text-font-size"),O("text-font","size")],[l("search","text-font-style"),O("text-font","style")],[l("search","text-font-weight"),O("text-font","weight")],[l("search","text-font-family"),O("text-font","family")],[l("search","placeholder-font-size"),O("placeholder-font","size")],[l("search","placeholder-font-style"),O("placeholder-font","style")],[l("search","placeholder-font-weight"),O("placeholder-font","weight")],[l("search","placeholder-font-family"),O("placeholder-font","family")],[l("search","placeholderColor"),S("placeholderColor")],[l("search","search-text-align"),function(e,t){const r=(0,o.getMediaProperty)(e,"search-text-align",(0,a.curry)(a.getEtsEnumValue)("TextAlign."));if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"search-text-align",(0,a.curry)(a.getEtsEnumValue)("TextAlign.")),i=(0,o.getVariableName)(e.id,"search-text-align");t.setDefaultValue(i,(0,o.getType)("search-text-align"),n),t.setMediaProperty(i,r),t.mediaProperties.set("textAlign",i)}],[l("search","search-button"),f("search-button")],[l("search","copy-option"),h("copy-option","CopyOptions.")]],ne=[[l("tabs","bar-position"),T("bar-position","BarPosition.")],[l("tabs","index"),(0,t.rawDataMediaParamParser)("index")],[l("tabs","controller"),(0,t.rawDataMediaParamParser)("controller")],[l("tabs","vertical"),g("vertical")],[l("tabs","tabs-scrollable"),b("tabs-scrollable","scrollable")],[l("tabs","bar-mode"),h("bar-mode","BarMode.")],[l("tabs","bar-width"),f("bar-width")],[l("tabs","bar-height"),f("bar-height")],[l("tabs","animation-duration"),m("animation-duration")]],ae=[[function(e){return"tab-content"===e.type&&(e.hasMediaProperty("tabBar-icon")||e.hasMediaProperty("tabBar-text"))},function(e,t){const r=(0,o.getMediaProperty)(e,"tabBar-text",a.quoteString),n=(0,o.getMediaProperty)(e,"tabBar-icon",i.dealWithSrc),s=(0,o.getMediaDefaultValue)(e,"tabBar-text",a.quoteString),p=(0,o.getMediaDefaultValue)(e,"tabBar-icon",i.dealWithSrc),l=(0,o.getVariableName)(e.id,"tabBar-text"),c=(0,o.getVariableName)(e.id,"tabBar-icon"),u=new Map([["text",s],["icon",p]]);r.size>0&&(t.setDefaultValue(l,(0,o.getType)("tabBar-text"),s),t.setMediaProperty(l,r),u.set("text",l)),n.size>0&&(t.setDefaultValue(c,(0,o.getType)("tabBar-icon"),p),t.setMediaProperty(c,n),u.set("icon",c)),t.mediaProperties.set("tabBar",u)}]];t.componentsMediaParserArray=[...R,...I,...x,...L,...F,...k,...B,...D,...U,...V,...G,...z,...j,...X,...W,...$,...H,...Y,...q,...te,...K,...Z,...ee,...re,...oe,...ne,...ae,...J,...Q]},366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCustomMediaVisualModel=void 0;const o=r(6125),n=r(3135),a=r(6282),i=r(1195),s=r(8122);t.parseCustomMediaVisualModel=function(e,t){(0,i.getCustomAttributeMap)().forEach(((r,n)=>{if(function(e,t){return e.hasMediaProperty(t)}(e,n)){const l=p.get(r.type);"function"==typeof l&&l(n,e,t);const c=o.enumParserMap.get(r.type);"function"==typeof c&&function(e,t,r,o){const n=(0,a.getMediaProperty)(t,e,o);if(!(r.mediaParams instanceof Map)||0===n.size)return;const p=(0,a.getMediaDefaultValue)(t,e,o),l=(0,a.getVariableName)(t.id,e);r.setDefaultValue(l,(0,a.getType)(e),p),r.setMediaProperty(l,n),r.mediaParams.set((0,s.getEtsPropName)(e),(0,i.getDynamicValueByDecorator)(e,l))}(n,e,t,c)}}))};const p=new Map([["string",n.stringMediaParamParser],["boolean",n.rawDataMediaParamParser],["number",n.rawDataMediaParamParser],["any[]",n.rawDataMediaParamParser],["object",n.rawDataMediaParamParser],["Date",function(e,t,r){(0,n.dateMediaParamParser)(e,(0,s.getEtsPropName)(e),"private",t,r)}]])},3729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMediaProperty=t.parseMediaVisualModel=void 0;const o=r(1912),n=r(9223),a=r(3135);function i(e,t,r){const o=t.get(r);return void 0!==o&&o.has(e)}t.parseMediaVisualModel=function(e,t){(0,n.forEachParser)(e,t),(0,n.ifParser)(e,t);for(const r of p)("boolean"==typeof r[0]||r[0](e))&&r[1](e,t)},t.isMediaProperty=function(e,t){return!i(e,s,"common")&&!i(e,s,t)&&!i(e,s,"events")};const s=new Map([["common",new Set(["keyGenerator","item","idx"])],["events",new Set([...o.events])]]),p=[...n.commonMediaParserArray,...a.componentsMediaParserArray]},6282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMediaDefaultValue=t.getVariableName=t.getMediaProperty=t.getType=void 0;const o=r(4294),n=r(1290),a=r(1195),i=r(8122);function s(e,t){for(const r of t)if(r.property===e)return r.etsType;return""}t.getType=function(e){const t=e+"-visual",r=n.etsPropertyList;let o="";for(const e of r)if(void 0!==e.propertySet.properties&&(o=s(t,e.propertySet.properties)),e.propertySet.property===t&&(o=e.propertySet.etsType),""!==o)break;return""!==o?function(e=""){const t=new Map([["Rfloat","Resource"],["Rstring","Resource"],["Rcolor","Resource"],["Rmedia","Resource"],["Rrawfile","Resource"],["Rplural","Resource"],["ETSArray","any[]"]]),r=new Array;return e.split("|").forEach((e=>{const o=t.get(e),n=null!=o?o:e;r.includes(n)||r.push(null!=o?o:e)})),r.join(" | ")}(o):(0,a.getCustomAttrType)(e)},t.getMediaProperty=function(e,t,r){var o,n;const a=new Map;return(null!==(o=e.mediaProperty)&&void 0!==o?o:new Map).forEach(((e,o)=>{let n=e.get(t);(0,i.isEmptyOrUndefined)(n)||("function"==typeof r&&(n=r(n)),(0,i.isEmptyOrUndefined)(n)||a.set(o,n))})),(null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map).forEach(((e,r)=>{let o=e.get(t);void 0===o||"content"!==t&&"label"!==t||(o=(0,i.getContentName)(o)),(0,i.isEmptyOrUndefined)(o)||a.set(r,o)})),a},t.getVariableName=function(e,t){const r=(0,o.getTagName)(e),n=`this.${(0,i.getEtsPropName)(r)}${(0,i.firstUpperCase)((0,i.getEtsPropName)(t))}`;return`${n}_${(0,o.getUniqueId)(n)}`},t.getMediaDefaultValue=function(e,t,r){var o;const n=e.property.get(t),a=e.dynamicProperty.get(t);let s=null!==(o=new Map([["if","true"],["auto-play","false"],["interval","3000"],["select-value","''"],["columns-template","''"],["rows-template","''"],["tabBar-icon","''"],["tabBar-text","'TabBar'"]]).get(t))&&void 0!==o?o:"undefined";return(0,i.isEmptyOrUndefined)(n)||(s="function"==typeof r?r(n):n,s=(0,i.isEmptyOrUndefined)(s)?"undefined":s),(0,i.isEmptyOrUndefined)(a)||(s=a),s}},7893:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseBuildersVisualModel=void 0;const o=r(8122);t.parseBuildersVisualModel=function(e,t,r){const n=e.slots;void 0!==n&&0!==n.size&&n.forEach(((n,a)=>{const i=(0,o.getBuilderUniqueName)(e.id,a);t.properties.set(a,`this.${i}`),t.builders.set(i,r.visit(n))}))}},8916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buttonParserArray=void 0;const o=r(8122);t.buttonParserArray=[[(0,o.hasFeatureProperty)("button","label"),o.labelParamParser],[(0,o.hasFeatureProperty)("button","type"),(0,o.enumPropertyParser)("type","ButtonType.")],[(0,o.hasFeatureProperty)("button","state-effect"),(0,o.booleanPropertyParser)("state-effect")],[(0,o.hasFeatureProperty)("button","font-size"),(0,o.stringPropertyParser)("font-size")],[(0,o.hasFeatureProperty)("button","font-style"),(0,o.enumPropertyParser)("font-style","FontStyle.")],[(0,o.hasFeatureProperty)("button","font-weight"),o.fontWeightPropertyParser],[(0,o.hasFeatureProperty)("button","font-family"),(0,o.stringPropertyParser)("font-family")]]},1147:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxGroupParseArray=void 0;const o=r(8122);t.checkboxGroupParseArray=[[(0,o.hasFeatureProperty)("checkboxGroup","selectAll"),(0,o.booleanPropertyParser)("selectAll")],[(0,o.hasFeatureProperty)("checkboxGroup","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("checkboxGroup","group"),(0,o.stringParamParser)("group")]]},2218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxParseArray=void 0;const o=r(8122);t.checkboxParseArray=[[(0,o.hasFeatureProperty)("checkbox","select"),(0,o.booleanPropertyParser)("select")],[(0,o.hasFeatureProperty)("checkbox","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("checkbox","name"),(0,o.stringParamParser)("name")],[(0,o.hasFeatureProperty)("checkbox","group"),(0,o.stringParamParser)("group")]]},7150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonParserArray=void 0;const o=r(8122),n=r(9248);function a(e,t,r,n=!1){(0,o.isEmptyOrUndefined)(t)||r.set(e,n?t:(0,o.quoteString)(t))}function i(e,t,r,n,a){const i=e.getProperty(t),s=e.getProperty(r),p=e.dynamicProperty.has(t),l=e.dynamicProperty.has(r),c=(0,o.getEdgeBorderDirection)(r);(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||n.set(c,p?i:a(i)):n.set(c,l?s:a(s))}t.commonParserArray=[[(0,o.hasCommonProperty)("width"),(0,o.stringPropertyParser)("width")],[(0,o.hasCommonProperty)("height"),(0,o.stringPropertyParser)("height")],[function(e){return e.hasProperty("constraint-size-min-width")||e.hasProperty("constraint-size-max-width")||e.hasProperty("constraint-size-min-height")||e.hasProperty("constraint-size-max-height")},function(e,t){const r=new Map,o=e.getProperty("constraint-size-min-width"),n=e.getProperty("constraint-size-max-width"),i=e.getProperty("constraint-size-min-height"),s=e.getProperty("constraint-size-max-height");a("minWidth",o,r,e.dynamicProperty.has("constraint-size-min-width")),a("maxWidth",n,r,e.dynamicProperty.has("constraint-size-max-width")),a("minHeight",i,r,e.dynamicProperty.has("constraint-size-min-height")),a("maxHeight",s,r,e.dynamicProperty.has("constraint-size-max-height")),r.size>0&&t.properties.set("constraintSize",r)}],[(0,o.hasCommonProperty)("align"),(0,o.enumPropertyParser)("align","Alignment.")],[(0,o.hasCommonProperty)("direction"),(0,o.enumPropertyParser)("direction","Direction.")],[function(e){return e.hasProperty("left")||e.hasProperty("top")},function(e,t){const r="absolute"===e.property.get("position")?"position":"offset",n=e.property.get("left"),a=e.property.get("top"),i=e.dynamicProperty.get("left"),s=e.dynamicProperty.get("top");if((0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(n)&&(0,o.isEmptyOrUndefined)(a))return;const p=new Map([["x",`${(0,o.quoteString)(null!=n?n:"0")}`],["y",`${(0,o.quoteString)(null!=a?a:"0")}`]]);(0,o.isEmptyOrUndefined)(i)||p.set("x",i),(0,o.isEmptyOrUndefined)(s)||p.set("y",s),t.properties.set(r,p)}],[(0,o.hasCommonProperty)("aspect-ratio"),(0,o.numberPropertyParser)("aspect-ratio")],[(0,o.hasCommonProperty)("display-priority"),(0,o.numberPropertyParser)("display-priority")],[(0,o.hasCommonProperty)("flex-basis"),(0,o.stringPropertyParser)("flex-basis")],[(0,o.hasCommonProperty)("flex-grow"),(0,o.numberPropertyParser)("flex-grow")],[(0,o.hasCommonProperty)("flex-shrink"),(0,o.numberPropertyParser)("flex-shrink")],[(0,o.hasCommonProperty)("align-self"),function(e,t){const r=e.dynamicProperty.get("align-self");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignSelf",r);const n=e.property.get("align-self");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.dealWithAlignSelf)(n);t.properties.set("alignSelf",a)}],[function(e){return e.hasProperty("border-style")||e.hasProperty("border-top-style")||e.hasProperty("border-right-style")||e.hasProperty("border-bottom-style")||e.hasProperty("border-left-style")},function(e,t){const r=new Map,n=e.getProperty("border-style"),a=e.getProperty("border-top-style"),s=e.getProperty("border-bottom-style"),p=e.getProperty("border-left-style"),l=e.getProperty("border-right-style"),c=e.dynamicProperty.has("border-style"),u=(0,o.getBorderDirections)("border-style");for(const t of u)i(e,"border-style",t,r,(0,o.curry)(o.getEtsEnumValue)("BorderStyle."));(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-style"),c?n:(0,o.getEtsEnumValue)("BorderStyle.",n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-style"),r)}],[function(e){return e.hasProperty("border-width")||e.hasProperty("border-top-width")||e.hasProperty("border-right-width")||e.hasProperty("border-bottom-width")||e.hasProperty("border-left-width")},function(e,t){const r=new Map,n=e.getProperty("border-width"),i=e.getProperty("border-top-width"),s=e.getProperty("border-bottom-width"),p=e.getProperty("border-left-width"),l=e.getProperty("border-right-width"),c=e.property.has("border-top-width"),u=e.property.has("border-bottom-width"),y=e.property.has("border-left-width"),d=e.property.has("border-right-width"),f=e.dynamicProperty.has("border-width"),m=e.dynamicProperty.has("border-top-width"),g=e.dynamicProperty.has("border-bottom-width"),h=e.dynamicProperty.has("border-left-width"),E=e.dynamicProperty.has("border-right-width");(0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-width"),f?n:(0,o.quoteString)(n)):(a("top",null!=i?i:n,r,m||!c&&f),a("bottom",null!=s?s:n,r,g||!u&&f),a("left",null!=p?p:n,r,h||!y&&f),a("right",null!=l?l:n,r,E||!d&&f),r.size>0&&t.properties.set((0,o.getEtsPropName)("border-width"),r))}],[function(e){return e.hasProperty("border-color")||e.hasProperty("border-top-color")||e.hasProperty("border-right-color")||e.hasProperty("border-bottom-color")||e.hasProperty("border-left-color")},function(e,t){const r=new Map,n=e.getProperty("border-color"),a=e.getProperty("border-top-color"),s=e.getProperty("border-bottom-color"),p=e.getProperty("border-left-color"),l=e.getProperty("border-right-color"),c=e.dynamicProperty.has("border-color"),u=(0,o.getBorderDirections)("border-color");for(const t of u)i(e,"border-color",t,r,o.dealWithColor);(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-color"),c?n:(0,o.dealWithColor)(n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-color"),r)}],[function(e){return e.hasProperty("border-radius")||e.hasProperty("border-top-left-radius")||e.hasProperty("border-top-right-radius")||e.hasProperty("border-bottom-right-radius")||e.hasProperty("border-bottom-left-radius")},function(e,t){const r=new Map,n=e.getProperty("border-radius"),a=e.getProperty("border-top-left-radius"),s=e.getProperty("border-top-right-radius"),p=e.getProperty("border-bottom-left-radius"),l=e.getProperty("border-bottom-right-radius"),c=e.dynamicProperty.has("border-radius"),u=(0,o.getBorderDirections)("border-radius");for(const t of u)i(e,"border-radius",t,r,o.quoteString);(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-radius"),c?n:(0,o.quoteString)(n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-radius"),r)}],[(0,o.hasCommonProperty)("background-color"),(0,o.colorPropertyParser)("background-color")],[function(e){return e.hasProperty("background-image-src")||e.hasProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),a=e.property.get("background-image-repeat"),i=e.dynamicProperty.get("background-image-src"),s=e.dynamicProperty.get("background-image-repeat");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s))return;let p=(0,n.dealWithSrc)(null!=r?r:"");if((0,o.isEmptyOrUndefined)(i)||(p=i),(0,o.isEmptyOrUndefined)(s)){if(!(0,o.isEmptyOrUndefined)(a)){const e=(0,o.dealWithBackgroundRepeat)(a);null!=e&&""!==e&&(p=p+", "+e)}}else p=p+", "+s;t.properties.set("backgroundImage",p)}],[(0,o.hasCommonProperty)("background-image-size"),function(e,t){const r=e.dynamicProperty.get("background-image-size");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("backgroundImageSize",r);const n=e.property.get("background-image-size");if((0,o.isEmptyOrUndefined)(n))return;if(""!==(0,o.getBackgroundImageSizeEnumValue)(n))return void t.properties.set("backgroundImageSize",(0,o.getEtsEnumValue)("ImageSize.",n));const a=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);null!==a&&(void 0!==a[5]?t.properties.set("backgroundImageSize",new Map([["width",`${(0,o.quoteString)(a[1])}`],["height",`${(0,o.quoteString)(a[5])}`]])):t.properties.set("backgroundImageSize",new Map([["width",`${(0,o.quoteString)(a[1])}`]])))}],[(0,o.hasCommonProperty)("background-image-position"),function(e,t){const r=e.dynamicProperty.get("background-image-position");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("backgroundImagePosition",r);const n=e.property.get("background-image-position");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.getBackgroundImagePositionEnumValue)(n);if(""!==a)return void t.properties.set("backgroundImagePosition",a);const i=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);null!==i&&t.properties.set("backgroundImagePosition",new Map([["x",`${(0,o.quoteString)(i[1])}`],["y",`${(0,o.quoteString)(i[4])}`]]))}],[(0,o.hasCommonProperty)("opacity"),(0,o.numberPropertyParser)("opacity")],[(0,o.hasCommonProperty)("visibility"),(0,o.enumPropertyParser)("visibility","Visibility.")],[(0,o.hasCommonProperty)("enabled"),(0,o.booleanPropertyParser)("enabled")],[(0,o.hasCommonProperty)("font-color"),(0,o.colorPropertyParser)("font-color")],[function(e){return e.hasProperty("margin")||e.hasProperty("margin-left")||e.hasProperty("margin-top")||e.hasProperty("margin-right")||e.hasProperty("margin-bottom")},function(e,t){var r,o,n,i;const s=new Map,p=e.getProperty("margin"),l=null!==(r=e.getProperty("margin-top"))&&void 0!==r?r:p,c=null!==(o=e.getProperty("margin-bottom"))&&void 0!==o?o:p,u=null!==(n=e.getProperty("margin-left"))&&void 0!==n?n:p,y=null!==(i=e.getProperty("margin-right"))&&void 0!==i?i:p,d=e.property.has("margin-top"),f=e.property.has("margin-bottom"),m=e.property.has("margin-left"),g=e.property.has("margin-right"),h=e.dynamicProperty.has("margin"),E=e.dynamicProperty.has("margin-top"),T=e.dynamicProperty.has("margin-bottom"),S=e.dynamicProperty.has("margin-left"),P=e.dynamicProperty.has("margin-right");a("top",l,s,E||!d&&h),a("bottom",c,s,T||!f&&h),a("left",u,s,S||!m&&h),a("right",y,s,P||!g&&h),s.size>0&&t.properties.set("margin",s)}],[function(e){return e.hasProperty("padding")||e.hasProperty("padding-left")||e.hasProperty("padding-top")||e.hasProperty("padding-right")||e.hasProperty("padding-bottom")},function(e,t){var r,o,n,i;const s=new Map,p=e.getProperty("padding"),l=null!==(r=e.getProperty("padding-top"))&&void 0!==r?r:p,c=null!==(o=e.getProperty("padding-bottom"))&&void 0!==o?o:p,u=null!==(n=e.getProperty("padding-left"))&&void 0!==n?n:p,y=null!==(i=e.getProperty("padding-right"))&&void 0!==i?i:p,d=e.property.has("padding-top"),f=e.property.has("padding-bottom"),m=e.property.has("padding-left"),g=e.property.has("padding-right"),h=e.dynamicProperty.has("padding"),E=e.dynamicProperty.has("padding-top"),T=e.dynamicProperty.has("padding-bottom"),S=e.dynamicProperty.has("padding-left"),P=e.dynamicProperty.has("padding-right");a("top",l,s,E||!d&&h),a("bottom",c,s,T||!f&&h),a("left",u,s,S||!m&&h),a("right",y,s,P||!g&&h),s.size>0&&t.properties.set("padding",s)}]]},1778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dividerParserArray=void 0;const o=r(8122);t.dividerParserArray=[[(0,o.hasFeatureProperty)("divider","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("divider","color"),(0,o.colorPropertyParser)("color")],[(0,o.hasFeatureProperty)("divider","stroke-width"),(0,o.stringPropertyParser)("stroke-width")],[(0,o.hasFeatureProperty)("divider","line-cap"),(0,o.enumPropertyParser)("line-cap","LineCapStyle.")]]},5264:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithFlexAlignItems=t.flexParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t,r,n)=>{if(!(n.params instanceof Map))return;const a=r.dynamicProperty.get(e);if(!(0,o.isEmptyOrUndefined)(a))return void n.params.set((0,o.getEtsPropName)(e),a);const i=r.property.get(e);if((0,o.isEmptyOrUndefined)(i))return;let s=(0,o.getEtsEnumValue)(t,i);"flex-start"===i?s=t+"Start":"flex-end"===i&&(s=t+"End"),n.params.set((0,o.getEtsPropName)(e),s)}));function a(e){let t=(0,o.getEtsEnumValue)("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}t.flexParserArray=[[(0,o.hasFeatureProperty)("flex","flex-direction"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("flex-direction");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("direction",r);const n=e.property.get("flex-direction");(0,o.isEmptyOrUndefined)(n)||t.params.set("direction",(0,o.getEtsEnumValue)("FlexDirection.",n))}],[(0,o.hasFeatureProperty)("flex","wrap"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("wrap");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("wrap",r);const n=e.property.get("wrap");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.dealWithWrap)(n);t.params.set("wrap",a)}],[(0,o.hasFeatureProperty)("flex","justify-content"),n("justify-content","FlexAlign.")],[(0,o.hasFeatureProperty)("flex","align-items-flex"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-items-flex");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("alignItems",r);const n=e.property.get("align-items-flex");if((0,o.isEmptyOrUndefined)(n))return;const i=a(n);t.params.set("alignItems",i)}],[(0,o.hasFeatureProperty)("flex","align-content"),n("align-content","FlexAlign.")]],t.dealWithFlexAlignItems=a},2153:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridItemParserArray=t.gridParserArray=void 0;const o=r(8122);t.gridParserArray=[[(0,o.hasFeatureProperty)("grid","scroller"),o.scrollerParamParser],[(0,o.hasFeatureProperty)("grid","columns-template"),(0,o.stringPropertyParser)("columns-template")],[(0,o.hasFeatureProperty)("grid","rows-template"),(0,o.stringPropertyParser)("rows-template")],[(0,o.hasFeatureProperty)("grid","columns-gap"),(0,o.stringPropertyParser)("columns-gap")],[(0,o.hasFeatureProperty)("grid","rows-gap"),(0,o.stringPropertyParser)("rows-gap")],[(0,o.hasFeatureProperty)("grid","scroll-bar"),(0,o.enumPropertyParser)("scroll-bar","BarState.")],[(0,o.hasFeatureProperty)("grid","scroll-bar-color"),(0,o.colorPropertyParser)("scroll-bar-color")],[(0,o.hasFeatureProperty)("grid","scroll-bar-width"),(0,o.stringPropertyParser)("scroll-bar-width")],[(0,o.hasFeatureProperty)("grid","cached-count"),(0,o.numberPropertyParser)("cached-count")],[(0,o.hasFeatureProperty)("grid","edit-mode"),(0,o.booleanPropertyParser)("edit-mode")],[(0,o.hasFeatureProperty)("grid","layout-direction"),(0,o.enumPropertyParser)("layout-direction","GridDirection.")],[(0,o.hasFeatureProperty)("grid","max-count"),(0,o.numberPropertyParser)("max-count")],[(0,o.hasFeatureProperty)("grid","min-count"),(0,o.numberPropertyParser)("min-count")],[(0,o.hasFeatureProperty)("grid","cell-length"),(0,o.numberPropertyParser)("cell-length")],[(0,o.hasFeatureProperty)("grid","multi-selectable"),(0,o.booleanPropertyParser)("multi-selectable")],[(0,o.hasFeatureProperty)("grid","support-animation"),(0,o.booleanPropertyParser)("support-animation")]],t.gridItemParserArray=[[(0,o.hasFeatureProperty)("grid-item","row-start"),(0,o.numberPropertyParser)("row-start")],[(0,o.hasFeatureProperty)("grid-item","row-end"),(0,o.numberPropertyParser)("row-end")],[(0,o.hasFeatureProperty)("grid-item","column-start"),(0,o.numberPropertyParser)("column-start")],[(0,o.hasFeatureProperty)("grid-item","column-end"),(0,o.numberPropertyParser)("column-end")],[(0,o.hasFeatureProperty)("grid-item","force-rebuild"),(0,o.booleanPropertyParser)("force-rebuild")],[(0,o.hasFeatureProperty)("grid-item","selectable"),(0,o.booleanPropertyParser)("selectable")]]},9248:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithSrc=t.imageParserArray=t.isTargetComponent=void 0;const o=r(8122);function n(e){return null===e.match(/\$(r|rawfile)\('(.*)'\)$/)?(0,o.quoteString)(e):e}t.isTargetComponent=(0,o.curry)(((e,t)=>t.type===e)),t.imageParserArray=[[(0,t.isTargetComponent)("image"),function(e,t){var r;const a=e.dynamicProperty.get("src");if(!(0,o.isEmptyOrUndefined)(a))return void t.setParams(a);const i=null!==(r=e.property.get("src"))&&void 0!==r?r:"";t.setParams(n(i))}],[(0,o.hasFeatureProperty)("image","alt"),(0,o.stringPropertyParser)("alt")],[(0,o.hasFeatureProperty)("image","object-fit"),(0,o.enumPropertyParser)("object-fit","ImageFit.")],[(0,o.hasFeatureProperty)("image","object-repeat"),(0,o.enumPropertyParser)("object-repeat","ImageRepeat.")],[(0,o.hasFeatureProperty)("image","interpolation"),(0,o.enumPropertyParser)("interpolation","ImageInterpolation.")],[(0,o.hasFeatureProperty)("image","render-mode"),(0,o.enumPropertyParser)("render-mode","ImageRenderMode.")],[function(e){return e.hasProperty("source-size-width")||e.hasProperty("source-size-height")},function(e,t){let r=e.getProperty("source-size-width"),n=e.getProperty("source-size-height");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(n))return;const a=e.dynamicProperty.has("source-size-width"),i=e.dynamicProperty.has("source-size-height");r="0"===r||(0,o.isEmptyOrUndefined)(r)?"0":a?r:r.substring(0,r.length-2),n="0"===n||(0,o.isEmptyOrUndefined)(n)?"0":i?n:n.substring(0,n.length-2);const s=new Map([["width",r],["height",n]]);t.properties.set("sourceSize",s)}]],t.dealWithSrc=n},7907:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemParserArray=t.listParserArray=void 0;const o=r(8122);t.listParserArray=[[(0,o.hasFeatureProperty)("list","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("list","initial-index"),(0,o.rawDataParamParser)("initial-index")],[(0,o.hasFeatureProperty)("list","list-direction"),(0,o.enumPropertyParser)("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasProperty("divider-stroke-width")||e.hasProperty("divider-color")||e.hasProperty("divider-start-margin")||e.hasProperty("divider-end-margin"))},function(e,t){const r=e.property.get("divider-stroke-width"),n=e.dynamicProperty.get("divider-stroke-width"),a=new Map([["strokeWidth",`${(0,o.quoteString)(null!=r?r:"0")}`]]);(0,o.isEmptyOrUndefined)(n)||a.set("strokeWidth",n);const i=e.property.get("divider-color"),s=e.dynamicProperty.get("divider-color"),p=e.property.get("divider-start-margin"),l=e.dynamicProperty.get("divider-start-margin"),c=e.property.get("divider-end-margin"),u=e.dynamicProperty.get("divider-end-margin");(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||a.set("color",(0,o.dealWithColor)(i)):a.set("color",s),(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(p)||a.set("startMargin",(0,o.quoteString)(p)):a.set("startMargin",l),(0,o.isEmptyOrUndefined)(u)?(0,o.isEmptyOrUndefined)(c)||a.set("endMargin",(0,o.quoteString)(c)):a.set("endMargin",u),t.properties.set("divider",a)}],[(0,o.hasFeatureProperty)("list","edit-mode"),(0,o.booleanPropertyParser)("edit-mode")],[(0,o.hasFeatureProperty)("list","edge-effect"),(0,o.enumPropertyParser)("edge-effect","EdgeEffect.")],[(0,o.hasFeatureProperty)("list","chain-animation"),(0,o.booleanPropertyParser)("chain-animation")]],t.listItemParserArray=[[(0,o.hasFeatureProperty)("list-item","sticky"),(0,o.enumPropertyParser)("sticky","Sticky.")],[(0,o.hasFeatureProperty)("list-item","editable"),(0,o.booleanPropertyParser)("editable")]]},8191:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.navigationParserArray=void 0;const o=r(8122);t.navigationParserArray=[[(0,o.hasFeatureProperty)("navigation","navigation-title"),function(e,t){const r=e.getProperty("navigation-title"),n=e.dynamicProperty.get("navigation-title");(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||t.properties.set("title",(0,o.quoteString)(r)):t.properties.set("title",n)}],[(0,o.hasFeatureProperty)("navigation","subTitle"),(0,o.stringPropertyParser)("subTitle")],[(0,o.hasFeatureProperty)("navigation","menus"),(0,o.objectPropertyParser)("menus")],[(0,o.hasFeatureProperty)("navigation","titleMode"),(0,o.enumPropertyParser)("titleMode","NavigationTitleMode.")],[(0,o.hasFeatureProperty)("navigation","toolBar"),(0,o.objectPropertyParser)("toolBar")],[(0,o.hasFeatureProperty)("navigation","hideToolBar"),(0,o.booleanPropertyParser)("hideToolBar")],[(0,o.hasFeatureProperty)("navigation","hideTitleBar"),(0,o.booleanPropertyParser)("hideTitleBar")],[(0,o.hasFeatureProperty)("navigation","hideBackButton"),(0,o.booleanPropertyParser)("hideBackButton")]]},2565:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textPickerParserArray=t.datePickerParserArray=t.timePickerParserArray=void 0;const o=r(8122);t.timePickerParserArray=[[(0,o.hasFeatureProperty)("timePicker","datetime-selected"),(0,o.dateParamParser)("datetime-selected","selected")],[(0,o.hasFeatureProperty)("timePicker","useMilitaryTime"),(0,o.booleanPropertyParser)("useMilitaryTime")]],t.datePickerParserArray=[[(0,o.hasFeatureProperty)("datePicker","datetime-selected"),(0,o.dateParamParser)("datetime-selected","selected")],[(0,o.hasFeatureProperty)("datePicker","start"),(0,o.dateParamParser)("start","start")],[(0,o.hasFeatureProperty)("datePicker","end"),(0,o.dateParamParser)("end","end")],[(0,o.hasFeatureProperty)("datePicker","lunar"),(0,o.booleanPropertyParser)("lunar")]],t.textPickerParserArray=[[(0,o.hasFeatureProperty)("textPicker","range"),(0,o.arrayParamParser)("range")],[(0,o.hasFeatureProperty)("textPicker","textPicker-selected"),(0,o.customRawDataParamParser)("textPicker-selected","selected")],[(0,o.hasFeatureProperty)("textPicker","defaultPickerItemHeight"),(0,o.stringPropertyParser)("defaultPickerItemHeight")]]},8483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.progressParserArray=void 0;const o=r(8122);t.progressParserArray=[[function(e){return"progress"===e.type&&(e.hasProperty("value")||e.hasProperty("total")||e.hasProperty("style"))},function(e,t){var r;(0,o.dynamicParamParser)("value",e,t)||t.params instanceof Map&&t.params.set("value",null!==(r=e.getProperty("value"))&&void 0!==r?r:"0")}],[(0,o.hasFeatureProperty)("progress","total"),(0,o.rawDataParamParser)("total")],[(0,o.hasFeatureProperty)("progress","style"),(0,o.enumParamParser)("style","ProgressStyle.")],[(0,o.hasFeatureProperty)("progress","color"),(0,o.colorPropertyParser)("color")]]},4925:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshParserArray=void 0;const o=r(8122);t.refreshParserArray=[[(0,o.hasFeatureProperty)("refresh","friction"),(0,o.rawDataParamParser)("friction")],[(0,o.hasFeatureProperty)("refresh","offset"),(0,o.stringParamParser)("offset")],[(0,o.hasFeatureProperty)("refresh","refreshing"),(0,o.booleanParamParser)("refreshing")]]},1790:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithRowAlignItems=t.dealWithColumnAlignItems=t.rowParserArray=t.columnParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t,r,n)=>{if(!(n.properties instanceof Map))return;const a=r.dynamicProperty.get(e);if(!(0,o.isEmptyOrUndefined)(a))return void n.properties.set("justifyContent",a);const i=r.property.get(e);if((0,o.isEmptyOrUndefined)(i))return;let s=(0,o.getEtsEnumValue)(t,i);"flex-start"===i?s=t+"Start":"flex-end"===i&&(s=t+"End"),n.properties.set("justifyContent",s)}));function a(e){let t=(0,o.getEtsEnumValue)("HorizontalAlign.",e);return"flex-start"===e?t="HorizontalAlign.Start":"flex-end"===e&&(t="HorizontalAlign.End"),t}function i(e){let t=(0,o.getEtsEnumValue)("VerticalAlign.",e);return"flex-start"===e?t="VerticalAlign.Top":"flex-end"===e&&(t="VerticalAlign.Bottom"),t}t.columnParserArray=[[(0,o.hasFeatureProperty)("column","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("column","align-items-column"),function(e,t){const r=e.dynamicProperty.get("align-items-column");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-column");if((0,o.isEmptyOrUndefined)(n))return;const i=a(n);t.properties.set("alignItems",i)}],[(0,o.hasFeatureProperty)("column","justify-content-rc"),n("justify-content-rc","FlexAlign.")]],t.rowParserArray=[[(0,o.hasFeatureProperty)("row","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("row","align-items-row"),function(e,t){const r=e.dynamicProperty.get("align-items-row");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-row");if((0,o.isEmptyOrUndefined)(n))return;const a=i(n);t.properties.set("alignItems",a)}],[(0,o.hasFeatureProperty)("row","justify-content-rc"),n("justify-content-rc","FlexAlign.")]],t.dealWithColumnAlignItems=a,t.dealWithRowAlignItems=i},7375:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollParserArray=void 0;const o=r(8122);t.scrollParserArray=[[(0,o.hasFeatureProperty)("scroll","scrollable"),(0,o.enumPropertyParser)("scrollable","ScrollDirection.")],[(0,o.hasFeatureProperty)("scroll","scroll-bar"),(0,o.enumPropertyParser)("scroll-bar","BarState.")],[(0,o.hasFeatureProperty)("scroll","scroll-bar-color"),(0,o.colorPropertyParser)("scroll-bar-color")],[(0,o.hasFeatureProperty)("scroll","scroll-bar-width"),(0,o.stringPropertyParser)("scroll-bar-width")],[(0,o.hasFeatureProperty)("scroll","edge-effect-scroll"),function(e,t){const r="edge-effect-scroll";if((0,o.dynamicPropertyParser)(r,e,t))return;const n=e.property.get(r);(0,o.isEmptyOrUndefined)(n)||t.properties.set("edgeEffect",(0,o.getEtsEnumValue)("EdgeEffect.",n))}],[(0,o.hasFeatureProperty)("scroll","scroller"),o.scrollerParamParser]]},9284:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchParserArray=void 0;const o=r(8122),n=r(8014);function a(e,t,r,n){const a=new Map([["value","search-value"],["placeholder","search-placeholder"],["icon","icon"],["controller","search-controller"]]).get(e);if(void 0===a)return;const i=r.getProperty(a),s=r.dynamicProperty.get(a);"controller"!==e||(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||t.push(`${e}: ${(0,o.quoteString)(i)}`):t.push(`${e}: ${(0,o.getContentName)(s)}`):t.push(`${e}: ${s}`)}t.searchParserArray=[[(0,o.hasFeatureProperty)("search","text-font-size"),(0,n.selectFontParser)("text-font","size")],[(0,o.hasFeatureProperty)("search","text-font-style"),(0,n.selectFontParser)("text-font","style")],[(0,o.hasFeatureProperty)("search","text-font-weight"),(0,n.selectFontParser)("text-font","weight")],[(0,o.hasFeatureProperty)("search","text-font-family"),(0,n.selectFontParser)("text-font","family")],[(0,o.hasFeatureProperty)("search","placeholder-font-size"),(0,n.selectFontParser)("placeholder-font","size")],[(0,o.hasFeatureProperty)("search","placeholder-font-style"),(0,n.selectFontParser)("placeholder-font","style")],[(0,o.hasFeatureProperty)("search","placeholder-font-weight"),(0,n.selectFontParser)("placeholder-font","weight")],[(0,o.hasFeatureProperty)("search","placeholder-font-family"),(0,n.selectFontParser)("placeholder-font","family")],[(0,o.hasFeatureProperty)("search","placeholderColor"),(0,o.colorPropertyParser)("placeholderColor")],[(0,o.hasFeatureProperty)("search","search-text-align"),o.searchTextAlign],[function(e){return"search"===e.type},function(e,t){const r=[];a("value",r,e),a("placeholder",r,e),a("icon",r,e),a("controller",r,e),t.setParams(`{${r.join(", ")}}`)}],[(0,o.hasFeatureProperty)("search","search-button"),(0,o.stringPropertyParser)("search-button")],[(0,o.hasFeatureProperty)("search","copy-option"),(0,o.enumPropertyParser)("copy-option","CopyOptions.")]]},8014:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectParserArray=t.selectFontParser=void 0;const o=r(8122);t.selectFontParser=(0,o.curry)(((e,t,r,n)=>{let a=n.properties.get((0,o.getEtsPropName)(e));void 0===a&&(a=new Map);const i=`${e}-${t}`,s=r.property.get(i),p=r.dynamicProperty.get(i);"string"!=typeof a&&((0,o.isEmptyOrUndefined)(p)?(0,o.isEmptyOrUndefined)(s)||("size"!==t&&"family"!==t||a.set(t,(0,o.quoteString)(s)),"style"===t&&a.set(t,(0,o.getEtsEnumValue)("FontStyle.",s)),"weight"===t&&a.set(t,(0,o.dealWithFontWeight)(s))):a.set(t,p)),n.properties.set((0,o.getEtsPropName)(e),a)})),t.selectParserArray=[[(0,o.hasSelectOption)("select","select-option"),function(e,t){const r=e.dynamicProperty.get("select-option");t.setParams(null!=r?r:'[{value: ""}]')}],[(0,o.hasFeatureProperty)("select","select-value"),function(e,t){const r=e.getProperty("select-value"),n=e.dynamicProperty.get("select-value");(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||t.properties.set("value",(0,o.quoteString)(r)):t.properties.set("value",(0,o.getContentName)(n))}],[(0,o.hasFeatureProperty)("select","selected"),(0,o.numberPropertyParser)("selected")],[(0,o.hasFeatureProperty)("select","font-size"),(0,t.selectFontParser)("font","size")],[(0,o.hasFeatureProperty)("select","font-style"),(0,t.selectFontParser)("font","style")],[(0,o.hasFeatureProperty)("select","font-weight"),(0,t.selectFontParser)("font","weight")],[(0,o.hasFeatureProperty)("select","font-family"),(0,t.selectFontParser)("font","family")],[(0,o.hasFeatureProperty)("select","selected-option-font-size"),(0,t.selectFontParser)("selected-option-font","size")],[(0,o.hasFeatureProperty)("select","selected-option-font-style"),(0,t.selectFontParser)("selected-option-font","style")],[(0,o.hasFeatureProperty)("select","selected-option-font-weight"),(0,t.selectFontParser)("selected-option-font","weight")],[(0,o.hasFeatureProperty)("select","selected-option-font-family"),(0,t.selectFontParser)("selected-option-font","family")],[(0,o.hasFeatureProperty)("select","selected-option-font-color"),(0,o.colorPropertyParser)("selected-option-font-color")],[(0,o.hasFeatureProperty)("select","selected-option-bg-color"),(0,o.colorPropertyParser)("selected-option-bg-color")],[(0,o.hasFeatureProperty)("select","option-font-size"),(0,t.selectFontParser)("option-font","size")],[(0,o.hasFeatureProperty)("select","option-font-style"),(0,t.selectFontParser)("option-font","style")],[(0,o.hasFeatureProperty)("select","option-font-weight"),(0,t.selectFontParser)("option-font","weight")],[(0,o.hasFeatureProperty)("select","option-font-family"),(0,t.selectFontParser)("option-font","family")],[(0,o.hasFeatureProperty)("select","option-font-color"),(0,o.colorPropertyParser)("option-font-color")],[(0,o.hasFeatureProperty)("select","option-bg-color"),(0,o.colorPropertyParser)("option-bg-color")]]},2563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sliderParserArray=void 0;const o=r(8122);t.sliderParserArray=[[(0,o.hasFeatureProperty)("slider","value"),(0,o.rawDataParamParser)("value")],[(0,o.hasFeatureProperty)("slider","min"),(0,o.rawDataParamParser)("min")],[(0,o.hasFeatureProperty)("slider","max"),(0,o.rawDataParamParser)("max")],[(0,o.hasFeatureProperty)("slider","step"),(0,o.rawDataParamParser)("step")],[(0,o.hasFeatureProperty)("slider","style"),(0,o.enumParamParser)("style","SliderStyle.")],[(0,o.hasFeatureProperty)("slider","block-color"),(0,o.colorPropertyParser)("block-color")],[(0,o.hasFeatureProperty)("slider","track-color"),(0,o.colorPropertyParser)("track-color")],[(0,o.hasFeatureProperty)("slider","selected-color"),(0,o.colorPropertyParser)("selected-color")],[(0,o.hasFeatureProperty)("slider","show-steps"),(0,o.booleanPropertyParser)("show-steps")],[(0,o.hasFeatureProperty)("slider","show-tips"),(0,o.booleanPropertyParser)("show-tips")]]},8936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackParserArray=void 0;const o=r(8122);t.stackParserArray=[[(0,o.hasFeatureProperty)("stack","align-content-stack"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-content-stack");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("alignContent",r);const n=e.property.get("align-content-stack");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.getEtsEnumValue)("Alignment.",n);t.params.set((0,o.getEtsPropName)("alignContent"),a)}]]},780:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.swiperParserArray=void 0;const o=r(8122);t.swiperParserArray=[[(0,o.hasFeatureProperty)("swiper","index"),(0,o.numberPropertyParser)("index")],[(0,o.hasFeatureProperty)("swiper","auto-play"),(0,o.booleanPropertyParser)("auto-play")],[(0,o.hasFeatureProperty)("swiper","interval"),(0,o.numberPropertyParser)("interval")],[(0,o.hasFeatureProperty)("swiper","indicator"),(0,o.booleanPropertyParser)("indicator")],[(0,o.hasFeatureProperty)("swiper","loop"),(0,o.booleanPropertyParser)("loop")],[(0,o.hasFeatureProperty)("swiper","duration"),(0,o.numberPropertyParser)("duration")],[(0,o.hasFeatureProperty)("swiper","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("swiper","item-space"),(0,o.stringPropertyParser)("item-space")],[(0,o.hasFeatureProperty)("swiper","cached-count"),(0,o.numberPropertyParser)("cached-count")],[(0,o.hasFeatureProperty)("swiper","disable-swipe"),(0,o.booleanPropertyParser)("disable-swipe")]]},7036:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabContentParserArray=void 0;const o=r(8122),n=r(9248);t.tabContentParserArray=[[function(e){return"tab-content"===e.type&&(e.hasProperty("tabBar-icon")||e.hasProperty("tabBar-text"))},function(e,t){var r,a;const i=new Map,s=null!==(r=e.getProperty("tabBar-icon"))&&void 0!==r?r:"",p=null!==(a=e.getProperty("tabBar-text"))&&void 0!==a?a:"TabBar",l=e.dynamicProperty.has("tabBar-text"),c=e.dynamicProperty.has("tabBar-icon");(0,o.isEmptyOrUndefined)(s)||i.set("icon",c?s:(0,n.dealWithSrc)(s)),void 0!==p&&i.set("text",l?p:(0,o.quoteString)(p)),i.size>0&&t.properties.set("tabBar",i)}]]},2973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabsParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t)=>{const r=e.dynamicProperty.get("tabs-scrollable");if(void 0!==r&&""!==r.trim())return void t.properties.set("scrollable",r);const n=e.property.get("tabs-scrollable");(0,o.isEmptyOrUndefined)(n)||t.properties.set("scrollable",n)}));t.tabsParserArray=[[(0,o.hasFeatureProperty)("tabs","bar-position"),(0,o.enumParamParser)("bar-position","BarPosition.")],[(0,o.hasFeatureProperty)("tabs","index"),(0,o.rawDataParamParser)("index")],[(0,o.hasFeatureProperty)("tabs","controller"),(0,o.rawDataParamParser)("controller")],[(0,o.hasFeatureProperty)("tabs","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("tabs","tabs-scrollable"),n],[(0,o.hasFeatureProperty)("tabs","bar-mode"),(0,o.enumPropertyParser)("bar-mode","BarMode.")],[(0,o.hasFeatureProperty)("tabs","bar-width"),(0,o.stringPropertyParser)("bar-width")],[(0,o.hasFeatureProperty)("tabs","bar-height"),(0,o.stringPropertyParser)("bar-height")],[(0,o.hasFeatureProperty)("tabs","animation-duration"),(0,o.numberPropertyParser)("animation-duration")]]},1162:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textInputParserArray=void 0;const o=r(8122);t.textInputParserArray=[[(0,o.hasFeatureProperty)("text-input","placeholder"),(0,o.stringParamParser)("placeholder")],[(0,o.hasFeatureProperty)("text-input","textInput-type"),function(e,t){const r=e.dynamicProperty.get("textInput-type");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("type",r);const n=e.property.get("textInput-type");(0,o.isEmptyOrUndefined)(n)||t.properties.set("type","InputType."+n)}],[(0,o.hasFeatureProperty)("text-input","placeholderColor"),(0,o.colorPropertyParser)("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasProperty("placeholderFont-size")||e.hasProperty("placeholderFont-weight")||e.hasProperty("placeholderFont-family")||e.hasProperty("placeholderFont-style"))},function(e,t){const r=e.property.get("placeholderFont-size"),n=e.dynamicProperty.get("placeholderFont-size"),a=e.property.get("placeholderFont-weight"),i=e.dynamicProperty.get("placeholderFont-weight"),s=e.property.get("placeholderFont-family"),p=e.dynamicProperty.get("placeholderFont-family"),l=e.property.get("placeholderFont-style"),c=e.dynamicProperty.get("placeholderFont-style"),u=new Map;(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||u.set("size",parseInt(r)):u.set("size",n),(0,o.isEmptyOrUndefined)(i)?(0,o.isEmptyOrUndefined)(a)||u.set("weight",isNaN(Number(a))?(0,o.getEtsEnumValue)("FontWeight.",a):a):u.set("weight",i),(0,o.isEmptyOrUndefined)(p)?(0,o.isEmptyOrUndefined)(s)||u.set("family",(0,o.quoteString)(s)):u.set("family",p),(0,o.isEmptyOrUndefined)(c)?(0,o.isEmptyOrUndefined)(l)||u.set("style",(0,o.getEtsEnumValue)("FontStyle.",l)):u.set("style",c),t.properties.set("placeholderFont",u)}],[(0,o.hasFeatureProperty)("text-input","enterKeyType"),(0,o.enumPropertyParser)("enterKeyType","EnterKeyType.")],[(0,o.hasFeatureProperty)("text-input","caretColor"),(0,o.colorPropertyParser)("caretColor")],[(0,o.hasFeatureProperty)("text-input","maxLength"),(0,o.numberPropertyParser)("maxLength")]]},8681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textParserArray=void 0;const o=r(8122);t.textParserArray=[[(0,o.hasFeatureProperty)("text","content"),o.contentParamParser],[(0,o.hasFeatureProperty)("text","text-align"),(0,o.enumPropertyParser)("text-align","TextAlign.")],[(0,o.hasFeatureProperty)("text","text-overflow"),function(e,t){const r=e.dynamicProperty.get("text-overflow");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("textOverflow",new Map([["overflow",r]]));const n=e.property.get("text-overflow");(0,o.isEmptyOrUndefined)(n)||t.properties.set("textOverflow",new Map([["overflow","TextOverflow."+(0,o.firstUpperCase)(n)]]))}],[(0,o.hasFeatureProperty)("text","max-lines"),(0,o.numberPropertyParser)("max-lines")],[(0,o.hasFeatureProperty)("text","line-height"),(0,o.stringPropertyParser)("line-height")],[function(e){return"text"===e.type&&(e.hasProperty("decoration-type")||e.hasProperty("decoration-color"))},function(e,t){const r=e.property.get("decoration-type"),n=e.dynamicProperty.get("decoration-type"),a=e.property.get("decoration-color"),i=e.dynamicProperty.get("decoration-color");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(n)&&(0,o.isEmptyOrUndefined)(i))return;const s=new Map;(0,o.isEmptyOrUndefined)(n)?s.set("type",(0,o.isEmptyOrUndefined)(r)?"TextDecorationType.None":(0,o.getEtsEnumValue)("TextDecorationType.",r)):s.set("type",n),t.properties.set("decoration",s),(0,o.isEmptyOrUndefined)(i)?(0,o.isEmptyOrUndefined)(a)||s.set("color",(0,o.dealWithColor)(a)):s.set("color",i)}],[(0,o.hasFeatureProperty)("text","baseline-offset"),(0,o.stringPropertyParser)("baseline-offset")],[(0,o.hasFeatureProperty)("text","text-case"),(0,o.enumPropertyParser)("text-case","TextCase.")],[(0,o.hasFeatureProperty)("text","font-size"),(0,o.stringPropertyParser)("font-size")],[(0,o.hasFeatureProperty)("text","font-style"),(0,o.enumPropertyParser)("font-style","FontStyle.")],[(0,o.hasFeatureProperty)("text","font-weight"),o.fontWeightPropertyParser],[(0,o.hasFeatureProperty)("text","font-family"),(0,o.stringPropertyParser)("font-family")]]},4313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleParseArray=void 0;const o=r(8122);t.toggleParseArray=[[(0,o.hasFeatureProperty)("toggle","toggle-type"),function(e,t){const r="toggle-type";if((0,o.customDynamicParamParser)(r,"type",e,t))return;const n=e.property.get(r);!(0,o.isEmptyOrUndefined)(n)&&t.params instanceof Map&&t.params.set("type",(0,o.getEtsEnumValue)("ToggleType.",n))}],[(0,o.hasFeatureProperty)("toggle","isOn"),(0,o.booleanParamParser)("isOn")],[(0,o.hasFeatureProperty)("toggle","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("toggle","switchPointColor"),(0,o.colorPropertyParser)("switchPointColor")]]},8122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBuilderUniqueName=t.getEdgeBorderDirection=t.getBorderDirections=t.dealWithAlignSelf=t.dealWithScrollEdgeEffect=t.dealWithBackgroundRepeat=t.dealWithBackgroundImageSize=t.dealWithBackgroundImagePosition=t.dealWithFontWeight=t.getContentName=t.scrollerParamParser=t.dealWithWrap=t.getBackgroundImageSizeEnumValue=t.getBackgroundImagePositionEnumValue=t.contentParamParser=t.labelParamParser=t.fontWeightPropertyParser=t.dealWithColor=t.getEtsEnumValue=t.getEtsPropName=t.parseTagName=t.firstUpperCase=t.getForEachObj=t.colorPropertyParser=t.enumParamParser=t.arrayParamParser=t.booleanParamParser=t.customRawDataParamParser=t.rawDataParamParser=t.dateParamParser=t.stringParamParser=t.dynamicParamParser=t.searchTextAlign=t.enumPropertyParser=t.booleanPropertyParser=t.numberPropertyParser=t.isEmptyOrUndefined=t.objectPropertyParser=t.stringPropertyParser=t.customDynamicParamParser=t.dynamicPropertyParser=t.quoteString=t.hasSelectOption=t.hasFeatureProperty=t.hasCommonProperty=t.curry=void 0;const o=r(1195),n=r(4294);function a(e){return(...t)=>t.lengtht.property.has(e)||t.dynamicProperty.has(e))),t.hasFeatureProperty=a(((e,t,r)=>r.type===e&&(r.property.has(t)||r.dynamicProperty.has(t)))),t.hasSelectOption=a(((e,t,r)=>r.type===e)),t.quoteString=i,t.dynamicPropertyParser=s,t.customDynamicParamParser=p,t.stringPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.properties.set(y(e),i(o))})),t.objectPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.properties.set(y(e),o)})),t.isEmptyOrUndefined=l,t.numberPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);l(o)||r.properties.set(y(e),o)})),t.booleanPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);l(o)||r.properties.set(y(e),o)})),t.enumPropertyParser=a(((e,t,r,o)=>{if(s(e,r,o))return;const n=r.property.get(e);l(n)||o.properties.set(y(e),d(t,n))})),t.searchTextAlign=function(e,t){const r=e.dynamicProperty.get("search-text-align");if(void 0!==r&&""!==r.trim())return void t.properties.set("textAlign",r);const o=e.property.get("search-text-align");l(o)||t.properties.set("textAlign",d("TextAlign.",o))},t.dynamicParamParser=c,t.stringParamParser=a(((e,t,r)=>{if(c(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.params instanceof Map&&r.params.set(y(e),i(o))})),t.dateParamParser=a(((e,t,r,o)=>{const n=r.dynamicProperty.get(e);if(void 0!==n&&""!==n.trim()&&o.params instanceof Map)return void o.params.set(t,n);const a=r.property.get(e);void 0!==a&&o.params instanceof Map&&o.params.set(t,(e=>void 0===e||""===e?"new Date()":"new Date ("+i(e)+")")(a))})),t.rawDataParamParser=a(((e,t,r)=>{if(c(e,t,r))return;const o=t.property.get(e);!l(o)&&r.params instanceof Map&&r.params.set(y(e),o)})),t.customRawDataParamParser=a(((e,t,r,o)=>{if(p(e,t,r,o))return;const n=r.property.get(e);!l(n)&&o.params instanceof Map&&o.params.set(t,n)})),t.booleanParamParser=a(((e,r,o)=>{(0,t.rawDataParamParser)(e,r,o)})),t.arrayParamParser=a(((e,r,o)=>{(0,t.rawDataParamParser)(e,r,o)})),t.enumParamParser=a(((e,t,r,o)=>{if(c(e,r,o))return;const n=r.property.get(e);!l(n)&&o.params instanceof Map&&o.params.set(y(e),d(t,n))})),t.colorPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;let o=t.property.get(e);l(o)||(o=f(o),r.properties.set(y(e),o))})),t.getForEachObj=function(e){var t,r;const o=e.dynamicProperty.get("for"),n=e.dynamicProperty.get("keyGenerator"),a=null!==(t=e.property.get("item"))&&void 0!==t?t:"item",i=null!==(r=e.property.get("idx"))&&void 0!==r?r:"idx";return void 0!==e.dynamicProperty.get("for")?{for:o,key:n,item:a,idx:i}:null},t.firstUpperCase=u,t.parseTagName=function(e){return(0,n.getTagName)(e).split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")},t.getEtsPropName=y,t.getEtsEnumValue=d,t.dealWithColor=f,t.fontWeightPropertyParser=function(e,t){const r=e.getProperty("font-weight");if(l(r))return;const o=g(r);t.properties.set("fontWeight",o)},t.labelParamParser=function(e,t){const r=e.dynamicProperty.get("label");if(!l(r))return void t.setParams(m(r));const o=e.property.get("label");"string"==typeof o&&t.setParams(i(o))},t.contentParamParser=function(e,t){const r=e.property.get("content"),o=e.dynamicProperty.get("content");l(o)?"string"==typeof r&&t.setParams(i(r)):t.setParams(m(o))},t.getBackgroundImagePositionEnumValue=function(e){const t=new Map([["top left","TopStart"],["top center","Top"],["top right","TopEnd"],["center left","Start"],["center center","Center"],["center right","End"],["bottom left","BottomStart"],["bottom center","Bottom"],["bottom right","BottomEnd"]]);return t.has(e)?`Alignment.${String(t.get(e))}`:""},t.getBackgroundImageSizeEnumValue=function(e){return new Set(["cover","contain","auto"]).has(e)?d("ImageSize.",e):""},t.dealWithWrap=function(e){let t=d("FlexWrap.",e);return"nowrap"===e&&(t="FlexWrap.NoWrap"),t},t.scrollerParamParser=function(e,t){const r=e.dynamicProperty.get("scroller");l(r)||t.setParams(r)},t.getContentName=m,t.dealWithFontWeight=g,t.dealWithBackgroundImagePosition=function(e){if(new Set(["TopStart","Top","TopEnd","Start","Center","End","BottomStart","Bottom","BottomEnd"]).has(e))return"Alignment."+e;const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null!==t?`{ x: ${i(t[1])}, y: ${i(t[4])} }`:void 0},t.dealWithBackgroundImageSize=function(e){if(new Set(["Cover","Contain","Auto"]).has(e))return d("ImageSize.",e);const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null!==t?void 0!==t[5]?`{ width: ${i(t[1])}, height: ${i(t[5])} }`:`{ width: ${i(t[1])} }`:void 0},t.dealWithBackgroundRepeat=function(e){const t=new Map([["repeat-x","X"],["repeat-y","Y"],["repeat","XY"],["no-repeat","NoRepeat"]]).get(e);if(null!=t&&""!==t)return d("ImageRepeat.",t)},t.dealWithScrollEdgeEffect=function(e){var t;const r=d("EdgeEffect.",e);return null!==(t=new Map([["Spring","EdgeEffect.Spring"],["Fade","EdgeEffect.Fade"],["None","EdgeEffect.None"]]).get(r))&&void 0!==t?t:r},t.dealWithAlignSelf=function(e){let t=d("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t},t.getBorderDirections=function(e){return"border-width"===e?["border-top-width","border-bottom-width","border-left-width","border-right-width"]:"border-color"===e?["border-top-color","border-bottom-color","border-left-color","border-right-color"]:"border-style"===e?["border-top-style","border-bottom-style","border-left-style","border-right-style"]:["border-top-left-radius","border-bottom-right-radius","border-bottom-left-radius","border-top-right-radius"]},t.getEdgeBorderDirection=function(e){var t;return e.includes("radius")?null!==(t=new Map([["border-top-left-radius","topLeft"],["border-top-right-radius","topRight"],["border-bottom-left-radius","bottomLeft"],["border-bottom-right-radius","bottomRight"]]).get(e))&&void 0!==t?t:e:e.split("-")[1]},t.getBuilderUniqueName=function(e,t){const r=`${y((0,n.getTagName)(e))}${u(y(t))}`;return`${r}_${(0,n.getUniqueId)(r)}`}},1912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.events=t.parseVisualModel=void 0;const o=r(8122),n=r(7150),a=r(1778),i=r(8916),s=r(9248),p=r(8483),l=r(2563),c=r(8681),u=r(1790),y=r(8191),d=r(2153),f=r(780),m=r(2565),g=r(4313),h=r(5264),E=r(7907),T=r(7375),S=r(8014),P=r(4925),v=r(1162),b=r(9284),_=r(8936),N=r(2973),C=r(7036),A=r(2218),O=r(1147);t.parseVisualModel=function(e,r){r.setTagName((0,o.parseTagName)(e.type));const n=(0,o.getForEachObj)(e);r.setForEachObj(n);const a=void 0!==e.dynamicProperty.get("if")?e.dynamicProperty.get("if"):e.property.get("if");void 0===a?r.setIfBoolean(null):r.setIfBoolean(a);for(const t of M)("boolean"==typeof t[0]||t[0](e))&&t[1](e,r);!function(e,r){var o;const n="onDisappear",a="onDisAppear";for(let o of t.events){const t=e.property.get(o);o===n&&(o=a),void 0!==t&&""!==t&&("this"===t.split(".")[0]?r.properties.set(o,t+".bind(this)"):r.properties.set(o,t))}if(void 0!==e.property.get("newFunction")){const t=null!==(o=e.property.get("newFunction"))&&void 0!==o?o:"{}",i=JSON.parse(t);Object.keys(i).forEach((e=>{var t;const o=null!==(t=i[e].eventCodeGen)&&void 0!==t?t:"";e===n&&(e=a),r.properties.set(e,o)}))}}(e,r)},t.events=["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange","onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop","onComplete","onError","onFinish","onChange","onSubmit","onEditChanged","onStateChange","onRefreshing","onSelect","onScroll","onScrollEdge","onScrollEnd","onScrollBegin","onTitleModeChange","onCopy","onCut","onPaste"];const M=[...n.commonParserArray,...i.buttonParserArray,...a.dividerParserArray,...s.imageParserArray,...p.progressParserArray,...l.sliderParserArray,...c.textParserArray,...u.columnParserArray,...u.rowParserArray,...h.flexParserArray,...E.listParserArray,...E.listItemParserArray,...f.swiperParserArray,...v.textInputParserArray,...y.navigationParserArray,...m.timePickerParserArray,...m.textPickerParserArray,...P.refreshParserArray,...g.toggleParseArray,...S.selectParserArray,...m.datePickerParserArray,...T.scrollParserArray,...d.gridParserArray,...d.gridItemParserArray,...b.searchParserArray,..._.stackParserArray,...N.tabsParserArray,...C.tabContentParserArray,...A.checkboxParseArray,...O.checkboxGroupParseArray]},3243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Style=t.Tag=void 0;const o=r(4117);class n extends o.ASTNode{constructor(e,t,r){super(),this.tagName=e,this.attributes=t,this.content=r}}t.Tag=n;class a extends o.ASTNode{constructor(e,t,r,o){super(),this.mediaQuery=void 0,this.kind=e,this.name=t,this.content=r,this.mediaQuery=o}}t.Style=a},3573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const o=r(3243),n=r(2334);class a{constructor(e){this.cache=e}visit(e){e instanceof o.Tag?this.genTag(e):e instanceof o.Style&&this.genStyle(e)}static getMethodGen(e){return void 0===a.instance?a.instance=new a(e):a.instance.setCache(e),a.instance}setCache(e){this.cache=e}genTag(e){if(this.cache.concat(n.TokenClass.TAG_START,e.tagName),this.cache.indentOff(),e.attributes.forEach(((e,t)=>{let r="";for(const t of e)r+='"'===t?""":"\n"===t?" ":t;this.cache.concat(n.TokenClass.SPACE,t,n.TokenClass.ASSIGN,n.TokenClass.LQUOTE,r,n.TokenClass.RQUOTE)})),null===e.content)this.cache.concat(n.TokenClass.EMPTY_TAG_END);else{if(this.cache.concat(n.TokenClass.TAG_END),"string"==typeof e.content){let t="";for(const r of e.content)t+="<"===r?"<":r;this.cache.concat(t)}else 0!==e.content.length&&(this.cache.concat(n.TokenClass.NEW_LINE),this.cache.incIndent(),this.cache.indentOn(),e.content.forEach((e=>{e.accept(this),this.cache.indentOff(),this.cache.concat(n.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.indentOn(),this.cache.decIndent());this.cache.concat(n.TokenClass.END_TAG_START,e.tagName,n.TokenClass.TAG_END)}}genStyle(e){void 0!==e.mediaQuery&&(this.cache.concat("@media"),this.cache.indentOff(),this.cache.concat(n.TokenClass.SPACE,e.mediaQuery,n.TokenClass.SPACE,n.TokenClass.LBRA,n.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent()),"IDStyle"===e.kind&&(this.cache.concat(n.TokenClass.ID_STYLE_START),this.cache.indentOff()),this.cache.concat(e.name,n.TokenClass.SPACE,n.TokenClass.LBRA,n.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent(),e.content.forEach(((e,t)=>{this.cache.concat(t,n.TokenClass.COLON,n.TokenClass.SPACE,e,n.TokenClass.SEMICOLON,n.TokenClass.NEW_LINE)})),this.cache.decIndent(),this.cache.concat(n.TokenClass.RBRA,n.TokenClass.NEW_LINE),void 0!==e.mediaQuery&&(this.cache.decIndent(),this.cache.concat(n.TokenClass.RBRA,n.TokenClass.NEW_LINE)),this.cache.concat(n.TokenClass.NEW_LINE)}}t.ASTNodeGenerator=a,a.instance=void 0},8844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CSSBridge=t.HMLBridge=void 0;const o=r(3243),n=r(7571);t.HMLBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map([["id",e.id]]);let r="";for(let[o,a]of e.property)(0,n.isAttribute)(o,e.type)?("string"!=typeof a&&(a=JSON.stringify(a)),t.set(o,a)):(0,n.isContent)(o)&&(r=a);if(e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}const a=new o.Tag(e.type,t,r);return"wrapper"===t.get("id")?new o.Tag("div",new Map,[a]):a}},t.CSSBridge=class{constructor(){this.errors=0,this.styles=[]}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}genIDStyle(e){var t;const r=t=>{const r=new Map;for(const[o,a]of t)(0,n.isStyle)(o,e.type)&&r.set(o,a);return r},a=r(e.property);a.size>0&&this.styles.push(new o.Style("IDStyle",e.id,a)),(null!==(t=e.mediaProperty)&&void 0!==t?t:new Map).forEach(((t,n)=>{const a=r(t);a.size>0&&this.styles.push(new o.Style("IDStyle",e.id,a,n))}));for(const t of e.children)t.accept(this)}visit(e){return this.genIDStyle(e),this.styles}}},1055:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genFACSS=t.genFAHML=void 0;const o=r(3573),n=r(1862);t.genFAHML=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" "));return e.accept(t),t.cache.toString()},t.genFACSS=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" "));return e.forEach((e=>{e.accept(t)})),t.cache.toString()}},7571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEvent=t.isData=t.isUnknown=t.isContent=t.isAttribute=t.isStyle=t.styleMap=void 0;const o=r(904),n=["width","height","min-width","min-height","max-width","max-height","padding","padding-start","padding-end","padding-top","padding-right","padding-bottom","padding-left","margin","margin-start","margin-end","margin-top","margin-right","margin-bottom","margin-left","border-width","border-style","border-color","border-radius","border-top-width","border-top-style","border-top-color","border-top-left-radius","border-right-width","border-right-style","border-right-color","border-top-right-radius","border-bottom-width","border-bottom-style","border-bottom-color","border-bottom-right-radius","border-left-width","border-left-style","border-left-color","border-bottom-left-radius","background-color","background","background-image","background-size","background-position","background-repeat","display","opacity","visibility","flex","flex-grow","flex-shrink","flex-basis","position","display","top","right","bottom","left","display-index","flex-weight","aspect-ratio"],a=["font-size","font-family","font-style","font-weight"],i=["text-align","line-height","text-decoration","letter-spacing","max-lines","text-overflow","allow-scale","min-font-size","max-font-size","font-size-step","prefer-font-sizes","color",...a],s=["allow-scale","text-decoration","color",...a],p=["text-color","allow-scale","icon-width","icon-height","radius",...a],l=["texton-color","textoff-color","text-padding","allow-scale",...a],c=["column-height","text-color","allow-scale","letter-spacing","text-decoration","line-height","opacity",...a],u=["text-color","allow-scale","letter-spacing",...a];t.styleMap=new Map([["common",new Set([...n])],["div",new Set(["flex-direction","overflow","flex-wrap","justify-content","align-items","align-content","grid-template-columns","grid-template-rows","grid-row-start","grid-row-end","grid-column-start","grid-column-end","grid-gap","grid-columns-gap","grid-rows-gap"])],["text",new Set([...i])],["image",new Set(["object-fit","match-text-direction","fit-original-size"])],["span",new Set([...s])],["input",new Set(["font-size","font-family","font-weight","color","placeholder-color","allow-scale"])],["button",new Set([...p])],["switch",new Set([...l])],["refresh",new Set(["progress-color"])],["divider",new Set(["stroke-width","line-cap","color"])],["chart",new Set(["stroke-width","radius","start-angle","total-angle","center-x","center-y","colors","weights"])],["picker",new Set([...c])],["picker-view",new Set(["color","font-size","selected-color","selected-font-size","focus-color","focus-font-size","disappear-color","disappear-font-size","font-family"])],["slider",new Set(["color","selected-color","block-color"])],["swiper",new Set(["indicator-color","indicator-selected-color","indicator-size","indicator-top","indicator-right","indicator-bottom","indicator-left"])],["list",new Set(["flex-direction","columns","item-extent","fade-color"])],["list-item",new Set(["column-span"])],["progress",new Set(["color","stroke-width","background-color","secondary-color","scale-width","scale-number","start-angle","total-angle","center-x","center-y","radius"])],["select",new Set(["font-family"])],["menu",new Set([...u])],["option",new Set(["color","font-family","allow-scale","font-size","font-weight","text-decoration"])],["video",new Set(["object-fit"])],["clock",new Set(["font-family"])]]);const y=new Map([["common",new Set(["id","ref","disabled","focusable","data","if","for"])],["image",new Set(["src","alt"])],["button",new Set(["type","value","icon","waiting"])],["refresh",new Set(["offset","refreshing","type","lasttime","friction"])],["input",new Set(["type","checked","name","value","placeholder","maxlength","enterkeytype","headericon"])],["switch",new Set(["checked","showtext","texton","textoff"])],["option",new Set(["value","selected","icon"])],["chart",new Set(["type","percent","datasets","options"])],["picker",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","value","vibrate"])],["picker-view",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","indicatorprefix","indicatorsuffix","vibrate"])],["slider",new Set(["min","max","step","showtips","showsteps","mode","value"])],["divider",new Set(["vertical"])],["list",new Set(["scrollpage","cachedcount","scrollbar","scrolleffect","shapemode","indexer","itemscale","itemcenter","updateeffect","scrollvibrate","initialindex","initialoffset"])],["list-item",new Set(["type","primary","section","sticky","stickyradius","clickeffect"])],["swiper",new Set(["index","autoplay","interval","indicator","digital","indicatordisabled","loop","duration","vertical"])],["progress",new Set(["type","percent","secondarypercent","clockwise"])],["menu",new Set(["target","title","type"])],["clock",new Set(["clockconfig","showdigit","hourswest"])],["badge",new Set(["placement","count","visible","maxcount","config","label"])],["video",new Set(["muted","src","autoplay","poster","controls","loop","starttime","direction","speed"])],["tabs",new Set(["index","vertical"])],["tab-bar",new Set(["mode"])],["tab-content",new Set(["scrollable"])]]),d=new Map([["common",new Set(["ontouchstart","ontouchmove","ontouchcancel","ontouchend","onclick","onlongpress","onfocus","onblur","onkey","onswipe"])],["image",new Set(["oncomplete","onerror"])],["input",new Set(["onchange","onenterkeyclick"])],["select",new Set(["onchange"])],["refresh",new Set(["onrefresh","onpulldown"])],["swiper",new Set(["onchange","onrotation"])],["list",new Set(["onindexerchange","onscroll","onscrollbottom","onscrolltop","onscrollend","onscrolltouchup","onrequestitem"])],["list-item",new Set(["onsticky"])],["menu",new Set(["onselected","oncancel"])],["picker",new Set(["oncolumnchange","onchange","oncancel"])],["picker-view",new Set(["oncolumnchange","onchange"])],["video",new Set(["onprepared","onstart","onpause","onfinish","onerror","onseeking","onseeked","ontimeupdate","onfullscreenchange","onstop"])],["tabs",new Set(["onchange"])],["switch",new Set(["onchange"])],["dialog",new Set(["oncancel"])],["slider",new Set(["onchange"])]]),f=new Map([["common",new Set(["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange"])],["image",new Set(["onComplete","onError","onFinish"])],["swiper",new Set(["onChange"])],["list",new Set(["onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop"])],["text-input",new Set(["onChange","onSubmit","onEditChanged"])],["refresh",new Set(["onStateChange","onRefreshing"])],["toggle",new Set(["onChange"])],["timePicker",new Set(["onChange"])],["textPicker",new Set(["onChange"])],["select",new Set(["onSelect"])],["datePicker",new Set(["onChange"])],["search",new Set(["onSubmit","onChange","onCopy","onCut","onPaste"])],["grid",new Set(["onScrollIndex","onItemDragStart","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDrop"])],["grid-item",new Set(["onSelect"])],["scroll",new Set(["onScroll","onScrollEdge","onScrollEnd","onScrollBegin"])],["navigation",new Set(["onTitleModeChange"])],["tabs",new Set(["onChange"])],["checkbox",new Set(["onChange"])],["checkboxGroup",new Set(["onChange"])]]);function m(e,t,r){const o=t.get(r);return void 0!==o&&o.has(e)}function g(e,r){return m(e,t.styleMap,"common")||m(e,t.styleMap,r)}function h(e,t){return(0,o.getDomain)()===o.Domain.ETS?m(e,f,"common")||m(e,f,t):E(e,t)||T(e,t)}function E(e,t){return m(e,y,"common")||m(e,y,t)}function T(e,t){return m(e,d,"common")||m(e,d,t)}t.isStyle=g,t.isAttribute=h,t.isContent=function(e){return"content"===e},t.isUnknown=function(e,t){return!g(e,t)&&!h(e,t)},t.isData=E,t.isEvent=T},2334:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.INDENT=" ",r.SPACE=" ",r.LQUOTE='"',r.RQUOTE='"',r.TAG_START="<",r.TAG_END=">",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxGroupProperties=t.checkboxProperties=void 0;const o=r(1513);t.checkboxProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"Select",property:"select-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Name",property:"name-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Group",property:"group-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}}],t.checkboxGroupProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"SelectAll",property:"selectAll-visual"},o.commonParamsForJudge),{defaults:!1})}]},3311:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dividerProperties=void 0;const o=r(1513);t.dividerProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign({name:"Vertical",property:"vertical-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"LineCap",property:"line-cap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.LINE_CAP_STYLE,defaults:"butt",list:[o.CLEAN_VALUE_NODE,{name:"Butt",value:"butt"},{name:"Round",value:"round"},{name:"Square",value:"square"}]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"StrokeWidth",property:"stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength}}]},3687:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flexProperties=void 0;const o=r(1513);t.flexProperties=[{propertySector:o.Sector.FLEXCHILD,propertySet:{name:"FlexBasis",property:"flex-basis-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength,defaults:"auto",fixedValues:["auto"],info:"The initial main size of a flex item. It sets the size of the content box otherwise set with box-sizing."}},{propertySector:o.Sector.FLEXCHILD,propertySet:{name:"AlignSelf",property:"align-self-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"auto",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Direction",property:"flex-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_DIRECTION,defaults:"row",list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"RowReverse",value:"row-reverse"},{name:"Column",value:"column"},{name:"ColumnReverse",value:"column-reverse"}],info:"The direction of flex."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Wrap",property:"wrap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_WRAP,defaults:"nowrap",list:[o.CLEAN_VALUE_NODE,{name:"NoWrap",value:"nowrap"},{name:"Wrap",value:"wrap"},{name:"WrapReverse",value:"wrap-reverse"}],info:"Whether flex items are forced onto one line or multiple lines."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"JustifyContent",property:"justify-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"JustifyContent",property:"justify-content-rc-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-flex-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"stretch",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignContent",property:"align-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Set the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis."}}]},4836:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridItemProperties=void 0;const o=r(1513);t.gridItemProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowStart",property:"row-start-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowEnd",property:"row-end-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnStart",property:"column-start-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnEnd",property:"column-end-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ForceRebuild",property:"force-rebuild-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selectable",property:"selectable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"true"}}]},6181:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridProperties=void 0;const o=r(1513);t.gridProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnsTemplate",property:"columns-template-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowsTemplate",property:"rows-template-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnsGap",property:"columns-gap-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength,defaults:0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowsGap",property:"rows-gap-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength,defaults:0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"LayoutDirection",property:"layout-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.GRID_DIRECTION,list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"Column",value:"column"},{name:"RowReverse",value:"row-reverse"},{name:"ColumnReverse",value:"column-reverse"}],defaults:"row"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MaxCount",property:"max-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER,defaults:1/0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MinCount",property:"min-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER,defaults:1}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"CellLength",property:"cell-length-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MultiSelectable",property:"multi-selectable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SupportAnimation",property:"support-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}}]},8840:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemProperties=void 0;const o=r(1513);t.listItemProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Sticky",property:"sticky-visual",type:o.TypeName.SELECT,etsType:o.EtsType.STICKY,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"Normal",value:"normal"}],defaults:"none"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Editable",property:"editable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}]},8124:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listProperties=void 0;const o=r(1513);t.listProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"InitialIndex",property:"initial-index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:{name:"ListDirection",property:"list-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.AXIS,list:[o.CLEAN_VALUE_NODE,{name:"Vertical",value:"vertical"},{name:"Horizontal",value:"horizontal"}],defaults:"vertical"}},{propertySector:o.Sector.MORE,propertySet:{name:"Color",property:"divider-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"StrokeWidth",property:"divider-stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"StartMargin",property:"divider-start-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"EndMargin",property:"divider-end-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"EditMode",property:"edit-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}},{propertySector:o.Sector.MORE,propertySet:{name:"EdgeEffect",property:"edge-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{name:"Spring",value:"spring"},{name:"None",value:"none"}],defaults:"spring"}},{propertySector:o.Sector.MORE,propertySet:{name:"ChainAnimation",property:"chain-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}]},5452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.navigationProperties=void 0;const o=r(1513);t.navigationProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Title",property:"navigation-title-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SubTitle",property:"subTitle-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Menus",property:"menus-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TitleMode",property:"titleMode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.NAVIGATION_TITLEMODE,list:[o.CLEAN_VALUE_NODE,{value:"Free"},{value:"Mini"},{value:"Full"}],defaults:"Mini"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ToolBar",property:"toolBar-visual",type:o.TypeName.BASE,etsType:o.EtsType.OBJECT,supportStaticProperty:!1,defaults:{}}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideToolBar",property:"hideToolBar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideTitleBar",property:"hideTitleBar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideBackButton",property:"hideBackButton-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}}]},4090:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pickerProperties=void 0;const o=r(1513);t.pickerProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Range",property:"range-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selected",property:"datetime-selected-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Start",property:"start-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"End",property:"end-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"UseMilitaryTime",property:"useMilitaryTime-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selected",property:"textPicker-selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"DefaultPickerItemHeight",property:"defaultPickerItemHeight-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["vp","px","lpx"]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Lunar",property:"lunar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}]},5302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshProperties=void 0;const o=r(1513);t.refreshProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Friction",property:"friction-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,defaults:62}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Offset",property:"offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength,defaults:16}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Refreshing",property:"refreshing-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"false",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}]},4488:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollProperties=void 0;const o=r(1513);t.scrollProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.SCROLL_DIRECTION,list:[o.CLEAN_VALUE_NODE,{value:"Horizontal"},{value:"Vertical"},{value:"None"}],defaults:"Vertical",startApi:"9"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.SCROLL_DIRECTION,list:[o.CLEAN_VALUE_NODE,{value:"Horizontal"},{value:"Vertical"},{value:"None"},{value:"Free"}],defaults:"Vertical",endApi:"9"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBar",property:"scroll-bar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_STATE,list:[o.CLEAN_VALUE_NODE,{value:"Off"},{value:"On"},{value:"Auto"}]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBarColor",property:"scroll-bar-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.NON_R_COLOR}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBarWidth",property:"scroll-bar-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"EdgeEffect",property:"edge-effect-scroll-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{value:"Spring"},{value:"Fade"},{value:"None"}],defaults:"None"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scroller",property:"scroller-visual",type:o.TypeName.BASE,etsType:o.EtsType.SCROLLER,supportStaticProperty:!1}}]},128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchProperties=void 0;const o=r(1513),n=[{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontSize",property:"placeholder-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontStyle",property:"placeholder-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontWeight",property:"placeholder-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontFamily",property:"placeholder-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}}],a=[{propertySector:o.Sector.MORE,propertySet:{name:"TextFontSize",property:"text-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontStyle",property:"text-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontWeight",property:"text-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontFamily",property:"text-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.MORE,propertySet:{name:"TextAlign",property:"search-text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start"}}];t.searchProperties=[...n,...a,{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Controller",property:"search-controller-visual",type:o.TypeName.BASE,etsType:o.EtsType.SEARCH_CONTROLLER,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Icon",property:"icon-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Placeholder",property:"search-placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Value",property:"search-value-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.MORE,propertySet:{name:"SearchButton",property:"search-button-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.MORE,propertySet:{name:"CopyOption",property:"copy-option-visual",type:o.TypeName.SELECT,etsType:o.EtsType.COPY_OPTION,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"None"},{name:"InApp",value:"InApp"},{name:"LocalDevice",value:"LocalDevice"}],defaults:"None",startApi:"9"}}]},1021:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectProperties=void 0;const o=r(1513),n=[{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontSize",property:"selected-option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontStyle",property:"selected-option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontColor",property:"selected-option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontWeight",property:"selected-option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontFamily",property:"selected-option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionBackgroundColor",property:"selected-option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}],a=[{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontSize",property:"option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontStyle",property:"option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontColor",property:"option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontWeight",property:"option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontFamily",property:"option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionBackgroundColor",property:"option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}];t.selectProperties=[...n,...a,{propertySector:o.Sector.SELECT,propertySet:{name:"Value",property:"select-value-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.SELECT,propertySet:{name:"Selected",property:"selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.SELECT,propertySet:{name:"Options",property:"select-option-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}}]},8929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sliderProperties=void 0;const o=r(1513);t.sliderProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TrackColor",property:"track-color-visual",type:o.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ShowSteps",property:"show-steps-visual",type:o.TypeName.ADJUSTABLE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ShowTips",property:"show-tips-visual",type:o.TypeName.ADJUSTABLE}}]},1815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackProperties=void 0;const o=r(1513);t.stackProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignContent",property:"align-content-stack-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ALIGNMENT,defaults:"center",list:o.alignProperties}}]},1492:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.swiperProperties=void 0;const o=r(1513);t.swiperProperties=[{propertySector:o.Sector.MORE,propertySet:Object.assign({name:"AutoPlay",property:"auto-play-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.MORE,propertySet:{name:"Interval",property:"interval-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign(Object.assign({name:"Loop",property:"loop-visual"},o.commonParamsForJudge),{defaults:!0})},{propertySector:o.Sector.MORE,propertySet:{name:"Duration",property:"duration-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:{name:"ItemSpace",property:"item-space-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH}},{propertySector:o.Sector.MORE,propertySet:{name:"CachedCount",property:"cached-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign({name:"DisableSwipe",property:"disable-swipe-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Index",property:"index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign(Object.assign({name:"Indicator",property:"indicator-visual"},o.commonParamsForJudge),{defaults:!0})}]},6153:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabContentProperties=void 0;const o=r(1513);t.tabContentProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TabBar Icon",property:"tabBar-icon-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_SRC}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TabBar Text",property:"tabBar-text-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT}}]},6686:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabsProperties=void 0;const o=r(1513);t.tabsProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Controller",property:"controller-visual",type:o.TypeName.BASE,etsType:o.EtsType.TABS_CONTROLLER,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"tabs-scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"true"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarPosition",property:"bar-position-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_POSITION,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"End",value:"end"}],defaults:"start"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarMode",property:"bar-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_MODE,list:[o.CLEAN_VALUE_NODE,{name:"Scrollable",value:"scrollable"},{name:"Fixed",value:"fixed"}],defaults:"fixed"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarWidth",property:"bar-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarHeight",property:"bar-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AnimationDuration",property:"animation-duration-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:200}}]},3890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textInputProperties=void 0;const o=r(1513);t.textInputProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Placeholder",property:"placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"textInput-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.INPUT_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Password"},{value:"Email"},{value:"Number"}],defaults:"Normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderColor",property:"placeholderColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontSize",property:"placeholderFont-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp"]}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontWeight",property:"placeholderFont-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Lighter"},{value:"Regular"},{value:"Medium"},{value:"Bold"},{value:"Bolder"},...o.commonFontWeight],defaults:"400"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontFamily",property:"placeholderFont-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontStyle",property:"placeholderFont-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Italic"}],defaults:"Normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"EnterKeyType",property:"enterKeyType-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ENTER_KEY_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Go"},{value:"Search"},{value:"Send"},{value:"Next"},{value:"Done"}],defaults:"Done"}},{propertySector:o.Sector.MORE,propertySet:{name:"CaretColor",property:"caretColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"MaxLength",property:"maxLength-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}}]},8271:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textComponentProperties=void 0;const o=r(1513);t.textComponentProperties=[{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextAlign",property:"text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start"}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"LineHeight",property:"line-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextOverflow",property:"text-overflow-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_OVERFLOW,list:[o.CLEAN_VALUE_NODE,{name:"Clip",value:"clip"},{name:"Ellipsis",value:"ellipsis"},{name:"None",value:"none"}],defaults:"clip"}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"BaselineOffset",property:"baseline-offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"DecorationType",property:"decoration-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_DECORATION_TYPE,list:[o.CLEAN_VALUE_NODE,{name:"Underline",value:"underline"},{name:"LineThrough",value:"line-through"},{name:"Overline",value:"overline"},{name:"None",value:"none"}],defaults:"none"}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"DecorationColor",property:"decoration-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextCase",property:"text-case-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_CASE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"LowerCase"},{value:"UpperCase"}],defaults:"Normal"}}]},3460:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleProperties=void 0;const o=r(1513);t.toggleProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"toggle-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TOGGLE_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Button"},{value:"Checkbox"},{value:"Switch"}],defaults:"Button"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"IsOn",property:"isOn-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SelectedColor",property:"selectedColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SwitchPointColor",property:"switchPointColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}]},1290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.etsPropertyList=void 0;const o=r(5958),n=r(1513),a=r(5302),i=r(3460),s=r(8271),p=r(3890),l=r(3311),c=r(8124),u=r(8840),y=r(3687),d=r(1492),f=r(1021),m=r(8929),g=r(4090),h=r(128),E=r(1815),T=r(4836),S=r(6181),P=r(4488),v=r(5452),b=r(6686),_=r(8964),N=r(6153),C=r(6486),A=(()=>{const e=C.cloneDeep(o.commonPropertyList),t=new Map([["color-visual",n.Sector.FEATURE_ETS],["value-visual",n.Sector.FEATURE_ETS],["total-visual",n.Sector.FEATURE_ETS],["style-visual",n.Sector.FEATURE_ETS],["font-family-visual",n.Sector.TEXTSTYLES],["max-lines-visual",n.Sector.TEXTSTYLES],["flex-grow-visual",n.Sector.FLEXCHILD],["flex-shrink-visual",n.Sector.FLEXCHILD],["aspect-ratio-visual",n.Sector.LAYOUT],["opacity-visual",n.Sector.EFFECT],["background-color-visual",n.Sector.BACKGROUND]]);return e.forEach((e=>{const r=e.propertySet.property;t.has(r)&&(e.propertySector=t.get(r))})),e})(),O=[{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontSize",property:"font-size-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.fontSizeUnit}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontStyle",property:"font-style-visual",type:n.TypeName.SELECT,etsType:n.EtsType.FONT_STYLE,list:[n.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontColor",property:"font-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontWeight",property:"font-weight-visual",type:n.TypeName.SELECT,etsType:`${n.EtsType.FONT_WEIGHT}|${n.EtsType.NUMBER}`,list:n.fontWeightList,defaults:"400"}}],M=[{propertySector:n.Sector.RENDER,propertySet:{name:"ForEach",property:"for-visual",type:n.TypeName.BASE,etsType:n.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:n.Sector.RENDER,propertySet:{name:"KeyGenerator",property:"keyGenerator-visual",type:n.TypeName.BASE,etsType:"Event",supportStaticProperty:!1,defaults:""}},{propertySector:n.Sector.RENDER,propertySet:{name:"Item",property:"item-visual",type:n.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Item of ForEach Array"}},{propertySector:n.Sector.RENDER,propertySet:{name:"Idx",property:"idx-visual",type:n.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Index of Corresponding Item In ForEach Array"}}],w={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:["vp","px","lpx"],placeholder:"0"},R=[{propertySector:n.Sector.SIZE,propertySet:{name:"Width",property:"width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SIZE,propertySet:{name:"Height",property:"height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SIZE,propertySet:{name:"MinWidth",property:"constraint-size-min-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SIZE,propertySet:{name:"MinHeight",property:"constraint-size-min-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SIZE,propertySet:{name:"MaxWidth",property:"constraint-size-max-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SIZE,propertySet:{name:"MaxHeight",property:"constraint-size-max-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"Margin",property:"margin-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"Padding",property:"padding-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginTop",property:"margin-top-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginRight",property:"margin-right-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginBottom",property:"margin-bottom-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginLeft",property:"margin-left-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingTop",property:"padding-top-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingRight",property:"padding-right-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingBottom",property:"padding-bottom-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingLeft",property:"padding-left-visual"},w)}],I={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength},x={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength},L={type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR},F=[{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomString",property:"custom-string-visual",type:n.TypeName.BASE,etsType:n.EtsType.STRING}},{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomNumber",property:"custom-number-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomBoolean",property:"custom-boolean-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,list:n.booleanListWithClean,defaults:"false"}}],k=[{propertySector:n.Sector.BORDER,propertySet:{name:"Border",property:"border-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-width-visual"},I),Object.assign({name:"Style",property:"border-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-color-visual"},L),Object.assign({name:"Radius",property:"border-radius-visual"},x)]}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderTop",property:"border-top-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-top-width-visual"},I),Object.assign({name:"Style",property:"border-top-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-top-color-visual"},L),Object.assign({name:"TopLeftRadius",property:"border-top-left-radius-visual"},x)],startApi:"9"}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderRight",property:"border-right-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-right-width-visual"},I),Object.assign({name:"Style",property:"border-right-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-right-color-visual"},L),Object.assign({name:"TopRightRadius",property:"border-top-right-radius-visual"},x)],startApi:"9"}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderBottom",property:"border-bottom-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-bottom-width-visual"},I),Object.assign({name:"Style",property:"border-bottom-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-bottom-color-visual"},L),Object.assign({name:"BottomRightRadius",property:"border-bottom-right-radius-visual"},x)],startApi:"9"}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderLeft",property:"border-left-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-left-width-visual"},I),Object.assign({name:"Style",property:"border-left-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-left-color-visual"},L),Object.assign({name:"BottomLeftRadius",property:"border-bottom-left-radius-visual"},x)],startApi:"9"}}],B=[{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageSrc",property:"background-image-src-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_SRC}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageRepeat",property:"background-image-repeat-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_REPERT,list:[n.CLEAN_VALUE_NODE,{name:"X",value:"repeat-x"},{name:"Y",value:"repeat-y"},{name:"XY",value:"repeat"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageSize",property:"background-image-size-visual",type:n.TypeName.DATA_SELECT_INPUT,etsType:`${n.EtsType.IMAGE_SIZE}|${n.EtsType.STRING}`,list:[n.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Auto",value:"auto"}],defaults:"Auto"}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImagePosition",property:"background-image-position-visual",type:n.TypeName.DATA_SELECT_INPUT,etsType:`${n.EtsType.ALIGNMENT}|${n.EtsType.STRING}`,list:[n.CLEAN_VALUE_NODE,{name:"TopStart",value:"top left"},{name:"Top",value:"top center"},{name:"TopEnd",value:"top right"},{name:"Start",value:"center left"},{name:"Center",value:"center center"},{name:"End",value:"center right"},{name:"BottomStart",value:"bottom left"},{name:"Bottom",value:"bottom center"},{name:"BottomEnd",value:"bottom right"}],defaults:"0 0"}}],D=[{propertySector:n.Sector.LAYOUT,propertySet:{name:"Location",property:"position-visual",type:n.TypeName.SELECT,defaults:"offset",supportDynamicProperty:!1,list:[n.CLEAN_VALUE_NODE,{name:"offset",value:"relative"},{name:"position",value:"absolute"}]}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"X",property:"left-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"Y",property:"top-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}}],U=[{propertySector:n.Sector.LAYOUT,propertySet:{name:"DisplayPriority",property:"display-priority-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.EFFECT,propertySet:{name:"Visibility",property:"visibility-visual",type:n.TypeName.SELECT,etsType:n.EtsType.VISIBILITY,defaults:"visible",list:[n.CLEAN_VALUE_NODE,{name:"Visible",value:"visible"},{name:"Hidden",value:"hidden"},{name:"None",value:"none"}]}},{propertySector:n.Sector.EFFECT,propertySet:{name:"Enabled",property:"enabled-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"true",list:[{value:"true"},{value:"false"}]}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"Align",property:"align-visual",type:n.TypeName.SELECT,etsType:n.EtsType.ALIGNMENT,defaults:"center",list:n.alignProperties}},{propertySector:n.Sector.RENDER,propertySet:{name:"If",property:"if-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Space",property:"space-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_LENGTH,units:["vp","px","lpx"],requires:{"display-visual":["flex","cleanValue"]},info:"Space between any two adjacent child components."}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-row-visual",type:n.TypeName.SELECT,etsType:n.EtsType.VERTICAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[n.CLEAN_VALUE_NODE,{value:"flex-start",name:"top",etsEnumValue:"Top"},{value:"flex-end",name:"bottom",etsEnumValue:"Bottom"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the vertical direction."}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-column-visual",type:n.TypeName.SELECT,etsType:n.EtsType.HORIZONTAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[n.CLEAN_VALUE_NODE,{value:"flex-start",name:"start",etsEnumValue:"Start"},{value:"flex-end",name:"end",etsEnumValue:"End"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the horizontal direction."}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Src",property:"src-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_SRC}},{propertySector:n.Sector.MORE,propertySet:{name:"Alt",property:"alt-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_CONTENT}},{propertySector:n.Sector.MORE,propertySet:{name:"RenderMode",property:"render-mode-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_RENDER_MODE,defaults:"original",list:[n.CLEAN_VALUE_NODE,{name:"Original",value:"original"},{name:"Template",value:"template"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"ObjectRepeat",property:"object-repeat-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_REPERT,defaults:"no-repeat",list:[n.CLEAN_VALUE_NODE,{name:"X",value:"X"},{name:"Y",value:"Y"},{name:"XY",value:"XY"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"ObjectFit",property:"object-fit-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_FIT,defaults:"cover",list:[n.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Fill",value:"fill"},{name:"None",value:"none"},{name:"ScaleDown",value:"scale-down"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"InterPolation",property:"interpolation-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_INTERPOLATION,defaults:"none",list:[n.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"High",value:"high"},{name:"Medium",value:"medium"},{name:"Low",value:"low"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"SourceSizeWidth",property:"source-size-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,units:["px"]}},{propertySector:n.Sector.MORE,propertySet:{name:"SourceSizeHeight",property:"source-size-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,units:["px"]}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"type-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BUTTON_TYPE,defaults:"capsule",list:[{name:"Normal",value:"normal"},{name:"Capsule",value:"capsule"},{name:"Circle",value:"circle"}]}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"StateEffect",property:"state-effect-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"true",list:n.booleanList}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Content",property:"content-visual",type:n.TypeName.ADJUSTABLE,etsType:n.EtsType.COMB_CONTENT}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Label",property:"label-visual",type:n.TypeName.ADJUSTABLE,etsType:n.EtsType.COMB_CONTENT}}];t.etsPropertyList=[...F,...k,...R,...O,...M,...i.toggleProperties,..._.checkboxProperties,..._.checkboxGroupProperties,...s.textComponentProperties,...p.textInputProperties,...l.dividerProperties,...D,...c.listProperties,...u.listItemProperties,...y.flexProperties,...d.swiperProperties,...a.refreshProperties,...f.selectProperties,...m.sliderProperties,...A,...B,...g.pickerProperties,...h.searchProperties,...P.scrollProperties,...v.navigationProperties,...b.tabsProperties,...N.tabContentProperties,...U,...E.stackProperties,...T.gridItemProperties,...S.gridProperties]},5958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonPropertyList=void 0;const o=r(1513);t.commonPropertyList=[{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundColor",property:"background-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Display",property:"display-visual",type:o.TypeName.SELECT,defaults:"flex",list:[o.CLEAN_VALUE_NODE,{value:"flex"},{value:"none"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Opacity",property:"opacity-visual",type:o.TypeName.SLIDER,etsType:o.EtsType.COMB_R_NUMBER,defaults:"1",step:.01,max:1,min:0}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Overflow",property:"overflow-visual",type:o.TypeName.SELECT,defaults:"visible",list:[o.CLEAN_VALUE_NODE,{value:"visible"},{value:"hidden"},{value:"scroll"}]}},{propertySector:o.Sector.FLEX,propertySet:{name:"FlexGrow",property:"flex-grow-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:"0",requiresParent:{display:["flex","cleanValue"]},info:"The flex grow factor of a flex item's main size"}},{propertySector:o.Sector.FLEX,propertySet:{name:"FlexShrink",property:"flex-shrink-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:"1",requiresParent:{display:["flex","cleanValue"]},info:"The flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items will shrink"}},{propertySector:o.Sector.FLEX,propertySet:{name:"Columns",property:"columns-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:1,info:"The column number of flex."}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Header Logo",property:"headerLogo-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Title",property:"title-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Status",property:"status-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Logo",property:"logo-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Color",property:"color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontFamily",property:"font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:"sans-serif"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"MaxLines",property:"max-lines-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextColor",property:"text-color-visual",type:o.TypeName.COLOR,defaults:"rgba(0,0,0,0.9)"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FocusColor",property:"focus-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DisappearColor",property:"disappear-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorColor",property:"indicator-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorSelectedColor",property:"indicator-selected-color-visual",type:o.TypeName.COLOR,defaults:"#ff007dff"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorSize",property:"indicator-size-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorTop",property:"indicator-top-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorRight",property:"indicator-right-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorBottom",property:"indicator-bottom-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorLeft",property:"indicator-left-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:{name:"AllowScale",property:"allow-scale-visual",type:o.TypeName.SELECT,defaults:"true",list:[o.CLEAN_VALUE_NODE,{value:"true"},{value:"false"}]}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowStart",property:"grid-row-start-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its row in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnStart",property:"grid-column-start-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its column in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowEnd",property:"grid-row-end-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its row in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnEnd",property:"grid-column-end-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its column in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridTemplateRows",property:"grid-template-rows-visual",type:o.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid rows."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridTemplateColumns",property:"grid-template-columns-visual",type:o.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid columns."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowsGap",property:"grid-rows-gap-visual",type:o.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's grid rows."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnsGap",property:"grid-columns-gap-visual",type:o.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's columns."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridGap",property:"grid-gap-visual",type:o.TypeName.INTEGER,units:["px"],requires:{"display-visual":["grid"]},info:"The gaps between rows and columns. It is a shorthand for row-gap and column-gap."}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"MatchTextDirection",property:"match-text-direction-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"FitOriginalSize",property:"fit-original-size-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"IconWidth",property:"icon-width-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IconHeight",property:"icon-height-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextonColor",property:"texton-color-visual",type:o.TypeName.COLOR,defaults:"#000000"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextoffColor",property:"textoff-color-visual",type:o.TypeName.COLOR,defaults:"#000000"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextPadding",property:"text-padding-visual",type:o.TypeName.INTEGER,defaults:0,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedColor",property:"selected-color-visual",type:o.TypeName.COLOR,defaults:"rgba(0,125,255,1)"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"BlockColor",property:"block-color-visual",type:o.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Radius",property:"radius-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StartAngle",property:"start-angle-visual",type:o.TypeName.INTEGER,defaults:240}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TotalAngle",property:"total-angle-visual",type:o.TypeName.INTEGER,defaults:240}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CenterX",property:"center-x-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CenterY",property:"center-y-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Colors",property:"colors-visual",type:o.TypeName.BASE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Weights",property:"weights-visual",type:o.TypeName.BASE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceHolderColor",property:"placeholder-color-visual",type:o.TypeName.COLOR,defaults:"gray"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ProgressColor",property:"progress-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR,defaults:"black"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ItemExtent",property:"item-extent-visual",type:o.TypeName.INTEGER,units:["px","%"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FadeColor",property:"fade-color-visual",type:o.TypeName.COLOR,defaults:"grey"}},{propertySector:o.Sector.FLEX,propertySet:{name:"ColumnSpan",property:"column-span-visual",type:o.TypeName.INTEGER,defaults:1,min:1,info:"The number of span."}},{propertySector:o.Sector.ATOMIC,propertySet:{name:"FlexWeight",property:"flex-weight-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.ATOMIC,propertySet:{name:"AspectRatio",property:"aspect-ratio-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SecondaryColor",property:"secondary-color-visual",type:o.TypeName.COLOR,requires:{type:["horizontal","ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ScaleWidth",property:"scale-width-visual",type:o.TypeName.INTEGER,requires:{type:["ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ScaleNumber",property:"scale-number-visual",type:o.TypeName.INTEGER,defaults:120,requires:{type:["ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Value",property:"value-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:0}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Total",property:"total-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:100}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Style",property:"style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.PROGRESS_STYLE,defaults:"Linear",list:[{value:"Linear"}]}}]},1513:(e,t)=>{"use strict";var r,o,n,a,i,s,p;Object.defineProperty(t,"__esModule",{value:!0}),t.alignProperties=t.booleanListWithClean=t.booleanList=t.fontWeightList=t.fontSizeUnit=t.etsLength=t.commonFontWeight=t.commonParamsForBorderRadius=t.commonParamsForIndicator=t.commonParamsForInteger=t.commonParamsForJudge=t.commonParamsForBorder=t.CLEAN_VALUE_NODE=t.EtsSpecialType=t.EtsCombinationType=t.EtsBasicType=t.EtsEnumType=t.EtsType=t.TypeName=t.Sector=void 0,function(e){e.GENERAL="general",e.DIMENSION="dimension",e.FEATURE="feature",e.FEATURE_ETS="feature_ets",e.SIZE="size",e.SPACING="spacing",e.BORDER="border",e.BACKGROUND="background",e.LAYOUT="layout",e.RENDER="render",e.FLEX="flex",e.FLEXCHILD="flexchild",e.GRID="grid",e.ATOMIC="atomic",e.CUSTOM="custom",e.TEXT="text",e.TEXTSTYLES="textstyles",e.SELECT="select",e.OPTION="option",e.EFFECT="effect",e.MORE="more"}(r||(r={})),t.Sector=r,function(e){e.BASE="base",e.INTEGER="integer",e.SELECT="select",e.COLOR="color",e.COMPOSITE="composite",e.SLIDER="slider",e.DATA_SELECT_INPUT="dataSelectInput",e.ADJUSTABLE="adjustable"}(o||(o={})),t.TypeName=o,function(e){e.ARRAY="ETSArray",e.BOOLEAN="boolean",e.DATE="Date",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(n||(n={})),t.EtsBasicType=n,function(e){e.R_FLOAT="Rfloat",e.R_STRING="Rstring",e.R_COLOR="Rcolor",e.R_PLURAL="Rplural",e.R_MEDIA="Rmedia",e.R_RAWFILE="Rrawfile"}(a||(a={})),function(e){e.ALIGNMENT="Alignment",e.AXIS="Axis",e.BORDER_STYLE="BorderStyle",e.BUTTON_TYPE="ButtonType",e.COLOR="Color",e.DIRECTION="Direction",e.EDGE_EFFECT="EdgeEffect",e.ENTER_KEY_TYPE="EnterKeyType",e.NAVIGATION_TITLEMODE="NavigationTitleMode",e.FLEX_ALIGN="FlexAlign",e.FLEX_DIRECTION="FlexDirection",e.FLEX_WRAP="FlexWrap",e.FONT_STYLE="FontStyle",e.FONT_WEIGHT="FontWeight",e.HORIZONTAL_ALIGN="HorizontalAlign",e.IMAGE_FIT="ImageFit",e.IMAGE_INTERPOLATION="ImageInterpolation",e.IMAGE_RENDER_MODE="ImageRenderMode",e.IMAGE_REPERT="ImageRepeat",e.IMAGE_SIZE="ImageSize",e.INPUT_TYPE="InputType",e.ITEM_ALIGN="ItemAlign",e.LINE_CAP_STYLE="LineCapStyle",e.PROGRESS_STYLE="ProgressStyle",e.STICKY="Sticky",e.TEXT_ALIGN="TextAlign",e.TEXT_OVERFLOW="TextOverflow",e.TEXT_DECORATION_TYPE="TextDecorationType",e.TEXT_CASE="TextCase",e.TOGGLE_TYPE="ToggleType",e.VERTICAL_ALIGN="VerticalAlign",e.VISIBILITY="Visibility",e.COPY_OPTION="CopyOption",e.BAR_STATE="BarState",e.GRID_DIRECTION="GridDirection",e.SCROLL_DIRECTION="ScrollDirection",e.BAR_POSITION="BarPosition",e.BAR_MODE="BarMode"}(i||(i={})),t.EtsEnumType=i,function(e){e.COMB_COLOR="string|number|Color|Rcolor",e.COMB_LENGTH="string|number",e.COMB_R_NUMBER="number|Rfloat",e.COMB_R_LENGTH="string|number|Rfloat",e.COMB_CONTENT="string|Rstring|Rplural",e.COMB_SRC="string|Rmedia|Rrawfile",e.NON_R_COLOR="string|number|Color"}(s||(s={})),t.EtsCombinationType=s,function(e){e.SCROLLER="Scroller",e.TABS_CONTROLLER="TabsController",e.SEARCH_CONTROLLER="SearchController"}(p||(p={})),t.EtsSpecialType=p;const l=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),a),i),s),p);t.EtsType=l;const c={value:"cleanValue",name:"---Clean Value---"};t.CLEAN_VALUE_NODE=c;const u={type:o.SELECT,etsType:l.BORDER_STYLE,list:[c,{value:"dotted",etsEnumValue:"Dotted"},{value:"dashed",etsEnumValue:"Dashed"},{value:"solid",etsEnumValue:"Solid"}]};t.commonParamsForBorder=u;const y={type:o.SELECT,etsType:l.BOOLEAN,defaults:"false",list:[c,{value:"true"},{value:"false"}]};t.commonParamsForJudge=y;const d={type:o.INTEGER,units:["px"],placeholder:"0px"};t.commonParamsForInteger=d;const f={type:o.INTEGER,units:["px","%"]};t.commonParamsForIndicator=f;const m={type:o.INTEGER,units:["px"]};t.commonParamsForBorderRadius=m;const g=[{value:"100"},{value:"200"},{value:"300"},{value:"400"},{value:"500"},{value:"600"},{value:"700"},{value:"800"},{value:"900"}];t.commonFontWeight=g,t.etsLength=["vp","px","%","lpx"],t.fontSizeUnit=["fp","px","lpx"];const h=[c,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...g];t.fontWeightList=h;const E=[{name:"true",value:"true"},{name:"false",value:"false"}];t.booleanList=E;const T=[c,...E];t.booleanListWithClean=T;const S=[c,{name:"TopStart",value:"top-start"},{name:"Top",value:"top"},{name:"TopEnd",value:"top-end"},{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"},{name:"BottomStart",value:"bottom-start"},{name:"Bottom",value:"bottom"},{name:"BottomEnd",value:"bottom-end"}];t.alignProperties=S},9282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TagTypeMap=void 0,t.TagTypeMap=new Map([["button","TextContent"],["span","TextContent"],["divider","TextContent"],["picker","TextContent"],["option","TextContent"],["clock","TextContent"],["image","Base"],["input","Base"],["chart","Base"],["slider","Base"],["progress","Base"],["text","Text"],["div","Container"],["list","Container"],["list-item","Container"],["list-item-group","Container"],["refresh","Container"],["dialog","Container"],["stack","Container"],["menu","Container"],["select","Container"],["tabs","Container"],["tab-bar","Container"],["tab-content","Container"],["scroll","Container"],["navigation","Container"]])},4294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.beforeCodegen=t.getCustomCompRelativePath=t.getRelativePath=t.prepareCustomCompTagName=t.capitalize=t.getTagName=t.strToBase64=t.getUniqueName=t.getUniqueId=t.removeFromArray=t.getDataName=void 0;const o=r(2891);function n(e){let t=a(e).replace(/[/=+]/g,"");const r=t.length;return r>=4&&(t=t.substring(r/2-2,r/2+2)),t}function a(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");let r="";for(let t=0;t{const t=r.indexOf(e);-1!==t&&r.splice(t,1)})),r},t.getUniqueId=n,t.getUniqueName=function(e){return`${e}_${n(e)}`},t.strToBase64=a;const i=new Map,s=new Map;function p(e){return e[0].toUpperCase()+e.slice(1)}function l(e){const t=(0,o.getInstance)().document.path;if(0===e.size)return;const r=p(t.substring(t.lastIndexOf("/")+1));e.forEach(((e,o)=>{const n=e.length,a=[...e];o===r&&a.push(t);const l=function(e){e.sort();const t=e[0],r=e[e.length-1];let o=0;for(let e=0;e1||o===r)&&(u=p(e[a].substring(l+1).split("/").join("_"))),s.set(e[a],u);const y="/node_modules/";let d=c(e[a],t);e[a].startsWith(y)&&(d=e[a].replace(y,"@"),d=d.replace("src/main/supervisual","src/main/ets")),i.set(u,d)}}))}function c(e,t){const r=e.split("/"),o=t.split("/");let n=0;for(let e=0;e1){const o=p(r[r.length-1]),n=t.get(o);void 0===n?t.set(o,[e.type]):n.push(e.type)}const o=e.children;for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formManager=void 0;const o=r(2891),n=r(5945);t.formManager={removeData(e){this.getFormModel().data.delete(e)},addData(e){e instanceof Map?e.forEach(((e,t)=>{this.getFormModel().data.set(t,e)})):Object.keys(e).forEach((t=>{this.getFormModel().data.set(t,e[t])}))},updateAllData(e){this.getFormModel().data.clear(),this.addData(e)},addAction(e,t,r,o,a){const i=new Map;void 0!==r&&Object.keys(r).forEach((e=>{i.set(e,r[e])}));const s=new Map;void 0!==o&&Object.keys(o).forEach((e=>{s.set(e,o[e])})),this.getFormModel().actions.set(e,new n.FormAction(t,i,s,a))},updateAllActions(e){this.getFormModel().actions.clear(),e.forEach(((e,t)=>{const r=void 0===e.params?e.params:this.objectToMap(e.params),o=void 0===e.want?e.want:this.objectToMap(e.want),a=new n.FormAction(e.actionType,r,o);this.getFormModel().actions.set(t,a)}))},removeAction(e){this.getFormModel().actions.delete(e)},addActionParams(e,t){var r,o;const a=null!==(r=this.getFormModel().actions.get(e))&&void 0!==r?r:new n.FormAction(e),i=null!==(o=a.params)&&void 0!==o?o:new Map;Object.keys(t).forEach((e=>{i.set(e,t[e])})),a.params=i},removeActionParam(e,t){var r;const o=this.getFormModel().actions.get(e);null===(r=null==o?void 0:o.params)||void 0===r||r.delete(t)},getFormModel:()=>(0,o.getInstance)().formData,codegenToJson:function(){const e=(0,o.getInstance)().formData,t=this.mapToObject(e.data),r={actions:{},data:{}};return r.data=t,e.actions.forEach(((e,t)=>{r.actions[t]={},r.actions[t].action=e.action,e.params instanceof Map&&e.params.size>0&&(r.actions[t].params=this.mapToObject(e.params)),e.want instanceof Map&&e.want.size>0&&(r.actions[t].abilityName=e.abilityName,r.actions[t].want=this.mapToObject(e.want))})),JSON.stringify(r,null,4)},clear(){(0,o.getInstance)().formData.data.clear(),(0,o.getInstance)().formData.actions.clear()},mapToObject:e=>void 0===e?{}:Array.from(e.entries()).reduce(((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r})),{}),objectToMap(e){const t=new Map;return Object.keys(e).forEach(((r,o)=>{t.set(r,e[r])})),t}}},5945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormAction=t.FormModel=void 0,t.FormModel=class{constructor(){this.data=new Map,this.actions=new Map}},t.FormAction=class{constructor(e,t,r,o){this.action=e,this.abilityName=o,this.want=r,this.params=t}}},1509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeForVersion1=t.rootToVisualContent=t.visualToRootContent=t.serializeForVersion1=void 0;const o=r(2891),n=r(1933),a=r(7571),i=r(9282),s=r(5945),p=r(7977),l=new Map;function c(e){l.set("textMap",new Map);const t=u(null!=e?e:(0,o.getInstance)().visualModel);return JSON.stringify({VisualVersion:"1",content:JSON.stringify(t),extraData:JSON.stringify(f(l))})}function u(e){const t=Array.from(e.property).filter((t=>(0,a.isAttribute)(t[0],e.type)));t.push(["id",e.id]);const r=Array.from(e.property).filter((t=>(0,a.isStyle)(t[0],e.type)));let o=i.TagTypeMap.get(e.type);void 0===o&&(o="Base");let n=e.property.has("content")?e.property.get("content"):[];if(e.children.length>0){if("string"==typeof n){const t=l.get("textMap");t instanceof Map&&t.set(e.id,n)}n=e.children.map((e=>u(e)))}return{id:e.id,tagName:e.type,attributes:t,idStyle:r,type:o,content:n}}function y(e,t){let r;if(t instanceof Map){const o=t.get("textMap");o instanceof Map&&(r=o.get(e.id))}const o=new n.VisualModel({id:e.id,type:e.tagName,property:new Map([...e.attributes,...e.idStyle])});return"string"==typeof r&&o.property.set("content",r),o.property.delete("id"),"string"==typeof e.content&&o.property.set("content",e.content),Array.isArray(e.content)&&(o.children=e.content.map((e=>y(e,t)))),o}function d(e){if(e instanceof Array&&e.length>0&&"$$map"===e[0]){e.shift();const t=new Map;for(const[r,o]of e)t.set(r,d(o));return t}return e}function f(e){if(e instanceof Map){const t=["$$map"];for(const[r,o]of e)t.push([r,f(o)]);return t}return e}t.serializeForVersion1=c,t.visualToRootContent=function(e){try{return c(JSON.parse(e,p.reviver).visualModel)}catch(e){console.error("convert visual model to root model failed")}return e},t.rootToVisualContent=function(e){const t=JSON.parse(e),r=JSON.parse(t.content);let o='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(o=JSON.parse(t.extraData));const n=y(r,d(o));return n.property.has("flex-direction")||n.property.set("flex-direction","column"),JSON.stringify({document:{VisualVersion:"12",type:"FA"},visualModel:n,formData:new s.FormModel},p.replacer)},t.deserializeForVersion1=function(e){try{const t=JSON.parse(e),r=JSON.parse(t.content);let n='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(n=JSON.parse(t.extraData)),(0,o.getInstance)().visualModel=y(r,d(n)),(0,o.getInstance)().visualModel.property.has("flex-direction")||(0,o.getInstance)().visualModel.property.set("flex-direction","column")}catch(e){console.error("convert error")}}},2891:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setInstance=t.getInstance=t.setVisualPath=t.clearCustomInstance=t.setCustomInstance=t.getInstanceTemplate=t.getCustomInstance=void 0;const o=r(1933),n=r(5945),a=r(904),i={document:{VisualVersion:"12",type:"FA",custom:!1,path:""},visualModel:new o.VisualModel({type:"div",id:"wrapper"}),formData:new n.FormModel},s=new Map;t.getCustomInstance=function(){return s},t.getInstanceTemplate=function(e){return{document:{VisualVersion:"12",type:"ETS",custom:e,path:"&path"},visualModel:new o.VisualModel({type:"column",id:"wrapper"}),imgData:""}},t.setCustomInstance=function(e,t){var r;const n={path:"",document:{VisualVersion:"",type:"",custom:!0},visualModel:new o.VisualModel({type:"",id:""}),methods:[],property:[],imgData:"",originType:[]};n.path=e;for(const e in n)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);n.visualModel=null!==(r=n.visualModel.children[0])&&void 0!==r?r:new o.VisualModel({type:"text"}),s.set(e,n)},t.clearCustomInstance=function(){s.clear()},t.setVisualPath=function(e){i.document.path=e},t.getInstance=function(){return i},t.setInstance=function(e){var t,r,o,n;for(const t in i)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);const s=i.document.type;void 0===i.document.custom&&(i.document.custom=!1),null!==((null!==(r=(null===(t=e.customData)||void 0===t?void 0:t.property.size)>0)&&void 0!==r?r:null)||(null!==(n=(null===(o=e.customData)||void 0===o?void 0:o.event.size)>0)&&void 0!==n?n:null))&&(i.customData=e.customData),(0,a.setDomain)("ETS"===s?a.Domain.ETS:"FORM"===s?a.Domain.FORM:a.Domain.FA)}},7977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviver=t.replacer=t.serializeSketchPage=t.serializeCustom=t.deserializeCustom=t.deserialize=t.serialize=void 0;const o=r(1933),n=r(2891),a=r(1509);function i(e,t){if(t instanceof Map)return{dataType:"Map",value:Object.fromEntries(t.entries())};if(t instanceof Set)return{dataType:"Set",value:Array.from(t.entries())};if(t instanceof o.VisualModel){const e=new o.VisualModel({type:"none"}),r={};for(const o in e)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return{dataType:"VisualModel",value:r}}return t}function s(e,t){if("object"==typeof t&&null!=t){if("Map"===t.dataType)return new Map(Object.entries(t.value));if("Set"===t.dataType)return new Set(t.value);if("VisualModel"===t.dataType){const e=new o.VisualModel({type:""});Object.assign(e,t.value),t=e}}return t}t.serialize=function(e,t){return 1===e?(0,a.serializeForVersion1)(t):JSON.stringify(null!=t?t:(0,n.getInstance)(),i,4)},t.deserialize=function(e){if("1"===JSON.parse(e).VisualVersion)return(0,a.deserializeForVersion1)(e);const t=JSON.parse(e,s);(0,n.setInstance)(t)},t.deserializeCustom=function(e,t){const r=JSON.parse(t,s);(0,n.setCustomInstance)(e,r)},t.serializeCustom=function(e){const t=(0,n.getInstanceTemplate)(!0);return t.visualModel.property=new Map([["width","100%"],["height","100%"]]),t.visualModel.children.push(e),JSON.stringify(t,i,4)},t.serializeSketchPage=function(e){const t=(0,n.getInstanceTemplate)(!1);return t.visualModel=e,JSON.stringify(t,i,4)},t.replacer=i,t.reviver=s},1933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VisualModel=void 0;const r="-visual";t.VisualModel=class{constructor(e){if(this.propertyStorage=void 0,this.dynamicPropertyStorage=void 0,this.mediaProperty=void 0,this.dynamicMediaProperty=void 0,this.mediaPropertyStorage=void 0,this.dynamicMediaPropertyStorage=void 0,this.slots=void 0,this.property=void 0!==e.property?e.property:new Map,this.dynamicProperty=void 0!==e.dynamicProperty?e.dynamicProperty:new Map,this.children=void 0!==e.children?e.children:[],"wrapper"===e.type)return this.id="wrapper",void(this.type="div");e.type.endsWith(r)&&(e.type=e.type.substring(0,e.type.length-r.length)),this.id=void 0!==e.id?e.id:"",this.type=e.type,this.slots=e.slots}getProperty(e){const t=this.dynamicProperty.get(e);return void 0!==t&&""!==t?t:this.property.get(e)}hasMediaProperty(e){if(void 0!==this.mediaProperty)for(const[,t]of this.mediaProperty)if(null==t?void 0:t.has(e))return!0;if(void 0!==this.dynamicMediaProperty)for(const[,t]of this.dynamicMediaProperty)if(null==t?void 0:t.has(e))return!0;return!1}hasProperty(e){return this.dynamicProperty.has(e)||this.property.has(e)}getChildren(){var e;const t=[...this.children];for(const[,r]of null!==(e=this.slots)&&void 0!==e?e:new Map)t.push(r);return t}accept(e){return e.visit(this)}}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={id:o,loaded:!1,exports:{}};return e[o].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var o={};(()=>{"use strict";var e=o;Object.defineProperty(e,"__esModule",{value:!0});const t=r(3784),n=r(2891),a=r(7977),i=r(8844),s=r(1055),p=r(3207),l=r(8413),c=r(4435),u=r(6486),y=r(4294),d={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""};function f(e,r){var o;try{(0,a.deserialize)(e);const t=(0,n.getInstance)().document.VisualVersion,o=/^([1-9]+[0-9]*)$/;if(void 0===t)r.errorType="versionError";else{const e=t.match(o);(null===e||parseInt(e[1])>12)&&(r.errorType="versionError")}}catch(e){r.errorType="fileError"}""!==r.errorType&&(r.errorMessage=null!==(o=t.errorMap.get(r.errorType))&&void 0!==o?o:"Codegen visual file failed")}e.genHmlAndCss=function(e){const r={hmlCss:{hml:"",css:"",json:""},errorType:"",errorMessage:""};if(f(e,r),""!==r.errorType)return r.hmlCss.hml="",r.hmlCss.css="",r;try{const e=function(e){const t={hml:"",css:"",json:""},r=new i.HMLBridge,o=e.accept(r),n=(0,s.genFAHML)(o);t.hml=r.getErrorCount()>0?"error":n;const a=new i.CSSBridge,p=e.accept(a),l=(0,s.genFACSS)(p);return t.css=a.getErrorCount()>0?"error":l,t}((0,n.getInstance)().visualModel);"error"!==e.hml&&"error"!==e.css||(r.errorType="codegenError"),r.hmlCss=e,"FORM"===(0,n.getInstance)().document.type&&(r.hmlCss.json=p.formManager.codegenToJson())}catch(e){r.errorType="modelError"}return""!==r.errorType&&(r.errorMessage=t.errorMap.get(r.errorType),r.hmlCss.hml="",r.hmlCss.css=""),r},e.genETS=function(e){var r;const o={ets:(0,u.cloneDeep)(d),errorType:"",errorMessage:""};if(f(e,o),""!==o.errorType)return o.ets=(0,u.cloneDeep)(d),o;try{let e=(0,n.getInstance)().visualModel;if((0,n.getInstance)().document.custom&&(e=e.children[0],void 0===e))return o;(0,y.beforeCodegen)(e);const t=function(e){const t=new l.ETSBridge,r=e.accept(t),o=(new c.StringWriter).genETS(r);return t.getErrorCount()>0?"error":o}(e);"error"===t&&(o.errorType="codegenError"),o.ets=t}catch(e){o.errorType="modelError"}return""!==o.errorType&&(o.errorMessage=null!==(r=t.errorMap.get(o.errorType))&&void 0!==r?r:"Codegen visual file failed",o.ets=(0,u.cloneDeep)(d)),o}})();var n=exports;for(var a in o)n[a]=o[a];o.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})(); -- Gitee From dc2db3d613e8905ddf38aa2b0594c321956d5e7a Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Thu, 8 Dec 2022 15:06:55 +0800 Subject: [PATCH 245/379] Modify ark compiler exectue mode of ts2abc Issue: I65HT5 Signed-off-by: zhangrengao Change-Id: I4b98b9391acc466dcefff88f2fef4a2859945b89 --- compiler/src/gen_abc_plugin.ts | 228 +++++++++++---------------------- compiler/src/gen_module_abc.ts | 6 +- compiler/src/manage_workers.ts | 83 ++++++++++++ compiler/src/pre_define.ts | 5 + 4 files changed, 162 insertions(+), 160 deletions(-) create mode 100644 compiler/src/manage_workers.ts diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 3fce51e..d394b9a 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -70,7 +70,9 @@ import { PROTO_FILESINFO_TXT, NPMENTRIES_TXT, EXTNAME_PROTO_BIN, - FILESINFO_TXT + FILESINFO_TXT, + MANAGE_WORKERS_SCRIPT, + MAX_WORKER_NUMBER } from './pre_define'; import { getOhmUrlByFilepath @@ -80,8 +82,6 @@ import { generateNpmEntriesInfo } from './gen_merged_abc'; -const genAbcScript: string = 'gen_abc.js'; -const genModuleAbcScript: string = 'gen_module_abc.js'; let output: string; let isWin: boolean = false; let isMac: boolean = false; @@ -89,8 +89,6 @@ let isDebug: boolean = false; let arkDir: string; let nodeJs: string; -let previewCount: number = 0; -let compileCount: number = 0; interface File { path: string, size: number, @@ -206,7 +204,6 @@ export class GenAbcPlugin { return; } buildPathInfo = output; - previewCount++; compilation.hooks.finishModules.tap('finishModules', handleFinishModules.bind(this)); }); @@ -246,12 +243,7 @@ export class GenAbcPlugin { } buildPathInfo = output; if (isTs2Abc() || process.env.minPlatformVersion === "8") { - if (previewCount == compileCount) { - previewCount++; - invokeWorkersToGenAbc(); - } else { - previewCount++; - } + invokeWorkersToGenAbc(); } else if (isEs2Abc()){ generateAbcByEs2AbcOfBundleMode(intermediateJsBundle); } else { @@ -499,7 +491,6 @@ function handleFullModuleFiles(modules, callback): any { clearGlobalInfo(); } else { invokeWorkersModuleToGenAbc(moduleInfos); - processEntryToGenAbc(entryInfos); } } @@ -686,89 +677,49 @@ function invokeClusterModuleToAbc(): void { filterIntermediateModuleByHashJson(buildPathInfo, moduleInfos); const abcArgs: string[] = initAbcEnv(); - const clusterNewApiVersion: number = 16; - const useNewApi: boolean = compareNodeVersion(clusterNewApiVersion); + const splitedModules: any[] = splitModulesByNumber(filterModuleInfos, MAX_WORKER_NUMBER); + let cmdPrefix: string = `${nodeJs} ${abcArgs.join(' ')}`; + const workerNumber: number = MAX_WORKER_NUMBER < splitedModules.length ? MAX_WORKER_NUMBER : splitedModules.length; - if (useNewApi && cluster.isPrimary || !useNewApi && cluster.isMaster) { - if (useNewApi) { - cluster.setupPrimary({ - exec: path.resolve(__dirname, genModuleAbcScript) - }); - } else { - cluster.setupMaster({ - exec: path.resolve(__dirname, genModuleAbcScript) - }); - } - - let workerNumber: number = invokeClusterByModule(abcArgs, filterModuleInfos); + let envParams: any = { + 'splitedData': JSON.stringify(splitedModules), + 'cmdPrefix': cmdPrefix, + 'workerNumber': workerNumber.toString(), + 'cachePath': process.env.cachePath, + 'mode': ESMODULE + }; + let genAbcCmd: string = `${nodeJs} ${path.resolve(__dirname, MANAGE_WORKERS_SCRIPT)}`; - let count_ = 0; + try { if (process.env.watchMode === 'true') { - cluster.removeAllListeners("exit"); - } - cluster.on('exit', (worker, code, signal) => { - if (code === FAIL || process.exitCode === FAIL) { - process.exitCode = FAIL; - } - count_++; - if (count_ === workerNumber) { - if (process.env.watchMode === 'true' && compileCount < previewCount) { - compileCount++; - processExtraAsset(); - if (process.exitCode === SUCCESS) { - console.info(blue, 'COMPILE RESULT:SUCCESS ', reset); - } else { - console.info(blue, 'COMPILE RESULT:FAIL ', reset); - } - if (compileCount >= previewCount) { - return; - } - invokeWorkersModuleToGenAbc(moduleInfos); - processEntryToGenAbc(entryInfos); - } - } - logger.debug(`worker ${worker.process.pid} finished`); - }); - - process.on('exit', (code) => { - // for build options + childProcess.execSync(genAbcCmd, {env: envParams}); processExtraAsset(); - }); + } else { + const child = childProcess.exec(genAbcCmd, {env: envParams}); + child.on('exit', (code: any) => { + if (code === 1) { + logger.debug(red, "ArkTS:ERROR failed to execute ts2abc", reset); + process.exit(FAIL); + } + processExtraAsset(); + }); - // for preview of without incre compile - if (workerNumber === 0 && process.env.watchMode === 'true') { - processExtraAsset(); - } - } -} + child.on('error', (err: any) => { + logger.debug(red, err.toString(), reset); + process.exit(FAIL); + }); -function invokeClusterByModule(abcArgs:string[], moduleInfos: Array, isModule: Boolean = false) { - moduleInfos = Array.from(new Set(moduleInfos)); - let workerNumber: number = 0; - if (moduleInfos.length > 0) { - let cmdPrefix: any = ""; - const tempAbcArgs: string[] = abcArgs.slice(0); - if (process.env.panda === TS2ABC) { - workerNumber = 3; - cmdPrefix = `${nodeJs} ${tempAbcArgs.join(' ')}`; - } else { - logger.error(red, `ArkTS:ERROR please set panda module`, reset); + child.stderr.on('data', (data: any) => { + logger.error(red, data.toString(), reset); + }); } - const splitedModules: any[] = splitModulesByNumber(moduleInfos, workerNumber); - workerNumber = splitedModules.length; - for (let i = 0; i < workerNumber; i++) { - let sn: number = i + 1; - let workerFileName: string = `filesInfo_${sn}.txt`; - const workerData: any = { - 'inputs': JSON.stringify(splitedModules[i]), - 'cmd': cmdPrefix, - 'workerFileName': workerFileName - }; - cluster.fork(workerData); + } catch (e) { + logger.debug(red, `ArkTS:ERROR failed to generate abc. Error message: ${e}`, reset); + process.env.abcCompileSuccess = 'false'; + if (process.env.watchMode !== 'true') { + process.exit(FAIL); } } - - return workerNumber; } function splitModulesByNumber(moduleInfos: Array, workerNumber: number): any[] { @@ -797,90 +748,54 @@ function invokeWorkersToGenAbc(): void { process.exitCode = SUCCESS; } let cmdPrefix: string = ''; - let maxWorkerNumber: number = 3; const abcArgs: string[] = initAbcEnv(); if (process.env.panda === TS2ABC) { cmdPrefix = `${nodeJs} ${abcArgs.join(' ')}`; - } else if (process.env.panda === ES2ABC || process.env.panda === 'undefined' || process.env.panda === undefined) { - maxWorkerNumber = os.cpus().length; - cmdPrefix = `${abcArgs.join(' ')}`; } else { logger.error(red, `ArkTS:ERROR please set panda module`, reset); } filterIntermediateJsBundleByHashJson(buildPathInfo, intermediateJsBundle); - const splitedBundles: any[] = splitJsBundlesBySize(fileterIntermediateJsBundle, maxWorkerNumber); - const workerNumber: number = maxWorkerNumber < splitedBundles.length ? maxWorkerNumber : splitedBundles.length; - - const clusterNewApiVersion: number = 16; - const currentNodeVersion: number = parseInt(process.version.split('.')[0]); - const useNewApi: boolean = currentNodeVersion >= clusterNewApiVersion; - - if (useNewApi && cluster.isPrimary || !useNewApi && cluster.isMaster) { - if (useNewApi) { - cluster.setupPrimary({ - exec: path.resolve(__dirname, genAbcScript) - }); + const splitedBundles: any[] = splitJsBundlesBySize(fileterIntermediateJsBundle, MAX_WORKER_NUMBER); + const workerNumber: number = MAX_WORKER_NUMBER < splitedBundles.length ? MAX_WORKER_NUMBER : splitedBundles.length; + + let envParams: any = { + 'splitedData': JSON.stringify(splitedBundles), + 'cmdPrefix': cmdPrefix, + 'workerNumber': workerNumber.toString(), + 'mode': JSBUNDLE + }; + let genAbcCmd: string = `${nodeJs} ${path.resolve(__dirname, MANAGE_WORKERS_SCRIPT)}`; + + try { + if (process.env.watchMode === 'true') { + childProcess.execSync(genAbcCmd, {env: envParams}); + processExtraAsset(); } else { - cluster.setupMaster({ - exec: path.resolve(__dirname, genAbcScript) + const child = childProcess.exec(genAbcCmd, {env: envParams}); + child.on('exit', (code: any) => { + if (code === 1) { + logger.debug(red, "ArkTS:ERROR failed to execute ts2abc", reset); + process.exit(FAIL); + } + processExtraAsset(); }); - } - if (workerNumber === 0) { - if (process.env.watchMode === 'true' && compileCount < previewCount) { - compileCount++; - processExtraAsset(); - if (compileCount >= previewCount) { - return; - } - invokeWorkersToGenAbc(); - } - } else { - for (let i = 0; i < workerNumber; ++i) { - const workerData: any = { - 'inputs': JSON.stringify(splitedBundles[i]), - 'cmd': cmdPrefix - }; - cluster.fork(workerData); - } + child.on('error', (err: any) => { + logger.debug(red, err.toString(), reset); + process.exit(FAIL); + }); - let count_ = 0; - if (process.env.watchMode === 'true') { - process.removeAllListeners("exit"); - cluster.removeAllListeners("exit"); - } - cluster.on('exit', (worker, code, signal) => { - if (code === FAIL) { - process.exitCode = FAIL; - } - count_++; - if (count_ === workerNumber) { - // for preview of with incre compile - if (process.env.watchMode === 'true' && compileCount < previewCount) { - compileCount++; - processExtraAsset(); - if (code === SUCCESS) { - console.info(blue, 'COMPILE RESULT:SUCCESS ', reset); - } else { - console.info(blue, 'COMPILE RESULT:FAIL ', reset); - } - if (compileCount >= previewCount) { - return; - } - invokeWorkersToGenAbc(); - } - } - logger.debug(`worker ${worker.process.pid} finished`); + child.stderr.on('data', (data: any) => { + logger.error(red, data.toString(), reset); }); } - + } catch (e) { + logger.debug(red, `ArkTS:ERROR failed to generate abc. Error message: ${e}`, reset); + process.env.abcCompileSuccess = 'false'; if (process.env.watchMode !== 'true') { - process.on('exit', (code) => { - // for build options - processExtraAsset(); - }); + process.exit(FAIL); } } } @@ -1101,6 +1016,7 @@ function processExtraAsset() { writeHashJson(); copyFileCachePathToBuildPath(); } else if (projectConfig.compileMode === ESMODULE) { + processEntryToGenAbc(entryInfos); writeModuleHashJson(); copyModuleFileCachePathToBuildPath(); mergeProtoToAbc(); @@ -1230,6 +1146,7 @@ function generateAbcByEs2AbcOfBundleMode(inputPaths: File[]) { try { if (process.env.watchMode === 'true') { childProcess.execSync(genAbcCmd); + processExtraAsset(); } else { const child = childProcess.exec(genAbcCmd); child.on('exit', (code: any) => { @@ -1263,7 +1180,6 @@ function generateAbcByEs2AbcOfBundleMode(inputPaths: File[]) { if (process.env.cachePath === undefined) { unlinkSync(filesInfoPath); } - processExtraAsset(); } } } diff --git a/compiler/src/gen_module_abc.ts b/compiler/src/gen_module_abc.ts index ca78107..9b910f3 100644 --- a/compiler/src/gen_module_abc.ts +++ b/compiler/src/gen_module_abc.ts @@ -21,9 +21,7 @@ import cluster from 'cluster'; import { logger } from './compile_info'; import { SUCCESS, - FAIL, - TS2ABC, - ES2ABC + FAIL } from './pre_define'; import { toUnixPath @@ -62,7 +60,7 @@ function js2abcByWorkers(jsonInput: string, cmd: string, workerFileName: string) logger.debug('worker data is: ', JSON.stringify(process.env)); logger.debug('gen_abc isWorker is: ', cluster.isWorker); if (cluster.isWorker && process.env['inputs'] !== undefined && process.env['cmd'] !== undefined - && process.env['workerFileName'] !== undefined) { + && process.env['workerFileName'] !== undefined && process.env['cachePath'] !== undefined) { logger.debug('==>worker #', cluster.worker.id, 'started!'); js2abcByWorkers(process.env['inputs'], process.env['cmd'], process.env['workerFileName']); process.exit(SUCCESS); diff --git a/compiler/src/manage_workers.ts b/compiler/src/manage_workers.ts new file mode 100644 index 0000000..7dc2140 --- /dev/null +++ b/compiler/src/manage_workers.ts @@ -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. + */ + +import * as path from "path"; +import cluster from "cluster"; +import process from "process"; +import { + ESMODULE, + FAIL, + GEN_ABC_SCRIPT, + GEN_MODULE_ABC_SCRIPT, + JSBUNDLE +} from "./pre_define"; + +if (process.env["workerNumber"] === undefined) { + process.exit(FAIL); +} + +if (process.env["mode"] !== JSBUNDLE && process.env['mode'] !== ESMODULE) { + process.exit(FAIL); +} + +if ( + process.env["workerNumber"] !== undefined || + process.env["splitedData"] !== undefined || + process.env["cmdPrefix"] !== undefined +) { + const clusterNewApiVersion: number = 16; + const currentNodeVersion: number = parseInt(process.version.split(".")[0]); + const useNewApi: boolean = currentNodeVersion >= clusterNewApiVersion; + + let workerNumber: number = parseInt(process.env.workerNumber); + let splitedData: any = JSON.parse(process.env.splitedData); + let cmdPrefix: string = process.env.cmdPrefix; + + if ((useNewApi && cluster.isPrimary) || (!useNewApi && cluster.isMaster)) { + let genAbcScript: string = GEN_ABC_SCRIPT; + if (process.env['mode'] === ESMODULE) { + genAbcScript = GEN_MODULE_ABC_SCRIPT + } + if (useNewApi) { + cluster.setupPrimary({ + exec: path.resolve(__dirname, genAbcScript), + }); + } else { + cluster.setupMaster({ + exec: path.resolve(__dirname, genAbcScript), + }); + } + + for (let i = 0; i < workerNumber; ++i) { + let workerData: any = { + inputs: JSON.stringify(splitedData[i]), + cmd: cmdPrefix, + }; + if (process.env['mode'] === ESMODULE) { + let cachePath: string = process.env.cachePath; + let sn: number = i + 1; + let workerFileName: string = `filesInfo_${sn}.txt`; + workerData['workerFileName'] = workerFileName; + workerData['cachePath'] = cachePath; + } + cluster.fork(workerData); + } + cluster.on("exit", (worker, code, signal) => { + if (code === FAIL) { + process.exit(FAIL); + } + }); + } +} diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 819e0fb..b87f81f 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -281,6 +281,9 @@ export const EXTNAME_D_TS: string = '.d.ts'; export const EXTNAME_ABC: string = '.abc'; export const EXTNAME_PROTO_BIN: string = '.protoBin'; export const PATCH_SYMBOL_TABLE: string = "symbol.txt"; +export const MANAGE_WORKERS_SCRIPT: string = 'manage_workers.js'; +export const GEN_ABC_SCRIPT: string = "gen_abc.js"; +export const GEN_MODULE_ABC_SCRIPT: string = "gen_module_abc.js"; export const SUCCESS: number = 0; export const FAIL: number = 1; @@ -288,6 +291,8 @@ export const FAIL: number = 1; export const TS2ABC: string = 'ts2abc'; export const ES2ABC: string = 'es2abc'; +export const MAX_WORKER_NUMBER: number = 3; + export const GENERATE_ID = 'generateId'; export const _GENERATE_ID = '__generate__Id'; -- Gitee From 768bea55fc2e1dc3668e63113170c4e2a47d12a1 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Fri, 16 Dec 2022 15:14:01 +0800 Subject: [PATCH 246/379] Add cluster fork Issue: I65HT5 Signed-off-by: zhangrengao Change-Id: Icc1573f4accc86556b076e3a18d60a1ee4f5369a --- compiler/src/gen_abc_plugin.ts | 134 ++++++++++++++++++--------------- compiler/src/manage_workers.ts | 39 +++++----- 2 files changed, 92 insertions(+), 81 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index d394b9a..50d6dd5 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -72,7 +72,9 @@ import { EXTNAME_PROTO_BIN, FILESINFO_TXT, MANAGE_WORKERS_SCRIPT, - MAX_WORKER_NUMBER + MAX_WORKER_NUMBER, + GEN_ABC_SCRIPT, + GEN_MODULE_ABC_SCRIPT } from './pre_define'; import { getOhmUrlByFilepath @@ -681,37 +683,11 @@ function invokeClusterModuleToAbc(): void { let cmdPrefix: string = `${nodeJs} ${abcArgs.join(' ')}`; const workerNumber: number = MAX_WORKER_NUMBER < splitedModules.length ? MAX_WORKER_NUMBER : splitedModules.length; - let envParams: any = { - 'splitedData': JSON.stringify(splitedModules), - 'cmdPrefix': cmdPrefix, - 'workerNumber': workerNumber.toString(), - 'cachePath': process.env.cachePath, - 'mode': ESMODULE - }; - let genAbcCmd: string = `${nodeJs} ${path.resolve(__dirname, MANAGE_WORKERS_SCRIPT)}`; - try { if (process.env.watchMode === 'true') { - childProcess.execSync(genAbcCmd, {env: envParams}); - processExtraAsset(); + processWorkersOfPreviewMode(splitedModules, cmdPrefix, workerNumber); } else { - const child = childProcess.exec(genAbcCmd, {env: envParams}); - child.on('exit', (code: any) => { - if (code === 1) { - logger.debug(red, "ArkTS:ERROR failed to execute ts2abc", reset); - process.exit(FAIL); - } - processExtraAsset(); - }); - - child.on('error', (err: any) => { - logger.debug(red, err.toString(), reset); - process.exit(FAIL); - }); - - child.stderr.on('data', (data: any) => { - logger.error(red, data.toString(), reset); - }); + processWorkersOfBuildMode(splitedModules, cmdPrefix, workerNumber); } } catch (e) { logger.debug(red, `ArkTS:ERROR failed to generate abc. Error message: ${e}`, reset); @@ -760,36 +736,11 @@ function invokeWorkersToGenAbc(): void { const splitedBundles: any[] = splitJsBundlesBySize(fileterIntermediateJsBundle, MAX_WORKER_NUMBER); const workerNumber: number = MAX_WORKER_NUMBER < splitedBundles.length ? MAX_WORKER_NUMBER : splitedBundles.length; - let envParams: any = { - 'splitedData': JSON.stringify(splitedBundles), - 'cmdPrefix': cmdPrefix, - 'workerNumber': workerNumber.toString(), - 'mode': JSBUNDLE - }; - let genAbcCmd: string = `${nodeJs} ${path.resolve(__dirname, MANAGE_WORKERS_SCRIPT)}`; - - try { + try { if (process.env.watchMode === 'true') { - childProcess.execSync(genAbcCmd, {env: envParams}); - processExtraAsset(); + processWorkersOfPreviewMode(splitedBundles, cmdPrefix, workerNumber); } else { - const child = childProcess.exec(genAbcCmd, {env: envParams}); - child.on('exit', (code: any) => { - if (code === 1) { - logger.debug(red, "ArkTS:ERROR failed to execute ts2abc", reset); - process.exit(FAIL); - } - processExtraAsset(); - }); - - child.on('error', (err: any) => { - logger.debug(red, err.toString(), reset); - process.exit(FAIL); - }); - - child.stderr.on('data', (data: any) => { - logger.error(red, data.toString(), reset); - }); + processWorkersOfBuildMode(splitedBundles, cmdPrefix, workerNumber); } } catch (e) { logger.debug(red, `ArkTS:ERROR failed to generate abc. Error message: ${e}`, reset); @@ -1150,7 +1101,7 @@ function generateAbcByEs2AbcOfBundleMode(inputPaths: File[]) { } else { const child = childProcess.exec(genAbcCmd); child.on('exit', (code: any) => { - if (code === 1) { + if (code === FAIL) { logger.debug(red, "ArkTS:ERROR failed to execute es2abc", reset); process.exit(FAIL); } @@ -1215,4 +1166,69 @@ function removeDuplicateInfoOfBundleList(inputPaths: File[]) { inputPaths = tempInputPaths; return inputPaths; -} \ No newline at end of file +} + +function processWorkersOfPreviewMode(splittedData: any, cmdPrefix: string, workerNumber: number) { + let envParams: any = { + 'splittedData': JSON.stringify(splittedData), + 'cmdPrefix': cmdPrefix, + 'workerNumber': workerNumber.toString(), + }; + if (projectConfig.compileMode === JSBUNDLE || projectConfig.compileMode === undefined) { + envParams['mode'] = JSBUNDLE; + } else if (projectConfig.compileMode === ESMODULE) { + envParams['cachePath'] = process.env.cachePath; + envParams['mode'] = ESMODULE; + } + + let genAbcCmd: string = `${nodeJs} ${path.resolve(__dirname, MANAGE_WORKERS_SCRIPT)}`; + childProcess.execSync(genAbcCmd, {env: envParams}); + processExtraAsset(); +} + +function processWorkersOfBuildMode(splittedData: any, cmdPrefix: string, workerNumber: number) { + const useNewApi: boolean = compareNodeVersion() + + if (useNewApi && cluster.isPrimary || !useNewApi && cluster.isMaster) { + let genAbcScript: string = GEN_ABC_SCRIPT; + if (projectConfig.compileMode === ESMODULE) { + genAbcScript = GEN_MODULE_ABC_SCRIPT; + } + if (useNewApi) { + cluster.setupPrimary({ + exec: path.resolve(__dirname, genAbcScript) + }); + } else { + cluster.setupMaster({ + exec: path.resolve(__dirname, genAbcScript) + }); + } + + for (let i = 0; i < workerNumber; ++i) { + let workerData: any = { + 'inputs': JSON.stringify(splittedData[i]), + 'cmd': cmdPrefix + }; + if (projectConfig.compileMode === ESMODULE) { + let sn: number = i + 1; + let workerFileName: string = `filesInfo_${sn}.txt`; + workerData['workerFileName'] = workerFileName; + workerData['cachePath'] = process.env.cachePath; + } + cluster.fork(workerData); + } + + cluster.on('exit', (worker, code, signal) => { + if (code === FAIL) { + process.exitCode = FAIL; + } + logger.debug(`worker ${worker.process.pid} finished`); + }); + + process.on('exit', (code) => { + if (process.exitCode !== FAIL && process.env.watchMode !== 'true') { + processExtraAsset(); + } + }); + } +} diff --git a/compiler/src/manage_workers.ts b/compiler/src/manage_workers.ts index 7dc2140..b9a4cd5 100644 --- a/compiler/src/manage_workers.ts +++ b/compiler/src/manage_workers.ts @@ -24,56 +24,51 @@ import { JSBUNDLE } from "./pre_define"; -if (process.env["workerNumber"] === undefined) { - process.exit(FAIL); -} - if (process.env["mode"] !== JSBUNDLE && process.env['mode'] !== ESMODULE) { - process.exit(FAIL); + process.exit(FAIL); } -if ( - process.env["workerNumber"] !== undefined || - process.env["splitedData"] !== undefined || +if (process.env["workerNumber"] !== undefined && + process.env["splittedData"] !== undefined && process.env["cmdPrefix"] !== undefined ) { + let workerNumber: number = parseInt(process.env.workerNumber); + let splittedData: any = JSON.parse(process.env.splittedData); + let cmdPrefix: string = process.env.cmdPrefix; + const clusterNewApiVersion: number = 16; - const currentNodeVersion: number = parseInt(process.version.split(".")[0]); + const currentNodeVersion: number = parseInt(process.version.split('.')[0]); const useNewApi: boolean = currentNodeVersion >= clusterNewApiVersion; - let workerNumber: number = parseInt(process.env.workerNumber); - let splitedData: any = JSON.parse(process.env.splitedData); - let cmdPrefix: string = process.env.cmdPrefix; - if ((useNewApi && cluster.isPrimary) || (!useNewApi && cluster.isMaster)) { let genAbcScript: string = GEN_ABC_SCRIPT; - if (process.env['mode'] === ESMODULE) { - genAbcScript = GEN_MODULE_ABC_SCRIPT + if (process.env["mode"] === ESMODULE) { + genAbcScript = GEN_MODULE_ABC_SCRIPT; } if (useNewApi) { cluster.setupPrimary({ - exec: path.resolve(__dirname, genAbcScript), + exec: path.resolve(__dirname, genAbcScript) }); } else { cluster.setupMaster({ - exec: path.resolve(__dirname, genAbcScript), + exec: path.resolve(__dirname, genAbcScript) }); } for (let i = 0; i < workerNumber; ++i) { let workerData: any = { - inputs: JSON.stringify(splitedData[i]), - cmd: cmdPrefix, + 'inputs': JSON.stringify(splittedData[i]), + 'cmd': cmdPrefix }; - if (process.env['mode'] === ESMODULE) { - let cachePath: string = process.env.cachePath; + if (process.env["mode"] === ESMODULE) { let sn: number = i + 1; let workerFileName: string = `filesInfo_${sn}.txt`; workerData['workerFileName'] = workerFileName; - workerData['cachePath'] = cachePath; + workerData['cachePath'] = process.env.cachePath; } cluster.fork(workerData); } + cluster.on("exit", (worker, code, signal) => { if (code === FAIL) { process.exit(FAIL); -- Gitee From d05ac9a8b4d9fffdf987588356ad1a71bf3ef934 Mon Sep 17 00:00:00 2001 From: bojiang Date: Mon, 26 Dec 2022 21:18:28 +0800 Subject: [PATCH 247/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: Ib1f45a15f73de456a0f1c8dfcab3d4d20e913751 --- compiler/src/compile_info.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 47580c1..ea8053b 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -281,12 +281,12 @@ export class ResultStates { this.removedFiles = watchRemovedFiles; } if (watchModifiedFiles.length) { - const isTsAndEtsFile: boolean = watchModifiedFiles.some((item: string) => { - return /.(ts|ets)$/.test(item); + watchModifiedFiles.some((item: string) => { + if (fs.statSync(item).isFile() && !/.(ts|ets)$/.test(item)) { + process.env.watchTs = 'end'; + return true; + } }); - if (!isTsAndEtsFile) { - process.env.watchTs = 'end'; - } } if (this.shouldWriteChangedList(watchModifiedFiles, watchRemovedFiles)) { this.hotReloadIncrementalTime.hotReloadIncrementalStartTime = new Date().getTime().toString(); -- Gitee From 2e8e43272652e9756cbc9bbcc75af1e7372a36a1 Mon Sep 17 00:00:00 2001 From: laosan_ted Date: Tue, 27 Dec 2022 18:21:29 +0800 Subject: [PATCH 248/379] webview support scroll Signed-off-by: laosan_ted --- compiler/components/web.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/components/web.json b/compiler/components/web.json index 05087de..ae728ba 100644 --- a/compiler/components/web.json +++ b/compiler/components/web.json @@ -11,6 +11,6 @@ "userAgent", "onConfirm", "onConsole", "onErrorReceive", "onHttpErrorReceive", "onDownloadStart", "webDebuggingAccess", "onShowFileSelector", "initialScale", "onResourceLoad", "onScaleChange", "onHttpAuthRequest", "onPermissionRequest", "onContextMenuShow", "textZoomRatio", "onScroll", "mediaPlayGestureAccess", "onSslErrorEventReceive", - "onClientAuthenticationRequest" + "onClientAuthenticationRequest", "horizontalScrollBarAccess", "verticalScrollBarAccess" ] } -- Gitee From 3dced4df8e5a6e870b891c6da3f03fd1ec51f375 Mon Sep 17 00:00:00 2001 From: zhangchen168 Date: Sun, 11 Dec 2022 21:32:12 +0800 Subject: [PATCH 249/379] Enable .d.ets file emitting and retain the arkUI decorators Issue: https://gitee.com/openharmony/third_party_typescript/issues/I65G6O Change-Id: I421ec93b8b8de8f557251009dd0307dc4fd3c0b5 Signed-off-by: zhangchen168 --- compiler/package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/package-lock.json b/compiler/package-lock.json index 5f0f071..cc09792 100644 --- a/compiler/package-lock.json +++ b/compiler/package-lock.json @@ -4161,7 +4161,7 @@ }, "typescript": { "version": "file:deps/ohos-typescript-4.2.3-r2.tgz", - "integrity": "sha512-gxr6vSrPdDve0VfW5RjrRYQKlRXHiMti6lTAPpGwLh/ZOE0ChZAmo8G6JEVmMzBw/KMbENku2YbUIS1rKIExfg==" + "integrity": "sha512-ITYnPXE5QJpdmQqQgzChV5DYRgyJ/kigjlaRAEFjW3HtgldUNeH57jyFsSlQ39MBabkusRheRjzBYgNxW76uiw==" }, "uglify-js": { "version": "3.16.1", -- Gitee From ad1b898210844e1227cba8cb0875966296b72c12 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Thu, 29 Dec 2022 15:31:16 +0800 Subject: [PATCH 250/379] houhaoyu@huawei.com change parent=undefined to null Signed-off-by: houhaoyu Change-Id: Iaf07f28e0b25b64b983923c3b719e0ca91c3fffa --- compiler/src/pre_define.ts | 1 + compiler/src/process_component_class.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index b87f81f..882068a 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -116,6 +116,7 @@ export const ATTRIBUTE_STATESTYLES: string = 'stateStyles'; export const ATTRIBUTE_ID: string = 'id'; export const TRUE: string = 'true'; export const FALSE: string = 'false'; +export const NULL: string = 'null'; export const COMPONENT_CONSTRUCTOR_ID: string = 'compilerAssignedUniqueChildId'; export const COMPONENT_CONSTRUCTOR_PARENT: string = 'parent'; diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index f65299c..507cc3c 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -60,7 +60,7 @@ import { COMPONENT_CONSTRUCTOR_UNDEFINED, CUSTOM_COMPONENT, COMPONENT_CONSTRUCTOR_PARENT, - COMPONENT_IF_UNDEFINED, + NULL, INNER_COMPONENT_MEMBER_DECORATORS, COMPONENT_RERENDER_FUNCTION, RMELMTID, @@ -401,7 +401,7 @@ function processComponentMethod(node: ts.MethodDeclaration, parentComponentName: export function createParentParameter(): ts.ParameterDeclaration { return ts.factory.createParameterDeclaration(undefined, undefined, undefined, ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT), undefined, undefined, - ts.factory.createIdentifier(COMPONENT_IF_UNDEFINED)); + ts.factory.createIdentifier(NULL)); } function processBuildMember(node: ts.MethodDeclaration, context: ts.TransformationContext, -- Gitee From 71c8e3dea105552fef8b9dd9dfad0da0459f86eb Mon Sep 17 00:00:00 2001 From: hufeng Date: Wed, 28 Dec 2022 16:33:29 +0800 Subject: [PATCH 251/379] Set js not fullySpecified Signed-off-by: hufeng Change-Id: Ia7b6dbeebbb1a1d897344b7cd098ab95998bb18d --- compiler/webpack.config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index a844dc0..eacaa73 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -165,6 +165,8 @@ function setJsConfigRule() { 'allowTopLevelThis': true } ]); + } else { + jsRule.resolve = { fullySpecified: false }; } return jsRule; } -- Gitee From a3ab30e8bb97b4806092d12e5919e81cb2783bd5 Mon Sep 17 00:00:00 2001 From: hufeng Date: Mon, 26 Dec 2022 21:20:56 +0800 Subject: [PATCH 252/379] Replace harName with OhmUrl in cross hap Signed-off-by: hufeng Change-Id: I3c6eff1394afcc0f115cd13243ba645cb392739a --- compiler/main.js | 1 + compiler/src/utils.ts | 32 +++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/compiler/main.js b/compiler/main.js index a909cec..d5b1ebc 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -475,6 +475,7 @@ function loadModuleInfo(projectConfig, envArgs) { projectConfig.buildArkMode = envArgs.buildMode; if (buildJsonInfo.compileMode === 'esmodule') { projectConfig.nodeModulesPath = buildJsonInfo.nodeModulesPath; + projectConfig.harNameOhmMap = buildJsonInfo.harNameOhmMap; } } } diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 7792829..46fb6f1 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -458,10 +458,40 @@ function replaceRelativeDependency(item:string, moduleRequest: string, sourcePat return item; } +function replaceHarDependency(item:string, moduleRequest: string): string { + if (projectConfig.harNameOhmMap) { + // case1: "@ohos/lib" ---> "@module:lib/ets/index" + if (projectConfig.harNameOhmMap.hasOwnProperty(moduleRequest)) { + return item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { + return quotation + projectConfig.harNameOhmMap[moduleRequest] + quotation; + }); + } + // case2: "@ohos/lib/src/main/ets/pages/page1" ---> "@module:lib/ets/pages/page1" + for (const harName in projectConfig.harNameOhmMap) { + if (moduleRequest.startsWith(harName + '/')) { + const harOhmName: string = + projectConfig.harNameOhmMap[harName].substring(0, projectConfig.harNameOhmMap[harName].indexOf('/')); + if (moduleRequest.indexOf(harName + '/' + SRC_MAIN) == 0) { + moduleRequest = moduleRequest.replace(harName + '/' + SRC_MAIN , harOhmName); + } else { + moduleRequest = moduleRequest.replace(harName, harOhmName); + } + return item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { + return quotation + moduleRequest + quotation; + }); + } + } + } + return item; +} + function transformModuleSpecifier(sourcePath: string, sourceCode: string): string { // replace relative moduleSpecifier with ohmURl const REG_RELATIVE_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]((?:\.\/|\.\.\/)[^'"]+)['"]/g; - return sourceCode.replace(REG_RELATIVE_DEPENDENCY, (item, moduleRequest)=>{ + const REG_HAR_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]([^\.\/][^'"]+)['"]/g; + return sourceCode.replace(REG_HAR_DEPENDENCY, (item, moduleRequest) => { + return replaceHarDependency(item, moduleRequest); + }).replace(REG_RELATIVE_DEPENDENCY, (item, moduleRequest) => { return replaceRelativeDependency(item, moduleRequest, toUnixPath(sourcePath)); }); } -- Gitee From 4a3c861b2f7755570543f42f48915aa6bf4e327a Mon Sep 17 00:00:00 2001 From: hufeng Date: Fri, 23 Dec 2022 18:30:29 +0800 Subject: [PATCH 253/379] Support to generate Json file by compiling modules Signed-off-by: hufeng Change-Id: I9e90329949e67b3b692e56a7b98b6004654e217f --- compiler/src/gen_abc_plugin.ts | 66 +++++++++++++++---- compiler/src/pre_define.ts | 3 +- ...cess_js_file.ts => process_source_file.ts} | 2 +- compiler/src/utils.ts | 22 ++++--- compiler/webpack.config.js | 18 ++++- 5 files changed, 86 insertions(+), 25 deletions(-) rename compiler/src/{process_js_file.ts => process_source_file.ts} (80%) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 50d6dd5..7026a78 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -49,14 +49,15 @@ import { ESMODULE, JSBUNDLE, NODE_MODULES, - ENTRY_TXT, ES2ABC, EXTNAME_ETS, EXTNAME_JS, EXTNAME_TS, EXTNAME_MJS, EXTNAME_CJS, + EXTNAME_D_ETS, EXTNAME_D_TS, + EXTNAME_JSON, EXTNAME_JS_MAP, FAIL, MODULELIST_JSON, @@ -376,6 +377,18 @@ function processJsModule(filePath: string, tempFilePath: string, buildFilePath: buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath + path.sep, ''))); } +function processJsonModule(filePath: string, tempFilePath: string, buildFilePath: string, nodeModulesFile: Array, module: any): void { + const abcFilePath: string = "NA"; + if (checkNodeModulesFile(filePath, projectConfig.projectPath)) { + processNodeModulesFile(filePath, tempFilePath, buildFilePath, abcFilePath, nodeModulesFile, module); + } else { + const moduleName: string = getPackageInfo(projectConfig.aceModuleJsonPath)[1]; + const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, moduleName, false); + moduleInfos.push(tempModuleInfo); + } + buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath + path.sep, ''))); +} + var cachedSourceMaps: Object; function updateCachedSourceMaps(): void { @@ -462,18 +475,47 @@ function handleFullModuleFiles(modules, callback): any { validateFilePathLength(buildFilePath); tempFilePath = toUnixPath(tempFilePath); buildFilePath = toUnixPath(buildFilePath); - if (filePath.endsWith(EXTNAME_ETS)) { - processEtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); - } else if (filePath.endsWith(EXTNAME_D_TS)) { - processDtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); - } else if (filePath.endsWith(EXTNAME_TS)) { - processTsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); - } else if (filePath.endsWith(EXTNAME_JS) || filePath.endsWith(EXTNAME_MJS) || filePath.endsWith(EXTNAME_CJS)) { - processJsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); - } else { - logger.error(red, `ArkTS:ERROR Cannot find resolve this file path: ${filePath}`, reset); - process.exitCode = FAIL; + + switch (path.extname(filePath)) { + case EXTNAME_ETS: { + processEtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + break; + } + case EXTNAME_TS: { + processTsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + break; + } + case EXTNAME_JS: + case EXTNAME_MJS: + case EXTNAME_CJS: { + processJsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + break; + } + case EXTNAME_D_TS: + case EXTNAME_D_ETS: + break; + case EXTNAME_JSON: { + processJsonModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + break; + } + default: { + logger.error(red, `ArkTS:ERROR Cannot find resolve this file path: ${filePath}`, reset); + process.exitCode = FAIL; + } } + + // if (filePath.endsWith(EXTNAME_ETS)) { + // processEtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + // } else if (filePath.endsWith(EXTNAME_D_TS)) { + // processDtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + // } else if (filePath.endsWith(EXTNAME_TS)) { + // processTsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + // } else if (filePath.endsWith(EXTNAME_JS) || filePath.endsWith(EXTNAME_MJS) || filePath.endsWith(EXTNAME_CJS)) { + // processJsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); + // } else { + // logger.error(red, `ArkTS:ERROR Cannot find resolve this file path: ${filePath}`, reset); + // process.exitCode = FAIL; + // } } }); diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index b87f81f..53a32ab 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -252,7 +252,6 @@ export const COMPONENT_TOGGLE: string = 'Toggle'; export const TTOGGLE_CHECKBOX: string = 'Checkbox'; export const TOGGLE_SWITCH: string = 'Switch'; -export const ENTRY_TXT: string = 'entry.txt'; export const FILESINFO_TXT: string = 'filesInfo.txt'; export const NPMENTRIES_TXT: string = 'npmEntries.txt'; export const MODULES_CACHE: string = 'modules.cache'; @@ -278,6 +277,8 @@ export const EXTNAME_TS_MAP: string = '.ts.map'; export const EXTNAME_MJS: string = '.mjs'; export const EXTNAME_CJS: string = '.cjs'; export const EXTNAME_D_TS: string = '.d.ts'; +export const EXTNAME_D_ETS: string = '.d.ets'; +export const EXTNAME_JSON: string = '.json'; export const EXTNAME_ABC: string = '.abc'; export const EXTNAME_PROTO_BIN: string = '.protoBin'; export const PATCH_SYMBOL_TABLE: string = "symbol.txt"; diff --git a/compiler/src/process_js_file.ts b/compiler/src/process_source_file.ts similarity index 80% rename from compiler/src/process_js_file.ts rename to compiler/src/process_source_file.ts index 8aff181..d4c1d93 100644 --- a/compiler/src/process_js_file.ts +++ b/compiler/src/process_source_file.ts @@ -5,7 +5,7 @@ import { ARK } from './pre_define'; -module.exports = function processjs2file(source: string): string { +module.exports = function processSourcefile(source: string): string { if (projectConfig.compileMode === ESMODULE && process.env.compilerType && process.env.compilerType === ARK) { writeFileSyncByString(this.resourcePath, source); diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 46fb6f1..c2929df 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -394,20 +394,24 @@ async function writeMinimizedSourceCode(content: string, filePath: string): Prom } export function writeFileSyncByString(sourcePath: string, sourceCode: string): void { - const jsFilePath: string = genTemporaryPath(sourcePath, projectConfig.projectPath, process.env.cachePath); - if (jsFilePath.length === 0) { + const filePath: string = genTemporaryPath(sourcePath, projectConfig.projectPath, process.env.cachePath); + if (filePath.length === 0) { return; } - sourceCode = transformModuleSpecifier(sourcePath, sourceCode); - - mkdirsSync(path.dirname(jsFilePath)); - if (projectConfig.buildArkMode === 'debug') { - fs.writeFileSync(jsFilePath, sourceCode); - return; + if (/\.js$/.test(sourcePath)) { + sourceCode = transformModuleSpecifier(sourcePath, sourceCode); + mkdirsSync(path.dirname(filePath)); + if (projectConfig.buildArkMode === 'debug') { + fs.writeFileSync(filePath, sourceCode); + return; + } + writeMinimizedSourceCode(sourceCode, filePath); } - writeMinimizedSourceCode(sourceCode, jsFilePath); + if (/\.json$/.test(sourcePath)) { + fs.writeFileSync(filePath, sourceCode); + } } export const packageCollection: Map> = new Map(); diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index eacaa73..2bfa717 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -92,7 +92,8 @@ function initConfig(config) { { loader: path.resolve(__dirname, 'lib/pre_process.js') } ] }, - setJsConfigRule() + setJsConfigRule(), + setJsonConfigRule() ] }, node: { @@ -153,7 +154,7 @@ function setJsConfigRule() { compact: false } }, - { loader: path.resolve(__dirname, 'lib/process_js_file.js')}, + { loader: path.resolve(__dirname, 'lib/process_source_file.js') }, { loader: path.resolve(__dirname, 'lib/process_system_module.js') } ] }; @@ -171,6 +172,19 @@ function setJsConfigRule() { return jsRule; } +function setJsonConfigRule() { + const jsonRule = { + test: /\.json$/, + use: [ + { loader: 'json-loader' } + ] + } + if (projectConfig.compileMode === 'esmodule') { + jsonRule.use.push({ loader: path.resolve(__dirname, 'lib/process_source_file.js') }) + } + return jsonRule; +} + function existsPackageJson(config, rootPackageJsonPath, modulePackageJsonPath) { if (config.cache) { config.cache.buildDependencies = { -- Gitee From 1ecb1631197db5f42b58263e98a920ac0f828190 Mon Sep 17 00:00:00 2001 From: hufeng Date: Mon, 26 Dec 2022 10:08:26 +0800 Subject: [PATCH 254/379] Set json-loader in package.json Signed-off-by: hufeng Change-Id: I9c908af84cddb48ea93c8f836260b1be26ef0af3 --- compiler/package.json | 1 + compiler/src/gen_abc_plugin.ts | 50 ++++++++++++++++------------------ compiler/src/utils.ts | 4 +-- 3 files changed, 25 insertions(+), 30 deletions(-) diff --git a/compiler/package.json b/compiler/package.json index 32824c6..ee138f8 100644 --- a/compiler/package.json +++ b/compiler/package.json @@ -41,6 +41,7 @@ "deccjsunit": "^1.0.8", "hypium": "^1.0.0", "ignore-loader": "^0.1.2", + "json-loader":"^0.5.7", "lodash": "^4.17.21", "log4js": "^6.3.0", "md5": "^2.3.0", diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 7026a78..9df5ddf 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -491,9 +491,6 @@ function handleFullModuleFiles(modules, callback): any { processJsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); break; } - case EXTNAME_D_TS: - case EXTNAME_D_ETS: - break; case EXTNAME_JSON: { processJsonModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); break; @@ -503,19 +500,6 @@ function handleFullModuleFiles(modules, callback): any { process.exitCode = FAIL; } } - - // if (filePath.endsWith(EXTNAME_ETS)) { - // processEtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); - // } else if (filePath.endsWith(EXTNAME_D_TS)) { - // processDtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); - // } else if (filePath.endsWith(EXTNAME_TS)) { - // processTsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); - // } else if (filePath.endsWith(EXTNAME_JS) || filePath.endsWith(EXTNAME_MJS) || filePath.endsWith(EXTNAME_CJS)) { - // processJsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, module); - // } else { - // logger.error(red, `ArkTS:ERROR Cannot find resolve this file path: ${filePath}`, reset); - // process.exitCode = FAIL; - // } } }); @@ -1045,17 +1029,29 @@ function handleHotReloadChangedFiles() { let buildFilePath: string = ""; tempFilePath = toUnixPath(tempFilePath); - if (file.endsWith(EXTNAME_ETS)) { - processEtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); - } else if (file.endsWith(EXTNAME_D_TS)) { - processDtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); - } else if (file.endsWith(EXTNAME_TS)) { - processTsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); - } else if (file.endsWith(EXTNAME_JS) || file.endsWith(EXTNAME_MJS) || file.endsWith(EXTNAME_CJS)) { - processJsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); - } else { - logger.debug(red, `ArkTS:ERROR Cannot resolve file path: ${filePath}, stop hot reload build`, reset); - return; + switch (path.extname(filePath)) { + case EXTNAME_ETS: { + processEtsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); + break; + } + case EXTNAME_TS: { + processTsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); + break; + } + case EXTNAME_JS: + case EXTNAME_MJS: + case EXTNAME_CJS: { + processJsModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); + break; + } + case EXTNAME_JSON: { + processJsonModule(filePath, tempFilePath, buildFilePath, nodeModulesFile, undefined); + break; + } + default: { + logger.debug(red, `ArkTS:ERROR Cannot resolve file path: ${filePath}, stop hot reload build`, reset); + return; + } } let sourceMapPath: string = toUnixPath(path.join(relativeProjectPath, file)); diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index c2929df..ca4cbbb 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -398,17 +398,15 @@ export function writeFileSyncByString(sourcePath: string, sourceCode: string): v if (filePath.length === 0) { return; } - + mkdirsSync(path.dirname(filePath)); if (/\.js$/.test(sourcePath)) { sourceCode = transformModuleSpecifier(sourcePath, sourceCode); - mkdirsSync(path.dirname(filePath)); if (projectConfig.buildArkMode === 'debug') { fs.writeFileSync(filePath, sourceCode); return; } writeMinimizedSourceCode(sourceCode, filePath); } - if (/\.json$/.test(sourcePath)) { fs.writeFileSync(filePath, sourceCode); } -- Gitee From 7a1dc2ff46e1761e7ff969e5f8dad92ee5d876ae Mon Sep 17 00:00:00 2001 From: hufeng Date: Mon, 26 Dec 2022 15:45:51 +0800 Subject: [PATCH 255/379] Remove json-loader Signed-off-by: hufeng Change-Id: Ib03694f0c62745e144c781724ef2cb4d2170b9ba --- compiler/package.json | 1 - compiler/src/gen_abc_plugin.ts | 9 ++------- compiler/webpack.config.js | 16 ++++++++-------- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/compiler/package.json b/compiler/package.json index ee138f8..32824c6 100644 --- a/compiler/package.json +++ b/compiler/package.json @@ -41,7 +41,6 @@ "deccjsunit": "^1.0.8", "hypium": "^1.0.0", "ignore-loader": "^0.1.2", - "json-loader":"^0.5.7", "lodash": "^4.17.21", "log4js": "^6.3.0", "md5": "^2.3.0", diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 9df5ddf..f92036b 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -55,8 +55,6 @@ import { EXTNAME_TS, EXTNAME_MJS, EXTNAME_CJS, - EXTNAME_D_ETS, - EXTNAME_D_TS, EXTNAME_JSON, EXTNAME_JS_MAP, FAIL, @@ -216,7 +214,8 @@ export class GenAbcPlugin { return; } Object.keys(compilation.assets).forEach(key => { - if (path.extname(key) === EXTNAME_JS || path.extname(key) === EXTNAME_JS_MAP) { + if (path.extname(key) === EXTNAME_JS || path.extname(key) === EXTNAME_JS_MAP || + path.extname(key) === EXTNAME_JSON) { delete assets[key]; } }); @@ -338,10 +337,6 @@ function processEtsModule(filePath: string, tempFilePath: string, buildFilePath: buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath + path.sep, ''))); } -function processDtsModule(filePath: string, tempFilePath: string, buildFilePath: string, nodeModulesFile: Array, module: any): void { - return; -} - function processTsModule(filePath: string, tempFilePath: string, buildFilePath: string, nodeModulesFile: Array, module: any): void { if (projectConfig.processTs === false) { tempFilePath = tempFilePath.replace(/\.ts$/, EXTNAME_JS); diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 2bfa717..b1358c2 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -92,8 +92,7 @@ function initConfig(config) { { loader: path.resolve(__dirname, 'lib/pre_process.js') } ] }, - setJsConfigRule(), - setJsonConfigRule() + setJsConfigRule() ] }, node: { @@ -119,6 +118,7 @@ function initConfig(config) { new ResultStates() ] }); + setModuleJsonConfigRule(config); if (!projectConfig.xtsMode) { config.cache = { type: "filesystem", @@ -172,17 +172,17 @@ function setJsConfigRule() { return jsRule; } -function setJsonConfigRule() { +function setModuleJsonConfigRule(config) { + if (projectConfig.compileMode !== 'esmodule') { + return; + } const jsonRule = { test: /\.json$/, use: [ - { loader: 'json-loader' } + { loader: path.resolve(__dirname, 'lib/process_source_file.js') } ] } - if (projectConfig.compileMode === 'esmodule') { - jsonRule.use.push({ loader: path.resolve(__dirname, 'lib/process_source_file.js') }) - } - return jsonRule; + config.module.rules.push(jsonRule); } function existsPackageJson(config, rootPackageJsonPath, modulePackageJsonPath) { -- Gitee From e45900470637dac247cebc18b98f79c139ba7ef7 Mon Sep 17 00:00:00 2001 From: hufeng Date: Tue, 27 Dec 2022 21:38:22 +0800 Subject: [PATCH 256/379] Fix json file's protoBin extension Signed-off-by: hufeng Change-Id: Icb63b81c63660268c38768f869f19eeebd80c850 --- compiler/src/gen_abc_plugin.ts | 5 +++-- compiler/src/utils.ts | 8 +------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index f92036b..32d3367 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -315,7 +315,9 @@ function processNodeModulesFile(filePath: string, tempFilePath: string, buildFil moduleInfos.push(tempModuleInfo); nodeModulesFile.push(tempFilePath); } - buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath + path.sep, ''))); + if (!filePath.endsWith(EXTNAME_JSON)) { + buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath + path.sep, ''))); + } } function processEtsModule(filePath: string, tempFilePath: string, buildFilePath: string, nodeModulesFile: Array, module: any): void { @@ -381,7 +383,6 @@ function processJsonModule(filePath: string, tempFilePath: string, buildFilePath const tempModuleInfo: ModuleInfo = new ModuleInfo(filePath, tempFilePath, buildFilePath, abcFilePath, moduleName, false); moduleInfos.push(tempModuleInfo); } - buildMapFileList.add(toUnixPath(filePath.replace(projectConfig.projectRootPath + path.sep, ''))); } var cachedSourceMaps: Object; diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index ca4cbbb..bee8a7a 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -694,13 +694,7 @@ export function isTs2Abc(): boolean { } export function genProtoFileName(temporaryFile: string): string { - let protoFile: string = temporaryFile; - if (temporaryFile.endsWith(EXTNAME_TS)) { - protoFile = temporaryFile.replace(/\.ts$/, EXTNAME_PROTO_BIN); - } else { - protoFile = temporaryFile.replace(/\.js$/, EXTNAME_PROTO_BIN); - } - return protoFile; + return temporaryFile.replace(/\.(?:[tj]s|json)$/, EXTNAME_PROTO_BIN); } export function genMergeProtoFileName(temporaryFile: string): string { -- Gitee From b9d799879c548fe64b12ae79515913ab2850a31c Mon Sep 17 00:00:00 2001 From: zhaoxinyu Date: Fri, 30 Dec 2022 16:54:27 +0800 Subject: [PATCH 257/379] add Menu MenuItem MenuItemGroup Signed-off-by: zhaoxinyu Change-Id: I81bd47d8e576e8c1762995e30600e2c80e6fb8b6 --- compiler/components/menu.json | 2 +- compiler/components/menu_item.json | 5 +++++ compiler/components/menu_item_group.json | 4 ++++ compiler/tsconfig.json | 12 ++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 compiler/components/menu_item.json create mode 100644 compiler/components/menu_item_group.json diff --git a/compiler/components/menu.json b/compiler/components/menu.json index 2db5287..749e8c0 100644 --- a/compiler/components/menu.json +++ b/compiler/components/menu.json @@ -1,5 +1,5 @@ { "name": "Menu", - "children": ["Option"], + "children": ["Option", "MenuItem", "MenuItemGroup"], "attrs": ["show", "showPosition", "fontColor", "fontSize", "fontWeight", "fontFamily"] } \ No newline at end of file diff --git a/compiler/components/menu_item.json b/compiler/components/menu_item.json new file mode 100644 index 0000000..b949f26 --- /dev/null +++ b/compiler/components/menu_item.json @@ -0,0 +1,5 @@ +{ + "name": "MenuItem", + "parent": ["Menu", "MenuItemGroup"], + "attrs": ["selectIcon", "onChange"] + } \ No newline at end of file diff --git a/compiler/components/menu_item_group.json b/compiler/components/menu_item_group.json new file mode 100644 index 0000000..110332a --- /dev/null +++ b/compiler/components/menu_item_group.json @@ -0,0 +1,4 @@ +{ + "name": "MenuItemGroup", + "children": ["MenuItem"] + } \ No newline at end of file diff --git a/compiler/tsconfig.json b/compiler/tsconfig.json index da14aae..c6ed4f9 100644 --- a/compiler/tsconfig.json +++ b/compiler/tsconfig.json @@ -63,6 +63,8 @@ "LoadingProgress", "Marquee", "Menu", + "MenuItem", + "MenuItemGroup", "NavDestination", "NavRouter", "Navigation", @@ -313,6 +315,16 @@ "type": "MenuAttribute", "instance": "MenuInstance" }, + { + "name": "MenuItem", + "type": "MenuItemAttribute", + "instance": "MenuItemInstance" + }, + { + "name": "MenuItemGroup", + "type": "MenuItemGroupAttribute", + "instance": "MenuItemGroupInstance" + }, { "name": "NavDestination", "type": "NavDestinationAttribute", -- Gitee From 452299a2b02281fde59b2c8f96384c721b87d4b4 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 2 Jan 2023 22:15:22 +0800 Subject: [PATCH 258/379] houhaoyu@huawei.com compile har & shared project Signed-off-by: houhaoyu Change-Id: I3edc8d543770fb02382918a9974a0f7d3f803d12 --- compiler/main.js | 147 +++++++++++++++--- compiler/src/compile_info.ts | 36 ++++- compiler/src/ets_checker.ts | 44 +++++- compiler/src/process_har_writejs.ts | 21 +++ compiler/src/process_import.ts | 3 +- compiler/src/process_ui_syntax.ts | 8 +- compiler/src/result_process.ts | 9 +- compiler/src/utils.ts | 26 +++- .../ut/render_decorator/@builder/@builder.ts | 10 +- .../@builder/@builderWithLinkData.ts | 2 +- .../@builderParam/@builderParam.ts | 6 +- .../render_decorator/@builder/@builder.ts | 10 +- .../@builder/@builderWithComponent.ts | 4 +- .../@builder/@builderWithLinkData.ts | 2 +- .../@builderParam/@builderParam.ts | 6 +- compiler/tsconfig.esm.json | 80 +++++++++- compiler/tsconfig.json | 80 +++++++++- compiler/webpack.config.js | 17 +- 18 files changed, 451 insertions(+), 60 deletions(-) create mode 100644 compiler/src/process_har_writejs.ts diff --git a/compiler/main.js b/compiler/main.js index d5b1ebc..665c9a6 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -113,22 +113,24 @@ function loadEntryObj(projectConfig) { throw Error('\u001b[31m ERROR: the manifest file ' + projectConfig.manifestFilePath.replace(/\\/g, '/') + ' or module.json is lost or format is invalid. \u001b[39m').message; } - if (manifest.pages) { - const pages = manifest.pages; - pages.forEach((element) => { - const sourcePath = element.replace(/^\.\/ets\//, ''); - const fileName = path.resolve(projectConfig.projectPath, sourcePath + '.ets'); - if (fs.existsSync(fileName)) { - projectConfig.entryObj['./' + sourcePath] = fileName + '?entry'; - } else { - throw Error(`\u001b[31m ERROR: page '${fileName.replace(/\\/g, '/')}' does not exist. \u001b[39m`) - .message; - } - }); - } else { - throw Error('\u001b[31m ERROR: missing pages attribute in ' + - projectConfig.manifestFilePath.replace(/\\/g, '/') + - '. \u001b[39m').message; + if (!projectConfig.compileHar) { + if (manifest.pages) { + const pages = manifest.pages; + pages.forEach((element) => { + const sourcePath = element.replace(/^\.\/ets\//, ''); + const fileName = path.resolve(projectConfig.projectPath, sourcePath + '.ets'); + if (fs.existsSync(fileName)) { + projectConfig.entryObj['./' + sourcePath] = fileName + '?entry'; + } else { + throw Error(`\u001b[31m ERROR: page '${fileName.replace(/\\/g, '/')}' does not exist. \u001b[39m`) + .message; + } + }); + } else { + throw Error('\u001b[31m ERROR: missing pages attribute in ' + + projectConfig.manifestFilePath.replace(/\\/g, '/') + + '. \u001b[39m').message; + } } } } @@ -142,12 +144,15 @@ function buildManifest(manifest, aceConfigPath) { partialUpdateController(moduleConfigJson.module.metadata, moduleConfigJson.app.minAPIVersion); } - if (moduleConfigJson.module) { - manifest.pages = getPages(moduleConfigJson); + if (moduleConfigJson.module.type === 'har') { + projectConfig.compileHar = true; + getPackageJsonEntryPath(); + } else if (moduleConfigJson.module.type === 'shared') { + projectConfig.compileShared = true; + getPackageJsonEntryPath(); + getManifestPages(moduleConfigJson, manifest); } else { - throw Error('\u001b[31m'+ - 'ERROR: the config.json file miss key word module || module[abilities].' + - '\u001b[39m').message; + getManifestPages(moduleConfigJson, manifest); } } catch (e) { if (/BUIDERROR/.test(e)) { @@ -159,6 +164,102 @@ function buildManifest(manifest, aceConfigPath) { } } +function getManifestPages(moduleConfigJson, manifest) { + if (moduleConfigJson.module) { + manifest.pages = getPages(moduleConfigJson); + } else { + throw Error('\u001b[31m'+ + 'ERROR: the config.json file miss key word module || module[abilities].' + + '\u001b[39m').message; + } +} + +function getPackageJsonEntryPath() { + let rootPackageJsonPath = path.resolve(projectConfig.projectPath, '../../../package.json'); + if (fs.existsSync(rootPackageJsonPath)) { + let rootPackageJsonContent = JSON.parse(fs.readFileSync(rootPackageJsonPath, 'utf-8')); + if (rootPackageJsonContent) { + if (rootPackageJsonContent.module) { + getEntryPath(rootPackageJsonContent.module, rootPackageJsonPath); + } else if (rootPackageJsonContent.main) { + getEntryPath(rootPackageJsonContent.main, rootPackageJsonPath); + } else { + getEntryPath('', rootPackageJsonPath); + } + } else { + throw Error('\u001b[31m'+ 'lack message in package.json.' + '\u001b[39m').message; + } + if (rootPackageJsonContent.module) { + rootPackageJsonContent.main = rootPackageJsonContent.module; + } + if (rootPackageJsonContent && rootPackageJsonContent.main) { + let mainEntryPath = path.resolve(rootPackageJsonPath, '../', rootPackageJsonContent.main); + if (path.extname(mainEntryPath)==='') { + if (fs.existsSync(mainEntryPath+'.ets')) { + mainEntryPath = mainEntryPath+'.ets' + } else if (fs.existsSync(mainEntryPath+'.ts')) { + mainEntryPath = mainEntryPath+'.ts' + } else if (fs.existsSync(mainEntryPath+'.js')) { + mainEntryPath = mainEntryPath+'.js' + } + } + if (fs.existsSync(mainEntryPath)) { + projectConfig.entryObj[path.relative(projectConfig.projectPath, mainEntryPath)] = mainEntryPath; + } else { + throw Error('\u001b[31m'+ + 'not find file declared of main in package.json.' + + '\u001b[39m').message; + } + } else if (rootPackageJsonContent && !rootPackageJsonContent.main) { + let mainEntryPath = path.resolve(rootPackageJsonPath, '../', rootPackageJsonContent.main); + if (fs.existsSync(path.join(mainEntryPath, 'index.ets'))) { + mainEntryPath = path.join(mainEntryPath, 'index.ets') + } else if (fs.existsSync(path.join(mainEntryPath, 'index.ts'))) { + mainEntryPath = path.join(mainEntryPath, 'index.ts') + } else if (fs.existsSync(path.join(mainEntryPath, 'index.js'))) { + mainEntryPath = path.join(mainEntryPath, 'index.js') + } else { + throw Error('\u001b[31m'+ + 'lack main in package.json.' + + '\u001b[39m').message; + } + projectConfig.entryObj[path.relative(projectConfig.projectPath, mainEntryPath)] = mainEntryPath; + } else { + throw Error('\u001b[31m'+ + 'lack message in package.json.' + + '\u001b[39m').message; + } + } +} + +function getEntryPath(entryPath, rootPackageJsonPath) { + let mainEntryPath = path.resolve(rootPackageJsonPath, '../', entryPath); + if (fs.statSync(mainEntryPath).isDirectory()) { + if (fs.existsSync(path.join(mainEntryPath, 'index.ets'))) { + mainEntryPath = path.join(mainEntryPath, 'index.ets'); + } else if (fs.existsSync(path.join(mainEntryPath, 'index.ts'))) { + mainEntryPath = path.join(mainEntryPath, 'index.ts'); + } else if (fs.existsSync(path.join(mainEntryPath, 'index.js'))) { + mainEntryPath = path.join(mainEntryPath, 'index.js'); + } + } else { + if (path.extname(mainEntryPath) === '') { + if (fs.existsSync(mainEntryPath + '.ets')) { + mainEntryPath = mainEntryPath + '.ets'; + } else if (fs.existsSync(mainEntryPath + '.ts')) { + mainEntryPath = mainEntryPath + '.ts'; + } else if (fs.existsSync(mainEntryPath + '.js')) { + mainEntryPath = mainEntryPath + '.js'; + } + } + } + if (fs.existsSync(mainEntryPath)) { + projectConfig.entryObj[path.relative(projectConfig.projectPath, mainEntryPath)] = mainEntryPath; + } else { + throw Error('\u001b[31m' + 'not find entry file in package.json.' + '\u001b[39m').message; + } +} + function getPages(configJson) { const pages = [] const pagesJsonFileName = `${configJson.module.pages.replace(/\$profile\:/, '')}.json`; @@ -477,6 +578,10 @@ function loadModuleInfo(projectConfig, envArgs) { projectConfig.nodeModulesPath = buildJsonInfo.nodeModulesPath; projectConfig.harNameOhmMap = buildJsonInfo.harNameOhmMap; } + if (projectConfig.compileHar && buildJsonInfo.moduleName && + buildJsonInfo.modulePathMap[buildJsonInfo.moduleName]) { + projectConfig.moduleRootPath = buildJsonInfo.modulePathMap[buildJsonInfo.moduleName]; + } } } diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 2be1be8..5924ec8 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -36,13 +36,17 @@ import { circularFile, mkDir, writeFileSync, - parseErrorMessage + parseErrorMessage, + generateSourceFilesInHar } from './utils'; import { MODULE_ETS_PATH, MODULE_SHARE_PATH, BUILD_SHARE_PATH, - ESMODULE + ESMODULE, + JSBUNDLE, + EXTNAME_JS, + EXTNAME_JS_MAP } from './pre_define'; import { createLanguageService, @@ -94,6 +98,7 @@ interface NeedUpdateFlag { flag: boolean; } +export const allResolvedModules: Set = new Set(); export let hotReloadSupportFiles: Set = new Set(); export let cache: Cache = {}; export const shouldResolvedFiles: Set = new Set() @@ -126,6 +131,17 @@ export class ResultStates { public apply(compiler: Compiler): void { compiler.hooks.compilation.tap('SourcemapFixer', compilation => { + compilation.hooks.processAssets.tap('RemoveHar', (assets) => { + if (!projectConfig.compileHar) { + return; + } + Object.keys(compilation.assets).forEach(key => { + if (path.extname(key) === EXTNAME_JS || path.extname(key) === EXTNAME_JS_MAP) { + delete assets[key]; + } + }); + }); + compilation.hooks.afterProcessAssets.tap('SourcemapFixer', assets => { Reflect.ownKeys(assets).forEach(key => { if (/\.map$/.test(key.toString()) && assets[key]._value) { @@ -282,6 +298,22 @@ export class ResultStates { "fileList": cache }, null, 2)); } + if (projectConfig.compileHar || projectConfig.compileShared) { + [...allResolvedModules, ...rootFileNames].forEach(moduleFile => { + if (!(moduleFile.match(/node_modules/) && projectConfig.compileHar)) { + try { + const emit: any = languageService.getEmitOutput(moduleFile, true, true); + if (emit.outputFiles[0]) { + generateSourceFilesInHar(moduleFile, emit.outputFiles[0].text, '.d' + path.extname(moduleFile)); + } else { + console.warn(this.yellow, + "ArkTS:WARN doesn't generate .d"+path.extname(moduleFile) + " for " + moduleFile, this.reset); + } + } catch(err) { + } + } + }) + } } }); diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index f209c55..ab3167b 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -34,7 +34,9 @@ import { $$, PROPERTIES_ADD_DOUBLE_DOLLAR, $$_BLOCK_INTERFACE, - COMPONENT_EXTEND_DECORATOR + COMPONENT_EXTEND_DECORATOR, + EXTNAME_D_ETS, + EXTNAME_JS } from './pre_define'; import { getName } from './process_component_build'; import { INNER_COMPONENT_NAMES } from './component_map'; @@ -43,7 +45,8 @@ import { CacheFileName, cache, shouldResolvedFiles, - hotReloadSupportFiles + hotReloadSupportFiles, + allResolvedModules } from './compile_info'; import { hasDecorator } from './utils'; import { isExtendFunction, isOriginalExtend } from './process_ui_syntax'; @@ -143,7 +146,18 @@ function resolveModuleNames(moduleNames: string[], containingFile: string): ts.R } }); if (result.resolvedModule) { - resolvedModules.push(result.resolvedModule); + if (result.resolvedModule.resolvedFileName && + path.extname(result.resolvedModule.resolvedFileName) === EXTNAME_JS) { + const resultDETSPath: string = + result.resolvedModule.resolvedFileName.replace(EXTNAME_JS, EXTNAME_D_ETS); + if (ts.sys.fileExists(resultDETSPath)) { + resolvedModules.push(getResolveModule(resultDETSPath, EXTNAME_D_ETS)); + } else { + resolvedModules.push(result.resolvedModule); + } + } else { + resolvedModules.push(result.resolvedModule); + } } else if (/^@(system|ohos)\./i.test(moduleName.trim())) { const modulePath: string = path.resolve(__dirname, '../../../api', moduleName + '.d.ts'); if (systemModules.includes(moduleName + '.d.ts') && ts.sys.fileExists(modulePath)) { @@ -151,7 +165,7 @@ function resolveModuleNames(moduleNames: string[], containingFile: string): ts.R } else { resolvedModules.push(null); } - } else if (/\.ets$/.test(moduleName)) { + } else if (/\.ets$/.test(moduleName) && !/\.d\.ets$/.test(moduleName)) { const modulePath: string = path.resolve(path.dirname(containingFile), moduleName); if (ts.sys.fileExists(modulePath)) { resolvedModules.push(getResolveModule(modulePath, '.ets')); @@ -171,20 +185,40 @@ function resolveModuleNames(moduleNames: string[], containingFile: string): ts.R const jsModulePath: string = path.resolve(__dirname, '../node_modules', moduleName + suffix); const fileModulePath: string = path.resolve(__dirname, '../node_modules', moduleName + '/index.js'); + const DETSModulePath: string = path.resolve(path.dirname(containingFile), + /\.d\.ets$/.test(moduleName) ? moduleName : moduleName + EXTNAME_D_ETS); if (ts.sys.fileExists(modulePath)) { resolvedModules.push(getResolveModule(modulePath, '.d.ts')); } else if (ts.sys.fileExists(jsModulePath)) { resolvedModules.push(getResolveModule(jsModulePath, '.js')); } else if (ts.sys.fileExists(fileModulePath)) { resolvedModules.push(getResolveModule(fileModulePath, '.js')); + } else if (ts.sys.fileExists(DETSModulePath)) { + resolvedModules.push(getResolveModule(DETSModulePath, '.d.ets')); } else { - resolvedModules.push(null); + const srcIndex: number = projectConfig.projectPath.indexOf('src' + path.sep + 'main'); + let DETSModulePathFromModule: string; + if (srcIndex > 0) { + DETSModulePathFromModule = path.resolve( + projectConfig.projectPath.substring(0, srcIndex), moduleName + path.sep + 'index' + EXTNAME_D_ETS); + if (DETSModulePathFromModule && ts.sys.fileExists(DETSModulePathFromModule)) { + resolvedModules.push(getResolveModule(DETSModulePathFromModule, '.d.ets')); + } else { + resolvedModules.push(null); + } + } else { + resolvedModules.push(null); + } } } if (projectConfig.hotReload && resolvedModules.length && resolvedModules[resolvedModules.length - 1]) { hotReloadSupportFiles.add(path.resolve(resolvedModules[resolvedModules.length - 1].resolvedFileName)); } + if ((projectConfig.compileHar || projectConfig.compileShared) && resolvedModules[resolvedModules.length - 1] && + path.resolve(resolvedModules[resolvedModules.length - 1].resolvedFileName).match(/(\.[^d]|[^\.]d|[^\.][^d])\.e?ts$/)) { + allResolvedModules.add(resolvedModules[resolvedModules.length - 1].resolvedFileName); + } } if (!projectConfig.xtsMode) { createOrUpdateCache(resolvedModules, containingFile); diff --git a/compiler/src/process_har_writejs.ts b/compiler/src/process_har_writejs.ts new file mode 100644 index 0000000..77d04b6 --- /dev/null +++ b/compiler/src/process_har_writejs.ts @@ -0,0 +1,21 @@ +/* + * 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 { generateSourceFilesInHar } from './utils'; + +module.exports = function writejsfile(source: string): string { + generateSourceFilesInHar(this.resourcePath, source, '.js'); + return source; +}; diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index aba8db9..48e9466 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -516,7 +516,8 @@ function isPackageJsonEntry(filePath: string): boolean { } function getPackageJsonEntry(filePath: string): string { - return path.join(filePath, JSON.parse(fs.readFileSync(path.join(filePath, PACKAGE_JSON)).toString()).main); + let packageJson: Object = JSON.parse(fs.readFileSync(path.join(filePath, PACKAGE_JSON)).toString()); + return path.join(filePath, packageJson.types ? packageJson.types : packageJson.main); } function getModuleFilePath(filePath: string): string { diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index a2ae1a4..969dd3a 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -398,13 +398,19 @@ function getResourceDataNode(node: ts.CallExpression, } const resourceValue: number = resources[resourceData[0]][resourceData[1]][resourceData[2]]; return createResourceParam(resourceValue, resourceType, - Array.from(node.arguments).slice(1)); + projectConfig.compileHar ? Array.from(node.arguments) : Array.from(node.arguments).slice(1)); } return node; } function createResourceParam(resourceValue: number, resourceType: number, argsArr: ts.Expression[]): ts.ObjectLiteralExpression { + if (projectConfig.compileHar) { + projectConfig.bundleName = ''; + projectConfig.moduleName = ''; + resourceValue = -1; + } + const propertyArray: Array = [ ts.factory.createPropertyAssignment( ts.factory.createStringLiteral(RESOURCE_NAME_ID), diff --git a/compiler/src/result_process.ts b/compiler/src/result_process.ts index 094ae07..26444cd 100644 --- a/compiler/src/result_process.ts +++ b/compiler/src/result_process.ts @@ -29,7 +29,8 @@ import { LogInfo, emitLogInfo, componentInfo, - generateSourceFilesToTemporary + generateSourceFilesToTemporary, + generateSourceFilesInHar } from './utils'; import { resetComponentCollection } from './validate_ui_syntax'; import { abilityConfig, projectConfig } from '../main'; @@ -70,9 +71,13 @@ module.exports = function resultProcess(source: string, map: any): void { } if (projectConfig.compileMode == ESMODULE && projectConfig.processTs === false - && process.env.compilerType && process.env.compilerType === 'ark') { + && process.env.compilerType && process.env.compilerType === 'ark' && !projectConfig.compileHar) { generateSourceFilesToTemporary(this.resourcePath, source, map); } + if (projectConfig.compileHar) { + generateSourceFilesInHar(this.resourcePath, source, '.js'); + } + this.callback(null, source, map); }; diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index bee8a7a..12061d4 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -17,6 +17,8 @@ import path from 'path'; import ts from 'typescript'; import fs from 'fs'; import os from 'os'; +import uglifyJS from 'uglify-js'; + import { projectConfig } from '../main'; import { createHash } from 'crypto'; import { processSystemApi } from './validate_ui_syntax'; @@ -270,7 +272,8 @@ export function writeFileSync(filePath: string, content: string): void { fs.writeFileSync(filePath, content); } -export function genTemporaryPath(filePath: string, projectPath: string, buildPath: string): string { +export function genTemporaryPath(filePath: string, projectPath: string, buildPath: string, + buildInHar: boolean = false): string { filePath = toUnixPath(filePath); if (filePath.endsWith(EXTNAME_MJS)) { filePath = filePath.replace(/\.mjs$/, EXTNAME_JS); @@ -287,16 +290,17 @@ export function genTemporaryPath(filePath: string, projectPath: string, buildPat const hapPath: string = toUnixPath(projectConfig.projectRootPath); const tempFilePath: string = filePath.replace(hapPath, ''); const sufStr: string = tempFilePath.substring(tempFilePath.indexOf(NODE_MODULES) + NODE_MODULES.length + 1); - output = path.join(buildPath, TEMPORARY, NODE_MODULES, MAIN, sufStr); + output = path.join(buildPath, buildInHar ? '' : TEMPORARY, NODE_MODULES, MAIN, sufStr); } else { - output = filePath.replace(fakeNodeModulesPath, path.join(buildPath, TEMPORARY, NODE_MODULES, AUXILIARY)); + output = filePath.replace(fakeNodeModulesPath, + path.join(buildPath, buildInHar ? '' : TEMPORARY, NODE_MODULES, AUXILIARY)); } return output; } if (filePath.indexOf(projectPath) !== -1) { const sufStr: string = filePath.replace(projectPath, ''); - const output: string = path.join(buildPath, TEMPORARY, sufStr); + const output: string = path.join(buildPath, buildInHar ? '' : TEMPORARY, sufStr); return output; } @@ -460,6 +464,20 @@ function replaceRelativeDependency(item:string, moduleRequest: string, sourcePat return item; } +export function generateSourceFilesInHar(sourcePath: string, sourceContent: string, suffix: string) { + let jsFilePath: string = genTemporaryPath(sourcePath, + projectConfig.compileShared ? projectConfig.projectRootPath : projectConfig.moduleRootPath, + path.resolve(projectConfig.buildPath, projectConfig.compileShared ? '../etsFortgz' : ''), true); + if (!jsFilePath.match(/node_modules/)) { + jsFilePath = jsFilePath.replace(/\.ets$/, suffix).replace(/\.ts$/, suffix); + mkdirsSync(path.dirname(jsFilePath)); + if (projectConfig.obfuscateHarType === 'uglify' && suffix === '.js') { + sourceContent = uglifyJS.minify(sourceContent).code; + } + fs.writeFileSync(jsFilePath, sourceContent); + } +} + function replaceHarDependency(item:string, moduleRequest: string): string { if (projectConfig.harNameOhmMap) { // case1: "@ohos/lib" ---> "@module:lib/ets/index" diff --git a/compiler/test/ut/render_decorator/@builder/@builder.ts b/compiler/test/ut/render_decorator/@builder/@builder.ts index ead282e..ad993f9 100644 --- a/compiler/test/ut/render_decorator/@builder/@builder.ts +++ b/compiler/test/ut/render_decorator/@builder/@builder.ts @@ -147,13 +147,13 @@ let __generate__Id = 0; function generateId() { return "@builder_" + ++__generate__Id; } -function noParam(parent = undefined) { +function noParam(parent = null) { Row.create(); Text.create('this is a no param builder'); Text.pop(); Row.pop(); } -function specificParam(label1, label2, parent = undefined) { +function specificParam(label1, label2, parent = null) { Column.create(); Text.create(label1); Text.pop(); @@ -190,12 +190,12 @@ class MyComponent extends View { set hideBar(newValue) { this.__hideBar.set(newValue); } - textBuilder(parent = undefined) { + textBuilder(parent = null) { Text.create("文本"); Text.fontSize(30); Text.pop(); } - NavigationTitlePara(label, parent = undefined) { + NavigationTitlePara(label, parent = null) { Column.create(); Text.create(label); Text.width(80); @@ -203,7 +203,7 @@ class MyComponent extends View { Text.pop(); Column.pop(); } - MenuBuilder(parent = undefined) { + MenuBuilder(parent = null) { Flex.create({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }); Flex.width(100); Text.create('Test menu item 1'); diff --git a/compiler/test/ut/render_decorator/@builder/@builderWithLinkData.ts b/compiler/test/ut/render_decorator/@builder/@builderWithLinkData.ts index 88cc765..a5d64b5 100644 --- a/compiler/test/ut/render_decorator/@builder/@builderWithLinkData.ts +++ b/compiler/test/ut/render_decorator/@builder/@builderWithLinkData.ts @@ -87,7 +87,7 @@ class TestPage extends View { set value(newValue) { this.__value.set(newValue); } - TitleCompView(parent = undefined) { + TitleCompView(parent = null) { let earlierCreatedChild_2 = ((parent ? parent : this) && (parent ? parent : this).findChildById) ? (parent ? parent : this).findChildById(generateId()) : undefined; if (earlierCreatedChild_2 == undefined) { View.create(new TitleComp("@builderWithLinkData_" + __generate__Id, parent ? parent : this, { title: this.__value })); diff --git a/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts b/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts index e4e191b..a7b4d13 100644 --- a/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts +++ b/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts @@ -162,7 +162,7 @@ class CustomContainer2 extends View { Column.pop(); } } -function specificWithParam(label1, label2, parent = undefined) { +function specificWithParam(label1, label2, parent = null) { Column.create(); Text.create(label1); Text.fontSize(50); @@ -193,14 +193,14 @@ class CustomContainerUser extends View { set text(newValue) { this.__text.set(newValue); } - specificParam(parent = undefined) { + specificParam(parent = null) { Column.create(); Text.create("content"); Text.fontSize(50); Text.pop(); Column.pop(); } - callSpecificParam(label1, label2, parent = undefined) { + callSpecificParam(label1, label2, parent = null) { Column.create(); Text.create(label1); Text.fontSize(50); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts index ff93496..52cfc5b 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts @@ -143,7 +143,7 @@ struct MyComponent { ` exports.expectResult = `"use strict"; -function noParam(parent = undefined) { +function noParam(parent = null) { (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Row.create(); @@ -163,7 +163,7 @@ function noParam(parent = undefined) { Text.pop(); Row.pop(); } -function specificParam(label1, label2, parent = undefined) { +function specificParam(label1, label2, parent = null) { (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Column.create(); @@ -227,7 +227,7 @@ class MyComponent extends ViewPU { set hideBar(newValue) { this.__hideBar.set(newValue); } - textBuilder(parent = undefined) { + textBuilder(parent = null) { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Text.create("文本"); @@ -239,7 +239,7 @@ class MyComponent extends ViewPU { }); Text.pop(); } - NavigationTitlePara(label, parent = undefined) { + NavigationTitlePara(label, parent = null) { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Column.create(); @@ -261,7 +261,7 @@ class MyComponent extends ViewPU { Text.pop(); Column.pop(); } - MenuBuilder(parent = undefined) { + MenuBuilder(parent = null) { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Flex.create({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts index b7b7afd..bcff54b 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts @@ -44,7 +44,7 @@ struct child{ exports.expectResult = `"use strict"; -function myBuilder(parent = undefined) { +function myBuilder(parent = null) { { (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); @@ -73,7 +73,7 @@ class Index extends ViewPU { SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } - Builder1(parent = undefined) { + Builder1(parent = null) { { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts index 245b6f4..784ac7d 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts @@ -105,7 +105,7 @@ class TestPage extends ViewPU { set value(newValue) { this.__value.set(newValue); } - TitleCompView(parent = undefined) { + TitleCompView(parent = null) { { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts b/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts index ef18ed7..9742eed 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts @@ -209,7 +209,7 @@ class CustomContainer2 extends ViewPU { this.updateDirtyElements(); } } -function specificWithParam(label1, label2, parent = undefined) { +function specificWithParam(label1, label2, parent = null) { (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Column.create(); @@ -267,7 +267,7 @@ class CustomContainerUser extends ViewPU { set text(newValue) { this.__text.set(newValue); } - specificParam(parent = undefined) { + specificParam(parent = null) { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Column.create(); @@ -288,7 +288,7 @@ class CustomContainerUser extends ViewPU { Text.pop(); Column.pop(); } - callSpecificParam(label1, label2, parent = undefined) { + callSpecificParam(label1, label2, parent = null) { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Column.create(); diff --git a/compiler/tsconfig.esm.json b/compiler/tsconfig.esm.json index 04c2dd3..77671db 100644 --- a/compiler/tsconfig.esm.json +++ b/compiler/tsconfig.esm.json @@ -1,7 +1,85 @@ { "compileOnSave": false, "compilerOptions": { - "ets": { + "ets": { + "emitDecorators":[ + { + "name":"Entry", + "emitParameters" : false + }, + { + "name":"Component", + "emitParameters" : false + }, + { + "name":"Preview", + "emitParameters" : false + }, + { + "name":"CustomDialog", + "emitParameters" : false + }, + { + "name":"Consume", + "emitParameters" : false + }, + { + "name":"Link", + "emitParameters" : false + }, + { + "name":"LocalStorageLink", + "emitParameters" : false + }, + { + "name":"LocalStorageProp", + "emitParameters" : false + }, + { + "name":"ObjectLink", + "emitParameters" : false + }, + { + "name":"Prop", + "emitParameters" : false + }, + { + "name":"Provide", + "emitParameters" : false + }, + { + "name":"State", + "emitParameters" : false + }, + { + "name":"StorageLink", + "emitParameters" : false + }, + { + "name":"StorageProp", + "emitParameters" : false + }, + { + "name":"Watch", + "emitParameters" : false + }, + { + "name":"Builder", + "emitParameters" : false + }, + { + "name":"BuilderParam", + "emitParameters" : false + }, + { + "name":"Styles", + "emitParameters" : false + }, + { + "name":"Observed", + "emitParameters" : false + } + ], "propertyDecorators": [ { "name": "Link", diff --git a/compiler/tsconfig.json b/compiler/tsconfig.json index da14aae..b4b3e38 100644 --- a/compiler/tsconfig.json +++ b/compiler/tsconfig.json @@ -1,7 +1,85 @@ { "compileOnSave": false, "compilerOptions": { - "ets": { + "ets": { + "emitDecorators":[ + { + "name":"Entry", + "emitParameters" : false + }, + { + "name":"Component", + "emitParameters" : false + }, + { + "name":"Preview", + "emitParameters" : false + }, + { + "name":"CustomDialog", + "emitParameters" : false + }, + { + "name":"Consume", + "emitParameters" : false + }, + { + "name":"Link", + "emitParameters" : false + }, + { + "name":"LocalStorageLink", + "emitParameters" : false + }, + { + "name":"LocalStorageProp", + "emitParameters" : false + }, + { + "name":"ObjectLink", + "emitParameters" : false + }, + { + "name":"Prop", + "emitParameters" : false + }, + { + "name":"Provide", + "emitParameters" : false + }, + { + "name":"State", + "emitParameters" : false + }, + { + "name":"StorageLink", + "emitParameters" : false + }, + { + "name":"StorageProp", + "emitParameters" : false + }, + { + "name":"Watch", + "emitParameters" : false + }, + { + "name":"Builder", + "emitParameters" : false + }, + { + "name":"BuilderParam", + "emitParameters" : false + }, + { + "name":"Styles", + "emitParameters" : false + }, + { + "name":"Observed", + "emitParameters" : false + } + ], "propertyDecorators": [ { "name": "Link", diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index b1358c2..324d737 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -100,7 +100,7 @@ function initConfig(config) { }, resolve: { symlinks: projectConfig.compileMode === 'esmodule' ? false : true, - extensions: ['.js', '.ets', '.ts', '.d.ts'], + extensions: ['.js', '.ets', '.ts', '.d.ts', '.d.ets'], modules: [ projectPath, './node_modules', @@ -169,6 +169,9 @@ function setJsConfigRule() { } else { jsRule.resolve = { fullySpecified: false }; } + if (projectConfig.compileHar) { + jsRule.use.unshift({ loader: path.resolve(__dirname, 'lib/process_har_writejs.js')}); + } return jsRule; } @@ -439,7 +442,7 @@ module.exports = (env, argv) => { if (env.isPreview !== "true") { loadWorker(projectConfig, workerFile); - if (env.compilerType && env.compilerType === 'ark') { + if (env.compilerType && env.compilerType === 'ark' && !projectConfig.compileHar) { setGenAbcPlugin(env, config); } } else { @@ -457,6 +460,10 @@ module.exports = (env, argv) => { } } + if (projectConfig.compileHar && env.obfuscate === 'uglify') { + projectConfig.obfuscateHarType = 'uglify'; + } + if (env.sourceMap === 'none') { config.devtool = false; } @@ -465,6 +472,12 @@ module.exports = (env, argv) => { setReleaseConfig(config); } + if (projectConfig.compileMode === 'esmodule') { + for (const harName in (projectConfig.harNameOhmMap || {})) { + config.externals[harName] = RegExp("^("+harName+")($|\/\S+)"); + } + } + const appResourcePath = env.appResource || process.env.appResource; checkAppResourcePath(appResourcePath, config); setCopyPluginConfig(config, appResourcePath, env.isPreview); -- Gitee From d70f4c6b0aba1eec54221a39346186a1c562a8c4 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Thu, 29 Dec 2022 15:26:52 +0800 Subject: [PATCH 259/379] Fix entry of npm resovle Issue: I6819H Signed-off-by: zhangrengao Change-Id: I045a789412bb603939cd5ea684b54e256e999bf0 --- compiler/src/gen_abc_plugin.ts | 37 +++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 50d6dd5..2e175e8 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -275,6 +275,15 @@ function getEntryInfo(filePath: string, resourceResolveData: any): string { if (!resourceResolveData.descriptionFilePath) { return; } + + let isEntry: boolean = false; + let mainFileds: Set = getEntryCandidatesFromPackageJson(resourceResolveData); + for (let value of mainFileds.values()) { + if (toUnixPath(filePath) === value) { + isEntry = true; + break; + } + } const packageJsonPath: string = resourceResolveData.descriptionFilePath; let npmInfoPath: string = path.resolve(packageJsonPath, '..'); @@ -288,7 +297,7 @@ function getEntryInfo(filePath: string, resourceResolveData: any): string { const buildFakeEntryPath: string = genBuildPath(fakeEntryPath, projectConfig.projectPath, projectConfig.buildPath); npmInfoPath = toUnixPath(path.resolve(tempFakeEntryPath, '..')); const buildNpmInfoPath: string = toUnixPath(path.resolve(buildFakeEntryPath, '..')); - if (!entryInfos.has(npmInfoPath)) { + if (!entryInfos.has(npmInfoPath) && isEntry) { const entryInfo: EntryInfo = new EntryInfo(npmInfoPath, buildNpmInfoPath, entry); entryInfos.set(npmInfoPath, entryInfo); } @@ -296,6 +305,32 @@ function getEntryInfo(filePath: string, resourceResolveData: any): string { return buildNpmInfoPath; } +function getEntryCandidatesFromPackageJson(resourceResolveData: any): Set{ + let descriptionFileData: any = resourceResolveData.descriptionFileData; + let packagePath: string = path.resolve(resourceResolveData.descriptionFilePath, '..'); + let mainFileds: Set = new Set(); + if (descriptionFileData.browser) { + if (typeof descriptionFileData.browser === 'string') { + mainFileds.add(toUnixPath(path.join(packagePath, descriptionFileData.browser))); + } else { + Object.keys(descriptionFileData.browser).forEach(key => { + mainFileds.add(toUnixPath(path.join(packagePath, descriptionFileData.browser[key]))); + }); + } + } + if (descriptionFileData.module) { + mainFileds.add(toUnixPath(path.join(packagePath, descriptionFileData.module))); + } + if (descriptionFileData.main) { + mainFileds.add(toUnixPath(path.join(packagePath, descriptionFileData.main))); + } + if (mainFileds.size === 0) { + mainFileds.add(toUnixPath(path.join(packagePath, 'index.js'))); + } + + return mainFileds; +} + function processNodeModulesFile(filePath: string, tempFilePath: string, buildFilePath: string, abcFilePath: string, nodeModulesFile: Array, module: any): void { let npmPkgPath: string = getEntryInfo(filePath, module.resourceResolveData); const buildNpmPkgPath: string = npmPkgPath.replace(toUnixPath(projectConfig.nodeModulesPath), ''); -- Gitee From d943f65888a99320bf1abf1757e717b75aa636e8 Mon Sep 17 00:00:00 2001 From: zhouzebin Date: Sat, 24 Dec 2022 17:23:54 +0800 Subject: [PATCH 260/379] support AOT compile Issue: https://gitee.com/openharmony/developtools_ace_ets2bundle/issues/I67BVM Signed-off-by: zhouzebin Change-Id: I6dbd1187cc0a302b40ac4ab0ba86f7bc51ed888a --- compiler/main.js | 2 + compiler/src/gen_abc_plugin.ts | 9 ++++ compiler/src/gen_aot.ts | 96 ++++++++++++++++++++++++++++++++++ compiler/src/utils.ts | 25 ++++++++- 4 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 compiler/src/gen_aot.ts diff --git a/compiler/main.js b/compiler/main.js index d5b1ebc..d0e8a05 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -468,6 +468,8 @@ function loadModuleInfo(projectConfig, envArgs) { if (projectConfig.aotMode && projectConfig.compileMode === 'esmodule') { projectConfig.processTs = true; projectConfig.pandaMode = TS2ABC; + projectConfig.anBuildMode = buildJsonInfo.anBuildMode || "type"; + projectConfig.anBuildOutPut = buildJsonInfo.anBuildOutPut; } else { projectConfig.processTs = false; projectConfig.pandaMode = buildJsonInfo.pandaMode; diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 32d3367..0f9a610 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -82,6 +82,10 @@ import { generateMergedAbc, generateNpmEntriesInfo } from './gen_merged_abc'; +import { + generateAot, + generateBuiltinAbc +} from './gen_aot' let output: string; let isWin: boolean = false; @@ -1262,6 +1266,11 @@ function processWorkersOfBuildMode(splittedData: any, cmdPrefix: string, workerN process.on('exit', (code) => { if (process.exitCode !== FAIL && process.env.watchMode !== 'true') { processExtraAsset(); + if (projectConfig.compileMode === ESMODULE && + (projectConfig.anBuildMode === 'full' || projectConfig.anBuildMode === 'pgo')) { + const builtinAbcPath: string = generateBuiltinAbc(arkDir, nodeJs, initAbcEnv()); + generateAot(arkDir, builtinAbcPath); + } } }); } diff --git a/compiler/src/gen_aot.ts b/compiler/src/gen_aot.ts new file mode 100644 index 0000000..5212d68 --- /dev/null +++ b/compiler/src/gen_aot.ts @@ -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 * as childProcess from 'child_process'; +import * as process from 'process'; +import * as fs from 'fs'; +import * as path from 'path'; +import { projectConfig } from '../main'; +import { logger } from './compile_info'; +import { + SUCCESS, + FAIL, + MODULES_ABC, + TEMPORARY +} from './pre_define'; +import { + isWindows, + mkdirsSync, + toUnixPath, + getArkBuildDir, + getBuildBinDir, + validateFilePathLengths +} from './utils'; + +const red: string = '\u001b[31m'; +const reset: string = '\u001b[39m'; + +export function generateAot(arkDir: string, builtinAbcPath: string): void { + let aotCompiler: string = path.join(getBuildBinDir(arkDir), isWindows() ? "ark_aot_compiler.exe" : "ark_aot_compiler"); + const appAbc: string = path.relative(process.cwd(), path.join(projectConfig.buildPath, MODULES_ABC)); + const appAot: string = path.relative(process.cwd(), path.join(projectConfig.anBuildOutPut, projectConfig.moduleName)); + const profile: string = path.relative(process.cwd(), path.join(projectConfig.buildPath, "..", "profile.aprof")); + + if (!validateFilePathLengths([aotCompiler, appAbc, builtinAbcPath, appAot, profile])) { + logger.error(reset, `ArkTS:ERROR generateAot failed. Invalid file path.`); + return; + } + const singleCmdPrefix: string = `"${aotCompiler}" --builtins-dts="${path.relative(process.cwd(), builtinAbcPath)}" --aot-file="${appAot}"`; + let singleCmd: string = ""; + if (projectConfig.anBuildMode === "full") { + singleCmd = singleCmdPrefix + ` "${appAbc}"`; + } else if (projectConfig.anBuildMode === "pgo") { + if (!fs.existsSync(profile)) { + logger.error(reset, `ArkTS:ERROR generateAot failed. PGO mode lost profile in "${profile}"`); + process.exit(FAIL); + } + singleCmd = singleCmdPrefix + ` --enable-pgo-profiler=true --pgo-profiler-path="${profile}" "${appAbc}"`; + } else { + logger.error(reset, `ArkTS:ERROR generateAot failed. unknown anBuildMode: ${projectConfig.anBuildMode}`); + process.exit(FAIL); + } + try { + logger.debug(`generateAot cmd: ${singleCmd}`); + mkdirsSync(projectConfig.anBuildOutPut); + childProcess.execSync(singleCmd); + } catch (e) { + logger.error(reset, `ArkTS:ERROR Failed to generate aot file. Error message: ${e}`); + process.exit(FAIL); + } +} + +export function generateBuiltinAbc(arkDir: string, nodeJs: string, abcArgs: string[]): string { + const builtinFilePath: string = path.join(getArkBuildDir(arkDir), "aot", "src", "lib_ark_builtins.d.ts"); + const builtinAbcPath: string = path.join(process.env.cachePath, TEMPORARY, "aot", "lib_ark_builtins.d.abc"); + if (fs.existsSync(builtinAbcPath)) { + logger.info(`builtin.d.abc already exists, no need to rebuild again`); + return builtinAbcPath; + } + mkdirsSync(path.dirname(builtinAbcPath)); + if (!validateFilePathLengths([builtinFilePath, builtinAbcPath])) { + logger.error(reset, `ArkTS:ERROR generateBuiltinAbc failed. Invalid file path.`); + process.exit(FAIL); + } + const tempAbcArgs: string[] = abcArgs.slice(0); + let singleCmd: string = `${nodeJs} ${tempAbcArgs.join(' ')} "${toUnixPath(builtinFilePath)}" -q -b -m --merge-abc -o "${builtinAbcPath}"`; + try { + logger.debug(`generateBuiltinAbc cmd: ${singleCmd}`); + childProcess.execSync(singleCmd); + } catch (e) { + logger.error(reset, `ArkTS:ERROR Failed to generate builtin to abc. Error message: ${e}`); + process.exit(FAIL); + } + return builtinAbcPath; +} diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index bee8a7a..b3ad20b 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -762,6 +762,15 @@ export function validateFilePathLength(filePath: string): boolean { } } +export function validateFilePathLengths(filePaths: Array): boolean { + filePaths.forEach((filePath) => { + if (!validateFilePathLength(filePath)) { + return false; + } + }) + return true; +} + export function buildCachePath(tailName: string): string { let pathName: string = process.env.cachePath !== undefined ? path.join(process.env.cachePath, tailName) : path.join(projectConfig.buildPath, tailName); @@ -776,6 +785,20 @@ export function unlinkSync(filePath: string): void { } } +export function getArkBuildDir(arkDir: string): string { + if (isWindows()) { + return path.join(arkDir, 'build-win'); + } else if (isMac()) { + return path.join(arkDir, 'build-mac'); + } else { + return path.join(arkDir, 'build'); + } +} + +export function getBuildBinDir(arkDir: string): string { + return path.join(getArkBuildDir(arkDir), 'bin'); +} + export function getExtension(filePath: string): string { if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) { return ""; @@ -793,4 +816,4 @@ export function getExtension(filePath: string): string { } return extension; -} \ No newline at end of file +} -- Gitee From a8ea84a09317ed40aace10d2718b642472ac5d18 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 3 Jan 2023 14:25:29 +0800 Subject: [PATCH 261/379] houhaoyu@huawei.com optimize compile har code Signed-off-by: houhaoyu Change-Id: I7c394ba04219d73b38306054170eccf23c305912 --- compiler/main.js | 125 +++++++++++----------------- compiler/src/compile_info.ts | 2 +- compiler/src/process_har_writejs.ts | 2 +- compiler/src/process_ui_syntax.ts | 4 +- 4 files changed, 54 insertions(+), 79 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 665c9a6..c2941ed 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -81,6 +81,8 @@ function initProjectConfig(projectConfig) { projectConfig.compileMode = projectConfig.compileMode || 'jsbundle'; projectConfig.runtimeOS = projectConfig.runtimeOS || process.env.runtimeOS || 'default'; projectConfig.sdkInfo = projectConfig.sdkInfo || process.env.sdkInfo || 'default'; + projectConfig.compileHar = false; + projectConfig.compileShared = false; } function loadEntryObj(projectConfig) { @@ -144,15 +146,25 @@ function buildManifest(manifest, aceConfigPath) { partialUpdateController(moduleConfigJson.module.metadata, moduleConfigJson.app.minAPIVersion); } - if (moduleConfigJson.module.type === 'har') { - projectConfig.compileHar = true; - getPackageJsonEntryPath(); - } else if (moduleConfigJson.module.type === 'shared') { - projectConfig.compileShared = true; - getPackageJsonEntryPath(); - getManifestPages(moduleConfigJson, manifest); + if (moduleConfigJson.module) { + switch (moduleConfigJson.module.type) { + case 'har': + projectConfig.compileHar = true; + getPackageJsonEntryPath(); + break; + case 'shared': + projectConfig.compileShared = true; + getPackageJsonEntryPath(); + manifest.pages = getPages(moduleConfigJson); + break; + default: + manifest.pages = getPages(moduleConfigJson); + break; + } } else { - getManifestPages(moduleConfigJson, manifest); + throw Error('\u001b[31m'+ + 'ERROR: the config.json file miss key word module || module[abilities].' + + '\u001b[39m').message; } } catch (e) { if (/BUIDERROR/.test(e)) { @@ -164,16 +176,6 @@ function buildManifest(manifest, aceConfigPath) { } } -function getManifestPages(moduleConfigJson, manifest) { - if (moduleConfigJson.module) { - manifest.pages = getPages(moduleConfigJson); - } else { - throw Error('\u001b[31m'+ - 'ERROR: the config.json file miss key word module || module[abilities].' + - '\u001b[39m').message; - } -} - function getPackageJsonEntryPath() { let rootPackageJsonPath = path.resolve(projectConfig.projectPath, '../../../package.json'); if (fs.existsSync(rootPackageJsonPath)) { @@ -189,79 +191,52 @@ function getPackageJsonEntryPath() { } else { throw Error('\u001b[31m'+ 'lack message in package.json.' + '\u001b[39m').message; } - if (rootPackageJsonContent.module) { - rootPackageJsonContent.main = rootPackageJsonContent.module; - } - if (rootPackageJsonContent && rootPackageJsonContent.main) { - let mainEntryPath = path.resolve(rootPackageJsonPath, '../', rootPackageJsonContent.main); - if (path.extname(mainEntryPath)==='') { - if (fs.existsSync(mainEntryPath+'.ets')) { - mainEntryPath = mainEntryPath+'.ets' - } else if (fs.existsSync(mainEntryPath+'.ts')) { - mainEntryPath = mainEntryPath+'.ts' - } else if (fs.existsSync(mainEntryPath+'.js')) { - mainEntryPath = mainEntryPath+'.js' - } - } - if (fs.existsSync(mainEntryPath)) { - projectConfig.entryObj[path.relative(projectConfig.projectPath, mainEntryPath)] = mainEntryPath; - } else { - throw Error('\u001b[31m'+ - 'not find file declared of main in package.json.' + - '\u001b[39m').message; - } - } else if (rootPackageJsonContent && !rootPackageJsonContent.main) { - let mainEntryPath = path.resolve(rootPackageJsonPath, '../', rootPackageJsonContent.main); - if (fs.existsSync(path.join(mainEntryPath, 'index.ets'))) { - mainEntryPath = path.join(mainEntryPath, 'index.ets') - } else if (fs.existsSync(path.join(mainEntryPath, 'index.ts'))) { - mainEntryPath = path.join(mainEntryPath, 'index.ts') - } else if (fs.existsSync(path.join(mainEntryPath, 'index.js'))) { - mainEntryPath = path.join(mainEntryPath, 'index.js') - } else { - throw Error('\u001b[31m'+ - 'lack main in package.json.' + - '\u001b[39m').message; - } - projectConfig.entryObj[path.relative(projectConfig.projectPath, mainEntryPath)] = mainEntryPath; - } else { - throw Error('\u001b[31m'+ - 'lack message in package.json.' + - '\u001b[39m').message; + } +} + +function supportSuffix(mainEntryPath) { + if (fs.existsSync(path.join(mainEntryPath, 'index.ets'))) { + mainEntryPath = path.join(mainEntryPath, 'index.ets'); + } else if (fs.existsSync(path.join(mainEntryPath, 'index.ts'))) { + mainEntryPath = path.join(mainEntryPath, 'index.ts'); + } else if (fs.existsSync(path.join(mainEntryPath, 'index.js'))) { + mainEntryPath = path.join(mainEntryPath, 'index.js'); + } else { + throw Error('\u001b[31m' + 'not find entry file in package.json.' + '\u001b[39m').message; + } + return mainEntryPath; +} + +function supportExtName(mainEntryPath) { + if (path.extname(mainEntryPath) === '') { + if (fs.existsSync(mainEntryPath + '.ets')) { + mainEntryPath = mainEntryPath + '.ets'; + } else if (fs.existsSync(mainEntryPath + '.ts')) { + mainEntryPath = mainEntryPath + '.ts'; + } else if (fs.existsSync(mainEntryPath + '.js')) { + mainEntryPath = mainEntryPath + '.js'; } } + return mainEntryPath; } function getEntryPath(entryPath, rootPackageJsonPath) { let mainEntryPath = path.resolve(rootPackageJsonPath, '../', entryPath); if (fs.statSync(mainEntryPath).isDirectory()) { - if (fs.existsSync(path.join(mainEntryPath, 'index.ets'))) { - mainEntryPath = path.join(mainEntryPath, 'index.ets'); - } else if (fs.existsSync(path.join(mainEntryPath, 'index.ts'))) { - mainEntryPath = path.join(mainEntryPath, 'index.ts'); - } else if (fs.existsSync(path.join(mainEntryPath, 'index.js'))) { - mainEntryPath = path.join(mainEntryPath, 'index.js'); - } + mainEntryPath = supportSuffix(mainEntryPath); } else { - if (path.extname(mainEntryPath) === '') { - if (fs.existsSync(mainEntryPath + '.ets')) { - mainEntryPath = mainEntryPath + '.ets'; - } else if (fs.existsSync(mainEntryPath + '.ts')) { - mainEntryPath = mainEntryPath + '.ts'; - } else if (fs.existsSync(mainEntryPath + '.js')) { - mainEntryPath = mainEntryPath + '.js'; - } - } + mainEntryPath = supportExtName(mainEntryPath); } if (fs.existsSync(mainEntryPath)) { - projectConfig.entryObj[path.relative(projectConfig.projectPath, mainEntryPath)] = mainEntryPath; + let entryKey = path.relative(projectConfig.projectPath, mainEntryPath); + projectConfig.entryObj[entryKey] = mainEntryPath; } else { throw Error('\u001b[31m' + 'not find entry file in package.json.' + '\u001b[39m').message; } } function getPages(configJson) { - const pages = [] + const pages = []; const pagesJsonFileName = `${configJson.module.pages.replace(/\$profile\:/, '')}.json`; const modulePagePath = path.resolve(projectConfig.aceProfilePath, pagesJsonFileName); if (fs.existsSync(modulePagePath)) { diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 5924ec8..4df4e91 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -306,7 +306,7 @@ export class ResultStates { if (emit.outputFiles[0]) { generateSourceFilesInHar(moduleFile, emit.outputFiles[0].text, '.d' + path.extname(moduleFile)); } else { - console.warn(this.yellow, + logger.warn(this.yellow, "ArkTS:WARN doesn't generate .d"+path.extname(moduleFile) + " for " + moduleFile, this.reset); } } catch(err) { diff --git a/compiler/src/process_har_writejs.ts b/compiler/src/process_har_writejs.ts index 77d04b6..230768d 100644 --- a/compiler/src/process_har_writejs.ts +++ b/compiler/src/process_har_writejs.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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 diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 969dd3a..be0e72a 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -426,14 +426,14 @@ function createResourceParam(resourceValue: number, resourceType: number, argsAr ) ]; - if (projectConfig.bundleName) { + if (projectConfig.bundleName || projectConfig.bundleName === '') { propertyArray.push(ts.factory.createPropertyAssignment( ts.factory.createStringLiteral(RESOURCE_NAME_BUNDLE), ts.factory.createStringLiteral(projectConfig.bundleName) )); } - if (projectConfig.moduleName) { + if (projectConfig.moduleName || projectConfig.moduleName === '') { propertyArray.push(ts.factory.createPropertyAssignment( ts.factory.createStringLiteral(RESOURCE_NAME_MODULE), ts.factory.createStringLiteral(projectConfig.moduleName) -- Gitee From 23e7ab3c9a30e7a4668befca502b82bcb0cc0c03 Mon Sep 17 00:00:00 2001 From: hufeng Date: Tue, 3 Jan 2023 14:23:14 +0800 Subject: [PATCH 262/379] Skip processing declaration files Signed-off-by: hufeng Change-Id: I6e452c36d22ac4c533c02843d6bf5ab0d16a7b1b --- compiler/src/gen_abc_plugin.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 32d3367..1bb8d91 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -50,6 +50,8 @@ import { JSBUNDLE, NODE_MODULES, ES2ABC, + EXTNAME_D_ETS, + EXTNAME_D_TS, EXTNAME_ETS, EXTNAME_JS, EXTNAME_TS, @@ -321,6 +323,10 @@ function processNodeModulesFile(filePath: string, tempFilePath: string, buildFil } function processEtsModule(filePath: string, tempFilePath: string, buildFilePath: string, nodeModulesFile: Array, module: any): void { + // skip declaration modules + if (filePath.endsWith(EXTNAME_D_ETS)) { + return; + } if (projectConfig.processTs === true) { tempFilePath = tempFilePath.replace(/\.ets$/, EXTNAME_TS); buildFilePath = buildFilePath.replace(/\.ets$/, EXTNAME_TS); @@ -340,6 +346,10 @@ function processEtsModule(filePath: string, tempFilePath: string, buildFilePath: } function processTsModule(filePath: string, tempFilePath: string, buildFilePath: string, nodeModulesFile: Array, module: any): void { + // skip declaration modules + if (filePath.endsWith(EXTNAME_D_TS)) { + return; + } if (projectConfig.processTs === false) { tempFilePath = tempFilePath.replace(/\.ts$/, EXTNAME_JS); buildFilePath = buildFilePath.replace(/\.ts$/, EXTNAME_JS); -- Gitee From 08d89b5a8c4f3f5418de61d1a9b4a1de9bacfe97 Mon Sep 17 00:00:00 2001 From: lihong Date: Thu, 29 Dec 2022 21:55:21 +0800 Subject: [PATCH 263/379] lihong67@huawei.com add split commons and vendors for stage mode. Signed-off-by: lihong Change-Id: I39e15dc410aba6a63eb541b022b177dff8b7d65c --- compiler/main.js | 14 ++++++++++++++ compiler/webpack.config.js | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index e8cced8..3905371 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -83,6 +83,7 @@ function initProjectConfig(projectConfig) { projectConfig.sdkInfo = projectConfig.sdkInfo || process.env.sdkInfo || 'default'; projectConfig.compileHar = false; projectConfig.compileShared = false; + projectConfig.splitCommon = false; } function loadEntryObj(projectConfig) { @@ -145,6 +146,7 @@ function buildManifest(manifest, aceConfigPath) { moduleConfigJson.app && moduleConfigJson.app.minAPIVersion) { partialUpdateController(moduleConfigJson.module.metadata, moduleConfigJson.app.minAPIVersion); + stageOptimization(moduleConfigJson.module.metadata); } if (moduleConfigJson.module) { switch (moduleConfigJson.module.type) { @@ -235,6 +237,18 @@ function getEntryPath(entryPath, rootPackageJsonPath) { } } +function stageOptimization(metadata) { + if (Array.isArray(metadata) && metadata.length) { + metadata.some(item => { + if (item.name && item.name === 'USE_COMMON_CHUNK' && + item.value && item.value === 'true') { + projectConfig.splitCommon = true; + return true; + } + }); + } +} + function getPages(configJson) { const pages = []; const pagesJsonFileName = `${configJson.module.pages.replace(/\$profile\:/, '')}.json`; diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 324d737..a1fcee7 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -233,7 +233,8 @@ function setProjectConfig(envArgs) { function setReleaseConfig(config) { const TerserPlugin = require('terser-webpack-plugin'); config.mode = 'production'; - if (process.env.compileMode !== 'moduleJson' && abilityConfig.abilityType === 'page') { + if ((process.env.compileMode !== 'moduleJson' || projectConfig.splitCommon) && + abilityConfig.abilityType === 'page') { config.optimization = config.optimization; } else { config.optimization = {}; @@ -328,7 +329,8 @@ function excludeWorker(workerFile, name) { } function setOptimizationConfig(config, workerFile) { - if (process.env.compileMode !== 'moduleJson' && abilityConfig.abilityType === 'page') { + if ((process.env.compileMode !== 'moduleJson' || projectConfig.splitCommon) && + abilityConfig.abilityType === 'page') { config.optimization = { splitChunks: { chunks(chunk) { -- Gitee From dd6c0349bc5d2160efea9a8c8d98b85c60528835 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Jan 2023 09:58:07 +0800 Subject: [PATCH 264/379] lizhouze@huawei.com Signed-off-by: unknown --- compiler/src/process_custom_component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index fad18a9..f001bec 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -428,7 +428,7 @@ function checkFromParentToChild(node: ts.ObjectLiteralElementLike, customCompone } } else { parentPropertyName = - getParentPropertyName(node as ts.PropertyAssignment, curPropertyKind, log); + getParentPropertyName(node as ts.PropertyAssignment, curPropertyKind, log) || propertyName; const parentPropertyKind = COMPONENT_NON_DECORATOR; if (!isCorrectInitFormParent(parentPropertyKind, curPropertyKind)) { validateIllegalInitFromParent( @@ -461,6 +461,9 @@ function isInitFromLocal(node: ts.ObjectLiteralElementLike): boolean { function getParentPropertyName(node: ts.PropertyAssignment, curPropertyKind: string, log: LogInfo[]): string { const initExpression: ts.Expression = node.initializer; + if (!initExpression) { + return undefined; + } let parentPropertyName: string = initExpression.getText(); if (curPropertyKind === COMPONENT_LINK_DECORATOR) { if (hasDollar(initExpression)) { -- Gitee From c74006046acf5db6e126e5d67ca2125562d9d0a5 Mon Sep 17 00:00:00 2001 From: zhouzebin Date: Wed, 4 Jan 2023 10:49:36 +0800 Subject: [PATCH 265/379] modify PGO path for AOT Issue: https://gitee.com/openharmony/developtools_ace_ets2bundle/issues/I68O3U?from=project-issue Signed-off-by: zhouzebin Change-Id: I5220df2a03acc358a30af863f4a538d3f359d5ea --- compiler/src/gen_aot.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/src/gen_aot.ts b/compiler/src/gen_aot.ts index 5212d68..a3908ca 100644 --- a/compiler/src/gen_aot.ts +++ b/compiler/src/gen_aot.ts @@ -23,7 +23,7 @@ import { SUCCESS, FAIL, MODULES_ABC, - TEMPORARY + TEMPORARY } from './pre_define'; import { isWindows, @@ -41,8 +41,9 @@ export function generateAot(arkDir: string, builtinAbcPath: string): void { let aotCompiler: string = path.join(getBuildBinDir(arkDir), isWindows() ? "ark_aot_compiler.exe" : "ark_aot_compiler"); const appAbc: string = path.relative(process.cwd(), path.join(projectConfig.buildPath, MODULES_ABC)); const appAot: string = path.relative(process.cwd(), path.join(projectConfig.anBuildOutPut, projectConfig.moduleName)); - const profile: string = path.relative(process.cwd(), path.join(projectConfig.buildPath, "..", "profile.aprof")); - + const profile: string = path.relative(process.cwd(), path.join( + projectConfig.modulePathMap[projectConfig.moduleName], "profile.aprof")); + if (!validateFilePathLengths([aotCompiler, appAbc, builtinAbcPath, appAot, profile])) { logger.error(reset, `ArkTS:ERROR generateAot failed. Invalid file path.`); return; -- Gitee From 5d22136dd9eb50914623d1110ee12007db2e4c54 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 4 Jan 2023 14:29:20 +0800 Subject: [PATCH 266/379] houhaoyu@huawei.com fix compileshared code Signed-off-by: houhaoyu Change-Id: Ieffda801f197289c29a33f18de59ca359c50aa6c --- compiler/webpack.config.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 324d737..88e3124 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -451,7 +451,7 @@ module.exports = (env, argv) => { setGenAbcPlugin(env, config); let port; process.argv.forEach((val, index) => { - if(val.startsWith('port=')){ + if (val.startsWith('port=')) { port = val.split('=')[1]; } }); @@ -472,9 +472,10 @@ module.exports = (env, argv) => { setReleaseConfig(config); } - if (projectConfig.compileMode === 'esmodule') { - for (const harName in (projectConfig.harNameOhmMap || {})) { - config.externals[harName] = RegExp("^("+harName+")($|\/\S+)"); + if (projectConfig.compileMode === 'esmodule' && projectConfig.harNameOhmMap) { + config.externals = []; + for (const harName in projectConfig.harNameOhmMap) { + config.externals.push(RegExp('^(' + harName + ')($|\/\S+)')); } } -- Gitee From 5b0f240fcae9b2f3e004fb0f3435dec45a0398e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Wed, 4 Jan 2023 10:28:49 +0000 Subject: [PATCH 267/379] update compiler/src/process_custom_component.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index f001bec..fdad635 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -685,7 +685,7 @@ function validateIllegalInitFromParent(node: ts.ObjectLiteralElementLike, proper message: `The ${parentPropertyKind} property '${parentPropertyName}' cannot be assigned to ` + `the ${curPropertyKind} property '${propertyName}'.`, // @ts-ignore - pos: node.initializer.getStart() + pos: node.initializer ? node.initializer.getStart() : node.getStart() }); } -- Gitee From 5d95c4a02c8e508fa71e914413294b344333b869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Thu, 5 Jan 2023 06:47:35 +0000 Subject: [PATCH 268/379] update compiler/src/process_custom_component.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index fdad635..a14ebca 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -673,9 +673,6 @@ function validateIllegalInitFromParent(node: ts.ObjectLiteralElementLike, proper let type: LogType = LogType.ERROR; if (inputType) { type = inputType; - } else if (parentPropertyKind === COMPONENT_NON_DECORATOR && - curPropertyKind === COMPONENT_PROP_DECORATOR) { - type = LogType.WARN; } else if (parentPropertyKind === COMPONENT_STATE_DECORATOR && curPropertyKind === COMPONENT_STATE_DECORATOR) { type = LogType.WARN; -- Gitee From 867701c10fdd44a88e46983b6934386d6ed6ea67 Mon Sep 17 00:00:00 2001 From: yfwang6 Date: Wed, 4 Jan 2023 17:44:38 +0800 Subject: [PATCH 269/379] wangyongfei6@huawei.com prevent function transform on release mode Signed-off-by: yfwang6 Change-Id: I41c612c7c02c41625175d5d30e8e50f60ecd17c9 --- compiler/webpack.config.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index ebe86d8..748d141 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -246,12 +246,20 @@ function setReleaseConfig(config) { minimizer: [new TerserPlugin({ terserOptions: { compress: { + defaults: false, + dead_code: true, + collapse_vars: true, + unused: true, + drop_debugger: true, + if_return: true, + reduce_vars: true, join_vars: false, sequences: 0 }, format: { semicolons: false, beautify: true, + braces: true, indent_level: 2 } } -- Gitee From f352a375a9786b9158c352df8f7387475199b37d Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Fri, 6 Jan 2023 16:01:33 +0800 Subject: [PATCH 270/379] houhaoyu@huawei.com fix partial update builder error Signed-off-by: houhaoyu Change-Id: I14bd65476c541830447db9bfd492d0654006e919 --- compiler/src/process_component_build.ts | 2 +- compiler/src/process_custom_component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index b330988..1253846 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -987,7 +987,7 @@ function processForEachComponentNew(node: ts.ExpressionStatement, newStatements: const lazyForEachStatement: ts.ExpressionStatement = createLazyForEachStatement(argumentsArray); if (node.expression.expression.getText() === COMPONENT_FOREACH) { newForEachStatements.push(propertyNode, itemGenFunctionStatement, updateFunctionStatement); - newStatements.push(createComponentCreationStatement(node, newForEachStatements), popNode); + newStatements.push(createComponentCreationStatement(node, newForEachStatements, isGlobalBuilder), popNode); } else { if (argumentsArray[2]) { newStatements.push(ts.factory.createBlock([itemGenFunctionStatement, itemIdFuncStatement, lazyForEachStatement, diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index a14ebca..92d1544 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -129,7 +129,7 @@ export function processCustomComponent(node: ts.ExpressionStatement, newStatemen createFunction(ts.factory.createIdentifier(COMPONENT_COMMON), ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))]; bindComponentAttr(node, ts.factory.createIdentifier(COMPONENT_COMMON), commomComponentNode, log); - newStatements.push(createComponentCreationStatement(componentAttributes(), commomComponentNode)); + newStatements.push(createComponentCreationStatement(componentAttributes(), commomComponentNode, isGlobalBuilder)); } else { newStatements.push(ts.factory.createExpressionStatement( createFunction(ts.factory.createIdentifier(COMPONENT_COMMON), -- Gitee From 3c8ea782fe4a759680395a87c58bf2aeff195497 Mon Sep 17 00:00:00 2001 From: zhouzebin Date: Sat, 7 Jan 2023 22:52:08 +0800 Subject: [PATCH 271/379] add target-triple for aot Issue: https://gitee.com/openharmony/developtools_ace_ets2bundle/issues/I69DSB?from=project-issue Signed-off-by: zhouzebin Change-Id: I372791e0d223a49aa771fea0752726076c5253d8 --- compiler/src/gen_aot.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/gen_aot.ts b/compiler/src/gen_aot.ts index a3908ca..9efabcc 100644 --- a/compiler/src/gen_aot.ts +++ b/compiler/src/gen_aot.ts @@ -48,7 +48,8 @@ export function generateAot(arkDir: string, builtinAbcPath: string): void { logger.error(reset, `ArkTS:ERROR generateAot failed. Invalid file path.`); return; } - const singleCmdPrefix: string = `"${aotCompiler}" --builtins-dts="${path.relative(process.cwd(), builtinAbcPath)}" --aot-file="${appAot}"`; + const singleCmdPrefix: string = `"${aotCompiler}" --builtins-dts="${path.relative(process.cwd(), builtinAbcPath)}" ` + + `--aot-file="${appAot}" --target-triple=aarch64-unknown-linux-gnu `; let singleCmd: string = ""; if (projectConfig.anBuildMode === "full") { singleCmd = singleCmdPrefix + ` "${appAbc}"`; -- Gitee From ebfdfaa148c54c9d7680c9015832fa3873a2aa68 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 10 Jan 2023 20:09:55 +0800 Subject: [PATCH 272/379] houhaoyu@huawei.com fix builder nest builder Signed-off-by: houhaoyu Change-Id: I347e253c9b013c9cd589d1fc49df527a330edd49 --- compiler/src/process_component_build.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 1253846..6c50083 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -340,7 +340,7 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme case ComponentType.customBuilderMethod: parent = undefined; if (CUSTOM_BUILDER_METHOD.has(name)) { - newStatements.push(addInnerBuilderParameter(item)); + newStatements.push(addInnerBuilderParameter(item, isGlobalBuilder)); } else { newStatements.push(item); } @@ -375,9 +375,10 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme } } -function addInnerBuilderParameter(node: ts.ExpressionStatement): ts.ExpressionStatement { +function addInnerBuilderParameter(node: ts.ExpressionStatement, + isGlobalBuilder: boolean = false): ts.ExpressionStatement { if (node.expression && ts.isCallExpression(node.expression) && node.expression.arguments) { - node.expression.arguments.push(ts.factory.createThis()); + node.expression.arguments.push(isGlobalBuilder ? parentConditionalExpression() : ts.factory.createThis()); return ts.factory.createExpressionStatement(ts.factory.updateCallExpression(node.expression, node.expression.expression, node.expression.typeArguments, node.expression.arguments)); } else { -- Gitee From 071cdd1dddd756348871cc67c1ebcc78e96ea02d Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Wed, 11 Jan 2023 15:13:09 +0800 Subject: [PATCH 273/379] Modify hotfix compile options Issue:I69ZRK Signed-off-by: chenqy930 Change-Id: I88bc6c7096e1e2336378c3959a2e52d188ea3847 --- compiler/src/gen_merged_abc.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index 87550ec..b42e620 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -42,9 +42,6 @@ import { const red: string = '\u001b[31m'; const reset: string = '\u001b[39m'; -projectConfig.patch = false -projectConfig.enableMap = false - function generateCompileFilesInfo(moduleInfos: Array) { const tempModuleInfos: ModuleInfo[] = Array(); moduleInfos.forEach((item) => { @@ -95,7 +92,10 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma let genAbcCmd: string = `${initAbcEnv().join(' ')} "@${filesInfoPath}" --npm-module-entry-list "${npmEntriesInfoPath}" --output "${outputABCPath}" --file-threads "${fileThreads}"`; - projectConfig.inOldSymbolTablePath = projectConfig.projectRootPath; // temp symbol table path for hot patch + projectConfig.patch = projectConfig.patch || false; + projectConfig.enableMap = projectConfig.enableMap || false; + projectConfig.inOldSymbolTablePath = projectConfig.inOldSymbolTablePath || projectConfig.projectRootPath; + if (projectConfig.patch) { let oldHapSymbolTable = path.join(projectConfig.inOldSymbolTablePath, PATCH_SYMBOL_TABLE); genAbcCmd += ` --input-symbol-table "${oldHapSymbolTable}" --generate-patch`; -- Gitee From 0cf5a2327fd95a7a9bc7c9d3e9da400cab7362d7 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 11 Jan 2023 18:02:08 +0800 Subject: [PATCH 274/379] houhaoyu@huawei.com process import with new tsc Signed-off-by: houhaoyu Change-Id: Iea673f89add0655d52f8a1cc72a655aa23e15777 --- compiler/src/process_import.ts | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index 48e9466..70c5c4d 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -134,11 +134,8 @@ isEntryPage: boolean = true, pathCollection: Set = new Set()): void { export function generateSourceFileAST(fileResolvePath: string, filePath: string): ts.SourceFile { const originContent: string = fs.readFileSync(fileResolvePath, { encoding: 'utf-8' }); const content: string = path.extname(fileResolvePath) === EXTNAME_ETS ? - preprocessNewExtend(preprocessExtend(processSystemApi(originContent.replace( - new RegExp('\\b' + STRUCT + '\\b.+\\{', 'g'), item => { - return item.replace(new RegExp('\\b' + STRUCT + '\\b', 'g'), `${CLASS} `); - })))) : originContent; - return ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); + preprocessNewExtend(preprocessExtend(processSystemApi(originContent))) : originContent; + return ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true, ts.ScriptKind.ETS); } function visitAllNode(node: ts.Node, sourceFile: ts.SourceFile, defaultNameFromParent: string, @@ -156,8 +153,7 @@ function visitAllNode(node: ts.Node, sourceFile: ts.SourceFile, defaultNameFromP if (ts.isEnumDeclaration(node) && node.name) { enumCollection.add(node.name.getText()); } - if ((ts.isClassDeclaration(node) || ts.isStructDeclaration(node)) && ts.isIdentifier(node.name) && - isCustomComponent(node)) { + if (ts.isStructDeclaration(node) && ts.isIdentifier(node.name) && isCustomComponent(node)) { addDependencies(node, defaultNameFromParent, asNameFromParent); isExportEntry(node, log, entryCollection, exportCollection, defaultCollection, fileResolvePath, sourceFile); if (asExportCollection.has(node.name.getText())) { @@ -304,7 +300,7 @@ function collectSpecialFunctionNode(node: ts.FunctionDeclaration, asNameFromPare } } -function isExportEntry(node: ts.ClassDeclaration, log: LogInfo[], entryCollection: Set, +function isExportEntry(node: ts.StructDeclaration, log: LogInfo[], entryCollection: Set, exportCollection: Set, defaultCollection: Set, fileResolvePath: string, sourceFile: ts.SourceFile): void { if (process.env.watchMode === 'true' && node && node.decorators) { @@ -348,7 +344,7 @@ function remindExportEntryComponent(node: ts.Node, log: LogInfo[], fileResolvePa } } -function addDependencies(node: ts.ClassDeclaration, defaultNameFromParent: string, +function addDependencies(node: ts.StructDeclaration, defaultNameFromParent: string, asNameFromParent: Map): void { const componentName: string = node.name.getText(); const ComponentSet: IComponentSet = getComponentSet(node); @@ -375,9 +371,9 @@ function addDependencies(node: ts.ClassDeclaration, defaultNameFromParent: strin } } -function addDefaultExport(node: ts.ClassDeclaration | ts.ExportAssignment): void { +function addDefaultExport(node: ts.StructDeclaration | ts.ExportAssignment): void { let name: string; - if (ts.isClassDeclaration(node) && node.name && ts.isIdentifier(node.name)) { + if (ts.isStructDeclaration(node) && node.name && ts.isIdentifier(node.name)) { name = node.name.escapedText.toString(); } else if (ts.isExportAssignment(node) && node.expression && ts.isIdentifier(node.expression)) { name = node.expression.escapedText.toString(); @@ -487,7 +483,7 @@ function isModule(filePath: string): boolean { return !/^(\.|\.\.)?\//.test(filePath) || filePath.indexOf(NODE_MODULES) > -1; } -function isCustomComponent(node: ts.ClassDeclaration | ts.StructDeclaration): boolean { +function isCustomComponent(node: ts.StructDeclaration): boolean { if (node.decorators && node.decorators.length) { for (let i = 0; i < node.decorators.length; ++i) { const decoratorName: ts.Identifier = node.decorators[i].expression as ts.Identifier; -- Gitee From e289b9bad495470b3048d101aa5e10d5fd27abfe Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Tue, 10 Jan 2023 11:52:45 +0800 Subject: [PATCH 275/379] Fix transmit process env of child process issue: I69QP9 Signed-off-by: zhangrengao Change-Id: Ibeb7eed13e2ca2c5e70c71acd98228efb8e0f396 --- compiler/src/gen_abc_plugin.ts | 12 +++++++----- compiler/src/manage_workers.ts | 26 +++++++++++++++----------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 9d01015..d7e7aad 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -1252,20 +1252,22 @@ function removeDuplicateInfoOfBundleList(inputPaths: File[]) { } function processWorkersOfPreviewMode(splittedData: any, cmdPrefix: string, workerNumber: number) { - let envParams: any = { + let processEnv: any = Object.assign({}, process.env); + let arkEnvParams: any = { 'splittedData': JSON.stringify(splittedData), 'cmdPrefix': cmdPrefix, 'workerNumber': workerNumber.toString(), }; if (projectConfig.compileMode === JSBUNDLE || projectConfig.compileMode === undefined) { - envParams['mode'] = JSBUNDLE; + arkEnvParams['mode'] = JSBUNDLE; } else if (projectConfig.compileMode === ESMODULE) { - envParams['cachePath'] = process.env.cachePath; - envParams['mode'] = ESMODULE; + arkEnvParams['cachePath'] = process.env.cachePath; + arkEnvParams['mode'] = ESMODULE; } + processEnv.arkEnvParams = JSON.stringify(arkEnvParams); let genAbcCmd: string = `${nodeJs} ${path.resolve(__dirname, MANAGE_WORKERS_SCRIPT)}`; - childProcess.execSync(genAbcCmd, {env: envParams}); + childProcess.execSync(genAbcCmd, {env: processEnv}); processExtraAsset(); } diff --git a/compiler/src/manage_workers.ts b/compiler/src/manage_workers.ts index b9a4cd5..a12c1be 100644 --- a/compiler/src/manage_workers.ts +++ b/compiler/src/manage_workers.ts @@ -24,17 +24,21 @@ import { JSBUNDLE } from "./pre_define"; -if (process.env["mode"] !== JSBUNDLE && process.env['mode'] !== ESMODULE) { +if (process.env['arkEnvParams'] === undefined) { process.exit(FAIL); } -if (process.env["workerNumber"] !== undefined && - process.env["splittedData"] !== undefined && - process.env["cmdPrefix"] !== undefined -) { - let workerNumber: number = parseInt(process.env.workerNumber); - let splittedData: any = JSON.parse(process.env.splittedData); - let cmdPrefix: string = process.env.cmdPrefix; +let arkEnvParams = JSON.parse(process.env.arkEnvParams); +if (arkEnvParams['mode'] !== JSBUNDLE && arkEnvParams['mode'] !== ESMODULE) { + process.exit(FAIL); +} + +if (arkEnvParams['workerNumber'] !== undefined && + arkEnvParams['splittedData'] !== undefined && + arkEnvParams['cmdPrefix'] !== undefined) { + let workerNumber: number = parseInt(arkEnvParams['workerNumber']); + let splittedData: any = JSON.parse(arkEnvParams['splittedData']); + let cmdPrefix: string = arkEnvParams['cmdPrefix']; const clusterNewApiVersion: number = 16; const currentNodeVersion: number = parseInt(process.version.split('.')[0]); @@ -42,7 +46,7 @@ if (process.env["workerNumber"] !== undefined && if ((useNewApi && cluster.isPrimary) || (!useNewApi && cluster.isMaster)) { let genAbcScript: string = GEN_ABC_SCRIPT; - if (process.env["mode"] === ESMODULE) { + if (arkEnvParams['mode'] === ESMODULE) { genAbcScript = GEN_MODULE_ABC_SCRIPT; } if (useNewApi) { @@ -60,11 +64,11 @@ if (process.env["workerNumber"] !== undefined && 'inputs': JSON.stringify(splittedData[i]), 'cmd': cmdPrefix }; - if (process.env["mode"] === ESMODULE) { + if (arkEnvParams['mode'] === ESMODULE) { let sn: number = i + 1; let workerFileName: string = `filesInfo_${sn}.txt`; workerData['workerFileName'] = workerFileName; - workerData['cachePath'] = process.env.cachePath; + workerData['cachePath'] = arkEnvParams['cachePath']; } cluster.fork(workerData); } -- Gitee From cbd1ea45d20584574c0fdcd6356dbc2cb77225ca Mon Sep 17 00:00:00 2001 From: hufeng Date: Wed, 11 Jan 2023 16:43:24 +0800 Subject: [PATCH 276/379] Fix npm entry without being specified in package.json Signed-off-by: hufeng Change-Id: Ic5994b207e524e93257d5c3aa88eeb82af19c105 --- compiler/src/gen_abc_plugin.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 9d01015..9bf867f 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -332,6 +332,8 @@ function getEntryCandidatesFromPackageJson(resourceResolveData: any): Set Date: Tue, 10 Jan 2023 18:41:55 +0800 Subject: [PATCH 277/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I27f71258a642050eebeb9a675f72414287cf9c30 --- compiler/src/ets_checker.ts | 15 +++++++++++++-- compiler/src/pre_define.ts | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index ab3167b..83a87ce 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -36,7 +36,8 @@ import { $$_BLOCK_INTERFACE, COMPONENT_EXTEND_DECORATOR, EXTNAME_D_ETS, - EXTNAME_JS + EXTNAME_JS, + FOREACH_LAZYFOREACH } from './pre_define'; import { getName } from './process_component_build'; import { INNER_COMPONENT_NAMES } from './component_map'; @@ -368,6 +369,12 @@ function parseAllNode(node: ts.Node, sourceFileNode: ts.SourceFile, extendFuncti node.getChildren().forEach((item: ts.Node) => parseAllNode(item, sourceFileNode, extendFunctionInfo)); } +function isForeachAndLzayForEach(node: ts.Node): boolean { + return ts.isCallExpression(node) && node.expression && ts.isIdentifier(node.expression) && + FOREACH_LAZYFOREACH.has(node.expression.escapedText.toString()) && node.arguments && node.arguments[1] && + ts.isArrowFunction(node.arguments[1]) && node.arguments[1].body && ts.isBlock(node.arguments[1].body); +} + function traverseBuild(node: ts.Node, index: number): void { if (ts.isExpressionStatement(node)) { let parentComponentName: string = getName(node); @@ -378,7 +385,11 @@ function traverseBuild(node: ts.Node, index: number): void { node = node.expression; if (ts.isEtsComponentExpression(node) && node.body && ts.isBlock(node.body) && !$$_BLOCK_INTERFACE.has(node.expression.escapedText.toString())) { - node.body.statements.forEach((item, indexBlock) => { + node.body.statements.forEach((item: ts.Statement, indexBlock: number) => { + traverseBuild(item, indexBlock); + }); + } else if (isForeachAndLzayForEach(node)) { + node.arguments[1].body.statements.forEach((item: ts.Statement, indexBlock: number) => { traverseBuild(item, indexBlock); }); } else { diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 4cb5110..c37b97e 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -117,6 +117,9 @@ export const ATTRIBUTE_ID: string = 'id'; export const TRUE: string = 'true'; export const FALSE: string = 'false'; export const NULL: string = 'null'; +export const FOREACH_LAZYFOREACH: Set = new Set([ + COMPONENT_FOREACH, COMPONENT_LAZYFOREACH +]); export const COMPONENT_CONSTRUCTOR_ID: string = 'compilerAssignedUniqueChildId'; export const COMPONENT_CONSTRUCTOR_PARENT: string = 'parent'; -- Gitee From 6d270aecb5504bedac80e125929b6425f1e5c921 Mon Sep 17 00:00:00 2001 From: bojiang Date: Tue, 10 Jan 2023 20:28:19 +0800 Subject: [PATCH 278/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: Id2049190ca3b0080f8eae0e969c462377ebb528e --- compiler/src/process_ui_syntax.ts | 40 ++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index be0e72a..016f9d3 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -100,6 +100,7 @@ export let contextGlobal: ts.TransformationContext; export let resourceFileName: string = ''; export function processUISyntax(program: ts.Program, ut = false): Function { + let entryNodeKey: ts.Expression; return (context: ts.TransformationContext) => { contextGlobal = context; let pagesDir: string; @@ -121,8 +122,9 @@ export function processUISyntax(program: ts.Program, ut = false): Function { } return node; } - node = createEntryNode(node, context); + const id: number = ++componentInfo.id; node = ts.visitEachChild(node, processAllNodes, context); + node = createEntryNode(node, context, entryNodeKey, id); if (projectConfig.compileMode === ESMODULE && process.env.compilerType && process.env.compilerType === ARK) { validateReExportType(node, pagesDir, transformLog.errors); } @@ -148,12 +150,27 @@ export function processUISyntax(program: ts.Program, ut = false): Function { return node; } }; + + function entryKeyNode(node: ts.Node): ts.Expression { + if (node && node.decorators && node.decorators.length) { + node.decorators.forEach(item => { + if (item.expression && ts.isCallExpression(item.expression) && ts.isIdentifier(item.expression.expression) && + item.expression.expression.escapedText.toString() === 'Entry' && item.expression.arguments && + item.expression.arguments.length && ts.isIdentifier(item.expression.arguments[0])) { + entryNodeKey = item.expression.arguments[0]; + } + }); + } + return entryNodeKey; + } + function processAllNodes(node: ts.Node): ts.Node { if (ts.isImportDeclaration(node) || ts.isImportEqualsDeclaration(node) || ts.isExportDeclaration(node) && node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier)) { processImport(node, pagesDir, transformLog.errors); } else if (ts.isStructDeclaration(node)) { componentCollection.currentClassName = node.name.getText(); + componentCollection.entryComponent === componentCollection.currentClassName && entryKeyNode(node); node = processComponentClass(node, context, transformLog.errors, program); componentCollection.currentClassName = null; INNER_STYLE_FUNCTION.forEach((block, styleName) => { @@ -611,7 +628,8 @@ export function isExtendFunction(node: ts.FunctionDeclaration): string { return null; } -function createEntryNode(node: ts.SourceFile, context: ts.TransformationContext): ts.SourceFile { +function createEntryNode(node: ts.SourceFile, context: ts.TransformationContext, + entryNodeKey: ts.Expression, id: number): ts.SourceFile { let cardRelativePath: string = undefined; if (projectConfig && projectConfig.cardObj) { cardRelativePath = projectConfig.cardObj[resourceFileName]; @@ -621,12 +639,12 @@ function createEntryNode(node: ts.SourceFile, context: ts.TransformationContext) if (!partialUpdateConfig.partialUpdateMode) { const entryNode: ts.ExpressionStatement = createEntryFunction(componentCollection.entryComponent, context, - cardRelativePath) as ts.ExpressionStatement; + cardRelativePath, entryNodeKey, id) as ts.ExpressionStatement; return context.factory.updateSourceFile(node, [...node.statements, entryNode]); } else { const entryNodes: ts.ExpressionStatement[] = createEntryFunction(componentCollection.entryComponent, context, - cardRelativePath) as ts.ExpressionStatement[]; + cardRelativePath, entryNodeKey, id) as ts.ExpressionStatement[]; return entryNodes ? context.factory.updateSourceFile(node, [...node.statements, ...entryNodes]) : context.factory.updateSourceFile(node, [...node.statements]); @@ -636,13 +654,13 @@ function createEntryNode(node: ts.SourceFile, context: ts.TransformationContext) } } else { const statementsArray: ts.Statement = - createPreviewComponentFunction(componentCollection.entryComponent, context, cardRelativePath); + createPreviewComponentFunction(componentCollection.entryComponent, context, cardRelativePath, id); return context.factory.updateSourceFile(node, [...node.statements, statementsArray]); } } -function createEntryFunction(name: string, context: ts.TransformationContext, cardRelativePath: string) - : ts.ExpressionStatement | ts.ExpressionStatement[] { +function createEntryFunction(name: string, context: ts.TransformationContext, cardRelativePath: string, + entryNodeKey: ts.Expression, id: number): ts.ExpressionStatement | ts.ExpressionStatement[] { let localStorageName: string; const localStorageNum: number = localStorageLinkCollection.get(name).size + localStoragePropCollection.get(name).size; @@ -658,12 +676,12 @@ function createEntryFunction(name: string, context: ts.TransformationContext, ca return; } const newArray: ts.Expression[] = [ - context.factory.createStringLiteral((++componentInfo.id).toString()), + context.factory.createStringLiteral(id.toString()), context.factory.createIdentifier(COMPONENT_CONSTRUCTOR_UNDEFINED), context.factory.createObjectLiteralExpression([], false) ]; if (localStorageName) { - newArray.push(context.factory.createIdentifier(localStorageName)); + newArray.push(entryNodeKey); } const newExpressionParams: any[] = [ context.factory.createNewExpression( @@ -739,9 +757,9 @@ function createStopGetAccessRecording(context: ts.TransformationContext): ts.Exp } function createPreviewComponentFunction(name: string, context: ts.TransformationContext, - cardRelativePath: string): ts.Statement { + cardRelativePath: string, id: number): ts.Statement { const newArray: ts.Expression[] = [ - context.factory.createStringLiteral((++componentInfo.id).toString()), + context.factory.createStringLiteral(id.toString()), context.factory.createIdentifier(COMPONENT_CONSTRUCTOR_UNDEFINED), context.factory.createObjectLiteralExpression([], false) ]; -- Gitee From 486480645e7877b59159e7e872f344eef5ec6b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 13 Jan 2023 10:55:50 +0800 Subject: [PATCH 279/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 32 +++++++++--------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 92d1544..f9ccf3a 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -44,7 +44,8 @@ import { BASE_COMPONENT_NAME_PU, OBSERVECOMPONENTCREATION, ISINITIALRENDER, - UPDATE_STATE_VARS_OF_CHIND_BY_ELMTID + UPDATE_STATE_VARS_OF_CHIND_BY_ELMTID, + COMPONENT_CUSTOM_DECORATOR } from './pre_define'; import { propertyCollection, @@ -490,33 +491,24 @@ function getParentPropertyName(node: ts.PropertyAssignment, curPropertyKind: str function isCorrectInitFormParent(parent: string, child: string): boolean { switch (child) { case COMPONENT_STATE_DECORATOR: + case COMPONENT_PROP_DECORATOR: case COMPONENT_PROVIDE_DECORATOR: - if (parent === COMPONENT_NON_DECORATOR) { + return true; + case COMPONENT_CUSTOM_DECORATOR: + return false; + case COMPONENT_NON_DECORATOR: + if ([COMPONENT_NON_DECORATOR, COMPONENT_STATE_DECORATOR, COMPONENT_LINK_DECORATOR, COMPONENT_PROP_DECORATOR, + COMPONENT_OBJECT_LINK_DECORATOR, COMPONENT_STORAGE_LINK_DECORATOR].includes(parent)) { return true; } break; case COMPONENT_LINK_DECORATOR: - if ([COMPONENT_STATE_DECORATOR, COMPONENT_LINK_DECORATOR, - COMPONENT_STORAGE_LINK_DECORATOR].includes(parent)) { - return true; - } - break; - case COMPONENT_PROP_DECORATOR: - if ([COMPONENT_STATE_DECORATOR, ...propAndLinkDecorators, COMPONENT_NON_DECORATOR - ].includes(parent)) { - return true; - } - break; - case COMPONENT_NON_DECORATOR: - if ([COMPONENT_STATE_DECORATOR, ...propAndLinkDecorators, COMPONENT_NON_DECORATOR, - COMPONENT_OBJECT_LINK_DECORATOR, COMPONENT_STORAGE_LINK_DECORATOR].includes(parent)) { - return true; + if (![COMPONENT_NON_DECORATOR].includes(parent)) { + return false; } break; case COMPONENT_OBJECT_LINK_DECORATOR: - if (!partialUpdateConfig.partialUpdateMode && parent === COMPONENT_STATE_DECORATOR) { - return true; - } else if (partialUpdateConfig.partialUpdateMode && STATE_OBJECTLINK_DECORATORS.includes(parent)) { + if ([COMPONENT_STATE_DECORATOR].includes(parent)) { return true; } break; -- Gitee From 6dfdf907d50bf038646cdf53efb2f819467e3dd3 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Fri, 13 Jan 2023 11:32:49 +0800 Subject: [PATCH 280/379] houhaoyu@huawei.com remove strict check Signed-off-by: houhaoyu Change-Id: I5e177c12198fdcbae9f8ed505f28cefae5288e8b --- compiler/src/pre_define.ts | 4 - compiler/src/process_component_build.ts | 320 +---------------------- compiler/src/process_component_member.ts | 100 +------ 3 files changed, 3 insertions(+), 421 deletions(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index c37b97e..b57dbd7 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -374,7 +374,3 @@ export const CARD_LOG_TYPE_IMPORT = 3; export const CALL = 'call'; export const RESERT = 'reset'; -export const ARRAY = 'Array'; -export const JSON = 'JSON'; -export const STRINGIFY = 'stringify'; -export const GETDATA = 'getData'; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 6c50083..5c871ad 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -99,10 +99,6 @@ import { FOOTER, CALL, CREATE_BIND_COMPONENT, - ARRAY, - JSON, - STRINGIFY, - GETDATA, TabContentAndNavDestination } from './pre_define'; import { @@ -140,8 +136,7 @@ import { } from './utils'; import { partialUpdateConfig, - projectConfig, - globalProgram + projectConfig } from '../main'; import { transformLog, contextGlobal } from './process_ui_syntax'; import { props } from './compile_info'; @@ -328,9 +323,6 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme break; case ComponentType.forEachComponent: parent = undefined; - if (partialUpdateConfig.strictCheck && partialUpdateConfig.partialUpdateMode) { - checkoutForEachSameId(item, log, name); - } if (!partialUpdateConfig.partialUpdateMode) { processForEachComponent(item, newStatements, log, isBuilder, isGlobalBuilder); } else { @@ -2392,313 +2384,3 @@ function parseCreateParameterBuilder(argument: ts.Expression):ts.Expression { return argument; } } -enum ReturnType { - notDefined, - notCompatible, - simple, - complex -} - -function checkoutForEachSameId(node: ts.ExpressionStatement, log: LogInfo[], name: string): void { - if (node.expression && ts.isCallExpression(node.expression) && node.expression.arguments && - node.expression.arguments.length) { - let target: ts.Node = node.expression.arguments[0]; - if (globalProgram.program && node.expression.arguments.length === 3 && - !isReturnStringify(node.expression.arguments[2], log)) { - let TypeChecker: ts.TypeChecker = globalProgram.program.getTypeChecker(true); - judgeTargetType(target, log, TypeChecker, name); - } - } -} - -function judgeTargetType(target: ts.Node, log: LogInfo[], TypeChecker: ts.TypeChecker, name: string): void { - if (ts.isIdentifier(target) && TypeChecker.getSymbolAtLocation(target)) { - let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(target).declarations; - if (declarations && declarations.length) { - let declaration: ts.Node = declarations[0]; - if (ts.isVariableDeclaration(declaration)) { - judgeDeclaration(declaration, target, log, name, TypeChecker); - } - } - } else if (ts.isPropertyAccessExpression(target) && target.expression && - target.expression.kind === ts.SyntaxKind.ThisKeyword && TypeChecker.getSymbolAtLocation(target)) { - if (name === COMPONENT_LAZYFOREACH && target.name && ts.isIdentifier(target.name) && - getObservedPropertyCollection(componentCollection.currentClassName).has(target.name.escapedText.toString())) { - log.push({ - type: LogType.WARN, - message: "LazyForEach's first parameter should not be state variable", - pos: target.getStart(), - }) - } - let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(target).declarations; - if (declarations && declarations.length) { - let declaration: ts.Node = declarations[0]; - if (ts.isPropertyDeclaration(declaration)) { - judgeDeclaration(declaration, target, log, name, TypeChecker); - } - } - } else if (ts.isCallExpression(target) && target.expression && - ts.isIdentifier(target.expression) && TypeChecker.getSymbolAtLocation(target.expression)) { - let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(target.expression).declarations; - if (declarations && declarations.length) { - let declaration: ts.Node = declarations[0]; - if (ts.isFunctionDeclaration(declaration)) { - judgeDeclaration(declaration, target, log, name, TypeChecker); - } - } - } else if (ts.isCallExpression(target) && target.expression && - ts.isPropertyAccessExpression(target.expression) && target.expression.expression && - target.expression.expression.kind === ts.SyntaxKind.ThisKeyword && - TypeChecker.getSymbolAtLocation(target.expression)) { - let declarations: ts.Node[] = TypeChecker.getSymbolAtLocation(target.expression).declarations; - if (declarations && declarations.length) { - let declaration: ts.Node = declarations[0]; - if (ts.isMethodDeclaration(declaration)) { - judgeDeclaration(declaration, target, log, name, TypeChecker); - } - } - } else if (partialUpdateConfig.strictCheck === 'all') { - if (name === COMPONENT_FOREACH) { - notRecognizeArrayType(log, target); - } else { - notRecognizeObjectType(log, target); - } - } -} - -function judgeDeclaration(declaration: ts.Node, target: ts.Node, log: LogInfo[], name: string, - TypeChecker: ts.TypeChecker): void { - if (name === COMPONENT_FOREACH) { - judgeArrayDeclaration(declaration, target, log); - } else { - judgeClassDeclaration(declaration, target, log, TypeChecker); - } -} - -function isReturnStringify(node: ts.Node, log: LogInfo[]): boolean { - return functionWithoutBlock(node, log) || functionWithBlock(node, log); -} - -function hasJsonStringify(node: ts.Node): boolean { - return ts.isPropertyAccessExpression(node) && node.expression && ts.isIdentifier(node.expression) && - node.expression.escapedText.toString() === JSON && node.name && ts.isIdentifier(node.name) && - node.name.escapedText.toString() === STRINGIFY; -} - -function functionWithoutBlock(node: ts.Node, log: LogInfo[]): boolean { - let withoutBlock: boolean = ts.isArrowFunction(node) && node.body && ts.isCallExpression(node.body) && - node.body.expression && hasJsonStringify(node.body.expression); - if (ts.isArrowFunction(node) && withoutBlock) { - if (judgeReturnType(node.type) === ReturnType.complex) { - remindComplexOfKeyGeneratorType(log, node); - } - } - return withoutBlock; -} - -function functionWithBlock(node: ts.Node, log: LogInfo[]): boolean { - if (ts.isArrowFunction(node) || ts.isFunctionExpression(node)) { - if (judgeReturnType(node.type) === ReturnType.notDefined) { - let useStringify = []; - if (node.body && ts.isBlock(node.body)) { - ts.forEachChild(node, (node)=>{traverseReturnStatement(node, useStringify)}) - } - return useStringify.length && useStringify[useStringify.length-1]; - } else if (judgeReturnType(node.type) === ReturnType.complex) { - remindComplexOfKeyGeneratorType(log, node); - return false; - } else { - return true; - } - } -} - -function traverseReturnStatement(childNode, useStringify): void { - if (useStringify.length && !useStringify[useStringify.length-1]) { - return; - } - if (ts.isReturnStatement(childNode) && childNode.expression) { - if (childNode.expression.expression && hasJsonStringify(childNode.expression.expression)) { - useStringify.push(true); - } else { - useStringify.push(false); - } - } - ts.forEachChild(childNode, (childNode)=>{traverseReturnStatement(childNode, useStringify)}) -} - -function judgeReturnType(type: ts.TypeNode): ReturnType { - if (type) { - return judgeType(type); - } else { - return ReturnType.notDefined; - } -} - -function judgeArrayDeclaration(declaration: ts.Node, targetArray: ts.Node, log: LogInfo[]): void { - switch (judgeArrayType(declaration.type)) { - case ReturnType.notDefined: - log.push({ - type: LogType.NOTE, - message: "Variable/function which used for ForEach component's 1st parameter should allocate a type", - pos: declaration.getStart(), - }) - break; - case ReturnType.complex: - log.push({ - type: LogType.NOTE, - message: "if key generator(return type of ForEach's 3rd parameter) is a complex type, " + - "should use JSON.stringify to serialize it", - pos: targetArray.getStart(), - }) - break; - } -} - -function judgeClassDeclaration(declaration: ts.Node, targetClass: ts.Node, log: LogInfo[], - TypeChecker: ts.TypeChecker): void { - if (declaration.type) { - if (ts.isTypeReferenceNode(declaration.type) && declaration.type.typeName && - ts.isIdentifier(declaration.type.typeName)) { - let tsSymbol: ts.Symbol = TypeChecker.getSymbolAtLocation(declaration.type.typeName); - if (tsSymbol && tsSymbol.declarations && tsSymbol.declarations[0]) { - checkClassGetDataReturnType(tsSymbol.declarations[0], log, targetClass, TypeChecker); - } - } else if (ts.isTypeLiteralNode(declaration.type) && declaration.type.members && - declaration.type.members.length) { - checkObjectGetDataReturnType(declaration.type, log); - } else { - notRecognizeObjectType(log, targetClass); - } - } else { - log.push({ - type: LogType.NOTE, - message: `Better allocate a type of this Object/Function/Method`, - pos: declaration.getStart(), - }) - notRecognizeObjectType(log, targetClass); - } -} - -function checkClassGetDataReturnType(declaration: ts.Node, log: LogInfo[], targetClass: ts.Node, - TypeChecker: ts.TypeChecker): void { - if ((ts.isInterfaceDeclaration(declaration) || ts.isClassDeclaration(declaration)) && - declaration.members && declaration.members.length) { - let hasGetData: boolean = checkObjectGetDataReturnType(declaration, log); - if (!hasGetData && declaration.heritageClauses && declaration.heritageClauses.length && - declaration.heritageClauses[0] && declaration.heritageClauses[0].types && - declaration.heritageClauses[0].types.length && declaration.heritageClauses[0].types[0] && - ts.isExpressionWithTypeArguments(declaration.heritageClauses[0].types[0]) && - declaration.heritageClauses[0].types[0].expression && - ts.isIdentifier(declaration.heritageClauses[0].types[0].expression)) { - let classSymbol: ts.Symbol = TypeChecker.getSymbolAtLocation(declaration.heritageClauses[0].types[0].expression); - if (classSymbol && classSymbol.declarations && classSymbol.declarations[0]) { - checkClassGetDataReturnType(classSymbol.declarations[0], log, targetClass, TypeChecker); - } - } - } else { - notRecognizeObjectType(log, targetClass); - } -} - -function checkObjectGetDataReturnType(objectType: ts.TypeLiteralNode|ts.InterfaceDeclaration|ts.ClassDeclaration, - log: LogInfo[]): boolean { - let hasGetData: boolean = false; - objectType.members.forEach(member => { - if ((ts.isMethodSignature(member) || ts.isMethodDeclaration(member)) && member.name && - ts.isIdentifier(member.name) && member.name.escapedText.toString() === GETDATA) { - hasGetData = true; - if (member.type) { - if (judgeType(member.type) === ReturnType.complex) { - remindComplexOfGetDataType(log, member); - } - } else { - allocateGetDataType(log, member); - } - } else if (ts.isPropertySignature(member) && member.name && ts.isIdentifier(member.name) && - member.name.escapedText.toString() === GETDATA && member.type && ts.isFunctionTypeNode(member.type)) { - hasGetData = true; - if (member.type.type) { - if (judgeType(member.type.type) === ReturnType.complex) { - remindComplexOfGetDataType(log, member); - } - } else { - allocateGetDataType(log, member); - } - } - }); - return hasGetData; -} - -function judgeArrayType(type: ts.TypeNode): ReturnType { - if (type) { - if (ts.isTypeReferenceNode(type) && type.typeName && ts.isIdentifier(type.typeName) && - type.typeName.escapedText.toString() === ARRAY && type.typeArguments && type.typeArguments.length) { - return judgeType(type.typeArguments[0]); - } else if (ts.isArrayTypeNode(type) && type.elementType) { - return judgeType(type.elementType); - } else { - return ReturnType.notCompatible; - } - } else { - return ReturnType.notDefined; - } -} - -function judgeType(type: ts.TypeNode): ReturnType { - switch (type.kind) { - case ts.SyntaxKind.StringKeyword: - case ts.SyntaxKind.NumberKeyword: - case ts.SyntaxKind.BooleanKeyword: - case ts.SyntaxKind.SymbolKeyword: - case ts.SyntaxKind.BigIntKeyword: - case ts.SyntaxKind.UndefinedKeyword: - case ts.SyntaxKind.NullKeyword: - return ReturnType.simple; - default: - return ReturnType.complex; - } -} - -function notRecognizeArrayType(log: LogInfo[], target: ts.Node): void { - log.push({ - type: LogType.NOTE, - message: `Make sure the key generator in 3rd parameter of ForEach Component is different when item needs to be updated, ` + - `If the type of the key generator is not a simple type, use JSON.stringify to serialize it instead of object.toString()`, - pos: target.getStart(), - }) -} - -function notRecognizeObjectType(log: LogInfo[], target: ts.Node): void { - log.push({ - type: LogType.NOTE, - message: `Make sure the key generator in 3rd parameter of LazyForEach Component is different when item needs to be updated, ` + - `If the type of the key generator is not a simple type, use JSON.stringify to serialize it instead of object.toString()`, - pos: target.getStart(), - }) -} - -function allocateGetDataType(log: LogInfo[], target: ts.Node): void { - log.push({ - type: LogType.NOTE, - message: `Should allocate a type of getData`, - pos: target.getStart(), - }) -} - -function remindComplexOfKeyGeneratorType(log: LogInfo[], target: ts.Node): void { - log.push({ - type: LogType.NOTE, - message: "Return complex type, please use JSON.stringify to serialize it", - pos: target.getStart(), - }) -} - -function remindComplexOfGetDataType(log: LogInfo[], target: ts.Node): void { - log.push({ - type: LogType.NOTE, - message: `If return type of getData is a complex type, ` + - `use JSON.stringify to serialize the key generator in 3rd parameter of LazyForEach Component`, - pos: target.getStart(), - }) -} diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 8c07df2..61f4030 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -73,8 +73,7 @@ import { CREATE_STORAGE_PROP, ELMTID, COMPONENT_CONSTRUCTOR_PARAMS, - RESERT, - ARRAY + RESERT } from './pre_define'; import { forbiddenUseStateType, @@ -91,8 +90,7 @@ import { updateConstructor } from './process_component_constructor'; import { LogType, LogInfo, - componentInfo, - hasDecorator + componentInfo } from './utils'; import { createReference, @@ -392,9 +390,6 @@ function processStateDecorators(node: ts.PropertyDeclaration, decorator: string, if (decorator !== COMPONENT_BUILDERPARAM_DECORATOR) { updateResult.setVariableGet(createGetAccessor(name, CREATE_GET_METHOD)); updateResult.setDeleteParams(true); - if (partialUpdateConfig.strictCheck === 'all' && partialUpdateConfig.partialUpdateMode) { - checkStatePropertyType(node, log); - } } if (!immutableDecorators.has(decorator)) { updateResult.setVariableSet(createSetAccessor(name, CREATE_SET_METHOD, node.type)); @@ -412,97 +407,6 @@ function processStateDecorators(node: ts.PropertyDeclaration, decorator: string, } } -function checkStatePropertyType(node: ts.PropertyDeclaration, log: LogInfo[]): void { - switch (isArrayTypeNode(node.type, log, true)) { - case 'TypeReference': - if (ts.isTypeReferenceNode(node.type.typeArguments[0]) && node.type.typeArguments[0].typeName && - ts.isIdentifier(node.type.typeArguments[0].typeName)) { - judgeArrayType(node.type.typeArguments[0], log); - } else if (!isExactArrayType(node.type.typeArguments[0])) { - remindObserved(log, node.type.typeArguments[0]); - } - break; - case 'ArrayType': - if (ts.isArrayTypeNode(node.type) && node.type.elementType && - ts.isTypeReferenceNode(node.type.elementType) && node.type.elementType.typeName && - ts.isIdentifier(node.type.elementType.typeName)) { - judgeArrayType(node.type.elementType, log); - } else if (!isExactArrayType(node.type.elementType)) { - remindObserved(log, node.type.elementType); - } - break; - } -} - -function judgeArrayType(node: ts.Node, log: LogInfo[]): void { - if (!observedClassCollection.has(node.typeName.escapedText.toString())) { - remindObserved(log, node); - } -} - -function remindObserved(log: LogInfo[], node: ts.Node): void { - log.push({ - type: LogType.NOTE, - message: `Make sure this type is a Class with @Observed decorator, ` + - `or it's property may not update when you change this state variable`, - pos: node.getStart() - }) -} - -function isArrayTypeNode(type: ts.Node, log: LogInfo[], isSurface: boolean): string { - let isArrayType: string; - if (type) { - if (ts.isTypeReferenceNode(type) && type.typeName && ts.isIdentifier(type.typeName) && - type.typeName.escapedText.toString() === ARRAY && type.typeArguments && type.typeArguments.length) { - isArrayType = 'TypeReference'; - isArrayTypeNodeCommon(isSurface, type.typeArguments[0], log); - } else if (ts.isArrayTypeNode(type) && type.elementType) { - isArrayType = 'ArrayType'; - isArrayTypeNodeCommon(isSurface, type.elementType, log); - } - } - return isArrayType; -} - -function isArrayTypeNodeCommon(isSurface: boolean, node: ts.Node, log: LogInfo[]): void { - if (isSurface) { - isObscureArrayType(node, log); - isArrayTypeNode(node, log, false); - } else { - log.push({ - type: LogType.NOTE, - message: `Better not nested Array in Array`, - pos: node.getStart() - }) - } -} - -function isExactArrayType(type: ts.Node): boolean { - switch(type.kind) { - case ts.SyntaxKind.StringKeyword: - case ts.SyntaxKind.NumberKeyword: - case ts.SyntaxKind.BooleanKeyword: - case ts.SyntaxKind.SymbolKeyword: - case ts.SyntaxKind.BigIntKeyword: - return true; - default: - return false; - } -} - -function isObscureArrayType(type: ts.Node, log: LogInfo[]): void { - switch(type.kind) { - case ts.SyntaxKind.AnyKeyword: - case ts.SyntaxKind.TupleType: - case ts.SyntaxKind.VoidKeyword: - log.push({ - type: LogType.NOTE, - message: `Please give a exact type of Array`, - pos: type.getStart() - }) - } -} - function createPurgeVariableDepStatement(variableWithUnderLink: string): ts.Statement { return ts.factory.createExpressionStatement( ts.factory.createCallExpression( -- Gitee From f64d33c7115bc455b4a67292d3487de3bb9abca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 13 Jan 2023 06:51:25 +0000 Subject: [PATCH 281/379] update compiler/src/process_custom_component.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index f9ccf3a..6126d91 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -503,15 +503,9 @@ function isCorrectInitFormParent(parent: string, child: string): boolean { } break; case COMPONENT_LINK_DECORATOR: - if (![COMPONENT_NON_DECORATOR].includes(parent)) { - return false; - } - break; + return ![COMPONENT_NON_DECORATOR].includes(parent); case COMPONENT_OBJECT_LINK_DECORATOR: - if ([COMPONENT_STATE_DECORATOR].includes(parent)) { - return true; - } - break; + return [COMPONENT_STATE_DECORATOR].includes(parent); } return false; } -- Gitee From e036c11de72905815f8dd4b9fc64a73e232c67f7 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Fri, 13 Jan 2023 15:17:06 +0800 Subject: [PATCH 282/379] houhaoyu@huawei.com change log of resource error Signed-off-by: houhaoyu Change-Id: I0154c2b1dfa8c0c6534b5f550df5f5b157c971d8 --- compiler/src/process_ui_syntax.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index be0e72a..cae1173 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -464,19 +464,19 @@ function validateResourceData(resourceData: string[], resources: object, pos: nu } else if (!resources[resourceData[0]]) { log.push({ type: LogType.ERROR, - message: `The value of '${resourceData[0]}' is invalid.`, + message: `Unknown resource source '${resourceData[0]}'.`, pos: pos }); } else if (!resources[resourceData[0]][resourceData[1]]) { log.push({ type: LogType.ERROR, - message: `Value '${resourceData[1]}' does not exist on type 'typeof ${resourceData[0]}'.`, + message: `Unknown resource type '${resourceData[1]}'.`, pos: pos }); } else if (!resources[resourceData[0]][resourceData[1]][resourceData[2]]) { log.push({ type: LogType.ERROR, - message: `Value '${resourceData[2]}' does not exist on type 'typeof ${resourceData[1]}'.`, + message: `Unknown resource name '${resourceData[2]}'.`, pos: pos }); } else { -- Gitee From cbdf1d1dd7b2c84a3c80dbc04fbe35762501ed94 Mon Sep 17 00:00:00 2001 From: Gymee Date: Mon, 16 Jan 2023 11:01:23 +0800 Subject: [PATCH 283/379] Remove isSystemPlugin check for replaceSystemApi Issue: https://gitee.com/openharmony/developtools_ace_ets2bundle/issues/I6AO2G Signed-off-by: Gymee Change-Id: I63a98b01c2cf2675485ec9c9375def7798314736 --- compiler/src/validate_ui_syntax.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index a0d5dc6..8595847 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -854,14 +854,8 @@ export function preprocessNewExtend(content: string, extendCollection?: Set Date: Mon, 16 Jan 2023 15:55:35 +0800 Subject: [PATCH 284/379] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix 自定义弹窗import @CustomDialog应用奔溃 Signed-off-by: bojiang Change-Id: I1213f75557ec2c002072a69e0885aad83e380bc7 --- compiler/src/validate_ui_syntax.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index a0d5dc6..9beaa0e 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -255,7 +255,7 @@ export function isObservedClass(node: ts.Node): boolean { } export function isCustomDialogClass(node: ts.Node): boolean { - if (ts.isClassDeclaration(node) && hasDecorator(node, COMPONENT_DECORATOR_CUSTOM_DIALOG)) { + if (ts.isStructDeclaration(node) && hasDecorator(node, COMPONENT_DECORATOR_CUSTOM_DIALOG)) { return true; } return false; -- Gitee From df09af3c4031fd629d28ec24d2a6799492d58564 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 11 Jan 2023 17:24:25 +0800 Subject: [PATCH 285/379] houhaoyu@huawei.com fix main type module in import npm modules Signed-off-by: houhaoyu Change-Id: I68ae894a35d52704a201b190f3c9b6b14040bf58 --- compiler/src/process_import.ts | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index 48e9466..8e25cd8 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -500,24 +500,32 @@ function isCustomComponent(node: ts.ClassDeclaration | ts.StructDeclaration): bo return false; } +let packageJsonEntry: string = ''; + function isPackageJsonEntry(filePath: string): boolean { const packageJsonPath: string = path.join(filePath, PACKAGE_JSON); if (fs.existsSync(packageJsonPath)) { - let entry: string; + let entryTypes: string; + let entryMain: string; try { - entry = JSON.parse(fs.readFileSync(packageJsonPath).toString()).main; + const packageJson: Object = JSON.parse(fs.readFileSync(packageJsonPath).toString()); + entryTypes = packageJson.types; + entryMain = packageJson.main; } catch (e) { return false; } - if (typeof entry === 'string' && fs.existsSync(path.join(filePath, entry))) { + if (entryExist(filePath, entryTypes)) { + packageJsonEntry = path.resolve(filePath, entryTypes); + return true; + } else if (entryExist(filePath, entryMain)) { + packageJsonEntry = path.resolve(filePath, entryMain); return true; } } } -function getPackageJsonEntry(filePath: string): string { - let packageJson: Object = JSON.parse(fs.readFileSync(path.join(filePath, PACKAGE_JSON)).toString()); - return path.join(filePath, packageJson.types ? packageJson.types : packageJson.main); +function entryExist(filePath: string, entry: string): boolean { + return typeof entry === 'string' && fs.existsSync(path.resolve(filePath, entry)); } function getModuleFilePath(filePath: string): string { @@ -559,7 +567,7 @@ function getFileResolvePath(fileResolvePath: string, pagesDir: string, filePath: if (fs.existsSync(fileResolvePath + EXTNAME_ETS)) { fileResolvePath = fileResolvePath + EXTNAME_ETS; } else if (isPackageJsonEntry(fileResolvePath)) { - fileResolvePath = getPackageJsonEntry(fileResolvePath); + fileResolvePath = packageJsonEntry; if (fs.statSync(fileResolvePath).isDirectory() && fs.existsSync(path.join(fileResolvePath, INDEX_ETS))) { fileResolvePath = path.join(fileResolvePath, INDEX_ETS); } -- Gitee From f90f97f452d24c6317c09bc2f3e10308ec1e38c0 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sun, 15 Jan 2023 21:17:48 +0800 Subject: [PATCH 286/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 闭源har增量编译 Signed-off-by: houhaoyu Change-Id: Id1faeb6d01dfa0961c917cedbe414ced3f1e4925 --- compiler/src/compile_info.ts | 33 ++++++++++++++++++++++++++++++++- compiler/src/utils.ts | 11 ++++++----- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 4df4e91..2b2a1ae 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -37,7 +37,8 @@ import { mkDir, writeFileSync, parseErrorMessage, - generateSourceFilesInHar + generateSourceFilesInHar, + genTemporaryPath } from './utils'; import { MODULE_ETS_PATH, @@ -128,6 +129,7 @@ export class ResultStates { hotReloadIncrementalStartTime: '', hotReloadIncrementalEndTime: '' } + private incrementalFileInHar: Map = new Map(); public apply(compiler: Compiler): void { compiler.hooks.compilation.tap('SourcemapFixer', compilation => { @@ -194,6 +196,8 @@ export class ResultStates { } } }); + + compilation.hooks.finishModules.tap('finishModules', handleFinishModules.bind(this)); }); compiler.hooks.afterCompile.tap('copyFindModule', () => { @@ -362,6 +366,12 @@ export class ResultStates { useOSFiles && useOSFiles.size > 0) { this.writeUseOSFiles(); } + if (projectConfig.compileHar) { + this.incrementalFileInHar.forEach((jsBuildFilePath, jsCacheFilePath) => { + const sourceCode: string = fs.readFileSync(jsCacheFilePath, 'utf-8'); + writeFileSync(jsBuildFilePath, sourceCode); + }); + } this.mStats = stats; this.warningCount = 0; this.noteCount = 0; @@ -659,3 +669,24 @@ function checkNeedUpdateFiles(file: string, needUpdate: NeedUpdateFlag, alreadyC needUpdate.flag = true; } } + +function handleFinishModules(modules, callback) { + if (projectConfig.compileHar) { + modules.forEach(module => { + if (module !== undefined && module.resourceResolveData !== undefined) { + const filePath: string = module.resourceResolveData.path; + if (!filePath.match(/node_modules/)) { + const jsCacheFilePath: string = genTemporaryPath(filePath, projectConfig.moduleRootPath, process.env.cachePath); + const jsBuildFilePath: string = genTemporaryPath(filePath, projectConfig.moduleRootPath, projectConfig.buildPath, true); + if (path.extname(filePath) === 'ets' || path.extname(filePath) === 'ts') { + this.incrementalFileInHar.set(jsCacheFilePath.replace(/\.ets$/, '.d.ets').replace(/\.ts$/, '.d.ts'), + jsBuildFilePath.replace(/\.ets$/, '.d.ets').replace(/\.ts$/, '.d.ts')); + this.incrementalFileInHar.set(jsCacheFilePath.replace(/\.e?ts$/, '.js'), jsBuildFilePath.replace(/\.e?ts$/, '.js')); + } else { + this.incrementalFileInHar.set(jsCacheFilePath, jsBuildFilePath); + } + } + } + }); + } +} diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index b352d9b..be3ba3a 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -273,7 +273,7 @@ export function writeFileSync(filePath: string, content: string): void { } export function genTemporaryPath(filePath: string, projectPath: string, buildPath: string, - buildInHar: boolean = false): string { + removeTemporary: boolean = false): string { filePath = toUnixPath(filePath); if (filePath.endsWith(EXTNAME_MJS)) { filePath = filePath.replace(/\.mjs$/, EXTNAME_JS); @@ -290,17 +290,17 @@ export function genTemporaryPath(filePath: string, projectPath: string, buildPat const hapPath: string = toUnixPath(projectConfig.projectRootPath); const tempFilePath: string = filePath.replace(hapPath, ''); const sufStr: string = tempFilePath.substring(tempFilePath.indexOf(NODE_MODULES) + NODE_MODULES.length + 1); - output = path.join(buildPath, buildInHar ? '' : TEMPORARY, NODE_MODULES, MAIN, sufStr); + output = path.join(buildPath, removeTemporary ? '' : TEMPORARY, NODE_MODULES, MAIN, sufStr); } else { output = filePath.replace(fakeNodeModulesPath, - path.join(buildPath, buildInHar ? '' : TEMPORARY, NODE_MODULES, AUXILIARY)); + path.join(buildPath, removeTemporary ? '' : TEMPORARY, NODE_MODULES, AUXILIARY)); } return output; } if (filePath.indexOf(projectPath) !== -1) { const sufStr: string = filePath.replace(projectPath, ''); - const output: string = path.join(buildPath, buildInHar ? '' : TEMPORARY, sufStr); + const output: string = path.join(buildPath, removeTemporary ? '' : TEMPORARY, sufStr); return output; } @@ -467,7 +467,8 @@ function replaceRelativeDependency(item:string, moduleRequest: string, sourcePat export function generateSourceFilesInHar(sourcePath: string, sourceContent: string, suffix: string) { let jsFilePath: string = genTemporaryPath(sourcePath, projectConfig.compileShared ? projectConfig.projectRootPath : projectConfig.moduleRootPath, - path.resolve(projectConfig.buildPath, projectConfig.compileShared ? '../etsFortgz' : ''), true); + projectConfig.compileShared ? path.resolve(projectConfig.buildPath, '../etsFortgz') : process.env.cachePath, + projectConfig.compileShared); if (!jsFilePath.match(/node_modules/)) { jsFilePath = jsFilePath.replace(/\.ets$/, suffix).replace(/\.ts$/, suffix); mkdirsSync(path.dirname(jsFilePath)); -- Gitee From 48b24d2b88294420f1e13bf0552946475b7480d3 Mon Sep 17 00:00:00 2001 From: bojiang Date: Sun, 15 Jan 2023 18:34:24 +0800 Subject: [PATCH 287/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: If019ef7f7c0f103646adc5749e39013dd30a0be3 --- compiler/src/compile_info.ts | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 4df4e91..ac6b33b 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -104,6 +104,7 @@ export let cache: Cache = {}; export const shouldResolvedFiles: Set = new Set() type Cache = Record; let allModifiedFiles: Set = new Set(); +let checkErrorMessage: Set = new Set([]); interface wholeCache { runtimeOS: string, sdkInfo: string, @@ -532,8 +533,11 @@ export class ResultStates { this.noteCount++; logger.info(this.blue, message.replace(/^NOTE/, 'ArkTS:NOTE'), this.reset, '\n'); } else { - this.warningCount++; - logger.warn(this.yellow, message.replace(/^WARN/, 'ArkTS:WARN'), this.reset, '\n'); + if (!checkErrorMessage.has(message)) { + this.warningCount++; + logger.warn(this.yellow, message.replace(/^WARN/, 'ArkTS:WARN'), this.reset, '\n'); + checkErrorMessage.add(message); + } } } if (this.mWarningCount > length) { @@ -547,6 +551,7 @@ export class ResultStates { const errors: Info[] = [...this.mStats.compilation.errors]; for (let index = 0; index < errors.length; index++) { if (errors[index].issue) { + if (!checkErrorMessage.has(errors[index].issue)) { this.mErrorCount++; const position: string = errors[index].issue.location ? `:${errors[index].issue.location.start.line}:${errors[index].issue.location.start.column}` @@ -555,12 +560,17 @@ export class ResultStates { const detail: string = errors[index].issue.message; logger.error(this.red, 'ArkTS:ERROR File: ' + location, this.reset); logger.error(this.red, detail, this.reset, '\n'); + checkErrorMessage.add(errors[index].issue); + } } else if (/BUILDERROR/.test(errors[index].message)) { - this.mErrorCount++; - const errorMessage: string = errors[index].message.replace(/^Module Error\s*.*:\n/, '') - .replace(/\(Emitted value instead of an instance of Error\) BUILD/, '') - .replace(/^ERROR/, 'ArkTS:ERROR'); - this.printErrorMessage(errorMessage, true, errors[index]); + if (!checkErrorMessage.has(errors[index].message)) { + this.mErrorCount++; + const errorMessage: string = errors[index].message.replace(/^Module Error\s*.*:\n/, '') + .replace(/\(Emitted value instead of an instance of Error\) BUILD/, '') + .replace(/^ERROR/, 'ArkTS:ERROR'); + this.printErrorMessage(errorMessage, true, errors[index]); + checkErrorMessage.add(errors[index].message); + } } else if (!/TS[0-9]+:/.test(errors[index].message.toString()) && !/Module parse failed/.test(errors[index].message.toString())) { this.mErrorCount++; -- Gitee From 1958907a34cc7f19aba1956d6c3afb5bd4bc8097 Mon Sep 17 00:00:00 2001 From: xiexiyun Date: Mon, 16 Jan 2023 22:35:32 +0800 Subject: [PATCH 288/379] textTimerController & search controller white list Signed-off-by: xiexiyun --- compiler/src/component_map.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/component_map.ts b/compiler/src/component_map.ts index 2ee65cc..44e583b 100644 --- a/compiler/src/component_map.ts +++ b/compiler/src/component_map.ts @@ -53,7 +53,8 @@ export const forbiddenUseStateType: Set = new Set(['Scroller', 'SwiperSc 'VideoController', 'WebController', 'CustomDialogController', 'SwiperController', 'TabsController', 'CalendarController', 'AbilityController', 'XComponentController', 'CanvasRenderingContext2D', 'CanvasGradient', 'ImageBitmap', 'ImageData', 'Path2D', - 'RenderingContextSettings', 'OffscreenCanvasRenderingContext2D', 'PatternLockController', 'TextAreaController', 'TextInputController' + 'RenderingContextSettings', 'OffscreenCanvasRenderingContext2D', 'PatternLockController', + 'TextAreaController', 'TextInputController', 'TextTimerController', 'SearchController' ]); export const INNER_COMPONENT_NAMES: Set = new Set(); -- Gitee From ab86a5ac029e6eb907b7307ab427fa193c6497ef Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 17 Jan 2023 09:35:09 +0800 Subject: [PATCH 289/379] houhaoyu@huawei.com fix extname Signed-off-by: houhaoyu Change-Id: I628667754e88d278d210b61232beec1cad15f01f --- compiler/src/compile_info.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 2b2a1ae..3752c68 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -678,7 +678,7 @@ function handleFinishModules(modules, callback) { if (!filePath.match(/node_modules/)) { const jsCacheFilePath: string = genTemporaryPath(filePath, projectConfig.moduleRootPath, process.env.cachePath); const jsBuildFilePath: string = genTemporaryPath(filePath, projectConfig.moduleRootPath, projectConfig.buildPath, true); - if (path.extname(filePath) === 'ets' || path.extname(filePath) === 'ts') { + if (filePath.match(/\.e?ts$/)) { this.incrementalFileInHar.set(jsCacheFilePath.replace(/\.ets$/, '.d.ets').replace(/\.ts$/, '.d.ts'), jsBuildFilePath.replace(/\.ets$/, '.d.ets').replace(/\.ts$/, '.d.ts')); this.incrementalFileInHar.set(jsCacheFilePath.replace(/\.e?ts$/, '.js'), jsBuildFilePath.replace(/\.e?ts$/, '.js')); -- Gitee From 202a9035090d5efc1a385b264a51eab5deb081dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Tue, 17 Jan 2023 16:28:58 +0800 Subject: [PATCH 290/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_member.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 61f4030..1d3b8cd 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -138,7 +138,7 @@ export const setUpdateParamsDecorators: Set = export const setStateVarsDecorators: Set = new Set([COMPONENT_OBJECT_LINK_DECORATOR]); export const immutableDecorators: Set = - new Set([COMPONENT_STORAGE_PROP_DECORATOR, COMPONENT_OBJECT_LINK_DECORATOR, COMPONENT_BUILDERPARAM_DECORATOR]); + new Set([COMPONENT_OBJECT_LINK_DECORATOR, COMPONENT_BUILDERPARAM_DECORATOR]); export const simpleTypes: Set = new Set([ts.SyntaxKind.StringKeyword, ts.SyntaxKind.NumberKeyword, ts.SyntaxKind.BooleanKeyword, ts.SyntaxKind.EnumDeclaration]); -- Gitee From a19da0b3f7c21a5ada3bea72f5380e78b84d3fc0 Mon Sep 17 00:00:00 2001 From: lihong Date: Mon, 16 Jan 2023 15:20:13 +0800 Subject: [PATCH 291/379] lihong67@huawei.com add validate for Length/ResourceStr/ResourceColor. Signed-off-by: lihong Change-Id: I9e528141f35ad018108e0b34d9e5462c4afee219 --- compiler/src/process_component_member.ts | 76 +++++++++++++----------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 8c07df2..1cdc0da 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -943,27 +943,6 @@ export function isSimpleType(typeNode: ts.TypeNode, program: ts.Program, log?: L } else if (program) { checker = program.getTypeChecker(); } - const enumType: ts.SyntaxKind = getEnumType(typeNode, checker); - if (simpleTypes.has(enumType || typeNode.kind) || isEnumtype(typeNode)) { - return true; - } else if (ts.isUnionTypeNode(typeNode) && typeNode.types) { - const types: ts.NodeArray = typeNode.types; - let basicType: boolean = false; - let referenceType: boolean = false; - for (let i = 0; i < types.length; i++) { - const enumType: ts.SyntaxKind = getEnumType(types[i], checker); - if (simpleTypes.has(enumType || types[i].kind) || isEnumtype(typeNode)) { - basicType = true; - } else { - referenceType = true; - } - if (basicType && referenceType && log) { - validateVariableType(typeNode, log); - return false; - } - } - return true; - } if (typeNode.parent && typeNode.parent.name && typeNode.kind === ts.SyntaxKind.AnyKeyword && log) { log.push({ @@ -972,27 +951,50 @@ export function isSimpleType(typeNode: ts.TypeNode, program: ts.Program, log?: L pos: typeNode.getStart() }); } - return false; + return getDeclarationType(typeNode, checker, log); } -function getEnumType(typeNode: ts.TypeNode, checker: ts.TypeChecker): ts.SyntaxKind { - if (!checker) { - return; +function getDeclarationType(typeNode: ts.TypeNode, checker: ts.TypeChecker, log: LogInfo[]): boolean { + if (simpleTypes.has(typeNode.kind)) { + return true; } - typeNode = typeNode || ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword); - if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName)) { - const type: ts.Type = - checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(typeNode.typeName)); - if (type.symbol && type.symbol.valueDeclaration) { - return type.symbol.valueDeclaration.kind; + if (checker) { + const type: ts.Type = checker.getTypeFromTypeNode(typeNode); + /* Enum */ + if (type.flags & 32) { + return true; + } + // @ts-ignore + if (type.types && type.types.length) { + // @ts-ignore + const types = type.types; + let basicType: boolean = false; + let referenceType: boolean = false; + for (let i = 0; i < types.length; i++) { + if (isBasicType(types[i].flags)) { + basicType = true; + } else { + referenceType = true; + } + } + if (basicType && referenceType && log) { + validateVariableType(typeNode, log); + return false; + } + if (!referenceType) { + return true; + } } } + return false; } -function isEnumtype(typeNode: ts.TypeNode): boolean { - if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName)) { - return enumCollection.has(typeNode.typeName.getText()); - } +function isBasicType(flags: number): boolean { + return [ + 4, /* String */ 8, /* Number */ 16 /* Boolean */, 32 /* Enum */, 64, /* BigInt */ + 128, /* StringLiteral */ 256, /* NumberLiteral */ 512 /* BooleanLiteral */, 1024 /* EnumLiteral */, + 2048 /* BigIntLiteral */ + ].includes(flags); } function isObservedClassType(type: ts.TypeNode): boolean { @@ -1153,7 +1155,9 @@ function validateWatchParam(type: LogType, pos: number, log: LogInfo[]): void { function validateVariableType(typeNode: ts.TypeNode, log: LogInfo[]): void { log.push({ type: LogType.ERROR, - message: 'The state variable type of a struct component cannot be declared by both a simple type and an object type.', + message: `The state variable type here is '${typeNode.getText()}', ` + + `it contains both a simple type and an object type,\n ` + + `which are not allowed to be defined for state variable of a struct.`, pos: typeNode.getStart() }); } -- Gitee From 978ee4b3d090c11bac552019274fec98c26db1e4 Mon Sep 17 00:00:00 2001 From: lihong Date: Tue, 17 Jan 2023 21:56:43 +0800 Subject: [PATCH 292/379] lihong67@huawei.com add validate for Length/ResourceStr/ResourceColor. Signed-off-by: lihong Change-Id: I728cf8f37b2227ccc09cbf164989cb83ce4aa5cc --- compiler/src/process_component_member.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index b7e19ab..02ba4dd 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -865,7 +865,7 @@ function getDeclarationType(typeNode: ts.TypeNode, checker: ts.TypeChecker, log: if (checker) { const type: ts.Type = checker.getTypeFromTypeNode(typeNode); /* Enum */ - if (type.flags & 32) { + if (type.flags & (32 | 1024)) { return true; } // @ts-ignore @@ -894,11 +894,12 @@ function getDeclarationType(typeNode: ts.TypeNode, checker: ts.TypeChecker, log: } function isBasicType(flags: number): boolean { - return [ - 4, /* String */ 8, /* Number */ 16 /* Boolean */, 32 /* Enum */, 64, /* BigInt */ - 128, /* StringLiteral */ 256, /* NumberLiteral */ 512 /* BooleanLiteral */, 1024 /* EnumLiteral */, - 2048 /* BigIntLiteral */ - ].includes(flags); + if (flags & (4 | /* String */ 8 | /* Number */ 16 | /* Boolean */ 32 | /* Enum */ 64 | /* BigInt */ + 128 | /* StringLiteral */ 256 | /* NumberLiteral */ 512 /* BooleanLiteral */| 1024 /* EnumLiteral */| + 2048 /* BigIntLiteral */)) { + return true; + } + return false; } function isObservedClassType(type: ts.TypeNode): boolean { -- Gitee From 0302c46e6fac72bb233db69d43e7bad870d055fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Wed, 18 Jan 2023 11:16:32 +0800 Subject: [PATCH 293/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 6126d91..aff25e7 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -494,8 +494,6 @@ function isCorrectInitFormParent(parent: string, child: string): boolean { case COMPONENT_PROP_DECORATOR: case COMPONENT_PROVIDE_DECORATOR: return true; - case COMPONENT_CUSTOM_DECORATOR: - return false; case COMPONENT_NON_DECORATOR: if ([COMPONENT_NON_DECORATOR, COMPONENT_STATE_DECORATOR, COMPONENT_LINK_DECORATOR, COMPONENT_PROP_DECORATOR, COMPONENT_OBJECT_LINK_DECORATOR, COMPONENT_STORAGE_LINK_DECORATOR].includes(parent)) { -- Gitee From acf5acb7a39cd2d212c115024c2e778a4494140d Mon Sep 17 00:00:00 2001 From: zhouzebin Date: Mon, 9 Jan 2023 14:32:36 +0800 Subject: [PATCH 294/379] adapter config with IDE Issue: https://gitee.com/openharmony/developtools_ace_ets2bundle/issues/I69JFZ?from=project-issue Signed-off-by: zhouzebin Change-Id: Ic30f84a8863601ad5e6cabb16e667de18bdb82bd --- compiler/main.js | 10 ++- compiler/src/gen_abc_plugin.ts | 6 +- compiler/src/gen_aot.ts | 121 ++++++++++++++++++++++++++++----- compiler/src/pre_define.ts | 4 ++ 4 files changed, 118 insertions(+), 23 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 3905371..f928229 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -27,6 +27,10 @@ const { TS2ABC } = require('./lib/pre_define'); +const { + checkAotConfig +} = require('./lib/gen_aot'); + const { configure, getLogger @@ -554,12 +558,12 @@ function loadModuleInfo(projectConfig, envArgs) { projectConfig.projectRootPath = buildJsonInfo.projectRootPath; projectConfig.modulePathMap = buildJsonInfo.modulePathMap; projectConfig.isOhosTest = buildJsonInfo.isOhosTest; - projectConfig.aotMode = buildJsonInfo.aotMode; - if (projectConfig.aotMode && projectConfig.compileMode === 'esmodule') { + if (checkAotConfig(buildJsonInfo)) { projectConfig.processTs = true; projectConfig.pandaMode = TS2ABC; - projectConfig.anBuildMode = buildJsonInfo.anBuildMode || "type"; projectConfig.anBuildOutPut = buildJsonInfo.anBuildOutPut; + projectConfig.anBuildMode = buildJsonInfo.anBuildMode; + projectConfig.apPath = buildJsonInfo.apPath; } else { projectConfig.processTs = false; projectConfig.pandaMode = buildJsonInfo.pandaMode; diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 848b2b6..0b9d982 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -75,7 +75,9 @@ import { MANAGE_WORKERS_SCRIPT, MAX_WORKER_NUMBER, GEN_ABC_SCRIPT, - GEN_MODULE_ABC_SCRIPT + GEN_MODULE_ABC_SCRIPT, + AOT_FULL, + AOT_PARTIAL } from './pre_define'; import { getOhmUrlByFilepath @@ -1316,7 +1318,7 @@ function processWorkersOfBuildMode(splittedData: any, cmdPrefix: string, workerN if (process.exitCode !== FAIL && process.env.watchMode !== 'true') { processExtraAsset(); if (projectConfig.compileMode === ESMODULE && - (projectConfig.anBuildMode === 'full' || projectConfig.anBuildMode === 'pgo')) { + (projectConfig.anBuildMode === AOT_FULL || projectConfig.anBuildMode === AOT_PARTIAL)) { const builtinAbcPath: string = generateBuiltinAbc(arkDir, nodeJs, initAbcEnv()); generateAot(arkDir, builtinAbcPath); } diff --git a/compiler/src/gen_aot.ts b/compiler/src/gen_aot.ts index 9efabcc..5ee93c9 100644 --- a/compiler/src/gen_aot.ts +++ b/compiler/src/gen_aot.ts @@ -23,7 +23,12 @@ import { SUCCESS, FAIL, MODULES_ABC, - TEMPORARY + TEMPORARY, + ESMODULE, + AOT_FULL, + AOT_TYPE, + AOT_PARTIAL, + AOT_PROFILE_SUFFIX } from './pre_define'; import { isWindows, @@ -31,36 +36,116 @@ import { toUnixPath, getArkBuildDir, getBuildBinDir, + validateFilePathLength, validateFilePathLengths } from './utils'; const red: string = '\u001b[31m'; const reset: string = '\u001b[39m'; +function checkAotPartialConfig(buildJsonInfo: any): boolean { + if (buildJsonInfo.anBuildMode !== AOT_PARTIAL && !buildJsonInfo.apPath) { + return false; + } + if (buildJsonInfo.compileMode !== ESMODULE) { + logger.error(`ArkTS:ERROR Aot's partial mode must config compileMode with esmodule.`); + process.exit(FAIL); + } + if (buildJsonInfo.anBuildMode !== AOT_PARTIAL) { + logger.error(`ArkTS:ERROR Aot's partial mode must config aotBuildMode with partial.`); + process.exit(FAIL); + } + if (!buildJsonInfo.apPath) { + logger.error(`ArkTS:ERROR Aot's partial mode must config a valid apPath.`); + process.exit(FAIL); + } + if (path.extname(buildJsonInfo.apPath) !== AOT_PROFILE_SUFFIX) { + logger.error(`ArkTS:ERROR apPath for Aot's partial mode must with suffix "${AOT_PROFILE_SUFFIX}".`); + process.exit(FAIL); + } + if (!fs.existsSync(buildJsonInfo.apPath)) { + logger.error(`ArkTS:ERROR apPath for Aot's partial mode is not found in "${buildJsonInfo.apPath}".`); + process.exit(FAIL); + } + if (!buildJsonInfo.anBuildOutPut) { + logger.error(`ArkTS:ERROR Aot's partial mode need anBuildOutPut.`); + process.exit(FAIL); + } + logger.debug(`Aot compiler's partial mode.`); + return true; +} + +function checkAotFullConfig(buildJsonInfo: any): boolean { + if (buildJsonInfo.anBuildMode !== AOT_FULL) { + return false; + } + if (buildJsonInfo.compileMode !== ESMODULE) { + logger.error(`ArkTS:ERROR Aot's full mode must config compileMode with esmodule.`); + process.exit(FAIL); + } + if (buildJsonInfo.apPath) { + logger.error(`ArkTS:ERROR Aot's full mode do not need apPath.`); + process.exit(FAIL); + } + if (!buildJsonInfo.anBuildOutPut) { + logger.error(`ArkTS:ERROR Aot's full mode need anBuildOutPut.`); + process.exit(FAIL); + } + logger.debug(`Aot compiler's full mode.`); + return true; +} + +function checkAotTypeConfig(buildJsonInfo: any): boolean { + if (buildJsonInfo.anBuildMode !== AOT_TYPE) { + return false; + } + if (buildJsonInfo.compileMode !== ESMODULE) { + logger.error(`ArkTS:ERROR Aot's type mode must config compileMode with esmodule.`); + process.exit(FAIL); + } + if (buildJsonInfo.apPath) { + logger.error(`ArkTS:ERROR Aot's type mode do not need apPath.`); + process.exit(FAIL); + } + logger.debug(`Aot compiler's type mode.`); + return true; +} + +export function checkAotConfig(buildJsonInfo: any): boolean { + return checkAotTypeConfig(buildJsonInfo) || checkAotFullConfig(buildJsonInfo) || checkAotPartialConfig(buildJsonInfo); +} + export function generateAot(arkDir: string, builtinAbcPath: string): void { let aotCompiler: string = path.join(getBuildBinDir(arkDir), isWindows() ? "ark_aot_compiler.exe" : "ark_aot_compiler"); - const appAbc: string = path.relative(process.cwd(), path.join(projectConfig.buildPath, MODULES_ABC)); - const appAot: string = path.relative(process.cwd(), path.join(projectConfig.anBuildOutPut, projectConfig.moduleName)); - const profile: string = path.relative(process.cwd(), path.join( - projectConfig.modulePathMap[projectConfig.moduleName], "profile.aprof")); + const appAbc: string = path.join(projectConfig.buildPath, MODULES_ABC); + const appAot: string = path.join(projectConfig.anBuildOutPut, projectConfig.moduleName); - if (!validateFilePathLengths([aotCompiler, appAbc, builtinAbcPath, appAot, profile])) { - logger.error(reset, `ArkTS:ERROR generateAot failed. Invalid file path.`); - return; + if (!validateFilePathLengths([aotCompiler, appAbc, builtinAbcPath, appAot])) { + logger.error(`ArkTS:ERROR generateAot failed. Invalid file path.`); + process.exit(FAIL); } - const singleCmdPrefix: string = `"${aotCompiler}" --builtins-dts="${path.relative(process.cwd(), builtinAbcPath)}" ` + - `--aot-file="${appAot}" --target-triple=aarch64-unknown-linux-gnu `; + if (!fs.existsSync(appAbc)) { + logger.error(`ArkTS:ERROR generateAot failed. AppAbc not found in "${appAbc}"`); + process.exit(FAIL); + } + const singleCmdPrefix: string = `"${aotCompiler}" --builtins-dts="${builtinAbcPath}" ` + + `--aot-file="${appAot}" --target-triple=aarch64-unknown-linux-gnu `; let singleCmd: string = ""; - if (projectConfig.anBuildMode === "full") { + if (projectConfig.anBuildMode === AOT_FULL) { singleCmd = singleCmdPrefix + ` "${appAbc}"`; - } else if (projectConfig.anBuildMode === "pgo") { + } else if (projectConfig.anBuildMode === AOT_PARTIAL) { + const profile: string = projectConfig.apPath; + if (!validateFilePathLength(profile)) { + logger.error(`ArkTS:ERROR generateAot failed. Invalid profile file path.`); + process.exit(FAIL); + } if (!fs.existsSync(profile)) { - logger.error(reset, `ArkTS:ERROR generateAot failed. PGO mode lost profile in "${profile}"`); + logger.error(`ArkTS:ERROR generateAot failed. Partial mode lost profile in "${profile}"`); process.exit(FAIL); } singleCmd = singleCmdPrefix + ` --enable-pgo-profiler=true --pgo-profiler-path="${profile}" "${appAbc}"`; } else { - logger.error(reset, `ArkTS:ERROR generateAot failed. unknown anBuildMode: ${projectConfig.anBuildMode}`); + logger.error(`ArkTS:ERROR generateAot failed. unknown anBuildMode: ${projectConfig.anBuildMode}`); process.exit(FAIL); } try { @@ -68,7 +153,7 @@ export function generateAot(arkDir: string, builtinAbcPath: string): void { mkdirsSync(projectConfig.anBuildOutPut); childProcess.execSync(singleCmd); } catch (e) { - logger.error(reset, `ArkTS:ERROR Failed to generate aot file. Error message: ${e}`); + logger.error(`ArkTS:ERROR Failed to generate aot file. Error message: ${e}`); process.exit(FAIL); } } @@ -77,12 +162,12 @@ export function generateBuiltinAbc(arkDir: string, nodeJs: string, abcArgs: stri const builtinFilePath: string = path.join(getArkBuildDir(arkDir), "aot", "src", "lib_ark_builtins.d.ts"); const builtinAbcPath: string = path.join(process.env.cachePath, TEMPORARY, "aot", "lib_ark_builtins.d.abc"); if (fs.existsSync(builtinAbcPath)) { - logger.info(`builtin.d.abc already exists, no need to rebuild again`); + logger.debug(`builtin.d.abc already exists, no need to rebuild again`); return builtinAbcPath; } mkdirsSync(path.dirname(builtinAbcPath)); if (!validateFilePathLengths([builtinFilePath, builtinAbcPath])) { - logger.error(reset, `ArkTS:ERROR generateBuiltinAbc failed. Invalid file path.`); + logger.error(`ArkTS:ERROR generateBuiltinAbc failed. Invalid file path.`); process.exit(FAIL); } const tempAbcArgs: string[] = abcArgs.slice(0); @@ -91,7 +176,7 @@ export function generateBuiltinAbc(arkDir: string, nodeJs: string, abcArgs: stri logger.debug(`generateBuiltinAbc cmd: ${singleCmd}`); childProcess.execSync(singleCmd); } catch (e) { - logger.error(reset, `ArkTS:ERROR Failed to generate builtin to abc. Error message: ${e}`); + logger.error(`ArkTS:ERROR Failed to generate builtin to abc. Error message: ${e}`); process.exit(FAIL); } return builtinAbcPath; diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index b57dbd7..d07d54c 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -265,6 +265,10 @@ export const PREBUILDMODE_JSON: string = 'preBuildMode.json'; export const SOURCEMAPS_JSON: string = 'sourceMaps.json'; export const SOURCEMAPS: string = 'sourceMaps.map'; export const PROTO_FILESINFO_TXT: string = 'protoFilesInfo.txt'; +export const AOT_FULL: string = 'full'; +export const AOT_TYPE: string = 'type'; +export const AOT_PARTIAL: string = 'partial'; +export const AOT_PROFILE_SUFFIX: string = '.ap'; export const ESMODULE: string = 'esmodule'; export const JSBUNDLE: string = 'jsbundle'; -- Gitee From 8b785e6700e27dd3bc75015ece4ddf6f75bbd11e Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 18 Jan 2023 15:01:31 +0800 Subject: [PATCH 295/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 极速预览带全局变量性能优化 Signed-off-by: houhaoyu Change-Id: I920dcf5a3992032e4dc580a4250fc175cb323ee4 --- compiler/server/build_pipe_server.js | 120 +++++++++++---------------- 1 file changed, 47 insertions(+), 73 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index fe34896..7f66788 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -39,7 +39,7 @@ let supplement = { line: 0, column: 0, fileName: '' -} +}; const pluginCommandChannelMessageHandlers = { 'compileComponent': handlePluginCompileComponent, @@ -58,10 +58,7 @@ let compileWithCheck; let globalVariable = []; let propertyVariable = []; let globalDeclaration = new Map(); -let variableDoubleCheck = new Set(); -let compileVariable = false; let connectNum = 0; -let script = ''; const maxConnectNum = 8; function init(port) { @@ -92,7 +89,7 @@ function handlePluginConnect(ws) { try { const jsonData = JSON.parse(message); handlePluginCommand(jsonData); - } catch(e) { + } catch (e) { } }); } @@ -109,7 +106,7 @@ function handlePluginCompileComponent(jsonData) { if (receivedMsg_) { return; } - } else if (messages.length > 0){ + } else if (messages.length > 0) { jsonData = messages[0]; } else { return; @@ -118,14 +115,15 @@ function handlePluginCompileComponent(jsonData) { const receivedMsg = _.cloneDeep(jsonData); const compilerOptions = ts.readConfigFile( path.resolve(__dirname, '../tsconfig.json'), ts.sys.readFile).config.compilerOptions; - Object.assign(compilerOptions, { - "sourceMap": false, - }); + Object.assign(compilerOptions, { + 'sourceMap': false + }); const sourceNode = ts.createSourceFile('preview.ets', 'struct preview{build(){' + receivedMsg.data.script + '}}', ts.ScriptTarget.Latest, true, ts.ScriptKind.ETS, compilerOptions); compileWithCheck = jsonData.data.compileWithCheck || 'true'; - checkPreparation(receivedMsg); + receivedMsg.data.variableScript = ''; + checkPreparation(receivedMsg, sourceNode); const previewStatements = []; const log = []; supplement = { @@ -133,7 +131,7 @@ function handlePluginCompileComponent(jsonData) { line: parseInt(JSON.parse(receivedMsg.data.offset).line), column: parseInt(JSON.parse(receivedMsg.data.offset).column), fileName: receivedMsg.data.filePath || '' - } + }; processComponentChild(sourceNode.statements[0].members[1].body, previewStatements, log, supplement); supplement.isAcceleratePreview = false; const newSource = ts.factory.updateSourceFile(sourceNode, previewStatements); @@ -143,25 +141,17 @@ function handlePluginCompileComponent(jsonData) { receivedMsg.data.script = ts.transpileModule(result, {}).outputText; receivedMsg.data.log = log; if (receivedMsg.data.viewID) { - receivedMsg.data.script = `function quickPreview(context) { + receivedMsg.data.script = receivedMsg.data.variableScript + `function quickPreview(context) { const fastPreview = function build(){ ${receivedMsg.data.script} }.bind(context); fastPreview(); } - quickPreview(GetRootView().findChildByIdForPreview(${receivedMsg.data.viewID}))` - script = receivedMsg.data.script; + quickPreview(GetRootView().findChildByIdForPreview(${receivedMsg.data.viewID}))`; } callEs2abc(receivedMsg); } -function handlePluginCompileVariable() { - writeFileSync(previewCacheFilePath, receivedMsg_.data.variableScript); - receivedMsg_.data.script = ts.transpileModule(receivedMsg_.data.variableScript, {}).outputText + script; - script = ''; - callEs2abc(receivedMsg_); -} - function transformResourceNode(newSource, log) { const transformerFactory = (context) => { return (rootNode) => { @@ -170,8 +160,8 @@ function transformResourceNode(newSource, log) { return processResourceNode(node, log); } return ts.visitNode(rootNode, visit); - } - } + }; + }; const transformationResult = ts.transform(newSource, [transformerFactory]); return transformationResult.transformed[0]; } @@ -184,19 +174,27 @@ function processResourceNode(node, log) { } } -function checkPreparation(receivedMsg) { +function checkPreparation(receivedMsg, sourceNode) { + let variableScript = ''; if (previewCacheFilePath && fs.existsSync(previewCacheFilePath) && compileWithCheck === 'true') { - globalVariable = receivedMsg.data.globalVariable.map((item)=>{ + globalVariable = receivedMsg.data.globalVariable || globalVariable; + globalVariable = globalVariable.map((item) => { globalDeclaration.set(item.identifier, item.declaration); return item.identifier; - }) + }); + for (const [key, value] of sourceNode.identifiers) { + if (globalVariable.includes(key)) { + variableScript += globalDeclaration.get(key) + '\n'; + } + } propertyVariable = receivedMsg.data.propertyVariable || propertyVariable; - writeFileSync(previewCacheFilePath, 'struct preview{build(){' + receivedMsg.data.script + '}}'); + receivedMsg.data.variableScript = ts.transpileModule(variableScript, {}).outputText; + writeFileSync(previewCacheFilePath, variableScript + 'struct preview{build(){' + receivedMsg.data.script + '}}'); } } function callEs2abc(receivedMsg) { - if (fs.existsSync(es2abcFilePath + '.exe') || fs.existsSync(es2abcFilePath)){ + if (fs.existsSync(es2abcFilePath + '.exe') || fs.existsSync(es2abcFilePath)) { es2abc(receivedMsg); } else { es2abcFilePath = path.join(__dirname, '../bin/ark/build-mac/bin/es2abc'); @@ -211,23 +209,15 @@ function es2abc(receivedMsg) { Buffer.from(receivedMsg.data.script).toString('base64') + ' --base64Output'; try { pipeProcess.exec(cmd, (error, stdout, stderr) => { - if (compileVariable) { - if (stdout) { - receivedMsg.data.script = stdout; - } else { - receivedMsg.data.script = ""; - } + if (stdout) { + receivedMsg.data.script = stdout; } else { - if (stdout) { - receivedMsg.data.script = stdout; - } else { - receivedMsg.data.script = ""; - } + receivedMsg.data.script = ''; } compileStatus = true; receivedMsg_ = receivedMsg; responseToPlugin(); - }) + }); } catch (e) { } } @@ -238,8 +228,8 @@ function resolveDiagnostic(diagnostic) { if (diagnostic.file) { const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - errorInfo.push( - `ArkTS:ERROR File: ${diagnostic.file.fileName}:${line + 1}:${character + 1}\n ${message}\n`); + errorInfo.push( + `ArkTS:ERROR File: ${diagnostic.file.fileName}:${line + 1}:${character + 1}\n ${message}\n`); } else { errorInfo.push(`ArkTS:ERROR: ${message}`); } @@ -254,38 +244,25 @@ function delayPrintLogCount() { } function responseToPlugin() { - if ((compileWithCheck !== "true" && compileStatus == true) || - (compileWithCheck === "true" && compileStatus == true && checkStatus == true) ) { + if ((compileWithCheck !== 'true' && compileStatus == true) || + (compileWithCheck === 'true' && compileStatus == true && checkStatus == true)) { if (receivedMsg_) { if (errorInfo && errorInfo.length) { receivedMsg_.data.log = receivedMsg_.data.log || []; receivedMsg_.data.log.push(...errorInfo); } - if (!receivedMsg_.data.log.length && variableDoubleCheck.size && !compileVariable) { - compileVariable = true; + pluginSocket.send(JSON.stringify(receivedMsg_), (err) => { + start = false; checkStatus = false; compileStatus = false; - let variableContent = ''; - variableDoubleCheck.forEach((item)=>{ - variableContent += globalDeclaration.get(item) + '\n'; - }) - receivedMsg_.data.variableScript = variableContent; - handlePluginCompileVariable(); - } else { - pluginSocket.send(JSON.stringify(receivedMsg_), (err) => { - start = false; - checkStatus = false; - compileStatus = false; - errorInfo = []; - receivedMsg_ = undefined; - variableDoubleCheck = new Set(); - compileVariable = false; - messages.shift(); - if (messages.length > 0) { - handlePluginCompileComponent(); - } - }); - } + errorInfo = []; + receivedMsg_ = undefined; + globalDeclaration.clear(); + messages.shift(); + if (messages.length > 0) { + handlePluginCompileComponent(); + } + }); } } } @@ -293,20 +270,17 @@ function responseToPlugin() { function validateError(message) { const propInfoReg = /Cannot find name\s*'(\$?\$?[_a-zA-Z0-9]+)'/; const stateInfoReg = /Property\s*'(\$?[_a-zA-Z0-9]+)' does not exist on type/; - if (!compileVariable && (matchMessage(message, [...globalVariable, ...props], propInfoReg, true) || - matchMessage(message, [...propertyVariable, ...props], stateInfoReg))) { + if (matchMessage(message, [...globalVariable, ...props], propInfoReg) || + matchMessage(message, [...propertyVariable, ...props], stateInfoReg)) { return false; } return true; } -function matchMessage(message, nameArr, reg, isGlobalVariable = false) { +function matchMessage(message, nameArr, reg) { if (reg.test(message)) { const match = message.match(reg); if (match[1] && nameArr.includes(match[1])) { - if (isGlobalVariable) { - variableDoubleCheck.add(match[1]); - } return true; } } -- Gitee From b5b7b46b37201c5377be8fe78bf4a0c8cc0706c3 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 18 Jan 2023 20:00:17 +0800 Subject: [PATCH 296/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 极速预览带全局变量不支持多层引用 Signed-off-by: houhaoyu Change-Id: I574f2dbf4f9a1cb5c0a739304b4d528eaf2c629d --- compiler/server/build_pipe_server.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index 7f66788..5667286 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -268,10 +268,8 @@ function responseToPlugin() { } function validateError(message) { - const propInfoReg = /Cannot find name\s*'(\$?\$?[_a-zA-Z0-9]+)'/; const stateInfoReg = /Property\s*'(\$?[_a-zA-Z0-9]+)' does not exist on type/; - if (matchMessage(message, [...globalVariable, ...props], propInfoReg) || - matchMessage(message, [...propertyVariable, ...props], stateInfoReg)) { + if (matchMessage(message, [...propertyVariable, ...props], stateInfoReg)) { return false; } return true; -- Gitee From be8fa3bae015ab7e13f9b3fdc515c1c6bd375dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Thu, 19 Jan 2023 10:27:01 +0800 Subject: [PATCH 297/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index aff25e7..152e9dd 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -502,8 +502,6 @@ function isCorrectInitFormParent(parent: string, child: string): boolean { break; case COMPONENT_LINK_DECORATOR: return ![COMPONENT_NON_DECORATOR].includes(parent); - case COMPONENT_OBJECT_LINK_DECORATOR: - return [COMPONENT_STATE_DECORATOR].includes(parent); } return false; } @@ -660,6 +658,9 @@ function validateIllegalInitFromParent(node: ts.ObjectLiteralElementLike, proper } else if (parentPropertyKind === COMPONENT_STATE_DECORATOR && curPropertyKind === COMPONENT_STATE_DECORATOR) { type = LogType.WARN; + } else if ([COMPONENT_STATE_DECORATOR, COMPONENT_OBJECT_LINK_DECORATOR].includes( + parentPropertyKind) && curPropertyKind === COMPONENT_OBJECT_LINK_DECORATOR) { + type = LogType.WARN; } log.push({ type: type, -- Gitee From 0958b2cea61fb5cb23cc3ed76621a6d662f5d985 Mon Sep 17 00:00:00 2001 From: zhouzebin Date: Thu, 19 Jan 2023 14:37:19 +0800 Subject: [PATCH 298/379] adapter config with IDE Signed-off-by: zhouzebin Change-Id: I24ef863229c6516c007913ceae2db0248b9c0114 --- compiler/main.js | 2 +- compiler/src/gen_abc_plugin.ts | 4 +-- compiler/src/gen_aot.ts | 62 +++++++++++++++++++--------------- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index f928229..09c9373 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -558,7 +558,7 @@ function loadModuleInfo(projectConfig, envArgs) { projectConfig.projectRootPath = buildJsonInfo.projectRootPath; projectConfig.modulePathMap = buildJsonInfo.modulePathMap; projectConfig.isOhosTest = buildJsonInfo.isOhosTest; - if (checkAotConfig(buildJsonInfo)) { + if (checkAotConfig(buildJsonInfo, logger)) { projectConfig.processTs = true; projectConfig.pandaMode = TS2ABC; projectConfig.anBuildOutPut = buildJsonInfo.anBuildOutPut; diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 0b9d982..758ab7d 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -1319,8 +1319,8 @@ function processWorkersOfBuildMode(splittedData: any, cmdPrefix: string, workerN processExtraAsset(); if (projectConfig.compileMode === ESMODULE && (projectConfig.anBuildMode === AOT_FULL || projectConfig.anBuildMode === AOT_PARTIAL)) { - const builtinAbcPath: string = generateBuiltinAbc(arkDir, nodeJs, initAbcEnv()); - generateAot(arkDir, builtinAbcPath); + const builtinAbcPath: string = generateBuiltinAbc(arkDir, nodeJs, initAbcEnv(), logger); + generateAot(arkDir, builtinAbcPath, logger); } } }); diff --git a/compiler/src/gen_aot.ts b/compiler/src/gen_aot.ts index 5ee93c9..aa8a7ef 100644 --- a/compiler/src/gen_aot.ts +++ b/compiler/src/gen_aot.ts @@ -18,9 +18,7 @@ import * as process from 'process'; import * as fs from 'fs'; import * as path from 'path'; import { projectConfig } from '../main'; -import { logger } from './compile_info'; import { - SUCCESS, FAIL, MODULES_ABC, TEMPORARY, @@ -43,90 +41,97 @@ import { const red: string = '\u001b[31m'; const reset: string = '\u001b[39m'; -function checkAotPartialConfig(buildJsonInfo: any): boolean { +function processExit(isFastBuild = false): void { + if (!isFastBuild) { + process.exit(FAIL); + } +} + +function checkAotPartialConfig(buildJsonInfo: any, logger: any, isFastBuild: boolean): boolean { if (buildJsonInfo.anBuildMode !== AOT_PARTIAL && !buildJsonInfo.apPath) { return false; } if (buildJsonInfo.compileMode !== ESMODULE) { logger.error(`ArkTS:ERROR Aot's partial mode must config compileMode with esmodule.`); - process.exit(FAIL); + processExit(isFastBuild); } if (buildJsonInfo.anBuildMode !== AOT_PARTIAL) { logger.error(`ArkTS:ERROR Aot's partial mode must config aotBuildMode with partial.`); - process.exit(FAIL); + processExit(isFastBuild); } if (!buildJsonInfo.apPath) { logger.error(`ArkTS:ERROR Aot's partial mode must config a valid apPath.`); - process.exit(FAIL); + processExit(isFastBuild); } if (path.extname(buildJsonInfo.apPath) !== AOT_PROFILE_SUFFIX) { logger.error(`ArkTS:ERROR apPath for Aot's partial mode must with suffix "${AOT_PROFILE_SUFFIX}".`); - process.exit(FAIL); + processExit(isFastBuild); } if (!fs.existsSync(buildJsonInfo.apPath)) { logger.error(`ArkTS:ERROR apPath for Aot's partial mode is not found in "${buildJsonInfo.apPath}".`); - process.exit(FAIL); + processExit(isFastBuild); } if (!buildJsonInfo.anBuildOutPut) { logger.error(`ArkTS:ERROR Aot's partial mode need anBuildOutPut.`); - process.exit(FAIL); + processExit(isFastBuild); } logger.debug(`Aot compiler's partial mode.`); return true; } -function checkAotFullConfig(buildJsonInfo: any): boolean { +function checkAotFullConfig(buildJsonInfo: any, logger: any, isFastBuild: boolean): boolean { if (buildJsonInfo.anBuildMode !== AOT_FULL) { return false; } if (buildJsonInfo.compileMode !== ESMODULE) { logger.error(`ArkTS:ERROR Aot's full mode must config compileMode with esmodule.`); - process.exit(FAIL); + processExit(isFastBuild); } if (buildJsonInfo.apPath) { logger.error(`ArkTS:ERROR Aot's full mode do not need apPath.`); - process.exit(FAIL); + processExit(isFastBuild); } if (!buildJsonInfo.anBuildOutPut) { logger.error(`ArkTS:ERROR Aot's full mode need anBuildOutPut.`); - process.exit(FAIL); + processExit(isFastBuild); } logger.debug(`Aot compiler's full mode.`); return true; } -function checkAotTypeConfig(buildJsonInfo: any): boolean { +function checkAotTypeConfig(buildJsonInfo: any, logger: any, isFastBuild: boolean): boolean { if (buildJsonInfo.anBuildMode !== AOT_TYPE) { return false; } if (buildJsonInfo.compileMode !== ESMODULE) { logger.error(`ArkTS:ERROR Aot's type mode must config compileMode with esmodule.`); - process.exit(FAIL); + processExit(isFastBuild); } if (buildJsonInfo.apPath) { logger.error(`ArkTS:ERROR Aot's type mode do not need apPath.`); - process.exit(FAIL); + processExit(isFastBuild); } logger.debug(`Aot compiler's type mode.`); return true; } -export function checkAotConfig(buildJsonInfo: any): boolean { - return checkAotTypeConfig(buildJsonInfo) || checkAotFullConfig(buildJsonInfo) || checkAotPartialConfig(buildJsonInfo); +export function checkAotConfig(buildJsonInfo: any, logger: any, isFastBuild = false): boolean { + return checkAotTypeConfig(buildJsonInfo, logger, isFastBuild) || + checkAotFullConfig(buildJsonInfo, logger, isFastBuild) || checkAotPartialConfig(buildJsonInfo, logger, isFastBuild); } -export function generateAot(arkDir: string, builtinAbcPath: string): void { +export function generateAot(arkDir: string, builtinAbcPath: string, logger: any, isFastBuild = false): void { let aotCompiler: string = path.join(getBuildBinDir(arkDir), isWindows() ? "ark_aot_compiler.exe" : "ark_aot_compiler"); const appAbc: string = path.join(projectConfig.buildPath, MODULES_ABC); const appAot: string = path.join(projectConfig.anBuildOutPut, projectConfig.moduleName); if (!validateFilePathLengths([aotCompiler, appAbc, builtinAbcPath, appAot])) { logger.error(`ArkTS:ERROR generateAot failed. Invalid file path.`); - process.exit(FAIL); + processExit(isFastBuild); } if (!fs.existsSync(appAbc)) { logger.error(`ArkTS:ERROR generateAot failed. AppAbc not found in "${appAbc}"`); - process.exit(FAIL); + processExit(isFastBuild); } const singleCmdPrefix: string = `"${aotCompiler}" --builtins-dts="${builtinAbcPath}" ` + `--aot-file="${appAot}" --target-triple=aarch64-unknown-linux-gnu `; @@ -137,16 +142,16 @@ export function generateAot(arkDir: string, builtinAbcPath: string): void { const profile: string = projectConfig.apPath; if (!validateFilePathLength(profile)) { logger.error(`ArkTS:ERROR generateAot failed. Invalid profile file path.`); - process.exit(FAIL); + processExit(isFastBuild); } if (!fs.existsSync(profile)) { logger.error(`ArkTS:ERROR generateAot failed. Partial mode lost profile in "${profile}"`); - process.exit(FAIL); + processExit(isFastBuild); } singleCmd = singleCmdPrefix + ` --enable-pgo-profiler=true --pgo-profiler-path="${profile}" "${appAbc}"`; } else { logger.error(`ArkTS:ERROR generateAot failed. unknown anBuildMode: ${projectConfig.anBuildMode}`); - process.exit(FAIL); + processExit(isFastBuild); } try { logger.debug(`generateAot cmd: ${singleCmd}`); @@ -154,11 +159,12 @@ export function generateAot(arkDir: string, builtinAbcPath: string): void { childProcess.execSync(singleCmd); } catch (e) { logger.error(`ArkTS:ERROR Failed to generate aot file. Error message: ${e}`); - process.exit(FAIL); + processExit(isFastBuild); } } -export function generateBuiltinAbc(arkDir: string, nodeJs: string, abcArgs: string[]): string { +export function generateBuiltinAbc(arkDir: string, nodeJs: string, abcArgs: string[], + logger: any, isFastBuild = false): string { const builtinFilePath: string = path.join(getArkBuildDir(arkDir), "aot", "src", "lib_ark_builtins.d.ts"); const builtinAbcPath: string = path.join(process.env.cachePath, TEMPORARY, "aot", "lib_ark_builtins.d.abc"); if (fs.existsSync(builtinAbcPath)) { @@ -168,7 +174,7 @@ export function generateBuiltinAbc(arkDir: string, nodeJs: string, abcArgs: stri mkdirsSync(path.dirname(builtinAbcPath)); if (!validateFilePathLengths([builtinFilePath, builtinAbcPath])) { logger.error(`ArkTS:ERROR generateBuiltinAbc failed. Invalid file path.`); - process.exit(FAIL); + processExit(isFastBuild); } const tempAbcArgs: string[] = abcArgs.slice(0); let singleCmd: string = `${nodeJs} ${tempAbcArgs.join(' ')} "${toUnixPath(builtinFilePath)}" -q -b -m --merge-abc -o "${builtinAbcPath}"`; @@ -177,7 +183,7 @@ export function generateBuiltinAbc(arkDir: string, nodeJs: string, abcArgs: stri childProcess.execSync(singleCmd); } catch (e) { logger.error(`ArkTS:ERROR Failed to generate builtin to abc. Error message: ${e}`); - process.exit(FAIL); + processExit(isFastBuild); } return builtinAbcPath; } -- Gitee From 8fbef521470f32a56694d2fa5405177c981595de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Thu, 19 Jan 2023 07:39:58 +0000 Subject: [PATCH 299/379] update compiler/src/process_custom_component.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 152e9dd..63ad12a 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -655,9 +655,6 @@ function validateIllegalInitFromParent(node: ts.ObjectLiteralElementLike, proper let type: LogType = LogType.ERROR; if (inputType) { type = inputType; - } else if (parentPropertyKind === COMPONENT_STATE_DECORATOR && - curPropertyKind === COMPONENT_STATE_DECORATOR) { - type = LogType.WARN; } else if ([COMPONENT_STATE_DECORATOR, COMPONENT_OBJECT_LINK_DECORATOR].includes( parentPropertyKind) && curPropertyKind === COMPONENT_OBJECT_LINK_DECORATOR) { type = LogType.WARN; -- Gitee From 896947ac5037574d6a3c5409e096dec95674528a Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Tue, 17 Jan 2023 19:50:23 +0800 Subject: [PATCH 300/379] Remove cache path when buildmode change Signed-off-by: chenqy930 Change-Id: I1ed2fb1f7c22992a8a221f367453279f47eb4ed8 --- compiler/webpack.config.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 748d141..883195d 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -33,7 +33,7 @@ const { } = require('./main'); const { ResultStates } = require('./lib/compile_info'); const { processUISyntax } = require('./lib/process_ui_syntax'); -const { IGNORE_ERROR_CODE, removeDir } = require('./lib/utils'); +const { IGNORE_ERROR_CODE, removeDir, mkdirsSync } = require('./lib/utils'); const { BUILD_SHARE_PATH, PREBUILDMODE_JSON } = require('./lib/pre_define'); process.env.watchMode = (process.env.watchMode && process.env.watchMode === 'true') || 'false'; @@ -433,7 +433,8 @@ function clearWebpackCacheByBuildMode() { if (fs.existsSync(CACHED_BUILDMODE)) { let cachedBuildMode = JSON.parse(fs.readFileSync(CACHED_BUILDMODE).toString()).buildMode; if (cachedBuildMode !== projectConfig.buildArkMode) { - removeDir(path.resolve(projectConfig.cachePath, '.ets_cache')); + removeDir(projectConfig.cachePath); + mkdirsSync(projectConfig.cachePath); } } } -- Gitee From 43dd28aa207a12c0fa535b82c09afe266da8132e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Jan 2023 13:49:50 +0800 Subject: [PATCH 301/379] lizhouze@huawei.com Signed-off-by: unknown --- compiler/src/process_custom_component.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 63ad12a..5b7c004 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -427,6 +427,10 @@ function checkFromParentToChild(node: ts.ObjectLiteralElementLike, customCompone validateIllegalInitFromParent(node, propertyName, curPropertyKind, node.initializer.getText(), COMPONENT_NON_DECORATOR, log); } + } else if (curPropertyKind === COMPONENT_OBJECT_LINK_DECORATOR && node.initializer && + (ts.isPropertyAccessExpression(node.initializer) || + ts.isElementAccessExpression(node.initializer))) { + return; } else { parentPropertyName = getParentPropertyName(node as ts.PropertyAssignment, curPropertyKind, log) || propertyName; -- Gitee From 0e40d95d4138f6893846e467821694c1dabed3c7 Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Tue, 17 Jan 2023 20:59:47 +0800 Subject: [PATCH 302/379] Refactor utils: move ark util methods to ark_utils Signed-off-by: chenqy930 Change-Id: Ia2fe2282676c2667c37528659910d4d35e0faa0e --- compiler/main.js | 1 + compiler/src/ark_utils.ts | 445 ++++++++++++++++++++++++++++ compiler/src/compile_info.ts | 9 +- compiler/src/gen_abc_plugin.ts | 114 +++---- compiler/src/gen_aot.ts | 12 +- compiler/src/pre_define.ts | 2 + compiler/src/process_har_writejs.ts | 3 +- compiler/src/process_source_file.ts | 5 +- compiler/src/process_ui_syntax.ts | 10 +- compiler/src/resolve_ohm_url.ts | 39 --- compiler/src/result_process.ts | 7 +- compiler/src/utils.ts | 419 ++------------------------ compiler/src/validate_ui_syntax.ts | 10 +- 13 files changed, 564 insertions(+), 512 deletions(-) create mode 100644 compiler/src/ark_utils.ts diff --git a/compiler/main.js b/compiler/main.js index 09c9373..6d3b6cc 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -65,6 +65,7 @@ function initProjectConfig(projectConfig) { path.join(process.cwd(), 'sample'); projectConfig.buildPath = projectConfig.buildPath || process.env.aceModuleBuild || path.resolve(projectConfig.projectPath, 'build'); + projectConfig.aceModuleBuild = projectConfig.buildPath; // To be compatible with both webpack and rollup projectConfig.manifestFilePath = projectConfig.manifestFilePath || process.env.aceManifestPath || path.join(projectConfig.projectPath, 'manifest.json'); projectConfig.aceProfilePath = projectConfig.aceProfilePath || process.env.aceProfilePath; diff --git a/compiler/src/ark_utils.ts b/compiler/src/ark_utils.ts new file mode 100644 index 0000000..904e187 --- /dev/null +++ b/compiler/src/ark_utils.ts @@ -0,0 +1,445 @@ +/* + * 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 path from 'path'; +import ts from 'typescript'; +import fs from 'fs'; +import { minify, MinifyOutput } from 'terser'; + +import { + NODE_MODULES, + TEMPORARY, + MAIN, + AUXILIARY, + ZERO, + ONE, + EXTNAME_JS, + EXTNAME_TS, + EXTNAME_MJS, + EXTNAME_CJS, + EXTNAME_ABC, + EXTNAME_ETS, + EXTNAME_TS_MAP, + EXTNAME_JS_MAP, + ESMODULE, + FAIL, + TS2ABC, + ES2ABC, + EXTNAME_PROTO_BIN, + TS_NOCHECK +} from './pre_define'; +import { + isMac, + isWindows, + isNodeModulesFile, + genTemporaryPath, + mkdirsSync, + toUnixPath, + validateFilePathLength +} from './utils'; +import { processSystemApi } from './validate_ui_syntax'; + +const red: string = '\u001b[31m'; +const reset: string = '\u001b[39m'; + +export const SRC_MAIN: string = 'src/main'; + +export var newSourceMaps: Object = {}; +export const packageCollection: Map> = new Map(); + +export function getOhmUrlByFilepath(filePath: string, projectConfig: any, logger: any): string { + let unixFilePath: string = toUnixPath(filePath); + unixFilePath = unixFilePath.substring(0, filePath.lastIndexOf('.')); // remove extension + const REG_PROJECT_SRC: RegExp = /(\S+)\/src\/(?:main|ohosTest)\/(ets|js)\/(\S+)/; + + const packageInfo: string[] = getPackageInfo(projectConfig.aceModuleJsonPath); + const bundleName: string = packageInfo[0]; + const moduleName: string = packageInfo[1]; + const moduleRootPath: string = toUnixPath(projectConfig.modulePathMap[moduleName]); + const projectRootPath: string = toUnixPath(projectConfig.projectRootPath); + // case1: /entry/src/main/ets/xxx/yyy + // case2: /node_modules/xxx/yyy + // case3: /entry/node_modules/xxx/yyy + const projectFilePath: string = unixFilePath.replace(projectRootPath, ''); + + const result: RegExpMatchArray | null = projectFilePath.match(REG_PROJECT_SRC); + if (result && result[1].indexOf(NODE_MODULES) === -1) { + return `${bundleName}/${moduleName}/${result[2]}/${result[3]}`; + } + + if (projectFilePath.indexOf(NODE_MODULES) !== -1) { + + const tryProjectNPM: string = toUnixPath(path.join(projectRootPath, NODE_MODULES)); + if (unixFilePath.indexOf(tryProjectNPM) !== -1) { + return unixFilePath.replace(tryProjectNPM, `${NODE_MODULES}/${ONE}`); + } + + const tryModuleNPM: string = toUnixPath(path.join(moduleRootPath, NODE_MODULES)); + if (unixFilePath.indexOf(tryModuleNPM) !== -1) { + return unixFilePath.replace(tryModuleNPM, `${NODE_MODULES}/${ZERO}`); + } + } + + logger.error(red, `ArkTS:ERROR Failed to get an resolved OhmUrl by filepath "${filePath}"`, reset); + return filePath; +} + +export function writeFileSyncByNode(node: ts.SourceFile, toTsFile: boolean, projectConfig: any): void { + if (toTsFile) { + const newStatements: ts.Node[] = []; + const tsIgnoreNode: ts.Node = ts.factory.createExpressionStatement(ts.factory.createIdentifier(TS_NOCHECK)); + newStatements.push(tsIgnoreNode); + if (node.statements && node.statements.length) { + newStatements.push(...node.statements); + } + + node = ts.factory.updateSourceFile(node, newStatements); + } + const mixedInfo: {content: string, sourceMapJson: any} = genContentAndSourceMapInfo(node, toTsFile, projectConfig); + let temporaryFile: string = genTemporaryPath(node.fileName, projectConfig.projectPath, process.env.cachePath, + projectConfig); + if (temporaryFile.length === 0) { + return; + } + let temporarySourceMapFile: string = ''; + if (temporaryFile.endsWith(EXTNAME_ETS)) { + if (toTsFile) { + temporaryFile = temporaryFile.replace(/\.ets$/, EXTNAME_TS); + } else { + temporaryFile = temporaryFile.replace(/\.ets$/, EXTNAME_JS); + } + temporarySourceMapFile = genSourceMapFileName(temporaryFile); + } else { + if (!toTsFile) { + temporaryFile = temporaryFile.replace(/\.ts$/, EXTNAME_JS); + temporarySourceMapFile = genSourceMapFileName(temporaryFile); + } + } + mkdirsSync(path.dirname(temporaryFile)); + if (temporarySourceMapFile.length > 0 && projectConfig.buildArkMode === 'debug') { + let source = toUnixPath(node.fileName).replace(toUnixPath(projectConfig.projectRootPath) + '/', ''); + newSourceMaps[source] = mixedInfo.sourceMapJson; + } + fs.writeFileSync(temporaryFile, mixedInfo.content); +} + +function genContentAndSourceMapInfo(node: ts.SourceFile, toTsFile: boolean, projectConfig: any): any { + const printer: ts.Printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); + const options: ts.CompilerOptions = { + sourceMap: true + }; + const mapOpions: any = { + sourceMap: true, + inlineSourceMap: false, + inlineSources: false, + sourceRoot: '', + mapRoot: '', + extendedDiagnostics: false + }; + const host: ts.CompilerHost = ts.createCompilerHost(options); + const fileName: string = node.fileName; + // @ts-ignore + const sourceMapGenerator: any = ts.createSourceMapGenerator( + host, + // @ts-ignore + ts.getBaseFileName(fileName), + '', + '', + mapOpions + ); + // @ts-ignore + const writer: any = ts.createTextWriter( + // @ts-ignore + ts.getNewLineCharacter({newLine: ts.NewLineKind.LineFeed, removeComments: false})); + printer['writeFile'](node, writer, sourceMapGenerator); + const sourceMapJson: any = sourceMapGenerator.toJSON(); + sourceMapJson['sources'] = [fileName.replace(toUnixPath(projectConfig.projectRootPath) + '/', '')]; + let content: string = writer.getText(); + if (toTsFile) { + content = content.replace(`${TS_NOCHECK};`, TS_NOCHECK); + } + content = transformModuleSpecifier(fileName, processSystemApi(content, true), projectConfig); + + return { + content: content, + sourceMapJson: sourceMapJson + }; +} + +export function genSourceMapFileName(temporaryFile: string): string { + let abcFile: string = temporaryFile; + if (temporaryFile.endsWith(EXTNAME_TS)) { + abcFile = temporaryFile.replace(/\.ts$/, EXTNAME_TS_MAP); + } else { + abcFile = temporaryFile.replace(/\.js$/, EXTNAME_JS_MAP); + } + return abcFile; +} + +export function writeFileSyncByString(sourcePath: string, sourceCode: string, projectConfig: any, logger: any): void { + const filePath: string = genTemporaryPath(sourcePath, projectConfig.projectPath, process.env.cachePath, projectConfig); + if (filePath.length === 0) { + return; + } + mkdirsSync(path.dirname(filePath)); + if (/\.js$/.test(sourcePath)) { + sourceCode = transformModuleSpecifier(sourcePath, sourceCode, projectConfig); + if (projectConfig.buildArkMode === 'debug') { + fs.writeFileSync(filePath, sourceCode); + return; + } + writeMinimizedSourceCode(sourceCode, filePath, logger); + } + if (/\.json$/.test(sourcePath)) { + fs.writeFileSync(filePath, sourceCode); + } +} + +export function transformModuleSpecifier(sourcePath: string, sourceCode: string, projectConfig: any): string { + // replace relative moduleSpecifier with ohmURl + const REG_RELATIVE_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]((?:\.\/|\.\.\/)[^'"]+)['"]/g; + const REG_HAR_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]([^\.\/][^'"]+)['"]/g; + return sourceCode.replace(REG_HAR_DEPENDENCY, (item, moduleRequest) => { + return replaceHarDependency(item, moduleRequest, projectConfig); + }).replace(REG_RELATIVE_DEPENDENCY, (item, moduleRequest) => { + return replaceRelativeDependency(item, moduleRequest, toUnixPath(sourcePath), projectConfig); + }); +} + +function replaceHarDependency(item:string, moduleRequest: string, projectConfig: any): string { + if (projectConfig.harNameOhmMap) { + // case1: "@ohos/lib" ---> "@module:lib/ets/index" + if (projectConfig.harNameOhmMap.hasOwnProperty(moduleRequest)) { + return item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { + return quotation + projectConfig.harNameOhmMap[moduleRequest] + quotation; + }); + } + // case2: "@ohos/lib/src/main/ets/pages/page1" ---> "@module:lib/ets/pages/page1" + for (const harName in projectConfig.harNameOhmMap) { + if (moduleRequest.startsWith(harName + '/')) { + const harOhmName: string = + projectConfig.harNameOhmMap[harName].substring(0, projectConfig.harNameOhmMap[harName].indexOf('/')); + if (moduleRequest.indexOf(harName + '/' + SRC_MAIN) == 0) { + moduleRequest = moduleRequest.replace(harName + '/' + SRC_MAIN , harOhmName); + } else { + moduleRequest = moduleRequest.replace(harName, harOhmName); + } + return item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { + return quotation + moduleRequest + quotation; + }); + } + } + } + return item; +} + +function replaceRelativeDependency(item:string, moduleRequest: string, sourcePath: string, projectConfig: any): string { + if (sourcePath && projectConfig.compileMode === ESMODULE) { + // remove file extension from moduleRequest + const SUFFIX_REG: RegExp = /\.(?:[cm]?js|[e]?ts|json)$/; + moduleRequest = moduleRequest.replace(SUFFIX_REG, ''); + + // normalize the moduleRequest + item = item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { + let normalizedModuleRequest: string = toUnixPath(path.normalize(moduleRequest)); + if (moduleRequest.startsWith("./")) { + normalizedModuleRequest = "./" + normalizedModuleRequest; + } + return quotation + normalizedModuleRequest + quotation; + }); + + const filePath: string = path.resolve(path.dirname(sourcePath), moduleRequest); + const result: RegExpMatchArray | null = + filePath.match(/(\S+)(\/|\\)src(\/|\\)(?:main|ohosTest)(\/|\\)(ets|js)(\/|\\)(\S+)/); + if (result && projectConfig.aceModuleJsonPath) { + const npmModuleIdx: number = result[1].search(/(\/|\\)node_modules(\/|\\)/); + const projectRootPath: string = projectConfig.projectRootPath; + if (npmModuleIdx === -1 || npmModuleIdx === projectRootPath.search(/(\/|\\)node_modules(\/|\\)/)) { + const packageInfo: string[] = getPackageInfo(projectConfig.aceModuleJsonPath); + const bundleName: string = packageInfo[0]; + const moduleName: string = packageInfo[1]; + moduleRequest = `@bundle:${bundleName}/${moduleName}/${result[5]}/${toUnixPath(result[7])}`; + item = item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { + return quotation + moduleRequest + quotation; + }); + } + } + } + return item; +} + +export async function writeMinimizedSourceCode(content: string, filePath: string, logger: any): Promise { + let result: MinifyOutput; + try { + result = await minify(content, { + compress: { + join_vars: false, + sequences: 0 + }, + format: { + semicolons: false, + beautify: true, + indent_level: 2 + } + }); + } catch { + logger.error(red, `ArkTS:ERROR Failed to source code obfuscation.`, reset); + process.exit(FAIL); + } + fs.writeFileSync(filePath, result.code); +} + +export function genBuildPath(filePath: string, projectPath: string, buildPath: string, projectConfig: any): string { + filePath = toUnixPath(filePath); + if (filePath.endsWith(EXTNAME_MJS)) { + filePath = filePath.replace(/\.mjs$/, EXTNAME_JS); + } + if (filePath.endsWith(EXTNAME_CJS)) { + filePath = filePath.replace(/\.cjs$/, EXTNAME_JS); + } + projectPath = toUnixPath(projectPath); + + if (isNodeModulesFile(filePath, projectConfig)) { + filePath = toUnixPath(filePath); + const fakeNodeModulesPath: string = toUnixPath(path.join(projectConfig.projectRootPath, NODE_MODULES)); + let output: string = ''; + if (filePath.indexOf(fakeNodeModulesPath) === -1) { + const hapPath: string = toUnixPath(projectConfig.projectRootPath); + const tempFilePath: string = filePath.replace(hapPath, ''); + const sufStr: string = tempFilePath.substring(tempFilePath.indexOf(NODE_MODULES) + NODE_MODULES.length + 1); + output = path.join(projectConfig.nodeModulesPath, ZERO, sufStr); + } else { + output = filePath.replace(fakeNodeModulesPath, path.join(projectConfig.nodeModulesPath, ONE)); + } + return output; + } + + if (filePath.indexOf(projectPath) !== -1) { + const sufStr: string = filePath.replace(projectPath, ''); + const output: string = path.join(buildPath, sufStr); + return output; + } + + return ''; +} + +export function getPackageInfo(configFile: string): Array { + if (packageCollection.has(configFile)) { + return packageCollection.get(configFile); + } + const data: any = JSON.parse(fs.readFileSync(configFile).toString()); + const bundleName: string = data.app.bundleName; + const moduleName: string = data.module.name; + packageCollection.set(configFile, [bundleName, moduleName]); + return [bundleName, moduleName]; +} + +export function generateSourceFilesToTemporary(sourcePath: string, sourceContent: string, sourceMap: any, + projectConfig: any, logger: any): void { + let jsFilePath: string = genTemporaryPath(sourcePath, projectConfig.projectPath, process.env.cachePath, projectConfig); + if (jsFilePath.length === 0) { + return; + } + if (jsFilePath.endsWith(EXTNAME_ETS)) { + jsFilePath = jsFilePath.replace(/\.ets$/, EXTNAME_JS); + } else { + jsFilePath = jsFilePath.replace(/\.ts$/, EXTNAME_JS); + } + let sourceMapFile: string = genSourceMapFileName(jsFilePath); + if (sourceMapFile.length > 0 && projectConfig.buildArkMode === 'debug') { + let source = toUnixPath(sourcePath).replace(toUnixPath(projectConfig.projectRootPath) + '/', ''); + // adjust sourceMap info + sourceMap.sources = [source]; + sourceMap.file = path.basename(sourceMap.file); + delete sourceMap.sourcesContent; + newSourceMaps[source] = sourceMap; + } + sourceContent = transformModuleSpecifier(sourcePath, sourceContent, projectConfig); + + mkdirsSync(path.dirname(jsFilePath)); + if (projectConfig.buildArkMode === 'debug') { + fs.writeFileSync(jsFilePath, sourceContent); + return; + } + + writeMinimizedSourceCode(sourceContent, jsFilePath, logger); +} + +export function genAbcFileName(temporaryFile: string): string { + let abcFile: string = temporaryFile; + if (temporaryFile.endsWith(EXTNAME_TS)) { + abcFile = temporaryFile.replace(/\.ts$/, EXTNAME_ABC); + } else { + abcFile = temporaryFile.replace(/\.js$/, EXTNAME_ABC); + } + return abcFile; +} + +export function isEs2Abc(projectConfig: any): boolean { + return projectConfig.pandaMode === ES2ABC || projectConfig.pandaMode === "undefined" || + projectConfig.pandaMode === undefined; +} + +export function isTs2Abc(projectConfig: any): boolean { + return projectConfig.pandaMode === TS2ABC; +} + +export function genProtoFileName(temporaryFile: string): string { + return temporaryFile.replace(/\.(?:[tj]s|json)$/, EXTNAME_PROTO_BIN); +} + +export function genMergeProtoFileName(temporaryFile: string): string { + let protoTempPathArr: string[] = temporaryFile.split(TEMPORARY); + const sufStr: string = protoTempPathArr[protoTempPathArr.length - 1]; + let protoBuildPath: string = path.join(process.env.cachePath, "protos", sufStr); + + return protoBuildPath; +} + +export function removeDuplicateInfo(moduleInfos: Array): Array { + const tempModuleInfos: any[] = Array(); + moduleInfos.forEach((item) => { + let check: boolean = tempModuleInfos.every((newItem) => { + return item.tempFilePath !== newItem.tempFilePath; + }); + if (check) { + tempModuleInfos.push(item); + } + }); + moduleInfos = tempModuleInfos; + + return moduleInfos; +} + +export function buildCachePath(tailName: string, projectConfig: any, logger: any): string { + let pathName: string = process.env.cachePath !== undefined ? + path.join(projectConfig.cachePath, tailName) : path.join(projectConfig.aceModuleBuild, tailName); + validateFilePathLength(pathName, logger); + return pathName; +} + +export function getArkBuildDir(arkDir: string): string { + if (isWindows()) { + return path.join(arkDir, 'build-win'); + } else if (isMac()) { + return path.join(arkDir, 'build-mac'); + } else { + return path.join(arkDir, 'build'); + } +} + +export function getBuildBinDir(arkDir: string): string { + return path.join(getArkBuildDir(arkDir), 'bin'); +} \ No newline at end of file diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 3752c68..ede9a4a 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -308,7 +308,8 @@ export class ResultStates { try { const emit: any = languageService.getEmitOutput(moduleFile, true, true); if (emit.outputFiles[0]) { - generateSourceFilesInHar(moduleFile, emit.outputFiles[0].text, '.d' + path.extname(moduleFile)); + generateSourceFilesInHar(moduleFile, emit.outputFiles[0].text, '.d' + path.extname(moduleFile), + projectConfig); } else { logger.warn(this.yellow, "ArkTS:WARN doesn't generate .d"+path.extname(moduleFile) + " for " + moduleFile, this.reset); @@ -676,8 +677,10 @@ function handleFinishModules(modules, callback) { if (module !== undefined && module.resourceResolveData !== undefined) { const filePath: string = module.resourceResolveData.path; if (!filePath.match(/node_modules/)) { - const jsCacheFilePath: string = genTemporaryPath(filePath, projectConfig.moduleRootPath, process.env.cachePath); - const jsBuildFilePath: string = genTemporaryPath(filePath, projectConfig.moduleRootPath, projectConfig.buildPath, true); + const jsCacheFilePath: string = genTemporaryPath(filePath, projectConfig.moduleRootPath, process.env.cachePath, + projectConfig); + const jsBuildFilePath: string = genTemporaryPath(filePath, projectConfig.moduleRootPath, + projectConfig.buildPath, projectConfig, true); if (filePath.match(/\.e?ts$/)) { this.incrementalFileInHar.set(jsCacheFilePath.replace(/\.ets$/, '.d.ets').replace(/\.ts$/, '.d.ts'), jsBuildFilePath.replace(/\.ets$/, '.d.ets').replace(/\.ts$/, '.d.ts')); diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 758ab7d..8d9f442 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -25,25 +25,27 @@ import * as childProcess from 'child_process'; import { toUnixPath, toHashData, - genTemporaryPath, - genBuildPath, - genAbcFileName, - getPackageInfo, mkdirsSync, - genSourceMapFileName, - checkNodeModulesFile, compareNodeVersion, removeDir, - newSourceMaps, - genProtoFileName, - genMergeProtoFileName, - removeDuplicateInfo, validateFilePathLength, - isTs2Abc, - isEs2Abc, - buildCachePath, - unlinkSync + unlinkSync, + isNodeModulesFile, + genTemporaryPath } from './utils'; +import { + buildCachePath, + genAbcFileName, + genBuildPath, + genMergeProtoFileName, + genProtoFileName, + getOhmUrlByFilepath, + getPackageInfo, + isEs2Abc, + isTs2Abc, + newSourceMaps, + removeDuplicateInfo +} from './ark_utils'; import { projectConfig } from '../main'; import { ESMODULE, @@ -79,9 +81,6 @@ import { AOT_FULL, AOT_PARTIAL } from './pre_define'; -import { - getOhmUrlByFilepath -} from './resolve_ohm_url'; import { generateMergedAbc, generateNpmEntriesInfo @@ -142,7 +141,7 @@ export class ModuleInfo { this.abcFilePath = abcFilePath; this.packageName = packageName; this.isCommonJs = isCommonJs; - this.recordName = getOhmUrlByFilepath(filePath); + this.recordName = getOhmUrlByFilepath(filePath, projectConfig, logger); this.sourceFile = filePath.replace(projectConfig.projectRootPath + path.sep, ''); } } @@ -190,7 +189,7 @@ export class GenAbcPlugin { if (projectConfig.cachePath && !projectConfig.xtsMode) { let cachedJson: any = {}; const CACHED_BUILDMODE: string = path.join(projectConfig.cachePath, PREBUILDMODE_JSON); - validateFilePathLength(CACHED_BUILDMODE); + validateFilePathLength(CACHED_BUILDMODE, logger); cachedJson["buildMode"] = projectConfig.buildArkMode; fs.writeFile(CACHED_BUILDMODE, JSON.stringify(cachedJson, null, 2), 'utf-8', (err) => { @@ -252,9 +251,9 @@ export class GenAbcPlugin { return; } buildPathInfo = output; - if (isTs2Abc() || process.env.minPlatformVersion === "8") { + if (isTs2Abc(projectConfig) || process.env.minPlatformVersion === "8") { invokeWorkersToGenAbc(); - } else if (isEs2Abc()){ + } else if (isEs2Abc(projectConfig)){ generateAbcByEs2AbcOfBundleMode(intermediateJsBundle); } else { logger.error(red, `ArkTS:ERROR please set panda module`, reset); @@ -301,8 +300,10 @@ function getEntryInfo(filePath: string, resourceResolveData: any): string { } const fakeEntryPath: string = path.resolve(npmInfoPath, 'fake.js'); - const tempFakeEntryPath: string = genTemporaryPath(fakeEntryPath, projectConfig.projectPath, process.env.cachePath); - const buildFakeEntryPath: string = genBuildPath(fakeEntryPath, projectConfig.projectPath, projectConfig.buildPath); + const tempFakeEntryPath: string = genTemporaryPath(fakeEntryPath, projectConfig.projectPath, process.env.cachePath, + projectConfig); + const buildFakeEntryPath: string = genBuildPath(fakeEntryPath, projectConfig.projectPath, projectConfig.buildPath, + projectConfig); npmInfoPath = toUnixPath(path.resolve(tempFakeEntryPath, '..')); const buildNpmInfoPath: string = toUnixPath(path.resolve(buildFakeEntryPath, '..')); if (!entryInfos.has(npmInfoPath) && isEntry) { @@ -378,7 +379,7 @@ function processEtsModule(filePath: string, tempFilePath: string, buildFilePath: buildFilePath = buildFilePath.replace(/\.ets$/, EXTNAME_JS); } const abcFilePath: string = genAbcFileName(tempFilePath); - if (checkNodeModulesFile(filePath, projectConfig.projectPath)) { + if (isNodeModulesFile(filePath, projectConfig)) { processNodeModulesFile(filePath, tempFilePath, buildFilePath, abcFilePath, nodeModulesFile, module); } else { const moduleName: string = getPackageInfo(projectConfig.aceModuleJsonPath)[1]; @@ -398,7 +399,7 @@ function processTsModule(filePath: string, tempFilePath: string, buildFilePath: buildFilePath = buildFilePath.replace(/\.ts$/, EXTNAME_JS); } const abcFilePath: string = genAbcFileName(tempFilePath); - if (checkNodeModulesFile(filePath, projectConfig.projectPath)) { + if (isNodeModulesFile(filePath, projectConfig)) { processNodeModulesFile(filePath, tempFilePath, buildFilePath, abcFilePath, nodeModulesFile, module); } else { const moduleName: string = getPackageInfo(projectConfig.aceModuleJsonPath)[1]; @@ -417,7 +418,7 @@ function processJsModule(filePath: string, tempFilePath: string, buildFilePath: fs.copyFileSync(filePath, tempFilePath); } const abcFilePath: string = genAbcFileName(tempFilePath); - if (checkNodeModulesFile(filePath, projectConfig.projectPath)) { + if (isNodeModulesFile(filePath, projectConfig)) { processNodeModulesFile(filePath, tempFilePath, buildFilePath, abcFilePath, nodeModulesFile, module); } else { const moduleName: string = getPackageInfo(projectConfig.aceModuleJsonPath)[1]; @@ -429,7 +430,7 @@ function processJsModule(filePath: string, tempFilePath: string, buildFilePath: function processJsonModule(filePath: string, tempFilePath: string, buildFilePath: string, nodeModulesFile: Array, module: any): void { const abcFilePath: string = "NA"; - if (checkNodeModulesFile(filePath, projectConfig.projectPath)) { + if (isNodeModulesFile(filePath, projectConfig)) { processNodeModulesFile(filePath, tempFilePath, buildFilePath, abcFilePath, nodeModulesFile, module); } else { const moduleName: string = getPackageInfo(projectConfig.aceModuleJsonPath)[1]; @@ -442,7 +443,7 @@ var cachedSourceMaps: Object; function updateCachedSourceMaps(): void { const CACHED_SOURCEMAPS: string = path.join(process.env.cachePath, SOURCEMAPS_JSON); - validateFilePathLength(CACHED_SOURCEMAPS); + validateFilePathLength(CACHED_SOURCEMAPS, logger); if (!fs.existsSync(CACHED_SOURCEMAPS)) { cachedSourceMaps = {}; } else { @@ -455,7 +456,7 @@ function updateCachedSourceMaps(): void { function getCachedModuleList(): Array { const CACHED_MODULELIST_FILE: string = path.join(process.env.cachePath, MODULELIST_JSON); - validateFilePathLength(CACHED_MODULELIST_FILE); + validateFilePathLength(CACHED_MODULELIST_FILE, logger); if (!fs.existsSync(CACHED_MODULELIST_FILE)) { return []; } @@ -466,9 +467,9 @@ function getCachedModuleList(): Array { function updateCachedModuleList(moduleList: Array): void { const CACHED_MODULELIST_FILE: string = path.join(process.env.cachePath, MODULELIST_JSON); - validateFilePathLength(CACHED_MODULELIST_FILE); + validateFilePathLength(CACHED_MODULELIST_FILE, logger); const CACHED_SOURCEMAPS: string = path.join(process.env.cachePath, SOURCEMAPS_JSON); - validateFilePathLength(CACHED_SOURCEMAPS); + validateFilePathLength(CACHED_SOURCEMAPS, logger); let cachedJson: Object = {}; cachedJson["list"] = moduleList; fs.writeFile(CACHED_MODULELIST_FILE, JSON.stringify(cachedJson, null, 2), 'utf-8', @@ -490,7 +491,7 @@ function updateCachedModuleList(moduleList: Array): void { function writeSourceMaps(): void { mkdirsSync(projectConfig.buildPath); let sourceMapFilePath: string = path.join(projectConfig.buildPath, SOURCEMAPS); - validateFilePathLength(sourceMapFilePath); + validateFilePathLength(sourceMapFilePath, logger); fs.writeFile(sourceMapFilePath, JSON.stringify(cachedSourceMaps, null, 2), 'utf-8', (err) => { if (err) { @@ -515,13 +516,14 @@ function handleFullModuleFiles(modules, callback): any { modules.forEach(module => { if (module !== undefined && module.resourceResolveData !== undefined) { const filePath: string = module.resourceResolveData.path; - let tempFilePath = genTemporaryPath(filePath, projectConfig.projectPath, process.env.cachePath); + let tempFilePath = genTemporaryPath(filePath, projectConfig.projectPath, process.env.cachePath, projectConfig); if (tempFilePath.length === 0) { return; } - validateFilePathLength(tempFilePath); - let buildFilePath: string = genBuildPath(filePath, projectConfig.projectPath, projectConfig.buildPath); - validateFilePathLength(buildFilePath); + validateFilePathLength(tempFilePath, logger); + let buildFilePath: string = genBuildPath(filePath, projectConfig.projectPath, projectConfig.buildPath, + projectConfig); + validateFilePathLength(buildFilePath, logger); tempFilePath = toUnixPath(tempFilePath); buildFilePath = toUnixPath(buildFilePath); @@ -563,7 +565,7 @@ function handleFullModuleFiles(modules, callback): any { if (process.env.panda !== TS2ABC) { const outputABCPath: string = path.join(projectConfig.buildPath, MODULES_ABC); - validateFilePathLength(outputABCPath); + validateFilePathLength(outputABCPath, logger); generateMergedAbc(moduleInfos, entryInfos, outputABCPath); clearGlobalInfo(); } else { @@ -577,10 +579,10 @@ function processEntryToGenAbc(entryInfos: Map): void { } generateNpmEntriesInfo(entryInfos); const npmEntriesInfoPath: string = path.join(process.env.cachePath, NPMENTRIES_TXT); - validateFilePathLength(npmEntriesInfoPath); + validateFilePathLength(npmEntriesInfoPath, logger); let npmEntriesProtoFileName: string = "npm_entries" + EXTNAME_PROTO_BIN; const npmEntriesProtoFilePath: string = path.join(process.env.cachePath, "protos", "npm_entries", npmEntriesProtoFileName); - validateFilePathLength(npmEntriesProtoFilePath); + validateFilePathLength(npmEntriesProtoFilePath, logger); mkdirsSync(path.dirname(npmEntriesProtoFilePath)); let js2Abc: string = path.join(arkDir, 'build', 'bin', 'js2abc'); if (isWin) { @@ -588,7 +590,7 @@ function processEntryToGenAbc(entryInfos: Map): void { } else if (isMac) { js2Abc = path.join(arkDir, 'build-mac', 'bin', 'js2abc'); } - validateFilePathLength(js2Abc); + validateFilePathLength(js2Abc, logger); const singleCmd: any = `"${js2Abc}" --compile-npm-entries "${npmEntriesInfoPath}" "${npmEntriesProtoFilePath}`; try { childProcess.execSync(singleCmd); @@ -599,7 +601,7 @@ function processEntryToGenAbc(entryInfos: Map): void { function writeFileSync(inputString: string, buildPath: string, keyPath: string, jsBundleFile: string): void { let output = path.resolve(buildPath, keyPath); - validateFilePathLength(output); + validateFilePathLength(output, logger); let parent: string = path.join(output, '..'); if (!(fs.existsSync(parent) && fs.statSync(parent).isDirectory())) { mkDir(parent); @@ -612,7 +614,7 @@ function writeFileSync(inputString: string, buildPath: string, keyPath: string, } else { cacheOutputPath = output; } - validateFilePathLength(cacheOutputPath); + validateFilePathLength(cacheOutputPath, logger); parent = path.join(cacheOutputPath, '..'); if (!(fs.existsSync(parent) && fs.statSync(parent).isDirectory())) { mkDir(parent); @@ -695,7 +697,7 @@ export function initAbcEnv() : string[] { } else if (isMac) { js2abc = path.join(arkDir, 'build-mac', 'legacy_api8', 'src', 'index.js'); } - validateFilePathLength(js2abc); + validateFilePathLength(js2abc, logger); js2abc = '"' + js2abc + '"'; args = [ @@ -712,7 +714,7 @@ export function initAbcEnv() : string[] { } else if (isMac) { js2abc = path.join(arkDir, 'build-mac', 'src', 'index.js'); } - validateFilePathLength(js2abc); + validateFilePathLength(js2abc, logger); js2abc = '"' + js2abc + '"'; args = [ @@ -729,7 +731,7 @@ export function initAbcEnv() : string[] { } else if (isMac) { es2abc = path.join(arkDir, 'build-mac', 'bin', 'es2abc'); } - validateFilePathLength(es2abc); + validateFilePathLength(es2abc, logger); args = [ '"' + es2abc + '"' @@ -974,7 +976,7 @@ function genHashJsonPath(buildPath: string): string { let buildDirArr: string[] = projectConfig.buildPath.split(path.sep); let abilityDir: string = buildDirArr[buildDirArr.length - 1]; let hashJsonPath: string = path.join(process.env.cachePath, TEMPORARY, abilityDir, hashFile); - validateFilePathLength(hashJsonPath) + validateFilePathLength(hashJsonPath, logger) mkdirsSync(path.dirname(hashJsonPath)); return hashJsonPath; } else if (buildPath.indexOf(ARK) >= 0) { @@ -985,7 +987,7 @@ function genHashJsonPath(buildPath: string): string { return ''; } let hashJsonPath: string = path.join(hashPath, hashFile); - validateFilePathLength(hashJsonPath); + validateFilePathLength(hashJsonPath, logger); return hashJsonPath; } else { logger.debug(red, `ArkTS:ERROR not cache exist`, reset); @@ -1002,7 +1004,7 @@ function checkNodeModules() { arkEntryPath = path.join(arkDir, 'build-mac'); } let nodeModulesPath: string = path.join(arkEntryPath, NODE_MODULES); - validateFilePathLength(nodeModulesPath); + validateFilePathLength(nodeModulesPath, logger); if (!(fs.existsSync(nodeModulesPath) && fs.statSync(nodeModulesPath).isDirectory())) { logger.error(red, `ERROR: node_modules for ark compiler not found. Please make sure switch to non-root user before runing "npm install" for safity requirements and try re-run "npm install" under ${arkEntryPath}`, reset); @@ -1069,12 +1071,12 @@ function handleHotReloadChangedFiles() { for (let file of changedFileList) { let filePath: string = path.join(projectConfig.projectPath, file); - validateFilePathLength(filePath); - let tempFilePath: string = genTemporaryPath(filePath, projectConfig.projectPath, process.env.cachePath); + validateFilePathLength(filePath, logger); + let tempFilePath: string = genTemporaryPath(filePath, projectConfig.projectPath, process.env.cachePath, projectConfig); if (tempFilePath.length === 0) { return; } - validateFilePathLength(tempFilePath); + validateFilePathLength(tempFilePath, logger); let buildFilePath: string = ""; tempFilePath = toUnixPath(tempFilePath); @@ -1104,7 +1106,7 @@ function handleHotReloadChangedFiles() { } let sourceMapPath: string = toUnixPath(path.join(relativeProjectPath, file)); - validateFilePathLength(sourceMapPath); + validateFilePathLength(sourceMapPath, logger); hotReloadSourceMap[sourceMapPath] = newSourceMaps[sourceMapPath]; } @@ -1113,12 +1115,12 @@ function handleHotReloadChangedFiles() { } const outputABCPath: string = path.join(projectConfig.patchAbcPath, MODULES_ABC); - validateFilePathLength(outputABCPath); + validateFilePathLength(outputABCPath, logger); generateMergedAbc(moduleInfos, entryInfos, outputABCPath); // write source maps let sourceMapFilePath: string = path.join(projectConfig.patchAbcPath, SOURCEMAPS); - validateFilePathLength(sourceMapFilePath); + validateFilePathLength(sourceMapFilePath, logger); fs.writeFileSync(sourceMapFilePath, JSON.stringify(hotReloadSourceMap, null, 2), 'utf-8'); } @@ -1138,7 +1140,7 @@ function handleFinishModules(modules, callback) { function copyModuleFileCachePathToBuildPath(): void { protoFilePath = path.join(path.join(process.env.cachePath, "protos", PROTO_FILESINFO_TXT)); - validateFilePathLength(protoFilePath); + validateFilePathLength(protoFilePath, logger); mkdirsSync(path.dirname(protoFilePath)); let entriesInfo: string = ''; moduleInfos = removeDuplicateInfo(moduleInfos); @@ -1223,7 +1225,7 @@ function generateAbcByEs2AbcOfBundleMode(inputPaths: File[]) { } function generateFileOfBundle(inputPaths: File[]): string { - let filesInfoPath: string = buildCachePath(FILESINFO_TXT); + let filesInfoPath: string = buildCachePath(FILESINFO_TXT, projectConfig, logger); inputPaths = removeDuplicateInfoOfBundleList(inputPaths); let filesInfo: string = ''; diff --git a/compiler/src/gen_aot.ts b/compiler/src/gen_aot.ts index aa8a7ef..383df89 100644 --- a/compiler/src/gen_aot.ts +++ b/compiler/src/gen_aot.ts @@ -32,11 +32,13 @@ import { isWindows, mkdirsSync, toUnixPath, - getArkBuildDir, - getBuildBinDir, validateFilePathLength, validateFilePathLengths } from './utils'; +import { + getArkBuildDir, + getBuildBinDir +} from './ark_utils'; const red: string = '\u001b[31m'; const reset: string = '\u001b[39m'; @@ -125,7 +127,7 @@ export function generateAot(arkDir: string, builtinAbcPath: string, logger: any, const appAbc: string = path.join(projectConfig.buildPath, MODULES_ABC); const appAot: string = path.join(projectConfig.anBuildOutPut, projectConfig.moduleName); - if (!validateFilePathLengths([aotCompiler, appAbc, builtinAbcPath, appAot])) { + if (!validateFilePathLengths([aotCompiler, appAbc, builtinAbcPath, appAot], logger)) { logger.error(`ArkTS:ERROR generateAot failed. Invalid file path.`); processExit(isFastBuild); } @@ -140,7 +142,7 @@ export function generateAot(arkDir: string, builtinAbcPath: string, logger: any, singleCmd = singleCmdPrefix + ` "${appAbc}"`; } else if (projectConfig.anBuildMode === AOT_PARTIAL) { const profile: string = projectConfig.apPath; - if (!validateFilePathLength(profile)) { + if (!validateFilePathLength(profile, logger)) { logger.error(`ArkTS:ERROR generateAot failed. Invalid profile file path.`); processExit(isFastBuild); } @@ -172,7 +174,7 @@ export function generateBuiltinAbc(arkDir: string, nodeJs: string, abcArgs: stri return builtinAbcPath; } mkdirsSync(path.dirname(builtinAbcPath)); - if (!validateFilePathLengths([builtinFilePath, builtinAbcPath])) { + if (!validateFilePathLengths([builtinFilePath, builtinAbcPath], logger)) { logger.error(`ArkTS:ERROR generateBuiltinAbc failed. Invalid file path.`); processExit(isFastBuild); } diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index d07d54c..32d85b8 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -378,3 +378,5 @@ export const CARD_LOG_TYPE_IMPORT = 3; export const CALL = 'call'; export const RESERT = 'reset'; + +export const TS_NOCHECK: string = '// @ts-nocheck'; diff --git a/compiler/src/process_har_writejs.ts b/compiler/src/process_har_writejs.ts index 230768d..7863e46 100644 --- a/compiler/src/process_har_writejs.ts +++ b/compiler/src/process_har_writejs.ts @@ -14,8 +14,9 @@ */ import { generateSourceFilesInHar } from './utils'; +import { projectConfig } from '../main.js'; module.exports = function writejsfile(source: string): string { - generateSourceFilesInHar(this.resourcePath, source, '.js'); + generateSourceFilesInHar(this.resourcePath, source, '.js', projectConfig); return source; }; diff --git a/compiler/src/process_source_file.ts b/compiler/src/process_source_file.ts index d4c1d93..22fe2bc 100644 --- a/compiler/src/process_source_file.ts +++ b/compiler/src/process_source_file.ts @@ -1,14 +1,15 @@ -import { writeFileSyncByString } from './utils'; +import { writeFileSyncByString } from './ark_utils'; import { projectConfig } from '../main'; import { ESMODULE, ARK } from './pre_define'; +import { logger } from './compile_info'; module.exports = function processSourcefile(source: string): string { if (projectConfig.compileMode === ESMODULE && process.env.compilerType && process.env.compilerType === ARK) { - writeFileSyncByString(this.resourcePath, source); + writeFileSyncByString(this.resourcePath, source, projectConfig, logger); } return source; }; diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 753ae0a..728a3ea 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -67,9 +67,9 @@ import { LogInfo, LogType, hasDecorator, - FileLog, - writeFileSyncByNode + FileLog } from './utils'; +import { writeFileSyncByNode } from './ark_utils'; import { processComponentBlock, bindComponentAttr, @@ -117,7 +117,7 @@ export function processUISyntax(program: ts.Program, ut = false): Function { if (projectConfig.compileMode === ESMODULE && process.env.compilerType && process.env.compilerType === ARK) { validateReExportType(node, pagesDir, transformLog.errors); if (projectConfig.processTs === true) { - writeFileSyncByNode(node, true); + writeFileSyncByNode(node, true, projectConfig); } } return node; @@ -143,7 +143,7 @@ export function processUISyntax(program: ts.Program, ut = false): Function { INTERFACE_NODE_SET.clear(); if (projectConfig.compileMode === ESMODULE && projectConfig.processTs === true && process.env.compilerType && process.env.compilerType === ARK) { - writeFileSyncByNode(node, true); + writeFileSyncByNode(node, true, projectConfig); } return node; } else { @@ -722,7 +722,7 @@ function createStartGetAccessRecording(context: ts.TransformationContext): ts.Ex ); } -function createLoadDocument(context: ts.TransformationContext, name: string, +function createLoadDocument(context: ts.TransformationContext, name: string, cardRelativePath: string, localStorageName: string): ts.ExpressionStatement { const newArray: ts.Expression[] = [ context.factory.createIdentifier('undefined'), diff --git a/compiler/src/resolve_ohm_url.ts b/compiler/src/resolve_ohm_url.ts index d4129c1..6987b21 100644 --- a/compiler/src/resolve_ohm_url.ts +++ b/compiler/src/resolve_ohm_url.ts @@ -1,8 +1,6 @@ import * as fs from 'fs'; import * as path from 'path'; import { logger } from './compile_info'; -import { NODE_MODULES, ONE, ZERO } from './pre_define'; -import { toUnixPath, getPackageInfo } from './utils'; const { projectConfig } = require('../main'); const red: string = '\u001b[31m'; @@ -88,40 +86,3 @@ export function resolveSourceFile(ohmUrl: string): string { return file; } - -export function getOhmUrlByFilepath(filePath: string): string { - let unixFilePath: string = toUnixPath(filePath); - unixFilePath = unixFilePath.substring(0, filePath.lastIndexOf('.')); // remove extension - const REG_PROJECT_SRC: RegExp = /(\S+)\/src\/(?:main|ohosTest)\/(ets|js)\/(\S+)/; - - const packageInfo: string[] = getPackageInfo(projectConfig.aceModuleJsonPath); - const bundleName: string = packageInfo[0]; - const moduleName: string = packageInfo[1]; - const moduleRootPath: string = toUnixPath(projectConfig.modulePathMap[moduleName]); - const projectRootPath: string = toUnixPath(projectConfig.projectRootPath); - // case1: /entry/src/main/ets/xxx/yyy - // case2: /node_modules/xxx/yyy - // case3: /entry/node_modules/xxx/yyy - const projectFilePath: string = unixFilePath.replace(projectRootPath, ''); - - const result: RegExpMatchArray | null = projectFilePath.match(REG_PROJECT_SRC); - if (result && result[1].indexOf(NODE_MODULES) === -1) { - return `${bundleName}/${moduleName}/${result[2]}/${result[3]}`; - } - - if (projectFilePath.indexOf(NODE_MODULES) !== -1) { - - const tryProjectNPM: string = toUnixPath(path.join(projectRootPath, NODE_MODULES)); - if (unixFilePath.indexOf(tryProjectNPM) !== -1) { - return unixFilePath.replace(tryProjectNPM, `${NODE_MODULES}/${ONE}`); - } - - const tryModuleNPM: string = toUnixPath(path.join(moduleRootPath, NODE_MODULES)); - if (unixFilePath.indexOf(tryModuleNPM) !== -1) { - return unixFilePath.replace(tryModuleNPM, `${NODE_MODULES}/${ZERO}`); - } - } - - logger.error(red, `ArkTS:ERROR Failed to get an resolved OhmUrl by filepath "${filePath}"`, reset); - return filePath; -} \ No newline at end of file diff --git a/compiler/src/result_process.ts b/compiler/src/result_process.ts index 26444cd..924ced2 100644 --- a/compiler/src/result_process.ts +++ b/compiler/src/result_process.ts @@ -29,11 +29,12 @@ import { LogInfo, emitLogInfo, componentInfo, - generateSourceFilesToTemporary, generateSourceFilesInHar } from './utils'; +import { generateSourceFilesToTemporary } from './ark_utils'; import { resetComponentCollection } from './validate_ui_syntax'; import { abilityConfig, projectConfig } from '../main'; +import { logger } from './compile_info'; module.exports = function resultProcess(source: string, map: any): void { process.env.compiler = BUILD_OFF; @@ -72,11 +73,11 @@ module.exports = function resultProcess(source: string, map: any): void { if (projectConfig.compileMode == ESMODULE && projectConfig.processTs === false && process.env.compilerType && process.env.compilerType === 'ark' && !projectConfig.compileHar) { - generateSourceFilesToTemporary(this.resourcePath, source, map); + generateSourceFilesToTemporary(this.resourcePath, source, map, projectConfig, logger); } if (projectConfig.compileHar) { - generateSourceFilesInHar(this.resourcePath, source, '.js'); + generateSourceFilesInHar(this.resourcePath, source, '.js', projectConfig); } this.callback(null, source, map); diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index be3ba3a..8da7413 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -21,35 +21,20 @@ import uglifyJS from 'uglify-js'; import { projectConfig } from '../main'; import { createHash } from 'crypto'; -import { processSystemApi } from './validate_ui_syntax'; -import { logger } from './compile_info'; import { - NODE_MODULES, - TEMPORARY, - MAIN, AUXILIARY, - ZERO, - ONE, - EXTNAME_JS, - EXTNAME_TS, - EXTNAME_MJS, - EXTNAME_CJS, - EXTNAME_ABC, EXTNAME_ETS, - EXTNAME_TS_MAP, - EXTNAME_JS_MAP, - ESMODULE, + EXTNAME_CJS, + EXTNAME_MJS, + EXTNAME_JS, + MAIN, + NODE_MODULES, FAIL, + TEMPORARY, CARD_LOG_TYPE_COMPONENTS, CARD_LOG_TYPE_DECORATORS, - CARD_LOG_TYPE_IMPORT, - TS2ABC, - ES2ABC, - EXTNAME_PROTO_BIN, - COMPONENT_CREATE_FUNCTION, - CREATE_BIND_COMPONENT + CARD_LOG_TYPE_IMPORT } from './pre_define'; -import { minify, MinifyOutput } from 'terser'; import { resourceFileName } from './process_ui_syntax'; export enum LogType { @@ -60,7 +45,6 @@ export enum LogType { export const TEMPORARYS: string = 'temporarys'; export const BUILD: string = 'build'; export const SRC_MAIN: string = 'src/main'; -const TS_NOCHECK: string = '// @ts-nocheck'; const red: string = '\u001b[31m'; const reset: string = '\u001b[39m'; @@ -273,7 +257,7 @@ export function writeFileSync(filePath: string, content: string): void { } export function genTemporaryPath(filePath: string, projectPath: string, buildPath: string, - removeTemporary: boolean = false): string { + projectConfig: any, buildInHar: boolean = false): string { filePath = toUnixPath(filePath); if (filePath.endsWith(EXTNAME_MJS)) { filePath = filePath.replace(/\.mjs$/, EXTNAME_JS); @@ -283,67 +267,32 @@ export function genTemporaryPath(filePath: string, projectPath: string, buildPat } projectPath = toUnixPath(projectPath); - if (checkNodeModulesFile(filePath, projectPath)) { + if (isNodeModulesFile(filePath, projectConfig)) { const fakeNodeModulesPath: string = toUnixPath(path.join(projectConfig.projectRootPath, NODE_MODULES)); let output: string = ''; if (filePath.indexOf(fakeNodeModulesPath) === -1) { const hapPath: string = toUnixPath(projectConfig.projectRootPath); const tempFilePath: string = filePath.replace(hapPath, ''); const sufStr: string = tempFilePath.substring(tempFilePath.indexOf(NODE_MODULES) + NODE_MODULES.length + 1); - output = path.join(buildPath, removeTemporary ? '' : TEMPORARY, NODE_MODULES, MAIN, sufStr); + output = path.join(buildPath, buildInHar ? '' : TEMPORARY, NODE_MODULES, MAIN, sufStr); } else { output = filePath.replace(fakeNodeModulesPath, - path.join(buildPath, removeTemporary ? '' : TEMPORARY, NODE_MODULES, AUXILIARY)); + path.join(buildPath, buildInHar ? '' : TEMPORARY, NODE_MODULES, AUXILIARY)); } return output; } if (filePath.indexOf(projectPath) !== -1) { const sufStr: string = filePath.replace(projectPath, ''); - const output: string = path.join(buildPath, removeTemporary ? '' : TEMPORARY, sufStr); + const output: string = path.join(buildPath, buildInHar ? '' : TEMPORARY, sufStr); return output; } return ''; } -export function genBuildPath(filePath: string, projectPath: string, buildPath: string): string { +export function isNodeModulesFile(filePath: string, projectConfig: any): boolean { filePath = toUnixPath(filePath); - if (filePath.endsWith(EXTNAME_MJS)) { - filePath = filePath.replace(/\.mjs$/, EXTNAME_JS); - } - if (filePath.endsWith(EXTNAME_CJS)) { - filePath = filePath.replace(/\.cjs$/, EXTNAME_JS); - } - projectPath = toUnixPath(projectPath); - - if (checkNodeModulesFile(filePath, projectPath)) { - filePath = toUnixPath(filePath); - const fakeNodeModulesPath: string = toUnixPath(path.join(projectConfig.projectRootPath, NODE_MODULES)); - let output: string = ''; - if (filePath.indexOf(fakeNodeModulesPath) === -1) { - const hapPath: string = toUnixPath(projectConfig.projectRootPath); - const tempFilePath: string = filePath.replace(hapPath, ''); - const sufStr: string = tempFilePath.substring(tempFilePath.indexOf(NODE_MODULES) + NODE_MODULES.length + 1); - output = path.join(projectConfig.nodeModulesPath, ZERO, sufStr); - } else { - output = filePath.replace(fakeNodeModulesPath, path.join(projectConfig.nodeModulesPath, ONE)); - } - return output; - } - - if (filePath.indexOf(projectPath) !== -1) { - const sufStr: string = filePath.replace(projectPath, ''); - const output: string = path.join(buildPath, sufStr); - return output; - } - - return ''; -} - -export function checkNodeModulesFile(filePath: string, projectPath: string): boolean { - filePath = toUnixPath(filePath); - projectPath = toUnixPath(projectPath); const hapPath: string = toUnixPath(projectConfig.projectRootPath); const tempFilePath: string = filePath.replace(hapPath, ''); if (tempFilePath.indexOf(NODE_MODULES) !== -1) { @@ -365,110 +314,11 @@ export function checkNodeModulesFile(filePath: string, projectPath: string): boo return false; } -export function mkdirsSync(dirname: string): boolean { - if (fs.existsSync(dirname)) { - return true; - } else if (mkdirsSync(path.dirname(dirname))) { - fs.mkdirSync(dirname); - return true; - } - - return false; -} - -async function writeMinimizedSourceCode(content: string, filePath: string): Promise { - let result: MinifyOutput; - try { - result = await minify(content, { - compress: { - join_vars: false, - sequences: 0 - }, - format: { - semicolons: false, - beautify: true, - indent_level: 2 - } - }); - } catch { - logger.error(red, `ArkTS:ERROR Failed to source code obfuscation.`, reset); - process.exit(FAIL); - } - fs.writeFileSync(filePath, result.code); -} - -export function writeFileSyncByString(sourcePath: string, sourceCode: string): void { - const filePath: string = genTemporaryPath(sourcePath, projectConfig.projectPath, process.env.cachePath); - if (filePath.length === 0) { - return; - } - mkdirsSync(path.dirname(filePath)); - if (/\.js$/.test(sourcePath)) { - sourceCode = transformModuleSpecifier(sourcePath, sourceCode); - if (projectConfig.buildArkMode === 'debug') { - fs.writeFileSync(filePath, sourceCode); - return; - } - writeMinimizedSourceCode(sourceCode, filePath); - } - if (/\.json$/.test(sourcePath)) { - fs.writeFileSync(filePath, sourceCode); - } -} - -export const packageCollection: Map> = new Map(); - -export function getPackageInfo(configFile: string): Array { - if (packageCollection.has(configFile)) { - return packageCollection.get(configFile); - } - const data: any = JSON.parse(fs.readFileSync(configFile).toString()); - const bundleName: string = data.app.bundleName; - const moduleName: string = data.module.name; - packageCollection.set(configFile, [bundleName, moduleName]); - return [bundleName, moduleName]; -} - -function replaceRelativeDependency(item:string, moduleRequest: string, sourcePath: string): string { - if (sourcePath && projectConfig.compileMode === ESMODULE) { - // remove file extension from moduleRequest - const SUFFIX_REG: RegExp = /\.(?:[cm]?js|[e]?ts|json)$/; - moduleRequest = moduleRequest.replace(SUFFIX_REG, ''); - - // normalize the moduleRequest - item = item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { - let normalizedModuleRequest: string = toUnixPath(path.normalize(moduleRequest)); - if (moduleRequest.startsWith("./")) { - normalizedModuleRequest = "./" + normalizedModuleRequest; - } - return quotation + normalizedModuleRequest + quotation; - }); - - const filePath: string = path.resolve(path.dirname(sourcePath), moduleRequest); - const result: RegExpMatchArray | null = - filePath.match(/(\S+)(\/|\\)src(\/|\\)(?:main|ohosTest)(\/|\\)(ets|js)(\/|\\)(\S+)/); - if (result && projectConfig.aceModuleJsonPath) { - const npmModuleIdx: number = result[1].search(/(\/|\\)node_modules(\/|\\)/); - const projectRootPath: string = projectConfig.projectRootPath; - if (npmModuleIdx === -1 || npmModuleIdx === projectRootPath.search(/(\/|\\)node_modules(\/|\\)/)) { - const packageInfo: string[] = getPackageInfo(projectConfig.aceModuleJsonPath); - const bundleName: string = packageInfo[0]; - const moduleName: string = packageInfo[1]; - moduleRequest = `@bundle:${bundleName}/${moduleName}/${result[5]}/${toUnixPath(result[7])}`; - item = item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { - return quotation + moduleRequest + quotation; - }); - } - } - } - return item; -} - -export function generateSourceFilesInHar(sourcePath: string, sourceContent: string, suffix: string) { +export function generateSourceFilesInHar(sourcePath: string, sourceContent: string, suffix: string, projectConfig: any) { let jsFilePath: string = genTemporaryPath(sourcePath, projectConfig.compileShared ? projectConfig.projectRootPath : projectConfig.moduleRootPath, - projectConfig.compileShared ? path.resolve(projectConfig.buildPath, '../etsFortgz') : process.env.cachePath, - projectConfig.compileShared); + projectConfig.compileShared ? path.resolve(projectConfig.aceModuleBuild, '../etsFortgz') : process.env.cachePath, + projectConfig, projectConfig.compileShared); if (!jsFilePath.match(/node_modules/)) { jsFilePath = jsFilePath.replace(/\.ets$/, suffix).replace(/\.ts$/, suffix); mkdirsSync(path.dirname(jsFilePath)); @@ -479,175 +329,15 @@ export function generateSourceFilesInHar(sourcePath: string, sourceContent: stri } } -function replaceHarDependency(item:string, moduleRequest: string): string { - if (projectConfig.harNameOhmMap) { - // case1: "@ohos/lib" ---> "@module:lib/ets/index" - if (projectConfig.harNameOhmMap.hasOwnProperty(moduleRequest)) { - return item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { - return quotation + projectConfig.harNameOhmMap[moduleRequest] + quotation; - }); - } - // case2: "@ohos/lib/src/main/ets/pages/page1" ---> "@module:lib/ets/pages/page1" - for (const harName in projectConfig.harNameOhmMap) { - if (moduleRequest.startsWith(harName + '/')) { - const harOhmName: string = - projectConfig.harNameOhmMap[harName].substring(0, projectConfig.harNameOhmMap[harName].indexOf('/')); - if (moduleRequest.indexOf(harName + '/' + SRC_MAIN) == 0) { - moduleRequest = moduleRequest.replace(harName + '/' + SRC_MAIN , harOhmName); - } else { - moduleRequest = moduleRequest.replace(harName, harOhmName); - } - return item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { - return quotation + moduleRequest + quotation; - }); - } - } - } - return item; -} - -function transformModuleSpecifier(sourcePath: string, sourceCode: string): string { - // replace relative moduleSpecifier with ohmURl - const REG_RELATIVE_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]((?:\.\/|\.\.\/)[^'"]+)['"]/g; - const REG_HAR_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]([^\.\/][^'"]+)['"]/g; - return sourceCode.replace(REG_HAR_DEPENDENCY, (item, moduleRequest) => { - return replaceHarDependency(item, moduleRequest); - }).replace(REG_RELATIVE_DEPENDENCY, (item, moduleRequest) => { - return replaceRelativeDependency(item, moduleRequest, toUnixPath(sourcePath)); - }); -} - -export var newSourceMaps: Object = {}; - -export function generateSourceFilesToTemporary(sourcePath: string, sourceContent: string, sourceMap: any): void { - let jsFilePath: string = genTemporaryPath(sourcePath, projectConfig.projectPath, process.env.cachePath); - if (jsFilePath.length === 0) { - return; - } - if (jsFilePath.endsWith(EXTNAME_ETS)) { - jsFilePath = jsFilePath.replace(/\.ets$/, EXTNAME_JS); - } else { - jsFilePath = jsFilePath.replace(/\.ts$/, EXTNAME_JS); - } - let sourceMapFile: string = genSourceMapFileName(jsFilePath); - if (sourceMapFile.length > 0 && projectConfig.buildArkMode === 'debug') { - let source = toUnixPath(sourcePath).replace(toUnixPath(projectConfig.projectRootPath) + '/', ''); - // adjust sourceMap info - sourceMap.sources = [source]; - sourceMap.file = path.basename(sourceMap.file); - delete sourceMap.sourcesContent; - newSourceMaps[source] = sourceMap; - } - sourceContent = transformModuleSpecifier(sourcePath, sourceContent); - - mkdirsSync(path.dirname(jsFilePath)); - if (projectConfig.buildArkMode === 'debug') { - fs.writeFileSync(jsFilePath, sourceContent); - return; - } - - writeMinimizedSourceCode(sourceContent, jsFilePath); -} - -export function writeFileSyncByNode(node: ts.SourceFile, toTsFile: boolean): void { - if (toTsFile) { - const newStatements: ts.Node[] = []; - const tsIgnoreNode: ts.Node = ts.factory.createExpressionStatement(ts.factory.createIdentifier(TS_NOCHECK)); - newStatements.push(tsIgnoreNode); - if (node.statements && node.statements.length) { - newStatements.push(...node.statements); - } - - node = ts.factory.updateSourceFile(node, newStatements); - } - const mixedInfo: {content: string, sourceMapJson: any} = genContentAndSourceMapInfo(node, toTsFile); - let temporaryFile: string = genTemporaryPath(node.fileName, projectConfig.projectPath, process.env.cachePath); - if (temporaryFile.length === 0) { - return; - } - let temporarySourceMapFile: string = ''; - if (temporaryFile.endsWith(EXTNAME_ETS)) { - if (toTsFile) { - temporaryFile = temporaryFile.replace(/\.ets$/, EXTNAME_TS); - } else { - temporaryFile = temporaryFile.replace(/\.ets$/, EXTNAME_JS); - } - temporarySourceMapFile = genSourceMapFileName(temporaryFile); - } else { - if (!toTsFile) { - temporaryFile = temporaryFile.replace(/\.ts$/, EXTNAME_JS); - temporarySourceMapFile = genSourceMapFileName(temporaryFile); - } - } - mkdirsSync(path.dirname(temporaryFile)); - if (temporarySourceMapFile.length > 0 && projectConfig.buildArkMode === 'debug') { - let source = toUnixPath(node.fileName).replace(toUnixPath(projectConfig.projectRootPath) + '/', ''); - newSourceMaps[source] = mixedInfo.sourceMapJson; - } - fs.writeFileSync(temporaryFile, mixedInfo.content); -} - -function genContentAndSourceMapInfo(node: ts.SourceFile, toTsFile: boolean): any { - const printer: ts.Printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); - const options: ts.CompilerOptions = { - sourceMap: true - }; - const mapOpions: any = { - sourceMap: true, - inlineSourceMap: false, - inlineSources: false, - sourceRoot: '', - mapRoot: '', - extendedDiagnostics: false - }; - const host: ts.CompilerHost = ts.createCompilerHost(options); - const fileName: string = node.fileName; - // @ts-ignore - const sourceMapGenerator: any = ts.createSourceMapGenerator( - host, - // @ts-ignore - ts.getBaseFileName(fileName), - '', - '', - mapOpions - ); - // @ts-ignore - const writer: any = ts.createTextWriter( - // @ts-ignore - ts.getNewLineCharacter({newLine: ts.NewLineKind.LineFeed, removeComments: false})); - printer['writeFile'](node, writer, sourceMapGenerator); - const sourceMapJson: any = sourceMapGenerator.toJSON(); - sourceMapJson['sources'] = [fileName.replace(toUnixPath(projectConfig.projectRootPath) + '/', '')]; - let content: string = writer.getText(); - if (toTsFile) { - content = content.replace(`${TS_NOCHECK};`, TS_NOCHECK); - } - content = transformModuleSpecifier(fileName, processSystemApi(content, true)); - - return { - content: content, - sourceMapJson: sourceMapJson - }; -} - -export function genAbcFileName(temporaryFile: string): string { - let abcFile: string = temporaryFile; - if (temporaryFile.endsWith(EXTNAME_TS)) { - abcFile = temporaryFile.replace(/\.ts$/, EXTNAME_ABC); - } else { - abcFile = temporaryFile.replace(/\.js$/, EXTNAME_ABC); +export function mkdirsSync(dirname: string): boolean { + if (fs.existsSync(dirname)) { + return true; + } else if (mkdirsSync(path.dirname(dirname))) { + fs.mkdirSync(dirname); + return true; } - return abcFile; -} -export function genSourceMapFileName(temporaryFile: string): string { - let abcFile: string = temporaryFile; - if (temporaryFile.endsWith(EXTNAME_TS)) { - abcFile = temporaryFile.replace(/\.ts$/, EXTNAME_TS_MAP); - } else { - abcFile = temporaryFile.replace(/\.js$/, EXTNAME_JS_MAP); - } - return abcFile; + return false; } export function compareNodeVersion(nodeVersion: number = 16): boolean { @@ -704,41 +394,6 @@ export function parseErrorMessage(message: string): string { return logContent; } -export function isEs2Abc(): boolean { - return process.env.panda === ES2ABC || process.env.panda === 'undefined' || process.env.panda === undefined; -} - -export function isTs2Abc(): boolean { - return process.env.panda === TS2ABC; -} - -export function genProtoFileName(temporaryFile: string): string { - return temporaryFile.replace(/\.(?:[tj]s|json)$/, EXTNAME_PROTO_BIN); -} - -export function genMergeProtoFileName(temporaryFile: string): string { - let protoTempPathArr: string[] = temporaryFile.split(TEMPORARY); - const sufStr: string = protoTempPathArr[protoTempPathArr.length - 1]; - let protoBuildPath: string = path.join(process.env.cachePath, "protos", sufStr); - - return protoBuildPath; -} - -export function removeDuplicateInfo(moduleInfos: Array): Array { - const tempModuleInfos: any[] = Array(); - moduleInfos.forEach((item) => { - let check: boolean = tempModuleInfos.every((newItem) => { - return item.tempFilePath !== newItem.tempFilePath; - }); - if (check) { - tempModuleInfos.push(item); - } - }); - moduleInfos = tempModuleInfos; - - return moduleInfos; -} - export function isWindows(): boolean { return os.type() === WINDOWS; } @@ -763,7 +418,7 @@ export function maxFilePathLength(): number { } } -export function validateFilePathLength(filePath: string): boolean { +export function validateFilePathLength(filePath: string, logger: any): boolean { if (maxFilePathLength() < 0) { logger.error(red, "Unknown OS platform", reset); process.exitCode = FAIL; @@ -781,43 +436,21 @@ export function validateFilePathLength(filePath: string): boolean { } } -export function validateFilePathLengths(filePaths: Array): boolean { +export function validateFilePathLengths(filePaths: Array, logger: any): boolean { filePaths.forEach((filePath) => { - if (!validateFilePathLength(filePath)) { + if (!validateFilePathLength(filePath, logger)) { return false; } }) return true; } -export function buildCachePath(tailName: string): string { - let pathName: string = process.env.cachePath !== undefined ? - path.join(process.env.cachePath, tailName) : path.join(projectConfig.buildPath, tailName); - validateFilePathLength(pathName); - - return pathName; -} - export function unlinkSync(filePath: string): void { if (fs.existsSync(filePath)) { fs.unlinkSync(filePath); } } -export function getArkBuildDir(arkDir: string): string { - if (isWindows()) { - return path.join(arkDir, 'build-win'); - } else if (isMac()) { - return path.join(arkDir, 'build-mac'); - } else { - return path.join(arkDir, 'build'); - } -} - -export function getBuildBinDir(arkDir: string): string { - return path.join(getArkBuildDir(arkDir), 'bin'); -} - export function getExtension(filePath: string): string { if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) { return ""; diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 9beaa0e..be91ab2 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -72,14 +72,14 @@ import { componentInfo, addLog, hasDecorator, - getPackageInfo, validatorCard } from './utils'; +import { getPackageInfo } from './ark_utils' import { projectConfig, abilityPagesFullPath } from '../main'; -import { - collectExtend, - isExtendFunction, - transformLog +import { + collectExtend, + isExtendFunction, + transformLog } from './process_ui_syntax'; import { isOhmUrl } from './resolve_ohm_url'; import { logger } from './compile_info'; -- Gitee From ad4f04f85197b655a62614ee4a4664b3576764a5 Mon Sep 17 00:00:00 2001 From: hufeng Date: Sat, 14 Jan 2023 17:09:44 +0800 Subject: [PATCH 303/379] Fix ohmUrl of directory with index Signed-off-by: hufeng Change-Id: I5511387f69a053c3fcb89a46429cb5823d39457e --- compiler/src/utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 8da7413..10346ac 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -465,6 +465,8 @@ export function getExtension(filePath: string): string { extension = '.d.ets'; } else if (fs.existsSync(filePath + '.js') && fs.statSync(filePath + '.js').isFile()) { extension = '.js'; + } else if (fs.existsSync(filePath + '.json') && fs.statSync(filePath + '.json').isFile()) { + extension = '.json'; } return extension; -- Gitee From 3d0f09d17f5e180d9a6f639a6259fcfcaff1fd7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Sun, 29 Jan 2023 15:45:09 +0800 Subject: [PATCH 304/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/component_map.ts | 2 +- compiler/src/pre_define.ts | 10 ++++++++-- compiler/src/process_component_build.ts | 8 +++++--- .../@storageLink/@storageLink.ts | 3 +++ .../@storageProp/@storageProp.ts | 3 +++ .../appStorage/appStorage.ts | 6 ++++++ .../@storageLink/@storageLink.ts | 3 +++ .../@storageProp/@storageProp.ts | 3 +++ .../appStorage/appStorage.ts | 3 +++ 9 files changed, 35 insertions(+), 6 deletions(-) diff --git a/compiler/src/component_map.ts b/compiler/src/component_map.ts index 44e583b..1964464 100644 --- a/compiler/src/component_map.ts +++ b/compiler/src/component_map.ts @@ -98,7 +98,7 @@ export const JS_BIND_COMPONENTS: Set = new Set([ export const NEEDPOP_COMPONENT: Set = new Set(['Blank', 'Search']); export const CUSTOM_BUILDER_PROPERTIES: Set = new Set(['bindPopup', 'bindMenu', 'bindContextMenu', 'title', - 'menus', 'toolBar', 'tabBar', 'onDragStart', 'onItemDragStart']); + 'menus', 'toolBar', 'tabBar', 'onDragStart', 'onItemDragStart', 'swipeAction']); (function initComponent() { Object.keys(COMPONENT_MAP).forEach((componentName) => { diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 32d85b8..4eb1657 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -132,6 +132,9 @@ export const COMPONENT_SET_AND_PROP: string = 'setAndProp'; export const BUILD_ON: string = 'on'; export const BUILD_OFF: string = 'off'; +export const START: string = 'start'; +export const END: string = 'end'; + export const COMPONENT_CREATE_FUNCTION: string = 'create'; export const COMPONENT_CREATE_LABEL_FUNCTION: string = 'createWithLabel'; export const COMPONENT_CREATE_CHILD_FUNCTION: string = 'createWithChild'; @@ -218,8 +221,11 @@ export const VIEW_STACK_PROCESSOR: string = 'ViewStackProcessor'; export const BIND_POPUP: string = 'bindPopup'; export const BIND_POPUP_SET: Set = new Set(['bindPopup']); export const BIND_DRAG_SET: Set = new Set(['onDragStart', 'onItemDragStart']); -export const BIND_OBJECT_PROPERTY: Map> = - new Map([['Navigation', new Set(['title'])], ['NavDestination', new Set(['title'])]]); +export const BIND_OBJECT_PROPERTY: Map> = new Map([ + ['Navigation', new Set(['title'])], + ['NavDestination', new Set(['title'])], + ['ListImte', new Set(['swipeAction'])] +]); export const CREATE_BIND_COMPONENT: Set = new Set(['ListItemGroup']); export const HEADER: string = 'header'; export const FOOTER: string = 'footer'; diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 5c871ad..cb4dd73 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -99,7 +99,9 @@ import { FOOTER, CALL, CREATE_BIND_COMPONENT, - TabContentAndNavDestination + TabContentAndNavDestination, + START, + END } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -1616,8 +1618,8 @@ export function processObjectPropertyBuilder(node: ts.ObjectLiteralExpression): const newProperties: ts.PropertyAssignment[] = []; node.properties.forEach((property: ts.PropertyAssignment) => { if (property.name && ts.isIdentifier(property.name) && - [CUSTOM_DIALOG_CONTROLLER_BUILDER, HEADER, FOOTER].includes(property.name.escapedText.toString()) && - property.initializer) { + [CUSTOM_DIALOG_CONTROLLER_BUILDER, HEADER, FOOTER, START, END].includes( + property.name.escapedText.toString()) && property.initializer) { if (isPropertyAccessExpressionNode(property.initializer)) { newProperties.push(ts.factory.updatePropertyAssignment(property, property.name, ts.factory.createCallExpression( diff --git a/compiler/test/ut/ui_state_management/application_state_management/@storageLink/@storageLink.ts b/compiler/test/ut/ui_state_management/application_state_management/@storageLink/@storageLink.ts index 3feea88..942c825 100644 --- a/compiler/test/ut/ui_state_management/application_state_management/@storageLink/@storageLink.ts +++ b/compiler/test/ut/ui_state_management/application_state_management/@storageLink/@storageLink.ts @@ -82,6 +82,9 @@ class MyComponent extends View { get lang() { return this.__lang.get(); } + set lang(newValue) { + this.__lang.set(newValue); + } aboutToAppear() { this.label = (this.lang === 'zh') ? '数' : 'Count'; } diff --git a/compiler/test/ut/ui_state_management/application_state_management/@storageProp/@storageProp.ts b/compiler/test/ut/ui_state_management/application_state_management/@storageProp/@storageProp.ts index 7fe97dc..b95ca3f 100644 --- a/compiler/test/ut/ui_state_management/application_state_management/@storageProp/@storageProp.ts +++ b/compiler/test/ut/ui_state_management/application_state_management/@storageProp/@storageProp.ts @@ -82,6 +82,9 @@ class MyComponent extends View { get lang() { return this.__lang.get(); } + set lang(newValue) { + this.__lang.set(newValue); + } aboutToAppear() { this.label = (this.lang === 'zh') ? '数' : 'Count'; } diff --git a/compiler/test/ut/ui_state_management/application_state_management/appStorage/appStorage.ts b/compiler/test/ut/ui_state_management/application_state_management/appStorage/appStorage.ts index 8d95801..6926a0d 100644 --- a/compiler/test/ut/ui_state_management/application_state_management/appStorage/appStorage.ts +++ b/compiler/test/ut/ui_state_management/application_state_management/appStorage/appStorage.ts @@ -82,6 +82,12 @@ class MyComponent extends View { get lang() { return this.__lang.get(); } + set lang(newValue) { + this.__lang.set(newValue); + } + set lang(newValue) { + this.__lang.set(newValue); + } aboutToAppear() { this.label = (this.lang === 'zh') ? '数' : 'Count'; } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts index 3366b8d..1c054fd 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageLink/@storageLink.ts @@ -83,6 +83,9 @@ class MyComponent extends ViewPU { get lang() { return this.__lang.get(); } + set lang(newValue) { + this.__lang.set(newValue); + } aboutToAppear() { this.label = (this.lang === 'zh') ? '数' : 'Count'; } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts index 3366b8d..1c054fd 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/@storageProp/@storageProp.ts @@ -83,6 +83,9 @@ class MyComponent extends ViewPU { get lang() { return this.__lang.get(); } + set lang(newValue) { + this.__lang.set(newValue); + } aboutToAppear() { this.label = (this.lang === 'zh') ? '数' : 'Count'; } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts index 3366b8d..1c054fd 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/application_state_management/appStorage/appStorage.ts @@ -83,6 +83,9 @@ class MyComponent extends ViewPU { get lang() { return this.__lang.get(); } + set lang(newValue) { + this.__lang.set(newValue); + } aboutToAppear() { this.label = (this.lang === 'zh') ? '数' : 'Count'; } -- Gitee From 312126d798697743a9383efe2f147ace554852a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Sun, 29 Jan 2023 15:56:54 +0800 Subject: [PATCH 305/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- .../application_state_management/appStorage/appStorage.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/compiler/test/ut/ui_state_management/application_state_management/appStorage/appStorage.ts b/compiler/test/ut/ui_state_management/application_state_management/appStorage/appStorage.ts index 6926a0d..f26c16c 100644 --- a/compiler/test/ut/ui_state_management/application_state_management/appStorage/appStorage.ts +++ b/compiler/test/ut/ui_state_management/application_state_management/appStorage/appStorage.ts @@ -85,9 +85,6 @@ class MyComponent extends View { set lang(newValue) { this.__lang.set(newValue); } - set lang(newValue) { - this.__lang.set(newValue); - } aboutToAppear() { this.label = (this.lang === 'zh') ? '数' : 'Count'; } -- Gitee From 549704bc4a3513e4c00bd018fb4718ed166590a7 Mon Sep 17 00:00:00 2001 From: hufeng Date: Tue, 17 Jan 2023 15:28:04 +0800 Subject: [PATCH 306/379] Fix validateReExportType api Signed-off-by: hufeng Change-Id: I89f223487eb9041d5b78df690f321bb7bc2fa759 --- compiler/src/ark_utils.ts | 19 +++++++++++++++++-- compiler/src/pre_define.ts | 1 + compiler/src/process_import.ts | 19 +++++++++++++------ compiler/src/utils.ts | 2 +- 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/compiler/src/ark_utils.ts b/compiler/src/ark_utils.ts index 904e187..e244121 100644 --- a/compiler/src/ark_utils.ts +++ b/compiler/src/ark_utils.ts @@ -45,6 +45,7 @@ import { isWindows, isNodeModulesFile, genTemporaryPath, + getExtensionIfUnfullySpecifiedFilepath, mkdirsSync, toUnixPath, validateFilePathLength @@ -209,7 +210,7 @@ export function writeFileSyncByString(sourcePath: string, sourceCode: string, pr export function transformModuleSpecifier(sourcePath: string, sourceCode: string, projectConfig: any): string { // replace relative moduleSpecifier with ohmURl - const REG_RELATIVE_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]((?:\.\/|\.\.\/)[^'"]+)['"]/g; + const REG_RELATIVE_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]((?:\.\/|\.\.\/)[^'"]+|(?:\.\/?|\.\.\/?))['"]/g; const REG_HAR_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]([^\.\/][^'"]+)['"]/g; return sourceCode.replace(REG_HAR_DEPENDENCY, (item, moduleRequest) => { return replaceHarDependency(item, moduleRequest, projectConfig); @@ -245,6 +246,19 @@ function replaceHarDependency(item:string, moduleRequest: string, projectConfig: return item; } +function locateActualFilePathWithModuleRequest(absolutePath: string): string { + if (!fs.existsSync(absolutePath) || !fs.statSync(absolutePath).isDirectory()) { + return absolutePath + } + + const filePath: string = absolutePath + getExtensionIfUnfullySpecifiedFilepath(absolutePath); + if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) { + return absolutePath; + } + + return path.join(absolutePath, 'index'); +} + function replaceRelativeDependency(item:string, moduleRequest: string, sourcePath: string, projectConfig: any): string { if (sourcePath && projectConfig.compileMode === ESMODULE) { // remove file extension from moduleRequest @@ -260,7 +274,8 @@ function replaceRelativeDependency(item:string, moduleRequest: string, sourcePat return quotation + normalizedModuleRequest + quotation; }); - const filePath: string = path.resolve(path.dirname(sourcePath), moduleRequest); + const filePath: string = + locateActualFilePathWithModuleRequest(path.resolve(path.dirname(sourcePath), moduleRequest)); const result: RegExpMatchArray | null = filePath.match(/(\S+)(\/|\\)src(\/|\\)(?:main|ohosTest)(\/|\\)(ets|js)(\/|\\)(\S+)/); if (result && projectConfig.aceModuleJsonPath) { diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 32d85b8..08d0c7c 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -88,6 +88,7 @@ export const CUSTOM_DECORATOR_NAME: Set = new Set([ export const EXTNAME_ETS: string = '.ets'; export const NODE_MODULES: string = 'node_modules'; export const INDEX_ETS: string = 'index.ets'; +export const INDEX_TS: string = 'index.ts'; export const PACKAGE_JSON: string = 'package.json'; export const CUSTOM_COMPONENT_DEFAULT: string = 'default'; diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index 559ca0d..36aadd2 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -19,8 +19,10 @@ import path from 'path'; import { EXTNAME_ETS, + EXTNAME_TS, NODE_MODULES, INDEX_ETS, + INDEX_TS, PACKAGE_JSON, STRUCT, CLASS, @@ -56,7 +58,7 @@ import { localStoragePropCollection } from './validate_ui_syntax'; import { - getExtension, + getExtensionIfUnfullySpecifiedFilepath, hasDecorator, LogInfo, LogType, @@ -579,13 +581,18 @@ function getFileResolvePath(fileResolvePath: string, pagesDir: string, filePath: } export function getFileFullPath(filePath: string, pagesDir: string): string { - if (filePath && path.extname(filePath) !== EXTNAME_ETS && !isModule(filePath)) { - const dirIndexPath: string = path.resolve(path.resolve(pagesDir, filePath), INDEX_ETS); + if (filePath && path.extname(filePath) !== EXTNAME_ETS && path.extname(filePath) !== EXTNAME_TS && + !isModule(filePath)) { + const dirIndexEtsPath: string = path.resolve(path.resolve(pagesDir, filePath), INDEX_ETS); + const dirIndexTsPath: string = path.resolve(path.resolve(pagesDir, filePath), INDEX_TS); if (/^(\.|\.\.)\//.test(filePath) && !fs.existsSync(path.resolve(pagesDir, filePath + EXTNAME_ETS)) && - fs.existsSync(dirIndexPath)) { - filePath = dirIndexPath; + fs.existsSync(dirIndexEtsPath)) { + filePath = dirIndexEtsPath; + } else if (/^(\.|\.\.)\//.test(filePath) && !fs.existsSync(path.resolve(pagesDir, filePath + EXTNAME_TS)) && + fs.existsSync(dirIndexTsPath)) { + filePath = dirIndexTsPath; } else { - filePath += getExtension(path.resolve(pagesDir, filePath)); + filePath += getExtensionIfUnfullySpecifiedFilepath(path.resolve(pagesDir, filePath)); } } diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 10346ac..6c30e30 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -451,7 +451,7 @@ export function unlinkSync(filePath: string): void { } } -export function getExtension(filePath: string): string { +export function getExtensionIfUnfullySpecifiedFilepath(filePath: string): string { if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) { return ""; } -- Gitee From 98de94817e0345c2df0e1d67009846e384274794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 30 Jan 2023 10:20:53 +0800 Subject: [PATCH 307/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_class.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index 507cc3c..214b066 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -76,7 +76,8 @@ import { OBSERVED_PROPERTY_ABSTRACT_PU, CREATE_LOCAL_STORAGE_LINK, CREATE_LOCAL_STORAGE_PROP, - COMPONENT_UPDATE_STATE_VARS + COMPONENT_UPDATE_STATE_VARS, + COMPONENT_WATCH_DECORATOR } from './pre_define'; import { BUILDIN_STYLE_NAMES, @@ -287,12 +288,18 @@ function addPropertyMember(item: ts.ClassElement, newMembers: ts.ClassElement[], ) { isLocalStorage = true; } - updatePropertyItem = createPropertyDeclaration(propertyItem, newType, false, - isLocalStorage, parentComponentName); - if (updatePropertyItem) { - newMembers.push(updatePropertyItem); + const newUpdatePropertyItem = createPropertyDeclaration( + propertyItem, newType, false, isLocalStorage, parentComponentName); + if (!updatePropertyItem) { + updatePropertyItem = newUpdatePropertyItem; + } else if (INNER_COMPONENT_MEMBER_DECORATORS.has(decoratorName) && + decoratorName !== COMPONENT_WATCH_DECORATOR) { + updatePropertyItem = newUpdatePropertyItem; } } + if (updatePropertyItem) { + newMembers.push(updatePropertyItem); + } } } -- Gitee From 1d78a261bb8aa35029d1fc114834f082d5dc470a Mon Sep 17 00:00:00 2001 From: hufeng Date: Sun, 29 Jan 2023 10:51:22 +0800 Subject: [PATCH 308/379] Fix js class static properties transforming during compiling module Signed-off-by: hufeng Change-Id: I9a72c21e5be98e4fe1b6dc0530374c3beabe0994 --- compiler/webpack.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 883195d..c673437 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -147,6 +147,7 @@ function setJsConfigRule() { const jsRule = { test: /\.js$/, use: [ + { loader: path.resolve(__dirname, 'lib/process_source_file.js') }, { loader: 'babel-loader', options: { @@ -154,13 +155,12 @@ function setJsConfigRule() { compact: false } }, - { loader: path.resolve(__dirname, 'lib/process_source_file.js') }, { loader: path.resolve(__dirname, 'lib/process_system_module.js') } ] }; if (projectConfig.compileMode !== 'esmodule') { jsRule.type = 'javascript/auto'; - jsRule.use[0].options.plugins.unshift([ + jsRule.use[1].options.plugins.unshift([ '@babel/plugin-transform-modules-commonjs', { 'allowTopLevelThis': true -- Gitee From bfb46ae055afdaac321dba5d06224bdf0f2c58ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Mon, 30 Jan 2023 06:27:35 +0000 Subject: [PATCH 309/379] update compiler/src/pre_define.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/pre_define.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 4eb1657..8d4097e 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -224,7 +224,7 @@ export const BIND_DRAG_SET: Set = new Set(['onDragStart', 'onItemDragSta export const BIND_OBJECT_PROPERTY: Map> = new Map([ ['Navigation', new Set(['title'])], ['NavDestination', new Set(['title'])], - ['ListImte', new Set(['swipeAction'])] + ['ListItem', new Set(['swipeAction'])] ]); export const CREATE_BIND_COMPONENT: Set = new Set(['ListItemGroup']); export const HEADER: string = 'header'; -- Gitee From 8cc47409d73afdd675b64373417f950a296be567 Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Fri, 20 Jan 2023 12:28:38 +0800 Subject: [PATCH 310/379] Fix unconsistent abc in ts mode Signed-off-by: chenqy930 Change-Id: Id9adf8a0e2196dbe60ad22140f616e2f96d06597 --- compiler/src/gen_abc_plugin.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 758ab7d..2c82d44 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -1142,6 +1142,9 @@ function copyModuleFileCachePathToBuildPath(): void { mkdirsSync(path.dirname(protoFilePath)); let entriesInfo: string = ''; moduleInfos = removeDuplicateInfo(moduleInfos); + moduleInfos.sort((m1: ModuleInfo, m2: ModuleInfo) => { + return m1.tempFilePath < m2.tempFilePath ? 1 : -1; + }); for (let i = 0; i < moduleInfos.length; ++i) { let protoTempPath: string = genProtoFileName(moduleInfos[i].tempFilePath); entriesInfo += `${toUnixPath(protoTempPath)}\n`; -- Gitee From b1a1f2612c908d080dec2bd353941f4cae562cc8 Mon Sep 17 00:00:00 2001 From: lihong Date: Sun, 29 Jan 2023 11:15:14 +0800 Subject: [PATCH 311/379] lihong67@huawei.com optimize compile performance for fast build. Signed-off-by: lihong Change-Id: Icae84491dc48796dd3db7e36ca097864e8f9cfdf --- BUILD.gn | 2 + compiler/compile_plugin.js | 26 ++ compiler/main.js | 115 ++++--- compiler/package-lock.json | 316 +++++++++++++++++- compiler/package.json | 9 +- compiler/rollup.config.js | 104 ++++++ compiler/src/compile_info.ts | 259 ++------------ compiler/src/ets_checker.ts | 216 +++++++++++- compiler/src/fast_build/common/init_config.ts | 25 ++ .../common/process_project_config.ts | 90 +++++ .../common/rollup-plugin-watch-change.ts | 59 ++++ .../ets_ui/rollup-plugin-ets-checker.ts | 49 +++ .../ets_ui/rollup-plugin-ets-typescript.ts | 118 +++++++ .../system_api/rollup-plugin-system-api.ts | 100 ++++++ compiler/src/process_component_build.ts | 5 +- compiler/src/process_custom_component.ts | 15 +- compiler/src/process_import.ts | 4 +- compiler/src/process_ui_syntax.ts | 60 +++- compiler/src/result_process.ts | 25 +- compiler/src/utils.ts | 146 ++++++-- compiler/src/validate_ui_syntax.ts | 5 +- compiler/webpack.config.js | 38 +-- 22 files changed, 1382 insertions(+), 404 deletions(-) create mode 100644 compiler/compile_plugin.js create mode 100644 compiler/rollup.config.js create mode 100644 compiler/src/fast_build/common/init_config.ts create mode 100644 compiler/src/fast_build/common/process_project_config.ts create mode 100644 compiler/src/fast_build/common/rollup-plugin-watch-change.ts create mode 100644 compiler/src/fast_build/ets_ui/rollup-plugin-ets-checker.ts create mode 100644 compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts create mode 100644 compiler/src/fast_build/system_api/rollup-plugin-system-api.ts diff --git a/BUILD.gn b/BUILD.gn index b2d5b86..d2d5501 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -133,10 +133,12 @@ action("build_ets_sysResource") { } ets_loader_sources = [ + "compiler/compile_plugin.js", "compiler/main.js", "compiler/npm-install.js", "compiler/package-lock.json", "compiler/package.json", + "compiler/rollup.config.js", "compiler/tsconfig.esm.json", "compiler/tsconfig.json", "compiler/webpack.config.js", diff --git a/compiler/compile_plugin.js b/compiler/compile_plugin.js new file mode 100644 index 0000000..027176b --- /dev/null +++ b/compiler/compile_plugin.js @@ -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. + */ + +const { etsTransform } = require('./lib/fast_build/ets_ui/rollup-plugin-ets-typescript'); +const { etsChecker } = require('./lib/fast_build/ets_ui/rollup-plugin-ets-checker'); +const { apiTransform } = require('./lib/fast_build/system_api/rollup-plugin-system-api'); +const { genAbc } = require('./lib/fast_build/ark_compiler/rollup-plugin-gen-abc'); +const { watchChangeFiles } = require('./lib/fast_build/common/rollup-plugin-watch-change'); + +exports.etsTransform = etsTransform; +exports.apiTransform = apiTransform; +exports.etsChecker = etsChecker; +exports.genAbc = genAbc; +exports.watchChangeFiles = watchChangeFiles; diff --git a/compiler/main.js b/compiler/main.js index 6d3b6cc..31475df 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -81,19 +81,21 @@ function initProjectConfig(projectConfig) { projectConfig.xtsMode = /ets_loader_ark$/.test(__dirname); projectConfig.localPropertiesPath = projectConfig.localPropertiesPath || process.env.localPropertiesPath; projectConfig.projectProfilePath = projectConfig.projectProfilePath || process.env.projectProfilePath; - projectConfig.isPreview = projectConfig.isPreview || - (process.env.isPreview === 'true' ? true : process.env.isPreview); + projectConfig.isPreview = projectConfig.isPreview || process.env.isPreview === 'true'; projectConfig.compileMode = projectConfig.compileMode || 'jsbundle'; projectConfig.runtimeOS = projectConfig.runtimeOS || process.env.runtimeOS || 'default'; projectConfig.sdkInfo = projectConfig.sdkInfo || process.env.sdkInfo || 'default'; projectConfig.compileHar = false; projectConfig.compileShared = false; projectConfig.splitCommon = false; + projectConfig.checkEntry = projectConfig.checkEntry || process.env.checkEntry; + projectConfig.obfuscateHarType = projectConfig.obfuscateHarType || process.env.obfuscate; } function loadEntryObj(projectConfig) { let manifest = {}; initProjectConfig(projectConfig); + loadBuildJson(); if (process.env.aceManifestPath && aceCompileMode === 'page') { setEntryFile(projectConfig); setFaTestRunnerFile(projectConfig); @@ -103,7 +105,7 @@ function loadEntryObj(projectConfig) { setStageTestRunnerFile(projectConfig); } - if(staticPreviewPage) { + if (staticPreviewPage) { projectConfig.entryObj['./' + staticPreviewPage] = projectConfig.projectPath + path.sep + staticPreviewPage + '.ets?entry'; } else if (abilityConfig.abilityType === 'page') { @@ -451,65 +453,80 @@ function loadWorker(projectConfig, workerFileEntry) { } } -function readWorkerFile(isPreview) { - const workerFileEntry = {}; +let aceBuildJson = {}; +function loadBuildJson() { if (projectConfig.aceBuildJson && fs.existsSync(projectConfig.aceBuildJson)) { - const workerConfig = JSON.parse(fs.readFileSync(projectConfig.aceBuildJson).toString()); - if (workerConfig.workers) { - workerConfig.workers.forEach(worker => { - if (!/\.(ts|js)$/.test(worker)) { - worker += '.ts'; - } - const relativePath = path.relative(projectConfig.projectPath, worker); - if (filterWorker(relativePath)) { - const workerKey = relativePath.replace(/\.(ts|js)$/, '').replace(/\\/g, '/'); - if (workerFileEntry[workerKey]) { - throw Error( - '\u001b[31m ERROR: The worker file cannot use the same file name: \n' + - workerFileEntry[workerKey] + '\n' + worker + '\u001b[39m' - ).message; - } else { - workerFileEntry[workerKey] = worker; - } + aceBuildJson = JSON.parse(fs.readFileSync(projectConfig.aceBuildJson).toString()); + } +} + +function initBuildInfo() { + projectConfig.projectRootPath = aceBuildJson.projectRootPath; + if (projectConfig.compileHar && aceBuildJson.moduleName && + aceBuildJson.modulePathMap[aceBuildJson.moduleName]) { + projectConfig.moduleRootPath = aceBuildJson.modulePathMap[aceBuildJson.moduleName]; + } +} + +function readWorkerFile() { + const workerFileEntry = {}; + if (aceBuildJson.workers) { + aceBuildJson.workers.forEach(worker => { + if (!/\.(ts|js)$/.test(worker)) { + worker += '.ts'; + } + const relativePath = path.relative(projectConfig.projectPath, worker); + if (filterWorker(relativePath)) { + const workerKey = relativePath.replace(/\.(ts|js)$/, '').replace(/\\/g, '/'); + if (workerFileEntry[workerKey]) { + throw Error( + '\u001b[31m ERROR: The worker file cannot use the same file name: \n' + + workerFileEntry[workerKey] + '\n' + worker + '\u001b[39m' + ).message; + } else { + workerFileEntry[workerKey] = worker; } - }); - return workerFileEntry; - } - if (workerConfig.patchConfig) { - projectConfig.hotReload = process.env.watchMode === 'true' && isPreview !== 'true'; - projectConfig.patchAbcPath = workerConfig.patchConfig.patchAbcPath; - projectConfig.changedFileList = workerConfig.patchConfig.changedFileList ? - workerConfig.patchConfig.changedFileList : path.join(projectConfig.cachePath, 'changedFileList.json'); - if (projectConfig.hotReload) { - writeFileSync(projectConfig.changedFileList, JSON.stringify({ - modifiedFiles: [], - removedFiles: [] - })); } - } + }); + return workerFileEntry; } return null; } +function readPatchConfig() { + if (aceBuildJson.patchConfig) { + projectConfig.hotReload = process.env.watchMode === 'true' && !projectConfig.isPreview; + projectConfig.patchAbcPath = aceBuildJson.patchConfig.patchAbcPath; + projectConfig.changedFileList = aceBuildJson.patchConfig.changedFileList ? + aceBuildJson.patchConfig.changedFileList : path.join(projectConfig.cachePath, 'changedFileList.json'); + if (projectConfig.hotReload) { + writeFileSync(projectConfig.changedFileList, JSON.stringify({ + modifiedFiles: [], + removedFiles: [] + })); + } + } +} + function filterWorker(workerPath) { return /\.(ts|js)$/.test(workerPath); } ;(function initSystemResource() { - const sysResourcePath = path.resolve('./sysResource.js'); + const sysResourcePath = path.resolve(__dirname, './sysResource.js'); if (fs.existsSync(sysResourcePath)) { resources.sys = require(sysResourcePath).sys; } })(); ;(function readSystemModules() { - const systemModulesPath = path.resolve(__dirname,'../../api'); + const systemModulesPath = path.resolve(__dirname, '../../api'); if (fs.existsSync(systemModulesPath)) { systemModules.push(...fs.readdirSync(systemModulesPath)); } })() -function readAppResource(resources, filePath) { +function readAppResource(filePath) { if (fs.existsSync(filePath)) { const appResource = fs.readFileSync(filePath, "utf-8"); const resourceArr = appResource.split(/\n/); @@ -583,7 +600,7 @@ function loadModuleInfo(projectConfig, envArgs) { function checkAppResourcePath(appResourcePath, config) { if (appResourcePath) { - readAppResource(resources, appResourcePath); + readAppResource(appResourcePath); if (fs.existsSync(appResourcePath) && config.cache) { config.cache.buildDependencies.config.push(appResourcePath); } @@ -623,6 +640,21 @@ function addSDKBuildDependencies(config) { } } +function getCleanConfig(workerFile) { + const cleanPath = []; + if (projectConfig.compileMode === 'esmodule') { + return cleanPath; + } + cleanPath.push(projectConfig.buildPath); + if (workerFile) { + const workerFilesPath = Object.keys(workerFile); + for (const workerFilePath of workerFilesPath) { + cleanPath.push(path.join(projectConfig.buildPath, workerFilePath, '..')); + } + } + return cleanPath; +} + function isPartialUpdate(metadata) { if (Array.isArray(metadata) && metadata.length) { metadata.some(item => { @@ -672,3 +704,6 @@ exports.systemModules = systemModules; exports.checkAppResourcePath = checkAppResourcePath; exports.addSDKBuildDependencies = addSDKBuildDependencies; exports.partialUpdateConfig = partialUpdateConfig; +exports.readPatchConfig = readPatchConfig; +exports.initBuildInfo = initBuildInfo; +exports.getCleanConfig = getCleanConfig; diff --git a/compiler/package-lock.json b/compiler/package-lock.json index cc09792..19a7da8 100644 --- a/compiler/package-lock.json +++ b/compiler/package-lock.json @@ -249,7 +249,6 @@ "version": "7.18.6", "resolved": "https://repo.huaweicloud.com/repository/npm/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", - "dev": true, "requires": { "@babel/types": "^7.18.6" } @@ -340,8 +339,7 @@ "@babel/helper-validator-identifier": { "version": "7.18.6", "resolved": "https://repo.huaweicloud.com/repository/npm/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz", - "integrity": "sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==", - "dev": true + "integrity": "sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==" }, "@babel/helper-validator-option": { "version": "7.18.6", @@ -1248,7 +1246,6 @@ "version": "7.18.7", "resolved": "https://repo.huaweicloud.com/repository/npm/@babel/types/-/types-7.18.7.tgz", "integrity": "sha512-QG3yxTcTIBoAcQmkCs+wAPYZhu7Dk9rXKacINfNbdJDNERTbLQbHGyVG8q/YGMPeCJRIhSY0+fTc5+xuh6WPSQ==", - "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.18.6", "to-fast-properties": "^2.0.0" @@ -1383,6 +1380,88 @@ "fastq": "^1.6.0" } }, + "@rollup/plugin-babel": { + "version": "6.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/@rollup/plugin-babel/-/plugin-babel-6.0.3.tgz", + "integrity": "sha512-fKImZKppa1A/gX73eg4JGo+8kQr/q1HBQaCGKECZ0v4YBBv3lFqi14+7xyApECzvkLTHCifx+7ntcrvtBIRcpg==", + "requires": { + "@babel/helper-module-imports": "^7.18.6", + "@rollup/pluginutils": "^5.0.1" + } + }, + "@rollup/plugin-commonjs": { + "version": "23.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/@rollup/plugin-commonjs/-/plugin-commonjs-23.0.2.tgz", + "integrity": "sha512-e9ThuiRf93YlVxc4qNIurvv+Hp9dnD+4PjOqQs5vAYfcZ3+AXSrcdzXnVjWxcGQOa6KGJFcRZyUI3ktWLavFjg==", + "requires": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "glob": "^8.0.3", + "is-reference": "1.2.1", + "magic-string": "^0.26.4" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "glob": { + "version": "8.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + } + }, + "minimatch": { + "version": "5.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, + "@rollup/plugin-node-resolve": { + "version": "15.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.1.tgz", + "integrity": "sha512-ReY88T7JhJjeRVbfCyNj+NXAG3IIsVMsX9b5/9jC98dRP8/yxlZdz7mHZbHk5zHr24wZZICS5AcXsFZAXYUQEg==", + "requires": { + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-builtin-module": "^3.2.0", + "is-module": "^1.0.0", + "resolve": "^1.22.1" + } + }, + "@rollup/pluginutils": { + "version": "5.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", + "integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==", + "requires": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + }, + "dependencies": { + "@types/estree": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/@types/estree/-/estree-1.0.0.tgz", + "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==" + } + } + }, "@types/eslint": { "version": "8.4.3", "resolved": "https://repo.huaweicloud.com/repository/npm/@types/eslint/-/eslint-8.4.3.tgz", @@ -1406,6 +1485,14 @@ "resolved": "https://repo.huaweicloud.com/repository/npm/@types/estree/-/estree-0.0.51.tgz", "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==" }, + "@types/fs-extra": { + "version": "8.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/@types/fs-extra/-/fs-extra-8.1.2.tgz", + "integrity": "sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==", + "requires": { + "@types/node": "*" + } + }, "@types/glob": { "version": "7.2.0", "resolved": "https://repo.huaweicloud.com/repository/npm/@types/glob/-/glob-7.2.0.tgz", @@ -1430,6 +1517,11 @@ "resolved": "https://repo.huaweicloud.com/repository/npm/@types/node/-/node-18.0.0.tgz", "integrity": "sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==" }, + "@types/resolve": { + "version": "1.20.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/@types/resolve/-/resolve-1.20.2.tgz", + "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==" + }, "@types/source-list-map": { "version": "0.1.2", "resolved": "https://repo.huaweicloud.com/repository/npm/@types/source-list-map/-/source-list-map-0.1.2.tgz", @@ -1734,6 +1826,15 @@ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ajv": { "version": "6.12.6", "resolved": "https://repo.huaweicloud.com/repository/npm/ajv/-/ajv-6.12.6.tgz", @@ -1961,6 +2062,11 @@ "resolved": "https://repo.huaweicloud.com/repository/npm/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, + "builtin-modules": { + "version": "3.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==" + }, "call-bind": { "version": "1.0.2", "resolved": "https://repo.huaweicloud.com/repository/npm/call-bind/-/call-bind-1.0.2.tgz", @@ -2045,6 +2151,11 @@ "resolved": "https://repo.huaweicloud.com/repository/npm/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==" }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" + }, "clean-webpack-plugin": { "version": "3.0.0", "resolved": "https://repo.huaweicloud.com/repository/npm/clean-webpack-plugin/-/clean-webpack-plugin-3.0.0.tgz", @@ -2101,8 +2212,7 @@ "commondir": { "version": "1.0.1", "resolved": "https://repo.huaweicloud.com/repository/npm/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==" }, "concat-map": { "version": "0.0.1", @@ -2243,6 +2353,11 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "deepmerge": { + "version": "4.2.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" + }, "define-properties": { "version": "1.1.4", "resolved": "https://repo.huaweicloud.com/repository/npm/define-properties/-/define-properties-1.1.4.tgz", @@ -2534,6 +2649,11 @@ "resolved": "https://repo.huaweicloud.com/repository/npm/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" }, + "estree-walker": { + "version": "2.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, "esutils": { "version": "2.0.3", "resolved": "https://repo.huaweicloud.com/repository/npm/esutils/-/esutils-2.0.3.tgz", @@ -2707,7 +2827,6 @@ "version": "2.3.2", "resolved": "https://repo.huaweicloud.com/repository/npm/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "optional": true }, "function-bind": { @@ -2894,6 +3013,11 @@ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" + }, "inflight": { "version": "1.0.6", "resolved": "https://repo.huaweicloud.com/repository/npm/inflight/-/inflight-1.0.6.tgz", @@ -2927,6 +3051,14 @@ "resolved": "https://repo.huaweicloud.com/repository/npm/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, + "is-builtin-module": { + "version": "3.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-builtin-module/-/is-builtin-module-3.2.0.tgz", + "integrity": "sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw==", + "requires": { + "builtin-modules": "^3.3.0" + } + }, "is-core-module": { "version": "2.9.0", "resolved": "https://repo.huaweicloud.com/repository/npm/is-core-module/-/is-core-module-2.9.0.tgz", @@ -2954,6 +3086,11 @@ "is-extglob": "^2.1.1" } }, + "is-module": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==" + }, "is-number": { "version": "7.0.0", "resolved": "https://repo.huaweicloud.com/repository/npm/is-number/-/is-number-7.0.0.tgz", @@ -2994,6 +3131,14 @@ "isobject": "^3.0.1" } }, + "is-reference": { + "version": "1.2.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "requires": { + "@types/estree": "*" + } + }, "isarray": { "version": "1.0.0", "resolved": "https://repo.huaweicloud.com/repository/npm/isarray/-/isarray-1.0.0.tgz", @@ -3180,6 +3325,14 @@ "yallist": "^4.0.0" } }, + "magic-string": { + "version": "0.26.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/magic-string/-/magic-string-0.26.7.tgz", + "integrity": "sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==", + "requires": { + "sourcemap-codec": "^1.4.8" + } + }, "make-dir": { "version": "2.1.0", "resolved": "https://repo.huaweicloud.com/repository/npm/make-dir/-/make-dir-2.1.0.tgz", @@ -3838,6 +3991,147 @@ "glob": "^7.1.3" } }, + "rollup": { + "version": "3.5.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/rollup/-/rollup-3.5.0.tgz", + "integrity": "sha512-TYu2L+TGhmNsXCtByont89u+ATQLcDy6A+++PwLXYunRtOm7XnaD+65s1pvewaOxMYR0eOkMXn9/i0saBxxpnQ==", + "requires": { + "fsevents": "~2.3.2" + } + }, + "rollup-plugin-copy": { + "version": "3.4.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/rollup-plugin-copy/-/rollup-plugin-copy-3.4.0.tgz", + "integrity": "sha512-rGUmYYsYsceRJRqLVlE9FivJMxJ7X6jDlP79fmFkL8sJs7VVMSVyA2yfyL+PGyO/vJs4A87hwhgVfz61njI+uQ==", + "requires": { + "@types/fs-extra": "^8.0.1", + "colorette": "^1.1.0", + "fs-extra": "^8.1.0", + "globby": "10.0.1", + "is-plain-object": "^3.0.0" + }, + "dependencies": { + "array-union": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" + }, + "colorette": { + "version": "1.4.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==" + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "globby": { + "version": "10.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/globby/-/globby-10.0.1.tgz", + "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==", + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + } + }, + "is-plain-object": { + "version": "3.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-plain-object/-/is-plain-object-3.0.1.tgz", + "integrity": "sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==" + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + } + } + }, + "rollup-plugin-delete": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/rollup-plugin-delete/-/rollup-plugin-delete-2.0.0.tgz", + "integrity": "sha512-/VpLMtDy+8wwRlDANuYmDa9ss/knGsAgrDhM+tEwB1npHwNu4DYNmDfUL55csse/GHs9Q+SMT/rw9uiaZ3pnzA==", + "requires": { + "del": "^5.1.0" + }, + "dependencies": { + "array-union": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" + }, + "del": { + "version": "5.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/del/-/del-5.1.0.tgz", + "integrity": "sha512-wH9xOVHnczo9jN2IW68BabcecVPxacIA3g/7z6vhSU/4stOKQzeCRK0yD0A24WiAAUJmmVpWqrERcTxnLo3AnA==", + "requires": { + "globby": "^10.0.1", + "graceful-fs": "^4.2.2", + "is-glob": "^4.0.1", + "is-path-cwd": "^2.2.0", + "is-path-inside": "^3.0.1", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "slash": "^3.0.0" + } + }, + "globby": { + "version": "10.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/globby/-/globby-10.0.2.tgz", + "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + } + }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==" + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "requires": { + "glob": "^7.1.3" + } + } + } + }, "run-parallel": { "version": "1.2.0", "resolved": "https://repo.huaweicloud.com/repository/npm/run-parallel/-/run-parallel-1.2.0.tgz", @@ -3928,6 +4222,11 @@ "source-map": "^0.6.0" } }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://repo.huaweicloud.com/repository/npm/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://repo.huaweicloud.com/repository/npm/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -4078,8 +4377,7 @@ "to-fast-properties": { "version": "2.0.0", "resolved": "https://repo.huaweicloud.com/repository/npm/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "dev": true + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==" }, "to-regex-range": { "version": "5.0.1", diff --git a/compiler/package.json b/compiler/package.json index 32824c6..4c01e7b 100644 --- a/compiler/package.json +++ b/compiler/package.json @@ -15,7 +15,8 @@ "compile": "webpack --config webpack.config.js --env buildMode=debug projectName", "test": "npm run build && mocha -r mocha-context/register test/test.js && mocha -r mocha-context/register test/test.js --partialUpdate", "generateDeclarations": "node ./build_declarations_file.js ../../../interface/sdk-js/api/@internal/component/ets ./declarations ./lib", - "postinstall": "node npm-install.js" + "postinstall": "node npm-install.js", + "fastbuild": "rollup -c rollup.config.js" }, "devDependencies": { "@babel/cli": "^7.8.4", @@ -36,6 +37,9 @@ "url-loader": "^4.1.1" }, "dependencies": { + "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-commonjs": "^23.0.2", + "@rollup/plugin-node-resolve": "^15.0.1", "clean-webpack-plugin": "^3.0.0", "copy-webpack-plugin": "^8.1.0", "deccjsunit": "^1.0.8", @@ -44,6 +48,9 @@ "lodash": "^4.17.21", "log4js": "^6.3.0", "md5": "^2.3.0", + "rollup": "^3.5.0", + "rollup-plugin-copy": "^3.4.0", + "rollup-plugin-delete": "^2.0.0", "ts-loader": "^8.0.12", "typescript": "file:./deps/ohos-typescript-4.2.3-r2.tgz", "webpack": "^5.70.0", diff --git a/compiler/rollup.config.js b/compiler/rollup.config.js new file mode 100644 index 0000000..38dce61 --- /dev/null +++ b/compiler/rollup.config.js @@ -0,0 +1,104 @@ +/* + * 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 path = require('path'); +const commonjs = require('@rollup/plugin-commonjs'); +const resolve = require('@rollup/plugin-node-resolve'); +const copyPlugin = require('rollup-plugin-copy'); +const deletePlugin = require('rollup-plugin-delete'); +const { getBabelOutputPlugin } = require('@rollup/plugin-babel'); + +const { + projectConfig, + readAppResource, + getCleanConfig +} = require('./main'); +const { + getEntryObj, + workerFile, + setCopyPluginConfig +} = require('./lib/fast_build/common/process_project_config'); +const { + getResolveModules +} = require('./lib/utils'); +const { etsTransform } = require('./lib/fast_build/ets_ui/rollup-plugin-ets-typescript'); +const { etsChecker } = require('./lib/fast_build/ets_ui/rollup-plugin-ets-checker'); +const { apiTransform } = require('./lib/fast_build/system_api/rollup-plugin-system-api'); +const { watchChangeFiles } = require('./lib/fast_build/common/rollup-plugin-watch-change'); +const { initArkConfig } = require('./lib/fast_build/ark_compiler/common/process_ark_config'); +const { genAbc } = require('./lib/fast_build/ark_compiler/rollup-plugin-gen-abc'); + +process.env.watchMode = (process.env.watchMode && process.env.watchMode === 'true') || 'false'; +process.env.compileTool = 'rollup'; + +getEntryObj(); +if (process.env.appResource) { + readAppResource(process.env.appResource); +} +initArkConfig(process.env, projectConfig); + +const external = []; +if (projectConfig.compileMode === 'esmodule' && projectConfig.harNameOhmMap) { + for (const harName in projectConfig.harNameOhmMap) { + external.push(RegExp('^(' + harName + ')($|\/\S+)')); + } +} + +const config = { + input: projectConfig.entryObj, + watch: { + buildDelay: 10 + }, + output: { + dir: path.resolve(__dirname, projectConfig.buildPath), + chunkFileNames: '[name].js', + format: 'cjs', + sourcemap: true + }, + external: external, + plugins: [ + // copyPlugin({targets: setCopyPluginConfig(projectConfig, process.env.appResource)}), + resolve({ + extensions: ['.js', '.ets', '.ts', '.d.ts', '.d.ets'], + modulePaths: [ + path.resolve(projectConfig.projectPath), + path.resolve('node_modules'), + path.resolve(__dirname, 'node_modules'), + path.resolve(__dirname, '../../api'), + projectConfig.aceModuleJsonPath ? + ...getResolveModules(path.resolve(projectConfig.projectPath), false) : + ...getResolveModules(path.resolve(projectConfig.projectPath), true) + ] + }), + commonjs(), + getBabelOutputPlugin({ + plugins: [ + '@babel/plugin-proposal-class-properties' + ], + compact: false + }), + watchChangeFiles(), + etsChecker(), + apiTransform(), + etsTransform(), + genAbc(), + deletePlugin({ + targets: getCleanConfig(workerFile), + runOnce: true + }) + ] +}; + +module.exports = config; diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index ede9a4a..afca008 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -34,25 +34,27 @@ import { } from './validate_ui_syntax'; import { circularFile, - mkDir, + writeUseOSFiles, writeFileSync, parseErrorMessage, - generateSourceFilesInHar, - genTemporaryPath + genTemporaryPath, + shouldWriteChangedList, + getHotReloadFiles } from './utils'; import { MODULE_ETS_PATH, MODULE_SHARE_PATH, BUILD_SHARE_PATH, - ESMODULE, - JSBUNDLE, EXTNAME_JS, EXTNAME_JS_MAP } from './pre_define'; import { - createLanguageService, + serviceChecker, createWatchCompilerHost, - readDeaclareFiles + hotReloadSupportFiles, + printDiagnostic, + checkerResult, + incrementWatchFile } from './ets_checker'; import { globalProgram, @@ -78,11 +80,6 @@ interface Info { }; } -interface filesObj { - modifiedFiles: string[], - removedFiles: string[] -} - export interface CacheFileName { mtimeMs: number, children: string[], @@ -95,27 +92,10 @@ interface hotReloadIncrementalTime { hotReloadIncrementalEndTime: string; } -interface NeedUpdateFlag { - flag: boolean; -} - -export const allResolvedModules: Set = new Set(); -export let hotReloadSupportFiles: Set = new Set(); -export let cache: Cache = {}; -export const shouldResolvedFiles: Set = new Set() -type Cache = Record; -let allModifiedFiles: Set = new Set(); -interface wholeCache { - runtimeOS: string, - sdkInfo: string, - fileList: Cache -} - export class ResultStates { private mStats: Stats; private mErrorCount: number = 0; private mPreErrorCount: number = 0; - private tsErrorCount: number = 0; private mWarningCount: number = 0; private warningCount: number = 0; private noteCount: number = 0; @@ -261,64 +241,11 @@ export class ResultStates { rootFileNames.push(fileName.replace('?entry', '')); }); if (process.env.watchMode === 'true') { - if (projectConfig.hotReload) { - [...rootFileNames, ...readDeaclareFiles()].forEach(fileName => { - hotReloadSupportFiles.add(path.resolve(fileName)); - }) - } globalProgram.watchProgram = ts.createWatchProgram( - createWatchCompilerHost(rootFileNames, this.printDiagnostic.bind(this), - this.delayPrintLogCount.bind(this), this.resetTsErrorCount.bind(this))); + createWatchCompilerHost(rootFileNames, printDiagnostic, + this.delayPrintLogCount.bind(this), this.resetTsErrorCount)); } else { - let languageService: ts.LanguageService = null; - let cacheFile: string = null; - if (projectConfig.xtsMode) { - languageService = createLanguageService(rootFileNames); - } else { - cacheFile = path.resolve(projectConfig.cachePath, '../.ts_checker_cache'); - let wholeCache: wholeCache = fs.existsSync(cacheFile) ? - JSON.parse(fs.readFileSync(cacheFile).toString()) : - {"runtimeOS": projectConfig.runtimeOS, "sdkInfo": projectConfig.sdkInfo, "fileList": {}}; - if (wholeCache.runtimeOS === projectConfig.runtimeOS && wholeCache.sdkInfo === projectConfig.sdkInfo) { - cache = wholeCache.fileList; - } else { - cache = {}; - } - const filterFiles: string[] = filterInput(rootFileNames); - languageService = createLanguageService(filterFiles); - } - globalProgram.program = languageService.getProgram(); - const allDiagnostics: ts.Diagnostic[] = globalProgram.program - .getSyntacticDiagnostics() - .concat(globalProgram.program.getSemanticDiagnostics()) - .concat(globalProgram.program.getDeclarationDiagnostics()); - allDiagnostics.forEach((diagnostic: ts.Diagnostic) => { - this.printDiagnostic(diagnostic); - }); - if (process.env.watchMode !== 'true' && !projectConfig.xtsMode) { - fs.writeFileSync(cacheFile, JSON.stringify({ - "runtimeOS": projectConfig.runtimeOS, - "sdkInfo": projectConfig.sdkInfo, - "fileList": cache - }, null, 2)); - } - if (projectConfig.compileHar || projectConfig.compileShared) { - [...allResolvedModules, ...rootFileNames].forEach(moduleFile => { - if (!(moduleFile.match(/node_modules/) && projectConfig.compileHar)) { - try { - const emit: any = languageService.getEmitOutput(moduleFile, true, true); - if (emit.outputFiles[0]) { - generateSourceFilesInHar(moduleFile, emit.outputFiles[0].text, '.d' + path.extname(moduleFile), - projectConfig); - } else { - logger.warn(this.yellow, - "ArkTS:WARN doesn't generate .d"+path.extname(moduleFile) + " for " + moduleFile, this.reset); - } - } catch(err) { - } - } - }) - } + serviceChecker(rootFileNames); } }); @@ -340,32 +267,17 @@ export class ResultStates { } }); } - if (this.shouldWriteChangedList(watchModifiedFiles, watchRemovedFiles)) { - this.hotReloadIncrementalTime.hotReloadIncrementalStartTime = new Date().getTime().toString(); - watchRemovedFiles = watchRemovedFiles.map(file => path.relative(projectConfig.projectPath, file)); - allModifiedFiles = new Set([...allModifiedFiles, ...watchModifiedFiles - .filter(file => fs.statSync(file).isFile() && hotReloadSupportFiles.has(file)) - .map(file => path.relative(projectConfig.projectPath, file))] - .filter(file => !watchRemovedFiles.includes(file))); - const filesObj: filesObj = { - modifiedFiles: [...allModifiedFiles], - removedFiles: [...watchRemovedFiles] - }; - writeFileSync(projectConfig.changedFileList, JSON.stringify(filesObj)); + if (shouldWriteChangedList(watchModifiedFiles, watchRemovedFiles)) { + writeFileSync(projectConfig.changedFileList, JSON.stringify( + getHotReloadFiles(watchModifiedFiles, watchRemovedFiles, hotReloadSupportFiles))); } - const changedFiles: string[] = [...watchModifiedFiles, ...watchRemovedFiles]; - if (changedFiles.length) { - shouldResolvedFiles.clear(); - } - changedFiles.forEach((file) => { - this.judgeFileShouldResolved(file, shouldResolvedFiles) - }) - }) + incrementWatchFile(watchModifiedFiles, watchRemovedFiles); + }); compiler.hooks.done.tap('Result States', (stats: Stats) => { if (projectConfig.isPreview && projectConfig.aceSoPath && useOSFiles && useOSFiles.size > 0) { - this.writeUseOSFiles(); + writeUseOSFiles(useOSFiles); } if (projectConfig.compileHar) { this.incrementalFileInHar.forEach((jsBuildFilePath, jsCacheFilePath) => { @@ -383,65 +295,8 @@ export class ResultStates { }); } - private shouldWriteChangedList(watchModifiedFiles: string[], watchRemovedFiles: string[]): boolean { - return projectConfig.compileMode === ESMODULE && process.env.watchMode === 'true' && !projectConfig.isPreview && - projectConfig.changedFileList && (watchRemovedFiles.length + watchModifiedFiles.length) && - !(watchModifiedFiles.length === 1 && watchModifiedFiles[0] == projectConfig.projectPath && !watchRemovedFiles.length); - } - - private judgeFileShouldResolved(file: string, shouldResolvedFiles: Set): void { - if (shouldResolvedFiles.has(file)) { - return; - } - shouldResolvedFiles.add(file); - if (cache && cache[file] && cache[file].parent) { - cache[file].parent.forEach((item)=>{ - this.judgeFileShouldResolved(item, shouldResolvedFiles); - }) - cache[file].parent = []; - } - if (cache && cache[file] && cache[file].children) { - cache[file].children.forEach((item)=>{ - this.judgeFileShouldResolved(item, shouldResolvedFiles); - }) - cache[file].children = []; - } - } - - private printDiagnostic(diagnostic: ts.Diagnostic): void { - const message: string = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); - if (this.validateError(message)) { - if (process.env.watchMode !== 'true' && !projectConfig.xtsMode) { - updateErrorFileCache(diagnostic); - } - this.tsErrorCount += 1; - if (diagnostic.file) { - const { line, character }: ts.LineAndCharacter = - diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start!); - logger.error(this.red, - `ArkTS:ERROR File: ${diagnostic.file.fileName}:${line + 1}:${character + 1}\n ${message}\n`, - this.reset); - } else { - logger.error(this.red, `ArkTS:ERROR: ${message}`, this.reset); - } - } - } - private resetTsErrorCount(): void { - this.tsErrorCount = 0; - } - - private writeUseOSFiles(): void { - let info: string = ''; - if (!fs.existsSync(projectConfig.aceSoPath)) { - const parent: string = path.join(projectConfig.aceSoPath, '..'); - if (!(fs.existsSync(parent) && !fs.statSync(parent).isFile())) { - mkDir(parent); - } - } else { - info = fs.readFileSync(projectConfig.aceSoPath, 'utf-8') + '\n'; - } - fs.writeFileSync(projectConfig.aceSoPath, info + Array.from(useOSFiles).join('\n')); + checkerResult.count = 0; } private printResult(): void { @@ -467,7 +322,7 @@ export class ResultStates { } private printLogCount(): void { - let errorCount: number = this.mErrorCount + this.tsErrorCount; + let errorCount: number = this.mErrorCount + checkerResult.count; if (errorCount + this.warningCount + this.noteCount > 0) { let result: string; let resultInfo: string = ''; @@ -586,36 +441,12 @@ export class ResultStates { } } private printErrorMessage(errorMessage: string, lineFeed: boolean, errorInfo: Info): void { - if (this.validateError(errorMessage)) { - const formatErrMsg = errorMessage.replace(/\\/g, '/'); - if (lineFeed) { - logger.error(this.red, formatErrMsg + '\n', this.reset); - } else { - logger.error(this.red, formatErrMsg, this.reset); - } + const formatErrMsg = errorMessage.replace(/\\/g, '/'); + if (lineFeed) { + logger.error(this.red, formatErrMsg + '\n', this.reset); } else { - const errorsIndex = this.mStats.compilation.errors.indexOf(errorInfo); - this.mStats.compilation.errors.splice(errorsIndex, 1); - this.mErrorCount = this.mErrorCount - 1; - } - } - private validateError(message: string): boolean { - const propInfoReg: RegExp = /Cannot find name\s*'(\$?\$?[_a-zA-Z0-9]+)'/; - const stateInfoReg: RegExp = /Property\s*'(\$?[_a-zA-Z0-9]+)' does not exist on type/; - if (this.matchMessage(message, props, propInfoReg) || - this.matchMessage(message, props, stateInfoReg)) { - return false; - } - return true; - } - private matchMessage(message: string, nameArr: any, reg: RegExp): boolean { - if (reg.test(message)) { - const match: string[] = message.match(reg); - if (match[1] && nameArr.includes(match[1])) { - return true; - } + logger.error(this.red, formatErrMsg, this.reset); } - return false; } private filterModuleError(message: string): string { if (/You may need an additional loader/.test(message) && transformLog && transformLog.sourceFile) { @@ -629,48 +460,6 @@ export class ResultStates { } } -function updateErrorFileCache(diagnostic: ts.Diagnostic): void { - if (diagnostic.file && cache[path.resolve(diagnostic.file.fileName)]) { - cache[path.resolve(diagnostic.file.fileName)].error = true; - } -} - -function filterInput(rootFileNames: string[]): string[] { - return rootFileNames.filter((file: string) => { - const needUpdate: NeedUpdateFlag = { flag: false }; - const alreadyCheckedFiles: Set = new Set(); - checkNeedUpdateFiles(path.resolve(file), needUpdate, alreadyCheckedFiles); - return needUpdate.flag; - }); -} - -function checkNeedUpdateFiles(file: string, needUpdate: NeedUpdateFlag, alreadyCheckedFiles: Set): void { - if (alreadyCheckedFiles.has(file)) { - return; - } else { - alreadyCheckedFiles.add(file); - } - - if (needUpdate.flag) { - return; - } - - const value: CacheFileName = cache[file]; - const mtimeMs: number = fs.statSync(file).mtimeMs; - if (value) { - if (value.error || value.mtimeMs !== mtimeMs) { - needUpdate.flag = true; - return; - } - for (let i = 0; i < value.children.length; ++i) { - checkNeedUpdateFiles(value.children[i], needUpdate, alreadyCheckedFiles); - } - } else { - cache[file] = { mtimeMs, children: [], parent: [], error: false }; - needUpdate.flag = true; - } -} - function handleFinishModules(modules, callback) { if (projectConfig.compileHar) { modules.forEach(module => { diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index 83a87ce..2937466 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -19,7 +19,8 @@ import * as ts from 'typescript'; import { projectConfig, - systemModules + systemModules, + globalProgram } from '../main'; import { processSystemApi, @@ -41,15 +42,12 @@ import { } from './pre_define'; import { getName } from './process_component_build'; import { INNER_COMPONENT_NAMES } from './component_map'; -import { props } from './compile_info'; import { - CacheFileName, - cache, - shouldResolvedFiles, - hotReloadSupportFiles, - allResolvedModules + props, + logger } from './compile_info'; import { hasDecorator } from './utils'; +import { generateSourceFilesInHar } from './utils'; import { isExtendFunction, isOriginalExtend } from './process_ui_syntax'; export function readDeaclareFiles(): string[] { @@ -131,6 +129,167 @@ export function createLanguageService(rootFileNames: string[]): ts.LanguageServi return ts.createLanguageService(servicesHost, ts.createDocumentRegistry()); } +interface CacheFileName { + mtimeMs: number, + children: string[], + parent: string[], + error: boolean +} +interface NeedUpdateFlag { + flag: boolean; +} +interface CheckerResult { + count: number +} +interface WholeCache { + runtimeOS: string, + sdkInfo: string, + fileList: Cache +} +type Cache = Record; +export let cache: Cache = {}; +export const hotReloadSupportFiles: Set = new Set(); +export const shouldResolvedFiles: Set = new Set(); +const allResolvedModules: Set = new Set(); + +let fastBuildLogger = null; + +export const checkerResult: CheckerResult = {count: 0}; +export function serviceChecker(rootFileNames: string[], newLogger: any = null): void { + fastBuildLogger = newLogger; + let languageService: ts.LanguageService = null; + let cacheFile: string = null; + if (projectConfig.xtsMode) { + languageService = createLanguageService(rootFileNames); + } else { + cacheFile = path.resolve(projectConfig.cachePath, '../.ts_checker_cache'); + const wholeCache: WholeCache = fs.existsSync(cacheFile) ? + JSON.parse(fs.readFileSync(cacheFile).toString()) : + {'runtimeOS': projectConfig.runtimeOS, 'sdkInfo': projectConfig.sdkInfo, 'fileList': {}}; + if (wholeCache.runtimeOS === projectConfig.runtimeOS && wholeCache.sdkInfo === projectConfig.sdkInfo) { + cache = wholeCache.fileList; + } else { + cache = {}; + } + const filterFiles: string[] = filterInput(rootFileNames); + languageService = createLanguageService(filterFiles); + } + globalProgram.program = languageService.getProgram(); + const allDiagnostics: ts.Diagnostic[] = globalProgram.program + .getSyntacticDiagnostics() + .concat(globalProgram.program.getSemanticDiagnostics()) + .concat(globalProgram.program.getDeclarationDiagnostics()); + allDiagnostics.forEach((diagnostic: ts.Diagnostic) => { + printDiagnostic(diagnostic); + }); + if (process.env.watchMode !== 'true' && !projectConfig.xtsMode) { + fs.writeFileSync(cacheFile, JSON.stringify({ + 'runtimeOS': projectConfig.runtimeOS, + 'sdkInfo': projectConfig.sdkInfo, + 'fileList': cache + }, null, 2)); + } + if (projectConfig.compileHar || projectConfig.compileShared) { + [...allResolvedModules, ...rootFileNames].forEach(moduleFile => { + if (!(moduleFile.match(/node_modules/) && projectConfig.compileHar)) { + try { + const emit: any = languageService.getEmitOutput(moduleFile, true, true); + if (emit.outputFiles[0]) { + generateSourceFilesInHar(moduleFile, emit.outputFiles[0].text, '.d' + path.extname(moduleFile), + projectConfig); + } else { + console.warn(this.yellow, + "ArkTS:WARN doesn't generate .d" + path.extname(moduleFile) + ' for ' + moduleFile, this.reset); + } + } catch (err) {} + } + }); + } +} + +export function printDiagnostic(diagnostic: ts.Diagnostic): void { + const message: string = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); + if (validateError(message)) { + if (process.env.watchMode !== 'true' && !projectConfig.xtsMode) { + updateErrorFileCache(diagnostic); + } + checkerResult.count += 1; + if (diagnostic.file) { + const { line, character }: ts.LineAndCharacter = + diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start!); + fastBuildLogger ? + fastBuildLogger.error('\u001b[31m' + + `ArkTS:ERROR File: ${diagnostic.file.fileName}:${line + 1}:${character + 1}\n ${message}\n`) : + logger.error('\u001b[31m', + `ArkTS:ERROR File: ${diagnostic.file.fileName}:${line + 1}:${character + 1}\n ${message}\n`); + } else { + fastBuildLogger ? fastBuildLogger.error('\u001b[31m' + `ArkTS:ERROR: ${message}`) : + logger.error('\u001b[31m', `ArkTS:ERROR: ${message}`); + } + } +} + +function validateError(message: string): boolean { + const propInfoReg: RegExp = /Cannot find name\s*'(\$?\$?[_a-zA-Z0-9]+)'/; + const stateInfoReg: RegExp = /Property\s*'(\$?[_a-zA-Z0-9]+)' does not exist on type/; + if (matchMessage(message, props, propInfoReg) || + matchMessage(message, props, stateInfoReg)) { + return false; + } + return true; +} +function matchMessage(message: string, nameArr: any, reg: RegExp): boolean { + if (reg.test(message)) { + const match: string[] = message.match(reg); + if (match[1] && nameArr.includes(match[1])) { + return true; + } + } + return false; +} + +function updateErrorFileCache(diagnostic: ts.Diagnostic): void { + if (diagnostic.file && cache[path.resolve(diagnostic.file.fileName)]) { + cache[path.resolve(diagnostic.file.fileName)].error = true; + } +} + +function filterInput(rootFileNames: string[]): string[] { + return rootFileNames.filter((file: string) => { + const needUpdate: NeedUpdateFlag = { flag: false }; + const alreadyCheckedFiles: Set = new Set(); + checkNeedUpdateFiles(path.resolve(file), needUpdate, alreadyCheckedFiles); + return needUpdate.flag; + }); +} + +function checkNeedUpdateFiles(file: string, needUpdate: NeedUpdateFlag, alreadyCheckedFiles: Set): void { + if (alreadyCheckedFiles.has(file)) { + return; + } else { + alreadyCheckedFiles.add(file); + } + + if (needUpdate.flag) { + return; + } + + const value: CacheFileName = cache[file]; + const mtimeMs: number = fs.statSync(file).mtimeMs; + if (value) { + if (value.error || value.mtimeMs !== mtimeMs) { + needUpdate.flag = true; + return; + } + for (let i = 0; i < value.children.length; ++i) { + checkNeedUpdateFiles(value.children[i], needUpdate, alreadyCheckedFiles); + } + } else { + cache[file] = { mtimeMs, children: [], parent: [], error: false }; + needUpdate.flag = true; + } +} + const resolvedModulesCache: Map = new Map(); function resolveModuleNames(moduleNames: string[], containingFile: string): ts.ResolvedModuleFull[] { @@ -252,12 +411,17 @@ function createOrUpdateCache(resolvedModules: ts.ResolvedModuleFull[], containin }); cache[path.resolve(containingFile)] = { mtimeMs: fs.statSync(containingFile).mtimeMs, children, parent: cache[path.resolve(containingFile)] && cache[path.resolve(containingFile)].parent ? - cache[path.resolve(containingFile)].parent : [], error }; + cache[path.resolve(containingFile)].parent : [], error }; } export function createWatchCompilerHost(rootFileNames: string[], reportDiagnostic: ts.DiagnosticReporter, delayPrintLogCount: Function, resetErrorCount: Function, isPipe: boolean = false): ts.WatchCompilerHostOfFilesAndCompilerOptions { + if (projectConfig.hotReload) { + rootFileNames.forEach(fileName => { + hotReloadSupportFiles.add(fileName); + }); + } setCompilerOptions(); const createProgram = ts.createSemanticDiagnosticsBuilderProgram; const host = ts.createWatchCompilerHost( @@ -294,6 +458,12 @@ export function createWatchCompilerHost(rootFileNames: string[], return host; } +export function watchChecker(rootFileNames: string[], newLogger: any = null): void { + fastBuildLogger = newLogger; + globalProgram.watchProgram = ts.createWatchProgram( + createWatchCompilerHost(rootFileNames, printDiagnostic, () => {}, () => {})); +} + function instanceInsteadThis(content: string, fileName: string, extendFunctionInfo: extendInfo[]): string { checkUISyntax(content, fileName, extendFunctionInfo); extendFunctionInfo.reverse().forEach((item) => { @@ -490,3 +660,33 @@ function processContent(source: string): string { source = processDraw(source); return source; } + +function judgeFileShouldResolved(file: string, shouldResolvedFiles: Set): void { + if (shouldResolvedFiles.has(file)) { + return; + } + shouldResolvedFiles.add(file); + if (cache && cache[file] && cache[file].parent) { + cache[file].parent.forEach((item) => { + judgeFileShouldResolved(item, shouldResolvedFiles); + }); + cache[file].parent = []; + } + if (cache && cache[file] && cache[file].children) { + cache[file].children.forEach((item) => { + judgeFileShouldResolved(item, shouldResolvedFiles); + }); + cache[file].children = []; + } +} + +export function incrementWatchFile(watchModifiedFiles: string[], + watchRemovedFiles: string[]): void { + const changedFiles: string[] = [...watchModifiedFiles, ...watchRemovedFiles]; + if (changedFiles.length) { + shouldResolvedFiles.clear(); + } + changedFiles.forEach((file) => { + judgeFileShouldResolved(file, shouldResolvedFiles); + }); +} diff --git a/compiler/src/fast_build/common/init_config.ts b/compiler/src/fast_build/common/init_config.ts new file mode 100644 index 0000000..22f8a81 --- /dev/null +++ b/compiler/src/fast_build/common/init_config.ts @@ -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. + */ + +import { readAppResource } from '../../../main'; +import { getEntryObj } from './process_project_config'; + +export function initConfig() { + getEntryObj(); + if (process.env.appResource) { + readAppResource(process.env.appResource); + } +} + diff --git a/compiler/src/fast_build/common/process_project_config.ts b/compiler/src/fast_build/common/process_project_config.ts new file mode 100644 index 0000000..a7e0a64 --- /dev/null +++ b/compiler/src/fast_build/common/process_project_config.ts @@ -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 fs from 'fs'; +import path from 'path'; + +const { + projectConfig, + loadEntryObj, + abilityConfig, + initBuildInfo, + readWorkerFile, + loadWorker, + readPatchConfig +} = require('../../../main.js'); + +export let workerFile = null; +export function getEntryObj() { + loadEntryObj(projectConfig); + initBuildInfo(); + readPatchConfig(); + workerFile = readWorkerFile(); + if (!projectConfig.isPreview) { + loadWorker(projectConfig, workerFile); + } + projectConfig.entryObj = Object.keys(projectConfig.entryObj).reduce((newEntry, key) => { + const newKey: string = key.replace(/^\.\//, ''); + newEntry[newKey] = projectConfig.entryObj[key].replace('?entry', ''); + return newEntry; + }, {}); +} + +export function setCopyPluginConfig(projectConfig: any, appResource: string) { + const copyPluginPattrens: object[] = []; + const BUILD_SHARE_PATH: string = '../share'; + copyPluginPattrens.push({ + src: [ + path.resolve(projectConfig.projectPath, '**/*'), + '!**/*.ets', + '!**/*.ts', + '!**/*.js', + `!${projectConfig.buildPath}` + ], + dest: projectConfig.buildPath + }); + const sharePath: string = path.resolve(projectConfig.projectPath, BUILD_SHARE_PATH); + if (fs.existsSync(sharePath)) { + copyPluginPattrens.push({ + src: [ + path.resolve(projectConfig.projectPath, BUILD_SHARE_PATH, '**/*'), + '!**/*.ets', + '!**/*.ts', + '!**/*.js' + ], + dest: path.resolve(projectConfig.buildPath, BUILD_SHARE_PATH), + }); + } + if (abilityConfig.abilityType === 'page') { + if (fs.existsSync(projectConfig.manifestFilePath)) { + copyPluginPattrens.push({ + src: projectConfig.manifestFilePath, + dest: projectConfig.buildPath + }); + } else if (fs.existsSync(projectConfig.aceConfigPath)) { + copyPluginPattrens.push({ + src: projectConfig.aceConfigPath, + dest: projectConfig.buildPath + }); + } + } + if (appResource && fs.existsSync(appResource) && !projectConfig.xtsMode && + projectConfig.isPreview) { + copyPluginPattrens.push({ + src: path.resolve(__dirname, appResource), + dest: path.resolve(__dirname, projectConfig.cachePath) + }); + } + return copyPluginPattrens; +} diff --git a/compiler/src/fast_build/common/rollup-plugin-watch-change.ts b/compiler/src/fast_build/common/rollup-plugin-watch-change.ts new file mode 100644 index 0000000..0206b41 --- /dev/null +++ b/compiler/src/fast_build/common/rollup-plugin-watch-change.ts @@ -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 { + shouldWriteChangedList, + writeFileSync, + getHotReloadFiles +} from '../../utils'; +import { projectConfig } from '../../../main'; +import { + incrementWatchFile, + hotReloadSupportFiles +} from '../../ets_checker'; + +export function watchChangeFiles() { + function addFileToCache(this: any, key: string, id: string) { + let modifiedFiles: string[] = []; + if (this.cache && this.cache.has(key)) { + modifiedFiles = this.cache.get(key); + modifiedFiles.push(id); + } else { + modifiedFiles.push(id); + } + this.cache.set(key, modifiedFiles); + } + return { + name: 'watchChangedFiles', + watchChange(id: string, change: {event: 'create' | 'update' | 'delete'}): void { + if (change.event === 'update') { + addFileToCache.call(this, 'watchModifiedFiles', id); + } + if (['create', 'delete'].includes(change.event)) { + addFileToCache.call(this, 'watchRemovedFiles', id); + } + }, + beforeBuild() { + this.cache.set('watchChangedFilesCache', 'watchChangedFiles'); + const watchModifiedFiles: string[] = this.cache.get('watchModifiedFiles') || []; + const watchRemovedFiles: string[] = this.cache.get('watchRemovedFiles') || []; + if (shouldWriteChangedList(watchModifiedFiles, watchRemovedFiles)) { + writeFileSync(projectConfig.changedFileList, JSON.stringify( + getHotReloadFiles(watchModifiedFiles, watchRemovedFiles, hotReloadSupportFiles))); + } + incrementWatchFile(watchModifiedFiles, watchRemovedFiles); + } + }; +} diff --git a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-checker.ts b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-checker.ts new file mode 100644 index 0000000..064491d --- /dev/null +++ b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-checker.ts @@ -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 path from 'path'; + +import { initConfig } from '../common/init_config'; +import { projectConfig } from '../../../main'; +import { + serviceChecker, + watchChecker +} from '../../ets_checker'; + +export function etsChecker() { + let executedOnce: boolean = false; + return { + name: 'etsChecker', + buildStart() { + if (executedOnce) { + return; + } + Object.assign(projectConfig, this.share.projectConfig); + initConfig(); + const logger = this.share.getLogger('etsChecker'); + const rootFileNames: string[] = []; + Object.values(projectConfig.entryObj).forEach((fileName: string) => { + rootFileNames.push(path.resolve(fileName)); + }); + if (process.env.watchMode === 'true') { + executedOnce = true; + watchChecker(rootFileNames, logger); + } else { + serviceChecker(rootFileNames, logger); + } + } + }; +} + diff --git a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts new file mode 100644 index 0000000..d15e77d --- /dev/null +++ b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts @@ -0,0 +1,118 @@ +/* + * 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 ts from 'typescript'; +import path from 'path'; +import { createFilter } from '@rollup/pluginutils'; +import MagicString from 'magic-string'; + +import { + LogInfo, + componentInfo, + emitLogInfo, + getTransformLog +} from '../../utils'; +import { + preprocessExtend, + preprocessNewExtend, + validateUISyntax, + propertyCollection, + linkCollection, + resetComponentCollection +} from '../../validate_ui_syntax'; +import { + processUISyntax, + resetLog, + transformLog +} from '../../process_ui_syntax'; +import { + abilityConfig, + projectConfig +} from '../../../main'; +import { JSBUNDLE } from '../../pre_define'; + +const filter:any = createFilter(/(? = new Set(); + return { + name: 'apiTransform', + transform(code: string, id: string) { + const magicString = new MagicString(code); + if (filter(id)) { + code = processSystemApi(code, id); + code = proceseLibso(code, id, useOSFiles); + } + return { + code: code, + map: magicString.generateMap() + }; + }, + buildEnd() { + if (projectConfig.isPreview && projectConfig.aceSoPath && + useOSFiles && useOSFiles.size > 0) { + writeUseOSFiles(useOSFiles); + } + } + }; +} + +function processSystemApi(content: string, sourcePath: string): string { + const REG_SYSTEM: RegExp = + /import\s+(.+)\s+from\s+['"]@(system|ohos)\.(\S+)['"]|import\s+(.+)\s*=\s*require\(\s*['"]@(system|ohos)\.(\S+)['"]\s*\)/g; + return content.replace(REG_SYSTEM, (item, item1, item2, item3, item4, item5, item6) => { + const moduleType: string = item2 || item5; + const systemKey: string = item3 || item6; + const systemValue: string = item1 || item4; + const systemModule: string = `${moduleType}.${systemKey}`; + checkModuleExist(systemModule, sourcePath); + if (NATIVE_MODULE.has(systemModule)) { + item = `var ${systemValue} = globalThis.requireNativeModule('${moduleType}.${systemKey}')`; + } else if (moduleType === SYSTEM_PLUGIN) { + item = `var ${systemValue} = isSystemplugin('${systemKey}', '${SYSTEM_PLUGIN}') ? ` + + `globalThis.systemplugin.${systemKey} : globalThis.requireNapi('${systemKey}')`; + } else if (moduleType === OHOS_PLUGIN) { + item = `var ${systemValue} = globalThis.requireNapi('${systemKey}') || ` + + `(isSystemplugin('${systemKey}', '${OHOS_PLUGIN}') ? ` + + `globalThis.ohosplugin.${systemKey} : isSystemplugin('${systemKey}', '${SYSTEM_PLUGIN}') ` + + `? globalThis.systemplugin.${systemKey} : undefined)`; + } + return item; + }); +} + +function checkModuleExist(systemModule: string, sourcePath: string): void { + const module: string = `@${systemModule.trim()}.d.ts`; + if (/\.js$/.test(sourcePath) && !systemModules.includes(module)) { + const message: string = + `Cannot find module '${module}' or its corresponding type declarations.`; + console.error(`BUILDERROR File: ${sourcePath}\n ${message}`); + } +} + +function proceseLibso(content: string, sourcePath: string, useOSFiles: Set): string { + const REG_LIB_SO: RegExp = + /import\s+(.+)\s+from\s+['"]lib(\S+)\.so['"]|import\s+(.+)\s*=\s*require\(\s*['"]lib(\S+)\.so['"]\s*\)/g; + return content.replace(REG_LIB_SO, (_, item1, item2, item3, item4) => { + useOSFiles.add(sourcePath); + const libSoValue: string = item1 || item3; + const libSoKey: string = item2 || item4; + return projectConfig.bundleName && projectConfig.moduleName + ? `var ${libSoValue} = globalThis.requireNapi("${libSoKey}", true, "${projectConfig.bundleName}/${projectConfig.moduleName}");` + : `var ${libSoValue} = globalThis.requireNapi("${libSoKey}", true);`; + }); +} diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 5c871ad..57120eb 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -131,14 +131,13 @@ import { import { LogType, LogInfo, - componentInfo, - validatorCard + componentInfo } from './utils'; import { partialUpdateConfig, projectConfig } from '../main'; -import { transformLog, contextGlobal } from './process_ui_syntax'; +import { transformLog, contextGlobal, validatorCard } from './process_ui_syntax'; import { props } from './compile_info'; const checkComponents: Set = new Set([ diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 5b7c004..7e87f45 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -87,16 +87,17 @@ import { const localArray: string[] = [COMPONENT_STATE_DECORATOR, COMPONENT_PROVIDE_DECORATOR, COMPONENT_NON_DECORATOR, COMPONENT_OBJECT_LINK_DECORATOR]; -const decoractorMap: Map>> = new Map( - [[COMPONENT_STATE_DECORATOR, stateCollection], - [COMPONENT_LINK_DECORATOR, linkCollection], - [COMPONENT_PROP_DECORATOR, propCollection], - [COMPONENT_NON_DECORATOR, regularCollection], - [COMPONENT_PROVIDE_DECORATOR, provideCollection], - [COMPONENT_OBJECT_LINK_DECORATOR, objectLinkCollection]]); +let decoractorMap: Map>>; export function processCustomComponent(node: ts.ExpressionStatement, newStatements: ts.Statement[], log: LogInfo[], name: string, isBuilder: boolean = false, isGlobalBuilder: boolean = false): void { + decoractorMap = new Map( + [[COMPONENT_STATE_DECORATOR, stateCollection], + [COMPONENT_LINK_DECORATOR, linkCollection], + [COMPONENT_PROP_DECORATOR, propCollection], + [COMPONENT_NON_DECORATOR, regularCollection], + [COMPONENT_PROVIDE_DECORATOR, provideCollection], + [COMPONENT_OBJECT_LINK_DECORATOR, objectLinkCollection]]); const componentNode: ts.CallExpression = getCustomComponentNode(node); if (componentNode) { const hasChainCall: boolean = componentNode.parent && diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index 559ca0d..35cf8fa 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -60,11 +60,11 @@ import { hasDecorator, LogInfo, LogType, - repeatLog, - validatorCard + repeatLog } from './utils'; import { projectConfig } from '../main'; import { CUSTOM_BUILDER_METHOD, INNER_COMPONENT_NAMES } from './component_map'; +import { validatorCard } from './process_ui_syntax'; export const IMPORT_FILE_ASTCACHE: Map = new Map(); diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 728a3ea..9d47d06 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -16,12 +16,6 @@ import ts from 'typescript'; import path from 'path'; -import { componentCollection } from './validate_ui_syntax'; -import { - processComponentClass, - createParentParameter -} from './process_component_class'; -import processImport from './process_import'; import validateReExportType from './validate_module_syntax'; import { PAGE_ENTRY_FUNCTION_NAME, @@ -52,7 +46,6 @@ import { CUSTOM_DIALOG_CONTROLLER_BUILDER, ESMODULE, ARK, - COMPONENT_COMMON, EXTNAME_ETS, GENERATE_ID, _GENERATE_ID, @@ -60,7 +53,10 @@ import { STARTGETACCESSRECORDINGFOR, ALLOCATENEWELMETIDFORNEXTCOMPONENT, STOPGETACCESSRECORDING, - CARD_ENTRY_FUNCTION_NAME + CARD_ENTRY_FUNCTION_NAME, + CARD_LOG_TYPE_COMPONENTS, + CARD_LOG_TYPE_DECORATORS, + CARD_LOG_TYPE_IMPORT } from './pre_define'; import { componentInfo, @@ -70,6 +66,16 @@ import { FileLog } from './utils'; import { writeFileSyncByNode } from './ark_utils'; +import { + componentCollection, + localStorageLinkCollection, + localStoragePropCollection, +} from './validate_ui_syntax'; +import { + processComponentClass, + createParentParameter +} from './process_component_class'; +import processImport from './process_import'; import { processComponentBlock, bindComponentAttr, @@ -84,10 +90,6 @@ import { INTERFACE_NODE_SET, ID_ATTRS } from './component_map'; -import { - localStorageLinkCollection, - localStoragePropCollection -} from './validate_ui_syntax'; import { resources, projectConfig, @@ -107,7 +109,7 @@ export function processUISyntax(program: ts.Program, ut = false): Function { return (node: ts.SourceFile) => { pagesDir = path.resolve(path.dirname(node.fileName)); resourceFileName = path.resolve(node.fileName); - if (process.env.compiler === BUILD_ON) { + if (process.env.compiler === BUILD_ON || process.env.compileTool === 'rollup') { transformLog.sourceFile = node; preprocessIdAttrs(node.fileName); if (!ut && (process.env.compileMode !== 'moduleJson' && @@ -115,10 +117,10 @@ export function processUISyntax(program: ts.Program, ut = false): Function { /\.ts$/.test(node.fileName))) { node = ts.visitEachChild(node, processResourceNode, context); if (projectConfig.compileMode === ESMODULE && process.env.compilerType && process.env.compilerType === ARK) { - validateReExportType(node, pagesDir, transformLog.errors); - if (projectConfig.processTs === true) { - writeFileSyncByNode(node, true, projectConfig); - } + validateReExportType(node, pagesDir, transformLog.errors); + if (projectConfig.processTs === true) { + writeFileSyncByNode(node, true, projectConfig); + } } return node; } @@ -823,3 +825,27 @@ function addCardStringliteral(newExpressionParams: any[], context: ts.Transforma cardRelativePath)); } } + +export function validatorCard(log: any[], type: number, pos: number, + name: string = ''): void { + if (projectConfig && projectConfig.cardObj && resourceFileName + && projectConfig.cardObj[resourceFileName]) { + const logInfo: object = { + type: LogType.ERROR, + message: '', + pos: pos + }; + switch (type) { + case CARD_LOG_TYPE_COMPONENTS: + logInfo.message = `Card page cannot use the component ${name}.`; + break; + case CARD_LOG_TYPE_DECORATORS: + logInfo.message = `Card page cannot use ${name}`; + break; + case CARD_LOG_TYPE_IMPORT: + logInfo.message = `Card page cannot use import.`; + break; + } + log.push(logInfo); + } +} diff --git a/compiler/src/result_process.ts b/compiler/src/result_process.ts index 924ced2..9097b27 100644 --- a/compiler/src/result_process.ts +++ b/compiler/src/result_process.ts @@ -13,8 +13,6 @@ * limitations under the License. */ -import ts from 'typescript'; - import { BUILD_OFF, ESMODULE, JSBUNDLE } from './pre_define'; import { resetLog, @@ -26,10 +24,10 @@ import { processSystemApi } from './validate_ui_syntax'; import { - LogInfo, emitLogInfo, componentInfo, - generateSourceFilesInHar + generateSourceFilesInHar, + getTransformLog } from './utils'; import { generateSourceFilesToTemporary } from './ark_utils'; import { resetComponentCollection } from './validate_ui_syntax'; @@ -45,24 +43,7 @@ module.exports = function resultProcess(source: string, map: any): void { linkCollection.clear(); resetComponentCollection(); if (transformLog && transformLog.errors.length) { - const sourceFile: ts.SourceFile = transformLog.sourceFile; - const logInfos: LogInfo[] = transformLog.errors.map((item) => { - if (item.pos) { - if (!item.column || !item.line) { - const posOfNode: ts.LineAndCharacter = sourceFile.getLineAndCharacterOfPosition(item.pos); - item.line = posOfNode.line + 1; - item.column = posOfNode.character + 1; - } - } else { - item.line = item.line || undefined; - item.column = item.column || undefined; - } - if (!item.fileName) { - item.fileName = sourceFile.fileName; - } - return item; - }); - emitLogInfo(this, logInfos); + emitLogInfo(this, getTransformLog(transformLog)); resetLog(); } } diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 8da7413..d72f169 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -31,11 +31,8 @@ import { NODE_MODULES, FAIL, TEMPORARY, - CARD_LOG_TYPE_COMPONENTS, - CARD_LOG_TYPE_DECORATORS, - CARD_LOG_TYPE_IMPORT + ESMODULE } from './pre_define'; -import { resourceFileName } from './process_ui_syntax'; export enum LogType { ERROR = 'ERROR', @@ -85,18 +82,22 @@ export class FileLog { } } -export function emitLogInfo(loader: any, infos: LogInfo[]) { +export function emitLogInfo(loader: any, infos: LogInfo[], fastBuild: boolean = false, + resourcePath: string = null): void { if (infos && infos.length) { infos.forEach((item) => { switch (item.type) { case LogType.ERROR: - loader.emitError(getMessage(item.fileName || loader.resourcePath, item)); + fastBuild ? loader.error('\u001b[31m' + getMessage(item.fileName || resourcePath, item, true)) : + loader.emitError(getMessage(item.fileName || loader.resourcePath, item)); break; case LogType.WARN: - loader.emitWarning(getMessage(item.fileName || loader.resourcePath, item)); + fastBuild ? loader.warn('\u001b[33m' + getMessage(item.fileName || resourcePath, item, true)) : + loader.emitWarning(getMessage(item.fileName || loader.resourcePath, item)); break; case LogType.NOTE: - loader.emitWarning(getMessage(loader.resourcePath, item)); + fastBuild ? loader.info('\u001b[34m' + getMessage(item.fileName || resourcePath, item, true)) : + loader.emitWarning(getMessage(loader.resourcePath, item)); break; } }); @@ -115,16 +116,40 @@ export function addLog(type: LogType, message: string, pos: number, log: LogInfo }); } -export function getMessage(fileName: string, info: LogInfo): string { +export function getMessage(fileName: string, info: LogInfo, fastBuild: boolean = false): string { let message: string; if (info.line && info.column) { message = `BUILD${info.type} File: ${fileName}:${info.line}:${info.column}\n ${info.message}`; } else { message = `BUILD${info.type} File: ${fileName}\n ${info.message}`; } + if (fastBuild) { + message = message.replace(/^BUILD/, 'ArkTS:'); + } return message; } +export function getTransformLog(transformLog: FileLog): LogInfo[] { + const sourceFile: ts.SourceFile = transformLog.sourceFile; + const logInfos: LogInfo[] = transformLog.errors.map((item) => { + if (item.pos) { + if (!item.column || !item.line) { + const posOfNode: ts.LineAndCharacter = sourceFile.getLineAndCharacterOfPosition(item.pos); + item.line = posOfNode.line + 1; + item.column = posOfNode.character + 1; + } + } else { + item.line = item.line || undefined; + item.column = item.column || undefined; + } + if (!item.fileName) { + item.fileName = sourceFile.fileName; + } + return item; + }); + return logInfos; +} + class ComponentInfo { private _id: number = 0; private _componentNames: Set = new Set(['ForEach']); @@ -359,30 +384,6 @@ export function removeDir(dirName: string): void { } } -export function validatorCard(log: any[], type: number, pos: number, - name: string = ''): void { - if (projectConfig && projectConfig.cardObj && resourceFileName - && projectConfig.cardObj[resourceFileName]) { - const logInfo: object = { - type: LogType.ERROR, - message: '', - pos: pos - } - switch(type) { - case CARD_LOG_TYPE_COMPONENTS: - logInfo.message = `Card page cannot use the component ${name}.`; - break; - case CARD_LOG_TYPE_DECORATORS: - logInfo.message = `Card page cannot use ${name}`; - break; - case CARD_LOG_TYPE_IMPORT: - logInfo.message = `Card page cannot use import.`; - break; - } - log.push(logInfo); - } -} - export function parseErrorMessage(message: string): string { const messageArrary: string[] = message.split('\n'); let logContent: string = ''; @@ -469,3 +470,82 @@ export function getExtension(filePath: string): string { return extension; } + +export function shouldWriteChangedList(watchModifiedFiles: string[], + watchRemovedFiles: string[]): boolean { + if (projectConfig.compileMode === ESMODULE && process.env.watchMode === 'true' && !projectConfig.isPreview && + projectConfig.changedFileList && (watchRemovedFiles.length + watchModifiedFiles.length)) { + if (process.env.compileTool !== 'rollup') { + if (!(watchModifiedFiles.length === 1 && + watchModifiedFiles[0] === projectConfig.projectPath && !watchRemovedFiles.length)) { + return true; + } else { + return false; + } + } + return true; + } + return false; +} + +interface HotReloadIncrementalTime { + hotReloadIncrementalStartTime: string; + hotReloadIncrementalEndTime: string; +} + +export const hotReloadIncrementalTime: HotReloadIncrementalTime = { + hotReloadIncrementalStartTime: '', + hotReloadIncrementalEndTime: '' +}; + +interface FilesObj { + modifiedFiles: string[], + removedFiles: string[] +} + +let allModifiedFiles: Set = new Set(); + +export function getHotReloadFiles(watchModifiedFiles: string[], + watchRemovedFiles: string[], hotReloadSupportFiles: Set): FilesObj { + hotReloadIncrementalTime.hotReloadIncrementalStartTime = new Date().getTime().toString(); + watchRemovedFiles = watchRemovedFiles.map(file => path.relative(projectConfig.projectPath, file)); + allModifiedFiles = new Set([...allModifiedFiles, ...watchModifiedFiles + .filter(file => fs.statSync(file).isFile() && hotReloadSupportFiles.has(file)) + .map(file => path.relative(projectConfig.projectPath, file))] + .filter(file => !watchRemovedFiles.includes(file))); + return { + modifiedFiles: [...allModifiedFiles], + removedFiles: [...watchRemovedFiles] + }; +} + +export function getResolveModules(projectPath: string, faMode: boolean): string[] { + if (faMode) { + return [ + path.resolve(projectPath, '../../../../../'), + path.resolve(projectPath, '../../../../node_modules'), + path.resolve(projectPath, '../../../../../node_modules'), + path.resolve(projectPath, '../../') + ]; + } else { + return [ + path.resolve(projectPath, '../../../../'), + path.resolve(projectPath, '../../../node_modules'), + path.resolve(projectPath, '../../../../node_modules'), + path.resolve(projectPath, '../') + ]; + } +} + +export function writeUseOSFiles(useOSFiles: Set): void { + let info: string = ''; + if (!fs.existsSync(projectConfig.aceSoPath)) { + const parent: string = path.resolve(projectConfig.aceSoPath, '..'); + if (!(fs.existsSync(parent) && !fs.statSync(parent).isFile())) { + mkDir(parent); + } + } else { + info = fs.readFileSync(projectConfig.aceSoPath, 'utf-8') + '\n'; + } + fs.writeFileSync(projectConfig.aceSoPath, info + Array.from(useOSFiles).join('\n')); +} diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index be91ab2..04ff190 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -72,16 +72,15 @@ import { componentInfo, addLog, hasDecorator, - validatorCard } from './utils'; import { getPackageInfo } from './ark_utils' import { projectConfig, abilityPagesFullPath } from '../main'; import { collectExtend, isExtendFunction, - transformLog + transformLog, + validatorCard } from './process_ui_syntax'; -import { isOhmUrl } from './resolve_ohm_url'; import { logger } from './compile_info'; export interface ComponentCollection { diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 883195d..1814573 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -29,11 +29,18 @@ const { readWorkerFile, loadModuleInfo, checkAppResourcePath, - addSDKBuildDependencies + addSDKBuildDependencies, + readPatchConfig, + getCleanConfig } = require('./main'); const { ResultStates } = require('./lib/compile_info'); const { processUISyntax } = require('./lib/process_ui_syntax'); -const { IGNORE_ERROR_CODE, removeDir, mkdirsSync } = require('./lib/utils'); +const { + IGNORE_ERROR_CODE, + removeDir, + mkdirsSync, + getResolveModules +} = require('./lib/utils'); const { BUILD_SHARE_PATH, PREBUILDMODE_JSON } = require('./lib/pre_define'); process.env.watchMode = (process.env.watchMode && process.env.watchMode === 'true') || 'false'; @@ -127,17 +134,11 @@ function initConfig(config) { }; } if (!projectConfig.aceModuleJsonPath) { - config.resolve.modules.push(path.join(projectPath, '../../../../../')); - config.resolve.modules.push(path.resolve(projectPath, '../../../../node_modules')); - config.resolve.modules.push(path.resolve(projectPath, '../../../../../node_modules')); - config.resolve.modules.push(path.resolve(projectPath, '../../')); + config.resolve.modules.push(...getResolveModules(projectPath, true)); existsPackageJson(config, path.resolve(projectPath, '../../../../../package.json'), path.resolve(projectPath, '../../../../package.json')); } else { - config.resolve.modules.push(path.join(projectPath, '../../../../')); - config.resolve.modules.push(path.resolve(projectPath, '../../../node_modules')); - config.resolve.modules.push(path.resolve(projectPath, '../../../../node_modules')); - config.resolve.modules.push(path.resolve(projectPath, '../')); + config.resolve.modules.push(...getResolveModules(projectPath, false)); existsPackageJson(config, path.resolve(projectPath, '../../../../package.json'), path.resolve(projectPath, '../../../package.json')); } @@ -398,23 +399,11 @@ function setGenAbcPlugin(env, config) { } function setCleanWebpackPlugin(workerFile, config) { - if (projectConfig.compileMode === 'esmodule') { - return; - } - let cleanPath = []; - cleanPath.push(projectConfig.buildPath); - if (workerFile) { - let workerFilesPath = Object.keys(workerFile); - for (let workerFilePath of workerFilesPath) { - cleanPath.push(path.join(projectConfig.buildPath, workerFilePath, '..')); - } - } - config.plugins.push( new CleanWebpackPlugin({ dry: false, dangerouslyAllowCleanPatternsOutsideProject: true, - cleanOnceBeforeBuildPatterns: cleanPath + cleanOnceBeforeBuildPatterns: getCleanConfig(workerFile) }) ); } @@ -447,7 +436,8 @@ module.exports = (env, argv) => { setTsConfigFile(); clearWebpackCacheByBuildMode(); initConfig(config); - const workerFile = readWorkerFile(env.isPreview); + readPatchConfig(); + const workerFile = readWorkerFile(); setOptimizationConfig(config, workerFile); setCleanWebpackPlugin(workerFile, config); -- Gitee From d97671d5c03690660de77caff2625495b75143c8 Mon Sep 17 00:00:00 2001 From: Gymee Date: Tue, 17 Jan 2023 17:37:37 +0800 Subject: [PATCH 312/379] Convert globalThis.require* to import Signed-off-by: Gymee Change-Id: I21ad2438b82c7bbdb4e90195cab7e715adbf6d72 --- compiler/src/ark_utils.ts | 13 ++++++++++++- compiler/src/validate_ui_syntax.ts | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/compiler/src/ark_utils.ts b/compiler/src/ark_utils.ts index e244121..0fb23cd 100644 --- a/compiler/src/ark_utils.ts +++ b/compiler/src/ark_utils.ts @@ -212,10 +212,21 @@ export function transformModuleSpecifier(sourcePath: string, sourceCode: string, // replace relative moduleSpecifier with ohmURl const REG_RELATIVE_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]((?:\.\/|\.\.\/)[^'"]+|(?:\.\/?|\.\.\/?))['"]/g; const REG_HAR_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]([^\.\/][^'"]+)['"]/g; + // replace requireNapi and requireNativeModule with import + const REG_REQUIRE_NATIVE_MODULE: RegExp = /var (\S+) = globalThis.requireNativeModule\(['"](\S+)['"]\);/g; + const REG_REQUIRE_NAPI_APP: RegExp = /var (\S+) = globalThis.requireNapi\(['"](\S+)['"], true, ['"](\S+)['"]\);/g; + const REG_REQUIRE_NAPI_OHOS: RegExp = /var (\S+) = globalThis.requireNapi\(['"](\S+)['"]\);/g; + return sourceCode.replace(REG_HAR_DEPENDENCY, (item, moduleRequest) => { return replaceHarDependency(item, moduleRequest, projectConfig); }).replace(REG_RELATIVE_DEPENDENCY, (item, moduleRequest) => { return replaceRelativeDependency(item, moduleRequest, toUnixPath(sourcePath), projectConfig); + }).replace(REG_REQUIRE_NATIVE_MODULE, (_, moduleRequest, moduleName) => { + return `import ${moduleRequest} from '@native:${moduleName}';`; + }).replace(REG_REQUIRE_NAPI_APP, (_, moduleRequest, soName, moudlePath) => { + return `import ${moduleRequest} from '@app:${moudlePath}/${soName}';`; + }).replace(REG_REQUIRE_NAPI_OHOS, (_, moduleRequest, moduleName) => { + return `import ${moduleRequest} from '@ohos:${moduleName}';`; }); } @@ -457,4 +468,4 @@ export function getArkBuildDir(arkDir: string): string { export function getBuildBinDir(arkDir: string): string { return path.join(getArkBuildDir(arkDir), 'bin'); -} \ No newline at end of file +} diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 68c6ea4..8a6d94d 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -852,6 +852,7 @@ export function preprocessNewExtend(content: string, extendCollection?: Set Date: Sat, 14 Jan 2023 11:02:45 +0800 Subject: [PATCH 313/379] Support oh_modules and oh-package.json Issue: https://gitee.com/openharmony/third_party_typescript/issues/I694YF Signed-off-by: zhangchen168 Change-Id: Ia492effa6f4c2c2cc19a45f7cff6a588f58df53f --- compiler/package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/package-lock.json b/compiler/package-lock.json index 19a7da8..ad14bb3 100644 --- a/compiler/package-lock.json +++ b/compiler/package-lock.json @@ -4459,7 +4459,7 @@ }, "typescript": { "version": "file:deps/ohos-typescript-4.2.3-r2.tgz", - "integrity": "sha512-ITYnPXE5QJpdmQqQgzChV5DYRgyJ/kigjlaRAEFjW3HtgldUNeH57jyFsSlQ39MBabkusRheRjzBYgNxW76uiw==" + "integrity": "sha512-Znvyk9NOaGjaIX/viL2hLuQfrftuJ8eu/gxZAvvXcHACWXopOO3zqxvrYRcxiN4VG/D2eQ4odQqwxKs0lq2h6g==" }, "uglify-js": { "version": "3.16.1", -- Gitee From d85a58f24283442bfe4f868b30c74f5d98869c35 Mon Sep 17 00:00:00 2001 From: hufeng Date: Tue, 31 Jan 2023 21:04:06 +0800 Subject: [PATCH 314/379] Fix json files not being copied into buildDir in compiling module Signed-off-by: hufeng Change-Id: Ibe28d463af568bdd066d0e53a6b48ac76d6ffb07 --- compiler/src/gen_abc_plugin.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 8d9f442..78353bc 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -221,8 +221,7 @@ export class GenAbcPlugin { return; } Object.keys(compilation.assets).forEach(key => { - if (path.extname(key) === EXTNAME_JS || path.extname(key) === EXTNAME_JS_MAP || - path.extname(key) === EXTNAME_JSON) { + if (path.extname(key) === EXTNAME_JS || path.extname(key) === EXTNAME_JS_MAP) { delete assets[key]; } }); -- Gitee From 045a4881b8412290f9873034e84cb7efc6cc2c1c Mon Sep 17 00:00:00 2001 From: bojiang Date: Tue, 17 Jan 2023 15:37:37 +0800 Subject: [PATCH 315/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I784205bf13ee1eae840dc22fb1aa826ebe2c1dfd --- compiler/src/process_component_member.ts | 23 +- .../@prop/@prop.ts | 95 +++++---- .../@prop/@propComplexType.ts | 197 ++++++++++++++++++ 3 files changed, 265 insertions(+), 50 deletions(-) create mode 100644 compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@propComplexType.ts diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 61f4030..85c14c8 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -125,7 +125,7 @@ export const mandatorySpecifyDefaultValueDecorators: Set = new Set([...observedPropertyDecorators, ...appStorageDecorators]); export const forbiddenSpecifyDefaultValueDecorators: Set = - new Set([...propAndLinkDecorators, COMPONENT_CONSUME_DECORATOR, COMPONENT_OBJECT_LINK_DECORATOR]); + new Set([COMPONENT_LINK_DECORATOR, COMPONENT_CONSUME_DECORATOR, COMPONENT_OBJECT_LINK_DECORATOR]); export const mandatoryToInitViaParamDecorators: Set = new Set([...propAndLinkDecorators, COMPONENT_OBJECT_LINK_DECORATOR]); @@ -395,7 +395,7 @@ function processStateDecorators(node: ts.PropertyDeclaration, decorator: string, updateResult.setVariableSet(createSetAccessor(name, CREATE_SET_METHOD, node.type)); } if (setUpdateParamsDecorators.has(decorator)) { - updateResult.setUpdateParams(createUpdateParams(name, decorator)); + updateResult.setUpdateParams(createUpdateParams(name, decorator, node)); } if (setStateVarsDecorators.has(decorator)) { updateResult.setStateVarsParams(createStateVarsParams(name, decorator)); @@ -521,7 +521,8 @@ function wrongDecoratorInPreview(node: ts.PropertyDeclaration, decorator: string } } -function createUpdateParams(name: ts.Identifier, decorator: string): ts.Statement { +function createUpdateParams(name: ts.Identifier, decorator: string, + localInitializationNode: ts.PropertyDeclaration = undefined): ts.Statement { let updateParamsNode: ts.Statement; switch (decorator) { case COMPONENT_NON_DECORATOR: @@ -533,6 +534,11 @@ function createUpdateParams(name: ts.Identifier, decorator: string): ts.Statemen case COMPONENT_PROP_DECORATOR: if (!partialUpdateConfig.partialUpdateMode) { updateParamsNode = createUpdateParamsWithoutIf(name); + } else { + if (localInitializationNode && localInitializationNode.initializer) { + updateParamsNode = createUpdateParamsWithIf(name, true, + localInitializationNode.initializer); + } } break; case COMPONENT_BUILDERPARAM_DECORATOR: @@ -555,14 +561,16 @@ function createStateVarsParams(name: ts.Identifier, decorator: string): ts.State return updateParamsNode; } -function createUpdateParamsWithIf(name: ts.Identifier): ts.IfStatement { +function createUpdateParamsWithIf(name: ts.Identifier, isSet: boolean = false, + initializeNode: ts.Expression = undefined): ts.IfStatement { return ts.factory.createIfStatement(ts.factory.createBinaryExpression( ts.factory.createPropertyAccessExpression( ts.factory.createIdentifier(CREATE_CONSTRUCTOR_PARAMS), ts.factory.createIdentifier(name.escapedText.toString())), ts.factory.createToken(ts.SyntaxKind.ExclamationEqualsEqualsToken), ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_UNDEFINED)), ts.factory.createBlock([ - createUpdateParamsWithoutIf(name)], true), undefined); + isSet ? createUpdateParamsWithSet(name) : createUpdateParamsWithoutIf(name)], true), + isSet ? ts.factory.createBlock([createUpdateParamsWithSet(name, true, initializeNode)]) : undefined); } function createUpdateParamsWithoutIf(name: ts.Identifier): ts.ExpressionStatement { @@ -572,11 +580,12 @@ function createUpdateParamsWithoutIf(name: ts.Identifier): ts.ExpressionStatemen createPropertyAccessExpressionWithParams(name.getText()))); } -function createUpdateParamsWithSet(name: ts.Identifier): ts.ExpressionStatement { +function createUpdateParamsWithSet(name: ts.Identifier, hasElse: boolean = false, + initializeNode: ts.Expression = undefined): ts.ExpressionStatement { return ts.factory.createExpressionStatement(ts.factory.createCallExpression( ts.factory.createPropertyAccessExpression(createPropertyAccessExpressionWithThis(`__${name.getText()}`), ts.factory.createIdentifier(CREATE_SET_METHOD)), undefined, - [createPropertyAccessExpressionWithParams(name.getText())])); + [hasElse ? initializeNode : createPropertyAccessExpressionWithParams(name.getText())])); } function updateNormalProperty(node: ts.PropertyDeclaration, name: ts.Identifier, diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts index e7d0576..1866cba 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@prop.ts @@ -15,99 +15,96 @@ exports.source = ` @Component -struct PropComponent { - @Prop counter: string - build() { - Text(this.counter) +struct CustomX{ + @Prop fruit:string='香蕉' + build(){ + } } - @Entry @Component -struct ParentComponent { - @State value: string = 'first init content'; +struct CustomY { + @State parentFruit: string = '苹果' build() { - Column() { - PropComponent({counter: this.value}) + Row() { + CustomX({fruit:this.parentFruit}) + CustomX({}) } } } ` exports.expectResult = `"use strict"; -class PropComponent extends ViewPU { +class CustomX extends ViewPU { constructor(parent, params, __localStorage, elmtId = -1) { super(parent, __localStorage, elmtId); - this.__counter = new SynchedPropertySimpleOneWayPU(params.counter, this, "counter"); + this.__fruit = new SynchedPropertySimpleOneWayPU(params.fruit, this, "fruit"); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { + if (params.fruit !== undefined) { + this.__fruit.set(params.fruit); + } + else { + this.__fruit.set('香蕉'); + } } updateStateVars(params) { - this.__counter.reset(params.counter); + this.__fruit.reset(params.fruit); } purgeVariableDependenciesOnElmtId(rmElmtId) { - this.__counter.purgeDependencyOnElmtId(rmElmtId); + this.__fruit.purgeDependencyOnElmtId(rmElmtId); } aboutToBeDeleted() { - this.__counter.aboutToBeDeleted(); + this.__fruit.aboutToBeDeleted(); SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } - get counter() { - return this.__counter.get(); + get fruit() { + return this.__fruit.get(); } - set counter(newValue) { - this.__counter.set(newValue); + set fruit(newValue) { + this.__fruit.set(newValue); } initialRender() { - this.observeComponentCreation((elmtId, isInitialRender) => { - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - Text.create(this.counter); - if (!isInitialRender) { - Text.pop(); - } - ViewStackProcessor.StopGetAccessRecording(); - }); - Text.pop(); } rerender() { this.updateDirtyElements(); } } -class ParentComponent extends ViewPU { +class CustomY extends ViewPU { constructor(parent, params, __localStorage, elmtId = -1) { super(parent, __localStorage, elmtId); - this.__value = new ObservedPropertySimplePU('first init content', this, "value"); + this.__parentFruit = new ObservedPropertySimplePU('苹果', this, "parentFruit"); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { - if (params.value !== undefined) { - this.value = params.value; + if (params.parentFruit !== undefined) { + this.parentFruit = params.parentFruit; } } updateStateVars(params) { } purgeVariableDependenciesOnElmtId(rmElmtId) { - this.__value.purgeDependencyOnElmtId(rmElmtId); + this.__parentFruit.purgeDependencyOnElmtId(rmElmtId); } aboutToBeDeleted() { - this.__value.aboutToBeDeleted(); + this.__parentFruit.aboutToBeDeleted(); SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } - get value() { - return this.__value.get(); + get parentFruit() { + return this.__parentFruit.get(); } - set value(newValue) { - this.__value.set(newValue); + set parentFruit(newValue) { + this.__parentFruit.set(newValue); } initialRender() { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - Column.create(); + Row.create(); if (!isInitialRender) { - Column.pop(); + Row.pop(); } ViewStackProcessor.StopGetAccessRecording(); }); @@ -115,23 +112,35 @@ class ParentComponent extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); if (isInitialRender) { - ViewPU.create(new PropComponent(this, { counter: this.value }, undefined, elmtId)); + ViewPU.create(new CustomX(this, { fruit: this.parentFruit }, undefined, elmtId)); } else { this.updateStateVarsOfChildByElmtId(elmtId, { - counter: this.value + fruit: this.parentFruit }); } ViewStackProcessor.StopGetAccessRecording(); }); } - Column.pop(); + { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new CustomX(this, {}, undefined, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, {}); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + } + Row.pop(); } rerender() { this.updateDirtyElements(); } } ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); -loadDocument(new ParentComponent(undefined, {})); +loadDocument(new CustomY(undefined, {})); ViewStackProcessor.StopGetAccessRecording(); ` \ No newline at end of file diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@propComplexType.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@propComplexType.ts new file mode 100644 index 0000000..b5a3458 --- /dev/null +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@prop/@propComplexType.ts @@ -0,0 +1,197 @@ +/* + * 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. + */ + +exports.source = ` +var nextID: number = 0 + +@Observed +class ClassA { + public name: string + public c: number + public id: number + + constructor(c: number, name: string = 'OK') { + this.name = name + this.c = c + this.id = nextID++ + } +} +@Component +struct CustomX{ + @Prop fruit:ClassA = new ClassA(1) + build(){ + Row() { + Text(JSON.stringify(this.fruit.c)) + } + } +} +@Entry +@Component +struct Index { + @State arrA:ClassA[] = [new ClassA(0), new ClassA(0)]; + build() { + Row() { + CustomX({fruit:this.arrA[0]}) + CustomX({}) + } + } +} +` +exports.expectResult = +`"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var nextID = 0; +let ClassA = class ClassA { + constructor(c, name = 'OK') { + this.name = name; + this.c = c; + this.id = nextID++; + } +}; +ClassA = __decorate([ + Observed +], ClassA); +class CustomX extends ViewPU { + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); + this.__fruit = new SynchedPropertyObjectOneWayPU(params.fruit, this, "fruit"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.fruit !== undefined) { + this.__fruit.set(params.fruit); + } + else { + this.__fruit.set(new ClassA(1)); + } + } + updateStateVars(params) { + this.__fruit.reset(params.fruit); + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__fruit.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__fruit.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get fruit() { + return this.__fruit.get(); + } + set fruit(newValue) { + this.__fruit.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create(JSON.stringify(this.fruit.c)); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Row.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class Index extends ViewPU { + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); + this.__arrA = new ObservedPropertyObjectPU([new ClassA(0), new ClassA(0)], this, "arrA"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.arrA !== undefined) { + this.arrA = params.arrA; + } + } + updateStateVars(params) { + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__arrA.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__arrA.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get arrA() { + return this.__arrA.get(); + } + set arrA(newValue) { + this.__arrA.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new CustomX(this, { fruit: this.arrA[0] }, undefined, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + fruit: this.arrA[0] + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + } + { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new CustomX(this, {}, undefined, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, {}); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + } + Row.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new Index(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` \ No newline at end of file -- Gitee From 10fe6861444e280767c7de57d235892abd801422 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 31 Jan 2023 20:35:32 +0800 Subject: [PATCH 316/379] houhaoyu@huawei.com rollup acceleratepreview Signed-off-by: houhaoyu Change-Id: Ic8b8c2d88d2a6fc99203765663b4ea47323a8957 --- compiler/server/build_pipe_server.js | 75 ++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 22 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index 5667286..eb9d751 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -17,7 +17,7 @@ const WebSocket = require('ws'); const ts = require('typescript'); const path = require('path'); const fs = require('fs'); -const pipeProcess = require('child_process'); +const { spawn } = require('child_process'); const _ = require('lodash'); const { processComponentChild } = require('../lib/process_component_build'); @@ -61,6 +61,25 @@ let globalDeclaration = new Map(); let connectNum = 0; const maxConnectNum = 8; +let callback = undefined; + +function buildPipeServer() { + return { + init(cachePath, buildPath, cb) { + previewCacheFilePath = path.join(cachePath || buildPath, 'preview.ets'); + const rootFileNames = []; + writeFileSync(previewCacheFilePath, ''); + rootFileNames.push(previewCacheFilePath); + ts.createWatchProgram( + createWatchCompilerHost(rootFileNames, resolveDiagnostic, delayPrintLogCount, ()=>{}, true)); + callback = cb; + }, + compileComponent(jsonData) { + handlePluginCompileComponent(jsonData); + } + } +} + function init(port) { previewCacheFilePath = path.join(projectConfig.cachePath || projectConfig.buildPath, 'preview.ets'); @@ -205,15 +224,17 @@ function callEs2abc(receivedMsg) { } function es2abc(receivedMsg) { - const cmd = '"' + es2abcFilePath + '"' + ' --base64Input ' + - Buffer.from(receivedMsg.data.script).toString('base64') + ' --base64Output'; try { - pipeProcess.exec(cmd, (error, stdout, stderr) => { - if (stdout) { - receivedMsg.data.script = stdout; - } else { - receivedMsg.data.script = ''; - } + const transCode = spawn(es2abcFilePath, + ['--base64Input', Buffer.from(receivedMsg.data.script).toString('base64'), '--base64Output'], {windowsHide: true}); + transCode.stdout.on('data', (data) => { + receivedMsg.data.script = data.toString(); + compileStatus = true; + receivedMsg_ = receivedMsg; + responseToPlugin(); + }); + transCode.stderr.on('data', (data) => { + receivedMsg.data.script = ''; compileStatus = true; receivedMsg_ = receivedMsg; responseToPlugin(); @@ -251,22 +272,31 @@ function responseToPlugin() { receivedMsg_.data.log = receivedMsg_.data.log || []; receivedMsg_.data.log.push(...errorInfo); } - pluginSocket.send(JSON.stringify(receivedMsg_), (err) => { - start = false; - checkStatus = false; - compileStatus = false; - errorInfo = []; - receivedMsg_ = undefined; - globalDeclaration.clear(); - messages.shift(); - if (messages.length > 0) { - handlePluginCompileComponent(); - } - }); + if (callback) { + callback(JSON.stringify(receivedMsg_)); + afterResponse(); + } else { + pluginSocket.send(JSON.stringify(receivedMsg_), (err) => { + afterResponse(); + }); + } } } } +function afterResponse() { + start = false; + checkStatus = false; + compileStatus = false; + errorInfo = []; + receivedMsg_ = undefined; + globalDeclaration.clear(); + messages.shift(); + if (messages.length > 0) { + handlePluginCompileComponent(); + } +} + function validateError(message) { const stateInfoReg = /Property\s*'(\$?[_a-zA-Z0-9]+)' does not exist on type/; if (matchMessage(message, [...propertyVariable, ...props], stateInfoReg)) { @@ -286,5 +316,6 @@ function matchMessage(message, nameArr, reg) { } module.exports = { - init + init, + buildPipeServer }; -- Gitee From 91fafa0bb355a9aaee3de2ef2f9924d3adbab157 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 1 Feb 2023 15:40:00 +0800 Subject: [PATCH 317/379] houhaoyu@huawei.com emit parameter in d.ets Signed-off-by: houhaoyu Change-Id: I9066437c30bda60e50b99856dfa232309c81ca89 --- compiler/tsconfig.esm.json | 26 +++++++------------------- compiler/tsconfig.json | 26 +++++++------------------- 2 files changed, 14 insertions(+), 38 deletions(-) diff --git a/compiler/tsconfig.esm.json b/compiler/tsconfig.esm.json index 77671db..3e5d4f7 100644 --- a/compiler/tsconfig.esm.json +++ b/compiler/tsconfig.esm.json @@ -5,23 +5,19 @@ "emitDecorators":[ { "name":"Entry", - "emitParameters" : false + "emitParameters" : true }, { "name":"Component", "emitParameters" : false }, - { - "name":"Preview", - "emitParameters" : false - }, { "name":"CustomDialog", "emitParameters" : false }, { "name":"Consume", - "emitParameters" : false + "emitParameters" : true }, { "name":"Link", @@ -29,11 +25,11 @@ }, { "name":"LocalStorageLink", - "emitParameters" : false + "emitParameters" : true }, { "name":"LocalStorageProp", - "emitParameters" : false + "emitParameters" : true }, { "name":"ObjectLink", @@ -45,7 +41,7 @@ }, { "name":"Provide", - "emitParameters" : false + "emitParameters" : true }, { "name":"State", @@ -53,15 +49,11 @@ }, { "name":"StorageLink", - "emitParameters" : false + "emitParameters" : true }, { "name":"StorageProp", - "emitParameters" : false - }, - { - "name":"Watch", - "emitParameters" : false + "emitParameters" : true }, { "name":"Builder", @@ -71,10 +63,6 @@ "name":"BuilderParam", "emitParameters" : false }, - { - "name":"Styles", - "emitParameters" : false - }, { "name":"Observed", "emitParameters" : false diff --git a/compiler/tsconfig.json b/compiler/tsconfig.json index b110bb8..2c10a40 100644 --- a/compiler/tsconfig.json +++ b/compiler/tsconfig.json @@ -5,23 +5,19 @@ "emitDecorators":[ { "name":"Entry", - "emitParameters" : false + "emitParameters" : true }, { "name":"Component", "emitParameters" : false }, - { - "name":"Preview", - "emitParameters" : false - }, { "name":"CustomDialog", "emitParameters" : false }, { "name":"Consume", - "emitParameters" : false + "emitParameters" : true }, { "name":"Link", @@ -29,11 +25,11 @@ }, { "name":"LocalStorageLink", - "emitParameters" : false + "emitParameters" : true }, { "name":"LocalStorageProp", - "emitParameters" : false + "emitParameters" : true }, { "name":"ObjectLink", @@ -45,7 +41,7 @@ }, { "name":"Provide", - "emitParameters" : false + "emitParameters" : true }, { "name":"State", @@ -53,15 +49,11 @@ }, { "name":"StorageLink", - "emitParameters" : false + "emitParameters" : true }, { "name":"StorageProp", - "emitParameters" : false - }, - { - "name":"Watch", - "emitParameters" : false + "emitParameters" : true }, { "name":"Builder", @@ -71,10 +63,6 @@ "name":"BuilderParam", "emitParameters" : false }, - { - "name":"Styles", - "emitParameters" : false - }, { "name":"Observed", "emitParameters" : false -- Gitee From 1a230b7a878a9611d1baa460b3652e2641d304df Mon Sep 17 00:00:00 2001 From: yfwang6 Date: Wed, 1 Feb 2023 10:47:38 +0800 Subject: [PATCH 318/379] wangyongfei6@huawei.com modify pageTransition do not with pop stack Signed-off-by: yfwang6 Change-Id: Id5ed85ea865d3cef712d79aebd7e61785d6226af --- compiler/src/process_component_build.ts | 51 ++++++++++--------- .../pageTransition/pageTransition.ts | 9 ---- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 35e7ffc..bdff61d 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -173,7 +173,7 @@ export function processComponentBlock(node: ts.Block, isLazy: boolean, log: LogI forEachParameters: ts.NodeArray = undefined, isGlobalBuilder: boolean = false): ts.Block { const newStatements: ts.Statement[] = []; processComponentChild(node, newStatements, log, {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, - isBuilder, parent, forEachParameters, isGlobalBuilder); + isBuilder, parent, forEachParameters, isGlobalBuilder, isTransition); if (isLazy && !partialUpdateConfig.partialUpdateMode) { newStatements.unshift(createRenderingInProgress(true)); } @@ -187,7 +187,7 @@ export function processComponentBlock(node: ts.Block, isLazy: boolean, log: LogI createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null)), [ts.factory.createExpressionStatement( createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), - ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))])); + ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))], false, isTransition)); } newStatements.push(ts.factory.createExpressionStatement( createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME), @@ -282,7 +282,8 @@ let sourceNode: ts.SourceFile; export function processComponentChild(node: ts.Block | ts.SourceFile, newStatements: ts.Statement[], log: LogInfo[], supplement: supplementType = {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, isBuilder: boolean = false, parent: string = undefined, - forEachParameters: ts.NodeArray = undefined, isGlobalBuilder: boolean = false): void { + forEachParameters: ts.NodeArray = undefined, isGlobalBuilder: boolean = false, + isTransition: boolean = false): void { if (supplement.isAcceleratePreview) { newsupplement = supplement; const compilerOptions = ts.readConfigFile( @@ -306,7 +307,7 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme if (ts.isIdentifier(etsExpression.expression)) { parent = etsExpression.expression.escapedText.toString(); } - processInnerComponent(item, newStatements, log, parent, isGlobalBuilder); + processInnerComponent(item, newStatements, log, parent, isGlobalBuilder, isTransition); break; case ComponentType.customComponent: parent = undefined; @@ -452,7 +453,8 @@ function parseEtsComponentExpression(node: ts.ExpressionStatement): EtsComponent } function processInnerComponent(node: ts.ExpressionStatement, innerCompStatements: ts.Statement[], - log: LogInfo[], parent: string = undefined, isGlobalBuilder: boolean = false): void { + log: LogInfo[], parent: string = undefined, isGlobalBuilder: boolean = false, + isTransition: boolean = false): void { const newStatements: ts.Statement[] = []; const res: CreateResult = createComponent(node, COMPONENT_CREATE_FUNCTION); newStatements.push(res.newNode); @@ -463,13 +465,14 @@ function processInnerComponent(node: ts.ExpressionStatement, innerCompStatements } else if (partialUpdateConfig.partialUpdateMode && TabContentAndNavDestination.has(nameResult.name)) { processTabAndNav(node, innerCompStatements, nameResult.name, log, isGlobalBuilder); } else { - processNormalComponent(node, nameResult, innerCompStatements, log, parent, isGlobalBuilder); + processNormalComponent(node, nameResult, innerCompStatements, log, parent, isGlobalBuilder, + isTransition); } } function processNormalComponent(node: ts.ExpressionStatement, nameResult: NameResult, innerCompStatements: ts.Statement[], log: LogInfo[], parent: string = undefined, - isGlobalBuilder: boolean = false): void { + isGlobalBuilder: boolean = false, isTransition: boolean = false): void { const newStatements: ts.Statement[] = []; const res: CreateResult = createComponent(node, COMPONENT_CREATE_FUNCTION); newStatements.push(res.newNode); @@ -497,12 +500,12 @@ function processNormalComponent(node: ts.ExpressionStatement, nameResult: NameRe if (etsComponentResult.hasAttr) { bindComponentAttr(node, res.identifierNode, newStatements, log); } - processInnerCompStatements(innerCompStatements, newStatements, node, isGlobalBuilder); + processInnerCompStatements(innerCompStatements, newStatements, node, isGlobalBuilder, isTransition); processComponentChild(etsComponentResult.etsComponentNode.body, innerCompStatements, log, - {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, false, parent, undefined, isGlobalBuilder); + {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, false, parent, undefined, isGlobalBuilder, false); } else { bindComponentAttr(node, res.identifierNode, newStatements, log); - processInnerCompStatements(innerCompStatements, newStatements, node, isGlobalBuilder); + processInnerCompStatements(innerCompStatements, newStatements, node, isGlobalBuilder, isTransition); } if (res.isContainerComponent || res.needPop) { innerCompStatements.push(createComponent(node, COMPONENT_POP_FUNCTION).newNode); @@ -541,17 +544,27 @@ function processInnerCompStatements( innerCompStatements: ts.Statement[], newStatements: ts.Statement[], node: ts.Statement, - isGlobalBuilder: boolean = false + isGlobalBuilder: boolean = false, + isTransition: boolean = false ): void { if (!partialUpdateConfig.partialUpdateMode) { innerCompStatements.push(...newStatements); } else { - innerCompStatements.push(createComponentCreationStatement(node, newStatements, isGlobalBuilder)); + innerCompStatements.push(createComponentCreationStatement(node, newStatements, isGlobalBuilder, + isTransition)); } } export function createComponentCreationStatement(node: ts.Statement, innerStatements: ts.Statement[], - isGlobalBuilder: boolean = false): ts.Statement { + isGlobalBuilder: boolean = false, isTransition: boolean = false): ts.Statement { + const blockArr = [ + createViewStackProcessorStatement(STARTGETACCESSRECORDINGFOR, ELMTID), + ...innerStatements + ]; + if (!isTransition) { + blockArr.push(createInitRenderStatement(node)); + } + blockArr.push(createViewStackProcessorStatement(STOPGETACCESSRECORDING)); return ts.factory.createExpressionStatement( ts.factory.createCallExpression( ts.factory.createPropertyAccessExpression(createConditionParent(isGlobalBuilder), @@ -565,15 +578,7 @@ export function createComponentCreationStatement(node: ts.Statement, innerStatem ts.factory.createIdentifier(ISINITIALRENDER), undefined, undefined, undefined) ], undefined, ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), - ts.factory.createBlock( - [ - createViewStackProcessorStatement(STARTGETACCESSRECORDINGFOR, ELMTID), - ...innerStatements, - createInitRenderStatement(node), - createViewStackProcessorStatement(STOPGETACCESSRECORDING) - ], - true - ) + ts.factory.createBlock(blockArr, true) )] ) ); @@ -622,7 +627,7 @@ function processItemComponent(node: ts.ExpressionStatement, nameResult: NameResu bindComponentAttr(node, res.identifierNode, itemRenderInnerStatements, log); } processComponentChild(etsComponentResult.etsComponentNode.body, deepItemRenderInnerStatements, log, - {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, false, undefined, undefined, isGlobalBuilder); + {isAcceleratePreview: false, line: 0, column: 0, fileName: ''}, false, undefined, undefined, isGlobalBuilder, false); } else { bindComponentAttr(node, res.identifierNode, itemRenderInnerStatements, log); } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/pageTransition/pageTransition.ts b/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/pageTransition/pageTransition.ts index 866fdc0..5f98426 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/pageTransition/pageTransition.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/pageTransition/pageTransition.ts @@ -138,9 +138,6 @@ class PageTransitionExample1 extends ViewPU { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); PageTransition.create(); - if (!isInitialRender) { - PageTransition.pop(); - } ViewStackProcessor.StopGetAccessRecording(); }); this.observeComponentCreation((elmtId, isInitialRender) => { @@ -150,9 +147,6 @@ class PageTransitionExample1 extends ViewPU { this.scale2 = 1; this.opacity2 = progress; }); - if (!isInitialRender) { - PageTransitionEnter.pop(); - } ViewStackProcessor.StopGetAccessRecording(); }); this.observeComponentCreation((elmtId, isInitialRender) => { @@ -162,9 +156,6 @@ class PageTransitionExample1 extends ViewPU { this.scale2 = 1 - progress; this.opacity2 = 1; }); - if (!isInitialRender) { - PageTransitionExit.pop(); - } ViewStackProcessor.StopGetAccessRecording(); }); PageTransition.pop(); -- Gitee From a6983832a3f090d5173e4548366396518d935f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Thu, 2 Feb 2023 14:56:24 +0800 Subject: [PATCH 319/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 7e87f45..a5e8576 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -84,9 +84,6 @@ import { projectConfig } from '../main'; -const localArray: string[] = [COMPONENT_STATE_DECORATOR, COMPONENT_PROVIDE_DECORATOR, - COMPONENT_NON_DECORATOR, COMPONENT_OBJECT_LINK_DECORATOR]; - let decoractorMap: Map>>; export function processCustomComponent(node: ts.ExpressionStatement, newStatements: ts.Statement[], @@ -424,7 +421,7 @@ function checkFromParentToChild(node: ts.ObjectLiteralElementLike, customCompone node, propertyName, curPropertyKind, parentPropertyName, parentPropertyKind, log); } } else if (isInitFromLocal(node) && ts.isPropertyAssignment(node)) { - if (!localArray.includes(curPropertyKind)) { + if (!isCorrectInitFormParent(COMPONENT_NON_DECORATOR, curPropertyKind)) { validateIllegalInitFromParent(node, propertyName, curPropertyKind, node.initializer.getText(), COMPONENT_NON_DECORATOR, log); } -- Gitee From ab5a95b4f477dcbf44616ac5e0126a2bdfaceb29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Thu, 2 Feb 2023 08:38:09 +0000 Subject: [PATCH 320/379] update compiler/src/process_custom_component.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_custom_component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index a5e8576..5e922e4 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -420,7 +420,8 @@ function checkFromParentToChild(node: ts.ObjectLiteralElementLike, customCompone validateIllegalInitFromParent( node, propertyName, curPropertyKind, parentPropertyName, parentPropertyKind, log); } - } else if (isInitFromLocal(node) && ts.isPropertyAssignment(node)) { + } else if (isInitFromLocal(node) && ts.isPropertyAssignment(node) && + curPropertyKind !== COMPONENT_OBJECT_LINK_DECORATOR) { if (!isCorrectInitFormParent(COMPONENT_NON_DECORATOR, curPropertyKind)) { validateIllegalInitFromParent(node, propertyName, curPropertyKind, node.initializer.getText(), COMPONENT_NON_DECORATOR, log); -- Gitee From 4733c5d2c6ce8d783226f30aae9df2d7de4bda5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Wed, 1 Feb 2023 16:35:54 +0800 Subject: [PATCH 321/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/main.js | 7 +- compiler/src/compile_info.ts | 5 +- compiler/src/process_component_build.ts | 90 ------------------- compiler/src/process_component_constructor.ts | 5 -- compiler/src/process_custom_component.ts | 32 ++----- 5 files changed, 7 insertions(+), 132 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 31475df..948f826 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -662,11 +662,7 @@ function isPartialUpdate(metadata) { item.value && item.value === 'true') { partialUpdateConfig.partialUpdateMode = true; } - if (item.name && item.name === 'partialUpdateStrictCheck' && item.value) { - partialUpdateConfig.strictCheck = item.value; - } - return partialUpdateConfig.partialUpdateMode && - partialUpdateConfig.strictCheck; + return partialUpdateConfig.partialUpdateMode; }); } } @@ -686,7 +682,6 @@ const globalProgram = { }; const partialUpdateConfig = { - strictCheck: undefined, partialUpdateMode: false }; diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index afca008..2780e48 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -58,7 +58,6 @@ import { } from './ets_checker'; import { globalProgram, - partialUpdateConfig, projectConfig } from '../main'; import cluster from 'cluster'; @@ -329,9 +328,7 @@ export class ResultStates { if (errorCount > 0) { resultInfo += `ERROR:${errorCount}`; result = 'FAIL '; - if (!partialUpdateConfig.strictCheck && !partialUpdateConfig.partialUpdateMode) { - process.exitCode = 1; - } + process.exitCode = 1; } else { result = 'SUCCESS '; } diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 35e7ffc..7dfd317 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -475,11 +475,6 @@ function processNormalComponent(node: ts.ExpressionStatement, nameResult: NameRe newStatements.push(res.newNode); processDebug(node, nameResult, newStatements); const etsComponentResult: EtsComponentResult = parseEtsComponentExpression(node); - if (res.identifierNode.escapedText && partialUpdateConfig.strictCheck === 'all' && - partialUpdateConfig.partialUpdateMode) { - checkComponentInitializer( - res.identifierNode.escapedText.toString(), etsComponentResult.etsComponentNode, log); - } if (PROPERTIES_ADD_DOUBLE_DOLLAR.has(res.identifierNode.getText()) && etsComponentResult.etsComponentNode.arguments && etsComponentResult.etsComponentNode.arguments.length) { etsComponentResult.etsComponentNode = processDollarEtsComponent(etsComponentResult.etsComponentNode, @@ -1212,7 +1207,6 @@ function createRenderingInProgress(isTrue: boolean): ts.ExpressionStatement { function processIfStatement(node: ts.IfStatement, newStatements: ts.Statement[], log: LogInfo[], isBuilder: boolean = false, isGlobalBuilder: boolean = false): void { - checkHasThisKeyword(node, log); const ifCreate: ts.ExpressionStatement = createIfCreate(); const newIfNode: ts.IfStatement = processInnerIfStatement(node, 0, log, isBuilder, isGlobalBuilder); const ifPop: ts.ExpressionStatement = createIfPop(); @@ -1303,47 +1297,6 @@ function processElseStatement(elseStatement: ts.Statement, id: number, return elseStatement; } -function checkHasThisKeyword(node: ts.Statement, log: LogInfo[]): void { - if (partialUpdateConfig.strictCheck === 'all' && partialUpdateConfig.partialUpdateMode && - node && node.getText()) { - if (node.getText().indexOf(THIS) >= 0) { - const currentObservedPropertyCollection: Set = getObservedPropertyCollection( - componentCollection.currentClassName); - let hasObservedKeyword: boolean = false; - const realKeywords: Set = new Set(); - const traverse: Function = (node: ts.Node) => { - if (node && ts.isPropertyAccessExpression(node) && node.expression && - node.expression.kind === ts.SyntaxKind.ThisKeyword) { - const keyword: string = node.name.escapedText.toString(); - if (currentObservedPropertyCollection.has(keyword)) { - hasObservedKeyword = true; - return; - } else { - realKeywords.add(keyword); - } - } - if (node && !ts.isBlock(node)) { - ts.forEachChild(node, node => traverse(node)); - } - } - traverse(node); - if (!hasObservedKeyword && node && realKeywords.size > 0) { - log.push({ - type: LogType.NOTE, - message: `It is recommended to use the state variable for condition judgment of the IF component.`, - pos: node.getStart() || node.pos - }); - } - } else { - log.push({ - type: LogType.NOTE, - message: `It is recommended to use the state variable for condition judgment of the IF component.`, - pos: node.getStart() || node.pos - }); - } - } -} - function processIfBlock(block: ts.Block, id: number, log: LogInfo[], isBuilder: boolean = false, isGlobalBuilder: boolean = false): ts.Block { return addIfBranchId(id, isGlobalBuilder, @@ -1531,49 +1484,6 @@ export function bindComponentAttr(node: ts.ExpressionStatement, identifierNode: } } -function checkComponentInitializer(name: string, node: ts.ExpressionStatement, log: LogInfo[]): void { - if (!checkComponents.has(name)) { - return; - } - const textList: Set = new Set(['TextArea', 'TextInput']); - if (node.arguments && node.arguments.length && - ts.isObjectLiteralExpression(node.arguments[0])) { - node.arguments[0].properties.forEach(property => { - if (textList.has(name) && property.name && - ts.isIdentifier(property.name) && property.name.escapedText.toString() === 'text') { - let logFlag: boolean = true; - if (property.initializer && ts.isPropertyAccessExpression(property.initializer) && - property.initializer.expression && - property.initializer.expression.kind === ts.SyntaxKind.ThisKeyword && - property.initializer.name.escapedText) { - const observedPropertyCollection: Set = getObservedPropertyCollection( - componentCollection.currentClassName); - if (observedPropertyCollection.has(property.initializer.name.escapedText.toString())) { - logFlag = false; - } - } - if (logFlag) { - log.push({ - type: LogType.NOTE, - message: `If the text property value does not use the state variable,` + - ` the text content will not be updated.`, - pos: node.getStart() - }); - } - return; - } else if (name === 'GridContainer' && property.name && ts.isIdentifier(property.name) && - property.name.escapedText && property.name.escapedText.toString() === 'margin') { - log.push({ - type: LogType.NOTE, - message: `In API9, the margin attribute of GridContainer takes effect.`, - pos: node.getStart() - }); - return; - } - }); - } -} - function processCustomBuilderProperty(node: ts.CallExpression, identifierNode: ts.Identifier, propertyName: string): ts.CallExpression { const newArguments: ts.Expression[] = []; diff --git a/compiler/src/process_component_constructor.ts b/compiler/src/process_component_constructor.ts index cbd4027..139b44c 100644 --- a/compiler/src/process_component_constructor.ts +++ b/compiler/src/process_component_constructor.ts @@ -31,11 +31,6 @@ import { ELMTID } from './pre_define'; -import { - localStorageLinkCollection, - localStoragePropCollection -} from './validate_ui_syntax'; - import { partialUpdateConfig } from '../main'; export function getInitConstructor(members: ts.NodeArray, parentComponentName: ts.Identifier diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 7e87f45..5b7a64a 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -80,8 +80,7 @@ import { createFunction } from './process_component_build'; import { - partialUpdateConfig, - projectConfig + partialUpdateConfig } from '../main'; const localArray: string[] = [COMPONENT_STATE_DECORATOR, COMPONENT_PROVIDE_DECORATOR, @@ -302,12 +301,11 @@ function validateCustomComponentPrams(node: ts.CallExpression, name: string, if (nodeArguments && nodeArguments.length === 1 && ts.isObjectLiteralExpression(nodeArguments[0])) { const nodeArgument: ts.ObjectLiteralExpression = nodeArguments[0] as ts.ObjectLiteralExpression; - const propertyObservedKinds: string[] = []; nodeArgument.properties.forEach(item => { if (item.name && ts.isIdentifier(item.name)) { curChildProps.add(item.name.escapedText.toString()); } - validateStateManagement(item, name, log, propertyObservedKinds); + validateStateManagement(item, name, log); if (isNonThisProperty(item, linkSet)) { if (isToChange(item as ts.PropertyAssignment, name)) { item = ts.factory.updatePropertyAssignment(item as ts.PropertyAssignment, @@ -315,24 +313,7 @@ function validateCustomComponentPrams(node: ts.CallExpression, name: string, } props.push(item); } - if (partialUpdateConfig.strictCheck === 'all' && partialUpdateConfig.partialUpdateMode && - item.initializer && ts.isCallExpression(item.initializer)) { - log.push({ - type: LogType.NOTE, - message: 'If method assignment is used here, the UI may not be updated.', - pos: item.initializer.getStart() - }); - } }); - if (partialUpdateConfig.strictCheck === 'all' && partialUpdateConfig.partialUpdateMode && - propertyObservedKinds.length === 0 && nodeArgument.properties.length > 0) { - log.push({ - type: LogType.NOTE, - message: `You do not use any state variables for the component '${name}', ` + - `UI of the component will not be update.`, - pos: node.getStart() - }); - } } validateMandatoryToAssignmentViaParam(node, name, curChildProps, log); } @@ -395,13 +376,13 @@ function isNonThisProperty(node: ts.ObjectLiteralElementLike, propertySet: Set Date: Wed, 1 Feb 2023 18:38:11 +0800 Subject: [PATCH 322/379] lihong67@huawei.com enable new framework by default Signed-off-by: lihong Change-Id: Ia8e9226f25b85b9c23d5b7d29550c2567f40e761 --- compiler/main.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 31475df..2d85878 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -114,6 +114,7 @@ function loadEntryObj(projectConfig) { manifest = JSON.parse(jsonString); if (manifest && manifest.minPlatformVersion) { process.env.minPlatformVersion = manifest.minPlatformVersion; + partialUpdateController(manifest.minPlatformVersion); } projectConfig.pagesJsonFileName = 'config.json'; } else if (projectConfig.aceModuleJsonPath && fs.existsSync(projectConfig.aceModuleJsonPath)) { @@ -149,11 +150,13 @@ function buildManifest(manifest, aceConfigPath) { try { const moduleConfigJson = JSON.parse(fs.readFileSync(aceConfigPath).toString()); manifest.type = process.env.abilityType; - if (moduleConfigJson && moduleConfigJson.module && moduleConfigJson.module.metadata && - moduleConfigJson.app && moduleConfigJson.app.minAPIVersion) { - partialUpdateController(moduleConfigJson.module.metadata, - moduleConfigJson.app.minAPIVersion); - stageOptimization(moduleConfigJson.module.metadata); + if (moduleConfigJson && moduleConfigJson.app && moduleConfigJson.app.minAPIVersion) { + if (moduleConfigJson.module && moduleConfigJson.module.metadata) { + partialUpdateController(moduleConfigJson.app.minAPIVersion, moduleConfigJson.module.metadata); + stageOptimization(moduleConfigJson.module.metadata); + } else { + partialUpdateController(moduleConfigJson.app.minAPIVersion); + } } if (moduleConfigJson.module) { switch (moduleConfigJson.module.type) { @@ -659,23 +662,26 @@ function isPartialUpdate(metadata) { if (Array.isArray(metadata) && metadata.length) { metadata.some(item => { if (item.name && item.name === 'ArkTSPartialUpdate' && - item.value && item.value === 'true') { - partialUpdateConfig.partialUpdateMode = true; + item.value && item.value === 'false') { + partialUpdateConfig.partialUpdateMode = false; } if (item.name && item.name === 'partialUpdateStrictCheck' && item.value) { partialUpdateConfig.strictCheck = item.value; } - return partialUpdateConfig.partialUpdateMode && + return !partialUpdateConfig.partialUpdateMode && partialUpdateConfig.strictCheck; }); } } -function partialUpdateController(metadata, minAPIVersion) { +function partialUpdateController(minAPIVersion, metadata = null) { if (projectConfig.isPreview) { return; } if (minAPIVersion >= 9) { + partialUpdateConfig.partialUpdateMode = true; + } + if (metadata) { isPartialUpdate(metadata); } } -- Gitee From 924a7f764a2d55afc79a9ec091e3d56a9bbfcc5a Mon Sep 17 00:00:00 2001 From: jsjzju Date: Thu, 2 Feb 2023 22:09:10 +0800 Subject: [PATCH 323/379] modify externals Signed-off-by: jsjzju Change-Id: I0e9276a503a1bc00fd534a41665b644363672a5d --- compiler/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index b2fdfcb..51d4b60 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -476,7 +476,7 @@ module.exports = (env, argv) => { if (projectConfig.compileMode === 'esmodule' && projectConfig.harNameOhmMap) { config.externals = []; for (const harName in projectConfig.harNameOhmMap) { - config.externals.push(RegExp('^(' + harName + ')($|\/\S+)')); + config.externals.push(RegExp('^(' + harName + ')($|\\/\\S+)')); } } -- Gitee From b84bc5cf790dd9ea37e214bb7356c126772b883b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 3 Feb 2023 15:03:48 +0800 Subject: [PATCH 324/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/main.js b/compiler/main.js index e76deaa..de56aeb 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -417,7 +417,8 @@ function readCardResource(resource) { } function readCardForm(form) { - if (form.type && form.type === 'eTS') { + if ((form.type && form.type === 'eTS') || + (form.uiSyntax && form.uiSyntax === 'arkts')) { const sourcePath = form.src.replace(/\.ets$/, ''); const cardPath = path.resolve(projectConfig.projectPath, '..', sourcePath + '.ets'); if (cardPath && fs.existsSync(cardPath)) { -- Gitee From b61e3c01536a8506712a1dbbf2bc11cbc262bc11 Mon Sep 17 00:00:00 2001 From: hufeng Date: Thu, 22 Dec 2022 21:11:02 +0800 Subject: [PATCH 325/379] Transform concurrent decorator Signed-off-by: hufeng Change-Id: I174b6a06935fb19f24177c6d71ccba5833d06063 --- compiler/package-lock.json | 2 +- compiler/src/pre_define.ts | 1 + compiler/src/process_ui_syntax.ts | 15 +++++++++++++ compiler/src/validate_ui_syntax.ts | 36 +++++++++++++++++++++++++++--- compiler/tsconfig.esm.json | 3 +++ compiler/tsconfig.json | 3 +++ 6 files changed, 56 insertions(+), 4 deletions(-) diff --git a/compiler/package-lock.json b/compiler/package-lock.json index ad14bb3..7435f79 100644 --- a/compiler/package-lock.json +++ b/compiler/package-lock.json @@ -4459,7 +4459,7 @@ }, "typescript": { "version": "file:deps/ohos-typescript-4.2.3-r2.tgz", - "integrity": "sha512-Znvyk9NOaGjaIX/viL2hLuQfrftuJ8eu/gxZAvvXcHACWXopOO3zqxvrYRcxiN4VG/D2eQ4odQqwxKs0lq2h6g==" + "integrity": "sha512-nUW6Nr2UFqhuJW2Zs/06fEAOloU9TuwFvVqz/m3q27UY9xXKBOSTL/jhdsGwdoqx+ZjGPAC1qLFknsfkawvguA==" }, "uglify-js": { "version": "3.16.1", diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index bbc0847..58ed7f1 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -56,6 +56,7 @@ export const COMPONENT_OBSERVED_DECORATOR: string = '@Observed'; export const COMPONENT_BUILDER_DECORATOR: string = '@Builder'; export const COMPONENT_EXTEND_DECORATOR: string = '@Extend'; export const COMPONENT_STYLES_DECORATOR: string = '@Styles'; +export const COMPONENT_CONCURRENT_DECORATOR: string = '@Concurrent'; export const CHECK_COMPONENT_EXTEND_DECORATOR: string = 'Extend'; export const OBSERVED_PROPERTY_SIMPLE: string = 'ObservedPropertySimple'; diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 9d47d06..da3d392 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -25,6 +25,7 @@ import { COMPONENT_CONSTRUCTOR_UNDEFINED, BUILD_ON, COMPONENT_BUILDER_DECORATOR, + COMPONENT_CONCURRENT_DECORATOR, COMPONENT_EXTEND_DECORATOR, COMPONENT_STYLES_DECORATOR, RESOURCE, @@ -200,6 +201,9 @@ export function processUISyntax(program: ts.Program, ut = false): Function { pos: node.getStart() }); } + } else if (hasDecorator(node, COMPONENT_CONCURRENT_DECORATOR)) { + // ark compiler's feature + node = processConcurrent(node); } } else if (isResource(node)) { node = processResourceData(node as ts.CallExpression); @@ -566,6 +570,17 @@ function processExtend(node: ts.FunctionDeclaration, log: LogInfo[]): ts.Functio } } +function processConcurrent(node: ts.FunctionDeclaration): ts.FunctionDeclaration { + if (node.body) { + const statementArray: ts.Statement[] + = [ts.factory.createExpressionStatement(ts.factory.createStringLiteral('use concurrent')), + ...node.body.statements]; + return ts.factory.updateFunctionDeclaration(node, undefined, node.modifiers, node.asteriskToken, node.name, + node.typeParameters, node.parameters, node.type, ts.factory.updateBlock(node.body, statementArray)); + } + return node; +} + export function isOriginalExtend(node: ts.Block): boolean { let innerNode: ts.Node = node.statements[0]; if (node.statements.length === 1 && ts.isExpressionStatement(innerNode)) { diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 02f9760..7a9e58a 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -43,6 +43,7 @@ import { STYLES, VALIDATE_MODULE, COMPONENT_BUILDER_DECORATOR, + COMPONENT_CONCURRENT_DECORATOR, COMPONENT_EXTEND_DECORATOR, COMPONENT_STYLES_DECORATOR, RESOURCE_NAME_TYPE, @@ -53,7 +54,8 @@ import { COMPONENT_BUILDERPARAM_DECORATOR, ESMODULE, CARD_ENABLE_DECORATORS, - CARD_LOG_TYPE_DECORATORS + CARD_LOG_TYPE_DECORATORS, + JSBUNDLE } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -315,6 +317,29 @@ function checkDecorators(decorators: ts.NodeArray, result: Decorat } } +function checkConcurrentDecorator(node: ts.FunctionDeclaration | ts.MethodDeclaration, log: LogInfo[], + sourceFile: ts.SourceFile): void { + if (projectConfig.compileMode === JSBUNDLE) { + const message: string = `@Concurrent can only be used in ESMODULE compile mode.`; + addLog(LogType.ERROR, message, node.decorators!.pos, log, sourceFile); + } + if (ts.isMethodDeclaration(node)) { + const message: string = `@Concurrent can not be used on method. please use it on function declaration.`; + addLog(LogType.ERROR, message, node.decorators!.pos, log, sourceFile); + } + let hasAsync: boolean = false; + node.modifiers && node.modifiers.forEach(m => { + if (m.kind === ts.SyntaxKind.AsyncKeyword) { + hasAsync = true; + } + }); + if (node.asteriskToken || hasAsync) { + const funcKind: string = node.asteriskToken ? hasAsync ? 'Async generator' : 'Generator' : 'Async'; + const message: string = `@Concurrent can not be used on ${funcKind} function declaration.`; + addLog(LogType.ERROR, message, node.decorators!.pos, log, sourceFile); + } +} + function collectLocalStorageName(node: ts.Decorator): void { if (node && node.expression && ts.isCallExpression(node.expression)) { if (node.expression.arguments && node.expression.arguments.length) { @@ -341,9 +366,14 @@ function visitAllNode(node: ts.Node, sourceFileNode: ts.SourceFile, allComponent if (ts.isStructDeclaration(node) && node.name && ts.isIdentifier(node.name)) { collectComponentProps(node); } - if ((ts.isMethodDeclaration(node) || ts.isFunctionDeclaration(node)) && - hasDecorator(node, COMPONENT_BUILDER_DECORATOR)) { + if (ts.isMethodDeclaration(node) || ts.isFunctionDeclaration(node)) { + if (hasDecorator(node, COMPONENT_BUILDER_DECORATOR)) { CUSTOM_BUILDER_METHOD.add(node.name.getText()); + } + if (hasDecorator(node, COMPONENT_CONCURRENT_DECORATOR)) { + // ark compiler's feature + checkConcurrentDecorator(node, log, sourceFileNode); + } } if (ts.isFunctionDeclaration(node) && isExtendFunction(node)) { const componentName: string = isExtendFunction(node); diff --git a/compiler/tsconfig.esm.json b/compiler/tsconfig.esm.json index 77671db..30de0cd 100644 --- a/compiler/tsconfig.esm.json +++ b/compiler/tsconfig.esm.json @@ -682,6 +682,9 @@ }, "property": "stateStyles" }, + "concurrent": { + "decorator": "Concurrent" + }, "customComponent": "CustomComponent", }, "allowJs": true, diff --git a/compiler/tsconfig.json b/compiler/tsconfig.json index b110bb8..bac0d89 100644 --- a/compiler/tsconfig.json +++ b/compiler/tsconfig.json @@ -694,6 +694,9 @@ }, "property": "stateStyles" }, + "concurrent": { + "decorator": "Concurrent" + }, "customComponent": "CustomComponent", }, "allowJs": true, -- Gitee From e7751b2f3ed3efdf87fb806d50feb6c99db7937e Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Sun, 29 Jan 2023 17:22:54 +0800 Subject: [PATCH 326/379] Implement ark compliation feature of bundle mode Signed-off-by: zhangrengao Change-Id: I8e01c84e769831992f6e634829f054388c6994c8 --- .../ark_compiler/bundle/bundle_build_mode.ts | 30 ++ .../ark_compiler/bundle/bundle_mode.ts | 381 ++++++++++++++++++ .../bundle/bundle_preview_mode.ts | 29 ++ .../ark_compiler/common/ark_define.ts | 75 ++++ .../ark_compiler/common/common_mode.ts | 113 ++++++ .../fast_build/ark_compiler/common/gen_abc.ts | 87 ++++ .../ark_compiler/common/process_ark_config.ts | 131 ++++++ .../ark_compiler/generate_bundle_abc.ts | 44 ++ .../ark_compiler/generate_module_abc.ts | 51 +++ compiler/src/fast_build/ark_compiler/load.ts | 47 +++ .../ark_compiler/rollup-plugin-gen-abc.ts | 30 ++ .../src/fast_build/ark_compiler/transform.ts | 66 +++ compiler/src/fast_build/ark_compiler/utils.ts | 164 ++++++++ 13 files changed, 1248 insertions(+) create mode 100644 compiler/src/fast_build/ark_compiler/bundle/bundle_build_mode.ts create mode 100644 compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts create mode 100644 compiler/src/fast_build/ark_compiler/bundle/bundle_preview_mode.ts create mode 100644 compiler/src/fast_build/ark_compiler/common/ark_define.ts create mode 100644 compiler/src/fast_build/ark_compiler/common/common_mode.ts create mode 100644 compiler/src/fast_build/ark_compiler/common/gen_abc.ts create mode 100644 compiler/src/fast_build/ark_compiler/common/process_ark_config.ts create mode 100644 compiler/src/fast_build/ark_compiler/generate_bundle_abc.ts create mode 100644 compiler/src/fast_build/ark_compiler/generate_module_abc.ts create mode 100644 compiler/src/fast_build/ark_compiler/load.ts create mode 100644 compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts create mode 100644 compiler/src/fast_build/ark_compiler/transform.ts create mode 100644 compiler/src/fast_build/ark_compiler/utils.ts diff --git a/compiler/src/fast_build/ark_compiler/bundle/bundle_build_mode.ts b/compiler/src/fast_build/ark_compiler/bundle/bundle_build_mode.ts new file mode 100644 index 0000000..6a8dccf --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/bundle/bundle_build_mode.ts @@ -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. + */ + +import { BundleMode } from './bundle_mode'; + +export class BundleBuildMode extends BundleMode { + constructor(rollupObject: any, rollupBundleFileSet: any) { + super(rollupObject, rollupBundleFileSet); + } + + generateAbc() { + if (this.filterIntermediateJsBundle.length === 0) { + this.afterCompilationProcess(); + return; + } + super.executeArkCompiler(); + } +} diff --git a/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts b/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts new file mode 100644 index 0000000..a3ed551 --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts @@ -0,0 +1,381 @@ +/* + * 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 path from 'path'; +import fs from 'fs'; +import cluster from 'cluster'; +import childProcess from 'child_process'; + +import { CommonMode } from '../common/common_mode'; +import { + changeFileExtension, + genCachePath, + getEs2abcFileThreadNumber, + genTemporaryModuleCacheDirectoryForBundle, + isMasterOrPrimary, + isSpecifiedExt +} from '../utils'; +import { + EXTNAME_ABC, + EXTNAME_JS, + FILESINFO_TXT, + JSBUNDLE, + MAX_WORKER_NUMBER, + TEMP_JS +} from '../common/ark_define'; +import { + blue, + FAIL, + reset +} from '../../common/common_define'; +import { + mkDir, + toHashData, + toUnixPath, + unlinkSync, + validateFilePathLength +} from '../../../utils'; +import { + isEs2Abc, + isTs2Abc +} from '../../../ark_utils'; + +interface File { + filePath: string; + cacheFilePath: string; + sourceFile: string; + size: number; +} + +export class BundleMode extends CommonMode { + intermediateJsBundle: Map; + filterIntermediateJsBundle: Array; + hashJsonObject: any; + filesInfoPath: string; + + constructor(rollupObject: any, rollupBundleFileSet: any) { + super(rollupObject); + this.intermediateJsBundle = new Map(); + this.filterIntermediateJsBundle = []; + this.hashJsonObject = {}; + this.filesInfoPath = ''; + this.prepareBundleFileListForCompilation(rollupBundleFileSet); + } + + prepareBundleFileListForCompilation(rollupBundleFileSet: any) { + this.collectBundleFileList(rollupBundleFileSet); + this.filterBundleFileListWithHashJson(); + } + + collectBundleFileList(rollupBundleFileSet: any) { + Object.keys(rollupBundleFileSet).forEach((fileName) => { + // choose *.js + if (this.projectConfig.aceModuleBuild && isSpecifiedExt(fileName, EXTNAME_JS)) { + const tempFilePath: string = changeFileExtension(fileName, TEMP_JS); + const outputPath: string = path.resolve(this.projectConfig.aceModuleBuild, tempFilePath); + const cacheOutputPath: string = this.genCacheBundleFilePath(outputPath, tempFilePath); + let rollupBundleSourceCode: string = ''; + if (rollupBundleFileSet[fileName].type === 'asset') { + rollupBundleSourceCode = rollupBundleFileSet[fileName].source; + } else if (rollupBundleFileSet[fileName].type === 'chunk') { + rollupBundleSourceCode = rollupBundleFileSet[fileName].code; + } else { + throw Error('ArkTS:ERROR failed to get rollup bundle file source code'); + } + fs.writeFileSync(cacheOutputPath, rollupBundleSourceCode, 'utf-8'); + if (!fs.existsSync(cacheOutputPath)) { + throw Error('ArkTS:ERROR failed to generate cached source file'); + } + this.collectIntermediateJsBundle(outputPath, cacheOutputPath); + } + }); + } + + filterBundleFileListWithHashJson() { + if (this.intermediateJsBundle.size === 0) { + return; + } + if (!fs.existsSync(this.hashJsonFilePath) || this.hashJsonFilePath.length === 0) { + this.intermediateJsBundle.forEach((value) => { + this.filterIntermediateJsBundle.push(value); + }); + return; + } + let updatedJsonObject: any = {}; + let jsonObject: any = {}; + let jsonFile: string = ''; + jsonFile = fs.readFileSync(this.hashJsonFilePath).toString(); + jsonObject = JSON.parse(jsonFile); + this.filterIntermediateJsBundle = []; + for (const value of this.intermediateJsBundle.values()) { + const cacheFilePath: string = value.cacheFilePath; + const cacheAbcFilePath: string = changeFileExtension(cacheFilePath, EXTNAME_ABC); + if (!fs.existsSync(cacheFilePath)) { + throw Error(`ArkTS:ERROR ${cacheFilePath} is lost`); + } + if (fs.existsSync(cacheAbcFilePath)) { + const hashCacheFileContentData: any = toHashData(cacheFilePath); + const hashAbcContentData: any = toHashData(cacheAbcFilePath); + if (jsonObject[cacheFilePath] === hashCacheFileContentData && + jsonObject[cacheAbcFilePath] === hashAbcContentData) { + updatedJsonObject[cacheFilePath] = hashCacheFileContentData; + updatedJsonObject[cacheAbcFilePath] = hashAbcContentData; + continue; + } + } + this.filterIntermediateJsBundle.push(value); + } + + this.hashJsonObject = updatedJsonObject; + } + + executeArkCompiler() { + if (isEs2Abc(this.projectConfig)) { + this.filesInfoPath = this.generateFileInfoOfBundle(); + this.generateEs2AbcCmd(this.filesInfoPath); + this.executeEs2AbcCmd(); + } else if (isTs2Abc(this.projectConfig)) { + const splittedBundles: any[] = this.getSplittedBundles(); + this.invokeTs2AbcWorkersToGenAbc(splittedBundles); + } else { + throw Error('ArkTS:ERROR please set panda mode'); + } + } + + afterCompilationProcess() { + this.writeHashJson(); + this.copyFileFromCachePathToOutputPath(); + this.cleanCacheFiles(); + this.cleanInfo(); + } + + private generateEs2AbcCmd(filesInfoPath: string) { + const fileThreads: number = getEs2abcFileThreadNumber(); + this.cmdArgs.push( + `"@${filesInfoPath}"`, + '--file-threads', + `"${fileThreads}"` + ); + } + + private generateFileInfoOfBundle(): string { + const filesInfoPath: string = genCachePath(FILESINFO_TXT, this.projectConfig, this.logger); + let filesInfo: string = ''; + this.filterIntermediateJsBundle.forEach((info) => { + const cacheFilePath: string = info.cacheFilePath; + const recordName: string = 'null_recordName'; + const moduleType: string = 'script'; + const sourceFile: string = info.sourceFile; + const abcFilePath: string = changeFileExtension(cacheFilePath, EXTNAME_ABC); + filesInfo += `${cacheFilePath};${recordName};${moduleType};${sourceFile};${abcFilePath}\n`; + }); + fs.writeFileSync(filesInfoPath, filesInfo, 'utf-8'); + + return filesInfoPath; + } + + private executeEs2AbcCmd() { + const genAbcCmd: string = this.cmdArgs.join(' '); + try { + const child = this.asyncHandler(() => { + return childProcess.exec(genAbcCmd, { windowsHide: true }); + }); + child.on('exit', (code: any) => { + if (code === FAIL) { + throw Error('ArkTS:ERROR failed to execute es2abc'); + } + this.afterCompilationProcess(); + this.signalHandler(); + }); + + child.on('error', (err: any) => { + throw Error(err.toString()); + }); + + child.stderr.on('data', (data: any) => { + this.logger.error(blue, data.toString(), reset); + }); + } catch (e) { + throw Error('ArkTS:ERROR failed to execute es2abc with async handler: ' + e.toString()); + } + } + + private genCacheBundleFilePath(outputPath: string, tempFilePath: string): string { + let cacheOutputPath: string = ''; + if (this.projectConfig.cachePath) { + cacheOutputPath = path.join(genTemporaryModuleCacheDirectoryForBundle(this.projectConfig), tempFilePath); + } else { + cacheOutputPath = outputPath; + } + validateFilePathLength(cacheOutputPath, this.logger); + const parentDir: string = path.join(cacheOutputPath, '..'); + if (!(fs.existsSync(parentDir) && fs.statSync(parentDir).isDirectory())) { + mkDir(parentDir); + } + + return cacheOutputPath; + } + + private collectIntermediateJsBundle(filePath: string, cacheFilePath: string) { + const fileSize: any = fs.statSync(cacheFilePath).size; + filePath = toUnixPath(filePath); + cacheFilePath = toUnixPath(cacheFilePath); + let sourceFile: string = changeFileExtension(filePath, '_.js', TEMP_JS); + if (!this.projectConfig.isDebug && this.projectConfig.projectRootPath) { + sourceFile = toUnixPath(sourceFile.replace(this.projectConfig.projectRootPath + path.sep, '')); + } else { + sourceFile = toUnixPath(sourceFile); + } + const bundleFile: File = { + filePath: filePath, + cacheFilePath: cacheFilePath, + sourceFile: sourceFile, + size: fileSize + }; + this.intermediateJsBundle.set(filePath, bundleFile); + } + + private getSplittedBundles(): any[] { + const splittedBundles: any[] = this.splitJsBundlesBySize(this.filterIntermediateJsBundle, MAX_WORKER_NUMBER); + return splittedBundles; + } + + private invokeTs2AbcWorkersToGenAbc(splittedBundles) { + if (isMasterOrPrimary()) { + this.setupCluster(cluster); + const workerNumber: number = splittedBundles.length < MAX_WORKER_NUMBER ? splittedBundles.length : MAX_WORKER_NUMBER; + for (let i = 0; i < workerNumber; ++i) { + const workerData: any = { + inputs: JSON.stringify(splittedBundles[i]), + cmd: this.cmdArgs.join(' '), + mode: JSBUNDLE + }; + this.asyncHandler(() => { + cluster.fork(workerData); + }); + } + + let workerCount: number = 0; + cluster.on('exit', (worker, code, signal) => { + if (code === FAIL) { + throw Error('ArkTS:ERROR failed to execute ts2abc'); + } + workerCount++; + if (workerCount === workerNumber) { + this.afterCompilationProcess(); + } + this.signalHandler(); + }); + } + } + + private getSmallestSizeGroup(groupSize: Map): any { + const groupSizeArray: any = Array.from(groupSize); + groupSizeArray.sort(function(g1, g2) { + return g1[1] - g2[1]; // sort by size + }); + return groupSizeArray[0][0]; + } + + private splitJsBundlesBySize(bundleArray: Array, groupNumber: number): any { + const result: any = []; + if (bundleArray.length < groupNumber) { + for (const value of bundleArray) { + result.push([value]); + } + return result; + } + + bundleArray.sort(function(f1: File, f2: File) { + return f2.size - f1.size; + }); + const groupFileSize: any = new Map(); + for (let i = 0; i < groupNumber; ++i) { + result.push([]); + groupFileSize.set(i, 0); + } + + let index: number = 0; + while (index < bundleArray.length) { + const smallestGroup: any = this.getSmallestSizeGroup(groupFileSize); + result[smallestGroup].push(bundleArray[index]); + const sizeUpdate: any = groupFileSize.get(smallestGroup) + bundleArray[index].size; + groupFileSize.set(smallestGroup, sizeUpdate); + index++; + } + return result; + } + + private writeHashJson() { + if (this.hashJsonFilePath.length === 0) { + return; + } + + for (let i = 0; i < this.filterIntermediateJsBundle.length; ++i) { + const cacheFilePath: string = this.filterIntermediateJsBundle[i].cacheFilePath; + const cacheAbcFilePath: string = changeFileExtension(cacheFilePath, EXTNAME_ABC); + if (!fs.existsSync(cacheFilePath) || !fs.existsSync(cacheAbcFilePath)) { + throw Error(`ArkTS:ERROR ${cacheFilePath} or ${cacheAbcFilePath} is lost`); + } + const hashCacheFileContentData: any = toHashData(cacheFilePath); + const hashCacheAbcContentData: any = toHashData(cacheAbcFilePath); + this.hashJsonObject[cacheFilePath] = hashCacheFileContentData; + this.hashJsonObject[cacheAbcFilePath] = hashCacheAbcContentData; + } + + fs.writeFileSync(this.hashJsonFilePath, JSON.stringify(this.hashJsonObject), 'utf-8'); + } + + private copyFileFromCachePathToOutputPath() { + for (const value of this.intermediateJsBundle.values()) { + const abcFilePath: string = changeFileExtension(value.filePath, EXTNAME_ABC, TEMP_JS); + const cacheAbcFilePath: string = changeFileExtension(value.cacheFilePath, EXTNAME_ABC); + if (!fs.existsSync(cacheAbcFilePath)) { + throw Error(`ArkTS:ERROR ${cacheAbcFilePath} is lost`); + } + const parent: string = path.join(abcFilePath, '..'); + if (!(fs.existsSync(parent) && fs.statSync(parent).isDirectory())) { + mkDir(parent); + } + // for preview mode, cache path and old abc file both exist, should copy abc file for updating + if (this.projectConfig.cachePath !== undefined) { + fs.copyFileSync(cacheAbcFilePath, abcFilePath); + } + } + } + + private cleanCacheFiles() { + // in xts mode, as cache path is not provided, cache files are located in output path, clear them + if (this.projectConfig.cachePath !== undefined) { + return; + } + + for (const value of this.intermediateJsBundle.values()) { + if (fs.existsSync(value.cacheFilePath)) { + fs.unlinkSync(value.cacheFilePath); + } + } + + if (isEs2Abc(this.projectConfig) && fs.existsSync(this.filesInfoPath)) { + unlinkSync(this.filesInfoPath); + } + } + + private cleanInfo() { + this.intermediateJsBundle.clear(); + this.filterIntermediateJsBundle = []; + this.hashJsonObject = {}; + } +} diff --git a/compiler/src/fast_build/ark_compiler/bundle/bundle_preview_mode.ts b/compiler/src/fast_build/ark_compiler/bundle/bundle_preview_mode.ts new file mode 100644 index 0000000..bac0fd7 --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/bundle/bundle_preview_mode.ts @@ -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. + */ + +import { BundleMode } from './bundle_mode'; + +export class BundlePreviewMode extends BundleMode { + constructor(rollupObject: any, rollupBundleFileSet: any) { + super(rollupObject, rollupBundleFileSet); + } + + generateAbc() { + if (this.filterIntermediateJsBundle.length === 0) { + return; + } + super.executeArkCompiler(); + } +} diff --git a/compiler/src/fast_build/ark_compiler/common/ark_define.ts b/compiler/src/fast_build/ark_compiler/common/ark_define.ts new file mode 100644 index 0000000..7ba9ffe --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/common/ark_define.ts @@ -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. + */ + +export const ENTRY_TXT: string = 'entry.txt'; +export const FILESINFO_TXT: string = 'filesInfo.txt'; +export const FILESINFO: string = 'filesInfo'; +export const NPMENTRIES_TXT: string = 'npmEntries.txt'; +export const MODULES_CACHE: string = 'modules.cache'; +export const MODULES_ABC: string = 'modules.abc'; +export const MODULELIST_JSON: string = 'moduleList.json'; +export const PREBUILDMODE_JSON: string = 'preBuildMode.json'; +export const SOURCEMAPS_JSON: string = 'sourceMaps.json'; +export const SOURCEMAPS: string = 'sourceMaps.map'; +export const PROTO_FILESINFO_TXT: string = 'protoFilesInfo.txt'; +export const NPM_ENTRIES_PROTO_BIN: string = 'npm_entries.protoBin'; +export const PACKAGE_JSON: string = 'package.json'; +export const FAKE_JS: string = 'fake.js'; + +export const ESMODULE: string = 'esmodule'; +export const JSBUNDLE: string = 'jsbundle'; +export const ARK: string = 'ark'; +export const TEMPORARY: string = 'temporary'; +export const MAIN: string = 'main'; +export const AUXILIARY: string = 'auxiliary'; +export const HAP_PACKAGE: string = '0'; +export const PROJECT_PACKAGE: string = '1'; +export const EXTNAME_ETS: string = '.ets'; +export const EXTNAME_JS: string = '.js'; +export const EXTNAME_TS: string = '.ts'; +export const EXTNAME_JS_MAP: string = '.js.map'; +export const EXTNAME_TS_MAP: string = '.ts.map'; +export const EXTNAME_MJS: string = '.mjs'; +export const EXTNAME_CJS: string = '.cjs'; +export const EXTNAME_D_TS: string = '.d.ts'; +export const EXTNAME_ABC: string = '.abc'; +export const EXTNAME_JSON: string = '.json'; +export const EXTNAME_PROTO_BIN: string = '.protoBin'; +export const PATCH_SYMBOL_TABLE: string = 'symbol.txt'; +export const TEMP_JS: string = '.temp.js'; +export const HASH_FILE_NAME: string = 'gen_hash.json'; +export const EXTNAME_TXT: string = '.txt'; +export const PROTOS: string = 'protos'; + +export const TS2ABC: string = 'ts2abc'; +export const ES2ABC: string = 'es2abc'; + +export const MAX_WORKER_NUMBER: number = 3; + +export const GEN_ABC_SCRIPT: string = 'gen_abc.js'; + +export const NODE_MODULES: string = 'node_modules'; +export const TS_NOCHECK: string = '// @ts-nocheck'; + +export const WINDOWS: string = 'Windows_NT'; +export const LINUX: string = 'Linux'; +export const MAC: string = 'Darwin'; + +export const COMMONJS: string = 'commonjs'; +export const ESM: string = 'esm'; +export const SCRIPT: string = 'script'; + +export const SRC_MAIN: string = 'src/main'; +export const GEN_ABC_PLUGIN_NAME: string = 'Gen_Abc_Plugin'; diff --git a/compiler/src/fast_build/ark_compiler/common/common_mode.ts b/compiler/src/fast_build/ark_compiler/common/common_mode.ts new file mode 100644 index 0000000..3f77fdc --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/common/common_mode.ts @@ -0,0 +1,113 @@ +/* + * 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 'fs'; +import path from 'path'; + +import { + HASH_FILE_NAME, + GEN_ABC_PLUGIN_NAME, + GEN_ABC_SCRIPT +} from './ark_define'; +import { initArkConfig } from './process_ark_config'; +import { blue, reset } from '../../common/common_define'; +import { + compareNodeVersion, + mkdirsSync, + validateFilePathLength +} from '../../../utils'; +import { isEs2Abc, isTs2Abc } from '../../../ark_utils'; +import { + genTemporaryModuleCacheDirectoryForBundle +} from '../utils'; + +export class CommonMode { + projectConfig: any; + arkConfig: any; + cmdArgs: string[] = []; + logger: any; + hashJsonFilePath: string; + genAbcScriptPath: string; + asyncHandler: any; + signalHandler: any; + + constructor(rollupObject: any) { + this.projectConfig = Object.assign(rollupObject.share.arkProjectConfig, rollupObject.share.projectConfig); + this.arkConfig = initArkConfig(this.projectConfig); + this.cmdArgs = this.initCmdEnv(); + this.logger = rollupObject.share.getLogger(GEN_ABC_PLUGIN_NAME); + this.hashJsonFilePath = this.genHashJsonFilePath(); + this.genAbcScriptPath = path.resolve(__dirname, GEN_ABC_SCRIPT); + this.asyncHandler = rollupObject.async; + this.signalHandler = rollupObject.signal; + } + + private initCmdEnv() { + let args: string[] = []; + + if (isTs2Abc(this.projectConfig)) { + let ts2abc: string = this.arkConfig.ts2abcPath; + validateFilePathLength(ts2abc, this.logger); + + ts2abc = '"' + ts2abc + '"'; + args = [`${this.arkConfig.nodePath}`, '--expose-gc', ts2abc]; + if (this.arkConfig.isDebug) { + args.push('--debug'); + } + } else if (isEs2Abc(this.projectConfig)) { + const es2abc: string = this.arkConfig.es2abcPath; + validateFilePathLength(es2abc, this.logger); + + args = ['"' + es2abc + '"']; + if (this.arkConfig.isDebug) { + args.push('--debug-info'); + } + } else { + throw Error('ArkTS:ERROR please set panda mode'); + } + + return args; + } + + private genHashJsonFilePath() { + if (this.projectConfig.cachePath) { + if (!fs.existsSync(this.projectConfig.cachePath) || !fs.statSync(this.projectConfig.cachePath).isDirectory()) { + this.logger.debug(blue, `ArkTS:WARN cache path does bit exist or is not directory`, reset); + return ''; + } + const hashJsonPath: string = path.join(genTemporaryModuleCacheDirectoryForBundle(this.projectConfig), HASH_FILE_NAME); + validateFilePathLength(hashJsonPath, this.logger); + mkdirsSync(path.dirname(hashJsonPath)); + return hashJsonPath; + } else { + this.logger.debug(blue, `ArkTS:WARN cache path not specified`, reset); + return ''; + } + } + + setupCluster(cluster: any): void { + if (compareNodeVersion()) { + cluster.setupPrimary({ + exec: this.genAbcScriptPath, + windowsHide: true + }); + } else { + cluster.setupMaster({ + exec: this.genAbcScriptPath, + windowsHide: true + }); + } + } +} diff --git a/compiler/src/fast_build/ark_compiler/common/gen_abc.ts b/compiler/src/fast_build/ark_compiler/common/gen_abc.ts new file mode 100644 index 0000000..6b4ba68 --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/common/gen_abc.ts @@ -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. + */ + +import childProcess from 'child_process'; +import cluster from 'cluster'; +import fs from 'fs'; +import path from 'path'; +import process from 'process'; + +import { + COMMONJS, + ESM, + ESMODULE, + EXTNAME_ABC, + JSBUNDLE +} from './ark_define'; +import { changeFileExtension} from '../utils'; +import { FAIL, SUCCESS } from '../../common/common_define'; + +function genAbcByWorkersOfBundleMode(jsonInput: string, cmd: string): Promise { + const inputPaths: any = JSON.parse(jsonInput); + for (let i = 0; i < inputPaths.length; ++i) { + const cacheFilePath: string = inputPaths[i].cacheFilePath; + const cacheAbcFilePath: string = changeFileExtension(cacheFilePath, EXTNAME_ABC); + const sourceFile: string = inputPaths[i].sourceFile; + const singleCmd: any = `${cmd} "${cacheFilePath}" -o "${cacheAbcFilePath}" --source-file "${sourceFile}"`; + try { + // TODO: check syntax error? + childProcess.execSync(singleCmd); + } catch (e) { + process.exit(FAIL); + } + } + + return; +} + +function genAbcByWorkersOfModuleMode(jsonInput: string, cmd: string, workerFileName: string, + cachePath: string): Promise { + const inputPaths: any = JSON.parse(jsonInput); + const filePath: string = path.join(cachePath, workerFileName); + let content: string = ''; + for (let i = 0; i < inputPaths.length; ++i) { + const info: any = inputPaths[i]; + const moduleType: string = info.isCommonJs ? COMMONJS : ESM; + content += `${info.cacheFilePath};${info.recordName};${moduleType};${info.sourceFile};${info.packageName}`; + if (i < inputPaths.length - 1) { + content += '\n'; + } + } + fs.writeFileSync(filePath, content, 'utf-8'); + // cmd `${cmd} --input-file xx --output-proto --merge-abc` + const singleCmd: any = `${cmd} "${filePath}"`; + try { + childProcess.execSync(singleCmd); + } catch (e) { + process.exit(FAIL); + } + + return; +} + +if (cluster.isWorker && process.env['inputs'] !== undefined && process.env['cmd'] !== undefined && + process.env['mode'] !== undefined) { + if (process.env['mode'] === JSBUNDLE) { + genAbcByWorkersOfBundleMode(process.env['inputs'], process.env['cmd']); + process.exit(SUCCESS); + } else if (process.env['mode'] === ESMODULE && process.env['workerFileName'] && process.env['cachePath']) { + genAbcByWorkersOfModuleMode(process.env['inputs'], process.env['cmd'], process.env['workerFileName'], + process.env['cachePath']); + process.exit(SUCCESS); + } else { + process.exit(FAIL); + } +} diff --git a/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts b/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts new file mode 100644 index 0000000..15bf5c3 --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts @@ -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. + */ + +import path from 'path'; +import fs from 'fs'; + +import { + TS2ABC, + ESMODULE +} from './ark_define'; +import { DEBUG } from '../../common/common_define'; +import { + isLinux, + isMac, + isWindows +} from '../../../utils'; +import { getArkBuildDir } from '../../../ark_utils'; +import { projectConfig as mainProjectConfig } from '../../../../main'; + +type ArkConfig = { + arkRootPath: string; + ts2abcPath: string; + js2abcPath: string; + mergeAbcPath: string; + es2abcPath: string; + aotCompilerPath: string; + nodePath: string; + isDebug: boolean; +}; + +let arkConfig: ArkConfig = {}; + +export function initArkConfig(projectConfig: any) { + let arkRootPath: string = path.join(__dirname, '..', '..', '..', '..', 'bin', 'ark'); + if (projectConfig.arkFrontendDir) { + arkRootPath = projectConfig.arkFrontendDir; + } + arkConfig.nodePath = 'node'; + if (projectConfig.nodeJs) { + arkConfig.nodePath = projectConfig.nodePath; + } + processPlatformInfo(arkRootPath); + processCompatibleVersion(projectConfig, arkRootPath); + arkConfig.isDebug = projectConfig.buildMode.toLowerCase() === DEBUG; + arkConfig.arkRootPath = arkRootPath; + + return arkConfig; +} + +export function initArkProjectConfig(projectConfig) { + let arkProjectConfig: any = {}; + if (projectConfig.aceBuildJson && fs.existsSync(projectConfig.aceBuildJson)) { + const buildJsonInfo = JSON.parse(fs.readFileSync(projectConfig.aceBuildJson).toString()); + arkProjectConfig.projectRootPath = buildJsonInfo.projectRootPath; + arkProjectConfig.modulePathMap = buildJsonInfo.modulePathMap; + arkProjectConfig.isOhosTest = buildJsonInfo.isOhosTest; + arkProjectConfig.aotMode = buildJsonInfo.aotMode; + if (arkProjectConfig.aotMode && projectConfig.compileMode === ESMODULE) { + arkProjectConfig.processTs = true; + arkProjectConfig.pandaMode = TS2ABC; + arkProjectConfig.anBuildMode = buildJsonInfo.anBuildMode || 'type'; + arkProjectConfig.anBuildOutPut = buildJsonInfo.anBuildOutPut; + } else { + arkProjectConfig.processTs = false; + arkProjectConfig.pandaMode = buildJsonInfo.pandaMode; + } + arkProjectConfig.buildArkMode = projectConfig.buildMode; + if (buildJsonInfo.compileMode === ESMODULE) { + arkProjectConfig.nodeModulesPath = buildJsonInfo.nodeModulesPath; + arkProjectConfig.harNameOhmMap = buildJsonInfo.harNameOhmMap; + } + } + if (projectConfig.aceModuleJsonPath && fs.existsSync(projectConfig.aceModuleJsonPath)) { + const moduleJsonInfo = JSON.parse(fs.readFileSync(projectConfig.aceModuleJsonPath).toString()); + arkProjectConfig.minPlatformVersion = moduleJsonInfo.app.minPlatformVersion; + if (moduleJsonInfo.module) { + arkProjectConfig.moduleName = moduleJsonInfo.module.name; + } + if (moduleJsonInfo.app) { + arkProjectConfig.bundleName = moduleJsonInfo.app.bundleName; + } + } + + // Hotreload attributes are initialized by arkui in main.js, just copy them. + arkProjectConfig.hotReload = mainProjectConfig.hotReload; + arkProjectConfig.patchAbcPath = mainProjectConfig.patchAbcPath; + arkProjectConfig.changedFileList = mainProjectConfig.changedFileList; + + return arkProjectConfig; +} + +function processPlatformInfo(arkRootPath: string): void { + const arkPlatformPath: string = getArkBuildDir(arkRootPath); + if (isWindows()) { + arkConfig.es2abcPath = path.join(arkPlatformPath, 'bin', 'es2abc.exe'); + arkConfig.ts2abcPath = path.join(arkPlatformPath, 'src', 'index.js'); + arkConfig.mergeAbcPath = path.join(arkPlatformPath, 'bin', 'merge_abc.exe'); + arkConfig.js2abcPath = path.join(arkPlatformPath, 'bin', 'js2abc.exe'); + arkConfig.aotCompilerPath = path.join(arkPlatformPath, 'bin', 'ark_aot_compiler.exe'); + return; + } + if (isLinux() || isMac()) { + arkConfig.es2abcPath = path.join(arkPlatformPath, 'bin', 'es2abc'); + arkConfig.ts2abcPath = path.join(arkPlatformPath, 'src', 'index.js'); + arkConfig.mergeAbcPath = path.join(arkPlatformPath, 'bin', 'merge_abc'); + arkConfig.js2abcPath = path.join(arkPlatformPath, 'bin', 'js2abc '); + arkConfig.aotCompilerPath = path.join(arkPlatformPath, 'bin', 'ark_aot_compiler'); + return; + } +} + +function processCompatibleVersion(projectConfig: any, arkRootPath: string) { + const platformPath: string = getArkBuildDir(arkRootPath); + if (projectConfig.minPlatformVersion === '8') { + arkConfig.ts2abcPath = path.join(platformPath, 'legacy_api8', 'src', 'index.js'); + // for api 8 + projectConfig.pandaMode = TS2ABC; + } +} diff --git a/compiler/src/fast_build/ark_compiler/generate_bundle_abc.ts b/compiler/src/fast_build/ark_compiler/generate_bundle_abc.ts new file mode 100644 index 0000000..fc2adfc --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/generate_bundle_abc.ts @@ -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 { JSBUNDLE } from './common/ark_define'; +import { BundlePreviewMode } from './bundle/bundle_preview_mode'; +import { BundleBuildMode } from './bundle/bundle_build_mode'; + +/** + * rollup generatebundle hook + * @param {rollup OutputOptions} options + * @param {rollup [fileName: string]: AssetInfo | ChunkInfo} bundle + * @param {boolean} isWrite + */ +export function generateBundleAbc(options: any, bundle: any, isWrite: boolean) { + if (bundle === null || this.share.projectConfig.compileMode !== JSBUNDLE) { + return; + } + + generateAbc(this, bundle); + + return; +} + +function generateAbc(rollupObject: any, rollupBundleFileSet: any) { + if (rollupObject.share.projectConfig.watchMode === 'true') { + const bundlePreviewMode: BundlePreviewMode = new BundlePreviewMode(rollupObject, rollupBundleFileSet); + bundlePreviewMode.generateAbc(); + } else { + const bundleBuildMode: BundleBuildMode = new BundleBuildMode(rollupObject, rollupBundleFileSet); + bundleBuildMode.generateAbc(); + } +} diff --git a/compiler/src/fast_build/ark_compiler/generate_module_abc.ts b/compiler/src/fast_build/ark_compiler/generate_module_abc.ts new file mode 100644 index 0000000..a9aaee9 --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/generate_module_abc.ts @@ -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 { ESMODULE } from './common/ark_define'; +import { ModuleBuildMode } from './module/module_build_mode'; +import { ModuleHotfixMode } from './module/module_hotfix_mode'; +import { ModuleHotreloadMode } from './module/module_hotreload_mode'; +import { ModulePreviewMode } from './module/module_preview_mode'; +import { ModuleSourceFile } from './module/module_source_file'; + +export function generateModuleAbc(error) { + // compileHar: compile closed har of project + // compileShared: compile shared har of project + if (this.share.projectConfig.compileHar) { + return; + } + if (this.share.projectConfig.compileMode === ESMODULE) { + ModuleSourceFile.processModuleSourceFiles(this); + generateAbc(this); + } + + return; +} + +function generateAbc(rollupObject: any) { + if (rollupObject.share.projectConfig.watchMode !== 'true') { + const moduleBuildMode: ModuleBuildMode = new ModuleBuildMode(rollupObject); + moduleBuildMode.generateAbc(rollupObject); + } else if (rollupObject.share.arkProjectConfig.hotReload) { + const moduleHotreloadMode: ModuleHotreloadMode = new ModuleHotreloadMode(rollupObject); + moduleHotreloadMode.generateAbc(rollupObject); + } else if (rollupObject.share.arkProjectConfig.hotFix) { + const moduleHotfixMode: ModuleHotfixMode = new ModuleHotfixMode(rollupObject); + moduleHotfixMode.generateAbc(rollupObject); + } else { + const modulePreviewMode: ModulePreviewMode = new ModulePreviewMode(rollupObject); + modulePreviewMode.generateAbc(rollupObject); + } +} diff --git a/compiler/src/fast_build/ark_compiler/load.ts b/compiler/src/fast_build/ark_compiler/load.ts new file mode 100644 index 0000000..e359f1c --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/load.ts @@ -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 fs from 'fs'; + +import { + ESMODULE, + EXTNAME_CJS, + EXTNAME_JS, + EXTNAME_JSON, + EXTNAME_MJS, +} from './common/ark_define'; +import { initArkProjectConfig } from './common/process_ark_config'; +import { ModuleSourceFile } from "./module/module_source_file"; +import { isSpecifiedExt } from './utils'; + +/** + * rollup load hook + * @param {string } id + */ +export function load(id: string) { + this.share.arkProjectConfig = initArkProjectConfig(this.share.projectConfig); + if (this.share.projectConfig.compileMode === ESMODULE) { + preserveJsAndJsonSourceContent(id); + } +} + +function preserveJsAndJsonSourceContent(sourceFilePath: string) { + if (isSpecifiedExt(sourceFilePath, EXTNAME_JS) || isSpecifiedExt(sourceFilePath, EXTNAME_MJS) || + isSpecifiedExt(sourceFilePath, EXTNAME_CJS) || isSpecifiedExt(sourceFilePath, EXTNAME_JSON)) { + ModuleSourceFile.newSourceFile(sourceFilePath, fs.readFileSync(sourceFilePath).toString()); + } + + return; +} diff --git a/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts b/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts new file mode 100644 index 0000000..d3aadfc --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts @@ -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. + */ + +import { generateBundleAbc } from './generate_bundle_abc'; +import { generateModuleAbc } from './generate_module_abc'; +import { load } from './load'; +import { transformForModule } from './transform'; + +export function genAbc() { + return { + name: 'genAbc', + load: load, + transform: transformForModule, + buildEnd: generateModuleAbc, + generateBundle: generateBundleAbc + }; +} + diff --git a/compiler/src/fast_build/ark_compiler/transform.ts b/compiler/src/fast_build/ark_compiler/transform.ts new file mode 100644 index 0000000..04ae70e --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/transform.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 path from 'path'; + +import { DEBUG } from '../common/common_define'; +import { + EXTNAME_JS, + EXTNAME_MJS, + EXTNAME_CJS, + ESMODULE, + EXTNAME_ETS, + EXTNAME_TS +} from './common/ark_define'; +import { ModuleSourceFile } from "./module/module_source_file"; +import { isSpecifiedExt } from './utils'; +import { toUnixPath } from '../../utils'; + +export let newSourceMaps: Object = {}; + +/** + * rollup transform hook + * @param {string} code + * @param {string} id + */ +export function transformForModule(code: string, id: string) { + if (this.share.projectConfig.compileMode === ESMODULE) { + const projectConfig: any = Object.assign(this.share.arkProjectConfig, this.share.projectConfig); + preserveTsAndEtsSourceContent(id, code); + preserveSourceMap(id, this.getCombinedSourcemap(), projectConfig); + } +} + +function preserveTsAndEtsSourceContent(sourceFilePath: string, code: string): void { + if (isSpecifiedExt(sourceFilePath, EXTNAME_ETS) || isSpecifiedExt(sourceFilePath, EXTNAME_TS)) { + ModuleSourceFile.newSourceFile(sourceFilePath, code); + } +} + +function preserveSourceMap(sourceFilePath: string, sourcemap: any, projectConfig: any): void { + if (projectConfig.buildArkMode.toLowerCase() !== DEBUG) { + return; + } + + if (sourceFilePath.includes('\x00') || isSpecifiedExt(sourceFilePath, EXTNAME_JS) || + isSpecifiedExt(sourceFilePath, EXTNAME_MJS) || isSpecifiedExt(sourceFilePath, EXTNAME_CJS)) { + // skip automatic generated files like 'jsfile.js?commonjs-exports' + // skip js/cjs/mjs file sourcemap + return; + } + + sourcemap['sources'] = toUnixPath(sourceFilePath.replace(projectConfig.projectRootPath + path.sep, '')); + newSourceMaps[toUnixPath(sourceFilePath.replace(projectConfig.projectRootPath + path.sep, ''))] = sourcemap; +} diff --git a/compiler/src/fast_build/ark_compiler/utils.ts b/compiler/src/fast_build/ark_compiler/utils.ts new file mode 100644 index 0000000..8c583a1 --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/utils.ts @@ -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 cluster from 'cluster'; +import fs from 'fs'; +import path from 'path'; +import os from 'os'; + +import { DEBUG } from '../common/common_define'; +import { + ESMODULE, + EXTNAME_ETS, + EXTNAME_JS, + EXTNAME_TS, + EXTNAME_JSON, + EXTNAME_CJS, + EXTNAME_MJS, + NODE_MODULES, + TEMPORARY +} from './common/ark_define'; +import { + compareNodeVersion, + mkdirsSync, + toUnixPath, + validateFilePathLength +} from '../../utils'; +import { + genBuildPath, + genTemporaryPath, + transformModuleSpecifier, + writeMinimizedSourceCode +} from '../../ark_utils'; +import { processSystemApi } from '../../validate_ui_syntax'; + +export function isAotMode(projectConfig: any): boolean { + return projectConfig.compileMode === ESMODULE && ( + projectConfig.anBuildMode === 'full' || projectConfig.anBuildMode === 'pgo' + ); +} + +export function isMasterOrPrimary() { + return ((compareNodeVersion() && cluster.isPrimary) || (!compareNodeVersion() && cluster.isMaster)); +} + +export function changeFileExtension(file: string, targetExt: string, originExt = ''): string { + let basename: string = originExt.length == 0 ? path.basename(file, path.extname(file)) : + path.basename(file, originExt); + return path.join(path.dirname(file), basename + targetExt); +} + +export function writeFileContentToTempDir(id: string, content: string, projectConfig: any, logger: any) { + if (id.includes('\x00')) { + // skip automatic generated files like 'jsfile.js?commonjs-exports' + return; + } + + let filePath: string = genTemporaryPath(id, projectConfig.projectPath, projectConfig.cachePath, projectConfig); + + if (projectConfig.compileHar) { + filePath = genTemporaryPath(id, + projectConfig.compileShared ? projectConfig.projectRootPath : projectConfig.moduleRootPath, + path.resolve(projectConfig.buildPath, projectConfig.compileShared ? '../etsFortgz' : ''), projectConfig, true); + } + + if (filePath.length === 0) { + return; + } + + switch (path.extname(id)) { + case EXTNAME_ETS: + case EXTNAME_TS: + case EXTNAME_JS: + case EXTNAME_MJS: + case EXTNAME_CJS: + writeFileContent(id, filePath, content, projectConfig, logger); + break; + case EXTNAME_JSON: + fs.writeFileSync(filePath, content, 'utf-8'); + break; + default: + break; + } +} + +function writeFileContent(sourceFilePath: string, filePath: string, content: string, projectConfig: any, logger: any) { + if (!isSpecifiedExt(sourceFilePath, EXTNAME_JS)) { + filePath = changeFileExtension(filePath, EXTNAME_JS); + } + + transformModuleSpecifier(sourceFilePath, processSystemApi(content, true), projectConfig); + + mkdirsSync(path.dirname(filePath)); + + if (projectConfig.compileHar && projectConfig.obfuscateHarType === 'uglify') { + writeMinimizedSourceCode(content, filePath, logger); + return; + } + + if (projectConfig.buildArkMode.toLowerCase() === DEBUG) { + fs.writeFileSync(filePath, content, 'utf-8'); + return; + } + + writeMinimizedSourceCode(content, filePath, logger); +} + +export function getNodeModulesFilePackageName(projectConfig: any, pkgPath: string) { + const buildPackagePath: string = genBuildPath(pkgPath, projectConfig.projectPath, projectConfig.aceModuleBuild, + projectConfig); + + return toUnixPath(path.join(NODE_MODULES, toUnixPath(buildPackagePath.replace(projectConfig.nodeModulesPath, '')))); +} + +export function getEs2abcFileThreadNumber(): number { + const fileThreads : number = os.cpus().length < 16 ? os.cpus().length : 16; + return fileThreads; +} + +export function isCommonJsPluginVirtualFile(filePath: string): boolean { + // rollup uses commonjs plugin to handle commonjs files, + // which will automatic generate files like 'jsfile.js?commonjs-exports' + return filePath.includes('\x00'); +} + +export function isCurrentProjectFiles(filePath: string, projectConfig: any): boolean { + let modulePath: string = projectConfig.modulePathMap[projectConfig.moduleName]; + return filePath.indexOf(projectConfig.projectPath) >= 0 || + filePath.indexOf(path.join(projectConfig.projectRootPath, NODE_MODULES)) >= 0 || + filePath.indexOf(path.join(modulePath, NODE_MODULES)) >= 0; +} + +export function genTemporaryModuleCacheDirectoryForBundle(projectConfig: any) { + const buildDirArr: string[] = projectConfig.aceModuleBuild.split(path.sep); + const abilityDir: string = buildDirArr[buildDirArr.length - 1]; + const temporaryModuleCacheDirPath: string = path.join(projectConfig.cachePath, TEMPORARY, abilityDir); + mkdirsSync(temporaryModuleCacheDirPath); + + return temporaryModuleCacheDirPath; +} + +export function isSpecifiedExt(filePath: string, fileExtendName: string) { + return path.extname(filePath) === fileExtendName; +} + +export function genCachePath(tailName: string, projectConfig: any, logger: any): string { + const pathName: string = projectConfig.cachePath !== undefined ? + path.join(projectConfig.cachePath, TEMPORARY, tailName) : path.join(projectConfig.aceModuleBuild, tailName); + mkdirsSync(path.dirname(pathName)); + + validateFilePathLength(pathName, logger); + return pathName; +} -- Gitee From c001c09faa372ac77c41e78efd0f84f6cd829ec0 Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Sun, 29 Jan 2023 17:43:40 +0800 Subject: [PATCH 327/379] Implement rollup module mode Signed-off-by: chenqy930 --- compiler/src/ark_utils.ts | 110 +--- .../ark_compiler/bundle/bundle_build_mode.ts | 2 +- .../ark_compiler/bundle/bundle_mode.ts | 13 +- .../ark_compiler/common/ark_define.ts | 14 + .../ark_compiler/common/common_mode.ts | 5 +- .../fast_build/ark_compiler/common/gen_abc.ts | 5 +- .../ark_compiler/common/process_ark_config.ts | 6 +- .../ark_compiler/generate_bundle_abc.ts | 2 - .../ark_compiler/generate_module_abc.ts | 5 +- compiler/src/fast_build/ark_compiler/load.ts | 23 +- .../ark_compiler/module/module_build_mode.ts | 44 ++ .../ark_compiler/module/module_hotfix_mode.ts | 74 +++ .../module/module_hotreload_mode.ts | 106 ++++ .../ark_compiler/module/module_mode.ts | 533 ++++++++++++++++++ .../module/module_preview_mode.ts | 43 ++ .../ark_compiler/module/module_source_file.ts | 152 +++++ .../src/fast_build/ark_compiler/transform.ts | 34 +- compiler/src/fast_build/ark_compiler/utils.ts | 39 +- compiler/src/process_module_files.ts | 120 ++++ compiler/src/process_ui_syntax.ts | 9 +- compiler/src/utils.ts | 1 + 21 files changed, 1169 insertions(+), 171 deletions(-) create mode 100644 compiler/src/fast_build/ark_compiler/module/module_build_mode.ts create mode 100644 compiler/src/fast_build/ark_compiler/module/module_hotfix_mode.ts create mode 100644 compiler/src/fast_build/ark_compiler/module/module_hotreload_mode.ts create mode 100644 compiler/src/fast_build/ark_compiler/module/module_mode.ts create mode 100644 compiler/src/fast_build/ark_compiler/module/module_preview_mode.ts create mode 100644 compiler/src/fast_build/ark_compiler/module/module_source_file.ts create mode 100644 compiler/src/process_module_files.ts diff --git a/compiler/src/ark_utils.ts b/compiler/src/ark_utils.ts index 0fb23cd..0afc04f 100644 --- a/compiler/src/ark_utils.ts +++ b/compiler/src/ark_utils.ts @@ -14,15 +14,12 @@ */ import path from 'path'; -import ts from 'typescript'; import fs from 'fs'; import { minify, MinifyOutput } from 'terser'; import { NODE_MODULES, TEMPORARY, - MAIN, - AUXILIARY, ZERO, ONE, EXTNAME_JS, @@ -38,7 +35,6 @@ import { TS2ABC, ES2ABC, EXTNAME_PROTO_BIN, - TS_NOCHECK } from './pre_define'; import { isMac, @@ -50,7 +46,6 @@ import { toUnixPath, validateFilePathLength } from './utils'; -import { processSystemApi } from './validate_ui_syntax'; const red: string = '\u001b[31m'; const reset: string = '\u001b[39m'; @@ -97,88 +92,6 @@ export function getOhmUrlByFilepath(filePath: string, projectConfig: any, logger return filePath; } -export function writeFileSyncByNode(node: ts.SourceFile, toTsFile: boolean, projectConfig: any): void { - if (toTsFile) { - const newStatements: ts.Node[] = []; - const tsIgnoreNode: ts.Node = ts.factory.createExpressionStatement(ts.factory.createIdentifier(TS_NOCHECK)); - newStatements.push(tsIgnoreNode); - if (node.statements && node.statements.length) { - newStatements.push(...node.statements); - } - - node = ts.factory.updateSourceFile(node, newStatements); - } - const mixedInfo: {content: string, sourceMapJson: any} = genContentAndSourceMapInfo(node, toTsFile, projectConfig); - let temporaryFile: string = genTemporaryPath(node.fileName, projectConfig.projectPath, process.env.cachePath, - projectConfig); - if (temporaryFile.length === 0) { - return; - } - let temporarySourceMapFile: string = ''; - if (temporaryFile.endsWith(EXTNAME_ETS)) { - if (toTsFile) { - temporaryFile = temporaryFile.replace(/\.ets$/, EXTNAME_TS); - } else { - temporaryFile = temporaryFile.replace(/\.ets$/, EXTNAME_JS); - } - temporarySourceMapFile = genSourceMapFileName(temporaryFile); - } else { - if (!toTsFile) { - temporaryFile = temporaryFile.replace(/\.ts$/, EXTNAME_JS); - temporarySourceMapFile = genSourceMapFileName(temporaryFile); - } - } - mkdirsSync(path.dirname(temporaryFile)); - if (temporarySourceMapFile.length > 0 && projectConfig.buildArkMode === 'debug') { - let source = toUnixPath(node.fileName).replace(toUnixPath(projectConfig.projectRootPath) + '/', ''); - newSourceMaps[source] = mixedInfo.sourceMapJson; - } - fs.writeFileSync(temporaryFile, mixedInfo.content); -} - -function genContentAndSourceMapInfo(node: ts.SourceFile, toTsFile: boolean, projectConfig: any): any { - const printer: ts.Printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); - const options: ts.CompilerOptions = { - sourceMap: true - }; - const mapOpions: any = { - sourceMap: true, - inlineSourceMap: false, - inlineSources: false, - sourceRoot: '', - mapRoot: '', - extendedDiagnostics: false - }; - const host: ts.CompilerHost = ts.createCompilerHost(options); - const fileName: string = node.fileName; - // @ts-ignore - const sourceMapGenerator: any = ts.createSourceMapGenerator( - host, - // @ts-ignore - ts.getBaseFileName(fileName), - '', - '', - mapOpions - ); - // @ts-ignore - const writer: any = ts.createTextWriter( - // @ts-ignore - ts.getNewLineCharacter({newLine: ts.NewLineKind.LineFeed, removeComments: false})); - printer['writeFile'](node, writer, sourceMapGenerator); - const sourceMapJson: any = sourceMapGenerator.toJSON(); - sourceMapJson['sources'] = [fileName.replace(toUnixPath(projectConfig.projectRootPath) + '/', '')]; - let content: string = writer.getText(); - if (toTsFile) { - content = content.replace(`${TS_NOCHECK};`, TS_NOCHECK); - } - content = transformModuleSpecifier(fileName, processSystemApi(content, true), projectConfig); - - return { - content: content, - sourceMapJson: sourceMapJson - }; -} - export function genSourceMapFileName(temporaryFile: string): string { let abcFile: string = temporaryFile; if (temporaryFile.endsWith(EXTNAME_TS)) { @@ -230,13 +143,11 @@ export function transformModuleSpecifier(sourcePath: string, sourceCode: string, }); } -function replaceHarDependency(item:string, moduleRequest: string, projectConfig: any): string { +export function getOhmUrlByHarName(moduleRequest: string, projectConfig: any): string | undefined { if (projectConfig.harNameOhmMap) { // case1: "@ohos/lib" ---> "@module:lib/ets/index" if (projectConfig.harNameOhmMap.hasOwnProperty(moduleRequest)) { - return item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { - return quotation + projectConfig.harNameOhmMap[moduleRequest] + quotation; - }); + return projectConfig.harNameOhmMap[moduleRequest]; } // case2: "@ohos/lib/src/main/ets/pages/page1" ---> "@module:lib/ets/pages/page1" for (const harName in projectConfig.harNameOhmMap) { @@ -244,16 +155,23 @@ function replaceHarDependency(item:string, moduleRequest: string, projectConfig: const harOhmName: string = projectConfig.harNameOhmMap[harName].substring(0, projectConfig.harNameOhmMap[harName].indexOf('/')); if (moduleRequest.indexOf(harName + '/' + SRC_MAIN) == 0) { - moduleRequest = moduleRequest.replace(harName + '/' + SRC_MAIN , harOhmName); + return moduleRequest.replace(harName + '/' + SRC_MAIN , harOhmName); } else { - moduleRequest = moduleRequest.replace(harName, harOhmName); + return moduleRequest.replace(harName, harOhmName); } - return item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { - return quotation + moduleRequest + quotation; - }); } } } + return undefined; +} + +function replaceHarDependency(item:string, moduleRequest: string, projectConfig: any): string { + const harOhmUrl: string | undefined = getOhmUrlByHarName(moduleRequest, projectConfig); + if (harOhmUrl !== undefined) { + return item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { + return quotation + harOhmUrl + quotation; + }); + } return item; } diff --git a/compiler/src/fast_build/ark_compiler/bundle/bundle_build_mode.ts b/compiler/src/fast_build/ark_compiler/bundle/bundle_build_mode.ts index 6a8dccf..139e591 100644 --- a/compiler/src/fast_build/ark_compiler/bundle/bundle_build_mode.ts +++ b/compiler/src/fast_build/ark_compiler/bundle/bundle_build_mode.ts @@ -22,7 +22,7 @@ export class BundleBuildMode extends BundleMode { generateAbc() { if (this.filterIntermediateJsBundle.length === 0) { - this.afterCompilationProcess(); + super.afterCompilationProcess(); return; } super.executeArkCompiler(); diff --git a/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts b/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts index a3ed551..79df7b9 100644 --- a/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts +++ b/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts @@ -33,13 +33,11 @@ import { FILESINFO_TXT, JSBUNDLE, MAX_WORKER_NUMBER, - TEMP_JS -} from '../common/ark_define'; -import { + TEMP_JS, blue, FAIL, reset -} from '../../common/common_define'; +} from '../common/ark_define'; import { mkDir, toHashData, @@ -158,7 +156,6 @@ export class BundleMode extends CommonMode { this.writeHashJson(); this.copyFileFromCachePathToOutputPath(); this.cleanCacheFiles(); - this.cleanInfo(); } private generateEs2AbcCmd(filesInfoPath: string) { @@ -372,10 +369,4 @@ export class BundleMode extends CommonMode { unlinkSync(this.filesInfoPath); } } - - private cleanInfo() { - this.intermediateJsBundle.clear(); - this.filterIntermediateJsBundle = []; - this.hashJsonObject = {}; - } } diff --git a/compiler/src/fast_build/ark_compiler/common/ark_define.ts b/compiler/src/fast_build/ark_compiler/common/ark_define.ts index 7ba9ffe..c4af92d 100644 --- a/compiler/src/fast_build/ark_compiler/common/ark_define.ts +++ b/compiler/src/fast_build/ark_compiler/common/ark_define.ts @@ -73,3 +73,17 @@ export const SCRIPT: string = 'script'; export const SRC_MAIN: string = 'src/main'; export const GEN_ABC_PLUGIN_NAME: string = 'Gen_Abc_Plugin'; + +export const SUCCESS: number = 0; +export const FAIL: number = 1; + +export const red: string = '\u001b[31m'; +export const yellow: string = '\u001b[33m'; +export const blue: string = '\u001b[34m'; +export const reset: string = '\u001b[39m'; + +export const DEBUG: string = 'debug'; +export const RELEASE: string = 'release'; + +export const TRUE: string = 'true'; +export const FALSE: string = 'false'; diff --git a/compiler/src/fast_build/ark_compiler/common/common_mode.ts b/compiler/src/fast_build/ark_compiler/common/common_mode.ts index 3f77fdc..73b3536 100644 --- a/compiler/src/fast_build/ark_compiler/common/common_mode.ts +++ b/compiler/src/fast_build/ark_compiler/common/common_mode.ts @@ -19,10 +19,11 @@ import path from 'path'; import { HASH_FILE_NAME, GEN_ABC_PLUGIN_NAME, - GEN_ABC_SCRIPT + GEN_ABC_SCRIPT, + blue, + reset } from './ark_define'; import { initArkConfig } from './process_ark_config'; -import { blue, reset } from '../../common/common_define'; import { compareNodeVersion, mkdirsSync, diff --git a/compiler/src/fast_build/ark_compiler/common/gen_abc.ts b/compiler/src/fast_build/ark_compiler/common/gen_abc.ts index 6b4ba68..da6fbe6 100644 --- a/compiler/src/fast_build/ark_compiler/common/gen_abc.ts +++ b/compiler/src/fast_build/ark_compiler/common/gen_abc.ts @@ -24,10 +24,11 @@ import { ESM, ESMODULE, EXTNAME_ABC, - JSBUNDLE + JSBUNDLE, + FAIL, + SUCCESS } from './ark_define'; import { changeFileExtension} from '../utils'; -import { FAIL, SUCCESS } from '../../common/common_define'; function genAbcByWorkersOfBundleMode(jsonInput: string, cmd: string): Promise { const inputPaths: any = JSON.parse(jsonInput); diff --git a/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts b/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts index 15bf5c3..108b4c7 100644 --- a/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts +++ b/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts @@ -20,7 +20,7 @@ import { TS2ABC, ESMODULE } from './ark_define'; -import { DEBUG } from '../../common/common_define'; +import { isDebug } from '../utils'; import { isLinux, isMac, @@ -53,7 +53,7 @@ export function initArkConfig(projectConfig: any) { } processPlatformInfo(arkRootPath); processCompatibleVersion(projectConfig, arkRootPath); - arkConfig.isDebug = projectConfig.buildMode.toLowerCase() === DEBUG; + arkConfig.isDebug = isDebug(projectConfig); arkConfig.arkRootPath = arkRootPath; return arkConfig; @@ -76,7 +76,7 @@ export function initArkProjectConfig(projectConfig) { arkProjectConfig.processTs = false; arkProjectConfig.pandaMode = buildJsonInfo.pandaMode; } - arkProjectConfig.buildArkMode = projectConfig.buildMode; + if (buildJsonInfo.compileMode === ESMODULE) { arkProjectConfig.nodeModulesPath = buildJsonInfo.nodeModulesPath; arkProjectConfig.harNameOhmMap = buildJsonInfo.harNameOhmMap; diff --git a/compiler/src/fast_build/ark_compiler/generate_bundle_abc.ts b/compiler/src/fast_build/ark_compiler/generate_bundle_abc.ts index fc2adfc..a498f9d 100644 --- a/compiler/src/fast_build/ark_compiler/generate_bundle_abc.ts +++ b/compiler/src/fast_build/ark_compiler/generate_bundle_abc.ts @@ -29,8 +29,6 @@ export function generateBundleAbc(options: any, bundle: any, isWrite: boolean) { } generateAbc(this, bundle); - - return; } function generateAbc(rollupObject: any, rollupBundleFileSet: any) { diff --git a/compiler/src/fast_build/ark_compiler/generate_module_abc.ts b/compiler/src/fast_build/ark_compiler/generate_module_abc.ts index a9aaee9..8b8f5a6 100644 --- a/compiler/src/fast_build/ark_compiler/generate_module_abc.ts +++ b/compiler/src/fast_build/ark_compiler/generate_module_abc.ts @@ -21,8 +21,7 @@ import { ModulePreviewMode } from './module/module_preview_mode'; import { ModuleSourceFile } from './module/module_source_file'; export function generateModuleAbc(error) { - // compileHar: compile closed har of project - // compileShared: compile shared har of project + // compileHar: compile closed source har of project, which convert .ets to .d.ts and js, dosen't emit abc. if (this.share.projectConfig.compileHar) { return; } @@ -30,8 +29,6 @@ export function generateModuleAbc(error) { ModuleSourceFile.processModuleSourceFiles(this); generateAbc(this); } - - return; } function generateAbc(rollupObject: any) { diff --git a/compiler/src/fast_build/ark_compiler/load.ts b/compiler/src/fast_build/ark_compiler/load.ts index e359f1c..efa4206 100644 --- a/compiler/src/fast_build/ark_compiler/load.ts +++ b/compiler/src/fast_build/ark_compiler/load.ts @@ -15,22 +15,20 @@ import fs from 'fs'; -import { - ESMODULE, - EXTNAME_CJS, - EXTNAME_JS, - EXTNAME_JSON, - EXTNAME_MJS, -} from './common/ark_define'; +import { ESMODULE } from './common/ark_define'; import { initArkProjectConfig } from './common/process_ark_config'; -import { ModuleSourceFile } from "./module/module_source_file"; -import { isSpecifiedExt } from './utils'; +import { ModuleSourceFile } from './module/module_source_file'; +import { + isJsonSourceFile, + isJsSourceFile +} from './utils'; /** * rollup load hook - * @param {string } id + * @param {string } id: absolute path of an input file */ export function load(id: string) { + // init ArkProjectConfig here since load is the first plugin of gen_abc_plugin this.share.arkProjectConfig = initArkProjectConfig(this.share.projectConfig); if (this.share.projectConfig.compileMode === ESMODULE) { preserveJsAndJsonSourceContent(id); @@ -38,10 +36,7 @@ export function load(id: string) { } function preserveJsAndJsonSourceContent(sourceFilePath: string) { - if (isSpecifiedExt(sourceFilePath, EXTNAME_JS) || isSpecifiedExt(sourceFilePath, EXTNAME_MJS) || - isSpecifiedExt(sourceFilePath, EXTNAME_CJS) || isSpecifiedExt(sourceFilePath, EXTNAME_JSON)) { + if (isJsSourceFile(sourceFilePath) || isJsonSourceFile(sourceFilePath)) { ModuleSourceFile.newSourceFile(sourceFilePath, fs.readFileSync(sourceFilePath).toString()); } - - return; } diff --git a/compiler/src/fast_build/ark_compiler/module/module_build_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_build_mode.ts new file mode 100644 index 0000000..eca5375 --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/module/module_build_mode.ts @@ -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 { ModuleMode } from './module_mode'; +import { isEs2Abc, isTs2Abc } from '../../../ark_utils'; + +export class ModuleBuildMode extends ModuleMode { + constructor(rollupObject: any) { + super(rollupObject); + } + + generateAbc(rollupObject: any) { + this.collectModuleFileList(rollupObject, rollupObject.getModuleIds()); + this.buildModuleSourceMapInfo(); + this.executeArkCompiler(); + } + + executeArkCompiler() { + if (isEs2Abc(this.projectConfig)) { + this.generateEs2AbcCmd(); + this.generateMergedAbcOfEs2Abc(); + } else if (isTs2Abc(this.projectConfig)) { + this.filterModulesByHashJson(); + const splittedModules: any[] = this.getSplittedModulesByNumber(); + this.generateTs2AbcCmd(); + this.invokeTs2AbcWorkersToGenProto(splittedModules); + this.processTs2abcWorkersToGenAbc(); + } else { + throw Error('ArkTS:ERROR please set panda mode'); + } + } +} diff --git a/compiler/src/fast_build/ark_compiler/module/module_hotfix_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_hotfix_mode.ts new file mode 100644 index 0000000..5452b55 --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/module/module_hotfix_mode.ts @@ -0,0 +1,74 @@ +/* + * 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 path from 'path'; + +import { ModuleMode } from './module_mode'; +import { PATCH_SYMBOL_TABLE } from '../common/ark_define'; +import { getEs2abcFileThreadNumber } from '../utils'; + +export class ModuleHotfixMode extends ModuleMode { + patch: boolean; + inOldSymbolTablePath: string; + enableMap: boolean; + + constructor(rollupObject: any) { + super(rollupObject); + this.patch = false; + this.inOldSymbolTablePath = ''; + this.enableMap = false; + } + + generateAbc(rollupObject: any) { + this.patch = this.projectConfig.patch || false; + this.inOldSymbolTablePath = this.projectConfig.inOldSymbolTablePath || this.projectConfig.projectRootPath; + this.enableMap = this.projectConfig.enableMap || false; + this.collectModuleFileList(rollupObject, rollupObject.getModuleIds()); + this.buildModuleSourceMapInfo(); + + this.generateEs2AbcCmdForHotfix(); + this.generateMergedAbcOfEs2Abc(); + } + + private generateEs2AbcCmdForHotfix() { + const fileThreads = getEs2abcFileThreadNumber();; + this.cmdArgs.push(`"@${this.filesInfoPath}"`); + this.cmdArgs.push('--npm-module-entry-list'); + this.cmdArgs.push(`"${this.npmEntriesInfoPath}"`); + this.cmdArgs.push('--output'); + this.cmdArgs.push(`"${this.moduleAbcPath}"`); + this.cmdArgs.push('--file-threads'); + this.cmdArgs.push(`"${fileThreads}"`); + + if (this.projectConfig.patch) { + const oldHapSymbolTable: string = path.join(this.projectConfig.inOldSymbolTablePath, PATCH_SYMBOL_TABLE); + this.cmdArgs.push('--input-symbol-table'); + this.cmdArgs.push(`"${oldHapSymbolTable}"`); + this.cmdArgs.push('--generate-patch'); + } + + if (!this.projectConfig.enableMap) { + this.cmdArgs.push('--cache-file'); + this.cmdArgs.push(`"${this.cacheFilePath}"`); + } else { + // when generating map, cache is forbiden to avoid uncomplete symbol table + const oldHapSymbolTable: string = path.join(this.projectConfig.inOldSymbolTablePath, PATCH_SYMBOL_TABLE); + this.cmdArgs.push('--dump-symbol-table'); + this.cmdArgs.push(`"${oldHapSymbolTable}"`); + } + + this.cmdArgs.push('--merge-abc'); + } +} diff --git a/compiler/src/fast_build/ark_compiler/module/module_hotreload_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_hotreload_mode.ts new file mode 100644 index 0000000..fa76ed7 --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/module/module_hotreload_mode.ts @@ -0,0 +1,106 @@ +/* + * 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 'fs'; +import path from 'path'; + +import { ModuleMode } from './module_mode'; +import { + blue, + reset, + MODULES_ABC, + SOURCEMAPS +} from '../common/ark_define'; +import { newSourceMaps } from '../transform'; +import { + mkdirsSync, + toUnixPath, + validateFilePathLength +} from '../../../utils'; + +let isFirstBuild: boolean = true; +let hotReloadSourceMap: Object = {}; + +export class ModuleHotreloadMode extends ModuleMode { + constructor(rollupObject: any) { + super(rollupObject); + } + + generateAbc(rollupObject: any) { + if (isFirstBuild) { + this.compileAllFiles(rollupObject); + isFirstBuild = false; + } else { + this.compileChangeListFiles(rollupObject); + } + } + + private compileAllFiles(rollupObject: any) { + this.collectModuleFileList(rollupObject, rollupObject.getModuleIds()); + this.buildModuleSourceMapInfo(); + this.generateAbcByEs2abc(); + } + + private compileChangeListFiles(rollupObject: any) { + if (!fs.existsSync(this.projectConfig.changedFileList)) { + this.logger.debug(blue, `ArkTS: Cannot find file: ${ + this.projectConfig.changedFileList}, skip hot reload build`, reset); + return; + } + + const changedFileListJson: string = fs.readFileSync(this.projectConfig.changedFileList).toString(); + const changedFileList: Array = JSON.parse(changedFileListJson).modifiedFiles; + if (typeof changedFileList === 'undefined' || changedFileList.length === 0) { + this.logger.debug(blue, `ArkTS: No changed files found, skip hot reload build`, reset); + return; + } + + if (!fs.existsSync(this.projectConfig.patchAbcPath)) { + mkdirsSync(this.projectConfig.patchAbcPath); + } + + this.updateSourceMapFromFileList(changedFileList); + let changedFileListInAbsolutePath: Array = changedFileList.map((file) => { + return path.join(this.projectConfig.projectPath, file); + }); + this.collectModuleFileList(rollupObject, changedFileListInAbsolutePath[Symbol.iterator]()); + + const outputABCPath: string = path.join(this.projectConfig.patchAbcPath, MODULES_ABC); + validateFilePathLength(outputABCPath, this.logger); + this.moduleAbcPath = outputABCPath; + + this.generateAbcByEs2abc(); + } + + private updateSourceMapFromFileList(fileList: Array) { + const relativeProjectPath: string = this.projectConfig.projectPath.slice( + this.projectConfig.projectRootPath.length + path.sep.length); + for (const file of fileList) { + const sourceMapPath: string = toUnixPath(path.join(relativeProjectPath, file)); + validateFilePathLength(sourceMapPath, this.logger); + hotReloadSourceMap[sourceMapPath] = newSourceMaps[sourceMapPath]; + } + + const sourceMapFilePath: string = path.join(this.projectConfig.patchAbcPath, SOURCEMAPS); + validateFilePathLength(sourceMapFilePath, this.logger); + fs.writeFileSync(sourceMapFilePath, + JSON.stringify(hotReloadSourceMap, null, 2), 'utf-8'); + } + + private generateAbcByEs2abc() { + this.generateEs2AbcCmd(); + this.generateMergedAbcOfEs2Abc(); + } +} diff --git a/compiler/src/fast_build/ark_compiler/module/module_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_mode.ts new file mode 100644 index 0000000..c733fb3 --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/module/module_mode.ts @@ -0,0 +1,533 @@ +/* + * 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 childProcess from 'child_process'; +import fs from 'fs'; +import os from 'os'; +import path from 'path'; +import cluster from 'cluster'; + +import { + AUXILIARY, + COMMONJS, + ESM, + EXTNAME_CJS, + EXTNAME_ETS, + EXTNAME_JS, + EXTNAME_JSON, + EXTNAME_MJS, + EXTNAME_TS, + FILESINFO_TXT, + MAIN, + MODULES_ABC, + MODULES_CACHE, + MODULELIST_JSON, + NODE_MODULES, + NPMENTRIES_TXT, + SOURCEMAPS, + SOURCEMAPS_JSON, + TEMPORARY, + HAP_PACKAGE, + PROJECT_PACKAGE +} from '../common/ark_define'; +import { + ESMODULE, + EXTNAME_PROTO_BIN, + EXTNAME_TXT, + FILESINFO, + GEN_ABC_SCRIPT, + MAX_WORKER_NUMBER, + NPM_ENTRIES_PROTO_BIN, + PROTOS, + PROTO_FILESINFO_TXT, + FAIL, + red, + reset +} from '../common/ark_define'; +import { + isAotMode, + isMasterOrPrimary +} from '../utils'; +import { CommonMode } from '../common/common_mode'; +import { newSourceMaps } from '../transform'; +import { + changeFileExtension, + getEs2abcFileThreadNumber, + isCommonJsPluginVirtualFile, + isCurrentProjectFiles +} from '../utils'; +import { + isNodeModulesFile, + mkdirsSync, + toUnixPath, + toHashData, + validateFilePathLength +} from '../../../utils'; +import { + getPackageInfo, + getOhmUrlByFilepath +} from '../../../ark_utils'; +import { generateAot, generateBuiltinAbc } from '../../../gen_aot'; + +export class ModuleInfo { + filePath: string; + cacheFilePath: string; + recordName: string; + isCommonJs: boolean; + sourceFile: string; + packageName: string; + + constructor(filePath: string, cacheFilePath: string, isCommonJs: boolean, recordName: string, sourceFile: string, + packageName: string + ) { + this.filePath = filePath; + this.cacheFilePath = cacheFilePath; + this.recordName = recordName; + this.isCommonJs = isCommonJs; + this.sourceFile = sourceFile; + this.packageName = packageName; + } +} + +export class PackageEntryInfo { + pkgEntryPath: string; + pkgBuildPath: string; + constructor(pkgEntryPath: string, pkgBuildPath: string) { + this.pkgEntryPath = pkgEntryPath; + this.pkgBuildPath = pkgBuildPath; + } +} + +export class ModuleMode extends CommonMode { + moduleInfos: Map; + pkgEntryInfos: Map; + hashJsonObject: any; + filesInfoPath: string; + npmEntriesInfoPath: string; + moduleAbcPath: string; + sourceMapPath: string; + cacheFilePath: string; + workerNumber: number; + npmEntriesProtoFilePath: string; + protoFilePath: string; + filterModuleInfos: Map; + + constructor(rollupObject: any) { + super(rollupObject); + this.moduleInfos = new Map(); + this.pkgEntryInfos = new Map(); + this.hashJsonObject = {}; + this.filesInfoPath = path.join(this.projectConfig.cachePath, FILESINFO_TXT); + this.npmEntriesInfoPath = path.join(this.projectConfig.cachePath, NPMENTRIES_TXT); + this.moduleAbcPath = path.join(this.projectConfig.aceModuleBuild, MODULES_ABC); + this.sourceMapPath = path.join(this.projectConfig.aceModuleBuild, SOURCEMAPS); + this.cacheFilePath = path.join(this.projectConfig.cachePath, MODULES_CACHE); + this.workerNumber = MAX_WORKER_NUMBER; + this.npmEntriesProtoFilePath = path.join(this.projectConfig.cachePath, PROTOS, NPM_ENTRIES_PROTO_BIN); + this.protoFilePath = path.join(this.projectConfig.cachePath, PROTOS, PROTO_FILESINFO_TXT); + this.hashJsonObject = {}; + this.filterModuleInfos = new Map(); + } + + collectModuleFileList(module: any, fileList: IterableIterator) { + let moduleInfos: Map = new Map(); + let pkgEntryInfos: Map = new Map(); + for (const moduleId of fileList) { + if (isCommonJsPluginVirtualFile(moduleId) || !isCurrentProjectFiles(moduleId, this.projectConfig)) { + continue; + } + const moduleInfo: any = module.getModuleInfo(moduleId); + if (moduleInfo['meta']['isNodeModuleEntryFile']) { + this.getPackageEntryInfo(moduleId, moduleInfo['meta'], pkgEntryInfos); + } + + this.processModuleInfos(moduleId, moduleInfos, moduleInfo['meta']); + } + this.moduleInfos = moduleInfos; + this.pkgEntryInfos = pkgEntryInfos; + } + + private getPackageEntryInfo(filePath: string, metaInfo: any, pkgEntryInfos: Map) { + if (!metaInfo['packageJson']) { + this.logger.debug("Failed to get 'packageJson' from metaInfo. File: ", filePath); + return; + } + const pkgPath: string = metaInfo['packageJson']['pkgPath']; + let originPkgEntryPath: string = toUnixPath(filePath.replace(pkgPath, '')); + if (originPkgEntryPath.startsWith('/')) { + originPkgEntryPath = originPkgEntryPath.slice(1, originPkgEntryPath.length); + } + let originPkgName: string = this.getNodeModulesFilePkgName(pkgPath); + + let pkgEntryPath: string = ''; + const projectNodeModulesPath: string = toUnixPath(path.join(this.projectConfig.projectRootPath, NODE_MODULES)); + if (pkgPath.includes(projectNodeModulesPath)) { + pkgEntryPath = path.join(NODE_MODULES, PROJECT_PACKAGE, originPkgName); + } else { + pkgEntryPath = path.join(NODE_MODULES, HAP_PACKAGE, originPkgName); + } + pkgEntryPath = toUnixPath(pkgEntryPath); + + let pkgBuildPath: string = path.join(pkgEntryPath, originPkgEntryPath); + pkgBuildPath = pkgBuildPath.substring(0, pkgBuildPath.lastIndexOf('.')); + pkgBuildPath = toUnixPath(pkgBuildPath); + + pkgEntryInfos.set(pkgPath, new PackageEntryInfo(pkgEntryPath, pkgBuildPath)); + } + + private processModuleInfos(moduleId: string, moduleInfos: Map, metaInfo?: any) { + switch (path.extname(moduleId)) { + case EXTNAME_ETS: { + const extName: string = this.projectConfig.processTs ? EXTNAME_TS : EXTNAME_JS; + this.addModuleInfoItem(moduleId, false, extName, metaInfo, moduleInfos); + break; + } + case EXTNAME_TS: { + const extName: string = this.projectConfig.processTs ? '' : EXTNAME_JS; + this.addModuleInfoItem(moduleId, false, extName, metaInfo, moduleInfos); + break; + } + case EXTNAME_JS: + case EXTNAME_MJS: + case EXTNAME_CJS: { + const extName: string = (moduleId.endsWith(EXTNAME_MJS) || moduleId.endsWith(EXTNAME_CJS)) ? EXTNAME_JS : ''; + const isCommonJS: boolean = metaInfo && metaInfo['commonjs'] && metaInfo['commonjs']['isCommonJS']; + this.addModuleInfoItem(moduleId, isCommonJS, extName, metaInfo, moduleInfos); + break; + } + case EXTNAME_JSON: { + this.addModuleInfoItem(moduleId, false, '', metaInfo, moduleInfos); + break; + } + default: + break; + } + } + + private addModuleInfoItem(filePath: string, isCommonJs: boolean, extName: string, metaInfo: any, moduleInfos: any) { + let recordName: string = getOhmUrlByFilepath(filePath, this.projectConfig, this.logger); + let sourceFile: string = filePath.replace(this.projectConfig.projectRootPath + path.sep, ''); + let cacheFilePath: string = ''; + let packageName: string = ''; + if (isNodeModulesFile(filePath, this.projectConfig)) { + cacheFilePath = this.genNodeModulesFileCachePath(filePath, this.projectConfig.cachePath, this.projectConfig); + packageName = this.getNodeModulesFilePkgName(metaInfo['packageJson']['pkgPath']); + } else { + cacheFilePath = this.genFileCachePath(filePath, this.projectConfig.projectPath, this.projectConfig.cachePath); + packageName = getPackageInfo(this.projectConfig.aceModuleJsonPath)[1]; + } + + if (extName.length != 0) { + cacheFilePath = changeFileExtension(cacheFilePath, extName); + } + + cacheFilePath = toUnixPath(cacheFilePath); + recordName = toUnixPath(recordName); + sourceFile = toUnixPath(sourceFile); + packageName = toUnixPath(packageName); + + moduleInfos.set(filePath, new ModuleInfo(filePath, cacheFilePath, isCommonJs, recordName, sourceFile, packageName)); + } + + buildModuleSourceMapInfo() { + if (!this.arkConfig.isDebug) { + return; + } + mkdirsSync(this.projectConfig.aceModuleBuild); + const sourceMapFilePath: string = path.join(this.projectConfig.aceModuleBuild, SOURCEMAPS); + fs.writeFile(sourceMapFilePath, JSON.stringify(newSourceMaps, null, 2), 'utf-8', (err) => { + if (err) { + throw Error('ArkTS:ERROR failed to write cache sourceMaps json'); + } + }); + } + + generateEs2AbcCmd() { + const fileThreads = getEs2abcFileThreadNumber(); + this.cmdArgs.push(`"@${this.filesInfoPath}"`); + this.cmdArgs.push('--npm-module-entry-list'); + this.cmdArgs.push(`"${this.npmEntriesInfoPath}"`); + this.cmdArgs.push('--output'); + this.cmdArgs.push(`"${this.moduleAbcPath}"`); + this.cmdArgs.push('--file-threads'); + this.cmdArgs.push(`"${fileThreads}"`); + this.cmdArgs.push('--cache-file'); + this.cmdArgs.push(`"${this.cacheFilePath}"`); + this.cmdArgs.push('--merge-abc'); + } + + private generateCompileFilesInfo() { + let filesInfo: string = ''; + this.moduleInfos.forEach((info) => { + const moduleType: string = info.isCommonJs ? COMMONJS : ESM; + filesInfo += `${info.cacheFilePath};${info.recordName};${moduleType};${info.sourceFile};${info.packageName}\n`; + }); + fs.writeFileSync(this.filesInfoPath, filesInfo, 'utf-8'); + } + + private generateNpmEntriesInfo() { + let entriesInfo: string = ''; + for (const value of this.pkgEntryInfos.values()) { + entriesInfo += `${value.pkgEntryPath}:${value.pkgBuildPath}\n`; + } + fs.writeFileSync(this.npmEntriesInfoPath, entriesInfo, 'utf-8'); + } + + private genDescriptionsForMergedEs2abc() { + this.generateCompileFilesInfo(); + this.generateNpmEntriesInfo(); + } + + generateMergedAbcOfEs2Abc() { + this.genDescriptionsForMergedEs2abc(); + const genAbcCmd: string = this.cmdArgs.join(' '); + try { + const child = this.asyncHandler(() => { + return childProcess.exec(genAbcCmd, { windowsHide: true }); + }); + child.on('exit', (code: any) => { + if (code === FAIL) { + throw Error('ArkTS:ERROR failed to execute es2abc'); + } + this.signalHandler(); + }); + + child.on('error', (err: any) => { + throw Error(err.toString()); + }); + + child.stderr.on('data', (data: any) => { + this.logger.error(red, data.toString(), reset); + }); + } catch (e) { + throw Error('ArkTS:ERROR failed to execute es2abc. Error message: ' + e.toString()); + } + } + + filterModulesByHashJson() { + if (this.hashJsonFilePath.length === 0) { + for (const key of this.moduleInfos.keys()) { + this.filterModuleInfos.set(key, this.moduleInfos.get(key)); + } + return; + } + + let updatedJsonObject: any = {}; + let jsonObject: any = {}; + let jsonFile: string = ''; + + if (fs.existsSync(this.hashJsonFilePath)) { + jsonFile = fs.readFileSync(this.hashJsonFilePath).toString(); + jsonObject = JSON.parse(jsonFile); + this.filterModuleInfos = new Map(); + for (const [key, value] of this.moduleInfos) { + const cacheFilePath: string = value.cacheFilePath; + const cacheProtoFilePath: string = changeFileExtension(cacheFilePath, EXTNAME_PROTO_BIN); + if (!fs.existsSync(cacheFilePath)) { + throw Error(`ArkTS:ERROR ${cacheFilePath} is lost`); + } + if (fs.existsSync(cacheProtoFilePath)) { + const hashCacheFileContentData: any = toHashData(cacheFilePath); + const hashProtoFileContentData: any = toHashData(cacheProtoFilePath); + if (jsonObject[cacheFilePath] === hashCacheFileContentData && + jsonObject[cacheProtoFilePath] === hashProtoFileContentData) { + updatedJsonObject[cacheFilePath] = cacheFilePath; + updatedJsonObject[cacheProtoFilePath] = cacheProtoFilePath; + continue; + } + } + this.filterModuleInfos.set(key, value); + } + } + + this.hashJsonObject = updatedJsonObject; + } + + getSplittedModulesByNumber() { + const result: any = []; + if (this.moduleInfos.size < this.workerNumber) { + for (const value of this.moduleInfos.values()) { + result.push([value]); + } + return result; + } + + for (let i = 0; i < this.workerNumber; ++i) { + result.push([]); + } + + let pos: number = 0; + for (const value of this.moduleInfos.values()) { + const chunk = pos % this.workerNumber; + result[chunk].push(value); + pos++; + } + + return result; + } + + generateTs2AbcCmd() { + this.cmdArgs.push('--output-proto'); + this.cmdArgs.push('--merge-abc'); + this.cmdArgs.push('--input-file'); + } + + invokeTs2AbcWorkersToGenProto(splittedModules) { + if (isMasterOrPrimary()) { + this.setupCluster(cluster); + for (let i = 0; i < this.workerNumber; ++i) { + const sn: number = i + 1; + const workerFileName: string = `${FILESINFO}_${sn}${EXTNAME_TXT}`; + const workerData: any = { + inputs: JSON.stringify(splittedModules[i]), + cmd: this.cmdArgs.join(' '), + workerFileName: workerFileName, + mode: ESMODULE, + cachePath: this.projectConfig.cachePath + }; + this.asyncHandler(() => { + cluster.fork(workerData); + }); + } + } + } + + processTs2abcWorkersToGenAbc() { + this.generateNpmEntriesInfo(); + let workerCount: number = 0; + if (isMasterOrPrimary()) { + cluster.on('exit', (worker, code, signal) => { + if (code === FAIL) { + throw Error('ArkTS:ERROR failed to execute ts2abc'); + } + workerCount++; + if (workerCount === this.workerNumber) { + this.generateNpmEntryToGenProto(); + this.generateProtoFilesInfo(); + this.mergeProtoToAbc(); + if (isAotMode(this.projectConfig)) { + const builtinAbcPath: string = generateBuiltinAbc(this.arkConfig.arkRootPath, this.arkConfig.nodePath, + this.cmdArgs, this.logger, true); + generateAot(this.arkConfig.arkRootPath, builtinAbcPath, this.logger, true); + } + this.afterCompilationProcess(); + } + this.signalHandler(); + }); + } + } + + private genFileCachePath(filePath: string, projectPath: string, cachePath: string, + buildInHar: boolean = false): string { + const sufStr: string = filePath.replace(projectPath, ''); + const output: string = path.join(cachePath, buildInHar ? '' : TEMPORARY, sufStr); + return output; + } + + private genNodeModulesFileCachePath(filePath: string, cachePath: string, projectConfig: any, + buildInHar: boolean = false): string { + const fakeNodeModulesPath: string = toUnixPath(path.join(projectConfig.projectRootPath, NODE_MODULES)); + let output: string = ''; + if (filePath.indexOf(fakeNodeModulesPath) === -1) { + const hapPath: string = toUnixPath(projectConfig.projectRootPath); + const tempFilePath: string = filePath.replace(hapPath, ''); + const sufStr: string = tempFilePath.substring(tempFilePath.indexOf(NODE_MODULES) + NODE_MODULES.length + 1); + output = path.join(cachePath, buildInHar ? '' : TEMPORARY, NODE_MODULES, MAIN, sufStr); + } else { + output = filePath.replace(fakeNodeModulesPath, + path.join(cachePath, buildInHar ? '' : TEMPORARY, NODE_MODULES, AUXILIARY)); + } + return output; + } + + private getNodeModulesFilePkgName(pkgPath: string) { + const projectRootPath = toUnixPath(this.projectConfig.projectRootPath); + const projectNodeModulesPath: string = toUnixPath(path.join(projectRootPath, NODE_MODULES)); + let pkgName: string = ''; + if (pkgPath.includes(projectNodeModulesPath)) { + pkgName = pkgPath.replace(projectNodeModulesPath, ''); + } else { + const tempFilePath: string = pkgPath.replace(projectRootPath, ''); + pkgName = tempFilePath.substring(tempFilePath.indexOf(NODE_MODULES) + NODE_MODULES.length + 1); + } + return pkgName; + } + + private generateProtoFilesInfo() { + validateFilePathLength(this.protoFilePath, this.logger); + mkdirsSync(path.dirname(this.protoFilePath)); + let protoFilesInfo: string = ''; + for (const value of this.moduleInfos.values()) { + const cacheProtoPath: string = changeFileExtension(value.cacheFilePath, EXTNAME_PROTO_BIN); + protoFilesInfo += `${toUnixPath(cacheProtoPath)}\n`; + } + if (this.pkgEntryInfos.size > 0) { + protoFilesInfo += `${toUnixPath(this.npmEntriesProtoFilePath)}\n`; + } + fs.writeFileSync(this.protoFilePath, protoFilesInfo, 'utf-8'); + } + + private mergeProtoToAbc() { + mkdirsSync(this.projectConfig.aceModuleBuild); + const cmd: any = `"${this.arkConfig.mergeAbcPath}" --input "@${this.protoFilePath}" --outputFilePath "${ + this.projectConfig.aceModuleBuild}" --output ${MODULES_ABC} --suffix protoBin`; + try { + childProcess.execSync(cmd); + } catch (e) { + throw Error(`ArkTS:ERROR failed to merge proto file to abc, error message:` + e.toString()); + } + } + + private afterCompilationProcess() { + this.writeHashJson(); + this.cleanInfo(); + } + + private writeHashJson() { + if (this.hashJsonFilePath.length === 0) { + return; + } + + for (const value of this.filterModuleInfos.values()) { + const cacheFilePath: string = value.cacheFilePath; + const cacheProtoFilePath: string = changeFileExtension(cacheFilePath, EXTNAME_PROTO_BIN); + if (!fs.existsSync(cacheFilePath) || !fs.existsSync(cacheProtoFilePath)) { + throw Error( + `ArkTS:ERROR ${cacheFilePath} or ${cacheProtoFilePath} is lost` + ); + } + const hashCacheFileContentData: any = toHashData(cacheFilePath); + const hashCacheProtoContentData: any = toHashData(cacheProtoFilePath); + this.hashJsonObject[cacheFilePath] = hashCacheFileContentData; + this.hashJsonObject[cacheProtoFilePath] = hashCacheProtoContentData; + } + + fs.writeFileSync(this.hashJsonFilePath, JSON.stringify(this.hashJsonObject)); + } + + private generateNpmEntryToGenProto() { + if (this.pkgEntryInfos.size <= 0) { + return; + } + mkdirsSync(path.dirname(this.npmEntriesProtoFilePath)); + const cmd: string = `"${this.arkConfig.js2abcPath}" --compile-npm-entries "${ + this.npmEntriesInfoPath}" "${this.npmEntriesProtoFilePath}"`; + try { + childProcess.execSync(cmd); + } catch (e) { + throw Error(`ArkTS:ERROR failed to generate npm proto file to abc. Error message: ` + e.toString()); + } + } +} diff --git a/compiler/src/fast_build/ark_compiler/module/module_preview_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_preview_mode.ts new file mode 100644 index 0000000..44c07db --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/module/module_preview_mode.ts @@ -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 { ModuleMode } from './module_mode'; +import { isEs2Abc, isTs2Abc } from '../../../ark_utils'; + +export class ModulePreviewMode extends ModuleMode { + constructor(rollupObject: any) { + super(rollupObject); + } + + generateAbc(rollupObject: any) { + this.collectModuleFileList(rollupObject, rollupObject.getModuleIds()); + this.executeArkCompiler(); + } + + executeArkCompiler() { + if (isEs2Abc(this.projectConfig)) { + this.generateEs2AbcCmd(); + this.generateMergedAbcOfEs2Abc(); + } else if (isTs2Abc(this.projectConfig)) { + this.filterModulesByHashJson(); + const splittedModules: any[] = this.getSplittedModulesByNumber(); + this.generateTs2AbcCmd(); + this.invokeTs2AbcWorkersToGenProto(splittedModules); + this.processTs2abcWorkersToGenAbc(); + } else { + throw Error('ArkTS:ERROR please set panda mode'); + } + } +} diff --git a/compiler/src/fast_build/ark_compiler/module/module_source_file.ts b/compiler/src/fast_build/ark_compiler/module/module_source_file.ts new file mode 100644 index 0000000..c960bc9 --- /dev/null +++ b/compiler/src/fast_build/ark_compiler/module/module_source_file.ts @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use rollupObject file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 * as ts from 'typescript'; +import MagicString from 'magic-string'; +import { + NODE_MODULES, + GEN_ABC_PLUGIN_NAME +} from '../common/ark_define'; +import { getOhmUrlByFilepath, getOhmUrlByHarName } from '../../../ark_utils'; +import { writeFileSyncByNode } from '../../../process_module_files'; +import { + isJsonSourceFile, + isJsSourceFile, + writeFileContentToTempDir +} from '../utils'; + +const ROLLUP_IMPORT_NODE: string = 'ImportDeclaration'; +const ROLLUP_EXPORTNAME_NODE: string = 'ExportNamedDeclaration'; +const ROLLUP_EXPORTALL_NODE: string = 'ExportAllDeclaration'; + +export class ModuleSourceFile { + private static sourceFiles: ModuleSourceFile[] = []; + private moduleId: string; + private source: string | ts.SourceFile; + private isSourceNode: boolean = false; + private static projectConfig: any; + private static logger: any; + + constructor(moduleId: string, source: string | ts.SourceFile) { + this.moduleId = moduleId; + this.source = source; + if (typeof this.source !== 'string') { + this.isSourceNode = true; + } + } + + static newSourceFile(moduleId: string, source: string | ts.SourceFile) { + ModuleSourceFile.sourceFiles.push(new ModuleSourceFile(moduleId, source)); + } + + static processModuleSourceFiles(rollupObject: any) { + this.initPluginEnv(rollupObject); + ModuleSourceFile.sourceFiles.forEach((source: ModuleSourceFile) => { + source.processModuleRequest(rollupObject); + source.writeSourceFile(); + }); + ModuleSourceFile.sourceFiles = []; + } + + writeSourceFile() { + if (this.isSourceNode && !isJsSourceFile(this.moduleId)) { + writeFileSyncByNode(this.source, true, ModuleSourceFile.projectConfig); + } else { + writeFileContentToTempDir(this.moduleId, this.source, ModuleSourceFile.projectConfig, + ModuleSourceFile.logger); + } + } + + private getOhmUrl(moduleRequest: string, filePath: string | undefined): string | undefined { + const harOhmUrl: string | undefined = getOhmUrlByHarName(moduleRequest, ModuleSourceFile.projectConfig); + if (harOhmUrl !== undefined) { + return harOhmUrl; + } + if (filePath) { + const ohmUrl: string = getOhmUrlByFilepath(filePath, ModuleSourceFile.projectConfig, ModuleSourceFile.logger); + return ohmUrl.startsWith(NODE_MODULES) ? `@package:${ohmUrl}` : `@bundle:${ohmUrl}`; + } + return undefined; + } + + private processJsModuleRequest(rollupObject: any) { + const moduleInfo: any = rollupObject.getModuleInfo(this.moduleId); + const importMap: any = moduleInfo.importedIdMaps; + const REG_DEPENDENCY: RegExp = /(?:import|from)(?:\s*)['"]([^'"]+)['"]/g; + this.source = (this.source).replace(REG_DEPENDENCY, (item, moduleRequest) => { + const ohmUrl: string | undefined = this.getOhmUrl(moduleRequest, importMap[moduleRequest]); + if (ohmUrl !== undefined) { + item = item.replace(/(['"])(?:\S+)['"]/, (_, quotation) => { + return quotation + ohmUrl + quotation; + }); + } + return item; + }); + } + + private processTransformedJsModuleRequest(rollupObject: any) { + const moduleInfo: any = rollupObject.getModuleInfo(this.moduleId); + const importMap: any = moduleInfo.importedIdMaps; + const code: MagicString = new MagicString(this.source); + const ast = moduleInfo.ast; + ast.body.forEach(node => { + if (node.type === ROLLUP_IMPORT_NODE || (node.type === ROLLUP_EXPORTNAME_NODE && node.source) || + node.type === ROLLUP_EXPORTALL_NODE) { + const ohmUrl: string | undefined = this.getOhmUrl(node.source.value, importMap[node.source.value]); + if (ohmUrl !== undefined) { + code.update(node.source.start, node.source.end, `'${ohmUrl}'`); + } + } + }); + this.source = code.toString(); + } + + private processTransformedTsmoduleRequest(rollupObject: any) { + const moduleInfo: any = rollupObject.getModuleInfo(this.moduleId); + const importMap: any = moduleInfo.importedIdMaps; + (this.source)!.forEachChild((childNode: ts.Node) => { + if (ts.isImportDeclaration(childNode) || (ts.isExportDeclaration(childNode) && childNode.moduleSpecifier)) { + const moduleRequest: string = childNode.moduleSpecifier.getText(); + const ohmUrl: string | undefined = this.getOhmUrl(moduleRequest, importMap[moduleRequest]); + if (ohmUrl !== undefined) { + if (ts.isImportDeclaration(childNode)) { + childNode = ts.factory.updateImportDeclaration(childNode, childNode.decorators, childNode.modifiers, + childNode.importClause, ts.factory.createStringLiteral(ohmUrl)); + } else { + childNode = ts.factory.updateExportDeclaration(childNode, childNode.decorators, childNode.modifiers, + childNode.isTypeOnly, childNode.exportClause, ts.factory.createStringLiteral(ohmUrl)); + } + } + } + }); + } + + processModuleRequest(rollupObject: any) { + if (isJsonSourceFile(this.moduleId)) { + return; + } + if (isJsSourceFile(this.moduleId)) { + this.processJsModuleRequest(rollupObject); + return; + } + this.isSourceNode ? this.processTransformedTsmoduleRequest(rollupObject) : + this.processTransformedJsModuleRequest(rollupObject); + } + + private static initPluginEnv(rollupObject: any) { + this.projectConfig = Object.assign(rollupObject.share.arkProjectConfig, rollupObject.share.projectConfig); + this.logger = rollupObject.share.getLogger(GEN_ABC_PLUGIN_NAME); + } +} diff --git a/compiler/src/fast_build/ark_compiler/transform.ts b/compiler/src/fast_build/ark_compiler/transform.ts index 04ae70e..11a9842 100644 --- a/compiler/src/fast_build/ark_compiler/transform.ts +++ b/compiler/src/fast_build/ark_compiler/transform.ts @@ -15,31 +15,34 @@ import path from 'path'; -import { DEBUG } from '../common/common_define'; import { - EXTNAME_JS, - EXTNAME_MJS, - EXTNAME_CJS, ESMODULE, EXTNAME_ETS, EXTNAME_TS } from './common/ark_define'; -import { ModuleSourceFile } from "./module/module_source_file"; -import { isSpecifiedExt } from './utils'; +import { ModuleSourceFile } from './module/module_source_file'; +import { + isCommonJsPluginVirtualFile, + isDebug, + isJsSourceFile, + isSpecifiedExt +} from './utils'; import { toUnixPath } from '../../utils'; export let newSourceMaps: Object = {}; /** * rollup transform hook - * @param {string} code - * @param {string} id + * @param {string} code: source code of an input file + * @param {string} id: absolute path of an input file */ export function transformForModule(code: string, id: string) { if (this.share.projectConfig.compileMode === ESMODULE) { const projectConfig: any = Object.assign(this.share.arkProjectConfig, this.share.projectConfig); preserveTsAndEtsSourceContent(id, code); - preserveSourceMap(id, this.getCombinedSourcemap(), projectConfig); + if (isDebug(projectConfig)) { + preserveSourceMap(id, this.getCombinedSourcemap(), projectConfig); + } } } @@ -50,17 +53,14 @@ function preserveTsAndEtsSourceContent(sourceFilePath: string, code: string): vo } function preserveSourceMap(sourceFilePath: string, sourcemap: any, projectConfig: any): void { - if (projectConfig.buildArkMode.toLowerCase() !== DEBUG) { - return; - } - - if (sourceFilePath.includes('\x00') || isSpecifiedExt(sourceFilePath, EXTNAME_JS) || - isSpecifiedExt(sourceFilePath, EXTNAME_MJS) || isSpecifiedExt(sourceFilePath, EXTNAME_CJS)) { + if (isCommonJsPluginVirtualFile(sourceFilePath) || isJsSourceFile(sourceFilePath)) { // skip automatic generated files like 'jsfile.js?commonjs-exports' // skip js/cjs/mjs file sourcemap return; } - sourcemap['sources'] = toUnixPath(sourceFilePath.replace(projectConfig.projectRootPath + path.sep, '')); - newSourceMaps[toUnixPath(sourceFilePath.replace(projectConfig.projectRootPath + path.sep, ''))] = sourcemap; + const relativeSourceFilePath = toUnixPath(sourceFilePath.replace(projectConfig.projectRootPath + path.sep, '')); + sourcemap['sources'] = [ relativeSourceFilePath ]; + sourcemap['file'] = path.basename(relativeSourceFilePath); + newSourceMaps[relativeSourceFilePath] = sourcemap; } diff --git a/compiler/src/fast_build/ark_compiler/utils.ts b/compiler/src/fast_build/ark_compiler/utils.ts index 8c583a1..46c71e6 100644 --- a/compiler/src/fast_build/ark_compiler/utils.ts +++ b/compiler/src/fast_build/ark_compiler/utils.ts @@ -18,8 +18,8 @@ import fs from 'fs'; import path from 'path'; import os from 'os'; -import { DEBUG } from '../common/common_define'; import { + DEBUG, ESMODULE, EXTNAME_ETS, EXTNAME_JS, @@ -32,13 +32,13 @@ import { } from './common/ark_define'; import { compareNodeVersion, + genTemporaryPath, mkdirsSync, toUnixPath, validateFilePathLength } from '../../utils'; import { genBuildPath, - genTemporaryPath, transformModuleSpecifier, writeMinimizedSourceCode } from '../../ark_utils'; @@ -50,6 +50,10 @@ export function isAotMode(projectConfig: any): boolean { ); } +export function isDebug(projectConfig: any): boolean { + return projectConfig.buildMode.toLowerCase() === DEBUG; +} + export function isMasterOrPrimary() { return ((compareNodeVersion() && cluster.isPrimary) || (!compareNodeVersion() && cluster.isMaster)); } @@ -61,21 +65,21 @@ export function changeFileExtension(file: string, targetExt: string, originExt = } export function writeFileContentToTempDir(id: string, content: string, projectConfig: any, logger: any) { - if (id.includes('\x00')) { - // skip automatic generated files like 'jsfile.js?commonjs-exports' + if (isCommonJsPluginVirtualFile(id)) { return; } - let filePath: string = genTemporaryPath(id, projectConfig.projectPath, projectConfig.cachePath, projectConfig); + if (!isCurrentProjectFiles(id, projectConfig)) { + return; + } + let filePath: string; if (projectConfig.compileHar) { filePath = genTemporaryPath(id, projectConfig.compileShared ? projectConfig.projectRootPath : projectConfig.moduleRootPath, path.resolve(projectConfig.buildPath, projectConfig.compileShared ? '../etsFortgz' : ''), projectConfig, true); - } - - if (filePath.length === 0) { - return; + } else { + filePath = genTemporaryPath(id, projectConfig.projectPath, projectConfig.cachePath, projectConfig); } switch (path.extname(id)) { @@ -103,17 +107,12 @@ function writeFileContent(sourceFilePath: string, filePath: string, content: str mkdirsSync(path.dirname(filePath)); - if (projectConfig.compileHar && projectConfig.obfuscateHarType === 'uglify') { + if ((projectConfig.compileHar && projectConfig.obfuscateHarType === 'uglify') || !isDebug(projectConfig)) { writeMinimizedSourceCode(content, filePath, logger); return; } - if (projectConfig.buildArkMode.toLowerCase() === DEBUG) { - fs.writeFileSync(filePath, content, 'utf-8'); - return; - } - - writeMinimizedSourceCode(content, filePath, logger); + fs.writeFileSync(filePath, content, 'utf-8'); } export function getNodeModulesFilePackageName(projectConfig: any, pkgPath: string) { @@ -162,3 +161,11 @@ export function genCachePath(tailName: string, projectConfig: any, logger: any): validateFilePathLength(pathName, logger); return pathName; } + +export function isJsSourceFile(file: string): boolean { + return /\.[cm]?js$/.test(file); +} + +export function isJsonSourceFile(file: string): boolean { + return /\.json$/.test(file); +} diff --git a/compiler/src/process_module_files.ts b/compiler/src/process_module_files.ts new file mode 100644 index 0000000..5fb04d4 --- /dev/null +++ b/compiler/src/process_module_files.ts @@ -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 path from 'path'; +import ts from 'typescript'; +import fs from 'fs'; + +import { + EXTNAME_JS, + EXTNAME_TS, + EXTNAME_ETS, + TS_NOCHECK +} from './pre_define'; +import { + genTemporaryPath, + mkdirsSync, + toUnixPath, +} from './utils'; +import { + genSourceMapFileName, + newSourceMaps, + transformModuleSpecifier +} from './ark_utils'; +import { processSystemApi } from './validate_ui_syntax'; + +export const SRC_MAIN: string = 'src/main'; + +export function writeFileSyncByNode(node: ts.SourceFile, toTsFile: boolean, projectConfig: any): void { + if (toTsFile) { + const newStatements: ts.Node[] = []; + const tsIgnoreNode: ts.Node = ts.factory.createExpressionStatement(ts.factory.createIdentifier(TS_NOCHECK)); + newStatements.push(tsIgnoreNode); + if (node.statements && node.statements.length) { + newStatements.push(...node.statements); + } + + node = ts.factory.updateSourceFile(node, newStatements); + } + const mixedInfo: {content: string, sourceMapJson: any} = genContentAndSourceMapInfo(node, toTsFile, projectConfig); + let temporaryFile: string = genTemporaryPath(node.fileName, projectConfig.projectPath, process.env.cachePath, + projectConfig); + if (temporaryFile.length === 0) { + return; + } + let temporarySourceMapFile: string = ''; + if (temporaryFile.endsWith(EXTNAME_ETS)) { + if (toTsFile) { + temporaryFile = temporaryFile.replace(/\.ets$/, EXTNAME_TS); + } else { + temporaryFile = temporaryFile.replace(/\.ets$/, EXTNAME_JS); + } + temporarySourceMapFile = genSourceMapFileName(temporaryFile); + } else { + if (!toTsFile) { + temporaryFile = temporaryFile.replace(/\.ts$/, EXTNAME_JS); + temporarySourceMapFile = genSourceMapFileName(temporaryFile); + } + } + mkdirsSync(path.dirname(temporaryFile)); + if (temporarySourceMapFile.length > 0 && projectConfig.buildArkMode === 'debug') { + let source = toUnixPath(node.fileName).replace(toUnixPath(projectConfig.projectRootPath) + '/', ''); + newSourceMaps[source] = mixedInfo.sourceMapJson; + } + fs.writeFileSync(temporaryFile, mixedInfo.content); +} + +function genContentAndSourceMapInfo(node: ts.SourceFile, toTsFile: boolean, projectConfig: any): any { + const printer: ts.Printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); + const options: ts.CompilerOptions = { + sourceMap: true + }; + const mapOpions: any = { + sourceMap: true, + inlineSourceMap: false, + inlineSources: false, + sourceRoot: '', + mapRoot: '', + extendedDiagnostics: false + }; + const host: ts.CompilerHost = ts.createCompilerHost(options); + const fileName: string = node.fileName; + // @ts-ignore + const sourceMapGenerator: any = ts.createSourceMapGenerator( + host, + // @ts-ignore + ts.getBaseFileName(fileName), + '', + '', + mapOpions + ); + // @ts-ignore + const writer: any = ts.createTextWriter( + // @ts-ignore + ts.getNewLineCharacter({newLine: ts.NewLineKind.LineFeed, removeComments: false})); + printer['writeFile'](node, writer, sourceMapGenerator); + const sourceMapJson: any = sourceMapGenerator.toJSON(); + sourceMapJson['sources'] = [fileName.replace(toUnixPath(projectConfig.projectRootPath) + '/', '')]; + let content: string = writer.getText(); + if (toTsFile) { + content = content.replace(`${TS_NOCHECK};`, TS_NOCHECK); + } + content = transformModuleSpecifier(fileName, processSystemApi(content, true), projectConfig); + + return { + content: content, + sourceMapJson: sourceMapJson + }; +} diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 9d47d06..24d8541 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -65,7 +65,7 @@ import { hasDecorator, FileLog } from './utils'; -import { writeFileSyncByNode } from './ark_utils'; +import { writeFileSyncByNode } from './process_module_files'; import { componentCollection, localStorageLinkCollection, @@ -96,6 +96,7 @@ import { partialUpdateConfig } from '../main'; import { createCustomComponentNewExpression, createViewCreate } from './process_component_member'; +import { ModuleSourceFile } from "./fast_build/ark_compiler/module/module_source_file"; export const transformLog: FileLog = new FileLog(); export let contextGlobal: ts.TransformationContext; @@ -119,7 +120,8 @@ export function processUISyntax(program: ts.Program, ut = false): Function { if (projectConfig.compileMode === ESMODULE && process.env.compilerType && process.env.compilerType === ARK) { validateReExportType(node, pagesDir, transformLog.errors); if (projectConfig.processTs === true) { - writeFileSyncByNode(node, true, projectConfig); + process.env.compileTool === 'rollup' ? ModuleSourceFile.newSourceFile(node.fileName, node) : + writeFileSyncByNode(node, true, projectConfig); } } return node; @@ -145,7 +147,8 @@ export function processUISyntax(program: ts.Program, ut = false): Function { INTERFACE_NODE_SET.clear(); if (projectConfig.compileMode === ESMODULE && projectConfig.processTs === true && process.env.compilerType && process.env.compilerType === ARK) { - writeFileSyncByNode(node, true, projectConfig); + process.env.compileTool === 'rollup' ? ModuleSourceFile.newSourceFile(node.fileName, node) : + writeFileSyncByNode(node, true, projectConfig); } return node; } else { diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 783aa51..a98d914 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -340,6 +340,7 @@ export function isNodeModulesFile(filePath: string, projectConfig: any): boolean } export function generateSourceFilesInHar(sourcePath: string, sourceContent: string, suffix: string, projectConfig: any) { + // compileShared: compile shared har of project let jsFilePath: string = genTemporaryPath(sourcePath, projectConfig.compileShared ? projectConfig.projectRootPath : projectConfig.moduleRootPath, projectConfig.compileShared ? path.resolve(projectConfig.aceModuleBuild, '../etsFortgz') : process.env.cachePath, -- Gitee From 72cc6992c3d477c06f4cd2c13f65809866c12507 Mon Sep 17 00:00:00 2001 From: hufeng Date: Wed, 1 Feb 2023 11:39:36 +0800 Subject: [PATCH 328/379] Adapt to oh_modules Signed-off-by: hufeng Change-Id: I95028a6a674b555b707c0fc8a29b63dd65b0f996 --- compiler/main.js | 1 + compiler/src/ark_utils.ts | 35 ++++++------ .../ark_compiler/common/ark_define.ts | 3 + .../ark_compiler/common/process_ark_config.ts | 8 ++- .../ark_compiler/module/module_mode.ts | 57 ++++++++----------- .../ark_compiler/module/module_source_file.ts | 6 +- compiler/src/fast_build/ark_compiler/utils.ts | 13 +---- compiler/src/gen_abc_plugin.ts | 15 ++--- compiler/src/gen_merged_abc.ts | 12 ++-- compiler/src/pre_define.ts | 1 + compiler/src/utils.ts | 29 +++++----- 11 files changed, 90 insertions(+), 90 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index e76deaa..9885a39 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -593,6 +593,7 @@ function loadModuleInfo(projectConfig, envArgs) { if (buildJsonInfo.compileMode === 'esmodule') { projectConfig.nodeModulesPath = buildJsonInfo.nodeModulesPath; projectConfig.harNameOhmMap = buildJsonInfo.harNameOhmMap; + projectConfig.packageDir = 'node_modules'; } if (projectConfig.compileHar && buildJsonInfo.moduleName && buildJsonInfo.modulePathMap[buildJsonInfo.moduleName]) { diff --git a/compiler/src/ark_utils.ts b/compiler/src/ark_utils.ts index 0afc04f..8b3c4ee 100644 --- a/compiler/src/ark_utils.ts +++ b/compiler/src/ark_utils.ts @@ -18,7 +18,7 @@ import fs from 'fs'; import { minify, MinifyOutput } from 'terser'; import { - NODE_MODULES, + PACKAGES, TEMPORARY, ZERO, ONE, @@ -39,7 +39,7 @@ import { import { isMac, isWindows, - isNodeModulesFile, + isPackageModulesFile, genTemporaryPath, getExtensionIfUnfullySpecifiedFilepath, mkdirsSync, @@ -69,22 +69,21 @@ export function getOhmUrlByFilepath(filePath: string, projectConfig: any, logger // case2: /node_modules/xxx/yyy // case3: /entry/node_modules/xxx/yyy const projectFilePath: string = unixFilePath.replace(projectRootPath, ''); - + const packageDir: string = projectConfig.packageDir; const result: RegExpMatchArray | null = projectFilePath.match(REG_PROJECT_SRC); - if (result && result[1].indexOf(NODE_MODULES) === -1) { + if (result && result[1].indexOf(packageDir) === -1) { return `${bundleName}/${moduleName}/${result[2]}/${result[3]}`; } - if (projectFilePath.indexOf(NODE_MODULES) !== -1) { - - const tryProjectNPM: string = toUnixPath(path.join(projectRootPath, NODE_MODULES)); - if (unixFilePath.indexOf(tryProjectNPM) !== -1) { - return unixFilePath.replace(tryProjectNPM, `${NODE_MODULES}/${ONE}`); + if (projectFilePath.indexOf(packageDir) !== -1) { + const tryProjectPkg: string = toUnixPath(path.join(projectRootPath, packageDir)); + if (unixFilePath.indexOf(tryProjectPkg) !== -1) { + return unixFilePath.replace(tryProjectPkg, `${packageDir}/${ONE}`).replace(packageDir, PACKAGES); } - const tryModuleNPM: string = toUnixPath(path.join(moduleRootPath, NODE_MODULES)); - if (unixFilePath.indexOf(tryModuleNPM) !== -1) { - return unixFilePath.replace(tryModuleNPM, `${NODE_MODULES}/${ZERO}`); + const tryModulePkg: string = toUnixPath(path.join(moduleRootPath, packageDir)); + if (unixFilePath.indexOf(tryModulePkg) !== -1) { + return unixFilePath.replace(tryModulePkg, `${packageDir}/${ZERO}`).replace(packageDir, PACKAGES); } } @@ -255,17 +254,17 @@ export function genBuildPath(filePath: string, projectPath: string, buildPath: s } projectPath = toUnixPath(projectPath); - if (isNodeModulesFile(filePath, projectConfig)) { - filePath = toUnixPath(filePath); - const fakeNodeModulesPath: string = toUnixPath(path.join(projectConfig.projectRootPath, NODE_MODULES)); + if (isPackageModulesFile(filePath, projectConfig)) { + const packageDir: string = projectConfig.packageDir; + const fakePkgModulesPath: string = toUnixPath(path.join(projectConfig.projectRootPath, packageDir)); let output: string = ''; - if (filePath.indexOf(fakeNodeModulesPath) === -1) { + if (filePath.indexOf(fakePkgModulesPath) === -1) { const hapPath: string = toUnixPath(projectConfig.projectRootPath); const tempFilePath: string = filePath.replace(hapPath, ''); - const sufStr: string = tempFilePath.substring(tempFilePath.indexOf(NODE_MODULES) + NODE_MODULES.length + 1); + const sufStr: string = tempFilePath.substring(tempFilePath.indexOf(packageDir) + packageDir.length + 1); output = path.join(projectConfig.nodeModulesPath, ZERO, sufStr); } else { - output = filePath.replace(fakeNodeModulesPath, path.join(projectConfig.nodeModulesPath, ONE)); + output = filePath.replace(fakePkgModulesPath, path.join(projectConfig.nodeModulesPath, ONE)); } return output; } diff --git a/compiler/src/fast_build/ark_compiler/common/ark_define.ts b/compiler/src/fast_build/ark_compiler/common/ark_define.ts index c4af92d..2ae008a 100644 --- a/compiler/src/fast_build/ark_compiler/common/ark_define.ts +++ b/compiler/src/fast_build/ark_compiler/common/ark_define.ts @@ -61,6 +61,9 @@ export const MAX_WORKER_NUMBER: number = 3; export const GEN_ABC_SCRIPT: string = 'gen_abc.js'; export const NODE_MODULES: string = 'node_modules'; +export const OH_MODULES: string = 'oh_modules'; +export const PACKAGES: string = 'pkg_modules'; + export const TS_NOCHECK: string = '// @ts-nocheck'; export const WINDOWS: string = 'Windows_NT'; diff --git a/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts b/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts index 108b4c7..a3c5295 100644 --- a/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts +++ b/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts @@ -18,7 +18,9 @@ import fs from 'fs'; import { TS2ABC, - ESMODULE + ESMODULE, + NODE_MODULES, + OH_MODULES } from './ark_define'; import { isDebug } from '../utils'; import { @@ -80,6 +82,10 @@ export function initArkProjectConfig(projectConfig) { if (buildJsonInfo.compileMode === ESMODULE) { arkProjectConfig.nodeModulesPath = buildJsonInfo.nodeModulesPath; arkProjectConfig.harNameOhmMap = buildJsonInfo.harNameOhmMap; + projectConfig.packageDir = NODE_MODULES; + if (process.env.compileTool === 'rollup' && buildJsonInfo.packageManagerType === 'ohpm') { + projectConfig.packageDir = OH_MODULES; + } } } if (projectConfig.aceModuleJsonPath && fs.existsSync(projectConfig.aceModuleJsonPath)) { diff --git a/compiler/src/fast_build/ark_compiler/module/module_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_mode.ts index c733fb3..caced6a 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_mode.ts @@ -34,13 +34,13 @@ import { MODULES_ABC, MODULES_CACHE, MODULELIST_JSON, - NODE_MODULES, NPMENTRIES_TXT, SOURCEMAPS, SOURCEMAPS_JSON, TEMPORARY, HAP_PACKAGE, - PROJECT_PACKAGE + PROJECT_PACKAGE, + PACKAGES } from '../common/ark_define'; import { ESMODULE, @@ -69,7 +69,7 @@ import { isCurrentProjectFiles } from '../utils'; import { - isNodeModulesFile, + isPackageModulesFile, mkdirsSync, toUnixPath, toHashData, @@ -169,20 +169,9 @@ export class ModuleMode extends CommonMode { if (originPkgEntryPath.startsWith('/')) { originPkgEntryPath = originPkgEntryPath.slice(1, originPkgEntryPath.length); } - let originPkgName: string = this.getNodeModulesFilePkgName(pkgPath); - - let pkgEntryPath: string = ''; - const projectNodeModulesPath: string = toUnixPath(path.join(this.projectConfig.projectRootPath, NODE_MODULES)); - if (pkgPath.includes(projectNodeModulesPath)) { - pkgEntryPath = path.join(NODE_MODULES, PROJECT_PACKAGE, originPkgName); - } else { - pkgEntryPath = path.join(NODE_MODULES, HAP_PACKAGE, originPkgName); - } - pkgEntryPath = toUnixPath(pkgEntryPath); - + let pkgEntryPath: string = toUnixPath(this.getPkgModulesFilePkgName(pkgPath)); let pkgBuildPath: string = path.join(pkgEntryPath, originPkgEntryPath); - pkgBuildPath = pkgBuildPath.substring(0, pkgBuildPath.lastIndexOf('.')); - pkgBuildPath = toUnixPath(pkgBuildPath); + pkgBuildPath = toUnixPath(pkgBuildPath.substring(0, pkgBuildPath.lastIndexOf('.'))); pkgEntryInfos.set(pkgPath, new PackageEntryInfo(pkgEntryPath, pkgBuildPath)); } @@ -221,9 +210,9 @@ export class ModuleMode extends CommonMode { let sourceFile: string = filePath.replace(this.projectConfig.projectRootPath + path.sep, ''); let cacheFilePath: string = ''; let packageName: string = ''; - if (isNodeModulesFile(filePath, this.projectConfig)) { - cacheFilePath = this.genNodeModulesFileCachePath(filePath, this.projectConfig.cachePath, this.projectConfig); - packageName = this.getNodeModulesFilePkgName(metaInfo['packageJson']['pkgPath']); + if (isPackageModulesFile(filePath, this.projectConfig)) { + cacheFilePath = this.genPkgModulesFileCachePath(filePath, this.projectConfig.cachePath, this.projectConfig); + packageName = this.getPkgModulesFilePkgName(metaInfo['packageJson']['pkgPath']); } else { cacheFilePath = this.genFileCachePath(filePath, this.projectConfig.projectPath, this.projectConfig.cachePath); packageName = getPackageInfo(this.projectConfig.aceModuleJsonPath)[1]; @@ -436,33 +425,37 @@ export class ModuleMode extends CommonMode { return output; } - private genNodeModulesFileCachePath(filePath: string, cachePath: string, projectConfig: any, + private genPkgModulesFileCachePath(filePath: string, cachePath: string, projectConfig: any, buildInHar: boolean = false): string { - const fakeNodeModulesPath: string = toUnixPath(path.join(projectConfig.projectRootPath, NODE_MODULES)); + const packageDir: string = projectConfig.packageDir; + const fakePkgModulesPath: string = toUnixPath(path.join(projectConfig.projectRootPath, packageDir)); let output: string = ''; - if (filePath.indexOf(fakeNodeModulesPath) === -1) { + if (filePath.indexOf(fakePkgModulesPath) === -1) { const hapPath: string = toUnixPath(projectConfig.projectRootPath); const tempFilePath: string = filePath.replace(hapPath, ''); - const sufStr: string = tempFilePath.substring(tempFilePath.indexOf(NODE_MODULES) + NODE_MODULES.length + 1); - output = path.join(cachePath, buildInHar ? '' : TEMPORARY, NODE_MODULES, MAIN, sufStr); + const sufStr: string = tempFilePath.substring(tempFilePath.indexOf(packageDir) + packageDir.length + 1); + output = path.join(cachePath, buildInHar ? '' : TEMPORARY, packageDir, MAIN, sufStr); } else { - output = filePath.replace(fakeNodeModulesPath, - path.join(cachePath, buildInHar ? '' : TEMPORARY, NODE_MODULES, AUXILIARY)); + output = filePath.replace(fakePkgModulesPath, + path.join(cachePath, buildInHar ? '' : TEMPORARY, packageDir, AUXILIARY)); } return output; } - private getNodeModulesFilePkgName(pkgPath: string) { + private getPkgModulesFilePkgName(pkgPath: string) { + const packageDir: string = this.projectConfig.packageDir; const projectRootPath = toUnixPath(this.projectConfig.projectRootPath); - const projectNodeModulesPath: string = toUnixPath(path.join(projectRootPath, NODE_MODULES)); + const projectPkgModulesPath: string = toUnixPath(path.join(projectRootPath, packageDir)); let pkgName: string = ''; - if (pkgPath.includes(projectNodeModulesPath)) { - pkgName = pkgPath.replace(projectNodeModulesPath, ''); + if (pkgPath.includes(projectPkgModulesPath)) { + pkgName = path.join(PACKAGES, PROJECT_PACKAGE, pkgPath.replace(projectPkgModulesPath, '')); } else { const tempFilePath: string = pkgPath.replace(projectRootPath, ''); - pkgName = tempFilePath.substring(tempFilePath.indexOf(NODE_MODULES) + NODE_MODULES.length + 1); + pkgName = path.join(PACKAGES, HAP_PACKAGE, + tempFilePath.substring(tempFilePath.indexOf(packageDir) + packageDir.length + 1)); } - return pkgName; + + return pkgName.replace(packageDir, PACKAGES); } private generateProtoFilesInfo() { diff --git a/compiler/src/fast_build/ark_compiler/module/module_source_file.ts b/compiler/src/fast_build/ark_compiler/module/module_source_file.ts index c960bc9..76c9af3 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_source_file.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_source_file.ts @@ -16,8 +16,8 @@ import * as ts from 'typescript'; import MagicString from 'magic-string'; import { - NODE_MODULES, - GEN_ABC_PLUGIN_NAME + GEN_ABC_PLUGIN_NAME, + PACKAGES } from '../common/ark_define'; import { getOhmUrlByFilepath, getOhmUrlByHarName } from '../../../ark_utils'; import { writeFileSyncByNode } from '../../../process_module_files'; @@ -76,7 +76,7 @@ export class ModuleSourceFile { } if (filePath) { const ohmUrl: string = getOhmUrlByFilepath(filePath, ModuleSourceFile.projectConfig, ModuleSourceFile.logger); - return ohmUrl.startsWith(NODE_MODULES) ? `@package:${ohmUrl}` : `@bundle:${ohmUrl}`; + return ohmUrl.startsWith(PACKAGES) ? `@package:${ohmUrl}` : `@bundle:${ohmUrl}`; } return undefined; } diff --git a/compiler/src/fast_build/ark_compiler/utils.ts b/compiler/src/fast_build/ark_compiler/utils.ts index 46c71e6..81617b5 100644 --- a/compiler/src/fast_build/ark_compiler/utils.ts +++ b/compiler/src/fast_build/ark_compiler/utils.ts @@ -27,7 +27,6 @@ import { EXTNAME_JSON, EXTNAME_CJS, EXTNAME_MJS, - NODE_MODULES, TEMPORARY } from './common/ark_define'; import { @@ -115,13 +114,6 @@ function writeFileContent(sourceFilePath: string, filePath: string, content: str fs.writeFileSync(filePath, content, 'utf-8'); } -export function getNodeModulesFilePackageName(projectConfig: any, pkgPath: string) { - const buildPackagePath: string = genBuildPath(pkgPath, projectConfig.projectPath, projectConfig.aceModuleBuild, - projectConfig); - - return toUnixPath(path.join(NODE_MODULES, toUnixPath(buildPackagePath.replace(projectConfig.nodeModulesPath, '')))); -} - export function getEs2abcFileThreadNumber(): number { const fileThreads : number = os.cpus().length < 16 ? os.cpus().length : 16; return fileThreads; @@ -134,10 +126,11 @@ export function isCommonJsPluginVirtualFile(filePath: string): boolean { } export function isCurrentProjectFiles(filePath: string, projectConfig: any): boolean { + const packageDir: string = projectConfig.packageDir; let modulePath: string = projectConfig.modulePathMap[projectConfig.moduleName]; return filePath.indexOf(projectConfig.projectPath) >= 0 || - filePath.indexOf(path.join(projectConfig.projectRootPath, NODE_MODULES)) >= 0 || - filePath.indexOf(path.join(modulePath, NODE_MODULES)) >= 0; + filePath.indexOf(path.join(projectConfig.projectRootPath, packageDir)) >= 0 || + filePath.indexOf(path.join(modulePath, packageDir)) >= 0; } export function genTemporaryModuleCacheDirectoryForBundle(projectConfig: any) { diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index fe8a337..2be1172 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -30,7 +30,7 @@ import { removeDir, validateFilePathLength, unlinkSync, - isNodeModulesFile, + isPackageModulesFile, genTemporaryPath } from './utils'; import { @@ -79,7 +79,8 @@ import { GEN_ABC_SCRIPT, GEN_MODULE_ABC_SCRIPT, AOT_FULL, - AOT_PARTIAL + AOT_PARTIAL, + PACKAGES } from './pre_define'; import { generateMergedAbc, @@ -344,7 +345,7 @@ function getEntryCandidatesFromPackageJson(resourceResolveData: any): Set, module: any): void { let npmPkgPath: string = getEntryInfo(filePath, module.resourceResolveData); const buildNpmPkgPath: string = npmPkgPath.replace(toUnixPath(projectConfig.nodeModulesPath), ''); - const npmPkgName: string = toUnixPath(path.join(NODE_MODULES, buildNpmPkgPath)); + const npmPkgName: string = toUnixPath(path.join(PACKAGES, buildNpmPkgPath)).replace(NODE_MODULES, PACKAGES); const descriptionFileData: any = module.resourceResolveData.descriptionFileData; if (descriptionFileData && descriptionFileData['type'] && descriptionFileData['type'] === 'module') { @@ -378,7 +379,7 @@ function processEtsModule(filePath: string, tempFilePath: string, buildFilePath: buildFilePath = buildFilePath.replace(/\.ets$/, EXTNAME_JS); } const abcFilePath: string = genAbcFileName(tempFilePath); - if (isNodeModulesFile(filePath, projectConfig)) { + if (isPackageModulesFile(filePath, projectConfig)) { processNodeModulesFile(filePath, tempFilePath, buildFilePath, abcFilePath, nodeModulesFile, module); } else { const moduleName: string = getPackageInfo(projectConfig.aceModuleJsonPath)[1]; @@ -398,7 +399,7 @@ function processTsModule(filePath: string, tempFilePath: string, buildFilePath: buildFilePath = buildFilePath.replace(/\.ts$/, EXTNAME_JS); } const abcFilePath: string = genAbcFileName(tempFilePath); - if (isNodeModulesFile(filePath, projectConfig)) { + if (isPackageModulesFile(filePath, projectConfig)) { processNodeModulesFile(filePath, tempFilePath, buildFilePath, abcFilePath, nodeModulesFile, module); } else { const moduleName: string = getPackageInfo(projectConfig.aceModuleJsonPath)[1]; @@ -417,7 +418,7 @@ function processJsModule(filePath: string, tempFilePath: string, buildFilePath: fs.copyFileSync(filePath, tempFilePath); } const abcFilePath: string = genAbcFileName(tempFilePath); - if (isNodeModulesFile(filePath, projectConfig)) { + if (isPackageModulesFile(filePath, projectConfig)) { processNodeModulesFile(filePath, tempFilePath, buildFilePath, abcFilePath, nodeModulesFile, module); } else { const moduleName: string = getPackageInfo(projectConfig.aceModuleJsonPath)[1]; @@ -429,7 +430,7 @@ function processJsModule(filePath: string, tempFilePath: string, buildFilePath: function processJsonModule(filePath: string, tempFilePath: string, buildFilePath: string, nodeModulesFile: Array, module: any): void { const abcFilePath: string = "NA"; - if (isNodeModulesFile(filePath, projectConfig)) { + if (isPackageModulesFile(filePath, projectConfig)) { processNodeModulesFile(filePath, tempFilePath, buildFilePath, abcFilePath, nodeModulesFile, module); } else { const moduleName: string = getPackageInfo(projectConfig.aceModuleJsonPath)[1]; diff --git a/compiler/src/gen_merged_abc.ts b/compiler/src/gen_merged_abc.ts index b42e620..6646fcf 100644 --- a/compiler/src/gen_merged_abc.ts +++ b/compiler/src/gen_merged_abc.ts @@ -25,8 +25,9 @@ import { FILESINFO_TXT, MODULES_CACHE, NPMENTRIES_TXT, - NODE_MODULES, - PATCH_SYMBOL_TABLE + PATCH_SYMBOL_TABLE, + PACKAGES, + NODE_MODULES } from './pre_define'; import { EntryInfo, @@ -70,11 +71,12 @@ export function generateNpmEntriesInfo(entryInfos: Map) { validateFilePathLength(npmEntriesInfoPath); let entriesInfo: string = ''; for (const value of entryInfos.values()) { - const buildPath: string = value.buildPath.replace(toUnixPath(projectConfig.nodeModulesPath), ''); + const buildPath: string = + value.buildPath.replace(toUnixPath(projectConfig.nodeModulesPath), '').replace(NODE_MODULES, PACKAGES); const entryFile: string = toUnixPath(path.join(buildPath, value.entry)); - const entry: string = entryFile.substring(0, entryFile.lastIndexOf('.')); + const entry: string = entryFile.substring(0, entryFile.lastIndexOf('.')).replace(NODE_MODULES, PACKAGES); entriesInfo += - `${toUnixPath(path.join(NODE_MODULES, buildPath))}:${toUnixPath(path.join(NODE_MODULES, entry))}\n`; + `${toUnixPath(path.join(PACKAGES, buildPath))}:${toUnixPath(path.join(PACKAGES, entry))}\n`; } fs.writeFileSync(npmEntriesInfoPath, entriesInfo, 'utf-8'); } diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index bbc0847..a78f7f7 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -87,6 +87,7 @@ export const CUSTOM_DECORATOR_NAME: Set = new Set([ export const EXTNAME_ETS: string = '.ets'; export const NODE_MODULES: string = 'node_modules'; +export const PACKAGES: string = 'pkg_modules'; export const INDEX_ETS: string = 'index.ets'; export const INDEX_TS: string = 'index.ts'; export const PACKAGE_JSON: string = 'package.json'; diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index a98d914..7be8df6 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -28,7 +28,6 @@ import { EXTNAME_MJS, EXTNAME_JS, MAIN, - NODE_MODULES, FAIL, TEMPORARY, ESMODULE @@ -292,17 +291,18 @@ export function genTemporaryPath(filePath: string, projectPath: string, buildPat } projectPath = toUnixPath(projectPath); - if (isNodeModulesFile(filePath, projectConfig)) { - const fakeNodeModulesPath: string = toUnixPath(path.join(projectConfig.projectRootPath, NODE_MODULES)); + if (isPackageModulesFile(filePath, projectConfig)) { + const packageDir: string = projectConfig.packageDir; + const fakePkgModulesPath: string = toUnixPath(path.join(projectConfig.projectRootPath, packageDir)); let output: string = ''; - if (filePath.indexOf(fakeNodeModulesPath) === -1) { + if (filePath.indexOf(fakePkgModulesPath) === -1) { const hapPath: string = toUnixPath(projectConfig.projectRootPath); const tempFilePath: string = filePath.replace(hapPath, ''); - const sufStr: string = tempFilePath.substring(tempFilePath.indexOf(NODE_MODULES) + NODE_MODULES.length + 1); - output = path.join(buildPath, buildInHar ? '' : TEMPORARY, NODE_MODULES, MAIN, sufStr); + const sufStr: string = tempFilePath.substring(tempFilePath.indexOf(packageDir) + packageDir.length + 1); + output = path.join(buildPath, buildInHar ? '' : TEMPORARY, packageDir, MAIN, sufStr); } else { - output = filePath.replace(fakeNodeModulesPath, - path.join(buildPath, buildInHar ? '' : TEMPORARY, NODE_MODULES, AUXILIARY)); + output = filePath.replace(fakePkgModulesPath, + path.join(buildPath, buildInHar ? '' : TEMPORARY, packageDir, AUXILIARY)); } return output; } @@ -316,20 +316,21 @@ export function genTemporaryPath(filePath: string, projectPath: string, buildPat return ''; } -export function isNodeModulesFile(filePath: string, projectConfig: any): boolean { +export function isPackageModulesFile(filePath: string, projectConfig: any): boolean { filePath = toUnixPath(filePath); const hapPath: string = toUnixPath(projectConfig.projectRootPath); const tempFilePath: string = filePath.replace(hapPath, ''); - if (tempFilePath.indexOf(NODE_MODULES) !== -1) { - const fakeNodeModulesPath: string = toUnixPath(path.resolve(projectConfig.projectRootPath, NODE_MODULES)); - if (filePath.indexOf(fakeNodeModulesPath) !== -1) { + const packageDir: string = projectConfig.packageDir; + if (tempFilePath.indexOf(packageDir) !== -1) { + const fakePkgModulesPath: string = toUnixPath(path.resolve(projectConfig.projectRootPath, packageDir)); + if (filePath.indexOf(fakePkgModulesPath) !== -1) { return true; } if (projectConfig.modulePathMap) { for (const key in projectConfig.modulePathMap) { const value: string = projectConfig.modulePathMap[key]; - const fakeModuleNodeModulesPath: string = toUnixPath(path.resolve(value, NODE_MODULES)); - if (filePath.indexOf(fakeModuleNodeModulesPath) !== -1) { + const fakeModulePkgModulesPath: string = toUnixPath(path.resolve(value, packageDir)); + if (filePath.indexOf(fakeModulePkgModulesPath) !== -1) { return true; } } -- Gitee From ddbd225ff0a4bdcc36b325bd6b790282ee56d28f Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Wed, 1 Feb 2023 17:39:31 +0800 Subject: [PATCH 329/379] Fix bugs and reviews of rollup arkCompiler plugin Signed-off-by: chenqy930 Change-Id: I1dc869f5b3eed0629a240c5950ddba1f3ddcfe17 --- compiler/main.js | 4 +- .../ark_compiler/bundle/bundle_mode.ts | 29 +++++++----- .../ark_compiler/common/common_mode.ts | 4 +- .../fast_build/ark_compiler/common/gen_abc.ts | 25 ++++++++-- .../ark_compiler/common/process_ark_config.ts | 11 ++--- .../ark_compiler/generate_module_abc.ts | 6 +-- compiler/src/fast_build/ark_compiler/load.ts | 42 ----------------- .../ark_compiler/module/module_build_mode.ts | 5 +- .../ark_compiler/module/module_mode.ts | 47 +++++++++++-------- .../module/module_preview_mode.ts | 5 +- .../ark_compiler/module/module_source_file.ts | 14 ++++-- .../ark_compiler/rollup-plugin-gen-abc.ts | 6 ++- .../src/fast_build/ark_compiler/transform.ts | 27 +++++------ compiler/src/fast_build/ark_compiler/utils.ts | 16 +++---- .../common/process_project_config.ts | 4 +- .../ets_ui/rollup-plugin-ets-typescript.ts | 5 +- compiler/src/gen_abc_plugin.ts | 2 +- compiler/src/gen_merged_abc.ts | 10 ++-- compiler/src/process_module_files.ts | 10 ++-- compiler/src/process_ui_syntax.ts | 16 +++---- 20 files changed, 149 insertions(+), 139 deletions(-) delete mode 100644 compiler/src/fast_build/ark_compiler/load.ts diff --git a/compiler/main.js b/compiler/main.js index 9885a39..b6af0d7 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -589,7 +589,9 @@ function loadModuleInfo(projectConfig, envArgs) { projectConfig.processTs = false; projectConfig.pandaMode = buildJsonInfo.pandaMode; } - projectConfig.buildArkMode = envArgs.buildMode; + if (envArgs !== undefined) { + projectConfig.buildArkMode = envArgs.buildMode; + } if (buildJsonInfo.compileMode === 'esmodule') { projectConfig.nodeModulesPath = buildJsonInfo.nodeModulesPath; projectConfig.harNameOhmMap = buildJsonInfo.harNameOhmMap; diff --git a/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts b/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts index 79df7b9..51d73fe 100644 --- a/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts +++ b/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts @@ -28,12 +28,14 @@ import { isSpecifiedExt } from '../utils'; import { + ES2ABC, EXTNAME_ABC, EXTNAME_JS, FILESINFO_TXT, JSBUNDLE, MAX_WORKER_NUMBER, TEMP_JS, + TS2ABC, blue, FAIL, reset @@ -90,11 +92,11 @@ export class BundleMode extends CommonMode { } else if (rollupBundleFileSet[fileName].type === 'chunk') { rollupBundleSourceCode = rollupBundleFileSet[fileName].code; } else { - throw Error('ArkTS:ERROR failed to get rollup bundle file source code'); + this.throwArkTsCompilerError('ArkTS:ERROR failed to get rollup bundle file source code'); } fs.writeFileSync(cacheOutputPath, rollupBundleSourceCode, 'utf-8'); if (!fs.existsSync(cacheOutputPath)) { - throw Error('ArkTS:ERROR failed to generate cached source file'); + this.throwArkTsCompilerError('ArkTS:ERROR failed to generate cached source file'); } this.collectIntermediateJsBundle(outputPath, cacheOutputPath); } @@ -121,7 +123,7 @@ export class BundleMode extends CommonMode { const cacheFilePath: string = value.cacheFilePath; const cacheAbcFilePath: string = changeFileExtension(cacheFilePath, EXTNAME_ABC); if (!fs.existsSync(cacheFilePath)) { - throw Error(`ArkTS:ERROR ${cacheFilePath} is lost`); + this.throwArkTsCompilerError(`ArkTS:ERROR ${cacheFilePath} is lost`); } if (fs.existsSync(cacheAbcFilePath)) { const hashCacheFileContentData: any = toHashData(cacheFilePath); @@ -148,7 +150,8 @@ export class BundleMode extends CommonMode { const splittedBundles: any[] = this.getSplittedBundles(); this.invokeTs2AbcWorkersToGenAbc(splittedBundles); } else { - throw Error('ArkTS:ERROR please set panda mode'); + this.throwArkTsCompilerError(`Invalid projectConfig.pandaMode for bundle build, should be either + "${TS2ABC}" or "${ES2ABC}"`); } } @@ -191,21 +194,21 @@ export class BundleMode extends CommonMode { }); child.on('exit', (code: any) => { if (code === FAIL) { - throw Error('ArkTS:ERROR failed to execute es2abc'); + this.throwArkTsCompilerError('ArkTS:ERROR failed to execute es2abc'); } this.afterCompilationProcess(); this.signalHandler(); }); child.on('error', (err: any) => { - throw Error(err.toString()); + this.throwArkTsCompilerError(err.toString()); }); child.stderr.on('data', (data: any) => { this.logger.error(blue, data.toString(), reset); }); } catch (e) { - throw Error('ArkTS:ERROR failed to execute es2abc with async handler: ' + e.toString()); + this.throwArkTsCompilerError('ArkTS:ERROR failed to execute es2abc with async handler: ' + e.toString()); } } @@ -260,14 +263,18 @@ export class BundleMode extends CommonMode { mode: JSBUNDLE }; this.asyncHandler(() => { - cluster.fork(workerData); + let worker = cluster.fork(workerData); + worker.on("message", (errorMsg) => { + this.logger.error(errorMsg.data.toString()); + this.throwArkTsCompilerError('ArkTS:ERROR failed to execute ts2abc, received error message.'); + }) }); } let workerCount: number = 0; cluster.on('exit', (worker, code, signal) => { if (code === FAIL) { - throw Error('ArkTS:ERROR failed to execute ts2abc'); + this.throwArkTsCompilerError('ArkTS:ERROR failed to execute ts2abc, exit code non-zero'); } workerCount++; if (workerCount === workerNumber) { @@ -324,7 +331,7 @@ export class BundleMode extends CommonMode { const cacheFilePath: string = this.filterIntermediateJsBundle[i].cacheFilePath; const cacheAbcFilePath: string = changeFileExtension(cacheFilePath, EXTNAME_ABC); if (!fs.existsSync(cacheFilePath) || !fs.existsSync(cacheAbcFilePath)) { - throw Error(`ArkTS:ERROR ${cacheFilePath} or ${cacheAbcFilePath} is lost`); + this.throwArkTsCompilerError(`ArkTS:ERROR ${cacheFilePath} or ${cacheAbcFilePath} is lost`); } const hashCacheFileContentData: any = toHashData(cacheFilePath); const hashCacheAbcContentData: any = toHashData(cacheAbcFilePath); @@ -340,7 +347,7 @@ export class BundleMode extends CommonMode { const abcFilePath: string = changeFileExtension(value.filePath, EXTNAME_ABC, TEMP_JS); const cacheAbcFilePath: string = changeFileExtension(value.cacheFilePath, EXTNAME_ABC); if (!fs.existsSync(cacheAbcFilePath)) { - throw Error(`ArkTS:ERROR ${cacheAbcFilePath} is lost`); + this.throwArkTsCompilerError(`ArkTS:ERROR ${cacheAbcFilePath} is lost`); } const parent: string = path.join(abcFilePath, '..'); if (!(fs.existsSync(parent) && fs.statSync(parent).isDirectory())) { diff --git a/compiler/src/fast_build/ark_compiler/common/common_mode.ts b/compiler/src/fast_build/ark_compiler/common/common_mode.ts index 73b3536..159b4a1 100644 --- a/compiler/src/fast_build/ark_compiler/common/common_mode.ts +++ b/compiler/src/fast_build/ark_compiler/common/common_mode.ts @@ -39,6 +39,7 @@ export class CommonMode { arkConfig: any; cmdArgs: string[] = []; logger: any; + throwArkTsCompilerError: any; hashJsonFilePath: string; genAbcScriptPath: string; asyncHandler: any; @@ -49,6 +50,7 @@ export class CommonMode { this.arkConfig = initArkConfig(this.projectConfig); this.cmdArgs = this.initCmdEnv(); this.logger = rollupObject.share.getLogger(GEN_ABC_PLUGIN_NAME); + this.throwArkTsCompilerError = rollupObject.share.throwArkTsCompilerError; this.hashJsonFilePath = this.genHashJsonFilePath(); this.genAbcScriptPath = path.resolve(__dirname, GEN_ABC_SCRIPT); this.asyncHandler = rollupObject.async; @@ -76,7 +78,7 @@ export class CommonMode { args.push('--debug-info'); } } else { - throw Error('ArkTS:ERROR please set panda mode'); + this.throwArkTsCompilerError('ArkTS:ERROR please set panda mode'); } return args; diff --git a/compiler/src/fast_build/ark_compiler/common/gen_abc.ts b/compiler/src/fast_build/ark_compiler/common/gen_abc.ts index da6fbe6..fc8ebfc 100644 --- a/compiler/src/fast_build/ark_compiler/common/gen_abc.ts +++ b/compiler/src/fast_build/ark_compiler/common/gen_abc.ts @@ -38,9 +38,9 @@ function genAbcByWorkersOfBundleMode(jsonInput: string, cmd: string): Promise { if (err) { - throw Error('ArkTS:ERROR failed to write cache sourceMaps json'); + this.throwArkTsCompilerError('ArkTS:ERROR failed to write cache sourceMaps json'); } }); } @@ -288,25 +290,25 @@ export class ModuleMode extends CommonMode { }); child.on('exit', (code: any) => { if (code === FAIL) { - throw Error('ArkTS:ERROR failed to execute es2abc'); + this.throwArkTsCompilerError('ArkTS:ERROR failed to execute es2abc'); } this.signalHandler(); }); child.on('error', (err: any) => { - throw Error(err.toString()); + this.throwArkTsCompilerError(err.toString()); }); child.stderr.on('data', (data: any) => { this.logger.error(red, data.toString(), reset); }); } catch (e) { - throw Error('ArkTS:ERROR failed to execute es2abc. Error message: ' + e.toString()); + this.throwArkTsCompilerError('ArkTS:ERROR failed to execute es2abc. Error message: ' + e.toString()); } } filterModulesByHashJson() { - if (this.hashJsonFilePath.length === 0) { + if (this.hashJsonFilePath.length === 0 || !fs.existsSync(this.hashJsonFilePath)) { for (const key of this.moduleInfos.keys()) { this.filterModuleInfos.set(key, this.moduleInfos.get(key)); } @@ -325,7 +327,7 @@ export class ModuleMode extends CommonMode { const cacheFilePath: string = value.cacheFilePath; const cacheProtoFilePath: string = changeFileExtension(cacheFilePath, EXTNAME_PROTO_BIN); if (!fs.existsSync(cacheFilePath)) { - throw Error(`ArkTS:ERROR ${cacheFilePath} is lost`); + this.throwArkTsCompilerError(`ArkTS:ERROR ${cacheFilePath} is lost`); } if (fs.existsSync(cacheProtoFilePath)) { const hashCacheFileContentData: any = toHashData(cacheFilePath); @@ -387,7 +389,11 @@ export class ModuleMode extends CommonMode { cachePath: this.projectConfig.cachePath }; this.asyncHandler(() => { - cluster.fork(workerData); + let worker = cluster.fork(workerData); + worker.on("message", (errorMsg) => { + this.logger.error(errorMsg.data.toString()); + this.throwArkTsCompilerError('ArkTS:ERROR failed to execute ts2abc'); + }); }); } } @@ -399,7 +405,7 @@ export class ModuleMode extends CommonMode { if (isMasterOrPrimary()) { cluster.on('exit', (worker, code, signal) => { if (code === FAIL) { - throw Error('ArkTS:ERROR failed to execute ts2abc'); + this.throwArkTsCompilerError('ArkTS:ERROR failed to execute ts2abc'); } workerCount++; if (workerCount === this.workerNumber) { @@ -429,6 +435,7 @@ export class ModuleMode extends CommonMode { buildInHar: boolean = false): string { const packageDir: string = projectConfig.packageDir; const fakePkgModulesPath: string = toUnixPath(path.join(projectConfig.projectRootPath, packageDir)); + filePath = toUnixPath(filePath); let output: string = ''; if (filePath.indexOf(fakePkgModulesPath) === -1) { const hapPath: string = toUnixPath(projectConfig.projectRootPath); @@ -443,6 +450,7 @@ export class ModuleMode extends CommonMode { } private getPkgModulesFilePkgName(pkgPath: string) { + pkgPath = toUnixPath(pkgPath); const packageDir: string = this.projectConfig.packageDir; const projectRootPath = toUnixPath(this.projectConfig.projectRootPath); const projectPkgModulesPath: string = toUnixPath(path.join(projectRootPath, packageDir)); @@ -477,15 +485,14 @@ export class ModuleMode extends CommonMode { const cmd: any = `"${this.arkConfig.mergeAbcPath}" --input "@${this.protoFilePath}" --outputFilePath "${ this.projectConfig.aceModuleBuild}" --output ${MODULES_ABC} --suffix protoBin`; try { - childProcess.execSync(cmd); + childProcess.execSync(cmd, { windowsHide: true }); } catch (e) { - throw Error(`ArkTS:ERROR failed to merge proto file to abc, error message:` + e.toString()); + this.throwArkTsCompilerError(`ArkTS:ERROR failed to merge proto file to abc, error message:` + e.toString()); } } private afterCompilationProcess() { this.writeHashJson(); - this.cleanInfo(); } private writeHashJson() { @@ -497,7 +504,7 @@ export class ModuleMode extends CommonMode { const cacheFilePath: string = value.cacheFilePath; const cacheProtoFilePath: string = changeFileExtension(cacheFilePath, EXTNAME_PROTO_BIN); if (!fs.existsSync(cacheFilePath) || !fs.existsSync(cacheProtoFilePath)) { - throw Error( + this.throwArkTsCompilerError( `ArkTS:ERROR ${cacheFilePath} or ${cacheProtoFilePath} is lost` ); } @@ -518,9 +525,9 @@ export class ModuleMode extends CommonMode { const cmd: string = `"${this.arkConfig.js2abcPath}" --compile-npm-entries "${ this.npmEntriesInfoPath}" "${this.npmEntriesProtoFilePath}"`; try { - childProcess.execSync(cmd); + childProcess.execSync(cmd, { windowsHide: true }); } catch (e) { - throw Error(`ArkTS:ERROR failed to generate npm proto file to abc. Error message: ` + e.toString()); + this.throwArkTsCompilerError(`ArkTS:ERROR failed to generate npm proto file to abc. Error message: ` + e.toString()); } } } diff --git a/compiler/src/fast_build/ark_compiler/module/module_preview_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_preview_mode.ts index 44c07db..b77d5b0 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_preview_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_preview_mode.ts @@ -14,6 +14,7 @@ */ import { ModuleMode } from './module_mode'; +import { ES2ABC, TS2ABC } from '../common/ark_define'; import { isEs2Abc, isTs2Abc } from '../../../ark_utils'; export class ModulePreviewMode extends ModuleMode { @@ -33,11 +34,13 @@ export class ModulePreviewMode extends ModuleMode { } else if (isTs2Abc(this.projectConfig)) { this.filterModulesByHashJson(); const splittedModules: any[] = this.getSplittedModulesByNumber(); + this.workerNumber = splittedModules.length; this.generateTs2AbcCmd(); this.invokeTs2AbcWorkersToGenProto(splittedModules); this.processTs2abcWorkersToGenAbc(); } else { - throw Error('ArkTS:ERROR please set panda mode'); + this.throwArkTsCompilerError(`Invalid projectConfig.pandaMode for module preview, should be either + "${TS2ABC}" or "${ES2ABC}"`); } } } diff --git a/compiler/src/fast_build/ark_compiler/module/module_source_file.ts b/compiler/src/fast_build/ark_compiler/module/module_source_file.ts index 76c9af3..b4c3f4c 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_source_file.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_source_file.ts @@ -51,9 +51,9 @@ export class ModuleSourceFile { ModuleSourceFile.sourceFiles.push(new ModuleSourceFile(moduleId, source)); } - static processModuleSourceFiles(rollupObject: any) { + static async processModuleSourceFiles(rollupObject: any) { this.initPluginEnv(rollupObject); - ModuleSourceFile.sourceFiles.forEach((source: ModuleSourceFile) => { + await ModuleSourceFile.sourceFiles.forEach((source: ModuleSourceFile) => { source.processModuleRequest(rollupObject); source.writeSourceFile(); }); @@ -113,7 +113,7 @@ export class ModuleSourceFile { this.source = code.toString(); } - private processTransformedTsmoduleRequest(rollupObject: any) { + private processTransformedTsModuleRequest(rollupObject: any) { const moduleInfo: any = rollupObject.getModuleInfo(this.moduleId); const importMap: any = moduleInfo.importedIdMaps; (this.source)!.forEachChild((childNode: ts.Node) => { @@ -133,6 +133,9 @@ export class ModuleSourceFile { }); } + // Replace each module request in source file to a unique representation which is called 'ohmUrl'. + // This 'ohmUrl' will be the same as the record name for each file, to make sure runtime can find the corresponding + // record based on each module request. processModuleRequest(rollupObject: any) { if (isJsonSourceFile(this.moduleId)) { return; @@ -141,7 +144,10 @@ export class ModuleSourceFile { this.processJsModuleRequest(rollupObject); return; } - this.isSourceNode ? this.processTransformedTsmoduleRequest(rollupObject) : + + // Only when files were transformed to ts, the corresponding ModuleSourceFile were initialized with sourceFile node, + // if files were transformed to js, ModuleSourceFile were initialized with srouce string. + this.isSourceNode ? this.processTransformedTsModuleRequest(rollupObject) : this.processTransformedJsModuleRequest(rollupObject); } diff --git a/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts b/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts index d3aadfc..d516fd2 100644 --- a/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts +++ b/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts @@ -13,15 +13,17 @@ * limitations under the License. */ +import { initArkProjectConfig } from './common/process_ark_config'; import { generateBundleAbc } from './generate_bundle_abc'; import { generateModuleAbc } from './generate_module_abc'; -import { load } from './load'; import { transformForModule } from './transform'; export function genAbc() { return { name: 'genAbc', - load: load, + buildStart() { + this.share.arkProjectConfig = initArkProjectConfig(this.share.projectConfig); + }, transform: transformForModule, buildEnd: generateModuleAbc, generateBundle: generateBundleAbc diff --git a/compiler/src/fast_build/ark_compiler/transform.ts b/compiler/src/fast_build/ark_compiler/transform.ts index 11a9842..5081356 100644 --- a/compiler/src/fast_build/ark_compiler/transform.ts +++ b/compiler/src/fast_build/ark_compiler/transform.ts @@ -17,15 +17,15 @@ import path from 'path'; import { ESMODULE, - EXTNAME_ETS, - EXTNAME_TS } from './common/ark_define'; import { ModuleSourceFile } from './module/module_source_file'; import { + isAotMode, isCommonJsPluginVirtualFile, isDebug, + isJsonSourceFile, isJsSourceFile, - isSpecifiedExt + isTsOrEtsSourceFile } from './utils'; import { toUnixPath } from '../../utils'; @@ -33,29 +33,28 @@ export let newSourceMaps: Object = {}; /** * rollup transform hook - * @param {string} code: source code of an input file + * @param {string} code: transformed source code of an input file * @param {string} id: absolute path of an input file */ export function transformForModule(code: string, id: string) { if (this.share.projectConfig.compileMode === ESMODULE) { const projectConfig: any = Object.assign(this.share.arkProjectConfig, this.share.projectConfig); - preserveTsAndEtsSourceContent(id, code); - if (isDebug(projectConfig)) { - preserveSourceMap(id, this.getCombinedSourcemap(), projectConfig); + if (isTsOrEtsSourceFile(id) && !isAotMode(projectConfig)) { + if (isDebug(projectConfig)) { + preserveSourceMap(id, this.getCombinedSourcemap(), projectConfig); + } + ModuleSourceFile.newSourceFile(id, code); } - } -} -function preserveTsAndEtsSourceContent(sourceFilePath: string, code: string): void { - if (isSpecifiedExt(sourceFilePath, EXTNAME_ETS) || isSpecifiedExt(sourceFilePath, EXTNAME_TS)) { - ModuleSourceFile.newSourceFile(sourceFilePath, code); + if (isJsSourceFile(id) || isJsonSourceFile(id)) { + ModuleSourceFile.newSourceFile(id, this.getModuleInfo(id).originalCode); + } } } function preserveSourceMap(sourceFilePath: string, sourcemap: any, projectConfig: any): void { - if (isCommonJsPluginVirtualFile(sourceFilePath) || isJsSourceFile(sourceFilePath)) { + if (isCommonJsPluginVirtualFile(sourceFilePath)) { // skip automatic generated files like 'jsfile.js?commonjs-exports' - // skip js/cjs/mjs file sourcemap return; } diff --git a/compiler/src/fast_build/ark_compiler/utils.ts b/compiler/src/fast_build/ark_compiler/utils.ts index 81617b5..66ec9e5 100644 --- a/compiler/src/fast_build/ark_compiler/utils.ts +++ b/compiler/src/fast_build/ark_compiler/utils.ts @@ -33,15 +33,11 @@ import { compareNodeVersion, genTemporaryPath, mkdirsSync, - toUnixPath, validateFilePathLength } from '../../utils'; import { - genBuildPath, - transformModuleSpecifier, writeMinimizedSourceCode } from '../../ark_utils'; -import { processSystemApi } from '../../validate_ui_syntax'; export function isAotMode(projectConfig: any): boolean { return projectConfig.compileMode === ESMODULE && ( @@ -58,9 +54,9 @@ export function isMasterOrPrimary() { } export function changeFileExtension(file: string, targetExt: string, originExt = ''): string { - let basename: string = originExt.length == 0 ? path.basename(file, path.extname(file)) : - path.basename(file, originExt); - return path.join(path.dirname(file), basename + targetExt); + let currentExt = originExt.length == 0 ? path.extname(file) : originExt; + let fileWithoutExt = file.substring(0, file.lastIndexOf(currentExt)); + return fileWithoutExt + targetExt; } export function writeFileContentToTempDir(id: string, content: string, projectConfig: any, logger: any) { @@ -102,8 +98,6 @@ function writeFileContent(sourceFilePath: string, filePath: string, content: str filePath = changeFileExtension(filePath, EXTNAME_JS); } - transformModuleSpecifier(sourceFilePath, processSystemApi(content, true), projectConfig); - mkdirsSync(path.dirname(filePath)); if ((projectConfig.compileHar && projectConfig.obfuscateHarType === 'uglify') || !isDebug(projectConfig)) { @@ -155,6 +149,10 @@ export function genCachePath(tailName: string, projectConfig: any, logger: any): return pathName; } +export function isTsOrEtsSourceFile(file: string): boolean { + return /(?) { moduleInfos = tempModuleInfos; const filesInfoPath: string = path.join(process.env.cachePath, FILESINFO_TXT); - validateFilePathLength(filesInfoPath); + validateFilePathLength(filesInfoPath, logger); let filesInfo: string = ''; moduleInfos.forEach(info => { const moduleType: string = info.isCommonJs ? 'commonjs' : 'esm'; @@ -68,7 +68,7 @@ function generateCompileFilesInfo(moduleInfos: Array) { export function generateNpmEntriesInfo(entryInfos: Map) { const npmEntriesInfoPath: string = path.join(process.env.cachePath, NPMENTRIES_TXT); - validateFilePathLength(npmEntriesInfoPath); + validateFilePathLength(npmEntriesInfoPath, logger); let entriesInfo: string = ''; for (const value of entryInfos.values()) { const buildPath: string = @@ -88,7 +88,7 @@ export function generateMergedAbc(moduleInfos: Array, entryInfos: Ma const filesInfoPath: string = path.join(process.env.cachePath, FILESINFO_TXT); const npmEntriesInfoPath: string = path.join(process.env.cachePath, NPMENTRIES_TXT); const cacheFilePath: string = path.join(process.env.cachePath, MODULES_CACHE); - validateFilePathLength(cacheFilePath); + validateFilePathLength(cacheFilePath, logger); const fileThreads = os.cpus().length < 16 ? os.cpus().length : 16; mkdirsSync(projectConfig.buildPath); let genAbcCmd: string = diff --git a/compiler/src/process_module_files.ts b/compiler/src/process_module_files.ts index 5fb04d4..933e8f8 100644 --- a/compiler/src/process_module_files.ts +++ b/compiler/src/process_module_files.ts @@ -17,6 +17,7 @@ import path from 'path'; import ts from 'typescript'; import fs from 'fs'; +import { newSourceMaps as rollupNewSourceMaps } from './fast_build/ark_compiler/transform'; import { EXTNAME_JS, EXTNAME_TS, @@ -30,7 +31,7 @@ import { } from './utils'; import { genSourceMapFileName, - newSourceMaps, + newSourceMaps as webpackNewSourceMaps, transformModuleSpecifier } from './ark_utils'; import { processSystemApi } from './validate_ui_syntax'; @@ -71,7 +72,8 @@ export function writeFileSyncByNode(node: ts.SourceFile, toTsFile: boolean, proj mkdirsSync(path.dirname(temporaryFile)); if (temporarySourceMapFile.length > 0 && projectConfig.buildArkMode === 'debug') { let source = toUnixPath(node.fileName).replace(toUnixPath(projectConfig.projectRootPath) + '/', ''); - newSourceMaps[source] = mixedInfo.sourceMapJson; + process.env.compileTool === 'rollup' ? rollupNewSourceMaps[source] = mixedInfo.sourceMapJson : + webpackNewSourceMaps[source] = mixedInfo.sourceMapJson; } fs.writeFileSync(temporaryFile, mixedInfo.content); } @@ -111,7 +113,9 @@ function genContentAndSourceMapInfo(node: ts.SourceFile, toTsFile: boolean, proj if (toTsFile) { content = content.replace(`${TS_NOCHECK};`, TS_NOCHECK); } - content = transformModuleSpecifier(fileName, processSystemApi(content, true), projectConfig); + if (process.env.compileTool !== 'rollup') { + content = transformModuleSpecifier(fileName, processSystemApi(content, true), projectConfig); + } return { content: content, diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 24d8541..65794b2 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -117,11 +117,12 @@ export function processUISyntax(program: ts.Program, ut = false): Function { path.resolve(node.fileName) === path.resolve(projectConfig.projectPath, 'app.ets') || /\.ts$/.test(node.fileName))) { node = ts.visitEachChild(node, processResourceNode, context); - if (projectConfig.compileMode === ESMODULE && process.env.compilerType && process.env.compilerType === ARK) { + if (projectConfig.compileMode === ESMODULE) { validateReExportType(node, pagesDir, transformLog.errors); if (projectConfig.processTs === true) { - process.env.compileTool === 'rollup' ? ModuleSourceFile.newSourceFile(node.fileName, node) : - writeFileSyncByNode(node, true, projectConfig); + process.env.compileTool === 'rollup' ? + ModuleSourceFile.newSourceFile(path.normalize(node.fileName), node) : + writeFileSyncByNode(node, true, projectConfig); } } return node; @@ -129,7 +130,7 @@ export function processUISyntax(program: ts.Program, ut = false): Function { const id: number = ++componentInfo.id; node = ts.visitEachChild(node, processAllNodes, context); node = createEntryNode(node, context, entryNodeKey, id); - if (projectConfig.compileMode === ESMODULE && process.env.compilerType && process.env.compilerType === ARK) { + if (projectConfig.compileMode === ESMODULE) { validateReExportType(node, pagesDir, transformLog.errors); } GLOBAL_STYLE_FUNCTION.forEach((block, styleName) => { @@ -145,10 +146,9 @@ export function processUISyntax(program: ts.Program, ut = false): Function { }); node = ts.factory.updateSourceFile(node, statements); INTERFACE_NODE_SET.clear(); - if (projectConfig.compileMode === ESMODULE && projectConfig.processTs === true - && process.env.compilerType && process.env.compilerType === ARK) { - process.env.compileTool === 'rollup' ? ModuleSourceFile.newSourceFile(node.fileName, node) : - writeFileSyncByNode(node, true, projectConfig); + if (projectConfig.compileMode === ESMODULE && projectConfig.processTs === true) { + process.env.compileTool === 'rollup' ? ModuleSourceFile.newSourceFile(path.normalize(node.fileName), node) : + writeFileSyncByNode(node, true, projectConfig); } return node; } else { -- Gitee From 01315190c94e716a620775db1d67501bedc34221 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Sat, 4 Feb 2023 15:28:53 +0800 Subject: [PATCH 330/379] fixed 50aa81c from https://gitee.com/houhaoyu/developtools_ace_ets2bundle/pulls/1807 houhaoyu@huawei.com judge oh_module&oh-package.json5 Signed-off-by: houhaoyu Change-Id: I915019a95e84e29e23c53f5edfd15c4cb5f56fdc --- compiler/main.js | 21 +++++++++++++-------- compiler/src/ets_checker.ts | 7 ++++++- compiler/src/process_import.ts | 23 ++++++++++------------- compiler/src/utils.ts | 10 +++++----- 4 files changed, 34 insertions(+), 27 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index b6af0d7..7c1d623 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -90,6 +90,8 @@ function initProjectConfig(projectConfig) { projectConfig.splitCommon = false; projectConfig.checkEntry = projectConfig.checkEntry || process.env.checkEntry; projectConfig.obfuscateHarType = projectConfig.obfuscateHarType || process.env.obfuscate; + projectConfig.packageDir = 'node_modules'; + projectConfig.packageJson = 'package.json'; } function loadEntryObj(projectConfig) { @@ -174,7 +176,7 @@ function buildManifest(manifest, aceConfigPath) { break; } } else { - throw Error('\u001b[31m'+ + throw Error('\u001b[31m' + 'ERROR: the config.json file miss key word module || module[abilities].' + '\u001b[39m').message; } @@ -189,7 +191,7 @@ function buildManifest(manifest, aceConfigPath) { } function getPackageJsonEntryPath() { - let rootPackageJsonPath = path.resolve(projectConfig.projectPath, '../../../package.json'); + let rootPackageJsonPath = path.resolve(projectConfig.projectPath, '../../../' + projectConfig.packageJson); if (fs.existsSync(rootPackageJsonPath)) { let rootPackageJsonContent = JSON.parse(fs.readFileSync(rootPackageJsonPath, 'utf-8')); if (rootPackageJsonContent) { @@ -201,7 +203,7 @@ function getPackageJsonEntryPath() { getEntryPath('', rootPackageJsonPath); } } else { - throw Error('\u001b[31m'+ 'lack message in package.json.' + '\u001b[39m').message; + throw Error('\u001b[31m' + 'lack message in ' + projectConfig.packageJson + '.' + '\u001b[39m').message; } } } @@ -214,7 +216,7 @@ function supportSuffix(mainEntryPath) { } else if (fs.existsSync(path.join(mainEntryPath, 'index.js'))) { mainEntryPath = path.join(mainEntryPath, 'index.js'); } else { - throw Error('\u001b[31m' + 'not find entry file in package.json.' + '\u001b[39m').message; + throw Error('\u001b[31m' + 'not find entry file in ' + projectConfig.packageJson + '.' + '\u001b[39m').message; } return mainEntryPath; } @@ -397,7 +399,7 @@ function setCardPages(extensionAbilities) { if (metadata.resource) { readCardResource(metadata.resource); } - }) + }); } }); } @@ -411,7 +413,7 @@ function readCardResource(resource) { if (cardConfig.forms) { cardConfig.forms.forEach(form => { readCardForm(form); - }) + }); } } } @@ -451,7 +453,7 @@ function loadWorker(projectConfig, workerFileEntry) { .replace(/\.(ts|js)$/, '').replace(/\\/g, '/'); projectConfig.entryObj[`./${WORKERS_DIR}/` + relativePath] = item; } - }) + }); } } } @@ -469,6 +471,10 @@ function initBuildInfo() { aceBuildJson.modulePathMap[aceBuildJson.moduleName]) { projectConfig.moduleRootPath = aceBuildJson.modulePathMap[aceBuildJson.moduleName]; } + if (aceBuildJson.packageManagerType === 'ohpm') { + projectConfig.packageDir = 'oh_modules'; + projectConfig.packageJson = 'oh-package.json5'; + } } function readWorkerFile() { @@ -595,7 +601,6 @@ function loadModuleInfo(projectConfig, envArgs) { if (buildJsonInfo.compileMode === 'esmodule') { projectConfig.nodeModulesPath = buildJsonInfo.nodeModulesPath; projectConfig.harNameOhmMap = buildJsonInfo.harNameOhmMap; - projectConfig.packageDir = 'node_modules'; } if (projectConfig.compileHar && buildJsonInfo.moduleName && buildJsonInfo.modulePathMap[buildJsonInfo.moduleName]) { diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index 2937466..2410696 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -89,6 +89,11 @@ function setCompilerOptions() { 'lib.es2020.d.ts' ] }); + if (projectConfig.packageDir === 'oh_modules') { + Object.assign(compilerOptions, { + 'packageManagerType': 'ohpm' + }); + } } interface extendInfo { @@ -191,7 +196,7 @@ export function serviceChecker(rootFileNames: string[], newLogger: any = null): } if (projectConfig.compileHar || projectConfig.compileShared) { [...allResolvedModules, ...rootFileNames].forEach(moduleFile => { - if (!(moduleFile.match(/node_modules/) && projectConfig.compileHar)) { + if (!(moduleFile.match(new RegExp(projectConfig.packageDir)) && projectConfig.compileHar)) { try { const emit: any = languageService.getEmitOutput(moduleFile, true, true); if (emit.outputFiles[0]) { diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index 2bfbd0d..ac9b026 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -20,12 +20,8 @@ import path from 'path'; import { EXTNAME_ETS, EXTNAME_TS, - NODE_MODULES, INDEX_ETS, INDEX_TS, - PACKAGE_JSON, - STRUCT, - CLASS, CUSTOM_COMPONENT_DEFAULT, CUSTOM_DECORATOR_NAME, COMPONENT_DECORATOR_ENTRY, @@ -482,7 +478,7 @@ function hasCollection(node: ts.Identifier): boolean { } function isModule(filePath: string): boolean { - return !/^(\.|\.\.)?\//.test(filePath) || filePath.indexOf(NODE_MODULES) > -1; + return !/^(\.|\.\.)?\//.test(filePath) || filePath.indexOf(projectConfig.packageDir) > -1; } function isCustomComponent(node: ts.StructDeclaration): boolean { @@ -501,7 +497,7 @@ function isCustomComponent(node: ts.StructDeclaration): boolean { let packageJsonEntry: string = ''; function isPackageJsonEntry(filePath: string): boolean { - const packageJsonPath: string = path.join(filePath, PACKAGE_JSON); + const packageJsonPath: string = path.join(filePath, projectConfig.packageJson); if (fs.existsSync(packageJsonPath)) { let entryTypes: string; let entryMain: string; @@ -523,7 +519,8 @@ function isPackageJsonEntry(filePath: string): boolean { } function entryExist(filePath: string, entry: string): boolean { - return typeof entry === 'string' && fs.existsSync(path.resolve(filePath, entry)); + return typeof entry === 'string' && fs.existsSync(path.resolve(filePath, entry)) && + fs.statSync(path.resolve(filePath, entry)).isFile(); } function getModuleFilePath(filePath: string): string { @@ -557,10 +554,10 @@ function getFileResolvePath(fileResolvePath: string, pagesDir: string, filePath: } let curPageDir: string = pagesDir; while (!fs.existsSync(fileResolvePath)) { - if (filePath.indexOf(NODE_MODULES) > -1) { + if (filePath.indexOf(projectConfig.packageDir) > -1) { fileResolvePath = path.join(curPageDir, filePath); } else { - fileResolvePath = path.join(curPageDir, NODE_MODULES, filePath); + fileResolvePath = path.join(curPageDir, projectConfig.packageDir, filePath); } if (fs.existsSync(fileResolvePath + EXTNAME_ETS)) { fileResolvePath = fileResolvePath + EXTNAME_ETS; @@ -597,9 +594,9 @@ export function getFileFullPath(filePath: string, pagesDir: string): string { } let fileResolvePath: string; - if (/^(\.|\.\.)\//.test(filePath) && filePath.indexOf(NODE_MODULES) < 0) { + if (/^(\.|\.\.)\//.test(filePath) && filePath.indexOf(projectConfig.packageDir) < 0) { fileResolvePath = path.resolve(pagesDir, filePath); - } else if (/^\//.test(filePath) && filePath.indexOf(NODE_MODULES) < 0 || + } else if (/^\//.test(filePath) && filePath.indexOf(projectConfig.packageDir) < 0 || fs.existsSync(filePath) && fs.statSync(filePath).isFile()) { fileResolvePath = filePath; } else { @@ -617,7 +614,7 @@ function validateModuleName(moduleNode: ts.Identifier, log: LogInfo[], sourceFil type: LogType.ERROR, message: `The module name '${moduleName}' can not be the same as the inner component name.`, pos: moduleNode.getStart() - } + }; if (sourceFile && fileResolvePath) { const posOfNode: ts.LineAndCharacter = sourceFile.getLineAndCharacterOfPosition(moduleNode.getStart()); const line: number = posOfNode.line + 1; @@ -626,7 +623,7 @@ function validateModuleName(moduleNode: ts.Identifier, log: LogInfo[], sourceFil fileName: fileResolvePath, line: line, column: column - }) + }); } log.push(error); } diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 7be8df6..4d4ac39 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -346,7 +346,7 @@ export function generateSourceFilesInHar(sourcePath: string, sourceContent: stri projectConfig.compileShared ? projectConfig.projectRootPath : projectConfig.moduleRootPath, projectConfig.compileShared ? path.resolve(projectConfig.aceModuleBuild, '../etsFortgz') : process.env.cachePath, projectConfig, projectConfig.compileShared); - if (!jsFilePath.match(/node_modules/)) { + if (!jsFilePath.match(new RegExp(projectConfig.packageDir))) { jsFilePath = jsFilePath.replace(/\.ets$/, suffix).replace(/\.ts$/, suffix); mkdirsSync(path.dirname(jsFilePath)); if (projectConfig.obfuscateHarType === 'uglify' && suffix === '.js') { @@ -527,15 +527,15 @@ export function getResolveModules(projectPath: string, faMode: boolean): string[ if (faMode) { return [ path.resolve(projectPath, '../../../../../'), - path.resolve(projectPath, '../../../../node_modules'), - path.resolve(projectPath, '../../../../../node_modules'), + path.resolve(projectPath, '../../../../' + projectConfig.packageDir), + path.resolve(projectPath, '../../../../../' + projectConfig.packageDir), path.resolve(projectPath, '../../') ]; } else { return [ path.resolve(projectPath, '../../../../'), - path.resolve(projectPath, '../../../node_modules'), - path.resolve(projectPath, '../../../../node_modules'), + path.resolve(projectPath, '../../../' + projectConfig.packageDir), + path.resolve(projectPath, '../../../../' + projectConfig.packageDir), path.resolve(projectPath, '../') ]; } -- Gitee From d813b9ce206601c4b6a791c1588deca881890240 Mon Sep 17 00:00:00 2001 From: bojiang Date: Thu, 2 Feb 2023 19:49:54 +0800 Subject: [PATCH 331/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I70cef03abfa41c43df6eb83d5414740cb64ecb19 --- compiler/src/process_component_build.ts | 9 +- .../@builder/@builderWithForEach.ts | 117 ++++++++++++ .../@builder/@builderWithForEach.ts | 171 ++++++++++++++++++ 3 files changed, 293 insertions(+), 4 deletions(-) create mode 100644 compiler/test/ut/render_decorator/@builder/@builderWithForEach.ts create mode 100644 compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithForEach.ts diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 18548b3..9459412 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -982,7 +982,7 @@ function processForEachComponentNew(node: ts.ExpressionStatement, newStatements: const itemGenFunctionStatement: ts.VariableStatement = createItemGenFunctionStatement(node.expression, argumentsArray, newArrowNode); const itemIdFuncStatement: ts.VariableStatement = createItemIdFuncStatement(node.expression, argumentsArray); - const updateFunctionStatement: ts.ExpressionStatement = createUpdateFunctionStatement(argumentsArray); + const updateFunctionStatement: ts.ExpressionStatement = createUpdateFunctionStatement(argumentsArray, isGlobalBuilder); const lazyForEachStatement: ts.ExpressionStatement = createLazyForEachStatement(argumentsArray); if (node.expression.expression.getText() === COMPONENT_FOREACH) { newForEachStatements.push(propertyNode, itemGenFunctionStatement, updateFunctionStatement); @@ -1080,11 +1080,12 @@ function createItemIdFuncStatement( } } -function createUpdateFunctionStatement(argumentsArray: ts.Expression[]): ts.ExpressionStatement { +function createUpdateFunctionStatement(argumentsArray: ts.Expression[], + isGlobalBuilder: boolean = false): ts.ExpressionStatement { return ts.factory.createExpressionStatement( ts.factory.createCallExpression( ts.factory.createPropertyAccessExpression( - ts.factory.createThis(), + isGlobalBuilder ? parentConditionalExpression() : ts.factory.createThis(), ts.factory.createIdentifier(FOREACHUPDATEFUNCTION) ), undefined, @@ -1197,7 +1198,7 @@ function processForEachBlock(node: ts.CallExpression, log: LogInfo[], arrowNode.type, arrowNode.equalsGreaterThanToken, processComponentBlock(body, isLazy, log, false, isBuilder, undefined, arrowNode.parameters)); } else { - return processComponentBlock(body, isLazy, log, false, false, undefined, arrowNode.parameters).statements; + return processComponentBlock(body, isLazy, log, false, false, undefined, arrowNode.parameters, isGlobalBuilder).statements; } } } diff --git a/compiler/test/ut/render_decorator/@builder/@builderWithForEach.ts b/compiler/test/ut/render_decorator/@builder/@builderWithForEach.ts new file mode 100644 index 0000000..b314b90 --- /dev/null +++ b/compiler/test/ut/render_decorator/@builder/@builderWithForEach.ts @@ -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. + */ + +exports.source = ` +@Builder +function ComB(param: string[]) { + ForEach(param, item => { + ComA().backgroundColor('red') + }) +} + +@Entry +@Component +struct Index { + @State arr: string[] = ['1', '2', '3', '4', '5'] + + build() { + Column() { + ComB(this.arr); + } + } +} + +@Component +struct ComA { + build() { + Row() { + Text('自定义组件') + .fontSize(30) + } + } +} +` +exports.expectResult = +`"use strict"; +let __generate__Id = 0; +function generateId() { + return "@builderWithForEach_" + ++__generate__Id; +} +function ComB(param, parent = null) { + ForEach.create("3", parent ? parent : this, ObservedObject.GetRawObject(param), item => { + __Common__.create(); + __Common__.backgroundColor('red'); + let earlierCreatedChild_2 = ((parent ? parent : this) && (parent ? parent : this).findChildById) ? (parent ? parent : this).findChildById(generateId()) : undefined; + if (earlierCreatedChild_2 == undefined) { + View.create(new ComA("@builderWithForEach_" + __generate__Id, parent ? parent : this, {})); + } + else { + earlierCreatedChild_2.updateWithValueParams({}); + if (!earlierCreatedChild_2.needsUpdate()) { + earlierCreatedChild_2.markStatic(); + } + View.create(earlierCreatedChild_2); + } + __Common__.pop(); + }); + ForEach.pop(); +} +class Index extends View { + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); + this.__arr = new ObservedPropertyObject(['1', '2', '3', '4', '5'], this, "arr"); + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + if (params.arr !== undefined) { + this.arr = params.arr; + } + } + aboutToBeDeleted() { + this.__arr.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id()); + } + get arr() { + return this.__arr.get(); + } + set arr(newValue) { + this.__arr.set(newValue); + } + render() { + Column.create(); + ComB(this.arr, this); + Column.pop(); + } +} +class ComA extends View { + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + } + aboutToBeDeleted() { + SubscriberManager.Get().delete(this.id()); + } + render() { + Row.create(); + Text.create('自定义组件'); + Text.fontSize(30); + Text.pop(); + Row.pop(); + } +} +loadDocument(new Index("1", undefined, {})); +` diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithForEach.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithForEach.ts new file mode 100644 index 0000000..9c02a20 --- /dev/null +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithForEach.ts @@ -0,0 +1,171 @@ +/* + * 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. + */ + +exports.source = ` +@Builder +function ComB(param: string[]) { + ForEach(param, item => { + ComA().backgroundColor('red') + }) +} + +@Entry +@Component +struct Index { + @State arr: string[] = ['1', '2', '3', '4', '5'] + + build() { + Column() { + ComB(this.arr); + } + } +} + +@Component +struct ComA { + build() { + Row() { + Text('自定义组件') + .fontSize(30) + } + } +} +` +exports.expectResult = +`"use strict"; +function ComB(param, parent = null) { + (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ForEach.create(); + const forEachItemGenFunction = _item => { + const item = _item; + (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + __Common__.create(); + __Common__.backgroundColor('red'); + if (!isInitialRender) { + __Common__.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + { + (parent ? parent : this).observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new ComA(parent ? parent : this, {}, undefined, elmtId)); + } + else { + (parent ? parent : this).updateStateVarsOfChildByElmtId(elmtId, {}); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + } + __Common__.pop(); + }; + (parent ? parent : this).forEachUpdateFunction(elmtId, param, forEachItemGenFunction); + if (!isInitialRender) { + ForEach.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + ForEach.pop(); +} +class Index extends ViewPU { + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); + this.__arr = new ObservedPropertyObjectPU(['1', '2', '3', '4', '5'], this, "arr"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.arr !== undefined) { + this.arr = params.arr; + } + } + updateStateVars(params) { + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__arr.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__arr.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get arr() { + return this.__arr.get(); + } + set arr(newValue) { + this.__arr.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + ComB(this.arr, this); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class ComA extends ViewPU { + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + } + updateStateVars(params) { + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + } + aboutToBeDeleted() { + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Text.create('自定义组件'); + Text.fontSize(30); + if (!isInitialRender) { + Text.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Text.pop(); + Row.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new Index(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` -- Gitee From e93d494a68805b656d43a3f46ea62f1728e975bf Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Mon, 6 Feb 2023 10:09:48 +0800 Subject: [PATCH 332/379] Fix reviews of rollup 1.modify compareNodeVersion to nodeLargeOrEqualTargetVersion(targetVersion) 2.modify asyncHandler & singalHandler to triggerAsync & triggerEndSignal 3.fix ts2abcCmdArgs & workerNumber 4.fix code style Signed-off-by: zhangrengao Change-Id: I49249a6caabc261966caea28636f882add648486 --- .../ark_compiler/bundle/bundle_mode.ts | 14 ++++----- .../ark_compiler/common/common_mode.ts | 17 +++++++---- .../fast_build/ark_compiler/common/gen_abc.ts | 10 +++---- .../ark_compiler/module/module_build_mode.ts | 2 -- .../ark_compiler/module/module_hotfix_mode.ts | 2 +- .../ark_compiler/module/module_mode.ts | 29 +++++++++---------- .../module/module_preview_mode.ts | 2 -- .../ark_compiler/module/module_source_file.ts | 2 +- .../ark_compiler/rollup-plugin-gen-abc.ts | 1 - .../src/fast_build/ark_compiler/transform.ts | 2 +- compiler/src/fast_build/ark_compiler/utils.ts | 7 +++-- compiler/src/gen_abc_plugin.ts | 4 +-- compiler/src/utils.ts | 6 ++-- 13 files changed, 49 insertions(+), 49 deletions(-) diff --git a/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts b/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts index 51d73fe..41ecb6c 100644 --- a/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts +++ b/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts @@ -189,7 +189,7 @@ export class BundleMode extends CommonMode { private executeEs2AbcCmd() { const genAbcCmd: string = this.cmdArgs.join(' '); try { - const child = this.asyncHandler(() => { + const child = this.triggerAsync(() => { return childProcess.exec(genAbcCmd, { windowsHide: true }); }); child.on('exit', (code: any) => { @@ -197,7 +197,7 @@ export class BundleMode extends CommonMode { this.throwArkTsCompilerError('ArkTS:ERROR failed to execute es2abc'); } this.afterCompilationProcess(); - this.signalHandler(); + this.triggerEndSignal(); }); child.on('error', (err: any) => { @@ -262,12 +262,12 @@ export class BundleMode extends CommonMode { cmd: this.cmdArgs.join(' '), mode: JSBUNDLE }; - this.asyncHandler(() => { - let worker = cluster.fork(workerData); - worker.on("message", (errorMsg) => { + this.triggerAsync(() => { + const worker: any = cluster.fork(workerData); + worker.on('message', (errorMsg) => { this.logger.error(errorMsg.data.toString()); this.throwArkTsCompilerError('ArkTS:ERROR failed to execute ts2abc, received error message.'); - }) + }); }); } @@ -280,7 +280,7 @@ export class BundleMode extends CommonMode { if (workerCount === workerNumber) { this.afterCompilationProcess(); } - this.signalHandler(); + this.triggerEndSignal(); }); } } diff --git a/compiler/src/fast_build/ark_compiler/common/common_mode.ts b/compiler/src/fast_build/ark_compiler/common/common_mode.ts index 159b4a1..93f2fa1 100644 --- a/compiler/src/fast_build/ark_compiler/common/common_mode.ts +++ b/compiler/src/fast_build/ark_compiler/common/common_mode.ts @@ -25,7 +25,7 @@ import { } from './ark_define'; import { initArkConfig } from './process_ark_config'; import { - compareNodeVersion, + nodeLargeOrEqualTargetVersion, mkdirsSync, validateFilePathLength } from '../../../utils'; @@ -42,8 +42,8 @@ export class CommonMode { throwArkTsCompilerError: any; hashJsonFilePath: string; genAbcScriptPath: string; - asyncHandler: any; - signalHandler: any; + triggerAsync: any; + triggerEndSignal: any; constructor(rollupObject: any) { this.projectConfig = Object.assign(rollupObject.share.arkProjectConfig, rollupObject.share.projectConfig); @@ -53,8 +53,13 @@ export class CommonMode { this.throwArkTsCompilerError = rollupObject.share.throwArkTsCompilerError; this.hashJsonFilePath = this.genHashJsonFilePath(); this.genAbcScriptPath = path.resolve(__dirname, GEN_ABC_SCRIPT); - this.asyncHandler = rollupObject.async; - this.signalHandler = rollupObject.signal; + // Each time triggerAsync() was called, IDE will wait for asynchronous operation to finish before continue excuting. + // The finish signal was passed to IDE by calling triggerEndSignal() in the child process created by triggerAsync() + // When multiple workers were invoked by triggerAsync(), IDE will wait until the times of calling + // triggerEndSignal() matches the number of workers invoked. + // If the child process throws an error by calling throwArkTsCompilerError(), IDE will reset the counting state. + this.triggerAsync = rollupObject.async; + this.triggerEndSignal = rollupObject.signal; } private initCmdEnv() { @@ -101,7 +106,7 @@ export class CommonMode { } setupCluster(cluster: any): void { - if (compareNodeVersion()) { + if (nodeLargeOrEqualTargetVersion(16)) { cluster.setupPrimary({ exec: this.genAbcScriptPath, windowsHide: true diff --git a/compiler/src/fast_build/ark_compiler/common/gen_abc.ts b/compiler/src/fast_build/ark_compiler/common/gen_abc.ts index fc8ebfc..8dde73b 100644 --- a/compiler/src/fast_build/ark_compiler/common/gen_abc.ts +++ b/compiler/src/fast_build/ark_compiler/common/gen_abc.ts @@ -75,15 +75,15 @@ function genAbcByWorkersOfModuleMode(jsonInput: string, cmd: string, workerFileN process.stderr.write = function(chunk) { const message = chunk.toString(); - if (message.length != 0) { + if (message.length !== 0) { // send only non-empty message. sometimes there will be empty stderr, // if processed by parent process's logger.error, the gen_abc process will fail process.send({ data: message - }) + }); } return true; -} +}; if (cluster.isWorker && process.env['inputs'] !== undefined && process.env['cmd'] !== undefined && process.env['mode'] !== undefined) { @@ -99,7 +99,7 @@ if (cluster.isWorker && process.env['inputs'] !== undefined && process.env['cmd' } } else { process.send({ - data: "Failed to invoke worker with uncomplete inputs" - }) + data: 'Failed to invoke worker with uncomplete inputs' + }); process.exit(FAIL); } diff --git a/compiler/src/fast_build/ark_compiler/module/module_build_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_build_mode.ts index 933fbcf..4d05ca9 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_build_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_build_mode.ts @@ -35,8 +35,6 @@ export class ModuleBuildMode extends ModuleMode { } else if (isTs2Abc(this.projectConfig)) { this.filterModulesByHashJson(); const splittedModules: any[] = this.getSplittedModulesByNumber(); - this.workerNumber = splittedModules.length; - this.generateTs2AbcCmd(); this.invokeTs2AbcWorkersToGenProto(splittedModules); this.processTs2abcWorkersToGenAbc(); } else { diff --git a/compiler/src/fast_build/ark_compiler/module/module_hotfix_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_hotfix_mode.ts index 5452b55..8cc8617 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_hotfix_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_hotfix_mode.ts @@ -43,7 +43,7 @@ export class ModuleHotfixMode extends ModuleMode { } private generateEs2AbcCmdForHotfix() { - const fileThreads = getEs2abcFileThreadNumber();; + const fileThreads = getEs2abcFileThreadNumber(); this.cmdArgs.push(`"@${this.filesInfoPath}"`); this.cmdArgs.push('--npm-module-entry-list'); this.cmdArgs.push(`"${this.npmEntriesInfoPath}"`); diff --git a/compiler/src/fast_build/ark_compiler/module/module_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_mode.ts index b100873..637d6b0 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_mode.ts @@ -171,7 +171,7 @@ export class ModuleMode extends CommonMode { if (originPkgEntryPath.startsWith('/')) { originPkgEntryPath = originPkgEntryPath.slice(1, originPkgEntryPath.length); } - let pkgEntryPath: string = toUnixPath(this.getPkgModulesFilePkgName(pkgPath)); + const pkgEntryPath: string = toUnixPath(this.getPkgModulesFilePkgName(pkgPath)); let pkgBuildPath: string = path.join(pkgEntryPath, originPkgEntryPath); pkgBuildPath = toUnixPath(pkgBuildPath.substring(0, pkgBuildPath.lastIndexOf('.'))); @@ -220,7 +220,7 @@ export class ModuleMode extends CommonMode { packageName = getPackageInfo(this.projectConfig.aceModuleJsonPath)[1]; } - if (extName.length != 0) { + if (extName.length !== 0) { cacheFilePath = changeFileExtension(cacheFilePath, extName); } @@ -285,14 +285,14 @@ export class ModuleMode extends CommonMode { this.genDescriptionsForMergedEs2abc(); const genAbcCmd: string = this.cmdArgs.join(' '); try { - const child = this.asyncHandler(() => { + const child = this.triggerAsync(() => { return childProcess.exec(genAbcCmd, { windowsHide: true }); }); child.on('exit', (code: any) => { if (code === FAIL) { this.throwArkTsCompilerError('ArkTS:ERROR failed to execute es2abc'); } - this.signalHandler(); + this.triggerEndSignal(); }); child.on('error', (err: any) => { @@ -369,28 +369,27 @@ export class ModuleMode extends CommonMode { return result; } - generateTs2AbcCmd() { - this.cmdArgs.push('--output-proto'); - this.cmdArgs.push('--merge-abc'); - this.cmdArgs.push('--input-file'); - } - invokeTs2AbcWorkersToGenProto(splittedModules) { + let ts2abcCmdArgs: string[] = this.cmdArgs.slice(0); + ts2abcCmdArgs.push('--output-proto'); + ts2abcCmdArgs.push('--merge-abc'); + ts2abcCmdArgs.push('--input-file'); if (isMasterOrPrimary()) { this.setupCluster(cluster); + this.workerNumber = splittedModules.length; for (let i = 0; i < this.workerNumber; ++i) { const sn: number = i + 1; const workerFileName: string = `${FILESINFO}_${sn}${EXTNAME_TXT}`; const workerData: any = { inputs: JSON.stringify(splittedModules[i]), - cmd: this.cmdArgs.join(' '), + cmd: ts2abcCmdArgs.join(' '), workerFileName: workerFileName, mode: ESMODULE, cachePath: this.projectConfig.cachePath }; - this.asyncHandler(() => { - let worker = cluster.fork(workerData); - worker.on("message", (errorMsg) => { + this.triggerAsync(() => { + const worker: any = cluster.fork(workerData); + worker.on('message', (errorMsg) => { this.logger.error(errorMsg.data.toString()); this.throwArkTsCompilerError('ArkTS:ERROR failed to execute ts2abc'); }); @@ -419,7 +418,7 @@ export class ModuleMode extends CommonMode { } this.afterCompilationProcess(); } - this.signalHandler(); + this.triggerEndSignal(); }); } } diff --git a/compiler/src/fast_build/ark_compiler/module/module_preview_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_preview_mode.ts index b77d5b0..933bb28 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_preview_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_preview_mode.ts @@ -34,8 +34,6 @@ export class ModulePreviewMode extends ModuleMode { } else if (isTs2Abc(this.projectConfig)) { this.filterModulesByHashJson(); const splittedModules: any[] = this.getSplittedModulesByNumber(); - this.workerNumber = splittedModules.length; - this.generateTs2AbcCmd(); this.invokeTs2AbcWorkersToGenProto(splittedModules); this.processTs2abcWorkersToGenAbc(); } else { diff --git a/compiler/src/fast_build/ark_compiler/module/module_source_file.ts b/compiler/src/fast_build/ark_compiler/module/module_source_file.ts index b4c3f4c..0ced98b 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_source_file.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_source_file.ts @@ -60,7 +60,7 @@ export class ModuleSourceFile { ModuleSourceFile.sourceFiles = []; } - writeSourceFile() { + private writeSourceFile() { if (this.isSourceNode && !isJsSourceFile(this.moduleId)) { writeFileSyncByNode(this.source, true, ModuleSourceFile.projectConfig); } else { diff --git a/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts b/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts index d516fd2..6a33446 100644 --- a/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts +++ b/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts @@ -29,4 +29,3 @@ export function genAbc() { generateBundle: generateBundleAbc }; } - diff --git a/compiler/src/fast_build/ark_compiler/transform.ts b/compiler/src/fast_build/ark_compiler/transform.ts index 5081356..3577577 100644 --- a/compiler/src/fast_build/ark_compiler/transform.ts +++ b/compiler/src/fast_build/ark_compiler/transform.ts @@ -16,7 +16,7 @@ import path from 'path'; import { - ESMODULE, + ESMODULE } from './common/ark_define'; import { ModuleSourceFile } from './module/module_source_file'; import { diff --git a/compiler/src/fast_build/ark_compiler/utils.ts b/compiler/src/fast_build/ark_compiler/utils.ts index 66ec9e5..19ce3cb 100644 --- a/compiler/src/fast_build/ark_compiler/utils.ts +++ b/compiler/src/fast_build/ark_compiler/utils.ts @@ -30,7 +30,7 @@ import { TEMPORARY } from './common/ark_define'; import { - compareNodeVersion, + nodeLargeOrEqualTargetVersion, genTemporaryPath, mkdirsSync, validateFilePathLength @@ -50,11 +50,12 @@ export function isDebug(projectConfig: any): boolean { } export function isMasterOrPrimary() { - return ((compareNodeVersion() && cluster.isPrimary) || (!compareNodeVersion() && cluster.isMaster)); + return ((nodeLargeOrEqualTargetVersion(16) && cluster.isPrimary) || + (!nodeLargeOrEqualTargetVersion(16) && cluster.isMaster)); } export function changeFileExtension(file: string, targetExt: string, originExt = ''): string { - let currentExt = originExt.length == 0 ? path.extname(file) : originExt; + let currentExt = originExt.length === 0 ? path.extname(file) : originExt; let fileWithoutExt = file.substring(0, file.lastIndexOf(currentExt)); return fileWithoutExt + targetExt; } diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 60a86cf..b505461 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -26,7 +26,7 @@ import { toUnixPath, toHashData, mkdirsSync, - compareNodeVersion, + nodeLargeOrEqualTargetVersion, removeDir, validateFilePathLength, unlinkSync, @@ -1281,7 +1281,7 @@ function processWorkersOfPreviewMode(splittedData: any, cmdPrefix: string, worke } function processWorkersOfBuildMode(splittedData: any, cmdPrefix: string, workerNumber: number) { - const useNewApi: boolean = compareNodeVersion() + const useNewApi: boolean = nodeLargeOrEqualTargetVersion(16); if (useNewApi && cluster.isPrimary || !useNewApi && cluster.isMaster) { let genAbcScript: string = GEN_ABC_SCRIPT; diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 4d4ac39..f57de51 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -367,9 +367,9 @@ export function mkdirsSync(dirname: string): boolean { return false; } -export function compareNodeVersion(nodeVersion: number = 16): boolean { +export function nodeLargeOrEqualTargetVersion(targetVersion: number): boolean { const currentNodeVersion: number = parseInt(process.versions.node.split('.')[0]); - if (currentNodeVersion >= nodeVersion) { + if (currentNodeVersion >= targetVersion) { return true; } @@ -378,7 +378,7 @@ export function compareNodeVersion(nodeVersion: number = 16): boolean { export function removeDir(dirName: string): void { if (fs.existsSync(dirName)) { - if (compareNodeVersion()) { + if (nodeLargeOrEqualTargetVersion(16)) { fs.rmSync(dirName, { recursive: true}); } else { fs.rmdirSync(dirName, { recursive: true}); -- Gitee From c00da4353ede46f4512d62beb1379748abd2c537 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Mon, 6 Feb 2023 18:48:36 +0800 Subject: [PATCH 333/379] Fix browser value is boolean of package.json Signed-off-by: zhangrengao Change-Id: Ic31e7371c232b4dd57a6c3430f30ac169f161ec7 --- compiler/src/gen_abc_plugin.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 60a86cf..d56c7ff 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -323,7 +323,9 @@ function getEntryCandidatesFromPackageJson(resourceResolveData: any): Set { - mainFileds.add(toUnixPath(path.join(packagePath, descriptionFileData.browser[key]))); + if (typeof key === 'string' && typeof descriptionFileData.browser[key] === 'string') { + mainFileds.add(toUnixPath(path.join(packagePath, descriptionFileData.browser[key]))); + } }); } } -- Gitee From fd873ce4aacc0b0f6fc3e1a73307903dc242887c Mon Sep 17 00:00:00 2001 From: hufeng Date: Mon, 6 Feb 2023 20:56:35 +0800 Subject: [PATCH 334/379] Adapt to ohos-typescript's oh-modules with ts2abc Signed-off-by: hufeng Change-Id: I200292297fe5580e58b5412d3035daf6aebe171d --- compiler/src/ark_utils.ts | 5 +++++ .../src/fast_build/ark_compiler/common/common_mode.ts | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/compiler/src/ark_utils.ts b/compiler/src/ark_utils.ts index 8b3c4ee..062f0b7 100644 --- a/compiler/src/ark_utils.ts +++ b/compiler/src/ark_utils.ts @@ -17,6 +17,7 @@ import path from 'path'; import fs from 'fs'; import { minify, MinifyOutput } from 'terser'; +import { OH_MODULES } from './fast_build/ark_compiler/common/ark_define'; import { PACKAGES, TEMPORARY, @@ -330,6 +331,10 @@ export function genAbcFileName(temporaryFile: string): string { return abcFile; } +export function isOhModules(projectConfig: any): boolean { + return projectConfig.packageDir === OH_MODULES; +} + export function isEs2Abc(projectConfig: any): boolean { return projectConfig.pandaMode === ES2ABC || projectConfig.pandaMode === "undefined" || projectConfig.pandaMode === undefined; diff --git a/compiler/src/fast_build/ark_compiler/common/common_mode.ts b/compiler/src/fast_build/ark_compiler/common/common_mode.ts index 93f2fa1..cc958d2 100644 --- a/compiler/src/fast_build/ark_compiler/common/common_mode.ts +++ b/compiler/src/fast_build/ark_compiler/common/common_mode.ts @@ -29,7 +29,11 @@ import { mkdirsSync, validateFilePathLength } from '../../../utils'; -import { isEs2Abc, isTs2Abc } from '../../../ark_utils'; +import { + isEs2Abc, + isOhModules, + isTs2Abc +} from '../../../ark_utils'; import { genTemporaryModuleCacheDirectoryForBundle } from '../utils'; @@ -74,6 +78,9 @@ export class CommonMode { if (this.arkConfig.isDebug) { args.push('--debug'); } + if (isOhModules(this.projectConfig)) { + args.push('--oh-modules'); + } } else if (isEs2Abc(this.projectConfig)) { const es2abc: string = this.arkConfig.es2abcPath; validateFilePathLength(es2abc, this.logger); -- Gitee From b22c91f5852d1d2350b95695db8b5c32f4638ded Mon Sep 17 00:00:00 2001 From: lihong Date: Fri, 3 Feb 2023 20:39:10 +0800 Subject: [PATCH 335/379] lihong67@huawei.com support build har. Signed-off-by: lihong Change-Id: I2b7d07d66b99c7f335a017efe3a38b14eb42af10 --- compiler/compile_plugin.js | 4 ++ compiler/main.js | 9 +++-- .../ark_compiler/generate_module_abc.ts | 8 ++-- .../ark_compiler/module/module_source_file.ts | 5 ++- compiler/src/fast_build/ark_compiler/utils.ts | 5 ++- compiler/src/fast_build/common/init_config.ts | 14 ++++++- .../ets_ui/rollup-plugin-ets-checker.ts | 6 +++ .../ets_ui/rollup-plugin-ets-typescript.ts | 37 +++++++++++++++++-- compiler/src/utils.ts | 2 +- 9 files changed, 74 insertions(+), 16 deletions(-) diff --git a/compiler/compile_plugin.js b/compiler/compile_plugin.js index 027176b..4775a74 100644 --- a/compiler/compile_plugin.js +++ b/compiler/compile_plugin.js @@ -13,6 +13,8 @@ * limitations under the License. */ +const { initConfig } = require('./lib/fast_build/common/init_config'); +const { getCleanConfig } = require('./main'); const { etsTransform } = require('./lib/fast_build/ets_ui/rollup-plugin-ets-typescript'); const { etsChecker } = require('./lib/fast_build/ets_ui/rollup-plugin-ets-checker'); const { apiTransform } = require('./lib/fast_build/system_api/rollup-plugin-system-api'); @@ -24,3 +26,5 @@ exports.apiTransform = apiTransform; exports.etsChecker = etsChecker; exports.genAbc = genAbc; exports.watchChangeFiles = watchChangeFiles; +exports.initConfig = initConfig; +exports.getCleanConfig = getCleanConfig; diff --git a/compiler/main.js b/compiler/main.js index 7c1d623..f68570b 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -244,6 +244,7 @@ function getEntryPath(entryPath, rootPackageJsonPath) { if (fs.existsSync(mainEntryPath)) { let entryKey = path.relative(projectConfig.projectPath, mainEntryPath); projectConfig.entryObj[entryKey] = mainEntryPath; + abilityPagesFullPath.push(mainEntryPath); } else { throw Error('\u001b[31m' + 'not find entry file in package.json.' + '\u001b[39m').message; } @@ -463,6 +464,10 @@ function loadBuildJson() { if (projectConfig.aceBuildJson && fs.existsSync(projectConfig.aceBuildJson)) { aceBuildJson = JSON.parse(fs.readFileSync(projectConfig.aceBuildJson).toString()); } + if (aceBuildJson.packageManagerType === 'ohpm') { + projectConfig.packageDir = 'oh_modules'; + projectConfig.packageJson = 'oh-package.json5'; + } } function initBuildInfo() { @@ -471,10 +476,6 @@ function initBuildInfo() { aceBuildJson.modulePathMap[aceBuildJson.moduleName]) { projectConfig.moduleRootPath = aceBuildJson.modulePathMap[aceBuildJson.moduleName]; } - if (aceBuildJson.packageManagerType === 'ohpm') { - projectConfig.packageDir = 'oh_modules'; - projectConfig.packageJson = 'oh-package.json5'; - } } function readWorkerFile() { diff --git a/compiler/src/fast_build/ark_compiler/generate_module_abc.ts b/compiler/src/fast_build/ark_compiler/generate_module_abc.ts index d25f567..06f6857 100644 --- a/compiler/src/fast_build/ark_compiler/generate_module_abc.ts +++ b/compiler/src/fast_build/ark_compiler/generate_module_abc.ts @@ -21,12 +21,12 @@ import { ModulePreviewMode } from './module/module_preview_mode'; import { ModuleSourceFile } from './module/module_source_file'; export async function generateModuleAbc(error) { - if (this.share.projectConfig.compileHar) { - // compileHar: compile closed source har of project, which convert .ets to .d.ts and js, dosen't emit abc. - return; - } if (this.share.projectConfig.compileMode === ESMODULE) { await ModuleSourceFile.processModuleSourceFiles(this); + if (this.share.projectConfig.compileHar) { + // compileHar: compile closed source har of project, which convert .ets to .d.ts and js, doesn't emit abc. + return; + } generateAbc(this); } } diff --git a/compiler/src/fast_build/ark_compiler/module/module_source_file.ts b/compiler/src/fast_build/ark_compiler/module/module_source_file.ts index 0ced98b..457b350 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_source_file.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_source_file.ts @@ -54,7 +54,10 @@ export class ModuleSourceFile { static async processModuleSourceFiles(rollupObject: any) { this.initPluginEnv(rollupObject); await ModuleSourceFile.sourceFiles.forEach((source: ModuleSourceFile) => { - source.processModuleRequest(rollupObject); + if (!rollupObject.share.projectConfig.compileHar) { + // compileHar: compile closed source har of project, which convert .ets to .d.ts and js, doesn't transform module request. + source.processModuleRequest(rollupObject); + } source.writeSourceFile(); }); ModuleSourceFile.sourceFiles = []; diff --git a/compiler/src/fast_build/ark_compiler/utils.ts b/compiler/src/fast_build/ark_compiler/utils.ts index 19ce3cb..0b6cd66 100644 --- a/compiler/src/fast_build/ark_compiler/utils.ts +++ b/compiler/src/fast_build/ark_compiler/utils.ts @@ -71,9 +71,11 @@ export function writeFileContentToTempDir(id: string, content: string, projectCo let filePath: string; if (projectConfig.compileHar) { + // compileShared: compile shared har of project filePath = genTemporaryPath(id, projectConfig.compileShared ? projectConfig.projectRootPath : projectConfig.moduleRootPath, - path.resolve(projectConfig.buildPath, projectConfig.compileShared ? '../etsFortgz' : ''), projectConfig, true); + projectConfig.compileShared ? path.resolve(projectConfig.aceModuleBuild, '../etsFortgz'): projectConfig.cachePath, + projectConfig, projectConfig.compileShared); } else { filePath = genTemporaryPath(id, projectConfig.projectPath, projectConfig.cachePath, projectConfig); } @@ -124,6 +126,7 @@ export function isCurrentProjectFiles(filePath: string, projectConfig: any): boo const packageDir: string = projectConfig.packageDir; let modulePath: string = projectConfig.modulePathMap[projectConfig.moduleName]; return filePath.indexOf(projectConfig.projectPath) >= 0 || + (projectConfig.moduleRootPath && filePath.indexOf(projectConfig.moduleRootPath) >= 0) || filePath.indexOf(path.join(projectConfig.projectRootPath, packageDir)) >= 0 || filePath.indexOf(path.join(modulePath, packageDir)) >= 0; } diff --git a/compiler/src/fast_build/common/init_config.ts b/compiler/src/fast_build/common/init_config.ts index 22f8a81..64f8483 100644 --- a/compiler/src/fast_build/common/init_config.ts +++ b/compiler/src/fast_build/common/init_config.ts @@ -13,13 +13,23 @@ * limitations under the License. */ -import { readAppResource } from '../../../main'; -import { getEntryObj } from './process_project_config'; +import { + readAppResource, + projectConfig +} from '../../../main'; +import { + getEntryObj, + workerFile +} from './process_project_config'; export function initConfig() { getEntryObj(); if (process.env.appResource) { readAppResource(process.env.appResource); } + return { + entryObj: projectConfig.entryObj, + workerFile: workerFile + }; } diff --git a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-checker.ts b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-checker.ts index 064491d..daf52a9 100644 --- a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-checker.ts +++ b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-checker.ts @@ -31,6 +31,12 @@ export function etsChecker() { return; } Object.assign(projectConfig, this.share.projectConfig); + Object.assign(this.share.projectConfig, { + compileHar: projectConfig.compileHar, + compileShared: projectConfig.compileShared, + moduleRootPath: projectConfig.moduleRootPath, + buildPath: projectConfig.buildPath + }); initConfig(); const logger = this.share.getLogger('etsChecker'); const rootFileNames: string[] = []; diff --git a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts index 37efb92..14161f1 100644 --- a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts +++ b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts @@ -15,6 +15,7 @@ import ts from 'typescript'; import path from 'path'; +import fs from 'fs'; import { createFilter } from '@rollup/pluginutils'; import MagicString from 'magic-string'; @@ -22,7 +23,9 @@ import { LogInfo, componentInfo, emitLogInfo, - getTransformLog + getTransformLog, + genTemporaryPath, + writeFileSync } from '../../utils'; import { preprocessExtend, @@ -39,7 +42,8 @@ import { } from '../../process_ui_syntax'; import { abilityConfig, - projectConfig + projectConfig, + abilityPagesFullPath } from '../../../main'; import { ESMODULE, JSBUNDLE } from '../../pre_define'; @@ -53,6 +57,7 @@ if (projectConfig.compileMode === ESMODULE) { } export function etsTransform() { + const incrementalFileInHar: Map = new Map(); return { name: 'etsTransform', transform: transform, @@ -67,6 +72,32 @@ export function etsTransform() { code: code, map: magicString.generateMap() }; + }, + moduleParsed(moduleInfo) { + if (projectConfig.compileHar) { + if (moduleInfo.id && !moduleInfo.id.match(/node_modules/)) { + const filePath: string = moduleInfo.id; + const jsCacheFilePath: string = genTemporaryPath(filePath, projectConfig.moduleRootPath, + process.env.cachePath, projectConfig); + const jsBuildFilePath: string = genTemporaryPath(filePath, projectConfig.moduleRootPath, + projectConfig.buildPath, projectConfig, true); + if (filePath.match(/\.e?ts$/)) { + incrementalFileInHar.set(jsCacheFilePath.replace(/\.ets$/, '.d.ets').replace(/\.ts$/, '.d.ts'), + jsBuildFilePath.replace(/\.ets$/, '.d.ets').replace(/\.ts$/, '.d.ts')); + incrementalFileInHar.set(jsCacheFilePath.replace(/\.e?ts$/, '.js'), jsBuildFilePath.replace(/\.e?ts$/, '.js')); + } else { + incrementalFileInHar.set(jsCacheFilePath, jsBuildFilePath); + } + } + } + }, + afterBuildEnd() { + if (projectConfig.compileHar) { + incrementalFileInHar.forEach((jsBuildFilePath, jsCacheFilePath) => { + const sourceCode: string = fs.readFileSync(jsCacheFilePath, 'utf-8'); + writeFileSync(jsBuildFilePath, sourceCode); + }); + } } }; } @@ -104,7 +135,7 @@ function preProcess(code: string, id: string, isEntry: boolean, logger: any): st let content = preprocessExtend(code); content = preprocessNewExtend(content); const log: LogInfo[] = validateUISyntax(code, content, - id, isEntry ? '?entry' : ''); + id, isEntry && !abilityPagesFullPath.includes(id) ? '?entry' : ''); if (log.length) { emitLogInfo(logger, log, true, id); } diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index f57de51..b1faff7 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -344,7 +344,7 @@ export function generateSourceFilesInHar(sourcePath: string, sourceContent: stri // compileShared: compile shared har of project let jsFilePath: string = genTemporaryPath(sourcePath, projectConfig.compileShared ? projectConfig.projectRootPath : projectConfig.moduleRootPath, - projectConfig.compileShared ? path.resolve(projectConfig.aceModuleBuild, '../etsFortgz') : process.env.cachePath, + projectConfig.compileShared ? path.resolve(projectConfig.aceModuleBuild, '../etsFortgz') : projectConfig.cachePath, projectConfig, projectConfig.compileShared); if (!jsFilePath.match(new RegExp(projectConfig.packageDir))) { jsFilePath = jsFilePath.replace(/\.ets$/, suffix).replace(/\.ts$/, suffix); -- Gitee From 6e9dfd411c4a2d4b53e65e271e77e26024fa025d Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Tue, 7 Feb 2023 14:44:36 +0800 Subject: [PATCH 336/379] Fix gen abc failed, but previewer executes success Signed-off-by: zhangrengao Change-Id: I6c688f760578a7fd922f1c2418ba00b8ba595de9 --- compiler/src/compile_info.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 7a9ae07..088c157 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -324,7 +324,7 @@ export class ResultStates { private printLogCount(): void { let errorCount: number = this.mErrorCount + checkerResult.count; - if (errorCount + this.warningCount + this.noteCount > 0) { + if (errorCount + this.warningCount + this.noteCount > 0 || process.env.abcCompileSuccess === 'false') { let result: string; let resultInfo: string = ''; if (errorCount > 0) { -- Gitee From 5c04dc16a12e38497b51e24bd78b2441a421b393 Mon Sep 17 00:00:00 2001 From: hufeng Date: Wed, 8 Feb 2023 10:45:17 +0800 Subject: [PATCH 337/379] Fix compilerOptions.importsNotUsedAsValues not being set as remove Signed-off-by: hufeng Change-Id: I25bb2879c3291268cf30666b39af0df6d406ef15 --- .../src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts index 14161f1..04ad785 100644 --- a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts +++ b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts @@ -52,9 +52,6 @@ const compilerOptions = ts.readConfigFile( path.resolve(__dirname, '../../../tsconfig.json'), ts.sys.readFile).config.compilerOptions; compilerOptions['moduleResolution'] = 'nodenext'; compilerOptions['module'] = 'es2020'; -if (projectConfig.compileMode === ESMODULE) { - compilerOptions['importsNotUsedAsValues'] = 'remove'; -} export function etsTransform() { const incrementalFileInHar: Map = new Map(); @@ -107,6 +104,10 @@ function transform(code: string, id: string) { return null; } + if (projectConfig.compileMode === ESMODULE) { + compilerOptions['importsNotUsedAsValues'] = 'remove'; + } + const logger = this.share.getLogger('etsTransform'); const magicString = new MagicString(code); -- Gitee From 3df7f76d606041423aaf4ee0a3b05a4831f21067 Mon Sep 17 00:00:00 2001 From: yfwang6 Date: Wed, 8 Feb 2023 13:55:07 +0800 Subject: [PATCH 338/379] wangyongfei6@huawei.com add form config json file Signed-off-by: yfwang6 Change-Id: I60394ecf9046bd6b48527044e71eba7aa2c52607 --- .gitignore | 1 + BUILD.gn | 33 ++++++++++++++ build_ets_loader_library.py | 5 ++- compiler/build_declarations_file.js | 3 +- compiler/form_components/badge.json | 5 +++ compiler/form_components/blank.json | 6 +++ compiler/form_components/button.json | 5 +++ compiler/form_components/canvas.json | 6 +++ compiler/form_components/checkbox.json | 4 ++ compiler/form_components/checkboxgroup.json | 4 ++ compiler/form_components/circle.json | 4 ++ compiler/form_components/column.json | 4 ++ compiler/form_components/common_attrs.json | 12 +++++ compiler/form_components/counter.json | 6 +++ compiler/form_components/datapanel.json | 5 +++ compiler/form_components/divider.json | 5 +++ compiler/form_components/ellipse.json | 4 ++ compiler/form_components/flex.json | 4 ++ compiler/form_components/gauge.json | 7 +++ compiler/form_components/grid_col.json | 8 ++++ compiler/form_components/grid_row.json | 7 +++ compiler/form_components/image.json | 9 ++++ compiler/form_components/line.json | 7 +++ compiler/form_components/list.json | 9 ++++ compiler/form_components/listItem.json | 6 +++ compiler/form_components/loadingProgress.json | 5 +++ compiler/form_components/marquee.json | 7 +++ compiler/form_components/path.json | 7 +++ compiler/form_components/polygon.json | 5 +++ compiler/form_components/polyline.json | 5 +++ compiler/form_components/progress.json | 7 +++ compiler/form_components/qrcode.json | 4 ++ compiler/form_components/radio.json | 5 +++ compiler/form_components/rating.json | 4 ++ compiler/form_components/rect.json | 7 +++ .../form_components/relative_container.json | 4 ++ compiler/form_components/row.json | 4 ++ compiler/form_components/shape.json | 12 +++++ compiler/form_components/slider.json | 8 ++++ compiler/form_components/span.json | 8 ++++ compiler/form_components/stack.json | 4 ++ compiler/form_components/text.json | 9 ++++ compiler/form_components/toggle.json | 4 ++ compiler/src/component_map.ts | 45 ++++++++++++------- 44 files changed, 306 insertions(+), 17 deletions(-) create mode 100755 compiler/form_components/badge.json create mode 100755 compiler/form_components/blank.json create mode 100755 compiler/form_components/button.json create mode 100755 compiler/form_components/canvas.json create mode 100755 compiler/form_components/checkbox.json create mode 100755 compiler/form_components/checkboxgroup.json create mode 100755 compiler/form_components/circle.json create mode 100755 compiler/form_components/column.json create mode 100755 compiler/form_components/common_attrs.json create mode 100755 compiler/form_components/counter.json create mode 100755 compiler/form_components/datapanel.json create mode 100755 compiler/form_components/divider.json create mode 100755 compiler/form_components/ellipse.json create mode 100755 compiler/form_components/flex.json create mode 100755 compiler/form_components/gauge.json create mode 100755 compiler/form_components/grid_col.json create mode 100755 compiler/form_components/grid_row.json create mode 100755 compiler/form_components/image.json create mode 100755 compiler/form_components/line.json create mode 100755 compiler/form_components/list.json create mode 100755 compiler/form_components/listItem.json create mode 100755 compiler/form_components/loadingProgress.json create mode 100755 compiler/form_components/marquee.json create mode 100755 compiler/form_components/path.json create mode 100755 compiler/form_components/polygon.json create mode 100755 compiler/form_components/polyline.json create mode 100755 compiler/form_components/progress.json create mode 100755 compiler/form_components/qrcode.json create mode 100755 compiler/form_components/radio.json create mode 100755 compiler/form_components/rating.json create mode 100755 compiler/form_components/rect.json create mode 100755 compiler/form_components/relative_container.json create mode 100755 compiler/form_components/row.json create mode 100755 compiler/form_components/shape.json create mode 100755 compiler/form_components/slider.json create mode 100755 compiler/form_components/span.json create mode 100755 compiler/form_components/stack.json create mode 100755 compiler/form_components/text.json create mode 100755 compiler/form_components/toggle.json diff --git a/.gitignore b/.gitignore index 91cc1be..eaa3c66 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ compiler/lib/ compiler/declarations/ compiler/sample/build/ compiler/component_config.json +compiler/form_config.json compiler/syntax_parser/dist/ \ No newline at end of file diff --git a/BUILD.gn b/BUILD.gn index d2d5501..3d3db65 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -28,12 +28,16 @@ ets_loader_declarations_dir = get_label_info(":build_ets_loader_library", ets_loader_component_config_file = get_label_info(":build_ets_loader_library", "target_out_dir") + "/component_config.json" +ets_loader_form_config_file = + get_label_info(":build_ets_loader_library", "target_out_dir") + + "/form_config.json" ets_sysResource = get_label_info(":build_ets_sysResource", "target_out_dir") + "/sysResource.js" action("build_ets_loader_library") { deps = [ ":components", + ":form_components", ":server", ] script = "build_ets_loader_library.py" @@ -42,6 +46,7 @@ action("build_ets_loader_library") { ets_loader_lib_dir, ets_loader_declarations_dir, ets_loader_component_config_file, + ets_loader_form_config_file, ] _ets_loader_dir = "compiler" @@ -110,6 +115,8 @@ action("build_ets_loader_library") { rebase_path(ets_loader_declarations_dir, root_build_dir), "--output-component-config-file", rebase_path(ets_loader_component_config_file, root_build_dir), + "--output-form-config-file", + rebase_path(ets_loader_form_config_file, root_build_dir), ] } @@ -176,6 +183,15 @@ ohos_copy("ets_loader_component_config") { module_install_name = "" } +ohos_copy("ets_loader_form_config") { + deps = [ ":build_ets_loader_library" ] + sources = [ ets_loader_form_config_file ] + + outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] + module_source_dir = target_out_dir + "/$target_name" + module_install_name = "" +} + ohos_copy("ets_loader_library") { deps = [ ":build_ets_loader_library" ] sources = [ ets_loader_lib_dir ] @@ -191,6 +207,13 @@ ohos_copy("components") { module_install_name = "" } +ohos_copy("form_components") { + sources = [ "compiler/form_components" ] + outputs = [ target_out_dir + "/$target_name" ] + module_source_dir = target_out_dir + "/$target_name" + module_install_name = "" +} + ohos_copy("server") { sources = [ "compiler/server" ] outputs = [ target_out_dir + "/$target_name" ] @@ -248,6 +271,15 @@ ohos_copy("ets_loader_ark_components") { outputs = [ target_out_dir + "/ets_loader_ark/components" ] } +ohos_copy("ets_loader_ark_form_components") { + deps = [ + ":build_ets_loader_library", + ":ets_loader_ark", + ] + sources = [ "compiler/form_components" ] + outputs = [ target_out_dir + "/ets_loader_ark/form_components" ] +} + ohos_copy("ets_loader_ark_server") { deps = [ ":build_ets_loader_library", @@ -293,6 +325,7 @@ ohos_copy("ets_loader_node_modules") { ":ets_loader_ark_codegen", ":ets_loader_ark_components", ":ets_loader_ark_declaration", + ":ets_loader_ark_form_components", ":ets_loader_ark_lib", ":ets_loader_ark_server", ] diff --git a/build_ets_loader_library.py b/build_ets_loader_library.py index d160556..01dfcfa 100755 --- a/build_ets_loader_library.py +++ b/build_ets_loader_library.py @@ -50,6 +50,8 @@ def parse_args(): help='path declarations file to output') parser.add_argument('--output-component-config-file', help='path component config file to output') + parser.add_argument('--output-form-config-file', + help='path form config file to output') options = parser.parse_args() return options @@ -89,7 +91,8 @@ def main(): output_paths=([ options.output_dir, options.output_declarations_dir, - options.output_component_config_file])) + options.output_component_config_file, + options.output_form_config_file])) if __name__ == '__main__': sys.exit(main()) diff --git a/compiler/build_declarations_file.js b/compiler/build_declarations_file.js index 7b4f4c1..806a388 100644 --- a/compiler/build_declarations_file.js +++ b/compiler/build_declarations_file.js @@ -215,9 +215,10 @@ generateComponentConfig(process.argv[4]); function generateComponentConfig(dir) { const configFile = path.resolve(dir, 'component_map.js'); if (fs.existsSync(configFile)) { - const { COMPONENT_MAP } = require(configFile); + const { COMPONENT_MAP, FORM_MAP } = require(configFile); try { fs.writeFileSync(path.resolve(dir, '../component_config.json'), JSON.stringify(COMPONENT_MAP)); + fs.writeFileSync(path.resolve(dir, '../form_config.json'), JSON.stringify(FORM_MAP)); } catch (error) { console.error(error); } diff --git a/compiler/form_components/badge.json b/compiler/form_components/badge.json new file mode 100755 index 0000000..b4b3bc6 --- /dev/null +++ b/compiler/form_components/badge.json @@ -0,0 +1,5 @@ +{ + "name": "Badge", + "atomics": true, + "attrs": [] +} \ No newline at end of file diff --git a/compiler/form_components/blank.json b/compiler/form_components/blank.json new file mode 100755 index 0000000..9fe088f --- /dev/null +++ b/compiler/form_components/blank.json @@ -0,0 +1,6 @@ +{ + "name": "Blank", + "parents": ["Row", "Column"], + "atomic": true, + "attrs": ["color"] +} \ No newline at end of file diff --git a/compiler/form_components/button.json b/compiler/form_components/button.json new file mode 100755 index 0000000..545d255 --- /dev/null +++ b/compiler/form_components/button.json @@ -0,0 +1,5 @@ +{ + "name": "Button", + "single": true, + "attrs": ["type", "stateEffect", "fontColor", "fontSize", "fontWeight", "fontStyle", "fontFamily"] +} \ No newline at end of file diff --git a/compiler/form_components/canvas.json b/compiler/form_components/canvas.json new file mode 100755 index 0000000..f0a8ba6 --- /dev/null +++ b/compiler/form_components/canvas.json @@ -0,0 +1,6 @@ +{ + "name": "Canvas", + "attrs": [ + "onReady" + ] +} diff --git a/compiler/form_components/checkbox.json b/compiler/form_components/checkbox.json new file mode 100755 index 0000000..5335867 --- /dev/null +++ b/compiler/form_components/checkbox.json @@ -0,0 +1,4 @@ +{ + "name": "Checkbox", + "attrs": ["select","selectedColor","onChange"] +} \ No newline at end of file diff --git a/compiler/form_components/checkboxgroup.json b/compiler/form_components/checkboxgroup.json new file mode 100755 index 0000000..66e4385 --- /dev/null +++ b/compiler/form_components/checkboxgroup.json @@ -0,0 +1,4 @@ +{ + "name": "CheckboxGroup", + "attrs": ["selectAll","selectedColor","onChange"] +} \ No newline at end of file diff --git a/compiler/form_components/circle.json b/compiler/form_components/circle.json new file mode 100755 index 0000000..85a8ffe --- /dev/null +++ b/compiler/form_components/circle.json @@ -0,0 +1,4 @@ +{ + "name": "Circle", + "atomic": true +} \ No newline at end of file diff --git a/compiler/form_components/column.json b/compiler/form_components/column.json new file mode 100755 index 0000000..a80092f --- /dev/null +++ b/compiler/form_components/column.json @@ -0,0 +1,4 @@ +{ + "name": "Column", + "attrs": ["alignItems", "justifyContent"] +} diff --git a/compiler/form_components/common_attrs.json b/compiler/form_components/common_attrs.json new file mode 100755 index 0000000..6aec236 --- /dev/null +++ b/compiler/form_components/common_attrs.json @@ -0,0 +1,12 @@ +{ + "attrs": [ + "width", "height", "responseRegion", "size", "constraintSize", "layoutWeight", "padding", "margin", + "backgroundColor", "backgroundImage", "backgroundImageSize", "backgroundImagePosition", "backgroundBlurStyle", + "opacity", "border", "borderStyle", "borderWidth", "borderColor", "borderRadius", "borderImage", + "onClick", "animation", "transition", "blur", "brightness", "contrast", "grayscale", "colorBlend", + "saturate", "sepia", "invert", "hueRotate", "backdropBlur", "translate", "scale", "rotate", "onAppear", + "onDisAppear", "visibility", "flexGrow", "flexShrink", "flexBasis", "alignSelf", "displayPriority", + "zIndex", "direction", "align", "position", "markAnchor", "offset", "enabled", "alignRules", "aspectRatio", + "overlay", "linearGradient", "sweepGradient", "radialGradient", "shadow", "clip", "mask", "id", "stateStyles" + ] +} diff --git a/compiler/form_components/counter.json b/compiler/form_components/counter.json new file mode 100755 index 0000000..d3e7350 --- /dev/null +++ b/compiler/form_components/counter.json @@ -0,0 +1,6 @@ +{ + "name": "Counter", + "attrs": [ + "onInc", "onDec" + ] +} \ No newline at end of file diff --git a/compiler/form_components/datapanel.json b/compiler/form_components/datapanel.json new file mode 100755 index 0000000..3128924 --- /dev/null +++ b/compiler/form_components/datapanel.json @@ -0,0 +1,5 @@ +{ + "name": "DataPanel", + "atomic": false, + "attrs": ["closeEffect"] +} \ No newline at end of file diff --git a/compiler/form_components/divider.json b/compiler/form_components/divider.json new file mode 100755 index 0000000..75728fd --- /dev/null +++ b/compiler/form_components/divider.json @@ -0,0 +1,5 @@ +{ + "name": "Divider", + "atomic": true, + "attrs": ["color", "vertical", "strokeWidth", "lineCap"] +} \ No newline at end of file diff --git a/compiler/form_components/ellipse.json b/compiler/form_components/ellipse.json new file mode 100755 index 0000000..0f4a225 --- /dev/null +++ b/compiler/form_components/ellipse.json @@ -0,0 +1,4 @@ +{ + "name": "Ellipse", + "atomic": true +} \ No newline at end of file diff --git a/compiler/form_components/flex.json b/compiler/form_components/flex.json new file mode 100755 index 0000000..32cee03 --- /dev/null +++ b/compiler/form_components/flex.json @@ -0,0 +1,4 @@ +{ + "name": "Flex", + "attrs": [] +} \ No newline at end of file diff --git a/compiler/form_components/gauge.json b/compiler/form_components/gauge.json new file mode 100755 index 0000000..8ba00bd --- /dev/null +++ b/compiler/form_components/gauge.json @@ -0,0 +1,7 @@ +{ + "name": "Gauge", + "atomic": true, + "attrs": [ + "value", "startAngle", "endAngle", "colors", "strokeWidth" + ] +} \ No newline at end of file diff --git a/compiler/form_components/grid_col.json b/compiler/form_components/grid_col.json new file mode 100755 index 0000000..feb1fd3 --- /dev/null +++ b/compiler/form_components/grid_col.json @@ -0,0 +1,8 @@ +{ + "name": "GridCol", + "parents": ["GridRow"], + "single": true, + "attrs": [ + "span", "offset", "order" + ] +} \ No newline at end of file diff --git a/compiler/form_components/grid_row.json b/compiler/form_components/grid_row.json new file mode 100755 index 0000000..d66192d --- /dev/null +++ b/compiler/form_components/grid_row.json @@ -0,0 +1,7 @@ +{ + "name": "GridRow", + "children": ["GridCol"], + "attrs": [ + "onBreakpointChange" + ] +} \ No newline at end of file diff --git a/compiler/form_components/image.json b/compiler/form_components/image.json new file mode 100755 index 0000000..60ee17d --- /dev/null +++ b/compiler/form_components/image.json @@ -0,0 +1,9 @@ +{ + "name": "Image", + "atomic": true, + "attrs": [ + "alt", "matchTextDirection", "fitOriginalSize", "fillColor", "objectFit", "objectRepeat", + "autoResize", "renderMode", "interpolation", "sourceSize", "onComplete", "onError", "onFinish", + "syncLoad", "colorFilter", "copyOption", "draggable" + ] +} \ No newline at end of file diff --git a/compiler/form_components/line.json b/compiler/form_components/line.json new file mode 100755 index 0000000..bb5340a --- /dev/null +++ b/compiler/form_components/line.json @@ -0,0 +1,7 @@ +{ + "name": "Line", + "atomic": true, + "attrs": [ + "startPoint","endPoint" + ] +} \ No newline at end of file diff --git a/compiler/form_components/list.json b/compiler/form_components/list.json new file mode 100755 index 0000000..67fe095 --- /dev/null +++ b/compiler/form_components/list.json @@ -0,0 +1,9 @@ +{ + "name": "List", + "children": ["ListItem"], + "attrs": [ + "lanes", "alignListItem", "listDirection", "scrollBar", "edgeEffect", "divider", "multiSelectable", + "cachedCount", "chainAnimation", "sticky", "onScroll", "onScrollIndex", "onReachStart", "onReachEnd", + "onScrollStop", "onScrollFrameBegin" + ] +} \ No newline at end of file diff --git a/compiler/form_components/listItem.json b/compiler/form_components/listItem.json new file mode 100755 index 0000000..f85f49b --- /dev/null +++ b/compiler/form_components/listItem.json @@ -0,0 +1,6 @@ +{ + "name": "ListItem", + "parents": ["List"], + "single": true, + "attrs": ["selectable", "onSelect"] +} diff --git a/compiler/form_components/loadingProgress.json b/compiler/form_components/loadingProgress.json new file mode 100755 index 0000000..08d1a29 --- /dev/null +++ b/compiler/form_components/loadingProgress.json @@ -0,0 +1,5 @@ +{ + "name": "LoadingProgress", + "atomic": true, + "attrs": ["color"] +} \ No newline at end of file diff --git a/compiler/form_components/marquee.json b/compiler/form_components/marquee.json new file mode 100755 index 0000000..b29b965 --- /dev/null +++ b/compiler/form_components/marquee.json @@ -0,0 +1,7 @@ +{ + "name": "Marquee", + "attrs": [ + "fontColor", "fontSize", "allowScale", "fontWeight", "fontFamily", "onStart", + "onBounce", "onFinish" + ] +} \ No newline at end of file diff --git a/compiler/form_components/path.json b/compiler/form_components/path.json new file mode 100755 index 0000000..7e3efd7 --- /dev/null +++ b/compiler/form_components/path.json @@ -0,0 +1,7 @@ +{ + "name": "Path", + "atomic": true, + "attrs": [ + "commands" + ] +} \ No newline at end of file diff --git a/compiler/form_components/polygon.json b/compiler/form_components/polygon.json new file mode 100755 index 0000000..bc0b103 --- /dev/null +++ b/compiler/form_components/polygon.json @@ -0,0 +1,5 @@ +{ + "name": "Polygon", + "atomic": true, + "attrs": ["points"] +} \ No newline at end of file diff --git a/compiler/form_components/polyline.json b/compiler/form_components/polyline.json new file mode 100755 index 0000000..5f5862b --- /dev/null +++ b/compiler/form_components/polyline.json @@ -0,0 +1,5 @@ +{ + "name": "Polyline", + "atomic": true, + "attrs": ["points"] +} \ No newline at end of file diff --git a/compiler/form_components/progress.json b/compiler/form_components/progress.json new file mode 100755 index 0000000..e8c01fc --- /dev/null +++ b/compiler/form_components/progress.json @@ -0,0 +1,7 @@ +{ + "name": "Progress", + "atomic": true, + "attrs": [ + "value", "color", "style" + ] +} \ No newline at end of file diff --git a/compiler/form_components/qrcode.json b/compiler/form_components/qrcode.json new file mode 100755 index 0000000..eda56a4 --- /dev/null +++ b/compiler/form_components/qrcode.json @@ -0,0 +1,4 @@ +{ + "name": "QRCode", + "attrs": ["color", "backgroundColor"] +} \ No newline at end of file diff --git a/compiler/form_components/radio.json b/compiler/form_components/radio.json new file mode 100755 index 0000000..ae90392 --- /dev/null +++ b/compiler/form_components/radio.json @@ -0,0 +1,5 @@ +{ + "name": "Radio", + "atomic": true, + "attrs": ["checked", "onChange"] +} \ No newline at end of file diff --git a/compiler/form_components/rating.json b/compiler/form_components/rating.json new file mode 100755 index 0000000..ec43a7a --- /dev/null +++ b/compiler/form_components/rating.json @@ -0,0 +1,4 @@ +{ + "name": "Rating", + "attrs": ["stars", "stepSize", "starStyle", "onChange"] +} \ No newline at end of file diff --git a/compiler/form_components/rect.json b/compiler/form_components/rect.json new file mode 100755 index 0000000..fce921d --- /dev/null +++ b/compiler/form_components/rect.json @@ -0,0 +1,7 @@ +{ + "name": "Rect", + "atomic": true, + "attrs": [ + "radiusWidth", "radiusHeight", "radius" + ] +} \ No newline at end of file diff --git a/compiler/form_components/relative_container.json b/compiler/form_components/relative_container.json new file mode 100755 index 0000000..db24994 --- /dev/null +++ b/compiler/form_components/relative_container.json @@ -0,0 +1,4 @@ +{ + "name": "RelativeContainer", + "attrs": [] +} \ No newline at end of file diff --git a/compiler/form_components/row.json b/compiler/form_components/row.json new file mode 100755 index 0000000..3e26421 --- /dev/null +++ b/compiler/form_components/row.json @@ -0,0 +1,4 @@ +{ + "name": "Row", + "attrs": ["alignItems", "justifyContent"] +} diff --git a/compiler/form_components/shape.json b/compiler/form_components/shape.json new file mode 100755 index 0000000..8038e5f --- /dev/null +++ b/compiler/form_components/shape.json @@ -0,0 +1,12 @@ +{ + "name": "Shape", + "children": [ + "Rect", "Path", "Circle", "Ellipse", "Shape", "Polyline", "Polygon", "Image", "Text", "Column", + "Row" + ], + "attrs": [ + "viewPort", "stroke", "fill", "strokeDashOffset", "strokeDashArray", "strokeLineCap", + "strokeLineJoin", "strokeMiterLimit", "strokeOpacity", "fillOpacity", "strokeWidth", + "antiAlias", "mesh" + ] +} diff --git a/compiler/form_components/slider.json b/compiler/form_components/slider.json new file mode 100755 index 0000000..d2bf8af --- /dev/null +++ b/compiler/form_components/slider.json @@ -0,0 +1,8 @@ +{ + "name": "Slider", + "atomic": true, + "attrs": [ + "blockColor", "trackColor", "selectedColor", "showSteps", "showTips", "trackThickness", + "onChange" + ] +} diff --git a/compiler/form_components/span.json b/compiler/form_components/span.json new file mode 100755 index 0000000..d8467e6 --- /dev/null +++ b/compiler/form_components/span.json @@ -0,0 +1,8 @@ +{ + "name": "Span", + "atomic": true, + "attrs": [ + "fontColor", "fontSize", "fontStyle", "fontFamily", "fontWeight", "decoration", "letterSpacing", + "textCase" + ] +} \ No newline at end of file diff --git a/compiler/form_components/stack.json b/compiler/form_components/stack.json new file mode 100755 index 0000000..7007a9f --- /dev/null +++ b/compiler/form_components/stack.json @@ -0,0 +1,4 @@ +{ + "name": "Stack", + "attrs": ["alignContent"] +} \ No newline at end of file diff --git a/compiler/form_components/text.json b/compiler/form_components/text.json new file mode 100755 index 0000000..845819c --- /dev/null +++ b/compiler/form_components/text.json @@ -0,0 +1,9 @@ +{ + "name": "Text", + "children": ["Span"], + "attrs": [ + "fontColor", "fontSize", "minFontSize", "maxFontSize", "fontStyle", "fontWeight", + "fontFamily", "textAlign", "lineHeight", "textOverflow", "maxLines", "decoration", + "letterSpacing", "textCase", "baselineOffset", "copyOption" + ] +} \ No newline at end of file diff --git a/compiler/form_components/toggle.json b/compiler/form_components/toggle.json new file mode 100755 index 0000000..fbee0bf --- /dev/null +++ b/compiler/form_components/toggle.json @@ -0,0 +1,4 @@ +{ + "name": "Toggle", + "attrs": ["onChange", "selectedColor", "switchPointColor"] +} \ No newline at end of file diff --git a/compiler/src/component_map.ts b/compiler/src/component_map.ts index 1964464..0397fa7 100644 --- a/compiler/src/component_map.ts +++ b/compiler/src/component_map.ts @@ -17,27 +17,42 @@ const fs = require('fs'); const path = require('path'); import ts from 'typescript'; +const COMPONENTS = 'components'; +const FORM_COMPONENTS = 'form_components'; export const COMPONENT_MAP: any = {}; +export const FORM_MAP: any = {}; export let COMMON_ATTRS: Set = new Set([]); (function readComponents() { - const componentsFile: string = path.join(__dirname, '../components'); - const files: string[] = fs.readdirSync(componentsFile); - files.forEach(function (item) { - const fPath: string = path.join(componentsFile, item); - const json: any = require(fPath); - const stat: any = fs.statSync(fPath); - if (stat.isFile()) { - if (json.name) { - const compName: string = json.name; - delete json.name; - COMPONENT_MAP[compName] = json; - } else { - COMMON_ATTRS = new Set(json.attrs); + const componentPath: Map = new Map([ + [`${COMPONENTS}`, `../${COMPONENTS}`], + [`${FORM_COMPONENTS}`, `../${FORM_COMPONENTS}`] + ]); + for (const [id, relPath] of componentPath.entries()) { + const componentsFile: string = path.join(__dirname, relPath); + const files: string[] = fs.readdirSync(componentsFile); + files.forEach(function (item) { + const fPath: string = path.join(componentsFile, item); + const json: any = require(fPath); + const stat: any = fs.statSync(fPath); + if (stat.isFile()) { + if (json.name) { + const compName: string = json.name; + delete json.name; + if (id === COMPONENTS) { + COMPONENT_MAP[compName] = json; + } else if (id === FORM_COMPONENTS) { + FORM_MAP[compName] = json; + } + } else { + if (id === COMPONENTS) { + COMMON_ATTRS = new Set(json.attrs); + } + } } - } - }); + }); + } })(); const TRANSITION_COMMON_ATTRS: Set = new Set([ -- Gitee From ac22d838c4934a4601e073501a4a4f63f10d9f97 Mon Sep 17 00:00:00 2001 From: congjiye Date: Wed, 8 Feb 2023 11:49:18 +0800 Subject: [PATCH 339/379] support visual fast build Signed-off-by: congjiye --- .../ets_ui/rollup-plugin-ets-typescript.ts | 6 +- compiler/src/pre_define.ts | 1 + compiler/src/pre_process.ts | 257 +------------- compiler/src/process_visual.ts | 316 ++++++++++++++++++ 4 files changed, 325 insertions(+), 255 deletions(-) create mode 100644 compiler/src/process_visual.ts diff --git a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts index 14161f1..e41a8c7 100644 --- a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts +++ b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts @@ -46,6 +46,7 @@ import { abilityPagesFullPath } from '../../../main'; import { ESMODULE, JSBUNDLE } from '../../pre_define'; +import { parseVisual } from '../../process_visual'; const filter:any = createFilter(/(? = new Map(); -const slotMap: Map = new Map(); - -const red: string = '\u001b[31m'; -const reset: string = '\u001b[39m'; +import { BUILD_ON } from './pre_define'; +import { parseVisual } from './process_visual'; function preProcess(source: string): string { process.env.compiler = BUILD_ON; @@ -62,234 +43,4 @@ function preProcess(source: string): string { } } -function parseVisual(resourcePath: string, resourceQuery: string, content: string, - log: LogInfo[], source: string): string { - if (!(componentCollection.entryComponent || componentCollection.customComponents) || !projectConfig.aceSuperVisualPath) { - return content; - } - const visualPath: string = findVisualFile(resourcePath); - if (!visualPath || !fs.existsSync(visualPath)) { - return content; - } - const visualContent: any = getVisualContent(visualPath, log); - if (!visualContent) { - return content; - } - visualMap.clear(); - slotMap.clear(); - const compilerOptions = ts.readConfigFile( - path.resolve(__dirname, '../tsconfig.json'), ts.sys.readFile).config.compilerOptions; - Object.assign(compilerOptions, { - 'sourceMap': false - }); - const sourceFile: ts.SourceFile = ts.createSourceFile(resourcePath, content, - ts.ScriptTarget.Latest, true, ts.ScriptKind.ETS, compilerOptions); - let newContent: string = content; - if (sourceFile.statements) { - sourceFile.statements.forEach(statement => { - newContent = parseStatement(statement, newContent, log, visualContent); - }); - } - const result: ReplaceResult = sourceReplace(newContent, resourcePath); - newContent = result.content; - const resultLog: LogInfo[] = result.log.concat(validateUISyntax(source, newContent, - resourcePath, resourceQuery)); - log.concat(resultLog); - if (!log.length) { - generateSourceMapForNewAndOriEtsFile(resourcePath, source); - } - return newContent; -} - -function parseStatement(statement: ts.Statement, content: string, log: LogInfo[], - visualContent: any): string { - if (statement.kind === ts.SyntaxKind.StructDeclaration && statement.name) { - if (statement.members) { - statement.members.forEach(member => { - if (member.kind && member.kind === ts.SyntaxKind.MethodDeclaration) { - content = parseMember(statement, member, content, log, visualContent); - } - }); - } - } - return content; -} - -function parseMember(statement: ts.Statement, member: ts.MethodDeclaration, content: string, - log: LogInfo[], visualContent: any): string { - let newContent: string = content; - if (member.name && member.name.getText() === 'build') { - const buildBody: string = member.getText(); - if (buildBody.replace(/\ +/g, '').replace(/[\r\n]/g, '') === 'build(){}') { - newContent = insertVisualCode(statement, member, visualContent, newContent); - } else { - log.push({ - type: LogType.ERROR, - message: `when the corresponding visual file exists,` + - ` the build function of the entry component must be empty.`, - pos: member.pos - }); - } - } - return newContent; -} - -function insertVisualCode(statement: ts.Statement, member: ts.MethodDeclaration, - visualContent: any, content: string): string { - let newContent: string = content; - newContent = insertImport(visualContent, newContent); - newContent = insertVarAndFunc(member, visualContent, newContent, content); - newContent = insertBuild(member, visualContent, newContent, content); - newContent = insertAboutToAppear(statement, member, visualContent, newContent, content); - return newContent; -} - -function insertImport(visualContent: any, content: string): string { - if (!visualContent.etsImport) { - return content; - } - const mediaQueryImport: string = visualContent.etsImport + '\n'; - const newContent: string = mediaQueryImport + content; - slotMap.set(0, mediaQueryImport.length); - visualMap.set(0, mediaQueryImport.split('\n').length - 1); - return newContent; -} - -function insertVarAndFunc(build: ts.MethodDeclaration, visualContent: any, - content: string, oriContent: string): string { - const visualVarAndFunc: string = (visualContent.etsVariable ? visualContent.etsVariable : '') + - (visualContent.etsFunction ? visualContent.etsFunction : ''); - return visualVarAndFunc ? insertVisualCodeBeforePos(build, '\n' + visualVarAndFunc, content, - oriContent) : content; -} - -function insertBuild(build: ts.MethodDeclaration, visualContent: any, content: string, - oriContent: string): string { - return visualContent.build ? insertVisualCodeAfterPos(build.body, - '\n' + visualContent.build + '\n', content, oriContent) : content; -} - -function insertAboutToAppear(statement: ts.Statement, build: ts.MethodDeclaration, - visualContent: any, content: string, oriContent: string): string { - if (!visualContent.aboutToAppear) { - return content; - } - for (const member of statement.members) { - const hasAboutToAppear: boolean = member.kind && member.kind === ts.SyntaxKind.MethodDeclaration - && member.name && member.name.getText() === 'aboutToAppear'; - if (hasAboutToAppear) { - return insertVisualCodeAfterPos(member.body, '\n' + visualContent.aboutToAppear, content, - oriContent); - } - } - - const aboutToAppearFunc: string = '\n aboutToAppear() {\n' + visualContent.aboutToAppear + - ' }\n'; - return insertVisualCodeBeforePos(build, aboutToAppearFunc, content, oriContent); -} - -function insertVisualCodeAfterPos(member: ts.Block, visualContent: string, content: string, - oriContent: string): string { - const contentBeforePos: string = oriContent.substring(0, member.getStart() + 1); - const originEtsFileLineNumber: number = contentBeforePos.split('\n').length; - const visualLines: number = visualContent.split('\n').length - 1; - const insertedLineNumbers: number = visualMap.get(originEtsFileLineNumber); - visualMap.set(originEtsFileLineNumber, insertedLineNumbers ? insertedLineNumbers + visualLines : - visualLines); - - let newPos: number = member.getStart() + 1; - for (const [key, value] of slotMap) { - if (member.getStart() >= key) { - newPos += value; - } - } - - const newContent: string = content.substring(0, newPos) + visualContent + - content.substring(newPos); - slotMap.set(member.getStart(), visualContent.length); - return newContent; -} - -function insertVisualCodeBeforePos(member: ts.MethodDeclaration, visualContent: string, - content: string, oriContent: string): string { - const contentBeforePos: string = oriContent.substring(0, member.pos); - const originEtsFileLineNumber: number = contentBeforePos.split('\n').length; - const visualLines: number = visualContent.split('\n').length - 1; - const insertedLineNumbers: number = visualMap.get(originEtsFileLineNumber); - visualMap.set(originEtsFileLineNumber, insertedLineNumbers ? insertedLineNumbers + visualLines : - visualLines); - let newPos: number = member.pos; - for (const [key, value] of slotMap) { - if (member.pos >= key) { - newPos += value; - } - } - const newContent: string = content.substring(0, newPos) + visualContent + - content.substring(newPos); - slotMap.set(member.pos, visualContent.length); - return newContent; -} - -function generateSourceMapForNewAndOriEtsFile(resourcePath: string, content: string) { - if (!process.env.cachePath) { - return; - } - const sourcemap: SourceMapGenerator = new SourceMapGenerator({ - file: resourcePath - }); - const lines: Array = content.split('\n'); - const originEtsFileLines: number = lines.length; - for (let l: number = 1; l <= originEtsFileLines; l++) { - let newEtsFileLineNumber: number = l; - for (const [originEtsFileLineNumber, visualLines] of visualMap) { - if (l > originEtsFileLineNumber) { - newEtsFileLineNumber += visualLines; - } - } - sourcemap.addMapping({ - generated: { - line: newEtsFileLineNumber, - column: 0 - }, - source: resourcePath, - original: { - line: l, - column: 0 - } - }); - } - const visualMapName: string = path.parse(resourcePath).name + SUPERVISUAL_SOURCEMAP_EXT; - const visualDirPath: string = path.parse(resourcePath).dir; - const etsDirPath: string = path.parse(projectConfig.projectPath).dir; - const visualMapDirPath: string = path.resolve(process.env.cachePath, SUPERVISUAL + - visualDirPath.replace(etsDirPath, '')); - if (!(fs.existsSync(visualMapDirPath) && fs.statSync(visualMapDirPath).isDirectory())) { - mkDir(visualMapDirPath); - } - fs.writeFile(path.resolve(visualMapDirPath, visualMapName), sourcemap.toString(), (err) => { - if (err) { - return console.error(red, 'ERROR: Failed to write visual.js.map', reset); - } - }); -} - -function findVisualFile(filePath: string): string { - const etsDirPath: string = path.parse(projectConfig.projectPath).dir; - const visualDirPath: string = path.parse(projectConfig.aceSuperVisualPath).dir; - return filePath - .replace(projectConfig.projectPath, projectConfig.aceSuperVisualPath) - .replace(etsDirPath, visualDirPath).replace(/\.ets$/, '.visual'); -} - -function getVisualContent(visualPath: string, log: LogInfo[]): any { - const parseContent: any = genETS(fs.readFileSync(visualPath, 'utf-8')); - if (parseContent && parseContent.errorType && parseContent.errorType !== '') { - log.push({ - type: LogType.ERROR, - message: parseContent.message - }); - } - return parseContent ? parseContent.ets : null; -} - module.exports = preProcess; diff --git a/compiler/src/process_visual.ts b/compiler/src/process_visual.ts new file mode 100644 index 0000000..740450b --- /dev/null +++ b/compiler/src/process_visual.ts @@ -0,0 +1,316 @@ +/* + * 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 ts from 'typescript'; +import fs from 'fs'; +import path from 'path'; +import { SourceMapGenerator } from 'source-map'; + +import { + validateUISyntax, + componentCollection, + preprocessExtend, + preprocessNewExtend, + ReplaceResult, + sourceReplace +} from './validate_ui_syntax'; +import { + LogType, + LogInfo, + mkDir +} from './utils'; +import { + MODULE_ETS_PATH, + MODULE_VISUAL_PATH, + SUPERVISUAL, + SUPERVISUAL_SOURCEMAP_EXT +} from './pre_define'; + +import { projectConfig } from '../main.js'; +import { genETS } from '../codegen/codegen_ets.js'; + +const visualMap: Map = new Map(); +const slotMap: Map = new Map(); + +const red: string = '\u001b[31m'; +const reset: string = '\u001b[39m'; + +export function parseVisual(resourcePath: string, resourceQuery: string, content: string, + log: LogInfo[], source: string, isFastBuild: boolean = false): string { + if (!(componentCollection.entryComponent || componentCollection.customComponents) || !projectConfig.aceSuperVisualPath) { + return content; + } + const visualPath: string = findVisualFile(resourcePath); + if (!visualPath || !fs.existsSync(visualPath)) { + return content; + } + const visualContent: any = getVisualContent(visualPath, log); + if (!visualContent) { + return content; + } + visualMap.clear(); + slotMap.clear(); + const compilerOptions = ts.readConfigFile( + path.resolve(__dirname, '../tsconfig.json'), ts.sys.readFile).config.compilerOptions; + Object.assign(compilerOptions, { + 'sourceMap': false + }); + const sourceFile: ts.SourceFile = ts.createSourceFile(resourcePath, content, + ts.ScriptTarget.Latest, true, ts.ScriptKind.ETS, compilerOptions); + let newContent: string = content; + if (sourceFile.statements) { + sourceFile.statements.forEach(statement => { + newContent = parseStatement(statement, newContent, log, visualContent); + }); + } + if (isFastBuild) { + newContent = preprocessExtend(newContent); + newContent = preprocessNewExtend(newContent); + } else { + const result: ReplaceResult = sourceReplace(newContent, resourcePath); + newContent = result.content; + log.concat(result.log); + } + let resultLog: LogInfo[] = validateUISyntax(source, newContent, resourcePath, resourceQuery); + log.concat(resultLog); + if (!log.length) { + generateSourceMapForNewAndOriEtsFile(resourcePath, source); + } + return newContent; +} + +function parseStatement(statement: ts.Statement, content: string, log: LogInfo[], + visualContent: any): string { + if (statement.kind === ts.SyntaxKind.StructDeclaration && statement.name) { + if (statement.members) { + statement.members.forEach(member => { + if (member.kind && member.kind === ts.SyntaxKind.MethodDeclaration) { + content = parseMember(statement, member, content, log, visualContent); + } + }); + } + } + return content; +} + +function parseMember(statement: ts.Statement, member: ts.MethodDeclaration, content: string, + log: LogInfo[], visualContent: any): string { + let newContent: string = content; + if (member.name && member.name.getText() === 'build') { + const buildBody: string = member.getText(); + if (buildBody.replace(/\ +/g, '').replace(/[\r\n]/g, '') === 'build(){}') { + newContent = insertVisualCode(statement, member, visualContent, newContent); + } else { + log.push({ + type: LogType.ERROR, + message: `when the corresponding visual file exists,` + + ` the build function of the entry component must be empty.`, + pos: member.pos + }); + } + } + return newContent; +} + +function insertVisualCode(statement: ts.Statement, member: ts.MethodDeclaration, + visualContent: any, content: string): string { + let newContent: string = content; + newContent = insertImport(visualContent, newContent); + newContent = insertVarAndFunc(member, visualContent, newContent, content); + newContent = insertBuild(member, visualContent, newContent, content); + newContent = insertAboutToAppear(statement, member, visualContent, newContent, content); + return newContent; +} + +function insertImport(visualContent: any, content: string): string { + if (!visualContent.etsImport) { + return content; + } + const mediaQueryImport: string = visualContent.etsImport + '\n'; + const newContent: string = mediaQueryImport + content; + slotMap.set(0, mediaQueryImport.length); + visualMap.set(0, mediaQueryImport.split('\n').length - 1); + return newContent; +} + +function insertVarAndFunc(build: ts.MethodDeclaration, visualContent: any, + content: string, oriContent: string): string { + const visualVarAndFunc: string = (visualContent.etsVariable ? visualContent.etsVariable : '') + + (visualContent.etsFunction ? visualContent.etsFunction : ''); + return visualVarAndFunc ? insertVisualCodeBeforePos(build, '\n' + visualVarAndFunc, content, + oriContent) : content; +} + +function insertBuild(build: ts.MethodDeclaration, visualContent: any, content: string, + oriContent: string): string { + return visualContent.build ? insertVisualCodeAfterPos(build.body, + '\n' + visualContent.build + '\n', content, oriContent) : content; +} + +function insertAboutToAppear(statement: ts.Statement, build: ts.MethodDeclaration, + visualContent: any, content: string, oriContent: string): string { + if (!visualContent.aboutToAppear) { + return content; + } + for (const member of statement.members) { + const hasAboutToAppear: boolean = member.kind && member.kind === ts.SyntaxKind.MethodDeclaration + && member.name && member.name.getText() === 'aboutToAppear'; + if (hasAboutToAppear) { + return insertVisualCodeAfterPos(member.body, '\n' + visualContent.aboutToAppear, content, + oriContent); + } + } + + const aboutToAppearFunc: string = '\n aboutToAppear() {\n' + visualContent.aboutToAppear + + ' }\n'; + return insertVisualCodeBeforePos(build, aboutToAppearFunc, content, oriContent); +} + +function insertVisualCodeAfterPos(member: ts.Block, visualContent: string, content: string, + oriContent: string): string { + const contentBeforePos: string = oriContent.substring(0, member.getStart() + 1); + const originEtsFileLineNumber: number = contentBeforePos.split('\n').length; + const visualLines: number = visualContent.split('\n').length - 1; + const insertedLineNumbers: number = visualMap.get(originEtsFileLineNumber); + visualMap.set(originEtsFileLineNumber, insertedLineNumbers ? insertedLineNumbers + visualLines : + visualLines); + + let newPos: number = member.getStart() + 1; + for (const [key, value] of slotMap) { + if (member.getStart() >= key) { + newPos += value; + } + } + + const newContent: string = content.substring(0, newPos) + visualContent + + content.substring(newPos); + slotMap.set(member.getStart(), visualContent.length); + return newContent; +} + +function insertVisualCodeBeforePos(member: ts.MethodDeclaration, visualContent: string, + content: string, oriContent: string): string { + const contentBeforePos: string = oriContent.substring(0, member.pos); + const originEtsFileLineNumber: number = contentBeforePos.split('\n').length; + const visualLines: number = visualContent.split('\n').length - 1; + const insertedLineNumbers: number = visualMap.get(originEtsFileLineNumber); + visualMap.set(originEtsFileLineNumber, insertedLineNumbers ? insertedLineNumbers + visualLines : + visualLines); + let newPos: number = member.pos; + for (const [key, value] of slotMap) { + if (member.pos >= key) { + newPos += value; + } + } + const newContent: string = content.substring(0, newPos) + visualContent + + content.substring(newPos); + slotMap.set(member.pos, visualContent.length); + return newContent; +} + +function generateSourceMapForNewAndOriEtsFile(resourcePath: string, content: string) { + if (!process.env.cachePath) { + return; + } + const sourcemap: SourceMapGenerator = new SourceMapGenerator({ + file: resourcePath + }); + const lines: Array = content.split('\n'); + const originEtsFileLines: number = lines.length; + for (let l: number = 1; l <= originEtsFileLines; l++) { + let newEtsFileLineNumber: number = l; + for (const [originEtsFileLineNumber, visualLines] of visualMap) { + if (l > originEtsFileLineNumber) { + newEtsFileLineNumber += visualLines; + } + } + sourcemap.addMapping({ + generated: { + line: newEtsFileLineNumber, + column: 0 + }, + source: resourcePath, + original: { + line: l, + column: 0 + } + }); + } + const visualMapName: string = path.parse(resourcePath).name + SUPERVISUAL_SOURCEMAP_EXT; + const visualDirPath: string = path.parse(resourcePath).dir; + const etsDirPath: string = path.parse(projectConfig.projectPath).dir; + let visualMapDirPath: string = path.resolve(process.env.cachePath, SUPERVISUAL + + visualDirPath.replace(etsDirPath, '')); + if (!visualDirPath.includes(etsDirPath)) { + visualMapDirPath = path.resolve(process.env.cachePath, SUPERVISUAL + + visualDirPath.replace(projectConfig.projectRootPath, '')); + } + if (!(fs.existsSync(visualMapDirPath) && fs.statSync(visualMapDirPath).isDirectory())) { + mkDir(visualMapDirPath); + } + fs.writeFile(path.resolve(visualMapDirPath, visualMapName), sourcemap.toString(), (err) => { + if (err) { + return console.error(red, 'ERROR: Failed to write visual.js.map', reset); + } + }); +} + +function findVisualFile(filePath: string): string { + let etsDirPath: string = path.parse(projectConfig.projectPath).dir; + let visualDirPath: string = path.parse(projectConfig.aceSuperVisualPath).dir; + let resolvePath = filePath.replace(projectConfig.projectPath, projectConfig.aceSuperVisualPath) + .replace(etsDirPath, visualDirPath).replace(/\.ets$/, '.visual'); + if (fs.existsSync(resolvePath)) { + return resolvePath; + } + let projectRootPath = projectConfig.projectRootPath; + if (projectConfig.isPreview && !projectRootPath) { + if (!projectConfig.aceModuleJsonPath) { + projectRootPath = path.resolve(projectConfig.projectPath, '../../../../../'); + } else { + projectRootPath = path.resolve(projectConfig.projectPath, '../../../../'); + } + } + let moduleName = ''; + const relativePath = filePath.replace(projectRootPath, ''); + const moduleNames = relativePath.split(path.sep); + for (let i = 0; i < moduleNames.length; ++i) { + if (moduleNames[i] === 'src') { + if (i >= moduleNames.length - 2) { + break; + } + const modulePath = path.join(moduleNames[i], moduleNames[i + 1], moduleNames[i + 2]); + if (modulePath === MODULE_ETS_PATH) { + break; + } + } + moduleName = path.join(moduleName, moduleNames[i]); + } + etsDirPath = path.join(projectRootPath, moduleName, MODULE_ETS_PATH); + visualDirPath = path.join(projectRootPath, moduleName, MODULE_VISUAL_PATH); + resolvePath = filePath.replace(etsDirPath, visualDirPath).replace(/\.ets$/, '.visual'); + return resolvePath; +} + +function getVisualContent(visualPath: string, log: LogInfo[]): any { + const parseContent: any = genETS(fs.readFileSync(visualPath, 'utf-8')); + if (parseContent && parseContent.errorType && parseContent.errorType !== '') { + log.push({ + type: LogType.ERROR, + message: parseContent.message + }); + } + return parseContent ? parseContent.ets : null; +} \ No newline at end of file -- Gitee From c617a0398c0889fb9866f537385ef55036965798 Mon Sep 17 00:00:00 2001 From: hufeng Date: Tue, 7 Feb 2023 16:49:57 +0800 Subject: [PATCH 340/379] Fix ts compiling's moduleRequest transforming Signed-off-by: hufeng Change-Id: I8ae3c3f19e09fb38a7d5355c242e197a649d0a38 --- .../fast_build/ark_compiler/module/module_source_file.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/src/fast_build/ark_compiler/module/module_source_file.ts b/compiler/src/fast_build/ark_compiler/module/module_source_file.ts index 457b350..934f2af 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_source_file.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_source_file.ts @@ -119,9 +119,12 @@ export class ModuleSourceFile { private processTransformedTsModuleRequest(rollupObject: any) { const moduleInfo: any = rollupObject.getModuleInfo(this.moduleId); const importMap: any = moduleInfo.importedIdMaps; - (this.source)!.forEachChild((childNode: ts.Node) => { + const statements: ts.Statement[] = []; + (this.source)!.forEachChild((childNode: ts.Statement) => { if (ts.isImportDeclaration(childNode) || (ts.isExportDeclaration(childNode) && childNode.moduleSpecifier)) { - const moduleRequest: string = childNode.moduleSpecifier.getText(); + // moduleSpecifier.getText() returns string carrying on quotation marks which the importMap's key does not, + // so we need to remove the quotation marks from moduleRequest. + const moduleRequest: string = childNode.moduleSpecifier.getText().replace(/'|"/g, ''); const ohmUrl: string | undefined = this.getOhmUrl(moduleRequest, importMap[moduleRequest]); if (ohmUrl !== undefined) { if (ts.isImportDeclaration(childNode)) { @@ -133,7 +136,9 @@ export class ModuleSourceFile { } } } + statements.push(childNode); }); + this.source = ts.factory.updateSourceFile(this.source, statements); } // Replace each module request in source file to a unique representation which is called 'ohmUrl'. -- Gitee From f0f4412561134bfcf7e4a67968a380606720b659 Mon Sep 17 00:00:00 2001 From: raul Date: Wed, 8 Feb 2023 16:36:52 +0800 Subject: [PATCH 341/379] seprate card and app into two abc Signed-off-by: raul Change-Id: I21b40b96d7a14115b79efaaed4101540c9b0c4e3 --- compiler/main.js | 2 ++ compiler/src/fast_build/common/init_config.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/compiler/main.js b/compiler/main.js index f68570b..6761078 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -92,6 +92,7 @@ function initProjectConfig(projectConfig) { projectConfig.obfuscateHarType = projectConfig.obfuscateHarType || process.env.obfuscate; projectConfig.packageDir = 'node_modules'; projectConfig.packageJson = 'package.json'; + projectConfig.cardEntryObj = {}; } function loadEntryObj(projectConfig) { @@ -425,6 +426,7 @@ function readCardForm(form) { const cardPath = path.resolve(projectConfig.projectPath, '..', sourcePath + '.ets'); if (cardPath && fs.existsSync(cardPath)) { projectConfig.entryObj['../' + sourcePath] = cardPath + '?entry'; + projectConfig.cardEntryObj['../' + sourcePath] = cardPath; projectConfig.cardObj[cardPath] = sourcePath.replace(/^\.\//, ''); } } diff --git a/compiler/src/fast_build/common/init_config.ts b/compiler/src/fast_build/common/init_config.ts index 64f8483..1875b5f 100644 --- a/compiler/src/fast_build/common/init_config.ts +++ b/compiler/src/fast_build/common/init_config.ts @@ -29,6 +29,7 @@ export function initConfig() { } return { entryObj: projectConfig.entryObj, + cardEntryObj: projectConfig.cardEntryObj, workerFile: workerFile }; } -- Gitee From 01a0d03fed70eac57b84fc810fdcc62162f17398 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Wed, 8 Feb 2023 20:37:40 +0800 Subject: [PATCH 342/379] Fix compaitble 8 of rollup Signed-off-by: zhangrengao Change-Id: I2de826bc6ec7cdab4faaeacb8a01d0f6d72b0253 --- .../ark_compiler/common/process_ark_config.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts b/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts index a1a2543..82755e5 100644 --- a/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts +++ b/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts @@ -85,9 +85,17 @@ export function initArkProjectConfig(projectConfig) { projectConfig.packageDir = buildJsonInfo.packageManagerType === 'ohpm' ? OH_MODULES : NODE_MODULES; } } + if (projectConfig.aceManifestPath && fs.existsSync(projectConfig.aceManifestPath)) { + const manifestJsonInfo = JSON.parse(fs.readFileSync(projectConfig.aceManifestPath).toString()); + if (manifestJsonInfo.minPlatformVersion) { + arkProjectConfig.minPlatformVersion = manifestJsonInfo.minPlatformVersion; + } + } if (projectConfig.aceModuleJsonPath && fs.existsSync(projectConfig.aceModuleJsonPath)) { const moduleJsonInfo = JSON.parse(fs.readFileSync(projectConfig.aceModuleJsonPath).toString()); - arkProjectConfig.minPlatformVersion = moduleJsonInfo.app.minAPIVersion; + if (moduleJsonInfo.app.minAPIVersion) { + arkProjectConfig.minPlatformVersion = moduleJsonInfo.app.minAPIVersion; + } if (moduleJsonInfo.module) { arkProjectConfig.moduleName = moduleJsonInfo.module.name; } @@ -126,7 +134,7 @@ function processPlatformInfo(arkRootPath: string): void { function processCompatibleVersion(projectConfig: any, arkRootPath: string) { const platformPath: string = getArkBuildDir(arkRootPath); - if (projectConfig.minPlatformVersion.toString() === '8') { + if (projectConfig.minPlatformVersion && projectConfig.minPlatformVersion.toString() === '8') { // use ts2abc to compile apps with 'CompatibleSdkVersion' set to 8 arkConfig.ts2abcPath = path.join(platformPath, 'legacy_api8', 'src', 'index.js'); projectConfig.pandaMode = TS2ABC; -- Gitee From 37484c024b416712b95c8c8d1e47fe2dadd696a9 Mon Sep 17 00:00:00 2001 From: congjiye Date: Thu, 9 Feb 2023 16:08:41 +0800 Subject: [PATCH 343/379] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=8E=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=B7=A8=E6=A8=A1=E5=9D=97=E5=B7=A5=E7=A8=8B=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E6=8B=BC=E6=8E=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: congjiye --- compiler/src/process_visual.ts | 51 +++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/compiler/src/process_visual.ts b/compiler/src/process_visual.ts index 740450b..0575e0e 100644 --- a/compiler/src/process_visual.ts +++ b/compiler/src/process_visual.ts @@ -275,33 +275,38 @@ function findVisualFile(filePath: string): string { if (fs.existsSync(resolvePath)) { return resolvePath; } - let projectRootPath = projectConfig.projectRootPath; - if (projectConfig.isPreview && !projectRootPath) { - if (!projectConfig.aceModuleJsonPath) { - projectRootPath = path.resolve(projectConfig.projectPath, '../../../../../'); - } else { - projectRootPath = path.resolve(projectConfig.projectPath, '../../../../'); - } - } - let moduleName = ''; - const relativePath = filePath.replace(projectRootPath, ''); - const moduleNames = relativePath.split(path.sep); - for (let i = 0; i < moduleNames.length; ++i) { - if (moduleNames[i] === 'src') { - if (i >= moduleNames.length - 2) { - break; + try { + let projectRootPath = projectConfig.projectRootPath; + if (!projectRootPath) { + if (!projectConfig.aceModuleJsonPath) { + projectRootPath = path.resolve(projectConfig.projectPath, '../../../../../'); + } else { + projectRootPath = path.resolve(projectConfig.projectPath, '../../../../'); } - const modulePath = path.join(moduleNames[i], moduleNames[i + 1], moduleNames[i + 2]); - if (modulePath === MODULE_ETS_PATH) { - break; + } + let moduleName = ''; + const relativePath = filePath.replace(projectRootPath, ''); + const moduleNames = relativePath.split(path.sep); + for (let i = 0; i < moduleNames.length; ++i) { + if (moduleNames[i] === 'src') { + if (i >= moduleNames.length - 2) { + break; + } + const modulePath = path.join(moduleNames[i], moduleNames[i + 1], moduleNames[i + 2]); + if (modulePath === MODULE_ETS_PATH) { + break; + } } + moduleName = path.join(moduleName, moduleNames[i]); } - moduleName = path.join(moduleName, moduleNames[i]); + etsDirPath = path.join(projectRootPath, moduleName, MODULE_ETS_PATH); + visualDirPath = path.join(projectRootPath, moduleName, MODULE_VISUAL_PATH); + resolvePath = filePath.replace(etsDirPath, visualDirPath).replace(/\.ets$/, '.visual'); + return resolvePath; + } catch (e) { + // avoid projectConfig attributes has undefined value + return ''; } - etsDirPath = path.join(projectRootPath, moduleName, MODULE_ETS_PATH); - visualDirPath = path.join(projectRootPath, moduleName, MODULE_VISUAL_PATH); - resolvePath = filePath.replace(etsDirPath, visualDirPath).replace(/\.ets$/, '.visual'); - return resolvePath; } function getVisualContent(visualPath: string, log: LogInfo[]): any { -- Gitee From acfc3bfc7e8f1b630a3d62ba559a6a8c9461bfc6 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Thu, 9 Feb 2023 19:01:41 +0800 Subject: [PATCH 344/379] houhaoyu@huawei.com fix previewcomponent in partialupdate Signed-off-by: houhaoyu Change-Id: Ie8caa013a7038f64112e41afe26db291527c4047 --- compiler/src/process_ui_syntax.ts | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index 6837a00..b0cfb34 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -778,11 +778,16 @@ function createStopGetAccessRecording(context: ts.TransformationContext): ts.Exp function createPreviewComponentFunction(name: string, context: ts.TransformationContext, cardRelativePath: string, id: number): ts.Statement { - const newArray: ts.Expression[] = [ - context.factory.createStringLiteral(id.toString()), - context.factory.createIdentifier(COMPONENT_CONSTRUCTOR_UNDEFINED), - context.factory.createObjectLiteralExpression([], false) - ]; + const newArray: ts.Expression[] = partialUpdateConfig.partialUpdateMode ? + [ + context.factory.createIdentifier(COMPONENT_CONSTRUCTOR_UNDEFINED), + context.factory.createObjectLiteralExpression([], false) + ] : + [ + context.factory.createStringLiteral(id.toString()), + context.factory.createIdentifier(COMPONENT_CONSTRUCTOR_UNDEFINED), + context.factory.createObjectLiteralExpression([], false) + ]; const argsArr: ts.Expression[] = []; componentCollection.previewComponent.forEach(componentName => { const newExpression: ts.Expression = context.factory.createNewExpression( @@ -820,10 +825,12 @@ function createPreviewComponentFunction(name: string, context: ts.Transformation ...argsArr ] )), + name && partialUpdateConfig.partialUpdateMode ? createStartGetAccessRecording(context) : undefined, name ? context.factory.createExpressionStatement(context.factory.createCallExpression( context.factory.createIdentifier(cardRelativePath ? CARD_ENTRY_FUNCTION_NAME : - PAGE_ENTRY_FUNCTION_NAME),undefined,newExpressionParams - )) : undefined + PAGE_ENTRY_FUNCTION_NAME), undefined, newExpressionParams + )) : undefined, + name && partialUpdateConfig.partialUpdateMode ? createStopGetAccessRecording(context) : undefined ], true ) -- Gitee From 0821df8cf787ecc6e0e25b2a0846d177196a9b81 Mon Sep 17 00:00:00 2001 From: zhouzebin Date: Fri, 3 Feb 2023 22:05:44 +0800 Subject: [PATCH 345/379] adapter aot with rollup Issue: https://gitee.com/openharmony/developtools_ace_ets2bundle/issues/I6DAU9 Signed-off-by: zhouzebin Change-Id: I3036c78dd650c54957fdd51886fe6993787b26ef --- compiler/main.js | 13 ++- compiler/src/ark_utils.ts | 4 + .../ark_compiler/common/ark_define.ts | 4 + .../ark_compiler/common/process_ark_config.ts | 19 ++-- .../ark_compiler/generate_module_abc.ts | 5 + .../ark_compiler/module/module_mode.ts | 17 ++-- .../ark_compiler/rollup-plugin-gen-abc.ts | 2 +- compiler/src/fast_build/ark_compiler/utils.ts | 11 ++- compiler/src/gen_abc_plugin.ts | 10 +- compiler/src/gen_aot.ts | 97 +++++++------------ compiler/src/process_module_files.ts | 6 +- 11 files changed, 105 insertions(+), 83 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index f68570b..1e9ce6e 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -24,7 +24,8 @@ const { const { WORKERS_DIR, - TS2ABC + TS2ABC, + FAIL } = require('./lib/pre_define'); const { @@ -586,7 +587,15 @@ function loadModuleInfo(projectConfig, envArgs) { projectConfig.projectRootPath = buildJsonInfo.projectRootPath; projectConfig.modulePathMap = buildJsonInfo.modulePathMap; projectConfig.isOhosTest = buildJsonInfo.isOhosTest; - if (checkAotConfig(buildJsonInfo, logger)) { + let faultHandler = function (error) { + // rollup's error will be handled in fast build + if (process.env.compileTool === 'rollup') { + return; + } + logger.error(error); + process.exit(FAIL); + } + if (checkAotConfig(buildJsonInfo, faultHandler)) { projectConfig.processTs = true; projectConfig.pandaMode = TS2ABC; projectConfig.anBuildOutPut = buildJsonInfo.anBuildOutPut; diff --git a/compiler/src/ark_utils.ts b/compiler/src/ark_utils.ts index 062f0b7..5d07709 100644 --- a/compiler/src/ark_utils.ts +++ b/compiler/src/ark_utils.ts @@ -102,6 +102,10 @@ export function genSourceMapFileName(temporaryFile: string): string { return abcFile; } +export function getBuildModeInLowerCase(projectConfig: any): string { + return (process.env.compileTool === 'rollup' ? projectConfig.buildMode : projectConfig.buildArkMode).toLowerCase(); +} + export function writeFileSyncByString(sourcePath: string, sourceCode: string, projectConfig: any, logger: any): void { const filePath: string = genTemporaryPath(sourcePath, projectConfig.projectPath, process.env.cachePath, projectConfig); if (filePath.length === 0) { diff --git a/compiler/src/fast_build/ark_compiler/common/ark_define.ts b/compiler/src/fast_build/ark_compiler/common/ark_define.ts index 2ae008a..ad30329 100644 --- a/compiler/src/fast_build/ark_compiler/common/ark_define.ts +++ b/compiler/src/fast_build/ark_compiler/common/ark_define.ts @@ -24,6 +24,10 @@ export const PREBUILDMODE_JSON: string = 'preBuildMode.json'; export const SOURCEMAPS_JSON: string = 'sourceMaps.json'; export const SOURCEMAPS: string = 'sourceMaps.map'; export const PROTO_FILESINFO_TXT: string = 'protoFilesInfo.txt'; +export const AOT_FULL: string = 'full'; +export const AOT_TYPE: string = 'type'; +export const AOT_PARTIAL: string = 'partial'; +export const AOT_PROFILE_SUFFIX: string = '.ap'; export const NPM_ENTRIES_PROTO_BIN: string = 'npm_entries.protoBin'; export const PACKAGE_JSON: string = 'package.json'; export const FAKE_JS: string = 'fake.js'; diff --git a/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts b/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts index a1a2543..79e32e5 100644 --- a/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts +++ b/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts @@ -19,8 +19,13 @@ import fs from 'fs'; import { TS2ABC, ESMODULE, + AOT_FULL, + AOT_PARTIAL, + AOT_TYPE, + AOT_PROFILE_SUFFIX, NODE_MODULES, - OH_MODULES + OH_MODULES, + FAIL } from './ark_define'; import { isDebug } from '../utils'; import { @@ -29,6 +34,7 @@ import { isWindows } from '../../../utils'; import { getArkBuildDir } from '../../../ark_utils'; +import { checkAotConfig } from '../../../gen_aot'; import { projectConfig as mainProjectConfig } from '../../../../main'; type ArkConfig = { @@ -61,19 +67,20 @@ export function initArkConfig(projectConfig: any) { return arkConfig; } -export function initArkProjectConfig(projectConfig) { +export function initArkProjectConfig(share: any) { + let projectConfig: any = share.projectConfig; let arkProjectConfig: any = {}; if (projectConfig.aceBuildJson && fs.existsSync(projectConfig.aceBuildJson)) { const buildJsonInfo = JSON.parse(fs.readFileSync(projectConfig.aceBuildJson).toString()); arkProjectConfig.projectRootPath = buildJsonInfo.projectRootPath; arkProjectConfig.modulePathMap = buildJsonInfo.modulePathMap; arkProjectConfig.isOhosTest = buildJsonInfo.isOhosTest; - arkProjectConfig.aotMode = buildJsonInfo.aotMode; - if (arkProjectConfig.aotMode && projectConfig.compileMode === ESMODULE) { + if (checkAotConfig(buildJsonInfo, (error: string) => { share.throwArkTsCompilerError(error) })) { arkProjectConfig.processTs = true; arkProjectConfig.pandaMode = TS2ABC; - arkProjectConfig.anBuildMode = buildJsonInfo.anBuildMode || 'type'; arkProjectConfig.anBuildOutPut = buildJsonInfo.anBuildOutPut; + projectConfig.anBuildMode = buildJsonInfo.anBuildMode; + projectConfig.apPath = buildJsonInfo.apPath; } else { arkProjectConfig.processTs = false; arkProjectConfig.pandaMode = buildJsonInfo.pandaMode; @@ -131,4 +138,4 @@ function processCompatibleVersion(projectConfig: any, arkRootPath: string) { arkConfig.ts2abcPath = path.join(platformPath, 'legacy_api8', 'src', 'index.js'); projectConfig.pandaMode = TS2ABC; } -} +} \ No newline at end of file diff --git a/compiler/src/fast_build/ark_compiler/generate_module_abc.ts b/compiler/src/fast_build/ark_compiler/generate_module_abc.ts index 06f6857..52177a0 100644 --- a/compiler/src/fast_build/ark_compiler/generate_module_abc.ts +++ b/compiler/src/fast_build/ark_compiler/generate_module_abc.ts @@ -21,6 +21,11 @@ import { ModulePreviewMode } from './module/module_preview_mode'; import { ModuleSourceFile } from './module/module_source_file'; export async function generateModuleAbc(error) { + if (error) { + // When error thrown in previous plugins, rollup will catch and call buildEnd plugin. + // Stop generate abc if error exists + return; + } if (this.share.projectConfig.compileMode === ESMODULE) { await ModuleSourceFile.processModuleSourceFiles(this); if (this.share.projectConfig.compileHar) { diff --git a/compiler/src/fast_build/ark_compiler/module/module_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_mode.ts index 637d6b0..353e3cc 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_mode.ts @@ -53,7 +53,7 @@ import { reset } from '../common/ark_define'; import { - isAotMode, + needAotCompiler, isMasterOrPrimary } from '../utils'; import { CommonMode } from '../common/common_mode'; @@ -75,7 +75,11 @@ import { getPackageInfo, getOhmUrlByFilepath } from '../../../ark_utils'; -import { generateAot, generateBuiltinAbc } from '../../../gen_aot'; +import { + generateAot, + generateBuiltinAbc, + FaultHandler +} from '../../../gen_aot' export class ModuleInfo { filePath: string; @@ -411,10 +415,11 @@ export class ModuleMode extends CommonMode { this.generateNpmEntryToGenProto(); this.generateProtoFilesInfo(); this.mergeProtoToAbc(); - if (isAotMode(this.projectConfig)) { - const builtinAbcPath: string = generateBuiltinAbc(this.arkConfig.arkRootPath, this.arkConfig.nodePath, - this.cmdArgs, this.logger, true); - generateAot(this.arkConfig.arkRootPath, builtinAbcPath, this.logger, true); + if (needAotCompiler(this.projectConfig)) { + let faultHandler: FaultHandler = ((error: string) => { this.throwArkTsCompilerError(error); }) + const builtinAbcPath: string = generateBuiltinAbc(this.arkConfig.arkRootPath, this.cmdArgs, + this.projectConfig.cachePath, this.logger, faultHandler); + generateAot(this.arkConfig.arkRootPath, builtinAbcPath, this.projectConfig, this.logger, faultHandler); } this.afterCompilationProcess(); } diff --git a/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts b/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts index 6a33446..4584269 100644 --- a/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts +++ b/compiler/src/fast_build/ark_compiler/rollup-plugin-gen-abc.ts @@ -22,7 +22,7 @@ export function genAbc() { return { name: 'genAbc', buildStart() { - this.share.arkProjectConfig = initArkProjectConfig(this.share.projectConfig); + this.share.arkProjectConfig = initArkProjectConfig(this.share); }, transform: transformForModule, buildEnd: generateModuleAbc, diff --git a/compiler/src/fast_build/ark_compiler/utils.ts b/compiler/src/fast_build/ark_compiler/utils.ts index 0b6cd66..dcdf682 100644 --- a/compiler/src/fast_build/ark_compiler/utils.ts +++ b/compiler/src/fast_build/ark_compiler/utils.ts @@ -38,11 +38,16 @@ import { import { writeMinimizedSourceCode } from '../../ark_utils'; +import { AOT_FULL, AOT_PARTIAL, AOT_TYPE } from '../../pre_define'; + +export function needAotCompiler(projectConfig: any): boolean { + return projectConfig.compileMode === ESMODULE && (projectConfig.anBuildMode === AOT_FULL || + projectConfig.anBuildMode === AOT_PARTIAL); +} export function isAotMode(projectConfig: any): boolean { - return projectConfig.compileMode === ESMODULE && ( - projectConfig.anBuildMode === 'full' || projectConfig.anBuildMode === 'pgo' - ); + return projectConfig.compileMode === ESMODULE && (projectConfig.anBuildMode === AOT_FULL || + projectConfig.anBuildMode === AOT_PARTIAL || projectConfig.anBuildMode === AOT_TYPE); } export function isDebug(projectConfig: any): boolean { diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index cd33221..617e6ae 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -88,7 +88,8 @@ import { } from './gen_merged_abc'; import { generateAot, - generateBuiltinAbc + generateBuiltinAbc, + FaultHandler } from './gen_aot' let output: string; @@ -1326,8 +1327,11 @@ function processWorkersOfBuildMode(splittedData: any, cmdPrefix: string, workerN processExtraAsset(); if (projectConfig.compileMode === ESMODULE && (projectConfig.anBuildMode === AOT_FULL || projectConfig.anBuildMode === AOT_PARTIAL)) { - const builtinAbcPath: string = generateBuiltinAbc(arkDir, nodeJs, initAbcEnv(), logger); - generateAot(arkDir, builtinAbcPath, logger); + let faultHandler: FaultHandler = (error) => { logger.error(error); process.exit(FAIL); } + let abcArgs: string[] = initAbcEnv(); + abcArgs.unshift(nodeJs); + const builtinAbcPath: string = generateBuiltinAbc(arkDir, abcArgs, process.env.cachePath, logger, faultHandler); + generateAot(arkDir, builtinAbcPath, projectConfig, logger, faultHandler); } } }); diff --git a/compiler/src/gen_aot.ts b/compiler/src/gen_aot.ts index 383df89..985097a 100644 --- a/compiler/src/gen_aot.ts +++ b/compiler/src/gen_aot.ts @@ -17,9 +17,7 @@ import * as childProcess from 'child_process'; import * as process from 'process'; import * as fs from 'fs'; import * as path from 'path'; -import { projectConfig } from '../main'; import { - FAIL, MODULES_ABC, TEMPORARY, ESMODULE, @@ -43,97 +41,82 @@ import { const red: string = '\u001b[31m'; const reset: string = '\u001b[39m'; -function processExit(isFastBuild = false): void { - if (!isFastBuild) { - process.exit(FAIL); - } +export interface FaultHandler { + (error: string): void } -function checkAotPartialConfig(buildJsonInfo: any, logger: any, isFastBuild: boolean): boolean { +function checkAotPartialConfig(buildJsonInfo: any, faultHandler: FaultHandler): boolean { if (buildJsonInfo.anBuildMode !== AOT_PARTIAL && !buildJsonInfo.apPath) { return false; } if (buildJsonInfo.compileMode !== ESMODULE) { - logger.error(`ArkTS:ERROR Aot's partial mode must config compileMode with esmodule.`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR Aot's partial mode must config compileMode with esmodule.`); } if (buildJsonInfo.anBuildMode !== AOT_PARTIAL) { - logger.error(`ArkTS:ERROR Aot's partial mode must config aotBuildMode with partial.`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR Aot's partial mode must config aotBuildMode with partial.`); } if (!buildJsonInfo.apPath) { - logger.error(`ArkTS:ERROR Aot's partial mode must config a valid apPath.`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR Aot's partial mode must config a valid apPath.`); } if (path.extname(buildJsonInfo.apPath) !== AOT_PROFILE_SUFFIX) { - logger.error(`ArkTS:ERROR apPath for Aot's partial mode must with suffix "${AOT_PROFILE_SUFFIX}".`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR apPath for Aot's partial mode must with suffix "${AOT_PROFILE_SUFFIX}".`); } if (!fs.existsSync(buildJsonInfo.apPath)) { - logger.error(`ArkTS:ERROR apPath for Aot's partial mode is not found in "${buildJsonInfo.apPath}".`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR apPath for Aot's partial mode is not found in "${buildJsonInfo.apPath}".`); } if (!buildJsonInfo.anBuildOutPut) { - logger.error(`ArkTS:ERROR Aot's partial mode need anBuildOutPut.`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR Aot's partial mode need anBuildOutPut.`); } - logger.debug(`Aot compiler's partial mode.`); + // Aot compiler's partial mode. return true; } -function checkAotFullConfig(buildJsonInfo: any, logger: any, isFastBuild: boolean): boolean { +function checkAotFullConfig(buildJsonInfo: any, faultHandler: FaultHandler): boolean { if (buildJsonInfo.anBuildMode !== AOT_FULL) { return false; } if (buildJsonInfo.compileMode !== ESMODULE) { - logger.error(`ArkTS:ERROR Aot's full mode must config compileMode with esmodule.`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR Aot's full mode must config compileMode with esmodule.`); } if (buildJsonInfo.apPath) { - logger.error(`ArkTS:ERROR Aot's full mode do not need apPath.`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR Aot's full mode do not need apPath.`); } if (!buildJsonInfo.anBuildOutPut) { - logger.error(`ArkTS:ERROR Aot's full mode need anBuildOutPut.`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR Aot's full mode need anBuildOutPut.`); } - logger.debug(`Aot compiler's full mode.`); + // Aot compiler's full mode. return true; } -function checkAotTypeConfig(buildJsonInfo: any, logger: any, isFastBuild: boolean): boolean { +function checkAotTypeConfig(buildJsonInfo: any, faultHandler: FaultHandler): boolean { if (buildJsonInfo.anBuildMode !== AOT_TYPE) { return false; } if (buildJsonInfo.compileMode !== ESMODULE) { - logger.error(`ArkTS:ERROR Aot's type mode must config compileMode with esmodule.`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR Aot's type mode must config compileMode with esmodule.`); } if (buildJsonInfo.apPath) { - logger.error(`ArkTS:ERROR Aot's type mode do not need apPath.`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR Aot's type mode do not need apPath.`); } - logger.debug(`Aot compiler's type mode.`); + // Aot compiler's type mode. return true; } -export function checkAotConfig(buildJsonInfo: any, logger: any, isFastBuild = false): boolean { - return checkAotTypeConfig(buildJsonInfo, logger, isFastBuild) || - checkAotFullConfig(buildJsonInfo, logger, isFastBuild) || checkAotPartialConfig(buildJsonInfo, logger, isFastBuild); +export function checkAotConfig(buildJsonInfo: any, faultHandler: FaultHandler): boolean { + return checkAotTypeConfig(buildJsonInfo, faultHandler) || + checkAotFullConfig(buildJsonInfo, faultHandler) || checkAotPartialConfig(buildJsonInfo, faultHandler); } -export function generateAot(arkDir: string, builtinAbcPath: string, logger: any, isFastBuild = false): void { +export function generateAot(arkDir: string, builtinAbcPath: string, projectConfig: any, logger: any, faultHandler: FaultHandler): void { let aotCompiler: string = path.join(getBuildBinDir(arkDir), isWindows() ? "ark_aot_compiler.exe" : "ark_aot_compiler"); const appAbc: string = path.join(projectConfig.buildPath, MODULES_ABC); const appAot: string = path.join(projectConfig.anBuildOutPut, projectConfig.moduleName); if (!validateFilePathLengths([aotCompiler, appAbc, builtinAbcPath, appAot], logger)) { - logger.error(`ArkTS:ERROR generateAot failed. Invalid file path.`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR generateAot failed. Invalid file path.`); } if (!fs.existsSync(appAbc)) { - logger.error(`ArkTS:ERROR generateAot failed. AppAbc not found in "${appAbc}"`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR generateAot failed. AppAbc not found in "${appAbc}"`); } const singleCmdPrefix: string = `"${aotCompiler}" --builtins-dts="${builtinAbcPath}" ` + `--aot-file="${appAot}" --target-triple=aarch64-unknown-linux-gnu `; @@ -143,49 +126,43 @@ export function generateAot(arkDir: string, builtinAbcPath: string, logger: any, } else if (projectConfig.anBuildMode === AOT_PARTIAL) { const profile: string = projectConfig.apPath; if (!validateFilePathLength(profile, logger)) { - logger.error(`ArkTS:ERROR generateAot failed. Invalid profile file path.`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR generateAot failed. Invalid profile file path.`); } if (!fs.existsSync(profile)) { - logger.error(`ArkTS:ERROR generateAot failed. Partial mode lost profile in "${profile}"`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR generateAot failed. Partial mode lost profile in "${profile}"`); } singleCmd = singleCmdPrefix + ` --enable-pgo-profiler=true --pgo-profiler-path="${profile}" "${appAbc}"`; } else { - logger.error(`ArkTS:ERROR generateAot failed. unknown anBuildMode: ${projectConfig.anBuildMode}`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR generateAot failed. unknown anBuildMode: ${projectConfig.anBuildMode}`); } try { logger.debug(`generateAot cmd: ${singleCmd}`); mkdirsSync(projectConfig.anBuildOutPut); - childProcess.execSync(singleCmd); + childProcess.execSync(singleCmd, { windowsHide: true }); } catch (e) { - logger.error(`ArkTS:ERROR Failed to generate aot file. Error message: ${e}`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR Failed to generate aot file. Error message: ${e}`); } } -export function generateBuiltinAbc(arkDir: string, nodeJs: string, abcArgs: string[], - logger: any, isFastBuild = false): string { +export function generateBuiltinAbc(arkDir: string, abcArgs: string[], cachePath: string, + logger: any, faultHandler: FaultHandler): string { const builtinFilePath: string = path.join(getArkBuildDir(arkDir), "aot", "src", "lib_ark_builtins.d.ts"); - const builtinAbcPath: string = path.join(process.env.cachePath, TEMPORARY, "aot", "lib_ark_builtins.d.abc"); + const builtinAbcPath: string = path.join(cachePath, TEMPORARY, "aot", "lib_ark_builtins.d.abc"); if (fs.existsSync(builtinAbcPath)) { logger.debug(`builtin.d.abc already exists, no need to rebuild again`); return builtinAbcPath; } mkdirsSync(path.dirname(builtinAbcPath)); if (!validateFilePathLengths([builtinFilePath, builtinAbcPath], logger)) { - logger.error(`ArkTS:ERROR generateBuiltinAbc failed. Invalid file path.`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR generateBuiltinAbc failed. Invalid file path.`); } const tempAbcArgs: string[] = abcArgs.slice(0); - let singleCmd: string = `${nodeJs} ${tempAbcArgs.join(' ')} "${toUnixPath(builtinFilePath)}" -q -b -m --merge-abc -o "${builtinAbcPath}"`; + let singleCmd: string = `${tempAbcArgs.join(' ')} "${toUnixPath(builtinFilePath)}" -q -b -m --merge-abc -o "${builtinAbcPath}"`; try { logger.debug(`generateBuiltinAbc cmd: ${singleCmd}`); - childProcess.execSync(singleCmd); + childProcess.execSync(singleCmd, { windowsHide: true }); } catch (e) { - logger.error(`ArkTS:ERROR Failed to generate builtin to abc. Error message: ${e}`); - processExit(isFastBuild); + faultHandler(`ArkTS:ERROR Failed to generate builtin to abc. Error message: ${e}`); } return builtinAbcPath; } diff --git a/compiler/src/process_module_files.ts b/compiler/src/process_module_files.ts index 933e8f8..a5a41fa 100644 --- a/compiler/src/process_module_files.ts +++ b/compiler/src/process_module_files.ts @@ -32,9 +32,11 @@ import { import { genSourceMapFileName, newSourceMaps as webpackNewSourceMaps, - transformModuleSpecifier + transformModuleSpecifier, + getBuildModeInLowerCase } from './ark_utils'; import { processSystemApi } from './validate_ui_syntax'; +import { DEBUG } from './fast_build/ark_compiler/common/ark_define'; export const SRC_MAIN: string = 'src/main'; @@ -70,7 +72,7 @@ export function writeFileSyncByNode(node: ts.SourceFile, toTsFile: boolean, proj } } mkdirsSync(path.dirname(temporaryFile)); - if (temporarySourceMapFile.length > 0 && projectConfig.buildArkMode === 'debug') { + if (temporarySourceMapFile.length > 0 && getBuildModeInLowerCase(projectConfig) === DEBUG) { let source = toUnixPath(node.fileName).replace(toUnixPath(projectConfig.projectRootPath) + '/', ''); process.env.compileTool === 'rollup' ? rollupNewSourceMaps[source] = mixedInfo.sourceMapJson : webpackNewSourceMaps[source] = mixedInfo.sourceMapJson; -- Gitee From c1ed784666a0dac1d784f56218389df86920ad24 Mon Sep 17 00:00:00 2001 From: hufeng Date: Sat, 11 Feb 2023 11:02:14 +0800 Subject: [PATCH 346/379] Remove setTsConfigFile Api Signed-off-by: hufeng Change-Id: I6600772a7f2c6cd8dc8d812f41fd0b3e84b2ec6e --- compiler/webpack.config.js | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 51d4b60..949f7f5 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -84,7 +84,8 @@ function initConfig(config) { reportFiles: ['*.js'], onlyCompileBundledFiles: true, transpileOnly: true, - configFile: path.resolve(__dirname, 'tsconfig.json'), + configFile: path.resolve(__dirname, + projectConfig.compileMode === 'esmodule' ? 'tsconfig.esm.json' : 'tsconfig.json'), getCustomTransformers(program) { let transformerOperation = { before: [processUISyntax(program)], @@ -364,21 +365,6 @@ function setOptimizationConfig(config, workerFile) { } } -function setTsConfigFile() { - let tsconfigTemplate = - path.resolve(__dirname, projectConfig.compileMode === 'esmodule' ? 'tsconfig.esm.json' : 'tsconfig.cjs.json'); - if (fs.existsSync(tsconfigTemplate) && fs.statSync(tsconfigTemplate).isFile()) { - let currentTsconfigFile = path.resolve(__dirname, 'tsconfig.json'); - let tsconfigTemplateNew = - currentTsconfigFile.replace(/.json$/, projectConfig.compileMode === 'esmodule' ? '.cjs.json' : '.esm.json'); - fs.renameSync(currentTsconfigFile, tsconfigTemplateNew); - - let tsconfigFileNew = - tsconfigTemplate.replace(projectConfig.compileMode === 'esmodule' ? /.esm.json$/ : /.cjs.json$/, '.json'); - fs.renameSync(tsconfigTemplate, tsconfigFileNew); - } -} - function setGenAbcPlugin(env, config) { process.env.compilerType = 'ark'; process.env.panda = projectConfig.pandaMode; @@ -433,7 +419,6 @@ module.exports = (env, argv) => { setProjectConfig(env); loadEntryObj(projectConfig); loadModuleInfo(projectConfig, env); - setTsConfigFile(); clearWebpackCacheByBuildMode(); initConfig(config); readPatchConfig(); -- Gitee From 56e99b1e7b926ef8b353f0d4b1705d4ec5edc30c Mon Sep 17 00:00:00 2001 From: hufeng Date: Sat, 11 Feb 2023 15:26:06 +0800 Subject: [PATCH 347/379] Update harOhmName with @bundle:bundleName Signed-off-by: hufeng Change-Id: Ia3344b6e6cca0c60ce145908368c65241c12ac8d --- compiler/src/ark_utils.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/src/ark_utils.ts b/compiler/src/ark_utils.ts index 062f0b7..2b2b65d 100644 --- a/compiler/src/ark_utils.ts +++ b/compiler/src/ark_utils.ts @@ -145,17 +145,17 @@ export function transformModuleSpecifier(sourcePath: string, sourceCode: string, export function getOhmUrlByHarName(moduleRequest: string, projectConfig: any): string | undefined { if (projectConfig.harNameOhmMap) { - // case1: "@ohos/lib" ---> "@module:lib/ets/index" + // case1: "@ohos/lib" ---> "@bundle:bundleName/lib/ets/index" if (projectConfig.harNameOhmMap.hasOwnProperty(moduleRequest)) { return projectConfig.harNameOhmMap[moduleRequest]; } - // case2: "@ohos/lib/src/main/ets/pages/page1" ---> "@module:lib/ets/pages/page1" + // case2: "@ohos/lib/src/main/ets/pages/page1" ---> "@bundle:bundleName/lib/ets/pages/page1" for (const harName in projectConfig.harNameOhmMap) { if (moduleRequest.startsWith(harName + '/')) { - const harOhmName: string = - projectConfig.harNameOhmMap[harName].substring(0, projectConfig.harNameOhmMap[harName].indexOf('/')); - if (moduleRequest.indexOf(harName + '/' + SRC_MAIN) == 0) { - return moduleRequest.replace(harName + '/' + SRC_MAIN , harOhmName); + const idx: number = projectConfig.harNameOhmMap[harName].split('/', 2).join('/').length; + const harOhmName: string = projectConfig.harNameOhmMap[harName].substring(0, idx); + if (moduleRequest.indexOf(harName + '/' + SRC_MAIN) === 0) { + return moduleRequest.replace(harName + '/' + SRC_MAIN, harOhmName); } else { return moduleRequest.replace(harName, harOhmName); } -- Gitee From 55b69330fe102d2cce66aeffe4889ebaf27717d7 Mon Sep 17 00:00:00 2001 From: yangbo_404 Date: Sat, 11 Feb 2023 02:36:43 +0000 Subject: [PATCH 348/379] add form typecheck framwork Signed-off-by: yangbo_404 Change-Id: I9100beb360dadc11e98153c4c5e065113ed51a96 --- compiler/src/ets_checker.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index 2410696..2c5c063 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -129,7 +129,24 @@ export function createLanguageService(rootFileNames: string[]): ts.LanguageServi readDirectory: ts.sys.readDirectory, resolveModuleNames: resolveModuleNames, directoryExists: ts.sys.directoryExists, - getDirectories: ts.sys.getDirectories + getDirectories: ts.sys.getDirectories, + getTagNameNeededCheckByFile: (fileName, sourceFileName) => { + let needCheckResult: boolean = false; + if (/compiler\/declarations/.test(sourceFileName) || /ets-loader\/declarations/.test(sourceFileName)) { + needCheckResult = true; + } + return { + needCheck: needCheckResult, + checkConfig: [{ + tagName: "form", + message: "'{0}' can't support form application.", + needConditionCheck: false, + type: ts.DiagnosticCategory.Error, + specifyCheckConditionFuncName: '', + tagNameShouldExisted: true + }] + } + } }; return ts.createLanguageService(servicesHost, ts.createDocumentRegistry()); } @@ -220,6 +237,11 @@ export function printDiagnostic(diagnostic: ts.Diagnostic): void { } checkerResult.count += 1; if (diagnostic.file) { + // FIXME: will be instead of ts.Diagnostics config + if (!projectConfig.cardObj[diagnostic.file.fileName.replace(/\//g, '\\')] && + /can't support form application./.test(message)) { + return; + } const { line, character }: ts.LineAndCharacter = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start!); fastBuildLogger ? -- Gitee From 8b9565a6f43b8c41f5cae989144dcde6608b7757 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Mon, 13 Feb 2023 14:55:15 +0800 Subject: [PATCH 349/379] Fix write json file of rollup Signed-off-by: zhangrengao Change-Id: I79ffece91bad34c3724b3f3fc04217b6afcab759 --- compiler/src/fast_build/ark_compiler/utils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/src/fast_build/ark_compiler/utils.ts b/compiler/src/fast_build/ark_compiler/utils.ts index dcdf682..3cfc02e 100644 --- a/compiler/src/fast_build/ark_compiler/utils.ts +++ b/compiler/src/fast_build/ark_compiler/utils.ts @@ -94,6 +94,7 @@ export function writeFileContentToTempDir(id: string, content: string, projectCo writeFileContent(id, filePath, content, projectConfig, logger); break; case EXTNAME_JSON: + mkdirsSync(path.dirname(filePath)); fs.writeFileSync(filePath, content, 'utf-8'); break; default: -- Gitee From 534b2592413faf2c08e49f4ed3125798e5d52dd8 Mon Sep 17 00:00:00 2001 From: bojiang Date: Mon, 13 Feb 2023 17:11:50 +0800 Subject: [PATCH 350/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I5da335e91d2061fd739905f2fb622750ce0e3b3e --- compiler/src/process_component_member.ts | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index d84eace..5fe7f0b 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -856,13 +856,8 @@ export function isSimpleType(typeNode: ts.TypeNode, program: ts.Program, log?: L } else if (program) { checker = program.getTypeChecker(); } - if (typeNode.parent && typeNode.parent.name && - typeNode.kind === ts.SyntaxKind.AnyKeyword && log) { - log.push({ - type: LogType.WARN, - message: `Please define an explicit type, not any.`, - pos: typeNode.getStart() - }); + if (typeNode.kind === ts.SyntaxKind.AnyKeyword && log) { + checkTypeAny(typeNode, log); } return getDeclarationType(typeNode, checker, log); } @@ -877,6 +872,10 @@ function getDeclarationType(typeNode: ts.TypeNode, checker: ts.TypeChecker, log: if (type.flags & (32 | 1024)) { return true; } + /* Any */ + if ((type.flags & 1) && typeNode.kind !== ts.SyntaxKind.AnyKeyword && log) { + checkTypeAny(typeNode, log); + } // @ts-ignore if (type.types && type.types.length) { // @ts-ignore @@ -1153,3 +1152,11 @@ function validatePropDecorator(decorators: ts.NodeArray): boolean } return false; } + +function checkTypeAny(typeNode: ts.TypeNode, log: LogInfo[]): void { + log.push({ + type: LogType.WARN, + message: `Please define an explicit type, not any.`, + pos: typeNode.getStart() + }); +} -- Gitee From bd3a45b421998e205954faecc71fffddd001d4e3 Mon Sep 17 00:00:00 2001 From: hufeng Date: Mon, 13 Feb 2023 16:34:13 +0800 Subject: [PATCH 351/379] remove cacheDir if can not accessing `buildMode` Signed-off-by: hufeng Change-Id: Ib7bdb60603e356015330e924cd11f0af8cea1a91 --- compiler/webpack.config.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 949f7f5..e78c544 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -406,8 +406,14 @@ function clearWebpackCacheByBuildMode() { // clear&update cache dir when buildMode is different from last time const CACHED_BUILDMODE = path.join(projectConfig.cachePath, PREBUILDMODE_JSON); if (fs.existsSync(CACHED_BUILDMODE)) { - let cachedBuildMode = JSON.parse(fs.readFileSync(CACHED_BUILDMODE).toString()).buildMode; - if (cachedBuildMode !== projectConfig.buildArkMode) { + let cachedBuildMode = undefined; + try { + cachedBuildMode = JSON.parse(fs.readFileSync(CACHED_BUILDMODE).toString()).buildMode; + } catch { + removeDir(projectConfig.cachePath); + mkdirsSync(projectConfig.cachePath); + } + if (cachedBuildMode && cachedBuildMode !== projectConfig.buildArkMode) { removeDir(projectConfig.cachePath); mkdirsSync(projectConfig.cachePath); } -- Gitee From 9dfaa0e1fe6c0f4d7ee48335c2e10c88c450f1cc Mon Sep 17 00:00:00 2001 From: hufeng Date: Thu, 9 Feb 2023 19:45:01 +0800 Subject: [PATCH 352/379] Concurrent decorator supports async function Signed-off-by: hufeng Change-Id: If914c3110b3ed4002a0d2da190a47d3bf063e699 --- compiler/src/validate_ui_syntax.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 7a9e58a..83633e6 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -327,14 +327,11 @@ function checkConcurrentDecorator(node: ts.FunctionDeclaration | ts.MethodDeclar const message: string = `@Concurrent can not be used on method. please use it on function declaration.`; addLog(LogType.ERROR, message, node.decorators!.pos, log, sourceFile); } - let hasAsync: boolean = false; - node.modifiers && node.modifiers.forEach(m => { - if (m.kind === ts.SyntaxKind.AsyncKeyword) { - hasAsync = true; - } - }); - if (node.asteriskToken || hasAsync) { - const funcKind: string = node.asteriskToken ? hasAsync ? 'Async generator' : 'Generator' : 'Async'; + if (node.asteriskToken) { + let hasAsync: boolean = false; + const checkAsyncModifier = (modifier: ts.Modifier) => modifier.kind === ts.SyntaxKind.AsyncKeyword; + node.modifiers && (hasAsync = node.modifiers.some(checkAsyncModifier)); + const funcKind: string = hasAsync ? 'Async generator' : 'Generator'; const message: string = `@Concurrent can not be used on ${funcKind} function declaration.`; addLog(LogType.ERROR, message, node.decorators!.pos, log, sourceFile); } -- Gitee From 7507528e00d33ae0e336ff5134b1f9197b7b2fed Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Tue, 14 Feb 2023 11:04:26 +0800 Subject: [PATCH 353/379] Fix collect error from subprocess data parse to end parse Signed-off-by: zhangrengao Change-Id: Ib744da9fbcf7c5a20b805329002d0ad753d5bf6e --- .../fast_build/ark_compiler/bundle/bundle_mode.ts | 13 +++++++++++-- .../fast_build/ark_compiler/module/module_mode.ts | 12 ++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts b/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts index 41ecb6c..f1e58fb 100644 --- a/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts +++ b/compiler/src/fast_build/ark_compiler/bundle/bundle_mode.ts @@ -36,6 +36,7 @@ import { MAX_WORKER_NUMBER, TEMP_JS, TS2ABC, + red, blue, FAIL, reset @@ -187,6 +188,8 @@ export class BundleMode extends CommonMode { } private executeEs2AbcCmd() { + // collect data error from subprocess + let errMsg: string = ''; const genAbcCmd: string = this.cmdArgs.join(' '); try { const child = this.triggerAsync(() => { @@ -205,7 +208,13 @@ export class BundleMode extends CommonMode { }); child.stderr.on('data', (data: any) => { - this.logger.error(blue, data.toString(), reset); + errMsg += data.toString(); + }); + + child.stderr.on('end', () => { + if (errMsg !== undefined && errMsg.length > 0) { + this.logger.error(red, errMsg, reset); + } }); } catch (e) { this.throwArkTsCompilerError('ArkTS:ERROR failed to execute es2abc with async handler: ' + e.toString()); @@ -265,7 +274,7 @@ export class BundleMode extends CommonMode { this.triggerAsync(() => { const worker: any = cluster.fork(workerData); worker.on('message', (errorMsg) => { - this.logger.error(errorMsg.data.toString()); + this.logger.error(red, errorMsg.data.toString(), reset); this.throwArkTsCompilerError('ArkTS:ERROR failed to execute ts2abc, received error message.'); }); }); diff --git a/compiler/src/fast_build/ark_compiler/module/module_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_mode.ts index 353e3cc..6eb9067 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_mode.ts @@ -286,6 +286,8 @@ export class ModuleMode extends CommonMode { } generateMergedAbcOfEs2Abc() { + // collect data error from subprocess + let errMsg: string = ''; this.genDescriptionsForMergedEs2abc(); const genAbcCmd: string = this.cmdArgs.join(' '); try { @@ -304,7 +306,13 @@ export class ModuleMode extends CommonMode { }); child.stderr.on('data', (data: any) => { - this.logger.error(red, data.toString(), reset); + errMsg += data.toString(); + }); + + child.stderr.on('end', (data: any) => { + if (errMsg !== undefined && errMsg.length > 0) { + this.logger.error(red, errMsg, reset); + } }); } catch (e) { this.throwArkTsCompilerError('ArkTS:ERROR failed to execute es2abc. Error message: ' + e.toString()); @@ -394,7 +402,7 @@ export class ModuleMode extends CommonMode { this.triggerAsync(() => { const worker: any = cluster.fork(workerData); worker.on('message', (errorMsg) => { - this.logger.error(errorMsg.data.toString()); + this.logger.error(red, errorMsg.data.toString(), reset); this.throwArkTsCompilerError('ArkTS:ERROR failed to execute ts2abc'); }); }); -- Gitee From bebdf0cc8528fc1eb4d4b4a2df5fd81abf800fcc Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Tue, 14 Feb 2023 11:29:33 +0800 Subject: [PATCH 354/379] Sort module infos of merge protoBin to abc Signed-off-by: zhangrengao Change-Id: I49fe71478f163e75271ddc2b28c3cdb70aed7e7b --- compiler/src/fast_build/ark_compiler/module/module_mode.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/fast_build/ark_compiler/module/module_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_mode.ts index 6eb9067..a129fe9 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_mode.ts @@ -482,7 +482,8 @@ export class ModuleMode extends CommonMode { validateFilePathLength(this.protoFilePath, this.logger); mkdirsSync(path.dirname(this.protoFilePath)); let protoFilesInfo: string = ''; - for (const value of this.moduleInfos.values()) { + const sortModuleInfos: any = new Map([...this.moduleInfos].sort()); + for (const value of sortModuleInfos.values()) { const cacheProtoPath: string = changeFileExtension(value.cacheFilePath, EXTNAME_PROTO_BIN); protoFilesInfo += `${toUnixPath(cacheProtoPath)}\n`; } -- Gitee From cd23b378cbf33dc7003b63abcc23db405d8e0386 Mon Sep 17 00:00:00 2001 From: hufeng Date: Tue, 14 Feb 2023 14:39:04 +0800 Subject: [PATCH 355/379] Support compiling widgets Signed-off-by: hufeng Change-Id: I10a50cb3d6edabc642684f4f02e47775bebde145 --- compiler/src/fast_build/ark_compiler/common/ark_define.ts | 1 + compiler/src/fast_build/ark_compiler/module/module_mode.ts | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/src/fast_build/ark_compiler/common/ark_define.ts b/compiler/src/fast_build/ark_compiler/common/ark_define.ts index ad30329..e57275d 100644 --- a/compiler/src/fast_build/ark_compiler/common/ark_define.ts +++ b/compiler/src/fast_build/ark_compiler/common/ark_define.ts @@ -19,6 +19,7 @@ export const FILESINFO: string = 'filesInfo'; export const NPMENTRIES_TXT: string = 'npmEntries.txt'; export const MODULES_CACHE: string = 'modules.cache'; export const MODULES_ABC: string = 'modules.abc'; +export const WIDGETS_ABC: string = 'widgets.abc'; export const MODULELIST_JSON: string = 'moduleList.json'; export const PREBUILDMODE_JSON: string = 'preBuildMode.json'; export const SOURCEMAPS_JSON: string = 'sourceMaps.json'; diff --git a/compiler/src/fast_build/ark_compiler/module/module_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_mode.ts index 353e3cc..1e630a1 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_mode.ts @@ -35,6 +35,7 @@ import { NPMENTRIES_TXT, SOURCEMAPS, TEMPORARY, + WIDGETS_ABC, HAP_PACKAGE, PACKAGES, PROJECT_PACKAGE @@ -137,7 +138,8 @@ export class ModuleMode extends CommonMode { this.hashJsonObject = {}; this.filesInfoPath = path.join(this.projectConfig.cachePath, FILESINFO_TXT); this.npmEntriesInfoPath = path.join(this.projectConfig.cachePath, NPMENTRIES_TXT); - this.moduleAbcPath = path.join(this.projectConfig.aceModuleBuild, MODULES_ABC); + const outPutABC: string = this.projectConfig.widgetCompile ? WIDGETS_ABC : MODULES_ABC; + this.moduleAbcPath = path.join(this.projectConfig.aceModuleBuild, outPutABC); this.sourceMapPath = path.join(this.projectConfig.aceModuleBuild, SOURCEMAPS); this.cacheFilePath = path.join(this.projectConfig.cachePath, MODULES_CACHE); this.workerNumber = MAX_WORKER_NUMBER; @@ -237,7 +239,7 @@ export class ModuleMode extends CommonMode { } buildModuleSourceMapInfo() { - if (!this.arkConfig.isDebug) { + if (!this.arkConfig.isDebug || this.projectConfig.widgetCompile) { return; } mkdirsSync(this.projectConfig.aceModuleBuild); -- Gitee From 4e20f25ea3bdd964ae8a7ce6c07c683f211c3f16 Mon Sep 17 00:00:00 2001 From: lihong Date: Tue, 14 Feb 2023 15:36:41 +0800 Subject: [PATCH 356/379] lihong67@huawei.com update animation transform. Signed-off-by: lihong Change-Id: Ia6d366b4a9bbbe90d41753958acd71db19e03602 --- compiler/src/process_component_build.ts | 11 ++-- .../animateTo/animateTo.ts | 44 ++++++++++++++ .../animateTo/animateTo.ts | 58 +++++++++++++++++++ 3 files changed, 108 insertions(+), 5 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 229f095..c0a5997 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1805,16 +1805,17 @@ function addComponentAttr(temp: any, node: ts.Identifier, lastStatement: any, const propName: string = node.getText(); verifyComponentId(temp, node, propName, log); if (propName === ATTRIBUTE_ANIMATION) { + const animationNullNode: ts.ExpressionStatement = ts.factory.createExpressionStatement( + createFunction(ts.factory.createIdentifier(GLOBAL_CONTEXT), node, + // @ts-ignore + [ts.factory.createNull()])); if (!lastStatement.statement) { if (!(temp.arguments.length === 1 && temp.arguments[0].kind === ts.SyntaxKind.NullKeyword)) { - statements.push(ts.factory.createExpressionStatement(createFunction( - ts.factory.createIdentifier(GLOBAL_CONTEXT), node, - // @ts-ignore - [ts.factory.createNull()]))); + statements.push(animationNullNode); } } else { - statements.push(lastStatement.statement); + statements.push(lastStatement.statement, animationNullNode); } lastStatement.statement = ts.factory.createExpressionStatement(createFunction( ts.factory.createIdentifier(GLOBAL_CONTEXT), node, temp.arguments)); diff --git a/compiler/test/ut/inner_commponent_transform/transition_component/animateTo/animateTo.ts b/compiler/test/ut/inner_commponent_transform/transition_component/animateTo/animateTo.ts index e683e6a..3399a36 100644 --- a/compiler/test/ut/inner_commponent_transform/transition_component/animateTo/animateTo.ts +++ b/compiler/test/ut/inner_commponent_transform/transition_component/animateTo/animateTo.ts @@ -52,6 +52,26 @@ struct TransitionExample { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) + Column({space: 5}) { + Column() + .opacity(this.opacity1) + .backgroundColor(this.color) + .animation({duration: 1000}) + .width(this.width1) + .animation({duration: 2000}) + .height(this.height1) + .borderRadius(this.borderRaius1) + .animation({duration: 3000}) + .onClick(() => { + this.color = Color.Green + this.borderRaius1 = 20 + this.opacity1 = 0.5 + this.height1 = 200 + this.width1 = 200 + }) + } + .width("100%") + .height("100%") }.height(400).width("100%").padding({top:100}) } } @@ -161,6 +181,30 @@ class TransitionExample extends View { }); Context.animation(null); Button.pop(); + Column.create({ space: 5 }); + Column.width("100%"); + Column.height("100%"); + Column.create(); + Context.animation({ duration: 1000 }); + Column.opacity(this.opacity1); + Column.backgroundColor(this.color); + Context.animation(null); + Context.animation({ duration: 2000 }); + Column.width(this.width1); + Context.animation(null); + Context.animation({ duration: 3000 }); + Column.height(this.height1); + Column.borderRadius(this.borderRaius1); + Context.animation(null); + Column.onClick(() => { + this.color = Color.Green; + this.borderRaius1 = 20; + this.opacity1 = 0.5; + this.height1 = 200; + this.width1 = 200; + }); + Column.pop(); + Column.pop(); Flex.pop(); } } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts b/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts index 38adff4..a830d61 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts @@ -52,6 +52,26 @@ struct TransitionExample { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) + Column({space: 5}) { + Column() + .opacity(this.opacity1) + .backgroundColor(this.color) + .animation({duration: 1000}) + .width(this.width1) + .animation({duration: 2000}) + .height(this.height1) + .borderRadius(this.borderRaius1) + .animation({duration: 3000}) + .onClick(() => { + this.color = Color.Green + this.borderRaius1 = 20 + this.opacity1 = 0.5 + this.height1 = 200 + this.width1 = 200 + }) + } + .width("100%") + .height("100%") }.height(400).width("100%").padding({top:100}) } } @@ -205,6 +225,44 @@ class TransitionExample extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create({ space: 5 }); + Column.width("100%"); + Column.height("100%"); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + Context.animation({ duration: 1000 }); + Column.opacity(this.opacity1); + Column.backgroundColor(this.color); + Context.animation(null); + Context.animation({ duration: 2000 }); + Column.width(this.width1); + Context.animation(null); + Context.animation({ duration: 3000 }); + Column.height(this.height1); + Column.borderRadius(this.borderRaius1); + Context.animation(null); + Column.onClick(() => { + this.color = Color.Green; + this.borderRaius1 = 20; + this.opacity1 = 0.5; + this.height1 = 200; + this.width1 = 200; + }); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Column.pop(); + Column.pop(); Flex.pop(); } rerender() { -- Gitee From 6f8f16bd74a7ac8481c88da2394e286bfedc546a Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 13 Feb 2023 22:00:23 +0800 Subject: [PATCH 357/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hotreload放开非编译文件限制 Signed-off-by: houhaoyu Change-Id: Iebfa6360af324a5a626dfea18ef3f7764f454b6b --- compiler/src/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index b1faff7..1b2be90 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -514,7 +514,8 @@ export function getHotReloadFiles(watchModifiedFiles: string[], hotReloadIncrementalTime.hotReloadIncrementalStartTime = new Date().getTime().toString(); watchRemovedFiles = watchRemovedFiles.map(file => path.relative(projectConfig.projectPath, file)); allModifiedFiles = new Set([...allModifiedFiles, ...watchModifiedFiles - .filter(file => fs.statSync(file).isFile() && hotReloadSupportFiles.has(file)) + .filter(file => fs.statSync(file).isFile() && + (hotReloadSupportFiles.has(file) || !['.ets', '.ts', '.js'].includes(path.extname(file)))) .map(file => path.relative(projectConfig.projectPath, file))] .filter(file => !watchRemovedFiles.includes(file))); return { -- Gitee From 92127df8c1a2b3cb7a34be9bca7777d9bbf1ac55 Mon Sep 17 00:00:00 2001 From: yangbo_404 Date: Tue, 14 Feb 2023 08:11:20 +0000 Subject: [PATCH 358/379] fix compile error Signed-off-by: yangbo_404 Change-Id: Ic969b4a0be9cac09b74d5765ea0a94a465b4ed58 --- compiler/src/ets_checker.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index 2c5c063..5a9dc96 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -235,13 +235,13 @@ export function printDiagnostic(diagnostic: ts.Diagnostic): void { if (process.env.watchMode !== 'true' && !projectConfig.xtsMode) { updateErrorFileCache(diagnostic); } + // FIXME: will be instead of ts.Diagnostics config + if (diagnostic.file && !projectConfig.cardObj[diagnostic.file.fileName.replace(/\//g, '\\')] && + /can't support form application./.test(message)) { + return; + } checkerResult.count += 1; if (diagnostic.file) { - // FIXME: will be instead of ts.Diagnostics config - if (!projectConfig.cardObj[diagnostic.file.fileName.replace(/\//g, '\\')] && - /can't support form application./.test(message)) { - return; - } const { line, character }: ts.LineAndCharacter = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start!); fastBuildLogger ? -- Gitee From cd1258795ca4cabfcff17d02532af2f386d7f55d Mon Sep 17 00:00:00 2001 From: Guangyao Ma Date: Tue, 14 Feb 2023 16:49:42 +0800 Subject: [PATCH 359/379] fix: update sha256 of typescript package to support form compile Signed-off-by: Guangyao Ma Change-Id: I7cded74d55218328a8082c483be2c8cb6ef8c09b --- compiler/package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/package-lock.json b/compiler/package-lock.json index 7435f79..e58a906 100644 --- a/compiler/package-lock.json +++ b/compiler/package-lock.json @@ -4459,7 +4459,7 @@ }, "typescript": { "version": "file:deps/ohos-typescript-4.2.3-r2.tgz", - "integrity": "sha512-nUW6Nr2UFqhuJW2Zs/06fEAOloU9TuwFvVqz/m3q27UY9xXKBOSTL/jhdsGwdoqx+ZjGPAC1qLFknsfkawvguA==" + "integrity": "sha512-EgfQyxAFWaYxjuDw26Ub4al9+ihVhymnE7fp84C5AoTfyclZLFeRVv7Duv20Pgku7+euJ8vBeh3oFgHl7jhbEg==" }, "uglify-js": { "version": "3.16.1", -- Gitee From 8f1ef67cf0f7216ceac94ff2c866710eaf2cef05 Mon Sep 17 00:00:00 2001 From: congjiye Date: Wed, 15 Feb 2023 14:22:42 +0800 Subject: [PATCH 360/379] update supervisual codegen script Signed-off-by: congjiye --- compiler/codegen/codegen_ets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/codegen/codegen_ets.js b/compiler/codegen/codegen_ets.js index e7d4dfc..8dcc55a 100644 --- a/compiler/codegen/codegen_ets.js +++ b/compiler/codegen/codegen_ets.js @@ -12,4 +12,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(()=>{var e={6486:function(e,t,r){var o;e=r.nmd(e),function(){var n,a="Expected a function",i="__lodash_hash_undefined__",s="__lodash_placeholder__",p=32,l=128,c=1/0,u=9007199254740991,y=NaN,d=4294967295,f=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",p],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",h="[object Boolean]",E="[object Date]",T="[object Error]",S="[object Function]",P="[object GeneratorFunction]",v="[object Map]",b="[object Number]",_="[object Object]",N="[object Promise]",C="[object RegExp]",A="[object Set]",O="[object String]",M="[object Symbol]",w="[object WeakMap]",R="[object ArrayBuffer]",I="[object DataView]",x="[object Float32Array]",L="[object Float64Array]",F="[object Int8Array]",k="[object Int16Array]",B="[object Int32Array]",D="[object Uint8Array]",U="[object Uint8ClampedArray]",V="[object Uint16Array]",G="[object Uint32Array]",z=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,H=RegExp($.source),Y=RegExp(q.source),X=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),oe=/^\s+/,ne=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,pe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ye=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,he=/^(?:0|[1-9]\d*)$/,Ee=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Te=/($^)/,Se=/['\n\r\u2028\u2029\\]/g,Pe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ve="a-z\\xdf-\\xf6\\xf8-\\xff",be="A-Z\\xc0-\\xd6\\xd8-\\xde",_e="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ne="["+_e+"]",Ce="["+Pe+"]",Ae="\\d+",Oe="["+ve+"]",Me="[^\\ud800-\\udfff"+_e+Ae+"\\u2700-\\u27bf"+ve+be+"]",we="\\ud83c[\\udffb-\\udfff]",Re="[^\\ud800-\\udfff]",Ie="(?:\\ud83c[\\udde6-\\uddff]){2}",xe="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+be+"]",Fe="(?:"+Oe+"|"+Me+")",ke="(?:"+Le+"|"+Me+")",Be="(?:['’](?:d|ll|m|re|s|t|ve))?",De="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ue="(?:"+Ce+"|"+we+")?",Ve="[\\ufe0e\\ufe0f]?",Ge=Ve+Ue+"(?:\\u200d(?:"+[Re,Ie,xe].join("|")+")"+Ve+Ue+")*",ze="(?:"+["[\\u2700-\\u27bf]",Ie,xe].join("|")+")"+Ge,je="(?:"+[Re+Ce+"?",Ce,Ie,xe,"[\\ud800-\\udfff]"].join("|")+")",We=RegExp("['’]","g"),$e=RegExp(Ce,"g"),qe=RegExp(we+"(?="+we+")|"+je+Ge,"g"),He=RegExp([Le+"?"+Oe+"+"+Be+"(?="+[Ne,Le,"$"].join("|")+")",ke+"+"+De+"(?="+[Ne,Le+Fe,"$"].join("|")+")",Le+"?"+Fe+"+"+Be,Le+"+"+De,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,ze].join("|"),"g"),Ye=RegExp("[\\u200d\\ud800-\\udfff"+Pe+"\\ufe0e\\ufe0f]"),Xe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Je=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Qe=-1,Ke={};Ke[x]=Ke[L]=Ke[F]=Ke[k]=Ke[B]=Ke[D]=Ke[U]=Ke[V]=Ke[G]=!0,Ke[m]=Ke[g]=Ke[R]=Ke[h]=Ke[I]=Ke[E]=Ke[T]=Ke[S]=Ke[v]=Ke[b]=Ke[_]=Ke[C]=Ke[A]=Ke[O]=Ke[w]=!1;var Ze={};Ze[m]=Ze[g]=Ze[R]=Ze[I]=Ze[h]=Ze[E]=Ze[x]=Ze[L]=Ze[F]=Ze[k]=Ze[B]=Ze[v]=Ze[b]=Ze[_]=Ze[C]=Ze[A]=Ze[O]=Ze[M]=Ze[D]=Ze[U]=Ze[V]=Ze[G]=!0,Ze[T]=Ze[S]=Ze[w]=!1;var et={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tt=parseFloat,rt=parseInt,ot="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,nt="object"==typeof self&&self&&self.Object===Object&&self,at=ot||nt||Function("return this")(),it=t&&!t.nodeType&&t,st=it&&e&&!e.nodeType&&e,pt=st&&st.exports===it,lt=pt&&ot.process,ct=function(){try{return st&&st.require&&st.require("util").types||lt&<.binding&<.binding("util")}catch(e){}}(),ut=ct&&ct.isArrayBuffer,yt=ct&&ct.isDate,dt=ct&&ct.isMap,ft=ct&&ct.isRegExp,mt=ct&&ct.isSet,gt=ct&&ct.isTypedArray;function ht(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Et(e,t,r,o){for(var n=-1,a=null==e?0:e.length;++n-1}function _t(e,t,r){for(var o=-1,n=null==e?0:e.length;++o-1;);return r}function Ht(e,t){for(var r=e.length;r--&&xt(t,e[r],0)>-1;);return r}function Yt(e,t){for(var r=e.length,o=0;r--;)e[r]===t&&++o;return o}var Xt=Dt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Jt=Dt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Qt(e){return"\\"+et[e]}function Kt(e){return Ye.test(e)}function Zt(e){var t=-1,r=Array(e.size);return e.forEach((function(e,o){r[++t]=[o,e]})),r}function er(e,t){return function(r){return e(t(r))}}function tr(e,t){for(var r=-1,o=e.length,n=0,a=[];++r",""":'"',"'":"'"}),pr=function e(t){var r,o=(t=null==t?at:pr.defaults(at.Object(),t,pr.pick(at,Je))).Array,ne=t.Date,Pe=t.Error,ve=t.Function,be=t.Math,_e=t.Object,Ne=t.RegExp,Ce=t.String,Ae=t.TypeError,Oe=o.prototype,Me=ve.prototype,we=_e.prototype,Re=t["__core-js_shared__"],Ie=Me.toString,xe=we.hasOwnProperty,Le=0,Fe=(r=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",ke=we.toString,Be=Ie.call(_e),De=at._,Ue=Ne("^"+Ie.call(xe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=pt?t.Buffer:n,Ge=t.Symbol,ze=t.Uint8Array,je=Ve?Ve.allocUnsafe:n,qe=er(_e.getPrototypeOf,_e),Ye=_e.create,et=we.propertyIsEnumerable,ot=Oe.splice,nt=Ge?Ge.isConcatSpreadable:n,it=Ge?Ge.iterator:n,st=Ge?Ge.toStringTag:n,lt=function(){try{var e=ca(_e,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==at.clearTimeout&&t.clearTimeout,wt=ne&&ne.now!==at.Date.now&&ne.now,Dt=t.setTimeout!==at.setTimeout&&t.setTimeout,lr=be.ceil,cr=be.floor,ur=_e.getOwnPropertySymbols,yr=Ve?Ve.isBuffer:n,dr=t.isFinite,fr=Oe.join,mr=er(_e.keys,_e),gr=be.max,hr=be.min,Er=ne.now,Tr=t.parseInt,Sr=be.random,Pr=Oe.reverse,vr=ca(t,"DataView"),br=ca(t,"Map"),_r=ca(t,"Promise"),Nr=ca(t,"Set"),Cr=ca(t,"WeakMap"),Ar=ca(_e,"create"),Or=Cr&&new Cr,Mr={},wr=Ua(vr),Rr=Ua(br),Ir=Ua(_r),xr=Ua(Nr),Lr=Ua(Cr),Fr=Ge?Ge.prototype:n,kr=Fr?Fr.valueOf:n,Br=Fr?Fr.toString:n;function Dr(e){if(rs(e)&&!$i(e)&&!(e instanceof zr)){if(e instanceof Gr)return e;if(xe.call(e,"__wrapped__"))return Va(e)}return new Gr(e)}var Ur=function(){function e(){}return function(t){if(!ts(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Vr(){}function Gr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function zr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function jr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function io(e,t,r,o,a,i){var s,p=1&t,l=2&t,c=4&t;if(r&&(s=a?r(e,o,a,i):r(e)),s!==n)return s;if(!ts(e))return e;var u=$i(e);if(u){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&xe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!p)return On(e,s)}else{var y=da(e),d=y==S||y==P;if(Xi(e))return vn(e,p);if(y==_||y==m||d&&!a){if(s=l||d?{}:ma(e),!p)return l?function(e,t){return Mn(e,ya(e),t)}(e,function(e,t){return e&&Mn(t,xs(t),e)}(s,e)):function(e,t){return Mn(e,ua(e),t)}(e,ro(s,e))}else{if(!Ze[y])return a?e:{};s=function(e,t,r){var o,n=e.constructor;switch(t){case R:return bn(e);case h:case E:return new n(+e);case I:return function(e,t){var r=t?bn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case x:case L:case F:case k:case B:case D:case U:case V:case G:return _n(e,r);case v:return new n;case b:case O:return new n(e);case C:return function(e){var t=new e.constructor(e.source,ye.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new n;case M:return o=e,kr?_e(kr.call(o)):{}}}(e,y,p)}}i||(i=new Hr);var f=i.get(e);if(f)return f;i.set(e,s),ss(e)?e.forEach((function(o){s.add(io(o,t,r,o,e,i))})):os(e)&&e.forEach((function(o,n){s.set(n,io(o,t,r,n,e,i))}));var g=u?n:(c?l?oa:ra:l?xs:Is)(e);return Tt(g||e,(function(o,n){g&&(o=e[n=o]),Zr(s,n,io(o,t,r,n,e,i))})),s}function so(e,t,r){var o=r.length;if(null==e)return!o;for(e=_e(e);o--;){var a=r[o],i=t[a],s=e[a];if(s===n&&!(a in e)||!i(s))return!1}return!0}function po(e,t,r){if("function"!=typeof e)throw new Ae(a);return wa((function(){e.apply(n,r)}),t)}function lo(e,t,r,o){var n=-1,a=bt,i=!0,s=e.length,p=[],l=t.length;if(!s)return p;r&&(t=Nt(t,jt(r))),o?(a=_t,i=!1):t.length>=200&&(a=$t,i=!1,t=new qr(t));e:for(;++n-1},Wr.prototype.set=function(e,t){var r=this.__data__,o=eo(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new jr,map:new(br||Wr),string:new jr}},$r.prototype.delete=function(e){var t=pa(this,e).delete(e);return this.size-=t?1:0,t},$r.prototype.get=function(e){return pa(this,e).get(e)},$r.prototype.has=function(e){return pa(this,e).has(e)},$r.prototype.set=function(e,t){var r=pa(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this},qr.prototype.add=qr.prototype.push=function(e){return this.__data__.set(e,i),this},qr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Hr.prototype.get=function(e){return this.__data__.get(e)},Hr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var o=r.__data__;if(!br||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new $r(o)}return r.set(e,t),this.size=r.size,this};var co=In(To),uo=In(So,!0);function yo(e,t){var r=!0;return co(e,(function(e,o,n){return r=!!t(e,o,n)})),r}function fo(e,t,r){for(var o=-1,a=e.length;++o0&&r(s)?t>1?go(s,t-1,r,o,n):Ct(n,s):o||(n[n.length]=s)}return n}var ho=xn(),Eo=xn(!0);function To(e,t){return e&&ho(e,t,Is)}function So(e,t){return e&&Eo(e,t,Is)}function Po(e,t){return vt(t,(function(t){return Ki(e[t])}))}function vo(e,t){for(var r=0,o=(t=En(t,e)).length;null!=e&&rt}function Co(e,t){return null!=e&&xe.call(e,t)}function Ao(e,t){return null!=e&&t in _e(e)}function Oo(e,t,r){for(var a=r?_t:bt,i=e[0].length,s=e.length,p=s,l=o(s),c=1/0,u=[];p--;){var y=e[p];p&&t&&(y=Nt(y,jt(t))),c=hr(y.length,c),l[p]=!r&&(t||i>=120&&y.length>=120)?new qr(p&&y):n}y=e[0];var d=-1,f=l[0];e:for(;++d=s?p:p*("desc"==r[o]?-1:1)}return e.index-t.index}(e,t,r)}));o--;)e[o]=e[o].value;return e}(n)}function jo(e,t,r){for(var o=-1,n=t.length,a={};++o-1;)s!==e&&ot.call(s,p,1),ot.call(e,p,1);return e}function $o(e,t){for(var r=e?t.length:0,o=r-1;r--;){var n=t[r];if(r==o||n!==a){var a=n;ha(n)?ot.call(e,n,1):cn(e,n)}}return e}function qo(e,t){return e+cr(Sr()*(t-e+1))}function Ho(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=cr(t/2))&&(e+=e)}while(t);return r}function Yo(e,t){return Ra(Na(e,t,np),e+"")}function Xo(e){return Xr(Gs(e))}function Jo(e,t){var r=Gs(e);return La(r,ao(t,0,r.length))}function Qo(e,t,r,o){if(!ts(e))return e;for(var a=-1,i=(t=En(t,e)).length,s=i-1,p=e;null!=p&&++aa?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=o(a);++n>>1,i=e[a];null!==i&&!ls(i)&&(r?i<=t:i=200){var l=t?null:Yn(e);if(l)return rr(l);i=!1,n=$t,p=new qr}else p=t?[]:s;e:for(;++o=o?e:tn(e,t,r)}var Pn=ct||function(e){return at.clearTimeout(e)};function vn(e,t){if(t)return e.slice();var r=e.length,o=je?je(r):new e.constructor(r);return e.copy(o),o}function bn(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function _n(e,t){var r=t?bn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Nn(e,t){if(e!==t){var r=e!==n,o=null===e,a=e==e,i=ls(e),s=t!==n,p=null===t,l=t==t,c=ls(t);if(!p&&!c&&!i&&e>t||i&&s&&l&&!p&&!c||o&&s&&l||!r&&l||!a)return 1;if(!o&&!i&&!c&&e1?r[a-1]:n,s=a>2?r[2]:n;for(i=e.length>3&&"function"==typeof i?(a--,i):n,s&&Ea(r[0],r[1],s)&&(i=a<3?n:i,a=1),t=_e(t);++o-1?a[i?t[s]:s]:n}}function Dn(e){return ta((function(t){var r=t.length,o=r,i=Gr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ae(a);if(i&&!p&&"wrapper"==aa(s))var p=new Gr([],!0)}for(o=p?o:r;++o1&&T.reverse(),d&&up))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var y=-1,d=!0,f=2&r?new qr:n;for(i.set(e,t),i.set(t,e);++y-1&&e%1==0&&e1?"& ":"")+t[o],t=t.join(r>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(o,function(e,t){return Tt(f,(function(r){var o="_."+r[0];t&r[1]&&!bt(e,o)&&e.push(o)})),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(se):[]}(o),r)))}function xa(e){var t=0,r=0;return function(){var o=Er(),a=16-(o-r);if(r=o,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function La(e,t){var r=-1,o=e.length,a=o-1;for(t=t===n?o:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ii(e,r)}));function di(e){var t=Dr(e);return t.__chain__=!0,t}function fi(e,t){return t(e)}var mi=ta((function(e){var t=e.length,r=t?e[0]:0,o=this.__wrapped__,a=function(t){return no(t,e)};return!(t>1||this.__actions__.length)&&o instanceof zr&&ha(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:fi,args:[a],thisArg:n}),new Gr(o,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(a)})),gi=wn((function(e,t,r){xe.call(e,r)?++e[r]:oo(e,r,1)})),hi=Bn(Wa),Ei=Bn($a);function Ti(e,t){return($i(e)?Tt:co)(e,sa(t,3))}function Si(e,t){return($i(e)?St:uo)(e,sa(t,3))}var Pi=wn((function(e,t,r){xe.call(e,r)?e[r].push(t):oo(e,r,[t])})),vi=Yo((function(e,t,r){var n=-1,a="function"==typeof t,i=Hi(e)?o(e.length):[];return co(e,(function(e){i[++n]=a?ht(t,e,r):Mo(e,t,r)})),i})),bi=wn((function(e,t,r){oo(e,r,t)}));function _i(e,t){return($i(e)?Nt:Bo)(e,sa(t,3))}var Ni=wn((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Ci=Yo((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ea(e,t[0],t[1])?t=[]:r>2&&Ea(t[0],t[1],t[2])&&(t=[t[0]]),zo(e,go(t,1),[])})),Ai=wt||function(){return at.Date.now()};function Oi(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Jn(e,l,n,n,n,n,t)}function Mi(e,t){var r;if("function"!=typeof t)throw new Ae(a);return e=ms(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var wi=Yo((function(e,t,r){var o=1;if(r.length){var n=tr(r,ia(wi));o|=p}return Jn(e,o,t,r,n)})),Ri=Yo((function(e,t,r){var o=3;if(r.length){var n=tr(r,ia(Ri));o|=p}return Jn(t,o,e,r,n)}));function Ii(e,t,r){var o,i,s,p,l,c,u=0,y=!1,d=!1,f=!0;if("function"!=typeof e)throw new Ae(a);function m(t){var r=o,a=i;return o=i=n,u=t,p=e.apply(a,r)}function g(e){return u=e,l=wa(E,t),y?m(e):p}function h(e){var r=e-c;return c===n||r>=t||r<0||d&&e-u>=s}function E(){var e=Ai();if(h(e))return T(e);l=wa(E,function(e){var r=t-(e-c);return d?hr(r,s-(e-u)):r}(e))}function T(e){return l=n,f&&o?m(e):(o=i=n,p)}function S(){var e=Ai(),r=h(e);if(o=arguments,i=this,c=e,r){if(l===n)return g(c);if(d)return Pn(l),l=wa(E,t),m(c)}return l===n&&(l=wa(E,t)),p}return t=hs(t)||0,ts(r)&&(y=!!r.leading,s=(d="maxWait"in r)?gr(hs(r.maxWait)||0,t):s,f="trailing"in r?!!r.trailing:f),S.cancel=function(){l!==n&&Pn(l),u=0,o=c=i=l=n},S.flush=function(){return l===n?p:T(Ai())},S}var xi=Yo((function(e,t){return po(e,1,t)})),Li=Yo((function(e,t,r){return po(e,hs(t)||0,r)}));function Fi(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ae(a);var r=function(){var o=arguments,n=t?t.apply(this,o):o[0],a=r.cache;if(a.has(n))return a.get(n);var i=e.apply(this,o);return r.cache=a.set(n,i)||a,i};return r.cache=new(Fi.Cache||$r),r}function ki(e){if("function"!=typeof e)throw new Ae(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Fi.Cache=$r;var Bi=Tn((function(e,t){var r=(t=1==t.length&&$i(t[0])?Nt(t[0],jt(sa())):Nt(go(t,1),jt(sa()))).length;return Yo((function(o){for(var n=-1,a=hr(o.length,r);++n=t})),Wi=wo(function(){return arguments}())?wo:function(e){return rs(e)&&xe.call(e,"callee")&&!et.call(e,"callee")},$i=o.isArray,qi=ut?jt(ut):function(e){return rs(e)&&_o(e)==R};function Hi(e){return null!=e&&es(e.length)&&!Ki(e)}function Yi(e){return rs(e)&&Hi(e)}var Xi=yr||hp,Ji=yt?jt(yt):function(e){return rs(e)&&_o(e)==E};function Qi(e){if(!rs(e))return!1;var t=_o(e);return t==T||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function Ki(e){if(!ts(e))return!1;var t=_o(e);return t==S||t==P||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zi(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var os=dt?jt(dt):function(e){return rs(e)&&da(e)==v};function ns(e){return"number"==typeof e||rs(e)&&_o(e)==b}function as(e){if(!rs(e)||_o(e)!=_)return!1;var t=qe(e);if(null===t)return!0;var r=xe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Ie.call(r)==Be}var is=ft?jt(ft):function(e){return rs(e)&&_o(e)==C},ss=mt?jt(mt):function(e){return rs(e)&&da(e)==A};function ps(e){return"string"==typeof e||!$i(e)&&rs(e)&&_o(e)==O}function ls(e){return"symbol"==typeof e||rs(e)&&_o(e)==M}var cs=gt?jt(gt):function(e){return rs(e)&&es(e.length)&&!!Ke[_o(e)]},us=$n(ko),ys=$n((function(e,t){return e<=t}));function ds(e){if(!e)return[];if(Hi(e))return ps(e)?ar(e):On(e);if(it&&e[it])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[it]());var t=da(e);return(t==v?Zt:t==A?rr:Gs)(e)}function fs(e){return e?(e=hs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=fs(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?ao(ms(e),0,d):0}function hs(e){if("number"==typeof e)return e;if(ls(e))return y;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=zt(e);var r=fe.test(e);return r||ge.test(e)?rt(e.slice(2),r?2:8):de.test(e)?y:+e}function Es(e){return Mn(e,xs(e))}function Ts(e){return null==e?"":pn(e)}var Ss=Rn((function(e,t){if(va(t)||Hi(t))Mn(t,Is(t),e);else for(var r in t)xe.call(t,r)&&Zr(e,r,t[r])})),Ps=Rn((function(e,t){Mn(t,xs(t),e)})),vs=Rn((function(e,t,r,o){Mn(t,xs(t),e,o)})),bs=Rn((function(e,t,r,o){Mn(t,Is(t),e,o)})),_s=ta(no),Ns=Yo((function(e,t){e=_e(e);var r=-1,o=t.length,a=o>2?t[2]:n;for(a&&Ea(t[0],t[1],a)&&(o=1);++r1),t})),Mn(e,oa(e),r),o&&(r=io(r,7,Zn));for(var n=t.length;n--;)cn(r,t[n]);return r})),Bs=ta((function(e,t){return null==e?{}:function(e,t){return jo(e,t,(function(t,r){return Os(e,r)}))}(e,t)}));function Ds(e,t){if(null==e)return{};var r=Nt(oa(e),(function(e){return[e]}));return t=sa(t),jo(e,r,(function(e,r){return t(e,r[0])}))}var Us=Xn(Is),Vs=Xn(xs);function Gs(e){return null==e?[]:Wt(e,Is(e))}var zs=Fn((function(e,t,r){return t=t.toLowerCase(),e+(r?js(t):t)}));function js(e){return Qs(Ts(e).toLowerCase())}function Ws(e){return(e=Ts(e))&&e.replace(Ee,Xt).replace($e,"")}var $s=Fn((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),qs=Fn((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Hs=Ln("toLowerCase"),Ys=Fn((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Xs=Fn((function(e,t,r){return e+(r?" ":"")+Qs(t)})),Js=Fn((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Qs=Ln("toUpperCase");function Ks(e,t,r){return e=Ts(e),(t=r?n:t)===n?function(e){return Xe.test(e)}(e)?function(e){return e.match(He)||[]}(e):function(e){return e.match(pe)||[]}(e):e.match(t)||[]}var Zs=Yo((function(e,t){try{return ht(e,n,t)}catch(e){return Qi(e)?e:new Pe(e)}})),ep=ta((function(e,t){return Tt(t,(function(t){t=Da(t),oo(e,t,wi(e[t],e))})),e}));function tp(e){return function(){return e}}var rp=Dn(),op=Dn(!0);function np(e){return e}function ap(e){return Lo("function"==typeof e?e:io(e,1))}var ip=Yo((function(e,t){return function(r){return Mo(r,e,t)}})),sp=Yo((function(e,t){return function(r){return Mo(e,r,t)}}));function pp(e,t,r){var o=Is(t),n=Po(t,o);null!=r||ts(t)&&(n.length||!o.length)||(r=t,t=e,e=this,n=Po(t,Is(t)));var a=!(ts(r)&&"chain"in r&&!r.chain),i=Ki(e);return Tt(n,(function(r){var o=t[r];e[r]=o,i&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__),n=r.__actions__=On(this.__actions__);return n.push({func:o,args:arguments,thisArg:e}),r.__chain__=t,r}return o.apply(e,Ct([this.value()],arguments))})})),e}function lp(){}var cp=zn(Nt),up=zn(Pt),yp=zn(Mt);function dp(e){return Ta(e)?Bt(Da(e)):function(e){return function(t){return vo(t,e)}}(e)}var fp=Wn(),mp=Wn(!0);function gp(){return[]}function hp(){return!1}var Ep,Tp=Gn((function(e,t){return e+t}),0),Sp=Hn("ceil"),Pp=Gn((function(e,t){return e/t}),1),vp=Hn("floor"),bp=Gn((function(e,t){return e*t}),1),_p=Hn("round"),Np=Gn((function(e,t){return e-t}),0);return Dr.after=function(e,t){if("function"!=typeof t)throw new Ae(a);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},Dr.ary=Oi,Dr.assign=Ss,Dr.assignIn=Ps,Dr.assignInWith=vs,Dr.assignWith=bs,Dr.at=_s,Dr.before=Mi,Dr.bind=wi,Dr.bindAll=ep,Dr.bindKey=Ri,Dr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $i(e)?e:[e]},Dr.chain=di,Dr.chunk=function(e,t,r){t=(r?Ea(e,t,r):t===n)?1:gr(ms(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var i=0,s=0,p=o(lr(a/t));ia?0:a+r),(o=o===n||o>a?a:ms(o))<0&&(o+=a),o=r>o?0:gs(o);r>>0)?(e=Ts(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=pn(t))&&Kt(e)?Sn(ar(e),0,r):e.split(t,r):[]},Dr.spread=function(e,t){if("function"!=typeof e)throw new Ae(a);return t=null==t?0:gr(ms(t),0),Yo((function(r){var o=r[t],n=Sn(r,0,t);return o&&Ct(n,o),ht(e,this,n)}))},Dr.tail=function(e){var t=null==e?0:e.length;return t?tn(e,1,t):[]},Dr.take=function(e,t,r){return e&&e.length?tn(e,0,(t=r||t===n?1:ms(t))<0?0:t):[]},Dr.takeRight=function(e,t,r){var o=null==e?0:e.length;return o?tn(e,(t=o-(t=r||t===n?1:ms(t)))<0?0:t,o):[]},Dr.takeRightWhile=function(e,t){return e&&e.length?yn(e,sa(t,3),!1,!0):[]},Dr.takeWhile=function(e,t){return e&&e.length?yn(e,sa(t,3)):[]},Dr.tap=function(e,t){return t(e),e},Dr.throttle=function(e,t,r){var o=!0,n=!0;if("function"!=typeof e)throw new Ae(a);return ts(r)&&(o="leading"in r?!!r.leading:o,n="trailing"in r?!!r.trailing:n),Ii(e,t,{leading:o,maxWait:t,trailing:n})},Dr.thru=fi,Dr.toArray=ds,Dr.toPairs=Us,Dr.toPairsIn=Vs,Dr.toPath=function(e){return $i(e)?Nt(e,Da):ls(e)?[e]:On(Ba(Ts(e)))},Dr.toPlainObject=Es,Dr.transform=function(e,t,r){var o=$i(e),n=o||Xi(e)||cs(e);if(t=sa(t,4),null==r){var a=e&&e.constructor;r=n?o?new a:[]:ts(e)&&Ki(a)?Ur(qe(e)):{}}return(n?Tt:To)(e,(function(e,o,n){return t(r,e,o,n)})),r},Dr.unary=function(e){return Oi(e,1)},Dr.union=ri,Dr.unionBy=oi,Dr.unionWith=ni,Dr.uniq=function(e){return e&&e.length?ln(e):[]},Dr.uniqBy=function(e,t){return e&&e.length?ln(e,sa(t,2)):[]},Dr.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ln(e,n,t):[]},Dr.unset=function(e,t){return null==e||cn(e,t)},Dr.unzip=ai,Dr.unzipWith=ii,Dr.update=function(e,t,r){return null==e?e:un(e,t,hn(r))},Dr.updateWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:un(e,t,hn(r),o)},Dr.values=Gs,Dr.valuesIn=function(e){return null==e?[]:Wt(e,xs(e))},Dr.without=si,Dr.words=Ks,Dr.wrap=function(e,t){return Di(hn(t),e)},Dr.xor=pi,Dr.xorBy=li,Dr.xorWith=ci,Dr.zip=ui,Dr.zipObject=function(e,t){return mn(e||[],t||[],Zr)},Dr.zipObjectDeep=function(e,t){return mn(e||[],t||[],Qo)},Dr.zipWith=yi,Dr.entries=Us,Dr.entriesIn=Vs,Dr.extend=Ps,Dr.extendWith=vs,pp(Dr,Dr),Dr.add=Tp,Dr.attempt=Zs,Dr.camelCase=zs,Dr.capitalize=js,Dr.ceil=Sp,Dr.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=hs(r))==r?r:0),t!==n&&(t=(t=hs(t))==t?t:0),ao(hs(e),t,r)},Dr.clone=function(e){return io(e,4)},Dr.cloneDeep=function(e){return io(e,5)},Dr.cloneDeepWith=function(e,t){return io(e,5,t="function"==typeof t?t:n)},Dr.cloneWith=function(e,t){return io(e,4,t="function"==typeof t?t:n)},Dr.conformsTo=function(e,t){return null==t||so(e,t,Is(t))},Dr.deburr=Ws,Dr.defaultTo=function(e,t){return null==e||e!=e?t:e},Dr.divide=Pp,Dr.endsWith=function(e,t,r){e=Ts(e),t=pn(t);var o=e.length,a=r=r===n?o:ao(ms(r),0,o);return(r-=t.length)>=0&&e.slice(r,a)==t},Dr.eq=Gi,Dr.escape=function(e){return(e=Ts(e))&&Y.test(e)?e.replace(q,Jt):e},Dr.escapeRegExp=function(e){return(e=Ts(e))&&re.test(e)?e.replace(te,"\\$&"):e},Dr.every=function(e,t,r){var o=$i(e)?Pt:yo;return r&&Ea(e,t,r)&&(t=n),o(e,sa(t,3))},Dr.find=hi,Dr.findIndex=Wa,Dr.findKey=function(e,t){return Rt(e,sa(t,3),To)},Dr.findLast=Ei,Dr.findLastIndex=$a,Dr.findLastKey=function(e,t){return Rt(e,sa(t,3),So)},Dr.floor=vp,Dr.forEach=Ti,Dr.forEachRight=Si,Dr.forIn=function(e,t){return null==e?e:ho(e,sa(t,3),xs)},Dr.forInRight=function(e,t){return null==e?e:Eo(e,sa(t,3),xs)},Dr.forOwn=function(e,t){return e&&To(e,sa(t,3))},Dr.forOwnRight=function(e,t){return e&&So(e,sa(t,3))},Dr.get=As,Dr.gt=zi,Dr.gte=ji,Dr.has=function(e,t){return null!=e&&fa(e,t,Co)},Dr.hasIn=Os,Dr.head=Ha,Dr.identity=np,Dr.includes=function(e,t,r,o){e=Hi(e)?e:Gs(e),r=r&&!o?ms(r):0;var n=e.length;return r<0&&(r=gr(n+r,0)),ps(e)?r<=n&&e.indexOf(t,r)>-1:!!n&&xt(e,t,r)>-1},Dr.indexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var n=null==r?0:ms(r);return n<0&&(n=gr(o+n,0)),xt(e,t,n)},Dr.inRange=function(e,t,r){return t=fs(t),r===n?(r=t,t=0):r=fs(r),function(e,t,r){return e>=hr(t,r)&&e=-9007199254740991&&e<=u},Dr.isSet=ss,Dr.isString=ps,Dr.isSymbol=ls,Dr.isTypedArray=cs,Dr.isUndefined=function(e){return e===n},Dr.isWeakMap=function(e){return rs(e)&&da(e)==w},Dr.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==_o(e)},Dr.join=function(e,t){return null==e?"":fr.call(e,t)},Dr.kebabCase=$s,Dr.last=Qa,Dr.lastIndexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var a=o;return r!==n&&(a=(a=ms(r))<0?gr(o+a,0):hr(a,o-1)),t==t?function(e,t,r){for(var o=r+1;o--;)if(e[o]===t)return o;return o}(e,t,a):It(e,Ft,a,!0)},Dr.lowerCase=qs,Dr.lowerFirst=Hs,Dr.lt=us,Dr.lte=ys,Dr.max=function(e){return e&&e.length?fo(e,np,No):n},Dr.maxBy=function(e,t){return e&&e.length?fo(e,sa(t,2),No):n},Dr.mean=function(e){return kt(e,np)},Dr.meanBy=function(e,t){return kt(e,sa(t,2))},Dr.min=function(e){return e&&e.length?fo(e,np,ko):n},Dr.minBy=function(e,t){return e&&e.length?fo(e,sa(t,2),ko):n},Dr.stubArray=gp,Dr.stubFalse=hp,Dr.stubObject=function(){return{}},Dr.stubString=function(){return""},Dr.stubTrue=function(){return!0},Dr.multiply=bp,Dr.nth=function(e,t){return e&&e.length?Go(e,ms(t)):n},Dr.noConflict=function(){return at._===this&&(at._=De),this},Dr.noop=lp,Dr.now=Ai,Dr.pad=function(e,t,r){e=Ts(e);var o=(t=ms(t))?nr(e):0;if(!t||o>=t)return e;var n=(t-o)/2;return jn(cr(n),r)+e+jn(lr(n),r)},Dr.padEnd=function(e,t,r){e=Ts(e);var o=(t=ms(t))?nr(e):0;return t&&ot){var o=e;e=t,t=o}if(r||e%1||t%1){var a=Sr();return hr(e+a*(t-e+tt("1e-"+((a+"").length-1))),t)}return qo(e,t)},Dr.reduce=function(e,t,r){var o=$i(e)?At:Ut,n=arguments.length<3;return o(e,sa(t,4),r,n,co)},Dr.reduceRight=function(e,t,r){var o=$i(e)?Ot:Ut,n=arguments.length<3;return o(e,sa(t,4),r,n,uo)},Dr.repeat=function(e,t,r){return t=(r?Ea(e,t,r):t===n)?1:ms(t),Ho(Ts(e),t)},Dr.replace=function(){var e=arguments,t=Ts(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dr.result=function(e,t,r){var o=-1,a=(t=En(t,e)).length;for(a||(a=1,e=n);++ou)return[];var r=d,o=hr(e,d);t=sa(t),e-=d;for(var n=Gt(o,t);++r=i)return e;var p=r-nr(o);if(p<1)return o;var l=s?Sn(s,0,p).join(""):e.slice(0,p);if(a===n)return l+o;if(s&&(p+=l.length-p),is(a)){if(e.slice(p).search(a)){var c,u=l;for(a.global||(a=Ne(a.source,Ts(ye.exec(a))+"g")),a.lastIndex=0;c=a.exec(u);)var y=c.index;l=l.slice(0,y===n?p:y)}}else if(e.indexOf(pn(a),p)!=p){var d=l.lastIndexOf(a);d>-1&&(l=l.slice(0,d))}return l+o},Dr.unescape=function(e){return(e=Ts(e))&&H.test(e)?e.replace($,sr):e},Dr.uniqueId=function(e){var t=++Le;return Ts(e)+t},Dr.upperCase=Js,Dr.upperFirst=Qs,Dr.each=Ti,Dr.eachRight=Si,Dr.first=Ha,pp(Dr,(Ep={},To(Dr,(function(e,t){xe.call(Dr.prototype,t)||(Ep[t]=e)})),Ep),{chain:!1}),Dr.VERSION="4.17.21",Tt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Dr[e].placeholder=Dr})),Tt(["drop","take"],(function(e,t){zr.prototype[e]=function(r){r=r===n?1:gr(ms(r),0);var o=this.__filtered__&&!t?new zr(this):this.clone();return o.__filtered__?o.__takeCount__=hr(r,o.__takeCount__):o.__views__.push({size:hr(r,d),type:e+(o.__dir__<0?"Right":"")}),o},zr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Tt(["filter","map","takeWhile"],(function(e,t){var r=t+1,o=1==r||3==r;zr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:sa(e,3),type:r}),t.__filtered__=t.__filtered__||o,t}})),Tt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");zr.prototype[e]=function(){return this[r](1).value()[0]}})),Tt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");zr.prototype[e]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(np)},zr.prototype.find=function(e){return this.filter(e).head()},zr.prototype.findLast=function(e){return this.reverse().find(e)},zr.prototype.invokeMap=Yo((function(e,t){return"function"==typeof e?new zr(this):this.map((function(r){return Mo(r,e,t)}))})),zr.prototype.reject=function(e){return this.filter(ki(sa(e)))},zr.prototype.slice=function(e,t){e=ms(e);var r=this;return r.__filtered__&&(e>0||t<0)?new zr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ms(t))<0?r.dropRight(-t):r.take(t-e)),r)},zr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zr.prototype.toArray=function(){return this.take(d)},To(zr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),a=Dr[o?"take"+("last"==t?"Right":""):t],i=o||/^find/.test(t);a&&(Dr.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,p=t instanceof zr,l=s[0],c=p||$i(t),u=function(e){var t=a.apply(Dr,Ct([e],s));return o&&y?t[0]:t};c&&r&&"function"==typeof l&&1!=l.length&&(p=c=!1);var y=this.__chain__,d=!!this.__actions__.length,f=i&&!y,m=p&&!d;if(!i&&c){t=m?t:new zr(this);var g=e.apply(t,s);return g.__actions__.push({func:fi,args:[u],thisArg:n}),new Gr(g,y)}return f&&m?e.apply(this,s):(g=this.thru(u),f?o?g.value()[0]:g.value():g)})})),Tt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Oe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);Dr.prototype[e]=function(){var e=arguments;if(o&&!this.__chain__){var n=this.value();return t.apply($i(n)?n:[],e)}return this[r]((function(r){return t.apply($i(r)?r:[],e)}))}})),To(zr.prototype,(function(e,t){var r=Dr[t];if(r){var o=r.name+"";xe.call(Mr,o)||(Mr[o]=[]),Mr[o].push({name:t,func:r})}})),Mr[Un(n,2).name]=[{name:"wrapper",func:n}],zr.prototype.clone=function(){var e=new zr(this.__wrapped__);return e.__actions__=On(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=On(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=On(this.__views__),e},zr.prototype.reverse=function(){if(this.__filtered__){var e=new zr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=$i(e),o=t<0,n=r?e.length:0,a=function(e,t,r){for(var o=-1,n=r.length;++o=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Dr.prototype.plant=function(e){for(var t,r=this;r instanceof Vr;){var o=Va(r);o.__index__=0,o.__values__=n,t?a.__wrapped__=o:t=o;var a=o;r=r.__wrapped__}return a.__wrapped__=e,t},Dr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zr){var t=e;return this.__actions__.length&&(t=new zr(this)),(t=t.reverse()).__actions__.push({func:fi,args:[ti],thisArg:n}),new Gr(t,this.__chain__)}return this.thru(ti)},Dr.prototype.toJSON=Dr.prototype.valueOf=Dr.prototype.value=function(){return dn(this.__wrapped__,this.__actions__)},Dr.prototype.first=Dr.prototype.head,it&&(Dr.prototype[it]=function(){return this}),Dr}();at._=pr,(o=function(){return pr}.call(t,r,t,e))===n||(e.exports=o)}.call(this)},904:(e,t)=>{"use strict";var r;let o;Object.defineProperty(t,"__esModule",{value:!0}),t.setDomain=t.getDomain=t.Domain=void 0,function(e){e[e.FA=0]="FA",e[e.FORM=1]="FORM",e[e.ETS=2]="ETS"}(r||(r={})),t.Domain=r,t.setDomain=e=>{o=e},t.getDomain=()=>null!=o?o:r.FA},3784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMap=void 0,t.errorMap=new Map([["fileError","Visual file is damaged"],["versionError","Version number of visual file does not match"],["modelError","Visual model in visual file is damaged"],["codegenError","Codegen visual file failed"]])},4117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNode=void 0,t.ASTNode=class{accept(e){return e.visit(this)}}},1862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0,t.Cache=class{constructor(e,t=0){this.value="",this.indent=t,this.flag=!0,this.INDENT=e}indentOn(){this.flag=!0}indentOff(){this.flag=!1}incIndent(){this.indent++}decIndent(){this.indent--}checkIndent(){return this.indent<0}getIndents(){if(this.flag){let e="";for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const o=r(4117);class n extends o.ASTNode{constructor(e,t,r,o,n){super(),this.builders=new Map,this.defaultValue=new Map,this.mediaParams=new Map,this.mediaProperties=new Map,this.mediaKeyProperty=new Map,this.tagName=e,this.params=t,this.content=r,this.properties=o,this.forEachObj=n,this.ifBoolean=null,this.isCustomTag=!1}setMediaParams(e){this.mediaParams=e}setParams(e){this.params=e}setIfBoolean(e){this.ifBoolean=e}setTagName(e){this.tagName=e}setForEachObj(e){this.forEachObj=e}setMediaProperty(e,t){t.forEach(((t,r)=>{var o;this.mediaKeyProperty.has(r)||this.mediaKeyProperty.set(r,new Map),null===(o=this.mediaKeyProperty.get(r))||void 0===o||o.set(e,t)}))}setDefaultValue(e,t,r="undefined",o=""){this.defaultValue.set(e,[r,t,o])}}t.Tag=n},5623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const o=r(9519),n=r(1862),a=r(5051),i=r(4294),s=r(6486),p=r(9459);class l{constructor(e){this.cache=e,this.etsImport=new n.Cache(" ",0),this.etsVariable=new n.Cache(" ",1),this.etsFunction=new n.Cache(" ",1),this.etsBuilder=new n.Cache(" ",1),this.aboutToAppear=new n.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}visit(e){e instanceof o.Tag&&(e.isCustomTag?this.genCustomTag(e):(this.needMediaQuery&&this.genMediaQuery(e),this.genTag(e)))}static getMethodGen(e){return void 0===l.instance?l.instance=new l(e):l.instance.setCache(e),l.instance}setCache(e){this.cache=e,this.etsImport=new n.Cache(" ",0),this.etsVariable=new n.Cache(" ",1),this.etsFunction=new n.Cache(" ",1),this.etsBuilder=new n.Cache(" ",1),this.aboutToAppear=new n.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}genParams(e){const t=this.getParams(e);this.isCustomComponent(e)?this.genCustomParams(t):this.genCommonParams(t)}genCommonParams(e){if("string"==typeof e)this.cache.concat(e);else if(e.size>0){this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE);let t=0;e.forEach(((r,o)=>{this.cache.concat(o,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(t,a.TokenClass.COLON,a.TokenClass.SPACE,e,a.TokenClass.COMMA)})),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genObjectProperty(e){let t=0;this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE),e.forEach(((r,o)=>{this.cache.concat(o,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{e.accept(this),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.decIndent(),this.cache.indentOn()),this.cache.indentOn(),this.cache.concat(a.TokenClass.RBRA)),(null!==e.properties||null!==e.mediaProperties)&&(null!==e.content&&0!==e.content.length||this.cache.incIndent(),this.getProperties(e).forEach(((e,t)=>{this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.PROPERTY_START,t,a.TokenClass.TAG_START),this.cache.indentOff(),"string"==typeof e?this.cache.concat(e,a.TokenClass.TAG_END):this.genObjectProperty(e)})),null!==e.content&&0!==e.content.length||this.cache.decIndent()),this.genEnd(e),this.genBuildersFunction(e)}genStart(e){this.genIfStart(e),this.genForTagStart(e),this.genCustomImport(e)}genEnd(e){this.genForTagEnd(e),this.genIfEnd(e)}genForTagStart(e){var t;void 0!==(null===(t=e.forEachObj)||void 0===t?void 0:t.for)&&(this.cache.concat("ForEach",a.TokenClass.TAG_START,e.forEachObj.for.toString(),a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE))}genForTagEnd(e){null!==e.forEachObj&&(this.cache.concat(a.TokenClass.RBRA),void 0!==e.forEachObj.key&&""!==e.forEachObj.key&&(this.cache.concat(a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.concat("return ",e.forEachObj.key.toString(),a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.TAG_END,a.TokenClass.RBRA),this.cache.indentOff()),this.cache.concat(a.TokenClass.TAG_END))}genIfStart(e){null!==e.ifBoolean&&(this.cache.concat("if",a.TokenClass.SPACE,a.TokenClass.TAG_START,e.ifBoolean.toString(),a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.incIndent())}genIfEnd(e){null!==e.ifBoolean&&(this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genMediaQuery(e){const t=new Map,r=new Map;if(this.collectMediaQueryMap(e,t),this.collectDefaultValueMap(e,r),0===t.size&&0===r.size)return;const o=(0,i.getUniqueName)("mediaQuery"),s=(0,i.getUniqueName)("initForMediaQuery"),p=(0,i.getUniqueName)("mediaQueryCb"),l=(0,i.getUniqueName)("saveMediaQueryResult"),c=(0,i.getUniqueName)("updateForMediaQuery"),u=new n.Cache(a.TokenClass.INDENT,1),y=new n.Cache(a.TokenClass.INDENT,1),d=new n.Cache(a.TokenClass.INDENT,1),f=new n.Cache(a.TokenClass.INDENT,1),m=new n.Cache(a.TokenClass.INDENT,1),g=new n.Cache(a.TokenClass.INDENT,1),h=new n.Cache(a.TokenClass.INDENT,1),E=new n.Cache(a.TokenClass.INDENT,2);this.genVariableDeclare(r,u,a.TokenClass.UNDEFINED),this.genMediaQueryCb(p,y),this.genMediaQueryListener(t,d,f),this.genInitFuc(s,r,m),this.genMediaQueryCbFnc(l,c,t,g),this.genUpdateFnc(c,s,t,h),this.genAboutToAppear(p,l,t,E),this.etsImport.indentOff(),this.aboutToAppear.indentOff(),this.etsVariable.indentOff(),this.etsFunction.indentOff(),this.etsImport.indentOff(),this.etsImport.concat("import ",o," from '@ohos.mediaquery'",a.TokenClass.NEW_LINE),this.aboutToAppear.concat(E.toString()),this.etsVariable.concat(u.toString(),y.toString(),d.toString(),f.toString()),this.etsFunction.concat(g.toString(),a.TokenClass.NEW_LINE,m.toString(),a.TokenClass.NEW_LINE,h.toString()),this.etsImport.indentOn(),this.aboutToAppear.indentOn(),this.etsVariable.indentOn(),this.etsFunction.indentOn(),this.needMediaQuery=!1}genBuildersFunction(e){e.builders.forEach(((e,t)=>{this.etsBuilder.indentOff(),this.etsBuilder.concat(a.TokenClass.NEW_LINE),this.etsBuilder.indentOn(),this.etsBuilder.concat(a.TokenClass.DECORATOR_Builder,a.TokenClass.SPACE,t,a.TokenClass.TAG_START,a.TokenClass.TAG_END),this.etsBuilder.indentOff();const r=(0,p.genBuilderEts)(e);this.etsBuilder.concat(a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.etsBuilder.indentOn(),this.etsBuilder.concat(r.cache.toString(),a.TokenClass.NEW_LINE),this.etsBuilder.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE),this.etsBuilder.indentOff(),this.etsBuilder.concat(r.etsBuilder.toString())}))}genCustomTag(e){this.genVariableDeclare(e.defaultValue,this.cache)}genVariableDeclare(e,t,r){t.indentOn(),e.forEach(((e,o)=>{const n=e[2];""!==n&&(t.concat(n,a.TokenClass.SPACE),t.indentOff()),t.concat(o.slice(5),a.TokenClass.COLON,a.TokenClass.SPACE,e[1]),t.indentOff();const i=null!=r?r:e[0];null!=i&&t.concat(a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,i),t.concat(a.TokenClass.NEW_LINE),t.indentOn()}))}genMediaQueryCb(e,t){t.concat(e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.NULL,a.TokenClass.NEW_LINE)}genMediaQueryListener(e,t,r){const o=(0,i.getUniqueName)("mediaQuery");e.forEach(((e,n)=>{const s=(0,i.getUniqueName)(this.getMediaQueryVariableName(n));t.concat(s,a.TokenClass.COLON,a.TokenClass.SPACE,a.TokenClass.BOOLEAN,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.FALSE,a.TokenClass.NEW_LINE),r.concat(`listener_${s}`,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,o,a.TokenClass.PROPERTY_START,"matchMediaSync",a.TokenClass.TAG_START,`'${n}'`,a.TokenClass.TAG_END,a.TokenClass.NEW_LINE)}))}genInitFuc(e,t,r){r.concat(e,a.TokenClass.TAG_START,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),r.indentOn(),r.incIndent(),t.forEach(((e,t)=>{r.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e[0],a.TokenClass.NEW_LINE)})),r.decIndent(),r.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genMediaQueryCbFnc(e,t,r,o){const n=Array.from(r.entries());o.concat(e,a.TokenClass.TAG_START,"mediaQueryResult",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent(),o.concat(a.TokenClass.SWITCH,a.TokenClass.SPACE,a.TokenClass.TAG_START,"mediaQueryResult.media",a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent();for(let e=0;e{const r=(0,i.getUniqueName)(this.getMediaQueryVariableName(t));o.concat(a.TokenClass.IF,a.TokenClass.SPACE,a.TokenClass.TAG_START,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,r,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent(),e.forEach(((e,t)=>{o.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e,a.TokenClass.NEW_LINE)})),o.decIndent(),o.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)})),o.decIndent(),o.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genAboutToAppear(e,t,r,o){let n=1;o.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,`${t}.bind(this)`,a.TokenClass.NEW_LINE),r.forEach(((t,s)=>{const p=`listener_${(0,i.getUniqueName)(this.getMediaQueryVariableName(s))}`;o.indentOn(),o.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,p,a.TokenClass.PROPERTY_START,`on('change', this.${e})`),n0&&e.mediaParams.forEach(((e,r)=>{t.set(r,e)})),t}getProperties(e){const t=new Map;return e.properties.forEach(((e,r)=>{t.set(r,e)})),e.mediaProperties.forEach(((e,r)=>{t.set(r,e)})),t}collectDefaultValueMap(e,t){void 0!==e.defaultValue&&e.defaultValue.forEach(((e,r)=>{t.set(r,e)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectDefaultValueMap(e,t)}))}collectMediaQueryMap(e,t){void 0!==e.mediaKeyProperty&&e.mediaKeyProperty.forEach(((e,r)=>{var o;const n=null!==(o=t.get(r))&&void 0!==o?o:new Map;e.forEach(((e,t)=>{n.set(t,e)})),t.set(r,n)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectMediaQueryMap(e,t)}))}getMediaQueryVariableName(e){const t="device-type: ",r="orientation: ",o=e.substring(e.indexOf(t),e.length),n=o.substring(t.length,o.indexOf(")")),a=e.substring(e.indexOf(r),e.length),i=a.substring(r.length,a.indexOf(")"));return`${n}${i.slice(0,1).toUpperCase()+i.slice(1).toLowerCase()}`}}t.ASTNodeGenerator=l,l.instance=void 0},8413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ETSBridge=void 0;const o=r(9519),n=r(1912),a=r(3729),i=r(6125),s=r(366),p=r(7893);t.ETSBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map;let r=null;const l=new Map,c=new o.Tag(e.type,t,r,l,null);if((0,n.parseVisualModel)(e,c),(0,a.parseMediaVisualModel)(e,c),(0,i.parseCustomVisualModel)(e,c),(0,s.parseCustomMediaVisualModel)(e,c),(0,p.parseBuildersVisualModel)(e,c,this),e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}return c.content=r,c}}},9459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genBuilderEts=t.genCustomEts=t.genETS=t.EMPTY=void 0;const o=r(5623),n=r(1862);t.EMPTY={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""},t.genETS=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" ",2));return e.accept(t),{build:t.cache.toString(),etsImport:t.etsImport.toString(),etsVariable:t.etsVariable.toString(),etsFunction:t.etsFunction.toString().concat(t.etsBuilder.toString()),aboutToAppear:t.aboutToAppear.toString()}},t.genCustomEts=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" ",1));return e.accept(t),t.cache.toString()},t.genBuilderEts=function(e){const t=new o.ASTNodeGenerator(new n.Cache(" ",1));return e.accept(t),t}},4435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;const o=r(9459);t.StringWriter=class{genETS(e){return(0,o.genETS)(e)}}},5051:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.INDENT=" ",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.SPACE=" ",r.LQUOTE="'",r.RQUOTE="'",r.TAG_START="(",r.TAG_END=")",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDynamicValueByDecorator=t.getMediaVariableDecorator=t.getCustomAttrType=t.getCustomAttributeMap=t.setCustomAttribute=void 0;const o=r(2891),n=new Map;function a(){return n}function i(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.decorator)&&void 0!==r?r:"normal"}t.setCustomAttribute=function(e){var t,r;const a=e.type;(null!==(r=null===(t=(0,o.getInstance)().customData)||void 0===t?void 0:t.property.get(a))&&void 0!==r?r:new Map).forEach(((e,t)=>{const r=`${t}-${a.replace(/\//g,"-")}`;n.set(r,e)}))},t.getCustomAttributeMap=a,t.getCustomAttrType=function(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.type)&&void 0!==r?r:""},t.getMediaVariableDecorator=function(e){const t=i(e);let r="";return"@Link"!==t&&"@Prop"!==t||(r="@State"),r},t.getDynamicValueByDecorator=function(e,t){let r=t;return"@Link"===i(e)&&(r=t.replace("this.","$")),r}},6125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumParserMap=t.genCustomEvent=t.parseCustomVisualModel=void 0;const o=r(2891),n=r(3135),a=r(1195),i=r(8122),s=r(1790);function p(e,t){if(!(t.params instanceof Map))return;const r=function(e){var t,r;const n=e.type;return[...null!==(r=null===(t=(0,o.getInstance)().customData)||void 0===t?void 0:t.event.get(n))&&void 0!==r?r:[]]}(e);for(const o of r){const r=e.property.get(o);void 0!==r&&""!==r&&("this"===r.split(".")[0]?t.params.set(o,r+".bind(this)"):t.params.set(o,r))}}t.parseCustomVisualModel=function(e,r){(0,a.setCustomAttribute)(e),(0,a.getCustomAttributeMap)().forEach(((o,n)=>{if(function(e,t){return e.property.has(t)||e.dynamicProperty.has(t)}(e,n)){const a=c.get(o.type);"function"==typeof a&&a(n,e,r);const s=t.enumParserMap.get(o.type);"function"==typeof s&&function(e,t,r,o){if((0,i.dynamicParamParser)(e,t,r))return;const n=t.property.get(e);!(0,i.isEmptyOrUndefined)(n)&&r.params instanceof Map&&r.params.set((0,i.getEtsPropName)(e),o(n))}(n,e,r,s)}})),p(e,r)},t.genCustomEvent=p;const l=(0,i.curry)(i.getEtsEnumValue),c=new Map([["string",i.stringParamParser],["boolean",i.rawDataParamParser],["number",i.rawDataParamParser],["any[]",i.rawDataParamParser],["object",i.rawDataParamParser],["Date",function(e,t,r){(0,i.dateParamParser)(e,(0,i.getEtsPropName)(e),t,r)}]]);t.enumParserMap=new Map([["Alignment",function(e){const t=(0,i.getBackgroundImagePositionEnumValue)(e);return""!==t?t:(0,i.getEtsEnumValue)("Alignment.",e)}],["Direction",l("Direction.")],["ItemAlign",i.dealWithAlignSelf],["BorderStyle",l("BorderStyle.")],["ImageRepeat",i.dealWithBackgroundRepeat],["ImageSize",l("ImageSize.")],["Visibility",l("Visibility.")],["FontStyle",l("FontStyle.")],["FontWeight",i.dealWithFontWeight],["ButtonType",l("ButtonType.")],["Color",l("Color.")],["LineCapStyle",l("LineCapStyle.")],["ImageFit",l("ImageFit.")],["ImageInterpolation",l("ImageInterpolation.")],["ImageRenderMode",l("ImageRenderMode.")],["ProgressStyle",l("ProgressStyle.")],["SliderStyle",l("SliderStyle.")],["TextAlign",l("TextAlign.")],["TextOverflow",l("TextOverflow.")],["TextDecorationType",l("TextDecorationType.")],["TextCase",l("TextCase.")],["HorizontalAlign",s.dealWithColumnAlignItems],["FlexAlign",n.dealWithJustifyAlignContent],["VerticalAlign",s.dealWithRowAlignItems],["FlexDirection",l("FlexDirection.")],["FlexWrap",i.dealWithWrap],["Axis",l("Axis.")],["EdgeEffect",l("EdgeEffect.")],["Sticky",l("Sticky.")],["EnterKeyType",l("EnterKeyType.")],["ToggleType",l("ToggleType.")],["InputType",l("InputType.")],["ScrollDirection",l("ScrollDirection.")],["EdgeEffect",l("EdgeEffect.")],["GridDirection",l("GridDirection.")],["BarState",l("BarState.")],["NavigationTitleMode",l("NavigationTitleMode.")],["CopyOption",l("CopyOption.")],["BarPosition",l("BarPosition.")],["BarMode",l("BarMode.")]])},9223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonMediaParserArray=t.ifParser=t.forEachParser=void 0;const o=r(6282),n=r(8122),a=r(9248),i=(0,n.curry)(((e,t)=>t.hasMediaProperty(e)));function s(e,t,r){var o,a,i,s;const p=null!==(o=e.property.get("left"))&&void 0!==o?o:e.dynamicProperty.get("left"),l=null!==(a=e.property.get("top"))&&void 0!==a?a:e.dynamicProperty.get("top"),c=t.get("left"),u=t.get("top"),y=r.get("left"),d=r.get("top");let f="undefined",m="undefined";return(0,n.isEmptyOrUndefined)(c)&&(0,n.isEmptyOrUndefined)(u)||(f=(0,n.quoteString)(null!==(i=null!=c?c:p)&&void 0!==i?i:"0"),m=(0,n.quoteString)(null!==(s=null!=u?u:l)&&void 0!==s?s:"0")),(0,n.isEmptyOrUndefined)(y)&&(0,n.isEmptyOrUndefined)(d)||(f=null!=y?y:f,m=null!=d?d:m),{leftValue:f,topValue:m}}function p(e,t){e.forEach(((e,r)=>{"undefined"!==e&&t.set(r,"undefined")}))}function l(e,t){var r,o;const a=new Map,i=t.split("-")[0];return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((r,o)=>{var s,p,l,c;const u=r.get(i),y=null===(p=null===(s=e.dynamicMediaProperty)||void 0===s?void 0:s.get(o))||void 0===p?void 0:p.get(i),d=null!==(c=null!==(l=r.get(t))&&void 0!==l?l:y)&&void 0!==c?c:u;void 0!==d&&a.set(o,(0,n.quoteString)(d))})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{var o;const n=e.get(i),s=null!==(o=e.get(t))&&void 0!==o?o:n;void 0!==s&&a.set(r,s)})),a}const c=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.quoteString);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.quoteString),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),u=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),y=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),d=(0,n.curry)(((e,t,r,a)=>{const i=(0,o.getMediaProperty)(r,e,(0,n.curry)(n.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,n.curry)(n.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);a.setDefaultValue(p,(0,o.getType)(e),s),a.setMediaProperty(p,i),a.mediaProperties.set((0,n.getEtsPropName)(e),p)})),f=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.dealWithColor);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.dealWithColor),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)}));function m(e,t,r,o=!1){(0,n.isEmptyOrUndefined)(t)||r.set(e,o?t:(0,n.quoteString)(t))}t.forEachParser=function(e,t){var r,n,a;const i=null!==(r=e.dynamicProperty.get("for"))&&void 0!==r?r:"[1]",s=null!==(n=e.property.get("item"))&&void 0!==n?n:"item",p=null!==(a=e.property.get("idx"))&&void 0!==a?a:"idx",l=e.dynamicProperty.get("keyGenerator"),c=(0,o.getMediaProperty)(e,"for");if(0===c.size)return;const u=(0,o.getVariableName)(e.id,"for"),y={for:u,key:l,item:s,idx:p};t.setDefaultValue(u,(0,o.getType)("for"),i),t.setMediaProperty(u,c),t.setForEachObj(y)},t.ifParser=function(e,t){const r=(0,o.getMediaProperty)(e,"if");if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"if"),a=(0,o.getVariableName)(e.id,"if");t.setDefaultValue(a,(0,o.getType)("if"),n),t.setMediaProperty(a,r),t.setIfBoolean(a)};const g=(0,n.curry)(((e,t,r)=>{const a=new Map,i=t.property.get(e),s=t.dynamicProperty.get(e),p=null!=s?s:i,c=["top","bottom","left","right"];let u=0;for(const i of c){const s=`${e}-${i}`,c=t.property.get(s),y=t.dynamicProperty.get(s),d=l(t,s);let f=(0,n.isEmptyOrUndefined)(p)?"undefined":(0,n.quoteString)(p);if((0,n.isEmptyOrUndefined)(c)||(f=(0,n.quoteString)(c)),(0,n.isEmptyOrUndefined)(y)||(f=y),d.size>0){const e=(0,o.getVariableName)(t.id,s);r.setDefaultValue(e,(0,o.getType)(s),f),r.setMediaProperty(e,d),m(i,e,a,!0),u++}else m(i,f,a,!0)}u>0&&r.mediaProperties.set(e,a)}));function h(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null===t?"undefined":void 0!==t[5]?`{ width: ${(0,n.quoteString)(t[1])}, height: ${(0,n.quoteString)(t[5])} }`:`{ width: ${(0,n.quoteString)(t[1])} }`}function E(e,t){var r,o;const a=new Map,i=new Map,s=S(t),p=P(t);return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((e,r)=>{const o=e.get(t);if(!(0,n.isEmptyOrUndefined)(o)){let e=s(o);e=""!==e?e:"undefined",a.set(r,e),i.set(r,p(o))}})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{const o=e.get(t);(0,n.isEmptyOrUndefined)(o)||(a.set(r,o),i.set(r,"undefined"))})),{enumValueMap:a,objValueMap:i}}function T(e,t){const r=e.property.get(t),o=e.dynamicProperty.get(t),a=S(t),i=P(t);let s="undefined",p="undefined";if(!(0,n.isEmptyOrUndefined)(r)){const e=a(r);s=""!==e?e:s,p=i(r)}return(0,n.isEmptyOrUndefined)(o)||(s=o,p="undefined"),{enumDefault:s,objDefault:p}}function S(e){return new Map([["background-image-size",n.getBackgroundImageSizeEnumValue],["background-image-position",n.getBackgroundImagePositionEnumValue]]).get(e)}function P(e){return new Map([["background-image-size",h],["background-image-position",v]]).get(e)}function v(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null===t?"undefined":`{ x: ${(0,n.quoteString)(t[1])}, y: ${(0,n.quoteString)(t[4])} }`}const b=(0,n.curry)(((e,t,r,a)=>{const i=(0,n.getBorderDirections)(e),s=new Map;let p=r.property.get(e);(0,n.isEmptyOrUndefined)(p)||(p=t(p));const l=r.dynamicProperty.get(e),c=null!=l?l:p,u=(0,o.getMediaProperty)(r,e,t);let y=0;for(const e of i){const i=(0,n.getEdgeBorderDirection)(e),p=r.property.get(e),l=r.dynamicProperty.get(e),d=(0,o.getMediaProperty)(r,e,t);let f=(0,n.isEmptyOrUndefined)(c)?"undefined":c;if((0,n.isEmptyOrUndefined)(p)||(f=t(p)),(0,n.isEmptyOrUndefined)(l)||(f=l),d.size>0){const t=(0,o.getVariableName)(r.id,e);a.setDefaultValue(t,(0,o.getType)(e),f),a.setMediaProperty(t,d),s.set(i,t),y++}else{const t=(0,o.getVariableName)(r.id,e);a.setDefaultValue(t,(0,o.getType)(e),f),a.setMediaProperty(t,u),s.set(i,t)}}y>0&&a.mediaProperties.set((0,n.getEtsPropName)(e),s)}));t.commonMediaParserArray=[[i("width"),c("width")],[i("height"),c("height")],[function(e){return e.hasMediaProperty("constraint-size-min-width")||e.hasMediaProperty("constraint-size-max-width")||e.hasMediaProperty("constraint-size-min-height")||e.hasMediaProperty("constraint-size-min-height")},function(e,t){const r=new Map,a=["min-width","max-width","min-height","max-height"];for(const i of a){const a=`constraint-size-${i}`,s=(0,o.getMediaProperty)(e,a,n.quoteString),p=(0,o.getMediaDefaultValue)(e,a,n.quoteString);if(s.size>0){const l=(0,o.getVariableName)(e.id,a);t.setDefaultValue(l,(0,o.getType)(a),p),t.setMediaProperty(l,s),m((0,n.getEtsPropName)(i),l,r,!0)}}r.size>0&&t.mediaProperties.set("constraintSize",r)}],[i("align"),d("align","Alignment.")],[i("direction"),d("direction","Direction.")],[function(e){return e.hasMediaProperty("left")||e.hasMediaProperty("top")},function(e,t){var r;const n=null!==(r=e.property.get("position"))&&void 0!==r?r:"relative",{leftValue:a,topValue:i}=s(e,e.property,e.dynamicProperty),{mediaPositionLeft:l,mediaPositionTop:c,mediaOffsetLeft:u,mediaOffsetTop:y}=function(e){var t,r;const o=new Map,n=new Map,a=new Map,i=new Map,p=null!==(t=e.mediaProperty)&&void 0!==t?t:new Map,l=null!==(r=e.dynamicMediaProperty)&&void 0!==r?r:new Map,c=new Set;for(const[e]of p)c.add(e);for(const[e]of l)c.add(e);return c.forEach((t=>{var r,p,l,c;const u=null!==(p=null===(r=e.mediaProperty)||void 0===r?void 0:r.get(t))&&void 0!==p?p:new Map,y=null!==(c=null===(l=e.dynamicMediaProperty)||void 0===l?void 0:l.get(t))&&void 0!==c?c:new Map,d=u.get("position"),{leftValue:f,topValue:m}=s(e,u,y);"absolute"===d?("undefined"!==f&&o.set(t,f),"undefined"!==m&&n.set(t,m)):("undefined"!==f&&a.set(t,f),"undefined"!==m&&i.set(t,m))})),{mediaPositionLeft:o,mediaPositionTop:n,mediaOffsetLeft:a,mediaOffsetTop:i}}(e),d=l.size>0||c.size>0||"absolute"===n,f=u.size>0||y.size>0||"relative"===n,m=(0,o.getVariableName)(e.id,"positionLeft"),g=(0,o.getVariableName)(e.id,"positionTop"),h=(0,o.getVariableName)(e.id,"offsetLeft"),E=(0,o.getVariableName)(e.id,"offsetTop");if(0!==l.size||0!==c.size||0!==y.size||0!==u.size){if(d&&f&&(p(l,u),p(u,l),p(c,y),p(y,c)),d){const e="absolute"===n?a:"undefined",r="absolute"===n?i:"undefined";t.setDefaultValue(m,(0,o.getType)("left"),e),t.setDefaultValue(g,(0,o.getType)("top"),r),t.setMediaProperty(m,l),t.setMediaProperty(g,c),t.mediaProperties.set("position",new Map([["x",m],["y",g]]))}if(f){const e="relative"===n?a:"undefined",r="relative"===n?i:"undefined";t.setDefaultValue(h,(0,o.getType)("left"),e),t.setDefaultValue(E,(0,o.getType)("top"),r),t.setMediaProperty(h,u),t.setMediaProperty(E,y),t.mediaProperties.set("offset",new Map([["x",h],["y",E]]))}}}],[i("aspect-ratio"),u("aspect-ratio")],[i("display-priority"),u("display-priority")],[i("flex-basis"),c("flex-basis")],[i("flex-grow"),u("flex-grow")],[i("flex-shrink"),u("flex-shrink")],[i("align-self"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-self",n.dealWithAlignSelf);if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"align-self",n.dealWithAlignSelf),i=(0,o.getVariableName)(e.id,"align-self");t.setDefaultValue(i,(0,o.getType)("align-self"),a),t.setMediaProperty(i,r),t.mediaProperties.set("alignSelf",i)}],[i("border-style"),d("border-style","BorderStyle.")],[function(e){return e.hasMediaProperty("border-top-style")||e.hasMediaProperty("border-bottom-style")||e.hasMediaProperty("border-left-style")||e.hasMediaProperty("border-right-style")},b("border-style",(0,n.curry)(n.getEtsEnumValue)("BorderStyle."))],[i("border-width"),c("border-width")],[function(e){return e.hasMediaProperty("border-top-width")||e.hasMediaProperty("border-bottom-width")||e.hasMediaProperty("border-left-width")||e.hasMediaProperty("border-right-width")},b("border-width",n.quoteString)],[i("border-color"),f("border-color")],[function(e){return e.hasMediaProperty("border-top-color")||e.hasMediaProperty("border-bottom-color")||e.hasMediaProperty("border-left-color")||e.hasMediaProperty("border-right-color")},b("border-color",n.dealWithColor)],[i("border-radius"),c("border-radius")],[function(e){return e.hasMediaProperty("border-top-left-radius")||e.hasMediaProperty("border-bottom-right-radius")||e.hasMediaProperty("border-bottom-left-radius")||e.hasMediaProperty("border-top-right-radius")},b("border-radius",n.quoteString)],[i("background-color"),f("background-color")],[function(e){return e.hasMediaProperty("background-image-src")||e.hasMediaProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),i=e.property.get("background-image-repeat"),s=e.dynamicProperty.get("background-image-src"),p=e.dynamicProperty.get("background-image-repeat"),l=(0,o.getMediaProperty)(e,"background-image-src",a.dealWithSrc),c=(0,o.getMediaProperty)(e,"background-image-repeat",n.dealWithBackgroundRepeat);if(0===l.size&&0===c.size)return;let u=(0,a.dealWithSrc)(null!=r?r:"");if((0,n.isEmptyOrUndefined)(s)||(u=s),l.size>0){const r=(0,o.getVariableName)(e.id,"background-image-src");t.setDefaultValue(r,(0,o.getType)("background-image-src"),u),t.setMediaProperty(r,l),u=r}let y="undefined";if(!(0,n.isEmptyOrUndefined)(i)){const e=(0,n.dealWithBackgroundRepeat)(i);null!=e&&""!==e&&(y=e)}if((0,n.isEmptyOrUndefined)(p)||(y=p),c.size>0){const r=(0,o.getVariableName)(e.id,"background-image-repeat");t.setDefaultValue(r,(0,o.getType)("background-image-repeat"),y),t.setMediaProperty(r,c),y=r}t.mediaProperties.set("backgroundImage",u+", "+y)}],[i("background-image-size"),function(e,t){const{enumValueMap:r,objValueMap:n}=E(e,"background-image-size");if(0===r.size&&0===n.size)return;const{enumDefault:a,objDefault:i}=T(e,"background-image-size"),s=(0,o.getVariableName)(e.id,"background-image-size-enum"),p=(0,o.getVariableName)(e.id,"background-image-size-obj");t.setDefaultValue(s,"ImageSize",a),t.setDefaultValue(p,"SizeOptions",i),t.setMediaProperty(s,r),t.setMediaProperty(p,n),t.mediaProperties.set("backgroundImageSize",`${s} !== undefined ? ${s} : ${p}`)}],[i("background-image-position"),function(e,t){const{enumValueMap:r,objValueMap:n}=E(e,"background-image-position");if(0===r.size&&0===n.size)return;const{enumDefault:a,objDefault:i}=T(e,"background-image-position"),s=(0,o.getVariableName)(e.id,"background-image-position-enum"),p=(0,o.getVariableName)(e.id,"background-image-position-obj");t.setDefaultValue(s,"Alignment",a),t.setDefaultValue(p,"Position",i),t.setMediaProperty(s,r),t.setMediaProperty(p,n),t.mediaProperties.set("backgroundImagePosition",`${s} !== undefined ? ${s} : ${p}`)}],[i("opacity"),u("opacity")],[i("visibility"),d("visibility","Visibility.")],[i("enabled"),y("enabled")],[i("font-color"),f("font-color")],[function(e){return e.hasMediaProperty("margin")||e.hasMediaProperty("margin-left")||e.hasMediaProperty("margin-top")||e.hasMediaProperty("margin-right")||e.hasMediaProperty("margin-bottom")},g("margin")],[function(e){return e.hasMediaProperty("padding")||e.hasMediaProperty("padding-left")||e.hasMediaProperty("padding-top")||e.hasMediaProperty("padding-right")||e.hasMediaProperty("padding-bottom")},g("padding")]]},3135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.componentsMediaParserArray=t.dateMediaParamParser=t.rawDataMediaParamParser=t.stringMediaParamParser=t.dealWithJustifyAlignContent=void 0;const o=r(6282),n=r(1195),a=r(8122),i=r(9248),s=r(1790),p=r(5264),l=(0,a.curry)(((e,t,r)=>r.type===e&&r.hasMediaProperty(t)));function c(e){return isNaN(Number(e))?(0,a.getEtsEnumValue)("FontWeight.",e):e}function u(e){let t=(0,a.getEtsEnumValue)("FlexAlign.",e);return"flex-start"===e?t="FlexAlign.Start":"flex-end"===e&&(t="FlexAlign.End"),t}function y(e){return"TextOverflow."+(0,a.firstUpperCase)(e)}function d(e,t,r){var o,n;const i=new Map,s=null!==(o=e.mediaProperty)&&void 0!==o?o:new Map,p=null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map;return s.forEach(((e,o)=>{let n=e.get(t);const s=e.get(r);(0,a.isEmptyOrUndefined)(n)&&(0,a.isEmptyOrUndefined)(s)||(n="0"===n||(0,a.isEmptyOrUndefined)(n)?"0":n.substring(0,n.length-2),i.set(o,n))})),p.forEach(((e,r)=>{const o=e.get(t);(0,a.isEmptyOrUndefined)(o)||i.set(r,o)})),i}t.dealWithJustifyAlignContent=u;const f=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e,a.quoteString);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e,a.quoteString),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),m=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),g=(0,a.curry)(((e,t,r)=>{m(e,t,r)})),h=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,(0,a.curry)(a.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,a.curry)(a.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(e),p)}));t.stringMediaParamParser=(0,a.curry)(((e,t,r)=>{const i=(0,o.getMediaProperty)(t,e,a.quoteString);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(t,e,a.quoteString),p=(0,o.getVariableName)(t.id,e),l=(0,n.getMediaVariableDecorator)(e);r.setDefaultValue(p,(0,o.getType)(e),s,l),r.setMediaProperty(p,i),r.mediaParams.set((0,a.getEtsPropName)(e),(0,n.getDynamicValueByDecorator)(e,p))})),t.rawDataMediaParamParser=(0,a.curry)(((e,t,r)=>{const i=(0,o.getMediaProperty)(t,e);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(t,e),p=(0,o.getVariableName)(t.id,e);r.setDefaultValue(p,(0,o.getType)(e),s),r.setMediaProperty(p,i),r.mediaParams.set((0,a.getEtsPropName)(e),(0,n.getDynamicValueByDecorator)(e,p))})),t.dateMediaParamParser=(0,a.curry)(((e,t,r,n,i)=>{const s=e=>void 0===e||""===e?"new Date()":"new Date ("+(0,a.quoteString)(e)+")",p=(0,o.getMediaProperty)(n,e,s);if(!(i.mediaParams instanceof Map)||0===p.size)return;const l=(0,o.getMediaDefaultValue)(n,e,s),c=(0,o.getVariableName)(n.id,e);i.setDefaultValue(c,(0,o.getType)(e),l,r),i.setMediaProperty(c,p),i.mediaParams.set(t,c)}));const E=(0,a.curry)(((e,t,r,n,a)=>{const i=(0,o.getMediaProperty)(n,e);if(!(a.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(n,e),p=(0,o.getVariableName)(n.id,e);a.setDefaultValue(p,(0,o.getType)(e),s,r),a.setMediaProperty(p,i),a.mediaParams.set(t,p)})),T=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,(0,a.curry)(a.getEtsEnumValue)(t));if(!(n.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,a.curry)(a.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaParams.set((0,a.getEtsPropName)(e),p)})),S=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e,a.dealWithColor);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e,a.dealWithColor),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),P=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),v=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,a.quoteString);if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,a.quoteString),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(t),p)})),b=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e);if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(t),p)})),_=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,u);if(!(n.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,u),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaParams.set((0,a.getEtsPropName)(e),p)})),N=(0,a.curry)(((e,t,r,n)=>{const a=(0,o.getMediaProperty)(r,e,u);if(!(n.mediaProperties instanceof Map)||0===a.size)return;const i=(0,o.getMediaDefaultValue)(r,e,u),s=(0,o.getVariableName)(r.id,e);n.setDefaultValue(s,(0,o.getType)(e),i),n.setMediaProperty(s,a),n.mediaProperties.set("justifyContent",s)})),C=(0,a.curry)(((e,t)=>t.type===e));function A(e,t,r){const n=e.property.get(r),i=e.dynamicProperty.get(r),s=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===s.size)return;let p="''";(0,a.isEmptyOrUndefined)(n)||(p=(0,a.quoteString)(n)),(0,a.isEmptyOrUndefined)(i)||(p=(0,a.getContentName)(i));const l=(0,o.getVariableName)(e.id,r);t.setDefaultValue(l,(0,o.getType)(r),p),t.setMediaProperty(l,s),t.setMediaParams(l)}const O=(0,a.curry)(((e,t,r,n)=>{let i=n.mediaProperties.get((0,a.getEtsPropName)(e));void 0===i&&(i=new Map);const s=`${e}-${t}`,p=(0,o.getVariableName)(r.id,s);let l=(0,o.getMediaProperty)(r,s,a.quoteString),u=(0,o.getMediaDefaultValue)(r,s,a.quoteString);if("string"!=typeof i){if((0,a.isEmptyOrUndefined)(u))return;"style"===t&&(l=(0,o.getMediaProperty)(r,s,(0,a.curry)(a.getEtsEnumValue)("FontStyle.")),u=(0,o.getMediaDefaultValue)(r,s,(0,a.curry)(a.getEtsEnumValue)("FontStyle."))),"weight"===t&&(l=(0,o.getMediaProperty)(r,s,c),u=(0,o.getMediaDefaultValue)(r,s,c)),n.setDefaultValue(p,(0,o.getType)(s),u),n.setMediaProperty(p,l),i.set(t,p)}n.mediaProperties.set((0,a.getEtsPropName)(e),i)}));function M(e,t){const r=(0,o.getMediaProperty)(e,"font-weight",a.dealWithFontWeight);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"font-weight",a.dealWithFontWeight),i=(0,o.getVariableName)(e.id,"font-weight");t.setDefaultValue(i,(0,o.getType)("font-weight"),n),t.setMediaProperty(i,r),t.mediaProperties.set("fontWeight",i)}function w(e,t,r,n){const i=new Map([["value","search-value"],["placeholder","search-placeholder"],["icon","icon"],["controller","search-controller"]]).get(e);if(void 0===i)return;const s=r.getProperty(i),p=r.dynamicProperty.get(i),l=(0,o.getMediaProperty)(r,i,a.quoteString),c=(0,o.getVariableName)(r.id,i);let u="''";0!==l.size&&((0,a.isEmptyOrUndefined)(s)||(u=(0,a.quoteString)(s)),(0,a.isEmptyOrUndefined)(p)||(u="controller"===e?p:(0,a.getContentName)(p)),n.setDefaultValue(c,(0,o.getType)(i),u),n.setMediaProperty(c,l),t.push(`${e}: ${(0,a.getContentName)(c)}`))}const R=[[l("button","label"),function(e,t){A(e,t,"label")}],[l("button","type"),h("type","ButtonType.")],[l("button","state-effect"),g("state-effect")],[l("button","font-size"),f("font-size")],[l("button","font-style"),h("font-style","FontStyle.")],[l("button","font-weight"),M],[l("button","font-family"),f("font-family")]],I=[[l("divider","vertical"),g("vertical")],[l("divider","color"),S("color")],[l("divider","stroke-width"),f("stroke-width")],[l("divider","line-cap"),h("line-cap","LineCapStyle.")]],x=[[C("image"),function(e,t){var r;const n=null!==(r=e.property.get("src"))&&void 0!==r?r:"",s=e.dynamicProperty.get("src"),p=(0,o.getMediaProperty)(e,"src",i.dealWithSrc);if(0===p.size)return;let l=(0,i.dealWithSrc)(n);(0,a.isEmptyOrUndefined)(s)||(l=s);const c=(0,o.getVariableName)(e.id,"src");t.setDefaultValue(c,(0,o.getType)("src"),l),t.setMediaProperty(c,p),t.setMediaParams(c)}],[l("image","alt"),f("alt")],[l("image","object-fit"),h("object-fit","ImageFit.")],[l("image","object-repeat"),h("object-repeat","ImageRepeat.")],[l("image","interpolation"),h("interpolation","ImageInterpolation.")],[l("image","render-mode"),h("render-mode","ImageRenderMode.")],[function(e){return e.hasMediaProperty("source-size-width")||e.hasMediaProperty("source-size-height")},function(e,t){let r=e.property.get("source-size-width"),n=e.property.get("source-size-height");const i=e.dynamicProperty.get("source-size-width"),s=e.dynamicProperty.get("source-size-height"),p=d(e,"source-size-width","source-size-height"),l=d(e,"source-size-height","source-size-width");if(0===p.size)return;r="0"===r||(0,a.isEmptyOrUndefined)(r)?"0":r.substring(0,r.length-2),n="0"===n||(0,a.isEmptyOrUndefined)(n)?"0":n.substring(0,n.length-2),(0,a.isEmptyOrUndefined)(i)||(r=i),(0,a.isEmptyOrUndefined)(s)||(n=s);const c=(0,o.getVariableName)(e.id,"source-size-width"),u=(0,o.getVariableName)(e.id,"source-size-height");t.setDefaultValue(c,(0,o.getType)("source-size-width"),r),t.setDefaultValue(u,(0,o.getType)("source-size-height"),n),t.setMediaProperty(c,p),t.setMediaProperty(u,l);const y=new Map([["width",c],["height",u]]);t.mediaProperties.set("sourceSize",y)}]],L=[[function(e){return"progress"===e.type&&(e.hasMediaProperty("value")||e.hasMediaProperty("total")||e.hasMediaProperty("style"))},function(e,t){const r=e.property.get("value"),n=e.dynamicProperty.get("value"),i=(0,o.getMediaProperty)(e,"value");if(!(t.mediaParams instanceof Map)||0===i.size)return;let s=null!=r?r:"0";(0,a.isEmptyOrUndefined)(n)||(s=n);const p=(0,o.getVariableName)(e.id,"value");t.setDefaultValue(p,(0,o.getType)("value"),s),t.setMediaProperty(p,i),t.mediaParams.set("value",p)}],[l("progress","total"),(0,t.rawDataMediaParamParser)("total")],[l("progress","style"),T("style","ProgressStyle.")],[l("progress","color"),S("color")]],F=[[l("slider","value"),(0,t.rawDataMediaParamParser)("value")],[l("slider","min"),(0,t.rawDataMediaParamParser)("min")],[l("slider","max"),(0,t.rawDataMediaParamParser)("max")],[l("slider","step"),(0,t.rawDataMediaParamParser)("step")],[l("slider","style"),T("style","SliderStyle.")],[l("slider","block-color"),S("block-color")],[l("slider","track-color"),S("track-color")],[l("slider","selected-color"),S("selected-color")],[l("slider","show-steps"),g("show-steps")],[l("slider","show-tips"),g("show-tips")]],k=[[l("text","content"),function(e,t){A(e,t,"content")}],[l("text","text-align"),h("text-align","TextAlign.")],[l("text","text-overflow"),function(e,t){const r=(0,o.getMediaProperty)(e,"text-overflow",y);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"text-overflow",y),a=(0,o.getVariableName)(e.id,"text-overflow");t.setDefaultValue(a,(0,o.getType)("text-overflow"),n),t.setMediaProperty(a,r),t.mediaProperties.set("textOverflow",new Map([["overflow",a]]))}],[l("text","max-lines"),m("max-lines")],[l("text","line-height"),f("line-height")],[function(e){return"text"===e.type&&(e.hasMediaProperty("decoration-type")||e.hasMediaProperty("decoration-color"))},function(e,t){const r=(0,o.getMediaProperty)(e,"decoration-type",(0,a.curry)(a.getEtsEnumValue)("TextDecorationType.")),n=(0,o.getMediaProperty)(e,"decoration-color",a.dealWithColor);if(0===r.size&&0===n.size)return;let i=(0,o.getMediaDefaultValue)(e,"decoration-type",(0,a.curry)(a.getEtsEnumValue)("TextDecorationType.")),s=(0,o.getMediaDefaultValue)(e,"decoration-color",a.dealWithColor);if(r.size>0){const n=(0,o.getVariableName)(e.id,"decoration-type");t.setDefaultValue(n,(0,o.getType)("decoration-type"),i),t.setMediaProperty(n,r),i=n}if(n.size>0){const r=(0,o.getVariableName)(e.id,"decoration-color");t.setDefaultValue(r,(0,o.getType)("decoration-color"),s),t.setMediaProperty(r,n),s=r}const p=new Map([["type",i]]);t.mediaProperties.set("decoration",p),"undefined"!==s&&p.set("color",s)}],[l("text","baseline-offset"),f("baseline-offset")],[l("text","text-case"),h("text-case","TextCase.")],[l("text","font-size"),f("font-size")],[l("text","font-style"),h("font-style","FontStyle.")],[l("text","font-weight"),M],[l("text","font-family"),f("font-family")]],B=[[l("column","space"),(0,t.stringMediaParamParser)("space")],[l("column","align-items-column"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-column",s.dealWithColumnAlignItems);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-column",s.dealWithColumnAlignItems),a=(0,o.getVariableName)(e.id,"align-items-column");t.setDefaultValue(a,(0,o.getType)("align-items-column"),n),t.setMediaProperty(a,r),t.mediaProperties.set("alignItems",a)}],[l("column","justify-content-rc"),N("justify-content-rc","FlexAlign.")]],D=[[l("row","space"),(0,t.stringMediaParamParser)("space")],[l("row","align-items-row"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-row",s.dealWithRowAlignItems);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-row",s.dealWithRowAlignItems),a=(0,o.getVariableName)(e.id,"align-items-row");t.setDefaultValue(a,(0,o.getType)("align-items-row"),n),t.setMediaProperty(a,r),t.mediaProperties.set("alignItems",a)}],[l("row","justify-content-rc"),N("justify-content-rc","FlexAlign.")]],U=[[l("flex","flex-direction"),function(e,t){const r=(0,o.getMediaProperty)(e,"flex-direction",(0,a.curry)(a.getEtsEnumValue)("FlexDirection."));if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"flex-direction",(0,a.curry)(a.getEtsEnumValue)("FlexDirection.")),i=(0,o.getVariableName)(e.id,"flex-direction");t.setDefaultValue(i,(0,o.getType)("flex-direction"),n),t.setMediaProperty(i,r),t.mediaParams.set("direction",i)}],[l("flex","wrap"),function(e,t){const r=(0,o.getMediaProperty)(e,"wrap",a.dealWithWrap);if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"wrap",a.dealWithWrap),i=(0,o.getVariableName)(e.id,"wrap");t.setDefaultValue(i,(0,o.getType)("wrap"),n),t.setMediaProperty(i,r),t.mediaParams.set("wrap",i)}],[l("flex","justify-content"),_("justify-content","FlexAlign.")],[l("flex","align-items-flex"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-flex",p.dealWithFlexAlignItems);if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-flex",p.dealWithFlexAlignItems),a=(0,o.getVariableName)(e.id,"align-items-flex");t.setDefaultValue(a,(0,o.getType)("align-items-flex"),n),t.setMediaProperty(a,r),t.mediaParams.set("alignItems",a)}],[l("flex","align-content"),_("align-content","FlexAlign.")]],V=[[l("list","space"),(0,t.stringMediaParamParser)("space")],[l("list","initial-index"),(0,t.rawDataMediaParamParser)("initial-index")],[l("list","list-direction"),h("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasMediaProperty("divider-stroke-width")||e.hasMediaProperty("divider-color")||e.hasMediaProperty("divider-start-margin")||e.hasMediaProperty("divider-end-margin"))},function(e,t){const r=[["divider-stroke-width",a.quoteString],["divider-color",a.dealWithColor],["divider-start-margin",a.quoteString],["divider-end-margin",a.quoteString]];let n=0;const i=new Map;for(const[s,p]of r){const r=(0,o.getMediaProperty)(e,s,p),l=(0,a.getEtsPropName)(s.replace("divider-",""));let c=(0,o.getMediaDefaultValue)(e,s,p);if("undefined"===c&&"divider-stroke-width"===s&&(c="0"),r.size>0){const a=(0,o.getVariableName)(e.id,s);t.setDefaultValue(a,(0,o.getType)(s),c),t.setMediaProperty(a,r),c=a,n++}i.set(l,c)}n>0&&t.mediaProperties.set("divider",i)}],[l("list","edit-mode"),g("edit-mode")],[l("list","edge-effect"),h("edge-effect","EdgeEffect.")],[l("list","chain-animation"),g("chain-animation")]],G=[[l("list-item","sticky"),h("sticky","Sticky.")],[l("list-item","editable"),g("editable")]],z=[[l("swiper","index"),m("index")],[l("swiper","auto-play"),g("auto-play")],[l("swiper","interval"),m("interval")],[l("swiper","indicator"),g("indicator")],[l("swiper","loop"),g("loop")],[l("swiper","duration"),m("duration")],[l("swiper","vertical"),g("vertical")],[l("swiper","item-space"),f("item-space")],[l("swiper","cached-count"),m("cached-count")],[l("swiper","disable-swipe"),g("disable-swipe")]],j=[[l("text-input","placeholder"),(0,t.stringMediaParamParser)("placeholder")],[l("text-input","textInput-type"),function(e,t){const r=(0,o.getMediaProperty)(e,"textInput-type",(0,a.curry)(a.getEtsEnumValue)("InputType."));if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"textInput-type",(0,a.curry)(a.getEtsEnumValue)("InputType.")),i=(0,o.getVariableName)(e.id,"textInput-type");t.setDefaultValue(i,(0,o.getType)("textInput-type"),n),t.setMediaProperty(i,r),t.mediaProperties.set("type",i)}],[l("text-input","placeholderColor"),S("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasMediaProperty("placeholderFont-size")||e.hasMediaProperty("placeholderFont-weight")||e.hasMediaProperty("placeholderFont-family")||e.hasMediaProperty("placeholderFont-style"))},function(e,t){const r=[["size",a.quoteString],["weight",c],["family",a.quoteString],["style",(0,a.curry)(a.getEtsEnumValue)("FontStyle.")]];let n=0;const i=new Map;for(const[a,s]of r){const r=`placeholderFont-${a}`,p=(0,o.getMediaProperty)(e,r,s);let l=(0,o.getMediaDefaultValue)(e,r,s);if(p.size>0){const a=(0,o.getVariableName)(e.id,r);t.setDefaultValue(a,(0,o.getType)(r),l),t.setMediaProperty(a,p),l=a,n++}i.set(a,l)}n>0&&t.mediaProperties.set("placeholderFont",i)}],[l("text-input","enterKeyType"),h("enterKeyType","EnterKeyType.")],[l("text-input","caretColor"),S("caretColor")],[l("text-input","maxLength"),m("maxLength")]],W=[[l("refresh","friction"),(0,t.rawDataMediaParamParser)("friction")],[l("refresh","offset"),(0,t.stringMediaParamParser)("offset")],[l("refresh","refreshing"),(0,t.rawDataMediaParamParser)("refreshing")]],$=[[l("timePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[l("timePicker","useMilitaryTime"),g("useMilitaryTime")]],q=[[l("datePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[l("datePicker","start"),(0,t.dateMediaParamParser)("start","start","private")],[l("datePicker","end"),(0,t.dateMediaParamParser)("end","end","private")],[l("datePicker","lunar"),g("lunar")]],H=[[l("textPicker","range"),(0,t.rawDataMediaParamParser)("range")],[l("textPicker","textPicker-selected"),E("textPicker-selected","selected","@State")],[l("textPicker","defaultPickerItemHeight"),f("defaultPickerItemHeight")]],Y=[[l("select","select-option"),function(e,t){!function(e,t,r){const n=e.dynamicProperty.get(r),i=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===i.size)return;const s=null!=n?n:'[{value: ""}]',p=(0,o.getVariableName)(e.id,r);t.setDefaultValue(p,(0,o.getType)(r),s),t.setMediaProperty(p,i),t.setMediaParams(p)}(e,t,"select-option")}],[l("select","select-value"),function(e,t){const r="select-value",n=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,a.quoteString),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaProperties.set("value",s)}],[l("select","selected"),m("selected")],[l("select","font-size"),O("font","size")],[l("select","font-style"),O("font","style")],[l("select","font-family"),O("font","family")],[l("select","font-weight"),O("font","weight")],[l("select","selected-option-font-size"),O("selected-option-font","size")],[l("select","selected-option-font-style"),O("selected-option-font","style")],[l("select","selected-option-font-family"),O("selected-option-font","family")],[l("select","selected-option-font-weight"),O("selected-option-font","weight")],[l("select","selected-option-font-color"),S("selected-option-font-color")],[l("select","selected-option-bg-color"),S("selected-option-bg-color")],[l("select","option-font-size"),O("option-font","size")],[l("select","option-font-style"),O("option-font","style")],[l("select","option-font-family"),O("option-font","family")],[l("select","option-font-weight"),O("option-font","weight")],[l("select","option-font-color"),S("option-font-color")],[l("select","option-bg-color"),S("option-bg-color")]],X=[[l("toggle","toggle-type"),function(e,t){const r="ToggleType.",n="toggle-type",i=(0,o.getMediaProperty)(e,n,(0,a.curry)(a.getEtsEnumValue)(r));if(!(t.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(e,n,(0,a.curry)(a.getEtsEnumValue)(r)),p=(0,o.getVariableName)(e.id,n);t.setDefaultValue(p,(0,o.getType)(n),s),t.setMediaProperty(p,i),t.mediaParams.set("type",p)}],[l("toggle","isOn"),(0,t.rawDataMediaParamParser)("isOn")],[l("toggle","selectedColor"),S("selectedColor")],[l("toggle","switchPointColor"),S("switchPointColor")]],J=[[l("checkbox","select"),g("select")],[l("checkbox","selectedColor"),S("selectedColor")],[l("checkbox","name"),(0,t.stringMediaParamParser)("name")],[l("checkbox","group"),(0,t.stringMediaParamParser)("group")]],Q=[[l("checkboxGroup","selectAll"),g("selectAll")],[l("checkboxGroup","selectedColor"),S("selectedColor")],[l("checkboxGroup","group"),(0,t.stringMediaParamParser)("group")]],K=[[l("scroll","scrollable"),h("scrollable","ScrollDirection.")],[l("scroll","scroll-bar"),h("scroll-bar","BarState.")],[l("scroll","scroll-bar-color"),S("scroll-bar-color")],[l("scroll","scroll-bar-width"),f("scroll-bar-width")],[l("scroll","edge-effect-scroll"),function(e,t){const r="edge-effect-scroll",n=(0,o.getMediaProperty)(e,r,a.dealWithScrollEdgeEffect);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,a.dealWithScrollEdgeEffect),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaProperties.set("edgeEffect",s)}]],Z=[[l("grid","columns-template"),f("columns-template")],[l("grid","rows-template"),f("rows-template")],[l("grid","columns-gap"),f("columns-gap")],[l("grid","rows-gap"),f("rows-gap")],[l("grid","scroll-bar"),h("scroll-bar","BarState.")],[l("grid","scroll-bar-color"),S("scroll-bar-color")],[l("grid","scroll-bar-width"),f("scroll-bar-width")],[l("grid","cached-count"),m("cached-count")],[l("grid","edit-mode"),g("edit-mode")],[l("grid","layout-direction"),h("layout-direction","GridDirection.")],[l("grid","max-count"),m("max-count")],[l("grid","min-count"),m("min-count")],[l("grid","cell-length"),m("cell-length")],[l("grid","multi-selectable"),g("multi-selectable")],[l("grid","support-animation"),g("support-animation")]],ee=[[l("grid-item","row-start"),m("row-start")],[l("grid-item","row-end"),m("row-end")],[l("grid-item","column-start"),m("column-start")],[l("grid-item","column-end"),m("column-end")],[l("grid-item","force-rebuild"),g("force-rebuild")],[l("grid-item","selectable"),g("selectable")]],te=[[l("stack","align-content-stack"),function(e,t){const r="align-content-stack",n=(0,o.getMediaProperty)(e,r,(0,a.curry)(a.getEtsEnumValue)("Alignment."));if(!(t.mediaParams instanceof Map)||0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,(0,a.curry)(a.getEtsEnumValue)("Alignment.")),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaParams.set("alignContent",s)}]],re=[[l("navigation","navigation-title"),v("navigation-title","title")],[l("navigation","subTitle"),f("subTitle")],[l("navigation","menus"),P("menus")],[l("navigation","titleMode"),h("titleMode","NavigationTitleMode.")],[l("navigation","toolBar"),P("toolBar")],[l("navigation","hideToolBar"),g("hideToolBar")],[l("navigation","hideTitleBar"),g("hideTitleBar")],[l("navigation","hideBackButton"),g("hideBackButton")]],oe=[[function(e){return"search"===e.type},function(e,t){const r=[];w("value",r,e,t),w("placeholder",r,e,t),w("icon",r,e,t),w("controller",r,e,t),0!==r.length&&t.setParams(`{${r.join(", ")}}`)}],[l("search","text-font-size"),O("text-font","size")],[l("search","text-font-style"),O("text-font","style")],[l("search","text-font-weight"),O("text-font","weight")],[l("search","text-font-family"),O("text-font","family")],[l("search","placeholder-font-size"),O("placeholder-font","size")],[l("search","placeholder-font-style"),O("placeholder-font","style")],[l("search","placeholder-font-weight"),O("placeholder-font","weight")],[l("search","placeholder-font-family"),O("placeholder-font","family")],[l("search","placeholderColor"),S("placeholderColor")],[l("search","search-text-align"),function(e,t){const r=(0,o.getMediaProperty)(e,"search-text-align",(0,a.curry)(a.getEtsEnumValue)("TextAlign."));if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"search-text-align",(0,a.curry)(a.getEtsEnumValue)("TextAlign.")),i=(0,o.getVariableName)(e.id,"search-text-align");t.setDefaultValue(i,(0,o.getType)("search-text-align"),n),t.setMediaProperty(i,r),t.mediaProperties.set("textAlign",i)}],[l("search","search-button"),f("search-button")],[l("search","copy-option"),h("copy-option","CopyOptions.")]],ne=[[l("tabs","bar-position"),T("bar-position","BarPosition.")],[l("tabs","index"),(0,t.rawDataMediaParamParser)("index")],[l("tabs","controller"),(0,t.rawDataMediaParamParser)("controller")],[l("tabs","vertical"),g("vertical")],[l("tabs","tabs-scrollable"),b("tabs-scrollable","scrollable")],[l("tabs","bar-mode"),h("bar-mode","BarMode.")],[l("tabs","bar-width"),f("bar-width")],[l("tabs","bar-height"),f("bar-height")],[l("tabs","animation-duration"),m("animation-duration")]],ae=[[function(e){return"tab-content"===e.type&&(e.hasMediaProperty("tabBar-icon")||e.hasMediaProperty("tabBar-text"))},function(e,t){const r=(0,o.getMediaProperty)(e,"tabBar-text",a.quoteString),n=(0,o.getMediaProperty)(e,"tabBar-icon",i.dealWithSrc),s=(0,o.getMediaDefaultValue)(e,"tabBar-text",a.quoteString),p=(0,o.getMediaDefaultValue)(e,"tabBar-icon",i.dealWithSrc),l=(0,o.getVariableName)(e.id,"tabBar-text"),c=(0,o.getVariableName)(e.id,"tabBar-icon"),u=new Map([["text",s],["icon",p]]);r.size>0&&(t.setDefaultValue(l,(0,o.getType)("tabBar-text"),s),t.setMediaProperty(l,r),u.set("text",l)),n.size>0&&(t.setDefaultValue(c,(0,o.getType)("tabBar-icon"),p),t.setMediaProperty(c,n),u.set("icon",c)),t.mediaProperties.set("tabBar",u)}]];t.componentsMediaParserArray=[...R,...I,...x,...L,...F,...k,...B,...D,...U,...V,...G,...z,...j,...X,...W,...$,...H,...Y,...q,...te,...K,...Z,...ee,...re,...oe,...ne,...ae,...J,...Q]},366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCustomMediaVisualModel=void 0;const o=r(6125),n=r(3135),a=r(6282),i=r(1195),s=r(8122);t.parseCustomMediaVisualModel=function(e,t){(0,i.getCustomAttributeMap)().forEach(((r,n)=>{if(function(e,t){return e.hasMediaProperty(t)}(e,n)){const l=p.get(r.type);"function"==typeof l&&l(n,e,t);const c=o.enumParserMap.get(r.type);"function"==typeof c&&function(e,t,r,o){const n=(0,a.getMediaProperty)(t,e,o);if(!(r.mediaParams instanceof Map)||0===n.size)return;const p=(0,a.getMediaDefaultValue)(t,e,o),l=(0,a.getVariableName)(t.id,e);r.setDefaultValue(l,(0,a.getType)(e),p),r.setMediaProperty(l,n),r.mediaParams.set((0,s.getEtsPropName)(e),(0,i.getDynamicValueByDecorator)(e,l))}(n,e,t,c)}}))};const p=new Map([["string",n.stringMediaParamParser],["boolean",n.rawDataMediaParamParser],["number",n.rawDataMediaParamParser],["any[]",n.rawDataMediaParamParser],["object",n.rawDataMediaParamParser],["Date",function(e,t,r){(0,n.dateMediaParamParser)(e,(0,s.getEtsPropName)(e),"private",t,r)}]])},3729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMediaProperty=t.parseMediaVisualModel=void 0;const o=r(1912),n=r(9223),a=r(3135);function i(e,t,r){const o=t.get(r);return void 0!==o&&o.has(e)}t.parseMediaVisualModel=function(e,t){(0,n.forEachParser)(e,t),(0,n.ifParser)(e,t);for(const r of p)("boolean"==typeof r[0]||r[0](e))&&r[1](e,t)},t.isMediaProperty=function(e,t){return!i(e,s,"common")&&!i(e,s,t)&&!i(e,s,"events")};const s=new Map([["common",new Set(["keyGenerator","item","idx"])],["events",new Set([...o.events])]]),p=[...n.commonMediaParserArray,...a.componentsMediaParserArray]},6282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMediaDefaultValue=t.getVariableName=t.getMediaProperty=t.getType=void 0;const o=r(4294),n=r(1290),a=r(1195),i=r(8122);function s(e,t){for(const r of t)if(r.property===e)return r.etsType;return""}t.getType=function(e){const t=e+"-visual",r=n.etsPropertyList;let o="";for(const e of r)if(void 0!==e.propertySet.properties&&(o=s(t,e.propertySet.properties)),e.propertySet.property===t&&(o=e.propertySet.etsType),""!==o)break;return""!==o?function(e=""){const t=new Map([["Rfloat","Resource"],["Rstring","Resource"],["Rcolor","Resource"],["Rmedia","Resource"],["Rrawfile","Resource"],["Rplural","Resource"],["ETSArray","any[]"]]),r=new Array;return e.split("|").forEach((e=>{const o=t.get(e),n=null!=o?o:e;r.includes(n)||r.push(null!=o?o:e)})),r.join(" | ")}(o):(0,a.getCustomAttrType)(e)},t.getMediaProperty=function(e,t,r){var o,n;const a=new Map;return(null!==(o=e.mediaProperty)&&void 0!==o?o:new Map).forEach(((e,o)=>{let n=e.get(t);(0,i.isEmptyOrUndefined)(n)||("function"==typeof r&&(n=r(n)),(0,i.isEmptyOrUndefined)(n)||a.set(o,n))})),(null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map).forEach(((e,r)=>{let o=e.get(t);void 0===o||"content"!==t&&"label"!==t||(o=(0,i.getContentName)(o)),(0,i.isEmptyOrUndefined)(o)||a.set(r,o)})),a},t.getVariableName=function(e,t){const r=(0,o.getTagName)(e),n=`this.${(0,i.getEtsPropName)(r)}${(0,i.firstUpperCase)((0,i.getEtsPropName)(t))}`;return`${n}_${(0,o.getUniqueId)(n)}`},t.getMediaDefaultValue=function(e,t,r){var o;const n=e.property.get(t),a=e.dynamicProperty.get(t);let s=null!==(o=new Map([["if","true"],["auto-play","false"],["interval","3000"],["select-value","''"],["columns-template","''"],["rows-template","''"],["tabBar-icon","''"],["tabBar-text","'TabBar'"]]).get(t))&&void 0!==o?o:"undefined";return(0,i.isEmptyOrUndefined)(n)||(s="function"==typeof r?r(n):n,s=(0,i.isEmptyOrUndefined)(s)?"undefined":s),(0,i.isEmptyOrUndefined)(a)||(s=a),s}},7893:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseBuildersVisualModel=void 0;const o=r(8122);t.parseBuildersVisualModel=function(e,t,r){const n=e.slots;void 0!==n&&0!==n.size&&n.forEach(((n,a)=>{const i=(0,o.getBuilderUniqueName)(e.id,a);t.properties.set(a,`this.${i}`),t.builders.set(i,r.visit(n))}))}},8916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buttonParserArray=void 0;const o=r(8122);t.buttonParserArray=[[(0,o.hasFeatureProperty)("button","label"),o.labelParamParser],[(0,o.hasFeatureProperty)("button","type"),(0,o.enumPropertyParser)("type","ButtonType.")],[(0,o.hasFeatureProperty)("button","state-effect"),(0,o.booleanPropertyParser)("state-effect")],[(0,o.hasFeatureProperty)("button","font-size"),(0,o.stringPropertyParser)("font-size")],[(0,o.hasFeatureProperty)("button","font-style"),(0,o.enumPropertyParser)("font-style","FontStyle.")],[(0,o.hasFeatureProperty)("button","font-weight"),o.fontWeightPropertyParser],[(0,o.hasFeatureProperty)("button","font-family"),(0,o.stringPropertyParser)("font-family")]]},1147:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxGroupParseArray=void 0;const o=r(8122);t.checkboxGroupParseArray=[[(0,o.hasFeatureProperty)("checkboxGroup","selectAll"),(0,o.booleanPropertyParser)("selectAll")],[(0,o.hasFeatureProperty)("checkboxGroup","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("checkboxGroup","group"),(0,o.stringParamParser)("group")]]},2218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxParseArray=void 0;const o=r(8122);t.checkboxParseArray=[[(0,o.hasFeatureProperty)("checkbox","select"),(0,o.booleanPropertyParser)("select")],[(0,o.hasFeatureProperty)("checkbox","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("checkbox","name"),(0,o.stringParamParser)("name")],[(0,o.hasFeatureProperty)("checkbox","group"),(0,o.stringParamParser)("group")]]},7150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonParserArray=void 0;const o=r(8122),n=r(9248);function a(e,t,r,n=!1){(0,o.isEmptyOrUndefined)(t)||r.set(e,n?t:(0,o.quoteString)(t))}function i(e,t,r,n,a){const i=e.getProperty(t),s=e.getProperty(r),p=e.dynamicProperty.has(t),l=e.dynamicProperty.has(r),c=(0,o.getEdgeBorderDirection)(r);(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||n.set(c,p?i:a(i)):n.set(c,l?s:a(s))}t.commonParserArray=[[(0,o.hasCommonProperty)("width"),(0,o.stringPropertyParser)("width")],[(0,o.hasCommonProperty)("height"),(0,o.stringPropertyParser)("height")],[function(e){return e.hasProperty("constraint-size-min-width")||e.hasProperty("constraint-size-max-width")||e.hasProperty("constraint-size-min-height")||e.hasProperty("constraint-size-max-height")},function(e,t){const r=new Map,o=e.getProperty("constraint-size-min-width"),n=e.getProperty("constraint-size-max-width"),i=e.getProperty("constraint-size-min-height"),s=e.getProperty("constraint-size-max-height");a("minWidth",o,r,e.dynamicProperty.has("constraint-size-min-width")),a("maxWidth",n,r,e.dynamicProperty.has("constraint-size-max-width")),a("minHeight",i,r,e.dynamicProperty.has("constraint-size-min-height")),a("maxHeight",s,r,e.dynamicProperty.has("constraint-size-max-height")),r.size>0&&t.properties.set("constraintSize",r)}],[(0,o.hasCommonProperty)("align"),(0,o.enumPropertyParser)("align","Alignment.")],[(0,o.hasCommonProperty)("direction"),(0,o.enumPropertyParser)("direction","Direction.")],[function(e){return e.hasProperty("left")||e.hasProperty("top")},function(e,t){const r="absolute"===e.property.get("position")?"position":"offset",n=e.property.get("left"),a=e.property.get("top"),i=e.dynamicProperty.get("left"),s=e.dynamicProperty.get("top");if((0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(n)&&(0,o.isEmptyOrUndefined)(a))return;const p=new Map([["x",`${(0,o.quoteString)(null!=n?n:"0")}`],["y",`${(0,o.quoteString)(null!=a?a:"0")}`]]);(0,o.isEmptyOrUndefined)(i)||p.set("x",i),(0,o.isEmptyOrUndefined)(s)||p.set("y",s),t.properties.set(r,p)}],[(0,o.hasCommonProperty)("aspect-ratio"),(0,o.numberPropertyParser)("aspect-ratio")],[(0,o.hasCommonProperty)("display-priority"),(0,o.numberPropertyParser)("display-priority")],[(0,o.hasCommonProperty)("flex-basis"),(0,o.stringPropertyParser)("flex-basis")],[(0,o.hasCommonProperty)("flex-grow"),(0,o.numberPropertyParser)("flex-grow")],[(0,o.hasCommonProperty)("flex-shrink"),(0,o.numberPropertyParser)("flex-shrink")],[(0,o.hasCommonProperty)("align-self"),function(e,t){const r=e.dynamicProperty.get("align-self");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignSelf",r);const n=e.property.get("align-self");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.dealWithAlignSelf)(n);t.properties.set("alignSelf",a)}],[function(e){return e.hasProperty("border-style")||e.hasProperty("border-top-style")||e.hasProperty("border-right-style")||e.hasProperty("border-bottom-style")||e.hasProperty("border-left-style")},function(e,t){const r=new Map,n=e.getProperty("border-style"),a=e.getProperty("border-top-style"),s=e.getProperty("border-bottom-style"),p=e.getProperty("border-left-style"),l=e.getProperty("border-right-style"),c=e.dynamicProperty.has("border-style"),u=(0,o.getBorderDirections)("border-style");for(const t of u)i(e,"border-style",t,r,(0,o.curry)(o.getEtsEnumValue)("BorderStyle."));(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-style"),c?n:(0,o.getEtsEnumValue)("BorderStyle.",n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-style"),r)}],[function(e){return e.hasProperty("border-width")||e.hasProperty("border-top-width")||e.hasProperty("border-right-width")||e.hasProperty("border-bottom-width")||e.hasProperty("border-left-width")},function(e,t){const r=new Map,n=e.getProperty("border-width"),i=e.getProperty("border-top-width"),s=e.getProperty("border-bottom-width"),p=e.getProperty("border-left-width"),l=e.getProperty("border-right-width"),c=e.property.has("border-top-width"),u=e.property.has("border-bottom-width"),y=e.property.has("border-left-width"),d=e.property.has("border-right-width"),f=e.dynamicProperty.has("border-width"),m=e.dynamicProperty.has("border-top-width"),g=e.dynamicProperty.has("border-bottom-width"),h=e.dynamicProperty.has("border-left-width"),E=e.dynamicProperty.has("border-right-width");(0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-width"),f?n:(0,o.quoteString)(n)):(a("top",null!=i?i:n,r,m||!c&&f),a("bottom",null!=s?s:n,r,g||!u&&f),a("left",null!=p?p:n,r,h||!y&&f),a("right",null!=l?l:n,r,E||!d&&f),r.size>0&&t.properties.set((0,o.getEtsPropName)("border-width"),r))}],[function(e){return e.hasProperty("border-color")||e.hasProperty("border-top-color")||e.hasProperty("border-right-color")||e.hasProperty("border-bottom-color")||e.hasProperty("border-left-color")},function(e,t){const r=new Map,n=e.getProperty("border-color"),a=e.getProperty("border-top-color"),s=e.getProperty("border-bottom-color"),p=e.getProperty("border-left-color"),l=e.getProperty("border-right-color"),c=e.dynamicProperty.has("border-color"),u=(0,o.getBorderDirections)("border-color");for(const t of u)i(e,"border-color",t,r,o.dealWithColor);(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-color"),c?n:(0,o.dealWithColor)(n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-color"),r)}],[function(e){return e.hasProperty("border-radius")||e.hasProperty("border-top-left-radius")||e.hasProperty("border-top-right-radius")||e.hasProperty("border-bottom-right-radius")||e.hasProperty("border-bottom-left-radius")},function(e,t){const r=new Map,n=e.getProperty("border-radius"),a=e.getProperty("border-top-left-radius"),s=e.getProperty("border-top-right-radius"),p=e.getProperty("border-bottom-left-radius"),l=e.getProperty("border-bottom-right-radius"),c=e.dynamicProperty.has("border-radius"),u=(0,o.getBorderDirections)("border-radius");for(const t of u)i(e,"border-radius",t,r,o.quoteString);(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-radius"),c?n:(0,o.quoteString)(n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-radius"),r)}],[(0,o.hasCommonProperty)("background-color"),(0,o.colorPropertyParser)("background-color")],[function(e){return e.hasProperty("background-image-src")||e.hasProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),a=e.property.get("background-image-repeat"),i=e.dynamicProperty.get("background-image-src"),s=e.dynamicProperty.get("background-image-repeat");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s))return;let p=(0,n.dealWithSrc)(null!=r?r:"");if((0,o.isEmptyOrUndefined)(i)||(p=i),(0,o.isEmptyOrUndefined)(s)){if(!(0,o.isEmptyOrUndefined)(a)){const e=(0,o.dealWithBackgroundRepeat)(a);null!=e&&""!==e&&(p=p+", "+e)}}else p=p+", "+s;t.properties.set("backgroundImage",p)}],[(0,o.hasCommonProperty)("background-image-size"),function(e,t){const r=e.dynamicProperty.get("background-image-size");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("backgroundImageSize",r);const n=e.property.get("background-image-size");if((0,o.isEmptyOrUndefined)(n))return;if(""!==(0,o.getBackgroundImageSizeEnumValue)(n))return void t.properties.set("backgroundImageSize",(0,o.getEtsEnumValue)("ImageSize.",n));const a=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);null!==a&&(void 0!==a[5]?t.properties.set("backgroundImageSize",new Map([["width",`${(0,o.quoteString)(a[1])}`],["height",`${(0,o.quoteString)(a[5])}`]])):t.properties.set("backgroundImageSize",new Map([["width",`${(0,o.quoteString)(a[1])}`]])))}],[(0,o.hasCommonProperty)("background-image-position"),function(e,t){const r=e.dynamicProperty.get("background-image-position");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("backgroundImagePosition",r);const n=e.property.get("background-image-position");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.getBackgroundImagePositionEnumValue)(n);if(""!==a)return void t.properties.set("backgroundImagePosition",a);const i=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);null!==i&&t.properties.set("backgroundImagePosition",new Map([["x",`${(0,o.quoteString)(i[1])}`],["y",`${(0,o.quoteString)(i[4])}`]]))}],[(0,o.hasCommonProperty)("opacity"),(0,o.numberPropertyParser)("opacity")],[(0,o.hasCommonProperty)("visibility"),(0,o.enumPropertyParser)("visibility","Visibility.")],[(0,o.hasCommonProperty)("enabled"),(0,o.booleanPropertyParser)("enabled")],[(0,o.hasCommonProperty)("font-color"),(0,o.colorPropertyParser)("font-color")],[function(e){return e.hasProperty("margin")||e.hasProperty("margin-left")||e.hasProperty("margin-top")||e.hasProperty("margin-right")||e.hasProperty("margin-bottom")},function(e,t){var r,o,n,i;const s=new Map,p=e.getProperty("margin"),l=null!==(r=e.getProperty("margin-top"))&&void 0!==r?r:p,c=null!==(o=e.getProperty("margin-bottom"))&&void 0!==o?o:p,u=null!==(n=e.getProperty("margin-left"))&&void 0!==n?n:p,y=null!==(i=e.getProperty("margin-right"))&&void 0!==i?i:p,d=e.property.has("margin-top"),f=e.property.has("margin-bottom"),m=e.property.has("margin-left"),g=e.property.has("margin-right"),h=e.dynamicProperty.has("margin"),E=e.dynamicProperty.has("margin-top"),T=e.dynamicProperty.has("margin-bottom"),S=e.dynamicProperty.has("margin-left"),P=e.dynamicProperty.has("margin-right");a("top",l,s,E||!d&&h),a("bottom",c,s,T||!f&&h),a("left",u,s,S||!m&&h),a("right",y,s,P||!g&&h),s.size>0&&t.properties.set("margin",s)}],[function(e){return e.hasProperty("padding")||e.hasProperty("padding-left")||e.hasProperty("padding-top")||e.hasProperty("padding-right")||e.hasProperty("padding-bottom")},function(e,t){var r,o,n,i;const s=new Map,p=e.getProperty("padding"),l=null!==(r=e.getProperty("padding-top"))&&void 0!==r?r:p,c=null!==(o=e.getProperty("padding-bottom"))&&void 0!==o?o:p,u=null!==(n=e.getProperty("padding-left"))&&void 0!==n?n:p,y=null!==(i=e.getProperty("padding-right"))&&void 0!==i?i:p,d=e.property.has("padding-top"),f=e.property.has("padding-bottom"),m=e.property.has("padding-left"),g=e.property.has("padding-right"),h=e.dynamicProperty.has("padding"),E=e.dynamicProperty.has("padding-top"),T=e.dynamicProperty.has("padding-bottom"),S=e.dynamicProperty.has("padding-left"),P=e.dynamicProperty.has("padding-right");a("top",l,s,E||!d&&h),a("bottom",c,s,T||!f&&h),a("left",u,s,S||!m&&h),a("right",y,s,P||!g&&h),s.size>0&&t.properties.set("padding",s)}]]},1778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dividerParserArray=void 0;const o=r(8122);t.dividerParserArray=[[(0,o.hasFeatureProperty)("divider","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("divider","color"),(0,o.colorPropertyParser)("color")],[(0,o.hasFeatureProperty)("divider","stroke-width"),(0,o.stringPropertyParser)("stroke-width")],[(0,o.hasFeatureProperty)("divider","line-cap"),(0,o.enumPropertyParser)("line-cap","LineCapStyle.")]]},5264:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithFlexAlignItems=t.flexParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t,r,n)=>{if(!(n.params instanceof Map))return;const a=r.dynamicProperty.get(e);if(!(0,o.isEmptyOrUndefined)(a))return void n.params.set((0,o.getEtsPropName)(e),a);const i=r.property.get(e);if((0,o.isEmptyOrUndefined)(i))return;let s=(0,o.getEtsEnumValue)(t,i);"flex-start"===i?s=t+"Start":"flex-end"===i&&(s=t+"End"),n.params.set((0,o.getEtsPropName)(e),s)}));function a(e){let t=(0,o.getEtsEnumValue)("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}t.flexParserArray=[[(0,o.hasFeatureProperty)("flex","flex-direction"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("flex-direction");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("direction",r);const n=e.property.get("flex-direction");(0,o.isEmptyOrUndefined)(n)||t.params.set("direction",(0,o.getEtsEnumValue)("FlexDirection.",n))}],[(0,o.hasFeatureProperty)("flex","wrap"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("wrap");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("wrap",r);const n=e.property.get("wrap");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.dealWithWrap)(n);t.params.set("wrap",a)}],[(0,o.hasFeatureProperty)("flex","justify-content"),n("justify-content","FlexAlign.")],[(0,o.hasFeatureProperty)("flex","align-items-flex"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-items-flex");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("alignItems",r);const n=e.property.get("align-items-flex");if((0,o.isEmptyOrUndefined)(n))return;const i=a(n);t.params.set("alignItems",i)}],[(0,o.hasFeatureProperty)("flex","align-content"),n("align-content","FlexAlign.")]],t.dealWithFlexAlignItems=a},2153:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridItemParserArray=t.gridParserArray=void 0;const o=r(8122);t.gridParserArray=[[(0,o.hasFeatureProperty)("grid","scroller"),o.scrollerParamParser],[(0,o.hasFeatureProperty)("grid","columns-template"),(0,o.stringPropertyParser)("columns-template")],[(0,o.hasFeatureProperty)("grid","rows-template"),(0,o.stringPropertyParser)("rows-template")],[(0,o.hasFeatureProperty)("grid","columns-gap"),(0,o.stringPropertyParser)("columns-gap")],[(0,o.hasFeatureProperty)("grid","rows-gap"),(0,o.stringPropertyParser)("rows-gap")],[(0,o.hasFeatureProperty)("grid","scroll-bar"),(0,o.enumPropertyParser)("scroll-bar","BarState.")],[(0,o.hasFeatureProperty)("grid","scroll-bar-color"),(0,o.colorPropertyParser)("scroll-bar-color")],[(0,o.hasFeatureProperty)("grid","scroll-bar-width"),(0,o.stringPropertyParser)("scroll-bar-width")],[(0,o.hasFeatureProperty)("grid","cached-count"),(0,o.numberPropertyParser)("cached-count")],[(0,o.hasFeatureProperty)("grid","edit-mode"),(0,o.booleanPropertyParser)("edit-mode")],[(0,o.hasFeatureProperty)("grid","layout-direction"),(0,o.enumPropertyParser)("layout-direction","GridDirection.")],[(0,o.hasFeatureProperty)("grid","max-count"),(0,o.numberPropertyParser)("max-count")],[(0,o.hasFeatureProperty)("grid","min-count"),(0,o.numberPropertyParser)("min-count")],[(0,o.hasFeatureProperty)("grid","cell-length"),(0,o.numberPropertyParser)("cell-length")],[(0,o.hasFeatureProperty)("grid","multi-selectable"),(0,o.booleanPropertyParser)("multi-selectable")],[(0,o.hasFeatureProperty)("grid","support-animation"),(0,o.booleanPropertyParser)("support-animation")]],t.gridItemParserArray=[[(0,o.hasFeatureProperty)("grid-item","row-start"),(0,o.numberPropertyParser)("row-start")],[(0,o.hasFeatureProperty)("grid-item","row-end"),(0,o.numberPropertyParser)("row-end")],[(0,o.hasFeatureProperty)("grid-item","column-start"),(0,o.numberPropertyParser)("column-start")],[(0,o.hasFeatureProperty)("grid-item","column-end"),(0,o.numberPropertyParser)("column-end")],[(0,o.hasFeatureProperty)("grid-item","force-rebuild"),(0,o.booleanPropertyParser)("force-rebuild")],[(0,o.hasFeatureProperty)("grid-item","selectable"),(0,o.booleanPropertyParser)("selectable")]]},9248:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithSrc=t.imageParserArray=t.isTargetComponent=void 0;const o=r(8122);function n(e){return null===e.match(/\$(r|rawfile)\('(.*)'\)$/)?(0,o.quoteString)(e):e}t.isTargetComponent=(0,o.curry)(((e,t)=>t.type===e)),t.imageParserArray=[[(0,t.isTargetComponent)("image"),function(e,t){var r;const a=e.dynamicProperty.get("src");if(!(0,o.isEmptyOrUndefined)(a))return void t.setParams(a);const i=null!==(r=e.property.get("src"))&&void 0!==r?r:"";t.setParams(n(i))}],[(0,o.hasFeatureProperty)("image","alt"),(0,o.stringPropertyParser)("alt")],[(0,o.hasFeatureProperty)("image","object-fit"),(0,o.enumPropertyParser)("object-fit","ImageFit.")],[(0,o.hasFeatureProperty)("image","object-repeat"),(0,o.enumPropertyParser)("object-repeat","ImageRepeat.")],[(0,o.hasFeatureProperty)("image","interpolation"),(0,o.enumPropertyParser)("interpolation","ImageInterpolation.")],[(0,o.hasFeatureProperty)("image","render-mode"),(0,o.enumPropertyParser)("render-mode","ImageRenderMode.")],[function(e){return e.hasProperty("source-size-width")||e.hasProperty("source-size-height")},function(e,t){let r=e.getProperty("source-size-width"),n=e.getProperty("source-size-height");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(n))return;const a=e.dynamicProperty.has("source-size-width"),i=e.dynamicProperty.has("source-size-height");r="0"===r||(0,o.isEmptyOrUndefined)(r)?"0":a?r:r.substring(0,r.length-2),n="0"===n||(0,o.isEmptyOrUndefined)(n)?"0":i?n:n.substring(0,n.length-2);const s=new Map([["width",r],["height",n]]);t.properties.set("sourceSize",s)}]],t.dealWithSrc=n},7907:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemParserArray=t.listParserArray=void 0;const o=r(8122);t.listParserArray=[[(0,o.hasFeatureProperty)("list","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("list","initial-index"),(0,o.rawDataParamParser)("initial-index")],[(0,o.hasFeatureProperty)("list","list-direction"),(0,o.enumPropertyParser)("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasProperty("divider-stroke-width")||e.hasProperty("divider-color")||e.hasProperty("divider-start-margin")||e.hasProperty("divider-end-margin"))},function(e,t){const r=e.property.get("divider-stroke-width"),n=e.dynamicProperty.get("divider-stroke-width"),a=new Map([["strokeWidth",`${(0,o.quoteString)(null!=r?r:"0")}`]]);(0,o.isEmptyOrUndefined)(n)||a.set("strokeWidth",n);const i=e.property.get("divider-color"),s=e.dynamicProperty.get("divider-color"),p=e.property.get("divider-start-margin"),l=e.dynamicProperty.get("divider-start-margin"),c=e.property.get("divider-end-margin"),u=e.dynamicProperty.get("divider-end-margin");(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||a.set("color",(0,o.dealWithColor)(i)):a.set("color",s),(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(p)||a.set("startMargin",(0,o.quoteString)(p)):a.set("startMargin",l),(0,o.isEmptyOrUndefined)(u)?(0,o.isEmptyOrUndefined)(c)||a.set("endMargin",(0,o.quoteString)(c)):a.set("endMargin",u),t.properties.set("divider",a)}],[(0,o.hasFeatureProperty)("list","edit-mode"),(0,o.booleanPropertyParser)("edit-mode")],[(0,o.hasFeatureProperty)("list","edge-effect"),(0,o.enumPropertyParser)("edge-effect","EdgeEffect.")],[(0,o.hasFeatureProperty)("list","chain-animation"),(0,o.booleanPropertyParser)("chain-animation")]],t.listItemParserArray=[[(0,o.hasFeatureProperty)("list-item","sticky"),(0,o.enumPropertyParser)("sticky","Sticky.")],[(0,o.hasFeatureProperty)("list-item","editable"),(0,o.booleanPropertyParser)("editable")]]},8191:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.navigationParserArray=void 0;const o=r(8122);t.navigationParserArray=[[(0,o.hasFeatureProperty)("navigation","navigation-title"),function(e,t){const r=e.getProperty("navigation-title"),n=e.dynamicProperty.get("navigation-title");(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||t.properties.set("title",(0,o.quoteString)(r)):t.properties.set("title",n)}],[(0,o.hasFeatureProperty)("navigation","subTitle"),(0,o.stringPropertyParser)("subTitle")],[(0,o.hasFeatureProperty)("navigation","menus"),(0,o.objectPropertyParser)("menus")],[(0,o.hasFeatureProperty)("navigation","titleMode"),(0,o.enumPropertyParser)("titleMode","NavigationTitleMode.")],[(0,o.hasFeatureProperty)("navigation","toolBar"),(0,o.objectPropertyParser)("toolBar")],[(0,o.hasFeatureProperty)("navigation","hideToolBar"),(0,o.booleanPropertyParser)("hideToolBar")],[(0,o.hasFeatureProperty)("navigation","hideTitleBar"),(0,o.booleanPropertyParser)("hideTitleBar")],[(0,o.hasFeatureProperty)("navigation","hideBackButton"),(0,o.booleanPropertyParser)("hideBackButton")]]},2565:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textPickerParserArray=t.datePickerParserArray=t.timePickerParserArray=void 0;const o=r(8122);t.timePickerParserArray=[[(0,o.hasFeatureProperty)("timePicker","datetime-selected"),(0,o.dateParamParser)("datetime-selected","selected")],[(0,o.hasFeatureProperty)("timePicker","useMilitaryTime"),(0,o.booleanPropertyParser)("useMilitaryTime")]],t.datePickerParserArray=[[(0,o.hasFeatureProperty)("datePicker","datetime-selected"),(0,o.dateParamParser)("datetime-selected","selected")],[(0,o.hasFeatureProperty)("datePicker","start"),(0,o.dateParamParser)("start","start")],[(0,o.hasFeatureProperty)("datePicker","end"),(0,o.dateParamParser)("end","end")],[(0,o.hasFeatureProperty)("datePicker","lunar"),(0,o.booleanPropertyParser)("lunar")]],t.textPickerParserArray=[[(0,o.hasFeatureProperty)("textPicker","range"),(0,o.arrayParamParser)("range")],[(0,o.hasFeatureProperty)("textPicker","textPicker-selected"),(0,o.customRawDataParamParser)("textPicker-selected","selected")],[(0,o.hasFeatureProperty)("textPicker","defaultPickerItemHeight"),(0,o.stringPropertyParser)("defaultPickerItemHeight")]]},8483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.progressParserArray=void 0;const o=r(8122);t.progressParserArray=[[function(e){return"progress"===e.type&&(e.hasProperty("value")||e.hasProperty("total")||e.hasProperty("style"))},function(e,t){var r;(0,o.dynamicParamParser)("value",e,t)||t.params instanceof Map&&t.params.set("value",null!==(r=e.getProperty("value"))&&void 0!==r?r:"0")}],[(0,o.hasFeatureProperty)("progress","total"),(0,o.rawDataParamParser)("total")],[(0,o.hasFeatureProperty)("progress","style"),(0,o.enumParamParser)("style","ProgressStyle.")],[(0,o.hasFeatureProperty)("progress","color"),(0,o.colorPropertyParser)("color")]]},4925:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshParserArray=void 0;const o=r(8122);t.refreshParserArray=[[(0,o.hasFeatureProperty)("refresh","friction"),(0,o.rawDataParamParser)("friction")],[(0,o.hasFeatureProperty)("refresh","offset"),(0,o.stringParamParser)("offset")],[(0,o.hasFeatureProperty)("refresh","refreshing"),(0,o.booleanParamParser)("refreshing")]]},1790:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithRowAlignItems=t.dealWithColumnAlignItems=t.rowParserArray=t.columnParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t,r,n)=>{if(!(n.properties instanceof Map))return;const a=r.dynamicProperty.get(e);if(!(0,o.isEmptyOrUndefined)(a))return void n.properties.set("justifyContent",a);const i=r.property.get(e);if((0,o.isEmptyOrUndefined)(i))return;let s=(0,o.getEtsEnumValue)(t,i);"flex-start"===i?s=t+"Start":"flex-end"===i&&(s=t+"End"),n.properties.set("justifyContent",s)}));function a(e){let t=(0,o.getEtsEnumValue)("HorizontalAlign.",e);return"flex-start"===e?t="HorizontalAlign.Start":"flex-end"===e&&(t="HorizontalAlign.End"),t}function i(e){let t=(0,o.getEtsEnumValue)("VerticalAlign.",e);return"flex-start"===e?t="VerticalAlign.Top":"flex-end"===e&&(t="VerticalAlign.Bottom"),t}t.columnParserArray=[[(0,o.hasFeatureProperty)("column","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("column","align-items-column"),function(e,t){const r=e.dynamicProperty.get("align-items-column");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-column");if((0,o.isEmptyOrUndefined)(n))return;const i=a(n);t.properties.set("alignItems",i)}],[(0,o.hasFeatureProperty)("column","justify-content-rc"),n("justify-content-rc","FlexAlign.")]],t.rowParserArray=[[(0,o.hasFeatureProperty)("row","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("row","align-items-row"),function(e,t){const r=e.dynamicProperty.get("align-items-row");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-row");if((0,o.isEmptyOrUndefined)(n))return;const a=i(n);t.properties.set("alignItems",a)}],[(0,o.hasFeatureProperty)("row","justify-content-rc"),n("justify-content-rc","FlexAlign.")]],t.dealWithColumnAlignItems=a,t.dealWithRowAlignItems=i},7375:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollParserArray=void 0;const o=r(8122);t.scrollParserArray=[[(0,o.hasFeatureProperty)("scroll","scrollable"),(0,o.enumPropertyParser)("scrollable","ScrollDirection.")],[(0,o.hasFeatureProperty)("scroll","scroll-bar"),(0,o.enumPropertyParser)("scroll-bar","BarState.")],[(0,o.hasFeatureProperty)("scroll","scroll-bar-color"),(0,o.colorPropertyParser)("scroll-bar-color")],[(0,o.hasFeatureProperty)("scroll","scroll-bar-width"),(0,o.stringPropertyParser)("scroll-bar-width")],[(0,o.hasFeatureProperty)("scroll","edge-effect-scroll"),function(e,t){const r="edge-effect-scroll";if((0,o.dynamicPropertyParser)(r,e,t))return;const n=e.property.get(r);(0,o.isEmptyOrUndefined)(n)||t.properties.set("edgeEffect",(0,o.getEtsEnumValue)("EdgeEffect.",n))}],[(0,o.hasFeatureProperty)("scroll","scroller"),o.scrollerParamParser]]},9284:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchParserArray=void 0;const o=r(8122),n=r(8014);function a(e,t,r,n){const a=new Map([["value","search-value"],["placeholder","search-placeholder"],["icon","icon"],["controller","search-controller"]]).get(e);if(void 0===a)return;const i=r.getProperty(a),s=r.dynamicProperty.get(a);"controller"!==e||(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||t.push(`${e}: ${(0,o.quoteString)(i)}`):t.push(`${e}: ${(0,o.getContentName)(s)}`):t.push(`${e}: ${s}`)}t.searchParserArray=[[(0,o.hasFeatureProperty)("search","text-font-size"),(0,n.selectFontParser)("text-font","size")],[(0,o.hasFeatureProperty)("search","text-font-style"),(0,n.selectFontParser)("text-font","style")],[(0,o.hasFeatureProperty)("search","text-font-weight"),(0,n.selectFontParser)("text-font","weight")],[(0,o.hasFeatureProperty)("search","text-font-family"),(0,n.selectFontParser)("text-font","family")],[(0,o.hasFeatureProperty)("search","placeholder-font-size"),(0,n.selectFontParser)("placeholder-font","size")],[(0,o.hasFeatureProperty)("search","placeholder-font-style"),(0,n.selectFontParser)("placeholder-font","style")],[(0,o.hasFeatureProperty)("search","placeholder-font-weight"),(0,n.selectFontParser)("placeholder-font","weight")],[(0,o.hasFeatureProperty)("search","placeholder-font-family"),(0,n.selectFontParser)("placeholder-font","family")],[(0,o.hasFeatureProperty)("search","placeholderColor"),(0,o.colorPropertyParser)("placeholderColor")],[(0,o.hasFeatureProperty)("search","search-text-align"),o.searchTextAlign],[function(e){return"search"===e.type},function(e,t){const r=[];a("value",r,e),a("placeholder",r,e),a("icon",r,e),a("controller",r,e),t.setParams(`{${r.join(", ")}}`)}],[(0,o.hasFeatureProperty)("search","search-button"),(0,o.stringPropertyParser)("search-button")],[(0,o.hasFeatureProperty)("search","copy-option"),(0,o.enumPropertyParser)("copy-option","CopyOptions.")]]},8014:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectParserArray=t.selectFontParser=void 0;const o=r(8122);t.selectFontParser=(0,o.curry)(((e,t,r,n)=>{let a=n.properties.get((0,o.getEtsPropName)(e));void 0===a&&(a=new Map);const i=`${e}-${t}`,s=r.property.get(i),p=r.dynamicProperty.get(i);"string"!=typeof a&&((0,o.isEmptyOrUndefined)(p)?(0,o.isEmptyOrUndefined)(s)||("size"!==t&&"family"!==t||a.set(t,(0,o.quoteString)(s)),"style"===t&&a.set(t,(0,o.getEtsEnumValue)("FontStyle.",s)),"weight"===t&&a.set(t,(0,o.dealWithFontWeight)(s))):a.set(t,p)),n.properties.set((0,o.getEtsPropName)(e),a)})),t.selectParserArray=[[(0,o.hasSelectOption)("select","select-option"),function(e,t){const r=e.dynamicProperty.get("select-option");t.setParams(null!=r?r:'[{value: ""}]')}],[(0,o.hasFeatureProperty)("select","select-value"),function(e,t){const r=e.getProperty("select-value"),n=e.dynamicProperty.get("select-value");(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||t.properties.set("value",(0,o.quoteString)(r)):t.properties.set("value",(0,o.getContentName)(n))}],[(0,o.hasFeatureProperty)("select","selected"),(0,o.numberPropertyParser)("selected")],[(0,o.hasFeatureProperty)("select","font-size"),(0,t.selectFontParser)("font","size")],[(0,o.hasFeatureProperty)("select","font-style"),(0,t.selectFontParser)("font","style")],[(0,o.hasFeatureProperty)("select","font-weight"),(0,t.selectFontParser)("font","weight")],[(0,o.hasFeatureProperty)("select","font-family"),(0,t.selectFontParser)("font","family")],[(0,o.hasFeatureProperty)("select","selected-option-font-size"),(0,t.selectFontParser)("selected-option-font","size")],[(0,o.hasFeatureProperty)("select","selected-option-font-style"),(0,t.selectFontParser)("selected-option-font","style")],[(0,o.hasFeatureProperty)("select","selected-option-font-weight"),(0,t.selectFontParser)("selected-option-font","weight")],[(0,o.hasFeatureProperty)("select","selected-option-font-family"),(0,t.selectFontParser)("selected-option-font","family")],[(0,o.hasFeatureProperty)("select","selected-option-font-color"),(0,o.colorPropertyParser)("selected-option-font-color")],[(0,o.hasFeatureProperty)("select","selected-option-bg-color"),(0,o.colorPropertyParser)("selected-option-bg-color")],[(0,o.hasFeatureProperty)("select","option-font-size"),(0,t.selectFontParser)("option-font","size")],[(0,o.hasFeatureProperty)("select","option-font-style"),(0,t.selectFontParser)("option-font","style")],[(0,o.hasFeatureProperty)("select","option-font-weight"),(0,t.selectFontParser)("option-font","weight")],[(0,o.hasFeatureProperty)("select","option-font-family"),(0,t.selectFontParser)("option-font","family")],[(0,o.hasFeatureProperty)("select","option-font-color"),(0,o.colorPropertyParser)("option-font-color")],[(0,o.hasFeatureProperty)("select","option-bg-color"),(0,o.colorPropertyParser)("option-bg-color")]]},2563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sliderParserArray=void 0;const o=r(8122);t.sliderParserArray=[[(0,o.hasFeatureProperty)("slider","value"),(0,o.rawDataParamParser)("value")],[(0,o.hasFeatureProperty)("slider","min"),(0,o.rawDataParamParser)("min")],[(0,o.hasFeatureProperty)("slider","max"),(0,o.rawDataParamParser)("max")],[(0,o.hasFeatureProperty)("slider","step"),(0,o.rawDataParamParser)("step")],[(0,o.hasFeatureProperty)("slider","style"),(0,o.enumParamParser)("style","SliderStyle.")],[(0,o.hasFeatureProperty)("slider","block-color"),(0,o.colorPropertyParser)("block-color")],[(0,o.hasFeatureProperty)("slider","track-color"),(0,o.colorPropertyParser)("track-color")],[(0,o.hasFeatureProperty)("slider","selected-color"),(0,o.colorPropertyParser)("selected-color")],[(0,o.hasFeatureProperty)("slider","show-steps"),(0,o.booleanPropertyParser)("show-steps")],[(0,o.hasFeatureProperty)("slider","show-tips"),(0,o.booleanPropertyParser)("show-tips")]]},8936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackParserArray=void 0;const o=r(8122);t.stackParserArray=[[(0,o.hasFeatureProperty)("stack","align-content-stack"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-content-stack");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("alignContent",r);const n=e.property.get("align-content-stack");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.getEtsEnumValue)("Alignment.",n);t.params.set((0,o.getEtsPropName)("alignContent"),a)}]]},780:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.swiperParserArray=void 0;const o=r(8122);t.swiperParserArray=[[(0,o.hasFeatureProperty)("swiper","index"),(0,o.numberPropertyParser)("index")],[(0,o.hasFeatureProperty)("swiper","auto-play"),(0,o.booleanPropertyParser)("auto-play")],[(0,o.hasFeatureProperty)("swiper","interval"),(0,o.numberPropertyParser)("interval")],[(0,o.hasFeatureProperty)("swiper","indicator"),(0,o.booleanPropertyParser)("indicator")],[(0,o.hasFeatureProperty)("swiper","loop"),(0,o.booleanPropertyParser)("loop")],[(0,o.hasFeatureProperty)("swiper","duration"),(0,o.numberPropertyParser)("duration")],[(0,o.hasFeatureProperty)("swiper","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("swiper","item-space"),(0,o.stringPropertyParser)("item-space")],[(0,o.hasFeatureProperty)("swiper","cached-count"),(0,o.numberPropertyParser)("cached-count")],[(0,o.hasFeatureProperty)("swiper","disable-swipe"),(0,o.booleanPropertyParser)("disable-swipe")]]},7036:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabContentParserArray=void 0;const o=r(8122),n=r(9248);t.tabContentParserArray=[[function(e){return"tab-content"===e.type&&(e.hasProperty("tabBar-icon")||e.hasProperty("tabBar-text"))},function(e,t){var r,a;const i=new Map,s=null!==(r=e.getProperty("tabBar-icon"))&&void 0!==r?r:"",p=null!==(a=e.getProperty("tabBar-text"))&&void 0!==a?a:"TabBar",l=e.dynamicProperty.has("tabBar-text"),c=e.dynamicProperty.has("tabBar-icon");(0,o.isEmptyOrUndefined)(s)||i.set("icon",c?s:(0,n.dealWithSrc)(s)),void 0!==p&&i.set("text",l?p:(0,o.quoteString)(p)),i.size>0&&t.properties.set("tabBar",i)}]]},2973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabsParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t)=>{const r=e.dynamicProperty.get("tabs-scrollable");if(void 0!==r&&""!==r.trim())return void t.properties.set("scrollable",r);const n=e.property.get("tabs-scrollable");(0,o.isEmptyOrUndefined)(n)||t.properties.set("scrollable",n)}));t.tabsParserArray=[[(0,o.hasFeatureProperty)("tabs","bar-position"),(0,o.enumParamParser)("bar-position","BarPosition.")],[(0,o.hasFeatureProperty)("tabs","index"),(0,o.rawDataParamParser)("index")],[(0,o.hasFeatureProperty)("tabs","controller"),(0,o.rawDataParamParser)("controller")],[(0,o.hasFeatureProperty)("tabs","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("tabs","tabs-scrollable"),n],[(0,o.hasFeatureProperty)("tabs","bar-mode"),(0,o.enumPropertyParser)("bar-mode","BarMode.")],[(0,o.hasFeatureProperty)("tabs","bar-width"),(0,o.stringPropertyParser)("bar-width")],[(0,o.hasFeatureProperty)("tabs","bar-height"),(0,o.stringPropertyParser)("bar-height")],[(0,o.hasFeatureProperty)("tabs","animation-duration"),(0,o.numberPropertyParser)("animation-duration")]]},1162:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textInputParserArray=void 0;const o=r(8122);t.textInputParserArray=[[(0,o.hasFeatureProperty)("text-input","placeholder"),(0,o.stringParamParser)("placeholder")],[(0,o.hasFeatureProperty)("text-input","textInput-type"),function(e,t){const r=e.dynamicProperty.get("textInput-type");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("type",r);const n=e.property.get("textInput-type");(0,o.isEmptyOrUndefined)(n)||t.properties.set("type","InputType."+n)}],[(0,o.hasFeatureProperty)("text-input","placeholderColor"),(0,o.colorPropertyParser)("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasProperty("placeholderFont-size")||e.hasProperty("placeholderFont-weight")||e.hasProperty("placeholderFont-family")||e.hasProperty("placeholderFont-style"))},function(e,t){const r=e.property.get("placeholderFont-size"),n=e.dynamicProperty.get("placeholderFont-size"),a=e.property.get("placeholderFont-weight"),i=e.dynamicProperty.get("placeholderFont-weight"),s=e.property.get("placeholderFont-family"),p=e.dynamicProperty.get("placeholderFont-family"),l=e.property.get("placeholderFont-style"),c=e.dynamicProperty.get("placeholderFont-style"),u=new Map;(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||u.set("size",parseInt(r)):u.set("size",n),(0,o.isEmptyOrUndefined)(i)?(0,o.isEmptyOrUndefined)(a)||u.set("weight",isNaN(Number(a))?(0,o.getEtsEnumValue)("FontWeight.",a):a):u.set("weight",i),(0,o.isEmptyOrUndefined)(p)?(0,o.isEmptyOrUndefined)(s)||u.set("family",(0,o.quoteString)(s)):u.set("family",p),(0,o.isEmptyOrUndefined)(c)?(0,o.isEmptyOrUndefined)(l)||u.set("style",(0,o.getEtsEnumValue)("FontStyle.",l)):u.set("style",c),t.properties.set("placeholderFont",u)}],[(0,o.hasFeatureProperty)("text-input","enterKeyType"),(0,o.enumPropertyParser)("enterKeyType","EnterKeyType.")],[(0,o.hasFeatureProperty)("text-input","caretColor"),(0,o.colorPropertyParser)("caretColor")],[(0,o.hasFeatureProperty)("text-input","maxLength"),(0,o.numberPropertyParser)("maxLength")]]},8681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textParserArray=void 0;const o=r(8122);t.textParserArray=[[(0,o.hasFeatureProperty)("text","content"),o.contentParamParser],[(0,o.hasFeatureProperty)("text","text-align"),(0,o.enumPropertyParser)("text-align","TextAlign.")],[(0,o.hasFeatureProperty)("text","text-overflow"),function(e,t){const r=e.dynamicProperty.get("text-overflow");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("textOverflow",new Map([["overflow",r]]));const n=e.property.get("text-overflow");(0,o.isEmptyOrUndefined)(n)||t.properties.set("textOverflow",new Map([["overflow","TextOverflow."+(0,o.firstUpperCase)(n)]]))}],[(0,o.hasFeatureProperty)("text","max-lines"),(0,o.numberPropertyParser)("max-lines")],[(0,o.hasFeatureProperty)("text","line-height"),(0,o.stringPropertyParser)("line-height")],[function(e){return"text"===e.type&&(e.hasProperty("decoration-type")||e.hasProperty("decoration-color"))},function(e,t){const r=e.property.get("decoration-type"),n=e.dynamicProperty.get("decoration-type"),a=e.property.get("decoration-color"),i=e.dynamicProperty.get("decoration-color");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(n)&&(0,o.isEmptyOrUndefined)(i))return;const s=new Map;(0,o.isEmptyOrUndefined)(n)?s.set("type",(0,o.isEmptyOrUndefined)(r)?"TextDecorationType.None":(0,o.getEtsEnumValue)("TextDecorationType.",r)):s.set("type",n),t.properties.set("decoration",s),(0,o.isEmptyOrUndefined)(i)?(0,o.isEmptyOrUndefined)(a)||s.set("color",(0,o.dealWithColor)(a)):s.set("color",i)}],[(0,o.hasFeatureProperty)("text","baseline-offset"),(0,o.stringPropertyParser)("baseline-offset")],[(0,o.hasFeatureProperty)("text","text-case"),(0,o.enumPropertyParser)("text-case","TextCase.")],[(0,o.hasFeatureProperty)("text","font-size"),(0,o.stringPropertyParser)("font-size")],[(0,o.hasFeatureProperty)("text","font-style"),(0,o.enumPropertyParser)("font-style","FontStyle.")],[(0,o.hasFeatureProperty)("text","font-weight"),o.fontWeightPropertyParser],[(0,o.hasFeatureProperty)("text","font-family"),(0,o.stringPropertyParser)("font-family")]]},4313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleParseArray=void 0;const o=r(8122);t.toggleParseArray=[[(0,o.hasFeatureProperty)("toggle","toggle-type"),function(e,t){const r="toggle-type";if((0,o.customDynamicParamParser)(r,"type",e,t))return;const n=e.property.get(r);!(0,o.isEmptyOrUndefined)(n)&&t.params instanceof Map&&t.params.set("type",(0,o.getEtsEnumValue)("ToggleType.",n))}],[(0,o.hasFeatureProperty)("toggle","isOn"),(0,o.booleanParamParser)("isOn")],[(0,o.hasFeatureProperty)("toggle","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("toggle","switchPointColor"),(0,o.colorPropertyParser)("switchPointColor")]]},8122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBuilderUniqueName=t.getEdgeBorderDirection=t.getBorderDirections=t.dealWithAlignSelf=t.dealWithScrollEdgeEffect=t.dealWithBackgroundRepeat=t.dealWithBackgroundImageSize=t.dealWithBackgroundImagePosition=t.dealWithFontWeight=t.getContentName=t.scrollerParamParser=t.dealWithWrap=t.getBackgroundImageSizeEnumValue=t.getBackgroundImagePositionEnumValue=t.contentParamParser=t.labelParamParser=t.fontWeightPropertyParser=t.dealWithColor=t.getEtsEnumValue=t.getEtsPropName=t.parseTagName=t.firstUpperCase=t.getForEachObj=t.colorPropertyParser=t.enumParamParser=t.arrayParamParser=t.booleanParamParser=t.customRawDataParamParser=t.rawDataParamParser=t.dateParamParser=t.stringParamParser=t.dynamicParamParser=t.searchTextAlign=t.enumPropertyParser=t.booleanPropertyParser=t.numberPropertyParser=t.isEmptyOrUndefined=t.objectPropertyParser=t.stringPropertyParser=t.customDynamicParamParser=t.dynamicPropertyParser=t.quoteString=t.hasSelectOption=t.hasFeatureProperty=t.hasCommonProperty=t.curry=void 0;const o=r(1195),n=r(4294);function a(e){return(...t)=>t.lengtht.property.has(e)||t.dynamicProperty.has(e))),t.hasFeatureProperty=a(((e,t,r)=>r.type===e&&(r.property.has(t)||r.dynamicProperty.has(t)))),t.hasSelectOption=a(((e,t,r)=>r.type===e)),t.quoteString=i,t.dynamicPropertyParser=s,t.customDynamicParamParser=p,t.stringPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.properties.set(y(e),i(o))})),t.objectPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.properties.set(y(e),o)})),t.isEmptyOrUndefined=l,t.numberPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);l(o)||r.properties.set(y(e),o)})),t.booleanPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);l(o)||r.properties.set(y(e),o)})),t.enumPropertyParser=a(((e,t,r,o)=>{if(s(e,r,o))return;const n=r.property.get(e);l(n)||o.properties.set(y(e),d(t,n))})),t.searchTextAlign=function(e,t){const r=e.dynamicProperty.get("search-text-align");if(void 0!==r&&""!==r.trim())return void t.properties.set("textAlign",r);const o=e.property.get("search-text-align");l(o)||t.properties.set("textAlign",d("TextAlign.",o))},t.dynamicParamParser=c,t.stringParamParser=a(((e,t,r)=>{if(c(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.params instanceof Map&&r.params.set(y(e),i(o))})),t.dateParamParser=a(((e,t,r,o)=>{const n=r.dynamicProperty.get(e);if(void 0!==n&&""!==n.trim()&&o.params instanceof Map)return void o.params.set(t,n);const a=r.property.get(e);void 0!==a&&o.params instanceof Map&&o.params.set(t,(e=>void 0===e||""===e?"new Date()":"new Date ("+i(e)+")")(a))})),t.rawDataParamParser=a(((e,t,r)=>{if(c(e,t,r))return;const o=t.property.get(e);!l(o)&&r.params instanceof Map&&r.params.set(y(e),o)})),t.customRawDataParamParser=a(((e,t,r,o)=>{if(p(e,t,r,o))return;const n=r.property.get(e);!l(n)&&o.params instanceof Map&&o.params.set(t,n)})),t.booleanParamParser=a(((e,r,o)=>{(0,t.rawDataParamParser)(e,r,o)})),t.arrayParamParser=a(((e,r,o)=>{(0,t.rawDataParamParser)(e,r,o)})),t.enumParamParser=a(((e,t,r,o)=>{if(c(e,r,o))return;const n=r.property.get(e);!l(n)&&o.params instanceof Map&&o.params.set(y(e),d(t,n))})),t.colorPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;let o=t.property.get(e);l(o)||(o=f(o),r.properties.set(y(e),o))})),t.getForEachObj=function(e){var t,r;const o=e.dynamicProperty.get("for"),n=e.dynamicProperty.get("keyGenerator"),a=null!==(t=e.property.get("item"))&&void 0!==t?t:"item",i=null!==(r=e.property.get("idx"))&&void 0!==r?r:"idx";return void 0!==e.dynamicProperty.get("for")?{for:o,key:n,item:a,idx:i}:null},t.firstUpperCase=u,t.parseTagName=function(e){return(0,n.getTagName)(e).split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")},t.getEtsPropName=y,t.getEtsEnumValue=d,t.dealWithColor=f,t.fontWeightPropertyParser=function(e,t){const r=e.getProperty("font-weight");if(l(r))return;const o=g(r);t.properties.set("fontWeight",o)},t.labelParamParser=function(e,t){const r=e.dynamicProperty.get("label");if(!l(r))return void t.setParams(m(r));const o=e.property.get("label");"string"==typeof o&&t.setParams(i(o))},t.contentParamParser=function(e,t){const r=e.property.get("content"),o=e.dynamicProperty.get("content");l(o)?"string"==typeof r&&t.setParams(i(r)):t.setParams(m(o))},t.getBackgroundImagePositionEnumValue=function(e){const t=new Map([["top left","TopStart"],["top center","Top"],["top right","TopEnd"],["center left","Start"],["center center","Center"],["center right","End"],["bottom left","BottomStart"],["bottom center","Bottom"],["bottom right","BottomEnd"]]);return t.has(e)?`Alignment.${String(t.get(e))}`:""},t.getBackgroundImageSizeEnumValue=function(e){return new Set(["cover","contain","auto"]).has(e)?d("ImageSize.",e):""},t.dealWithWrap=function(e){let t=d("FlexWrap.",e);return"nowrap"===e&&(t="FlexWrap.NoWrap"),t},t.scrollerParamParser=function(e,t){const r=e.dynamicProperty.get("scroller");l(r)||t.setParams(r)},t.getContentName=m,t.dealWithFontWeight=g,t.dealWithBackgroundImagePosition=function(e){if(new Set(["TopStart","Top","TopEnd","Start","Center","End","BottomStart","Bottom","BottomEnd"]).has(e))return"Alignment."+e;const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null!==t?`{ x: ${i(t[1])}, y: ${i(t[4])} }`:void 0},t.dealWithBackgroundImageSize=function(e){if(new Set(["Cover","Contain","Auto"]).has(e))return d("ImageSize.",e);const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null!==t?void 0!==t[5]?`{ width: ${i(t[1])}, height: ${i(t[5])} }`:`{ width: ${i(t[1])} }`:void 0},t.dealWithBackgroundRepeat=function(e){const t=new Map([["repeat-x","X"],["repeat-y","Y"],["repeat","XY"],["no-repeat","NoRepeat"]]).get(e);if(null!=t&&""!==t)return d("ImageRepeat.",t)},t.dealWithScrollEdgeEffect=function(e){var t;const r=d("EdgeEffect.",e);return null!==(t=new Map([["Spring","EdgeEffect.Spring"],["Fade","EdgeEffect.Fade"],["None","EdgeEffect.None"]]).get(r))&&void 0!==t?t:r},t.dealWithAlignSelf=function(e){let t=d("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t},t.getBorderDirections=function(e){return"border-width"===e?["border-top-width","border-bottom-width","border-left-width","border-right-width"]:"border-color"===e?["border-top-color","border-bottom-color","border-left-color","border-right-color"]:"border-style"===e?["border-top-style","border-bottom-style","border-left-style","border-right-style"]:["border-top-left-radius","border-bottom-right-radius","border-bottom-left-radius","border-top-right-radius"]},t.getEdgeBorderDirection=function(e){var t;return e.includes("radius")?null!==(t=new Map([["border-top-left-radius","topLeft"],["border-top-right-radius","topRight"],["border-bottom-left-radius","bottomLeft"],["border-bottom-right-radius","bottomRight"]]).get(e))&&void 0!==t?t:e:e.split("-")[1]},t.getBuilderUniqueName=function(e,t){const r=`${y((0,n.getTagName)(e))}${u(y(t))}`;return`${r}_${(0,n.getUniqueId)(r)}`}},1912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.events=t.parseVisualModel=void 0;const o=r(8122),n=r(7150),a=r(1778),i=r(8916),s=r(9248),p=r(8483),l=r(2563),c=r(8681),u=r(1790),y=r(8191),d=r(2153),f=r(780),m=r(2565),g=r(4313),h=r(5264),E=r(7907),T=r(7375),S=r(8014),P=r(4925),v=r(1162),b=r(9284),_=r(8936),N=r(2973),C=r(7036),A=r(2218),O=r(1147);t.parseVisualModel=function(e,r){r.setTagName((0,o.parseTagName)(e.type));const n=(0,o.getForEachObj)(e);r.setForEachObj(n);const a=void 0!==e.dynamicProperty.get("if")?e.dynamicProperty.get("if"):e.property.get("if");void 0===a?r.setIfBoolean(null):r.setIfBoolean(a);for(const t of M)("boolean"==typeof t[0]||t[0](e))&&t[1](e,r);!function(e,r){var o;const n="onDisappear",a="onDisAppear";for(let o of t.events){const t=e.property.get(o);o===n&&(o=a),void 0!==t&&""!==t&&("this"===t.split(".")[0]?r.properties.set(o,t+".bind(this)"):r.properties.set(o,t))}if(void 0!==e.property.get("newFunction")){const t=null!==(o=e.property.get("newFunction"))&&void 0!==o?o:"{}",i=JSON.parse(t);Object.keys(i).forEach((e=>{var t;const o=null!==(t=i[e].eventCodeGen)&&void 0!==t?t:"";e===n&&(e=a),r.properties.set(e,o)}))}}(e,r)},t.events=["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange","onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop","onComplete","onError","onFinish","onChange","onSubmit","onEditChanged","onStateChange","onRefreshing","onSelect","onScroll","onScrollEdge","onScrollEnd","onScrollBegin","onTitleModeChange","onCopy","onCut","onPaste"];const M=[...n.commonParserArray,...i.buttonParserArray,...a.dividerParserArray,...s.imageParserArray,...p.progressParserArray,...l.sliderParserArray,...c.textParserArray,...u.columnParserArray,...u.rowParserArray,...h.flexParserArray,...E.listParserArray,...E.listItemParserArray,...f.swiperParserArray,...v.textInputParserArray,...y.navigationParserArray,...m.timePickerParserArray,...m.textPickerParserArray,...P.refreshParserArray,...g.toggleParseArray,...S.selectParserArray,...m.datePickerParserArray,...T.scrollParserArray,...d.gridParserArray,...d.gridItemParserArray,...b.searchParserArray,..._.stackParserArray,...N.tabsParserArray,...C.tabContentParserArray,...A.checkboxParseArray,...O.checkboxGroupParseArray]},3243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Style=t.Tag=void 0;const o=r(4117);class n extends o.ASTNode{constructor(e,t,r){super(),this.tagName=e,this.attributes=t,this.content=r}}t.Tag=n;class a extends o.ASTNode{constructor(e,t,r,o){super(),this.mediaQuery=void 0,this.kind=e,this.name=t,this.content=r,this.mediaQuery=o}}t.Style=a},3573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const o=r(3243),n=r(2334);class a{constructor(e){this.cache=e}visit(e){e instanceof o.Tag?this.genTag(e):e instanceof o.Style&&this.genStyle(e)}static getMethodGen(e){return void 0===a.instance?a.instance=new a(e):a.instance.setCache(e),a.instance}setCache(e){this.cache=e}genTag(e){if(this.cache.concat(n.TokenClass.TAG_START,e.tagName),this.cache.indentOff(),e.attributes.forEach(((e,t)=>{let r="";for(const t of e)r+='"'===t?""":"\n"===t?" ":t;this.cache.concat(n.TokenClass.SPACE,t,n.TokenClass.ASSIGN,n.TokenClass.LQUOTE,r,n.TokenClass.RQUOTE)})),null===e.content)this.cache.concat(n.TokenClass.EMPTY_TAG_END);else{if(this.cache.concat(n.TokenClass.TAG_END),"string"==typeof e.content){let t="";for(const r of e.content)t+="<"===r?"<":r;this.cache.concat(t)}else 0!==e.content.length&&(this.cache.concat(n.TokenClass.NEW_LINE),this.cache.incIndent(),this.cache.indentOn(),e.content.forEach((e=>{e.accept(this),this.cache.indentOff(),this.cache.concat(n.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.indentOn(),this.cache.decIndent());this.cache.concat(n.TokenClass.END_TAG_START,e.tagName,n.TokenClass.TAG_END)}}genStyle(e){void 0!==e.mediaQuery&&(this.cache.concat("@media"),this.cache.indentOff(),this.cache.concat(n.TokenClass.SPACE,e.mediaQuery,n.TokenClass.SPACE,n.TokenClass.LBRA,n.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent()),"IDStyle"===e.kind&&(this.cache.concat(n.TokenClass.ID_STYLE_START),this.cache.indentOff()),this.cache.concat(e.name,n.TokenClass.SPACE,n.TokenClass.LBRA,n.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.incIndent(),e.content.forEach(((e,t)=>{this.cache.concat(t,n.TokenClass.COLON,n.TokenClass.SPACE,e,n.TokenClass.SEMICOLON,n.TokenClass.NEW_LINE)})),this.cache.decIndent(),this.cache.concat(n.TokenClass.RBRA,n.TokenClass.NEW_LINE),void 0!==e.mediaQuery&&(this.cache.decIndent(),this.cache.concat(n.TokenClass.RBRA,n.TokenClass.NEW_LINE)),this.cache.concat(n.TokenClass.NEW_LINE)}}t.ASTNodeGenerator=a,a.instance=void 0},8844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CSSBridge=t.HMLBridge=void 0;const o=r(3243),n=r(7571);t.HMLBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map([["id",e.id]]);let r="";for(let[o,a]of e.property)(0,n.isAttribute)(o,e.type)?("string"!=typeof a&&(a=JSON.stringify(a)),t.set(o,a)):(0,n.isContent)(o)&&(r=a);if(e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}const a=new o.Tag(e.type,t,r);return"wrapper"===t.get("id")?new o.Tag("div",new Map,[a]):a}},t.CSSBridge=class{constructor(){this.errors=0,this.styles=[]}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}genIDStyle(e){var t;const r=t=>{const r=new Map;for(const[o,a]of t)(0,n.isStyle)(o,e.type)&&r.set(o,a);return r},a=r(e.property);a.size>0&&this.styles.push(new o.Style("IDStyle",e.id,a)),(null!==(t=e.mediaProperty)&&void 0!==t?t:new Map).forEach(((t,n)=>{const a=r(t);a.size>0&&this.styles.push(new o.Style("IDStyle",e.id,a,n))}));for(const t of e.children)t.accept(this)}visit(e){return this.genIDStyle(e),this.styles}}},1055:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genFACSS=t.genFAHML=void 0;const o=r(3573),n=r(1862);t.genFAHML=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" "));return e.accept(t),t.cache.toString()},t.genFACSS=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" "));return e.forEach((e=>{e.accept(t)})),t.cache.toString()}},7571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEvent=t.isData=t.isUnknown=t.isContent=t.isAttribute=t.isStyle=t.styleMap=void 0;const o=r(904),n=["width","height","min-width","min-height","max-width","max-height","padding","padding-start","padding-end","padding-top","padding-right","padding-bottom","padding-left","margin","margin-start","margin-end","margin-top","margin-right","margin-bottom","margin-left","border-width","border-style","border-color","border-radius","border-top-width","border-top-style","border-top-color","border-top-left-radius","border-right-width","border-right-style","border-right-color","border-top-right-radius","border-bottom-width","border-bottom-style","border-bottom-color","border-bottom-right-radius","border-left-width","border-left-style","border-left-color","border-bottom-left-radius","background-color","background","background-image","background-size","background-position","background-repeat","display","opacity","visibility","flex","flex-grow","flex-shrink","flex-basis","position","display","top","right","bottom","left","display-index","flex-weight","aspect-ratio"],a=["font-size","font-family","font-style","font-weight"],i=["text-align","line-height","text-decoration","letter-spacing","max-lines","text-overflow","allow-scale","min-font-size","max-font-size","font-size-step","prefer-font-sizes","color",...a],s=["allow-scale","text-decoration","color",...a],p=["text-color","allow-scale","icon-width","icon-height","radius",...a],l=["texton-color","textoff-color","text-padding","allow-scale",...a],c=["column-height","text-color","allow-scale","letter-spacing","text-decoration","line-height","opacity",...a],u=["text-color","allow-scale","letter-spacing",...a];t.styleMap=new Map([["common",new Set([...n])],["div",new Set(["flex-direction","overflow","flex-wrap","justify-content","align-items","align-content","grid-template-columns","grid-template-rows","grid-row-start","grid-row-end","grid-column-start","grid-column-end","grid-gap","grid-columns-gap","grid-rows-gap"])],["text",new Set([...i])],["image",new Set(["object-fit","match-text-direction","fit-original-size"])],["span",new Set([...s])],["input",new Set(["font-size","font-family","font-weight","color","placeholder-color","allow-scale"])],["button",new Set([...p])],["switch",new Set([...l])],["refresh",new Set(["progress-color"])],["divider",new Set(["stroke-width","line-cap","color"])],["chart",new Set(["stroke-width","radius","start-angle","total-angle","center-x","center-y","colors","weights"])],["picker",new Set([...c])],["picker-view",new Set(["color","font-size","selected-color","selected-font-size","focus-color","focus-font-size","disappear-color","disappear-font-size","font-family"])],["slider",new Set(["color","selected-color","block-color"])],["swiper",new Set(["indicator-color","indicator-selected-color","indicator-size","indicator-top","indicator-right","indicator-bottom","indicator-left"])],["list",new Set(["flex-direction","columns","item-extent","fade-color"])],["list-item",new Set(["column-span"])],["progress",new Set(["color","stroke-width","background-color","secondary-color","scale-width","scale-number","start-angle","total-angle","center-x","center-y","radius"])],["select",new Set(["font-family"])],["menu",new Set([...u])],["option",new Set(["color","font-family","allow-scale","font-size","font-weight","text-decoration"])],["video",new Set(["object-fit"])],["clock",new Set(["font-family"])]]);const y=new Map([["common",new Set(["id","ref","disabled","focusable","data","if","for"])],["image",new Set(["src","alt"])],["button",new Set(["type","value","icon","waiting"])],["refresh",new Set(["offset","refreshing","type","lasttime","friction"])],["input",new Set(["type","checked","name","value","placeholder","maxlength","enterkeytype","headericon"])],["switch",new Set(["checked","showtext","texton","textoff"])],["option",new Set(["value","selected","icon"])],["chart",new Set(["type","percent","datasets","options"])],["picker",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","value","vibrate"])],["picker-view",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","indicatorprefix","indicatorsuffix","vibrate"])],["slider",new Set(["min","max","step","showtips","showsteps","mode","value"])],["divider",new Set(["vertical"])],["list",new Set(["scrollpage","cachedcount","scrollbar","scrolleffect","shapemode","indexer","itemscale","itemcenter","updateeffect","scrollvibrate","initialindex","initialoffset"])],["list-item",new Set(["type","primary","section","sticky","stickyradius","clickeffect"])],["swiper",new Set(["index","autoplay","interval","indicator","digital","indicatordisabled","loop","duration","vertical"])],["progress",new Set(["type","percent","secondarypercent","clockwise"])],["menu",new Set(["target","title","type"])],["clock",new Set(["clockconfig","showdigit","hourswest"])],["badge",new Set(["placement","count","visible","maxcount","config","label"])],["video",new Set(["muted","src","autoplay","poster","controls","loop","starttime","direction","speed"])],["tabs",new Set(["index","vertical"])],["tab-bar",new Set(["mode"])],["tab-content",new Set(["scrollable"])]]),d=new Map([["common",new Set(["ontouchstart","ontouchmove","ontouchcancel","ontouchend","onclick","onlongpress","onfocus","onblur","onkey","onswipe"])],["image",new Set(["oncomplete","onerror"])],["input",new Set(["onchange","onenterkeyclick"])],["select",new Set(["onchange"])],["refresh",new Set(["onrefresh","onpulldown"])],["swiper",new Set(["onchange","onrotation"])],["list",new Set(["onindexerchange","onscroll","onscrollbottom","onscrolltop","onscrollend","onscrolltouchup","onrequestitem"])],["list-item",new Set(["onsticky"])],["menu",new Set(["onselected","oncancel"])],["picker",new Set(["oncolumnchange","onchange","oncancel"])],["picker-view",new Set(["oncolumnchange","onchange"])],["video",new Set(["onprepared","onstart","onpause","onfinish","onerror","onseeking","onseeked","ontimeupdate","onfullscreenchange","onstop"])],["tabs",new Set(["onchange"])],["switch",new Set(["onchange"])],["dialog",new Set(["oncancel"])],["slider",new Set(["onchange"])]]),f=new Map([["common",new Set(["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange"])],["image",new Set(["onComplete","onError","onFinish"])],["swiper",new Set(["onChange"])],["list",new Set(["onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop"])],["text-input",new Set(["onChange","onSubmit","onEditChanged"])],["refresh",new Set(["onStateChange","onRefreshing"])],["toggle",new Set(["onChange"])],["timePicker",new Set(["onChange"])],["textPicker",new Set(["onChange"])],["select",new Set(["onSelect"])],["datePicker",new Set(["onChange"])],["search",new Set(["onSubmit","onChange","onCopy","onCut","onPaste"])],["grid",new Set(["onScrollIndex","onItemDragStart","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDrop"])],["grid-item",new Set(["onSelect"])],["scroll",new Set(["onScroll","onScrollEdge","onScrollEnd","onScrollBegin"])],["navigation",new Set(["onTitleModeChange"])],["tabs",new Set(["onChange"])],["checkbox",new Set(["onChange"])],["checkboxGroup",new Set(["onChange"])]]);function m(e,t,r){const o=t.get(r);return void 0!==o&&o.has(e)}function g(e,r){return m(e,t.styleMap,"common")||m(e,t.styleMap,r)}function h(e,t){return(0,o.getDomain)()===o.Domain.ETS?m(e,f,"common")||m(e,f,t):E(e,t)||T(e,t)}function E(e,t){return m(e,y,"common")||m(e,y,t)}function T(e,t){return m(e,d,"common")||m(e,d,t)}t.isStyle=g,t.isAttribute=h,t.isContent=function(e){return"content"===e},t.isUnknown=function(e,t){return!g(e,t)&&!h(e,t)},t.isData=E,t.isEvent=T},2334:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.INDENT=" ",r.SPACE=" ",r.LQUOTE='"',r.RQUOTE='"',r.TAG_START="<",r.TAG_END=">",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxGroupProperties=t.checkboxProperties=void 0;const o=r(1513);t.checkboxProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"Select",property:"select-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Name",property:"name-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Group",property:"group-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}}],t.checkboxGroupProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"SelectAll",property:"selectAll-visual"},o.commonParamsForJudge),{defaults:!1})}]},3311:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dividerProperties=void 0;const o=r(1513);t.dividerProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign({name:"Vertical",property:"vertical-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"LineCap",property:"line-cap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.LINE_CAP_STYLE,defaults:"butt",list:[o.CLEAN_VALUE_NODE,{name:"Butt",value:"butt"},{name:"Round",value:"round"},{name:"Square",value:"square"}]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"StrokeWidth",property:"stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength}}]},3687:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flexProperties=void 0;const o=r(1513);t.flexProperties=[{propertySector:o.Sector.FLEXCHILD,propertySet:{name:"FlexBasis",property:"flex-basis-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength,defaults:"auto",fixedValues:["auto"],info:"The initial main size of a flex item. It sets the size of the content box otherwise set with box-sizing."}},{propertySector:o.Sector.FLEXCHILD,propertySet:{name:"AlignSelf",property:"align-self-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"auto",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Direction",property:"flex-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_DIRECTION,defaults:"row",list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"RowReverse",value:"row-reverse"},{name:"Column",value:"column"},{name:"ColumnReverse",value:"column-reverse"}],info:"The direction of flex."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Wrap",property:"wrap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_WRAP,defaults:"nowrap",list:[o.CLEAN_VALUE_NODE,{name:"NoWrap",value:"nowrap"},{name:"Wrap",value:"wrap"},{name:"WrapReverse",value:"wrap-reverse"}],info:"Whether flex items are forced onto one line or multiple lines."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"JustifyContent",property:"justify-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"JustifyContent",property:"justify-content-rc-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-flex-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"stretch",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis."}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignContent",property:"align-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Set the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis."}}]},4836:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridItemProperties=void 0;const o=r(1513);t.gridItemProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowStart",property:"row-start-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowEnd",property:"row-end-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnStart",property:"column-start-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnEnd",property:"column-end-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ForceRebuild",property:"force-rebuild-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selectable",property:"selectable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"true"}}]},6181:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridProperties=void 0;const o=r(1513);t.gridProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnsTemplate",property:"columns-template-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowsTemplate",property:"rows-template-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnsGap",property:"columns-gap-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength,defaults:0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowsGap",property:"rows-gap-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength,defaults:0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"LayoutDirection",property:"layout-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.GRID_DIRECTION,list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"Column",value:"column"},{name:"RowReverse",value:"row-reverse"},{name:"ColumnReverse",value:"column-reverse"}],defaults:"row"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MaxCount",property:"max-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER,defaults:1/0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MinCount",property:"min-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER,defaults:1}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"CellLength",property:"cell-length-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MultiSelectable",property:"multi-selectable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SupportAnimation",property:"support-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}}]},8840:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemProperties=void 0;const o=r(1513);t.listItemProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Sticky",property:"sticky-visual",type:o.TypeName.SELECT,etsType:o.EtsType.STICKY,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"Normal",value:"normal"}],defaults:"none"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Editable",property:"editable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}]},8124:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listProperties=void 0;const o=r(1513);t.listProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"InitialIndex",property:"initial-index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:{name:"ListDirection",property:"list-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.AXIS,list:[o.CLEAN_VALUE_NODE,{name:"Vertical",value:"vertical"},{name:"Horizontal",value:"horizontal"}],defaults:"vertical"}},{propertySector:o.Sector.MORE,propertySet:{name:"Color",property:"divider-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"StrokeWidth",property:"divider-stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"StartMargin",property:"divider-start-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"EndMargin",property:"divider-end-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"EditMode",property:"edit-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}},{propertySector:o.Sector.MORE,propertySet:{name:"EdgeEffect",property:"edge-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{name:"Spring",value:"spring"},{name:"None",value:"none"}],defaults:"spring"}},{propertySector:o.Sector.MORE,propertySet:{name:"ChainAnimation",property:"chain-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}]},5452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.navigationProperties=void 0;const o=r(1513);t.navigationProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Title",property:"navigation-title-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SubTitle",property:"subTitle-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Menus",property:"menus-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TitleMode",property:"titleMode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.NAVIGATION_TITLEMODE,list:[o.CLEAN_VALUE_NODE,{value:"Free"},{value:"Mini"},{value:"Full"}],defaults:"Mini"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ToolBar",property:"toolBar-visual",type:o.TypeName.BASE,etsType:o.EtsType.OBJECT,supportStaticProperty:!1,defaults:{}}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideToolBar",property:"hideToolBar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideTitleBar",property:"hideTitleBar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideBackButton",property:"hideBackButton-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}}]},4090:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pickerProperties=void 0;const o=r(1513);t.pickerProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Range",property:"range-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selected",property:"datetime-selected-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Start",property:"start-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"End",property:"end-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"UseMilitaryTime",property:"useMilitaryTime-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selected",property:"textPicker-selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"DefaultPickerItemHeight",property:"defaultPickerItemHeight-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["vp","px","lpx"]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Lunar",property:"lunar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}]},5302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshProperties=void 0;const o=r(1513);t.refreshProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Friction",property:"friction-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,defaults:62}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Offset",property:"offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength,defaults:16}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Refreshing",property:"refreshing-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"false",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}]},4488:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollProperties=void 0;const o=r(1513);t.scrollProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.SCROLL_DIRECTION,list:[o.CLEAN_VALUE_NODE,{value:"Horizontal"},{value:"Vertical"},{value:"None"}],defaults:"Vertical",startApi:"9"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.SCROLL_DIRECTION,list:[o.CLEAN_VALUE_NODE,{value:"Horizontal"},{value:"Vertical"},{value:"None"},{value:"Free"}],defaults:"Vertical",endApi:"9"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBar",property:"scroll-bar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_STATE,list:[o.CLEAN_VALUE_NODE,{value:"Off"},{value:"On"},{value:"Auto"}]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBarColor",property:"scroll-bar-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.NON_R_COLOR}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBarWidth",property:"scroll-bar-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"EdgeEffect",property:"edge-effect-scroll-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{value:"Spring"},{value:"Fade"},{value:"None"}],defaults:"None"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scroller",property:"scroller-visual",type:o.TypeName.BASE,etsType:o.EtsType.SCROLLER,supportStaticProperty:!1}}]},128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchProperties=void 0;const o=r(1513),n=[{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontSize",property:"placeholder-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontStyle",property:"placeholder-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontWeight",property:"placeholder-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontFamily",property:"placeholder-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}}],a=[{propertySector:o.Sector.MORE,propertySet:{name:"TextFontSize",property:"text-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontStyle",property:"text-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontWeight",property:"text-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontFamily",property:"text-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.MORE,propertySet:{name:"TextAlign",property:"search-text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start"}}];t.searchProperties=[...n,...a,{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Controller",property:"search-controller-visual",type:o.TypeName.BASE,etsType:o.EtsType.SEARCH_CONTROLLER,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Icon",property:"icon-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Placeholder",property:"search-placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Value",property:"search-value-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.MORE,propertySet:{name:"SearchButton",property:"search-button-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.MORE,propertySet:{name:"CopyOption",property:"copy-option-visual",type:o.TypeName.SELECT,etsType:o.EtsType.COPY_OPTION,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"None"},{name:"InApp",value:"InApp"},{name:"LocalDevice",value:"LocalDevice"}],defaults:"None",startApi:"9"}}]},1021:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectProperties=void 0;const o=r(1513),n=[{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontSize",property:"selected-option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontStyle",property:"selected-option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontColor",property:"selected-option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontWeight",property:"selected-option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontFamily",property:"selected-option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionBackgroundColor",property:"selected-option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}],a=[{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontSize",property:"option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontStyle",property:"option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontColor",property:"option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontWeight",property:"option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontFamily",property:"option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionBackgroundColor",property:"option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}];t.selectProperties=[...n,...a,{propertySector:o.Sector.SELECT,propertySet:{name:"Value",property:"select-value-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.SELECT,propertySet:{name:"Selected",property:"selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.SELECT,propertySet:{name:"Options",property:"select-option-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}}]},8929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sliderProperties=void 0;const o=r(1513);t.sliderProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TrackColor",property:"track-color-visual",type:o.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ShowSteps",property:"show-steps-visual",type:o.TypeName.ADJUSTABLE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ShowTips",property:"show-tips-visual",type:o.TypeName.ADJUSTABLE}}]},1815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackProperties=void 0;const o=r(1513);t.stackProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignContent",property:"align-content-stack-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ALIGNMENT,defaults:"center",list:o.alignProperties}}]},1492:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.swiperProperties=void 0;const o=r(1513);t.swiperProperties=[{propertySector:o.Sector.MORE,propertySet:Object.assign({name:"AutoPlay",property:"auto-play-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.MORE,propertySet:{name:"Interval",property:"interval-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign(Object.assign({name:"Loop",property:"loop-visual"},o.commonParamsForJudge),{defaults:!0})},{propertySector:o.Sector.MORE,propertySet:{name:"Duration",property:"duration-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:{name:"ItemSpace",property:"item-space-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH}},{propertySector:o.Sector.MORE,propertySet:{name:"CachedCount",property:"cached-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign({name:"DisableSwipe",property:"disable-swipe-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Index",property:"index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign(Object.assign({name:"Indicator",property:"indicator-visual"},o.commonParamsForJudge),{defaults:!0})}]},6153:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabContentProperties=void 0;const o=r(1513);t.tabContentProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TabBar Icon",property:"tabBar-icon-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_SRC}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TabBar Text",property:"tabBar-text-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT}}]},6686:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabsProperties=void 0;const o=r(1513);t.tabsProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Controller",property:"controller-visual",type:o.TypeName.BASE,etsType:o.EtsType.TABS_CONTROLLER,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"tabs-scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"true"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarPosition",property:"bar-position-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_POSITION,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"End",value:"end"}],defaults:"start"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarMode",property:"bar-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_MODE,list:[o.CLEAN_VALUE_NODE,{name:"Scrollable",value:"scrollable"},{name:"Fixed",value:"fixed"}],defaults:"fixed"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarWidth",property:"bar-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarHeight",property:"bar-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AnimationDuration",property:"animation-duration-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:200}}]},3890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textInputProperties=void 0;const o=r(1513);t.textInputProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Placeholder",property:"placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"textInput-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.INPUT_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Password"},{value:"Email"},{value:"Number"}],defaults:"Normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderColor",property:"placeholderColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontSize",property:"placeholderFont-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp"]}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontWeight",property:"placeholderFont-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Lighter"},{value:"Regular"},{value:"Medium"},{value:"Bold"},{value:"Bolder"},...o.commonFontWeight],defaults:"400"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontFamily",property:"placeholderFont-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontStyle",property:"placeholderFont-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Italic"}],defaults:"Normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"EnterKeyType",property:"enterKeyType-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ENTER_KEY_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Go"},{value:"Search"},{value:"Send"},{value:"Next"},{value:"Done"}],defaults:"Done"}},{propertySector:o.Sector.MORE,propertySet:{name:"CaretColor",property:"caretColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"MaxLength",property:"maxLength-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}}]},8271:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textComponentProperties=void 0;const o=r(1513);t.textComponentProperties=[{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextAlign",property:"text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start"}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"LineHeight",property:"line-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextOverflow",property:"text-overflow-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_OVERFLOW,list:[o.CLEAN_VALUE_NODE,{name:"Clip",value:"clip"},{name:"Ellipsis",value:"ellipsis"},{name:"None",value:"none"}],defaults:"clip"}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"BaselineOffset",property:"baseline-offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["fp","px","lpx"]}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"DecorationType",property:"decoration-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_DECORATION_TYPE,list:[o.CLEAN_VALUE_NODE,{name:"Underline",value:"underline"},{name:"LineThrough",value:"line-through"},{name:"Overline",value:"overline"},{name:"None",value:"none"}],defaults:"none"}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"DecorationColor",property:"decoration-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextCase",property:"text-case-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_CASE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"LowerCase"},{value:"UpperCase"}],defaults:"Normal"}}]},3460:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleProperties=void 0;const o=r(1513);t.toggleProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"toggle-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TOGGLE_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Button"},{value:"Checkbox"},{value:"Switch"}],defaults:"Button"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"IsOn",property:"isOn-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SelectedColor",property:"selectedColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SwitchPointColor",property:"switchPointColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}]},1290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.etsPropertyList=void 0;const o=r(5958),n=r(1513),a=r(5302),i=r(3460),s=r(8271),p=r(3890),l=r(3311),c=r(8124),u=r(8840),y=r(3687),d=r(1492),f=r(1021),m=r(8929),g=r(4090),h=r(128),E=r(1815),T=r(4836),S=r(6181),P=r(4488),v=r(5452),b=r(6686),_=r(8964),N=r(6153),C=r(6486),A=(()=>{const e=C.cloneDeep(o.commonPropertyList),t=new Map([["color-visual",n.Sector.FEATURE_ETS],["value-visual",n.Sector.FEATURE_ETS],["total-visual",n.Sector.FEATURE_ETS],["style-visual",n.Sector.FEATURE_ETS],["font-family-visual",n.Sector.TEXTSTYLES],["max-lines-visual",n.Sector.TEXTSTYLES],["flex-grow-visual",n.Sector.FLEXCHILD],["flex-shrink-visual",n.Sector.FLEXCHILD],["aspect-ratio-visual",n.Sector.LAYOUT],["opacity-visual",n.Sector.EFFECT],["background-color-visual",n.Sector.BACKGROUND]]);return e.forEach((e=>{const r=e.propertySet.property;t.has(r)&&(e.propertySector=t.get(r))})),e})(),O=[{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontSize",property:"font-size-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.fontSizeUnit}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontStyle",property:"font-style-visual",type:n.TypeName.SELECT,etsType:n.EtsType.FONT_STYLE,list:[n.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontColor",property:"font-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontWeight",property:"font-weight-visual",type:n.TypeName.SELECT,etsType:`${n.EtsType.FONT_WEIGHT}|${n.EtsType.NUMBER}`,list:n.fontWeightList,defaults:"400"}}],M=[{propertySector:n.Sector.RENDER,propertySet:{name:"ForEach",property:"for-visual",type:n.TypeName.BASE,etsType:n.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:n.Sector.RENDER,propertySet:{name:"KeyGenerator",property:"keyGenerator-visual",type:n.TypeName.BASE,etsType:"Event",supportStaticProperty:!1,defaults:""}},{propertySector:n.Sector.RENDER,propertySet:{name:"Item",property:"item-visual",type:n.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Item of ForEach Array"}},{propertySector:n.Sector.RENDER,propertySet:{name:"Idx",property:"idx-visual",type:n.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Index of Corresponding Item In ForEach Array"}}],w={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:["vp","px","lpx"],placeholder:"0"},R=[{propertySector:n.Sector.SIZE,propertySet:{name:"Width",property:"width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SIZE,propertySet:{name:"Height",property:"height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SIZE,propertySet:{name:"MinWidth",property:"constraint-size-min-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SIZE,propertySet:{name:"MinHeight",property:"constraint-size-min-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SIZE,propertySet:{name:"MaxWidth",property:"constraint-size-max-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SIZE,propertySet:{name:"MaxHeight",property:"constraint-size-max-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,min:0}},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"Margin",property:"margin-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"Padding",property:"padding-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginTop",property:"margin-top-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginRight",property:"margin-right-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginBottom",property:"margin-bottom-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginLeft",property:"margin-left-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingTop",property:"padding-top-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingRight",property:"padding-right-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingBottom",property:"padding-bottom-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingLeft",property:"padding-left-visual"},w)}],I={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength},x={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength},L={type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR},F=[{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomString",property:"custom-string-visual",type:n.TypeName.BASE,etsType:n.EtsType.STRING}},{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomNumber",property:"custom-number-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomBoolean",property:"custom-boolean-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,list:n.booleanListWithClean,defaults:"false"}}],k=[{propertySector:n.Sector.BORDER,propertySet:{name:"Border",property:"border-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-width-visual"},I),Object.assign({name:"Style",property:"border-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-color-visual"},L),Object.assign({name:"Radius",property:"border-radius-visual"},x)]}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderTop",property:"border-top-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-top-width-visual"},I),Object.assign({name:"Style",property:"border-top-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-top-color-visual"},L),Object.assign({name:"TopLeftRadius",property:"border-top-left-radius-visual"},x)],startApi:"9"}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderRight",property:"border-right-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-right-width-visual"},I),Object.assign({name:"Style",property:"border-right-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-right-color-visual"},L),Object.assign({name:"TopRightRadius",property:"border-top-right-radius-visual"},x)],startApi:"9"}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderBottom",property:"border-bottom-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-bottom-width-visual"},I),Object.assign({name:"Style",property:"border-bottom-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-bottom-color-visual"},L),Object.assign({name:"BottomRightRadius",property:"border-bottom-right-radius-visual"},x)],startApi:"9"}},{propertySector:n.Sector.BORDER,propertySet:{name:"BorderLeft",property:"border-left-visual",type:n.TypeName.COMPOSITE,detached:1,properties:[Object.assign({name:"Width",property:"border-left-width-visual"},I),Object.assign({name:"Style",property:"border-left-style-visual"},n.commonParamsForBorder),Object.assign({name:"Color",property:"border-left-color-visual"},L),Object.assign({name:"BottomLeftRadius",property:"border-bottom-left-radius-visual"},x)],startApi:"9"}}],B=[{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageSrc",property:"background-image-src-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_SRC}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageRepeat",property:"background-image-repeat-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_REPERT,list:[n.CLEAN_VALUE_NODE,{name:"X",value:"repeat-x"},{name:"Y",value:"repeat-y"},{name:"XY",value:"repeat"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageSize",property:"background-image-size-visual",type:n.TypeName.DATA_SELECT_INPUT,etsType:`${n.EtsType.IMAGE_SIZE}|${n.EtsType.STRING}`,list:[n.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Auto",value:"auto"}],defaults:"Auto"}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImagePosition",property:"background-image-position-visual",type:n.TypeName.DATA_SELECT_INPUT,etsType:`${n.EtsType.ALIGNMENT}|${n.EtsType.STRING}`,list:[n.CLEAN_VALUE_NODE,{name:"TopStart",value:"top left"},{name:"Top",value:"top center"},{name:"TopEnd",value:"top right"},{name:"Start",value:"center left"},{name:"Center",value:"center center"},{name:"End",value:"center right"},{name:"BottomStart",value:"bottom left"},{name:"Bottom",value:"bottom center"},{name:"BottomEnd",value:"bottom right"}],defaults:"0 0"}}],D=[{propertySector:n.Sector.LAYOUT,propertySet:{name:"Location",property:"position-visual",type:n.TypeName.SELECT,defaults:"offset",supportDynamicProperty:!1,list:[n.CLEAN_VALUE_NODE,{name:"offset",value:"relative"},{name:"position",value:"absolute"}]}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"X",property:"left-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"Y",property:"top-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"]}}],U=[{propertySector:n.Sector.LAYOUT,propertySet:{name:"DisplayPriority",property:"display-priority-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.EFFECT,propertySet:{name:"Visibility",property:"visibility-visual",type:n.TypeName.SELECT,etsType:n.EtsType.VISIBILITY,defaults:"visible",list:[n.CLEAN_VALUE_NODE,{name:"Visible",value:"visible"},{name:"Hidden",value:"hidden"},{name:"None",value:"none"}]}},{propertySector:n.Sector.EFFECT,propertySet:{name:"Enabled",property:"enabled-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"true",list:[{value:"true"},{value:"false"}]}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"Align",property:"align-visual",type:n.TypeName.SELECT,etsType:n.EtsType.ALIGNMENT,defaults:"center",list:n.alignProperties}},{propertySector:n.Sector.RENDER,propertySet:{name:"If",property:"if-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Space",property:"space-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_LENGTH,units:["vp","px","lpx"],requires:{"display-visual":["flex","cleanValue"]},info:"Space between any two adjacent child components."}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-row-visual",type:n.TypeName.SELECT,etsType:n.EtsType.VERTICAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[n.CLEAN_VALUE_NODE,{value:"flex-start",name:"top",etsEnumValue:"Top"},{value:"flex-end",name:"bottom",etsEnumValue:"Bottom"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the vertical direction."}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-column-visual",type:n.TypeName.SELECT,etsType:n.EtsType.HORIZONTAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[n.CLEAN_VALUE_NODE,{value:"flex-start",name:"start",etsEnumValue:"Start"},{value:"flex-end",name:"end",etsEnumValue:"End"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the horizontal direction."}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Src",property:"src-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_SRC}},{propertySector:n.Sector.MORE,propertySet:{name:"Alt",property:"alt-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_CONTENT}},{propertySector:n.Sector.MORE,propertySet:{name:"RenderMode",property:"render-mode-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_RENDER_MODE,defaults:"original",list:[n.CLEAN_VALUE_NODE,{name:"Original",value:"original"},{name:"Template",value:"template"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"ObjectRepeat",property:"object-repeat-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_REPERT,defaults:"no-repeat",list:[n.CLEAN_VALUE_NODE,{name:"X",value:"X"},{name:"Y",value:"Y"},{name:"XY",value:"XY"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"ObjectFit",property:"object-fit-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_FIT,defaults:"cover",list:[n.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Fill",value:"fill"},{name:"None",value:"none"},{name:"ScaleDown",value:"scale-down"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"InterPolation",property:"interpolation-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_INTERPOLATION,defaults:"none",list:[n.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"High",value:"high"},{name:"Medium",value:"medium"},{name:"Low",value:"low"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"SourceSizeWidth",property:"source-size-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,units:["px"]}},{propertySector:n.Sector.MORE,propertySet:{name:"SourceSizeHeight",property:"source-size-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,units:["px"]}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"type-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BUTTON_TYPE,defaults:"capsule",list:[{name:"Normal",value:"normal"},{name:"Capsule",value:"capsule"},{name:"Circle",value:"circle"}]}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"StateEffect",property:"state-effect-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"true",list:n.booleanList}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Content",property:"content-visual",type:n.TypeName.ADJUSTABLE,etsType:n.EtsType.COMB_CONTENT}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Label",property:"label-visual",type:n.TypeName.ADJUSTABLE,etsType:n.EtsType.COMB_CONTENT}}];t.etsPropertyList=[...F,...k,...R,...O,...M,...i.toggleProperties,..._.checkboxProperties,..._.checkboxGroupProperties,...s.textComponentProperties,...p.textInputProperties,...l.dividerProperties,...D,...c.listProperties,...u.listItemProperties,...y.flexProperties,...d.swiperProperties,...a.refreshProperties,...f.selectProperties,...m.sliderProperties,...A,...B,...g.pickerProperties,...h.searchProperties,...P.scrollProperties,...v.navigationProperties,...b.tabsProperties,...N.tabContentProperties,...U,...E.stackProperties,...T.gridItemProperties,...S.gridProperties]},5958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonPropertyList=void 0;const o=r(1513);t.commonPropertyList=[{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundColor",property:"background-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Display",property:"display-visual",type:o.TypeName.SELECT,defaults:"flex",list:[o.CLEAN_VALUE_NODE,{value:"flex"},{value:"none"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Opacity",property:"opacity-visual",type:o.TypeName.SLIDER,etsType:o.EtsType.COMB_R_NUMBER,defaults:"1",step:.01,max:1,min:0}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Overflow",property:"overflow-visual",type:o.TypeName.SELECT,defaults:"visible",list:[o.CLEAN_VALUE_NODE,{value:"visible"},{value:"hidden"},{value:"scroll"}]}},{propertySector:o.Sector.FLEX,propertySet:{name:"FlexGrow",property:"flex-grow-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:"0",requiresParent:{display:["flex","cleanValue"]},info:"The flex grow factor of a flex item's main size"}},{propertySector:o.Sector.FLEX,propertySet:{name:"FlexShrink",property:"flex-shrink-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:"1",requiresParent:{display:["flex","cleanValue"]},info:"The flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items will shrink"}},{propertySector:o.Sector.FLEX,propertySet:{name:"Columns",property:"columns-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:1,info:"The column number of flex."}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Header Logo",property:"headerLogo-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Title",property:"title-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Status",property:"status-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Logo",property:"logo-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Color",property:"color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontFamily",property:"font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:"sans-serif"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"MaxLines",property:"max-lines-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextColor",property:"text-color-visual",type:o.TypeName.COLOR,defaults:"rgba(0,0,0,0.9)"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FocusColor",property:"focus-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DisappearColor",property:"disappear-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorColor",property:"indicator-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorSelectedColor",property:"indicator-selected-color-visual",type:o.TypeName.COLOR,defaults:"#ff007dff"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorSize",property:"indicator-size-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorTop",property:"indicator-top-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorRight",property:"indicator-right-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorBottom",property:"indicator-bottom-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorLeft",property:"indicator-left-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:{name:"AllowScale",property:"allow-scale-visual",type:o.TypeName.SELECT,defaults:"true",list:[o.CLEAN_VALUE_NODE,{value:"true"},{value:"false"}]}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowStart",property:"grid-row-start-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its row in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnStart",property:"grid-column-start-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its column in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowEnd",property:"grid-row-end-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its row in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnEnd",property:"grid-column-end-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its column in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridTemplateRows",property:"grid-template-rows-visual",type:o.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid rows."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridTemplateColumns",property:"grid-template-columns-visual",type:o.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid columns."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowsGap",property:"grid-rows-gap-visual",type:o.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's grid rows."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnsGap",property:"grid-columns-gap-visual",type:o.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's columns."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridGap",property:"grid-gap-visual",type:o.TypeName.INTEGER,units:["px"],requires:{"display-visual":["grid"]},info:"The gaps between rows and columns. It is a shorthand for row-gap and column-gap."}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"MatchTextDirection",property:"match-text-direction-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"FitOriginalSize",property:"fit-original-size-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"IconWidth",property:"icon-width-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IconHeight",property:"icon-height-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextonColor",property:"texton-color-visual",type:o.TypeName.COLOR,defaults:"#000000"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextoffColor",property:"textoff-color-visual",type:o.TypeName.COLOR,defaults:"#000000"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextPadding",property:"text-padding-visual",type:o.TypeName.INTEGER,defaults:0,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedColor",property:"selected-color-visual",type:o.TypeName.COLOR,defaults:"rgba(0,125,255,1)"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"BlockColor",property:"block-color-visual",type:o.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Radius",property:"radius-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StartAngle",property:"start-angle-visual",type:o.TypeName.INTEGER,defaults:240}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TotalAngle",property:"total-angle-visual",type:o.TypeName.INTEGER,defaults:240}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CenterX",property:"center-x-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CenterY",property:"center-y-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Colors",property:"colors-visual",type:o.TypeName.BASE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Weights",property:"weights-visual",type:o.TypeName.BASE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceHolderColor",property:"placeholder-color-visual",type:o.TypeName.COLOR,defaults:"gray"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ProgressColor",property:"progress-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR,defaults:"black"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ItemExtent",property:"item-extent-visual",type:o.TypeName.INTEGER,units:["px","%"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FadeColor",property:"fade-color-visual",type:o.TypeName.COLOR,defaults:"grey"}},{propertySector:o.Sector.FLEX,propertySet:{name:"ColumnSpan",property:"column-span-visual",type:o.TypeName.INTEGER,defaults:1,min:1,info:"The number of span."}},{propertySector:o.Sector.ATOMIC,propertySet:{name:"FlexWeight",property:"flex-weight-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.ATOMIC,propertySet:{name:"AspectRatio",property:"aspect-ratio-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SecondaryColor",property:"secondary-color-visual",type:o.TypeName.COLOR,requires:{type:["horizontal","ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ScaleWidth",property:"scale-width-visual",type:o.TypeName.INTEGER,requires:{type:["ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ScaleNumber",property:"scale-number-visual",type:o.TypeName.INTEGER,defaults:120,requires:{type:["ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Value",property:"value-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:0}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Total",property:"total-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:100}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Style",property:"style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.PROGRESS_STYLE,defaults:"Linear",list:[{value:"Linear"}]}}]},1513:(e,t)=>{"use strict";var r,o,n,a,i,s,p;Object.defineProperty(t,"__esModule",{value:!0}),t.alignProperties=t.booleanListWithClean=t.booleanList=t.fontWeightList=t.fontSizeUnit=t.etsLength=t.commonFontWeight=t.commonParamsForBorderRadius=t.commonParamsForIndicator=t.commonParamsForInteger=t.commonParamsForJudge=t.commonParamsForBorder=t.CLEAN_VALUE_NODE=t.EtsSpecialType=t.EtsCombinationType=t.EtsBasicType=t.EtsEnumType=t.EtsType=t.TypeName=t.Sector=void 0,function(e){e.GENERAL="general",e.DIMENSION="dimension",e.FEATURE="feature",e.FEATURE_ETS="feature_ets",e.SIZE="size",e.SPACING="spacing",e.BORDER="border",e.BACKGROUND="background",e.LAYOUT="layout",e.RENDER="render",e.FLEX="flex",e.FLEXCHILD="flexchild",e.GRID="grid",e.ATOMIC="atomic",e.CUSTOM="custom",e.TEXT="text",e.TEXTSTYLES="textstyles",e.SELECT="select",e.OPTION="option",e.EFFECT="effect",e.MORE="more"}(r||(r={})),t.Sector=r,function(e){e.BASE="base",e.INTEGER="integer",e.SELECT="select",e.COLOR="color",e.COMPOSITE="composite",e.SLIDER="slider",e.DATA_SELECT_INPUT="dataSelectInput",e.ADJUSTABLE="adjustable"}(o||(o={})),t.TypeName=o,function(e){e.ARRAY="ETSArray",e.BOOLEAN="boolean",e.DATE="Date",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(n||(n={})),t.EtsBasicType=n,function(e){e.R_FLOAT="Rfloat",e.R_STRING="Rstring",e.R_COLOR="Rcolor",e.R_PLURAL="Rplural",e.R_MEDIA="Rmedia",e.R_RAWFILE="Rrawfile"}(a||(a={})),function(e){e.ALIGNMENT="Alignment",e.AXIS="Axis",e.BORDER_STYLE="BorderStyle",e.BUTTON_TYPE="ButtonType",e.COLOR="Color",e.DIRECTION="Direction",e.EDGE_EFFECT="EdgeEffect",e.ENTER_KEY_TYPE="EnterKeyType",e.NAVIGATION_TITLEMODE="NavigationTitleMode",e.FLEX_ALIGN="FlexAlign",e.FLEX_DIRECTION="FlexDirection",e.FLEX_WRAP="FlexWrap",e.FONT_STYLE="FontStyle",e.FONT_WEIGHT="FontWeight",e.HORIZONTAL_ALIGN="HorizontalAlign",e.IMAGE_FIT="ImageFit",e.IMAGE_INTERPOLATION="ImageInterpolation",e.IMAGE_RENDER_MODE="ImageRenderMode",e.IMAGE_REPERT="ImageRepeat",e.IMAGE_SIZE="ImageSize",e.INPUT_TYPE="InputType",e.ITEM_ALIGN="ItemAlign",e.LINE_CAP_STYLE="LineCapStyle",e.PROGRESS_STYLE="ProgressStyle",e.STICKY="Sticky",e.TEXT_ALIGN="TextAlign",e.TEXT_OVERFLOW="TextOverflow",e.TEXT_DECORATION_TYPE="TextDecorationType",e.TEXT_CASE="TextCase",e.TOGGLE_TYPE="ToggleType",e.VERTICAL_ALIGN="VerticalAlign",e.VISIBILITY="Visibility",e.COPY_OPTION="CopyOption",e.BAR_STATE="BarState",e.GRID_DIRECTION="GridDirection",e.SCROLL_DIRECTION="ScrollDirection",e.BAR_POSITION="BarPosition",e.BAR_MODE="BarMode"}(i||(i={})),t.EtsEnumType=i,function(e){e.COMB_COLOR="string|number|Color|Rcolor",e.COMB_LENGTH="string|number",e.COMB_R_NUMBER="number|Rfloat",e.COMB_R_LENGTH="string|number|Rfloat",e.COMB_CONTENT="string|Rstring|Rplural",e.COMB_SRC="string|Rmedia|Rrawfile",e.NON_R_COLOR="string|number|Color"}(s||(s={})),t.EtsCombinationType=s,function(e){e.SCROLLER="Scroller",e.TABS_CONTROLLER="TabsController",e.SEARCH_CONTROLLER="SearchController"}(p||(p={})),t.EtsSpecialType=p;const l=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),a),i),s),p);t.EtsType=l;const c={value:"cleanValue",name:"---Clean Value---"};t.CLEAN_VALUE_NODE=c;const u={type:o.SELECT,etsType:l.BORDER_STYLE,list:[c,{value:"dotted",etsEnumValue:"Dotted"},{value:"dashed",etsEnumValue:"Dashed"},{value:"solid",etsEnumValue:"Solid"}]};t.commonParamsForBorder=u;const y={type:o.SELECT,etsType:l.BOOLEAN,defaults:"false",list:[c,{value:"true"},{value:"false"}]};t.commonParamsForJudge=y;const d={type:o.INTEGER,units:["px"],placeholder:"0px"};t.commonParamsForInteger=d;const f={type:o.INTEGER,units:["px","%"]};t.commonParamsForIndicator=f;const m={type:o.INTEGER,units:["px"]};t.commonParamsForBorderRadius=m;const g=[{value:"100"},{value:"200"},{value:"300"},{value:"400"},{value:"500"},{value:"600"},{value:"700"},{value:"800"},{value:"900"}];t.commonFontWeight=g,t.etsLength=["vp","px","%","lpx"],t.fontSizeUnit=["fp","px","lpx"];const h=[c,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...g];t.fontWeightList=h;const E=[{name:"true",value:"true"},{name:"false",value:"false"}];t.booleanList=E;const T=[c,...E];t.booleanListWithClean=T;const S=[c,{name:"TopStart",value:"top-start"},{name:"Top",value:"top"},{name:"TopEnd",value:"top-end"},{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"},{name:"BottomStart",value:"bottom-start"},{name:"Bottom",value:"bottom"},{name:"BottomEnd",value:"bottom-end"}];t.alignProperties=S},9282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TagTypeMap=void 0,t.TagTypeMap=new Map([["button","TextContent"],["span","TextContent"],["divider","TextContent"],["picker","TextContent"],["option","TextContent"],["clock","TextContent"],["image","Base"],["input","Base"],["chart","Base"],["slider","Base"],["progress","Base"],["text","Text"],["div","Container"],["list","Container"],["list-item","Container"],["list-item-group","Container"],["refresh","Container"],["dialog","Container"],["stack","Container"],["menu","Container"],["select","Container"],["tabs","Container"],["tab-bar","Container"],["tab-content","Container"],["scroll","Container"],["navigation","Container"]])},4294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.beforeCodegen=t.getCustomCompRelativePath=t.getRelativePath=t.prepareCustomCompTagName=t.capitalize=t.getTagName=t.strToBase64=t.getUniqueName=t.getUniqueId=t.removeFromArray=t.getDataName=void 0;const o=r(2891);function n(e){let t=a(e).replace(/[/=+]/g,"");const r=t.length;return r>=4&&(t=t.substring(r/2-2,r/2+2)),t}function a(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");let r="";for(let t=0;t{const t=r.indexOf(e);-1!==t&&r.splice(t,1)})),r},t.getUniqueId=n,t.getUniqueName=function(e){return`${e}_${n(e)}`},t.strToBase64=a;const i=new Map,s=new Map;function p(e){return e[0].toUpperCase()+e.slice(1)}function l(e){const t=(0,o.getInstance)().document.path;if(0===e.size)return;const r=p(t.substring(t.lastIndexOf("/")+1));e.forEach(((e,o)=>{const n=e.length,a=[...e];o===r&&a.push(t);const l=function(e){e.sort();const t=e[0],r=e[e.length-1];let o=0;for(let e=0;e1||o===r)&&(u=p(e[a].substring(l+1).split("/").join("_"))),s.set(e[a],u);const y="/node_modules/";let d=c(e[a],t);e[a].startsWith(y)&&(d=e[a].replace(y,"@"),d=d.replace("src/main/supervisual","src/main/ets")),i.set(u,d)}}))}function c(e,t){const r=e.split("/"),o=t.split("/");let n=0;for(let e=0;e1){const o=p(r[r.length-1]),n=t.get(o);void 0===n?t.set(o,[e.type]):n.push(e.type)}const o=e.children;for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formManager=void 0;const o=r(2891),n=r(5945);t.formManager={removeData(e){this.getFormModel().data.delete(e)},addData(e){e instanceof Map?e.forEach(((e,t)=>{this.getFormModel().data.set(t,e)})):Object.keys(e).forEach((t=>{this.getFormModel().data.set(t,e[t])}))},updateAllData(e){this.getFormModel().data.clear(),this.addData(e)},addAction(e,t,r,o,a){const i=new Map;void 0!==r&&Object.keys(r).forEach((e=>{i.set(e,r[e])}));const s=new Map;void 0!==o&&Object.keys(o).forEach((e=>{s.set(e,o[e])})),this.getFormModel().actions.set(e,new n.FormAction(t,i,s,a))},updateAllActions(e){this.getFormModel().actions.clear(),e.forEach(((e,t)=>{const r=void 0===e.params?e.params:this.objectToMap(e.params),o=void 0===e.want?e.want:this.objectToMap(e.want),a=new n.FormAction(e.actionType,r,o);this.getFormModel().actions.set(t,a)}))},removeAction(e){this.getFormModel().actions.delete(e)},addActionParams(e,t){var r,o;const a=null!==(r=this.getFormModel().actions.get(e))&&void 0!==r?r:new n.FormAction(e),i=null!==(o=a.params)&&void 0!==o?o:new Map;Object.keys(t).forEach((e=>{i.set(e,t[e])})),a.params=i},removeActionParam(e,t){var r;const o=this.getFormModel().actions.get(e);null===(r=null==o?void 0:o.params)||void 0===r||r.delete(t)},getFormModel:()=>(0,o.getInstance)().formData,codegenToJson:function(){const e=(0,o.getInstance)().formData,t=this.mapToObject(e.data),r={actions:{},data:{}};return r.data=t,e.actions.forEach(((e,t)=>{r.actions[t]={},r.actions[t].action=e.action,e.params instanceof Map&&e.params.size>0&&(r.actions[t].params=this.mapToObject(e.params)),e.want instanceof Map&&e.want.size>0&&(r.actions[t].abilityName=e.abilityName,r.actions[t].want=this.mapToObject(e.want))})),JSON.stringify(r,null,4)},clear(){(0,o.getInstance)().formData.data.clear(),(0,o.getInstance)().formData.actions.clear()},mapToObject:e=>void 0===e?{}:Array.from(e.entries()).reduce(((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r})),{}),objectToMap(e){const t=new Map;return Object.keys(e).forEach(((r,o)=>{t.set(r,e[r])})),t}}},5945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormAction=t.FormModel=void 0,t.FormModel=class{constructor(){this.data=new Map,this.actions=new Map}},t.FormAction=class{constructor(e,t,r,o){this.action=e,this.abilityName=o,this.want=r,this.params=t}}},1509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeForVersion1=t.rootToVisualContent=t.visualToRootContent=t.serializeForVersion1=void 0;const o=r(2891),n=r(1933),a=r(7571),i=r(9282),s=r(5945),p=r(7977),l=new Map;function c(e){l.set("textMap",new Map);const t=u(null!=e?e:(0,o.getInstance)().visualModel);return JSON.stringify({VisualVersion:"1",content:JSON.stringify(t),extraData:JSON.stringify(f(l))})}function u(e){const t=Array.from(e.property).filter((t=>(0,a.isAttribute)(t[0],e.type)));t.push(["id",e.id]);const r=Array.from(e.property).filter((t=>(0,a.isStyle)(t[0],e.type)));let o=i.TagTypeMap.get(e.type);void 0===o&&(o="Base");let n=e.property.has("content")?e.property.get("content"):[];if(e.children.length>0){if("string"==typeof n){const t=l.get("textMap");t instanceof Map&&t.set(e.id,n)}n=e.children.map((e=>u(e)))}return{id:e.id,tagName:e.type,attributes:t,idStyle:r,type:o,content:n}}function y(e,t){let r;if(t instanceof Map){const o=t.get("textMap");o instanceof Map&&(r=o.get(e.id))}const o=new n.VisualModel({id:e.id,type:e.tagName,property:new Map([...e.attributes,...e.idStyle])});return"string"==typeof r&&o.property.set("content",r),o.property.delete("id"),"string"==typeof e.content&&o.property.set("content",e.content),Array.isArray(e.content)&&(o.children=e.content.map((e=>y(e,t)))),o}function d(e){if(e instanceof Array&&e.length>0&&"$$map"===e[0]){e.shift();const t=new Map;for(const[r,o]of e)t.set(r,d(o));return t}return e}function f(e){if(e instanceof Map){const t=["$$map"];for(const[r,o]of e)t.push([r,f(o)]);return t}return e}t.serializeForVersion1=c,t.visualToRootContent=function(e){try{return c(JSON.parse(e,p.reviver).visualModel)}catch(e){console.error("convert visual model to root model failed")}return e},t.rootToVisualContent=function(e){const t=JSON.parse(e),r=JSON.parse(t.content);let o='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(o=JSON.parse(t.extraData));const n=y(r,d(o));return n.property.has("flex-direction")||n.property.set("flex-direction","column"),JSON.stringify({document:{VisualVersion:"12",type:"FA"},visualModel:n,formData:new s.FormModel},p.replacer)},t.deserializeForVersion1=function(e){try{const t=JSON.parse(e),r=JSON.parse(t.content);let n='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(n=JSON.parse(t.extraData)),(0,o.getInstance)().visualModel=y(r,d(n)),(0,o.getInstance)().visualModel.property.has("flex-direction")||(0,o.getInstance)().visualModel.property.set("flex-direction","column")}catch(e){console.error("convert error")}}},2891:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setInstance=t.getInstance=t.setVisualPath=t.clearCustomInstance=t.setCustomInstance=t.getInstanceTemplate=t.getCustomInstance=void 0;const o=r(1933),n=r(5945),a=r(904),i={document:{VisualVersion:"12",type:"FA",custom:!1,path:""},visualModel:new o.VisualModel({type:"div",id:"wrapper"}),formData:new n.FormModel},s=new Map;t.getCustomInstance=function(){return s},t.getInstanceTemplate=function(e){return{document:{VisualVersion:"12",type:"ETS",custom:e,path:"&path"},visualModel:new o.VisualModel({type:"column",id:"wrapper"}),imgData:""}},t.setCustomInstance=function(e,t){var r;const n={path:"",document:{VisualVersion:"",type:"",custom:!0},visualModel:new o.VisualModel({type:"",id:""}),methods:[],property:[],imgData:"",originType:[]};n.path=e;for(const e in n)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);n.visualModel=null!==(r=n.visualModel.children[0])&&void 0!==r?r:new o.VisualModel({type:"text"}),s.set(e,n)},t.clearCustomInstance=function(){s.clear()},t.setVisualPath=function(e){i.document.path=e},t.getInstance=function(){return i},t.setInstance=function(e){var t,r,o,n;for(const t in i)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);const s=i.document.type;void 0===i.document.custom&&(i.document.custom=!1),null!==((null!==(r=(null===(t=e.customData)||void 0===t?void 0:t.property.size)>0)&&void 0!==r?r:null)||(null!==(n=(null===(o=e.customData)||void 0===o?void 0:o.event.size)>0)&&void 0!==n?n:null))&&(i.customData=e.customData),(0,a.setDomain)("ETS"===s?a.Domain.ETS:"FORM"===s?a.Domain.FORM:a.Domain.FA)}},7977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviver=t.replacer=t.serializeSketchPage=t.serializeCustom=t.deserializeCustom=t.deserialize=t.serialize=void 0;const o=r(1933),n=r(2891),a=r(1509);function i(e,t){if(t instanceof Map)return{dataType:"Map",value:Object.fromEntries(t.entries())};if(t instanceof Set)return{dataType:"Set",value:Array.from(t.entries())};if(t instanceof o.VisualModel){const e=new o.VisualModel({type:"none"}),r={};for(const o in e)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return{dataType:"VisualModel",value:r}}return t}function s(e,t){if("object"==typeof t&&null!=t){if("Map"===t.dataType)return new Map(Object.entries(t.value));if("Set"===t.dataType)return new Set(t.value);if("VisualModel"===t.dataType){const e=new o.VisualModel({type:""});Object.assign(e,t.value),t=e}}return t}t.serialize=function(e,t){return 1===e?(0,a.serializeForVersion1)(t):JSON.stringify(null!=t?t:(0,n.getInstance)(),i,4)},t.deserialize=function(e){if("1"===JSON.parse(e).VisualVersion)return(0,a.deserializeForVersion1)(e);const t=JSON.parse(e,s);(0,n.setInstance)(t)},t.deserializeCustom=function(e,t){const r=JSON.parse(t,s);(0,n.setCustomInstance)(e,r)},t.serializeCustom=function(e){const t=(0,n.getInstanceTemplate)(!0);return t.visualModel.property=new Map([["width","100%"],["height","100%"]]),t.visualModel.children.push(e),JSON.stringify(t,i,4)},t.serializeSketchPage=function(e){const t=(0,n.getInstanceTemplate)(!1);return t.visualModel=e,JSON.stringify(t,i,4)},t.replacer=i,t.reviver=s},1933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VisualModel=void 0;const r="-visual";t.VisualModel=class{constructor(e){if(this.propertyStorage=void 0,this.dynamicPropertyStorage=void 0,this.mediaProperty=void 0,this.dynamicMediaProperty=void 0,this.mediaPropertyStorage=void 0,this.dynamicMediaPropertyStorage=void 0,this.slots=void 0,this.property=void 0!==e.property?e.property:new Map,this.dynamicProperty=void 0!==e.dynamicProperty?e.dynamicProperty:new Map,this.children=void 0!==e.children?e.children:[],"wrapper"===e.type)return this.id="wrapper",void(this.type="div");e.type.endsWith(r)&&(e.type=e.type.substring(0,e.type.length-r.length)),this.id=void 0!==e.id?e.id:"",this.type=e.type,this.slots=e.slots}getProperty(e){const t=this.dynamicProperty.get(e);return void 0!==t&&""!==t?t:this.property.get(e)}hasMediaProperty(e){if(void 0!==this.mediaProperty)for(const[,t]of this.mediaProperty)if(null==t?void 0:t.has(e))return!0;if(void 0!==this.dynamicMediaProperty)for(const[,t]of this.dynamicMediaProperty)if(null==t?void 0:t.has(e))return!0;return!1}hasProperty(e){return this.dynamicProperty.has(e)||this.property.has(e)}getChildren(){var e;const t=[...this.children];for(const[,r]of null!==(e=this.slots)&&void 0!==e?e:new Map)t.push(r);return t}accept(e){return e.visit(this)}}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={id:o,loaded:!1,exports:{}};return e[o].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var o={};(()=>{"use strict";var e=o;Object.defineProperty(e,"__esModule",{value:!0});const t=r(3784),n=r(2891),a=r(7977),i=r(8844),s=r(1055),p=r(3207),l=r(8413),c=r(4435),u=r(6486),y=r(4294),d={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""};function f(e,r){var o;try{(0,a.deserialize)(e);const t=(0,n.getInstance)().document.VisualVersion,o=/^([1-9]+[0-9]*)$/;if(void 0===t)r.errorType="versionError";else{const e=t.match(o);(null===e||parseInt(e[1])>12)&&(r.errorType="versionError")}}catch(e){r.errorType="fileError"}""!==r.errorType&&(r.errorMessage=null!==(o=t.errorMap.get(r.errorType))&&void 0!==o?o:"Codegen visual file failed")}e.genHmlAndCss=function(e){const r={hmlCss:{hml:"",css:"",json:""},errorType:"",errorMessage:""};if(f(e,r),""!==r.errorType)return r.hmlCss.hml="",r.hmlCss.css="",r;try{const e=function(e){const t={hml:"",css:"",json:""},r=new i.HMLBridge,o=e.accept(r),n=(0,s.genFAHML)(o);t.hml=r.getErrorCount()>0?"error":n;const a=new i.CSSBridge,p=e.accept(a),l=(0,s.genFACSS)(p);return t.css=a.getErrorCount()>0?"error":l,t}((0,n.getInstance)().visualModel);"error"!==e.hml&&"error"!==e.css||(r.errorType="codegenError"),r.hmlCss=e,"FORM"===(0,n.getInstance)().document.type&&(r.hmlCss.json=p.formManager.codegenToJson())}catch(e){r.errorType="modelError"}return""!==r.errorType&&(r.errorMessage=t.errorMap.get(r.errorType),r.hmlCss.hml="",r.hmlCss.css=""),r},e.genETS=function(e){var r;const o={ets:(0,u.cloneDeep)(d),errorType:"",errorMessage:""};if(f(e,o),""!==o.errorType)return o.ets=(0,u.cloneDeep)(d),o;try{let e=(0,n.getInstance)().visualModel;if((0,n.getInstance)().document.custom&&(e=e.children[0],void 0===e))return o;(0,y.beforeCodegen)(e);const t=function(e){const t=new l.ETSBridge,r=e.accept(t),o=(new c.StringWriter).genETS(r);return t.getErrorCount()>0?"error":o}(e);"error"===t&&(o.errorType="codegenError"),o.ets=t}catch(e){o.errorType="modelError"}return""!==o.errorType&&(o.errorMessage=null!==(r=t.errorMap.get(o.errorType))&&void 0!==r?r:"Codegen visual file failed",o.ets=(0,u.cloneDeep)(d)),o}})();var n=exports;for(var a in o)n[a]=o[a];o.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})(); +(()=>{var e={6486:function(e,t,r){var o;e=r.nmd(e),function(){var n,a="Expected a function",i="__lodash_hash_undefined__",s="__lodash_placeholder__",p=32,l=128,c=1/0,u=9007199254740991,y=NaN,d=4294967295,f=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",p],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",h="[object Boolean]",E="[object Date]",T="[object Error]",S="[object Function]",P="[object GeneratorFunction]",v="[object Map]",b="[object Number]",_="[object Object]",N="[object Promise]",C="[object RegExp]",O="[object Set]",A="[object String]",M="[object Symbol]",w="[object WeakMap]",R="[object ArrayBuffer]",x="[object DataView]",L="[object Float32Array]",I="[object Float64Array]",F="[object Int8Array]",k="[object Int16Array]",B="[object Int32Array]",D="[object Uint8Array]",U="[object Uint8ClampedArray]",V="[object Uint16Array]",z="[object Uint32Array]",G=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,H=RegExp($.source),Y=RegExp(q.source),X=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),oe=/^\s+/,ne=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,pe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ye=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,he=/^(?:0|[1-9]\d*)$/,Ee=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Te=/($^)/,Se=/['\n\r\u2028\u2029\\]/g,Pe="\\ud800-\\udfff",ve="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",be="\\u2700-\\u27bf",_e="a-z\\xdf-\\xf6\\xf8-\\xff",Ne="A-Z\\xc0-\\xd6\\xd8-\\xde",Ce="\\ufe0e\\ufe0f",Oe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ae="["+Pe+"]",Me="["+Oe+"]",we="["+ve+"]",Re="\\d+",xe="["+be+"]",Le="["+_e+"]",Ie="[^"+Pe+Oe+Re+be+_e+Ne+"]",Fe="\\ud83c[\\udffb-\\udfff]",ke="[^"+Pe+"]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",De="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Ne+"]",Ve="\\u200d",ze="(?:"+Le+"|"+Ie+")",Ge="(?:"+Ue+"|"+Ie+")",je="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",$e="(?:"+we+"|"+Fe+")?",qe="["+Ce+"]?",He=qe+$e+"(?:"+Ve+"(?:"+[ke,Be,De].join("|")+")"+qe+$e+")*",Ye="(?:"+[xe,Be,De].join("|")+")"+He,Xe="(?:"+[ke+we+"?",we,Be,De,Ae].join("|")+")",Je=RegExp("['’]","g"),Ke=RegExp(we,"g"),Qe=RegExp(Fe+"(?="+Fe+")|"+Xe+He,"g"),Ze=RegExp([Ue+"?"+Le+"+"+je+"(?="+[Me,Ue,"$"].join("|")+")",Ge+"+"+We+"(?="+[Me,Ue+ze,"$"].join("|")+")",Ue+"?"+ze+"+"+je,Ue+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,Ye].join("|"),"g"),et=RegExp("["+Ve+Pe+ve+Ce+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ot=-1,nt={};nt[L]=nt[I]=nt[F]=nt[k]=nt[B]=nt[D]=nt[U]=nt[V]=nt[z]=!0,nt[m]=nt[g]=nt[R]=nt[h]=nt[x]=nt[E]=nt[T]=nt[S]=nt[v]=nt[b]=nt[_]=nt[C]=nt[O]=nt[A]=nt[w]=!1;var at={};at[m]=at[g]=at[R]=at[x]=at[h]=at[E]=at[L]=at[I]=at[F]=at[k]=at[B]=at[v]=at[b]=at[_]=at[C]=at[O]=at[A]=at[M]=at[D]=at[U]=at[V]=at[z]=!0,at[T]=at[S]=at[w]=!1;var it={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,pt=parseInt,lt="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,ct="object"==typeof self&&self&&self.Object===Object&&self,ut=lt||ct||Function("return this")(),yt=t&&!t.nodeType&&t,dt=yt&&e&&!e.nodeType&&e,ft=dt&&dt.exports===yt,mt=ft&<.process,gt=function(){try{return dt&&dt.require&&dt.require("util").types||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),ht=gt&>.isArrayBuffer,Et=gt&>.isDate,Tt=gt&>.isMap,St=gt&>.isRegExp,Pt=gt&>.isSet,vt=gt&>.isTypedArray;function bt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function _t(e,t,r,o){for(var n=-1,a=null==e?0:e.length;++n-1}function wt(e,t,r){for(var o=-1,n=null==e?0:e.length;++o-1;);return r}function Zt(e,t){for(var r=e.length;r--&&Ut(t,e[r],0)>-1;);return r}function er(e,t){for(var r=e.length,o=0;r--;)e[r]===t&&++o;return o}var tr=Wt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),rr=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function or(e){return"\\"+it[e]}function nr(e){return et.test(e)}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e,o){r[++t]=[o,e]})),r}function ir(e,t){return function(r){return e(t(r))}}function sr(e,t){for(var r=-1,o=e.length,n=0,a=[];++r",""":'"',"'":"'"}),fr=function e(t){var r,o=(t=null==t?ut:fr.defaults(ut.Object(),t,fr.pick(ut,rt))).Array,ne=t.Date,Pe=t.Error,ve=t.Function,be=t.Math,_e=t.Object,Ne=t.RegExp,Ce=t.String,Oe=t.TypeError,Ae=o.prototype,Me=ve.prototype,we=_e.prototype,Re=t["__core-js_shared__"],xe=Me.toString,Le=we.hasOwnProperty,Ie=0,Fe=(r=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",ke=we.toString,Be=xe.call(_e),De=ut._,Ue=Ne("^"+xe.call(Le).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=ft?t.Buffer:n,ze=t.Symbol,Ge=t.Uint8Array,je=Ve?Ve.allocUnsafe:n,We=ir(_e.getPrototypeOf,_e),$e=_e.create,qe=we.propertyIsEnumerable,He=Ae.splice,Ye=ze?ze.isConcatSpreadable:n,Xe=ze?ze.iterator:n,Qe=ze?ze.toStringTag:n,et=function(){try{var e=ca(_e,"defineProperty");return e({},"",{}),e}catch(e){}}(),it=t.clearTimeout!==ut.clearTimeout&&t.clearTimeout,lt=ne&&ne.now!==ut.Date.now&&ne.now,ct=t.setTimeout!==ut.setTimeout&&t.setTimeout,yt=be.ceil,dt=be.floor,mt=_e.getOwnPropertySymbols,gt=Ve?Ve.isBuffer:n,kt=t.isFinite,Wt=Ae.join,mr=ir(_e.keys,_e),gr=be.max,hr=be.min,Er=ne.now,Tr=t.parseInt,Sr=be.random,Pr=Ae.reverse,vr=ca(t,"DataView"),br=ca(t,"Map"),_r=ca(t,"Promise"),Nr=ca(t,"Set"),Cr=ca(t,"WeakMap"),Or=ca(_e,"create"),Ar=Cr&&new Cr,Mr={},wr=Ua(vr),Rr=Ua(br),xr=Ua(_r),Lr=Ua(Nr),Ir=Ua(Cr),Fr=ze?ze.prototype:n,kr=Fr?Fr.valueOf:n,Br=Fr?Fr.toString:n;function Dr(e){if(rs(e)&&!$i(e)&&!(e instanceof Gr)){if(e instanceof zr)return e;if(Le.call(e,"__wrapped__"))return Va(e)}return new zr(e)}var Ur=function(){function e(){}return function(t){if(!ts(t))return{};if($e)return $e(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Vr(){}function zr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Gr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function jr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function io(e,t,r,o,a,i){var s,p=1&t,l=2&t,c=4&t;if(r&&(s=a?r(e,o,a,i):r(e)),s!==n)return s;if(!ts(e))return e;var u=$i(e);if(u){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Le.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!p)return An(e,s)}else{var y=da(e),d=y==S||y==P;if(Xi(e))return vn(e,p);if(y==_||y==m||d&&!a){if(s=l||d?{}:ma(e),!p)return l?function(e,t){return Mn(e,ya(e),t)}(e,function(e,t){return e&&Mn(t,Ls(t),e)}(s,e)):function(e,t){return Mn(e,ua(e),t)}(e,ro(s,e))}else{if(!at[y])return a?e:{};s=function(e,t,r){var o,n=e.constructor;switch(t){case R:return bn(e);case h:case E:return new n(+e);case x:return function(e,t){var r=t?bn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case L:case I:case F:case k:case B:case D:case U:case V:case z:return _n(e,r);case v:return new n;case b:case A:return new n(e);case C:return function(e){var t=new e.constructor(e.source,ye.exec(e));return t.lastIndex=e.lastIndex,t}(e);case O:return new n;case M:return o=e,kr?_e(kr.call(o)):{}}}(e,y,p)}}i||(i=new Hr);var f=i.get(e);if(f)return f;i.set(e,s),ss(e)?e.forEach((function(o){s.add(io(o,t,r,o,e,i))})):os(e)&&e.forEach((function(o,n){s.set(n,io(o,t,r,n,e,i))}));var g=u?n:(c?l?oa:ra:l?Ls:xs)(e);return Nt(g||e,(function(o,n){g&&(o=e[n=o]),Zr(s,n,io(o,t,r,n,e,i))})),s}function so(e,t,r){var o=r.length;if(null==e)return!o;for(e=_e(e);o--;){var a=r[o],i=t[a],s=e[a];if(s===n&&!(a in e)||!i(s))return!1}return!0}function po(e,t,r){if("function"!=typeof e)throw new Oe(a);return wa((function(){e.apply(n,r)}),t)}function lo(e,t,r,o){var n=-1,a=Mt,i=!0,s=e.length,p=[],l=t.length;if(!s)return p;r&&(t=Rt(t,Xt(r))),o?(a=wt,i=!1):t.length>=200&&(a=Kt,i=!1,t=new qr(t));e:for(;++n-1},Wr.prototype.set=function(e,t){var r=this.__data__,o=eo(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new jr,map:new(br||Wr),string:new jr}},$r.prototype.delete=function(e){var t=pa(this,e).delete(e);return this.size-=t?1:0,t},$r.prototype.get=function(e){return pa(this,e).get(e)},$r.prototype.has=function(e){return pa(this,e).has(e)},$r.prototype.set=function(e,t){var r=pa(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this},qr.prototype.add=qr.prototype.push=function(e){return this.__data__.set(e,i),this},qr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Hr.prototype.get=function(e){return this.__data__.get(e)},Hr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var o=r.__data__;if(!br||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new $r(o)}return r.set(e,t),this.size=r.size,this};var co=xn(To),uo=xn(So,!0);function yo(e,t){var r=!0;return co(e,(function(e,o,n){return r=!!t(e,o,n)})),r}function fo(e,t,r){for(var o=-1,a=e.length;++o0&&r(s)?t>1?go(s,t-1,r,o,n):xt(n,s):o||(n[n.length]=s)}return n}var ho=Ln(),Eo=Ln(!0);function To(e,t){return e&&ho(e,t,xs)}function So(e,t){return e&&Eo(e,t,xs)}function Po(e,t){return At(t,(function(t){return Qi(e[t])}))}function vo(e,t){for(var r=0,o=(t=En(t,e)).length;null!=e&&rt}function Co(e,t){return null!=e&&Le.call(e,t)}function Oo(e,t){return null!=e&&t in _e(e)}function Ao(e,t,r){for(var a=r?wt:Mt,i=e[0].length,s=e.length,p=s,l=o(s),c=1/0,u=[];p--;){var y=e[p];p&&t&&(y=Rt(y,Xt(t))),c=hr(y.length,c),l[p]=!r&&(t||i>=120&&y.length>=120)?new qr(p&&y):n}y=e[0];var d=-1,f=l[0];e:for(;++d=s?p:p*("desc"==r[o]?-1:1)}return e.index-t.index}(e,t,r)}));o--;)e[o]=e[o].value;return e}(n)}function jo(e,t,r){for(var o=-1,n=t.length,a={};++o-1;)s!==e&&He.call(s,p,1),He.call(e,p,1);return e}function $o(e,t){for(var r=e?t.length:0,o=r-1;r--;){var n=t[r];if(r==o||n!==a){var a=n;ha(n)?He.call(e,n,1):cn(e,n)}}return e}function qo(e,t){return e+dt(Sr()*(t-e+1))}function Ho(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=dt(t/2))&&(e+=e)}while(t);return r}function Yo(e,t){return Ra(Na(e,t,np),e+"")}function Xo(e){return Xr(zs(e))}function Jo(e,t){var r=zs(e);return Ia(r,ao(t,0,r.length))}function Ko(e,t,r,o){if(!ts(e))return e;for(var a=-1,i=(t=En(t,e)).length,s=i-1,p=e;null!=p&&++aa?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=o(a);++n>>1,i=e[a];null!==i&&!ls(i)&&(r?i<=t:i=200){var l=t?null:Yn(e);if(l)return pr(l);i=!1,n=Kt,p=new qr}else p=t?[]:s;e:for(;++o=o?e:tn(e,t,r)}var Pn=it||function(e){return ut.clearTimeout(e)};function vn(e,t){if(t)return e.slice();var r=e.length,o=je?je(r):new e.constructor(r);return e.copy(o),o}function bn(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function _n(e,t){var r=t?bn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Nn(e,t){if(e!==t){var r=e!==n,o=null===e,a=e==e,i=ls(e),s=t!==n,p=null===t,l=t==t,c=ls(t);if(!p&&!c&&!i&&e>t||i&&s&&l&&!p&&!c||o&&s&&l||!r&&l||!a)return 1;if(!o&&!i&&!c&&e1?r[a-1]:n,s=a>2?r[2]:n;for(i=e.length>3&&"function"==typeof i?(a--,i):n,s&&Ea(r[0],r[1],s)&&(i=a<3?n:i,a=1),t=_e(t);++o-1?a[i?t[s]:s]:n}}function Dn(e){return ta((function(t){var r=t.length,o=r,i=zr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Oe(a);if(i&&!p&&"wrapper"==aa(s))var p=new zr([],!0)}for(o=p?o:r;++o1&&T.reverse(),d&&up))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var y=-1,d=!0,f=2&r?new qr:n;for(i.set(e,t),i.set(t,e);++y-1&&e%1==0&&e1?"& ":"")+t[o],t=t.join(r>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(o,function(e,t){return Nt(f,(function(r){var o="_."+r[0];t&r[1]&&!Mt(e,o)&&e.push(o)})),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(se):[]}(o),r)))}function La(e){var t=0,r=0;return function(){var o=Er(),a=16-(o-r);if(r=o,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Ia(e,t){var r=-1,o=e.length,a=o-1;for(t=t===n?o:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ii(e,r)}));function di(e){var t=Dr(e);return t.__chain__=!0,t}function fi(e,t){return t(e)}var mi=ta((function(e){var t=e.length,r=t?e[0]:0,o=this.__wrapped__,a=function(t){return no(t,e)};return!(t>1||this.__actions__.length)&&o instanceof Gr&&ha(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:fi,args:[a],thisArg:n}),new zr(o,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(a)})),gi=wn((function(e,t,r){Le.call(e,r)?++e[r]:oo(e,r,1)})),hi=Bn(Wa),Ei=Bn($a);function Ti(e,t){return($i(e)?Nt:co)(e,sa(t,3))}function Si(e,t){return($i(e)?Ct:uo)(e,sa(t,3))}var Pi=wn((function(e,t,r){Le.call(e,r)?e[r].push(t):oo(e,r,[t])})),vi=Yo((function(e,t,r){var n=-1,a="function"==typeof t,i=Hi(e)?o(e.length):[];return co(e,(function(e){i[++n]=a?bt(t,e,r):Mo(e,t,r)})),i})),bi=wn((function(e,t,r){oo(e,r,t)}));function _i(e,t){return($i(e)?Rt:Bo)(e,sa(t,3))}var Ni=wn((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Ci=Yo((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ea(e,t[0],t[1])?t=[]:r>2&&Ea(t[0],t[1],t[2])&&(t=[t[0]]),Go(e,go(t,1),[])})),Oi=lt||function(){return ut.Date.now()};function Ai(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Jn(e,l,n,n,n,n,t)}function Mi(e,t){var r;if("function"!=typeof t)throw new Oe(a);return e=ms(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var wi=Yo((function(e,t,r){var o=1;if(r.length){var n=sr(r,ia(wi));o|=p}return Jn(e,o,t,r,n)})),Ri=Yo((function(e,t,r){var o=3;if(r.length){var n=sr(r,ia(Ri));o|=p}return Jn(t,o,e,r,n)}));function xi(e,t,r){var o,i,s,p,l,c,u=0,y=!1,d=!1,f=!0;if("function"!=typeof e)throw new Oe(a);function m(t){var r=o,a=i;return o=i=n,u=t,p=e.apply(a,r)}function g(e){return u=e,l=wa(E,t),y?m(e):p}function h(e){var r=e-c;return c===n||r>=t||r<0||d&&e-u>=s}function E(){var e=Oi();if(h(e))return T(e);l=wa(E,function(e){var r=t-(e-c);return d?hr(r,s-(e-u)):r}(e))}function T(e){return l=n,f&&o?m(e):(o=i=n,p)}function S(){var e=Oi(),r=h(e);if(o=arguments,i=this,c=e,r){if(l===n)return g(c);if(d)return Pn(l),l=wa(E,t),m(c)}return l===n&&(l=wa(E,t)),p}return t=hs(t)||0,ts(r)&&(y=!!r.leading,s=(d="maxWait"in r)?gr(hs(r.maxWait)||0,t):s,f="trailing"in r?!!r.trailing:f),S.cancel=function(){l!==n&&Pn(l),u=0,o=c=i=l=n},S.flush=function(){return l===n?p:T(Oi())},S}var Li=Yo((function(e,t){return po(e,1,t)})),Ii=Yo((function(e,t,r){return po(e,hs(t)||0,r)}));function Fi(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Oe(a);var r=function(){var o=arguments,n=t?t.apply(this,o):o[0],a=r.cache;if(a.has(n))return a.get(n);var i=e.apply(this,o);return r.cache=a.set(n,i)||a,i};return r.cache=new(Fi.Cache||$r),r}function ki(e){if("function"!=typeof e)throw new Oe(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Fi.Cache=$r;var Bi=Tn((function(e,t){var r=(t=1==t.length&&$i(t[0])?Rt(t[0],Xt(sa())):Rt(go(t,1),Xt(sa()))).length;return Yo((function(o){for(var n=-1,a=hr(o.length,r);++n=t})),Wi=wo(function(){return arguments}())?wo:function(e){return rs(e)&&Le.call(e,"callee")&&!qe.call(e,"callee")},$i=o.isArray,qi=ht?Xt(ht):function(e){return rs(e)&&_o(e)==R};function Hi(e){return null!=e&&es(e.length)&&!Qi(e)}function Yi(e){return rs(e)&&Hi(e)}var Xi=gt||hp,Ji=Et?Xt(Et):function(e){return rs(e)&&_o(e)==E};function Ki(e){if(!rs(e))return!1;var t=_o(e);return t==T||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function Qi(e){if(!ts(e))return!1;var t=_o(e);return t==S||t==P||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zi(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var os=Tt?Xt(Tt):function(e){return rs(e)&&da(e)==v};function ns(e){return"number"==typeof e||rs(e)&&_o(e)==b}function as(e){if(!rs(e)||_o(e)!=_)return!1;var t=We(e);if(null===t)return!0;var r=Le.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&xe.call(r)==Be}var is=St?Xt(St):function(e){return rs(e)&&_o(e)==C},ss=Pt?Xt(Pt):function(e){return rs(e)&&da(e)==O};function ps(e){return"string"==typeof e||!$i(e)&&rs(e)&&_o(e)==A}function ls(e){return"symbol"==typeof e||rs(e)&&_o(e)==M}var cs=vt?Xt(vt):function(e){return rs(e)&&es(e.length)&&!!nt[_o(e)]},us=$n(ko),ys=$n((function(e,t){return e<=t}));function ds(e){if(!e)return[];if(Hi(e))return ps(e)?ur(e):An(e);if(Xe&&e[Xe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Xe]());var t=da(e);return(t==v?ar:t==O?pr:zs)(e)}function fs(e){return e?(e=hs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=fs(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?ao(ms(e),0,d):0}function hs(e){if("number"==typeof e)return e;if(ls(e))return y;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var r=fe.test(e);return r||ge.test(e)?pt(e.slice(2),r?2:8):de.test(e)?y:+e}function Es(e){return Mn(e,Ls(e))}function Ts(e){return null==e?"":pn(e)}var Ss=Rn((function(e,t){if(va(t)||Hi(t))Mn(t,xs(t),e);else for(var r in t)Le.call(t,r)&&Zr(e,r,t[r])})),Ps=Rn((function(e,t){Mn(t,Ls(t),e)})),vs=Rn((function(e,t,r,o){Mn(t,Ls(t),e,o)})),bs=Rn((function(e,t,r,o){Mn(t,xs(t),e,o)})),_s=ta(no),Ns=Yo((function(e,t){e=_e(e);var r=-1,o=t.length,a=o>2?t[2]:n;for(a&&Ea(t[0],t[1],a)&&(o=1);++r1),t})),Mn(e,oa(e),r),o&&(r=io(r,7,Zn));for(var n=t.length;n--;)cn(r,t[n]);return r})),Bs=ta((function(e,t){return null==e?{}:function(e,t){return jo(e,t,(function(t,r){return As(e,r)}))}(e,t)}));function Ds(e,t){if(null==e)return{};var r=Rt(oa(e),(function(e){return[e]}));return t=sa(t),jo(e,r,(function(e,r){return t(e,r[0])}))}var Us=Xn(xs),Vs=Xn(Ls);function zs(e){return null==e?[]:Jt(e,xs(e))}var Gs=Fn((function(e,t,r){return t=t.toLowerCase(),e+(r?js(t):t)}));function js(e){return Ks(Ts(e).toLowerCase())}function Ws(e){return(e=Ts(e))&&e.replace(Ee,tr).replace(Ke,"")}var $s=Fn((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),qs=Fn((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Hs=In("toLowerCase"),Ys=Fn((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Xs=Fn((function(e,t,r){return e+(r?" ":"")+Ks(t)})),Js=Fn((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Ks=In("toUpperCase");function Qs(e,t,r){return e=Ts(e),(t=r?n:t)===n?function(e){return tt.test(e)}(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.match(pe)||[]}(e):e.match(t)||[]}var Zs=Yo((function(e,t){try{return bt(e,n,t)}catch(e){return Ki(e)?e:new Pe(e)}})),ep=ta((function(e,t){return Nt(t,(function(t){t=Da(t),oo(e,t,wi(e[t],e))})),e}));function tp(e){return function(){return e}}var rp=Dn(),op=Dn(!0);function np(e){return e}function ap(e){return Io("function"==typeof e?e:io(e,1))}var ip=Yo((function(e,t){return function(r){return Mo(r,e,t)}})),sp=Yo((function(e,t){return function(r){return Mo(e,r,t)}}));function pp(e,t,r){var o=xs(t),n=Po(t,o);null!=r||ts(t)&&(n.length||!o.length)||(r=t,t=e,e=this,n=Po(t,xs(t)));var a=!(ts(r)&&"chain"in r&&!r.chain),i=Qi(e);return Nt(n,(function(r){var o=t[r];e[r]=o,i&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__),n=r.__actions__=An(this.__actions__);return n.push({func:o,args:arguments,thisArg:e}),r.__chain__=t,r}return o.apply(e,xt([this.value()],arguments))})})),e}function lp(){}var cp=Gn(Rt),up=Gn(Ot),yp=Gn(Ft);function dp(e){return Ta(e)?jt(Da(e)):function(e){return function(t){return vo(t,e)}}(e)}var fp=Wn(),mp=Wn(!0);function gp(){return[]}function hp(){return!1}var Ep,Tp=zn((function(e,t){return e+t}),0),Sp=Hn("ceil"),Pp=zn((function(e,t){return e/t}),1),vp=Hn("floor"),bp=zn((function(e,t){return e*t}),1),_p=Hn("round"),Np=zn((function(e,t){return e-t}),0);return Dr.after=function(e,t){if("function"!=typeof t)throw new Oe(a);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},Dr.ary=Ai,Dr.assign=Ss,Dr.assignIn=Ps,Dr.assignInWith=vs,Dr.assignWith=bs,Dr.at=_s,Dr.before=Mi,Dr.bind=wi,Dr.bindAll=ep,Dr.bindKey=Ri,Dr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $i(e)?e:[e]},Dr.chain=di,Dr.chunk=function(e,t,r){t=(r?Ea(e,t,r):t===n)?1:gr(ms(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var i=0,s=0,p=o(yt(a/t));ia?0:a+r),(o=o===n||o>a?a:ms(o))<0&&(o+=a),o=r>o?0:gs(o);r>>0)?(e=Ts(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=pn(t))&&nr(e)?Sn(ur(e),0,r):e.split(t,r):[]},Dr.spread=function(e,t){if("function"!=typeof e)throw new Oe(a);return t=null==t?0:gr(ms(t),0),Yo((function(r){var o=r[t],n=Sn(r,0,t);return o&&xt(n,o),bt(e,this,n)}))},Dr.tail=function(e){var t=null==e?0:e.length;return t?tn(e,1,t):[]},Dr.take=function(e,t,r){return e&&e.length?tn(e,0,(t=r||t===n?1:ms(t))<0?0:t):[]},Dr.takeRight=function(e,t,r){var o=null==e?0:e.length;return o?tn(e,(t=o-(t=r||t===n?1:ms(t)))<0?0:t,o):[]},Dr.takeRightWhile=function(e,t){return e&&e.length?yn(e,sa(t,3),!1,!0):[]},Dr.takeWhile=function(e,t){return e&&e.length?yn(e,sa(t,3)):[]},Dr.tap=function(e,t){return t(e),e},Dr.throttle=function(e,t,r){var o=!0,n=!0;if("function"!=typeof e)throw new Oe(a);return ts(r)&&(o="leading"in r?!!r.leading:o,n="trailing"in r?!!r.trailing:n),xi(e,t,{leading:o,maxWait:t,trailing:n})},Dr.thru=fi,Dr.toArray=ds,Dr.toPairs=Us,Dr.toPairsIn=Vs,Dr.toPath=function(e){return $i(e)?Rt(e,Da):ls(e)?[e]:An(Ba(Ts(e)))},Dr.toPlainObject=Es,Dr.transform=function(e,t,r){var o=$i(e),n=o||Xi(e)||cs(e);if(t=sa(t,4),null==r){var a=e&&e.constructor;r=n?o?new a:[]:ts(e)&&Qi(a)?Ur(We(e)):{}}return(n?Nt:To)(e,(function(e,o,n){return t(r,e,o,n)})),r},Dr.unary=function(e){return Ai(e,1)},Dr.union=ri,Dr.unionBy=oi,Dr.unionWith=ni,Dr.uniq=function(e){return e&&e.length?ln(e):[]},Dr.uniqBy=function(e,t){return e&&e.length?ln(e,sa(t,2)):[]},Dr.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ln(e,n,t):[]},Dr.unset=function(e,t){return null==e||cn(e,t)},Dr.unzip=ai,Dr.unzipWith=ii,Dr.update=function(e,t,r){return null==e?e:un(e,t,hn(r))},Dr.updateWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:un(e,t,hn(r),o)},Dr.values=zs,Dr.valuesIn=function(e){return null==e?[]:Jt(e,Ls(e))},Dr.without=si,Dr.words=Qs,Dr.wrap=function(e,t){return Di(hn(t),e)},Dr.xor=pi,Dr.xorBy=li,Dr.xorWith=ci,Dr.zip=ui,Dr.zipObject=function(e,t){return mn(e||[],t||[],Zr)},Dr.zipObjectDeep=function(e,t){return mn(e||[],t||[],Ko)},Dr.zipWith=yi,Dr.entries=Us,Dr.entriesIn=Vs,Dr.extend=Ps,Dr.extendWith=vs,pp(Dr,Dr),Dr.add=Tp,Dr.attempt=Zs,Dr.camelCase=Gs,Dr.capitalize=js,Dr.ceil=Sp,Dr.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=hs(r))==r?r:0),t!==n&&(t=(t=hs(t))==t?t:0),ao(hs(e),t,r)},Dr.clone=function(e){return io(e,4)},Dr.cloneDeep=function(e){return io(e,5)},Dr.cloneDeepWith=function(e,t){return io(e,5,t="function"==typeof t?t:n)},Dr.cloneWith=function(e,t){return io(e,4,t="function"==typeof t?t:n)},Dr.conformsTo=function(e,t){return null==t||so(e,t,xs(t))},Dr.deburr=Ws,Dr.defaultTo=function(e,t){return null==e||e!=e?t:e},Dr.divide=Pp,Dr.endsWith=function(e,t,r){e=Ts(e),t=pn(t);var o=e.length,a=r=r===n?o:ao(ms(r),0,o);return(r-=t.length)>=0&&e.slice(r,a)==t},Dr.eq=zi,Dr.escape=function(e){return(e=Ts(e))&&Y.test(e)?e.replace(q,rr):e},Dr.escapeRegExp=function(e){return(e=Ts(e))&&re.test(e)?e.replace(te,"\\$&"):e},Dr.every=function(e,t,r){var o=$i(e)?Ot:yo;return r&&Ea(e,t,r)&&(t=n),o(e,sa(t,3))},Dr.find=hi,Dr.findIndex=Wa,Dr.findKey=function(e,t){return Bt(e,sa(t,3),To)},Dr.findLast=Ei,Dr.findLastIndex=$a,Dr.findLastKey=function(e,t){return Bt(e,sa(t,3),So)},Dr.floor=vp,Dr.forEach=Ti,Dr.forEachRight=Si,Dr.forIn=function(e,t){return null==e?e:ho(e,sa(t,3),Ls)},Dr.forInRight=function(e,t){return null==e?e:Eo(e,sa(t,3),Ls)},Dr.forOwn=function(e,t){return e&&To(e,sa(t,3))},Dr.forOwnRight=function(e,t){return e&&So(e,sa(t,3))},Dr.get=Os,Dr.gt=Gi,Dr.gte=ji,Dr.has=function(e,t){return null!=e&&fa(e,t,Co)},Dr.hasIn=As,Dr.head=Ha,Dr.identity=np,Dr.includes=function(e,t,r,o){e=Hi(e)?e:zs(e),r=r&&!o?ms(r):0;var n=e.length;return r<0&&(r=gr(n+r,0)),ps(e)?r<=n&&e.indexOf(t,r)>-1:!!n&&Ut(e,t,r)>-1},Dr.indexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var n=null==r?0:ms(r);return n<0&&(n=gr(o+n,0)),Ut(e,t,n)},Dr.inRange=function(e,t,r){return t=fs(t),r===n?(r=t,t=0):r=fs(r),function(e,t,r){return e>=hr(t,r)&&e=-9007199254740991&&e<=u},Dr.isSet=ss,Dr.isString=ps,Dr.isSymbol=ls,Dr.isTypedArray=cs,Dr.isUndefined=function(e){return e===n},Dr.isWeakMap=function(e){return rs(e)&&da(e)==w},Dr.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==_o(e)},Dr.join=function(e,t){return null==e?"":Wt.call(e,t)},Dr.kebabCase=$s,Dr.last=Ka,Dr.lastIndexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var a=o;return r!==n&&(a=(a=ms(r))<0?gr(o+a,0):hr(a,o-1)),t==t?function(e,t,r){for(var o=r+1;o--;)if(e[o]===t)return o;return o}(e,t,a):Dt(e,zt,a,!0)},Dr.lowerCase=qs,Dr.lowerFirst=Hs,Dr.lt=us,Dr.lte=ys,Dr.max=function(e){return e&&e.length?fo(e,np,No):n},Dr.maxBy=function(e,t){return e&&e.length?fo(e,sa(t,2),No):n},Dr.mean=function(e){return Gt(e,np)},Dr.meanBy=function(e,t){return Gt(e,sa(t,2))},Dr.min=function(e){return e&&e.length?fo(e,np,ko):n},Dr.minBy=function(e,t){return e&&e.length?fo(e,sa(t,2),ko):n},Dr.stubArray=gp,Dr.stubFalse=hp,Dr.stubObject=function(){return{}},Dr.stubString=function(){return""},Dr.stubTrue=function(){return!0},Dr.multiply=bp,Dr.nth=function(e,t){return e&&e.length?zo(e,ms(t)):n},Dr.noConflict=function(){return ut._===this&&(ut._=De),this},Dr.noop=lp,Dr.now=Oi,Dr.pad=function(e,t,r){e=Ts(e);var o=(t=ms(t))?cr(e):0;if(!t||o>=t)return e;var n=(t-o)/2;return jn(dt(n),r)+e+jn(yt(n),r)},Dr.padEnd=function(e,t,r){e=Ts(e);var o=(t=ms(t))?cr(e):0;return t&&ot){var o=e;e=t,t=o}if(r||e%1||t%1){var a=Sr();return hr(e+a*(t-e+st("1e-"+((a+"").length-1))),t)}return qo(e,t)},Dr.reduce=function(e,t,r){var o=$i(e)?Lt:$t,n=arguments.length<3;return o(e,sa(t,4),r,n,co)},Dr.reduceRight=function(e,t,r){var o=$i(e)?It:$t,n=arguments.length<3;return o(e,sa(t,4),r,n,uo)},Dr.repeat=function(e,t,r){return t=(r?Ea(e,t,r):t===n)?1:ms(t),Ho(Ts(e),t)},Dr.replace=function(){var e=arguments,t=Ts(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dr.result=function(e,t,r){var o=-1,a=(t=En(t,e)).length;for(a||(a=1,e=n);++ou)return[];var r=d,o=hr(e,d);t=sa(t),e-=d;for(var n=Ht(o,t);++r=i)return e;var p=r-cr(o);if(p<1)return o;var l=s?Sn(s,0,p).join(""):e.slice(0,p);if(a===n)return l+o;if(s&&(p+=l.length-p),is(a)){if(e.slice(p).search(a)){var c,u=l;for(a.global||(a=Ne(a.source,Ts(ye.exec(a))+"g")),a.lastIndex=0;c=a.exec(u);)var y=c.index;l=l.slice(0,y===n?p:y)}}else if(e.indexOf(pn(a),p)!=p){var d=l.lastIndexOf(a);d>-1&&(l=l.slice(0,d))}return l+o},Dr.unescape=function(e){return(e=Ts(e))&&H.test(e)?e.replace($,dr):e},Dr.uniqueId=function(e){var t=++Ie;return Ts(e)+t},Dr.upperCase=Js,Dr.upperFirst=Ks,Dr.each=Ti,Dr.eachRight=Si,Dr.first=Ha,pp(Dr,(Ep={},To(Dr,(function(e,t){Le.call(Dr.prototype,t)||(Ep[t]=e)})),Ep),{chain:!1}),Dr.VERSION="4.17.21",Nt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Dr[e].placeholder=Dr})),Nt(["drop","take"],(function(e,t){Gr.prototype[e]=function(r){r=r===n?1:gr(ms(r),0);var o=this.__filtered__&&!t?new Gr(this):this.clone();return o.__filtered__?o.__takeCount__=hr(r,o.__takeCount__):o.__views__.push({size:hr(r,d),type:e+(o.__dir__<0?"Right":"")}),o},Gr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Nt(["filter","map","takeWhile"],(function(e,t){var r=t+1,o=1==r||3==r;Gr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:sa(e,3),type:r}),t.__filtered__=t.__filtered__||o,t}})),Nt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Gr.prototype[e]=function(){return this[r](1).value()[0]}})),Nt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Gr.prototype[e]=function(){return this.__filtered__?new Gr(this):this[r](1)}})),Gr.prototype.compact=function(){return this.filter(np)},Gr.prototype.find=function(e){return this.filter(e).head()},Gr.prototype.findLast=function(e){return this.reverse().find(e)},Gr.prototype.invokeMap=Yo((function(e,t){return"function"==typeof e?new Gr(this):this.map((function(r){return Mo(r,e,t)}))})),Gr.prototype.reject=function(e){return this.filter(ki(sa(e)))},Gr.prototype.slice=function(e,t){e=ms(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Gr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ms(t))<0?r.dropRight(-t):r.take(t-e)),r)},Gr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gr.prototype.toArray=function(){return this.take(d)},To(Gr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),a=Dr[o?"take"+("last"==t?"Right":""):t],i=o||/^find/.test(t);a&&(Dr.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,p=t instanceof Gr,l=s[0],c=p||$i(t),u=function(e){var t=a.apply(Dr,xt([e],s));return o&&y?t[0]:t};c&&r&&"function"==typeof l&&1!=l.length&&(p=c=!1);var y=this.__chain__,d=!!this.__actions__.length,f=i&&!y,m=p&&!d;if(!i&&c){t=m?t:new Gr(this);var g=e.apply(t,s);return g.__actions__.push({func:fi,args:[u],thisArg:n}),new zr(g,y)}return f&&m?e.apply(this,s):(g=this.thru(u),f?o?g.value()[0]:g.value():g)})})),Nt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ae[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);Dr.prototype[e]=function(){var e=arguments;if(o&&!this.__chain__){var n=this.value();return t.apply($i(n)?n:[],e)}return this[r]((function(r){return t.apply($i(r)?r:[],e)}))}})),To(Gr.prototype,(function(e,t){var r=Dr[t];if(r){var o=r.name+"";Le.call(Mr,o)||(Mr[o]=[]),Mr[o].push({name:t,func:r})}})),Mr[Un(n,2).name]=[{name:"wrapper",func:n}],Gr.prototype.clone=function(){var e=new Gr(this.__wrapped__);return e.__actions__=An(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=An(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=An(this.__views__),e},Gr.prototype.reverse=function(){if(this.__filtered__){var e=new Gr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=$i(e),o=t<0,n=r?e.length:0,a=function(e,t,r){for(var o=-1,n=r.length;++o=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Dr.prototype.plant=function(e){for(var t,r=this;r instanceof Vr;){var o=Va(r);o.__index__=0,o.__values__=n,t?a.__wrapped__=o:t=o;var a=o;r=r.__wrapped__}return a.__wrapped__=e,t},Dr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gr){var t=e;return this.__actions__.length&&(t=new Gr(this)),(t=t.reverse()).__actions__.push({func:fi,args:[ti],thisArg:n}),new zr(t,this.__chain__)}return this.thru(ti)},Dr.prototype.toJSON=Dr.prototype.valueOf=Dr.prototype.value=function(){return dn(this.__wrapped__,this.__actions__)},Dr.prototype.first=Dr.prototype.head,Xe&&(Dr.prototype[Xe]=function(){return this}),Dr}();ut._=fr,(o=function(){return fr}.call(t,r,t,e))===n||(e.exports=o)}.call(this)},6483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSourceCode=t.visualVersion=void 0;const o=r(7977),n=r(2891),a=r(3784);t.visualVersion=12,t.parseSourceCode=function(e,r){var i;try{(0,o.deserialize)(e);const a=(0,n.getInstance)().document.VisualVersion,i=/^([1-9]+[0-9]*)$/;if(void 0===a)r.errorType="versionError";else{const e=a.match(i);(null===e||parseInt(e[1])>t.visualVersion)&&(r.errorType="versionError")}}catch(e){r.errorType="fileError"}""!==r.errorType&&(r.errorMessage=null!==(i=a.errorMap.get(r.errorType))&&void 0!==i?i:"Codegen visual file failed")}},904:(e,t)=>{"use strict";var r;let o;Object.defineProperty(t,"__esModule",{value:!0}),t.setDomain=t.getDomain=t.Domain=void 0,function(e){e[e.FA=0]="FA",e[e.FORM=1]="FORM",e[e.ETS=2]="ETS"}(r||(r={})),t.Domain=r,t.setDomain=e=>{o=e},t.getDomain=()=>null!=o?o:r.FA},3784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMap=void 0,t.errorMap=new Map([["fileError","Visual file is damaged"],["versionError","Version number of visual file does not match"],["modelError","Visual model in visual file is damaged"],["codegenError","Codegen visual file failed"]])},4117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNode=void 0,t.ASTNode=class{accept(e){return e.visit(this)}}},1862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0,t.Cache=class{constructor(e,t=0){this.value="",this.indent=t,this.flag=!0,this.INDENT=e}indentOn(){this.flag=!0}indentOff(){this.flag=!1}incIndent(){this.indent++}decIndent(){this.indent--}checkIndent(){return this.indent<0}getIndents(){if(this.flag){let e="";for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const o=r(4117);class n extends o.ASTNode{constructor(e,t,r,o,n){super(),this.builders=new Map,this.defaultValue=new Map,this.mediaParams=new Map,this.mediaProperties=new Map,this.mediaKeyProperty=new Map,this.tagName=e,this.params=t,this.content=r,this.properties=o,this.forEachObj=n,this.ifBoolean=null,this.isCustomTag=!1}setMediaParams(e){this.mediaParams=e}setParams(e){this.params=e}setIfBoolean(e){this.ifBoolean=e}setTagName(e){this.tagName=e}setForEachObj(e){this.forEachObj=e}setMediaProperty(e,t){t.forEach(((t,r)=>{var o;this.mediaKeyProperty.has(r)||this.mediaKeyProperty.set(r,new Map),null===(o=this.mediaKeyProperty.get(r))||void 0===o||o.set(e,t)}))}setDefaultValue(e,t,r="undefined",o=""){this.defaultValue.set(e,[r,t,o])}}t.Tag=n},5623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASTNodeGenerator=void 0;const o=r(9519),n=r(1862),a=r(5051),i=r(4294),s=r(6486),p=r(9459);class l{constructor(e){this.cache=e,this.etsImport=new n.Cache(" ",0),this.etsVariable=new n.Cache(" ",1),this.etsFunction=new n.Cache(" ",1),this.etsBuilder=new n.Cache(" ",1),this.aboutToAppear=new n.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}visit(e){e instanceof o.Tag&&(e.isCustomTag?this.genCustomTag(e):(this.needMediaQuery&&this.genMediaQuery(e),this.genTag(e)))}static getMethodGen(e){return void 0===l.instance?l.instance=new l(e):l.instance.setCache(e),l.instance}setCache(e){this.cache=e,this.etsImport=new n.Cache(" ",0),this.etsVariable=new n.Cache(" ",1),this.etsFunction=new n.Cache(" ",1),this.etsBuilder=new n.Cache(" ",1),this.aboutToAppear=new n.Cache(" ",2),this.needMediaQuery=!0,this.customComponents=new Set}genParams(e){const t=this.getParams(e);this.isCustomComponent(e)?this.genCustomParams(t):this.genCommonParams(t)}genCommonParams(e){if("string"==typeof e)this.cache.concat(e);else if(e.size>0){this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE);let t=0;e.forEach(((r,o)=>{this.cache.concat(o,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(t,a.TokenClass.COLON,a.TokenClass.SPACE,e,a.TokenClass.COMMA)})),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genObjectProperty(e){let t=0;this.cache.concat(a.TokenClass.LBRA,a.TokenClass.SPACE),e.forEach(((r,o)=>{this.cache.concat(o,a.TokenClass.COLON,a.TokenClass.SPACE,r),t++,t{e.accept(this),this.cache.indentOff(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn()})),this.cache.decIndent(),this.cache.indentOn()),this.cache.indentOn(),this.cache.concat(a.TokenClass.RBRA)),(null!==e.properties||null!==e.mediaProperties)&&(null!==e.content&&0!==e.content.length||this.cache.incIndent(),this.getProperties(e).forEach(((e,t)=>{this.cache.concat(a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.PROPERTY_START,t,a.TokenClass.TAG_START),this.cache.indentOff(),"string"==typeof e?this.cache.concat(e,a.TokenClass.TAG_END):this.genObjectProperty(e)})),null!==e.content&&0!==e.content.length||this.cache.decIndent()),this.genEnd(e),this.genBuildersFunction(e)}genStart(e){this.genIfStart(e),this.genForTagStart(e),this.genCustomImport(e)}genEnd(e){this.genForTagEnd(e),this.genIfEnd(e)}genForTagStart(e){var t;void 0!==(null===(t=e.forEachObj)||void 0===t?void 0:t.for)&&(this.cache.concat("ForEach",a.TokenClass.TAG_START,e.forEachObj.for.toString(),a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE))}genForTagEnd(e){null!==e.forEachObj&&(this.cache.concat(a.TokenClass.RBRA),void 0!==e.forEachObj.key&&""!==e.forEachObj.key&&(this.cache.concat(a.TokenClass.COMMA,a.TokenClass.NEW_LINE),this.cache.indentOn(),this.cache.concat(a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COLON," any",a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.COLON," number",a.TokenClass.TAG_END," => ",a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.concat("return ",e.forEachObj.key.toString(),a.TokenClass.TAG_START,e.forEachObj.item,a.TokenClass.COMMA," ",e.forEachObj.idx,a.TokenClass.TAG_END,a.TokenClass.RBRA),this.cache.indentOff()),this.cache.concat(a.TokenClass.TAG_END))}genIfStart(e){null!==e.ifBoolean&&(this.cache.concat("if",a.TokenClass.SPACE,a.TokenClass.TAG_START,e.ifBoolean.toString(),a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.cache.incIndent())}genIfEnd(e){null!==e.ifBoolean&&(this.cache.indentOn(),this.cache.decIndent(),this.cache.concat(a.TokenClass.NEW_LINE),this.cache.concat(a.TokenClass.RBRA),this.cache.indentOff())}genMediaQuery(e){const t=new Map,r=new Map;if(this.collectMediaQueryMap(e,t),this.collectDefaultValueMap(e,r),0===t.size&&0===r.size)return;const o=(0,i.getUniqueName)("mediaQuery"),s=(0,i.getUniqueName)("initForMediaQuery"),p=(0,i.getUniqueName)("mediaQueryCb"),l=(0,i.getUniqueName)("saveMediaQueryResult"),c=(0,i.getUniqueName)("updateForMediaQuery"),u=new n.Cache(a.TokenClass.INDENT,1),y=new n.Cache(a.TokenClass.INDENT,1),d=new n.Cache(a.TokenClass.INDENT,1),f=new n.Cache(a.TokenClass.INDENT,1),m=new n.Cache(a.TokenClass.INDENT,1),g=new n.Cache(a.TokenClass.INDENT,1),h=new n.Cache(a.TokenClass.INDENT,1),E=new n.Cache(a.TokenClass.INDENT,2);this.genVariableDeclare(r,u,a.TokenClass.UNDEFINED),this.genMediaQueryCb(p,y),this.genMediaQueryListener(t,d,f),this.genInitFuc(s,r,m),this.genMediaQueryCbFnc(l,c,t,g),this.genUpdateFnc(c,s,t,h),this.genAboutToAppear(p,l,t,E),this.etsImport.indentOff(),this.aboutToAppear.indentOff(),this.etsVariable.indentOff(),this.etsFunction.indentOff(),this.etsImport.indentOff(),this.etsImport.concat("import ",o," from '@ohos.mediaquery'",a.TokenClass.NEW_LINE),this.aboutToAppear.concat(E.toString()),this.etsVariable.concat(u.toString(),y.toString(),d.toString(),f.toString()),this.etsFunction.concat(g.toString(),a.TokenClass.NEW_LINE,m.toString(),a.TokenClass.NEW_LINE,h.toString()),this.etsImport.indentOn(),this.aboutToAppear.indentOn(),this.etsVariable.indentOn(),this.etsFunction.indentOn(),this.needMediaQuery=!1}genBuildersFunction(e){e.builders.forEach(((e,t)=>{this.etsBuilder.indentOff(),this.etsBuilder.concat(a.TokenClass.NEW_LINE),this.etsBuilder.indentOn(),this.etsBuilder.concat(a.TokenClass.DECORATOR_Builder,a.TokenClass.SPACE,t,a.TokenClass.TAG_START,a.TokenClass.TAG_END),this.etsBuilder.indentOff();const r=(0,p.genBuilderEts)(e);this.etsBuilder.concat(a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),this.etsBuilder.indentOn(),this.etsBuilder.concat(r.cache.toString(),a.TokenClass.NEW_LINE),this.etsBuilder.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE),this.etsBuilder.indentOff(),this.etsBuilder.concat(r.etsBuilder.toString())}))}genCustomTag(e){this.genVariableDeclare(e.defaultValue,this.cache)}genVariableDeclare(e,t,r){t.indentOn(),e.forEach(((e,o)=>{const n=e[2];""!==n&&(t.concat(n,a.TokenClass.SPACE),t.indentOff()),t.concat(o.slice(5),a.TokenClass.COLON,a.TokenClass.SPACE,e[1]),t.indentOff();const i=null!=r?r:e[0];null!=i&&t.concat(a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,i),t.concat(a.TokenClass.NEW_LINE),t.indentOn()}))}genMediaQueryCb(e,t){t.concat(e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.NULL,a.TokenClass.NEW_LINE)}genMediaQueryListener(e,t,r){const o=(0,i.getUniqueName)("mediaQuery");e.forEach(((e,n)=>{const s=(0,i.getUniqueName)(this.getMediaQueryVariableName(n));t.concat(s,a.TokenClass.COLON,a.TokenClass.SPACE,a.TokenClass.BOOLEAN,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.FALSE,a.TokenClass.NEW_LINE),r.concat(`listener_${s}`,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,o,a.TokenClass.PROPERTY_START,"matchMediaSync",a.TokenClass.TAG_START,`'${n}'`,a.TokenClass.TAG_END,a.TokenClass.NEW_LINE)}))}genInitFuc(e,t,r){r.concat(e,a.TokenClass.TAG_START,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),r.indentOn(),r.incIndent(),t.forEach(((e,t)=>{r.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e[0],a.TokenClass.NEW_LINE)})),r.decIndent(),r.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genMediaQueryCbFnc(e,t,r,o){const n=Array.from(r.entries()),s="mediaQueryResult";o.concat(e,a.TokenClass.TAG_START,s,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent(),o.concat(a.TokenClass.SWITCH,a.TokenClass.SPACE,a.TokenClass.TAG_START,`${s}.media`,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent();for(let e=0;e{const r=(0,i.getUniqueName)(this.getMediaQueryVariableName(t));o.concat(a.TokenClass.IF,a.TokenClass.SPACE,a.TokenClass.TAG_START,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,r,a.TokenClass.TAG_END,a.TokenClass.SPACE,a.TokenClass.LBRA,a.TokenClass.NEW_LINE),o.incIndent(),e.forEach(((e,t)=>{o.concat(t,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,e,a.TokenClass.NEW_LINE)})),o.decIndent(),o.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)})),o.decIndent(),o.concat(a.TokenClass.RBRA,a.TokenClass.NEW_LINE)}genAboutToAppear(e,t,r,o){let n=1;o.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,e,a.TokenClass.SPACE,a.TokenClass.ASSIGN,a.TokenClass.SPACE,a.TokenClass.THIS,a.TokenClass.PROPERTY_START,`${t}.bind(this)`,a.TokenClass.NEW_LINE),r.forEach(((t,s)=>{const p=`listener_${(0,i.getUniqueName)(this.getMediaQueryVariableName(s))}`;o.indentOn(),o.concat(a.TokenClass.THIS,a.TokenClass.PROPERTY_START,p,a.TokenClass.PROPERTY_START,`on('change', this.${e})`),n0&&e.mediaParams.forEach(((e,r)=>{t.set(r,e)})),t}getProperties(e){const t=new Map;return e.properties.forEach(((e,r)=>{t.set(r,e)})),e.mediaProperties.forEach(((e,r)=>{t.set(r,e)})),t}collectDefaultValueMap(e,t){void 0!==e.defaultValue&&e.defaultValue.forEach(((e,r)=>{t.set(r,e)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectDefaultValueMap(e,t)}))}collectMediaQueryMap(e,t){void 0!==e.mediaKeyProperty&&e.mediaKeyProperty.forEach(((e,r)=>{var o;const n=null!==(o=t.get(r))&&void 0!==o?o:new Map;e.forEach(((e,t)=>{n.set(t,e)})),t.set(r,n)})),null!==e.content&&0!==e.content.length&&e.content.forEach((e=>{this.collectMediaQueryMap(e,t)}))}getMediaQueryVariableName(e){const t="device-type: ",r="orientation: ",o=e.substring(e.indexOf(t),e.length),n=o.substring(t.length,o.indexOf(")")),a=e.substring(e.indexOf(r),e.length),i=a.substring(r.length,a.indexOf(")"));return`${n}${i.slice(0,1).toUpperCase()+i.slice(1).toLowerCase()}`}}t.ASTNodeGenerator=l,l.instance=void 0},8413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ETSBridge=void 0;const o=r(9519),n=r(1912),a=r(3729),i=r(6125),s=r(366),p=r(7893);t.ETSBridge=class{constructor(){this.errors=0}error(e){console.error("Code generating error: "+e),this.errors+=1}getErrorCount(){return this.errors}visit(e){const t=new Map;let r=null;const l=new Map,c=new o.Tag(e.type,t,r,l,null);if((0,n.parseVisualModel)(e,c),(0,a.parseMediaVisualModel)(e,c),(0,i.parseCustomVisualModel)(e,c),(0,s.parseCustomMediaVisualModel)(e,c),(0,p.parseBuildersVisualModel)(e,c,this),e.children.length>0){r=[];for(const t of e.children)r.push(t.accept(this))}return c.content=r,c}}},9459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genBuilderEts=t.genCustomEts=t.genETS=t.EMPTY=void 0;const o=r(5623),n=r(1862);t.EMPTY={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""},t.genETS=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" ",2));return e.accept(t),{build:t.cache.toString(),etsImport:t.etsImport.toString(),etsVariable:t.etsVariable.toString(),etsFunction:t.etsFunction.toString().concat(t.etsBuilder.toString()),aboutToAppear:t.aboutToAppear.toString()}},t.genCustomEts=function(e){const t=o.ASTNodeGenerator.getMethodGen(new n.Cache(" ",1));return e.accept(t),t.cache.toString()},t.genBuilderEts=function(e){const t=new o.ASTNodeGenerator(new n.Cache(" ",1));return e.accept(t),t}},4435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;const o=r(9459);t.StringWriter=class{genETS(e){return(0,o.genETS)(e)}}},5051:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClass=void 0,(r=t.TokenClass||(t.TokenClass={}))[r.IDENTIFIER=0]="IDENTIFIER",r[r.STRING_LITERAL=1]="STRING_LITERAL",r[r.NUMBER=2]="NUMBER",r[r.CHARACTER=3]="CHARACTER",r[r.EOF=4]="EOF",r[r.INVALID=5]="INVALID",r.EMPTY_DATA="empty",r.ASSIGN="=",r.INDENT=" ",r.NEW_LINE="\n",r.CARRIAGE_RETURN="\r",r.SPACE=" ",r.LQUOTE="'",r.RQUOTE="'",r.TAG_START="(",r.TAG_END=")",r.EMPTY_TAG_END="/>",r.END_TAG_START="{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDynamicValueByDecorator=t.getMediaVariableDecorator=t.getCustomAttrType=t.getCustomAttributeMap=t.setCustomAttribute=void 0;const o=r(2891),n=new Map;function a(){return n}function i(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.decorator)&&void 0!==r?r:"normal"}t.setCustomAttribute=function(e){var t,r;const a=e.type;(null!==(r=null===(t=(0,o.getInstance)().customData)||void 0===t?void 0:t.property.get(a))&&void 0!==r?r:new Map).forEach(((e,t)=>{const r=`${t}-${a.replace(/\//g,"-")}`;n.set(r,e)}))},t.getCustomAttributeMap=a,t.getCustomAttrType=function(e){var t,r;return null!==(r=null===(t=a().get(e))||void 0===t?void 0:t.type)&&void 0!==r?r:""},t.getMediaVariableDecorator=function(e){const t=i(e);let r="";return"@Link"!==t&&"@Prop"!==t||(r="@State"),r},t.getDynamicValueByDecorator=function(e,t){let r=t;return"@Link"===i(e)&&(r=t.replace("this.","$")),r}},6125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumParserMap=t.genCustomEvent=t.parseCustomVisualModel=void 0;const o=r(2891),n=r(3135),a=r(1195),i=r(8122),s=r(1790);function p(e,t){if(!(t.params instanceof Map))return;const r=function(e){var t,r;const n=e.type;return[...null!==(r=null===(t=(0,o.getInstance)().customData)||void 0===t?void 0:t.event.get(n))&&void 0!==r?r:[]]}(e);for(const o of r){const r=e.property.get(o);void 0!==r&&""!==r&&("this"===r.split(".")[0]?t.params.set(o,r+".bind(this)"):t.params.set(o,r))}}t.parseCustomVisualModel=function(e,r){(0,a.setCustomAttribute)(e),(0,a.getCustomAttributeMap)().forEach(((o,n)=>{if(function(e,t){return e.property.has(t)||e.dynamicProperty.has(t)}(e,n)){const a=c.get(o.type);"function"==typeof a&&a(n,e,r);const s=t.enumParserMap.get(o.type);"function"==typeof s&&function(e,t,r,o){if((0,i.dynamicParamParser)(e,t,r))return;const n=t.property.get(e);!(0,i.isEmptyOrUndefined)(n)&&r.params instanceof Map&&r.params.set((0,i.getEtsPropName)(e),o(n))}(n,e,r,s)}})),p(e,r)},t.genCustomEvent=p;const l=(0,i.curry)(i.getEtsEnumValue),c=new Map([["string",i.stringParamParser],["boolean",i.rawDataParamParser],["number",i.rawDataParamParser],["any[]",i.rawDataParamParser],["object",i.rawDataParamParser],["Date",function(e,t,r){(0,i.dateParamParser)(e,(0,i.getEtsPropName)(e),t,r)}]]);t.enumParserMap=new Map([["Alignment",function(e){const t=(0,i.getBackgroundImagePositionEnumValue)(e);return""!==t?t:(0,i.getEtsEnumValue)("Alignment.",e)}],["Direction",l("Direction.")],["ItemAlign",i.dealWithAlignSelf],["BorderStyle",l("BorderStyle.")],["ImageRepeat",i.dealWithBackgroundRepeat],["ImageSize",l("ImageSize.")],["Visibility",l("Visibility.")],["FontStyle",l("FontStyle.")],["FontWeight",i.dealWithFontWeight],["ButtonType",l("ButtonType.")],["Color",l("Color.")],["LineCapStyle",l("LineCapStyle.")],["ImageFit",l("ImageFit.")],["ImageInterpolation",l("ImageInterpolation.")],["ImageRenderMode",l("ImageRenderMode.")],["ProgressStyle",l("ProgressStyle.")],["SliderStyle",l("SliderStyle.")],["TextAlign",l("TextAlign.")],["TextOverflow",l("TextOverflow.")],["TextDecorationType",l("TextDecorationType.")],["TextCase",l("TextCase.")],["HorizontalAlign",s.dealWithColumnAlignItems],["FlexAlign",n.dealWithJustifyAlignContent],["VerticalAlign",s.dealWithRowAlignItems],["FlexDirection",l("FlexDirection.")],["FlexWrap",i.dealWithWrap],["Axis",l("Axis.")],["EdgeEffect",l("EdgeEffect.")],["Sticky",l("Sticky.")],["EnterKeyType",l("EnterKeyType.")],["ToggleType",l("ToggleType.")],["InputType",l("InputType.")],["ScrollDirection",l("ScrollDirection.")],["EdgeEffect",l("EdgeEffect.")],["GridDirection",l("GridDirection.")],["BarState",l("BarState.")],["NavigationTitleMode",l("NavigationTitleMode.")],["CopyOption",l("CopyOption.")],["BarPosition",l("BarPosition.")],["BarMode",l("BarMode.")]])},9223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonMediaParserArray=t.ifParser=t.forEachParser=void 0;const o=r(6282),n=r(8122),a=r(9248),i=(0,n.curry)(((e,t)=>t.hasMediaProperty(e)));function s(e,t,r){var o,a,i,s;const p=null!==(o=e.property.get("left"))&&void 0!==o?o:e.dynamicProperty.get("left"),l=null!==(a=e.property.get("top"))&&void 0!==a?a:e.dynamicProperty.get("top"),c=t.get("left"),u=t.get("top"),y=r.get("left"),d=r.get("top");let f="undefined",m="undefined";return(0,n.isEmptyOrUndefined)(c)&&(0,n.isEmptyOrUndefined)(u)||(f=(0,n.quoteString)(null!==(i=null!=c?c:p)&&void 0!==i?i:"0"),m=(0,n.quoteString)(null!==(s=null!=u?u:l)&&void 0!==s?s:"0")),(0,n.isEmptyOrUndefined)(y)&&(0,n.isEmptyOrUndefined)(d)||(f=null!=y?y:f,m=null!=d?d:m),{leftValue:f,topValue:m}}function p(e,t){e.forEach(((e,r)=>{"undefined"!==e&&t.set(r,"undefined")}))}function l(e,t){var r,o;const a=new Map,i=t.split("-")[0];return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((r,o)=>{var s,p,l,c;const u=r.get(i),y=null===(p=null===(s=e.dynamicMediaProperty)||void 0===s?void 0:s.get(o))||void 0===p?void 0:p.get(i),d=null!==(c=null!==(l=r.get(t))&&void 0!==l?l:y)&&void 0!==c?c:u;void 0!==d&&a.set(o,(0,n.quoteString)(d))})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{var o;const n=e.get(i),s=null!==(o=e.get(t))&&void 0!==o?o:n;void 0!==s&&a.set(r,s)})),a}const c=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.quoteString);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.quoteString),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),u=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),y=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)})),d=(0,n.curry)(((e,t,r,a)=>{const i=(0,o.getMediaProperty)(r,e,(0,n.curry)(n.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,n.curry)(n.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);a.setDefaultValue(p,(0,o.getType)(e),s),a.setMediaProperty(p,i),a.mediaProperties.set((0,n.getEtsPropName)(e),p)})),f=(0,n.curry)(((e,t,r)=>{const a=(0,o.getMediaProperty)(t,e,n.dealWithColor);if(0===a.size)return;const i=(0,o.getMediaDefaultValue)(t,e,n.dealWithColor),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,a),r.mediaProperties.set((0,n.getEtsPropName)(e),s)}));function m(e,t,r,o=!1){(0,n.isEmptyOrUndefined)(t)||r.set(e,o?t:(0,n.quoteString)(t))}t.forEachParser=function(e,t){var r,n,a;const i=null!==(r=e.dynamicProperty.get("for"))&&void 0!==r?r:"[1]",s=null!==(n=e.property.get("item"))&&void 0!==n?n:"item",p=null!==(a=e.property.get("idx"))&&void 0!==a?a:"idx",l=e.dynamicProperty.get("keyGenerator"),c=(0,o.getMediaProperty)(e,"for");if(0===c.size)return;const u=(0,o.getVariableName)(e.id,"for"),y={for:u,key:l,item:s,idx:p};t.setDefaultValue(u,(0,o.getType)("for"),i),t.setMediaProperty(u,c),t.setForEachObj(y)},t.ifParser=function(e,t){const r=(0,o.getMediaProperty)(e,"if");if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"if"),a=(0,o.getVariableName)(e.id,"if");t.setDefaultValue(a,(0,o.getType)("if"),n),t.setMediaProperty(a,r),t.setIfBoolean(a)};const g=(0,n.curry)(((e,t,r)=>{const a=new Map,i=t.property.get(e),s=t.dynamicProperty.get(e),p=null!=s?s:i,c=["top","bottom","left","right"];let u=0;for(const i of c){const s=`${e}-${i}`,c=t.property.get(s),y=t.dynamicProperty.get(s),d=l(t,s);let f=(0,n.isEmptyOrUndefined)(p)?"undefined":(0,n.quoteString)(p);if((0,n.isEmptyOrUndefined)(c)||(f=(0,n.quoteString)(c)),(0,n.isEmptyOrUndefined)(y)||(f=y),d.size>0){const e=(0,o.getVariableName)(t.id,s);r.setDefaultValue(e,(0,o.getType)(s),f),r.setMediaProperty(e,d),m(i,e,a,!0),u++}else m(i,f,a,!0)}u>0&&r.mediaProperties.set(e,a)}));function h(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null===t?"undefined":void 0!==t[5]?`{ width: ${(0,n.quoteString)(t[1])}, height: ${(0,n.quoteString)(t[5])} }`:`{ width: ${(0,n.quoteString)(t[1])} }`}function E(e,t){var r,o;const a=new Map,i=new Map,s=S(t),p=P(t);return(null!==(r=e.mediaProperty)&&void 0!==r?r:new Map).forEach(((e,r)=>{const o=e.get(t);if(!(0,n.isEmptyOrUndefined)(o)){let e=s(o);e=""!==e?e:"undefined",a.set(r,e),i.set(r,p(o))}})),(null!==(o=e.dynamicMediaProperty)&&void 0!==o?o:new Map).forEach(((e,r)=>{const o=e.get(t);(0,n.isEmptyOrUndefined)(o)||(a.set(r,o),i.set(r,"undefined"))})),{enumValueMap:a,objValueMap:i}}function T(e,t){const r=e.property.get(t),o=e.dynamicProperty.get(t),a=S(t),i=P(t);let s="undefined",p="undefined";if(!(0,n.isEmptyOrUndefined)(r)){const e=a(r);s=""!==e?e:s,p=i(r)}return(0,n.isEmptyOrUndefined)(o)||(s=o,p="undefined"),{enumDefault:s,objDefault:p}}function S(e){return new Map([["background-image-size",n.getBackgroundImageSizeEnumValue],["background-image-position",n.getBackgroundImagePositionEnumValue]]).get(e)}function P(e){return new Map([["background-image-size",h],["background-image-position",v]]).get(e)}function v(e){const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null===t?"undefined":`{ x: ${(0,n.quoteString)(t[1])}, y: ${(0,n.quoteString)(t[4])} }`}const b=(0,n.curry)(((e,t,r,a)=>{const i=(0,n.getBorderDirections)(e),s=new Map;let p=r.property.get(e);(0,n.isEmptyOrUndefined)(p)||(p=t(p));const l=r.dynamicProperty.get(e),c=null!=l?l:p,u=(0,o.getMediaProperty)(r,e,t);let y=0;for(const e of i){const i=(0,n.getEdgeBorderDirection)(e),p=r.property.get(e),l=r.dynamicProperty.get(e),d=(0,o.getMediaProperty)(r,e,t);let f=(0,n.isEmptyOrUndefined)(c)?"undefined":c;if((0,n.isEmptyOrUndefined)(p)||(f=t(p)),(0,n.isEmptyOrUndefined)(l)||(f=l),d.size>0){const t=(0,o.getVariableName)(r.id,e);a.setDefaultValue(t,(0,o.getType)(e),f),a.setMediaProperty(t,d),s.set(i,t),y++}else{const t=(0,o.getVariableName)(r.id,e);a.setDefaultValue(t,(0,o.getType)(e),f),a.setMediaProperty(t,u),s.set(i,t)}}y>0&&a.mediaProperties.set((0,n.getEtsPropName)(e),s)}));t.commonMediaParserArray=[[i("width"),c("width")],[i("height"),c("height")],[function(e){return e.hasMediaProperty("constraint-size-min-width")||e.hasMediaProperty("constraint-size-max-width")||e.hasMediaProperty("constraint-size-min-height")||e.hasMediaProperty("constraint-size-min-height")},function(e,t){const r=new Map,a=["min-width","max-width","min-height","max-height"];for(const i of a){const a=`constraint-size-${i}`,s=(0,o.getMediaProperty)(e,a,n.quoteString),p=(0,o.getMediaDefaultValue)(e,a,n.quoteString);if(s.size>0){const l=(0,o.getVariableName)(e.id,a);t.setDefaultValue(l,(0,o.getType)(a),p),t.setMediaProperty(l,s),m((0,n.getEtsPropName)(i),l,r,!0)}}r.size>0&&t.mediaProperties.set("constraintSize",r)}],[i("align"),d("align","Alignment.")],[i("direction"),d("direction","Direction.")],[function(e){return e.hasMediaProperty("left")||e.hasMediaProperty("top")},function(e,t){var r;const n=null!==(r=e.property.get("position"))&&void 0!==r?r:"relative",{leftValue:a,topValue:i}=s(e,e.property,e.dynamicProperty),{mediaPositionLeft:l,mediaPositionTop:c,mediaOffsetLeft:u,mediaOffsetTop:y}=function(e){var t,r;const o=new Map,n=new Map,a=new Map,i=new Map,p=null!==(t=e.mediaProperty)&&void 0!==t?t:new Map,l=null!==(r=e.dynamicMediaProperty)&&void 0!==r?r:new Map,c=new Set;for(const[e]of p)c.add(e);for(const[e]of l)c.add(e);return c.forEach((t=>{var r,p,l,c;const u=null!==(p=null===(r=e.mediaProperty)||void 0===r?void 0:r.get(t))&&void 0!==p?p:new Map,y=null!==(c=null===(l=e.dynamicMediaProperty)||void 0===l?void 0:l.get(t))&&void 0!==c?c:new Map,d=u.get("position"),{leftValue:f,topValue:m}=s(e,u,y);"absolute"===d?("undefined"!==f&&o.set(t,f),"undefined"!==m&&n.set(t,m)):("undefined"!==f&&a.set(t,f),"undefined"!==m&&i.set(t,m))})),{mediaPositionLeft:o,mediaPositionTop:n,mediaOffsetLeft:a,mediaOffsetTop:i}}(e),d=l.size>0||c.size>0||"absolute"===n,f=u.size>0||y.size>0||"relative"===n,m=(0,o.getVariableName)(e.id,"positionLeft"),g=(0,o.getVariableName)(e.id,"positionTop"),h=(0,o.getVariableName)(e.id,"offsetLeft"),E=(0,o.getVariableName)(e.id,"offsetTop");if(0!==l.size||0!==c.size||0!==y.size||0!==u.size){if(d&&f&&(p(l,u),p(u,l),p(c,y),p(y,c)),d){const e="absolute"===n?a:"undefined",r="absolute"===n?i:"undefined";t.setDefaultValue(m,(0,o.getType)("left"),e),t.setDefaultValue(g,(0,o.getType)("top"),r),t.setMediaProperty(m,l),t.setMediaProperty(g,c),t.mediaProperties.set("position",new Map([["x",m],["y",g]]))}if(f){const e="relative"===n?a:"undefined",r="relative"===n?i:"undefined";t.setDefaultValue(h,(0,o.getType)("left"),e),t.setDefaultValue(E,(0,o.getType)("top"),r),t.setMediaProperty(h,u),t.setMediaProperty(E,y),t.mediaProperties.set("offset",new Map([["x",h],["y",E]]))}}}],[i("aspect-ratio"),u("aspect-ratio")],[i("display-priority"),u("display-priority")],[i("flex-basis"),c("flex-basis")],[i("flex-grow"),u("flex-grow")],[i("flex-shrink"),u("flex-shrink")],[i("align-self"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-self",n.dealWithAlignSelf);if(0===r.size)return;const a=(0,o.getMediaDefaultValue)(e,"align-self",n.dealWithAlignSelf),i=(0,o.getVariableName)(e.id,"align-self");t.setDefaultValue(i,(0,o.getType)("align-self"),a),t.setMediaProperty(i,r),t.mediaProperties.set("alignSelf",i)}],[i("border-style"),d("border-style","BorderStyle.")],[function(e){return e.hasMediaProperty("border-top-style")||e.hasMediaProperty("border-bottom-style")||e.hasMediaProperty("border-left-style")||e.hasMediaProperty("border-right-style")},b("border-style",(0,n.curry)(n.getEtsEnumValue)("BorderStyle."))],[i("border-width"),c("border-width")],[function(e){return e.hasMediaProperty("border-top-width")||e.hasMediaProperty("border-bottom-width")||e.hasMediaProperty("border-left-width")||e.hasMediaProperty("border-right-width")},b("border-width",n.quoteString)],[i("border-color"),f("border-color")],[function(e){return e.hasMediaProperty("border-top-color")||e.hasMediaProperty("border-bottom-color")||e.hasMediaProperty("border-left-color")||e.hasMediaProperty("border-right-color")},b("border-color",n.dealWithColor)],[i("border-radius"),c("border-radius")],[function(e){return e.hasMediaProperty("border-top-left-radius")||e.hasMediaProperty("border-bottom-right-radius")||e.hasMediaProperty("border-bottom-left-radius")||e.hasMediaProperty("border-top-right-radius")},b("border-radius",n.quoteString)],[i("background-color"),f("background-color")],[function(e){return e.hasMediaProperty("background-image-src")||e.hasMediaProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),i=e.property.get("background-image-repeat"),s=e.dynamicProperty.get("background-image-src"),p=e.dynamicProperty.get("background-image-repeat"),l=(0,o.getMediaProperty)(e,"background-image-src",a.dealWithSrc),c=(0,o.getMediaProperty)(e,"background-image-repeat",n.dealWithBackgroundRepeat);if(0===l.size&&0===c.size)return;let u=(0,a.dealWithSrc)(null!=r?r:"");if((0,n.isEmptyOrUndefined)(s)||(u=s),l.size>0){const r=(0,o.getVariableName)(e.id,"background-image-src");t.setDefaultValue(r,(0,o.getType)("background-image-src"),u),t.setMediaProperty(r,l),u=r}let y="undefined";if(!(0,n.isEmptyOrUndefined)(i)){const e=(0,n.dealWithBackgroundRepeat)(i);null!=e&&""!==e&&(y=e)}if((0,n.isEmptyOrUndefined)(p)||(y=p),c.size>0){const r=(0,o.getVariableName)(e.id,"background-image-repeat");t.setDefaultValue(r,(0,o.getType)("background-image-repeat"),y),t.setMediaProperty(r,c),y=r}t.mediaProperties.set("backgroundImage",u+", "+y)}],[i("background-image-size"),function(e,t){const{enumValueMap:r,objValueMap:n}=E(e,"background-image-size");if(0===r.size&&0===n.size)return;const{enumDefault:a,objDefault:i}=T(e,"background-image-size"),s=(0,o.getVariableName)(e.id,"background-image-size-enum"),p=(0,o.getVariableName)(e.id,"background-image-size-obj");t.setDefaultValue(s,"ImageSize",a),t.setDefaultValue(p,"SizeOptions",i),t.setMediaProperty(s,r),t.setMediaProperty(p,n),t.mediaProperties.set("backgroundImageSize",`${s} !== undefined ? ${s} : ${p}`)}],[i("background-image-position"),function(e,t){const{enumValueMap:r,objValueMap:n}=E(e,"background-image-position");if(0===r.size&&0===n.size)return;const{enumDefault:a,objDefault:i}=T(e,"background-image-position"),s=(0,o.getVariableName)(e.id,"background-image-position-enum"),p=(0,o.getVariableName)(e.id,"background-image-position-obj");t.setDefaultValue(s,"Alignment",a),t.setDefaultValue(p,"Position",i),t.setMediaProperty(s,r),t.setMediaProperty(p,n),t.mediaProperties.set("backgroundImagePosition",`${s} !== undefined ? ${s} : ${p}`)}],[i("opacity"),u("opacity")],[i("visibility"),d("visibility","Visibility.")],[i("enabled"),y("enabled")],[i("font-color"),f("font-color")],[function(e){return e.hasMediaProperty("margin")||e.hasMediaProperty("margin-left")||e.hasMediaProperty("margin-top")||e.hasMediaProperty("margin-right")||e.hasMediaProperty("margin-bottom")},g("margin")],[function(e){return e.hasMediaProperty("padding")||e.hasMediaProperty("padding-left")||e.hasMediaProperty("padding-top")||e.hasMediaProperty("padding-right")||e.hasMediaProperty("padding-bottom")},g("padding")]]},3135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.componentsMediaParserArray=t.dateMediaParamParser=t.rawDataMediaParamParser=t.stringMediaParamParser=t.dealWithJustifyAlignContent=void 0;const o=r(6282),n=r(1195),a=r(8122),i=r(9248),s=r(1790),p=r(5264),l=(0,a.curry)(((e,t,r)=>r.type===e&&r.hasMediaProperty(t)));function c(e){return isNaN(Number(e))?(0,a.getEtsEnumValue)("FontWeight.",e):e}function u(e){let t=(0,a.getEtsEnumValue)("FlexAlign.",e);return"flex-start"===e?t="FlexAlign.Start":"flex-end"===e&&(t="FlexAlign.End"),t}function y(e){return"TextOverflow."+(0,a.firstUpperCase)(e)}function d(e,t,r){var o,n;const i=new Map,s=null!==(o=e.mediaProperty)&&void 0!==o?o:new Map,p=null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map;return s.forEach(((e,o)=>{let n=e.get(t);const s=e.get(r);(0,a.isEmptyOrUndefined)(n)&&(0,a.isEmptyOrUndefined)(s)||(n="0"===n||(0,a.isEmptyOrUndefined)(n)?"0":n.substring(0,n.length-2),i.set(o,n))})),p.forEach(((e,r)=>{const o=e.get(t);(0,a.isEmptyOrUndefined)(o)||i.set(r,o)})),i}t.dealWithJustifyAlignContent=u;const f=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e,a.quoteString);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e,a.quoteString),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),m=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),g=(0,a.curry)(((e,t,r)=>{m(e,t,r)})),h=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,(0,a.curry)(a.getEtsEnumValue)(t));if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,a.curry)(a.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(e),p)}));t.stringMediaParamParser=(0,a.curry)(((e,t,r)=>{const i=(0,o.getMediaProperty)(t,e,a.quoteString);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(t,e,a.quoteString),p=(0,o.getVariableName)(t.id,e),l=(0,n.getMediaVariableDecorator)(e);r.setDefaultValue(p,(0,o.getType)(e),s,l),r.setMediaProperty(p,i),r.mediaParams.set((0,a.getEtsPropName)(e),(0,n.getDynamicValueByDecorator)(e,p))})),t.rawDataMediaParamParser=(0,a.curry)(((e,t,r)=>{const i=(0,o.getMediaProperty)(t,e);if(!(r.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(t,e),p=(0,o.getVariableName)(t.id,e);r.setDefaultValue(p,(0,o.getType)(e),s),r.setMediaProperty(p,i),r.mediaParams.set((0,a.getEtsPropName)(e),(0,n.getDynamicValueByDecorator)(e,p))})),t.dateMediaParamParser=(0,a.curry)(((e,t,r,n,i)=>{const s=e=>void 0===e||""===e?"new Date()":"new Date ("+(0,a.quoteString)(e)+")",p=(0,o.getMediaProperty)(n,e,s);if(!(i.mediaParams instanceof Map)||0===p.size)return;const l=(0,o.getMediaDefaultValue)(n,e,s),c=(0,o.getVariableName)(n.id,e);i.setDefaultValue(c,(0,o.getType)(e),l,r),i.setMediaProperty(c,p),i.mediaParams.set(t,c)}));const E=(0,a.curry)(((e,t,r,n,a)=>{const i=(0,o.getMediaProperty)(n,e);if(!(a.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(n,e),p=(0,o.getVariableName)(n.id,e);a.setDefaultValue(p,(0,o.getType)(e),s,r),a.setMediaProperty(p,i),a.mediaParams.set(t,p)})),T=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,(0,a.curry)(a.getEtsEnumValue)(t));if(!(n.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,(0,a.curry)(a.getEtsEnumValue)(t)),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaParams.set((0,a.getEtsPropName)(e),p)})),S=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e,a.dealWithColor);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e,a.dealWithColor),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),P=(0,a.curry)(((e,t,r)=>{const n=(0,o.getMediaProperty)(t,e);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(t,e),s=(0,o.getVariableName)(t.id,e);r.setDefaultValue(s,(0,o.getType)(e),i),r.setMediaProperty(s,n),r.mediaProperties.set((0,a.getEtsPropName)(e),s)})),v=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,a.quoteString);if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,a.quoteString),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(t),p)})),b=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e);if(0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaProperties.set((0,a.getEtsPropName)(t),p)})),_=(0,a.curry)(((e,t,r,n)=>{const i=(0,o.getMediaProperty)(r,e,u);if(!(n.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(r,e,u),p=(0,o.getVariableName)(r.id,e);n.setDefaultValue(p,(0,o.getType)(e),s),n.setMediaProperty(p,i),n.mediaParams.set((0,a.getEtsPropName)(e),p)})),N=(0,a.curry)(((e,t,r,n)=>{const a=(0,o.getMediaProperty)(r,e,u);if(!(n.mediaProperties instanceof Map)||0===a.size)return;const i=(0,o.getMediaDefaultValue)(r,e,u),s=(0,o.getVariableName)(r.id,e);n.setDefaultValue(s,(0,o.getType)(e),i),n.setMediaProperty(s,a),n.mediaProperties.set("justifyContent",s)})),C=(0,a.curry)(((e,t)=>t.type===e));function O(e,t,r){const n=e.property.get(r),i=e.dynamicProperty.get(r),s=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===s.size)return;let p="''";(0,a.isEmptyOrUndefined)(n)||(p=(0,a.quoteString)(n)),(0,a.isEmptyOrUndefined)(i)||(p=(0,a.getContentName)(i));const l=(0,o.getVariableName)(e.id,r);t.setDefaultValue(l,(0,o.getType)(r),p),t.setMediaProperty(l,s),t.setMediaParams(l)}const A=(0,a.curry)(((e,t,r,n)=>{let i=n.mediaProperties.get((0,a.getEtsPropName)(e));void 0===i&&(i=new Map);const s=`${e}-${t}`,p=(0,o.getVariableName)(r.id,s);let l=(0,o.getMediaProperty)(r,s,a.quoteString),u=(0,o.getMediaDefaultValue)(r,s,a.quoteString);if("string"!=typeof i){if((0,a.isEmptyOrUndefined)(u))return;"style"===t&&(l=(0,o.getMediaProperty)(r,s,(0,a.curry)(a.getEtsEnumValue)("FontStyle.")),u=(0,o.getMediaDefaultValue)(r,s,(0,a.curry)(a.getEtsEnumValue)("FontStyle."))),"weight"===t&&(l=(0,o.getMediaProperty)(r,s,c),u=(0,o.getMediaDefaultValue)(r,s,c)),n.setDefaultValue(p,(0,o.getType)(s),u),n.setMediaProperty(p,l),i.set(t,p)}n.mediaProperties.set((0,a.getEtsPropName)(e),i)}));function M(e,t){const r=(0,o.getMediaProperty)(e,"font-weight",a.dealWithFontWeight);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"font-weight",a.dealWithFontWeight),i=(0,o.getVariableName)(e.id,"font-weight");t.setDefaultValue(i,(0,o.getType)("font-weight"),n),t.setMediaProperty(i,r),t.mediaProperties.set("fontWeight",i)}function w(e,t,r,n){const i=new Map([["value","search-value"],["placeholder","search-placeholder"],["icon","icon"],["controller","search-controller"]]).get(e);if(void 0===i)return;const s=r.getProperty(i),p=r.dynamicProperty.get(i),l=(0,o.getMediaProperty)(r,i,a.quoteString),c=(0,o.getVariableName)(r.id,i);let u="''";0!==l.size&&((0,a.isEmptyOrUndefined)(s)||(u=(0,a.quoteString)(s)),(0,a.isEmptyOrUndefined)(p)||(u="controller"===e?p:(0,a.getContentName)(p)),n.setDefaultValue(c,(0,o.getType)(i),u),n.setMediaProperty(c,l),t.push(`${e}: ${(0,a.getContentName)(c)}`))}const R=[[l("button","label"),function(e,t){O(e,t,"label")}],[l("button","type"),h("type","ButtonType.")],[l("button","state-effect"),g("state-effect")],[l("button","font-size"),f("font-size")],[l("button","font-style"),h("font-style","FontStyle.")],[l("button","font-weight"),M],[l("button","font-family"),f("font-family")]],x=[[l("divider","vertical"),g("vertical")],[l("divider","color"),S("color")],[l("divider","stroke-width"),f("stroke-width")],[l("divider","line-cap"),h("line-cap","LineCapStyle.")]],L=[[C("image"),function(e,t){var r;const n=null!==(r=e.property.get("src"))&&void 0!==r?r:"",s=e.dynamicProperty.get("src"),p=(0,o.getMediaProperty)(e,"src",i.dealWithSrc);if(0===p.size)return;let l=(0,i.dealWithSrc)(n);(0,a.isEmptyOrUndefined)(s)||(l=s);const c=(0,o.getVariableName)(e.id,"src");t.setDefaultValue(c,(0,o.getType)("src"),l),t.setMediaProperty(c,p),t.setMediaParams(c)}],[l("image","alt"),f("alt")],[l("image","object-fit"),h("object-fit","ImageFit.")],[l("image","object-repeat"),h("object-repeat","ImageRepeat.")],[l("image","interpolation"),h("interpolation","ImageInterpolation.")],[l("image","render-mode"),h("render-mode","ImageRenderMode.")],[function(e){return e.hasMediaProperty("source-size-width")||e.hasMediaProperty("source-size-height")},function(e,t){let r=e.property.get("source-size-width"),n=e.property.get("source-size-height");const i=e.dynamicProperty.get("source-size-width"),s=e.dynamicProperty.get("source-size-height"),p=d(e,"source-size-width","source-size-height"),l=d(e,"source-size-height","source-size-width");if(0===p.size)return;r="0"===r||(0,a.isEmptyOrUndefined)(r)?"0":r.substring(0,r.length-2),n="0"===n||(0,a.isEmptyOrUndefined)(n)?"0":n.substring(0,n.length-2),(0,a.isEmptyOrUndefined)(i)||(r=i),(0,a.isEmptyOrUndefined)(s)||(n=s);const c=(0,o.getVariableName)(e.id,"source-size-width"),u=(0,o.getVariableName)(e.id,"source-size-height");t.setDefaultValue(c,(0,o.getType)("source-size-width"),r),t.setDefaultValue(u,(0,o.getType)("source-size-height"),n),t.setMediaProperty(c,p),t.setMediaProperty(u,l);const y=new Map([["width",c],["height",u]]);t.mediaProperties.set("sourceSize",y)}]],I=[[function(e){return"progress"===e.type&&(e.hasMediaProperty("value")||e.hasMediaProperty("total")||e.hasMediaProperty("style"))},function(e,t){const r=e.property.get("value"),n=e.dynamicProperty.get("value"),i=(0,o.getMediaProperty)(e,"value");if(!(t.mediaParams instanceof Map)||0===i.size)return;let s=null!=r?r:"0";(0,a.isEmptyOrUndefined)(n)||(s=n);const p=(0,o.getVariableName)(e.id,"value");t.setDefaultValue(p,(0,o.getType)("value"),s),t.setMediaProperty(p,i),t.mediaParams.set("value",p)}],[l("progress","total"),(0,t.rawDataMediaParamParser)("total")],[l("progress","style"),T("style","ProgressStyle.")],[l("progress","color"),S("color")]],F=[[l("slider","value"),(0,t.rawDataMediaParamParser)("value")],[l("slider","min"),(0,t.rawDataMediaParamParser)("min")],[l("slider","max"),(0,t.rawDataMediaParamParser)("max")],[l("slider","step"),(0,t.rawDataMediaParamParser)("step")],[l("slider","style"),T("style","SliderStyle.")],[l("slider","block-color"),S("block-color")],[l("slider","track-color"),S("track-color")],[l("slider","selected-color"),S("selected-color")],[l("slider","show-steps"),g("show-steps")],[l("slider","show-tips"),g("show-tips")]],k=[[l("text","content"),function(e,t){O(e,t,"content")}],[l("text","text-align"),h("text-align","TextAlign.")],[l("text","text-overflow"),function(e,t){const r=(0,o.getMediaProperty)(e,"text-overflow",y);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"text-overflow",y),a=(0,o.getVariableName)(e.id,"text-overflow");t.setDefaultValue(a,(0,o.getType)("text-overflow"),n),t.setMediaProperty(a,r),t.mediaProperties.set("textOverflow",new Map([["overflow",a]]))}],[l("text","max-lines"),m("max-lines")],[l("text","line-height"),f("line-height")],[function(e){return"text"===e.type&&(e.hasMediaProperty("decoration-type")||e.hasMediaProperty("decoration-color"))},function(e,t){const r=(0,o.getMediaProperty)(e,"decoration-type",(0,a.curry)(a.getEtsEnumValue)("TextDecorationType.")),n=(0,o.getMediaProperty)(e,"decoration-color",a.dealWithColor);if(0===r.size&&0===n.size)return;let i=(0,o.getMediaDefaultValue)(e,"decoration-type",(0,a.curry)(a.getEtsEnumValue)("TextDecorationType.")),s=(0,o.getMediaDefaultValue)(e,"decoration-color",a.dealWithColor);if(r.size>0){const n=(0,o.getVariableName)(e.id,"decoration-type");t.setDefaultValue(n,(0,o.getType)("decoration-type"),i),t.setMediaProperty(n,r),i=n}if(n.size>0){const r=(0,o.getVariableName)(e.id,"decoration-color");t.setDefaultValue(r,(0,o.getType)("decoration-color"),s),t.setMediaProperty(r,n),s=r}const p=new Map([["type",i]]);t.mediaProperties.set("decoration",p),"undefined"!==s&&p.set("color",s)}],[l("text","baseline-offset"),f("baseline-offset")],[l("text","text-case"),h("text-case","TextCase.")],[l("text","font-size"),f("font-size")],[l("text","font-style"),h("font-style","FontStyle.")],[l("text","font-weight"),M],[l("text","font-family"),f("font-family")]],B=[[l("column","space"),(0,t.stringMediaParamParser)("space")],[l("column","align-items-column"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-column",s.dealWithColumnAlignItems);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-column",s.dealWithColumnAlignItems),a=(0,o.getVariableName)(e.id,"align-items-column");t.setDefaultValue(a,(0,o.getType)("align-items-column"),n),t.setMediaProperty(a,r),t.mediaProperties.set("alignItems",a)}],[l("column","justify-content-rc"),N("justify-content-rc","FlexAlign.")]],D=[[l("row","space"),(0,t.stringMediaParamParser)("space")],[l("row","align-items-row"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-row",s.dealWithRowAlignItems);if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-row",s.dealWithRowAlignItems),a=(0,o.getVariableName)(e.id,"align-items-row");t.setDefaultValue(a,(0,o.getType)("align-items-row"),n),t.setMediaProperty(a,r),t.mediaProperties.set("alignItems",a)}],[l("row","justify-content-rc"),N("justify-content-rc","FlexAlign.")]],U=[[l("flex","flex-direction"),function(e,t){const r=(0,o.getMediaProperty)(e,"flex-direction",(0,a.curry)(a.getEtsEnumValue)("FlexDirection."));if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"flex-direction",(0,a.curry)(a.getEtsEnumValue)("FlexDirection.")),i=(0,o.getVariableName)(e.id,"flex-direction");t.setDefaultValue(i,(0,o.getType)("flex-direction"),n),t.setMediaProperty(i,r),t.mediaParams.set("direction",i)}],[l("flex","wrap"),function(e,t){const r=(0,o.getMediaProperty)(e,"wrap",a.dealWithWrap);if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"wrap",a.dealWithWrap),i=(0,o.getVariableName)(e.id,"wrap");t.setDefaultValue(i,(0,o.getType)("wrap"),n),t.setMediaProperty(i,r),t.mediaParams.set("wrap",i)}],[l("flex","justify-content"),_("justify-content","FlexAlign.")],[l("flex","align-items-flex"),function(e,t){const r=(0,o.getMediaProperty)(e,"align-items-flex",p.dealWithFlexAlignItems);if(!(t.mediaParams instanceof Map)||0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"align-items-flex",p.dealWithFlexAlignItems),a=(0,o.getVariableName)(e.id,"align-items-flex");t.setDefaultValue(a,(0,o.getType)("align-items-flex"),n),t.setMediaProperty(a,r),t.mediaParams.set("alignItems",a)}],[l("flex","align-content"),_("align-content","FlexAlign.")]],V=[[l("list","space"),(0,t.stringMediaParamParser)("space")],[l("list","initial-index"),(0,t.rawDataMediaParamParser)("initial-index")],[l("list","list-direction"),h("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasMediaProperty("divider-stroke-width")||e.hasMediaProperty("divider-color")||e.hasMediaProperty("divider-start-margin")||e.hasMediaProperty("divider-end-margin"))},function(e,t){const r=[["divider-stroke-width",a.quoteString],["divider-color",a.dealWithColor],["divider-start-margin",a.quoteString],["divider-end-margin",a.quoteString]];let n=0;const i=new Map;for(const[s,p]of r){const r=(0,o.getMediaProperty)(e,s,p),l=(0,a.getEtsPropName)(s.replace("divider-",""));let c=(0,o.getMediaDefaultValue)(e,s,p);if("undefined"===c&&"divider-stroke-width"===s&&(c="0"),r.size>0){const a=(0,o.getVariableName)(e.id,s);t.setDefaultValue(a,(0,o.getType)(s),c),t.setMediaProperty(a,r),c=a,n++}i.set(l,c)}n>0&&t.mediaProperties.set("divider",i)}],[l("list","edit-mode"),g("edit-mode")],[l("list","edge-effect"),h("edge-effect","EdgeEffect.")],[l("list","chain-animation"),g("chain-animation")]],z=[[l("list-item","sticky"),h("sticky","Sticky.")],[l("list-item","editable"),g("editable")]],G=[[l("swiper","index"),m("index")],[l("swiper","auto-play"),g("auto-play")],[l("swiper","interval"),m("interval")],[l("swiper","indicator"),g("indicator")],[l("swiper","loop"),g("loop")],[l("swiper","duration"),m("duration")],[l("swiper","vertical"),g("vertical")],[l("swiper","item-space"),f("item-space")],[l("swiper","cached-count"),m("cached-count")],[l("swiper","disable-swipe"),g("disable-swipe")]],j=[[l("text-input","placeholder"),(0,t.stringMediaParamParser)("placeholder")],[l("text-input","textInput-type"),function(e,t){const r=(0,o.getMediaProperty)(e,"textInput-type",(0,a.curry)(a.getEtsEnumValue)("InputType."));if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"textInput-type",(0,a.curry)(a.getEtsEnumValue)("InputType.")),i=(0,o.getVariableName)(e.id,"textInput-type");t.setDefaultValue(i,(0,o.getType)("textInput-type"),n),t.setMediaProperty(i,r),t.mediaProperties.set("type",i)}],[l("text-input","placeholderColor"),S("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasMediaProperty("placeholderFont-size")||e.hasMediaProperty("placeholderFont-weight")||e.hasMediaProperty("placeholderFont-family")||e.hasMediaProperty("placeholderFont-style"))},function(e,t){const r=[["size",a.quoteString],["weight",c],["family",a.quoteString],["style",(0,a.curry)(a.getEtsEnumValue)("FontStyle.")]];let n=0;const i=new Map;for(const[a,s]of r){const r=`placeholderFont-${a}`,p=(0,o.getMediaProperty)(e,r,s);let l=(0,o.getMediaDefaultValue)(e,r,s);if(p.size>0){const a=(0,o.getVariableName)(e.id,r);t.setDefaultValue(a,(0,o.getType)(r),l),t.setMediaProperty(a,p),l=a,n++}i.set(a,l)}n>0&&t.mediaProperties.set("placeholderFont",i)}],[l("text-input","enterKeyType"),h("enterKeyType","EnterKeyType.")],[l("text-input","caretColor"),S("caretColor")],[l("text-input","maxLength"),m("maxLength")]],W=[[l("refresh","friction"),(0,t.rawDataMediaParamParser)("friction")],[l("refresh","offset"),(0,t.stringMediaParamParser)("offset")],[l("refresh","refreshing"),(0,t.rawDataMediaParamParser)("refreshing")]],$=[[l("timePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[l("timePicker","useMilitaryTime"),g("useMilitaryTime")]],q=[[l("datePicker","datetime-selected"),(0,t.dateMediaParamParser)("datetime-selected","selected","private")],[l("datePicker","start"),(0,t.dateMediaParamParser)("start","start","private")],[l("datePicker","end"),(0,t.dateMediaParamParser)("end","end","private")],[l("datePicker","lunar"),g("lunar")]],H=[[l("textPicker","range"),(0,t.rawDataMediaParamParser)("range")],[l("textPicker","textPicker-selected"),E("textPicker-selected","selected","@State")],[l("textPicker","defaultPickerItemHeight"),f("defaultPickerItemHeight")]],Y=[[l("select","select-option"),function(e,t){!function(e,t,r){const n=e.dynamicProperty.get(r),i=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===i.size)return;const s=null!=n?n:'[{value: ""}]',p=(0,o.getVariableName)(e.id,r);t.setDefaultValue(p,(0,o.getType)(r),s),t.setMediaProperty(p,i),t.setMediaParams(p)}(e,t,"select-option")}],[l("select","select-value"),function(e,t){const r="select-value",n=(0,o.getMediaProperty)(e,r,a.quoteString);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,a.quoteString),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaProperties.set("value",s)}],[l("select","selected"),m("selected")],[l("select","font-size"),A("font","size")],[l("select","font-style"),A("font","style")],[l("select","font-family"),A("font","family")],[l("select","font-weight"),A("font","weight")],[l("select","selected-option-font-size"),A("selected-option-font","size")],[l("select","selected-option-font-style"),A("selected-option-font","style")],[l("select","selected-option-font-family"),A("selected-option-font","family")],[l("select","selected-option-font-weight"),A("selected-option-font","weight")],[l("select","selected-option-font-color"),S("selected-option-font-color")],[l("select","selected-option-bg-color"),S("selected-option-bg-color")],[l("select","option-font-size"),A("option-font","size")],[l("select","option-font-style"),A("option-font","style")],[l("select","option-font-family"),A("option-font","family")],[l("select","option-font-weight"),A("option-font","weight")],[l("select","option-font-color"),S("option-font-color")],[l("select","option-bg-color"),S("option-bg-color")]],X=[[l("toggle","toggle-type"),function(e,t){const r="ToggleType.",n="toggle-type",i=(0,o.getMediaProperty)(e,n,(0,a.curry)(a.getEtsEnumValue)(r));if(!(t.mediaParams instanceof Map)||0===i.size)return;const s=(0,o.getMediaDefaultValue)(e,n,(0,a.curry)(a.getEtsEnumValue)(r)),p=(0,o.getVariableName)(e.id,n);t.setDefaultValue(p,(0,o.getType)(n),s),t.setMediaProperty(p,i),t.mediaParams.set("type",p)}],[l("toggle","isOn"),(0,t.rawDataMediaParamParser)("isOn")],[l("toggle","selectedColor"),S("selectedColor")],[l("toggle","switchPointColor"),S("switchPointColor")]],J=[[l("checkbox","select"),g("select")],[l("checkbox","selectedColor"),S("selectedColor")],[l("checkbox","name"),(0,t.stringMediaParamParser)("name")],[l("checkbox","group"),(0,t.stringMediaParamParser)("group")]],K=[[l("checkboxGroup","selectAll"),g("selectAll")],[l("checkboxGroup","selectedColor"),S("selectedColor")],[l("checkboxGroup","group"),(0,t.stringMediaParamParser)("group")]],Q=[[l("scroll","scrollable"),h("scrollable","ScrollDirection.")],[l("scroll","scroll-bar"),h("scroll-bar","BarState.")],[l("scroll","scroll-bar-color"),S("scroll-bar-color")],[l("scroll","scroll-bar-width"),f("scroll-bar-width")],[l("scroll","edge-effect-scroll"),function(e,t){const r="edge-effect-scroll",n=(0,o.getMediaProperty)(e,r,a.dealWithScrollEdgeEffect);if(0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,a.dealWithScrollEdgeEffect),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaProperties.set("edgeEffect",s)}]],Z=[[l("grid","columns-template"),f("columns-template")],[l("grid","rows-template"),f("rows-template")],[l("grid","columns-gap"),f("columns-gap")],[l("grid","rows-gap"),f("rows-gap")],[l("grid","scroll-bar"),h("scroll-bar","BarState.")],[l("grid","scroll-bar-color"),S("scroll-bar-color")],[l("grid","scroll-bar-width"),f("scroll-bar-width")],[l("grid","cached-count"),m("cached-count")],[l("grid","edit-mode"),g("edit-mode")],[l("grid","layout-direction"),h("layout-direction","GridDirection.")],[l("grid","max-count"),m("max-count")],[l("grid","min-count"),m("min-count")],[l("grid","cell-length"),m("cell-length")],[l("grid","multi-selectable"),g("multi-selectable")],[l("grid","support-animation"),g("support-animation")]],ee=[[l("grid-item","row-start"),m("row-start")],[l("grid-item","row-end"),m("row-end")],[l("grid-item","column-start"),m("column-start")],[l("grid-item","column-end"),m("column-end")],[l("grid-item","force-rebuild"),g("force-rebuild")],[l("grid-item","selectable"),g("selectable")]],te=[[l("stack","align-content-stack"),function(e,t){const r="align-content-stack",n=(0,o.getMediaProperty)(e,r,(0,a.curry)(a.getEtsEnumValue)("Alignment."));if(!(t.mediaParams instanceof Map)||0===n.size)return;const i=(0,o.getMediaDefaultValue)(e,r,(0,a.curry)(a.getEtsEnumValue)("Alignment.")),s=(0,o.getVariableName)(e.id,r);t.setDefaultValue(s,(0,o.getType)(r),i),t.setMediaProperty(s,n),t.mediaParams.set("alignContent",s)}]],re=[[l("navigation","navigation-title"),v("navigation-title","title")],[l("navigation","subTitle"),f("subTitle")],[l("navigation","menus"),P("menus")],[l("navigation","titleMode"),h("titleMode","NavigationTitleMode.")],[l("navigation","toolBar"),P("toolBar")],[l("navigation","hideToolBar"),g("hideToolBar")],[l("navigation","hideTitleBar"),g("hideTitleBar")],[l("navigation","hideBackButton"),g("hideBackButton")]],oe=[[function(e){return"search"===e.type},function(e,t){const r=[];w("value",r,e,t),w("placeholder",r,e,t),w("icon",r,e,t),w("controller",r,e,t),0!==r.length&&t.setParams(`{${r.join(", ")}}`)}],[l("search","text-font-size"),A("text-font","size")],[l("search","text-font-style"),A("text-font","style")],[l("search","text-font-weight"),A("text-font","weight")],[l("search","text-font-family"),A("text-font","family")],[l("search","placeholder-font-size"),A("placeholder-font","size")],[l("search","placeholder-font-style"),A("placeholder-font","style")],[l("search","placeholder-font-weight"),A("placeholder-font","weight")],[l("search","placeholder-font-family"),A("placeholder-font","family")],[l("search","placeholderColor"),S("placeholderColor")],[l("search","search-text-align"),function(e,t){const r=(0,o.getMediaProperty)(e,"search-text-align",(0,a.curry)(a.getEtsEnumValue)("TextAlign."));if(0===r.size)return;const n=(0,o.getMediaDefaultValue)(e,"search-text-align",(0,a.curry)(a.getEtsEnumValue)("TextAlign.")),i=(0,o.getVariableName)(e.id,"search-text-align");t.setDefaultValue(i,(0,o.getType)("search-text-align"),n),t.setMediaProperty(i,r),t.mediaProperties.set("textAlign",i)}],[l("search","search-button"),f("search-button")],[l("search","copy-option"),h("copy-option","CopyOptions.")]],ne=[[l("tabs","bar-position"),T("bar-position","BarPosition.")],[l("tabs","index"),(0,t.rawDataMediaParamParser)("index")],[l("tabs","controller"),(0,t.rawDataMediaParamParser)("controller")],[l("tabs","vertical"),g("vertical")],[l("tabs","tabs-scrollable"),b("tabs-scrollable","scrollable")],[l("tabs","bar-mode"),h("bar-mode","BarMode.")],[l("tabs","bar-width"),f("bar-width")],[l("tabs","bar-height"),f("bar-height")],[l("tabs","animation-duration"),m("animation-duration")]],ae=[[function(e){return"tab-content"===e.type&&(e.hasMediaProperty("tabBar-icon")||e.hasMediaProperty("tabBar-text"))},function(e,t){const r=(0,o.getMediaProperty)(e,"tabBar-text",a.quoteString),n=(0,o.getMediaProperty)(e,"tabBar-icon",i.dealWithSrc),s=(0,o.getMediaDefaultValue)(e,"tabBar-text",a.quoteString),p=(0,o.getMediaDefaultValue)(e,"tabBar-icon",i.dealWithSrc),l=(0,o.getVariableName)(e.id,"tabBar-text"),c=(0,o.getVariableName)(e.id,"tabBar-icon"),u=new Map([["text",s],["icon",p]]);r.size>0&&(t.setDefaultValue(l,(0,o.getType)("tabBar-text"),s),t.setMediaProperty(l,r),u.set("text",l)),n.size>0&&(t.setDefaultValue(c,(0,o.getType)("tabBar-icon"),p),t.setMediaProperty(c,n),u.set("icon",c)),t.mediaProperties.set("tabBar",u)}]];t.componentsMediaParserArray=[...R,...x,...L,...I,...F,...k,...B,...D,...U,...V,...z,...G,...j,...X,...W,...$,...H,...Y,...q,...te,...Q,...Z,...ee,...re,...oe,...ne,...ae,...J,...K]},366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCustomMediaVisualModel=void 0;const o=r(6125),n=r(3135),a=r(6282),i=r(1195),s=r(8122);t.parseCustomMediaVisualModel=function(e,t){(0,i.getCustomAttributeMap)().forEach(((r,n)=>{if(function(e,t){return e.hasMediaProperty(t)}(e,n)){const l=p.get(r.type);"function"==typeof l&&l(n,e,t);const c=o.enumParserMap.get(r.type);"function"==typeof c&&function(e,t,r,o){const n=(0,a.getMediaProperty)(t,e,o);if(!(r.mediaParams instanceof Map)||0===n.size)return;const p=(0,a.getMediaDefaultValue)(t,e,o),l=(0,a.getVariableName)(t.id,e);r.setDefaultValue(l,(0,a.getType)(e),p),r.setMediaProperty(l,n),r.mediaParams.set((0,s.getEtsPropName)(e),(0,i.getDynamicValueByDecorator)(e,l))}(n,e,t,c)}}))};const p=new Map([["string",n.stringMediaParamParser],["boolean",n.rawDataMediaParamParser],["number",n.rawDataMediaParamParser],["any[]",n.rawDataMediaParamParser],["object",n.rawDataMediaParamParser],["Date",function(e,t,r){(0,n.dateMediaParamParser)(e,(0,s.getEtsPropName)(e),"private",t,r)}]])},3729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMediaProperty=t.parseMediaVisualModel=void 0;const o=r(1912),n=r(9223),a=r(3135);function i(e,t,r){const o=t.get(r);return void 0!==o&&o.has(e)}t.parseMediaVisualModel=function(e,t){(0,n.forEachParser)(e,t),(0,n.ifParser)(e,t);for(const r of p)("boolean"==typeof r[0]||r[0](e))&&r[1](e,t)},t.isMediaProperty=function(e,t){return!i(e,s,"common")&&!i(e,s,t)&&!i(e,s,"events")};const s=new Map([["common",new Set(["keyGenerator","item","idx"])],["events",new Set([...o.events])]]),p=[...n.commonMediaParserArray,...a.componentsMediaParserArray]},6282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMediaDefaultValue=t.getVariableName=t.getMediaProperty=t.getType=void 0;const o=r(4294),n=r(1290),a=r(1195),i=r(8122);function s(e,t){for(const r of t)if(r.property===e)return r.etsType;return""}t.getType=function(e){const t=e+"-visual",r=n.etsPropertyList;let o="";for(const e of r)if(void 0!==e.propertySet.properties&&(o=s(t,e.propertySet.properties)),e.propertySet.property===t&&(o=e.propertySet.etsType),""!==o)break;return""!==o?function(e=""){const t=new Map([["Rfloat","Resource"],["Rstring","Resource"],["Rcolor","Resource"],["Rmedia","Resource"],["Rrawfile","Resource"],["Rplural","Resource"],["ETSArray","any[]"]]),r=new Array;return e.split("|").forEach((e=>{const o=t.get(e),n=null!=o?o:e;r.includes(n)||r.push(null!=o?o:e)})),r.join(" | ")}(o):(0,a.getCustomAttrType)(e)},t.getMediaProperty=function(e,t,r){var o,n;const a=new Map;return(null!==(o=e.mediaProperty)&&void 0!==o?o:new Map).forEach(((e,o)=>{let n=e.get(t);(0,i.isEmptyOrUndefined)(n)||("function"==typeof r&&(n=r(n)),(0,i.isEmptyOrUndefined)(n)||a.set(o,n))})),(null!==(n=e.dynamicMediaProperty)&&void 0!==n?n:new Map).forEach(((e,r)=>{let o=e.get(t);void 0===o||"content"!==t&&"label"!==t||(o=(0,i.getContentName)(o)),(0,i.isEmptyOrUndefined)(o)||a.set(r,o)})),a},t.getVariableName=function(e,t){const r=(0,o.getTagName)(e),n=`this.${(0,i.getEtsPropName)(r)}${(0,i.firstUpperCase)((0,i.getEtsPropName)(t))}`;return`${n}_${(0,o.getUniqueId)(n)}`},t.getMediaDefaultValue=function(e,t,r){var o;const n=e.property.get(t),a=e.dynamicProperty.get(t);let s=null!==(o=new Map([["if","true"],["auto-play","false"],["interval","3000"],["select-value","''"],["columns-template","''"],["rows-template","''"],["tabBar-icon","''"],["tabBar-text","'TabBar'"]]).get(t))&&void 0!==o?o:"undefined";return(0,i.isEmptyOrUndefined)(n)||(s="function"==typeof r?r(n):n,s=(0,i.isEmptyOrUndefined)(s)?"undefined":s),(0,i.isEmptyOrUndefined)(a)||(s=a),s}},7893:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseBuildersVisualModel=void 0;const o=r(8122);t.parseBuildersVisualModel=function(e,t,r){const n=e.slots;void 0!==n&&0!==n.size&&n.forEach(((n,a)=>{const i=(0,o.getBuilderUniqueName)(e.id,a);t.properties.set(a,`this.${i}`),t.builders.set(i,r.visit(n))}))}},8916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buttonParserArray=void 0;const o=r(8122);t.buttonParserArray=[[(0,o.hasFeatureProperty)("button","label"),o.labelParamParser],[(0,o.hasFeatureProperty)("button","type"),(0,o.enumPropertyParser)("type","ButtonType.")],[(0,o.hasFeatureProperty)("button","state-effect"),(0,o.booleanPropertyParser)("state-effect")],[(0,o.hasFeatureProperty)("button","font-size"),(0,o.stringPropertyParser)("font-size")],[(0,o.hasFeatureProperty)("button","font-style"),(0,o.enumPropertyParser)("font-style","FontStyle.")],[(0,o.hasFeatureProperty)("button","font-weight"),o.fontWeightPropertyParser],[(0,o.hasFeatureProperty)("button","font-family"),(0,o.stringPropertyParser)("font-family")]]},1147:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxGroupParseArray=void 0;const o=r(8122);t.checkboxGroupParseArray=[[(0,o.hasFeatureProperty)("checkboxGroup","selectAll"),(0,o.booleanPropertyParser)("selectAll")],[(0,o.hasFeatureProperty)("checkboxGroup","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("checkboxGroup","group"),(0,o.stringParamParser)("group")]]},2218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxParseArray=void 0;const o=r(8122);t.checkboxParseArray=[[(0,o.hasFeatureProperty)("checkbox","select"),(0,o.booleanPropertyParser)("select")],[(0,o.hasFeatureProperty)("checkbox","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("checkbox","name"),(0,o.stringParamParser)("name")],[(0,o.hasFeatureProperty)("checkbox","group"),(0,o.stringParamParser)("group")]]},7150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonParserArray=void 0;const o=r(8122),n=r(9248);function a(e,t,r,n=!1){(0,o.isEmptyOrUndefined)(t)||r.set(e,n?t:(0,o.quoteString)(t))}function i(e,t,r,n,a){const i=e.getProperty(t),s=e.getProperty(r),p=e.dynamicProperty.has(t),l=e.dynamicProperty.has(r),c=(0,o.getEdgeBorderDirection)(r);(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||n.set(c,p?i:a(i)):n.set(c,l?s:a(s))}t.commonParserArray=[[(0,o.hasCommonProperty)("width"),(0,o.stringPropertyParser)("width")],[(0,o.hasCommonProperty)("height"),(0,o.stringPropertyParser)("height")],[function(e){return e.hasProperty("constraint-size-min-width")||e.hasProperty("constraint-size-max-width")||e.hasProperty("constraint-size-min-height")||e.hasProperty("constraint-size-max-height")},function(e,t){const r=new Map,o=e.getProperty("constraint-size-min-width"),n=e.getProperty("constraint-size-max-width"),i=e.getProperty("constraint-size-min-height"),s=e.getProperty("constraint-size-max-height");a("minWidth",o,r,e.dynamicProperty.has("constraint-size-min-width")),a("maxWidth",n,r,e.dynamicProperty.has("constraint-size-max-width")),a("minHeight",i,r,e.dynamicProperty.has("constraint-size-min-height")),a("maxHeight",s,r,e.dynamicProperty.has("constraint-size-max-height")),r.size>0&&t.properties.set("constraintSize",r)}],[(0,o.hasCommonProperty)("align"),(0,o.enumPropertyParser)("align","Alignment.")],[(0,o.hasCommonProperty)("direction"),(0,o.enumPropertyParser)("direction","Direction.")],[function(e){return e.hasProperty("left")||e.hasProperty("top")},function(e,t){const r="absolute"===e.property.get("position")?"position":"offset",n=e.property.get("left"),a=e.property.get("top"),i=e.dynamicProperty.get("left"),s=e.dynamicProperty.get("top");if((0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(n)&&(0,o.isEmptyOrUndefined)(a))return;const p=new Map([["x",`${(0,o.quoteString)(null!=n?n:"0")}`],["y",`${(0,o.quoteString)(null!=a?a:"0")}`]]);(0,o.isEmptyOrUndefined)(i)||p.set("x",i),(0,o.isEmptyOrUndefined)(s)||p.set("y",s),t.properties.set(r,p)}],[(0,o.hasCommonProperty)("aspect-ratio"),(0,o.numberPropertyParser)("aspect-ratio")],[(0,o.hasCommonProperty)("display-priority"),(0,o.numberPropertyParser)("display-priority")],[(0,o.hasCommonProperty)("flex-basis"),(0,o.stringPropertyParser)("flex-basis")],[(0,o.hasCommonProperty)("flex-grow"),(0,o.numberPropertyParser)("flex-grow")],[(0,o.hasCommonProperty)("flex-shrink"),(0,o.numberPropertyParser)("flex-shrink")],[(0,o.hasCommonProperty)("align-self"),function(e,t){const r=e.dynamicProperty.get("align-self");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignSelf",r);const n=e.property.get("align-self");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.dealWithAlignSelf)(n);t.properties.set("alignSelf",a)}],[function(e){return e.hasProperty("border-style")||e.hasProperty("border-top-style")||e.hasProperty("border-right-style")||e.hasProperty("border-bottom-style")||e.hasProperty("border-left-style")},function(e,t){const r=new Map,n=e.getProperty("border-style"),a=e.getProperty("border-top-style"),s=e.getProperty("border-bottom-style"),p=e.getProperty("border-left-style"),l=e.getProperty("border-right-style"),c=e.dynamicProperty.has("border-style"),u=(0,o.getBorderDirections)("border-style");for(const t of u)i(e,"border-style",t,r,(0,o.curry)(o.getEtsEnumValue)("BorderStyle."));(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-style"),c?n:(0,o.getEtsEnumValue)("BorderStyle.",n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-style"),r)}],[function(e){return e.hasProperty("border-width")||e.hasProperty("border-top-width")||e.hasProperty("border-right-width")||e.hasProperty("border-bottom-width")||e.hasProperty("border-left-width")},function(e,t){const r=new Map,n=e.getProperty("border-width"),i=e.getProperty("border-top-width"),s=e.getProperty("border-bottom-width"),p=e.getProperty("border-left-width"),l=e.getProperty("border-right-width"),c=e.property.has("border-top-width"),u=e.property.has("border-bottom-width"),y=e.property.has("border-left-width"),d=e.property.has("border-right-width"),f=e.dynamicProperty.has("border-width"),m=e.dynamicProperty.has("border-top-width"),g=e.dynamicProperty.has("border-bottom-width"),h=e.dynamicProperty.has("border-left-width"),E=e.dynamicProperty.has("border-right-width");(0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-width"),f?n:(0,o.quoteString)(n)):(a("top",null!=i?i:n,r,m||!c&&f),a("bottom",null!=s?s:n,r,g||!u&&f),a("left",null!=p?p:n,r,h||!y&&f),a("right",null!=l?l:n,r,E||!d&&f),r.size>0&&t.properties.set((0,o.getEtsPropName)("border-width"),r))}],[function(e){return e.hasProperty("border-color")||e.hasProperty("border-top-color")||e.hasProperty("border-right-color")||e.hasProperty("border-bottom-color")||e.hasProperty("border-left-color")},function(e,t){const r=new Map,n=e.getProperty("border-color"),a=e.getProperty("border-top-color"),s=e.getProperty("border-bottom-color"),p=e.getProperty("border-left-color"),l=e.getProperty("border-right-color"),c=e.dynamicProperty.has("border-color"),u=(0,o.getBorderDirections)("border-color");for(const t of u)i(e,"border-color",t,r,o.dealWithColor);(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-color"),c?n:(0,o.dealWithColor)(n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-color"),r)}],[function(e){return e.hasProperty("border-radius")||e.hasProperty("border-top-left-radius")||e.hasProperty("border-top-right-radius")||e.hasProperty("border-bottom-right-radius")||e.hasProperty("border-bottom-left-radius")},function(e,t){const r=new Map,n=e.getProperty("border-radius"),a=e.getProperty("border-top-left-radius"),s=e.getProperty("border-top-right-radius"),p=e.getProperty("border-bottom-left-radius"),l=e.getProperty("border-bottom-right-radius"),c=e.dynamicProperty.has("border-radius"),u=(0,o.getBorderDirections)("border-radius");for(const t of u)i(e,"border-radius",t,r,o.quoteString);(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(s)&&(0,o.isEmptyOrUndefined)(p)&&(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(n)||t.properties.set((0,o.getEtsPropName)("border-radius"),c?n:(0,o.quoteString)(n)):r.size>0&&t.properties.set((0,o.getEtsPropName)("border-radius"),r)}],[(0,o.hasCommonProperty)("background-color"),(0,o.colorPropertyParser)("background-color")],[function(e){return e.hasProperty("background-image-src")||e.hasProperty("background-image-repeat")},function(e,t){const r=e.property.get("background-image-src"),a=e.property.get("background-image-repeat"),i=e.dynamicProperty.get("background-image-src"),s=e.dynamicProperty.get("background-image-repeat");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(i)&&(0,o.isEmptyOrUndefined)(s))return;let p=(0,n.dealWithSrc)(null!=r?r:"");if((0,o.isEmptyOrUndefined)(i)||(p=i),(0,o.isEmptyOrUndefined)(s)){if(!(0,o.isEmptyOrUndefined)(a)){const e=(0,o.dealWithBackgroundRepeat)(a);null!=e&&""!==e&&(p=p+", "+e)}}else p=p+", "+s;t.properties.set("backgroundImage",p)}],[(0,o.hasCommonProperty)("background-image-size"),function(e,t){const r=e.dynamicProperty.get("background-image-size");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("backgroundImageSize",r);const n=e.property.get("background-image-size");if((0,o.isEmptyOrUndefined)(n))return;if(""!==(0,o.getBackgroundImageSizeEnumValue)(n))return void t.properties.set("backgroundImageSize",(0,o.getEtsEnumValue)("ImageSize.",n));const a=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);null!==a&&(void 0!==a[5]?t.properties.set("backgroundImageSize",new Map([["width",`${(0,o.quoteString)(a[1])}`],["height",`${(0,o.quoteString)(a[5])}`]])):t.properties.set("backgroundImageSize",new Map([["width",`${(0,o.quoteString)(a[1])}`]])))}],[(0,o.hasCommonProperty)("background-image-position"),function(e,t){const r=e.dynamicProperty.get("background-image-position");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("backgroundImagePosition",r);const n=e.property.get("background-image-position");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.getBackgroundImagePositionEnumValue)(n);if(""!==a)return void t.properties.set("backgroundImagePosition",a);const i=n.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);null!==i&&t.properties.set("backgroundImagePosition",new Map([["x",`${(0,o.quoteString)(i[1])}`],["y",`${(0,o.quoteString)(i[4])}`]]))}],[(0,o.hasCommonProperty)("opacity"),(0,o.numberPropertyParser)("opacity")],[(0,o.hasCommonProperty)("visibility"),(0,o.enumPropertyParser)("visibility","Visibility.")],[(0,o.hasCommonProperty)("enabled"),(0,o.booleanPropertyParser)("enabled")],[(0,o.hasCommonProperty)("font-color"),(0,o.colorPropertyParser)("font-color")],[function(e){return e.hasProperty("margin")||e.hasProperty("margin-left")||e.hasProperty("margin-top")||e.hasProperty("margin-right")||e.hasProperty("margin-bottom")},function(e,t){var r,o,n,i;const s=new Map,p=e.getProperty("margin"),l=null!==(r=e.getProperty("margin-top"))&&void 0!==r?r:p,c=null!==(o=e.getProperty("margin-bottom"))&&void 0!==o?o:p,u=null!==(n=e.getProperty("margin-left"))&&void 0!==n?n:p,y=null!==(i=e.getProperty("margin-right"))&&void 0!==i?i:p,d=e.property.has("margin-top"),f=e.property.has("margin-bottom"),m=e.property.has("margin-left"),g=e.property.has("margin-right"),h=e.dynamicProperty.has("margin"),E=e.dynamicProperty.has("margin-top"),T=e.dynamicProperty.has("margin-bottom"),S=e.dynamicProperty.has("margin-left"),P=e.dynamicProperty.has("margin-right");a("top",l,s,E||!d&&h),a("bottom",c,s,T||!f&&h),a("left",u,s,S||!m&&h),a("right",y,s,P||!g&&h),s.size>0&&t.properties.set("margin",s)}],[function(e){return e.hasProperty("padding")||e.hasProperty("padding-left")||e.hasProperty("padding-top")||e.hasProperty("padding-right")||e.hasProperty("padding-bottom")},function(e,t){var r,o,n,i;const s=new Map,p=e.getProperty("padding"),l=null!==(r=e.getProperty("padding-top"))&&void 0!==r?r:p,c=null!==(o=e.getProperty("padding-bottom"))&&void 0!==o?o:p,u=null!==(n=e.getProperty("padding-left"))&&void 0!==n?n:p,y=null!==(i=e.getProperty("padding-right"))&&void 0!==i?i:p,d=e.property.has("padding-top"),f=e.property.has("padding-bottom"),m=e.property.has("padding-left"),g=e.property.has("padding-right"),h=e.dynamicProperty.has("padding"),E=e.dynamicProperty.has("padding-top"),T=e.dynamicProperty.has("padding-bottom"),S=e.dynamicProperty.has("padding-left"),P=e.dynamicProperty.has("padding-right");a("top",l,s,E||!d&&h),a("bottom",c,s,T||!f&&h),a("left",u,s,S||!m&&h),a("right",y,s,P||!g&&h),s.size>0&&t.properties.set("padding",s)}]]},1778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dividerParserArray=void 0;const o=r(8122);t.dividerParserArray=[[(0,o.hasFeatureProperty)("divider","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("divider","color"),(0,o.colorPropertyParser)("color")],[(0,o.hasFeatureProperty)("divider","stroke-width"),(0,o.stringPropertyParser)("stroke-width")],[(0,o.hasFeatureProperty)("divider","line-cap"),(0,o.enumPropertyParser)("line-cap","LineCapStyle.")]]},5264:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithFlexAlignItems=t.flexParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t,r,n)=>{if(!(n.params instanceof Map))return;const a=r.dynamicProperty.get(e);if(!(0,o.isEmptyOrUndefined)(a))return void n.params.set((0,o.getEtsPropName)(e),a);const i=r.property.get(e);if((0,o.isEmptyOrUndefined)(i))return;let s=(0,o.getEtsEnumValue)(t,i);"flex-start"===i?s=t+"Start":"flex-end"===i&&(s=t+"End"),n.params.set((0,o.getEtsPropName)(e),s)}));function a(e){let t=(0,o.getEtsEnumValue)("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t}t.flexParserArray=[[(0,o.hasFeatureProperty)("flex","flex-direction"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("flex-direction");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("direction",r);const n=e.property.get("flex-direction");(0,o.isEmptyOrUndefined)(n)||t.params.set("direction",(0,o.getEtsEnumValue)("FlexDirection.",n))}],[(0,o.hasFeatureProperty)("flex","wrap"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("wrap");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("wrap",r);const n=e.property.get("wrap");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.dealWithWrap)(n);t.params.set("wrap",a)}],[(0,o.hasFeatureProperty)("flex","justify-content"),n("justify-content","FlexAlign.")],[(0,o.hasFeatureProperty)("flex","align-items-flex"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-items-flex");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("alignItems",r);const n=e.property.get("align-items-flex");if((0,o.isEmptyOrUndefined)(n))return;const i=a(n);t.params.set("alignItems",i)}],[(0,o.hasFeatureProperty)("flex","align-content"),n("align-content","FlexAlign.")]],t.dealWithFlexAlignItems=a},2153:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridItemParserArray=t.gridParserArray=void 0;const o=r(8122);t.gridParserArray=[[(0,o.hasFeatureProperty)("grid","scroller"),o.scrollerParamParser],[(0,o.hasFeatureProperty)("grid","columns-template"),(0,o.stringPropertyParser)("columns-template")],[(0,o.hasFeatureProperty)("grid","rows-template"),(0,o.stringPropertyParser)("rows-template")],[(0,o.hasFeatureProperty)("grid","columns-gap"),(0,o.stringPropertyParser)("columns-gap")],[(0,o.hasFeatureProperty)("grid","rows-gap"),(0,o.stringPropertyParser)("rows-gap")],[(0,o.hasFeatureProperty)("grid","scroll-bar"),(0,o.enumPropertyParser)("scroll-bar","BarState.")],[(0,o.hasFeatureProperty)("grid","scroll-bar-color"),(0,o.colorPropertyParser)("scroll-bar-color")],[(0,o.hasFeatureProperty)("grid","scroll-bar-width"),(0,o.stringPropertyParser)("scroll-bar-width")],[(0,o.hasFeatureProperty)("grid","cached-count"),(0,o.numberPropertyParser)("cached-count")],[(0,o.hasFeatureProperty)("grid","edit-mode"),(0,o.booleanPropertyParser)("edit-mode")],[(0,o.hasFeatureProperty)("grid","layout-direction"),(0,o.enumPropertyParser)("layout-direction","GridDirection.")],[(0,o.hasFeatureProperty)("grid","max-count"),(0,o.numberPropertyParser)("max-count")],[(0,o.hasFeatureProperty)("grid","min-count"),(0,o.numberPropertyParser)("min-count")],[(0,o.hasFeatureProperty)("grid","cell-length"),(0,o.numberPropertyParser)("cell-length")],[(0,o.hasFeatureProperty)("grid","multi-selectable"),(0,o.booleanPropertyParser)("multi-selectable")],[(0,o.hasFeatureProperty)("grid","support-animation"),(0,o.booleanPropertyParser)("support-animation")]],t.gridItemParserArray=[[(0,o.hasFeatureProperty)("grid-item","row-start"),(0,o.numberPropertyParser)("row-start")],[(0,o.hasFeatureProperty)("grid-item","row-end"),(0,o.numberPropertyParser)("row-end")],[(0,o.hasFeatureProperty)("grid-item","column-start"),(0,o.numberPropertyParser)("column-start")],[(0,o.hasFeatureProperty)("grid-item","column-end"),(0,o.numberPropertyParser)("column-end")],[(0,o.hasFeatureProperty)("grid-item","force-rebuild"),(0,o.booleanPropertyParser)("force-rebuild")],[(0,o.hasFeatureProperty)("grid-item","selectable"),(0,o.booleanPropertyParser)("selectable")]]},9248:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithSrc=t.imageParserArray=t.isTargetComponent=void 0;const o=r(8122);function n(e){return null===e.match(/\$(r|rawfile)\('(.*)'\)$/)?(0,o.quoteString)(e):e}t.isTargetComponent=(0,o.curry)(((e,t)=>t.type===e)),t.imageParserArray=[[(0,t.isTargetComponent)("image"),function(e,t){var r;const a=e.dynamicProperty.get("src");if(!(0,o.isEmptyOrUndefined)(a))return void t.setParams(a);const i=null!==(r=e.property.get("src"))&&void 0!==r?r:"";t.setParams(n(i))}],[(0,o.hasFeatureProperty)("image","alt"),(0,o.stringPropertyParser)("alt")],[(0,o.hasFeatureProperty)("image","object-fit"),(0,o.enumPropertyParser)("object-fit","ImageFit.")],[(0,o.hasFeatureProperty)("image","object-repeat"),(0,o.enumPropertyParser)("object-repeat","ImageRepeat.")],[(0,o.hasFeatureProperty)("image","interpolation"),(0,o.enumPropertyParser)("interpolation","ImageInterpolation.")],[(0,o.hasFeatureProperty)("image","render-mode"),(0,o.enumPropertyParser)("render-mode","ImageRenderMode.")],[function(e){return e.hasProperty("source-size-width")||e.hasProperty("source-size-height")},function(e,t){let r=e.getProperty("source-size-width"),n=e.getProperty("source-size-height");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(n))return;const a=e.dynamicProperty.has("source-size-width"),i=e.dynamicProperty.has("source-size-height");r="0"===r||(0,o.isEmptyOrUndefined)(r)?"0":a?r:r.substring(0,r.length-2),n="0"===n||(0,o.isEmptyOrUndefined)(n)?"0":i?n:n.substring(0,n.length-2);const s=new Map([["width",r],["height",n]]);t.properties.set("sourceSize",s)}]],t.dealWithSrc=n},7907:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemParserArray=t.listParserArray=void 0;const o=r(8122);t.listParserArray=[[(0,o.hasFeatureProperty)("list","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("list","initial-index"),(0,o.rawDataParamParser)("initial-index")],[(0,o.hasFeatureProperty)("list","list-direction"),(0,o.enumPropertyParser)("list-direction","Axis.")],[function(e){return"list"===e.type&&(e.hasProperty("divider-stroke-width")||e.hasProperty("divider-color")||e.hasProperty("divider-start-margin")||e.hasProperty("divider-end-margin"))},function(e,t){const r=e.property.get("divider-stroke-width"),n=e.dynamicProperty.get("divider-stroke-width"),a=new Map([["strokeWidth",`${(0,o.quoteString)(null!=r?r:"0")}`]]);(0,o.isEmptyOrUndefined)(n)||a.set("strokeWidth",n);const i=e.property.get("divider-color"),s=e.dynamicProperty.get("divider-color"),p=e.property.get("divider-start-margin"),l=e.dynamicProperty.get("divider-start-margin"),c=e.property.get("divider-end-margin"),u=e.dynamicProperty.get("divider-end-margin");(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||a.set("color",(0,o.dealWithColor)(i)):a.set("color",s),(0,o.isEmptyOrUndefined)(l)?(0,o.isEmptyOrUndefined)(p)||a.set("startMargin",(0,o.quoteString)(p)):a.set("startMargin",l),(0,o.isEmptyOrUndefined)(u)?(0,o.isEmptyOrUndefined)(c)||a.set("endMargin",(0,o.quoteString)(c)):a.set("endMargin",u),t.properties.set("divider",a)}],[(0,o.hasFeatureProperty)("list","edit-mode"),(0,o.booleanPropertyParser)("edit-mode")],[(0,o.hasFeatureProperty)("list","edge-effect"),(0,o.enumPropertyParser)("edge-effect","EdgeEffect.")],[(0,o.hasFeatureProperty)("list","chain-animation"),(0,o.booleanPropertyParser)("chain-animation")]],t.listItemParserArray=[[(0,o.hasFeatureProperty)("list-item","sticky"),(0,o.enumPropertyParser)("sticky","Sticky.")],[(0,o.hasFeatureProperty)("list-item","editable"),(0,o.booleanPropertyParser)("editable")]]},8191:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.navigationParserArray=void 0;const o=r(8122);t.navigationParserArray=[[(0,o.hasFeatureProperty)("navigation","navigation-title"),function(e,t){const r=e.getProperty("navigation-title"),n=e.dynamicProperty.get("navigation-title");(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||t.properties.set("title",(0,o.quoteString)(r)):t.properties.set("title",n)}],[(0,o.hasFeatureProperty)("navigation","subTitle"),(0,o.stringPropertyParser)("subTitle")],[(0,o.hasFeatureProperty)("navigation","menus"),(0,o.objectPropertyParser)("menus")],[(0,o.hasFeatureProperty)("navigation","titleMode"),(0,o.enumPropertyParser)("titleMode","NavigationTitleMode.")],[(0,o.hasFeatureProperty)("navigation","toolBar"),(0,o.objectPropertyParser)("toolBar")],[(0,o.hasFeatureProperty)("navigation","hideToolBar"),(0,o.booleanPropertyParser)("hideToolBar")],[(0,o.hasFeatureProperty)("navigation","hideTitleBar"),(0,o.booleanPropertyParser)("hideTitleBar")],[(0,o.hasFeatureProperty)("navigation","hideBackButton"),(0,o.booleanPropertyParser)("hideBackButton")]]},2565:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textPickerParserArray=t.datePickerParserArray=t.timePickerParserArray=void 0;const o=r(8122);t.timePickerParserArray=[[(0,o.hasFeatureProperty)("timePicker","datetime-selected"),(0,o.dateParamParser)("datetime-selected","selected")],[(0,o.hasFeatureProperty)("timePicker","useMilitaryTime"),(0,o.booleanPropertyParser)("useMilitaryTime")]],t.datePickerParserArray=[[(0,o.hasFeatureProperty)("datePicker","datetime-selected"),(0,o.dateParamParser)("datetime-selected","selected")],[(0,o.hasFeatureProperty)("datePicker","start"),(0,o.dateParamParser)("start","start")],[(0,o.hasFeatureProperty)("datePicker","end"),(0,o.dateParamParser)("end","end")],[(0,o.hasFeatureProperty)("datePicker","lunar"),(0,o.booleanPropertyParser)("lunar")]],t.textPickerParserArray=[[(0,o.hasFeatureProperty)("textPicker","range"),(0,o.arrayParamParser)("range")],[(0,o.hasFeatureProperty)("textPicker","textPicker-selected"),(0,o.customRawDataParamParser)("textPicker-selected","selected")],[(0,o.hasFeatureProperty)("textPicker","defaultPickerItemHeight"),(0,o.stringPropertyParser)("defaultPickerItemHeight")]]},8483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.progressParserArray=void 0;const o=r(8122);t.progressParserArray=[[function(e){return"progress"===e.type&&(e.hasProperty("value")||e.hasProperty("total")||e.hasProperty("style"))},function(e,t){var r;(0,o.dynamicParamParser)("value",e,t)||t.params instanceof Map&&t.params.set("value",null!==(r=e.getProperty("value"))&&void 0!==r?r:"0")}],[(0,o.hasFeatureProperty)("progress","total"),(0,o.rawDataParamParser)("total")],[(0,o.hasFeatureProperty)("progress","style"),(0,o.enumParamParser)("style","ProgressStyle.")],[(0,o.hasFeatureProperty)("progress","color"),(0,o.colorPropertyParser)("color")]]},4925:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshParserArray=void 0;const o=r(8122);t.refreshParserArray=[[(0,o.hasFeatureProperty)("refresh","friction"),(0,o.rawDataParamParser)("friction")],[(0,o.hasFeatureProperty)("refresh","offset"),(0,o.stringParamParser)("offset")],[(0,o.hasFeatureProperty)("refresh","refreshing"),(0,o.booleanParamParser)("refreshing")]]},1790:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dealWithRowAlignItems=t.dealWithColumnAlignItems=t.rowParserArray=t.columnParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t,r,n)=>{if(!(n.properties instanceof Map))return;const a=r.dynamicProperty.get(e);if(!(0,o.isEmptyOrUndefined)(a))return void n.properties.set("justifyContent",a);const i=r.property.get(e);if((0,o.isEmptyOrUndefined)(i))return;let s=(0,o.getEtsEnumValue)(t,i);"flex-start"===i?s=t+"Start":"flex-end"===i&&(s=t+"End"),n.properties.set("justifyContent",s)}));function a(e){let t=(0,o.getEtsEnumValue)("HorizontalAlign.",e);return"flex-start"===e?t="HorizontalAlign.Start":"flex-end"===e&&(t="HorizontalAlign.End"),t}function i(e){let t=(0,o.getEtsEnumValue)("VerticalAlign.",e);return"flex-start"===e?t="VerticalAlign.Top":"flex-end"===e&&(t="VerticalAlign.Bottom"),t}t.columnParserArray=[[(0,o.hasFeatureProperty)("column","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("column","align-items-column"),function(e,t){const r=e.dynamicProperty.get("align-items-column");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-column");if((0,o.isEmptyOrUndefined)(n))return;const i=a(n);t.properties.set("alignItems",i)}],[(0,o.hasFeatureProperty)("column","justify-content-rc"),n("justify-content-rc","FlexAlign.")]],t.rowParserArray=[[(0,o.hasFeatureProperty)("row","space"),(0,o.stringParamParser)("space")],[(0,o.hasFeatureProperty)("row","align-items-row"),function(e,t){const r=e.dynamicProperty.get("align-items-row");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("alignItems",r);const n=e.property.get("align-items-row");if((0,o.isEmptyOrUndefined)(n))return;const a=i(n);t.properties.set("alignItems",a)}],[(0,o.hasFeatureProperty)("row","justify-content-rc"),n("justify-content-rc","FlexAlign.")]],t.dealWithColumnAlignItems=a,t.dealWithRowAlignItems=i},7375:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollParserArray=void 0;const o=r(8122);t.scrollParserArray=[[(0,o.hasFeatureProperty)("scroll","scrollable"),(0,o.enumPropertyParser)("scrollable","ScrollDirection.")],[(0,o.hasFeatureProperty)("scroll","scroll-bar"),(0,o.enumPropertyParser)("scroll-bar","BarState.")],[(0,o.hasFeatureProperty)("scroll","scroll-bar-color"),(0,o.colorPropertyParser)("scroll-bar-color")],[(0,o.hasFeatureProperty)("scroll","scroll-bar-width"),(0,o.stringPropertyParser)("scroll-bar-width")],[(0,o.hasFeatureProperty)("scroll","edge-effect-scroll"),function(e,t){const r="edge-effect-scroll";if((0,o.dynamicPropertyParser)(r,e,t))return;const n=e.property.get(r);(0,o.isEmptyOrUndefined)(n)||t.properties.set("edgeEffect",(0,o.getEtsEnumValue)("EdgeEffect.",n))}],[(0,o.hasFeatureProperty)("scroll","scroller"),o.scrollerParamParser]]},9284:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchParserArray=void 0;const o=r(8122),n=r(8014);function a(e,t,r,n){const a=new Map([["value","search-value"],["placeholder","search-placeholder"],["icon","icon"],["controller","search-controller"]]).get(e);if(void 0===a)return;const i=r.getProperty(a),s=r.dynamicProperty.get(a);"controller"!==e||(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(s)?(0,o.isEmptyOrUndefined)(i)||t.push(`${e}: ${(0,o.quoteString)(i)}`):t.push(`${e}: ${(0,o.getContentName)(s)}`):t.push(`${e}: ${s}`)}t.searchParserArray=[[(0,o.hasFeatureProperty)("search","text-font-size"),(0,n.selectFontParser)("text-font","size")],[(0,o.hasFeatureProperty)("search","text-font-style"),(0,n.selectFontParser)("text-font","style")],[(0,o.hasFeatureProperty)("search","text-font-weight"),(0,n.selectFontParser)("text-font","weight")],[(0,o.hasFeatureProperty)("search","text-font-family"),(0,n.selectFontParser)("text-font","family")],[(0,o.hasFeatureProperty)("search","placeholder-font-size"),(0,n.selectFontParser)("placeholder-font","size")],[(0,o.hasFeatureProperty)("search","placeholder-font-style"),(0,n.selectFontParser)("placeholder-font","style")],[(0,o.hasFeatureProperty)("search","placeholder-font-weight"),(0,n.selectFontParser)("placeholder-font","weight")],[(0,o.hasFeatureProperty)("search","placeholder-font-family"),(0,n.selectFontParser)("placeholder-font","family")],[(0,o.hasFeatureProperty)("search","placeholderColor"),(0,o.colorPropertyParser)("placeholderColor")],[(0,o.hasFeatureProperty)("search","search-text-align"),o.searchTextAlign],[function(e){return"search"===e.type},function(e,t){const r=[];a("value",r,e),a("placeholder",r,e),a("icon",r,e),a("controller",r,e),t.setParams(`{${r.join(", ")}}`)}],[(0,o.hasFeatureProperty)("search","search-button"),(0,o.stringPropertyParser)("search-button")],[(0,o.hasFeatureProperty)("search","copy-option"),(0,o.enumPropertyParser)("copy-option","CopyOptions.")]]},8014:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectParserArray=t.selectFontParser=void 0;const o=r(8122);t.selectFontParser=(0,o.curry)(((e,t,r,n)=>{let a=n.properties.get((0,o.getEtsPropName)(e));void 0===a&&(a=new Map);const i=`${e}-${t}`,s=r.property.get(i),p=r.dynamicProperty.get(i);"string"!=typeof a&&((0,o.isEmptyOrUndefined)(p)?(0,o.isEmptyOrUndefined)(s)||("size"!==t&&"family"!==t||a.set(t,(0,o.quoteString)(s)),"style"===t&&a.set(t,(0,o.getEtsEnumValue)("FontStyle.",s)),"weight"===t&&a.set(t,(0,o.dealWithFontWeight)(s))):a.set(t,p)),n.properties.set((0,o.getEtsPropName)(e),a)})),t.selectParserArray=[[(0,o.hasSelectOption)("select","select-option"),function(e,t){const r=e.dynamicProperty.get("select-option");t.setParams(null!=r?r:'[{value: ""}]')}],[(0,o.hasFeatureProperty)("select","select-value"),function(e,t){const r=e.getProperty("select-value"),n=e.dynamicProperty.get("select-value");(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||t.properties.set("value",(0,o.quoteString)(r)):t.properties.set("value",(0,o.getContentName)(n))}],[(0,o.hasFeatureProperty)("select","selected"),(0,o.numberPropertyParser)("selected")],[(0,o.hasFeatureProperty)("select","font-size"),(0,t.selectFontParser)("font","size")],[(0,o.hasFeatureProperty)("select","font-style"),(0,t.selectFontParser)("font","style")],[(0,o.hasFeatureProperty)("select","font-weight"),(0,t.selectFontParser)("font","weight")],[(0,o.hasFeatureProperty)("select","font-family"),(0,t.selectFontParser)("font","family")],[(0,o.hasFeatureProperty)("select","selected-option-font-size"),(0,t.selectFontParser)("selected-option-font","size")],[(0,o.hasFeatureProperty)("select","selected-option-font-style"),(0,t.selectFontParser)("selected-option-font","style")],[(0,o.hasFeatureProperty)("select","selected-option-font-weight"),(0,t.selectFontParser)("selected-option-font","weight")],[(0,o.hasFeatureProperty)("select","selected-option-font-family"),(0,t.selectFontParser)("selected-option-font","family")],[(0,o.hasFeatureProperty)("select","selected-option-font-color"),(0,o.colorPropertyParser)("selected-option-font-color")],[(0,o.hasFeatureProperty)("select","selected-option-bg-color"),(0,o.colorPropertyParser)("selected-option-bg-color")],[(0,o.hasFeatureProperty)("select","option-font-size"),(0,t.selectFontParser)("option-font","size")],[(0,o.hasFeatureProperty)("select","option-font-style"),(0,t.selectFontParser)("option-font","style")],[(0,o.hasFeatureProperty)("select","option-font-weight"),(0,t.selectFontParser)("option-font","weight")],[(0,o.hasFeatureProperty)("select","option-font-family"),(0,t.selectFontParser)("option-font","family")],[(0,o.hasFeatureProperty)("select","option-font-color"),(0,o.colorPropertyParser)("option-font-color")],[(0,o.hasFeatureProperty)("select","option-bg-color"),(0,o.colorPropertyParser)("option-bg-color")]]},2563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sliderParserArray=void 0;const o=r(8122);t.sliderParserArray=[[(0,o.hasFeatureProperty)("slider","value"),(0,o.rawDataParamParser)("value")],[(0,o.hasFeatureProperty)("slider","min"),(0,o.rawDataParamParser)("min")],[(0,o.hasFeatureProperty)("slider","max"),(0,o.rawDataParamParser)("max")],[(0,o.hasFeatureProperty)("slider","step"),(0,o.rawDataParamParser)("step")],[(0,o.hasFeatureProperty)("slider","style"),(0,o.enumParamParser)("style","SliderStyle.")],[(0,o.hasFeatureProperty)("slider","block-color"),(0,o.colorPropertyParser)("block-color")],[(0,o.hasFeatureProperty)("slider","track-color"),(0,o.colorPropertyParser)("track-color")],[(0,o.hasFeatureProperty)("slider","selected-color"),(0,o.colorPropertyParser)("selected-color")],[(0,o.hasFeatureProperty)("slider","show-steps"),(0,o.booleanPropertyParser)("show-steps")],[(0,o.hasFeatureProperty)("slider","show-tips"),(0,o.booleanPropertyParser)("show-tips")]]},8936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackParserArray=void 0;const o=r(8122);t.stackParserArray=[[(0,o.hasFeatureProperty)("stack","align-content-stack"),function(e,t){if(!(t.params instanceof Map))return;const r=e.dynamicProperty.get("align-content-stack");if(!(0,o.isEmptyOrUndefined)(r))return void t.params.set("alignContent",r);const n=e.property.get("align-content-stack");if((0,o.isEmptyOrUndefined)(n))return;const a=(0,o.getEtsEnumValue)("Alignment.",n);t.params.set((0,o.getEtsPropName)("alignContent"),a)}]]},780:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.swiperParserArray=void 0;const o=r(8122);t.swiperParserArray=[[(0,o.hasFeatureProperty)("swiper","index"),(0,o.numberPropertyParser)("index")],[(0,o.hasFeatureProperty)("swiper","auto-play"),(0,o.booleanPropertyParser)("auto-play")],[(0,o.hasFeatureProperty)("swiper","interval"),(0,o.numberPropertyParser)("interval")],[(0,o.hasFeatureProperty)("swiper","indicator"),(0,o.booleanPropertyParser)("indicator")],[(0,o.hasFeatureProperty)("swiper","loop"),(0,o.booleanPropertyParser)("loop")],[(0,o.hasFeatureProperty)("swiper","duration"),(0,o.numberPropertyParser)("duration")],[(0,o.hasFeatureProperty)("swiper","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("swiper","item-space"),(0,o.stringPropertyParser)("item-space")],[(0,o.hasFeatureProperty)("swiper","cached-count"),(0,o.numberPropertyParser)("cached-count")],[(0,o.hasFeatureProperty)("swiper","disable-swipe"),(0,o.booleanPropertyParser)("disable-swipe")]]},7036:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabContentParserArray=void 0;const o=r(8122),n=r(9248);t.tabContentParserArray=[[function(e){return"tab-content"===e.type&&(e.hasProperty("tabBar-icon")||e.hasProperty("tabBar-text"))},function(e,t){var r,a;const i=new Map,s=null!==(r=e.getProperty("tabBar-icon"))&&void 0!==r?r:"",p=null!==(a=e.getProperty("tabBar-text"))&&void 0!==a?a:"TabBar",l=e.dynamicProperty.has("tabBar-text"),c=e.dynamicProperty.has("tabBar-icon");(0,o.isEmptyOrUndefined)(s)||i.set("icon",c?s:(0,n.dealWithSrc)(s)),void 0!==p&&i.set("text",l?p:(0,o.quoteString)(p)),i.size>0&&t.properties.set("tabBar",i)}]]},2973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabsParserArray=void 0;const o=r(8122),n=(0,o.curry)(((e,t)=>{const r=e.dynamicProperty.get("tabs-scrollable");if(void 0!==r&&""!==r.trim())return void t.properties.set("scrollable",r);const n=e.property.get("tabs-scrollable");(0,o.isEmptyOrUndefined)(n)||t.properties.set("scrollable",n)}));t.tabsParserArray=[[(0,o.hasFeatureProperty)("tabs","bar-position"),(0,o.enumParamParser)("bar-position","BarPosition.")],[(0,o.hasFeatureProperty)("tabs","index"),(0,o.rawDataParamParser)("index")],[(0,o.hasFeatureProperty)("tabs","controller"),(0,o.rawDataParamParser)("controller")],[(0,o.hasFeatureProperty)("tabs","vertical"),(0,o.booleanPropertyParser)("vertical")],[(0,o.hasFeatureProperty)("tabs","tabs-scrollable"),n],[(0,o.hasFeatureProperty)("tabs","bar-mode"),(0,o.enumPropertyParser)("bar-mode","BarMode.")],[(0,o.hasFeatureProperty)("tabs","bar-width"),(0,o.stringPropertyParser)("bar-width")],[(0,o.hasFeatureProperty)("tabs","bar-height"),(0,o.stringPropertyParser)("bar-height")],[(0,o.hasFeatureProperty)("tabs","animation-duration"),(0,o.numberPropertyParser)("animation-duration")]]},1162:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textInputParserArray=void 0;const o=r(8122);t.textInputParserArray=[[(0,o.hasFeatureProperty)("text-input","placeholder"),(0,o.stringParamParser)("placeholder")],[(0,o.hasFeatureProperty)("text-input","textInput-type"),function(e,t){const r=e.dynamicProperty.get("textInput-type");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("type",r);const n=e.property.get("textInput-type");(0,o.isEmptyOrUndefined)(n)||t.properties.set("type","InputType."+n)}],[(0,o.hasFeatureProperty)("text-input","placeholderColor"),(0,o.colorPropertyParser)("placeholderColor")],[function(e){return"text-input"===e.type&&(e.hasProperty("placeholderFont-size")||e.hasProperty("placeholderFont-weight")||e.hasProperty("placeholderFont-family")||e.hasProperty("placeholderFont-style"))},function(e,t){const r=e.property.get("placeholderFont-size"),n=e.dynamicProperty.get("placeholderFont-size"),a=e.property.get("placeholderFont-weight"),i=e.dynamicProperty.get("placeholderFont-weight"),s=e.property.get("placeholderFont-family"),p=e.dynamicProperty.get("placeholderFont-family"),l=e.property.get("placeholderFont-style"),c=e.dynamicProperty.get("placeholderFont-style"),u=new Map;(0,o.isEmptyOrUndefined)(n)?(0,o.isEmptyOrUndefined)(r)||u.set("size",parseInt(r)):u.set("size",n),(0,o.isEmptyOrUndefined)(i)?(0,o.isEmptyOrUndefined)(a)||u.set("weight",isNaN(Number(a))?(0,o.getEtsEnumValue)("FontWeight.",a):a):u.set("weight",i),(0,o.isEmptyOrUndefined)(p)?(0,o.isEmptyOrUndefined)(s)||u.set("family",(0,o.quoteString)(s)):u.set("family",p),(0,o.isEmptyOrUndefined)(c)?(0,o.isEmptyOrUndefined)(l)||u.set("style",(0,o.getEtsEnumValue)("FontStyle.",l)):u.set("style",c),t.properties.set("placeholderFont",u)}],[(0,o.hasFeatureProperty)("text-input","enterKeyType"),(0,o.enumPropertyParser)("enterKeyType","EnterKeyType.")],[(0,o.hasFeatureProperty)("text-input","caretColor"),(0,o.colorPropertyParser)("caretColor")],[(0,o.hasFeatureProperty)("text-input","maxLength"),(0,o.numberPropertyParser)("maxLength")]]},8681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textParserArray=void 0;const o=r(8122);t.textParserArray=[[(0,o.hasFeatureProperty)("text","content"),o.contentParamParser],[(0,o.hasFeatureProperty)("text","text-align"),(0,o.enumPropertyParser)("text-align","TextAlign.")],[(0,o.hasFeatureProperty)("text","text-overflow"),function(e,t){const r=e.dynamicProperty.get("text-overflow");if(!(0,o.isEmptyOrUndefined)(r))return void t.properties.set("textOverflow",new Map([["overflow",r]]));const n=e.property.get("text-overflow");(0,o.isEmptyOrUndefined)(n)||t.properties.set("textOverflow",new Map([["overflow","TextOverflow."+(0,o.firstUpperCase)(n)]]))}],[(0,o.hasFeatureProperty)("text","max-lines"),(0,o.numberPropertyParser)("max-lines")],[(0,o.hasFeatureProperty)("text","line-height"),(0,o.stringPropertyParser)("line-height")],[function(e){return"text"===e.type&&(e.hasProperty("decoration-type")||e.hasProperty("decoration-color"))},function(e,t){const r=e.property.get("decoration-type"),n=e.dynamicProperty.get("decoration-type"),a=e.property.get("decoration-color"),i=e.dynamicProperty.get("decoration-color");if((0,o.isEmptyOrUndefined)(r)&&(0,o.isEmptyOrUndefined)(a)&&(0,o.isEmptyOrUndefined)(n)&&(0,o.isEmptyOrUndefined)(i))return;const s=new Map;(0,o.isEmptyOrUndefined)(n)?s.set("type",(0,o.isEmptyOrUndefined)(r)?"TextDecorationType.None":(0,o.getEtsEnumValue)("TextDecorationType.",r)):s.set("type",n),t.properties.set("decoration",s),(0,o.isEmptyOrUndefined)(i)?(0,o.isEmptyOrUndefined)(a)||s.set("color",(0,o.dealWithColor)(a)):s.set("color",i)}],[(0,o.hasFeatureProperty)("text","baseline-offset"),(0,o.stringPropertyParser)("baseline-offset")],[(0,o.hasFeatureProperty)("text","text-case"),(0,o.enumPropertyParser)("text-case","TextCase.")],[(0,o.hasFeatureProperty)("text","font-size"),(0,o.stringPropertyParser)("font-size")],[(0,o.hasFeatureProperty)("text","font-style"),(0,o.enumPropertyParser)("font-style","FontStyle.")],[(0,o.hasFeatureProperty)("text","font-weight"),o.fontWeightPropertyParser],[(0,o.hasFeatureProperty)("text","font-family"),(0,o.stringPropertyParser)("font-family")]]},4313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleParseArray=void 0;const o=r(8122);t.toggleParseArray=[[(0,o.hasFeatureProperty)("toggle","toggle-type"),function(e,t){const r="toggle-type";if((0,o.customDynamicParamParser)(r,"type",e,t))return;const n=e.property.get(r);!(0,o.isEmptyOrUndefined)(n)&&t.params instanceof Map&&t.params.set("type",(0,o.getEtsEnumValue)("ToggleType.",n))}],[(0,o.hasFeatureProperty)("toggle","isOn"),(0,o.booleanParamParser)("isOn")],[(0,o.hasFeatureProperty)("toggle","selectedColor"),(0,o.colorPropertyParser)("selectedColor")],[(0,o.hasFeatureProperty)("toggle","switchPointColor"),(0,o.colorPropertyParser)("switchPointColor")]]},8122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBuilderUniqueName=t.getEdgeBorderDirection=t.getBorderDirections=t.dealWithAlignSelf=t.dealWithScrollEdgeEffect=t.dealWithBackgroundRepeat=t.dealWithBackgroundImageSize=t.dealWithBackgroundImagePosition=t.dealWithFontWeight=t.getContentName=t.scrollerParamParser=t.dealWithWrap=t.getBackgroundImageSizeEnumValue=t.getBackgroundImagePositionEnumValue=t.contentParamParser=t.labelParamParser=t.fontWeightPropertyParser=t.dealWithColor=t.getEtsEnumValue=t.getEtsPropName=t.parseTagName=t.firstUpperCase=t.getForEachObj=t.colorPropertyParser=t.enumParamParser=t.arrayParamParser=t.booleanParamParser=t.customRawDataParamParser=t.rawDataParamParser=t.dateParamParser=t.stringParamParser=t.dynamicParamParser=t.searchTextAlign=t.enumPropertyParser=t.booleanPropertyParser=t.numberPropertyParser=t.isEmptyOrUndefined=t.objectPropertyParser=t.stringPropertyParser=t.customDynamicParamParser=t.dynamicPropertyParser=t.quoteString=t.hasSelectOption=t.hasFeatureProperty=t.hasCommonProperty=t.curry=void 0;const o=r(1195),n=r(4294);function a(e){return(...t)=>t.lengtht.property.has(e)||t.dynamicProperty.has(e))),t.hasFeatureProperty=a(((e,t,r)=>r.type===e&&(r.property.has(t)||r.dynamicProperty.has(t)))),t.hasSelectOption=a(((e,t,r)=>r.type===e)),t.quoteString=i,t.dynamicPropertyParser=s,t.customDynamicParamParser=p,t.stringPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.properties.set(y(e),i(o))})),t.objectPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.properties.set(y(e),o)})),t.isEmptyOrUndefined=l,t.numberPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);l(o)||r.properties.set(y(e),o)})),t.booleanPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;const o=t.property.get(e);l(o)||r.properties.set(y(e),o)})),t.enumPropertyParser=a(((e,t,r,o)=>{if(s(e,r,o))return;const n=r.property.get(e);l(n)||o.properties.set(y(e),d(t,n))})),t.searchTextAlign=function(e,t){const r=e.dynamicProperty.get("search-text-align");if(void 0!==r&&""!==r.trim())return void t.properties.set("textAlign",r);const o=e.property.get("search-text-align");l(o)||t.properties.set("textAlign",d("TextAlign.",o))},t.dynamicParamParser=c,t.stringParamParser=a(((e,t,r)=>{if(c(e,t,r))return;const o=t.property.get(e);void 0!==o&&r.params instanceof Map&&r.params.set(y(e),i(o))})),t.dateParamParser=a(((e,t,r,o)=>{const n=r.dynamicProperty.get(e);if(void 0!==n&&""!==n.trim()&&o.params instanceof Map)return void o.params.set(t,n);const a=r.property.get(e);void 0!==a&&o.params instanceof Map&&o.params.set(t,(e=>void 0===e||""===e?"new Date()":"new Date ("+i(e)+")")(a))})),t.rawDataParamParser=a(((e,t,r)=>{if(c(e,t,r))return;const o=t.property.get(e);!l(o)&&r.params instanceof Map&&r.params.set(y(e),o)})),t.customRawDataParamParser=a(((e,t,r,o)=>{if(p(e,t,r,o))return;const n=r.property.get(e);!l(n)&&o.params instanceof Map&&o.params.set(t,n)})),t.booleanParamParser=a(((e,r,o)=>{(0,t.rawDataParamParser)(e,r,o)})),t.arrayParamParser=a(((e,r,o)=>{(0,t.rawDataParamParser)(e,r,o)})),t.enumParamParser=a(((e,t,r,o)=>{if(c(e,r,o))return;const n=r.property.get(e);!l(n)&&o.params instanceof Map&&o.params.set(y(e),d(t,n))})),t.colorPropertyParser=a(((e,t,r)=>{if(s(e,t,r))return;let o=t.property.get(e);l(o)||(o=f(o),r.properties.set(y(e),o))})),t.getForEachObj=function(e){var t,r;const o=e.dynamicProperty.get("for"),n=e.dynamicProperty.get("keyGenerator"),a=null!==(t=e.property.get("item"))&&void 0!==t?t:"item",i=null!==(r=e.property.get("idx"))&&void 0!==r?r:"idx";return void 0!==e.dynamicProperty.get("for")?{for:o,key:n,item:a,idx:i}:null},t.firstUpperCase=u,t.parseTagName=function(e){return(0,n.getTagName)(e).split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")},t.getEtsPropName=y,t.getEtsEnumValue=d,t.dealWithColor=f,t.fontWeightPropertyParser=function(e,t){const r=e.getProperty("font-weight");if(l(r))return;const o=g(r);t.properties.set("fontWeight",o)},t.labelParamParser=function(e,t){const r=e.dynamicProperty.get("label");if(!l(r))return void t.setParams(m(r));const o=e.property.get("label");"string"==typeof o&&t.setParams(i(o))},t.contentParamParser=function(e,t){const r=e.property.get("content"),o=e.dynamicProperty.get("content");l(o)?"string"==typeof r&&t.setParams(i(r)):t.setParams(m(o))},t.getBackgroundImagePositionEnumValue=function(e){const t=new Map([["top left","TopStart"],["top center","Top"],["top right","TopEnd"],["center left","Start"],["center center","Center"],["center right","End"],["bottom left","BottomStart"],["bottom center","Bottom"],["bottom right","BottomEnd"]]);return t.has(e)?`Alignment.${String(t.get(e))}`:""},t.getBackgroundImageSizeEnumValue=function(e){return new Set(["cover","contain","auto"]).has(e)?d("ImageSize.",e):""},t.dealWithWrap=function(e){let t=d("FlexWrap.",e);return"nowrap"===e&&(t="FlexWrap.NoWrap"),t},t.scrollerParamParser=function(e,t){const r=e.dynamicProperty.get("scroller");l(r)||t.setParams(r)},t.getContentName=m,t.dealWithFontWeight=g,t.dealWithBackgroundImagePosition=function(e){if(new Set(["TopStart","Top","TopEnd","Start","Center","End","BottomStart","Bottom","BottomEnd"]).has(e))return"Alignment."+e;const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%)) +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$/);return null!==t?`{ x: ${i(t[1])}, y: ${i(t[4])} }`:void 0},t.dealWithBackgroundImageSize=function(e){if(new Set(["Cover","Contain","Auto"]).has(e))return d("ImageSize.",e);const t=e.match(/^ *((0|[1-9][0-9]*)(px|vp|lpx|%))( *$| +((0|[1-9][0-9]*)(px|vp|lpx|%)) *$)/);return null!==t?void 0!==t[5]?`{ width: ${i(t[1])}, height: ${i(t[5])} }`:`{ width: ${i(t[1])} }`:void 0},t.dealWithBackgroundRepeat=function(e){const t=new Map([["repeat-x","X"],["repeat-y","Y"],["repeat","XY"],["no-repeat","NoRepeat"]]).get(e);if(null!=t&&""!==t)return d("ImageRepeat.",t)},t.dealWithScrollEdgeEffect=function(e){var t;const r=d("EdgeEffect.",e);return null!==(t=new Map([["Spring","EdgeEffect.Spring"],["Fade","EdgeEffect.Fade"],["None","EdgeEffect.None"]]).get(r))&&void 0!==t?t:r},t.dealWithAlignSelf=function(e){let t=d("ItemAlign.",e);return"flex-start"===e?t="ItemAlign.Start":"flex-end"===e&&(t="ItemAlign.End"),t},t.getBorderDirections=function(e){return"border-width"===e?["border-top-width","border-bottom-width","border-left-width","border-right-width"]:"border-color"===e?["border-top-color","border-bottom-color","border-left-color","border-right-color"]:"border-style"===e?["border-top-style","border-bottom-style","border-left-style","border-right-style"]:["border-top-left-radius","border-bottom-right-radius","border-bottom-left-radius","border-top-right-radius"]},t.getEdgeBorderDirection=function(e){var t;return e.includes("radius")?null!==(t=new Map([["border-top-left-radius","topLeft"],["border-top-right-radius","topRight"],["border-bottom-left-radius","bottomLeft"],["border-bottom-right-radius","bottomRight"]]).get(e))&&void 0!==t?t:e:e.split("-")[1]},t.getBuilderUniqueName=function(e,t){const r=`${y((0,n.getTagName)(e))}${u(y(t))}`;return`${r}_${(0,n.getUniqueId)(r)}`}},1912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.events=t.parseVisualModel=void 0;const o=r(8122),n=r(7150),a=r(1778),i=r(8916),s=r(9248),p=r(8483),l=r(2563),c=r(8681),u=r(1790),y=r(8191),d=r(2153),f=r(780),m=r(2565),g=r(4313),h=r(5264),E=r(7907),T=r(7375),S=r(8014),P=r(4925),v=r(1162),b=r(9284),_=r(8936),N=r(2973),C=r(7036),O=r(2218),A=r(1147);t.parseVisualModel=function(e,r){r.setTagName((0,o.parseTagName)(e.type));const n=(0,o.getForEachObj)(e);r.setForEachObj(n);const a=void 0!==e.dynamicProperty.get("if")?e.dynamicProperty.get("if"):e.property.get("if");void 0===a?r.setIfBoolean(null):r.setIfBoolean(a);for(const t of M)("boolean"==typeof t[0]||t[0](e))&&t[1](e,r);!function(e,r){var o;const n="onDisappear",a="onDisAppear";for(let o of t.events){const t=e.property.get(o);o===n&&(o=a),void 0!==t&&""!==t&&("this"===t.split(".")[0]?r.properties.set(o,t+".bind(this)"):r.properties.set(o,t))}if(void 0!==e.property.get("newFunction")){const t=null!==(o=e.property.get("newFunction"))&&void 0!==o?o:"{}",i=JSON.parse(t);Object.keys(i).forEach((e=>{var t;const o=null!==(t=i[e].eventCodeGen)&&void 0!==t?t:"";e===n&&(e=a),r.properties.set(e,o)}))}}(e,r)},t.events=["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange","onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop","onComplete","onError","onFinish","onChange","onSubmit","onEditChanged","onStateChange","onRefreshing","onSelect","onScroll","onScrollEdge","onScrollEnd","onScrollBegin","onTitleModeChange","onCopy","onCut","onPaste"];const M=[...n.commonParserArray,...i.buttonParserArray,...a.dividerParserArray,...s.imageParserArray,...p.progressParserArray,...l.sliderParserArray,...c.textParserArray,...u.columnParserArray,...u.rowParserArray,...h.flexParserArray,...E.listParserArray,...E.listItemParserArray,...f.swiperParserArray,...v.textInputParserArray,...y.navigationParserArray,...m.timePickerParserArray,...m.textPickerParserArray,...P.refreshParserArray,...g.toggleParseArray,...S.selectParserArray,...m.datePickerParserArray,...T.scrollParserArray,...d.gridParserArray,...d.gridItemParserArray,...b.searchParserArray,..._.stackParserArray,...N.tabsParserArray,...C.tabContentParserArray,...O.checkboxParseArray,...A.checkboxGroupParseArray]},7571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEvent=t.isData=t.isUnknown=t.isContent=t.isAttribute=t.isStyle=t.styleMap=void 0;const o=r(904),n=["width","height","min-width","min-height","max-width","max-height","padding","padding-start","padding-end","padding-top","padding-right","padding-bottom","padding-left","margin","margin-start","margin-end","margin-top","margin-right","margin-bottom","margin-left","border-width","border-style","border-color","border-radius","border-top-width","border-top-style","border-top-color","border-top-left-radius","border-right-width","border-right-style","border-right-color","border-top-right-radius","border-bottom-width","border-bottom-style","border-bottom-color","border-bottom-right-radius","border-left-width","border-left-style","border-left-color","border-bottom-left-radius","background-color","background","background-image","background-size","background-position","background-repeat","display","opacity","visibility","flex","flex-grow","flex-shrink","flex-basis","position","display","top","right","bottom","left","display-index","flex-weight","aspect-ratio"],a=["font-size","font-family","font-style","font-weight"],i=["text-align","line-height","text-decoration","letter-spacing","max-lines","text-overflow","allow-scale","min-font-size","max-font-size","font-size-step","prefer-font-sizes","color",...a],s=["allow-scale","text-decoration","color",...a],p=["text-color","allow-scale","icon-width","icon-height","radius",...a],l=["texton-color","textoff-color","text-padding","allow-scale",...a],c=["column-height","text-color","allow-scale","letter-spacing","text-decoration","line-height","opacity",...a],u=["text-color","allow-scale","letter-spacing",...a];t.styleMap=new Map([["common",new Set([...n])],["div",new Set(["flex-direction","overflow","flex-wrap","justify-content","align-items","align-content","grid-template-columns","grid-template-rows","grid-row-start","grid-row-end","grid-column-start","grid-column-end","grid-gap","grid-columns-gap","grid-rows-gap"])],["text",new Set([...i])],["image",new Set(["object-fit","match-text-direction","fit-original-size"])],["span",new Set([...s])],["input",new Set(["font-size","font-family","font-weight","color","placeholder-color","allow-scale"])],["button",new Set([...p])],["switch",new Set([...l])],["refresh",new Set(["progress-color"])],["divider",new Set(["stroke-width","line-cap","color"])],["chart",new Set(["stroke-width","radius","start-angle","total-angle","center-x","center-y","colors","weights"])],["picker",new Set([...c])],["picker-view",new Set(["color","font-size","selected-color","selected-font-size","focus-color","focus-font-size","disappear-color","disappear-font-size","font-family"])],["slider",new Set(["color","selected-color","block-color"])],["swiper",new Set(["indicator-color","indicator-selected-color","indicator-size","indicator-top","indicator-right","indicator-bottom","indicator-left"])],["list",new Set(["flex-direction","columns","item-extent","fade-color"])],["list-item",new Set(["column-span"])],["progress",new Set(["color","stroke-width","background-color","secondary-color","scale-width","scale-number","start-angle","total-angle","center-x","center-y","radius"])],["select",new Set(["font-family"])],["menu",new Set([...u])],["option",new Set(["color","font-family","allow-scale","font-size","font-weight","text-decoration"])],["video",new Set(["object-fit"])],["clock",new Set(["font-family"])]]);const y=new Map([["common",new Set(["id","ref","disabled","focusable","data","if","for"])],["image",new Set(["src","alt"])],["button",new Set(["type","value","icon","waiting"])],["refresh",new Set(["offset","refreshing","type","lasttime","friction"])],["input",new Set(["type","checked","name","value","placeholder","maxlength","enterkeytype","headericon"])],["switch",new Set(["checked","showtext","texton","textoff"])],["option",new Set(["value","selected","icon"])],["chart",new Set(["type","percent","datasets","options"])],["picker",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","value","vibrate"])],["picker-view",new Set(["type","range","selected","start","end","lunar","lunarSwitch","columns","hours","containSecond","indicatorprefix","indicatorsuffix","vibrate"])],["slider",new Set(["min","max","step","showtips","showsteps","mode","value"])],["divider",new Set(["vertical"])],["list",new Set(["scrollpage","cachedcount","scrollbar","scrolleffect","shapemode","indexer","itemscale","itemcenter","updateeffect","scrollvibrate","initialindex","initialoffset"])],["list-item",new Set(["type","primary","section","sticky","stickyradius","clickeffect"])],["swiper",new Set(["index","autoplay","interval","indicator","digital","indicatordisabled","loop","duration","vertical"])],["progress",new Set(["type","percent","secondarypercent","clockwise"])],["menu",new Set(["target","title","type"])],["clock",new Set(["clockconfig","showdigit","hourswest"])],["badge",new Set(["placement","count","visible","maxcount","config","label"])],["video",new Set(["muted","src","autoplay","poster","controls","loop","starttime","direction","speed"])],["tabs",new Set(["index","vertical"])],["tab-bar",new Set(["mode"])],["tab-content",new Set(["scrollable"])]]),d=new Map([["common",new Set(["ontouchstart","ontouchmove","ontouchcancel","ontouchend","onclick","onlongpress","onfocus","onblur","onkey","onswipe"])],["image",new Set(["oncomplete","onerror"])],["input",new Set(["onchange","onenterkeyclick"])],["select",new Set(["onchange"])],["refresh",new Set(["onrefresh","onpulldown"])],["swiper",new Set(["onchange","onrotation"])],["list",new Set(["onindexerchange","onscroll","onscrollbottom","onscrolltop","onscrollend","onscrolltouchup","onrequestitem"])],["list-item",new Set(["onsticky"])],["menu",new Set(["onselected","oncancel"])],["picker",new Set(["oncolumnchange","onchange","oncancel"])],["picker-view",new Set(["oncolumnchange","onchange"])],["video",new Set(["onprepared","onstart","onpause","onfinish","onerror","onseeking","onseeked","ontimeupdate","onfullscreenchange","onstop"])],["tabs",new Set(["onchange"])],["switch",new Set(["onchange"])],["dialog",new Set(["oncancel"])],["slider",new Set(["onchange"])]]),f=new Map([["common",new Set(["onClick","onTouch","onAppear","onDisappear","onKeyEvent","onAreaChange"])],["image",new Set(["onComplete","onError","onFinish"])],["swiper",new Set(["onChange"])],["list",new Set(["onItemDelete","onScrollIndex","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDragStart","onItemDrop"])],["text-input",new Set(["onChange","onSubmit","onEditChanged"])],["refresh",new Set(["onStateChange","onRefreshing"])],["toggle",new Set(["onChange"])],["timePicker",new Set(["onChange"])],["textPicker",new Set(["onChange"])],["select",new Set(["onSelect"])],["datePicker",new Set(["onChange"])],["search",new Set(["onSubmit","onChange","onCopy","onCut","onPaste"])],["grid",new Set(["onScrollIndex","onItemDragStart","onItemDragEnter","onItemDragMove","onItemDragLeave","onItemDrop"])],["grid-item",new Set(["onSelect"])],["scroll",new Set(["onScroll","onScrollEdge","onScrollEnd","onScrollBegin"])],["navigation",new Set(["onTitleModeChange"])],["tabs",new Set(["onChange"])],["checkbox",new Set(["onChange"])],["checkboxGroup",new Set(["onChange"])]]);function m(e,t,r){const o=t.get(r);return void 0!==o&&o.has(e)}function g(e,r){return m(e,t.styleMap,"common")||m(e,t.styleMap,r)}function h(e,t){return(0,o.getDomain)()===o.Domain.ETS?m(e,f,"common")||m(e,f,t):E(e,t)||T(e,t)}function E(e,t){return m(e,y,"common")||m(e,y,t)}function T(e,t){return m(e,d,"common")||m(e,d,t)}t.isStyle=g,t.isAttribute=h,t.isContent=function(e){return"content"===e},t.isUnknown=function(e,t){return!g(e,t)&&!h(e,t)},t.isData=E,t.isEvent=T},8964:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkboxGroupProperties=t.checkboxProperties=void 0;const o=r(1513);t.checkboxProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"Select",property:"select-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Name",property:"name-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Group",property:"group-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}}],t.checkboxGroupProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"SelectAll",property:"selectAll-visual"},o.commonParamsForJudge),{defaults:!1})}]},3311:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dividerProperties=void 0;const o=r(1513);t.dividerProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign({name:"Vertical",property:"vertical-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"LineCap",property:"line-cap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.LINE_CAP_STYLE,defaults:"butt",list:[o.CLEAN_VALUE_NODE,{name:"Butt",value:"butt"},{name:"Round",value:"round"},{name:"Square",value:"square"}]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"StrokeWidth",property:"stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength}}]},3687:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flexProperties=void 0;const o=r(1513);t.flexProperties=[{propertySector:o.Sector.FLEXCHILD,propertySet:{name:"FlexBasis",property:"flex-basis-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength,defaults:"auto",fixedValues:["auto"],info:"The initial main size of a flex item. It sets the size of the content box otherwise set with box-sizing.",isLayout:!0}},{propertySector:o.Sector.FLEXCHILD,propertySet:{name:"AlignSelf",property:"align-self-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"auto",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis.",isLayout:!0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Direction",property:"flex-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_DIRECTION,defaults:"row",list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"RowReverse",value:"row-reverse"},{name:"Column",value:"column"},{name:"ColumnReverse",value:"column-reverse"}],info:"The direction of flex.",isLayout:!0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Wrap",property:"wrap-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_WRAP,defaults:"nowrap",list:[o.CLEAN_VALUE_NODE,{name:"NoWrap",value:"nowrap"},{name:"Wrap",value:"wrap"},{name:"WrapReverse",value:"wrap-reverse"}],info:"Whether flex items are forced onto one line or multiple lines.",isLayout:!0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"JustifyContent",property:"justify-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container",isLayout:!0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"JustifyContent",property:"justify-content-rc-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Allocate the space between and around the elements along the main axis of the flexible container",isLayout:!0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-flex-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ITEM_ALIGN,defaults:"stretch",list:[o.CLEAN_VALUE_NODE,{name:"Auto",value:"auto"},{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"Stretch",value:"stretch"},{name:"Baseline",value:"baseline"}],info:"The alignment of items on the Cross Axis.",isLayout:!0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignContent",property:"align-content-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FLEX_ALIGN,defaults:"flex-start",list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"flex-start"},{name:"Center",value:"center"},{name:"End",value:"flex-end"},{name:"SpaceBetween",value:"space-between"},{name:"SpaceAround",value:"space-around"},{name:"SpaceEvenly",value:"space-evenly"}],info:"Set the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis.",isLayout:!0}}]},4836:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridItemProperties=void 0;const o=r(1513);t.gridItemProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowStart",property:"row-start-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowEnd",property:"row-end-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnStart",property:"column-start-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnEnd",property:"column-end-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ForceRebuild",property:"force-rebuild-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selectable",property:"selectable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"true"}}]},6181:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gridProperties=void 0;const o=r(1513);t.gridProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnsTemplate",property:"columns-template-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowsTemplate",property:"rows-template-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ColumnsGap",property:"columns-gap-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength,defaults:0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"RowsGap",property:"rows-gap-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength,defaults:0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"LayoutDirection",property:"layout-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.GRID_DIRECTION,list:[o.CLEAN_VALUE_NODE,{name:"Row",value:"row"},{name:"Column",value:"column"},{name:"RowReverse",value:"row-reverse"},{name:"ColumnReverse",value:"column-reverse"}],defaults:"row"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MaxCount",property:"max-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER,defaults:1/0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MinCount",property:"min-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER,defaults:1}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"CellLength",property:"cell-length-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"MultiSelectable",property:"multi-selectable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SupportAnimation",property:"support-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}}]},8840:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listItemProperties=void 0;const o=r(1513);t.listItemProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Sticky",property:"sticky-visual",type:o.TypeName.SELECT,etsType:o.EtsType.STICKY,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"Normal",value:"normal"}],defaults:"none"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Editable",property:"editable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}]},8124:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listProperties=void 0;const o=r(1513);t.listProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"InitialIndex",property:"initial-index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:{name:"ListDirection",property:"list-direction-visual",type:o.TypeName.SELECT,etsType:o.EtsType.AXIS,list:[o.CLEAN_VALUE_NODE,{name:"Vertical",value:"vertical"},{name:"Horizontal",value:"horizontal"}],defaults:"vertical"}},{propertySector:o.Sector.MORE,propertySet:{name:"Color",property:"divider-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"StrokeWidth",property:"divider-stroke-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"StartMargin",property:"divider-start-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"EndMargin",property:"divider-end-margin-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.MORE,propertySet:{name:"EditMode",property:"edit-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}},{propertySector:o.Sector.MORE,propertySet:{name:"EdgeEffect",property:"edge-effect-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{name:"Spring",value:"spring"},{name:"None",value:"none"}],defaults:"spring"}},{propertySector:o.Sector.MORE,propertySet:{name:"ChainAnimation",property:"chain-animation-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[o.CLEAN_VALUE_NODE,{name:"true",value:"true"},{name:"false",value:"false"}],defaults:"false"}}]},5452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.navigationProperties=void 0;const o=r(1513);t.navigationProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Title",property:"navigation-title-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SubTitle",property:"subTitle-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Menus",property:"menus-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TitleMode",property:"titleMode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.NAVIGATION_TITLEMODE,list:[o.CLEAN_VALUE_NODE,{value:"Free"},{value:"Mini"},{value:"Full"}],defaults:"Mini"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ToolBar",property:"toolBar-visual",type:o.TypeName.BASE,etsType:o.EtsType.OBJECT,supportStaticProperty:!1,defaults:{}}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideToolBar",property:"hideToolBar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideTitleBar",property:"hideTitleBar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"HideBackButton",property:"hideBackButton-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"false"}}]},4090:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pickerProperties=void 0;const o=r(1513);t.pickerProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Range",property:"range-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selected",property:"datetime-selected-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Start",property:"start-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"End",property:"end-visual",type:o.TypeName.BASE,etsType:o.EtsType.DATE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"UseMilitaryTime",property:"useMilitaryTime-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Selected",property:"textPicker-selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"DefaultPickerItemHeight",property:"defaultPickerItemHeight-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["vp","px","lpx"]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Lunar",property:"lunar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}]},5302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshProperties=void 0;const o=r(1513);t.refreshProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Friction",property:"friction-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,defaults:62}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Offset",property:"offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength,defaults:16}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Refreshing",property:"refreshing-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,defaults:"false",list:[{name:"true",value:"true"},{name:"false",value:"false"}]}}]},4488:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scrollProperties=void 0;const o=r(1513);t.scrollProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.SCROLL_DIRECTION,list:[o.CLEAN_VALUE_NODE,{value:"Horizontal"},{value:"Vertical"},{value:"None"}],defaults:"Vertical",startApi:"9"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.SCROLL_DIRECTION,list:[o.CLEAN_VALUE_NODE,{value:"Horizontal"},{value:"Vertical"},{value:"None"},{value:"Free"}],defaults:"Vertical",endApi:"9"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBar",property:"scroll-bar-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_STATE,list:[o.CLEAN_VALUE_NODE,{value:"Off"},{value:"On"},{value:"Auto"}]}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBarColor",property:"scroll-bar-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.NON_R_COLOR}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ScrollBarWidth",property:"scroll-bar-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"EdgeEffect",property:"edge-effect-scroll-visual",type:o.TypeName.SELECT,etsType:o.EtsType.EDGE_EFFECT,list:[o.CLEAN_VALUE_NODE,{value:"Spring"},{value:"Fade"},{value:"None"}],defaults:"None"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scroller",property:"scroller-visual",type:o.TypeName.BASE,etsType:o.EtsType.SCROLLER,supportStaticProperty:!1}}]},128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchProperties=void 0;const o=r(1513),n=[{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontSize",property:"placeholder-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontStyle",property:"placeholder-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontWeight",property:"placeholder-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontFamily",property:"placeholder-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}}],a=[{propertySector:o.Sector.MORE,propertySet:{name:"TextFontSize",property:"text-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontStyle",property:"text-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontWeight",property:"text-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"TextFontFamily",property:"text-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.MORE,propertySet:{name:"TextAlign",property:"search-text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start"}}];t.searchProperties=[...n,...a,{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Controller",property:"search-controller-visual",type:o.TypeName.BASE,etsType:o.EtsType.SEARCH_CONTROLLER,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Icon",property:"icon-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Placeholder",property:"search-placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Value",property:"search-value-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.MORE,propertySet:{name:"SearchButton",property:"search-button-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.MORE,propertySet:{name:"CopyOption",property:"copy-option-visual",type:o.TypeName.SELECT,etsType:o.EtsType.COPY_OPTION,list:[o.CLEAN_VALUE_NODE,{name:"None",value:"None"},{name:"InApp",value:"InApp"},{name:"LocalDevice",value:"LocalDevice"}],defaults:"None",startApi:"9"}}]},1021:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectProperties=void 0;const o=r(1513),n=[{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontSize",property:"selected-option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontStyle",property:"selected-option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontColor",property:"selected-option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontWeight",property:"selected-option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionFontFamily",property:"selected-option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.SELECT,propertySet:{name:"SelectedOptionBackgroundColor",property:"selected-option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}],a=[{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontSize",property:"option-font-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.fontSizeUnit}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontStyle",property:"option-font-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal"}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontColor",property:"option-font-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontWeight",property:"option-font-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:o.fontWeightList,defaults:"normal"}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionFontFamily",property:"option-font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.OPTION,propertySet:{name:"OptionBackgroundColor",property:"option-bg-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}];t.selectProperties=[...n,...a,{propertySector:o.Sector.SELECT,propertySet:{name:"Value",property:"select-value-visual",type:o.TypeName.BASE,etsType:o.EtsType.STRING}},{propertySector:o.Sector.SELECT,propertySet:{name:"Selected",property:"selected-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.SELECT,propertySet:{name:"Options",property:"select-option-visual",type:o.TypeName.BASE,etsType:o.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}}]},8929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sliderProperties=void 0;const o=r(1513);t.sliderProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TrackColor",property:"track-color-visual",type:o.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ShowSteps",property:"show-steps-visual",type:o.TypeName.ADJUSTABLE}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"ShowTips",property:"show-tips-visual",type:o.TypeName.ADJUSTABLE}}]},1815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stackProperties=void 0;const o=r(1513);t.stackProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AlignContent",property:"align-content-stack-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ALIGNMENT,defaults:"center",list:o.alignProperties}}]},1492:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.swiperProperties=void 0;const o=r(1513);t.swiperProperties=[{propertySector:o.Sector.MORE,propertySet:Object.assign({name:"AutoPlay",property:"auto-play-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.MORE,propertySet:{name:"Interval",property:"interval-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign(Object.assign({name:"Loop",property:"loop-visual"},o.commonParamsForJudge),{defaults:!0})},{propertySector:o.Sector.MORE,propertySet:{name:"Duration",property:"duration-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:{name:"ItemSpace",property:"item-space-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH}},{propertySector:o.Sector.MORE,propertySet:{name:"CachedCount",property:"cached-count-visual",type:o.TypeName.BASE,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign({name:"DisableSwipe",property:"disable-swipe-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Index",property:"index-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}},{propertySector:o.Sector.MORE,propertySet:Object.assign(Object.assign({name:"Indicator",property:"indicator-visual"},o.commonParamsForJudge),{defaults:!0})}]},6153:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabContentProperties=void 0;const o=r(1513);t.tabContentProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TabBar Icon",property:"tabBar-icon-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_SRC}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"TabBar Text",property:"tabBar-text-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT}}]},6686:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tabsProperties=void 0;const o=r(1513);t.tabsProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Controller",property:"controller-visual",type:o.TypeName.BASE,etsType:o.EtsType.TABS_CONTROLLER,supportStaticProperty:!1,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Scrollable",property:"tabs-scrollable-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BOOLEAN,list:o.booleanListWithClean,defaults:"true"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarPosition",property:"bar-position-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_POSITION,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"End",value:"end"}],defaults:"start"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarMode",property:"bar-mode-visual",type:o.TypeName.SELECT,etsType:o.EtsType.BAR_MODE,list:[o.CLEAN_VALUE_NODE,{name:"Scrollable",value:"scrollable"},{name:"Fixed",value:"fixed"}],defaults:"fixed"}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarWidth",property:"bar-width-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"BarHeight",property:"bar-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:o.etsLength}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"AnimationDuration",property:"animation-duration-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:200}}]},3890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textInputProperties=void 0;const o=r(1513);t.textInputProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Placeholder",property:"placeholder-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"textInput-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.INPUT_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Password"},{value:"Email"},{value:"Number"}],defaults:"Normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderColor",property:"placeholderColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontSize",property:"placeholderFont-size-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp"]}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontWeight",property:"placeholderFont-weight-visual",type:o.TypeName.SELECT,etsType:`${o.EtsType.FONT_WEIGHT}|${o.EtsType.NUMBER}`,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Lighter"},{value:"Regular"},{value:"Medium"},{value:"Bold"},{value:"Bolder"},...o.commonFontWeight],defaults:"400"}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontFamily",property:"placeholderFont-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:""}},{propertySector:o.Sector.MORE,propertySet:{name:"PlaceholderFontStyle",property:"placeholderFont-style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.FONT_STYLE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"Italic"}],defaults:"Normal"}},{propertySector:o.Sector.MORE,propertySet:{name:"EnterKeyType",property:"enterKeyType-visual",type:o.TypeName.SELECT,etsType:o.EtsType.ENTER_KEY_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Go"},{value:"Search"},{value:"Send"},{value:"Next"},{value:"Done"}],defaults:"Done"}},{propertySector:o.Sector.MORE,propertySet:{name:"CaretColor",property:"caretColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.MORE,propertySet:{name:"MaxLength",property:"maxLength-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER}}]},8271:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.textComponentProperties=void 0;const o=r(1513);t.textComponentProperties=[{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextAlign",property:"text-align-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_ALIGN,list:[o.CLEAN_VALUE_NODE,{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"}],defaults:"start",isLayout:!0}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"LineHeight",property:"line-height-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_R_LENGTH,units:["fp","px","lpx"],isLayout:!0}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextOverflow",property:"text-overflow-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_OVERFLOW,list:[o.CLEAN_VALUE_NODE,{name:"Clip",value:"clip"},{name:"Ellipsis",value:"ellipsis"},{name:"None",value:"none"}],defaults:"clip",isLayout:!0}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"BaselineOffset",property:"baseline-offset-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.COMB_LENGTH,units:["fp","px","lpx"],isLayout:!0}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"DecorationType",property:"decoration-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_DECORATION_TYPE,list:[o.CLEAN_VALUE_NODE,{name:"Underline",value:"underline"},{name:"LineThrough",value:"line-through"},{name:"Overline",value:"overline"},{name:"None",value:"none"}],defaults:"none"}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"DecorationColor",property:"decoration-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.TEXTSTYLES,propertySet:{name:"TextCase",property:"text-case-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TEXT_CASE,list:[o.CLEAN_VALUE_NODE,{value:"Normal"},{value:"LowerCase"},{value:"UpperCase"}],defaults:"Normal"}}]},3460:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleProperties=void 0;const o=r(1513);t.toggleProperties=[{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"toggle-type-visual",type:o.TypeName.SELECT,etsType:o.EtsType.TOGGLE_TYPE,list:[o.CLEAN_VALUE_NODE,{value:"Button"},{value:"Checkbox"},{value:"Switch"}],defaults:"Button",isLayout:!0}},{propertySector:o.Sector.FEATURE_ETS,propertySet:Object.assign(Object.assign({name:"IsOn",property:"isOn-visual"},o.commonParamsForJudge),{defaults:!1})},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SelectedColor",property:"selectedColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE_ETS,propertySet:{name:"SwitchPointColor",property:"switchPointColor-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}}]},1290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.etsPropertyList=t.sizeProperties=void 0;const o=r(5958),n=r(1513),a=r(5302),i=r(3460),s=r(8271),p=r(3890),l=r(3311),c=r(8124),u=r(8840),y=r(3687),d=r(1492),f=r(1021),m=r(8929),g=r(4090),h=r(128),E=r(1815),T=r(4836),S=r(6181),P=r(4488),v=r(5452),b=r(6686),_=r(8964),N=r(6153),C=r(6486),O=(()=>{const e=C.cloneDeep(o.commonPropertyList),t=new Map([["color-visual",n.Sector.FEATURE_ETS],["value-visual",n.Sector.FEATURE_ETS],["total-visual",n.Sector.FEATURE_ETS],["style-visual",n.Sector.FEATURE_ETS],["font-family-visual",n.Sector.TEXTSTYLES],["max-lines-visual",n.Sector.TEXTSTYLES],["flex-grow-visual",n.Sector.FLEXCHILD],["flex-shrink-visual",n.Sector.FLEXCHILD],["aspect-ratio-visual",n.Sector.LAYOUT],["opacity-visual",n.Sector.EFFECT],["background-color-visual",n.Sector.BACKGROUND]]);return e.forEach((e=>{const r=e.propertySet.property;t.has(r)&&(e.propertySector=t.get(r))})),e})(),A=[{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontSize",property:"font-size-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.fontSizeUnit,min:0,isLayout:!0}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontStyle",property:"font-style-visual",type:n.TypeName.SELECT,etsType:n.EtsType.FONT_STYLE,list:[n.CLEAN_VALUE_NODE,{name:"Normal",value:"normal"},{name:"Italic",value:"italic"}],defaults:"normal",isLayout:!0}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontColor",property:"font-color-visual",type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR}},{propertySector:n.Sector.TEXTSTYLES,propertySet:{name:"FontWeight",property:"font-weight-visual",type:n.TypeName.SELECT,etsType:`${n.EtsType.FONT_WEIGHT}|${n.EtsType.NUMBER}`,list:n.fontWeightList,defaults:"400",isLayout:!0}}],M=[{propertySector:n.Sector.RENDER,propertySet:{name:"ForEach",property:"for-visual",type:n.TypeName.BASE,etsType:n.EtsType.ARRAY,supportStaticProperty:!1,defaults:""}},{propertySector:n.Sector.RENDER,propertySet:{name:"KeyGenerator",property:"keyGenerator-visual",type:n.TypeName.BASE,etsType:"Event",supportStaticProperty:!1,defaults:""}},{propertySector:n.Sector.RENDER,propertySet:{name:"Item",property:"item-visual",type:n.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Item of ForEach Array"}},{propertySector:n.Sector.RENDER,propertySet:{name:"Idx",property:"idx-visual",type:n.TypeName.BASE,supportDynamicProperty:!1,info:"Variable Name for Index of Corresponding Item In ForEach Array"}}],w={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsUnit,placeholder:"0",isLayout:!0};t.sizeProperties=[{propertySector:n.Sector.SIZE,propertySet:{name:"Width",property:"width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsUnit,min:0,isLayout:!0}},{propertySector:n.Sector.SIZE,propertySet:{name:"Height",property:"height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsUnit,min:0,isLayout:!0}},{propertySector:n.Sector.SIZE,propertySet:{name:"MinWidth",property:"constraint-size-min-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsUnit,min:0,isLayout:!0}},{propertySector:n.Sector.SIZE,propertySet:{name:"MinHeight",property:"constraint-size-min-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsUnit,min:0,isLayout:!0}},{propertySector:n.Sector.SIZE,propertySet:{name:"MaxWidth",property:"constraint-size-max-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsUnit,min:0,isLayout:!0}},{propertySector:n.Sector.SIZE,propertySet:{name:"MaxHeight",property:"constraint-size-max-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsUnit,min:0,isLayout:!0}},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"Margin",property:"margin-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"Padding",property:"padding-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginTop",property:"margin-top-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginRight",property:"margin-right-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginBottom",property:"margin-bottom-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"MarginLeft",property:"margin-left-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingTop",property:"padding-top-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingRight",property:"padding-right-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingBottom",property:"padding-bottom-visual"},w)},{propertySector:n.Sector.SPACING,propertySet:Object.assign({name:"PaddingLeft",property:"padding-left-visual"},w)}];const R={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength,isLayout:!0},x={type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,units:n.etsLength},L={type:n.TypeName.COLOR,etsType:n.EtsType.COMB_COLOR},I=[{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomString",property:"custom-string-visual",type:n.TypeName.BASE,etsType:n.EtsType.STRING}},{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomNumber",property:"custom-number-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER}},{propertySector:n.Sector.CUSTOM,propertySet:{name:"CustomBoolean",property:"custom-boolean-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,list:n.booleanListWithClean,defaults:"false"}}],F=[{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderWidth",property:"border-width-visual"},R)},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderStyle",property:"border-style-visual"},n.commonParamsForBorder)},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderColor",property:"border-color-visual"},L)},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderRadius",property:"border-radius-visual"},x)},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderTopWidth",property:"border-top-width-visual"},R),startApi:"9"},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderTopStyle",property:"border-top-style-visual"},n.commonParamsForBorder),startApi:"9"},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderTopColor",property:"border-top-color-visual"},L),startApi:"9"},{propertySector:n.Sector.BORDER,propertySet:Object.assign(Object.assign({name:"BorderTopLeftRadius",property:"border-top-left-radius-visual"},x),{startApi:"9"})},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderRightWidth",property:"border-right-width-visual"},R),startApi:"9"},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderRightStyle",property:"border-right-style-visual"},n.commonParamsForBorder),startApi:"9"},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderRightColor",property:"border-right-color-visual"},L),startApi:"9"},{propertySector:n.Sector.BORDER,propertySet:Object.assign(Object.assign({name:"BorderTopRightRadius",property:"border-top-right-radius-visual"},x),{startApi:"9"})},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderBottomWidth",property:"border-bottom-width-visual"},R),startApi:"9"},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderBottomStyle",property:"border-bottom-style-visual"},n.commonParamsForBorder),startApi:"9"},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderBottomColor",property:"border-bottom-color-visual"},L),startApi:"9"},{propertySector:n.Sector.BORDER,propertySet:Object.assign(Object.assign({name:"BorderBottomRightRadius",property:"border-bottom-right-radius-visual"},x),{startApi:"9"})},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderLeftWidth",property:"border-left-width-visual"},R),startApi:"9"},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderLeftStyle",property:"border-left-style-visual"},n.commonParamsForBorder),startApi:"9"},{propertySector:n.Sector.BORDER,propertySet:Object.assign({name:"BorderLeftColor",property:"border-left-color-visual"},L),startApi:"9"},{propertySector:n.Sector.BORDER,propertySet:Object.assign(Object.assign({name:"BorderBottomLeftRadius",property:"border-bottom-left-radius-visual"},x),{startApi:"9"})}],k=[{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageSrc",property:"background-image-src-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_SRC}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageRepeat",property:"background-image-repeat-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_REPERT,list:[n.CLEAN_VALUE_NODE,{name:"X",value:"repeat-x"},{name:"Y",value:"repeat-y"},{name:"XY",value:"repeat"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImageSize",property:"background-image-size-visual",type:n.TypeName.DATA_SELECT_INPUT,etsType:`${n.EtsType.IMAGE_SIZE}|${n.EtsType.STRING}`,list:[n.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Auto",value:"auto"}],defaults:"Auto"}},{propertySector:n.Sector.BACKGROUND,propertySet:{name:"BackgroundImagePosition",property:"background-image-position-visual",type:n.TypeName.DATA_SELECT_INPUT,etsType:`${n.EtsType.ALIGNMENT}|${n.EtsType.STRING}`,list:[n.CLEAN_VALUE_NODE,{name:"TopStart",value:"top left"},{name:"Top",value:"top center"},{name:"TopEnd",value:"top right"},{name:"Start",value:"center left"},{name:"Center",value:"center center"},{name:"End",value:"center right"},{name:"BottomStart",value:"bottom left"},{name:"Bottom",value:"bottom center"},{name:"BottomEnd",value:"bottom right"}],defaults:"0 0"}}],B=[{propertySector:n.Sector.LAYOUT,propertySet:{name:"Location",property:"position-visual",type:n.TypeName.SELECT,defaults:"offset",supportDynamicProperty:!1,list:[n.CLEAN_VALUE_NODE,{name:"offset",value:"relative"},{name:"position",value:"absolute"}],isLayout:!0}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"X",property:"left-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"],isLayout:!0}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"Y",property:"top-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_R_LENGTH,defaults:0,units:["vp","px","lpx"],isLayout:!0}}],D=[{propertySector:n.Sector.LAYOUT,propertySet:{name:"DisplayPriority",property:"display-priority-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,isLayout:!0}},{propertySector:n.Sector.EFFECT,propertySet:{name:"Visibility",property:"visibility-visual",type:n.TypeName.SELECT,etsType:n.EtsType.VISIBILITY,defaults:"visible",list:[n.CLEAN_VALUE_NODE,{name:"Visible",value:"visible"},{name:"Hidden",value:"hidden"},{name:"None",value:"none"}],isLayout:!0}},{propertySector:n.Sector.EFFECT,propertySet:{name:"Enabled",property:"enabled-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"true",list:[{value:"true"},{value:"false"}]}},{propertySector:n.Sector.LAYOUT,propertySet:{name:"Align",property:"align-visual",type:n.TypeName.SELECT,etsType:n.EtsType.ALIGNMENT,defaults:"center",list:n.alignProperties}},{propertySector:n.Sector.RENDER,propertySet:{name:"If",property:"if-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"",list:[{name:"true",value:"true"},{name:"false",value:"false"}],isLayout:!0}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Space",property:"space-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.COMB_LENGTH,units:["vp","px","lpx"],requires:{"display-visual":["flex","cleanValue"]},info:"Space between any two adjacent child components.",isLayout:!0}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-row-visual",type:n.TypeName.SELECT,etsType:n.EtsType.VERTICAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[n.CLEAN_VALUE_NODE,{value:"flex-start",name:"top",etsEnumValue:"Top"},{value:"flex-end",name:"bottom",etsEnumValue:"Bottom"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the vertical direction.",isLayout:!0}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"AlignItems",property:"align-items-column-visual",type:n.TypeName.SELECT,etsType:n.EtsType.HORIZONTAL_ALIGN,defaults:"center",requires:{"display-visual":["flex","cleanValue"]},list:[n.CLEAN_VALUE_NODE,{value:"flex-start",name:"start",etsEnumValue:"Start"},{value:"flex-end",name:"end",etsEnumValue:"End"},{value:"center",name:"center",etsEnumValue:"Center"}],info:"Alignment mode of child components in the horizontal direction.",isLayout:!0}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Src",property:"src-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_SRC}},{propertySector:n.Sector.MORE,propertySet:{name:"Alt",property:"alt-visual",type:n.TypeName.BASE,etsType:n.EtsType.COMB_CONTENT}},{propertySector:n.Sector.MORE,propertySet:{name:"RenderMode",property:"render-mode-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_RENDER_MODE,defaults:"original",list:[n.CLEAN_VALUE_NODE,{name:"Original",value:"original"},{name:"Template",value:"template"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"ObjectRepeat",property:"object-repeat-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_REPERT,defaults:"no-repeat",list:[n.CLEAN_VALUE_NODE,{name:"X",value:"X"},{name:"Y",value:"Y"},{name:"XY",value:"XY"},{name:"NoRepeat",value:"no-repeat"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"ObjectFit",property:"object-fit-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_FIT,defaults:"cover",list:[n.CLEAN_VALUE_NODE,{name:"Cover",value:"cover"},{name:"Contain",value:"contain"},{name:"Fill",value:"fill"},{name:"None",value:"none"},{name:"ScaleDown",value:"scale-down"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"InterPolation",property:"interpolation-visual",type:n.TypeName.SELECT,etsType:n.EtsType.IMAGE_INTERPOLATION,defaults:"none",list:[n.CLEAN_VALUE_NODE,{name:"None",value:"none"},{name:"High",value:"high"},{name:"Medium",value:"medium"},{name:"Low",value:"low"}]}},{propertySector:n.Sector.MORE,propertySet:{name:"SourceSizeWidth",property:"source-size-width-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,units:["px"]}},{propertySector:n.Sector.MORE,propertySet:{name:"SourceSizeHeight",property:"source-size-height-visual",type:n.TypeName.INTEGER,etsType:n.EtsType.NUMBER,units:["px"]}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Type",property:"type-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BUTTON_TYPE,defaults:"capsule",list:[{name:"Normal",value:"normal"},{name:"Capsule",value:"capsule"},{name:"Circle",value:"circle"}]}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"StateEffect",property:"state-effect-visual",type:n.TypeName.SELECT,etsType:n.EtsType.BOOLEAN,defaults:"true",list:n.booleanList}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Content",property:"content-visual",type:n.TypeName.ADJUSTABLE,etsType:n.EtsType.COMB_CONTENT,isLayout:!0,full:1}},{propertySector:n.Sector.FEATURE_ETS,propertySet:{name:"Label",property:"label-visual",type:n.TypeName.ADJUSTABLE,etsType:n.EtsType.COMB_CONTENT,full:1}}];t.etsPropertyList=[...I,...F,...t.sizeProperties,...A,...M,...i.toggleProperties,..._.checkboxProperties,..._.checkboxGroupProperties,...s.textComponentProperties,...p.textInputProperties,...l.dividerProperties,...B,...c.listProperties,...u.listItemProperties,...y.flexProperties,...d.swiperProperties,...a.refreshProperties,...f.selectProperties,...m.sliderProperties,...O,...k,...g.pickerProperties,...h.searchProperties,...P.scrollProperties,...v.navigationProperties,...b.tabsProperties,...N.tabContentProperties,...D,...E.stackProperties,...T.gridItemProperties,...S.gridProperties]},5958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonPropertyList=void 0;const o=r(1513);t.commonPropertyList=[{propertySector:o.Sector.GENERAL,propertySet:{name:"BackgroundColor",property:"background-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Display",property:"display-visual",type:o.TypeName.SELECT,defaults:"flex",list:[o.CLEAN_VALUE_NODE,{value:"flex"},{value:"none"}]}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Opacity",property:"opacity-visual",type:o.TypeName.SLIDER,etsType:o.EtsType.COMB_R_NUMBER,defaults:"1",step:.01,max:1,min:0,full:1}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Overflow",property:"overflow-visual",type:o.TypeName.SELECT,defaults:"visible",list:[o.CLEAN_VALUE_NODE,{value:"visible"},{value:"hidden"},{value:"scroll"}]}},{propertySector:o.Sector.FLEX,propertySet:{name:"FlexGrow",property:"flex-grow-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:"0",requiresParent:{display:["flex","cleanValue"]},info:"The flex grow factor of a flex item's main size",isLayout:!0}},{propertySector:o.Sector.FLEX,propertySet:{name:"FlexShrink",property:"flex-shrink-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:"1",requiresParent:{display:["flex","cleanValue"]},info:"The flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items will shrink",isLayout:!0}},{propertySector:o.Sector.FLEX,propertySet:{name:"Columns",property:"columns-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:1,info:"The column number of flex."}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Header Logo",property:"headerLogo-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Title",property:"title-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Status",property:"status-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.GENERAL,propertySet:{name:"Logo",property:"logo-visual",type:o.TypeName.BASE,defaults:""}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Color",property:"color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FontFamily",property:"font-family-visual",type:o.TypeName.BASE,etsType:o.EtsType.COMB_CONTENT,defaults:"sans-serif",isLayout:!0}},{propertySector:o.Sector.FEATURE,propertySet:{name:"MaxLines",property:"max-lines-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,isLayout:!0}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextColor",property:"text-color-visual",type:o.TypeName.COLOR,defaults:"rgba(0,0,0,0.9)"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FocusColor",property:"focus-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"DisappearColor",property:"disappear-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorColor",property:"indicator-color-visual",type:o.TypeName.COLOR}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorSelectedColor",property:"indicator-selected-color-visual",type:o.TypeName.COLOR,defaults:"#ff007dff"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IndicatorSize",property:"indicator-size-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorTop",property:"indicator-top-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorRight",property:"indicator-right-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorBottom",property:"indicator-bottom-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"IndicatorLeft",property:"indicator-left-visual"},o.commonParamsForIndicator)},{propertySector:o.Sector.FEATURE,propertySet:{name:"AllowScale",property:"allow-scale-visual",type:o.TypeName.SELECT,defaults:"true",list:[o.CLEAN_VALUE_NODE,{value:"true"},{value:"false"}]}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowStart",property:"grid-row-start-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its row in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnStart",property:"grid-column-start-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The start position of its column in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowEnd",property:"grid-row-end-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its row in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnEnd",property:"grid-column-end-visual",type:o.TypeName.INTEGER,requiresParent:{display:["grid"]},info:"The end position of its column in the grid area."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridTemplateRows",property:"grid-template-rows-visual",type:o.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid rows."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridTemplateColumns",property:"grid-template-columns-visual",type:o.TypeName.BASE,defaults:"1fr",requires:{"display-visual":["grid"]},info:"The number of items in the grid columns."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridRowsGap",property:"grid-rows-gap-visual",type:o.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's grid rows."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridColumnsGap",property:"grid-columns-gap-visual",type:o.TypeName.INTEGER,defaults:"0px",units:["px"],requires:{"display-visual":["grid"]},info:"The size of the gap between an element's columns."}},{propertySector:o.Sector.GRID,propertySet:{name:"GridGap",property:"grid-gap-visual",type:o.TypeName.INTEGER,units:["px"],requires:{"display-visual":["grid"]},info:"The gaps between rows and columns. It is a shorthand for row-gap and column-gap."}},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"MatchTextDirection",property:"match-text-direction-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:Object.assign({name:"FitOriginalSize",property:"fit-original-size-visual"},o.commonParamsForJudge)},{propertySector:o.Sector.FEATURE,propertySet:{name:"IconWidth",property:"icon-width-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"IconHeight",property:"icon-height-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextonColor",property:"texton-color-visual",type:o.TypeName.COLOR,defaults:"#000000"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextoffColor",property:"textoff-color-visual",type:o.TypeName.COLOR,defaults:"#000000"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TextPadding",property:"text-padding-visual",type:o.TypeName.INTEGER,defaults:0,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SelectedColor",property:"selected-color-visual",type:o.TypeName.COLOR,defaults:"rgba(0,125,255,1)"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"BlockColor",property:"block-color-visual",type:o.TypeName.COLOR,defaults:"#ffffff"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Radius",property:"radius-visual",type:o.TypeName.INTEGER,units:["px"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"StartAngle",property:"start-angle-visual",type:o.TypeName.INTEGER,defaults:240}},{propertySector:o.Sector.FEATURE,propertySet:{name:"TotalAngle",property:"total-angle-visual",type:o.TypeName.INTEGER,defaults:240}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CenterX",property:"center-x-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"CenterY",property:"center-y-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Colors",property:"colors-visual",type:o.TypeName.BASE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Weights",property:"weights-visual",type:o.TypeName.BASE}},{propertySector:o.Sector.FEATURE,propertySet:{name:"PlaceHolderColor",property:"placeholder-color-visual",type:o.TypeName.COLOR,defaults:"gray"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ProgressColor",property:"progress-color-visual",type:o.TypeName.COLOR,etsType:o.EtsType.COMB_COLOR,defaults:"black"}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ItemExtent",property:"item-extent-visual",type:o.TypeName.INTEGER,units:["px","%"]}},{propertySector:o.Sector.FEATURE,propertySet:{name:"FadeColor",property:"fade-color-visual",type:o.TypeName.COLOR,defaults:"grey"}},{propertySector:o.Sector.FLEX,propertySet:{name:"ColumnSpan",property:"column-span-visual",type:o.TypeName.INTEGER,defaults:1,min:1,info:"The number of span."}},{propertySector:o.Sector.ATOMIC,propertySet:{name:"FlexWeight",property:"flex-weight-visual",type:o.TypeName.INTEGER}},{propertySector:o.Sector.ATOMIC,propertySet:{name:"AspectRatio",property:"aspect-ratio-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,isLayout:!0}},{propertySector:o.Sector.FEATURE,propertySet:{name:"SecondaryColor",property:"secondary-color-visual",type:o.TypeName.COLOR,requires:{type:["horizontal","ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ScaleWidth",property:"scale-width-visual",type:o.TypeName.INTEGER,requires:{type:["ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"ScaleNumber",property:"scale-number-visual",type:o.TypeName.INTEGER,defaults:120,requires:{type:["ring","scale-ring"]}}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Value",property:"value-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:0}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Total",property:"total-visual",type:o.TypeName.INTEGER,etsType:o.EtsType.NUMBER,defaults:100}},{propertySector:o.Sector.FEATURE,propertySet:{name:"Style",property:"style-visual",type:o.TypeName.SELECT,etsType:o.EtsType.PROGRESS_STYLE,defaults:"Linear",list:[{value:"Linear"}]}}]},1513:(e,t)=>{"use strict";var r,o,n,a,i,s,p;Object.defineProperty(t,"__esModule",{value:!0}),t.alignProperties=t.booleanListWithClean=t.booleanList=t.fontWeightList=t.fontSizeUnit=t.etsUnit=t.etsLength=t.commonFontWeight=t.commonParamsForBorderRadius=t.commonParamsForIndicator=t.commonParamsForInteger=t.commonParamsForJudge=t.commonParamsForBorder=t.CLEAN_VALUE_NODE=t.EtsSpecialType=t.EtsCombinationType=t.EtsBasicType=t.EtsEnumType=t.EtsType=t.TypeName=t.Sector=void 0,function(e){e.GENERAL="general",e.DIMENSION="dimension",e.FEATURE="feature",e.FEATURE_ETS="feature_ets",e.SIZE="size",e.SPACING="spacing",e.BORDER="border",e.BACKGROUND="background",e.LAYOUT="layout",e.RENDER="render",e.FLEX="flex",e.FLEXCHILD="flexchild",e.GRID="grid",e.ATOMIC="atomic",e.CUSTOM="custom",e.TEXT="text",e.TEXTSTYLES="textstyles",e.SELECT="select",e.OPTION="option",e.EFFECT="effect",e.MORE="more",e.PAGEDATA="pagedata"}(r||(r={})),t.Sector=r,function(e){e.BASE="base",e.INTEGER="integer",e.SELECT="select",e.COLOR="color",e.COMPOSITE="composite",e.SLIDER="slider",e.DATA_SELECT_INPUT="dataSelectInput",e.ADJUSTABLE="adjustable"}(o||(o={})),t.TypeName=o,function(e){e.ARRAY="ETSArray",e.BOOLEAN="boolean",e.DATE="Date",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(n||(n={})),t.EtsBasicType=n,function(e){e.R_FLOAT="Rfloat",e.R_STRING="Rstring",e.R_COLOR="Rcolor",e.R_PLURAL="Rplural",e.R_MEDIA="Rmedia",e.R_RAWFILE="Rrawfile"}(a||(a={})),function(e){e.ALIGNMENT="Alignment",e.AXIS="Axis",e.BORDER_STYLE="BorderStyle",e.BUTTON_TYPE="ButtonType",e.COLOR="Color",e.DIRECTION="Direction",e.EDGE_EFFECT="EdgeEffect",e.ENTER_KEY_TYPE="EnterKeyType",e.NAVIGATION_TITLEMODE="NavigationTitleMode",e.FLEX_ALIGN="FlexAlign",e.FLEX_DIRECTION="FlexDirection",e.FLEX_WRAP="FlexWrap",e.FONT_STYLE="FontStyle",e.FONT_WEIGHT="FontWeight",e.HORIZONTAL_ALIGN="HorizontalAlign",e.IMAGE_FIT="ImageFit",e.IMAGE_INTERPOLATION="ImageInterpolation",e.IMAGE_RENDER_MODE="ImageRenderMode",e.IMAGE_REPERT="ImageRepeat",e.IMAGE_SIZE="ImageSize",e.INPUT_TYPE="InputType",e.ITEM_ALIGN="ItemAlign",e.LINE_CAP_STYLE="LineCapStyle",e.PROGRESS_STYLE="ProgressStyle",e.STICKY="Sticky",e.TEXT_ALIGN="TextAlign",e.TEXT_OVERFLOW="TextOverflow",e.TEXT_DECORATION_TYPE="TextDecorationType",e.TEXT_CASE="TextCase",e.TOGGLE_TYPE="ToggleType",e.VERTICAL_ALIGN="VerticalAlign",e.VISIBILITY="Visibility",e.COPY_OPTION="CopyOption",e.BAR_STATE="BarState",e.GRID_DIRECTION="GridDirection",e.SCROLL_DIRECTION="ScrollDirection",e.BAR_POSITION="BarPosition",e.BAR_MODE="BarMode"}(i||(i={})),t.EtsEnumType=i,function(e){e.COMB_COLOR="string|number|Color|Rcolor",e.COMB_LENGTH="string|number",e.COMB_R_NUMBER="number|Rfloat",e.COMB_R_LENGTH="string|number|Rfloat",e.COMB_CONTENT="string|Rstring|Rplural",e.COMB_SRC="string|Rmedia|Rrawfile",e.NON_R_COLOR="string|number|Color"}(s||(s={})),t.EtsCombinationType=s,function(e){e.SCROLLER="Scroller",e.TABS_CONTROLLER="TabsController",e.SEARCH_CONTROLLER="SearchController"}(p||(p={})),t.EtsSpecialType=p;const l=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),a),i),s),p);t.EtsType=l;const c={value:"cleanValue",name:"---Clean Value---"};t.CLEAN_VALUE_NODE=c;const u={type:o.SELECT,etsType:l.BORDER_STYLE,list:[c,{value:"dotted",etsEnumValue:"Dotted"},{value:"dashed",etsEnumValue:"Dashed"},{value:"solid",etsEnumValue:"Solid"}]};t.commonParamsForBorder=u;const y={type:o.SELECT,etsType:l.BOOLEAN,defaults:"false",list:[c,{value:"true"},{value:"false"}]};t.commonParamsForJudge=y;const d={type:o.INTEGER,units:["px"],placeholder:"0px"};t.commonParamsForInteger=d;const f={type:o.INTEGER,units:["px","%"]};t.commonParamsForIndicator=f;const m={type:o.INTEGER,units:["px"]};t.commonParamsForBorderRadius=m;const g=[{value:"100"},{value:"200"},{value:"300"},{value:"400"},{value:"500"},{value:"600"},{value:"700"},{value:"800"},{value:"900"}];t.commonFontWeight=g,t.etsLength=["vp","px","lpx"],t.etsUnit=["vp","px","%","lpx"],t.fontSizeUnit=["fp","px","lpx"];const h=[c,{name:"Normal",value:"normal"},{name:"Lighter",value:"lighter"},{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"},{name:"Bolder",value:"bolder"},...g];t.fontWeightList=h;const E=[{name:"true",value:"true"},{name:"false",value:"false"}];t.booleanList=E;const T=[c,...E];t.booleanListWithClean=T;const S=[c,{name:"TopStart",value:"top-start"},{name:"Top",value:"top"},{name:"TopEnd",value:"top-end"},{name:"Start",value:"start"},{name:"Center",value:"center"},{name:"End",value:"end"},{name:"BottomStart",value:"bottom-start"},{name:"Bottom",value:"bottom"},{name:"BottomEnd",value:"bottom-end"}];t.alignProperties=S},9282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TagTypeMap=void 0,t.TagTypeMap=new Map([["button","TextContent"],["span","TextContent"],["divider","TextContent"],["picker","TextContent"],["option","TextContent"],["clock","TextContent"],["image","Base"],["input","Base"],["chart","Base"],["slider","Base"],["progress","Base"],["text","Text"],["div","Container"],["list","Container"],["list-item","Container"],["list-item-group","Container"],["refresh","Container"],["dialog","Container"],["stack","Container"],["menu","Container"],["select","Container"],["tabs","Container"],["tab-bar","Container"],["tab-content","Container"],["scroll","Container"],["navigation","Container"]])},4294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.beforeCodegen=t.getCustomCompRelativePath=t.getRelativePath=t.getNpmPath=t.prepareCustomCompTagName=t.capitalize=t.getTagName=t.strToBase64=t.getUniqueName=t.getUniqueId=t.removeFromArray=t.getDataName=void 0;const o=r(2891);function n(e){let t=a(e).replace(/[/=+]/g,"");const r=t.length;return r>=4&&(t=t.substring(r/2-2,r/2+2)),t}function a(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");let r="";for(let t=0;t{const t=r.indexOf(e);-1!==t&&r.splice(t,1)})),r},t.getUniqueId=n,t.getUniqueName=function(e){return`${e}_${n(e)}`},t.strToBase64=a;const i=new Map,s=new Map;function p(e){return e[0].toUpperCase()+e.slice(1)}function l(e){const t=(0,o.getInstance)().document.path;if(0===e.size)return;const r=p(t.substring(t.lastIndexOf("/")+1));e.forEach(((e,o)=>{var n;const a=e.length,l=[...e];o===r&&l.push(t);const y=function(e){e.sort();const t=e[0],r=e[e.length-1];let o=0;for(let e=0;e1||o===r)&&(d=p(e[l].substring(y+1).split("/").join("_")),d=d.replace("src_main_supervisual_",""),d=d.replace(/-/g,"_")),s.set(e[l],d);let f=u(e[l],t);f=null!==(n=c(e[l]))&&void 0!==n?n:f,i.set(d,f)}}))}function c(e){let t=e;const r=t.match(/\/(?:\/node|oh)_modules\/(.+\/)?(?=[\w-]+\/src\/main\/)/);if(null===r)return;const o=r[0],n=r[1],a=void 0!==n&&""!==n?"@"+n:"";return t=t.replace("src/main/supervisual","src/main/ets"),t.replace(o,a)}function u(e,t){const r=e.split("/"),o=t.split("/");let n=0;for(let e=0;e1){const o=p(r[r.length-1]),n=t.get(o);void 0===n?t.set(o,[e.type]):n.push(e.type)}const o=e.children;for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormAction=t.FormModel=void 0,t.FormModel=class{constructor(){this.data=new Map,this.actions=new Map}},t.FormAction=class{constructor(e,t,r,o){this.action=e,this.abilityName=o,this.want=r,this.params=t}}},1509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeForVersion1=t.rootToVisualContent=t.visualToRootContent=t.serializeForVersion1=void 0;const o=r(2891),n=r(1933),a=r(7571),i=r(9282),s=r(5945),p=r(7977),l=r(6486),c=new Map;function u(e){c.set("textMap",new Map);const t=y(null!=e?e:(0,o.getInstance)().visualModel),r={VisualVersion:"1",content:JSON.stringify(t),extraData:JSON.stringify(m(c))};return null==e&&(r.contentV12=JSON.stringify((0,o.getInstance)(),p.replacer,4)),JSON.stringify(r)}function y(e){const t=(0,l.cloneDeep)(e);"huaweiLogin"!==t.type&&"huaweiPay"!==t.type||(t.type="button");const r=Array.from(t.property).filter((e=>(0,a.isAttribute)(e[0],t.type)));r.push(["id",t.id]);const o=Array.from(t.property).filter((e=>(0,a.isStyle)(e[0],t.type)));let n=i.TagTypeMap.get(t.type);void 0===n&&(n="Base");let s=t.property.has("content")?t.property.get("content"):[];if(t.children.length>0){if("string"==typeof s){const e=c.get("textMap");e instanceof Map&&e.set(t.id,s)}s=t.children.map((e=>y(e)))}return{id:t.id,tagName:t.type,attributes:r,idStyle:o,type:n,content:s}}function d(e,t){let r;if(t instanceof Map){const o=t.get("textMap");o instanceof Map&&(r=o.get(e.id))}const o=new n.VisualModel({id:e.id,type:e.tagName,property:new Map([...e.attributes,...e.idStyle])});return"string"==typeof r&&o.property.set("content",r),o.property.delete("id"),"string"==typeof e.content&&o.property.set("content",e.content),Array.isArray(e.content)&&(o.children=e.content.map((e=>d(e,t)))),o}function f(e){if(e instanceof Array&&e.length>0&&"$$map"===e[0]){e.shift();const t=new Map;for(const[r,o]of e)t.set(r,f(o));return t}return e}function m(e){if(e instanceof Map){const t=["$$map"];for(const[r,o]of e)t.push([r,m(o)]);return t}return e}t.serializeForVersion1=u,t.visualToRootContent=function(e){try{return u(JSON.parse(e,p.reviver).visualModel)}catch(e){console.error("convert visual model to root model failed")}return e},t.rootToVisualContent=function(e){const t=JSON.parse(e),r=JSON.parse(t.content);let o='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(o=JSON.parse(t.extraData));const n=d(r,f(o));return n.property.has("flex-direction")||n.property.set("flex-direction","column"),JSON.stringify({document:{VisualVersion:"12",type:"FA"},visualModel:n,formData:new s.FormModel},p.replacer)},t.deserializeForVersion1=function(e){try{const t=JSON.parse(e);if(null!==t.contentV12&&void 0!==t.contentV12)return void(0,o.setInstance)(JSON.parse(t.contentV12,p.reviver));const r=JSON.parse(t.content);let n='["$$map",["textMap",["$$map"]]]';"string"==typeof t.extraData&&(n=JSON.parse(t.extraData)),(0,o.getInstance)().visualModel=d(r,f(n)),(0,o.getInstance)().visualModel.property.has("flex-direction")||(0,o.getInstance)().visualModel.property.set("flex-direction","column")}catch(e){console.error("convert error")}}},2891:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setInstance=t.getInstance=t.setVisualPath=t.clearCustomInstance=t.setCustomInstance=t.getInstanceTemplate=t.getCustomInstance=void 0;const o=r(1933),n=r(5945),a=r(904),i={document:{VisualVersion:"12",type:"FA",custom:!1,path:""},visualModel:new o.VisualModel({type:"div",id:"wrapper"}),formData:new n.FormModel,imgData:void 0,customData:void 0,cloudQuery:void 0},s=new Map;t.getCustomInstance=function(){return s},t.getInstanceTemplate=function(e){return{document:{VisualVersion:"12",type:"ETS",custom:e,path:"&path"},visualModel:new o.VisualModel({type:"column",id:"wrapper"}),imgData:""}},t.setCustomInstance=function(e,t){var r;const n={path:"",document:{VisualVersion:"",type:"",custom:!0},visualModel:new o.VisualModel({type:"",id:""}),methods:[],property:[],imgData:"",originType:[],isEditable:!0,originPath:""};n.path=e.path,n.isEditable=e.isEditable,n.originPath=e.originPath;for(const e in n)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);n.visualModel=null!==(r=n.visualModel.children[0])&&void 0!==r?r:new o.VisualModel({type:"text"}),s.set(e.path,n)},t.clearCustomInstance=function(){s.clear()},t.setVisualPath=function(e){i.document.path=e},t.getInstance=function(){return i},t.setInstance=function(e){var t,r,o,n;for(const t in i)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);const s=i.document.type;void 0===i.document.custom&&(i.document.custom=!1),null!==((null!==(r=(null===(t=e.customData)||void 0===t?void 0:t.property.size)>0)&&void 0!==r?r:null)||(null!==(n=(null===(o=e.customData)||void 0===o?void 0:o.event.size)>0)&&void 0!==n?n:null))&&(i.customData=e.customData),(0,a.setDomain)("ETS"===s?a.Domain.ETS:"FORM"===s?a.Domain.FORM:a.Domain.FA)}},7977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInstanceEqual=t.reviver=t.replacer=t.serializeSketchPage=t.serializeCustom=t.deserializeCustom=t.deserialize=t.serialize=void 0;const o=r(1933),n=r(2891),a=r(1509);function i(e,t){if(t instanceof Map)return{dataType:"Map",value:Object.fromEntries(t.entries())};if(t instanceof Set)return{dataType:"Set",value:Array.from(t.entries())};if(t instanceof o.VisualModel){const e=new o.VisualModel({type:"none"}),r={};for(const o in e)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return{dataType:"VisualModel",value:r}}return t}function s(e,t){if("object"==typeof t&&null!=t){if("Map"===t.dataType)return new Map(Object.entries(t.value));if("Set"===t.dataType)return new Set(t.value);if("VisualModel"===t.dataType){const e=new o.VisualModel({type:""});Object.assign(e,t.value),t=e}}return t}t.serialize=function(e,t){return 1===e?(0,a.serializeForVersion1)(t):JSON.stringify(null!=t?t:(0,n.getInstance)(),i,4)},t.deserialize=function(e){if("1"===JSON.parse(e).VisualVersion)return(0,a.deserializeForVersion1)(e);const t=JSON.parse(e,s);(0,n.setInstance)(t)},t.deserializeCustom=function(e,t){const r=JSON.parse(t,s);(0,n.setCustomInstance)(e,r)},t.serializeCustom=function(e){const t=(0,n.getInstanceTemplate)(!0);return t.visualModel.property=new Map([["width","100%"],["height","100%"]]),t.visualModel.children.push(e),JSON.stringify(t,i,4)},t.serializeSketchPage=function(e){const t=(0,n.getInstanceTemplate)(!1);return t.visualModel=e,JSON.stringify(t,i,4)},t.replacer=i,t.reviver=s,t.isInstanceEqual=function(e,t){return JSON.stringify(e,i)===JSON.stringify(t,i)}},1933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VisualModel=void 0;const r="-visual";t.VisualModel=class{constructor(e){if(this.propertyStorage=void 0,this.dynamicPropertyStorage=void 0,this.mediaProperty=void 0,this.dynamicMediaProperty=void 0,this.mediaPropertyStorage=void 0,this.dynamicMediaPropertyStorage=void 0,this.slots=void 0,this.property=void 0!==e.property?e.property:new Map,this.dynamicProperty=void 0!==e.dynamicProperty?e.dynamicProperty:new Map,this.children=void 0!==e.children?e.children:[],"wrapper"===e.type)return this.id="wrapper",void(this.type="div");e.type.endsWith(r)&&(e.type=e.type.substring(0,e.type.length-r.length)),this.id=void 0!==e.id?e.id:"",this.type=e.type,this.slots=e.slots}getProperty(e){const t=this.dynamicProperty.get(e);return void 0!==t&&""!==t?t:this.property.get(e)}hasMediaProperty(e){if(void 0!==this.mediaProperty)for(const[,t]of this.mediaProperty)if(null==t?void 0:t.has(e))return!0;if(void 0!==this.dynamicMediaProperty)for(const[,t]of this.dynamicMediaProperty)if(null==t?void 0:t.has(e))return!0;return!1}hasProperty(e){return this.dynamicProperty.has(e)||this.property.has(e)}getChildren(){var e;const t=[...this.children];for(const[,r]of null!==(e=this.slots)&&void 0!==e?e:new Map)t.push(r);return t}accept(e){return e.visit(this)}}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={id:o,loaded:!1,exports:{}};return e[o].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var o={};(()=>{"use strict";var e=o;Object.defineProperty(e,"__esModule",{value:!0});const t=r(3784),n=r(2891),a=r(8413),i=r(4435),s=r(6486),p=r(4294),l=r(6483),c={build:"",etsImport:"",etsVariable:"",etsFunction:"",aboutToAppear:""};e.genETS=function(e){var r;const o={ets:(0,s.cloneDeep)(c),errorType:"",errorMessage:""};if((0,l.parseSourceCode)(e,o),""!==o.errorType)return o.ets=(0,s.cloneDeep)(c),o;try{let e=(0,n.getInstance)().visualModel;if((0,n.getInstance)().document.custom&&(e=e.children[0],void 0===e))return o;(0,p.beforeCodegen)(e);const t=function(e){const t=new a.ETSBridge,r=e.accept(t),o=(new i.StringWriter).genETS(r);return t.getErrorCount()>0?"error":o}(e);"error"===t&&(o.errorType="codegenError"),o.ets=t}catch(e){o.errorType="modelError"}return""!==o.errorType&&(o.errorMessage=null!==(r=t.errorMap.get(o.errorType))&&void 0!==r?r:"Codegen visual file failed",o.ets=(0,s.cloneDeep)(c)),o}})();var n=exports;for(var a in o)n[a]=o[a];o.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})(); \ No newline at end of file -- Gitee From 1e717b23cf5c6b13f063376f9b8fbc144e2b9b0c Mon Sep 17 00:00:00 2001 From: longwei Date: Wed, 15 Feb 2023 02:06:05 +0000 Subject: [PATCH 361/379] adapt srcEntry for schema Change-Id: I3a4193fd30482c1452020d8fb94ce11f5d3be5f8 Signed-off-by: longwei --- compiler/main.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index e78c238..0f3c2e2 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -358,7 +358,7 @@ function setAbilityFile(projectConfig, abilityPages) { projectConfig.entryObj[entryPageKey] = projectAbilityPath + '?entry'; } else { throw Error( - `\u001b[31m ERROR: srcEntrance file '${projectAbilityPath.replace(/\\/g, '/')}' does not exist. \u001b[39m` + `\u001b[31m ERROR: srcEntry file '${projectAbilityPath.replace(/\\/g, '/')}' does not exist. \u001b[39m` ).message; } }); @@ -368,7 +368,11 @@ function readAbilityEntrance(moduleJson) { let abilityPages = []; if (moduleJson.module) { const moduleSrcEntrance = moduleJson.module.srcEntrance; - if (moduleSrcEntrance) { + const moduleSrcEntry = moduleJson.module.srcEntry; + if (moduleSrcEntry) { + abilityPages.push(moduleSrcEntry); + abilityPagesFullPath.push(getAbilityFullPath(projectConfig.projectPath, moduleSrcEntry)); + } else if (moduleSrcEntrance) { abilityPages.push(moduleSrcEntrance); abilityPagesFullPath.push(getAbilityFullPath(projectConfig.projectPath, moduleSrcEntrance)); } @@ -386,7 +390,10 @@ function readAbilityEntrance(moduleJson) { function setEntrance(abilityConfig, abilityPages) { if (abilityConfig && abilityConfig.length > 0) { abilityConfig.forEach(ability => { - if (ability.srcEntrance) { + if (ability.srcEntry) { + abilityPages.push(ability.srcEntry) + abilityPagesFullPath.push(getAbilityFullPath(projectConfig.projectPath, ability.srcEntry)) + } else if (ability.srcEntrance) { abilityPages.push(ability.srcEntrance); abilityPagesFullPath.push(getAbilityFullPath(projectConfig.projectPath, ability.srcEntrance)); } -- Gitee From db869c4b9abefe8e78f669392f1a2feaca64c8cd Mon Sep 17 00:00:00 2001 From: bojiang Date: Wed, 15 Feb 2023 15:48:11 +0800 Subject: [PATCH 362/379] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 回退对any类型的校验 Signed-off-by: bojiang Change-Id: Ia3bc8813f62af54ae3e44eea962b19f9784e581d --- compiler/src/process_component_member.ts | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 5fe7f0b..67b5a75 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -856,8 +856,13 @@ export function isSimpleType(typeNode: ts.TypeNode, program: ts.Program, log?: L } else if (program) { checker = program.getTypeChecker(); } - if (typeNode.kind === ts.SyntaxKind.AnyKeyword && log) { - checkTypeAny(typeNode, log); + if (typeNode.parent && typeNode.parent.name && + typeNode.kind === ts.SyntaxKind.AnyKeyword && log) { + log.push({ + type: LogType.WARN, + message: `Please define an explicit type, not any.`, + pos: typeNode.getStart() + }); } return getDeclarationType(typeNode, checker, log); } @@ -872,10 +877,6 @@ function getDeclarationType(typeNode: ts.TypeNode, checker: ts.TypeChecker, log: if (type.flags & (32 | 1024)) { return true; } - /* Any */ - if ((type.flags & 1) && typeNode.kind !== ts.SyntaxKind.AnyKeyword && log) { - checkTypeAny(typeNode, log); - } // @ts-ignore if (type.types && type.types.length) { // @ts-ignore @@ -1153,10 +1154,3 @@ function validatePropDecorator(decorators: ts.NodeArray): boolean return false; } -function checkTypeAny(typeNode: ts.TypeNode, log: LogInfo[]): void { - log.push({ - type: LogType.WARN, - message: `Please define an explicit type, not any.`, - pos: typeNode.getStart() - }); -} -- Gitee From 89645c2bc497572dcb72ced1149419f76a271e1d Mon Sep 17 00:00:00 2001 From: Guangyao Ma Date: Wed, 15 Feb 2023 15:41:02 +0800 Subject: [PATCH 363/379] fix: fix up cardobj to cardEntryObj of ProjectConfig Signed-off-by: Guangyao Ma Change-Id: I3b438d329c52c8d02f1aa3ba98233e2b114fda64 --- compiler/src/ets_checker.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index 5a9dc96..c844a54 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -235,11 +235,18 @@ export function printDiagnostic(diagnostic: ts.Diagnostic): void { if (process.env.watchMode !== 'true' && !projectConfig.xtsMode) { updateErrorFileCache(diagnostic); } + // FIXME: will be instead of ts.Diagnostics config - if (diagnostic.file && !projectConfig.cardObj[diagnostic.file.fileName.replace(/\//g, '\\')] && - /can't support form application./.test(message)) { - return; + if (diagnostic.file) { + const absPath = diagnostic.file.fileName; + const relativePath = path.relative(projectConfig.projectPath, absPath); + const cardEntryObjKey = `.././${relativePath}`.replace(/\.ets$/, ''); + if (!projectConfig.cardEntryObj[cardEntryObjKey] && + /can't support form application./.test(message)) { + return; + } } + checkerResult.count += 1; if (diagnostic.file) { const { line, character }: ts.LineAndCharacter = -- Gitee From 8d7b13bf7bdbe3b235b0731d0dd97322a6401527 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 13 Feb 2023 21:53:47 +0800 Subject: [PATCH 364/379] houhaoyu@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 共享包package.json可以不设置入口 Signed-off-by: houhaoyu Change-Id: Id5e9bb3d067cace97f84f5f87b7366964d189913 --- compiler/main.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index e78c238..0ee7ceb 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -193,9 +193,9 @@ function buildManifest(manifest, aceConfigPath) { } function getPackageJsonEntryPath() { - let rootPackageJsonPath = path.resolve(projectConfig.projectPath, '../../../' + projectConfig.packageJson); + const rootPackageJsonPath = path.resolve(projectConfig.projectPath, '../../../' + projectConfig.packageJson); if (fs.existsSync(rootPackageJsonPath)) { - let rootPackageJsonContent = JSON.parse(fs.readFileSync(rootPackageJsonPath, 'utf-8')); + const rootPackageJsonContent = JSON.parse(fs.readFileSync(rootPackageJsonPath, 'utf-8')); if (rootPackageJsonContent) { if (rootPackageJsonContent.module) { getEntryPath(rootPackageJsonContent.module, rootPackageJsonPath); @@ -204,7 +204,7 @@ function getPackageJsonEntryPath() { } else { getEntryPath('', rootPackageJsonPath); } - } else { + } else if (projectConfig.compileHar) { throw Error('\u001b[31m' + 'lack message in ' + projectConfig.packageJson + '.' + '\u001b[39m').message; } } @@ -217,7 +217,7 @@ function supportSuffix(mainEntryPath) { mainEntryPath = path.join(mainEntryPath, 'index.ts'); } else if (fs.existsSync(path.join(mainEntryPath, 'index.js'))) { mainEntryPath = path.join(mainEntryPath, 'index.js'); - } else { + } else if (projectConfig.compileHar) { throw Error('\u001b[31m' + 'not find entry file in ' + projectConfig.packageJson + '.' + '\u001b[39m').message; } return mainEntryPath; @@ -238,16 +238,16 @@ function supportExtName(mainEntryPath) { function getEntryPath(entryPath, rootPackageJsonPath) { let mainEntryPath = path.resolve(rootPackageJsonPath, '../', entryPath); - if (fs.statSync(mainEntryPath).isDirectory()) { + if (fs.existsSync(mainEntryPath) && fs.statSync(mainEntryPath).isDirectory()) { mainEntryPath = supportSuffix(mainEntryPath); } else { mainEntryPath = supportExtName(mainEntryPath); } - if (fs.existsSync(mainEntryPath)) { - let entryKey = path.relative(projectConfig.projectPath, mainEntryPath); + if (fs.existsSync(mainEntryPath) && fs.statSync(mainEntryPath).isFile()) { + const entryKey = path.relative(projectConfig.projectPath, mainEntryPath); projectConfig.entryObj[entryKey] = mainEntryPath; abilityPagesFullPath.push(mainEntryPath); - } else { + } else if (projectConfig.compileHar) { throw Error('\u001b[31m' + 'not find entry file in package.json.' + '\u001b[39m').message; } } -- Gitee From 21c6dc75e207c40af11c8cfc93d935a9331f8edf Mon Sep 17 00:00:00 2001 From: congjiye Date: Thu, 16 Feb 2023 10:37:10 +0800 Subject: [PATCH 365/379] fix fa visual map generate path Signed-off-by: congjiye --- compiler/src/process_visual.ts | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/compiler/src/process_visual.ts b/compiler/src/process_visual.ts index 0575e0e..935825b 100644 --- a/compiler/src/process_visual.ts +++ b/compiler/src/process_visual.ts @@ -254,8 +254,9 @@ function generateSourceMapForNewAndOriEtsFile(resourcePath: string, content: str let visualMapDirPath: string = path.resolve(process.env.cachePath, SUPERVISUAL + visualDirPath.replace(etsDirPath, '')); if (!visualDirPath.includes(etsDirPath)) { + const projectRootPath = getProjectRootPath(); visualMapDirPath = path.resolve(process.env.cachePath, SUPERVISUAL + - visualDirPath.replace(projectConfig.projectRootPath, '')); + visualDirPath.replace(projectRootPath, '')); } if (!(fs.existsSync(visualMapDirPath) && fs.statSync(visualMapDirPath).isDirectory())) { mkDir(visualMapDirPath); @@ -267,6 +268,18 @@ function generateSourceMapForNewAndOriEtsFile(resourcePath: string, content: str }); } +function getProjectRootPath(): string { + let projectRootPath = projectConfig.projectRootPath; + if (!projectRootPath) { + if (!projectConfig.aceModuleJsonPath) { + projectRootPath = path.resolve(projectConfig.projectPath, '../../../../../'); + } else { + projectRootPath = path.resolve(projectConfig.projectPath, '../../../../'); + } + } + return projectRootPath; +} + function findVisualFile(filePath: string): string { let etsDirPath: string = path.parse(projectConfig.projectPath).dir; let visualDirPath: string = path.parse(projectConfig.aceSuperVisualPath).dir; @@ -276,14 +289,7 @@ function findVisualFile(filePath: string): string { return resolvePath; } try { - let projectRootPath = projectConfig.projectRootPath; - if (!projectRootPath) { - if (!projectConfig.aceModuleJsonPath) { - projectRootPath = path.resolve(projectConfig.projectPath, '../../../../../'); - } else { - projectRootPath = path.resolve(projectConfig.projectPath, '../../../../'); - } - } + const projectRootPath = getProjectRootPath(); let moduleName = ''; const relativePath = filePath.replace(projectRootPath, ''); const moduleNames = relativePath.split(path.sep); -- Gitee From 54448dec7b76587a6b8784c829fb476d1afc04b3 Mon Sep 17 00:00:00 2001 From: hufeng Date: Thu, 16 Feb 2023 17:18:27 +0800 Subject: [PATCH 366/379] Adjust log type from error to warning in validateReExportType Signed-off-by: hufeng Change-Id: I5212cd99158f65c61a0a93ae6f8146941ed17cef --- compiler/src/validate_module_syntax.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/src/validate_module_syntax.ts b/compiler/src/validate_module_syntax.ts index b003c3d..001eb49 100644 --- a/compiler/src/validate_module_syntax.ts +++ b/compiler/src/validate_module_syntax.ts @@ -229,17 +229,17 @@ function addErrorLogIfReExportType(sourceFile: ts.SourceFile, log: LogInfo[], ty typeIdentifier = moduleNode.importClause.name!.escapedText.toString(); } const posOfNode: ts.LineAndCharacter = sourceFile.getLineAndCharacterOfPosition(moduleNode.getStart()); - let errorMessage: string = `The re-export name '${typeIdentifier}' need to be marked as type, `; - errorMessage += ts.isImportDeclaration(moduleNode) ? "please use 'import type'." : "please use 'export type'."; - const error: LogInfo = { - type: LogType.ERROR, - message: errorMessage, + let warningMessage: string = `The re-export name '${typeIdentifier}' need to be marked as type, `; + warningMessage += ts.isImportDeclaration(moduleNode) ? "please use 'import type'." : "please use 'export type'."; + const warning: LogInfo = { + type: LogType.WARN, + message: warningMessage, pos: moduleNode.getStart(), fileName: sourceFile.fileName, line: posOfNode.line + 1, column: posOfNode.character + 1 } - log.push(error); + log.push(warning); }); } -- Gitee From 7d38748dae4f7d5d3cf97e74ad68b237d2d45121 Mon Sep 17 00:00:00 2001 From: lihong Date: Thu, 16 Feb 2023 20:33:47 +0800 Subject: [PATCH 367/379] lihong67@huawei.com remove renderChunk in fastbuild mode. Signed-off-by: lihong Change-Id: Id3c696800c228218f48a02d47b4b1a0c2922b507 --- .../ets_ui/rollup-plugin-ets-typescript.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts index 70ec19f..9e64ba9 100644 --- a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts +++ b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts @@ -59,18 +59,6 @@ export function etsTransform() { return { name: 'etsTransform', transform: transform, - renderChunk(code, chunk) { - const magicString = new MagicString(code); - if (projectConfig.compileMode === JSBUNDLE && - [abilityConfig.abilityEntryFile].concat(abilityConfig.projectAbilityPath) - .concat(abilityConfig.testRunnerFile).includes(chunk.facadeModuleId)) { - code = code.replace(/module\.exports/, 'globalThis.exports.default'); - } - return { - code: code, - map: magicString.generateMap() - }; - }, moduleParsed(moduleInfo) { if (projectConfig.compileHar) { if (moduleInfo.id && !moduleInfo.id.match(/node_modules/)) { -- Gitee From 442d40e1ce354f68b753a500bd3f394084f3c457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Fri, 17 Feb 2023 15:41:15 +0800 Subject: [PATCH 368/379] lizhouze@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/src/process_component_class.ts | 24 ++++++++++++++++++++++++ compiler/src/process_component_member.ts | 8 -------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index 214b066..becb0a6 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -722,6 +722,7 @@ function createHeritageClause(): ts.HeritageClause { function createTypeReference(decoratorName: string, type: ts.TypeNode, log: LogInfo[], program: ts.Program): ts.TypeNode { let newType: ts.TypeNode; + let isCheckAny: boolean = true; switch (decoratorName) { case COMPONENT_STATE_DECORATOR: case COMPONENT_PROVIDE_DECORATOR: @@ -765,6 +766,12 @@ function createTypeReference(decoratorName: string, type: ts.TypeNode, log: LogI type || ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword), ]); break; + default: + isCheckAny = false; + break; + } + if (isCheckAny) { + checkAny(type, log); } return newType; } @@ -772,6 +779,7 @@ function createTypeReference(decoratorName: string, type: ts.TypeNode, log: LogI function createTypeReferencePU(decoratorName: string, type: ts.TypeNode, log: LogInfo[], program: ts.Program): ts.TypeNode { let newType: ts.TypeNode; + let isCheckAny: boolean = true; switch (decoratorName) { case COMPONENT_STATE_DECORATOR: case COMPONENT_PROVIDE_DECORATOR: @@ -815,6 +823,22 @@ function createTypeReferencePU(decoratorName: string, type: ts.TypeNode, log: Lo type || ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword), ]); break; + default: + isCheckAny = false; + break; + } + if (isCheckAny) { + checkAny(type, log); } return newType; } + +function checkAny(typeNode: ts.TypeNode, log: LogInfo[]): void { + if (typeNode.kind === ts.SyntaxKind.AnyKeyword && log) { + log.push({ + type: LogType.WARN, + message: `Please define an explicit type, not any.`, + pos: typeNode.getStart() + }); + } +} diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index 67b5a75..07f984b 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -856,14 +856,6 @@ export function isSimpleType(typeNode: ts.TypeNode, program: ts.Program, log?: L } else if (program) { checker = program.getTypeChecker(); } - if (typeNode.parent && typeNode.parent.name && - typeNode.kind === ts.SyntaxKind.AnyKeyword && log) { - log.push({ - type: LogType.WARN, - message: `Please define an explicit type, not any.`, - pos: typeNode.getStart() - }); - } return getDeclarationType(typeNode, checker, log); } -- Gitee From aa8064ab1c6a3044fca041e136f35318f601ce08 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Fri, 17 Feb 2023 17:23:43 +0800 Subject: [PATCH 369/379] houhaoyu@huawei.com preview open pu Signed-off-by: houhaoyu Change-Id: I44ddafa1771443783cdf6a9db6acec6b429fb726 --- compiler/main.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 3557ab3..1217970 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -699,9 +699,6 @@ function isPartialUpdate(metadata) { } function partialUpdateController(minAPIVersion, metadata = null) { - if (projectConfig.isPreview) { - return; - } if (minAPIVersion >= 9) { partialUpdateConfig.partialUpdateMode = true; } -- Gitee From b83204c1263fe2028b378200f447b6d7bb2d46f4 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Fri, 17 Feb 2023 17:08:11 +0800 Subject: [PATCH 370/379] Fix arkCompiler cluster exit listener always exist of rollup & webpack Signed-off-by: zhangrengao Change-Id: I41668433ae28955337a297a72077682b1fa43978 --- compiler/src/fast_build/ark_compiler/common/common_mode.ts | 1 + compiler/src/fast_build/ark_compiler/module/module_mode.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/src/fast_build/ark_compiler/common/common_mode.ts b/compiler/src/fast_build/ark_compiler/common/common_mode.ts index cc958d2..7cc34fb 100644 --- a/compiler/src/fast_build/ark_compiler/common/common_mode.ts +++ b/compiler/src/fast_build/ark_compiler/common/common_mode.ts @@ -113,6 +113,7 @@ export class CommonMode { } setupCluster(cluster: any): void { + cluster.removeAllListeners('exit'); if (nodeLargeOrEqualTargetVersion(16)) { cluster.setupPrimary({ exec: this.genAbcScriptPath, diff --git a/compiler/src/fast_build/ark_compiler/module/module_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_mode.ts index 753f155..88ae1cf 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_mode.ts @@ -362,8 +362,8 @@ export class ModuleMode extends CommonMode { getSplittedModulesByNumber() { const result: any = []; - if (this.moduleInfos.size < this.workerNumber) { - for (const value of this.moduleInfos.values()) { + if (this.filterModuleInfos.size < this.workerNumber) { + for (const value of this.filterModuleInfos.values()) { result.push([value]); } return result; @@ -374,7 +374,7 @@ export class ModuleMode extends CommonMode { } let pos: number = 0; - for (const value of this.moduleInfos.values()) { + for (const value of this.filterModuleInfos.values()) { const chunk = pos % this.workerNumber; result[chunk].push(value); pos++; -- Gitee From 086296c18f2f7b037dac1efd252bcb5fb25d3116 Mon Sep 17 00:00:00 2001 From: zhouzebin Date: Sat, 18 Feb 2023 18:35:27 +0800 Subject: [PATCH 371/379] fix aot not work for IDE rebuild Signed-off-by: zhouzebin Change-Id: I2244a0c9b0744bf63b4fc2212ee74d99270255bc --- .../ark_compiler/common/process_ark_config.ts | 4 ++-- .../ark_compiler/module/module_mode.ts | 21 +++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts b/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts index 31d32c5..f9a3a63 100644 --- a/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts +++ b/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts @@ -79,8 +79,8 @@ export function initArkProjectConfig(share: any) { arkProjectConfig.processTs = true; arkProjectConfig.pandaMode = TS2ABC; arkProjectConfig.anBuildOutPut = buildJsonInfo.anBuildOutPut; - projectConfig.anBuildMode = buildJsonInfo.anBuildMode; - projectConfig.apPath = buildJsonInfo.apPath; + arkProjectConfig.anBuildMode = buildJsonInfo.anBuildMode; + arkProjectConfig.apPath = buildJsonInfo.apPath; } else { arkProjectConfig.processTs = false; arkProjectConfig.pandaMode = buildJsonInfo.pandaMode; diff --git a/compiler/src/fast_build/ark_compiler/module/module_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_mode.ts index 88ae1cf..b54d98a 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_mode.ts @@ -425,17 +425,26 @@ export class ModuleMode extends CommonMode { this.generateNpmEntryToGenProto(); this.generateProtoFilesInfo(); this.mergeProtoToAbc(); - if (needAotCompiler(this.projectConfig)) { - let faultHandler: FaultHandler = ((error: string) => { this.throwArkTsCompilerError(error); }) - const builtinAbcPath: string = generateBuiltinAbc(this.arkConfig.arkRootPath, this.cmdArgs, - this.projectConfig.cachePath, this.logger, faultHandler); - generateAot(this.arkConfig.arkRootPath, builtinAbcPath, this.projectConfig, this.logger, faultHandler); - } + this.processAotIfNeeded(); this.afterCompilationProcess(); } this.triggerEndSignal(); }); + if (this.workerNumber == 0) { + // process aot for no source file changed. + this.processAotIfNeeded(); + } + } + } + + private processAotIfNeeded(): void { + if (!needAotCompiler(this.projectConfig)) { + return; } + let faultHandler: FaultHandler = ((error: string) => { this.throwArkTsCompilerError(error); }) + const builtinAbcPath: string = generateBuiltinAbc(this.arkConfig.arkRootPath, this.cmdArgs, + this.projectConfig.cachePath, this.logger, faultHandler); + generateAot(this.arkConfig.arkRootPath, builtinAbcPath, this.projectConfig, this.logger, faultHandler); } private genFileCachePath(filePath: string, projectPath: string, cachePath: string, -- Gitee From c3e7d7b824167781aa4430fcc2a7511f0125275f Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 13 Feb 2023 21:45:37 +0800 Subject: [PATCH 372/379] houhaoyu@huawei.com support state variable in builder Signed-off-by: houhaoyu Change-Id: I3123b3ff25874eafb25d0c3564e11a897c1f0cfa --- compiler/src/component_map.ts | 1 + compiler/src/pre_define.ts | 4 +- compiler/src/pre_process.ts | 2 +- compiler/src/process_component_build.ts | 143 +++++++++++++++++++++-- compiler/src/process_component_class.ts | 23 ++-- compiler/src/process_component_member.ts | 17 ++- compiler/src/process_custom_component.ts | 17 ++- compiler/src/process_import.ts | 8 +- compiler/src/process_ui_syntax.ts | 30 ++--- compiler/src/validate_ui_syntax.ts | 9 +- 10 files changed, 204 insertions(+), 50 deletions(-) diff --git a/compiler/src/component_map.ts b/compiler/src/component_map.ts index 0397fa7..bfadcf2 100644 --- a/compiler/src/component_map.ts +++ b/compiler/src/component_map.ts @@ -99,6 +99,7 @@ export const STYLES_ATTRIBUTE: Set = new Set(); export const INTERFACE_NODE_SET: Set = new Set(); export const INNER_CUSTOM_BUILDER_METHOD: Set = new Set(); +export const GLOBAL_CUSTOM_BUILDER_METHOD: Set = new Set(); export const JS_BIND_COMPONENTS: Set = new Set([ 'ForEach', 'LazyForEach', ...GESTURE_TYPE_NAMES, 'Gesture', diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index 07f2d0e..b4a3a1c 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -226,7 +226,7 @@ export const BIND_POPUP: string = 'bindPopup'; export const BIND_POPUP_SET: Set = new Set(['bindPopup']); export const BIND_DRAG_SET: Set = new Set(['onDragStart', 'onItemDragStart']); export const BIND_OBJECT_PROPERTY: Map> = new Map([ - ['Navigation', new Set(['title'])], + ['Navigation', new Set(['title'])], ['NavDestination', new Set(['title'])], ['ListItem', new Set(['swipeAction'])] ]); @@ -390,3 +390,5 @@ export const CALL = 'call'; export const RESERT = 'reset'; export const TS_NOCHECK: string = '// @ts-nocheck'; + +export const BUILDER_PARAM_PROXY: string = 'makeBuilderParameterProxy'; diff --git a/compiler/src/pre_process.ts b/compiler/src/pre_process.ts index 4e9b936..3e2345c 100644 --- a/compiler/src/pre_process.ts +++ b/compiler/src/pre_process.ts @@ -17,7 +17,7 @@ import { validateUISyntax, processSystemApi, ReplaceResult, - sourceReplace, + sourceReplace } from './validate_ui_syntax'; import { LogInfo, diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 229f095..38ef71c 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -101,7 +101,8 @@ import { CREATE_BIND_COMPONENT, TabContentAndNavDestination, START, - END + END, + BUILDER_PARAM_PROXY } from './pre_define'; import { INNER_COMPONENT_NAMES, @@ -118,6 +119,7 @@ import { COMMON_ATTRS, CUSTOM_BUILDER_PROPERTIES, INNER_CUSTOM_BUILDER_METHOD, + GLOBAL_CUSTOM_BUILDER_METHOD, ID_ATTRS } from './component_map'; import { @@ -333,15 +335,19 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme break; case ComponentType.customBuilderMethod: parent = undefined; - if (CUSTOM_BUILDER_METHOD.has(name)) { - newStatements.push(addInnerBuilderParameter(item, isGlobalBuilder)); + if (partialUpdateConfig.partialUpdateMode) { + newStatements.push(transferBuilderCall(item, name, isBuilder)); } else { - newStatements.push(item); + newStatements.push(addInnerBuilderParameter(item, isGlobalBuilder)); } break; case ComponentType.builderParamMethod: parent = undefined; - newStatements.push(addInnerBuilderParameter(item)); + if (partialUpdateConfig.partialUpdateMode) { + newStatements.push(transferBuilderCall(item, name, isBuilder)); + } else { + newStatements.push(addInnerBuilderParameter(item)); + } break; case ComponentType.function: parent = undefined; @@ -369,6 +375,119 @@ export function processComponentChild(node: ts.Block | ts.SourceFile, newStateme } } +function transferBuilderCall(node: ts.ExpressionStatement, name: string, + isBuilder: boolean = false): ts.ExpressionStatement { + if (node.expression && ts.isCallExpression(node.expression) && node.expression.arguments && + node.expression.arguments.length === 1 && ts.isObjectLiteralExpression(node.expression.arguments[0])) { + return ts.factory.createExpressionStatement(ts.factory.createCallExpression( + ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + node.expression.expression, + ts.factory.createIdentifier(BUILDER_ATTR_BIND) + ), + undefined, + [ts.factory.createThis()] + ), + undefined, + [ts.factory.createCallExpression( + ts.factory.createIdentifier(BUILDER_PARAM_PROXY), + undefined, + [ + ts.factory.createStringLiteral(name), + traverseBuilderParams(node.expression.arguments[0], isBuilder) + ] + )] + )); + } else { + return ts.factory.createExpressionStatement(ts.factory.createCallExpression( + ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + node.expression.expression, + ts.factory.createIdentifier(BUILDER_ATTR_BIND) + ), + undefined, + [ts.factory.createThis()] + ), + undefined, + node.expression.arguments + )); + } +} + +function traverseBuilderParams(node: ts.ObjectLiteralExpression, + isBuilder: boolean): ts.ObjectLiteralExpression { + const properties: ts.ObjectLiteralElementLike[] = []; + if (node.properties && node.properties.length) { + node.properties.forEach(property => { + if (ts.isPropertyAssignment(property) && property.initializer && + ts.isPropertyAccessExpression(property.initializer) && property.initializer.expression && + property.initializer.name && ts.isIdentifier(property.initializer.name)) { + const name: string = property.initializer.name.escapedText.toString(); + if (!isBuilder && property.initializer.expression.kind === ts.SyntaxKind.ThisKeyword || + isBuilder && ts.isIdentifier(property.initializer.expression) && + property.initializer.expression.escapedText.toString() === $$) { + addProperties(properties, property, name, isBuilder); + } else { + properties.push(ts.factory.createPropertyAssignment( + property.name, + ts.factory.createArrowFunction( + undefined, + undefined, + [], + undefined, + ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), + property.initializer + ) + )); + } + } else { + properties.push(ts.factory.createPropertyAssignment( + property.name, + ts.factory.createArrowFunction( + undefined, + undefined, + [], + undefined, + ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), + property.initializer + ) + )); + } + }); + } + return ts.factory.createObjectLiteralExpression(properties); +} + +function addProperties(properties: ts.ObjectLiteralElementLike[], property: ts.ObjectLiteralElementLike, + name: string, isBuilder: boolean): void { + properties.push(ts.factory.createPropertyAssignment( + property.name, + ts.factory.createArrowFunction( + undefined, + undefined, + [], + undefined, + ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), + ts.factory.createParenthesizedExpression(ts.factory.createConditionalExpression( + ts.factory.createElementAccessExpression( + isBuilder ? ts.factory.createIdentifier($$) : ts.factory.createThis(), + ts.factory.createStringLiteral('__' + name) + ), + ts.factory.createToken(ts.SyntaxKind.QuestionToken), + ts.factory.createElementAccessExpression( + isBuilder ? ts.factory.createIdentifier($$) : ts.factory.createThis(), + ts.factory.createStringLiteral('__' + name) + ), + ts.factory.createToken(ts.SyntaxKind.ColonToken), + ts.factory.createElementAccessExpression( + isBuilder ? ts.factory.createIdentifier($$) : ts.factory.createThis(), + ts.factory.createStringLiteral(name) + ) + )) + ) + )); +} + function addInnerBuilderParameter(node: ts.ExpressionStatement, isGlobalBuilder: boolean = false): ts.ExpressionStatement { if (node.expression && ts.isCallExpression(node.expression) && node.expression.arguments) { @@ -2155,7 +2274,7 @@ function isParamFunction(node: ts.ExpressionStatement): boolean { function getComponentType(node: ts.ExpressionStatement, log: LogInfo[], name: string, parent: string, forEachParameters: ts.NodeArray = undefined): ComponentType { let isBuilderName: boolean = true; - if(forEachParameters && isSomeName(forEachParameters, name) && isParamFunction(node)) { + if (forEachParameters && isSomeName(forEachParameters, name) && isParamFunction(node)) { isBuilderName = false; } if (isEtsComponent(node)) { @@ -2225,8 +2344,8 @@ function checkButtonParamHasLabel(node: ts.EtsComponentExpression, log: LogInfo[ (argument.expression.escapedText.toString() === RESOURCE))) { log.push({ type: LogType.ERROR, - message: "The Button component with a label parameter can not have any child.", - pos: node.getStart(), + message: 'The Button component with a label parameter can not have any child.', + pos: node.getStart() }); return; } @@ -2236,7 +2355,7 @@ function checkButtonParamHasLabel(node: ts.EtsComponentExpression, log: LogInfo[ function isLazyForEachChild(node: ts.ExpressionStatement): boolean { let temp: any = node.parent; - while(temp && !ts.isEtsComponentExpression(temp) && !ts.isCallExpression(temp)) { + while (temp && !ts.isEtsComponentExpression(temp) && !ts.isCallExpression(temp)) { temp = temp.parent; } if (temp && temp.expression && (temp.expression as ts.Identifier).escapedText.toString() === COMPONENT_LAZYFOREACH) { @@ -2264,7 +2383,7 @@ export function createFunction(node: ts.Identifier, attrNode: ts.Identifier, argumentsArr = transformBuilder(argumentsArr); } } else { - //@ts-ignore + // @ts-ignore argumentsArr = []; } return ts.factory.createCallExpression( @@ -2289,8 +2408,8 @@ function transformBuilder(argumentsArr: ts.NodeArray): ts.NodeArr const newArguments: ts.Expression[] = []; argumentsArr.forEach((argument: ts.Expression) => { newArguments.push(parseCreateParameterBuilder(argument)); - }) - //@ts-ignore + }); + // @ts-ignore return newArguments; } diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index 214b066..6192862 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -383,7 +383,7 @@ function processComponentMethod(node: ts.MethodDeclaration, parentComponentName: const builderNode: ts.MethodDeclaration = ts.factory.updateMethodDeclaration(node, customBuilder, node.modifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, processComponentBlock(node.body, false, log, false, true)); - updateItem = processBuildMember(builderNode, context, log); + updateItem = processBuildMember(builderNode, context, log, true); } else if (hasDecorator(node, COMPONENT_STYLES_DECORATOR)) { if (node.parameters && node.parameters.length === 0) { if (ts.isBlock(node.body) && node.body.statements && node.body.statements.length) { @@ -411,15 +411,15 @@ export function createParentParameter(): ts.ParameterDeclaration { ts.factory.createIdentifier(NULL)); } -function processBuildMember(node: ts.MethodDeclaration, context: ts.TransformationContext, - log: LogInfo[]): ts.MethodDeclaration { +export function processBuildMember(node: ts.MethodDeclaration | ts.FunctionDeclaration, context: ts.TransformationContext, + log: LogInfo[], isBuilder = false): ts.MethodDeclaration | ts.FunctionDeclaration { return ts.visitNode(node, visitBuild); function visitBuild(node: ts.Node): ts.Node { if (isGeometryView(node)) { node = processGeometryView(node as ts.ExpressionStatement, log); } if (isProperty(node)) { - node = createReference(node as ts.PropertyAssignment, log); + node = createReference(node as ts.PropertyAssignment, log, isBuilder); } if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && stateObjectCollection.has(checkStateName(node)) && node.parent && ts.isCallExpression(node.parent) && @@ -526,13 +526,14 @@ function judgmentParentType(node: ts.Node): boolean { (ts.isCallExpression(node.parent.parent) || ts.isEtsComponentExpression(node.parent.parent)); } -export function createReference(node: ts.PropertyAssignment, log: LogInfo[]): ts.PropertyAssignment { +export function createReference(node: ts.PropertyAssignment, log: LogInfo[], isBuilder = false): ts.PropertyAssignment { const linkParentComponent: string[] = getParentNode(node, linkCollection).slice(1); const propParentComponent: string[] = getParentNode(node, propCollection).slice(1); const propertyName: ts.Identifier = node.name as ts.Identifier; let initText: string; const LINK_REG: RegExp = /^\$/g; const initExpression: ts.Expression = node.initializer; + let is$$: boolean = false; if (ts.isIdentifier(initExpression) && initExpression.escapedText.toString().match(LINK_REG)) { initText = initExpression.escapedText.toString().replace(LINK_REG, ''); @@ -540,6 +541,11 @@ export function createReference(node: ts.PropertyAssignment, log: LogInfo[]): ts initExpression.expression.kind === ts.SyntaxKind.ThisKeyword && ts.isIdentifier(initExpression.name) && initExpression.name.escapedText.toString().match(LINK_REG)) { initText = initExpression.name.escapedText.toString().replace(LINK_REG, ''); + } else if (isBuilder && ts.isPropertyAccessExpression(initExpression) && initExpression.expression && + ts.isIdentifier(initExpression.expression) && initExpression.expression.escapedText.toString() === '$$' && + ts.isIdentifier(initExpression.name) && linkParentComponent.includes(propertyName.escapedText.toString())) { + is$$ = true; + initText = initExpression.name.escapedText.toString(); } else if (isMatchInitExpression(initExpression) && linkParentComponent.includes(propertyName.escapedText.toString())) { initText = initExpression.name.escapedText.toString().replace(LINK_REG, ''); @@ -552,7 +558,7 @@ export function createReference(node: ts.PropertyAssignment, log: LogInfo[]): ts } } if (initText) { - node = addDoubleUnderline(node, propertyName, initText); + node = addDoubleUnderline(node, propertyName, initText, is$$); } return node; } @@ -565,9 +571,10 @@ function isMatchInitExpression(initExpression: ts.Expression): boolean { } function addDoubleUnderline(node: ts.PropertyAssignment, propertyName: ts.Identifier, - initText: string): ts.PropertyAssignment { + initText: string, is$$ = false): ts.PropertyAssignment { return ts.factory.updatePropertyAssignment(node, propertyName, - ts.factory.createPropertyAccessExpression(ts.factory.createThis(), + ts.factory.createPropertyAccessExpression( + is$$ && partialUpdateConfig.partialUpdateMode ? ts.factory.createIdentifier('$$') : ts.factory.createThis(), ts.factory.createIdentifier(`__${initText}`))); } diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index d84eace..55f7747 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -473,7 +473,7 @@ function createVariableInitStatement(node: ts.PropertyDeclaration, decorator: st case COMPONENT_STATE_DECORATOR: case COMPONENT_PROVIDE_DECORATOR: updateState = !partialUpdateConfig.partialUpdateMode ? - updateObservedProperty(node, name, type, program) : updateObservedPropertyPU(node, name, type, program); + updateObservedProperty(node, name, type, program) : updateObservedPropertyPU(node, name, type, program); break; case COMPONENT_LINK_DECORATOR: wrongDecoratorInPreview(node, COMPONENT_LINK_DECORATOR, hasPreview, log); @@ -499,6 +499,8 @@ function createVariableInitStatement(node: ts.PropertyDeclaration, decorator: st wrongDecoratorInPreview(node, COMPONENT_CONSUME_DECORATOR, hasPreview, log); updateState = updateConsumeProperty(node, name); break; + case COMPONENT_BUILDERPARAM_DECORATOR: + updateState = updateBuilderParamProperty(node, name); } const members = interfaceNode.members; members.push(ts.factory.createPropertySignature(undefined, name, @@ -537,12 +539,12 @@ function createUpdateParams(name: ts.Identifier, decorator: string, } else { if (localInitializationNode && localInitializationNode.initializer) { updateParamsNode = createUpdateParamsWithIf(name, true, - localInitializationNode.initializer); + localInitializationNode.initializer); } } break; case COMPONENT_BUILDERPARAM_DECORATOR: - updateParamsNode = createUpdateParamsWithoutIf(name); + updateParamsNode = createUpdateParamsWithIf(name); break; case COMPONENT_OBJECT_LINK_DECORATOR: updateParamsNode = createUpdateParamsWithSet(name); @@ -704,6 +706,15 @@ function updateConsumeProperty(node: ts.PropertyDeclaration, ts.factory.createStringLiteral(propertyOrAliasName), ts.factory.createStringLiteral(name)]))); } +function updateBuilderParamProperty(node: ts.PropertyDeclaration, + nameIdentifier: ts.Identifier): ts.ExpressionStatement { + const name: string = nameIdentifier.getText(); + return ts.factory.createExpressionStatement(ts.factory.createBinaryExpression( + createPropertyAccessExpressionWithThis(name), ts.factory.createToken(ts.SyntaxKind.EqualsToken), + node.initializer || ts.factory.createIdentifier('undefined') + )); +} + function createCustomComponentBuilderArrowFunction(parent: ts.PropertyDeclaration, jsDialog: ts.Identifier, newExp: ts.Expression): ts.ArrowFunction { return ts.factory.createArrowFunction(undefined, undefined, [], undefined, diff --git a/compiler/src/process_custom_component.ts b/compiler/src/process_custom_component.ts index 5b1d2af..e3c0a82 100644 --- a/compiler/src/process_custom_component.ts +++ b/compiler/src/process_custom_component.ts @@ -211,9 +211,9 @@ function createChildElmtId(node: ts.CallExpression, name: string): ts.PropertyAs if (node.arguments[0].properties) { node.arguments[0].properties.forEach(item => { if (ts.isIdentifier(item.name) && propsAndObjectLinks.includes(item.name.escapedText.toString())) { - childParam.push(item); + childParam.push(item); } - }) + }); } return childParam; } @@ -231,7 +231,7 @@ function createCustomComponent(node: ts.ExpressionStatement, newNode: ts.NewExpr ts.factory.createExpressionStatement(ts.factory.createCallExpression( ts.factory.createPropertyAccessExpression(isGlobalBuilder ? ts.factory.createParenthesizedExpression(parentConditionalExpression()) : ts.factory.createThis(), - ts.factory.createIdentifier(OBSERVECOMPONENTCREATION) + ts.factory.createIdentifier(OBSERVECOMPONENTCREATION) ), undefined, [ts.factory.createArrowFunction(undefined, undefined, [ @@ -283,7 +283,7 @@ function createIfCustomComponent(newNode: ts.NewExpression, componentParameter: [ts.factory.createExpressionStatement(ts.factory.createCallExpression( ts.factory.createPropertyAccessExpression(isGlobalBuilder ? ts.factory.createParenthesizedExpression(parentConditionalExpression()) : ts.factory.createThis(), - ts.factory.createIdentifier(UPDATE_STATE_VARS_OF_CHIND_BY_ELMTID) + ts.factory.createIdentifier(UPDATE_STATE_VARS_OF_CHIND_BY_ELMTID) ), undefined, [ts.factory.createIdentifier(ELMTID), componentParameter]))], true) ); @@ -312,7 +312,6 @@ function validateCustomComponentPrams(node: ts.CallExpression, name: string, } }); } - validateMandatoryToAssignmentViaParam(node, name, curChildProps, log); } function getCustomComponentNode(node: ts.ExpressionStatement): ts.CallExpression { @@ -448,12 +447,12 @@ function getParentPropertyName(node: ts.PropertyAssignment, curPropertyKind: str } let parentPropertyName: string = initExpression.getText(); if (curPropertyKind === COMPONENT_LINK_DECORATOR) { + // @ts-ignore + const initName: ts.Identifier = initExpression.name || initExpression; if (hasDollar(initExpression)) { - // @ts-ignore - const initName: ts.Identifier = initExpression.name || initExpression; parentPropertyName = initName.getText().replace(/^\$/, ''); } else { - validateLinkWithoutDollar(node, log); + parentPropertyName = initName.getText(); } } else { if (hasDollar(initExpression)) { @@ -511,7 +510,7 @@ function createFindChildById(id: string, name: string, isBuilder: boolean = fals ))), ts.factory.createToken(ts.SyntaxKind.QuestionToken), ts.factory.createAsExpression(ts.factory.createCallExpression( ts.factory.createPropertyAccessExpression(createConditionParent(isBuilder), - ts.factory.createIdentifier(`${CUSTOM_COMPONENT_FUNCTION_FIND_CHILD_BY_ID}`)), undefined, + ts.factory.createIdentifier(`${CUSTOM_COMPONENT_FUNCTION_FIND_CHILD_BY_ID}`)), undefined, [isBuilder ? ts.factory.createCallExpression(ts.factory.createIdentifier(GENERATE_ID), undefined, []) : ts.factory.createStringLiteral(id)]), ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(name))), diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index ac9b026..b428ab4 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -61,7 +61,11 @@ import { repeatLog } from './utils'; import { projectConfig } from '../main'; -import { CUSTOM_BUILDER_METHOD, INNER_COMPONENT_NAMES } from './component_map'; +import { + CUSTOM_BUILDER_METHOD, + INNER_COMPONENT_NAMES, + GLOBAL_CUSTOM_BUILDER_METHOD +} from './component_map'; import { validatorCard } from './process_ui_syntax'; export const IMPORT_FILE_ASTCACHE: Map = new Map(); @@ -173,6 +177,8 @@ function visitAllNode(node: ts.Node, sourceFile: ts.SourceFile, defaultNameFromP if (ts.isFunctionDeclaration(node) && hasDecorator(node, COMPONENT_BUILDER_DECORATOR)) { collectSpecialFunctionNode(node, asNameFromParent, defaultNameFromParent, defaultCollection, asExportCollection, CUSTOM_BUILDER_METHOD); + collectSpecialFunctionNode(node, asNameFromParent, defaultNameFromParent, defaultCollection, + asExportCollection, GLOBAL_CUSTOM_BUILDER_METHOD); } if (ts.isExportAssignment(node) && node.expression && ts.isIdentifier(node.expression) && hasCollection(node.expression)) { diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index b0cfb34..82aa69b 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -74,7 +74,8 @@ import { } from './validate_ui_syntax'; import { processComponentClass, - createParentParameter + createParentParameter, + processBuildMember } from './process_component_class'; import processImport from './process_import'; import { @@ -122,8 +123,8 @@ export function processUISyntax(program: ts.Program, ut = false): Function { validateReExportType(node, pagesDir, transformLog.errors); if (projectConfig.processTs === true) { process.env.compileTool === 'rollup' ? - ModuleSourceFile.newSourceFile(path.normalize(node.fileName), node) : - writeFileSyncByNode(node, true, projectConfig); + ModuleSourceFile.newSourceFile(path.normalize(node.fileName), node) : + writeFileSyncByNode(node, true, projectConfig); } } return node; @@ -149,7 +150,7 @@ export function processUISyntax(program: ts.Program, ut = false): Function { INTERFACE_NODE_SET.clear(); if (projectConfig.compileMode === ESMODULE && projectConfig.processTs === true) { process.env.compileTool === 'rollup' ? ModuleSourceFile.newSourceFile(path.normalize(node.fileName), node) : - writeFileSyncByNode(node, true, projectConfig); + writeFileSyncByNode(node, true, projectConfig); } return node; } else { @@ -194,6 +195,7 @@ export function processUISyntax(program: ts.Program, ut = false): Function { node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, processComponentBlock(node.body, false, transformLog.errors, false, true, node.name.getText(), undefined, true)); + node = processBuildMember(node, context, transformLog.errors, true); } else if (hasDecorator(node, COMPONENT_STYLES_DECORATOR)) { if (node.parameters.length === 0) { node = undefined; @@ -237,7 +239,7 @@ function generateId(statements: ts.Statement[], node: ts.SourceFile): void { ts.factory.createIdentifier(_GENERATE_ID), undefined, ts.factory.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword), - ts.factory.createNumericLiteral("0") + ts.factory.createNumericLiteral('0') )], ts.NodeFlags.Let ) @@ -252,15 +254,15 @@ function generateId(statements: ts.Statement[], node: ts.SourceFile): void { ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword), ts.factory.createBlock( [ts.factory.createReturnStatement(ts.factory.createBinaryExpression( - ts.factory.createStringLiteral(path.basename(node.fileName, EXTNAME_ETS)+'_'), - ts.factory.createToken(ts.SyntaxKind.PlusToken),ts.factory.createPrefixUnaryExpression( - ts.SyntaxKind.PlusPlusToken, - ts.factory.createIdentifier(_GENERATE_ID) - )))], + ts.factory.createStringLiteral(path.basename(node.fileName, EXTNAME_ETS) + '_'), + ts.factory.createToken(ts.SyntaxKind.PlusToken), ts.factory.createPrefixUnaryExpression( + ts.SyntaxKind.PlusPlusToken, + ts.factory.createIdentifier(_GENERATE_ID) + )))], true ) ) - ) + ); } function preprocessIdAttrs(fileName: string): void { @@ -753,13 +755,13 @@ function createLoadDocument(context: ts.TransformationContext, name: string, } const newExpressionParams: any[] = [ context.factory.createNewExpression( - context.factory.createIdentifier(name), - undefined, newArray)]; + context.factory.createIdentifier(name), + undefined, newArray)]; addCardStringliteral(newExpressionParams, context, cardRelativePath); return context.factory.createExpressionStatement( context.factory.createCallExpression( context.factory.createIdentifier(cardRelativePath ? CARD_ENTRY_FUNCTION_NAME : - PAGE_ENTRY_FUNCTION_NAME), undefined, newExpressionParams) + PAGE_ENTRY_FUNCTION_NAME), undefined, newExpressionParams) ); } diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 7a9e58a..a1b6eaf 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -66,7 +66,9 @@ import { EXTEND_ATTRIBUTE, GLOBAL_STYLE_FUNCTION, STYLES_ATTRIBUTE, - CUSTOM_BUILDER_METHOD + CUSTOM_BUILDER_METHOD, + GLOBAL_CUSTOM_BUILDER_METHOD, + INNER_CUSTOM_BUILDER_METHOD } from './component_map'; import { LogType, @@ -369,6 +371,11 @@ function visitAllNode(node: ts.Node, sourceFileNode: ts.SourceFile, allComponent if (ts.isMethodDeclaration(node) || ts.isFunctionDeclaration(node)) { if (hasDecorator(node, COMPONENT_BUILDER_DECORATOR)) { CUSTOM_BUILDER_METHOD.add(node.name.getText()); + if (ts.isFunctionDeclaration(node)) { + GLOBAL_CUSTOM_BUILDER_METHOD.add(node.name.getText()); + } else { + INNER_CUSTOM_BUILDER_METHOD.add(node.name.getText()); + } } if (hasDecorator(node, COMPONENT_CONCURRENT_DECORATOR)) { // ark compiler's feature -- Gitee From fb46d398ef6783da6e7778af62a8794901d0722e Mon Sep 17 00:00:00 2001 From: bojiang Date: Mon, 20 Feb 2023 16:08:09 +0800 Subject: [PATCH 373/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I2563760a6bcea0fff60f50a694130b1e959d7bf1 --- compiler/src/process_import.ts | 10 +- compiler/test/pages/import@CustomDialog.ets | 46 +++ compiler/test/pages/import@Observed.ets | 28 ++ .../test/ut/import/import@CustomDialog.ts | 146 ++++++++++ compiler/test/ut/import/import@Observed.ts | 184 ++++++++++++ .../import/import@CustomDialog.ts | 168 +++++++++++ .../import/import@Observed.ts | 265 ++++++++++++++++++ 7 files changed, 844 insertions(+), 3 deletions(-) create mode 100644 compiler/test/pages/import@CustomDialog.ets create mode 100644 compiler/test/pages/import@Observed.ets create mode 100644 compiler/test/ut/import/import@CustomDialog.ts create mode 100644 compiler/test/ut/import/import@Observed.ts create mode 100644 compiler/test/utForPartialUpdate/import/import@CustomDialog.ts create mode 100644 compiler/test/utForPartialUpdate/import/import@Observed.ts diff --git a/compiler/src/process_import.ts b/compiler/src/process_import.ts index ac9b026..a60a79e 100644 --- a/compiler/src/process_import.ts +++ b/compiler/src/process_import.ts @@ -141,10 +141,14 @@ function visitAllNode(node: ts.Node, sourceFile: ts.SourceFile, defaultNameFromP exportCollection: Set, defaultCollection: Set, asExportCollection: Map, pathCollection: Set, fileResolvePath: string) { if (isObservedClass(node)) { + collectSpecialFunctionNode(node as ts.ClassDeclaration, asNameFromParent, defaultNameFromParent, defaultCollection, + asExportCollection, observedClassCollection); // @ts-ignore observedClassCollection.add(node.name.getText()); } if (isCustomDialogClass(node)) { + collectSpecialFunctionNode(node as ts.StructDeclaration, asNameFromParent, defaultNameFromParent, defaultCollection, + asExportCollection, componentCollection.customDialogs); // @ts-ignore componentCollection.customDialogs.add(node.name.getText()); } @@ -273,9 +277,9 @@ function visitAllNode(node: ts.Node, sourceFile: ts.SourceFile, defaultNameFromP defaultCollection, asExportCollection, pathCollection, fileResolvePath)); } -function collectSpecialFunctionNode(node: ts.FunctionDeclaration, asNameFromParent: Map, - defaultNameFromParent: string, defaultCollection: Set, asExportCollection: Map, - collection: Set): void { +function collectSpecialFunctionNode(node: ts.FunctionDeclaration | ts.ClassDeclaration | ts.StructDeclaration, + asNameFromParent: Map, defaultNameFromParent: string, defaultCollection: Set, + asExportCollection: Map, collection: Set): void { const name: string = node.name.getText(); let componentName: string; if (asNameFromParent.has(name)) { diff --git a/compiler/test/pages/import@CustomDialog.ets b/compiler/test/pages/import@CustomDialog.ets new file mode 100644 index 0000000..ac32fd3 --- /dev/null +++ b/compiler/test/pages/import@CustomDialog.ets @@ -0,0 +1,46 @@ +/* + * 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. + */ +@CustomDialog +export struct CustomDialogExample1 { + @Link textValue: string + @Link inputValue: string + controller: CustomDialogController + cancel: () => void + confirm: () => void + + build() { + Column() { + Text('Change text').fontSize(20).margin({ top: 10, bottom: 10 }) + TextInput({ placeholder: '', text: this.textValue }).height(60).width('90%') + .onChange((value: string) => { + this.textValue = value + }) + Text('Whether to change a text?').fontSize(16).margin({ bottom: 10 }) + Flex({ justifyContent: FlexAlign.SpaceAround }) { + Button('cancel') + .onClick(() => { + this.controller.close() + this.cancel() + }).backgroundColor(0xffffff).fontColor(Color.Black) + Button('confirm') + .onClick(() => { + this.inputValue = this.textValue + this.controller.close() + this.confirm() + }).backgroundColor(0xffffff).fontColor(Color.Red) + }.margin({ bottom: 10 }) + } + } +} \ No newline at end of file diff --git a/compiler/test/pages/import@Observed.ets b/compiler/test/pages/import@Observed.ets new file mode 100644 index 0000000..768bce9 --- /dev/null +++ b/compiler/test/pages/import@Observed.ets @@ -0,0 +1,28 @@ +/* + * 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 nextID: number = 0 + +@Observed +export class ClassB { + public name: string + public c: number + public id: number + + constructor(c: number, name: string = 'OK') { + this.name = name + this.c = c + this.id = nextID++ + } +} \ No newline at end of file diff --git a/compiler/test/ut/import/import@CustomDialog.ts b/compiler/test/ut/import/import@CustomDialog.ts new file mode 100644 index 0000000..d9bdce3 --- /dev/null +++ b/compiler/test/ut/import/import@CustomDialog.ts @@ -0,0 +1,146 @@ +/* + * 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. + */ + +exports.source = ` +import { CustomDialogExample1 as CustomDialogExample } from './test/pages/import@CustomDialog' + +@Entry +@Component +struct CustomDialogUser { + @State textValue: string = '' + @State inputValue: string = 'click me' + dialogController: CustomDialogController = new CustomDialogController({ + builder: CustomDialogExample({ + cancel: this.onCancel, + confirm: this.onAccept, + textValue: $textValue, + inputValue: $inputValue + }), + cancel: this.existApp, + autoCancel: true, + alignment: DialogAlignment.Default, + offset: { dx: 0, dy: -20 }, + gridCount: 4, + customStyle: false + }) + + onCancel() { + console.info('Callback when the first button is clicked') + } + + onAccept() { + console.info('Callback when the second button is clicked') + } + + existApp() { + console.info('Click the callback in the blank area') + } + + build() { + Column() { + Button(this.inputValue) + .onClick(() => { + this.dialogController.open() + }).backgroundColor(0x317aff) + }.width('100%').margin({ top: 5 }) + } +} +` + +exports.expectResult = +`"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +let __generate__Id = 0; +function generateId() { + return "import@CustomDialog_" + ++__generate__Id; +} +const import_CustomDialog_1 = require("./test/pages/import@CustomDialog"); +class CustomDialogUser extends View { + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); + this.__textValue = new ObservedPropertySimple('', this, "textValue"); + this.__inputValue = new ObservedPropertySimple('click me', this, "inputValue"); + this.dialogController = new CustomDialogController({ + builder: () => { + let jsDialog = new import_CustomDialog_1.CustomDialogExample1("2", this, { + cancel: this.onCancel, + confirm: this.onAccept, + textValue: this.__textValue, + inputValue: this.__inputValue + }); + jsDialog.setController(this.dialogController); + View.create(jsDialog); + }, + cancel: this.existApp, + autoCancel: true, + alignment: DialogAlignment.Default, + offset: { dx: 0, dy: -20 }, + gridCount: 4, + customStyle: false + }, this); + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + if (params.textValue !== undefined) { + this.textValue = params.textValue; + } + if (params.inputValue !== undefined) { + this.inputValue = params.inputValue; + } + if (params.dialogController !== undefined) { + this.dialogController = params.dialogController; + } + } + aboutToBeDeleted() { + this.__textValue.aboutToBeDeleted(); + this.__inputValue.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id()); + } + get textValue() { + return this.__textValue.get(); + } + set textValue(newValue) { + this.__textValue.set(newValue); + } + get inputValue() { + return this.__inputValue.get(); + } + set inputValue(newValue) { + this.__inputValue.set(newValue); + } + onCancel() { + console.info('Callback when the first button is clicked'); + } + onAccept() { + console.info('Callback when the second button is clicked'); + } + existApp() { + console.info('Click the callback in the blank area'); + } + render() { + Column.create(); + Column.width('100%'); + Column.margin({ top: 5 }); + Button.createWithLabel(this.inputValue); + Button.onClick(() => { + this.dialogController.open(); + }); + Button.backgroundColor(0x317aff); + Button.pop(); + Column.pop(); + } +} +loadDocument(new CustomDialogUser("1", undefined, {})); +` diff --git a/compiler/test/ut/import/import@Observed.ts b/compiler/test/ut/import/import@Observed.ts new file mode 100644 index 0000000..6ef35b3 --- /dev/null +++ b/compiler/test/ut/import/import@Observed.ts @@ -0,0 +1,184 @@ +/* + * 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. + */ + +exports.source = ` +import { ClassB as ClassA } from './test/pages/import@Observed' +@Component +struct ViewA { + label: string = 'ViewA1' + @ObjectLink a: ClassA + + build() { + Row() { + Button('ViewA'+ JSON.stringify(this.label) + 'this.a.c='+JSON.stringify(this.a.c)) + .onClick(() => { + this.a.c += 1 + }) + }.margin({ top: 10 }) + } +} + +@Entry +@Component +struct ViewB { + @State arrA: ClassA[] = [new ClassA(0), new ClassA(0)] + + build() { + Column() { + ForEach(this.arrA, (item) => { + ViewA({ label: JSON.stringify(item.id), a: item }) + }, (item) => item.id.toString()) + ViewA({ label: JSON.stringify(this.arrA[0]), a: this.arrA[0] }) + ViewA({ label: JSON.stringify(this.arrA[this.arrA.length - 1]), a: this.arrA[this.arrA.length - 1] }) + + Button('ViewB: reset array') + .margin({ top: 10 }) + .onClick(() => { + this.arrA = [new ClassA(0), new ClassA(0)] + }) + Button('ViewB: push') + .margin({ top: 10 }) + .onClick(() => { + this.arrA.push(new ClassA(0)) + }) + Button('ViewB: shift') + .margin({ top: 10 }) + .onClick(() => { + this.arrA.shift() + }) + }.width('100%') + } +} +` + +exports.expectResult = +`"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +let __generate__Id = 0; +function generateId() { + return "import@Observed_" + ++__generate__Id; +} +const import_Observed_1 = require("./test/pages/import@Observed"); +class ViewA extends View { + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); + this.label = 'ViewA1'; + this.__a = new SynchedPropertyNesedObject(params.a, this, "a"); + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + if (params.label !== undefined) { + this.label = params.label; + } + this.__a.set(params.a); + } + aboutToBeDeleted() { + this.__a.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id()); + } + get a() { + return this.__a.get(); + } + render() { + Row.create(); + Row.margin({ top: 10 }); + Button.createWithLabel('ViewA' + JSON.stringify(this.label) + 'this.a.c=' + JSON.stringify(this.a.c)); + Button.onClick(() => { + this.a.c += 1; + }); + Button.pop(); + Row.pop(); + } +} +class ViewB extends View { + constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { + super(compilerAssignedUniqueChildId, parent, localStorage); + this.__arrA = new ObservedPropertyObject([new import_Observed_1.ClassB(0), new import_Observed_1.ClassB(0)], this, "arrA"); + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + if (params.arrA !== undefined) { + this.arrA = params.arrA; + } + } + aboutToBeDeleted() { + this.__arrA.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id()); + } + get arrA() { + return this.__arrA.get(); + } + set arrA(newValue) { + this.__arrA.set(newValue); + } + render() { + Column.create(); + Column.width('100%'); + ForEach.create("3", this, ObservedObject.GetRawObject(this.arrA), (item) => { + let earlierCreatedChild_2 = (this && this.findChildById) ? this.findChildById("2") : undefined; + if (earlierCreatedChild_2 == undefined) { + View.create(new ViewA("2", this, { label: JSON.stringify(item.id), a: item })); + } + else { + earlierCreatedChild_2.updateWithValueParams({ + label: JSON.stringify(item.id), a: item + }); + View.create(earlierCreatedChild_2); + } + }, (item) => item.id.toString()); + ForEach.pop(); + let earlierCreatedChild_4 = (this && this.findChildById) ? this.findChildById("4") : undefined; + if (earlierCreatedChild_4 == undefined) { + View.create(new ViewA("4", this, { label: JSON.stringify(this.arrA[0]), a: this.arrA[0] })); + } + else { + earlierCreatedChild_4.updateWithValueParams({ + label: JSON.stringify(this.arrA[0]), a: this.arrA[0] + }); + View.create(earlierCreatedChild_4); + } + let earlierCreatedChild_5 = (this && this.findChildById) ? this.findChildById("5") : undefined; + if (earlierCreatedChild_5 == undefined) { + View.create(new ViewA("5", this, { label: JSON.stringify(this.arrA[this.arrA.length - 1]), a: this.arrA[this.arrA.length - 1] })); + } + else { + earlierCreatedChild_5.updateWithValueParams({ + label: JSON.stringify(this.arrA[this.arrA.length - 1]), a: this.arrA[this.arrA.length - 1] + }); + View.create(earlierCreatedChild_5); + } + Button.createWithLabel('ViewB: reset array'); + Button.margin({ top: 10 }); + Button.onClick(() => { + this.arrA = [new import_Observed_1.ClassB(0), new import_Observed_1.ClassB(0)]; + }); + Button.pop(); + Button.createWithLabel('ViewB: push'); + Button.margin({ top: 10 }); + Button.onClick(() => { + this.arrA.push(new import_Observed_1.ClassB(0)); + }); + Button.pop(); + Button.createWithLabel('ViewB: shift'); + Button.margin({ top: 10 }); + Button.onClick(() => { + this.arrA.shift(); + }); + Button.pop(); + Column.pop(); + } +} +loadDocument(new ViewB("1", undefined, {})); +` diff --git a/compiler/test/utForPartialUpdate/import/import@CustomDialog.ts b/compiler/test/utForPartialUpdate/import/import@CustomDialog.ts new file mode 100644 index 0000000..84afb01 --- /dev/null +++ b/compiler/test/utForPartialUpdate/import/import@CustomDialog.ts @@ -0,0 +1,168 @@ +/* + * 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. + */ + +exports.source = ` +import { CustomDialogExample1 as CustomDialogExample } from './test/pages/import@CustomDialog' + +@Entry +@Component +struct CustomDialogUser { + @State textValue: string = '' + @State inputValue: string = 'click me' + dialogController: CustomDialogController = new CustomDialogController({ + builder: CustomDialogExample({ + cancel: this.onCancel, + confirm: this.onAccept, + textValue: $textValue, + inputValue: $inputValue + }), + cancel: this.existApp, + autoCancel: true, + alignment: DialogAlignment.Default, + offset: { dx: 0, dy: -20 }, + gridCount: 4, + customStyle: false + }) + + onCancel() { + console.info('Callback when the first button is clicked') + } + + onAccept() { + console.info('Callback when the second button is clicked') + } + + existApp() { + console.info('Click the callback in the blank area') + } + + build() { + Column() { + Button(this.inputValue) + .onClick(() => { + this.dialogController.open() + }).backgroundColor(0x317aff) + }.width('100%').margin({ top: 5 }) + } +} +` + +exports.expectResult = +`"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const import_CustomDialog_1 = require("./test/pages/import@CustomDialog"); +class CustomDialogUser extends ViewPU { + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); + this.__textValue = new ObservedPropertySimplePU('', this, "textValue"); + this.__inputValue = new ObservedPropertySimplePU('click me', this, "inputValue"); + this.dialogController = new CustomDialogController({ + builder: () => { + let jsDialog = new import_CustomDialog_1.CustomDialogExample1(this, { + cancel: this.onCancel, + confirm: this.onAccept, + textValue: this.__textValue, + inputValue: this.__inputValue + }); + jsDialog.setController(this.dialogController); + ViewPU.create(jsDialog); + }, + cancel: this.existApp, + autoCancel: true, + alignment: DialogAlignment.Default, + offset: { dx: 0, dy: -20 }, + gridCount: 4, + customStyle: false + }, this); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.textValue !== undefined) { + this.textValue = params.textValue; + } + if (params.inputValue !== undefined) { + this.inputValue = params.inputValue; + } + if (params.dialogController !== undefined) { + this.dialogController = params.dialogController; + } + } + updateStateVars(params) { + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__textValue.purgeDependencyOnElmtId(rmElmtId); + this.__inputValue.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__textValue.aboutToBeDeleted(); + this.__inputValue.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get textValue() { + return this.__textValue.get(); + } + set textValue(newValue) { + this.__textValue.set(newValue); + } + get inputValue() { + return this.__inputValue.get(); + } + set inputValue(newValue) { + this.__inputValue.set(newValue); + } + onCancel() { + console.info('Callback when the first button is clicked'); + } + onAccept() { + console.info('Callback when the second button is clicked'); + } + existApp() { + console.info('Click the callback in the blank area'); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + Column.width('100%'); + Column.margin({ top: 5 }); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel(this.inputValue); + Button.onClick(() => { + this.dialogController.open(); + }); + Button.backgroundColor(0x317aff); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new CustomDialogUser(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` diff --git a/compiler/test/utForPartialUpdate/import/import@Observed.ts b/compiler/test/utForPartialUpdate/import/import@Observed.ts new file mode 100644 index 0000000..783c310 --- /dev/null +++ b/compiler/test/utForPartialUpdate/import/import@Observed.ts @@ -0,0 +1,265 @@ +/* + * 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. + */ + +exports.source = ` +import { ClassB as ClassA } from './test/pages/import@Observed' +@Component +struct ViewA { + label: string = 'ViewA1' + @ObjectLink a: ClassA + + build() { + Row() { + Button('ViewA'+ JSON.stringify(this.label) + 'this.a.c='+JSON.stringify(this.a.c)) + .onClick(() => { + this.a.c += 1 + }) + }.margin({ top: 10 }) + } +} + +@Entry +@Component +struct ViewB { + @State arrA: ClassA[] = [new ClassA(0), new ClassA(0)] + + build() { + Column() { + ForEach(this.arrA, (item) => { + ViewA({ label: JSON.stringify(item.id), a: item }) + }, (item) => item.id.toString()) + ViewA({ label: JSON.stringify(this.arrA[0]), a: this.arrA[0] }) + ViewA({ label: JSON.stringify(this.arrA[this.arrA.length - 1]), a: this.arrA[this.arrA.length - 1] }) + + Button('ViewB: reset array') + .margin({ top: 10 }) + .onClick(() => { + this.arrA = [new ClassA(0), new ClassA(0)] + }) + Button('ViewB: push') + .margin({ top: 10 }) + .onClick(() => { + this.arrA.push(new ClassA(0)) + }) + Button('ViewB: shift') + .margin({ top: 10 }) + .onClick(() => { + this.arrA.shift() + }) + }.width('100%') + } +} +` + +exports.expectResult = +`"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const import_Observed_1 = require("./test/pages/import@Observed"); +class ViewA extends ViewPU { + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); + this.label = 'ViewA1'; + this.__a = new SynchedPropertyNesedObjectPU(params.a, this, "a"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.label !== undefined) { + this.label = params.label; + } + this.__a.set(params.a); + } + updateStateVars(params) { + this.__a.set(params.a); + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__a.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__a.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get a() { + return this.__a.get(); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Row.create(); + Row.margin({ top: 10 }); + if (!isInitialRender) { + Row.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel('ViewA' + JSON.stringify(this.label) + 'this.a.c=' + JSON.stringify(this.a.c)); + Button.onClick(() => { + this.a.c += 1; + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Row.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +class ViewB extends ViewPU { + constructor(parent, params, __localStorage, elmtId = -1) { + super(parent, __localStorage, elmtId); + this.__arrA = new ObservedPropertyObjectPU([new import_Observed_1.ClassB(0), new import_Observed_1.ClassB(0)], this, "arrA"); + this.setInitiallyProvidedValue(params); + } + setInitiallyProvidedValue(params) { + if (params.arrA !== undefined) { + this.arrA = params.arrA; + } + } + updateStateVars(params) { + } + purgeVariableDependenciesOnElmtId(rmElmtId) { + this.__arrA.purgeDependencyOnElmtId(rmElmtId); + } + aboutToBeDeleted() { + this.__arrA.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id__()); + this.aboutToBeDeletedInternal(); + } + get arrA() { + return this.__arrA.get(); + } + set arrA(newValue) { + this.__arrA.set(newValue); + } + initialRender() { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Column.create(); + Column.width('100%'); + if (!isInitialRender) { + Column.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + ForEach.create(); + const forEachItemGenFunction = _item => { + const item = _item; + { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new ViewA(this, { label: JSON.stringify(item.id), a: item }, undefined, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + a: item + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + } + }; + this.forEachUpdateFunction(elmtId, this.arrA, forEachItemGenFunction, (item) => item.id.toString(), false, false); + if (!isInitialRender) { + ForEach.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + ForEach.pop(); + { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new ViewA(this, { label: JSON.stringify(this.arrA[0]), a: this.arrA[0] }, undefined, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + a: this.arrA[0] + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + } + { + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + if (isInitialRender) { + ViewPU.create(new ViewA(this, { label: JSON.stringify(this.arrA[this.arrA.length - 1]), a: this.arrA[this.arrA.length - 1] }, undefined, elmtId)); + } + else { + this.updateStateVarsOfChildByElmtId(elmtId, { + a: this.arrA[this.arrA.length - 1] + }); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + } + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel('ViewB: reset array'); + Button.margin({ top: 10 }); + Button.onClick(() => { + this.arrA = [new import_Observed_1.ClassB(0), new import_Observed_1.ClassB(0)]; + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel('ViewB: push'); + Button.margin({ top: 10 }); + Button.onClick(() => { + this.arrA.push(new import_Observed_1.ClassB(0)); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + this.observeComponentCreation((elmtId, isInitialRender) => { + ViewStackProcessor.StartGetAccessRecordingFor(elmtId); + Button.createWithLabel('ViewB: shift'); + Button.margin({ top: 10 }); + Button.onClick(() => { + this.arrA.shift(); + }); + if (!isInitialRender) { + Button.pop(); + } + ViewStackProcessor.StopGetAccessRecording(); + }); + Button.pop(); + Column.pop(); + } + rerender() { + this.updateDirtyElements(); + } +} +ViewStackProcessor.StartGetAccessRecordingFor(ViewStackProcessor.AllocateNewElmetIdForNextComponent()); +loadDocument(new ViewB(undefined, {})); +ViewStackProcessor.StopGetAccessRecording(); +` -- Gitee From 242b38e1fd14e72d4b041a1f89c589670f8f8193 Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Mon, 20 Feb 2023 09:53:20 +0800 Subject: [PATCH 374/379] Add sourcemap cache for abc plugin Signed-off-by: chenqy930 Change-Id: Ie48e62949ad21837fe6286bb21448eec6ca0d062 Signed-off-by: chenqy930 --- .../ark_compiler/module/module_mode.ts | 46 +++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/compiler/src/fast_build/ark_compiler/module/module_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_mode.ts index 753f155..1375030 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_mode.ts @@ -34,6 +34,7 @@ import { MODULES_CACHE, NPMENTRIES_TXT, SOURCEMAPS, + SOURCEMAPS_JSON, TEMPORARY, WIDGETS_ABC, HAP_PACKAGE, @@ -61,6 +62,7 @@ import { CommonMode } from '../common/common_mode'; import { newSourceMaps } from '../transform'; import { changeFileExtension, + genCachePath, getEs2abcFileThreadNumber, isCommonJsPluginVirtualFile, isCurrentProjectFiles @@ -121,11 +123,13 @@ export class ModuleMode extends CommonMode { moduleInfos: Map; pkgEntryInfos: Map; hashJsonObject: any; + cacheSourceMapObject: any; filesInfoPath: string; npmEntriesInfoPath: string; moduleAbcPath: string; sourceMapPath: string; cacheFilePath: string; + cacheSourceMapPath: string; workerNumber: number; npmEntriesProtoFilePath: string; protoFilePath: string; @@ -136,12 +140,14 @@ export class ModuleMode extends CommonMode { this.moduleInfos = new Map(); this.pkgEntryInfos = new Map(); this.hashJsonObject = {}; + this.cacheSourceMapObject = {}; this.filesInfoPath = path.join(this.projectConfig.cachePath, FILESINFO_TXT); this.npmEntriesInfoPath = path.join(this.projectConfig.cachePath, NPMENTRIES_TXT); const outPutABC: string = this.projectConfig.widgetCompile ? WIDGETS_ABC : MODULES_ABC; this.moduleAbcPath = path.join(this.projectConfig.aceModuleBuild, outPutABC); this.sourceMapPath = path.join(this.projectConfig.aceModuleBuild, SOURCEMAPS); this.cacheFilePath = path.join(this.projectConfig.cachePath, MODULES_CACHE); + this.cacheSourceMapPath = path.join(this.projectConfig.cachePath, SOURCEMAPS_JSON); this.workerNumber = MAX_WORKER_NUMBER; this.npmEntriesProtoFilePath = path.join(this.projectConfig.cachePath, PROTOS, NPM_ENTRIES_PROTO_BIN); this.protoFilePath = path.join(this.projectConfig.cachePath, PROTOS, PROTO_FILESINFO_TXT); @@ -238,16 +244,48 @@ export class ModuleMode extends CommonMode { moduleInfos.set(filePath, new ModuleInfo(filePath, cacheFilePath, isCommonJs, recordName, sourceFile, packageName)); } + updateCachedSourceMaps(): void { + if (!fs.existsSync(this.cacheSourceMapPath)) { + this.cacheSourceMapObject = newSourceMaps; + return; + } + + this.cacheSourceMapObject = JSON.parse(fs.readFileSync(this.cacheSourceMapPath).toString()); + + // remove unused source files's sourceMap + let unusedFiles = []; + let compileFileList: Set = new Set(); + this.moduleInfos.forEach((moduleInfo: ModuleInfo, moduleId: string) => { + compileFileList.add(toUnixPath(moduleId)); + }) + + Object.keys(this.cacheSourceMapObject).forEach(key => { + const sourceFileAbsolutePath: string = toUnixPath(path.join(this.projectConfig.projectRootPath, key)); + if (!compileFileList.has(sourceFileAbsolutePath)) { + unusedFiles.push(key); + } + }); + unusedFiles.forEach(file => { + delete this.cacheSourceMapObject[file]; + }) + + // update sourceMap + Object.keys(newSourceMaps).forEach(key => { + this.cacheSourceMapObject[key] = newSourceMaps[key]; + }); + } + buildModuleSourceMapInfo() { if (!this.arkConfig.isDebug || this.projectConfig.widgetCompile) { return; } - mkdirsSync(this.projectConfig.aceModuleBuild); - const sourceMapFilePath: string = path.join(this.projectConfig.aceModuleBuild, SOURCEMAPS); - fs.writeFile(sourceMapFilePath, JSON.stringify(newSourceMaps, null, 2), 'utf-8', (err) => { + + this.updateCachedSourceMaps(); + fs.writeFile(this.sourceMapPath, JSON.stringify(this.cacheSourceMapObject, null, 2), 'utf-8', (err) => { if (err) { - this.throwArkTsCompilerError('ArkTS:ERROR failed to write cache sourceMaps json'); + this.throwArkTsCompilerError('ArkTS:ERROR failed to write sourceMaps'); } + fs.copyFileSync(this.sourceMapPath, this.cacheSourceMapPath); }); } -- Gitee From e0220f3a90d9cabf092cf0b2734d7b9fd89761ac Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 20 Feb 2023 22:12:52 +0800 Subject: [PATCH 375/379] houhaoyu@huawei.com update ut for builder Signed-off-by: houhaoyu Change-Id: I2a98a254a08f4bd9841921a5db3810f2ec740b55 --- .../@builderParam/@builderParam.ts | 15 ++++++++--- .../import/importExportNest.ts | 4 +-- .../render_decorator/@builder/@builder.ts | 2 +- .../@builder/@builderWithComponent.ts | 4 +-- .../@builder/@builderWithForEach.ts | 2 +- .../@builder/@builderWithLinkData.ts | 2 +- .../@builderParam/@builderParam.ts | 25 +++++++++++++------ 7 files changed, 36 insertions(+), 18 deletions(-) diff --git a/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts b/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts index a7b4d13..04ad5ac 100644 --- a/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts +++ b/compiler/test/ut/render_decorator/@builderParam/@builderParam.ts @@ -112,6 +112,8 @@ class CustomContainer extends View { constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { super(compilerAssignedUniqueChildId, parent, localStorage); this.header = ""; + this.content = undefined; + this.callContent = undefined; this.footer = ""; this.updateWithValueParams(params); } @@ -119,8 +121,12 @@ class CustomContainer extends View { if (params.header !== undefined) { this.header = params.header; } - this.content = params.content; - this.callContent = params.callContent; + if (params.content !== undefined) { + this.content = params.content; + } + if (params.callContent !== undefined) { + this.callContent = params.callContent; + } if (params.footer !== undefined) { this.footer = params.footer; } @@ -143,13 +149,16 @@ class CustomContainer2 extends View { constructor(compilerAssignedUniqueChildId, parent, params, localStorage) { super(compilerAssignedUniqueChildId, parent, localStorage); this.header = ""; + this.content = undefined; this.updateWithValueParams(params); } updateWithValueParams(params) { if (params.header !== undefined) { this.header = params.header; } - this.content = params.content; + if (params.content !== undefined) { + this.content = params.content; + } } aboutToBeDeleted() { SubscriberManager.Get().delete(this.id()); diff --git a/compiler/test/utForPartialUpdate/import/importExportNest.ts b/compiler/test/utForPartialUpdate/import/importExportNest.ts index bf28f43..a90d1a6 100644 --- a/compiler/test/utForPartialUpdate/import/importExportNest.ts +++ b/compiler/test/utForPartialUpdate/import/importExportNest.ts @@ -201,7 +201,7 @@ class ImportTest extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); Text.pop(); - ImportNestAll_1.tExtend(20, this); + ImportNestAll_1.tExtend.bind(this)(20); this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Text.create(this.testText2); @@ -211,7 +211,7 @@ class ImportTest extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); Text.pop(); - ImportNestAll_1.tStyles(this); + ImportNestAll_1.tStyles.bind(this)(); this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Button.createWithLabel(this.testText3); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts index 52cfc5b..72e3bf9 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builder.ts @@ -335,7 +335,7 @@ class MyComponent extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); Text.pop(); - specificParam('test1', 'test2', this); + specificParam.bind(this)('test1', 'test2'); Row.pop(); this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts index bcff54b..37353ff 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithComponent.ts @@ -96,8 +96,8 @@ class Index extends ViewPU { } ViewStackProcessor.StopGetAccessRecording(); }); - myBuilder(this); - this.Builder1(this); + myBuilder.bind(this)(); + this.Builder1.bind(this)(); { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithForEach.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithForEach.ts index 9c02a20..baac3f7 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithForEach.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithForEach.ts @@ -118,7 +118,7 @@ class Index extends ViewPU { } ViewStackProcessor.StopGetAccessRecording(); }); - ComB(this.arr, this); + ComB.bind(this)(this.arr); Column.pop(); } rerender() { diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts index 784ac7d..3cd608b 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builder/@builderWithLinkData.ts @@ -128,7 +128,7 @@ class TestPage extends ViewPU { } ViewStackProcessor.StopGetAccessRecording(); }); - this.TitleCompView(this); + this.TitleCompView.bind(this)(); Flex.pop(); } rerender() { diff --git a/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts b/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts index 9742eed..9966a93 100644 --- a/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts +++ b/compiler/test/utForPartialUpdate/render_decorator/@builderParam/@builderParam.ts @@ -108,6 +108,8 @@ class CustomContainer extends ViewPU { constructor(parent, params, __localStorage, elmtId = -1) { super(parent, __localStorage, elmtId); this.header = ""; + this.content = undefined; + this.callContent = undefined; this.footer = ""; this.setInitiallyProvidedValue(params); } @@ -115,8 +117,12 @@ class CustomContainer extends ViewPU { if (params.header !== undefined) { this.header = params.header; } - this.content = params.content; - this.callContent = params.callContent; + if (params.content !== undefined) { + this.content = params.content; + } + if (params.callContent !== undefined) { + this.callContent = params.callContent; + } if (params.footer !== undefined) { this.footer = params.footer; } @@ -147,8 +153,8 @@ class CustomContainer extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); Text.pop(); - this.content(this); - this.callContent(this); + this.content.bind(this)(); + this.callContent.bind(this)(); this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); Text.create(this.footer); @@ -168,13 +174,16 @@ class CustomContainer2 extends ViewPU { constructor(parent, params, __localStorage, elmtId = -1) { super(parent, __localStorage, elmtId); this.header = ""; + this.content = undefined; this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { if (params.header !== undefined) { this.header = params.header; } - this.content = params.content; + if (params.content !== undefined) { + this.content = params.content; + } } updateStateVars(params) { } @@ -202,7 +211,7 @@ class CustomContainer2 extends ViewPU { ViewStackProcessor.StopGetAccessRecording(); }); Text.pop(); - this.content(this); + this.content.bind(this)(); Column.pop(); } rerender() { @@ -346,7 +355,7 @@ class CustomContainerUser extends ViewPU { } ViewStackProcessor.StopGetAccessRecording(); }); - specificWithParam("111", "22", this); + specificWithParam.bind(this)("111", "22"); Column.pop(); } }, undefined, elmtId)); @@ -409,7 +418,7 @@ class CustomContainerUser extends ViewPU { } ViewStackProcessor.StopGetAccessRecording(); }); - this.callSpecificParam("111", '222', this); + this.callSpecificParam.bind(this)("111", '222'); Column.pop(); } }, undefined, elmtId)); -- Gitee From fe7fc1aea66f12905f3b5b52574c3af8e0bab5fd Mon Sep 17 00:00:00 2001 From: Guangyao Ma Date: Tue, 21 Feb 2023 00:55:42 +0800 Subject: [PATCH 376/379] refact: rewrite the filter of form type error in printDiagnostic function Close #I6GH5N Signed-off-by: Guangyao Ma Change-Id: I71d5af735c349f46cfffca784c7ae07c5d0298d8 --- compiler/src/ets_checker.ts | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index c844a54..7eeffee 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -229,22 +229,31 @@ export function serviceChecker(rootFileNames: string[], newLogger: any = null): } } +function isCardFile(file: string): boolean { + for (const key in projectConfig.cardEntryObj) { + if (path.normalize(projectConfig.cardEntryObj[key]) === path.normalize(file)) { + return true; + } + } + return false; +} + +function containFormError(message: string): boolean { + if (/can't support form application./.test(message)) { + return true; + } + return false; +} + export function printDiagnostic(diagnostic: ts.Diagnostic): void { const message: string = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); if (validateError(message)) { if (process.env.watchMode !== 'true' && !projectConfig.xtsMode) { updateErrorFileCache(diagnostic); } - - // FIXME: will be instead of ts.Diagnostics config - if (diagnostic.file) { - const absPath = diagnostic.file.fileName; - const relativePath = path.relative(projectConfig.projectPath, absPath); - const cardEntryObjKey = `.././${relativePath}`.replace(/\.ets$/, ''); - if (!projectConfig.cardEntryObj[cardEntryObjKey] && - /can't support form application./.test(message)) { + + if (containFormError(message) && !isCardFile(diagnostic.file.fileName)) { return; - } } checkerResult.count += 1; -- Gitee From f6d098217d40f8067ef45515785eb27a5fb7f5c6 Mon Sep 17 00:00:00 2001 From: bojiang Date: Mon, 20 Feb 2023 18:48:25 +0800 Subject: [PATCH 377/379] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: Ifff8e1b7ca86a0b8c72cbddd746ca3a6af55b65b --- .../animateTo/animateTo.ts | 112 ++++++++++++---- .../animateTo/animateTo.ts | 125 +++++++++++++----- 2 files changed, 181 insertions(+), 56 deletions(-) diff --git a/compiler/test/ut/inner_commponent_transform/transition_component/animateTo/animateTo.ts b/compiler/test/ut/inner_commponent_transform/transition_component/animateTo/animateTo.ts index 3399a36..da1e3e7 100644 --- a/compiler/test/ut/inner_commponent_transform/transition_component/animateTo/animateTo.ts +++ b/compiler/test/ut/inner_commponent_transform/transition_component/animateTo/animateTo.ts @@ -21,6 +21,11 @@ struct TransitionExample { @State btnH: number = 50 @State btn1: boolean = false @State show: string = "show" + @State color: Color = Color.Red; + @State width1: number = 100; + @State height1: number = 100; + @State opacity1: number = 1; + @State borderRaius1: number = 10 build() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,}) { Button(this.show) @@ -41,37 +46,37 @@ struct TransitionExample { .transition({ type: TransitionType.Delete, scale: { x: 1.0, y: 0.0 }}) } Button('animation') - .width(this.btnW).height(this.btnH) - .onClick(() => { - this.btnW += 50 - }) - .animation({ - duration: 1000, // 动画时长 - curve: Curve.EaseOut, // 动画曲线 - delay: 200, // 动画延迟 - iterations: 1, // 播放次数 - playMode: PlayMode.Normal // 动画模式 - }) - Column({space: 5}) { - Column() - .opacity(this.opacity1) - .backgroundColor(this.color) - .animation({duration: 1000}) - .width(this.width1) - .animation({duration: 2000}) - .height(this.height1) - .borderRadius(this.borderRaius1) - .animation({duration: 3000}) + .width(this.btnW).height(this.btnH) .onClick(() => { + this.btnW += 50 + }) + .animation({ + duration: 1000, // 动画时长 + curve: Curve.EaseOut, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal // 动画模式 + }) + Column({space: 5}) { + Column() + .opacity(this.opacity1) + .backgroundColor(this.color) + .animation({duration: 1000}) + .width(this.width1) + .animation({duration: 2000}) + .height(this.height1) + .borderRadius(this.borderRaius1) + .animation({duration: 3000}) + .onClick(() => { this.color = Color.Green this.borderRaius1 = 20 this.opacity1 = 0.5 this.height1 = 200 this.width1 = 200 - }) - } - .width("100%") - .height("100%") + }) + } + .width("100%") + .height("100%") }.height(400).width("100%").padding({top:100}) } } @@ -90,6 +95,11 @@ class TransitionExample extends View { this.__btnH = new ObservedPropertySimple(50, this, "btnH"); this.__btn1 = new ObservedPropertySimple(false, this, "btn1"); this.__show = new ObservedPropertySimple("show", this, "show"); + this.__color = new ObservedPropertyObject(Color.Red, this, "color"); + this.__width1 = new ObservedPropertySimple(100, this, "width1"); + this.__height1 = new ObservedPropertySimple(100, this, "height1"); + this.__opacity1 = new ObservedPropertySimple(1, this, "opacity1"); + this.__borderRaius1 = new ObservedPropertySimple(10, this, "borderRaius1"); this.updateWithValueParams(params); } updateWithValueParams(params) { @@ -105,12 +115,32 @@ class TransitionExample extends View { if (params.show !== undefined) { this.show = params.show; } + if (params.color !== undefined) { + this.color = params.color; + } + if (params.width1 !== undefined) { + this.width1 = params.width1; + } + if (params.height1 !== undefined) { + this.height1 = params.height1; + } + if (params.opacity1 !== undefined) { + this.opacity1 = params.opacity1; + } + if (params.borderRaius1 !== undefined) { + this.borderRaius1 = params.borderRaius1; + } } aboutToBeDeleted() { this.__btnW.aboutToBeDeleted(); this.__btnH.aboutToBeDeleted(); this.__btn1.aboutToBeDeleted(); this.__show.aboutToBeDeleted(); + this.__color.aboutToBeDeleted(); + this.__width1.aboutToBeDeleted(); + this.__height1.aboutToBeDeleted(); + this.__opacity1.aboutToBeDeleted(); + this.__borderRaius1.aboutToBeDeleted(); SubscriberManager.Get().delete(this.id()); } get btnW() { @@ -137,6 +167,36 @@ class TransitionExample extends View { set show(newValue) { this.__show.set(newValue); } + get color() { + return this.__color.get(); + } + set color(newValue) { + this.__color.set(newValue); + } + get width1() { + return this.__width1.get(); + } + set width1(newValue) { + this.__width1.set(newValue); + } + get height1() { + return this.__height1.get(); + } + set height1(newValue) { + this.__height1.set(newValue); + } + get opacity1() { + return this.__opacity1.get(); + } + set opacity1(newValue) { + this.__opacity1.set(newValue); + } + get borderRaius1() { + return this.__borderRaius1.get(); + } + set borderRaius1(newValue) { + this.__borderRaius1.set(newValue); + } render() { Flex.create({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, }); Flex.height(400); @@ -187,7 +247,7 @@ class TransitionExample extends View { Column.create(); Context.animation({ duration: 1000 }); Column.opacity(this.opacity1); - Column.backgroundColor(this.color); + Column.backgroundColor(ObservedObject.GetRawObject(this.color)); Context.animation(null); Context.animation({ duration: 2000 }); Column.width(this.width1); diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts b/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts index a830d61..5a21c3b 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/transition_component/animateTo/animateTo.ts @@ -21,6 +21,11 @@ struct TransitionExample { @State btnH: number = 50 @State btn1: boolean = false @State show: string = "show" + @State color: Color = Color.Red; + @State width1: number = 100; + @State height1: number = 100; + @State opacity1: number = 1; + @State borderRaius1: number = 10 build() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,}) { Button(this.show) @@ -41,37 +46,37 @@ struct TransitionExample { .transition({ type: TransitionType.Delete, scale: { x: 1.0, y: 0.0 }}) } Button('animation') - .width(this.btnW).height(this.btnH) + .width(this.btnW).height(this.btnH) + .onClick(() => { + this.btnW += 50 + }) + .animation({ + duration: 1000, // 动画时长 + curve: Curve.EaseOut, // 动画曲线 + delay: 200, // 动画延迟 + iterations: 1, // 播放次数 + playMode: PlayMode.Normal // 动画模式 + }) + Column({space: 5}) { + Column() + .opacity(this.opacity1) + .backgroundColor(this.color) + .animation({duration: 1000}) + .width(this.width1) + .animation({duration: 2000}) + .height(this.height1) + .borderRadius(this.borderRaius1) + .animation({duration: 3000}) .onClick(() => { - this.btnW += 50 + this.color = Color.Green + this.borderRaius1 = 20 + this.opacity1 = 0.5 + this.height1 = 200 + this.width1 = 200 }) - .animation({ - duration: 1000, // 动画时长 - curve: Curve.EaseOut, // 动画曲线 - delay: 200, // 动画延迟 - iterations: 1, // 播放次数 - playMode: PlayMode.Normal // 动画模式 - }) - Column({space: 5}) { - Column() - .opacity(this.opacity1) - .backgroundColor(this.color) - .animation({duration: 1000}) - .width(this.width1) - .animation({duration: 2000}) - .height(this.height1) - .borderRadius(this.borderRaius1) - .animation({duration: 3000}) - .onClick(() => { - this.color = Color.Green - this.borderRaius1 = 20 - this.opacity1 = 0.5 - this.height1 = 200 - this.width1 = 200 - }) - } - .width("100%") - .height("100%") + } + .width("100%") + .height("100%") }.height(400).width("100%").padding({top:100}) } } @@ -86,6 +91,11 @@ class TransitionExample extends ViewPU { this.__btnH = new ObservedPropertySimplePU(50, this, "btnH"); this.__btn1 = new ObservedPropertySimplePU(false, this, "btn1"); this.__show = new ObservedPropertySimplePU("show", this, "show"); + this.__color = new ObservedPropertyObjectPU(Color.Red, this, "color"); + this.__width1 = new ObservedPropertySimplePU(100, this, "width1"); + this.__height1 = new ObservedPropertySimplePU(100, this, "height1"); + this.__opacity1 = new ObservedPropertySimplePU(1, this, "opacity1"); + this.__borderRaius1 = new ObservedPropertySimplePU(10, this, "borderRaius1"); this.setInitiallyProvidedValue(params); } setInitiallyProvidedValue(params) { @@ -101,6 +111,21 @@ class TransitionExample extends ViewPU { if (params.show !== undefined) { this.show = params.show; } + if (params.color !== undefined) { + this.color = params.color; + } + if (params.width1 !== undefined) { + this.width1 = params.width1; + } + if (params.height1 !== undefined) { + this.height1 = params.height1; + } + if (params.opacity1 !== undefined) { + this.opacity1 = params.opacity1; + } + if (params.borderRaius1 !== undefined) { + this.borderRaius1 = params.borderRaius1; + } } updateStateVars(params) { } @@ -109,12 +134,22 @@ class TransitionExample extends ViewPU { this.__btnH.purgeDependencyOnElmtId(rmElmtId); this.__btn1.purgeDependencyOnElmtId(rmElmtId); this.__show.purgeDependencyOnElmtId(rmElmtId); + this.__color.purgeDependencyOnElmtId(rmElmtId); + this.__width1.purgeDependencyOnElmtId(rmElmtId); + this.__height1.purgeDependencyOnElmtId(rmElmtId); + this.__opacity1.purgeDependencyOnElmtId(rmElmtId); + this.__borderRaius1.purgeDependencyOnElmtId(rmElmtId); } aboutToBeDeleted() { this.__btnW.aboutToBeDeleted(); this.__btnH.aboutToBeDeleted(); this.__btn1.aboutToBeDeleted(); this.__show.aboutToBeDeleted(); + this.__color.aboutToBeDeleted(); + this.__width1.aboutToBeDeleted(); + this.__height1.aboutToBeDeleted(); + this.__opacity1.aboutToBeDeleted(); + this.__borderRaius1.aboutToBeDeleted(); SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } @@ -142,6 +177,36 @@ class TransitionExample extends ViewPU { set show(newValue) { this.__show.set(newValue); } + get color() { + return this.__color.get(); + } + set color(newValue) { + this.__color.set(newValue); + } + get width1() { + return this.__width1.get(); + } + set width1(newValue) { + this.__width1.set(newValue); + } + get height1() { + return this.__height1.get(); + } + set height1(newValue) { + this.__height1.set(newValue); + } + get opacity1() { + return this.__opacity1.get(); + } + set opacity1(newValue) { + this.__opacity1.set(newValue); + } + get borderRaius1() { + return this.__borderRaius1.get(); + } + set borderRaius1(newValue) { + this.__borderRaius1.set(newValue); + } initialRender() { this.observeComponentCreation((elmtId, isInitialRender) => { ViewStackProcessor.StartGetAccessRecordingFor(elmtId); @@ -240,7 +305,7 @@ class TransitionExample extends ViewPU { Column.create(); Context.animation({ duration: 1000 }); Column.opacity(this.opacity1); - Column.backgroundColor(this.color); + Column.backgroundColor(ObservedObject.GetRawObject(this.color)); Context.animation(null); Context.animation({ duration: 2000 }); Column.width(this.width1); -- Gitee From 5ce0d6a816c842fbecba6fa66deeca789dd4ae28 Mon Sep 17 00:00:00 2001 From: gavin1012_hw Date: Sat, 11 Feb 2023 11:25:14 +0800 Subject: [PATCH 378/379] Enhance reload ability for IDE compiling Issue: I6D2D4 Signed-off-by: gavin1012_hw Change-Id: I849b58644e75c2ab92a76be71afe7a035fb99244 --- .../ark_compiler/common/ark_define.ts | 1 + .../ark_compiler/common/process_ark_config.ts | 3 ++ .../module/module_hotreload_mode.ts | 21 +++++++++++- .../ark_compiler/module/module_mode.ts | 32 +++++++++---------- 4 files changed, 39 insertions(+), 18 deletions(-) diff --git a/compiler/src/fast_build/ark_compiler/common/ark_define.ts b/compiler/src/fast_build/ark_compiler/common/ark_define.ts index e57275d..97638e2 100644 --- a/compiler/src/fast_build/ark_compiler/common/ark_define.ts +++ b/compiler/src/fast_build/ark_compiler/common/ark_define.ts @@ -24,6 +24,7 @@ export const MODULELIST_JSON: string = 'moduleList.json'; export const PREBUILDMODE_JSON: string = 'preBuildMode.json'; export const SOURCEMAPS_JSON: string = 'sourceMaps.json'; export const SOURCEMAPS: string = 'sourceMaps.map'; +export const SYMBOLMAP: string = 'symbolMap.map'; export const PROTO_FILESINFO_TXT: string = 'protoFilesInfo.txt'; export const AOT_FULL: string = 'full'; export const AOT_TYPE: string = 'type'; diff --git a/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts b/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts index f9a3a63..39292cf 100644 --- a/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts +++ b/compiler/src/fast_build/ark_compiler/common/process_ark_config.ts @@ -75,6 +75,9 @@ export function initArkProjectConfig(share: any) { arkProjectConfig.projectRootPath = buildJsonInfo.projectRootPath; arkProjectConfig.modulePathMap = buildJsonInfo.modulePathMap; arkProjectConfig.isOhosTest = buildJsonInfo.isOhosTest; + if (buildJsonInfo.patchConfig) { + arkProjectConfig.oldMapFilePath = buildJsonInfo.patchConfig.oldMapFilePath; + } if (checkAotConfig(buildJsonInfo, (error: string) => { share.throwArkTsCompilerError(error) })) { arkProjectConfig.processTs = true; arkProjectConfig.pandaMode = TS2ABC; diff --git a/compiler/src/fast_build/ark_compiler/module/module_hotreload_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_hotreload_mode.ts index fa76ed7..20c3cec 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_hotreload_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_hotreload_mode.ts @@ -21,7 +21,8 @@ import { blue, reset, MODULES_ABC, - SOURCEMAPS + SOURCEMAPS, + SYMBOLMAP } from '../common/ark_define'; import { newSourceMaps } from '../transform'; import { @@ -34,8 +35,14 @@ let isFirstBuild: boolean = true; let hotReloadSourceMap: Object = {}; export class ModuleHotreloadMode extends ModuleMode { + symbolMapFilePath: string; constructor(rollupObject: any) { super(rollupObject); + if (this.projectConfig.oldMapFilePath) { + this.symbolMapFilePath = path.join(this.projectConfig.oldMapFilePath, SYMBOLMAP); + } else { + this.throwArkTsCompilerError('ArkTS:ERROR oldMapFilePath is not specified, hotReload Fail'); + } } generateAbc(rollupObject: any) { @@ -47,6 +54,17 @@ export class ModuleHotreloadMode extends ModuleMode { } } + addHotReloadArgs() { + if (isFirstBuild) { + this.cmdArgs.push('--dump-symbol-table'); + this.cmdArgs.push(`"${this.symbolMapFilePath}"`); + return; + } + this.cmdArgs.push('--input-symbol-table'); + this.cmdArgs.push(`"${this.symbolMapFilePath}"`); + this.cmdArgs.push('--hot-reload'); + } + private compileAllFiles(rollupObject: any) { this.collectModuleFileList(rollupObject, rollupObject.getModuleIds()); this.buildModuleSourceMapInfo(); @@ -101,6 +119,7 @@ export class ModuleHotreloadMode extends ModuleMode { private generateAbcByEs2abc() { this.generateEs2AbcCmd(); + this.addHotReloadArgs(); this.generateMergedAbcOfEs2Abc(); } } diff --git a/compiler/src/fast_build/ark_compiler/module/module_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_mode.ts index 293a0b4..1e22447 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_mode.ts @@ -22,37 +22,35 @@ import { AUXILIARY, COMMONJS, ESM, + ESMODULE, EXTNAME_CJS, EXTNAME_ETS, EXTNAME_JS, EXTNAME_JSON, EXTNAME_MJS, + EXTNAME_PROTO_BIN, EXTNAME_TS, + EXTNAME_TXT, + FAIL, + FILESINFO, FILESINFO_TXT, + HAP_PACKAGE, MAIN, + MAX_WORKER_NUMBER, MODULES_ABC, MODULES_CACHE, + NPM_ENTRIES_PROTO_BIN, NPMENTRIES_TXT, - SOURCEMAPS, - SOURCEMAPS_JSON, - TEMPORARY, - WIDGETS_ABC, - HAP_PACKAGE, PACKAGES, - PROJECT_PACKAGE -} from '../common/ark_define'; -import { - ESMODULE, - EXTNAME_PROTO_BIN, - EXTNAME_TXT, - FILESINFO, - MAX_WORKER_NUMBER, - NPM_ENTRIES_PROTO_BIN, - PROTOS, + PROJECT_PACKAGE, PROTO_FILESINFO_TXT, - FAIL, + PROTOS, red, - reset + reset, + SOURCEMAPS, + SOURCEMAPS_JSON, + TEMPORARY, + WIDGETS_ABC } from '../common/ark_define'; import { needAotCompiler, -- Gitee From b1e7425a82409163375af916d1d1327201c8053c Mon Sep 17 00:00:00 2001 From: nickyjd Date: Tue, 21 Feb 2023 22:54:51 +0800 Subject: [PATCH 379/379] =?UTF-8?q?gridRow=E6=B7=BB=E5=8A=A0alignItems?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nickyjd Change-Id: Iec845136a92369cd5550239f86fe475272c2003b --- compiler/components/grid_row.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/components/grid_row.json b/compiler/components/grid_row.json index d66192d..cfee5e6 100644 --- a/compiler/components/grid_row.json +++ b/compiler/components/grid_row.json @@ -2,6 +2,7 @@ "name": "GridRow", "children": ["GridCol"], "attrs": [ - "onBreakpointChange" + "onBreakpointChange", + "alignItems" ] } \ No newline at end of file -- Gitee