@angular-eslint/eslint-plugin-template 15.1.1-alpha.9 → 15.2.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/configs/all.json +1 -0
  2. package/dist/eslint-plugin-template/src/index.d.ts +2 -0
  3. package/dist/eslint-plugin-template/src/processors.d.ts +1 -1
  4. package/dist/eslint-plugin-template/src/rules/accessibility-alt-text.d.ts +1 -1
  5. package/dist/eslint-plugin-template/src/rules/accessibility-elements-content.d.ts +2 -2
  6. package/dist/eslint-plugin-template/src/rules/accessibility-interactive-supports-focus.d.ts +1 -1
  7. package/dist/eslint-plugin-template/src/rules/accessibility-label-for.d.ts +2 -2
  8. package/dist/eslint-plugin-template/src/rules/accessibility-label-has-associated-control.d.ts +3 -3
  9. package/dist/eslint-plugin-template/src/rules/accessibility-role-has-required-aria.d.ts +1 -1
  10. package/dist/eslint-plugin-template/src/rules/accessibility-table-scope.d.ts +1 -1
  11. package/dist/eslint-plugin-template/src/rules/accessibility-valid-aria.d.ts +1 -1
  12. package/dist/eslint-plugin-template/src/rules/attributes-order.d.ts +2 -2
  13. package/dist/eslint-plugin-template/src/rules/banana-in-box.d.ts +1 -1
  14. package/dist/eslint-plugin-template/src/rules/button-has-type.d.ts +1 -1
  15. package/dist/eslint-plugin-template/src/rules/click-events-have-key-events.d.ts +1 -1
  16. package/dist/eslint-plugin-template/src/rules/conditional-complexity.d.ts +2 -2
  17. package/dist/eslint-plugin-template/src/rules/cyclomatic-complexity.d.ts +2 -2
  18. package/dist/eslint-plugin-template/src/rules/eqeqeq.d.ts +2 -2
  19. package/dist/eslint-plugin-template/src/rules/i18n.d.ts +2 -2
  20. package/dist/eslint-plugin-template/src/rules/mouse-events-have-key-events.d.ts +1 -1
  21. package/dist/eslint-plugin-template/src/rules/no-any.d.ts +1 -1
  22. package/dist/eslint-plugin-template/src/rules/no-autofocus.d.ts +1 -1
  23. package/dist/eslint-plugin-template/src/rules/no-call-expression.d.ts +2 -2
  24. package/dist/eslint-plugin-template/src/rules/no-distracting-elements.d.ts +1 -1
  25. package/dist/eslint-plugin-template/src/rules/no-duplicate-attributes.d.ts +2 -2
  26. package/dist/eslint-plugin-template/src/rules/no-inline-styles.d.ts +2 -2
  27. package/dist/eslint-plugin-template/src/rules/no-interpolation-in-attributes.d.ts +4 -0
  28. package/dist/eslint-plugin-template/src/rules/no-negated-async.d.ts +1 -1
  29. package/dist/eslint-plugin-template/src/rules/no-positive-tabindex.d.ts +1 -1
  30. package/dist/eslint-plugin-template/src/rules/use-track-by-function.d.ts +1 -1
  31. package/dist/eslint-plugin-template/src/utils/get-nearest-node-from.d.ts +1 -1
  32. package/dist/index.js +1 -1
  33. package/package.json +6 -6
@@ -24,6 +24,7 @@
24
24
  "@angular-eslint/template/no-distracting-elements": "error",
25
25
  "@angular-eslint/template/no-duplicate-attributes": "error",
26
26
  "@angular-eslint/template/no-inline-styles": "error",
27
+ "@angular-eslint/template/no-interpolation-in-attributes": "error",
27
28
  "@angular-eslint/template/no-negated-async": "error",
28
29
  "@angular-eslint/template/no-positive-tabindex": "error",
29
30
  "@angular-eslint/template/use-track-by-function": "error"
@@ -26,6 +26,7 @@ declare const _default: {
26
26
  "@angular-eslint/template/no-distracting-elements": string;
27
27
  "@angular-eslint/template/no-duplicate-attributes": string;
28
28
  "@angular-eslint/template/no-inline-styles": string;
29
+ "@angular-eslint/template/no-interpolation-in-attributes": string;
29
30
  "@angular-eslint/template/no-negated-async": string;
30
31
  "@angular-eslint/template/no-positive-tabindex": string;
31
32
  "@angular-eslint/template/use-track-by-function": string;
@@ -126,6 +127,7 @@ declare const _default: {
126
127
  "no-negated-async": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<import("./rules/no-negated-async").MessageIds, [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
127
128
  "no-positive-tabindex": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<import("./rules/no-positive-tabindex").MessageIds, [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
128
129
  "use-track-by-function": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"useTrackByFunction", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
130
+ "no-interpolation-in-attributes": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"noInterpolationInAttributes", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
129
131
  };
130
132
  };
131
133
  export default _default;
@@ -7,7 +7,7 @@
7
7
  * a file is likely to contain them.
8
8
  */
9
9
  export declare function isFileLikelyToContainComponentDeclarations(text: string, filename: string): boolean;
10
- declare type PreprocessResult = (string | {
10
+ type PreprocessResult = (string | {
11
11
  text: string;
12
12
  filename: string;
13
13
  })[];
@@ -1,4 +1,4 @@
1
- export declare type MessageIds = 'accessibilityAltText';
1
+ export type MessageIds = 'accessibilityAltText';
2
2
  export declare const RULE_NAME = "accessibility-alt-text";
3
3
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"accessibilityAltText", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
4
  export default _default;
@@ -1,9 +1,9 @@
1
- declare type Options = [
1
+ type Options = [
2
2
  {
3
3
  readonly allowList?: readonly string[];
4
4
  }
5
5
  ];
6
- export declare type MessageIds = 'accessibilityElementsContent';
6
+ export type MessageIds = 'accessibilityElementsContent';
7
7
  export declare const RULE_NAME = "accessibility-elements-content";
8
8
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"accessibilityElementsContent", Options, import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
9
9
  export default _default;
@@ -1,4 +1,4 @@
1
- export declare type MessageIds = 'interactiveSupportsFocus';
1
+ export type MessageIds = 'interactiveSupportsFocus';
2
2
  export declare const RULE_NAME = "accessibility-interactive-supports-focus";
3
3
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"interactiveSupportsFocus", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
4
  export default _default;
@@ -1,11 +1,11 @@
1
- declare type Options = [
1
+ type Options = [
2
2
  {
3
3
  readonly controlComponents?: readonly string[];
4
4
  readonly labelAttributes?: readonly string[];
5
5
  readonly labelComponents?: readonly string[];
6
6
  }
7
7
  ];
8
- export declare type MessageIds = 'accessibilityLabelFor';
8
+ export type MessageIds = 'accessibilityLabelFor';
9
9
  export declare const RULE_NAME = "accessibility-label-for";
10
10
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"accessibilityLabelFor", Options, import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
11
11
  export default _default;
@@ -1,14 +1,14 @@
1
- declare type LabelComponent = {
1
+ type LabelComponent = {
2
2
  readonly inputs?: readonly string[];
3
3
  readonly selector: string;
4
4
  };
5
- declare type Options = [
5
+ type Options = [
6
6
  {
7
7
  readonly controlComponents?: readonly string[];
8
8
  readonly labelComponents?: readonly LabelComponent[];
9
9
  }
10
10
  ];
11
- export declare type MessageIds = 'accessibilityLabelHasAssociatedControl';
11
+ export type MessageIds = 'accessibilityLabelHasAssociatedControl';
12
12
  export declare const RULE_NAME = "accessibility-label-has-associated-control";
13
13
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"accessibilityLabelHasAssociatedControl", Options, import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
14
14
  export default _default;
@@ -1,4 +1,4 @@
1
- export declare type MessageIds = 'roleHasRequiredAria' | 'suggestRemoveRole';
1
+ export type MessageIds = 'roleHasRequiredAria' | 'suggestRemoveRole';
2
2
  export declare const RULE_NAME = "accessibility-role-has-required-aria";
3
3
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<MessageIds, [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
4
  export default _default;
@@ -1,4 +1,4 @@
1
- export declare type MessageIds = 'accessibilityTableScope';
1
+ export type MessageIds = 'accessibilityTableScope';
2
2
  export declare const RULE_NAME = "accessibility-table-scope";
3
3
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"accessibilityTableScope", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
4
  export default _default;
@@ -1,4 +1,4 @@
1
- export declare type MessageIds = 'accessibilityValidAria' | 'accessibilityValidAriaValue' | 'suggestRemoveInvalidAria';
1
+ export type MessageIds = 'accessibilityValidAria' | 'accessibilityValidAriaValue' | 'suggestRemoveInvalidAria';
2
2
  export declare const RULE_NAME = "accessibility-valid-aria";
3
3
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<MessageIds, [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
4
  export default _default;
@@ -6,13 +6,13 @@ export declare const enum OrderType {
6
6
  OutputBinding = "OUTPUT_BINDING",
7
7
  TwoWayBinding = "TWO_WAY_BINDING"
8
8
  }
9
- declare type Options = [
9
+ type Options = [
10
10
  {
11
11
  readonly alphabetical: boolean;
12
12
  readonly order: readonly OrderType[];
13
13
  }
14
14
  ];
15
- export declare type MessageIds = 'attributesOrder';
15
+ export type MessageIds = 'attributesOrder';
16
16
  export declare const RULE_NAME = "attributes-order";
17
17
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"attributesOrder", Options, import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
18
18
  export default _default;
@@ -1,4 +1,4 @@
1
- export declare type MessageIds = 'bananaInBox';
1
+ export type MessageIds = 'bananaInBox';
2
2
  export declare const RULE_NAME = "banana-in-box";
3
3
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"bananaInBox", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
4
  export default _default;
@@ -1,5 +1,5 @@
1
1
  export declare const RULE_NAME = "button-has-type";
2
2
  export declare const INVALID_TYPE_DATA_KEY = "type";
3
- export declare type MessageIds = 'invalidType' | 'missingType';
3
+ export type MessageIds = 'invalidType' | 'missingType';
4
4
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<MessageIds, [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
5
5
  export default _default;
@@ -1,4 +1,4 @@
1
- export declare type MessageIds = 'clickEventsHaveKeyEvents';
1
+ export type MessageIds = 'clickEventsHaveKeyEvents';
2
2
  export declare const RULE_NAME = "click-events-have-key-events";
3
3
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"clickEventsHaveKeyEvents", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
4
  export default _default;
@@ -1,7 +1,7 @@
1
- declare type Options = [{
1
+ type Options = [{
2
2
  maxComplexity: number;
3
3
  }];
4
- export declare type MessageIds = 'conditionalComplexity';
4
+ export type MessageIds = 'conditionalComplexity';
5
5
  export declare const RULE_NAME = "conditional-complexity";
6
6
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"conditionalComplexity", Options, import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
7
7
  export default _default;
@@ -1,7 +1,7 @@
1
- declare type Options = [{
1
+ type Options = [{
2
2
  maxComplexity: number;
3
3
  }];
4
- export declare type MessageIds = 'cyclomaticComplexity';
4
+ export type MessageIds = 'cyclomaticComplexity';
5
5
  export declare const RULE_NAME = "cyclomatic-complexity";
6
6
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"cyclomaticComplexity", Options, import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
7
7
  export default _default;
@@ -1,8 +1,8 @@
1
1
  import type { TSESLint } from '@typescript-eslint/utils';
2
- declare type Options = [{
2
+ type Options = [{
3
3
  readonly allowNullOrUndefined?: boolean;
4
4
  }];
5
- export declare type MessageIds = 'eqeqeq' | 'suggestStrictEquality';
5
+ export type MessageIds = 'eqeqeq' | 'suggestStrictEquality';
6
6
  export declare const RULE_NAME = "eqeqeq";
7
7
  declare const _default: TSESLint.RuleModule<MessageIds, Options, TSESLint.RuleListener>;
8
8
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import type { TSESLint } from '@typescript-eslint/utils';
2
- declare type Options = [
2
+ type Options = [
3
3
  {
4
4
  readonly boundTextAllowedPattern?: string;
5
5
  readonly checkAttributes?: boolean;
@@ -12,7 +12,7 @@ declare type Options = [
12
12
  readonly requireMeaning?: boolean;
13
13
  }
14
14
  ];
15
- export declare type MessageIds = 'i18nAttribute' | 'i18nAttributeOnIcuOrText' | 'i18nCustomIdOnAttribute' | 'i18nCustomIdOnElement' | 'i18nDuplicateCustomId' | 'suggestAddI18nAttribute' | 'i18nMissingDescription' | 'i18nMissingMeaning';
15
+ export type MessageIds = 'i18nAttribute' | 'i18nAttributeOnIcuOrText' | 'i18nCustomIdOnAttribute' | 'i18nCustomIdOnElement' | 'i18nDuplicateCustomId' | 'suggestAddI18nAttribute' | 'i18nMissingDescription' | 'i18nMissingMeaning';
16
16
  export declare const RULE_NAME = "i18n";
17
17
  declare const _default: TSESLint.RuleModule<MessageIds, Options, TSESLint.RuleListener>;
18
18
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import type { TSESLint } from '@typescript-eslint/utils';
2
- export declare type MessageIds = 'mouseEventsHaveKeyEvents';
2
+ export type MessageIds = 'mouseEventsHaveKeyEvents';
3
3
  export declare const RULE_NAME = "mouse-events-have-key-events";
4
4
  declare const _default: TSESLint.RuleModule<"mouseEventsHaveKeyEvents", [], TSESLint.RuleListener>;
5
5
  export default _default;
@@ -1,4 +1,4 @@
1
- export declare type MessageIds = 'noAny' | 'suggestRemoveAny';
1
+ export type MessageIds = 'noAny' | 'suggestRemoveAny';
2
2
  export declare const RULE_NAME = "no-any";
3
3
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<MessageIds, [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
4
  export default _default;
@@ -1,4 +1,4 @@
1
- export declare type MessageIds = 'noAutofocus';
1
+ export type MessageIds = 'noAutofocus';
2
2
  export declare const RULE_NAME = "no-autofocus";
3
3
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"noAutofocus", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
4
  export default _default;
@@ -1,9 +1,9 @@
1
- declare type Options = [
1
+ type Options = [
2
2
  {
3
3
  readonly allowList?: readonly string[];
4
4
  }
5
5
  ];
6
- export declare type MessageIds = 'noCallExpression';
6
+ export type MessageIds = 'noCallExpression';
7
7
  export declare const RULE_NAME = "no-call-expression";
8
8
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"noCallExpression", Options, import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
9
9
  export default _default;
@@ -1,4 +1,4 @@
1
- export declare type MessageIds = 'noDistractingElements';
1
+ export type MessageIds = 'noDistractingElements';
2
2
  export declare const RULE_NAME = "no-distracting-elements";
3
3
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"noDistractingElements", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
4
  export default _default;
@@ -1,10 +1,10 @@
1
- declare type Options = [
1
+ type Options = [
2
2
  {
3
3
  readonly allowTwoWayDataBinding?: boolean;
4
4
  readonly ignore?: readonly string[];
5
5
  }
6
6
  ];
7
- export declare type MessageIds = 'noDuplicateAttributes' | 'suggestRemoveAttribute';
7
+ export type MessageIds = 'noDuplicateAttributes' | 'suggestRemoveAttribute';
8
8
  export declare const RULE_NAME = "no-duplicate-attributes";
9
9
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<MessageIds, Options, import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
10
10
  export default _default;
@@ -1,10 +1,10 @@
1
- declare type Options = [
1
+ type Options = [
2
2
  {
3
3
  readonly allowNgStyle?: boolean;
4
4
  readonly allowBindToStyle?: boolean;
5
5
  }
6
6
  ];
7
- export declare type MessageIds = 'noInlineStyles';
7
+ export type MessageIds = 'noInlineStyles';
8
8
  export declare const RULE_NAME = "no-inline-styles";
9
9
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"noInlineStyles", Options, import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
10
10
  export default _default;
@@ -0,0 +1,4 @@
1
+ export declare const MESSAGE_ID = "noInterpolationInAttributes";
2
+ export declare const RULE_NAME = "no-interpolation-in-attributes";
3
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"noInterpolationInAttributes", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
+ export default _default;
@@ -1,4 +1,4 @@
1
- export declare type MessageIds = 'noNegatedAsync' | 'suggestFalseComparison' | 'suggestNullComparison' | 'suggestUndefinedComparison';
1
+ export type MessageIds = 'noNegatedAsync' | 'suggestFalseComparison' | 'suggestNullComparison' | 'suggestUndefinedComparison';
2
2
  export declare const RULE_NAME = "no-negated-async";
3
3
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<MessageIds, [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
4
  export default _default;
@@ -1,4 +1,4 @@
1
- export declare type MessageIds = 'noPositiveTabindex' | 'suggestNonNegativeTabindex';
1
+ export type MessageIds = 'noPositiveTabindex' | 'suggestNonNegativeTabindex';
2
2
  export declare const RULE_NAME = "no-positive-tabindex";
3
3
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<MessageIds, [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
4
  export default _default;
@@ -1,4 +1,4 @@
1
- export declare type MessageIds = 'useTrackByFunction';
1
+ export type MessageIds = 'useTrackByFunction';
2
2
  export declare const RULE_NAME = "use-track-by-function";
3
3
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"useTrackByFunction", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
4
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import type { AST, TmplAstNode } from '@angular-eslint/bundled-angular-compiler';
2
- declare type ASTOrNodeWithParent = (AST | TmplAstNode) & {
2
+ type ASTOrNodeWithParent = (AST | TmplAstNode) & {
3
3
  parent?: ASTOrNodeWithParent;
4
4
  };
5
5
  export declare function getNearestNodeFrom<T extends ASTOrNodeWithParent>({ parent }: ASTOrNodeWithParent, predicate: (parent: ASTOrNodeWithParent) => parent is T): T | null;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var e=require("path"),t=require("@typescript-eslint/type-utils"),n=require("typescript"),r=require("@angular-eslint/utils"),a=require("@typescript-eslint/utils"),o=require("@angular-eslint/bundled-angular-compiler"),s=require("aria-query");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=/*#__PURE__*/i(n);const l=new Map;var c={"extract-inline-html":{preprocess:function(n,r){const a=[n];if(!function(e,t){return!![".component.ts",".page.ts",".dialog.ts",".modal.ts",".popover.ts",".bottomsheet.ts",".snackbar.ts"].some(e=>t.endsWith(e))||!(!e.includes("Component")||!e.includes("@angular/core"))}(n,r))return a;try{const o=u.default.createSourceFile(r,n,u.default.ScriptTarget.Latest,!0),s=o.statements.filter(e=>u.default.isClassDeclaration(e));if(!s||!s.length)return a;const i=[];for(const e of s){const n=t.getDecorators(e);if(n)for(const e of n)u.default.isCallExpression(e.expression)&&u.default.isIdentifier(e.expression.expression)&&"Component"===e.expression.expression.text&&i.push(e)}if(!i||!i.length)return a;const c=[n];let p=0;for(const t of i){if(!u.default.isDecorator(t)||!u.default.isCallExpression(t.expression)||1!==t.expression.arguments.length)continue;const n=t.expression.arguments[0];if(!u.default.isObjectLiteralExpression(n))continue;const a=n.properties.find(e=>e&&e.name&&"template"===e.name.getText());if(n.properties.find(e=>e&&e.name&&"templateUrl"===e.name.getText())||!a)continue;if(!u.default.isPropertyAssignment(a))continue;let s;const i=a.initializer;if(u.default.isNoSubstitutionTemplateLiteral(i)&&(s=i.rawText),u.default.isTemplateExpression(i)&&(s=i.getText()),u.default.isStringLiteral(i)&&(s=i.text),!s)continue;const m=`inline-template-${e.basename(r)}-${++p}.component.html`,d=a.initializer.getStart(),f=a.initializer.getEnd();l.set(m,{range:[d,f],lineAndCharacter:{start:o.getLineAndCharacterOfPosition(d),end:o.getLineAndCharacterOfPosition(f)}}),c.push({text:s,filename:m})}return c}catch(e){return console.log(e),console.error("preprocess: ERROR could not parse @Component() metadata",r),a}},postprocess:function(t,n){const r=t[0];if(1===t.length)return r;const a=t.slice(1);return[...r,...a.flatMap((t,r)=>{const a=`inline-template-${e.basename(n)}-${++r}.component.html`,o=l.get(a);return o?t.map(e=>{if(e.line=e.line+o.lineAndCharacter.start.line,e.endLine=e.endLine+o.lineAndCharacter.start.line,e.fix){const t=o.range[0];e.fix.range=[t+e.fix.range[0],t+e.fix.range[1]]}return e}):[]})]},supportsAutofix:!0}};const p=e=>function({name:t,meta:n,defaultOptions:r,create:o}){return{meta:Object.assign(Object.assign({},n),{docs:Object.assign(Object.assign({},n.docs),{url:e(t)})}),defaultOptions:r,create(e){const t=a.ESLintUtils.applyDefault(r,e.options);return o(e,t)}}};p.withoutDocs=a.ESLintUtils.RuleCreator.withoutDocs;const m=p(e=>`https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/${e}.md`),d=Symbol("PROPERTY_READ");function f(e){var t;const{details:n}=null!=(t=e.keySpan)?t:{};return n?e instanceof o.TmplAstBoundEvent?function({keySpan:{details:e},name:t}){return t===`${e}Change`}(e)?e.name:n:n.replace("attr.",""):e.name}function g({attributes:e,inputs:t},n){const r=[...e,...t].find(e=>f(e)===n);if("string"==typeof(null==r?void 0:r.value))return r.value;if(!((null==r?void 0:r.value)instanceof o.ASTWithSource))return null;if(r.value.ast instanceof o.LiteralArray)return r.value.ast.expressions;if(r.value.ast instanceof o.LiteralMap){const{keys:e,values:t}=r.value.ast;return e.reduce((e,n,r)=>e.set(n.key,t[r]),new Map)}return r.value.ast instanceof o.LiteralPrimitive?r.value.ast.value:d}var y=m({name:"accessibility-alt-text",meta:{type:"suggestion",docs:{description:"Enforces alternate text for elements which require the alt, aria-label, aria-labelledby attributes.",recommended:!1},schema:[],messages:{accessibilityAltText:"<{{element}}/> element must have a text alternative."}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{"Element$1[name=/^(img|area|object|input)$/]"(n){if(!function(e){return"img"===e.name?function(e){return e.attributes.some(({name:e})=>A(e))||e.inputs.some(({name:e})=>A(e))}(e):"object"===e.name?function(e){let t=!1,n=!1;for(const r of e.attributes)t="title"===r.name,n=T(r.name);if(t||n)return!0;let r=!1,a=!1;for(const t of e.inputs)r="title"===t.name,a=T(t.name);return!(!r&&!a)||e.children.length>0&&!!e.children[0].value}(e):"area"===e.name?S(e):function(e){return"image"!==g(e,"type")||S(e)}(e)}(n)){const r=t.convertElementSourceSpanToLoc(e,n);e.report({loc:r,messageId:"accessibilityAltText",data:{element:n.name}})}}}}});function S(e){let t=!1,n=!1;for(const r of e.attributes)t=A(r.name),n=T(r.name);if(t||n)return!0;let r=!1,a=!1;for(const t of e.inputs)r=A(t.name),a=T(t.name);return r||a}function T(e){return"aria-label"===e||"aria-labelledby"===e}function A(e){return"alt"===e}var b="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function E(e){var t={exports:{}};return e(t,t.exports),t.exports}var x=E(function(e,t){var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.AST_TOKEN_TYPES=t.AST_NODE_TYPES=void 0,(n=t.AST_NODE_TYPES||(t.AST_NODE_TYPES={})).ArrayExpression="ArrayExpression",n.ArrayPattern="ArrayPattern",n.ArrowFunctionExpression="ArrowFunctionExpression",n.AssignmentExpression="AssignmentExpression",n.AssignmentPattern="AssignmentPattern",n.AwaitExpression="AwaitExpression",n.BinaryExpression="BinaryExpression",n.BlockStatement="BlockStatement",n.BreakStatement="BreakStatement",n.CallExpression="CallExpression",n.CatchClause="CatchClause",n.ChainExpression="ChainExpression",n.ClassBody="ClassBody",n.ClassDeclaration="ClassDeclaration",n.ClassExpression="ClassExpression",n.ConditionalExpression="ConditionalExpression",n.ContinueStatement="ContinueStatement",n.DebuggerStatement="DebuggerStatement",n.Decorator="Decorator",n.DoWhileStatement="DoWhileStatement",n.EmptyStatement="EmptyStatement",n.ExportAllDeclaration="ExportAllDeclaration",n.ExportDefaultDeclaration="ExportDefaultDeclaration",n.ExportNamedDeclaration="ExportNamedDeclaration",n.ExportSpecifier="ExportSpecifier",n.ExpressionStatement="ExpressionStatement",n.ForInStatement="ForInStatement",n.ForOfStatement="ForOfStatement",n.ForStatement="ForStatement",n.FunctionDeclaration="FunctionDeclaration",n.FunctionExpression="FunctionExpression",n.Identifier="Identifier",n.IfStatement="IfStatement",n.ImportAttribute="ImportAttribute",n.ImportDeclaration="ImportDeclaration",n.ImportDefaultSpecifier="ImportDefaultSpecifier",n.ImportExpression="ImportExpression",n.ImportNamespaceSpecifier="ImportNamespaceSpecifier",n.ImportSpecifier="ImportSpecifier",n.JSXAttribute="JSXAttribute",n.JSXClosingElement="JSXClosingElement",n.JSXClosingFragment="JSXClosingFragment",n.JSXElement="JSXElement",n.JSXEmptyExpression="JSXEmptyExpression",n.JSXExpressionContainer="JSXExpressionContainer",n.JSXFragment="JSXFragment",n.JSXIdentifier="JSXIdentifier",n.JSXMemberExpression="JSXMemberExpression",n.JSXNamespacedName="JSXNamespacedName",n.JSXOpeningElement="JSXOpeningElement",n.JSXOpeningFragment="JSXOpeningFragment",n.JSXSpreadAttribute="JSXSpreadAttribute",n.JSXSpreadChild="JSXSpreadChild",n.JSXText="JSXText",n.LabeledStatement="LabeledStatement",n.Literal="Literal",n.LogicalExpression="LogicalExpression",n.MemberExpression="MemberExpression",n.MetaProperty="MetaProperty",n.MethodDefinition="MethodDefinition",n.NewExpression="NewExpression",n.ObjectExpression="ObjectExpression",n.ObjectPattern="ObjectPattern",n.PrivateIdentifier="PrivateIdentifier",n.Program="Program",n.Property="Property",n.PropertyDefinition="PropertyDefinition",n.RestElement="RestElement",n.ReturnStatement="ReturnStatement",n.SequenceExpression="SequenceExpression",n.SpreadElement="SpreadElement",n.StaticBlock="StaticBlock",n.Super="Super",n.SwitchCase="SwitchCase",n.SwitchStatement="SwitchStatement",n.TaggedTemplateExpression="TaggedTemplateExpression",n.TemplateElement="TemplateElement",n.TemplateLiteral="TemplateLiteral",n.ThisExpression="ThisExpression",n.ThrowStatement="ThrowStatement",n.TryStatement="TryStatement",n.UnaryExpression="UnaryExpression",n.UpdateExpression="UpdateExpression",n.VariableDeclaration="VariableDeclaration",n.VariableDeclarator="VariableDeclarator",n.WhileStatement="WhileStatement",n.WithStatement="WithStatement",n.YieldExpression="YieldExpression",n.TSAbstractKeyword="TSAbstractKeyword",n.TSAbstractMethodDefinition="TSAbstractMethodDefinition",n.TSAbstractPropertyDefinition="TSAbstractPropertyDefinition",n.TSAnyKeyword="TSAnyKeyword",n.TSArrayType="TSArrayType",n.TSAsExpression="TSAsExpression",n.TSAsyncKeyword="TSAsyncKeyword",n.TSBigIntKeyword="TSBigIntKeyword",n.TSBooleanKeyword="TSBooleanKeyword",n.TSCallSignatureDeclaration="TSCallSignatureDeclaration",n.TSClassImplements="TSClassImplements",n.TSConditionalType="TSConditionalType",n.TSConstructorType="TSConstructorType",n.TSConstructSignatureDeclaration="TSConstructSignatureDeclaration",n.TSDeclareFunction="TSDeclareFunction",n.TSDeclareKeyword="TSDeclareKeyword",n.TSEmptyBodyFunctionExpression="TSEmptyBodyFunctionExpression",n.TSEnumDeclaration="TSEnumDeclaration",n.TSEnumMember="TSEnumMember",n.TSExportAssignment="TSExportAssignment",n.TSExportKeyword="TSExportKeyword",n.TSExternalModuleReference="TSExternalModuleReference",n.TSFunctionType="TSFunctionType",n.TSInstantiationExpression="TSInstantiationExpression",n.TSImportEqualsDeclaration="TSImportEqualsDeclaration",n.TSImportType="TSImportType",n.TSIndexedAccessType="TSIndexedAccessType",n.TSIndexSignature="TSIndexSignature",n.TSInferType="TSInferType",n.TSInterfaceBody="TSInterfaceBody",n.TSInterfaceDeclaration="TSInterfaceDeclaration",n.TSInterfaceHeritage="TSInterfaceHeritage",n.TSIntersectionType="TSIntersectionType",n.TSIntrinsicKeyword="TSIntrinsicKeyword",n.TSLiteralType="TSLiteralType",n.TSMappedType="TSMappedType",n.TSMethodSignature="TSMethodSignature",n.TSModuleBlock="TSModuleBlock",n.TSModuleDeclaration="TSModuleDeclaration",n.TSNamedTupleMember="TSNamedTupleMember",n.TSNamespaceExportDeclaration="TSNamespaceExportDeclaration",n.TSNeverKeyword="TSNeverKeyword",n.TSNonNullExpression="TSNonNullExpression",n.TSNullKeyword="TSNullKeyword",n.TSNumberKeyword="TSNumberKeyword",n.TSObjectKeyword="TSObjectKeyword",n.TSOptionalType="TSOptionalType",n.TSParameterProperty="TSParameterProperty",n.TSPrivateKeyword="TSPrivateKeyword",n.TSPropertySignature="TSPropertySignature",n.TSProtectedKeyword="TSProtectedKeyword",n.TSPublicKeyword="TSPublicKeyword",n.TSQualifiedName="TSQualifiedName",n.TSReadonlyKeyword="TSReadonlyKeyword",n.TSRestType="TSRestType",n.TSSatisfiesExpression="TSSatisfiesExpression",n.TSStaticKeyword="TSStaticKeyword",n.TSStringKeyword="TSStringKeyword",n.TSSymbolKeyword="TSSymbolKeyword",n.TSTemplateLiteralType="TSTemplateLiteralType",n.TSThisType="TSThisType",n.TSTupleType="TSTupleType",n.TSTypeAliasDeclaration="TSTypeAliasDeclaration",n.TSTypeAnnotation="TSTypeAnnotation",n.TSTypeAssertion="TSTypeAssertion",n.TSTypeLiteral="TSTypeLiteral",n.TSTypeOperator="TSTypeOperator",n.TSTypeParameter="TSTypeParameter",n.TSTypeParameterDeclaration="TSTypeParameterDeclaration",n.TSTypeParameterInstantiation="TSTypeParameterInstantiation",n.TSTypePredicate="TSTypePredicate",n.TSTypeQuery="TSTypeQuery",n.TSTypeReference="TSTypeReference",n.TSUndefinedKeyword="TSUndefinedKeyword",n.TSUnionType="TSUnionType",n.TSUnknownKeyword="TSUnknownKeyword",n.TSVoidKeyword="TSVoidKeyword",(r=t.AST_TOKEN_TYPES||(t.AST_TOKEN_TYPES={})).Boolean="Boolean",r.Identifier="Identifier",r.JSXIdentifier="JSXIdentifier",r.JSXText="JSXText",r.Keyword="Keyword",r.Null="Null",r.Numeric="Numeric",r.Punctuator="Punctuator",r.RegularExpression="RegularExpression",r.String="String",r.Template="Template",r.Block="Block",r.Line="Line"});Object.defineProperty(exports,"__esModule",{value:!0});var h={__proto__:null};Object.defineProperty(exports,"__esModule",{value:!0});var v={__proto__:null},C=E(function(e,t){var n=b&&b.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=b&&b.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=b&&b.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TSESTree=void 0,t.TSESTree=a(x)}),F=E(function(e,t){var n=b&&b.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=b&&b.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AST_TOKEN_TYPES=t.AST_NODE_TYPES=void 0,Object.defineProperty(t,"AST_NODE_TYPES",{enumerable:!0,get:function(){return x.AST_NODE_TYPES}}),Object.defineProperty(t,"AST_TOKEN_TYPES",{enumerable:!0,get:function(){return x.AST_TOKEN_TYPES}}),r(h,t),r(v,t),r(C,t)});function D({parent:e},t){for(;e&&e.type!==F.AST_NODE_TYPES.Program;){if(t(e))return e;e=e.parent}return null}function B(e){if(D(e,w)||function(e){const t=g(e,"style");if("string"!=typeof t)return!1;const n=t.replace(/[\s'"]/g,"");return n.includes("display:none")||n.includes("visibility:hidden")}(e)||function(e){const t=g(e,"ngStyle");return t instanceof Map&&("none"===t.get("display")||"hidden"===t.get("visibility"))}(e)||function(e){return"none"===g(e,"style.display")||"true"===String(g(e,"style.display.none"))||"hidden"===g(e,"style.visibility")||"true"===String(g(e,"style.visibility.hidden"))}(e)||I(e,"aria-hidden")||I(e,"hidden"))return!0;if("INPUT"!==e.name.toUpperCase())return!1;const t=g(e,"type");return"string"==typeof t&&"HIDDEN"===t.toUpperCase()}function I(e,t){const n=g(e,t);return""===n||"true"===String(n)}function w(e){return e instanceof o.TmplAstElement&&B(e)}const N=["aria-label","innerHtml","innerHTML","innerText","outerHTML","title"];var P=m({name:"accessibility-elements-content",meta:{type:"suggestion",docs:{description:"Ensures that the heading, anchor and button elements have content in it",recommended:!1},schema:[{additionalProperties:!1,properties:{allowList:{items:{type:"string"},type:"array",uniqueItems:!0}},type:"object"}],messages:{accessibilityElementsContent:"<{{element}}> should have content"}},defaultOptions:[{allowList:N}],create(e,[{allowList:t}]){const n=r.getTemplateParserServices(e);return{"Element$1[name=/^(a|button|h1|h2|h3|h4|h5|h6)$/][children.length=0]"(r){if(B(r))return;const{attributes:a,inputs:o,name:s,sourceSpan:i}=r,u=new Set([...N,...null!=t?t:[]]);if([...a,...o].map(({name:e})=>e).some(e=>u.has(e)))return;const l=n.convertNodeSourceSpanToLoc(i);e.report({loc:l,messageId:"accessibilityElementsContent",data:{element:s}})}}}});let O=null;function L(){var e;return null!=(e=O)?e:O=new Set(s.dom.keys())}let k=null,R=null,$=null,_=null;function q(){if(null===_){const e=[...s.roles.keys()];_=new Set(e.filter(e=>{const t=s.roles.get(e);return t&&!t.abstract&&"toolbar"!==e&&!t.superClass.some(e=>e.includes("widget"))}).concat("progressbar"))}return _}function M(e){return L().has(e.name)&&function(e){function t({attributes:t,name:n}){return e.name===n&&function(e,t){const n=[...t.attributes,...t.inputs];return e.every(e=>n.some(({name:n})=>"a"===t.name&&"routerLink"===n||e.name===n&&(!e.value||e.value===g(t,e.name))))}(null!=t?t:[],e)}return!!function(){if(null===R){const e=[...s.roles.keys()],t=[...s.elementRoles.entries()],n=new Set(e.filter(e=>{const t=s.roles.get(e);return t&&!t.abstract&&"progressbar"!==e&&t.superClass.some(e=>e.includes("widget"))}).concat("toolbar"));R=t.reduce((e,[t,r])=>e.concat([...r].every(e=>n.has(e))?t:[]),[])}return R}().some(t)||!function(){if(null===$){const e=[...s.elementRoles.entries()];$=e.reduce((e,[t,n])=>e.concat([...n].every(e=>q().has(e))?t:[]),[])}return $}().some(t)&&function(){if(null===k){const{AXObjects:e,elementAXObjects:t}=require("axobject-query"),n=new Set(Array.from(e.keys()).filter(t=>"widget"===e.get(t).type));k=[...t.entries()].reduce((e,[t,r])=>e.concat([...r].every(e=>n.has(e))?t:[]),[])}return k}().some(t)}(e)}const j=new Set(["none","presentation"]);function K(e){const t=g(e,"role");return"string"==typeof t&&j.has(t)}const U="accessibility-interactive-supports-focus";var X=m({name:U,meta:{type:"suggestion",docs:{description:"Ensures that elements with interactive handlers like `(click)` are focusable.",recommended:!1},schema:[],messages:{interactiveSupportsFocus:"Elements with interaction handlers must be focusable."}},defaultOptions:[],create:e=>({Element$1(t){const n=t.name;if(!L().has(n))return;const a=t.outputs.find(e=>"click"===e.name||e.name.startsWith("keyup")||e.name.startsWith("keydown")||e.name.startsWith("keypress"));if(!a||function(e){const t=[...e.attributes,...e.inputs].find(e=>"disabled"===f(e)),n=g(e,"disabled");return!((!t||void 0===n)&&"true"!==String(g(e,"aria-disabled")).toLowerCase())}(t)||B(t)||K(t))return;const o=[...t.attributes,...t.inputs].find(e=>"tabindex"===e.name);if(a&&!o&&!M(t)&&!function(e){return function(e){return q().has(g(e,"role"))}(e)}(t)&&!function(e){const t=[...e.attributes,...e.inputs].find(e=>"contenteditable"===f(e)),n=g(e,"contenteditable");return!!t&&(""===n||"true"===String(n).toLowerCase())}(t)){const n=r.getTemplateParserServices(e).convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:n,messageId:"interactiveSupportsFocus"})}}})});function J(e,t){return function e({children:n}){return n.some(n=>n instanceof o.TmplAstElement&&(n.name===t||e(n)))}(e)}const W={items:{type:"string"},type:"array",uniqueItems:!0},V=["button","input","meter","output","progress","select","textarea"],Y=["for","htmlFor"],H=["label"];var G=m({name:"accessibility-label-for",meta:{deprecated:!0,replacedBy:["accessibility-label-has-associated-control"],type:"suggestion",docs:{description:"Ensures that a label element/component is associated with a form element",recommended:!1},schema:[{additionalProperties:!1,properties:{controlComponents:{...W},labelAttributes:{...W},labelComponents:{...W}},type:"object"}],messages:{accessibilityLabelFor:"A label element/component must be associated with a form element"}},defaultOptions:[{controlComponents:V,labelAttributes:Y,labelComponents:H}],create(e,[t]){const n=r.getTemplateParserServices(e),{controlComponents:a,labelAttributes:o,labelComponents:s}=function({controlComponents:e,labelAttributes:t,labelComponents:n}){return{controlComponents:new Set([...V,...null!=e?e:[]]),labelAttributes:new Set([...Y,...null!=t?t:[]]),labelComponents:new Set([...H,...null!=n?n:[]])}}(t);var i;return{[`Element$1[name=${i=[...s],RegExp(`^(${i.join("|")})$`)}]`](t){const r=new Set([...t.attributes,...t.inputs].map(({name:e})=>e));if([...o].some(e=>r.has(e))||function(e,t){return Boolean([...e].some(e=>J(t,e)))}(a,t))return;const s=n.convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:s,messageId:"accessibilityLabelFor"})}}}});const z="accessibility-label-has-associated-control",Q=["input","meter","output","progress","select","textarea"],Z=[{inputs:["for","htmlFor"],selector:"label"}];var ee=m({name:z,meta:{type:"suggestion",docs:{description:"Ensures that a label element/component is associated with a form element",recommended:!1},schema:[{additionalProperties:!1,properties:{controlComponents:{items:{type:"string"},type:"array",uniqueItems:!0},labelComponents:{items:{additionalProperties:!1,properties:{inputs:{items:{type:"string"},type:"array",uniqueItems:!0},selector:{type:"string"}},required:["selector"],type:"object"},type:"array",uniqueItems:!0}},type:"object"}],messages:{accessibilityLabelHasAssociatedControl:"A label component must be associated with a form element"}},defaultOptions:[{controlComponents:Q,labelComponents:Z}],create(e,[{controlComponents:t,labelComponents:n}]){const a=r.getTemplateParserServices(e),o=new Set([...Q,...null!=t?t:[]]),s=[...Z,...null!=n?n:[]],i=s.map(({selector:e})=>e);return{[`Element$1[name=${RegExp(`^(${i.join("|")})$`)}]`](t){var n;const r=s.find(({selector:e})=>e===t.name);if(!r)return;const i=new Set([...t.attributes,...t.inputs].map(({name:e})=>e));if((null==(n=r.inputs)?void 0:n.some(e=>i.has(e)))||function(e,t){return Boolean([...e].some(e=>J(t,e)))}(o,t))return;const u=a.convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:u,messageId:"accessibilityLabelHasAssociatedControl"})}}}});function te(e){return RegExp(`^(${e.join("|")})$`)}let ne=null,re=null;const ae="accessibility-role-has-required-aria";var oe=m({name:ae,meta:{type:"suggestion",docs:{description:"Ensures elements with ARIA roles have all required properties for that role.",recommended:!1},hasSuggestions:!0,schema:[],messages:{roleHasRequiredAria:'The {{element}} with role="{{role}}" does not have required ARIA properties: {{missingProps}}',suggestRemoveRole:"Remove role `{{role}}`"}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{[`Element$1[name=${te([...L()])}] > TextAttribute[name='role']`](n){const{value:r,sourceSpan:a}=n,{attributes:o,inputs:i,name:u}=n.parent,l=[...o,...i],c=s.roles.get(r),p=Object.keys((null==c?void 0:c.requiredProps)||{});if(!p.length)return;if(function(e,t,n){var r,a;if(null===ne||null===re){const{AXObjectRoles:e,elementAXObjects:t}=require("axobject-query");ne=t,re=e}return Array.from(null!=(r=null==(a=ne)?void 0:a.keys())?r:[]).some(r=>{var a,o,s;return r.name===e&&(null!=(a=r.attributes)?a:[]).every(e=>n.find(t=>e.name===t.name&&e.value===t.value))&&(null==(o=ne)||null==(s=o.get(r))?void 0:s.find(e=>{var n,r;return null==(n=re)||null==(r=n.get(e))?void 0:r.find(e=>e.name===t)}))})}(u,r,l))return;const m=p.filter(e=>!l.find(t=>t.name===e)).join(", ");if(m){const n=t.convertNodeSourceSpanToLoc(a);e.report({loc:n,messageId:"roleHasRequiredAria",data:{element:u,role:r,missingProps:m},suggest:[{messageId:"suggestRemoveRole",data:{element:u,role:r,missingProps:m},fix:e=>e.removeRange([(null==a?void 0:a.start.offset)-1,null==a?void 0:a.end.offset])}]})}}}}}),se=m({name:"accessibility-table-scope",meta:{type:"suggestion",docs:{description:"Ensures that the `scope` attribute is only used on the `<th>` element",recommended:!1},fixable:"code",schema:[],messages:{accessibilityTableScope:"The `scope` attribute should only be on the `<th>` element"}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{[`Element$1[name=${te([...L()].filter(e=>"th"!==e))}] > :matches(BoundAttribute, TextAttribute)[name='scope']`]({sourceSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"accessibilityTableScope",fix:e=>e.removeRange([n.start.offset-1,n.end.offset])})}}}}),ie=m({name:"accessibility-valid-aria",meta:{type:"suggestion",docs:{description:"Ensures that correct ARIA attributes and respective values are used",recommended:!1},hasSuggestions:!0,schema:[],messages:{accessibilityValidAria:"The `{{attribute}}` is an invalid ARIA attribute",accessibilityValidAriaValue:"The `{{attribute}}` has an invalid value. Check the valid values at https://raw.githack.com/w3c/aria/stable/#roles",suggestRemoveInvalidAria:"Remove attribute `{{attribute}}`"}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{[`Element$1[name=${te([...L()])}] > :matches(BoundAttribute, TextAttribute)[name=/^aria-.+/]`](n){const{name:r,sourceSpan:a}=n,i=s.aria.get(r),u=t.convertNodeSourceSpanToLoc(a);if(!i)return void e.report({loc:u,messageId:"accessibilityValidAria",data:{attribute:r},suggest:[{messageId:"suggestRemoveInvalidAria",data:{attribute:r},fix:e=>e.removeRange([a.start.offset-1,a.end.offset])}]});const l=function(e){return e instanceof o.TmplAstBoundAttribute&&e.value instanceof o.ASTWithSource?e.value.ast:e}(n);(function(e){return!function(e){return e instanceof o.LiteralArray||e instanceof o.LiteralMap}(e)&&!function(e){return e instanceof o.LiteralPrimitive||e instanceof o.TmplAstTextAttribute}(e)})(l)||function({allowundefined:e,type:t,values:n},r){if(e&&le(r))return!0;switch(t){case"boolean":return ue(r);case"tristate":return ue(r)||le(r);case"id":case"idlist":return!0;case"integer":return a=r,!Number.isNaN(a)&&parseInt(Number(a))==a&&!Number.isNaN(parseInt(a,10));case"number":return function(e){return!Number.isNaN(Number.parseFloat(e))&&Number.isFinite(Number(e))}(r);case"string":return function(e){return"string"==typeof e}(r);case"token":case"tokenlist":{const e=ue(r)?JSON.parse(r):r;return Boolean(null==n?void 0:n.includes(e))}}var a}(i,l.value)||e.report({loc:u,messageId:"accessibilityValidAriaValue",data:{attribute:r}})}}}});function ue(e){return"boolean"==typeof e||"false"===e||"true"===e}function le(e){return null==e}const ce={alphabetical:!1,order:["STRUCTURAL_DIRECTIVE","TEMPLATE_REFERENCE","ATTRIBUTE_BINDING","INPUT_BINDING","TWO_WAY_BINDING","OUTPUT_BINDING"]};var pe=m({name:"attributes-order",meta:{type:"layout",docs:{description:"Ensures that HTML attributes and Angular bindings are sorted based on an expected order",recommended:!1},fixable:"code",schema:[{type:"object",properties:{alphabetical:{type:"boolean",default:ce.alphabetical},order:{type:"array",items:{enum:ce.order},default:ce.order,minItems:ce.order.length,uniqueItems:!0}},additionalProperties:!1}],messages:{attributesOrder:"The element's attributes/bindings did not match the expected order: expected {{expected}} instead of {{actual}}"}},defaultOptions:[ce],create(e,[{alphabetical:t,order:n}]){const a=r.getTemplateParserServices(e);function o(e){const t=a.convertNodeSourceSpanToLoc(e.sourceSpan);switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return{start:{line:t.start.line,column:t.start.column-1},end:{line:t.end.line,column:t.end.column+1}};default:return t}}return{Element$1(r){const{attributes:a,inputs:s,outputs:i,references:u}=r,{extractedBananaBoxes:l,extractedInputs:c,extractedOutputs:p}=function(e,t){const n=e.filter(e=>!t.some(t=>Ee(e,t))).map(ge),{extractedBananaBoxes:r,extractedOutputs:a}=t.reduce(({extractedBananaBoxes:t,extractedOutputs:n},r)=>{const a=e.find(e=>Ee(e,r));return{extractedBananaBoxes:t.concat(a?Te(a):[]),extractedOutputs:n.concat(a?[]:Se(r))}},{extractedBananaBoxes:[],extractedOutputs:[]});return{extractedBananaBoxes:r,extractedInputs:n,extractedOutputs:a}}(s.map(ge),i.map(Se)),m=[...be(r),...a.map(fe),...u.map(Ae),...l,...c,...p];if(m.length<2)return;const d=[...m].sort(me),f=[...m].sort(function(e,t){return function(n,r){const a=de(n,e)-de(r,e);return t&&0===a?n.name>r.name?1:-1:a}}(n,t));let g;for(let e=0;e<d.length;e++){var y,S;d[e]!==f[e]&&(g=[null!=(y=null==(S=g)?void 0:S[0])?y:e,e])}if(g){const[t,n]=g,r=e.getSourceCode(),{start:a}=o(d[t]),{end:s}=o(d[n]),i={start:a,end:s},u=[he(d[t]),ve(d[n])];let l="",c=u[0];for(let e=t;e<=n;e++){const t=d[e],n=he(t),a=ve(t),o=f[e],s=he(o),i=ve(o);l+=r.text.slice(c,n),l+=r.text.slice(s,i),c=a}e.report({loc:i,messageId:"attributesOrder",data:{expected:f.slice(t,n+1).map(e=>`\`${xe(e)}\``).join(", "),actual:d.slice(t,n+1).map(e=>`\`${xe(e)}\``).join(", ")},fix:e=>e.replaceTextRange(u,l)})}}}}});function me(e,t){return e.sourceSpan.start.line===t.sourceSpan.start.line?e.sourceSpan.start.col-t.sourceSpan.start.col:e.sourceSpan.start.line-t.sourceSpan.start.line}function de(e,t){return t.indexOf(e.orderType)}function fe(e){return{...e,orderType:"ATTRIBUTE_BINDING"}}function ge(e){return{...e,orderType:"INPUT_BINDING"}}function ye(e){return{...e,orderType:"STRUCTURAL_DIRECTIVE"}}function Se(e){return{...e,orderType:"OUTPUT_BINDING"}}function Te(e){return{...e,orderType:"TWO_WAY_BINDING"}}function Ae(e){return{...e,orderType:"TEMPLATE_REFERENCE"}}function be(e){return function(e){return e instanceof o.TmplAstTemplate}(e.parent)?e.parent.templateAttrs.map(ye):[]}function Ee(e,t){return e.sourceSpan.start===t.sourceSpan.start&&e.sourceSpan.end===t.sourceSpan.end}function xe(e){switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return`*${e.name}`;case"TEMPLATE_REFERENCE":return`#${e.name}`;case"INPUT_BINDING":return`[${e.name}]`;case"OUTPUT_BINDING":return`(${e.name})`;case"TWO_WAY_BINDING":return`[(${e.name})]`;default:return e.name}}function he(e){switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return e.sourceSpan.start.offset-1;default:return e.sourceSpan.start.offset}}function ve(e){switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return e.sourceSpan.end.offset+1;default:return e.sourceSpan.end.offset}}const Ce=/\[(.*)\]/;var Fe=m({name:"banana-in-box",meta:{type:"suggestion",docs:{description:"Ensures that the two-way data binding syntax is correct",recommended:"error"},fixable:"code",schema:[],messages:{bananaInBox:"Invalid binding syntax. Use [(expr)] instead"}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e),n=e.getSourceCode();return{BoundEvent({name:r,sourceSpan:a}){const o=r.match(Ce);if(!o)return;const s=t.convertNodeSourceSpanToLoc(a);e.report({messageId:"bananaInBox",loc:s,fix:e=>{const[,t]=o,a=`[(${t})]`,i=n.getIndexFromLoc(s.start);return e.replaceTextRange([i,i+r.length+2],a)}})}}}});const De=["button","submit","reset"];var Be=m({name:"button-has-type",meta:{type:"suggestion",docs:{description:"Ensures that a button has a valid type specified",recommended:!1},schema:[],messages:{missingType:"Type for <button> is missing",invalidType:'"{{type}}" can not be used as a type for <button>'}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{"Element$1[name=button]"(n){(function({inputs:e,attributes:t}){return[...e,...t].some(({name:e})=>"type"===e)})(n)||e.report({loc:t.convertNodeSourceSpanToLoc(n.sourceSpan),messageId:"missingType"});const r=function(e){const t=e.attributes.find(({name:e,value:t})=>"type"===e&&!De.includes(t));if(t)return{sourceSpan:t.sourceSpan,value:t.value};for(const{name:t,value:n,sourceSpan:r}of e.inputs)if("type"===t&&n instanceof o.ASTWithSource&&n.ast instanceof o.LiteralPrimitive&&!De.includes(n.ast.value))return{value:n.ast.value,sourceSpan:r};return null}(n);null!=r&&e.report({loc:t.convertNodeSourceSpanToLoc(r.sourceSpan),messageId:"invalidType",data:{type:r.value}})}}}}),Ie=m({name:"click-events-have-key-events",meta:{type:"suggestion",docs:{description:"Ensures that the click event is accompanied with at least one key event keyup, keydown or keypress.",recommended:!1},schema:[],messages:{clickEventsHaveKeyEvents:"click must be accompanied by either keyup, keydown or keypress event for accessibility."}},defaultOptions:[],create:e=>({Element$1(t){if(!L().has(t.name))return;if(K(t)||B(t)||M(t))return;let n=!1,a=!1;for(const e of t.outputs)n=n||"click"===e.name,a=a||e.name.startsWith("keyup")||e.name.startsWith("keydown")||e.name.startsWith("keypress");if(!n||a)return;const o=r.getTemplateParserServices(e).convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:o,messageId:"clickEventsHaveKeyEvents"})}})}),we=m({name:"conditional-complexity",meta:{type:"suggestion",docs:{description:"The conditional complexity should not exceed a rational limit",recommended:!1},schema:[{type:"object",properties:{maxComplexity:{minimum:1,type:"number"}},additionalProperties:!1}],messages:{conditionalComplexity:"The conditional complexity {{totalComplexity}} exceeds the defined limit {{maxComplexity}}"}},defaultOptions:[{maxComplexity:5}],create(e,[{maxComplexity:t}]){r.ensureTemplateParser(e);const n=e.getSourceCode();return{BoundAttribute(r){if(!r.value.source||r.value.ast instanceof o.Interpolation)return;const a=Oe(Ne((Pe||(Pe=new o.Parser(new o.Lexer))).parseBinding(r.value.source,"",0).ast));if(a<=t)return;const{sourceSpan:{start:s,end:i}}=r.value;e.report({loc:{start:n.getLocFromIndex(s),end:n.getLocFromIndex(i)},messageId:"conditionalComplexity",data:{maxComplexity:t,totalComplexity:a}})},Interpolation({expressions:r}){for(const a of r){const r=Oe(a);if(r<=t)continue;const{sourceSpan:{start:o,end:s}}=a;e.report({loc:{start:n.getLocFromIndex(o),end:n.getLocFromIndex(s)},messageId:"conditionalComplexity",data:{maxComplexity:t,totalComplexity:r}})}}}}});function Ne(e){return e instanceof o.BindingPipe?e.exp:e}let Pe=null;function Oe(e){const t=Ne(e);if(!(t instanceof o.Binary||t instanceof o.Conditional))return 0;let n=1;return t instanceof o.Binary&&(t.left instanceof o.Binary&&(n+=Oe(t.left)),t.right instanceof o.Binary&&(n+=Oe(t.right))),t instanceof o.Conditional&&(n+=Oe(t.condition)+Oe(t.trueExp)+Oe(t.falseExp)),n}var Le=m({name:"cyclomatic-complexity",meta:{type:"suggestion",docs:{description:"Checks cyclomatic complexity against a specified limit. It is a quantitative measure of the number of linearly independent paths through a program's source code",recommended:!1},schema:[{type:"object",properties:{maxComplexity:{type:"number",minimum:1}},additionalProperties:!1}],messages:{cyclomaticComplexity:"The cyclomatic complexity {{totalComplexity}} exceeds the defined limit {{maxComplexity}}"}},defaultOptions:[{maxComplexity:5}],create(e,[{maxComplexity:t}]){let n=0;const a=r.getTemplateParserServices(e);return{'BoundAttribute[name=/^(ngForOf|ngIf|ngSwitchCase)$/], TextAttribute[name="ngSwitchDefault"]'({sourceSpan:r}){if(n+=1,n<=t)return;const o=a.convertNodeSourceSpanToLoc(r);e.report({messageId:"cyclomaticComplexity",loc:o,data:{maxComplexity:t,totalComplexity:n}})}}}});const ke={allowNullOrUndefined:!1};var Re=m({name:"eqeqeq",meta:{type:"suggestion",docs:{description:"Requires `===` and `!==` in place of `==` and `!=`",recommended:"error"},hasSuggestions:!0,fixable:"code",schema:[{type:"object",properties:{allowNullOrUndefined:{type:"boolean",default:ke.allowNullOrUndefined}},additionalProperties:!1}],messages:{eqeqeq:"Expected `{{expectedOperation}}` but received `{{actualOperation}}`",suggestStrictEquality:"Replace `{{actualOperation}}` with `{{expectedOperation}}`"}},defaultOptions:[ke],create(e,[{allowNullOrUndefined:t}]){r.ensureTemplateParser(e);const n=e.getSourceCode();return{"Binary[operation=/^(==|!=)$/]"(r){const{left:a,operation:o,right:s,sourceSpan:{start:i,end:u}}=r;if(t&&(Ke(a)||Ke(s)))return;const l={actualOperation:o,expectedOperation:`${o}=`};e.report({loc:{start:n.getLocFromIndex(i),end:n.getLocFromIndex(u)},messageId:"eqeqeq",data:l,...je(a)||je(s)?{fix:e=>_e({node:r,left:a,right:s,start:i,end:u,fixer:e})}:{suggest:[{messageId:"suggestStrictEquality",fix:e=>_e({node:r,left:a,right:s,start:i,end:u,fixer:e}),data:l}]}})}}}});function $e({span:{start:e,end:t}}){return t-e}const _e=({node:e,left:t,right:n,start:r,end:a,fixer:o})=>{var s;const{source:i}=null!=(s=D(e,qe))?s:{};return i?o.insertTextAfterRange([r+$e(t)+1,a-$e(n)-1],"="):null};function qe(e){return e instanceof o.ASTWithSource}function Me(e){return e instanceof o.LiteralPrimitive}function je(e){return Me(e)&&"string"==typeof e.value&&(t=e.value,!(!Number.isNaN(Number.parseFloat(String(t)))&&Number.isFinite(Number(t))));var t}function Ke(e){return Me(e)&&null==e.value}const Ue=/[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,Xe=new RegExp(`[^${Ue}]`),Je=new Set(["autocomplete","charset","class","color","colspan","dir","fill","for","formArrayName","formControlName","formGroupName","height","href","id","lang","list","name","ngClass","ngProjectAs","role","routerLink","routerLinkActive","src","stroke","stroke-width","style","svgIcon","tabindex","target","type","value","viewBox","width","xmlns"]),We={checkAttributes:!0,checkId:!0,checkDuplicateId:!0,checkText:!0,ignoreAttributes:[...Je]},Ve="https://angular.io/guide/i18n",Ye=`${Ve}#mark-element-attributes-for-translations`,He=`${Ve}#mark-plurals-and-alternates-for-translation`,Ge=`${Ve}#mark-text-for-translations`,ze=`${Ve}#manage-marked-text-with-custom-ids`,Qe=`${Ve}#define-unique-custom-ids`,Ze=`${Ve}-common-prepare#i18n-metadata-for-translation`;var et=m({name:"i18n",meta:{type:"suggestion",docs:{description:"Ensures following best practices for i18n. Checks for missing i18n attributes on elements and attributes containing texts. Can also check for texts without i18n attribute, elements that do not use custom ID (@@) feature and duplicate custom IDs",recommended:!1},fixable:"code",hasSuggestions:!0,schema:[{type:"object",properties:{boundTextAllowedPattern:{type:"string"},checkAttributes:{type:"boolean",default:We.checkAttributes},checkDuplicateId:{type:"boolean",default:We.checkDuplicateId},checkId:{type:"boolean",default:We.checkId},checkText:{type:"boolean",default:We.checkText},ignoreAttributes:{type:"array",items:{type:"string"},default:[...Je]},ignoreTags:{type:"array",items:{type:"string"}},requireDescription:{type:"boolean",default:We.requireDescription},requireMeaning:{type:"boolean",default:We.requireMeaning}},additionalProperties:!1}],messages:{i18nAttribute:`Attribute "{{attributeName}}" has no corresponding i18n attribute. See more at ${Ye}`,i18nAttributeOnIcuOrText:`Each element containing text node should have an i18n attribute. See more at ${He} and ${Ge}`,i18nCustomIdOnAttribute:`Missing custom ID on attribute "i18n-{{attributeName}}". See more at ${ze}`,i18nCustomIdOnElement:`Missing custom ID on element. See more at ${ze}`,i18nDuplicateCustomId:`Duplicate custom ID "@@{{customId}}". See more at ${Qe}`,suggestAddI18nAttribute:"Add the `i18n` attribute",i18nMissingDescription:`Missing i18n description on element. See more at ${Ze}`,i18nMissingMeaning:`Missing i18n meaning on element. See more at ${Ze}`}},defaultOptions:[We],create(e,[{boundTextAllowedPattern:t,checkAttributes:n,checkId:a,checkDuplicateId:s,checkText:i,ignoreAttributes:u,ignoreTags:l,requireDescription:c,requireMeaning:p}]){const m=r.getTemplateParserServices(e),d=e.getSourceCode(),f=t?new RegExp(t):Xe,g=new Set([...Je,...null!=u?u:[]]),y=new Set(l),S=new Map;return{...(a||c||p)&&{"Element$1[i18n]"(t){!function({i18n:{description:t,meaning:n,customId:r},name:o,parent:s,sourceSpan:i}){if(y.has(o)||nt(s))return;const u=m.convertNodeSourceSpanToLoc(i);if(a)if(rt(r))e.report({messageId:"i18nCustomIdOnElement",loc:u});else{var l;const e=null!=(l=S.get(r))?l:[];S.set(r,[...e,i])}c&&rt(t)&&e.report({messageId:"i18nMissingDescription",loc:u}),p&&rt(n)&&e.report({messageId:"i18nMissingMeaning",loc:u})}(t)}},...(n||a||c||p)&&{[`Element$1 > TextAttribute[value=${Ue}]`](t){!function({i18n:t,keySpan:r,name:o,parent:{name:s},sourceSpan:i,value:u}){if(y.has(s))return;const l=m.convertNodeSourceSpanToLoc(null!=r?r:i);if(t){const{customId:n,description:r}=t;if(a)if(rt(n))e.report({messageId:"i18nCustomIdOnAttribute",loc:l,data:{attributeName:o}});else{var p;const e=null!=(p=S.get(n))?p:[];S.set(n,[...e,i])}c&&rt(r)&&e.report({messageId:"i18nMissingDescription",loc:l,data:{attributeName:o}})}t||!n||function(e,t,n,r){return e.has(n)||e.has(`${t}[${n}]`)||rt(r)||function(e){return"false"===e||"true"===e}(r)||function(e){const t=Number.parseFloat(e);return!Number.isNaN(t)&&Number.isFinite(t)}(r)}(g,s,o,u)||e.report({messageId:"i18nAttribute",loc:l,data:{attributeName:o},fix:e=>{const{end:t}=m.convertNodeSourceSpanToLoc(i),n=d.getIndexFromLoc(t);return e.insertTextAfterRange([n,n],` i18n-${o}`)}})}(t)}},...i&&{[`BoundText, Icu$1, Text$3[value=${Ue}]`](t){!function(t){var n;const{parent:r,sourceSpan:a}=t;if(t instanceof o.TmplAstBoundText&&function(e,{value:{ast:{strings:t}}}){const n=t.join("").trim();return!Ue.test(n)||e.test(n)}(f,t)||tt(r)&&(r.i18n||y.has(r.name)))return;const s=m.convertNodeSourceSpanToLoc(a),i=e=>function(e,t,n,r,a){return tt(a)?D(a,nt)?[]:function(e,t,{start:n},r){const a=e.getIndexFromLoc(n)+r.length+1;return t.insertTextAfterRange([a,a]," i18n")}(e,n,t.convertNodeSourceSpanToLoc(a.sourceSpan),a.name):function(e,t,{start:n,end:r}){const a=e.getIndexFromLoc(n),o=e.getIndexFromLoc(r);return[t.insertTextBeforeRange([a,a],"<ng-container i18n>"),t.insertTextAfterRange([o,o],"</ng-container>")]}(e,n,r)}(d,m,e,s,r);e.report({messageId:"i18nAttributeOnIcuOrText",loc:s,...null!=r&&null!=(n=r.children)&&n.filter(tt).length?{suggest:[{messageId:"suggestAddI18nAttribute",fix:i}]}:{fix:i}})}(t)}},"Program:exit"(){!function(){if(s)for(const[t,n]of S){if(n.length<=1)break;for(const r of n){const n=m.convertNodeSourceSpanToLoc(r);e.report({messageId:"i18nDuplicateCustomId",loc:n,data:{customId:t}})}}S.clear()}()}}}});function tt(e){return e instanceof o.TmplAstElement}function nt(e){return Boolean(tt(e)&&e.i18n)}function rt(e){return!e||0===e.trim().length}const at="https://www.w3.org/WAI/WCAG21/Understanding/keyboard";var ot=m({name:"mouse-events-have-key-events",meta:{type:"suggestion",docs:{description:`Ensures that the mouse events \`mouseout\` and \`mouseover\` are accompanied by \`focus\` and \`blur\` events respectively. Coding for the keyboard is important for users with physical disabilities who cannot use a mouse, AT compatibility, and screenreader users. See more at ${at}`,recommended:!1},schema:[],messages:{mouseEventsHaveKeyEvents:`\`{{mouseEvent}}\` must be accompanied by \`{{keyEvent}}\` for accessibility (${at})`}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e),n=te([...L()]);return[["blur","mouseout"],["focus","mouseover"]].reduce((r,[a,o])=>({...r,[`Element$1[name=${n}]:has(BoundEvent[name='${o}']):not(:has(BoundEvent[name='${a}']))`]({sourceSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"mouseEventsHaveKeyEvents",data:{keyEvent:a,mouseEvent:o}})}}),{})}}),st=m({name:"no-any",meta:{type:"suggestion",docs:{description:'The use of "$any" nullifies the compile-time benefits of Angular\'s type system',recommended:!1},hasSuggestions:!0,schema:[],messages:{noAny:'Avoid using "$any" in templates',suggestRemoveAny:"Remove $any"}},defaultOptions:[],create(e){r.ensureTemplateParser(e);const t=e.getSourceCode();return{'Call[receiver.name="$any"]'({receiver:n,sourceSpan:{end:r,start:a}}){if(!(n instanceof o.PropertyRead))return;if(!(n.receiver instanceof o.ThisReceiver||n.receiver instanceof o.ImplicitReceiver))return;const s=n.nameSpan;e.report({messageId:"noAny",loc:{start:t.getLocFromIndex(a),end:t.getLocFromIndex(r)},suggest:[{messageId:"suggestRemoveAny",fix:e=>[e.removeRange([s.start,s.end+1]),e.removeRange([r-1,r])]}]})}}}}),it=m({name:"no-autofocus",meta:{type:"suggestion",docs:{description:"Ensures that the `autofocus` attribute is not used",recommended:!1},fixable:"code",schema:[],messages:{noAutofocus:"The `autofocus` attribute should not be used, as it reduces usability and accessibility for users"}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{[`Element$1[name=${te([...L()])}] > :matches(BoundAttribute, TextAttribute)[name="autofocus"]`]({sourceSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"noAutofocus",fix:e=>e.removeRange([n.start.offset-1,n.end.offset])})}}}}),ut=m({name:"no-call-expression",meta:{type:"suggestion",docs:{description:"Disallows calling expressions in templates, except for output handlers",recommended:!1},schema:[{additionalProperties:!1,properties:{allowList:{items:{type:"string"},type:"array",uniqueItems:!0}},type:"object"}],messages:{noCallExpression:"Avoid calling expressions in templates"}},defaultOptions:[{allowList:[]}],create(e,[{allowList:t}]){r.ensureTemplateParser(e);const n=e.getSourceCode();return{'Call[receiver.name!="$any"]'(r){if(Boolean(D(r,lt)))return;if(function(e,t){return t&&t.length>0&&function(e){return!!e.name}(e)&&t.indexOf(e.name)>-1}(r.receiver,t))return;const{sourceSpan:{start:a,end:o}}=r;e.report({loc:{start:n.getLocFromIndex(a),end:n.getLocFromIndex(o)},messageId:"noCallExpression"})}}}});function lt(e){return e instanceof o.TmplAstBoundEvent}var ct=m({name:"no-distracting-elements",meta:{type:"suggestion",docs:{description:"Enforces that no distracting elements are used",recommended:!1},fixable:"code",schema:[],messages:{noDistractingElements:"Do not use <{{element}}> elements as they can create visual accessibility issues and are deprecated"}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{"Element$1[name=/^(blink|marquee)$/]"({name:n,sourceSpan:r}){const a=t.convertNodeSourceSpanToLoc(r);e.report({loc:a,messageId:"noDistractingElements",data:{element:n},fix:e=>e.removeRange([r.start.offset,r.end.offset])})}}}});const pt={allowTwoWayDataBinding:!0,ignore:[]};var mt=m({name:"no-duplicate-attributes",meta:{type:"problem",docs:{description:"Ensures that there are no duplicate input properties or output event listeners",recommended:!1},hasSuggestions:!0,schema:[{type:"object",properties:{allowTwoWayDataBinding:{type:"boolean",default:pt.allowTwoWayDataBinding,description:"Whether or not two-way data binding is allowed as an exception to the rule."},ignore:{type:"array",items:{type:"string"},uniqueItems:!0,default:pt.ignore,description:"Input or output properties for which duplicate presence is allowed as an exception to the rule."}},additionalProperties:!1}],messages:{noDuplicateAttributes:"Duplicate attribute `{{attributeName}}`",suggestRemoveAttribute:"Remove attribute `{{attributeName}}`"}},defaultOptions:[pt],create(e,[{allowTwoWayDataBinding:t,ignore:n}]){const a=r.getTemplateParserServices(e);return{Element$1({inputs:r,outputs:o,attributes:s}){const i=[...dt([...r,...s]),...dt(t?o.filter(e=>!r.some(t=>t.sourceSpan.start===e.sourceSpan.start&&t.sourceSpan.end===e.sourceSpan.end)):o)];(n&&n.length>0?i.filter(e=>!n.includes(f(e))):i).forEach(t=>{const n=a.convertNodeSourceSpanToLoc(t.sourceSpan),r={attributeName:f(t)};e.report({loc:n,messageId:"noDuplicateAttributes",data:r,suggest:[{messageId:"suggestRemoveAttribute",fix:e=>e.removeRange([n.start.column,n.end.column+1]),data:r}]})})}}}});function dt(e){return e.filter(t=>e.some(e=>e!==t&&f(e)===f(t)))}const ft={allowNgStyle:!1,allowBindToStyle:!1};var gt=m({name:"no-inline-styles",meta:{type:"suggestion",docs:{description:"Disallows the use of inline styles in HTML templates",recommended:!1},schema:[{type:"object",properties:{allowNgStyle:{type:"boolean",default:ft.allowNgStyle},allowBindToStyle:{type:"boolean",default:ft.allowBindToStyle}},additionalProperties:!1}],messages:{noInlineStyles:"<{{element}}/> element should not have inline styles via style attribute. Please use classes instead."}},defaultOptions:[ft],create(e,[{allowNgStyle:t,allowBindToStyle:n}]){const a=r.getTemplateParserServices(e);return{Element$1(r){let o=!1;if(t||n){const e=!t&&St(r),a=!n&&Tt(r);o=yt(r)||e||a}else o=yt(r)||St(r)||Tt(r);if(o){const t=a.convertElementSourceSpanToLoc(e,r);e.report({loc:t,messageId:"noInlineStyles",data:{element:r.name}})}}}}});function yt(e){return e.attributes.some(({name:e})=>At(e))||e.inputs.some(({name:e})=>At(e))}function St(e){return e.inputs.some(({name:e})=>function(e){return"ngStyle"===e}(e))}function Tt(e){return e.inputs.some(({keySpan:e})=>function(e){return!(null==e||!e.details)&&e.details.includes("style.")}(e))}function At(e){return"style"===e}var bt=m({name:"no-negated-async",meta:{type:"suggestion",docs:{description:"Ensures that async pipe results are not negated",recommended:"error"},hasSuggestions:!0,schema:[],messages:{noNegatedAsync:"Async pipe results should not be negated. Use `(observable | async) === false`, `(observable | async) === null`, or `(observable | async) === undefined` to check its value instead",suggestFalseComparison:"Compare with `false`",suggestNullComparison:"Compare with `null`",suggestUndefinedComparison:"Compare with `undefined`"}},defaultOptions:[],create(e){r.ensureTemplateParser(e);const t=e.getSourceCode();return{':not(PrefixNot) > PrefixNot > BindingPipe[name="async"]'({parent:{sourceSpan:{end:n,start:r}}}){e.report({messageId:"noNegatedAsync",loc:{start:t.getLocFromIndex(r),end:t.getLocFromIndex(n)},suggest:[{messageId:"suggestFalseComparison",textToInsert:" === false"},{messageId:"suggestNullComparison",textToInsert:" === null"},{messageId:"suggestUndefinedComparison",textToInsert:" === undefined"}].map(({messageId:e,textToInsert:t})=>({messageId:e,fix:e=>[e.removeRange([r,r+1]),e.insertTextAfterRange([n,n],t)]}))})}}}}),Et=m({name:"no-positive-tabindex",meta:{type:"suggestion",docs:{description:"Ensures that the `tabindex` attribute is not positive",recommended:!1},hasSuggestions:!0,schema:[],messages:{noPositiveTabindex:"The `tabindex` attribute should not be positive",suggestNonNegativeTabindex:'Use `tabindex="{{tabindex}}"`'}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{[`Element$1[name=${te([...L()])}] > BoundAttribute[name="tabindex"][value.ast.value>0], TextAttribute[name="tabindex"][value>0]`]({valueSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"noPositiveTabindex",suggest:["-1","0"].map(e=>({messageId:"suggestNonNegativeTabindex",fix:t=>t.replaceTextRange([n.start.offset,n.end.offset],e),data:{tabindex:e}}))})}}}}),xt=m({name:"use-track-by-function",meta:{type:"suggestion",docs:{description:"Ensures trackBy function is used",recommended:!1},schema:[],messages:{useTrackByFunction:"Missing trackBy function in ngFor directive"}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{'BoundAttribute.inputs[name="ngForOf"]'({parent:{inputs:n},sourceSpan:r}){if(n.some(ht))return;const a=t.convertNodeSourceSpanToLoc(r);e.report({messageId:"useTrackByFunction",loc:a})},'BoundAttribute.templateAttrs[name="ngForOf"]'({parent:{templateAttrs:n}}){if(n.some(ht))return;const{start:r}=t.convertNodeSourceSpanToLoc(n[0].sourceSpan),{end:a}=t.convertNodeSourceSpanToLoc(n[n.length-1].sourceSpan),o={start:{...r,column:r.column-1},end:{...a,column:a.column+1}};e.report({messageId:"useTrackByFunction",loc:o})}}}});function ht(e){return e instanceof o.TmplAstBoundAttribute&&"ngForTrackBy"===e.name}module.exports={configs:{all:{extends:"./configs/base.json",rules:{"@angular-eslint/template/accessibility-alt-text":"error","@angular-eslint/template/accessibility-elements-content":"error","@angular-eslint/template/accessibility-interactive-supports-focus":"error","@angular-eslint/template/accessibility-label-for":"error","@angular-eslint/template/accessibility-label-has-associated-control":"error","@angular-eslint/template/accessibility-role-has-required-aria":"error","@angular-eslint/template/accessibility-table-scope":"error","@angular-eslint/template/accessibility-valid-aria":"error","@angular-eslint/template/attributes-order":"error","@angular-eslint/template/banana-in-box":"error","@angular-eslint/template/button-has-type":"error","@angular-eslint/template/click-events-have-key-events":"error","@angular-eslint/template/conditional-complexity":"error","@angular-eslint/template/cyclomatic-complexity":"error","@angular-eslint/template/eqeqeq":"error","@angular-eslint/template/i18n":"error","@angular-eslint/template/mouse-events-have-key-events":"error","@angular-eslint/template/no-any":"error","@angular-eslint/template/no-autofocus":"error","@angular-eslint/template/no-call-expression":"error","@angular-eslint/template/no-distracting-elements":"error","@angular-eslint/template/no-duplicate-attributes":"error","@angular-eslint/template/no-inline-styles":"error","@angular-eslint/template/no-negated-async":"error","@angular-eslint/template/no-positive-tabindex":"error","@angular-eslint/template/use-track-by-function":"error"}},base:{parser:"@angular-eslint/template-parser",plugins:["@angular-eslint/template"]},recommended:{extends:"./configs/base.json",rules:{"@angular-eslint/template/banana-in-box":"error","@angular-eslint/template/eqeqeq":"error","@angular-eslint/template/no-negated-async":"error"}},"process-inline-templates":{parser:"@typescript-eslint/parser",parserOptions:{ecmaVersion:2020,sourceType:"module"},plugins:["@angular-eslint/template"],processor:"@angular-eslint/template/extract-inline-html"}},processors:c,rules:{"accessibility-alt-text":y,"accessibility-elements-content":P,[U]:X,"accessibility-label-for":G,[z]:ee,[ae]:oe,"accessibility-table-scope":se,"accessibility-valid-aria":ie,"attributes-order":pe,"banana-in-box":Fe,"button-has-type":Be,"conditional-complexity":we,"click-events-have-key-events":Ie,"cyclomatic-complexity":Le,eqeqeq:Re,i18n:et,"mouse-events-have-key-events":ot,"no-any":st,"no-autofocus":it,"no-call-expression":ut,"no-distracting-elements":ct,"no-duplicate-attributes":mt,"no-inline-styles":gt,"no-negated-async":bt,"no-positive-tabindex":Et,"use-track-by-function":xt}};
1
+ var e=require("path"),t=require("@typescript-eslint/type-utils"),n=require("typescript"),r=require("@angular-eslint/utils"),a=require("@typescript-eslint/utils"),o=require("@angular-eslint/bundled-angular-compiler"),s=require("aria-query");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=/*#__PURE__*/i(n);const c=new Map;var l={"extract-inline-html":{preprocess:function(n,r){const a=[n];if(!function(e,t){return!![".component.ts",".page.ts",".dialog.ts",".modal.ts",".popover.ts",".bottomsheet.ts",".snackbar.ts"].some(e=>t.endsWith(e))||!(!e.includes("Component")||!e.includes("@angular/core"))}(n,r))return a;try{const o=u.default.createSourceFile(r,n,u.default.ScriptTarget.Latest,!0),s=o.statements.filter(e=>u.default.isClassDeclaration(e));if(!s||!s.length)return a;const i=[];for(const e of s){const n=t.getDecorators(e);if(n)for(const e of n)u.default.isCallExpression(e.expression)&&u.default.isIdentifier(e.expression.expression)&&"Component"===e.expression.expression.text&&i.push(e)}if(!i||!i.length)return a;const l=[n];let p=0;for(const t of i){if(!u.default.isDecorator(t)||!u.default.isCallExpression(t.expression)||1!==t.expression.arguments.length)continue;const n=t.expression.arguments[0];if(!u.default.isObjectLiteralExpression(n))continue;const a=n.properties.find(e=>e&&e.name&&"template"===e.name.getText());if(n.properties.find(e=>e&&e.name&&"templateUrl"===e.name.getText())||!a)continue;if(!u.default.isPropertyAssignment(a))continue;let s;const i=a.initializer;if(u.default.isNoSubstitutionTemplateLiteral(i)&&(s=i.rawText),u.default.isTemplateExpression(i)&&(s=i.getText()),u.default.isStringLiteral(i)&&(s=i.text),!s)continue;const m=`inline-template-${e.basename(r)}-${++p}.component.html`,d=a.initializer.getStart(),f=a.initializer.getEnd();c.set(m,{range:[d,f],lineAndCharacter:{start:o.getLineAndCharacterOfPosition(d),end:o.getLineAndCharacterOfPosition(f)}}),l.push({text:s,filename:m})}return l}catch(e){return console.log(e),console.error("preprocess: ERROR could not parse @Component() metadata",r),a}},postprocess:function(t,n){const r=t[0];if(1===t.length)return r;const a=t.slice(1);return[...r,...a.flatMap((t,r)=>{const a=`inline-template-${e.basename(n)}-${++r}.component.html`,o=c.get(a);return o?t.map(e=>{if(e.line=e.line+o.lineAndCharacter.start.line,e.endLine=e.endLine+o.lineAndCharacter.start.line,e.fix){const t=o.range[0];e.fix.range=[t+e.fix.range[0],t+e.fix.range[1]]}return e}):[]})]},supportsAutofix:!0}};const p=e=>function({name:t,meta:n,defaultOptions:r,create:o}){return{meta:Object.assign(Object.assign({},n),{docs:Object.assign(Object.assign({},n.docs),{url:e(t)})}),defaultOptions:r,create(e){const t=a.ESLintUtils.applyDefault(r,e.options);return o(e,t)}}};p.withoutDocs=a.ESLintUtils.RuleCreator.withoutDocs;const m=p(e=>`https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/${e}.md`),d=Symbol("PROPERTY_READ");function f(e){var t;const{details:n}=null!=(t=e.keySpan)?t:{};return n?e instanceof o.TmplAstBoundEvent?function({keySpan:{details:e},name:t}){return t===`${e}Change`}(e)?e.name:n:n.replace("attr.",""):e.name}function g({attributes:e,inputs:t},n){const r=[...e,...t].find(e=>f(e)===n);if("string"==typeof(null==r?void 0:r.value))return r.value;if(!((null==r?void 0:r.value)instanceof o.ASTWithSource))return null;if(r.value.ast instanceof o.LiteralArray)return r.value.ast.expressions;if(r.value.ast instanceof o.LiteralMap){const{keys:e,values:t}=r.value.ast;return e.reduce((e,n,r)=>e.set(n.key,t[r]),new Map)}return r.value.ast instanceof o.LiteralPrimitive?r.value.ast.value:d}var y=m({name:"accessibility-alt-text",meta:{type:"suggestion",docs:{description:"Enforces alternate text for elements which require the alt, aria-label, aria-labelledby attributes.",recommended:!1},schema:[],messages:{accessibilityAltText:"<{{element}}/> element must have a text alternative."}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{"Element$1[name=/^(img|area|object|input)$/]"(n){if(!function(e){return"img"===e.name?function(e){return e.attributes.some(({name:e})=>A(e))||e.inputs.some(({name:e})=>A(e))}(e):"object"===e.name?function(e){let t=!1,n=!1;for(const r of e.attributes)t="title"===r.name,n=T(r.name);if(t||n)return!0;let r=!1,a=!1;for(const t of e.inputs)r="title"===t.name,a=T(t.name);return!(!r&&!a)||e.children.length>0&&!!e.children[0].value}(e):"area"===e.name?S(e):function(e){return"image"!==g(e,"type")||S(e)}(e)}(n)){const r=t.convertElementSourceSpanToLoc(e,n);e.report({loc:r,messageId:"accessibilityAltText",data:{element:n.name}})}}}}});function S(e){let t=!1,n=!1;for(const r of e.attributes)t=A(r.name),n=T(r.name);if(t||n)return!0;let r=!1,a=!1;for(const t of e.inputs)r=A(t.name),a=T(t.name);return r||a}function T(e){return"aria-label"===e||"aria-labelledby"===e}function A(e){return"alt"===e}var b="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function E(e){var t={exports:{}};return e(t,t.exports),t.exports}var x=E(function(e,t){var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.AST_TOKEN_TYPES=t.AST_NODE_TYPES=void 0,(n=t.AST_NODE_TYPES||(t.AST_NODE_TYPES={})).AccessorProperty="AccessorProperty",n.ArrayExpression="ArrayExpression",n.ArrayPattern="ArrayPattern",n.ArrowFunctionExpression="ArrowFunctionExpression",n.AssignmentExpression="AssignmentExpression",n.AssignmentPattern="AssignmentPattern",n.AwaitExpression="AwaitExpression",n.BinaryExpression="BinaryExpression",n.BlockStatement="BlockStatement",n.BreakStatement="BreakStatement",n.CallExpression="CallExpression",n.CatchClause="CatchClause",n.ChainExpression="ChainExpression",n.ClassBody="ClassBody",n.ClassDeclaration="ClassDeclaration",n.ClassExpression="ClassExpression",n.ConditionalExpression="ConditionalExpression",n.ContinueStatement="ContinueStatement",n.DebuggerStatement="DebuggerStatement",n.Decorator="Decorator",n.DoWhileStatement="DoWhileStatement",n.EmptyStatement="EmptyStatement",n.ExportAllDeclaration="ExportAllDeclaration",n.ExportDefaultDeclaration="ExportDefaultDeclaration",n.ExportNamedDeclaration="ExportNamedDeclaration",n.ExportSpecifier="ExportSpecifier",n.ExpressionStatement="ExpressionStatement",n.ForInStatement="ForInStatement",n.ForOfStatement="ForOfStatement",n.ForStatement="ForStatement",n.FunctionDeclaration="FunctionDeclaration",n.FunctionExpression="FunctionExpression",n.Identifier="Identifier",n.IfStatement="IfStatement",n.ImportAttribute="ImportAttribute",n.ImportDeclaration="ImportDeclaration",n.ImportDefaultSpecifier="ImportDefaultSpecifier",n.ImportExpression="ImportExpression",n.ImportNamespaceSpecifier="ImportNamespaceSpecifier",n.ImportSpecifier="ImportSpecifier",n.JSXAttribute="JSXAttribute",n.JSXClosingElement="JSXClosingElement",n.JSXClosingFragment="JSXClosingFragment",n.JSXElement="JSXElement",n.JSXEmptyExpression="JSXEmptyExpression",n.JSXExpressionContainer="JSXExpressionContainer",n.JSXFragment="JSXFragment",n.JSXIdentifier="JSXIdentifier",n.JSXMemberExpression="JSXMemberExpression",n.JSXNamespacedName="JSXNamespacedName",n.JSXOpeningElement="JSXOpeningElement",n.JSXOpeningFragment="JSXOpeningFragment",n.JSXSpreadAttribute="JSXSpreadAttribute",n.JSXSpreadChild="JSXSpreadChild",n.JSXText="JSXText",n.LabeledStatement="LabeledStatement",n.Literal="Literal",n.LogicalExpression="LogicalExpression",n.MemberExpression="MemberExpression",n.MetaProperty="MetaProperty",n.MethodDefinition="MethodDefinition",n.NewExpression="NewExpression",n.ObjectExpression="ObjectExpression",n.ObjectPattern="ObjectPattern",n.PrivateIdentifier="PrivateIdentifier",n.Program="Program",n.Property="Property",n.PropertyDefinition="PropertyDefinition",n.RestElement="RestElement",n.ReturnStatement="ReturnStatement",n.SequenceExpression="SequenceExpression",n.SpreadElement="SpreadElement",n.StaticBlock="StaticBlock",n.Super="Super",n.SwitchCase="SwitchCase",n.SwitchStatement="SwitchStatement",n.TaggedTemplateExpression="TaggedTemplateExpression",n.TemplateElement="TemplateElement",n.TemplateLiteral="TemplateLiteral",n.ThisExpression="ThisExpression",n.ThrowStatement="ThrowStatement",n.TryStatement="TryStatement",n.UnaryExpression="UnaryExpression",n.UpdateExpression="UpdateExpression",n.VariableDeclaration="VariableDeclaration",n.VariableDeclarator="VariableDeclarator",n.WhileStatement="WhileStatement",n.WithStatement="WithStatement",n.YieldExpression="YieldExpression",n.TSAbstractAccessorProperty="TSAbstractAccessorProperty",n.TSAbstractKeyword="TSAbstractKeyword",n.TSAbstractMethodDefinition="TSAbstractMethodDefinition",n.TSAbstractPropertyDefinition="TSAbstractPropertyDefinition",n.TSAnyKeyword="TSAnyKeyword",n.TSArrayType="TSArrayType",n.TSAsExpression="TSAsExpression",n.TSAsyncKeyword="TSAsyncKeyword",n.TSBigIntKeyword="TSBigIntKeyword",n.TSBooleanKeyword="TSBooleanKeyword",n.TSCallSignatureDeclaration="TSCallSignatureDeclaration",n.TSClassImplements="TSClassImplements",n.TSConditionalType="TSConditionalType",n.TSConstructorType="TSConstructorType",n.TSConstructSignatureDeclaration="TSConstructSignatureDeclaration",n.TSDeclareFunction="TSDeclareFunction",n.TSDeclareKeyword="TSDeclareKeyword",n.TSEmptyBodyFunctionExpression="TSEmptyBodyFunctionExpression",n.TSEnumDeclaration="TSEnumDeclaration",n.TSEnumMember="TSEnumMember",n.TSExportAssignment="TSExportAssignment",n.TSExportKeyword="TSExportKeyword",n.TSExternalModuleReference="TSExternalModuleReference",n.TSFunctionType="TSFunctionType",n.TSInstantiationExpression="TSInstantiationExpression",n.TSImportEqualsDeclaration="TSImportEqualsDeclaration",n.TSImportType="TSImportType",n.TSIndexedAccessType="TSIndexedAccessType",n.TSIndexSignature="TSIndexSignature",n.TSInferType="TSInferType",n.TSInterfaceBody="TSInterfaceBody",n.TSInterfaceDeclaration="TSInterfaceDeclaration",n.TSInterfaceHeritage="TSInterfaceHeritage",n.TSIntersectionType="TSIntersectionType",n.TSIntrinsicKeyword="TSIntrinsicKeyword",n.TSLiteralType="TSLiteralType",n.TSMappedType="TSMappedType",n.TSMethodSignature="TSMethodSignature",n.TSModuleBlock="TSModuleBlock",n.TSModuleDeclaration="TSModuleDeclaration",n.TSNamedTupleMember="TSNamedTupleMember",n.TSNamespaceExportDeclaration="TSNamespaceExportDeclaration",n.TSNeverKeyword="TSNeverKeyword",n.TSNonNullExpression="TSNonNullExpression",n.TSNullKeyword="TSNullKeyword",n.TSNumberKeyword="TSNumberKeyword",n.TSObjectKeyword="TSObjectKeyword",n.TSOptionalType="TSOptionalType",n.TSParameterProperty="TSParameterProperty",n.TSPrivateKeyword="TSPrivateKeyword",n.TSPropertySignature="TSPropertySignature",n.TSProtectedKeyword="TSProtectedKeyword",n.TSPublicKeyword="TSPublicKeyword",n.TSQualifiedName="TSQualifiedName",n.TSReadonlyKeyword="TSReadonlyKeyword",n.TSRestType="TSRestType",n.TSSatisfiesExpression="TSSatisfiesExpression",n.TSStaticKeyword="TSStaticKeyword",n.TSStringKeyword="TSStringKeyword",n.TSSymbolKeyword="TSSymbolKeyword",n.TSTemplateLiteralType="TSTemplateLiteralType",n.TSThisType="TSThisType",n.TSTupleType="TSTupleType",n.TSTypeAliasDeclaration="TSTypeAliasDeclaration",n.TSTypeAnnotation="TSTypeAnnotation",n.TSTypeAssertion="TSTypeAssertion",n.TSTypeLiteral="TSTypeLiteral",n.TSTypeOperator="TSTypeOperator",n.TSTypeParameter="TSTypeParameter",n.TSTypeParameterDeclaration="TSTypeParameterDeclaration",n.TSTypeParameterInstantiation="TSTypeParameterInstantiation",n.TSTypePredicate="TSTypePredicate",n.TSTypeQuery="TSTypeQuery",n.TSTypeReference="TSTypeReference",n.TSUndefinedKeyword="TSUndefinedKeyword",n.TSUnionType="TSUnionType",n.TSUnknownKeyword="TSUnknownKeyword",n.TSVoidKeyword="TSVoidKeyword",(r=t.AST_TOKEN_TYPES||(t.AST_TOKEN_TYPES={})).Boolean="Boolean",r.Identifier="Identifier",r.JSXIdentifier="JSXIdentifier",r.JSXText="JSXText",r.Keyword="Keyword",r.Null="Null",r.Numeric="Numeric",r.Punctuator="Punctuator",r.RegularExpression="RegularExpression",r.String="String",r.Template="Template",r.Block="Block",r.Line="Line"});Object.defineProperty(exports,"__esModule",{value:!0});var h={__proto__:null};Object.defineProperty(exports,"__esModule",{value:!0});var v={__proto__:null},C=E(function(e,t){var n=b&&b.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=b&&b.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=b&&b.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TSESTree=void 0,t.TSESTree=a(x)}),F=E(function(e,t){var n=b&&b.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=b&&b.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AST_TOKEN_TYPES=t.AST_NODE_TYPES=void 0,Object.defineProperty(t,"AST_NODE_TYPES",{enumerable:!0,get:function(){return x.AST_NODE_TYPES}}),Object.defineProperty(t,"AST_TOKEN_TYPES",{enumerable:!0,get:function(){return x.AST_TOKEN_TYPES}}),r(h,t),r(v,t),r(C,t)});function D({parent:e},t){for(;e&&e.type!==F.AST_NODE_TYPES.Program;){if(t(e))return e;e=e.parent}return null}function B(e){if(D(e,w)||function(e){const t=g(e,"style");if("string"!=typeof t)return!1;const n=t.replace(/[\s'"]/g,"");return n.includes("display:none")||n.includes("visibility:hidden")}(e)||function(e){const t=g(e,"ngStyle");return t instanceof Map&&("none"===t.get("display")||"hidden"===t.get("visibility"))}(e)||function(e){return"none"===g(e,"style.display")||"true"===String(g(e,"style.display.none"))||"hidden"===g(e,"style.visibility")||"true"===String(g(e,"style.visibility.hidden"))}(e)||I(e,"aria-hidden")||I(e,"hidden"))return!0;if("INPUT"!==e.name.toUpperCase())return!1;const t=g(e,"type");return"string"==typeof t&&"HIDDEN"===t.toUpperCase()}function I(e,t){const n=g(e,t);return""===n||"true"===String(n)}function w(e){return e instanceof o.TmplAstElement&&B(e)}const N=["aria-label","innerHtml","innerHTML","innerText","outerHTML","title"];var P=m({name:"accessibility-elements-content",meta:{type:"suggestion",docs:{description:"Ensures that the heading, anchor and button elements have content in it",recommended:!1},schema:[{additionalProperties:!1,properties:{allowList:{items:{type:"string"},type:"array",uniqueItems:!0}},type:"object"}],messages:{accessibilityElementsContent:"<{{element}}> should have content"}},defaultOptions:[{allowList:N}],create(e,[{allowList:t}]){const n=r.getTemplateParserServices(e);return{"Element$1[name=/^(a|button|h1|h2|h3|h4|h5|h6)$/][children.length=0]"(r){if(B(r))return;const{attributes:a,inputs:o,name:s,sourceSpan:i}=r,u=new Set([...N,...null!=t?t:[]]);if([...a,...o].map(({name:e})=>e).some(e=>u.has(e)))return;const c=n.convertNodeSourceSpanToLoc(i);e.report({loc:c,messageId:"accessibilityElementsContent",data:{element:s}})}}}});let O=null;function L(){var e;return null!=(e=O)?e:O=new Set(s.dom.keys())}let k=null,R=null,$=null,_=null;function q(){if(null===_){const e=[...s.roles.keys()];_=new Set(e.filter(e=>{const t=s.roles.get(e);return t&&!t.abstract&&"toolbar"!==e&&!t.superClass.some(e=>e.includes("widget"))}).concat("progressbar"))}return _}function M(e){return L().has(e.name)&&function(e){function t({attributes:t,name:n}){return e.name===n&&function(e,t){const n=[...t.attributes,...t.inputs];return e.every(e=>n.some(({name:n})=>"a"===t.name&&"routerLink"===n||e.name===n&&(!e.value||e.value===g(t,e.name))))}(null!=t?t:[],e)}return!!function(){if(null===R){const e=[...s.roles.keys()],t=[...s.elementRoles.entries()],n=new Set(e.filter(e=>{const t=s.roles.get(e);return t&&!t.abstract&&"progressbar"!==e&&t.superClass.some(e=>e.includes("widget"))}).concat("toolbar"));R=t.reduce((e,[t,r])=>e.concat([...r].every(e=>n.has(e))?t:[]),[])}return R}().some(t)||!function(){if(null===$){const e=[...s.elementRoles.entries()];$=e.reduce((e,[t,n])=>e.concat([...n].every(e=>q().has(e))?t:[]),[])}return $}().some(t)&&function(){if(null===k){const{AXObjects:e,elementAXObjects:t}=require("axobject-query"),n=new Set(Array.from(e.keys()).filter(t=>"widget"===e.get(t).type));k=[...t.entries()].reduce((e,[t,r])=>e.concat([...r].every(e=>n.has(e))?t:[]),[])}return k}().some(t)}(e)}const j=new Set(["none","presentation"]);function K(e){const t=g(e,"role");return"string"==typeof t&&j.has(t)}const U="accessibility-interactive-supports-focus";var X=m({name:U,meta:{type:"suggestion",docs:{description:"Ensures that elements with interactive handlers like `(click)` are focusable.",recommended:!1},schema:[],messages:{interactiveSupportsFocus:"Elements with interaction handlers must be focusable."}},defaultOptions:[],create:e=>({Element$1(t){const n=t.name;if(!L().has(n))return;const a=t.outputs.find(e=>"click"===e.name||e.name.startsWith("keyup")||e.name.startsWith("keydown")||e.name.startsWith("keypress"));if(!a||function(e){const t=[...e.attributes,...e.inputs].find(e=>"disabled"===f(e)),n=g(e,"disabled");return!((!t||void 0===n)&&"true"!==String(g(e,"aria-disabled")).toLowerCase())}(t)||B(t)||K(t))return;const o=[...t.attributes,...t.inputs].find(e=>"tabindex"===e.name);if(a&&!o&&!M(t)&&!function(e){return function(e){return q().has(g(e,"role"))}(e)}(t)&&!function(e){const t=[...e.attributes,...e.inputs].find(e=>"contenteditable"===f(e)),n=g(e,"contenteditable");return!!t&&(""===n||"true"===String(n).toLowerCase())}(t)){const n=r.getTemplateParserServices(e).convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:n,messageId:"interactiveSupportsFocus"})}}})});function J(e,t){return function e({children:n}){return n.some(n=>n instanceof o.TmplAstElement&&(n.name===t||e(n)))}(e)}const W={items:{type:"string"},type:"array",uniqueItems:!0},V=["button","input","meter","output","progress","select","textarea"],Y=["for","htmlFor"],H=["label"];var G=m({name:"accessibility-label-for",meta:{deprecated:!0,replacedBy:["accessibility-label-has-associated-control"],type:"suggestion",docs:{description:"Ensures that a label element/component is associated with a form element",recommended:!1},schema:[{additionalProperties:!1,properties:{controlComponents:{...W},labelAttributes:{...W},labelComponents:{...W}},type:"object"}],messages:{accessibilityLabelFor:"A label element/component must be associated with a form element"}},defaultOptions:[{controlComponents:V,labelAttributes:Y,labelComponents:H}],create(e,[t]){const n=r.getTemplateParserServices(e),{controlComponents:a,labelAttributes:o,labelComponents:s}=function({controlComponents:e,labelAttributes:t,labelComponents:n}){return{controlComponents:new Set([...V,...null!=e?e:[]]),labelAttributes:new Set([...Y,...null!=t?t:[]]),labelComponents:new Set([...H,...null!=n?n:[]])}}(t);var i;return{[`Element$1[name=${i=[...s],RegExp(`^(${i.join("|")})$`)}]`](t){const r=new Set([...t.attributes,...t.inputs].map(({name:e})=>e));if([...o].some(e=>r.has(e))||function(e,t){return Boolean([...e].some(e=>J(t,e)))}(a,t))return;const s=n.convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:s,messageId:"accessibilityLabelFor"})}}}});const z="accessibility-label-has-associated-control",Q=["input","meter","output","progress","select","textarea"],Z=[{inputs:["for","htmlFor"],selector:"label"}];var ee=m({name:z,meta:{type:"suggestion",docs:{description:"Ensures that a label element/component is associated with a form element",recommended:!1},schema:[{additionalProperties:!1,properties:{controlComponents:{items:{type:"string"},type:"array",uniqueItems:!0},labelComponents:{items:{additionalProperties:!1,properties:{inputs:{items:{type:"string"},type:"array",uniqueItems:!0},selector:{type:"string"}},required:["selector"],type:"object"},type:"array",uniqueItems:!0}},type:"object"}],messages:{accessibilityLabelHasAssociatedControl:"A label component must be associated with a form element"}},defaultOptions:[{controlComponents:Q,labelComponents:Z}],create(e,[{controlComponents:t,labelComponents:n}]){const a=r.getTemplateParserServices(e),o=new Set([...Q,...null!=t?t:[]]),s=[...Z,...null!=n?n:[]],i=s.map(({selector:e})=>e);return{[`Element$1[name=${RegExp(`^(${i.join("|")})$`)}]`](t){var n;const r=s.find(({selector:e})=>e===t.name);if(!r)return;const i=new Set([...t.attributes,...t.inputs].map(({name:e})=>e));if((null==(n=r.inputs)?void 0:n.some(e=>i.has(e)))||function(e,t){return Boolean([...e].some(e=>J(t,e)))}(o,t))return;const u=a.convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:u,messageId:"accessibilityLabelHasAssociatedControl"})}}}});function te(e){return RegExp(`^(${e.join("|")})$`)}let ne=null,re=null;const ae="accessibility-role-has-required-aria";var oe=m({name:ae,meta:{type:"suggestion",docs:{description:"Ensures elements with ARIA roles have all required properties for that role.",recommended:!1},hasSuggestions:!0,schema:[],messages:{roleHasRequiredAria:'The {{element}} with role="{{role}}" does not have required ARIA properties: {{missingProps}}',suggestRemoveRole:"Remove role `{{role}}`"}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{[`Element$1[name=${te([...L()])}] > TextAttribute[name='role']`](n){const{value:r,sourceSpan:a}=n,{attributes:o,inputs:i,name:u}=n.parent,c=[...o,...i],l=s.roles.get(r),p=Object.keys((null==l?void 0:l.requiredProps)||{});if(!p.length)return;if(function(e,t,n){var r,a;if(null===ne||null===re){const{AXObjectRoles:e,elementAXObjects:t}=require("axobject-query");ne=t,re=e}return Array.from(null!=(r=null==(a=ne)?void 0:a.keys())?r:[]).some(r=>{var a,o,s;return r.name===e&&(null!=(a=r.attributes)?a:[]).every(e=>n.find(t=>e.name===t.name&&e.value===t.value))&&(null==(o=ne)||null==(s=o.get(r))?void 0:s.find(e=>{var n,r;return null==(n=re)||null==(r=n.get(e))?void 0:r.find(e=>e.name===t)}))})}(u,r,c))return;const m=p.filter(e=>!c.find(t=>t.name===e)).join(", ");if(m){const n=t.convertNodeSourceSpanToLoc(a);e.report({loc:n,messageId:"roleHasRequiredAria",data:{element:u,role:r,missingProps:m},suggest:[{messageId:"suggestRemoveRole",data:{element:u,role:r,missingProps:m},fix:e=>e.removeRange([(null==a?void 0:a.start.offset)-1,null==a?void 0:a.end.offset])}]})}}}}}),se=m({name:"accessibility-table-scope",meta:{type:"suggestion",docs:{description:"Ensures that the `scope` attribute is only used on the `<th>` element",recommended:!1},fixable:"code",schema:[],messages:{accessibilityTableScope:"The `scope` attribute should only be on the `<th>` element"}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{[`Element$1[name=${te([...L()].filter(e=>"th"!==e))}] > :matches(BoundAttribute, TextAttribute)[name='scope']`]({sourceSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"accessibilityTableScope",fix:e=>e.removeRange([n.start.offset-1,n.end.offset])})}}}}),ie=m({name:"accessibility-valid-aria",meta:{type:"suggestion",docs:{description:"Ensures that correct ARIA attributes and respective values are used",recommended:!1},hasSuggestions:!0,schema:[],messages:{accessibilityValidAria:"The `{{attribute}}` is an invalid ARIA attribute",accessibilityValidAriaValue:"The `{{attribute}}` has an invalid value. Check the valid values at https://raw.githack.com/w3c/aria/stable/#roles",suggestRemoveInvalidAria:"Remove attribute `{{attribute}}`"}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{[`Element$1[name=${te([...L()])}] > :matches(BoundAttribute, TextAttribute)[name=/^aria-.+/]`](n){const{name:r,sourceSpan:a}=n,i=s.aria.get(r),u=t.convertNodeSourceSpanToLoc(a);if(!i)return void e.report({loc:u,messageId:"accessibilityValidAria",data:{attribute:r},suggest:[{messageId:"suggestRemoveInvalidAria",data:{attribute:r},fix:e=>e.removeRange([a.start.offset-1,a.end.offset])}]});const c=function(e){return e instanceof o.TmplAstBoundAttribute&&e.value instanceof o.ASTWithSource?e.value.ast:e}(n);(function(e){return!function(e){return e instanceof o.LiteralArray||e instanceof o.LiteralMap}(e)&&!function(e){return e instanceof o.LiteralPrimitive||e instanceof o.TmplAstTextAttribute}(e)})(c)||function({allowundefined:e,type:t,values:n},r){if(e&&ce(r))return!0;switch(t){case"boolean":return ue(r);case"tristate":return ue(r)||ce(r);case"id":case"idlist":return!0;case"integer":return a=r,!Number.isNaN(a)&&parseInt(Number(a))==a&&!Number.isNaN(parseInt(a,10));case"number":return function(e){return!Number.isNaN(Number.parseFloat(e))&&Number.isFinite(Number(e))}(r);case"string":return function(e){return"string"==typeof e}(r);case"token":case"tokenlist":{const e=ue(r)?JSON.parse(r):r;return Boolean(null==n?void 0:n.includes(e))}}var a}(i,c.value)||e.report({loc:u,messageId:"accessibilityValidAriaValue",data:{attribute:r}})}}}});function ue(e){return"boolean"==typeof e||"false"===e||"true"===e}function ce(e){return null==e}const le={alphabetical:!1,order:["STRUCTURAL_DIRECTIVE","TEMPLATE_REFERENCE","ATTRIBUTE_BINDING","INPUT_BINDING","TWO_WAY_BINDING","OUTPUT_BINDING"]};var pe=m({name:"attributes-order",meta:{type:"layout",docs:{description:"Ensures that HTML attributes and Angular bindings are sorted based on an expected order",recommended:!1},fixable:"code",schema:[{type:"object",properties:{alphabetical:{type:"boolean",default:le.alphabetical},order:{type:"array",items:{enum:le.order},default:le.order,minItems:le.order.length,uniqueItems:!0}},additionalProperties:!1}],messages:{attributesOrder:"The element's attributes/bindings did not match the expected order: expected {{expected}} instead of {{actual}}"}},defaultOptions:[le],create(e,[{alphabetical:t,order:n}]){const a=r.getTemplateParserServices(e);function o(e){const t=a.convertNodeSourceSpanToLoc(e.sourceSpan);switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return{start:{line:t.start.line,column:t.start.column-1},end:{line:t.end.line,column:t.end.column+1}};default:return t}}return{Element$1(r){const{attributes:a,inputs:s,outputs:i,references:u}=r,{extractedBananaBoxes:c,extractedInputs:l,extractedOutputs:p}=function(e,t){const n=e.filter(e=>!t.some(t=>Ee(e,t))).map(ge),{extractedBananaBoxes:r,extractedOutputs:a}=t.reduce(({extractedBananaBoxes:t,extractedOutputs:n},r)=>{const a=e.find(e=>Ee(e,r));return{extractedBananaBoxes:t.concat(a?Te(a):[]),extractedOutputs:n.concat(a?[]:Se(r))}},{extractedBananaBoxes:[],extractedOutputs:[]});return{extractedBananaBoxes:r,extractedInputs:n,extractedOutputs:a}}(s.map(ge),i.map(Se)),m=[...be(r),...a.map(fe),...u.map(Ae),...c,...l,...p];if(m.length<2)return;const d=[...m].sort(me),f=[...m].sort(function(e,t){return function(n,r){const a=de(n,e)-de(r,e);return t&&0===a?n.name>r.name?1:-1:a}}(n,t));let g;for(let e=0;e<d.length;e++){var y,S;d[e]!==f[e]&&(g=[null!=(y=null==(S=g)?void 0:S[0])?y:e,e])}if(g){const[t,n]=g,r=e.getSourceCode(),{start:a}=o(d[t]),{end:s}=o(d[n]),i={start:a,end:s},u=[he(d[t]),ve(d[n])];let c="",l=u[0];for(let e=t;e<=n;e++){const t=d[e],n=he(t),a=ve(t),o=f[e],s=he(o),i=ve(o);c+=r.text.slice(l,n),c+=r.text.slice(s,i),l=a}e.report({loc:i,messageId:"attributesOrder",data:{expected:f.slice(t,n+1).map(e=>`\`${xe(e)}\``).join(", "),actual:d.slice(t,n+1).map(e=>`\`${xe(e)}\``).join(", ")},fix:e=>e.replaceTextRange(u,c)})}}}}});function me(e,t){return e.sourceSpan.start.line===t.sourceSpan.start.line?e.sourceSpan.start.col-t.sourceSpan.start.col:e.sourceSpan.start.line-t.sourceSpan.start.line}function de(e,t){return t.indexOf(e.orderType)}function fe(e){return{...e,orderType:"ATTRIBUTE_BINDING"}}function ge(e){return{...e,orderType:"INPUT_BINDING"}}function ye(e){return{...e,orderType:"STRUCTURAL_DIRECTIVE"}}function Se(e){return{...e,orderType:"OUTPUT_BINDING"}}function Te(e){return{...e,orderType:"TWO_WAY_BINDING"}}function Ae(e){return{...e,orderType:"TEMPLATE_REFERENCE"}}function be(e){return function(e){return e instanceof o.TmplAstTemplate}(e.parent)?e.parent.templateAttrs.map(ye):[]}function Ee(e,t){return e.sourceSpan.start===t.sourceSpan.start&&e.sourceSpan.end===t.sourceSpan.end}function xe(e){switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return`*${e.name}`;case"TEMPLATE_REFERENCE":return`#${e.name}`;case"INPUT_BINDING":return`[${e.name}]`;case"OUTPUT_BINDING":return`(${e.name})`;case"TWO_WAY_BINDING":return`[(${e.name})]`;default:return e.name}}function he(e){switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return e.sourceSpan.start.offset-1;default:return e.sourceSpan.start.offset}}function ve(e){switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return e.sourceSpan.end.offset+1;default:return e.sourceSpan.end.offset}}const Ce=/\[(.*)\]/;var Fe=m({name:"banana-in-box",meta:{type:"suggestion",docs:{description:"Ensures that the two-way data binding syntax is correct",recommended:"error"},fixable:"code",schema:[],messages:{bananaInBox:"Invalid binding syntax. Use [(expr)] instead"}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e),n=e.getSourceCode();return{BoundEvent({name:r,sourceSpan:a}){const o=r.match(Ce);if(!o)return;const s=t.convertNodeSourceSpanToLoc(a);e.report({messageId:"bananaInBox",loc:s,fix:e=>{const[,t]=o,a=`[(${t})]`,i=n.getIndexFromLoc(s.start);return e.replaceTextRange([i,i+r.length+2],a)}})}}}});const De=["button","submit","reset"];var Be=m({name:"button-has-type",meta:{type:"suggestion",docs:{description:"Ensures that a button has a valid type specified",recommended:!1},schema:[],messages:{missingType:"Type for <button> is missing",invalidType:'"{{type}}" can not be used as a type for <button>'}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{"Element$1[name=button]"(n){(function({inputs:e,attributes:t}){return[...e,...t].some(({name:e})=>"type"===e)})(n)||e.report({loc:t.convertNodeSourceSpanToLoc(n.sourceSpan),messageId:"missingType"});const r=function(e){const t=e.attributes.find(({name:e,value:t})=>"type"===e&&!De.includes(t));if(t)return{sourceSpan:t.sourceSpan,value:t.value};for(const{name:t,value:n,sourceSpan:r}of e.inputs)if("type"===t&&n instanceof o.ASTWithSource&&n.ast instanceof o.LiteralPrimitive&&!De.includes(n.ast.value))return{value:n.ast.value,sourceSpan:r};return null}(n);null!=r&&e.report({loc:t.convertNodeSourceSpanToLoc(r.sourceSpan),messageId:"invalidType",data:{type:r.value}})}}}}),Ie=m({name:"click-events-have-key-events",meta:{type:"suggestion",docs:{description:"Ensures that the click event is accompanied with at least one key event keyup, keydown or keypress.",recommended:!1},schema:[],messages:{clickEventsHaveKeyEvents:"click must be accompanied by either keyup, keydown or keypress event for accessibility."}},defaultOptions:[],create:e=>({Element$1(t){if(!L().has(t.name))return;if(K(t)||B(t)||M(t))return;let n=!1,a=!1;for(const e of t.outputs)n=n||"click"===e.name,a=a||e.name.startsWith("keyup")||e.name.startsWith("keydown")||e.name.startsWith("keypress");if(!n||a)return;const o=r.getTemplateParserServices(e).convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:o,messageId:"clickEventsHaveKeyEvents"})}})}),we=m({name:"conditional-complexity",meta:{type:"suggestion",docs:{description:"The conditional complexity should not exceed a rational limit",recommended:!1},schema:[{type:"object",properties:{maxComplexity:{minimum:1,type:"number"}},additionalProperties:!1}],messages:{conditionalComplexity:"The conditional complexity {{totalComplexity}} exceeds the defined limit {{maxComplexity}}"}},defaultOptions:[{maxComplexity:5}],create(e,[{maxComplexity:t}]){r.ensureTemplateParser(e);const n=e.getSourceCode();return{BoundAttribute(r){if(!r.value.source||r.value.ast instanceof o.Interpolation)return;const a=Oe(Ne((Pe||(Pe=new o.Parser(new o.Lexer))).parseBinding(r.value.source,"",0).ast));if(a<=t)return;const{sourceSpan:{start:s,end:i}}=r.value;e.report({loc:{start:n.getLocFromIndex(s),end:n.getLocFromIndex(i)},messageId:"conditionalComplexity",data:{maxComplexity:t,totalComplexity:a}})},Interpolation({expressions:r}){for(const a of r){const r=Oe(a);if(r<=t)continue;const{sourceSpan:{start:o,end:s}}=a;e.report({loc:{start:n.getLocFromIndex(o),end:n.getLocFromIndex(s)},messageId:"conditionalComplexity",data:{maxComplexity:t,totalComplexity:r}})}}}}});function Ne(e){return e instanceof o.BindingPipe?e.exp:e}let Pe=null;function Oe(e){const t=Ne(e);if(!(t instanceof o.Binary||t instanceof o.Conditional))return 0;let n=1;return t instanceof o.Binary&&(t.left instanceof o.Binary&&(n+=Oe(t.left)),t.right instanceof o.Binary&&(n+=Oe(t.right))),t instanceof o.Conditional&&(n+=Oe(t.condition)+Oe(t.trueExp)+Oe(t.falseExp)),n}var Le=m({name:"cyclomatic-complexity",meta:{type:"suggestion",docs:{description:"Checks cyclomatic complexity against a specified limit. It is a quantitative measure of the number of linearly independent paths through a program's source code",recommended:!1},schema:[{type:"object",properties:{maxComplexity:{type:"number",minimum:1}},additionalProperties:!1}],messages:{cyclomaticComplexity:"The cyclomatic complexity {{totalComplexity}} exceeds the defined limit {{maxComplexity}}"}},defaultOptions:[{maxComplexity:5}],create(e,[{maxComplexity:t}]){let n=0;const a=r.getTemplateParserServices(e);return{'BoundAttribute[name=/^(ngForOf|ngIf|ngSwitchCase)$/], TextAttribute[name="ngSwitchDefault"]'({sourceSpan:r}){if(n+=1,n<=t)return;const o=a.convertNodeSourceSpanToLoc(r);e.report({messageId:"cyclomaticComplexity",loc:o,data:{maxComplexity:t,totalComplexity:n}})}}}});const ke={allowNullOrUndefined:!1};var Re=m({name:"eqeqeq",meta:{type:"suggestion",docs:{description:"Requires `===` and `!==` in place of `==` and `!=`",recommended:"error"},hasSuggestions:!0,fixable:"code",schema:[{type:"object",properties:{allowNullOrUndefined:{type:"boolean",default:ke.allowNullOrUndefined}},additionalProperties:!1}],messages:{eqeqeq:"Expected `{{expectedOperation}}` but received `{{actualOperation}}`",suggestStrictEquality:"Replace `{{actualOperation}}` with `{{expectedOperation}}`"}},defaultOptions:[ke],create(e,[{allowNullOrUndefined:t}]){r.ensureTemplateParser(e);const n=e.getSourceCode();return{"Binary[operation=/^(==|!=)$/]"(r){const{left:a,operation:o,right:s,sourceSpan:{start:i,end:u}}=r;if(t&&(Ke(a)||Ke(s)))return;const c={actualOperation:o,expectedOperation:`${o}=`};e.report({loc:{start:n.getLocFromIndex(i),end:n.getLocFromIndex(u)},messageId:"eqeqeq",data:c,...je(a)||je(s)?{fix:e=>_e({node:r,left:a,right:s,start:i,end:u,fixer:e})}:{suggest:[{messageId:"suggestStrictEquality",fix:e=>_e({node:r,left:a,right:s,start:i,end:u,fixer:e}),data:c}]}})}}}});function $e({span:{start:e,end:t}}){return t-e}const _e=({node:e,left:t,right:n,start:r,end:a,fixer:o})=>{var s;const{source:i}=null!=(s=D(e,qe))?s:{};return i?o.insertTextAfterRange([r+$e(t)+1,a-$e(n)-1],"="):null};function qe(e){return e instanceof o.ASTWithSource}function Me(e){return e instanceof o.LiteralPrimitive}function je(e){return Me(e)&&"string"==typeof e.value&&(t=e.value,!(!Number.isNaN(Number.parseFloat(String(t)))&&Number.isFinite(Number(t))));var t}function Ke(e){return Me(e)&&null==e.value}const Ue=/[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,Xe=new RegExp(`[^${Ue}]`),Je=new Set(["autocomplete","charset","class","color","colspan","dir","fill","for","formArrayName","formControlName","formGroupName","height","href","id","lang","list","name","ngClass","ngProjectAs","role","routerLink","routerLinkActive","src","stroke","stroke-width","style","svgIcon","tabindex","target","type","value","viewBox","width","xmlns"]),We={checkAttributes:!0,checkId:!0,checkDuplicateId:!0,checkText:!0,ignoreAttributes:[...Je]},Ve="https://angular.io/guide/i18n",Ye=`${Ve}#mark-element-attributes-for-translations`,He=`${Ve}#mark-plurals-and-alternates-for-translation`,Ge=`${Ve}#mark-text-for-translations`,ze=`${Ve}#manage-marked-text-with-custom-ids`,Qe=`${Ve}#define-unique-custom-ids`,Ze=`${Ve}-common-prepare#i18n-metadata-for-translation`;var et=m({name:"i18n",meta:{type:"suggestion",docs:{description:"Ensures following best practices for i18n. Checks for missing i18n attributes on elements and attributes containing texts. Can also check for texts without i18n attribute, elements that do not use custom ID (@@) feature and duplicate custom IDs",recommended:!1},fixable:"code",hasSuggestions:!0,schema:[{type:"object",properties:{boundTextAllowedPattern:{type:"string"},checkAttributes:{type:"boolean",default:We.checkAttributes},checkDuplicateId:{type:"boolean",default:We.checkDuplicateId},checkId:{type:"boolean",default:We.checkId},checkText:{type:"boolean",default:We.checkText},ignoreAttributes:{type:"array",items:{type:"string"},default:[...Je]},ignoreTags:{type:"array",items:{type:"string"}},requireDescription:{type:"boolean",default:We.requireDescription},requireMeaning:{type:"boolean",default:We.requireMeaning}},additionalProperties:!1}],messages:{i18nAttribute:`Attribute "{{attributeName}}" has no corresponding i18n attribute. See more at ${Ye}`,i18nAttributeOnIcuOrText:`Each element containing text node should have an i18n attribute. See more at ${He} and ${Ge}`,i18nCustomIdOnAttribute:`Missing custom ID on attribute "i18n-{{attributeName}}". See more at ${ze}`,i18nCustomIdOnElement:`Missing custom ID on element. See more at ${ze}`,i18nDuplicateCustomId:`Duplicate custom ID "@@{{customId}}". See more at ${Qe}`,suggestAddI18nAttribute:"Add the `i18n` attribute",i18nMissingDescription:`Missing i18n description on element. See more at ${Ze}`,i18nMissingMeaning:`Missing i18n meaning on element. See more at ${Ze}`}},defaultOptions:[We],create(e,[{boundTextAllowedPattern:t,checkAttributes:n,checkId:a,checkDuplicateId:s,checkText:i,ignoreAttributes:u,ignoreTags:c,requireDescription:l,requireMeaning:p}]){const m=r.getTemplateParserServices(e),d=e.getSourceCode(),f=t?new RegExp(t):Xe,g=new Set([...Je,...null!=u?u:[]]),y=new Set(c),S=new Map;return{...(a||l||p)&&{"Element$1[i18n]"(t){!function({i18n:{description:t,meaning:n,customId:r},name:o,parent:s,sourceSpan:i}){if(y.has(o)||nt(s))return;const u=m.convertNodeSourceSpanToLoc(i);if(a)if(rt(r))e.report({messageId:"i18nCustomIdOnElement",loc:u});else{var c;const e=null!=(c=S.get(r))?c:[];S.set(r,[...e,i])}l&&rt(t)&&e.report({messageId:"i18nMissingDescription",loc:u}),p&&rt(n)&&e.report({messageId:"i18nMissingMeaning",loc:u})}(t)}},...(n||a||l||p)&&{[`Element$1 > TextAttribute[value=${Ue}]`](t){!function({i18n:t,keySpan:r,name:o,parent:{name:s},sourceSpan:i,value:u}){if(y.has(s))return;const c=m.convertNodeSourceSpanToLoc(null!=r?r:i);if(t){const{customId:n,description:r}=t;if(a)if(rt(n))e.report({messageId:"i18nCustomIdOnAttribute",loc:c,data:{attributeName:o}});else{var p;const e=null!=(p=S.get(n))?p:[];S.set(n,[...e,i])}l&&rt(r)&&e.report({messageId:"i18nMissingDescription",loc:c,data:{attributeName:o}})}t||!n||function(e,t,n,r){return e.has(n)||e.has(`${t}[${n}]`)||rt(r)||function(e){return"false"===e||"true"===e}(r)||function(e){const t=Number.parseFloat(e);return!Number.isNaN(t)&&Number.isFinite(t)}(r)}(g,s,o,u)||e.report({messageId:"i18nAttribute",loc:c,data:{attributeName:o},fix:e=>{const{end:t}=m.convertNodeSourceSpanToLoc(i),n=d.getIndexFromLoc(t);return e.insertTextAfterRange([n,n],` i18n-${o}`)}})}(t)}},...i&&{[`BoundText, Icu$1, Text$3[value=${Ue}]`](t){!function(t){var n;const{parent:r,sourceSpan:a}=t;if(t instanceof o.TmplAstBoundText&&function(e,{value:{ast:{strings:t}}}){const n=t.join("").trim();return!Ue.test(n)||e.test(n)}(f,t)||tt(r)&&(r.i18n||y.has(r.name)))return;const s=m.convertNodeSourceSpanToLoc(a),i=e=>function(e,t,n,r,a){return tt(a)?D(a,nt)?[]:function(e,t,{start:n},r){const a=e.getIndexFromLoc(n)+r.length+1;return t.insertTextAfterRange([a,a]," i18n")}(e,n,t.convertNodeSourceSpanToLoc(a.sourceSpan),a.name):function(e,t,{start:n,end:r}){const a=e.getIndexFromLoc(n),o=e.getIndexFromLoc(r);return[t.insertTextBeforeRange([a,a],"<ng-container i18n>"),t.insertTextAfterRange([o,o],"</ng-container>")]}(e,n,r)}(d,m,e,s,r);e.report({messageId:"i18nAttributeOnIcuOrText",loc:s,...null!=r&&null!=(n=r.children)&&n.filter(tt).length?{suggest:[{messageId:"suggestAddI18nAttribute",fix:i}]}:{fix:i}})}(t)}},"Program:exit"(){!function(){if(s)for(const[t,n]of S){if(n.length<=1)break;for(const r of n){const n=m.convertNodeSourceSpanToLoc(r);e.report({messageId:"i18nDuplicateCustomId",loc:n,data:{customId:t}})}}S.clear()}()}}}});function tt(e){return e instanceof o.TmplAstElement}function nt(e){return Boolean(tt(e)&&e.i18n)}function rt(e){return!e||0===e.trim().length}const at="https://www.w3.org/WAI/WCAG21/Understanding/keyboard";var ot=m({name:"mouse-events-have-key-events",meta:{type:"suggestion",docs:{description:`Ensures that the mouse events \`mouseout\` and \`mouseover\` are accompanied by \`focus\` and \`blur\` events respectively. Coding for the keyboard is important for users with physical disabilities who cannot use a mouse, AT compatibility, and screenreader users. See more at ${at}`,recommended:!1},schema:[],messages:{mouseEventsHaveKeyEvents:`\`{{mouseEvent}}\` must be accompanied by \`{{keyEvent}}\` for accessibility (${at})`}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e),n=te([...L()]);return[["blur","mouseout"],["focus","mouseover"]].reduce((r,[a,o])=>({...r,[`Element$1[name=${n}]:has(BoundEvent[name='${o}']):not(:has(BoundEvent[name='${a}']))`]({sourceSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"mouseEventsHaveKeyEvents",data:{keyEvent:a,mouseEvent:o}})}}),{})}}),st=m({name:"no-any",meta:{type:"suggestion",docs:{description:'The use of "$any" nullifies the compile-time benefits of Angular\'s type system',recommended:!1},hasSuggestions:!0,schema:[],messages:{noAny:'Avoid using "$any" in templates',suggestRemoveAny:"Remove $any"}},defaultOptions:[],create(e){r.ensureTemplateParser(e);const t=e.getSourceCode();return{'Call[receiver.name="$any"]'({receiver:n,sourceSpan:{end:r,start:a}}){if(!(n instanceof o.PropertyRead))return;if(!(n.receiver instanceof o.ThisReceiver||n.receiver instanceof o.ImplicitReceiver))return;const s=n.nameSpan;e.report({messageId:"noAny",loc:{start:t.getLocFromIndex(a),end:t.getLocFromIndex(r)},suggest:[{messageId:"suggestRemoveAny",fix:e=>[e.removeRange([s.start,s.end+1]),e.removeRange([r-1,r])]}]})}}}}),it=m({name:"no-autofocus",meta:{type:"suggestion",docs:{description:"Ensures that the `autofocus` attribute is not used",recommended:!1},fixable:"code",schema:[],messages:{noAutofocus:"The `autofocus` attribute should not be used, as it reduces usability and accessibility for users"}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{[`Element$1[name=${te([...L()])}] > :matches(BoundAttribute, TextAttribute)[name="autofocus"]`]({sourceSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"noAutofocus",fix:e=>e.removeRange([n.start.offset-1,n.end.offset])})}}}}),ut=m({name:"no-call-expression",meta:{type:"suggestion",docs:{description:"Disallows calling expressions in templates, except for output handlers",recommended:!1},schema:[{additionalProperties:!1,properties:{allowList:{items:{type:"string"},type:"array",uniqueItems:!0}},type:"object"}],messages:{noCallExpression:"Avoid calling expressions in templates"}},defaultOptions:[{allowList:[]}],create(e,[{allowList:t}]){r.ensureTemplateParser(e);const n=e.getSourceCode();return{'Call[receiver.name!="$any"]'(r){if(Boolean(D(r,ct)))return;if(function(e,t){return t&&t.length>0&&function(e){return!!e.name}(e)&&t.indexOf(e.name)>-1}(r.receiver,t))return;const{sourceSpan:{start:a,end:o}}=r;e.report({loc:{start:n.getLocFromIndex(a),end:n.getLocFromIndex(o)},messageId:"noCallExpression"})}}}});function ct(e){return e instanceof o.TmplAstBoundEvent}var lt=m({name:"no-distracting-elements",meta:{type:"suggestion",docs:{description:"Enforces that no distracting elements are used",recommended:!1},fixable:"code",schema:[],messages:{noDistractingElements:"Do not use <{{element}}> elements as they can create visual accessibility issues and are deprecated"}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{"Element$1[name=/^(blink|marquee)$/]"({name:n,sourceSpan:r}){const a=t.convertNodeSourceSpanToLoc(r);e.report({loc:a,messageId:"noDistractingElements",data:{element:n},fix:e=>e.removeRange([r.start.offset,r.end.offset])})}}}});const pt={allowTwoWayDataBinding:!0,ignore:[]};var mt=m({name:"no-duplicate-attributes",meta:{type:"problem",docs:{description:"Ensures that there are no duplicate input properties or output event listeners",recommended:!1},hasSuggestions:!0,schema:[{type:"object",properties:{allowTwoWayDataBinding:{type:"boolean",default:pt.allowTwoWayDataBinding,description:"Whether or not two-way data binding is allowed as an exception to the rule."},ignore:{type:"array",items:{type:"string"},uniqueItems:!0,default:pt.ignore,description:"Input or output properties for which duplicate presence is allowed as an exception to the rule."}},additionalProperties:!1}],messages:{noDuplicateAttributes:"Duplicate attribute `{{attributeName}}`",suggestRemoveAttribute:"Remove attribute `{{attributeName}}`"}},defaultOptions:[pt],create(e,[{allowTwoWayDataBinding:t,ignore:n}]){const a=r.getTemplateParserServices(e);return{Element$1({inputs:r,outputs:o,attributes:s}){const i=[...dt([...r,...s]),...dt(t?o.filter(e=>!r.some(t=>t.sourceSpan.start===e.sourceSpan.start&&t.sourceSpan.end===e.sourceSpan.end)):o)];(n&&n.length>0?i.filter(e=>!n.includes(f(e))):i).forEach(t=>{const n=a.convertNodeSourceSpanToLoc(t.sourceSpan),r={attributeName:f(t)};e.report({loc:n,messageId:"noDuplicateAttributes",data:r,suggest:[{messageId:"suggestRemoveAttribute",fix:e=>e.removeRange([n.start.column,n.end.column+1]),data:r}]})})}}}});function dt(e){return e.filter(t=>e.some(e=>e!==t&&f(e)===f(t)))}const ft={allowNgStyle:!1,allowBindToStyle:!1};var gt=m({name:"no-inline-styles",meta:{type:"suggestion",docs:{description:"Disallows the use of inline styles in HTML templates",recommended:!1},schema:[{type:"object",properties:{allowNgStyle:{type:"boolean",default:ft.allowNgStyle},allowBindToStyle:{type:"boolean",default:ft.allowBindToStyle}},additionalProperties:!1}],messages:{noInlineStyles:"<{{element}}/> element should not have inline styles via style attribute. Please use classes instead."}},defaultOptions:[ft],create(e,[{allowNgStyle:t,allowBindToStyle:n}]){const a=r.getTemplateParserServices(e);return{Element$1(r){let o=!1;if(t||n){const e=!t&&St(r),a=!n&&Tt(r);o=yt(r)||e||a}else o=yt(r)||St(r)||Tt(r);if(o){const t=a.convertElementSourceSpanToLoc(e,r);e.report({loc:t,messageId:"noInlineStyles",data:{element:r.name}})}}}}});function yt(e){return e.attributes.some(({name:e})=>At(e))||e.inputs.some(({name:e})=>At(e))}function St(e){return e.inputs.some(({name:e})=>function(e){return"ngStyle"===e}(e))}function Tt(e){return e.inputs.some(({keySpan:e})=>function(e){return!(null==e||!e.details)&&e.details.includes("style.")}(e))}function At(e){return"style"===e}var bt=m({name:"no-negated-async",meta:{type:"suggestion",docs:{description:"Ensures that async pipe results are not negated",recommended:"error"},hasSuggestions:!0,schema:[],messages:{noNegatedAsync:"Async pipe results should not be negated. Use `(observable | async) === false`, `(observable | async) === null`, or `(observable | async) === undefined` to check its value instead",suggestFalseComparison:"Compare with `false`",suggestNullComparison:"Compare with `null`",suggestUndefinedComparison:"Compare with `undefined`"}},defaultOptions:[],create(e){r.ensureTemplateParser(e);const t=e.getSourceCode();return{':not(PrefixNot) > PrefixNot > BindingPipe[name="async"]'({parent:{sourceSpan:{end:n,start:r}}}){e.report({messageId:"noNegatedAsync",loc:{start:t.getLocFromIndex(r),end:t.getLocFromIndex(n)},suggest:[{messageId:"suggestFalseComparison",textToInsert:" === false"},{messageId:"suggestNullComparison",textToInsert:" === null"},{messageId:"suggestUndefinedComparison",textToInsert:" === undefined"}].map(({messageId:e,textToInsert:t})=>({messageId:e,fix:e=>[e.removeRange([r,r+1]),e.insertTextAfterRange([n,n],t)]}))})}}}}),Et=m({name:"no-positive-tabindex",meta:{type:"suggestion",docs:{description:"Ensures that the `tabindex` attribute is not positive",recommended:!1},hasSuggestions:!0,schema:[],messages:{noPositiveTabindex:"The `tabindex` attribute should not be positive",suggestNonNegativeTabindex:'Use `tabindex="{{tabindex}}"`'}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{[`Element$1[name=${te([...L()])}] > BoundAttribute[name="tabindex"][value.ast.value>0], TextAttribute[name="tabindex"][value>0]`]({valueSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"noPositiveTabindex",suggest:["-1","0"].map(e=>({messageId:"suggestNonNegativeTabindex",fix:t=>t.replaceTextRange([n.start.offset,n.end.offset],e),data:{tabindex:e}}))})}}}}),xt=m({name:"use-track-by-function",meta:{type:"suggestion",docs:{description:"Ensures trackBy function is used",recommended:!1},schema:[],messages:{useTrackByFunction:"Missing trackBy function in ngFor directive"}},defaultOptions:[],create(e){const t=r.getTemplateParserServices(e);return{'BoundAttribute.inputs[name="ngForOf"]'({parent:{inputs:n},sourceSpan:r}){if(n.some(ht))return;const a=t.convertNodeSourceSpanToLoc(r);e.report({messageId:"useTrackByFunction",loc:a})},'BoundAttribute.templateAttrs[name="ngForOf"]'({parent:{templateAttrs:n}}){if(n.some(ht))return;const{start:r}=t.convertNodeSourceSpanToLoc(n[0].sourceSpan),{end:a}=t.convertNodeSourceSpanToLoc(n[n.length-1].sourceSpan),o={start:{...r,column:r.column-1},end:{...a,column:a.column+1}};e.report({messageId:"useTrackByFunction",loc:o})}}}});function ht(e){return e instanceof o.TmplAstBoundAttribute&&"ngForTrackBy"===e.name}const vt="no-interpolation-in-attributes";var Ct=m({name:vt,meta:{type:"suggestion",docs:{description:"Ensures that property-binding is used instead of interpolation in attributes.",recommended:!1},schema:[],messages:{noInterpolationInAttributes:'Use property binding [attribute]="value" instead of interpolation {{ value }} for an attribute.'}},defaultOptions:[],create(e){const t=e.getSourceCode();return{"BoundAttribute Interpolation"(n){const{sourceSpan:{start:r,end:a}}=n;e.report({loc:{start:t.getLocFromIndex(r),end:t.getLocFromIndex(a)},messageId:"noInterpolationInAttributes"})}}}});module.exports={configs:{all:{extends:"./configs/base.json",rules:{"@angular-eslint/template/accessibility-alt-text":"error","@angular-eslint/template/accessibility-elements-content":"error","@angular-eslint/template/accessibility-interactive-supports-focus":"error","@angular-eslint/template/accessibility-label-for":"error","@angular-eslint/template/accessibility-label-has-associated-control":"error","@angular-eslint/template/accessibility-role-has-required-aria":"error","@angular-eslint/template/accessibility-table-scope":"error","@angular-eslint/template/accessibility-valid-aria":"error","@angular-eslint/template/attributes-order":"error","@angular-eslint/template/banana-in-box":"error","@angular-eslint/template/button-has-type":"error","@angular-eslint/template/click-events-have-key-events":"error","@angular-eslint/template/conditional-complexity":"error","@angular-eslint/template/cyclomatic-complexity":"error","@angular-eslint/template/eqeqeq":"error","@angular-eslint/template/i18n":"error","@angular-eslint/template/mouse-events-have-key-events":"error","@angular-eslint/template/no-any":"error","@angular-eslint/template/no-autofocus":"error","@angular-eslint/template/no-call-expression":"error","@angular-eslint/template/no-distracting-elements":"error","@angular-eslint/template/no-duplicate-attributes":"error","@angular-eslint/template/no-inline-styles":"error","@angular-eslint/template/no-interpolation-in-attributes":"error","@angular-eslint/template/no-negated-async":"error","@angular-eslint/template/no-positive-tabindex":"error","@angular-eslint/template/use-track-by-function":"error"}},base:{parser:"@angular-eslint/template-parser",plugins:["@angular-eslint/template"]},recommended:{extends:"./configs/base.json",rules:{"@angular-eslint/template/banana-in-box":"error","@angular-eslint/template/eqeqeq":"error","@angular-eslint/template/no-negated-async":"error"}},"process-inline-templates":{parser:"@typescript-eslint/parser",parserOptions:{ecmaVersion:2020,sourceType:"module"},plugins:["@angular-eslint/template"],processor:"@angular-eslint/template/extract-inline-html"}},processors:l,rules:{"accessibility-alt-text":y,"accessibility-elements-content":P,[U]:X,"accessibility-label-for":G,[z]:ee,[ae]:oe,"accessibility-table-scope":se,"accessibility-valid-aria":ie,"attributes-order":pe,"banana-in-box":Fe,"button-has-type":Be,"conditional-complexity":we,"click-events-have-key-events":Ie,"cyclomatic-complexity":Le,eqeqeq:Re,i18n:et,"mouse-events-have-key-events":ot,"no-any":st,"no-autofocus":it,"no-call-expression":ut,"no-distracting-elements":lt,"no-duplicate-attributes":mt,"no-inline-styles":gt,"no-negated-async":bt,"no-positive-tabindex":Et,"use-track-by-function":xt,[vt]:Ct}};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/eslint-plugin-template",
3
- "version": "15.1.1-alpha.9+4ef0290",
3
+ "version": "15.2.1-alpha.0+e48f172",
4
4
  "description": "ESLint plugin for Angular Templates",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -17,10 +17,10 @@
17
17
  "LICENSE"
18
18
  ],
19
19
  "dependencies": {
20
- "@angular-eslint/bundled-angular-compiler": "15.1.1-alpha.9+4ef0290",
21
- "@angular-eslint/utils": "15.1.1-alpha.9+4ef0290",
22
- "@typescript-eslint/type-utils": "5.44.0",
23
- "@typescript-eslint/utils": "5.44.0",
20
+ "@angular-eslint/bundled-angular-compiler": "15.2.1-alpha.0+e48f172",
21
+ "@angular-eslint/utils": "15.2.1-alpha.0+e48f172",
22
+ "@typescript-eslint/type-utils": "5.48.1",
23
+ "@typescript-eslint/utils": "5.48.1",
24
24
  "aria-query": "5.1.3",
25
25
  "axobject-query": "3.1.1"
26
26
  },
@@ -31,5 +31,5 @@
31
31
  "eslint": "^7.20.0 || ^8.0.0",
32
32
  "typescript": "*"
33
33
  },
34
- "gitHead": "4ef02902f5216ee8a6fab1faf1798ac559341ffc"
34
+ "gitHead": "e48f172aea96f6e4c6b80d8ff06e8c004caf7775"
35
35
  }