@eslint-sukka/eslint-plugin-sukka-full 9.0.1 → 9.2.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 (2) hide show
  1. package/dist/index.cjs +2 -59
  2. package/package.json +7 -6
package/dist/index.cjs CHANGED
@@ -1,59 +1,2 @@
1
- let e,t,r,n;"use strict";var o=Map,a=RegExp,i=Set,s=WeakMap,l=WeakSet;var u,p,c=require("eslint-plugin-sukka"),d=require("@eslint-sukka/shared"),m=require("node:fs"),f=require("node:vm"),g=require("url"),y=require("path"),h=require("fs"),x=require("vm"),b=require("worker_threads"),E=require("node:assert/strict"),v=require("node:util/types"),S=require("node:path"),C=require("node:util"),D=require("eslint/use-at-your-own-risk"),T="u">typeof document?document.currentScript:null;function A(e,t){if("string"==typeof t){let e=t;t=t=>t.type===e}for(;e;){if(t(e))return e;e=e.parent}}function w(e){return e?.type==="Identifier"||e?.type==="PrivateIdentifier"}function k(e){return e?.type==="MemberExpression"}function I(e){return e?.type==="AwaitExpression"}function j(e,t){return!!w(e)&&("function"==typeof t?t(e.name):Array.isArray(t)?t.includes(e.name):e.name===t)}function F(e,t){return e?.type==="Literal"&&(Array.isArray(t)?t.includes(e.value):"string"==typeof e.value&&t instanceof RegExp?t.test(e.value):e.value===t)}function B(e){return!!e&&["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"].includes(e.type)}function R(e,t){return e?.type==="Identifier"&&t?.type===e.type&&e.name===t.name}function P({create:e,meta:t,name:r}){return t.docs&&!t.docs.url&&(t.docs.url=new URL(r,"https://dimensiondev.github.io/eslint-plugin/src/rules/").href),{create(r){var n,o;let a,s=(n=t.defaultOptions||[],o=r.options,a=structuredClone(n),null==o||a.forEach((e,t)=>{if(void 0!==o[t]){let r=o[t];"object"!=typeof r||Array.isArray(r)||"object"!=typeof e||Array.isArray(e)?a[t]=r:a[t]=function e(t={},r={}){return t?r?Object.fromEntries([...new i([...Object.keys(t),...Object.keys(r)])].map(n=>{let o=n in t,a=n in r,i=t[n],s=r[n];return[n,o&&a?"object"!=typeof i||Array.isArray(i)||"object"!=typeof s||Array.isArray(s)?s:e(i,s):o?i:s]})):t:r}(e,r)}}),a);return e(r,s)},meta:t,name:r}}function L(e){if(!e?.program)throw Error("see https://typescript-eslint.io/docs/linting/type-linting")}var N=P({name:"array/no-unneeded-flat-map",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow `Array#flatMap((x) => x)` when simpler alternatives exist",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow simple `Array#flatMap()` in array"}},create:e=>({CallExpression(t){var r;if("MemberExpression"!==t.callee.type||!j(t.callee.property,"flatMap")||!(B(r=t.arguments[0])&&1===r.params.length&&"Identifier"===r.params[0].type&&r.body&&(R(r.params[0],r.body)||"BlockStatement"===r.body.type&&1===r.body.body.length&&"ReturnStatement"===r.body.body[0].type&&R(r.params[0],r.body.body[0].argument))))return;let{property:n}=t.callee;e.report({node:t,messageId:"invalid",*fix(e){yield e.replaceText(n,"flat"),yield*t.arguments.map(t=>e.remove(t))}})}})});let $=new i(["href","pathname","search","hash","origin"]);var M=P({name:"browser/prefer-location-assign",meta:{type:"suggestion",fixable:"code",docs:{description:"Prefer `location.assign(...)` over `location.*`",recommended:"stylistic"},schema:[],messages:{instead:"Use `location.assign(...)` instead of `location.{{name}}`"}},create:e=>({AssignmentExpression(t){let r=function(e,t){if(j(e,t))return e;for(;k(e);){if(j(e.property,t))return e;e=e.object}}(t.left,"location");if(!r)return;let n=O(r.parent);e.report({node:t,messageId:"instead",data:{name:n},fix:function(e,t,r){let n=O(t.parent);if($.has(n??"href"))return n=>n.replaceText(r,`${e.getText(t)}.assign(${e.getText(r.right)})`)}(e.sourceCode,r,t)})}})});function O(e){if(k(e)&&w(e.property))return e.property.name}var q=P({name:"jsx/no-template-literal",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow use template-literal in JSX",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow use template-literal in JSX"}},create:e=>({JSXExpressionContainer(t){if("TemplateLiteral"!==t.expression.type||t.parent?.type==="JSXAttribute")return;let{expression:r}=t;e.report({node:t,messageId:"invalid",fix(n){let o=[...r.expressions,...r.quasis];o.sort((e,t)=>e.range[0]-t.range[0]);let a=o.map(t=>"TemplateElement"===t.type?t.value.cooked:"{"+e.sourceCode.getText(t)+"}");return n.replaceText(t,a.join(""))}})}})}),U=P({name:"jsx/no-unneeded-nested",meta:{type:"suggestion",fixable:"code",docs:{description:"Reduce unneeded JSXFragment nested",recommended:"stylistic"},schema:[],messages:{invalid:"Reduce unneeded JSXFragment nested"}},create(e){let t=e.sourceCode;return{JSXFragment(r){if(1!==r.children.length)return;let n=r.children[0];e.report({node:r,messageId:"invalid",*fix(e){"JSXExpressionContainer"===n.type?"JSXEmptyExpression"!==n.expression.type&&(yield e.replaceText(r,t.getText(n.expression))):yield e.replaceText(r,t.getText(n))}})}}}});let W=/^toLocale(?<name>Upper|Lower)Case$/g;var V=P({name:"string/no-locale-case",meta:{type:"problem",fixable:"code",docs:{description:"Disallow use `String#toLocale{Upper,Lower}Case()`",recommended:"recommended"},schema:[],messages:{instead:"Use `.to{{name}}Case(...)` instead of `.toLocale{{name}}Case()`"}},create:e=>({CallExpression(t){if(t.arguments.length>0||!k(t.callee)||!w(t.callee.property))return;let{property:r}=t.callee,n=W.exec(r.name);n&&e.report({node:t,data:{name:n.groups?.name},messageId:"instead",fix:e=>e.replaceText(r,r.name.replaceAll("Locale",""))})}})}),_=P({name:"string/no-simple-template-literal",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow simple template-literal",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow simple template-literal"}},create:e=>({TemplateLiteral(t){var r,n,o,a;let i=(r=e.sourceCode,(o=n=t,o.parent?.type!=="TaggedTemplateExpression"&&1===o.quasis.length&&!function({loc:e}){return!!e&&e.start.line!==e.end.line}(o.quasis[0])&&0===o.expressions.length)?e=>{let t=JSON.stringify(n.quasis[0].value.cooked||""),o=A(n,e=>"Property"===e.type&&e.key===n);return o?e.replaceText(o,`${t}: ${r.getText(o.value)}`):e.replaceText(n,t)}:2===(a=n).quasis.length&&a.quasis.every(({value:e})=>""===e.cooked)&&1===a.expressions.length?e=>e.replaceText(n,r.getText(n.expressions[0])):void 0);i&&e.report({node:t,messageId:"invalid",fix:i})}})});let z=/\P{ASCII}/u;function K(e,t){return{Program(r){for(let n of r.tokens??[]){let r=function(e){switch(e.type){case"String":case"Template":return e.value.slice(1,-1);case"Identifier":if(e.value.startsWith("#"))return e.value.slice(1);return e.value;case"PrivateIdentifier":case"JSXText":case"JSXIdentifier":return e.value;case"RegularExpression":return e.regex.pattern}return!1}(n);!1!==r&&e.test(r)&&t(n,"code")}for(let n of r.comments??[])e.test(n.value)&&t(n,"comment")}}}function G(e,t){switch(e.type){case"String":case"Template":return r=>{let n=e.value.slice(0,1),o=e.value.slice(-1),a=J(e.value.slice(1,-1),t);return r.replaceText(e,`${n}${a}${o}`)};case"JSXText":return r=>{let n=e.value.replace(t,e=>`&#x${X(e.codePointAt(0))};`);return r.replaceText(e,n)};case"RegularExpression":return r=>{let n=new i(e.regex.flags);n.add("u");let o=new a(J(e.regex.pattern,t),[...n].join(""));return r.replaceText(e,o.toString())}}}function J(e,t){return e.replace(t,e=>{let t=e.codePointAt(0);return t>65535?`\\u{${X(t)}}`:`\\u${X(t)}`})}function X(e){return e.toString(16).padStart(4,"0").toUpperCase()}P({name:"unicode/specific-set",meta:{type:"problem",fixable:"code",docs:{description:"Limit the range of literal characters"},schema:[{type:"object",properties:{pattern:{type:"string"},flags:{type:"string"},only:{type:"string",enum:["code","comment"]}},additionalProperties:!1}],messages:{illegal:"Illegal character detected"},defaultOptions:[{pattern:z.source,flags:"u",only:void 0}]},create(e,[{pattern:t,flags:r,only:n}]){let o=t?new a(t,r):z;return K(o,(t,r)=>{if(n&&n!==r)return;let a=G(t,RegExp(o.source,"gu"));e.report({node:t,messageId:"illegal",fix:a})})}});let Y=/[\u061C\u202A-\u202E\u2066-\u2069]/;var H=P({name:"unicode/no-bidi",meta:{type:"problem",fixable:"code",docs:{description:"Detect and stop Trojan Source attacks",recommended:"recommended"},schema:[],messages:{detected:"Detected potential trojan source attack with unicode bidi introduced in this {{kind}}: {{text}}."}},create:e=>K(Y,(t,r)=>{let n=RegExp(Y.source,"gu"),o={kind:r,text:J(t.value,n)},a=G(t,n);e.report({node:t,data:o,messageId:"detected",fix:a})})});let Q=(n=[/\u00AD\u034F\u061C\u17B4\u17B5\uFEFF\uFFFC/,/\u180B-\u180E/,/\u200B-\u200F/,/\u202A-\u202E/,/\u2060-\u206F/,/\uFE00-\uFE0F/,/\uFFF0-\uFFF8/,/\u{1D173}-\u{1D17A}/u,/\u{E0000}-\u{E007F}/u,/\u{E0100}-\u{E01EF}/u].map(e=>"string"==typeof e?e:e.source).join(""),RegExp(`[${n}]`,"u"));var Z=P({name:"unicode/no-invisible",meta:{type:"problem",fixable:"code",docs:{description:"Disallow invisible characters",recommended:"recommended"},schema:[],messages:{illegal:"Illegal character detected"}},create:e=>K(Q,t=>{let r=G(t,RegExp(Q.source,"gu"));e.report({node:t,messageId:"illegal",fix:r})})}),ee=P({name:"no-redundant-variable",meta:{type:"problem",fixable:"code",docs:{description:"Disallow redundant variable",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow Redundant Variable"}},create:e=>({BlockStatement({body:t}){var r,n,o,a,i;let s=t.find(et);if(!s)return;let l=t[t.indexOf(s)-1];r=l,n=s,r&&"VariableDeclaration"===r.type&&1===r.declarations.length&&r.declarations.some(({init:e,id:t})=>null!==e&&R(n.argument,t))&&e.report({node:s,messageId:"invalid",fix:(o=e.sourceCode,a=l,i=s,e=>{var t;let{init:r,id:n}=a.declarations[0];if(!(r&&n&&i.argument))return null;let s=!I(t=r)||A(t,"TryStatement")?t:t.argument,l=(e=>{if(!n.typeAnnotation)return e;let t=o.getText(n.typeAnnotation.typeAnnotation);return`(${e}) as ${I(r)?`Promise<${t}>`:t}`})(o.getText(s));return[e.remove(a),e.replaceText(i.argument,l)]})})}})});function et(e){return"ReturnStatement"===e.type&&w(e.argument)}var er=P({name:"no-single-return",meta:{type:"suggestion",docs:{description:"Disallow single-return",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow Single Return"}},create:e=>({BlockStatement({parent:t,body:r}){if(!B(t))return;let n=function(e,t){let r=t.find(en);if(!r)return;let n=t.find(e=>{var t,n;return t=e,n=r,"VariableDeclaration"===t.type&&"const"!==t.kind&&t.declarations.some(({id:e})=>R(n.argument,e))});if(n)return e.sourceCode.getDeclaredVariables(n).find(({references:e})=>e.every(e=>e.isWriteOnly()||e.identifier.parent===r))}(e,r);for(let{identifier:t}of n?.references??[])t.parent&&e.report({node:t.parent,messageId:"invalid"})}})});function en(e){return"ReturnStatement"===e.type&&w(e.argument)}var eo=P({name:"prefer-early-return",meta:{type:"problem",fixable:"code",docs:{description:"Prefer early returns over full-body conditional wrapping in function declarations",recommended:"stylistic"},schema:[{type:"object",properties:{maximumStatements:{type:"integer",minimum:0}},additionalProperties:!1}],messages:{prefer:"Prefer an early return to a conditionally-wrapped function body"},defaultOptions:[{maximumStatements:0}]},create:(e,[{maximumStatements:t}])=>({BlockStatement:function({body:r,parent:n}){var o,a;if(!B(n)||!(1===r.length&&function(e,t){if("IfStatement"!==e.type||null!==e.alternate)return!1;let{consequent:r}=e;return"ExpressionStatement"===r.type&&0===t||"BlockStatement"===r.type&&r.body.length>t}(r[0],t)))return;let i=(o=e,a=r[0],function*(e){var t;let r;if("IfStatement"!==a.type)return;let{test:n,consequent:i}=a;yield e.insertTextBefore(n,"!("),yield e.insertTextAfter(n,")"),yield e.replaceText(i,"return;");let s=(t=o.sourceCode.getText(i),r=t,"BlockStatement"===i.type?r.slice(1,-1):r);yield e.insertTextAfter(a,s)});e.report({node:r[0],messageId:"prefer",fix:i})}})}),ea=P({name:"prefer-fetch",meta:{type:"problem",docs:{description:"Enforce fetch",recommended:"stylistic"},schema:[],messages:{callee:"Should use 'fetch' instead"}},create:e=>({ImportDeclaration(t){let r=t.source.value;("axios"===r||"request"===r)&&e.report({node:t,messageId:"callee"})},NewExpression(t){var r;((function({callee:e}){return j(e,"XMLHttpRequest")})(t)||j((r=t).callee,"ActiveXObject")&&F(r.arguments[0],/xmlhttp/i))&&e.report({node:t,messageId:"callee"})},CallExpression(t){((function({callee:e}){let t="$http";return j(e,t)||k(e)&&j(e.object,t)})(t)||function({callee:e,parent:t}){let r=["$","jQuery"];return j(e,r)&&k(t)&&j(t.property,"load")||k(e)&&j(e.object,r)&&j(e.property,["ajax","get","post","getJSON","getScript"])}(t)||ei(t,"axios")||ei(t,"request"))&&e.report({node:t,messageId:"callee"})}})});function ei(e,t){return j(e.callee,"require")&&F(e.arguments[0],t)}let es=new i(["setTimeout","setInterval","requestAnimationFrame","requestIdleCallback"]);var el=P({name:"prefer-timer-id",meta:{type:"problem",docs:{description:"Enforce best practice with timer function",recommended:"recommended"},schema:[],messages:{assign:"Timer id should assign to an identifier or member for cleaning up, `const timer = {{name}}(...);`",fix:"Assign timer id to a variable"},hasSuggestions:!0},create:e=>({CallExpression(t){"Identifier"!==t.callee.type||!es.has(t.callee.name)||function(e){if(!j(e.callee,"setTimeout"))return!1;let t=e.arguments[1];return!t||F(t,0)}(t)||t.parent?.type==="AssignmentExpression"&&t.parent.right===t||t.parent?.type==="VariableDeclarator"&&t.parent.init===t||e.report({node:t,messageId:"assign",data:{name:t.callee.name},suggest:[{messageId:"fix",fix:e=>e.insertTextBefore(t,"const timer = ")}]})}})}),eu=P({name:"string/no-unneeded-to-string",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow `String#toString()` when simpler alternatives exist",recommended:"stylistic",requiresTypeChecking:!0},schema:[],messages:{invalid:"Disallow use `.toString()` in string"}},create(e){L(e.sourceCode.parserServices);let{program:t,esTreeNodeToTSNodeMap:r}=e.sourceCode.parserServices,n=t.getTypeChecker();return{CallExpression(t){if("MemberExpression"!==t.callee.type)return;let{object:o,property:a}=t.callee;(j(a,"toString")||F(a,"toString"))&&function(e,t){let r=e.getTypeAtLocation(t);if(r.isStringLiteral()||"string"===e.typeToString(r))return!0;let n=r.getSymbol();return n&&"String"===e.symbolToString(n)}(n,r.get(o))&&e.report({node:a,messageId:"invalid",fix:r=>r.replaceText(t,e.sourceCode.getText(o))})}}}}),ep=P({name:"type/no-force-cast-via-top-type",meta:{type:"problem",docs:{description:"Disallowing cast a type `T` to unrelated or incompatible type `Q` via `T as any as Q`",recommended:"recommended"},schema:[],messages:{invalid:"Don't cast this expression to another type by `as {{type}} as T`"}},create:e=>({TSAsExpression(t){var r,n;if("TSAnyKeyword"!==(r=t.typeAnnotation).type&&"TSUnknownKeyword"!==r.type||!((n=t.parent)&&"TSAsExpression"===n.type&&"TSTypeReference"===n.typeAnnotation.type))return;let o="TSAnyKeyword"===t.typeAnnotation.type?"any":"unknown";e.report({node:t,messageId:"invalid",data:{type:o}})}})});let ec=new i(["BigInt","Boolean","Number","String","Symbol"]);var ed=P({name:"type/no-wrapper-type-reference",meta:{type:"problem",fixable:"code",docs:{description:"Disallow wrapper type for type reference",recommended:"recommended"},schema:[],messages:{instead:"Use {{name}} instead"}},create:e=>({TSTypeReference(t){if("Identifier"!==t.typeName.type||!ec.has(t.typeName.name))return;let r=t.typeName.name.toLowerCase();e.report({node:t,messageId:"instead",data:{name:r},fix:e=>e.replaceText(t.typeName,r)})}})}),em=P({name:"no-default-error",meta:{type:"problem",docs:{description:"Restrict the usage of default (unextended) error",recommended:"strict",requiresTypeChecking:!0},schema:[],messages:{invalid:"Default error object should not be used in this project"}},create(e){L(e.sourceCode.parserServices);let{esTreeNodeToTSNodeMap:t,program:r}=e.sourceCode.parserServices,n=r.getTypeChecker();function o(r){"ErrorConstructor"===function(e,t){let r=e.getTypeAtLocation(t).getSymbol();if(!r?.valueDeclaration)return;let n=e.getTypeOfSymbolAtLocation(r,r.valueDeclaration);return e.typeToString(n)}(n,t.get(r))&&e.report({node:r,messageId:"invalid"})}return{ThrowStatement(e){e.argument&&o(e.argument)},NewExpression:o,CallExpression:o}}});let ef=/\.(?:[cm]?ts|tsx)$/i,eg=/\.d\.(?:[cm]?ts|ts)$/i;var ey=P({name:"require-project-reference",meta:{type:"problem",docs:{description:"Require project references for local package imports",requiresTypeChecking:!0},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string"},uniqueItems:!0}},additionalProperties:!1}],messages:{missingReference:"This local package is not covered by a project reference. Add its project to this tsconfig.json references and enable declarationMap."},defaultOptions:[{ignore:[]}]},create(e,[{ignore:t}]){L(e.sourceCode.parserServices);let{esTreeNodeToTSNodeMap:r,program:n}=e.sourceCode.parserServices;return{ImportDeclaration(o){var a,i,s,l,u;if(!(!(a=o.source.value).startsWith(".")&&!a.startsWith("/")&&!a.startsWith("node:"))||t.some(e=>o.source.value.startsWith(e)))return;let p=r.get(o.source),c=n.getResolvedModuleFromModuleSpecifier(p)?.resolvedModule;if(!c)return;let d=eh(c.resolvedFileName);if(!d.split(/[\\/]/).includes("node_modules")){if(i=n,s=d,!i.getRootFileNames().some(e=>eh(e)===s)){if(eg.test(d)){let e,t=(l=n,u=c.resolvedFileName,(e=function(e){return e}(l)).getRedirectFromOutput(e.getCanonicalFileName(u)));if(t&&ef.test(t.source)&&ex(n,eh(t.source)))return}else if(!ef.test(d))return;else if(ex(n,d))return;e.report({node:o.source,messageId:"missingReference"})}}}}}});function eh(e){try{return m.realpathSync.native(e)}catch{return e}}function ex(e,t){return e.getResolvedProjectReferences()?.some(e=>e?.commandLine.fileNames.some(e=>eh(e)===t))??!1}let eb={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportExpression:["source"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};for(let e of Object.keys(eb))Object.freeze(eb[e]);Object.freeze(eb);let eE=new i(["parent","leadingComments","trailingComments"]);function ev(e){return!eE.has(e)&&"_"!==e[0]}function eS(e,t){let r="",n=e;for("string"==typeof t?r=t:(r=t.name,n=function(e,t){let r=t.range[0],n=e,o=!1;do for(let e of(o=!1,n.childScopes)){let t=e.block.range;if(t[0]<=r&&r<t[1]){n=e,o=!0;break}}while(o);return n}(n,t));null!=n;){let e=n.set.get(r);if(null!=e)return e;n=n.upper}return null}function eC(e,t){return"Punctuator"===e.type&&e.value===t}function eD(e){return eC(e,"=>")}function eT(e){return eC(e,",")}function eA(e){return eC(e,";")}function ew(e){return eC(e,":")}function ek(e){return eC(e,"(")}function eI(e){return eC(e,")")}function ej(e){return eC(e,"{")}function eF(e){return["Block","Line","Shebang"].includes(e.type)}let eB=e=>!eA(e);function eR(e,t){let r=e.parent,n=null,o=null;if("ArrowFunctionExpression"===e.type){let r=t.getTokenBefore(e.body,eD);n=r.loc.start,o=r.loc.end}else{var a,i;n=r&&("Property"===r.type||"MethodDefinition"===r.type||"PropertyDefinition"===r.type)?r.loc.start:e.loc.start,o=(a=e,i=t,a.id?i.getTokenAfter(a.id,ek):i.getFirstToken(a,ek)).loc.start}return{start:{...n},end:{...o}}}let eP="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},eL=Object.freeze(new i(["Array","ArrayBuffer","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","Float32Array","Float64Array","Function","Infinity","Int16Array","Int32Array","Int8Array","isFinite","isNaN","isPrototypeOf","JSON","Map","Math","NaN","Number","Object","parseFloat","parseInt","Promise","Proxy","Reflect","RegExp","Set","String","Symbol","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","undefined","unescape","WeakMap","WeakSet"])),eN=new i([Array.isArray,Array.of,Array.prototype.at,Array.prototype.concat,Array.prototype.entries,Array.prototype.every,Array.prototype.filter,Array.prototype.find,Array.prototype.findIndex,Array.prototype.flat,Array.prototype.includes,Array.prototype.indexOf,Array.prototype.join,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.slice,Array.prototype.some,Array.prototype.toString,Array.prototype.values,"function"==typeof BigInt?BigInt:void 0,Boolean,Date,Date.parse,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,escape,isFinite,isNaN,isPrototypeOf,Map,Map.prototype.entries,Map.prototype.get,Map.prototype.has,Map.prototype.keys,Map.prototype.values,...Object.getOwnPropertyNames(Math).filter(e=>"random"!==e).map(e=>Math[e]).filter(e=>"function"==typeof e),Number,Number.isFinite,Number.isNaN,Number.parseFloat,Number.parseInt,Number.prototype.toExponential,Number.prototype.toFixed,Number.prototype.toPrecision,Number.prototype.toString,Object,Object.entries,Object.is,Object.isExtensible,Object.isFrozen,Object.isSealed,Object.keys,Object.values,parseFloat,parseInt,RegExp,Set,Set.prototype.entries,Set.prototype.has,Set.prototype.keys,Set.prototype.values,String,String.fromCharCode,String.fromCodePoint,String.raw,String.prototype.at,String.prototype.charAt,String.prototype.charCodeAt,String.prototype.codePointAt,String.prototype.concat,String.prototype.endsWith,String.prototype.includes,String.prototype.indexOf,String.prototype.lastIndexOf,String.prototype.normalize,String.prototype.padEnd,String.prototype.padStart,String.prototype.slice,String.prototype.startsWith,String.prototype.substr,String.prototype.substring,String.prototype.toLowerCase,String.prototype.toString,String.prototype.toUpperCase,String.prototype.trim,String.prototype.trimEnd,String.prototype.trimLeft,String.prototype.trimRight,String.prototype.trimStart,Symbol.for,Symbol.keyFor,unescape].filter(e=>"function"==typeof e)),e$=new i([Object.freeze,Object.preventExtensions,Object.seal]),eM=[[Map,new i(["size"])],[RegExp,new i(["dotAll","flags","global","hasIndices","ignoreCase","multiline","source","sticky","unicode"])],[Set,new i(["size"])]];function eO(e,t){let r=[];for(let n=0;n<e.length;++n){let o=e[n];if(null==o)r.length=n+1;else if("SpreadElement"===o.type){let e=eU(o.argument,t);if(null==e)return null;r.push(...e.value)}else{let e=eU(o,t);if(null==e)return null;r.push(e.value)}}return r}let eq=Object.freeze({ArrayExpression(e,t){let r=eO(e.elements,t);return null!=r?{value:r}:null},AssignmentExpression:(e,t)=>"="===e.operator?eU(e.right,t):null,BinaryExpression(e,t){if("in"===e.operator||"instanceof"===e.operator)return null;let r=eU(e.left,t),n=eU(e.right,t);if(null!=r&&null!=n)switch(e.operator){case"==":return{value:r.value==n.value};case"!=":return{value:r.value!=n.value};case"===":return{value:r.value===n.value};case"!==":return{value:r.value!==n.value};case"<":return{value:r.value<n.value};case"<=":return{value:r.value<=n.value};case">":return{value:r.value>n.value};case">=":return{value:r.value>=n.value};case"<<":return{value:r.value<<n.value};case">>":return{value:r.value>>n.value};case">>>":return{value:r.value>>>n.value};case"+":return{value:r.value+n.value};case"-":return{value:r.value-n.value};case"*":return{value:r.value*n.value};case"/":return{value:r.value/n.value};case"%":return{value:r.value%n.value};case"**":return{value:r.value**n.value};case"|":return{value:r.value|n.value};case"^":return{value:r.value^n.value};case"&":return{value:r.value&n.value}}return null},CallExpression(e,t){let r=e.callee,n=eO(e.arguments,t);if(null!=n)if("MemberExpression"===r.type){if("PrivateIdentifier"===r.property.type)return null;let o=eU(r.object,t);if(null!=o){if(null==o.value&&(o.optional||e.optional))return{value:void 0,optional:!0};let a=eW(r,t);if(null!=a){let e=o.value,t=a.value;if(eN.has(e[t]))return{value:e[t](...n)};if(e$.has(e[t]))return{value:n[0]}}}}else{let o=eU(r,t);if(null!=o){if(null==o.value&&e.optional)return{value:void 0,optional:!0};let t=o.value;if(eN.has(t))return{value:t(...n)};if(e$.has(t))return{value:n[0]}}}return null},ConditionalExpression(e,t){let r=eU(e.test,t);return null!=r?r.value?eU(e.consequent,t):eU(e.alternate,t):null},ExpressionStatement:(e,t)=>eU(e.expression,t),Identifier(e,t){if(null!=t){let r=eS(t,e);if(null!=r){if(null!=r&&0===r.defs.length&&eL.has(r.name)&&r.name in eP)return{value:eP[r.name]};if(function(e){let t,r,n;if(1!==e.defs.length)return!1;let o=e.defs[0];return!!(o.parent&&"Variable"===o.type&&("const"===o.parent.kind||(r=(t=e.references).filter(e=>e.init).length,n=t.filter(e=>e.isReadOnly()).length,1===r&&n+r===t.length)))}(r)){let e=r.defs[0];if("Identifier"===e.node.id.type){let n=eU(e.node.init,t);return n&&"object"==typeof n.value&&null!==n.value&&function(e,t){for(let r of e.references){let e=r.identifier;for(;e&&e.parent&&"MemberExpression"===e.parent.type;)e=e.parent;if(e&&e.parent&&("AssignmentExpression"===e.parent.type&&e.parent.left===e||"UpdateExpression"===e.parent.type&&e.parent.argument===e||"CallExpression"===e.parent.type&&e.parent.callee===e&&"MemberExpression"===e.type&&function(e){if(null==e||null==e.value)return!1;let t=e.value;return"copyWithin"===t||"fill"===t||"pop"===t||"push"===t||"reverse"===t||"shift"===t||"sort"===t||"splice"===t||"unshift"===t}(eW(e,t))))return!0}return!1}(r,t)?null:n}}}}return null},Literal:e=>(null!=e.regex||null!=e.bigint)&&null==e.value?null:{value:e.value},LogicalExpression(e,t){let r=eU(e.left,t);if(null!=r){if("||"===e.operator&&!0==!!r.value||"&&"===e.operator&&!1==!!r.value||"??"===e.operator&&null!=r.value)return r;let n=eU(e.right,t);if(null!=n)return n}return null},MemberExpression(e,t){if("PrivateIdentifier"===e.property.type)return null;let r=eU(e.object,t);if(null!=r){if(null==r.value&&(r.optional||e.optional))return{value:void 0,optional:!0};let n=eW(e,t);if(null!=n){let e;if(null==(e=function(e,t){let r=e;for(;("object"==typeof r||"function"==typeof r)&&null!==r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=Object.getPrototypeOf(r)}return null}(r.value,n.value))||null==e.get)return{value:r.value[n.value]};for(let[e,t]of eM)if(r.value instanceof e&&t.has(n.value))return{value:r.value[n.value]}}}return null},ChainExpression(e,t){let r=eU(e.expression,t);return null!=r?{value:r.value}:null},NewExpression(e,t){let r=eU(e.callee,t),n=eO(e.arguments,t);if(null!=r&&null!=n){let e=r.value;if(eN.has(e))return{value:new e(...n)}}return null},ObjectExpression(e,t){let r={};for(let n of e.properties)if("Property"===n.type){if("init"!==n.kind)return null;let e=eW(n,t),o=eU(n.value,t);if(null==e||null==o)return null;r[e.value]=o.value}else{if("SpreadElement"!==n.type&&"ExperimentalSpreadProperty"!==n.type)return null;let e=eU(n.argument,t);if(null==e)return null;Object.assign(r,e.value)}return{value:r}},SequenceExpression:(e,t)=>eU(e.expressions[e.expressions.length-1],t),TaggedTemplateExpression(e,t){let r=eU(e.tag,t),n=eO(e.quasi.expressions,t);if(null!=r&&null!=n){let t=r.value,o=e.quasi.quasis.map(e=>e.value.cooked);if(o.raw=e.quasi.quasis.map(e=>e.value.raw),t===String.raw)return{value:t(o,...n)}}return null},TemplateLiteral(e,t){let r=eO(e.expressions,t);if(null!=r){let t=e.quasis[0].value.cooked;for(let n=0;n<r.length;++n)t+=r[n],t+=e.quasis[n+1].value.cooked;return{value:t}}return null},UnaryExpression(e,t){if("delete"===e.operator)return null;if("void"===e.operator)return{value:void 0};let r=eU(e.argument,t);if(null!=r)switch(e.operator){case"-":return{value:-r.value};case"+":return{value:+r.value};case"!":return{value:!r.value};case"~":return{value:~r.value};case"typeof":return{value:typeof r.value}}return null},TSAsExpression:(e,t)=>eU(e.expression,t),TSSatisfiesExpression:(e,t)=>eU(e.expression,t),TSTypeAssertion:(e,t)=>eU(e.expression,t),TSNonNullExpression:(e,t)=>eU(e.expression,t),TSInstantiationExpression:(e,t)=>eU(e.expression,t)});function eU(e,t){return null!=e&&Object.hasOwnProperty.call(eq,e.type)?eq[e.type](e,t):null}function eW(e,t){let r="Property"===e.type?e.key:e.property;return e.computed?eU(r,t):"Identifier"===r.type?{value:r.name}:"Literal"===r.type?r.bigint?{value:r.bigint}:{value:String(r.value)}:null}function eV(e,t=null){try{return eU(e,t)}catch(e){return null}}function e_(e,t=null){if(e&&"Literal"===e.type&&null===e.value){if(e.regex)return`/${e.regex.pattern}/${e.regex.flags}`;if(e.bigint)return e.bigint}let r=eV(e,t);if(r)try{return String(r.value)}catch{}return null}function ez(e,t){switch(e.type){case"MemberExpression":if(e.computed)return e_(e.property,t);if("PrivateIdentifier"===e.property.type)break;return e.property.name;case"Property":case"MethodDefinition":case"PropertyDefinition":if(e.computed)return e_(e.key,t);if("Literal"===e.key.type)return String(e.key.value);if("PrivateIdentifier"===e.key.type)break;return e.key.name}return null}function eK(e,t){let r=e.parent;if(!r)return"";let n=[],o="Property"===r.type&&r.value===e,a="MethodDefinition"===r.type&&r.value===e,i="PropertyDefinition"===r.type&&r.value===e;if((a||i)&&(r.static&&n.push("static"),"PrivateIdentifier"===r.key.type&&n.push("private")),e.async&&n.push("async"),e.generator&&n.push("generator"),o||a){if("constructor"===r.kind)return"constructor";"get"===r.kind?n.push("getter"):"set"===r.kind?n.push("setter"):n.push("method")}else i?n.push("method"):("ArrowFunctionExpression"===e.type&&n.push("arrow"),n.push("function"));if(o||a||i)if("PrivateIdentifier"===r.key.type)n.push(`#${r.key.name}`);else{let e=ez(r);if(e)n.push(`'${e}'`);else if(t){let e=t.getText(r.key);e.includes("\n")||n.push(`[${e}]`)}}else e.id?n.push(`'${e.id.name}'`):"VariableDeclarator"===r.type&&r.id&&"Identifier"===r.id.type?n.push(`'${r.id.name}'`):("AssignmentExpression"===r.type||"AssignmentPattern"===r.type)&&r.left&&"Identifier"===r.left.type?n.push(`'${r.left.name}'`):"ExportDefaultDeclaration"===r.type&&r.declaration===e&&n.push("'default'");return n.join(" ")}let eG=Object.freeze(new i(["==","!=","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","|","^","&","in"])),eJ=Object.freeze(new i(["-","+","!","~"]));function eX(e){return null!==e&&"object"==typeof e&&"string"==typeof e.type}let eY=Object.freeze(Object.assign(Object.create(null),{$visit(e,t,r){let{type:n}=e;return"function"==typeof this[n]?this[n](e,t,r):this.$visitChildren(e,t,r)},$visitChildren(e,t,r){let{type:n}=e;for(let o of r[n]||Object.keys(e).filter(ev)){let n=e[o];if(Array.isArray(n)){for(let e of n)if(eX(e)&&this.$visit(e,t,r))return!0}else if(eX(n)&&this.$visit(n,t,r))return!0}return!1},ArrowFunctionExpression:()=>!1,AssignmentExpression:()=>!0,AwaitExpression:()=>!0,BinaryExpression(e,t,r){return!!(t.considerImplicitTypeConversion&&eG.has(e.operator))&&("Literal"!==e.left.type||"Literal"!==e.right.type)||this.$visitChildren(e,t,r)},CallExpression:()=>!0,FunctionExpression:()=>!1,ImportExpression:()=>!0,MemberExpression(e,t,r){return!!t.considerGetters||!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.property.type||this.$visitChildren(e,t,r)},MethodDefinition(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},NewExpression:()=>!0,Property(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},PropertyDefinition(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},UnaryExpression(e,t,r){return!!("delete"===e.operator||t.considerImplicitTypeConversion&&eJ.has(e.operator)&&"Literal"!==e.argument.type)||this.$visitChildren(e,t,r)},UpdateExpression:()=>!0,YieldExpression:()=>!0}));function eH(e,t,r={}){let{considerGetters:n=!1,considerImplicitTypeConversion:o=!1}=r;return eY.$visit(e,{considerGetters:n,considerImplicitTypeConversion:o},t.visitorKeys||eb)}function eQ(e,t,r){let n,o,a,i,s;if("number"==typeof e){if(n=0|e,o=t,a=r,!(n>=1))throw TypeError("'times' should be a positive integer.")}else n=1,o=e,a=t;if(null==o||null==o.parent||"CatchClause"===o.parent.type&&o.parent.param===o)return!1;i=s=o;do i=a.getTokenBefore(i),s=a.getTokenAfter(s);while(null!=i&&null!=s&&ek(i)&&eI(s)&&i!==function(e,t){let r=e.parent;if(!r)return null;switch(r.type){case"CallExpression":case"NewExpression":if(1===r.arguments.length&&r.arguments[0]===e)return t.getTokenAfter(r.typeArguments||r.typeParameters||r.callee,ek);return null;case"DoWhileStatement":if(r.test===e)return t.getTokenAfter(r.body,ek);return null;case"IfStatement":case"WhileStatement":if(r.test===e)return t.getFirstToken(r,1);return null;case"ImportExpression":if(r.source===e)return t.getFirstToken(r,1);return null;case"SwitchStatement":if(r.discriminant===e)return t.getFirstToken(r,1);return null;case"WithStatement":if(r.object===e)return t.getFirstToken(r,1);return null;default:return null}}(o,a)&&--n>0);return 0===n}let eZ=/^(?:Import|Export(?:All|Default|Named))Declaration$/u,e0=Function.call.bind(Object.hasOwnProperty),e1=Symbol("read"),e2=Symbol("call"),e3=Symbol("construct"),e8=Symbol("esm"),e6={require:{[e2]:!0}};function e9(e){return null==e||0!==e.defs.length||e.references.some(e=>e.isWrite())}class e5{constructor(e,t={}){let{mode:r="strict",globalObjectNames:n=["global","globalThis","self","window"]}=t;this.variableStack=[],this.globalScope=e,this.mode=r,this.globalObjectNames=n.slice(0)}*iterateGlobalReferences(e){for(let t of Object.keys(e)){let r=e[t],n=[t],o=this.globalScope.set.get(t);e9(o)||(yield*this._iterateVariableReferences(o,n,r,!0))}for(let t of this.globalObjectNames){let r=[],n=this.globalScope.set.get(t);e9(n)||(yield*this._iterateVariableReferences(n,r,e,!1))}}*iterateCjsReferences(e){for(let{node:t}of this.iterateGlobalReferences(e6)){let r=e_(t.arguments[0]);if(null==r||!e0(e,r))continue;let n=e[r],o=[r];n[e1]&&(yield{node:t,path:o,type:e1,info:n[e1]}),yield*this._iteratePropertyReferences(t,o,n)}}*iterateEsmReferences(e){for(let t of this.globalScope.block.body){if(!eZ.test(t.type)||null==t.source)continue;let r=t.source.value;if(!e0(e,r))continue;let n=e[r],o=[r];if(n[e1]&&(yield{node:t,path:o,type:e1,info:n[e1]}),"ExportAllDeclaration"===t.type)for(let e of Object.keys(n)){let r=n[e];r[e1]&&(yield{node:t,path:o.concat(e),type:e1,info:r[e1]})}else for(let e of t.specifiers){let t=e0(n,e8),r=this._iterateImportReferences(e,o,t?n:"legacy"===this.mode?{default:n,...n}:{default:n});if(t)yield*r;else for(let e of r)e.path=e.path.filter(e4),(e.path.length>=2||e.type!==e1)&&(yield e)}}}*iteratePropertyReferences(e,t){yield*this._iteratePropertyReferences(e,[],t)}*_iterateVariableReferences(e,t,r,n){if(!this.variableStack.includes(e)){this.variableStack.push(e);try{for(let o of e.references){if(!o.isRead())continue;let e=o.identifier;n&&r[e1]&&(yield{node:e,path:t,type:e1,info:r[e1]}),yield*this._iteratePropertyReferences(e,t,r)}}finally{this.variableStack.pop()}}}*_iteratePropertyReferences(e,t,r){let n=e;for(;function(e){let t=e.parent;if(t)switch(t.type){case"ConditionalExpression":return t.consequent===e||t.alternate===e;case"LogicalExpression":case"ChainExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":case"TSInstantiationExpression":return!0;case"SequenceExpression":return t.expressions[t.expressions.length-1]===e}return!1}(n);)n=n.parent;let o=n.parent;if(o){if("MemberExpression"===o.type){if(o.object===n){let e=ez(o);if(null==e||!e0(r,e))return;t=t.concat(e);let n=r[e];n[e1]&&(yield{node:o,path:t,type:e1,info:n[e1]}),yield*this._iteratePropertyReferences(o,t,n)}return}if("CallExpression"===o.type){o.callee===n&&r[e2]&&(yield{node:o,path:t,type:e2,info:r[e2]});return}if("NewExpression"===o.type){o.callee===n&&r[e3]&&(yield{node:o,path:t,type:e3,info:r[e3]});return}if("AssignmentExpression"===o.type){o.right===n&&(yield*this._iterateLhsReferences(o.left,t,r),yield*this._iteratePropertyReferences(o,t,r));return}if("AssignmentPattern"===o.type){o.right===n&&(yield*this._iterateLhsReferences(o.left,t,r));return}"VariableDeclarator"===o.type&&o.init===n&&(yield*this._iterateLhsReferences(o.id,t,r))}}*_iterateLhsReferences(e,t,r){if("Identifier"===e.type){let n=eS(this.globalScope,e);null!=n&&(yield*this._iterateVariableReferences(n,t,r,!1));return}if("ObjectPattern"===e.type){for(let n of e.properties){let e=ez(n);if(null==e||!e0(r,e))continue;let o=t.concat(e),a=r[e];a[e1]&&(yield{node:n,path:o,type:e1,info:a[e1]}),yield*this._iterateLhsReferences(n.value,o,a)}return}"AssignmentPattern"===e.type&&(yield*this._iterateLhsReferences(e.left,t,r))}*_iterateImportReferences(e,t,r){let n=e.type;if("ImportSpecifier"===n||"ImportDefaultSpecifier"===n){let o="ImportDefaultSpecifier"===n?"default":"Identifier"===e.imported.type?e.imported.name:e.imported.value;if(!e0(r,o))return;t=t.concat(o);let a=r[o];a[e1]&&(yield{node:e,path:t,type:e1,info:a[e1]}),yield*this._iterateVariableReferences(eS(this.globalScope,e.local),t,a,!1);return}if("ImportNamespaceSpecifier"===n)return void(yield*this._iterateVariableReferences(eS(this.globalScope,e.local),t,r,!1));if("ExportSpecifier"===n){let n="Identifier"===e.local.type?e.local.name:e.local.value;if(!e0(r,n))return;t=t.concat(n);let o=r[n];o[e1]&&(yield{node:e,path:t,type:e1,info:o[e1]})}}}function e4(e,t){return 1!==t||"default"!==e}e5.READ=e1,e5.CALL=e2,e5.CONSTRUCT=e3,e5.ESM=e8;let e7=Symbol("SYNTAX_OPENING_PARENTHESIS_INITIAL_VALUE");function*te(e,t){if(!e||!e.parent||"CatchClause"===e.parent.type&&e.parent.param===e)return;let r=e7,n=[e,e];for(;n=function([e,t],r){let n=r.sourceCode.getTokenBefore(e);if(!n||!ek(n))return;let o=r.sourceCode.getTokenAfter(t);if(o&&eI(o))return[n,o]}(n,t);){let[o]=n;if(r===e7&&(r=function(e,t){let{parent:r}=e;switch(r.type){case"CallExpression":case"NewExpression":if(1===r.arguments.length&&r.arguments[0]===e)return t.sourceCode.getTokenAfter(r.typeArguments??r.callee,ek);return;case"DoWhileStatement":if(r.test===e)return t.sourceCode.getTokenAfter(r.body,ek);return;case"IfStatement":case"WhileStatement":if(r.test===e)return t.sourceCode.getFirstToken(r,1);return;case"ImportExpression":if(r.source===e)return t.sourceCode.getFirstToken(r,1);return;case"SwitchStatement":if(r.discriminant===e)return t.sourceCode.getFirstToken(r,1);return;case"WithStatement":if(r.object===e)return t.sourceCode.getFirstToken(r,1)}}(e,t)),o===r)break;yield n}}let tt=new s;function tr(e,t){if(!e||!tt.has(e)){let r=[];for(let[n,o]of te(e,t))r.unshift(n),r.push(o);tt.set(e,r)}return tt.get(e)}function tn(e,t){let r=tr(e,t),[n]=t.sourceCode.getRange(r[0]??e),[,o]=t.sourceCode.getRange(r.at(-1)??e);return[n,o]}function to(e,t){let[r,n]=tn(e,t);return t.sourceCode.text.slice(r,n)}function ta(e,t){if(tt.has(e))return tt.get(e).length>0;let r=te(e,t).next().done;return r&&tt.set(e,[]),!r}function ti(e,t){return e?.type==="Literal"&&e.value===t}let ts=e=>e?.type==="Literal"&&"string"==typeof e.value,tl=(e,t)=>e?.type==="Literal"&&"boolean"==typeof e.value&&(void 0===t||e.value===t),tu=e=>ts(e)?e.value:e?.type==="TemplateLiteral"&&0===e.expressions.length?e.quasis[0].value.cooked:void 0,tp=e=>"Literal"===e.type&&"number"==typeof e.value,tc=e=>"Literal"===e.type&&!!e.regex,td=e=>e?.type==="Literal"&&"null"===e.raw,tm=e=>"Literal"===e.type&&!!e.bigint;function tf(e,t,r){return t?"Identifier"===e.type&&e.name===t:!Array.isArray(r)||0===r.length||"Identifier"===e.type&&r.includes(e.name)}let tg={},ty=["CallExpression"],th=["NewExpression"],tx=["CallExpression","NewExpression"];function tb(e,t,r){if(!r.includes(e?.type))return!1;"string"==typeof t?t={names:[t]}:Array.isArray(t)&&(t={names:t});let{name:n,names:o,argumentsLength:a,minimumArguments:i=0,maximumArguments:s=1/0,allowSpreadElement:l=!1,optional:u}=t??tg;if(!0===u&&e.optional!==u||!1===u&&e.optional||"number"==typeof a&&e.arguments.length!==a||0!==i&&e.arguments.length<i||Number.isFinite(s)&&e.arguments.length>s)return!1;if(!l){let t=Number.isFinite(s)?s:a;if("number"==typeof t&&e.arguments.some((e,r)=>"SpreadElement"===e.type&&r<t))return!1}return tf(e.callee,n,o)}let tE=(e,t)=>{if("boolean"==typeof t?.optional)throw TypeError("Cannot check node.optional in `isNewExpression`.");return tb(e,t,th)},tv=e=>"ExpressionStatement"===e.type&&"string"==typeof e.directive;function tS(e,t){let{type:r}=e;return"BlockStatement"===r?e.body.every(e=>tS(e,t)):"EmptyStatement"===r||!!t?.(e)}let tC=e=>"ArrayExpression"===e.type&&0===e.elements.length,tD=e=>"ObjectExpression"===e.type&&0===e.properties.length;function tT(e){return"ExpressionStatement"===e.type||"ChainExpression"===e.type&&"ExpressionStatement"===e.parent.type}let tA=["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"];function tw(e){return tA.includes(e.type)}let tk=["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"];function tI(e){return tk.includes(e.type)}let tj={};function tF(e,t){if(e?.type!=="MemberExpression")return!1;"string"==typeof t?t={properties:[t]}:Array.isArray(t)&&(t={properties:t});let{property:r,properties:n,object:o,objects:a,optional:i,computed:s}=t??tj;if(!0===i&&e.optional!==i||!1===i&&e.optional)return!1;if(r||Array.isArray(n)&&n.length>0){if(!tf(e.property,r,n))return!1;s??=!1}return(!0!==s||e.computed===s)&&(!1!==s||!e.computed)&&tf(e.object,o,a)}let tB={};function tR(e,t){return e?.type==="CallExpression"&&"MemberExpression"===e.callee.type&&("string"==typeof t?t={methods:[t]}:Array.isArray(t)&&(t={methods:t}),tb(e,{argumentsLength:(t??=tB).argumentsLength,minimumArguments:t.minimumArguments,maximumArguments:t.maximumArguments,allowSpreadElement:t.allowSpreadElement,optional:t.optionalCall},ty)&&tF(e.callee,{object:t.object,objects:t.objects,computed:t.computed,property:t.method,properties:t.methods,optional:t.optionalMember}))}function tP(e){return e?.type==="UnaryExpression"&&"-"===e.operator&&tp(e.argument)&&1===e.argument.value}function tL(e,t=[]){if("Identifier"!==e.type)return!1;let r=Array.isArray(t)?t:[t];return(!(r.length>0)||!!r.includes(e.name))&&!function(e){let{parent:t}=e;switch(t.type){case"MemberExpression":return!t.computed&&t.property===e;case"FunctionDeclaration":case"FunctionExpression":return t.params.includes(e)||t.id===e;case"ArrowFunctionExpression":return t.params.includes(e);case"ClassDeclaration":case"ClassExpression":case"VariableDeclarator":case"TSDeclareFunction":case"TSEnumMember":case"TSTypeAliasDeclaration":return t.id===e;case"PropertyDefinition":case"MethodDefinition":return!t.computed&&t.key===e;case"Property":return!t.computed&&t.key===e&&("ObjectExpression"===t.parent.type||"ObjectPattern"===t.parent.type)&&t.parent.properties.includes(t)||t.value===e&&"ObjectPattern"===t.parent.type&&t.parent.properties.includes(t);case"ArrayPattern":return t.elements.includes(e);case"LabeledStatement":case"ContinueStatement":case"BreakStatement":return t.label===e;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":return t.local===e;case"ExportAllDeclaration":return t.exported===e;case"ImportSpecifier":return t.local===e||t.imported===e;case"ExportSpecifier":return t.local===e||t.exported===e;case"TSIndexSignature":return t.parameters.includes(e);case"TSTypeParameter":return t.name===e;case"TSMappedType":case"TSPropertySignature":return t.key===e}return!1}(e)}let tN=e=>tb(e,{name:"require",argumentsLength:1,optional:!1},ty)&&ts(e.arguments[0]);function t$(e,t){let r=t.trim().split(".");for(let t=r.length-1;t>=0;t--){let n=r[t];if(!n)return!1;if(0===t)return"Identifier"===e.type&&e.name===n||"this"===n&&"ThisExpression"===e.type||"super"===n&&"Super"===e.type;if(1===t&&"MetaProperty"===e.type&&"Identifier"===e.property.type&&e.property.name===n){e=e.meta;continue}if("MemberExpression"===e.type&&!e.optional&&!e.computed&&"Identifier"===e.property.type&&e.property.name===n){e=e.object;continue}return!1}}function tM(e,t){return t.some(t=>t$(e,t))}function tO(e,t){return"TemplateLiteral"===e.type&&"TaggedTemplateExpression"===e.parent.type&&e.parent.quasi===e&&(!t||tM(e.parent.tag,t))}function tq(e){return e?.type==="Identifier"&&"undefined"===e.name}let tU=(e,t)=>(function(e,t){let{object:r,property:n,properties:o}={property:"",properties:[],...t};if(!tF(e,{property:n,properties:o,optional:!1}))return;let a=e.object;return tF(a,{object:r,property:"prototype",optional:!1})||"Array"===r&&tC(a)||"Object"===r&&tD(a)})(e,{...t,object:"Array"}),tW=e=>e?.type==="LogicalExpression"&&("&&"===e.operator||"||"===e.operator),tV=e=>e?.type==="UnaryExpression"&&"!"===e.operator,t_=e=>tV(e.parent)&&e.parent.argument===e,tz=(e,t)=>tK(e.parent,t)&&e.parent.arguments[0]===e,tK=(e,t)=>e?.type==="CallExpression"&&!e.optional&&"Identifier"===e.callee.type&&"Boolean"===e.callee.name&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type&&((e,t)=>{let{sourceCode:r}=t;if(r.isGlobalReference(e))return!0;let n=eS(r.getScope(e),e);return!n||0===n.defs.length})(e.callee,t);function tG(e,t){return!!(tV(e)||t_(e)||tK(e,t)||tz(e,t))||!!tW(e.parent)&&tG(e.parent,t)}function tJ(e){let t;return t=e.parent,!!(t?.type==="VExpressionContainer"&&"VAttribute"===t.parent.type&&t.parent.directive&&t.parent.value===t&&"VDirectiveKey"===t.parent.key.type&&"VIdentifier"===t.parent.key.name.type&&["if","else-if","show"].includes(t.parent.key.name.rawName)||["IfStatement","ConditionalExpression","WhileStatement","DoWhileStatement","ForStatement"].includes(e.parent.type)&&e.parent.test===e)||!!tW(e.parent)&&tJ(e.parent)}function tX(e,{test:t,expected:r,ruleId:n}){if(t?.(e)||(r=(r=Array.isArray(r)?r:[r]).map(e=>"string"==typeof e?{value:e}:e),!t&&r.some(t=>Object.entries(t).every(([t,r])=>e[t]===r))))return;let o=`'${JSON.stringify({value:e.value,type:e.type})}'`;r=r.map(e=>`'${JSON.stringify(e)}'`).join(" or ");let a=`\`${n}\`: Unexpected token ${o}`,i=`https://github.com/sindresorhus/eslint-plugin-unicorn/issues/new?title=${encodeURIComponent(a)}`;throw Error(`Expected token ${r}, got ${o}.
2
- Please open an issue at ${i}.`)}function tY(e,t){if("AwaitExpression"===e.type||"YieldExpression"===e.type||"ForOfStatement"===e.type&&e.await)return!0;if(tw(e))return!1;for(let r of t[e.type]??[]){let n=e[r];for(let e of Array.isArray(n)?n:[n])if(e?.type&&tY(e,t))return!0}return!1}let tH={"\n":String.raw`\n`,"\r":String.raw`\r`," ":String.raw`\t`,"\b":String.raw`\b`,"\f":String.raw`\f`,"\v":String.raw`\v`,"\0":String.raw`\u{0}`};function tQ(e,t="'"){if("string"!=typeof e)throw TypeError("Unexpected string.");return function(e,t="'"){if("string"!=typeof e)throw TypeError("Expected a string.");if("'"!==t&&'"'!==t)throw TypeError("Expected `quote` to be either `'` or `\"`.");let r=[...e].map(e=>{if("\\"===e)return String.raw`\\`;if(e===t)return`\\${t}`;let r=e.codePointAt(0);return r<=31||127===r||8232===r||8233===r||r>=55296&&r<=57343?tH[e]??String.raw`\u{${r.toString(16)}}`:e}).join("");return`${t}${r}${t}`}(e,t)}let tZ=["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","implements","interface","let","package","private","protected","public","static","arguments","eval"],t0=["globalThis","Infinity","NaN","undefined"];function t1({includeGlobalProperties:e=!1}={}){return new i([...tZ,...e?t0:[]])}let t2=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*/u,t3=`(?!(?:${[...t1({includeGlobalProperties:!0})].join("|")})(?![$_\\p{ID_Continue}]))`,t8=new o,t6=new f.Script("returnValue = functionToRun()"),t9=Symbol.for("worker"),t5=Symbol.for("events");class t4{constructor(){Object.defineProperty(this,t5,{value:new o})}dispatchEvent(e){if(e.target=e.currentTarget=this,this["on"+e.type])try{this["on"+e.type](e)}catch(e){console.error(e)}let t=this[t5].get(e.type);null!=t&&t.forEach(t=>{try{t.call(this,e)}catch(e){console.error(e)}})}addEventListener(e,t){let r=this[t5].get(e);r||this[t5].set(e,r=[]),r.push(t)}removeEventListener(e,t){let r=this[t5].get(e);if(r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}}function t7(e,t){this.type=e,this.timeStamp=Date.now(),this.target=this.currentTarget=this.data=null}var re="function"==typeof Worker?Worker:b.isMainThread?rr():function(){if("function"==typeof global.WorkerGlobalScope)return;let{mod:e,name:t,type:r}=b.workerData;if(!e)return rr();let n=global.self=global,o=[];function a(){let e=o;o=null,e.forEach(e=>{n.dispatchEvent(e)})}b.parentPort.on("message",e=>{let t=new t7("message");t.data=e,null==o?n.dispatchEvent(t):o.push(t)}),b.parentPort.on("error",e=>{e.type="Error",n.dispatchEvent(e)});class i extends t4{postMessage(e,t){b.parentPort.postMessage(e,t)}close(){process.exit()}importScripts(){for(let t=0;t<arguments.length;t++){let r,n=arguments[t];r=/^data:/.test(n)?ro(n).data:h.readFileSync(new g.URL(y.posix.normalize(n),g.pathToFileURL(e)),"utf-8"),x.runInThisContext(r,{filename:n})}}}let s=Object.getPrototypeOf(global);delete s.constructor,Object.defineProperties(i.prototype,s),s=Object.setPrototypeOf(global,new i),["postMessage","addEventListener","removeEventListener","dispatchEvent"].forEach(e=>{s[e]=s[e].bind(global)}),global.name=t,global.WorkerGlobalScope=i;let l=/^data:/.test(e);if("module"===r)import(l?e:g.pathToFileURL(e)).catch(r=>{if(l&&"Not supported"===r.message)return console.warn("Worker(): Importing data: URLs requires Node 12.10+. Falling back to classic worker."),rn(e,t);console.error(r)}).then(a);else{try{/^data:/.test(e)?rn(e,t):global.importScripts(e)}catch(e){console.error(e)}Promise.resolve().then(a)}}();let rt=g.pathToFileURL(process.cwd()+"/");function rr(){class e extends t4{constructor(e,t){let r;super();let{name:n,type:o}=t||{};e+="",r=/^data:/.test(e)?e:g.fileURLToPath(new g.URL(e,rt));let a=new b.Worker(g.fileURLToPath("u"<typeof document?require("url").pathToFileURL(__filename).href:T&&"SCRIPT"===T.tagName.toUpperCase()&&T.src||new URL("index.cjs",document.baseURI).href),{workerData:{mod:r,name:n,type:o}});Object.defineProperty(this,t9,{value:a}),a.on("message",e=>{let t=new t7("message");t.data=e,this.dispatchEvent(t)}),a.on("error",e=>{e.type="error",this.dispatchEvent(e)}),a.on("exit",()=>{this.dispatchEvent(new t7("close"))})}postMessage(e,t){this[t9].postMessage(e,t)}terminate(){this[t9].terminate()}}return e.prototype.onmessage=e.prototype.onerror=e.prototype.onclose=null,e}function rn(e,t){let{data:r}=ro(e);return x.runInThisContext(r,{filename:"worker.<"+(t||"data:")+">"})}function ro(e){let[t,r,n,o]=e.match(/^data: *([^;,]*)(?: *; *([^,]*))? *,(.*)$/)||[];if(!t)throw Error("Invalid Data URL.");if(o=decodeURIComponent(o),n)if("base64"===n.toLowerCase())o=Buffer.from(o,"base64").toString();else throw Error('Unknown Data URL encoding "'+n+'"');return{type:r,data:o}}class ra extends Error{constructor(e){super(e),this.name="TimeoutError"}}class ri extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}let rs=e=>void 0===globalThis.DOMException?new ri(e):new DOMException(e),rl=e=>{let t=void 0===e.reason?rs("This operation was aborted."):e.reason;return t instanceof Error?t:rs(t)};function ru(e,t,r){"function"==typeof r&&(r={filter:r});let n=function(e,t,r){let n,o=new Promise((o,a)=>{if(!((r={rejectionEvents:["error"],multiArgs:!1,resolveImmediately:!1,...r}).count>=0&&(1/0===r.count||Number.isInteger(r.count))))throw TypeError("The `count` option should be at least 0 or more");r.signal?.throwIfAborted();let i=[t].flat(),s=[],{addListener:l,removeListener:u}=(e=>{let t=e.addEventListener||e.on||e.addListener,r=e.removeEventListener||e.off||e.removeListener;if(!t||!r)throw TypeError("Emitter is not compatible");return{addListener:t.bind(e),removeListener:r.bind(e)}})(e),p=(...e)=>{let t=r.multiArgs?e:e[0];(!r.filter||r.filter(t))&&(s.push(t),r.count===s.length&&(n(),o(s)))},c=e=>{n(),a(e)};for(let e of(n=()=>{for(let e of i)u(e,p);for(let e of r.rejectionEvents)u(e,c)},i))l(e,p);for(let e of r.rejectionEvents)l(e,c);r.signal&&r.signal.addEventListener("abort",()=>{c(r.signal.reason)},{once:!0}),r.resolveImmediately&&o(s)});if(o.cancel=n,"number"==typeof r.timeout){let e=function(e,t){let r,n,{milliseconds:o,fallback:a,message:i,customTimers:s={setTimeout,clearTimeout}}=t,l=new Promise((l,u)=>{if("number"!=typeof o||1!==Math.sign(o))throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${o}\``);if(t.signal){let{signal:e}=t;e.aborted&&u(rl(e)),n=()=>{u(rl(e))},e.addEventListener("abort",n,{once:!0})}if(1/0===o)return void e.then(l,u);let p=new ra;r=s.setTimeout.call(void 0,()=>{if(a){try{l(a())}catch(e){u(e)}return}"function"==typeof e.cancel&&e.cancel(),!1===i?l():i instanceof Error?u(i):(p.message=i??`Promise timed out after ${o} milliseconds`,u(p))},o),(async()=>{try{l(await e)}catch(e){u(e)}})()}).finally(()=>{l.clear(),n&&t.signal&&t.signal.removeEventListener("abort",n)});return l.clear=()=>{s.clearTimeout.call(void 0,r),r=void 0},l}(o,{milliseconds:r.timeout});return e.cancel=n,e}return o}(e,t,r={...r,count:1,resolveImmediately:!1}),o=n.then(e=>e[0]);return o.cancel=n.cancel,o}let rp=!!globalThis.process?.versions?.node;function rc(e){let t,r;if(rp){let t;r=new re((t=globalThis.Buffer.from(e).toString("base64"),`data:text/javascript;base64,${t}`),{type:"module"})}else r=new re(t=URL.createObjectURL(new globalThis.Blob([e],{type:"text/javascript"})),{type:"module"});return{worker:r,cleanup:()=>{t&&URL.revokeObjectURL(t),r?.terminate()}}}function rd(e){let t=`
3
- globalThis.onmessage = async ({data: arguments_}) => {
4
- try {
5
- const output = await (${e.toString()})(...arguments_);
6
- globalThis.postMessage({output});
7
- } catch (error) {
8
- globalThis.postMessage({error});
9
- }
10
- };
11
- `;async function r({worker:e,arguments_:t}){let n=ru(e,"message",{rejectionEvents:["error","messageerror"]});e.postMessage(t);let{data:{output:o,error:a}}=await n;if(a)throw a;return o}let n=async(...e)=>{let{worker:n,cleanup:o}=rc(t);try{return await r({arguments_:e,worker:n})}finally{o()}};return n.withSignal=e=>async(...n)=>{e.throwIfAborted();let{worker:o,cleanup:a}=rc(t),i=ru(e,[],{rejectionEvents:["abort"]});try{return await Promise.race([r({arguments_:n,worker:o}),i])}catch(t){throw e.throwIfAborted(),t}finally{i.cancel(),a()}},n}let rm={};function rf(e,{checkReserved:t=!0}={}){if("string"!=typeof e)throw TypeError(`Expected a string, got \`${typeof e}\`.`);return!(e.length>1e5)&&function(e,t,{timeout:r,throwOnTimeout:n}={}){try{return(function(e,{timeout:t,context:r=f.createContext()}={}){let n=(...n)=>(r.functionToRun=()=>e(...n),t6.runInNewContext(r,{timeout:t}),r.returnValue);return Object.defineProperty(n,"name",{value:`functionTimeout(${e.name||"<anonymous>"})`,configurable:!0}),n})(()=>structuredClone(e).test(t),{timeout:(e=>{if(void 0===e||Number.isNaN(e))return;let t=Math.max(1,Math.trunc(Math.abs(e)));if(Number.isFinite(t))return t})(r),context:rm})()}catch(e){if(e?.code==="ERR_SCRIPT_EXECUTION_TIMEOUT"&&!n)return!1;throw e}}(function({exact:e=!0,checkReserved:t=!0}={}){let r=`${e}${t}`,n=t8.get(r);if(!n){let o=`(?<![@#$_\\p{ID_Continue}\\p{ID_Start}])${t?t3:""}${t2.source}`;n=RegExp(e?`^${o}$`:o,"u"),t8.set(r,n)}return n}({checkReserved:t}),e,{timeout:1e3})}function rg(e,t){for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}}rd((e,t,r)=>new a(e,t).test(r)),rd((e,t,r)=>{let n=new a(e,t).exec(r);if(null!==n)return{match:n[0],index:n.index,groups:n.slice(1),namedGroups:n.groups??{},input:n.input}}),t=function*(e,t,r){let n=new a(e,t);for(let e of r.matchAll(n))yield{match:e[0],index:e.index,groups:e.slice(1),namedGroups:e.groups??{},input:e.input}},r=`
12
- const nothing = Symbol('nothing');
13
- let iterator = nothing;
14
-
15
- globalThis.onmessage = async ({data: arguments_}) => {
16
- try {
17
- if (iterator === nothing) {
18
- iterator = await (${t.toString()})(...arguments_);
19
- }
20
-
21
- const output = await iterator.next();
22
- globalThis.postMessage({output});
23
- } catch (error) {
24
- globalThis.postMessage({error});
25
- }
26
- };
27
- `,e=>(...t)=>({async *[Symbol.asyncIterator](){e.throwIfAborted();let{worker:n,cleanup:o}=rc(r),a=ru(e,[],{rejectionEvents:["abort"]});try{let e=!0;for(;;){let r=Promise.race([ru(n,"message",{rejectionEvents:["error","messageerror"]}),a]);n.postMessage(e?t:void 0),e=!1;let{data:{output:o,error:i}}=await r;if(i)throw i;let{value:s,done:l}=o;if(l)break;yield s}}catch(t){throw e.throwIfAborted(),t}finally{a.cancel(),o()}}});let ry=e=>[e,...e.childScopes.flatMap(e=>ry(e))],rh=e=>[...new i(ry(e).flatMap(({references:e})=>e))],rx=new i(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","as","implements","interface","let","package","private","protected","public","static","yield","any","boolean","constructor","declare","get","module","require","number","set","string","symbol","type","from","of"]),rb=e=>"string"==typeof e&&rf(e)&&!rx.has(e),rE=(e,t)=>t.every(t=>!(rg(e,t)||rh(t).some(({identifier:t,resolved:r})=>t?.name===e&&!r))),rv=()=>!0;function rS(e,t,r=rv){if(rb(e)||rb(e+="_")){for(;!rE(e,t)||!r(e,t);)e+="_";return e}}function rC(e,t){if(e.arguments.length>0)return!0;let{sourceCode:r}=t,[n,o]=r.getLastTokens(e,2);return ek(n)&&eI(o)&&r.getRange(e.callee)[1]<r.getRange(e)[1]}function rD(e,t){let{sourceCode:r}=t,n=e.typeArguments??e.callee,o=r.getTokenAfter(n,ek),[a,i]=r.getLastTokens(e,2);return{openingParenthesisToken:o,closingParenthesisToken:i,trailingCommaToken:eT(a)?a:void 0}}function rT(e,t,r=!0){let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a,trailingCommaToken:i}=rD(t,e),[,s]=n.getRange(o),[l]=n.getRange(r?a:i??a);return n.text.slice(s,l)}function rA(e){let t;switch(e?.type){case"MemberExpression":t=e.property;break;case"ChainExpression":return rA(e.expression);case"Property":case"MethodDefinition":t=e.key}if(t){if("Identifier"===t.type&&!e.computed)return t.name;let r=eV(t);if(!r)return;return String(r.value)}}function rw(e){return["ChainExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?rw(e.expression):e}function rk(e,t){if(e=rw(e),t=rw(t),e.type!==t.type)return!1;switch(e.type){case"Super":case"ThisExpression":return!0;case"Identifier":case"PrivateIdentifier":return e.name===t.name;case"Literal":var r,n;return r=e,n=t,r.regex||n.regex?!!(r.regex&&n.regex&&r.regex.pattern===n.regex.pattern&&r.regex.flags===n.regex.flags):r.bigint||n.bigint?r.bigint===n.bigint:r.value===n.value;case"MemberExpression":{let r=rA(e);if(void 0!==r)return rk(e.object,t.object)&&r===rA(t);return e.computed===t.computed&&rk(e.object,t.object)&&rk(e.property,t.property)}default:return!1}}let rI=e=>null===e||"object"!=typeof e&&"function"!=typeof e,rj=(e,t)=>{if(!e)return{value:void 0};let{sourceCode:r}=t,n=eV(e,r.getScope(e));if(n&&rI(n.value))return{value:n.value}},rF=(e,t,r)=>{let n=rj(e,r),o=rj(t,r);if(n&&o){let e,t;return(e=n.value)===(t=o.value)||"number"==typeof e&&"number"==typeof t&&Number.isNaN(e)&&Number.isNaN(t)}return!!e&&!!t&&"Literal"!==e.type&&"Literal"!==t.type&&rk(e,t)},rB=(e,t)=>{let r=[],n=[];for(let o of e)o?.type!=="SpreadElement"&&(r.some(e=>rF(e,o,t))&&n.push(o),r.push(o));return n};function rR(e,t){let{sourceCode:r}=t,{start:{line:n,column:o}}=r.getLoc(e);return r.getLines()[n-1].slice(0,o).match(/\s*$/)[0]}let rP=new i(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),rL=e=>rP.has(e?.type);function rN(e){for(;rL(e);)e=e.expression;return e}function r$(e){return rf(e,{checkReserved:!1})}function rM(e){let{sourceCode:t}=e,r=t.getAllComments?.();return r?.length?r:t.comments??[]}let rO=(e,t)=>Array.isArray(t)?t:e.sourceCode.getRange(t),rq=([e,t],[r,n])=>e>=r&&t<=n;function rU(e,t,r=[]){let{sourceCode:n}=e,o=rO(e,t),a=r.map(t=>rO(e,t));return rM(e).some(e=>{let t=n.getRange(e);return rq(t,o)&&a.every(e=>!rq(t,e))})}function rW(e,t){let{sourceCode:r}=e,n=r.getLoc(t).end.line;return r.getCommentsAfter(t).findLast(e=>r.getLoc(e).start.line===n)}let rV=(e,[t,r])=>{let{sourceCode:n}=e;return n.getAllComments().some(e=>{let[o,a]=n.getRange(e);return o>=t&&a<=r})},r_=new i(["ClassDeclaration","FunctionDeclaration","TSEnumDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSTypeAliasDeclaration"]),rz=e=>"VariableDeclaration"===e.type&&"var"!==e.kind||r_.has(e.type),rK=e=>rz(e)||"BlockStatement"===e.type&&e.body.some(e=>rz(e)),rG=(e,t)=>{let{sourceCode:r}=t;return r.getTokens(e).some(e=>r.getLoc(e).start.line!==r.getLoc(e).end.line)};function rJ(e,t){if("Identifier"!==e.type)return;let r=eS(t.sourceCode.getScope(e),e);if(!r||1!==r.defs.length)return;let[n]=r.defs;if("Variable"===n.type&&"VariableDeclarator"===n.node.type&&"VariableDeclaration"===n.parent.type&&"const"===n.parent.kind)return n.node.init}function rX(e,t){let{sourceCode:r}=t,[,n]=tn(e.object,t);return[n,e.computed?r.getRange(r.getTokenBefore(e.property,e=>"["===e.value))[1]:r.getRange(e.property)[0]]}let rY=new i(["depth","height","width"]);function rH(e){return tF(e,{properties:["length","size"],optional:!1})}function rQ(e){return/\.(?:ts|mts|cts|tsx)$/i.test(e)}let rZ=["Program","StyleSheet","Document","root"];function r0(e,t){let{sourceCode:r}=e;return r.parserServices.getTemplateBodyTokenStore&&r.ast.templateBody&&r.getRange(r.ast.templateBody)[0]<=r.getRange(t)[0]&&r.getRange(t)[1]<=r.getRange(r.ast.templateBody)[1]?r.parserServices.getTemplateBodyTokenStore():r}let r1=({identifiers:e,references:t})=>[...new i([...e,...t.map(({identifier:e})=>e)])];function r2(e,t){if(!e)return!1;if("ThisExpression"===e.type||"Super"===e.type||"MetaProperty"===e.type&&"new"===e.meta.name&&"target"===e.property.name||"Identifier"===e.type&&"arguments"===e.name||"CallExpression"===e.type&&"Identifier"===e.callee.type&&"eval"===e.callee.name)return!0;for(let r of t[e.type]??[]){let n=e[r];if(Array.isArray(n)){for(let e of n)if(r2(e,t))return!0}else if(r2(n,t))return!0}return!1}function r3(e){let t;return(e=rN(e),e?.type==="ChainExpression")?r3(e.expression):(t=e,(t?.type==="MemberExpression"||t?.type==="CallExpression")&&(!!e.optional||("MemberExpression"===e.type?r3(e.object):r3(e.callee))))}let r8=(e,t)=>{let{references:r=[]}=eS(e,t)||{};return r};function r6(e,t){if(t.block!==e)throw Error('"functionScope" should be the scope of "functionNode".');let{type:r,id:n}=e;return"ArrowFunctionExpression"!==r&&(!!(t.thisFound||r8(t,"arguments").some(({from:e})=>e===t))||!!(n&&r8(t,n).length>0))}let r9=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],r5=new i(["any","error","unknown"]),r4=new i(["null","undefined"]),r7=e=>e.getSymbol()??e.aliasSymbol,ne=(e,t)=>e?.declarations?.some(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))??!1;function nt(e,t){try{return t.getBaseTypes(e)??e.getBaseTypes?.()??[]}catch{return[]}}let nr="target",nn="non-target",no="nullish",na="unknown",ni=new i(["ClassDeclaration","ClassExpression"]),ns=new i(["FunctionDeclaration","FunctionExpression"]),nl=new i(["ClassName","ImportBinding","TSEnumName","Type"]),nu=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNumberKeyword","TSStringKeyword","TSSymbolKeyword","TSVoidKeyword","TSArrayType","TSLiteralType","TSTupleType","TSTypeLiteral","TSFunctionType","TSConstructorType"]),np=new i(["TSNullKeyword","TSUndefinedKeyword"]),nc=e=>e===no?nn:e,nd=(e,t)=>0===(e=t.allowNullishInMixedUnion?e.filter(e=>e!==no):e.map(nc)).length?nn:(t.treatMixedUnionAsTarget?e.includes(nr):e.every(e=>e===nr))?nr:(t.treatMixedUnionAsNonTarget?e.includes(nn):e.every(e=>e===nn))?nn:na,nm=e=>(e=e.map(nc)).includes(nr)?nr:e.every(e=>e===nn)?nn:na,nf=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>nl.has(e.type));if(r)return r;t=t.upper}},ng=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=ng(e.left);return t?`${t}.${e.right.name}`:void 0}},ny=(e,t)=>{let r=t.typeReferenceAliases?.get(e);return t.targetTypeNames.has(e)||r&&t.targetTypeNames.has(r)?nr:t.nonTargetTypeNames?.has(e)?nn:na},nh=(e,t,r)=>{let{source:n,importedName:o,localName:a}=e,i=t?.get(n);return i?i.has(o)?nr:nn:t&&((e,t)=>{for(let r of t.values())if(r.has(e))return!0;return!1})(o,t)||ny(o,r)!==na||ny(a,r)!==na?nn:na};function nx(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return nx(e.typeAnnotation,t,r,n);case"TSTypeOperator":return"readonly"===e.operator?nx(e.typeAnnotation,t,r,n):na;case"TSTypeReference":return function e(t,r,n,o){var a,i;let s=ng(t.typeName);if(!s)return na;let l=((e,t,r)=>{if("TSQualifiedName"!==e.typeName.type||"Identifier"!==e.typeName.left.type||!r.targetTypeNamespaceImports)return na;let n=e.typeName.right.name,o=nf(e.typeName.left.name,t);return o?.type!=="ImportBinding"||"ImportNamespaceSpecifier"!==o.node.type&&"ImportDefaultSpecifier"!==o.node.type?na:nh({source:o.parent?.source?.value,importedName:n,localName:n},r.targetTypeNamespaceImports,r)})(t,r,n);if(l!==na)return l;if(!n.preferTypeReferenceDefinitions){let e=ny(s,n);if(e!==na)return e}if(o.has(s))return na;o.add(s);let u=nf(s,r);if(!u)return o.delete(s),ny(s,n);let p=na,c=((e,t)=>{if("ImportBinding"!==e.type)return na;if("ImportDefaultSpecifier"===e.node.type)return ny(e.node.local.name,t)===na?na:nn;let r=e.node.imported?.name??e.node.imported?.value;return r?nh({source:e.parent?.source?.value,importedName:r,localName:e.node.local.name},t.targetTypeImports,t):na})(u,n);return c!==na?p=c:"Type"===u.type&&"TSTypeAliasDeclaration"===u.node.type?p=nx(u.node.typeAnnotation,r,n,o):"Type"===u.type&&"TSTypeParameter"===u.node.type?p=nx(u.node.constraint,r,n,o):"Type"===u.type&&"TSInterfaceDeclaration"===u.node.type?(a=u.node,p=0===a.extends.length?nn:nm(a.extends.map(t=>ng(t.expression)?e({typeName:t.expression},r,n,o):na))):"ClassName"===u.type&&(i=u.node,p=i.superClass&&n.checkClassHeritage?"Identifier"!==i.superClass.type?na:nE(i.superClass,r,n,o):nn),o.delete(s),p}(e,t,r,n);case"TSUnionType":return nd(e.types.map(e=>nx(e,t,r,n)),r);case"TSIntersectionType":return nm(e.types.map(e=>nx(e,t,r,n)));default:if(r.isTargetTypeAnnotation?.(e))return nr;if(np.has(e?.type))return no;return nu.has(e?.type)?nn:na}}let nb=(e,t,r,n)=>e.superClass&&r.checkClassHeritage?nE(e.superClass,t,r,n):nn;function nE(e,t,r,n=new i){if("Identifier"===e.type){let o=e.name;if(!r.checkClassHeritage)return ny(o,r);if(n.has(o))return na;n.add(o);let a=((e,t)=>{for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}})(o,t),[i]=a?.defs??[],s=na;return i?.type==="Variable"&&"const"===i.parent.kind&&i.node.id===i.name&&i.node.init?s=nE(i.node.init,t,r,n):i?.type==="ClassName"&&(s=nb(i.node,t,r,n)),n.delete(o),i?s:ny(o,r)}return ni.has(e.type)?nb(e,t,r,n):na}let nv=(e,t,r)=>{let n=e.params.find(e=>"Identifier"===e.type&&"this"===e.name);return nx(n?.typeAnnotation,t.sourceCode.getScope(e),r)};function nS(e,t,r,n=new i){if(!e)return na;if("TSSatisfiesExpression"===e.type)return nS(e.expression,t,r,n);let o=t.sourceCode.getScope(e),a=nx(e.typeAnnotation,o,r);if(a!==na)return a;let s=((e,t,r,n)=>{let o=t.sourceCode.getScope(e);switch(e.type){case"Identifier":return((e,t,r,n)=>{let o=eS(t.sourceCode.getScope(e),e);if(!o||n.has(o)||1!==o.defs.length)return na;n.add(o);let[a]=o.defs,i=t.sourceCode.getScope(a.name),s=nx(a.name?.typeAnnotation,i,r),l=na;return s!==na?l=s:"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&(l=nS(a.node.init,t,r,n)),n.delete(o),l})(e,t,r,n);case"ThisExpression":return r.checkClassSyntax?((e,t,r)=>{for(let{parent:n}=e;n;n=n.parent){if(ni.has(n.type))return nb(n,t.sourceCode.getScope(n),r);if("StaticBlock"===n.type||("AccessorProperty"===n.type||"PropertyDefinition"===n.type)&&n.static)return nn;if(ns.has(n.type)){let e=nv(n,t,r);if(e!==na)return e;if(n.parent?.type==="Property"&&n.parent.parent?.type==="ObjectExpression")return nn;if(n.parent?.type==="MethodDefinition"){if(n.parent.static)return nn;continue}break}}return na})(e,t,r):na;case"Super":return r.checkClassSyntax?((e,t,r)=>{for(let{parent:n}=e;n;n=n.parent){if("StaticBlock"===n.type||("AccessorProperty"===n.type||"PropertyDefinition"===n.type)&&n.static||"MethodDefinition"===n.type&&n.static)return nn;if(ni.has(n.type))return n.superClass?nE(n.superClass,t.sourceCode.getScope(n),r):nn}return na})(e,t,r):na;case"NewExpression":let a;return r.checkClassSyntax?(a=e.callee,nE(a,t.sourceCode.getScope(a),r,void 0)):na;case"TSAsExpression":case"TSTypeAssertion":{let a=nx(e.typeAnnotation,o,r);return a===na?nS(e.expression,t,r,n):a}case"TSNonNullExpression":case"ParenthesizedExpression":return nS(e.expression,t,r,n);case"SequenceExpression":return nS(e.expressions.at(-1),t,r,n);case"ConditionalExpression":return nd([nS(e.consequent,t,r,n),nS(e.alternate,t,r,n)],r);default:return na}})(e,t,r,n);if(s!==na)return s;if("Identifier"!==e.type){let t,n=(t=eV(e,o))?r.getStaticType?.(t.value,e)??na:na;if(n!==na)return n}if(r.isTargetNode?.(e,t)||r.targetConstructorNames?.some(t=>tE(e,{name:t}))||r.targetCallNames?.some(t=>tb(e,{name:t},ty)))return nr;let l=((e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return na;try{let{program:t}=n;return function e(t,r,n,o){if(r5.has(t.intrinsicName))return na;if(r4.has(t.intrinsicName))return no;if(t.isTypeParameter?.()){let a=t.getConstraint();return a?e(a,r,n,o):na}if(t.isUnion())return nd(t.types.map(t=>e(t,r,n,o)),o);if(t.isIntersection())return nm(t.types.map(t=>e(t,r,n,o)));if(o.isTargetType?.(t,r,n))return nr;let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);if(o.checkClassHeritage&&nt(t,r).some(t=>e(t,r,n,o)===nr))return nr;if(t.intrinsicName)return nn;let i=r7(t);if(!i)return na;let s=i.getName(),l=o.typeReferenceAliases?.get(s);return o.targetTypeNames.has(s)||l&&o.targetTypeNames.has(l)?nr:nn}(n.getTypeAtLocation(e),t.getTypeChecker(),t,r)}catch{return na}})(e,t,r);return l!==na?l:r.isNonTargetNode?.(e,t)?nn:na}let nC=e=>(e={checkClassHeritage:!0,checkClassSyntax:!1,...e},{getType:(t,r,n)=>nc(nS(t,r,{...e,...n})),isTarget:(t,r,n)=>nS(t,r,{...e,...n})===nr,isKnownNonTarget:(t,r,n)=>nc(nS(t,r,{...e,...n}))===nn}),nD=({name:e,aliases:t=[],checkConstructor:r=!0,...n})=>nC({...n,targetTypeNames:new i([e]),typeReferenceAliases:new o(t.map(t=>[t,e])),targetConstructorNames:r?[e]:void 0}),nT=new i(["ObjectExpression","FunctionExpression","ArrowFunctionExpression","ClassExpression","TemplateLiteral"]),nA=new i(["Map","ReadonlyMap","WeakMap","Set","ReadonlySet","WeakSet"]),nw=new i(["BigInt64Array","BigUint64Array"]),nk=new i([...r9,...nA]),nI={checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:new i(["Array","ReadonlyArray"]),nonTargetTypeNames:nk,targetCallNames:["Array"],targetConstructorNames:["Array"],isTargetNode:e=>"ArrayExpression"===e.type||tR(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}),isNonTargetNode:e=>"NewExpression"===e.type||nT.has(e.type),isTargetTypeAnnotation:e=>e?.type==="TSArrayType"||e?.type==="TSTupleType",isTargetType:(e,t)=>t.isArrayType(e)||t.isTupleType(e),getStaticType:(e,t)=>Array.isArray(e)?nr:"Identifier"===t.type||"MemberExpression"===t.type?na:nn},{isTarget:nj,isKnownNonTarget:nF}=nC(nI),{isKnownNonTarget:nB}=nC({...nI,targetTypeNames:new i([...nI.targetTypeNames,...r9]),nonTargetTypeNames:nA,targetConstructorNames:["Array",...r9]}),{isTarget:nR}=nC({treatMixedUnionAsTarget:!0,targetTypeNames:nw,targetConstructorNames:[...nw],isTargetNode:e=>tR(e,{objects:[...nw],methods:["from","of"],optionalCall:!1,optionalMember:!1})}),nP=new i(["ArrayExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]);function nL(e,t){return!nP.has(e.type)&&nB(e,t)}let nN=new i(["AnimationEvent","BaseSyntheticEvent","ChangeEvent","ClipboardEvent","CompositionEvent","DragEvent","FocusEvent","FormEvent","InputEvent","InvalidEvent","KeyboardEvent","MouseEvent","PointerEvent","SubmitEvent","SyntheticEvent","TouchEvent","ToggleEvent","TransitionEvent","UIEvent","WheelEvent"]),n$=new i(["AnimationEvent","AnimationPlaybackEvent","AudioProcessingEvent","BeforeUnloadEvent","BlobEvent","ClipboardEvent","CloseEvent","CommandEvent","CompositionEvent","ContentVisibilityAutoStateChangeEvent","CookieChangeEvent","CustomEvent","DeviceMotionEvent","DeviceOrientationEvent","DragEvent","ErrorEvent","Event","ExtendableCookieChangeEvent","ExtendableEvent","ExtendableMessageEvent","FetchEvent","FocusEvent","FontFaceSetLoadEvent","FormDataEvent","GPUUncapturedErrorEvent","GamepadEvent","HashChangeEvent","IDBVersionChangeEvent","InputEvent","KeyboardEvent","MIDIConnectionEvent","MIDIMessageEvent","MediaEncryptedEvent","MediaKeyMessageEvent","MediaQueryListEvent","MediaStreamTrackEvent","MessageEvent","MouseEvent","NavigateEvent","NavigationCurrentEntryChangeEvent","NotificationEvent","OfflineAudioCompletionEvent","PageRevealEvent","PageSwapEvent","PageTransitionEvent","PaymentMethodChangeEvent","PaymentRequestUpdateEvent","PictureInPictureEvent","PointerEvent","PopStateEvent","ProgressEvent","PromiseRejectionEvent","PushEvent","PushSubscriptionChangeEvent","RTCDataChannelEvent","RTCDTMFToneChangeEvent","RTCErrorEvent","RTCPeerConnectionIceErrorEvent","RTCPeerConnectionIceEvent","RTCTrackEvent","RTCTransformEvent","SecurityPolicyViolationEvent","SpeechRecognitionErrorEvent","SpeechRecognitionEvent","SpeechSynthesisErrorEvent","SpeechSynthesisEvent","StorageEvent","SubmitEvent","TaskPriorityChangeEvent","TextEvent","ToggleEvent","TouchEvent","TrackEvent","TransitionEvent","UIEvent","WebGLContextEvent","WheelEvent",...nN]),{isTarget:nM,isKnownNonTarget:nO}=nC({preferTypeReferenceDefinitions:!0,targetTypeImports:new o([["react",nN]]),targetTypeNamespaceImports:new o([["react",nN]]),targetTypeNames:n$}),{isTarget:nq}=nD({name:"Set",aliases:["ReadonlySet"],getStaticType:e=>e instanceof Set?nr:na}),{isTarget:nU}=nD({name:"Map",aliases:["ReadonlyMap"],getStaticType:e=>e instanceof Map?nr:na}),nW=new i(["CharacterData","Document","DocumentFragment","Element","HTMLElement","Node","SVGElement","Text"]),nV=new i(["KeyboardEvent","React.KeyboardEvent"]),n_=new i(["Event","MouseEvent","PointerEvent","React.MouseEvent","React.PointerEvent"]),{isKnownNonTarget:nz}=nC({targetTypeNames:nW,getStaticType:e=>{let{Node:t}=globalThis;return"function"==typeof t&&e instanceof t?nr:na}}),{isKnownNonTarget:nK}=nC({targetTypeNames:nV,nonTargetTypeNames:n_}),nG=e=>("AssignmentExpression"===e.parent.type||"AssignmentPattern"===e.parent.type)&&e.parent.left===e||"UpdateExpression"===e.parent.type&&e.parent.argument===e||"ArrayPattern"===e.parent.type&&e.parent.elements.includes(e)||"RestElement"===e.parent.type&&e.parent.argument===e||"Property"===e.parent.type&&e.parent.value===e&&"ObjectPattern"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent)||"UnaryExpression"===e.parent.type&&"delete"===e.parent.operator&&e.parent.argument===e,nJ=(e,t)=>"CallExpression"===e.type&&!e.optional&&"Identifier"===e.callee.type&&e.callee.name===t,nX=(e,t,r)=>"MemberExpression"===e.type&&!e.computed&&!e.optional&&"Identifier"===e.object.type&&e.object.name===t&&"Identifier"===e.property.type&&r.has(e.property.name),nY=new i(["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"]),nH=new i(["abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","clz32","cos","cosh","exp","expm1","floor","fround","hypot","imul","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc"]),nQ=new i(["EPSILON","MAX_SAFE_INTEGER","MAX_VALUE","MIN_SAFE_INTEGER","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]),nZ=new i(["parseFloat","parseInt"]),n0=e=>e?.type==="TSNumberKeyword"||e?.type==="TSLiteralType"&&tp(e.literal),n1=new i(["-","*","/","%","**","<<",">>","|","^","&"]);function n2(e,t){let r;if(tp(e)||nX(e,"Math",nY)||"CallExpression"===e.type&&!e.optional&&nX(e.callee,"Math",nH)||nJ(e,"Number")||nX(e,"Number",nQ)||"CallExpression"===e.type&&!e.optional&&nX(e.callee,"Number",nZ)||nJ(e,"parseInt")||nJ(e,"parseFloat")||"MemberExpression"===e.type&&!e.computed&&!e.optional&&"Identifier"===e.property.type&&"length"===e.property.name)return!0;switch(e.type){case"AssignmentExpression":{let{operator:r}=e;if("="===r&&n2(e.right,t))return!0}case"BinaryExpression":{let{operator:r}=e;if("AssignmentExpression"===e.type&&(r=r.slice(0,-1)),"+"===r&&n2(e.left,t)&&n2(e.right,t)||">>>"===r||n1.has(r)&&(n2(e.left,t)||n2(e.right,t)))return!0;break}case"UnaryExpression":{let{operator:r}=e;if("+"===r||("-"===r||"~"===r)&&n2(e.argument,t))return!0;break}case"UpdateExpression":if(n2(e.argument,t))return!0;break;case"ConditionalExpression":{let r=n2(e.consequent,t),n=n2(e.alternate,t);if(r&&n)return!0;let o=eV(e.test,t);if(null!==o&&(r&&o.value||n&&!o.value))return!0;break}case"SequenceExpression":if(n2(e.expressions.at(-1),t))return!0;break;case"Identifier":if((r=eS(t,e))&&r.defs.some(e=>n0(e.name?.typeAnnotation?.typeAnnotation)))return!0;break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":if(n0(e.typeAnnotation))return!0;break;case"TSNonNullExpression":if(n2(e.expression,t))return!0}return"number"==typeof eV(e,t)?.value}nC({targetTypeNames:new i,targetCallNames:["Number"],isTargetTypeAnnotation:n0,isTargetType:e=>e.isNumberLiteral?.()||"number"===e.intrinsicName,getStaticType:e=>"number"==typeof e?nr:na});let n3=new i([">",">=","<","<=","==","===","!=","!==","in","instanceof"]),n8=new i(["boolean","true","false"]),n6=new i(["isFinite","isNaN"]),n9=new o([["Array",new i(["isArray"])],["ArrayBuffer",new i(["isView"])],["Atomics",new i(["isLockFree"])],["Error",new i(["isError"])],["Number",new i(["isFinite","isInteger","isNaN","isSafeInteger"])],["Object",new i(["hasOwn","is","isExtensible","isFrozen","isSealed"])],["Reflect",new i(["deleteProperty","has"])],["URL",new i(["canParse"])]]),n5=new o([["array",new i(["every","includes","some"])],["map",new i(["has"])],["regexp",new i(["test"])],["set",new i(["has","isDisjointFrom","isSubsetOf","isSupersetOf"])],["string",new i(["endsWith","includes","isWellFormed","startsWith"])],["weakSet",new i(["has"])]]),n4=new o([["regexp",new i(["dotAll","global","hasIndices","ignoreCase","multiline","sticky","unicode","unicodeSets"])]]);function n7(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{return function e(t,r){if(!t)return!1;if(t.isUnion?.())return t.types.every(t=>e(t,r));let n=r.getBaseConstraintOfType(t);return n&&n!==t?e(n,r):n8.has(r.typeToString(t))}(r.getTypeAtLocation(e),r.program.getTypeChecker())}catch{return!1}}function oe(e,t,r,n){let o=e.filter(e=>"TSCallSignatureDeclaration"===e.type);return o.length>0&&o.every(e=>or(e.returnType,t,r,n))}function ot({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:o}){let a=function(e){if(e?.type==="Identifier")return e.name}(e.typeName);if(!a||n.has(a))return!1;n.add(a);let i=rg(a,r),[s]=i?.defs??[],l=s?.type==="Type"?t.sourceCode.getScope(s.node):r,u=s?.type==="Type"&&o(s.node,l);return n.delete(a),u}function or(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return or(e.typeAnnotation,t,r,n);case"TSBooleanKeyword":return!0;case"TSLiteralType":return"boolean"==typeof e.literal.value;case"TSTypeReference":return ot({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:(e,r)=>"TSTypeAliasDeclaration"===e.type&&or(e.typeAnnotation,t,r,n)});case"TSTypePredicate":return!e.asserts;case"TSUnionType":return e.types.every(e=>or(e,t,r,n));case"TypeAnnotation":return e.typeAnnotation?.type==="BooleanTypeAnnotation";default:return!1}}function on(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return on(e.typeAnnotation,t,r,n);case"TSFunctionType":return or(e.returnType,t,r,n);case"TSTypeLiteral":return oe(e.members,t,r,n);case"TSTypeReference":return ot({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:(e,r)=>"TSTypeAliasDeclaration"===e.type&&on(e.typeAnnotation,t,r,n)||"TSInterfaceDeclaration"===e.type&&oe(e.body.body,t,r,n)});case"TSUnionType":return e.types.every(e=>on(e,t,r,n));default:return!1}}function oo(e,t,r=new i){if(e.async||e.generator)return!1;let n=t.sourceCode.getScope(e);return!!or(e.returnType,t,n)||!!e.body&&("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type?os(e.body.body[0].argument,t,r):"ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type&&os(e.body,t,r))}function oa(e,t,r=new i){if(e?.type!=="Identifier")return!1;let n=eS(t.sourceCode.getScope(e),e);if(!n||r.has(n))return!1;r.add(n);let o=!1;if(n.defs.length>1&&n.defs.every(e=>"FunctionName"===e.type)){let e=n.defs.filter(e=>"TSDeclareFunction"===e.node.type),a=e.length>0?e:n.defs;o=n.references.every(e=>!e.writeExpr)&&a.every(e=>oo(e.node,t,r))}else if(1===n.defs.length){let[e]=n.defs,a=t.sourceCode.getScope(e.name);if(on(e.name?.typeAnnotation,t,a))o=!0;else{let a;"FunctionName"===e.type?n.references.every(e=>!e.writeExpr)&&(a=e.node):"Variable"===e.type&&"const"===e.parent.kind&&["ArrowFunctionExpression","FunctionExpression"].includes(e.node.init?.type)&&(a=e.node.init),o=!!a&&oo(a,t,r)}}return r.delete(n),o}function oi(e,t,r=new i){switch(e?.type){case"ArrayExpression":return"array";case"Literal":return"string"==typeof e.value?"string":e.regex?"regexp":void 0;case"TemplateLiteral":return 0===e.expressions.length?"string":void 0;case"NewExpression":if("Identifier"===e.callee.type&&t.sourceCode.isGlobalReference(e.callee)){if("RegExp"===e.callee.name)return"regexp";if(["Map","WeakMap"].includes(e.callee.name))return"map";if("Set"===e.callee.name)return"set";if("WeakSet"===e.callee.name)return"weakSet"}return;case"Identifier":return function(e,t,r){let n=eS(t.sourceCode.getScope(e),e),[o]=n?.defs??[];if(!n||r.has(n)||1!==n.defs.length||"Variable"!==o.type||"const"!==o.parent.kind)return;r.add(n);let a=oi(o.node.init,t,r);return r.delete(n),a}(e,t,r);case"ParenthesizedExpression":case"TSNonNullExpression":case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":return oi(e.expression,t,r)}}function os(e,t,r=new i){if(!e)return!1;let n=t.sourceCode.getScope(e);return!!or(e.typeAnnotation,t,n)||"boolean"==typeof eV(e,t.sourceCode.getScope(e))?.value||(function(e,t,r){switch(e.type){case"Identifier":return function(e,t,r){if(!e||r.has(e)||1!==e.defs.length)return!1;r.add(e);let[n]=e.defs,o=t.sourceCode.getScope(n.name);if(n.name?.typeAnnotation)return r.delete(e),!n.name.optional&&or(n.name.typeAnnotation,t,o);let a="Variable"===n.type&&"const"===n.parent.kind&&os(n.node.init,t,r);if(!a&&"Parameter"===n.type){let e=n.name.parent;a="AssignmentPattern"===e.type&&e.left===n.name&&n.node.params.includes(e)&&os(e.right,t,r)}return r.delete(e),a}(eS(t.sourceCode.getScope(e),e),t,r)||n7(e,t);case"UnaryExpression":return["!","delete"].includes(e.operator);case"LogicalExpression":return os(e.left,t,r)&&os(e.right,t,r);case"BinaryExpression":return n3.has(e.operator);case"ConditionalExpression":return os(e.consequent,t,r)&&os(e.alternate,t,r);case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":let n;return n=t.sourceCode.getScope(e),or(e.typeAnnotation,t,n)||os(e.expression,t,r);case"CallExpression":return!!(function(e,t){if("MemberExpression"!==e.callee.type||"Identifier"!==e.callee.object.type||!t.sourceCode.isGlobalReference(e.callee.object))return!1;let r=n9.get(e.callee.object.name),n=ez(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t)||function(e,t){if("MemberExpression"!==e.callee.type)return!1;let r=n5.get(oi(e.callee.object,t)),n=ez(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t))||("Identifier"!==e.callee.type?n7(e,t):!!("Boolean"===e.callee.name&&t.sourceCode.isGlobalReference(e.callee)||n6.has(e.callee.name)&&t.sourceCode.isGlobalReference(e.callee))||oa(e.callee,t,r)||n7(e,t));case"MemberExpression":return function(e,t){if("MemberExpression"!==e.type||e.optional)return!1;let r=n4.get(oi(e.object,t)),n=ez(e,t.sourceCode.getScope(e));return!!r?.has(n)}(e,t)||void 0;default:switch(e.type){case"AwaitExpression":case"TSNonNullExpression":case"ParenthesizedExpression":return os(e.argument??e.expression,t,r);case"SequenceExpression":return os(e.expressions.at(-1),t,r);case"AssignmentExpression":return"="===e.operator&&os(e.right,t,r)}return}}(e,t,r)??n7(e,t))}let ol=new i(["asIntN","asUintN"]),ou=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return ou(e.typeAnnotation);case"TSBigIntKeyword":return!0;case"TSLiteralType":return tm(e.literal);default:return!1}},{isTarget:op}=nC({targetTypeNames:new i,targetCallNames:["BigInt"],isTargetNode:e=>tm(e)||nJ(e,"BigInt")||"CallExpression"===e.type&&!e.optional&&nX(e.callee,"BigInt",ol),isTargetTypeAnnotation:ou,isTargetType:e=>e.isBigIntLiteral?.()||"bigint"===e.intrinsicName,getStaticType:e=>"bigint"==typeof e?nr:na}),oc=new i(["fromCharCode","fromCodePoint"]),od=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return od(e.typeAnnotation);case"TSStringKeyword":return!0;case"TSLiteralType":return ts(e.literal);default:return!1}},{isTarget:om,isKnownNonTarget:of}=nC({targetTypeNames:new i,targetCallNames:["String"],isTargetNode:(e,t)=>{if(ts(e)||nJ(e,"String")||"CallExpression"===e.type&&!e.optional&&nX(e.callee,"String",oc))return!0;switch(e.type){case"TemplateLiteral":return!0;case"UnaryExpression":return"typeof"===e.operator;case"BinaryExpression":return"+"===e.operator&&(og(e.left,t)||og(e.right,t));case"AssignmentExpression":if("="===e.operator)return og(e.right,t);return"+="===e.operator&&(og(e.left,t)||og(e.right,t));default:return!1}},isTargetTypeAnnotation:od,isTargetType:e=>e.isStringLiteral?.()||"string"===e.intrinsicName,getStaticType:e=>"string"==typeof e?nr:na});function og(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&od(e.typeAnnotation)||om(e,t))||"string"==typeof eV(e,t.sourceCode.getScope(e))?.value)}let oy=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]),oh=e=>oy.has(e.type)||tq(e),ox=new i(["ArrayExpression","BinaryExpression","ClassExpression","Literal","ObjectExpression","TemplateLiteral","UnaryExpression","UpdateExpression"]),ob=new i(["AssignmentExpression","AwaitExpression","NewExpression","TaggedTemplateExpression","ThisExpression"]),oE=e=>ox.has(e.type)||ob.has(e.type)||tq(e)||tb(e,void 0,ty)&&!tR(e,{method:"bind",optionalCall:!1,optionalMember:!1}),ov=(e,t)=>{if("ThisExpression"===e.type)return!0;if("FunctionDeclaration"===e.type||"FunctionExpression"===e.type)return!1;if("ClassDeclaration"===e.type||"ClassExpression"===e.type){if(e.superClass&&ov(e.superClass,t))return!0;for(let r of e.body.body)if(r.computed&&ov(r.key,t))return!0;return!1}let r=t[e.type];if(!r)return!1;for(let n of r){let r=e[n];if(r){if(Array.isArray(r)){for(let e of r)if(e&&ov(e,t))return!0;continue}if(ov(r,t))return!0}}return!1};function oS(e,t,r){let[n,o]=[e,t].map(e=>r.sourceCode.getLoc(e).start.line);return n===o}function oC(e,t){let r;if(r=e=t.getNonNullableType(e),!r5.has(r.intrinsicName)){if(e.isUnion()){let r=e.types.map(e=>oC(e,t));return!!r.every(Boolean)||!r.every(e=>!1===e)&&void 0}return void 0!==t.getPromisedTypeOfPromise(e)}}let oD=e=>"use"===e||/^use[\dA-Z]/.test(e),oT=(e,t)=>"Identifier"===e.type&&"Identifier"===t.type&&e.name===t.name;function oA(e,t){return"Identifier"===e.type&&(t.sourceCode.isGlobalReference(e)||!eS(t.sourceCode.getScope(e),e))}let ow=e=>rL(e)||e?.type==="TSInstantiationExpression",ok=e=>{for(;ow(e);)e=e.expression;return e},oI=(e,t)=>{let r=ok(e?.callee);return e?.type==="CallExpression"&&r?.type==="MemberExpression"&&!e.optional&&!r.optional&&!r.computed&&"Identifier"===r.object.type&&"process"===r.object.name&&"Identifier"===r.property.type&&"exit"===r.property.name&&oA(r.object,t)},oj=e=>"ReturnStatement"===e.type||"ThrowStatement"===e.type,oF=e=>"ThrowStatement"===e.type,oB=()=>!1,oR=(e,t)=>"SequenceExpression"===e.type?e.expressions.every(e=>oW(e,t)):null!==eV(e,t.sourceCode.getScope(e)),oP=(e,t)=>{let{sourceCode:r}=t,n=eS(r.getScope(e),e.name),o=r.getRange(e)[0];return n?.defs.some(e=>("Variable"===e.type&&e.parent?.kind!=="var"||"ClassName"===e.type||"ImportBinding"===e.type)&&e.name&&r.getRange(e.name)[0]>o)!==!0},oL=(e,t)=>!!eS(t.sourceCode.getScope(e),e.name)&&oP(e,t),oN=(e,t)=>{let r=eV(e,t.sourceCode.getScope(e));return null!==r&&(null===r.value||"function"==typeof r.value)},o$=(e,t)=>{var r;let n;return"MemberExpression"===e.type&&!e.optional&&!oZ(e.object)&&(tC(e.object)||tD(e.object)||null!==(n=eV(r=e.object,t.sourceCode.getScope(r)))&&null!==n.value&&void 0!==n.value)&&(!e.computed||oW(e.property,t))},oM=(e,t)=>{let r,n;return"Identifier"===e.type&&oP(e,t)&&(r=eS(t.sourceCode.getScope(e),e.name),r?.defs.some(e=>"Variable"===e.type&&e.parent?.kind==="const"||"ClassName"===e.type||"ImportBinding"===e.type)!==!0)&&(!(n=t.sourceCode.getScope(e)).isStrict||!!eS(n,e.name))||o$(e,t)},oO=(e,t)=>"Identifier"===e.type&&oL(e,t)||o$(e,t),oq=new i(["+=","-=","*=","/=","%=","**=","<<=",">>=",">>>=","&=","^=","|="]),oU=(e,t)=>{if("="===e.operator){let r;return r=e.left,"Identifier"===r.type||"ArrayPattern"===r.type||"ObjectPattern"===r.type||o$(r,t)}if(oq.has(e.operator))return oO(e.left,t);if(!["&&=","||=","??="].includes(e.operator)||!oO(e.left,t))return!1;let r=eV(e.left,t.sourceCode.getScope(e.left));return null!==r&&("&&="===e.operator?!!r.value:"||="===e.operator?!r.value:null===r.value||void 0===r.value)},oW=(e,t)=>"AssignmentExpression"===e.type?"="===e.operator&&oM(e.left,t)&&oR(e.right,t):oR(e,t),oV=(e,t)=>(e=ok(e),e?.type==="Identifier")?oL(e,t):oW(e,t),o_=e=>"using"===e.kind||"await using"===e.kind,oz=(e,t)=>"ExpressionStatement"===e.type?oW(e.expression,t):"BlockStatement"===e.type?e.body.every(e=>oz(e,t)):"EmptyStatement"===e.type||"FunctionDeclaration"===e.type||"VariableDeclaration"===e.type&&!o_(e)&&e.declarations.every(e=>"Identifier"===e.id.type&&(!e.init||oW(e.init,t))),oK=(e,t,r)=>oz(e,t)||!!r?.isAdditionalStatementDefinitelyNotThrowing?.(e),oG=e=>"ReturnStatement"===e.type&&!e.argument,oJ=(e,t)=>{if("IfStatement"!==e.type||e.alternate||!oW(e.test,t)||!(oG(e.consequent)||"BlockStatement"===e.consequent.type&&1===e.consequent.body.length&&oG(e.consequent.body[0])))return!1;let r=eV(e.test,t.sourceCode.getScope(e.test));return null!==r&&!r.value},oX=(e,t)=>e.declarations.some(e=>e.init&&o2(e.init,t)),oY=(e,t)=>{for(let r of e.declarations)if(r.init){if(o5(r.init,t))return!0;if(o_(e))return!1;if("Identifier"!==r.id.type||!oW(r.init,t))break}return!1},oH=(e,t,r,n={})=>{let{isAdditionalStatementAlwaysExits:o=()=>!1}=n;for(let a of e){if(ad(a,t,r,n)||o(a))return!0;if(!oJ(a,t)&&!oK(a,t,n))break}return!1},oQ=(e,t,r=!0,n)=>!function(e,t){if("StaticBlock"!==e.type)return!1;let r=e,{parent:n}=e;for(;n&&!tw(n);){if("ClassDeclaration"===n.type||"ClassExpression"===n.type)return!!(n.superClass&&n.superClass!==r&&!o5(n.superClass,t)&&!oN(n.superClass,t));r=n,{parent:n}=n}return!1}(e,t)&&oH(e.body,t,r,n);function oZ(e){return e?.type==="MemberExpression"?e.optional||oZ(e.object):e?.type==="CallExpression"&&(e.optional||oZ(e.callee))}function o0(e,t){if(!o9(e,t))return!1;let r=e,{parent:n}=e;for(;n&&!tw(n);){if(("ClassDeclaration"===n.type||"ClassExpression"===n.type)&&n.superClass&&n.superClass!==r&&!o5(n.superClass,t)&&!oN(n.superClass,t)||"CallExpression"===n.type&&n.arguments.includes(r)&&(n.optional||oZ(n.callee))||"MemberExpression"===n.type&&n.computed&&n.property===r&&(n.optional||oZ(n.object)))return!1;r=n,{parent:n}=n}return!0}let o1=(e,t)=>{let r,n=eV(e.left,t.sourceCode.getScope(e.left));if(null===n||!oW(e.left,t))return!1;switch(e.operator){case"&&":r=!!n.value;break;case"||":r=!n.value;break;default:r=null===n.value||void 0===n.value}return r};function o2(e,t){if(oI(e,t))return!0;if(ow(e))return o2(e.expression,t);switch(e?.type){case"ChainExpression":return o2(e.expression,t);case"SpreadElement":case"UnaryExpression":case"AwaitExpression":return o2(e.argument,t);case"CallExpression":case"NewExpression":return!!o2(e.callee,t)||!("CallExpression"===e.type&&(e.optional||oZ(e.callee)))&&!!oV(e.callee,t)&&e.arguments.some(e=>o2(e,t));case"MemberExpression":return o2(e.object,t)||e.computed&&!e.optional&&!oZ(e.object)&&oV(e.object,t)&&o2(e.property,t);case"ArrayExpression":return e.elements.some(e=>e&&o2(e,t));case"ObjectExpression":return e.properties.some(e=>"SpreadElement"===e.type?o2(e.argument,t):e.computed&&o2(e.key,t)||o2(e.value,t));case"YieldExpression":return!!(e.argument&&o2(e.argument,t));case"AssignmentExpression":return o2(e.left,t)||oU(e,t)&&o2(e.right,t);case"ImportExpression":return o2(e.source,t);case"TemplateLiteral":return e.expressions.some(e=>o2(e,t));case"TaggedTemplateExpression":return o2(e.tag,t)||oV(e.tag,t)&&e.quasi.expressions.some(e=>o2(e,t));case"ClassExpression":return am(e,t,!0);case"SequenceExpression":return e.expressions.some(e=>o2(e,t));case"ConditionalExpression":if(o2(e.test,t))return!0;let r=eV(e.test,t.sourceCode.getScope(e.test));return null!==r&&oW(e.test,t)?o2(r.value?e.consequent:e.alternate,t):o2(e.consequent,t)&&o2(e.alternate,t);case"LogicalExpression":return o2(e.left,t)||o1(e,t)&&o2(e.right,t);case"BinaryExpression":return o2(e.left,t)||o2(e.right,t);default:return!1}}function o3(e,t,r){if(!e||tw(e))return!1;if("BreakStatement"===e.type)return e.label?.name===r;if("LabeledStatement"===e.type&&e.label.name===r)return!1;if("IfStatement"===e.type){if(o5(e.test,t))return!1;let n=eV(e.test,t.sourceCode.getScope(e.test));if(null!==n&&oW(e.test,t)){let o=n.value?e.consequent:e.alternate;return!!(o&&o3(o,t,r))}}if(o2(e.expression,t))return!1;if("BlockStatement"===e.type){for(let n of e.body){if(o3(n,t,r))return!0;if(af(n,t))break}return!1}for(let n of t.sourceCode.visitorKeys[e.type]??[]){let o=e[n];if((Array.isArray(o)?o:[o]).some(e=>o3(e,t,r)))return!0}return!1}let o8=(e,t)=>{if("SpreadElement"===e.type)return o5(e.argument,t);if(e.computed){if(o5(e.key,t))return!0;if(!oW(e.key,t))return!1}return o5(e.value,t)},o6=(e,t)=>{for(let r of e)if(r){if(o5(r,t))return!0;if(!oW(r,t))break}return!1},o9=(e,t)=>oI(e,t)&&(e.arguments.every(e=>oW(e,t))||o6(e.arguments,t));function o5(e,t){if(o9(e,t))return!0;if(ow(e))return o5(e.expression,t);switch(e?.type){case"ChainExpression":return o5(e.expression,t);case"SpreadElement":case"UnaryExpression":case"AwaitExpression":return o5(e.argument,t);case"CallExpression":case"NewExpression":return!!o5(e.callee,t)||!("CallExpression"===e.type&&(e.optional||oZ(e.callee)))&&!!oV(e.callee,t)&&o6(e.arguments,t);case"MemberExpression":return o5(e.object,t)||e.computed&&!e.optional&&!oZ(e.object)&&(tC(e.object)||tD(e.object))&&o5(e.property,t);case"ArrayExpression":return o6(e.elements,t);case"ObjectExpression":for(let r of e.properties){if(o8(r,t))return!0;if("SpreadElement"===r.type){if(!oW(r.argument,t))return!1;continue}if(r.computed&&!oW(r.key,t)||!oW(r.value,t))break}return!1;case"ClassExpression":return ac(e,t,!0);case"AssignmentExpression":return o5(e.left,t)||oU(e,t)&&o5(e.right,t);case"TaggedTemplateExpression":return!!o5(e.tag,t)||!!oV(e.tag,t)&&o6(e.quasi.expressions,t);case"YieldExpression":return!!(e.argument&&o5(e.argument,t));case"ImportExpression":return o5(e.source,t);case"TemplateLiteral":case"SequenceExpression":return o6(e.expressions,t);case"LogicalExpression":return!!o5(e.left,t)||o1(e,t)&&o5(e.right,t);case"BinaryExpression":return o5(e.left,t)||oW(e.left,t)&&o5(e.right,t);case"ConditionalExpression":if(o5(e.test,t))return!0;let r=eV(e.test,t.sourceCode.getScope(e.test));return null!==r&&oW(e.test,t)?o5(r.value?e.consequent:e.alternate,t):oV(e.test,t)&&o5(e.consequent,t)&&o5(e.alternate,t);default:return!1}}function o4(e,t,r,n){if(e.finalizer&&af(e.finalizer,t,!0,n))return!0;let o=e.handler?oQ(e.block,t,r,n):af(e.block,t,r,n);return r?!!o||!!(e.handler&&aA(e.block,t,oF)&&af(e.handler,t,!0,n)):o||e.handler&&aA(e.block,t,oF)&&af(e.handler,t,!1,n)}function o7(e,t,r,n){for(let o of e.body){if(af(o,t,r,n))return!0;if(oj(o)||aA(o,t,oj))break}return!1}let ae=(e,t,r,n)=>{let{checkTryStatements:o,enclosingLoop:a,isAtStart:i,isLastStatement:s,options:l,isProcessExitAtTest:u}=n;if("BlockStatement"!==e.type&&(i?ad(e,r,o,l):af(e,r,o,l))||"BlockStatement"!==e.type&&!i&&aA(e,r,oj)&&!("SwitchStatement"===e.type&&aS(e,t,r)))return!0;if(oK(e,r,l)||ay(e,t))return u;if("LabeledStatement"===e.type&&tI(e.body))return ae(e.body,t,r,n);if("IfStatement"===e.type){let o=eV(e.test,r.sourceCode.getScope(e.test));if(null!==o&&oW(e.test,r)){let a=o.value?e.consequent:e.alternate;return a?ae(a,t,r,n):u}return oV(e.test,r)&&ae(e.consequent,t,r,n)&&(e.alternate?ae(e.alternate,t,r,n):u)}if("BlockStatement"!==e.type)return u&&s&&("SwitchStatement"===e.type&&(!o||ai(e,t,r,l))&&!av(e,t,r)||tI(e)&&(!an(e,r)||aa(e,n))&&(!o||au(e,r))&&(!o||ao(e.body,e,n))&&!av(e,t,r));if(i){if(oQ(e,r,o,l)||at(e.body,t,r,n))return!0;let a=e.body.at(-1);return a&&ay(a,t)&&e.body.slice(0,-1).every(e=>oK(e,r,l))?u:1===e.body.length&&ae(e.body[0],t,r,n)}if(e.body.some(e=>aS(e,t,r))){if(at(e.body,t,r,n)||ar(e.body,t,r,n))return!0;let o=e.body.at(-1);return!!(o&&aS(o,t,r)&&ae(o,t,r,n))}return ar(e.body,t,r,n)},at=(e,t,r,n)=>{let{isProcessExitAtTest:o,options:a}=n,i=e.findIndex(e=>aE(e,t,r)),s=-1===i?void 0:e[i];return!!(s&&e.slice(0,i).every(e=>oK(e,r,a))&&o&&(s.alternate?ae(s.alternate,t,r,n):i===e.length-1||ar(e.slice(i+1),t,r,n)))},ar=(e,t,r,n)=>{let{checkTryStatements:o,isAtStart:a,options:i,isProcessExitAtTest:s}=n,l=!1;for(let[u,p]of e.entries()){if(a){if(ad(p,r,o,i))return!0;if(ay(p,t))return s;if(!oK(p,r,i))return!1;continue}if(!oK(p,r,i)){if(aE(p,t,r)&&l)break;if(ae(p,t,r,{...n,isLastStatement:u===e.length-1}))return!0;if(aS(p,t,r))break;l=!0}}return!1},an=(e,t)=>("WhileStatement"===e.type||"ForStatement"===e.type)&&(!e.test||!!eV(e.test,t.sourceCode.getScope(e.test))?.value),ao=(e,t,r)=>{let{context:n,enclosingLoop:o,options:a}=r;if(ah(e,t)||ay(e,t)||o&&ay(e,o)||"EmptyStatement"===e.type)return!0;if("IfStatement"===e.type&&oV(e.test,n))return ao(e.consequent,t,r)&&(!e.alternate||ao(e.alternate,t,r));if("BlockStatement"!==e.type)return!1;let i=e.body.at(-1);return!!(!i||ao(i,t,r)&&e.body.slice(0,-1).every(e=>oK(e,n,a)))},aa=(e,t)=>{let{context:r,enclosingLoop:n}=t;return ao(e.body,e,t)||aA(e.body,r,t=>ah(t,e)||!!(n&&ay(t,n)))},ai=(e,t,r,n)=>{let o=a=>oK(a,r,n)||aC(a,e)||ay(a,t)||"BlockStatement"===a.type&&a.body.length>0&&o(a.body.at(-1))&&a.body.slice(0,-1).every(e=>oK(e,r,n));return oW(e.discriminant,r)&&e.cases.every(e=>(null===e.test||oW(e.test,r))&&e.consequent.every(e=>o(e)))},as=(e,t,r,n)=>an(e,t)&&ad(e.body,t,r,n),al=(e,t)=>"VariableDeclaration"===e.type?oz(e,t):oW(e,t),au=(e,t)=>{let r;return"WhileStatement"===e.type||"DoWhileStatement"===e.type?oV(e.test,t):"ForStatement"===e.type?(!e.init||al(e.init,t))&&(!e.test||oV(e.test,t))&&(!e.update||oW(e.update,t)):("ForInStatement"===e.type||"ForOfStatement"===e.type)&&(r=e.left,"VariableDeclaration"===r.type?oz(r,t):oM(r,t))&&oW(e.right,t)},ap=(e,t,r,{checkTryStatements:n,switchStatement:o,options:a})=>{let i=[];for(let r=t;r<e.length;r++)i.push(...e[r].consequent);return oH(i,r,n,{...a,isAdditionalStatementAlwaysExits:e=>aD(e,o)})},ac=(e,t,r,n)=>{if(e.superClass){if(o5(e.superClass,t))return!0;if(!oN(e.superClass,t))return!1}for(let o of e.body.body){if(o.computed){if(o5(o.key,t))return!0;if(!oW(o.key,t))break}if("StaticBlock"===o.type){if(oQ(o,t,r,n))return!0;if(o.body.some(e=>!oK(e,t,n)))return!1;continue}if("PropertyDefinition"===o.type&&o.static){if(o.value&&o5(o.value,t))return!0;if(o.value&&!oW(o.value,t))break}}return!1};function ad(e,t,r=!0,n){if("ExpressionStatement"===e.type)return o5(e.expression,t);if("VariableDeclaration"===e.type)return oY(e,t);if("ReturnStatement"===e.type||"ThrowStatement"===e.type)return!!(e.argument&&o5(e.argument,t));if("IfStatement"===e.type||"ConditionalExpression"===e.type){var o;if(o5(e.test,t))return!0;let a=eV(e.test,t.sourceCode.getScope(e.test));if(null!==a&&oW(e.test,t)){let o=a.value?e.consequent:e.alternate;return!!(o&&ad(o,t,r,n))}return oV(e.test,t)&&ad(e.consequent,t,r,n)&&!!(e.alternate&&ad(e.alternate,t,r,n))}if("BlockStatement"===e.type)return oQ(e,t,r,n);if("TryStatement"===e.type)return o=n,!!(e.finalizer&&ad(e.finalizer,t,r,o))||(e.finalizer&&o?.isAdditionalStatementAlwaysExits&&!oK(e.finalizer,t,o)&&(o={...o,isAdditionalStatementAlwaysExits:void 0}),e.handler?o4(e,t,r,o):oQ(e.block,t,r,o));if("LabeledStatement"===e.type)return!o3(e.body,t,e.label.name)&&ad(e.body,t,r,n);if(["DoWhileStatement","WhileStatement","ForStatement","ForInStatement","ForOfStatement"].includes(e.type))return"DoWhileStatement"===e.type?ae(e.body,e,t,{checkTryStatements:r,context:t,enclosingLoop:e,isAtStart:!0,isLastStatement:!0,options:n,isProcessExitAtTest:o5(e.test,t)}):((e,t,r,n)=>{if("WhileStatement"===e.type)return o5(e.test,t)||as(e,t,r,n);if("ForStatement"===e.type){if(e.init){let r;if(r=e.init,"VariableDeclaration"===r.type?oY(r,t):o5(r,t))return!0;if(!al(e.init,t))return!1}return!!(e.test&&o5(e.test,t)||an(e,t)&&e.update&&o5(e.update,t)&&oz(e.body,t)||as(e,t,r,n))}return("ForInStatement"===e.type||"ForOfStatement"===e.type)&&o5(e.right,t)})(e,t,r,n);if("SwitchStatement"===e.type){if(o5(e.discriminant,t))return!0;if(!oV(e.discriminant,t))return!1;let o=e.cases.findIndex(e=>e.test&&o5(e.test,t)),a=e.cases.findIndex(e=>null===e.test);for(let[a,i]of e.cases.entries()){if(-1!==o&&a>=o)break;if(null!==i.test&&!oW(i.test,t)||!ap(e.cases,a,t,{checkTryStatements:r,switchStatement:e,options:n}))return!1}return -1!==o||-1!==a&&ap(e.cases,a,t,{checkTryStatements:r,switchStatement:e,options:n})}return"ClassDeclaration"===e.type||"ClassExpression"===e.type?ac(e,t,r,n):af(e,t,r,n)}let am=(e,t,r,n)=>{if(e.superClass){if(o2(e.superClass,t))return!0;if(!oN(e.superClass,t))return!1}return e.body.body.some(e=>!!(e.computed&&o2(e.key,t))||("StaticBlock"===e.type?o7(e,t,r,n):"PropertyDefinition"===e.type&&e.static&&o2(e.value,t)))};function af(e,t,r=!0,n){if("ExpressionStatement"===e.type&&o2(e.expression,t)||o2(e,t)||("ReturnStatement"===e.type||"ThrowStatement"===e.type)&&e.argument&&o2(e.argument,t)||"SwitchStatement"===e.type&&o2(e.discriminant,t))return!0;if("BlockStatement"===e.type)return o7(e,t,r,n);if("CatchClause"===e.type)return af(e.body,t,r,n);if("VariableDeclaration"===e.type)return oX(e,t);if("DoWhileStatement"===e.type)return ae(e.body,e,t,{checkTryStatements:r,context:t,enclosingLoop:e,isAtStart:!1,isLastStatement:!0,options:n,isProcessExitAtTest:o2(e.test,t)});return"WhileStatement"===e.type?o2(e.test,t)||as(e,t,r,n):"ForStatement"===e.type?!!(e.init&&("VariableDeclaration"===e.init.type?oX(e.init,t):o2(e.init,t))||e.test&&o2(e.test,t)||an(e,t)&&e.update&&o2(e.update,t)&&oz(e.body,t)||as(e,t,r,n)):"ForInStatement"===e.type||"ForOfStatement"===e.type?o2(e.right,t):"ClassDeclaration"===e.type||"ClassExpression"===e.type?am(e,t,r,n):"LabeledStatement"===e.type?!o3(e.body,t,e.label.name)&&af(e.body,t,r,n):"TryStatement"===e.type?o4(e,t,r,n):"SwitchStatement"===e.type?aT(e,t,oB,r):!!("IfStatement"===e.type&&o2(e.test,t))||("IfStatement"===e.type||"ConditionalExpression"===e.type)&&e.alternate&&af(e.consequent,t,r,n)&&af(e.alternate,t,r,n)}function ag(e){let t=e.parent;if(e.label){for(;t&&!tw(t);){if("LabeledStatement"===t.type&&t.label.name===e.label.name)return t;t=t.parent}return}let r="BreakStatement"===e.type;for(;t&&!tw(t);){if(r&&(tI(t)||"SwitchStatement"===t.type)||!r&&tI(t))return t;t=t.parent}}function ay(e,t){return"ContinueStatement"===e.type?ax(ag(e),t):"BlockStatement"===e.type&&1===e.body.length&&ay(e.body[0],t)}function ah(e,t){return"BreakStatement"===e.type&&ax(ag(e),t)}function ax(e,t){return e===t||e?.type==="LabeledStatement"&&e.body===t}function ab(e,t){for(let r=t.parent;r;r=r.parent){if(r===e)return!0;if(tw(r))break}return!1}function aE(e,t,r){return"IfStatement"===e.type&&oV(e.test,r)&&ay(e.consequent,t)}function av(e,t,r){if(!e||tw(e))return!1;if("BreakStatement"===e.type||"ContinueStatement"===e.type){let r=ag(e),n=ax(r,t);if("BreakStatement"===e.type&&n||!n&&ab(r,t))return!0}for(let n of r.sourceCode.visitorKeys[e.type]??[]){let o=e[n];if((Array.isArray(o)?o:[o]).some(e=>av(e,t,r)))return!0}return!1}function aS(e,t,r){if(!e||tw(e))return!1;if("BreakStatement"===e.type||"ContinueStatement"===e.type){let r=ag(e);if(ax(r,t)||ab(r,t))return!0}for(let n of r.sourceCode.visitorKeys[e.type]??[]){let o=e[n];if((Array.isArray(o)?o:[o]).some(e=>aS(e,t,r)))return!0}return!1}function aC(e,t){return"BreakStatement"===e.type&&ax(ag(e),t)}function aD(e,t){if("BreakStatement"!==e.type&&"ContinueStatement"!==e.type)return!1;let r=ag(e);return!(!r||ax(r,t))&&ab(r,t)}function aT(e,t,r,n){let o=[],a=r===oB?r:t=>oj(t)||r(t)||aD(t,e),i=!1;for(let s=e.cases.length-1;s>=0;s--){let l=e.cases[s];i=!function e(t,r,n,o){for(let a of t){if(function t(r,n,o,a){if(!r||tw(r))return!1;if("BreakStatement"===r.type&&aC(r,o)||a&&aD(r,o))return!0;if("BlockStatement"===r.type)return e(r.body,n,o,a);if(tI(r)||"SwitchStatement"===r.type)return!1;if("IfStatement"===r.type){if(o5(r.test,n))return!1;let e=eV(r.test,n.sourceCode.getScope(r.test));if(null!==e&&oW(r.test,n)){let i=e.value?r.consequent:r.alternate;return!!(i&&t(i,n,o,a))}}for(let e of n.sourceCode.visitorKeys[r.type]??[]){let i=r[e];if((Array.isArray(i)?i:[i]).some(e=>t(e,n,o,a)))return!0}return!1}(a,r,n,o))return!0;if(oj(a)||aA(a,r,oj)||af(a,r))break}return!1}(l.consequent,t,e,r===oB)&&(l.consequent.some(e=>aA(e,t,a)||af(e,t,n))||i),o[s]=i}let s=e.cases.findIndex(e=>e.test&&o5(e.test,t));return -1!==s?e.cases.every((e,t)=>t>=s||o[t]):e.cases.some(e=>null===e.test)&&o.every(Boolean)}function aA(e,t,r){if(r(e)||af(e,t,!1))return!0;if("BlockStatement"===e.type){let n=e.body.at(-1);return!!(n&&aA(n,t,r))}if("CatchClause"===e.type)return aA(e.body,t,r);if("TryStatement"===e.type)return!!(e.finalizer&&aA(e.finalizer,t,r)||e.handler&&aA(e.block,t,r)&&aA(e.handler,t,r));if("SwitchStatement"===e.type)return aT(e,t,r,!1);if("IfStatement"===e.type||"ConditionalExpression"===e.type){let n=eV(e.test,t.sourceCode.getScope(e.test));if(null!==n&&oW(e.test,t)){let o=n.value?e.consequent:e.alternate;return!!(o&&aA(o,t,r))}}return("IfStatement"===e.type||"ConditionalExpression"===e.type)&&e.alternate&&aA(e.consequent,t,r)&&aA(e.alternate,t,r)}let aw=(e,t,r)=>e&&t&&r.sourceCode.getRange(e)[0]===r.sourceCode.getRange(t)[0]&&r.sourceCode.getRange(e)[1]===r.sourceCode.getRange(t)[1],ak=(e,t)=>{let{type:r,local:n,imported:o}=e.parent;return"ImportSpecifier"===r&&aw(n,o,t)&&n===e},aI=new i(["ArrayExpression","CallExpression","ChainExpression","Identifier","ImportExpression","Literal","MemberExpression","NewExpression","Super","TaggedTemplateExpression","TemplateLiteral","ThisExpression","TSNonNullExpression"]);function aj(e){return aI.has(e.type)}let aF=e=>"Property"===e.parent.type&&e.parent.shorthand&&e===e.parent.value,aB=e=>tT(e.parent),aR=new i(["String","Null","Boolean","Numeric","RegularExpression"]),aP=new i(["[","(","/","`","+","-","*",",","."]);function aL(e,t,r){if(""===r||r&&!aP.has(r.charAt(0))||!e)return!1;let{sourceCode:n}=t,{type:o,value:a}=e,i=n.getRange(e),s=n.getNodeByRangeIndex(i[0]);if("Punctuator"===o){if(";"===a)return!1;if("]"===a)return!0;if(")"===a){switch(s.type){case"IfStatement":if(n.getTokenBefore(s.consequent)===e)return!1;break;case"ForStatement":case"ForInStatement":case"ForOfStatement":case"WhileStatement":case"DoWhileStatement":case"WithStatement":if(s.body&&n.getTokenBefore(s.body)===e)return!1}return!0}}return!!aR.has(o)||("Template"===o?a.endsWith("`"):"ObjectExpression"===s.type||"Identifier"===o&&("of"!==a||"ForOfStatement"!==s.type)&&("await"!==a||"AwaitExpression"!==s.type))}let aN=e=>"type"===e.importKind||"type"===e.parent.importKind,a$=(e,t,r)=>r.sourceCode.getRange(e.name??e.node)[0]<=r.sourceCode.getRange(t)[0],aM=(e,t)=>{for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}},aO=new i(["Map","ReadonlyMap"]),aq=new i(["Set","ReadonlySet"]),aU=aO.union(aq),aW=e=>new i([e]),aV=e=>aU.has(e)?e:void 0,a_=new i(["ClassName","ImportBinding","TSEnumName","Type"]),az=(e,t,r)=>{let n=r.sourceCode.getScope(t);for(;n;){if(n.set.get(e)?.defs.find(e=>a_.has(e.type)))return!0;n=n.upper}return!1},aK=e=>{let t=new i;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},aG=(e,t)=>{if(r5.has(e.intrinsicName))return;if(e.isUnion())return aK(e.types.map(e=>aG(e,t)));let r=r7(e);if(!(r?.declarations?.length>0&&r.declarations.every(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))))return;let n=r.getName(),o=n&&aV(n);return o&&aW(o)},aJ=(e,t)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return aJ(e.typeAnnotation,t);case"TSTypeOperator":return"readonly"===e.operator?aJ(e.typeAnnotation,t):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type||az(e.typeName.name,e,t))return;let r=aV(e.typeName.name);return r&&aW(r)}case"TSUnionType":return aK(e.types.map(e=>aJ(e,t)))}},aX=(e,t,r=new i)=>((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:n}=r,o=aG(r.getTypeAtLocation(e),n);if(o&&!((e,t,r)=>{for(let n of e)if(az(n,t,r))return!0;return!1})(o,e,t))return o}catch{}})(e,t)??((e,t,r)=>{if(tE(e,{names:["Map","Set"]})&&oA(e.callee,t))return aW(e.callee.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n,o=eS(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,i=aJ(a.name?.typeAnnotation,t);return i?n=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(n=aX(a.node.init,t,r)),r.delete(o),n})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return aJ(e.typeAnnotation,t)??aX(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return aX(e.expression,t,r);case"ConditionalExpression":return aK([aX(e.consequent,t,r),aX(e.alternate,t,r)])}})(e,t,r),aY=(e,t)=>{let r=aX(e,t);if(!r?.size)return;let n=!1,o=!1;for(let e of r){if(aO.has(e)){n=!0;continue}if(aq.has(e)){o=!0;continue}return}if(!n||!o)return n?"Map":"Set"};function aH(e,t){if("function"!=typeof e?.[Symbol.iterator])return void t(e);for(let r of e)aH(r,t)}class aQ extends Error{name="FixAbortError"}let aZ={abort(){throw new aQ("Fix aborted.")}};function a0(e){return t=>{let r=e(t,aZ),n=[];try{return aH(r,e=>{n.push(e)}),n}catch(e){if(e instanceof aQ)return;throw e}}}class a1{#e;#t=new o;constructor(e){this.#e=e}#r(e,t){let r=this.#t;for(let n of e)r.has(n)?r.get(n).push(t):r.set(n,[t])}on(e,t){let r=Array.isArray(e)?e:[e];this.#r(r,t)}onExit(e,t){let r=Array.isArray(e)?e:[e];this.#r(r.map(e=>`${e}:exit`),t)}toEslintListeners(){let e={};for(let[t,r]of this.#t)e[t]=function(e,t){let r=t=>{let r;t&&e.report((r={...t},t.fix&&(r.fix=a0(t.fix)),Array.isArray(t.suggest)&&(r.suggest=t.suggest.map(e=>({...e,fix:a0(e.fix),data:{...t.data,...e.data}}))),r))};return(e,n,o)=>{for(let a of t){let t=a(e,n,o);t&&aH(t,r)}}}(this.#e,r);return e}}let a2=new i;function a3(e){return a2.has(e)?e:t=>{let r=new a1(t),n=e(new Proxy(t,{get:(e,t,n)=>"on"===t||"onExit"===t?r[t].bind(r):Reflect.get(e,t,n)}));return E.equal(n,void 0,`[${t.id}] Rule \`create\` function should return \`undefined\`, please use \`context.on()\` instead of return listeners.`),r.toEslintListeners()}}function a8(e,t){var r;let{visitScriptBlock:n=!0}={},o=a3(e);return r=e=>{let t=o(e),{parserServices:r}=e.sourceCode;return r?.defineTemplateBodyVisitor?n?r.defineTemplateBodyVisitor(t,t):r.defineTemplateBodyVisitor(t):t},a2.add(r),r}let a6={"??":4,"||":4,"&&":5},a9={"|":6,"^":7,"&":8,"==":9,"!=":9,"===":9,"!==":9,"<":10,"<=":10,">":10,">=":10,in:10,instanceof:10,"<<":11,">>":11,">>>":11,"+":12,"-":12,"*":13,"/":13,"%":13,"**":15};function a5(e){switch(e.type){case"SequenceExpression":return 0;case"AssignmentExpression":case"ArrowFunctionExpression":case"YieldExpression":return 1;case"ConditionalExpression":return 3;case"LogicalExpression":return a6[e.operator];case"BinaryExpression":return a9[e.operator];case"TSAsExpression":case"TSSatisfiesExpression":return 10;case"UnaryExpression":case"AwaitExpression":case"TSTypeAssertion":case"TSNonNullExpression":return 16;case"UpdateExpression":return e.prefix?16:17;case"CallExpression":case"ChainExpression":case"ImportExpression":return 18;case"NewExpression":return 19;default:return 20}}function a4(e){return["AwaitExpression","AssignmentExpression","YieldExpression","SequenceExpression","TSAsExpression","TSTypeAssertion"].includes(e.type)}let a7=/^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u;function ie(e){if(tp(e=rN(e)))return e.value;if("UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)){let t=ie(e.argument);if("number"==typeof t)return"-"===e.operator?-t:t}}function it(e,t){switch(e.type){case"Identifier":case"MemberExpression":case"CallExpression":case"ChainExpression":case"TemplateLiteral":case"ThisExpression":case"ArrayExpression":case"FunctionExpression":return!1;case"NewExpression":return!rC(e,t);case"Literal":let r;return!!(tp(e)&&(r=e.raw,a7.test(r)));default:return!0}}let ir=new i(["!","typeof","void","delete","~","+","-"]),io=new i(["UpdateExpression","TSNonNullExpression","TSTypeAssertion"]);function ia(e,t){if(!ir.has(t))throw Error("Unexpected operator");return 16>a5(e)||io.has(e.type)}function ii(e,{operator:t,property:r}){if(!r)throw Error("`property` is required.");return("LogicalExpression"!==e.type||e.operator!==t)&&(!!["AwaitExpression","BinaryExpression"].includes(e.type)||["LogicalExpression","ConditionalExpression","AssignmentExpression","ArrowFunctionExpression","YieldExpression","SequenceExpression"].includes(e.type))}function is(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var il={exports:{}},iu=il.exports,ip=is(function(){return u?il.exports:(u=1,il.exports=function(){var e=[],t=[],r={},n={},o={};function a(e){return"string"==typeof e?RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function s(e,t,n){if(!e.length||r.hasOwnProperty(e))return t;for(var o=n.length;o--;){var a=n[o];if(a[0].test(t))return function(e,t){return e.replace(t[0],function(r,n){var o,a,s=(o=t[1],a=arguments,o.replace(/\$(\d{1,2})/g,function(e,t){return a[t]||""}));return""===r?i(e[n-1],s):i(r,s)})}(t,a)}return t}function l(e,t,r){return function(n){var o=n.toLowerCase();return t.hasOwnProperty(o)?i(n,o):e.hasOwnProperty(o)?i(n,e[o]):s(o,n,r)}}function u(e,t,r,n){return function(n){var o=n.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&s(o,o,r)===o}}function p(e,t,r){var n=1===t?p.singular(e):p.plural(e);return(r?t+" ":"")+n}return p.plural=l(o,n,e),p.isPlural=u(o,n,e),p.singular=l(n,o,t),p.isSingular=u(n,o,t),p.addPluralRule=function(t,r){e.push([a(t),r])},p.addSingularRule=function(e,r){t.push([a(e),r])},p.addUncountableRule=function(e){if("string"==typeof e){r[e.toLowerCase()]=!0;return}p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")},p.addIrregularRule=function(e,t){t=t.toLowerCase(),o[e=e.toLowerCase()]=t,n[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(e){return p.addIrregularRule(e[0],e[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(e){return p.addPluralRule(e[0],e[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(e){return p.addSingularRule(e[0],e[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}(),il.exports)}());function ic(e,t,r=0,n=0){let{sourceCode:o}=t,[a,i]=Array.isArray(e)?e:o.getRange(e);return{start:o.getLocFromIndex(a+r),end:o.getLocFromIndex(i+n)}}function id(e,t){let r=[],n=[],o=()=>n.at(-1),a=new s,u=new s,p=new l;e.on("onCodePathStart",()=>{r.push(new i),n.push(new l)}),e.on("onCodePathEnd",()=>{r.pop(),n.pop()});let c=e=>{r.at(-1).add(e),e.prevSegments.length>0&&e.prevSegments.every(e=>!e.reachable||o().has(e))&&o().add(e)};return e.on("onCodePathSegmentStart",c),e.on("onCodePathSegmentEnd",e=>{r.at(-1).delete(e)}),e.on("onUnreachableCodePathSegmentStart",c),e.on("onUnreachableCodePathSegmentEnd",e=>{r.at(-1).delete(e)}),e.onExit("CallExpression",t=>{if(!(e=>{let t=e,{parent:r}=e;for(;r&&!tw(r);){if("TryStatement"===r.type&&r.finalizer&&r.block===t){let t=r.block.body.at(-1);return 1===r.block.body.length&&t?.type==="ExpressionStatement"&&t.expression===e}t=r,{parent:r}=r}return!1})(t)&&o0(t,e))for(let e of r.at(-1))e.reachable&&o().add(e)}),e.on("IfStatement",e=>{[...r.at(-1)].some(e=>e.reachable&&!o().has(e))&&p.add(e)}),e.onExit(["IfStatement > .consequent","IfStatement > .alternate"],e=>{a.set(e,new i(r.at(-1)))}),e.onExit("IfStatement",e=>{let n=r.at(-1);for(let r of[e.consequent,e.alternate]){if(!r)continue;let o=a.get(r),i=o&&[...n].every(e=>e.prevSegments.every(e=>!o.has(e)))||t?.(r);u.set(r,p.has(e)&&!!i)}}),e=>!!(e&&u.get(e))}function im(e,t,r){let{parent:n}=e;for(let o of t.sourceCode.visitorKeys[n.type]||Object.keys(n)){let t=n[o];if(t!==e&&Array.isArray(t)){let n=t.indexOf(e);if(-1!==n)return t[n+r]}}}let ig=(e,t)=>im(e,t,1),iy=e=>e.charAt(0).toUpperCase()+e.slice(1),ih=e=>e.charAt(0).toLowerCase()+e.slice(1),ix="too-deep",ib="should-parenthesized",iE="prefer-event-target",iv=new i(["@angular/core","eventemitter3"]),iS=e=>"VariableDeclarator"===e.parent.type&&e.parent.id===e&&"VariableDeclaration"===e.parent.parent.type&&"const"===e.parent.parent.kind&&e.parent.parent.declarations.includes(e.parent);function iC(e){let t;return!!e&&(tN(e)?[t]=e.arguments:"AwaitExpression"===e.type&&"ImportExpression"===e.argument.type&&({source:t}=e.argument),!!(ts(t)&&iv.has(t.value)))}let iD={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",186:";",187:"=",188:",",189:"-",190:".",191:"/",219:"[",220:"\\",221:"]",222:"'",224:"Meta"},iT="prefer-keyboard-event-key",iA="prefer-keyboard-event-key/suggestion",iw=new i(["keyCode","charCode","which"]),ik=new i(["onKeyDown","onKeyPress","onKeyUp"]),iI=e=>{var t;return e?.type==="TSTypeAnnotation"&&"TSTypeReference"===e.typeAnnotation.type&&("Identifier"===(t=e.typeAnnotation.typeName).type?"KeyboardEvent"===t.name:"TSQualifiedName"===t.type&&"Identifier"===t.left.type&&"React"===t.left.name&&"Identifier"===t.right.type&&"KeyboardEvent"===t.right.name)},ij=(e,t)=>{var r;let n,o=[],a="ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type;for(let e of(a&&tR(t.parent,{method:"addEventListener",minimumArguments:2,optionalCall:!1,optionalMember:!1})&&t.parent.arguments[1]===t&&o.push({parameter:t.params[0],shouldAutofix:!0}),a&&"JSXExpressionContainer"===(r=t).parent.type&&r.parent.expression===r&&"JSXAttribute"===r.parent.parent.type&&r.parent.parent.value===r.parent&&"JSXAttribute"===(n=r.parent.parent).type&&"JSXIdentifier"===n.name.type&&ik.has(n.name.name)&&o.push({parameter:t.params[0],shouldAutofix:!1}),t.params))iI(e.typeAnnotation)&&o.push({parameter:e,shouldAutofix:!1});let i=e.sourceCode.getDeclaredVariables(t);return o.filter(({parameter:t})=>t&&!nK(t,e)).map(e=>({...e,references:i.find(t=>t.identifiers.includes(e.parameter))?.references}))},iF=(e,t)=>e?.parent?.type==="MemberExpression"&&e.parent.property===e&&!e.parent.computed&&e.parent.object===t,iB=(e,t)=>{let r=[];for(let n=t.parent;n;n=n.parent)tw(n)&&r.push(...ij(e,n));return r},iR=(e,{shouldAutofix:t})=>{let r=(e=>{var t;if(e.parent?.type!=="MemberExpression"||e.parent.property!==e)return;let r=((e,t)=>{let r=e;for(;r&&t;)t--,r=r.parent;if(0===t)return r})(e,3);if(!r||"IfStatement"!==r.type)return;let{type:n,operator:o,right:a}=r.test;if(!("BinaryExpression"===n&&r.test.left===e.parent&&("=="===o||"==="===o)&&tp(a)))return;let i=Object.hasOwn(iD,t=a.value)?iD[t]:Number.isSafeInteger(t)&&t>=0&&t<=1114111?String.fromCodePoint(t):void 0;if(i)return{key:i,right:a}})(e),n={messageId:iT,data:{name:e.name},node:e};if(!r)return n;let o=t=>[t.replaceText(e,"key"),t.replaceText(r.right,tQ(r.key))];return t?n.fix=o:n.suggest=[{messageId:iA,data:{key:r.key},fix:o}],n},iP=(e,{parameter:t})=>t?.type==="ObjectPattern"&&t.properties.includes(e.parent),iL=(e,{references:t})=>{let r=((e,t,r=()=>!0)=>{let n=e;for(;n;){if(n.type===t&&r(n))return n;n=n.parent}})(e,"VariableDeclarator"),n=r?.init;return t&&r?.id===e.parent.parent&&t.some(e=>e.identifier===n)},iN="error",i$="suggestion";function*iM(e,t,r){for(let n of tr(e,r))yield t.remove(n)}function iO(e,t,r,n){if("CallExpression"!==t.type)throw Error(`Unexpected node "${t.type}".`);let{sourceCode:o}=n,[a,i]=o.getLastTokens(t,2);return t.arguments.length>0&&(r=eT(a)?` ${r},`:`, ${r}`),e.insertTextBefore(i,r)}function iq(e,t,r){let n=function(e,t){let r=e.parent,n=r.arguments.indexOf(e),o=tr(e,t),a=o[0]||e,i=o.at(-1)||e,{sourceCode:s}=t,[l]=s.getRange(a),[,u]=s.getRange(i);if(1===r.arguments.length){let e=s.getTokenAfter(i);eT(e)&&([,u]=s.getRange(e))}else if(0===n){let e=s.getTokenAfter(i),t=s.getTokenAfter(e,{includeComments:!0});[u]=s.getRange(t)}else{let e=s.getTokenBefore(a);[l]=s.getRange(e)}return[l,u]}(t,r),o=t.parent;if(0===o.arguments.indexOf(t)&&o.arguments.length>1&&rV(r,n)){let{sourceCode:o}=r,a=tr(t,r).at(-1)||t,[,i]=o.getRange(a),s=o.getTokenAfter(a),[l,u]=o.getRange(s),p=o.text.slice(...n),c=p.slice(i-n[0],l-n[0])+p.slice(u-n[0]);return e.replaceTextRange(n,c)}return e.removeRange(n)}function iU(e,t,r,n){return e.replaceTextRange(tn(t,n),r)}function iW(e,t,r,n){let o=to(r,n);return("MemberExpression"===t.parent.type&&t.parent.object===t?!it(r,n):aj(r))||ta(r,n)||(o=`(${o})`),o.startsWith("{")&&(o=`(${o})`),aL(n.sourceCode.getTokenBefore(t),n,o)&&(o=`;${o}`),e.replaceText(t,o)}function*iV(e,t,r){if("ReturnStatement"!==t.type&&"ThrowStatement"!==t.type)return;let{sourceCode:n}=r,o=n.getFirstToken(t);yield e.insertTextAfter(o," (");let a=n.getLastToken(t);eA(a)?yield e.insertTextBefore(a,")"):yield e.insertTextAfter(t,")")}function i_(e,t,r){let n="object"==typeof e?t.sourceCode.getRange(e)[1]:e,[o]=t.sourceCode.text.slice(n).match(/^\s*/);return r.removeRange([n,n+o.length])}function*iz(e,t,r){let n=t.sourceCode.getFirstToken(e);yield r.remove(n),yield i_(n,t,r),rC(e,t)||(yield r.insertTextAfter(e,"()")),oS(n,e.callee,t)||ta(e,t)||(yield iV(r,e.parent,t))}let iK=({type:e,value:t})=>"Keyword"===e&&/^[a-z]*$/.test(t)||"Identifier"===e&&"of"===t||"Identifier"===e&&"await"===t;function*iG(e,t,r){let{sourceCode:n}=r,o=tn(t,r),a=n.getTokenBefore({range:o},{includeComments:!0});a&&o[0]===n.getRange(a)[1]&&iK(a)&&(yield e.insertTextAfter(a," "));let i=n.getTokenAfter({range:o},{includeComments:!0});i&&o[1]===n.getRange(i)[0]&&iK(i)&&(yield e.insertTextBefore(i," "))}function*iJ(e,t,r){var n;yield iG(r,e,t),yield r.insertTextBefore(e,"new ");let{callee:o}=e;!ta(o,t)&&"MemberExpression"===(n=o).type&&function(e){let t=e.object,r=e.object.type;for(;"MemberExpression"===r;)r=(t=t.object).type;return"CallExpression"===r}(n)&&(yield r.insertTextBefore(o,"("),yield r.insertTextAfter(o,")"))}function iX(e,t,r,n){let[,o]=tn(t.object,r),[,a]=r.sourceCode.getRange(t);return e.replaceTextRange([o,a],n)}let iY=(e,t,r)=>iX(e,t,r,"");function*iH(e,t,r){let n=t.callee;yield iY(e,n,r);let[,o]=tn(n,r),[,a]=r.sourceCode.getRange(t);yield e.removeRange([o,a])}function iQ(e,t,r,n=!1){let{sourceCode:o}=t,{lines:a}=o,i=e;if(n){let[t,r]=o.getLastTokens(e,2);eA(r)&&(i=t)}let s=o.getLoc(e).start,l=o.getLoc(i).end,u=a[s.line-1].slice(0,s.column),p=a[l.line-1].slice(l.column),[c]=o.getRange(e),[,d]=o.getRange(i);if(/^\s*$/.test(u)&&/^\s*$/.test(p))if(d+=p.length,0===c){let{text:e}=o;"\r"===e[d]&&"\n"===e[d+1]?d+=2:("\n"===e[d]||"\r"===e[d])&&d++}else c=Math.max(0,c-u.length-1);return r.removeRange([c,d])}function iZ(e,t,r,n){if(aF(e)||"AssignmentPattern"===e.parent.type&&e.parent.left===e&&aF(e.parent))return n.replaceText(e,`${e.name}: ${t}`);if(ak(e,r))return n.replaceText(e,`${e.name} as ${t}`);if(((e,t)=>{let{type:r,local:n,exported:o}=e.parent;return"ExportSpecifier"===r&&aw(n,o,t)&&n===e})(e,r))return n.replaceText(e,`${t} as ${e.name}`);if(e.typeAnnotation){let{sourceCode:o}=r;return o.getCommentsInside(e).length>0?n.replaceText(o.getFirstToken(e),t):n.replaceTextRange([o.getRange(e)[0],o.getRange(e.typeAnnotation)[0]],`${t}${e.optional?"?":""}`)}return n.replaceText(e,t)}let i0=(e,t,r,n)=>r1(e).map(e=>iZ(e,t,r,n)),i1=(e,t,r,n)=>{let{tail:o}=e,[a,i]=r.sourceCode.getRange(e);return n.replaceTextRange([a+1,i-(o?1:2)],t)};function*i2(e,t,r,n,o){for(let t of tr(e,o?{sourceCode:o}:n))yield i2(t,"",r,n,o);let{sourceCode:a}=n,[i,s]=a.getRange(e),[l]=a.text.slice(0,i).match(/\s*$/),[u]=l.match(/(?:\r?\n|\r)?/);i-=l.length,yield r.replaceTextRange([i,s],`${u}${t}`)}let i3="require-array-join-separator",i8="no-thenable-object",i6="no-thenable-export",i9="no-thenable-class",i5=(e,t)=>eV(e,t.sourceCode.getScope(e))?.value==="then",i4=(e,t)=>{let r="MemberExpression"===e.type?e.property:e.key;return"Literal"===r.type?"then"===r.value:e.computed||"Identifier"!==r.type?"then"===ez(e,t.sourceCode.getScope(e)):"then"===r.name},i7=[{selector:"ObjectExpression",*getNodes(e,t){for(let r of e.properties)"Property"===r.type&&i4(r,t)&&(yield r.key)},messageId:i8},{selectors:["PropertyDefinition","MethodDefinition"],*getNodes(e,t){i4(e,t)&&(yield e.key)},messageId:i9},{selector:"MemberExpression",*getNodes(e,t){"AssignmentExpression"===e.parent.type&&e.parent.left===e&&i4(e,t)&&(yield e.property)},messageId:i8},{selector:"CallExpression",*getNodes(e,t){if(!tR(e,{objects:["Object","Reflect"],method:"defineProperty",minimumArguments:3,optionalCall:!1,optionalMember:!1})||"SpreadElement"===e.arguments[0].type)return;let[,r]=e.arguments;i5(r,t)&&(yield r)},messageId:i8},{selector:"CallExpression",*getNodes(e,t){if(tR(e,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"ArrayExpression"===e.arguments[0].type)for(let r of e.arguments[0].elements){if(!(r?.type==="ArrayExpression"&&r.elements[0])||"SpreadElement"===r.elements[0].type)continue;let[e]=r.elements;i5(e,t)&&(yield e)}},messageId:i8},{selector:"Identifier",*getNodes(e){"then"===e.name&&"ExportSpecifier"===e.parent.type&&e.parent.exported===e&&(yield e)},messageId:i6},{selector:"Identifier",*getNodes(e){"then"===e.name&&("FunctionDeclaration"===e.parent.type||"ClassDeclaration"===e.parent.type)&&e.parent.id===e&&"ExportNamedDeclaration"===e.parent.parent.type&&e.parent.parent.declaration===e.parent&&(yield e)},messageId:i6},{selector:"VariableDeclaration",*getNodes(e,t){if("ExportNamedDeclaration"===e.parent.type&&e.parent.declaration===e)for(let r of t.sourceCode.getDeclaredVariables(e))"then"===r.name&&(yield*r.identifiers)},messageId:i6}],se="no-invalid-remove-event-listener",st="consistent-function-scoping",sr=(e,t)=>e&&t&&(e===t||e.block===t.block),sn=(e,t)=>e.some(e=>sr(e,t)),so=["useState","useEffect","useContext","useReducer","useCallback","useMemo","useRef","useImperativeHandle","useLayoutEffect","useDebugValue"].flatMap(e=>[e,`React.${e}`]),sa=new i(["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"]),si=e=>e?.type==="BlockStatement"&&sa.has(e.parent.type)&&e.parent.body===e,ss=new i(["FunctionExpression","ArrowFunctionExpression"]),sl={create:e=>{let{checkArrowFunctions:t}=e.options[0],{sourceCode:r}=e,{scopeManager:n}=r;e.onExit(tA,e=>{if(("ArrowFunctionExpression"!==e.type||t)&&!function(e,t,r){let n,o,a,i=t.acquire(e);if(!i||(o=r.visitorKeys,"ArrowFunctionExpression"===e.type&&ov(e,o))||function(e){let t=e;for(;t.parent;){let{parent:e}=t;if("CallExpression"===e.type&&e.arguments[1]===t&&tA.includes(t.type)&&tM(e.callee,["jest.mock"]))return!0;t=e}return!1}(e))return!0;let s=e.parent;"VariableDeclarator"===s.type&&(s=s.parent),"VariableDeclaration"===s.type&&(s=s.parent),s?.type==="ReturnStatement"&&"ArrowFunctionExpression"===e.type&&(s=s.parent),s=function(e,t){if("ArrowFunctionExpression"===e.type&&"ArrowFunctionExpression"===t.type){let t=function(e){let t=e;for(;t&&"ArrowFunctionExpression"===t.type;)t=t.parent;return t}(e);t&&"ReturnStatement"===t.type&&"ReturnStatement"===(e=function(e){let t=e;for(;"ArrowFunctionExpression"===t.type;)t=t.parent;return t}(e)).type&&(e=e.parent)}return e}(s,e),s?.type==="BlockStatement"&&(n=s,s=s.parent);let l=t.acquire(s),u=function(e,t,r){let n=[];e&&n.push(e);let o=function(e){let t=[];for(;e?.type==="BlockStatement";){if(t.push(e),si(e))return t;e=e.parent}return[]}(t);if(0===o.length)return n;let a=o.at(-1),i=r.acquire(a.parent);for(let e of(i&&n.push(i),o)){let t=r.acquire(e);t&&n.push(t)}return n}(l,n,t);return!!(0===u.length||u.some(e=>"global"===e.type)||l&&l.block?.parent?.callee&&tM(l.block.parent.callee,so)||l&&(a=s,ss.has(a.type)&&"CallExpression"===a.parent.type&&a.parent.callee===a))||rh(i).map(({resolved:e})=>e).filter(Boolean).some(e=>e.references.some(e=>{if(sn(u,e.from))return!0;let{resolved:t}=e,[r]=t.defs;return(r?.type!=="FunctionName"||t.name!==r.name.name)&&sn(u,t.scope)})||e.defs.some(e=>sn(u,t.acquire(e.node)))||e.identifiers.some(e=>{if(!e.parent||"FunctionDeclaration"!==e.parent.type||t.acquire(e))return!1;let r=t.acquire(e.parent);return!(!r||sr(i,r))&&sn(u,r.upper)}))}(e,n,r))return{node:e,loc:eR(e,r),messageId:st,data:{functionNameWithKind:eK(e,r)}}})},meta:{type:"suggestion",docs:{description:"Move function definitions to the highest possible scope.",recommended:!0},schema:[{type:"object",additionalProperties:!1,properties:{checkArrowFunctions:{type:"boolean",description:"Whether to check arrow functions."}}}],defaultOptions:[{checkArrowFunctions:!0}],messages:{[st]:"Move {{functionNameWithKind}} to the outer scope."},languages:["js/js"]}},su="error",sp="error-unknown",sc="suggestion";function sd(e,t,r){return function*(n){yield n.insertTextAfter(e.callee,`.${r}`),yield iz(e,t,n)}}let sm="no-console-spaces",sf=e=>e.length>1&&" "===e.charAt(0)&&" "!==e.charAt(1),sg=e=>e.length>1&&" "===e.at(-1)&&" "!==e.at(-2),sy="no-empty-file",sh={create:e=>{let{allowComments:t}=e.options[0];e.filename===e.physicalFilename&&(e.on("Program",r=>{if(r.templateBody)return;if(1===r.body.length&&"Document"===r.body[0].type){let{children:e}=r.body[0];if(e.some(e=>"Comment"!==e.type&&("Text"!==e.type||""!==e.value.trim()))||t&&e.some(e=>"Comment"===e.type))return;return{node:r,messageId:sy}}if(r.body.some(e=>!tS(e,tv)))return;let{sourceCode:n}=e,o=rM(e);if(0!==n.ast.tokens.length||0!==o.length||""===n.text.trim()){if(!o.some(e=>"Line"===e.type&&e.value.startsWith("/"))&&(!(t&&o.length>0&&o.every(e=>"Line"===e.type||"Block"===e.type))||0!==n.ast.tokens.length))return{node:r,messageId:sy}}}),e.on("StyleSheet",r=>{if(r.children.length>0)return;let n=rM(e);if(!t||!(n.length>0))return{node:r,messageId:sy}}),e.on("Document",r=>{if(r.parent?.type==="Program"||null!==r.body&&void 0!==r.body)return;let n=rM(e);if(!t||!(n.length>0))return{node:r,messageId:sy}}),e.on("root",e=>{if(!e.children.some(e=>!("html"===e.type&&/^<!--(?:(?!-->)[\s\S])*-->$/.test(e.value.trim())))&&(!t||!(e.children.length>0)))return{node:e,messageId:sy}}))},meta:{type:"suggestion",docs:{description:"Disallow empty files.",recommended:"unopinionated"},schema:[{type:"object",additionalProperties:!1,properties:{allowComments:{type:"boolean",description:"Whether to allow files that only contain comments."}}}],defaultOptions:[{allowComments:!1}],messages:{[sy]:"Empty files are not allowed."},languages:["js/js","css/css","html/html","json/json","json/jsonc","json/json5","markdown/commonmark","markdown/gfm"]}},sx="no-useless-fallback-in-spread";function sb(e){return"AwaitExpression"===e.parent.type&&e.parent.argument===e?{expression:e.parent,parent:e.parent.parent,isAwaited:!0}:{expression:e,parent:e.parent,isAwaited:!1}}function sE(e,t){let r=e?t.sourceCode.getText(e):"";return e?.type==="SequenceExpression"?`(${r})`:r}let sv="zero-fraction",sS="dangling-dot",sC="error",sD="suggestion",sT=Symbol.for("default"),sA=Symbol("NAMESPACE_SPECIFIER_NAME"),sw=e=>{switch(e.type){case"Identifier":return Symbol.for(e.name);case"Literal":return e.value}},sk=e=>"type"===e.exportKind||"type"===e.parent.exportKind;function*sI(e,t,r){switch(e.type){case"ImportSpecifier":case"ExportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":return void(yield function*(e,t,r,n=!1){let o=e.parent,{specifiers:a}=o;if(1===a.length&&!n)return void(yield t.remove(o));let{sourceCode:i}=r;switch(e.type){case"ImportSpecifier":if(a.every(t=>e===t||e.type!==t.type)){let r=i.getTokenAfter(e,e=>"Identifier"===e.type&&"from"===e.value),n=a.some(e=>"ImportDefaultSpecifier"===e.type),o=i.getTokenBefore(e,n?eT:ej),[s]=i.getRange(o),[l]=i.getRange(r),u=i.getTokenBefore(o),p=i.getRange(u)[1]===s;yield t.replaceTextRange([s,l],p?" ":"");return}case"ExportSpecifier":case"ImportNamespaceSpecifier":case"ImportDefaultSpecifier":{yield t.remove(e);let r=i.getTokenAfter(e);eT(r)&&(yield t.remove(r))}}}(e,t,r));case"ImportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":yield t.remove(e)}}function sj(e,t){let{sourceCode:r}=t,n=r.getTokenBefore(e.source,e=>"Identifier"===e.type&&"from"===e.value),[o]=r.getRange(n),[,a]=r.getRange(e);return r.text.slice(o,a)}let sF={create:function(e){let{sourceCode:t}=e,{checkUsedVariables:r}=e.options[0],n=new i,o=[];e.on("ImportDeclaration",e=>{e.specifiers.length>0&&n.add(e)}),e.on("ExportNamedDeclaration",e=>{ts(e.source)&&o.push(e)}),e.on("Program:exit",function*(a){for(let i of n){let n=t.getDeclaredVariables(i);if(n.some(e=>1!==e.defs.length||e.defs[0].parent!==i)||(n=n.map(e=>{let r=function(e,t){let r=e.defs[0].node,n={node:r,declaration:r.parent,variable:e,isTypeImport:aN(r)};switch(r.type){case"ImportDefaultSpecifier":return{name:sT,text:"default",...n};case"ImportSpecifier":return{name:sw(r.imported),text:t.getText(r.imported),...n};case"ImportNamespaceSpecifier":return{name:sA,text:"*",...n}}}(e,t),n=function(e,t){let r=[];for(let{identifier:n}of e.variable.references){let o=function(e,t){let{parent:r}=e;switch(r.type){case"ExportDefaultDeclaration":return{node:r,name:sT,text:"default",isTypeExport:sk(r)};case"ExportSpecifier":return{node:r,name:sw(r.exported),text:t.getText(r.exported),isTypeExport:sk(r)};case"VariableDeclarator":{let n=r.parent.parent;if(r.init===e&&"Identifier"===r.id.type&&!r.id.typeAnnotation&&"VariableDeclaration"===r.parent.type&&"const"===r.parent.kind&&1===r.parent.declarations.length&&r.parent.declarations[0]===r&&"ExportNamedDeclaration"===n.type&&function(e,t){let r=t.getDeclaredVariables(e);if(1!==r.length)return!1;let[{identifiers:n,references:o}]=r;return 1===n.length&&n[0]===e.id&&1===o.length&&o[0].identifier===e.id}(r,t))return{node:n,name:Symbol.for(r.id.name),text:t.getText(r.id),isJSDocumentComment:function(e,t){let r=t.getTokenBefore(e,{includeComments:!0});if(r?.type!=="Block"||!r.value.startsWith("*")||r.value.startsWith("**"))return!1;let n=t.getTokenBefore(r),o=t.getLoc(r).start,a=t.getLoc(r).end,i=t.getLoc(e).start;return(!n||t.getLoc(n).end.line<o.line)&&(a.line===i.line||a.line===i.line-1)}(n,t)}}}}(n,t);o&&(e.name!==sA||o.name!==sT)&&r.push(o)}return r}(r,t);return{variable:e,imported:r,exports:n}}),!r&&n.some(({variable:e,exports:t})=>e.references.length!==t.length)))continue;let s=!r&&n.some(({variable:e})=>0===e.references.length);for(let{imported:t,exports:r}of n)for(let n of function*(e){for(let t of e)t.isJSDocumentComment||(yield t)}(r)){let r={node:n.node,messageId:sC,data:{exported:n.text}},i=function({context:e,imported:t,exported:r,exportDeclarations:n,program:o}){let a,i=t.declaration,s=i.source.value,l=t.isTypeImport||r.isTypeExport;return l&&(a=n.find(({source:e,exportKind:t})=>"type"===t&&e.value===s)),a||=n.find(({source:e,exportKind:t})=>"type"!==t&&e.value===s),function*(n){if(t.name===sA)yield n.insertTextAfter(o,`
28
- export ${l?"type ":""}* as ${r.text} ${sj(i,e)}`);else{let s=r.name===t.name?r.text:`${t.text} as ${r.text}`;if(l&&(!a||"type"!==a.exportKind)&&(s=`type ${s}`),a){let t=a.specifiers.at(-1);if(t)yield n.insertTextAfter(t,`, ${s}`);else{let t=e.sourceCode.getFirstToken(a,ej);yield n.insertTextAfter(t,s)}}else yield n.insertTextAfter(o,`
29
- export {${s}} ${sj(i,e)}`)}let s=r.isTypeExport&&!t.isTypeImport;1!==t.variable.references.length||s||(yield sI(t.node,n,e)),yield sI(r.node,n,e)}}({context:e,imported:t,exported:n,exportDeclarations:o,program:a});s?r.suggest=[{messageId:sD,fix:i}]:r.fix=i,yield r}}})},meta:{type:"suggestion",docs:{description:"Prefer `export…from` when re-exporting.",recommended:!0},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkUsedVariables:{type:"boolean",description:"Whether to check variables that are used in the module."}}}],defaultOptions:[{checkUsedVariables:!0}],messages:{[sC]:"Use `export…from` to re-export `{{exported}}`.",[sD]:"Switch to `export…from`."},languages:["js/js"]}},sB="prefer-native-coercion-functions",sR=new i(["String","Number","BigInt","Boolean","Symbol"]),sP=new i(["every","filter","find","findLast","findIndex","findLastIndex","some"]),sL=(e,t)=>e?.type==="CallExpression"&&!e.optional&&"Identifier"===e.callee.type&&sR.has(e.callee.name)&&e.arguments[0]?.type==="Identifier"&&e.arguments[0].name===t,sN=(e,t)=>{let r={[t]:!0};for(let t of e.split(".").toReversed())r={[t]:r};return r},s$=(e,t)=>{for(let r of Reflect.ownKeys(t)){let n=t[r];"object"==typeof n?(e[r]??={},s$(e[r],n)):e[r]=n}};class sM{static READ=e5.READ;static CALL=e5.CALL;static CONSTRUCT=e5.CONSTRUCT;#n={};#e;#o;#a;constructor({object:e,objects:t=[e],type:r=e5.READ,context:n,filter:o,handle:a}){for(let e of t)s$(this.#n,sN(e,r));this.#e=n,this.#o=o,this.#a=a}*#i(e,t){let r=t?.context??this.#e,n=t?.filter??this.#o,o=t?.handle??this.#a;for(let t of new e5(e).iterateGlobalReferences(this.#n)){if(n&&!n(t))continue;let e=o(t,r);yield e}}listen(e){let t=e?.context??this.#e;t.onExit("Program",r=>this.#i(t.sourceCode.getScope(r),e))}}let sO="no-document-cookie",sq=new sM({object:"document.cookie",filter:({node:e})=>"AssignmentExpression"===e.parent.type&&e.parent.left===e,handle:({node:e})=>({node:e,messageId:sO})}),sU=e=>[`webkit${e}`,`o${e.toLowerCase()}`,e.toLowerCase()],sW=new i(["click","rightclick","dblclick","auxclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","mousecancel","selectionchange","selectstart","wheel","keypress","keydown","keyup","blur","focus","deactivate","focusin","focusout","change","reset","select","submit","input","propertychange","dragstart","drag","dragenter","dragover","dragleave","drop","dragend","touchstart","touchmove","touchend","touchcancel","beforeunload","consolemessage","contextmenu","devicechange","devicemotion","deviceorientation","DOMContentLoaded","error","help","load","losecapture","orientationchange","readystatechange","resize","scroll","unload","canplay","canplaythrough","durationchange","emptied","ended","loadeddata","loadedmetadata","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","sourceopen","sourceended","sourceclosed","abort","update","updatestart","updateend","hashchange","pagehide","pageshow","popstate","copy","paste","cut","beforecopy","beforecut","beforepaste","online","offline","message","connect","install","activate","fetch","foreignfetch","messageerror","statechange","updatefound","controllerchange",...sU("AnimationStart"),...sU("AnimationEnd"),...sU("AnimationIteration"),...sU("TransitionEnd"),"pointerdown","pointerup","pointercancel","pointermove","pointerover","pointerout","pointerenter","pointerleave","gotpointercapture","lostpointercapture","MSGestureChange","MSGestureEnd","MSGestureHold","MSGestureStart","MSGestureTap","MSGotPointerCapture","MSInertiaStart","MSLostPointerCapture","MSPointerCancel","MSPointerDown","MSPointerEnter","MSPointerHover","MSPointerLeave","MSPointerMove","MSPointerOut","MSPointerOver","MSPointerUp","text","textinput","textInput","compositionstart","compositionupdate","compositionend","beforeinput","exit","loadabort","loadcommit","loadredirect","loadstart","loadstop","responsive","sizechanged","unresponsive","visibilitychange","storage","DOMSubtreeModified","DOMNodeInserted","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","DOMAttrModified","DOMCharacterDataModified","beforeprint","afterprint","beforeinstallprompt","appinstalled","afterblur","beforeblur","cancel","close","dragexit","encrypted","fullscreenchange","invalid","toggle","search","open","show"]),sV="prefer-add-event-listener",s_={create:e=>{let t,r,n=new i(e.options[0].excludedPackages),o=new s;e.on("onCodePathStart",(e,t)=>{r={node:t,upper:r,returnsSomething:!1}}),e.on("onCodePathEnd",()=>{o.set(r.node,r.returnsSomething),r=r.upper}),e.on("CallExpression",e=>{tN(e)&&!t&&n.has(e.arguments[0].value)&&(t=!0)}),e.on("Literal",e=>{"ImportDeclaration"===e.parent.type&&!t&&n.has(e.value)&&(t=!0)}),e.on("ReturnStatement",e=>{r.returnsSomething||=!!e.argument}),e.on("AssignmentExpression:exit",r=>{let n;if(t)return;let{left:a,right:i,operator:s}=r;if("MemberExpression"!==a.type||a.computed)return;let l=a.property.name;if(!l||!l.startsWith("on"))return;let u=l.slice(2);if(!sW.has(u))return;let p="addEventListener",c="";if(tq(i)||td(i))p="removeEventListener";else"beforeunload"===u&&("ArrowFunctionExpression"!==i.type&&"FunctionExpression"!==i.type||"BlockStatement"!==i.body.type||o.get(i))?c="Use `event.preventDefault(); event.returnValue = 'foo'` to trigger the prompt.":"message"===u?c="Note that there is difference between `SharedWorker#onmessage` and `SharedWorker#addEventListener('message')`.":"error"===u?c="Note that there is difference between `{window,element}.onerror` and `{window,element}.addEventListener('error')`.":"="!==s||"ExpressionStatement"!==r.parent.type||r.parent.expression!==r||oE(i)||(n=t=>((e,t,r,n)=>{let{sourceCode:o}=t,a=n.property.name.slice(2),i=o.getText(n.object);ta(n.object,t)&&(i=`(${i})`);let s=o.getText(r.right);ta(r.right,t)&&(s=`(${s})`);let l=`${i}.addEventListener('${a}', ${s})`;return e.replaceText(r,l)})(t,e,r,a));return{node:a.property,messageId:sV,data:{replacement:p,method:l,extra:c?` ${c}`:""},fix:n}})},meta:{type:"suggestion",docs:{description:"Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{excludedPackages:{type:"array",items:{type:"string"},uniqueItems:!0,description:"Packages to exclude from checking."}}}],defaultOptions:[{excludedPackages:["koa","sax"]}],messages:{[sV]:"Prefer `{{replacement}}` over `{{method}}`.{{extra}}"},languages:["js/js"]}},sz=new i(["false","true"]),sK=(e,t)=>"BinaryExpression"===e.type&&"==="===e.operator&&(oT(e.left,t)||oT(e.right,t)),sG=({type:e,name:t},r)=>"Identifier"===e&&t===r;function sJ({method:e,replacement:t,checkBooleanPredicate:r=!1}){let n=`prefer-${t}-over-${e}/`,o=`${n}error`,a=`${n}suggestion`;return{messages:{[o]:({findIndex:"Use `.indexOf()` instead of `.findIndex()` when looking for the index of an item.",findLastIndex:"Use `.lastIndexOf()` instead of `.findLastIndex() when looking for the index of an item.`",some:`Use \`.${t}()\` instead of \`.${e}()\` when checking value existence.`})[e],[a]:`Replace \`.${e}()\` with \`.${t}()\`.`},listen:function(n){let{sourceCode:i}=n,{scopeManager:s}=i;n.on("CallExpression",r=>{let l,u,p;if(!tR(r,{method:e,argumentsLength:1,optionalCall:!1})||!("ArrowFunctionExpression"===(p=r.arguments[0]).type&&!p.async&&1===p.params.length&&sK(p.body,p.params[0])||("ArrowFunctionExpression"===p.type||"FunctionExpression"===p.type)&&!p.async&&!p.generator&&1===p.params.length&&"BlockStatement"===p.body.type&&1===p.body.body.length&&"ReturnStatement"===p.body.body[0].type&&sK(p.body.body[0].argument,p.params[0]))||nL(r.callee.object,n))return;let[c]=r.arguments,d="BinaryExpression"===c.body.type?c.body:c.body.body[0].argument,[m]=c.params,{left:f,right:g}=d,{name:y}=m;if(sG(f,y))l=g,u=f;else{if(!sG(g,y))return;l=f,u=g}let h=s.acquire(c);if(!h||eS(h,m).references.some(({identifier:e})=>e!==u)||r6(c,h))return;let x=r.callee.property,b={node:x,messageId:o,suggest:[]},E=function*(e){let r=i.getText(l);ta(l,n)&&!ta(c,n)&&(r=`(${r})`),yield e.replaceText(x,t),yield e.replaceText(c,r)};return eH(l,i)?b.suggest.push({messageId:a,fix:E}):b.fix=E,b}),r&&i.parserServices?.program&&n.on("CallExpression",r=>{if(!tR(r,{method:e,argumentsLength:1,optionalCall:!1}))return;let[n]=r.arguments;if("ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||1!==n.params.length||"Identifier"!==n.params[0].type)return;let[a]=n.params,{parserServices:l}=i,u=function(e,t){let r="ArrowFunctionExpression"!==e.type||e.async||1!==e.params.length||"BlockStatement"===e.body.type?"ArrowFunctionExpression"!==e.type&&"FunctionExpression"!==e.type||e.async||e.generator||1!==e.params.length||"BlockStatement"!==e.body.type||1!==e.body.body.length||"ReturnStatement"!==e.body.body[0].type?void 0:e.body.body[0].argument:e.body;if(r){if(oT(r,t))return r;if("CallExpression"===r.type&&!r.optional&&sG(r.callee,"Boolean")&&1===r.arguments.length&&oT(r.arguments[0],t))return r.arguments[0]}}(n,a);if(!u||!function(e){if("boolean"===e.intrinsicName||"true"===e.intrinsicName)return!0;if(!e.isUnion())return!1;let t=e.types.map(e=>e.intrinsicName);return t.includes("true")&&t.every(e=>sz.has(e))}(l.getTypeAtLocation(a))||!function(e,t){if(e.isUnion())return!1;let r=t.program.getTypeChecker();return!!e.getProperty("includes")&&(r.isArrayType(e)||r.isTupleType(e))}(l.getTypeAtLocation(r.callee.object),l))return;let p=s.acquire(n);if(!p||eS(p,a).references.some(({identifier:e})=>e!==u)||r6(n,p))return;let c=r.callee.property;return{node:c,messageId:o,*fix(e,{abort:r}){i.getCommentsInside(n).length>0&&r(),yield e.replaceText(c,t),yield e.replaceText(n,"true")}}})}}}let sX=sJ({method:"findIndex",replacement:"indexOf"}),sY=sJ({method:"findLastIndex",replacement:"lastIndexOf"}),sH={create(e){sX.listen(e),sY.listen(e)},meta:{type:"suggestion",docs:{description:"Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{...sX.messages,...sY.messages},languages:["js/js"]}},sQ="error",sZ="prefer-date",s0="prefer-date-now-over-methods",s1="prefer-date-now-over-number-data-object",s2=e=>tE(e,{name:"Date",argumentsLength:0}),s3=(e,t,r)=>({node:e,messageId:sZ,*fix(t){yield t.replaceText(e,"Date.now()"),"UnaryExpression"===e.type&&(yield iG(t,e,r))},...t}),s8="prefer-dataset",s6="prefer-attributes",s9=e=>`data-${e.replaceAll(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`,s5=e=>tF(e,{property:"dataset"}),s4=e=>e.computed||"Identifier"!==e.property.type?e.computed&&ts(e.property)?e.property.value:void 0:e.property.name,s7=new i(["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),le=/[\s\u0000-\u001F"'/<=>]/,lt=e=>s7.has(e)||e.includes("-")||le.test(e);function lr(e,t){let r=to(e,t);return!ta(e,t.sourceCode)&&it(e,t)?`(${r})`:r}let ln={create:e=>{let{preferAttributes:t}=e.options[0];if(t){let{sourceCode:t}=e,r=(r,n,o)=>{if(lt(n.value)||nz(o.object,e))return;let a=lr(o.object,e),i=o.optional?"?.":".",s=tQ(s9(n.value),n.raw.charAt(0)),l=rU(e,r,[o.object])?void 0:n=>{let o=`${a}${i}hasAttribute(${s})`;return aL(t.getTokenBefore(r),e,o)&&(o=`;${o}`),n.replaceText(r,o)};return{node:r,messageId:s6,data:{method:"hasAttribute"},fix:l}};e.on("BinaryExpression",e=>{if("in"===e.operator&&ts(e.left)&&s5(e.right))return r(e,e.left,e.right)}),e.on("CallExpression",e=>tR(e,{object:"Object",method:"hasOwn",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&s5(e.arguments[0])&&ts(e.arguments[1])?r(e,e.arguments[1],e.arguments[0]):tR(e,{method:"hasOwnProperty",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&s5(e.callee.object)&&ts(e.arguments[0])?r(e,e.arguments[0],e.callee.object):void 0),e.on("VariableDeclarator",t=>{let r;if(!(t.init&&s5(t.init)&&("ObjectPattern"===t.id.type||"Identifier"===t.id.type))||nz(t.init.object,e))return;let n=t.init;if("Identifier"===t.id.type)return{node:n,messageId:s6,data:{method:"getAttribute"},fix:function(e,t){let{sourceCode:r}=t,n=e.init,o=e.parent,[a]=r.getDeclaredVariables(e);if(!a)return;let i=function(e){let t=[];for(let r of e.references){if(r.init)continue;let{identifier:e}=r,n=e.parent;if("MemberExpression"!==n.type||n.object!==e||n.optional)return;let o=s4(n);if(void 0===o||lt(o))return;let{parent:a}=n;if(nG(n)||"CallExpression"===a.type&&a.callee===n||"TaggedTemplateExpression"===a.type&&a.tag===n)return;t.push(n)}return t}(a);if(!(i&&i.length>0&&"const"===o.kind&&1===o.declarations.length&&!o.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==o.parent.type&&"Identifier"===n.object.type&&function(e,t,r){let{sourceCode:n}=r,{name:o}=e.object,a=e=>eS(n.getScope(e),o),i=a(e.object),s=t.some(e=>a(e)!==i),l=!!i?.references.some(e=>e.isWrite()&&!e.init);return!s&&!l}(n,i,t)&&!rU(t,o)&&i.every(e=>!rU(t,e))))return;let s=lr(n.object,t);return function*(e){for(let r of(yield iQ(o,t,e),i)){let t=r.computed?r.property.raw.charAt(0):void 0,n=tQ(s9(s4(r)),t);yield e.replaceText(r,`${s}.getAttribute(${n})`)}}}(t,e)};let{properties:o}=t.id;if(o.some(e=>"Property"===e.type&&(e.computed||"Identifier"!==e.key.type?!ts(e.key)||lt(e.key.value):lt(e.key.name))))return;let a=t.parent,i=lr(n.object,e),s=n.optional?"?.":".";if(o.length>0&&1===a.declarations.length&&!a.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==a.parent.type&&!rU(e,a,[n.object])&&o.every(e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type&&"Identifier"===e.value.type)&&(1===o.length||"Identifier"===n.object.type)){let t=rR(a,e),n=o.map(e=>{let t=tQ(s9(e.key.name),"'");return`${a.kind} ${e.value.name} = ${i}${s}getAttribute(${t})`});r=e=>e.replaceText(a,`${n.join(`;
30
- ${t}`)};`)}return{node:n,messageId:s6,data:{method:"getAttribute"},fix:r}}),e.on("MemberExpression",r=>{let n,{object:o}=r;if(!s5(o)||nz(o.object,e))return;let a=s4(r);if(void 0===a||lt(a)||r.optional)return;let i="ChainExpression"===r.parent.type?r.parent.parent:r.parent;if("CallExpression"===i.type&&i.callee===r||"TaggedTemplateExpression"===i.type&&i.tag===r||"UpdateExpression"===i.type||"AssignmentExpression"===i.type&&i.left===r&&"="!==i.operator)return;let s="AssignmentExpression"===i.type&&i.left===r,l="UnaryExpression"===i.type&&"delete"===i.operator;if(nG(r)&&!s&&!l)return;let u=lr(o.object,e),p=o.optional?"?.":".",c=r.computed?r.property.raw.charAt(0):void 0,d=tQ(s9(a),c);return s&&aB(i)&&!rU(e,i,[o.object,i.right])?n=t=>t.replaceText(i,`${u}${p}setAttribute(${d}, ${to(i.right,e)})`):l&&tT(i.parent)&&!rU(e,i,[o.object])?n=r=>{let n=`${u}${p}removeAttribute(${d})`;return aL(t.getTokenBefore(i),e,n)&&(n=`;${n}`),r.replaceText(i,n)}:s||l||rU(e,r,[o.object])||(n=e=>e.replaceText(r,`${u}${p}getAttribute(${d})`)),{node:r,messageId:s6,data:{method:s?"setAttribute":l?"removeAttribute":"getAttribute"},fix:n}});return}e.on("CallExpression",t=>{if(!((tR(t,{method:"setAttribute",argumentsLength:2,optionalCall:!1,optionalMember:!1})||tR(t,{methods:["removeAttribute","hasAttribute"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tR(t,{method:"getAttribute",argumentsLength:1,optionalCall:!1}))&&ts(t.arguments[0]))||nz(t.callee.object,e))return;let r=t.callee.property.name,n="ChainExpression"===t.parent.type?t.parent:t;if(("AwaitExpression"!==n.parent.type||n.parent.argument!==n||"getAttribute"!==r)&&t.arguments[0].value.toLowerCase().startsWith("data-"))return{node:t,messageId:s8,data:{method:r},fix:function(e,t){let r=e.callee.property.name;if("setAttribute"===r&&r3(e.callee)||"setAttribute"===r&&!aB(e)||"removeAttribute"===r&&!tT(e.parent))return;let n=[e.callee.object];if("setAttribute"===r&&n.push(e.arguments[1]),!rU(t,e,n))return n=>{let[o]=e.arguments,a=o.value.toLowerCase().slice(5).replaceAll(/-[a-z]/g,e=>e[1].toUpperCase()),i="",s=`${lr(e.callee.object,t)}${e.callee.optional?"?":""}.dataset`;switch(r){case"setAttribute":case"getAttribute":case"removeAttribute":i=r$(a)?`.${a}`:`[${tQ(a,o.raw.charAt(0))}]`,i=`${s}${i}`,"setAttribute"===r?i+=` = ${to(e.arguments[1],t)}`:"removeAttribute"===r&&(i=`delete ${i}`);break;case"hasAttribute":i=`Object.hasOwn(${s}, ${tQ(a,o.raw.charAt(0))})`}return n.replaceText(e,i)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for DOM element dataset access.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{preferAttributes:{type:"boolean",description:"Prefer attribute methods over named `.dataset` access."}}}],defaultOptions:[{preferAttributes:!1}],messages:{[s8]:"Prefer `.dataset` over `{{method}}(…)`.",[s6]:"Prefer `.{{method}}(…)` over `.dataset`."},languages:["js/js"]}},lo="prefer-modern-math-apis",la=(e,t)=>"MemberExpression"===e.type&&!e.optional&&!e.computed&&"Identifier"===e.object.type&&"Math"===e.object.name&&"Identifier"===e.property.type&&e.property.name===t,li=(e,t)=>"CallExpression"===e.type&&!e.optional&&la(e.callee,t)&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type;function ls({constantName:e,replacementMethod:t}){let r=`Math.${t}(…)`;return function(n,o){let a,i;if("BinaryExpression"!==n.type||"*"!==n.operator||(li(n.left,"log")&&la(n.right,e)?(a=n.left,i=`Math.log(…) * Math.${e}`):li(n.right,"log")&&la(n.left,e)&&(a=n.right,i=`Math.${e} * Math.log(…)`),!a))return;let[s]=a.arguments;return{node:n,messageId:lo,data:{replacement:r,description:i},fix:e=>e.replaceText(n,`Math.${t}(${to(s,o)})`)}}}function ll({constantName:e,replacementMethod:t}){let r={messageId:lo,data:{replacement:`Math.${t}(…)`,description:`Math.log(…) / Math.${e}`}};return function(n,o){if(!("BinaryExpression"===n.type&&"/"===n.operator&&li(n.left,"log")&&la(n.right,e)))return;let[a]=n.left.arguments;return{...r,node:n,fix:e=>e.replaceText(n,`Math.${t}(${to(a,o)})`)}}}let lu=[ls({constantName:"LOG10E",replacementMethod:"log10"}),ls({constantName:"LOG2E",replacementMethod:"log2"}),ll({constantName:"LN10",replacementMethod:"log10"}),ll({constantName:"LN2",replacementMethod:"log2"})],lp=e=>"BinaryExpression"===e.type&&"+"===e.operator?[e.left,e.right].flatMap(e=>lp(e)):[e],lc="number-literal-case",ld=(e,{hexadecimalValue:t})=>{let r=e.toLowerCase();return r.startsWith("0x")&&(r="0x"+r.slice(2)["lowercase"===t?"toLowerCase":"toUpperCase"]()),r},lm={create:a8(e=>{e.on("Literal",t=>{let{raw:r}=t,n=e.options[0]??{};n.hexadecimalValue??="uppercase";let o=r;if(tp(t)?o=ld(r,n):tm(t)&&(o=ld(r.slice(0,-1),n)+"n"),r!==o)return{node:t,messageId:lc,fix:e=>e.replaceText(t,o)}})}),meta:{type:"suggestion",docs:{description:"Enforce proper case for numeric literals.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{hexadecimalValue:{enum:["uppercase","lowercase"]}}}],defaultOptions:[{hexadecimalValue:"uppercase"}],messages:{[lc]:"Invalid number literal casing."},languages:["js/js"]}},lf="error",lg="suggestion",ly={parseInt:!0,parseFloat:!0,NaN:!0,Infinity:!0,isNaN:!1,isFinite:!1},lh=e=>{let{parent:t}=e;return"UnaryExpression"===t.type&&"-"===t.operator&&t.argument===e};function lx(e,t){let{node:r,path:n}=e,[o]=n,{parent:a}=r,i=o;"Infinity"===o&&(i=lh(r)?"NEGATIVE_INFINITY":"POSITIVE_INFINITY");let s={node:r,messageId:lf,data:{description:o,property:i}};if("NEGATIVE_INFINITY"===i)return s.node=a,s.data.description="-Infinity",s.fix=function*(e){yield e.replaceText(a,"Number.NEGATIVE_INFINITY"),yield iG(e,a,t)},s;let l=e=>iZ(r,`Number.${i}`,t,e);return ly[o]||((e,t)=>{let{parent:r}=e;if("CallExpression"!==r.type||r.callee!==e||1!==r.arguments.length)return!1;let[n]=r.arguments;return"SpreadElement"!==n.type&&n2(n,t.sourceCode.getScope(e))})(r,t)?s.fix=l:s.suggest=[{messageId:lg,fix:l}],s}let lb={create:e=>{let{checkInfinity:t,checkNaN:r}=e.options[0];new sM({objects:Object.keys(ly).filter(e=>(!!t||"Infinity"!==e)&&(r||"NaN"!==e)),context:e,handle:lx,filter(t){let{node:r,path:n}=t,[o]=n;return!nG(r)&&!("Infinity"===o&&(e=>{if(!lh(e))return!1;let{parent:t}=e,{parent:r}=t;return"UnaryExpression"===r.type&&"delete"===r.operator&&r.argument===t})(r))&&!("parseInt"===o&&function(e,t){let{parent:r}=e;if("CallExpression"!==r.type||r.callee!==e)return!1;let n=r.arguments[1];return!n||"SpreadElement"!==n.type&&eV(n,t.sourceCode.getScope(n))?.value===10}(r,e))}}).listen()},meta:{type:"suggestion",docs:{description:"Prefer `Number` static methods over global functions and optionally static properties over global constants.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkInfinity:{type:"boolean",description:"Whether to check usage of the global `Infinity`."},checkNaN:{type:"boolean",description:"Whether to check usage of the global `NaN`."}}}],defaultOptions:[{checkInfinity:!1,checkNaN:!1}],messages:{[lf]:"Prefer `Number.{{property}}` over `{{description}}`.",[lg]:"Replace `{{description}}` with `Number.{{property}}`."},languages:["js/js"]}},lE="prefer-reflect-apply",lv=(e,t)=>(td(e)||"ThisExpression"===e.type)&&("ArrayExpression"===t.type||"Identifier"===t.type&&"arguments"===t.name),lS=(e,t,r,n)=>`Reflect.apply(${e.getText(t)}, ${e.getText(r)}, ${e.getText(n)})`,lC="prefer-set-size";var lD={exports:{}},lT=is(function(){var e,t,r,n;return p?lD.exports:(p=1,r=String.fromCodePoint||(e=String.fromCharCode,t=Math.floor,function(){var r,n,o=[],a=-1,i=arguments.length;if(!i)return"";for(var s="";++a<i;){var l=Number(arguments[a]);if(!isFinite(l)||l<0||l>1114111||t(l)!=l)throw RangeError("Invalid code point: "+l);l<=65535?o.push(l):(l-=65536,r=(l>>10)+55296,n=l%1024+56320,o.push(r,n)),(a+1==i||o.length>16384)&&(s+=e.apply(null,o),o.length=0)}return s}),n={parse:function(e,t,n){function o(t,r){return t.range[0]=r,t.raw=e.substring(r,t.range[1]),t}function a(t,r){return{type:"anchor",kind:t,range:[H-r,H],raw:e.substring(H-r,H)}}function i(t,r,n,o){return{type:"value",kind:t,codePoint:r,range:[n,o],raw:e.substring(n,o)}}function s(e,t,r,n){return n=n||0,i(e,t,H-(r.length+n),H)}function l(e){var t,r=e[0],n=r.charCodeAt(0);return Y&&1===r.length&&n>=55296&&n<=56319&&(t=h().charCodeAt(0))>=56320&&t<=57343?i("symbol",(n-55296)*1024+t-56320+65536,++H-2,H):i("symbol",n,H-1,H)}function u(t,r,n,o,a){return null==o&&(n=H-1,o=H),{type:"quantifier",min:t,max:r,greedy:!0,body:null,symbol:a,range:[n,o],raw:e.substring(n,o)}}function p(t,r,n,o){return{type:"characterClass",kind:t.kind,body:t.body,negative:r,range:[n,o],raw:e.substring(n,o)}}function c(t,r,n,o){return t.codePoint>r.codePoint&&V("invalid range in character class",t.raw+"-"+r.raw,n,o),{type:"characterClassRange",min:t,max:r,range:[n,o],raw:e.substring(n,o)}}function d(e){return"alternative"===e.type?e.body:[e]}function m(e){H+=e=e||1}function f(e){g(e)||V("character",e)}function g(t){var r=t.length;if(e.substring(H,H+r)===t)return m(r),t}function y(t){if(e[H]===t)return H++,t}function h(){return e[H]}function x(t){return e[H]===t}function b(t){return e[H+1]===t}function E(t){var r=e.substring(H).match(t);return r&&(H+=r[0].length),r}function v(){var t,r=[],n=H;for(r.push(S());y("|");)r.push(S());return 1===r.length?r[0]:{type:"disjunction",body:r,range:[n,t=H],raw:e.substring(n,t)}}function S(){for(var t,r,s=[],u=H;r=function(){if(H>=e.length||x("|")||x(")"))return null;var t,r=function(){switch(h()){case"^":return m(),a("start",1);case"$":return m(),a("end",1);case"\\":if(b("b"))return m(2),a("boundary",2);if(b("B"))return m(2),a("not-boundary",2);break;case"(":return C("(?=","lookahead","(?!","negativeLookahead");default:return}}();if(r){var s=H;if(t=T()||!1){if(!Y&&"group"===r.type)return t.body=d(r),o(t,r.range[0]),t;H=s,V("Expected atom")}return r}var u=function(){var t;switch(t=h()){case".":return m(),{type:"dot",range:[H-1,H],raw:"."};case"\\":if(m(),!(t=w())){if(!Y&&"c"==h())return i("symbol",92,H-1,H);V("atomEscape")}return t;case"[":return N();case"(":if(n.lookbehind&&(t=C("(?<=","lookbehind","(?<!","negativeLookbehind")))return t;if(n.namedGroups&&g("(?<")){var r,o,a,s,u,p=B();f(">");var c=D("normal",p.range[0]-3);return c.name=p,c}if(!n.modifiers||"(?"!==e.substring(H,H+2)||":"==e[H+2])return C("(?:","ignore","(","normal");return o=H,m(2),a=E(/^[sim]+/),y("-")&&":"!==h()?(r=E(/^[sim]+/))||V("Invalid flags for modifiers group"):a||V("Invalid flags for modifiers group"),((s=(a=a?a[0]:"")+(r=r?r[0]:"")).length>3||function(e){for(var t=0;t<e.length;){if(-1!=e.indexOf(e[t],t+1))return!0;t++}return!1}(s))&&V("flags cannot be duplicated for modifiers group"),y(":")||V("Invalid flags for modifiers group"),(u=D("ignore",o)).modifierFlags={enabling:a,disabling:r},u;case"]":case"}":if(!Y)return m(),l(t);break;case"^":case"$":case"*":case"+":case"?":case"{":case")":case"|":break;default:return m(),l(t)}}();if(u||(s=H,(t=T()||!1)&&(H=s,V("Expected atom")),!Y&&y("{")?u=l("{"):V("Expected atom")),t=T()||!1){var p=u.type,c=u.behavior;return"group"===p&&("negativeLookbehind"===c||"lookbehind"===c)&&V("Invalid quantifier","",t.range[0],t.range[1]),t.body=d(u),o(t,u.range[0]),t}return u}();)s.push(r);return 1===s.length?s[0]:{type:"alternative",body:s,range:[u,t=H],raw:e.substring(u,t)}}function C(e,t,r,n){var o,a=H;if(g(e))o=t;else{if(!g(r))return!1;o=n}return D(o,a)}function D(t,r){var n,o=v();o||V("Expected disjunction"),f(")");var a={type:"group",behavior:t,body:d(o),range:[r,n=H],raw:e.substring(r,n)};return"normal"==t&&K&&z++,a}function T(){var e,t,r,n,o=H;switch(h()){case"*":m(),e=u(0,void 0,void 0,void 0,"*");break;case"+":m(),e=u(1,void 0,void 0,void 0,"+");break;case"?":m(),e=u(0,1,void 0,void 0,"?");break;case"{":(n=E(/^\{(\d+)\}/))?e=u(t=parseInt(n[1],10),t,o,H):(n=E(/^\{(\d+),\}/))?e=u(t=parseInt(n[1],10),void 0,o,H):(n=E(/^\{(\d+),(\d+)\}/))&&((t=parseInt(n[1],10))>(r=parseInt(n[2],10))&&V("numbers out of order in {} quantifier","",o,H),e=u(t,r,o,H)),(t&&!Number.isSafeInteger(t)||r&&!Number.isSafeInteger(r))&&V("iterations outside JS safe integer range in quantifier","",o,H)}return e&&y("?")&&(e.greedy=!1,e.range[1]+=1),e}function A(t,r){if(r){var n,o;if("unicodeEscape"==t.kind&&(n=t.codePoint)>=55296&&n<=56319&&x("\\")&&b("u")){var a=H;H++;var i=w(!0);"unicodeEscape"==i.kind&&(o=i.codePoint)>=56320&&o<=57343?(t.kind="unicodeCodePointEscape",t.codePoint=(n-55296)*1024+o-56320+65536,t.range[1]=H,t.raw=e.substring(t.range[0],H)):H=a}}return t}n||(n={});function w(t){var r,a,i,u,p=H;switch(u=h()){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return function(t){var r,n,a=H;if(r=E(/^(?!0)\d+/)){var i,u,p=parseInt(n=r[0],10);if(p<=z&&!t)return u=H-1-(i=n).length,{type:"reference",matchIndex:parseInt(i,10),range:[u,H],raw:e.substring(u,H)};if(_.push(p),K?G=!0:k(a,H),m(-n.length),r=E(/^[0-7]{1,3}/))return s("octal",parseInt(r[0],8),r[0],1);var c=H;return o(r=l(E(/^[89]/)),c-1)}return!!(r=E(/^[0-7]{1,3}/))&&(("0"!==(n=r[0])&&k(a,H),/^0{1,3}$/.test(n))?s("null",0,"0",n.length):s("octal",parseInt(n,8),n,1))}(t);case"B":if(!t)return L();V("\\B not possible inside of CharacterClass","",p);break;case"b":if(t)return m(),s("singleEscape",8,"\\b");return L();case"c":if(t){if(!Y&&(i=E(/^c(\d)/)))return s("controlLetter",i[1]+16,i[1],2);else if(!Y&&g("c_"))return s("controlLetter",31,"_",2)}return j();case"d":case"D":case"w":case"W":case"s":case"S":return m(),{type:"characterClassEscape",value:u,range:[H-2,H],raw:e.substring(H-2,H)};case"k":return function(){if(n.namedGroups&&E(/^k<(?=.*?>)/)){var t,r=B();return f(">"),t=r.range[0]-3,{type:"reference",name:r,range:[t,H],raw:e.substring(t,H)}}}()||L();case"p":case"P":return a=H,!!(n.unicodePropertyEscape&&Y&&(r=E(/^([pP])\{([^}]+)\}/)))&&{type:"unicodePropertyEscape",negative:"P"===r[1],value:r[2],range:[a-1,H],raw:e.substring(a-1,H)}||L();case"-":if(t&&Y)return m(),s("singleEscape",45,"\\-");return L();default:return j()}}function k(e,t){Y&&V("Invalid decimal escape in unicode mode",null,e,t)}function I(e){var t;return(t=E(/^u([0-9a-fA-F]{4})/))?A(s("unicodeEscape",parseInt(t[1],16),t[1],2),e):e&&(t=E(/^u\{([0-9a-fA-F]+)\}/))?s("unicodeCodePointEscape",parseInt(t[1],16),t[1],4):void 0}function j(){var e,t=H;switch(h()){case"t":return m(),s("singleEscape",9,"\\t");case"n":return m(),s("singleEscape",10,"\\n");case"v":return m(),s("singleEscape",11,"\\v");case"f":return m(),s("singleEscape",12,"\\f");case"r":return m(),s("singleEscape",13,"\\r");case"c":if(e=E(/^c([a-zA-Z])/))return s("controlLetter",e[1].charCodeAt(0)%32,e[1],2);break;case"x":if(e=E(/^x([0-9a-fA-F]{2})/))return s("hexadecimalEscape",parseInt(e[1],16),e[1],2);break;case"u":if(e=I(Y))return(!e||e.codePoint>1114111)&&V("Invalid escape sequence",null,t,H),e}return L()}function F(t){var n=h(),o=H;if("\\"===n){m();var a=I(!0);return a&&t(a.codePoint)||V("Invalid escape sequence",null,o,H),r(a.codePoint)}var i=n.charCodeAt(0);if(i>=55296&&i<=56319){var s=(n+=e[H+1]).charCodeAt(1);s>=56320&&s<=57343&&(i=(i-55296)*1024+s-56320+65536)}if(t(i))return m(),i>65535&&m(),n}function B(){var t,r=H,n=F(R);for(n||V("Invalid identifier");t=F(P);)n+=t;return{type:"identifier",value:n,range:[r,H],raw:e.substring(r,H)}}function R(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=128&&/[\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\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\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\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\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\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\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\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\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\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\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-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2-\uDFF6]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/.test(r(e))}function P(e){return R(e)||e>=48&&e<=57||e>=128&&/[\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDD30-\uDD39\uDD40-\uDD49\uDD69-\uDD6D\uDEAB\uDEAC\uDEFA-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC66-\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDCF0-\uDCF9\uDD00-\uDD02\uDD27-\uDD34\uDD36-\uDD3F\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE-\uDDD9\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDFB8-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD0\uDFD2\uDFE1\uDFE2]|\uD805[\uDC35-\uDC46\uDC50-\uDC59\uDC5E\uDCB0-\uDCC3\uDCD0-\uDCD9\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDE50-\uDE59\uDEAB-\uDEB7\uDEC0-\uDEC9\uDED0-\uDEE3\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC2C-\uDC3A\uDCE0-\uDCE9\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDD50-\uDD59\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99\uDF60-\uDF67\uDFF0-\uDFF9]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC50-\uDC59\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD50-\uDD59\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDDA0-\uDDA9\uDDE0-\uDDE9\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42\uDF50-\uDF5A]|\uD80D[\uDC40\uDC47-\uDC55]|\uD818[\uDD1E-\uDD39]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDEF0-\uDEF4\uDF30-\uDF36\uDF50-\uDF59]|\uD81B[\uDD70-\uDD79\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDCF0-\uDCF9\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDD40-\uDD49\uDEAE\uDEEC-\uDEF9]|\uD839[\uDCEC-\uDCF9\uDDEE\uDDEF\uDDF1-\uDDFA\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9]|\uDB40[\uDD00-\uDDEF]/.test(r(e))}function L(){var t,r=h();return Y&&/[\^$.*+?()\\[\]{}|/]/.test(r)||!Y&&"c"!==r?"k"===r&&n.lookbehind?null:s("identifier",(t=e.substring(H,H+=1)).charCodeAt(0),t,1):null}function N(){var e,t=H;return g("[^")?(e=$(),f("]"),p(e,!0,t,H)):y("[")?(e=$(),f("]"),p(e,!1,t,H)):null}function $(){var e,t;return x("]")?{kind:"union",body:[]}:X?function(){var e,t=[],r=O(!0);for(t.push(r),e="classRange"===r.type?"union":x("&")?"intersection":x("-")?"subtraction":"union";!x("]");)"intersection"===e?(f("&"),f("&"),x("&")&&V("&& cannot be followed by &. Wrap it in brackets: &&[&].")):"subtraction"===e&&(f("-"),f("-")),t.push(r=O("union"===e));return{kind:e,body:t}}():((t=M())||V("classAtom"),(e=x("]")?[t]:function e(t){if(x("-")&&!b("]")){r=t.range[0],m(),i=l("-"),(a=M())||V("classAtom"),n=H;var r,n,o,a,i,s,u=$();return(u||V("classContents"),"codePoint"in t&&"codePoint"in a?o=[c(t,a,r,n)]:Y?V("invalid character class"):o=[t,i,a],"empty"===u.type)?o:o.concat(u.body)}return(s=M())||V("classAtom"),(o=x("]")?s:e(s))||V("nonEmptyClassRangesNoDash"),[t].concat(o)}(t))||V("nonEmptyClassRanges"),{kind:"union",body:e})}function M(){return y("-")?l("-"):function(){var e;switch(e=h()){case"\\":if(m(),!(e=w(!0))){if(!Y&&"c"==h())return l("\\");V("classEscape")}return A(e,Y);case"]":case"-":break;default:return m(),l(e)}}()}function O(t){var r,n,o=H;if(y("\\"))if(g("q{"))return function(){var t,r=H-3,n=[];do n.push(function(){for(var t,r,n=[],o=H;r=q();)n.push(r);return{type:"classString",characters:n,range:[o,t=H],raw:e.substring(o,t)}}());while(y("|"));return f("}"),{type:"classStrings",strings:n,range:[r,t=H],raw:e.substring(r,t)}}();else if(n=w(!0))r=n;else{if(n=W())return n;V("Invalid escape","\\"+h(),o)}else if(n=U())r=n;else{if(n=N())return n;V("Invalid character",h())}if(t&&x("-")&&!b("-")){if(m(),n=q())return c(r,n,o,H);V("Invalid range end",h())}return r}function q(){if(y("\\")){var e,t=H;if(e=W())return e;V("Invalid escape","\\"+h(),t)}return U()}function U(){var e;if(E(/^(?:&&|!!|##|\$\$|%%|\*\*|\+\+|,,|\.\.|::|;;|<<|==|>>|\?\?|@@|\^\^|``|~~)/)&&V("Invalid set operation in character class"),e=E(/^[^()[\]{}/\-\\|]/))return l(e)}function W(){var e;if(y("b"))return s("singleEscape",8,"\\b");if(y("B"))V("\\B not possible inside of ClassContents","",H-2);else if(e=E(/^[&\-!#%,:;<=>@`~]/))return s("identifier",e[0].codePointAt(0),e[0]);else if(e=j())return e;else return null}function V(t,r,n,o){n=null==n?H:n,o=null==o?n:o;var a=Math.max(0,n-10),i=Math.min(o+10,e.length),s=" "+e.substring(a,i),l=" "+Array(n-a+1).join(" ")+"^";throw SyntaxError(t+" at position "+n+(r?": "+r:"")+"\n"+s+"\n"+l)}var _=[],z=0,K=!0,G=!1,J=-1!==(t||"").indexOf("u"),X=-1!==(t||"").indexOf("v"),Y=J||X,H=0;if(X&&!n.unicodeSet)throw Error('The "v" flag is only supported when the .unicodeSet option is enabled.');if(J&&X)throw Error('The "u" and "v" flags are mutually exclusive.');""===(e=String(e))&&(e="(?:)");var Q=v();return(Q.range[1]!==e.length&&V("Could not parse entire input - got stuck","",Q.range[1]),G=G||_.some(function(e){return e<=z}))?(H=0,K=!1,v()):Q}},lD.exports?lD.exports=n:window.regjsparser=n,lD.exports)}());let lA=String.raw`\$&`,lw=new i(String.raw`\^$.*+?()[]{}|/-`),{parse:lk}=lT,lI="method",lj="pattern",lF="split-join",lB=new i(["i","y"]),lR=new i(["anchor","reference"]),lP=e=>String.raw`\u{${e.toString(16).toUpperCase()}}`;function lL(e){let{kind:t,codePoint:r,raw:n}=e;if("controlLetter"===t)return 13===r?String.raw`\r`:10===r?String.raw`\n`:9===r?String.raw`\t`:lP(r);if("null"===t||"octal"===t)return lP(r);let o=n;return(("identifier"===t||"symbol"===t&&n.length>1&&n.startsWith("\\"))&&(o=o.slice(1)),"'"===o||"\\"===o)?`\\${o}`:o}function lN(e){return"value"===e.type?lL(e):"characterClass"!==e.type||e.negative||1!==e.body.length||"value"!==e.body[0].type?"quantifier"===e.type&&1===e.min&&1===e.max||"group"===e.type&&"ignore"===e.behavior?l$(e.body):void 0:lL(e.body[0])}function l$(e){let t=[];for(let r of e){let e=lN(r);if(void 0===e)return;t.push(e)}return t.join("")}let lM=e=>{let{pattern:t,flags:r}=e.regex;try{return lk(t,r,{unicodePropertyEscape:r.includes("u"),unicodeSet:r.includes("v"),namedGroups:!0,lookbehind:!0})}catch{}},lO=e=>{let t=0;for(let r of e)t+=lq(r);return t};function lq(e){return lR.has(e.type)?0:["value","dot","characterClass","characterClassEscape","unicodePropertyEscape"].includes(e.type)?1:"alternative"===e.type?lO(e.body):"disjunction"===e.type?Math.min(...e.body.map(e=>lq(e))):"quantifier"===e.type?e.min*lO(e.body):"group"===e.type&&"ignore"===e.behavior?lO(e.body):0}let lU=e=>"group"===e.type&&"normal"===e.behavior||Array.isArray(e.body)&&e.body.some(e=>lU(e)),lW=e=>tp(e)&&Number.isSafeInteger(e.value)&&e.value>=0,lV=(e,t)=>{if("BinaryExpression"===e.type&&"+"===e.operator&&(rk(e.left,t)&&ti(e.right,1)||ti(e.left,1)&&rk(e.right,t)))return t},l_=e=>tp(e)?e.value:"UnaryExpression"===e.type&&"-"===e.operator?-l_(e.argument):void 0,lz=e=>e?.type==="MemberExpression"&&!1===e.computed&&"Identifier"===e.property.type&&"length"===e.property.name,lK="prefer-string-trim-start-end",lG="no-unreadable-iife",lJ="suggestion",lX="throw-new-error",lY=/^(?:[A-Z][\da-z]*)*Error$/,lH="escape-uppercase",lQ="escape-lowercase",lZ=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+})/g,l0=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+}|c[A-Za-z])/g,l1=({node:e,original:t,regex:r=lZ,lowercase:n,fix:o})=>{let a=t.replace(r,e=>e[0]+e.slice(1)[n?"toLowerCase":"toUpperCase"]());if(a!==t)return{node:e,messageId:n?lQ:lH,fix:t=>o?o(t,a):t.replaceText(e,a)}},l2="prefer-unicode-code-point-escapes",l3="prefer-unicode-code-point-escapes/add-unicode-flag",l8=String.raw`\u{`,l6=/^[\da-f]$/iv,l9=/^[0-7]$/v,l5=/^[A-Za-z]$/v;function l4(e){return l9.test(e)}function l7(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==0}function ue(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==1}function ut(e,t,r){let n=e.slice(t,t+r);if(!(n.length!==r||[...n].some(e=>!l6.test(e))))return Number.parseInt(n,16)}function ur(e){return e>=55296&&e<=56319}function un(e){return e>=56320&&e<=57343}function uo(e){return String.raw`\u{${e.toString(16).toUpperCase()}}`}function ua(e,{isRegex:t=!1,supportsNestedCharacterClasses:r=!1}={}){let n="",o=0,a=!1;for(let i=0;i<e.length;i++){let s=e[i],l=o>0;if(t&&"["===s&&(!l||r)&&!ue(e,i)){o++,n+=s;continue}if(t&&"]"===s&&l&&!ue(e,i)){o--,n+=s;continue}if("\\"!==s||!l7(e,i)){n+=s;continue}let u=function(e,t,{isRegex:r,isInCharacterClass:n}){return function(e,t){if("x"!==e[t+1])return;let r=ut(e,t+2,2);if(void 0!==r)return{end:t+4,replacement:uo(r)}}(e,t)??function(e,t,{allowSurrogatePair:r,allowSurrogate:n}){if("u"!==e[t+1]||"{"===e[t+2])return;let o=ut(e,t+2,4);if(void 0===o||!n&&(ur(o)||un(o)))return;let a=t+6;if(r&&ur(o)&&"\\"===e[a]&&l7(e,a)&&"u"===e[a+1]){let t=ut(e,a+2,4);if(un(t))return{end:a+6,replacement:uo((o-55296)*1024+(t-56320)+65536)}}return{end:t+6,replacement:uo(o)}}(e,t,{allowSurrogatePair:!n,allowSurrogate:!r||!n})??(r?function(e,t){let r=e[t+2];if("c"===e[t+1]&&l5.test(r))return{end:t+3,replacement:uo(r.toUpperCase().codePointAt(0)%32)}}(e,t):function(e,t){let r=e[t+1];if("0"===r&&!l4(e[t+2])||!l4(r))return;let n=r>="0"&&r<="3"?3:2,o=t+1;for(;o<t+1+n&&l4(e[o]);)o++;return{end:o,replacement:uo(Number.parseInt(e.slice(t+1,o),8))}}(e,t))}(e,i,{isRegex:t,isInCharacterClass:l});if(!u){n+=s;continue}n+=u.replacement,i=u.end-1,a=!0}return{fixed:n,hasReplacement:a}}function ui(e,t,r){let{fixed:n,hasReplacement:o}=ua(t);if(o)return{node:e,messageId:l2,fix:t=>r?r(t,n):t.replaceText(e,n)}}function us(e){return e.includes("u")||e.includes("v")?e:`${e}u`}let ul=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],uu=["Error","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","AggregateError","SuppressedError"],up="missing-message",uc="message-is-empty-string",ud="message-is-not-a-string",um=new o([["AggregateError",1],["SuppressedError",2]]),uf=e=>"instanceof"===e.value&&"Keyword"===e.type,ug="no-instanceof-builtins",uy="switch-to-type-of",uh=new i(["String","Number","Boolean","BigInt","Symbol"]),ux=new i(["global","globalThis","self","window"]),ub=[...uu,"Map","Set","WeakMap","WeakRef","WeakSet","ArrayBuffer",...r9,"Object","RegExp","Promise","Proxy","DataView","Date","SharedArrayBuffer","FinalizationRegistry"],uE=(e,t,r)=>function*(n){let{left:o,right:a}=e,i=r0(t,e),s=i.getTokenAfter(o,uf),{sourceCode:l}=t,u=l.getAncestors(e).findLast(e=>"VExpressionContainer"===e.type),p=u?'"'===l.getText(u)[0]?"'":'"':"'";yield iG(n,e,t);let c=tn(o,{sourceCode:i});!ta(o,t)&&ia(o,"typeof")?(yield n.insertTextBeforeRange(c,"typeof ("),yield n.insertTextAfterRange(c,")")):yield n.insertTextBeforeRange(c,"typeof "),yield n.replaceText(s,"===");let d=tn(a,{sourceCode:i});yield n.replaceTextRange(d,p+r.toLowerCase()+p)},uv=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,uS={create:a8(e=>{let{useErrorIsError:t=!1,strategy:r="loose",include:n=[],exclude:o=[]}=e.options[0]??{},a=new i("strict"===r?[...ub,...n]:n);e.on("BinaryExpression",r=>{let{right:n,operator:i}=r;if("instanceof"!==i)return;let s="Identifier"===n.type?{name:n.name,referenceText:n.name}:"MemberExpression"===n.type&&!n.computed&&"Identifier"===n.property.type&&"Identifier"===n.object.type&&ux.has(n.object.name)&&oA(n.object,e)?{name:n.property.name,referenceText:e.sourceCode.getText(n)}:void 0;if(!s||o.includes(s.name))return;let{name:l,referenceText:u}=s,p={node:r,messageId:ug};if("Array"===l||"Error"===l&&t){let t="Array"===l?"isArray":"isError",n=`${u}.${t}`;return p.fix=function*(t){let{left:o,right:a}=r,i=r0(e,r),s=i.getTokenAfter(o,uf);yield iG(t,r,e);let l=tn(o,{sourceCode:i});yield t.insertTextBeforeRange(l,n+"("),yield t.insertTextAfterRange(l,")"),yield i2(s,"",t,e,i),yield i2(a,"",t,e,i)},p}return"Function"===l?(uv(n,e)||(p.fix=uE(r,e,l)),p):uh.has(l)?(uv(n,e)||(p.suggest=[{messageId:uy,data:{type:l.toLowerCase()},fix:uE(r,e,l)}]),p):a.has(l)?p:void 0})}),meta:{type:"problem",docs:{description:"Disallow `instanceof` with built-in objects",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",properties:{useErrorIsError:{type:"boolean"},strategy:{enum:["loose","strict"]},include:{type:"array",items:{type:"string"}},exclude:{type:"array",items:{type:"string"}}},additionalProperties:!1}],defaultOptions:[{useErrorIsError:!1,strategy:"loose",include:[],exclude:[]}],hasSuggestions:!0,messages:{[ug]:"Avoid using `instanceof` for type checking as it can lead to unreliable results.",[uy]:"Switch to `typeof … === '{{type}}'`."},languages:["js/js"]}},uC="prefer-type-error",uD=new i(["isArguments","isArray","isArrayBuffer","isArrayLike","isArrayLikeObject","isBigInt","isBoolean","isBuffer","isDate","isElement","isError","isFinite","isFunction","isInteger","isLength","isMap","isNaN","isNative","isNil","isNull","isNumber","isObject","isObjectLike","isPlainObject","isPrototypeOf","isRegExp","isSafeInteger","isSet","isString","isSymbol","isTypedArray","isUndefined","isView","isWeakMap","isWeakSet","isWindow","isXMLDoc"]),uT=new i(["isNaN","isFinite"]),uA=(e,t,r)=>void 0!==t&&t.arguments.length>0&&"Identifier"===e.type&&(!0===r&&uD.has(e.name)||!1===r&&uT.has(e.name)),uw=(e,t)=>!!uA(e.property,t,!0)||"MemberExpression"===e.object.type&&uw(e.object,t),uk=/^(?:[A-Z][\da-z]*)*Error$/,uI=e=>"UnaryExpression"===e.type&&"typeof"===e.operator,uj=(e,t)=>{switch(e.type){case"Identifier":return uA(e,t,!1);case"MemberExpression":return uw(e,t);case"CallExpression":return uj(e.callee,e);case"UnaryExpression":return"typeof"===e.operator||"!"===e.operator&&uj(e.argument);case"BinaryExpression":{let{operator:r,left:n,right:o}=e;if("instanceof"===r)return!("Identifier"===o.type?uk.test(o.name):"MemberExpression"===o.type&&!o.optional&&!o.computed&&"Identifier"===o.property.type&&uk.test(o.property.name));if((e=>{let{operator:t,left:r,right:n}=e;return("=="===t||"!="===t||"==="===t||"!=="===t)&&(uI(r)&&ti(n,"undefined")||uI(n)&&ti(r,"undefined"))})(e))return!1;return uj(n,t)||uj(o,t)}case"LogicalExpression":return uj(e.left,t)&&uj(e.right,t);default:return!1}},uF="consistentDestructuring",uB="consistentDestructuringSuggest",uR=new i(["FunctionDeclaration","FunctionExpression","MethodDefinition","PropertyDefinition","AccessorProperty","StaticBlock","Program"]),uP=e=>{for(;e.parent;)if(e=e.parent,uR.has(e.type))return e},uL=e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type,uN=(e,t,r,n)=>{for(let o of e){if(o.key.name!==t)continue;let e=eS(n.getScope(o.value),o.value);if(e&&eS(r,o.value)===e)return o}},u$=({declaration:e,memberExpressionNode:t,memberScope:r,memberRootIdentifier:n,memberRootVariable:o,memberThisScopeBoundary:a,memberExpressionWrites:i,sourceCode:s})=>{if(!((e,t,r)=>{let[,n]=r.getRange(e.object),[o]=r.getRange(t);return n<o})(e,t,s)||e.rootIdentifierName&&n?.name===e.rootIdentifierName&&o!==e.rootVariable||e.thisScopeBoundary&&a!==e.thisScopeBoundary||((e,t,r,n)=>{if(!e.rootVariable)return!1;let[,o]=n.getRange(e.object),[a]=n.getRange(t);return e.rootVariable.references.some(e=>{if(!e.isWrite())return!1;let[t]=n.getRange(e.identifier);return!(t<o)&&(e.from.variableScope!==r.variableScope||t<=a)})})(e,t,r,s)||(({declaration:e,memberExpressionNode:t,memberScope:r,memberExpressionWrites:n,sourceCode:o})=>{let[,a]=o.getRange(e.object),[i]=o.getRange(t),s=t.property.name,l=rN(t.object),u="Identifier"===l.type?l.name:void 0,p="Identifier"===l.type?eS(r,l):void 0,c="ThisExpression"===l.type?uP(l):void 0;return n.some(e=>e.propertyName===s&&e.rootIdentifierName===u&&e.rootVariable===p&&e.thisScopeBoundary===c&&(e.scope.variableScope!==r.variableScope||e.start>=a&&e.start<=i))})({declaration:e,memberExpressionNode:t,memberScope:r,memberExpressionWrites:i,sourceCode:s}))return!1;for(var l=r,u=e.scope;l;){if(l===u)return!0;l=l.upper}return!1},uM=(e,t,r)=>!!("BinaryExpression"===e.type&&"in"===e.operator&&ts(e.left))&&"Identifier"===t.property.type&&e.left.value===t.property.name&&r.getText(e.right)===r.getText(t.object)||"LogicalExpression"===e.type&&"&&"===e.operator&&(uM(e.left,t,r)||uM(e.right,t,r)),uO=(e,t,r,n)=>{switch(e.type){case"ConditionalExpression":case"IfStatement":return e.consequent===t&&uM(e.test,r,n);case"LogicalExpression":return"&&"===e.operator&&e.right===t&&uM(e.left,r,n);default:return!1}},uq=e=>["AccessorProperty","FunctionDeclaration","MethodDefinition","PropertyDefinition"].includes(e.type),uU=["Object","Array","ArrayBuffer","DataView","Date","Function","Map","WeakMap","Set","WeakSet","Promise","RegExp","SharedArrayBuffer","Proxy","WeakRef","FinalizationRegistry","DisposableStack","AsyncDisposableStack",...uu,...["Collator","DateTimeFormat","DisplayNames","DurationFormat","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"].map(e=>`Intl.${e}`),...["Duration","Instant","PlainDate","PlainDateTime","PlainMonthDay","PlainTime","PlainYearMonth","ZonedDateTime"].map(e=>`Temporal.${e}`),...["Module","Instance","Memory","Table","Global","Tag","Exception","CompileError","LinkError","RuntimeError"].map(e=>`WebAssembly.${e}`),...r9],uW=["Temporal.Now","WebAssembly","WebAssembly.JSTag"],uV="error-date",u_="suggestion-date";function uz(e){let{node:t}=e;return{node:t,messageId:"disallowCallOrNew",data:{name:e.path.join(".")}}}let uK=new sM({objects:["BigInt","Boolean","Number","String","Symbol"],type:sM.CONSTRUCT,handle:function(e,t){let{node:r}=e,n=e.path.join("."),o={node:r,messageId:"disallow",data:{name:n}};return"String"!==n&&"Boolean"!==n&&"Number"!==n&&(o.fix=e=>iz(r,t,e)),o}}),uG=new sM({objects:uU,type:sM.CALL,handle:function(e,t){let{node:r}=e;if(r.optional||r3(r.callee))return;let n=e.path.join(".");if("Object"===n){let{parent:e}=r;if("BinaryExpression"===e.type&&("==="===e.operator||"!=="===e.operator)&&(e.left===r||e.right===r))return}else if("Date"===n){function*o(e){yield e.replaceText(r,"String(new Date())"),yield iG(e,r,t)}let e={node:r,messageId:uV};return 0===t.sourceCode.getCommentsInside(r).length&&0===r.arguments.length?e.fix=o:e.suggest=[{messageId:u_,fix:o}],e}return{node:r,messageId:"enforce",data:{name:n},fix:e=>iJ(r,t,e)}}}),uJ=new sM({objects:uW,type:sM.CALL,handle:uz}),uX=new sM({objects:uW,type:sM.CONSTRUCT,handle:uz}),uY="error/array-push",uH="suggestion",uQ=e=>tF(e,{property:"classList",computed:!1}),uZ=e=>e.arguments.some(e=>"SpreadElement"===e.type),u0=[{description:"Array#push()",test:e=>tR(e,{method:"push",optionalCall:!1}),checkArrayReceiver:!0,ignore:["stream.push","this.push","this.stream.push","process.stdin.push","process.stdout.push","process.stderr.push"]},{description:"Array#unshift()",test:e=>tR(e,{method:"unshift",optionalCall:!1}),checkArrayReceiver:!0,keepSecondCall:!0,ignore:["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"]},{description:"Element#classList.add()",test:e=>tR(e,{method:"add",optionalCall:!1,optionalMember:!1})&&uQ(e.callee.object)},{description:"Element#classList.remove()",test:e=>tR(e,{method:"remove",optionalCall:!1,optionalMember:!1})&&uQ(e.callee.object)},{description:"importScripts()",test:e=>tb(e,{name:"importScripts"},ty)}],u1={create:function(e){let{ignore:t}=e.options[0],{sourceCode:r}=e;e.on("CallExpression",function*(n){for(let{description:o,test:a,ignore:i=[],keepSecondCall:s=!1,checkArrayReceiver:l=!1}of u0){if(!a(n))continue;let u=function(e,{test:t,ignoredCallee:r,checkArrayReceiver:n},o){let a;if(tM(e.callee,r))return;let i=("ChainExpression"===(a=e.parent).type&&e===a.expression&&(a=a.parent),"ExpressionStatement"===a.type?a:void 0);if(!i)return;let s=im(i,o,-1);if(s?.type!=="ExpressionStatement")return;let l=function(e){let{expression:t}=e;return"ChainExpression"===t.type?t.expression:t}(s);if(!(!t(l)||!rk(l.callee,e.callee)||n&&nL(e.callee.object,o)))return{firstCall:l,firstExpressionStatement:s,secondExpressionStatement:i}}(n,{test:a,ignoredCallee:[...i,...t],checkArrayReceiver:l},e);if(!u)continue;let{firstCall:p,firstExpressionStatement:c,secondExpressionStatement:d}=u,{shouldKeepSecondCall:m,shouldPrependSourceArguments:f,targetCall:g,sourceCall:y}=function(e,t,r){let n=r&&(!r3(t.callee)||r3(e.callee));return{shouldKeepSecondCall:n,shouldPrependSourceArguments:r&&!n,targetCall:n?t:e,sourceCall:n?e:t}}(p,n,s),h=y.arguments,x=r.getRange(c),b=r.getRange(d),E=m?[x[0],b[0]]:[x[1],b[1]],v=!m&&!eA(r.getLastToken(c))&&eA(r.getLastToken(d)),S=m&&aL(r.getTokenBefore(c),e,r.text.slice(b[0],b[0]+1)),C={node:"Identifier"===n.callee.type?n.callee:n.callee.property,messageId:uY,data:{description:o}},D=function*(t){if(h.length>0){let r=rT(e,y,!f),{openingParenthesisToken:n,trailingCommaToken:o,closingParenthesisToken:a}=rD(g,e);f?yield t.insertTextAfter(n,g.arguments.length>0?`${r}, `:r):yield o?t.insertTextAfter(o,` ${r}`):t.insertTextBefore(a,g.arguments.length>0?`, ${r}`:r)}yield t.replaceTextRange(E,v||S?";":"")};!function(e,t){return e.getAllComments().some(r=>{let[n,o]=e.getRange(r);return n>=t[0]&&o<=t[1]})}(r,E)&&(function(e,t,r,n){let o=r?[...e.arguments,...t.arguments]:t.arguments;return r&&(uZ(e)||uZ(t))||r&&o.some(e=>null===eV(e,n.getScope(e)))||o.some(e=>eH(e,n))}(p,n,s,r)?C.suggest=[{messageId:uH,fix:D}]:C.fix=D),yield C}})},meta:{type:"suggestion",docs:{description:"Enforce combining multiple `Array#{push,unshift}()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{ignore:{type:"array",items:{type:"string"},uniqueItems:!0,description:"Methods to ignore."}}}],defaultOptions:[{ignore:[]}],messages:{[uY]:"Do not call `{{description}}` multiple times.",[uH]:"Merge with previous one."},languages:["js/js"]}},u2="no-process-exit",u3=e=>ti(e,"node:worker_threads")||ti(e,"worker_threads"),u8="no-single-promise-in-promise-methods/error",u6="no-single-promise-in-promise-methods/unwrap",u9="no-single-promise-in-promise-methods/use-promise-resolve",u5=["all","any","race"],u4=(e,t)=>{let[r]=e.arguments[0].elements,n=to(r,t);return!ta(r,t)&&16>a5(r)&&(n=`(${n})`),n},u7=(e,t)=>e.getCommentsInside(t).length>0,pe=e=>"ArrayPattern"===e.type&&!e.typeAnnotation&&1===e.elements.length&&e.elements[0]?.type==="Identifier",pt="no-static-only-class",pr=({type:e,value:t})=>"Punctuator"===e&&"="===t,pn=e=>"PropertyDefinition"===e.type,po="ignored-elements",pa="property-assignment",pi={create:e=>{let{sourceCode:t}=e,{maximumIgnoredElements:r}=e.options[0];e.on("ArrayPattern",n=>{let{elements:o,parent:a}=n;if(function(e){let t=0,r=0;for(let n of e)null===n?t=Math.max(t,++r):r=0;return t}(o)<=r)return;let i={node:n,messageId:po},s=o.filter(e=>null!==e);if("VariableDeclarator"===a.type&&a.id===n&&null!==a.init&&1===s.length){let[r]=s;"AssignmentPattern"!==r.type&&(i.fix=function*(i){let s=o.indexOf(r),l="RestElement"===r.type,u=l?r.argument:r;yield i.replaceText(n,t.getText(u));let p=l?`.slice(${s})`:`[${s}]`,c=a.init;!ta(c,e)&&it(c,e)?(yield i.insertTextBefore(c,"("),yield i.insertTextAfter(a,`)${p}`)):yield i.insertTextAfter(a,p),yield iG(i,n,e)})}return i}),e.on("MemberExpression",e=>{if(function e(t){let{parent:r}=t;if(r){if(rL(r)&&r.expression===t||"AssignmentPattern"===r.type&&r.left===t||"RestElement"===r.type&&r.argument===t)return e(r);if("Property"===r.type&&r.value===t&&"ObjectPattern"===r.parent.type)return r.parent;if("ObjectPattern"===r.type||"ArrayPattern"===r.type)return r}}(e)?.type==="ArrayPattern")return{node:e,messageId:pa}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable array destructuring.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{maximumIgnoredElements:{type:"integer",minimum:0,description:"Maximum number of consecutive ignored elements allowed."}}}],defaultOptions:[{maximumIgnoredElements:1}],messages:{[po]:"Array destructuring may not contain consecutive ignored values.",[pa]:"Do not assign destructured values to object properties."},languages:["js/js"]}},ps="spread-in-list",pl="iterable-to-array",pu="iterable-to-array-in-for-of",pp="iterable-to-array-in-yield-star",pc="spread-in-collection-constructor",pd="spread-in-object-assign",pm="clone-array",pf="suggestion/remove-object-assign-spread",pg=["Map","WeakMap","Set","WeakSet"],py=["copyWithin","flat","slice","splice","toReversed","toSorted","toSpliced","with"],ph=[...py,"filter","flatMap","map"],px=e=>"ArrayExpression"===e.type&&1===e.elements.length&&e.elements[0]?.type==="SpreadElement",pb={ArrayExpression:"array literal",ObjectExpression:"object literal",CallExpression:"arguments",NewExpression:"arguments"};function*pE(e,t,r){let{sourceCode:n}=r,[o,a,i]=n.getFirstTokens(t,3);yield e.remove(o),yield e.remove(a);let[s,l]=n.getLastTokens(t,2);yield e.remove(l),eT(s)&&(yield e.remove(s));let{parent:u}=t;"ReturnStatement"!==u.type&&"ThrowStatement"!==u.type||u.argument!==t||oS(o,i,r)||ta(t,r)?yield iG(e,t,r):yield iV(e,u,r)}let pv=(e,t)=>"CallExpression"===e.type&&"MemberExpression"===e.callee.type&&nF(e.callee.object,t),pS="no-useless-switch-case/error",pC="no-useless-switch-case/suggestion",pD=e=>e.consequent.every(e=>tS(e)),pT=e=>tq(e.test)||td(e.test),pA=new i(["CallExpression","MemberExpression"]),pw=new i(["Identifier","MemberExpression","Super","ThisExpression"]),pk=e=>"MemberExpression"===(e=rN(e)).type?{...e,object:pk(e.object),property:e.computed?pk(e.property):e.property}:e,pI=(e,t)=>rk(pk(e),pk(t)),pj=e=>pw.has(rN(e).type),pF=(e,t)=>tF(e=rN(e),{property:"length",optional:!1,computed:!1})&&pI(e.object,t),pB=e=>!!("ChainExpression"===e.type||pA.has(e.type)&&e.optional)||Object.entries(e).some(([e,t])=>"parent"!==e&&!!t&&(Array.isArray(t)?t.some(e=>e?.type&&pB(e)):t.type&&pB(t))),pR="no-useless-undefined",pP="no-useless-undefined/suggestion",pL=new i(["is","equal","notEqual","strictEqual","notStrictEqual","propertyVal","notPropertyVal","not","include","property","toBe","toHaveBeenCalledWith","toContain","toContainEqual","toEqual","same","notSame","strictSame","strictNotSame"]),pN=e=>{for(;e;e=e.upper)if("function"===e.type)return e.block},p$={">=":{valid:!0,addend:0},">":{valid:!0,addend:-1},"<":{valid:!1,addend:0},"<=":{valid:!1,addend:-1}},pM={"<=":{valid:!0,addend:0},"<":{valid:!0,addend:-1},">":{valid:!1,addend:0},">=":{valid:!1,addend:-1}},pO={"<":{valid:!0,kind:"length"},"<=":{valid:!0,kind:"lengthMinusOne"},">=":{valid:!1,kind:"length"},">":{valid:!1,kind:"lengthMinusOne"}},pq={">":{valid:!0,kind:"length"},">=":{valid:!0,kind:"lengthMinusOne"},"<=":{valid:!1,kind:"length"},"<":{valid:!1,kind:"lengthMinusOne"}},pU=new i(["<","<=",">",">="]);function pW(e,t,r,n){let o=e[t];if(o&&r===n+o.addend)return o.valid}function pV(e,t){var r;return pF(e,t)?"length":"BinaryExpression"===(r=rN(r=e)).type&&"-"===r.operator&&1===ie(r.right)&&pF(r.left,t)?"lengthMinusOne":void 0}function p_(e,t,r){let n=e[t];if(n?.kind===r)return n.valid}let pz={create:e=>{let{sourceCode:t}=e,r=(e,r,n)=>{if(n){let r=pN(t.getScope(e));if(r?.returnType)return}return{node:e,messageId:pR,fix:r}},n=e.options[0];e.on("Identifier",o=>{if(!tq(o))return;let{parent:a}=o;if("ReturnStatement"===a.type&&a.argument===o){let n,a=pN(t.getScope(o));if(a?.returnType&&"TSUndefinedKeyword"!==(n=a.returnType?.typeAnnotation?.type)&&"TSVoidKeyword"!==n)return;return r(o,t=>i2(o,"",t,e))}if("YieldExpression"===a.type&&!a.delegate&&a.argument===o)return r(o,t=>i2(o,"",t,e));if(n.checkArrowFunctionBody&&"ArrowFunctionExpression"===a.type&&a.body===o)return r(o,t=>i2(o," {}",t,e),!0);if("VariableDeclarator"===a.type&&a.init===o&&"VariableDeclaration"===a.parent.type&&"const"!==a.parent.kind&&a.parent.declarations.includes(a)){let[,e]=t.getRange(a.id),[,n]=t.getRange(o);return r(o,t=>t.removeRange([e,n]))}if("AssignmentPattern"===a.type&&a.right===o)return r(o,function*(r){let{left:n}=a,[,i]=t.getRange(n),[,s]=t.getRange(o);yield r.removeRange([i,s]),(n.typeAnnotation||rQ(e.physicalFilename))&&!n.optional&&tw(a.parent)&&a.parent.params.includes(a)&&(yield n.typeAnnotation?r.insertTextBefore(n.typeAnnotation,"?"):r.insertTextAfter(n,"?"))})}),e.on("ConditionalExpression",r=>{let n=tq(r.consequent);if(n===tq(r.alternate))return;let o=n?r.alternate:r.consequent,a=function(e,t){if(!(!tF(e=rN(e),{computed:!0,optional:!1})||pB(e)||eH(e.object,t,{considerGetters:!0})||eH(e.property,t,{considerGetters:!0})))return{node:e,index:function(e){if("BinaryExpression"===(e=rN(e)).type&&"-"===e.operator){let t=ie(e.right);if(Number.isSafeInteger(t)&&t>0)return{node:e.left,offset:t}}return{node:e,offset:0}}(e.property)}}(o,t);if(!a||function(e,t){if(!("BinaryExpression"!==(e=rN(e)).type||!pU.has(e.operator)||pB(e)))return function(e,t){let{operator:r,left:n,right:o}=e,a=ie(n),i=ie(o);return Number.isSafeInteger(i)&&pI(n,t.node)?pW(p$,r,i,t.offset):Number.isSafeInteger(a)&&pI(o,t.node)?pW(pM,r,a,t.offset):void 0}(e,t.index)??function(e,t){if(0!==t.index.offset)return;let{operator:r,left:n,right:o}=e,a=pV(o,t.node.object);if(a&&pI(n,t.index.node))return p_(pO,r,a);let i=pV(n,t.node.object);if(i&&pI(o,t.index.node))return p_(pq,r,i)}(e,t)}(r.test,a)!==!n)return;let i={node:n?r.consequent:r.alternate,messageId:pR};return 0===t.getCommentsInside(r).length&&(i.suggest=[{messageId:pP,fix(n){let a=t.getText(o),i=aL(t.getTokenBefore(r),e,a)?";":"";return n.replaceText(r,i+a)}}]),i}),!n.checkArguments||rQ(e.physicalFilename)||e.on("CallExpression",t=>{var r;let n,o=t.arguments,a=o.at(-1);if(!(!tq(a)||("Identifier"===(r=t.callee).type?n=r.name:"MemberExpression"===r.type&&!1===r.computed&&"Identifier"===r.property.type&&(n=r.property.name),pL.has(n)||"push"===n||"unshift"===n||"includes"===n||"add"===n||"has"===n||"delete"===n||"set"===n||"createContext"===n||/^set[A-Z]/v.test(n)||"useRef"===n||"ref"===n))&&(!(!t.optional&&"MemberExpression"===t.callee.type&&!t.callee.computed&&"Identifier"===t.callee.property.type&&"bind"===t.callee.property.name)||1===o.length))return{node:a,messageId:pR,fix:t=>iq(t,a,e)}})},meta:{type:"suggestion",docs:{description:"Disallow useless `undefined`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkArguments:{type:"boolean",description:"Whether to check function arguments."},checkArrowFunctionBody:{type:"boolean",description:"Whether to check arrow function bodies."}}}],defaultOptions:[{checkArguments:!0,checkArrowFunctionBody:!0}],messages:{[pR]:"Do not use useless `undefined`.",[pP]:"Use the indexed access directly."},languages:["js/js"]}},pK="numeric-separators-style";function pG(e,{minimumDigits:t,groupLength:r},n){let{length:o}=e;if(o<t)return e;let a=[];if(n)for(let t=0;t<o;t+=r){let n=Math.min(t+r,o);a.push(e.slice(t,n))}else for(let t=o;t>0;t-=r){let n=Math.max(t-r,0);a.unshift(e.slice(n,t))}return a.join("_")}let pJ={binary:{minimumDigits:0,groupLength:4},octal:{minimumDigits:0,groupLength:4},hexadecimal:{minimumDigits:0,groupLength:2},number:{minimumDigits:5,groupLength:3,fractionGroupLength:1/0}},pX={create:e=>{let{onlyIfContainsSeparator:t,binary:r,octal:n,hexadecimal:o,number:a}=e.options[0],i={"0b":{onlyIfContainsSeparator:t,...r},"0o":{onlyIfContainsSeparator:t,...n},"0x":{onlyIfContainsSeparator:t,...o},"":{onlyIfContainsSeparator:t,...a}};e.on("Literal",e=>{let t,r;if(!(tp(e)||tm(e))||tp(e)&&/^0\d+$/.test(e.raw))return;let{raw:n}=e,o=n,a="";tm(e)&&(o=n.slice(0,-1),a="n");let s=o.replaceAll("_",""),{prefix:l,data:u}=(t="",r=s,/^0[box]/i.test(s)&&(t=s.slice(0,2),r=s.slice(2)),{prefix:t,data:r}),{onlyIfContainsSeparator:p}=i[l.toLowerCase()];if(p&&!n.includes("_"))return;let c=function(e,{prefix:t,data:r},n){let o=n[t.toLowerCase()];if(t)return t+pG(r,o);let{number:a,mark:i,sign:s,power:l}=function(e){let{number:t,mark:r="",sign:n="",power:o=""}=e.match(/^(?<number>[\d._]*)(?:(?<mark>e)(?<sign>[+-])?(?<power>[\d_]+))?$/i).groups;return{number:t,mark:r,sign:n,power:o}}(e);return function(e,t){let{integer:r,dot:n,fractional:o}=function(e){let t=e.split("."),[r,n=""]=t;return{integer:r,dot:2===t.length?".":"",fractional:n}}(e);return pG(r,t)+n+pG(o,{...t,groupLength:t.fractionGroupLength},!0)}(a,o)+i+s+pG(l,n[""])}(s,{prefix:l,data:u},i)+a;if(n!==c)return{node:e,messageId:pK,fix:t=>t.replaceText(e,c)}})},meta:{type:"suggestion",docs:{description:"Enforce the style of numeric separators by correctly grouping digits.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{...Object.fromEntries(Object.keys(pJ).map(e=>[e,(({withFraction:e=!1}={})=>({type:"object",additionalProperties:!1,properties:{onlyIfContainsSeparator:{type:"boolean",description:"Whether to only enforce the style if the number already contains a separator."},minimumDigits:{type:"integer",minimum:0,description:"The minimum number of digits before separators are enforced."},groupLength:{type:"integer",minimum:1,description:"The number of digits in each group."},...e&&{fractionGroupLength:{type:"integer",minimum:1,description:"The number of digits in each group after the decimal point. Defaults to no grouping."}}}}))({withFraction:"number"===e})])),onlyIfContainsSeparator:{type:"boolean",description:"Whether to only enforce the style if the number already contains a separator."}}}],defaultOptions:[{onlyIfContainsSeparator:!1,binary:pJ.binary,octal:pJ.octal,hexadecimal:pJ.hexadecimal,number:pJ.number}],messages:{[pK]:"Invalid group length in numeric value."},languages:["js/js"]}},pY="error-zero-index",pH="error-shift",pQ="error-pop",pZ="error-at-zero",p0="error-at-minus-one",p1="error-slice-minus-one",p2="error-destructuring-declaration",p3="error-destructuring-assignment",p8="error-variable",p6="suggest-nullish-coalescing-operator",p9="suggest-logical-or-operator",p5=(e,t,r)=>tR(e,{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,...r})&&!nB(e.callee.object,t),p4=e=>"UnaryExpression"===e.type&&"-"===e.operator&&e.prefix&&"Literal"===e.argument.type&&"1"===e.argument.raw,p7=(e,t)=>tR(e,{method:"slice",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&p4(e.arguments[0])&&p5(e.callee.object,t),ce=e=>e?"AssignmentExpression"===e.type?e:"VariableDeclarator"===e.type?{left:e.id,right:e.init}:{}:{};function*ct(e,t,r){let{left:n}=ce(e),[o]=n.elements,a=t.getText("AssignmentPattern"===o.type?o.left:o);yield r.replaceText(n,a),((e,t)=>{if("AssignmentExpression"!==e.type||eQ(e,t))return!1;let{left:r}=ce(e),[n]=r.elements,{type:o}="AssignmentPattern"===n.type?n.left:n;return"ObjectExpression"===o||"ObjectPattern"===o})(e,t)&&(yield r.insertTextBefore(e,"("),yield r.insertTextAfter(e,")"))}let cr=e=>"AssignmentPattern"===ce(e).left.elements[0].type,cn=(e,t)=>{let r,n,{property:o}=ce(t).right.callee;return cr(t)?r=[{operator:"??",messageId:p6},{operator:"||",messageId:p9}].map(({messageId:r,operator:n})=>({messageId:r,*fix(r){yield r.replaceText(o,"find"),yield((e,t,r,n)=>{let{left:o,right:a}=ce(e),[i]=o.elements,s=i.right,l=t.getText(s);return(eQ(s,t)||"LogicalExpression"===s.type&&(s.operator===n||"||"===n&&"??"===s.operator||"??"===n&&("||"===s.operator||"&&"===s.operator))||"ConditionalExpression"===s.type||"AssignmentExpression"===s.type||"YieldExpression"===s.type||"SequenceExpression"===s.type)&&(l=`(${l})`),r.insertTextAfter(a,` ${n} ${l}`)})(t,e,r,n),yield ct(t,e,r)}})):n=function*(r){yield r.replaceText(o,"find"),yield ct(t,e,r)},{fix:n,suggest:r}},co=e=>"MemberExpression"===e.parent.type&&!0===e.parent.computed&&e.parent.object===e&&"Literal"===e.parent.property.type&&"0"===e.parent.property.raw,ca=e=>{let{left:t,right:r}=ce(e.parent);return t&&r&&r===e&&"ArrayPattern"===t.type&&1===t.elements.length&&t.elements[0]&&"RestElement"!==t.elements[0].type},ci={create:e=>{let{sourceCode:t}=e,{checkFromLast:r}=e.options[0];e.on("MemberExpression",t=>{if(!(!(t.computed&&"Literal"===t.property.type&&"0"===t.property.raw&&p5(t.object,e))||nG(t)))return{node:t.object.callee.property,messageId:pY,fix:r=>[r.replaceText(t.object.callee.property,"find"),iY(r,t,e)]}}),e.on("CallExpression",t=>{if(tR(t,{method:"shift",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&p5(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:pH,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...iH(r,t,e)]}}),e.on("VariableDeclarator",r=>{if("ArrayPattern"===r.id.type&&1===r.id.elements.length&&r.id.elements[0]&&"RestElement"!==r.id.elements[0].type&&p5(r.init,e,{optionalMember:!1}))return{node:r.init.callee.property,messageId:p2,...cn(t,r)}}),e.on("AssignmentExpression",r=>{if("ArrayPattern"===r.left.type&&1===r.left.elements.length&&r.left.elements[0]&&"RestElement"!==r.left.elements[0].type&&p5(r.right,e,{optionalMember:!1}))return{node:r.right.callee.property,messageId:p3,...cn(t,r)}}),e.on("VariableDeclarator",r=>{if(!("Identifier"===r.id.type&&p5(r.init,e,{optionalMember:!1})&&"VariableDeclaration"===r.parent.type&&r.parent.declarations.includes(r)&&("ExportNamedDeclaration"!==r.parent.parent.type||r.parent.parent.declaration!==r.parent)))return;let n=t.getScope(r),o=eS(n,r.id),a=r1(o).filter(e=>e!==r.id);if(0===a.length)return;let i=[],s=[];for(let e of a)if(co(e))i.push(e.parent);else{if(!ca(e))return;s.push(e.parent)}let l={node:r.init.callee.property,messageId:p8};return s.every(e=>!cr(e))&&(l.fix=function*(a){yield a.replaceText(r.init.callee.property,"find");let l=(e=>{let t=ip.singular(e);if(t!==e)return t})(r.id.name);if(l){let r=rS(l,ry(n));yield i0(o,r,e,a),yield function*(e,t){yield e.insertTextBeforeRange(t,""),yield e.insertTextAfterRange(t,"")}(a,t.getRange(t.ast))}for(let t of i)yield iY(a,t,e);for(let e of s)yield ct(e,t,a)}),l}),e.on("CallExpression",t=>{if(tR(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"Literal"===t.arguments[0].type&&"0"===t.arguments[0].raw&&p5(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:pZ,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...iH(r,t,e)]}}),r&&(e.on("CallExpression",t=>{if(tR(t,{method:"pop",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&p5(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:pQ,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...iH(r,t,e)]}}),e.on("CallExpression",t=>{if(tR(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&p4(t.arguments[0])&&p5(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:p0,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...iH(r,t,e)]}}),e.on("MemberExpression",r=>{if(!(r.computed&&!r.optional&&"Literal"===r.property.type&&"0"===r.property.raw&&!nG(r)&&p7(r.object,e)))return;let n=r.object.callee.object;return{node:n.callee.property,messageId:p1,*fix(o,{abort:a}){if(rV(e,[tn(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield iH(o,r.object,e),yield iY(o,r,e)}}}),e.on("CallExpression",r=>{if(!(tR(r,{methods:["pop","shift"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&p7(r.callee.object,e)))return;let n=r.callee.object.callee.object;return{node:n.callee.property,messageId:p1,*fix(o,{abort:a}){if(rV(e,[tn(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield iH(o,r.callee.object,e),yield iH(o,r,e)}}}))},meta:{type:"suggestion",docs:{description:"Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkFromLast:{type:"boolean",description:"Whether to also check for patterns that can be replaced with `findLast()`."}}}],defaultOptions:[{checkFromLast:!0}],messages:{[p8]:"Prefer `.find(…)` over `.filter(…)`.",[pY]:"Prefer `.find(…)` over `.filter(…)[0]`.",[pZ]:"Prefer `.find(…)` over `.filter(…).at(0)`.",[pH]:"Prefer `.find(…)` over `.filter(…).shift()`.",[pQ]:"Prefer `.findLast(…)` over `.filter(…).pop()`.",[p0]:"Prefer `.findLast(…)` over `.filter(…).at(-1)`.",[p1]:"Prefer `.findLast(…)` over `.filter(…).slice(-1)`.",[p2]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[p3]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[p6]:"Replace `.filter(…)` with `.find(…) ?? …`.",[p9]:"Replace `.filter(…)` with `.find(…) || …`."},languages:["js/js"]}},cs="prefer-array-flat-map",cl="prefer-array-flat-map/filter-flat-map",cu="prefer-array-flat-map/filter-flat-map-suggestion",cp=["React.Children","Children"],cc=new i(["ArrowFunctionExpression","AssignmentExpression","ClassExpression","ConditionalExpression","FunctionExpression","ObjectExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),cd=e=>"ArrowFunctionExpression"===e.type&&!e.async&&!e.returnType&&!e.typeParameters&&1===e.params.length&&"Identifier"===e.params[0].type&&!e.params[0].optional&&!e.params[0].typeAnnotation&&"BlockStatement"!==e.body.type,cm="prefer-array-flat",cf={getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#flatMap()",testFunction(e,t){if(!tR(e,{method:"flatMap",argumentsLength:1,optionalCall:!1}))return!1;let[r]=e.arguments;return"ArrowFunctionExpression"===r.type&&!r.async&&1===r.params.length&&oT(r.params[0],r.body)&&!cE(e.callee.object,t)}},cg={testFunction(e,t){if(!tR(e,{method:"reduce",argumentsLength:2,optionalCall:!1}))return!1;let[r,n]=e.arguments;if(!("ArrowFunctionExpression"===r.type&&!r.async&&2===r.params.length&&tC(n)))return!1;let o=r.body,[a,i]=r.params;return!!(tR(o,{method:"concat",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&oT(a,o.callee.object)&&oT(i,o.arguments[0])||"ArrayExpression"===o.type&&2===o.elements.length&&o.elements.every((e,t)=>e?.type==="SpreadElement"&&"Identifier"===e.argument.type&&oT(r.params[t],e.argument)))&&!nF(e.callee.object,t)},getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#reduce()"},cy={testFunction:e=>tR(e,{method:"concat",argumentsLength:1,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&tC(e.callee.object)&&"SpreadElement"===e.arguments[0].type,getArrayNode:e=>e.arguments[0].argument,description:"[].concat()"},ch={testFunction(e){if(!(tR(e,{methods:["apply","call"],argumentsLength:2,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&tU(e.callee.object,{property:"concat"})))return!1;let[t,r]=e.arguments;return tC(t)&&("apply"===e.callee.property.name&&"SpreadElement"!==r.type||"call"===e.callee.property.name&&"SpreadElement"===r.type)},getArrayNode(e){let t=e.arguments[1];return"SpreadElement"===t.type?t.argument:t},description:"Array.prototype.concat()"},cx=["_.flatten","lodash.flatten","underscore.flatten"],cb=/^\p{Uppercase_Letter}/u,cE=(e,t)=>{let r,n;return"Identifier"===e.type&&cb.test(e.name)&&(!(r=rJ(e,t))||"ArrayExpression"!==r.type&&("NewExpression"!==r.type||"Identifier"!==r.callee.type||"Array"!==r.callee.name))||!!((n=rJ(e,t))&&("ObjectExpression"===n.type||"Literal"===n.type||"TemplateLiteral"===n.type||"ArrowFunctionExpression"===n.type||"FunctionExpression"===n.type||"ClassExpression"===n.type||"NewExpression"===n.type&&"Identifier"===n.callee.type&&"Array"!==n.callee.name))},cv={create:function(e){let{functions:t}=e.options[0],r=[...t,...cx],n=[cf,cg,cy,ch,{testFunction:e=>tb(e,{argumentsLength:1,optional:!1},ty)&&tM(e.callee,r),getArrayNode:e=>e.arguments[0],description:e=>`${r.find(t=>t$(e.callee,t)).trim()}()`}];e.on("CallExpression",function*(t){for(let{testFunction:r,description:o,getArrayNode:a,shouldSwitchToArray:i,isOptionalArray:s}of n){if(!r(t,e))continue;let n=a(t),l=s?.(t),u={description:"string"==typeof o?o:o(t)},p={node:t,messageId:cm,data:u},{sourceCode:c}=e;c.getCommentsInside(t).length===c.getCommentsInside(n).length&&(p.fix=function(e,t,r,n,o){return"function"==typeof n&&(n=n(e)),function*(a){let{sourceCode:i}=r,s=to(t,r);n?s=`[${s}]`:!ta(t,i)&&it(t,r)&&(s=`(${s})`),s+=`${o?"?":""}.flat()`,aL(i.getTokenBefore(e),r,s)&&(s=`;${s}`),yield a.replaceText(e,s),yield iG(a,e,r)}}(t,n,e,i,l)),yield p}})},meta:{type:"suggestion",docs:{description:"Prefer `Array#flat()` over legacy techniques to flatten arrays.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{functions:{type:"array",items:{type:"string"},uniqueItems:!0,description:"Additional functions to check."}}}],defaultOptions:[{functions:[]}],messages:{[cm]:"Prefer `Array#flat()` over `{{description}}` to flatten an array."},languages:["js/js"]}},cS="some",cC="some-suggestion",cD="filter",cT={create:a8(e=>{e.on("CallExpression",t=>{if(!tR(t,{methods:["find","findLast"],minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||t.typeArguments||t.typeParameters||nB(t.callee.object,e))return;let r="BinaryExpression"===t.parent.type&&t.parent.left===t&&(["!=","==","===","!=="].includes(t.parent.operator)&&tq(t.parent.right)||("!="===t.parent.operator||"=="===t.parent.operator)&&td(t.parent.right));if(!r&&!(tG(t,e)||tJ(t)||function(e,t){if(!nj(e.callee.object,t))return!1;let r=e.parent;if("VariableDeclarator"!==r.type||r.init!==e||"Identifier"!==r.id.type||r.id.typeAnnotation||"VariableDeclaration"!==r.parent.type||"const"!==r.parent.kind||"ExportNamedDeclaration"===r.parent.parent.type&&r.parent.parent.declaration===r.parent)return!1;let[n]=t.sourceCode.getDeclaredVariables(r);if(!n||1!==n.identifiers.length||n.identifiers[0]!==r.id)return!1;let o=n.references.filter(e=>!e.init);return 0!==o.length&&o.every(e=>{let{identifier:r}=e;return e.isRead()&&(tG(r,t)||tJ(r))})}(t,e)))return;let n=t.callee.property,o=r&&rV(e,[tn(t,e)[1],e.sourceCode.getRange(t.parent)[1]]);return{node:n,messageId:cS,data:{method:n.name},suggest:o?void 0:[{messageId:cC,*fix(o){if(yield o.replaceText(n,"some"),!r)return;let{sourceCode:a}=e,i=tn(t,e);yield o.removeRange([i[1],a.getRange(t.parent)[1]]),"!="!==t.parent.operator&&"!=="!==t.parent.operator&&(yield o.insertTextBeforeRange(i,"!"))}}]}}),e.on("BinaryExpression",t=>{let{left:r,right:n,operator:o}=t;if(!(tR(r,{methods:["findIndex","findLastIndex"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&(["!==","!=",">","===","=="].includes(o)&&"UnaryExpression"===n.type&&"-"===n.operator&&n.argument&&"Literal"===n.argument.type&&1===n.argument.value||[">=","<"].includes(o)&&ti(n,0)))||nB(r.callee.object,e))return;let a=r.callee.property;return{node:a,messageId:cS,data:{method:a.name},*fix(n,{abort:i}){let{sourceCode:s}=e,l=s.getTokenAfter(r,e=>"Punctuator"===e.type&&e.value===o),[u]=s.getRange(l),[,p]=s.getRange(t);if(rV(e,[u,p]))return i();["===","==","<"].includes(o)&&(yield n.insertTextBefore(t,"!")),yield n.replaceText(a,"some"),yield n.removeRange([u,p])}}}),e.on("BinaryExpression",t=>{if(!((">"===t.operator||"!=="===t.operator)&&"Literal"===t.right.type&&"0"===t.right.raw&&tF(t.left,{property:"length",optional:!1})&&tR(t.left.object,{method:"filter",optionalCall:!1,optionalMember:!1})))return;let r=t.left.object,n=r.callee.object;if("Identifier"===n.type&&n.name.startsWith("$")||nB(n,e))return;let[o]=r.arguments;if(!o||oE(o))return;let a=r.callee.property;return{node:a,messageId:cD,*fix(n,{abort:o}){let{sourceCode:i}=e,s=t.left;if(rV(e,[tn(r,e)[1],i.getRange(t)[1]]))return o();yield n.replaceText(a,"some"),yield iY(n,s,e),yield n.removeRange([tn(s,e)[1],i.getRange(t)[1]])}}})}),meta:{type:"suggestion",docs:{description:"Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.",recommended:"unopinionated"},fixable:"code",messages:{[cS]:"Prefer `.some(…)` over `.{{method}}(…)`.",[cC]:"Replace `.{{method}}(…)` with `.some(…)`.",[cD]:"Prefer `.some(…)` over non-zero length check from `.filter(…)`."},hasSuggestions:!0,languages:["js/js"]}},cA="preferDefaultParameters",cw="preferDefaultParametersSuggest",ck=new i(["CallExpression","NewExpression","ImportExpression","TaggedTemplateExpression"]),cI=(e,t)=>{if(!t)return!1;if(ck.has(t.type))return!0;for(let r of e.visitorKeys[t.type]){let n=t[r];if(Array.isArray(n)){for(let t of n)if(cI(e,t))return!0}else if(cI(e,n))return!0}return!1},cj="prefer-logical-operator-over-ternary/error",cF="prefer-logical-operator-over-ternary/optional-chain-error",cB="prefer-logical-operator-over-ternary/suggestion",cR="prefer-logical-operator-over-ternary/optional-chain-suggestion",cP=new i(["==","==="]),cL=new i(["!=","!=="]);function cN(e,t,r){if(rk(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return cN(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&cN(e.left,t.left,r)&&cN(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&cN(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function c$({context:e,conditionalExpression:t,left:r,right:n,operators:o=["??","||"]}){return e.sourceCode.getCommentsInside(t).length>0?{node:t,messageId:cj}:{node:t,messageId:cj,suggest:o.map(o=>({messageId:cB,data:{operator:o},fix:a=>(function({fixer:e,context:t,conditionalExpression:r,left:n,right:o,operator:a}){let{sourceCode:i}=t,s=[n,o].map((e,r)=>{let n=ta(e,t),o=n?to(e,t):i.getText(e);return!n&&ii(e,{operator:a,property:0===r?"left":"right"})&&(o=`(${o})`),o}).join(` ${a} `);return aL(i.getTokenBefore(r),t,s)&&(s=`;${s}`),e.replaceText(r,s)})({fixer:a,context:e,conditionalExpression:t,left:r,right:n,operator:o})}))}}function cM(e){return td(e)?"null":tq(e)?"undefined":void 0}function cO(e){if("BinaryExpression"!==e.type||!cP.has(e.operator)&&!cL.has(e.operator))return;let t=cM(e.left),r=cM(e.right);if(!!t==!!r)return;let n=cP.has(e.operator);return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:n}}let cq=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind,cU="with-name",cW="without-name",cV="regexp-exec",c_="string-match",cz="string-search",cK="suggestion",cG="string",cJ="regexp",cX="other",cY="string-or-other",cH="regexp-or-other",cQ="unknown";function*cZ(e,{stringNode:t,methodNode:r,regexpNode:n},o){let{sourceCode:a}=o;yield e.replaceText(r,"test");let i=a.getText(t);eQ(n,a)||"SequenceExpression"!==t.type||(i=`(${i})`),yield e.replaceText(n,i);let s=a.getText(n);!eQ(t,a)&&it(n,o)&&(s=`(${s})`),yield e.replaceText(t,s)}let c0=[{type:cV,test:e=>tR(e,{method:"exec",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.arguments[0],methodNode:e.callee.property,regexpNode:e.callee.object}),*fix(e,{methodNode:t}){yield e.replaceText(t,"test")}},{type:c_,test:e=>tR(e,{method:"match",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:cZ},{type:cz,test:e=>tR(e,{method:"search",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:cZ}],c1=e=>tc(e)||tE(e,{name:"RegExp"}),c2=e=>{if("[object RegExp]"===Object.prototype.toString.call(e))return e},c3=e=>{if(e.includes(cQ))return cQ;let t=new i(e),r=t.has(cG)||t.has(cY),n=t.has(cJ)||t.has(cH);if(r&&n)return cY;let o=t.has(cX)||t.has(cY)||t.has(cH);return r?o?cY:cG:n?o?cH:cJ:cX},c8=e=>{let t=new i(e);return t.has(cQ)?cQ:t.has(cJ)?cJ:t.has(cG)?cG:cX},c6=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSVoidKeyword","TSArrayType","TSTypeLiteral","TSTupleType","TSFunctionType","TSConstructorType"]),c9=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return c9(e.typeAnnotation);case"TSStringKeyword":return cG;case"TSLiteralType":return"Literal"===e.literal.type&&"string"==typeof e.literal.value?cG:cX;case"TSTypeReference":if("Identifier"!==e.typeName.type)return cQ;if("String"===e.typeName.name)return cG;if("RegExp"===e.typeName.name)return cJ;if("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)return cX;return cQ;case"TSUnionType":return c3(e.types.map(e=>c9(e)));case"TSIntersectionType":return c8(e.types.map(e=>c9(e)));default:return c6.has(e?.type)?cX:cQ}},c5=(e,t)=>{let r,n;if(r=e,r5.has(r.intrinsicName)||(n=e=t.getNonNullableType(e),r5.has(n.intrinsicName)))return cQ;if(e.isTypeParameter?.()){let r=e.getConstraint();return r?c5(r,t):cQ}return e.isUnion()?c3(e.types.map(e=>c5(e,t))):e.isIntersection()?c8(e.types.map(e=>c5(e,t))):"string"===e.intrinsicName||e.isStringLiteral?.()?cG:"RegExp"===r7(e)?.getName()||nt(e,t).some(e=>c5(e,t)===cJ)?cJ:cX},c4=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]);function c7(e,t,r=new i){let n;if(c1(e))return cJ;if(og(e,t))return cG;switch(e.type){case"Identifier":{let n=((e,t,r)=>{let{sourceCode:n}=t,o=eS(n.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return cQ;r.add(o);let[a]=o.defs,i=c9(a.name?.typeAnnotation),s=cQ;return i!==cQ?s=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(s=c7(a.node.init,t,r)),r.delete(o),s})(e,t,r);if(n!==cQ)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let n=c9(e.typeAnnotation);return n===cQ?c7(e.expression,t,r):n}case"TSNonNullExpression":case"ParenthesizedExpression":return c7(e.expression,t,r);case"SequenceExpression":return c7(e.expressions.at(-1),t,r);case"ConditionalExpression":return c3([c7(e.consequent,t,r),c7(e.alternate,t,r)])}let o=t.sourceCode.getScope(e),a=(n=eV(e,o))?"string"==typeof n.value?cG:c2(n.value)?cJ:void 0===n.value&&("Identifier"===e.type&&"undefined"===e.name||"UnaryExpression"===e.type&&"void"===e.operator)||null===n.value||["bigint","boolean","number","symbol"].includes(typeof n.value)?cX:cQ:cQ;return a!==cQ?a:c4.has(e.type)?cX:((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return cQ;try{let{program:t}=r;return c5(r.getTypeAtLocation(e),t.getTypeChecker())}catch{return cQ}})(e,t)}let de=(e,t)=>{let r;return"UnaryExpression"===(r=((e,t)=>{for(;;){if(tW(e.parent)||tK(e.parent,t)&&e.parent.arguments[0]===e){e=e.parent;continue}break}return e})(e,t)).parent.type&&"!"===r.parent.operator&&r.parent.argument===r},dt=(e,[t,r])=>e.getAllComments().some(n=>{let[o,a]=e.getRange(n);return o>=t&&a<=r}),dr=(e,t,r)=>[tn(t,r)[1],r.sourceCode.getRange(e.node)[1]],dn=e=>[{messageId:cK,fix:e}],da=e=>[cJ,cH,cX].includes(e),di=e=>[cG,cY,cX].includes(e),ds=({type:e,stringType:t,regexpType:r})=>e===cV?di(r)||da(t):da(t)||di(r),dl=(e,t,r,{lengthCheck:n,searchCheck:o,callExpression:a,isRegExp:i,staticRegExp:s})=>{if(n){((e,t)=>{let{sourceCode:r}=t,n=[[tn(e.lengthNode.object,t)[1],r.getRange(e.lengthNode)[1]]];return e.comparisonLeftNode&&n.push([tn(e.comparisonLeftNode,t)[1],r.getRange(e.node)[1]]),n})(n,r).every(e=>!dt(r.sourceCode,e))&&(e.suggest=dn(t));return}if(!o||!dt(r.sourceCode,dr(o,a,r))){if((({searchCheck:e,isRegExp:t,staticRegExp:r})=>t||r?.global===!1&&(!e||!1===r.sticky))({searchCheck:o,isRegExp:i,staticRegExp:s})){e.fix=t;return}e.suggest=dn(t)}},du={create:a8(e=>{e.on("CallExpression",function*(t){let r=((e,t)=>{let r,n="ChainExpression"===(r=e.parent).type?r.expression:r;if(!tF(n,{property:"length"})||n.object!==e)return;let o="ChainExpression"===n.parent.type?n.parent:n;if(de(o,t))return;if(tG(o,t)||tJ(o))return{lengthNode:n,node:o};let{parent:a}=o;if(a?.type==="BinaryExpression"&&a.left===o&&">"===a.operator&&ti(a.right,0)&&!de(a,t)&&(tG(a,t)||tJ(a)))return{lengthNode:n,node:a,comparisonLeftNode:o}})(t,e),n=(e=>{let{parent:t}=e;if(t?.type!=="BinaryExpression"||t.left!==e)return;let{operator:r,right:n}=t;return["!==","!=",">"].includes(r)&&tP(n)||">="===r&&ti(n,0)?{node:t,negate:!1}:["===","=="].includes(r)&&tP(n)||"<"===r&&ti(n,0)?{node:t,negate:!0}:void 0})(t);if(r||n||tG(t,e)||tJ(t))for(let{type:o,test:a,getNodes:i,fix:s}of c0){if(o===cz!=!!n||!a(t))continue;let l=i(t),{methodNode:u,regexpNode:p}=l,c=e.sourceCode.getScope(p),d=eV(p,c),m=d?c2(d.value):void 0,f=c1(p);if(ds({type:o,stringType:c7(l.stringNode,e),regexpType:c7(p,e)}))continue;let g={node:o===cV?u:t,messageId:o};dl(g,function*(o){for(let a of(r?(yield iY(o,r.lengthNode,e),r.comparisonLeftNode&&(yield o.removeRange([tn(r.comparisonLeftNode,e)[1],e.sourceCode.getRange(r.node)[1]]))):n&&(n.negate&&(yield o.insertTextBefore(n.node,"!")),yield o.removeRange(dr(n,t,e))),s(o,l,e)))yield a},e,{lengthCheck:r,searchCheck:n,callExpression:t,isRegExp:f,staticRegExp:m}),yield g}})}),meta:{type:"suggestion",docs:{description:"Prefer `RegExp#test()` over `String#match()`, `String#search()`, and `RegExp#exec()`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[cV]:"Prefer `.test(…)` over `.exec(…)`.",[c_]:"Prefer `RegExp#test(…)` over `String#match(…)`.",[cz]:"Prefer `RegExp#test(…)` over `String#search(…)` when checking for existence.",[cK]:"Switch to `RegExp#test(…)`."},languages:["js/js"]}},dp="error",dc="suggestion",dd=["copyWithin","fill","filter","flat","flatMap","map","reverse","sort","splice","toReversed","toSorted","toSpliced","with","split","toArray"],dm=["slice","concat"],df=e=>tR(e.parent.parent,{method:"includes",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.parent.callee.object===e,dg=new i(["ForOfStatement","ForStatement","ForInStatement","WhileStatement","DoWhileStatement","FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),dy=(e,t,r=new i)=>"ArrayExpression"===e.type||tb(e,{name:"Array",optional:!1},tx)||tR(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||tR(e,{methods:dd,optionalCall:!1,optionalMember:!1})||tR(e,{methods:dm,optionalCall:!1,optionalMember:!1})&&void 0===tu(e.callee.object)&&("Identifier"!==e.callee.object.type||((e,t,r=new i)=>{if("Identifier"!==e.type)return!1;let n=eS(t,e);if(!n||r.has(n)||1!==n.defs.length)return!1;r.add(n);let[o]=n.defs;return"Variable"===o.type&&"const"===o.kind&&!!o.node.init&&dy(o.node.init,t,r)})(e.callee.object,t,r)),dh=e=>Number.isSafeInteger(e)&&e>=0&&e<=0xffffffff,dx=e=>e.some(e=>e?.type==="SpreadElement"),db=(e,t,r)=>e.getCommentsInside(t).some(t=>{let n,o;return n=e.getRange(t),o=e.getRange(r),!(n[0]>=o[0])||!(n[1]<=o[1])}),dE=(e,t)=>(e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion"||e?.type==="TSNonNullExpression")&&e.expression===t,dv=e=>{let{parent:t}=e;if(!("MemberExpression"===t.type&&t.object===e&&!t.computed&&!t.optional&&"Identifier"===t.property.type&&"length"===t.property.name)||(e=>{let t,r=e;for(;dE(r.parent,r);)r=r.parent;return nG(r)||("ForInStatement"===(t=r).parent.type||"ForOfStatement"===t.parent.type)&&t.parent.left===t})(t))return!1;let r=t.parent;return"CallExpression"!==r.type||r.callee!==t},dS=e=>{let t,r;return"ForOfStatement"===e.parent.type&&e.parent.right===e||(e=>{let{parent:t}=e;return"SpreadElement"===t.type&&t.argument===e&&["ArrayExpression","CallExpression","NewExpression"].includes(t.parent.type)})(e)||tR(t=e.parent.parent,{method:"forEach",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.object===e&&"ArrowFunctionExpression"===(r=t.arguments[0]).type&&1===r.params.length&&"RestElement"!==r.params[0].type},dC={create:e=>{let{minimumItems:t}=e.options[0],{sourceCode:r}=e;e.on("Identifier",n=>{let o,{parent:a}=n;if(!((e,t)=>{let{parent:r}=e;return"VariableDeclarator"===r.type&&r.id===e&&!!r.init&&"VariableDeclaration"===r.parent.type&&("ExportNamedDeclaration"!==r.parent.parent.type||r.parent.parent.declaration!==r.parent)&&dy(r.init,t.getScope(r.init))})(n,r))return;if(t>0){var i,s;let e=(i=a.init,s=r.getScope(a.init),"ArrayExpression"===i.type?dx(i.elements)?void 0:i.elements.length:tb(i,{name:"Array",optional:!1},tx)?((e,t)=>{if(dx(e.arguments))return;if(1!==e.arguments.length)return e.arguments.length;let r=eV(e.arguments[0],t);if(!r)return;let{value:n}=r;return"number"!=typeof n?1:dh(n)?n:void 0})(i,s):tR(i,{object:"Array",method:"of",optionalCall:!1,optionalMember:!1})?dx(i.arguments)?void 0:i.arguments.length:tR(i,{object:"Array",method:"from",optionalCall:!1,optionalMember:!1})?((e,t)=>{let[r]=e.arguments;if(r&&"SpreadElement"!==r.type){if("ArrayExpression"===r.type)return dx(r.elements)?void 0:r.elements.length;if(void 0!==tu(r)){let e=eV(r,t);return"string"==typeof e?.value?[...e.value].length:void 0}return((e,t)=>{if("ObjectExpression"!==e.type||1!==e.properties.length)return;let[r]=e.properties;if((e=>{if("Property"!==e.type||e.computed)return!1;let{key:t}=e;return"Identifier"===t.type&&"length"===t.name||"Literal"===t.type&&"length"===t.value})(r)){let e=eV(r.value,t);return dh(e?.value)?e.value:void 0}})(r,t)}})(i,s):void 0);if(void 0===e||e<t)return}let l=eS(r.getScope(n),n);if(!l)return;let u=(e=>{let t=[],r=[],n=[];for(let o of e){if(df(o)){t.push(o);continue}if(dv(o)){r.push(o),n.push(o);continue}if(dS(o)){n.push(o);continue}return}return{includes:t,lengths:r,extra:n}})(r1(l).filter(e=>e!==n));if(!u||0===u.includes.length||u.extra.length>0&&(o=a.init,!("ArrayExpression"===o.type&&!dx(o.elements)&&o.elements.every(Boolean)&&o.elements.every(t=>{let r;return(r=eV(t,e.sourceCode.getScope(t)))&&rI(r.value)&&!Object.is(r.value,-0)}))||0!==rB(o.elements,e).length)||1===u.includes.length&&!((e,t)=>{let r=t.parent.parent.parent,{parent:n}=e.parent;for(;n&&n!==r;){if(dg.has(n.type))return!0;n=n.parent}return!1})(u.includes[0],n))return;let p={node:n,messageId:dp,data:{name:n.name}},c=n.typeAnnotation&&((e,t)=>{if("TSArrayType"===e.type){if(db(t,e,e.elementType))return;return`Set<${t.getText(e.elementType)}>`}if("TSTypeOperator"===e.type&&"readonly"===e.operator&&"TSArrayType"===e.typeAnnotation.type){if(db(t,e,e.typeAnnotation.elementType))return;return`ReadonlySet<${t.getText(e.typeAnnotation.elementType)}>`}if("TSTypeReference"!==e.type||"Identifier"!==e.typeName.type)return;let r=e.typeArguments??e.typeParameters;if(r?.params.length===1&&!db(t,e,r)){if("Array"===e.typeName.name)return`Set${t.getText(r)}`;if("ReadonlyArray"===e.typeName.name)return`ReadonlySet${t.getText(r)}`}})(n.typeAnnotation.typeAnnotation,r),d=function*(e){for(let t of(c&&(yield e.replaceText(n.typeAnnotation.typeAnnotation,c)),yield e.insertTextBefore(n.parent.init,"new Set("),yield e.insertTextAfter(n.parent.init,")"),u.includes))yield e.replaceText(t.parent.property,"has");for(let t of u.lengths)yield e.replaceText(t.parent.property,"size")};return n.typeAnnotation&&!c?p.suggest=[{messageId:dc,fix:d}]:p.fix=d,p})},meta:{type:"suggestion",docs:{description:"Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{minimumItems:{type:"integer",minimum:0,description:"The minimum known array size before `Set#has()` is enforced."}}}],defaultOptions:[{minimumItems:0}],messages:{[dp]:"`{{name}}` should be a `Set`, and use `{{name}}.has()` to check existence or non-existence.",[dc]:"Switch `{{name}}` to `Set`."},languages:["js/js"]}},dD=e=>tR(e.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&e.parent.arguments[0]===e&&tb(e.parent.callee.object,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1},ty),dT="prefer-string-raw",dA="unnecessary-string-raw";function dw(e,t=""){return e.replaceAll(RegExp(String.raw`\\(?<escapedCharacter>[\\${t}])`,"g"),"$<escapedCharacter>")}let dk="prefer-switch",dI=(e,t)=>e===t||rk(e,t),dj=({left:e,right:t})=>[e,t].filter(e=>!("Literal"===e.type||tq(e))),dF=new i(["WhileStatement","DoWhileStatement","ForStatement","ForOfStatement","ForInStatement","SwitchStatement"]),dB=e=>{for(;e.parent;e=e.parent)if(dF.has(e.type))return e},dR=(e,t,r)=>{let{sourceCode:n}=r;return n.getRange(e)[0]>=n.getRange(t)[0]&&n.getRange(e)[1]<=n.getRange(t)[1]},dP={create:e=>{let t={...e.options[0]},{sourceCode:r}=e,n=new i,o=[],a=new i;e.on("IfStatement",e=>{n.add(e)}),e.on("BreakStatement",e=>{e.label||o.push(e)}),e.on("Program:exit",function*(){for(let i of n){if(a.has(i))continue;let{discriminant:n,ifStatements:s}=function(e){let t,r=[];for(;e&&"IfStatement"===e.type;e=e.alternate){let{test:n}=e,o=function(e){let t=[e],r=[];for(;t.length>0;){if("LogicalExpression"===(e=t.pop()).type&&"||"===e.operator){t.push(e.right,e.left);continue}if("BinaryExpression"!==e.type||"==="!==e.operator)return[];r.push(e)}return r}(n);if(0===o.length)break;t||=dj(o[0]);let a=function(e,t){for(let{left:r,right:n}of e)if(0===(t=t.filter(e=>dI(e,r)||dI(e,n))).length)break;return t}(o,t);if(0===a.length)break;t=a,r.push({statement:e,compareExpressions:o})}return{ifStatements:r,discriminant:t&&t[0]}}(i);if(!n||s.length<t.minimumCases)continue;for(let{statement:e}of s)a.add(e);let l={loc:{start:r.getLoc(i).start,end:r.getLoc(i.consequent).start},messageId:dk};!eH(n,r)&&s.every(({statement:t})=>!function(e,t,r){for(let n of e){if(!dR(n,t,r))continue;let e=dB(n);if(!e||dR(t,e,r))return!0}return!1}(o,t,e))&&(l.fix=function({discriminant:e,ifStatements:t},r,n){let{sourceCode:o}=r,a=o.getText(e);return function*(i){let s=t[0].statement,l=rR(s,r);yield i.insertTextBefore(s,`switch (${a}) {`);let u=t.at(-1).statement;if(u.alternate){let{alternate:e}=u;yield i.insertTextBefore(e,`
31
- ${l}default: `)}else switch(n.emptyDefaultCase){case"no-default-comment":yield i.insertTextAfter(s,`
32
- ${l}// No default`);break;case"do-nothing-comment":yield i.insertTextAfter(s,`
33
- ${l}default:
34
- ${l}// Do nothing`)}for(let{statement:r,compareExpressions:n}of(yield i.insertTextAfter(s,`
35
- ${l}}`),t)){let{consequent:t,alternate:a}=r;if(a){let[,e]=o.getRange(t),[r]=o.getRange(a);yield i.removeRange([e,r])}let s=[o.getRange(r)[0],o.getRange(t)[0]];for(let{left:r,right:a}of(yield i.removeRange(s),n)){let n=dI(r,e)?a:r,s=o.getText(n);yield i.insertTextBefore(t,`
36
- ${l}case ${s}: `)}(function e(t){switch(t.type){case"ReturnStatement":case"ThrowStatement":return!1;case"IfStatement":return!t.alternate||e(t.consequent)||e(t.alternate);case"BlockStatement":{let r=function e(t){let{body:r}=t;for(let t=r.length-1;t>=0;t--){let n=r[t];if("FunctionDeclaration"!==n.type&&"EmptyStatement"!==n.type){if("BlockStatement"===n.type){let t=e(n);if(t)return t;continue}return n}}}(t);return!r||e(r)}default:return!0}})(t)&&(yield function*(e,t,r,n){if("BlockStatement"===e.type){let o=r.getLastToken(e);yield t.insertTextBefore(o,`
37
- ${n}break;
38
- ${n}`)}else yield t.insertTextAfter(e,`
39
- ${n}break;`)}(t,i,o,l),yield function*(e,t,r){e&&"BlockStatement"!==e.type&&(yield t.insertTextBefore(e,`{
40
- ${r}`),yield t.insertTextAfter(e,`
41
- ${r}}`))}(t,i,l))}}}({discriminant:n,ifStatements:s},e,t)),yield l}})},meta:{type:"suggestion",docs:{description:"Prefer `switch` over multiple `else-if`.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{minimumCases:{type:"integer",minimum:2,description:"The minimum number of `if`/`else if` cases before suggesting a `switch` statement."},emptyDefaultCase:{enum:["no-default-comment","do-nothing-comment","no-default-case"],description:"How to handle an empty `default` case."}}}],defaultOptions:[{minimumCases:3,emptyDefaultCase:"no-default-comment"}],messages:{[dk]:"Use `switch` instead of multiple `else-if`."},languages:["js/js"]}},dL="require-number-to-fixed-digits-argument";function dN(e){let t=e.match(/^[ \t]*(?=\S)/gm);if(!t)return e;let r=1/0;for(let e of t)r=Math.min(r,e.length);return 0===r||1/0===r?e:e.replace(RegExp(`^[ \\t]{${r}}`,"gm"),"")}function d$(e,t=1,r={}){let{indent:n=" ",includeEmptyLines:o=!1}=r;if("string"!=typeof e)throw TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if("number"!=typeof t)throw TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if("string"!=typeof n)throw TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);return 0===t?e:e.replace(o?/^/gm:/^(?!\s*$)/gm,n.repeat(t))}let dM=/^(?:( )+|\t+)/,dO="space";function dq(e,t){let r,n,a=new o,i=0;for(let o of e.split(/\n/g)){if(!o)continue;let e=o.match(dM);if(null===e)i=0,r="";else{let o=e[0].length,s=e[1]?dO:"tab";if(t&&s===dO&&1===o)continue;s!==r&&(i=0),r=s;let l=1,u=0,p=o-i;if(i=o,0===p)l=0,u=1;else{let e=Math.abs(p);if(t&&s===dO&&1===e)continue;n=(s===dO?"s":"t")+String(e)}let c=a.get(n);a.set(n,void 0===c?[1,0]:[c[0]+l,c[1]+u])}}return a}function dU(e){let t;if("string"!=typeof e)throw TypeError("Expected a string");let r=dq(e,!0);0===r.size&&(r=dq(e,!1));let n=function(e){let t,r=0,n=0;for(let[o,[a,i]]of e)(a>r||a===r&&i>n)&&(r=a,n=i,t=o);return t}(r),o=0,a="";if(void 0!==n){var i,s;({type:t,amount:o}={type:"s"===n[0]?dO:"tab",amount:Number(n.slice(1))}),i=t,s=o,a=(i===dO?" ":" ").repeat(s)}return{amount:o,type:t,indent:a}}let dW="template-indent",dV=(e,t=new i)=>e.map((e,r)=>t.has(r+1)||""===e.trim()?"":e).join("\n"),d_=[{type:"object",additionalProperties:!1,properties:{indent:{oneOf:[{type:"string",pattern:/^\s+$/.source,description:"Whitespace string to use as indentation."},{type:"integer",minimum:1,description:"Number of spaces to use as indentation."}],description:"The indentation to use inside the template literal."},tags:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Tagged template names to check."},functions:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Function names whose template literal arguments to check."},selectors:{type:"array",uniqueItems:!0,items:{type:"string"},description:"AST selectors for template literals to check."},comments:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Comment patterns to mark template literals for checking."}}}],dz="no-await-in-promise-methods/error",dK="no-await-in-promise-methods/suggestion",dG=["all","allSettled","any","race"],dJ="no-negation-in-equality-check/error",dX="no-negation-in-equality-check/suggestion",dY=new i(["===","!==","==","!="]),dH=e=>"UnaryExpression"===e.type&&e.prefix&&"!"===e.operator;function dQ(e,{methods:t,messageId:r,checkArrayReceiver:n=!1}){e.on("CallExpression",o=>{if(!tR(o,{methods:t,argumentsLength:2,optionalCall:!1}))return;let a=o.arguments[1],i=function(e,t){if("Identifier"===e.type&&"Infinity"===e.name)return"Infinity";if(tF(e,{object:"Number",property:"POSITIVE_INFINITY",computed:!1,optional:!1}))return"Number.POSITIVE_INFINITY";let r="ChainExpression"===e.type;if(r&&(e=e.expression),tF(e,{property:"length",computed:!1})&&rk(t,e.object))return`${"Identifier"===t.type?t.name:"…"}${r?"?.":"."}length`}(a,o.callee.object);if(!i||n&&nL(o.callee.object,e))return;let s=o.callee.property.name,l={description:i};return"splice"===s?l.argumentName="deleteCount":"toSpliced"===s&&(l.argumentName="skipCount"),{node:a,messageId:r,data:l,fix:t=>iq(t,a,e)}})}let dZ="no-unnecessary-slice-end",d0="catch-error-name",d1=[{type:"object",additionalProperties:!1,properties:{name:{type:"string",description:"The expected name for the error variable."},ignore:{type:"array",items:{type:["string","object"],additionalProperties:!0},uniqueItems:!0,description:"Patterns to ignore."}}}],d2="invalidExport",d3="doNotPassMessageToSuper",d8="doNotAssignMessageWithoutSetter",d6="missingOptionsParameter",d9="invalidOptionsParameter",d5="passMessageToSuper",d4="passOptionsToSuper",d7=/^(?:[A-Z][\da-z]*)*Error$/,me=e=>`
42
- name = '${e}';
43
- `,mt=e=>{var t;let r=(t=e.superClass,t?.type==="Identifier"?t.name:t?.type!=="MemberExpression"||t.computed||"Identifier"!==t.property.type?void 0:t.property.name);return!!r&&d7.test(r)},mr=e=>"ExpressionStatement"===e.type&&"CallExpression"===e.expression.type&&t$(e.expression.callee,"super"),mn=(e,t)=>"ExpressionStatement"===e.type&&"AssignmentExpression"===e.expression.type&&"="===e.expression.operator&&t$(e.expression.left,`this.${t}`),mo=(e,t)=>({node:e,message:`The \`name\` property should be set to \`${t}\`.`}),ma=(e,t)=>tu(e?.value)===t,mi=(e,t)=>"MethodDefinition"===e.type&&e.kind===t&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"message"===e.key.name,ms=e=>e?.type==="Identifier"?e:e?.type==="AssignmentPattern"&&"Identifier"===e.left.type?e.left:void 0,ml=e=>ms(e)?.name==="options",mu=(e,t)=>{if("ThisExpression"===e.type||"Super"===e.type)return!0;for(let r of t[e.type]??[]){let n=e[r];if(n){if(Array.isArray(n)){if(n.some(e=>e&&mu(e,t)))return!0;continue}if(mu(n,t))return!0}}return!1},mp=e=>{let t=ms(e);return t.typeAnnotation?t.optional?"options?: ErrorOptions":"options: ErrorOptions":"options"},mc=(e,t,r)=>n=>{let o=t.arguments;if(0===o.length){let o=e.getTokenAfter(t.callee,e=>"("===e.value);return n.insertTextAfter(o,`${r}, options`)}if(1===o.length){let e;return"undefined"!==r&&(!(e=o[0])||tq(e))?n.replaceText(o[0],`${r}, options`):n.insertTextAfter(o[0],", options")}},md=(e,t)=>e?.type==="Identifier"&&e.name===t.name;function*mm(e,t){if(!mt(t)||null===t.id)return;let{name:r}=t.id,n=iy(r).replace(/(?:error)?$/i,"Error");r!==n&&(yield{node:t.id,message:`Invalid class name, use \`${n}\`.`});let{body:o}=t.body,{sourceCode:a}=e,i=o.find(e=>"constructor"===e.kind),s=o.find(e=>"PropertyDefinition"===e.type&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"name"===e.key.name);if(!i){if(ma(s,r))return;let e=a.getRange(t.body);yield{...mo(s?.value??t,r),fix:t=>s?.value?t.replaceText(s.value,`'${r}'`):s?t.replaceText(s,me(r).trim()):t.insertTextAfterRange([e[0],e[0]+1],me(r))};return}let l=o.some(e=>mi(e,"get")),u=o.some(e=>mi(e,"set"));yield*function*(e,t,r){let{sourceCode:n}=e,o=t.value.body;if(!o)return;let a=o.body,{hasMessageGetter:i,hasMessageSetter:s,checkOptions:l}=r,u=a.find(e=>mr(e)),p=a.findIndex(e=>mr(e)),c=a.findIndex(e=>mn(e,"message")),d=i||s,m=!1;if(u){let r;if(d&&!(!(r=u.expression.arguments[0])||tq(r)))m=!0,yield{node:u,messageId:d3};else if(i&&!s&&-1!==c)m=!0,yield{node:a[c],messageId:d8};else if(!s&&-1!==c){let r=a[c];m=!0,yield{node:u,message:"Pass the error message to `super()` instead of setting `this.message`.",*fix(i){let s=r.expression.right,[l,d]=t.value.params,m=ms(l),f=1===t.value.params.length&&m&&!ml(l),g=f||ml(d);if(0===u.expression.arguments.length){if(c!==p+1||mu(s,n.visitorKeys))return;let[t]=n.getRange(u);yield i.insertTextAfterRange([t,t+6],g?`${to(s,e)}, options`:to(s,e))}else{let e;if(e=u.expression.arguments[0],n.getText(e)!==n.getText(s))return;g&&1===u.expression.arguments.length&&(yield i.insertTextAfter(u.expression.arguments[0],", options"))}f&&(yield i.insertTextAfter(l,`, ${mp(l)}`));let y=0===c?n.getRange(o)[0]:n.getRange(a[c-1])[1],[,h]=n.getRange(r);yield i.removeRange([y,h])}}}}else m=!0,yield{node:o,message:"Missing call to `super()` in constructor."};let f=function(e,t,r){let{name:n,nameProperty:o}=r,a=t.find(e=>mn(e,"name"));return a?tu(a.expression.right)!==n?mo(a.expression.right??e,n):void 0:ma(o,n)?void 0:mo(o?.value??e,n)}(o,a,r);if(f&&(yield f),!f&&l&&!m){let r=((e,t,r,n)=>{let o=t.value.params,a=o[0],i=ms(a);if(0===o.length||!i)return;let s=r.expression;if(ml(a)){if(!ml(s.arguments[1])){let t={node:s,messageId:d4};return md(s.arguments[0],i)||(t.fix=mc(e.sourceCode,s,"undefined")),t}return}let l=o[1],u=!n&&"message"===i.name,p=u?i.name:"undefined";if(!l){if(((e,t)=>{if(t)return!1;let[r,n]=e.arguments;return 2===e.arguments.length&&void 0!==tu(r)&&"ObjectExpression"===n.type&&1===n.properties.length&&"cause"===ez(n.properties[0])})(s,u))return;return{node:a,messageId:d6,fix:function*(r){let{sourceCode:n}=e,o=mc(n,s,p)(r);if(!o)return;let a=t.value.params[0];yield r.insertTextAfter(a,`, ${mp(a)}`),yield o}}}if(!ml(l))return{node:l,messageId:d9};if(u&&!md(s.arguments[0],i)){let t;return{node:s,messageId:d5,fix:(t=e.sourceCode,e=>{let r,n=s.arguments;if(0===n.length){let r=t.getTokenAfter(s.callee,e=>"("===e.value);return e.insertTextAfter(r,`${p}, options`)}if(!(r=n[0])||tq(r))return e.replaceText(n[0],1===n.length?`${p}, options`:p)})}}if(!ml(s.arguments[1]))return{node:s,messageId:d4,fix:mc(e.sourceCode,s,p)}})(e,t,u,d);r&&(yield r)}}(e,i,{name:r,nameProperty:s,hasMessageGetter:l,hasMessageSetter:u,checkOptions:r===n})}let mf="no-lonely-if",mg=e=>"IfStatement"===e.type&&!e.alternate;function my(e,t){let r={ifToken:t.getFirstToken(e),openingParenthesisToken:t.getFirstToken(e,1)},{consequent:n}=e;return r.closingParenthesisToken=t.getTokenBefore(n),"BlockStatement"===n.type&&(r.openingBraceToken=t.getFirstToken(n),r.closingBraceToken=t.getLastToken(n)),r}let mh=(e,t,r)=>r.text.slice(r.getRange(e)[1],r.getRange(t)[0]),mx=e=>e.trim()?e:"",mb=(e,t)=>/\s$/u.test(e)&&/^\s/u.test(t)?e+t.trimStart():e+t,mE=(e,t)=>mh(e.ifToken,e.openingParenthesisToken,t),mv=(e,t,r)=>{let n,o=mh(e.openingParenthesisToken,e.closingParenthesisToken,r);return ta(e.test,t)?o:"LogicalExpression"===(n=e.test).type&&("||"===n.operator||"??"===n.operator)||"ConditionalExpression"===n.type||"AssignmentExpression"===n.type||"YieldExpression"===n.type||"SequenceExpression"===n.type?`(${o})`:o},mS="no-magic-array-flat-depth",mC="no-negated-condition",mD="identifier",mT="non-identifier",mA="prefer-negative-index",mw=new o([["slice",{argumentsIndexes:[0,1],supportObjects:new i(["Array","String","ArrayBuffer",...r9])}],["subarray",{argumentsIndexes:[0,1],supportObjects:new i(r9)}],["splice",{argumentsIndexes:[0],supportObjects:new i(["Array"])}],["toSpliced",{argumentsIndexes:[0],supportObjects:new i(["Array"])}],["at",{argumentsIndexes:[0],supportObjects:new i(["Array","String",...r9])}]]),mk=e=>{let{type:t,property:r}=e;if("MemberExpression"===t&&"Identifier"===r.type)return r.name};var mI=["node:assert","assert","node:assert/strict","assert/strict","node:async_hooks","async_hooks","node:buffer","buffer","node:child_process","child_process","node:cluster","cluster","node:console","console","node:constants","constants","node:crypto","crypto","node:dgram","dgram","node:diagnostics_channel","diagnostics_channel","node:dns","dns","node:dns/promises","dns/promises","node:domain","domain","node:events","events","node:ffi","node:fs","fs","node:fs/promises","fs/promises","node:http","http","node:http2","http2","node:https","https","node:inspector","inspector","node:inspector/promises","inspector/promises","node:module","module","node:net","net","node:os","os","node:path","path","node:path/posix","path/posix","node:path/win32","path/win32","node:perf_hooks","perf_hooks","node:process","process","node:querystring","querystring","node:quic","node:readline","readline","node:readline/promises","readline/promises","node:repl","repl","node:sea","node:sqlite","node:stream","stream","node:stream/consumers","stream/consumers","node:stream/iter","stream/iter","node:stream/promises","stream/promises","node:stream/web","stream/web","node:string_decoder","string_decoder","node:test","node:test/reporters","node:timers","timers","node:timers/promises","timers/promises","node:tls","tls","node:trace_events","trace_events","node:tty","tty","node:url","url","node:util","util","node:util/types","util/types","node:v8","v8","node:vm","vm","node:wasi","wasi","node:worker_threads","worker_threads","node:zlib","zlib","node:zlib/iter","zlib/iter"];function mj(t){if("string"!=typeof t)throw TypeError("Expected a string");return(e??=new i(mI)).has(t)}let mF="prefer-node-protocol",mB="node:",mR="consistent-date-clone/error",mP="no-accessor-recursion/error",mL=e=>"Identifier"===e.type||"PrivateIdentifier"===e.type,mN=(e,t)=>["type","name"].every(r=>e[r]===t[r]),m$=(e,t)=>"MemberExpression"===e.parent.type&&e.parent.object===e&&!e.parent.computed&&mL(e.parent.property)&&mN(e.parent.property,t.key),mM="error/calculate-dirname",mO="error/calculate-filename";function mq(e,{modules:t,functionName:r,sourceCode:n}){if(!tb(e,{optional:!1,argumentsLength:1},ty))return!1;let o=new i;return function e(t,i){if("MemberExpression"===t.type)return!!("property"===i&&tF(t,{property:r,computed:!1,optional:!1}))&&e(t.object,"module");if("CallExpression"===t.type)return"module"===i&&tR(t,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalMember:!1,optionalCall:!1})&&a(t.arguments[0]);if("Identifier"!==t.type||o.has(t))return!1;o.add(t);let s=eS(n.getScope(t),t);return!!s&&1===s.defs.length&&function(t,n){if("ImportBinding"===t.type){if(!a(t.parent.source))return!1;let e=t.node;return"module"===n?e?.type==="ImportDefaultSpecifier"||e?.type==="ImportNamespaceSpecifier":e?.type==="ImportSpecifier"&&e.imported.name===r}return"Variable"===t.type&&function t(n,o){let{parent:a}=n;return"VariableDeclarator"===a.type?!!a.init&&a.id===n&&"VariableDeclaration"===a.parent.type&&"const"===a.parent.kind&&e(a.init,o):"Property"===a.type&&!!("property"===o&&a.value===n&&!a.computed&&"Identifier"===a.key.type&&a.key.name===r)&&t(a.parent,"module")}(t.name,n)}(s.defs[0],i)}(e.callee,"property");function a(e){return e?.type==="Literal"&&t.has(e.value)}}function mU(e,t){return mq(e,{modules:new i(["url","node:url"]),functionName:"fileURLToPath",sourceCode:t})}function mW(e,t){return mq(e,{modules:new i(["path","node:path"]),functionName:"dirname",sourceCode:t})}let mV="no-unnecessary-array-flat-depth",m_="no-unnecessary-array-splice-count",mz="no-useless-error-capture-stack-trace/error",mK="prefer-class-fields/error",mG="prefer-class-fields/suggestion",mJ="prefer-bigint-literals/error",mX="prefer-bigint-literals/suggestion",mY="prefer-classlist-toggle/error",mH="prefer-classlist-toggle/suggestion",mQ=e=>tF(e,{property:"classList",computed:!1}),mZ=(e,t,r)=>{let n={node:r??e,messageId:mY};return"IfStatement"===e.type||tT(e)||tT(e.parent)?n.fix=t:n.suggest=[{messageId:mH,fix:t}],n},m0=(e,t,r)=>{let{sourceCode:n}=t,o=to(e,t);return r?(!ta(e,n)&&ia(e,"!")&&(o=`(${o})`),o=`!${o}`):(ta(e,n)||"SequenceExpression"!==e.type||(o=`(${o})`),o)},m1=(e,t)=>tR(e,{methods:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})&&mQ(e.callee.object),m2=(e,t)=>rk(e.callee.object,t.callee.object)&&rk(e.arguments[0],t.arguments[0]),m3=(e,t,r)=>t?("ChainExpression"===e.type&&(e=e.expression),m1(e,["contains"])&&m2(e,r))?e:void 0:"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix?m3(e.argument,!t,r):void 0,m8="require-module-attributes",m6="error",m9="suggestion/array",m5="suggestion/object",m4="suggestion/object-assign",m7="suggestion/set",fe="suggestion/map",ft=(e,t,r)=>{let{sourceCode:n}=r,o=r1(e);return t.some(e=>{let t=n.getRange(e);return o.some(e=>{let[r,o]=n.getRange(e);return r>=t[0]&&o<=t[1]})})};function fr(e,t){if(!tE(e,{names:t,maximumArguments:1}))return!1;let[r]=e.arguments;return!r||"ArrayExpression"===r.type}function*fn(e,t,r){let n=!eA(t.sourceCode.getTokenBefore(e));yield iQ(e,t,r,n)}function fo(e,t,r,n){let{sourceCode:o}=e,[a,i]=o.getLastTokens(r,2),s=("ArrayExpression"===r.type?r.elements:r.properties).length>0&&!eT(a);return t.insertTextBefore(i,`${s?",":""} ${n}`)}function*fa({context:e,fixer:t,newExpression:r,elementsText:n,nextExpressionStatement:o}){if(rC(r,e)){let[o]=r.arguments;if(o)yield fo(e,t,o,n);else{let{openingParenthesisToken:o}=rC(r,e)?rD(r,e):{};yield t.insertTextAfter(o,`[${n}]`)}}else yield t.insertTextAfter(r,`([${n}])`);yield*fn(o,e,t)}let fi=[{testValue:e=>e?.type==="ArrayExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(tR(n,{object:t.name,methods:["push","unshift"],optionalMember:!1,optionalCall:!1})&&n.arguments.length>0&&!ft(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,i=e.callee,s=i.property,l={node:i,messageId:m6,data:{objectType:"array"}},u="unshift"===s.name,p=o(t,{callExpression:e,isPrepend:u});return e.arguments.some(e=>eH(e,a))?l.suggest=[{messageId:m9,fix:p,data:{operation:u?"Prepend":"Append",assignType:n}}]:l.fix=p,l},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{callExpression:n,isPrepend:o})=>function*(a){let i=rT(e,n,!1);yield o?a.insertTextAfter(e.sourceCode.getFirstToken(t),`${i}, `):fo(e,a,t,i),yield fn(r,e,a)}},{testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(!("AssignmentExpression"===n.type&&"="===n.operator&&tF(n.left,{object:t.name,optional:!1})))return;let o=n.right,a=n.left,{property:i}=a;if(!ft(t,a.computed?[i,o]:[o],e))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,{left:i,right:s}=e,{property:l}=i,u=a.getTokenAfter(i,t=>"Punctuator"===t.type&&t.value===e.operator),p={node:e,loc:{start:a.getLoc(e).start,end:a.getLoc(u).end},messageId:m6,data:{objectType:"object"}},c=o(t,{assignmentExpression:e,memberExpression:i,property:l,value:s});return i.computed&&eH(l,a)||eH(s,a)?p.suggest=[{messageId:m5,data:{assignType:n},fix:c}]:p.fix=c,p},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{memberExpression:n,property:o,value:a})=>function*(i){let s=to(o,e);n.computed&&(s=`[${s}]`);let l=to(a,e),u=`${s}: ${l},`,[p,c]=e.sourceCode.getLastTokens(t,2),d=t.properties.length>0&&!eT(p);yield i.insertTextBefore(c,`${d?",":""} ${u}`),yield fn(r,e,i)}},{testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(!tR(n,{object:"Object",method:"assign",minimumArguments:2,optionalMember:!1,optionalCall:!1}))return;let[o,a]=n.arguments;if(!("Identifier"!==o.type||o.name!==t.name||"SpreadElement"===a.type||ft(t,[a],e)))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,[,i]=e.arguments,s={node:e.callee,messageId:m6,data:{objectType:"object"}},l=o(t,{callExpression:e,firstValue:i});return eH(i,a)?s.suggest=[{messageId:m4,data:{description:"ObjectExpression"===i.type?"Move properties to":"Spread properties in",assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{callExpression:n,firstValue:o})=>function*(a){let i;("ObjectExpression"===o.type?o.properties.length>0&&(i=function(e,t){let{sourceCode:r}=t,n=r.getFirstToken(e),[o,a]=r.getLastTokens(e,2),[,i]=r.getRange(n),[s]=r.getRange(eT(o)?o:a);return r.text.slice(i,s)}(o,e)):i=`...${to(o,e)}`,i&&(yield fo(e,a,t,i)),2!==n.arguments.length)?yield iq(a,o,e):yield fn(r,e,a)}},{testValue:e=>fr(e,["Set","WeakSet"]),getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(("ChainExpression"===n.type&&(n=n.expression),tR(n,{object:t.name,method:"add",argumentsLength:1,optionalMember:!1,optionalCall:!1}))&&!ft(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,valueNode:o,getFix:a}=t,{sourceCode:i}=r,s={node:e.callee,messageId:m6,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>eH(e,i))?s.suggest=[{messageId:m7,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=rT(e,r,!1);return fa({context:e,fixer:o,newExpression:n,elementsText:a,nextExpressionStatement:t})}},{testValue:e=>fr(e,["Map","WeakMap"]),getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(tR(n,{object:t.name,method:"set",argumentsLength:2,optionalCall:!1})&&!ft(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,valueNode:o,getFix:a}=t,{sourceCode:i}=r,s={node:e.callee,messageId:m6,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>eH(e,i))?s.suggest=[{messageId:fe,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=rT(e,r,!1);return fa({context:e,fixer:o,newExpression:n,elementsText:`[${a}]`,nextExpressionStatement:t})}}],fs="no-useless-collection-argument/error",fl="no-useless-collection-argument/suggestion",fu="prefer-response-static-json",fp=/([\p{Ll}\d])(\p{Lu})/gu,fc=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,fd=/(\d)\p{Ll}|(\p{L})\d/u,fm=/[^\p{L}\d]+/giu,ff="$1\0$2";function fg(e){let t=e.trim();t=(t=t.replace(fp,ff).replace(fc,ff)).replace(fm,"\0");let r=0,n=t.length;for(;"\0"===t.charAt(r);)r++;if(r===n)return[];for(;"\0"===t.charAt(n-1);)n--;return t.slice(r,n).split(/\0/g)}function fy(e){let t=fg(e);for(let e=0;e<t.length;e++){let r=t[e],n=fd.exec(r);if(n){let o=n.index+(n[1]??n[2]).length;t.splice(e,1,r.slice(0,o),r.slice(o))}}return t}function fh(e,t){let[r,n,o]=fC(e,t);return r+n.map(fE(t?.locale)).join(t?.delimiter??" ")+o}function fx(e,t){var r,n;let[o,a,i]=fC(e,t),s=fE(t?.locale),l=fv(t?.locale),u=t?.mergeAmbiguousCharacters?(r=s,n=l,e=>`${n(e[0])}${r(e.slice(1))}`):fS(s,l);return o+a.map((e,t)=>0===t?s(e):u(e,t)).join(t?.delimiter??"")+i}function fb(e,t){let[r,n,o]=fC(e,t),a=fS(fE(t?.locale),fv(t?.locale));return r+n.map(a).join("")+o}function fE(e){return!1===e?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function fv(e){return!1===e?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function fS(e,t){return(r,n)=>{let o=r[0];return(n>0&&o>="0"&&o<="9"?"_"+o:t(o))+e(r.slice(1))}}function fC(e,t={}){let r=t.split??(t.separateNumbers?fy:fg),n=t.prefixCharacters??"",o=t.suffixCharacters??"",a=0,i=e.length;for(;a<e.length;){let t=e.charAt(a);if(!n.includes(t))break;a++}for(;i>a;){let t=i-1,r=e.charAt(t);if(!o.includes(r))break;i=t}return[e.slice(0,a),r(e.slice(a,i)),e.slice(i)]}let fD="filename-case",fT="directory-case",fA="filename-extension",fw=e=>!/^[\w-]$/.test(e),fk=new i(["index.js","index.mjs","index.cjs","index.ts","index.tsx","index.vue"]),fI=new Intl.ListFormat("en-US",{type:"disjunction"}),fj=/^[\da-z]+$/i,fF=/^[A-Z]{3,}(?=\d*[A-Z](?:[a-z]|\d+[a-z]))/,fB=e=>e>="0"&&e<="9",fR=e=>e>="a"&&e<="z",fP=e=>e>="A"&&e<="Z",fL={camelCase:{fn:fx,name:"camel case"},camelCaseWithAcronyms:{fn:function(e){return!function(e){if(!fR(e[0]))return!1;for(let t=1;t<e.length;t++){let r=e[t];if(fR(r)||fB(r))continue;if(!fP(r))return!1;let n=t;for(;fP(e[t+1]);)t++;if(t!==n){if(fR(e[t+1])){t--;continue}for(;fB(e[t+1]);)t++;if(t===e.length-1)return!0;if(!fP(e[t+1]))return!1}}return!0}(e)?fx(e):e},name:"camel case with acronyms"},kebabCase:{fn:function(e,t){return fh(e,{delimiter:"-",...t})},name:"kebab case"},snakeCase:{fn:function(e,t){return fh(e,{delimiter:"_",...t})},name:"snake case"},pascalCase:{fn:function(e){if(fj.test(e)){let t=fF.exec(e)?.[0],r=t&&e.slice(t.length);if(r&&fb(r)===r)return e}return fb(e)},name:"pascal case"}};function fN(e,t){return e.filter(({ignored:e})=>!e).every(({word:e})=>t.some(t=>t(e)===e))}function f$(e,t,{leading:r,trailing:n}){let{samples:o}=function(e,t=1/0){let r=e.reduce((e,{length:t})=>e*t,1),n=Array.from({length:Math.min(r,t)},(t,r)=>{let n=r,o=[];for(let t=e.length-1;t>=0;t--){let r=e[t],{length:a}=r,i=n%a;n=(n-i)/a,o.unshift(r[i])}return o});return{total:r,samples:n}}(e.map(({word:e,ignored:r})=>r?[e]:t.map(t=>t(e))));return[...new i(o.map(e=>`${r}${e.join("")}${n}`))]}let fM=/^(?<leading>_+)(?<tailing>.*)$/;function fO(e){let t,{leading:r="",tailing:n=e}=(fM.exec(e)||{groups:{}}).groups,o=[];for(let e of n){let r=fw(e);t?.ignored===r?t.word+=e:(t={word:e,ignored:r},o.push(t))}return{leading:r,words:o}}function fq(e){let t;return t=e.map(e=>fL[e].name),fI.format(t)}let fU=[{description:"The rule options.",anyOf:[{properties:{case:{enum:["camelCase","camelCaseWithAcronyms","snakeCase","kebabCase","pascalCase"],description:"The filename and directory name case style."},ignore:{type:"array",items:{type:["string","object"],additionalProperties:!0},uniqueItems:!0,description:"Path segment patterns to ignore."},multipleFileExtensions:{type:"boolean",description:"Whether to treat additional, dot-separated parts of a filename as file extensions."},checkDirectories:{type:"boolean",description:"Whether to check directory names."}},additionalProperties:!1},{properties:{cases:{properties:{camelCase:{type:"boolean",description:"Whether to allow camelCase filenames and directory names."},camelCaseWithAcronyms:{type:"boolean",description:"Whether to allow camelCase filenames and directory names with acronym segments."},snakeCase:{type:"boolean",description:"Whether to allow snake_case filenames and directory names."},kebabCase:{type:"boolean",description:"Whether to allow kebab-case filenames and directory names."},pascalCase:{type:"boolean",description:"Whether to allow PascalCase filenames and directory names."}},additionalProperties:!1,description:"The allowed filename and directory name case styles."},ignore:{type:"array",items:{type:["string","object"],additionalProperties:!0},uniqueItems:!0,description:"Path segment patterns to ignore."},multipleFileExtensions:{type:"boolean",description:"Whether to treat additional, dot-separated parts of a filename as file extensions."},checkDirectories:{type:"boolean",description:"Whether to check directory names."}},additionalProperties:!1}]}],fW="consistent-template-literal-escape",fV=["entries","keys","values"],f_=["drop","filter","flatMap","map","take"],fz=["concat","from","zip","zipKeyed"],fK=new i(["ArrayIterator","Generator","IterableIterator","Iterator","IteratorObject","MapIterator","RegExpStringIterator","SetIterator"]),{isTarget:fG}=nC({checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:fK}),fJ=e=>{for(;rL(e)||"ChainExpression"===e.type||"ParenthesizedExpression"===e.type;)e=e.expression;return e},fX="iterable-accepting",fY="for-of",fH="yield-star",fQ="spread",fZ="iterator-method",f0="iterable-accepting/suggestion",f1="iterator-method/suggestion",f2=["every","find","forEach","some"],f3="reduce",f8=e=>tR(e,{method:"toArray",argumentsLength:0,optionalCall:!1,optionalMember:!1}),f6=(e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>iH(r,e,t)},f9=(e,t,r,n)=>{let o=f6(e,t);if(o)return{messageId:r,...n&&{data:n},fix:o}},f5="prefer-simple-condition-first",f4="prefer-simple-condition-first/unsafe";function f7(e){return"Identifier"===(e=rN(e)).type||"UnaryExpression"===e.type&&"typeof"===e.operator&&"Identifier"===rN(e.argument).type}function ge(e){if(f7(e=rN(e))||"Literal"===e.type)return!0;if("UnaryExpression"!==e.type||"-"!==e.operator&&"+"!==e.operator)return!1;let t=rN(e.argument);return"Literal"===t.type&&("number"==typeof t.value||"-"===e.operator&&"bigint"==typeof t.value)}function gt(e){if("Identifier"===(e=rN(e)).type)return!0;if("UnaryExpression"===e.type&&"!"===e.operator)return gt(e.argument);if("BinaryExpression"===e.type){let t=rN(e.left),r=rN(e.right);return!!(("=="===e.operator||"!="===e.operator)&&("Identifier"===t.type&&td(r)||td(t)&&"Identifier"===r.type))||ge(t)&&ge(r)&&("==="===e.operator||"!=="===e.operator)&&(f7(t)||f7(r))}return!1}let gr="switch-case-break-position",gn=new i(["BreakStatement","ReturnStatement","ContinueStatement","ThrowStatement"]),go="first-child",ga="first-element-child",gi="query-selector",gs="closest",gl="merge-query-selector",gu="suggestion-first-child",gp="suggestion-first-element-child",gc="suggestion-merge-query-selector",gd={method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1},gm=(e,t)=>tF(e,{property:t,optional:!1,computed:!1}),gf=e=>"MemberExpression"===e.type&&!e.optional&&e.computed&&tp(e.property)&&Number.isSafeInteger(e.property.value)&&e.property.value>=0,gg=(e,t)=>t.getCommentsInside(e).length>0,gy=(e,t,r,n)=>{let{sourceCode:o}=n;if(gg(e,o))return;let[,a]=tn(e.object,n),[,i]=o.getRange(e);return[{messageId:r,fix:r=>[r.replaceText(e.object.property,t),r.removeRange([a,i])]}]},gh=e=>tF(e,{property:"parentElement",optional:!1,computed:!1}),gx=e=>void 0!==tu(e),gb=e=>tR(e,gd),gE=new i(["FunctionDeclaration","ClassDeclaration","TSTypeAliasDeclaration","TSInterfaceDeclaration","TSEnumDeclaration"]),gv=new i(["AccessorProperty","MethodDefinition","PropertyDefinition","TSAbstractAccessorProperty","TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSMethodSignature","TSPropertySignature"]),gS=e=>{let t="";return"Variable"===e.type?t=e.node.init.arguments[0].value:"ImportBinding"===e.type&&(t=e.parent.source.value),!t.includes("node_modules")&&(t.startsWith(".")||t.startsWith("/"))},gC="consistent-compound-words/error",gD="consistent-compound-words/rename",gT={backGround:"background",callBack:"callback",checkBox:"checkbox",clipBoard:"clipboard",codeBase:"codebase",dataBase:"database",downLoad:"download",feedBack:"feedback",foreGround:"foreground",frameWork:"framework",headLine:"headline",keyBoard:"keyboard",keyFrame:"keyframe",lifeCycle:"lifecycle",metaData:"metadata",midPoint:"midpoint",nameSpace:"namespace",overRide:"override",passWord:"password",payLoad:"payload",placeHolder:"placeholder",preView:"preview",screenShot:"screenshot",sideBar:"sidebar",subClass:"subclass",subDirectory:"subdirectory",subDomain:"subdomain",subMenu:"submenu",subProcess:"subprocess",subString:"substring",subTree:"subtree",subType:"subtype",subTitle:"subtitle",timeOut:"timeout",timeStamp:"timestamp",toolBar:"toolbar",toolKit:"toolkit",toolTip:"tooltip",touchScreen:"touchscreen",unSubscribe:"unsubscribe",underScore:"underscore",upLoad:"upload",userName:"username",viewPort:"viewport",webCam:"webcam",webHook:"webhook",webSite:"website",weekEnd:"weekend",whiteSpace:"whitespace",wildCard:"wildcard",workFlow:"workflow",workSpace:"workspace"},gA=new i(String.raw`\^$.*+?()[]{}|`),gw=e=>{let t="";for(let r of e)t+=gA.has(r)?`\\${r}`:r;return t},gk=String.raw`(?=$|[\d_$]|\p{Uppercase_Letter})`,gI=(e,{replacementRegExp:t,replacements:r,allowList:n})=>{if(!t||e===e.toUpperCase()||n.has(e))return;let o=e.replaceAll(t,e=>((e,t)=>{let r=t.get(e)??t.get(ih(e));if(r){let t;return(t=e[0])===t.toUpperCase()?iy(r):ih(r)}})(e,r));if(o!==e)return o},gj=(e,t)=>({node:e,messageId:gC,data:{name:e.name,replacement:t}}),gF={type:"array",additionalItems:!1,items:[{type:"object",additionalProperties:!1,properties:{checkProperties:{type:"boolean",description:"Whether to check property names."},checkVariables:{type:"boolean",description:"Whether to check variable names."},checkDefaultAndNamespaceImports:{anyOf:[{type:"boolean"},{enum:["internal"]}],description:"Whether to check default and namespace import names."},checkShorthandImports:{anyOf:[{type:"boolean"},{enum:["internal"]}],description:"Whether to check shorthand import names."},checkShorthandProperties:{type:"boolean",description:"Whether to check shorthand property names."},extendDefaultReplacements:{type:"boolean",description:"Whether to extend the default replacements."},replacements:{$ref:"#/definitions/replacements",description:"Custom compound word replacements."},allowList:{$ref:"#/definitions/trueObject",description:"Custom allow list of names."}}}],definitions:{replacements:{type:"object",propertyNames:{minLength:1},additionalProperties:{anyOf:[{enum:[!1]},{type:"string",minLength:1}]}},trueObject:{type:"object",propertyNames:{minLength:1},additionalProperties:{enum:[!0]}}}},gB="no-blob-to-file",gR="suggestion";function gP(e,t){let r=eS(t.sourceCode.getScope(e),e);return!r||0===r.defs.length}function gL(e,t){if(e?.type!=="Identifier")return;let r=eS(t.sourceCode.getScope(e),e),n=r?.defs[0],o=n?.node;if(n?.type==="Variable"&&"const"===n.kind&&o?.type==="VariableDeclarator")return o}let gN="no-canvas-to-image",g$=e=>{for(;e?.type==="AwaitExpression";)e=e.argument;return e};function gM(e,t){if(e=g$(e),e?.type!=="Identifier")return e;let r=eS(t.getScope(e),e);if(!r||1!==r.identifiers.length||2!==r.references.length)return;let[n]=r.identifiers;if("VariableDeclarator"===n.parent.type&&n.parent.id===n&&"VariableDeclaration"===n.parent.parent.type&&"const"===n.parent.parent.kind&&!(t.getRange(n)[0]>t.getRange(e)[0]))return g$(n.parent.init)}let gO=e=>e.toLowerCase().includes("canvas"),gq="replace-one-element",gU="insert-at-negative-one",gW="suggestion-replace-one-element",gV="suggestion-insert-at-negative-one";function g_(e){return"Identifier"===e.type||"ThisExpression"===e.type||"MemberExpression"===e.type&&!e.computed&&!e.optional&&g_(e.object)}let gz=(e,t)=>t.getCommentsInside(e).length>0,gK="no-duplicate-set-values",gG="first-match",gJ="id-selector",gX="length-check",gY="query-selector-all-nullish",gH="query-selector-undefined",gQ=e=>tR(e,{method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!oh(e.callee.object),gZ=e=>tR(e,{method:"querySelectorAll",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!oh(e.callee.object),g0=e=>{let t,r;return t=e,r=gZ,"MemberExpression"===t.type&&t.computed&&!t.optional&&r(t.object)&&ti(t.property,0)},g1=e=>{let t,r;return t=e,r=gZ,tR(t,{methods:["at","item"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&r(t.callee.object)&&ti(t.arguments[0],0)},g2=e=>nG(e)||("ForInStatement"===e.parent.type||"ForOfStatement"===e.parent.type)&&e.parent.left===e,g3=(e,t,r,n)=>{let[,o]=tn(t,n),[,a]=r.getRange(e);return r.getAllComments().some(e=>{let[t,n]=r.getRange(e);return t>=o&&n<=a})},g8=(e,t,r)=>{if("Identifier"!==e.type)return;let n=eS(t.getScope(e),e);if(!n||1!==n.defs.length)return;let[o]=n.defs;if("Variable"===o.type&&"const"===o.parent.kind&&o.node.id===o.name&&r(o.node.init))return o.node.init},g6=(e,t)=>{let{sourceCode:r}=t,{node:n,isNegative:o}=function(e,t){let r=!1;for(;;)if(t_(e))r=!r,e=e.parent;else if(tz(e,t))e=e.parent;else break;return{node:e,isNegative:r}}(e,t);if(!tJ(n)||(gZ(e)?!e:!g8(e,r,gZ)))return;let a=r.getText(e);return{node:e,messageId:gX,fix:((e,t,r)=>{let[n,o]=r.getRange(e),[a,i]=r.getRange(t);return r.getAllComments().some(e=>{let[t,s]=r.getRange(e);return t>=n&&s<=o&&(s<=a||t>=i)})})(n,e,r)?void 0:e=>e.replaceText(n,`${a}.length ${o?"=== 0":"> 0"}`)}},g9=(e,t,r)=>({node:e,messageId:gG,*fix(n){yield n.replaceText(t.callee.property,"querySelector"),yield"MemberExpression"===e.type?iY(n,e,r):iH(n,e,r)}}),g5=(e,t)=>td(e)||tq(e)&&t.isGlobalReference(e),g4=(e,t,r)=>{let{left:n,operator:o,right:a}=e;return["==","===","!=","!=="].includes(o)?(t(n)?n:g8(n,r,t))&&g5(a,r)?{node:n,value:a}:(t(a)?a:g8(a,r,t))&&g5(n,r)?{node:a,value:n}:void 0:void 0},g7="no-invalid-file-input-accept/invalid",ye="no-invalid-file-input-accept/static",yt="no-invalid-file-input-accept/normalize",yr=new i(["audio/*","image/*","video/*"]),yn=new o([["application/x-rar-compressed","application/vnd.rar"],["application/x-zip-compressed","application/zip"],["image/jpg","image/jpeg"],["image/svg","image/svg+xml"],["image/x-icon","image/vnd.microsoft.icon"]]),yo=/&(?:#\d+|#x[\da-f]+|[a-z][\da-z]*);/iv,ya=e=>{for(let t of e)if(""===t.trim()||","===t||"/"===t||"*"===t||"$"===t||"{"===t||"}"===t)return!0;return!1},yi=e=>{if(e.startsWith("."))return e.length>1&&!ya(e.slice(1))?{replacement:e.toLowerCase()}:{reason:"File extensions must start with `.` and cannot contain whitespace, commas, slashes, wildcards, or template markers."};if(!e.includes("/"))return e.length>0&&"."!==e[0]&&!ya(e)?{replacement:`.${e.toLowerCase()}`}:{reason:"File extensions must start with `.` and cannot contain whitespace, commas, slashes, wildcards, or template markers."};let t=e.toLowerCase();if(t.includes("*"))return yr.has(t)?{replacement:t}:{reason:"Wildcard MIME types must be `audio/*`, `image/*`, or `video/*`."};try{let{essence:t}=new C.MIMEType(e);return{replacement:yn.get(t)??t}}catch{return{reason:"MIME types must use valid `type/subtype` syntax."}}},ys=e=>{if("JSXIdentifier"===e.type)return e.name},yl=(e,t)=>e.attributes.find(e=>"JSXAttribute"===e.type&&ys(e.name)===t),yu=(e,t)=>{let r=e.sourceCode.getScope(t),n=eV(t,r)?.value;if("string"==typeof n)return n},yp=e=>">"===e||""===e.trim(),yc=(e,t,r)=>{for(;t<r&&""===e[t].trim();)t++;return t},yd=(e,t,r)=>t>=r||">"===e[t]||"/"===e[t]&&">"===e[t+1],ym=(e,t,r)=>{let n=t;for(;t<r&&""!==e[t].trim()&&"="!==e[t]&&">"!==e[t]&&("/"!==e[t]||">"!==e[t+1]);)t++;return{name:e.slice(n,t).toLowerCase(),index:t}},yf=(e,t,r)=>{let n='"'===e[t]||"'"===e[t]?e[t]:void 0;if(n){let o=t+1;for(t=o;t<r&&e[t]!==n;)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!0,index:t+1}}let o=t;for(;t<r&&!yp(e[t]);)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!1,index:t}},yg=(e,t,r)=>{let n=e.sourceCode.text,o=e.sourceCode.getRange(t.openStart)[1],a=e.sourceCode.getRange(t.openEnd)[1],i=o;for(;i<a&&(i=yc(n,i,a),!yd(n,i,a));){let e=ym(n,i,a);if(i=yc(n,e.index,a),"="!==n[i]){if(e.name===r)return{missing:!0};continue}i=yc(n,++i,a);let t=yf(n,i,a);if(i=t.index,e.name===r)return t}},yy=({valueInfo:e,fix:t})=>{if(e.missing)return{node:e.node,messageId:g7,data:{reason:"The `accept` attribute must have a value."}};if(e.dynamic)return{node:e.node,messageId:ye};let r=(e=>{let t=e.split(","),r=new i,n=[];for(let e of t){let t=e.trim();if(0===t.length)return{reason:"Empty entries are not allowed."};let o=yi(t);if(o.reason)return o;let{replacement:a}=o;r.has(a)||(r.add(a),n.push(a))}let o=n.join(", ");return o===e?{}:{replacement:o}})(e.value),n=r.replacement&&e.fixable&&(!e.isReplacementFixable||e.isReplacementFixable(r.replacement));return(({valueNode:e,checkResult:t,fix:r})=>{if(t.reason)return{node:e,messageId:g7,data:{reason:t.reason}};if(t.replacement){let n={node:e,messageId:yt,data:{replacement:t.replacement}};return r&&(n.fix=r),n}})({valueNode:e.node,checkResult:r,fix:n?t(r.replacement):void 0})},yh=/^(?:e|event|evt|[a-z][\dA-Za-z]*Event)$/u,yx=e=>{for(let t=e.parent;t;t=t.parent)if(tw(t))return t},yb=(e,t)=>{switch(e.type){case"ForStatement":return[e.test,e.update,e.body].includes(t);case"ForInStatement":case"ForOfStatement":return t!==e.right;case"DoWhileStatement":case"WhileStatement":return!0;default:return!1}},yE=e=>{let{sourceCode:t}=e,r=new i,n=e=>{let t=yx(e);t&&r.add(t)};return e.onExit("AwaitExpression",n),e.onExit("YieldExpression",n),e.onExit("ForOfStatement",e=>{e.await&&n(e)}),{isFunctionSuspended:e=>r.has(e),isInsideSuspendingLoop(e,r){for(let n=e,o=e.parent;o&&o!==r;n=o,o=o.parent)if(yb(o,n)&&tY(o,t.visitorKeys))return!0;return!1}}},yv="after-suspension",yS="in-nested-function",yC="no-unnecessary-nested-ternary";function yD(e,t,r){return r.getText(e)===r.getText(t)}function yT(e,t,r,n){let o=to(e,t);return!ta(e,t)&&ii(e,{operator:r,property:n})&&(o=`(${o})`),o}function yA(e,t){let r=to(e,t);return!ta(e,t)&&a4(e)&&(r=`(${r})`),r}function yw(e,t,r){let n={node:t,messageId:yC};return 0===e.sourceCode.getCommentsInside(t).length&&(n.fix=n=>n.replaceText(t,function({context:e,node:t,left:r,operator:n,right:o,consequent:a,alternate:i}){let{sourceCode:s}=e,l=[yT(r,e,n,"left"),yT(o,e,n,"right")].join(` ${n} `),u=`${l} ? ${yA(a,e)} : ${yA(i,e)}`;return aL(s.getTokenBefore(t),e,u)&&(u=`;${u}`),u}({context:e,node:t,...r}))),n}let yk="no-unused-array-method-return",yI=new i(["at","concat","entries","every","filter","find","findIndex","findLast","findLastIndex","flat","flatMap","includes","indexOf","join","keys","lastIndexOf","map","some","slice","toReversed","toSorted","toSpliced","values","with"]),yj=/^\p{Uppercase_Letter}/v,yF=Symbol("uncertainValue"),yB=["BigInt","Boolean","Number","RegExp","String","Symbol"],yR=(e,t,r)=>"Identifier"===e.type&&e.name===t&&r.sourceCode.isGlobalReference(e),yP="prefer-array-last-methods",yL="replace",yN=new o([["find","findLast"],["findIndex","findLastIndex"],["indexOf","lastIndexOf"],["reduce","reduceRight"]]),y$=["reverse","toReversed"],yM="prefer-math-abs",yO=new i([">",">=","<","<="]),yq={">":"<",">=":"<=","<":">","<=":">="},yU={">":"<",">=":"<="};function yW(e){return"TSBigIntKeyword"===e.type||"TSLiteralType"===e.type&&tm(e.literal)||"TSTypeAnnotation"===e.type&&yW(e.typeAnnotation)||"TSUnionType"===e.type&&e.types.some(e=>yW(e))||"TSIntersectionType"===e.type&&e.types.some(e=>yW(e))}function yV(e){return["TSAsExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?yV(e.expression):e}function y_(e){let t;return tm(e)||tb(e,{name:"BigInt",argumentsLength:1,optional:!1},ty)||"UnaryExpression"===e.type&&"-"===e.operator&&y_(e.argument)||(t=function e(t){return"TSNonNullExpression"===t.type?e(t.expression):"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?t.typeAnnotation:void 0}(e))&&yW(t)}function yz(e,t){return y_(e)||function(e,t){let r=yV(e);if("Identifier"!==r.type)return!1;let n=eS(t.sourceCode.getScope(r),r);return n?.defs.some(e=>"Parameter"===e.type?e.name.typeAnnotation&&yW(e.name.typeAnnotation)||"AssignmentPattern"===e.name.parent.type&&y_(e.name.parent.right):"Variable"===e.type&&(e.node.id.typeAnnotation&&yW(e.node.id.typeAnnotation)||e.node.init&&y_(e.node.init)))??!1}(e,t)}function yK(e,t){return"UnaryExpression"===e.type&&"-"===e.operator?rk(e.argument,t):"BinaryExpression"===e.type&&"-"===e.operator&&ti(e.left,0)?rk(e.right,t):"BinaryExpression"===e.type&&"*"===e.operator&&(rk(e.left,t)&&tP(e.right)||tP(e.left)&&rk(e.right,t))}function yG(e,t){if(!("BinaryExpression"!==e.type||!yO.has(e.operator)||yz(e.left,t)||yz(e.right,t)))return">"===e.operator||">="===e.operator?{value:e.left,threshold:e.right,operator:e.operator}:{value:e.right,threshold:e.left,operator:yq[e.operator]}}function yJ(e,t){if(!("BinaryExpression"!==e.type||!yO.has(e.operator)||yz(e.left,t)||yz(e.right,t)))return"<"===e.operator||"<="===e.operator?{value:e.left,negativeThreshold:e.right,operator:e.operator}:{value:e.right,negativeThreshold:e.left,operator:yq[e.operator]}}function yX(e,t){let r=to(e,t);return"SequenceExpression"===e.type?`(${r})`:r}function yY(e,t,r){let n={node:e,messageId:yM};return r&&!(t.sourceCode.getCommentsInside(e).length>0)&&(n.fix=r),n}function yH(e){return["Identifier","Literal","ThisExpression"].includes((e=yV(e)).type)}let yQ="prefer-split-limit",yZ=(e,t)=>{let r=eV(e,t.getScope(e));if(r&&Number.isSafeInteger(r.value)&&!(r.value<0)&&!(r.value>=0xfffffffe))return r.value},y0=e=>{let t,r=e?.type==="ChainExpression"?e.expression:e;if(tR(r,{method:"split",argumentsLength:1})&&(ts(t=r.arguments[0])&&""!==t.value||tc(t)))return r},y1=(e,t,r,n)=>({node:e,messageId:yQ,fix:e=>iO(e,t,String(r),n)}),y2=(e,t,r)=>{let{elements:n}=e,o=y0(t);if(0!==n.length&&n.at(-1)?.type!=="RestElement"&&o)return y1(e,o,n.length,r)},y3="prefer-queue-microtask",y8={create:e=>{let{checkSetImmediate:t,checkSetTimeout:r}=e.options[0];e.on("MemberExpression",t=>{if(tF(t,{object:"process",property:"nextTick",computed:!1,optional:!1})&&oA(t.object,e)&&("CallExpression"!==t.parent.type||t.parent.callee!==t||!t.parent.optional))return{node:t.property,messageId:y3,data:{name:"process.nextTick()"},fix:((e,t)=>{let{parent:r}=e;if("CallExpression"===r.type&&r.callee===e&&1===r.arguments.length&&"SpreadElement"!==r.arguments[0].type&&!(t.sourceCode.getCommentsInside(e).length>0))return t=>t.replaceText(e,"queueMicrotask")})(t,e)}}),e.on("CallExpression",n=>{let o;return t&&"Identifier"===n.callee.type&&"setImmediate"===n.callee.name&&!n.optional&&n.arguments.length>0&&"SpreadElement"!==n.arguments[0].type&&!oE(n.arguments[0])&&aB(n)&&oA(n.callee,e)?{node:n.callee,messageId:y3,data:{name:"setImmediate()"},fix:(e=>{if(1===e.arguments.length)return t=>t.replaceText(e.callee,"queueMicrotask")})(n)}:r&&"Identifier"===n.callee.type&&"setTimeout"===n.callee.name&&!n.optional&&n.arguments.length>=2&&"Literal"===(o=n.arguments[1]).type&&0===o.value&&"SpreadElement"!==n.arguments[0].type&&!oE(n.arguments[0])&&aB(n)&&oA(n.callee,e)?{node:n.callee,messageId:y3,data:{name:"setTimeout()"},fix:((e,t)=>{if(2!==e.arguments.length)return;let r=((e,t)=>{let{sourceCode:r}=t,[,n]=e.arguments,o=r.getTokenBefore(n),a=r.getTokenAfter(n),i=a?.value===","?r.getTokenAfter(a):a,s=[r.getRange(o)[0],a?.value===","?r.getRange(a)[1]:r.getRange(n)[1]];if(!rV(t,[s[0],r.getRange(i)[0]]))return s})(e,t);if(r)return function*(t){yield t.replaceText(e.callee,"queueMicrotask"),yield t.removeRange(r)}})(n,e)}:void 0})},meta:{type:"suggestion",docs:{description:"Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{checkSetImmediate:{type:"boolean",description:"Whether to also check `setImmediate()`."},checkSetTimeout:{type:"boolean",description:"Whether to also check `setTimeout(…, 0)`."}}}],defaultOptions:[{checkSetImmediate:!1,checkSetTimeout:!1}],messages:{[y3]:"Prefer `queueMicrotask()` over `{{name}}`."},languages:["js/js"]}},y6="prefer-string-pad-start-end",y9="suggest-padding-method",y5=new i(["ArrayExpression","ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","ObjectExpression"]),y4=(e,t)=>{let r;return y5.has(e.type)||(r=eV(e,t.sourceCode.getScope(e)))&&"string"!=typeof r.value||y5.has(((e,t)=>{if("Identifier"!==e.type)return;let r=eS(t.sourceCode.getScope(e),e),n=r?.defs[0];return n?.type==="FunctionName"||n?.type==="ClassName"?n.node:n?.type==="Variable"&&n.node.id===n.name?n.node.init:void 0})(e,t)?.type)||of(e,t)},y7=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,he=e=>"Literal"===e.type&&"string"==typeof e.value||"TemplateLiteral"===e.type&&0===e.expressions.length,ht=({targetNode:e,targetLengthNode:t,paddingNode:r})=>"Identifier"===e.type&&tp(t)&&he(r),hr=(e,t)=>{if(!tR(e,{method:"repeat",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=e.callee.object,n=((e,t)=>{let r=eV(e,t.sourceCode.getScope(e));if("string"==typeof r?.value)return r.value})(r,t);if(n?.length===1)return{paddingNode:r,paddingString:n,widthNode:e.arguments[0]}},hn=(e,t)=>{let r=hr(e,t);if(!r)return;let{widthNode:n}=r;if("BinaryExpression"===n.type&&"-"===n.operator&&tF(n.right,{property:"length",computed:!1}))return{...r,targetLengthNode:n.left,targetNode:n.right.object}},ho=({method:e,targetNode:t,targetLengthNode:r,paddingNode:n,paddingString:o},a)=>{let i=to(t,a),s=to(r,a),l=(({paddingNode:e,paddingString:t},r)=>" "===t?"":`, ${to(e,r)}`)({paddingNode:n,paddingString:o},a);return`${i}.${e}(${s}${l})`},ha=({node:e,method:t,replacement:r,context:n,canFix:o})=>{let a={node:e,messageId:y6,data:{method:t}};return o&&!y7(e,n)&&(a.fix=function(t){let o=aL(n.sourceCode.getTokenBefore(e),n,r)?";":"";return t.replaceText(e,`${o}${r}`)}),a},hi=({node:e,method:t,replacement:r,context:n,canSuggest:o})=>{let a={node:e,messageId:y6,data:{method:t}};return o&&!y7(e,n)&&(a.suggest=[{messageId:y9,data:{method:t},fix:t=>t.replaceText(e,r)}]),a},hs="require-css-escape",hl=["closest","matches","querySelector","querySelectorAll"],hu=e=>e.value.cooked,hp=(e,t)=>{let r,n="";for(let r of e.quasis.slice(0,t+1)){let e=hu(r);if(void 0===e)return!1;n+=e}if(!((r=n).lastIndexOf("[")>r.lastIndexOf("]")))return!1;for(let r of e.quasis.slice(t+1)){let e=hu(r);if(void 0===e)break;if(e.includes("]"))return!0}return!1},hc=e=>tR(e,{object:"CSS",method:"escape",argumentsLength:1,optionalCall:!1,optionalMember:!1}),hd=e=>t=>"SequenceExpression"===e.type?[t.insertTextBefore(e,"CSS.escape(("),t.insertTextAfter(e,"))")]:[t.insertTextBefore(e,"CSS.escape("),t.insertTextAfter(e,")")],hm={create:e=>{let{checkAllSelectors:t}=e.options[0];e.on("CallExpression",function*(e){if(!tR(e,{methods:hl,minimumArguments:1})||oh(e.callee.object))return;let[r]=e.arguments;if("TemplateLiteral"===r.type&&0!==r.expressions.length)for(let[e,n]of r.expressions.entries())!hc(n)&&(t||hp(r,e))&&(yield{node:n,messageId:hs,fix:hd(n)})})},meta:{type:"suggestion",docs:{description:"Require `CSS.escape()` for interpolated values in CSS selectors.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{checkAllSelectors:{type:"boolean",description:"Check all selector interpolations instead of only attribute selector interpolations."}}}],defaultOptions:[{checkAllSelectors:!1}],messages:{[hs]:"Use `CSS.escape()` for interpolated values in CSS selectors."},languages:["js/js"]}},hf="require-passive-events",hg=new i(["touchstart","touchmove","touchenter","touchend","touchleave","wheel","mousewheel"]),hy=e=>e.computed||"Identifier"!==e.property.type?ts(e.property)?e.property.value:void 0:e.property.name,hh=e=>{var t,r;return"MemberExpression"===e.parent.type&&e.parent.object===e&&"MemberExpression"===(t=e.parent).type&&"preventDefault"===hy(t)&&("CallExpression"===(r=t).parent.type&&r.parent.callee===r?r.parent:"ChainExpression"===r.parent.type&&"CallExpression"===r.parent.parent.type&&r.parent.parent.callee===r.parent?r.parent.parent:void 0)},hx=e=>{if("MemberExpression"!==e.parent.type||e.parent.object!==e)return!1;let t=hy(e.parent);return t&&"preventDefault"!==t&&!nG((e=>{for(;"MemberExpression"===e.parent.type&&e.parent.object===e;)e=e.parent;return e})(e.parent))},hb="this",hE="class",hv="class-unavailable",hS="super",hC="super-class",hD="super-class-unavailable",hT="suggestion",hA=new i(["PropertyDefinition","AccessorProperty","StaticBlock","ClassBody"]),hw=new i(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]),hk=e=>"MethodDefinition"===e.parent.type&&e.parent.value===e,hI=e=>"FunctionDeclaration"===e.type||"FunctionExpression"===e.type,hj=e=>{let t=e;for(let{parent:r}=e;r;t=r,r=r.parent)if("ArrowFunctionExpression"!==r.type){if(hI(r)&&!hk(r))return;if("MethodDefinition"===r.type)return r.static&&r.value===t?r:void 0;if(hA.has(r.type))return}},hF=e=>{if(e.id)return e.id;let{parent:t}=e;if("ClassExpression"===e.type&&"VariableDeclarator"===t.type&&t.init===e&&"Identifier"===t.id.type)return t.id},hB=(e,t,r)=>eS(e.getScope(t),t)===eS(e.getScope(r),r),hR=(e,t,r)=>eS(e.getScope(t),r.name)===eS(e.getScope(r),r),hP=(e,t)=>"AssignmentExpression"===e.type&&e.left===t||"UpdateExpression"===e.type&&e.argument===t||"UnaryExpression"===e.type&&"delete"===e.operator&&e.argument===t||("ForInStatement"===e.type||"ForOfStatement"===e.type)&&e.left===t,hL=e=>{let t;return(t=e.parent,hw.has(t.type)&&t.expression===e)?e.parent:void 0},hN=e=>{let{parent:t}=e;if("MemberExpression"===t.type&&t.object===e||"ChainExpression"===t.type&&t.expression===e)return t;let r=hL(e);return r||("Property"===t.type&&t.value===e&&"ObjectPattern"===t.parent.type?t.parent:"ObjectPattern"===t.type&&t.properties.includes(e)||"ArrayPattern"===t.type&&t.elements.includes(e)||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e?t:void 0)},h$=e=>{let t=e;for(;t.parent;){if(hP(t.parent,t))return!0;let e=hN(t);if(!e)break;t=e}return!1},hM=e=>"MemberExpression"===e.parent.type&&e.parent.object===e,hO=e=>{let t=e;for(;t.parent;){let e=hL(t);if(!e)break;t=e}return t},hq=e=>{let t=hO(e);return"CallExpression"===t.parent.type&&t.parent.callee===t||"NewExpression"===t.parent.type&&t.parent.callee===t||"TaggedTemplateExpression"===t.parent.type&&t.parent.tag===t},hU=e=>{let t=hO(e);return hM(t)&&"PrivateIdentifier"===t.parent.property.type},hW=e=>{let t=hO(e);return"BinaryExpression"===t.parent.type&&"in"===t.parent.operator&&"PrivateIdentifier"===t.parent.left.type&&t.parent.right===t},hV=e=>e.superClass?.type==="Identifier"?e.superClass:void 0,h_=({node:e,messageId:t,source:r,replacement:n,name:o})=>({node:e,messageId:t,data:{name:o},suggest:[{messageId:hT,data:{source:r,replacement:n},fix:t=>t.replaceText("ChainExpression"===e.parent.type?e.parent:e,n)}]}),hz=(e,t,r)=>({node:e,messageId:t,data:{name:r}}),hK={create:e=>{let{sourceCode:t}=e,{preferThis:r,preferSuper:n}=e.options[0];e.on("ThisExpression",e=>{if(r||h$(e)||hq(e)||hU(e)||hW(e))return;let n=hj(e);if(!n)return;let o=hF(n.parent.parent);return o&&hR(t,e,o)?h_({node:e,messageId:hE,source:"this",replacement:o.name,name:o.name}):hz(e,hv)}),e.on("Super",e=>{if(n||h$(e))return;let r=hj(e);if(!r)return;let o=hV(r.parent.parent);return o&&hR(t,e,o)?h_({node:e,messageId:hC,source:"super",replacement:o.name,name:o.name}):hz(e,hD)}),e.on("Identifier",o=>{if(!tL(o)||(e=>{let t=e;for(;"TSQualifiedName"===t.parent.type;)t=t.parent;return"TSTypeReference"===t.parent.type&&t.parent.typeName===t||"TSTypeQuery"===t.parent.type&&t.parent.exprName===t})(o)||h$(o)||hq(o)||hU(o)||hW(o))return;let a=hj(o);if(!a)return;let i=a.parent.parent;if(r){let e=hF(i);if(e&&o.name===e.name&&hB(t,o,e))return h_({node:o,messageId:hb,source:o.name,replacement:"this",name:o.name})}if(!n||!(hM(o)&&!o.parent.optional&&!h$(o.parent))||ta(o,e))return;let s=hV(i);if(s&&o.name===s.name&&hB(t,o,s))return h_({node:o,messageId:hS,source:o.name,replacement:"super",name:o.name})})},meta:{type:"suggestion",docs:{description:"Enforce consistent class references in static methods.",recommended:!0},hasSuggestions:!0,schema:[{type:"object",properties:{preferThis:{type:"boolean",description:"Prefer `this` over the current class name in static methods."},preferSuper:{type:"boolean",description:"Prefer `super` over the superclass name in static methods."}},additionalProperties:!1}],defaultOptions:[{preferThis:!0,preferSuper:!0}],messages:{[hb]:"Use `this` instead of `{{name}}` in static methods.",[hE]:"Use `{{name}}` instead of `this` in static methods.",[hv]:"Use the class name instead of `this` in static methods.",[hS]:"Use `super` instead of `{{name}}` in static methods.",[hC]:"Use `{{name}}` instead of `super` in static methods.",[hD]:"Use the superclass name instead of `super` in static methods.",[hT]:"Replace `{{source}}` with `{{replacement}}`."},languages:["js/js"]}},hG="consistent-optional-chaining/remove-optional",hJ="consistent-optional-chaining/use-optional",hX="consistent-optional-chaining/suggest-remove-optional",hY="consistent-optional-chaining/suggest-use-optional",hH=new i(["Identifier","ThisExpression","Super"]);function hQ(e){let t;for(;e!==t;)t=e,"ChainExpression"===(e=rN(e)).type&&(e=e.expression);return e}function hZ(e){return"MemberExpression"===(e=hQ(e)).type?e:void 0}function h0(e){return e=hQ(e),!!hH.has(e.type)||"MemberExpression"===e.type&&h0(e.object)}function h1(e,t){let r=rX(e,t);return!rV(t,r)}function h2({memberExpression:e,context:t,fixer:r,replacement:n}){let o=rX(e,t);return r.replaceTextRange(o,n)}function h3(e,t,r){return h2({memberExpression:e,context:t,fixer:r,replacement:e.computed?"[":"."})}let h8="always",h6="never",h9="missing-delay",h5="redundant-delay",h4=new i(["setTimeout","setInterval"]),h7=new i(["window","globalThis","global","self"]),xe=e=>ti(e,0)||"UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)&&xe(e.argument),xt="negative-index",xr="length-index",xn="no-duplicate-loops",xo=["filter","map"],xa="no-declarations-before-early-exit",xi=e=>"VariableDeclaration"===e.type&&("let"===e.kind||"const"===e.kind),xs=e=>!e||"Literal"===e.type||"TemplateLiteral"===e.type&&0===e.expressions.length,xl=(e,t,r)=>{let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return n&&eF(n)},xu=(e,t)=>{let[r,n]=e.getRange(t);return new i(rh(e.getScope(t)).filter(({identifier:t})=>{let[o,a]=e.getRange(t);return o>=r&&a<=n}).map(({identifier:e})=>e.name))};function*xp(e,t,r){let n;for(let[o,a]of t.entries())if(xi(a)&&!a.declare){n??=t.map(e=>{var t,n;return(t=e,n=r,"IfStatement"!==t.type||n(t.consequent)===(!!t.alternate&&n(t.alternate)))?void 0:e});for(let r=o+1;r<t.length;r++){let t=n[r];if(t){for(let n of a.declarations){let i=function({sourceCode:e,declaration:t,declarator:r,guardStatement:n,declarationIndex:o,guardIndex:a}){var i;let s;if("Identifier"!==r.id.type||(e=>{if(e?.type!=="CallExpression")return!1;let{callee:t}=e;return"Identifier"===t.type?oD(t.name):"MemberExpression"===t.type&&!t.computed&&"Identifier"===t.object.type&&/^[A-Z]/.test(t.object.name)&&"Identifier"===t.property.type&&oD(t.property.name)})(r.init)||r.init&&tY(r.init,e.visitorKeys)||a>o+1&&!xs(r.init)||r.init&&(i=r.init,s=xu(e,n),[...xu(e,i)].some(e=>s.has(e)))&&(eH(r.init,e)||eH(n.test,e)))return;let[l]=e.getDeclaredVariables(r),u=l.references.filter(e=>!e.init&&!function(e){let t=e;for(;"TSQualifiedName"===t.parent.type;)t=t.parent;return"TSTypeQuery"===t.parent.type}(e.identifier));if(0===u.length)return;let[,p]=e.getRange(n);if(u.some(t=>e.getRange(t.identifier)[0]<p))return;let c={node:r.id,messageId:xa};return(({sourceCode:e,declaration:t,guardStatement:r,declarationIndex:n,guardIndex:o})=>o===n+1&&1===t.declarations.length&&xs(t.declarations[0].init)&&0===e.getCommentsInside(t).length&&!xl(e,t,"before")&&!xl(e,r,"after")&&!e.getTokensBetween(t,r,{includeComments:!0}).some(e=>eF(e)))({sourceCode:e,declaration:t,guardStatement:n,declarationIndex:o,guardIndex:a})&&(c.fix=function(e,t,r){let n=e.getText(t),o=e.getText(r),[a,i]=e.getRange(t),[s,l]=e.getRange(r),u=e.text.slice(i,s);return e=>e.replaceTextRange([a,l],`${o}${u}${n}`)}(e,t,n)),c}({sourceCode:e,declaration:a,declarator:n,guardStatement:t,declarationIndex:o,guardIndex:r});i&&(yield i)}break}}}}let xc="no-optional-chaining-on-undeclared-variable",xd=e=>"Type"===e.type||"ImportBinding"===e.type&&aN(e.node);function xm(e){let t;for(;e!==t;)t=e,("ChainExpression"===(e=rN(e)).type||"TSInstantiationExpression"===e.type)&&(e=e.expression);return e}let xf="no-object-methods-with-collections/error",xg="no-object-methods-with-collections/suggestion",xy=new i(["entries","keys","values"]),xh="no-subtraction-comparison/error",xx="no-subtraction-comparison/suggestion",xb={">":"<",">=":"<=","<":">","<=":">=","===":"===","!==":"!==","==":"==","!=":"!="},xE=new i(Object.keys(xb)),xv=new i([">","<"]),xS=e=>"BinaryExpression"===e.type&&"-"===e.operator,xC=(e,t)=>{let r=eV(e,t)?.value;return"number"==typeof r&&Number.isFinite(r)},xD="no-unnecessary-global-this",xT=new i(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]);function xA(e){for(;xT.has(e.type);)e=e.expression;return e}let xw=e=>{for(;xT.has(e.parent.type)&&e.parent.expression===e;)e=e.parent;return e},xk=t1();function xI(e){return"CallExpression"===(e=xw(e)).parent.type&&e.parent.callee===e}let xj=new i(["==","!=","===","!=="]),xF="computed-key",xB="nested-array",xR="deep-object",xP="property-assignment";function xL(e){let{parent:t}=e;if(t){if(rL(t)&&t.expression===e||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e)return xL(t);if("Property"===t.type&&t.value===e&&"ObjectPattern"===t.parent.type)return t.parent;if("ObjectPattern"===t.type||"ArrayPattern"===t.type)return t}}function xN(e){let t=0;for(;e;)"ObjectPattern"===e.type&&t++,e=xL(e);return t}let x$="no-useless-else",xM=new i(["Program","BlockStatement","StaticBlock","SwitchCase"]),xO=new i(["[","(","<","/","`","+","-"]),xq=(e,t)=>{let r=e.text.lastIndexOf("\n",t-1)+1;return/^[\t ]*/.exec(e.text.slice(r,t))[0]},xU=e=>xO.has(e.value[0]),xW="no-useless-recursion",xV=new i(["using","await using"]),x_=e=>e?.type==="VariableDeclaration"&&xV.has(e.kind),xz=e=>"ForStatement"===e.type?x_(e.init):"ForOfStatement"===e.type&&x_(e.left),xK="prefer-add-event-listener-options",xG="prefer-direct-iteration",xJ="Array",xX="FormData",xY="URLSearchParams",xH=new i([xJ,"Map","Set",xX,xY,...r9]),xQ=new o([["ReadonlyArray",xJ],["ReadonlyMap","Map"],["ReadonlySet","Set"]]),xZ=new o([[xJ,["values"]],["Map",["entries"]],["Set",["values","keys"]],[xX,["entries"]],[xY,["entries"]],...r9.map(e=>[e,["values"]])]),x0=["Map","WeakMap","Set","WeakSet"],x1=["all","allSettled","any","race"],x2=new i(["ArrayExpression","CallExpression","NewExpression"]),x3=e=>new i([e]),x8=(e,t)=>tR(e,{objects:r9,methods:t,optionalCall:!1,optionalMember:!1}),x6=e=>xH.has(e)?e:xQ.get(e),x9=e=>{let t=new i;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},x5=(e,t,r)=>{if("any"===e.intrinsicName||"unknown"===e.intrinsicName)return;if(e.isUnion())return x9(e.types.map(e=>x5(e,t,r)));if(t.isArrayType(e)||t.isTupleType(e))return x3(xJ);let n=r7(e);if(!ne(n,r))return;let o=n.getName(),a=o&&x6(o);return a&&x3(a)},x4=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return x4(e.typeAnnotation);case"TSArrayType":case"TSTupleType":return x3(xJ);case"TSTypeOperator":return"readonly"===e.operator?x4(e.typeAnnotation):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type)return;let t=x6(e.typeName.name);return t&&x3(t)}case"TSUnionType":return x9(e.types.map(e=>x4(e)))}},x7=(e,t,r=new i)=>((e,t,r)=>{if("ArrayExpression"===e.type||tE(e,{name:"Array"}))return x3(xJ);if(tE(e,{names:r9})||tE(e,{names:["Map","Set",xX,xY]}))return x3(e.callee.name);if(tb(e,{name:"Array"},ty)||tR(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}))return x3(xJ);if(x8(e,["from","of"]))return x3(e.callee.object.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n=eS(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return;r.add(n);let[o]=n.defs,a=x4(o.name?.typeAnnotation);return a||("Variable"===o.type&&"const"===o.parent.kind&&o.node.init?x7(o.node.init,t,r):void 0)})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return x4(e.typeAnnotation)??x7(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return x7(e.expression,t,r)}})(e,t,r)??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return x5(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e,t),be="prefer-number-is-safe-integer/error",bt="prefer-number-is-safe-integer/suggestion",br="prefer-number-is-safe-integer/integer-check-error",bn="prefer-number-is-safe-integer/integer-check-suggestion",bo=["_","lodash","underscore"],ba=["floor","trunc"],bi=(e,t)=>{let r=eS(t.getScope(e),"Number");return!r||"global"===r.scope.type&&0===r.defs.length},bs=e=>{if("BinaryExpression"===e.type&&"%"===e.operator&&ti(e.right,1))return e.left},bl=(e,t)=>{if(tR(e,{object:"Math",methods:ba,argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return e.arguments[0]},bu="prefer-object-define-properties";function bp(e){if(e?.type!=="ExpressionStatement")return;let{expression:t}=e;if(tR(t,{object:"Object",method:"defineProperty",argumentsLength:3,optionalCall:!1,optionalMember:!1,computed:!1}))return t}let bc="prefer-object-destructuring-defaults",bd="prefer-object-destructuring-defaults/suggestion",bm=new i(Object.getOwnPropertyNames(Object.prototype)),bf={considerGetters:!0,considerImplicitTypeConversion:!0},bg=e=>"Property"===e.type&&"init"===e.kind&&!e.computed&&!e.method,by=(e,t,r)=>rh(r.sourceCode.getScope(e)).some(n=>t.has(n.identifier.name)&&((e,t,r)=>{let[n,o]=r.getRange(e),[a,i]=r.getRange(t);return n>=a&&o<=i})(n.identifier,e,r.sourceCode)),bh=(e,t,r)=>{let{sourceCode:n}=r,o=n.getText(e.node.value),a=to(t.value,r);return e.node.shorthand?`${o} = ${a}`:`${n.getText(e.node.key)}: ${o} = ${a}`},bx="prefer-single-object-destructuring",bb=(e,t)=>{let r,n;if(!("VariableDeclaration"===t.type&&("const"===(r=t.kind)||"let"===r)&&!t.declare&&1===t.declarations.length))return;let[o]=t.declarations;if("ObjectPattern"===o.id.type&&!o.id.typeAnnotation&&(n=o.id).properties.length>0&&n.properties.every(e=>"Property"===e.type&&!e.computed&&"Identifier"===e.value.type)&&o.init?.type==="Identifier"&&((e,t)=>{let r=eS(e.getScope(t),t);if(!r||1!==r.defs.length)return!1;let[n]=r.defs;return"Variable"===n.type&&"VariableDeclarator"===n.node.type&&"VariableDeclaration"===n.parent.type&&!n.parent.declare&&"const"===n.parent.kind})(e,o.init))return{node:t,declarator:o,source:o.init.name}},bE=(e,t,r)=>{let n,o,a=bb(e,t),i=bb(e,r);if(!(a&&i&&a.node.kind===i.node.kind&&a.source===i.source&&0===e.getCommentsInside(a.node).length&&0===e.getCommentsInside(i.node).length)||(n=a.node,o=i.node,e.getTokensBetween(n,o,{includeComments:!0}).some(e=>eF(e))))return;let s=t=>t.properties.map(t=>e.getText(t)).join(", "),l=`${a.node.kind} {${s(a.declarator.id)}, ${s(i.declarator.id)}} = ${a.source};`;return{node:i.node,messageId:bx,data:{source:a.source},fix:t=>t.replaceTextRange([e.getRange(a.node)[0],e.getRange(i.node)[1]],l)}};function*bv(e,t){for(let[r,n]of t.entries()){if(0===r)continue;let o=bE(e,t[r-1],n);o&&(yield o)}}let bS="prefer-smaller-scope",bC=new i(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","StaticBlock","WithStatement"]);function bD(e,t){let r=e.parent;for(;r&&r!==t;){if(bC.has(r.type))return!1;r=r.parent}return r===t}function bT(e,t,r){let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return!!(n&&eF(n))}function bA(e,t){let r=e.getTokenBefore(t),n=e.getTokenAfter(t);return r?.value==="("&&n?.value===")"}let bw="prefer-single-array-predicate/error",bk="prefer-single-array-predicate/suggestion",bI=new o([["||","some"],["&&","every"]]),bj=new i(["AssignmentExpression","ArrowFunctionExpression","ConditionalExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),bF="prefer-url-href",bB="non-url",bR="unknown",bP=new i(["ClassName","ImportBinding","Type"]),bL=new i(["any","error","unknown"]),bN=new i(["node:url","url"]),b$=e=>bP.has(e.type),bM=(e,t,r,n)=>{for(;t;){let o=t.set.get(e);if(o?.defs.some(e=>a$(e,r,n)))return o;t=t.upper}},bO=e=>e.every(e=>"url"===e)?"url":!e.includes(bR)&&e.includes(bB)?bB:bR,bq=e=>{let t;if("ImportBinding"!==e.type)return!1;let{node:r,parent:n}=e;return t=n.source,bN.has(t.value)&&"ImportSpecifier"===r.type&&"Identifier"===r.imported.type&&"URL"===r.imported.name},bU=e=>"ImportBinding"===e.type&&("type"===e.parent.importKind||aN(e.node)),bW=e=>"Type"===e.type||bU(e),bV=e=>bq(e)&&!bU(e),b_=(e,t)=>{let r;return"NewExpression"===e.type&&(((e,t)=>{if("Identifier"!==e.type||"URL"!==e.name||((e,t,r)=>{for(;e;){let n=e.set.get("URL");if(n?.defs.some(e=>!bW(e)&&a$(e,t,r)))return!0;e=e.upper}return!1})(t.sourceCode.getScope(e),e,t))return!1;if(oA(e,t))return!0;let r=eS(t.sourceCode.getScope(e),e);return r?.defs.length>0&&r.defs.every(e=>bW(e))})(r=e.callee,t)||((e,t)=>{if("Identifier"!==e.type)return!1;let r=eS(t.sourceCode.getScope(e),e);return r?.defs.some(e=>bV(e))??!1})(r,t))},bz=(e,t)=>t.sourceCode.getScope(e.name??e.node),bK=(e,t,r,n=new i)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return bK(e.typeAnnotation,t,r,n);case"TSTypeReference":return((e,t,r,n)=>{if("Identifier"!==e.typeName.type)return bR;let o=e.typeName.name,a=bM(o,r,e.typeName,t),[i]=a?.defs??[];if(!i)return"URL"!==o||((e,t)=>{for(;t;){let r=t.set.get(e);if(r?.defs.some(e=>b$(e)))return!0;t=t.upper}return!1})(o,r)?bR:"url";if(n.has(o))return bR;if(bq(i))return"url";n.add(o);let s=bR;return"Type"===i.type&&"TSTypeAliasDeclaration"===i.node.type?s=bK(i.node.typeAnnotation,t,bz(i,t),n):"Type"===i.type&&"TSTypeParameter"===i.node.type?s=bR:"ClassName"===i.type&&(s=bB),n.delete(o),s})(e,t,r,n);case"TSUnionType":return bO(e.types.map(e=>bK(e,t,r,n)));case"TSIntersectionType":return bO(e.types.map(e=>bK(e,t,r,n)));case"TSImportType":let o;return(o=e.source,bN.has(o.value)&&e.qualifier?.type==="Identifier"&&"URL"===e.qualifier.name)?"url":bB;default:return e?bB:bR}},bG=(e,t)=>{let{checker:r,context:n,node:o,program:a}=t;if(bL.has(e.intrinsicName)||e.isTypeParameter?.())return bR;let i=r.getBaseConstraintOfType(e);if(i&&i!==e)return bG(i,t);if(e.isUnion()||e.isIntersection())return bO(e.types.map(e=>bG(e,t)));let s=((e,t,r)=>{if(!/^[\w$]+$/.test(e))return bR;let n=bM(e,r.sourceCode.getScope(t),t,r),o=n?.defs.filter(e=>"Type"===e.type||"ClassName"===e.type||bq(e))??[];return 0===o.length?bR:o.every(e=>bq(e))?"url":bB})(r.typeToString(e),o,n);if(s!==bR)return s;let l=r7(e);return ne(l,a)&&"URL"===l.getName()?"url":bB},bJ=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return bR;try{let{program:n}=r;return bG(r.getTypeAtLocation(e),{checker:n.getTypeChecker(),context:t,node:e,program:n})}catch{return bR}};function bX(e,t,r=new i){if(!e)return bR;let n=t.sourceCode.getScope(e);switch(e.type){case"Identifier":{let n=((e,t,r)=>{let n=eS(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return bR;let[o]=n.defs;if(!a$(o,e,t))return bR;r.add(n);let a="Variable"===o.type&&"const"===o.parent.kind&&o.node.init?bX(o.node.init,t,r):bR,i=bK(o.name?.typeAnnotation,t,bz(o,t)),s=bR;return a!==bR?s=a:i!==bR&&(s=i),r.delete(n),s})(e,t,r);if(n!==bR)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let o=bK(e.typeAnnotation,t,n);return o===bR?bX(e.expression,t,r):o}case"TSNonNullExpression":case"ParenthesizedExpression":return bX(e.expression,t,r);case"SequenceExpression":return bX(e.expressions.at(-1),t,r);case"ConditionalExpression":return bO([bX(e.consequent,t,r),bX(e.alternate,t,r)])}if(b_(e,t))return"url";if("NewExpression"===e.type){if(((e,t)=>{if("Identifier"!==e.type)return!1;let r=eS(t.sourceCode.getScope(e),e);return r?.defs.some(e=>!bW(e)&&!bV(e))??!1})(e.callee,t))return bB;let r=bJ(e,t);return r===bR?bB:r}let o=((e,t)=>{if("CallExpression"!==e.type||"Identifier"!==e.callee.type)return bR;let r=eS(t.sourceCode.getScope(e.callee),e.callee);if(r?.defs.length!==1)return bR;let[n]=r.defs;return bK(n.node.returnType,t,bz(n,t))})(e,t);return o!==bR?o:bJ(e,t)}let bY=(e,t)=>{switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"ParenthesizedExpression":case"TSNonNullExpression":return bY(e.expression,t);case"SequenceExpression":return bY(e.expressions.at(-1),t);case"ConditionalExpression":return bY(e.consequent,t)&&bY(e.alternate,t);case"NewExpression":return b_(e,t);default:return!1}},bH=(e,t)=>0===t.sourceCode.getCommentsInside(e).length,bQ="require-proxy-trap-boolean-return",bZ=new i(["defineProperty","deleteProperty","has","isExtensible","preventExtensions","set","setPrototypeOf"]),b0=new i(["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"]),b1=e=>"ReturnStatement"===e.type||"ThrowStatement"===e.type,b2=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression","TemplateLiteral","UpdateExpression"]),b3=new i(["%","&","*","**","+","-","/","<<",">>",">>>","^","|"]),b8=(e,t)=>({node:e,messageId:bQ,data:{name:t}}),b6=e=>{if(e)return b8(e.node,e.data.name)},b9=(e,t,r)=>{if("AssignmentExpression"===e.type)return"="===e.operator?b6(b9(e.right,t,r)):b8(e,t);if("ConditionalExpression"===e.type)return b9(e.consequent,t,r)??b9(e.alternate,t,r);if("LogicalExpression"===e.type)return b6(b9(e.left,t,r)??b9(e.right,t,r));if("SequenceExpression"===e.type)return b6(b9(e.expressions.at(-1),t,r));let n=((e,t)=>{let r=eV(e,t.getScope(e));if(null!==r&&"boolean"!=typeof r.value)return!!r.value})(e,r);if(void 0===n&&!(b2.has(e.type)||"UnaryExpression"===e.type&&"!"!==e.operator&&"delete"!==e.operator||"BinaryExpression"===e.type&&b3.has(e.operator)))return;let o=((e,t,r)=>{if(!(r.getCommentsInside(e).length>0)&&("Literal"===e.type&&!e.regex||"TemplateLiteral"===e.type&&0===e.expressions.length||"Identifier"===e.type&&"undefined"===e.name))return String(t)})(e,n,r);return{...b8(e,t),...o&&{fix:t=>t.replaceText(e,o)}}},b5=(e,t)=>{if("Property"!==e.type||"init"!==e.kind)return;let r=ez(e,t.getScope(e));if(bZ.has(r)&&b0.has(e.value.type))return{name:r,functionNode:e.value}},b4=({functionNode:e,name:t},r,n)=>{if(e.async||e.generator)return b8(e,t);if("BlockStatement"!==e.body.type)return b9(e.body,t,r);let o=[...function* e(t){if(t&&"string"==typeof t.type){if("ReturnStatement"===t.type)return void(yield t);if(!("BlockStatement"!==t.type&&b0.has(t.type))){for(let[r,n]of Object.entries(t))if("parent"!==r){if(Array.isArray(n)){for(let t of n)yield*e(t);continue}yield*e(n)}}}}(e.body)],a=n.get(e)??!1;if(0===o.length){if(a)return;return b8(e,t)}for(let e of o){if(!e.argument)return b8(e,t);let n=b9(e.argument,t,r);if(n)return n}if(!a)return b8(e,t)},b7=D.builtinRules.get("logical-assignment-operators"),Ee="ifNullish",Et="convertIf",Er={...b7.meta.messages,[Ee]:"'if' statement can be replaced with a logical operator assignment with operator ||= or ??=."},En=e=>e.fix??e.suggest?.[0]?.fix,Eo={create:e=>{let{sourceCode:t}=e,r=Object.create(e,{report:{value(r){e.report(function(e,t){let r;if("if"!==e.messageId||e.data?.operator!=="||="||"function"!=typeof En(e))return e;let n={...(r={...e},delete r.fix,delete r.suggest,r),messageId:Ee};if(t.getCommentsInside(e.node).length>0)return n;let o=En(e);return{...n,suggest:[{messageId:Et,data:{operator:"||="},fix:o},{messageId:Et,data:{operator:"??="},fix:e=>o(new Proxy(e,{get(e,t){if("insertTextBefore"!==t){let r=Reflect.get(e,t,e);return"function"==typeof r?r.bind(e):r}return(t,r)=>e.insertTextBefore(t,"||"===r?"??":r)}}))}]}}(r,t))}}});for(let[t,n]of Object.entries(b7.create(r)))e.on(t,n)},meta:{type:b7.meta.type,docs:{description:b7.meta.docs.description,recommended:!0},fixable:b7.meta.fixable,hasSuggestions:b7.meta.hasSuggestions,schema:b7.meta.schema,defaultOptions:[b7.meta.defaultOptions?.[0]],messages:Er,languages:["js/js"]}},Ea="no-useless-coercion",Ei=new o([["Boolean",{type:"boolean",isType:os}],["String",{type:"string",isType:og}],["BigInt",{type:"bigint",isType:function(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&ou(e.typeAnnotation)||op(e,t))||"bigint"==typeof eV(e,t.sourceCode.getScope(e))?.value)}}],["Number",{type:"number",isType:(e,t)=>n2(e,t.sourceCode.getScope(e))}]]),Es="no-useless-boolean-cast",El=["every","filter","find","findIndex","findLast","findLastIndex","some"],Eu="no-useless-continue",Ep="no-useless-override",Ec=e=>e.isUnion()?e.types.every(e=>Ec(e)):"void"===e.intrinsicName||"undefined"===e.intrinsicName,Ed=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{return{type:r.getTypeAtLocation(e),checker:r.program.getTypeChecker()}}catch{}},Em="prefer-has-check",Ef=new i(["Map","ReadonlyMap","WeakMap"]),Eg=new i(["Map","WeakMap"]),Ey=new i(["FormData","Headers","URLSearchParams"]),Eh=new i(["Array","ReadonlyArray"]),Ex=Eg.union(Ey),Eb=new i(["ClassName","ImportBinding","TSEnumName","Type"]),EE=new i(["any","bigint","boolean","false","number","string","unknown","undefined","null","void"]),Ev=new i(["TSTypeAnnotation","TSParenthesizedType"]),ES=new i(["TSAnyKeyword","TSNeverKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword"]),EC=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNumberKeyword","TSStringKeyword"]),ED=new i(["TSArrayType","TSConstructorType","TSFunctionType","TSObjectKeyword","TSSymbolKeyword","TSTupleType"]),ET=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression"]),EA=new i(["ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"]),Ew=e=>{for(;EA.has(e.type);)e=e.expression;return e},Ek=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=Ek(e.left);return t?`${t}.${e.right.name}`:void 0}},EI=e=>e.typeArguments?.params??e.typeParameters?.params??[],Ej=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>Eb.has(e.type));if(r)return r;t=t.upper}},EF=e=>{if(e?.type==="Type"&&"TSTypeAliasDeclaration"===e.node.type&&0===EI(e.node).length)return e.node.typeAnnotation},EB=(e,t)=>{if(t.sourceCode.isGlobalReference(e))return!0;let r=eS(t.sourceCode.getScope(e),e);return!r||0===r.defs.length},ER=(e,t)=>tq(e)&&EB(e,t)||"UnaryExpression"===e.type&&"void"===e.operator&&"Literal"===e.argument.type&&0===e.argument.value,EP=(e,t)=>Ef.has(e)?{kind:"map",typeName:e,valueType:t}:Ey.has(e)?{kind:"null-sentinel",typeName:e}:void 0,EL=(e,t,r=new i)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return EL(e.typeAnnotation,t,r);case"TSTypeOperator":return"readonly"===e.operator?EL(e.typeAnnotation,t,r):void 0;case"TSTypeReference":{let n=Ek(e.typeName);if(!n)return;if((Ef.has(n)||Ey.has(n))&&!Ej(n,t))return EP(n,EI(e).at(-1));let o=((e,t,r)=>{if(!r.has(e))return r.add(e),EF(Ej(e,t))})(n,t,r);return o?EL(o,t,r):void 0}}},EN=(e,t)=>{let r=t.sourceCode.getScope(e);return EL(e.typeAnnotation,r)},E$=(e,t,r=new i)=>{let n=EN(e,t);if(n)return n;if(tE(e=Ew(e))&&"Identifier"===e.callee.type&&Ex.has(e.callee.name)&&EB(e.callee,t))return EP(e.callee.name);if("Identifier"!==e.type)return;let o=eS(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,s=EL(a.name?.typeAnnotation,t.sourceCode.getScope(a.name));return s||("Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init?E$(a.node.init,t,r):void 0)},EM=(e,t)=>{for(let r of[e,e.target]){if(!r)continue;let e=r7(r);if(ne(e,t))return e.getName()}},EO=(e,t,r)=>{if(r5.has(e.intrinsicName)||r4.has(e.intrinsicName))return;if(e.isUnion()){let n=e.types.map(e=>EO(e,t,r));if(1===new i(n.map(e=>e?.typeName)).size){let[e]=n;if(e?.kind!=="map")return e;let r=n.map(e=>e?.valueType);return{...e,valueType:r.every(Boolean)?t.getUnionType(r):void 0}}if(n.every(e=>e?.kind==="map")){let e=n.map(e=>e.valueType);return{kind:"map",typeName:"Map",valueType:e.every(Boolean)?t.getUnionType(e):void 0}}return n.every(e=>e?.kind==="null-sentinel")?{kind:"null-sentinel",typeName:"null-sentinel"}:void 0}if(e.isIntersection())return e.types.map(e=>EO(e,t,r)).find(e=>e?.kind==="map");let n=EM(e,r);return EP(n,Ef.has(n)?t.getTypeArguments(e).at(-1):void 0)},Eq=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return EO(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}},EU=(e,t)=>Eq(e,t)??E$(e,t),EW=(e,t)=>"truthy"===t?!!e:"not-undefined"===t?void 0!==e:null!=e,EV=(e,t,r,n=new i)=>{if(!e||ES.has(e.type))return!1;if(Ev.has(e.type))return EV(e.typeAnnotation,t,r,n);if("TSTypeOperator"===e.type)return"readonly"===e.operator&&EV(e.typeAnnotation,t,r,n);if("TSUnionType"===e.type||"TSIntersectionType"===e.type)return e.types.every(e=>EV(e,t,r,n));if("TSNullKeyword"===e.type)return"not-undefined"===r;if(EC.has(e.type))return"truthy"!==r;if(ED.has(e.type))return!0;if("TSTypeLiteral"===e.type)return"truthy"!==r;if("TSLiteralType"===e.type){var o;let t="Literal"===(o=e.literal).type?o.value:"TemplateLiteral"===o.type&&0===o.expressions.length?o.quasis[0].value.cooked:"UnaryExpression"===o.type&&("-"===o.operator||"+"===o.operator)&&"Literal"===o.argument.type&&("number"==typeof o.argument.value||"bigint"==typeof o.argument.value)?"-"===o.operator?-o.argument.value:o.argument.value:void 0;return void 0!==t&&EW(t,r)}return"TSTypeReference"===e.type&&((e,t,r,n)=>{let o,a,i=Ek(e.typeName);if(!i||n.has(i))return!1;n.add(i);let s=(a=EF(o=Ej(i,t.sourceCode.getScope(e.typeName))))?{type:"alias",node:a}:o?.type==="ClassName"||o?.type==="Type"&&"TSInterfaceDeclaration"===o.node.type?{type:"object"}:void 0,l=!1;return s?.type==="alias"?l=EV(s.node,t,r,n):s?.type==="object"&&(l="truthy"!==r),n.delete(i),l})(e,t,r,n)},E_=(e,t)=>e.isTypeParameter?.()?e.getConstraint()??t.getBaseConstraintOfType(e):e,Ez=(e,t,r)=>{if(r5.has(e.intrinsicName))return!1;let n=E_(e,t);return n&&n!==e?Ez(n,t,r):!e.isTypeParameter?.()&&(e.isUnion()||e.isIntersection()?e.types.every(e=>Ez(e,t,r)):!r.has(e.intrinsicName))},EK=(e,t,r)=>{if(r5.has(e.intrinsicName)||r4.has(e.intrinsicName))return!1;let n=E_(e,t);if(n&&n!==e)return EK(n,t,r);if(e.isUnion()||e.isIntersection())return e.types.every(e=>EK(e,t,r));if(EE.has(e.intrinsicName))return!1;if("true"===e.intrinsicName||"symbol"===e.intrinsicName)return!0;if(e.isStringLiteral?.())return e.value.length>0;if(e.isNumberLiteral?.())return 0!==e.value;if(e.isBigIntLiteral?.())return e.value.negative||"0"!==e.value.base10Value;let o=t.typeToString(e);return/^-?\d+n$/u.test(o)?!/^-?0n$/u.test(o):"object"===t.typeToString(e)||Eh.has(EM(e,r))||e.getCallSignatures().length>0||e.getConstructSignatures().length>0},EG=(e,t,r)=>{if(!tE(e)||"Identifier"!==e.callee.type||!Eg.has(e.callee.name)||!EB(e.callee,t))return;if(0===e.arguments.length)return!0;if(1!==e.arguments.length)return;let[n]=e.arguments;if("ArrayExpression"===n.type)return n.elements.every(e=>{var n;let o;return e?.type==="ArrayExpression"&&e.elements.length>=2&&e.elements[1]&&"SpreadElement"!==e.elements[1].type&&(n=e.elements[1],(o=eV(n,t.sourceCode.getScope(n)))?EW(o.value,r):!tq(n)&&ET.has(n.type))})},EJ=(e,t,r)=>{let n=EG(Ew(e),t,r);if(void 0!==n)return n;let o=Eq(e,t)?.valueType;if(o){let{program:e}=t.sourceCode.parserServices,n=e.getTypeChecker();if("truthy"===r?EK(o,n,e):"not-undefined"===r?Ez(o,n,new i(["undefined","void"])):Ez(o,n,new i(["undefined","void","null"])))return!0}return function e(t,r,n,o={}){let a,s=o.visitedVariables??new i,l=o.checkConstructorValues??!0,u=EN(t,r);if(u?.kind==="map")return!!u.valueType&&EV(u.valueType,r,n);let p=((e,t,r,n)=>{if(!tE(e)||"Identifier"!==e.callee.type||!Eg.has(e.callee.name)||!EB(e.callee,t))return;if(n){let n=EG(e,t,r);if(void 0!==n)return n}let o=EI(e).at(-1);return!!o&&EV(o,t,r)})(t=Ew(t),r,n,l);if(void 0!==p)return p;let c=((e,t,r)=>{if("Identifier"!==e.type)return;let n=eS(t.sourceCode.getScope(e),e);if(!(!n||r.has(n))&&1===n.defs.length)return n})(t,r,s);if(!c)return!1;s.add(c);let[d]=c.defs,m=(a=EL(d.name?.typeAnnotation,r.sourceCode.getScope(d.name)),a?.kind==="map"?!!a.valueType&&EV(a.valueType,r,n):"Variable"===d.type&&"const"===d.parent.kind&&d.node.id===d.name&&!!d.node.init&&e(d.node.init,r,n,{visitedVariables:s,checkConstructorValues:!1}));return s.delete(c),m}(e,t,r)},EX="logical",EY="ternary",EH="consistent-conditional-object-spread",EQ=new i(["==","==="]),EZ=new i(["!=","!=="]),E0=e=>tD(e)||tq(e)||td(e),E1=e=>"SpreadElement"===e.parent.type&&e.parent.argument===e&&"ObjectExpression"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent);function E2(e,t,r){if(rk(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return E2(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&E2(e.left,t.left,r)&&E2(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&E2(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function E3(e){return td(e)?"null":tq(e)?"undefined":void 0}function E8(e){if("BinaryExpression"!==e.type||!EQ.has(e.operator)&&!EZ.has(e.operator))return;let t=E3(e.left),r=E3(e.right);if(!!t!=!!r)return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:EQ.has(e.operator)}}let E6=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind;function E9(e,t){let r=E8(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=E8(e.left),o=E8(e.right);if(n&&o&&E2(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&E6(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&E6(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}function E5(e,t,r){let n=to(e,r);return!ta(e,r)&&ii(e,{operator:"&&",property:t})&&(n=`(${n})`),n}function E4(e,t){let r=to(e,t);return!ta(e,t)&&a4(e)&&(r=`(${r})`),r}let E7="default-export-style/inline",ve="default-export-style/separate",vt="default-export-style/suggestion-inline",vr="default-export-style/suggestion-separate",vn="inline",vo="separate",va="ignore",vi="class",vs="function",vl=()=>({enum:[vn,vo,va]}),vu=(e,t)=>e?.type==="ExportDefaultDeclaration"&&"Identifier"===e.declaration.type&&e.declaration.name===t,vp=e=>e.id?.name,vc=e=>{switch(e.type){case"ClassDeclaration":return vi;case"FunctionDeclaration":return vs}},vd=e=>e===vi?"classes":"functions",vm=(e,t)=>{let[,r]=e.sourceCode.getRange(t),n=e.sourceCode.getLoc(t).end.line;return rM(e).some(t=>e.sourceCode.getRange(t)[0]>=r&&e.sourceCode.getLoc(t).start.line===n)},vf=(e,t)=>eS(e,t)?.references.some(e=>!e.init&&e.isWrite())??!1,vg=e=>!!e&&!!(e.type.startsWith("TS")||e.typeAnnotation||e.typeParameters||e.returnType||e.implements?.length>0||e.superTypeArguments||e.accessibility||e.readonly||e.override||e.definite||e.optional&&"MemberExpression"!==e.type&&"CallExpression"!==e.type||e.abstract||e.declare||e.decorators?.length>0),vy=(e,t)=>{if(vg(e))return!0;for(let r of t[e.type]??[]){let n=e[r];if(Array.isArray(n)){if(n.some(e=>e?.type&&vy(e,t)))return!0;continue}if(n?.type&&vy(n,t))return!0}return!1},vh=(e,t)=>e.params.every(e=>!r2(e,t.sourceCode.visitorKeys)),vx=(e,t,r)=>eS(e,t)?.references.some(e=>!e.init&&e.identifier!==r)??!1,vb=(e,t)=>{let r=vp(e);if(r){let t=vc(e);return t&&{kind:t,name:r,declaration:e}}let n=((e,t)=>{if("VariableDeclaration"!==e.type||"const"!==e.kind||1!==e.declarations.length)return;let[r]=e.declarations;if(!("Identifier"!==r.id.type||vg(r.id)||r.init?.type!=="ArrowFunctionExpression"||vy(r.init,t.sourceCode.visitorKeys)))return r})(e,t);if(n)return{kind:vs,name:n.id.name,declaration:e,functionNode:n.init}},vE=(e,t)=>e.params.map(e=>t.getText(e)).join(", "),vv=({context:e,declaration:t,exportDeclaration:r,name:n,scope:o,rangeStartNode:a=t})=>{if(!(e.sourceCode.getCommentsInside(r).length>e.sourceCode.getCommentsInside(t).length||vx(o,t.id,"Identifier"===r.declaration.type?r.declaration:void 0))&&"FunctionDeclaration"===t.type&&!t.generator&&!vy(t,e.sourceCode.visitorKeys)&&0===e.sourceCode.getCommentsInside(t).length&&vh(t,e)&&!r2(t.body,e.sourceCode.visitorKeys))return[{messageId:vr,fix:o=>o.replaceTextRange([e.sourceCode.getRange(a)[0],e.sourceCode.getRange(r)[1]],`const ${n} = ${t.async?"async ":""}(${vE(t,e.sourceCode)}) => ${e.sourceCode.getText(t.body)};
44
- export default ${n};`)}]},vS=({context:e,declaration:t,exportDeclaration:r,expectedStyle:n,kind:o,name:a,scope:i})=>{if(!(n===va||((e,t,r)=>{let[,n]=e.sourceCode.getRange(t),[o]=e.sourceCode.getRange(r);return rM(e).some(t=>{let[r,a]=e.sourceCode.getRange(t);return r>=n&&a<=o})})(e,t,r)||vf(i,r.declaration))&&(o!==vs||"FunctionDeclaration"!==t.type||!t.generator)&&!(o===vs&&"FunctionDeclaration"===t.type&&vy(t,e.sourceCode.visitorKeys))){if(n===vn)return"VariableDeclaration"===t.type?{node:r,messageId:E7,data:{kind:o},suggest:(({context:e,declaration:t,exportDeclaration:r,name:n,scope:o})=>{let[{id:a,init:i}]=t.declarations;if(!(e.sourceCode.getCommentsInside(r).length>0||vm(e,r)||e.sourceCode.getCommentsInside(t).length>e.sourceCode.getCommentsInside(i).length||vx(o,a,r.declaration))&&"ArrowFunctionExpression"===i.type&&!vy(i,e.sourceCode.visitorKeys)&&0===e.sourceCode.getCommentsInside(i).length&&vh(i,e)&&!r2(i.body,e.sourceCode.visitorKeys))return[{messageId:vt,data:{kind:vs},fix:o=>o.replaceTextRange([e.sourceCode.getRange(t)[0],e.sourceCode.getRange(r)[1]],`export default ${i.async?"async ":""}function ${n}(${vE(i,e.sourceCode)}) ${"BlockStatement"===i.body.type?e.sourceCode.getText(i.body):`{ return ${to(i.body,e)}; }`}`)}]})({context:e,declaration:t,exportDeclaration:r,name:a,scope:i})}:o===vi&&vy(t,e.sourceCode.visitorKeys)?void 0:e.sourceCode.getCommentsInside(r).length>0||vm(e,r)?{node:r,messageId:E7,data:{kind:o}}:{node:r,messageId:E7,data:{kind:o},fix:function*(n){yield n.insertTextBefore(t,"export default "),yield n.removeRange([e.sourceCode.getRange(t)[1],e.sourceCode.getRange(r)[1]])}};if(n===vo&&o===vs&&"FunctionDeclaration"===t.type)return{node:r,messageId:ve,data:{kind:o,style:"const arrow function"},suggest:vv({context:e,declaration:t,exportDeclaration:r,name:a,scope:i})}}},vC=({context:e,exportDeclaration:t,expectedStyle:r,kind:n})=>{let{declaration:o}=t,a=vp(o),i=e.sourceCode.getScope(t);if(!(!a||r===va||r===vn||vf(i,a)||n===vs&&(o.generator||vy(o,e.sourceCode.visitorKeys)))){if(n===vs)return{node:t,messageId:ve,data:{kind:n,style:"const arrow function"},suggest:vv({context:e,declaration:o,exportDeclaration:t,name:a,scope:i,rangeStartNode:t})};if(!(n===vi&&vy(o,e.sourceCode.visitorKeys)))return e.sourceCode.getCommentsInside(t).length>e.sourceCode.getCommentsInside(o).length?{node:t,messageId:ve,data:{kind:n,style:"class declaration"}}:{node:t,messageId:ve,data:{kind:n,style:"class declaration"},fix:r=>{let{declaration:n}=t;return r.replaceText(t,`${e.sourceCode.getText(n)}
45
- export default ${n.id.name};`)}}}},vD={create:e=>{let t=e.options[0];e.on("Program",r=>{for(let[n,o]of r.body.entries()){if("ExportDefaultDeclaration"===o.type){let{declaration:r}=o,n=vc(r),a=vp(r);if(!n||!a)continue;let i=vC({context:e,exportDeclaration:o,expectedStyle:t[vd(n)],kind:n});if(i)return i;continue}let a=r.body[n+1],i=vb(o,e);if(!i||!vu(a,i.name))continue;let s=vS({context:e,exportDeclaration:a,expectedStyle:t[vd(i.kind)],scope:e.sourceCode.getScope(a),...i});if(s)return s}})},meta:{type:"suggestion",docs:{description:"Enforce consistent default export declarations.",recommended:!0},fixable:"code",hasSuggestions:!0,schema:[{type:"object",properties:{functions:vl(),classes:vl()},additionalProperties:!1}],defaultOptions:[{functions:vn,classes:vn}],messages:{[E7]:"Prefer declaring this default-exported {{kind}} inline.",[ve]:"Prefer declaring this default-exported {{kind}} as a separate {{style}}.",[vt]:"Use an inline default {{kind}} declaration.",[vr]:"Use a separate const arrow function default export."},languages:["js/js"]}};function vT(e){for(;;){let t=rN(e);if(t!==e){e=t;continue}if(e?.type!=="ParenthesizedExpression")return e;e=e.expression}}function vA(e,t){return eS(t.sourceCode.getScope(e),e)}let vw="no-array-concat-in-loop",vk="no-array-front-mutation",vI=["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"],vj="no-array-sort-for-min-max/error",vF="no-array-sort-for-min-max/suggestion",vB=e=>tp(e)&&0===e.value,vR=(e,t)=>{if(!tR(e,{methods:["sort","toSorted"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||r3(e.callee.object))return;let[r]=e.arguments,n=(e=>{if(!tw(e)||e.async||e.generator||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type))return;let t=rN((e=>{if("BlockStatement"!==e.body.type)return e.body;if(1!==e.body.body.length)return;let[t]=e.body.body;if("ReturnStatement"===t.type)return t.argument})(e));if(t?.type!=="BinaryExpression"||"-"!==t.operator)return;let[r,n]=e.params;if(r.name!==n.name){if(rk(t.left,r)&&rk(t.right,n))return"ascending";if(rk(t.left,n)&&rk(t.right,r))return"descending"}})(r);if(n&&!(nB(e.callee.object,t)||nR(e.callee.object,t)))return{direction:n,node:e.callee.object}},vP=(e,t,r,n)=>{var o,a,i;let s=(o=t.direction,"first"===r?"ascending"===o?"min":"max":"ascending"===o?"max":"min"),l={node:e,messageId:vj,data:{method:s,extreme:"min"===s?"minimum":"maximum"}};if("Super"!==t.node.type&&0===n.sourceCode.getCommentsInside(e).length){let r,o=(a=t.node,i=n.sourceCode,r=aj(a)?i.getText(a):`(${i.getText(a)})`,`Math.${s}(...${r})`);l.suggest=[{messageId:vF,data:{replacement:o},fix:t=>t.replaceText(e,o)}]}return l},vL="no-boolean-sort-comparator",vN="no-boolean-sort-comparator/suggestion",v$=new i(["sort","toSorted"]),vM=new i([">",">=","<","<="]),vO=(e,t,r,n)=>(e=rN(e),t=rN(t),"Identifier"===e.type&&"Identifier"===t.type)?e.name===r.name&&t.name===n.name||e.name===n.name&&t.name===r.name:"MemberExpression"===e.type&&"MemberExpression"===t.type&&e.computed===t.computed&&(e.computed?!!rk(e.property,t.property):e.property.name===t.property.name)&&vO(e.object,t.object,r,n),vq=(e,t)=>{for(;rL(e);){if(e.typeAnnotation&&on(e.typeAnnotation,t,t.sourceCode.getScope(e)))return!0;e=e.expression}return!1},vU="no-chained-comparison/error",vW="no-chained-comparison/suggestion",vV=new i(["<",">","<=",">="]),v_=new i(["===","!==","==","!="]),vz=vV.union(v_),vK=e=>"BinaryExpression"===e.type&&vz.has(e.operator),vG="no-constant-zero-expression/error",vJ="no-constant-zero-expression/suggestion",vX="no-duplicate-logical-operands",vY="no-duplicate-logical-operands/suggestion",vH=new i(["Identifier","ThisExpression","Literal"]),vQ=new i(["Identifier","ThisExpression"]),vZ=e=>{if(pB(e=rN(e)))return!1;switch(e.type){case"Identifier":case"Super":case"ThisExpression":return!0;case"MemberExpression":var t;return vZ(e.object)&&(!e.computed||(t=rN(t=e.property),vH.has(t.type)));default:return!1}},v0="no-impossible-length-comparison",v1={"<":">","<=":">=",">":"<",">=":"<=","===":"===","!==":"!==","==":"==","!=":"!="},v2="no-invalid-character-comparison",v3=new i(["==","===","!=","!=="]),v8=(e,t)=>!!(tR(e,{method:"charAt",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&og(e.callee.object,t)||tR(e,{method:"at",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&og(e.callee.object,t))||"MemberExpression"===e.type&&e.computed&&!e.optional&&(e=>{if(tp(e))return!0;if(!ts(e))return!1;let t=Number(e.value);return Number.isSafeInteger(t)&&t>=0&&String(t)===e.value})(e.property)&&og(e.object,t),v6="no-loop-iterable-mutation",v9=["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"],v5=["add","clear","delete"],v4=["clear","delete","set"],v7={array:new i(v9),set:new i(v5),map:new i(v4),unknown:new i([...v9,...v5,...v4])},Se=new i(["entries","keys","values"]),St=new i(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression"]);function Sr(e,t){return nj(e,t)?"array":nq(e,t)?"set":nU(e,t)?"map":void 0}function Sn(e){return"VariableDeclaration"===e.left.type?e.left.declarations[0].id:e.left}function So(e){return"Identifier"===(e=rN(e)).type?e:void 0}function Sa(e){if("ArrayPattern"!==(e=rN(e)).type)return;let[t]=e.elements;return t&&So(t)}function Si(e,t){if(pB(e=rN(e)))return;if(pj(e))return{collectionKind:Sr(e,t),reference:e,method:"direct"};if("CallExpression"!==e.type||"MemberExpression"!==e.callee.type||e.arguments.length>0)return;let r=ez(e.callee,t.sourceCode.getScope(e.callee));if(!(!Se.has(r)||pB(e.callee.object))&&pj(e.callee.object))return{collectionKind:Sr(e.callee.object,t),reference:e.callee.object,method:r}}function Ss(e,t){let r=Sn(e);return"keys"===t.method?So(r):"entries"===t.method||"direct"===t.method&&"set"!==t.collectionKind?Sa(r):void 0}function Sl(e,t){let r,n;if("VariableDeclaration"!==e.left.type||"const"!==e.left.kind)return{collectionKind:t.collectionKind,iterable:t.reference,loopBody:e.body};let o=(r=Sn(e),"entries"===t.method?Sa(r):"direct"!==t.method||"map"!==t.collectionKind?So(r):void 0),a=Ss(e,t),i=(n=Sn(e),"set"===t.collectionKind&&("direct"===t.method||"values"===t.method)?So(n):"direct"===t.method&&"map"!==t.collectionKind?So(n)??Sa(n):Ss(e,t));return{addArgumentIdentifier:o,collectionKind:t.collectionKind,deleteArgumentIdentifier:i,iterable:t.reference,loopBody:e.body,setKeyIdentifier:a}}function*Su(e){"Identifier"===(e=rN(e)).type?yield e:"MemberExpression"===e.type&&(yield*Su(e.object),e.computed&&(yield*Su(e.property)))}function Sp(e,t,r){if(!pI(e,t))return!1;let n=[...Su(e)],o=[...Su(t)];return n.length!==o.length||0===n.length?n.length===o.length:n.every((e,t)=>{var n;let a,i;return n=o[t],a=eS(r.sourceCode.getScope(e),e),i=eS(r.sourceCode.getScope(n),n),a||i?a===i:e.name===n.name})}function Sc(e,t,r){let[n]=e.arguments;return!!(t&&n&&Sp(n,t,r))}function Sd(e,t,r,n){return"add"===r&&Sc(e,t.addArgumentIdentifier,n)||"set"===r&&Sc(e,t.setKeyIdentifier,n)}let Sm="no-selector-as-dom-name",Sf=["add","remove","contains","toggle","replace"],Sg=/^[#.]-?[A-Z_a-z][\w-]*$/u,Sy=new i([".","#"]),Sh=e=>Sy.has(e?.[0]),Sx=e=>tu(e)??("TemplateLiteral"===e.type&&e.quasis[0].value.cooked),Sb=(e,t,r,n)=>({node:e,messageId:Sm,fix:((e,t,r,n)=>{let o=((e,t)=>{let[r]=t.getRange(e);return[r+1,r+2]})(e,n);if(t.startsWith(r)&&n.text[o[0]]===r){if("TemplateLiteral"===e.type&&e.expressions.length>0){if(1!==e.expressions.length||e.quasis[0].value.cooked!==r||""!==e.quasis[1].value.cooked)return;return e=>e.removeRange(o)}if(Sg.test(t))return e=>e.removeRange(o)}})(e,t,r,n)}),SE=(e,t)=>e.map(e=>({node:e,expectedPrefix:t})),Sv="no-useless-compound-assignment/error",SS="no-useless-compound-assignment/remove",SC="no-useless-compound-assignment/replace",SD=new o([["+=",0],["-=",0],["*=",1],["/=",1],["**=",1]]),ST="no-useless-delete-check",SA="removeCheck",Sw={considerGetters:!0},Sk=new i(["Map","Set","WeakMap","WeakSet"]),SI=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),Sj=new i(["ClassName","FunctionName"]),SF=new i(["TSConstructorType","TSFunctionType","TSObjectKeyword"]),SB=e=>null!==e&&("object"==typeof e||"function"==typeof e),SR=e=>!!SF.has(e?.type)||e?.type==="TSUnionType"&&e.types.every(e=>SR(e)),SP=(e,t)=>{if("Identifier"!==e.type)return!1;let r=eS(t.sourceCode.getScope(e),e);return r?.defs.some(e=>Sj.has(e.type))??!1},SL=(e,t)=>{let r=eV(e,t.sourceCode.getScope(e));return r&&"symbol"!=typeof r.value&&!SB(r.value)?String(r.value):void 0},SN=(e,t)=>{let r=eV(e,t.sourceCode.getScope(e));if(r)return SB(r.value);let n=rJ(rN(e),t);if(n){let e=rN(n),r=eV(e,t.sourceCode.getScope(e));if(r)return SB(r.value);if(SI.has(e.type))return!0}return!SP(rN(e),t)&&SR(((e,t)=>{if("Identifier"!==(e=rN(e)).type)return;let r=eS(t.sourceCode.getScope(e),e);return r?.defs[0]?.name?.typeAnnotation?.typeAnnotation??e.typeAnnotation?.typeAnnotation})(e,t))},S$=(e,t)=>!eH(e,t.sourceCode,Sw),SM=(e,t)=>tR(e,{method:t,argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}),SO=(e,t,r)=>n=>{if(rV(r,r.sourceCode.getRange(e)))return;let o=r.sourceCode.getText(t.parent);return o.trimEnd().endsWith(";")||(o+=";"),aL(r.sourceCode.getTokenBefore(e),r,o)&&(o=`;${o}`),n.replaceText(e,o)},Sq="no-useless-logical-operand",SU=new o([["&&",!0],["||",!1]]),SW=new o([["&&",!1],["||",!0]]),SV=new i(["FunctionExpression","ClassExpression","ObjectExpression"]),S_="prefer-boolean-return",Sz=new i(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function SK(e){if(e){if("BlockStatement"===e.type){let t=e.body.filter(({type:e})=>"EmptyStatement"!==e);if(1===t.length)return SK(t[0])}return e}}let SG=e=>{if(e?.type==="ReturnStatement"&&e.argument?.type==="Literal"&&"boolean"==typeof e.argument.value)return e.argument.value};function SJ(e,t){switch(e.type){case"Literal":return"boolean"==typeof e.value;case"UnaryExpression":return["!","delete"].includes(e.operator);case"BinaryExpression":return Sz.has(e.operator);case"LogicalExpression":return SJ(e.left,t)&&SJ(e.right,t);case"CallExpression":return tK(e,t)||"CallExpression"===e.type&&!e.optional&&"MemberExpression"===e.callee.type&&!e.callee.optional&&!e.callee.computed&&"Identifier"===e.callee.object.type&&"Array"===e.callee.object.name&&t.sourceCode.isGlobalReference(e.callee.object)&&"Identifier"===e.callee.property.type&&"isArray"===e.callee.property.name;default:return!1}}let SX="prefer-flat-math-min-max",SY=["min","max"],SH=(e,t)=>tR(e,{object:"Math",method:t,optionalCall:!1,optionalMember:!1}),SQ=(e,t)=>{let r=[];for(let n of e.arguments){if(SH(n,t)){r.push(...SQ(n,t));continue}r.push(n)}return r},SZ="prefer-hoisting-branch-code/start",S0="prefer-hoisting-branch-code/end",S1="prefer-hoisting-branch-code/suggestion",S2=new i(["await using","using"]),S3=(e,t)=>eH(e,t)||function e(t,r){if("TaggedTemplateExpression"===t.type)return!0;for(let n of r.visitorKeys[t.type]??[]){let o=t[n];if(Array.isArray(o)){for(let t of o)if(t&&e(t,r))return!0;continue}if(o&&e(o,r))return!0}return!1}(e,t),S8=(e,t)=>{let r=t.getTokens(e),n=r.at(-1);return n?.type==="Punctuator"&&";"===n.value?r.slice(0,-1):r},S6=(e,t,r)=>{let n=S8(e,r),o=S8(t,r);return 0!==n.length&&n.length===o.length&&n.every((e,t)=>e.type===o[t].type&&e.value===o[t].value)};function S9(e,{leading:t,trailing:r,isStart:n},o){let{sourceCode:a}=o,{body:i}=e;if(n){let[e]=a.getRange(i[0]),[r]=a.getRange(i[t]);return[e,r]}let[,s]=a.getRange(i[i.length-r-1]),[,l]=a.getRange(i.at(-1));return[s,l]}function S5({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){var i;let{sourceCode:s}=a,l=t[0].body,u=o?l.slice(0,r):l.slice(l.length-n),p=u.every(e=>!rK(e))&&function(e){let{parent:t}=e;return["Program","BlockStatement","StaticBlock","SwitchCase"].includes(t.type)}(e)&&!((i={leading:r,trailing:n,isStart:o}).isStart&&((e,t)=>{let{sourceCode:r}=t,[n]=r.getRange(e),o=r.getTokenBefore(e);return rV(t,[o?r.getRange(o)[1]:0,n])})(e,a)||!i.isStart&&((e,t)=>{let{sourceCode:r}=t,n=r.getCommentsAfter(e)[0];return!!(n&&r.getLoc(n).start.line===r.getLoc(e).end.line)})(e,a)||t.some(e=>{let{sourceCode:t}=a,[r]=t.getRange(e),[n]=t.getRange(e.body[0]);if(i.isStart&&rV(a,[r+1,n]))return!0;if(!i.isStart){let[,r]=t.getRange(e.body.at(-1)),[,n]=t.getRange(e);if(rV(a,[r,n-1]))return!0}return rV(a,S9(e,i,a))}))&&(o||t.every(e=>!function(e,t,r){let{sourceCode:n}=r,{body:o}=e,[a]=n.getRange(o[o.length-t]),[i,s]=n.getRange(e);for(let t of n.getScope(e).variables){let[e]=t.defs;if(!e||e.parent?.type==="VariableDeclaration"&&"var"===e.parent.kind)continue;let[r]=n.getRange(e.name);if(!(r<=i)&&!(r>=a)){if(e.parent?.type==="VariableDeclaration"&&S2.has(e.parent.kind))return!0;for(let e of t.references){let[t]=n.getRange(e.identifier);if(t>=a&&t<=s)return!0}}}return!1}(e,n,a))),c={loc:{start:s.getLoc(u[0]).start,end:s.getLoc(u.at(-1)).end},messageId:o?SZ:S0};if(p){let i=function({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){let{sourceCode:i}=a,s=rR(e,a),l=o?r:n,u=t[0].body,p=o?u.slice(0,l):u.slice(u.length-l),c=function(e,t,r){let{sourceCode:n}=r,[o]=n.getRange(e[0]),[,a]=n.getRange(e.at(-1)),i=n.text.slice(o,a),s=rR(e[0],r);return s===t?i:i.split("\n").map((e,r)=>0===r?e:e.startsWith(s)?`${t}${e.slice(s.length)}`:e).join("\n")}(p,s,a);return function*(l){if(o){let t=i.getTokenBefore(e),r=t&&aL(t,a,c)?";":"";yield l.insertTextBefore(e,`${r}${c}
46
- ${s}`)}else{let t=i.getLastToken(p.at(-1)),r=i.getTokenAfter(e),n=r&&aL(t,a,r.value)?";":"";yield l.insertTextAfter(e,`
47
- ${s}${c}${n}`)}for(let e of t)yield l.removeRange(S9(e,{leading:r,trailing:n,isStart:o},a))}}({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a);!o||function(e,t){for(let r=e;r?.type==="IfStatement";r=r.alternate)if(S3(r.test,t))return!1;return!0}(e,s)&&u.every(e=>"ExpressionStatement"===e.type&&!S3(e,s))?c.fix=i:c.suggest=[{messageId:S1,fix:i}]}return c}let{parse:S4}=lT,S7="prefer-single-replace",Ce=new i(["g","m","s"]),Ct=new o([["\\",String.raw`\\`],["]",String.raw`\]`],["\n",String.raw`\n`],["\r",String.raw`\r`],[" ",String.raw`\t`],["\f",String.raw`\f`],["\v",String.raw`\v`],["\u2028",String.raw`\u2028`],["\u2029",String.raw`\u2029`]]);function Cr(e){if(!tR(e,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1}))return;let[t]=e.arguments;if(ts(t)){if("replaceAll"!==e.callee.property.name)return;return 1===t.value.length?t.value:void 0}if(tc(t))return function({pattern:e,flags:t}){let r;if(t.includes("g")){for(let e of t)if(!Ce.has(e))return;try{r=S4(e,t,{namedGroups:!0,lookbehind:!0})}catch{return}return function e(t){return"value"===t.type?String.fromCodePoint(t.codePoint):("alternative"!==t.type||1!==t.body.length)&&("characterClass"!==t.type||t.negative||1!==t.body.length)?void 0:e(t.body[0])}(r)}}(t.regex)}let Cn="consistent-tuple-labels",Co="no-invalid-well-known-symbol-methods/async-dispose",Ca="no-invalid-well-known-symbol-methods/dispose-generator",Ci="no-invalid-well-known-symbol-methods/sync-iterator",Cs="no-invalid-well-known-symbol-methods/async-iterator",Cl="no-invalid-well-known-symbol-methods/suggestion",Cu=new i(["Promise","PromiseLike"]),Cp=new i(["dispose","iterator","asyncIterator"]);function Cc(e){return"TSTypeReference"===e.type&&"Identifier"===e.typeName.type&&Cu.has(e.typeName.name)}function Cd(e,t){let r,n=function(e){if(e.computed&&"MemberExpression"===e.key.type&&!e.key.computed&&"Identifier"===e.key.object.type&&"Symbol"===e.key.object.name&&"Identifier"===e.key.property.type)return e.key.property.name}(e);if(!Cp.has(n))return;let o=function(e){if("get"!==e.kind&&"set"!==e.kind&&("MethodDefinition"===e.type||"PropertyDefinition"===e.type||"Property"===e.type))return e.value}(e);if(o?.type!=="FunctionExpression"&&o?.type!=="ArrowFunctionExpression")return;if("dispose"===n&&o.generator)return{node:e.key,messageId:Ca};let a=!o.async&&(!!(r=o.returnType?.typeAnnotation)&&("TSTypeReference"===r.type?Cc(r):"TSUnionType"===r.type&&r.types.some(e=>Cc(e)))||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let t=r.program.getTypeChecker(),n=r.esTreeNodeToTSNodeMap.get(e),o=t.getSignatureFromDeclaration(n);if(o)return!0===oC(t.getReturnTypeOfSignature(o),t);return r.getTypeAtLocation(e).getCallSignatures().some(e=>!0===oC(t.getReturnTypeOfSignature(e),t))}catch{return!1}}(o,t));if("dispose"===n&&(o.async||a))return{node:e.key,messageId:Co,fix:t=>t.replaceText(e.key.property,"asyncDispose")};if("iterator"===n&&(o.async||a)){let t={node:e.key,messageId:Ci};return o.generator&&(t.suggest=[{messageId:Cl,data:{replacement:"asyncIterator"},fix:t=>t.replaceText(e.key.property,"asyncIterator")}]),t}if("asyncIterator"===n&&!o.generator&&(o.async||a))return{node:e.key,messageId:Cs}}let Cm="after-suspension",Cf="in-generator",Cg="in-nested-function",Cy=["preventDefault","stopImmediatePropagation","stopPropagation"],Ch="prefer-abort-signal-timeout",Cx="prefer-abort-signal-timeout/suggestion",Cb=new i(["reason","throwIfAborted"]),CE=(e,t)=>{let r,{parent:n}=e;if(!(!tF(n,{property:"signal",computed:!1,optional:!1})||n.object!==e||nG(n)||("ForInStatement"===n.parent.type||"ForOfStatement"===n.parent.type)&&n.parent.left===n||tF(n.parent)&&n.parent.object===n&&(r=n.parent,Cb.has(ez(r,t.sourceCode.getScope(r))))||(e=>{let{expression:t,parent:r}=(e=>{let t=e,{parent:r}=e;for(;rL(r);)t=r,r=r.parent;return{expression:t,parent:r}})(e);return"VariableDeclarator"===r.type&&r.init===t||"AssignmentExpression"===r.type&&r.right===t})(n)||rV(t,t.sourceCode.getRange(n))))return n},Cv=(e,t,r,n)=>{let o=eS(n.sourceCode.getScope(r),e);return o&&o!==t},CS="prefer-aggregate-error",CC=/[Ee]rrors$|[Ee]rror(?:List|Array|Collection)$/u,CD=new i(uu);function CT(e){for(;e?.type==="ParenthesizedExpression";)e=e.expression;return rN(e)}function CA(e){if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=CA(e.left);return t?`${t}.${e.right.name}`:void 0}}function Cw(e){return e=e?.type==="TSTypeAnnotation"?e.typeAnnotation:e,e?.type==="TSTypeOperator"&&"readonly"===e.operator&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType"?Cw(e.typeAnnotation):e}function Ck(e,t,r,n=new i){switch(e=Cw(e),e?.type){case"TSTypeReference":{let o=CA(e.typeName);if(!o)return!1;let a=aM(o,t);if(CD.has(o)&&!((a?.defs.length??0)>0))return!0;if(n.has(o))return!1;n.add(o);let[i]=a?.defs??[],s=i?r.sourceCode.getScope(i.name):t,l=i?.type==="Type"&&"TSTypeAliasDeclaration"===i.node.type&&Ck(i.node.typeAnnotation,s,r,n);return n.delete(o),l}case"TSUnionType":return e.types.every(e=>Ck(e,t,r,n));case"TSIntersectionType":return e.types.some(e=>Ck(e,t,r,n));default:return!1}}function CI(e,t){let r;if(tF(e=CT(e),{property:"length",optional:!1})&&"Identifier"===e.object.type&&(r=e.object.name,CC.test(r))&&nj(e.object,t)&&function(e,t){let r=aM(e.name,t.sourceCode.getScope(e)),[n]=r?.defs??[],o=n?t.sourceCode.getScope(n.name):t.sourceCode.getScope(e);return function e(t,r,n,o=new i){switch(t=Cw(t),t?.type){case"TSArrayType":return Ck(t.elementType,r,n,o);case"TSTupleType":return t.elementTypes.length>0&&t.elementTypes.every(e=>Ck("TSNamedTupleMember"===e.type?e.elementType:"TSRestType"===e.type?e.typeAnnotation:e,r,n,o));case"TSTypeReference":return function(t,r,n,o){let a=CA(t.typeName),i=t.typeArguments?.params??t.typeParameters?.params;if(("Array"===a||"ReadonlyArray"===a)&&i?.length===1)return Ck(i[0],r,n,o);if(!a||o.has(a))return!1;o.add(a);let s=aM(a,r),[l]=s?.defs??[],u=l?n.sourceCode.getScope(l.name):r,p=l?.type==="Type"&&"TSTypeAliasDeclaration"===l.node.type&&e(l.node.typeAnnotation,u,n,o);return o.delete(a),p}(t,r,n,o);case"TSUnionType":return t.types.every(t=>e(t,r,n,o));case"TSIntersectionType":return t.types.some(t=>e(t,r,n,o));default:return!1}}(n?.name?.typeAnnotation,o,t)||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r;return function e(t,r,n,o=new i){if(!t||o.has(t))return!1;if(o.add(t),t.isUnion())return t.types.every(t=>e(t,r,n,o));if(t.isIntersection())return t.types.some(t=>e(t,r,n,o));let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);if(!(r.isArrayType(t)||r.isTupleType(t)))return!1;let s=r.getTypeArguments(t);return s.length>0&&s.every(e=>(function e(t,r,n,o=new i){if(!t||o.has(t))return!1;if(o.add(t),t.isUnion())return t.types.every(t=>e(t,r,n,o));if(t.isIntersection())return t.types.some(t=>e(t,r,n,o));let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);let s=r7(t);return!!(CD.has(s?.getName())&&ne(s,n))||nt(t,r).some(t=>e(t,r,n,o))})(e,r,n))}(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{return!1}}(e,t)}(e.object,t))return e.object}let Cj=(e,t,r)=>{var n;if(("!=="===e||"!="===e)&&ti(CT(t),0))return!0;let o=(n=CT(n=t),n?.type==="Literal"&&"number"==typeof n.value?n.value:void 0);return void 0!==o&&(r?">"===e&&o>=0||">="===e&&o>=1:"<"===e&&o>=0||"<="===e&&o>=1)},CF=e=>"LogicalExpression"!==(e=CT(e)).type||"&&"!==e.operator?[e]:[...CF(e.left),...CF(e.right)],CB={resize:"Prefer ResizeObserver over a resize listener with layout reads.",scroll:"Prefer IntersectionObserver over a scroll listener with layout reads."},CR=new i(Object.keys(CB)),CP=new i(["globalThis","self","window"]),CL=new i(["getBoundingClientRect","getClientRects"]),CN=new i(["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetParent","offsetTop","offsetWidth","scrollHeight","scrollWidth"]),C$=new i(["innerHeight","innerWidth"]),CM=new i(["height","width"]),CO=new i(["Window"]),Cq=new i(["VisualViewport"]),CU=new i(["Document","Element","HTMLElement","Node","SVGElement","VisualViewport","Window"]),CW=(e,t,r)=>{let n;if(r5.has(e.intrinsicName))return!1;if(r4.has(e.intrinsicName)||e.intrinsicName)return!0;if(e.isUnion()||e.isIntersection())return e.types.every(e=>CW(e,t,r));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return CW(o,t,r);let a=r7(e);return!(!a||nt(e,t).some(e=>!CW(e,t,r)))&&(!ne(a,r)||(n=a.getName(),!(CU.has(n)||/^HTML\w*Element$/.test(n)||/^SVG\w*Element$/.test(n))))},CV=(e,t,r,n)=>{if(r5.has(e.intrinsicName)||r4.has(e.intrinsicName))return!1;if(e.isUnion()){let o=e.types.filter(e=>!r4.has(e.intrinsicName));return o.length>0&&o.every(e=>CV(e,t,r,n))}if(e.isIntersection())return e.types.some(e=>CV(e,t,r,n));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return CV(o,t,r,n);let a=r7(e);return!!(a&&ne(a,r)&&n.has(a.getName()))||nt(e,t).some(e=>CV(e,t,r,n))},C_=(e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return!1;try{let{program:t}=n,o=t.getTypeChecker();return CV(n.getTypeAtLocation(e),o,t,r)}catch{return!1}},Cz=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r,n=t.getTypeChecker();return CW(r.getTypeAtLocation(e),n,t)}catch{return!1}},CK=e=>e.computed||"Identifier"!==e.property.type?tu(rN(e.property)):e.property.name,CG=(e,t)=>e.properties.some(e=>t.has((e=>{if("Property"===e.type)return e.computed||"Identifier"!==e.key.type?tu(rN(e.key)):e.key.name})(e))),CJ=(e,t)=>"Identifier"===e.type&&CP.has(e.name)&&oA(e,t),CX=e=>nG(e)&&"UpdateExpression"!==e.parent.type&&("AssignmentExpression"!==e.parent.type||e.parent.left!==e||"="===e.parent.operator),CY=(e,t)=>"Identifier"===(e=rN(e)).type?"visualViewport"===e.name&&oA(e,t):"MemberExpression"===e.type&&"visualViewport"===CK(e)&&CJ(rN(e.object),t),CH=(e,t)=>{var r;return CJ(e=rN(e),t)||("Identifier"===(r=rN(r=e)).type?"document"===r.name&&oA(r,t):"MemberExpression"===r.type&&"document"===CK(r)&&CJ(rN(r.object),t))||CY(e,t)},CQ=(e,t,r)=>{let n=rN(t);return CG(e,C$)&&(CJ(n,r)||C_(t,r,CO))||CG(e,CM)&&(CY(n,r)||C_(t,r,Cq))||CG(e,CN)&&!CH(n,r)&&!Cz(t,r)},CZ=(e,t,r=e)=>{let n,o,a,i;if(!e||e!==r&&tw(e))return!1;if(a=e,i=t,tb(a,void 0,ty)&&"MemberExpression"===a.callee.type&&CL.has(CK(a.callee))&&!CH(a.callee.object,i)&&!Cz(a.callee.object,i)||tL(e)&&C$.has(e.name)&&!CX(e)&&oA(e,t)||"MemberExpression"===e.type&&!CX(e)&&(n=CK(e),o=rN(e.object),C$.has(n)&&(CJ(o,t)||C_(e.object,t,CO))||CM.has(n)&&(CY(o,t)||C_(e.object,t,Cq))||CN.has(CK(e))&&!CH(e.object,t)&&!Cz(e.object,t))||("VariableDeclarator"===e.type&&"ObjectPattern"===e.id.type&&e.init?CQ(e.id,e.init,t):"AssignmentExpression"===e.type&&"ObjectPattern"===e.left.type&&CQ(e.left,e.right,t)))return!0;for(let n of t.sourceCode.visitorKeys[e.type]??[]){let o=e[n];if(Array.isArray(o)){if(o.some(e=>CZ(e,t,r)))return!0;continue}if(CZ(o,t,r))return!0}return!1},C0="prefer-set-methods/union",C1="prefer-set-methods/intersection",C2="prefer-set-methods/intersection-suggestion",C3="prefer-set-methods/difference",C8="prefer-set-methods/difference-suggestion",C6=(e,t)=>tE(e,{name:"Set",argumentsLength:1})&&oA(e.callee,t),C9=(e,t)=>{let r=to(e,t);return it(e,t)&&!ta(e,t)?`(${r})`:r},C5=(e,t,r)=>((e,t)=>{let r=e;for(;r.parent;){if("ExpressionStatement"===r.parent.type)return t.sourceCode.getRange(t.sourceCode.getFirstToken(r.parent.expression))[0]===t.sourceCode.getRange(t.sourceCode.getFirstToken(e))[0];r=r.parent}return!1})(e,r)&&aL(r.sourceCode.getTokenBefore(e),r,t)?`;${t}`:t,C4=(e,t)=>("ParenthesizedExpression"===e.type||rL(e))&&e.expression===t,C7=e=>{for(;e.parent;){let{parent:t}=e;if(C4(t,e)){e=t;continue}break}return e},De=(e,t)=>e?.type==="SpreadElement"&&"Set"===aY(e.argument,t),Dt=(e,t,r)=>{if(!(!tR(e,{method:"has",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!rk(e.arguments[0],t)||rk(e.callee.object,t))&&"Set"===aY(e.callee.object,r))return e.callee.object},Dr=(e,t,r)=>{var n;if(r.sourceCode.getCommentsInside(t).length>0||(n=C7(n=e),n.parent?.type==="MemberExpression"&&n.parent.object===n)||e===t&&rL(e.parent))return;let o=((e,t)=>{if(!tR(e,{method:"filter",argumentsLength:1,optionalCall:!1,optionalMember:!1})||t.sourceCode.getCommentsInside(e).length>0)return;let r=((e,t)=>{if("ArrayExpression"===e.type&&1===e.elements.length&&De(e.elements[0],t))return e.elements[0].argument})(e.callee.object,t);if(!r)return;let[n]=e.arguments;if("ArrowFunctionExpression"!==n.type||n.async||1!==n.params.length||"Identifier"!==n.params[0].type)return;let o=((e,t,r)=>{let n=Dt(e,t,r);if(n)return{method:"intersection",messageId:C1,suggestionMessageId:C2,otherSet:n};if("UnaryExpression"!==e.type||"!"!==e.operator||!e.prefix)return;let o=Dt(e.argument,t,r);if(o)return{method:"difference",messageId:C3,suggestionMessageId:C8,otherSet:o}})(n.body,n.params[0],t);if(!(!o||eH(o.otherSet,t.sourceCode,{considerGetters:!0})))return{messageId:o.messageId,suggestionMessageId:o.suggestionMessageId,replacement:`${C9(r,t)}.${o.method}(${to(o.otherSet,t)})`}})(e,r);if(o)return{node:t,messageId:o.messageId,suggest:[{messageId:o.suggestionMessageId,fix:e=>e.replaceText(t,C5(t,o.replacement,r))}]}},Dn="prefer-toggle-attribute/error",Do="prefer-toggle-attribute/suggestion",Da=(e,t,r)=>{let n=to(e,t);return r?"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix&&t.sourceCode.getCommentsInside(e).length===t.sourceCode.getCommentsInside(e.argument).length?Da(e.argument,t,!1):(!ta(e,t.sourceCode)&&ia(e,"!")&&(n=`(${n})`),`!${n}`):ta(e,t.sourceCode)||"SequenceExpression"!==e.type?n:`(${n})`},Di=(e,t,r)=>tR(e,{methods:t,argumentsLength:r,optionalCall:!1,computed:!1});function Ds(e){if(e?.type==="ChainExpression"&&(e=e.expression),Di(e,["removeAttribute","hasAttribute"],1)||Di(e,["setAttribute"],2)){let{callee:t}=e,[r,n]=e.arguments;if(tu(r)?.toLowerCase().startsWith("data-"))return;let o=t.property.name;return{node:e,method:o,receiver:t.object,attributeName:r,attributeValue:n,isOptional:!!t.optional,hasEmptyAttributeValue:"setAttribute"!==o||ti(n,"")}}}function Dl(e){if(e){if("BlockStatement"===e.type){if(1!==e.body.length)return;e=e.body[0]}return"ExpressionStatement"===e.type&&(e=e.expression),Ds(e)}}let Du=(e,t)=>e.isOptional===t.isOptional&&rk(e.receiver,t.receiver)&&rk(e.attributeName,t.attributeName),Dp=(e,t)=>oh(e.receiver)||nz(e.receiver,t),Dc="prefer-url-search-parameters/error",Dd="prefer-url-search-parameters/suggestion",Dm=new i(["node:url","url"]),Df=e=>"Type"===e.type||"ImportBinding"===e.type&&aN(e.node),Dg=(e,t,r)=>{let n=eS(r.sourceCode.getScope(t),e);return!n||n.defs.every(e=>Df(e))},Dy=(e,t)=>tu(rN(e))===t,Dh=(e,t)=>{let r=t.sourceCode.getText(e);return"SequenceExpression"===e.type?`(${r})`:r},Dx=(e,t)=>{if(!tR(e=rN(e),{method:"map",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})||e.typeArguments||e.typeParameters)return;let r=((e,t)=>{var r;let n;if(tR(e=rN(e),{method:"split",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})&&!(!Dy(e.arguments[0],"&")||of(e.callee.object,t)||(n=eV(r=e.callee.object,t.sourceCode.getScope(r)))&&"string"!=typeof n.value))return e})(e.callee.object,t);if(!r)return;let[n]=e.arguments,o="ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||n.async||n.generator||1!==n.params.length||"Identifier"!==n.params[0].type?void 0:"BlockStatement"!==n.body.type?{parameter:n.params[0],returnExpression:n.body}:1===n.body.body.length&&"ReturnStatement"===n.body.body[0].type&&n.body.body[0].argument?{parameter:n.params[0],returnExpression:n.body.body[0].argument}:void 0;if(o&&((e,t,r)=>{let n;return!!tR(e=rN(e),{method:"split",minimumArguments:1,maximumArguments:2,computed:!1,optionalCall:!1,optionalMember:!1})&&!!oT(rN(e.callee.object),t)&&!!Dy(e.arguments[0],"=")&&(1===e.arguments.length||2===(n=e.arguments[1],eV(n,r.sourceCode.getScope(n))?.value))})(o.returnExpression,o.parameter,t))return{node:e,query:r.callee.object}},Db=(e,t)=>`new URLSearchParams(${Dh(e,t)})`,DE=(e,t,r,n)=>{let{sourceCode:o}=n,[a,i]=o.getRange(e),[s,l]=tn(t,n);return o.text.slice(a,s)+r+o.text.slice(l,i)},Dv=(e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=tn(t,r);return[[n,a],[i,o]]},DS=({node:e,query:t,replacement:r,preservedNodes:n=[t]},o)=>{let a=(({node:e,replacement:t,preservedNodes:r},n)=>{let o;if(!(!(!(o=eS(n.sourceCode.getScope(e),"URLSearchParams"))||o.defs.every(e=>Df(e))||o.defs.some(e=>(e=>{if("ImportBinding"!==e.type)return!1;let{node:t,parent:r}=e;return Dm.has(r.source.value)&&"type"!==r.importKind&&"ImportSpecifier"===t.type&&"type"!==t.importKind&&"Identifier"===t.imported.type&&"URLSearchParams"===t.imported.name})(e)))||rU(n,e,r)))return[{messageId:Dd,data:{replacement:t},fix:r=>r.replaceText(e,t)}]})({node:e,replacement:r,preservedNodes:n},o);if(a)return{node:e,messageId:Dc,suggest:a}},DC="no-unsafe-promise-all-settled-values",DD=new i(["PromiseSettledResult","PromiseRejectedResult"]),DT=new i(["PromiseFulfilledResult"]),DA=new i(["ChainExpression","ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),Dw=e=>e?.type==="ArrowFunctionExpression"||e?.type==="FunctionExpression"||e?.type==="FunctionDeclaration",Dk=e=>{for(;e&&DA.has(e.type);)e=e.expression;return e},DI=e=>tR(Dk(e),{object:"Promise",method:"allSettled",argumentsLength:1,optionalCall:!1,optionalMember:!1}),Dj=e=>e?.parent.type==="ReturnStatement"&&e.parent.argument===e,DF=e=>tR(Dk(e),{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1});function DB(e){return"Identifier"===e.type?e.name:"TSQualifiedName"===e.type?DB(e.right):void 0}function DR(e){for(e=e?.type==="TSTypeAnnotation"?e.typeAnnotation:e;e?.type==="TSParenthesizedType"||e?.type==="TSTypeOperator";)e=e.typeAnnotation;return e?.type==="TSArrayType"?e.elementType:e?.type==="TSTypeReference"&&"Identifier"===e.typeName.type&&("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)?e.typeArguments?.params[0]??e.typeParameters?.params[0]:void 0}function DP(e){return function e(t){if(t?.type==="TSTypeReference"){let e=DB(t.typeName);return DD.has(e)}return t?.type==="TSUnionType"&&t.types.some(t=>e(t))}(DR(e))}function DL(e){return function e(t){if(t?.type==="TSTypeReference"){let e=DB(t.typeName);return DT.has(e)}return t?.type==="TSUnionType"&&t.types.every(t=>e(t))}(DR(e))}function DN(e){if(e.isUnion())return e.types.every(e=>DN(e));let t=e.aliasSymbol??e.getSymbol();return DT.has(t?.getName())}function D$(e,t){if((e=t.getNonNullableType(e)).isUnion()){let r=e.types.map(e=>D$(e,t));return r.every(Boolean)?t.getUnionType(r):void 0}if(t.isArrayType(e)||t.isTupleType(e))return t.getTypeArguments(e)[0]}function DM(e,t){let{parserServices:r}=t.sourceCode;if(r?.program)try{return{checker:r.program.getTypeChecker(),type:r.getTypeAtLocation(e)}}catch{}}let DO=e=>e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion";function Dq(e,t,r=new i){var n;let o;return!!(DO(o=e)&&DP(o.typeAnnotation))||!!(e=Dk(e))&&(n=Dk(n=e),!!(n?.type==="AwaitExpression"&&DI(n.argument)||DP(e.typeAnnotation)||function(e,t){let r=DM(e,t);if(!r)return!1;let{type:n,checker:o}=r,a=D$(n,o);return!!(a&&function e(t){if(t.isUnion())return t.types.some(t=>e(t));let r=t.aliasSymbol??t.getSymbol();return DD.has(r?.getName())}(a))}(e,t))||(DF(e)?Dq(e.callee.object,t,r):"Identifier"===e.type&&function(e,t,r){let n=eS(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return!1;r.add(n);let[o]=n.defs,a=!!(DP(o.name?.typeAnnotation)||"Variable"===o.type&&"const"===o.parent.kind&&o.node.id===o.name&&o.node.init&&Dq(o.node.init,t,r));return r.delete(n),a}(e,t,r)))}let DU=e=>(e=Dk(e),e?.type==="Identifier"?e.name:void 0),DW=e=>{if(e=Dk(e),e?.type==="ObjectPattern"){for(let t of e.properties)if("Property"===t.type&&!t.computed&&"status"===ez(t)&&"Identifier"===t.value.type)return t.value}},DV=e=>{if(e?.type==="Literal"&&("fulfilled"===e.value||"rejected"===e.value))return e.value};function D_(e,t){return e=Dk(e),!!(t.statusVariable&&D0(e,t.statusVariable,t.context)||!t.statusVariable&&t.statusName&&e?.type==="Identifier"&&e.name===t.statusName||t.entryVariable&&e?.type==="MemberExpression"&&D0(e.object,t.entryVariable,t.context)&&"status"===ez(e))||!!(!t.entryVariable&&t.entryName&&e?.type==="MemberExpression"&&DU(e.object)===t.entryName&&"status"===ez(e))}function Dz(e,t){if(e=Dk(e),e?.type!=="BinaryExpression"||!["===","==","!==","!="].includes(e.operator))return;let r=D_(e.left,t)?DV(e.right):D_(e.right,t)?DV(e.left):void 0;if(!r)return;let n="==="===e.operator||"=="===e.operator;return n&&"fulfilled"===r||!n&&"rejected"===r?"fulfilled":"unfulfilled"}function DK(e,t){return"fulfilled"===Dz(e=Dk(e),t)||e?.type==="LogicalExpression"&&"&&"===e.operator&&(DK(e.left,t)||DK(e.right,t))}function DG(e,t){return"unfulfilled"===Dz(e=Dk(e),t)||e?.type==="LogicalExpression"&&"||"===e.operator&&(DG(e.left,t)||DG(e.right,t))}let DJ=(e,t,r)=>"ConditionalExpression"===e.type&&(e.consequent===t&&DK(e.test,r)||e.alternate===t&&DG(e.test,r)),DX=(e,t,r)=>"LogicalExpression"===e.type&&("&&"===e.operator&&e.right===t&&DK(e.left,r)||"||"===e.operator&&e.right===t&&DG(e.left,r)),DY=(e,t,r)=>"IfStatement"===e.type&&(e.consequent===t&&DK(e.test,r)||e.alternate===t&&DG(e.test,r)),DH=e=>{let t;if(!Dw(e)||0===e.params.length)return!1;let r={entryName:DU(e.params[0]),statusName:(t=e.params[0],DW(t)?.name)},n=Dk(e.body);if(n?.type==="BlockStatement"){let[e]=n.body;return 1===n.body.length&&"ReturnStatement"===e.type&&e.argument&&DK(e.argument,r)}return DK(n,r)};function DQ(e){if(e=Dk(e),e?.type==="ObjectPattern"){for(let t of e.properties)if("Property"===t.type&&!t.computed&&"value"===ez(t))return t}}let DZ=(e,t)=>"MemberExpression"===e.type&&"property"===t&&!e.computed||["Property","PropertyDefinition","MethodDefinition"].includes(e.type)&&"key"===t&&!e.computed;function D0(e,t,r){return e=Dk(e),e?.type==="Identifier"&&t&&eS(r.sourceCode.getScope(e),e)===t}function D1(e){for(e=Dk(e);DF(e);){if(DH(e.arguments[0]))return!0;e=Dk(e.callee.object)}return!1}function D2(e,t,{knownPromiseSettledResultArray:r=!1,branchAlwaysExits:n}={}){let o,a;if(!tR(e,{method:"map",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||!r&&!Dq(e.callee.object,t)||function e(t,r,n=new i){return!!(DO(t)&&DL(t.typeAnnotation)||function(e,t){let r=DM(e,t);if(!r)return!1;let{type:n,checker:o}=r,a=D$(n,o);return!!(a&&DN(a))}(t=Dk(t),r))||("Identifier"===t.type?function(t,r,n){let o=eS(r.sourceCode.getScope(t),t);if(!o||n.has(o)||1!==o.defs.length)return!1;n.add(o);let[a]=o.defs,i=!!(DL(a.name?.typeAnnotation)||"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&e(a.node.init,r,n));return n.delete(o),i}(t,r,n):DF(t)&&D1(t)&&Dq(t,r))}(e.callee.object,t))return;let[s]=e.arguments;if(!Dw(s)||0===s.params.length)return;let[l]=s.params;if(function(e,t){let r=DM(e,t);if(!r)return!1;let{type:n}=r;return DN(n)}(l,t))return;let u=DQ(l);if(u&&"Identifier"!==u.value.type)return{node:u.key,messageId:DC};let p=DU(l),c=p&&eS(t.sourceCode.getScope(l),l),d=(o=DQ(l),a=o?.value,a?.type==="Identifier"?a:a?.type==="AssignmentPattern"&&"Identifier"===a.left.type?a.left:void 0),m=d&&eS(t.sourceCode.getScope(d),d),f=DW(l),g=f?.name,y=f&&eS(t.sourceCode.getScope(f),f),h=function e(t,r){var n;if(n=t=Dk(t),n=Dk(n),(n?.type==="MemberExpression"&&D0(n.object,r.entryVariable,r.context)&&"value"===ez(n)||n?.type==="Identifier"&&D0(n,r.valueVariable,r.context))&&!function(e,t){for(let r=e,n=e.parent;n&&"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type;r=n,n=n.parent){if(DJ(n,r,t)||DX(n,r,t)||DY(n,r,t)||function(e,t,r,n){let o,a=e.parent?.body;if(!Array.isArray(a))return!1;let i=a.indexOf(e),s=a[i-1];return s?.type==="IfStatement"&&!s.alternate&&DG(s.test,t)&&(o=s.consequent,aA(o,r,e=>{var t;return t=Dk(t=e),t?.type==="ReturnStatement"||t?.type==="ThrowStatement"||n(e)})||af(o,r))}(n,t,t.context,t.branchAlwaysExits))return!0;if(Dj(n))break}return!1}(t,r))return t;for(let[n,o]of Object.entries(t)){if("parent"===n||DZ(t,n)||!o||"object"!=typeof o)continue;let a=function(t,r){for(let n of t){if(!n?.type||Dw(n)||"ClassExpression"===n.type||"ClassDeclaration"===n.type)continue;let t=e(n,r);if(t)return t}}(Array.isArray(o)?o:[o],r);if(a)return a}}(s.body,{entryName:p,entryVariable:c,statusName:g,statusVariable:y,valueVariable:m,context:t,branchAlwaysExits:n});if(h)return{node:h,messageId:DC}}let D3="prefer-abort-signal-any",D8="prefer-abort-signal-any/suggestion",D6=new i(["reason","throwIfAborted"]),D9=new i(["capture","once","passive"]),D5=new i(["TSAsExpression","TSTypeAssertion","TSSatisfiesExpression"]),D4=e=>{let t=Array.isArray(e.parent.body)?e.parent.body:Array.isArray(e.parent.consequent)?e.parent.consequent:void 0;if(t)return t[t.indexOf(e)+1]},D7=(e,t,r)=>{let{sourceCode:n}=e,[,o]=n.getRange(t),[a]=n.getRange(r);return n.getAllComments().some(e=>{let[t,r]=n.getRange(e);return t>=o&&r<=a})},Te=e=>{let t=e,{parent:r}=e;for(;rL(r);)t=r,r=r.parent;return{expression:t,parent:r}},Tt=(e,t)=>{let{parent:r}=e;if(!(!tF(r,{property:"signal",computed:!1,optional:!1})||r.object!==e||nG(r)||("ForInStatement"===r.parent.type||"ForOfStatement"===r.parent.type)&&r.parent.left===r||((e,t)=>{let{expression:r,parent:n}=Te(e);return tF(n)&&n.object===r&&D6.has(ez(n,t.sourceCode.getScope(n)))})(r,t)||(e=>{let{expression:t,parent:r}=Te(e);return"VariableDeclarator"===r.type&&r.init===t||"AssignmentExpression"===r.type&&r.right===t})(r)||rV(t,t.sourceCode.getRange(r))))return r},Tr=(e,t,r)=>{if(r5.has(e.intrinsicName))return;if(r4.has(e.intrinsicName))return!1;if(e.isUnion()){let n=e.types.filter(e=>!r4.has(e.intrinsicName));if(0===n.length)return!1;let o=n.map(e=>Tr(e,t,r));return!!o.every(Boolean)||!o.every(e=>!1===e)&&void 0}if(e.isIntersection()){let n=e.types.map(e=>Tr(e,t,r));return!!n.some(Boolean)||!n.every(e=>!1===e)&&void 0}let n=t.getBaseConstraintOfType(e);if(n&&n!==e)return Tr(n,t,r);let o=r7(e);if(o&&ne(o,r))return"AbortSignal"===o.getName();let a=nt(e,t).map(e=>Tr(e,t,r));return!!a.some(Boolean)||!(a.length>0&&a.every(e=>!1===e))&&void 0},Tn=(e,t)=>tb(e,{optional:!1},ty)&&tF(e.callee,{object:"AbortSignal",properties:t,computed:!1,optional:!1}),To=e=>Tn(e,["any","timeout"]),Ta=e=>Tn(e,["any"]),Ti=(e,t)=>{if("Identifier"!==(e=rN(e)).type)return;let r=eS(t.sourceCode.getScope(e),e),n=r?.defs[0];if(r&&1===r.defs.length&&"Variable"===n.type&&"const"===n.parent.kind)return n.node.init},Ts=(e,t)=>{if("Identifier"!==(e=rN(e)).type)return!1;let r=eS(t.sourceCode.getScope(e),e),n=r?.defs[0];if(!r||1!==r.defs.length||"Variable"!==n.type||"const"!==n.parent.kind||!n.node.init)return!1;let[,o]=t.sourceCode.getRange(n.node.init),[a]=t.sourceCode.getRange(e);return r.references.some(r=>{if(r.init||r.identifier===e)return!1;let[n]=t.sourceCode.getRange(r.identifier);return n>o&&n<a})},Tl=(e,t,r)=>tb(e,{optional:!1},ty)&&tF(e.callee,{object:"Array",property:t,computed:!1,optional:!1})&&oA(e.callee.object,r),Tu=(e,t)=>(tb(e,{name:"Array",optional:!1},ty)||tE(e,{name:"Array"}))&&oA(e.callee,t),Tp=(e,t,r=new i)=>{if(e=rN(e),r.has(e))return!1;if(r.add(e),"SpreadElement"===e.type)return!0;if("ArrayExpression"===e.type)return e.elements.some(e=>e&&Tp(e,t,r));if(Tl(e,"of",t)||Tu(e,t))return e.arguments.some(e=>Tp(e,t,r));if(Tl(e,"from",t)){if(1!==e.arguments.length)return!0;let[n]=e.arguments;if("SpreadElement"===n.type)return!0;let o=Ti(n,t);if(o)return!!(!nj(o,t)||Ts(n,t))||Tp(o,t,r);let a=rN(n);return"ArrayExpression"!==a.type||Tp(a,t,r)}if(Ta(e))return e.arguments[0]&&Tp(e.arguments[0],t,r);let n=Ti(e,t);return n?!!(nj(n,t)&&Ts(e,t))||Tp(n,t,r):Tn(rN(e),["abort"])},Tc=(e,t,r,n=new i)=>{var o;if(e=rN(e),n.has(e))return!1;if(n.add(e),"SpreadElement"===e.type)return!0;if("ArrayExpression"===e.type)return e.elements.some(e=>e&&Tc(e,t,r,n));if(Tl(e,"of",r)||Tu(e,r))return e.arguments.some(e=>Tc(e,t,r,n));if(Tl(e,"from",r)){if(1!==e.arguments.length)return!0;let[o]=e.arguments;if("SpreadElement"===o.type)return!0;let a=Ti(o,r);if(a)return!!(!nj(a,r)||Ts(o,r))||Tc(a,t,r,n);let i=rN(o);return"ArrayExpression"!==i.type||Tc(i,t,r,n)}if(Ta(e))return e.arguments[0]&&Tc(e.arguments[0],t,r,n);let a=Ti(e,r);return a?!!(nj(a,r)&&Ts(e,r))||Tc(a,t,r,n):tF(o=rN(o=e),{property:"signal",computed:!1,optional:!1})&&"Identifier"===o.object.type&&o.object.name===t},Td=(e,t)=>{let r=((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return Tr(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e=rN(e),t);if(!0===r)return!0;if(!1===r||t.sourceCode.parserServices?.program)return!1;if("Identifier"===e.type){let t;return"signal"===(t=e.name)||t.endsWith("Signal")}return To(e)},Tm=(e,t)=>"Identifier"===(e=rN(e)).type?Td(e,t):To(e)&&e.arguments.every(e=>"SpreadElement"!==e.type&&!eH(e,t.sourceCode)),Tf=(e,t)=>{if(!Tl(e,"from",t)||1!==e.arguments.length)return;let[r]=e.arguments;if("SpreadElement"===r.type)return;let n=rN(r);if("ArrayExpression"===n.type)return n;let o=Ti(r,t);if(o&&nj(o,t)&&!Ts(r,t))return o},Tg=(e,t,r=new i)=>{if(e=rN(e),r.has(e))return;if(r.add(e),"ArrayExpression"===e.type)return e.elements.every(e=>e&&"SpreadElement"!==e.type)?e.elements:void 0;if(Tl(e,"of",t)||Tu(e,t))return e.arguments.every(e=>"SpreadElement"!==e.type)?e.arguments:void 0;let n=Tf(e,t);if(n)return Tg(n,t,r);let o=Ti(e,t);if(o&&nj(o,t)&&!Ts(e,t))return Tg(o,t,r)},Ty=(e,t,r=new i)=>{if(e=rN(e),r.has(e))return!1;if(r.add(e),"Identifier"===e.type||"ArrayExpression"===e.type||Tl(e,"of",t)||Tu(e,t))return!0;let n=Tf(e,t);return!!n&&Ty(n,t,r)},Th=e=>"Identifier"===e.type?e.name:"TSQualifiedName"===e.type?Th(e.right):void 0,Tx=(e,t,r=new i)=>{if(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")return Tx(e.typeAnnotation,t,r);if(e?.type!=="TSTypeReference")return!1;var n=e;let o=Th(n.typeName);if("AbortSignal"===o)return!0;if(!o||"Identifier"!==n.typeName.type||r.has(n.typeName.name))return!1;r.add(n.typeName.name);let a=eS(t.sourceCode.getScope(n),n.typeName),s=a?.defs[0],l=s?.type==="Type"&&"TSTypeAliasDeclaration"===s.node.type&&Tx(s.node.typeAnnotation,t,r);return r.delete(n.typeName.name),l},Tb=(e,t,r=new i)=>(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")?Tb(e.typeAnnotation,t,r):e?.type==="TSTypeOperator"?"readonly"===e.operator?Tb(e.typeAnnotation,t,r):void 0:e?.type==="TSArrayType"?Tx(e.elementType,t,r):e?.type==="TSTupleType"?e.elementTypes.length>0&&e.elementTypes.every(e=>Tx("TSNamedTupleMember"===e.type?e.elementType:e,t,r)):e?.type==="TSTypeReference"?((e,t,r)=>{let n,o=Th(e.typeName),a=e.typeArguments?.params??e.typeParameters?.params;if(("Array"===o||"ReadonlyArray"===o)&&a?.length===1)return Tx(a[0],t,r);if(!o||"Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let i=eS(t.sourceCode.getScope(e),e.typeName),s=i?.defs[0];return s?.type==="Type"&&"TSTypeAliasDeclaration"===s.node.type&&(n=Tb(s.node.typeAnnotation,t,r)),r.delete(e.typeName.name),n})(e,t,r):void 0,TE=(e,t,r=new i)=>{if(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")return TE(e.typeAnnotation,t,r);if(e?.type==="TSTypeOperator")return"readonly"===e.operator&&("TSArrayType"===e.typeAnnotation.type||"TSTupleType"===e.typeAnnotation.type);if(e?.type!=="TSTypeReference")return!1;if("ReadonlyArray"===Th(e.typeName))return!0;if("Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let n=eS(t.sourceCode.getScope(e),e.typeName),o=n?.defs[0];return o?.type==="Type"&&"TSTypeAliasDeclaration"===o.node.type&&TE(o.node.typeAnnotation,t,r)},Tv=(e,t,r,n=new i)=>{if(!e||r5.has(e.intrinsicName)||r4.has(e.intrinsicName)||n.has(e))return!1;if(n.add(e),e.isUnion()||e.isIntersection())return e.types.some(e=>Tv(e,t,r,n));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return Tv(o,t,r,n);let a=r7(e);if(a&&ne(a,r)&&"ReadonlyArray"===a.getName())return!0;let s=t.typeToString(e);return!!(s.startsWith("readonly ")||s.startsWith("ReadonlyArray<"))||nt(e,t).some(e=>Tv(e,t,r,n))},TS=(e,t)=>{if(D5.has(e.type)){let r;return r=e.typeAnnotation,r?.type==="TSTypeReference"&&"const"===Th(r.typeName)||TE(e.typeAnnotation,t)||TS(e.expression,t)}if("Identifier"!==(e=rN(e)).type)return!1;let r=eS(t.sourceCode.getScope(e),e),n=r?.defs[0];return!!(n?.name?.typeAnnotation&&TE(n.name.typeAnnotation,t)||n?.type==="Variable"&&n.node.init&&TS(n.node.init,t)||((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r;return Tv(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{return!1}})(e,t))},TC=(e,t,r=new i)=>{if(r.has(e))return!1;if(r.add(e),D5.has(e.type))return Tb(e.typeAnnotation,t)??TC(e.expression,t,r);if("Identifier"===(e=rN(e)).type){let n=eS(t.sourceCode.getScope(e),e),o=n?.defs[0];if(o?.name?.typeAnnotation){let e=Tb(o.name.typeAnnotation,t);if(void 0!==e)return e}if(o?.type==="Variable"&&o.node.init&&TC(o.node.init,t,r))return!0}return nj(e,t)},TD=(e,t,r,n)=>{var o,a;let i,s=!e||"ArrowFunctionExpression"!==e.type&&"FunctionExpression"!==e.type||e.async||e.generator||e.params.length>0?void 0:"BlockStatement"!==e.body.type?e.body:1===e.body.body.length&&"ExpressionStatement"===e.body.body[0].type?e.body.body[0].expression:void 0;if(tb(s,{optional:!1},ty)&&tF(s.callee,{property:"abort",computed:!1,optional:!1})&&"Identifier"===s.callee.object.type&&s.callee.object.name===t&&(0===s.arguments.length||1===s.arguments.length&&(i=s.arguments[0],tF(i,{property:"reason",computed:!1,optional:!1})&&(o=i.object,a=r,o=rN(o),a=rN(a),"Identifier"===o.type&&"Identifier"===a.type&&o.name===a.name&&eS(n.sourceCode.getScope(o),o)===eS(n.sourceCode.getScope(a),a)))))return s.callee.object},TT=e=>{var t;if(e?.type!=="ExpressionStatement")return;let{expression:r}=e;if(tb(r,{minimumArguments:2,maximumArguments:3,optional:!1},ty)&&tF(r.callee,{property:"addEventListener",computed:!1,optional:!1})&&"abort"===tu(rN(r.arguments[0]))&&(!(t=r.arguments[2])||"Literal"===(t=rN(t)).type&&"boolean"==typeof t.value||"ObjectExpression"===t.type&&t.properties.every(e=>{if("Property"!==e.type||e.computed||"init"!==e.kind||e.method||e.shorthand||"Literal"!==e.value.type||"boolean"!=typeof e.value.value)return!1;let t="Identifier"===e.key.type?e.key.name:e.key.value;return D9.has(t)})))return{call:r,sourceSignal:r.callee.object}},TA=(e,t)=>!rV(t,t.sourceCode.getRange(e))&&!rW(t,e),Tw=(e,t,r,n)=>{let o=eS(n.sourceCode.getScope(r),e);return o&&o!==t},Tk="prefer-block-statement-over-iife",TI=e=>"ThisExpression"===e.type||"MetaProperty"===e.type&&"new"===e.meta.name&&"target"===e.property.name||"Identifier"===e.type&&"arguments"===e.name,Tj=(e,t)=>e!==t&&tw(e),TF=(e,t)=>Tj(e,t)&&"ArrowFunctionExpression"!==e.type;function TB(e,t,r,n=Tj){return function o(a){if(r(a))return!0;if(n(a,e))return!1;for(let e of t[a.type]??[]){let t=a[e];for(let e of Array.isArray(t)?t:[t])if(e?.type&&o(e))return!0}return!1}(e)}let TR=(e,t)=>{let[r,n]=t.getRange(e),o=t.getLastToken(e);return[r,eA(o)?t.getRange(o)[1]:n]},TP="no-multiple-promise-resolver-calls",TL=e=>rL(e)||e?.type==="TSInstantiationExpression",TN=e=>"ReturnStatement"===e.type||"ThrowStatement"===e.type;function T$(e){for(;TL(e.parent)&&e.parent.expression===e;)e=e.parent;return e}function TM(e){for(;TL(e);)e=e.expression;return e}let TO=(e,t)=>{if(!(("FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type)&&!e.generator))return!1;let r=T$(e);return tE(r.parent,{name:"Promise",argumentsLength:1})&&r.parent.arguments[0]===r&&oA(r.parent.callee,t)},Tq=e=>e.references.some(e=>e.isWrite()),TU=(e,t)=>{if("CallExpression"!==e.type)return;let r=TM(e.callee);return"Identifier"===r.type?t.get(r):void 0},TW=(e,t)=>"ExpressionStatement"===e.type&&"CallExpression"===e.expression.type&&0===e.expression.arguments.length&&!!TU(e.expression,t);function TV(e){let t=[];return e.traverseSegments(e=>{e.reachable&&t.push(e)}),t}let T_=({isTerminated:e=!1,resolverUncalled:t=!1,resolverCalled:r=!1,catchClausesAfterResolverCall:n=new i,pendingFinallyBlocksByCatchClause:a=new o}={})=>({isTerminated:e,resolverUncalled:t,resolverCalled:r,catchClausesAfterResolverCall:n,pendingFinallyBlocksByCatchClause:a}),Tz=e=>T_({isTerminated:e.isTerminated,resolverUncalled:e.resolverUncalled,resolverCalled:e.resolverCalled,catchClausesAfterResolverCall:new i(e.catchClausesAfterResolverCall),pendingFinallyBlocksByCatchClause:function(e){let t=new o;for(let[r,n]of e)t.set(r,new i(n));return t}(e.pendingFinallyBlocksByCatchClause)}),TK=(e,t,r)=>{if(e.isTerminated)return e;if(t.executor===r){let r=Tz(e);for(let[e,n]of r.pendingFinallyBlocksByCatchClause)t.finallyBlocks.some(e=>n.has(e))&&r.catchClausesAfterResolverCall.add(e);return r.resolverCalled=e.resolverUncalled||e.resolverCalled,r.resolverUncalled=!1,r}if(t.executor)return e;let n=Tz(e);if(t.catchClause){if(e.resolverUncalled){let e=n.pendingFinallyBlocksByCatchClause.get(t.catchClause);for(let r of(e||(e=new i,n.pendingFinallyBlocksByCatchClause.set(t.catchClause,e)),t.finallyBlocks))e.add(r)}e.resolverCalled&&n.catchClausesAfterResolverCall.add(t.catchClause)}return n};function TG(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let TJ=(e,t)=>void 0!==t&&e.isTerminated===t.isTerminated&&e.resolverUncalled===t.resolverUncalled&&e.resolverCalled===t.resolverCalled&&TG(e.catchClausesAfterResolverCall,t.catchClausesAfterResolverCall)&&function(e,t){if(e.size!==t.size)return!1;for(let[r,n]of e){let e=t.get(r);if(!e||!TG(n,e))return!1}return!0}(e.pendingFinallyBlocksByCatchClause,t.pendingFinallyBlocksByCatchClause);function TX(e){let t=[],r=e,{parent:n}=e;for(;n&&!tw(n);){if("TryStatement"===n.type){if(n.block===r&&n.handler)return{catchClause:n.handler,finallyBlocks:t};n.finalizer&&(n.block===r||n.handler===r)&&t.push(n.finalizer)}r=n,{parent:n}=n}return{catchClause:void 0,finallyBlocks:t}}function TY(e,t,r){let n=T_({isTerminated:e!==r.codePath.initialSegment,resolverUncalled:e===r.codePath.initialSegment});for(let o of e.prevSegments){let a=function(e,t,r,n){if(!t.reachable||n.terminatedSegments.has(t)||e.isTerminated||n.ignoredLoopEdges.some(e=>e.previousSegment===t&&e.segment===r))return T_({isTerminated:!0});let o=n.catchClausesBySegment.get(r);return o?T_({resolverUncalled:e.pendingFinallyBlocksByCatchClause.has(o),resolverCalled:e.catchClausesAfterResolverCall.has(o)}):e}(t.get(o)??T_(),o,e,r);if(!a.isTerminated){for(let e of(n.isTerminated=!1,n.resolverUncalled||=a.resolverUncalled,n.resolverCalled||=a.resolverCalled,a.catchClausesAfterResolverCall))n.catchClausesAfterResolverCall.add(e);for(let[e,t]of a.pendingFinallyBlocksByCatchClause){let r=n.pendingFinallyBlocksByCatchClause.get(e);for(let o of(r||(r=new i,n.pendingFinallyBlocksByCatchClause.set(e,r)),t))r.add(o)}}}return n}let TH=e=>{let t=TM(e.test);return t?.type==="Literal"&&!t.value},TQ=e=>{let t=T$(e);return t.parent?.type==="AwaitExpression"&&t.parent.argument===t};function TZ(e,t){let r=e,{parent:n}=e;for(;n;){if("AssignmentPattern"===n.type&&n.right===r&&TO(n.parent,t)&&n.parent.params.slice(0,2).includes(n))return!0;r=n,{parent:n}=n}return!1}let T0=(e,t,r)=>"SequenceExpression"===e.type&&e.expressions.includes(t)||"LogicalExpression"===e.type&&e.left===t||"BinaryExpression"===e.type&&(e.left===t||e.right===t)||"UnaryExpression"===e.type&&e.argument===t||"AwaitExpression"===e.type&&e.argument===t||"ConditionalExpression"===e.type&&aA(e,r,TN)||TL(e)&&e.expression===t||"CallExpression"===e.type&&(e.callee===t||e.arguments.includes(t)&&!e.optional&&!oZ(e.callee))||"NewExpression"===e.type&&(e.callee===t||e.arguments.includes(t))||"MemberExpression"===e.type&&(e.object===t||e.computed&&e.property===t&&!e.optional&&!oZ(e.object)),T1=(e,t)=>af(e,t),T2=(e,t)=>"class-static-block"===e.origin||"class-field-initializer"===e.origin&&t.parent?.type==="PropertyDefinition"&&t.parent.value===t&&t.parent.static,T3="no-unnecessary-string-trim",T8=["startsWith","endsWith"],T6=new i(["bigint","boolean","number","string","undefined"]),T9=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),T5=(e,t)=>eV(e=rN(e),t.sourceCode.getScope(e)),T4="no-useless-re-export",T7=e=>"Identifier"===e.type?e.name:e.value;function Ae(e,t){let r=e.attributes??[];return`${e.source.value}\u0000${r.map(e=>t.getText(e)).join("\0")}`}let At="preferGuard",Ar="preferFallback",An="guard",Ao="fallback",Aa=["keys","values","entries"],Ai=e=>{if("ForInStatement"===e.type)return;let t=rN(e.right);if(tR(t,{object:"Object",methods:Aa,argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1}))return t},As=e=>Ai(e)?.arguments[0]??e.right,Al=e=>"ForInStatement"===e.type||!!Ai(e),Au={configs:{node:{name:"@eslint-sukka/eslint-plugin-sukka-full node preset",plugins:{get sukka(){return Au}},rules:{"sukka/unicorn/prefer-node-protocol":"error","sukka/unicorn/prefer-import-meta-properties":"error","no-process-exit":"off","sukka/unicorn/no-process-exit":"warn","no-buffer-constructor":"off","sukka/unicorn/no-new-buffer":"error"}},recommended:{...c.eslint_plugin_sukka.configs.recommended,plugins:{get sukka(){return Au}},rules:Object.assign({"sukka/array/no-unneeded-flat-map":"error","sukka/browser/prefer-location-assign":"warn","sukka/jsx/no-template-literal":"error","sukka/jsx/no-unneeded-nested":"error","sukka/string/no-locale-case":"warn","sukka/string/no-simple-template-literal":"error","sukka/unicode/no-bidi":"warn","sukka/unicode/no-invisible":"warn","sukka/no-redundant-variable":"error","sukka/no-single-return":"warn","sukka/prefer-early-return":["error",{maximumStatements:16}],"sukka/prefer-fetch":"error","sukka/prefer-timer-id":"warn"},d.collectRules(c.eslint_plugin_sukka.configs.recommended),{"sukka/prefer-single-boolean-return":"off"})},recommended_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full recommended unicorn preset",plugins:{get sukka(){return Au}},rules:{"sukka/unicorn/no-lonely-if":"error","sukka/unicorn/no-negated-condition":"warn","sukka/unicorn/catch-error-name":["error",{ignore:[/^(?:e|err|error|\w+Err|\w+Error)[\d_]?$/]}],"sukka/unicorn/custom-error-definition":"error","sukka/unicorn/require-array-join-separator":"warn","sukka/unicorn/no-thenable":"error","sukka/unicorn/no-invalid-remove-event-listener":"error","sukka/unicorn/consistent-function-scoping":"warn","sukka/unicorn/prefer-event-target":"warn","sukka/unicorn/prefer-keyboard-event-key":"warn","sukka/unicorn/prefer-text-content":"warn","sukka/unicorn/no-console-spaces":"warn","sukka/unicorn/no-empty-file":"warn","sukka/unicorn/no-useless-fallback-in-spread":"warn","sukka/unicorn/no-useless-length-check":"warn","sukka/unicorn/no-useless-promise-resolve-reject":"warn","sukka/unicorn/no-zero-fractions":"warn","sukka/unicorn/prefer-export-from":["warn",{checkUsedVariables:!1}],"sukka/unicorn/prefer-native-coercion-functions":"warn","sukka/unicorn/prefer-negative-index":"warn","sukka/unicorn/no-document-cookie":"error","sukka/unicorn/prefer-add-event-listener":"warn","sukka/unicorn/prefer-array-index-of":"warn","sukka/unicorn/prefer-blob-reading-methods":"warn","sukka/unicorn/prefer-date-now":"warn","sukka/unicorn/dom-node-dataset":"warn","sukka/unicorn/prefer-modern-math-apis":"warn","sukka/unicorn/number-literal-case":"error","sukka/unicorn/prefer-number-properties":["warn",{checkInfinity:!1}],"sukka/unicorn/prefer-reflect-apply":"warn","sukka/unicorn/prefer-set-size":"warn","sukka/unicorn/prefer-string-replace-all":"warn","sukka/unicorn/prefer-string-slice":"warn","sukka/unicorn/prefer-string-trim-start-end":"warn","sukka/unicorn/no-unreadable-iife":"warn","sukka/unicorn/throw-new-error":"warn","sukka/unicorn/escape-case":"warn","sukka/unicorn/prefer-unicode-code-point-escapes":"warn","sukka/unicorn/prefer-prototype-methods":"warn","sukka/unicorn/error-message":"error","sukka/unicorn/no-instanceof-builtins":["error",{strategy:"loose"}],"sukka/unicorn/prefer-type-error":"error","sukka/unicorn/consistent-destructuring":"warn","sukka/unicorn/new-for-builtins":"warn","sukka/unicorn/prefer-single-call":"warn","sukka/unicorn/no-static-only-class":"warn","sukka/unicorn/no-unreadable-array-destructuring":"error","sukka/unicorn/no-useless-spread":"error","sukka/unicorn/no-useless-switch-case":"warn","sukka/unicorn/no-useless-undefined":["error",{checkArguments:!1}],"sukka/unicorn/numeric-separators-style":["warn",{onlyIfContainsSeparator:!1,number:{minimumDigits:7,groupLength:3},binary:{minimumDigits:9,groupLength:4},octal:{minimumDigits:9,groupLength:4},hexadecimal:{minimumDigits:5,groupLength:2}}],"sukka/unicorn/prefer-array-find":"warn","sukka/unicorn/prefer-array-flat-map":"warn","sukka/unicorn/prefer-array-flat":"warn","sukka/unicorn/prefer-array-some":"warn","sukka/unicorn/prefer-default-parameters":"warn","sukka/unicorn/prefer-logical-operator-over-ternary":"warn","sukka/unicorn/prefer-optional-catch-binding":"error","sukka/unicorn/prefer-regexp-test":"warn","sukka/unicorn/prefer-set-has":"error","sukka/unicorn/prefer-switch":"warn","sukka/unicorn/require-number-to-fixed-digits-argument":"warn","sukka/unicorn/prefer-string-raw":"warn","sukka/unicorn/no-single-promise-in-promise-methods":"error","sukka/unicorn/no-await-in-promise-methods":"error","sukka/unicorn/no-magic-array-flat-depth":"error","sukka/unicorn/no-object-as-default-parameter":"error","sukka/unicorn/template-indent":["warn",{tags:["outdent","dedent","gql","sql","html","styled","css"],functions:["dedent","stripIndent","strip_indent","stripTags","striptags","strip_tags","stripHtml","stripHTML","strip_html"],selectors:[],comments:["HTML","html","CSS","css","indent"]}],"sukka/unicorn/no-negation-in-equality-check":"error","sukka/unicorn/no-unnecessary-slice-end":"error","sukka/unicorn/consistent-date-clone":"error","sukka/unicorn/no-accessor-recursion":"error","sukka/unicorn/no-unnecessary-array-flat-depth":"error","sukka/unicorn/no-unnecessary-array-splice-count":"error","sukka/unicorn/no-useless-error-capture-stack-trace":"error","sukka/unicorn/prefer-class-fields":"error","sukka/unicorn/prefer-bigint-literals":"error","sukka/unicorn/prefer-classlist-toggle":"warn","sukka/unicorn/require-module-attributes":"error","sukka/unicorn/no-immediate-mutation":"error","sukka/unicorn/no-useless-collection-argument":"error","sukka/unicorn/prefer-response-static-json":"error","sukka/unicorn/consistent-template-literal-escape":"error","sukka/unicorn/no-useless-iterator-to-array":"error","sukka/unicorn/prefer-simple-condition-first":"error","sukka/unicorn/switch-case-break-position":"error","sukka/unicorn/better-dom-traversing":"warn","sukka/unicorn/no-blob-to-file":"error","sukka/unicorn/no-canvas-to-image":"warn","sukka/unicorn/no-confusing-array-splice":"error","sukka/unicorn/no-duplicate-set-values":"error","sukka/unicorn/no-incorrect-query-selector":"error","sukka/unicorn/no-invalid-file-input-accept":"error","sukka/unicorn/no-late-current-target-access":"error","sukka/unicorn/no-unused-array-method-return":"error","sukka/unicorn/prefer-array-last-methods":"warn","sukka/unicorn/prefer-math-abs":"warn","sukka/unicorn/prefer-split-limit":"error","sukka/unicorn/prefer-queue-microtask":"warn","sukka/unicorn/prefer-string-pad-start-end":"warn","sukka/unicorn/require-css-escape":"warn","sukka/unicorn/require-passive-events":"warn","sukka/unicorn/class-reference-in-static-methods":["warn",{preferThis:!1,preferSuper:!1}],"sukka/unicorn/consistent-optional-chaining":"error","sukka/unicorn/explicit-timer-delay":"error","sukka/unicorn/no-confusing-array-with":"error","sukka/unicorn/no-duplicate-loops":"warn","sukka/unicorn/no-declarations-before-early-exit":"error","sukka/unicorn/no-optional-chaining-on-undeclared-variable":"error","sukka/unicorn/no-object-methods-with-collections":"error","sukka/unicorn/no-subtraction-comparison":"warn","sukka/unicorn/no-unnecessary-global-this":"warn","sukka/unicorn/no-useless-else":"error","sukka/unicorn/no-useless-recursion":"error","sukka/unicorn/prefer-add-event-listener-options":"warn","sukka/unicorn/prefer-direct-iteration":"warn","sukka/unicorn/prefer-number-is-safe-integer":"warn","sukka/unicorn/prefer-object-define-properties":"error","sukka/unicorn/prefer-object-destructuring-defaults":"warn","sukka/unicorn/prefer-single-object-destructuring":"warn","sukka/unicorn/prefer-smaller-scope":"warn","sukka/unicorn/prefer-single-array-predicate":"warn","sukka/unicorn/prefer-url-href":"error","sukka/unicorn/require-proxy-trap-boolean-return":"error","sukka/unicorn/logical-assignment-operators":"error","sukka/unicorn/no-useless-coercion":"error","sukka/unicorn/no-useless-boolean-cast":"warn","sukka/unicorn/no-useless-continue":"error","sukka/unicorn/no-useless-override":"error","sukka/unicorn/prefer-has-check":"warn","sukka/unicorn/consistent-conditional-object-spread":"error","sukka/unicorn/no-boolean-sort-comparator":"error","sukka/unicorn/no-chained-comparison":"error","sukka/unicorn/no-constant-zero-expression":"error","sukka/unicorn/no-duplicate-logical-operands":"error","sukka/unicorn/no-impossible-length-comparison":"error","sukka/unicorn/no-invalid-character-comparison":"error","sukka/unicorn/no-loop-iterable-mutation":"error","sukka/unicorn/no-selector-as-dom-name":"error","sukka/unicorn/no-array-concat-in-loop":"error","sukka/unicorn/no-array-front-mutation":"warn","sukka/unicorn/no-array-sort-for-min-max":"error","sukka/unicorn/no-useless-compound-assignment":"warn","sukka/unicorn/no-useless-delete-check":"warn","sukka/unicorn/no-useless-logical-operand":"error","sukka/unicorn/prefer-boolean-return":"warn","sukka/unicorn/prefer-flat-math-min-max":"warn","sukka/unicorn/prefer-hoisting-branch-code":"warn","sukka/unicorn/prefer-single-replace":"warn","sukka/unicorn/no-invalid-well-known-symbol-methods":"error","sukka/unicorn/no-late-event-control":"error","sukka/unicorn/prefer-abort-signal-timeout":"warn","sukka/unicorn/prefer-aggregate-error":"warn","sukka/unicorn/prefer-observer-apis":"warn","sukka/unicorn/prefer-set-methods":"warn","sukka/unicorn/prefer-toggle-attribute":"warn","sukka/unicorn/prefer-url-search-parameters":"warn","sukka/unicorn/no-unsafe-promise-all-settled-values":"error","sukka/unicorn/prefer-abort-signal-any":"warn","sukka/unicorn/prefer-block-statement-over-iife":"warn","sukka/unicorn/no-multiple-promise-resolver-calls":"error","sukka/unicorn/no-unnecessary-string-trim":"error","sukka/unicorn/no-useless-re-export":"warn","sukka/unicorn/iteration-fallback-style":"warn"}},stylistic_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full stylistic unicorn preset",plugins:{get sukka(){return Au}},rules:{"sukka/unicorn/no-nested-ternary":"warn","sukka/unicorn/filename-case":["error",{cases:{kebabCase:!0,snakeCase:!0},ignore:[/fixtures/i,/^_/,/^\./,/rc$/i,/\.(md|json|yaml|toml|yml|ini|conf|jsonc|json5)$/i]}],"sukka/unicorn/no-unnecessary-nested-ternary":"error","sukka/unicorn/no-unreadable-object-destructuring":"error","sukka/unicorn/consistent-compound-words":"warn","sukka/unicorn/default-export-style":"warn"}},recommended_extra_with_typed_lint:{...c.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint,plugins:{get sukka(){return Au}},rules:Object.assign({"sukka/string/no-unneeded-to-string":"error","sukka/type/no-force-cast-via-top-type":"error","sukka/type/no-wrapper-type-reference":"error","sukka/require-project-reference":"off","sukka/no-default-error":"off","sukka/unicorn/consistent-tuple-labels":"warn"},d.collectRules(c.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint))},recommended_react:{...c.eslint_plugin_sukka.configs.recommended_react,plugins:{get sukka(){return Au}}}},rules:Object.assign(c.eslint_plugin_sukka.rules,{"array/no-unneeded-flat-map":N,"browser/prefer-location-assign":M,"jsx/no-template-literal":q,"jsx/no-unneeded-nested":U,"string/no-locale-case":V,"string/no-simple-template-literal":_,"unicode/no-bidi":H,"unicode/no-invisible":Z,"no-redundant-variable":ee,"no-single-return":er,"prefer-early-return":eo,"prefer-fetch":ea,"prefer-timer-id":el,"string/no-unneeded-to-string":eu,"type/no-force-cast-via-top-type":ep,"type/no-wrapper-type-reference":ed,"no-default-error":em,"require-project-reference":ey},Object.fromEntries(Object.entries({"unicorn/catch-error-name":{create:e=>{let t=e.options[0],{name:r}=t,n=t.ignore.map(e=>v.isRegExp(e)?e:RegExp(e,"u")),o=e=>e===r||n.some(t=>t.test(e))||e.endsWith(r)||e.endsWith(iy(r));e.on("Identifier",t=>{if(("CatchClause"!==t.parent.type||t.parent.param!==t)&&!(("FunctionExpression"===t.parent.type||"ArrowFunctionExpression"===t.parent.type)&&t.parent.params[0]===t&&(tR(t.parent.parent,{method:"then",argumentsLength:2,optionalCall:!1})||tR(t.parent.parent,{method:"catch",argumentsLength:1,optionalCall:!1}))&&t.parent.parent.arguments.at(-1)===t.parent))return;let n=t.name;if(o(n)||o(n.replaceAll(/_+$/g,"")))return;let a=eS(e.sourceCode.getScope(t),t);if(!a||"_"===n&&0===a.references.length)return;let i=rS(r,[a.scope,...a.references.map(({from:e})=>e)]),s={node:t,messageId:d0,data:{originalName:n,fixedName:i||r}};return i&&(s.fix=t=>i0(a,i,e,t)),s})},meta:{type:"suggestion",docs:{description:"Enforce a specific parameter name in catch clauses.",recommended:!0},fixable:"code",schema:d1,defaultOptions:[{name:"error",ignore:[]}],messages:{[d0]:"The catch parameter `{{originalName}}` should be named `{{fixedName}}`."},languages:["js/js"]}},"unicorn/custom-error-definition":{create:e=>{e.on("ClassDeclaration",t=>mm(e,t)),e.on("AssignmentExpression",t=>{if("ClassExpression"===t.right.type)return mm(e,t.right)}),e.on("AssignmentExpression",e=>{if("MemberExpression"===e.left.type&&"Identifier"===e.left.object.type&&"exports"===e.left.object.name){let t=e.right;if("ClassExpression"!==t.type||!mt(t)||!t.id)return;let r=t.id.name;return e.left.property.name!==r?{node:e.left.property,messageId:d2,fix:t=>t.replaceText(e.left.property,r)}:void 0}})},meta:{type:"problem",docs:{description:"Enforce correct `Error` subclassing.",recommended:!1},fixable:"code",messages:{[d2]:"Exported error name should match error class",[d3]:"Do not pass the error message to `super()` when the class defines a `message` accessor.",[d8]:"Do not assign to `this.message` when the class defines a `message` getter without a setter.",[d6]:"Error constructors should accept `options` as the second parameter.",[d9]:"Error constructors should use `options` as the second parameter.",[d5]:"Pass the error message to `super()` as the first argument.",[d4]:"Pass `options` to `super()` as the second argument."},languages:["js/js"]}},"unicorn/no-nested-ternary":{create:e=>{e.on("ConditionalExpression",t=>{if([t.test,t.consequent,t.alternate].some(e=>"ConditionalExpression"===e.type))return;let{sourceCode:r}=e,n=r.getAncestors(t).toReversed(),o=n.findIndex(e=>"ConditionalExpression"!==e.type);return 1!==o||ta(t,e)?o>1?{node:o>2?n[o-3]:t,messageId:ix}:void 0:{node:t,messageId:ib,fix:e=>[e.insertTextBefore(t,"("),e.insertTextAfter(t,")")]}})},meta:{type:"suggestion",docs:{description:"Disallow nested ternary expressions.",recommended:!0},fixable:"code",messages:{[ix]:"Do not nest ternary expressions.",[ib]:"Nested ternary expression should be parenthesized."},languages:["js/js"]}},"unicorn/prefer-event-target":{create:e=>{e.on("Identifier",t=>{if("EventEmitter"!==t.name||("ClassDeclaration"!==t.parent.type&&"ClassExpression"!==t.parent.type||t.parent.superClass!==t)&&("NewExpression"!==t.parent.type||t.parent.callee!==t))return;let r=e.sourceCode.getScope(t);if(!function(e){if(!e)return!1;let t=function(e,t){let r=e=>e.type===t;for(;e.parent;e=e.parent)if(r(e))return e}(e,"ImportDeclaration");return!!(iv.has(t?.source.value)||"Property"===e.parent.type&&e.parent.value===e&&"Identifier"===e.parent.key.type&&"EventEmitter"===e.parent.key.name&&"ObjectPattern"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent)&&iS(e.parent.parent)&&iC(e.parent.parent.parent.init))||!!(iS(e)&&tF(e.parent.init,{property:"EventEmitter",optional:!1,computed:!1})&&iC(e.parent.init.object))}(eS(r,t)?.defs[0]?.name))return{node:t,messageId:iE}})},meta:{type:"suggestion",docs:{description:"Prefer `EventTarget` over `EventEmitter`.",recommended:"unopinionated"},messages:{[iE]:"Prefer `EventTarget` over `EventEmitter`."},languages:["js/js"]}},"unicorn/prefer-keyboard-event-key":{create:e=>{e.on("Identifier",t=>{if(iw.has(t.name)){for(let r of iB(e,t))if(r.references?.some(e=>iF(t,e.identifier)))return iR(t,r)}}),e.on("Property",t=>{let r;if("Identifier"===t.key.type&&iw.has(t.key.name)&&"Property"===(r=t.key).parent.type&&r.parent.key===r&&"ObjectPattern"===r.parent.parent.type&&!r.parent.computed){for(let r of iB(e,t))if(iL(t.key,r))return iR(t.key,r);for(let r of iB(e,t))if(iP(t.key,r))return iR(t.key,r)}})},meta:{type:"suggestion",docs:{description:"Prefer `KeyboardEvent#key` over deprecated keyboard event properties.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[iT]:"Use `.key` instead of `.{{name}}`.",[iA]:"Use `.key` with `{{key}}`."},languages:["js/js"]}},"unicorn/prefer-text-content":{create:e=>{e.on("MemberExpression",t=>{if(!tF(t,{property:"innerText"})||nz(t.object,e))return;let r=t.property;return{node:r,messageId:iN,suggest:[{messageId:i$,fix:e=>e.replaceText(r,"textContent")}]}}),e.on("Identifier",t=>{if("innerText"===t.name&&"Property"===t.parent.type&&t.parent.key===t&&!t.parent.computed&&"init"===t.parent.kind&&"ObjectPattern"===t.parent.parent.type&&t.parent.parent.properties.includes(t.parent)&&!((e,t)=>{if(nz(e,t))return!0;let{parent:r}=e;return"VariableDeclarator"===r.type?r.id===e&&r.init&&nz(r.init,t):"AssignmentExpression"===r.type&&r.left===e&&nz(r.right,t)})(t.parent.parent,e))return{node:t,messageId:iN,suggest:[{messageId:i$,fix:e=>e.replaceText(t,t.parent.shorthand?"textContent: innerText":"textContent")}]}})},meta:{type:"suggestion",docs:{description:"Prefer `.textContent` over `.innerText`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[iN]:"Prefer `.textContent` over `.innerText`.",[i$]:"Switch to `.textContent`."},languages:["js/js"]}},"unicorn/require-array-join-separator":{create:e=>{e.on("CallExpression",t=>{if(!(tR(t,{method:"join",argumentsLength:0,optionalCall:!1})||tR(t,{method:"call",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&tU(t.callee.object,{property:"join"}))||0===t.arguments.length&&nL(t.callee.object,e))return;let{sourceCode:r}=e,[n,o]=r.getLastTokens(t,2),a=1===t.arguments.length;return{loc:{start:r.getLoc(n)[a?"end":"start"],end:r.getLoc(o).end},messageId:i3,fix:r=>iO(r,t,"','",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the separator argument with `Array#join()`.",recommended:"unopinionated"},fixable:"code",messages:{[i3]:"Missing the separator argument."},languages:["js/js"]}},"unicorn/no-thenable":{create:e=>{for(let{selector:t,selectors:r,messageId:n,getNodes:o}of i7)e.on(t??r,function*(t){for(let r of o(t,e))yield{node:r,messageId:n}})},meta:{type:"problem",docs:{description:"Disallow `then` property.",recommended:"unopinionated"},messages:{[i8]:"Do not add `then` to an object.",[i6]:"Do not export `then`.",[i9]:"Do not add `then` to a class."},languages:["js/js"]}},"unicorn/no-invalid-remove-event-listener":{create:e=>{e.on("CallExpression",t=>{if(!(tR(t,{method:"removeEventListener",minimumArguments:2,optionalCall:!1})&&"SpreadElement"!==t.arguments[0].type&&("FunctionExpression"===t.arguments[1].type||"ArrowFunctionExpression"===t.arguments[1].type||tR(t.arguments[1],{method:"bind",optionalCall:!1,optionalMember:!1}))))return;let[,r]=t.arguments;return["ArrowFunctionExpression","FunctionExpression"].includes(r.type)?{node:r,loc:eR(r,e.sourceCode),messageId:se}:{node:r.callee.property,messageId:se}})},meta:{type:"problem",docs:{description:"Prevent calling `EventTarget#removeEventListener()` with the result of an expression.",recommended:"unopinionated"},messages:{[se]:"The listener argument should be a function reference."},languages:["js/js"]}},"unicorn/consistent-function-scoping":sl,"unicorn/no-new-buffer":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!tE(r,{name:"Buffer"}))return;let n=((e,t)=>{if(1!==e.length)return"from";let[r]=e;if("SpreadElement"===r.type)return;if("ArrayExpression"===r.type||"TemplateLiteral"===r.type)return"from";if(n2(r,t))return"alloc";let n=eV(r,t);if(n){let{value:e}=n;if("string"==typeof e||Array.isArray(e))return"from"}})(r.arguments,t.getScope(r));return n?{node:r,messageId:su,data:{method:n},fix:sd(r,e,n)}:{node:r,messageId:sp,suggest:["from","alloc"].map(t=>({messageId:sc,data:{replacement:t},fix:sd(r,e,t)}))}})},meta:{type:"problem",docs:{description:"Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[su]:"`new Buffer()` is deprecated, use `Buffer.{{method}}()` instead.",[sp]:"`new Buffer()` is deprecated, use `Buffer.alloc()` or `Buffer.from()` instead.",[sc]:"Switch to `Buffer.{{replacement}}()`."},languages:["js/js"]}},"unicorn/no-console-spaces":{create:e=>{let{sourceCode:t}=e,r=(r,n,o)=>{let[a,i]=t.getRange(r),s="leading"===o?a+1:i-2,l=[s,s+1];return{loc:ic(l,e),messageId:sm,data:{method:n,position:o},fix:e=>e.removeRange(l)}};e.on("CallExpression",function*(e){if(!tR(e,{object:"console",methods:["log","debug","info","warn","error"],minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let n=e.callee.property.name,{arguments:o}=e,{length:a}=o;for(let[e,i]of o.entries()){if(!ts(i)&&"TemplateLiteral"!==i.type)continue;let o=t.getText(i).slice(1,-1);0!==e&&sf(o)&&(yield r(i,n,"leading")),e!==a-1&&sg(o)&&(yield r(i,n,"trailing"))}})},meta:{type:"suggestion",docs:{description:"Do not use leading/trailing space between `console.log` parameters.",recommended:"unopinionated"},fixable:"code",messages:{[sm]:"Do not use {{position}} space between `console.{{method}}` parameters."},languages:["js/js"]}},"unicorn/no-empty-file":sh,"unicorn/no-useless-fallback-in-spread":{create:e=>{e.on("ObjectExpression",t=>{if(tD(t)&&"LogicalExpression"===t.parent.type&&t.parent.right===t&&("||"===t.parent.operator||"??"===t.parent.operator)&&"SpreadElement"===t.parent.parent.type&&t.parent.parent.argument===t.parent&&"ObjectExpression"===t.parent.parent.parent.type&&t.parent.parent.parent.properties.includes(t.parent.parent))return{node:t,messageId:sx,*fix(r,{abort:n}){let{sourceCode:o}=e,a=t.parent;if(o.getCommentsInside(a).length>0)return n();let{left:i}=a,s=ta(i,e),[,l]=s?tn(i,e):o.getRange(i),[,u]=o.getRange(a);yield r.removeRange([l,u]),(s||"SequenceExpression"!==i.type)&&(yield iM(a,r,e))}}})},meta:{type:"suggestion",docs:{description:"Disallow useless fallback when spreading in object literals.",recommended:"unopinionated"},fixable:"code",messages:{[sx]:"The empty object is useless."},languages:["js/js"]}},"unicorn/no-useless-length-check":{create:e=>{let t=[],r=new i,n=new i,o=(t,r,n)=>tR(t,{method:r,optionalCall:!1,optionalMember:!1})&&rk(n.left.object,t.callee.object)&&!nB(t.callee.object,e);e.on("BinaryExpression",e=>{if(!("BinaryExpression"===e.type&&"Literal"===e.right.type&&"0"===e.right.raw&&tF(e.left,{property:"length",optional:!1})&&tW(e.parent)))return;let{operator:t}=e;"==="===t?r.add(e):(">"===t||"!=="===t)&&n.add(e)}),e.on("LogicalExpression",e=>{tW(e)&&t.push(e)}),e.on("Program:exit",function*(){let a=new i(t.flatMap(e=>(function(e){let{operator:t}=e;return(function e(t){return[t.left,t.right].flatMap(r=>"LogicalExpression"===r.type&&r.operator===t.operator?e(r):[r])})(e).filter((e,a,i)=>(function({node:e,operator:t,siblings:a}){return"||"===t&&r.has(e)&&a.some(t=>o(t,"every",e))||"&&"===t&&n.has(e)&&a.some(t=>o(t,"some",e))})({node:e,operator:t,siblings:[i[a-1],i[a+1]].filter(Boolean)}))})(e))),{sourceCode:s}=e;for(let t of a)yield{loc:{start:s.getLoc(t.left.property).start,end:s.getLoc(t).end},messageId:r.has(t)?"zero":"non-zero",fix(r){let{left:n,right:o}=t.parent,a=tn(n,e),i=tn(o,e),s=[];return n===t?(s[0]=a[0],s[1]=i[0]):(s[0]=a[1],s[1]=i[1]),r.removeRange(s)}}})},meta:{type:"suggestion",docs:{description:"Disallow useless array length check.",recommended:"unopinionated"},fixable:"code",messages:{"non-zero":"The non-empty check is useless as `Array#some()` returns `false` for an empty array.",zero:"The empty check is useless as `Array#every()` returns `true` for an empty array."},languages:["js/js"]}},"unicorn/no-useless-promise-resolve-reject":{create:e=>{e.on("CallExpression",t=>{let{expression:r,parent:n}=sb(t);if(!(tR(t,{object:"Promise",methods:["resolve","reject"],optionalCall:!1,optionalMember:!1})&&("ArrowFunctionExpression"===n.type&&n.body===r||"ReturnStatement"===n.type&&n.argument===r||"YieldExpression"===n.type&&!n.delegate&&n.argument===r)))return;let{functionNode:o,isInTryStatement:a}=function(e){let t,r=!1;for(;e;e=e.parent){if(tw(e)){t=e;break}"TryStatement"===e.type&&(r=!0)}return{functionNode:t,isInTryStatement:r}}(t);if(o&&(o.async||function(e){if("CallExpression"===e.parent.type&&"MemberExpression"===e.parent.callee.type&&!e.parent.callee.computed&&"Identifier"===e.parent.callee.property.type){let{callee:{property:t},arguments:r}=e.parent;if(1===r.length&&["then","catch","finally"].includes(t.name)&&r[0]===e||2===r.length&&"then"===t.name&&(r[0]===e||"SpreadElement"!==r[0].type&&r[1]===e))return!0}return!1}(o)))return function(e,t){let{callee:r}=e,n=r.property.name,{parent:o}=sb(e);return{node:r,messageId:n,data:{type:"YieldExpression"===o.type?"yield":"return"},fix:t}}(t,function(e,t,r){if(e.arguments.length>1)return;let{callee:n,arguments:o}=e,{expression:a,parent:i,isAwaited:s}=sb(e),[l]=o;if(l?.type==="SpreadElement")return;let u="reject"===n.property.name,p="YieldExpression"===i.type;if(u&&(t||p&&"ExpressionStatement"!==i.parent.type))return;let c=function({callExpression:e,parent:t,expression:r,isAwaited:n,isReject:o,context:a}){return n&&!o?tn(e,a):o&&"YieldExpression"===t.type?tn(t,a):"ArrowFunctionExpression"===t.type?o?tn(r,a):e:t}({callExpression:e,parent:i,expression:a,isAwaited:s,isReject:u,context:r});if(!rU(r,c,l?[l]:[]))return function(t){let n="ArrowFunctionExpression"===i.type,o=sE(l,r);if(u){if(o||="undefined",o=`throw ${o}`,p)return t.replaceTextRange(tn(i,r),o);if(o+=";",n)return o=`{ ${o} }`,t.replaceTextRange(tn(a,r),o)}else{if(s){var c;let n;return t.replaceTextRange(tn(e,r),(n=sE(c=l,r)||"undefined",c&&"SequenceExpression"!==c.type&&16>a5(c)?`(${n})`:n))}p?o=`yield${o?" ":""}${o}`:"ReturnStatement"===i.type?o=`return${o?" ":""}${o};`:(l?.type==="ObjectExpression"&&(o=`(${o})`),o||="{}")}return t.replaceText(n?e:i,o)}}(t,a,e))})},meta:{type:"suggestion",docs:{description:"Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks",recommended:"unopinionated"},fixable:"code",messages:{resolve:"Prefer `{{type}} value` over `{{type}} Promise.resolve(value)`.",reject:"Prefer `throw error` over `{{type}} Promise.reject(error)`."},languages:["js/js"]}},"unicorn/no-zero-fractions":{create:e=>{e.on("Literal",t=>{if(!tp(t))return;let{raw:r}=t,n=r.match(/^(?<before>[\d_]*)(?<dotAndFractions>\.[\d_]*)(?<after>.*)$/);if(!n)return;let{before:o,dotAndFractions:a,after:i}=n.groups,s=(o+a.replaceAll(/[.0_]+$/g,"")||"0")+i;if(s===r)return;let l="."===a,{sourceCode:u}=e,p=u.getRange(t)[0]+o.length+a.length;return{loc:ic([p-(r.length-s.length),p],e),messageId:l?sS:sv,*fix(r){let n=s;"MemberExpression"===t.parent.type&&t.parent.object===t&&a7.test(s)&&!ta(t,e)&&(n=`(${n})`,aL(u.getTokenBefore(t),e,n)&&(n=`;${n}`)),yield r.replaceText(t,n),yield iG(r,t,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow number literals with zero fractions or dangling dots.",recommended:"unopinionated"},fixable:"code",messages:{[sv]:"Don't use a zero fraction in the number.",[sS]:"Don't use a dangling dot in the number."},languages:["js/js"]}},"unicorn/prefer-export-from":sF,"unicorn/prefer-native-coercion-functions":{create:e=>{e.on(tA,t=>{if(t.async||t.generator||t.returnType?.type==="TSTypeAnnotation"&&"TSTypePredicate"===t.returnType.typeAnnotation.type||0===t.params.length||"Identifier"!==t.params[0].type||("MethodDefinition"===t.parent.type&&("constructor"===t.parent.kind||"set"===t.parent.kind)||"Property"===t.parent.type&&"set"===t.parent.kind)&&t.parent.value===t)return;let r=function(e){if(("ArrowFunctionExpression"===e.type&&"Identifier"===e.body.type&&e.body.name===e.params[0].name||"BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type&&e.body.body[0].argument?.type==="Identifier"&&e.body.body[0].argument.name===e.params[0].name)&&"CallExpression"===e.parent.type&&!e.parent.optional&&e.parent.arguments[0]===e&&"MemberExpression"===e.parent.callee.type&&!e.parent.callee.computed&&!e.parent.callee.optional&&"Identifier"===e.parent.callee.property.type&&sP.has(e.parent.callee.property.name))return{replacementFunction:"Boolean",fix:t=>t.replaceText(e,"Boolean")}}(t)||function(e){let t,r=(t=e.params[0].name,"ArrowFunctionExpression"===e.type&&sL(e.body,t)?e.body:"BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type&&sL(e.body.body[0].argument,t)?e.body.body[0].argument:void 0);if(!r)return;let{name:n}=r.callee,o={replacementFunction:n};return"FunctionDeclaration"===e.type||1!==r.arguments.length||(o.fix=t=>{let r=n;return"Property"===e.parent.type&&e.parent.method&&e.parent.value===e?r=`: ${r}`:"MethodDefinition"===e.parent.type&&(r=` = ${r};`),t.replaceText(e,r)}),o}(t);if(!r)return;let{sourceCode:n}=e,{replacementFunction:o,fix:a}=r;return r={node:t,loc:eR(t,n),messageId:sB,data:{functionNameWithKind:eK(t,n),replacementFunction:o}},!a||1!==t.params.length||n.getCommentsInside(t).length>0||(r.fix=a),r})},meta:{type:"suggestion",docs:{description:"Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.",recommended:"unopinionated"},fixable:"code",messages:{[sB]:"{{functionNameWithKind}} is equivalent to `{{replacementFunction}}`. Use `{{replacementFunction}}` directly."},languages:["js/js"]}},"unicorn/no-document-cookie":{create(e){sq.listen({context:e})},meta:{type:"problem",docs:{description:"Do not use `document.cookie` directly.",recommended:"unopinionated"},messages:{[sO]:"Do not use `document.cookie` directly."},languages:["js/js"]}},"unicorn/prefer-add-event-listener":s_,"unicorn/prefer-array-index-of":sH,"unicorn/prefer-blob-reading-methods":{create:e=>{e.on("CallExpression",e=>{if(!tR(e,{methods:["readAsText","readAsArrayBuffer"],argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let t=e.callee.property,r=t.name;return{node:t,messageId:sQ,data:{method:r,replacement:"readAsArrayBuffer"===r?"arrayBuffer":"text"}}})},meta:{type:"suggestion",docs:{description:"Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.",recommended:"unopinionated"},messages:{[sQ]:"Prefer `Blob#{{replacement}}()` over `FileReader#{{method}}(blob)`."},languages:["js/js"]}},"unicorn/prefer-date-now":{create:e=>{e.on("CallExpression",e=>{if(tR(e,{methods:["getTime","valueOf"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&s2(e.callee.object)){let t=e.callee.property;return s3(e,{node:t,messageId:s0,data:{method:t.name}})}if(tb(e,{names:["Number","BigInt"],argumentsLength:1,optional:!1},ty)&&s2(e.arguments[0])){let{name:t}=e.callee;return"Number"===t?s3(e,{messageId:s1}):s3(e.arguments[0])}}),e.on("UnaryExpression",t=>{if(("+"===t.operator||"-"===t.operator)&&s2(t.argument))return s3("-"===t.operator?t.argument:t,{},e)}),e.on("AssignmentExpression",e=>{if(("-="===e.operator||"*="===e.operator||"/="===e.operator||"%="===e.operator||"**="===e.operator)&&s2(e.right))return s3(e.right)}),e.on("BinaryExpression",function*(e){if("-"===e.operator||"*"===e.operator||"/"===e.operator||"%"===e.operator||"**"===e.operator)for(let t of[e.left,e.right])s2(t)&&(yield s3(t))})},meta:{type:"suggestion",docs:{description:"Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.",recommended:"unopinionated"},fixable:"code",messages:{[sZ]:"Prefer `Date.now()` over `new Date()`.",[s0]:"Prefer `Date.now()` over `Date#{{method}}()`.",[s1]:"Prefer `Date.now()` over `Number(new Date())`."},languages:["js/js"]}},"unicorn/dom-node-dataset":ln,"unicorn/prefer-modern-math-apis":{create:e=>{let t=[];e.on("CallExpression",t=>{if(!tR(t,{object:"Math",method:"sqrt",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=lp(t.arguments[0]);if(r.some(e=>!("BinaryExpression"===e.type&&("*"===e.operator&&rk(e.left,e.right)||"**"===e.operator&&ti(e.right,2)))))return;let n=1===r.length?"abs":"hypot",o=new i(1===r.length?[]:r.map(e=>e.parent));return{node:t.callee.property,messageId:lo,data:{replacement:`Math.${n}(…)`,description:"Math.sqrt(…)"},*fix(a){let{sourceCode:i}=e;for(let r of(yield a.replaceText(t.callee.property,n),o)){let t=i.getTokenAfter(r.left,e=>"Punctuator"===e.type&&"+"===e.value);yield i2(t,",",a,e),yield iM(r,a,e)}for(let t of r)yield a.removeRange([tn(t.left,e)[1],i.getRange(t)[1]])}}}),e.on("BinaryExpression",e=>{t.push(e)}),e.on("Program:exit",function*(){for(let r of t)for(let t of lu){let n=t(r,e);n&&(yield n)}})},meta:{type:"suggestion",docs:{description:"Prefer modern `Math` APIs over legacy patterns.",recommended:"unopinionated"},fixable:"code",messages:{[lo]:"Prefer `{{replacement}}` over `{{description}}`."},languages:["js/js"]}},"unicorn/number-literal-case":lm,"unicorn/prefer-number-properties":lb,"unicorn/prefer-reflect-apply":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{optionalCall:!1,optionalMember:!1})||"Literal"===t.callee.object.type||"ArrayExpression"===t.callee.object.type||"ObjectExpression"===t.callee.object.type)return;let{sourceCode:r}=e,n=((e,t)=>{if("apply"===ez(e.callee)&&2===e.arguments.length&&lv(e.arguments[0],e.arguments[1]))return r=>r.replaceText(e,lS(t,e.callee.object,e.arguments[0],e.arguments[1]))})(t,r)||((e,t)=>{if("call"===ez(e.callee)&&"apply"===ez(e.callee.object)&&"prototype"===ez(e.callee.object.object)&&e.callee.object.object.object?.type==="Identifier"&&"Function"===e.callee.object.object.object.name&&3===e.arguments.length&&lv(e.arguments[1],e.arguments[2]))return r=>r.replaceText(e,lS(t,e.arguments[0],e.arguments[1],e.arguments[2]))})(t,r);if(n)return{node:t,messageId:lE,fix:n}})},meta:{type:"suggestion",docs:{description:"Prefer `Reflect.apply()` over `Function#apply()`.",recommended:"unopinionated"},fixable:"code",messages:{[lE]:"Prefer `Reflect.apply()` over `Function#apply()`."},languages:["js/js"]}},"unicorn/prefer-set-size":{create:e=>{e.on("MemberExpression",t=>{var r;if(!tF(t,{property:"length",optional:!1}))return;let n="ArrayExpression"===(r=t.object).type&&1===r.elements.length&&r.elements[0]?.type==="SpreadElement"?r.elements[0].argument:tR(r,{object:"Array",method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})?r.arguments[0]:void 0;if(n&&nq(n,e))return{node:t.property,messageId:lC,fix:function(e,t,r){let{sourceCode:n}=e,{object:o,property:a}=t;if(!(n.getCommentsInside(o).length>n.getCommentsInside(r).length))return function*(i){yield i.replaceText(a,"size");let s=n.getText(r);it(r,e)&&(s=`(${s})`),yield i.replaceText(o,s),"ArrayExpression"===o.type&&(yield iG(i,t,e))}}(e,t,n)}})},meta:{type:"suggestion",docs:{description:"Prefer using `Set#size` instead of `Array#length`.",recommended:"unopinionated"},fixable:"code",messages:{[lC]:"Prefer using `Set#size` instead of `Array#length`."},languages:["js/js"]}},"unicorn/prefer-string-replace-all":{create:e=>{e.on("CallExpression",t=>{let r,n,o=((e,t)=>{let r;if(!tR(e,{method:"join",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!tR(e.callee.object,{method:"split",argumentsLength:1,optionalCall:!1,optionalMember:!1})||t.sourceCode.getCommentsInside(e).length>0)return;let n=e.callee.object;if(of(n.callee.object,t))return;let[o]=n.arguments,[a]=e.arguments,i=tu(o);if("string"==typeof i){if(0===i.length)return;r=tQ(i)}else if(!(r=(e=>{if(!tc(e)||e.regex.flags.includes("y"))return;let t=lM(e);if(!t||lU(t)||0===lq(t))return;let{pattern:r,flags:n}=e.regex;return`/${r}/${n.includes("g")?n:`g${n}`}`})(o)))return;let s=tu(a);if("string"==typeof s)return`${to(n.callee.object,t)}.replaceAll(${r}, ${tQ(s.replaceAll("$","$$$$"))})`})(t,e);if(o)return{node:t.callee.property,messageId:lF,fix:e=>e.replaceText(t,o)};if(!tR(t,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1})||tR(t,{method:"replace",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&tc(r=t.arguments[0])&&r.regex.flags.includes("g")&&!r.regex.flags.includes("y")&&(e=>{if(!e.startsWith("[")||!e.endsWith("]")||e.startsWith("[^"))return;let t=new i,r=e.slice(1,-1);for(let e=0;e<r.length;e++){let n=r[e],o=!1;if("\\"===n&&(n=r[++e],o=!0,!n)||"-"===n&&!o&&0!==e&&e!==r.length-1||"]"===n&&!o&&0!==e||!lw.has(n))return;t.add(n)}return t})(r.regex.pattern)?.size>=8&&ts(n=t.arguments[1])&&n.value===lA)return;let{arguments:a,callee:{property:s}}=t;if(of(t.callee.object,e))return;let[l]=a;if(!((e,t)=>{if(tc(e))return e.regex.flags.includes("g");if(tE(e,{name:"RegExp"})&&e.arguments[0]?.type!=="SpreadElement"&&e.arguments[1]?.type==="Literal"&&"string"==typeof e.arguments[1].value)return e.arguments[1].value.includes("g");let r=eV(e,t);if(!r)return!1;let{value:n}=r;return"[object RegExp]"===Object.prototype.toString.call(n)&&n.global})(l,e.sourceCode.getScope(l)))return;let u=s.name,p=function(e){if(!tc(e))return;let t=lM(e);if(!t)return;let{flags:r}=e.regex;if(!function(e){if(!e.includes("g"))return!1;for(let t of e)if(lB.has(t))return!1;return!0}(r))return;let n="alternative"===t.type?l$(t.body):lN(t);if(n)return"'"+n+"'"}(l);if("replaceAll"===u){if(!p)return;return{node:l,messageId:lj,data:{replacement:p.length<20?p:"a string literal"},fix:e=>e.replaceText(l,p)}}return{node:s,messageId:lI,*fix(e){yield e.insertTextAfter(s,"All"),p&&(yield e.replaceText(l,p))}}})},meta:{type:"suggestion",docs:{description:"Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.",recommended:"unopinionated"},fixable:"code",messages:{[lI]:"Prefer `String#replaceAll()` over `String#replace()`.",[lj]:"This pattern can be replaced with {{replacement}}.",[lF]:"Prefer `String#replaceAll()` over `String#split().join()`."},languages:["js/js"]}},"unicorn/prefer-string-slice":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{methods:["substr","substring"]})||of(t.callee.object,e))return;let r=t.callee.property.name;if(!("substring"===r&&(e=>{if(!tR(e,{method:"substring",argumentsLength:2}))return;let[t,r]=e.arguments;if(lW(t)&&lW(r)&&1===Math.abs(t.value-r.value))return t.value<r.value?t:r;let n=(e=>{if("BinaryExpression"===e.type&&"-"===e.operator&&ti(e.right,1))return e.left})(t);return lV(r,t)??(lV(t,r)?r:void 0)??(n&&rk(n,r)?t:void 0)})(t)))return{node:t,messageId:r,*fix(n,{abort:o}){if(yield n.replaceText(t.callee.property,"slice"),0!==t.arguments.length){if(t.arguments.length>2||t.arguments.some(e=>"SpreadElement"===e.type))return o();yield("substr"===r?function*({node:e,fixer:t,context:r,abort:n}){let o=e.arguments,[a,i]=o;if(!i)return;let{sourceCode:s}=r,l=eV(a,s.getScope(e)),u=tn(i,r);if(l?.value===0){let n=((e,t,r)=>{let n,o,{sourceCode:a}=r;if(!("BinaryExpression"!==e.type||"-"!==e.operator||!(tp(n=e.right)&&Number.isSafeInteger(n.value)&&n.value>0)||!lz(e.left)||!("Identifier"===t.type||ts(t))||!rk(e.left.object,t)||(o=((e,t)=>{let[r,n]=tn(e,t),o=t.sourceCode.getTokenByRangeStart(r),a=t.sourceCode.getTokenBefore(o);return[t.sourceCode.getRange(a)[1],n]})(e,r),a.getAllComments().some(e=>{let t=a.getRange(e);return t[0]>=o[0]&&t[1]<=o[1]}))))return`-${e.right.raw}`})(i,e.callee.object,r);if(n)return void(yield iU(t,i,n,r));if(tp(i)||lz(i))return;let o=l_(i);return"number"==typeof o?void(yield iU(t,i,String(Math.max(0,o)),r)):(yield t.insertTextBeforeRange(u,"Math.max(0, "),void(yield t.insertTextAfterRange(u,")")))}if(o.every(e=>tp(e))){let e;return void(yield(e=String(a.value+i.value),iU(t,i,e,r)))}return n()}:function*({node:e,fixer:t,context:r,abort:n}){let[o,a]=e.arguments,i=o?l_(o):void 0;if(!a){if(lz(o))return;if(void 0!==i)return void(yield iU(t,o,String(Math.max(0,i)),r));let e=tn(o,r);return yield t.insertTextBeforeRange(e,"Math.max(0, "),void(yield t.insertTextAfterRange(e,")"))}let s=l_(a);if(void 0!==i&&void 0!==s){let e=[Math.max(0,i),Math.max(0,s)];i>s&&e.reverse(),e[0]!==i&&(yield iU(t,o,String(e[0]),r)),e[1]!==s&&(yield iU(t,a,String(e[1]),r));return}if(0===i||0===s){let e=to(o,r),n=to(a,r);yield iU(t,o,"0",r),yield iU(t,a,`Math.max(0, ${0===i?n:e})`,r);return}return n()})({node:t,fixer:n,context:e,abort:o})}}}})},meta:{type:"suggestion",docs:{description:"Prefer `String#slice()` over `String#substr()` and `String#substring()`.",recommended:"unopinionated"},fixable:"code",messages:{substr:"Prefer `String#slice()` over `String#substr()`.",substring:"Prefer `String#slice()` over `String#substring()`."},languages:["js/js"]}},"unicorn/prefer-string-trim-start-end":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{methods:["trimLeft","trimRight"],argumentsLength:0,optionalCall:!1})||of(t.callee.object,e))return;let r=t.callee.property,n=r.name,o="trimLeft"===n?"trimStart":"trimEnd";return{node:r,messageId:lK,data:{method:n,replacement:o},fix:e=>e.replaceText(r,o)}})},meta:{type:"suggestion",docs:{description:"Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.",recommended:"unopinionated"},fixable:"code",messages:{[lK]:"Prefer `String#{{replacement}}()` over `String#{{method}}()`."},languages:["js/js"]}},"unicorn/no-unreadable-iife":{create:e=>{e.on("CallExpression",t=>{if("ArrowFunctionExpression"!==t.callee.type||"BlockStatement"===t.callee.body.type||!ta(t.callee.body,e))return;let{body:r}=t.callee,n={node:t,loc:ic(tn(r,e),e),messageId:lG};return!function(e,t){let{sourceCode:r}=t,[n,o]=tn(e,t),[a,i]=r.getRange(e);return r.getCommentsInside(e.parent).some(e=>{let[t,s]=r.getRange(e);return t>=n&&s<=o&&(t<a||s>i)})}(r,e)&&(n.suggest=[{messageId:lJ,fix:t=>t.replaceTextRange(tn(r,e),`{ return ${e.sourceCode.getText(r)}; }`)}]),n})},meta:{type:"suggestion",docs:{description:"Disallow unreadable IIFEs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[lG]:"IIFE with parenthesized arrow function body is considered unreadable.",[lJ]:"Use a block statement body."},languages:["js/js"]}},"unicorn/throw-new-error":{create:e=>{e.on("CallExpression",t=>{if("Decorator"===t.parent.type)return;let{callee:r}=t;if(!(t.optional||r3(r))&&("Identifier"===r.type&&lY.test(r.name)||"MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&lY.test(r.property.name))&&!tF(r,{object:"Data",property:"TaggedError",computed:!1}))return{node:t,messageId:lX,fix:r=>iJ(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Require `new` when creating an error.",recommended:"unopinionated"},fixable:"code",messages:{[lX]:"Use `new` when creating an error."},languages:["js/js"]}},"unicorn/escape-case":{create:e=>{let t="lowercase"===e.options[0];e.on("Literal",e=>{if(ts(e))return l1({node:e,original:e.raw,lowercase:t})}),e.on("Literal",e=>{if(tc(e))return l1({node:e,original:e.raw,regex:l0,lowercase:t})}),e.on("TemplateElement",r=>{if(!tO(r.parent))return l1({node:r,original:r.value.raw,lowercase:t,fix:(t,n)=>i1(r,n,e,t)})})},meta:{type:"suggestion",docs:{description:"Require escape sequences to use uppercase or lowercase values.",recommended:"unopinionated"},fixable:"code",schema:[{enum:["uppercase","lowercase"],description:"The case style for escape sequences."}],defaultOptions:["uppercase"],messages:{[lH]:"Use uppercase characters for the value of the escape sequence.",[lQ]:"Use lowercase characters for the value of the escape sequence."},languages:["js/js"]}},"unicorn/prefer-unicode-code-point-escapes":{create:e=>{e.on("Literal",e=>ts(e)?ui(e,e.raw):tc(e)?function(e){let t,{raw:r}=e,{pattern:n,flags:o}=(t=r.lastIndexOf("/"),{pattern:r.slice(1,t),flags:r.slice(t+1)}),{fixed:i,hasReplacement:s}=ua(n,{isRegex:!0,supportsNestedCharacterClasses:o.includes("v")}),l=o.includes("u")||o.includes("v"),u=function(e){for(let t=0;t<e.length;t++)if(void 0!==function(e,t){var r;if(!e.startsWith(l8,t))return;let n=t+l8.length;for(;r=e[n],l6.test(r);)n++;if(n===t+l8.length||"}"!==e[n])return;let o=Number.parseInt(e.slice(t+l8.length,n),16);if(!(o>1114111))return o}(e,t)&&l7(e,t))return!0;return!1}(n);if(!s&&(l||!u))return;let p=`/${s?i:n}/${us(o)}`;return l?{node:e,messageId:l2,fix:t=>t.replaceText(e,p)}:!function(e,t){try{return new a(e,t),!0}catch{return!1}}(s?i:n,us(o))?{node:e,messageId:l2}:{node:e,messageId:l2,suggest:[{messageId:l3,fix:t=>t.replaceText(e,p)}]}}(e):void 0),e.on("TemplateElement",t=>{if(!tO(t.parent))return ui(t,t.value.raw,(r,n)=>i1(t,n,e,r))})},meta:{type:"suggestion",docs:{description:"Prefer Unicode code point escapes over legacy escape sequences.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[l2]:"Prefer Unicode code point escapes.",[l3]:"Use Unicode code point escapes and add the `u` flag."},languages:["js/js"]}},"unicorn/prefer-prototype-methods":{create:function(e){let{sourceCode:t}=e,r=[];e.on("CallExpression",e=>{r.push(e)}),e.onExit("Program",function*(n){let o=new s;for(let{node:e,path:r}of new e5(t.getScope(n)).iterateGlobalReferences(Object.fromEntries(ul.map(e=>[e,{[e5.READ]:!0}]))))o.set(e,r);for(let t of r)yield function(e,{context:t,globalReferences:r}){let n;tR(e,{object:"Reflect",method:"apply",minimumArguments:1,optionalCall:!1,optionalMember:!1})?n=e.arguments[0]:tR(e,{methods:["apply","bind","call"],optionalCall:!1,optionalMember:!1})&&(n=e.callee.object);let{isGlobalReference:o,constructorName:a,methodName:i}=function(e,{context:t,globalReferences:r}){if(!e)return;if(r.has(e))return{isGlobalReference:!0,constructorName:"Object",methodName:r.get(e).at(-1)};if(!tF(e,{optional:!1}))return;let n=e.object;if(tC(n)||tD(n))return{constructorName:"ArrayExpression"===n.type?"Array":"Object",methodName:ez(e,t.sourceCode.getScope(e))}}(n,{context:t,globalReferences:r})??{};if(a)return{node:n,messageId:i?"known-method":"unknown-method",data:{constructorName:a,methodName:i},*fix(r){if(o)return void(yield r.replaceText(n,`${a}.prototype.${i}`));if(tF(n)){let o=n.object;yield r.replaceText(o,`${a}.prototype`),("ArrayExpression"===o.type||"ObjectExpression"===o.type)&&(yield iG(r,e,t))}}}}(t,{context:e,globalReferences:o})})},meta:{type:"suggestion",docs:{description:"Prefer borrowing methods from the prototype instead of the instance.",recommended:"unopinionated"},fixable:"code",messages:{"known-method":"Prefer using `{{constructorName}}.prototype.{{methodName}}`.","unknown-method":"Prefer using method from `{{constructorName}}.prototype`."},languages:["js/js"]}},"unicorn/error-message":{create:e=>{e.on(["CallExpression","NewExpression"],t=>{if(!(tb(t,{names:uu,optional:!1},tx)&&e.sourceCode.isGlobalReference(t.callee)))return;let r=t.callee.name,n=um.has(r)?um.get(r):0,o=t.arguments;if(o.some((e,t)=>t<=n&&"SpreadElement"===e.type))return;let a=o[n];if(!a)return{node:t,messageId:up,data:{constructorName:r}};if("ArrayExpression"===a.type||"ObjectExpression"===a.type)return{node:a,messageId:ud};let i=eV(a,e.sourceCode.getScope(a));if(!i)return;let{value:s}=i;return"string"!=typeof s?{node:a,messageId:ud}:""===s?{node:a,messageId:uc}:void 0})},meta:{type:"problem",docs:{description:"Enforce passing a `message` value when creating a built-in error.",recommended:"unopinionated"},messages:{[up]:"Pass a message to the `{{constructorName}}` constructor.",[uc]:"Error message should not be an empty string.",[ud]:"Error message should be a string."},languages:["js/js"]}},"unicorn/no-instanceof-builtins":uS,"unicorn/prefer-type-error":{create:e=>{e.on("ThrowStatement",e=>{let t;if(!(tE(e.argument,{name:"Error"})&&e.parent&&e.parent.body&&1===e.parent.body.length&&e.parent.parent&&"IfStatement"===(t=e.parent.parent).type&&uj(t.test)))return;let r=e.argument.callee;return{node:r,messageId:uC,fix:e=>e.insertTextBefore(r,"Type")}})},meta:{type:"suggestion",docs:{description:"Enforce throwing `TypeError` in type checking conditions.",recommended:"unopinionated"},fixable:"code",messages:{[uC]:"`new Error()` is too unspecific for a type check. Use `new TypeError()` instead."},languages:["js/js"]}},"unicorn/consistent-destructuring":{create:e=>{let{sourceCode:t}=e,r=new o,n=[],a=[],i=e=>{let r=rN(e.object);if(e.computed||"Identifier"!==e.property.type||!["Identifier","ThisExpression"].includes(r.type))return;let n=t.getScope(e);a.push({propertyName:e.property.name,rootIdentifierName:"Identifier"===r.type?r.name:void 0,rootVariable:"Identifier"===r.type?eS(n,r):void 0,thisScopeBoundary:"ThisExpression"===r.type?uP(r):void 0,start:t.getRange(e)[0],scope:n})},s=e=>{switch(e.type){case"MemberExpression":i(e);break;case"AssignmentPattern":s(e.left);break;case"RestElement":s(e.argument);break;case"ObjectPattern":for(let t of e.properties)s("Property"===t.type?t.value:t.argument);break;case"ArrayPattern":for(let t of e.elements)t&&s(t)}};e.on("AssignmentExpression",e=>{s(e.left)}),e.on(["ForInStatement","ForOfStatement"],e=>{"VariableDeclaration"!==e.left.type&&s(e.left)}),e.on("UpdateExpression",e=>{"MemberExpression"===e.argument.type&&i(e.argument)}),e.on("UnaryExpression",e=>{"delete"===e.operator&&"MemberExpression"===e.argument.type&&i(e.argument)}),e.on("VariableDeclarator",e=>{let n;if(!("ObjectPattern"===e.id.type&&"const"===e.parent.kind&&e.init&&("Identifier"===(n=e.init).type||"ThisExpression"===n.type)))return;let o="Identifier"===e.init.type?e.init:void 0,a={scope:t.getScope(e),object:e.init,rootIdentifierName:o?.name,rootVariable:o&&eS(t.getScope(e),o),thisScopeBoundary:"ThisExpression"===e.init.type?uP(e.init):void 0,objectPattern:e.id},i=t.getText(e.init);r.set(i,[...r.get(i)??[],a])});let l=e=>{let n,o;if((o=e).computed||tb(o.parent,void 0,tx)&&o.parent.callee===o||"TaggedTemplateExpression"===o.parent.type&&o.parent.tag===o||nG(o))return;let i=rN(e.object),s=r.get(t.getText(i));if(!s)return;let l=t.getScope(e),u="Identifier"===i.type?i:void 0,p=u&&eS(l,u),c="ThisExpression"===i.type?uP(i):void 0,d=t.getText(e.property);for(let r of s.toReversed())if(u$({declaration:r,memberExpressionNode:e,memberScope:l,memberRootIdentifier:u,memberRootVariable:p,memberThisScopeBoundary:c,memberExpressionWrites:a,sourceCode:t})&&(n=uN(r.objectPattern.properties.filter(e=>uL(e)&&"Identifier"===e.value.type),d,l,t)))break;if(!n||((e,t)=>{let r=e,{parent:n}=e;for(;n&&!uq(n);){if(uO(n,r,e,t))return!0;r=n,n=n.parent}return!1})(e,t))return;if("MemberExpression"===e.parent.type)return{node:e,messageId:uF};let m=t.getText(e),f=n.value.name;return{node:e,messageId:uF,suggest:[{messageId:uB,data:{expression:m,property:f},fix:t=>t.replaceText(e,f)}]}};e.on("MemberExpression",e=>{n.push(e)}),e.onExit("Program",function*(){for(let e of n){let t=l(e);t&&(yield t)}})},meta:{type:"suggestion",docs:{description:"Use destructured variables over properties.",recommended:!1},hasSuggestions:!0,messages:{[uF]:"Use destructured variables over properties.",[uB]:"Replace `{{expression}}` with destructured property `{{property}}`."},languages:["js/js"]}},"unicorn/new-for-builtins":{create:e=>{uK.listen({context:e}),uG.listen({context:e}),uJ.listen({context:e}),uX.listen({context:e})},meta:{type:"suggestion",docs:{description:"Enforce correct use of `new` for builtin constructors.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{enforce:"Use `new {{name}}()` instead of `{{name}}()`.",disallow:"Use `{{name}}()` instead of `new {{name}}()`.",disallowCallOrNew:"`{{name}}` is not a function or constructor.",[uV]:"Use `String(new Date())` instead of `Date()`.",[u_]:"Switch to `String(new Date())`."},languages:["js/js"]}},"unicorn/prefer-single-call":u1,"unicorn/no-process-exit":{create:e=>{if(0===e.sourceCode.lines[0].indexOf("#!"))return;let t=0,r=!1,n=[],o=e=>tR(e,{object:"process",methods:["on","once"],minimumArguments:1,optionalCall:!1,optionalMember:!1});e.on("CallExpression",e=>{tN(e)&&u3(e.arguments[0])&&(r=!0)}),e.on("ImportDeclaration",e=>{"Literal"===e.source.type&&u3(e.source)&&(r=!0)}),e.on("CallExpression",e=>{o(e)&&t++}),e.onExit("CallExpression",e=>{o(e)&&t--}),e.on("CallExpression",e=>{0===t&&tR(e,{object:"process",method:"exit",optionalCall:!1,optionalMember:!1})&&n.push(e)}),e.onExit("Program",function*(){if(!r)for(let e of n)yield{node:e,messageId:u2}})},meta:{type:"suggestion",docs:{description:"Disallow `process.exit()`.",recommended:"unopinionated"},messages:{[u2]:"Only use `process.exit()` in CLI apps. Throw an error instead."},languages:["js/js"]}},"unicorn/no-static-only-class":{create:function(e){e.on(["ClassDeclaration","ClassExpression"],t=>{if(!(t.superClass||t.decorators&&t.decorators.length>0||"ClassBody"!==t.body.type||0===t.body.body.length||t.body.body.some(e=>!function(e){let{private:t,static:r,declare:n,readonly:o,accessibility:a,decorators:i,key:s}=e;return(!!pn(e)||"MethodDefinition"===e.type)&&!!r&&!t&&"PrivateIdentifier"!==s.type&&!(n||o||void 0!==a||Array.isArray(i)&&i.length>0)}(e))))return{node:t,loc:function(e,t){let{sourceCode:r}=t,{body:n}=e,o=r.getTokenBefore(n),{start:a}=r.getLoc(e),{end:i}=r.getLoc(o);return{start:a,end:i}}(t,e),messageId:pt,fix:function(e,t){let{type:r,id:n,body:o,declare:a,abstract:i,implements:s,parent:l}=e;if(a||i||Array.isArray(s)&&s.length>0||"ClassExpression"===r&&n)return;let u="ClassDeclaration"===e.type&&"ExportDefaultDeclaration"===e.parent.type&&e.parent.declaration===e;if(u&&n)return;let{sourceCode:p}=t;for(let e of o.body)if(pn(e)&&(e.typeAnnotation||e.value&&p.getText(e.value).includes("this")))return;return function*(n){let a=p.getFirstToken(e);if(tX(a,{expected:{type:"Keyword",value:"class"},ruleId:"no-static-only-class"}),u||"ClassExpression"===r)if("ClassExpression"===r&&"ReturnStatement"===l.type&&p.getLoc(o).start.line!==p.getLoc(l).start.line&&p.text.slice(p.getRange(a)[1],p.getRange(o)[0]).trim()){yield n.replaceText(a,"{");let e=p.getFirstToken(o);yield n.remove(e)}else yield n.replaceText(a,""),yield i_(a,t,n);else yield n.replaceText(a,"const"),yield n.insertTextBefore(o,"= "),yield n.insertTextAfter(o,";");for(let e of o.body)yield function*(e,t,r){let{sourceCode:n}=t,o=n.getFirstToken(e);tX(o,{expected:{type:"Keyword",value:"static"},ruleId:"no-static-only-class"}),yield r.remove(o),yield i_(o,t,r);let a=pn(e)?n.getLastToken(e):n.getTokenAfter(e),i=eA(a);if(pn(e)){let{key:t,value:o}=e;if(o){let e=n.getTokenAfter(t,pr);yield r.replaceText(e,":")}else i?yield r.insertTextBefore(a,": undefined"):yield r.insertTextAfter(e,": undefined")}yield i?r.replaceText(a,","):r.insertTextAfter(e,",")}(e,t,n)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Disallow classes that only have static members.",recommended:"unopinionated"},fixable:"code",messages:{[pt]:"Use an object instead of a class with only static members."},languages:["js/js"]}},"unicorn/no-unreadable-array-destructuring":pi,"unicorn/no-useless-spread":{create:e=>{let{sourceCode:t}=e;e.on(["ArrayExpression","ObjectExpression"],r=>{if(!("SpreadElement"===r.parent.type&&r.parent.argument===r&&("ObjectExpression"===r.type&&"ObjectExpression"===r.parent.parent.type&&r.parent.parent.properties.includes(r.parent)||"ArrayExpression"===r.type&&("ArrayExpression"===r.parent.parent.type&&r.parent.parent.elements.includes(r.parent)||tb(r.parent.parent,void 0,tx)&&r.parent.parent.arguments.includes(r.parent)))))return;let n=r.parent,o=t.getFirstToken(n),a=n.parent.type,i={node:o,messageId:ps,data:{argumentType:"ArrayExpression"===r.type?"array":"object",parentDescription:pb[a]}};return"NewExpression"===a&&px(r)&&tE(n.parent,{names:pg,argumentsLength:1,allowSpreadElement:!0})?i:{...i,*fix(i){let s;yield i.remove(o),yield iM(r,i,e);let l=t.getFirstToken(r);yield i.remove(l);let[u,p]=t.getLastTokens(r,2);if(yield i.remove(p),eT(u)&&(yield i.remove(u)),tC(r)||tD(r)){let e=t.getTokenAfter(n);eT(e)&&(yield i.remove(e))}if("CallExpression"===a||"NewExpression"===a)for(let[e,n]of(s=t.getFirstToken(r),r.elements.map((e,n,o)=>{if(n===o.length-1){let e=t.getLastToken(r,{skip:1});return eT(e)?e:void 0}let a=t.getTokenAfter(e||s,eT);return s=a,a})).entries())null===r.elements[e]&&(yield i.insertTextBefore(n,"undefined"))}}}),e.on("ObjectExpression",r=>{if(!("ObjectExpression"===r.type&&r.properties.length>0&&r.properties.every(e=>"SpreadElement"===e.type&&"ObjectExpression"!==e.argument.type)))return;let n=r.parent;if(!tR(n,{object:"Object",method:"assign",minimumArguments:2,optionalMember:!1,optionalCall:!1}))return;let o=n.arguments.indexOf(r),a=n.arguments.slice(0,o).some(e=>"SpreadElement"!==e.type);if(o<=0||!a)return;let i={node:t.getFirstToken(r.properties[0]),messageId:pd};return t.getCommentsInside(r).length>0?i:{...i,suggest:[{messageId:pf,fix:t=>t.replaceText(r,r.properties.map(t=>to(t.argument,e)).join(", "))}]}}),e.on("NewExpression",e=>{if(tE(e,{names:pg,argumentsLength:1,allowSpreadElement:!0})&&"SpreadElement"===e.arguments[0].type&&"ArrayExpression"!==e.arguments[0].argument.type)return{node:e.arguments[0],messageId:pc,data:{constructorName:`new ${e.callee.name}(…)`}}}),e.on("ArrayExpression",t=>{if(!px(t))return;let{parent:r}=t;if(!("ForOfStatement"===r.type&&r.right===t||"YieldExpression"===r.type&&r.delegate&&r.argument===t||(tE(r,{names:pg,argumentsLength:1})||tE(r,{names:r9,minimumArguments:1})||tR(r,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tR(r,{objects:["Array",...r9],method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tR(r,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1}))&&r.arguments[0]===t))return;let n="",o=pl;switch(r.type){case"ForOfStatement":o=pu;break;case"YieldExpression":o=pp;break;case"NewExpression":n=`new ${r.callee.name}(…)`;break;case"CallExpression":n=`${r.callee.object.name}.${r.callee.property.name}(…)`}return{node:t,messageId:o,data:{parentDescription:n},fix:r=>pE(r,t,e)}}),e.on("ArrayExpression",t=>{if(!px(t))return;let r=t.elements[0].argument,n=!!tR(r,{methods:ph,optionalCall:!1,optionalMember:!1})&&nj(r.callee.object,e)&&nj(r,e);if(!n&&!(!nF(r,e)&&(tR(r,{methods:py,optionalCall:!1,optionalMember:!1})?!pv(r,e):tR(r,{method:"concat",optionalCall:!1,optionalMember:!1})?!("Identifier"===r.callee.object.type&&"Iterator"===r.callee.object.name||pv(r,e)):tR(r,{method:"split",optionalCall:!1,optionalMember:!1})||tR(r,{object:"Object",methods:["keys","values"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||"AwaitExpression"===r.type&&tR(r.argument,{object:"Promise",methods:["all","allSettled"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tR(r,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||tE(r,{name:"Array"}))))return;let o={node:t,messageId:pm};return tE(r,{name:"Array"})||tR(r,{method:"slice",optionalCall:!1,optionalMember:!1})&&!n?o:Object.assign(o,{fix:r=>pE(r,t,e)})})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary spread.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[ps]:"Spread an {{argumentType}} literal in {{parentDescription}} is unnecessary.",[pl]:"`{{parentDescription}}` accepts an iterable as an argument, it's unnecessary to convert to an array.",[pu]:"`for…of` can iterate over an iterable, it's unnecessary to convert to an array.",[pp]:"`yield*` can delegate to an iterable, it's unnecessary to convert to an array.",[pc]:"`{{constructorName}}` accepts a single iterable argument, spreading is misleading.",[pd]:"`Object.assign(…)` source object with only spread properties is unnecessary.",[pm]:"Unnecessarily cloning an array.",[pf]:"Remove the object literal wrapper."},languages:["js/js"]}},"unicorn/no-useless-switch-case":{create:e=>{let t=rQ(e.physicalFilename);e.on("SwitchStatement",function*(r){let{cases:n}=r;if(!(n.length<2)&&null===n.at(-1).test)for(let r=n.length-2;r>=0;r--){let o=n[r];if(!pD(o))break;t&&pT(o)||(yield{node:o,loc:function(e,t){let{sourceCode:r}=t,n=e.test||r.getFirstToken(e),o=r.getTokenAfter(n,ew);return{start:r.getLoc(e).start,end:r.getLoc(o).end}}(o,e),messageId:pS,suggest:[{messageId:pC,fix:e=>e.remove(o)}]})}})},meta:{type:"suggestion",docs:{description:"Disallow useless case in switch statements.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[pS]:"Useless case in switch statement.",[pC]:"Remove this case."},languages:["js/js"]}},"unicorn/no-useless-undefined":pz,"unicorn/numeric-separators-style":pX,"unicorn/prefer-array-find":ci,"unicorn/prefer-array-flat-map":{create:e=>{e.on("CallExpression",t=>{if(!(tR(t,{method:"flat",optionalCall:!1,optionalMember:!1})&&(0===t.arguments.length||1===t.arguments.length&&"Literal"===t.arguments[0].type&&"1"===t.arguments[0].raw)&&tR(t.callee.object,{method:"map",optionalCall:!1})))return;let r=t.callee.object;if(tM(r.callee.object,cp)||nL(r.callee.object,e))return;let{sourceCode:n}=e,o=r.callee.property,a=rU(e,t,[r])||t.typeArguments||t.typeParameters||r.typeArguments||r.typeParameters?void 0:function*(r){yield iH(r,t,e),yield r.replaceText(o,"flatMap")};return{node:t,loc:{start:n.getLoc(o).start,end:n.getLoc(t).end},messageId:cs,fix:a}}),e.on("CallExpression",t=>{let r;if(!tR(t,{method:"flatMap",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||t.typeArguments||t.typeParameters)return;let n=t.callee.object;if(!tR(n,{method:"filter",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||n.typeArguments||n.typeParameters||r3(n.callee.object)||nB(n.callee.object,e))return;let{sourceCode:o}=e;if(o.getCommentsInside(t).length>0)return;let[a]=n.arguments,[i]=t.arguments;if(!cd(a)||!cd(i)||!("ArrayExpression"===(r=i.body).type&&r.elements.length>1))return;let[s]=a.params,[l]=i.params;if(!oT(s,l))return;let u=function(e,t){if(ta(e,t))return to(e,t);let r=t.sourceCode.getText(e);return it(e,t)?`(${r})`:r}(n.callee.object,e),p=o.getText(s),c=function(e,t){if(ta(e,t))return to(e,t);let r=t.sourceCode.getText(e);return cc.has(e.type)?`(${r})`:r}(a.body,e),d=o.getText(i.body);return{node:t.callee.property,messageId:cl,suggest:[{messageId:cu,fix:e=>e.replaceText(t,`${u}.flatMap(${p} => ${c} ? ${d} : [])`)}]}})},meta:{type:"suggestion",docs:{description:"Prefer `.flatMap(…)` over `.map(…).flat()` and `.filter(…).flatMap(…)`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[cs]:"Prefer `.flatMap(…)` over `.map(…).flat()`.",[cl]:"Prefer a single `.flatMap(…)` over `.filter(…).flatMap(…)`.",[cu]:"Replace `.filter(…).flatMap(…)` with a single `.flatMap(…)`."},languages:["js/js"]}},"unicorn/prefer-array-flat":cv,"unicorn/prefer-array-some":cT,"unicorn/prefer-default-parameters":{create:e=>{let{sourceCode:t}=e,r=[],n=(e,n,o,a)=>{let i,s=r.at(-1);if(!s||!n||!o||"Identifier"!==n.type||"LogicalExpression"!==o.type||"||"!==o.operator&&"??"!==o.operator||"Identifier"!==o.left.type||"Literal"!==o.right.type)return;let{name:l}=n,{left:{name:u},right:{raw:p}}=o;if(a&&l!==u)return;let c=eS(t.getScope(e),u);if(!c)return;let{references:d}=c,{params:m}=s,f=m.find(e=>"Identifier"===e.type&&e.name===u);if(((e,t,r)=>{for(let n of t.body.body){if(n===r)break;if(cI(e,n))return!0}return!1})(t,s,e)||a&&d[0].identifier!==n||!a&&d.length>1||(i=m.at(-1),!f||f!==i))return;let g=((e,t)=>{if("ArrowFunctionExpression"!==t.type||t.params.length>1)return!1;let[r]=t.params,n=e.getTokenBefore(r),o=e.getTokenAfter(r);return!o||!n||"("!==n.value||")"!==o.value})(t,s)?`(${l} = ${p})`:`${l} = ${p}`;return{node:e,messageId:cA,suggest:[{messageId:cw,fix:r=>[r.replaceText(f,g),((e,t,r)=>{let{line:n}=t.getLoc(r).start,{column:o}=t.getLoc(r).end,a=t.getText(r),i=t.lines[n-1];if(i.trim()===a)return e.removeRange([t.getIndexFromLoc({line:n,column:0}),t.getIndexFromLoc({line:n+1,column:0})]);if(" "===i[o]){let[n,o]=t.getRange(r);return e.removeRange([n,o+1])}return e.remove(r)})(r,t,e)]}]}};e.on(tA,e=>{r.push(e)}),e.onExit(tA,()=>{r.pop()}),e.on("AssignmentExpression",e=>{if("ExpressionStatement"===e.parent.type&&e.parent.expression===e)return n(e.parent,e.left,e.right,!0)}),e.on("VariableDeclarator",e=>{if("VariableDeclaration"===e.parent.type&&e.parent.declarations[0]===e)return n(e.parent,e.id,e.init,!1)})},meta:{type:"suggestion",docs:{description:"Prefer default parameters over reassignment.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[cA]:"Prefer default parameters over reassignment.",[cw]:"Replace reassignment with default parameter."},languages:["js/js"]}},"unicorn/prefer-logical-operator-over-ternary":{create:e=>{let{sourceCode:t}=e;e.on("ConditionalExpression",r=>{let{test:n,consequent:o,alternate:a}=r,i=function(e,t){let{test:r,consequent:n,alternate:o}=e,a=function(e,t){let r=cO(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=cO(e.left),o=cO(e.right);if(n&&o&&cN(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&cq(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&cq(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}(r,t.sourceCode);if(!a||t.sourceCode.getCommentsInside(e).length>0)return;let{reference:i}=a;if(a.isTrueWhenNullish&&cN(i,o,t.sourceCode))return c$({context:t,conditionalExpression:e,left:o,right:n,operators:["??"]});if(!a.isTrueWhenNullish&&cN(i,n,t.sourceCode))return c$({context:t,conditionalExpression:e,left:n,right:o,operators:["??"]});let s=a.isTrueWhenNullish?n:o,l=a.isTrueWhenNullish?o:n;if(!tq(s)||!tF(l)||l.optional||!rk(rN(i),rN(l.object))||function(e){let t=e,{parent:r}=t;for(;rL(r)&&r.expression===t;)r=(t=r).parent;return"UnaryExpression"===r.type&&"delete"===r.operator&&r.argument===t||"CallExpression"===r.type&&r.callee===t||"TaggedTemplateExpression"===r.type&&r.tag===t}(e))return;let u=function(e,t){let{sourceCode:r}=t,n=rX(e,t);if(rV(t,n))return;let[o,a]=r.getRange(e),[i,s]=n;return r.text.slice(o,i)+(e.computed?"?.[":"?.")+r.text.slice(s,a)}(l,t);if(u)return{node:e,messageId:cF,suggest:[{messageId:cR,fix(r){let n=u;return aL(t.sourceCode.getTokenBefore(e),t,n)&&(n=`;${n}`),r.replaceText(e,n)}}]}}(r,e);return i||(cN(n,o,t)?c$({context:e,conditionalExpression:r,left:n,right:a}):"UnaryExpression"===n.type&&"!"===n.operator&&n.prefix&&cN(n.argument,a,t)?c$({context:e,conditionalExpression:r,left:n.argument,right:o}):void 0)})},meta:{type:"suggestion",docs:{description:"Prefer using a logical operator over a ternary.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[cj]:"Prefer using a logical operator over a ternary.",[cF]:"Prefer using optional chaining over a ternary.",[cB]:"Switch to `{{operator}}` operator.",[cR]:"Switch to optional chaining."},languages:["js/js"]}},"unicorn/prefer-optional-catch-binding":{create:e=>{e.on("CatchClause",t=>{let r=t.param;if(!r)return;let{sourceCode:n}=e;if(n.getDeclaredVariables(r.parent).some(e=>e.references.length>0))return;let{type:o,name:a,parent:i}=r,s=n.getCommentsInside(r).length>0;return{node:r,messageId:"Identifier"===o?cU:cW,data:{name:a},fix:s?void 0:function*(e){let t=n.getTokenBefore(r);tX(t,{test:ek,expected:"(",ruleId:"prefer-optional-catch-binding"});let o=n.getTokenAfter(r);tX(o,{test:eI,expected:")",ruleId:"prefer-optional-catch-binding"}),yield e.remove(t),yield e.remove(r),yield e.remove(o);let[,a]=n.getRange(o),[s]=n.getRange(i.body),l=n.text.slice(a,s),u=l.length-l.trimStart().length;0!==u&&(yield e.removeRange([a,a+u]))}}})},meta:{type:"suggestion",docs:{description:"Prefer omitting the `catch` binding parameter.",recommended:"unopinionated"},fixable:"code",messages:{[cU]:"Remove unused catch binding `{{name}}`.",[cW]:"Remove unused catch binding."},languages:["js/js"]}},"unicorn/prefer-regexp-test":du,"unicorn/prefer-set-has":dC,"unicorn/prefer-string-raw":{create:e=>{e.on("Literal",t=>{if(!ts(t)||function(e){let{parent:t}=e,{type:r}=t;return tv(t)||["Property","PropertyDefinition","MethodDefinition","AccessorProperty"].includes(r)&&!t.computed&&t.key===e||["TSAbstractPropertyDefinition","TSAbstractMethodDefinition","TSAbstractAccessorProperty","TSPropertySignature"].includes(r)&&t.key===e||["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration"].includes(r)&&t.source===e||"ImportAttribute"===r&&(t.key===e||t.value===e)||"ImportSpecifier"===r&&t.imported===e||"ExportSpecifier"===r&&(t.local===e||t.exported===e)||"ExportAllDeclaration"===r&&t.exported===e||"JSXAttribute"===r&&t.value===e||"TSEnumMember"===r&&(t.initializer===e||t.id===e)||"TSModuleDeclaration"===r&&t.id===e||"TSExternalModuleReference"===r&&t.expression===e||"TSLiteralType"===r&&t.literal===e||"TSImportType"===r&&t.source===e}(t)||dD(t))return;let{sourceCode:r}=e,{raw:n}=t;if("\\"===n.at(-2)||!n.includes("\\\\")||n.includes("`")||n.includes("${")||r.getLoc(t).start.line!==r.getLoc(t).end.line)return;let o=dw(n.slice(1,-1),n.charAt(0));if(o===t.value)return{node:t,messageId:dT,*fix(r){yield iG(r,t,e),yield r.replaceText(t,`String.raw\`${o}\``)}}}),e.on("TemplateLiteral",t=>{if(!("TaggedTemplateExpression"===t.parent.type&&t.parent.quasi===t||t.quasis.every(({value:{cooked:e,raw:t}})=>e===t)||t.quasis.some(({value:{cooked:e,raw:t}})=>"\\"===e.at(-1)||dw(t)!==e)||dD(t)))return{node:t,messageId:dT,*fix(r){for(let n of(yield iG(r,t,e),yield r.insertTextBefore(t,"String.raw"),t.quasis)){let{cooked:t,raw:o}=n.value;t!==o&&(yield i1(n,t,e,r))}}}}),e.on("TaggedTemplateExpression",t=>{let{quasi:r,tag:n,parent:o}=t,{sourceCode:a}=e;if(!tF(n,{object:"String",property:"raw",optional:!1})||!a.isGlobalReference(n.object)||r.quasis.some(e=>e.value.raw.includes("\\")))return;let i=a.getText(r),s=r.expressions.length>0||/\r?\n/.test(i)?i:`'${i.slice(1,-1).replaceAll("'",()=>String.raw`\'`)}'`;return{node:n,messageId:dA,*fix(r){let n=a.getTokenBefore(t);aL(n,e,s)&&(yield r.insertTextBefore(t,";")),"ReturnStatement"!==o.type&&"ThrowStatement"!==o.type||oS(n,t.quasi,e)||ta(t,e)||(yield iV(r,o,e)),"YieldExpression"!==o.type||o.delegate||o.argument!==t||oS(n,t.quasi,e)||ta(t,e)||(yield r.insertTextBefore(t,"("),yield r.insertTextAfter(t,")")),yield r.replaceText(t.quasi,s),yield iM(t.tag,r,e),yield r.remove(t.tag)}}})},meta:{type:"suggestion",docs:{description:"Prefer using the `String.raw` tag to avoid escaping `\\`.",recommended:"unopinionated"},fixable:"code",messages:{[dT]:"`String.raw` should be used to avoid escaping `\\`.",[dA]:"Using `String.raw` is unnecessary as the string does not contain any `\\`."},languages:["js/js"]}},"unicorn/prefer-switch":dP,"unicorn/require-number-to-fixed-digits-argument":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{method:"toFixed",argumentsLength:0,optionalCall:!1})||"NewExpression"===t.callee.object.type)return;let{sourceCode:r}=e,[n,o]=r.getLastTokens(t,2);return{loc:{start:r.getLoc(n).start,end:r.getLoc(o).end},messageId:dL,fix:r=>iO(r,t,"0",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the digits argument with `Number#toFixed()`.",recommended:"unopinionated"},fixable:"code",messages:{[dL]:"Missing the digits argument."},languages:["js/js"]}},"unicorn/template-indent":{create:e=>{let{sourceCode:t}=e,r={...e.options[0]},n=(e=>{let t=new i,r=[e.ast];for(;r.length>0;){let n=r.pop();if(n){if("TemplateLiteral"===n.type){let{start:{line:r},end:{line:o}}=e.getLoc(n);for(let e=r+1;e<=o;e++)t.add(e)}for(let t of e.visitorKeys[n.type]??[]){let e=n[t];Array.isArray(e)?r.push(...e):r.push(e)}}}return t})(t);r.comments=r.comments.map(e=>e.toLowerCase());let o=new l,a=a=>{let i;if("TemplateLiteral"!==a.type||o.has(a))return;o.add(a);let s="__PLACEHOLDER__"+Math.random(),l=a.quasis.map(e=>t.getText(e).slice(1,e.tail?-1:-2)).join(s),u=l.match(/\r?\n/);if(!u)return;let p=u[0],c=t.getLoc(a),d=t.lines[c.start.line-1].match(/^(\s*)\S/),m=d?d[1]:"";i="string"==typeof r.indent?r.indent:"number"==typeof r.indent?" ".repeat(r.indent):((e,t,r,n)=>{if(""===r){let r;return dU(dV(e.lines,t)).indent||dU(dN(r=dV(n.split(/\r?\n/)))).indent||dU(r).indent||" "}return r.startsWith(" ")?" ":" "})(t,n,m,l);let f=dN(l).replaceAll(RegExp(`^${p}|${p}[ ]*$`,"g"),""),g=p+d$(f,1,{indent:m+i})+p+m;if(g!==l)return{node:a,messageId:dW,fix:t=>g.split(s).map((r,n)=>i1(a.quasis[n],r,e,t))}};e.on("TemplateLiteral",e=>{if((e=>{if(r.comments.length>0){let n=t.getTokenBefore(e,{includeComments:!0});if(n?.type==="Block"&&r.comments.includes(n.value.trim().toLowerCase()))return!0}return!!(dD(e)||r.tags.length>0&&tO(e,r.tags))||!!(r.functions.length>0&&"CallExpression"===e.parent.type&&e.parent.arguments.includes(e)&&tM(e.parent.callee,r.functions))})(e))return a(e)}),e.on(r.selectors,e=>a(e))},meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation.",recommended:!0},fixable:"code",schema:d_,defaultOptions:[{tags:["outdent","dedent","gql","sql","html","styled"],functions:["dedent","stripIndent"],selectors:[],comments:["HTML","indent"]}],messages:{[dW]:"Templates should be properly indented."},languages:["js/js"]}},"unicorn/no-single-promise-in-promise-methods":{create:e=>{e.on("CallExpression",t=>{if(!(tR(t,{object:"Promise",methods:u5,optionalMember:!1,optionalCall:!1,argumentsLength:1})&&"ArrayExpression"===t.arguments[0].type&&1===t.arguments[0].elements.length&&t.arguments[0].elements[0]&&"SpreadElement"!==t.arguments[0].elements[0].type))return;let r=t.callee.property.name,n={node:t.arguments[0],messageId:u8,data:{method:r}},{sourceCode:o}=e;if("AwaitExpression"===t.parent.type&&t.parent.argument===t&&("all"!==r||tT(t.parent.parent)))return n.fix=r=>r.replaceText(t,u4(t,e)),n;return"all"===r?(n.fix=((e,t)=>{let{sourceCode:r}=t;if(u7(r,e))return;let n=e.parent;if("AwaitExpression"!==n.type||n.argument!==e)return;let o=(e=>{let{parent:t}=e;return"VariableDeclarator"===t.type&&t.init===e&&pe(t.id)?t.id:"AssignmentExpression"===t.type&&t.right===e&&pe(t.left)&&tT(t.parent)?t.left:void 0})(n);if(o){if(u7(r,o))return;return function*(n){yield n.replaceText(o,r.getText(o.elements[0])),yield n.replaceText(e,u4(e,t))}}let a=n.parent;if("MemberExpression"===a.type&&a.computed&&ti(a.property,0)&&a.object===n&&("VariableDeclarator"===a.parent.type&&a.parent.init===a||"AssignmentExpression"===a.parent.type&&a.parent.right===a)&&!u7(r,a))return r=>r.replaceText(a,`await ${u4(e,t)}`)})(t,e),n):(n.suggest=[{messageId:u6,fix:r=>{let[n]=t.arguments[0].elements,o=to(n,e);return ta(n,e)||"Identifier"===n.type||"MemberExpression"===n.type||(o=`(${o})`),aL(e.sourceCode.getTokenBefore(t),e,o)&&(o=`;${o}`),r.replaceText(t,o)}},{messageId:u9,fix:function*(e){let r=t.callee.property;yield e.replaceText(r,"resolve");let[n]=t.arguments,a=o.getFirstToken(n),[i,s]=o.getLastTokens(n,2);yield e.remove(a),yield e.remove(s),eT(i)&&(yield e.remove(i))}}],n)})},meta:{type:"suggestion",docs:{description:"Disallow passing single-element arrays to `Promise` methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[u8]:"Wrapping single-element array with `Promise.{{method}}()` is unnecessary.",[u6]:"Use the value directly.",[u9]:"Switch to `Promise.resolve(…)`."},languages:["js/js"]}},"unicorn/no-await-in-promise-methods":{create:e=>{e.on("CallExpression",function*(t){if(tR(t,{object:"Promise",methods:dG,optionalMember:!1,optionalCall:!1,argumentsLength:1})&&"ArrayExpression"===t.arguments[0].type)for(let r of t.arguments[0].elements)r?.type==="AwaitExpression"&&(yield{node:r,messageId:dz,data:{method:t.callee.property.name},suggest:[{messageId:dK,*fix(t){let n=e.sourceCode.getFirstToken(r);yield t.remove(n),yield i_(n,e,t)}}]})})},meta:{type:"suggestion",docs:{description:"Disallow using `await` in `Promise` method parameters.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[dz]:"Promise in `Promise.{{method}}()` should not be awaited.",[dK]:"Remove `await`."},languages:["js/js"]}},"unicorn/no-negation-in-equality-check":{create:e=>{e.on("BinaryExpression",t=>{let{operator:r,left:n}=t;if(!("BinaryExpression"===t.type&&dY.has(t.operator)&&dH(n))||dH(n.argument))return;let{sourceCode:o}=e,a=o.getFirstToken(n),i=`${r.startsWith("!")?"=":"!"}${r.slice(1)}`;return{node:a,messageId:dJ,suggest:[{messageId:dX,data:{operator:i},*fix(s){yield iG(s,t,e);let l=o.getTokenAfter(a),{parent:u}=t;("ReturnStatement"===u.type||"ThrowStatement"===u.type)&&!ta(t,e)&&(oS(o.getFirstToken(u),l,e)||(yield iV(s,u,e))),yield s.remove(a),aL(o.getTokenBefore(a),e,l.value)&&(yield s.insertTextAfter(a,";"));let p=o.getTokenAfter(n,e=>"Punctuator"===e.type&&e.value===r);yield s.replaceText(p,i)}}]}})},meta:{type:"problem",docs:{description:"Disallow negated expression in equality check.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[dJ]:"Negated expression is not allowed in equality check.",[dX]:"Switch to '{{operator}}' check."},languages:["js/js"]}},"unicorn/no-unnecessary-slice-end":{create(e){dQ(e,{methods:["slice"],messageId:dZ})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.",recommended:"unopinionated"},fixable:"code",messages:{[dZ]:"Passing `{{description}}` as the `end` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-lonely-if":{create:e=>{e.on("IfStatement",t=>{if(mg(t)&&("BlockStatement"===t.parent.type&&1===t.parent.body.length&&t.parent.body[0]===t&&mg(t.parent.parent)&&t.parent.parent.consequent===t.parent||mg(t.parent)&&t.parent.consequent===t))return{node:t,messageId:mf,fix:function(e,t){let{sourceCode:r}=t;return n=>{var o,a;let i=("BlockStatement"===e.parent.type?e.parent:e).parent,s={...i,...my(i,r)},l={...e,...my(e,r)},u=mE(s,r),p=mv(s,t,r),c=mb(mx(mE(l,r)),mv(l,t,r)),d=function(e,t,r,n){let o=[...n.getRange(e)];if("BlockStatement"===t.type)return o;let a=n.getLastToken(t);if(eB(a)){let t=n.getTokenAfter(e);t&&aL(a,r,t.value)&&(o[1]=n.getRange(t)[0])}return o}(i,l.consequent,t,r),m={outerConditionGap:s.openingBraceToken?mx(mh(s.closingParenthesisToken,s.openingBraceToken,r)):"",outerLeadingContent:s.openingBraceToken?mx(mh(s.openingBraceToken,l.ifToken,r)):mx(mh(s.closingParenthesisToken,l.ifToken,r)),outerTrailingContent:s.openingBraceToken?mx(mh(l,s.closingBraceToken,r)):""},f=(o=m.outerConditionGap,a=m.outerLeadingContent,o.trimStart().startsWith("//")?{leadingStatementText:mx(a).trimStart(),conditionSuffixText:o}:{leadingStatementText:mx(mb(o,a)).trimStart(),conditionSuffixText:""}),{leadingStatementText:g}=f,y=function({outerIfStatement:e,inner:t,replacementRange:r,sourceCode:n,consequentTextPieces:o,outerConditionGapTextPieces:a}){let{outerTrailingContent:i}=o,{conditionSuffixText:s}=a;if("BlockStatement"===t.consequent.type){let e=mh(t.closingParenthesisToken,t.openingBraceToken,n),r=mh(t.openingBraceToken,t.closingBraceToken,n);return`${s}${e}{${r}${i}}`}let l=mh(t.closingParenthesisToken,t.consequent,n),u=`${s}${l}${((e,t)=>{let[r,n]=t.getRange(e);return t.text.slice(r,n)})(t.consequent,n)}${i}`;return`${u}${((e,t,r)=>{let[,n]=r.getRange(e);if(t[1]===n)return"";let o=r.text.slice(n,t[1]);return""===o.trim()?o.includes("\n")?`;${o}`:";":`;${o}`})(e,r,n)}`}({outerIfStatement:i,inner:l,replacementRange:d,sourceCode:r,consequentTextPieces:m,outerConditionGapTextPieces:f});return n.replaceTextRange(d,`${g}if${u}(${p} && ${c})${y}`)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Disallow `if` statements as the only statement in `if` blocks without `else`.",recommended:"unopinionated"},fixable:"code",messages:{[mf]:"Unexpected `if` as the only statement in a `if` block without `else`."},languages:["js/js"]}},"unicorn/no-magic-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{method:"flat",argumentsLength:1,optionalCall:!1}))return;let[r]=t.arguments;if(!tp(r)||1===r.value)return;let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a}=rD(t,e);if(!(n.commentsExistBetween(o,a)||nL(t.callee.object,e)))return{node:r,messageId:mS}})},meta:{type:"suggestion",docs:{description:"Disallow a magic number as the `depth` argument in `Array#flat(…).`",recommended:"unopinionated"},messages:{[mS]:"Magic number as depth is not allowed."},languages:["js/js"]}},"unicorn/no-negated-condition":{create:e=>{e.on(["IfStatement","ConditionalExpression"],t=>{if("IfStatement"===t.type&&(!t.alternate||"IfStatement"===t.alternate.type))return;let{test:r}=t;if("UnaryExpression"===r.type&&"!"===r.operator||"BinaryExpression"===r.type&&("!="===r.operator||"!=="===r.operator))return{node:r,messageId:mC,*fix(n){if(yield function*(e,t,r){let{sourceCode:n}=r,{test:o}=t;if("UnaryExpression"===o.type){let a=n.getFirstToken(o);"IfStatement"===t.type&&(yield iM(o.argument,e,r)),yield e.remove(a);return}let a=n.getTokenAfter(o.left,e=>"Punctuator"===e.type&&e.value===o.operator);yield e.replaceText(a,"="+a.value.slice(1))}(n,t,e),yield function*(e,t,r){let n="IfStatement"===t.type,[o,a]=[t.consequent,t.alternate].map(e=>{let t=tn(e,r),o=r.sourceCode.text.slice(...t);return n&&"BlockStatement"!==e.type&&(o=`{${o}}`),{range:t,text:o}});if(o.text===a.text)return;let{sourceCode:i}=r;yield e.replaceTextRange(i.getRange(o),a.text),yield e.replaceTextRange(i.getRange(a),o.text)}(n,t,e),"ConditionalExpression"!==t.type||"UnaryExpression"!==r.type)return;yield iG(n,t,e);let{sourceCode:o}=e,{parent:a}=t,[i,s]=o.getFirstTokens(r,2);"ReturnStatement"!==a.type&&"ThrowStatement"!==a.type||a.argument!==t||oS(i,s,e)||ta(t,e)||ta(r,e)?aL(o.getTokenBefore(t),e,s.value)&&(yield n.insertTextBefore(t,";")):yield iV(n,a,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow negated conditions.",recommended:"unopinionated"},fixable:"code",messages:{[mC]:"Unexpected negated condition."},languages:["js/js"]}},"unicorn/no-object-as-default-parameter":{create:e=>{e.on("AssignmentPattern",e=>{if(!("ObjectExpression"===e.right.type&&e.right.properties.length>0&&tw(e.parent)&&e.parent.params.includes(e)))return;let{left:t,right:r}=e;return"Identifier"===t.type?{node:t,messageId:mD,data:{parameter:t.name}}:{node:r,messageId:mT}})},meta:{type:"problem",docs:{description:"Disallow the use of objects as default parameters.",recommended:"unopinionated"},messages:{[mD]:"Do not use an object literal as default for parameter `{{parameter}}`.",[mT]:"Do not use an object literal as default."},languages:["js/js"]}},"unicorn/prefer-negative-index":{create:e=>{e.on("CallExpression",t=>{if("MemberExpression"!==t.callee.type)return;let r=function(e){let{callee:t,arguments:r}=e,n=t.property.name,o=t.object,a=r;if(mw.has(n))return{method:n,target:o,argumentsNodes:a};if("call"!==n&&"apply"!==n||(n=mk(t.object),!mw.has(n)))return;let i="apply"===t.property.name,{supportObjects:s}=mw.get(n),l=t.object.object;if(tC(l)||"slice"===n&&ti(l,"")||"prototype"===mk(l)&&"Identifier"===l.object.type&&s.has(l.object.name)){if([o]=r,i){let[,e]=r;if(!e||"ArrayExpression"!==e.type)return;a=e.elements}else a=r.slice(1);return{method:n,target:o,argumentsNodes:a}}}(t);if(!r)return;let{method:n,target:o,argumentsNodes:a}=r,{argumentsIndexes:i}=mw.get(n),s=i.map(e=>(function e(t,r){let n;if(!t)return;let{type:o,operator:a,left:i,right:s}=t=rN(t);if("BinaryExpression"===o&&"-"===a&&tp(n=rN(s))&&n.value>0)return pF(i,r)?i:e(i,r)})(a[e],o)).filter(Boolean);if(0!==s.length)return{node:t,messageId:mA,data:{method:n},*fix(t){for(let r of s)yield function(e,t,r){let[n,o]=tn(e,r);return t.removeRange([n,o+r.sourceCode.text.slice(o).match(/\S|$/).index])}(r,t,e)}}})},meta:{type:"suggestion",docs:{description:"Prefer negative index over `.length - index` when possible.",recommended:"unopinionated"},fixable:"code",messages:{[mA]:"Prefer negative index over length minus index for `{{method}}`."},languages:["js/js"]}},"unicorn/prefer-node-protocol":{create:e=>{e.on("Literal",t=>{if(!(["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","ImportExpression","TSImportType"].includes(t.parent.type)&&t.parent.source===t||(tR(t.parent,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tN(t.parent))&&t.parent.arguments[0]===t))return;let{value:r}=t;if(!("string"==typeof r&&!r.startsWith(mB)&&mj(r)&&mj(`${mB}${r}`)))return;let n=e.sourceCode.getRange(t)[0]+1;return{node:t,messageId:mF,data:{moduleName:r},fix:e=>e.insertTextAfterRange([n,n],mB)}})},meta:{type:"suggestion",docs:{description:"Prefer using the `node:` protocol when importing Node.js builtin modules.",recommended:"unopinionated"},fixable:"code",messages:{[mF]:"Prefer `node:{{moduleName}}` over `{{moduleName}}`."},languages:["js/js"]}},"unicorn/consistent-date-clone":{create:e=>{e.on("NewExpression",t=>{if(!tE(t,{name:"Date",argumentsLength:1}))return;let[r]=t.arguments;if(!tR(r,{method:"getTime",argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let{sourceCode:n}=e;return{node:r,loc:{start:n.getLoc(r.callee.property).start,end:n.getLoc(r).end},messageId:mR,fix:t=>iH(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer passing `Date` directly to the constructor when cloning.",recommended:"unopinionated"},fixable:"code",messages:{[mR]:"Unnecessary `.getTime()` call."},languages:["js/js"]}},"unicorn/no-accessor-recursion":{create:e=>{let{sourceCode:t}=e;e.on("ThisExpression",e=>{let r=((e,t)=>{for(let r=e.getScope(t);r;r=r.upper){if("class"===r.type)return;if("function"===r.type&&"ArrowFunctionExpression"!==r.block.type)return r}})(t,e);if(!r)return;let n=r.block.parent;if(["Property","MethodDefinition"].includes(n?.type)&&!n.computed&&["set","get"].includes(n.kind)&&mL(n.key)&&("get"===n.kind&&(m$(e,n)||"VariableDeclarator"===e.parent.type&&e.parent.init===e&&"ObjectPattern"===e.parent.id.type&&e.parent.id.properties.some(e=>"Property"===e.type&&!e.computed&&mN(e.key,n.key)))||"set"===n.kind&&((e,t)=>{if(!m$(e,t))return!1;let r=e.parent,{parent:n}=r;return("AssignmentExpression"===n.type||"AssignmentPattern"===n.type)&&n.left===r||"UpdateExpression"===n.type&&n.argument===r||"ArrayPattern"===n.type&&n.elements.includes(r)||"RestElement"===n.type&&n.argument===r||("ForOfStatement"===n.type||"ForInStatement"===n.type)&&n.left===r||"Property"===n.type&&n.value===r&&"ObjectPattern"===n.parent.type&&n.parent.properties.includes(r.parent)})(e,n)))return{node:e.parent,messageId:mP,data:{kind:n.kind}}})},meta:{type:"problem",docs:{description:"Disallow recursive access to `this` within getters and setters.",recommended:"unopinionated"},defaultOptions:[],messages:{[mP]:"Disallow recursive access to `this` within {{kind}}ters."},languages:["js/js"]}},"unicorn/prefer-import-meta-properties":{create:function(e){let{sourceCode:t}=e;e.on("MetaProperty",function*(e){if("MetaProperty"!==e.type||"import"!==e.meta.name||"meta"!==e.property.name)return;let r=e.parent;if(!tF(r,{properties:["url","filename"],computed:!1,optional:!1}))return;let n=r.property.name;if("url"===n){if(mU(r.parent,t)&&r.parent.arguments[0]===r)return void(yield a(r.parent,{reportFilenameNode:!0}));if(tE(r.parent,{name:"URL",minimumArguments:1,maximumArguments:2})){var o;let e=r.parent,n=e.parent;if(1===e.arguments.length&&e.arguments[0]===r&&mU(n,t)&&n.arguments[0]===e)return void(yield a(n,{reportFilenameNode:!0}));2===e.arguments.length&&(o=e.arguments[0],o?.type==="Literal"&&("."===o.value||"./"===o.value))&&e.arguments[1]===r&&mU(n,t)&&n.arguments[0]===e&&(yield i(n,"dirname"))}return}function*a(e,{reportFilenameNode:r=!1}={}){let{parent:n}=e;if(mW(n,t)&&n.arguments[0]===e)return void(yield i(n,"dirname"));if(r&&(yield i(e,"filename")),"VariableDeclarator"!==n.type||n.init!==e||"Identifier"!==n.id.type||"VariableDeclaration"!==n.parent.type||"const"!==n.parent.kind)return;let o=eS(t.getScope(n.id),n.id);if(o)for(let e of o.references){if(!e.isReadOnly())continue;let{parent:r}=e.identifier;mW(r,t)&&r.arguments[0]===e.identifier&&(yield i(r,"dirname"))}}function i(e,t){return{node:e,messageId:"dirname"===t?mM:mO,fix:r=>r.replaceText(e,`import.meta.${t}`)}}"filename"===n&&(yield a(r))})},meta:{type:"suggestion",docs:{description:"Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.",recommended:!1},fixable:"code",messages:{[mM]:"Do not construct dirname.",[mO]:"Do not construct filename using `fileURLToPath()`."},languages:["js/js"]}},"unicorn/no-unnecessary-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!(tR(t,{method:"flat",argumentsLength:1,optionalCall:!1})&&ti(t.arguments[0],1))||nL(t.callee.object,e))return;let[r]=t.arguments;return{node:r,messageId:mV,fix:t=>iq(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Disallow using `1` as the `depth` argument of `Array#flat()`.",recommended:"unopinionated"},fixable:"code",messages:{[mV]:"Passing `1` as the `depth` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-unnecessary-array-splice-count":{create(e){dQ(e,{methods:["splice","toSpliced"],messageId:m_,checkArrayReceiver:!0})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.",recommended:"unopinionated"},fixable:"code",messages:{[m_]:"Passing `{{description}}` as the `{{argumentName}}` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-useless-error-capture-stack-trace":{create:e=>{let t=[],r=[];e.on(["ClassDeclaration","ClassExpression"],e=>{t.push(e),r.push(e)}),e.onExit(["ClassDeclaration","ClassExpression"],()=>{t.pop(),r.pop()}),e.on(["FunctionDeclaration","FunctionExpression"],e=>{r.push(e)}),e.onExit(["FunctionDeclaration","FunctionExpression"],()=>{r.pop()}),e.on("CallExpression",n=>{let o,a=t.at(-1);if(!(a?.superClass&&"Identifier"===a.superClass.type&&uu.includes(a.superClass.name)&&e.sourceCode.isGlobalReference(a.superClass)&&(o=r.at(-1),o&&"MethodDefinition"===o.parent.type&&"constructor"===o.parent.kind&&o.parent.value===o&&a.body.body.includes(o.parent))&&tR(n,{object:"Error",method:"captureStackTrace",argumentsLength:2,optionalMember:!1})&&e.sourceCode.isGlobalReference(n.callee.object)))return;let[i,s]=n.arguments;if("ThisExpression"!==i.type||!((e,t,r)=>{if("MetaProperty"===e.type&&"Identifier"===e.meta.type&&"new"===e.meta.name&&"Identifier"===e.property.type&&"target"===e.property.name||tF(e,{property:"constructor",computed:!1,optional:!1})&&"ThisExpression"===e.object.type)return!0;if("Identifier"!==e.type||!t.id)return!1;let n=eS(r.sourceCode.getScope(e),e);return n&&1===n.defs.length&&"ClassName"===n.defs[0].type&&n.defs[0].node===t})(s,a,e))return;let l={node:n,messageId:mz},u="ChainExpression"===n.parent.type?n.parent.parent:n.parent;return"ExpressionStatement"===u.type&&"BlockStatement"===u.parent.type&&(l.fix=e=>e.remove(u)),l})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Error.captureStackTrace(…)`.",recommended:"unopinionated"},fixable:"code",messages:{[mz]:"Unnecessary `Error.captureStackTrace(…)` call."},languages:["js/js"]}},"unicorn/prefer-class-fields":{create:e=>{let{sourceCode:t}=e;e.on("ClassBody",r=>{let n=r.body.find(e=>"constructor"===e.kind&&!e.computed&&!e.static&&"MethodDefinition"===e.type&&"FunctionExpression"===e.value.type);if(!n)return;let o=n.value.body.body.find(e=>"EmptyStatement"!==e.type);if(!(o?.type==="ExpressionStatement"&&"AssignmentExpression"===o.expression.type&&"="===o.expression.operator&&"MemberExpression"===o.expression.left.type&&"ThisExpression"===o.expression.left.object.type&&!o.expression.left.computed&&["Identifier","PrivateIdentifier"].includes(o.expression.left.property.type)&&"Literal"===o.expression.right.type))return;let a=o.expression.left.property.name,i=o.expression.right.raw,s=o.expression.left.property.type,l=r.body.find(e=>"PropertyDefinition"===e.type&&!e.computed&&!e.static&&e.key.type===s&&e.key.name===a),u={node:o,messageId:mK};function*p(s){if(yield((e,t,r)=>{let{line:n}=t.getLoc(e).start,o=t.getText(e);return t.lines[n-1].trim()===o?r.removeRange([t.getIndexFromLoc({line:n,column:0}),t.getIndexFromLoc({line:n+1,column:0})]):r.remove(e)})(o,t,s),l){if(l.value)return void(yield s.replaceText(l.value,i));let e=` = ${i}`,r=t.getLastToken(l);return eA(r)?void(yield s.insertTextBefore(r,e)):void(yield s.insertTextAfter(l,`${e};`))}let u=t.getLastToken(r),p=rR(n,e),c=`${p}${a} = ${i};
48
- `;"\n"!==t.getText()[t.getRange(u)[0]-1]&&(c=`
49
- ${c}`);let d=r.body.at(-1);"PropertyDefinition"===d.type&&";"!==t.getLastToken(d).value&&(c=`;${c}`),yield s.insertTextBefore(u,c)}return l?.value?u.suggest=[{messageId:mG,fix:p}]:u.fix=p,u})},meta:{type:"suggestion",docs:{description:"Prefer class field declarations over `this` assignments in constructors.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[mK]:"Prefer class field declaration over `this` assignment in constructor for static values.",[mG]:"Encountered same-named class field declaration and `this` assignment in constructor. Replace the class field declaration with the value from `this` assignment."},languages:["js/js"]}},"unicorn/prefer-bigint-literals":{create:e=>{e.on("CallExpression",t=>{if(!tb(t,{name:"BigInt",argumentsLength:1,optional:!1},ty))return;let[r]=t.arguments,n=function(e){let t,r;if(ts(e)){let t,r=e.raw.slice(1,-1);try{t=BigInt(r)}catch{return}let n=0n===t?"0":r.trim();return n.startsWith("+")&&(n=n.slice(1).trim()),{shouldUseSuggestion:r.includes("+"),text:`${n}n`,bigint:t}}let n=!1,o=!1;for(;"UnaryExpression"===e.type&&e.prefix;)if("+"===e.operator)n=!0,e=e.argument;else{if("-"!==e.operator)return;o=!o,e=e.argument}let{value:a,raw:i}=e;if(Number.isInteger(a)){try{t=BigInt(a)}catch{return}return(e=>{let t=e.raw.replaceAll("_","").toLowerCase();if(t.includes("."))return!1;let{value:r}=e;for(let{prefix:e,base:n}of[{prefix:"0b",base:2},{prefix:"0o",base:8},{prefix:"0x",base:16}])if(t.startsWith(e))return t.slice(2)===r.toString(n);return!t.includes("e")&&t===String(r)})(e)?r=`${i}n`:(r=`${t}n`,n=!0),o&&0n!==t&&(r=`-${r}`,t=-t),{shouldUseSuggestion:n,text:r,bigint:t}}}(r);if(!n)return;let o={node:t,messageId:mJ},{shouldUseSuggestion:a,text:i,bigint:s}=n,l=r=>{let n=i;return!ta(t,e)&&s<0n&&(n=`(${n})`,aL(e.sourceCode.getTokenBefore(t),e,n)&&(n=`;${n}`)),r.replaceText(t,n)};return a||e.sourceCode.getCommentsInside(t).length>0?o.suggest=[{messageId:mX,data:{replacement:i.length<20?`\`${i}\``:"a bigint literal"},fix:l}]:o.fix=l,o})},meta:{type:"suggestion",docs:{description:"Prefer `BigInt` literals over the constructor.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[mJ]:"Prefer using bigint literal over `BigInt(…)`.",[mX]:"Replace with {{replacement}}."},languages:["js/js"]}},"unicorn/prefer-classlist-toggle":{create:e=>{let{sourceCode:t}=e;e.on(["IfStatement","ConditionalExpression"],r=>{let n=[r.consequent,r.alternate].map(e=>{if(e)return"BlockStatement"===e.type&&1===e.body.length&&(e=e.body[0]),"ExpressionStatement"===e.type&&(e=e.expression),"ChainExpression"===e.type&&(e=e.expression),e});if(n.some(e=>!m1(e,["add","remove"])))return;let[o,a]=n;if(o.callee.property.name!==a.callee.property.name&&m2(o,a))return mZ(r,function*(n){let i=to(o.callee.object.object,e),s=to(o.arguments[0],e),l="ConditionalExpression"===r.type,u="remove"===o.callee.property.name,p=r.test,c=m3(p,u,o),d=c?"":m0(p,e,u),m=o.callee.object.optional||a.callee.object.optional||c?.callee.object.optional,f=`${i}${m?"?":""}.classList.toggle(${s}${d?`, ${d}`:""})`;l||(f+=";"),aL(t.getTokenBefore(r),e,f)&&(f=`;${f}`),yield n.replaceText(r,f),l&&(yield iG(n,r,e))})}),e.on("ConditionalExpression",t=>{let r=[t.consequent,t.alternate];if(!(r.every(e=>ts(e)&&("add"===e.value||"remove"===e.value))&&r[0].value!==r[1].value&&"MemberExpression"===t.parent.type&&t.parent.computed&&!t.parent.optional&&t.parent.property===t&&mQ(t.parent.object)&&tb(t.parent.parent,{optional:!1,argumentsLength:1},ty)&&t.parent.parent.callee===t.parent))return;let n=t.parent,o=n.parent;return mZ(o,function*(r){let a="remove"===t.consequent.value,i=t.test,s=m3(i,a,o)?"":m0(i,e,a);s&&(yield r.insertTextAfter(o.arguments[0],`, ${s}`)),yield iX(r,n,e,".toggle")},t)})},meta:{type:"suggestion",docs:{description:"Prefer using `Element#classList.toggle()` to toggle class names.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[mY]:"Prefer using `Element#classList.toggle()` to toggle class names.",[mH]:"Replace with `Element#classList.toggle()`."},languages:["js/js"]}},"unicorn/require-module-attributes":{create:e=>{let{sourceCode:t}=e;e.on(["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration"],e=>{let{source:r,attributes:n}=e;if(!r||Array.isArray(n)&&n.length>0)return;let o=t.getTokenAfter(r);if(o?.type!=="Keyword"||"with"!==o.value)return;let a=t.getTokenAfter(o),i=t.getTokenAfter(a);return{node:e,loc:{start:t.getLoc(a).start,end:t.getLoc(i).end},messageId:m8,data:{type:"ImportDeclaration"===e.type?"import statement":"export statement"},fix:e=>[o,i,a].map(t=>e.remove(t))}}),e.on("ImportExpression",r=>{let{options:n}=r;if(n?.type!=="ObjectExpression")return;let o=n.properties.find(e=>"Property"===e.type&&!e.method&&!e.shorthand&&!e.computed&&"init"===e.kind&&("Identifier"===e.key.type&&"with"===e.key.name||"Literal"===e.key.type&&"with"===e.key.value)&&tD(e.value)),a=0===n.properties.length||o&&1===n.properties.length?n:o;if(!a)return;let i="Property"===a.type;return{node:o?.value??a,messageId:m8,data:{type:"import expression"},fix:r=>i?function*(e,t,r){let{sourceCode:n}=r;for(let r of n.getTokens(t))yield e.remove(r);let o=n.getTokenAfter(t);if(eT(o))yield e.remove(o);else{let{properties:r}=t.parent;if(r.length>1&&r.at(-1)===t){let r=n.getTokenBefore(t);yield e.remove(r)}}}(r,a,e):[t.getTokenBefore(a,eT),...t.getTokens(a),...tr(a,e)].map(e=>r.remove(e))}})},meta:{type:"suggestion",docs:{description:"Require non-empty module attributes for imports and exports",recommended:"unopinionated"},fixable:"code",messages:{[m8]:"{{type}} with empty attribute list is not allowed."},languages:["js/js"]}},"unicorn/no-immediate-mutation":{create:e=>{for(let t of fi)e.on(["VariableDeclarator","AssignmentExpression"],r=>(function(e,t,{testValue:r,getProblematicNode:n,getProblem:o,getFix:a}){let i,s="AssignmentExpression"===t.type,[l,u]=(s?["left","right"]:["id","init"]).map(e=>t[e]);if(!("Identifier"===l.type&&r(u)))return;let p=t.parent;if(!(s&&"="===t.operator&&"ExpressionStatement"===p.type&&p.expression===t||!s&&"VariableDeclaration"===(i=t.parent).type&&i.declarations.at(-1)===t))return;let c=ig(p,e);if(c?.type!=="ExpressionStatement")return;let d="VariableDeclarator"===t.type?e.sourceCode.getDeclaredVariables(t).find(e=>1===e.defs.length&&e.defs[0].name===t.id):eS(e.sourceCode.getScope(t),t.left.name);if(!d)return;let m={context:e,variable:d,variableNode:l,valueNode:u,statement:p,nextExpressionStatement:c,assignType:s?"assignment":"declaration",getFix:a},f=n(m);if(f)return o(f,m)})(e,r,t))},meta:{type:"suggestion",docs:{description:"Disallow immediate mutation after variable assignment.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[m6]:"Immediate mutation on {{objectType}} is not allowed.",[m9]:"{{operation}} the elements to the {{assignType}}.",[m5]:"Move this property to the {{assignType}}.",[m4]:"{{description}} the {{assignType}}.",[m7]:"Move the element to the {{assignType}}.",[fe]:"Move the entry to the {{assignType}}."},languages:["js/js"]}},"unicorn/no-useless-collection-argument":{create:e=>{e.on("NewExpression",t=>{var r;let n;if(!tE(t,{names:["Set","Map","WeakSet","WeakMap"],argumentsLength:1}))return;let[o]=t.arguments,a="LogicalExpression"===o.type&&"??"===o.operator,i=a?o.right:o,s=tC(r=i)?"empty array":ti(r,"")?"empty string":td(r)?"`null`":tq(r)?"`undefined`":void 0;if(!s)return;let l=!1;if(a)n=function*(t){let{sourceCode:r}=e,n=i.parent,{left:o}=n,a=ta(o,e),[,s]=a?tn(o,e):r.getRange(o),[,l]=r.getRange(n);yield t.removeRange([s,l]),(a||"SequenceExpression"!==o.type)&&(yield iM(n,t,e))};else e.sourceCode.getCommentsInside(i).length>0&&(l=!0),n=t=>iq(t,i,e);let u={node:i,messageId:fs,data:{description:s}};return l?u.suggest=[{messageId:fl,fix:n}]:u.fix=n,u})},meta:{type:"suggestion",docs:{description:"Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[fs]:"The {{description}} is useless.",[fl]:"Remove the {{description}}"},languages:["js/js"]}},"unicorn/prefer-response-static-json":{create:e=>{e.on("NewExpression",t=>{if(!tE(t,{name:"Response",minimumArguments:1}))return;let[r]=t.arguments;if(tR(r,{object:"JSON",method:"stringify",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return{node:r.callee,messageId:fu,*fix(n){yield n.insertTextAfter(t.callee,".json"),yield iz(t,e,n);let[o]=r.arguments,a=tn(r,e),i=tn(o,e);yield n.removeRange([a[0],i[0]]),yield n.removeRange([i[1],a[1]]),!ta(t,e)&&ta(t.callee,e)&&aL(e.sourceCode.getTokenBefore(t),e,"(")&&(yield n.insertTextBefore(t,";"))}}})},meta:{type:"suggestion",docs:{description:"Prefer `Response.json()` over `new Response(JSON.stringify())`.",recommended:"unopinionated"},fixable:"code",messages:{[fu]:"Prefer using `Response.json(…)` over `JSON.stringify()`."},languages:["js/js"]}},"unicorn/filename-case":{create:e=>{let t=e.physicalFilename;if("<input>"===t||"<text>"===t)return;let r=e.options[0]||{},n=function(e){if(e.case)return[e.case];if(e.cases){let t=Object.keys(e.cases).filter(t=>e.cases[t]);return t.length>0?t:["kebabCase"]}return["kebabCase"]}(r),o=(r.ignore||[]).map(e=>v.isRegExp(e)?e:RegExp(e,"u")),a=!1!==r.multipleFileExtensions,i=!1!==r.checkDirectories,s=n.map(e=>fL[e].fn);e.on(rZ,r=>{if("Document"!==r.type||r.parent?.type!=="Program")return(()=>{var r;let l,u,p=(r=e.cwd,""===(l=S.relative(r,S.resolve(r,t)))||".."===l||l.startsWith(`..${S.sep}`)||S.isAbsolute(l)?[S.basename(t)]:l.split(S.sep).filter(e=>"."!==e)),{basename:c,filename:d,middle:m,extension:f}=function(e,{multipleFileExtensions:t}){let r=S.extname(e),n=S.basename(e,r),o={basename:n+r,filename:n,middle:"",extension:r};if(t){let[e]=n.split(".",1);Object.assign(o,{filename:e,middle:n.slice(e.length)})}return o}(p.at(-1),{multipleFileExtensions:a});if(p.some(e=>o.some(t=>t.test(e))))return;if(i)for(let e of p.slice(0,-1)){let t=function(e,t,r){let n,{leading:o,words:a}=fO(e);if(e.startsWith("$")||fN(a,r))return;let i=f$(a,r,{leading:o,trailing:""});return{loc:{column:0,line:1},messageId:fT,data:{directory:e,chosenCases:fq(t),renamedDirectories:(n=i.map(e=>`\`${e}\``),fI.format(n))}}}(e,n,s);if(t)return t}if(fk.has(c))return;let{leading:g,words:y}=fO(d);if(d.startsWith("$")||fN(y,s))return f!==f.toLowerCase()?{loc:{column:0,line:1},messageId:fA,data:{filename:d+m+f.toLowerCase(),extension:f}}:void 0;let h=f$(y,s,{leading:g,trailing:m+f.toLowerCase()});return{loc:{column:0,line:1},messageId:fD,data:{chosenCases:fq(n),renamedFilenames:(u=h.map(e=>`\`${e}\``),fI.format(u))}}})()})},meta:{type:"suggestion",docs:{description:"Enforce a case style for filenames and directory names.",recommended:!0},schema:fU,defaultOptions:[],messages:{[fD]:"Filename is not in {{chosenCases}}. Rename it to {{renamedFilenames}}.",[fT]:"Directory name `{{directory}}` is not in {{chosenCases}}. Rename it to {{renamedDirectories}}.",[fA]:"File extension `{{extension}}` is not in lowercase. Rename it to `{{filename}}`."},languages:["*"]}},"unicorn/consistent-template-literal-escape":{create:e=>{e.on("TemplateElement",t=>{if(tO(t.parent))return;let{raw:r}=t.value,n=r.replaceAll(/(?<=(?:^|[^\\])(?:\\\\)*)\\?\$\\{/g,"\\${");if(r!==n)return{node:t,messageId:fW,fix:r=>i1(t,n,e,r)}})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for escaping `${` in template literals.",recommended:!0},fixable:"code",messages:{[fW]:"Use `\\${` instead of `$\\{` to escape in template literals."},languages:["js/js"]}},"unicorn/no-useless-iterator-to-array":{create:e=>{e.on("NewExpression",t=>{if(!(tE(t,{names:["Map","WeakMap","Set","WeakSet"],argumentsLength:1})||tE(t,{names:r9,minimumArguments:1}))||!f8(t.arguments[0]))return;let r=t.arguments[0],n=1===t.arguments.length?f6(r,e):void 0,o=t.arguments.length>1?f9(r,e,f0):void 0;return{node:r.callee.property,messageId:fX,data:{description:`new ${t.callee.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}}),e.on("CallExpression",t=>((e,t)=>{if(!tR(e,{objects:["Array",...r9],method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!f8(e.arguments[0]))return;let r=e.arguments[0],n=1===e.arguments.length?f6(r,t):void 0,o=e.arguments.length>1?f9(r,t,f0):void 0;return{node:r.callee.property,messageId:fX,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}})(t,e)??((e,t)=>{if(!tR(e,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!f8(e.arguments[0]))return;let r=e.arguments[0],n=1===e.arguments.length?f6(r,t):void 0,o=e.arguments.length>1?f9(r,t,f0):void 0;return{node:r.callee.property,messageId:fX,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}})(t,e)??((e,t)=>{if(!tR(e,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||!f8(e.arguments[0]))return;let r=e.arguments[0],n=f9(r,t,f0);return{node:r.callee.property,messageId:fX,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{suggest:[n]}}})(t,e)??((e,t)=>{var r,n;if(!(tR(e,{methods:f2,maximumArguments:1,optionalCall:!1,optionalMember:!1})||tR(e,{method:f3,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))||!f8(e.callee.object))return;let o=e.arguments[0],a=e.callee.property.name,i=a===f3;if(r=o,n=i?3:2,r&&("ArrowFunctionExpression"===(r=fJ(r)).type||"FunctionExpression"===r.type)&&(r.params.length>n||r.params.at(-1)?.type==="RestElement"||"FunctionExpression"===r.type&&t.sourceCode.getTokens(r).some(e=>"Identifier"===e.type&&"arguments"===e.value)))return;let s=e.callee.object,l=f9(s,t,f1,{method:a});return{node:s.callee.property,messageId:fZ,data:{method:a},...l&&{suggest:[l]}}})(t,e)),e.on("ForOfStatement",t=>{if(!f8(t.right))return;let r=f6(t.right,e);return{node:t.right.callee.property,messageId:fY,...r&&{fix:r}}}),e.on("YieldExpression",t=>{if(!t.delegate||!f8(t.argument))return;let r=f6(t.argument,e);return{node:t.argument.callee.property,messageId:fH,...r&&{fix:r}}}),e.on("SpreadElement",t=>{if(!f8(t.argument))return;let{parent:r}=t;if("ArrayExpression"!==r.type&&"CallExpression"!==r.type&&"NewExpression"!==r.type)return;let n=f6(t.argument,e);return{node:t.argument.callee.property,messageId:fQ,...n&&{fix:n}}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `.toArray()` on iterators.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[fX]:"`{{description}}` accepts an iterable, `.toArray()` is unnecessary.",[fY]:"`for…of`/`for await…of` can iterate over an iterable, `.toArray()` is unnecessary.",[fH]:"`yield*` can delegate to an iterable, `.toArray()` is unnecessary.",[fQ]:"Spread works on iterables, `.toArray()` is unnecessary.",[fZ]:"`Iterator` has a `.{{method}}()` method, `.toArray()` is unnecessary.",[f0]:"Remove `.toArray()`.",[f1]:"Remove `.toArray()` and use `Iterator#{{method}}()`."},languages:["js/js"]}},"unicorn/prefer-simple-condition-first":{create:e=>{let{sourceCode:t}=e;e.on("LogicalExpression",r=>{if("&&"!==r.operator&&"||"!==r.operator||function(e){let{operator:t}=e,{parent:r}=e;for(;rL(r)&&r.expression===e;)r=(e=r).parent;return r?.type==="LogicalExpression"&&r.operator===t}(r)||!function e(t,r){if(tG(t,r)||tJ(t))return!0;let{parent:n}=t;return rL(n)&&n.expression===t&&e(n,r)}(r,e))return;let n=function e(t,r,n=[]){let o=rN(t);return"LogicalExpression"!==o.type||o.operator!==r?n.push(t):(e(o.left,r,n),e(o.right,r,n)),n}(r,r.operator),o=n.map(e=>({operand:e,isSimple:gt(e)})),a=o.findIndex(({isSimple:e})=>!e),i=o.findIndex(({isSimple:e},t)=>e&&t>a);if(-1===a||-1===i)return;let s=[...o.filter(({isSimple:e})=>e),...o.filter(({isSimple:e})=>!e)].map(({operand:e})=>e),l=o.findLastIndex(({isSimple:e})=>e),u=o.every(({operand:e,isSimple:t},r)=>{var n;return t||r>l||gt(n=e)||function e(t){let r=rN(t);return"ConditionalExpression"===r.type&&[r.test,r.consequent,r.alternate].every(t=>gt(t)||ge(t)||e(t))}(n)}),p=u&&!function e(t,r){if(rL(t)){let e=rN(t);return"LogicalExpression"===e.type&&e.operator===r}return"LogicalExpression"===t.type&&t.operator===r&&(e(t.left,r)||e(t.right,r))}(r,r.operator)&&!function(e,t,r){let{sourceCode:n}=r;if(n.getCommentsInside(e).length>0)return!0;let[o]=t,a=t.at(-1),[i]=tn(o,r),[,s]=tn(a,r),l={range:[i,s]};return eF(n.getTokenBefore(l,{includeComments:!0}))||eF(n.getTokenAfter(l,{includeComments:!0}))}(r,n,e)?n=>n.replaceTextRange(t.getRange(r),s.map((t,n)=>(function(e,t,{operator:r,property:n}){let o=ta(e,t),a=o?to(e,t):t.sourceCode.getText(e);return!o&&ii(e,{operator:r,property:n})&&(a=`(${a})`),a})(t,e,{operator:r.operator,property:0===n?"left":"right"})).join(` ${r.operator} `)):void 0;return{node:r,loc:t.getLoc(n[i]),messageId:u?f5:f4,data:{operator:r.operator},...p&&{fix:p}}})},meta:{type:"suggestion",docs:{description:"Prefer simple conditions first in logical expressions.",recommended:!0},fixable:"code",messages:{[f5]:"Prefer this simple condition first in the `{{operator}}` expression.",[f4]:"Consider moving this simple condition first after verifying short-circuit behavior."},languages:["js/js"]}},"unicorn/switch-case-break-position":{create:e=>{let{sourceCode:t}=e;e.on("SwitchCase",r=>{let{consequent:n}=r;if(n.length<2)return;let o=n.at(-1);if(!gn.has(o.type))return;let a=n.slice(0,-1);if(1!==a.length||"BlockStatement"!==a[0].type)return;let i=a[0];if(0===i.body.length)return;let s=function(e){switch(e.type){case"BreakStatement":return"break";case"ReturnStatement":return"return";case"ContinueStatement":return"continue";case"ThrowStatement":return"throw"}}(o);return{node:o,loc:t.getLoc(o),messageId:gr,data:{keyword:s},..."ReturnStatement"!==o.type&&"ThrowStatement"!==o.type&&{*fix(r){let n=t.getLastToken(i);if(t.getTokensBetween(n,o,{includeComments:!0}).some(e=>eF(e)))return;let a=t.getLoc(i);if(a.start.line===a.end.line||rW(e,o))return;let s=i.body.at(-1),l=t.getText(o),u=rR(s,e),p=t.getTokenBefore(n,{includeComments:!0});yield r.insertTextAfter(p,`
50
- ${u}${l}`);let c=t.getRange(n)[1],d=t.getRange(o)[1];yield r.removeRange([c,d])}}}})},meta:{type:"layout",docs:{description:"Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.",recommended:!0},fixable:"code",messages:{[gr]:"Move `{{keyword}}` inside the block statement."},languages:["js/js"]}},"unicorn/better-dom-traversing":{create:e=>{e.on("MemberExpression",t=>{let r,n=(e=>{if(gf(e)){if(gm(e.object,"childNodes"))return"childNodes";if(gm(e.object,"children"))return"children"}})(t);if(!n||oh(t.object.object)||"children"===n&&gm(r=t.object,"children")&&("Identifier"===r.object.type&&"props"===r.object.name||tF(r.object,{property:"props",optional:!1,computed:!1}))||t.parent?.type==="MemberExpression"&&t.parent.object===t&&gm(t.parent,"children")&&gf(t.parent.parent))return;let o=t.property.value;return"childNodes"===n&&0===o?{node:t,messageId:go,suggest:gy(t,"firstChild",gu,e)}:"children"===n&&0===o?{node:t,messageId:ga,suggest:gy(t,"firstElementChild",gp,e)}:"children"===n?{node:t,messageId:gi}:void 0}),e.on("MemberExpression",e=>{if(!(!gh(e)||!gh(e.object)||!(!gh(e.parent)||e.parent.object!==e)||oh((e=>{for(;gh(e);)e=e.object;return e})(e))))return{node:e,messageId:gs}}),e.on("CallExpression",t=>{if(!gb(t)||t.parent?.type==="MemberExpression"&&t.parent.object===t&&t.parent.parent?.callee===t.parent&&gb(t.parent.parent)&&gx(t.parent.parent.arguments[0])||(e=>{for(;e.parent?.type==="MemberExpression"&&e.parent.object===e||e.parent?.type==="CallExpression"&&e.parent.callee===e;)e=e.parent;return e.parent?.type==="ChainExpression"})(t))return;let r=(e=>{let t=[];for(;gb(e);){let[r]=e.arguments;if(!gx(r))break;t.push(e),e=e.callee.object}if(t.length<2||"ChainExpression"===e.type||oh(e))return;let r=[];for(let e of t)r.unshift(tu(e.arguments[0]));return{root:e,selectors:r,quoteNode:t.at(-1).arguments[0]}})(t);if(r)return{node:t,messageId:gl,suggest:((e,t,r)=>{let n,o,{sourceCode:a}=r;if(gg(e,a)||!t.selectors.every(e=>!e.includes(",")&&!e.includes(":scope")))return;let i=to(t.root,r),s=`${"Identifier"===(n=t.root).type&&"document"===n.name||"MemberExpression"===n.type&&!n.computed&&"Identifier"===n.object.type&&["globalThis","window"].includes(n.object.name)&&"Identifier"===n.property.type&&"document"===n.property.name?"":":scope "}${t.selectors.join(" ")}`,l=`${i}.querySelector(${tQ(s,"Literal"===(o=t.quoteNode).type&&o.raw.startsWith('"')?'"':"'")})`;return[{messageId:gc,fix:t=>t.replaceText(e,l)}]})(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer better DOM traversal APIs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[go]:"Prefer `.firstChild` over `.childNodes[0]`.",[ga]:"Prefer `.firstElementChild` over `.children[0]`.",[gi]:"Consider `.querySelector()` over positional child traversal.",[gs]:"Consider `.closest()` over chaining `.parentElement`.",[gl]:"Consider merging chained `.querySelector()` calls.",[gu]:"Switch to `.firstChild`.",[gp]:"Switch to `.firstElementChild`.",[gc]:"Merge the `.querySelector()` calls."},languages:["js/js"]}},"unicorn/consistent-compound-words":{create:e=>{let t=(({checkProperties:e=!1,checkVariables:t=!0,checkDefaultAndNamespaceImports:r="internal",checkShorthandImports:n="internal",checkShorthandProperties:a=!1,extendDefaultReplacements:s=!0,replacements:l={},allowList:u={}}={})=>{let p=new o(Object.entries(s?{...gT,...l}:l).filter(([,e])=>!1!==e));return{checkProperties:e,checkVariables:t,checkDefaultAndNamespaceImports:r,checkShorthandImports:n,checkShorthandProperties:a,replacements:p,replacementRegExp:p.size>0?(e=>{let t=[],r=[];for(let n of e.keys())t.push(gw(n)),r.push(gw(iy(n)));return RegExp(`(?:^(?:${t.join("|")})|(?:${r.join("|")}))${gk}`,"gv")})(p):void 0,allowList:new i(Object.keys(u))}})(e.options[0]),r=new s,n=new s,a=(e,t)=>t.every(t=>{let r=n.get(t);return!r||!r.has(e)}),l=e=>{if((e=>{if(1!==e.defs.length)return!1;let[t]=e.defs;return"ClassName"===t.type})(e)){if("class"===e.scope.type){let[t]=e.defs,n=r.get(t.name);return n?u({name:e.name,scope:e.scope,defs:e.defs,identifiers:e.identifiers,references:[...e.references,...n.references]}):u(e)}let[t]=e.defs;return void r.set(t.name,e)}return u(e)},u=r=>{var o;if(0===r.defs.length)return;let s=gI(r.name,t);if(!s)return;let[l]=r.defs;if(!(!("ImportDefaultSpecifier"===(o=l.name).parent.type&&o.parent.local===o||"ImportNamespaceSpecifier"===o.parent.type&&o.parent.local===o||"ImportSpecifier"===o.parent.type&&o.parent.local===o&&"Identifier"===o.parent.imported.type&&"default"===o.parent.imported.name||"VariableDeclarator"===o.parent.type&&o.parent.id===o&&tN(o.parent.init))||t.checkDefaultAndNamespaceImports&&("internal"!==t.checkDefaultAndNamespaceImports||gS(l)))||!(!ak(l.name,e)||t.checkShorthandImports&&("internal"!==t.checkShorthandImports||gS(l)))||!t.checkShorthandProperties&&aF(l.name))return;let u=[...r.references.map(e=>e.from),r.scope],p=r$(s)?rS(s,u,a):void 0,c=gj(l.name,p??s);if(p&&r1(r).every(e=>!("VariableDeclarator"===e.parent.type&&e.parent.id===e?"VariableDeclaration"===e.parent.parent.type&&"ExportNamedDeclaration"===e.parent.parent.parent.type:!!gE.has(e.parent.type)&&e.parent.id===e&&"ExportNamedDeclaration"===e.parent.parent.type)&&"JSXIdentifier"!==e.type)&&r.references.every(e=>!e.vueUsedInTemplate)){for(let e of u)n.has(e)||n.set(e,new i),n.get(e).add(p);c.suggest=[{messageId:gD,data:{replacement:p},fix:t=>i0(r,p,e,t)}]}e.report(c)},p=e=>{for(let t of e.variables)l(t)},c=r=>{if(!t.checkProperties||"__proto__"===r.name)return;let n=gI(r.name,t);if(!n||"ExportSpecifier"===r.parent.type||(t.checkVariables||("TSParameterProperty"===r.parent.type?r.parent.parameter!==r:"AssignmentPattern"!==r.parent.type||r.parent.left!==r||"TSParameterProperty"!==r.parent.parent.type||r.parent.parent.parameter!==r.parent))&&!("MemberExpression"===r.parent.type&&r.parent.property===r&&!r.parent.computed&&("AssignmentExpression"===r.parent.parent.type&&r.parent.parent.left===r.parent||"UpdateExpression"===r.parent.parent.type&&r.parent.parent.argument===r.parent)||"Property"===r.parent.type&&r.parent.key===r&&!r.parent.computed&&!r.parent.shorthand&&"ObjectExpression"===r.parent.parent.type||"ExportSpecifier"===r.parent.type&&r.parent.exported===r&&r.parent.local!==r||gv.has(r.parent.type)&&r.parent.key===r&&!r.parent.computed))return;let o=gj(r,n);e.report(o)};e.on("Identifier",c),e.on("PrivateIdentifier",c),e.on("Program:exit",r=>{if(t.checkVariables)for(let t of ry(e.sourceCode.getScope(r)))p(t)})},meta:{type:"suggestion",docs:{description:"Enforce consistent spelling of compound words in identifiers.",recommended:"unopinionated"},hasSuggestions:!0,schema:gF,defaultOptions:[{}],messages:{[gC]:"Prefer `{{replacement}}` over `{{name}}`.",[gD]:"Rename to `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-blob-to-file":{create:e=>{e.on("VariableDeclarator",t=>(function(e,t){let{sourceCode:r}=t,{id:n,init:o}=e;if("Identifier"!==n.type||"VariableDeclaration"!==e.parent.type||"const"!==e.parent.kind||1!==e.parent.declarations.length||"Program"!==e.parent.parent.type&&"BlockStatement"!==e.parent.parent.type)return;let a=function(e,t){if(!tE(e,{name:"File",minimumArguments:2,maximumArguments:2})||!gP(e.callee,t))return;let[r]=e.arguments,[,n]=e.arguments;if("ArrayExpression"!==r.type||1!==r.elements.length||r.elements[0]?.type==="SpreadElement"||void 0===tu(n))return;let[o]=r.elements;if(function(e,t,r){let n=gL(e,r);if(!n||r.sourceCode.getRange(n)[0]>r.sourceCode.getRange(t)[0])return!1;let o=n.init;return(tE(o,{name:"Blob",maximumArguments:1})||tE(o,{name:"File",minimumArguments:2,maximumArguments:2}))&&gP(o.callee,r)}(o,e,t))return o}(o,t);if(!a)return;let i=eS(r.getScope(n),n);if(!i)return;let s=r1(i).filter(e=>e!==n);if(1!==s.length)return;let[l]=s,u=function(e,t){let r,{parent:n}=e;return tR(n,{object:"URL",method:"createObjectURL",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&n.arguments[0]===e&&gP(n.callee.object,t)?{call:n,kind:"blobArgument"}:tR(n,{methods:["append","set"],minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})&&n.arguments[1]===e&&(r=gL(n.callee.object,t)?.init,tE(r,{name:"FormData",argumentsLength:0})&&gP(r.callee,t))?{call:n,kind:"formData"}:void 0}(l,t);if(!u)return;let p=function(e){let[,t]=e.arguments;return t}(o);if(!(!function(e,t,r){if("Identifier"!==e.type)return!0;let{sourceCode:n}=r;return eS(n.getScope(e),e)===eS(n.getScope(t),e)}(a,l,t)||function(e,t){let{sourceCode:r}=t;return r.getCommentsInside(e).length>0||r.getCommentsBefore(e).some(t=>r.getLoc(t).end.line===r.getLoc(e).start.line||r.getLoc(t).end.line===r.getLoc(e).start.line-1)||rW(t,e)}(e.parent,t))&&("formData"!==u.kind||2!==u.call.arguments.length||p))return{node:o,messageId:gB,suggest:[{messageId:gR,*fix(n){yield iQ(e.parent,t,n),yield n.replaceText(l,r.getText(a)),"formData"===u.kind&&2===u.call.arguments.length&&(yield n.insertTextAfter(l,`, ${r.getText(p)}`))}}]}})(t,e))},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Blob` to `File` conversion.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[gB]:"Use the original `Blob` instead of converting it to a `File`.",[gR]:"Replace the `File` with the original `Blob`."},languages:["js/js"]}},"unicorn/no-canvas-to-image":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",e=>{var r,n,o;if(!tR(e,{method:"drawImage",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[a]=e.arguments;if("SpreadElement"!==a.type&&(r=gM(a,t),r?.type==="CallExpression"&&!r.optional&&"Identifier"===r.callee.type&&"loadImage"===r.callee.name&&r.arguments.length>0&&"SpreadElement"!==r.arguments[0].type&&tR(n=r.arguments[0],{method:"toDataURL",optionalCall:!1,optionalMember:!1})&&("Identifier"===(o=n.callee.object).type?gO(o.name):"MemberExpression"===o.type&&!o.computed&&"Identifier"===o.property.type&&gO(o.property.name))))return{node:a,messageId:gN}}),e.on("CallExpression",e=>{if(!tR(e,{method:"putImageData",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[r]=e.arguments;if("SpreadElement"!==r.type&&tR(gM(r,t),{method:"getImageData",optionalCall:!1,optionalMember:!1}))return{node:r,messageId:gN}})},meta:{type:"suggestion",docs:{description:"Prefer drawing canvases directly instead of converting them to images.",recommended:"unopinionated"},messages:{[gN]:"Prefer drawing the canvas directly with `drawImage()`."},languages:["js/js"]}},"unicorn/no-confusing-array-splice":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{methods:["splice","toSpliced"],argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let r=function([e,t]){let r=function(e){let t=ie(e);if("number"==typeof t)return Math.max(Math.trunc(t),0)}(t);return 1===r?gq:-1===Math.trunc(ie(e))&&0===r?gU:void 0}(t.arguments);if(!r||nL(t.callee.object,e))return;let n={node:t.callee.property,messageId:r,data:{method:t.callee.property.name}},o=function(e,t,r){let{sourceCode:n}=r,{object:o,property:a}=e.callee,[i,,s]=e.arguments,l=a.name,u=to(o,r),p=n.getText(i),c=n.getText(s);if(t===gq){if(gz(e,n))return;if("toSpliced"===l){if(0>Math.trunc(ie(i))||pF(i,o))return;return{messageId:gW,fix:t=>t.replaceText(e,`${u}.with(${p}, ${c})`)}}return"ExpressionStatement"===e.parent.type&&g_(o)&&(ie(i)??0)>=0?{messageId:gW,fix:t=>t.replaceText(e,`${u}[${p}] = ${c}`)}:void 0}if(t===gU&&g_(o)&&!gz(i,n))return{messageId:gV,fix:e=>e.replaceText(i,`Math.max(${u}.length - 1, 0)`)}}(t,r,e);return o&&(n.suggest=[o]),n})},meta:{type:"suggestion",docs:{description:"Disallow confusing uses of `Array#{splice,toSpliced}()`.",recommended:!0},hasSuggestions:!0,messages:{[gq]:"Prefer a direct element replacement instead of `{{method}}()`.",[gU]:"Avoid using `{{method}}()` to insert at `-1`.",[gW]:"Use direct element replacement.",[gV]:"Resolve the insertion index explicitly."},languages:["js/js"]}},"unicorn/no-duplicate-set-values":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!tE(r,{name:"Set",argumentsLength:1}))return;let[n]=r.arguments;if("ArrayExpression"===n.type)return rB(n.elements,e).map(e=>({node:e??n,messageId:gK,data:{value:e?t.getText(e):"undefined"}}))})},meta:{type:"suggestion",docs:{description:"Disallow duplicate values in `Set` constructor array literals.",recommended:!0},messages:{[gK]:"Remove duplicate value `{{value}}` from the Set."},languages:["js/js"]}},"unicorn/no-incorrect-query-selector":{create:e=>{let{sourceCode:t}=e;e.on("MemberExpression",r=>{if(!g0(r)||g2(r))return;let n=r.object;if(!g3(r,n,t,e))return g9(r,n,e)}),e.on("CallExpression",r=>{let n;if(g1(r)){if(g2(r))return;let n=r.callee.object;if(g3(r,n,t,e))return;return g9(r,n,e)}let o=g6(r,e);if(o)return o;if(gZ(r)&&!(g0(n=r.parent)||g1(n)||"MemberExpression"===r.parent.type&&r.parent.object===r&&g1(r.parent.parent))){let e;if(e=tu(r.arguments[0]),/^#[\-A-Z_a-z][\w\-]*$/v.test(e))return{node:r.callee.property,messageId:gJ}}}),e.on("BinaryExpression",r=>((e,t)=>{let{sourceCode:r}=t;if(g4(e,gZ,r))return{node:e,messageId:gY}})(r,e)??((e,t)=>{let r=g4(e,gQ,t);if(r&&("==="===e.operator||"!=="===e.operator)&&tq(r.value))return{node:e,messageId:gH}})(r,t)),e.on("Identifier",t=>g6(t,e))},meta:{type:"suggestion",docs:{description:"Disallow incorrect `querySelector()` and `querySelectorAll()` usage.",recommended:!0},fixable:"code",schema:[],messages:{[gG]:"Prefer `.querySelector()` when only the first match is used.",[gJ]:"Prefer `.querySelector()` for a simple ID selector.",[gX]:"Check `.length` instead of the `NodeList` object itself.",[gY]:"Check `.length` instead of comparing the `NodeList` object with `null` or `undefined`.",[gH]:"Compare the result of `.querySelector()` with `null` instead of `undefined`."},languages:["js/js"]}},"unicorn/no-invalid-file-input-accept":{create:e=>{e.on("JSXOpeningElement",t=>{if("input"!==ys(t.name))return;let r=((e,t)=>{if(t?.value){if(ts(t.value))return t.value.value;if("JSXExpressionContainer"===t.value.type)return yu(e,t.value.expression)}})(e,yl(t,"type"));if(r?.toLowerCase()!=="file")return;let n=yl(t,"accept");if(!n)return;let o=((e,t)=>{if(!t.value)return{node:t,missing:!0};if(ts(t.value))return{node:t.value,value:t.value.value,fixable:!0};if("JSXExpressionContainer"!==t.value.type)return{node:t.value,dynamic:!0};let r=yu(e,t.value.expression);return void 0===r?{node:t.value,dynamic:!0}:{node:t.value,value:r,fixable:!1}})(e,n);return yy({valueInfo:o,fix:t=>r=>{let n;return n=o.node,r.replaceTextRange([e.sourceCode.getRange(n)[0]+1,e.sourceCode.getRange(n)[1]-1],t)}})}),e.on("Tag",t=>{if("input"!==t.name.toLowerCase())return;let r=yg(e,t,"type")?.value;if(r?.toLowerCase()!=="file")return;let n=((e,t,r)=>{let n=yg(e,t,r);if(!n)return;let o=t.attributes.find(e=>"Attribute"===e.type&&e.key?.value?.toLowerCase()===r);return n.missing?{node:o??t,missing:!0}:o?.value?.parts?.length>0?{node:o.value,dynamic:!0}:yo.test(n.value)?void 0:{node:o?.value??t,value:n.value,fixable:!0,valueRange:n.valueRange,isReplacementFixable:e=>n.isQuoted||!/\s/v.test(e)}})(e,t,"accept");if(n)return yy({valueInfo:n,fix:e=>t=>t.replaceTextRange(n.valueRange,e)})})},meta:{type:"problem",docs:{description:"Disallow invalid `accept` values on file inputs.",recommended:!1},fixable:"code",messages:{[g7]:"Invalid file input `accept` value: {{reason}}",[ye]:"The file input `accept` value must be static.",[yt]:"Prefer `{{replacement}}` as the file input `accept` value."},languages:["js/js","html/html"]}},"unicorn/no-late-current-target-access":{create:e=>{let{sourceCode:t}=e,r=yE(e);e.on("MemberExpression",e=>{if("Identifier"!==e.object.type||!tF(e,{property:"currentTarget"})||!yh.test(e.object.name))return;let n=eS(t.getScope(e.object),e.object),o=n?.defs.find(({type:e})=>"Parameter"===e);if(!o)return;let a=o.node,i=yx(e)!==a;if(i||r.isFunctionSuspended(a)||r.isInsideSuspendingLoop(e,a))return{node:e,messageId:i?yS:yv,data:{name:e.object.name}}})},meta:{type:"problem",docs:{description:"Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.",recommended:!0},messages:{[yv]:"`{{name}}.currentTarget` is `null` after the handler suspends. It is only set during synchronous event dispatch; save it to a variable beforehand.",[yS]:"`{{name}}.currentTarget` is `null` inside this nested function. It is only set during synchronous event dispatch; save it to a variable in the outer function."},languages:["js/js"]}},"unicorn/no-unnecessary-nested-ternary":{create:e=>{let{sourceCode:t}=e;e.on("ConditionalExpression",r=>{let{test:n,consequent:o,alternate:a}=r;return"ConditionalExpression"===o.type&&yD(o.alternate,a,t)?yw(e,r,{left:n,operator:"&&",right:o.test,consequent:o.consequent,alternate:o.alternate}):"ConditionalExpression"===a.type&&yD(o,a.consequent,t)?yw(e,r,{left:n,operator:"||",right:a.test,consequent:o,alternate:a.alternate}):void 0})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary nested ternary expressions.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[yC]:"Do not use unnecessary nested ternary expressions."},languages:["js/js"]}},"unicorn/no-unused-array-method-return":{create:e=>{e.on("CallExpression",t=>{let r="MemberExpression"===t.callee.type?ez(t.callee,e.sourceCode.getScope(t.callee)):void 0;if(!(!yI.has(r)||!(e=>{for(;;){if(aB(e))return!0;let{parent:t}=e;if("ForStatement"===t.type&&(t.init===e||t.update===e))return!0;if("ChainExpression"!==t.type&&"AwaitExpression"!==t.type&&"TSAsExpression"!==t.type&&"TSTypeAssertion"!==t.type&&"TSNonNullExpression"!==t.type&&"TSSatisfiesExpression"!==t.type)return!1;e=t}})(t)||((e,t,r)=>{let n,o=function e(t,r,n=new i){if(!t||t===yF||n.has(t))return t;if(n.add(t),"Identifier"===t.type){let o=function(e,t){let r=eS(t.sourceCode.getScope(e),e);if(!r||0===r.defs.length)return;if(1!==r.defs.length||function(e,t,r){let[n]=r.sourceCode.getRange(t);return e.references.some(e=>!e.init&&e.isWrite()&&r.sourceCode.getRange(e.identifier)[0]<n)}(r,e,t))return yF;let[n]=r.defs;if("Parameter"===n.type&&n.node.params?.includes(n.name))return n.name.typeAnnotation&&!nj(n.name.typeAnnotation,t)?yF:void 0;if("Variable"===n.type&&"VariableDeclarator"===n.node.type&&"Identifier"===n.node.id.type&&n.node.id.name===e.name&&"VariableDeclaration"===n.parent.type){let{typeAnnotation:e}=n.node.id;return e?nj(e,t)?void 0:yF:n.node.init??yF}return yF}(t,r);return o===yF?o:void 0===o?t:e(o,r,n)}return["ChainExpression","TSNonNullExpression","TSSatisfiesExpression"].includes(t.type)?e(t.expression,r,n):"MemberExpression"===t.type?yF:"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?nj(t,r)?t:yF:t}(e,r);return!!(tb(n=o,"expect",ty)||tR(n,{object:"expect",methods:["element","poll","soft"]}))||("values"===t?o===yF||!nj(o,r):o===yF||((e,t)=>{let r,n;return yR(e,"undefined",t)||"ObjectExpression"===e.type||"Literal"===e.type||"BinaryExpression"===e.type||"TemplateLiteral"===e.type||"ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type||"ClassExpression"===e.type||"NewExpression"===e.type&&!yR(e.callee,"Array",t)||(r=e,n=t,tb(r,yB,ty)&&n.sourceCode.isGlobalReference(r.callee))})(o,r)||"Identifier"===o.type&&yj.test(o.name)&&!nj(o,r))})(t.callee.object,r,e)))return{node:t.callee.property,messageId:yk,data:{method:r}}})},meta:{type:"suggestion",docs:{description:"Disallow ignoring the return value of selected array methods.",recommended:"unopinionated"},messages:{[yk]:"Do not ignore the return value of `.{{method}}(…)`."},languages:["js/js"]}},"unicorn/prefer-array-last-methods":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(!tR(r,{methods:yN.keys().toArray(),optionalCall:!1,optionalMember:!1}))return;let n=r.callee.object;if(!tR(n,{methods:y$,argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let o=r.callee.property.name,a=yN.get(o),i={method:o,replacement:a,reversingMethod:n.callee.property.name},s={node:r.callee.property,messageId:yP,data:i};return 0===t.getCommentsInside(r).length&&(s.suggest=[{messageId:yL,data:i,*fix(t){yield t.replaceText(r.callee.property,a),yield iH(t,n,e)}}]),s})},meta:{type:"suggestion",docs:{description:"Prefer last-oriented array methods over `Array#reverse()` or `Array#toReversed()` followed by a method.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[yP]:"Prefer `Array#{{replacement}}()` over `Array#{{reversingMethod}}().{{method}}()`.",[yL]:"Replace `.{{reversingMethod}}().{{method}}()` with `.{{replacement}}()`."},languages:["js/js"]}},"unicorn/prefer-math-abs":{create:e=>{e.on("ConditionalExpression",t=>{let r=function(e,t){let r=function(e,t){if(!("BinaryExpression"!==e.type||!yO.has(e.operator)||yz(e.left,t)||yz(e.right,t))){if(ti(e.right,0))return{value:e.left,operator:e.operator};if(ti(e.left,0))return{value:e.right,operator:yq[e.operator]}}}(e.test,t);if(!r)return;let{value:n,operator:o}=r,{consequent:a,alternate:i}=e;if(("<"===o||"<="===o)&&yK(a,n)&&rk(i,n)||(">"===o||">="===o)&&rk(a,n)&&yK(i,n))return n}(t,e);if(!r)return;let n=yH(r)?function*(n){yield iG(n,t,e),yield n.replaceText(t,`Math.abs(${yX(r,e)})`)}:void 0;return yY(t,e,n)}),e.on("LogicalExpression",t=>{let r=function(e,t){if("||"!==e.operator)return;let r=yG(e.left,t),n=yJ(e.right,t);if(r&&n&&rk(r.value,n.value)&&yU[r.operator]===n.operator&&yK(n.negativeThreshold,r.threshold))return{value:r.value,threshold:r.threshold,operator:r.operator};let o=yG(e.right,t),a=yJ(e.left,t);if(o&&a&&rk(o.value,a.value)&&yU[o.operator]===a.operator&&yK(a.negativeThreshold,o.threshold))return{value:o.value,threshold:o.threshold,operator:o.operator}}(t,e);if(!r)return;let{value:n,threshold:o,operator:a}=r,i=yH(n)&&yH(o)?function*(r){yield iG(r,t,e),yield r.replaceText(t,`Math.abs(${yX(n,e)}) ${a} ${to(o,e)}`)}:void 0;return yY(t,e,i)})},meta:{type:"suggestion",docs:{description:"Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.",recommended:"unopinionated"},fixable:"code",messages:{[yM]:"Prefer `Math.abs()` to simplify this expression."},languages:["js/js"]}},"unicorn/prefer-split-limit":{create:e=>{let{sourceCode:t}=e;e.on("MemberExpression",r=>{if(!r.computed||nG(r))return;let n=y0(r.object);if(!n)return;let o=yZ(r.property,t);if(void 0!==o)return y1(r,n,o+1,e)}),e.on("CallExpression",r=>{if(!tR(r,{method:"at",argumentsLength:1}))return;let n=y0(r.callee.object);if(!n)return;let o=yZ(r.arguments[0],t);if(void 0!==o)return y1(r,n,o+1,e)}),e.on("VariableDeclarator",t=>{if("ArrayPattern"===t.id.type)return y2(t.id,t.init,e)}),e.on("AssignmentExpression",t=>{if("ArrayPattern"===t.left.type&&aB(t))return y2(t.left,t.right,e)})},meta:{type:"suggestion",docs:{description:"Prefer `String#split()` with a limit.",recommended:"unopinionated"},fixable:"code",messages:{[yQ]:"Prefer `String#split()` with a limit."},languages:["js/js"]}},"unicorn/prefer-queue-microtask":y8,"unicorn/prefer-string-pad-start-end":{create:e=>{e.on("BinaryExpression",t=>((e,t)=>{if("+"!==e.operator)return;let r=hn(e.left,t);if(r&&rk(e.right,r.targetNode)&&!y4(e.right,t)){let n=ht({targetNode:e.right,targetLengthNode:r.targetLengthNode,paddingNode:r.paddingNode});return ha({node:e,method:"padStart",replacement:n&&ho({method:"padStart",targetNode:e.right,...r},t),context:t,canFix:n})}let n=hn(e.right,t);if(n&&rk(e.left,n.targetNode)&&!y4(e.left,t)){let r=ht({targetNode:e.left,targetLengthNode:n.targetLengthNode,paddingNode:n.paddingNode});return ha({node:e,method:"padEnd",replacement:r&&ho({method:"padEnd",targetNode:e.left,...n},t),context:t,canFix:r})}})(t,e)),e.on("CallExpression",t=>((e,t)=>{if(!tR(e,{method:"slice",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||"BinaryExpression"!==e.callee.object.type||"+"!==e.callee.object.operator)return;let{object:r}=e.callee,[n,o]=e.arguments,a=hr(r.left,t),i=(e=>{if(e?.type==="UnaryExpression"&&"-"===e.operator)return e.argument})(n);if(1===e.arguments.length&&a&&i&&tp(a.widthNode)&&rk(a.widthNode,i)&&"Identifier"===r.right.type&&!y4(r.right,t)){let n=he(a.paddingNode);return hi({node:e,method:"padStart",replacement:ho({method:"padStart",targetNode:r.right,targetLengthNode:a.widthNode,...a},t),context:t,canSuggest:n})}let s=hr(r.right,t);if(2===e.arguments.length&&s&&tp(n)&&0===n.value&&tp(s.widthNode)&&rk(s.widthNode,o)&&"Identifier"===r.left.type&&!y4(r.left,t)){let n=he(s.paddingNode);return hi({node:e,method:"padEnd",replacement:ho({method:"padEnd",targetNode:r.left,targetLengthNode:s.widthNode,...s},t),context:t,canSuggest:n})}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `String#padStart()` and `String#padEnd()` over manual string padding.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[y6]:"Prefer `String#{{method}}()` over manual string padding.",[y9]:"Replace with `String#{{method}}()`."},languages:["js/js"]}},"unicorn/require-css-escape":hm,"unicorn/require-passive-events":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1}))return;let[r,n,o]=t.arguments;if(!ts(r)||!hg.has(r.value)||"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||!((e,t)=>{let r;if(r=t.sourceCode,"FunctionExpression"===e.type&&ry(r.getScope(e)).some(t=>((e,t)=>{let r=e.block;for(;r&&r!==t;){if("FunctionDeclaration"===r.type||"FunctionExpression"===r.type)return!1;r=r.parent}return r===t})(t,e)&&t.references.some(({identifier:e})=>"arguments"===e.name)))return!1;let[n]=e.params;if(!n)return!0;if("Identifier"!==n.type)return!1;let o=t.sourceCode.getDeclaredVariables(e).find(e=>e.defs[0]?.name===n);if(!o)return!1;for(let{identifier:e}of o.references)if(hh(e)||!hx(e))return!1;return!0})(n,e))return;let a=((e,t,r)=>{if(!r){let r;return{fix:(r=t.arguments[1],t=>t.insertTextAfterRange(tn(r,e),", {passive: true}"))}}if(tl(r,!0)||tl(r,!1))return{fix:e=>e.replaceText(r,tl(r,!0)?"{capture: true, passive: true}":"{passive: true}")};if("ObjectExpression"!==r.type||r.properties.some(e=>"SpreadElement"===e.type||e.computed))return;let n=r.properties.findLast(e=>"Property"===e.type&&"passive"===(e=>{if(!e.computed){if("Identifier"===e.key.type)return e.key.name;if(ts(e.key))return e.key.value}})(e));if(!n)return{fix:((e,t)=>{let r=e.properties.at(-1);if(!r)return!1;let n=t.getLastToken(e);return t.getTokensBetween(r,n,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type)})(r,e.sourceCode)?void 0:t=>{let{sourceCode:n}=e;if(0===r.properties.length)return t.replaceText(r,"{passive: true}");let o=r.properties.at(-1);if(n.getLoc(r).start.line===n.getLoc(r).end.line)return t.insertTextAfter(o,", passive: true");let a=n.getTokenAfter(o),i=rR(o,e);return","===a.value?t.insertTextAfter(a,`
51
- ${i}passive: true,`):t.insertTextAfter(o,`,
52
- ${i}passive: true`)}};if(tl(n.value,!1))return{fix:e=>e.replaceText(n.value,"true")}})(e,t,o);if(a)return{node:r,messageId:hf,...a}})},meta:{type:"suggestion",docs:{description:"Require passive event listeners for high-frequency events.",recommended:"unopinionated"},fixable:"code",messages:{[hf]:"Use `{passive: true}` for this high-frequency event listener."},languages:["js/js"]}},"unicorn/class-reference-in-static-methods":hK,"unicorn/consistent-optional-chaining":{create:e=>{e.on("LogicalExpression",t=>(function(e,t){let{left:r,operator:n,right:o}=e,a=hZ(r),i=hZ(o);if(!a||!i)return;let s=hQ(a.object),l=hQ(i.object);if(h0(s)&&h0(l)&&rk(s,l)){if("&&"===n&&i.optional)return{node:i,messageId:hG,...h1(i,t)&&{suggest:[{messageId:hX,fix:e=>h3(i,t,e)}]}};if("||"===n&&a.optional!==i.optional)return i.optional?{node:i,messageId:hG,...h1(i,t)&&{suggest:[{messageId:hX,fix:e=>h3(i,t,e)}]}}:{node:i,messageId:hJ,...h1(i,t)&&{suggest:[{messageId:hY,fix:e=>h2({memberExpression:i,context:t,fixer:e,replacement:i.computed?"?.[":"?."})}]}}}})(t,e))},meta:{type:"suggestion",docs:{description:"Enforce consistent optional chaining for same-base member access.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[hG]:"Remove unnecessary optional chaining.",[hJ]:"Use optional chaining consistently.",[hX]:"Remove optional chaining.",[hY]:"Use optional chaining."},languages:["js/js"]}},"unicorn/explicit-timer-delay":{create:e=>{let t=e.options[0],{sourceCode:r}=e;e.on("CallExpression",n=>{if(n.optional)return;let{isTimer:o,name:a}=((e,t)=>{let{callee:r}=e;if("Identifier"===r.type&&h4.has(r.name)&&t.isGlobalReference(r))return{isTimer:!0,name:r.name};if("MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&h4.has(r.property.name)){let{object:e}=r;if("Identifier"===e.type&&h7.has(e.name)&&t.isGlobalReference(e))return{isTimer:!0,name:r.property.name}}return{isTimer:!1}})(n,r);if(!o)return;let{arguments:i}=n,s=i.length>=2;if(t===h8&&!s){if(0===i.length)return;let[t]=i;if(1===i.length&&t?.type==="SpreadElement")return;return{node:n,messageId:h9,data:{name:a},fix:r=>r.insertTextAfterRange(tn(t,e),", 0")}}if(t===h6&&2===i.length){let t=i[1];if(xe(t))return{node:t,messageId:h5,data:{name:a},fix(r){let[n]=i,[,o]=tn(n,e),[,a]=tn(t,e);return r.removeRange([o,a])}}}})},meta:{type:"suggestion",docs:{description:"Enforce or disallow explicit `delay` argument for `setTimeout()` and `setInterval()`.",recommended:"unopinionated"},fixable:"code",schema:[{enum:[h8,h6],description:"Whether to always require an explicit `delay` argument, or disallow an explicit `0` delay."}],defaultOptions:[h8],messages:{[h9]:"`{{name}}` should have an explicit delay argument.",[h5]:"`{{name}}` should not have an explicit delay of `0`."},languages:["js/js"]}},"unicorn/no-confusing-array-with":{create:e=>{e.on("CallExpression",t=>{var r,n;if(!tR(t,{method:"with",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let{object:o}=t.callee,[a]=t.arguments,i=(r=a,n=o,0>Math.trunc(ie(r))?xt:pF(r,n)?xr:void 0);if(!(!i||nL(o,e)))return{node:t.callee.property,messageId:i}})},meta:{type:"suggestion",docs:{description:"Disallow confusing uses of `Array#with()`.",recommended:!0},schema:[],messages:{[xt]:"Avoid using a negative index with `Array#with()`.",[xr]:"Avoid using `.length` as the index in `Array#with()`."},languages:["js/js"]}},"unicorn/no-duplicate-loops":{create:e=>{e.on("ForOfStatement",t=>{let r=fJ(t.right);if(tR(r,{methods:xo,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&!function e(t,r){let n,o,a,i;return n=t=fJ(t),tR(n,{methods:fz,optionalCall:!1,optionalMember:!1,computed:!1})&&((e,t)=>{if("Identifier"===(e=fJ(e)).type)return"Iterator"===e.name&&t.sourceCode.isGlobalReference(e);if("MemberExpression"!==e.type||e.optional||e.computed||"Identifier"!==e.property.type||"Iterator"!==e.property.name)return!1;let r=fJ(e.object);return"Identifier"===r.type&&"globalThis"===r.name&&t.sourceCode.isGlobalReference(r)})(n.callee.object,r)||tR(o=t,{methods:fV,argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})||tR(o,{method:"matchAll",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||tR(a=t,{methods:f_,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&e(a.callee.object,r)||!((e,t)=>{for(let r=t.sourceCode.getScope(e);r;r=r.upper)for(let e of fK)if(r.set.get(e)?.defs.length>0)return!0;return!1})(i=t,r)&&!nj(i,r)&&fG(i,r)}(r.callee.object,e))return{node:r.callee.property,messageId:xn,data:{loopKind:t.await?"for await…of":"for…of",method:r.callee.property.name}}})},meta:{type:"suggestion",docs:{description:"Disallow `.map()` and `.filter()` in `for…of` and `for await…of` loop headers.",recommended:!0},messages:{[xn]:"Do not use `.{{method}}()` directly in a `{{loopKind}}` loop header. It creates an intermediate array before the loop."},languages:["js/js"]}},"unicorn/no-declarations-before-early-exit":{create:e=>{let{sourceCode:t}=e,r=id(e,t=>aA(t,e,r));e.onExit("Program",e=>xp(t,e.body,r)),e.onExit("BlockStatement",e=>xp(t,e.body,r))},meta:{type:"suggestion",docs:{description:"Disallow declarations before conditional early exits when they are only used after the exit.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[xa]:"Move this declaration after the early exit."},languages:["js/js"]}},"unicorn/no-optional-chaining-on-undeclared-variable":{create:e=>{let t=new l;e.on("ChainExpression",r=>{let n=function(e,t){let r=function e(t){return"MemberExpression"===(t=xm(t)).type?e(t.object)??(t.optional?t.object:void 0):"CallExpression"===t.type?e(t.callee)??(t.optional?t.callee:void 0):void 0}(e.expression);if(!r)return;let n=function(e){for(e=xm(e);"MemberExpression"===e.type;)e=xm(e.object);return"Identifier"===e.type?e:void 0}(r);if(n&&function(e,t){let r=t.sourceCode.getScope(e);for(;r;){let t=r.set.get(e.name);if(t&&(0===t.defs.length||t.defs.some(e=>!xd(e))))return!1;r=r.upper}return!0}(n,t))return n}(r,e);if(!(!n||t.has(n)))return t.add(n),{node:n,messageId:xc,data:{name:n.name}}})},meta:{type:"problem",docs:{description:"Disallow optional chaining on undeclared variables.",recommended:!0},schema:[],messages:{[xc]:"Optional chaining on undeclared variable `{{name}}` throws a ReferenceError."},languages:["js/js"]}},"unicorn/no-object-methods-with-collections":{create:e=>{e.on("CallExpression",t=>((e,t)=>{let r,{callee:n}=e;if(1!==e.arguments.length||e.optional||"MemberExpression"!==n.type||n.optional||n.computed||"Identifier"!==n.object.type||"Object"!==n.object.name||!oA(n.object,t)||"Identifier"!==n.property.type||!xy.has(n.property.name))return;let[o]=e.arguments,a=aY(o,t);if(!a)return;let i=n.property.name,s=`${(r=to(o,t),it(o,t)?`(${r})`:r)}.${i}()`,l={node:n.property,messageId:xf,data:{method:i,type:a}};return 0===t.sourceCode.getCommentsInside(e).length&&(l.suggest=[{messageId:xg,data:{replacement:s},fix:t=>t.replaceText(e,`Array.from(${s})`)}]),l})(t,e))},meta:{type:"problem",docs:{description:"Disallow `Object` methods with `Map` or `Set`.",recommended:!0},hasSuggestions:!0,messages:{[xf]:"`Object.{{method}}()` does not return {{type}} contents.",[xg]:"Use `Array.from({{replacement}})`."},languages:["js/js"]}},"unicorn/no-subtraction-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{let n,o;if(!xE.has(r.operator))return;if(ti(r.right,0)&&xS(r.left))n=r.left,o=r.operator;else{if(!(ti(r.left,0)&&xS(r.right)))return;n=r.right,o=xb[r.operator]}let a={node:r,messageId:xh};if(t.getCommentsInside(r).length>0)return a;let{left:i,right:s}=n,l=`${to(i,e)} ${o} ${to(s,e)}`,u=e=>e.replaceText(r,l),p=t.getScope(r);return(xv.has(o)?n2(i,p)&&n2(s,p):xC(i,p)&&xC(s,p))?a.fix=u:a.suggest=[{messageId:xx,data:{replacement:l},fix:u}],a})},meta:{type:"suggestion",docs:{description:"Prefer comparing values directly over subtracting and comparing to `0`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[xh]:"Prefer comparing the values directly over comparing the difference with `0`.",[xx]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-unnecessary-global-this":{create:e=>{e.on("MemberExpression",t=>{var r,n,o,a;let i,s,l=xA(t.object),u=xw(t);if("Identifier"!==l.type||"globalThis"!==l.name||!oA(l,e)||nG(r=u)||("ForInStatement"===(i=r).parent.type||"ForOfStatement"===i.parent.type)&&i.parent.left===i||r3(n=t)||("MemberExpression"===(n=xw(n)).parent.type||"CallExpression"===n.parent.type)&&n.parent.optional&&(n.parent.object===n||n.parent.callee===n)||"LogicalExpression"===(o=xw(o=t)).parent.type||function(e){let{parent:t}=e;if("BinaryExpression"!==t.type||!xj.has(t.operator))return!1;let r=xA(t.left===e?t.right:t.left);return"Literal"===r.type&&null===r.value||"Identifier"===r.type&&"undefined"===r.name}(o)||tJ(o)||tG(o,e))return;let p=t.computed?ts(t.property)?t.property.value:"TemplateLiteral"===t.property.type&&0===t.property.expressions.length?t.property.quasis[0].value.cooked:void 0:t.property.name;if("string"!=typeof p||!(r$(p)&&(!xk.has(p)||"eval"===p||"arguments"===p))||"eval"===p&&xI(t)||(s=eS(e.sourceCode.getScope(t),p),s?.scope.type!=="global"||0!==s.defs.length))return;let c={node:t,messageId:xD,data:{name:p}};return xI(t)||"TaggedTemplateExpression"===(a=xw(a=t)).parent.type&&a.parent.tag===a||0!==e.sourceCode.getCommentsInside(t).length||(c.fix=e=>e.replaceText(t,p)),c})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `globalThis` references.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[xD]:"Use `{{name}}` directly instead of `globalThis.{{name}}`."},languages:["js/js"]}},"unicorn/no-unreadable-object-destructuring":{create:e=>{e.on("Property",t=>{if("ObjectPattern"===t.parent.type&&t.computed&&!(null===eV(t.key,e.sourceCode.getScope(t.key))&&t.parent.properties.some(e=>"RestElement"===e.type)))return{node:t,messageId:xF}}),e.on("ArrayPattern",e=>{if(0!==xN(e))return{node:e,messageId:xB}}),e.on("ObjectPattern",e=>{if(3===xN(e))return{node:e,messageId:xR}}),e.on("MemberExpression",e=>{if(xL(e)?.type==="ObjectPattern")return{node:e,messageId:xP}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable object destructuring.",recommended:"unopinionated"},schema:[],messages:{[xF]:"Do not use computed keys in object destructuring.",[xB]:"Do not use array destructuring inside object destructuring.",[xR]:"Do not use object destructuring deeper than two levels.",[xP]:"Do not assign destructured values to object properties."},languages:["js/js"]}},"unicorn/no-useless-else":{create:e=>{let{sourceCode:t}=e,r=id(e,t=>aA(t,e,r));e.onExit("IfStatement",n=>{if(!(n.alternate&&xM.has(n.parent.type)&&r(n.consequent)))return;let o=t.getTokenBefore(n.alternate);return{node:n.alternate,loc:t.getLoc(o),messageId:x$,fix:t=>{let{sourceCode:r}=e,{alternate:o,consequent:a}=n;if(rK(o)||"BlockStatement"===o.type&&((e,t)=>{let{sourceCode:r}=t;return r.getTokens(e).some(e=>("JSXText"!==e.type||"JSXText"!==r.getNodeByRangeIndex(r.getRange(e)[0]).type)&&r.getLoc(e).start.line!==r.getLoc(e).end.line)})(o,e)||!((e,t)=>{let{sourceCode:r}=t,{alternate:n,consequent:o}=e,a="BlockStatement"===n.type?r.getTokenAfter(r.getFirstToken(n)):r.getFirstToken(n);if(!a)return!0;let i=r.getLastToken(o);if("BlockStatement"!==o.type&&";"!==i.value&&(aL(i,t,a.value)||xU(a))||((e,t)=>{let r=t.getTokenAfter(e);if(r&&t.getLoc(e).end.line===t.getLoc(r).start.line)return!0;let n=t.getCommentsAfter(e)[0];return!!(n&&t.getLoc(e).end.line===t.getLoc(n).start.line)})(n,r))return!1;let s="BlockStatement"===n.type?r.getTokenBefore(r.getLastToken(n)):r.getLastToken(n),l=r.getTokenAfter(n);return!(s&&";"!==s.value&&l&&(aL(s,t,l.value)||xU(l)))})(n,e))return;let i=[r.getRange(a)[1],r.getRange(o)[1]];if(!rV(e,[i[0],r.getRange(o)[0]]))return t.replaceTextRange(i,((e,t)=>{let{alternate:r}=e;if("BlockStatement"===r.type)return((e,t,r)=>{let n=r.getFirstToken(e),o=r.getLastToken(e),a=r.text.slice(r.getRange(n)[1],r.getRange(o)[0]);if(!a.includes("\n")){let e=a.trim();return e?`
53
- ${xq(r,r.getRange(t)[0])}${e}`:""}let i=a.split("\n");if(i[0]?.trim()===""&&i.shift(),i.at(-1)?.trim()===""&&i.pop(),0===i.length)return"";let s=r.getTokenAfter(n,{includeComments:!0}),l=xq(r,r.getRange(t)[0]),u=s&&s!==o?xq(r,r.getRange(s)[0]):l;return`
54
- ${i.map(e=>""===e.trim()?"":e.startsWith(u)?`${l}${e.slice(u.length)}`:`${l}${e.trimStart()}`).join("\n")}`})(r,e,t);let n=xq(t,t.getRange(e)[0]);return`
55
- ${n}${t.getText(r)}`})(n,r))}}})},meta:{type:"suggestion",docs:{description:"Disallow `else` after a statement that exits.",recommended:!0},fixable:"code",messages:{[x$]:"Unexpected `else` after a statement that exits."},languages:["js/js"]}},"unicorn/no-useless-recursion":{create:e=>{let{sourceCode:t}=e;e.on("ReturnStatement",e=>{if(((e,t)=>{var r;let n,{argument:o}=e;if(o?.type!=="CallExpression"||o.optional||"Identifier"!==o.callee.type)return!1;let a=(e=>{for(;e;e=e.parent)if(tw(e))return e})(e);return!!(a?.id&&!a.generator&&!((e,t)=>{for(;e&&e!==t;e=e.parent)if("TryStatement"===e.type)return!0;return!1})(e,a)&&!((e,t)=>{for(;e&&e!==t;e=e.parent){if(xz(e))return!0;if(e.parent?.type!=="BlockStatement")continue;let t=e.parent.body.indexOf(e);if(e.parent.body.slice(0,t).some(e=>x_(e)))return!0}return!1})(e,a)&&o.callee.name===a.id.name&&(r=o.callee,n=eS(t.getScope(r),r),n?.identifiers.includes(a.id)))})(e,t))return{node:e.argument.callee,messageId:xW}})},meta:{type:"suggestion",docs:{description:"Disallow simple recursive function calls that can be replaced with a loop.",recommended:!0},messages:{[xW]:"Use a loop instead of this recursive function call."},languages:["js/js"]}},"unicorn/prefer-add-event-listener-options":{create:e=>{e.on("CallExpression",e=>{if(!tR(e,{method:"addEventListener",argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let t=e.arguments[2];if(!tl(t))return;let r=`{capture: ${t.value}}`;return{node:t,messageId:xK,data:{value:String(t.value),replacement:r},fix:e=>e.replaceText(t,r)}})},meta:{type:"suggestion",docs:{description:"Prefer an options object over a boolean in `.addEventListener()`.",recommended:"unopinionated"},fixable:"code",messages:{[xK]:"Prefer `{{replacement}}` over `{{value}}`."},languages:["js/js"]}},"unicorn/prefer-direct-iteration":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{methods:["entries","keys","values"],argumentsLength:0,optionalCall:!1,optionalMember:!1})||!(e=>{let{parent:t}=e;if("ForOfStatement"===t.type&&t.right===e||"YieldExpression"===t.type&&t.delegate&&t.argument===e||"SpreadElement"===t.type&&t.argument===e&&(e=>{let{parent:t}=e;return x2.has(t.type)})(t))return!0;if("NewExpression"===t.type)return 1===t.arguments.length&&t.arguments[0]===e&&(tE(t,{names:x0,argumentsLength:1})||tE(t,{names:r9,argumentsLength:1}));if("CallExpression"===t.type)return t.arguments[0]===e&&(tR(t,{object:"Array",method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||x8(t,["from"])||tR(t,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||tR(t,{object:"Promise",methods:x1,argumentsLength:1,optionalCall:!1,optionalMember:!1}));return!1})(t))return;let r=t.callee.property.name;if(((e,t)=>{if(!t?.size)return!1;for(let r of t){let t=xZ.get(r);if(!t?.includes(e))return!1}return!0})(r,x7(t.callee.object,e)))return{node:t.callee.property,messageId:xG,data:{method:r},fix:((e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>iH(r,e,t)})(t,e)}})},meta:{type:"suggestion",docs:{description:"Prefer direct iteration over default iterator method calls.",recommended:"unopinionated"},fixable:"code",messages:{[xG]:"Prefer direct iteration instead of `.{{method}}()`."},languages:["js/js"]}},"unicorn/prefer-number-is-safe-integer":{create:e=>{let{sourceCode:t}=e,r=(e,r)=>{let n,o={node:e,messageId:br};return n=t.getRange(r),t.getCommentsInside(e).some(e=>{let r=t.getRange(e);return r[0]<n[0]||r[1]>n[1]})||(o.suggest=[{messageId:bn,fix:n=>{let o;return n.replaceText(e,`Number.isSafeInteger(${(o=t.getText(r),"SequenceExpression"===r.type?`(${o})`:o)})`)}}]),o};e.on("CallExpression",e=>{if(tR(e,{object:"Number",method:"isInteger",optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return{node:e.callee.property,messageId:be,suggest:[{messageId:bt,fix:t=>t.replaceText(e.callee.property,"isSafeInteger")}]};let n=(e=>{if(tR(e,{objects:bo,methods:["isInteger","isSafeInteger"],argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1}))return e.arguments[0]})(e);if(n&&bi(e,t))return r(e,n)}),e.on("BinaryExpression",e=>{let n=(e=>{if("==="===e.operator){if(ti(e.right,0))return bs(e.left);if(ti(e.left,0))return bs(e.right)}})(e)??((e,t)=>{if("==="!==e.operator)return;let r=bl(e.left,t);if(r&&rk(r,e.right))return r;let n=bl(e.right,t);if(n&&rk(n,e.left))return n})(e,t);if(n&&bi(e,t))return r(e,n)})},meta:{type:"suggestion",docs:{description:"Prefer `Number.isSafeInteger()` over integer checks.",recommended:!0},hasSuggestions:!0,messages:{[be]:"Prefer `Number.isSafeInteger()` over `Number.isInteger()`.",[bt]:"Replace `Number.isInteger()` with `Number.isSafeInteger()`.",[br]:"Prefer `Number.isSafeInteger()` over this integer check.",[bn]:"Replace this integer check with `Number.isSafeInteger()`."},languages:["js/js"]}},"unicorn/prefer-object-define-properties":{create:e=>{let{sourceCode:t}=e;e.on("ExpressionStatement",r=>{let n=bp(r);if(!n)return;let o=bp(im(r,e,-1));if(o&&rk(o.arguments[0],n.arguments[0]))return;let a=[r],s=[n],l=ig(r,e);for(;;){let t=bp(l);if(!t||!rk(n.arguments[0],t.arguments[0]))break;a.push(l),s.push(t),l=ig(l,e)}if(s.length<2)return;let u={node:n.callee.property,messageId:bu},p=[t.getRange(a[0])[0],t.getRange(a.at(-1))[1]];return function(e,t){let r=new i,n=[];for(let o of e){let e=o.arguments[1],a=function(e,t){let r=eV(e,t.getScope(e));if(r)return"symbol"==typeof r.value?r.value:String(r.value)}(e,t);if(void 0===a){if(n.some(t=>rk(t,e)))return!0;n.push(e);continue}if(r.has(a))return!0;r.add(a)}return!1}(s,t)||t.getAllComments().some(e=>{let[r,n]=t.getRange(e);return r>=p[0]&&n<=p[1]})||(u.fix=function(e,t,r){let{sourceCode:n}=r,o=e[0],a=e.at(-1),i=rR(o,r),s=`${i} `,l=n.getText(t[0].arguments[0]),u=t.map(e=>{let t=function(e,t){let r=t.getText(e);if("Literal"===e.type){if("string"==typeof e.value)return"__proto__"===e.value?`[${r}]`:r$(e.value)?e.value:r;if("number"==typeof e.value)return r}return`[${r}]`}(e.arguments[1],n),r=n.getText(e.arguments[2]).replaceAll("\n","\n ");return`${s}${t}: ${r},`}).join("\n");return e=>e.replaceTextRange([n.getRange(o)[0],n.getRange(a)[1]],`Object.defineProperties(${l}, {
56
- ${u}
57
- ${i}});`)}(a,s,e)),u})},meta:{type:"suggestion",docs:{description:"Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[bu]:"Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls."},languages:["js/js"]}},"unicorn/prefer-object-destructuring-defaults":{create:e=>{e.on("VariableDeclarator",t=>{let{id:r,init:n}=t;if("ObjectPattern"!==r.type||n?.type!=="ObjectExpression"||0!==e.sourceCode.getCommentsInside(t).length)return;let a=((e,t)=>{if(e.typeAnnotation)return;let r=[];for(let n of e.properties){if(!(bg(n)&&"Identifier"===n.value.type))return;let e=ez(n,t.sourceCode.getScope(n));if(null===e||bm.has(e))return;r.push({node:n,name:e})}return r})(r,e),s=((e,t)=>{let{properties:r}=e,n=r.at(-1);if(n?.type!=="SpreadElement"||eH(n.argument,t.sourceCode,bf))return;let a=new o;for(let e of r.slice(0,-1)){if(!bg(e)||eH(e.value,t.sourceCode,bf))return;let r=ez(e,t.sourceCode.getScope(e));if(null===r||a.has(r))return;a.set(r,e)}return{defaultProperties:a,spreadElement:n}})(n,e);if(!a||0===a.length||!s)return;let{defaultProperties:l,spreadElement:u}=s;if(a.length!==l.size)return;let p=new i(a.map(e=>e.node.value.name)),c=[];for(let t of a){let r=l.get(t.name);if(!r||by(r.value,p,e))return;c.push(bh(t,r,e))}return{node:t,messageId:bc,suggest:[{messageId:bd,fix:r=>r.replaceText(t,`{${c.join(", ")}} = {${e.sourceCode.getText(u)}}`)}]}})},meta:{type:"suggestion",docs:{description:"Prefer object destructuring defaults over default object literals with spread.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[bc]:"Prefer object destructuring defaults over default object literals with spread.",[bd]:"Use object destructuring defaults."},languages:["js/js"]}},"unicorn/prefer-single-object-destructuring":{create:e=>{let{sourceCode:t}=e;e.on("Program",e=>bv(t,e.body)),e.on(["BlockStatement","StaticBlock"],e=>bv(t,e.body)),e.on("SwitchCase",e=>bv(t,e.consequent))},meta:{type:"suggestion",docs:{description:"Prefer a single object destructuring declaration per local const source.",recommended:!0},fixable:"code",schema:[],messages:{[bx]:"Prefer a single object destructuring declaration from `{{source}}`."},languages:["js/js"]}},"unicorn/prefer-smaller-scope":{create:e=>{let{sourceCode:t}=e;e.on("VariableDeclaration",e=>(function(e,t){if(!(e.parent&&("Program"===e.parent.type||"BlockStatement"===e.parent.type)&&"let"===e.kind&&1===e.declarations.length&&"Identifier"===e.declarations[0].id.type&&!e.declarations[0].init))return;let[r]=e.declarations,[n]=t.getDeclaredVariables(r),o=n.references.filter(e=>!e.init),a=o.filter(e=>e.isWrite());if(1!==a.length||o.every(e=>!e.isRead()))return;let i=function(e){let{identifier:t}=e,r=t.parent;if("AssignmentExpression"!==r.type||"="!==r.operator||r.left!==t||"ExpressionStatement"!==r.parent.type)return;let n=r.parent,o=n.parent;if("BlockStatement"===o.type)return{assignmentExpression:r,assignmentStatement:n,block:o}}(a[0]);if(!i)return;let{assignmentExpression:s,assignmentStatement:l,block:u}=i,[,p]=t.getRange(e),[c,d]=t.getRange(l);if(!bD(u,e.parent)||function e(t,r){if("WithStatement"===t.type||"CallExpression"===t.type&&"Identifier"===t.callee.type&&"eval"===t.callee.name)return!0;for(let n of r[t.type]??[]){let o=t[n];if(Array.isArray(o)){if(o.some(t=>t&&e(t,r)))return!0}else if(o&&e(o,r))return!0}return!1}(e.parent,t.visitorKeys)||c<p||o.some(e=>!bD(e.identifier,u))||o.some(e=>e.isRead()&&t.getRange(e.identifier)[0]<d))return;let m={node:r.id,messageId:bS,data:{name:r.id.name}};return r.id.typeAnnotation||bA(t,s)&&"SequenceExpression"===s.right.type||t.getCommentsInside(e).length>0||t.getCommentsInside(l).length>0||bT(t,e,"before")||bT(t,e,"after")||bT(t,l,"before")||bT(t,l,"after")||(m.fix=function({sourceCode:e,declaration:t,assignmentExpression:r,assignmentStatement:n,name:o}){return function*(a){yield iQ(t,{sourceCode:e},a);let i=`const ${o} = `;if(bA(e,r))return void(yield a.replaceText(n,`${i}${e.getText(r.right)};`));let[s]=e.getRange(r),[l]=e.getRange(r.right);yield a.replaceTextRange([s,l],i)}}({sourceCode:t,declaration:e,assignmentExpression:s,assignmentStatement:l,name:r.id.name})),m})(e,t))},meta:{type:"suggestion",docs:{description:"Prefer declaring variables in the smallest possible scope.",recommended:!0},fixable:"code",schema:[],messages:{[bS]:"Move `{{name}}` into the block where it is used."},languages:["js/js"]}},"unicorn/prefer-single-array-predicate":{create:e=>{e.on("LogicalExpression",t=>{if("LogicalExpression"===t.parent.type&&t.parent.operator===t.operator)return;let r=bI.get(t.operator);if(!r||e.sourceCode.getCommentsInside(t).length>0)return;let n=(function e(t,r){return"LogicalExpression"!==t.type||t.operator!==r?[t]:[...e(t.left,r),...e(t.right,r)]})(t,t.operator).map(t=>(function(e,t,r){if(!tR(e,{method:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})||e.typeArguments||e.typeParameters)return;let n=function(e){if("ArrowFunctionExpression"===e.type&&!e.async&&!e.returnType&&!e.typeParameters&&1===e.params.length&&"Identifier"===e.params[0].type&&"BlockStatement"!==e.body.type)return{parameter:e.params[0],body:e.body}}(e.arguments[0]);if(!n)return;let{object:o}=e.callee;if(!nB(o,r)){var a;let t;return{node:e,object:o,callback:{...n,parameterText:(a=n.parameter,t=r.sourceCode.getText(a),a.typeAnnotation||a.optional?`(${t})`:t)}}}})(t,r,e));if(!(n.length<2||n.includes(void 0)||n.some(e=>{let t;return t=n[0],!rk(t.object,e.object)||t.callback.parameterText!==e.callback.parameterText})))return{node:t,messageId:bw,data:{method:r},suggest:[{messageId:bk,data:{method:r},fix:r=>r.replaceText(t,function(e,t,r){let{sourceCode:n}=r,[o]=e,{callback:a}=o,i=e.map(({callback:e})=>(function(e,t,r){var n,o;if(ta(e,r))return to(e,r);let a=r.sourceCode.getText(e);return(n=e,o=t,"LogicalExpression"===n.type?n.operator!==o&&("||"!==o||"&&"!==n.operator):bj.has(n.type))?`(${a})`:a})(e.body,t,r)).join(` ${t} `);return`${n.getText(o.node.callee)}(${a.parameterText} => ${i})`}(n,t.operator,e))}]}})},meta:{type:"suggestion",docs:{description:"Prefer a single `Array#some()` or `Array#every()` with a combined predicate.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[bw]:"Prefer a single `Array#{{method}}()` with a combined predicate.",[bk]:"Merge predicates into one `Array#{{method}}()` call."},languages:["js/js"]}},"unicorn/prefer-url-href":{create:e=>{e.on("CallExpression",t=>{if(tR(t,{method:"toString",argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})&&"url"===bX(t.callee.object,e)){let r={node:t.callee.property,messageId:bF};return bH(t,e)&&!ta(t.callee,e)&&bY(t.callee.object,e)&&(r.fix=r=>r.replaceTextRange([e.sourceCode.getRange(t.callee.property)[0],e.sourceCode.getRange(t)[1]],"href")),r}if(!(tb(t,{name:"String",argumentsLength:1,optional:!1},ty)&&oA(t.callee,e)))return;let[r]=t.arguments;if("url"!==bX(r,e))return;let n={node:t.callee,messageId:bF};return bH(t,e)&&bY(r,e)&&(n.fix=n=>{let o,a,i;return n.replaceText(t,(o=to(r,e),a=!ta(r,e)&&it(r,e)?`(${o})`:o,i=`${a}.href`,(aL(e.sourceCode.getTokenBefore(r.parent),e,i)?";":"")+i))}),n})},meta:{type:"suggestion",docs:{description:"Prefer `URL#href` over stringifying a `URL`.",recommended:"unopinionated"},fixable:"code",messages:{[bF]:"Prefer `URL#href` over stringifying a `URL`."},languages:["js/js"]}},"unicorn/require-proxy-trap-boolean-return":{create:e=>{let{sourceCode:t}=e,r=new s,n=[];function*o(e){let n;if(!(tE(n=e,{name:"Proxy",argumentsLength:2})||tR(n,{object:"Proxy",method:"revocable",argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1})))return;let o=e.arguments[1];if("ObjectExpression"===o.type)for(let e of o.properties){let n=b5(e,t);if(!n)continue;let o=b4(n,t,r);o&&(yield o)}}e.on("onCodePathStart",()=>{n.push(new i)}),e.on("onCodePathEnd",()=>{n.pop()}),e.on("onCodePathSegmentStart",e=>{n.at(-1).add(e)}),e.on("onCodePathSegmentEnd",e=>{n.at(-1).delete(e)}),e.on("onUnreachableCodePathSegmentStart",e=>{n.at(-1).add(e)}),e.on("onUnreachableCodePathSegmentEnd",e=>{n.at(-1).delete(e)}),e.onExit("BlockStatement",t=>{if(!(b0.has(t.parent?.type)&&t.parent.body===t))return;let o=[...n.at(-1)].every(e=>!e.reachable),a=aA(t,e,b1)||af(t,e);r.set(t.parent,o||a)}),e.onExit("CallExpression",o),e.onExit("NewExpression",o)},meta:{type:"problem",docs:{description:"Require boolean-returning Proxy traps to return booleans.",recommended:"unopinionated"},fixable:"code",messages:{[bQ]:"Proxy trap `{{name}}` should return a boolean."},languages:["js/js"]}},"unicorn/logical-assignment-operators":Eo,"unicorn/no-useless-coercion":{create:e=>{let{sourceCode:t}=e,r=(r,n,o,a)=>({node:r,messageId:Ea,data:{description:o,type:a},*fix(o,{abort:a}){if(t.getCommentsInside(r).length>0)return a();yield iW(o,r,n,e)}});e.on("CallExpression",t=>{if(t.optional||"Identifier"!==t.callee.type||1!==t.arguments.length||"SpreadElement"===t.arguments[0].type)return;let{name:n}=t.callee,o=Ei.get(n);if(!o||!oA(t.callee,e))return;let[a]=t.arguments;if(o.isType(a,e))return r(t,a,`\`${n}()\``,o.type)}),e.on("UnaryExpression",e=>{if("+"===e.operator&&n2(e.argument,t.getScope(e.argument)))return r(e,e.argument,"`+`","number")}),e.on("BinaryExpression",t=>{let n;if("+"!==t.operator)return;let{left:o,right:a}=t;if(ti(a,"")&&og(o,e))n=o;else{if(!(ti(o,"")&&og(a,e)))return;n=a}return r(t,n,"Concatenation with `''`","string")}),e.on("CallExpression",t=>{let{callee:n}=t;if(!t.optional&&!(t.arguments.length>0)&&"MemberExpression"===n.type&&!n.optional&&!n.computed&&"Identifier"===n.property.type&&"toString"===n.property.name&&og(n.object,e))return r(t,n.object,"`.toString()`","string")})},meta:{type:"suggestion",docs:{description:"Disallow useless type coercions of values that are already of the target type.",recommended:"unopinionated"},fixable:"code",messages:{[Ea]:"{{description}} is unnecessary because the value is already a {{type}}."},languages:["js/js"]}},"unicorn/no-useless-boolean-cast":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(!tR(r,{methods:El,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))return;let[n]=r.arguments;if(!tw(n))return;let o=function(e){if(!e.async&&!e.generator&&!e.returnType){if("ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type)return e.body;if("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type)return e.body.body[0].argument}}(n);if(!tK(o,e)||t.getCommentsInside(o).length>0)return;let[a]=o.arguments;if(!(n.params[0]?.type==="Identifier"&&oT(n.params[0],a))&&!(function e(t){return(t=rN(t),t?.type==="ChainExpression")?r3(t):t?.type==="LogicalExpression"?"&&"===t.operator&&e(t.left)||e(t.right):t?.type==="ConditionalExpression"?e(t.consequent)||e(t.alternate):t?.type==="SequenceExpression"&&e(t.expressions.at(-1))}(a)||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let t=r.getTypeAtLocation(e);return(t.isUnion()?t.types:[t]).some(e=>"void"===e.intrinsicName||r4.has(e.intrinsicName))}catch{return!1}}(a,e)))return{node:o,messageId:Es,data:{method:r.callee.property.name},fix(e){let r,i=t.getText(a);return"ArrowFunctionExpression"===n.type&&n.body===o&&(r=i,"SequenceExpression"===a.type||r.trimStart().startsWith("{"))&&(i=`(${i})`),e.replaceText(o,i)}}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Boolean()` casts in array predicate callbacks.",recommended:"unopinionated"},fixable:"code",messages:{[Es]:"`Boolean()` is unnecessary in `Array#{{method}}()` callbacks."},languages:["js/js"]}},"unicorn/no-useless-continue":{create:e=>{e.on("ContinueStatement",t=>{if(!t.label&&(e=>{if("BlockStatement"!==e.parent.type)return!1;let t=e;for(;;){let{parent:e}=t;if("BlockStatement"===e.type){if(e.body.at(-1)!==t)return!1;t=e;continue}if("IfStatement"===e.type&&(e.consequent===t||e.alternate===t)){t=e;continue}return tI(e)&&e.body===t}})(t))return{node:t,messageId:Eu,fix:r=>iQ(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Disallow useless `continue` statements.",recommended:"unopinionated"},fixable:"code",messages:{[Eu]:"Unnecessary `continue` statement."},languages:["js/js"]}},"unicorn/no-useless-override":{create:e=>{let{sourceCode:t}=e;e.on("MethodDefinition",r=>{let n;if("method"!==r.kind||r.accessibility||r.optional||r.decorators?.length>0||r.value.params.some(e=>e.decorators?.length>0))return;let{value:o}=r;if("FunctionExpression"!==o.type||!o.body||o.generator||!r.parent.parent.superClass)return;let a=function(e,t){let r,n,o,{value:a}=e;if(1!==a.body.body.length)return;let[i]=a.body.body;if("ReturnStatement"===i.type?r=i.argument:"ExpressionStatement"===i.type&&(r=i.expression),r?.type!=="CallExpression"||r.optional)return;let{callee:s}=r;if("MemberExpression"!==s.type||s.optional||"Super"!==s.object.type)return;let l=t.getScope(r),u=ez(e,l);if("string"==typeof u&&ez(s,l)===u&&(n=r.arguments,o=a.params,n.length===o.length&&o.every((e,t)=>{let r=n[t];return"Identifier"===e.type?"Identifier"===r.type&&r.name===e.name:"RestElement"===e.type&&"Identifier"===e.argument.type&&"SpreadElement"===r.type&&"Identifier"===r.argument.type&&r.argument.name===e.argument.name})))return{callExpression:r,name:u,isReturned:"ReturnStatement"===i.type}}(r,t);if(!a)return;let{callExpression:i,name:s,isReturned:l}=a;if(n=t.getScope(r),!r.parent.body.some(e=>e!==r&&"MethodDefinition"===e.type&&"method"===e.kind&&e.static===r.static&&null===e.value.body&&ez(e,n)===s)){if(l){let t;if(o.async&&(void 0===(t=Ed(i,e))||!0!==oC(t.type,t.checker)))return}else{let t;if(o.async||!(void 0!==(t=Ed(i,e))&&Ec(t.type)))return}return{node:r.key,messageId:Ep,data:{superCall:t.getText(i.callee)},*fix(n,{abort:o}){if(t.getCommentsInside(r).length>0)return o();yield i2(r,"",n,e)}}}})},meta:{type:"suggestion",docs:{description:"Disallow useless overrides of class methods.",recommended:"unopinionated"},fixable:"code",messages:{[Ep]:"Useless override; this method only forwards to `{{superCall}}(…)`."},languages:["js/js"]}},"unicorn/prefer-has-check":{create:e=>{e.on("CallExpression",t=>((e,t)=>{if(!tR(e,{method:"get",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}))return;let r=(e=>{let t=(e=>{for(;EA.has(e.parent?.type)&&e.parent.expression===e;)e=e.parent;return e})(e),{parent:r}=t;if(r?.type==="BinaryExpression"&&["!==","===","!=","=="].includes(r.operator)){if(r.left===t)return{node:r,operator:r.operator,value:r.right};if(r.right===t)return{node:r,operator:r.operator,value:r.left}}})(e);if(r){let n,o;if(t.sourceCode.getCommentsInside(e).length>0)return;let a=((e,t,r)=>{let n=EU(e.callee.object,r);if(!n)return;let o="!="===t.operator||"=="===t.operator;if("null-sentinel"===n.kind)return o&&ER(t.value,r)?{missingType:"undefined"}:{missingType:"null"};if("map"===n.kind){if(ER(t.value,r)&&EJ(e.callee.object,r,o?"not-nullish":"not-undefined"))return{missingType:"undefined"};if(td(t.value)&&o&&EJ(e.callee.object,r,"not-nullish"))return{missingType:"nullish"}}})(e,r,t);if(!a||(n=r.value,o=a.missingType,"undefined"===o?!ER(n,t):!td(n)))return;return{node:e.callee.property,messageId:Em,fix:((e,t,r)=>{var n;let o;if(r.sourceCode.getCommentsInside(t.node).length>r.sourceCode.getCommentsInside(e).length)return;let a=`${(({operator:e})=>"!=="===e||"!="===e)(t)?"":"!"}${(o=to(n=e.callee.object,r),!ta(n,r)&&it(n,r)?`(${o})`:o)}.has(${((e,t)=>{let[r]=e.arguments;return t.sourceCode.getText(r)})(e,r)})`;return e=>e.replaceText(t.node,a)})(e,r,t)}}if((tG(e,t)||tJ(e))&&EU(e.callee.object,t)?.kind==="map"&&EJ(e.callee.object,t,"truthy")){if(t.sourceCode.getCommentsInside(e).length>0)return;return{node:e.callee.property,messageId:Em,fix:t=>t.replaceText(e.callee.property,"has")}}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `.has()` when checking existence.",recommended:"unopinionated"},fixable:"code",messages:{[Em]:"Prefer `.has(…)` when checking existence."},languages:["js/js"]}},"unicorn/consistent-conditional-object-spread":{create:e=>{e.options[0]===EY?e.on("LogicalExpression",t=>{if(E1(t)){if("&&"!==t.operator||E0(t.right)||E2(t.left,t.right,e.sourceCode))return;let r=E9(t.left,e.sourceCode);if(r&&!r.isTrueWhenNullish&&E2(r.reference,t.right,e.sourceCode))return;let n=E4(t.left,e),o=E4(t.right,e);return{node:t,messageId:EH,data:{expectedStyle:"ternary"},*fix(r,{abort:a}){if(e.sourceCode.getCommentsInside(t).length>0)return a();yield r.replaceText(t,`${n} ? ${o} : {}`)}}}}):e.on("ConditionalExpression",t=>{if(E1(t))return function(e,t){let{test:r,consequent:n,alternate:o}=e,a=E0(o);if(a===E0(n))return;let i=a?n:o,s=E9(r,t.sourceCode),l=t.sourceCode.getCommentsInside(e).length>0;if((a?E2(r,i,t.sourceCode):"UnaryExpression"===r.type&&"!"===r.operator&&r.prefix&&E2(r.argument,i,t.sourceCode))||s&&!l&&(s.isTrueWhenNullish?!a:a)&&E2(s.reference,i,t.sourceCode))return;let u=a?E5(r,"left",t):function(e,t){if("UnaryExpression"===e.type&&"!"===e.operator&&e.prefix)return E5(e.argument,"left",t);let r=to(e,t);return!ta(e,t)&&ia(e,"!")&&(r=`(${r})`),`!${r}`}(r,t),p=E5(i,"right",t);return{node:e,messageId:EH,data:{expectedStyle:"logical"},*fix(t,{abort:r}){if(l)return r();yield t.replaceText(e,`${u} && ${p}`)}}}(t,e)})},meta:{type:"suggestion",docs:{description:"Enforce consistent conditional object spread style.",recommended:!0},fixable:"code",schema:[{description:"The conditional object spread style to enforce.",enum:[EX,EY]}],defaultOptions:[EX],messages:{[EH]:"Prefer {{expectedStyle}} conditional object spreads."},languages:["js/js"]}},"unicorn/default-export-style":vD,"unicorn/no-array-concat-in-loop":{create:e=>{e.on("AssignmentExpression",t=>{let r=function(e,t){var r;if("="!==e.operator)return;let n="Identifier"===e.left.type?e.left:void 0,o=vT(e.right);if(!n||!tR(o,{method:"concat",minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1}))return;let a=(r=vT(r=o.callee.object),r?.type==="Identifier"?r:void 0),i=vA(n,t);if(!a||!i||i!==vA(a,t)||!function(e){let[t]=e?.defs??[];if(!t||1!==e.defs.length||"global"===e.scope.type||"Variable"!==t.type||"Identifier"!==t.node.id.type||"let"!==t.parent.kind&&"var"!==t.parent.kind)return!1;let r=t.node.init&&vT(t.node.init);return!!(r&&tC(r))}(i))return;let s=function(e,t){for(let r of t.sourceCode.getAncestors(e).toReversed()){if(tw(r))return;if(tI(r))return r}}(e,t),[l]=i.defs;if(!(!s||function(e,t,r){let[n,o]=r.sourceCode.getRange(e),[a,i]=r.sourceCode.getRange(t);return n>=a&&o<=i}(l.node,s.body,t)))return{callExpression:o,property:o.callee.property}}(t,e);if(r)return{node:r.property,messageId:vw}})},meta:{type:"suggestion",docs:{description:"Disallow array accumulation with `Array#concat()` in loops.",recommended:!0},schema:[],messages:{[vw]:"Do not use `Array#concat()` to accumulate an array in a loop."},languages:["js/js"]}},"unicorn/no-array-front-mutation":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{methods:["shift","unshift"],optionalCall:!1,computed:!1}))return;let{object:r,property:n}=t.callee,{name:o}=n;if(!("unshift"===o&&tM(t.callee,vI)||nL(r,e)))return{node:n,messageId:vk,data:{method:o}}})},meta:{type:"suggestion",docs:{description:"Disallow front-of-array mutation.",recommended:!1},schema:[],messages:{[vk]:"Avoid front-of-array mutation with `Array#{{method}}()`."},languages:["js/js"]}},"unicorn/no-array-sort-for-min-max":{create:e=>{e.on("MemberExpression",t=>{if(!t.computed||t.optional||!vB(t.property)||nG(t)||("ForInStatement"===t.parent.type||"ForOfStatement"===t.parent.type)&&t.parent.left===t)return;let r=vR(t.object,e);if(r)return vP(t,r,"first",e)}),e.on("CallExpression",t=>{let r;if(!tR(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let[n]=t.arguments;if(vB(n)?r="first":tP(n)&&(r="last"),!r||nG(t))return;let o=vR(t.callee.object,e);if(o)return vP(t,o,r,e)})},meta:{type:"suggestion",docs:{description:"Disallow sorting arrays to get the minimum or maximum value.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[vj]:"Use `Math.{{method}}()` instead of sorting to get the {{extreme}} value.",[vF]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-boolean-sort-comparator":{create:e=>{e.on("CallExpression",t=>{let r,n;if(r=t,n=e,!(tb(r,{minimumArguments:1},ty)&&"MemberExpression"===r.callee.type&&v$.has(ez(r.callee,n.sourceCode.getScope(r.callee)))))return;let[o]=t.arguments;if("SpreadElement"===o.type)return;let a=((e,t)=>{let r=rN(e);if(tw(r)){let n=(e=>{if("BlockStatement"!==e.body.type)return e.body;if(1!==e.body.body.length)return;let[t]=e.body.body;if("ReturnStatement"===t.type)return t.argument})(r);if(!oo(r,t)&&!vq(e,t))return;return{node:e,messageId:vL,suggest:e===r?((e,t,r)=>{var n;if(!t||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type)||e.params.some(e=>e.typeAnnotation)||e.params.some(e=>e.optional)||e.typeParameters||e.returnType||r.sourceCode.getCommentsInside(e).length>0)return;let[o,a]=e.params;if(o.name===a.name)return;let i="BinaryExpression"===(n=rN(n=t)).type&&vM.has(n.operator)?n:void 0;if(!i||rL(i.left)||rL(i.right)||!vO(i.left,i.right,o,a))return;let[s,l]=">"===i.operator||">="===i.operator?[i.left,i.right]:[i.right,i.left],u=`(${o.name}, ${a.name}) => ${r.sourceCode.getText(s)} - ${r.sourceCode.getText(l)}`;return[{messageId:vN,data:{replacement:u},fix:t=>t.replaceText(e,u)}]})(r,n,t):void 0}}if(oa(r,t)||function(e,t){if("Identifier"===e.type)return("Boolean"===e.name||n6.has(e.name))&&t.sourceCode.isGlobalReference(e);if("MemberExpression"!==e.type||e.optional||"Identifier"!==e.object.type||!t.sourceCode.isGlobalReference(e.object))return!1;let r=n9.get(e.object.name),n=ez(e,t.sourceCode.getScope(e));return!!r?.has(n)}(r,t)||vq(e,t))return{node:e,messageId:vL}})(o,e);if(!(!a||nB(t.callee.object,e)))return a})},meta:{type:"problem",docs:{description:"Disallow boolean-returning sort comparators.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[vL]:"Do not return a boolean from a sort comparator.",[vN]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-chained-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{if(!vz.has(r.operator))return;let n=vK(r.left)?r.left:r.right;if(!vK(n))return;let o=n===r.left,a=o?r.right:r.left;if(v_.has(r.operator)&&os(a,e))return;let i={node:r,messageId:vU},s=vV.has(n.operator)===vV.has(r.operator)&&!tl(r.right);if(o&&s&&!vK(r.right)&&!vK(n.left)&&((e,t)=>{if(ta(e,t))return!0;let{parent:r}=e;return"BinaryExpression"!==r.type&&("LogicalExpression"!==r.type||"??"!==r.operator)})(r,e)&&!eH(n.right,t)&&0===t.getCommentsInside(r).length){let o=`${t.getText(r.left)} && ${to(n.right,e)} ${r.operator} ${to(r.right,e)}`;i.suggest=[{messageId:vW,data:{replacement:o},fix:e=>e.replaceText(r,o)}]}return i})},meta:{type:"problem",docs:{description:"Disallow chained comparisons such as `a < b < c`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[vU]:"Comparison operators cannot be chained. The inner comparison evaluates to a boolean, which is then compared instead of the operands.",[vW]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-constant-zero-expression":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",e=>{if(!(e=>{switch(e.operator){case"*":case"&":return ti(e.left,0)||ti(e.right,0);case"/":return ti(e.left,0);default:return!1}})(e))return;let r={node:e,messageId:vG},n=eV(e,t.getScope(e));return n&&Object.is(n.value,0)&&0===t.getCommentsInside(e).length&&(r.suggest=[{messageId:vJ,fix:t=>t.replaceText(e,"0")}]),r})},meta:{type:"problem",docs:{description:"Disallow arithmetic and bitwise operations that always evaluate to `0`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[vG]:"This operation always evaluates to `0` (or `-0`/`NaN`), which is likely a mistake.",[vJ]:"Replace this expression with `0`."},languages:["js/js"]}},"unicorn/no-duplicate-logical-operands":{create:e=>{e.on("LogicalExpression",t=>{let r,n;if("&&"!==t.operator&&"||"!==t.operator)return;let o="LogicalExpression"===t.left.type&&t.left.operator===t.operator?t.left.right:t.left;if((e=>{for(let t=e.parent;t;t=t.parent)if("WithStatement"===t.type)return!0;return!1})(t)||!vZ(o)||!vZ(t.right)||!pI(o,t.right))return;let a={node:t.right,messageId:vX};if(r=t.left,!e.sourceCode.getCommentsInside(t).every(t=>((e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=tn(t,r);return n>=a&&o<=i})(t,r,e)))return a;let i=to(t.left,e),s=e=>e.replaceText(t,i);return vQ.has(o.type)&&(n=t.right,vQ.has(n.type))?{...a,fix:s}:{...a,suggest:[{messageId:vY,fix:s}]}})},meta:{type:"problem",docs:{description:"Disallow adjacent duplicate operands in logical expressions.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[vX]:"This operand duplicates the left operand.",[vY]:"Remove the duplicate operand."},languages:["js/js"]}},"unicorn/no-impossible-length-comparison":{create:e=>{e.on("BinaryExpression",t=>{let r,n,o,a;if(!Object.hasOwn(v1,t.operator))return;let i=(r=rN(t.left),n=rN(t.right),rH(r)?{memberExpression:r,operator:t.operator,value:eV(n,e.sourceCode.getScope(n))?.value}:rH(n)?{memberExpression:n,operator:v1[t.operator],value:eV(r,e.sourceCode.getScope(r))?.value}:void 0);if(!i)return;let{memberExpression:s}=i;if("ThisExpression"===(o=rN(s.object)).type||"Super"===o.type||function e(t){return!!("ChainExpression"===(t=rN(t)).type||r3(t))||("MemberExpression"===t.type?e(t.object):"CallExpression"===t.type&&e(t.callee))}(s.object)||(a=eV(s,e.sourceCode.getScope(s)))&&(!Number.isSafeInteger(a.value)||a.value<0)||function({node:e,lengthOrSizeNode:t}){let r=function(e){for(;tW(e.parent)&&"&&"===e.parent.operator;)e=e.parent;return e}(e);return"LogicalExpression"===r.type&&"&&"===r.operator&&(function e(t){return[t.left,t.right].flatMap(r=>"LogicalExpression"===r.type&&r.operator===t.operator?e(r):[r])})(r).some(r=>r!==e&&tF(r,{computed:!1,optional:!1})&&"Identifier"===r.property.type&&rY.has(r.property.name)&&rk(r.object,t.object))}({node:t,lengthOrSizeNode:s}))return;let l=function({operator:e,value:t}){if("number"==typeof t&&Number.isFinite(t))switch(e){case"<":return!(t<=0)&&void 0;case"<=":case"===":case"==":return!(t<0)&&void 0;case">":case"!==":case"!=":return t<0||void 0;case">=":return t<=0||void 0}}(i);if(void 0!==l)return{node:t,messageId:v0,data:{property:s.property.name,result:String(l)}}})},meta:{type:"problem",docs:{description:"Disallow impossible comparisons against `.length` or `.size`.",recommended:"unopinionated"},messages:{[v0]:"This comparison is always {{result}} because `.{{property}}` is always a non-negative integer."},languages:["js/js"]}},"unicorn/no-invalid-character-comparison":{create:e=>{e.on("BinaryExpression",t=>{if(v3.has(t.operator))for(let[r,n]of[[t.left,t.right],[t.right,t.left]]){let o=tu(n);if(void 0!==o&&o.length>1&&v8(r,e)){let e="!=="===t.operator||"!="===t.operator;return{node:t,messageId:v2,data:{string:o,result:e?"true":"false"}}}}})},meta:{type:"problem",docs:{description:"Disallow comparing a single character from a string to a multi-character string.",recommended:"unopinionated"},schema:[],messages:{[v2]:"A single character can never equal the multi-character string `{{string}}`, so this comparison is always {{result}}."},languages:["js/js"]}},"unicorn/no-loop-iterable-mutation":{create:e=>{let t=new l,r=id(e);e.onExit("ForOfStatement",n=>{if(n.await)return;let o=Si(n.right,e);if(o)return function* e(t,r,n,o){if(St.has(t.type))return;let a=n;if("ForOfStatement"===t.type&&!t.await){let e=Si(t.right,o);e&&Sp(e.reference,r.iterable,o)&&(a=Sl(t,e))}if("CallExpression"===t.type){let e=function(e,t,r,n){if("MemberExpression"!==e.callee.type)return;let{addArgumentIdentifier:o,deleteArgumentIdentifier:a,iterable:i,reportedCallExpressions:s,setKeyIdentifier:l}=t,{object:u,property:p}=e.callee,c=ez(e.callee,n.sourceCode.getScope(e.callee));if(!(!v7[t.collectionKind??"unknown"].has(c)||!Sp(u,i,n)||"delete"===c&&Sc(e,a,n)||Sd(e,{addArgumentIdentifier:o,setKeyIdentifier:l},c,n)&&!function e(t,r,n){let o=function(e){let t=e;for(;t.parent&&"BlockStatement"!==t.parent.type&&"SwitchCase"!==t.parent.type;)t=t.parent;if(t.parent)return{parent:t.parent,statement:t,statements:"SwitchCase"===t.parent.type?t.parent.consequent:t.parent.body}}(t);if(!o)return!1;let{statement:a,statements:i}=o,s=i.indexOf(a);return!!i.slice(0,s).some(e=>(function e(t,r,n){let o=function(e){if("ExpressionStatement"!==e.type)return;let t=rN(e.expression);return"CallExpression"===t.type?t:void 0}(t);if(o)return"MemberExpression"===o.callee.type&&"delete"===ez(o.callee,n.sourceCode.getScope(o.callee))&&Sp(o.callee.object,r.iterable,n)&&Sc(o,r.deleteArgumentIdentifier,n);return"BlockStatement"===t.type?t.body.some(t=>e(t,r,n)):"IfStatement"===t.type&&(!r.branchAlwaysExits(t.consequent)&&e(t.consequent,r,n)||t.alternate&&!r.branchAlwaysExits(t.alternate)&&e(t.alternate,r,n))})(e,r,n))||o.parent!==r.loopBody&&e(o.parent,r,n)}(e,t,n)||r&&Sd(e,r,c,n))&&!s.has(e))return s.add(e),{node:p,messageId:v6,data:{iterable:n.sourceCode.getText(i)}}}(t,r,n,o);e&&(yield e)}for(let n of o.sourceCode.visitorKeys[t.type]??[]){let i=t[n];if(Array.isArray(i)){for(let t of i)t&&(yield*e(t,r,a,o));continue}i&&(yield*e(i,r,a,o))}}(n.body,{branchAlwaysExits:r,...Sl(n,o),reportedCallExpressions:t},void 0,e)})},meta:{type:"problem",docs:{description:"Disallow mutating a loop iterable during iteration.",recommended:!0},schema:[],messages:{[v6]:"Do not mutate `{{iterable}}` while iterating over it."},languages:["js/js"]}},"unicorn/no-selector-as-dom-name":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",function*(e){for(let{node:r,expectedPrefix:n}of(e=>{if(tR(e,{methods:Sf})&&tF(e.callee.object,{property:"classList",computed:!1})&&!oh(rN(e.callee.object.object))){let t=e.callee.property.name;return"add"===t||"remove"===t?SE(e.arguments,"."):"replace"===t?e.arguments[0]?.type==="SpreadElement"?[]:SE(e.arguments.slice(0,2),"."):SE(e.arguments.slice(0,1),".")}if(tR(e,{methods:["getElementById","getElementsByClassName"],argumentsLength:1})&&!oh(rN(e.callee.object))){let t="getElementById"===e.callee.property.name?"#":".";return SE(e.arguments,t)}return[]})(e)){if("SpreadElement"===r.type)continue;let e=rN(r),o=Sx(e);Sh(o)&&(yield Sb(e,o,n,t))}})},meta:{type:"problem",docs:{description:"Disallow selector syntax in DOM names.",recommended:!0},fixable:"code",messages:{[Sm]:"Do not use selector syntax in DOM names."},languages:["js/js"]}},"unicorn/no-useless-compound-assignment":{create:e=>{let{sourceCode:t}=e;e.on("AssignmentExpression",r=>{if(!SD.has(r.operator)||!tp(r.right)||r.right.value!==SD.get(r.operator))return;let n={operator:r.operator,value:r.right.raw};if(t.getCommentsInside(r).length>0)return{node:r,messageId:Sv,data:n};let{parent:o}=r;if("ExpressionStatement"===o.type&&["Program","BlockStatement","StaticBlock","SwitchCase"].includes(o.parent.type))return{node:r,messageId:Sv,data:n,suggest:[{messageId:SS,fix:t=>iQ(o,e,t)}]};let a=t.getText(r.left);return{node:r,messageId:Sv,data:n,suggest:[{messageId:SC,data:{left:a},fix:e=>e.replaceText(r,a)}]}})},meta:{type:"suggestion",docs:{description:"Disallow useless compound assignments such as `x += 0`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[Sv]:"This compound assignment is useless as `{{operator}} {{value}}` does not change the value.",[SS]:"Remove the useless assignment.",[SC]:"Replace the useless assignment with `{{left}}`."},languages:["js/js"]}},"unicorn/no-useless-delete-check":{create:e=>{e.on("IfStatement",t=>{let r=function(e,t){if(e.alternate||"IfStatement"===e.parent.type&&e.parent.alternate===e)return;let r=(e=>{if("BlockStatement"===e.type){if(1!==e.body.length)return;e=e.body[0]}return"ExpressionStatement"===e.type?e.expression:void 0})(e.consequent);if(r)return"UnaryExpression"===r.type&&"delete"===r.operator?function(e,t,r){let n,{test:o}=e,{argument:a}=t;if("BinaryExpression"===o.type&&"in"===o.operator&&"MemberExpression"===a.type&&!a.optional&&rk(o.right,a.object)&&SN(o.right,r)&&S$(o.left,r)&&S$(o.right,r)&&(!a.computed||S$(a.property,r))){if(a.computed)n=((e,t,r)=>{if(rk(e,t))return!((e,t)=>{var r;let n;if(SN(e,t)||SP(rN(e),t))return!0;let o=rJ(rN(e),t);if(!o)return!1;let a=rN(o);return"NewExpression"===a.type||"CallExpression"===(r="ChainExpression"===(n=r=a).type?n.expression:n).type&&void 0===SL(r,t)})(e,r);let n=SL(e,r),o=SL(t,r);return void 0!==n&&n===o})(o.left,a.property,r);else{let e=ez(a,r.sourceCode.getScope(a));n=null!==e&&e===SL(o.left,r)}return n?{suggest:[{messageId:SA,fix:SO(e,t,r)}]}:void 0}}(e,r,t):function(e,t,r){let{test:n}=e;if(SM(n,"has")&&SM(t,"delete")&&((e,t)=>{let r;if("Identifier"!==(e=rN(e)).type)return!1;let n=rJ(e,t);if(!n)return!1;let o=rN(n);return"NewExpression"===o.type&&(r=o.callee,"Identifier"===r.type&&Sk.has(r.name)&&t.sourceCode.isGlobalReference(r))})(n.callee.object,r)&&rk(n.callee.object,t.callee.object)&&rk(n.arguments[0],t.arguments[0])&&S$(n.arguments[0],r))return{fix:SO(e,t,r)}}(e,r,t)}(t,e);if(r)return{node:t.test,messageId:ST,fix:r.fix,suggest:r.suggest}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary existence checks before deletion.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[ST]:"The existence check before deletion is unnecessary.",[SA]:"Remove the existence check."},languages:["js/js"]}},"unicorn/no-useless-logical-operand":{create:e=>{e.on("LogicalExpression",t=>{if(!SU.has(t.operator)||"LogicalExpression"===t.parent.type&&t.parent.operator===t.operator)return;let r=function(e,t){let r,n,{operator:o}=e,a=function e(t,r){return"LogicalExpression"===t.type&&t.operator===r?[...e(t.left,r),...e(t.right,r)]:[t]}(e,o),i=(r=SW.get(o),tl(a[0],r)?a[0]:void 0);if(i)return{target:i,replacementOperands:[i]};let s=(n=SU.get(o),a.filter((e,r)=>tl(e,n)&&function(e,t,r){var n;if(t<e.length-1)return!0;let o=e.slice(0,-1);return tG(n=e[t].parent,r)||tJ(n)||o.every(e=>os(e,r))}(a,r,t)));if(0===s.length)return;let l=a.filter(e=>!s.includes(e));return{target:s[0],replacementOperands:0===l.length?[s.at(-1)]:l}}(t,e);if(!r)return;let{target:n,replacementOperands:o}=r;if(1===o.length&&ts(rN(o[0]))&&function(e){let{parent:t}=e;if("ExpressionStatement"!==t.type||t.expression!==e)return!1;let r=t.parent,n=r.parent;if("Program"!==r.type&&!("BlockStatement"===r.type&&tw(n)))return!1;let o=r.body.indexOf(t);return r.body.slice(0,o).every(e=>"string"==typeof e.directive)}(t))return;let a={node:n,messageId:Sq,data:{operator:t.operator}};return e.sourceCode.getCommentsInside(t).length>0||(1===o.length?a.fix=r=>iW(r,t,o[0],e):a.fix=r=>{var n;let a;return r.replaceText(t,(n=t.operator,a=o.map((t,r)=>{let o,a;return o=ta(t,e),a=to(t,e),!o&&ii(t,{operator:n,property:0===r?"left":"right"})&&(a=`(${a})`),0===r&&!o&&SV.has(rN(t).type)&&(a=`(${a})`),a}).join(` ${n} `),aL(e.sourceCode.getTokenBefore(t),e,a)?`;${a}`:a))}),a})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary operands in logical expressions involving boolean literals.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Sq]:"Simplify this `{{operator}}` expression."},languages:["js/js"]}},"unicorn/prefer-boolean-return":{create:e=>{let{sourceCode:t}=e;function r(n,o,a,i=t.getRange(n)){let s;if(!o||!a||"ConditionalExpression"===n.test.type)return;let l=SG(o),u=SG(a);if(void 0===l||void 0===u||l===u)return;let p={node:n,messageId:S_},c=!l,d=t.getCommentsInside(n).length>0||t.getCommentsInside(a).length>0||rW(e,a),m=!c&&!SJ(n.test,e)&&!!(s=eS(t.getScope(n),"Boolean"))&&0!==s.defs.length;return d||m?p:{...p,fix:t=>t.replaceTextRange(i,`return ${function(t,r){let n=to(t,e);if(r)return ia(t,"!")?`!(${n})`:`!${n}`;if(SJ(t,e))return n;let o="SequenceExpression"===t.type?`(${n})`:n;return`Boolean(${o})`}(n.test,c)};`)}}e.on("IfStatement",n=>{if(!n.alternate){var o,a;let i,s=ig(n,e);if(!s||"ReturnStatement"!==s.type)return;let l=SK(n.consequent),u=SG(l);if(void 0!==u&&(o=n,a=u,i=im(o,e,-1),i?.type==="IfStatement"&&!i.alternate&&SG(SK(i.consequent))===a))return;let p=r(n,l,s,[t.getRange(n)[0],t.getRange(s)[1]]);return p?.fix&&t.getTokensBetween(n,s,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type)?{node:n,messageId:S_}:p}return r(n,SK(n.consequent),SK(n.alternate))})},meta:{type:"suggestion",docs:{description:"Prefer directly returning boolean expressions over `if` statements.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[S_]:"Return the boolean expression directly."},languages:["js/js"]}},"unicorn/prefer-flat-math-min-max":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",e=>{let r=(e=>{for(let t of SY)if(SH(e,t))return t})(e);if(!(!r||!e.arguments.some(e=>SH(e,r))||((e,t)=>{let{parent:r}=e;return SH(r,t)&&r.arguments.includes(e)})(e,r)))return{node:e,messageId:SX,data:{method:r},*fix(n,{abort:o}){if(t.getCommentsInside(e).length>0)return o();let a=t.getText(e.callee),i=SQ(e,r).map(e=>t.getText(e)).join(", ");yield n.replaceText(e,`${a}(${i})`)}}})},meta:{type:"suggestion",docs:{description:"Prefer flat `Math.min()` and `Math.max()` calls over nested calls.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[SX]:"Prefer a flat `Math.{{method}}()` call instead of nested calls."},languages:["js/js"]}},"unicorn/prefer-hoisting-branch-code":{create:e=>{e.on("IfStatement",t=>(function*(e,t){if("IfStatement"===e.parent.type&&e.parent.alternate===e)return;let r=function(e){let t=[],r=e;for(;r?.type==="IfStatement";r=r.alternate)t.push(r.consequent);if(r)return t.push(r),t}(e);if(!r||r.some(e=>"BlockStatement"!==e.type))return;let{sourceCode:n}=t,{leading:o,trailing:a,minLength:i}=function(e,t){let r=Math.min(...e.map(e=>e.length)),n=0;for(;n<r&&e.every(r=>S6(r[n],e[0][n],t));)n++;let o=0;for(;n+o<r&&e.every(r=>S6(r.at(-1-o),e[0].at(-1-o),t));)o++;return{leading:n,trailing:o,minLength:r}}(r.map(e=>e.body),n);0===o&&0===a||!(o+a>=i)&&(o>0&&(yield S5({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!0},t)),a>0&&(yield S5({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!1},t)))})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer moving code shared by all branches of an `if` statement out of the branches.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[SZ]:"These branches start with the same code. Move it before the `if` statement.",[S0]:"These branches end with the same code. Move it after the `if` statement.",[S1]:"Move the shared code out of the branches."},languages:["js/js"]}},"unicorn/prefer-single-replace":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(void 0===Cr(r))return;let n=r.arguments[1];if(!ts(n))return;let o=n.value;if(o.includes("$`")||o.includes("$'"))return;let a=e=>void 0!==Cr(e)&&ts(e.arguments[1])&&e.arguments[1].value===o,{parent:s}=r;if("MemberExpression"===s.type&&s.object===r&&"CallExpression"===s.parent.type&&s.parent.callee===s&&a(s.parent))return;let l=[],u=r;for(;a(u);)l.push(Cr(u)),u=u.callee.object;if(l.length<2)return;let p=u;l.reverse();let c=[...new i(l)];if(c.some(e=>o.includes(e)))return;let d={node:r,messageId:S7};if(0===t.getCommentsInside(r).length){let t=c.map((e,t)=>(function(e,t,r){if(Ct.has(e))return Ct.get(e);if("^"===e)return t?String.raw`\^`:"^";if("-"===e)return t||r?"-":String.raw`\-`;let n=e.codePointAt(0);return n<32||127===n?String.raw`\x${n.toString(16).toUpperCase().padStart(2,"0")}`:e})(e,0===t,t===c.length-1)).join(""),o=to(p,e),a=to(n,e);d.fix=e=>e.replaceText(r,`${o}.replaceAll(/[${t}]/g, ${a})`)}return d})},meta:{type:"suggestion",docs:{description:"Enforce combining multiple single-character replacements into a single `String#replaceAll()` with a regular expression.",recommended:"unopinionated"},fixable:"code",messages:{[S7]:"Combine these single-character replacements into a single `replaceAll()` with a regular expression."},languages:["js/js"]}},"unicorn/consistent-tuple-labels":{create:e=>{e.on("TSTupleType",e=>{let t=e.elementTypes;if(t.length<2)return;let r=t.filter(e=>"TSNamedTupleMember"!==e.type&&("TSRestType"!==e.type||"TSNamedTupleMember"!==e.typeAnnotation.type));if(0!==r.length&&r.length!==t.length)return r.map(e=>({node:e,messageId:Cn}))})},meta:{type:"suggestion",docs:{description:"Enforce consistent labels on tuple type elements.",recommended:!0},messages:{[Cn]:"This tuple element should have a label, just like the other elements."},languages:["js/js"]}},"unicorn/no-invalid-well-known-symbol-methods":{create:e=>{e.on("MethodDefinition",t=>Cd(t,e)),e.on("Property",t=>Cd(t,e)),e.on("PropertyDefinition",t=>Cd(t,e))},meta:{type:"problem",docs:{description:"Disallow invalid implementations of well-known symbol methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[Co]:"`Symbol.dispose` must not return a Promise. Use `Symbol.asyncDispose` instead.",[Ca]:"`Symbol.dispose` must not be a generator. Use a normal method for synchronous disposal or `Symbol.asyncDispose` for asynchronous disposal.",[Ci]:"`Symbol.iterator` must return a sync iterator. Use `Symbol.asyncIterator` for async iterators.",[Cs]:"`Symbol.asyncIterator` must return an async iterator directly. Use an async generator or return the iterator synchronously.",[Cl]:"Use `Symbol.{{replacement}}` instead."},languages:["js/js"]}},"unicorn/no-late-event-control":{create:e=>{let{sourceCode:t}=e,r=yE(e);e.onExit("CallExpression",n=>{var o;let a=(e=>{if(!tR(e,{methods:Cy,computed:!1}))return;let{callee:t}=e,r=rN(t.object);if("Identifier"===r.type)return{event:r,method:t.property.name}})(n);if(!a)return;let{event:i,method:s}=a,l=eS(t.getScope(i),i),u=l?.defs.find(({type:e})=>"Parameter"===e);if(!u)return;let p=u.node;if(!(!nO(o=u.name,e)&&(yh.test(o.name)||nM(o,e))))return;let c=yx(n)!==p,d=p.generator;if(!c&&!d&&!r.isFunctionSuspended(p)&&!r.isInsideSuspendingLoop(n,p))return;let m=Cm;return c?m=Cg:d&&(m=Cf),{node:n,messageId:m,data:{name:i.name,method:s}}})},meta:{type:"problem",docs:{description:"Disallow event-control method calls after the synchronous event dispatch has finished.",recommended:!0},schema:[],messages:{[Cm]:"`{{name}}.{{method}}()` has no effect after the handler suspends. Call it before `await` or `yield` while the event is still being dispatched.",[Cf]:"`{{name}}.{{method}}()` is not called during event dispatch inside a generator function. Use a normal function handler instead.",[Cg]:"`{{name}}.{{method}}()` may run after synchronous event dispatch has finished. Call it in the outer handler before deferring work."},languages:["js/js"]}},"unicorn/prefer-abort-signal-timeout":{create:e=>{e.on("VariableDeclarator",t=>((e,t)=>{var r;let n,o,{sourceCode:a}=t,i=e.parent,{id:s,init:l}=e;if("VariableDeclaration"!==i.type||"const"!==i.kind||1!==i.declarations.length||"Identifier"!==s.type||!(tE(l,{name:"AbortController",argumentsLength:0})&&oA(l.callee,t))||(n=eS(t.sourceCode.getScope(s),"AbortSignal"))&&0!==n.defs.length||rV(t,a.getRange(l))||s.typeAnnotation&&rV(t,a.getRange(s.typeAnnotation)))return;let u=(e=>{let t=Array.isArray(e.parent.body)?e.parent.body:Array.isArray(e.parent.consequent)?e.parent.consequent:void 0;if(t)return t[t.indexOf(e)+1]})(i),p=((e,t)=>{if(e?.type==="ExpressionStatement"&&tb(e.expression,{name:"setTimeout",argumentsLength:2,optional:!1},ty)&&oA(e.expression.callee,t))return e.expression})(u,t);if(!p||((e,t,r)=>{let{sourceCode:n}=e,[,o]=n.getRange(t),[a]=n.getRange(r);return n.getAllComments().some(e=>{let[t,r]=n.getRange(e);return t>=o&&r<=a})})(t,i,u)||rV(t,a.getRange(u))||rW(t,u))return;let c=((e,t)=>{let[r]=e.arguments,n=!r||"ArrowFunctionExpression"!==r.type&&"FunctionExpression"!==r.type||r.async||r.generator||r.params.length>0?void 0:"BlockStatement"!==r.body.type?r.body:1===r.body.body.length&&"ExpressionStatement"===r.body.body[0].type?r.body.body[0].expression:void 0;if(tb(n,{argumentsLength:0,optional:!1},ty)&&tF(n.callee,{property:"abort",computed:!1,optional:!1})&&"Identifier"===n.callee.object.type&&n.callee.object.name===t)return n.callee.object})(p,s.name);if(!c)return;let d=eS(a.getScope(s),s);if(!d||eS(a.getScope(c),c)!==d)return;let m=((e,t,r)=>{let n=[];for(let o of e.references){let{identifier:e}=o;if(e===t||o.init)continue;if(o.isWrite())return;let a=CE(e,r);if(!a)return;n.push(a)}return n.length>0?n:void 0})(d,c,t);if(!m)return;let f=a.getRange(u),[,g]=p.arguments;if("SequenceExpression"===g.type||!((e,t)=>{let r=eV(e,t.sourceCode.getScope(e));if(!r)return!0;let{value:n}=r;return"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&n<=0x7fffffff})(g,t)||m.some(e=>{let r;return(r=t.sourceCode.getRange(e))[0]>=f[0]&&r[1]<=f[1]}))return;let y=(r=s.name,o=r,("abortController"===r?o="abortSignal":"controller"===r&&(o="signal"),o===r||Cv(o,d,d.identifiers[0],t)||m.some(e=>Cv(o,d,e,t)))?r:o),h=`AbortSignal.timeout(${a.getText(g)})`;return{node:s,messageId:Ch,suggest:[{messageId:Cx,*fix(e){if(yield e.replaceText(l,h),s.typeAnnotation&&(yield e.replaceText(s.typeAnnotation,": AbortSignal")),y!==s.name){let[t]=a.getRange(s);yield e.replaceTextRange([t,t+s.name.length],y)}for(let t of m)yield e.replaceText(t,y);yield iQ(u,t,e)}}]}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[Ch]:"Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.",[Cx]:"Replace with `AbortSignal.timeout()`."},languages:["js/js"]}},"unicorn/prefer-aggregate-error":{create:e=>{e.on("IfStatement",t=>{var r;let n,o="ThrowStatement"===(r=t.consequent).type?r:"BlockStatement"===r.type&&1===r.body.length&&"ThrowStatement"===r.body[0].type?r.body[0]:void 0;if(!o)return;let a=function(e,t){let r=e.argument;if(tE(r,{name:"Error",maximumArguments:2})&&oA(r.callee,t))return r}(o,e);if(!a)return;let i=function(e,t){let r=CF(e.test).map(e=>(function(e,t){let r=CI(e=CT(e),t);if(r)return r;if("BinaryExpression"!==e.type)return;let n=CI(e.left,t);if(n&&Cj(e.operator,e.right,!0))return n;let o=CI(e.right,t);if(o&&Cj(e.operator,e.left,!1))return o})(e,t)).filter(Boolean);if(1===r.length)return r[0]}(t,e);if(!i||(n=aM("AggregateError",e.sourceCode.getScope(a)))&&0!==n.defs.length)return;let{sourceCode:s}=e;return{node:a.callee,messageId:CS,fix:e.sourceCode.getCommentsInside(a).length>0?void 0:e=>{let t=[s.getText(i),...a.arguments.map(e=>s.getText(e))].join(", ");return e.replaceText(a,`new AggregateError(${t})`)}}})},meta:{type:"suggestion",docs:{description:"Prefer `AggregateError` when throwing collected errors.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[CS]:"Use `AggregateError` when throwing collected errors."},languages:["js/js"]}},"unicorn/prefer-observer-apis":{create:e=>{e.on("CallExpression",t=>{var r,n;let o;if(r=t,n=e,tR(r,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})?!!Cz(r.callee.object,n):!(tb(r,{name:"addEventListener",minimumArguments:2,maximumArguments:3,optional:!1},ty)&&oA(r.callee,n)))return;let[a,i]=t.arguments,s=tu(o=rN(a))??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{var n=r.getTypeAtLocation(e);if(n.isStringLiteral?.())return n.value;return}catch{}})(o,e);if(!CR.has(s))return;let l=((e,t)=>{if(tw(e=rN(e)))return e;if("Identifier"!==e.type)return;let r=eS(t.sourceCode.getScope(e),e);if(!r||1!==r.defs.length)return;let[n]=r.defs;if("FunctionName"===n.type)return n.node;let o=n.node.init&&rN(n.node.init);if("Variable"===n.type&&"const"===n.parent.kind&&o&&tw(o))return o})(i,e);if(l&&CZ(l.body,e))return{node:a,messageId:s}})},meta:{type:"suggestion",docs:{description:"Prefer observer APIs over resize and scroll listeners with layout reads.",recommended:!0},schema:[],messages:CB,languages:["js/js"]}},"unicorn/prefer-set-methods":{create:e=>{e.on("NewExpression",t=>{let r=((e,t)=>{if(!C6(e,t)||t.sourceCode.getCommentsInside(e).length>0)return;let[r]=e.arguments;if("ArrayExpression"===r.type&&r.elements.length>=2&&r.elements.every(e=>{let r;return De(e,t)&&(r=e.argument,tE(r,{name:"Set",argumentsLength:0})&&oA(r.callee,t)||!eH(r,t.sourceCode,{considerGetters:!0}))}))return{node:e,messageId:C0,fix:n=>n.replaceText(e,C5(e,((e,t)=>{let[r,...n]=e.elements.map(e=>e.argument),o=C9(r,t);for(let e of n)o+=`.union(${to(e,t)})`;return o})(r,t),t))}})(t,e);if(r)return r;if(!C6(t,e))return;let[n]=t.arguments;return Dr((e=>{for(;e?.type==="ParenthesizedExpression"||rL(e);)e=e.expression;return e})(n),t,e)}),e.on("CallExpression",t=>{if(!(e=>{let{parent:t}=e=C7(e);return(t?.type==="CallExpression"||t?.type==="NewExpression")&&(t.callee===e||t.arguments.includes(e))})(t))return Dr(t,t,e)})},meta:{type:"suggestion",docs:{description:"Prefer `Set` methods for Set operations.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[C0]:"Use `Set#union()` instead of spreading Sets into a new Set.",[C1]:"Use `Set#intersection()` instead of filtering by `Set#has()`.",[C2]:"Use `Set#intersection()`.",[C3]:"Use `Set#difference()` instead of filtering by `Set#has()`.",[C8]:"Use `Set#difference()`."},languages:["js/js"]}},"unicorn/prefer-toggle-attribute":{create:e=>{let{sourceCode:t}=e;e.on(["IfStatement","ConditionalExpression"],r=>{let n=Dl(r.consequent),o=Dl(r.alternate);if(!((e,t,r)=>!!(e&&t&&("setAttribute"===e.method&&"removeAttribute"===t.method||"removeAttribute"===e.method&&"setAttribute"===t.method)&&Du(e,t)&&!r3(e.receiver)&&!r3(t.receiver)&&!Dp(e,r)&&!Dp(t,r)))(n,o,e))return;let a="setAttribute"===n.method?n:o,i=n===a,s=function e(t,r,n,o=!1){if("ChainExpression"===t.type)return e(t.expression,r,n,o);if("UnaryExpression"===t.type&&"!"===t.operator&&t.prefix)return e(t.argument,r,n,!o);let a=Ds(t);if(a?.method==="hasAttribute"&&Du(a,r)&&!r3(a.receiver))return{isNegative:o,isKnownNonDom:Dp(a,n)}}(r.test,a,e);if(s?.isKnownNonDom)return;let l=s&&i===s.isNegative?"":Da(r.test,e,!i),u=a.hasEmptyAttributeValue||void 0!==tu(a.attributeValue),p=!!l&&a.isOptional||!u,c=[a.receiver,a.attributeName];l&&c.push(r.test);let d=p||rU(e,r,c)?void 0:function*(n){var o;let i,s=(i=to(o=a.receiver,e),!ta(o,e.sourceCode)&&it(o,e)?`(${i})`:i),u=to(a.attributeName,e),p=a.isOptional?"?":"",c="ConditionalExpression"===r.type,d=`${s}${p}.toggleAttribute(${u}${l?`, ${l}`:""})`;c||(d+=";"),aL(t.getTokenBefore(r),e,d)&&(d=`;${d}`),yield n.replaceText(r,d),c&&(yield iG(n,r,e))};return((e,t,{forceSuggestion:r=!1}={})=>{let n={node:e,messageId:Dn};if(!t)return n;let o="IfStatement"!==e.type&&!(tT(e)||tT(e.parent));return r||o?n.suggest=[{messageId:Do,fix:t}]:n.fix=t,n})(r,d,{forceSuggestion:!!l||!a.hasEmptyAttributeValue})})},meta:{type:"suggestion",docs:{description:"Prefer using `Element#toggleAttribute()` to toggle attributes.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[Dn]:"Prefer using `Element#toggleAttribute()` to toggle attributes.",[Do]:"Replace with `Element#toggleAttribute()`."},languages:["js/js"]}},"unicorn/prefer-url-search-parameters":{create:e=>{e.on("CallExpression",t=>{let r,n=((e,t)=>{if(!(tR(e,{object:"Object",method:"fromEntries",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})&&Dg("Object",e,t)))return;let[r]=e.arguments,n=Dx(r,t);if(!n)return;let o=DE(e,r,Db(n.query,t),t);return DS({node:e,query:n.query,replacement:o,preservedNodes:[...Dv(e,r,t),n.query]},t)})(t,e);if(n)return n;if((r=(e=>{let t=e,{parent:r}=e;for(;rL(r)&&r.expression===t;)t=r,r=r.parent;return r?.arguments?.[0]===t?r:void 0})(t))&&("CallExpression"===r.type&&1===r.arguments.length&&"MemberExpression"===r.callee.type&&"Identifier"===r.callee.object.type&&"Object"===r.callee.object.name&&((e,t,{computed:r})=>r?tu(e)===t:"Identifier"===e.type&&e.name===t)(r.callee.property,"fromEntries",{computed:r.callee.computed})||tE(r,{names:["Map","URLSearchParams"],argumentsLength:1})))return;let o=Dx(t,e);if(o)return DS({node:t,query:o.query,replacement:Db(o.query,e)},e)}),e.on("NewExpression",t=>((e,t)=>{let r=tE(e,{name:"Map",argumentsLength:1})&&Dg("Map",e,t);if(!r&&!tE(e,{name:"URLSearchParams",argumentsLength:1}))return;let[n]=e.arguments,o=Dx(n,t);if(!o)return;let a=Dh(o.query,t),i=Db(o.query,t),s=DE(e,n,r?i:a,t);return DS({node:e,query:o.query,replacement:s,preservedNodes:[...Dv(e,n,t),o.query]},t)})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `URLSearchParams` over manually splitting query strings.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[Dc]:"Prefer `URLSearchParams` over manually splitting query strings.",[Dd]:"Use `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-unsafe-promise-all-settled-values":{create:e=>{let t=id(e,r=>aA(r,e,t));e.onExit("CallExpression",r=>(function(e,t,r){if(!tR(e,{method:"then",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!DI(e.callee.object))return;let[n]=e.arguments;if(!Dw(n)||0===n.params.length)return;let[o]=n.params,a=DU(o)&&eS(t.sourceCode.getScope(o),o);if(a)return function e(t,r,n,o){if(t=Dk(t),!(!t?.type||Dw(t))&&"ClassExpression"!==t.type&&"ClassDeclaration"!==t.type){if(tR(t,{method:"map",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})&&function e(t,r,n){return!!D0(t=Dk(t),r,n)||DF(t)&&e(t.callee.object,r,n)}(t.callee.object,r,n)&&!D1(t.callee.object)){let e=D2(t,n,{knownPromiseSettledResultArray:!0,branchAlwaysExits:o});if(e)return e}for(let[a,i]of Object.entries(t))if(!("parent"===a||DZ(t,a))&&i&&"object"==typeof i)for(let t of Array.isArray(i)?i:[i]){let a=e(t,r,n,o);if(a)return a}}}(n.body,a,t,r)})(r,e,t)??D2(r,e,{branchAlwaysExits:t}))},meta:{type:"problem",docs:{description:"Disallow reading `.value` from `Promise.allSettled()` results without a fulfilled status guard.",recommended:"unopinionated"},schema:[],messages:{[DC]:"Do not read `.value` from `Promise.allSettled()` results without checking that the result is fulfilled."},languages:["js/js"]}},"unicorn/prefer-abort-signal-any":{create:e=>{e.on("VariableDeclarator",t=>((e,t)=>{var r;let n,o,{sourceCode:a}=t,s=e.parent,{id:l,init:u}=e;if("VariableDeclaration"!==s.type||"const"!==s.kind||1!==s.declarations.length||"Identifier"!==l.type||!(tE(u,{name:"AbortController",argumentsLength:0})&&oA(u.callee,t))||(n=eS(t.sourceCode.getScope(l),"AbortSignal"))&&0!==n.defs.length||rV(t,a.getRange(u))||l.typeAnnotation&&rV(t,a.getRange(l.typeAnnotation)))return;let p=((e,t,r)=>{var n;let o,a=D4(e);if(a?.type!=="ForOfStatement"||a.await||!TA(a,r)||D7(r,e,a)||!Ty(a.right,r)||Ts(a.right,r)||Tc(a.right,t,r)||Tp(a.right,r)||!TC(a.right,r)||!(!(o=Tg(a.right,r))||o.length>1&&o.every(e=>Tm(e,r))))return;let s=(e=>{if("VariableDeclaration"!==e.type||"const"!==e.kind||1!==e.declarations.length)return;let[t]=e.declarations;if("Identifier"===t.id.type&&!t.init)return t.id})(a.left);if(!s||!Td(s,r))return;let l=TT("ExpressionStatement"===(n=a.body).type?n:"BlockStatement"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type?n.body[0]:void 0);if(!l||!rk(rN(l.sourceSignal),s))return;let u=TD(l.call.arguments[1],t,s,r);if(u)return{abortReferences:new i([u]),replacement:`AbortSignal.any(${((e,t)=>{let r=t.sourceCode.getText(e);if(!TS(e,t))return r;let n=rN(e);if("ArrayExpression"===n.type)return t.sourceCode.getText(n);let o=n===e?r:`(${r})`;return`[...${o}]`})(a.right,r)})`,statements:[a]}})(s,l.name,t)??((e,t,r)=>{let n=[],o=[],a=new i,s=e,l=D4(e);for(;l;){let e=TT(l);if(!e||!TA(l,r)||D7(r,s,l)||Tc(e.sourceSignal,t,r)||Tp(e.sourceSignal,r)||!Tm(e.sourceSignal,r))break;let i=TD(e.call.arguments[1],t,e.sourceSignal,r);if(!i)break;n.push(l),o.push(e.sourceSignal),a.add(i),s=l,l=D4(l)}if(!(n.length<2))return{abortReferences:a,replacement:`AbortSignal.any([${o.map(e=>r.sourceCode.getText(e)).join(", ")}])`,statements:n}})(s,l.name,t);if(!p)return;let c=eS(a.getScope(l),l);if(!c)return;for(let e of p.abortReferences)if(eS(a.getScope(e),e)!==c)return;let d=((e,t,r)=>{let n=[];for(let o of e.references){let{identifier:e}=o;if(t.has(e)||o.init)continue;if(o.isWrite())return;let a=Tt(e,r);if(!a)return;n.push(a)}return n.length>0?n:void 0})(c,p.abortReferences,t);if(!d)return;let m=(r=l.name,o=r,("abortController"===r?o="abortSignal":"controller"===r&&(o="signal"),o===r||Tw(o,c,c.identifiers[0],t)||d.some(e=>Tw(o,c,e,t)))?r:o);return{node:l,messageId:D3,suggest:[{messageId:D8,*fix(e){if(yield e.replaceText(u,p.replacement),l.typeAnnotation&&(yield e.replaceText(l.typeAnnotation,": AbortSignal")),m!==l.name){let[t]=a.getRange(l);yield e.replaceTextRange([t,t+l.name.length],m)}for(let t of d)yield e.replaceText(t,m);yield((e,t,r)=>{if(1===e.length)return iQ(e[0],t,r);let{sourceCode:n}=t,{lines:o}=n,a=e[0],i=e.at(-1),s=n.getLoc(a).start,l=n.getLoc(i).end,u=o[s.line-1].slice(0,s.column),p=o[l.line-1].slice(l.column),{text:c}=n,[d]=n.getRange(a),[,m]=n.getRange(i);return/^\s*$/.test(u)&&/^\s*$/.test(p)&&(m+=p.length,0===d?"\r"===c[m]&&"\n"===c[m+1]?m+=2:("\n"===c[m]||"\r"===c[m])&&m++:"\r"===c[(d-=u.length)-2]&&"\n"===c[d-1]?d-=2:("\n"===c[d-1]||"\r"===c[d-1])&&d--),r.removeRange([d,m])})(p.statements,t,e)}}]}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `AbortSignal.any()` over manually forwarding abort events between signals.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[D3]:"Prefer `AbortSignal.any()` over manually forwarding abort events between signals.",[D8]:"Replace with `AbortSignal.any()`."},languages:["js/js"]}},"unicorn/prefer-block-statement-over-iife":{create:e=>{let{sourceCode:t}=e,{visitorKeys:r}=t;e.on("ExpressionStatement",n=>{let o,a,{expression:i}=n;if("CallExpression"!==i.type||i.optional||i.arguments.length>0)return;let{callee:s}=i;if(!("FunctionExpression"!==s.type&&"ArrowFunctionExpression"!==s.type||s.id||s.async||s.generator||s.params.length>0||"BlockStatement"!==s.body.type||s.body.body.some(e=>tv(e))||TB(s.body,r,e=>"ReturnStatement"===e.type||"VariableDeclaration"===e.type&&"var"===e.kind||"CallExpression"===e.type&&"Identifier"===e.callee.type&&"eval"===e.callee.name)||(o=s.body,"script"===t.ast.sourceType&&TB(o,t.visitorKeys,e=>"FunctionDeclaration"===e.type))||(a=s.body,rU(e,TR(n,e.sourceCode),[a]))||"FunctionExpression"===s.type&&TB(s.body,r,TI,TF))){let t;return{node:i,messageId:Tk,fix:(t=s.body,r=>r.replaceTextRange(TR(n,e.sourceCode),e.sourceCode.getText(t)))}}})},meta:{type:"suggestion",docs:{description:"Prefer block statements over IIFEs used only for scoping.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Tk]:"Prefer a block statement over an IIFE used only for scoping."},languages:["js/js"]}},"unicorn/no-multiple-promise-resolver-calls":{create:e=>{let t,{sourceCode:r}=e,n=new s,a=(e,r)=>{var n;t.currentSegments.add(e),(t.terminatedFinallyBlocks.has(r)||e.prevSegments.length>0&&e.prevSegments.every(e=>!e.reachable||t.terminatedSegments.has(e)))&&t.terminatedSegments.add(e),n=t,"CatchClause"===r.type&&n.catchClausesBySegment.set(e,r)},u=e=>{t.currentSegments.delete(e)};e.on("onCodePathStart",(a,s)=>{let u=t,p=u&&T2(a,s)&&u.currentSegments.size>0&&[...u.currentSegments].every(e=>u.terminatedSegments.has(e));t={upper:u,codePath:a,node:s,currentSegments:new i,eventsBySegment:new o,executors:new i,catchClausesBySegment:new o,ignoredLoopEdges:[],terminatedSegments:new l,terminatedFinallyBlocks:new l,hasResolverReferences:u?.hasResolverReferences??!1},p&&t.terminatedSegments.add(a.initialSegment),TO(s,e)&&function(e,t,r){let n=!1;for(let o of e.params.slice(0,2)){if("Identifier"!==o.type)continue;let a=eS(r.getScope(o),o);if(!(!a||Tq(a)))for(let r of a.references)t.set(r.identifier,e),n=!0}return n}(s,n,r)&&(t.hasResolverReferences=!0)}),e.on("onCodePathEnd",()=>{let r=t,n="StaticBlock"===r.node.type?r.node.body.at(-1):r.node,a="StaticBlock"===r.node.type?oQ(r.node,e):o5(r.node,e),i=T2(r.codePath,r.node)&&TX(r.node).catchClause&&n&&af(n,e)&&aA(n,e,TN)&&!a,s=n&&(aA(n,e,TN)&&!i||"TryStatement"===n.type&&T1(n,e)||"StaticBlock"===r.node.type&&!i&&a);if(!function(e,t){if(0===e.executors.size)return;let r=TV(e.codePath),n=new l;for(let a of e.executors){let i=function(e,t,r){let n,a=new o;do for(let o of(n=!1,r)){let r=function(e,t,r){for(let n of t)e=TK(e,n,r);return e}(TY(o,a,e),e.eventsBySegment.get(o)??[],t);TJ(r,a.get(o))||(a.set(o,r),n=!0)}while(n);return a}(e,a,r);for(let o of r){let r=TY(o,i,e);for(let i of e.eventsBySegment.get(o)??[])i.executor===a&&r.resolverCalled&&!n.has(i.node)&&(n.add(i.node),t.report({node:i.node,messageId:TP})),r=TK(r,i,a)}}}(r,e),r.upper&&T2(r.codePath,r.node)&&(TV(r.codePath).every(e=>r.terminatedSegments.has(e))||s))for(let e of r.upper.currentSegments)r.upper.terminatedSegments.add(e);t=r.upper}),e.onExit("IfStatement",n=>{let o,a=eV(n.test,r.getScope(n.test));if(null!==a&&oW(n.test,e)&&(o=a.value?n.consequent:n.alternate),o&&function e(t){return"ReturnStatement"===t.type?!t.argument:"BlockStatement"===t.type&&1===t.body.length&&e(t.body[0])}(o))for(let e of t.currentSegments)e.reachable&&t.terminatedSegments.add(e)}),e.on("onCodePathSegmentStart",a),e.on("onUnreachableCodePathSegmentStart",a),e.on("onCodePathSegmentEnd",u),e.on("onUnreachableCodePathSegmentEnd",u),e.on("onCodePathSegmentLoop",(e,r,n)=>{(TH(n)||function(e){if("ContinueStatement"!==e.type)return!1;let t=e.label?.name,r=!1,n=e,{parent:o}=e;for(;o&&!tw(o);){if("TryStatement"===o.type&&o.finalizer&&(o.block===n||o.handler===n)&&(r=!0),t&&"LabeledStatement"===o.type&&o.label.name===t||!t&&tI(o))return r;n=o,{parent:o}=o}return!1}(n))&&t.ignoredLoopEdges.push({previousSegment:e,segment:r})}),e.onExit(["Identifier","CallExpression","ImportExpression","MemberExpression","NewExpression","ThrowStatement","YieldExpression"],r=>{if(o0(r,e)){if(!TZ(r,e)&&!function(e,t,r){let n=e,{parent:o}=e,a=!1;for(;o&&!tw(o);){if("IfStatement"===o.type&&(o.consequent===n||o.alternate===n)?a||=!oV(o.test,t):("SequenceExpression"===o.type&&o.expressions[0]!==n||"LogicalExpression"===o.type&&o.right===n||"ConditionalExpression"===o.type&&o.test!==n)&&(a||=!o5(o,t)),"TryStatement"===o.type&&o.handler&&o.block===n)return a||!oQ(o.block,t,!0,{isAdditionalStatementDefinitelyNotThrowing:e=>TW(e,r)});n=o,{parent:o}=o}return!1}(r,e,n)){let n=function(e,t){let r=e,{parent:n}=e;for(;n;){if(tw(n))return;if("TryStatement"===n.type&&n.finalizer&&(n.block===r||n.handler===r)&&T1(n,t))return n;r=n,{parent:n}=n}}(r,e);for(let o of(n&&t.terminatedFinallyBlocks.add(n.finalizer),function(e,t){let r=e,{parent:n}=e;for(;n;){if("AssignmentPattern"===n.type)return n.right===r&&TO(n.parent,t)&&!n.parent.params.slice(0,2).includes(n);if(!T0(n,r,t))break;r=n,{parent:n}=n}return!1}(r,e)&&t.terminatedSegments.add(t.codePath.initialSegment),t.currentSegments))t.terminatedSegments.add(o)}return}if(!t.hasResolverReferences||"Identifier"===r.type&&(n.has(r)||!TQ(r))||"ImportExpression"===r.type&&!TQ(r))return;let o=TU(r,n),{catchClause:a,finallyBlocks:i}=o?{catchClause:void 0,finallyBlocks:function(e){let t=[],r=e,{parent:n}=e;for(;n&&!tw(n);)"TryStatement"===n.type&&n.finalizer===r&&t.push(n.finalizer),r=n,{parent:n}=n;return t}(r)}:TX(r);if((o||a)&&!(function(e){let t=e,{parent:r}=e;for(;r;){if(TH(r)&&("WhileStatement"===r.type&&r.body===t||"ForStatement"===r.type&&(r.body===t||r.update===t)))return!0;t=r,{parent:r}=r}return!1}(r)||o&&TZ(r,e))){var s=t,l={catchClause:a,finallyBlocks:i,node:r,executor:o};for(let e of s.currentSegments){if(!e.reachable||s.terminatedSegments.has(e))continue;let t=s.eventsBySegment.get(e);t||(t=[],s.eventsBySegment.set(e,t)),t.push(l)}o&&t.executors.add(o)}}),e.onExit(["ArrayExpression","AssignmentExpression","ConditionalExpression","ImportExpression","LogicalExpression","ObjectExpression","SequenceExpression","TemplateLiteral","YieldExpression"],r=>{if(o5(r,e))for(let e of t.currentSegments)e.reachable&&t.terminatedSegments.add(e)})},meta:{type:"problem",docs:{description:"Disallow calling Promise executor resolver functions more than once on the same execution path.",recommended:"unopinionated"},messages:{[TP]:"Promise executor resolver functions may be called multiple times on the same execution path."},languages:["js/js"]}},"unicorn/no-unnecessary-string-trim":{create:e=>{e.on("CallExpression",t=>{var r,n;let o;if(!tR(t,{methods:T8,maximumArguments:1,optionalCall:!1,optionalMember:!1}))return;let a=t.callee.object;if(!tR(a,{method:"trim",argumentsLength:0,optionalCall:!1,optionalMember:!1})||r3(t))return;let i=a.callee.object;if(((e,t)=>{if(e=rN(e),e=rN(rJ(e,t)??e),T9.has(e.type))return!0;let r=T5(e,t);return!!r&&"string"!=typeof r.value})(i,e)||of(i,e)||tR(r=rN(r=i),{method:"string",argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})&&"Identifier"===r.callee.object.type&&(n=r.callee.object,o=eS(e.sourceCode.getScope(n),n),o?.defs.some(e=>{if("ImportBinding"!==e.type)return!1;let{node:t,parent:r}=e;return!aN(t)&&r.source?.value==="zod"&&("ImportNamespaceSpecifier"===t.type||"ImportSpecifier"===t.type&&("z"===t.imported.name||"z"===t.imported.value))})))return;let{property:s}=t.callee,{property:l}=a.callee,u=s.name,[p]=t.arguments;if(p){let t=((e,t)=>{let r=T5(e,t);if(!r)return;let{value:n}=r;return null===n||T6.has(typeof n)?String(n):void 0})(p,e);if(void 0===t||("startsWith"===u?t!==t.trimEnd():t!==t.trimStart()))return}let c="startsWith"===u?"trimStart":"trimEnd";return{node:l,messageId:T3,data:{method:u,replacement:c},fix:e=>e.replaceText(l,c)}})},meta:{type:"suggestion",docs:{description:"Disallow `String#trim()` before `String#startsWith()` or `String#endsWith()`.",recommended:"unopinionated"},fixable:"code",messages:{[T3]:"Prefer `String#{{replacement}}()` before `String#{{method}}()`."},languages:["js/js"]}},"unicorn/no-useless-re-export":{create:e=>{let{sourceCode:t}=e,r=[],n=[];e.on("ExportAllDeclaration",e=>{e.exported||r.push({node:e,request:Ae(e,t)})}),e.on("ExportNamedDeclaration",e=>{e.source&&n.push(e)});let o=(e,n)=>{let o=T7(n.exported);if("default"===o)return;let a=T7(n.local),[i]=t.getRange(n.local),[s]=t.getRange(n.exported);if(a===o&&i!==s)return;let l="type"===n.exportKind||"type"===e.exportKind,u=Ae(e,t);if(a===o&&r.some(e=>e.request===u&&"default"!==o&&("type"!==e.node.exportKind||l)))return{node:n,messageId:T4}};e.on("Program:exit",function*(){if(1===new i(r.map(e=>e.request)).size)for(let e of n)for(let t of e.specifiers){let r=o(e,t);r&&(yield r)}})},meta:{type:"suggestion",docs:{description:"Disallow redundant re-exports.",recommended:"unopinionated"},schema:[],messages:{[T4]:"This export is redundant because the same module is already exported with `export *`."},languages:["js/js"]}},"unicorn/iteration-fallback-style":{create:e=>{e.options[0]===Ao?e.on("IfStatement",t=>((e,t)=>{let r=(e=>{let t=(e=>{if(e.alternate)return;let{consequent:t}=e;if("BlockStatement"===t.type){if(1!==t.body.length)return;return t.body[0]}return t})(e);if(!t||"ForInStatement"!==t.type&&"ForOfStatement"!==t.type)return;let r=rN(e.test),n="||";if(!pj(r)){if("BinaryExpression"!==r.type||"!="!==r.operator)return;let e=td(r.left),t=e?r.right:r.left;if(!td(e?r.left:r.right)||!pj(t))return;r=t,n="??"}let o=rN(As(t));if(!(pB(r)||pB(o))&&pj(o)&&rk(r,o))return{loop:t,source:o,sourceNode:As(t),operator:n}})(e);if(!r)return;let n=Al(r.loop)?"object":"array",o={node:e.test,messageId:Ar,data:{type:n}};return"ForOfStatement"===r.loop.type&&((e,t,r)=>{let{sourceCode:n}=r,{source:o}=t,{start:a}=n.getLoc(e);return!(n.getCommentsInside(e).length>0||rG(e,r)||!pj(o)||o!==t.sourceNode||eH(o,n)||t.loop.await||"LabeledStatement"===e.parent.type||rR(e,r).length!==a.column)})(e,r,t)&&(o.fix=n=>{let{sourceCode:o}=t,{loop:a,sourceNode:i,operator:s}=r,[l]=o.getRange(a),[u,p]=o.getRange(i),c=o.getText(a),d=o.getText(i),m=Al(a)?"{}":"[]",f=[c.slice(0,u-l),`${d} ${s} ${m}`,c.slice(p-l)].join(""),g=rR(e,t);return n.replaceText(e,((e,t,r)=>{let[n,...o]=dN(`${t}${e}`).split("\n");return[n,...o.map(e=>""===e?e:`${r}${e}`)].join("\n")})(f,rR(a,t),g))}),o})(t,e)):e.on(["ForInStatement","ForOfStatement"],t=>((e,t)=>{let r=((e,t)=>{let r=rN(e);if("LogicalExpression"!==r.type||"??"!==r.operator&&"||"!==r.operator)return;let n=rN(r.right);if(t(n))return{logicalExpression:r,fallback:n,source:r.left,operator:r.operator}})(As(e),Al(e)?tD:tC);if(!r)return;let{fallback:n}=r,o="ArrayExpression"===n.type?"array":"object",a={node:n,messageId:At,data:{type:o}};return"ForOfStatement"===e.type&&((e,t,r)=>{let{sourceCode:n}=r,{logicalExpression:o,source:a}=t;return!e.await&&!(n.getCommentsInside(o).length>0||rG(e,r)||rL(o.right)||!pj(a)||eH(a,n)||"LabeledStatement"===e.parent.type||"IfStatement"===e.parent.type)})(e,r,t)&&(a.fix=n=>{let{sourceCode:o}=t,{logicalExpression:a,source:i,operator:s}=r,[l]=o.getRange(e),[u,p]=o.getRange(a),c=o.getText(e),d=o.getText(i),m=[c.slice(0,u-l),d,c.slice(p-l)].join(""),f=rR(e,t),g=dN(`${f}${m}`),y="??"===s?`(${d}) != null`:d;return n.replaceText(e,`if (${y}) {
58
- ${d$(g,1,{indent:`${f} `})}
59
- ${f}}`)}),a})(t,e))},meta:{type:"suggestion",docs:{description:"Enforce a consistent style for optional loop sources.",recommended:!1},fixable:"code",schema:[{enum:[An,Ao],description:"The preferred style for optional loop sources."}],defaultOptions:[An],messages:{[At]:"Prefer an `if` guard over the empty {{type}} fallback.",[Ar]:"Prefer an empty {{type}} fallback over the `if` guard."},languages:["js/js"]}}}).map(([e,t])=>{let r;return[e,{meta:{schema:[],...t.meta,docs:{...t.meta.docs,url:(r=S.basename(e,".js"),`https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v73.0.0/docs/rules/${r}.md`)}},create:a3(t.create)}]})))};module.exports=Au;
1
+ let e;"use strict";var t=Int32Array,r=Map,n=RegExp,o=Set,a=Uint16Array,i=WeakMap,s=WeakSet;var l,u,p,c,d,m,f,g,y,h,x=require("eslint-plugin-sukka"),b=require("@eslint-sukka/shared"),v=require("node:fs"),E=require("@eslint/css-tree"),S=require("node:assert/strict"),T=require("node:util/types"),C=require("node:path"),D=require("node:util"),w=require("eslint/use-at-your-own-risk");function A(e,t){if("string"==typeof t){let e=t;t=t=>t.type===e}for(;e;){if(t(e))return e;e=e.parent}}function k(e){return e?.type==="Identifier"||e?.type==="PrivateIdentifier"}function I(e){return e?.type==="MemberExpression"}function j(e){return e?.type==="AwaitExpression"}function R(e,t){return!!k(e)&&("function"==typeof t?t(e.name):Array.isArray(t)?t.includes(e.name):e.name===t)}function F(e,t){return e?.type==="Literal"&&(Array.isArray(t)?t.includes(e.value):"string"==typeof e.value&&t instanceof RegExp?t.test(e.value):e.value===t)}function B(e){return!!e&&["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"].includes(e.type)}function L(e,t){return e?.type==="Identifier"&&t?.type===e.type&&e.name===t.name}function N({create:e,meta:t,name:r}){return t.docs&&!t.docs.url&&(t.docs.url=new URL(r,"https://dimensiondev.github.io/eslint-plugin/src/rules/").href),{create(r){var n,a;let i,s=(n=t.defaultOptions||[],a=r.options,i=structuredClone(n),null==a||i.forEach((e,t)=>{if(void 0!==a[t]){let r=a[t];"object"!=typeof r||Array.isArray(r)||"object"!=typeof e||Array.isArray(e)?i[t]=r:i[t]=function e(t={},r={}){return t?r?Object.fromEntries([...new o([...Object.keys(t),...Object.keys(r)])].map(n=>{let o=n in t,a=n in r,i=t[n],s=r[n];return[n,o&&a?"object"!=typeof i||Array.isArray(i)||"object"!=typeof s||Array.isArray(s)?s:e(i,s):o?i:s]})):t:r}(e,r)}}),i);return e(r,s)},meta:t,name:r}}function P(e){if(!e?.program)throw Error("see https://typescript-eslint.io/docs/linting/type-linting")}var M=N({name:"array/no-unneeded-flat-map",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow `Array#flatMap((x) => x)` when simpler alternatives exist",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow simple `Array#flatMap()` in array"}},create:e=>({CallExpression(t){var r;if("MemberExpression"!==t.callee.type||!R(t.callee.property,"flatMap")||!(B(r=t.arguments[0])&&1===r.params.length&&"Identifier"===r.params[0].type&&r.body&&(L(r.params[0],r.body)||"BlockStatement"===r.body.type&&1===r.body.body.length&&"ReturnStatement"===r.body.body[0].type&&L(r.params[0],r.body.body[0].argument))))return;let{property:n}=t.callee;e.report({node:t,messageId:"invalid",*fix(e){yield e.replaceText(n,"flat"),yield*t.arguments.map(t=>e.remove(t))}})}})});let $=new o(["href","pathname","search","hash","origin"]);var O=N({name:"browser/prefer-location-assign",meta:{type:"suggestion",fixable:"code",docs:{description:"Prefer `location.assign(...)` over `location.*`",recommended:"stylistic"},schema:[],messages:{instead:"Use `location.assign(...)` instead of `location.{{name}}`"}},create:e=>({AssignmentExpression(t){let r=function(e,t){if(R(e,t))return e;for(;I(e);){if(R(e.property,t))return e;e=e.object}}(t.left,"location");if(!r)return;let n=U(r.parent);e.report({node:t,messageId:"instead",data:{name:n},fix:function(e,t,r){let n=U(t.parent);if($.has(n??"href"))return n=>n.replaceText(r,`${e.getText(t)}.assign(${e.getText(r.right)})`)}(e.sourceCode,r,t)})}})});function U(e){if(I(e)&&k(e.property))return e.property.name}var q=N({name:"jsx/no-template-literal",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow use template-literal in JSX",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow use template-literal in JSX"}},create:e=>({JSXExpressionContainer(t){if("TemplateLiteral"!==t.expression.type||t.parent?.type==="JSXAttribute")return;let{expression:r}=t;e.report({node:t,messageId:"invalid",fix(n){let o=[...r.expressions,...r.quasis];o.sort((e,t)=>e.range[0]-t.range[0]);let a=o.map(t=>"TemplateElement"===t.type?t.value.cooked:"{"+e.sourceCode.getText(t)+"}");return n.replaceText(t,a.join(""))}})}})}),W=N({name:"jsx/no-unneeded-nested",meta:{type:"suggestion",fixable:"code",docs:{description:"Reduce unneeded JSXFragment nested",recommended:"stylistic"},schema:[],messages:{invalid:"Reduce unneeded JSXFragment nested"}},create(e){let t=e.sourceCode;return{JSXFragment(r){if(1!==r.children.length)return;let n=r.children[0];e.report({node:r,messageId:"invalid",*fix(e){"JSXExpressionContainer"===n.type?"JSXEmptyExpression"!==n.expression.type&&(yield e.replaceText(r,t.getText(n.expression))):yield e.replaceText(r,t.getText(n))}})}}}});let V=/^toLocale(?<name>Upper|Lower)Case$/g;var z=N({name:"string/no-locale-case",meta:{type:"problem",fixable:"code",docs:{description:"Disallow use `String#toLocale{Upper,Lower}Case()`",recommended:"recommended"},schema:[],messages:{instead:"Use `.to{{name}}Case(...)` instead of `.toLocale{{name}}Case()`"}},create:e=>({CallExpression(t){if(t.arguments.length>0||!I(t.callee)||!k(t.callee.property))return;let{property:r}=t.callee,n=V.exec(r.name);n&&e.report({node:t,data:{name:n.groups?.name},messageId:"instead",fix:e=>e.replaceText(r,r.name.replaceAll("Locale",""))})}})}),_=N({name:"string/no-simple-template-literal",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow simple template-literal",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow simple template-literal"}},create:e=>({TemplateLiteral(t){var r,n,o,a;let i=(r=e.sourceCode,(o=n=t,o.parent?.type!=="TaggedTemplateExpression"&&1===o.quasis.length&&!function({loc:e}){return!!e&&e.start.line!==e.end.line}(o.quasis[0])&&0===o.expressions.length)?e=>{let t=JSON.stringify(n.quasis[0].value.cooked||""),o=A(n,e=>"Property"===e.type&&e.key===n);return o?e.replaceText(o,`${t}: ${r.getText(o.value)}`):e.replaceText(n,t)}:2===(a=n).quasis.length&&a.quasis.every(({value:e})=>""===e.cooked)&&1===a.expressions.length?e=>e.replaceText(n,r.getText(n.expressions[0])):void 0);i&&e.report({node:t,messageId:"invalid",fix:i})}})});let J=/\P{ASCII}/u;function H(e,t){return{Program(r){for(let n of r.tokens??[]){let r=function(e){switch(e.type){case"String":case"Template":return e.value.slice(1,-1);case"Identifier":if(e.value.startsWith("#"))return e.value.slice(1);return e.value;case"PrivateIdentifier":case"JSXText":case"JSXIdentifier":return e.value;case"RegularExpression":return e.regex.pattern}return!1}(n);!1!==r&&e.test(r)&&t(n,"code")}for(let n of r.comments??[])e.test(n.value)&&t(n,"comment")}}}function K(e,t){switch(e.type){case"String":case"Template":return r=>{let n=e.value.slice(0,1),o=e.value.slice(-1),a=G(e.value.slice(1,-1),t);return r.replaceText(e,`${n}${a}${o}`)};case"JSXText":return r=>{let n=e.value.replace(t,e=>`&#x${X(e.codePointAt(0))};`);return r.replaceText(e,n)};case"RegularExpression":return r=>{let a=new o(e.regex.flags);a.add("u");let i=new n(G(e.regex.pattern,t),[...a].join(""));return r.replaceText(e,i.toString())}}}function G(e,t){return e.replace(t,e=>{let t=e.codePointAt(0);return t>65535?`\\u{${X(t)}}`:`\\u${X(t)}`})}function X(e){return e.toString(16).padStart(4,"0").toUpperCase()}N({name:"unicode/specific-set",meta:{type:"problem",fixable:"code",docs:{description:"Limit the range of literal characters"},schema:[{type:"object",properties:{pattern:{type:"string"},flags:{type:"string"},only:{type:"string",enum:["code","comment"]}},additionalProperties:!1}],messages:{illegal:"Illegal character detected"},defaultOptions:[{pattern:J.source,flags:"u",only:void 0}]},create(e,[{pattern:t,flags:r,only:o}]){let a=t?new n(t,r):J;return H(a,(t,r)=>{if(o&&o!==r)return;let n=K(t,RegExp(a.source,"gu"));e.report({node:t,messageId:"illegal",fix:n})})}});let Y=/[\u061C\u202A-\u202E\u2066-\u2069]/;var Z=N({name:"unicode/no-bidi",meta:{type:"problem",fixable:"code",docs:{description:"Detect and stop Trojan Source attacks",recommended:"recommended"},schema:[],messages:{detected:"Detected potential trojan source attack with unicode bidi introduced in this {{kind}}: {{text}}."}},create:e=>H(Y,(t,r)=>{let n=RegExp(Y.source,"gu"),o={kind:r,text:G(t.value,n)},a=K(t,n);e.report({node:t,data:o,messageId:"detected",fix:a})})});let Q=function(...e){let t=e.map(e=>"string"==typeof e?e:e.source).join("");return RegExp(`[${t}]`,"u")}(/\u00AD\u034F\u061C\u17B4\u17B5\uFEFF\uFFFC/,/\u180B-\u180E/,/\u200B-\u200F/,/\u202A-\u202E/,/\u2060-\u206F/,/\uFE00-\uFE0F/,/\uFFF0-\uFFF8/,/\u{1D173}-\u{1D17A}/u,/\u{E0000}-\u{E007F}/u,/\u{E0100}-\u{E01EF}/u);var ee=N({name:"unicode/no-invisible",meta:{type:"problem",fixable:"code",docs:{description:"Disallow invisible characters",recommended:"recommended"},schema:[],messages:{illegal:"Illegal character detected"}},create:e=>H(Q,t=>{let r=K(t,RegExp(Q.source,"gu"));e.report({node:t,messageId:"illegal",fix:r})})}),et=N({name:"no-redundant-variable",meta:{type:"problem",fixable:"code",docs:{description:"Disallow redundant variable",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow Redundant Variable"}},create:e=>({BlockStatement({body:t}){var r,n,o,a,i;let s=t.find(er);if(!s)return;let l=t[t.indexOf(s)-1];r=l,n=s,r&&"VariableDeclaration"===r.type&&1===r.declarations.length&&r.declarations.some(({init:e,id:t})=>null!==e&&L(n.argument,t))&&e.report({node:s,messageId:"invalid",fix:(o=e.sourceCode,a=l,i=s,e=>{var t;let{init:r,id:n}=a.declarations[0];if(!(r&&n&&i.argument))return null;let s=!j(t=r)||A(t,"TryStatement")?t:t.argument,l=(e=>{if(!n.typeAnnotation)return e;let t=o.getText(n.typeAnnotation.typeAnnotation);return`(${e}) as ${j(r)?`Promise<${t}>`:t}`})(o.getText(s));return[e.remove(a),e.replaceText(i.argument,l)]})})}})});function er(e){return"ReturnStatement"===e.type&&k(e.argument)}var en=N({name:"no-single-return",meta:{type:"suggestion",docs:{description:"Disallow single-return",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow Single Return"}},create:e=>({BlockStatement({parent:t,body:r}){if(!B(t))return;let n=function(e,t){let r=t.find(eo);if(!r)return;let n=t.find(e=>{var t,n;return t=e,n=r,"VariableDeclaration"===t.type&&"const"!==t.kind&&t.declarations.some(({id:e})=>L(n.argument,e))});if(n)return e.sourceCode.getDeclaredVariables(n).find(({references:e})=>e.every(e=>e.isWriteOnly()||e.identifier.parent===r))}(e,r);for(let{identifier:t}of n?.references??[])t.parent&&e.report({node:t.parent,messageId:"invalid"})}})});function eo(e){return"ReturnStatement"===e.type&&k(e.argument)}var ea=N({name:"prefer-early-return",meta:{type:"problem",fixable:"code",docs:{description:"Prefer early returns over full-body conditional wrapping in function declarations",recommended:"stylistic"},schema:[{type:"object",properties:{maximumStatements:{type:"integer",minimum:0}},additionalProperties:!1}],messages:{prefer:"Prefer an early return to a conditionally-wrapped function body"},defaultOptions:[{maximumStatements:0}]},create:(e,[{maximumStatements:t}])=>({BlockStatement:function({body:r,parent:n}){var o,a;if(!B(n)||!(1===r.length&&function(e,t){if("IfStatement"!==e.type||null!==e.alternate)return!1;let{consequent:r}=e;return"ExpressionStatement"===r.type&&0===t||"BlockStatement"===r.type&&r.body.length>t}(r[0],t)))return;let i=(o=e,a=r[0],function*(e){var t;let r;if("IfStatement"!==a.type)return;let{test:n,consequent:i}=a;yield e.insertTextBefore(n,"!("),yield e.insertTextAfter(n,")"),yield e.replaceText(i,"return;");let s=(t=o.sourceCode.getText(i),r=t,"BlockStatement"===i.type?r.slice(1,-1):r);yield e.insertTextAfter(a,s)});e.report({node:r[0],messageId:"prefer",fix:i})}})}),ei=N({name:"prefer-fetch",meta:{type:"problem",docs:{description:"Enforce fetch",recommended:"stylistic"},schema:[],messages:{callee:"Should use 'fetch' instead"}},create:e=>({ImportDeclaration(t){let r=t.source.value;("axios"===r||"request"===r)&&e.report({node:t,messageId:"callee"})},NewExpression(t){var r;((function({callee:e}){return R(e,"XMLHttpRequest")})(t)||R((r=t).callee,"ActiveXObject")&&F(r.arguments[0],/xmlhttp/i))&&e.report({node:t,messageId:"callee"})},CallExpression(t){((function({callee:e}){let t="$http";return R(e,t)||I(e)&&R(e.object,t)})(t)||function({callee:e,parent:t}){let r=["$","jQuery"];return R(e,r)&&I(t)&&R(t.property,"load")||I(e)&&R(e.object,r)&&R(e.property,["ajax","get","post","getJSON","getScript"])}(t)||es(t,"axios")||es(t,"request"))&&e.report({node:t,messageId:"callee"})}})});function es(e,t){return R(e.callee,"require")&&F(e.arguments[0],t)}let el=new o(["setTimeout","setInterval","requestAnimationFrame","requestIdleCallback"]);var eu=N({name:"prefer-timer-id",meta:{type:"problem",docs:{description:"Enforce best practice with timer function",recommended:"recommended"},schema:[],messages:{assign:"Timer id should assign to an identifier or member for cleaning up, `const timer = {{name}}(...);`",fix:"Assign timer id to a variable"},hasSuggestions:!0},create:e=>({CallExpression(t){"Identifier"!==t.callee.type||!el.has(t.callee.name)||function(e){if(!R(e.callee,"setTimeout"))return!1;let t=e.arguments[1];return!t||F(t,0)}(t)||t.parent?.type==="AssignmentExpression"&&t.parent.right===t||t.parent?.type==="VariableDeclarator"&&t.parent.init===t||e.report({node:t,messageId:"assign",data:{name:t.callee.name},suggest:[{messageId:"fix",fix:e=>e.insertTextBefore(t,"const timer = ")}]})}})}),ep=N({name:"string/no-unneeded-to-string",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow `String#toString()` when simpler alternatives exist",recommended:"stylistic",requiresTypeChecking:!0},schema:[],messages:{invalid:"Disallow use `.toString()` in string"}},create(e){P(e.sourceCode.parserServices);let{program:t,esTreeNodeToTSNodeMap:r}=e.sourceCode.parserServices,n=t.getTypeChecker();return{CallExpression(t){if("MemberExpression"!==t.callee.type)return;let{object:o,property:a}=t.callee;(R(a,"toString")||F(a,"toString"))&&function(e,t){let r=e.getTypeAtLocation(t);if(r.isStringLiteral()||"string"===e.typeToString(r))return!0;let n=r.getSymbol();return n&&"String"===e.symbolToString(n)}(n,r.get(o))&&e.report({node:a,messageId:"invalid",fix:r=>r.replaceText(t,e.sourceCode.getText(o))})}}}}),ec=N({name:"type/no-force-cast-via-top-type",meta:{type:"problem",docs:{description:"Disallowing cast a type `T` to unrelated or incompatible type `Q` via `T as any as Q`",recommended:"recommended"},schema:[],messages:{invalid:"Don't cast this expression to another type by `as {{type}} as T`"}},create:e=>({TSAsExpression(t){var r,n;if("TSAnyKeyword"!==(r=t.typeAnnotation).type&&"TSUnknownKeyword"!==r.type||!((n=t.parent)&&"TSAsExpression"===n.type&&"TSTypeReference"===n.typeAnnotation.type))return;let o="TSAnyKeyword"===t.typeAnnotation.type?"any":"unknown";e.report({node:t,messageId:"invalid",data:{type:o}})}})});let ed=new o(["BigInt","Boolean","Number","String","Symbol"]);var em=N({name:"type/no-wrapper-type-reference",meta:{type:"problem",fixable:"code",docs:{description:"Disallow wrapper type for type reference",recommended:"recommended"},schema:[],messages:{instead:"Use {{name}} instead"}},create:e=>({TSTypeReference(t){if("Identifier"!==t.typeName.type||!ed.has(t.typeName.name))return;let r=t.typeName.name.toLowerCase();e.report({node:t,messageId:"instead",data:{name:r},fix:e=>e.replaceText(t.typeName,r)})}})}),ef=N({name:"no-default-error",meta:{type:"problem",docs:{description:"Restrict the usage of default (unextended) error",recommended:"strict",requiresTypeChecking:!0},schema:[],messages:{invalid:"Default error object should not be used in this project"}},create(e){P(e.sourceCode.parserServices);let{esTreeNodeToTSNodeMap:t,program:r}=e.sourceCode.parserServices,n=r.getTypeChecker();function o(r){"ErrorConstructor"===function(e,t){let r=e.getTypeAtLocation(t).getSymbol();if(!r?.valueDeclaration)return;let n=e.getTypeOfSymbolAtLocation(r,r.valueDeclaration);return e.typeToString(n)}(n,t.get(r))&&e.report({node:r,messageId:"invalid"})}return{ThrowStatement(e){e.argument&&o(e.argument)},NewExpression:o,CallExpression:o}}});let eg=/\.(?:[cm]?ts|tsx)$/i,ey=/\.d\.(?:[cm]?ts|ts)$/i,eh=new i;var ex=N({name:"require-project-reference",meta:{type:"problem",docs:{description:"Require project references for local package imports",requiresTypeChecking:!0},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string"},uniqueItems:!0}},additionalProperties:!1}],messages:{missingReference:"This local package is not covered by a project reference. Add its project to this tsconfig.json references and enable declarationMap."},defaultOptions:[{ignore:[]}]},create(e,[{ignore:t}]){P(e.sourceCode.parserServices);let{esTreeNodeToTSNodeMap:r,program:n}=e.sourceCode.parserServices;return{ImportDeclaration(o){var a,i,s,l,u;if(!(!(a=o.source.value).startsWith(".")&&!a.startsWith("/")&&!a.startsWith("node:"))||t.some(e=>o.source.value.startsWith(e)))return;let p=r.get(o.source),c=n.getResolvedModuleFromModuleSpecifier(p)?.resolvedModule;if(!c)return;let d=eb(c.resolvedFileName);if(!d.split(/[\\/]/).includes("node_modules")){if(i=n,s=d,!eE(i).rootFiles.has(s)){if(ey.test(d)){let e,t=(l=n,u=c.resolvedFileName,(e=function(e){return e}(l)).getRedirectFromOutput(e.getCanonicalFileName(u)));if(t&&eg.test(t.source)&&ev(n,eb(t.source)))return}else if(!eg.test(d))return;else if(ev(n,d))return;e.report({node:o.source,messageId:"missingReference"})}}}}}});function eb(e){try{return v.realpathSync.native(e)}catch{return e}}function ev(e,t){return eE(e).projectReferenceFiles.has(t)}function eE(e){let t=eh.get(e);if(t)return t;let r={rootFiles:new o(e.getRootFileNames().map(eb)),projectReferenceFiles:new o(e.getResolvedProjectReferences()?.flatMap(e=>e?.commandLine.fileNames.map(eb)??[])??[])};return eh.set(e,r),r}let eS={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportExpression:["source"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};for(let e of Object.keys(eS))Object.freeze(eS[e]);Object.freeze(eS);let eT=new o(["parent","leadingComments","trailingComments"]);function eC(e){return!eT.has(e)&&"_"!==e[0]}function eD(e,t){let r="",n=e;for("string"==typeof t?r=t:(r=t.name,n=function(e,t){let r=t.range[0],n=e,o=!1;do for(let e of(o=!1,n.childScopes)){let t=e.block.range;if(t[0]<=r&&r<t[1]){n=e,o=!0;break}}while(o);return n}(n,t));null!=n;){let e=n.set.get(r);if(null!=e)return e;n=n.upper}return null}function ew(e,t){return"Punctuator"===e.type&&e.value===t}function eA(e){return ew(e,"=>")}function ek(e){return ew(e,",")}function eI(e){return ew(e,";")}function ej(e){return ew(e,":")}function eR(e){return ew(e,"(")}function eF(e){return ew(e,")")}function eB(e){return ew(e,"{")}function eL(e){return["Block","Line","Shebang"].includes(e.type)}let eN=e=>!eI(e);function eP(e,t){let r=e.parent,n=null,o=null;if("ArrowFunctionExpression"===e.type){let r=t.getTokenBefore(e.body,eA);n=r.loc.start,o=r.loc.end}else{var a,i;n=r&&("Property"===r.type||"MethodDefinition"===r.type||"PropertyDefinition"===r.type)?r.loc.start:e.loc.start,o=(a=e,i=t,a.id?i.getTokenAfter(a.id,eR):i.getFirstToken(a,eR)).loc.start}return{start:{...n},end:{...o}}}let eM="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},e$=Object.freeze(new o(["Array","ArrayBuffer","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","Float32Array","Float64Array","Function","Infinity","Int16Array","Int32Array","Int8Array","isFinite","isNaN","isPrototypeOf","JSON","Map","Math","NaN","Number","Object","parseFloat","parseInt","Promise","Proxy","Reflect","RegExp","Set","String","Symbol","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","undefined","unescape","WeakMap","WeakSet"])),eO=new o([Array.isArray,Array.of,Array.prototype.at,Array.prototype.concat,Array.prototype.entries,Array.prototype.every,Array.prototype.filter,Array.prototype.find,Array.prototype.findIndex,Array.prototype.flat,Array.prototype.includes,Array.prototype.indexOf,Array.prototype.join,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.slice,Array.prototype.some,Array.prototype.toString,Array.prototype.values,"function"==typeof BigInt?BigInt:void 0,Boolean,Date,Date.parse,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,escape,isFinite,isNaN,isPrototypeOf,Map,Map.prototype.entries,Map.prototype.get,Map.prototype.has,Map.prototype.keys,Map.prototype.values,...Object.getOwnPropertyNames(Math).filter(e=>"random"!==e).map(e=>Math[e]).filter(e=>"function"==typeof e),Number,Number.isFinite,Number.isNaN,Number.parseFloat,Number.parseInt,Number.prototype.toExponential,Number.prototype.toFixed,Number.prototype.toPrecision,Number.prototype.toString,Object,Object.entries,Object.is,Object.isExtensible,Object.isFrozen,Object.isSealed,Object.keys,Object.values,parseFloat,parseInt,RegExp,Set,Set.prototype.entries,Set.prototype.has,Set.prototype.keys,Set.prototype.values,String,String.fromCharCode,String.fromCodePoint,String.raw,String.prototype.at,String.prototype.charAt,String.prototype.charCodeAt,String.prototype.codePointAt,String.prototype.concat,String.prototype.endsWith,String.prototype.includes,String.prototype.indexOf,String.prototype.lastIndexOf,String.prototype.normalize,String.prototype.padEnd,String.prototype.padStart,String.prototype.slice,String.prototype.startsWith,String.prototype.substr,String.prototype.substring,String.prototype.toLowerCase,String.prototype.toString,String.prototype.toUpperCase,String.prototype.trim,String.prototype.trimEnd,String.prototype.trimLeft,String.prototype.trimRight,String.prototype.trimStart,Symbol.for,Symbol.keyFor,unescape].filter(e=>"function"==typeof e)),eU=new o([Object.freeze,Object.preventExtensions,Object.seal]),eq=[[Map,new o(["size"])],[RegExp,new o(["dotAll","flags","global","hasIndices","ignoreCase","multiline","source","sticky","unicode"])],[Set,new o(["size"])]];function eW(e,t){let r=[];for(let n=0;n<e.length;++n){let o=e[n];if(null==o)r.length=n+1;else if("SpreadElement"===o.type){let e=ez(o.argument,t);if(null==e)return null;r.push(...e.value)}else{let e=ez(o,t);if(null==e)return null;r.push(e.value)}}return r}let eV=Object.freeze({ArrayExpression(e,t){let r=eW(e.elements,t);return null!=r?{value:r}:null},AssignmentExpression:(e,t)=>"="===e.operator?ez(e.right,t):null,BinaryExpression(e,t){if("in"===e.operator||"instanceof"===e.operator)return null;let r=ez(e.left,t),n=ez(e.right,t);if(null!=r&&null!=n)switch(e.operator){case"==":return{value:r.value==n.value};case"!=":return{value:r.value!=n.value};case"===":return{value:r.value===n.value};case"!==":return{value:r.value!==n.value};case"<":return{value:r.value<n.value};case"<=":return{value:r.value<=n.value};case">":return{value:r.value>n.value};case">=":return{value:r.value>=n.value};case"<<":return{value:r.value<<n.value};case">>":return{value:r.value>>n.value};case">>>":return{value:r.value>>>n.value};case"+":return{value:r.value+n.value};case"-":return{value:r.value-n.value};case"*":return{value:r.value*n.value};case"/":return{value:r.value/n.value};case"%":return{value:r.value%n.value};case"**":return{value:r.value**n.value};case"|":return{value:r.value|n.value};case"^":return{value:r.value^n.value};case"&":return{value:r.value&n.value}}return null},CallExpression(e,t){let r=e.callee,n=eW(e.arguments,t);if(null!=n)if("MemberExpression"===r.type){if("PrivateIdentifier"===r.property.type)return null;let o=ez(r.object,t);if(null!=o){if(null==o.value&&(o.optional||e.optional))return{value:void 0,optional:!0};let a=e_(r,t);if(null!=a){let e=o.value,t=a.value;if(eO.has(e[t]))return{value:e[t](...n)};if(eU.has(e[t]))return{value:n[0]}}}}else{let o=ez(r,t);if(null!=o){if(null==o.value&&e.optional)return{value:void 0,optional:!0};let t=o.value;if(eO.has(t))return{value:t(...n)};if(eU.has(t))return{value:n[0]}}}return null},ConditionalExpression(e,t){let r=ez(e.test,t);return null!=r?r.value?ez(e.consequent,t):ez(e.alternate,t):null},ExpressionStatement:(e,t)=>ez(e.expression,t),Identifier(e,t){if(null!=t){let r=eD(t,e);if(null!=r){if(null!=r&&0===r.defs.length&&e$.has(r.name)&&r.name in eM)return{value:eM[r.name]};if(function(e){let t,r,n;if(1!==e.defs.length)return!1;let o=e.defs[0];return!!(o.parent&&"Variable"===o.type&&("const"===o.parent.kind||(r=(t=e.references).filter(e=>e.init).length,n=t.filter(e=>e.isReadOnly()).length,1===r&&n+r===t.length)))}(r)){let e=r.defs[0];if("Identifier"===e.node.id.type){let n=ez(e.node.init,t);return n&&"object"==typeof n.value&&null!==n.value&&function(e,t){for(let r of e.references){let e=r.identifier;for(;e&&e.parent&&"MemberExpression"===e.parent.type;)e=e.parent;if(e&&e.parent&&("AssignmentExpression"===e.parent.type&&e.parent.left===e||"UpdateExpression"===e.parent.type&&e.parent.argument===e||"CallExpression"===e.parent.type&&e.parent.callee===e&&"MemberExpression"===e.type&&function(e){if(null==e||null==e.value)return!1;let t=e.value;return"copyWithin"===t||"fill"===t||"pop"===t||"push"===t||"reverse"===t||"shift"===t||"sort"===t||"splice"===t||"unshift"===t}(e_(e,t))))return!0}return!1}(r,t)?null:n}}}}return null},Literal:e=>(null!=e.regex||null!=e.bigint)&&null==e.value?null:{value:e.value},LogicalExpression(e,t){let r=ez(e.left,t);if(null!=r){if("||"===e.operator&&!0==!!r.value||"&&"===e.operator&&!1==!!r.value||"??"===e.operator&&null!=r.value)return r;let n=ez(e.right,t);if(null!=n)return n}return null},MemberExpression(e,t){if("PrivateIdentifier"===e.property.type)return null;let r=ez(e.object,t);if(null!=r){if(null==r.value&&(r.optional||e.optional))return{value:void 0,optional:!0};let n=e_(e,t);if(null!=n){let e;if(null==(e=function(e,t){let r=e;for(;("object"==typeof r||"function"==typeof r)&&null!==r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=Object.getPrototypeOf(r)}return null}(r.value,n.value))||null==e.get)return{value:r.value[n.value]};for(let[e,t]of eq)if(r.value instanceof e&&t.has(n.value))return{value:r.value[n.value]}}}return null},ChainExpression(e,t){let r=ez(e.expression,t);return null!=r?{value:r.value}:null},NewExpression(e,t){let r=ez(e.callee,t),n=eW(e.arguments,t);if(null!=r&&null!=n){let e=r.value;if(eO.has(e))return{value:new e(...n)}}return null},ObjectExpression(e,t){let r={};for(let n of e.properties)if("Property"===n.type){if("init"!==n.kind)return null;let e=e_(n,t),o=ez(n.value,t);if(null==e||null==o)return null;r[e.value]=o.value}else{if("SpreadElement"!==n.type&&"ExperimentalSpreadProperty"!==n.type)return null;let e=ez(n.argument,t);if(null==e)return null;Object.assign(r,e.value)}return{value:r}},SequenceExpression:(e,t)=>ez(e.expressions[e.expressions.length-1],t),TaggedTemplateExpression(e,t){let r=ez(e.tag,t),n=eW(e.quasi.expressions,t);if(null!=r&&null!=n){let t=r.value,o=e.quasi.quasis.map(e=>e.value.cooked);if(o.raw=e.quasi.quasis.map(e=>e.value.raw),t===String.raw)return{value:t(o,...n)}}return null},TemplateLiteral(e,t){let r=eW(e.expressions,t);if(null!=r){let t=e.quasis[0].value.cooked;for(let n=0;n<r.length;++n)t+=r[n],t+=e.quasis[n+1].value.cooked;return{value:t}}return null},UnaryExpression(e,t){if("delete"===e.operator)return null;if("void"===e.operator)return{value:void 0};let r=ez(e.argument,t);if(null!=r)switch(e.operator){case"-":return{value:-r.value};case"+":return{value:+r.value};case"!":return{value:!r.value};case"~":return{value:~r.value};case"typeof":return{value:typeof r.value}}return null},TSAsExpression:(e,t)=>ez(e.expression,t),TSSatisfiesExpression:(e,t)=>ez(e.expression,t),TSTypeAssertion:(e,t)=>ez(e.expression,t),TSNonNullExpression:(e,t)=>ez(e.expression,t),TSInstantiationExpression:(e,t)=>ez(e.expression,t)});function ez(e,t){return null!=e&&Object.hasOwnProperty.call(eV,e.type)?eV[e.type](e,t):null}function e_(e,t){let r="Property"===e.type?e.key:e.property;return e.computed?ez(r,t):"Identifier"===r.type?{value:r.name}:"Literal"===r.type?r.bigint?{value:r.bigint}:{value:String(r.value)}:null}function eJ(e,t=null){try{return ez(e,t)}catch(e){return null}}function eH(e,t=null){if(e&&"Literal"===e.type&&null===e.value){if(e.regex)return`/${e.regex.pattern}/${e.regex.flags}`;if(e.bigint)return e.bigint}let r=eJ(e,t);if(r)try{return String(r.value)}catch{}return null}function eK(e,t){switch(e.type){case"MemberExpression":if(e.computed)return eH(e.property,t);if("PrivateIdentifier"===e.property.type)break;return e.property.name;case"Property":case"MethodDefinition":case"PropertyDefinition":if(e.computed)return eH(e.key,t);if("Literal"===e.key.type)return String(e.key.value);if("PrivateIdentifier"===e.key.type)break;return e.key.name}return null}function eG(e,t){let r=e.parent;if(!r)return"";let n=[],o="Property"===r.type&&r.value===e,a="MethodDefinition"===r.type&&r.value===e,i="PropertyDefinition"===r.type&&r.value===e;if((a||i)&&(r.static&&n.push("static"),"PrivateIdentifier"===r.key.type&&n.push("private")),e.async&&n.push("async"),e.generator&&n.push("generator"),o||a){if("constructor"===r.kind)return"constructor";"get"===r.kind?n.push("getter"):"set"===r.kind?n.push("setter"):n.push("method")}else i?n.push("method"):("ArrowFunctionExpression"===e.type&&n.push("arrow"),n.push("function"));if(o||a||i)if("PrivateIdentifier"===r.key.type)n.push(`#${r.key.name}`);else{let e=eK(r);if(e)n.push(`'${e}'`);else if(t){let e=t.getText(r.key);e.includes("\n")||n.push(`[${e}]`)}}else e.id?n.push(`'${e.id.name}'`):"VariableDeclarator"===r.type&&r.id&&"Identifier"===r.id.type?n.push(`'${r.id.name}'`):("AssignmentExpression"===r.type||"AssignmentPattern"===r.type)&&r.left&&"Identifier"===r.left.type?n.push(`'${r.left.name}'`):"ExportDefaultDeclaration"===r.type&&r.declaration===e&&n.push("'default'");return n.join(" ")}let eX=Object.freeze(new o(["==","!=","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","|","^","&","in"])),eY=Object.freeze(new o(["-","+","!","~"]));function eZ(e){return null!==e&&"object"==typeof e&&"string"==typeof e.type}let eQ=Object.freeze(Object.assign(Object.create(null),{$visit(e,t,r){let{type:n}=e;return"function"==typeof this[n]?this[n](e,t,r):this.$visitChildren(e,t,r)},$visitChildren(e,t,r){let{type:n}=e;for(let o of r[n]||Object.keys(e).filter(eC)){let n=e[o];if(Array.isArray(n)){for(let e of n)if(eZ(e)&&this.$visit(e,t,r))return!0}else if(eZ(n)&&this.$visit(n,t,r))return!0}return!1},ArrowFunctionExpression:()=>!1,AssignmentExpression:()=>!0,AwaitExpression:()=>!0,BinaryExpression(e,t,r){return!!(t.considerImplicitTypeConversion&&eX.has(e.operator))&&("Literal"!==e.left.type||"Literal"!==e.right.type)||this.$visitChildren(e,t,r)},CallExpression:()=>!0,FunctionExpression:()=>!1,ImportExpression:()=>!0,MemberExpression(e,t,r){return!!t.considerGetters||!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.property.type||this.$visitChildren(e,t,r)},MethodDefinition(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},NewExpression:()=>!0,Property(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},PropertyDefinition(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},UnaryExpression(e,t,r){return!!("delete"===e.operator||t.considerImplicitTypeConversion&&eY.has(e.operator)&&"Literal"!==e.argument.type)||this.$visitChildren(e,t,r)},UpdateExpression:()=>!0,YieldExpression:()=>!0}));function e0(e,t,r={}){let{considerGetters:n=!1,considerImplicitTypeConversion:o=!1}=r;return eQ.$visit(e,{considerGetters:n,considerImplicitTypeConversion:o},t.visitorKeys||eS)}function e1(e,t,r){let n,o,a,i,s;if("number"==typeof e){if(n=0|e,o=t,a=r,!(n>=1))throw TypeError("'times' should be a positive integer.")}else n=1,o=e,a=t;if(null==o||null==o.parent||"CatchClause"===o.parent.type&&o.parent.param===o)return!1;i=s=o;do i=a.getTokenBefore(i),s=a.getTokenAfter(s);while(null!=i&&null!=s&&eR(i)&&eF(s)&&i!==function(e,t){let r=e.parent;if(!r)return null;switch(r.type){case"CallExpression":case"NewExpression":if(1===r.arguments.length&&r.arguments[0]===e)return t.getTokenAfter(r.typeArguments||r.typeParameters||r.callee,eR);return null;case"DoWhileStatement":if(r.test===e)return t.getTokenAfter(r.body,eR);return null;case"IfStatement":case"WhileStatement":if(r.test===e)return t.getFirstToken(r,1);return null;case"ImportExpression":if(r.source===e)return t.getFirstToken(r,1);return null;case"SwitchStatement":if(r.discriminant===e)return t.getFirstToken(r,1);return null;case"WithStatement":if(r.object===e)return t.getFirstToken(r,1);return null;default:return null}}(o,a)&&--n>0);return 0===n}let e2=/^(?:Import|Export(?:All|Default|Named))Declaration$/u,e3=Function.call.bind(Object.hasOwnProperty),e5=Symbol("read"),e8=Symbol("call"),e9=Symbol("construct"),e6=Symbol("esm"),e4={require:{[e8]:!0}};function e7(e){return null==e||0!==e.defs.length||e.references.some(e=>e.isWrite())}class te{constructor(e,t={}){let{mode:r="strict",globalObjectNames:n=["global","globalThis","self","window"]}=t;this.variableStack=[],this.globalScope=e,this.mode=r,this.globalObjectNames=n.slice(0)}*iterateGlobalReferences(e){for(let t of Object.keys(e)){let r=e[t],n=[t],o=this.globalScope.set.get(t);e7(o)||(yield*this._iterateVariableReferences(o,n,r,!0))}for(let t of this.globalObjectNames){let r=[],n=this.globalScope.set.get(t);e7(n)||(yield*this._iterateVariableReferences(n,r,e,!1))}}*iterateCjsReferences(e){for(let{node:t}of this.iterateGlobalReferences(e4)){let r=eH(t.arguments[0]);if(null==r||!e3(e,r))continue;let n=e[r],o=[r];n[e5]&&(yield{node:t,path:o,type:e5,info:n[e5]}),yield*this._iteratePropertyReferences(t,o,n)}}*iterateEsmReferences(e){for(let t of this.globalScope.block.body){if(!e2.test(t.type)||null==t.source)continue;let r=t.source.value;if(!e3(e,r))continue;let n=e[r],o=[r];if(n[e5]&&(yield{node:t,path:o,type:e5,info:n[e5]}),"ExportAllDeclaration"===t.type)for(let e of Object.keys(n)){let r=n[e];r[e5]&&(yield{node:t,path:o.concat(e),type:e5,info:r[e5]})}else for(let e of t.specifiers){let t=e3(n,e6),r=this._iterateImportReferences(e,o,t?n:"legacy"===this.mode?{default:n,...n}:{default:n});if(t)yield*r;else for(let e of r)e.path=e.path.filter(tt),(e.path.length>=2||e.type!==e5)&&(yield e)}}}*iteratePropertyReferences(e,t){yield*this._iteratePropertyReferences(e,[],t)}*_iterateVariableReferences(e,t,r,n){if(!this.variableStack.includes(e)){this.variableStack.push(e);try{for(let o of e.references){if(!o.isRead())continue;let e=o.identifier;n&&r[e5]&&(yield{node:e,path:t,type:e5,info:r[e5]}),yield*this._iteratePropertyReferences(e,t,r)}}finally{this.variableStack.pop()}}}*_iteratePropertyReferences(e,t,r){let n=e;for(;function(e){let t=e.parent;if(t)switch(t.type){case"ConditionalExpression":return t.consequent===e||t.alternate===e;case"LogicalExpression":case"ChainExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":case"TSInstantiationExpression":return!0;case"SequenceExpression":return t.expressions[t.expressions.length-1]===e}return!1}(n);)n=n.parent;let o=n.parent;if(o){if("MemberExpression"===o.type){if(o.object===n){let e=eK(o);if(null==e||!e3(r,e))return;t=t.concat(e);let n=r[e];n[e5]&&(yield{node:o,path:t,type:e5,info:n[e5]}),yield*this._iteratePropertyReferences(o,t,n)}return}if("CallExpression"===o.type){o.callee===n&&r[e8]&&(yield{node:o,path:t,type:e8,info:r[e8]});return}if("NewExpression"===o.type){o.callee===n&&r[e9]&&(yield{node:o,path:t,type:e9,info:r[e9]});return}if("AssignmentExpression"===o.type){o.right===n&&(yield*this._iterateLhsReferences(o.left,t,r),yield*this._iteratePropertyReferences(o,t,r));return}if("AssignmentPattern"===o.type){o.right===n&&(yield*this._iterateLhsReferences(o.left,t,r));return}"VariableDeclarator"===o.type&&o.init===n&&(yield*this._iterateLhsReferences(o.id,t,r))}}*_iterateLhsReferences(e,t,r){if("Identifier"===e.type){let n=eD(this.globalScope,e);null!=n&&(yield*this._iterateVariableReferences(n,t,r,!1));return}if("ObjectPattern"===e.type){for(let n of e.properties){let e=eK(n);if(null==e||!e3(r,e))continue;let o=t.concat(e),a=r[e];a[e5]&&(yield{node:n,path:o,type:e5,info:a[e5]}),yield*this._iterateLhsReferences(n.value,o,a)}return}"AssignmentPattern"===e.type&&(yield*this._iterateLhsReferences(e.left,t,r))}*_iterateImportReferences(e,t,r){let n=e.type;if("ImportSpecifier"===n||"ImportDefaultSpecifier"===n){let o="ImportDefaultSpecifier"===n?"default":"Identifier"===e.imported.type?e.imported.name:e.imported.value;if(!e3(r,o))return;t=t.concat(o);let a=r[o];a[e5]&&(yield{node:e,path:t,type:e5,info:a[e5]}),yield*this._iterateVariableReferences(eD(this.globalScope,e.local),t,a,!1);return}if("ImportNamespaceSpecifier"===n)return void(yield*this._iterateVariableReferences(eD(this.globalScope,e.local),t,r,!1));if("ExportSpecifier"===n){let n="Identifier"===e.local.type?e.local.name:e.local.value;if(!e3(r,n))return;t=t.concat(n);let o=r[n];o[e5]&&(yield{node:e,path:t,type:e5,info:o[e5]})}}}function tt(e,t){return 1!==t||"default"!==e}te.READ=e5,te.CALL=e8,te.CONSTRUCT=e9,te.ESM=e6;let tr=Symbol("SYNTAX_OPENING_PARENTHESIS_INITIAL_VALUE");function*tn(e,t){if(!e||!e.parent||"CatchClause"===e.parent.type&&e.parent.param===e)return;let r=tr,n=[e,e];for(;n=function([e,t],r){let n=r.sourceCode.getTokenBefore(e);if(!n||!eR(n))return;let o=r.sourceCode.getTokenAfter(t);if(o&&eF(o))return[n,o]}(n,t);){let[o]=n;if(r===tr&&(r=function(e,t){let{parent:r}=e;switch(r.type){case"CallExpression":case"NewExpression":if(1===r.arguments.length&&r.arguments[0]===e)return t.sourceCode.getTokenAfter(r.typeArguments??r.callee,eR);return;case"DoWhileStatement":if(r.test===e)return t.sourceCode.getTokenAfter(r.body,eR);return;case"IfStatement":case"WhileStatement":if(r.test===e)return t.sourceCode.getFirstToken(r,1);return;case"ImportExpression":if(r.source===e)return t.sourceCode.getFirstToken(r,1);return;case"SwitchStatement":case"WithStatement":return t.sourceCode.getFirstToken(r,1)}}(e,t)),o===r)break;yield n}}let to=new i;function ta(e,t){if(!e||!to.has(e)){let r=[];for(let[n,o]of tn(e,t))r.unshift(n),r.push(o);to.set(e,r)}return to.get(e)}function ti(e,t){let r=ta(e,t),[n]=t.sourceCode.getRange(r[0]??e),[,o]=t.sourceCode.getRange(r.at(-1)??e);return[n,o]}function ts(e,t){let[r,n]=ti(e,t);return t.sourceCode.text.slice(r,n)}function tl(e,t){if(to.has(e))return to.get(e).length>0;let r=tn(e,t).next().done;return r&&to.set(e,[]),!r}function tu(e,t){return e?.type==="Literal"&&e.value===t}let tp=e=>e?.type==="Literal"&&"string"==typeof e.value,tc=(e,t)=>e?.type==="Literal"&&"boolean"==typeof e.value&&(void 0===t||e.value===t),td=e=>tp(e)?e.value:e?.type==="TemplateLiteral"&&0===e.expressions.length?e.quasis[0].value.cooked:void 0,tm=e=>"Literal"===e.type&&"number"==typeof e.value,tf=e=>"Literal"===e.type&&!!e.regex,tg=e=>e?.type==="Literal"&&"null"===e.raw,ty=e=>"Literal"===e.type&&!!e.bigint;function th(e,t,r){return t?"Identifier"===e.type&&e.name===t:!Array.isArray(r)||0===r.length||"Identifier"===e.type&&r.includes(e.name)}let tx={},tb=["CallExpression"],tv=["NewExpression"],tE=["CallExpression","NewExpression"];function tS(e,t,r){if(!r.includes(e?.type))return!1;"string"==typeof t?t={names:[t]}:Array.isArray(t)&&(t={names:t});let{name:n,names:o,argumentsLength:a,minimumArguments:i=0,maximumArguments:s=1/0,allowSpreadElement:l=!1,optional:u}=t??tx;if(!0===u&&e.optional!==u||!1===u&&e.optional||"number"==typeof a&&e.arguments.length!==a||0!==i&&e.arguments.length<i||Number.isFinite(s)&&e.arguments.length>s)return!1;if(!l){let t=Number.isFinite(s)?s:a;if("number"==typeof t&&e.arguments.some((e,r)=>"SpreadElement"===e.type&&r<t))return!1}return th(e.callee,n,o)}let tT=(e,t)=>{if("boolean"==typeof t?.optional)throw TypeError("Cannot check node.optional in `isNewExpression`.");return tS(e,t,tv)},tC=e=>"ExpressionStatement"===e.type&&"string"==typeof e.directive;function tD(e,t){let{type:r}=e;return"BlockStatement"===r?e.body.every(e=>tD(e,t)):"EmptyStatement"===r||!!t?.(e)}let tw=e=>"ArrayExpression"===e.type&&0===e.elements.length,tA=e=>"ObjectExpression"===e.type&&0===e.properties.length;function tk(e){return"ExpressionStatement"===e.type||"ChainExpression"===e.type&&"ExpressionStatement"===e.parent.type}let tI=["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"];function tj(e){return tI.includes(e.type)}let tR=["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"];function tF(e){return tR.includes(e.type)}let tB={};function tL(e,t){if(e?.type!=="MemberExpression")return!1;"string"==typeof t?t={properties:[t]}:Array.isArray(t)&&(t={properties:t});let{property:r,properties:n,object:o,objects:a,optional:i,computed:s}=t??tB;if(!0===i&&e.optional!==i||!1===i&&e.optional)return!1;if(r||Array.isArray(n)&&n.length>0){if(!th(e.property,r,n))return!1;s??=!1}return(!0!==s||e.computed===s)&&(!1!==s||!e.computed)&&th(e.object,o,a)}let tN={};function tP(e,t){return e?.type==="CallExpression"&&"MemberExpression"===e.callee.type&&("string"==typeof t?t={methods:[t]}:Array.isArray(t)&&(t={methods:t}),t??=tN,!!th(e.callee.property,t.method,t.methods))&&tS(e,{argumentsLength:t.argumentsLength,minimumArguments:t.minimumArguments,maximumArguments:t.maximumArguments,allowSpreadElement:t.allowSpreadElement,optional:t.optionalCall},tb)&&tL(e.callee,{object:t.object,objects:t.objects,computed:t.computed,property:t.method,properties:t.methods,optional:t.optionalMember})}function tM(e){return e?.type==="UnaryExpression"&&"-"===e.operator&&tm(e.argument)&&1===e.argument.value}function t$(e,t=[]){if("Identifier"!==e.type)return!1;let r=Array.isArray(t)?t:[t];return(!(r.length>0)||!!r.includes(e.name))&&!function(e){let{parent:t}=e;switch(t.type){case"MemberExpression":return!t.computed&&t.property===e;case"FunctionDeclaration":case"FunctionExpression":return t.params.includes(e)||t.id===e;case"ArrowFunctionExpression":return t.params.includes(e);case"ClassDeclaration":case"ClassExpression":case"VariableDeclarator":case"TSDeclareFunction":case"TSEnumMember":case"TSTypeAliasDeclaration":return t.id===e;case"PropertyDefinition":case"MethodDefinition":return!t.computed&&t.key===e;case"Property":return!t.computed&&t.key===e&&("ObjectExpression"===t.parent.type||"ObjectPattern"===t.parent.type)&&t.parent.properties.includes(t)||t.value===e&&"ObjectPattern"===t.parent.type&&t.parent.properties.includes(t);case"ArrayPattern":return t.elements.includes(e);case"LabeledStatement":case"ContinueStatement":case"BreakStatement":return t.label===e;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":return t.local===e;case"ExportAllDeclaration":return t.exported===e;case"ImportSpecifier":return t.local===e||t.imported===e;case"ExportSpecifier":return t.local===e||t.exported===e;case"TSIndexSignature":return t.parameters.includes(e);case"TSTypeParameter":return t.name===e;case"TSMappedType":case"TSPropertySignature":return t.key===e}return!1}(e)}let tO=e=>tS(e,{name:"require",argumentsLength:1,optional:!1},tb)&&tp(e.arguments[0]);function tU(e,t){let r=t.trim().split(".");for(let t=r.length-1;t>0;t--){let n=r[t];if(!n)return!1;if(1===t&&"MetaProperty"===e.type&&"Identifier"===e.property.type&&e.property.name===n){e=e.meta;continue}if("MemberExpression"===e.type&&!e.optional&&!e.computed&&"Identifier"===e.property.type&&e.property.name===n){e=e.object;continue}return!1}let[n]=r;return"Identifier"===e.type&&e.name===n||"this"===n&&"ThisExpression"===e.type||"super"===n&&"Super"===e.type}function tq(e,t){return t.some(t=>tU(e,t))}function tW(e,t){return"TemplateLiteral"===e.type&&"TaggedTemplateExpression"===e.parent.type&&e.parent.quasi===e&&(!t||tq(e.parent.tag,t))}let tV=e=>e?.type==="Identifier"&&"undefined"===e.name,tz=e=>tV(e)||e?.type==="UnaryExpression"&&"void"===e.operator,t_=(e,t)=>(function(e,t){let{object:r,property:n,properties:o}={property:"",properties:[],...t};if(!tL(e,{property:n,properties:o,optional:!1}))return;let a=e.object;return tL(a,{object:r,property:"prototype",optional:!1})||"Array"===r&&tw(a)})(e,{...t,object:"Array"}),tJ=e=>e?.type==="LogicalExpression"&&("&&"===e.operator||"||"===e.operator),tH=e=>e?.type==="UnaryExpression"&&"!"===e.operator,tK=e=>tH(e.parent)&&e.parent.argument===e,tG=(e,t)=>tX(e.parent,t)&&e.parent.arguments[0]===e,tX=(e,t)=>e?.type==="CallExpression"&&!e.optional&&"Identifier"===e.callee.type&&"Boolean"===e.callee.name&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type&&((e,t)=>{let{sourceCode:r}=t;if(r.isGlobalReference(e))return!0;let n=eD(r.getScope(e),e);return!n||0===n.defs.length})(e.callee,t),tY=new o(["IfStatement","ConditionalExpression","WhileStatement","DoWhileStatement","ForStatement"]);function tZ(e,t){return!!(tH(e)||tK(e)||tX(e,t)||tG(e,t))||!!tJ(e.parent)&&tZ(e.parent,t)}function tQ(e){let t;return t=e.parent,!!(t?.type==="VExpressionContainer"&&"VAttribute"===t.parent.type&&t.parent.directive&&t.parent.value===t&&"VDirectiveKey"===t.parent.key.type&&"VIdentifier"===t.parent.key.name.type&&["if","else-if","show"].includes(t.parent.key.name.rawName)||tY.has(e.parent.type)&&e.parent.test===e)||!!tJ(e.parent)&&tQ(e.parent)}function t0(e,{test:t,expected:r,ruleId:n}){if(t?.(e)||(r=(r=Array.isArray(r)?r:[r]).map(e=>"string"==typeof e?{value:e}:e),!t&&r.some(t=>Object.entries(t).every(([t,r])=>e[t]===r))))return;let o=`'${JSON.stringify({value:e.value,type:e.type})}'`;r=r.map(e=>`'${JSON.stringify(e)}'`).join(" or ");let a=`\`${n}\`: Unexpected token ${o}`,i=`https://github.com/sindresorhus/eslint-plugin-unicorn/issues/new?title=${encodeURIComponent(a)}`;throw Error(`Expected token ${r}, got ${o}.
2
+ Please open an issue at ${i}.`)}function*t1(e,t){for(let r of t[e.type]??[]){let t=e[r];for(let e of Array.isArray(t)?t:[t])e?.type&&(yield e)}}function t2(e,t){return"AwaitExpression"===e.type||"YieldExpression"===e.type||"ForOfStatement"===e.type&&!!e.await||!tj(e)&&t1(e,t).some(e=>t2(e,t))}let t3={"\n":String.raw`\n`,"\r":String.raw`\r`," ":String.raw`\t`,"\b":String.raw`\b`,"\f":String.raw`\f`,"\v":String.raw`\v`,"\0":String.raw`\u{0}`};function t5(e,t="'"){if("string"!=typeof e)throw TypeError("Unexpected string.");return function(e,t="'"){if("string"!=typeof e)throw TypeError("Expected a string.");if("'"!==t&&'"'!==t)throw TypeError("Expected `quote` to be either `'` or `\"`.");let r=[...e].map(e=>{if("\\"===e)return String.raw`\\`;if(e===t)return`\\${t}`;let r=e.codePointAt(0);return r<=31||127===r||8232===r||8233===r||r>=55296&&r<=57343?t3[e]??String.raw`\u{${r.toString(16)}}`:e}).join("");return`${t}${r}${t}`}(e,t)}let t8=["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","implements","interface","let","package","private","protected","public","static","arguments","eval"],t9=["globalThis","Infinity","NaN","undefined"];function t6({includeGlobalProperties:e=!1}={}){return new o([...t8,...e?t9:[]])}let t4=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*/u,t7=`(?!(?:${[...t6({includeGlobalProperties:!0})].join("|")})(?![$_\\p{ID_Continue}]))`,re=new r;function rt({exact:e=!0,checkReserved:t=!0}={}){let r=`${e}${t}`,n=re.get(r);if(!n){let o=`(?<![@#$_\\p{ID_Continue}\\p{ID_Start}])${t?t7:""}${t4.source}`;n=RegExp(e?`^${o}$`:o,"u"),re.set(r,n)}return n}function rr(e,t){for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}}let rn=new o(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","as","implements","interface","let","package","private","protected","public","static","yield","any","boolean","constructor","declare","get","module","require","number","set","string","symbol","type","from","of"]),ro=rt(),ra=e=>"string"==typeof e&&ro.test(e)&&!rn.has(e),ri=(e,t)=>t.every(t=>!(rr(e,t)||t.through.some(({identifier:t,resolved:r})=>t?.name===e&&!r))),rs=()=>!0;function rl(e,t,r=rs){if(ra(e)||ra(e+="_")){for(;!ri(e,t)||!r(e,t);)e+="_";return e}}function ru(e,t){if(e.arguments.length>0)return!0;let{sourceCode:r}=t,[n,o]=r.getLastTokens(e,2);return eR(n)&&eF(o)&&r.getRange(e.callee)[1]<r.getRange(e)[1]}function rp(e,t){let{sourceCode:r}=t,n=e.typeArguments??e.callee,o=r.getTokenAfter(n,eR),[a,i]=r.getLastTokens(e,2);return{openingParenthesisToken:o,closingParenthesisToken:i,trailingCommaToken:ek(a)?a:void 0}}function rc(e,t,r=!0){let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a,trailingCommaToken:i}=rp(t,e),[,s]=n.getRange(o),[l]=n.getRange(r?a:i??a);return n.text.slice(s,l)}function rd(e){let t;switch(e?.type){case"MemberExpression":t=e.property;break;case"ChainExpression":return rd(e.expression);case"Property":case"MethodDefinition":t=e.key}if(t){if("Identifier"===t.type&&!e.computed)return t.name;let r=eJ(t);if(!r)return;return String(r.value)}}function rm(e){return["ChainExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?rm(e.expression):e}function rf(e,t){if(e=rm(e),t=rm(t),e.type!==t.type)return!1;switch(e.type){case"Super":case"ThisExpression":return!0;case"Identifier":case"PrivateIdentifier":return e.name===t.name;case"Literal":var r,n;return r=e,n=t,r.regex||n.regex?!!(r.regex&&n.regex&&r.regex.pattern===n.regex.pattern&&r.regex.flags===n.regex.flags):r.bigint||n.bigint?r.bigint===n.bigint:r.value===n.value;case"MemberExpression":{let r=rd(e);if(void 0!==r)return rf(e.object,t.object)&&r===rd(t);return e.computed===t.computed&&rf(e.object,t.object)&&rf(e.property,t.property)}default:return!1}}function rg(e,t){return"Identifier"===e.type&&(t.sourceCode.isGlobalReference(e)||!eD(t.sourceCode.getScope(e),e))}let ry=new o(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),rh=e=>ry.has(e?.type);function rx(e){for(;rh(e);)e=e.expression;return e}let rb=new o(["FunctionExpression","ArrowFunctionExpression","ClassExpression"]),rv=new o(["freeze","preventExtensions","seal"]),rE=new r([["Math",new o(["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"])],["Number",new o(["EPSILON","MAX_SAFE_INTEGER","MAX_VALUE","MIN_SAFE_INTEGER","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"])],["String",new o(["raw"])],["Symbol",new o(["asyncIterator","hasInstance","isConcatSpreadable","iterator","match","matchAll","replace","search","species","split","toPrimitive","toStringTag","unscopables"])]]),rS=(e,t,r=new o)=>{if("CallExpression"!==(e=rx(e)).type)return!1;let n=rx(e.callee),a=rx(n.object);return!e.optional&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type&&"MemberExpression"===n.type&&!n.computed&&!n.optional&&"Identifier"===a.type&&"Object"===a.name&&rg(a,t)&&"Identifier"===n.property.type&&rv.has(n.property.name)&&void 0!==rN(e.arguments[0],t,r)},rT=e=>{for(e=rx(e);"UnaryExpression"===e.type;)e=rx(e.argument);return"ConditionalExpression"===e.type||"LogicalExpression"===e.type},rC=(e,t)=>{if("Identifier"!==e.type||!t)return;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs.length===1?r.defs[0]:void 0;if(n?.type==="Variable"&&n.parent?.kind==="const"&&n.node.id===n.name&&n.node.init)return{variable:r,initializer:n.node.init}},rD=e=>"[object RegExp]"===Object.prototype.toString.call(e),rw=e=>e?.type==="NewExpression"&&"Identifier"===e.callee.type&&"RegExp"===e.callee.name,rA=(e,t)=>{let r=rN(e,t);if(r&&rD(r.value))return r.value;let n=((e,t)=>{if("Identifier"!==e.type)return;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs.length===1?r.defs[0]:void 0;if(!(n?.type!=="Variable"||!n.node.init||n.node.id!==n.name||r.references.some(e=>e.isWrite()&&e.identifier!==n.name)))return{initializer:n.node.init}})(e,t),o=n?.initializer,a=rw(e)?e:rw(o)?o:void 0;if((o?.type!=="Literal"||!o.regex)&&(!a||a.arguments.some(e=>!((e,t)=>{if("SpreadElement"===e.type)return!1;let r=rN(e,t);return!!r&&(rD(r.value)||null===r.value||["bigint","boolean","number","string","undefined"].includes(typeof r.value))})(e,t))))return;let i=eJ(e,t.sourceCode.getScope(e));return i&&rD(i.value)?i.value:void 0},rk=e=>Object.entries(e).filter(([t])=>!["parent","loc","range"].includes(t)&&!("Property"===e.type&&"key"===t&&!e.computed)&&!("MemberExpression"===e.type&&"property"===t&&!e.computed)).flatMap(([,e])=>Array.isArray(e)?e:[e]).filter(e=>e?.type),rI=(e,t,r)=>"Identifier"===e.type?rj(e,t,r):!rb.has(e.type)&&rk(e).some(e=>rI(e,t,r)),rj=(e,t,r=new o)=>{let n=rC(e,t);if(!n)return"Identifier"!==e.type&&rI(e,t,r);if(r.has(n.variable))return!0;r.add(n.variable);let a=!rS(n.initializer,t,r)&&e0(n.initializer,t.sourceCode,{considerGetters:!0})||rI(n.initializer,t,r);return r.delete(n.variable),a},rR=e=>"string"==typeof e||"number"==typeof e,rF=(e,t,r)=>{if("Identifier"===t.type&&!e.computed)return t.name;if("Literal"===t.type&&rR(t.value))return String(t.value);if(!e.computed||!r||"Identifier"===t.type&&!rC(t,r))return;let n=eJ(t,r.sourceCode.getScope(t));if(n&&rR(n.value))return String(n.value)},rB=(e,t,r=new o)=>{if("ChainExpression"===(e=rx(e)).type&&(e=e.expression),rS(e,t,r))return!1;let n=rC(e,t);if(n){if(r.has(n.variable))return!0;r.add(n.variable);let e=rB(n.initializer,t,r);return r.delete(n.variable),e}if("MemberExpression"===e.type){var a;let n,o;return!("MemberExpression"===(n=e).type&&!n.optional&&"Identifier"===n.object.type&&rg(n.object,t)&&rE.get(n.object.name)?.has(n.computed?"Literal"===n.property.type&&"string"==typeof n.property.value&&n.property.value:"Identifier"===n.property.type&&n.property.name))&&(o=rF(a=e,a.property,t),!(!(a.computed&&rB(a.property,t,r))&&((e,t,r,n)=>{let o,a=rC(e,r);if("Literal"===e.type?o=e.value:a?.initializer.type==="Literal"&&(o=a.initializer.value),"string"==typeof o){if("length"===t)return!0;let e=Number(t);return String(e)===t&&Number.isSafeInteger(e)&&e>=0&&e<o.length}if("ArrayExpression"===e.type){if(e.elements.some(e=>e?.type==="SpreadElement"||e&&rB(e,r,n)))return!1;if("length"===t)return!0;let o=Number(t);return String(o)===t&&!!Number.isSafeInteger(o)&&!(o<0)&&!(o>=e.elements.length)&&!!e.elements.at(o)}if("ObjectExpression"===e.type){let o;if(void 0===t||e.properties.some(e=>"Property"!==e.type||e.computed||"__proto__"===e.key.name||"__proto__"===e.key.value||rB(e.value,r,n)))return!1;for(let r of e.properties)rF(r,r.key)===t&&(o=r);return!!(o&&"init"===o.kind&&!o.method)}return!1})(a.object,o,t,r)))}return rk(e).some(e=>rB(e,t,r))},rL=(e,t,r=new o)=>{if("Identifier"===(e=rx(e)).type){let n=eD(t.sourceCode.getScope(e),e),o=n?.defs.length===1?n.defs[0]:void 0;if(o?.type!=="Variable")return!1;if(o.parent?.kind!=="const"||t.sourceCode.getRange(o.node)[1]>t.sourceCode.getRange(e)[0])return!0;if(!o.node.init||r.has(n))return!1;r.add(n);let a=rL(o.node.init,t,r);return r.delete(n),a}if("ConditionalExpression"===e.type){if(rL(e.test,t,r))return!0;let n=rN(e.test,t,r);return void 0!==n?rL(n.value?e.consequent:e.alternate,t,r):rL(e.consequent,t,r)||rL(e.alternate,t,r)}if("LogicalExpression"===e.type){if(rL(e.left,t,r))return!0;let n=rN(e.left,t,r);if(void 0!==n)return("&&"===e.operator?!!n.value:"||"===e.operator?!n.value:null===n.value||void 0===n.value)&&rL(e.right,t,r);return rL(e.right,t,r)}return"SequenceExpression"===e.type?e.expressions.some(e=>rL(e,t,r)):!rb.has(e.type)&&rk(e).some(e=>rL(e,t,r))},rN=(e,t,r=new o)=>{e=rx(e);let{sourceCode:n}=t;if(e0(e,n)&&!rS(e,t,r)||rj(e,t,r))return;let a=eJ(e,n.getScope(e));if(a&&!rB(e,t,r))return a},rP=(e,t)=>{let r=rN(e,t);return void 0===r||rL(e,t)?void 0:r},rM=e=>null===e||"object"!=typeof e&&"function"!=typeof e,r$={value:void 0},rO=(e,t)=>{if(!e)return r$;let r=rN(e,t);if(r&&rM(r.value))return{value:r.value}},rU=(e,t)=>{let{element:r,staticValueResult:n}=e,{element:o,staticValueResult:a}=t;if(n&&a){let e,t;return(e=n.value)===(t=a.value)||"number"==typeof e&&"number"==typeof t&&Number.isNaN(e)&&Number.isNaN(t)}return!!r&&!!o&&"Literal"!==r.type&&"Literal"!==o.type&&rf(r,o)},rq=(e,t)=>{let r=[],n=[];for(let o of e){if(o?.type==="SpreadElement")continue;let e={element:o,staticValueResult:rO(o,t)};r.some(t=>rU(t,e))&&n.push(o),r.push(e)}return n};function rW(e,t){let{sourceCode:r}=t,{start:{line:n,column:o}}=r.getLoc(e);return r.getLines()[n-1].slice(0,o).match(/\s*$/)[0]}let rV=/^(?:( )+|\t+)/,rz="space";function r_(e,t){let n,o,a=new r,i=0;for(let r of e.split(/\n/g)){if(!r)continue;let e=r.match(rV);if(null===e)i=0,n="";else{let r=e[0].length,s=e[1]?rz:"tab";if(t&&s===rz&&1===r)continue;s!==n&&(i=0),n=s;let l=1,u=0,p=r-i;if(i=r,0===p)l=0,u=1;else{let e=Math.abs(p);if(t&&s===rz&&1===e)continue;o=(s===rz?"s":"t")+String(e)}let c=a.get(o);a.set(o,void 0===c?[1,0]:[c[0]+l,c[1]+u])}}return a}function rJ(e){let t;if("string"!=typeof e)throw TypeError("Expected a string");let r=r_(e,!0);0===r.size&&(r=r_(e,!1));let n=function(e){let t,r=0,n=0;for(let[o,[a,i]]of e)(a>r||a===r&&i>n)&&(r=a,n=i,t=o);return t}(r),o=0,a="";if(void 0!==n){var i,s;({type:t,amount:o}={type:"s"===n[0]?rz:"tab",amount:Number(n.slice(1))}),i=t,s=o,a=(i===rz?" ":" ").repeat(s)}return{amount:o,type:t,indent:a}}let rH=new i;function rK(e){let{sourceCode:t}=e,r=rH.get(t);return void 0===r&&(r=(e=>{let{sourceCode:t}=e,r=[...t.lines];for(let e of t.getTokens(t.ast,{includeComments:!0})){let{start:n,end:o}=t.getLoc(e);n.line!==o.line&&r.fill("",n.line,o.line)}let{type:n,indent:o}=rJ(r.join("\n"));return"space"===n?o:" "})(e),rH.set(t,r)),r}let rG=/\r\n|[\n\r\u2028\u2029]/;function rX(e){return e.sourceCode.text.match(rG)?.[0]??"\n"}function rY(e,t){let{sourceCode:r}=t,{line:n}=r.getLoc(e).start;return/^[\t ]*/.exec(r.lines[n-1])[0]}let rZ=/(?<linebreak>\r\n|[\n\r\u2028\u2029])(?<line>[^\n\r\u2028\u2029]*)/g;function rQ(e,t,r){return e.replaceAll(rZ,(e,n,o)=>""===o.trim()?n:o.startsWith(t)?`${n}${r}${o.slice(t.length)}`:`${n}${o}`)}let r0=rt({checkReserved:!1});function r1(e){return r0.test(e)}function r2(e){let{sourceCode:t}=e,r=t.getAllComments?.();return r?.length?r:t.comments??[]}function r3(e,t){let{sourceCode:r}=e,{directives:n}=r.getDisableDirectives();return n.some(({node:e})=>{if(e===t)return!0;let[n,o]=r.getRange(e),[a,i]=r.getRange(t);return n>=a&&o<=i&&""===r.text.slice(a,n).trim()&&""===r.text.slice(o,i).trim()})}let r5=(e,t)=>Array.isArray(t)?t:e.sourceCode.getRange(t),r8=([e,t],[r,n])=>e>=r&&t<=n;function r9(e,t,r=[],{ignoreDirectives:n=!1}={}){let{sourceCode:o}=e,a=r5(e,t),i=r.map(t=>r5(e,t));return r2(e).some(t=>{let r=o.getRange(t);return r8(r,a)&&i.every(e=>!r8(r,e))&&!(n&&r3(e,t))})}let r6=(e,t,r=[])=>r9(e,t,r,{ignoreDirectives:!0});function r4(e,t,r=t.node,n=[]){if(!r9(e,r,n))return t;let o={...t};return delete o.fix,delete o.suggest,o}function r7(e,t,{ignoreDirectives:r=!1}={}){let{sourceCode:n}=e,o=n.getLoc(t).end.line;return n.getCommentsAfter(t).findLast(t=>n.getLoc(t).start.line===o&&!(r&&r3(e,t)))}let ne=(e,t)=>r9(e,t),nt=new o(["ClassDeclaration","FunctionDeclaration","TSDeclareFunction","TSEnumDeclaration","TSImportEqualsDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSTypeAliasDeclaration"]),nr=e=>"VariableDeclaration"===e.type&&"var"!==e.kind||nt.has(e.type),nn=e=>nr(e)||"BlockStatement"===e.type&&e.body.some(e=>nr(e)),no=(e,t)=>{let{sourceCode:r}=t;return r.getTokens(e).some(e=>r.getLoc(e).start.line!==r.getLoc(e).end.line)};function na(e,t){if("Identifier"!==e.type)return;let r=eD(t.sourceCode.getScope(e),e);if(!r||1!==r.defs.length)return;let[n]=r.defs;if("Variable"===n.type&&"VariableDeclarator"===n.node.type&&"VariableDeclaration"===n.parent.type&&"const"===n.parent.kind)return n.node.init}function ni(e,t){let{sourceCode:r}=t,[,n]=ti(e.object,t);return[n,e.computed?r.getRange(r.getTokenBefore(e.property,e=>"["===e.value))[1]:r.getRange(e.property)[0]]}let ns=e=>("AssignmentExpression"===e.parent.type||"AssignmentPattern"===e.parent.type)&&e.parent.left===e||"UpdateExpression"===e.parent.type&&e.parent.argument===e||"ArrayPattern"===e.parent.type&&e.parent.elements.includes(e)||"RestElement"===e.parent.type&&e.parent.argument===e||("ForOfStatement"===e.parent.type||"ForInStatement"===e.parent.type)&&e.parent.left===e||"Property"===e.parent.type&&e.parent.value===e&&"ObjectPattern"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent)||"UnaryExpression"===e.parent.type&&"delete"===e.parent.operator&&e.parent.argument===e,nl=e=>e?.type==="MemberExpression"||e?.type==="CallExpression";function nu(e){return(e=rx(e),e?.type==="ChainExpression")?nu(e.expression):!!nl(e)&&(!!e.optional||("MemberExpression"===e.type?nu(e.object):nu(e.callee)))}let np=new o(["depth","height","width"]),nc=new o(["AccessorProperty","MethodDefinition","PropertyDefinition","StaticBlock","TSAbstractAccessorProperty","TSAbstractMethodDefinition","TSAbstractPropertyDefinition"]);function nd(e){return tL(e,{properties:["length","size"],optional:!1})}let nm=(e,t)=>e?.type==="ObjectExpression"&&e.properties.every(e=>"SpreadElement"!==e.type)&&e.properties.some(e=>"Property"===e.type&&["get","set"].includes(eK(e,t.sourceCode.getScope(e)))),nf=(e,t)=>{let r=e.identifier.parent;if(r?.type==="CallExpression"&&!r.optional&&"MemberExpression"===r.callee.type&&!r.callee.optional&&"Identifier"===r.callee.object.type&&rg(r.callee.object,t)&&r.arguments[0]===e.identifier)return r},ng=(e,t,r)=>{for(let n of e.properties.toReversed()){if("SpreadElement"===n.type)return;let e=eK(n,r.sourceCode.getScope(n));if(null===e)return;if(e===t)return n}},ny=(e,t)=>e?.type!=="ObjectExpression"||e.properties.some(e=>"SpreadElement"===e.type||"Property"===e.type&&e.computed&&null===eK(e,t.sourceCode.getScope(e))),nh=e=>e.parent?.type==="SwitchCase"&&null===e.parent.test&&1===e.parent.parent.cases.length,nx=(e,t,r)=>{let n=nf(e,r);if(!n)return;let o=eK(n.callee,r.sourceCode.getScope(n.callee));if("defineProperty"===o){let e=n.arguments[1];return e&&rP(e,r)?.value===t?n.arguments[2]:void 0}if("defineProperties"===o&&n.arguments[1]?.type==="ObjectExpression")return ng(n.arguments[1],t,r)?.value},nb=(e,t,r)=>{let n=nf(e,r);if(!(!n||"assign"!==eK(n.callee,r.sourceCode.getScope(n.callee))||2!==n.arguments.length||"ObjectExpression"!==n.arguments[1].type||n.arguments[1].properties.some(e=>"SpreadElement"===e.type)))return ng(n.arguments[1],t,r)?.value},nv=(e,t,r)=>{let n=nx(e,t,r);return!!(n&&nm(n,r))},nE=(e,t)=>{if(!e)return!1;let r=rP(e,t);return!!(r&&Number.isSafeInteger(r.value)&&r.value>=0)},nS=(e,t,r)=>{let n=nx(e,t,r);if(n?.type==="ObjectExpression")return nE(ng(n,"value",r)?.value,r);let o=nD(e);if(!o)return nE(nb(e,t,r),r);let{parent:a}=o;if("ForOfStatement"===a.type){let e=rP(a.right,r)?.value;return Array.isArray(e)&&e.length>0&&e.every(e=>Number.isSafeInteger(e)&&e>=0)}return nE(((e,t)=>{let r=[],n=e;for(;;){let{parent:e}=n;if(!e)return;if("AssignmentExpression"===e.type){if(e.left!==n||"="!==e.operator)return;let o=e.right;for(let e of r.toReversed()){if(!o)return;o="array"===e.type?"ArrayExpression"===o.type?o.elements[e.index]:void 0:"ObjectExpression"===o.type?ng(o,e.propertyName,t)?.value:void 0}return o}if("ArrayPattern"===e.type)r.push({type:"array",index:e.elements.indexOf(n)});else if("Property"===e.type&&"ObjectPattern"===e.parent.type)r.push({type:"object",propertyName:eK(e,t.sourceCode.getScope(e))});else if("RestElement"===e.type||"AssignmentPattern"===e.type)return;n=e}})(o,r),r)},nT=e=>{for(let t=e.parent;t;t=t.parent)if(tj(t)||nc.has(t.type))return t},nC=(e,t)=>{for(let r=e;r.parent;r=r.parent){let{parent:e}=r;if(("IfStatement"===e.type||"ConditionalExpression"===e.type)&&(e.consequent===r||e.alternate===r)){let n=rP(e.test,t);if(n&&!!n.value==(e.consequent===r))continue;return!0}if("LogicalExpression"===e.type&&e.right===r||"ForStatement"===e.type&&(e.body===r||e.update===r)||["WhileStatement","ForInStatement","ForOfStatement"].includes(e.type)&&e.body===r||"SwitchCase"===e.type&&e.consequent.includes(r)&&!nh(r)||"CatchClause"===e.type&&e.body===r||"TryStatement"===e.type&&e.block===r||"AssignmentPattern"===e.type&&e.right===r||"MemberExpression"===e.type&&e.computed&&e.property===r&&nu(e)||"CallExpression"===e.type&&(e.optional||nu(e.callee))&&e.arguments.includes(r))return!0}return!1},nD=e=>{let t=e.identifier;for(;t.parent?.type==="MemberExpression"&&t.parent.object===t;)t=t.parent;return"MemberExpression"===t.type?t:void 0},nw=(e,t,r)=>{let n=nx(e,t,r);if(n)return!nm(n,r);let o=nf(e,r);if(o){let n=eK(o.callee,r.sourceCode.getScope(o.callee));if("assign"===n){if(o.arguments.length<2)return!1;if(nb(e,t,r))return!0;let n=o.arguments[1];return 2!==o.arguments.length||ny(n,r)}if("defineProperty"===n){let e=o.arguments[1],n=e&&rP(e,r);return!n||n.value===t}if("defineProperties"===n)return ny(o.arguments[1],r)}let a=nD(e);return!!a&&eK(a,r.sourceCode.getScope(a))===t&&ns(a)},nA=(e,t,r)=>{let n=nD(e);return!!(n&&eK(n,r.sourceCode.getScope(n))===t&&n.parent?.type==="ForInStatement"&&n.parent.left===n)},nk=(e,t,r)=>{let n=nD(e);if(!n||eK(n,r.sourceCode.getScope(n))!==t){let t=nf(e,r),n=t&&eK(t.callee,r.sourceCode.getScope(t.callee));return!!(t&&["assign","defineProperty","defineProperties"].includes(n))}let{parent:o}=n;return("CallExpression"!==o.type||o.callee!==n)&&("NewExpression"!==o.type||o.callee!==n)&&("TaggedTemplateExpression"!==o.type||o.tag!==n)},nI=e=>{let t=[e];for(let e=0;e<t.length;e++)t.push(...t[e].childScopes);return t},nj=e=>[...new o(nI(e).flatMap(({references:e})=>e))];function nR(e){return/\.(?:ts|mts|cts|tsx)$/i.test(e)}let nF=["Program","StyleSheet","Document","root"];function nB(e,t){let{sourceCode:r}=e;return r.parserServices.getTemplateBodyTokenStore&&r.ast.templateBody&&r.getRange(r.ast.templateBody)[0]<=r.getRange(t)[0]&&r.getRange(t)[1]<=r.getRange(r.ast.templateBody)[1]?r.parserServices.getTemplateBodyTokenStore():r}let nL=(e,t)=>t.sourceCode.getText(e).slice(1,e.tail?-1:-2),nN=({identifiers:e,references:t})=>[...new o([...e,...t.map(({identifier:e})=>e)])],nP=(e,t)=>{let{references:r=[]}=eD(e,t)||{};return r},nM=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],n$=new o(["any","error","unknown"]),nO=new o(["null","undefined"]),nU=e=>e.getSymbol()??e.aliasSymbol,nq=(e,t)=>e?.declarations?.some(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))??!1;function nW(e,t){try{return t.getBaseTypes(e)}catch{return[]}}let nV="target",nz="non-target",n_="nullish",nJ="unknown",nH=new o(["ClassDeclaration","ClassExpression"]),nK=new o(["FunctionDeclaration","FunctionExpression"]),nG=new o(["ClassName","ImportBinding","TSEnumName","Type"]),nX=new o(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNumberKeyword","TSStringKeyword","TSSymbolKeyword","TSVoidKeyword","TSArrayType","TSLiteralType","TSTupleType","TSTypeLiteral","TSFunctionType","TSConstructorType"]),nY=new o(["TSNullKeyword","TSUndefinedKeyword"]),nZ=e=>e===n_?nz:e,nQ=(e,t)=>0===(e=t.allowNullishInMixedUnion?e.filter(e=>e!==n_):e.map(nZ)).length?nz:(t.treatMixedUnionAsTarget?e.includes(nV):e.every(e=>e===nV))?nV:(t.treatMixedUnionAsNonTarget?e.includes(nz):e.every(e=>e===nz))?nz:nJ,n0=e=>(e=e.map(nZ)).includes(nJ)?nJ:e.includes(nV)?nV:nz,n1=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>nG.has(e.type));if(r)return{definition:r,scope:t};t=t.upper}},n2=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=n2(e.left);return t?`${t}.${e.right.name}`:void 0}},n3=(e,t)=>{let r=t.typeReferenceAliases?.get(e);return t.targetTypeNames.has(e)||r&&t.targetTypeNames.has(r)?nV:t.nonTargetTypeNames?.has(e)?nz:nJ},n5=(e,t,r)=>{let{source:n,importedName:o,localName:a}=e,i=t?.get(n);return i?i.has(o)?nV:nz:t&&((e,t)=>{for(let r of t.values())if(r.has(e))return!0;return!1})(o,t)||n3(o,r)!==nJ||n3(a,r)!==nJ?nz:nJ};function n8(e,t,r,n=new o){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return n8(e.typeAnnotation,t,r,n);case"TSTypeOperator":return"readonly"===e.operator?n8(e.typeAnnotation,t,r,n):nJ;case"TSTypeReference":return function e(t,r,n,o){var a,i;let s=n2(t.typeName);if(!s)return nJ;let l=((e,t,r)=>{if("TSQualifiedName"!==e.typeName.type||"Identifier"!==e.typeName.left.type||!r.targetTypeNamespaceImports)return nJ;let n=e.typeName.right.name,o=n1(e.typeName.left.name,t)?.definition;return o?.type!=="ImportBinding"||"ImportNamespaceSpecifier"!==o.node.type&&"ImportDefaultSpecifier"!==o.node.type?nJ:n5({source:o.parent?.source?.value,importedName:n,localName:n},r.targetTypeNamespaceImports,r)})(t,r,n);if(l!==nJ)return l;if(!n.preferTypeReferenceDefinitions){let e=n3(s,n);if(e!==nJ)return e}let{definition:u,scope:p}=n1(s,r)??{};if(!u)return n3(s,n);if(o.has(u))return nJ;o.add(u);let c=nJ,d=((e,t)=>{if("ImportBinding"!==e.type)return nJ;if("ImportDefaultSpecifier"===e.node.type)return n3(e.node.local.name,t)===nJ?nJ:nz;let r=e.node.imported?.name??e.node.imported?.value;return r?n5({source:e.parent?.source?.value,importedName:r,localName:e.node.local.name},t.targetTypeImports,t):nJ})(u,n);return d!==nJ?c=d:"Type"===u.type&&"TSTypeAliasDeclaration"===u.node.type?c=n8(u.node.typeAnnotation,p,n,o):"Type"===u.type&&"TSTypeParameter"===u.node.type?c=n8(u.node.constraint,p,n,o):"Type"===u.type&&"TSInterfaceDeclaration"===u.node.type?(a=u.node,c=0===a.extends.length?nz:n0(a.extends.map(t=>e({typeName:t.expression},p,n,o)))):"ClassName"===u.type&&(i=u.node,c=i.superClass&&n.checkClassHeritage?"Identifier"!==i.superClass.type?nJ:n6(i.superClass,p,n,o):nz),o.delete(u),c}(e,t,r,n);case"TSUnionType":return nQ(e.types.map(e=>n8(e,t,r,n)),r);case"TSIntersectionType":return n0(e.types.map(e=>n8(e,t,r,n)));default:if(r.isTargetTypeAnnotation?.(e))return nV;if(nY.has(e?.type))return n_;return nX.has(e?.type)?nz:nJ}}let n9=(e,t,r,n)=>e.superClass&&r.checkClassHeritage?n6(e.superClass,t,r,n):nz;function n6(e,t,r,n=new o){if("Identifier"===e.type){let o=e.name;if(!r.checkClassHeritage)return n3(o,r);if(n.has(o))return nJ;n.add(o);let a=((e,t)=>{for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}})(o,t),[i]=a?.defs??[],s=nJ;return i?.type==="Variable"&&"const"===i.parent.kind&&i.node.id===i.name&&i.node.init?s=n6(i.node.init,t,r,n):i?.type==="ClassName"&&(s=n9(i.node,t,r,n)),n.delete(o),i?s:n3(o,r)}return nH.has(e.type)?n9(e,t,r,n):nJ}let n4=(e,t,r)=>{let n=e.params.find(e=>"Identifier"===e.type&&"this"===e.name);return n8(n?.typeAnnotation,t.sourceCode.getScope(e),r)};function n7(e,t,r,n=new o){if(!e)return nJ;if("TSSatisfiesExpression"===e.type)return n7(e.expression,t,r,n);if(e.typeAnnotation){let n=n8(e.typeAnnotation,t.sourceCode.getScope(e),r);if(n!==nJ)return n}let a=((e,t,r,n)=>{let o=t.sourceCode.getScope(e);switch(e.type){case"Identifier":return((e,t,r,n)=>{let o=eD(t.sourceCode.getScope(e),e);if(!o||n.has(o)||1!==o.defs.length)return nJ;n.add(o);let[a]=o.defs,i=t.sourceCode.getScope(a.name),s=n8(a.name?.typeAnnotation,i,r);a.name?.optional&&(s=nQ([s,n_],r));let l=nJ;return s!==nJ?l=s:"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&(l=n7(a.node.init,t,r,n)),n.delete(o),l})(e,t,r,n);case"CallExpression":return((e,t,r)=>{let n;if("Identifier"!==e.callee.type)return nJ;let o=eD(t.sourceCode.getScope(e.callee),e.callee);if(!o||1!==o.defs.length||o.references.some(e=>e.isWrite()&&!e.init))return nJ;let[a]=o.defs;if("FunctionName"===a.type)n=a.node;else if("Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name){let e=a.node.init;for(;e?.type==="TSSatisfiesExpression"||e?.type==="TSNonNullExpression";)e=e.expression;e&&tj(e)&&(n=e)}return n?.returnType&&!n.typeParameters?n8(n.returnType,t.sourceCode.getScope(n).upper,r):nJ})(e,t,r);case"ThisExpression":return r.checkClassSyntax?((e,t,r)=>{for(let{parent:n}=e;n;n=n.parent){if(nH.has(n.type))return n9(n,t.sourceCode.getScope(n),r);if("StaticBlock"===n.type||("AccessorProperty"===n.type||"PropertyDefinition"===n.type)&&n.static)return nz;if(nK.has(n.type)){let e=n4(n,t,r);if(e!==nJ)return e;if(n.parent?.type==="Property"&&n.parent.parent?.type==="ObjectExpression")return nz;if(n.parent?.type==="MethodDefinition"){if(n.parent.static)return nz;continue}break}}return nJ})(e,t,r):nJ;case"Super":return r.checkClassSyntax?((e,t,r)=>{for(let{parent:n}=e;n;n=n.parent){if("StaticBlock"===n.type||("AccessorProperty"===n.type||"PropertyDefinition"===n.type)&&n.static||"MethodDefinition"===n.type&&n.static)return nz;if(nH.has(n.type))return n.superClass?n6(n.superClass,t.sourceCode.getScope(n),r):nz}return nJ})(e,t,r):nJ;case"NewExpression":let a;return r.checkClassSyntax?(a=e.callee,n6(a,t.sourceCode.getScope(a),r,void 0)):nJ;case"TSAsExpression":case"TSTypeAssertion":{let a=n8(e.typeAnnotation,o,r);return a===nJ?n7(e.expression,t,r,n):a}case"TSNonNullExpression":case"ParenthesizedExpression":return n7(e.expression,t,r,n);case"SequenceExpression":return n7(e.expressions.at(-1),t,r,n);case"ConditionalExpression":return nQ([n7(e.consequent,t,r,n),n7(e.alternate,t,r,n)],r);default:return nJ}})(e,t,r,n);if(a!==nJ)return a;if("Identifier"!==e.type){let n,o=(n=rP(e,t))?r.getStaticType?.(n.value,e)??nJ:nJ;if(o!==nJ)return o}if(r.isTargetNode?.(e,t)||r.targetConstructorNames?.some(t=>tT(e,{name:t}))||r.targetCallNames?.some(t=>tS(e,{name:t},tb)))return nV;let i=((e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return nJ;try{let{program:t}=n;return function e(t,r,n,o){if(n$.has(t.intrinsicName))return nJ;if(nO.has(t.intrinsicName))return n_;if(t.isTypeParameter?.()){let a=t.getConstraint();return a?e(a,r,n,o):nJ}if(t.isUnion())return nQ(t.types.map(t=>e(t,r,n,o)),o);if(t.isIntersection())return n0(t.types.map(t=>e(t,r,n,o)));if(o.isTargetType?.(t,r,n))return nV;let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);if(o.checkClassHeritage&&nW(t,r).some(t=>e(t,r,n,o)===nV))return nV;if(t.intrinsicName)return nz;let i=nU(t);if(!i)return nJ;let s=i.getName(),l=o.typeReferenceAliases?.get(s);return o.targetTypeNames.has(s)||l&&o.targetTypeNames.has(l)?nV:nz}(n.getTypeAtLocation(e),t.getTypeChecker(),t,r)}catch{return nJ}})(e,t,r);return i!==nJ?i:r.isNonTargetNode?.(e,t)?nz:nJ}let oe=e=>{e={checkClassHeritage:!0,checkClassSyntax:!1,...e};let t=t=>t?{...e,...t}:e;return{getType:(e,r,n)=>nZ(n7(e,r,t(n))),isTarget:(e,r,n)=>n7(e,r,t(n))===nV,isKnownNonTarget:(e,r,n)=>nZ(n7(e,r,t(n)))===nz}},ot=({name:e,aliases:t=[],...n})=>oe({...n,targetTypeNames:new o([e]),typeReferenceAliases:new r(t.map(t=>[t,e])),targetConstructorNames:[e]}),or=new o(["ObjectExpression","FunctionExpression","ArrowFunctionExpression","ClassExpression","TemplateLiteral"]),on=new o(["Map","ReadonlyMap","WeakMap","Set","ReadonlySet","WeakSet","CanvasRenderingContext2D","OffscreenCanvasRenderingContext2D"]),oo=new o(["BigInt64Array","BigUint64Array"]),oa=new o([...nM,...on]),oi={checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:new o(["Array","ReadonlyArray"]),nonTargetTypeNames:oa,targetCallNames:["Array"],targetConstructorNames:["Array"],isTargetNode:e=>"ArrayExpression"===e.type||tP(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}),isNonTargetNode:e=>"NewExpression"===e.type||or.has(e.type),isTargetTypeAnnotation:e=>e?.type==="TSArrayType"||e?.type==="TSTupleType",isTargetType:(e,t)=>t.isArrayType(e)||t.isTupleType(e),getStaticType:(e,t)=>Array.isArray(e)?nV:"Identifier"===t.type||"MemberExpression"===t.type?nJ:nz},{isTarget:os,isKnownNonTarget:ol}=oe(oi),{isKnownNonTarget:ou}=oe({...oi,targetTypeNames:new o([...oi.targetTypeNames,...nM]),nonTargetTypeNames:on,targetConstructorNames:["Array",...nM]}),{isTarget:op}=oe({treatMixedUnionAsTarget:!0,targetTypeNames:oo,targetConstructorNames:[...oo],isTargetNode:e=>tP(e,{objects:[...oo],methods:["from","of"],optionalCall:!1,optionalMember:!1})}),oc=new o(["ArrayExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]);function od(e,t){return!oc.has(e.type)&&ou(e,t)}let om=new o(["AnimationEvent","BaseSyntheticEvent","ChangeEvent","ClipboardEvent","CompositionEvent","DragEvent","FocusEvent","FormEvent","InputEvent","InvalidEvent","KeyboardEvent","MouseEvent","PointerEvent","SubmitEvent","SyntheticEvent","TouchEvent","ToggleEvent","TransitionEvent","UIEvent","WheelEvent"]),of=new o(["AnimationEvent","AnimationPlaybackEvent","AudioProcessingEvent","BeforeUnloadEvent","BlobEvent","ClipboardEvent","CloseEvent","CommandEvent","CompositionEvent","ContentVisibilityAutoStateChangeEvent","CookieChangeEvent","CustomEvent","DeviceMotionEvent","DeviceOrientationEvent","DragEvent","ErrorEvent","Event","ExtendableCookieChangeEvent","ExtendableEvent","ExtendableMessageEvent","FetchEvent","FocusEvent","FontFaceSetLoadEvent","FormDataEvent","GPUUncapturedErrorEvent","GamepadEvent","HashChangeEvent","IDBVersionChangeEvent","InputEvent","KeyboardEvent","MIDIConnectionEvent","MIDIMessageEvent","MediaEncryptedEvent","MediaKeyMessageEvent","MediaQueryListEvent","MediaStreamTrackEvent","MessageEvent","MouseEvent","NavigateEvent","NavigationCurrentEntryChangeEvent","NotificationEvent","OfflineAudioCompletionEvent","PageRevealEvent","PageSwapEvent","PageTransitionEvent","PaymentMethodChangeEvent","PaymentRequestUpdateEvent","PictureInPictureEvent","PointerEvent","PopStateEvent","ProgressEvent","PromiseRejectionEvent","PushEvent","PushSubscriptionChangeEvent","RTCDataChannelEvent","RTCDTMFToneChangeEvent","RTCErrorEvent","RTCPeerConnectionIceErrorEvent","RTCPeerConnectionIceEvent","RTCTrackEvent","RTCTransformEvent","SecurityPolicyViolationEvent","SpeechRecognitionErrorEvent","SpeechRecognitionEvent","SpeechSynthesisErrorEvent","SpeechSynthesisEvent","StorageEvent","SubmitEvent","TaskPriorityChangeEvent","TextEvent","ToggleEvent","TouchEvent","TrackEvent","TransitionEvent","UIEvent","WebGLContextEvent","WheelEvent",...om]),{isTarget:og,isKnownNonTarget:oy}=oe({preferTypeReferenceDefinitions:!0,targetTypeImports:new r([["react",om]]),targetTypeNamespaceImports:new r([["react",om]]),targetTypeNames:of}),{isTarget:oh}=ot({name:"Set",aliases:["ReadonlySet"]}),{isTarget:ox}=ot({name:"Map",aliases:["ReadonlyMap"]}),ob=new o(["CharacterData","Document","DocumentFragment","Element","HTMLElement","Node","SVGElement","Text"]),ov=new o(["KeyboardEvent","React.KeyboardEvent"]),oE=new o(["Event","MouseEvent","PointerEvent","React.MouseEvent","React.PointerEvent"]),{isKnownNonTarget:oS}=oe({targetTypeNames:ob}),{isKnownNonTarget:oT}=oe({targetTypeNames:ov,nonTargetTypeNames:oE}),oC=new o(["textarea","title"]),oD=(e,t)=>"CallExpression"===e.type&&!e.optional&&"Identifier"===e.callee.type&&e.callee.name===t,ow=(e,t,r)=>"MemberExpression"===e.type&&!e.computed&&!e.optional&&"Identifier"===e.object.type&&e.object.name===t&&"Identifier"===e.property.type&&r.has(e.property.name),oA=new o(["fromCharCode","fromCodePoint"]),ok=e=>{switch(e?.type){case"TSStringKeyword":return!0;case"TSLiteralType":return tp(e.literal);default:return!1}},{isTarget:oI,isKnownNonTarget:oj}=oe({targetTypeNames:new o,targetCallNames:["String"],isTargetNode:(e,t)=>{if(tp(e)||oD(e,"String")||"CallExpression"===e.type&&!e.optional&&ow(e.callee,"String",oA))return!0;switch(e.type){case"TemplateLiteral":return!0;case"UnaryExpression":return"typeof"===e.operator;case"BinaryExpression":return"+"===e.operator&&(oR(e.left,t)||oR(e.right,t));case"AssignmentExpression":if("="===e.operator)return oR(e.right,t);return"+="===e.operator&&(oR(e.left,t)||oR(e.right,t));default:return!1}},isTargetTypeAnnotation:ok,isTargetType:e=>e.isStringLiteral?.()||"string"===e.intrinsicName,getStaticType:e=>"string"==typeof e?nV:nJ});function oR(e,t){if(!e)return!1;if("TSSatisfiesExpression"===e.type&&ok(e.typeAnnotation)||oI(e,t))return!0;let r=((e,t)=>{if("Identifier"!==e.type)return!1;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs.length===1?r.defs[0]:void 0;return!!(n?.type==="Variable"&&(n.parent?.kind==="let"||n.parent?.kind==="var")&&n.node.id===n.name&&n.node.init&&r.references.every(e=>!e.isWrite()||e.init))})(e,t)?rN(e,t):rP(e,t);return"string"==typeof r?.value}let oF=new o(["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"]),oB=new o(["abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","clz32","cos","cosh","exp","expm1","floor","fround","hypot","imul","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc"]),oL=new o(["charCodeAt","codePointAt","indexOf","lastIndexOf","localeCompare","search"]),oN=new o(["EPSILON","MAX_SAFE_INTEGER","MAX_VALUE","MIN_SAFE_INTEGER","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]),oP=new o(["parseFloat","parseInt"]),oM=e=>e?.type==="TSNumberKeyword"||e?.type==="TSLiteralType"&&tm(e.literal),o$=new o(["-","*","/","%","**","<<",">>","|","^","&"]);function oO(e,t){let r;if(tm(e)||ow(e,"Math",oF)||"CallExpression"===e.type&&!e.optional&&ow(e.callee,"Math",oB)||oD(e,"Number")||"CallExpression"===e.type&&!e.optional&&"MemberExpression"===e.callee.type&&!e.callee.computed&&!e.callee.optional&&"Identifier"===e.callee.property.type&&oL.has(e.callee.property.name)&&oR(e.callee.object,t)||ow(e,"Number",oN)||"CallExpression"===e.type&&!e.optional&&ow(e.callee,"Number",oP)||oD(e,"parseInt")||oD(e,"parseFloat")||"MemberExpression"===e.type&&!e.computed&&!e.optional&&"Identifier"===e.property.type&&"length"===e.property.name&&!((e,t)=>{if("Identifier"!==e.object.type)return!1;let r=na(e.object,t);if(r?.type!=="ObjectExpression")return!1;let n=r.properties.find(e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type&&"length"===e.key.name);return!!(n&&n.value?.type==="Literal"&&"number"!=typeof n.value.value)})(e,t))return!0;switch(e.type){case"AssignmentExpression":{let{operator:r}=e;if("="===r&&oO(e.right,t))return!0}case"BinaryExpression":{let{operator:r}=e;if("AssignmentExpression"===e.type&&(r=r.slice(0,-1)),"+"===r&&oO(e.left,t)&&oO(e.right,t)||">>>"===r||o$.has(r)&&(oO(e.left,t)||oO(e.right,t)))return!0;break}case"UnaryExpression":{let{operator:r}=e;if("+"===r||("-"===r||"~"===r)&&oO(e.argument,t))return!0;break}case"UpdateExpression":if(oO(e.argument,t))return!0;break;case"ConditionalExpression":{let r=oO(e.consequent,t),n=oO(e.alternate,t);if(r&&n)return!0;let o=rP(e.test,t);if(void 0!==o&&(r&&o.value||n&&!o.value))return!0;break}case"SequenceExpression":if(oO(e.expressions.at(-1),t))return!0;break;case"Identifier":var n;if(n=t.sourceCode.getScope(e),(r=eD(n,e))&&r.defs.some(e=>oM(e.name?.typeAnnotation?.typeAnnotation)))return!0;break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":if(oM(e.typeAnnotation))return!0;break;case"TSNonNullExpression":if(oO(e.expression,t))return!0}return"number"==typeof rP(e,t)?.value}oe({targetTypeNames:new o,targetCallNames:["Number"],isTargetTypeAnnotation:oM,isTargetType:e=>e.isNumberLiteral?.()||"number"===e.intrinsicName});let oU=new o([">",">=","<","<=","==","===","!=","!==","in","instanceof"]),oq=new o(["boolean","true","false"]),oW=new o(["isFinite","isNaN"]),oV=new r([["Array",new o(["isArray"])],["ArrayBuffer",new o(["isView"])],["Atomics",new o(["isLockFree"])],["Error",new o(["isError"])],["Number",new o(["isFinite","isInteger","isNaN","isSafeInteger"])],["Object",new o(["hasOwn","is","isExtensible","isFrozen","isSealed"])],["Reflect",new o(["deleteProperty","has"])],["URL",new o(["canParse"])]]),oz=new r([["array",new o(["every","includes","some"])],["map",new o(["has"])],["regexp",new o(["test"])],["set",new o(["has","isDisjointFrom","isSubsetOf","isSupersetOf"])],["string",new o(["endsWith","includes","isWellFormed","startsWith"])],["weakSet",new o(["has"])]]),o_=new r([["regexp",new o(["dotAll","global","hasIndices","ignoreCase","multiline","sticky","unicode","unicodeSets"])]]);function oJ(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{return function e(t,r){if(t.isUnion?.())return t.types.every(t=>e(t,r));let n=r.getBaseConstraintOfType(t);return n&&n!==t?e(n,r):oq.has(r.typeToString(t))}(r.getTypeAtLocation(e),r.program.getTypeChecker())}catch{return!1}}function oH(e,t,r,n){let o=e.filter(e=>"TSCallSignatureDeclaration"===e.type);return o.length>0&&o.every(e=>oG(e.returnType,t,r,n))}function oK({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:o}){let a=function(e){if(e?.type==="Identifier")return e.name}(e.typeName);if(!a||n.has(a))return!1;n.add(a);let i=rr(a,r),[s]=i?.defs??[],l=s?.type==="Type"?t.sourceCode.getScope(s.node):r,u=s?.type==="Type"&&o(s.node,l);return n.delete(a),u}function oG(e,t,r,n=new o){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return oG(e.typeAnnotation,t,r,n);case"TSBooleanKeyword":return!0;case"TSLiteralType":return"boolean"==typeof e.literal.value;case"TSTypeReference":return oK({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:(e,r)=>"TSTypeAliasDeclaration"===e.type&&oG(e.typeAnnotation,t,r,n)});case"TSTypePredicate":return!e.asserts;case"TSUnionType":return e.types.every(e=>oG(e,t,r,n));case"TypeAnnotation":return e.typeAnnotation?.type==="BooleanTypeAnnotation";default:return!1}}function oX(e,t,r,n=new o){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return oX(e.typeAnnotation,t,r,n);case"TSFunctionType":return oG(e.returnType,t,r,n);case"TSTypeLiteral":return oH(e.members,t,r,n);case"TSTypeReference":return oK({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:(e,r)=>"TSTypeAliasDeclaration"===e.type&&oX(e.typeAnnotation,t,r,n)||"TSInterfaceDeclaration"===e.type&&oH(e.body.body,t,r,n)});case"TSUnionType":return e.types.every(e=>oX(e,t,r,n));default:return!1}}function oY(e,t,r=new o){if(e.async||e.generator)return!1;let n=t.sourceCode.getScope(e);return!!oG(e.returnType,t,n)||!!e.body&&("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type?o2(e.body.body[0].argument,t,r):"ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type&&o2(e.body,t,r))}let oZ=e=>"Variable"===e.type&&"const"===e.parent.kind&&e.node.id===e.name,oQ=e=>("function-expression-name"===e.scope.type||"global"!==e.scope.type&&e.scope.isStrict)&&e.defs.every(e=>"FunctionName"===e.type);function o0(e,t,r=new o){if(e?.type!=="Identifier")return!1;let n=eD(t.sourceCode.getScope(e),e);if(!n||r.has(n))return!1;r.add(n);let a=!1;if(n.defs.length>1&&oQ(n)){let e=n.defs.filter(e=>"TSDeclareFunction"===e.node.type),o=e.length>0?e:n.defs;a=n.references.every(e=>!e.isWrite())&&o.every(e=>oY(e.node,t,r))}else if(1===n.defs.length){let[e]=n.defs,o=t.sourceCode.getScope(e.name);if(oX(e.name?.typeAnnotation,t,o))a=!0;else{let o;oQ(n)?n.references.every(e=>!e.isWrite())&&(o=e.node):oZ(e)&&["ArrowFunctionExpression","FunctionExpression"].includes(e.node.init?.type)&&(o=e.node.init),a=!!o&&oY(o,t,r)}}return r.delete(n),a}function o1(e,t,r=new o){switch(e?.type){case"ArrayExpression":return"array";case"Literal":return"string"==typeof e.value?"string":e.regex?"regexp":void 0;case"TemplateLiteral":return 0===e.expressions.length?"string":void 0;case"NewExpression":if("Identifier"===e.callee.type&&t.sourceCode.isGlobalReference(e.callee)){if("RegExp"===e.callee.name)return"regexp";if(["Map","WeakMap"].includes(e.callee.name))return"map";if("Set"===e.callee.name)return"set";if("WeakSet"===e.callee.name)return"weakSet"}return;case"Identifier":return function(e,t,r){let n=eD(t.sourceCode.getScope(e),e),[o]=n?.defs??[];if(!n||r.has(n)||1!==n.defs.length||!oZ(o))return;r.add(n);let a=o1(o.node.init,t,r);return r.delete(n),a}(e,t,r);case"ParenthesizedExpression":case"TSNonNullExpression":case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":return o1(e.expression,t,r)}}function o2(e,t,r=new o){let n,a;return!!e&&(!!(e.typeAnnotation&&oG(e.typeAnnotation,t,t.sourceCode.getScope(e))||(n=e,a=t,"boolean"==typeof rN(n,a)?.value))||(function(e,t,r){switch(e.type){case"Identifier":return function(e,t,r){if(!e||r.has(e)||1!==e.defs.length)return!1;r.add(e);let[n]=e.defs,o=t.sourceCode.getScope(n.name);if(n.name?.typeAnnotation)return r.delete(e),!n.name.optional&&oG(n.name.typeAnnotation,t,o);let a=!!oZ(n)&&o2(n.node.init,t,r);return r.delete(e),a}(eD(t.sourceCode.getScope(e),e),t,r)||oJ(e,t);case"UnaryExpression":return["!","delete"].includes(e.operator);case"LogicalExpression":return o2(e.left,t,r)&&o2(e.right,t,r);case"BinaryExpression":return oU.has(e.operator);case"ConditionalExpression":return o2(e.consequent,t,r)&&o2(e.alternate,t,r);case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":let n;return n=t.sourceCode.getScope(e),oG(e.typeAnnotation,t,n)||o2(e.expression,t,r);case"CallExpression":return!!(function(e,t){if("MemberExpression"!==e.callee.type||"Identifier"!==e.callee.object.type||!t.sourceCode.isGlobalReference(e.callee.object))return!1;let r=oV.get(e.callee.object.name),n=eK(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t)||function(e,t){if("MemberExpression"!==e.callee.type)return!1;let r=oz.get(o1(e.callee.object,t)),n=eK(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t))||("Identifier"!==e.callee.type?oJ(e,t):!!("Boolean"===e.callee.name&&t.sourceCode.isGlobalReference(e.callee)||oW.has(e.callee.name)&&t.sourceCode.isGlobalReference(e.callee))||o0(e.callee,t,r)||oJ(e,t));case"MemberExpression":return function(e,t){if("MemberExpression"!==e.type||e.optional)return!1;let r=o_.get(o1(e.object,t)),n=eK(e,t.sourceCode.getScope(e));return!!r?.has(n)}(e,t)||void 0;default:switch(e.type){case"AwaitExpression":case"TSNonNullExpression":case"ParenthesizedExpression":return o2(e.argument??e.expression,t,r);case"SequenceExpression":return o2(e.expressions.at(-1),t,r);case"AssignmentExpression":return"="===e.operator&&o2(e.right,t,r)}return}}(e,t,r)??oJ(e,t)))}let o3=new o(["asIntN","asUintN"]),o5=e=>{switch(e?.type){case"TSBigIntKeyword":return!0;case"TSLiteralType":return ty(e.literal);default:return!1}},{isTarget:o8}=oe({targetTypeNames:new o,targetCallNames:["BigInt"],isTargetNode:e=>ty(e)||oD(e,"BigInt")||"CallExpression"===e.type&&!e.optional&&ow(e.callee,"BigInt",o3),isTargetTypeAnnotation:o5,isTargetType:(e,t)=>"bigint"===t.getBaseTypeOfLiteralType(e).intrinsicName,getStaticType:e=>"bigint"==typeof e?nV:nJ}),o9="non-url",o6="unknown",o4=new o(["node:url","url"]),o7=e=>e.every(e=>"url"===e)?"url":!e.includes(o6)&&e.includes(o9)?o9:o6,ae=e=>e.includes("url")&&e.includes(o9)?o6:o7(e),at=e=>{let t;if("ImportBinding"!==e.type)return!1;let{node:r,parent:n}=e;return t=n.source,o4.has(t.value)&&"ImportSpecifier"===r.type&&"Identifier"===r.imported.type&&"URL"===r.imported.name},ar=e=>"ImportBinding"===e.type&&("type"===e.parent.importKind||iL(e.node)),an=e=>"Type"===e.type||ar(e),ao=e=>at(e)&&!ar(e),aa=(e,t)=>{let r;return"NewExpression"===e.type&&(((e,t)=>{if("Identifier"!==e.type||"URL"!==e.name||((e,t,r)=>{for(;e;){let n=e.set.get("URL");if(n?.defs.some(e=>!an(e)&&iN(e,t,r)))return!0;e=e.upper}return!1})(t.sourceCode.getScope(e),e,t))return!1;if(rg(e,t))return!0;let r=eD(t.sourceCode.getScope(e),e);return r?.defs.length>0&&r.defs.every(e=>an(e))})(r=e.callee,t)||((e,t)=>{if("Identifier"!==e.type)return!1;let r=eD(t.sourceCode.getScope(e),e);return r?.defs.some(e=>ao(e))??!1})(r,t))},ai=(e,t)=>t.sourceCode.getScope(e.name),as=(e,t,r,n=new o)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return as(e.typeAnnotation,t,r,n);case"TSTypeReference":return((e,t,r,n)=>{if("Identifier"!==e.typeName.type)return o6;let o=e.typeName.name,a=r.references.find(t=>t.identifier===e.typeName)?.resolved,[i]=a?.defs??[];if(!i)return"URL"===o?"url":o6;if(n.has(o))return o6;if(at(i))return"url";n.add(o);let s=o6;return"Type"===i.type&&"TSTypeAliasDeclaration"===i.node.type?s=as(i.node.typeAnnotation,t,ai(i,t),n):"ClassName"===i.type&&(s=o9),n.delete(o),s})(e,t,r,n);case"TSUnionType":return ae(e.types.map(e=>as(e,t,r,n)));case"TSIntersectionType":return o7(e.types.map(e=>as(e,t,r,n)));case"TSImportType":let a;return(a=e.source,o4.has(a.value)&&e.qualifier?.type==="Identifier"&&"URL"===e.qualifier.name)?"url":o9;default:return e?o9:o6}},al=(e,t)=>{let{checker:r,program:n}=t;if(n$.has(e.intrinsicName)||e.isTypeParameter?.())return o6;let o=r.getBaseConstraintOfType(e);if(o&&o!==e)return al(o,t);if(e.isUnion())return ae(e.types.map(e=>al(e,t)));if(e.isIntersection())return o7(e.types.map(e=>al(e,t)));let a=nU(e);return nq(a,n)&&"URL"===a.getName()?"url":o9},au=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return o6;try{let{program:t}=r;return al(r.getTypeAtLocation(e),{checker:t.getTypeChecker(),program:t})}catch{return o6}};function ap(e,t,r=new o){let n=t.sourceCode.getScope(e);switch(e.type){case"Identifier":{let n=((e,t,r)=>{let n=eD(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return o6;let[o]=n.defs;if(!iN(o,e,t))return o6;r.add(n);let a="Variable"===o.type&&"Identifier"===o.node.id.type&&"const"===o.parent.kind&&o.node.init?ap(o.node.init,t,r):o6,i=as(o.name?.typeAnnotation,t,ai(o,t));return r.delete(n),a===o6?i:a})(e,t,r);if(n!==o6)return n;break}case"TSAsExpression":case"TSTypeAssertion":{let o=as(e.typeAnnotation,t,n);return o===o6?ap(e.expression,t,r):o}case"TSSatisfiesExpression":case"TSNonNullExpression":case"ParenthesizedExpression":return ap(e.expression,t,r);case"SequenceExpression":return ap(e.expressions.at(-1),t,r);case"ConditionalExpression":return o7([ap(e.consequent,t,r),ap(e.alternate,t,r)])}if(aa(e,t))return"url";if("NewExpression"===e.type){if(((e,t)=>{if("Identifier"!==e.type)return!1;let r=eD(t.sourceCode.getScope(e),e);return r?.defs.some(e=>!an(e)&&!ao(e))??!1})(e.callee,t))return o9;let r=au(e,t);return r===o6?o9:r}let a=((e,t)=>{if("CallExpression"!==e.type||"Identifier"!==e.callee.type)return o6;let r=eD(t.sourceCode.getScope(e.callee),e.callee);if(r?.defs.length!==1)return o6;let[n]=r.defs;return as(n.node.returnType,t,ai(n,t))})(e,t);return a!==o6?a:au(e,t)}let ac=(e,t)=>{switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"ParenthesizedExpression":case"TSNonNullExpression":return ac(e.expression,t);case"SequenceExpression":return ac(e.expressions.at(-1),t);case"ConditionalExpression":return ac(e.consequent,t)&&ac(e.alternate,t);case"NewExpression":return aa(e,t);default:return!1}},ad=new o(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]),am=e=>ad.has(e.type)||tV(e),af=new o(["ArrayExpression","BinaryExpression","ClassExpression","Literal","ObjectExpression","TemplateLiteral","UnaryExpression","UpdateExpression"]),ag=new o(["AssignmentExpression","AwaitExpression","NewExpression","TaggedTemplateExpression","ThisExpression"]),ay=e=>af.has(e.type)||ag.has(e.type)||tV(e)||tS(e,void 0,tb)&&!tP(e,{method:"bind",optionalCall:!1,optionalMember:!1}),ah=(e,t)=>{if("ThisExpression"===e.type||"Super"===e.type||"MetaProperty"===e.type&&e.meta?.name==="new"&&e.property?.name==="target")return!0;if("FunctionDeclaration"===e.type||"FunctionExpression"===e.type)return!1;if("ClassDeclaration"===e.type||"ClassExpression"===e.type){if(e.superClass&&ah(e.superClass,t))return!0;for(let r of e.body.body)if(r.computed&&ah(r.key,t))return!0;return!1}return t1(e,t).some(e=>ah(e,t))};function ax(e,t,r){let[n,o]=[e,t].map(e=>r.sourceCode.getLoc(e).start.line);return n===o}function ab(e,t){let r;if(r=e=t.getNonNullableType(e),!n$.has(r.intrinsicName)){if(e.isUnion()){let r=e.types.map(e=>ab(e,t));return!!r.every(Boolean)||!r.every(e=>!1===e)&&void 0}return void 0!==t.getPromisedTypeOfPromise(e)}}let av=e=>"use"===e||/^use[\dA-Z]/.test(e),aE=(e,t)=>"Identifier"===e.type&&"Identifier"===t.type&&e.name===t.name,aS=e=>rh(e)||e?.type==="TSInstantiationExpression",aT=e=>{for(;aS(e);)e=e.expression;return e},aC=(e,t)=>{let r=aT(e?.callee);return e?.type==="CallExpression"&&r?.type==="MemberExpression"&&!e.optional&&!r.optional&&!r.computed&&"Identifier"===r.object.type&&"process"===r.object.name&&"Identifier"===r.property.type&&"exit"===r.property.name&&rg(r.object,t)},aD=e=>"ReturnStatement"===e.type||"ThrowStatement"===e.type,aw=e=>"ThrowStatement"===e.type,aA=()=>!1,ak=(e,t)=>{let r;return"SequenceExpression"===e.type?e.expressions.every(e=>aM(e,t)):"ChainExpression"===e.type&&"MemberExpression"===e.expression.type&&!!e.expression.optional&&void 0!==(r=rP(e.expression.object,t))&&(null===r.value||void 0===r.value)||void 0!==rP(e,t)},aI=(e,t)=>{let{sourceCode:r}=t,n=eD(r.getScope(e),e.name),o=r.getRange(e)[0];return n?.defs.some(e=>("Variable"===e.type&&e.parent?.kind!=="var"||"ClassName"===e.type||"ImportBinding"===e.type)&&e.name&&r.getRange(e.name)[0]>o)!==!0},aj=(e,t)=>!!eD(t.sourceCode.getScope(e),e.name)&&aI(e,t),aR=(e,t)=>{let r=rP(e,t);return void 0!==r&&(null===r.value||"function"==typeof r.value)},aF=(e,t)=>{let r;return"MemberExpression"===e.type&&!e.optional&&!aK(e.object)&&(tw(e.object)||tA(e.object)||void 0!==(r=rP(e.object,t))&&null!==r.value&&void 0!==r.value)&&(!e.computed||aM(e.property,t))},aB=(e,t)=>{let r,n;return"Identifier"===e.type&&aI(e,t)&&(r=eD(t.sourceCode.getScope(e),e.name),r?.defs.some(e=>"Variable"===e.type&&e.parent?.kind==="const"||"ClassName"===e.type||"ImportBinding"===e.type)!==!0)&&(!(n=t.sourceCode.getScope(e)).isStrict||!!eD(n,e.name))||aF(e,t)},aL=(e,t)=>"Identifier"===e.type&&aj(e,t)||aF(e,t),aN=new o(["+=","-=","*=","/=","%=","**=","<<=",">>=",">>>=","&=","^=","|="]),aP=(e,t)=>{if("="===e.operator){let r;return r=e.left,"Identifier"===r.type||"ArrayPattern"===r.type||"ObjectPattern"===r.type||aF(r,t)}if(aN.has(e.operator))return aL(e.left,t);if(!aL(e.left,t))return!1;let r=rP(e.left,t);return void 0!==r&&("&&="===e.operator?!!r.value:"||="===e.operator?!r.value:null===r.value||void 0===r.value)},aM=(e,t)=>"AssignmentExpression"===e.type?"="===e.operator&&aB(e.left,t)&&ak(e.right,t):ak(e,t),a$=(e,t)=>(e=aT(e),e?.type==="Identifier")?aj(e,t):aM(e,t),aO=e=>"using"===e.kind||"await using"===e.kind,aU=(e,t)=>"ExpressionStatement"===e.type?aM(e.expression,t):"BlockStatement"===e.type?e.body.every(e=>aU(e,t)):"EmptyStatement"===e.type||"FunctionDeclaration"===e.type||"VariableDeclaration"===e.type&&!aO(e)&&e.declarations.every(e=>"Identifier"===e.id.type&&(!e.init||aM(e.init,t))),aq=(e,t,r)=>aU(e,t)||!!r?.isAdditionalStatementDefinitelyNotThrowing?.(e),aW=e=>"ReturnStatement"===e.type&&!e.argument,aV=(e,t)=>{if("IfStatement"!==e.type||e.alternate||!aM(e.test,t)||!(aW(e.consequent)||"BlockStatement"===e.consequent.type&&1===e.consequent.body.length&&aW(e.consequent.body[0])))return!1;let r=rP(e.test,t);return void 0!==r&&!r.value},az=(e,t)=>e.declarations.some(e=>e.init&&aY(e.init,t)),a_=(e,t)=>{for(let r of e.declarations)if(r.init){if(a2(r.init,t))return!0;if(aO(e))return!1;if("Identifier"!==r.id.type||!aM(r.init,t))break}return!1},aJ=(e,t,r,n={})=>{let{isAdditionalStatementAlwaysExits:o=()=>!1}=n;for(let a of e){if(il(a,t,r,n)||o(a))return!0;if(!aV(a,t)&&!aq(a,t,n))break}return!1},aH=(e,t,r=!0,n)=>!function(e,t){if("StaticBlock"!==e.type)return!1;let{superClass:r}=e.parent.parent;return!!(r&&!a2(r,t)&&!aR(r,t))}(e,t)&&aJ(e.body,t,r,n);function aK(e){return e?.type==="MemberExpression"?e.optional||aK(e.object):e?.type==="CallExpression"&&(e.optional||aK(e.callee))}function aG(e,t){if(!a1(e,t))return!1;let r=e,{parent:n}=e;for(;n&&!tj(n);){if(("ClassDeclaration"===n.type||"ClassExpression"===n.type)&&n.superClass&&n.superClass!==r&&!a2(n.superClass,t)&&!aR(n.superClass,t)||"CallExpression"===n.type&&n.arguments.includes(r)&&(n.optional||aK(n.callee))||"MemberExpression"===n.type&&n.computed&&n.property===r&&(n.optional||aK(n.object)))return!1;r=n,{parent:n}=n}return!0}let aX=(e,t)=>{let r,n=rP(e.left,t);if(void 0===n||!aM(e.left,t))return!1;switch(e.operator){case"&&":r=!!n.value;break;case"||":r=!n.value;break;default:r=null===n.value||void 0===n.value}return r};function aY(e,t){if(aC(e,t))return!0;if(aS(e))return aY(e.expression,t);switch(e?.type){case"ChainExpression":return aY(e.expression,t);case"SpreadElement":case"UnaryExpression":case"AwaitExpression":return aY(e.argument,t);case"CallExpression":case"NewExpression":return!!aY(e.callee,t)||!("CallExpression"===e.type&&(e.optional||aK(e.callee)))&&!!a$(e.callee,t)&&e.arguments.some(e=>aY(e,t));case"MemberExpression":return aY(e.object,t)||e.computed&&!e.optional&&!aK(e.object)&&a$(e.object,t)&&aY(e.property,t);case"ArrayExpression":return e.elements.some(e=>e&&aY(e,t));case"ObjectExpression":return e.properties.some(e=>"SpreadElement"===e.type?aY(e.argument,t):e.computed&&aY(e.key,t)||aY(e.value,t));case"YieldExpression":return!!(e.argument&&aY(e.argument,t));case"AssignmentExpression":return aY(e.left,t)||aP(e,t)&&aY(e.right,t);case"ImportExpression":return aY(e.source,t);case"TemplateLiteral":return e.expressions.some(e=>aY(e,t));case"TaggedTemplateExpression":return aY(e.tag,t)||a$(e.tag,t)&&e.quasi.expressions.some(e=>aY(e,t));case"ClassExpression":return iu(e,t,!0);case"SequenceExpression":return e.expressions.some(e=>aY(e,t));case"ConditionalExpression":if(aY(e.test,t))return!0;let r=rP(e.test,t);return void 0!==r&&aM(e.test,t)?aY(r.value?e.consequent:e.alternate,t):aY(e.consequent,t)&&aY(e.alternate,t);case"LogicalExpression":return aY(e.left,t)||aX(e,t)&&aY(e.right,t);case"BinaryExpression":return aY(e.left,t)||aY(e.right,t);default:return!1}}function aZ(e,t,r){if(tj(e))return!1;if("BreakStatement"===e.type)return e.label?.name===r;if("LabeledStatement"===e.type&&e.label.name===r)return!1;if("IfStatement"===e.type){if(a2(e.test,t))return!1;let n=rP(e.test,t);if(void 0!==n&&aM(e.test,t)){let o=n.value?e.consequent:e.alternate;return!!(o&&aZ(o,t,r))}}if(aY(e.expression,t))return!1;if("BlockStatement"===e.type){for(let n of e.body){if(aZ(n,t,r))return!0;if(ip(n,t))break}return!1}return t1(e,t.sourceCode.visitorKeys).some(e=>aZ(e,t,r))}let aQ=(e,t)=>{if("SpreadElement"===e.type)return a2(e.argument,t);if(e.computed){if(a2(e.key,t))return!0;if(!aM(e.key,t))return!1}return a2(e.value,t)},a0=(e,t)=>{for(let r of e)if(r){if(a2(r,t))return!0;if(!aM(r,t))break}return!1},a1=(e,t)=>aC(e,t)&&(e.arguments.every(e=>aM(e,t))||a0(e.arguments,t));function a2(e,t){if(a1(e,t))return!0;if(aS(e))return a2(e.expression,t);switch(e?.type){case"ChainExpression":return a2(e.expression,t);case"SpreadElement":case"UnaryExpression":case"AwaitExpression":return a2(e.argument,t);case"CallExpression":case"NewExpression":return!!a2(e.callee,t)||!("CallExpression"===e.type&&(e.optional||aK(e.callee)))&&!!a$(e.callee,t)&&a0(e.arguments,t);case"MemberExpression":return a2(e.object,t)||e.computed&&!e.optional&&!aK(e.object)&&(tw(e.object)||tA(e.object))&&a2(e.property,t);case"ArrayExpression":return a0(e.elements,t);case"ObjectExpression":for(let r of e.properties){if(aQ(r,t))return!0;if("SpreadElement"===r.type){if(!aM(r.argument,t))return!1;continue}if(r.computed&&!aM(r.key,t)||!aM(r.value,t))break}return!1;case"ClassExpression":return is(e,t,!0);case"AssignmentExpression":return a2(e.left,t)||aP(e,t)&&a2(e.right,t);case"TaggedTemplateExpression":return!!a2(e.tag,t)||!!a$(e.tag,t)&&a0(e.quasi.expressions,t);case"YieldExpression":return!!(e.argument&&a2(e.argument,t));case"ImportExpression":return a2(e.source,t);case"TemplateLiteral":case"SequenceExpression":return a0(e.expressions,t);case"LogicalExpression":return!!a2(e.left,t)||aX(e,t)&&a2(e.right,t);case"BinaryExpression":return a2(e.left,t)||aM(e.left,t)&&a2(e.right,t);case"ConditionalExpression":if(a2(e.test,t))return!0;let r=rP(e.test,t);return void 0!==r&&aM(e.test,t)?a2(r.value?e.consequent:e.alternate,t):a$(e.test,t)&&a2(e.consequent,t)&&a2(e.alternate,t);default:return!1}}function a3(e,t,r,n){if(e.finalizer&&ip(e.finalizer,t,!0,n))return!0;let o=e.handler?aH(e.block,t,r,n):ip(e.block,t,r,n);return r?!!o||!!(e.handler&&iT(e.block,t,aw)&&ip(e.handler,t,!0,n)):o||e.handler&&iT(e.block,t,aw)&&ip(e.handler,t,!1,n)}function a5(e,t,r,n){for(let o of e.body){if(ip(o,t,r,n))return!0;if(aD(o)||iT(o,t,aD))break}return!1}let a8=(e,t,r,n)=>{let{checkTryStatements:o,enclosingLoop:a,isAtStart:i,isLastStatement:s,options:l,isProcessExitAtTest:u}=n;if("BlockStatement"!==e.type&&(i?il(e,r,o,l):ip(e,r,o,l))||"BlockStatement"!==e.type&&!i&&iT(e,r,aD)&&!("SwitchStatement"===e.type&&ib(e,t,r)))return!0;if(aq(e,r,l)||id(e,t))return u;if("LabeledStatement"===e.type&&tF(e.body))return a8(e.body,t,r,n);if("IfStatement"===e.type){let o=rP(e.test,r);if(void 0!==o&&aM(e.test,r)){let a=o.value?e.consequent:e.alternate;return a?a8(a,t,r,n):u}return a$(e.test,r)&&a8(e.consequent,t,r,n)&&(e.alternate?a8(e.alternate,t,r,n):u)}if("BlockStatement"!==e.type)return u&&s&&("SwitchStatement"===e.type&&(!o||it(e,t,r,l))&&!ix(e,t,r)||tF(e)&&(!a4(e,r)||ie(e,n))&&(!o||ia(e,r))&&(!o||a7(e.body,e,n))&&!ix(e,t,r));if(i){if(aH(e,r,o,l)||a9(e.body,t,r,n))return!0;let a=e.body.at(-1);return a&&id(a,t)&&e.body.slice(0,-1).every(e=>aq(e,r,l))?u:1===e.body.length&&a8(e.body[0],t,r,n)}if(e.body.some(e=>ib(e,t,r))){if(a9(e.body,t,r,n)||a6(e.body,t,r,n))return!0;let o=e.body.at(-1);return!!(o&&ib(o,t,r)&&a8(o,t,r,n))}return a6(e.body,t,r,n)},a9=(e,t,r,n)=>{let{isProcessExitAtTest:o,options:a}=n,i=e.findIndex(e=>ih(e,t,r)),s=-1===i?void 0:e[i];return!!(s&&e.slice(0,i).every(e=>aq(e,r,a))&&o&&(s.alternate?a8(s.alternate,t,r,n):i===e.length-1||a6(e.slice(i+1),t,r,n)))},a6=(e,t,r,n)=>{let{checkTryStatements:o,isAtStart:a,options:i,isProcessExitAtTest:s}=n,l=!1;for(let[u,p]of e.entries()){if(a){if(il(p,r,o,i))return!0;if(id(p,t))return s;if(!aq(p,r,i))return!1;continue}if(!aq(p,r,i)){if(ih(p,t,r)&&l)break;if(a8(p,t,r,{...n,isLastStatement:u===e.length-1}))return!0;if(ib(p,t,r))break;l=!0}}return!1},a4=(e,t)=>("WhileStatement"===e.type||"ForStatement"===e.type)&&(!e.test||!!rP(e.test,t)?.value),a7=(e,t,r)=>{let{context:n,enclosingLoop:o,options:a}=r;if(im(e,t)||id(e,t)||o&&id(e,o)||"EmptyStatement"===e.type)return!0;if("IfStatement"===e.type&&a$(e.test,n))return a7(e.consequent,t,r)&&(!e.alternate||a7(e.alternate,t,r));if("BlockStatement"!==e.type)return!1;let i=e.body.at(-1);return!!(!i||a7(i,t,r)&&e.body.slice(0,-1).every(e=>aq(e,n,a)))},ie=(e,t)=>{let{context:r,enclosingLoop:n}=t;return a7(e.body,e,t)||iT(e.body,r,t=>im(t,e)||!!(n&&id(t,n)))},it=(e,t,r,n)=>{let o=a=>aq(a,r,n)||iv(a,e)||id(a,t)||"BlockStatement"===a.type&&a.body.length>0&&o(a.body.at(-1))&&a.body.slice(0,-1).every(e=>aq(e,r,n));return aM(e.discriminant,r)&&e.cases.every(e=>(null===e.test||aM(e.test,r))&&e.consequent.every(e=>o(e)))},ir=(e,t,r,n)=>a4(e,t)&&il(e.body,t,r,n),io=(e,t)=>"VariableDeclaration"===e.type?aU(e,t):aM(e,t),ia=(e,t)=>{let r;return"WhileStatement"===e.type||"DoWhileStatement"===e.type?a$(e.test,t):"ForStatement"===e.type?(!e.init||io(e.init,t))&&(!e.test||a$(e.test,t))&&(!e.update||aM(e.update,t)):("ForInStatement"===e.type||"ForOfStatement"===e.type)&&(r=e.left,"VariableDeclaration"===r.type?aU(r,t):aB(r,t))&&aM(e.right,t)},ii=(e,t,r,{checkTryStatements:n,switchStatement:o,options:a})=>{let i=[];for(let r=t;r<e.length;r++)i.push(...e[r].consequent);return aJ(i,r,n,{...a,isAdditionalStatementAlwaysExits:e=>iE(e,o)})},is=(e,t,r,n)=>{if(e.superClass){if(a2(e.superClass,t))return!0;if(!aR(e.superClass,t))return!1}for(let o of e.body.body){if(o.computed){if(a2(o.key,t))return!0;if(!aM(o.key,t))break}if("StaticBlock"===o.type){if(aH(o,t,r,n))return!0;if(o.body.some(e=>!aq(e,t,n)))return!1;continue}if("PropertyDefinition"===o.type&&o.static){if(o.value&&a2(o.value,t))return!0;if(o.value&&!aM(o.value,t))break}}return!1};function il(e,t,r=!0,n){if("ExpressionStatement"===e.type)return a2(e.expression,t);if("VariableDeclaration"===e.type)return a_(e,t);if("ReturnStatement"===e.type||"ThrowStatement"===e.type)return!!(e.argument&&a2(e.argument,t));if("IfStatement"===e.type||"ConditionalExpression"===e.type){var o;if(a2(e.test,t))return!0;let a=rP(e.test,t);if(void 0!==a&&aM(e.test,t)){let o=a.value?e.consequent:e.alternate;return!!(o&&il(o,t,r,n))}return a$(e.test,t)&&il(e.consequent,t,r,n)&&!!(e.alternate&&il(e.alternate,t,r,n))}if("BlockStatement"===e.type)return aH(e,t,r,n);if("TryStatement"===e.type)return o=n,!!(e.finalizer&&il(e.finalizer,t,r,o))||(e.finalizer&&o?.isAdditionalStatementAlwaysExits&&!aq(e.finalizer,t,o)&&(o={...o,isAdditionalStatementAlwaysExits:void 0}),e.handler?a3(e,t,r,o):aH(e.block,t,r,o));if("LabeledStatement"===e.type)return!aZ(e.body,t,e.label.name)&&il(e.body,t,r,n);if(["DoWhileStatement","WhileStatement","ForStatement","ForInStatement","ForOfStatement"].includes(e.type))return"DoWhileStatement"===e.type?a8(e.body,e,t,{checkTryStatements:r,context:t,enclosingLoop:e,isAtStart:!0,isLastStatement:!0,options:n,isProcessExitAtTest:a2(e.test,t)}):((e,t,r,n)=>{if("WhileStatement"===e.type)return a2(e.test,t)||ir(e,t,r,n);if("ForStatement"===e.type){if(e.init){let r;if(r=e.init,"VariableDeclaration"===r.type?a_(r,t):a2(r,t))return!0;if(!io(e.init,t))return!1}return!!(e.test&&a2(e.test,t)||a4(e,t)&&e.update&&a2(e.update,t)&&aU(e.body,t)||ir(e,t,r,n))}return("ForInStatement"===e.type||"ForOfStatement"===e.type)&&a2(e.right,t)})(e,t,r,n);if("SwitchStatement"===e.type){if(a2(e.discriminant,t))return!0;if(!a$(e.discriminant,t))return!1;let o=e.cases.findIndex(e=>e.test&&a2(e.test,t)),a=e.cases.findIndex(e=>null===e.test);for(let[a,i]of e.cases.entries()){if(-1!==o&&a>=o)break;if(null!==i.test&&!aM(i.test,t)||!ii(e.cases,a,t,{checkTryStatements:r,switchStatement:e,options:n}))return!1}return -1!==o||-1!==a&&ii(e.cases,a,t,{checkTryStatements:r,switchStatement:e,options:n})}return"ClassDeclaration"===e.type||"ClassExpression"===e.type?is(e,t,r,n):ip(e,t,r,n)}let iu=(e,t,r,n)=>{if(e.superClass){if(aY(e.superClass,t))return!0;if(!aR(e.superClass,t))return!1}return e.body.body.some(e=>!!(e.computed&&aY(e.key,t))||("StaticBlock"===e.type?a5(e,t,r,n):"PropertyDefinition"===e.type&&e.static&&aY(e.value,t)))};function ip(e,t,r=!0,n){if("ExpressionStatement"===e.type&&aY(e.expression,t)||aY(e,t)||("ReturnStatement"===e.type||"ThrowStatement"===e.type)&&e.argument&&aY(e.argument,t)||"SwitchStatement"===e.type&&aY(e.discriminant,t))return!0;if("BlockStatement"===e.type)return a5(e,t,r,n);if("CatchClause"===e.type)return ip(e.body,t,r,n);if("VariableDeclaration"===e.type)return az(e,t);if("DoWhileStatement"===e.type)return a8(e.body,e,t,{checkTryStatements:r,context:t,enclosingLoop:e,isAtStart:!1,isLastStatement:!0,options:n,isProcessExitAtTest:aY(e.test,t)});return"WhileStatement"===e.type?aY(e.test,t)||ir(e,t,r,n):"ForStatement"===e.type?!!(e.init&&("VariableDeclaration"===e.init.type?az(e.init,t):aY(e.init,t))||e.test&&aY(e.test,t)||a4(e,t)&&e.update&&aY(e.update,t)&&aU(e.body,t)||ir(e,t,r,n)):"ForInStatement"===e.type||"ForOfStatement"===e.type?aY(e.right,t):"ClassDeclaration"===e.type||"ClassExpression"===e.type?iu(e,t,r,n):"LabeledStatement"===e.type?!aZ(e.body,t,e.label.name)&&ip(e.body,t,r,n):"TryStatement"===e.type?a3(e,t,r,n):"SwitchStatement"===e.type?iS(e,t,aA,r):!!("IfStatement"===e.type&&aY(e.test,t))||("IfStatement"===e.type||"ConditionalExpression"===e.type)&&e.alternate&&ip(e.consequent,t,r,n)&&ip(e.alternate,t,r,n)}function ic(e){let t=e.parent;if(e.label){for(;t&&!tj(t);){if("LabeledStatement"===t.type&&t.label.name===e.label.name)return t;t=t.parent}return}let r="BreakStatement"===e.type;for(;t&&!tj(t);){if(r&&(tF(t)||"SwitchStatement"===t.type)||!r&&tF(t))return t;t=t.parent}}function id(e,t){return"ContinueStatement"===e.type?ig(ic(e),t):"BlockStatement"===e.type&&1===e.body.length&&id(e.body[0],t)}function im(e,t){return"BreakStatement"===e.type&&ig(ic(e),t)}function ig(e,t){return e===t||e?.type==="LabeledStatement"&&e.body===t}function iy(e,t){for(let r=t.parent;r;r=r.parent){if(r===e)return!0;if(tj(r))break}return!1}function ih(e,t,r){return"IfStatement"===e.type&&a$(e.test,r)&&id(e.consequent,t)}function ix(e,t,r){if(tj(e))return!1;if("BreakStatement"===e.type||"ContinueStatement"===e.type){let r=ic(e),n=ig(r,t);if("BreakStatement"===e.type&&n||!n&&iy(r,t))return!0}return t1(e,r.sourceCode.visitorKeys).some(e=>ix(e,t,r))}function ib(e,t,r){if(tj(e))return!1;if("BreakStatement"===e.type||"ContinueStatement"===e.type){let r=ic(e);if(ig(r,t)||iy(r,t))return!0}return t1(e,r.sourceCode.visitorKeys).some(e=>ib(e,t,r))}function iv(e,t){return"BreakStatement"===e.type&&ig(ic(e),t)}function iE(e,t){if("BreakStatement"!==e.type&&"ContinueStatement"!==e.type)return!1;let r=ic(e);return!(!r||ig(r,t))&&iy(r,t)}function iS(e,t,r,n){let o=[],a=r===aA?r:t=>aD(t)||r(t)||iE(t,e),i=!1;for(let s=e.cases.length-1;s>=0;s--){let l=e.cases[s];i=!function e(t,r,n,o){for(let a of t){if(function t(r,n,o,a){if(tj(r))return!1;if("BreakStatement"===r.type&&iv(r,o)||a&&iE(r,o))return!0;if("BlockStatement"===r.type)return e(r.body,n,o,a);if(tF(r)||"SwitchStatement"===r.type)return!1;if("IfStatement"===r.type){if(a2(r.test,n))return!1;let e=rP(r.test,n);if(void 0!==e&&aM(r.test,n)){let i=e.value?r.consequent:r.alternate;return!!(i&&t(i,n,o,a))}}return t1(r,n.sourceCode.visitorKeys).some(e=>t(e,n,o,a))}(a,r,n,o))return!0;if(aD(a)||iT(a,r,aD)||ip(a,r))break}return!1}(l.consequent,t,e,r===aA)&&(l.consequent.some(e=>iT(e,t,a)||ip(e,t,n))||i),o[s]=i}let s=e.cases.findIndex(e=>e.test&&a2(e.test,t));return -1!==s?e.cases.every((e,t)=>t>=s||o[t]):e.cases.some(e=>null===e.test)&&o.every(Boolean)}function iT(e,t,r){if(r(e)||ip(e,t,!1))return!0;if("BlockStatement"===e.type){let n=e.body.at(-1);return!!(n&&iT(n,t,r))}if("CatchClause"===e.type)return iT(e.body,t,r);if("TryStatement"===e.type)return!!(e.finalizer&&iT(e.finalizer,t,r)||e.handler&&iT(e.block,t,r)&&iT(e.handler,t,r));if("SwitchStatement"===e.type)return iS(e,t,r,!1);if("IfStatement"===e.type||"ConditionalExpression"===e.type){let n=e0(e.test,t.sourceCode,{considerGetters:!0})&&!rS(e.test,t)?void 0:rP(e.test,t);if(void 0!==n&&aM(e.test,t)){let o=n.value?e.consequent:e.alternate;return!!(o&&iT(o,t,r))}}return("IfStatement"===e.type||"ConditionalExpression"===e.type)&&e.alternate&&iT(e.consequent,t,r)&&iT(e.alternate,t,r)}let iC=(e,t,r)=>e&&t&&r.sourceCode.getRange(e)[0]===r.sourceCode.getRange(t)[0]&&r.sourceCode.getRange(e)[1]===r.sourceCode.getRange(t)[1],iD=(e,t)=>{let{type:r,local:n,imported:o}=e.parent;return"ImportSpecifier"===r&&iC(n,o,t)&&n===e},iw=new o(["ArrayExpression","CallExpression","ChainExpression","Identifier","ImportExpression","Literal","MemberExpression","NewExpression","Super","TaggedTemplateExpression","TemplateLiteral","ThisExpression","TSNonNullExpression"]);function iA(e){return iw.has(e.type)}let ik=e=>"Property"===e.parent.type&&e.parent.shorthand&&e===e.parent.value;function iI(e){return tk(e.parent)||(e=>{let{parent:t}=e;return"SequenceExpression"===t.type&&(t.expressions.at(-1)!==e||iI(t))})(e)}let ij=new o(["String","Null","Boolean","Numeric","RegularExpression"]),iR=new o(["[","(","/","`","+","-","*",",",".","<"]),iF=new o(["ExpressionStatement","VariableDeclaration","ReturnStatement","ThrowStatement","ExportDefaultDeclaration"]);function iB(e,t,r){if(""===r||r&&!iR.has(r.charAt(0))||!e)return!1;let{sourceCode:n}=t,{type:o,value:a}=e;if("Punctuator"===o&&";"===a)return!1;let i=n.getRange(e),s=n.getNodeByRangeIndex(i[0]);for(let e=s;e&&n.getRange(e)[1]===i[1];e=e.parent)if(iF.has(e.type))return!0;if("Punctuator"===o){if("]"===a||"}"===a&&("BlockStatement"===s.type&&"FunctionExpression"===s.parent.type||"ClassBody"===s.type&&"ClassExpression"===s.parent.type))return!0;if(")"===a){switch(s.type){case"IfStatement":if(n.getTokenBefore(s.consequent)===e)return!1;break;case"ForStatement":case"ForInStatement":case"ForOfStatement":case"WhileStatement":case"DoWhileStatement":case"WithStatement":if(s.body&&n.getTokenBefore(s.body)===e)return!1}return!0}}return!!ij.has(o)||("Template"===o?a.endsWith("`"):"ObjectExpression"===s.type||"TSNonNullExpression"===s.type||"TSTypeParameterInstantiation"===s.type&&"TSInstantiationExpression"===s.parent.type||"Identifier"===o&&("of"!==a||"ForOfStatement"!==s.type)&&("await"!==a||"AwaitExpression"!==s.type))}let iL=e=>"type"===e.importKind||"type"===e.parent.importKind,iN=(e,t,r)=>r.sourceCode.getRange(e.name)[0]<=r.sourceCode.getRange(t)[0],iP=(e,t)=>{for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}},iM=new o(["Map","ReadonlyMap"]),i$=new o(["Set","ReadonlySet"]),iO=iM.union(i$),iU=e=>new o([e]),iq=e=>iO.has(e)?e:void 0,iW=new o(["ClassName","ImportBinding","TSEnumName","Type"]),iV=(e,t,r)=>{let n=r.sourceCode.getScope(t);for(;n;){if(n.set.get(e)?.defs.find(e=>iW.has(e.type)))return!0;n=n.upper}return!1},iz=e=>{let t=new o;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},i_=(e,t)=>{if(n$.has(e.intrinsicName))return;if(e.isUnion())return iz(e.types.map(e=>i_(e,t)));let r=nU(e);if(!(r?.declarations?.length>0&&r.declarations.every(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))))return;let n=r.getName(),o=n&&iq(n);return o&&iU(o)},iJ=(e,t)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return iJ(e.typeAnnotation,t);case"TSTypeOperator":return"readonly"===e.operator?iJ(e.typeAnnotation,t):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type||iV(e.typeName.name,e,t))return;let r=iq(e.typeName.name);return r&&iU(r)}case"TSUnionType":return iz(e.types.map(e=>iJ(e,t)))}},iH=(e,t,r=new o)=>((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:n}=r,o=i_(r.getTypeAtLocation(e),n);if(o&&!((e,t,r)=>{for(let n of e)if(iV(n,t,r))return!0;return!1})(o,e,t))return o}catch{}})(e,t)??((e,t,r)=>{if(tT(e,{names:["Map","Set"]})&&rg(e.callee,t))return iU(e.callee.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n,o=eD(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,i=iJ(a.name?.typeAnnotation,t);return i?n=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&(n=iH(a.node.init,t,r)),r.delete(o),n})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return iJ(e.typeAnnotation,t)??iH(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return iH(e.expression,t,r);case"ConditionalExpression":return iz([iH(e.consequent,t,r),iH(e.alternate,t,r)])}})(e,t,r),iK=(e,t)=>{let r=iH(e,t);if(!r?.size)return;let n=!1,o=!1;for(let e of r)iM.has(e)?n=!0:o=!0;if(!n||!o)return n?"Map":"Set"};function iG(e,t){if("function"!=typeof e?.[Symbol.iterator])return void t(e);for(let r of e)iG(r,t)}class iX extends Error{name="FixAbortError"}let iY={abort(){throw new iX("Fix aborted.")}};function iZ(e){return t=>{let r=e(t,iY),n=[];try{return iG(r,e=>{n.push(e)}),n}catch(e){if(e instanceof iX)return;throw e}}}class iQ{#e;#t=new r;constructor(e){this.#e=e}#r(e,t){let r=this.#t;for(let n of e)r.has(n)?r.get(n).push(t):r.set(n,[t])}on(e,t){let r=Array.isArray(e)?e:[e];this.#r(r,t)}onExit(e,t){let r=Array.isArray(e)?e:[e];this.#r(r.map(e=>`${e}:exit`),t)}toEslintListeners(){let e={};for(let[t,r]of this.#t)e[t]=function(e,t){let r=t=>{let r;t&&e.report((r={...t},t.fix&&(r.fix=iZ(t.fix)),Array.isArray(t.suggest)&&(r.suggest=t.suggest.map(e=>({...e,fix:iZ(e.fix),data:{...t.data,...e.data}}))),r))};return(e,n,o)=>{for(let a of t){let t=a(e,n,o);t&&iG(t,r)}}}(this.#e,r);return e}}let i0=new o;function i1(e){return i0.has(e)?e:t=>{let r=new iQ(t),n=e(new Proxy(t,{get:(e,t,n)=>"on"===t||"onExit"===t?r[t].bind(r):Reflect.get(e,t,n)}));return S.equal(n,void 0,`[${t.id}] Rule \`create\` function should return \`undefined\`, please use \`context.on()\` instead of return listeners.`),r.toEslintListeners()}}function i2(e,t){var r;let{visitScriptBlock:n=!0}={},o=i1(e);return r=e=>{let t=o(e),{parserServices:r}=e.sourceCode;return r?.defineTemplateBodyVisitor?n?r.defineTemplateBodyVisitor(t,t):r.defineTemplateBodyVisitor(t):t},i0.add(r),r}let i3={"??":4,"||":4,"&&":5},i5={"|":6,"^":7,"&":8,"==":9,"!=":9,"===":9,"!==":9,"<":10,"<=":10,">":10,">=":10,in:10,instanceof:10,"<<":11,">>":11,">>>":11,"+":12,"-":12,"*":13,"/":13,"%":13,"**":15};function i8(e){switch(e.type){case"SequenceExpression":return 0;case"AssignmentExpression":case"ArrowFunctionExpression":case"YieldExpression":return 1;case"ConditionalExpression":return 3;case"LogicalExpression":return i3[e.operator];case"BinaryExpression":return i5[e.operator];case"TSAsExpression":case"TSSatisfiesExpression":return 10;case"UnaryExpression":case"AwaitExpression":case"TSTypeAssertion":case"TSNonNullExpression":return 16;case"UpdateExpression":return e.prefix?16:17;case"CallExpression":case"ChainExpression":case"ImportExpression":return 18;case"NewExpression":return 19;default:return 20}}function i9(e){return["AwaitExpression","AssignmentExpression","YieldExpression","SequenceExpression","TSAsExpression","TSTypeAssertion"].includes(e.type)}let i6=/^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u;function i4(e){if(tm(e=rx(e)))return e.value;if("UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)){let t=i4(e.argument);if("number"==typeof t)return"-"===e.operator?-t:t}}function i7(e,t){switch(e.type){case"Identifier":case"MemberExpression":case"CallExpression":case"ChainExpression":case"TemplateLiteral":case"ThisExpression":case"Super":case"ArrayExpression":case"MetaProperty":case"ImportExpression":case"TaggedTemplateExpression":case"TSNonNullExpression":return!1;case"NewExpression":return!ru(e,t);case"Literal":let r;return!!(tm(e)&&(r=e.raw,i6.test(r)));default:return!0}}function se(e,t){let r=ts(e,t);return!tl(e,t)&&i7(e,t)?`(${r})`:r}let st=new o(["!","typeof","void","delete","~","+","-"]),sr=new o(["UpdateExpression","TSNonNullExpression","TSTypeAssertion"]);function sn(e,t){if(!st.has(t))throw Error("Unexpected operator");return 16>i8(e)||sr.has(e.type)}function so(e,{operator:t,property:r}){if(!r)throw Error("`property` is required.");return("LogicalExpression"!==e.type||e.operator!==t)&&(!!["AwaitExpression","BinaryExpression"].includes(e.type)||["LogicalExpression","ConditionalExpression","AssignmentExpression","ArrowFunctionExpression","YieldExpression","SequenceExpression"].includes(e.type))}function sa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var si={exports:{}},ss=si.exports,sl=sa(function(){return d?si.exports:(d=1,si.exports=function(){var e=[],t=[],r={},n={},o={};function a(e){return"string"==typeof e?RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function s(e,t,n){if(!e.length||r.hasOwnProperty(e))return t;for(var o=n.length;o--;){var a=n[o];if(a[0].test(t))return function(e,t){return e.replace(t[0],function(r,n){var o,a,s=(o=t[1],a=arguments,o.replace(/\$(\d{1,2})/g,function(e,t){return a[t]||""}));return""===r?i(e[n-1],s):i(r,s)})}(t,a)}return t}function l(e,t,r){return function(n){var o=n.toLowerCase();return t.hasOwnProperty(o)?i(n,o):e.hasOwnProperty(o)?i(n,e[o]):s(o,n,r)}}function u(e,t,r,n){return function(n){var o=n.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&s(o,o,r)===o}}function p(e,t,r){var n=1===t?p.singular(e):p.plural(e);return(r?t+" ":"")+n}return p.plural=l(o,n,e),p.isPlural=u(o,n,e),p.singular=l(n,o,t),p.isSingular=u(n,o,t),p.addPluralRule=function(t,r){e.push([a(t),r])},p.addSingularRule=function(e,r){t.push([a(e),r])},p.addUncountableRule=function(e){if("string"==typeof e){r[e.toLowerCase()]=!0;return}p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")},p.addIrregularRule=function(e,t){t=t.toLowerCase(),o[e=e.toLowerCase()]=t,n[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(e){return p.addIrregularRule(e[0],e[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(e){return p.addPluralRule(e[0],e[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(e){return p.addSingularRule(e[0],e[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}(),si.exports)}());let su=e=>{let t=sl.singular(e);if(t!==e)return t};function sp(e,t,r=0,n=0){let{sourceCode:o}=t,[a,i]=Array.isArray(e)?e:o.getRange(e);return{start:o.getLocFromIndex(a+r),end:o.getLocFromIndex(i+n)}}function sc(e,t){let r=[],n=[],a=()=>n.at(-1),l=new i,u=new i,p=new s;e.on("onCodePathStart",()=>{r.push(new o),n.push(new s)}),e.on("onCodePathEnd",()=>{r.pop(),n.pop()});let c=e=>{r.at(-1).add(e),e.prevSegments.length>0&&e.prevSegments.every(e=>!e.reachable||a().has(e))&&a().add(e)};return e.on("onCodePathSegmentStart",c),e.on("onCodePathSegmentEnd",e=>{r.at(-1).delete(e)}),e.on("onUnreachableCodePathSegmentStart",c),e.on("onUnreachableCodePathSegmentEnd",e=>{r.at(-1).delete(e)}),e.onExit("CallExpression",t=>{if(!(e=>{let t=e,{parent:r}=e;for(;r&&!tj(r);){if("TryStatement"===r.type&&r.finalizer&&r.block===t){let t=r.block.body.at(-1);return 1===r.block.body.length&&t?.type==="ExpressionStatement"&&t.expression===e}t=r,{parent:r}=r}return!1})(t)&&aG(t,e))for(let e of r.at(-1))e.reachable&&a().add(e)}),e.on("IfStatement",e=>{[...r.at(-1)].some(e=>e.reachable&&!a().has(e))&&p.add(e)}),e.onExit(["IfStatement > .consequent","IfStatement > .alternate"],e=>{l.set(e,new o(r.at(-1)))}),e.onExit("IfStatement",e=>{let t=r.at(-1);for(let r of[e.consequent,e.alternate]){if(!r)continue;let n=l.get(r),o=n&&[...t].every(e=>e.prevSegments.every(e=>!n.has(e)));u.set(r,p.has(e)&&(o||void 0))}}),e=>{if(!e||!u.has(e))return!1;let r=u.get(e);return void 0===r&&(u.set(e,!1),r=!!t?.(e),u.set(e,r)),r}}function sd(e,t,r){let{parent:n}=e;for(let o of t.sourceCode.visitorKeys[n.type]||Object.keys(n)){let t=n[o];if(t!==e&&Array.isArray(t)){let n=t.indexOf(e);if(-1!==n)return t[n+r]}}}let sm=(e,t)=>sd(e,t,1);function*sf(e){for(let[t,r]of Object.entries(e))if("parent"!==t)for(let e of Array.isArray(r)?r:[r])e?.type&&(yield e)}let sg=e=>e.charAt(0).toUpperCase()+e.slice(1),sy=e=>e.charAt(0).toLowerCase()+e.slice(1),sh="too-deep",sx="should-parenthesized",sb="prefer-event-target",sv=new o(["@angular/core","eventemitter3"]),sE=e=>"VariableDeclarator"===e.parent.type&&e.parent.id===e&&"VariableDeclaration"===e.parent.parent.type&&"const"===e.parent.parent.kind&&e.parent.parent.declarations.includes(e.parent);function sS(e){let t;return!!e&&(tO(e)?[t]=e.arguments:"AwaitExpression"===e.type&&"ImportExpression"===e.argument.type&&({source:t}=e.argument),!!(tp(t)&&sv.has(t.value)))}let sT={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",91:"Meta",92:"Meta",93:"ContextMenu",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",186:";",187:"=",188:",",189:"-",190:".",191:"/",219:"[",220:"\\",221:"]",222:"'",224:"Meta"},sC="prefer-keyboard-event-key",sD="prefer-keyboard-event-key/suggestion",sw=new o(["keyCode","charCode","which"]),sA=new o(["onKeyDown","onKeyPress","onKeyUp"]),sk=e=>{var t;return e?.type==="TSTypeAnnotation"&&"TSTypeReference"===e.typeAnnotation.type&&("Identifier"===(t=e.typeAnnotation.typeName).type?"KeyboardEvent"===t.name:"TSQualifiedName"===t.type&&"Identifier"===t.left.type&&"React"===t.left.name&&"Identifier"===t.right.type&&"KeyboardEvent"===t.right.name)},sI=(e,t)=>{var r;let n,o=[],a="ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type;for(let e of(a&&tP(t.parent,{method:"addEventListener",minimumArguments:2,optionalCall:!1,optionalMember:!1})&&t.parent.arguments[1]===t&&o.push({parameter:t.params[0],shouldAutofix:!0}),a&&"JSXExpressionContainer"===(r=t).parent.type&&r.parent.expression===r&&"JSXAttribute"===r.parent.parent.type&&r.parent.parent.value===r.parent&&"JSXAttribute"===(n=r.parent.parent).type&&"JSXIdentifier"===n.name.type&&sA.has(n.name.name)&&o.push({parameter:t.params[0],shouldAutofix:!1}),t.params))sk(e.typeAnnotation)&&o.push({parameter:e,shouldAutofix:!1});let i=e.sourceCode.getDeclaredVariables(t);return o.filter(({parameter:t})=>t&&!oT(t,e)).map(e=>({...e,references:i.find(t=>t.identifiers.includes(e.parameter))?.references}))},sj=(e,t)=>e?.parent?.type==="MemberExpression"&&e.parent.property===e&&!e.parent.computed&&e.parent.object===t,sR=(e,t)=>{let r=[];for(let n=t.parent;n;n=n.parent)tj(n)&&r.push(...sI(e,n));return r},sF=/[\p{Letter}\p{Number}\p{Punctuation}\p{Symbol}]/u,sB=(e,{shouldAutofix:t})=>{let r=(e=>{var t,r;let n;if(e.parent?.type!=="MemberExpression"||e.parent.property!==e)return;let o=((e,t)=>{let r=e;for(;r&&t;)t--,r=r.parent;if(0===t)return r})(e,3);if(!o||"IfStatement"!==o.type)return;let{type:a,operator:i,right:s}=o.test;if(!("BinaryExpression"===a&&o.test.left===e.parent&&("=="===i||"==="===i)&&tm(s)))return;let l=(t=s.value,r=e.name,n=Number.isSafeInteger(t)&&t>=0&&t<=1114111?String.fromCodePoint(t):void 0,"charCode"===r&&n&&sF.test(n)?n:Object.hasOwn(sT,t)?sT[t]:"charCode"!==r&&n&&/^[\dA-Z]$/.test(n)?n:void 0);if(l)return{key:l,right:s}})(e),n={messageId:sC,data:{name:e.name},node:e};if(!r)return n;let o=t=>[t.replaceText(e,"key"),t.replaceText(r.right,t5(r.key))],a="charCode"!==e.name&&1===r.key.length&&" "!==r.key;return t&&!a?n.fix=o:n.suggest=[{messageId:sD,data:{key:r.key},fix:o}],n},sL=(e,{parameter:t})=>t?.type==="ObjectPattern"&&t.properties.includes(e.parent),sN=(e,{references:t})=>{let r=((e,t,r=()=>!0)=>{let n=e;for(;n;){if(n.type===t&&r(n))return n;n=n.parent}})(e,"VariableDeclarator"),n=r?.init;return t&&r?.id===e.parent.parent&&t.some(e=>e.identifier===n)},sP="error",sM="suggestion";function*s$(e,t){yield e.insertTextBeforeRange(t,""),yield e.insertTextAfterRange(t,"")}function*sO(e,t,r){for(let n of ta(e,r))yield t.remove(n)}function sU(e,t,r,n){if("CallExpression"!==t.type)throw Error(`Unexpected node "${t.type}".`);let{sourceCode:o}=n,[a,i]=o.getLastTokens(t,2);return t.arguments.length>0&&(r=ek(a)?` ${r},`:`, ${r}`),e.insertTextBefore(i,r)}function sq(e,t){let r=e.parent,n=r.arguments.indexOf(e),o=ta(e,t),a=o[0]||e,i=o.at(-1)||e,{sourceCode:s}=t,[l]=s.getRange(a),[,u]=s.getRange(i);if(1===r.arguments.length){let e=s.getTokenAfter(i);ek(e)&&([,u]=s.getRange(e))}else if(0===n){let e=s.getTokenAfter(i),t=s.getTokenAfter(e,{includeComments:!0});[u]=s.getRange(t)}else{let e=s.getTokenBefore(a);[l]=s.getRange(e)}return[l,u]}function sW(e,t,r){let n=sq(t,r),o=t.parent,a=o.arguments.indexOf(t);if(ne(r,n)){let{sourceCode:i}=r,s=r2(r).filter(e=>{let[t,r]=i.getRange(e);return t>=n[0]&&r<=n[1]}),l=e=>`${i.getText(e)}${"Line"===e.type?rX(r):""}`;if(0===a&&o.arguments.length>1){let o=ta(t,r).at(-1)||t,[,a]=i.getRange(o),u=i.getTokenAfter(o),[p,c]=i.getRange(u),d=i.text.slice(...n),m=s.filter(e=>i.getRange(e)[1]<=a).map(e=>l(e)).join(" ")+d.slice(a-n[0],p-n[0])+d.slice(c-n[0]);return e.replaceTextRange(n,m)}let u=s.map(e=>` ${l(e)}`).join("");return e.replaceTextRange(n,u)}return e.removeRange(n)}function sV(e,t,r,n){let o=ts(r,n);return("MemberExpression"===t.parent.type&&t.parent.object===t?!i7(r,n):iA(r))||tl(r,n)||(o=`(${o})`),o.startsWith("{")&&(o=`(${o})`),iB(n.sourceCode.getTokenBefore(t),n,o)&&(o=`;${o}`),e.replaceText(t,o)}function*sz(e,t,r){if("ReturnStatement"!==t.type&&"ThrowStatement"!==t.type)return;let{sourceCode:n}=r,o=n.getFirstToken(t);yield e.insertTextAfter(o," (");let a=n.getLastToken(t);eI(a)?yield e.insertTextBefore(a,")"):yield e.insertTextAfter(t,")")}function s_(e,t,r){let[,n]=t.sourceCode.getRange(e),[o]=t.sourceCode.text.slice(n).match(/^\s*/);return r.removeRange([n,n+o.length])}function*sJ(e,t,r){let n=t.sourceCode.getFirstToken(e);yield r.remove(n),yield s_(n,t,r),ru(e,t)||(yield r.insertTextAfter(e,"()")),ax(n,e.callee,t)||tl(e,t)||(yield sz(r,e.parent,t))}let sH=({type:e,value:t})=>"Keyword"===e&&/^[a-z]*$/.test(t)||"Identifier"===e&&"of"===t||"Identifier"===e&&"await"===t;function*sK(e,t,r){let{sourceCode:n}=r,o=ti(t,r),a=n.getTokenBefore({range:o},{includeComments:!0});a&&o[0]===n.getRange(a)[1]&&sH(a)&&(yield e.insertTextAfter(a," "));let i=n.getTokenAfter({range:o},{includeComments:!0});i&&o[1]===n.getRange(i)[0]&&sH(i)&&(yield e.insertTextBefore(i," "))}function*sG(e,t,r){var n;yield sK(r,e,t),yield r.insertTextBefore(e,"new ");let{callee:o}=e;!tl(o,t)&&"MemberExpression"===(n=o).type&&function(e){let t=e.object,r=e.object.type;for(;"MemberExpression"===r;)r=(t=t.object).type;return"CallExpression"===r}(n)&&(yield r.insertTextBefore(o,"("),yield r.insertTextAfter(o,")"))}function sX(e,t,r,n){let[,o]=ti(t.object,r),[,a]=r.sourceCode.getRange(t);return e.replaceTextRange([o,a],n)}let sY=(e,t,r)=>sX(e,t,r,"");function*sZ(e,t,r){let n=t.callee;yield sY(e,n,r);let[,o]=ti(n,r),[,a]=r.sourceCode.getRange(t);yield e.removeRange([o,a])}function sQ(e,t,r,n=!1){let{sourceCode:o}=t,{lines:a}=o,i=e;if(n){let[t,r]=o.getLastTokens(e,2);eI(r)&&(i=t)}let s=o.getLoc(e).start,l=o.getLoc(i).end,u=a[s.line-1].slice(0,s.column),p=a[l.line-1].slice(l.column),[c]=o.getRange(e),[,d]=o.getRange(i);if(/^\s*$/.test(u)&&/^\s*$/.test(p)){d+=p.length;let{text:e}=o;0===(c=o.getIndexFromLoc({line:s.line,column:0}))?d+=e.startsWith("\r\n",d)?2:Math.min(1,e.length-d):c-=e.startsWith("\r\n",c-2)?2:1}return r.removeRange([c,d])}function s0(e,t,r,n){if(ik(e)||"AssignmentPattern"===e.parent.type&&e.parent.left===e&&ik(e.parent))return n.replaceText(e,`${e.name}: ${t}`);if(iD(e,r))return n.replaceText(e,`${e.name} as ${t}`);if(((e,t)=>{let{type:r,local:n,exported:o}=e.parent;return"ExportSpecifier"===r&&iC(n,o,t)&&n===e})(e,r))return n.replaceText(e,`${t} as ${e.name}`);if(e.typeAnnotation){let{sourceCode:o}=r;return o.getCommentsInside(e).length>0?n.replaceText(o.getFirstToken(e),t):n.replaceTextRange([o.getRange(e)[0],o.getRange(e.typeAnnotation)[0]],`${t}${e.optional?"?":""}`)}return n.replaceText(e,t)}let s1=(e,t,r,n)=>nN(e).map(e=>s0(e,t,r,n)),s2=(e,t,r,n)=>{let{tail:o}=e,[a,i]=r.sourceCode.getRange(e);return n.replaceTextRange([a+1,i-(o?1:2)],t)};function*s3(e,t,r,n,o){for(let t of ta(e,o?{sourceCode:o}:n))yield s3(t,"",r,n,o);let{sourceCode:a}=n,[i,s]=a.getRange(e),[l]=a.text.slice(0,i).match(/\s*$/),[u]=l.match(/(?:\r?\n|\r)?/);i-=l.length,yield r.replaceTextRange([i,s],`${u}${t}`)}let s5=(e,t,r,n)=>n.replaceTextRange([r.sourceCode.getRange(e)[0]+1,r.sourceCode.getRange(e)[1]-1],t),s8="require-array-join-separator",s9="no-thenable-object",s6="no-thenable-export",s4="no-thenable-class",s7=(e,t)=>rP(e,t)?.value,le=(e,t)=>"then"===s7(e,t),lt=(e,t)=>{let r="MemberExpression"===e.type?e.property:e.key;return"Literal"===r.type?"then"===r.value:e.computed||"Identifier"!==r.type?"then"===s7(r,t):"then"===r.name},lr="no-invalid-remove-event-listener",ln="consistent-function-scoping",lo=(e,t)=>e&&t&&(e===t||e.block===t.block),la=(e,t)=>e.some(e=>lo(e,t)),li=["useState","useEffect","useContext","useReducer","useCallback","useMemo","useRef","useImperativeHandle","useLayoutEffect","useDebugValue"].flatMap(e=>[e,`React.${e}`]),ls=new o(["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"]),ll=e=>e?.type==="BlockStatement"&&ls.has(e.parent.type)&&e.parent.body===e,lu=new o(["FunctionExpression","ArrowFunctionExpression"]),lp={create:e=>{let{checkArrowFunctions:t}=e.options[0],{sourceCode:r}=e,{scopeManager:n}=r;e.onExit(tI,e=>{if(("ArrowFunctionExpression"!==e.type||t)&&!function(e,t,r){let n,o,a,i=t.acquire(e);if(!i||(o=r.visitorKeys,"ArrowFunctionExpression"===e.type&&ah(e,o))||function(e){let t=e;for(;t.parent;){let{parent:e}=t;if("CallExpression"===e.type&&e.arguments[1]===t&&tI.includes(t.type)&&tq(e.callee,["jest.mock"]))return!0;t=e}return!1}(e))return!0;let s=e.parent;"VariableDeclarator"===s.type&&(s=s.parent),"VariableDeclaration"===s.type&&(s=s.parent),s?.type==="ReturnStatement"&&"ArrowFunctionExpression"===e.type&&(s=s.parent),s=function(e,t){if("ArrowFunctionExpression"===e.type&&"ArrowFunctionExpression"===t.type){let t=function(e){let t=e;for(;t&&"ArrowFunctionExpression"===t.type;)t=t.parent;return t}(e);t&&"ReturnStatement"===t.type&&"ReturnStatement"===(e=function(e){let t=e;for(;"ArrowFunctionExpression"===t.type;)t=t.parent;return t}(e)).type&&(e=e.parent)}return e}(s,e),s?.type==="BlockStatement"&&(n=s,s=s.parent);let l=t.acquire(s),u=function(e,t,r){let n=[];e&&n.push(e);let o=function(e){let t=[];for(;e?.type==="BlockStatement";){if(t.push(e),ll(e))return t;e=e.parent}return[]}(t);if(0===o.length)return n;let a=o.at(-1),i=r.acquire(a.parent);for(let e of(i&&n.push(i),o)){let t=r.acquire(e);t&&n.push(t)}return n}(l,n,t);return!!(0===u.length||u.some(e=>"global"===e.type)||l&&l.block?.parent?.callee&&tq(l.block.parent.callee,li)||l&&(a=s,lu.has(a.type)&&"CallExpression"===a.parent.type&&a.parent.callee===a))||nj(i).map(({resolved:e})=>e).filter(Boolean).some(e=>e.references.some(e=>{if(la(u,e.from))return!0;let{resolved:t}=e,[r]=t.defs;return(r?.type!=="FunctionName"||t.name!==r.name.name)&&la(u,t.scope)})||e.defs.some(e=>la(u,t.acquire(e.node)))||e.identifiers.some(e=>{if(!e.parent||"FunctionDeclaration"!==e.parent.type)return!1;let r=t.acquire(e.parent);return!lo(i,r)&&la(u,r.upper)}))}(e,n,r))return{node:e,loc:eP(e,r),messageId:ln,data:{functionNameWithKind:eG(e,r)}}})},meta:{type:"suggestion",docs:{description:"Move function definitions to the highest possible scope.",recommended:!0},schema:[{type:"object",additionalProperties:!1,properties:{checkArrowFunctions:{type:"boolean",description:"Whether to check arrow functions."}}}],defaultOptions:[{checkArrowFunctions:!0}],messages:{[ln]:"Move {{functionNameWithKind}} to the outer scope."},languages:["js/js"]}},lc="error",ld="error-unknown",lm="suggestion";function lf(e,t,r){return function*(n){if("alloc"===r)for(let r of e.arguments.slice(1).toReversed())yield sW(n,r,t);yield n.insertTextAfter(e.callee,`.${r}`),yield sJ(e,t,n)}}let lg="no-console-spaces",ly=e=>e.length>1&&" "===e.charAt(0)&&" "!==e.charAt(1),lh=e=>{if(!(e.length>1&&" "===e.at(-1)&&" "!==e.at(-2)))return!1;let t=0;for(let r=e.length-2;"\\"===e[r];r--)t++;return t%2==0},lx="no-empty-file",lb=(e,t=r2(e))=>t.some(t=>!r3(e,t)),lv=(e,t)=>({node:e.sourceCode.getDisableDirectives().directives[0]?.node??t,messageId:lx}),lE={create:e=>{let{allowComments:t}=e.options[0];if(e.filename!==e.physicalFilename)return;let r=e.sourceCode.parserServices?.isYAML;e.on("Program",n=>{if(r)return n.body.some(e=>(e=>{let{content:t}=e;return null!==t&&("YAMLWithMeta"!==t.type||null!==t.value)})(e))||t&&lb(e)&&0===n.tokens.length?void 0:lv(e,n);if(n.templateBody)return;if(1===n.body.length&&"Document"===n.body[0].type){let{children:r}=n.body[0];if(r.some(e=>"Comment"!==e.type&&("Text"!==e.type||""!==e.value.trim()))||t&&lb(e))return;return lv(e,n)}if(n.body.some(e=>!(tD(e,tC)||"TOMLTopLevelTable"===e.type&&0===e.body.length)))return;let{sourceCode:o}=e,a=r2(e);if(0!==o.ast.tokens.length||0!==a.length||""===o.text.trim()){if(!a.some(e=>"Line"===e.type&&e.value.startsWith("/"))&&(!(t&&lb(e)&&a.every(e=>"Line"===e.type||"Block"===e.type))||0!==o.ast.tokens.length))return lv(e,n)}}),e.on("StyleSheet",r=>{if(!(r.children.length>0)&&!(t&&lb(e)))return lv(e,r)}),e.on("Document",r=>{if(r.parent?.type!=="Program"&&(null===r.body||void 0===r.body)&&!(t&&lb(e)))return lv(e,r)}),e.on("root",r=>{let n=[];for(let t of r.children){if("html"!==t.type)return;let r=t.value.split("--\x3e");if(""!==r.pop().trim())return;let[o]=e.sourceCode.getRange(t);for(let e of r){let t=e.trimStart();if(!t.startsWith("\x3c!--"))return;let r=o+e.length+3;n.push({range:[o+e.length-t.length,r]}),o=r}}if(!(t&&lb(e,n)))return lv(e,r)})},meta:{type:"suggestion",docs:{description:"Disallow empty files.",recommended:"unopinionated"},schema:[{type:"object",additionalProperties:!1,properties:{allowComments:{type:"boolean",description:"Whether to allow files that only contain comments."}}}],defaultOptions:[{allowComments:!1}],messages:{[lx]:"Empty files are not allowed."},languages:["js/js","css/css","html/html","json/json","json/jsonc","json/json5","markdown/commonmark","markdown/gfm","toml/toml","yml/yaml"]}},lS="no-useless-fallback-in-spread",lT=e=>"BinaryExpression"===e.type&&"Literal"===e.right.type&&"0"===e.right.raw&&tL(e.left,{property:"length",optional:!1});function lC(e){return"AwaitExpression"===e.parent.type&&e.parent.argument===e?{expression:e.parent,parent:e.parent.parent,isAwaited:!0}:{expression:e,parent:e.parent,isAwaited:!1}}function lD(e,t){let r=e?t.sourceCode.getText(e):"";return e?.type==="SequenceExpression"?`(${r})`:r}let lw=new o([E.tokenTypes.Number,E.tokenTypes.Dimension,E.tokenTypes.Percentage]),lA=new o([...lw,E.tokenTypes.Ident,E.tokenTypes.Hash,E.tokenTypes.AtKeyword]),lk=new o([".","#","@"]);function lI(e,t){let{sourceCode:r}=t,n=r.getRange(e),o="Raw"===e.type?e:r.getParent(e)??e,a=r.getText(o),[i]=r.getRange(o),s=[],l=[];for(let[e,{type:t,start:r,end:o}]of(E.tokenize(a,(e,t,r)=>{l.push({type:e,start:t,end:r})}),l.entries())){if(!lw.has(t)||i+r<n[0]||i+o>n[1])continue;let[u]=a.slice(r,o).match(/^[+\-]?(?:\d*\.\d+|\d+)(?:e[+\-]?\d+)?/iv),p=l[e-1],c=l[e+1],d=p?.end===r&&(lA.has(p.type)||p.type===E.tokenTypes.Delim&&lk.has(a.slice(p.start,p.end)))||c?.start===o&&lA.has(c.type);s.push({raw:u,numberRange:[i+r,i+r+u.length],hasMergingNeighbor:d})}return s}let lj="zero-fraction",lR="dangling-dot",lF="leading-zero",lB="error",lL="suggestion",lN=Symbol.for("default"),lP=Symbol("NAMESPACE_SPECIFIER_NAME"),lM=e=>{switch(e.type){case"Identifier":return Symbol.for(e.name);case"Literal":return e.value}},l$=e=>"type"===e.exportKind||"type"===e.parent.exportKind;function*lO(e,t,r){switch(e.type){case"ImportSpecifier":case"ExportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":return void(yield function*(e,t,r,n=!1){let o=e.parent,{specifiers:a}=o;if(1===a.length&&!n)return void(yield t.remove(o));let{sourceCode:i}=r;switch(e.type){case"ImportSpecifier":if(a.every(t=>e===t||e.type!==t.type)){let r=i.getTokenAfter(e,e=>"Identifier"===e.type&&"from"===e.value),n=a.some(e=>"ImportDefaultSpecifier"===e.type),o=i.getTokenBefore(e,n?ek:eB),[s]=i.getRange(o),[l]=i.getRange(r),u=i.getTokenBefore(o),p=i.getRange(u)[1]===s;yield t.replaceTextRange([s,l],p?" ":"");return}case"ExportSpecifier":case"ImportNamespaceSpecifier":case"ImportDefaultSpecifier":{yield t.remove(e);let r=i.getTokenAfter(e);ek(r)&&(yield t.remove(r))}}}(e,t,r));case"ExportDefaultDeclaration":case"ExportNamedDeclaration":yield t.remove(e)}}function lU(e,t){let{sourceCode:r}=t,n=r.getTokenBefore(e.source,e=>"Identifier"===e.type&&"from"===e.value),[o]=r.getRange(n),[,a]=r.getRange(e);return r.text.slice(o,a)}let lq={create:function(e){let{sourceCode:t}=e,{checkUsedVariables:r}=e.options[0],n=new o,a=[];e.on("ImportDeclaration",e=>{e.specifiers.length>0&&n.add(e)}),e.on("ExportNamedDeclaration",e=>{tp(e.source)&&a.push(e)}),e.on("Program:exit",function*(o){for(let i of n){let n=t.getDeclaredVariables(i);if(n.some(e=>1!==e.defs.length||e.defs[0].parent!==i)||(n=n.map(e=>{let r=function(e,t){let r=e.defs[0].node,n={node:r,declaration:r.parent,variable:e,isTypeImport:iL(r)};switch(r.type){case"ImportDefaultSpecifier":return{name:lN,text:"default",...n};case"ImportSpecifier":return{name:lM(r.imported),text:t.getText(r.imported),...n};case"ImportNamespaceSpecifier":return{name:lP,text:"*",...n}}}(e,t),n=function(e,t){let r=[];for(let{identifier:n}of e.variable.references){let o=function(e,t){let{parent:r}=e;switch(r.type){case"ExportDefaultDeclaration":return{node:r,name:lN,text:"default",isTypeExport:l$(r)};case"ExportSpecifier":return{node:r,name:lM(r.exported),text:t.getText(r.exported),isTypeExport:l$(r)};case"VariableDeclarator":{let n=r.parent.parent;if(r.init===e&&"Identifier"===r.id.type&&!r.id.typeAnnotation&&"VariableDeclaration"===r.parent.type&&"const"===r.parent.kind&&1===r.parent.declarations.length&&r.parent.declarations[0]===r&&"ExportNamedDeclaration"===n.type&&function(e,t){let r=t.getDeclaredVariables(e);if(1!==r.length)return!1;let[{identifiers:n,references:o}]=r;return 1===n.length&&n[0]===e.id&&1===o.length&&o[0].identifier===e.id}(r,t))return{node:n,name:Symbol.for(r.id.name),text:t.getText(r.id),isJSDocumentComment:function(e,t){let r=t.getTokenBefore(e,{includeComments:!0});if(r?.type!=="Block"||!r.value.startsWith("*")||r.value.startsWith("**"))return!1;let n=t.getTokenBefore(r),o=t.getLoc(r).start,a=t.getLoc(r).end,i=t.getLoc(e).start;return(!n||t.getLoc(n).end.line<o.line)&&(a.line===i.line||a.line===i.line-1)}(n,t)}}}}(n,t);o&&(e.name!==lP||o.name!==lN)&&r.push(o)}return r}(r,t);return{variable:e,imported:r,exports:n}}),!r&&n.some(({variable:e,exports:t})=>e.references.length!==t.length)))continue;let s=!r&&n.some(({variable:e})=>0===e.references.length);for(let{imported:r,exports:i}of n)for(let n of function*(e){for(let t of e)t.isJSDocumentComment||(yield t)}(i)){let i={node:n.node,messageId:lB,data:{exported:n.text}},l="ExportSpecifier"===n.node.type?n.node.parent:n.node,u=[r.declaration,l].some(e=>t.getCommentsInside(e).length>0)?void 0:function({context:e,imported:t,exported:r,exportDeclarations:n,program:o}){let a,i=t.declaration,s=i.source.value,l=t.isTypeImport||r.isTypeExport;return l&&(a=n.find(({source:e,exportKind:t})=>"type"===t&&e.value===s)),a||=n.find(({source:e,exportKind:t})=>"type"!==t&&e.value===s),function*(n){if(t.name===lP)yield n.insertTextAfter(o,`${rX(e)}export ${l?"type ":""}* as ${r.text} ${lU(i,e)}`);else{let s=r.name===t.name?r.text:`${t.text} as ${r.text}`;if(l&&(!a||"type"!==a.exportKind)&&(s=`type ${s}`),a){let t=a.specifiers.at(-1);if(t)yield n.insertTextAfter(t,`, ${s}`);else{let t=e.sourceCode.getFirstToken(a,eB);yield n.insertTextAfter(t,s)}}else yield n.insertTextAfter(o,`${rX(e)}export {${s}} ${lU(i,e)}`)}let s=r.isTypeExport&&!t.isTypeImport;1!==t.variable.references.length||s||(yield lO(t.node,n,e)),yield lO(r.node,n,e)}}({context:e,imported:r,exported:n,exportDeclarations:a,program:o});s?u&&(i.suggest=[{messageId:lL,fix:u}]):i.fix=u,yield i}}})},meta:{type:"suggestion",docs:{description:"Prefer `export…from` when re-exporting.",recommended:!0},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkUsedVariables:{type:"boolean",description:"Whether to check variables that are used in the module."}}}],defaultOptions:[{checkUsedVariables:!0}],messages:{[lB]:"Use `export…from` to re-export `{{exported}}`.",[lL]:"Switch to `export…from`."},languages:["js/js"]}},lW="prefer-native-coercion-functions",lV="prefer-native-coercion-functions/suggestion",lz=new o(["String","Number","BigInt","Boolean","Symbol"]),l_=new o(["every","filter","find","findLast","findIndex","findLastIndex","some"]);function lJ(e){return"BlockStatement"!==e.body.type?rx(e.body):1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type?rx(e.body.body[0].argument):void 0}let lH=new o(["(","[","+","-"]),lK=new o(["RegularExpression","Template"]),lG=(e,t)=>{let r={[t]:!0};for(let t of e.split(".").toReversed())r={[t]:r};return r},lX=(e,t)=>{for(let r of Reflect.ownKeys(t)){let n=t[r];"object"==typeof n?(e[r]??={},lX(e[r],n)):e[r]=n}};class lY{static READ=te.READ;static CALL=te.CALL;static CONSTRUCT=te.CONSTRUCT;#n={};#e;#o;#a;constructor({object:e,objects:t=[e],type:r=te.READ,context:n,filter:o,handle:a}){for(let e of t)lX(this.#n,lG(e,r));this.#e=n,this.#o=o,this.#a=a}*#i(e,t){let r=t?.context??this.#e,n=t?.filter??this.#o,o=t?.handle??this.#a;for(let t of new te(e).iterateGlobalReferences(this.#n)){if(n&&!n(t))continue;let e=o(t,r);yield e}}listen(e){let t=e?.context??this.#e;t.onExit("Program",r=>this.#i(t.sourceCode.getScope(r),e))}}let lZ="no-document-cookie",lQ=new lY({object:"document.cookie",filter:({node:e})=>"AssignmentExpression"===e.parent.type&&e.parent.left===e,handle:({node:e})=>({node:e,messageId:lZ})}),l0=e=>[`webkit${e}`,`o${e.toLowerCase()}`,e.toLowerCase()],l1=new o(["click","rightclick","dblclick","auxclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","mousecancel","selectionchange","selectstart","wheel","keypress","keydown","keyup","blur","focus","deactivate","focusin","focusout","change","reset","select","submit","input","propertychange","dragstart","drag","dragenter","dragover","dragleave","drop","dragend","touchstart","touchmove","touchend","touchcancel","beforeunload","consolemessage","contextmenu","devicechange","devicemotion","deviceorientation","DOMContentLoaded","error","help","load","losecapture","orientationchange","readystatechange","resize","scroll","unload","canplay","canplaythrough","durationchange","emptied","ended","loadeddata","loadedmetadata","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","sourceopen","sourceended","sourceclosed","abort","update","updatestart","updateend","hashchange","pagehide","pageshow","popstate","copy","paste","cut","beforecopy","beforecut","beforepaste","online","offline","message","connect","install","activate","fetch","foreignfetch","messageerror","statechange","updatefound","controllerchange",...l0("AnimationStart"),...l0("AnimationEnd"),...l0("AnimationIteration"),...l0("TransitionEnd"),"pointerdown","pointerup","pointercancel","pointermove","pointerover","pointerout","pointerenter","pointerleave","gotpointercapture","lostpointercapture","MSGestureChange","MSGestureEnd","MSGestureHold","MSGestureStart","MSGestureTap","MSGotPointerCapture","MSInertiaStart","MSLostPointerCapture","MSPointerCancel","MSPointerDown","MSPointerEnter","MSPointerHover","MSPointerLeave","MSPointerMove","MSPointerOut","MSPointerOver","MSPointerUp","text","textinput","textInput","compositionstart","compositionupdate","compositionend","beforeinput","exit","loadabort","loadcommit","loadredirect","loadstart","loadstop","responsive","sizechanged","unresponsive","visibilitychange","storage","DOMSubtreeModified","DOMNodeInserted","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","DOMAttrModified","DOMCharacterDataModified","beforeprint","afterprint","beforeinstallprompt","appinstalled","afterblur","beforeblur","cancel","close","dragexit","encrypted","fullscreenchange","invalid","toggle","search","open","show"]),l2="prefer-add-event-listener",l3={create:e=>{let t,r,n=new o(e.options[0].excludedPackages),a=new i;e.on("onCodePathStart",(e,t)=>{r={node:t,upper:r,returnsSomething:!1}}),e.on("onCodePathEnd",()=>{a.set(r.node,r.returnsSomething),r=r.upper}),e.on("CallExpression",e=>{tO(e)&&!t&&n.has(e.arguments[0].value)&&(t=!0)}),e.on("Literal",e=>{"ImportDeclaration"===e.parent.type&&!t&&n.has(e.value)&&(t=!0)}),e.on("ReturnStatement",e=>{r.returnsSomething||=!!e.argument}),e.on("AssignmentExpression:exit",r=>{var n;let o;if(t)return;let{left:i,right:s,operator:l}=r;if("MemberExpression"!==i.type||i.computed)return;let u=i.property.name;if(!u||!u.startsWith("on"))return;let p=u.slice(2);if(!l1.has(p))return;let c="addEventListener",d="";if(tz(n=rx(n=s))||tg(n))c="removeEventListener";else if("beforeunload"===p&&("ArrowFunctionExpression"!==s.type&&"FunctionExpression"!==s.type||"BlockStatement"!==s.body.type||a.get(s)))d="Use `event.preventDefault(); event.returnValue = 'foo'` to trigger the prompt.";else if("message"===p)d="Note that there is difference between `SharedWorker#onmessage` and `SharedWorker#addEventListener('message')`.";else if("error"===p)d="Note that there is difference between `{window,element}.onerror` and `{window,element}.addEventListener('error')`.";else"="!==l||"ExpressionStatement"!==r.parent.type||r.parent.expression!==r||ay(s)||0!==e.sourceCode.getCommentsInside(r).length||e.sourceCode.ast.body.some(e=>(function e(t,r,n){if("AssignmentExpression"===t.type&&t!==n&&rf(t.left,r))return!0;for(let o of sf(t))if(e(o,r,n))return!0;return!1})(e,i,r))||(o=t=>((e,t,r,n)=>{let{sourceCode:o}=t,a=n.property.name.slice(2),i=o.getText(n.object);tl(n.object,t)&&(i=`(${i})`);let s=o.getText(r.right);tl(r.right,t)&&(s=`(${s})`);let l=`${i}.addEventListener('${a}', ${s})`;return e.replaceText(r,l)})(t,e,r,i));return{node:i.property,messageId:l2,data:{replacement:c,method:u,extra:d?` ${d}`:""},fix:o}})},meta:{type:"suggestion",docs:{description:"Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{excludedPackages:{type:"array",items:{type:"string"},uniqueItems:!0,description:"Packages to exclude from checking."}}}],defaultOptions:[{excludedPackages:["koa","sax"]}],messages:{[l2]:"Prefer `{{replacement}}` over `{{method}}`.{{extra}}"},languages:["js/js"]}},l5=new o(["false","true"]),l8=(e,t)=>e?.type==="BinaryExpression"&&"==="===e.operator&&(aE(e.left,t)||aE(e.right,t)),l9=({type:e,name:t},r)=>"Identifier"===e&&t===r;function l6({method:e,replacement:t,checkBooleanPredicate:r=!1}){let n=`prefer-${t}-over-${e}/`,o=`${n}error`,a=`${n}suggestion`;return{messages:{[o]:({findIndex:"Use `.indexOf()` instead of `.findIndex()` when looking for the index of an item.",findLastIndex:"Use `.lastIndexOf()` instead of `.findLastIndex() when looking for the index of an item.`",some:`Use \`.${t}()\` instead of \`.${e}()\` when checking value existence.`})[e],[a]:`Replace \`.${e}()\` with \`.${t}()\`.`},listen:function(n){let{sourceCode:i}=n,{scopeManager:s}=i;n.on("CallExpression",r=>{let l,u,p,c;if(!tP(r,{method:e,argumentsLength:1,optionalCall:!1})||!("ArrowFunctionExpression"===(p=r.arguments[0]).type&&!p.async&&1===p.params.length&&l8(p.body,p.params[0])||("ArrowFunctionExpression"===p.type||"FunctionExpression"===p.type)&&!p.async&&!p.generator&&1===p.params.length&&"BlockStatement"===p.body.type&&1===p.body.body.length&&"ReturnStatement"===p.body.body[0].type&&l8(p.body.body[0].argument,p.params[0]))||od(r.callee.object,n))return;let[d]=r.arguments,m="BinaryExpression"===d.body.type?d.body:d.body.body[0].argument,[f]=d.params,{left:g,right:y}=m,{name:h}=f;if(l9(g,h))l=y,u=g;else{if(!l9(y,h))return;l=g,u=y}if("some"===e&&(c=l,Number.isNaN(eJ(c,n.sourceCode.getScope(c))?.value)))return;let x=s.acquire(d);if(!x||eD(x,f).references.some(({identifier:e})=>e!==u)||function(e,t){if(t.block!==e)throw Error('"functionScope" should be the scope of "functionNode".');let{type:r,id:n}=e;return"ArrowFunctionExpression"!==r&&(!!(t.thisFound||nP(t,"arguments").some(({from:e})=>e===t))||!!(n&&nP(t,n).length>0))}(d,x))return;let b=r.callee.property,v={node:b,messageId:o,suggest:[]},E=function*(e,{abort:r}){i.getCommentsInside(d).length>0&&r();let o=i.getText(l);tl(l,n)&&!tl(d,n)&&(o=`(${o})`),yield e.replaceText(b,t),yield e.replaceText(d,o)};return e0(l,i)?v.suggest.push({messageId:a,fix:E}):v.fix=E,v}),r&&i.parserServices?.program&&n.on("CallExpression",r=>{if(!tP(r,{method:e,argumentsLength:1,optionalCall:!1}))return;let[n]=r.arguments;if("ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||1!==n.params.length||"Identifier"!==n.params[0].type)return;let[a]=n.params,{parserServices:s}=i;if(!function(e,t){let r="ArrowFunctionExpression"!==e.type||e.async||1!==e.params.length||"BlockStatement"===e.body.type?"ArrowFunctionExpression"!==e.type&&"FunctionExpression"!==e.type||e.async||e.generator||1!==e.params.length||"BlockStatement"!==e.body.type||1!==e.body.body.length||"ReturnStatement"!==e.body.body[0].type?void 0:e.body.body[0].argument:e.body;if(r){if(aE(r,t))return r;if("CallExpression"===r.type&&!r.optional&&l9(r.callee,"Boolean")&&1===r.arguments.length&&aE(r.arguments[0],t))return r.arguments[0]}}(n,a)||!function(e){if("boolean"===e.intrinsicName||"true"===e.intrinsicName)return!0;if(!e.isUnion())return!1;let t=e.types.map(e=>e.intrinsicName);return t.includes("true")&&t.every(e=>l5.has(e))}(s.getTypeAtLocation(a))||!function(e,t){if(e.isUnion())return!1;let r=t.program.getTypeChecker();return!!e.getProperty("includes")&&(r.isArrayType(e)||r.isTupleType(e))}(s.getTypeAtLocation(r.callee.object),s))return;let l=r.callee.property;return{node:l,messageId:o,*fix(e,{abort:r}){i.getCommentsInside(n).length>0&&r(),yield e.replaceText(l,t),yield e.replaceText(n,"true")}}})}}}let l4=l6({method:"findIndex",replacement:"indexOf"}),l7=l6({method:"findLastIndex",replacement:"lastIndexOf"}),ue={create(e){l4.listen(e),l7.listen(e)},meta:{type:"suggestion",docs:{description:"Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{...l4.messages,...l7.messages},languages:["js/js"]}},ut="error",ur="prefer-date",un="prefer-date-now-over-methods",uo="prefer-date-now-over-number-data-object",ua=e=>tT(e,{name:"Date",argumentsLength:0}),ui=(e,t,r)=>({node:e,messageId:ur,*fix(r,{abort:n}){t.sourceCode.getCommentsInside(e).length>0&&n(),yield r.replaceText(e,"Date.now()"),"UnaryExpression"===e.type&&(yield sK(r,e,t))},...r}),us="prefer-dataset",ul="prefer-dataset/suggestion",uu="prefer-attributes",up="prefer-attributes/suggestion",uc=e=>`data-${e.replaceAll(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`,ud=e=>tL(e,{property:"dataset"}),um=e=>e.computed||"Identifier"!==e.property.type?e.computed&&tp(e.property)?e.property.value:void 0:e.property.name,uf=new o(["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),ug=/[\s\u0000-\u001F"'/<=>]/,uy=e=>uf.has(e)||e.includes("-")||ug.test(e),uh={create:e=>{let{preferAttributes:t}=e.options[0];if(t){let{sourceCode:t}=e,r=(r,n,o)=>{if(uy(n.value)||oS(o.object,e))return;let a=se(o.object,e),i=o.optional?"?.":".",s=t5(uc(n.value),n.raw.charAt(0)),l=r9(e,r,[o.object])?void 0:n=>{let o=`${a}${i}hasAttribute(${s})`;return iB(t.getTokenBefore(r),e,o)&&(o=`;${o}`),n.replaceText(r,o)};return{node:r,messageId:uu,data:{method:"hasAttribute"},fix:l}};e.on("BinaryExpression",e=>{if("in"===e.operator&&tp(e.left)&&ud(e.right))return r(e,e.left,e.right)}),e.on("CallExpression",e=>tP(e,{object:"Object",method:"hasOwn",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&ud(e.arguments[0])&&tp(e.arguments[1])?r(e,e.arguments[1],e.arguments[0]):tP(e,{method:"hasOwnProperty",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&ud(e.callee.object)&&tp(e.arguments[0])?r(e,e.arguments[0],e.callee.object):void 0),e.on("VariableDeclarator",t=>{if(!(t.init&&ud(t.init)&&("ObjectPattern"===t.id.type||"Identifier"===t.id.type))||oS(t.init.object,e))return;let r=t.init;if("Identifier"===t.id.type){let n=function(e,t){let{sourceCode:r}=t,n=e.init,o=e.parent,[a]=r.getDeclaredVariables(e),i=function(e){let t=[];for(let r of e.references){if(r.init)continue;let{identifier:e}=r,n=e.parent;if("MemberExpression"!==n.type||n.object!==e||n.optional)return;let o=um(n);if(void 0===o||uy(o))return;let{parent:a}=n;if(ns(n)||"CallExpression"===a.type&&a.callee===n||"TaggedTemplateExpression"===a.type&&a.tag===n)return;t.push(n)}return t}(a);if(!(i&&i.length>0&&"const"===o.kind&&1===o.declarations.length&&!o.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==o.parent.type&&"Identifier"===n.object.type&&function(e,t,r){let{sourceCode:n}=r,{name:o}=e.object,a=e=>eD(n.getScope(e),o),i=a(e.object),s=t.some(e=>a(e)!==i),l=!!i?.references.some(e=>e.isWrite()&&!e.init);return!s&&!l}(n,i,t)&&!r9(t,o)&&i.every(e=>!r9(t,e))))return;let s=se(n.object,t);return function*(e){for(let r of(yield sQ(o,t,e),i)){let t=r.computed?r.property.raw.charAt(0):void 0,n=t5(uc(um(r)),t);yield e.replaceText(r,`${s}.getAttribute(${n})`)}}}(t,e);return{node:r,messageId:uu,data:{method:"getAttribute"},...n&&{suggest:[{messageId:up,fix:n}]}}}let{properties:n}=t.id;if(n.some(e=>"Property"===e.type&&(e.computed||"Identifier"!==e.key.type?!tp(e.key)||uy(e.key.value):uy(e.key.name))))return;let o=t.parent,a=se(r.object,e);if(n.length>0&&1===o.declarations.length&&!o.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==o.parent.type&&!r9(e,o,[r.object])&&n.every(e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type&&"Identifier"===e.value.type)&&(1===n.length||"Identifier"===r.object.type)){let r=rW(o,e),i=n.map(e=>{let t=t5(uc(e.key.name),"'");return`${o.kind} ${e.value.name} = ${a}.getAttribute(${t})`});return{node:t,messageId:uu,data:{method:"getAttribute"},suggest:[{messageId:up,fix:t=>t.replaceText(o,`${i.join(`;${rX(e)}${r}`)};`)}]}}return{node:r,messageId:uu,data:{method:"getAttribute"}}}),e.on("MemberExpression",r=>{let n,{object:o}=r;if(!ud(o)||oS(o.object,e))return;let a=um(r);if(void 0===a||uy(a)||r.optional)return;let i="ChainExpression"===r.parent.type?r.parent.parent:r.parent;if("CallExpression"===i.type&&i.callee===r||"TaggedTemplateExpression"===i.type&&i.tag===r||"UpdateExpression"===i.type||"AssignmentExpression"===i.type&&i.left===r&&"="!==i.operator)return;let s="AssignmentExpression"===i.type&&i.left===r,l="UnaryExpression"===i.type&&"delete"===i.operator;if(ns(r)&&!s&&!l)return;let u=s?"setAttribute":l?"removeAttribute":"getAttribute",p=se(o.object,e),c=o.optional?"?.":".",d=r.computed?r.property.raw.charAt(0):void 0,m=t5(uc(a),d);if(s&&iI(i)&&!r9(e,i,[o.object,i.right]))n=t=>t.replaceText(i,`${p}${c}setAttribute(${m}, ${ts(i.right,e)})`);else if(l&&tk(i.parent)&&!r9(e,i,[o.object]))n=r=>{let n=`${p}${c}removeAttribute(${m})`;return iB(t.getTokenBefore(i),e,n)&&(n=`;${n}`),r.replaceText(i,n)};else if(!s&&!l&&!r9(e,r,[o.object]))return{node:r,messageId:uu,data:{method:u},suggest:[{messageId:up,fix:e=>e.replaceText(r,`${p}${c}getAttribute(${m})`)}]};return{node:r,messageId:uu,data:{method:u},fix:n}});return}e.on("CallExpression",t=>{if(!((tP(t,{method:"setAttribute",argumentsLength:2,optionalCall:!1,optionalMember:!1})||tP(t,{methods:["removeAttribute","hasAttribute"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tP(t,{method:"getAttribute",argumentsLength:1,optionalCall:!1}))&&tp(t.arguments[0])))return;let r=t.callee.object;if(oS(r,e)||"Identifier"===r.type&&"document"===r.name&&rg(r,e))return;let n=t.callee.property.name,o="ChainExpression"===t.parent.type?t.parent:t;if("AwaitExpression"===o.parent.type&&o.parent.argument===o&&"getAttribute"===n||!t.arguments[0].value.toLowerCase().startsWith("data-"))return;let a={node:t,messageId:us,data:{method:n}},i=function(e,t){let r=e.callee.property.name;if("setAttribute"===r&&nu(e.callee)||"setAttribute"===r&&!iI(e)||"removeAttribute"===r&&!tk(e.parent))return;let n=[e.callee.object];if("setAttribute"===r&&n.push(e.arguments[1]),!r9(t,e,n))return n=>{let[o]=e.arguments,a=o.value.toLowerCase().slice(5).replaceAll(/-[a-z]/g,e=>e[1].toUpperCase()),i="",s=`${se(e.callee.object,t)}${e.callee.optional?"?":""}.dataset`;switch(r){case"setAttribute":case"getAttribute":case"removeAttribute":i=r1(a)?`.${a}`:`[${t5(a,o.raw.charAt(0))}]`,i=`${s}${i}`,"setAttribute"===r?i+=` = ${ts(e.arguments[1],t)}`:"removeAttribute"===r&&(i=`delete ${i}`);break;case"hasAttribute":i=`Object.hasOwn(${s}, ${t5(a,o.raw.charAt(0))})`}return n.replaceText(e,i)}}(t,e);return i&&("getAttribute"===n?a.suggest=[{messageId:ul,fix:i}]:a.fix=i),a})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for DOM element dataset access.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{preferAttributes:{type:"boolean",description:"Prefer attribute methods over named `.dataset` access."}}}],defaultOptions:[{preferAttributes:!1}],messages:{[us]:"Prefer `.dataset` over `{{method}}(…)`.",[ul]:"Switch to `.dataset`.",[uu]:"Prefer `.{{method}}(…)` over `.dataset`.",[up]:"Switch to `getAttribute()`."},languages:["js/js"]}},ux="prefer-modern-math-apis",ub=(e,t)=>"MemberExpression"===e.type&&!e.optional&&!e.computed&&"Identifier"===e.object.type&&"Math"===e.object.name&&"Identifier"===e.property.type&&e.property.name===t,uv=(e,t)=>"CallExpression"===e.type&&!e.optional&&ub(e.callee,t)&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type;function uE({constantName:e,replacementMethod:t}){let r=`Math.${t}(…)`;return function(n,o){let a,i;if("BinaryExpression"!==n.type||"*"!==n.operator||(uv(n.left,"log")&&ub(n.right,e)?(a=n.left,i=`Math.log(…) * Math.${e}`):uv(n.right,"log")&&ub(n.left,e)&&(a=n.right,i=`Math.${e} * Math.log(…)`),!a))return;let[s]=a.arguments;return{node:n,messageId:ux,data:{replacement:r,description:i},fix:r9(o,n,[ti(s,o)])?void 0:e=>e.replaceText(n,`Math.${t}(${ts(s,o)})`)}}}function uS({constantName:e,replacementMethod:t}){let r={messageId:ux,data:{replacement:`Math.${t}(…)`,description:`Math.log(…) / Math.${e}`}};return function(n,o){if(!("BinaryExpression"===n.type&&"/"===n.operator&&uv(n.left,"log")&&ub(n.right,e)))return;let[a]=n.left.arguments;return{...r,node:n,fix:r9(o,n,[ti(a,o)])?void 0:e=>e.replaceText(n,`Math.${t}(${ts(a,o)})`)}}}let uT=[uE({constantName:"LOG10E",replacementMethod:"log10"}),uE({constantName:"LOG2E",replacementMethod:"log2"}),uS({constantName:"LN10",replacementMethod:"log10"}),uS({constantName:"LN2",replacementMethod:"log2"})],uC=e=>"BinaryExpression"===e.type&&"+"===e.operator?[e.left,e.right].flatMap(e=>uC(e)):[e],uD="number-literal-case",uw=(e,{hexadecimalValue:t})=>e.toLowerCase().replace(/0x([\d_a-f]+)/v,(e,r)=>"0x"+r["lowercase"===t?"toLowerCase":"toUpperCase"]()),uA={create:i2(e=>{let t=e.options[0];e.on(["Literal","TOMLValue","Number","YAMLScalar"],r=>{let n=e.sourceCode.getText(r),o=n;if(!tm(r)&&("Number"!==r.type||"number"!=typeof r.value||/^[+\-]?[IN]/v.test(n))&&("YAMLScalar"!==r.type||"number"!=typeof r.value||r.parent.tag||/^[+-]?\.(?:inf|nan)$/i.test(n))&&("TOMLValue"!==r.type||"integer"!==r.kind&&"float"!==r.kind)?ty(r)&&(o=uw(n.slice(0,-1),t)+"n"):o=uw(n,t),n!==o)return{node:r,messageId:uD,fix:e=>e.replaceText(r,o)}}),e.on(["Number","Dimension","Percentage","Raw"],function*(t){if("StyleSheet"===e.sourceCode.ast.type)for(let{raw:r,numberRange:n}of lI(t,e)){let t=r.toLowerCase();t!==r&&(yield{loc:sp(n,e),messageId:uD,fix:e=>e.replaceTextRange(n,t)})}})}),meta:{type:"suggestion",docs:{description:"Enforce proper case for numeric literals.",recommended:!0},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{hexadecimalValue:{enum:["uppercase","lowercase"]}}}],defaultOptions:[{hexadecimalValue:"uppercase"}],messages:{[uD]:"Invalid number literal casing."},languages:["js/js","yml/yaml","toml/toml","json/json","json/jsonc","json/json5","css/css"]}},uk="error",uI="suggestion",uj={parseInt:!0,parseFloat:!0,NaN:!0,Infinity:!0,isNaN:!1,isFinite:!1},uR=e=>{let{parent:t}=e;return"UnaryExpression"===t.type&&"-"===t.operator&&t.argument===e};function uF(e,t){let{sourceCode:r}=t,{node:n,path:o}=e,[a]=o,{parent:i}=n,s=a;"Infinity"===a&&(s=uR(n)?"NEGATIVE_INFINITY":"POSITIVE_INFINITY");let l={node:n,messageId:uk,data:{description:a,property:s}};if("NEGATIVE_INFINITY"===s)return l.node=i,l.data.description="-Infinity",0===r.getCommentsInside(i).length&&(l.fix=function*(e){yield e.replaceText(i,"Number.NEGATIVE_INFINITY"),yield sK(e,i,t)}),l;let u=e=>s0(n,`Number.${s}`,t,e);return uj[a]||((e,t)=>{let{parent:r}=e;if("CallExpression"!==r.type||r.callee!==e||1!==r.arguments.length)return!1;let[n]=r.arguments;return"SpreadElement"!==n.type&&oO(n,t)})(n,t)?l.fix=u:l.suggest=[{messageId:uI,fix:u}],l}let uB={create:e=>{let{checkInfinity:t,checkNaN:r}=e.options[0];new lY({objects:Object.keys(uj).filter(e=>(t||"Infinity"!==e)&&(r||"NaN"!==e)),context:e,handle:uF,filter(t){let{node:r,path:n}=t,[o]=n;return!ns(r)&&!("Infinity"===o&&(e=>{if(!uR(e))return!1;let{parent:t}=e,{parent:r}=t;return"UnaryExpression"===r.type&&"delete"===r.operator&&r.argument===t})(r))&&!("parseInt"===o&&function(e,t){let{parent:r}=e;if("CallExpression"!==r.type||r.callee!==e)return!1;let n=r.arguments[1];if(!n)return!0;if("SpreadElement"===n.type)return!1;let o=rN(n,t);return o?.value===10}(r,e))}}).listen()},meta:{type:"suggestion",docs:{description:"Prefer `Number` static methods over global functions and optionally static properties over global constants.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkInfinity:{type:"boolean",description:"Whether to check usage of the global `Infinity`."},checkNaN:{type:"boolean",description:"Whether to check usage of the global `NaN`."}}}],defaultOptions:[{checkInfinity:!1,checkNaN:!1}],messages:{[uk]:"Prefer `Number.{{property}}` over `{{description}}`.",[uI]:"Replace `{{description}}` with `Number.{{property}}`."},languages:["js/js"]}},uL="prefer-reflect-apply",uN=(e,t)=>(tg(e)||"ThisExpression"===e.type)&&("ArrayExpression"===t.type||"Identifier"===t.type&&"arguments"===t.name),uP=(e,t,r,n)=>`Reflect.apply(${"SequenceExpression"===e.type?ts(e,n):n.sourceCode.getText(e)}, ${n.sourceCode.getText(t)}, ${n.sourceCode.getText(r)})`,uM="prefer-set-size";var u$={exports:{}},uO=sa(function(){var e,t,r,n;return m?u$.exports:(m=1,r=String.fromCodePoint||(e=String.fromCharCode,t=Math.floor,function(){var r,n,o=[],a=-1,i=arguments.length;if(!i)return"";for(var s="";++a<i;){var l=Number(arguments[a]);if(!isFinite(l)||l<0||l>1114111||t(l)!=l)throw RangeError("Invalid code point: "+l);l<=65535?o.push(l):(l-=65536,r=(l>>10)+55296,n=l%1024+56320,o.push(r,n)),(a+1==i||o.length>16384)&&(s+=e.apply(null,o),o.length=0)}return s}),n={parse:function(e,t,n){function o(t,r){return t.range[0]=r,t.raw=e.substring(r,t.range[1]),t}function a(t,r){return{type:"anchor",kind:t,range:[Y-r,Y],raw:e.substring(Y-r,Y)}}function i(t,r,n,o){return{type:"value",kind:t,codePoint:r,range:[n,o],raw:e.substring(n,o)}}function s(e,t,r,n){return n=n||0,i(e,t,Y-(r.length+n),Y)}function l(e){var t,r=e[0],n=r.charCodeAt(0);return X&&1===r.length&&n>=55296&&n<=56319&&(t=h().charCodeAt(0))>=56320&&t<=57343?i("symbol",(n-55296)*1024+t-56320+65536,++Y-2,Y):i("symbol",n,Y-1,Y)}function u(t,r,n,o,a){return null==o&&(n=Y-1,o=Y),{type:"quantifier",min:t,max:r,greedy:!0,body:null,symbol:a,range:[n,o],raw:e.substring(n,o)}}function p(t,r,n,o){return{type:"characterClass",kind:t.kind,body:t.body,negative:r,range:[n,o],raw:e.substring(n,o)}}function c(t,r,n,o){return t.codePoint>r.codePoint&&V("invalid range in character class",t.raw+"-"+r.raw,n,o),{type:"characterClassRange",min:t,max:r,range:[n,o],raw:e.substring(n,o)}}function d(e){return"alternative"===e.type?e.body:[e]}function m(e){Y+=e=e||1}function f(e){g(e)||V("character",e)}function g(t){var r=t.length;if(e.substring(Y,Y+r)===t)return m(r),t}function y(t){if(e[Y]===t)return Y++,t}function h(){return e[Y]}function x(t){return e[Y]===t}function b(t){return e[Y+1]===t}function v(t){var r=e.substring(Y).match(t);return r&&(Y+=r[0].length),r}function E(){var t,r=[],n=Y;for(r.push(S());y("|");)r.push(S());return 1===r.length?r[0]:{type:"disjunction",body:r,range:[n,t=Y],raw:e.substring(n,t)}}function S(){for(var t,r,s=[],u=Y;r=function(){if(Y>=e.length||x("|")||x(")"))return null;var t,r=function(){switch(h()){case"^":return m(),a("start",1);case"$":return m(),a("end",1);case"\\":if(b("b"))return m(2),a("boundary",2);if(b("B"))return m(2),a("not-boundary",2);break;case"(":return T("(?=","lookahead","(?!","negativeLookahead");default:return}}();if(r){var s=Y;if(t=D()||!1){if(!X&&"group"===r.type)return t.body=d(r),o(t,r.range[0]),t;Y=s,V("Expected atom")}return r}var u=function(){var t;switch(t=h()){case".":return m(),{type:"dot",range:[Y-1,Y],raw:"."};case"\\":if(m(),!(t=A())){if(!X&&"c"==h())return i("symbol",92,Y-1,Y);V("atomEscape")}return t;case"[":return P();case"(":if(n.lookbehind&&(t=T("(?<=","lookbehind","(?<!","negativeLookbehind")))return t;if(n.namedGroups&&g("(?<")){var r=F();f(">");var o=C("normal",r.range[0]-3);return o.name=r,o}if(n.modifiers&&"(?"===e.substring(Y,Y+2)&&":"!=e[Y+2])return function(){var e,t=Y;m(2);var r=v(/^[sim]+/);y("-")&&":"!==h()?(e=v(/^[sim]+/))||V("Invalid flags for modifiers group"):r||V("Invalid flags for modifiers group");var n=(r=r?r[0]:"")+(e=e?e[0]:"");(n.length>3||function(e){for(var t=0;t<e.length;){if(-1!=e.indexOf(e[t],t+1))return!0;t++}return!1}(n))&&V("flags cannot be duplicated for modifiers group"),y(":")||V("Invalid flags for modifiers group");var o=C("ignore",t);return o.modifierFlags={enabling:r,disabling:e},o}();return T("(?:","ignore","(","normal");case"]":case"}":if(!X)return m(),l(t);break;case"^":case"$":case"*":case"+":case"?":case"{":case")":case"|":break;default:return m(),l(t)}}();if(u||(s=Y,(t=D()||!1)&&(Y=s,V("Expected atom")),!X&&y("{")?u=l("{"):V("Expected atom")),t=D()||!1){var p=u.type,c=u.behavior;return"group"===p&&("negativeLookbehind"===c||"lookbehind"===c)&&V("Invalid quantifier","",t.range[0],t.range[1]),t.body=d(u),o(t,u.range[0]),t}return u}();)s.push(r);return 1===s.length?s[0]:{type:"alternative",body:s,range:[u,t=Y],raw:e.substring(u,t)}}function T(e,t,r,n){var o,a=Y;if(g(e))o=t;else{if(!g(r))return!1;o=n}return C(o,a)}function C(t,r){var n,o=E();o||V("Expected disjunction"),f(")");var a={type:"group",behavior:t,body:d(o),range:[r,n=Y],raw:e.substring(r,n)};return"normal"==t&&J&&_++,a}function D(){var e,t,r,n,o=Y;switch(h()){case"*":m(),e=u(0,void 0,void 0,void 0,"*");break;case"+":m(),e=u(1,void 0,void 0,void 0,"+");break;case"?":m(),e=u(0,1,void 0,void 0,"?");break;case"{":(n=v(/^\{(\d+)\}/))?e=u(t=parseInt(n[1],10),t,o,Y):(n=v(/^\{(\d+),\}/))?e=u(t=parseInt(n[1],10),void 0,o,Y):(n=v(/^\{(\d+),(\d+)\}/))&&((t=parseInt(n[1],10))>(r=parseInt(n[2],10))&&V("numbers out of order in {} quantifier","",o,Y),e=u(t,r,o,Y)),(t&&!Number.isSafeInteger(t)||r&&!Number.isSafeInteger(r))&&V("iterations outside JS safe integer range in quantifier","",o,Y)}return e&&y("?")&&(e.greedy=!1,e.range[1]+=1),e}function w(t,r){if(r){var n,o;if("unicodeEscape"==t.kind&&(n=t.codePoint)>=55296&&n<=56319&&x("\\")&&b("u")){var a=Y;Y++;var i=A(!0);"unicodeEscape"==i.kind&&(o=i.codePoint)>=56320&&o<=57343?(t.kind="unicodeCodePointEscape",t.codePoint=(n-55296)*1024+o-56320+65536,t.range[1]=Y,t.raw=e.substring(t.range[0],Y)):Y=a}}return t}n||(n={});function A(t){var r,a,i,u,p=Y;switch(u=h()){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return function(t){var r,n,a=Y;if(r=v(/^(?!0)\d+/)){var i,u,p=parseInt(n=r[0],10);if(p<=_&&!t)return u=Y-1-(i=n).length,{type:"reference",matchIndex:parseInt(i,10),range:[u,Y],raw:e.substring(u,Y)};if(z.push(p),J?H=!0:k(a,Y),m(-n.length),r=v(/^[0-7]{1,3}/))return s("octal",parseInt(r[0],8),r[0],1);var c=Y;return o(r=l(v(/^[89]/)),c-1)}return!!(r=v(/^[0-7]{1,3}/))&&((("0"!==(n=r[0])||/\d/.test(h()))&&k(a,Y),/^0{1,3}$/.test(n))?s("null",0,"0",n.length):s("octal",parseInt(n,8),n,1))}(t);case"B":if(!t)return N();V("\\B not possible inside of CharacterClass","",p);break;case"b":if(t)return m(),s("singleEscape",8,"\\b");return N();case"c":if(t){if(!X&&(i=v(/^c(\d)/)))return s("controlLetter",i[1].charCodeAt(0)%32,i[1],2);else if(!X&&g("c_"))return s("controlLetter",31,"_",2)}return j();case"d":case"D":case"w":case"W":case"s":case"S":return m(),{type:"characterClassEscape",value:u,range:[Y-2,Y],raw:e.substring(Y-2,Y)};case"k":return function(){if(n.namedGroups&&v(/^k<(?=.*?>)/)){var t,r=F();return f(">"),t=r.range[0]-3,{type:"reference",name:r,range:[t,Y],raw:e.substring(t,Y)}}}()||N();case"p":case"P":return a=Y,!!(n.unicodePropertyEscape&&X&&(r=v(/^([pP])\{([^}]+)\}/)))&&{type:"unicodePropertyEscape",negative:"P"===r[1],value:r[2],range:[a-1,Y],raw:e.substring(a-1,Y)}||N();case"-":if(t&&X)return m(),s("singleEscape",45,"\\-");return N();default:return j()}}function k(e,t){X&&V("Invalid decimal escape in unicode mode",null,e,t)}function I(e){var t;return(t=v(/^u([0-9a-fA-F]{4})/))?w(s("unicodeEscape",parseInt(t[1],16),t[1],2),e):e&&(t=v(/^u\{([0-9a-fA-F]+)\}/))?s("unicodeCodePointEscape",parseInt(t[1],16),t[1],4):void 0}function j(){var e,t=Y;switch(h()){case"t":return m(),s("singleEscape",9,"\\t");case"n":return m(),s("singleEscape",10,"\\n");case"v":return m(),s("singleEscape",11,"\\v");case"f":return m(),s("singleEscape",12,"\\f");case"r":return m(),s("singleEscape",13,"\\r");case"c":if(e=v(/^c([a-zA-Z])/))return s("controlLetter",e[1].charCodeAt(0)%32,e[1],2);break;case"0":if(v(/^0(?!\d)/))return s("null",0,"0",1);break;case"x":if(e=v(/^x([0-9a-fA-F]{2})/))return s("hexadecimalEscape",parseInt(e[1],16),e[1],2);break;case"u":if(e=I(X))return(!e||e.codePoint>1114111)&&V("Invalid escape sequence",null,t,Y),e}return N()}function R(t){var n=h(),o=Y;if("\\"===n){m();var a=I(!0);return a&&t(a.codePoint)||V("Invalid escape sequence",null,o,Y),r(a.codePoint)}var i=n.charCodeAt(0);if(i>=55296&&i<=56319){var s=(n+=e[Y+1]).charCodeAt(1);s>=56320&&s<=57343&&(i=(i-55296)*1024+s-56320+65536)}if(t(i))return m(),i>65535&&m(),n}function F(){var t,r=Y,n=R(B);for(n||V("Invalid identifier");t=R(L);)n+=t;return{type:"identifier",value:n,range:[r,Y],raw:e.substring(r,Y)}}function B(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=128&&/[\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\u0558\u0559\u0560-\u0588\u058B\u058C\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\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\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\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\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\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\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\u208F-\u209F\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\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\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DD\uA7E2\uA7F1-\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-\uAB69\uAB6C\uAB6D\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBF]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDED9-\uDEEE\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDF0A\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDDF1\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6F\uDC75-\uDD43\uDD50-\uDE86]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C\uD8B4-\uD8BE][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2-\uDFF6]|\uD823[\uDC00-\uDCDA\uDCFF-\uDD20\uDD80-\uDDF2\uDE00-\uDFFF]|\uD824[\uDC00-\uDD91\uDDA0-\uDDD2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD28\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD68\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA6\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF81\uDF90-\uDF96\uDFCD-\uDFFF]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1E\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]|\uD8BF[\uDC00-\uDC3F]/.test(r(e))}function L(e){return B(e)||e>=48&&e<=57||e>=128&&/[\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05C9\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B53-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1AF0\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDD30-\uDD39\uDD40-\uDD49\uDD69-\uDD6D\uDEAB\uDEAC\uDECB-\uDECF\uDEF0-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC66-\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDCF0-\uDCF9\uDD00-\uDD02\uDD27-\uDD34\uDD36-\uDD3F\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE-\uDDD9\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDFB8-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD0\uDFD2\uDFE1\uDFE2]|\uD805[\uDC35-\uDC46\uDC50-\uDC59\uDC5E\uDCB0-\uDCC3\uDCD0-\uDCD9\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDE50-\uDE59\uDEAB-\uDEB7\uDEC0-\uDEC9\uDED0-\uDEE3\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC2C-\uDC3A\uDCE0-\uDCE9\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDD50-\uDD59\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99\uDF60-\uDF67\uDFF0-\uDFF9]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC50-\uDC59\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD50-\uDD59\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDDA0-\uDDA9\uDDE0-\uDDE9\uDDF0\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42\uDF50-\uDF5A]|\uD80D[\uDC40\uDC47-\uDC55]|\uD818[\uDD1E-\uDD39]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDEF0-\uDEF4\uDF30-\uDF36\uDF50-\uDF59]|\uD81B[\uDD70-\uDD79\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDCF0-\uDCF9\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44\uDE50-\uDE52\uDE5B\uDE5C\uDE5F\uDE80\uDE81]|\uD835[\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDD40-\uDD49\uDEAE\uDEEC-\uDEF9]|\uD839[\uDCEC-\uDCF9\uDDEE\uDDEF\uDDF1-\uDDFA\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9]|\uDB40[\uDD00-\uDDEF]/.test(r(e))}function N(){var t,r=h();return X&&/[\^$.*+?()\\[\]{}|/]/.test(r)||!X&&"c"!==r?"k"===r&&n.lookbehind?null:s("identifier",(t=e.substring(Y,Y+=1)).charCodeAt(0),t,1):null}function P(){var e,t=Y;return g("[^")?(e=M(),f("]"),p(e,!0,t,Y)):y("[")?(e=M(),f("]"),p(e,!1,t,Y)):null}function M(){var e;return x("]")?{kind:"union",body:[]}:G?function(){var e,t=[],r=O(!0);for(t.push(r),e="characterClassRange"===r.type?"union":x("&")?"intersection":x("-")?"subtraction":"union";!x("]");)"intersection"===e?(f("&"),f("&"),x("&")&&V("&& cannot be followed by &. Wrap it in brackets: &&[&].")):"subtraction"===e&&(f("-"),f("-")),t.push(r=O("union"===e));return{kind:e,body:t}}():((e=function(){var e,t,r,n,o,a,i=[],s=[];do(e=$())||V("classAtom"),x("-")&&!b("]")?(m(),r=l("-"),(t=$())||V("classAtom"),s.push(i.length),i.push({atom:e,dash:r,atomTo:t,from:e.range[0],to:Y})):i.push(e);while(!x("]"));for(o=s.length-1;o>=0;o--)"codePoint"in(n=i[s[o]]).atom&&"codePoint"in n.atomTo?i[s[o]]=c(n.atom,n.atomTo,n.from,n.to):X?V("invalid character class"):i[s[o]]=[n.atom,n.dash,n.atomTo];var u=[];for(o=0;o<i.length;o++){var p=i[o];if(Array.isArray(p))for(a=0;a<p.length;a++)u.push(p[a]);else u.push(p)}return u}())||V("nonEmptyClassRanges"),{kind:"union",body:e})}function $(){return y("-")?l("-"):function(){var e;switch(e=h()){case"\\":if(m(),!(e=A(!0))){if(!X&&"c"==h())return l("\\");V("classEscape")}return w(e,X);case"]":case"-":break;default:return m(),l(e)}}()}function O(t){var r,n,o=Y;if(y("\\"))if(g("q{"))return function(){var t,r=Y-3,n=[];do n.push(function(){for(var t,r,n=[],o=Y;r=U();)n.push(r);return{type:"classString",characters:n,range:[o,t=Y],raw:e.substring(o,t)}}());while(y("|"));return f("}"),{type:"classStrings",strings:n,range:[r,t=Y],raw:e.substring(r,t)}}();else if(n=A(!0))r=n;else{if(n=W())return n;V("Invalid escape","\\"+h(),o)}else if(n=q())r=n;else{if(n=P())return n;V("Invalid character",h())}if(t&&x("-")&&!b("-")){if(m(),n=U())return c(r,n,o,Y);V("Invalid range end",h())}return r}function U(){if(y("\\")){var e,t=Y;if(e=W())return e;V("Invalid escape","\\"+h(),t)}return q()}function q(){var e;if(v(/^(?:&&|!!|##|\$\$|%%|\*\*|\+\+|,,|\.\.|::|;;|<<|==|>>|\?\?|@@|\^\^|``|~~)/)&&V("Invalid set operation in character class"),e=v(/^[^()[\]{}/\-\\|]/))return l(e)}function W(){var e;if(y("b"))return s("singleEscape",8,"\\b");if(y("B"))V("\\B not possible inside of ClassContents","",Y-2);else if(e=v(/^[&\-!#%,:;<=>@`~]/))return s("identifier",e[0].codePointAt(0),e[0]);else if(e=j())return e;else return null}function V(t,r,n,o){n=null==n?Y:n,o=null==o?n:o;var a=Math.max(0,n-10),i=Math.min(o+10,e.length),s=" "+e.substring(a,i),l=" "+Array(n-a+1).join(" ")+"^";throw SyntaxError(t+" at position "+n+(r?": "+r:"")+"\n"+s+"\n"+l)}var z=[],_=0,J=!0,H=!1,K=-1!==(t||"").indexOf("u"),G=-1!==(t||"").indexOf("v"),X=K||G,Y=0;if(G&&!n.unicodeSet)throw Error('The "v" flag is only supported when the .unicodeSet option is enabled.');if(K&&G)throw Error('The "u" and "v" flags are mutually exclusive.');""===(e=String(e))&&(e="(?:)");var Z=E();return(Z.range[1]!==e.length&&V("Could not parse entire input - got stuck","",Z.range[1]),H=H||z.some(function(e){return e<=_}))?(Y=0,J=!1,E()):Z}},u$.exports?u$.exports=n:window.regjsparser=n,u$.exports)}());let uU=String.raw`\$&`,uq=new o(String.raw`\^$.*+?()[]{}|/-`),{parse:uW}=uO,uV="method",uz="pattern",u_="split-join",uJ=new o(["i","y"]),uH=new o(["anchor","reference"]),uK=e=>String.raw`\u{${e.toString(16).toUpperCase()}}`;function uG(e){let{kind:t,codePoint:r,raw:n}=e;if("controlLetter"===t)return 13===r?String.raw`\r`:10===r?String.raw`\n`:9===r?String.raw`\t`:uK(r);if("null"===t||"octal"===t)return uK(r);let o=n;return(("identifier"===t||"symbol"===t&&n.length>1&&n.startsWith("\\"))&&(o=o.slice(1)),"'"===o||"\\"===o)?`\\${o}`:o}function uX(e){return"value"===e.type?uG(e):"characterClass"!==e.type||e.negative||1!==e.body.length||"value"!==e.body[0].type?"quantifier"===e.type&&1===e.min&&1===e.max||"group"===e.type&&"ignore"===e.behavior?uY(e.body):void 0:uG(e.body[0])}function uY(e){let t=[];for(let r of e){let e=uX(r);if(void 0===e)return;t.push(e)}return t.join("")}let uZ=e=>{let{pattern:t,flags:r}=e.regex;try{return uW(t,r,{unicodePropertyEscape:r.includes("u")||r.includes("v"),unicodeSet:r.includes("v"),namedGroups:!0,lookbehind:!0})}catch{}},uQ=e=>{let t=0;for(let r of e)t+=u0(r);return t};function u0(e){return uH.has(e.type)?0:["value","dot","characterClass","characterClassEscape","unicodePropertyEscape"].includes(e.type)?1:"alternative"===e.type?uQ(e.body):"disjunction"===e.type?Math.min(...e.body.map(e=>u0(e))):"quantifier"===e.type?e.min*uQ(e.body):"ignore"===e.behavior?uQ(e.body):0}let u1=e=>"group"===e.type&&"normal"===e.behavior||Array.isArray(e.body)&&e.body.some(e=>u1(e)),u2=e=>tm(e)&&Number.isSafeInteger(e.value)&&e.value>=0,u3=(e,t)=>{if("BinaryExpression"===e.type&&"+"===e.operator&&(rf(e.left,t)&&tu(e.right,1)||tu(e.left,1)&&rf(e.right,t)))return t},u5=(e,t)=>{if(e0(e,t.sourceCode))return;let r=ts(e,t);return!tl(e,t)&&("LogicalExpression"===e.type||12>i8(e))&&(r=`(${r})`),`${r} === undefined ? Infinity : ${r}`},u8=e=>{if(tm(e))return e.value;if("UnaryExpression"===e.type&&"-"===e.operator){let t=u8(e.argument);if(void 0===t)return;return-t}},u9=e=>e?.type==="MemberExpression"&&!1===e.computed&&"Identifier"===e.property.type&&"length"===e.property.name,u6=(e,t)=>e.getAllComments().some(r=>{let n=e.getRange(r);return n[0]>=t[0]&&n[1]<=t[1]}),u4=(e,t,r,n,o)=>(u6(n.sourceCode,ti(t,n))&&o(),e.replaceTextRange(ti(t,n),r)),u7="prefer-string-trim-start-end",pe="no-unreadable-iife",pt="suggestion",pr="throw-new-error",pn=/^(?:[A-Z][\da-z]*)*Error$/,po="escape-uppercase",pa="escape-lowercase",pi=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+})/g,ps=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+}|c[A-Za-z])/g,pl=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/g,pu=/(?<!\\)(?:\\\\)*\\[\da-f]{1,6}/gi,pp=({node:e,original:t,regex:r=pi,lowercase:n,fix:o})=>{let a=t.replace(r,e=>e[0]+e.slice(1)[n?"toLowerCase":"toUpperCase"]());if(a!==t)return{node:e,messageId:n?pa:po,fix:t=>o?o(t,a):t.replaceText(e,a)}},pc="prefer-unicode-code-point-escapes",pd="prefer-unicode-code-point-escapes/add-unicode-flag",pm=String.raw`\u{`,pf=/^[\da-f]$/iv,pg=/^[0-7]$/v,py=/^[A-Za-z]$/v,ph=new o([0,8,9,10,11,12,13,34,39,47,92,96]);function px(e){return pg.test(e)}function pb(e,t,r){let n=e.slice(t,t+r);if(!(n.length!==r||[...n].some(e=>!pf.test(e))))return Number.parseInt(n,16)}function pv(e){return e>=55296&&e<=56319}function pE(e){return e>=56320&&e<=57343}function pS(e){return String.raw`\u{${e.toString(16).toUpperCase()}}`}function pT(e,{isRegex:t=!1,supportsNestedCharacterClasses:r=!1,allowOctal:n=!0}={}){let o="",a=0,i=!1,s=!1;for(let l=0;l<e.length;l++){let u=e[l],p=a>0;if("\\"===u){t&&void 0!==function(e,t){var r;if(!e.startsWith(pm,t))return;let n=t+pm.length;for(;r=e[n],pf.test(r);)n++;if(n===t+pm.length||"}"!==e[n])return;let o=Number.parseInt(e.slice(t+pm.length,n),16);if(!(o>1114111))return o}(e,l)&&(s=!0);let r=function(e,t,{isRegex:r,isInCharacterClass:n,allowOctal:o}){let a=function(e,t){if("x"!==e[t+1])return;let r=pb(e,t+2,2);if(void 0!==r)return{end:t+4,replacement:pS(r),value:r}}(e,t)??function(e,t,{allowSurrogatePair:r,allowSurrogate:n,preferShortEscape:o}){if("u"!==e[t+1]||"{"===e[t+2])return;let a=pb(e,t+2,4);if(void 0===a||o&&ph.has(a)&&(0!==a||!/^\d$/v.test(e[t+6]))||!n&&(pv(a)||pE(a)))return;let i=t+6;if(r&&pv(a)&&"\\"===e[i]&&"u"===e[i+1]){let t=pb(e,i+2,4);if(pE(t)){let e=(a-55296)*1024+(t-56320)+65536;return{end:i+6,replacement:pS(e),value:e}}}return{end:t+6,replacement:pS(a),value:a}}(e,t,{allowSurrogatePair:!n,allowSurrogate:!r||!n,preferShortEscape:!r});if(!(!r&&a?.value>=32)||!(a.value<=126)){if(a)return a;if(r){let r=e[t+2];return"c"===e[t+1]&&py.test(r)?{end:t+3,replacement:pS(r.toUpperCase().codePointAt(0)%32)}:void 0}if(o){let r=e[t+1];if("0"===r&&!px(e[t+2])||!px(r))return;let n=r>="0"&&r<="3"?3:2,o=t+1;for(;o<t+1+n&&px(e[o]);)o++;return{end:o,replacement:pS(Number.parseInt(e.slice(t+1,o),8))}}}}(e,l,{isRegex:t,isInCharacterClass:p,allowOctal:n});if(r){o+=r.replacement,l=r.end-1,i=!0;continue}o+=u,l+1<e.length&&(o+=e[l+1],l++);continue}t&&"["===u&&(!p||r)?a++:t&&"]"===u&&p&&a--,o+=u}return{fixed:o,hasReplacement:i,hasCodePointEscape:s}}function pC(e,t,{fix:r,allowOctal:n}={}){let{fixed:o,hasReplacement:a}=pT(t,{allowOctal:n});if(a)return{node:e,messageId:pc,fix:t=>r?r(t,o):t.replaceText(e,o)}}let pD=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],pw=["Error","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","AggregateError","SuppressedError"],pA="missing-message",pk="message-is-empty-string",pI="message-is-not-a-string",pj=new r([["AggregateError",1],["SuppressedError",2]]),pR=e=>"instanceof"===e.value&&"Keyword"===e.type,pF="no-instanceof-builtins",pB="switch-to-type-of",pL=new o(["String","Number","Boolean","BigInt","Symbol"]),pN=new o(["global","globalThis","self","window"]),pP=[...pw,"Map","Set","WeakMap","WeakRef","WeakSet","ArrayBuffer",...nM,"Object","RegExp","Promise","Proxy","DataView","Date","SharedArrayBuffer","FinalizationRegistry"],pM=(e,t,r)=>function*(n){let{left:o,right:a}=e,i=nB(t,e),s=i.getTokenAfter(o,pR),{sourceCode:l}=t,u=l.getAncestors(e).findLast(e=>"VExpressionContainer"===e.type),p=u?'"'===l.getText(u)[0]?"'":'"':"'";yield sK(n,e,t);let c=ti(o,{sourceCode:i});!tl(o,t)&&sn(o,"typeof")?(yield n.insertTextBeforeRange(c,"typeof ("),yield n.insertTextAfterRange(c,")")):yield n.insertTextBeforeRange(c,"typeof "),yield n.replaceText(s,"===");let d=ti(a,{sourceCode:i});yield n.replaceTextRange(d,p+r.toLowerCase()+p)},p$=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,pO={create:i2(e=>{let{useErrorIsError:t,strategy:r,include:n,exclude:a}=e.options[0],i=new o("strict"===r?[...pP,...n]:n);e.on("BinaryExpression",r=>{let{right:n,operator:o}=r;if("instanceof"!==o)return;let s="Identifier"===n.type?{name:n.name,referenceText:n.name}:"MemberExpression"===n.type&&!n.computed&&"Identifier"===n.property.type&&"Identifier"===n.object.type&&pN.has(n.object.name)&&rg(n.object,e)?{name:n.property.name,referenceText:e.sourceCode.getText(n)}:void 0;if(!s||a.includes(s.name))return;let{name:l,referenceText:u}=s,p={node:r,messageId:pF};if("Array"===l||"Error"===l&&t){let t="Array"===l?"isArray":"isError",n=`${u}.${t}`;return p$(r,e)||(p.fix=function*(t){let{left:o,right:a}=r,i=nB(e,r),s=i.getTokenAfter(o,pR);yield sK(t,r,e);let l=ti(o,{sourceCode:i});yield t.insertTextBeforeRange(l,n+"("),yield t.insertTextAfterRange(l,")"),yield s3(s,"",t,e,i),yield s3(a,"",t,e,i)}),p}return"Function"===l?(p$(r,e)||(p.fix=pM(r,e,l)),p):pL.has(l)?(p$(r,e)||(p.suggest=[{messageId:pB,data:{type:l.toLowerCase()},fix:pM(r,e,l)}]),p):i.has(l)?p:void 0})}),meta:{type:"problem",docs:{description:"Disallow `instanceof` with built-in objects",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",properties:{useErrorIsError:{type:"boolean"},strategy:{enum:["loose","strict"]},include:{type:"array",items:{type:"string"}},exclude:{type:"array",items:{type:"string"}}},additionalProperties:!1}],defaultOptions:[{useErrorIsError:!1,strategy:"loose",include:[],exclude:[]}],hasSuggestions:!0,messages:{[pF]:"Avoid using `instanceof` for type checking as it can lead to unreliable results.",[pB]:"Switch to `typeof … === '{{type}}'`."},languages:["js/js"]}},pU="prefer-type-error",pq=new o(["isArguments","isArray","isArrayBuffer","isArrayLike","isArrayLikeObject","isBigInt","isBoolean","isBuffer","isDate","isElement","isError","isFinite","isFunction","isInteger","isLength","isMap","isNaN","isNative","isNil","isNull","isNumber","isObject","isObjectLike","isPlainObject","isPrototypeOf","isRegExp","isSafeInteger","isSet","isString","isSymbol","isTypedArray","isUndefined","isView","isWeakMap","isWeakSet","isWindow","isXMLDoc"]),pW=new o(["isNaN","isFinite"]),pV=(e,t,r)=>void 0!==t&&t.arguments.length>0&&"Identifier"===e.type&&(!0===r&&pq.has(e.name)||!1===r&&pW.has(e.name)),pz=(e,t)=>pV(e.property,t,!0)||"MemberExpression"===e.object.type&&pz(e.object,t),p_=/^(?:[A-Z][\da-z]*)*Error$/,pJ=e=>"UnaryExpression"===e.type&&"typeof"===e.operator,pH=(e,t)=>{switch(e.type){case"Identifier":return pV(e,t,!1);case"MemberExpression":return pz(e,t);case"CallExpression":return pH(e.callee,e);case"UnaryExpression":return"typeof"===e.operator||"!"===e.operator&&pH(e.argument);case"BinaryExpression":{let{operator:r,left:n,right:o}=e;if("instanceof"===r)return!("Identifier"===o.type?p_.test(o.name):"MemberExpression"===o.type&&!o.optional&&!o.computed&&"Identifier"===o.property.type&&p_.test(o.property.name));if((e=>{let{operator:t,left:r,right:n}=e;return["==","!=","===","!=="].includes(t)&&(pJ(r)&&tu(n,"undefined")||pJ(n)&&tu(r,"undefined"))})(e))return!1;return pH(n,t)||pH(o,t)}case"LogicalExpression":return pH(e.left,t)&&pH(e.right,t);default:return!1}},pK="consistentDestructuring",pG="consistentDestructuringSuggest",pX=new o(["FunctionDeclaration","FunctionExpression","MethodDefinition","PropertyDefinition","AccessorProperty","StaticBlock","Program"]),pY=e=>{for(;e.parent;)if(e=e.parent,pX.has(e.type))return e},pZ=e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type,pQ=(e,t,r,n)=>{for(let o of e){if(o.key.name!==t)continue;let e=eD(n.getScope(o.value),o.value);if(e&&eD(r,o.value)===e)return o}},p0=({declaration:e,memberExpressionNode:t,memberScope:r,memberRootIdentifier:n,memberRootVariable:o,memberThisScopeBoundary:a,memberExpressionWrites:i,sourceCode:s})=>{var l;let u;return!(!((e,t,r)=>{let[,n]=r.getRange(e.object),[o]=r.getRange(t);return n<o})(e,t,s)||e.rootIdentifierName&&n?.name===e.rootIdentifierName&&o!==e.rootVariable||e.thisScopeBoundary&&a!==e.thisScopeBoundary||!((e,t)=>{for(;e;){if(e===t)return!0;e=e.upper}return!1})(r,e.scope)||((e,t,r,n)=>{if(!e.rootVariable)return!1;let[,o]=n.getRange(e.object),[a]=n.getRange(t);return e.rootVariable.references.some(e=>{if(!e.isWrite())return!1;let[t]=n.getRange(e.identifier);return!(t<o)&&(e.from.variableScope!==r.variableScope||t<=a)})})(e,t,r,s)||(({declaration:e,memberExpressionNode:t,memberScope:r,memberExpressionWrites:n,sourceCode:o})=>{let[,a]=o.getRange(e.object),[i]=o.getRange(t),s=t.property.name,l=rx(t.object),u="Identifier"===l.type?l.name:void 0,p="Identifier"===l.type?eD(r,l):void 0,c="ThisExpression"===l.type?pY(l):void 0;return n.some(e=>e.propertyName===s&&e.rootIdentifierName===u&&e.rootVariable===p&&e.thisScopeBoundary===c&&(e.scope.variableScope!==r.variableScope||e.start>=a&&e.start<=i))})({declaration:e,memberExpressionNode:t,memberScope:r,memberExpressionWrites:i,sourceCode:s}))&&(l=e.object,u=s.getScope(l),!s.getTokensBetween(l,t).some(e=>{if("Identifier"!==e.type)return!1;let r=s.getNodeByRangeIndex(s.getRange(e)[0]);if("Identifier"!==r.type)return!1;let n=(e=>{let t=e;for(;t.parent;){let{parent:e}=t;if("CallExpression"===e.type&&e.callee===t||"NewExpression"===e.type&&e.callee===t||"TaggedTemplateExpression"===e.type&&e.tag===t)return e;if("MemberExpression"===e.type&&e.object===t){t=e;continue}return}})(r);if(!n||s.getScope(n).variableScope!==u.variableScope)return!1;let[o]=s.getRange(t),[a,i]=s.getRange(n);return o<a||o>i}))},p1=(e,t,r)=>!!("BinaryExpression"===e.type&&"in"===e.operator&&tp(e.left))&&"Identifier"===t.property.type&&e.left.value===t.property.name&&r.getText(e.right)===r.getText(t.object)||"LogicalExpression"===e.type&&"&&"===e.operator&&(p1(e.left,t,r)||p1(e.right,t,r)),p2=(e,t,r,n)=>{switch(e.type){case"ConditionalExpression":case"IfStatement":return e.consequent===t&&p1(e.test,r,n);case"LogicalExpression":return"&&"===e.operator&&e.right===t&&p1(e.left,r,n);default:return!1}},p3=e=>["AccessorProperty","FunctionDeclaration","MethodDefinition","PropertyDefinition"].includes(e.type),p5=["Object","Array","ArrayBuffer","DataView","Date","Function","Map","WeakMap","Set","WeakSet","Promise","RegExp","SharedArrayBuffer","Proxy","WeakRef","FinalizationRegistry","DisposableStack","AsyncDisposableStack",...pw,...["Collator","DateTimeFormat","DisplayNames","DurationFormat","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"].map(e=>`Intl.${e}`),...["Duration","Instant","PlainDate","PlainDateTime","PlainMonthDay","PlainTime","PlainYearMonth","ZonedDateTime"].map(e=>`Temporal.${e}`),...["Module","Instance","Memory","Table","Global","Tag","Exception","CompileError","LinkError","RuntimeError"].map(e=>`WebAssembly.${e}`),...nM],p8=["Temporal.Now","WebAssembly","WebAssembly.JSTag"],p9="error-date",p6="suggestion-date";function p4(e){let{node:t}=e;return{node:t,messageId:"disallowCallOrNew",data:{name:e.path.join(".")}}}let p7=new lY({objects:["BigInt","Boolean","Number","String","Symbol"],type:lY.CONSTRUCT,handle:function(e,t){let{node:r}=e,n=e.path.join("."),o={node:r,messageId:"disallow",data:{name:n}};return"String"!==n&&"Boolean"!==n&&"Number"!==n&&(o.fix=e=>sJ(r,t,e)),o}}),ce=new lY({objects:p5,type:lY.CALL,handle:function(e,t){let{node:r}=e;if(r.optional||nu(r.callee))return;let n=e.path.join(".");if("Object"===n){let{parent:e}=r;if("BinaryExpression"===e.type&&("==="===e.operator||"!=="===e.operator)&&(e.left===r||e.right===r))return}else if("Date"===n){function*o(e){yield e.replaceText(r,"String(new Date())"),yield sK(e,r,t)}let e={node:r,messageId:p9};return 0===t.sourceCode.getCommentsInside(r).length&&0===r.arguments.length?e.fix=o:e.suggest=[{messageId:p6,fix:o}],e}return{node:r,messageId:"enforce",data:{name:n},fix:e=>sG(r,t,e)}}}),ct=new lY({objects:p8,type:lY.CALL,handle:p4}),cr=new lY({objects:p8,type:lY.CONSTRUCT,handle:p4}),cn="error/array-push",co="suggestion",ca=e=>tL(e,{property:"classList",computed:!1}),ci=[{description:"Array#push()",test:e=>tP(e,{method:"push",optionalCall:!1}),checkArrayReceiver:!0,ignore:["stream.push","this.push","this.stream.push","process.stdin.push","process.stdout.push","process.stderr.push"]},{description:"Array#unshift()",test:e=>tP(e,{method:"unshift",optionalCall:!1}),checkArrayReceiver:!0,keepSecondCall:!0,ignore:["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"]},{description:"Element#classList.add()",test:e=>tP(e,{method:"add",optionalCall:!1,optionalMember:!1})&&ca(e.callee.object)},{description:"Element#classList.remove()",test:e=>tP(e,{method:"remove",optionalCall:!1,optionalMember:!1})&&ca(e.callee.object)},{description:"importScripts()",test:e=>tS(e,{name:"importScripts"},tb)}],cs={create:function(e){let{ignore:t}=e.options[0],{sourceCode:r}=e;e.on("CallExpression",function*(n){for(let{description:o,test:a,ignore:i=[],keepSecondCall:s=!1,checkArrayReceiver:l=!1}of ci){if(!a(n))continue;let u=function(e,{test:t,ignoredCallee:r,checkArrayReceiver:n},o){let a;if(tq(e.callee,r))return;let i=("ChainExpression"===(a=e.parent).type&&e===a.expression&&(a=a.parent),"ExpressionStatement"===a.type?a:void 0);if(!i)return;let s=sd(i,o,-1);if(s?.type!=="ExpressionStatement")return;let l=function(e){let{expression:t}=e;return"ChainExpression"===t.type?t.expression:t}(s);if(!(!t(l)||!rf(l.callee,e.callee)||n&&od(e.callee.object,o)))return{firstCall:l,firstExpressionStatement:s,secondExpressionStatement:i}}(n,{test:a,ignoredCallee:[...i,...t],checkArrayReceiver:l},e);if(!u)continue;let{firstCall:p,firstExpressionStatement:c,secondExpressionStatement:d}=u,{shouldKeepSecondCall:m,shouldPrependSourceArguments:f,targetCall:g,sourceCall:y}=function(e,t,r){let n=r&&(!nu(t.callee)||nu(e.callee));return{shouldKeepSecondCall:n,shouldPrependSourceArguments:r&&!n,targetCall:n?t:e,sourceCall:n?e:t}}(p,n,s),h=y.arguments,x=r.getRange(c),b=r.getRange(d),v=m?[x[0],b[0]]:[x[1],b[1]],E=!m&&!eI(r.getLastToken(c))&&eI(r.getLastToken(d)),S=m&&iB(r.getTokenBefore(c),e,r.text.slice(b[0],b[0]+1)),T={node:"Identifier"===n.callee.type?n.callee:n.callee.property,messageId:cn,data:{description:o}},C=function*(t){if(h.length>0){let r=rc(e,y,!f),{openingParenthesisToken:n,trailingCommaToken:o,closingParenthesisToken:a}=rp(g,e);f?yield t.insertTextAfter(n,g.arguments.length>0?`${r}, `:r):yield o?t.insertTextAfter(o,` ${r}`):t.insertTextBefore(a,g.arguments.length>0?`, ${r}`:r)}yield t.replaceTextRange(v,E||S?";":"")};!function(e,t){return e.getAllComments().some(r=>{let[n,o]=e.getRange(r);return n>=t[0]&&o<=t[1]})}(r,v)&&(l&&!os(n.callee.object,e)||function(e,t,r,n){return r?[...e.arguments,...t.arguments].some(e=>void 0===rN(e,n)):t.arguments.some(e=>e0(e,n.sourceCode))}(p,n,l,e)?T.suggest=[{messageId:co,fix:C}]:T.fix=C),yield T}})},meta:{type:"suggestion",docs:{description:"Enforce combining multiple `Array#{push,unshift}()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{ignore:{type:"array",items:{type:"string"},uniqueItems:!0,description:"Methods to ignore."}}}],defaultOptions:[{ignore:[]}],messages:{[cn]:"Do not call `{{description}}` multiple times.",[co]:"Merge with previous one."},languages:["js/js"]}},cl="no-process-exit",cu=e=>tu(e,"node:worker_threads")||tu(e,"worker_threads"),cp="no-single-promise-in-promise-methods/error",cc="no-single-promise-in-promise-methods/unwrap",cd="no-single-promise-in-promise-methods/use-promise-resolve",cm=["all","any","race"],cf=(e,t)=>{let[r]=e.arguments[0].elements,n=ts(r,t);return!tl(r,t)&&16>i8(r)&&(n=`(${n})`),n},cg=(e,t)=>e.getCommentsInside(t).length>0,cy=e=>"ArrayPattern"===e.type&&!e.typeAnnotation&&1===e.elements.length&&e.elements[0]?.type==="Identifier",ch="no-static-only-class",cx=({type:e,value:t})=>"Punctuator"===e&&"="===t,cb=["this","super","new.target"],cv=e=>"PropertyDefinition"===e.type,cE=(e,t,r)=>{if(!t)return!1;let{sourceCode:n}=r,o=eD(n.getScope(t),t),[a,i]=n.getRange(e);return o.references.some(({identifier:e})=>{let[t,r]=n.getRange(e);return t>=a&&r<=i})},cS="ignored-elements",cT="property-assignment",cC={create:e=>{let{sourceCode:t}=e,{maximumIgnoredElements:r}=e.options[0];e.on("ArrayPattern",n=>{let{elements:o,parent:a}=n;if(function(e){let t=0,r=0;for(let n of e)null===n?t=Math.max(t,++r):r=0;return t}(o)<=r)return;let i={node:n,messageId:cS},s=o.filter(e=>null!==e);if("VariableDeclarator"===a.type&&a.id===n&&null!==a.init&&1===s.length){let[r]=s,l="RestElement"===r.type;"AssignmentPattern"===r.type||n.typeAnnotation||ou(a.init,e)||l&&ol(a.init,e)||0!==t.getCommentsInside(n).length||(i.fix=function*(i){let s=o.indexOf(r),u=l?r.argument:r;yield i.replaceText(n,t.getText(u));let p=l?`.slice(${s})`:`[${s}]`,c=a.init;!tl(c,e)&&i7(c,e)?(yield i.insertTextBefore(c,"("),yield i.insertTextAfter(a,`)${p}`)):yield i.insertTextAfter(a,p),yield sK(i,n,e)})}return i}),e.on("MemberExpression",e=>{if(function e(t){let{parent:r}=t;return rh(r)&&r.expression===t||"AssignmentPattern"===r.type&&r.left===t||"RestElement"===r.type&&r.argument===t?e(r):"Property"===r.type&&r.value===t&&"ObjectPattern"===r.parent.type?r.parent:"ObjectPattern"===r.type||"ArrayPattern"===r.type?r:void 0}(e)?.type==="ArrayPattern")return{node:e,messageId:cT}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable array destructuring.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{maximumIgnoredElements:{type:"integer",minimum:0,description:"Maximum number of consecutive ignored elements allowed."}}}],defaultOptions:[{maximumIgnoredElements:1}],messages:{[cS]:"Array destructuring may not contain consecutive ignored values.",[cT]:"Do not assign destructured values to object properties."},languages:["js/js"]}},cD="spread-in-list",cw="iterable-to-array",cA="iterable-to-array-in-for-of",ck="iterable-to-array-in-yield-star",cI="spread-in-collection-constructor",cj="spread-in-object-assign",cR="clone-array",cF="suggestion/remove-object-assign-spread",cB=["Map","WeakMap","Set","WeakSet"],cL=["copyWithin","flat","slice","splice","toReversed","toSorted","toSpliced","with"],cN=[...cL,"filter","flatMap","map"],cP=e=>"ArrayExpression"===e.type&&1===e.elements.length&&e.elements[0]?.type==="SpreadElement",cM={ArrayExpression:"array literal",ObjectExpression:"object literal",CallExpression:"arguments",NewExpression:"arguments"};function*c$(e,t,r){let{sourceCode:n}=r,[o,a,i]=n.getFirstTokens(t,3);yield e.remove(o);let{argument:s}=t.elements[0],l=!tl(s,r)&&!iA(s)&&!iA(rx(s));l&&(yield e.insertTextAfter(o,"(")),yield e.remove(a);let[u,p]=n.getLastTokens(t,2);yield e.remove(p),l&&(yield e.insertTextBefore(p,")")),ek(u)&&(yield e.remove(u));let{parent:c}=t;"ReturnStatement"!==c.type&&"ThrowStatement"!==c.type||c.argument!==t||ax(o,i,r)||tl(t,r)?yield sK(e,t,r):yield sz(e,c,r)}let cO=(e,t)=>"CallExpression"===e.type&&"MemberExpression"===e.callee.type&&ol(e.callee.object,t),cU="no-useless-switch-case/error",cq="no-useless-switch-case/suggestion",cW=e=>e.consequent.every(e=>tD(e)),cV=e=>tz(e.test)||tg(e.test),cz=new o(["CallExpression","MemberExpression"]),c_=new o(["Identifier","MemberExpression","Super","ThisExpression"]),cJ=e=>"MemberExpression"===(e=rx(e)).type?{...e,object:cJ(e.object),property:e.computed?cJ(e.property):e.property}:e,cH=(e,t)=>rf(cJ(e),cJ(t)),cK=e=>c_.has(rx(e).type),cG=(e,t)=>tL(e=rx(e),{property:"length",optional:!1,computed:!1})&&cH(e.object,t),cX=e=>!!("ChainExpression"===e.type||cz.has(e.type)&&e.optional)||Object.entries(e).some(([e,t])=>"parent"!==e&&!!t&&(Array.isArray(t)?t.some(e=>e?.type&&cX(e)):t.type&&cX(t))),cY="no-useless-undefined",cZ="no-useless-undefined/suggestion",cQ=new o(["is","equal","notEqual","strictEqual","notStrictEqual","propertyVal","notPropertyVal","not","include","property","toBe","toHaveBeenCalledWith","toContain","toContainEqual","toEqual","same","notSame","strictSame","strictNotSame"]),c0=new o(["push","unshift","includes","concat","splice","toSpliced","lastIndexOf","reduce","reduceRight","String","fromCharCode","fromCodePoint","Number","max","min","hypot","Array","of","from","structuredClone","add","has","delete","set","createContext","useRef","ref"]),c1=e=>{for(;e;e=e.upper)if("function"===e.type)return e.block},c2={">=":{valid:!0,addend:0},">":{valid:!0,addend:-1},"<":{valid:!1,addend:0},"<=":{valid:!1,addend:-1}},c3={"<=":{valid:!0,addend:0},"<":{valid:!0,addend:-1},">":{valid:!1,addend:0},">=":{valid:!1,addend:-1}},c5={"<":{valid:!0,kind:"length"},"<=":{valid:!0,kind:"lengthMinusOne"},">=":{valid:!1,kind:"length"},">":{valid:!1,kind:"lengthMinusOne"}},c8={">":{valid:!0,kind:"length"},">=":{valid:!0,kind:"lengthMinusOne"},"<=":{valid:!1,kind:"length"},"<":{valid:!1,kind:"lengthMinusOne"}},c9=new o(["<","<=",">",">="]);function c6(e,t,r,n){let o=e[t];if(o&&r===n+o.addend)return o.valid}function c4(e,t){var r;return cG(e,t)?"length":"BinaryExpression"===(r=rx(r=e)).type&&"-"===r.operator&&1===i4(r.right)&&cG(r.left,t)?"lengthMinusOne":void 0}function c7(e,t,r){let n=e[t];if(n?.kind===r)return n.valid}let de={create:e=>{let{sourceCode:t}=e,r=(e,r,n)=>{if(n){let r=c1(t.getScope(e));if(r?.returnType)return}return{node:e,messageId:cY,fix:r}},n=e.options[0];e.on("Identifier",o=>{if(!tV(o))return;let{parent:a}=o;if("ReturnStatement"===a.type&&a.argument===o){let n,a=c1(t.getScope(o));if(a?.returnType&&"TSUndefinedKeyword"!==(n=a.returnType?.typeAnnotation?.type)&&"TSVoidKeyword"!==n)return;return r(o,t=>s3(o,"",t,e))}return"YieldExpression"!==a.type||a.delegate||a.argument!==o?n.checkArrowFunctionBody&&"ArrowFunctionExpression"===a.type&&a.body===o?r(o,t=>s3(o," {}",t,e),!0):"VariableDeclarator"===a.type&&a.init===o&&("let"===a.parent.kind||"var"===a.parent.kind)&&"Identifier"===a.id.type?r(o,function*(r,{abort:n}){let[,i]=t.getRange(a.id),[,s]=ti(o,e);if(ne(e,[i,s]))return n();yield r.removeRange([i,s])}):"AssignmentPattern"===a.type&&a.right===o?r(o,function*(r,{abort:n}){let{left:i}=a,[,s]=t.getRange(i),[,l]=ti(o,e);if(ne(e,[s,l]))return n();yield r.removeRange([s,l]),(i.typeAnnotation||nR(e.physicalFilename))&&!i.optional&&tj(a.parent)&&a.parent.params.includes(a)&&(yield i.typeAnnotation?r.insertTextBefore(i.typeAnnotation,"?"):r.insertTextAfter(i,"?"))}):void 0:r(o,t=>s3(o,"",t,e))}),e.on("ConditionalExpression",r=>{let n=tV(r.consequent);if(n===tV(r.alternate))return;let o=n?r.alternate:r.consequent,a=function(e,t){if(!(!tL(e=rx(e),{computed:!0,optional:!1})||cX(e)||e0(e.object,t,{considerGetters:!0})||e0(e.property,t,{considerGetters:!0})))return{node:e,index:function(e){if("BinaryExpression"===(e=rx(e)).type&&"-"===e.operator){let t=i4(e.right);if(Number.isSafeInteger(t)&&t>0)return{node:e.left,offset:t}}return{node:e,offset:0}}(e.property)}}(o,t);if(!a||function(e,t){if(!("BinaryExpression"!==(e=rx(e)).type||!c9.has(e.operator)||cX(e)))return function(e,t){let{operator:r,left:n,right:o}=e,a=i4(n),i=i4(o);return Number.isSafeInteger(i)&&cH(n,t.node)?c6(c2,r,i,t.offset):Number.isSafeInteger(a)&&cH(o,t.node)?c6(c3,r,a,t.offset):void 0}(e,t.index)??function(e,t){if(0!==t.index.offset)return;let{operator:r,left:n,right:o}=e,a=c4(o,t.node.object);if(a&&cH(n,t.index.node))return c7(c5,r,a);let i=c4(n,t.node.object);if(i&&cH(o,t.index.node))return c7(c8,r,i)}(e,t)}(r.test,a)!==!n)return;let i={node:n?r.consequent:r.alternate,messageId:cY};return 0===t.getCommentsInside(r).length&&(i.suggest=[{messageId:cZ,fix(n){let a=t.getText(o),i=iB(t.getTokenBefore(r),e,a)?";":"";return n.replaceText(r,i+a)}}]),i}),!n.checkArguments||nR(e.physicalFilename)||e.on("CallExpression",t=>{var r;let n,o=t.arguments,a=o.at(-1);if(!tV(a)||("Identifier"===(r=t.callee).type?n=r.name:"MemberExpression"===r.type&&!1===r.computed&&"Identifier"===r.property.type&&(n=r.property.name),cQ.has(n)||c0.has(n)||/^set[A-Z]/v.test(n))||!t.optional&&"MemberExpression"===t.callee.type&&!t.callee.computed&&"Identifier"===t.callee.property.type&&"bind"===t.callee.property.name&&1!==o.length)return;let i={node:a,messageId:cY};return ne(e,sq(a,e))||(i.fix=t=>sW(t,a,e)),i})},meta:{type:"suggestion",docs:{description:"Disallow useless `undefined`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkArguments:{type:"boolean",description:"Whether to check function arguments."},checkArrowFunctionBody:{type:"boolean",description:"Whether to check arrow function bodies."}}}],defaultOptions:[{checkArguments:!0,checkArrowFunctionBody:!0}],messages:{[cY]:"Do not use useless `undefined`.",[cZ]:"Use the indexed access directly."},languages:["js/js"]}},dt="numeric-separators-style";function dr(e,{minimumDigits:t,groupLength:r},n){let{length:o}=e;if(o<t)return e;let a=[];if(n)for(let t=0;t<o;t+=r){let n=Math.min(t+r,o);a.push(e.slice(t,n))}else for(let t=o;t>0;t-=r){let n=Math.max(t-r,0);a.unshift(e.slice(n,t))}return a.join("_")}let dn={binary:{minimumDigits:0,groupLength:4},octal:{minimumDigits:0,groupLength:4},hexadecimal:{minimumDigits:0,groupLength:2},number:{minimumDigits:5,groupLength:3,fractionGroupLength:1/0}},da={create:e=>{let{onlyIfContainsSeparator:t,binary:r,octal:n,hexadecimal:o,number:a}=e.options[0],i={"0b":{onlyIfContainsSeparator:t,...r},"0o":{onlyIfContainsSeparator:t,...n},"0x":{onlyIfContainsSeparator:t,...o},"":{onlyIfContainsSeparator:t,...a}},s=(e,t)=>{let r,n,o=t,a="",s="";(o.startsWith("+")||o.startsWith("-"))&&(a=o[0],o=o.slice(1)),ty(e)&&(o=t.slice(0,-1),s="n");let l=o.replaceAll("_",""),{prefix:u,data:p}=(r="",n=l,/^0[box]/i.test(l)&&(r=l.slice(0,2),n=l.slice(2)),{prefix:r,data:n}),{onlyIfContainsSeparator:c}=i[u.toLowerCase()];if(c&&!t.includes("_"))return;let d=a+function(e,{prefix:t,data:r},n){let o=n[t.toLowerCase()];if(t)return t+dr(r,o);let{number:a,mark:i,sign:s,power:l}=function(e){let{number:t,mark:r="",sign:n="",power:o=""}=e.match(/^(?<number>[\d._]*)(?:(?<mark>e)(?<sign>[+-])?(?<power>[\d_]+))?$/i).groups;return{number:t,mark:r,sign:n,power:o}}(e);return function(e,t){let{integer:r,dot:n,fractional:o}=function(e){let t=e.split("."),[r,n=""]=t;return{integer:r,dot:2===t.length?".":"",fractional:n}}(e);return dr(r,t)+n+dr(o,{...t,groupLength:t.fractionGroupLength},!0)}(a,o)+i+s+dr(l,n[""])}(l,{prefix:u,data:p},i)+s;if(t!==d)return{node:e,messageId:dt,fix:t=>t.replaceText(e,d)}};e.on("Literal",e=>{if((tm(e)||ty(e))&&!(tm(e)&&/^0\d+$/.test(e.raw)))return s(e,e.raw)}),e.on("TOMLValue",t=>{if("integer"!==t.kind&&"float"!==t.kind)return;let r=e.sourceCode.getText(t);if(!/(?:inf|nan)$/u.test(r))return s(t,r)})},meta:{type:"suggestion",docs:{description:"Enforce the style of numeric separators by correctly grouping digits.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{...Object.fromEntries(Object.keys(dn).map(e=>[e,(({withFraction:e=!1}={})=>({type:"object",additionalProperties:!1,properties:{onlyIfContainsSeparator:{type:"boolean",description:"Whether to only enforce the style if the number already contains a separator."},minimumDigits:{type:"integer",minimum:0,description:"The minimum number of digits before separators are enforced."},groupLength:{type:"integer",minimum:1,description:"The number of digits in each group."},...e&&{fractionGroupLength:{type:"integer",minimum:1,description:"The number of digits in each group after the decimal point. Defaults to no grouping."}}}}))({withFraction:"number"===e})])),onlyIfContainsSeparator:{type:"boolean",description:"Whether to only enforce the style if the number already contains a separator."}}}],defaultOptions:[{onlyIfContainsSeparator:!1,binary:dn.binary,octal:dn.octal,hexadecimal:dn.hexadecimal,number:dn.number}],messages:{[dt]:"Invalid group length in numeric value."},languages:["js/js","toml/toml"]}},di="error-zero-index",ds="error-shift",dl="error-pop",du="error-at-zero",dp="error-at-minus-one",dc="error-slice-minus-one",dd="error-destructuring-declaration",dm="error-destructuring-assignment",df="error-variable",dg=(e,t,r)=>tP(e,{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,...r})&&!ou(e.callee.object,t),dy=e=>"UnaryExpression"===e.type&&"-"===e.operator&&e.prefix&&"Literal"===e.argument.type&&"1"===e.argument.raw,dh=(e,t)=>tP(e,{method:"slice",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&dy(e.arguments[0])&&dg(e.callee.object,t),dx=e=>e?"AssignmentExpression"===e.type?e:"VariableDeclarator"===e.type?{left:e.id,right:e.init}:{}:{},db=(e,t,r)=>ne(r,[ti(e,r)[1],r.sourceCode.getRange(t)[1]]),dv=(e,t,r,n)=>{let o=e.callee.object,a={node:o.callee.property,messageId:t};return db(o,e,n)||(a.fix=t=>[t.replaceText(o.callee.property,r),...sZ(t,e,n)]),a};function*dE(e,t,r,{abort:n}){let{sourceCode:o}=r,{left:a}=dx(e),[i]=a.elements;if(ne(r,o.getRange(a))||a.typeAnnotation)return n();let s=o.getText(i);yield t.replaceText(a,s),((e,t)=>{if("AssignmentExpression"!==e.type||e1(e,t))return!1;let{left:r}=dx(e),[{type:n}]=r.elements;return"ObjectExpression"===n||"ObjectPattern"===n})(e,o)&&(yield t.insertTextBefore(e,"("),yield t.insertTextAfter(e,")"))}let dS=e=>"AssignmentPattern"===dx(e).left.elements[0].type,dT=(e,t)=>{let{property:r}=dx(e).right.callee;return dS(e)?{}:{fix:function*(n,{abort:o}){yield n.replaceText(r,"find"),yield dE(e,n,t,{abort:o})}}},dC=e=>"MemberExpression"===e.parent.type&&!0===e.parent.computed&&e.parent.object===e&&"Literal"===e.parent.property.type&&"0"===e.parent.property.raw&&!ns(e.parent),dD=e=>{let{left:t,right:r}=dx(e.parent);return t&&r&&r===e&&"ArrayPattern"===t.type&&1===t.elements.length&&t.elements[0]&&"RestElement"!==t.elements[0].type},dw={create:e=>{let{sourceCode:t}=e,{checkFromLast:r}=e.options[0];e.on("MemberExpression",t=>{if(!(t.computed&&"Literal"===t.property.type&&"0"===t.property.raw&&dg(t.object,e))||ns(t))return;let r={node:t.object.callee.property,messageId:di};return db(t.object,t,e)||(r.fix=r=>[r.replaceText(t.object.callee.property,"find"),sY(r,t,e)]),r}),e.on("CallExpression",t=>{if(tP(t,{method:"shift",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&dg(t.callee.object,e))return dv(t,ds,"find",e)}),e.on("VariableDeclarator",t=>{if("ArrayPattern"===t.id.type&&1===t.id.elements.length&&t.id.elements[0]&&"RestElement"!==t.id.elements[0].type&&dg(t.init,e,{optionalMember:!1}))return{node:t.init.callee.property,messageId:dd,...dT(t,e)}}),e.on("AssignmentExpression",t=>{if("ArrayPattern"===t.left.type&&1===t.left.elements.length&&t.left.elements[0]&&"RestElement"!==t.left.elements[0].type&&dg(t.right,e,{optionalMember:!1}))return{node:t.right.callee.property,messageId:dm,...dT(t,e)}}),e.on("VariableDeclarator",r=>{if(!("Identifier"===r.id.type&&!r.id.typeAnnotation&&dg(r.init,e,{optionalMember:!1})&&"VariableDeclaration"===r.parent.type&&r.parent.declarations.includes(r)&&("ExportNamedDeclaration"!==r.parent.parent.type||r.parent.parent.declaration!==r.parent)))return;let n=t.getScope(r),o=eD(n,r.id),a=nN(o).filter(e=>e!==r.id);if(0===a.length)return;let i=[],s=[];for(let e of a)if(dC(e))i.push(e.parent);else{if(!dD(e))return;s.push(e.parent)}let l={node:r.init.callee.property,messageId:df},u=[...i,...s];return s.every(e=>!dS(e))&&u.every(r=>!ne(e,t.getRange(r)))&&(l.fix=function*(a,{abort:l}){yield a.replaceText(r.init.callee.property,"find");let u=su(r.id.name);if(u){let r=rl(u,nI(n));yield s1(o,r,e,a),yield s$(a,t.getRange(t.ast))}for(let t of i)yield sY(a,t,e);for(let t of s)yield dE(t,a,e,{abort:l})}),l}),e.on("CallExpression",t=>{if(tP(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"Literal"===t.arguments[0].type&&"0"===t.arguments[0].raw&&dg(t.callee.object,e))return dv(t,du,"find",e)}),r&&(e.on("CallExpression",t=>{if(tP(t,{method:"pop",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&dg(t.callee.object,e))return dv(t,dl,"findLast",e)}),e.on("CallExpression",t=>{if(tP(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&dy(t.arguments[0])&&dg(t.callee.object,e))return dv(t,dp,"findLast",e)}),e.on("MemberExpression",t=>{if(!(t.computed&&!t.optional&&"Literal"===t.property.type&&"0"===t.property.raw&&!ns(t)&&dh(t.object,e)))return;let r=t.object.callee.object;return{node:r.callee.property,messageId:dc,*fix(n,{abort:o}){if(db(r,t,e))return o();yield n.replaceText(r.callee.property,"findLast"),yield sZ(n,t.object,e),yield sY(n,t,e)}}}),e.on("CallExpression",t=>{if(!(tP(t,{methods:["pop","shift"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&dh(t.callee.object,e)))return;let r=t.callee.object.callee.object;return{node:r.callee.property,messageId:dc,*fix(n,{abort:o}){if(db(r,t,e))return o();yield n.replaceText(r.callee.property,"findLast"),yield sZ(n,t.callee.object,e),yield sZ(n,t,e)}}}))},meta:{type:"suggestion",docs:{description:"Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{checkFromLast:{type:"boolean",description:"Whether to also check for patterns that can be replaced with `findLast()`."}}}],defaultOptions:[{checkFromLast:!0}],messages:{[df]:"Prefer `.find(…)` over `.filter(…)`.",[di]:"Prefer `.find(…)` over `.filter(…)[0]`.",[du]:"Prefer `.find(…)` over `.filter(…).at(0)`.",[ds]:"Prefer `.find(…)` over `.filter(…).shift()`.",[dl]:"Prefer `.findLast(…)` over `.filter(…).pop()`.",[dp]:"Prefer `.findLast(…)` over `.filter(…).at(-1)`.",[dc]:"Prefer `.findLast(…)` over `.filter(…).slice(-1)`.",[dd]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[dm]:"Prefer `.find(…)` over destructuring `.filter(…)`."},languages:["js/js"]}},dA="prefer-array-flat-map",dk="prefer-array-flat-map/filter-flat-map",dI="prefer-array-flat-map/filter-flat-map-suggestion",dj=["React.Children","Children"],dR=new o(["ArrowFunctionExpression","AssignmentExpression","ClassExpression","ConditionalExpression","FunctionExpression","ObjectExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),dF=e=>"ArrowFunctionExpression"===e.type&&!e.async&&!e.returnType&&!e.typeParameters&&1===e.params.length&&"Identifier"===e.params[0].type&&!e.params[0].optional&&!e.params[0].typeAnnotation&&"BlockStatement"!==e.body.type,dB="prefer-array-flat",dL={getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#flatMap()",testFunction(e,t){if(!tP(e,{method:"flatMap",argumentsLength:1,optionalCall:!1}))return!1;let[r]=e.arguments;return"ArrowFunctionExpression"===r.type&&!r.async&&1===r.params.length&&aE(r.params[0],r.body)&&!dU(e.callee.object,t)}},dN={testFunction(e){if(!tP(e,{method:"reduce",argumentsLength:2,optionalCall:!1}))return!1;let[t,r]=e.arguments;if(!("ArrowFunctionExpression"===t.type&&!t.async&&2===t.params.length&&tw(r)))return!1;let n=t.body,[o,a]=t.params;return tP(n,{method:"concat",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&aE(o,n.callee.object)&&aE(a,n.arguments[0])},getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#reduce()"},dP={testFunction:e=>tP(e,{method:"concat",argumentsLength:1,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&tw(e.callee.object)&&"SpreadElement"===e.arguments[0].type,getArrayNode:e=>e.arguments[0].argument,description:"[].concat()"},dM={testFunction(e){if(!(tP(e,{methods:["apply","call"],argumentsLength:2,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&t_(e.callee.object,{property:"concat"})))return!1;let[t,r]=e.arguments;return tw(t)&&("apply"===e.callee.property.name&&"SpreadElement"!==r.type||"call"===e.callee.property.name&&"SpreadElement"===r.type)},getArrayNode(e){let t=e.arguments[1];return"SpreadElement"===t.type?t.argument:t},description:"Array.prototype.concat()"},d$=["_.flatten","lodash.flatten","underscore.flatten"],dO=/^\p{Uppercase_Letter}/u,dU=(e,t)=>{let r,n;return"Identifier"===e.type&&dO.test(e.name)&&(!(r=na(e,t))||"ArrayExpression"!==r.type&&("NewExpression"!==r.type||"Identifier"!==r.callee.type||"Array"!==r.callee.name))||!!((n=na(e,t))&&("ObjectExpression"===n.type||"Literal"===n.type||"TemplateLiteral"===n.type||"ArrowFunctionExpression"===n.type||"FunctionExpression"===n.type||"ClassExpression"===n.type||"NewExpression"===n.type&&"Identifier"===n.callee.type&&"Array"!==n.callee.name))},dq={create:function(e){let{functions:t}=e.options[0],r=[...t,...d$],n=[dL,dN,dP,dM,{testFunction:e=>tS(e,{argumentsLength:1,optional:!1},tb)&&tq(e.callee,r),getArrayNode:e=>e.arguments[0],description:e=>`${r.find(t=>tU(e.callee,t)).trim()}()`}];e.on("CallExpression",function*(t){for(let{testFunction:r,description:o,getArrayNode:a,isOptionalArray:i}of n){if(!r(t,e))continue;let n=a(t);if(ol(n,e)||"Identifier"===n.type&&"arguments"===n.name)continue;let s=i?.(t),l={description:"string"==typeof o?o:o(t)},u={node:t,messageId:dB,data:l},{sourceCode:p}=e;p.getCommentsInside(t).length===p.getCommentsInside(n).length&&(u.fix=function(e,t,r,n){return function*(o){let{sourceCode:a}=r,i=`${se(t,r)}${n?"?":""}.flat()`;iB(a.getTokenBefore(e),r,i)&&(i=`;${i}`),yield o.replaceText(e,i),yield sK(o,e,r)}}(t,n,e,s)),yield u}})},meta:{type:"suggestion",docs:{description:"Prefer `Array#flat()` over legacy techniques to flatten arrays.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{functions:{type:"array",items:{type:"string"},uniqueItems:!0,description:"Additional functions to check."}}}],defaultOptions:[{functions:[]}],messages:{[dB]:"Prefer `Array#flat()` over `{{description}}` to flatten an array."},languages:["js/js"]}},dW="some",dV="some-suggestion",dz="filter",d_={create:i2(e=>{e.on("CallExpression",t=>{if(!tP(t,{methods:["find","findLast"],minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||t.typeArguments||t.typeParameters||ou(t.callee.object,e))return;let r="BinaryExpression"===t.parent.type&&t.parent.left===t&&(["!=","==","===","!=="].includes(t.parent.operator)&&tV(t.parent.right)||("!="===t.parent.operator||"=="===t.parent.operator)&&tg(t.parent.right));if(!r&&!(tZ(t,e)||tQ(t)||function(e,t){if(!os(e.callee.object,t))return!1;let r=e.parent;if("VariableDeclarator"!==r.type||r.init!==e||"Identifier"!==r.id.type||r.id.typeAnnotation||"VariableDeclaration"!==r.parent.type||"const"!==r.parent.kind||"ExportNamedDeclaration"===r.parent.parent.type)return!1;let[n]=t.sourceCode.getDeclaredVariables(r);if(1!==n.identifiers.length)return!1;let o=n.references.filter(e=>!e.init);return 0!==o.length&&o.every(e=>{let{identifier:r}=e;return e.isRead()&&(tZ(r,t)||tQ(r))})}(t,e)))return;let n=t.callee.property,o=r&&ne(e,[ti(t,e)[1],e.sourceCode.getRange(t.parent)[1]]);return{node:n,messageId:dW,data:{method:n.name},suggest:o?void 0:[{messageId:dV,*fix(o){if(yield o.replaceText(n,"some"),!r)return;let{sourceCode:a}=e,i=ti(t,e);yield o.removeRange([i[1],a.getRange(t.parent)[1]]),"!="!==t.parent.operator&&"!=="!==t.parent.operator&&(yield o.insertTextBeforeRange(i,"!"))}}]}}),e.on("BinaryExpression",t=>{let{left:r,right:n,operator:o}=t;if(!(tP(r,{methods:["findIndex","findLastIndex"],minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})&&(["!==","!=",">","===","=="].includes(o)&&"UnaryExpression"===n.type&&"-"===n.operator&&n.argument&&"Literal"===n.argument.type&&1===n.argument.value||[">=","<"].includes(o)&&tu(n,0)))||ou(r.callee.object,e))return;let a=r.callee.property;return{node:a,messageId:dW,data:{method:a.name},*fix(n,{abort:i}){let{sourceCode:s}=e,l=s.getTokenAfter(r,e=>"Punctuator"===e.type&&e.value===o),[,u]=s.getRange(s.getTokenBefore(l,{includeComments:!0})),[,p]=s.getRange(t);if(ne(e,[u,p]))return i();["===","==","<"].includes(o)&&(yield n.insertTextBefore(t,"!")),yield n.replaceText(a,"some"),yield n.removeRange([u,p])}}}),e.on("BinaryExpression",t=>{if(!((">"===t.operator||"!=="===t.operator)&&"Literal"===t.right.type&&"0"===t.right.raw&&tL(t.left,{property:"length",optional:!1})&&tP(t.left.object,{method:"filter",optionalCall:!1,optionalMember:!1})))return;let r=t.left.object,n=r.callee.object;if("Identifier"===n.type&&n.name.startsWith("$")||ou(n,e))return;let[o]=r.arguments;if(!o||ay(o))return;let a=r.callee.property;return{node:a,messageId:dz,*fix(n,{abort:o}){let{sourceCode:i}=e,s=t.left;if(ne(e,[ti(r,e)[1],i.getRange(t)[1]]))return o();yield n.replaceText(a,"some"),yield sY(n,s,e),yield n.removeRange([ti(s,e)[1],i.getRange(t)[1]])}}})}),meta:{type:"suggestion",docs:{description:"Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.",recommended:"unopinionated"},fixable:"code",messages:{[dW]:"Prefer `.some(…)` over `.{{method}}(…)`.",[dV]:"Replace `.{{method}}(…)` with `.some(…)`.",[dz]:"Prefer `.some(…)` over non-zero length check from `.filter(…)`."},hasSuggestions:!0,languages:["js/js"]}},dJ="preferDefaultParameters",dH="preferDefaultParametersSuggest",dK="preferDefaultParameterOverFallback",dG="preferDestructuringDefaultOverFallback",dX="moveDefaultToDeclaration",dY=new o(["CallExpression","NewExpression","ImportExpression","TaggedTemplateExpression"]),dZ=(e,t)=>!!dY.has(t.type)||t1(t,e.visitorKeys).some(t=>dZ(e,t)),dQ=(e,t)=>{if("ArrowFunctionExpression"!==t.type||t.params.length>1)return!1;let[r]=t.params,n=e.getTokenBefore(r);return!n||"("!==n.value},d0="prefer-logical-operator-over-ternary/error",d1="prefer-logical-operator-over-ternary/optional-chain-error",d2="prefer-logical-operator-over-ternary/suggestion",d3="prefer-logical-operator-over-ternary/optional-chain-suggestion",d5=new o(["==","==="]),d8=new o(["!=","!=="]);function d9(e,t,r){if(rf(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return d9(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&d9(e.left,t.left,r)&&d9(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&d9(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function d6({fixer:e,context:t,conditionalExpression:r,left:n,right:o,operator:a,negateLeft:i=!1}){let{sourceCode:s}=t,l=[n,o].map((e,r)=>{let n=tl(e,t),o=n?ts(e,t):s.getText(e),l=0===r&&i;return!n&&(l?sn(e,"!"):so(e,{operator:a,property:0===r?"left":"right"}))&&(o=`(${o})`),l?`!${o}`:o}).join(` ${a} `);return iB(s.getTokenBefore(r),t,l)&&(l=`;${l}`),e.replaceText(r,l)}let d4=e=>"TSTypeReference"===e.type&&"Identifier"===e.typeName.type&&"const"===e.typeName.name;function d7(e,t){let r=t.sourceCode.getScope(e),n=eD(r,e),o=n?.defs.length===1?n.defs[0]:void 0;if(o?.type==="Variable"&&"const"===o.parent.kind&&o.node.id===o.name&&o.node.init&&r.variableScope===n.scope.variableScope&&"switch"!==n.scope.type&&!(t.sourceCode.getRange(o.node)[1]>t.sourceCode.getRange(e)[0]))return o}function me(e,t){let r=[];for(;e;){if(tc(e)){let{value:t}=e;if(r.some(e=>{var r;return r=e,r?.type==="TSTypeAnnotation"&&(r=r.typeAnnotation),(r?.type==="TSLiteralType"&&tc(r.literal)?r.literal.value:void 0)!==t}))return;return t}if("TSNonNullExpression"===e.type||"TSSatisfiesExpression"===e.type){e=e.expression;continue}if("TSAsExpression"===e.type||"TSTypeAssertion"===e.type){d4(e.typeAnnotation)||r.push(e.typeAnnotation),e=e.expression;continue}if("Identifier"!==e.type)return;let n=d7(e,t);if(!n)return;n.name.typeAnnotation&&r.push(n.name.typeAnnotation),e=n.node.init}}function mt(e,t){try{return o2(e,t)}catch(e){if(e instanceof RangeError)return!1;throw e}}function mr({context:e,conditionalExpression:t,left:r,right:n,operators:o=["??","||"]}){return e.sourceCode.getCommentsInside(t).length>0?{node:t,messageId:d0}:{node:t,messageId:d0,suggest:o.map(o=>({messageId:d2,data:{operator:o},fix:a=>d6({fixer:a,context:e,conditionalExpression:t,left:r,right:n,operator:o})}))}}function mn(e){return tg(e)?"null":tV(e)?"undefined":void 0}function mo(e){if("BinaryExpression"!==e.type||!d5.has(e.operator)&&!d8.has(e.operator))return;let t=mn(e.left),r=mn(e.right);if(!!t==!!r)return;let n=d5.has(e.operator);return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:n}}let ma=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind,mi="with-name",ms="without-name",ml=e=>{switch(e.type){case"Property":return e.computed||ml(e.value);case"ObjectPattern":return e.properties.some(e=>ml(e));case"ArrayPattern":return e.elements.some(e=>e&&ml(e));case"RestElement":return ml(e.argument);default:return!1}},mu="regexp-exec",mp="string-match",mc="string-search",md="suggestion",mm="string",mf="regexp",mg="other",my="string-or-other",mh="regexp-or-other",mx="unknown";function*mb(e,{stringNode:t,methodNode:r,regexpNode:n},o){let{sourceCode:a}=o;yield e.replaceText(r,"test");let i=a.getText(t);e1(n,a)||"SequenceExpression"!==t.type||(i=`(${i})`),yield e.replaceText(n,i);let s=a.getText(n);!e1(t,a)&&i7(n,o)&&(s=`(${s})`),iB(a.getTokenBefore(t),o,s)&&(yield e.insertTextBefore(t,";")),yield e.replaceText(t,s)}let mv=[{type:mu,test:e=>tP(e,{method:"exec",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.arguments[0],methodNode:e.callee.property,regexpNode:e.callee.object}),*fix(e,{methodNode:t}){yield e.replaceText(t,"test")}},{type:mp,test:e=>tP(e,{method:"match",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:mb},{type:mc,test:e=>tP(e,{method:"search",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:mb}],mE=e=>{if(e.includes(mx))return mx;let t=new o(e),r=t.has(mm)||t.has(my),n=t.has(mf)||t.has(mh);if(r&&n)return my;let a=t.has(mg)||t.has(my)||t.has(mh);return r?a?my:mm:n?a?mh:mf:mg},mS=e=>{let t=new o(e);return t.has(mx)?mx:t.has(mf)?mf:t.has(mm)?mm:mg},mT=new o(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSVoidKeyword","TSArrayType","TSTypeLiteral","TSTupleType","TSFunctionType","TSConstructorType"]),mC=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return mC(e.typeAnnotation);case"TSStringKeyword":return mm;case"TSLiteralType":return"Literal"===e.literal.type&&"string"==typeof e.literal.value?mm:mg;case"TSTypeReference":if("Identifier"!==e.typeName.type)return mx;if("String"===e.typeName.name)return mm;if("RegExp"===e.typeName.name)return mf;return"Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name?mg:mx;case"TSUnionType":return mE(e.types.map(e=>mC(e)));case"TSIntersectionType":return mS(e.types.map(e=>mC(e)));default:return mT.has(e?.type)?mg:mx}},mD=(e,t)=>{if(n$.has(e.intrinsicName))return mx;if(e.isTypeParameter()){let r=e.getConstraint();return r?mD(r,t):mx}return e.isUnion()?mE(e.types.map(e=>mD(e,t))):e.isIntersection()?mS(e.types.map(e=>mD(e,t))):"string"===e.intrinsicName||e.isStringLiteral()?mm:"RegExp"===nU(e)?.getName()||nW(e,t).some(e=>mD(e,t)===mf)?mf:mg},mw=new o(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]);function mA(e,t,r=new o){if(tf(e)||tT(e,{name:"RegExp"}))return mf;if(oR(e,t))return mm;switch(e.type){case"Identifier":{let n=((e,t,r)=>{let{sourceCode:n}=t,o=eD(n.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return mx;r.add(o);let[a]=o.defs,i=mC(a.name?.typeAnnotation),s=mx;return i!==mx?s=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(s=mA(a.node.init,t,r)),r.delete(o),s})(e,t,r);if(n!==mx)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let n=mC(e.typeAnnotation);return n===mx?mA(e.expression,t,r):n}case"TSNonNullExpression":case"ParenthesizedExpression":return mA(e.expression,t,r);case"SequenceExpression":return mA(e.expressions.at(-1),t,r);case"ConditionalExpression":return mE([mA(e.consequent,t,r),mA(e.alternate,t,r)])}let n=((e,t)=>{let r,n=rN(e,t);if(!n&&rB(e,t)){let r=eJ(e,t.sourceCode.getScope(e));return r&&void 0!==r.value?mg:mx}return n?"string"==typeof n.value?mm:(r=n.value,"[object RegExp]"===Object.prototype.toString.call(r))?mf:void 0===n.value&&("Identifier"===e.type&&"undefined"===e.name||"UnaryExpression"===e.type&&"void"===e.operator)||null===n.value||["bigint","boolean","number","symbol"].includes(typeof n.value)?mg:mx:mx})(e,t);return n!==mx?n:mw.has(e.type)?mg:((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return mx;try{let{program:t}=r;return mD(r.getTypeAtLocation(e),t.getTypeChecker())}catch{return mx}})(e,t)}let mk=(e,t)=>{let r;return"UnaryExpression"===(r=((e,t)=>{for(;;){if(tJ(e.parent)||tX(e.parent,t)&&e.parent.arguments[0]===e){e=e.parent;continue}break}return e})(e,t)).parent.type&&"!"===r.parent.operator&&r.parent.argument===r},mI=(e,[t,r])=>e.getAllComments().some(n=>{let[o,a]=e.getRange(n);return o>=t&&a<=r}),mj=(e,t,r)=>[ti(t,r)[1],r.sourceCode.getRange(e.node)[1]],mR=e=>[{messageId:md,fix:e}],mF=e=>[mf,mh,mg].includes(e),mB=e=>[mm,my,mg].includes(e),mL=({type:e,stringType:t,regexpType:r})=>e===mu?mB(r)||mF(t):mF(t)||mB(r),mN=(e,t,r,{lengthCheck:n,searchCheck:o,callExpression:a,isRegExp:i,staticRegExp:s})=>{if(n){((e,t)=>{let{sourceCode:r}=t,n=[[ti(e.lengthNode.object,t)[1],r.getRange(e.lengthNode)[1]]];return e.comparisonLeftNode&&n.push([ti(e.comparisonLeftNode,t)[1],r.getRange(e.node)[1]]),n})(n,r).every(e=>!mI(r.sourceCode,e))&&(e.suggest=mR(t));return}if(!o||!mI(r.sourceCode,mj(o,a,r))){if((({searchCheck:e,isRegExp:t,staticRegExp:r})=>t||r?.global===!1&&(!e||!1===r.sticky))({searchCheck:o,isRegExp:i,staticRegExp:s})){e.fix=t;return}e.suggest=mR(t)}},mP={create:i2(e=>{e.on("CallExpression",function*(t){let r=((e,t)=>{let r,n="ChainExpression"===(r=e.parent).type?r.expression:r;if(!tL(n,{property:"length"})||n.object!==e)return;let o="ChainExpression"===n.parent.type?n.parent:n;if(mk(o,t))return;if(tZ(o,t)||tQ(o))return{lengthNode:n,node:o};let{parent:a}=o;if(a?.type==="BinaryExpression"&&a.left===o&&">"===a.operator&&tu(a.right,0)&&!mk(a,t)&&(tZ(a,t)||tQ(a)))return{lengthNode:n,node:a,comparisonLeftNode:o}})(t,e),n=(e=>{let{parent:t}=e;if(t?.type!=="BinaryExpression"||t.left!==e)return;let{operator:r,right:n}=t;return["!==","!=",">"].includes(r)&&tM(n)||">="===r&&tu(n,0)?{node:t,negate:!1}:["===","=="].includes(r)&&tM(n)||"<"===r&&tu(n,0)?{node:t,negate:!0}:void 0})(t);if(r||n||tZ(t,e)||tQ(t))for(let{type:o,test:a,getNodes:i,fix:s}of mv){if(o===mc!=!!n||!a(t))continue;let l=i(t),{methodNode:u,regexpNode:p}=l,c=rA(p,e),d=tf(p)?!p.regex.flags.includes("g")&&!p.regex.flags.includes("y"):!!(c&&!c.global&&!c.sticky);if(mL({type:o,stringType:mA(l.stringNode,e),regexpType:mA(p,e)}))continue;let m={node:o===mu?u:t,messageId:o};mN(m,function*(o){for(let a of(r?(yield sY(o,r.lengthNode,e),r.comparisonLeftNode&&(yield o.removeRange([ti(r.comparisonLeftNode,e)[1],e.sourceCode.getRange(r.node)[1]]))):n&&(n.negate&&(yield o.insertTextBefore(n.node,"!")),yield o.removeRange(mj(n,t,e))),s(o,l,e)))yield a},e,{lengthCheck:r,searchCheck:n,callExpression:t,isRegExp:d,staticRegExp:c}),yield m}})}),meta:{type:"suggestion",docs:{description:"Prefer `RegExp#test()` over `String#match()`, `String#search()`, and `RegExp#exec()`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[mu]:"Prefer `.test(…)` over `.exec(…)`.",[mp]:"Prefer `RegExp#test(…)` over `String#match(…)`.",[mc]:"Prefer `RegExp#test(…)` over `String#search(…)` when checking for existence.",[md]:"Switch to `RegExp#test(…)`."},languages:["js/js"]}},mM="error",m$="suggestion",mO=["copyWithin","fill","filter","flat","flatMap","map","reverse","sort","splice","toReversed","toSorted","toSpliced","with","split","toArray"],mU=["slice","concat"],mq=e=>tP(e.parent.parent,{method:"includes",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.parent.callee.object===e,mW=new o(["ForOfStatement","ForStatement","ForInStatement","WhileStatement","DoWhileStatement","FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),mV=(e,t,r=new o)=>"ArrayExpression"===e.type||tS(e,{name:"Array",optional:!1},tE)||tP(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||tP(e,{methods:mO,optionalCall:!1,optionalMember:!1})||tP(e,{methods:mU,optionalCall:!1,optionalMember:!1})&&void 0===td(e.callee.object)&&("Identifier"!==e.callee.object.type||((e,t,r=new o)=>{let n=eD(t,e);if(!n||r.has(n)||1!==n.defs.length)return!1;r.add(n);let[a]=n.defs;return"Variable"===a.type&&"const"===a.kind&&!!a.node.init&&mV(a.node.init,t,r)})(e.callee.object,t,r)),mz=e=>Number.isSafeInteger(e)&&e>=0&&e<=0xffffffff,m_=e=>e.some(e=>e?.type==="SpreadElement"),mJ=(e,t,r)=>e.getCommentsInside(t).some(t=>{let n,o;return n=e.getRange(t),o=e.getRange(r),!(n[0]>=o[0])||!(n[1]<=o[1])}),mH=(e,t)=>(e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion"||e?.type==="TSNonNullExpression")&&e.expression===t,mK=e=>{let{parent:t}=e;if(!("MemberExpression"===t.type&&t.object===e&&!t.computed&&!t.optional&&"Identifier"===t.property.type&&"length"===t.property.name)||(e=>{let t=e;for(;mH(t.parent,t);)t=t.parent;return ns(t)})(t))return!1;let r=t.parent;return"CallExpression"!==r.type||r.callee!==t},mG=e=>{let t,r;return"ForOfStatement"===e.parent.type&&e.parent.right===e||(e=>{let{parent:t}=e;return"SpreadElement"===t.type&&t.argument===e&&["ArrayExpression","CallExpression","NewExpression"].includes(t.parent.type)})(e)||tP(t=e.parent.parent,{method:"forEach",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.object===e&&"ArrowFunctionExpression"===(r=t.arguments[0]).type&&1===r.params.length&&"RestElement"!==r.params[0].type},mX={create:e=>{let{minimumItems:t}=e.options[0],{sourceCode:r}=e;e.on("Identifier",n=>{let o,{parent:a}=n;if(!((e,t)=>{let{parent:r}=e;return"VariableDeclarator"===r.type&&r.id===e&&!!r.init&&"VariableDeclaration"===r.parent.type&&("ExportNamedDeclaration"!==r.parent.parent.type||r.parent.parent.declaration!==r.parent)&&mV(r.init,t.getScope(r.init))})(n,r))return;if(t>0){var i,s;let r=(i=a.init,s=e,"ArrayExpression"===i.type?m_(i.elements)?void 0:i.elements.length:tS(i,{name:"Array",optional:!1},tE)?((e,t)=>{if(m_(e.arguments))return;if(1!==e.arguments.length)return e.arguments.length;let r=rN(e.arguments[0],t);if(!r)return;let{value:n}=r;return"number"!=typeof n?1:mz(n)?n:void 0})(i,s):tP(i,{object:"Array",method:"of",optionalCall:!1,optionalMember:!1})?m_(i.arguments)?void 0:i.arguments.length:tP(i,{object:"Array",method:"from",optionalCall:!1,optionalMember:!1})?((e,t)=>{let[r]=e.arguments;if(!r||"SpreadElement"===r.type)return;if("ArrayExpression"===r.type)return m_(r.elements)?void 0:r.elements.length;let n=td(r);return void 0!==n?[...n].length:((e,t)=>{if("ObjectExpression"!==e.type||1!==e.properties.length)return;let[r]=e.properties;if((e=>{if("Property"!==e.type||e.computed)return!1;let{key:t}=e;return"Identifier"===t.type&&"length"===t.name||"Literal"===t.type&&"length"===t.value})(r)){let e=rN(r.value,t);return mz(e?.value)?e.value:void 0}})(r,t)})(i,s):void 0);if(void 0===r||r<t)return}let l=eD(r.getScope(n),n);if(!l)return;let u=(e=>{let t=[],r=[],n=[];for(let o of e){if(mq(o)){t.push(o);continue}if(mK(o)){r.push(o),n.push(o);continue}if(mG(o)){n.push(o);continue}return}return{includes:t,lengths:r,extra:n}})(nN(l).filter(e=>e!==n));if(!u||0===u.includes.length||u.extra.length>0&&(o=a.init,!("ArrayExpression"===o.type&&!m_(o.elements)&&o.elements.every(Boolean)&&o.elements.every(t=>{let r;return(r=rN(t,e))&&rM(r.value)&&!Object.is(r.value,-0)}))||0!==rq(o.elements,e).length)||1===u.includes.length&&!((e,t)=>{let r=t.parent.parent.parent,{parent:n}=e.parent;for(;n&&n!==r;){if(mW.has(n.type))return!0;n=n.parent}return!1})(u.includes[0],n))return;let p={node:n,messageId:mM,data:{name:n.name}},c=n.typeAnnotation&&((e,t)=>{if("TSArrayType"===e.type){if(mJ(t,e,e.elementType))return;return`Set<${t.getText(e.elementType)}>`}if("TSTypeOperator"===e.type&&"readonly"===e.operator&&"TSArrayType"===e.typeAnnotation.type){if(mJ(t,e,e.typeAnnotation.elementType))return;return`ReadonlySet<${t.getText(e.typeAnnotation.elementType)}>`}if("TSTypeReference"!==e.type||"Identifier"!==e.typeName.type)return;let r=e.typeArguments??e.typeParameters;if(r?.params.length===1&&!mJ(t,e,r)){if("Array"===e.typeName.name)return`Set${t.getText(r)}`;if("ReadonlyArray"===e.typeName.name)return`ReadonlySet${t.getText(r)}`}})(n.typeAnnotation.typeAnnotation,r),d=function*(e){for(let t of(c&&(yield e.replaceText(n.typeAnnotation.typeAnnotation,c)),yield e.insertTextBefore(n.parent.init,"new Set("),yield e.insertTextAfter(n.parent.init,")"),u.includes))yield e.replaceText(t.parent.property,"has");for(let t of u.lengths)yield e.replaceText(t.parent.property,"size")};return n.typeAnnotation&&!c?p.suggest=[{messageId:m$,fix:d}]:p.fix=d,p})},meta:{type:"suggestion",docs:{description:"Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{minimumItems:{type:"integer",minimum:0,description:"The minimum known array size before `Set#has()` is enforced."}}}],defaultOptions:[{minimumItems:0}],messages:{[mM]:"`{{name}}` should be a `Set`, and use `{{name}}.has()` to check existence or non-existence.",[m$]:"Switch `{{name}}` to `Set`."},languages:["js/js"]}},mY=e=>tP(e.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&e.parent.arguments[0]===e&&tS(e.parent.callee.object,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1},tb),mZ="prefer-string-raw",mQ="unnecessary-string-raw";function m0(e,t=""){return e.replaceAll(RegExp(String.raw`\\(?<escapedCharacter>[\\${t}])`,"g"),"$<escapedCharacter>")}let m1="prefer-switch",m2=(e,t)=>e===t||rf(e,t),m3=({left:e,right:t})=>[e,t].filter(e=>!("Literal"===e.type||tV(e))),m5=new o(["WhileStatement","DoWhileStatement","ForStatement","ForOfStatement","ForInStatement","SwitchStatement"]),m8=e=>{for(;e.parent;e=e.parent)if(m5.has(e.type))return e},m9=(e,t,r)=>{let{sourceCode:n}=r;return n.getRange(e)[0]>=n.getRange(t)[0]&&n.getRange(e)[1]<=n.getRange(t)[1]},m6={create:e=>{let t={...e.options[0]},{sourceCode:r}=e,n=new o,a=[],i=new o;e.on("IfStatement",e=>{n.add(e)}),e.on("BreakStatement",e=>{e.label||a.push(e)}),e.on("Program:exit",function*(){for(let s of n){if(i.has(s))continue;let{discriminant:n,ifStatements:l}=function(e){let t,r=[];for(;e&&"IfStatement"===e.type;e=e.alternate){let{test:n}=e,o=function(e){let t=[e],r=[];for(;t.length>0;){if("LogicalExpression"===(e=t.pop()).type&&"||"===e.operator){t.push(e.right,e.left);continue}if("BinaryExpression"!==e.type||"==="!==e.operator)return[];r.push(e)}return r}(n);if(0===o.length)break;t||=m3(o[0]);let a=function(e,t){for(let{left:r,right:n}of e)if(0===(t=t.filter(e=>m2(e,r)||m2(e,n))).length)break;return t}(o,t);if(0===a.length)break;t=a,r.push({statement:e,compareExpressions:o})}return{ifStatements:r,discriminant:t&&t[0]}}(s);if(!n||l.length<t.minimumCases)continue;for(let{statement:e}of l)i.add(e);let u={loc:{start:r.getLoc(s).start,end:r.getLoc(s.consequent).start},messageId:m1};if(!e0(n,r)&&l.every(({statement:t})=>!function(e,t,r){for(let n of e){if(!m9(n,t,r))continue;let e=m8(n);if(!e||m9(t,e,r))return!0}return!1}(a,t,e))){let a=function({discriminant:e,ifStatements:t},r,n){let{sourceCode:a}=r,i=a.getText(e);return function*(s,{abort:l}){let u=t[0].statement,p=rW(u,r),c=rX(r);t.some(({statement:e})=>{let{consequent:t,alternate:n}=e;return r9(r,[a.getRange(e)[0],a.getRange(t)[0]])||n&&r9(r,[a.getRange(t)[1],a.getRange(n)[0]])})&&l();let d=new o;for(let{compareExpressions:n}of t)for(let{left:t,right:o}of n){let n=m2(t,e)?o:t,i=eJ(n,r.sourceCode.getScope(n)),s=i?`value:${typeof i.value}:${String(i.value)}`:`text:${a.getText(n)}`;d.has(s)&&l(),d.add(s)}yield s.insertTextBefore(u,`switch (${i}) {`);let m=t.at(-1).statement;if(m.alternate){let{alternate:e}=m;yield s.insertTextBefore(e,`${c}${p}default: `)}for(let{statement:r,compareExpressions:n}of t){let{consequent:t,alternate:o}=r;if(o){let[,e]=a.getRange(t),[r]=a.getRange(o);yield s.removeRange([e,r])}let i=[a.getRange(r)[0],a.getRange(t)[0]];for(let{left:r,right:o}of(yield s.removeRange(i),n)){let n=m2(r,e)?o:r,i=a.getText(n);yield s.insertTextBefore(t,`${c}${p}case ${i}: `)}(function e(t){switch(t.type){case"ReturnStatement":case"ThrowStatement":return!1;case"IfStatement":return!t.alternate||e(t.consequent)||e(t.alternate);case"BlockStatement":{let r=function e(t){let{body:r}=t;for(let t=r.length-1;t>=0;t--){let n=r[t];if("FunctionDeclaration"!==n.type&&"EmptyStatement"!==n.type){if("BlockStatement"===n.type){let t=e(n);if(t)return t;continue}return n}}}(t);return!r||e(r)}default:return!0}})(t)&&(yield function*(e,t,r,n,o){if("BlockStatement"===e.type){let a=r.getLastToken(e);yield t.insertTextBefore(a,`${o}${n}break;${o}${n}`)}else yield t.insertTextAfter(e,`${o}${n}break;`)}(t,s,a,p,c),yield function*(e,t,r,n){e&&"BlockStatement"!==e.type&&(yield t.insertTextBefore(e,`{${n}${r}`),yield t.insertTextAfter(e,`${n}${r}}`))}(t,s,p,c))}m.alternate||("no-default-comment"===n.emptyDefaultCase?yield s.insertTextAfter(u,`${c}${p}// No default`):"do-nothing-comment"===n.emptyDefaultCase&&(yield s.insertTextAfter(u,`${c}${p}default:${c}${p}// Do nothing`))),yield s.insertTextAfter(u,`${c}${p}}`)}}({discriminant:n,ifStatements:l},e,t);e0(n,r,{considerGetters:!0})?u.suggest=[{messageId:m1,fix:a}]:u.fix=a}yield u}})},meta:{type:"suggestion",docs:{description:"Prefer `switch` over multiple `else-if`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{minimumCases:{type:"integer",minimum:2,description:"The minimum number of `if`/`else if` cases before suggesting a `switch` statement."},emptyDefaultCase:{enum:["no-default-comment","do-nothing-comment","no-default-case"],description:"How to handle an empty `default` case."}}}],defaultOptions:[{minimumCases:3,emptyDefaultCase:"no-default-comment"}],messages:{[m1]:"Use `switch` instead of multiple `else-if`."},languages:["js/js"]}},m4="require-number-to-fixed-digits-argument";function m7(e){let t=e.match(/^[ \t]*(?=\S)/gm);if(!t)return e;let r=1/0;for(let e of t)r=Math.min(r,e.length);return 0===r||1/0===r?e:e.replace(RegExp(`^[ \\t]{${r}}`,"gm"),"")}let fe="template-indent",ft=(e,t=new o)=>e.map((e,r)=>t.has(r+1)||""===e.trim()?"":e).join("\n"),fr=[{type:"object",additionalProperties:!1,properties:{indent:{oneOf:[{type:"string",pattern:/^\s+$/.source,description:"Whitespace string to use as indentation."},{type:"integer",minimum:1,description:"Number of spaces to use as indentation."}],description:"The indentation to use inside the template literal."},tags:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Tagged template names to check."},functions:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Function names whose template literal arguments to check."},selectors:{type:"array",uniqueItems:!0,items:{type:"string",minLength:1,pattern:/\S/.source},description:"AST selectors for template literals to check."},comments:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Comment patterns to mark template literals for checking."}}}],fn="no-await-in-promise-methods/error",fo="no-await-in-promise-methods/suggestion",fa=["all","allSettled","any","race"],fi=e=>tP(e,{object:"Promise",methods:fa,optionalMember:!1,optionalCall:!1,argumentsLength:1})&&"ArrayExpression"===e.arguments[0].type,fs="no-negation-in-equality-check/error",fl="no-negation-in-equality-check/suggestion",fu=new o(["===","!==","==","!="]),fp=e=>"UnaryExpression"===e.type&&e.prefix&&"!"===e.operator;function fc(e,{methods:t,messageId:r,checkArrayReceiver:n=!1}){e.on("CallExpression",o=>{if(!tP(o,{methods:t,argumentsLength:2,optionalCall:!1}))return;let a=o.arguments[1],i=function(e,t){if("Identifier"===e.type&&"Infinity"===e.name)return"Infinity";if(tL(e,{object:"Number",property:"POSITIVE_INFINITY",computed:!1,optional:!1}))return"Number.POSITIVE_INFINITY";let r="ChainExpression"===e.type;if(r&&(e=e.expression),tL(e,{property:"length",computed:!1})&&rf(t,e.object))return`${"Identifier"===t.type?t.name:"…"}${r?"?.":"."}length`}(a,o.callee.object);if(!i||n&&od(o.callee.object,e))return;let s=o.callee.property.name,l={description:i};return"splice"===s?l.argumentName="deleteCount":"toSpliced"===s&&(l.argumentName="skipCount"),{node:a,messageId:r,data:l,fix:t=>sW(t,a,e)}})}let fd="no-unnecessary-slice-end",fm="catch-error-name",ff=[{type:"object",additionalProperties:!1,properties:{name:{type:"string",description:"The expected name for the error variable."},ignore:{type:"array",items:{type:["string","object"],additionalProperties:!0},uniqueItems:!0,description:"Patterns to ignore."}}}],fg="invalidExport",fy="doNotPassMessageToSuper",fh="doNotAssignMessageWithoutSetter",fx="missingOptionsParameter",fb="invalidOptionsParameter",fv="passMessageToSuper",fE="passOptionsToSuper",fS=/^(?:[A-Z][\da-z]*)*Error$/,fT=new o(["AggregateError","SuppressedError"]),fC=(e,t,r)=>{let{sourceCode:n}=r,o=rX(r),[a]=t.body.body,i=a?rY(a,r):rY(t,r)+rK(r),s=n.text.startsWith(o,n.getRange(t.body)[0]+1);return`${o}${i}name = '${e}';${s?"":o+rY(t,r)}`},fD=e=>e?.type==="Identifier"?e.name:e?.type!=="MemberExpression"||e.computed||"Identifier"!==e.property.type?void 0:e.property.name,fw=e=>{let t=fD(rx(e.superClass));return!!t&&fS.test(t)},fA=(e,t)=>"ExpressionStatement"===e.type&&"AssignmentExpression"===e.expression.type&&"="===e.expression.operator&&tU(e.expression.left,`this.${t}`),fk=(e,t)=>({node:e,message:`The \`name\` property should be set to \`${t}\`.`}),fI=(e,t)=>td(rx(e?.value))===t,fj=(e,t)=>"MethodDefinition"===e.type&&e.kind===t&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"message"===e.key.name,fR=e=>!e||tV(rx(e)),fF=e=>e?.type==="TSParameterProperty"?fF(e.parameter):e?.type==="Identifier"?e:e?.type==="AssignmentPattern"&&"Identifier"===e.left.type?e.left:void 0,fB=e=>fF(rx(e))?.name==="options",fL=(e,t)=>eL(e.getTokenAfter(t,{includeComments:!0})),fN=(e,t)=>"ThisExpression"===e.type||"Super"===e.type||t1(e,t).some(e=>fN(e,t)),fP=e=>{let t=fF(e);return t.typeAnnotation?t.optional?"options?: ErrorOptions":"options: ErrorOptions":"options"},fM=(e,t,r)=>n=>{let{sourceCode:o}=e;if(o.getCommentsInside(t).length>0)return;let a=t.arguments;if(0===a.length){let e=o.getTokenAfter(t.callee,e=>"("===e.value);return n.insertTextAfter(e,`${r}, options`)}if(!(1!==a.length||tl(a[0],e)))return"undefined"!==r&&fR(a[0])?n.replaceText(a[0],`${r}, options`):n.insertTextAfter(a[0],", options")},f$=(e,t)=>(e=rx(e),e?.type==="Identifier"&&e.name===t.name);function*fO(e,t){let r,n;if(!fw(t)||null===t.id)return;let{name:o}=t.id,a=sg(o).replace(/(?:error)?$/i,"Error");o!==a&&(yield{node:t.id,message:`Invalid class name, use \`${a}\`.`});let{body:i}=t.body,{sourceCode:s}=e,l=i.find(e=>"constructor"===e.kind&&e.value.body)??i.find(e=>"constructor"===e.kind),u=i.find(e=>"PropertyDefinition"===e.type&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"name"===e.key.name);if(!l){if(fI(u,o))return;let r=s.getRange(t.body);yield{...fk(u?.value??t,o),fix(n){if(u?.value){let e=rx(u.value);if(void 0!==td(e))return n.replaceText(e,`'${o}'`);if(s.getCommentsInside(u.value).length>0)return;return n.replaceText(u.value,`'${o}'`)}return u?n.replaceText(u,fC(o,t,e).trim()):n.insertTextAfterRange([r[0],r[0]+1],fC(o,t,e))}};return}let p=i.some(e=>fj(e,"get")),c=i.some(e=>fj(e,"set"));yield*function*(e,t,r){let{sourceCode:n}=e,o=t.value.body;if(!o)return;let a=o.body,{hasMessageGetter:i,hasMessageSetter:s,checkOptions:l}=r,u=a.findIndex(e=>"ExpressionStatement"===e.type&&"CallExpression"===e.expression.type&&tU(e.expression.callee,"super")),p=a[u],c=a.findIndex(e=>fA(e,"message")),d=i||s,m=!1;if(p){if(d&&!fR(p.expression.arguments[0]))m=!0,yield{node:p,messageId:fy};else if(i&&!s&&-1!==c)m=!0,yield{node:a[c],messageId:fh};else if(!s&&-1!==c){let r=a[c];m=!0,yield{node:p,message:"Pass the error message to `super()` instead of setting `this.message`.",*fix(o){if(c<u)return;let i=r.expression.right,[s,l]=t.value.params,d=fF(s),m=1===t.value.params.length&&d&&!fB(s),[,f]=n.getRange(a[c-1]),[,g]=n.getRange(r);if(m&&fL(n,s)||ne(e,[f,g])||fL(n,r))return;let y=p.expression;if(n.getCommentsInside(y).length>0)return;let h=m||fB(l);if(0===y.arguments.length){if(c!==u+1||fN(i,n.visitorKeys))return;let t=n.getTokenAfter(y.callee,e=>"("===e.value);yield o.insertTextAfter(t,h?`${ts(i,e)}, options`:ts(i,e))}else{let t;if(t=y.arguments[0],n.getText(rx(t))!==n.getText(rx(i)))return;if(h&&1===y.arguments.length){if(tl(y.arguments[0],e))return;yield o.insertTextAfter(y.arguments[0],", options")}}m&&(yield o.insertTextAfter(s,`, ${fP(s)}`)),yield o.removeRange([f,g])}}}}else m=!0,yield{node:o,message:"Missing call to `super()` in constructor."};let f=function(e,t,r){let{name:n,nameProperty:o}=r,a=t.find(e=>fA(e,"name"));return a?td(rx(a.expression.right))!==n?fk(a.expression.right,n):void 0:fI(o,n)?void 0:fk(o?.value??e,n)}(o,a,r);if(f&&(yield f),f||!l||m)return;let g=((e,t,r,n)=>{let o=t.value.params,a=o[0],i=fF(a);if(0===o.length||!i)return;let s=r.expression,l=o.find(e=>fB(e));if(l===a){if(!fB(s.arguments[1])){let t={node:s,messageId:fE};return f$(s.arguments[0],i)||(t.fix=fM(e,s,"undefined")),t}return}let u=((e,t)=>{let[r,n]=e.arguments,o=rx(n);if(2!==e.arguments.length||"ObjectExpression"!==o.type||1!==o.properties.length||"cause"!==eK(o.properties[0]))return!1;if(t){let e=rx(o.properties[0].value);return"ChainExpression"===e.type&&(e=e.expression),tL(e,{property:"cause",object:fF(t).name})}return void 0!==td(rx(r))})(s,l);if(u&&!l)return;let p=!n&&"message"===i.name,c=p?i.name:"undefined";if(!o[1])return{node:a,messageId:fx,fix:function*(r){let{sourceCode:n}=e,o=t.value.params[0];if(fL(n,o))return;let a=fM(e,s,c)(r);a&&(yield r.insertTextAfter(o,`, ${fP(o)}`),yield a)}};if(!l)return{node:t.key,messageId:fb};if(p&&!f$(s.arguments[0],i))return{node:s,messageId:fv,fix:t=>{let{sourceCode:r}=e;if(r.getCommentsInside(s).length>0)return;let n=s.arguments;if(0===n.length){let e=r.getTokenAfter(s.callee,e=>"("===e.value);return t.insertTextAfter(e,`${c}, options`)}if(!(!fR(n[0])||tl(n[0],e)))return t.replaceText(n[0],1===n.length?`${c}, options`:c)}};if(u||fB(s.arguments[1]))return;let d={node:s,messageId:fE};return f$(s.arguments[0],fF(l))||(d.fix=fM(e,s,c)),d})(e,t,p,d);g&&(yield g)}(e,l,{name:o,nameProperty:u,hasMessageGetter:p,hasMessageSetter:c,checkOptions:o===a&&(n=fD(r=rx(t.superClass)),pw.includes(n)&&!fT.has(n)&&("Identifier"===r.type||tU(r,`globalThis.${n}`)))})}let fU="no-lonely-if",fq=e=>"IfStatement"===e.type&&!e.alternate;function fW(e,t){let r={ifToken:t.getFirstToken(e),openingParenthesisToken:t.getFirstToken(e,1)},{consequent:n}=e;return r.closingParenthesisToken=t.getTokenBefore(n),"BlockStatement"===n.type&&(r.openingBraceToken=t.getFirstToken(n),r.closingBraceToken=t.getLastToken(n)),r}let fV=(e,t,r)=>r.text.slice(r.getRange(e)[1],r.getRange(t)[0]),fz=e=>e.trim()?e:"",f_=(e,t)=>/\s$/u.test(e)&&/^\s/u.test(t)?e+t.trimStart():e+t,fJ=(e,t)=>fV(e.ifToken,e.openingParenthesisToken,t),fH=(e,t,r)=>{let n,o=fV(e.openingParenthesisToken,e.closingParenthesisToken,r);return tl(e.test,t)?o:"LogicalExpression"===(n=e.test).type&&("||"===n.operator||"??"===n.operator)||"ConditionalExpression"===n.type||"ArrowFunctionExpression"===n.type||"AssignmentExpression"===n.type||"YieldExpression"===n.type||"SequenceExpression"===n.type?`(${o})`:o},fK="no-magic-array-flat-depth",fG="no-negated-condition",fX="identifier",fY="non-identifier",fZ="prefer-negative-index",fQ=new r([["slice",{argumentsIndexes:[0,1],supportObjects:new o(["Array","String","ArrayBuffer",...nM])}],["subarray",{argumentsIndexes:[0,1],supportObjects:new o(nM)}],["splice",{argumentsIndexes:[0],supportObjects:new o(["Array"])}],["toSpliced",{argumentsIndexes:[0],supportObjects:new o(["Array"])}],["at",{argumentsIndexes:[0],supportObjects:new o(["Array","String",...nM])}]]),f0=e=>{let{type:t,property:r}=e;if("MemberExpression"===t&&"Identifier"===r.type)return r.name};var f1=["node:assert","assert","node:assert/strict","assert/strict","node:async_hooks","async_hooks","node:buffer","buffer","node:child_process","child_process","node:cluster","cluster","node:console","console","node:constants","constants","node:crypto","crypto","node:dgram","dgram","node:diagnostics_channel","diagnostics_channel","node:dns","dns","node:dns/promises","dns/promises","node:domain","domain","node:events","events","node:ffi","node:fs","fs","node:fs/promises","fs/promises","node:http","http","node:http2","http2","node:https","https","node:inspector","inspector","node:inspector/promises","inspector/promises","node:module","module","node:net","net","node:os","os","node:path","path","node:path/posix","path/posix","node:path/win32","path/win32","node:perf_hooks","perf_hooks","node:process","process","node:querystring","querystring","node:quic","node:readline","readline","node:readline/promises","readline/promises","node:repl","repl","node:sea","node:sqlite","node:stream","stream","node:stream/consumers","stream/consumers","node:stream/iter","stream/iter","node:stream/promises","stream/promises","node:stream/web","stream/web","node:string_decoder","string_decoder","node:test","node:test/reporters","node:timers","timers","node:timers/promises","timers/promises","node:tls","tls","node:trace_events","trace_events","node:tty","tty","node:url","url","node:util","util","node:util/types","util/types","node:v8","v8","node:vm","vm","node:wasi","wasi","node:worker_threads","worker_threads","node:zlib","zlib","node:zlib/iter","zlib/iter"];function f2(t){if("string"!=typeof t)throw TypeError("Expected a string");return(e??=new o(f1)).has(t)}let f3="prefer-node-protocol",f5="node:",f8="consistent-date-clone/error",f9="no-accessor-recursion/error",f6=e=>"Identifier"===e.type||"PrivateIdentifier"===e.type,f4=e=>tp(e)?e.value:e.name,f7=(e,t)=>"PrivateIdentifier"===e.type==("PrivateIdentifier"===t.type)&&f4(e)===f4(t),ge=(e,t)=>"MemberExpression"===e.parent.type&&e.parent.object===e&&(!e.parent.computed&&f6(e.parent.property)||e.parent.computed&&tp(e.parent.property))&&f7(e.parent.property,t.key),gt=(e,t)=>{if(!ge(e,t))return!1;let r=e.parent,{parent:n}=r;return("AssignmentExpression"===n.type||"AssignmentPattern"===n.type)&&n.left===r||"UpdateExpression"===n.type&&n.argument===r||"ArrayPattern"===n.type&&n.elements.includes(r)||"RestElement"===n.type&&n.argument===r||("ForOfStatement"===n.type||"ForInStatement"===n.type)&&n.left===r||"Property"===n.type&&n.value===r&&"ObjectPattern"===n.parent.type&&n.parent.properties.includes(r.parent)},gr="error/calculate-dirname",gn="error/calculate-filename";function go(e,{modules:t,functionName:r,sourceCode:n}){if(!tS(e,{optional:!1,argumentsLength:1},tb))return!1;let a=new o;return function e(t,o){if("MemberExpression"===t.type)return!!("property"===o&&tL(t,{property:r,computed:!1,optional:!1}))&&e(t.object,"module");if("CallExpression"===t.type)return"module"===o&&tP(t,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalMember:!1,optionalCall:!1})&&i(t.arguments[0]);if("Identifier"!==t.type||a.has(t))return!1;a.add(t);let s=eD(n.getScope(t),t);return!!s&&1===s.defs.length&&function(t,n){if("ImportBinding"===t.type){if(!i(t.parent.source))return!1;let e=t.node;return"module"===n?e?.type==="ImportDefaultSpecifier"||e?.type==="ImportNamespaceSpecifier":e?.type==="ImportSpecifier"&&e.imported.name===r}return"Variable"===t.type&&function t(n,o){let{parent:a}=n;return"VariableDeclarator"===a.type?!!a.init&&a.id===n&&"VariableDeclaration"===a.parent.type&&"const"===a.parent.kind&&e(a.init,o):"Property"===a.type&&!!("property"===o&&a.value===n&&!a.computed&&"Identifier"===a.key.type&&a.key.name===r)&&t(a.parent,"module")}(t.name,n)}(s.defs[0],o)}(e.callee,"property");function i(e){return e?.type==="Literal"&&t.has(e.value)}}function ga(e,t){return go(e,{modules:new o(["url","node:url"]),functionName:"fileURLToPath",sourceCode:t})}function gi(e,t){return go(e,{modules:new o(["path","node:path"]),functionName:"dirname",sourceCode:t})}let gs="no-unnecessary-array-flat-depth",gl="no-unnecessary-array-splice-count",gu="no-useless-error-capture-stack-trace/error",gp="prefer-class-fields/error",gc="prefer-class-fields/suggestion",gd=new o(["AccessorProperty","PropertyDefinition","TSAbstractPropertyDefinition"]),gm="prefer-bigint-literals/error",gf="prefer-bigint-literals/suggestion",gg=(e,t)=>{for(let{prefix:r,base:n}of[{prefix:"0b",base:2},{prefix:"0o",base:8},{prefix:"0x",base:16}])if(e.startsWith(r))return e.slice(2)===t.toString(n);return!1},gy="prefer-classlist-toggle/error",gh="prefer-classlist-toggle/suggestion",gx=e=>tL(e,{property:"classList",computed:!1}),gb=(e,t,r)=>{let n={node:r??e,messageId:gy};return"IfStatement"===e.type||tk(e)||tk(e.parent)?n.fix=t:n.suggest=[{messageId:gh,fix:t}],n},gv=(e,t,r)=>{let{sourceCode:n}=t,o=ts(e,t);return r?(!tl(e,n)&&sn(e,"!")&&(o=`(${o})`),o=`!${o}`):(tl(e,n)||"SequenceExpression"!==e.type||(o=`(${o})`),o)},gE=(e,t)=>tP(e,{methods:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})&&gx(e.callee.object),gS=(e,t)=>rf(e.callee.object,t.callee.object)&&rf(e.arguments[0],t.arguments[0]),gT=(e,t,r)=>t?("ChainExpression"===e.type&&(e=e.expression),gE(e,["contains"])&&gS(e,r))?e:void 0:"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix?gT(e.argument,!t,r):void 0,gC="require-module-attributes",gD="error",gw="suggestion/array",gA="suggestion/object",gk="suggestion/object-assign",gI="suggestion/set",gj="suggestion/map",gR="suggestion/conditional";function gF(e,t,r){return e.getCommentsInside(t).some(t=>{let[n,o]=e.getRange(t);return r.every(([e,t])=>n<e||o>t)})}let gB=(e,t,r)=>gF(r.sourceCode,t,[function(e,t){let{sourceCode:r}=t,{openingParenthesisToken:n,closingParenthesisToken:o,trailingCommaToken:a}=rp(e,t),[,i]=r.getRange(n),[s]=r.getRange(a??o);return[i,s]}(e,r)]),gL=(e,t,r)=>{let{sourceCode:n}=r,o=nN(e);return t.some(e=>{let t=n.getRange(e);return o.some(e=>{let[r,o]=n.getRange(e);return r>=t[0]&&o<=t[1]})})};function gN(e,t){if(!tT(e,{names:t,maximumArguments:1}))return!1;let[r]=e.arguments;return!r||"ArrayExpression"===r.type}function*gP(e,t,r){let n=t.sourceCode.getTokenBefore(e);if("IfStatement"===e.type){let o=t.sourceCode.getTokenAfter(e);o&&iB(n,t,o.value)&&(yield r.insertTextAfter(n,";")),yield sQ(e,t,r);return}let o=!eI(n);yield sQ(e,t,r,o)}function gM(e,t,r,n){let{sourceCode:o}=e,[a,i]=o.getLastTokens(r,2),s=("ArrayExpression"===r.type?r.elements:r.properties).length>0&&!ek(a);return t.insertTextBefore(i,`${s?",":""} ${n}`)}function*g$({context:e,fixer:t,newExpression:r,elementsText:n,nextStatement:o}){if(ru(r,e)){let[o]=r.arguments;if(o)yield gM(e,t,o,n);else{let{openingParenthesisToken:o}=ru(r,e)?rp(r,e):{};yield t.insertTextAfter(o,`[${n}]`)}}else yield t.insertTextAfter(r,`([${n}])`);yield*gP(o,e,t)}function gO(e,t){let{sourceCode:r}=t,n=r.getFirstToken(e),[o,a]=r.getLastTokens(e,2),[,i]=r.getRange(n),[s]=r.getRange(ek(o)?o:a);return[i,s]}let gU=(e,t)=>"__proto__"===eK(e,t.getScope(e)),gq=(e,t)=>e.properties.some(e=>"Property"===e.type&&gU(e,t)),gW=e=>e.properties.some(e=>"Property"===e.type&&"init"!==e.kind),gV={testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,expression:r}){if(!("AssignmentExpression"===r.type&&"="===r.operator&&tL(r.left,{object:t.name,optional:!1})))return;let n=r.right,o=r.left,{property:a}=o;if(!("PrivateIdentifier"===a.type||gL(t,o.computed?[a,n]:[n],e)))return r},getProblem(e,t){let{context:r,assignType:n,getFix:o,valueNode:a}=t,{sourceCode:i}=r,{left:s,right:l}=e,{property:u}=s,p=i.getTokenAfter(s,t=>"Punctuator"===t.type&&t.value===e.operator),c={node:e,loc:{start:i.getLoc(e).start,end:i.getLoc(p).end},messageId:gD,data:{objectType:"object"}};if(gF(i,t.nextStatement,[u,l].map(e=>ti(e,r)))||gU(s,i)||gW(a))return c;let d=o(t,{assignmentExpression:e,memberExpression:s,property:u,value:l});return s.computed&&e0(u,i)||e0(l,i)?c.suggest=[{messageId:gA,data:{assignType:n},fix:d}]:c.fix=d,c},getFix:({context:e,valueNode:t,nextStatement:r},{memberExpression:n,property:o,value:a})=>function*(i){let s=ts(o,e);n.computed&&(s=`[${s}]`);let l=ts(a,e),u=`${s}: ${l},`,[p,c]=e.sourceCode.getLastTokens(t,2),d=t.properties.length>0&&!ek(p);yield i.insertTextBefore(c,`${d?",":""} ${u}`),yield gP(r,e,i)}},gz={testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,expression:r}){if(!tP(r,{object:"Object",method:"assign",minimumArguments:2,optionalMember:!1,optionalCall:!1}))return;let[n,o]=r.arguments;if(!("Identifier"!==n.type||n.name!==t.name||"SpreadElement"===o.type||gL(t,[o],e)))return r},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,[,i]=e.arguments,s={node:e.callee,messageId:gD,data:{objectType:"object"}};if(gW(t.valueNode)||"ObjectExpression"===i.type&&(gW(i)||gq(i,a)))return s;let l=o(t,{callExpression:e,firstValue:i}),u=["ObjectExpression"===i.type?gO(i,r):ti(i,r)];return gF(a,t.nextStatement,u)||(e0(i,a)?s.suggest=[{messageId:gk,data:{description:"ObjectExpression"===i.type?"Move properties to":"Spread properties in",assignType:n},fix:l}]:s.fix=l),s},getFix:({context:e,valueNode:t,nextStatement:r},{callExpression:n,firstValue:o})=>function*(a){let i="ObjectExpression"===o.type?function(e,t){let[r,n]=gO(e,t);return t.sourceCode.text.slice(r,n)}(o,e):`...${ts(o,e)}`;(""!==i.trim()&&(yield gM(e,a,t,i)),2!==n.arguments.length)?yield a.removeRange(sq(o,e)):yield gP(r,e,a)}},g_={testValue:e=>gN(e,["Map","WeakMap"]),getProblematicNode({context:e,variable:t,expression:r}){if(!(!tP(r,{object:t.name,method:"set",argumentsLength:2,optionalCall:!1})||gL(t,r.arguments,e)))return r},getProblem(e,t){let{context:r,assignType:n,valueNode:o,getFix:a}=t,{sourceCode:i}=r,s={node:e.callee,messageId:gD,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return gB(e,t.nextStatement,r)||(e.arguments.some(e=>e0(e,i))?s.suggest=[{messageId:gj,data:{assignType:n},fix:l}]:s.fix=l),s},getFix:({context:e,nextStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=rc(e,r,!1);return g$({context:e,fixer:o,newExpression:n,elementsText:`[${a}]`,nextStatement:t})}},gJ=[{testValue:e=>e?.type==="ArrayExpression",getProblematicNode({context:e,variable:t,expression:r}){if(tP(r,{object:t.name,methods:["push","unshift"],optionalMember:!1,optionalCall:!1})&&r.arguments.length>0&&!gL(t,r.arguments,e))return r},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,i=e.callee,s=i.property,l={node:i,messageId:gD,data:{objectType:"array"}},u="unshift"===s.name,p=o(t,{callExpression:e,isPrepend:u});return u&&t.valueNode.elements.some(e=>e&&e0(e,a))||gB(e,t.nextStatement,r)||(e.arguments.some(e=>e0(e,a))?l.suggest=[{messageId:gw,fix:p,data:{operation:u?"Prepend":"Append",assignType:n}}]:l.fix=p),l},getFix:({context:e,valueNode:t,nextStatement:r},{callExpression:n,isPrepend:o})=>function*(a){let i=rc(e,n,!1);yield o?a.insertTextAfter(e.sourceCode.getFirstToken(t),`${i}, `):gM(e,a,t,i),yield gP(r,e,a)}},gV,gz,{testValue:e=>gN(e,["Set","WeakSet"]),getProblematicNode({context:e,variable:t,expression:r}){let n=r;if("ChainExpression"===n.type&&(n=n.expression),!(!tP(n,{object:t.name,method:"add",argumentsLength:1,optionalMember:!1,optionalCall:!1})||gL(t,n.arguments,e)))return n},getProblem(e,t){let{context:r,assignType:n,valueNode:o,getFix:a}=t,{sourceCode:i}=r,s={node:e.callee,messageId:gD,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return gB(e,t.nextStatement,r)||(e.arguments.some(e=>e0(e,i))?s.suggest=[{messageId:gI,data:{assignType:n},fix:l}]:s.fix=l),s},getFix:({context:e,nextStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=rc(e,r,!1);return g$({context:e,fixer:o,newExpression:n,elementsText:a,nextStatement:t})}},g_];function gH(e){if("BlockStatement"===e.type&&1===e.body.length&&([e]=e.body),"ExpressionStatement"===e.type)return e.expression}function gK(e,t,r){let{context:n,valueNode:o}=t,a=r.getProblematicNode({...t,expression:e});if(!a)return;if(r===gV){let{left:e,right:t}=a,{property:r,computed:i}=e,s=ts(r,n);return{text:`{${i?`[${s}]`:s}: ${ts(t,n)}}`,inputs:i?[r,t]:[t],canFix:!gU(e,n.sourceCode)&&!gW(o)}}if(r===gz){if(2!==a.arguments.length)return;let e=a.arguments[1],t=!gW(o)&&("ObjectExpression"!==e.type||!gq(e,n.sourceCode));return{text:ts(e,n),inputs:[e],canFix:t}}let i=rc(n,a,!1);return{text:r===g_?`[[${i}]]`:`[${i}]`,inputs:a.arguments,method:a.callee.property.name}}let gG={create:e=>{for(let t of gJ)e.on(["VariableDeclarator","AssignmentExpression"],r=>(function(e,t,r){let n,{testValue:o,getProblematicNode:a,getProblem:i,getFix:s}=r,l="AssignmentExpression"===t.type,[u,p]=(l?["left","right"]:["id","init"]).map(e=>t[e]);if(!("Identifier"===u.type&&o(p)))return;let c=t.parent;if(!(l&&"="===t.operator&&"ExpressionStatement"===c.type&&c.expression===t||!l&&"VariableDeclaration"===(n=t.parent).type&&n.declarations.at(-1)===t))return;let d=sm(c,e);if(!["ExpressionStatement","IfStatement"].includes(d?.type))return;let m="VariableDeclarator"===t.type?e.sourceCode.getDeclaredVariables(t).find(e=>1===e.defs.length&&e.defs[0].name===t.id):eD(e.sourceCode.getScope(t),t.left.name);if(!m)return;let f={context:e,variable:m,valueNode:p,nextStatement:d,assignType:l?"assignment":"declaration",getFix:s},g=function(e){if("IfStatement"===e.type){let t=gH(e.consequent),r=e.alternate&&gH(e.alternate);return t&&(!e.alternate||r)?{test:e.test,consequent:t,alternate:r}:void 0}let{expression:t}=e;return t?.type==="ConditionalExpression"?t:t?.type==="LogicalExpression"&&"&&"===t.operator?{test:t.left,consequent:t.right}:void 0}(d);if(g){if(!e.options[0].checkConditionals)return;return function(e,t,r){let{context:n,variable:o,valueNode:a,nextStatement:i,assignType:s}=t,{sourceCode:l}=n;if(gL(o,[e.test],n))return;let u=gK(e.consequent,t,r),p=e.alternate&&gK(e.alternate,t,r);if(!u||e.alternate&&!p||p&&u.method!==p.method)return;let c="ObjectExpression"===a.type,d=c?"object":"array";"NewExpression"===a.type&&(d=`\`${a.callee.name}\``);let m={node:i,messageId:gD,data:{objectType:d}},f=[u,p].some(e=>e?.canFix===!1);if(nR(n.physicalFilename)||l.parserServices.esTreeNodeToTSNodeMap||function(e,t){let{end:r}=t.getLoc(e);return t.getCommentsInside(e).length>0||t.getCommentsBefore(e).length>0||t.getCommentsAfter(e).some(e=>t.getLoc(e).start.line===r.line)}(i,l)||f)return m;let g="unshift"===u.method,y=function*(t){let r=ts(e.test,n),o=`...((${r}) ? ${u.text} : ${p?.text??(c?"{}":"[]")})`;"NewExpression"===a.type?yield g$({context:n,fixer:t,newExpression:a,elementsText:o,nextStatement:i}):(yield g?t.insertTextAfter(l.getFirstToken(a),`${o}, `):gM(n,t,a,o),yield gP(i,n,t))};return[e.test,...u.inputs,...p?.inputs??[]].some(e=>e0(e,l))||g&&a.elements.length>0?m.suggest=[{messageId:gR,data:{assignType:s},fix:y}]:m.fix=y,m}(g,f,r)}if("ExpressionStatement"!==d.type)return;let y=a({...f,expression:d.expression});if(y)return i(y,f)})(e,r,t))},meta:{type:"suggestion",docs:{description:"Disallow immediate mutation after variable assignment.",recommended:!0},fixable:"code",hasSuggestions:!0,schema:[{type:"object",properties:{checkConditionals:{type:"boolean",description:"Whether to check conditional mutations."}},additionalProperties:!1}],defaultOptions:[{checkConditionals:!1}],messages:{[gD]:"Immediate mutation on {{objectType}} is not allowed.",[gw]:"{{operation}} the elements to the {{assignType}}.",[gA]:"Move this property to the {{assignType}}.",[gk]:"{{description}} the {{assignType}}.",[gI]:"Move the element to the {{assignType}}.",[gj]:"Move the entry to the {{assignType}}.",[gR]:"Move the conditional mutation to the {{assignType}}."},languages:["js/js"]}},gX="no-useless-collection-argument/error",gY="no-useless-collection-argument/suggestion",gZ="prefer-response-static-json",gQ=/([\p{Ll}\d])(\p{Lu})/gu,g0=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,g1=/(\d)\p{Ll}|(\p{L})\d/u,g2=/[^\p{L}\d]+/giu,g3="$1\0$2";function g5(e){let t=e.trim();t=(t=t.replace(gQ,g3).replace(g0,g3)).replace(g2,"\0");let r=0,n=t.length;for(;"\0"===t.charAt(r);)r++;if(r===n)return[];for(;"\0"===t.charAt(n-1);)n--;return t.slice(r,n).split(/\0/g)}function g8(e){let t=g5(e);for(let e=0;e<t.length;e++){let r=t[e],n=g1.exec(r);if(n){let o=n.index+(n[1]??n[2]).length;t.splice(e,1,r.slice(0,o),r.slice(o))}}return t}function g9(e,t){let[r,n,o]=yr(e,t);return r+n.map(g7(t?.locale)).join(t?.delimiter??" ")+o}function g6(e,t){let[r,n,o]=yr(e,t),a=g7(t?.locale),i=yt(a,ye(t?.locale));return r+n.map((e,t)=>0===t?a(e):i(e,t)).join("")+o}function g4(e,t){let[r,n,o]=yr(e,t),a=yt(g7(t?.locale),ye(t?.locale));return r+n.map(a).join("")+o}function g7(e){return!1===e?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function ye(e){return t=>t.toLocaleUpperCase(e)}function yt(e,t){return(r,n)=>{let o=r[0];return(n>0&&o>="0"&&o<="9"?"_"+o:t(o))+e(r.slice(1))}}function yr(e,t={}){let r=t.split??(t.separateNumbers?g8:g5),n=t.prefixCharacters??"",o=t.suffixCharacters??"",a=0,i=e.length;for(;a<e.length;){let t=e.charAt(a);if(!n.includes(t))break;a++}for(;i>a;){let t=i-1,r=e.charAt(t);if(!o.includes(r))break;i=t}return[e.slice(0,a),r(e.slice(a,i)),e.slice(i)]}let yn="filename-case",yo="directory-case",ya="filename-extension",yi=e=>!/^[\w-]$/.test(e),ys=new o(["index.js","index.mjs","index.cjs","index.ts","index.tsx","index.vue"]),yl=new Intl.ListFormat("en-US",{type:"disjunction"}),yu=/^[\da-z]+$/i,yp=/^[A-Z]{3,}(?=\d*[A-Z](?:[a-z]|\d+[a-z]))/,yc=e=>e>="0"&&e<="9",yd=e=>e>="a"&&e<="z",ym=e=>e>="A"&&e<="Z";function yf(e){if(!yd(e[0]))return!1;for(let t=1;t<e.length;t++){let r=e[t];if(yd(r)||yc(r))continue;if(!ym(r))return!1;let n=t;for(;ym(e[t+1]);)t++;if(t!==n){if(yd(e[t+1])){t--;continue}for(;yc(e[t+1]);)t++;if(t===e.length-1)return!0;if(!ym(e[t+1]))return!1}}return!0}function yg(e){if(!yu.test(e))return!1;let t=yp.exec(e)?.[0],r=t&&e.slice(t.length);return!!(r&&g4(r)===r)}let yy={camelCase:{fn:function(e){return g6(g6(e))},name:"camel case"},camelCaseWithAcronyms:{fn:function(e){if(yf(e))return e;let t=g6(e);return yf(t)?t:g6(t)},name:"camel case with acronyms"},kebabCase:{fn:function(e,t){return g9(e,{delimiter:"-",...t})},name:"kebab case"},snakeCase:{fn:function(e,t){return g9(e,{delimiter:"_",...t})},name:"snake case"},pascalCase:{fn:function(e){if(yg(e))return e;let t=g4(e);return yg(t)?t:g4(t)},name:"pascal case"}};function yh(e,t){return e.filter(({ignored:e})=>!e).every(({word:e})=>t.some(t=>t(e)===e))}function yx(e,t,{leading:r,trailing:n}){return[...new o(t.map(t=>{let o=e.map(({word:e,ignored:r})=>r?e:t(e)).join("");return`${r}${o}${n}`}))]}function yb(e,t){if(t.some(e=>"string"!=typeof e&&!T.isRegExp(e)))throw TypeError(`The \`${e}\` option only accepts strings and regular expressions.`)}let yv=/^_+/;function yE(e){let t,r=yv.exec(e)?.[0]??"",n=e.slice(r.length),o=[];for(let e of n){let r=yi(e);t?.ignored===r?t.word+=e:(t={word:e,ignored:r},o.push(t))}return{leading:r,words:o}}function yS(e){let t;return t=e.map(e=>yy[e].name),yl.format(t)}let yT={ignore:{type:"array",items:{type:["string","object"],additionalProperties:!0},uniqueItems:!0,description:"Path segment patterns to ignore."},multipleFileExtensions:{type:"boolean",description:"Whether to treat additional, dot-separated parts of a filename as file extensions."},checkDirectories:{type:"boolean",description:"Whether to check directory names."},directoryRoots:{type:"array",items:{type:["string","object"],additionalProperties:!0},uniqueItems:!0,description:"Directory root paths or patterns, relative to the current working directory."}},yC=[{description:"The rule options.",anyOf:[{type:"object",properties:{case:{enum:["camelCase","camelCaseWithAcronyms","snakeCase","kebabCase","pascalCase"],description:"The filename and directory name case style."},...yT},additionalProperties:!1},{type:"object",properties:{cases:{type:"object",properties:{camelCase:{type:"boolean",description:"Whether to allow camelCase filenames and directory names."},camelCaseWithAcronyms:{type:"boolean",description:"Whether to allow camelCase filenames and directory names with acronym segments."},snakeCase:{type:"boolean",description:"Whether to allow snake_case filenames and directory names."},kebabCase:{type:"boolean",description:"Whether to allow kebab-case filenames and directory names."},pascalCase:{type:"boolean",description:"Whether to allow PascalCase filenames and directory names."}},additionalProperties:!1,description:"The allowed filename and directory name case styles."},...yT},additionalProperties:!1}]}],yD="consistent-template-literal-escape",yw=["entries","keys","values"],yA=["drop","filter","flatMap","map","take"],yk=["concat","from","zip","zipKeyed"],yI=new o(["ArrayIterator","Generator","IterableIterator","Iterator","IteratorObject","MapIterator","RegExpStringIterator","SetIterator","StringIterator"]),{isTarget:yj}=oe({allowNullishInMixedUnion:!0,preferTypeReferenceDefinitions:!0,targetTypeNames:yI}),yR=e=>{for(;rh(e)||"TSInstantiationExpression"===e.type||"ChainExpression"===e.type||"ParenthesizedExpression"===e.type;)e=e.expression;return e},yF=(e,t,r)=>tP(e,{methods:yA,minimumArguments:1,computed:!1})&&yP(e.callee.object,t,r),yB=new o(["ObjectExpression","ArrayExpression","Literal","TemplateLiteral","FunctionExpression","ArrowFunctionExpression","ClassExpression"]),yL=(e,t)=>(e=yR(e),!!yB.has(e.type)||"NewExpression"===e.type&&"Identifier"===e.callee.type&&(eD(t.sourceCode.getScope(e.callee),e.callee)?.defs.some(e=>"ClassName"===e.type)??!1)),yN=(e,t)=>{if("Identifier"!==e.type)return;let r=eD(t.sourceCode.getScope(e),e);if(r?.defs.length!==1||r.references.some(e=>e.isWrite()&&!e.init))return;let[n]=r.defs;return"FunctionName"===n.type&&"FunctionDeclaration"===n.node.type?n.node:"Variable"!==n.type||"const"!==n.parent.kind||"Identifier"!==n.node.id.type||n.node.id.typeAnnotation?void 0:n.node.init};function yP(e,t,r=new o){let n=yR(e);if(r.has(n))return!1;r.add(n);let a=yN(n,t);return tP(n,{methods:yk,computed:!1})&&((e,t)=>{if("Identifier"===(e=yR(e)).type)return"Iterator"===e.name&&t.sourceCode.isGlobalReference(e);if("MemberExpression"!==e.type||e.optional||e.computed||"Identifier"!==e.property.type||"Iterator"!==e.property.name)return!1;let r=yR(e.object);return"Identifier"===r.type&&"globalThis"===r.name&&t.sourceCode.isGlobalReference(r)})(n.callee.object,t)||tP(n,{methods:yw,argumentsLength:0,computed:!1})||tP(n,{method:"matchAll",maximumArguments:1,computed:!1})||yF(n,t,r)||!!a&&yP(a,t,r)||"CallExpression"===n.type&&!n.optional&&((e,t,r)=>{for(;e&&(e=yR(e),!r.has(e));){if(r.add(e),"FunctionDeclaration"===e.type||"FunctionExpression"===e.type)return e.generator&&!e.async;e=yN(e,t)}return!1})(n.callee,t,r)||((e,t)=>{if(os(e,t))return!1;let r=new o(yI);for(let n=t.sourceCode.getScope(e);n;n=n.upper)for(let e of r)n.set.get(e)?.defs.length>0&&r.delete(e);return yj(e,t,{targetTypeNames:r})})(e,t)}let yM="iterable-accepting",y$="for-of",yO="yield-star",yU="spread",yq="iterator-method",yW="iterable-accepting/suggestion",yV="iterator-method/suggestion",yz=["every","find","forEach","some"],y_="reduce",yJ=(e,t)=>tP(e,{method:"toArray",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&!((e,t)=>{if(yL(e,t))return!0;if("Identifier"!==(e=yR(e)).type)return!1;let r=na(e,t);return!!r&&(yL(r,t)||tP(r,{methods:["toArray","slice","concat","split"],optionalCall:!1,optionalMember:!1}))})(e.callee.object,t),yH=(e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>sZ(r,e,t)},yK=(e,t,r,n)=>{let o=yH(e,t);if(o)return{messageId:r,...n&&{data:n},fix:o}},yG="prefer-simple-condition-first",yX="prefer-simple-condition-first/unsafe";function yY(e){return"Identifier"===(e=rx(e)).type||"UnaryExpression"===e.type&&"typeof"===e.operator&&"Identifier"===rx(e.argument).type}function yZ(e){if(yY(e=rx(e))||"Literal"===e.type)return!0;if("UnaryExpression"!==e.type||"-"!==e.operator&&"+"!==e.operator)return!1;let t=rx(e.argument);return"Literal"===t.type&&("number"==typeof t.value||"-"===e.operator&&"bigint"==typeof t.value)}function yQ(e){if("Identifier"===(e=rx(e)).type)return!0;if("UnaryExpression"===e.type&&"!"===e.operator)return yQ(e.argument);if("BinaryExpression"===e.type){let t=rx(e.left),r=rx(e.right);return!!(("=="===e.operator||"!="===e.operator)&&("Identifier"===t.type&&tg(r)||tg(t)&&"Identifier"===r.type))||yZ(t)&&yZ(r)&&("==="===e.operator||"!=="===e.operator)&&(yY(t)||yY(r))}return!1}let y0="switch-case-break-position",y1=new o(["BreakStatement","ReturnStatement","ContinueStatement","ThrowStatement"]),y2="first-child",y3="first-element-child",y5="query-selector",y8="closest",y9="merge-query-selector",y6="suggestion-first-child",y4="suggestion-first-element-child",y7="suggestion-merge-query-selector",he={method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1},ht=(e,t)=>tL(e,{property:t,optional:!1,computed:!1}),hr=e=>"MemberExpression"===e.type&&!e.optional&&e.computed&&tm(e.property)&&Number.isSafeInteger(e.property.value)&&e.property.value>=0,hn=(e,t)=>t.getCommentsInside(e).length>0,ho=(e,t,r,n)=>{let{sourceCode:o}=n;if(hn(e,o))return;let[,a]=ti(e.object,n),[,i]=o.getRange(e);return[{messageId:r,fix:r=>[r.replaceText(e.object.property,t),r.removeRange([a,i])]}]},ha=e=>tL(e,{property:"parentElement",optional:!1,computed:!1}),hi=e=>void 0!==td(e),hs=e=>tP(e,he),hl=new o(["FunctionDeclaration","ClassDeclaration","TSTypeAliasDeclaration","TSInterfaceDeclaration","TSEnumDeclaration"]),hu=new o(["AccessorProperty","MethodDefinition","PropertyDefinition","TSAbstractAccessorProperty","TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSMethodSignature","TSPropertySignature"]),hp=e=>{let t="";return"Variable"===e.type?t=e.node.init.arguments[0].value:"ImportBinding"===e.type&&(t=e.parent.source.value),!t.includes("node_modules")&&(t.startsWith(".")||t.startsWith("/"))},hc=/^(?:(?:-(?:webkit|moz|o)-)?keyframes|container|custom-media|property)$/i,hd=new o(["none","default","inherit","initial","unset","revert","revert-layer","revert-rule"]),hm=new o(["and","or","not",...hd]),hf=[8364,0,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,0,381,0,0,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,0,382,376],hg=(()=>{let e=new Uint8Array(127),t=0;for(let r=33;r<=126;r++)34!==r&&36!==r&&92!==r&&(e[r]=t++);return e})(),hy=function(e){let r=e.length,n=0,o=()=>{let t=hg[e.charCodeAt(n++)];return t<61?t:91*t-5490+hg[e.charCodeAt(n++)]},i=new t(2738);i.fill(-1,49,61),i.fill(-1,2725,2738);let s=new t(2738),l=new t(2738);function u(t,r){let o=0,a=r,s=r+t;for(;a<s;){let t=hg[e.charCodeAt(n++)];if(t<89)o+=t,i[a++]=o;else if(89===t){let t=hg[e.charCodeAt(n++)]+2;for(;t--;)i[a++]=++o}else{let t=hg[e.charCodeAt(n++)];o+=89+(t<90?91*t+hg[e.charCodeAt(n++)]:8281*hg[e.charCodeAt(n++)]+91*hg[e.charCodeAt(n++)]+hg[e.charCodeAt(n++)]),i[a++]=o}}}u(49,0),u(2664,61);let p=new t(50),c=0,d=0;function m(e,t){for(let r=0;r<e;r++){let e=t+r,n=o(),a=o();p[2*d]=n,p[2*d+1]=a,d+=1,s[e]=c;let u=(i[n]<0?l[n]:1)+(i[a]<0?l[a]:1);l[e]=u,c+=u}}m(13,2725),m(12,49);let f=new a(c),g=0;for(let e=0;e<d;e++)for(let t=0;t<2;t++){let r=p[2*e+t],n=i[r];if(n<0){let e=s[r],t=e+l[r];for(;e<t;)f[g++]=f[e++]}else f[g++]=n}let y=new a(13494),h=0;for(;n<r;){let t=hg[e.charCodeAt(n++)];t>=61&&(t=91*t-5490+hg[e.charCodeAt(n++)]);let r=i[t];if(r<0){let e=s[t],r=e+l[t];for(;e<r;)y[h++]=f[e++]}else y[h++]=r}return y}("!}.&u%}'&}*'~!6*)%&,~!J~!J~%L~y<~!R,~~%Lu~~#GD~~#|)1#%}^%}2%+#.##%##%}&%##%'#%##&%#%#'%#&#%#&#'#%%#&#%##%#)%''%&%#%#'%#%%#%%}%%%#%#&(23#%%#&-%0%('1#(##%#'##+%'*.:1}#%#6-+(%'%%#%%%}#L'2351&('%}&/N'(0(/*-%(%%}#'+&T%7.2}#&%&#%#36/5##%&%%#&#%%#))2%%##%&&'0~!#*+&'%1~!%).'3q?&%'1~!.##%6(~!+%%%(Gw'rT~!E#<nA%#jZ~!H%(~!42##~!*31&~!G%U~#)5~#`3~!J~!Z~%]~%Y~%C~!q~!u~#kz~%#~!6'~!D~!U~!?~#T~!c%~!G#'~%7|~!G~!J~!G&~#pb~(Df}#%}*&}#%##%##%##&#-}&'#'&%#.++}%mI,#,@&(}*%}*'%&##&#%##%}&0}#.},U},%}+%}&%}#%##&}B%(}(%}+%)})%##%#&}&%##%&}<%}>%#%&}*%}(%}9%}/%})%}*%}*%}?&}&%}3%}&*#%})%#%#)}#&#-#+*%E%%'%'#%}#*V##&##I}#&&##%&%#&&Qf%%))w/0+&%#(#.%-''''++++7}>%4'',##1,#%#&%##&#'##&#*#9)%&%}#*}%,#+P(%A&%#'&##wSD',9E00#y#@}(+}&%&>~!#~!X}#*}(&&}(&}(,%}%&#+&}#&}I%#%}%)#(},'%#*}4%%#%}(''}#/##(##),%-##%%)#&}(.}&%#&}%%}*&#%},&&}&%}#%*'#%})%}D&}&%}-&}6&#&}-,%}#%})-(~+`~,=?~I9'9%~!,#%})%})%}@%}?%}(~!?~#<~#pP~#BG~#=1#%K+~#?#~%;)~#A~#mF1~#A'~'X%'~#lR~#N~'N~#r~#m#-~#i'?%#'%~#B%##%,%#~#_%#0%~#]732~,w~2+#:&#%&'0%&>%}#>##F+)#%&&#(+_}4&}-%}(&}@&}O7Fdf0@+/v4}&WU##&/0#&'('B#%}.%}'+#%}#%%&#&%#%##+#&#)#6#'#.},%}c%},%#%##%&#&%#&~#>'*-.%##%##%}#%%}%'~#)D1}#%*&~#_%%'(~#S2%'.}#~#=##*'*-%}&'%'##&&~'E%.#&~#M4}%%##&'%#~#O1##%&#'+~#<B%##%%'%+~#;#@%}#&%#&&%#(~#H1}'%'##&&~#?A}&'~#D#%32}'&&&&~#[}'(#%}'~#;C})&}%%#%~#=&%,3}%'(#%%~#^'#&&)#%'~#Y%-~#d-%'~#^%%&#&&&}#~#b~2t*&'~&(~&@~0%~e~3}%*''0})&}+~!9##-}#%-hD*)1fC#%/&/fB#40~!+#)*4~!+~!K'&:~!/*7~!.#~!H~!L':~%x&~!H#~!*~%1~!I#~!+A~#p'~!F~~#-#~,,(~.Z~!V~%;'B'mq-W~!N~%I%#&&#&}#%},%%}'%}+X#%}#&}(%}'%}<%}#%}%%'}'%}:~![)9@~%>~#UA%-%##&~!C%~!-.9:~!1~!-^2/:a~!y,D*J#-5)/4~%23,~#G~!L1~!0X3`~!2+~!!0-~&E~!W~!o,>Y&]~%cZx_&~#O*9#A#'#+I'%#)~!0B*-5A+-((F&*M#)(-7-5+'-3a5Vi~!Y~!?+[)%3),ERHm~!+:D,VG.+)?fB%%*(%)'(#&80%1'8`K8?`+'Z#&O&'H5#*9)A%%5&3))0%39+.*7#()&&*=4@**L)<'_&*+..;(#*+)./&0#3)%')-8(4ixD(&.}%,('aI:,)%,k2231T)I'#/-W7,/'Q#.'Y24+h')37</31&83##&0#),H(?'&?/1##%#&&#%''-%&&&#(&''&#.-'%#%%(,')*'&#&#'##%(%(#%('#&##%%%%('%#%#%%#%#&%##h>w+v<ayvyvcg.uuhKr}g/v|g>u9i[~>g5uI~=RvdwEg;v/g;uk!!TTSx]@RT!U!#!@VBRUU!'UTe-d0c`e&gSdicedFcrdTaqb.kYcAohdYd@a3e+d}dMdtd.aJ#bqcK`dle/e.e'dwdPdodddjbEb}ogd^ofdpduc6j?l%d{drdqc)d7bacOdQ%T#Y)X.sR[yH>6Vyv3[xwLu>vo'!*.[yBacahoj>6Rew3[xqdZa#!a&#^(X-[yG>6Vyu3[xvg3sEr|g.u/Ri9db0T#^(Xa)!-[y;>6Vylg4wKs{JwNZt3@3r=c4Z([xlg;wKt!cpq's@v7A'*a(a+!-a#[y<3Dt?3Dt'>6Vym3[xmg9rxsNJwLZt4~?r?db1T#`-!(Xa,!0[yS>6Vz%NuQs.g4wKtnJwNZtS@3r>c4Z([y%g;wKtrdga8!a(!#&T*Y-Xa#!a0<or[yc3Dtq>6Vz43[y3JwNZtf@3s!Ju}!%Dti:pm3c_%X#tjB5pkd6q!r]u?voC'*-a.a2!0a&a+[yI3DtI3Ds~3DtH>6Vyw3[xx;:s#~<5pKJwNZtE@3r~d`a)!a2T#a.(!+U.X1[yT3Dt`3Dtv>6Vz&3[y&g9rxwzcxstPu.<rAJwLZtT~?r@dZa%!a.&^*Za(/Reu[ya>6Vz23[y1g3sEr}wkg{NuQRg{ci(U#5@b`~,cg#U(2WnH5wugcRh7dX#T(Y,a'Ta!!a,[yZ<]mj>6Vz,3[y+Pv#5ReZKu+=,%!H}7ABwkaS?Rh:BcW(X#<]mrj:ubv/ARekdg%!(!a.*Ta(Y.X1!#sP>Rl*Dt6[y>>6Vyo3Wf*jOvuumvuRgRJuq*!:9<B@bX~3jVv&v@s@5Re[d/rQt{uAvo&a&a*)a2!,0Wf!3Dt0=Bs'>6Re}3[xy~<5s%JwJZt1~Gs)c;&!#2sJkNuXvzq7rxu,Re8dka4!a8(aEZ+a@Y.X1Xa)[yd=Bs(3DtP>6Vz53[y4cX#X&Re:avRe9~<5s&JwJZtQ~Gs*i^rzvdRg+Jv{%!2sbB@bX}kdga,!Za?&^*T1/!a'Dt+[y6>6Vyf3Wf%g/u;s4hGu6?Rh-JvZ,!c%#&RoX54Rivj7uyvf8RgTKvZB%*!2sGh<vu5Rgq<=C::9bb~#dZ#T&Ta6Y.X*Dt>[y93Wf)coZ(T,6VyifluvRgC@95@B@bX~/hFu34cC#T,k/unq8w8Q5RkUklwQuzunq8w8Q5Rk8d/rJu?v8w9)-&!a0a;a&aIWejg3sEr/h1s<DtDJvyZqY5aws3Jvy!&Wei~Hr1:au5@Bag>23E~5c:Z&bX};kKv?w&unuVu5Rjc;>bs)#~@:Rh.=ay<a]C;b`}Vd6s/t{uAvoaxa()!a,a7%-a#a2Dt,[yF2Wo[>6Vyt3[xuNuPRi&NuPwpi#RoWh?vf8Ri%Jv]!%Ri:KvxD!.'2WeAjZu`q9rxu,Re7woeAg-unLq(qA_/*2Wg_g3u5q^9:4E}/jTrxrzv=Wkkd~0UX#^^Xa-a1a5T&a=U1a'*aEa]!a*aPaA-adok[y54Rn>;:p3~Dp5g9rpsFNvZqjg3uJp4~<5p0Pw;5qlJwNZt*@3p1Pw:5p/Ou!5p2JvG'!6Vye=<qnJvh_[xhg3v,Rh3kOwOw-sDuev/Re^dha[a%!%!a+#Ta7)-5TaCaO!aka!a)sf[yb2>Rl!9ARiq5E}Qg=ucRkBE|oJrJ_@Wk~@Wk{JrJ_@Wk|@WkyJrJ_@Wk}@WkzJvO_[y2g-vMRmiKuYC!)&>Ri;>Ri<@3RkNc](X#@9Rk=g5vuRmhKvDB!+'=]meg3u4Rmgd)#Y'Vz3CARmfd`a+!%T'!+#Ta1Ta6TaM-sTDt9[yA9sYd'%Y#s[[xpj:ueunaXRgEjRq,v-vuqdd2'`#6Rev<32@5>:2<E}5xIo9a*X#Y(;5RePJvD_g>vyRgNj8w)v8<wggs:RgXiZt|vjx,hSq3ah!-(~@:Ro/Ou!5RhWj^v(pyw8unRhUdx-UY#^Ua.a3a70!)%UX1TaDa)'omRiRRhE[y:3Dsz=Br,>6Vyj3[xkg6ruwjcqsrPw;5r*Ku]D'Zt-@3r(~?r.i[vwv]dU1a--U#`a4(g/vsRhPOu!5RhLj:rmu9Wo!~@:wdh@g/vsRiTjXuvvNr}:RhBj^v(pyw8unRn]dz1UYa'a+^Y(!aETZalaRY.Ta?a4[yDJw1!#qLsW>6Vyrfzq-pLflpwRe|Js>%!Dt@3Dt&Jvy_[xs~HrnjMuwpsw'RecKu+D#'!t<~Grl~?rjg5u-x,gwp{ah!-(~@:Rg~Ou!5Rh'jXuvvNr}:Rh#cW#X/c;&!#2sLi[v7u7RgpJv)(!iLrxu,Re6j7v@s@5Se[e7d`aW!Za(a`T.a#!a3!&aDa-!9)Dt_=6s+3[x~~DR|h~DS6avhGun5RkZj3w)v-]mkKunB!&*]kb97R|i<ARk<c:Z(6Vy}Juh'!wziMRoS:F|vkLuauJv5vtvQRh1d='T+Y#VyO~DR|jcF#T'7R|g97R|kJv3'!ay<Rj,Jvh&!:ReXcsa6*a+#a#_aIRf9aLRf?c,Z&Rf5Rf7c.Z&Rf;Rf>cQ#%T'p-Rf8Rf=ct#%'(*!,p,Rf4p+Rf6Rf:Rf<d~'Ua%U*^UYa(!a,-!#a4YaTalaEX0a8a<Weo3Dt/3Dsx=Br93Wen~Dr;~<5p<JwNZt2@3p=Pw:5p;Ou!5r3c7&!#:p>3Ds}KvGB)_6Vyk2sM=<r7x'eovA(!hFu1ARf}cV#X&@r5j6rvwQa^Rf3c=Za'wkghJv__g;unRggA53B9=b^}%j6uduo5Jq;!(hIv%2Re`Ou4ARe_e%a#^^^Xa&!a*a2!&a6YaP!*ad!#a:aE/5Rn?[y@>6Vyp;:pE~DrY~<5pBJwNZt8@3pCh=rt3rWPw:5pAJup_[xoNuPpF9c!#'45pD5ARn)d8#X'X*3@rU72s]h>v<<sSjJpqvewOJq/(!hNw'5ReBk0s2u3w/w'5ReE5@Jq.!a+JQ!&WeU23d(#Y&RjG5]jBk!u7w&u0udARjEe#+^^^Ub#!a2/a`Z(agT1!a-a;|@TaG!aS[yV=Re~fow'RguNuPRe?bz#'>RoUWeL>:Cbb|?JwPZtVg6ruRmzJvD'!6Vz(g/vmRh~Jvy_[y(g9voRgyx*cy(#2>Ri2B9b]~9kIw9u7rluJu3Rg]dI#a%UY'@=p%CAx.gQZ&RhwwygtRm{x5g_Z'+ABqR9Woa=Bp&dV#^*Xa'!&@o{g4v]Rk;Jv{!%Rk[wkkiA5RkiwwfUB=x,fUuqC&*!>RfTg8v0RfV~ARfSd;rJsAuAv9wR'ae+/aO!a@aza/a#[yQ@Wg!2Wemg3sEr0JvB_g>uvReWg2v+Re=KupB_+[y!2AbY~-~Hr2AJwD!(h<~El>h<~El?Kun@+_:9b`}Kg-v/Ri3g;vtwyk_9]k_d=&T#*U.6qh@Ab`|K9:H|CJv[!&3Dtex'fDwC%!Rf[9WlMd[(^X,!a%Z06Vz!@WgBg=v~Rgvg,QRe@awd,#Y+jTv|Q~EfWj]uNr|~FRfXdy#Y&^Ua%!aO.!(a)Ua;=!a@aKap!a-,a!Ta]a[rSa]p?[y82sK=Bq~;:p:~<5p8Pw:5p7d'#Y'Wf(;RnRi[u4w&RgJJvG'!6Vyh=<r#ijuuv/sIKuYD'ZtG@3p9~Gr&d2#`(g<vtRgFj`u5w&rqpxRf2CJuY!+:wfnTOu!5Rg}jNs1ucv&RfwJvA!&3@q|BDcC#T,k/unq8w8Q5RkTklwQuzunq8w8Q5Rk9dga#!a'!a=#a0!:+Tb*b@aO.a4!aba8aFJv^}?!VyR~Dr<g;u%Rn.~<5p[x'e`wNZtR@3p]Pw:5pZhNvjBp.woe_g5u-r4JwF!%DtO3:ooc7&!#:p^3DtpLuGw(!+%)Dtk6Vz#2sd=<r8d'#Y([y#<x3gJt`w@!)%}MRiowzikRij=]ilxAf3,U(#B2Rf#g0v-Rm[ck{`U#]giKv3>)!&6Ri154s,KuGB_%@r68r:dJ|t`#X(9<E|u2@H|rx3gJu?w'!+'1Nu7Reg4=H~+9<wxgY95Rm]xLggZ-`(X}U2:Ri4h<uOawRmsJv__5@bb{jbV~3dka#a'a]!,#a+U=a>b6a3b%!/aKa/)!arwve^VyJ;:pR~DpTg3uJpS~<5pOPw;5qmPw:5pNOu!5pQJvG'!6Vyx=<qoJvA!{~Jup!%@qk7Rn/KvyD!}''[xz;>wkh'?Rh,x8gyt`w5D!&),(SgyccRgztJ@3pPB5p#d'(Y#<]mmifubw&RgoJvE&!82s^JvF&!8Rf,ADb]~;x=h'rNu]vK!,%'*0RnORh)4Rh*AqQg-vaRnNg;wHwkh'ba~4cE#Ta*x3gctyw@'!+%RnFRnD<4Rn@hFvK5RnCxWg[#`&a0Ua()`1Rm75Rg[c]%X#qi8Rg^NvdRj>BwzgZauwji7Rm6A4wgg]d1#&(*,.0a#Rm;Rm<Rm=Rm>Rm?Rm@RmARmBe%#^^^Xaea?aC/b+(,!a+a#!a/!>a&Ta<aKbD!2wphBRnk[yPw}hE|.=Br-3Dtm>6Vy~g6urRf.x,hPrNav!%'RnqRo%Ro#Nu;q[Pw;5r+JwNZtM@3r)d'#Y'Weh;xChL#`&RnmRnoKu}>%(!Rne~Bs-;2wjcussJv+'!aYSO}6@B<5?ba~8LrNvj!.%*ROwungw~ng~:9;Ri^>wtnig;wHRnixDh@|(UZ.x1h@|)!#:2<H|*xHn]#-UX'3Ro)z=iT}6ARns=Bwsn_wpnaRncw]aR(#UXa&Ua*a/=]iPd'#Y&Ro'WnXf{QRm2hNvj]nZd`'T~&1`{|`#9b]{}c:'!#Wl{>@=be}]?cl{{U#:5Abb}Jds#^YaF!a*b4a#a3aPa>&Tb!bH!*a_!Eau?/a&RjY<]gj>6Vz*;:pe~DrZg,QRj1JwNZtX@wihspcJvZ&!VyX9WmOJu|!|N2WmHJvh&!]ht~Bpbcn&T(!#RmQ<s7Nu;padH#X'`+WmJ@>RmKCARhnKup=!)&Wf+:RhqNuPpf9c!#'45pd5AwghpARn(Ls@w!%,)!RmP@Wfe<E|IJva!&WmNg8vsRmLd`*.`#Y'Xa!axRn*]hrA8Rhug5s@rXg8u!RmMd8#X'X*3@rV72smdI*#UY&RmICARho~GsgxVgd)Ta'U-Y&Xa!T#RnEWnA@Wffg1uDRi0hFvK5RnBxGnG&#`%owp)@wsf+bX}Ze-*1!a*^^^Ua|!#a.aq&Ya2!a>.a6!a:aO`aJDtL[y`@Wg#>6Vz12@wzoYRoZNuPRi!NuPRhzg=ucRi,@=b`{Yg=ucRi-ACJvB!&Sh[ebSh]ebi`wUuFRm4Jw2_[y0JvB!.<Ju(!&SoG}6Shd}6<Ju(!&SoH}6She}6Kur@._g5vHRieJvx!{L2G{Kx6gd'T#?Rh82Wi5cZ#X(g1w)Rm5dW-Y(Ta#!a)!#aYa=wnfE=su2>>bU{0j9udv:<svj8uQv-7RgHdE%#^'sq9sp=>Bb_{TJv`!&g/r|snj6v(us5d,#Y(56H}[978H}]Jw5!&g1rushJvB!+j;v{u5?zDhd}6}bj;v{u5?zDhe}6}ce*#`(^^^a[aea!=!a6a*aoXb1a.!aAbL!b>,b'aL!aV@Wf|2Wlg3[y/JwNZt^@3piPw:5pgJunZou3@rsJva&!Vy_g<v~Rm#JvG'!6Vz0=<r{Ju{%!:pj@WfsiXuJu3Rm:JvZ&!WfA~Bph@c4Z&Dtwax5rubx(#:awRk1@d,#Y&RfjRfid1#,Y(@Wfp2Wlrg5s@ryKu[@!,'=]ig9wlk?Rk>g5u-rqJvy'!@9RkQcH(T#=>Ri~@<wkj(Wj(KuZB*!&<7rw@9RkRcH(T#=>Ri}@<wkj)Wj)dg(Ta2Xa9X#`-!a*CARhg@@=I}d9x;c~#X%so=<sj>2@@=aybb}XjWv0Q~EfEj3vLv;<d,#Y(56H}`978H}_dgaPaFa'a/!#a3Y0a_a;a|!1(a7-[yE3[xt;:pJNvZrrg3uJrvJwNZt=@3pIh=rt3rxPw:5pGOu!5rpJvG'!6Vys=<rz@c4Z&Dt(ax5rtJvZ!&~BpH@wsfNg-vaRlNci*U#=<wei<F}a5@Jq.!a*JQ!%@qZ23d(#Y&RjH5]jCk!u7w&u0udARjFd/prq=tyvpaEa(a:.!a1aZ(@@=I}:9wpd%=<sX55w_h}@@=I{t=ay<aU@@=I}T=ay<2@@=I})?C9:9au@9Cb]}DP~=x-fAZ(2Wl1=ay<aU@@=I}>5@d##Y+jTv|vV~EfFj]uNpn~FRfGdgaK!Z2&!a8a-Tb({E!acTbM*!a(DtY[yYd'%Y#sl[y*hHvh>Re5x2c{Z}.j4uCvcawRiMd+#X+_x&d!},<5RkX;2Hzw@x,gavfB-!{CcF&T#Roe;RodwWbBg5urRgaKvHC*_6Vz+<4opieuew&Rmq@d]&Y)X,T#X0Rh}<BqP=4qS9:ReMg/ujReNJw0!/<Jui%!bd{kawwnemRelAxUa?a3#*.&UX(Ya+a/RhvRnQ<o}9Wmtd-#Y&RgSRmw9;Rmxay=Rmyg-vaRmuxEhSrNu,v-voC!%(aR.a(a7+1Ro1>Ro5CE{A9b]{@;5x#eO{:g;urRi+KrNA!%(Ro3>Ro79;Ri_Ku@>{;&!x%gX|{KunA_+g5QRj/g3u5Rj#g>uERj%wio/xRhS&!,!#^1U}wba{8>>@=be}qC@:D5ba{7Ku+A&!}x?ba}t>>@=be}se(aA^^^Uat!b0#{pa+awUazbGa#aLb9bgaWac'a5TbS=Br!d1#`%scp_Jvl!#rT>Re0JvX&!VyN=H{Fcm#U&:pY=ReaJv2&!]h0=]nUJvG'!6Vy|=<r%JrM_=]h2@Wlud'#)U'Wf'b]{i=]h/Jvh!&~BpWg=v]RnMx+ny#'Nu;pVwjnu=]nwxJnx,T#`&Reqwjnt=]nvieu9vrRjLLuYwP(#+!th@wih5pX~Gr'g5v/Rh4KunA'!-CARnP@wwiN:Rm_9x'cvw>!|l=<saKvAA!0&3@q}>w^e1bp#&Re2Re3BDx7gH#T|f5H|eKuZ>!%(:qNAH{]Jv6!+3B2B9=b^{X<5<B92:E{ZLvhwA(a;a%!igQuyRmad+#Y}m@3Rh5d8#X'X*:AqUAHzmaxwbh<aXRnVcF}RT#Nw&cj#U(BWnug/vsRntdka)(a3+.Zb7aYYan1!bVa@Xa}[y^@b[{G=H{+hFu73Rj&Pv#5ReQcK%T#sig1v{Rj'Ku+D#'!t]~Grm~?rkKuMB!01d5#`'Vy.ta3Dtu~Hroc8#'{^45s85AwZbP&!#Rn!wghxWn#KvEA!)&2RlA2RlBx:h|#(T,=]j09Wobz>x]z/@awRoTd+#Y(az]hFhCrm4d,#Y+jTv|Q~EfMj]uNr|~FRfOdCa!Xa9_X#@<plJvf!%b`{(9;Rgwc;.!#2x7cw#T|UDb]|T5Ju={(!=@E{&Jv)&!Ab`{'awJvf!~*>>@=be{#KuY>!+&4Ezyi[ugv&RjIdea+T)#UXa&T-T&a!Rh9auRmW=]kLg5vuRn+g3u4Rn-Ow6ARn,hHus5xNk?#UX(U~)/g8v0RkD~AwkkF?Ri.OuNBwkkA?Ri/d|a2`a*^UYa.!aBTZaTa'Xa;!(!2!-a#b2[yC>6Vyq3[xr2Wi?g1rusVh%s?DtF~<5rbJs;%!DtBfswKtCj[uvuSsEu3RgVx3o:u+wN'*Zt;@3rd~Grh~?rfg8w)Lq)qE&-a%!>bI|`jWv0vV~EfCjTv|vV~Ef@j]uNpn~FRfBcK#T']gWNu7x,k7q4ai(0!hHv8<RhmkMu9vrsBuev/RhlCJvB!,g<v{wchh~@:Rhji[vrv{wchi~@:RhkdS&a5UY#Ta!RgPwwiI5BwciI~@:Rh`x'iJvj'!5]iJPu8Bwch]~@:Rhach)U#h3rp]gLh@t|Ax,hTq3ah!-(~@:Ro0Ou!5RhXj^v(pyw8unRhVd|)`,^UYas!a?/a2Z'a^Ta{Tb7Ta(a#!a,Wf&9sZ3DtAadamov=Bqt3[xig8vsRm~>waiL2b`{QJv*_Ouv2qgj<v]v2BqfdR'X*X#Y-@3qr~Gqv~?p6hHv-]glPup5Lq+q?_%*b_{qF{n9b^{rOu4ARhpKvCD!+&~Bqp:5Dbb}nwoiKl&unuTuBv]v+ueunaXRf0=Jvh!0nKufu8v1w&w7q%w&uHrz:Rgnj5w,uxDJq/(!hNw'5ReCk0s2u3w/w'5ReFd>Za&!*UaA=<wkgsRnSJv^!%Refifw3vyRgOKu_B'!,<]gkiiu:w&Rh<=C@a^<B57@2F{[<B5@aW:=3away9A5aW=<B=C@a^<B57@2F{Ie-#`(^^^bCara.b8aza6!/bZ,!adTbnTbOb+aFaS!aAT9@Wf~2Wli3Dtl2@d,#Y&RfnRfmJwJZtN~GqyJva&!VyMg<v~Rm%iXuJu3Rm9Jv[_=]ih9wlkDRkCd1#`(@Wg>2Wls3cH#T(@<Rj*=>Ri|b~'#23s9h<~El.d'#Y&Dtxi^rzvdRl#d*#U%(o|B2s`hJwSaxRmDKv4B&!1:Rmdd5#`'Vx}to~Hq{x'f1v3(!BA5ba|bJv_&!Wfug1v]ReIdO+U/Y#&G}-8wze=Rh{g1v]ReHg/uQRf/by#)ibQwERl/cH#T(@<Rj+=>Ri{cNu+vlax-!(#a0qa9<Rii2;;bU{H;x<i=&X#Rk`<4wwi=C9H~8xAI(Y#<azRi@45wXI<B9;5bb~7dL(X#Xa(+!aL6Vy{g5QqOau:5au2@ay547EzbxOcU(UX-T#Ta#:Cbb|A?wjh/b_|SOw6ARgtihr}u7Rhy<d1#T)X1@@=I|~=ay<2@@=aybb}Sj3vLv;<d,#Y(56H}A978H}@dGpvs@uAu`vcw9*!aFa+ai%(b!aXa8.a?a[ozWey=sU2@G}Nch&U#Rf_WexKu+D#'!t:~Gr`~?r^j]uNr|~FRg*j^psurwJt|RmcKv)@&!)7Rkv~Br[@wxfO:Rl3co#U'6Rezj_q#vIuavjRltwzeyh@vr5JqD0!>aY?C9:9au@9Cb]}9cl#U*5;5<H||jbuus1ucv&Rfvg1v~d/pppzqFr^a--a~!aMat1(hFv;Wiz@@=Izoj5uuv-7Rix~Cw`fk2WlVcZ#X,k)u3vWs@u2]ktg;wEx'fBq(_2Wg/jTv|vV~EfoJv]!15x'hzqG!(P~EfU~CRl_j6v(us5x4i-#T(2WmZ?C2F|d>Kq<aj1!*jTqIsBv=Wl`~Cw`fi2WlWj`v0u*~>RlR=c>Z,k#u3vWs@u2]kr<c1Z+jTqIsBv=Wla~Cw`fm2WlXdmb3!a{(arZa`bkTa%TbQTa-a9+c'!aM!/[yL=Bqug.w'RifhFvyDRj.g>vgwyk^9]k^Jv3_@WfbAARkhJw2_[x|JvB_wkoIRoKwkoJRoLd'(Y#<]gm=<9<H|yd'%_X#skDtb3awwqkgNulRkgdB#^',9:p'hJwSaxRmEBwVb8@4=H|qLu+w50&!)@3qs~?pU>Awwn;;Rn=c:Z'ARn<=<qwKvC@!/&~BqqJv6!&]eVb^z^xRge'/a%+^`#Sge}6<4Rn3=]n0Pw2>Rn8Jw0!&>Rn:>Rn6cY#a7+!a&=<wkaNw~h3z_c5Z{=wjh#=]nLKv^D!&)Vyz=bW|swYb<WetcG#T(2wxa@qVx@gD#Y&b^|V5JwG&!5bb|pg/w&RgD@x=kHs=uAvn!a%%/'+RmSRh694Ro`g-vaRmRhHv-]mlxCcS#`&ba~.5cD#Ta)P~=d,#Y(56H{>978H{Dd_#{2^Y%_+qbbb{6g3sERhsbU{?dfa.,`a(Xa<!aiX#(55RiG54RiHcI#T'WiU3RiVNvdwtfcRlKNvdd,#Y&RlHRlExQgf.1*^T'X#Sgf}6Wn4=]hfPrk>Rn7Jw0!&>Rn5>Rn9Lunw?&a2!,5<oq@@wqfdRlJj5Q~=d,#Y(~ARfcOuN]fdDKw;ay(}i!547E}j?cI#T(@5bV}iCbV}hdv(^^Tb?a40,b##Tbo!a*bR!a<b|a/!aKai!aU[yK=]o^g:v>ReGJwPZtK<7Rh+h<~El,Pv#5ReR@awwxjCg,ulRjDJv6&!]j!z?aQeeg>w=Sh<eeJw;!&axEzOg,Qosc!#*:wkeJ]eJ>x'h-u(!%Ro.w~h.zPdNZ(X,Ya![x{;9ReY;wkgxRiF:x?ap#Y&RmUg<s2Rkod]+UY0TZ'!a&A9sw<=bczLNvuw{gqzNhJwSaxRmCKuLay!#&s_Rf-55b^{uJvZa!!c%#(55Ri654wmiu5RiuawLu,vp!+}^%b_}Y9;wkgxba}o>A9:=b^}zKuh=a''!3awRk3c*'!#aHRk6c+Z&Rk5Rk4Jv)&!awRjSawd9*`#0?C2@EzMj8u<uJ5RmbjQrquJu3x,k>uq@_+=ayb^|W~ARkEOuN]k@7dhzV^X/X&a-#zRzSb`zXcJzTT#2WkVKvDBzW!%FzY9;5bbzWjQrquJu3Jw3%!b`zU=ayb^zQd:#X(T-a!6Vyywxh}=b]{Jg=u1RiAdGp~qHtzv!w(wA+a+a;<!aJaYai'anasb(=azRmV:Cbb{MLq2vb!%')RjuRjrRjtRjqx3jnqCw3!%')Rk(Rk+Rk&Rk)Lq2vb!%')Rj{RjxRjzRjwLq2vb!%')RjsRjpRjfRjex3jcqCw3!%')Rk'Rk*RjkRjl9<CbbzfOu4ARhxLq2vb!%')RjyRjvRjhRjgx=joq*uKvb!%')+-Rk.Rk%Rj~Rk-Rk#Rj}x=jdq*uKvb!%')+-Rk,Rk!Rj|RjmRjjRjidAq&qKs@uAv8Aa.'*-a@a&0!aM@a5[y73Dsy3Ds|3Dt):wxgI2sHJwJZt.~Gqxwsf0ikrzt}Rl0Jvy_[xj~HqzKv_A|D!&WfP8axRoVcf,U#k(v]v+ueunaXRf1Ju}'!g8u#Ri=jQw!sCunLprq>!,')~<5qeGzq9F{W=c##%s5au:5aU3CBE|;d4#X(D!a&6Vygx(b;#(=]ed?C2F{N<capoq2r[a&!aPa9,'Pw;5s:@@=I|,55w_h|@@=IzcP~=x'fCqB_2Wl2>aU@@=I|1OuNBc1Z+jTqIsBv=Wlc~Cw`fl2WlZ~AcTa%!Z+jTqIsBv=Wlb~Cw`fh2WlYk+uNqJsBv=WlSg,u3dca3#UXaMYa)TaB-=cM|7T#<bI}l5@B932:aV2G{BOuNBJq:|M!5Ezt=<B=C@a^<B57@2F{v>cB{/T#=ay<bI{3Jv6!a.6BKq0ah&+!5E}HP~Ef{978BaU@@=Iza<7d#.Y#978BaU@@=IzH~AJq0!(@@=IzG978BaU@@=IzFe,aU*Y&^^^bvJb,b:bFad!a,c2Ta>aL.bo6!a#CbTa'T#Re{2Wlh2@G{yg6t~Ro_NvdRfticuRQRllJv3&!x&c|zs@Jw3!%RflwpfkRlpKuL;%(!Re<@G|C2GzdhIvuBwgjAg-u0RjAKQB%!(GzZ@G|5NuuRl7d='T+Y#Vy[g<v~Rm!==G|>JvA!)@wma=]m1ifuaw&RmnLs@vT'!|/+[y,g:v>ReTJw1!#qX=x!eC{bLu+wT&)ZtZauq_~Graci&U#F|89:r_Lupvq!.)&2RlG8RfaC=x!eF{_h?rpWlmd&'!#X|&]k::xJey#`'T|+<E|&2@H|%dE#(^,g;u.RiEg6vjRiC9xCkA{O|zY#g=ucRmXKs0@!&*@G|m@awRknJuh!,3d(}gY}eJvj!%Rm):Jw3!%Rm+Rm-Ls0w(&!a(a#@b[|6cZ#X'7RkxWgAOu4ARn'dH'U#Y*Vz-Wm'CARm}d]*#a%^a*T'aK!a<9bV{PC=p*Jw4!&SgxcbB5r]idw(wBRmF7xFkt#&`(Rm/Rm8E|!JuY_9:Rl5=wrgr2:bbxd@xXfB(a*#T+!.X0X1Ta/a'T&RlDRfL>RlyARl9b[z[>RfZ:RlL:RfRwlg/ARl;9;RlxKv,A/!%7s69<74=BA5ba{-8Bde#`a<XaKYa1,a'P~=wxfB2bZ}}?C972@@=I}r8@55B9;5bb}G978B2@@=aybb}3j3vLv;<Jw3&!>Rfk=ayb^}4~Ad1#`*@@=aybb{w2@>==<bbz]dx+UY#^UaF!a9!bB'Ya1.!ajXa#%olRhD[y=3Dt#Ov5BrHKuMB%!(Rf^Wep~HrJwkiQjKr|~FRg)Ku+D#'!t5~GrF~?rDdV)UY,Z/_7RkuG{<~BrBg,rlsO:235B@bX}|d?a1!#`(6Vyn5@d##Y+jTv|vV~EfIj]uNpn~FRfH7Lq2vb1!a9-978BaU@@=Iz9978BbU}#~AJq0!(@@=Iz8978BaU@@=Iz7~AJQ|}!978BbU}!JvkaK!AdUa21-U#`a+(g/vsRn~Ou!5RPj:rmu9WhOjXuvvNr}:RhAj^v(pyw8unRn[kPr}p|u7vwv]RiSBd;pppzq@qHQa?(b.!a.a`@.|xa(hFv;Wiyj5uuv-7Riw~Cw`fg2WlU978BbU|wOuNBJqG!(P~EfD~CRlQcZ#X,k)u3vWs@u2]ksg;wEx'f@q1_2Wg.j]uNpn~FRfqJv]!15x'h{qG!(@@=IzK~CRl^j6v(us5x4i,#T(2WmY?C2F{1>Kq<aj1!*jTqIsBv=Wld~Cw`fj2Wl[j`v0u*~>RlT=c>Z,k#u3vWs@u2]kq<c1Z+jTqIsBv=Wle~Cw`fn2Wl]dn1#c(a(b^a2!b/bAT(bj!aDa7bu,a_a{c0!2T0g:v>ReD2@G{42@G{5~DpM~<5rc=Bx6i>{RT#RnI@zCx]y]z:2Jv[!zr5Awyk]9]k]dD(Y+X#6Vz.g=wKtgwhaCwgmTWj2Lu,w%_+/[y-B;b^xeg3u3Rj-2@bX{*KrJ<!+'@Wg(g?QRlC@Jv`!%b[zIwsfII}8JQ_@w|kW|=Jv(%!AqcOuNBJvEzh!bYzjLs@wP#(0!oy@>RkdJwMZtc3Dtd@BcG#T'9bWxg2@2Fznd*#Y+;2x'c}w<zizixNgwa#Z'U+!/!a'!a+w~g~z6wcn{Rn}wcnzRn|5Rh%=]nJg5vuRmvNvdRlvcprJu}w*az*a#!%.a.'Bot9qT]kj@Wg'ay2Gzv@Jv`!%b[zEwsfHI}1;ck#Ux`<Cbbx_Lu+w!a&0*!wko*wwo,So,}6Juqxf!E}PigQuyRm`d3(`#8>Rn%:A5B;bZ~%KvhCa!a2!x>k7#Uxb@b{#xaRk7Jw0!)>wwhlShl}6>wwhmShm}6CJvB!.x'hhvj{!!5Bwkhhbaz}x'hivjz~!5Bwkhibaz|xEhTrNu,v-vpD!a%&/)a3a.,%Ro2t[CE{)@3re9b]{%wjo09:rgc:Z&Ro6=<riifuaw&RmoKrNA!%(Ro4>Ro89;Ri`dSaL'UYzxZb)7Rka3xRhT&!,!#^1U}vbaz{>>@=be}yC@:D5bazzKu+A&!}{?ba}y>>@=be}wxBh[t`u~vJvr!%a!a()a,a0a4RoC=]o;Ju(!%RoGRhdwjh`=]oAg>w#Ro?g5vuRo=NvdRl|Ku]C.!&;RoEJvB!%RoORoMBx'h[v+_?w~h`}~5?w~hd~!xKh]oiptu-utv.vp!#%&a30a@a'a+(a/aOp(o~p!RoDJu(!%RoHRhewjha=]oBNvdRl}g>w#Ro@g5vuRo>c[#X']o<CauRoRAd-#Y':RkpauRoQKu]C.!&;RoFJvB!%RoNRoPBx'h]v+_?w~ha}t5?w~he}ue!/UbhYacXaW^Tc&a;b:a-c/#b&aja1(!cL+!bKbt!bmcRc9aIc?8[yW3Dtt94Rg`Jv}!&SiRMzBhEebShEMNuPRe>x7gL#TzuwjirRipc<Z&>on;>z=h-MSh.Mwqczx'a7vj&!>Re4@=ResJt__NuPRi*NuPRi)j]uNr|~FRfzKrJ>_+@Wfy@Wf]2WocKrJ<!+'@Wg%g/QRl@@Jv`!&awRl<wsfFIzgLu(w*!.*&ShBMwvhIRhI9;RhNx1hK'!#Sn]Mx1hK~0!#:2<H~7cNu+w7D*'1ZtW>Rn1~?rOc:Z&Rn2=<rQ<7wjh&=BSnLMc]#X(6Vz)w[b=a!U#9wzgMc3#&(RgMRitRis<x,gKt`ax!&+SioM=BSilMc3#&(RgKRinRimKurB,!&SiQMzBhDebShDM6BJQ!(P~Efx978B2@@=I}WLrJw!!,a*&@G}O@9wkibRid@@x'fKwC!&SlDMSfLMjUv~Q~EfKKv3@a+!(hFv-]mpx/hYZ(C5RiWz<o/MwkhY?So/M@x,gbvfB*&!SgEM:SoeeehFu3:Rgbda(,^TZa)X/7Sg[eb:2RgI~BrMC@wgkc:wwkcRerx3h(uUvK!&*,SnOM4Sh*MArRg;wHRh(x=h;rJvPwI!a4',a'0@Wg&=BSh/Mg>w=Rh=g3w*wwgGRgGcW(X#;Sg}M2Gzk@Jv`!&awRl=wsfGIz`dKZ*T'Y-:RhR7RhQg5u-p`j6v(us5d,#Y+~Awkia?RicOuNBwkibba}Ld6p~tyu_vbAa'a+!a/'a3aEa8a!>Sh,ebJv{!&Sh@ebSaReb9;SgwebNuPRi(NvdRl)NuPRi'hHu^<Rm^Jvv_@Wl(g;u1Si/ebKu'B&!*Sh?eb@Wl'z@aPeb95Si.ebcpputyvjB)!,&a+0a%ShAMWeK@G}C@WfJ9;RhMwvhH9w{ia}ix,hJvRA1(!zAn[MRhHx1hJ~*!#hFv(BSn[MBJQ!(@@=I~'978B2@@=I}2db.Ua<'X}+T#a0XaG2G}E;wkg|wuh!Rh!x,hZu,@)!&So0MVy)C5RiXACJvB!&5RiY5RiZg8w)cG}*T#2@bU}=KsA>(!a.3wkhZba~(x,h^u(A!&(SoCMRhb5Bz=h[eb?w~hb~6x,h_u(A!&(SoDMRhc5Bz=h]eb?w~hc~6e)aA1T#T,^^^c-bMb&blcPaP(a/!0!bA=b5c@a(!bfbrc#2afwmhARnjwchORnp2Wlf3DtsNvdRl-2@wpa<]m0bx(#:awRk2@Jw3!%RfhwpfgRlnKQB%!(G{V@G|'NuuRl6d='T+Y#VyUg<v~Rl~==G|<Jv+'!aYShC}6@B<5?ba~8@Jw3'!g2QRljhLrpWlOd+#Y'g.w'rIg>w*wgj@g-u0Rj@Lu+wT&)ZtUauq]~GrGci&U#F|39:rELrNvj!.%*RhCwunfw~nf~:9;Ri]>wtnhg;wHRnhx3hDs@v~!/+'@Wfr@9RkSNu&Rlo=@<5GzoKs0@_+@Wl+@awRkmJuh!-3d(}pY#qWJvj!%Rm(:Jw3!%Rm,Rm*de&!1U-U#`)Re;@G|.@9Ri82@wjfvRlq=@<5GzpLvOvr!).&2RlF8Rf`C=x!eE{.Jw3_g2QRlkhLrpWlPde(!#U{s,UXa*Ta'[y'g:v>ReS;x0PZ&RnlRnn~HrKJw1}f!=x!eB|2w]aP(#Xa&a*Ta.Ua2a7=]iOd'#Y&Ro&WnWg;u.RiDg6vjRiBNvdRlzhNvj]nYJuW_2Wm3x)kFze{9d])!a.!,Y01!#&aC!a3RndC=ox~BrC@2b^{pg,rlse7x'ksuq!%Rm.E{xidw(wBRmGx9o+)X#wwo-So-}69:Rl4@xSf@a#XZ'X)X,Ta(/ARl8b[xc>RfY:RlI:RfQwlg.ARl:9;Rlwdn'#^XafaQa1X1TaHTa)@b[{zcZ#X'7RkwWg@Ou4ARn&x)kG#{,g7u/RkGdH'U#Y*Vz'Wm&CARm|bx#(A]gUbUzJj9Q~=d,#Y(56H}l978H{U7d,0#U*2>ABb_xZ978BbU{e~AJQ{g!978BbU{hxMh?ad{oUYZ.x1h?{l!#:2<H{mx3n[t{vl!,&a%3Ro(z=iS}6ARnr=Bwsn^wvn`Rnbd`*T}B0!#^X'BG{c9b]{a>>@=be}F?JvS!&BG{d7BG}(Bde#`a1X,Ya@!a'P~=wxf@2bZ}I56B2@@=aybb}08@55B9;5bb}<j3vLv;<Jw3&!>Rfg=ayb^}&OuNBKuLA!)a!P~=x#fD{f2@>==<bbzl?C972@@=Ix^d6rSu,v7w*C(0a)a6#B+a%!sQ[y?3Dt%3[xn~<5rLOu!5p@Ku+D#'!t7~GrP~?rNKvlaya7'!h+v-5qMg=t|cd,U#5AAaa5Abb{S@52B5@a[@52B5Gx[iXueu;d<#`a(!/549C;ag>23ExY5@Dah89b^~689Jv)!~2b[~1Lv'w(%*!a#bX|aPrmawRe]keu7uhv-q6rxu,q`xTo]/a5aU!bNaDXbi!b-!ao!b<bwA!#5@B932:aV2G|:d-)Y#hJrL>RhG<7@C5<H|_=Cau:5aj5@B932:bJ|ng>vIbs)#?C2F|9jPv0w.vISh-MKvUaz(.!9ABbb|[5;5<H|Eg>unwfh;9:4E|YjQsBt|vjx'hYq3!(?C2F|J:2<BaY?C2F|GOu!5x,g|p{ah!-(?C2F|c9:4E|OjXuvvNr}:Rh&i[w*t|cd+U#jJvsu)vsSn~Mkfrmu9p}u7vwv]So!McW#Xa!ax5@A5aY:5;5<H|>kJv~vYrquJu3x4ib#T)2@SmZM?C2F|Bj:rmu9@xPhI(a*a#U#`a3-5Abb|L~@:RhK9:4E|0@52B5G|#C::aY?C2F|-:2<BaY?C2F|.5Jvk!a)javYrquJu3x4ia#T)2@SmYM?C2F|HAxPhH(!a#U#`a*-5Abb|4~@:RhJ9:4E|R@52B5G|F:2<BaY?C2F|Sc^#Xa2j=Qq5CJvB!-g<v{z;hhM?C2F|Zi[vrv{z;hiM?C2F|XKsA>!a)-g<v{z;h[eb?C2F|]i[vrv{z;h]eb?C2F|^iZu.vix,hZq3ah!.(?C2F|QOu!5ShXM:2<BaY?C2F|P");(l=f||(f={}))[l.VALUE_LENGTH=49152]="VALUE_LENGTH",l[l.FLAG13=8192]="FLAG13",l[l.BRANCH_LENGTH=8064]="BRANCH_LENGTH",l[l.JUMP_TABLE=127]="JUMP_TABLE",l[l.VALUE_MASK=8191]="VALUE_MASK",(u=g||(g={}))[u.AMP=38]="AMP",u[u.NUM=35]="NUM",u[u.SEMI=59]="SEMI",u[u.EQUALS=61]="EQUALS",u[u.ZERO=48]="ZERO",u[u.NINE=57]="NINE",u[u.LOWER_A=97]="LOWER_A",u[u.LOWER_X=120]="LOWER_X";let hh=0;function hx(e){return e-g.ZERO>>>0<=9}function hb(e){return(32|e)-g.LOWER_A>>>0<=25}function hv(e,t,r){return 1===r?String.fromCharCode(e[t]&f.VALUE_MASK):2===r?String.fromCharCode(e[t+1]):String.fromCharCode(e[t+1],e[t+2])}(p=y||(y={}))[p.EntityStart=0]="EntityStart",p[p.NumericStart=1]="NumericStart",p[p.NumericDecimal=2]="NumericDecimal",p[p.NumericHex=3]="NumericHex",p[p.NamedEntity=4]="NamedEntity",(c=h||(h={}))[c.Legacy=0]="Legacy",c[c.Strict=1]="Strict",c[c.Attribute=2]="Attribute";let hE="consistent-compound-words/error",hS="consistent-compound-words/rename",hT={backGround:"background",callBack:"callback",checkBox:"checkbox",clipBoard:"clipboard",codeBase:"codebase",dataBase:"database",downLoad:"download",feedBack:"feedback",foreGround:"foreground",frameWork:"framework",headLine:"headline",keyBoard:"keyboard",keyFrame:"keyframe",lifeCycle:"lifecycle",metaData:"metadata",midPoint:"midpoint",nameSpace:"namespace",overRide:"override",passWord:"password",payLoad:"payload",placeHolder:"placeholder",preView:"preview",screenShot:"screenshot",sideBar:"sidebar",subClass:"subclass",subDirectory:"subdirectory",subDomain:"subdomain",subMenu:"submenu",subProcess:"subprocess",subString:"substring",subTree:"subtree",subType:"subtype",subTitle:"subtitle",timeOut:"timeout",timeStamp:"timestamp",toolBar:"toolbar",toolKit:"toolkit",toolTip:"tooltip",touchScreen:"touchscreen",unSubscribe:"unsubscribe",underScore:"underscore",upLoad:"upload",userName:"username",viewPort:"viewport",webCam:"webcam",webHook:"webhook",webSite:"website",weekEnd:"weekend",whiteSpace:"whitespace",wildCard:"wildcard",workFlow:"workflow",workSpace:"workspace"},hC=new o(String.raw`\^$.*+?()[]{}|`),hD=e=>{let t="";for(let r of e)t+=hC.has(r)?`\\${r}`:r;return t},hw=String.raw`(?=$|[\d_$]|\p{Uppercase_Letter})`,hA=({checkProperties:e=!1,checkVariables:t=!0,checkDefaultAndNamespaceImports:n="internal",checkShorthandImports:a="internal",checkShorthandProperties:i=!1,extendDefaultReplacements:s=!0,replacements:l={},allowList:u={}}={})=>{let p=new r(Object.entries(s?{...hT,...l}:l).filter(([,e])=>!1!==e));return{checkProperties:e,checkVariables:t,checkDefaultAndNamespaceImports:n,checkShorthandImports:a,checkShorthandProperties:i,replacements:p,replacementRegExp:p.size>0?(e=>{let t=[],r=[];for(let n of e.keys())t.push(hD(n)),r.push(hD(sg(n)));return RegExp(`(?:^(?:${t.join("|")})|(?:${r.join("|")}))${hw}`,"gv")})(p):void 0,allowList:new o(Object.keys(u))}},hk=hA(),hI=(e,{replacementRegExp:t,replacements:r,allowList:n})=>{if(!t||e===e.toUpperCase()||n.has(e))return;let o=e.replaceAll(t,e=>{var t,n;let o,a;return t=e,(a=(n=r).get(t)??n.get(sy(t)))?(o=t[0])===o.toUpperCase()?sg(a):sy(a):t});if(o!==e)return o},hj=(e,t)=>({node:e,messageId:hE,data:{name:e.name,replacement:t}}),hR={type:"array",additionalItems:!1,items:[{type:"object",additionalProperties:!1,properties:{checkProperties:{type:"boolean",description:"Whether to check property names."},checkVariables:{type:"boolean",description:"Whether to check variable names."},checkDefaultAndNamespaceImports:{anyOf:[{type:"boolean"},{enum:["internal"]}],description:"Whether to check default and namespace import names."},checkShorthandImports:{anyOf:[{type:"boolean"},{enum:["internal"]}],description:"Whether to check shorthand import names."},checkShorthandProperties:{type:"boolean",description:"Whether to check shorthand property names."},extendDefaultReplacements:{type:"boolean",description:"Whether to extend the default replacements."},replacements:{$ref:"#/definitions/replacements",description:"Custom compound word replacements."},allowList:{$ref:"#/definitions/trueObject",description:"Custom allow list of names."}}}],definitions:{replacements:{type:"object",propertyNames:{minLength:1},additionalProperties:{anyOf:[{enum:[!1]},{type:"string",minLength:1}]}},trueObject:{type:"object",propertyNames:{minLength:1},additionalProperties:{enum:[!0]}}}},hF="no-blob-to-file",hB="suggestion";function hL(e,t){let r=eD(t.sourceCode.getScope(e),e);return!r||0===r.defs.length}function hN(e,t){if(e?.type!=="Identifier")return;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs[0],o=n?.node;if(n?.type==="Variable"&&"const"===n.parent.kind&&o?.type==="VariableDeclarator")return o}let hP="no-canvas-to-image",hM=e=>{for(;e?.type==="AwaitExpression";)e=e.argument;return e};function h$(e,t){if(e=hM(e),e?.type!=="Identifier")return e;let r=eD(t.getScope(e),e);if(!r||1!==r.identifiers.length||2!==r.references.length)return;let[n]=r.identifiers;if("VariableDeclarator"===n.parent.type&&n.parent.id===n&&"VariableDeclaration"===n.parent.parent.type&&"const"===n.parent.parent.kind&&!(t.getRange(n)[0]>t.getRange(e)[0]))return hM(n.parent.init)}let hO=e=>e.toLowerCase().includes("canvas"),hU="replace-one-element",hq="insert-at-negative-one",hW="suggestion-replace-one-element",hV="suggestion-insert-at-negative-one";function hz(e){return"Identifier"===e.type||"ThisExpression"===e.type||"MemberExpression"===e.type&&!e.computed&&!e.optional&&hz(e.object)}let h_=(e,t)=>t.getCommentsInside(e).length>0,hJ="no-duplicate-set-values",hH="first-match",hK="id-selector",hG="length-check",hX="query-selector-all-nullish",hY="query-selector-undefined",hZ=e=>tP(e,{method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!am(e.callee.object),hQ=e=>tP(e,{method:"querySelectorAll",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!am(e.callee.object),h0=e=>{let t,r;return t=e,r=hQ,"MemberExpression"===t.type&&t.computed&&!t.optional&&r(t.object)&&tu(t.property,0)},h1=e=>{let t,r;return t=e,r=hQ,tP(t,{methods:["at","item"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&r(t.callee.object)&&tu(t.arguments[0],0)},h2=e=>ns(e)||("ForInStatement"===e.parent.type||"ForOfStatement"===e.parent.type)&&e.parent.left===e,h3=(e,t,r)=>{let{sourceCode:n}=r,[,o]=ti(t,r),[,a]=n.getRange(e);return[o,a]},h5=(e,t,r)=>{if("Identifier"!==e.type)return;let n=eD(t.getScope(e),e);if(!n||1!==n.defs.length)return;let[o]=n.defs;if("Variable"===o.type&&"const"===o.parent.kind&&o.node.id===o.name&&r(o.node.init))return o.node.init},h8=new o([...tY,"LogicalExpression","UnaryExpression","CallExpression","VExpressionContainer"]),h9=(e,t)=>{let{sourceCode:r}=t;if(!h8.has(e.parent.type))return;let{node:n,isNegative:o}=function(e,t){let r=!1;for(;;)if(tK(e))r=!r,e=e.parent;else if(tG(e,t))e=e.parent;else break;return{node:e,isNegative:r}}(e,t);if(!tQ(n)||(hQ(e)?!e:!h5(e,r,hQ)))return;let a=r.getText(e);return{node:e,messageId:hG,fix:r9(t,n,[e])||r.getCommentsAfter(n).length>0?void 0:e=>e.replaceText(n,`${a}.length ${o?"=== 0":"> 0"}`)}},h6=(e,t,r)=>({node:e,messageId:hH,*fix(n){yield n.replaceText(t.callee.property,"querySelector"),yield"MemberExpression"===e.type?sY(n,e,r):sZ(n,e,r)}}),h4=(e,t)=>tg(e)||tV(e)&&t.isGlobalReference(e),h7=(e,t,r)=>{let{left:n,operator:o,right:a}=e;return["==","===","!=","!=="].includes(o)?(t(n)?n:h5(n,r,t))&&h4(a,r)?{node:n,value:a}:(t(a)?a:h5(a,r,t))&&h4(n,r)?{node:a,value:n}:void 0:void 0},xe="no-invalid-file-input-accept/invalid",xt="no-invalid-file-input-accept/static",xr="no-invalid-file-input-accept/normalize",xn=new o(["audio/*","image/*","video/*"]),xo=new r([["application/x-rar-compressed","application/vnd.rar"],["application/x-zip-compressed","application/zip"],["image/jpg","image/jpeg"],["image/svg","image/svg+xml"],["image/x-icon","image/vnd.microsoft.icon"]]),xa=/&(?:#\d+|#x[\da-f]+|[a-z][\da-z]*);/iv,xi=e=>{for(let t of e)if(""===t.trim()||","===t||"/"===t||"*"===t||"$"===t||"{"===t||"}"===t)return!0;return!1},xs=e=>{if(e.startsWith("."))return e.length>1&&!xi(e.slice(1))?{replacement:e.toLowerCase()}:{reason:"File extensions must start with `.` and cannot contain whitespace, commas, slashes, wildcards, or template markers."};if(!e.includes("/"))return e.length>0&&"."!==e[0]&&!xi(e)?{replacement:`.${e.toLowerCase()}`}:{reason:"File extensions must start with `.` and cannot contain whitespace, commas, slashes, wildcards, or template markers."};let t=e.toLowerCase();if(t.includes("*"))return xn.has(t)?{replacement:t}:{reason:"Wildcard MIME types must be `audio/*`, `image/*`, or `video/*`."};try{let{essence:t}=new D.MIMEType(e);return{replacement:xo.get(t)??t}}catch{return{reason:"MIME types must use valid `type/subtype` syntax."}}},xl=e=>{if("JSXIdentifier"===e.type)return e.name},xu=(e,t)=>e.attributes.find(e=>"JSXAttribute"===e.type&&xl(e.name)===t),xp=(e,t)=>{let r=rN(t,e)?.value;if("string"==typeof r)return r},xc=e=>" \n\f\r ".includes(e),xd=e=>">"===e||xc(e),xm=(e,t,r)=>{for(;t<r&&xc(e[t]);)t++;return t},xf=(e,t,r)=>t>=r||">"===e[t]||"/"===e[t]&&">"===e[t+1],xg=(e,t,r)=>{let n=t;for(;t<r&&!xc(e[t])&&"="!==e[t]&&">"!==e[t]&&("/"!==e[t]||">"!==e[t+1]);)t++;return{name:e.slice(n,t).toLowerCase(),index:t}},xy=(e,t,r)=>{let n='"'===e[t]||"'"===e[t]?e[t]:void 0;if(n){let o=t+1;for(t=o;t<r&&e[t]!==n;)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!0,index:t+1}}let o=t;for(;t<r&&!xd(e[t]);)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!1,index:t}},xh=(e,t,r)=>{if(!t.openEnd)return;let n=e.sourceCode.text,o=e.sourceCode.getRange(t.openStart)[1],a=e.sourceCode.getRange(t.openEnd)[1],i=o;for(;i<a&&(i=xm(n,i,a),!xf(n,i,a));){let e=xg(n,i,a);if(i=xm(n,e.index,a),"="!==n[i]){if(e.name===r)return{missing:!0};continue}i=xm(n,++i,a);let t=xy(n,i,a);if(i=t.index,e.name===r)return t}},xx=({valueInfo:e,fix:t})=>{if(e.missing)return{node:e.node,messageId:xe,data:{reason:"The `accept` attribute must have a value."}};if(e.dynamic)return{node:e.node,messageId:xt};let r=(e=>{let t=e.split(","),r=new o,n=[];for(let e of t){let t=e.trim();if(0===t.length)return{reason:"Empty entries are not allowed."};let o=xs(t);if(o.reason)return o;let{replacement:a}=o;r.has(a)||(r.add(a),n.push(a))}let a=n.join(", ");return a===e?{}:{replacement:a}})(e.value),n=r.replacement&&e.fixable&&(!e.isReplacementFixable||e.isReplacementFixable(r.replacement));return(({valueNode:e,checkResult:t,fix:r})=>{if(t.reason)return{node:e,messageId:xe,data:{reason:t.reason}};if(t.replacement){let n={node:e,messageId:xr,data:{replacement:t.replacement}};return r&&(n.fix=r),n}})({valueNode:e.node,checkResult:r,fix:n?t(r.replacement):void 0})},xb=/^(?:e|event|evt|[a-z][\dA-Za-z]*Event)$/u,xv=e=>{for(let t=e.parent;t;t=t.parent)if(tj(t))return t},xE=(e,t)=>{switch(e.type){case"ForStatement":return[e.test,e.update,e.body].includes(t);case"ForInStatement":case"ForOfStatement":return t!==e.right;case"DoWhileStatement":case"WhileStatement":return!0;default:return!1}},xS=e=>{let{sourceCode:t}=e,r=new o,n=e=>{let t=xv(e);t&&r.add(t)};return e.onExit("AwaitExpression",n),e.onExit("YieldExpression",n),e.onExit("ForOfStatement",e=>{e.await&&n(e)}),{isFunctionSuspended:e=>r.has(e),isInsideSuspendingLoop(e,r){for(let n=e,o=e.parent;o&&o!==r;n=o,o=o.parent)if(xE(o,n)&&t2(o,t.visitorKeys))return!0;return!1}}},xT="after-suspension",xC="in-nested-function",xD="no-unnecessary-nested-ternary";function xw(e,t,r){return r.getText(e)===r.getText(t)}function xA(e,t,r,n){let o=ts(e,t);return!tl(e,t)&&so(e,{operator:r,property:n})&&(o=`(${o})`),o}function xk(e,t){let r=ts(e,t);return!tl(e,t)&&i9(e)&&(r=`(${r})`),r}function xI(e,t,r){let n={node:t,messageId:xD};return 0===e.sourceCode.getCommentsInside(t).length&&(n.fix=n=>n.replaceText(t,function({context:e,node:t,left:r,operator:n,right:o,consequent:a,alternate:i}){let{sourceCode:s}=e,l=[xA(r,e,n,"left"),xA(o,e,n,"right")].join(` ${n} `),u=`${l} ? ${xk(a,e)} : ${xk(i,e)}`;return iB(s.getTokenBefore(t),e,u)&&(u=`;${u}`),u}({context:e,node:t,...r}))),n}let xj="no-unused-builtin-method-return",xR=new o(["at","concat","entries","every","filter","find","findIndex","findLast","findLastIndex","flat","flatMap","includes","indexOf","join","keys","lastIndexOf","map","some","slice","toReversed","toSorted","toSpliced","values","with"]),xF=new o(["has","union","intersection","difference","symmetricDifference","isSubsetOf","isSupersetOf","isDisjointFrom"]),xB=[["Instant",["add","subtract","round"]],["ZonedDateTime",["add","subtract","with","round"]],["PlainDate",["add","subtract","with"]],["PlainTime",["add","subtract","with","round"]],["PlainDateTime",["add","subtract","with","round"]],["PlainYearMonth",["add","subtract","with"]],["PlainMonthDay",["with"]],["Duration",["add","subtract","with","round"]]],xL=new r([...new o(xB.flatMap(([,e])=>e))].map(e=>{let t=xB.filter(([,t])=>t.includes(e)).map(([e])=>e),{isTarget:r}=oe({targetTypeNames:new o(t.map(e=>`Temporal.${e}`)),isTargetNode:e=>tL("NewExpression"===e.type?e.callee:tP(e,{method:"from",optionalCall:!1,optionalMember:!1})&&e.callee.object,{object:"Temporal",properties:t,optional:!1})});return[e,r]})),xN=new o([...xR,...xF,...xL.keys()]),xP=/^\p{Uppercase_Letter}/v,xM=Symbol("uncertainValue"),x$=["BigInt","Boolean","Number","RegExp","String","Symbol"],xO=(e,t,r)=>"Identifier"===e.type&&e.name===t&&r.sourceCode.isGlobalReference(e),xU="prefer-array-last-methods",xq="replace",xW=new r([["find","findLast"],["findIndex","findLastIndex"],["indexOf","lastIndexOf"],["reduce","reduceRight"]]),xV=["reverse","toReversed"],xz="prefer-math-abs",x_="prefer-math-abs/suggestion",xJ=new o([">",">=","<","<="]),xH={">":"<",">=":"<=","<":">","<=":">="},xK={">":"<",">=":"<="};function xG(e){return"TSBigIntKeyword"===e.type||"TSLiteralType"===e.type&&ty(e.literal)||"TSTypeAnnotation"===e.type&&xG(e.typeAnnotation)||"TSUnionType"===e.type&&e.types.some(e=>xG(e))||"TSIntersectionType"===e.type&&e.types.some(e=>xG(e))}function xX(e){return["TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?xX(e.expression):e}function xY(e){let t;return ty(e)||tS(e,{name:"BigInt",argumentsLength:1,optional:!1},tb)||"UnaryExpression"===e.type&&"-"===e.operator&&xY(e.argument)||(t=function e(t){return"TSNonNullExpression"===t.type?e(t.expression):["TSAsExpression","TSSatisfiesExpression","TSTypeAssertion"].includes(t.type)?t.typeAnnotation:void 0}(e))&&xG(t)}function xZ(e,t){return xY(e)||function(e,t){let r=xX(e);if("Identifier"!==r.type)return!1;let n=eD(t.sourceCode.getScope(r),r);return n?.defs.some(e=>"Parameter"===e.type?e.name.typeAnnotation&&xG(e.name.typeAnnotation)||"AssignmentPattern"===e.name.parent.type&&xY(e.name.parent.right):"Variable"===e.type&&(e.node.id.typeAnnotation&&xG(e.node.id.typeAnnotation)||e.node.init&&xY(e.node.init)))??!1}(e,t)}function xQ(e,t){return"UnaryExpression"===e.type&&"-"===e.operator?rf(e.argument,t):"BinaryExpression"===e.type&&"-"===e.operator&&tu(e.left,0)?rf(e.right,t):"BinaryExpression"===e.type&&"*"===e.operator&&(rf(e.left,t)&&tM(e.right)||tM(e.left)&&rf(e.right,t))}function x0(e,t){if(!("BinaryExpression"!==e.type||!xJ.has(e.operator)||xZ(e.left,t)||xZ(e.right,t)))return">"===e.operator||">="===e.operator?{value:e.left,threshold:e.right,operator:e.operator}:{value:e.right,threshold:e.left,operator:xH[e.operator]}}function x1(e,t){if(!("BinaryExpression"!==e.type||!xJ.has(e.operator)||xZ(e.left,t)||xZ(e.right,t)))return"<"===e.operator||"<="===e.operator?{value:e.left,negativeThreshold:e.right,operator:e.operator}:{value:e.right,negativeThreshold:e.left,operator:xH[e.operator]}}function x2(e,t,r){let n={node:e,messageId:xz};return r&&!(t.sourceCode.getCommentsInside(e).length>0)&&(n.suggest=[{messageId:x_,fix:r}]),n}function x3(e){return["Identifier","Literal","ThisExpression"].includes((e=xX(e)).type)}let x5="prefer-split-limit",x8=(e,t)=>{let r=rN(e,t);if(r&&Number.isSafeInteger(r.value)&&!(r.value<0)&&!(r.value>=0xfffffffe))return r.value},x9=e=>{let t,r=e?.type==="ChainExpression"?e.expression:e;if(tP(r,{method:"split",argumentsLength:1})&&(tp(t=r.arguments[0])&&""!==t.value||tf(t)))return r},x6=(e,t,r,n)=>({node:e,messageId:x5,fix:e=>sU(e,t,String(r),n)}),x4=(e,t,r)=>{let{elements:n}=e,o=x9(t);if(0!==n.length&&n.at(-1)?.type!=="RestElement"&&o)return x6(e,o,n.length,r)},x7="prefer-queue-microtask",be=(e,t)=>{let r=e.arguments[0];return"FunctionExpression"===r.type&&ah(r.body,t.sourceCode.visitorKeys)},bt={create:e=>{let{checkSetImmediate:t,checkSetTimeout:r}=e.options[0];e.on("MemberExpression",t=>{if(tL(t,{object:"process",property:"nextTick",computed:!1,optional:!1})&&rg(t.object,e)&&("CallExpression"!==t.parent.type||t.parent.callee!==t||!t.parent.optional))return{node:t.property,messageId:x7,data:{name:"process.nextTick()"},fix:((e,t)=>{let{parent:r}=e;if("CallExpression"===r.type&&r.callee===e&&1===r.arguments.length&&"SpreadElement"!==r.arguments[0].type&&!(t.sourceCode.getCommentsInside(e).length>0))return t=>t.replaceText(e,"queueMicrotask")})(t,e)}}),e.on("CallExpression",n=>{let o;return t&&"Identifier"===n.callee.type&&"setImmediate"===n.callee.name&&!n.optional&&n.arguments.length>0&&"SpreadElement"!==n.arguments[0].type&&!ay(n.arguments[0])&&iI(n)&&rg(n.callee,e)?{node:n.callee,messageId:x7,data:{name:"setImmediate()"},fix:((e,t)=>{if(!(1!==e.arguments.length||be(e,t)))return t=>t.replaceText(e.callee,"queueMicrotask")})(n,e)}:r&&"Identifier"===n.callee.type&&"setTimeout"===n.callee.name&&!n.optional&&n.arguments.length>=2&&"Literal"===(o=n.arguments[1]).type&&0===o.value&&"SpreadElement"!==n.arguments[0].type&&!ay(n.arguments[0])&&iI(n)&&rg(n.callee,e)?{node:n.callee,messageId:x7,data:{name:"setTimeout()"},fix:((e,t)=>{if(2!==e.arguments.length||be(e,t))return;let r=((e,t)=>{let{sourceCode:r}=t,[,n]=e.arguments,o=r.getTokenBefore(n),a=r.getTokenAfter(n),i=a?.value===","?r.getTokenAfter(a):a,s=[r.getRange(o)[0],a?.value===","?r.getRange(a)[1]:r.getRange(n)[1]];if(!ne(t,[s[0],r.getRange(i)[0]]))return s})(e,t);if(r)return function*(t){yield t.replaceText(e.callee,"queueMicrotask"),yield t.removeRange(r)}})(n,e)}:void 0})},meta:{type:"suggestion",docs:{description:"Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{checkSetImmediate:{type:"boolean",description:"Whether to also check `setImmediate()`."},checkSetTimeout:{type:"boolean",description:"Whether to also check `setTimeout(…, 0)`."}}}],defaultOptions:[{checkSetImmediate:!1,checkSetTimeout:!1}],messages:{[x7]:"Prefer `queueMicrotask()` over `{{name}}`."},languages:["js/js"]}},br="prefer-string-pad-start-end",bn="suggest-padding-method",bo=new o(["ArrayExpression","ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","ObjectExpression"]),ba=(e,t)=>{if("Identifier"!==e.type)return;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs.length===1?r.defs[0]:void 0,o=r?.references.some(e=>e.isWrite()&&!e.init);return o||n?.type!=="FunctionName"&&n?.type!=="ClassName"?!o&&n?.type==="Variable"&&n.parent?.kind==="const"&&n.node.id===n.name&&n.node.init?n.node.init:void 0:n.node},bi=(e,t)=>{let r=ba(e,t)??e;if(rj(e,t))return;let n=rT(r)?rP(r,t):rN(r,t);return"SequenceExpression"!==r.type?n:r.expressions.some(e=>rB(e,t))?void 0:n??eJ(r,t.sourceCode.getScope(r))},bs=(e,t)=>{let r=ba(e,t)??e;return bo.has(e.type)||((e,t)=>{let r=ba(e,t)??e;if("SequenceExpression"===r.type&&rB(r,t)){let e=rN(r.expressions.at(-1),t);return!e||"string"!=typeof e.value}let n=bi(r,t);return rT(r)?!n||"string"!=typeof n.value:n&&"string"!=typeof n.value})(e,t)||bo.has(r.type)||oO(r,t)||o2(r,t)||oj(e,t)},bl=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,bu=e=>"Literal"===e.type&&"string"==typeof e.value||"TemplateLiteral"===e.type&&0===e.expressions.length,bp=({targetNode:e,targetLengthNode:t,paddingNode:r})=>"Identifier"===e.type&&tm(t)&&bu(r),bc=(e,t)=>{if(!tP(e,{method:"repeat",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=e.callee.object,n=((e,t)=>{let r=bi(e,t);if("string"==typeof r?.value)return r.value})(r,t);if(n?.length===1)return{paddingNode:r,paddingString:n,widthNode:e.arguments[0]}},bd=(e,t)=>{let r=bc(e,t);if(!r)return;let{widthNode:n}=r;if("BinaryExpression"===n.type&&"-"===n.operator&&tL(n.right,{property:"length",computed:!1}))return{...r,targetLengthNode:n.left,targetNode:n.right.object}},bm=({method:e,targetNode:t,targetLengthNode:r,paddingNode:n,paddingString:o},a)=>{let i=ts(t,a),s=ts(r,a),l=(({paddingNode:e,paddingString:t},r)=>" "===t?"":`, ${ts(e,r)}`)({paddingNode:n,paddingString:o},a);return`${i}.${e}(${s}${l})`},bf=({node:e,method:t,replacement:r,context:n,canFix:o})=>{let a={node:e,messageId:br,data:{method:t}};return o&&!bl(e,n)&&(a.fix=function(t){let o=iB(n.sourceCode.getTokenBefore(e),n,r)?";":"";return t.replaceText(e,`${o}${r}`)}),a},bg=({node:e,method:t,replacement:r,context:n,canSuggest:o})=>{let a={node:e,messageId:br,data:{method:t}};return o&&!bl(e,n)&&(a.suggest=[{messageId:bn,data:{method:t},fix:t=>t.replaceText(e,r)}]),a},by="require-css-escape",bh=["closest","matches","querySelector","querySelectorAll"],bx=e=>e.value.cooked,bb=(e,t)=>{let r,n="";for(let r of e.quasis.slice(0,t+1))n+=bx(r);if(!((r=n).lastIndexOf("[")>r.lastIndexOf("]")))return!1;for(let r of e.quasis.slice(t+1))if(bx(r).includes("]"))return!0;return!1},bv=e=>tP(e,{object:"CSS",method:"escape",argumentsLength:1,optionalCall:!1,optionalMember:!1}),bE=e=>t=>"SequenceExpression"===e.type?[t.insertTextBefore(e,"CSS.escape(("),t.insertTextAfter(e,"))")]:[t.insertTextBefore(e,"CSS.escape("),t.insertTextAfter(e,")")],bS={create:e=>{let{checkAllSelectors:t}=e.options[0];e.on("CallExpression",function*(e){if(!tP(e,{methods:bh,minimumArguments:1})||am(e.callee.object))return;let[r]=e.arguments;if("TemplateLiteral"===r.type&&0!==r.expressions.length)for(let[e,n]of r.expressions.entries())!bv(n)&&(t||bb(r,e))&&(yield{node:n,messageId:by,fix:bE(n)})})},meta:{type:"suggestion",docs:{description:"Require `CSS.escape()` for interpolated values in CSS selectors.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{checkAllSelectors:{type:"boolean",description:"Check all selector interpolations instead of only attribute selector interpolations."}}}],defaultOptions:[{checkAllSelectors:!1}],messages:{[by]:"Use `CSS.escape()` for interpolated values in CSS selectors."},languages:["js/js"]}},bT="require-passive-events",bC=new o(["touchstart","touchmove","touchenter","touchend","touchleave","wheel","mousewheel"]),bD=e=>{var t;if("MemberExpression"!==e.parent.type||e.parent.object!==e)return!1;let r=(t=e.parent).computed||"Identifier"!==t.property.type?tp(t.property)?t.property.value:void 0:t.property.name;return r&&"preventDefault"!==r&&!ns((e=>{for(;"MemberExpression"===e.parent.type&&e.parent.object===e;)e=e.parent;return e})(e.parent))},bw="this",bA="class",bk="class-unavailable",bI="super",bj="super-class",bR="super-class-unavailable",bF="suggestion",bB=new o(["PropertyDefinition","AccessorProperty","StaticBlock","ClassBody"]),bL=new o(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]),bN=e=>"MethodDefinition"===e.parent.type&&e.parent.value===e,bP=e=>"FunctionDeclaration"===e.type||"FunctionExpression"===e.type,bM=e=>{let t=e;for(let{parent:r}=e;r;t=r,r=r.parent)if("ArrowFunctionExpression"!==r.type){if(bP(r)&&!bN(r))return;if("MethodDefinition"===r.type)return r.static&&r.value===t?r:void 0;if(bB.has(r.type))return}},b$=e=>{if(e.id)return e.id;let{parent:t}=e;if("ClassExpression"===e.type&&"VariableDeclarator"===t.type&&t.init===e&&"Identifier"===t.id.type)return t.id},bO=(e,t,r)=>eD(e.getScope(t),t)===eD(e.getScope(r),r),bU=(e,t,r)=>eD(e.getScope(t),r.name)===eD(e.getScope(r),r),bq=(e,t)=>"AssignmentExpression"===e.type&&e.left===t||"UpdateExpression"===e.type&&e.argument===t||"UnaryExpression"===e.type&&"delete"===e.operator&&e.argument===t||("ForInStatement"===e.type||"ForOfStatement"===e.type)&&e.left===t,bW=(e,t)=>bL.has(e.type)&&e.expression===t,bV=e=>{let{parent:t}=e;if("MemberExpression"===t.type&&t.object===e||"ChainExpression"===t.type&&t.expression===e)return t;let r=bW(e.parent,e)?e.parent:void 0;return r||("Property"===t.type&&t.value===e&&"ObjectPattern"===t.parent.type?t.parent:"ObjectPattern"===t.type&&t.properties.includes(e)||"ArrayPattern"===t.type&&t.elements.includes(e)||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e?t:void 0)},bz=e=>{let t=e;for(;t;){if(bq(t.parent,t))return!0;t=bV(t)}return!1},b_=e=>"MemberExpression"===e.parent.type&&e.parent.object===e,bJ=e=>{let t=e;for(;bW(t.parent,t);)t=t.parent;return t},bH=e=>{let t=bJ(e);return"CallExpression"===t.parent.type&&t.parent.callee===t||"NewExpression"===t.parent.type&&t.parent.callee===t||"TaggedTemplateExpression"===t.parent.type&&t.parent.tag===t},bK=e=>{let t=bJ(e);return b_(t)&&"PrivateIdentifier"===t.parent.property.type},bG=e=>{let t=bJ(e);return"BinaryExpression"===t.parent.type&&"in"===t.parent.operator&&"PrivateIdentifier"===t.parent.left.type&&t.parent.right===t},bX=e=>e.superClass?.type==="Identifier"?e.superClass:void 0,bY=({node:e,messageId:t,source:r,replacement:n,name:o})=>({node:e,messageId:t,data:{name:o},suggest:[{messageId:bF,data:{source:r,replacement:n},fix:t=>t.replaceText(e,n)}]}),bZ=(e,t,r)=>({node:e,messageId:t,data:{name:r}}),bQ={create:e=>{let{sourceCode:t}=e,{preferThis:r,preferSuper:n}=e.options[0];e.on("ThisExpression",e=>{if(r||bz(e)||bH(e)||bK(e)||bG(e))return;let n=bM(e);if(!n)return;let o=b$(n.parent.parent);return o&&bU(t,e,o)?bY({node:e,messageId:bA,source:"this",replacement:o.name,name:o.name}):bZ(e,bk)}),e.on("Super",e=>{if(n||bz(e))return;let r=bM(e);if(!r)return;let o=bX(r.parent.parent);return o&&bU(t,e,o)?bY({node:e,messageId:bj,source:"super",replacement:o.name,name:o.name}):bZ(e,bR)});let o=0;e.on("ClassBody",()=>{o++}),e.onExit("ClassBody",()=>{o--}),e.on("Identifier",a=>{if(0===o||!t$(a)||(e=>{let t=e;for(;"TSQualifiedName"===t.parent.type;)t=t.parent;return"TSTypeReference"===t.parent.type&&t.parent.typeName===t||"TSTypeQuery"===t.parent.type&&t.parent.exprName===t})(a)||bz(a)||bH(a)||bK(a)||bG(a))return;let i=bM(a);if(!i)return;let s=i.parent.parent;if(r){let e=b$(s);if(e&&a.name===e.name&&bO(t,a,e))return bY({node:a,messageId:bw,source:a.name,replacement:"this",name:a.name})}if(!n||!(b_(a)&&!a.parent.optional&&!bz(a.parent))||tl(a,e))return;let l=bX(s);if(l&&a.name===l.name&&bO(t,a,l))return bY({node:a,messageId:bI,source:a.name,replacement:"super",name:a.name})})},meta:{type:"suggestion",docs:{description:"Enforce consistent class references in static methods.",recommended:!0},hasSuggestions:!0,schema:[{type:"object",properties:{preferThis:{type:"boolean",description:"Prefer `this` over the current class name in static methods."},preferSuper:{type:"boolean",description:"Prefer `super` over the superclass name in static methods."}},additionalProperties:!1}],defaultOptions:[{preferThis:!0,preferSuper:!0}],messages:{[bw]:"Use `this` instead of `{{name}}` in static methods.",[bA]:"Use `{{name}}` instead of `this` in static methods.",[bk]:"Use the class name instead of `this` in static methods.",[bI]:"Use `super` instead of `{{name}}` in static methods.",[bj]:"Use `{{name}}` instead of `super` in static methods.",[bR]:"Use the superclass name instead of `super` in static methods.",[bF]:"Replace `{{source}}` with `{{replacement}}`."},languages:["js/js"]}},b0="consistent-optional-chaining/remove-optional",b1="consistent-optional-chaining/use-optional",b2="consistent-optional-chaining/suggest-remove-optional",b3="consistent-optional-chaining/suggest-use-optional",b5=new o(["Identifier","ThisExpression","Super"]);function b8(e){let t;for(;e!==t;)t=e,"ChainExpression"===(e=rx(e)).type&&(e=e.expression);return e}function b9(e){return"MemberExpression"===(e=b8(e)).type?e:void 0}function b6(e){return e=b8(e),!!b5.has(e.type)||"MemberExpression"===e.type&&b6(e.object)}function b4(e,t){let r=ni(e,t);return!ne(t,r)}function b7({memberExpression:e,context:t,fixer:r,replacement:n}){let o=ni(e,t);return r.replaceTextRange(o,n)}function ve(e,t,r){return b7({memberExpression:e,context:t,fixer:r,replacement:e.computed?"[":"."})}let vt="always",vr="never",vn="missing-delay",vo="redundant-delay",va=new o(["setTimeout","setInterval"]),vi=new o(["window","globalThis","global","self"]),vs=e=>tu(e,0)||"UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)&&vs(e.argument),vl="negative-index",vu="length-index",vp="no-duplicate-loops",vc=["filter","map"],vd="no-declarations-before-early-exit",vm=e=>"VariableDeclaration"===e.type&&("let"===e.kind||"const"===e.kind),vf=e=>!e||"Literal"===e.type||"TemplateLiteral"===e.type&&0===e.expressions.length,vg=(e,t,r)=>{let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return n&&eL(n)},vy=(e,t)=>{let[r,n]=e.getRange(t);return new o(nj(e.getScope(t)).filter(({identifier:t})=>{let[o,a]=e.getRange(t);return o>=r&&a<=n}).map(({identifier:e})=>e.name))};function*vh(e,t,r){let n;for(let[o,a]of t.entries())if(vm(a)&&!a.declare){n??=t.map(e=>{var t,n;return(t=e,n=r,"IfStatement"!==t.type||n(t.consequent)===(!!t.alternate&&n(t.alternate)))?void 0:e});for(let r=o+1;r<t.length;r++){let t=n[r];if(t){for(let n of a.declarations){let i=function({sourceCode:e,declaration:t,declarator:r,guardStatement:n,declarationIndex:o,guardIndex:a}){var i;let s;if("Identifier"!==r.id.type||(e=>{if(e?.type!=="CallExpression")return!1;let{callee:t}=e;return"Identifier"===t.type?av(t.name):"MemberExpression"===t.type&&!t.computed&&"Identifier"===t.object.type&&/^[A-Z]/.test(t.object.name)&&"Identifier"===t.property.type&&av(t.property.name)})(r.init)||r.init&&t2(r.init,e.visitorKeys)||a>o+1&&!vf(r.init)||r.init&&(i=r.init,s=vy(e,n),[...vy(e,i)].some(e=>s.has(e)))&&(e0(r.init,e)||e0(n.test,e)))return;let[l]=e.getDeclaredVariables(r),u=l.references.filter(e=>!e.init&&!function(e){let t=e;for(;"TSQualifiedName"===t.parent.type;)t=t.parent;return"TSTypeQuery"===t.parent.type}(e.identifier));if(0===u.length)return;let[,p]=e.getRange(n);if(u.some(t=>e.getRange(t.identifier)[0]<p))return;let c={node:r.id,messageId:vd};return(({sourceCode:e,declaration:t,guardStatement:r,declarationIndex:n,guardIndex:o})=>o===n+1&&1===t.declarations.length&&vf(t.declarations[0].init)&&0===e.getCommentsInside(t).length&&!vg(e,t,"before")&&!vg(e,r,"after")&&!e.getTokensBetween(t,r,{includeComments:!0}).some(e=>eL(e)))({sourceCode:e,declaration:t,guardStatement:n,declarationIndex:o,guardIndex:a})&&(c.fix=function(e,t,r){let n=e.getText(t),o=e.getText(r),[a,i]=e.getRange(t),[s,l]=e.getRange(r),u=e.text.slice(i,s);return e=>e.replaceTextRange([a,l],`${o}${u}${n}`)}(e,t,n)),c}({sourceCode:e,declaration:a,declarator:n,guardStatement:t,declarationIndex:o,guardIndex:r});i&&(yield i)}break}}}}let vx="no-optional-chaining-on-undeclared-variable",vb=e=>"Type"===e.type||"ImportBinding"===e.type&&iL(e.node);function vv(e){let t;for(;e!==t;)t=e,("ChainExpression"===(e=rx(e)).type||"TSInstantiationExpression"===e.type)&&(e=e.expression);return e}let vE="no-object-methods-with-collections/error",vS="no-object-methods-with-collections/suggestion",vT=new o(["entries","keys","values"]),vC="no-subtraction-comparison/error",vD="no-subtraction-comparison/suggestion",vw={">":"<",">=":"<=","<":">","<=":">=","===":"===","!==":"!==","==":"==","!=":"!="},vA=new o(Object.keys(vw)),vk=new o([">","<"]),vI=e=>"BinaryExpression"===e.type&&"-"===e.operator,vj=(e,t)=>{let r=rP(e,t)?.value;return"number"==typeof r&&Number.isFinite(r)},vR="no-unnecessary-global-this",vF=new o(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]);function vB(e){for(;vF.has(e.type);)e=e.expression;return e}let vL=e=>{for(;vF.has(e.parent.type)&&e.parent.expression===e;)e=e.parent;return e},vN=t6();function vP(e){return"CallExpression"===(e=vL(e)).parent.type&&e.parent.callee===e}let vM=new o(["==","!=","===","!=="]),v$="computed-key",vO="nested-array",vU="deep-object",vq="property-assignment",vW=new r([["Math",new o(["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"])],["String",new o(["raw"])]]);function vV(e){let{parent:t}=e;return rh(t)&&t.expression===e||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e?vV(t):"Property"===t.type&&t.value===e&&"ObjectPattern"===t.parent.type?t.parent:"ObjectPattern"===t.type||"ArrayPattern"===t.type?t:void 0}function vz(e){let t=0;for(;e;)"ObjectPattern"===e.type&&t++,e=vV(e);return t}let v_="no-useless-else",vJ=new o(["Program","BlockStatement","StaticBlock","SwitchCase"]),vH=new o(["[","(","<","/","`","+","-"]),vK=e=>vH.has(e.value[0]),vG="no-useless-recursion",vX=new o(["using","await using"]),vY=e=>e?.type==="VariableDeclaration"&&vX.has(e.kind),vZ=e=>"ForStatement"===e.type?vY(e.init):"ForOfStatement"===e.type&&vY(e.left),vQ="prefer-add-event-listener-options",v0="prefer-direct-iteration",v1="Array",v2="FormData",v3="URLSearchParams",v5=new o([v1,"Map","Set",v2,v3,...nM]),v8=new r([["ReadonlyArray",v1],["ReadonlyMap","Map"],["ReadonlySet","Set"]]),v9=new r([[v1,["values"]],["Map",["entries"]],["Set",["values","keys"]],[v2,["entries"]],[v3,["entries"]],...nM.map(e=>[e,["values"]])]),v6=["Map","WeakMap","Set","WeakSet"],v4=["all","allSettled","any","race"],v7=new o(["ArrayExpression","CallExpression","NewExpression"]),Ee=e=>new o([e]),Et=(e,t)=>tP(e,{objects:nM,methods:t,optionalCall:!1,optionalMember:!1}),Er=e=>v5.has(e)?e:v8.get(e),En=e=>{let t=new o;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},Eo=(e,t,r)=>{if("any"===e.intrinsicName||"unknown"===e.intrinsicName)return;if(e.isUnion())return En(e.types.map(e=>Eo(e,t,r)));if(t.isArrayType(e)||t.isTupleType(e))return Ee(v1);let n=nU(e);if(!nq(n,r))return;let o=n.getName(),a=o&&Er(o);return a&&Ee(a)},Ea=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return Ea(e.typeAnnotation);case"TSArrayType":case"TSTupleType":return Ee(v1);case"TSTypeOperator":return"readonly"===e.operator?Ea(e.typeAnnotation):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type)return;let t=Er(e.typeName.name);return t&&Ee(t)}case"TSUnionType":return En(e.types.map(e=>Ea(e)))}},Ei=(e,t,r=new o)=>((e,t,r)=>{if("ArrayExpression"===e.type||tT(e,{name:"Array"}))return Ee(v1);if(tT(e,{names:nM})||tT(e,{names:["Map","Set",v2,v3]}))return Ee(e.callee.name);if(tS(e,{name:"Array"},tb)||tP(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}))return Ee(v1);if(Et(e,["from","of"]))return Ee(e.callee.object.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n=eD(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return;r.add(n);let[o]=n.defs,a=Ea(o.name?.typeAnnotation);return a||("Variable"===o.type&&"const"===o.parent.kind&&o.node.id===o.name&&o.node.init?Ei(o.node.init,t,r):void 0)})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return Ea(e.typeAnnotation)??Ei(e.expression,t,r);case"TSNonNullExpression":return Ei(e.expression,t,r)}})(e,t,r)??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return Eo(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e,t),Es="prefer-number-is-safe-integer/error",El="prefer-number-is-safe-integer/suggestion",Eu="prefer-number-is-safe-integer/integer-check-error",Ep="prefer-number-is-safe-integer/integer-check-suggestion",Ec=["_","lodash","underscore"],Ed=["floor","trunc"],Em=(e,t)=>{let r=eD(t.getScope(e),"Number");return!r||"global"===r.scope.type&&0===r.defs.length},Ef=e=>{if("BinaryExpression"===e.type&&"%"===e.operator&&tu(e.right,1))return e.left},Eg=(e,t)=>{if(tP(e,{object:"Math",methods:Ed,argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return e.arguments[0]},Ey="prefer-object-define-properties";function Eh(e){if(e?.type!=="ExpressionStatement")return;let{expression:t}=e;if(tP(t,{object:"Object",method:"defineProperty",argumentsLength:3,optionalCall:!1,optionalMember:!1,computed:!1}))return t}function Ex(e,t){let r=rN(e,{sourceCode:t});if(!(!r||rB(e,{sourceCode:t})))return"symbol"==typeof r.value?r.value:String(r.value)}let Eb=new o(["String","Template"]),Ev=e=>/^(?:0|[1-9]\d*)$/.test(e)&&0xffffffff>Number(e),EE="prefer-object-destructuring-defaults",ES="prefer-object-destructuring-defaults/suggestion",ET=new o(Object.getOwnPropertyNames(Object.prototype)),EC={considerGetters:!0,considerImplicitTypeConversion:!0},ED=e=>"Property"===e.type&&"init"===e.kind&&!e.computed&&!e.method,Ew=(e,t,r)=>nj(r.sourceCode.getScope(e)).some(n=>t.has(n.identifier.name)&&((e,t,r)=>{let[n,o]=r.getRange(e),[a,i]=r.getRange(t);return n>=a&&o<=i})(n.identifier,e,r.sourceCode)),EA=(e,t,r)=>{let{sourceCode:n}=r,o=n.getText(e.node.value),a=ts(t.value,r);return e.node.shorthand?`${o} = ${a}`:`${n.getText(e.node.key)}: ${o} = ${a}`},Ek="prefer-single-object-destructuring",EI="prefer-direct-object-destructuring",Ej=new o(["Identifier","MemberExpression","ChainExpression","CallExpression","NewExpression","TaggedTemplateExpression","AwaitExpression"]),ER=(e,t)=>{let r,n;if(!("VariableDeclaration"===t.type&&("const"===(r=t.kind)||"let"===r)&&!t.declare&&1===t.declarations.length))return;let[o]=t.declarations;if("ObjectPattern"===o.id.type&&!o.id.typeAnnotation&&(n=o.id).properties.length>0&&n.properties.every(e=>"Property"===e.type&&!e.computed&&"Identifier"===e.value.type)&&o.init?.type==="Identifier"&&((e,t)=>{let r=eD(e.getScope(t),t);if(!r||1!==r.defs.length)return!1;let[n]=r.defs;return"Variable"===n.type&&"VariableDeclarator"===n.node.type&&"VariableDeclaration"===n.parent.type&&!n.parent.declare&&"const"===n.parent.kind})(e,o.init))return{node:t,declarator:o,source:o.init.name}},EF=(e,t,r)=>{let{sourceCode:n}=e;if(!("VariableDeclaration"===t.type&&"const"===t.kind&&!t.declare&&1===t.declarations.length))return;let[o]=t.declarations;if("Identifier"!==o.id.type||o.id.typeAnnotation||!o.init)return;let a=ER(n,r);if(!a)return;let i=eD(n.getScope(a.declarator.init),a.declarator.init),s=[n.getRange(t)[0],n.getRange(r)[1]];if(i.defs[0].node!==o||i.references.some(e=>!e.init&&e.identifier!==a.declarator.init)||r6(e,s))return;let l=rx(o.init);if(!Ej.has(l.type))return;let u=`${r.kind} ${n.getText(a.declarator.id)} = ${ts(o.init,e)};`;return r4(e,{node:o.id,messageId:EI,data:{source:o.id.name},fix:e=>e.replaceTextRange(s,u)},s)},EB=(e,t,r)=>{var n,a;let i,{sourceCode:s}=e,l=ER(s,t),u=ER(s,r);if(!(l&&u&&l.node.kind===u.node.kind&&l.source===u.source))return;let p=[s.getRange(l.node)[0],s.getRange(u.node)[1]];if(n=l.declarator.id,a=u.declarator.id,i=new o(n.properties.map(e=>eK(e))),a.properties.some(e=>i.has(eK(e)))||r6(e,p))return;let c=e=>e.properties.map(e=>s.getText(e)).join(", "),d=`${l.node.kind} {${c(l.declarator.id)}, ${c(u.declarator.id)}} = ${l.source};`;return r4(e,{node:u.node,messageId:Ek,data:{source:l.source},fix:e=>e.replaceTextRange(p,d)},p)};function*EL(e,t){for(let[r,n]of t.entries()){if(0===r)continue;let o=t[r-1],a=EF(e,o,n)??EB(e,o,n);a&&(yield a)}}let EN="prefer-smaller-scope",EP=new o(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","StaticBlock","WithStatement"]);function EM(e,t){let r=e.parent;for(;r&&r!==t;){if(EP.has(r.type))return!1;r=r.parent}return r===t}function E$(e,t){if("WithStatement"===e.type)return!0;let r="CallExpression"===e.type?rx(e.callee):void 0;for(;r?.type==="TSInstantiationExpression";)r=rx(r.expression);return r?.type==="Identifier"&&"eval"===r.name||t1(e,t).some(e=>E$(e,t))}function EO(e,t,r){let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return!!(n&&eL(n))}function EU(e,t){let r=e.getTokenBefore(t),n=e.getTokenAfter(t);return r?.value==="("&&n?.value===")"}let Eq="prefer-single-array-predicate/error",EW="prefer-single-array-predicate/suggestion",EV=new r([["||","some"],["&&","every"]]),Ez=new o(["AssignmentExpression","ArrowFunctionExpression","ConditionalExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),E_="prefer-url-href",EJ=(e,t)=>0===t.sourceCode.getCommentsInside(e).length,EH="require-proxy-trap-boolean-return",EK=new o(["defineProperty","deleteProperty","has","isExtensible","preventExtensions","set","setPrototypeOf"]),EG=new o(["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"]),EX=e=>"ReturnStatement"===e.type||"ThrowStatement"===e.type,EY=e=>tT(e,{name:"Proxy",argumentsLength:2})||tP(e,{object:"Proxy",method:"revocable",argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1}),EZ=new o(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression","TemplateLiteral","UpdateExpression"]),EQ=new o(["%","&","*","**","+","-","/","<<",">>",">>>","^","|"]),E0=(e,t)=>({node:e,messageId:EH,data:{name:t}}),E1=e=>{if(e)return E0(e.node,e.data.name)},E2=(e,t,r)=>{if("AssignmentExpression"===e.type)return"="===e.operator?E1(E2(e.right,t,r)):E0(e,t);if("ConditionalExpression"===e.type)return E2(e.consequent,t,r)??E2(e.alternate,t,r);if("LogicalExpression"===e.type)return E1(E2(e.left,t,r)??E2(e.right,t,r));if("SequenceExpression"===e.type)return E1(E2(e.expressions.at(-1),t,r));let n=((e,t)=>{let r={sourceCode:t},n=rx(e),o=rN(n,r);if(void 0!==o)return"boolean"==typeof o.value?void 0:!!o.value;if(rB(n,r)||rj(n,r))return;let a=eJ(n,t.getScope(n));if(a&&"boolean"!=typeof a.value)return!!a.value})(e,r);if(void 0===n&&!(EZ.has(e.type)||"UnaryExpression"===e.type&&"!"!==e.operator&&"delete"!==e.operator||"BinaryExpression"===e.type&&EQ.has(e.operator)))return;let o=((e,t,r)=>{if(!(r.getCommentsInside(e).length>0)&&("Literal"===e.type&&!e.regex||"TemplateLiteral"===e.type&&0===e.expressions.length||"Identifier"===e.type&&"undefined"===e.name))return String(t)})(e,n,r);return{...E0(e,t),...o&&{fix:t=>t.replaceText(e,o)}}},E3=(e,t)=>{if("Property"!==e.type||"init"!==e.kind)return;let r=eK(e,t.getScope(e));if(EK.has(r)&&EG.has(e.value.type))return{name:r,functionNode:e.value}},E5=({functionNode:e,name:t},r,n)=>{if(e.async||e.generator)return E0(e,t);if("BlockStatement"!==e.body.type)return E2(e.body,t,r);let o=[...function* e(t){if("ReturnStatement"===t.type)return void(yield t);if(!EG.has(t.type))for(let r of sf(t))yield*e(r)}(e.body)],a=n.get(e);if(0===o.length){if(a)return;return E0(e,t)}for(let e of o){if(!e.argument)return E0(e,t);let n=E2(e.argument,t,r);if(n)return n}if(!a)return E0(e,t)},E8=w.builtinRules.get("logical-assignment-operators"),E9="ifNullish",E6="convertIf",E4={...E8.meta.messages,[E9]:"'if' statement can be replaced with a logical operator assignment with operator ||= or ??=."},E7=e=>e.fix??e.suggest?.[0]?.fix,Se={create:e=>{let{sourceCode:t}=e,r=Object.create(e,{report:{value(r){e.report(function(e,t){let r;if("if"!==e.messageId||e.data?.operator!=="||="||"function"!=typeof E7(e))return e;let n={...(r={...e},delete r.fix,delete r.suggest,r),messageId:E9};if(t.getCommentsInside(e.node).length>0)return n;let o=E7(e);return{...n,suggest:[{messageId:E6,data:{operator:"||="},fix:o},{messageId:E6,data:{operator:"??="},fix:function*(e){for(let t of o(e))yield"||"===t.text?{...t,text:"??"}:t}}]}}(r,t))}}});for(let[t,n]of Object.entries(E8.create(r)))e.on(t,n)},meta:{type:E8.meta.type,docs:{description:E8.meta.docs.description,recommended:!0},fixable:E8.meta.fixable,hasSuggestions:E8.meta.hasSuggestions,schema:E8.meta.schema,defaultOptions:[E8.meta.defaultOptions?.[0]],messages:E4,languages:["js/js"]}},St="no-useless-coercion",Sr=new r([["Boolean",{type:"boolean",isType:o2}],["String",{type:"string",isType:oR}],["BigInt",{type:"bigint",isType:function(e,t){return!!("TSSatisfiesExpression"===e.type&&o5(e.typeAnnotation)||o8(e,t))||"bigint"==typeof rN(e,t)?.value}}],["Number",{type:"number",isType:oO}]]),Sn="no-useless-boolean-cast",So=["every","filter","find","findIndex","findLast","findLastIndex","some"],Sa="no-useless-continue",Si="no-useless-override",Ss=e=>e.isUnion()?e.types.every(e=>Ss(e)):"void"===e.intrinsicName||"undefined"===e.intrinsicName,Sl=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{return{type:r.getTypeAtLocation(e),checker:r.program.getTypeChecker()}}catch{}},Su="prefer-has-check",Sp=new o(["Map","ReadonlyMap","WeakMap"]),Sc=new o(["Map","WeakMap"]),Sd=new o(["FormData","Headers","URLSearchParams"]),Sm=new o(["Array","ReadonlyArray"]),Sf=Sc.union(Sd),Sg=new o(["ClassName","ImportBinding","TSEnumName","Type"]),Sy=new o(["any","bigint","boolean","false","number","string","unknown","undefined","null","void"]),Sh=new o(["TSAnyKeyword","TSNeverKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword"]),Sx=new o(["TSBigIntKeyword","TSBooleanKeyword","TSNumberKeyword","TSStringKeyword"]),Sb=new o(["TSArrayType","TSConstructorType","TSFunctionType","TSObjectKeyword","TSSymbolKeyword","TSTupleType"]),Sv=new o(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression"]),SE=new o(["ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"]),SS=e=>{for(;SE.has(e.type);)e=e.expression;return e},ST=e=>"Identifier"===e.type?e.name:void 0,SC=e=>e.typeArguments?.params??e.typeParameters?.params??[],SD=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>Sg.has(e.type));if(r)return r;t=t.upper}},Sw=e=>{if(e?.type==="Type"&&"TSTypeAliasDeclaration"===e.node.type&&0===SC(e.node).length)return e.node.typeAnnotation},SA=(e,t)=>{if(t.sourceCode.isGlobalReference(e))return!0;let r=eD(t.sourceCode.getScope(e),e);return!r||0===r.defs.length},Sk=(e,t)=>tV(e)&&SA(e,t)||"UnaryExpression"===e.type&&"void"===e.operator&&"Literal"===e.argument.type&&0===e.argument.value,SI=(e,t)=>Sp.has(e)?{kind:"map",typeName:e,valueType:t}:Sd.has(e)?{kind:"null-sentinel",typeName:e}:void 0,Sj=(e,t,r=new o)=>{switch(e?.type){case"TSTypeAnnotation":return Sj(e.typeAnnotation,t,r);case"TSTypeOperator":return"readonly"===e.operator?Sj(e.typeAnnotation,t,r):void 0;case"TSTypeReference":{let n=ST(e.typeName);if(!n)return;if((Sp.has(n)||Sd.has(n))&&!SD(n,t))return SI(n,SC(e).at(-1));let o=((e,t,r)=>{if(!r.has(e))return r.add(e),Sw(SD(e,t))})(n,t,r);return o?Sj(o,t,r):void 0}}},SR=(e,t)=>{let r=t.sourceCode.getScope(e);return Sj(e.typeAnnotation,r)},SF=(e,t,r=new o)=>{let n=SR(e,t);if(n)return n;if(tT(e=SS(e))&&"Identifier"===e.callee.type&&Sf.has(e.callee.name)&&SA(e.callee,t))return SI(e.callee.name);if("Identifier"!==e.type)return;let a=eD(t.sourceCode.getScope(e),e);if(!a||r.has(a)||1!==a.defs.length)return;r.add(a);let[i]=a.defs,s=Sj(i.name?.typeAnnotation,t.sourceCode.getScope(i.name));return s||("Variable"===i.type&&"const"===i.parent.kind&&i.node.id===i.name&&i.node.init?SF(i.node.init,t,r):void 0)},SB=(e,t)=>{for(let r of[e,e.target]){if(!r)continue;let e=nU(r);if(nq(e,t))return e.getName()}},SL=(e,t,r)=>{if(n$.has(e.intrinsicName)||nO.has(e.intrinsicName))return;if(e.isUnion()){let n=e.types.map(e=>SL(e,t,r));if(1===new o(n.map(e=>e?.typeName)).size){let[e]=n;return e?.kind!=="map"?e:{...e,valueType:t.getUnionType(n.map(e=>e.valueType))}}return n.every(e=>e?.kind==="map")?{kind:"map",typeName:"Map",valueType:t.getUnionType(n.map(e=>e.valueType))}:n.every(e=>e?.kind==="null-sentinel")?{kind:"null-sentinel",typeName:"null-sentinel"}:void 0}if(e.isIntersection())return e.types.map(e=>SL(e,t,r)).find(e=>e?.kind==="map");let n=SB(e,r);return SI(n,Sp.has(n)?t.getTypeArguments(e).at(-1):void 0)},SN=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return SL(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}},SP=(e,t)=>SN(e,t)??SF(e,t),SM=(e,t)=>"truthy"===t?!!e:"not-undefined"===t?void 0!==e:null!=e,S$=(e,t,r,n=new o)=>{if(!e||Sh.has(e.type))return!1;if("TSTypeOperator"===e.type)return"readonly"===e.operator&&S$(e.typeAnnotation,t,r,n);if("TSUnionType"===e.type||"TSIntersectionType"===e.type)return e.types.every(e=>S$(e,t,r,n));if("TSNullKeyword"===e.type)return"not-undefined"===r;if(Sx.has(e.type))return"truthy"!==r;if(Sb.has(e.type))return!0;if("TSTypeLiteral"===e.type)return"truthy"!==r;if("TSLiteralType"===e.type){var a;return SM("Literal"===(a=e.literal).type?a.value:"TemplateLiteral"===a.type?a.quasis[0].value.cooked:-a.argument.value,r)}return"TSTypeReference"===e.type&&((e,t,r,n)=>{let o,a,i=ST(e.typeName);if(!i||n.has(i))return!1;n.add(i);let s=(a=Sw(o=SD(i,t.sourceCode.getScope(e.typeName))))?{type:"alias",node:a}:o?.type==="ClassName"||o?.type==="Type"&&"TSInterfaceDeclaration"===o.node.type?{type:"object"}:void 0,l=!1;return s?.type==="alias"?l=S$(s.node,t,r,n):s?.type==="object"&&(l="truthy"!==r),n.delete(i),l})(e,t,r,n)},SO=(e,t)=>e.isTypeParameter?.()?e.getConstraint()??t.getBaseConstraintOfType(e):e,SU=(e,t,r)=>{if(n$.has(e.intrinsicName))return!1;let n=SO(e,t);return n&&n!==e?SU(n,t,r):!e.isTypeParameter?.()&&(e.isUnion()||e.isIntersection()?e.types.every(e=>SU(e,t,r)):!r.has(e.intrinsicName))},Sq=(e,t,r)=>{if(n$.has(e.intrinsicName)||nO.has(e.intrinsicName))return!1;let n=SO(e,t);if(n&&n!==e)return Sq(n,t,r);if(e.isUnion()||e.isIntersection())return e.types.every(e=>Sq(e,t,r));if(Sy.has(e.intrinsicName))return!1;if("true"===e.intrinsicName||"symbol"===e.intrinsicName)return!0;if(e.isStringLiteral?.())return e.value.length>0;if(e.isNumberLiteral?.())return 0!==e.value;let o=t.typeToString(e);return/^-?\d+n$/u.test(o)?!/^-?0n$/u.test(o):"object"===t.typeToString(e)||Sm.has(SB(e,r))||e.getCallSignatures().length>0||e.getConstructSignatures().length>0},SW=(e,t,r)=>{let n=((e,t,r)=>{if(!tT(e)||"Identifier"!==e.callee.type||!Sc.has(e.callee.name)||!SA(e.callee,t))return;if(0===e.arguments.length)return!0;if(1!==e.arguments.length)return;let[n]=e.arguments;if("ArrayExpression"===n.type)return n.elements.every(e=>{var n,o,a;let i;return e?.type==="ArrayExpression"&&e.elements.length>=2&&e.elements[1]&&"SpreadElement"!==e.elements[1].type&&(n=e.elements[1],o=t,a=r,(i=rN(n,o))?SM(i.value,a):!tV(n)&&Sv.has(n.type))})})(SS(e),t,r);if(void 0!==n)return n;let a=SN(e,t)?.valueType;if(a){let{program:e}=t.sourceCode.parserServices,n=e.getTypeChecker();if("truthy"===r?Sq(a,n,e):"not-undefined"===r?SU(a,n,new o(["undefined","void"])):SU(a,n,new o(["undefined","void","null"])))return!0}return function e(t,r,n,a=new o){let i,s=SR(t,r);if(s?.kind==="map")return!!s.valueType&&S$(s.valueType,r,n);let l=((e,t,r)=>{if(!tT(e)||"Identifier"!==e.callee.type||!Sc.has(e.callee.name)||!SA(e.callee,t))return;let n=SC(e).at(-1);return!!n&&S$(n,t,r)})(t=SS(t),r,n);if(void 0!==l)return l;let u=((e,t,r)=>{if("Identifier"!==e.type)return;let n=eD(t.sourceCode.getScope(e),e);if(!(!n||r.has(n))&&1===n.defs.length)return n})(t,r,a);if(!u)return!1;a.add(u);let[p]=u.defs,c=(i=Sj(p.name?.typeAnnotation,r.sourceCode.getScope(p.name)),i?.kind==="map"?!!i.valueType&&S$(i.valueType,r,n):"Variable"===p.type&&"const"===p.parent.kind&&p.node.id===p.name&&!!p.node.init&&e(p.node.init,r,n,a));return a.delete(u),c}(e,t,r)},SV="logical",Sz="ternary",S_="consistent-conditional-object-spread",SJ="unnecessary-boolean-cast",SH=new o(["==","==="]),SK=new o(["!=","!=="]),SG=e=>tA(e)||tV(e)||tg(e),SX=e=>"SpreadElement"===e.parent.type&&e.parent.argument===e&&"ObjectExpression"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent);function SY(e,t,r){if(rf(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return SY(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&SY(e.left,t.left,r)&&SY(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&SY(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function SZ(e){return tg(e)?"null":tV(e)?"undefined":void 0}function SQ(e){if("BinaryExpression"!==e.type||!SH.has(e.operator)&&!SK.has(e.operator))return;let t=SZ(e.left),r=SZ(e.right);if(!!t!=!!r)return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:SH.has(e.operator)}}let S0=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind;function S1(e,t){let r=SQ(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=SQ(e.left),o=SQ(e.right);if(n&&o&&SY(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&S0(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&S0(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}function S2(e,t,r){let n=ts(e,r);return!tl(e,r)&&so(e,{operator:"&&",property:t})&&(n=`(${n})`),n}function S3(e,t){let r=ts(e,t);return!tl(e,t)&&i9(e)&&(r=`(${r})`),r}function S5(e,t,r){let n="UnaryExpression"===e.type&&"!"===e.operator&&"UnaryExpression"===e.argument.type&&"!"===e.argument.operator?e.argument.argument:tX(e,r)?e.arguments[0]:void 0;if(n)return{node:e,messageId:SJ,*fix(o,{abort:a}){if(r.sourceCode.getCommentsInside(e).length>0)return a();yield o.replaceText(e,S2(n,t,r))}}}function S8(e,t){return eD(t.sourceCode.getScope(e),e)}let S9="no-array-concat-in-loop",S6="no-array-front-mutation",S4=["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"],S7="no-array-sort-for-min-max/error",Te="no-array-sort-for-min-max/suggestion",Tt=e=>tm(e)&&0===e.value,Tr=(e,t)=>{if(!tP(e,{methods:["sort","toSorted"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||nu(e.callee.object))return;let[r]=e.arguments,n=(e=>{if(!tj(e)||e.async||e.generator||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type))return;let t=rx((e=>{if("BlockStatement"!==e.body.type)return e.body;if(1!==e.body.body.length)return;let[t]=e.body.body;if("ReturnStatement"===t.type)return t.argument})(e));if(t?.type!=="BinaryExpression"||"-"!==t.operator)return;let[r,n]=e.params;if(r.name!==n.name){if(rf(t.left,r)&&rf(t.right,n))return"ascending";if(rf(t.left,n)&&rf(t.right,r))return"descending"}})(r);if(n&&!(ou(e.callee.object,t)||op(e.callee.object,t)))return{direction:n,node:e.callee.object}},Tn=(e,t,r,n)=>{var o,a,i;let s=(o=t.direction,"first"===r?"ascending"===o?"min":"max":"ascending"===o?"max":"min"),l={node:e,messageId:S7,data:{method:s,extreme:"min"===s?"minimum":"maximum"}};if("Super"!==t.node.type&&0===n.sourceCode.getCommentsInside(e).length){let r,o=(a=t.node,i=n.sourceCode,r=iA(a)?i.getText(a):`(${i.getText(a)})`,`Math.${s}(...${r})`);l.suggest=[{messageId:Te,data:{replacement:o},fix:t=>t.replaceText(e,o)}]}return l},To="no-boolean-sort-comparator",Ta="no-boolean-sort-comparator/suggestion",Ti=new o(["sort","toSorted"]),Ts=new o([">",">=","<","<="]),Tl=(e,t,r,n)=>(e=rx(e),t=rx(t),"Identifier"===e.type&&"Identifier"===t.type)?e.name===r.name&&t.name===n.name||e.name===n.name&&t.name===r.name:"MemberExpression"===e.type&&"MemberExpression"===t.type&&e.computed===t.computed&&(e.computed?!!rf(e.property,t.property):e.property.name===t.property.name)&&Tl(e.object,t.object,r,n),Tu=(e,t)=>{for(;rh(e);){if(e.typeAnnotation&&oX(e.typeAnnotation,t,t.sourceCode.getScope(e)))return!0;e=e.expression}return!1},Tp="no-chained-comparison/error",Tc="no-chained-comparison/suggestion",Td=new o(["<",">","<=",">="]),Tm=new o(["===","!==","==","!="]),Tf=Td.union(Tm),Tg=e=>"BinaryExpression"===e.type&&Tf.has(e.operator),Ty="no-constant-zero-expression/error",Th="no-constant-zero-expression/suggestion",Tx="no-duplicate-logical-operands",Tb="no-duplicate-logical-operands/suggestion",Tv=new o(["Identifier","ThisExpression","Literal"]),TE=new o(["Identifier","ThisExpression"]),TS=e=>{if(cX(e=rx(e)))return!1;switch(e.type){case"Identifier":case"Super":case"ThisExpression":return!0;case"MemberExpression":var t;return TS(e.object)&&(!e.computed||(t=rx(t=e.property),Tv.has(t.type)));default:return!1}},TT="no-impossible-length-comparison",TC={"<":">","<=":">=",">":"<",">=":"<=","===":"===","!==":"!==","==":"==","!=":"!="},TD=(e,t)=>rP(e,t)?.value,Tw="no-invalid-character-comparison",TA=new o(["==","===","!=","!=="]),Tk=(e,t)=>!!(tP(e,{method:"charAt",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&oR(e.callee.object,t)||tP(e,{method:"at",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&oR(e.callee.object,t))||"MemberExpression"===e.type&&e.computed&&!e.optional&&(e=>{if(tm(e))return!0;if(!tp(e))return!1;let t=Number(e.value);return Number.isSafeInteger(t)&&t>=0&&String(t)===e.value})(e.property)&&oR(e.object,t),TI="no-loop-iterable-mutation",Tj=["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"],TR=["add","clear","delete"],TF=["clear","delete","set"],TB={array:new o(Tj),set:new o(TR),map:new o(TF),unknown:new o([...Tj,...TR,...TF])},TL=new o(["entries","keys","values"]),TN=new o(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression"]);function TP(e,t){return os(e,t)?"array":oh(e,t)?"set":ox(e,t)?"map":void 0}function TM(e){return e.left.declarations[0].id}function T$(e){return"Identifier"===(e=rx(e)).type?e:void 0}function TO(e){if("ArrayPattern"!==(e=rx(e)).type)return;let[t]=e.elements;return t&&T$(t)}function TU(e,t){if(cX(e=rx(e)))return;if(cK(e))return{collectionKind:TP(e,t),reference:e,method:"direct"};if("CallExpression"!==e.type||"MemberExpression"!==e.callee.type||e.arguments.length>0)return;let r=eK(e.callee,t.sourceCode.getScope(e.callee));if(TL.has(r)&&cK(e.callee.object))return{collectionKind:TP(e.callee.object,t),reference:e.callee.object,method:r}}function Tq(e,t){let r=TM(e);return"keys"===t.method?T$(r):"entries"===t.method||"direct"===t.method&&"set"!==t.collectionKind?TO(r):void 0}function TW(e,t){let r,n;if("VariableDeclaration"!==e.left.type||"const"!==e.left.kind)return{collectionKind:t.collectionKind,iterable:t.reference,loopBody:e.body};let o=(r=TM(e),"entries"===t.method?TO(r):"direct"!==t.method||"map"!==t.collectionKind?T$(r):void 0),a=Tq(e,t),i=(n=TM(e),"set"===t.collectionKind&&("direct"===t.method||"values"===t.method)?T$(n):"direct"===t.method||"entries"===t.method?T$(n)??TO(n):Tq(e,t));return{addArgumentIdentifier:o,collectionKind:t.collectionKind,deleteArgumentIdentifier:i,iterable:t.reference,loopBody:e.body,setKeyIdentifier:a}}function*TV(e){"Identifier"===(e=rx(e)).type?yield e:"MemberExpression"===e.type&&(yield*TV(e.object),e.computed&&(yield*TV(e.property)))}function Tz(e,t,r){if(!cH(e,t))return!1;let n=[...TV(e)],o=[...TV(t)];return n.length!==o.length||0===n.length?n.length===o.length:n.every((e,t)=>{var n;let a,i;return n=o[t],a=eD(r.sourceCode.getScope(e),e),i=eD(r.sourceCode.getScope(n),n),a||i?a===i:e.name===n.name})}function T_(e,t,r){let[n]=e.arguments;return!!(t&&n&&Tz(n,t,r))}function TJ(e,t,r,n){return"add"===r&&T_(e,t.addArgumentIdentifier,n)||"set"===r&&T_(e,t.setKeyIdentifier,n)}function TH(e,t){return e.some(e=>"BlockStatement"===e.type?TH(e.body,t):t(e))}let TK=new o(["ContinueStatement","ReturnStatement","ThrowStatement"]),TG="no-selector-as-dom-name",TX=["add","remove","contains","toggle","replace"],TY=/^[#.]-?[A-Z_a-z][\w-]*$/u,TZ=new o([".","#"]),TQ=e=>TZ.has(e?.[0]),T0=e=>td(e)??("TemplateLiteral"===e.type&&e.quasis[0].value.cooked),T1=(e,t,r,n)=>({node:e,messageId:TG,fix:((e,t,r,n)=>{let o=((e,t)=>{let[r]=t.getRange(e);return[r+1,r+2]})(e,n);if(t.startsWith(r)&&n.text[o[0]]===r){if("TemplateLiteral"===e.type&&e.expressions.length>0){if(1!==e.expressions.length||e.quasis[0].value.cooked!==r||""!==e.quasis[1].value.cooked)return;return e=>e.removeRange(o)}if(TY.test(t))return e=>e.removeRange(o)}})(e,t,r,n)}),T2=(e,t)=>e.map(e=>({node:e,expectedPrefix:t})),T3="no-useless-compound-assignment/error",T5="no-useless-compound-assignment/remove",T8="no-useless-compound-assignment/replace",T9=new r([["+=",0],["-=",0],["*=",1],["/=",1],["**=",1]]),T6="no-useless-delete-check",T4="removeCheck",T7={considerGetters:!0},Ce=new o(["Map","Set","WeakMap","WeakSet"]),Ct=new o(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),Cr=new o(["ClassName","FunctionName"]),Cn=new o(["TSConstructorType","TSFunctionType","TSObjectKeyword"]),Co=e=>null!==e&&("object"==typeof e||"function"==typeof e),Ca=e=>Cn.has(e?.type)||e?.type==="TSUnionType"&&e.types.every(e=>Ca(e)),Ci=(e,t)=>{if("Identifier"!==e.type)return!1;let r=eD(t.sourceCode.getScope(e),e);return r?.defs.some(e=>Cr.has(e.type))??!1},Cs=(e,t)=>{let r=rN(e,t);if(!r&&rB(e,t))return;let n=r??eJ(e,t.sourceCode.getScope(e));return n&&"symbol"!=typeof n.value&&!Co(n.value)?String(n.value):void 0},Cl=(e,t)=>{let r=eJ(e,t.sourceCode.getScope(e));if(r)return Co(r.value);let n=na(rx(e),t);if(n){let e=rx(n),r=eJ(e,t.sourceCode.getScope(e));if(r)return Co(r.value);if(Ct.has(e.type))return!0}return!Ci(rx(e),t)&&Ca(((e,t)=>{if("Identifier"!==(e=rx(e)).type)return;let r=eD(t.sourceCode.getScope(e),e);return r?.defs[0]?.name?.typeAnnotation?.typeAnnotation})(e,t))},Cu=(e,t)=>!e0(e,t.sourceCode,T7),Cp=(e,t)=>tP(e,{method:t,argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}),Cc=(e,t,r)=>n=>{if(ne(r,r.sourceCode.getRange(e)))return;let o=r.sourceCode.getText(t.parent);return o.trimEnd().endsWith(";")||(o+=";"),iB(r.sourceCode.getTokenBefore(e),r,o)&&(o=`;${o}`),n.replaceText(e,o)},Cd="no-useless-logical-operand",Cm=new r([["&&",!0],["||",!1]]),Cf=new r([["&&",!1],["||",!0]]),Cg=new o(["FunctionExpression","ClassExpression","ObjectExpression"]),Cy="prefer-boolean-return",Ch=new o(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function Cx(e){if(e){if("BlockStatement"===e.type){let t=e.body.filter(({type:e})=>"EmptyStatement"!==e);if(1===t.length)return Cx(t[0])}return e}}let Cb=e=>{if(e?.type!=="ReturnStatement")return;let t=rx(e.argument);if(t?.type==="Literal"&&"boolean"==typeof t.value)return t.value};function Cv(e,t){switch(e.type){case"Literal":return"boolean"==typeof e.value;case"UnaryExpression":return["!","delete"].includes(e.operator);case"BinaryExpression":return Ch.has(e.operator);case"LogicalExpression":return Cv(e.left,t)&&Cv(e.right,t);case"CallExpression":return tX(e,t)||"CallExpression"===e.type&&!e.optional&&"MemberExpression"===e.callee.type&&!e.callee.optional&&!e.callee.computed&&"Identifier"===e.callee.object.type&&"Array"===e.callee.object.name&&t.sourceCode.isGlobalReference(e.callee.object)&&"Identifier"===e.callee.property.type&&"isArray"===e.callee.property.name;default:return!1}}let CE="prefer-flat-math-min-max",CS=["min","max"],CT=(e,t)=>tP(e,{object:"Math",method:t,optionalCall:!1,optionalMember:!1}),CC=(e,t)=>{let r=[];for(let n of e.arguments){if(CT(n,t)){r.push(...CC(n,t));continue}r.push(n)}return r},CD="prefer-hoisting-branch-code/start",Cw="prefer-hoisting-branch-code/end",CA="prefer-hoisting-branch-code/suggestion",Ck=new o(["await using","using"]),CI=(e,t)=>e0(e,t)||function e(t,r){return"TaggedTemplateExpression"===t.type||t1(t,r.visitorKeys).some(t=>e(t,r))}(e,t),Cj=(e,t)=>{let r=t.getTokens(e),n=r.at(-1);return n?.type==="Punctuator"&&";"===n.value?r.slice(0,-1):r},CR=(e,t,r)=>{let n=Cj(e,r),o=Cj(t,r);return 0!==n.length&&n.length===o.length&&n.every((e,t)=>e.type===o[t].type&&e.value===o[t].value)};function CF(e,{leading:t,trailing:r,isStart:n},o){let{sourceCode:a}=o,{body:i}=e;if(n){let[e]=a.getRange(i[0]),[r]=a.getRange(i[t]);return[e,r]}let[,s]=a.getRange(i[i.length-r-1]),[,l]=a.getRange(i.at(-1));return[s,l]}function CB({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){var i;let{sourceCode:s}=a,l=t[0].body,u=o?l.slice(0,r):l.slice(l.length-n),p=u.every(e=>!nn(e)&&!no(e,a))&&function(e){let{parent:t}=e;return["Program","BlockStatement","StaticBlock","SwitchCase"].includes(t.type)}(e)&&!((i={leading:r,trailing:n,isStart:o}).isStart&&((e,t)=>{let{sourceCode:r}=t,[n]=r.getRange(e),o=r.getTokenBefore(e);return ne(t,[o?r.getRange(o)[1]:0,n])})(e,a)||!i.isStart&&((e,t)=>{let{sourceCode:r}=t,n=r.getCommentsAfter(e)[0];return!!(n&&r.getLoc(n).start.line===r.getLoc(e).end.line)})(e,a)||t.some(e=>{let{sourceCode:t}=a,[r]=t.getRange(e),[n]=t.getRange(e.body[0]);if(i.isStart&&ne(a,[r+1,n]))return!0;if(!i.isStart){let[,r]=t.getRange(e.body.at(-1)),[,n]=t.getRange(e);if(ne(a,[r,n-1]))return!0}return ne(a,CF(e,i,a))}))&&t.every(e=>!function(e,{leading:t,trailing:r,isStart:n},o){let{sourceCode:a}=o,{body:i}=e,[s]=a.getRange(n?i[0]:i[i.length-r]),[,l]=a.getRange(n?i[t-1]:i.at(-1)),u=e=>{let[t]=a.getRange(e);return t>=s&&t<=l},p=a.getScope(e);return p.block===e&&p.variables.some(e=>{let[t]=e.defs;return!u(t.name)&&(!n&&t.parent?.type==="VariableDeclaration"&&Ck.has(t.parent.kind)||e.references.some(e=>u(e.identifier)))})}(e,{leading:r,trailing:n,isStart:o},a)),c={loc:{start:s.getLoc(u[0]).start,end:s.getLoc(u.at(-1)).end},messageId:o?CD:Cw};if(p){let i=function({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){let{sourceCode:i}=a,s=rW(e,a),l=o?r:n,u=t[0].body,p=o?u.slice(0,l):u.slice(u.length-l),c=function(e,t,r){let{sourceCode:n}=r,[o]=n.getRange(e[0]),[,a]=n.getRange(e.at(-1));return rQ(n.text.slice(o,a),rW(e[0],r),t)}(p,s,a);return function*(l){if(o){let t=i.getTokenBefore(e),r=t&&iB(t,a,c)?";":"";yield l.insertTextBefore(e,`${r}${c}${rX(a)}${s}`)}else{let t=i.getLastToken(p.at(-1)),r=i.getTokenAfter(e),n=r&&iB(t,a,r.value)?";":"";yield l.insertTextAfter(e,`${rX(a)}${s}${c}${n}`)}for(let e of t)yield l.removeRange(CF(e,{leading:r,trailing:n,isStart:o},a))}}({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a);!o||function(e,t){for(let r=e;r?.type==="IfStatement";r=r.alternate)if(CI(r.test,t))return!1;return!0}(e,s)&&u.every(e=>"ExpressionStatement"===e.type&&!CI(e,s))?c.fix=i:c.suggest=[{messageId:CA,fix:i}]}return c}let{parse:CL}=uO,CN="prefer-single-replace",CP=new o(["g","m","s"]),CM=new r([["\\",String.raw`\\`],["]",String.raw`\]`],["\n",String.raw`\n`],["\r",String.raw`\r`],[" ",String.raw`\t`],["\f",String.raw`\f`],["\v",String.raw`\v`],["\u2028",String.raw`\u2028`],["\u2029",String.raw`\u2029`]]);function C$(e){if(!tP(e,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1}))return;let[t]=e.arguments;if(tp(t)){if("replaceAll"!==e.callee.property.name)return;return 1===t.value.length?t.value:void 0}if(tf(t))return function({pattern:e,flags:t}){let r;if(t.includes("g")){for(let e of t)if(!CP.has(e))return;try{r=CL(e,t,{namedGroups:!0,lookbehind:!0})}catch{return}return function e(t){return"value"===t.type?String.fromCodePoint(t.codePoint):"characterClass"!==t.type||t.negative||1!==t.body.length?void 0:e(t.body[0])}(r)}}(t.regex)}let CO="consistent-tuple-labels",CU="no-invalid-well-known-symbol-methods/async-dispose",Cq="no-invalid-well-known-symbol-methods/dispose-generator",CW="no-invalid-well-known-symbol-methods/sync-iterator",CV="no-invalid-well-known-symbol-methods/async-iterator",Cz="no-invalid-well-known-symbol-methods/suggestion",C_=new o(["Promise","PromiseLike"]),CJ=new o(["dispose","iterator","asyncIterator"]);function CH(e){return"TSTypeReference"===e.type&&"Identifier"===e.typeName.type&&C_.has(e.typeName.name)}function CK(e,t){let r,n=function(e){if(e.computed&&"MemberExpression"===e.key.type&&!e.key.computed&&"Identifier"===e.key.object.type&&"Symbol"===e.key.object.name&&"Identifier"===e.key.property.type)return e.key.property.name}(e);if(!CJ.has(n))return;let o=function(e){if("get"!==e.kind&&"set"!==e.kind)return e.value}(e);if(o?.type!=="FunctionExpression"&&o?.type!=="ArrowFunctionExpression")return;if("dispose"===n&&o.generator)return{node:e.key,messageId:Cq};let a=!o.async&&(!!(r=o.returnType?.typeAnnotation)&&("TSUnionType"===r.type?r.types.some(e=>CH(e)):CH(r))||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let t=r.program.getTypeChecker(),n=r.esTreeNodeToTSNodeMap.get(e),o=t.getSignatureFromDeclaration(n);return!0===ab(t.getReturnTypeOfSignature(o),t)}catch{return!1}}(o,t));if("dispose"===n&&(o.async||a)){let t={node:e.key,messageId:CU},{parent:r}=e;return("ClassBody"===r.type?r.body:r.properties).some(t=>{let r;return t!==e&&t.computed&&"MemberExpression"===(r=t.key).type&&"Identifier"===r.object.type&&"Symbol"===r.object.name&&(!r.computed&&"Identifier"===r.property.type&&"asyncDispose"===r.property.name||r.computed&&"Literal"===r.property.type&&"asyncDispose"===r.property.value)&&t.static===e.static})||(t.fix=t=>t.replaceText(e.key.property,"asyncDispose")),t}if("iterator"===n&&(o.async||a)){let t={node:e.key,messageId:CW};return o.generator&&(t.suggest=[{messageId:Cz,data:{replacement:"asyncIterator"},fix:t=>t.replaceText(e.key.property,"asyncIterator")}]),t}if("asyncIterator"===n&&!o.generator&&(o.async||a))return{node:e.key,messageId:CV}}let CG="after-suspension",CX="in-generator",CY="in-nested-function",CZ=new o(["preventDefault","stopImmediatePropagation","stopPropagation"]),CQ="prefer-abort-signal-timeout",C0="prefer-abort-signal-timeout/suggestion",C1=new o(["reason","throwIfAborted"]),C2=(e,t)=>{let r,{parent:n}=e;if(!(!tL(n,{property:"signal",computed:!1,optional:!1})||n.object!==e||ns(n)||tL(n.parent)&&n.parent.object===n&&(r=n.parent,C1.has(eK(r,t.sourceCode.getScope(r))))||(e=>{let{expression:t,parent:r}=(e=>{let t=e,{parent:r}=e;for(;rh(r);)t=r,r=r.parent;return{expression:t,parent:r}})(e);return"VariableDeclarator"===r.type&&r.init===t||"AssignmentExpression"===r.type&&r.right===t})(n)||r6(t,n)))return n},C3=(e,t,r,n)=>{let o=eD(n.sourceCode.getScope(r),e);return o&&o!==t},C5="prefer-aggregate-error",C8=/[Ee]rrors$|[Ee]rror(?:List|Array|Collection)$/u,C9=new o(pw),C6=e=>"TSQualifiedName"===e.type?`${C6(e.left)}.${e.right.name}`:e.name;function C4(e){return(e=e?.type==="TSTypeAnnotation"?e.typeAnnotation:e,e?.type==="TSTypeOperator"&&"readonly"===e.operator)?e.typeAnnotation:e?.type==="TSNamedTupleMember"?e.elementType:e}function C7(e,t,r,n=new o){switch(e=C4(e),e?.type){case"TSTypeReference":{let o=C6(e.typeName),a=iP(o,t);if(C9.has(o)&&!((a?.defs.length??0)>0))return!0;if(n.has(o))return!1;n.add(o);let[i]=a?.defs??[],s=i?r.sourceCode.getScope(i.name):t,l=i?.type==="Type"&&"TSTypeAliasDeclaration"===i.node.type&&C7(i.node.typeAnnotation,s,r,n);return n.delete(o),l}case"TSUnionType":return e.types.every(e=>C7(e,t,r,n));case"TSIntersectionType":return e.types.some(e=>C7(e,t,r,n));default:return!1}}function De(e,t){let r;if(!tL(e=rx(e),{property:"length",optional:!1}))return;let n=rx(e.object);if("Identifier"===n.type&&(r=n.name,C8.test(r))&&os(n,t)&&function(e,t){let r=iP(e.name,t.sourceCode.getScope(e)),[n]=r?.defs??[],a=n?t.sourceCode.getScope(n.name):t.sourceCode.getScope(e);return function e(t,r,n,a=new o){switch(t=C4(t),t?.type){case"TSArrayType":return C7(t.elementType,r,n,a);case"TSTupleType":return t.elementTypes.length>0&&t.elementTypes.every(t=>"TSRestType"===t.type?e(t.typeAnnotation,r,n,a):C7(t,r,n,a));case"TSTypeReference":return function(t,r,n,o){let a=C6(t.typeName),i=t.typeArguments?.params;if(("Array"===a||"ReadonlyArray"===a)&&i?.length===1)return C7(i[0],r,n,o);if(o.has(a))return!1;o.add(a);let s=iP(a,r),[l]=s?.defs??[],u=l?n.sourceCode.getScope(l.name):r,p=l?.type==="Type"&&"TSTypeAliasDeclaration"===l.node.type&&e(l.node.typeAnnotation,u,n,o);return o.delete(a),p}(t,r,n,a);case"TSUnionType":return t.types.every(t=>e(t,r,n,a));case"TSIntersectionType":return t.types.some(t=>e(t,r,n,a));default:return!1}}(n?.name?.typeAnnotation,a,t)||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r;return function e(t,r,n,a=new o){if(a.has(t))return!1;if(a.add(t),t.isUnion())return t.types.every(t=>e(t,r,n,a));if(t.isIntersection())return t.types.some(t=>e(t,r,n,a));let i=r.getBaseConstraintOfType(t);if(i&&i!==t)return e(i,r,n,a);if(!(r.isArrayType(t)||r.isTupleType(t)))return!1;let s=r.getTypeArguments(t);return s.length>0&&s.every(e=>(function e(t,r,n,a=new o){if(a.has(t))return!1;if(a.add(t),t.isUnion())return t.types.every(t=>e(t,r,n,a));if(t.isIntersection())return t.types.some(t=>e(t,r,n,a));let i=r.getBaseConstraintOfType(t);if(i&&i!==t)return e(i,r,n,a);let s=nU(t);return!!(C9.has(s?.getName())&&nq(s,n))||nW(t,r).some(t=>e(t,r,n,a))})(e,r,n))}(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{return!1}}(e,t)}(n,t))return n}let Dt=(e,t,r)=>{var n;if(("!=="===e||"!="===e)&&tu(rx(t),0))return!0;let o="Literal"===(n=rx(n=t)).type&&"number"==typeof n.value?n.value:void 0;return void 0!==o&&(r?">"===e&&o>=0||">="===e&&o>=1:"<"===e&&o>=0||"<="===e&&o>=1)},Dr=e=>"LogicalExpression"!==(e=rx(e)).type||"&&"!==e.operator?[e]:[...Dr(e.left),...Dr(e.right)],Dn={resize:"Prefer ResizeObserver over a resize listener with layout reads.",scroll:"Prefer IntersectionObserver over a scroll listener with layout reads."},Do=new o(Object.keys(Dn)),Da=new o(["globalThis","self","window"]),Di=new o(["getBoundingClientRect","getClientRects"]),Ds=new o(["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetParent","offsetTop","offsetWidth","scrollHeight","scrollWidth"]),Dl=new o(["innerHeight","innerWidth"]),Du=new o(["height","width"]),Dp=new o(["Window"]),Dc=new o(["VisualViewport"]),Dd=new o(["Document","Element","HTMLElement","Node","SVGElement","VisualViewport","Window"]),Dm=(e,t,r)=>{let n;if(n$.has(e.intrinsicName))return!1;if(nO.has(e.intrinsicName)||e.intrinsicName)return!0;if(e.isUnion()||e.isIntersection())return e.types.every(e=>Dm(e,t,r));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return Dm(o,t,r);let a=nU(e);return!!a&&nW(e,t).every(e=>Dm(e,t,r))&&(!nq(a,r)||(n=a.getName(),!(Dd.has(n)||/^HTML\w*Element$/.test(n)||/^SVG\w*Element$/.test(n))))},Df=(e,t,r,n)=>{if(n$.has(e.intrinsicName)||nO.has(e.intrinsicName))return!1;if(e.isUnion()){let o=e.types.filter(e=>!nO.has(e.intrinsicName));return o.length>0&&o.every(e=>Df(e,t,r,n))}if(e.isIntersection())return e.types.some(e=>Df(e,t,r,n));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return Df(o,t,r,n);let a=nU(e);return!!(a&&nq(a,r)&&n.has(a.getName()))||nW(e,t).some(e=>Df(e,t,r,n))},Dg=(e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return!1;try{let{program:t}=n,o=t.getTypeChecker();return Df(n.getTypeAtLocation(e),o,t,r)}catch{return!1}},Dy=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r,n=t.getTypeChecker();return Dm(r.getTypeAtLocation(e),n,t)}catch{return!1}},Dh=e=>e.computed||"Identifier"!==e.property.type?td(rx(e.property)):e.property.name,Dx=(e,t)=>e.properties.some(e=>t.has((e=>{if("Property"===e.type)return e.computed||"Identifier"!==e.key.type?td(rx(e.key)):e.key.name})(e))),Db=(e,t)=>"Identifier"===e.type&&Da.has(e.name)&&rg(e,t),Dv=e=>ns(e)&&"UpdateExpression"!==e.parent.type&&("AssignmentExpression"!==e.parent.type||e.parent.left!==e||"="===e.parent.operator),DE=(e,t)=>"Identifier"===(e=rx(e)).type?"visualViewport"===e.name&&rg(e,t):"MemberExpression"===e.type&&"visualViewport"===Dh(e)&&Db(rx(e.object),t),DS=(e,t)=>{var r;return Db(e=rx(e),t)||("Identifier"===(r=rx(r=e)).type?"document"===r.name&&rg(r,t):"MemberExpression"===r.type&&"document"===Dh(r)&&Db(rx(r.object),t))||DE(e,t)||"ObjectExpression"===e.type||"ArrayExpression"===e.type||"Literal"===e.type||DT(e,t)},DT=(e,t)=>{if("Identifier"!==e.type)return!1;let r=eD(t.sourceCode.getScope(e),e);if(!r||1!==r.defs.length)return!1;let[n]=r.defs;return"Variable"===n.type&&"const"===n.parent.kind&&n.node.init?.type==="ObjectExpression"},DC=(e,t,r)=>{let n=rx(t);return Dx(e,Dl)&&(Db(n,r)||Dg(t,r,Dp))||Dx(e,Du)&&(DE(n,r)||Dg(t,r,Dc))||Dx(e,Ds)&&!DS(n,r)&&!Dy(t,r)},DD=(e,t,r=e)=>{let n,o,a,i;if(e!==r&&tj(e))return!1;return a=e,i=t,!!(tS(a,void 0,tb)&&"MemberExpression"===a.callee.type&&Di.has(Dh(a.callee))&&!DS(a.callee.object,i)&&!Dy(a.callee.object,i)||t$(e)&&Dl.has(e.name)&&!Dv(e)&&rg(e,t)||"MemberExpression"===e.type&&!Dv(e)&&(n=Dh(e),o=rx(e.object),Dl.has(n)&&(Db(o,t)||Dg(e.object,t,Dp))||Du.has(n)&&(DE(o,t)||Dg(e.object,t,Dc))||Ds.has(Dh(e))&&!DS(e.object,t)&&!Dy(e.object,t))||("VariableDeclarator"===e.type&&"ObjectPattern"===e.id.type&&e.init?DC(e.id,e.init,t):"AssignmentExpression"===e.type&&"ObjectPattern"===e.left.type&&DC(e.left,e.right,t)))||t1(e,t.sourceCode.visitorKeys).some(e=>DD(e,t,r))},Dw="prefer-set-methods/union",DA="prefer-set-methods/intersection",Dk="prefer-set-methods/intersection-suggestion",DI="prefer-set-methods/difference",Dj="prefer-set-methods/difference-suggestion",DR="prefer-set-methods/is-subset-of",DF="prefer-set-methods/is-disjoint-from",DB={every:{intersection:"isSubsetOf",difference:"isDisjointFrom"},some:{intersection:"isDisjointFrom",difference:"isSubsetOf"}},DL=(e,t)=>tT(e,{name:"Set",argumentsLength:1})&&rg(e.callee,t),DN=(e,t,r)=>((e,t)=>{let r=e;for(;r.parent;){if("ExpressionStatement"===r.parent.type)return t.sourceCode.getRange(t.sourceCode.getFirstToken(r.parent.expression))[0]===t.sourceCode.getRange(t.sourceCode.getFirstToken(e))[0];r=r.parent}return!1})(e,r)&&iB(r.sourceCode.getTokenBefore(e),r,t)?`;${t}`:t,DP=(e,t)=>("ParenthesizedExpression"===e.type||rh(e))&&e.expression===t,DM=e=>{for(;e.parent&&DP(e.parent,e);)e=e.parent;return e},D$=(e,t)=>e?.type==="SpreadElement"&&"Set"===iK(e.argument,t),DO=(e,t)=>{if("ArrayExpression"===e.type&&1===e.elements.length&&D$(e.elements[0],t))return e.elements[0].argument},DU=(e,t)=>"ArrowFunctionExpression"===e.type&&!e.async&&1===e.params.length&&"Identifier"===e.params[0].type&&1===t.sourceCode.getDeclaredVariables(e)[0].references.length,Dq=(e,t,r)=>{if(!(!tP(e,{method:"has",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!rf(e.arguments[0],t)||rf(e.callee.object,t)||"Set"!==iK(e.callee.object,r)||e0(e.callee.object,r.sourceCode,{considerGetters:!0})))return e.callee.object},DW=(e,t,r)=>{let n=Dq(e,t,r);if(n)return{method:"intersection",messageId:DA,suggestionMessageId:Dk,otherSet:n};if("UnaryExpression"!==e.type||"!"!==e.operator||!e.prefix)return;let o=Dq(e.argument,t,r);if(o)return{method:"difference",messageId:DI,suggestionMessageId:Dj,otherSet:o}},DV=(e,t,r)=>{var n;if(r6(r,t)||(n=DM(n=e),n.parent?.type==="MemberExpression"&&n.parent.object===n)||e===t&&rh(e.parent))return;let o=((e,t)=>{if(!tP(e,{method:"filter",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=DO(e.callee.object,t);if(!r)return;let[n]=e.arguments;if(!DU(n,t))return;let o=DW(n.body,n.params[0],t);if(o)return{messageId:o.messageId,suggestionMessageId:o.suggestionMessageId,replacement:`${se(r,t)}.${o.method}(${ts(o.otherSet,t)})`}})(e,r);if(o)return r4(r,{node:t,messageId:o.messageId,suggest:[{messageId:o.suggestionMessageId,*fix(e){yield e.replaceText(t,DN(t,o.replacement,r)),yield sK(e,t,r)}}]})},Dz=(e,{set:t,otherSet:r,method:n,negated:o},a)=>{if(r6(a,e))return;let i=`${se(t,a)}.${n}(${ts(r,a)})`;if(o){i=`!${i}`;let{parent:t}=e;tl(e,a)||("MemberExpression"!==t.type||t.object!==e)&&("CallExpression"!==t.type&&"NewExpression"!==t.type||t.callee!==e)&&("TaggedTemplateExpression"!==t.type||t.tag!==e)&&("BinaryExpression"!==t.type||"**"!==t.operator||t.left!==e)&&("ClassDeclaration"!==t.type||t.superClass!==e)&&("ClassExpression"!==t.type||t.superClass!==e)&&"TSNonNullExpression"!==t.type||(i=`(${i})`)}return r4(a,{node:e,messageId:"isSubsetOf"===n?DR:DF,*fix(t){yield t.replaceText(e,DN(e,i,a)),yield sK(t,e,a)}})},D_="prefer-toggle-attribute/error",DJ="prefer-toggle-attribute/suggestion",DH=(e,t,r)=>{let n=ts(e,t);return r?"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix&&t.sourceCode.getCommentsInside(e).length===t.sourceCode.getCommentsInside(e.argument).length?DH(e.argument,t,!1):(!tl(e,t.sourceCode)&&sn(e,"!")&&(n=`(${n})`),`!${n}`):tl(e,t.sourceCode)||"SequenceExpression"!==e.type?n:`(${n})`},DK=(e,t,r)=>tP(e,{methods:t,argumentsLength:r,optionalCall:!1,computed:!1});function DG(e){if(e?.type==="ChainExpression"&&(e=e.expression),DK(e,["removeAttribute","hasAttribute"],1)||DK(e,["setAttribute"],2)){let{callee:t}=e,[r,n]=e.arguments;if(td(r)?.toLowerCase().startsWith("data-"))return;let o=t.property.name;return{node:e,method:o,receiver:t.object,attributeName:r,attributeValue:n,isOptional:!!t.optional,hasEmptyAttributeValue:"setAttribute"!==o||tu(n,"")}}}function DX(e){if(e){if("BlockStatement"===e.type){if(1!==e.body.length)return;e=e.body[0]}return"ExpressionStatement"===e.type&&(e=e.expression),DG(e)}}let DY=(e,t)=>e.isOptional===t.isOptional&&rf(e.receiver,t.receiver)&&rf(e.attributeName,t.attributeName),DZ=(e,t)=>am(e.receiver)||oS(e.receiver,t),DQ="prefer-url-search-parameters/error",D0="prefer-url-search-parameters/suggestion",D1=new o(["node:url","url"]),D2=e=>"Type"===e.type||"ImportBinding"===e.type&&iL(e.node),D3=(e,t,r)=>{let n=eD(r.sourceCode.getScope(t),e);return!n||n.defs.every(e=>D2(e))},D5=(e,t)=>td(rx(e))===t,D8=(e,t)=>{let r=t.sourceCode.getText(e);return"SequenceExpression"===e.type?`(${r})`:r},D9=(e,t)=>{var r,n;let o,a;if(!tP(e=rx(e),{method:"map",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})||e.typeArguments||e.typeParameters)return;let i=((e,t)=>{if(tP(e=rx(e),{method:"split",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})){var r;let n;if(!(!D5(e.arguments[0],"&")||oj(e.callee.object,t)||(r=e.callee.object,(n=rN(r,t))&&"string"!=typeof n.value)))return e}})(e.callee.object,t);if(!i)return;let[s]=e.arguments,l="ArrowFunctionExpression"!==s.type&&"FunctionExpression"!==s.type||s.async||s.generator||1!==s.params.length||"Identifier"!==s.params[0].type?void 0:"BlockStatement"!==s.body.type?{parameter:s.params[0],returnExpression:s.body}:1===s.body.body.length&&"ReturnStatement"===s.body.body[0].type&&s.body.body[0].argument?{parameter:s.params[0],returnExpression:s.body.body[0].argument}:void 0;if(l&&(r=l.returnExpression,n=l.parameter,tP(r=rx(r),{method:"split",minimumArguments:1,maximumArguments:2,computed:!1,optionalCall:!1,optionalMember:!1})&&aE(rx(r.callee.object),n)&&D5(r.arguments[0],"=")&&(1===r.arguments.length||2===(o=r.arguments[1],a=t,rN(o,a)?.value))))return{node:e,query:i.callee.object}},D6=(e,t)=>`new URLSearchParams(${D8(e,t)})`,D4=(e,t,r,n)=>{let{sourceCode:o}=n,[a,i]=o.getRange(e),[s,l]=ti(t,n);return o.text.slice(a,s)+r+o.text.slice(l,i)},D7=(e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=ti(t,r);return[[n,a],[i,o]]},we=({node:e,query:t,replacement:r,preservedNodes:n=[t]},o)=>{let a=(({node:e,replacement:t,preservedNodes:r},n)=>{let o;if(!(!(!(o=eD(n.sourceCode.getScope(e),"URLSearchParams"))||o.defs.every(e=>D2(e))||o.defs.some(e=>(e=>{if("ImportBinding"!==e.type)return!1;let{node:t,parent:r}=e;return D1.has(r.source.value)&&"type"!==r.importKind&&"ImportSpecifier"===t.type&&"type"!==t.importKind&&"Identifier"===t.imported.type&&"URLSearchParams"===t.imported.name})(e)))||r6(n,e,r)))return[{messageId:D0,data:{replacement:t},fix:r=>r.replaceText(e,t)}]})({node:e,replacement:r,preservedNodes:n},o);if(a)return r4(o,{node:e,messageId:DQ,suggest:a},e,n)},wt="no-unsafe-promise-all-settled-values",wr=new o(["PromiseSettledResult","PromiseRejectedResult"]),wn=new o(["PromiseFulfilledResult"]),wo=new o(["ChainExpression","ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),wa=e=>e?.type==="ArrowFunctionExpression"||e?.type==="FunctionExpression"||e?.type==="FunctionDeclaration",wi=e=>{for(;e&&wo.has(e.type);)e=e.expression;return e},ws=e=>tP(wi(e),{object:"Promise",method:"allSettled",argumentsLength:1,optionalCall:!1,optionalMember:!1}),wl=e=>e?.parent.type==="ReturnStatement"&&e.parent.argument===e,wu=e=>tP(wi(e),{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}),wp=e=>"TSQualifiedName"===e.type?e.right.name:e.name;function wc(e){for(e=e?.type==="TSTypeAnnotation"?e.typeAnnotation:e;e?.type==="TSParenthesizedType"||e?.type==="TSTypeOperator";)e=e.typeAnnotation;return e?.type==="TSArrayType"?e.elementType:e?.type==="TSTypeReference"&&"Identifier"===e.typeName.type&&("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)?e.typeArguments?.params[0]??e.typeParameters?.params[0]:void 0}function wd(e){return function e(t){if(t?.type==="TSTypeReference"){let e=wp(t.typeName);return wr.has(e)}return t?.type==="TSUnionType"&&t.types.some(t=>e(t))}(wc(e))}function wm(e){return function e(t){if(t?.type==="TSTypeReference"){let e=wp(t.typeName);return wn.has(e)}return t?.type==="TSUnionType"&&t.types.every(t=>e(t))}(wc(e))}function wf(e){if(e.isUnion())return e.types.every(e=>wf(e));let t=e.aliasSymbol??e.getSymbol();return wn.has(t?.getName())}function wg(e,t){if((e=t.getNonNullableType(e)).isUnion()){let r=e.types.map(e=>wg(e,t));return r.every(Boolean)?t.getUnionType(r):void 0}if(t.isArrayType(e)||t.isTupleType(e))return t.getTypeArguments(e)[0]}function wy(e,t){let{parserServices:r}=t.sourceCode;if(r?.program)try{return{checker:r.program.getTypeChecker(),type:r.getTypeAtLocation(e)}}catch{}}let wh=e=>e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion";function wx(e,t,r=new o){var n;let a;return!!(wh(a=e)&&wd(a.typeAnnotation))||(e=wi(e),n=wi(n=e),!!(n?.type==="AwaitExpression"&&ws(n.argument)||wd(e.typeAnnotation)||function(e,t){let r=wy(e,t);if(!r)return!1;let{type:n,checker:o}=r,a=wg(n,o);return!!(a&&function e(t){if(t.isUnion())return t.types.some(t=>e(t));let r=t.aliasSymbol??t.getSymbol();return wr.has(r?.getName())}(a))}(e,t))||(wu(e)?wx(e.callee.object,t,r):"Identifier"===e.type&&function(e,t,r){let n=eD(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return!1;r.add(n);let[o]=n.defs,a=!!(wd(o.name?.typeAnnotation)||"Variable"===o.type&&"const"===o.parent.kind&&o.node.id===o.name&&o.node.init&&wx(o.node.init,t,r));return r.delete(n),a}(e,t,r)))}let wb=e=>(e=wi(e),e?.type==="Identifier"?e.name:void 0),wv=e=>{if(e=wi(e),e?.type==="ObjectPattern"){for(let t of e.properties)if("Property"===t.type&&!t.computed&&"status"===eK(t)&&"Identifier"===t.value.type)return t.value}},wE=e=>{if(e?.type==="Literal"&&("fulfilled"===e.value||"rejected"===e.value))return e.value};function wS(e,t){return e=wi(e),!!(t.statusVariable&&wR(e,t.statusVariable,t.context)||!t.statusVariable&&t.statusName&&e?.type==="Identifier"&&e.name===t.statusName||t.entryVariable&&e?.type==="MemberExpression"&&wR(e.object,t.entryVariable,t.context)&&"status"===eK(e))||!!(!t.entryVariable&&t.entryName&&e?.type==="MemberExpression"&&wb(e.object)===t.entryName&&"status"===eK(e))}function wT(e,t){if(e=wi(e),e?.type!=="BinaryExpression"||!["===","==","!==","!="].includes(e.operator))return;let r=wS(e.left,t)?wE(e.right):wS(e.right,t)?wE(e.left):void 0;if(!r)return;let n="==="===e.operator||"=="===e.operator;return n&&"fulfilled"===r||!n&&"rejected"===r?"fulfilled":"unfulfilled"}function wC(e,t){return"fulfilled"===wT(e=wi(e),t)||e?.type==="LogicalExpression"&&"&&"===e.operator&&(wC(e.left,t)||wC(e.right,t))}function wD(e,t){return"unfulfilled"===wT(e=wi(e),t)||e?.type==="LogicalExpression"&&"||"===e.operator&&(wD(e.left,t)||wD(e.right,t))}let ww=(e,t,r)=>"ConditionalExpression"===e.type&&(e.consequent===t&&wC(e.test,r)||e.alternate===t&&wD(e.test,r)),wA=(e,t,r)=>"LogicalExpression"===e.type&&("&&"===e.operator&&e.right===t&&wC(e.left,r)||"||"===e.operator&&e.right===t&&wD(e.left,r)),wk=(e,t,r)=>"IfStatement"===e.type&&(e.consequent===t&&wC(e.test,r)||e.alternate===t&&wD(e.test,r)),wI=e=>{let t;if(!wa(e)||0===e.params.length)return!1;let r={entryName:wb(e.params[0]),statusName:(t=e.params[0],wv(t)?.name)},n=wi(e.body);if(n?.type==="BlockStatement"){let[e]=n.body;return 1===n.body.length&&"ReturnStatement"===e.type&&e.argument&&wC(e.argument,r)}return wC(n,r)},wj=(e,t)=>"MemberExpression"===e.type&&"property"===t&&!e.computed||["Property","PropertyDefinition","MethodDefinition"].includes(e.type)&&"key"===t&&!e.computed;function wR(e,t,r){return e=wi(e),e?.type==="Identifier"&&t&&eD(r.sourceCode.getScope(e),e)===t}function wF(e){for(e=wi(e);wu(e);){if(wI(e.arguments[0]))return!0;e=wi(e.callee.object)}return!1}function wB(e,t,{knownPromiseSettledResultArray:r=!1,branchAlwaysExits:n}={}){if(!tP(e,{method:"map",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||!r&&!wx(e.callee.object,t)||function e(t,r,n=new o){return!!(wh(t)&&wm(t.typeAnnotation)||function(e,t){let r=wy(e,t);if(!r)return!1;let{type:n,checker:o}=r,a=wg(n,o);return!!(a&&wf(a))}(t=wi(t),r))||("Identifier"===t.type?function(t,r,n){let o=eD(r.sourceCode.getScope(t),t);if(!o||n.has(o)||1!==o.defs.length)return!1;n.add(o);let[a]=o.defs,i=!!(wm(a.name?.typeAnnotation)||"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&e(a.node.init,r,n));return n.delete(o),i}(t,r,n):wu(t)&&wF(t)&&wx(t,r))}(e.callee.object,t))return;let[a]=e.arguments;if(!wa(a)||0===a.params.length)return;let[i]=a.params;if(function(e,t){let r=wy(e,t);if(!r)return!1;let{type:n}=r;return wf(n)}(i,t))return;let s=function(e){if(e=wi(e),e?.type==="ObjectPattern"){for(let t of e.properties)if("Property"===t.type&&!t.computed&&"value"===eK(t))return t}}(i);if(s&&"Identifier"!==s.value.type)return{node:s.key,messageId:wt};let l=wb(i),u=l&&eD(t.sourceCode.getScope(i),i),p=s?.value,c=p&&eD(t.sourceCode.getScope(p),p),d=wv(i),m=d?.name,f=d&&eD(t.sourceCode.getScope(d),d),g=function e(t,r){var n;if(n=t=wi(t),n=wi(n),(n?.type==="MemberExpression"&&wR(n.object,r.entryVariable,r.context)&&"value"===eK(n)||n?.type==="Identifier"&&wR(n,r.valueVariable,r.context))&&!function(e,t){for(let r=e,n=e.parent;"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type;r=n,n=n.parent){if(ww(n,r,t)||wA(n,r,t)||wk(n,r,t)||function(e,t,r,n){let o,a=e.parent?.body;if(!Array.isArray(a))return!1;let i=a.indexOf(e),s=a[i-1];return s?.type==="IfStatement"&&!s.alternate&&wD(s.test,t)&&(o=s.consequent,iT(o,r,e=>{var t;return t=wi(t=e),t?.type==="ReturnStatement"||t?.type==="ThrowStatement"||n(e)})||ip(o,r))}(n,t,t.context,t.branchAlwaysExits))return!0;if(wl(n))break}return!1}(t,r))return t;for(let[n,o]of Object.entries(t)){if("parent"===n||wj(t,n)||!o||"object"!=typeof o)continue;let a=function(t,r){for(let n of t){if(!n?.type||wa(n)||"ClassExpression"===n.type||"ClassDeclaration"===n.type)continue;let t=e(n,r);if(t)return t}}(Array.isArray(o)?o:[o],r);if(a)return a}}(a.body,{entryName:l,entryVariable:u,statusName:m,statusVariable:f,valueVariable:c,context:t,branchAlwaysExits:n});if(g)return{node:g,messageId:wt}}let wL="prefer-abort-signal-any",wN="prefer-abort-signal-any/suggestion",wP=new o(["reason","throwIfAborted"]),wM=new o(["capture","once","passive"]),w$=new o(["TSAsExpression","TSTypeAssertion","TSSatisfiesExpression"]),wO=e=>{let t=Array.isArray(e.parent.body)?e.parent.body:Array.isArray(e.parent.consequent)?e.parent.consequent:void 0;if(t)return t[t.indexOf(e)+1]},wU=(e,t,r)=>{let{sourceCode:n}=e,[,o]=n.getRange(t),[a]=n.getRange(r);return r6(e,[o,a])},wq=e=>{let t=e,{parent:r}=e;for(;rh(r);)t=r,r=r.parent;return{expression:t,parent:r}},wW=(e,t)=>{let{parent:r}=e;if(!(!tL(r,{property:"signal",computed:!1,optional:!1})||r.object!==e||ns(r)||((e,t)=>{let{expression:r,parent:n}=wq(e);return tL(n)&&n.object===r&&wP.has(eK(n,t.sourceCode.getScope(n)))})(r,t)||(e=>{let{parent:t}=wq(e);return"VariableDeclarator"===t.type||"AssignmentExpression"===t.type})(r)||r6(t,r)))return r},wV=(e,t,r)=>{if(n$.has(e.intrinsicName))return;if(nO.has(e.intrinsicName))return!1;if(e.isUnion()){let n=e.types.filter(e=>!nO.has(e.intrinsicName));if(0===n.length)return!1;let o=n.map(e=>wV(e,t,r));return!!o.every(Boolean)||!o.every(e=>!1===e)&&void 0}if(e.isIntersection()){let n=e.types.map(e=>wV(e,t,r));return!!n.some(Boolean)||!n.every(e=>!1===e)&&void 0}let n=t.getBaseConstraintOfType(e);if(n&&n!==e)return wV(n,t,r);let o=nU(e);if(o&&nq(o,r))return"AbortSignal"===o.getName();let a=nW(e,t).map(e=>wV(e,t,r));return!!a.some(Boolean)||!(a.length>0&&a.every(e=>!1===e))&&void 0},wz=(e,t)=>tS(e,{optional:!1},tb)&&tL(e.callee,{object:"AbortSignal",properties:t,computed:!1,optional:!1}),w_=(e,t)=>{if("Identifier"!==(e=rx(e)).type)return;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs[0];if(r&&1===r.defs.length&&"Variable"===n.type&&"const"===n.parent.kind)return n.node.init},wJ=(e,t)=>{if("Identifier"!==(e=rx(e)).type)return!1;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs[0];if(!r||1!==r.defs.length||"Variable"!==n.type||"const"!==n.parent.kind||!n.node.init)return!1;let[,o]=t.sourceCode.getRange(n.node.init),[a]=t.sourceCode.getRange(e);return r.references.some(r=>{if(r.init||r.identifier===e)return!1;let[n]=t.sourceCode.getRange(r.identifier);return n>o&&n<a})},wH=(e,t,r)=>tS(e,{optional:!1},tb)&&tL(e.callee,{object:"Array",property:t,computed:!1,optional:!1})&&rg(e.callee.object,r),wK=(e,t)=>(tS(e,{name:"Array",optional:!1},tb)||tT(e,{name:"Array"}))&&rg(e.callee,t),wG=(e,t,r,n=new o)=>{var a;if(e=rx(e),n.has(e))return!1;if(n.add(e),"SpreadElement"===e.type)return!0;if("ArrayExpression"===e.type)return e.elements.some(e=>e&&wG(e,t,r,n));if(wH(e,"of",r)||wK(e,r))return e.arguments.some(e=>wG(e,t,r,n));if(wH(e,"from",r)){if(1!==e.arguments.length)return!0;let[o]=e.arguments;if("SpreadElement"===o.type)return!0;let a=w_(o,r);if(a)return!!(!os(a,r)||wJ(o,r))||wG(a,t,r,n);let i=rx(o);return"ArrayExpression"!==i.type||wG(i,t,r,n)}if(wz(e,["any"]))return e.arguments[0]&&wG(e.arguments[0],t,r,n);let i=w_(e,r);return i?!!(os(i,r)&&wJ(e,r))||wG(i,t,r,n):tL(a=rx(a=e),{property:"signal",computed:!1,optional:!1})&&"Identifier"===a.object.type&&a.object.name===t||wz(rx(e),["abort"])},wX=(e,t)=>{let r,n=((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return wV(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e,t);return!0===n||!1!==n&&!t.sourceCode.parserServices?.program&&("signal"===(r=e.name)||r.endsWith("Signal"))},wY=(e,t)=>"Identifier"===(e=rx(e)).type?wX(e,t):wz(e,["any","timeout"])&&e.arguments.every(e=>"SpreadElement"!==e.type&&!e0(e,t.sourceCode)),wZ=(e,t)=>{if(!wH(e,"from",t)||1!==e.arguments.length)return;let[r]=e.arguments;if("SpreadElement"===r.type)return;let n=rx(r);if("ArrayExpression"===n.type)return n;let o=w_(r,t);if(o&&os(o,t)&&!wJ(r,t))return o},wQ=(e,t,r=new o)=>{if(e=rx(e),r.has(e))return;if(r.add(e),"ArrayExpression"===e.type)return e.elements.every(Boolean)?e.elements:void 0;if(wH(e,"of",t)||wK(e,t))return e.arguments;let n=wZ(e,t);if(n)return wQ(n,t,r);let a=w_(e,t);if(a&&os(a,t)&&!wJ(e,t))return wQ(a,t,r)},w0=(e,t,r=new o)=>{if(e=rx(e),r.has(e))return!1;if(r.add(e),"Identifier"===e.type||"ArrayExpression"===e.type||wH(e,"of",t)||wK(e,t))return!0;let n=wZ(e,t);return!!n&&w0(n,t,r)},w1=e=>"TSQualifiedName"===e.type?e.right.name:e.name,w2=(e,t,r=new o)=>"TSTypeReference"===e.type&&((e,t,r)=>{let n=w1(e.typeName);if("AbortSignal"===n)return!0;if(!n||"Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let o=eD(t.sourceCode.getScope(e),e.typeName),a=o?.defs[0],i=a?.type==="Type"&&"TSTypeAliasDeclaration"===a.node.type&&w2(a.node.typeAnnotation,t,r);return r.delete(e.typeName.name),i})(e,t,r),w3=(e,t,r=new o)=>(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSTypeOperator")?"readonly"===e.operator?w3(e.typeAnnotation,t,r):void 0:e?.type==="TSArrayType"?w2(e.elementType,t,r):e?.type==="TSTupleType"?e.elementTypes.length>0&&e.elementTypes.every(e=>w2("TSNamedTupleMember"===e.type?e.elementType:e,t,r)):e?.type==="TSTypeReference"?((e,t,r)=>{let n,o=w1(e.typeName),a=(e.typeArguments??e.typeParameters)?.params;if(("Array"===o||"ReadonlyArray"===o)&&a?.length===1)return w2(a[0],t,r);if(!o||"Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let i=eD(t.sourceCode.getScope(e),e.typeName),s=i?.defs[0];return s?.type==="Type"&&"TSTypeAliasDeclaration"===s.node.type&&(n=w3(s.node.typeAnnotation,t,r)),r.delete(e.typeName.name),n})(e,t,r):void 0,w5=(e,t,r=new o)=>{if(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSTypeOperator")return"readonly"===e.operator&&("TSArrayType"===e.typeAnnotation.type||"TSTupleType"===e.typeAnnotation.type);if(e?.type!=="TSTypeReference")return!1;if("ReadonlyArray"===w1(e.typeName))return!0;if("Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let n=eD(t.sourceCode.getScope(e),e.typeName),a=n?.defs[0];return a?.type==="Type"&&"TSTypeAliasDeclaration"===a.node.type&&w5(a.node.typeAnnotation,t,r)},w8=(e,t,r,n=new o)=>{if(!e||n$.has(e.intrinsicName)||nO.has(e.intrinsicName)||n.has(e))return!1;if(n.add(e),e.isUnion()||e.isIntersection())return e.types.some(e=>w8(e,t,r,n));let a=t.getBaseConstraintOfType(e);if(a&&a!==e)return w8(a,t,r,n);let i=nU(e);if(i&&nq(i,r)&&"ReadonlyArray"===i.getName())return!0;let s=t.typeToString(e);return!!(s.startsWith("readonly ")||s.startsWith("ReadonlyArray<"))||nW(e,t).some(e=>w8(e,t,r,n))},w9=(e,t)=>{if(w$.has(e.type)){let r;return r=e.typeAnnotation,r?.type==="TSTypeReference"&&"const"===w1(r.typeName)||w5(e.typeAnnotation,t)||w9(e.expression,t)}if("Identifier"!==(e=rx(e)).type)return!1;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs[0];return!!(n?.name?.typeAnnotation&&w5(n.name.typeAnnotation,t)||n?.type==="Variable"&&n.node.init&&w9(n.node.init,t)||((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r;return w8(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{return!1}})(e,t))},w6=(e,t,r=new o)=>{if(r.has(e))return!1;if(r.add(e),w$.has(e.type))return w3(e.typeAnnotation,t)??w6(e.expression,t,r);if("Identifier"===(e=rx(e)).type){let n=eD(t.sourceCode.getScope(e),e),o=n?.defs[0];if(o?.name?.typeAnnotation){let e=w3(o.name.typeAnnotation,t);if(void 0!==e)return e}if(o?.type==="Variable"&&o.node.init&&w6(o.node.init,t,r))return!0}return os(e,t)},w4=(e,t,r,n)=>{var o,a;let i,s=!e||"ArrowFunctionExpression"!==e.type&&"FunctionExpression"!==e.type||e.async||e.generator||e.params.length>0?void 0:"BlockStatement"!==e.body.type?e.body:1===e.body.body.length&&"ExpressionStatement"===e.body.body[0].type?e.body.body[0].expression:void 0;if(tS(s,{optional:!1},tb)&&tL(s.callee,{property:"abort",computed:!1,optional:!1})&&"Identifier"===s.callee.object.type&&s.callee.object.name===t&&(0===s.arguments.length||1===s.arguments.length&&(i=s.arguments[0],tL(i,{property:"reason",computed:!1,optional:!1})&&(o=i.object,a=r,o=rx(o),a=rx(a),"Identifier"===o.type&&"Identifier"===a.type&&o.name===a.name&&eD(n.sourceCode.getScope(o),o)===eD(n.sourceCode.getScope(a),a)))))return s.callee.object},w7=e=>{var t;if(e?.type!=="ExpressionStatement")return;let{expression:r}=e;if(tS(r,{minimumArguments:2,maximumArguments:3,optional:!1},tb)&&tL(r.callee,{property:"addEventListener",computed:!1,optional:!1})&&"abort"===td(rx(r.arguments[0]))&&(!(t=r.arguments[2])||"Literal"===(t=rx(t)).type&&"boolean"==typeof t.value||"ObjectExpression"===t.type&&t.properties.every(e=>{if("Property"!==e.type||e.computed||"init"!==e.kind||e.method||e.shorthand||"Literal"!==e.value.type||"boolean"!=typeof e.value.value)return!1;let t="Identifier"===e.key.type?e.key.name:e.key.value;return wM.has(t)})))return{call:r,sourceSignal:r.callee.object}},Ae=(e,t)=>!r6(t,e)&&!r7(t,e,{ignoreDirectives:!0}),At=(e,t,r,n)=>{let o=eD(n.sourceCode.getScope(r),e);return o&&o!==t},Ar="prefer-block-statement-over-iife",An=e=>"ThisExpression"===e.type||"MetaProperty"===e.type&&"new"===e.meta.name&&"target"===e.property.name||"Identifier"===e.type&&"arguments"===e.name,Ao=(e,t)=>e!==t&&tj(e),Aa=(e,t)=>Ao(e,t)&&"ArrowFunctionExpression"!==e.type;function Ai(e,t,r,n=Ao){return function o(a){return!!r(a)||!n(a,e)&&t1(a,t).some(e=>o(e))}(e)}let As="no-multiple-promise-resolver-calls",Al=e=>rh(e)||e?.type==="TSInstantiationExpression",Au=e=>"ReturnStatement"===e.type||"ThrowStatement"===e.type;function Ap(e){for(;Al(e.parent)&&e.parent.expression===e;)e=e.parent;return e}function Ac(e){for(;Al(e);)e=e.expression;return e}let Ad=(e,t)=>{if(!(("FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type)&&!e.generator))return!1;let r=Ap(e);return tT(r.parent,{name:"Promise",argumentsLength:1})&&r.parent.arguments[0]===r&&rg(r.parent.callee,t)},Am=(e,t)=>e.references.some(e=>e.isWrite()&&e.identifier!==t),Af=(e,t)=>{if("CallExpression"!==e.type)return;let r=Ac(e.callee);return"Identifier"===r.type?t.get(r):void 0},Ag=(e,t)=>"ExpressionStatement"===e.type&&"CallExpression"===e.expression.type&&0===e.expression.arguments.length&&!!Af(e.expression,t);function Ay(e){let t=[];return e.traverseSegments(e=>{e.reachable&&t.push(e)}),t}let Ah=({isTerminated:e=!1,resolverUncalled:t=!1,resolverCalled:n=!1,catchClausesAfterResolverCall:a=new o,pendingFinallyBlocksByCatchClause:i=new r}={})=>({isTerminated:e,resolverUncalled:t,resolverCalled:n,catchClausesAfterResolverCall:a,pendingFinallyBlocksByCatchClause:i}),Ax=e=>Ah({isTerminated:e.isTerminated,resolverUncalled:e.resolverUncalled,resolverCalled:e.resolverCalled,catchClausesAfterResolverCall:new o(e.catchClausesAfterResolverCall),pendingFinallyBlocksByCatchClause:function(e){let t=new r;for(let[r,n]of e)t.set(r,new o(n));return t}(e.pendingFinallyBlocksByCatchClause)}),Ab=(e,t,r)=>{if(e.isTerminated)return e;if(t.executor===r){let r=Ax(e);for(let[e,n]of r.pendingFinallyBlocksByCatchClause)t.finallyBlocks.some(e=>n.has(e))&&r.catchClausesAfterResolverCall.add(e);return r.resolverCalled=e.resolverUncalled||e.resolverCalled,r.resolverUncalled=!1,r}if(t.executor)return e;let n=Ax(e);if(t.catchClause){if(e.resolverUncalled){let e=n.pendingFinallyBlocksByCatchClause.get(t.catchClause);for(let r of(e||(e=new o,n.pendingFinallyBlocksByCatchClause.set(t.catchClause,e)),t.finallyBlocks))e.add(r)}e.resolverCalled&&n.catchClausesAfterResolverCall.add(t.catchClause)}return n};function Av(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let AE=(e,t)=>void 0!==t&&e.isTerminated===t.isTerminated&&e.resolverUncalled===t.resolverUncalled&&e.resolverCalled===t.resolverCalled&&Av(e.catchClausesAfterResolverCall,t.catchClausesAfterResolverCall)&&function(e,t){if(e.size!==t.size)return!1;for(let[r,n]of e){let e=t.get(r);if(!e||!Av(n,e))return!1}return!0}(e.pendingFinallyBlocksByCatchClause,t.pendingFinallyBlocksByCatchClause);function AS(e){let t=[],r=e,{parent:n}=e;for(;n&&!tj(n);){if("TryStatement"===n.type){if(n.block===r&&n.handler)return{catchClause:n.handler,finallyBlocks:t};n.finalizer&&(n.block===r||n.handler===r)&&t.push(n.finalizer)}r=n,{parent:n}=n}return{catchClause:void 0,finallyBlocks:t}}function AT(e,t,r){let n=Ah({isTerminated:e!==r.codePath.initialSegment,resolverUncalled:e===r.codePath.initialSegment});for(let a of e.prevSegments){let i=function(e,t,r,n){if(!t.reachable||n.terminatedSegments.has(t)||e.isTerminated||n.ignoredLoopEdges.some(e=>e.previousSegment===t&&e.segment===r))return Ah({isTerminated:!0});let o=n.catchClausesBySegment.get(r);return o?Ah({resolverUncalled:e.pendingFinallyBlocksByCatchClause.has(o),resolverCalled:e.catchClausesAfterResolverCall.has(o)}):e}(t.get(a)??Ah(),a,e,r);if(!i.isTerminated){for(let e of(n.isTerminated=!1,n.resolverUncalled||=i.resolverUncalled,n.resolverCalled||=i.resolverCalled,i.catchClausesAfterResolverCall))n.catchClausesAfterResolverCall.add(e);for(let[e,t]of i.pendingFinallyBlocksByCatchClause){let r=n.pendingFinallyBlocksByCatchClause.get(e);for(let a of(r||(r=new o,n.pendingFinallyBlocksByCatchClause.set(e,r)),t))r.add(a)}}}return n}let AC=e=>{let t=Ac(e.test);return t?.type==="Literal"&&!t.value},AD=e=>{let t=Ap(e);return t.parent?.type==="AwaitExpression"&&t.parent.argument===t},Aw=(e,t)=>{let r=rP(e,t);if(!r)return!1;let{value:n}=r;return!n||"object"==typeof n&&0===Object.keys(n).length};function AA(e,t){let r=e,{parent:n}=e;for(;n;){if("AssignmentPattern"===n.type&&n.right===r&&Ad(n.parent,t)&&n.parent.params.slice(0,2).includes(n))return!0;r=n,{parent:n}=n}return!1}let Ak=(e,t,r)=>"SequenceExpression"===e.type&&e.expressions.includes(t)||"LogicalExpression"===e.type&&e.left===t||"BinaryExpression"===e.type&&(e.left===t||e.right===t)||"UnaryExpression"===e.type&&e.argument===t||"ConditionalExpression"===e.type&&iT(e,r,Au)||Al(e)&&e.expression===t||"CallExpression"===e.type&&(e.callee===t||e.arguments.includes(t)&&!e.optional&&!aK(e.callee))||"NewExpression"===e.type&&(e.callee===t||e.arguments.includes(t))||"MemberExpression"===e.type&&(e.object===t||e.computed&&e.property===t&&!e.optional&&!aK(e.object)),AI=(e,t)=>ip(e,t),Aj=(e,t)=>"class-static-block"===e.origin||"class-field-initializer"===e.origin&&t.parent?.type==="PropertyDefinition"&&t.parent.value===t&&t.parent.static,AR="no-unnecessary-string-trim",AF=["startsWith","endsWith"],AB=new o(["bigint","boolean","number","string","undefined"]),AL=new o(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),AN=(e,t)=>rN(e=rx(e),t),AP="no-useless-re-export",AM=e=>"Identifier"===e.type?e.name:e.value;function A$(e,t){let r=e.attributes??[];return`${e.source.value}\0${r.map(e=>t.getText(e)).join("\0")}`}let AO="preferGuard",AU="preferFallback",Aq="guard",AW="fallback",AV=["keys","values","entries"],Az=e=>{if("ForInStatement"===e.type)return;let t=rx(e.right);if(tP(t,{object:"Object",methods:AV,argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1}))return t},A_=e=>Az(e)?.arguments[0]??e.right,AJ=e=>"ForInStatement"===e.type||!!Az(e),AH="no-async-iterator-callback",AK=new o(["filter","forEach","some","every","find","flatMap"]),AG=e=>tj(e)&&e.async&&!e.generator,AX="no-unused-iterator-helper",AY="no-unused-iterator-helper/suggestion",AZ="no-useless-set-construction",AQ=["union","intersection","difference","symmetricDifference"],A0=[...AQ,"isSubsetOf","isSupersetOf","isDisjointFrom"],A1=(e,t=A0)=>tP(e,{methods:t,argumentsLength:1,optionalCall:!1,optionalMember:!1});function A2(e,t){if("Set"===iK(e,t))return e;if(!tP(e,{methods:["keys","values"],argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let{object:r,property:n}=e.callee,o=iK(r,t);if("Set"===o||"Map"===o&&"keys"===n.name)return r}let A3="no-using-resource-escape",A5=new o(["TSAbstractMethodDefinition","TSMethodSignature","TSPropertySignature"]);function A8(e){let{parent:t}=e;for(;!tj(t)&&"Program"!==t.type;)t=t.parent;return t}function A9(e,t){let r=e?.defs.filter(e=>t.includes(e.type));if(r?.length===1)return r[0]}function A6(e,t){let r=t.getScope(e);for(;r;){let t=r.set.get(e.name);if(t?.defs.some(e=>"Type"!==e.type))return t;r=r.upper}}function A4(e,t){let r=A9(e,["Variable"]);return r?.type==="Variable"&&("using"===r.parent.kind||"await using"===r.parent.kind)&&A8(r.node)===t}let A7="prefer-combined-guards",ke=new o(["ReturnStatement","ThrowStatement","BreakStatement","ContinueStatement"]);function kt(e,t=!0){switch((e=rx(e)).type){case"LogicalExpression":return t&&"||"===e.operator&&kt(e.left)&&kt(e.right);case"UnaryExpression":case"AwaitExpression":return kt(e.argument,!1);case"ConditionalExpression":case"AssignmentExpression":case"SequenceExpression":case"ArrowFunctionExpression":case"YieldExpression":return!1;default:return!0}}function kr(e,t,r){if(e?.type!=="IfStatement"||e.alternate)return;let{consequent:n}=e,o="BlockStatement"===n.type?n.body:[n];if(0===o.length||o.length>1&&!r)return;let a=o.at(-1);if(ke.has(a.type)||"ExpressionStatement"===a.type&&aC(a.expression,t))return o}let kn=(e,t)=>{let r=e.expression??e.argument??e.label;return r?t.getText(r):""};function ko(e,t){return"TaggedTemplateExpression"===e.type||t1(e,t).some(e=>ko(e,t))}let ka=new o(["Identifier","MemberExpression","ThisExpression","JSXIdentifier","JSXMemberExpression"]);function ki(e,t,r){if(tl(e,r))return ts(e,r);let n=r.sourceCode.getText(e);return rh(e)||so(e,{operator:"||",property:t})?`(${n})`:n}let ks={create:e=>{let{sourceCode:t}=e,{checkCompoundConditions:r,checkMultiStatementBodies:n}=e.options[0];e.on("IfStatement",o=>{let a,i=kr(o,e,n);if(!i)return;let s=sd(o,e,-1),l=kr(s,e,n);if(!l)return;let u=i.at(-1),p=l.at(-1);if(p.type!==u.type||kn(p,t)!==kn(u,t)||(a="ExpressionStatement"===u.type?u.expression.arguments[0]:u.argument)&&(t.parserServices?.esTreeNodeToTSNodeMap&&"Literal"!==a.type||ko(a,t.visitorKeys))||!(l.length===i.length&&i.slice(0,-1).every((e,r)=>t.getText(e)===t.getText(l[r])&&!ko(e,t.visitorKeys)))||!r&&(!kt(s.test)||!kt(o.test)))return;let c=[t.getRange(s)[0],t.getRange(o)[1]],d=t.getCommentsBefore(s)[0],m=[d?t.getRange(d)[0]:c[0],c[1]];if(!r6(e,m)&&function(e,t,r){let{parserServices:n,visitorKeys:o}=r;return!(1!==t.length&&n?.esTreeNodeToTSNodeMap)||!!n.program&&t.slice(0,-1).every((t,r)=>(function e(t,r,n,o){if(ka.has(r.type)&&n.getTypeAtLocation(t)!==n.getTypeAtLocation(r))return!1;for(let a of o[r.type]??[]){let i=[r[a]].flat(),s=[t[a]].flat();for(let[t,r]of i.entries())if(r?.type&&!e(s[t],r,n,o))return!1}return!0})(e[r],t,n,o))}(l,i,t))return r4(e,{node:o,messageId:A7,*fix(r){let n=ki(s.test,"left",e),a=ki(o.test,"right",e),i=t.getTokenBefore(o.consequent),l=t.text.slice(t.getRange(i)[1],c[1]);yield r.replaceTextRange(c,`if (${n} || ${a})${l}`)}},m)})},meta:{type:"suggestion",docs:{description:"Prefer combining consecutive guards with identical exit statements.",recommended:!0},fixable:"code",schema:[{type:"object",properties:{checkCompoundConditions:{type:"boolean",description:"Check guards with compound conditions."},checkMultiStatementBodies:{type:"boolean",description:"Check guards whose bodies run the same statements before the exit."}},additionalProperties:!1}],defaultOptions:[{checkCompoundConditions:!1,checkMultiStatementBodies:!1}],messages:{[A7]:"Combine this guard with the previous one using `||`."},languages:["js/js"]}},kl="prefer-temporal-conversion",ku="prefer-temporal-conversion/suggestion",kp=["year","month","day"],kc=["hour","minute","second","millisecond","microsecond","nanosecond"],kd=(e,t)=>tL(rx(e),{property:t,computed:!1,optional:!1}),km=(e,t)=>tL(e,{object:"Temporal",property:t,optional:!1}),kf=new r([["Instant",{sources:["ZonedDateTime"],fields:[]}],["PlainDateTime",{sources:["ZonedDateTime"],fields:[...kp,...kc]}],["PlainDate",{sources:["ZonedDateTime","PlainDateTime"],fields:kp}],["PlainTime",{sources:["ZonedDateTime","PlainDateTime"],fields:kc}]].map(([e,{sources:t,fields:r}])=>{let{isTarget:n}=oe({targetTypeNames:new o(t.map(e=>`Temporal.${e}`)),checkClassHeritage:!1,isTargetNode:e=>t.some(t=>"NewExpression"===e.type?km(e.callee,t):tP(e,{method:"from",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})?km(e.callee.object,t):tP(e,{method:"ZonedDateTime"===t?"zonedDateTimeISO":"plainDateTimeISO",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&km(e.callee.object,"Now")),isTargetType(e,r){let n=e.getSymbol();if(!n)return!1;let o=r.getFullyQualifiedName(n);return t.some(e=>o===`Temporal.${e}`||o.endsWith(`.Temporal.${e}`))}});return[e,{fields:r,isSource:n}]})),kg="prefer-iterator-helpers",ky="prefer-iterator-helpers/suggestion",kh="prefer-iterator-helpers/slice",kx="prefer-iterator-helpers/slice-suggestion",kb=["every","find","forEach","some"],kv="reduce",kE=(e,t)=>"ArrayExpression"===e.type?((e,t)=>{let[r]=e.elements;if(1===e.elements.length&&r?.type==="SpreadElement"&&yP(r.argument,t))return r.argument})(e,t):"CallExpression"===e.type?((e,t)=>{if(e.typeArguments||e.typeParameters||!tP(e,{object:"Array",method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1}))return;let[r]=e.arguments;if(yP(r,t))return r})(e,t):void 0,kS=(e,t,{suffix:r="",messageId:n,data:o},a)=>{if(((e,t,r)=>{let[n,o]=ti(t,r);return r.sourceCode.getCommentsInside(e).some(e=>{let[t,a]=r.sourceCode.getRange(e);return t<n||a>o})})(e,t,a))return;let i=((e,t)=>{let{sourceCode:r}=t,n=ts(e,t);return!tl(e,t)&&("ChainExpression"===e.type||["{","<","function","class","async"].includes(r.getFirstToken(e).value)||i7(e,t))&&(n=`(${n})`),n})(t,a)+r,{sourceCode:s}=a,l=iB(s.getTokenBefore(e),a,i)?";":"";return{messageId:n,data:o,*fix(t){yield t.replaceText(e,l+i),yield sK(t,e,a)}}},kT="prefer-iterator-zip",kC="prefer-iterator-zip/suggestion",kD=(e,t)=>e?.type==="Identifier"&&e.name===t;function kw(e,t){if(e?.type==="BinaryExpression"){if("<"===e.operator&&kD(e.left,t))return e.right;if(">"===e.operator&&kD(e.right,t))return e.left}}function kA(e){if(tL(e,{property:"length",computed:!1,optional:!1})&&"Identifier"===e.object.type)return e.object}function kk(e){if(!e.some(e=>!e)&&new o(e.map(e=>e.name)).size===e.length)return e}function kI(e){if(tP(e,{object:"Math",method:"min",minimumArguments:2,optionalCall:!1,optionalMember:!1}))return kk(e.arguments.map(e=>kA(e)))}function kj(e,t,r,n){let{declarator:o,declarationToRemove:a}=r,i=kw(e.test,t);if(i?.type!=="Identifier"||"Identifier"!==o.id.type||o.id.name!==i.name)return;let[s]=n.getDeclaredVariables(o),l=s.references.filter(e=>!e.init);if(1!==l.length||l[0].identifier!==i)return;let u=kI(o.init);if(u)return{inputs:u,declarationToRemove:a}}let kR="prefer-uint8array-hex/error",kF="prefer-uint8array-hex/suggestion",kB=new o(["buffer","node:buffer"]),kL=new o(["globalThis","window","self","global"]),kN=new o(["..",".{2}",".{1,2}","[0-9a-f]{2}",String.raw`[\da-f]{2}`]),kP=["ArrayBuffer","SharedArrayBuffer","DataView"],kM=new o(["ArrayExpression","ArrowFunctionExpression","BinaryExpression","ClassExpression","FunctionExpression","Literal","NewExpression","ObjectExpression","TemplateLiteral","UnaryExpression","UpdateExpression"]),k$=["Array",...kP,...nM],kO=(e,t,r)=>tP(e,{method:t,argumentsLength:r,computed:!1,optionalCall:!1,optionalMember:!1}),kU=(e,t)=>e?.type==="Literal"&&e.value===t,kq=e=>tp(e)&&"hex"===e.value.toLowerCase();function kW(e,t){if(tL(e,{property:"Buffer",computed:!1,optional:!1}))return kL.has(e.object.name)&&rg(e.object,t);if("Identifier"!==e.type)return!1;if("Buffer"===e.name&&rg(e,t))return!0;let r=eD(t.sourceCode.getScope(e),e);return r?.defs.some(e=>"ImportBinding"===e.type&&kB.has(e.parent.source.value)&&"ImportSpecifier"===e.node.type&&"Buffer"===e.node.imported.name)??!1}let kV=(e,t)=>tP(e,{methods:["from","of","alloc","allocUnsafe","allocUnsafeSlow","concat","copyBytesFrom"],computed:!1,optionalCall:!1,optionalMember:!1})&&kW(e.callee.object,t)||(tT(e)||tS(e,{optional:!1},tb))&&kW(e.callee,t),kz={checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:new o(["Buffer"]),targetTypeImports:new r([...kB].map(e=>[e,new o(["Buffer"])])),nonTargetTypeNames:new o(["Array","ReadonlyArray",...kP,...nM]),isTargetNode:kV,isNonTargetNode:(e,t)=>kM.has(e.type)||kW(e,t)||"Identifier"===e.type&&k$.includes(e.name)||tL(e,{properties:k$,computed:!1,optional:!1})&&kL.has(e.object.name)&&rg(e.object,t)||tS(e,{name:"Array"},tb)||tP(e,{objects:["Array",...nM],methods:["from","of"]})||tP(e,{object:"Uint8Array",methods:["fromHex","fromBase64"]})},k_={getStaticType:()=>nz,isNonTargetNode:(e,t)=>("BinaryExpression"!==e.type||"+"!==e.operator)&&kz.isNonTargetNode(e,t)},{getType:kJ}=oe(kz),{getType:kH}=oe({...kz,targetTypeNames:new o(["Buffer","Uint8Array"]),targetConstructorNames:["Uint8Array"],isTargetNode:(e,t)=>kV(e,t)||tP(e,{object:"Uint8Array",methods:["from","of","fromHex","fromBase64"],computed:!1,optionalCall:!1,optionalMember:!1})});function kK(e){if(e=rx(e),e?.type!=="ArrowFunctionExpression"&&e?.type!=="FunctionExpression"||e.async||e.generator||1!==e.params.length||"Identifier"!==e.params[0].type)return;let t=e.body;if("BlockStatement"===t.type){if(1!==t.body.length||"ReturnStatement"!==t.body[0].type||!t.body[0].argument)return;t=t.body[0].argument}return{parameter:e.params[0],expression:rx(t)}}let kG=e=>"0"===e||"00"===e;function kX(e){let t,r=kK(e);if(!r)return!1;let{parameter:n,expression:o}=r;if(kO(o,"padStart",2)&&kU(o.arguments[0],2)&&kU(o.arguments[1],"0"))t=o.callee.object;else{var a;if(!kO(o,"slice",1))return!1;let[e]=o.arguments;if("UnaryExpression"!==e.type||"-"!==e.operator||!kU(e.argument,2))return!1;t="BinaryExpression"===(a=o.callee.object).type&&"+"===a.operator&&tp(a.left)&&kG(a.left.value)?a.right:"TemplateLiteral"===a.type&&1===a.expressions.length&&kG(a.quasis[0].value.cooked)&&""===a.quasis[1].value.cooked?a.expressions[0]:void 0}return kO(t,"toString",1)&&kU(t.arguments[0],16)&&"Identifier"===t.callee.object.type&&t.callee.object.name===n.name}function kY(e,t,r,{decoding:n=!1,autofix:o=!1,canSuggest:a=!0}={}){if("Super"===t.type)return;let i=n?"Uint8Array.fromHex()":"Uint8Array#toHex()",s={node:e,messageId:kR,data:{replacement:i,description:n?"this hex decoding":"this hex encoding"}};function*l(o,{abort:a}){let{sourceCode:i}=r;i.getCommentsInside(e).length>0&&a();let s=n?`Uint8Array.fromHex(${ts(t,r)})`:`${se(t,r)}.toHex()`;iB(i.getTokenBefore(e),r,s)&&(s=`;${s}`),yield o.replaceText(e,s),yield sK(o,e,r)}return o?s.fix=l:a&&(s.suggest=[{messageId:kF,data:{replacement:i},fix:l}]),s}let kZ="no-incomplete-accessor-override",kQ=Symbol("unknown name"),k0=e=>e?.type==="ClassDeclaration"||e?.type==="ClassExpression",k1=(e,t)=>{let r=new o,n=e;for(;;){if(k0(n))return n.declare||n.decorators?.length>0?void 0:n;if(n?.type!=="Identifier")return;let e=eD(t.getScope(n),n);if(!e||1!==e.defs.length||r.has(e))return;let[o]=e.defs;if(e.references.some(e=>e.isWrite()&&!e.init))return;if("ClassName"===o.type){n=o.node;continue}if("Variable"!==o.type||"const"!==o.parent.kind||o.node.id!==o.name)return;r.add(e),n=o.node.init}},k2=(e,t)=>{let{key:r}=e;if("PrivateIdentifier"===r.type)return;if(!e.computed)return"Identifier"===r.type?r.name:String(r.value);let n=eJ(r,t.getScope(e));if(!n)return kQ;let{value:o}=n;if("symbol"!=typeof o)return o&&["object","function"].includes(typeof o)?kQ:String(o)},k3=e=>!e.declare&&["MethodDefinition","PropertyDefinition","AccessorProperty"].includes(e.type),k5=(e,t)=>t?["name","length"].includes(e):"constructor"===e,k8=(e,t,r)=>{if("MethodDefinition"===e.type&&!e.value.body)return;let n=k2(e,r);return n===kQ?"unknown":n===t?e.decorators?.length>0?"unknown":"AccessorProperty"===e.type?"both":"MethodDefinition"===e.type&&["get","set"].includes(e.kind)?e.kind:"data":void 0},k9=(e,t,r,n)=>{let o;for(let a of e.body.body){if(!k3(a)||a.static!==r)continue;let e=k8(a,t,n);if("unknown"===e||"data"===e&&"PropertyDefinition"===a.type)return e;("get"===e||"set"===e)&&("both"===o||o===("get"===e?"set":"get"))?o="both":e&&(o=e)}return o},k6=(e,t,r,n)=>{let a=new o;for(;e.superClass;){if(!(e=k1(e.superClass,n))||a.has(e))return;a.add(e);let o=k9(e,t,r,n);if(o)return o}},k4=Symbol("unknown"),k7=["year","month","week","day","hour","minute","second","millisecond","microsecond","nanosecond"],Ie=k7.map(e=>`${e}s`),It=k7.slice(4),Ir=k7.slice(0,4),In=new o(["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"]),Io=new r([["hour",24],["minute",60],["second",60],["millisecond",1e3],["microsecond",1e3],["nanosecond",1e3]]),Ia=new r([["hour",24],["minute",1440],["second",86400],["millisecond",864e5],["microsecond",864e8],["nanosecond",864e11]]),Ii=["Instant","Duration","PlainTime","PlainDate","PlainYearMonth","PlainDateTime","ZonedDateTime"],Is=new r([["Instant","instant"],["PlainTime","plainTimeISO"],["PlainDate","plainDateISO"],["PlainDateTime","plainDateTimeISO"],["ZonedDateTime","zonedDateTimeISO"]]),Il=new r([["Instant",["second","nanosecond"]],["PlainTime",["hour","nanosecond"]],["PlainDate",["day","day"]],["PlainYearMonth",["year","month"]],["PlainDateTime",["day","nanosecond"]],["ZonedDateTime",["hour","nanosecond"]]]),Iu=new r(Ii.map(e=>{let t=["add","subtract"];return"Duration"===e?t.push("round","total"):(t.push("since","until"),"PlainDate"!==e&&"PlainYearMonth"!==e&&t.push("round")),[e,new o(t)]})),Ip=new o(Iu.values().flatMap(e=>e.values())),Ic=(e,t)=>tL(e,{object:"Temporal",property:t,optional:!1}),Id=new r(Ii.map(e=>[e,oe({targetTypeNames:new o([`Temporal.${e}`]),checkClassHeritage:!1,isTargetNode:t=>"NewExpression"===t.type?Ic(t.callee,e):tP(t,{methods:"Instant"===e?["from","fromEpochMilliseconds","fromEpochNanoseconds"]:["from"],minimumArguments:1,maximumArguments:"Duration"===e||"Instant"===e?1:2,optionalCall:!1,optionalMember:!1})?Ic(t.callee.object,e):Is.has(e)&&tP(t,{method:Is.get(e),maximumArguments:+("Instant"!==e),optionalCall:!1,optionalMember:!1})&&Ic(t.callee.object,"Now"),isTargetType(t,r){let n=t.getSymbol();if(!n)return!1;let o=r.getFullyQualifiedName(n);return o===`Temporal.${e}`||o.endsWith(`.Temporal.${e}`)}}).isTarget]));function Im(e,t){if(!e)return;let r=rP(e,t);return!r||null!==r.value&&["object","function"].includes(typeof r.value)?k4:r.value}function If(e){if(e=rx(e),e?.type!=="ObjectExpression")return;let t=new r;for(let r of e.properties){if("Property"!==r.type||r.computed||r.method||"init"!==r.kind)return;let e=eK(r);if(void 0===e||"__proto__"===e)return;t.set(e,r)}return t}function Ig(e,t,n){let o=If(e);if(o)return new r([...o].map(([e,t])=>[e,{value:Im(t.value,n),node:t.value,property:t}]));let a=Im(e,n);return void 0===a?new r:t&&"string"==typeof a?new r([[t,{value:a,node:e}]]):void 0}function Iy(e){if(e===k4||"bigint"==typeof e||"symbol"==typeof e)return k4;let t=void 0===e?0:Number(e);return Number.isSafeInteger(t)?t:k4}let Ih=/^([+\-]?)P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)(?:\.(\d{1,9}))?S)?)?$/v;function Ix(e,t,r=new o){if(!(e=rx(e))||r.has(e))return;if(r.add(e),"Identifier"===e.type){let n=na(e,t);if(!n||"Identifier"!==n.parent.id.type||"ObjectExpression"===rx(n).type)return;return Ix(n,t,r)}if("NewExpression"===e.type&&Ic(e.callee,"Duration")){if(e.arguments.some(e=>"SpreadElement"===e.type))return;return Ie.map((r,n)=>Iy(Im(e.arguments[n],t)))}if(tP(e,{method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&Ic(e.callee.object,"Duration"))return Ix(e.arguments[0],t,r);let n=If(e);if(n)return Ie.map(e=>Iy(Im(n.get(e)?.value,t)));let a=Im(e,t);return"string"==typeof a?function(e){let t=Ih.exec(e);if(!t||t.slice(2).every(e=>void 0===e)||e.includes("T")&&t.slice(6).every(e=>void 0===e))return;let r="-"===t[1]?-1:1,n=t.slice(2,9).map(e=>{let t=Iy(e);return t===k4?k4:t*r});if(n.some(e=>!Number.isSafeInteger(e)))return;let o=(t[9]??"").padEnd(9,"0");return[...n,...[0,3,6].map(e=>Number(o.slice(e,e+3))*r)]}(a):void 0}let Ib=e=>e?.slice(0,3).some(e=>e!==k4&&0!==e)??!1,Iv=(e,t)=>e.get(t)?.value,IE=e=>{if(void 0===e||e===k4)return e;let t=String(e);return Ie.includes(t)?t.slice(0,-1):t},IS=e=>k7.includes(e)&&3>k7.indexOf(e),IT=(e,t)=>e===k4||t===k4?k4:k7[Math.min(k7.indexOf(e),k7.indexOf(t))];function IC(e){let t=Iv(e,"roundingIncrement");return t===k4?k4:void 0===t?1:"bigint"==typeof t||"symbol"==typeof t?0/0:Math.trunc(Number(t))}function ID(e,{type:t,method:r,options:n,fields:o}){let a=(o,a,i={})=>({node:n.get(a)?.node??e.callee.property,messageId:o,data:{type:t,method:r,option:a,...i}}),i=function(e,t,r){let n=["smallestUnit"];"total"===t?n=["unit"]:("Duration"===e||"round"!==t)&&(n=["largestUnit","smallestUnit"]);let o="Duration"===e?k7:"Instant"===e||"PlainTime"===e?It:"round"===t?k7.slice(3):"PlainDate"===e?Ir:"PlainYearMonth"===e?k7.slice(0,2):k7;for(let e of n){let t=IE(Iv(r,e));if(void 0!==t&&t!==k4&&("largestUnit"!==e||"auto"!==t)&&!o.includes(t))return{messageId:"invalid-option",option:e}}if("total"===t)return;let a=Iv(r,"roundingMode");if(void 0!==a&&a!==k4&&!In.has(String(a)))return{messageId:"invalid-option",option:"roundingMode"};let i=IC(r);if(i!==k4&&(!Number.isFinite(i)||i<1||i>1e9))return{messageId:"invalid-increment",option:"roundingIncrement"}}(t,r,n);if(i)return a(i.messageId,i.option);let s=function(e,t,r){if("total"===t&&void 0===Iv(r,"unit"))return"`unit`";if("round"===t&&void 0===Iv(r,"smallestUnit")){if("Duration"!==e)return"`smallestUnit`";if(void 0===Iv(r,"largestUnit"))return"`smallestUnit` or `largestUnit`"}}(t,r,n);if(s)return a("missing-unit",void 0,{required:s});let l=function(e,t,r,n){let o=IE(Iv(r,"total"===t?"unit":"smallestUnit")),a=IE(Iv(r,"largestUnit"));if("since"===t||"until"===t){let[t,r]=Il.get(e);o??=r,(void 0===a||"auto"===a)&&(a=IT(t,o))}else"Duration"===e&&"round"===t&&(o??="nanosecond",(void 0===a||"auto"===a)&&(a=IT((e=>{if(!e)return k4;for(let[t,r]of e.entries()){if(r===k4)return k4;if(0!==r)return k7[t]}return"nanosecond"})(n),o)));return{smallest:o,largest:a}}(t,r,n,o),{smallest:u,largest:p}=l,c="Duration"===t&&"round"===r;return("since"===r||"until"===r||c)&&p!==k4&&u!==k4&&k7.indexOf(p)>k7.indexOf(u)?a("unit-order","largestUnit"):!function(e,t,r,{smallest:n,largest:o}){if("total"===t||n===k4||r===k4)return!1;let a=Io.get(n),i=!1;return"Instant"===e&&"round"===t?(a=Ia.get(n),i=!0):"round"===t&&"Duration"!==e&&"day"===n&&(a=1,i=!0),!!a&&(r>a||!i&&r===a||a%r!=0)||"Duration"===e&&"round"===t&&Ir.includes(n)&&r>1&&o!==k4&&o!==n}(t,r,IC(n),l)?"Duration"===t&&void 0===Iv(n,"relativeTo")&&(Ib(o)||IS(u)||c&&IS(p))?a("relative-to","relativeTo"):void 0:a("invalid-increment","roundingIncrement")}let Iw="no-invalid-url-protocol-comparison",IA=new o(["==","===","!=","!=="]),Ik=e=>{let t=td(rx(e));if("string"==typeof t&&/^[A-Za-z][\d+\-.A-Za-z]*:?$/v.test(t))return(t.endsWith(":")?t:`${t}:`).toLowerCase()},II=(e,t)=>("ChainExpression"===(e=rx(e)).type&&(e=rx(e.expression)),"MemberExpression"===e.type&&(e.computed?"protocol"===td(rx(e.property)):"protocol"===e.property.name)&&"url"===ap(e.object,t)),Ij=(e,t)=>{let r=Ik(e=rx(e));if(void 0!==r&&r!==td(e))return{node:e,messageId:Iw,data:{protocol:r},fix:n=>s5(e,r,t,n)}},IR="no-prevent-default-in-passive-listener/error",IF="no-prevent-default-in-passive-listener/suggestion",IB="no-invalid-boolean-attribute-value",IL="no-invalid-boolean-attribute-value/remove",IN="no-invalid-boolean-attribute-value/empty",IP=new o(["globalThis","self","window"]),IM=new o(["a","script","style","title"]),I$=new r([["HTMLAnchorElement","a"],["HTMLElement","abbr address article aside b bdi bdo cite code dd dfn dt em figcaption figure footer header hgroup i kbd main mark nav noscript rp rt ruby s samp search section small strong sub summary sup u var wbr"],["HTMLAreaElement","area"],["HTMLAudioElement","audio"],["HTMLBaseElement","base"],["HTMLQuoteElement","blockquote q"],["HTMLBodyElement","body"],["HTMLBRElement","br"],["HTMLButtonElement","button"],["HTMLCanvasElement","canvas"],["HTMLTableCaptionElement","caption"],["HTMLTableColElement","col colgroup"],["HTMLDataElement","data"],["HTMLDataListElement","datalist"],["HTMLModElement","del ins"],["HTMLDetailsElement","details"],["HTMLDialogElement","dialog"],["HTMLDivElement","div"],["HTMLDListElement","dl"],["HTMLEmbedElement","embed"],["HTMLFieldSetElement","fieldset"],["HTMLFormElement","form"],["HTMLHeadingElement","h1 h2 h3 h4 h5 h6"],["HTMLHeadElement","head"],["HTMLHRElement","hr"],["HTMLHtmlElement","html"],["HTMLIFrameElement","iframe"],["HTMLImageElement","img"],["HTMLInputElement","input"],["HTMLLabelElement","label"],["HTMLLegendElement","legend"],["HTMLLIElement","li"],["HTMLLinkElement","link"],["HTMLMapElement","map"],["HTMLMenuElement","menu"],["HTMLMetaElement","meta"],["HTMLMeterElement","meter"],["HTMLObjectElement","object"],["HTMLOListElement","ol"],["HTMLOptGroupElement","optgroup"],["HTMLOptionElement","option"],["HTMLOutputElement","output"],["HTMLParagraphElement","p"],["HTMLPictureElement","picture"],["HTMLPreElement","pre"],["HTMLProgressElement","progress"],["HTMLScriptElement","script"],["HTMLSelectElement","select"],["HTMLSelectedContentElement","selectedcontent"],["HTMLSlotElement","slot"],["HTMLSourceElement","source"],["HTMLSpanElement","span"],["HTMLStyleElement","style"],["HTMLTableElement","table"],["HTMLTableSectionElement","tbody tfoot thead"],["HTMLTableCellElement","td th"],["HTMLTemplateElement","template"],["HTMLTextAreaElement","textarea"],["HTMLTimeElement","time"],["HTMLTitleElement","title"],["HTMLTableRowElement","tr"],["HTMLTrackElement","track"],["HTMLUListElement","ul"],["HTMLVideoElement","video"]]),IO=new r([...I$].flatMap(([e,t])=>t.split(" ").map(t=>[t,e]))),IU=new o(I$.keys().filter(e=>"HTMLElement"!==e)),Iq=new o(["autofocus","headingreset","inert","itemscope"]),IW=new r([["allowfullscreen",["HTMLIFrameElement"]],["alpha",["HTMLInputElement"]],["async",["HTMLScriptElement"]],["autoplay",["HTMLAudioElement","HTMLVideoElement"]],["checked",["HTMLInputElement"]],["controls",["HTMLAudioElement","HTMLVideoElement","HTMLImageElement"]],["default",["HTMLTrackElement"]],["defer",["HTMLScriptElement"]],["disabled",["HTMLButtonElement","HTMLInputElement","HTMLOptGroupElement","HTMLOptionElement","HTMLSelectElement","HTMLTextAreaElement","HTMLFieldSetElement","HTMLLinkElement"]],["formnovalidate",["HTMLButtonElement","HTMLInputElement"]],["ismap",["HTMLImageElement"]],["loop",["HTMLAudioElement","HTMLVideoElement"]],["multiple",["HTMLInputElement","HTMLSelectElement"]],["muted",["HTMLAudioElement","HTMLVideoElement"]],["nomodule",["HTMLScriptElement"]],["novalidate",["HTMLFormElement"]],["open",["HTMLDetailsElement","HTMLDialogElement"]],["playsinline",["HTMLVideoElement"]],["readonly",["HTMLInputElement","HTMLTextAreaElement"]],["required",["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement"]],["reversed",["HTMLOListElement"]],["selected",["HTMLOptionElement"]],["shadowrootclonable",["HTMLTemplateElement"]],["shadowrootcustomelementregistry",["HTMLTemplateElement"]],["shadowrootdelegatesfocus",["HTMLTemplateElement"]],["shadowrootserializable",["HTMLTemplateElement"]]]),IV=e=>e.replaceAll(/[A-Z]/g,e=>e.toLowerCase()),Iz=(e,t)=>{let r=rP(e,t);return"string"==typeof r?.value?r.value:void 0},I_=(e,t)=>e.computed?Iz(e.property,t):"Identifier"===e.property.type?e.property.name:void 0,IJ=(e,t)=>{let r=eD(t.sourceCode.getScope(e),e);return{variable:r,definition:r?.defs.length===1?r.defs[0]:void 0}},IH=e=>e?.type==="Variable"&&e.node.id===e.name?e.node.init:void 0;function IK(e,t,r=new o){if(e?.type==="TSTypeAnnotation"||e?.type==="TSParenthesizedType")return IK(e.typeAnnotation,t,r);if(e?.type==="TSNullKeyword"||e?.type==="TSUndefinedKeyword")return new o;if(e?.type==="TSUnionType"){let n=new o;for(let o of e.types){let e=IK(o,t,r);if(!e)return;for(let t of e)n.add(t)}return n}if(e?.type!=="TSTypeReference"||"Identifier"!==e.typeName.type)return;let{variable:n,definition:a}=IJ(e.typeName,t);if(!n?.defs.length)return IU.has(e.typeName.name)?new o([e.typeName.name]):void 0;if(a?.node.type!=="TSTypeAliasDeclaration"||r.has(n))return;r.add(n);let i=IK(a.node.typeAnnotation,t,r);return r.delete(n),i}let IG=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{return function e(t,r){if(n$.has(t.intrinsicName))return;if(nO.has(t.intrinsicName))return new o;if(t.isUnion()){let n=new o;for(let o of t.types){let t=e(o,r);if(!t)return;for(let e of t)n.add(e)}return n}let n=nU(t);if(IU.has(n?.getName())&&nq(n,r))return new o([n.getName()])}(r.getTypeAtLocation(e),r.program)}catch{}},IX="no-invalid-dom-token/empty",IY="no-invalid-dom-token/whitespace",IZ="no-invalid-dom-token/suggestion",IQ=new o(["classList","relList","sandbox","part","sizes","blocking","htmlFor","controlsList"]),I0=new r([["add",1/0],["remove",1/0],["toggle",1],["replace",2]]),I1=/[\t\n\f\r ]/v,I2=/[\t\n\f\r ]+/v,{isTarget:I3}=oe({targetTypeNames:new o(["DOMTokenList"]),allowNullishInMixedUnion:!0}),I5=e=>"ChainExpression"===(e=rx(e)).type?rx(e.expression):e,I8=e=>{if(tL(e)&&"PrivateIdentifier"!==e.property.type)return e.computed?td(rx(e.property)):e.property.name},I9=(e,t)=>{let r=td(rx(e));if("string"!=typeof r)return;let n=r.split(I2).filter(Boolean),o=ti(e,t);if(!(0===n.length||r9(t,o)))return{messageId:IZ,fix:e=>e.replaceTextRange(o,n.map(e=>t5(e)).join(", "))}},I6="require-text-decoder-streaming/error",I4="require-text-decoder-streaming/suggestion",I7=new o(["ForOfStatement","ForStatement","WhileStatement","DoWhileStatement"]);function je(e){return e=rx(e),e?.type==="ChainExpression"?je(e.expression):e}function jt(e){if(e=je(e),e?.type!=="CallExpression"&&e?.type!=="NewExpression")return e;let t=je(e.callee);return t===e.callee?e:{...e,callee:t}}function jr(e){for(;e;e=e.parent)if(tj(e)||"Program"===e.type)return e}function jn(e){for(let{parent:t}=e;t;t=t.parent){if(tj(t))return;if(I7.has(t.type))return t}}function jo(e,t){if(e?.type!=="Identifier")return;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs.length===1?r.defs[0]:void 0;if(n?.type==="Variable"&&jr(n.node)===jr(e))return{variable:r,definition:n}}function ja(e,t){let r=jo(e,t);if(!(r?.definition.parent.kind!=="const"||r.variable.references.some(e=>e.isWrite()&&!e.init)))return r}function ji(e,t){if(e=je(e),e?.type!=="Identifier")return e;let r=ja(e,t);if(!r)return;let{definition:n}=r;return"Identifier"===n.node.id.type&&n.node.init?t.sourceCode.getRange(n.node)[1]>t.sourceCode.getRange(e)[0]?void 0:ji(n.node.init,t):e}function js(e,t){if(!tL(e=ji(e,t),{property:"body"}))return!1;let r=ji(e.object,t);if(r?.type!=="AwaitExpression")return!1;let n=jt(r.argument);if(tS(n,{name:"fetch",minimumArguments:1,maximumArguments:2},tb))return!0;if(!tP(n,{method:"fetch",minimumArguments:1,maximumArguments:2}))return!1;let o=je(n.callee.object);return"Identifier"===o.type&&"globalThis"===o.name}function jl(e,t,r){if(e=ji(e,r),e?.type!=="AwaitExpression"||jn(e)!==t)return!1;let n=jt(e.argument);if(!tP(n,{method:"read",argumentsLength:0}))return!1;let o=jt(ji(n.callee.object,r));return tP(o,{method:"getReader",argumentsLength:0})&&js(o.callee.object,r)}let ju=(e,t)=>tP(e,{method:"decode",argumentsLength:t,optionalCall:!1,optionalMember:!1});function jp(e){let t=e?.type==="ExpressionStatement"?e.expression:void 0;return t?.type==="AssignmentExpression"&&"+="===t.operator&&"Identifier"===t.left.type?t:void 0}function jc(e,t,r){let n=jo(e,r);if(n?.definition.node.id.type==="Identifier"&&n.definition.parent.parent===t.parent&&!(r.sourceCode.getRange(n.definition.node)[1]>r.sourceCode.getRange(t)[0]))return n}let jd="prefer-literal-ascii",jm=/\\x(?<hex>[\dA-Fa-f]{2})|\\u(?<unicode>[\dA-Fa-f]{4})|\\u\{(?<codePoint>[\dA-Fa-f]+)\}/vy,jf=/\\(?<digits>[\da-f]{1,6})(?:\r\n|[\t\n\f\r ])?/iy,jg=new o([E.tokenTypes.Ident,E.tokenTypes.Hash,E.tokenTypes.AtKeyword,E.tokenTypes.Function,E.tokenTypes.Dimension]);function jy(e){return e>=32&&e<=126}function jh(e,t){return"\\"===e||e===t?"\\"+e:e}function jx(e){let t=[];return E.tokenize(e,(r,n,o)=>{t.push({type:r,value:E.ident.decode(e.slice(n,o))})}),t}function jb(e){return E.parse(e,{context:"value"}).children.first.value}function jv(e,t,r,n){let{fixed:o,canFix:a}=function(e,t,r){let n="",o=!0;for(let a=0;a<e.length;a++){let i=e[a];if("\\"!==i){n+=i;continue}if("\\"===e[a+1]){n+="\\\\",a++;continue}if(r&&"/"===e[a+1]){n+="/",a++;continue}let s=function(e,t){jm.lastIndex=t;let r=jm.exec(e);if(!r)return;let n=Number.parseInt(r.groups.hex??r.groups.unicode??r.groups.codePoint,16);return{end:jm.lastIndex,value:n}}(e,a);if(!s||!jy(s.value)){n+=i;continue}let l=String.fromCodePoint(s.value);(function(e,t){if(t<"0"||t>"9")return!1;let r=e.length;for(;r>0&&e[r-1]>="0"&&e[r-1]<="7"&&e.length-r<3;)r--;let n=r-1;if("\\"!==e[n]||function(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==1}(e,n))return!1;let o=e.slice(r);if("0"===o)return!0;if(t>"7")return!1;let a=o[0]<="3"?3:2;return o.length<a})(n,l)&&(o=!1),n+=jh(l,t),a=s.end-1}return{fixed:n,canFix:o}}(t,r,"String"===e.type);if(o===t)return;let i="TemplateElement"===e.type&&"TSLiteralType"===e.parent.parent.type&&e.value.cooked.includes("\\"),s=a&&!i&&("Literal"!==e.type||!tC(e.parent));return{node:e,messageId:jd,...s&&{fix:t=>n?n(t,o):t.replaceText(e,o)}}}let jE="prefer-short-escape-sequences",jS=new r([["0008",String.raw`\b`],["0009",String.raw`\t`],["000A",String.raw`\n`],["000C",String.raw`\f`],["000D",String.raw`\r`]]),jT=new r([["0022",String.raw`\"`],["0027","'"],["002F","/"],["005C",String.raw`\\`]]),jC=new r([["0000",String.raw`\0`],["000B",String.raw`\v`]]),jD=/(?<backslashes>\\+)(?:u(?<codePoint>[\dA-Fa-f]{4}))?/gv;function jw(e,t,r,n){let o=function(e,{dialect:t}){let r=e.replaceAll(jD,(r,n,o,a)=>{if(void 0===o||n.length%2==0)return r;let i=function(e,{dialect:t,nextCharacter:r}){if("toml"===t)return jT.get(e)??jS.get(e);if("javascript"===t){if("0000"===e&&/^\d$/v.test(r))return;let t=jC.get(e);if(t)return t}return jS.get(e)}(o.toUpperCase(),{dialect:t,nextCharacter:e[a+r.length]});return i?n.slice(0,-1)+i:r});return r===e?void 0:r}(t,r);if(void 0!==o)return{node:e,messageId:jE,fix:e=>n(e,o)}}let jA="prefer-escaped-irregular-whitespace",jk=/[\v\f\u{85}\u{a0}\u{1680}\u{180e}\u{2000}-\u{200b}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}\u{feff}]/gu,jI=new o(["\u2028","\u2029"]),jj=e=>String.raw`\u{${e.codePointAt(0).toString(16).toUpperCase()}}`,jR=e=>String.raw`\u${e.codePointAt(0).toString(16).toUpperCase().padStart(4,"0")}`;function jF(e,t,{fix:r,shouldFix:n=!0,escapeCharacter:o=jj}={}){let a="",i=0;for(let e of t.matchAll(jk)){let[r]=e,{index:n}=e,s=function(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==1}(t,n);a+=t.slice(i,n),s&&jI.has(r)?a+=r:(s&&(a=a.slice(0,-1)),a+=o(r)),i=n+r.length}if((a+=t.slice(i))===t)return;let s={node:e,messageId:jA};return n&&(s.fix=t=>r?r(t,a):t.replaceText(e,a)),s}let jB={configs:{node:{name:"@eslint-sukka/eslint-plugin-sukka-full node preset",plugins:{get sukka(){return jB}},rules:{"sukka/unicorn/prefer-node-protocol":"error","sukka/unicorn/prefer-import-meta-properties":"error","no-process-exit":"off","sukka/unicorn/no-process-exit":"warn","no-buffer-constructor":"off","sukka/unicorn/no-new-buffer":"error"}},recommended:{...x.eslint_plugin_sukka.configs.recommended,plugins:{get sukka(){return jB}},rules:Object.assign({"sukka/array/no-unneeded-flat-map":"error","sukka/browser/prefer-location-assign":"warn","sukka/jsx/no-template-literal":"error","sukka/jsx/no-unneeded-nested":"error","sukka/string/no-locale-case":"warn","sukka/string/no-simple-template-literal":"error","sukka/unicode/no-bidi":"warn","sukka/unicode/no-invisible":"warn","sukka/no-redundant-variable":"error","sukka/no-single-return":"warn","sukka/prefer-early-return":["error",{maximumStatements:16}],"sukka/prefer-fetch":"error","sukka/prefer-timer-id":"warn"},b.collectRules(x.eslint_plugin_sukka.configs.recommended),{"sukka/prefer-single-boolean-return":"off"})},recommended_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full recommended unicorn preset",plugins:{get sukka(){return jB}},rules:{"sukka/unicorn/no-lonely-if":"error","sukka/unicorn/no-negated-condition":"warn","sukka/unicorn/catch-error-name":["error",{ignore:[/^(?:e|err|error|\w+Err|\w+Error)[\d_]?$/]}],"sukka/unicorn/custom-error-definition":"error","sukka/unicorn/require-array-join-separator":"warn","sukka/unicorn/no-thenable":"error","sukka/unicorn/no-invalid-remove-event-listener":"error","sukka/unicorn/consistent-function-scoping":"warn","sukka/unicorn/prefer-event-target":"warn","sukka/unicorn/prefer-keyboard-event-key":"warn","sukka/unicorn/prefer-text-content":"warn","sukka/unicorn/no-console-spaces":"warn","sukka/unicorn/no-empty-file":"warn","sukka/unicorn/no-useless-fallback-in-spread":"warn","sukka/unicorn/no-useless-length-check":"warn","sukka/unicorn/no-useless-promise-resolve-reject":"warn","sukka/unicorn/no-zero-fractions":"warn","sukka/unicorn/prefer-export-from":["warn",{checkUsedVariables:!1}],"sukka/unicorn/prefer-native-coercion-functions":"warn","sukka/unicorn/prefer-negative-index":"warn","sukka/unicorn/no-document-cookie":"error","sukka/unicorn/prefer-add-event-listener":"warn","sukka/unicorn/prefer-array-index-of":"warn","sukka/unicorn/prefer-blob-reading-methods":"warn","sukka/unicorn/prefer-date-now":"warn","sukka/unicorn/dom-node-dataset":"warn","sukka/unicorn/prefer-modern-math-apis":"warn","sukka/unicorn/number-literal-case":"error","sukka/unicorn/prefer-number-properties":["warn",{checkInfinity:!1}],"sukka/unicorn/prefer-reflect-apply":"warn","sukka/unicorn/prefer-set-size":"warn","sukka/unicorn/prefer-string-replace-all":"warn","sukka/unicorn/prefer-string-slice":"warn","sukka/unicorn/prefer-string-trim-start-end":"warn","sukka/unicorn/no-unreadable-iife":"warn","sukka/unicorn/throw-new-error":"warn","sukka/unicorn/escape-case":"warn","sukka/unicorn/prefer-unicode-code-point-escapes":"warn","sukka/unicorn/prefer-prototype-methods":"warn","sukka/unicorn/error-message":"error","sukka/unicorn/no-instanceof-builtins":["error",{strategy:"loose"}],"sukka/unicorn/prefer-type-error":"error","sukka/unicorn/consistent-destructuring":"warn","sukka/unicorn/new-for-builtins":"warn","sukka/unicorn/prefer-single-call":"warn","sukka/unicorn/no-static-only-class":"warn","sukka/unicorn/no-unreadable-array-destructuring":"error","sukka/unicorn/no-useless-spread":"error","sukka/unicorn/no-useless-switch-case":"warn","sukka/unicorn/no-useless-undefined":["error",{checkArguments:!1}],"sukka/unicorn/numeric-separators-style":["warn",{onlyIfContainsSeparator:!1,number:{minimumDigits:7,groupLength:3},binary:{minimumDigits:9,groupLength:4},octal:{minimumDigits:9,groupLength:4},hexadecimal:{minimumDigits:5,groupLength:2}}],"sukka/unicorn/prefer-array-find":"warn","sukka/unicorn/prefer-array-flat-map":"warn","sukka/unicorn/prefer-array-flat":"warn","sukka/unicorn/prefer-array-some":"warn","sukka/unicorn/prefer-default-parameters":"warn","sukka/unicorn/prefer-logical-operator-over-ternary":"warn","sukka/unicorn/prefer-optional-catch-binding":"error","sukka/unicorn/prefer-regexp-test":"warn","sukka/unicorn/prefer-set-has":"error","sukka/unicorn/prefer-switch":"warn","sukka/unicorn/require-number-to-fixed-digits-argument":"warn","sukka/unicorn/prefer-string-raw":"warn","sukka/unicorn/no-single-promise-in-promise-methods":"error","sukka/unicorn/no-await-in-promise-methods":"error","sukka/unicorn/no-magic-array-flat-depth":"error","sukka/unicorn/no-object-as-default-parameter":"error","sukka/unicorn/template-indent":["warn",{tags:["outdent","dedent","gql","sql","html","styled","css"],functions:["dedent","stripIndent","strip_indent","stripTags","striptags","strip_tags","stripHtml","stripHTML","strip_html"],selectors:[],comments:["HTML","html","CSS","css","indent"]}],"sukka/unicorn/no-negation-in-equality-check":"error","sukka/unicorn/no-unnecessary-slice-end":"error","sukka/unicorn/consistent-date-clone":"error","sukka/unicorn/no-accessor-recursion":"error","sukka/unicorn/no-unnecessary-array-flat-depth":"error","sukka/unicorn/no-unnecessary-array-splice-count":"error","sukka/unicorn/no-useless-error-capture-stack-trace":"error","sukka/unicorn/prefer-class-fields":"error","sukka/unicorn/prefer-bigint-literals":"error","sukka/unicorn/prefer-classlist-toggle":"warn","sukka/unicorn/require-module-attributes":"error","sukka/unicorn/no-immediate-mutation":"error","sukka/unicorn/no-useless-collection-argument":"error","sukka/unicorn/prefer-response-static-json":"error","sukka/unicorn/consistent-template-literal-escape":"error","sukka/unicorn/no-useless-iterator-to-array":"error","sukka/unicorn/prefer-simple-condition-first":"error","sukka/unicorn/switch-case-break-position":"error","sukka/unicorn/better-dom-traversing":"warn","sukka/unicorn/no-blob-to-file":"error","sukka/unicorn/no-canvas-to-image":"warn","sukka/unicorn/no-confusing-array-splice":"error","sukka/unicorn/no-duplicate-set-values":"error","sukka/unicorn/no-incorrect-query-selector":"error","sukka/unicorn/no-invalid-file-input-accept":"error","sukka/unicorn/no-late-current-target-access":"error","sukka/unicorn/no-unused-builtin-method-return":"error","sukka/unicorn/prefer-array-last-methods":"warn","sukka/unicorn/prefer-math-abs":"warn","sukka/unicorn/prefer-split-limit":"error","sukka/unicorn/prefer-queue-microtask":"warn","sukka/unicorn/prefer-string-pad-start-end":"warn","sukka/unicorn/require-css-escape":"warn","sukka/unicorn/require-passive-events":"warn","sukka/unicorn/class-reference-in-static-methods":["warn",{preferThis:!1,preferSuper:!1}],"sukka/unicorn/consistent-optional-chaining":"error","sukka/unicorn/explicit-timer-delay":"error","sukka/unicorn/no-confusing-array-with":"error","sukka/unicorn/no-duplicate-loops":"warn","sukka/unicorn/no-declarations-before-early-exit":"error","sukka/unicorn/no-optional-chaining-on-undeclared-variable":"error","sukka/unicorn/no-object-methods-with-collections":"error","sukka/unicorn/no-subtraction-comparison":"warn","sukka/unicorn/no-unnecessary-global-this":"warn","sukka/unicorn/no-useless-else":"error","sukka/unicorn/no-useless-recursion":"error","sukka/unicorn/prefer-add-event-listener-options":"warn","sukka/unicorn/prefer-direct-iteration":"warn","sukka/unicorn/prefer-number-is-safe-integer":"warn","sukka/unicorn/prefer-object-define-properties":"error","sukka/unicorn/prefer-object-destructuring-defaults":"warn","sukka/unicorn/prefer-single-object-destructuring":"warn","sukka/unicorn/prefer-smaller-scope":"warn","sukka/unicorn/prefer-single-array-predicate":"warn","sukka/unicorn/prefer-url-href":"error","sukka/unicorn/require-proxy-trap-boolean-return":"error","sukka/unicorn/logical-assignment-operators":"error","sukka/unicorn/no-useless-coercion":"error","sukka/unicorn/no-useless-boolean-cast":"warn","sukka/unicorn/no-useless-continue":"error","sukka/unicorn/no-useless-override":"error","sukka/unicorn/prefer-has-check":"warn","sukka/unicorn/consistent-conditional-object-spread":"error","sukka/unicorn/no-boolean-sort-comparator":"error","sukka/unicorn/no-chained-comparison":"error","sukka/unicorn/no-constant-zero-expression":"error","sukka/unicorn/no-duplicate-logical-operands":"error","sukka/unicorn/no-impossible-length-comparison":"error","sukka/unicorn/no-invalid-character-comparison":"error","sukka/unicorn/no-loop-iterable-mutation":"error","sukka/unicorn/no-selector-as-dom-name":"error","sukka/unicorn/no-array-concat-in-loop":"error","sukka/unicorn/no-array-front-mutation":"warn","sukka/unicorn/no-array-sort-for-min-max":"error","sukka/unicorn/no-useless-compound-assignment":"warn","sukka/unicorn/no-useless-delete-check":"warn","sukka/unicorn/no-useless-logical-operand":"error","sukka/unicorn/prefer-boolean-return":"warn","sukka/unicorn/prefer-flat-math-min-max":"warn","sukka/unicorn/prefer-hoisting-branch-code":"warn","sukka/unicorn/prefer-single-replace":"warn","sukka/unicorn/no-invalid-well-known-symbol-methods":"error","sukka/unicorn/no-late-event-control":"error","sukka/unicorn/prefer-abort-signal-timeout":"warn","sukka/unicorn/prefer-aggregate-error":"warn","sukka/unicorn/prefer-observer-apis":"warn","sukka/unicorn/prefer-set-methods":"warn","sukka/unicorn/prefer-toggle-attribute":"warn","sukka/unicorn/prefer-url-search-parameters":"warn","sukka/unicorn/no-unsafe-promise-all-settled-values":"error","sukka/unicorn/prefer-abort-signal-any":"warn","sukka/unicorn/prefer-block-statement-over-iife":"warn","sukka/unicorn/no-multiple-promise-resolver-calls":"error","sukka/unicorn/no-unnecessary-string-trim":"error","sukka/unicorn/no-useless-re-export":"warn","sukka/unicorn/iteration-fallback-style":"warn","sukka/unicorn/no-async-iterator-callback":"error","sukka/unicorn/no-unused-iterator-helper":"error","sukka/unicorn/no-useless-set-construction":"warn","sukka/unicorn/no-using-resource-escape":"error","sukka/unicorn/prefer-combined-guards":"warn","sukka/unicorn/prefer-temporal-conversion":"warn","sukka/unicorn/prefer-iterator-helpers":"off","sukka/unicorn/prefer-iterator-zip":"off","sukka/unicorn/prefer-uint8array-hex":"off","sukka/unicorn/no-incomplete-accessor-override":"error","sukka/unicorn/no-invalid-temporal-arithmetic":"error","sukka/unicorn/no-invalid-url-protocol-comparison":"error","sukka/unicorn/no-prevent-default-in-passive-listener":"error","sukka/unicorn/no-invalid-boolean-attribute-value":"error","sukka/unicorn/no-invalid-dom-token":"error","sukka/unicorn/require-text-decoder-streaming":"error","sukka/unicorn/prefer-literal-ascii":"warn","sukka/unicorn/prefer-short-escape-sequences":"warn","sukka/unicorn/prefer-escaped-irregular-whitespace":"warn"}},stylistic_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full stylistic unicorn preset",plugins:{get sukka(){return jB}},rules:{"sukka/unicorn/no-nested-ternary":"warn","sukka/unicorn/filename-case":["error",{cases:{kebabCase:!0,snakeCase:!0},ignore:[/fixtures/i,/^_/,/^\./,/rc$/i,/\.(md|json|yaml|toml|yml|ini|conf|jsonc|json5)$/i]}],"sukka/unicorn/no-unnecessary-nested-ternary":"error","sukka/unicorn/no-unreadable-object-destructuring":"error","sukka/unicorn/consistent-compound-words":"warn"}},recommended_extra_with_typed_lint:{...x.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint,plugins:{get sukka(){return jB}},rules:Object.assign({"sukka/string/no-unneeded-to-string":"error","sukka/type/no-force-cast-via-top-type":"error","sukka/type/no-wrapper-type-reference":"error","sukka/require-project-reference":"off","sukka/no-default-error":"off","sukka/unicorn/consistent-tuple-labels":"warn"},b.collectRules(x.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint))},recommended_react:{...x.eslint_plugin_sukka.configs.recommended_react,plugins:{get sukka(){return jB}}}},rules:Object.assign(x.eslint_plugin_sukka.rules,{"array/no-unneeded-flat-map":M,"browser/prefer-location-assign":O,"jsx/no-template-literal":q,"jsx/no-unneeded-nested":W,"string/no-locale-case":z,"string/no-simple-template-literal":_,"unicode/no-bidi":Z,"unicode/no-invisible":ee,"no-redundant-variable":et,"no-single-return":en,"prefer-early-return":ea,"prefer-fetch":ei,"prefer-timer-id":eu,"string/no-unneeded-to-string":ep,"type/no-force-cast-via-top-type":ec,"type/no-wrapper-type-reference":em,"no-default-error":ef,"require-project-reference":ex},Object.fromEntries(Object.entries({"unicorn/catch-error-name":{create:e=>{let t=e.options[0],{name:r}=t,o=t.ignore.map(e=>T.isRegExp(e)?e:RegExp(e,"u")),a=e=>e===r||o.some(t=>((t.global||t.sticky)&&(t=new n(t)),t.test(e)))||e.endsWith(r)||e.endsWith(sg(r));e.on("Identifier",t=>{if(("CatchClause"!==t.parent.type||t.parent.param!==t)&&!(("FunctionExpression"===t.parent.type||"ArrowFunctionExpression"===t.parent.type)&&t.parent.params[0]===t&&(tP(t.parent.parent,{method:"then",argumentsLength:2,optionalCall:!1})||tP(t.parent.parent,{method:"catch",argumentsLength:1,optionalCall:!1}))&&t.parent.parent.arguments.at(-1)===t.parent))return;let n=t.name;if(a(n)||a(n.replaceAll(/_+$/g,"")))return;let o=eD(e.sourceCode.getScope(t),t);if(!o||"_"===n&&0===o.references.length)return;let i=[o.scope,...o.references.map(({from:e})=>e)],{body:s}=t.parent;"BlockStatement"===s.type&&i.push(e.sourceCode.getScope(s));let l=rl(r,i),u={node:t,messageId:fm,data:{originalName:n,fixedName:l||r}};return l&&(u.fix=t=>s1(o,l,e,t)),u})},meta:{type:"suggestion",docs:{description:"Enforce a specific parameter name in catch clauses.",recommended:!0},fixable:"code",schema:ff,defaultOptions:[{name:"error",ignore:[]}],messages:{[fm]:"The catch parameter `{{originalName}}` should be named `{{fixedName}}`."},languages:["js/js"]}},"unicorn/custom-error-definition":{create:e=>{e.on("ClassDeclaration",t=>fO(e,t)),e.on("AssignmentExpression",t=>{if("ClassExpression"===t.right.type)return fO(e,t.right)}),e.on("AssignmentExpression",e=>{if("MemberExpression"===e.left.type&&"Identifier"===e.left.object.type&&"exports"===e.left.object.name)return(e=>{let t=e.right;if("ClassExpression"!==t.type||!fw(t)||!t.id)return;let r=t.id.name,n=e.left.computed,o=e.left.property,a=rx(o),i=n?td(a):o.name;if(void 0===i||i===r)return;let s=n?a:o,l=n?`'${r}'`:r;return{node:o,messageId:fg,fix:e=>e.replaceText(s,l)}})(e)})},meta:{type:"problem",docs:{description:"Enforce correct `Error` subclassing.",recommended:!1},fixable:"code",messages:{[fg]:"Exported error name should match error class",[fy]:"Do not pass the error message to `super()` when the class defines a `message` accessor.",[fh]:"Do not assign to `this.message` when the class defines a `message` getter without a setter.",[fx]:"Error constructors should accept an `options` parameter.",[fb]:"Error constructors should use a non-rest parameter named `options`.",[fv]:"Pass the error message to `super()` as the first argument.",[fE]:"Pass `options` to `super()` as the second argument."},languages:["js/js"]}},"unicorn/no-nested-ternary":{create:e=>{e.on("ConditionalExpression",t=>{if([t.test,t.consequent,t.alternate].some(e=>"ConditionalExpression"===e.type))return;let{sourceCode:r}=e,n=r.getAncestors(t).toReversed(),o=n.findIndex(e=>"ConditionalExpression"!==e.type);return 1!==o||tl(t,e)?o>1?{node:o>2?n[o-3]:t,messageId:sh}:void 0:{node:t,messageId:sx,fix:e=>[e.insertTextBefore(t,"("),e.insertTextAfter(t,")")]}})},meta:{type:"suggestion",docs:{description:"Disallow nested ternary expressions.",recommended:!0},fixable:"code",messages:{[sh]:"Do not nest ternary expressions.",[sx]:"Nested ternary expression should be parenthesized."},languages:["js/js"]}},"unicorn/prefer-event-target":{create:e=>{e.on("Identifier",t=>{if("EventEmitter"!==t.name||("ClassDeclaration"!==t.parent.type&&"ClassExpression"!==t.parent.type||t.parent.superClass!==t)&&("NewExpression"!==t.parent.type||t.parent.callee!==t))return;let r=e.sourceCode.getScope(t);if(!function(e){if(!e)return!1;let t=function(e,t){let r=e=>e.type===t;for(;e.parent;e=e.parent)if(r(e))return e}(e,"ImportDeclaration");return!!(sv.has(t?.source.value)||"Property"===e.parent.type&&e.parent.value===e&&"Identifier"===e.parent.key.type&&"EventEmitter"===e.parent.key.name&&"ObjectPattern"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent)&&sE(e.parent.parent)&&sS(e.parent.parent.parent.init))||!!(sE(e)&&tL(e.parent.init,{property:"EventEmitter",optional:!1,computed:!1})&&sS(e.parent.init.object))}(eD(r,t)?.defs[0]?.name))return{node:t,messageId:sb}})},meta:{type:"suggestion",docs:{description:"Prefer `EventTarget` over `EventEmitter`.",recommended:"unopinionated"},messages:{[sb]:"Prefer `EventTarget` over `EventEmitter`."},languages:["js/js"]}},"unicorn/prefer-keyboard-event-key":{create:e=>{e.on("Identifier",t=>{if(sw.has(t.name)){for(let r of sR(e,t))if(r.references?.some(e=>sj(t,e.identifier)))return sB(t,r)}}),e.on("Property",t=>{let r;if("Identifier"===t.key.type&&sw.has(t.key.name)&&"Property"===(r=t.key).parent.type&&r.parent.key===r&&"ObjectPattern"===r.parent.parent.type&&!r.parent.computed){for(let r of sR(e,t))if(sN(t.key,r))return sB(t.key,r);for(let r of sR(e,t))if(sL(t.key,r))return sB(t.key,r)}})},meta:{type:"suggestion",docs:{description:"Prefer `KeyboardEvent#key` over deprecated keyboard event properties.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[sC]:"Use `.key` instead of `.{{name}}`.",[sD]:"Use `.key` with `{{key}}`."},languages:["js/js"]}},"unicorn/prefer-text-content":{create:e=>{e.on("MemberExpression",t=>{if(!tL(t,{property:"innerText"})||oS(t.object,e))return;let r=t.property;return{node:r,messageId:sP,suggest:[{messageId:sM,fix:e=>e.replaceText(r,"textContent")}]}}),e.on("Identifier",t=>{if("innerText"===t.name&&"Property"===t.parent.type&&t.parent.key===t&&!t.parent.computed&&"init"===t.parent.kind&&"ObjectPattern"===t.parent.parent.type&&t.parent.parent.properties.includes(t.parent)&&!((e,t)=>{if(oS(e,t))return!0;let{parent:r}=e;return"VariableDeclarator"===r.type?r.id===e&&r.init&&oS(r.init,t):"AssignmentExpression"===r.type&&r.left===e&&oS(r.right,t)})(t.parent.parent,e))return{node:t,messageId:sP,suggest:[{messageId:sM,fix:e=>e.replaceText(t,t.parent.shorthand?"textContent: innerText":"textContent")}]}})},meta:{type:"suggestion",docs:{description:"Prefer `.textContent` over `.innerText`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[sP]:"Prefer `.textContent` over `.innerText`.",[sM]:"Switch to `.textContent`."},languages:["js/js"]}},"unicorn/require-array-join-separator":{create:e=>{e.on("CallExpression",t=>{if(!(tP(t,{method:"join",argumentsLength:0,optionalCall:!1})||tP(t,{method:"call",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&t_(t.callee.object,{property:"join"}))||0===t.arguments.length&&od(t.callee.object,e))return;let{sourceCode:r}=e,[n,o]=r.getLastTokens(t,2),a=1===t.arguments.length;return{loc:{start:r.getLoc(n)[a?"end":"start"],end:r.getLoc(o).end},messageId:s8,fix:r=>sU(r,t,"','",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the separator argument with `Array#join()`.",recommended:"unopinionated"},fixable:"code",messages:{[s8]:"Missing the separator argument."},languages:["js/js"]}},"unicorn/no-thenable":{create:e=>{e.on("ObjectExpression",function*(t){for(let r of t.properties)"Property"===r.type&&lt(r,e)&&(yield{node:r.key,messageId:s9})}),e.on(["PropertyDefinition","MethodDefinition"],t=>{if(lt(t,e))return{node:t.key,messageId:s4}}),e.on("MemberExpression",t=>{if("AssignmentExpression"===t.parent.type&&t.parent.left===t&&lt(t,e))return{node:t.property,messageId:s9}}),e.on("CallExpression",function*(t){if(tP(t,{objects:["Object","Reflect"],method:"defineProperty",minimumArguments:3,optionalCall:!1,optionalMember:!1})&&"SpreadElement"!==t.arguments[0].type){let[,r]=t.arguments;le(r,e)&&(yield{node:r,messageId:s9})}if(tP(t,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"ArrayExpression"===t.arguments[0].type)for(let r of t.arguments[0].elements){if(!(r?.type==="ArrayExpression"&&r.elements[0])||"SpreadElement"===r.elements[0].type)continue;let[t]=r.elements;le(t,e)&&(yield{node:t,messageId:s9})}}),e.on("Identifier",e=>{if("then"===e.name&&("ExportSpecifier"===e.parent.type&&e.parent.exported===e||("FunctionDeclaration"===e.parent.type||"ClassDeclaration"===e.parent.type)&&e.parent.id===e&&"ExportNamedDeclaration"===e.parent.parent.type&&e.parent.parent.declaration===e.parent))return{node:e,messageId:s6}}),e.on("VariableDeclaration",function*(t){if("ExportNamedDeclaration"===t.parent.type&&t.parent.declaration===t){for(let r of e.sourceCode.getDeclaredVariables(t))if("then"===r.name)for(let e of r.identifiers)yield{node:e,messageId:s6}}})},meta:{type:"problem",docs:{description:"Disallow `then` property.",recommended:"unopinionated"},messages:{[s9]:"Do not add `then` to an object.",[s6]:"Do not export `then`.",[s4]:"Do not add `then` to a class."},languages:["js/js"]}},"unicorn/no-invalid-remove-event-listener":{create:e=>{e.on("CallExpression",t=>{if(!(tP(t,{method:"removeEventListener",minimumArguments:2,optionalCall:!1})&&"SpreadElement"!==t.arguments[0].type))return;let[,r]=t.arguments;return["ArrowFunctionExpression","FunctionExpression"].includes(r.type)?{node:r,loc:eP(r,e.sourceCode),messageId:lr}:"CallExpression"!==r.type||r.optional||"MemberExpression"!==r.callee.type||r.callee.optional||"bind"!==eK(r.callee)?void 0:{node:r.callee.property,messageId:lr}})},meta:{type:"problem",docs:{description:"Prevent calling `EventTarget#removeEventListener()` with the result of an expression.",recommended:"unopinionated"},messages:{[lr]:"The listener argument should be a function reference."},languages:["js/js"]}},"unicorn/consistent-function-scoping":lp,"unicorn/no-new-buffer":{create:e=>{e.on("NewExpression",t=>{if(!tT(t,{name:"Buffer"}))return;let r=((e,t)=>{let[r]=e;if(void 0===r)return"from";if("SpreadElement"===r.type)return;if(oO(r,t))return"alloc";if(1!==e.length||"ArrayExpression"===r.type||"TemplateLiteral"===r.type)return"from";let n=rP(r,t);if(n){let{value:e}=n;if("string"==typeof e||Array.isArray(e))return"from"}})(t.arguments,e);return r?{node:t,messageId:lc,data:{method:r},...("alloc"!==r||function(e,t){let[r,...n]=e.arguments;if(0===n.length)return!0;let{sourceCode:o}=t,[a]=o.getRange(o.getTokenAfter(r,ek)),[,i]=o.getRange(e);return!ne(t,[a,i])&&n.every(e=>!e0(e,o))}(t,e))&&{fix:lf(t,e,r)}}:{node:t,messageId:ld,suggest:["from","alloc"].map(r=>({messageId:lm,data:{replacement:r},fix:lf(t,e,r)}))}})},meta:{type:"problem",docs:{description:"Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[lc]:"`new Buffer()` is deprecated, use `Buffer.{{method}}()` instead.",[ld]:"`new Buffer()` is deprecated, use `Buffer.alloc()` or `Buffer.from()` instead.",[lm]:"Switch to `Buffer.{{replacement}}()`."},languages:["js/js"]}},"unicorn/no-console-spaces":{create:e=>{let{sourceCode:t}=e,r=(r,n,o)=>{let[a,i]=t.getRange(r),s="leading"===o?a+1:i-2,l=[s,s+1];return{loc:sp(l,e),messageId:lg,data:{method:n,position:o},fix:e=>e.removeRange(l)}};e.on("CallExpression",function*(e){if(!tP(e,{object:"console",methods:["log","debug","info","warn","error"],minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let n=e.callee.property.name,{arguments:o}=e,{length:a}=o;for(let[e,i]of o.entries()){if(!tp(i)&&"TemplateLiteral"!==i.type)continue;let o=t.getText(i).slice(1,-1);0!==e&&ly(o)&&(yield r(i,n,"leading")),e!==a-1&&lh(o)&&(yield r(i,n,"trailing"))}})},meta:{type:"suggestion",docs:{description:"Do not use leading/trailing space between `console.log` parameters.",recommended:"unopinionated"},fixable:"code",messages:{[lg]:"Do not use {{position}} space between `console.{{method}}` parameters."},languages:["js/js"]}},"unicorn/no-empty-file":lE,"unicorn/no-useless-fallback-in-spread":{create:e=>{e.on("ObjectExpression",t=>{if(tA(t)&&"LogicalExpression"===t.parent.type&&t.parent.right===t&&("||"===t.parent.operator||"??"===t.parent.operator)&&"SpreadElement"===t.parent.parent.type&&t.parent.parent.argument===t.parent&&"ObjectExpression"===t.parent.parent.parent.type&&t.parent.parent.parent.properties.includes(t.parent.parent))return{node:t,messageId:lS,*fix(r,{abort:n}){let{sourceCode:o}=e,a=t.parent;if(o.getCommentsInside(a).length>0)return n();let{left:i}=a,s=tl(i,e),[,l]=s?ti(i,e):o.getRange(i),[,u]=o.getRange(a);yield r.removeRange([l,u]),(s||"SequenceExpression"!==i.type)&&(yield sO(a,r,e))}}})},meta:{type:"suggestion",docs:{description:"Disallow useless fallback when spreading in object literals.",recommended:"unopinionated"},fixable:"code",messages:{[lS]:"The empty object is useless."},languages:["js/js"]}},"unicorn/no-useless-length-check":{create:e=>{let t=[],r=new o,n=new o,{sourceCode:a}=e,i=t=>rW(t,e).length===a.getLoc(t).start.column,s=(t,r,n)=>tP(t,{method:r,optionalCall:!1,optionalMember:!1})&&rf(n.left.object,t.callee.object)&&!ou(t.callee.object,e);e.on("BinaryExpression",e=>{if(!lT(e)||!tJ(e.parent))return;let{operator:t}=e;"==="===t?r.add(e):(">"===t||"!=="===t)&&n.add(e)}),e.on("IfStatement",t=>{let r=t.test,n=(e=>{if(e.alternate)return;let{consequent:t}=e;if("BlockStatement"===t.type){if(1!==t.body.length)return;[t]=t.body}if("ForOfStatement"===t.type&&!t.await)return t})(t);if(!n||!lT(r)||![">","!=="].includes(r.operator)||!rf(r.left.object,n.right)||((e,t)=>{let r=t.scopeManager.acquire(e);if(!r)return!1;let[n,o]=t.getRange(e.right);return r.variables.some(e=>e.references.some(e=>{let[r,a]=t.getRange(e.identifier);return r>=n&&a<=o}))})(n,a)||ou(n.right,e))return;let o={loc:{start:a.getLoc(r.left.property).start,end:a.getLoc(r).end},messageId:"for-of"},{start:s,end:l}=a.getLoc(n);return(s.line===l.line||i(t)&&i(n))&&!no(n,e)&&!r9(e,t,[n])&&(o.fix=r=>r.replaceText(t,rQ(a.getText(n),rW(n,e),rW(t,e)))),o}),e.on("LogicalExpression",e=>{tJ(e)&&t.push(e)}),e.on("Program:exit",function*(){for(let i of new o(t.flatMap(e=>(function(e){let{operator:t}=e;return(function e(t){return[t.left,t.right].flatMap(r=>"LogicalExpression"===r.type&&r.operator===t.operator?e(r):[r])})(e).filter((e,o,a)=>(function({node:e,operator:t,siblings:o}){return"||"===t&&r.has(e)&&o.some(t=>s(t,"every",e))||"&&"===t&&n.has(e)&&o.some(t=>s(t,"some",e))})({node:e,operator:t,siblings:[a[o-1],a[o+1]].filter(Boolean)}))})(e))))yield{loc:{start:a.getLoc(i.left.property).start,end:a.getLoc(i).end},messageId:r.has(i)?"zero":"non-zero",fix(t){let{left:r,right:n}=i.parent,o=ti(r,e),a=ti(n,e),s=[];if(r===i?(s[0]=o[0],s[1]=a[0]):(s[0]=o[1],s[1]=a[1]),!ne(e,s))return t.removeRange(s)}}})},meta:{type:"suggestion",docs:{description:"Disallow useless array length check.",recommended:"unopinionated"},fixable:"code",messages:{"for-of":"The non-empty check is useless as `for…of` does not iterate over an empty array.","non-zero":"The non-empty check is useless as `Array#some()` returns `false` for an empty array.",zero:"The empty check is useless as `Array#every()` returns `true` for an empty array."},languages:["js/js"]}},"unicorn/no-useless-promise-resolve-reject":{create:e=>{e.on("CallExpression",t=>{let{expression:r,parent:n}=lC(t);if(!(tP(t,{object:"Promise",methods:["resolve","reject"],optionalCall:!1,optionalMember:!1})&&("ArrowFunctionExpression"===n.type&&n.body===r||"ReturnStatement"===n.type&&n.argument===r||"YieldExpression"===n.type&&!n.delegate&&n.argument===r)))return;let{functionNode:o,isInTryStatement:a}=function(e){let t,r=!1;for(;e;e=e.parent){if(tj(e)){t=e;break}"TryStatement"===e.type&&(r=!0)}return{functionNode:t,isInTryStatement:r}}(t);if(o&&(o.async||function(e){if("CallExpression"===e.parent.type&&"MemberExpression"===e.parent.callee.type&&!e.parent.callee.computed&&"Identifier"===e.parent.callee.property.type){let{callee:{property:t},arguments:r}=e.parent;if(1===r.length&&["then","catch","finally"].includes(t.name)&&r[0]===e||2===r.length&&"then"===t.name&&(r[0]===e||"SpreadElement"!==r[0].type&&r[1]===e))return!0}return!1}(o)))return function(e,t){let{callee:r}=e,n=r.property.name,{parent:o}=lC(e);return{node:r,messageId:n,data:{type:"YieldExpression"===o.type?"yield":"return"},fix:t}}(t,function(e,t,r){if(e.arguments.length>1)return;let{callee:n,arguments:o}=e,{expression:a,parent:i,isAwaited:s}=lC(e),[l]=o;if(l?.type==="SpreadElement")return;let u="reject"===n.property.name,p="YieldExpression"===i.type;if(u&&(t||p&&"ExpressionStatement"!==i.parent.type))return;let c=function({callExpression:e,parent:t,expression:r,isAwaited:n,isReject:o,context:a}){return n&&!o?ti(e,a):o&&"YieldExpression"===t.type?ti(t,a):"ArrowFunctionExpression"===t.type?o?ti(r,a):e:t}({callExpression:e,parent:i,expression:a,isAwaited:s,isReject:u,context:r});if(!r9(r,c,l?[l]:[]))return function(t){let n="ArrowFunctionExpression"===i.type,o=lD(l,r);if(u){if(o||="undefined",o=`throw ${o}`,p)return t.replaceTextRange(ti(i,r),o);if(o+=";",n)return o=`{ ${o} }`,t.replaceTextRange(ti(a,r),o)}else{if(s){var c;let n;return t.replaceTextRange(ti(e,r),(n=lD(c=l,r)||"undefined",c&&"SequenceExpression"!==c.type&&16>i8(c)?`(${n})`:n))}p?o=`yield${o?" ":""}${o}`:"ReturnStatement"===i.type?o=`return${o?" ":""}${o};`:(l?.type==="ObjectExpression"&&(o=`(${o})`),o||="{}")}return t.replaceText(n?e:i,o)}}(t,a,e))})},meta:{type:"suggestion",docs:{description:"Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks",recommended:"unopinionated"},fixable:"code",messages:{resolve:"Prefer `{{type}} value` over `{{type}} Promise.resolve(value)`.",reject:"Prefer `throw error` over `{{type}} Promise.reject(error)`."},languages:["js/js"]}},"unicorn/no-zero-fractions":{create:e=>{let t=(t,r,n)=>{let o=r.match(/^(?<sign>[+-]?)(?<before>[\d_]*)(?<dotAndFractions>\.[\d_]*)(?<after>.*)$/);if(!o)return;let{sign:a,before:i,dotAndFractions:s,after:l}=o.groups,u=s.replaceAll(/[.0_]+$/g,"");u||"YAMLScalar"!==t.type&&("TOMLValue"!==t.type||l)||(u=".0");let p=a+(i||"0")+u+l;if(p===r)return;let c="."===s,{sourceCode:d}=e,m=n[0]+a.length+i.length+s.length,f=!i&&""!==u;return{loc:sp([f?n[0]+a.length:m-Math.max(r.length-p.length,0),m],e),messageId:f?lF:c?lR:lj,*fix(r){let o=p;t.parent?.type==="MemberExpression"&&t.parent.object===t&&i6.test(p)&&!tl(t,e)&&(o=`(${o})`,iB(d.getTokenBefore(t),e,o)&&(o=`;${o}`)),yield r.replaceTextRange(n,o),"Literal"===t.type&&(yield sK(r,t,e))}}};e.on(["Literal","Number","TOMLValue","YAMLScalar"],r=>{if(tm(r)||"Number"===r.type&&"number"==typeof r.value||"YAMLScalar"===r.type&&"number"==typeof r.value&&!r.parent.tag&&!/^[+-]?\.(?:inf|nan)$/i.test(r.raw)||"TOMLValue"===r.type&&"float"===r.kind)return t(r,e.sourceCode.getText(r),e.sourceCode.getRange(r))}),e.on(["Number","Dimension","Percentage","Raw"],function*(r){if("StyleSheet"===e.sourceCode.ast.type)for(let{raw:n,numberRange:o,hasMergingNeighbor:a}of lI(r,e)){if(a)continue;let e=t(r,n,o);e&&(yield e)}})},meta:{type:"suggestion",docs:{description:"Require consistent decimal numbers without redundant zeros.",recommended:"unopinionated"},fixable:"code",messages:{[lF]:"Use a leading zero before the decimal point.",[lj]:"Don't use a zero fraction in the number.",[lR]:"Don't use a dangling dot in the number."},languages:["js/js","yml/yaml","toml/toml","json/json","json/jsonc","json/json5","css/css"]}},"unicorn/prefer-export-from":lq,"unicorn/prefer-native-coercion-functions":{create:e=>{e.on(tI,t=>{if(t.async||t.generator||t.returnType?.type==="TSTypeAnnotation"&&"TSTypePredicate"===t.returnType.typeAnnotation.type||0===t.params.length||"Identifier"!==t.params[0].type||("MethodDefinition"===t.parent.type&&("constructor"===t.parent.kind||"set"===t.parent.kind)||"Property"===t.parent.type&&"set"===t.parent.kind)&&t.parent.value===t)return;let r=function(e){let t;if(t=lJ(e),t?.type==="Identifier"&&t.name===e.params[0].name&&"CallExpression"===e.parent.type&&!e.parent.optional&&e.parent.arguments[0]===e&&"MemberExpression"===e.parent.callee.type&&!e.parent.callee.computed&&!e.parent.callee.optional&&"Identifier"===e.parent.callee.property.type&&l_.has(e.parent.callee.property.name))return{replacementFunction:"Boolean",fix:t=>t.replaceText(e,"Boolean")}}(t)||function(e,t){let r=function(e){let t,r=lJ(e);if(t=e.params[0].name,r?.type==="CallExpression"&&!r.optional&&"Identifier"===r.callee.type&&lz.has(r.callee.name)&&r.arguments[0]?.type==="Identifier"&&r.arguments[0].name===t)return r}(e);if(!r)return;let{name:n}=r.callee,o={replacementFunction:n};return"FunctionDeclaration"===e.type||1!==r.arguments.length||(o.fix=r=>{let o=n;if("Property"===e.parent.type&&e.parent.method&&e.parent.value===e)o=`: ${o}`;else if("MethodDefinition"===e.parent.type)o=` = ${o};`;else{var a;let r;null!==(r=(a=t.sourceCode).getTokenAfter(e))&&a.getRange(r)[0]>=a.getRange(e.parent)[1]&&(lH.has(r.value)||lK.has(r.type))&&(o+=";")}return r.replaceText(e,o)}),o}(t,e);if(!r)return;let{sourceCode:n}=e,{replacementFunction:o,fix:a}=r;return r={node:t,loc:eP(t,n),messageId:lW,data:{functionNameWithKind:eG(t,n),replacementFunction:o}},!a||1!==t.params.length||n.getCommentsInside(t).length>0||("MethodDefinition"===t.parent.type?r.suggest=[{messageId:lV,data:{replacementFunction:o},fix:a}]:r.fix=a),r})},meta:{type:"suggestion",docs:{description:"Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[lW]:"{{functionNameWithKind}} is equivalent to `{{replacementFunction}}`. Use `{{replacementFunction}}` directly.",[lV]:"Replace with `{{replacementFunction}}`."},languages:["js/js"]}},"unicorn/no-document-cookie":{create(e){lQ.listen({context:e})},meta:{type:"problem",docs:{description:"Do not use `document.cookie` directly.",recommended:"unopinionated"},messages:{[lZ]:"Do not use `document.cookie` directly."},languages:["js/js"]}},"unicorn/prefer-add-event-listener":l3,"unicorn/prefer-array-index-of":ue,"unicorn/prefer-blob-reading-methods":{create:e=>{e.on("CallExpression",e=>{if(!tP(e,{methods:["readAsText","readAsArrayBuffer"],argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let t=e.callee.property,r=t.name;return{node:t,messageId:ut,data:{method:r,replacement:"readAsArrayBuffer"===r?"arrayBuffer":"text"}}})},meta:{type:"suggestion",docs:{description:"Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.",recommended:"unopinionated"},messages:{[ut]:"Prefer `Blob#{{replacement}}()` over `FileReader#{{method}}(blob)`."},languages:["js/js"]}},"unicorn/prefer-date-now":{create:e=>{e.on("CallExpression",t=>{if(tP(t,{methods:["getTime","valueOf"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&ua(t.callee.object)){let r=t.callee.property;return ui(t,e,{node:r,messageId:un,data:{method:r.name}})}if(tS(t,{names:["Number","BigInt"],argumentsLength:1,optional:!1},tb)&&ua(t.arguments[0])){let{name:r}=t.callee;return"Number"===r?ui(t,e,{messageId:uo}):ui(t.arguments[0],e)}}),e.on("UnaryExpression",t=>{if(("+"===t.operator||"-"===t.operator)&&ua(t.argument))return ui("-"===t.operator?t.argument:t,e)}),e.on("AssignmentExpression",t=>{if(("-="===t.operator||"*="===t.operator||"/="===t.operator||"%="===t.operator||"**="===t.operator)&&ua(t.right))return ui(t.right,e)}),e.on("BinaryExpression",function*(t){if("-"===t.operator||"*"===t.operator||"/"===t.operator||"%"===t.operator||"**"===t.operator)for(let r of[t.left,t.right])ua(r)&&(yield ui(r,e))})},meta:{type:"suggestion",docs:{description:"Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.",recommended:"unopinionated"},fixable:"code",messages:{[ur]:"Prefer `Date.now()` over `new Date()`.",[un]:"Prefer `Date.now()` over `Date#{{method}}()`.",[uo]:"Prefer `Date.now()` over `Number(new Date())`."},languages:["js/js"]}},"unicorn/dom-node-dataset":uh,"unicorn/prefer-modern-math-apis":{create:e=>{let t=[];e.on("CallExpression",t=>{if(!tP(t,{object:"Math",method:"sqrt",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=uC(t.arguments[0]);if(r.some(e=>!("BinaryExpression"===e.type&&("*"===e.operator&&rf(e.left,e.right)||"**"===e.operator&&tu(e.right,2)))))return;let n=1===r.length?"abs":"hypot",a=new o(1===r.length?[]:r.map(e=>e.parent));return{node:t.callee.property,messageId:ux,data:{replacement:`Math.${n}(…)`,description:"Math.sqrt(…)"},*fix(o,{abort:i}){let{sourceCode:s}=e;for(let r of(yield o.replaceText(t.callee.property,n),a)){let t=s.getTokenAfter(r.left,e=>"Punctuator"===e.type&&"+"===e.value);yield s3(t,",",o,e),yield sO(r,o,e)}for(let t of r){let[r,n]=[ti(t.left,e)[1],s.getRange(t)[1]];if(ne(e,[r,n]))return i();yield o.removeRange([r,n])}}}}),e.on("BinaryExpression",e=>{t.push(e)}),e.on("Program:exit",function*(){for(let r of t)for(let t of uT){let n=t(r,e);n&&(yield n)}})},meta:{type:"suggestion",docs:{description:"Prefer modern `Math` APIs over legacy patterns.",recommended:"unopinionated"},fixable:"code",messages:{[ux]:"Prefer `{{replacement}}` over `{{description}}`."},languages:["js/js"]}},"unicorn/number-literal-case":uA,"unicorn/prefer-number-properties":uB,"unicorn/prefer-reflect-apply":{create:e=>{e.on("CallExpression",t=>{if(!tP(t,{optionalCall:!1,optionalMember:!1})||"Literal"===t.callee.object.type||"ArrayExpression"===t.callee.object.type||"ObjectExpression"===t.callee.object.type)return;let r=((e,t)=>{if("apply"===eK(e.callee)&&2===e.arguments.length&&"Super"!==e.callee.object.type&&uN(e.arguments[0],e.arguments[1]))return r=>r.replaceText(e,uP(e.callee.object,e.arguments[0],e.arguments[1],t))})(t,e)||((e,t)=>{if("call"===eK(e.callee)&&"apply"===eK(e.callee.object)&&"prototype"===eK(e.callee.object.object)&&e.callee.object.object.object?.type==="Identifier"&&"Function"===e.callee.object.object.object.name&&3===e.arguments.length&&uN(e.arguments[1],e.arguments[2]))return r=>r.replaceText(e,uP(e.arguments[0],e.arguments[1],e.arguments[2],t))})(t,e);if(r)return{node:t,messageId:uL,fix:e.sourceCode.getCommentsInside(t).length>0?void 0:r}})},meta:{type:"suggestion",docs:{description:"Prefer `Reflect.apply()` over `Function#apply()`.",recommended:"unopinionated"},fixable:"code",messages:{[uL]:"Prefer `Reflect.apply()` over `Function#apply()`."},languages:["js/js"]}},"unicorn/prefer-set-size":{create:e=>{e.on("MemberExpression",t=>{var r;if(!tL(t,{property:"length",optional:!1})||ns(t))return;let n="ArrayExpression"===(r=t.object).type&&1===r.elements.length&&r.elements[0]?.type==="SpreadElement"?r.elements[0].argument:tP(r,{object:"Array",method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})?r.arguments[0]:void 0;if(n&&oh(n,e))return{node:t.property,messageId:uM,fix:function(e,t,r){let{sourceCode:n}=e,{object:o,property:a}=t;if(!(n.getCommentsInside(o).length>n.getCommentsInside(r).length))return function*(i){yield i.replaceText(a,"size");let s=n.getText(r);i7(r,e)&&(s=`(${s})`),yield i.replaceText(o,s),"ArrayExpression"===o.type&&(yield sK(i,t,e))}}(e,t,n)}})},meta:{type:"suggestion",docs:{description:"Prefer using `Set#size` instead of `Array#length`.",recommended:"unopinionated"},fixable:"code",messages:{[uM]:"Prefer using `Set#size` instead of `Array#length`."},languages:["js/js"]}},"unicorn/prefer-string-replace-all":{create:e=>{e.on("CallExpression",t=>{let r,n,a=((e,t)=>{let r;if(!tP(e,{method:"join",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!tP(e.callee.object,{method:"split",argumentsLength:1,optionalCall:!1,optionalMember:!1})||r6(t,e))return;let n=e.callee.object;if(oj(n.callee.object,t))return;let[o]=n.arguments,[a]=e.arguments,i=td(o);if("string"==typeof i){if(0===i.length)return;r=t5(i)}else if(!(r=(e=>{if(!tf(e)||e.regex.flags.includes("y"))return;let t=uZ(e);if(!t||u1(t)||0===u0(t))return;let{pattern:r,flags:n}=e.regex;return`/${r}/${n.includes("g")?n:`g${n}`}`})(o)))return;let s=td(a);if("string"==typeof s)return`${ts(n.callee.object,t)}.replaceAll(${r}, ${t5(s.replaceAll("$","$$$$"))})`})(t,e);if(a)return r4(e,{node:t.callee.property,messageId:u_,fix:e=>e.replaceText(t,a)},t);if(!tP(t,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1})||tP(t,{method:"replace",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&tf(r=t.arguments[0])&&r.regex.flags.includes("g")&&!r.regex.flags.includes("y")&&(e=>{if(!e.startsWith("[")||!e.endsWith("]")||e.startsWith("[^"))return;let t=new o,r=e.slice(1,-1);for(let e=0;e<r.length;e++){let n=r[e],o=!1;if("\\"===n&&(n=r[++e],o=!0,!n)||"-"===n&&!o&&0!==e&&e!==r.length-1||"]"===n&&!o&&0!==e||!uq.has(n))return;t.add(n)}return t})(r.regex.pattern)?.size>=8&&tp(n=t.arguments[1])&&n.value===uU)return;let{arguments:i,callee:{property:s}}=t;if(oj(t.callee.object,e))return;let[l]=i;if(!rA(l,e)?.global)return;let u=s.name,p=function(e){if(!tf(e))return;let t=uZ(e);if(!t)return;let{flags:r}=e.regex;if(!function(e){for(let t of e)if(uJ.has(t))return!1;return!0}(r))return;let n="alternative"===t.type?uY(t.body):uX(t);if(n)return"'"+n+"'"}(l);if("replaceAll"===u){if(!p)return;return{node:l,messageId:uz,data:{replacement:p.length<20?p:"a string literal"},fix:e=>e.replaceText(l,p)}}return{node:s,messageId:uV,*fix(e){yield e.insertTextAfter(s,"All"),p&&(yield e.replaceText(l,p))}}})},meta:{type:"suggestion",docs:{description:"Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.",recommended:"unopinionated"},fixable:"code",messages:{[uV]:"Prefer `String#replaceAll()` over `String#replace()`.",[uz]:"This pattern can be replaced with {{replacement}}.",[u_]:"Prefer `String#replaceAll()` over `String#split().join()`."},languages:["js/js"]}},"unicorn/prefer-string-slice":{create:e=>{e.on("CallExpression",t=>{if(!tP(t,{methods:["substr","substring"]})||oj(t.callee.object,e))return;let r=t.callee.property.name;if(!("substring"===r&&(e=>{if(!tP(e,{method:"substring",argumentsLength:2}))return;let[t,r]=e.arguments;if(u2(t)&&u2(r)&&1===Math.abs(t.value-r.value))return t.value<r.value?t:r;let n=(e=>{if("BinaryExpression"===e.type&&"-"===e.operator&&tu(e.right,1))return e.left})(t);return u3(r,t)??(u3(t,r)?r:void 0)??(n&&rf(n,r)?t:void 0)})(t)))return{node:t,messageId:r,*fix(n,{abort:o}){if(yield n.replaceText(t.callee.property,"slice"),0!==t.arguments.length){if(t.arguments.length>2||t.arguments.some(e=>"SpreadElement"===e.type))return o();yield("substr"===r?function*({node:e,fixer:t,context:r,abort:n}){let o=e.arguments,[a,i]=o;if(!i)return;let s=rN(a,r);if(s?.value===0){let o=((e,t,r)=>{let n,{sourceCode:o}=r;if(!("BinaryExpression"!==e.type||"-"!==e.operator||!(tm(n=e.right)&&Number.isSafeInteger(n.value)&&n.value>0)||!u9(e.left)||!("Identifier"===t.type||tp(t))||!rf(e.left.object,t)||u6(o,((e,t)=>{let[r,n]=ti(e,t),o=t.sourceCode.getTokenByRangeStart(r),a=t.sourceCode.getTokenBefore(o);return[t.sourceCode.getRange(a)[1],n]})(e,r))))return`-${e.right.raw}`})(i,e.callee.object,r);if(o)return void(yield u4(t,i,o,r,n));if(tm(i)||u9(i))return;let a=u8(i);if("number"==typeof a)return void(yield u4(t,i,String(Math.max(0,a)),r,n));let s=u5(i,r);return s?void(yield t.replaceTextRange(ti(i,r),`Math.max(0, ${s})`)):n()}if(o.every(e=>tm(e))){let e;return void(yield(e=String(Math.trunc(a.value)+Math.trunc(i.value)),u4(t,i,e,r,n)))}return n()}:function*({node:e,fixer:t,context:r,abort:n}){let[o,a]=e.arguments,i=u8(o);if(!a){if(u9(o))return;if(void 0!==i)return void(yield u4(t,o,String(Math.max(0,i)),r,n));let e=ti(o,r);return yield t.insertTextBeforeRange(e,"Math.max(0, "),void(yield t.insertTextAfterRange(e,")"))}let s=u8(a);if(void 0!==i&&void 0!==s){let e=[Math.max(0,i),Math.max(0,s)];i>s&&e.reverse(),e[0]!==i&&(yield u4(t,o,String(e[0]),r,n)),e[1]!==s&&(yield u4(t,a,String(e[1]),r,n));return}if(0===i||0===s){let e=0===s?ts(o,r):u5(a,r);return e?(yield u4(t,o,"0",r,n),void(yield u4(t,a,`Math.max(0, ${e})`,r,n))):n()}return n()})({node:t,fixer:n,context:e,abort:o})}}}})},meta:{type:"suggestion",docs:{description:"Prefer `String#slice()` over `String#substr()` and `String#substring()`.",recommended:"unopinionated"},fixable:"code",messages:{substr:"Prefer `String#slice()` over `String#substr()`.",substring:"Prefer `String#slice()` over `String#substring()`."},languages:["js/js"]}},"unicorn/prefer-string-trim-start-end":{create:e=>{e.on("CallExpression",t=>{if(!tP(t,{methods:["trimLeft","trimRight"],argumentsLength:0,optionalCall:!1})||oj(t.callee.object,e))return;let r=t.callee.property,n=r.name,o="trimLeft"===n?"trimStart":"trimEnd";return{node:r,messageId:u7,data:{method:n,replacement:o},fix:e=>e.replaceText(r,o)}})},meta:{type:"suggestion",docs:{description:"Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.",recommended:"unopinionated"},fixable:"code",messages:{[u7]:"Prefer `String#{{replacement}}()` over `String#{{method}}()`."},languages:["js/js"]}},"unicorn/no-unreadable-iife":{create:e=>{e.on("CallExpression",t=>{if("ArrowFunctionExpression"!==t.callee.type||"BlockStatement"===t.callee.body.type||!tl(t.callee.body,e))return;let{body:r}=t.callee,n={node:t,loc:sp(ti(r,e),e),messageId:pe};return!function(e,t){let{sourceCode:r}=t,[n,o]=ti(e,t),[a,i]=r.getRange(e);return r.getCommentsInside(e.parent).some(e=>{let[t,s]=r.getRange(e);return t>=n&&s<=o&&(t<a||s>i)})}(r,e)&&(n.suggest=[{messageId:pt,fix:t=>t.replaceTextRange(ti(r,e),`{ return ${e.sourceCode.getText(r)}; }`)}]),n})},meta:{type:"suggestion",docs:{description:"Disallow unreadable IIFEs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[pe]:"IIFE with parenthesized arrow function body is considered unreadable.",[pt]:"Use a block statement body."},languages:["js/js"]}},"unicorn/throw-new-error":{create:e=>{e.on("CallExpression",t=>{if("Decorator"===t.parent.type||"TaggedTemplateExpression"===t.parent.type&&t.parent.tag===t)return;let{callee:r}=t;if(!(t.optional||nu(r))&&("Identifier"===r.type&&pn.test(r.name)||"MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&pn.test(r.property.name))&&!tL(r,{object:"Data",property:"TaggedError",computed:!1}))return{node:t,messageId:pr,fix:r=>sG(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Require `new` when creating an error.",recommended:"unopinionated"},fixable:"code",messages:{[pr]:"Use `new` when creating an error."},languages:["js/js"]}},"unicorn/escape-case":{create:e=>{let t="lowercase"===e.options[0];e.on("StyleSheet",r=>{let{sourceCode:n}=e,o=[];return E.tokenize(n.text,(e,a,i)=>{if(e===E.tokenTypes.Comment)return;let s=pp({node:r,original:n.text.slice(a,i),regex:pu,lowercase:t,fix:(e,t)=>e.replaceTextRange([a,i],t)});s&&o.push({...s,loc:{start:n.getLocFromIndex(a),end:n.getLocFromIndex(i)}})}),o}),e.on("String",r=>{if("StyleSheet"!==e.sourceCode.ast.type)return pp({node:r,original:e.sourceCode.getText(r),lowercase:t})}),e.on(["TOMLValue","TOMLQuoted"],r=>{if("string"===r.kind&&"basic"===r.style)return pp({node:r,original:e.sourceCode.getText(r),regex:pl,lowercase:t})}),e.on("YAMLScalar",r=>{if("double-quoted"===r.style)return pp({node:r,original:e.sourceCode.getText(r),regex:pl,lowercase:t})}),e.on("Literal",e=>{if(tp(e))return pp({node:e,original:e.raw,lowercase:t})}),e.on("Literal",e=>{if(tf(e))return pp({node:e,original:e.raw,regex:ps,lowercase:t})}),e.on("TemplateElement",r=>{if(!tW(r.parent))return pp({node:r,original:nL(r,e),lowercase:t,fix:(t,n)=>s2(r,n,e,t)})})},meta:{type:"suggestion",docs:{description:"Require escape sequences to use uppercase or lowercase values.",recommended:"unopinionated"},fixable:"code",schema:[{enum:["uppercase","lowercase"],description:"The case style for escape sequences."}],defaultOptions:["uppercase"],messages:{[po]:"Use uppercase characters for the value of the escape sequence.",[pa]:"Use lowercase characters for the value of the escape sequence."},languages:["js/js","yml/yaml","json/json","json/jsonc","json/json5","css/css","toml/toml"]}},"unicorn/prefer-unicode-code-point-escapes":{create:e=>{e.on("Literal",e=>tp(e)&&"JSXAttribute"!==e.parent.type?pC(e,e.raw):tf(e)?function(e){let t,{raw:r}=e,{pattern:o,flags:a}=(t=r.lastIndexOf("/"),{pattern:r.slice(1,t),flags:r.slice(t+1)}),{fixed:i,hasReplacement:s,hasCodePointEscape:l}=pT(o,{isRegex:!0,supportsNestedCharacterClasses:a.includes("v")}),u=a.includes("u")||a.includes("v");if(!s&&(u||!l))return;let p=s?i:o,c=a.includes("u")||a.includes("v")?a:`${a}u`,d=`/${p}/${c}`;return u?{node:e,messageId:pc,fix:t=>t.replaceText(e,d)}:!function(e,t){try{return new n(e,t),!0}catch{return!1}}(p,c)?{node:e,messageId:pc}:{node:e,messageId:pc,suggest:[{messageId:pd,fix:t=>t.replaceText(e,d)}]}}(e):void 0),e.on("TemplateElement",t=>{if(!tW(t.parent))return pC(t,nL(t,e),{allowOctal:!1,fix:(r,n)=>s2(t,n,e,r)})})},meta:{type:"suggestion",docs:{description:"Prefer Unicode code point escapes over legacy escape sequences.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[pc]:"Prefer Unicode code point escapes.",[pd]:"Use Unicode code point escapes and add the `u` flag."},languages:["js/js"]}},"unicorn/prefer-prototype-methods":{create:function(e){let{sourceCode:t}=e,r=[];e.on("CallExpression",e=>{r.push(e)}),e.onExit("Program",function*(n){let o=new i;for(let{node:e,path:r}of new te(t.getScope(n)).iterateGlobalReferences(Object.fromEntries(pD.map(e=>[e,{[te.READ]:!0}]))))o.set(e,r);for(let t of r)yield function(e,{context:t,globalReferences:r}){let n;tP(e,{object:"Reflect",method:"apply",minimumArguments:1,optionalCall:!1,optionalMember:!1})?n=e.arguments[0]:tP(e,{methods:["apply","bind","call"],optionalCall:!1,optionalMember:!1})&&(n=e.callee.object);let{isGlobalReference:o,constructorName:a,methodName:i}=function(e,{context:t,globalReferences:r}){if(!e)return;if(r.has(e))return{isGlobalReference:!0,constructorName:"Object",methodName:r.get(e).at(-1)};if(!tL(e,{optional:!1}))return;let n=e.object;if(tw(n)||tA(n))return{constructorName:"ArrayExpression"===n.type?"Array":"Object",methodName:eK(e,t.sourceCode.getScope(e))}}(n,{context:t,globalReferences:r})??{};if(a)return{node:n,messageId:i?"known-method":"unknown-method",data:{constructorName:a,methodName:i},*fix(r,{abort:s}){let l=o?n:n.object;t.sourceCode.getCommentsInside(l).length>0&&s(),yield r.replaceText(l,o?`${a}.prototype.${i}`:`${a}.prototype`),yield sK(r,e,t)}}}(t,{context:e,globalReferences:o})})},meta:{type:"suggestion",docs:{description:"Prefer borrowing methods from the prototype instead of the instance.",recommended:"unopinionated"},fixable:"code",messages:{"known-method":"Prefer using `{{constructorName}}.prototype.{{methodName}}`.","unknown-method":"Prefer using method from `{{constructorName}}.prototype`."},languages:["js/js"]}},"unicorn/error-message":{create:e=>{e.on(["CallExpression","NewExpression"],t=>{if(!(tS(t,{names:pw,optional:!1},tE)&&e.sourceCode.isGlobalReference(t.callee)))return;let r=t.callee.name,n=pj.has(r)?pj.get(r):0,o=t.arguments;if(o.some((e,t)=>t<=n&&"SpreadElement"===e.type))return;let a=o[n];if(!a)return{node:t,messageId:pA,data:{constructorName:r}};if("ArrayExpression"===a.type||"ObjectExpression"===a.type)return{node:a,messageId:pI};let i=((e,t)=>{let r=rx(e),n=rT(r);if(n||rB(r,t)){var o;return("Identifier"===(o=r).type&&(o=eD(t.sourceCode.getScope(o),o).defs[0].node.init),"MemberExpression"===o.type&&"CallExpression"===o.object.type&&"MemberExpression"===o.object.callee.type&&!o.object.callee.computed&&"Identifier"===o.object.callee.object.type&&"Object"===o.object.callee.object.name&&"Identifier"===o.object.callee.property.type&&"freeze"===o.object.callee.property.name&&((e,t)=>{if(!e)return!1;if("ObjectExpression"===e.type)return!rB(e,t);if("Identifier"!==e.type)return!1;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs.length===1?r.defs[0]:void 0;return n?.type==="Variable"&&n.parent?.kind==="const"&&n.node.id===n.name&&n.node.init?.type==="ObjectExpression"&&!rB(n.node.init,t)&&r.references.every(t=>t.init||t.identifier===e)})(o.object.arguments[0],t))?eJ(r,t.sourceCode.getScope(e)):n?rP(r,t):rN(r,t)}return eJ(r,t.sourceCode.getScope(e))})(a,e);if(!i)return;let{value:s}=i;return"string"!=typeof s?{node:a,messageId:pI}:""===s?{node:a,messageId:pk}:void 0})},meta:{type:"problem",docs:{description:"Enforce passing a `message` value when creating a built-in error.",recommended:"unopinionated"},messages:{[pA]:"Pass a message to the `{{constructorName}}` constructor.",[pk]:"Error message should not be an empty string.",[pI]:"Error message should be a string."},languages:["js/js"]}},"unicorn/no-instanceof-builtins":pO,"unicorn/prefer-type-error":{create:e=>{e.on("ThrowStatement",e=>{let t="BlockStatement"===e.parent.type&&1===e.parent.body.length?e.parent:e,r=t.parent;if(!(tT(e.argument,{name:"Error"})&&"IfStatement"===r.type&&pH(r.test)&&r.consequent===t))return;let n=e.argument.callee;return{node:n,messageId:pU,fix:e=>e.insertTextBefore(n,"Type")}})},meta:{type:"suggestion",docs:{description:"Enforce throwing `TypeError` in type checking conditions.",recommended:"unopinionated"},fixable:"code",messages:{[pU]:"`new Error()` is too unspecific for a type check. Use `new TypeError()` instead."},languages:["js/js"]}},"unicorn/consistent-destructuring":{create:e=>{let{sourceCode:t}=e,n=new r,o=[],a=[],i=e=>{let r=rx(e.object);if(e.computed||"Identifier"!==e.property.type||!["Identifier","ThisExpression"].includes(r.type))return;let n=t.getScope(e);a.push({propertyName:e.property.name,rootIdentifierName:"Identifier"===r.type?r.name:void 0,rootVariable:"Identifier"===r.type?eD(n,r):void 0,thisScopeBoundary:"ThisExpression"===r.type?pY(r):void 0,start:t.getRange(e)[0],scope:n})},s=e=>{switch(e.type){case"MemberExpression":i(e);break;case"AssignmentPattern":s(e.left);break;case"RestElement":s(e.argument);break;case"ObjectPattern":for(let t of e.properties)s("Property"===t.type?t.value:t.argument);break;case"ArrayPattern":for(let t of e.elements)t&&s(t)}};e.on("AssignmentExpression",e=>{s(e.left)}),e.on(["ForInStatement","ForOfStatement"],e=>{"VariableDeclaration"!==e.left.type&&s(e.left)}),e.on("UpdateExpression",e=>{"MemberExpression"===e.argument.type&&i(e.argument)}),e.on("UnaryExpression",e=>{"delete"===e.operator&&"MemberExpression"===e.argument.type&&i(e.argument)}),e.on("VariableDeclarator",e=>{let r;if(!("ObjectPattern"===e.id.type&&"const"===e.parent.kind&&e.init&&("Identifier"===(r=e.init).type||"ThisExpression"===r.type)))return;let o="Identifier"===e.init.type?e.init:void 0,a={scope:t.getScope(e),object:e.init,rootIdentifierName:o?.name,rootVariable:o&&eD(t.getScope(e),o),thisScopeBoundary:"ThisExpression"===e.init.type?pY(e.init):void 0,objectPattern:e.id},i=t.getText(e.init);n.set(i,[...n.get(i)??[],a])});let l=e=>{let r,o;if((o=e).computed||tS(o.parent,void 0,tE)&&o.parent.callee===o||"TaggedTemplateExpression"===o.parent.type&&o.parent.tag===o||ns(o))return;let i=rx(e.object),s=n.get(t.getText(i));if(!s)return;let l=t.getScope(e),u="Identifier"===i.type?i:void 0,p=u&&eD(l,u),c="ThisExpression"===i.type?pY(i):void 0,d=t.getText(e.property);for(let n of s.toReversed()){let o=pQ(n.objectPattern.properties.filter(e=>pZ(e)&&"Identifier"===e.value.type),d,l,t);if(o&&p0({declaration:n,memberExpressionNode:e,memberScope:l,memberRootIdentifier:u,memberRootVariable:p,memberThisScopeBoundary:c,memberExpressionWrites:a,sourceCode:t})){r=o;break}}if(!r||((e,t)=>{let r=e,{parent:n}=e;for(;n&&!p3(n);){if(p2(n,r,e,t))return!0;r=n,n=n.parent}return!1})(e,t))return;if("MemberExpression"===e.parent.type||t.getCommentsInside(e).length>0)return{node:e,messageId:pK};let m=t.getText(e),f=r.value.name;return{node:e,messageId:pK,suggest:[{messageId:pG,data:{expression:m,property:f},fix:t=>t.replaceText(e,f)}]}};e.on("MemberExpression",e=>{o.push(e)}),e.onExit("Program",function*(){for(let e of o){let t=l(e);t&&(yield t)}})},meta:{type:"suggestion",docs:{description:"Use destructured variables over properties.",recommended:!1},hasSuggestions:!0,messages:{[pK]:"Use destructured variables over properties.",[pG]:"Replace `{{expression}}` with destructured property `{{property}}`."},languages:["js/js"]}},"unicorn/new-for-builtins":{create:e=>{p7.listen({context:e}),ce.listen({context:e}),ct.listen({context:e}),cr.listen({context:e})},meta:{type:"suggestion",docs:{description:"Enforce correct use of `new` for builtin constructors.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{enforce:"Use `new {{name}}()` instead of `{{name}}()`.",disallow:"Use `{{name}}()` instead of `new {{name}}()`.",disallowCallOrNew:"`{{name}}` is not a function or constructor.",[p9]:"Use `String(new Date())` instead of `Date()`.",[p6]:"Switch to `String(new Date())`."},languages:["js/js"]}},"unicorn/prefer-single-call":cs,"unicorn/no-process-exit":{create:e=>{if(0===e.sourceCode.lines[0].indexOf("#!"))return;let t=0,r=!1,n=[],o=e=>tP(e,{object:"process",methods:["on","once","addListener","prependListener","prependOnceListener"],minimumArguments:1,optionalCall:!1,optionalMember:!1});e.on("CallExpression",e=>{tO(e)&&cu(e.arguments[0])&&(r=!0)}),e.on("ImportDeclaration",e=>{"Literal"===e.source.type&&cu(e.source)&&(r=!0)}),e.on("CallExpression",e=>{o(e)&&t++}),e.onExit("CallExpression",e=>{o(e)&&t--}),e.on("CallExpression",e=>{0===t&&tP(e,{object:"process",method:"exit",optionalCall:!1,optionalMember:!1})&&n.push(e)}),e.onExit("Program",function*(){if(!r)for(let e of n)yield{node:e,messageId:cl}})},meta:{type:"suggestion",docs:{description:"Disallow `process.exit()`.",recommended:"unopinionated"},messages:{[cl]:"Only use `process.exit()` in CLI apps. Throw an error instead."},languages:["js/js"]}},"unicorn/no-static-only-class":{create:function(e){e.on(["ClassDeclaration","ClassExpression"],t=>{if(!(t.superClass||t.decorators&&t.decorators.length>0||"ClassBody"!==t.body.type||0===t.body.body.length||t.body.body.some(e=>!function(e){let{private:t,static:r,declare:n,readonly:o,override:a,accessibility:i,decorators:s,key:l}=e;return(!!cv(e)||"MethodDefinition"===e.type)&&!!r&&!t&&"PrivateIdentifier"!==l.type&&!(n||o||a||void 0!==i||Array.isArray(s)&&s.length>0)}(e))))return{node:t,loc:function(e,t){let{sourceCode:r}=t,{body:n}=e,o=r.getTokenBefore(n),{start:a}=r.getLoc(e),{end:i}=r.getLoc(o);return{start:a,end:i}}(t,e),messageId:ch,fix:function(e,t){let{type:r,id:n,body:o,declare:a,abstract:i,implements:s,parent:l}=e;if(a||i||Array.isArray(s)&&s.length>0||"ClassExpression"===r&&n)return;let u="ClassDeclaration"===e.type&&"ExportDefaultDeclaration"===e.parent.type&&e.parent.declaration===e;if(u&&n)return;let{sourceCode:p}=t;for(let e of o.body){if(cE(e.key,n,t))return;let r=e.value&&p.getText(e.value),o=!!r&&cb.some(e=>r.includes(e));if(cv(e)&&(e.typeAnnotation||o||cE(e,n,t)))return}return function*(n){let a=p.getFirstToken(e);if(t0(a,{expected:{type:"Keyword",value:"class"},ruleId:"no-static-only-class"}),u||"ClassExpression"===r){let i="=>"===p.getTokenBefore(a).value;if("ClassExpression"===r&&"ReturnStatement"===l.type&&p.getLoc(o).start.line!==p.getLoc(l).start.line&&p.text.slice(p.getRange(a)[1],p.getRange(o)[0]).trim()){yield n.replaceText(a,"{");let e=p.getFirstToken(o);yield n.remove(e)}else yield n.replaceText(a,i?"(":""),yield s_(a,t,n);if(i&&(yield n.insertTextAfter(o,")")),u){let r=p.getLastToken(e),o=p.getTokenAfter(r);iB(r,t,o?.value??"")&&(yield n.insertTextAfter(r,";"))}}else yield n.replaceText(a,"const"),yield n.insertTextBefore(o,"= "),yield n.insertTextAfter(o,";");for(let e of o.body)yield function*(e,t,r){let{sourceCode:n}=t,o=n.getFirstToken(e);t0(o,{expected:{type:"Keyword",value:"static"},ruleId:"no-static-only-class"}),yield r.remove(o),yield s_(o,t,r);let a=cv(e)?n.getLastToken(e):n.getTokenAfter(e),i=eI(a);if(cv(e)){let{key:t,value:o}=e;if(o){let e=n.getTokenAfter(t,cx);yield r.replaceText(e,":")}else i?yield r.insertTextBefore(a,": undefined"):yield r.insertTextAfter(e,": undefined")}yield i?r.replaceText(a,","):r.insertTextAfter(e,",")}(e,t,n)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Disallow classes that only have static members.",recommended:"unopinionated"},fixable:"code",messages:{[ch]:"Use an object instead of a class with only static members."},languages:["js/js"]}},"unicorn/no-unreadable-array-destructuring":cC,"unicorn/no-useless-spread":{create:e=>{let{sourceCode:t}=e;e.on(["ArrayExpression","ObjectExpression"],r=>{if(!("SpreadElement"===r.parent.type&&r.parent.argument===r&&("ObjectExpression"===r.type&&"ObjectExpression"===r.parent.parent.type&&r.parent.parent.properties.includes(r.parent)||"ArrayExpression"===r.type&&("ArrayExpression"===r.parent.parent.type&&r.parent.parent.elements.includes(r.parent)||tS(r.parent.parent,void 0,tE)&&r.parent.parent.arguments.includes(r.parent)))))return;let n=r.parent,o=t.getFirstToken(n),a=n.parent.type,i={node:o,messageId:cD,data:{argumentType:"ArrayExpression"===r.type?"array":"object",parentDescription:cM[a]}};return"NewExpression"===a&&cP(r)&&tT(n.parent,{names:cB,argumentsLength:1,allowSpreadElement:!0})?i:{...i,*fix(i){let s;yield i.remove(o),yield sO(r,i,e);let l=t.getFirstToken(r);yield i.remove(l);let[u,p]=t.getLastTokens(r,2);if(yield i.remove(p),ek(u)&&(yield i.remove(u)),tw(r)||tA(r)){let e=t.getTokenAfter(n);ek(e)&&(yield i.remove(e))}if("CallExpression"===a||"NewExpression"===a)for(let[e,n]of(s=t.getFirstToken(r),r.elements.map((e,n,o)=>{if(n===o.length-1){let e=t.getLastToken(r,{skip:1});return ek(e)?e:void 0}let a=t.getTokenAfter(e||s,ek);return s=a,a})).entries())null===r.elements[e]&&(yield i.insertTextBefore(n,"undefined"))}}}),e.on("ObjectExpression",r=>{if(!("ObjectExpression"===r.type&&r.properties.length>0&&r.properties.every(e=>"SpreadElement"===e.type&&"ObjectExpression"!==e.argument.type)))return;let n=r.parent;if(!tP(n,{object:"Object",method:"assign",minimumArguments:2,optionalMember:!1,optionalCall:!1}))return;let o=n.arguments.indexOf(r),a=n.arguments.slice(0,o).some(e=>"SpreadElement"!==e.type);if(o<=0||!a)return;let i={node:t.getFirstToken(r.properties[0]),messageId:cj};return t.getCommentsInside(r).length>0?i:{...i,suggest:[{messageId:cF,fix:t=>t.replaceText(r,r.properties.map(t=>ts(t.argument,e)).join(", "))}]}}),e.on("NewExpression",e=>{if(tT(e,{names:cB,argumentsLength:1,allowSpreadElement:!0})&&"SpreadElement"===e.arguments[0].type&&"ArrayExpression"!==e.arguments[0].argument.type)return{node:e.arguments[0],messageId:cI,data:{constructorName:`new ${e.callee.name}(…)`}}}),e.on("ArrayExpression",t=>{if(!cP(t))return;let{parent:r}=t;if(!("ForOfStatement"===r.type&&r.right===t||"YieldExpression"===r.type&&r.delegate&&r.argument===t||(tT(r,{names:cB,argumentsLength:1})||tP(r,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tP(r,{objects:["Array",...nM],method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tP(r,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1}))&&r.arguments[0]===t))return;let n="",o=cw;switch(r.type){case"ForOfStatement":o=cA;break;case"YieldExpression":o=ck;break;case"NewExpression":n=`new ${r.callee.name}(…)`;break;case"CallExpression":n=`${r.callee.object.name}.${r.callee.property.name}(…)`}return{node:t,messageId:o,data:{parentDescription:n},fix:r=>c$(r,t,e)}}),e.on("ArrayExpression",t=>{if(!cP(t))return;let r=t.elements[0].argument,n=!!tP(r,{methods:cN,optionalCall:!1,optionalMember:!1})&&os(r.callee.object,e)&&os(r,e);if(!n&&!(!ol(r,e)&&(tP(r,{methods:cL,optionalCall:!1,optionalMember:!1})?!cO(r,e):tP(r,{method:"concat",optionalCall:!1,optionalMember:!1})?!("Identifier"===r.callee.object.type&&"Iterator"===r.callee.object.name||cO(r,e)):tP(r,{method:"split",optionalCall:!1,optionalMember:!1})||tP(r,{object:"Object",methods:["keys","values"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||"AwaitExpression"===r.type&&tP(r.argument,{object:"Promise",methods:["all","allSettled"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tP(r,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||tT(r,{name:"Array"}))))return;let o={node:t,messageId:cR};return tT(r,{name:"Array"})||tP(r,{method:"slice",optionalCall:!1,optionalMember:!1})&&!n?o:Object.assign(o,{fix:r=>c$(r,t,e)})})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary spread.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[cD]:"Spread an {{argumentType}} literal in {{parentDescription}} is unnecessary.",[cw]:"`{{parentDescription}}` accepts an iterable as an argument, it's unnecessary to convert to an array.",[cA]:"`for…of` can iterate over an iterable, it's unnecessary to convert to an array.",[ck]:"`yield*` can delegate to an iterable, it's unnecessary to convert to an array.",[cI]:"`{{constructorName}}` accepts a single iterable argument, spreading is misleading.",[cj]:"`Object.assign(…)` source object with only spread properties is unnecessary.",[cR]:"Unnecessarily cloning an array.",[cF]:"Remove the object literal wrapper."},languages:["js/js"]}},"unicorn/no-useless-switch-case":{create:e=>{let t=nR(e.physicalFilename);e.on("SwitchStatement",function*(r){let{cases:n}=r;if(!(n.length<2)&&null===n.at(-1).test)for(let r=n.length-2;r>=0;r--){let o=n[r];if(!cW(o))break;if(t&&cV(o))continue;let a={node:o,loc:function(e,t){let{sourceCode:r}=t,n=e.test||r.getFirstToken(e),o=r.getTokenAfter(n,ej);return{start:r.getLoc(e).start,end:r.getLoc(o).end}}(o,e),messageId:cU};e0(o.test,e.sourceCode)||0!==e.sourceCode.getCommentsInside(o).length||(a.suggest=[{messageId:cq,fix:e=>e.remove(o)}]),yield a}})},meta:{type:"suggestion",docs:{description:"Disallow useless case in switch statements.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[cU]:"Useless case in switch statement.",[cq]:"Remove this case."},languages:["js/js"]}},"unicorn/no-useless-undefined":de,"unicorn/numeric-separators-style":da,"unicorn/prefer-array-find":dw,"unicorn/prefer-array-flat-map":{create:e=>{e.on("CallExpression",t=>{if(!(tP(t,{method:"flat",optionalCall:!1,optionalMember:!1})&&(0===t.arguments.length||1===t.arguments.length&&"Literal"===t.arguments[0].type&&"1"===t.arguments[0].raw)&&tP(t.callee.object,{method:"map",optionalCall:!1})))return;let r=t.callee.object;if(tq(r.callee.object,dj)||od(r.callee.object,e))return;let{sourceCode:n}=e,o=r.callee.property,a=r9(e,t,[r])||t.typeArguments||t.typeParameters||r.typeArguments||r.typeParameters?void 0:function*(r){yield sZ(r,t,e),yield r.replaceText(o,"flatMap")};return{node:t,loc:{start:n.getLoc(o).start,end:n.getLoc(t).end},messageId:dA,fix:a}}),e.on("CallExpression",t=>{let r;if(!tP(t,{method:"flatMap",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||t.typeArguments||t.typeParameters)return;let n=t.callee.object;if(!tP(n,{method:"filter",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||n.typeArguments||n.typeParameters||nu(n.callee.object)||ou(n.callee.object,e))return;let{sourceCode:o}=e;if(r6(e,t))return;let[a]=n.arguments,[i]=t.arguments;if(!dF(a)||!dF(i)||!("ArrayExpression"===(r=i.body).type&&r.elements.length>1))return;let[s]=a.params,[l]=i.params;if(!aE(s,l))return;let u=se(n.callee.object,e),p=o.getText(s),c=function(e,t){if(tl(e,t))return ts(e,t);let r=t.sourceCode.getText(e);return dR.has(e.type)?`(${r})`:r}(a.body,e),d=o.getText(i.body);return r4(e,{node:t.callee.property,messageId:dk,suggest:[{messageId:dI,fix:e=>e.replaceText(t,`${u}.flatMap(${p} => ${c} ? ${d} : [])`)}]},t)})},meta:{type:"suggestion",docs:{description:"Prefer `.flatMap(…)` over `.map(…).flat()` and `.filter(…).flatMap(…)`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[dA]:"Prefer `.flatMap(…)` over `.map(…).flat()`.",[dk]:"Prefer a single `.flatMap(…)` over `.filter(…).flatMap(…)`.",[dI]:"Replace `.filter(…).flatMap(…)` with a single `.flatMap(…)`."},languages:["js/js"]}},"unicorn/prefer-array-flat":dq,"unicorn/prefer-array-some":d_,"unicorn/prefer-default-parameters":{create:e=>{let{sourceCode:t}=e,r=[],n=new o,a=(e,r)=>{let[o]=e.defs;if(1!==e.defs.length||o.node!==r||"Parameter"!==o.type&&"Variable"!==o.type||"Variable"===o.type&&("var"===r.parent.kind||"ExportNamedDeclaration"===r.parent.parent.type)||n.has(e))return;let a=o.name,i="ArrayPattern"===a.parent.type||"Property"===a.parent.type&&"ObjectPattern"===a.parent.parent.type;if(!i&&("Parameter"!==o.type||r.params.at(-1)!==a||"BlockStatement"===r.body.type&&r.body.body.some(e=>"use strict"===e.directive)))return;let s=e.references.filter(e=>!e.init);if(0===s.length||s.some(e=>!e.isReadOnly()))return;let l=s.map(e=>e.identifier.parent),[u]=l;if(!l.some((e,t)=>"LogicalExpression"!==e.type||"??"!==e.operator&&"||"!==e.operator||e.left!==s[t].identifier||"Literal"!==e.right.type||e.right.regex||e.operator!==u.operator||!Object.is(e.right.value,u.right.value)))return{node:a,messageId:i?dG:dK,suggest:[{messageId:dX,*fix(e,{abort:n}){if(t.getCommentsInside(a).length>0||l.some(e=>t.getCommentsInside(e).length>0))return n();let o=a.typeAnnotation?t.getText(a.typeAnnotation):"",s=`${a.name}${o} = ${t.getText(u.right)}`;for(let n of(!i&&dQ(t,r)&&(s=`(${s})`),yield e.replaceText(a,s),l))yield e.replaceText(n,t.getText(n.left))}}]}};function*i(e){for(let r of t.getDeclaredVariables(e))yield a(r,e)}let s=(e,o,a,i)=>{let s=r.at(-1),l=((e,t,r="=")=>{if(e&&t&&"Identifier"===e.type){if("="===r&&"LogicalExpression"===t.type&&("||"===t.operator||"??"===t.operator)&&"Identifier"===t.left.type&&"Literal"===t.right.type)return{assignedIdentifier:e,parameterIdentifier:t.left,defaultValue:t.right};if(("||="===r||"??="===r)&&"Literal"===t.type)return{assignedIdentifier:e,parameterIdentifier:e,defaultValue:t}}})(o,a,i);if(!s||!l||e.parent!==s.body||s.body.body.some(e=>"use strict"===e.directive))return;let{assignedIdentifier:u,parameterIdentifier:{name:p},defaultValue:{raw:c}}=l,{name:d}=u,m="ExpressionStatement"===e.type;if(m&&d!==p)return;let f=t.getScope(e),g=eD(f,p);if(!g)return;let{references:y}=g,{params:h}=s,x=h.at(-1);if(x?.type!=="Identifier"||x.name!==p)return;let b=(d===p?g:eD(f,d)).defs.some(e=>"Parameter"===e.type&&e.name!==x);if(((e,t,r)=>{for(let n of t.body.body){if(n===r)break;if(dZ(e,n))return!0}return!1})(t,s,e)||m&&y[0].identifier!==o||!m&&y.length>1||b)return;let v=m?x.typeAnnotation:u.typeAnnotation,E=v?`${d}${t.getText(v)}`:d,S=dQ(t,s)?`(${E} = ${c})`:`${E} = ${c}`;return n.add(g),{node:e,messageId:dJ,suggest:[{messageId:dH,*fix(r,{abort:n}){if(t.getCommentsInside(e).length>0||t.getCommentsInside(x).length>0)return n();yield r.replaceText(x,S),yield((e,t,r)=>{let{line:n}=t.getLoc(r).start,{column:o}=t.getLoc(r).end,a=t.getText(r),i=t.lines[n-1];if(i.trim()===a)return e.removeRange([t.getIndexFromLoc({line:n,column:0}),t.getIndexFromLoc({line:n+1,column:0})]);if(" "===i[o]){let[n,o]=t.getRange(r);return e.removeRange([n,o+1])}return e.remove(r)})(r,t,e)}}]}};e.on(tI,e=>{r.push(e)}),e.onExit(tI,function*(e){r.pop(),yield*i(e)}),e.onExit("VariableDeclarator",i),e.on("AssignmentExpression",e=>{if("ExpressionStatement"===e.parent.type&&e.parent.expression===e)return s(e.parent,e.left,e.right,e.operator)}),e.on("VariableDeclarator",e=>{if("VariableDeclaration"===e.parent.type&&1===e.parent.declarations.length)return s(e.parent,e.id,e.init)})},meta:{type:"suggestion",docs:{description:"Prefer default parameters and destructuring defaults over reassignment and fallback expressions.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[dJ]:"Prefer default parameters over reassignment.",[dH]:"Replace reassignment with default parameter.",[dK]:"Prefer a default parameter over fallback expressions.",[dG]:"Prefer a destructuring default over fallback expressions.",[dX]:"Move the default value to the declaration."},languages:["js/js"]}},"unicorn/prefer-logical-operator-over-ternary":{create:e=>{let{sourceCode:t}=e;e.on("ConditionalExpression",r=>{let{test:n,consequent:o,alternate:a}=r;if(tc(o)&&tc(a)||t.getAncestors(r).every(e=>"WithStatement"!==e.type)&&void 0!==me(o,e)&&void 0!==me(a,e))return;let i=function(e,t){let{sourceCode:r}=t;if(r.getAncestors(e).some(e=>"WithStatement"===e.type))return;let{test:n,consequent:o,alternate:a}=e,i=me(o,t),s=me(a,t),l=void 0!==i;if(l===(void 0!==s))return;let u=i??s,p=l?a:o;if(!mt(p,t))return;let c=!1===i||!0===s,d=function(e){let{parserServices:t}=e.sourceCode;return!t?.esTreeNodeToTSNodeMap&&!nR(e.physicalFilename)}(t);if(!c&&!mt(d?function(e,t){for(;"Identifier"===e.type;){let r=d7(e,t);if(!r)break;e=r.node.init}return e}(n,t):n,t))return;let m={node:e,messageId:d0};return 0===r.getCommentsInside(e).length&&d&&(m.fix=r=>d6({fixer:r,context:t,conditionalExpression:e,left:n,right:p,operator:u?"||":"&&",negateLeft:c})),m}(r,e);if(i)return i;let s=function(e,t){let{test:r,consequent:n,alternate:o}=e,a=function(e,t){let r=mo(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=mo(e.left),o=mo(e.right);if(n&&o&&d9(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&ma(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&ma(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}(r,t.sourceCode);if(!a||r6(t,e))return;let{reference:i}=a;if(a.isTrueWhenNullish&&d9(i,o,t.sourceCode))return mr({context:t,conditionalExpression:e,left:i,right:n,operators:["??"]});if(!a.isTrueWhenNullish&&d9(i,n,t.sourceCode))return mr({context:t,conditionalExpression:e,left:i,right:o,operators:["??"]});let s=a.isTrueWhenNullish?n:o,l=a.isTrueWhenNullish?o:n;if(!tV(s)||!tL(l)||l.optional||!rf(rx(i),rx(l.object))||function(e){let t=e,{parent:r}=t;for(;rh(r)&&r.expression===t;)r=(t=r).parent;return"UnaryExpression"===r.type&&"delete"===r.operator&&r.argument===t||"CallExpression"===r.type&&r.callee===t||"TaggedTemplateExpression"===r.type&&r.tag===t}(e))return;let u=function(e,t){let{sourceCode:r}=t,n=ni(e,t),[o,a]=r.getRange(e),[i,s]=n;return r.text.slice(o,i)+(e.computed?"?.[":"?.")+r.text.slice(s,a)}(l,t);return r4(t,{node:e,messageId:d1,suggest:[{messageId:d3,fix(r){let n=u;return iB(t.sourceCode.getTokenBefore(e),t,n)&&(n=`;${n}`),r.replaceText(e,n)}}]})}(r,e);return s||(d9(n,o,t)?mr({context:e,conditionalExpression:r,left:n,right:a}):"UnaryExpression"===n.type&&"!"===n.operator&&n.prefix&&d9(n.argument,a,t)?mr({context:e,conditionalExpression:r,left:n.argument,right:o}):void 0)})},meta:{type:"suggestion",docs:{description:"Prefer using a logical operator over a ternary.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[d0]:"Prefer using a logical operator over a ternary.",[d1]:"Prefer using optional chaining over a ternary.",[d2]:"Switch to `{{operator}}` operator.",[d3]:"Switch to optional chaining."},languages:["js/js"]}},"unicorn/prefer-optional-catch-binding":{create:e=>{e.on("CatchClause",t=>{let r=t.param;if(!r)return;let{sourceCode:n}=e;if(n.getDeclaredVariables(r.parent).some(e=>e.references.length>0)||ml(r))return;let{type:o,name:a,parent:i}=r,s=n.getCommentsInside(r).length>0;return{node:r,messageId:"Identifier"===o?mi:ms,data:{name:a},fix:s?void 0:function*(e){let t=n.getTokenBefore(r);t0(t,{test:eR,expected:"(",ruleId:"prefer-optional-catch-binding"});let o=n.getTokenAfter(r);t0(o,{test:eF,expected:")",ruleId:"prefer-optional-catch-binding"}),yield e.remove(t),yield e.remove(r),yield e.remove(o);let[,a]=n.getRange(o),[s]=n.getRange(i.body),l=n.text.slice(a,s),u=l.length-l.trimStart().length;0!==u&&(yield e.removeRange([a,a+u]))}}})},meta:{type:"suggestion",docs:{description:"Prefer omitting the `catch` binding parameter.",recommended:"unopinionated"},fixable:"code",messages:{[mi]:"Remove unused catch binding `{{name}}`.",[ms]:"Remove unused catch binding."},languages:["js/js"]}},"unicorn/prefer-regexp-test":mP,"unicorn/prefer-set-has":mX,"unicorn/prefer-string-raw":{create:e=>{e.on("Literal",t=>{if(!tp(t)||function(e){let{parent:t}=e,{type:r}=t;return tC(t)||["Property","PropertyDefinition","MethodDefinition","AccessorProperty"].includes(r)&&!t.computed&&t.key===e||["TSAbstractPropertyDefinition","TSAbstractMethodDefinition","TSAbstractAccessorProperty","TSPropertySignature","TSMethodSignature"].includes(r)&&t.key===e||["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration"].includes(r)&&t.source===e||"ImportAttribute"===r&&(t.key===e||t.value===e)||"ImportSpecifier"===r&&t.imported===e||"ExportSpecifier"===r&&(t.local===e||t.exported===e)||"ExportAllDeclaration"===r&&t.exported===e||"JSXAttribute"===r&&t.value===e||"TSEnumMember"===r&&(t.initializer===e||t.id===e)||"TSModuleDeclaration"===r&&t.id===e||"TSExternalModuleReference"===r&&t.expression===e||"TSLiteralType"===r&&t.literal===e||"TSImportType"===r&&t.source===e}(t)||mY(t))return;let{sourceCode:r}=e,{raw:n}=t;if("\\"===n.at(-2)||!n.includes("\\\\")||n.includes("`")||n.includes("${")||r.getLoc(t).start.line!==r.getLoc(t).end.line)return;let o=m0(n.slice(1,-1),n.charAt(0));if(o===t.value)return{node:t,messageId:mZ,*fix(r){yield sK(r,t,e),yield r.replaceText(t,`String.raw\`${o}\``)}}}),e.on("TemplateLiteral",t=>{if(!("TaggedTemplateExpression"===t.parent.type&&t.parent.quasi===t||t.quasis.every(({value:{cooked:e,raw:t}})=>e===t)||t.quasis.some(({value:{cooked:e,raw:t}})=>"\\"===e.at(-1)||m0(t)!==e)||mY(t)))return{node:t,messageId:mZ,*fix(r){for(let n of(yield sK(r,t,e),yield r.insertTextBefore(t,"String.raw"),t.quasis)){let{cooked:t,raw:o}=n.value;t!==o&&(yield s2(n,t,e,r))}}}}),e.on("TaggedTemplateExpression",t=>{let{quasi:r,tag:n,parent:o}=t,{sourceCode:a}=e;if(!tL(n,{object:"String",property:"raw",optional:!1})||!a.isGlobalReference(n.object)||r.quasis.some(e=>e.value.raw.includes("\\")))return;let i=a.getText(r),s=r.expressions.length>0||/[\n\r\u{2028}\u{2029}]/u.test(i)?i:`'${i.slice(1,-1).replaceAll("'",()=>String.raw`\'`)}'`;return{node:n,messageId:mQ,*fix(r,{abort:i}){a.getCommentsInside(n).length>0&&i();let l=a.getTokenBefore(t);iB(l,e,s)&&(yield r.insertTextBefore(t,";")),"ReturnStatement"!==o.type&&"ThrowStatement"!==o.type||ax(l,t.quasi,e)||tl(t,e)||(yield sz(r,o,e)),"YieldExpression"!==o.type||o.delegate||o.argument!==t||ax(l,t.quasi,e)||tl(t,e)||(yield r.insertTextBefore(t,"("),yield r.insertTextAfter(t,")")),yield r.replaceText(t.quasi,s),yield sO(t.tag,r,e),yield r.remove(t.tag)}}})},meta:{type:"suggestion",docs:{description:"Prefer using the `String.raw` tag to avoid escaping `\\`.",recommended:"unopinionated"},fixable:"code",messages:{[mZ]:"`String.raw` should be used to avoid escaping `\\`.",[mQ]:"Using `String.raw` is unnecessary as the string does not contain any `\\`."},languages:["js/js"]}},"unicorn/prefer-switch":m6,"unicorn/require-number-to-fixed-digits-argument":{create:e=>{e.on("CallExpression",t=>{if(!tP(t,{method:"toFixed",argumentsLength:0,optionalCall:!1})||"NewExpression"===t.callee.object.type)return;let{sourceCode:r}=e,[n,o]=r.getLastTokens(t,2);return{loc:{start:r.getLoc(n).start,end:r.getLoc(o).end},messageId:m4,fix:r=>sU(r,t,"0",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the digits argument with `Number#toFixed()`.",recommended:"unopinionated"},fixable:"code",messages:{[m4]:"Missing the digits argument."},languages:["js/js"]}},"unicorn/template-indent":{create:e=>{let{sourceCode:t}=e,r={...e.options[0]},n=(e=>{let t=new o,r=[e.ast];for(;r.length>0;){let n=r.pop();if("TemplateLiteral"===n.type){let{start:{line:r},end:{line:o}}=e.getLoc(n);for(let e=r+1;e<=o;e++)t.add(e)}r.push(...t1(n,e.visitorKeys))}return t})(t);r.comments=r.comments.map(e=>e.toLowerCase());let a=new s,i=o=>{let i;if("TemplateLiteral"!==o.type||a.has(o))return;a.add(o);let s="__PLACEHOLDER__"+Math.random(),l=o.quasis.map(e=>t.getText(e).slice(1,e.tail?-1:-2)).join(s),u=l.match(/\r?\n/);if(!u)return;let p=u[0],c=t.getLoc(o),[d]=t.lines[c.start.line-1].match(/^\s*/);i="string"==typeof r.indent?r.indent:"number"==typeof r.indent?" ".repeat(r.indent):((e,t,r,n)=>{if(""===r){let r;return rJ(ft(e.lines,t)).indent||rJ(m7(r=ft(n.split(/\r?\n/)))).indent||rJ(r).indent||" "}return r.startsWith(" ")?" ":" "})(t,n,d,l);let m=m7(l).replaceAll(RegExp(`^${p}|${p}[ ]*$`,"g"),""),f=p+function(e,t=1,r={}){let{indent:n=" ",includeEmptyLines:o=!1}=r;if("string"!=typeof e)throw TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if("number"!=typeof t)throw TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if("string"!=typeof n)throw TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);return 0===t?e:e.replace(o?/^/gm:/^(?!\s*$)/gm,n.repeat(t))}(m,1,{indent:d+i})+p+d;if(f!==l)return{node:o,messageId:fe,fix:t=>f.split(s).map((r,n)=>s2(o.quasis[n],r,e,t))}};e.on("TemplateLiteral",e=>{if((e=>{if(r.comments.length>0){let n=t.getTokenBefore(e,{includeComments:!0});if(n?.type==="Block"&&r.comments.includes(n.value.trim().toLowerCase()))return!0}return!!(mY(e)||r.tags.length>0&&tW(e,r.tags))||!!(r.functions.length>0&&"CallExpression"===e.parent.type&&e.parent.arguments.includes(e)&&tq(e.parent.callee,r.functions))})(e))return i(e)}),e.on(r.selectors,e=>i(e))},meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation.",recommended:!0},fixable:"code",schema:fr,defaultOptions:[{tags:["outdent","dedent","gql","sql","html","styled"],functions:["dedent","stripIndent"],selectors:[],comments:["HTML","indent"]}],messages:{[fe]:"Templates should be properly indented."},languages:["js/js"]}},"unicorn/no-single-promise-in-promise-methods":{create:e=>{e.on("CallExpression",t=>{if(!(tP(t,{object:"Promise",methods:cm,optionalMember:!1,optionalCall:!1,argumentsLength:1})&&"ArrayExpression"===t.arguments[0].type&&1===t.arguments[0].elements.length&&t.arguments[0].elements[0]&&"SpreadElement"!==t.arguments[0].elements[0].type))return;let r=t.callee.property.name,n={node:t.arguments[0],messageId:cp,data:{method:r}},{sourceCode:o}=e,a=!cg(o,t);if("AwaitExpression"===t.parent.type&&t.parent.argument===t&&("all"!==r||tk(t.parent.parent)))return a&&(n.fix=r=>r.replaceText(t,cf(t,e))),n;return"all"===r?(n.fix=((e,t)=>{let{sourceCode:r}=t;if(cg(r,e))return;let n=e.parent;if("AwaitExpression"!==n.type||n.argument!==e)return;let o=(e=>{let{parent:t}=e;return"VariableDeclarator"===t.type&&t.init===e&&cy(t.id)?t.id:"AssignmentExpression"===t.type&&t.right===e&&cy(t.left)&&tk(t.parent)?t.left:void 0})(n);if(o){if(cg(r,o))return;return function*(n){yield n.replaceText(o,r.getText(o.elements[0])),yield n.replaceText(e,cf(e,t))}}let a=n.parent;if("MemberExpression"===a.type&&a.computed&&tu(a.property,0)&&a.object===n&&("VariableDeclarator"===a.parent.type&&a.parent.init===a||"AssignmentExpression"===a.parent.type&&a.parent.right===a)&&!cg(r,a))return r=>r.replaceText(a,`await ${cf(e,t)}`)})(t,e),n):(n.suggest=[a&&{messageId:cc,fix:r=>{let[n]=t.arguments[0].elements,o=ts(n,e);return tl(n,e)||"Identifier"===n.type||"MemberExpression"===n.type||(o=`(${o})`),iB(e.sourceCode.getTokenBefore(t),e,o)&&(o=`;${o}`),r.replaceText(t,o)}},{messageId:cd,fix:function*(e){let r=t.callee.property;yield e.replaceText(r,"resolve");let[n]=t.arguments,a=o.getFirstToken(n),[i,s]=o.getLastTokens(n,2);yield e.remove(a),yield e.remove(s),ek(i)&&(yield e.remove(i))}}].filter(Boolean),n)})},meta:{type:"suggestion",docs:{description:"Disallow passing single-element arrays to `Promise` methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[cp]:"Wrapping single-element array with `Promise.{{method}}()` is unnecessary.",[cc]:"Use the value directly.",[cd]:"Switch to `Promise.resolve(…)`."},languages:["js/js"]}},"unicorn/no-await-in-promise-methods":{create:e=>{e.on("AwaitExpression",t=>{let r=(e=>{for(let t=e;t.parent;t=t.parent){let{parent:e}=t;if(tj(e)||"AwaitExpression"===e.type)return;if("ArrayExpression"===e.type&&fi(e.parent))return t}})(t);if(!r)return;let n={node:t,messageId:fn,data:{method:r.parent.parent.callee.property.name}};return r===t&&(n.suggest=[{messageId:fo,*fix(r){let n=e.sourceCode.getFirstToken(t);yield r.remove(n),yield s_(n,e,r)}}]),n})},meta:{type:"suggestion",docs:{description:"Disallow using `await` in `Promise` method parameters.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[fn]:"Promise in `Promise.{{method}}()` should not be awaited.",[fo]:"Remove `await`."},languages:["js/js"]}},"unicorn/no-negation-in-equality-check":{create:e=>{e.on("BinaryExpression",t=>{let{operator:r,left:n}=t;if(!("BinaryExpression"===t.type&&fu.has(t.operator)&&fp(n))||fp(n.argument))return;let{sourceCode:o}=e,a=o.getFirstToken(n),i=`${r.startsWith("!")?"=":"!"}${r.slice(1)}`;return{node:a,messageId:fs,suggest:[{messageId:fl,data:{operator:i},*fix(s){yield sK(s,t,e);let l=o.getTokenAfter(a),{parent:u}=t;("ReturnStatement"===u.type||"ThrowStatement"===u.type)&&!tl(t,e)&&(ax(o.getFirstToken(u),l,e)||(yield sz(s,u,e))),yield s.remove(a),iB(o.getTokenBefore(a),e,l.value)&&(yield s.insertTextAfter(a,";"));let p=o.getTokenAfter(n,e=>"Punctuator"===e.type&&e.value===r);yield s.replaceText(p,i)}}]}})},meta:{type:"problem",docs:{description:"Disallow negated expression in equality check.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[fs]:"Negated expression is not allowed in equality check.",[fl]:"Switch to '{{operator}}' check."},languages:["js/js"]}},"unicorn/no-unnecessary-slice-end":{create(e){fc(e,{methods:["slice"],messageId:fd})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.",recommended:"unopinionated"},fixable:"code",messages:{[fd]:"Passing `{{description}}` as the `end` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-lonely-if":{create:e=>{e.on("IfStatement",t=>{if(fq(t)&&("BlockStatement"===t.parent.type&&1===t.parent.body.length&&t.parent.body[0]===t&&fq(t.parent.parent)&&t.parent.parent.consequent===t.parent||fq(t.parent)&&t.parent.consequent===t))return{node:t,messageId:fU,fix:function(e,t){let{sourceCode:r}=t;return n=>{var o,a;let i=("BlockStatement"===e.parent.type?e.parent:e).parent,s={...i,...fW(i,r)},l={...e,...fW(e,r)},u=fJ(s,r),p=fH(s,t,r),c=f_(fz(fJ(l,r)),fH(l,t,r)),d=function(e,t,r,n){let o=[...n.getRange(e)];if("BlockStatement"===t.type)return o;let a=n.getLastToken(t);if(eN(a)){let t=n.getTokenAfter(e);t&&iB(a,r,t.value)&&(o[1]=n.getRange(t)[0])}return o}(i,l.consequent,t,r),m={outerConditionGap:s.openingBraceToken?fz(fV(s.closingParenthesisToken,s.openingBraceToken,r)):"",outerLeadingContent:s.openingBraceToken?fz(fV(s.openingBraceToken,l.ifToken,r)):fz(fV(s.closingParenthesisToken,l.ifToken,r)),outerTrailingContent:s.openingBraceToken?fz(fV(l,s.closingBraceToken,r)):""},f=(o=m.outerConditionGap,a=m.outerLeadingContent,o.trimStart().startsWith("//")?{leadingStatementText:fz(a).trimStart(),conditionSuffixText:o}:{leadingStatementText:fz(f_(o,a)).trimStart(),conditionSuffixText:""}),{leadingStatementText:g}=f,y=function({outerIfStatement:e,inner:t,replacementRange:r,sourceCode:n,consequentTextPieces:o,outerConditionGapTextPieces:a}){let{outerTrailingContent:i}=o,{conditionSuffixText:s}=a;if("BlockStatement"===t.consequent.type){let e=fV(t.closingParenthesisToken,t.openingBraceToken,n),r=fV(t.openingBraceToken,t.closingBraceToken,n);return`${s}${e}{${r}${i}}`}let l=fV(t.closingParenthesisToken,t.consequent,n),u=`${s}${l}${((e,t)=>{let[r,n]=t.getRange(e);return t.text.slice(r,n)})(t.consequent,n)}${i}`;return`${u}${((e,t,r)=>{let[,n]=r.getRange(e);if(t[1]===n)return"";let o=r.text.slice(n,t[1]);return""===o.trim()?o.includes("\n")?`;${o}`:";":`;${o}`})(e,r,n)}`}({outerIfStatement:i,inner:l,replacementRange:d,sourceCode:r,consequentTextPieces:m,outerConditionGapTextPieces:f});return n.replaceTextRange(d,`${g}if${u}(${p} && ${c})${y}`)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Disallow `if` statements as the only statement in `if` blocks without `else`.",recommended:"unopinionated"},fixable:"code",messages:{[fU]:"Unexpected `if` as the only statement in a `if` block without `else`."},languages:["js/js"]}},"unicorn/no-magic-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!tP(t,{method:"flat",argumentsLength:1,optionalCall:!1}))return;let[r]=t.arguments,n=i4(r);if("number"!=typeof n||1===n)return;let{sourceCode:o}=e,{openingParenthesisToken:a,closingParenthesisToken:i}=rp(t,e);if(!(r6(e,[o.getRange(a)[1],o.getRange(i)[0]])||od(t.callee.object,e)))return{node:r,messageId:fK}})},meta:{type:"suggestion",docs:{description:"Disallow a magic number as the `depth` argument in `Array#flat(…).`",recommended:"unopinionated"},messages:{[fK]:"Magic number as depth is not allowed."},languages:["js/js"]}},"unicorn/no-negated-condition":{create:e=>{e.on(["IfStatement","ConditionalExpression"],t=>{if("IfStatement"===t.type&&(!t.alternate||"IfStatement"===t.alternate.type))return;let{test:r}=t;if("UnaryExpression"===r.type&&"!"===r.operator||"BinaryExpression"===r.type&&("!="===r.operator||"!=="===r.operator))return{node:r,messageId:fG,*fix(n,{abort:o}){if(yield function*(e,t,r){let{sourceCode:n}=r,{test:o}=t;if("UnaryExpression"===o.type){let a=n.getFirstToken(o);"IfStatement"===t.type&&(yield sO(o.argument,e,r)),yield e.remove(a);return}let a=n.getTokenAfter(o.left,e=>"Punctuator"===e.type&&e.value===o.operator);yield e.replaceText(a,"="+a.value.slice(1))}(n,t,e),yield function*(e,t,r,n){let{sourceCode:o}=r,a="IfStatement"===t.type,[i,s]=[t.consequent,t.alternate].map(e=>{let t=ti(e,r);o.getCommentsAfter({range:t}).length>0&&n();let i=o.getCommentsBefore({range:t})[0];i&&(t[0]=o.getRange(i)[0]);let s=o.text.slice(...t);return a&&"BlockStatement"!==e.type&&(s=`{${s}}`),{range:t,text:s}});i.text!==s.text&&(yield e.replaceTextRange(o.getRange(i),s.text),yield e.replaceTextRange(o.getRange(s),i.text))}(n,t,e,o),"ConditionalExpression"!==t.type||"UnaryExpression"!==r.type)return;yield sK(n,t,e);let{sourceCode:a}=e,{parent:i}=t,[s,l]=a.getFirstTokens(r,2);"ReturnStatement"!==i.type&&"ThrowStatement"!==i.type||i.argument!==t||ax(s,l,e)||tl(t,e)||tl(r,e)?iB(a.getTokenBefore(t),e,l.value)&&(yield n.insertTextBefore(t,";")):yield sz(n,i,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow negated conditions.",recommended:"unopinionated"},fixable:"code",messages:{[fG]:"Unexpected negated condition."},languages:["js/js"]}},"unicorn/no-object-as-default-parameter":{create:e=>{e.on("AssignmentPattern",e=>{let t=rx(e.right),r="TSParameterProperty"===e.parent.type?e.parent:e,n=r.parent;if(!("ObjectExpression"===t.type&&t.properties.length>0&&tj(n)&&n.params.includes(r)))return;let{left:o}=e;return"Identifier"===o.type?{node:o,messageId:fX,data:{parameter:o.name}}:{node:t,messageId:fY}})},meta:{type:"problem",docs:{description:"Disallow the use of objects as default parameters.",recommended:"unopinionated"},messages:{[fX]:"Do not use an object literal as default for parameter `{{parameter}}`.",[fY]:"Do not use an object literal as default."},languages:["js/js"]}},"unicorn/prefer-negative-index":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if("MemberExpression"!==r.callee.type)return;let n=function(e){let t,{callee:r,arguments:n}=e;if(fQ.has(r.property.name))return{method:r.property.name,target:r.object,argumentsNodes:n};if("call"!==r.property.name&&"apply"!==r.property.name)return;let o=f0(r.object);if(!fQ.has(o)||(t=r.object.object,!(tw(t)||"slice"===o&&tu(t,"")||"prototype"===f0(t)&&"Identifier"===t.object.type&&fQ.get(o).supportObjects.has(t.object.name))))return;let[a,i]=n;return"call"===r.property.name?{method:o,target:a,argumentsNodes:n.slice(1)}:i?.type==="ArrayExpression"?{method:o,target:a,argumentsNodes:i.elements}:void 0}(r);if(!n)return;let{method:o,target:a,argumentsNodes:i}=n,{argumentsIndexes:s}=fQ.get(o),l=s.map(e=>(function e(t,r){let n;if(!t)return;let{type:o,operator:a,left:i,right:s}=t=rx(t);if("BinaryExpression"===o&&"-"===a&&tm(n=rx(s))&&n.value>0&&Number.isSafeInteger(n.value))return cG(i,r)?i:e(i,r)})(i[e],a)).filter(Boolean);if(0!==l.length)return{node:r,messageId:fZ,data:{method:o},*fix(r,{abort:n}){for(let o of l){let a=function(e,t,r){let[n,o]=ti(e,r);if(!ne(r,[n,o]))return t.removeRange([n,o+r.sourceCode.text.slice(o).match(/\S|$/).index])}(o,r,e);if(!a)return n();yield a;let i=ta(o,e).at(-1)??t.getLastToken(o),s=t.getTokenAfter(i),l=t.getTokenAfter(s);s?.type==="Punctuator"&&"-"===s.value&&l?.type==="Numeric"&&/^\s+$/u.test(t.text.slice(t.getRange(s)[1],t.getRange(l)[0]))&&(yield r.removeRange([t.getRange(s)[1],t.getRange(l)[0]]))}}}})},meta:{type:"suggestion",docs:{description:"Prefer negative index over `.length - index` when possible.",recommended:"unopinionated"},fixable:"code",messages:{[fZ]:"Prefer negative index over length minus index for `{{method}}`."},languages:["js/js"]}},"unicorn/prefer-node-protocol":{create:e=>{e.on("Literal",t=>{if(!(["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","ImportExpression","TSImportType"].includes(t.parent.type)&&t.parent.source===t||(tP(t.parent,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tO(t.parent))&&t.parent.arguments[0]===t))return;let{value:r}=t;if(!("string"==typeof r&&!r.startsWith(f5)&&f2(r)&&f2(`${f5}${r}`)))return;let n=e.sourceCode.getRange(t)[0]+1;return{node:t,messageId:f3,data:{moduleName:r},fix:e=>e.insertTextAfterRange([n,n],f5)}})},meta:{type:"suggestion",docs:{description:"Prefer using the `node:` protocol when importing Node.js builtin modules.",recommended:"unopinionated"},fixable:"code",messages:{[f3]:"Prefer `node:{{moduleName}}` over `{{moduleName}}`."},languages:["js/js"]}},"unicorn/consistent-date-clone":{create:e=>{e.on("NewExpression",t=>{if(!tT(t,{name:"Date",argumentsLength:1}))return;let[r]=t.arguments;if(!tP(r,{method:"getTime",argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let{sourceCode:n}=e,o={node:r,loc:{start:n.getLoc(r.callee.property).start,end:n.getLoc(r).end},messageId:f8};return r9(e,r,[ti(r.callee.object,e)])||(o.fix=t=>sZ(t,r,e)),o})},meta:{type:"suggestion",docs:{description:"Prefer passing `Date` directly to the constructor when cloning.",recommended:"unopinionated"},fixable:"code",messages:{[f8]:"Unnecessary `.getTime()` call."},languages:["js/js"]}},"unicorn/no-accessor-recursion":{create:e=>{let{sourceCode:t}=e;e.on("ThisExpression",e=>{let r=((e,t)=>{for(let r=e.getScope(t);r;r=r.upper){if("class"===r.type)return;if("function"===r.type&&"ArrowFunctionExpression"!==r.block.type)return r}})(t,e);if(!r)return;let n=r.block.parent;if(["Property","MethodDefinition"].includes(n?.type)&&!n.computed&&["set","get"].includes(n.kind)&&f6(n.key)&&("get"===n.kind&&(ge(e,n)&&!((e,t)=>{if(!gt(e,t))return!1;let{parent:r}=e.parent;return"UpdateExpression"!==r.type&&("AssignmentExpression"!==r.type||"="===r.operator)})(e,n)||"VariableDeclarator"===e.parent.type&&e.parent.init===e&&"ObjectPattern"===e.parent.id.type&&e.parent.id.properties.some(e=>"Property"===e.type&&!e.computed&&f7(e.key,n.key)))||"set"===n.kind&&gt(e,n)))return{node:e.parent,messageId:f9,data:{kind:n.kind}}})},meta:{type:"problem",docs:{description:"Disallow recursive access to `this` within getters and setters.",recommended:"unopinionated"},defaultOptions:[],messages:{[f9]:"Disallow recursive access to `this` within {{kind}}ters."},languages:["js/js"]}},"unicorn/prefer-import-meta-properties":{create:function(e){let{sourceCode:t}=e;e.on("MetaProperty",function*(e){if("MetaProperty"!==e.type||"import"!==e.meta.name||"meta"!==e.property.name)return;let r=e.parent;if(!tL(r,{properties:["url","filename"],computed:!1,optional:!1}))return;let n=r.property.name;if("url"===n){if(ga(r.parent,t)&&r.parent.arguments[0]===r)return void(yield a(r.parent,{reportFilenameNode:!0}));if(tT(r.parent,{name:"URL",minimumArguments:1,maximumArguments:2})){var o;let e=r.parent,n=e.parent;if(1===e.arguments.length&&e.arguments[0]===r&&ga(n,t)&&n.arguments[0]===e)return void(yield a(n,{reportFilenameNode:!0}));2===e.arguments.length&&"Literal"===(o=e.arguments[0]).type&&("."===o.value||"./"===o.value)&&e.arguments[1]===r&&ga(n,t)&&n.arguments[0]===e&&(yield i(n,"dirname"))}return}function*a(e,{reportFilenameNode:r=!1}={}){let{parent:n}=e;if(gi(n,t)&&n.arguments[0]===e)return void(yield i(n,"dirname"));if(r&&(yield i(e,"filename")),"VariableDeclarator"===n.type&&n.init===e&&"Identifier"===n.id.type&&"VariableDeclaration"===n.parent.type&&"const"===n.parent.kind)for(let e of eD(t.getScope(n.id),n.id).references){if(!e.isReadOnly())continue;let{parent:r}=e.identifier;gi(r,t)&&r.arguments[0]===e.identifier&&(yield i(r,"dirname"))}}function i(e,r){return{node:e,messageId:"dirname"===r?gr:gn,fix:0===t.getCommentsInside(e).length?t=>t.replaceText(e,`import.meta.${r}`):void 0}}"filename"===n&&(yield a(r))})},meta:{type:"suggestion",docs:{description:"Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.",recommended:!1},fixable:"code",messages:{[gr]:"Do not construct dirname.",[gn]:"Do not construct filename using `fileURLToPath()`."},languages:["js/js"]}},"unicorn/no-unnecessary-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!(tP(t,{method:"flat",argumentsLength:1,optionalCall:!1})&&tu(t.arguments[0],1))||od(t.callee.object,e))return;let[r]=t.arguments;return{node:r,messageId:gs,fix:n=>{let{sourceCode:o}=e,{openingParenthesisToken:a,closingParenthesisToken:i}=rp(t,e),[s]=o.getRange(a),[,l]=o.getRange(i);return ne(e,[s,l])?sW(n,r,e):n.replaceTextRange([s,l],"()")}}})},meta:{type:"suggestion",docs:{description:"Disallow using `1` as the `depth` argument of `Array#flat()`.",recommended:"unopinionated"},fixable:"code",messages:{[gs]:"Passing `1` as the `depth` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-unnecessary-array-splice-count":{create(e){fc(e,{methods:["splice","toSpliced"],messageId:gl,checkArrayReceiver:!0})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.",recommended:"unopinionated"},fixable:"code",messages:{[gl]:"Passing `{{description}}` as the `{{argumentName}}` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-useless-error-capture-stack-trace":{create:e=>{let t=[],r=[];e.on(["ClassDeclaration","ClassExpression"],e=>{t.push(e),r.push(e)}),e.onExit(["ClassDeclaration","ClassExpression"],()=>{t.pop(),r.pop()}),e.on(["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"],e=>{r.push(e)}),e.onExit(["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"],()=>{r.pop()}),e.on("CallExpression",n=>{let o,a=t.at(-1);if(!(a?.superClass&&"Identifier"===a.superClass.type&&pw.includes(a.superClass.name)&&e.sourceCode.isGlobalReference(a.superClass)&&(o=r.at(-1),o&&"MethodDefinition"===o.parent.type&&"constructor"===o.parent.kind&&o.parent.value===o&&a.body.body.includes(o.parent))&&tP(n,{object:"Error",method:"captureStackTrace",argumentsLength:2,optionalMember:!1})&&e.sourceCode.isGlobalReference(n.callee.object)))return;let[i,s]=n.arguments;if("ThisExpression"!==i.type||!((e,t,r)=>{if("MetaProperty"===e.type&&"Identifier"===e.meta.type&&"new"===e.meta.name&&"Identifier"===e.property.type&&"target"===e.property.name||tL(e,{property:"constructor",computed:!1,optional:!1})&&"ThisExpression"===e.object.type)return!0;if("Identifier"!==e.type||!t.id)return!1;let n=eD(r.sourceCode.getScope(e),e);return n&&1===n.defs.length&&"ClassName"===n.defs[0].type&&n.defs[0].node===t})(s,a,e))return;let l={node:n,messageId:gu},u="ChainExpression"===n.parent.type?n.parent.parent:n.parent;return"ExpressionStatement"===u.type&&"BlockStatement"===u.parent.type&&0===e.sourceCode.getCommentsInside(u).length&&(l.fix=e=>e.remove(u)),l})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Error.captureStackTrace(…)`.",recommended:"unopinionated"},fixable:"code",messages:{[gu]:"Unnecessary `Error.captureStackTrace(…)` call."},languages:["js/js"]}},"unicorn/prefer-class-fields":{create:e=>{let{sourceCode:t}=e;e.on("ClassBody",r=>{let n=r.body.find(e=>"constructor"===e.kind&&!e.computed&&!e.static&&"MethodDefinition"===e.type&&"FunctionExpression"===e.value.type);if(!n)return;let o=n.value.body.body.find(e=>"EmptyStatement"!==e.type);if(!(o?.type==="ExpressionStatement"&&"AssignmentExpression"===o.expression.type&&"="===o.expression.operator&&"MemberExpression"===o.expression.left.type&&"ThisExpression"===o.expression.left.object.type&&!o.expression.left.computed&&["Identifier","PrivateIdentifier"].includes(o.expression.left.property.type)&&"Literal"===o.expression.right.type))return;let a=o.expression.left.property.name,i=o.expression.right.raw,s=o.expression.left.property.type,l=e=>e.type===s&&e.name===a||"Identifier"===s&&"Literal"===e.type&&e.value===a;if(n.value.params.some(e=>"TSParameterProperty"===e.type&&l(e.parameter.left??e.parameter)))return;let u=r.body.some(e=>("MethodDefinition"===e.type||gd.has(e.type))&&!e.computed&&l(e.key)&&("PrivateIdentifier"===s&&e.static||"MethodDefinition"===e.type&&!e.static)),p=r.body.find(e=>gd.has(e.type)&&!e.computed&&!e.static&&l(e.key)),c={node:o,messageId:gp};if(p&&(p.declare||p.definite||"TSAbstractPropertyDefinition"===p.type))return c;function*d(s){if(yield((e,t,r)=>{let{line:n}=t.getLoc(e).start,o=t.getText(e);return t.lines[n-1].trim()===o?r.removeRange([t.getIndexFromLoc({line:n,column:0}),t.getIndexFromLoc({line:n+1,column:0})]):r.remove(e)})(o,t,s),p){if(p.value)return void(yield s.replaceText(p.value,i));let e=` = ${i}`,r=t.getLastToken(p);return eI(r)?void(yield s.insertTextBefore(r,e)):void(yield s.insertTextAfter(p,`${e};`))}let l=t.getLastToken(r),u=rW(n,e),c=rX(e),d=`${u}${a} = ${i};${c}`;"\n"!==t.getText()[t.getRange(l)[0]-1]&&(d=`${c}${d}`);let m=r.body.at(-1);"PropertyDefinition"===m.type&&";"!==t.getLastToken(m).value&&(d=`;${d}`),yield s.insertTextBefore(l,d)}return u||t.getCommentsInside(o).length>0||(p?.value?c.suggest=[{messageId:gc,fix:d}]:c.fix=d),c})},meta:{type:"suggestion",docs:{description:"Prefer class field declarations over `this` assignments in constructors.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[gp]:"Prefer class field declaration over `this` assignment in constructor for static values.",[gc]:"Encountered same-named class field declaration and `this` assignment in constructor. Replace the class field declaration with the value from `this` assignment."},languages:["js/js"]}},"unicorn/prefer-bigint-literals":{create:e=>{e.on("CallExpression",t=>{if(!tS(t,{name:"BigInt",argumentsLength:1,optional:!1},tb))return;let[r]=t.arguments,n=function(e){let t;if(tp(e)){let t,r,n=e.raw.slice(1,-1);try{t=BigInt(n)}catch{return}let o=n.trim();return o.startsWith("+")&&(o=o.slice(1).trim()),r=o,/^(?:0|[1-9]\d*)$/u.test(r)||gg(o.toLowerCase(),t)||(o=t.toString()),{shouldUseSuggestion:n.includes("+"),text:`${o}n`,bigint:t}}let r=!1,n=!1;for(;"UnaryExpression"===e.type&&e.prefix;)if("+"===e.operator)r=!0,e=e.argument;else{if("-"!==e.operator)return;n=!n,e=e.argument}let{value:o,raw:a}=e;if(!Number.isInteger(o))return;let i=BigInt(o);return(e=>{let t=e.raw.replaceAll("_","").toLowerCase();if(t.includes("."))return!1;let{value:r}=e;return gg(t,r)||!t.includes("e")&&t===String(r)})(e)?t=`${a}n`:(t=`${i}n`,r=!0),n&&0n!==i&&(t=`-${t}`,i=-i),{shouldUseSuggestion:r,text:t,bigint:i}}(r);if(!n)return;let o={node:t,messageId:gm},{shouldUseSuggestion:a,text:i,bigint:s}=n,l=r=>{let n=i;return!tl(t,e)&&s<0n&&(n=`(${n})`,iB(e.sourceCode.getTokenBefore(t),e,n)&&(n=`;${n}`)),r.replaceText(t,n)};return a||e.sourceCode.getCommentsInside(t).length>0?o.suggest=[{messageId:gf,data:{replacement:i.length<20?`\`${i}\``:"a bigint literal"},fix:l}]:o.fix=l,o})},meta:{type:"suggestion",docs:{description:"Prefer `BigInt` literals over the constructor.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[gm]:"Prefer using bigint literal over `BigInt(…)`.",[gf]:"Replace with {{replacement}}."},languages:["js/js"]}},"unicorn/prefer-classlist-toggle":{create:e=>{let{sourceCode:t}=e;e.on(["IfStatement","ConditionalExpression"],r=>{let n=[r.consequent,r.alternate].map(e=>{if(e)return"BlockStatement"===e.type&&1===e.body.length&&(e=e.body[0]),"ExpressionStatement"===e.type&&(e=e.expression),"ChainExpression"===e.type&&(e=e.expression),e});if(n.some(e=>!gE(e,["add","remove"])))return;let[o,a]=n;if(o.callee.property.name!==a.callee.property.name&&gS(o,a))return gb(r,function*(n,{abort:i}){t.getCommentsInside(r).length>0&&i();let s=ts(o.callee.object.object,e),l=ts(o.arguments[0],e),u="ConditionalExpression"===r.type,p="remove"===o.callee.property.name,c=r.test,d=gT(c,p,o),m=d?"":gv(c,e,p),f=o.callee.object.optional||a.callee.object.optional||d?.callee.object.optional,g=`${s}${f?"?":""}.classList.toggle(${l}${m?`, ${m}`:""})`;u||(g+=";"),iB(t.getTokenBefore(r),e,g)&&(g=`;${g}`),yield n.replaceText(r,g),u&&(yield sK(n,r,e))})}),e.on("ConditionalExpression",r=>{let n=[r.consequent,r.alternate];if(!(n.every(e=>tp(e)&&("add"===e.value||"remove"===e.value))&&n[0].value!==n[1].value&&"MemberExpression"===r.parent.type&&r.parent.computed&&!r.parent.optional&&r.parent.property===r&&gx(r.parent.object)&&tS(r.parent.parent,{optional:!1,argumentsLength:1},tb)&&r.parent.parent.callee===r.parent))return;let o=r.parent,a=o.parent;return gb(a,function*(n,{abort:i}){t.getCommentsInside(o).length>0&&i();let s="remove"===r.consequent.value,l=r.test,u=gT(l,s,a)?"":gv(l,e,s);u&&(yield n.insertTextAfterRange(ti(a.arguments[0],e),`, ${u}`)),yield sX(n,o,e,".toggle")},r)})},meta:{type:"suggestion",docs:{description:"Prefer using `Element#classList.toggle()` to toggle class names.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[gy]:"Prefer using `Element#classList.toggle()` to toggle class names.",[gh]:"Replace with `Element#classList.toggle()`."},languages:["js/js"]}},"unicorn/require-module-attributes":{create:e=>{let{sourceCode:t}=e;e.on(["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration"],e=>{let{source:r,attributes:n}=e;if(!r||Array.isArray(n)&&n.length>0)return;let o=t.getTokenAfter(r);if(o?.type!=="Keyword"||"with"!==o.value)return;let a=t.getTokenAfter(o),i=t.getTokenAfter(a);return{node:e,loc:{start:t.getLoc(a).start,end:t.getLoc(i).end},messageId:gC,data:{type:"ImportDeclaration"===e.type?"import statement":"export statement"},fix:t.commentsExistBetween(o,i)?void 0:e=>[o,i,a].map(t=>e.remove(t))}}),e.on("ImportExpression",r=>{let{options:n}=r;if(n?.type!=="ObjectExpression")return;let o=n.properties.find(e=>"Property"===e.type&&!e.method&&!e.shorthand&&!e.computed&&"init"===e.kind&&("Identifier"===e.key.type&&"with"===e.key.name||"Literal"===e.key.type&&"with"===e.key.value)&&tA(e.value)),a=0===n.properties.length||o&&1===n.properties.length?n:o;if(!a)return;let i="Property"===a.type;return{node:o?.value??a,messageId:gC,data:{type:"import expression"},fix:t.getCommentsInside(a).length>0?void 0:r=>i?function*(e,t,r){let{sourceCode:n}=r;for(let r of n.getTokens(t))yield e.remove(r);let o=n.getTokenAfter(t);if(ek(o))yield e.remove(o);else{let{properties:r}=t.parent;if(r.length>1&&r.at(-1)===t){let r=n.getTokenBefore(t);yield e.remove(r)}}}(r,a,e):[t.getTokenBefore(a,ek),...t.getTokens(a),...ta(a,e)].map(e=>r.remove(e))}})},meta:{type:"suggestion",docs:{description:"Require non-empty module attributes for imports and exports",recommended:"unopinionated"},fixable:"code",messages:{[gC]:"{{type}} with empty attribute list is not allowed."},languages:["js/js"]}},"unicorn/no-immediate-mutation":gG,"unicorn/no-useless-collection-argument":{create:e=>{e.on("NewExpression",t=>{var r;if(!tT(t,{names:["Set","Map","WeakSet","WeakMap"],argumentsLength:1}))return;let[n]=t.arguments,o="LogicalExpression"===n.type&&"??"===n.operator,a=o?n.right:n,i=tw(r=a)?"empty array":tu(r,"")?"empty string":tg(r)?"`null`":tV(r)?"`undefined`":void 0;if(!i)return;let s=o?function*(t){let{sourceCode:r}=e,n=a.parent,{left:o}=n,i=tl(o,e),[,s]=i?ti(o,e):r.getRange(o),[,l]=r.getRange(n);yield t.removeRange([s,l]),(i||"SequenceExpression"!==o.type)&&(yield sO(n,t,e))}:t=>sW(t,a,e),l=ne(e,sq(n,e)),u={node:a,messageId:gX,data:{description:i}};return l?u.suggest=[{messageId:gY,fix:s}]:u.fix=s,u})},meta:{type:"suggestion",docs:{description:"Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[gX]:"The {{description}} is useless.",[gY]:"Remove the {{description}}"},languages:["js/js"]}},"unicorn/prefer-response-static-json":{create:e=>{e.on("NewExpression",t=>{if(!tT(t,{name:"Response",minimumArguments:1}))return;let[r]=t.arguments;if(!tP(r,{object:"JSON",method:"stringify",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let[n]=r.arguments,o=ti(r,e),a=ti(n,e),i=[o[0],a[0]],s=[a[1],o[1]],l={node:r.callee,messageId:gZ};return ne(e,i)||ne(e,s)||(l.fix=function*(r){yield r.insertTextAfter(t.callee,".json"),yield sJ(t,e,r),yield r.removeRange(i),yield r.removeRange(s),!tl(t,e)&&tl(t.callee,e)&&iB(e.sourceCode.getTokenBefore(t),e,"(")&&(yield r.insertTextBefore(t,";"))}),l})},meta:{type:"suggestion",docs:{description:"Prefer `Response.json()` over `new Response(JSON.stringify())`.",recommended:"unopinionated"},fixable:"code",messages:{[gZ]:"Prefer using `Response.json(…)` over `JSON.stringify()`."},languages:["js/js"]}},"unicorn/filename-case":{create:e=>{var t;let r=e.options[0]||{},o=r.ignore||[],a=r.directoryRoots||[];yb("ignore",o),yb("directoryRoots",a);let i=o.map(e=>T.isRegExp(e)?new n(e):RegExp(e,"u")),{physicalFilename:s}=e;if(e.filename!==s||"<input>"===(t=s)||"<text>"===t)return;let l=function(e){if(e.case)return[e.case];if(e.cases){let t=Object.keys(e.cases).filter(t=>e.cases[t]);return t.length>0?t:["kebabCase"]}return["kebabCase"]}(r),u=!1!==r.multipleFileExtensions,p=!1!==r.checkDirectories,c=l.map(e=>yy[e].fn);e.on(nF,t=>{if("Document"!==t.type||t.parent?.type!=="Program")return(()=>{var t;let r,o,d=(t=e.cwd,""===(r=C.relative(t,C.resolve(t,s)))||".."===r||r.startsWith(`..${C.sep}`)||C.isAbsolute(r)?[C.basename(s)]:r.split(C.sep).filter(e=>"."!==e)),m=d.at(-1),{filename:f,additionalExtensions:g,extension:y}=function(e,{multipleFileExtensions:t}){let r=C.extname(e),n=C.basename(e,r),o={filename:n,additionalExtensions:"",extension:r};if(t){let[e]=n.split(".",1);Object.assign(o,{filename:e,additionalExtensions:n.slice(e.length)})}return o}(m,{multipleFileExtensions:u});if(d.some(e=>i.some(t=>t.test(e))))return;if(p)for(let e of function(e,t){let r=e.slice(0,-1),o="",a=0;for(let[e,i]of r.entries())(function(e,t){return t.some(t=>"string"==typeof t?e===t:new n(t).test(e))})(o=o?`${o}/${i}`:i,t)&&(a=e+1);return r.slice(a)}(d,a)){let t=function(e,t,r){let n,{leading:o,words:a}=yE(e);if(e.startsWith("$")||yh(a,r))return;let i=yx(a,r,{leading:o,trailing:""});return{loc:{column:0,line:1},messageId:yo,data:{directory:e,chosenCases:yS(t),renamedDirectories:(n=i.map(e=>`\`${e}\``),yl.format(n))}}}(e,l,c);if(t)return t}if(ys.has(m))return;let{leading:h,words:x}=yE(f);if(f.startsWith("$")||yh(x,c))return y!==y.toLowerCase()?{loc:{column:0,line:1},messageId:ya,data:{filename:f+g+y.toLowerCase(),extension:y}}:void 0;let b=yx(x,c,{leading:h,trailing:g+y.toLowerCase()});return{loc:{column:0,line:1},messageId:yn,data:{chosenCases:yS(l),renamedFilenames:(o=b.map(e=>`\`${e}\``),yl.format(o))}}})()})},meta:{type:"suggestion",docs:{description:"Enforce a case style for filenames and directory names.",recommended:!0},schema:yC,defaultOptions:[],messages:{[yn]:"Filename is not in {{chosenCases}}. Rename it to {{renamedFilenames}}.",[yo]:"Directory name `{{directory}}` is not in {{chosenCases}}. Rename it to {{renamedDirectories}}.",[ya]:"File extension `{{extension}}` is not in lowercase. Rename it to `{{filename}}`."},languages:["*"]}},"unicorn/consistent-template-literal-escape":{create:e=>{e.on("TemplateElement",t=>{if(tW(t.parent))return;let r=nL(t,e),n=r.replaceAll(/(?<=(?:^|[^\\])(?:\\\\)*)\\?\$\\{/g,"\\${");if(r!==n)return{node:t,messageId:yD,fix:r=>s2(t,n,e,r)}})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for escaping `${` in template literals.",recommended:!0},fixable:"code",messages:{[yD]:"Use `\\${` instead of `$\\{` to escape in template literals."},languages:["js/js"]}},"unicorn/no-useless-iterator-to-array":{create:e=>{e.on("NewExpression",t=>{if(!(tT(t,{names:["Map","WeakMap","Set","WeakSet"],argumentsLength:1})||tT(t,{names:nM,minimumArguments:1}))||!yJ(t.arguments[0],e))return;let r=t.arguments[0],n=1===t.arguments.length?yH(r,e):void 0,o=t.arguments.length>1?yK(r,e,yW):void 0;return{node:r.callee.property,messageId:yM,data:{description:`new ${t.callee.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}}),e.on("CallExpression",t=>((e,t)=>{if(!tP(e,{objects:["Array",...nM],method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!yJ(e.arguments[0],t))return;let r=e.arguments[0],n=1===e.arguments.length?yH(r,t):void 0,o=e.arguments.length>1?yK(r,t,yW):void 0;return{node:r.callee.property,messageId:yM,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}})(t,e)??((e,t)=>{if(!tP(e,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!yJ(e.arguments[0],t))return;let r=e.arguments[0],n=1===e.arguments.length?yH(r,t):void 0,o=e.arguments.length>1?yK(r,t,yW):void 0;return{node:r.callee.property,messageId:yM,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}})(t,e)??((e,t)=>{if(!tP(e,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||!yJ(e.arguments[0],t))return;let r=e.arguments[0],n=yK(r,t,yW);return{node:r.callee.property,messageId:yM,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{suggest:[n]}}})(t,e)??((e,t)=>{var r,n;if(!(tP(e,{methods:yz,maximumArguments:1,optionalCall:!1,optionalMember:!1})||tP(e,{method:y_,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))||!yJ(e.callee.object,t))return;let o=e.arguments[0],a=e.callee.property.name,i=a===y_;if(r=o,n=i?3:2,r&&("ArrowFunctionExpression"!==(r=yR(r)).type&&"FunctionExpression"!==r.type||r.params.length>n||r.params.at(-1)?.type==="RestElement"||"FunctionExpression"===r.type&&t.sourceCode.getTokens(r).some(e=>"Identifier"===e.type&&"arguments"===e.value)))return;let s=e.callee.object,l=yK(s,t,yV,{method:a});return{node:s.callee.property,messageId:yq,data:{method:a},...l&&{suggest:[l]}}})(t,e)),e.on("ForOfStatement",t=>{if(!yJ(t.right,e))return;let r=yK(t.right,e,yW);return{node:t.right.callee.property,messageId:y$,...r&&{suggest:[r]}}}),e.on("YieldExpression",t=>{if(!t.delegate||!yJ(t.argument,e))return;let r=yK(t.argument,e,yW);return{node:t.argument.callee.property,messageId:yO,...r&&{suggest:[r]}}}),e.on("SpreadElement",t=>{if(!yJ(t.argument,e))return;let{parent:r}=t;if("ArrayExpression"!==r.type&&"CallExpression"!==r.type&&"NewExpression"!==r.type)return;let n=yH(t.argument,e);return{node:t.argument.callee.property,messageId:yU,...n&&{fix:n}}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `.toArray()` on iterators.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[yM]:"`{{description}}` accepts an iterable, `.toArray()` is unnecessary.",[y$]:"`for…of`/`for await…of` can iterate over an iterable, `.toArray()` is unnecessary.",[yO]:"`yield*` can delegate to an iterable, `.toArray()` is unnecessary.",[yU]:"Spread works on iterables, `.toArray()` is unnecessary.",[yq]:"`Iterator` has a `.{{method}}()` method, `.toArray()` is unnecessary.",[yW]:"Remove `.toArray()`.",[yV]:"Remove `.toArray()` and use `Iterator#{{method}}()`."},languages:["js/js"]}},"unicorn/prefer-simple-condition-first":{create:e=>{let{sourceCode:t}=e;e.on("LogicalExpression",r=>{if("&&"!==r.operator&&"||"!==r.operator||function(e){let{operator:t}=e,{parent:r}=e;for(;rh(r)&&r.expression===e;)r=(e=r).parent;return r?.type==="LogicalExpression"&&r.operator===t}(r)||!function e(t,r){if(tZ(t,r)||tQ(t))return!0;let{parent:n}=t;return rh(n)&&n.expression===t&&e(n,r)}(r,e))return;let n=function e(t,r,n=[]){let o=rx(t);return"LogicalExpression"!==o.type||o.operator!==r?n.push(t):(e(o.left,r,n),e(o.right,r,n)),n}(r,r.operator),o=n.map(e=>({operand:e,isSimple:yQ(e)})),a=o.findIndex(({isSimple:e})=>!e),i=o.findIndex(({isSimple:e},t)=>{let o;return e&&t>a&&!("&&"===r.operator&&"Identifier"===(o=rx(n[t])).type&&n.slice(0,t).some(e=>(function(e,t){if("BinaryExpression"!==(e=rx(e)).type||"!=="!==e.operator)return!1;let r=rx(e.left),n=rx(e.right),o="UnaryExpression"===r.type?r:n,a="Literal"===r.type?r:n;if("UnaryExpression"!==o.type||"typeof"!==o.operator||!tu(a,"undefined"))return!1;let i=rx(o.argument);return"Identifier"===i.type&&i.name===t})(e,o.name)))});if(-1===a||-1===i)return;let s=[...o.filter(({isSimple:e})=>e),...o.filter(({isSimple:e})=>!e)].map(({operand:e})=>e),l=o.findLastIndex(({isSimple:e})=>e),u=o.every(({operand:e,isSimple:t},r)=>{var n;return t||r>l||yQ(n=e)||function e(t){let r=rx(t);return"ConditionalExpression"===r.type&&[r.test,r.consequent,r.alternate].every(t=>yQ(t)||yZ(t)||e(t))}(n)}),p=u&&!function e(t,r){if(rh(t)){let e=rx(t);return"LogicalExpression"===e.type&&e.operator===r}return"LogicalExpression"===t.type&&t.operator===r&&(e(t.left,r)||e(t.right,r))}(r,r.operator)&&!function(e,t,r){let{sourceCode:n}=r;if(n.getCommentsInside(e).length>0)return!0;let[o]=t,a=t.at(-1),[i]=ti(o,r),[,s]=ti(a,r),l={range:[i,s]};return eL(n.getTokenBefore(l,{includeComments:!0}))||eL(n.getTokenAfter(l,{includeComments:!0}))}(r,n,e)?n=>n.replaceTextRange(t.getRange(r),s.map((t,n)=>(function(e,t,{operator:r,property:n}){let o=tl(e,t),a=o?ts(e,t):t.sourceCode.getText(e);return!o&&so(e,{operator:r,property:n})&&(a=`(${a})`),a})(t,e,{operator:r.operator,property:0===n?"left":"right"})).join(` ${r.operator} `)):void 0;return{node:r,loc:t.getLoc(n[i]),messageId:u?yG:yX,data:{operator:r.operator},...p&&{fix:p}}})},meta:{type:"suggestion",docs:{description:"Prefer simple conditions first in logical expressions.",recommended:!0},fixable:"code",messages:{[yG]:"Prefer this simple condition first in the `{{operator}}` expression.",[yX]:"Consider moving this simple condition first after verifying short-circuit behavior."},languages:["js/js"]}},"unicorn/switch-case-break-position":{create:e=>{let{sourceCode:t}=e;e.on("SwitchCase",r=>{let{consequent:n}=r;if(n.length<2)return;let o=n.at(-1);if(!y1.has(o.type))return;let a=n.slice(0,-1);if(1!==a.length||"BlockStatement"!==a[0].type)return;let i=a[0];if(0===i.body.length)return;let s=function(e){switch(e.type){case"BreakStatement":return"break";case"ReturnStatement":return"return";case"ContinueStatement":return"continue";case"ThrowStatement":return"throw"}}(o);return{node:o,loc:t.getLoc(o),messageId:y0,data:{keyword:s},..."ReturnStatement"!==o.type&&"ThrowStatement"!==o.type&&{*fix(r){let n=t.getLastToken(i);if(t.getTokensBetween(n,o,{includeComments:!0}).some(e=>eL(e)))return;let a=t.getLoc(i);if(a.start.line===a.end.line||r7(e,o))return;let s=i.body.at(-1),l=t.getText(o),u=rW(s,e),p=t.getTokenBefore(n,{includeComments:!0});yield r.insertTextAfter(p,`${rX(e)}${u}${l}`);let c=t.getRange(n)[1],d=t.getRange(o)[1];yield r.removeRange([c,d])}}}})},meta:{type:"layout",docs:{description:"Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.",recommended:!0},fixable:"code",messages:{[y0]:"Move `{{keyword}}` inside the block statement."},languages:["js/js"]}},"unicorn/better-dom-traversing":{create:e=>{e.on("MemberExpression",t=>{let r,n=(e=>{if(hr(e)){if(ht(e.object,"childNodes"))return"childNodes";if(ht(e.object,"children"))return"children"}})(t);if(!n||ns(t)||am(t.object.object)||"children"===n&&ht(r=t.object,"children")&&("Identifier"===r.object.type&&"props"===r.object.name||tL(r.object,{property:"props",optional:!1,computed:!1}))||t.parent?.type==="MemberExpression"&&t.parent.object===t&&ht(t.parent,"children")&&hr(t.parent.parent))return;let o=t.property.value;return"childNodes"===n&&0===o?{node:t,messageId:y2,suggest:ho(t,"firstChild",y6,e)}:"children"===n&&0===o?{node:t,messageId:y3,suggest:ho(t,"firstElementChild",y4,e)}:"children"===n?{node:t,messageId:y5}:void 0}),e.on("MemberExpression",e=>{if(!(!ha(e)||!ha(e.object)||!(!ha(e.parent)||e.parent.object!==e)||am((e=>{for(;ha(e);)e=e.object;return e})(e))))return{node:e,messageId:y8}}),e.on("CallExpression",t=>{if(!hs(t)||t.parent?.type==="MemberExpression"&&t.parent.object===t&&t.parent.parent?.callee===t.parent&&hs(t.parent.parent)&&hi(t.parent.parent.arguments[0])||(e=>{for(;e.parent?.type==="MemberExpression"&&e.parent.object===e||e.parent?.type==="CallExpression"&&e.parent.callee===e;)e=e.parent;return e.parent?.type==="ChainExpression"})(t))return;let r=(e=>{let t=[];for(;hs(e);){let[r]=e.arguments;if(!hi(r))break;t.push(e),e=e.callee.object}if(t.length<2||"ChainExpression"===e.type||am(e))return;let r=[];for(let e of t)r.unshift(td(e.arguments[0]));return{root:e,selectors:r,quoteNode:t.at(-1).arguments[0]}})(t);if(r)return{node:t,messageId:y9,suggest:((e,t,r)=>{let n,o,{sourceCode:a}=r;if(hn(e,a)||!t.selectors.every(e=>!e.includes(",")&&!e.includes(":scope")))return;let i=ts(t.root,r),s=`${"Identifier"===(n=t.root).type&&"document"===n.name||tL(n,{objects:["globalThis","window"],property:"document"})?"":":scope "}${t.selectors.join(" ")}`,l=`${i}.querySelector(${t5(s,"Literal"===(o=t.quoteNode).type&&o.raw.startsWith('"')?'"':"'")})`;return[{messageId:y7,fix:t=>t.replaceText(e,l)}]})(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer better DOM traversal APIs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[y2]:"Prefer `.firstChild` over `.childNodes[0]`.",[y3]:"Prefer `.firstElementChild` over `.children[0]`.",[y5]:"Consider `.querySelector()` over positional child traversal.",[y8]:"Consider `.closest()` over chaining `.parentElement`.",[y9]:"Consider merging chained `.querySelector()` calls.",[y6]:"Switch to `.firstChild`.",[y4]:"Switch to `.firstElementChild`.",[y7]:"Merge the `.querySelector()` calls."},languages:["js/js"]}},"unicorn/consistent-compound-words":{create:e=>{let t=0===Object.keys(e.options[0]).length?hk:hA(e.options[0]),{ast:n,parserServices:a}=e.sourceCode,s=n.body?.[0]?.type==="Document",l="Document"===n.type||a?.isYAML||a?.isTOML,u=s||l||"StyleSheet"===n.type?(e=>{let t={...e,allowList:new o},n=new r;for(let t of["-","_"])for(let[r,o]of e.replacements){let e=r.replaceAll(/([a-z])([A-Z])/g,(e,r,n)=>r+t+n.toLowerCase());n.set(e,o)}let a=RegExp(`(?<=^|[-_])(?:${n.keys().map(e=>hD(e)).toArray().join("|")})(?=$|[-_])`,"g");return r=>{if(e.allowList.has(r)||0===n.size)return;let o=r.replaceAll(a,e=>n.get(e)).split(/([-_])/).map(e=>hI(e,t)??e).join("");return o===r?void 0:o}})(t):void 0,p=({node:e,name:t,location:r})=>{let n=u(t);if(n)return{node:e,loc:r,messageId:hE,data:{name:t,replacement:n}}};if("StyleSheet"===n.type||s){t.checkVariables&&(s?function(e,t){let r=["{{","{%","<%","${",...Object.keys(e.languageOptions?.templateEngineSyntax??{})];e.on("Attribute",function*({key:n,value:o,startWrapper:a}){let i=n.value.toLowerCase();if(!["id","class"].includes(i)||!o||o.parts.length>0)return;let s=e.sourceCode.getRange(o),l=a?o.value:e.sourceCode.text.slice(s[0]).match(/^[^\t\n\f\r "'<>`]+/u)?.[0];if(!l||r.some(e=>l.includes(e)))return;let u=function(e){let t=e.indexOf("&");if(t<0)return e;let r=e.length,n=0,o="",a=hy[0],i=a&f.JUMP_TABLE,s=(a&f.BRANCH_LENGTH)>>7;do{var l;let a,u,p=t+1,c=e.charCodeAt(p);if(c===g.NUM){let t=function(e,t,r){let n=t+1,o=0,a=n;if(n<r&&(32|e.charCodeAt(n))===g.LOWER_X)for(n+=1,a=n;n<r;){let t=e.charCodeAt(n);if(hx(t))o=16*o+(t-g.ZERO);else if((32|t)-g.LOWER_A>>>0<=5)o=16*o+((32|t)-g.LOWER_A+10);else break;n+=1}else for(;n<r;){let t=e.charCodeAt(n)-g.ZERO;if(t>>>0>9)break;o=10*o+t,n+=1}if(n===a)return 0;n<r&&e.charCodeAt(n)===g.SEMI&&(n+=1),o>1114111&&(o=1114112);let i=n-t;return i>=2047&&(hh=i,i=2047),i<<21|o}(e,p,r);u=0===(a=function(e){let t=e>>>21;return 2047===t?hh:t}(t))?"":function(e){return e-1>>>0<127||e-160>>>0<55136?String.fromCharCode(e):String.fromCodePoint(0===e||e>=55296&&e<=57343||e>1114111?65533:e>=128&&e<=159&&hf[e-128]||e)}(2097151&t)}else if(hb(c)){let t;a=0,u="";let n=c-i;if(n>>>0<s){let e=hy[1+n];t=0===e?-1:s+e&65535}else t=-1;let o=0,l=0,d=t<0?0:hy[t],m=p+1;e:for(;m<r;){for(;(d&(f.VALUE_LENGTH|f.FLAG13))==0&&(d&f.JUMP_TABLE)!=0;){let n=d&f.JUMP_TABLE,o=(d&f.BRANCH_LENGTH)>>7;if(0===o){if(e.charCodeAt(m)!==n)break e;t+=1}else{let r=e.charCodeAt(m)-n;if(r>>>0>=o)break e;let a=hy[t+1+r];if(0===a)break e;t=t+o+a&65535}if(d=hy[t],(m+=1)>=r)break e}if((d&(f.VALUE_LENGTH|f.FLAG13))===f.FLAG13){let r=(d&f.BRANCH_LENGTH)>>7;if(e.charCodeAt(m)!==(d&f.JUMP_TABLE))break;m+=1;let n=r-1,o=t+1,a=0;for(;a+1<n;a+=2){let t=hy[o];if(e.charCodeAt(m)!==(255&t)||(m+=1,e.charCodeAt(m)!==(t>>8&255)))break e;m+=1,o+=1}if(a<n){if(e.charCodeAt(m)!==(255&hy[o]))break;m+=1}t+=1+(r>>1),d=hy[t];continue}let n=d>>>14,i=e.charCodeAt(m);if(0!==n){if(i===g.SEMI){a=m-p+1,u=1===n?String.fromCharCode(d&f.VALUE_MASK):hv(hy,t,n);break}if((d&f.FLAG13)==0&&(a=m-p,o=t,l=n),1===n)break}let s=function(e,t,r,n){let o=(t&f.BRANCH_LENGTH)>>7,a=t&f.JUMP_TABLE;if(a){if(0===o)return n===a?r:-1;let t=n-a;if(t>>>0>=o)return -1;let i=e[r+t];return 0===i?-1:r+o+i-1&65535}if(0===o)return -1;let i=o+1>>1,s=r+i+o;for(let t=0;t<o;t++){let o=e[r+(t>>1)]>>((1&t)<<3)&255;if(o===n)return s+e[r+i+t]&65535;if(o>n)break}return -1}(hy,d,t+(n||1),i);if(s<0)break;d=hy[t=s],m+=1}if(""===u){let e=d>>>14;0!==e&&(d&f.FLAG13)==0&&(a=m-p,o=t,l=e),a>0&&(u=hv(hy,o,l))}}else a=0,u="";0===a||c!==g.NUM&&e.charCodeAt(p+a-1)!==g.SEMI&&p+a<r&&((l=e.charCodeAt(p+a))===g.EQUALS||hb(l)||hx(l))?t=p:(n<t&&(o+=e.slice(n,t)),o+=u,t=n=p+a),e.charCodeAt(t)!==g.AMP&&(t=e.indexOf("&",t))}while(t>=0);return o+e.slice(n)}(l);if(s=[s[0],s[0]+l.length],"id"===i)return void(yield t({node:o,name:u,location:sp(s,e)}));for(let r of u.matchAll(/[^\t\n\f\r ]+/g)){let n=u===l?[s[0]+r.index,s[0]+r.index+r[0].length]:s;yield t({node:o,name:r[0],location:sp(n,e)})}})}:function(e,t){let{sourceCode:r}=e,n=(n,o,a=r.getRange(n),i=!1)=>t({node:n,name:o,location:sp(a,e),isDashedName:i});e.on(["ClassSelector","IdSelector"],e=>n(e,E.ident.decode(e.name))),e.on("Declaration",e=>{let t=E.ident.decode(e.property);if(t.startsWith("--")){let[o]=r.getRange(e);return n(e,t,[o,o+e.property.length],!0)}}),e.on("Layer",function*(e){let[t]=r.getRange(e),o=[];for(let{name:r,nameRange:a}of(E.tokenize(e.name,(r,n,a)=>{r===E.tokenTypes.Ident&&o.push({name:E.ident.decode(e.name.slice(n,a)),nameRange:[t+n,t+a]})}),o))yield n(e,r,a)}),e.on("Feature",e=>{let t,o=E.ident.decode(e.name);if("media"!==e.kind||null!==e.value||!o.startsWith("--"))return;let a=r.getText(e),[i]=r.getRange(e);if(E.tokenize(a,(e,r,n)=>{t||e!==E.tokenTypes.Ident||E.ident.decode(a.slice(r,n))!==o||(t=[i+r,i+n])}),t)return n(e,o,t,!0)}),e.on(["Identifier","String"],e=>{let t,o="String"===e.type?e.value:E.ident.decode(e.name),a=r.getParent(e),i=r.getParent(a),s=a?.type==="AtrulePrelude"&&a.children.at(0)===e&&i?.type==="Atrule"&&hc.test(E.ident.decode(i.name)),l=a?.type==="Value"&&i?.type==="Declaration"?E.ident.decode(i.property).toLowerCase():void 0,u="Identifier"===e.type&&("container-name"===l||"container"===l&&(-1===(t=a.children.findIndex(e=>"Operator"===e.type&&"/"===e.value))||a.children.indexOf(e)<t))&&!hm.has(o.toLowerCase()),p=["animation-name","-webkit-animation-name"].includes(l)&&("String"===e.type||!hd.has(o.toLowerCase()));if(s||u||p||"Identifier"===e.type&&o.startsWith("--")){let t="Identifier"===e.type&&a?.type==="Function"&&"var"===E.ident.decode(a.name).toLowerCase()&&a.children.at(0)===e||s&&["property","custom-media"].includes(E.ident.decode(i.name).toLowerCase());return n(e,o,r.getRange(e),t)}}),e.on("Raw",function*(e){let t=r.getText(e),[o]=r.getRange(e),a=[];for(let{name:r,nameRange:i}of(E.tokenize(t,(e,r,n)=>{if(e!==E.tokenTypes.Ident)return;let i=E.ident.decode(t.slice(r,n));i.startsWith("--")&&a.push({name:i,nameRange:[o+r,o+n]})}),a))yield n(e,r,i,!0)})})(e,p);return}if(l){t.checkProperties&&(e.on("Member",({name:e})=>p({node:e,name:e.name??e.value})),e.on("YAMLPair",({key:e})=>{if(e?.type==="YAMLScalar"&&"string"==typeof e.value&&("plain"!==e.style||"<<"!==e.value))return p({node:e,name:e.value})}),e.on("TOMLKey",function*({keys:e}){for(let t of e)yield p({node:t,name:t.name??t.value})}));return}let c=new i,d=new i,m=(e,t)=>t.every(t=>{let r=d.get(t);return!r||!r.has(e)}),y=e=>{if((e=>{if(1!==e.defs.length)return!1;let[t]=e.defs;return"ClassName"===t.type})(e)){if("class"===e.scope.type){let[t]=e.defs,r=c.get(t.name);return r?h({name:e.name,scope:e.scope,defs:e.defs,identifiers:e.identifiers,references:[...e.references,...r.references]}):h(e)}let[t]=e.defs;return void c.set(t.name,e)}return h(e)},h=r=>{var n;if(0===r.defs.length)return;let a=hI(r.name,t);if(!a)return;let[i]=r.defs;if(!(!("ImportDefaultSpecifier"===(n=i.name).parent.type&&n.parent.local===n||"ImportNamespaceSpecifier"===n.parent.type&&n.parent.local===n||"ImportSpecifier"===n.parent.type&&n.parent.local===n&&"Identifier"===n.parent.imported.type&&"default"===n.parent.imported.name||"VariableDeclarator"===n.parent.type&&n.parent.id===n&&tO(n.parent.init))||t.checkDefaultAndNamespaceImports&&("internal"!==t.checkDefaultAndNamespaceImports||hp(i)))||!(!iD(i.name,e)||t.checkShorthandImports&&("internal"!==t.checkShorthandImports||hp(i)))||!t.checkShorthandProperties&&ik(i.name))return;let s=[...r.references.map(e=>e.from),r.scope],l=r1(a)?rl(a,s,m):void 0,u=hj(i.name,l??a);if(l&&nN(r).every(e=>!("VariableDeclarator"===e.parent.type&&e.parent.id===e?"VariableDeclaration"===e.parent.parent.type&&"ExportNamedDeclaration"===e.parent.parent.parent.type:!!hl.has(e.parent.type)&&e.parent.id===e&&"ExportNamedDeclaration"===e.parent.parent.type)&&"JSXIdentifier"!==e.type)&&r.references.every(e=>!e.vueUsedInTemplate)){for(let e of s)d.has(e)||d.set(e,new o),d.get(e).add(l);u.suggest=[{messageId:hS,data:{replacement:l},fix:t=>s1(r,l,e,t)}]}e.report(u)},x=e=>{for(let t of e.variables)y(t)},b=r=>{if(!t.checkProperties||"__proto__"===r.name)return;let n=hI(r.name,t);if(!n||"ExportSpecifier"===r.parent.type||(t.checkVariables||("TSParameterProperty"===r.parent.type?r.parent.parameter!==r:"AssignmentPattern"!==r.parent.type||r.parent.left!==r||"TSParameterProperty"!==r.parent.parent.type||r.parent.parent.parameter!==r.parent))&&!("MemberExpression"===r.parent.type&&r.parent.property===r&&!r.parent.computed&&("AssignmentExpression"===r.parent.parent.type&&r.parent.parent.left===r.parent||"UpdateExpression"===r.parent.parent.type&&r.parent.parent.argument===r.parent)||"Property"===r.parent.type&&r.parent.key===r&&!r.parent.computed&&!r.parent.shorthand&&"ObjectExpression"===r.parent.parent.type||"ExportSpecifier"===r.parent.type&&r.parent.exported===r&&r.parent.local!==r||hu.has(r.parent.type)&&r.parent.key===r&&!r.parent.computed))return;let o=hj(r,n);e.report(o)};e.on("Identifier",b),e.on("PrivateIdentifier",b),e.on("Program:exit",r=>{if(t.checkVariables)for(let t of nI(e.sourceCode.getScope(r)))x(t)})},meta:{type:"suggestion",docs:{description:"Enforce consistent spelling of compound words in identifiers.",recommended:"unopinionated"},hasSuggestions:!0,schema:hR,defaultOptions:[{}],messages:{[hE]:"Prefer `{{replacement}}` over `{{name}}`.",[hS]:"Rename to `{{replacement}}`."},languages:["js/js","json/json","json/jsonc","json/json5","css/css","html/html","yml/yaml","toml/toml"]}},"unicorn/no-blob-to-file":{create:e=>{e.on("VariableDeclarator",t=>(function(e,t){let{sourceCode:r}=t,{id:n,init:o}=e;if("Identifier"!==n.type||"VariableDeclaration"!==e.parent.type||"const"!==e.parent.kind||1!==e.parent.declarations.length||"Program"!==e.parent.parent.type&&"BlockStatement"!==e.parent.parent.type)return;let a=function(e,t){if(!tT(e,{name:"File",minimumArguments:2,maximumArguments:2})||!hL(e.callee,t))return;let[r]=e.arguments,[,n]=e.arguments;if("ArrayExpression"!==r.type||1!==r.elements.length||r.elements[0]?.type==="SpreadElement"||void 0===td(n))return;let[o]=r.elements;if(function(e,t,r){let n=hN(e,r);if(!n||r.sourceCode.getRange(n)[0]>r.sourceCode.getRange(t)[0])return!1;let o=n.init;return(tT(o,{name:"Blob",maximumArguments:1})||tT(o,{name:"File",minimumArguments:2,maximumArguments:2}))&&hL(o.callee,r)}(o,e,t))return o}(o,t);if(!a)return;let i=nN(eD(r.getScope(n),n)).filter(e=>e!==n);if(1!==i.length)return;let[s]=i,l=function(e,t){let r,{parent:n}=e;return tP(n,{object:"URL",method:"createObjectURL",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&n.arguments[0]===e&&hL(n.callee.object,t)?{call:n,kind:"blobArgument"}:tP(n,{methods:["append","set"],minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})&&n.arguments[1]===e&&(r=hN(n.callee.object,t)?.init,tT(r,{name:"FormData",argumentsLength:0})&&hL(r.callee,t))?{call:n,kind:"formData"}:void 0}(s,t);if(!l)return;let u=function(e){let[,t]=e.arguments;return t}(o),p=function(e,t){let{sourceCode:r}=t,n=r.getCommentsBefore(e).find(t=>r.getLoc(t).end.line===r.getLoc(e).start.line||r.getLoc(t).end.line===r.getLoc(e).start.line-1),o=r7(t,e);return[r.getRange(n??e)[0],r.getRange(o??e)[1]]}(e.parent,t);if(!(!function(e,t,r){let{sourceCode:n}=r;return eD(n.getScope(e),e)===eD(n.getScope(t),e)}(a,s,t)||r6(t,p))&&("formData"!==l.kind||2!==l.call.arguments.length||u))return r4(t,{node:o,messageId:hF,suggest:[{messageId:hB,*fix(n){yield sQ(e.parent,t,n),yield n.replaceText(s,r.getText(a)),"formData"===l.kind&&2===l.call.arguments.length&&(yield n.insertTextAfter(s,`, ${r.getText(u)}`))}}]},p)})(t,e))},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Blob` to `File` conversion.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[hF]:"Use the original `Blob` instead of converting it to a `File`.",[hB]:"Replace the `File` with the original `Blob`."},languages:["js/js"]}},"unicorn/no-canvas-to-image":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",e=>{var r,n,o;if(!tP(e,{method:"drawImage",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[a]=e.arguments;if("SpreadElement"!==a.type&&(r=h$(a,t),r?.type==="CallExpression"&&!r.optional&&"Identifier"===r.callee.type&&"loadImage"===r.callee.name&&r.arguments.length>0&&"SpreadElement"!==r.arguments[0].type&&tP(n=r.arguments[0],{method:"toDataURL",optionalCall:!1,optionalMember:!1})&&("Identifier"===(o=n.callee.object).type?hO(o.name):"MemberExpression"===o.type&&!o.computed&&"Identifier"===o.property.type&&hO(o.property.name))))return{node:a,messageId:hP}}),e.on("CallExpression",e=>{if(!tP(e,{method:"putImageData",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[r]=e.arguments;if("SpreadElement"!==r.type&&tP(h$(r,t),{method:"getImageData",optionalCall:!1,optionalMember:!1}))return{node:r,messageId:hP}})},meta:{type:"suggestion",docs:{description:"Prefer drawing canvases directly instead of converting them to images.",recommended:"unopinionated"},messages:{[hP]:"Prefer drawing the canvas directly with `drawImage()`."},languages:["js/js"]}},"unicorn/no-confusing-array-splice":{create:e=>{e.on("CallExpression",t=>{if(!tP(t,{methods:["splice","toSpliced"],argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let r=function([e,t]){let r=function(e){let t=i4(e);if("number"==typeof t)return Math.max(Math.trunc(t),0)}(t);return 1===r?hU:-1===Math.trunc(i4(e))&&0===r?hq:void 0}(t.arguments);if(!r||od(t.callee.object,e))return;let n={node:t.callee.property,messageId:r,data:{method:t.callee.property.name}},o=function(e,t,r){let{sourceCode:n}=r,{object:o,property:a}=e.callee,[i,,s]=e.arguments,l=a.name,u=ts(o,r),p=ts(i,r),c=ts(s,r);if(t===hU){var d;let t;if(h_(e,n))return;if("toSpliced"===l){if(0>Math.trunc(i4(i))||cG(i,o))return;return{messageId:hW,fix:t=>t.replaceText(e,`${u}.with(${p}, ${c})`)}}return"ExpressionStatement"===e.parent.type&&hz(o)&&(void 0!==(t=i4(d=rx(d=i)))?Number.isSafeInteger(t)&&t>=0:"Identifier"===d.type?"NaN"!==d.name&&"undefined"!==d.name:"Literal"!==d.type||"string"==typeof d.value&&/^(?:0|[1-9]\d*)$/u.test(d.value))?{messageId:hW,fix:t=>t.replaceText(e,`${u}[${p}] = ${c}`)}:void 0}if(t===hq&&hz(o)&&!h_(i,n)&&!e0(s,n))return{messageId:hV,fix:e=>e.replaceText(i,`Math.max(${u}.length - 1, 0)`)}}(t,r,e);return o&&(n.suggest=[o]),n})},meta:{type:"suggestion",docs:{description:"Disallow confusing uses of `Array#{splice,toSpliced}()`.",recommended:!0},hasSuggestions:!0,messages:{[hU]:"Prefer a direct element replacement instead of `{{method}}()`.",[hq]:"Avoid using `{{method}}()` to insert at `-1`.",[hW]:"Use direct element replacement.",[hV]:"Resolve the insertion index explicitly."},languages:["js/js"]}},"unicorn/no-duplicate-set-values":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!tT(r,{name:"Set",argumentsLength:1}))return;let[n]=r.arguments,o=rx(n);if("ArrayExpression"===o.type)return rq(o.elements,e).map(e=>({node:e??n,messageId:hJ,data:{value:e?t.getText(e):"undefined"}}))})},meta:{type:"suggestion",docs:{description:"Disallow duplicate values in `Set` constructor array literals.",recommended:!0},messages:{[hJ]:"Remove duplicate value `{{value}}` from the Set."},languages:["js/js"]}},"unicorn/no-incorrect-query-selector":{create:e=>{let{sourceCode:t}=e;e.on("MemberExpression",t=>{if(!h0(t)||h2(t))return;let r=t.object,n=h3(t,r,e);if(!r6(e,n))return r4(e,h6(t,r,e),n)}),e.on("CallExpression",t=>{var r;let n,o;if(h1(t)){if(h2(t))return;let r=t.callee.object,n=h3(t,r,e);if(r6(e,n))return;return r4(e,h6(t,r,e),n)}let a=h9(t,e);if(a)return a;if(!(!hQ(t)||h0(n=(r=t).parent)||h1(n)||"MemberExpression"===r.parent.type&&r.parent.object===r&&h1(r.parent.parent))&&(o=td(t.arguments[0]),/^#[\-A-Z_a-z][\w\-]*$/v.test(o)))return{node:t.callee.property,messageId:hK}}),e.on("BinaryExpression",r=>((e,t)=>{let{sourceCode:r}=t;if(h7(e,hQ,r))return{node:e,messageId:hX}})(r,e)??((e,t)=>{let r=h7(e,hZ,t);if(r&&("==="===e.operator||"!=="===e.operator)&&tV(r.value))return{node:e,messageId:hY}})(r,t)),e.on("Identifier",t=>h9(t,e))},meta:{type:"suggestion",docs:{description:"Disallow incorrect `querySelector()` and `querySelectorAll()` usage.",recommended:!0},fixable:"code",schema:[],messages:{[hH]:"Prefer `.querySelector()` when only the first match is used.",[hK]:"Prefer `.querySelector()` for a simple ID selector.",[hG]:"Check `.length` instead of the `NodeList` object itself.",[hX]:"Check `.length` instead of comparing the `NodeList` object with `null` or `undefined`.",[hY]:"Compare the result of `.querySelector()` with `null` instead of `undefined`."},languages:["js/js"]}},"unicorn/no-invalid-file-input-accept":{create:e=>{e.on("JSXOpeningElement",t=>{if("input"!==xl(t.name))return;let r=((e,t)=>{if(t?.value){if(tp(t.value))return t.value.value;if("JSXExpressionContainer"===t.value.type)return xp(e,t.value.expression)}})(e,xu(t,"type"));if(r?.toLowerCase()!=="file")return;let n=xu(t,"accept");if(!n)return;let o=((e,t)=>{if(!t.value)return{node:t,missing:!0};if(tp(t.value))return{node:t.value,value:t.value.value,fixable:!0};if("JSXExpressionContainer"!==t.value.type)return{node:t.value,dynamic:!0};let r=xp(e,t.value.expression);return void 0===r?{node:t.value,dynamic:!0}:{node:t.value,value:r,fixable:!1}})(e,n);return xx({valueInfo:o,fix:t=>r=>s5(o.node,t,e,r)})}),e.on("Tag",t=>{if("input"!==t.name.toLowerCase()||function(e){for(let{parent:t}=e;t;t=t.parent)if("Tag"===t.type&&oC.has(t.name?.toLowerCase()))return!0;return!1}(t))return;let r=xh(e,t,"type")?.value;if(r?.toLowerCase()!=="file")return;let n=((e,t,r)=>{let n=xh(e,t,r);if(!n)return;let o=t.attributes.find(e=>"Attribute"===e.type&&e.key?.value?.toLowerCase()===r);return n.missing?{node:o??t,missing:!0}:o?.value?.parts?.length>0?{node:o.value,dynamic:!0}:xa.test(n.value)?void 0:{node:o?.value??t,value:n.value,fixable:!0,valueRange:n.valueRange,isReplacementFixable:e=>n.isQuoted||!/\s/v.test(e)}})(e,t,"accept");if(n)return xx({valueInfo:n,fix:e=>t=>t.replaceTextRange(n.valueRange,e)})})},meta:{type:"problem",docs:{description:"Disallow invalid `accept` values on file inputs.",recommended:!1},fixable:"code",messages:{[xe]:"Invalid file input `accept` value: {{reason}}",[xt]:"The file input `accept` value must be static.",[xr]:"Prefer `{{replacement}}` as the file input `accept` value."},languages:["js/js","html/html"]}},"unicorn/no-late-current-target-access":{create:e=>{let{sourceCode:t}=e,r=xS(e);e.on("MemberExpression",n=>{if("Identifier"!==n.object.type||!tL(n,{property:"currentTarget"})||!xb.test(n.object.name))return;let o=eD(t.getScope(n.object),n.object),a=o?.defs.find(({type:e})=>"Parameter"===e);if(!a||oy(n.object,e))return;let i=a.node,s=xv(n)!==i;if(s||r.isFunctionSuspended(i)||r.isInsideSuspendingLoop(n,i))return{node:n,messageId:s?xC:xT,data:{name:n.object.name}}})},meta:{type:"problem",docs:{description:"Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.",recommended:!0},messages:{[xT]:"`{{name}}.currentTarget` is `null` after the handler suspends. It is only set during synchronous event dispatch; save it to a variable beforehand.",[xC]:"`{{name}}.currentTarget` is `null` inside this nested function. It is only set during synchronous event dispatch; save it to a variable in the outer function."},languages:["js/js"]}},"unicorn/no-unnecessary-nested-ternary":{create:e=>{let{sourceCode:t}=e;e.on("ConditionalExpression",r=>{let{test:n,consequent:o,alternate:a}=r;return"ConditionalExpression"===o.type&&xw(o.alternate,a,t)?xI(e,r,{left:n,operator:"&&",right:o.test,consequent:o.consequent,alternate:o.alternate}):"ConditionalExpression"===a.type&&xw(o,a.consequent,t)?xI(e,r,{left:n,operator:"||",right:a.test,consequent:o,alternate:a.alternate}):void 0})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary nested ternary expressions.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[xD]:"Do not use unnecessary nested ternary expressions."},languages:["js/js"]}},"unicorn/no-unused-builtin-method-return":{create:e=>{e.on("CallExpression",t=>{let r="MemberExpression"===t.callee.type?eK(t.callee,e.sourceCode.getScope(t.callee)):void 0;if(!(!xN.has(r)||!(e=>{for(;;){if(iI(e))return!0;let{parent:t}=e;if("ForStatement"===t.type&&(t.init===e||t.update===e))return!0;if("ChainExpression"!==t.type&&"AwaitExpression"!==t.type&&!rh(t))return!1;e=t}})(t)||yF(t,e)||((e,t,r)=>{let n,a=xF.has(t)||xL.has(t),i=a?e=>xF.has(t)?oh(e,r):!!("with"===t&&os(e,r))||xL.get(t)(e,r):e=>os(e,r),s=function e(t,r,n,a=new o){if(a.has(t))return t;if(a.add(t),"Identifier"===t.type){let o=function(e,t,r){let n=eD(t.sourceCode.getScope(e),e);if(!n||0===n.defs.length)return;if(1!==n.defs.length||function(e,t,r){let[n]=r.sourceCode.getRange(t);return e.references.some(e=>!e.init&&e.isWrite()&&r.sourceCode.getRange(e.identifier)[0]<n)}(n,e,t))return xM;let[o]=n.defs;if("Parameter"===o.type&&o.node.params?.includes(o.name))return o.name.optional||o.name.typeAnnotation&&!r(o.name.typeAnnotation)?xM:void 0;if("Variable"===o.type&&"VariableDeclarator"===o.node.type&&"Identifier"===o.node.id.type&&o.node.id.name===e.name&&"VariableDeclaration"===o.parent.type){let{typeAnnotation:e}=o.node.id;return e?r(e)?void 0:xM:o.node.init??xM}return xM}(t,r,n);return o===xM?o:void 0===o?t:e(o,r,n,a)}return["ChainExpression","TSNonNullExpression","TSSatisfiesExpression"].includes(t.type)?e(t.expression,r,n,a):"MemberExpression"===t.type?xM:"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?n(t)?t:xM:t}(e,r,i);if(s===xM)return!0;if(a)return!i(s);return!!(tS(n=s,"expect",tb)||tP(n,{object:"expect",methods:["element","poll","soft"]}))||("values"===t?!os(s,r):((e,t)=>{let r,n;return xO(e,"undefined",t)||"ObjectExpression"===e.type||"Literal"===e.type||"BinaryExpression"===e.type||"TemplateLiteral"===e.type||"ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type||"ClassExpression"===e.type||"NewExpression"===e.type&&!xO(e.callee,"Array",t)||(r=e,n=t,tS(r,x$,tb)&&n.sourceCode.isGlobalReference(r.callee))})(s,r)||"Identifier"===s.type&&xP.test(s.name)&&!os(s,r))})(t.callee.object,r,e)))return{node:t.callee.property,messageId:xj,data:{method:r}}})},meta:{type:"suggestion",docs:{description:"Disallow ignoring the return value of selected built-in methods.",recommended:"unopinionated"},messages:{[xj]:"Do not ignore the return value of `.{{method}}(…)`."},languages:["js/js"]}},"unicorn/prefer-array-last-methods":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(!tP(r,{methods:xW.keys().toArray(),optionalCall:!1,optionalMember:!1}))return;let n=r.callee.object;if(!tP(n,{methods:xV,argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let o=r.callee.property.name,a=xW.get(o),i={method:o,replacement:a,reversingMethod:n.callee.property.name},s={node:r.callee.property,messageId:xU,data:i};return 0===t.getCommentsInside(r).length&&(s.suggest=[{messageId:xq,data:i,*fix(t){yield t.replaceText(r.callee.property,a),yield sZ(t,n,e)}}]),s})},meta:{type:"suggestion",docs:{description:"Prefer last-oriented array methods over `Array#reverse()` or `Array#toReversed()` followed by a method.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[xU]:"Prefer `Array#{{replacement}}()` over `Array#{{reversingMethod}}().{{method}}()`.",[xq]:"Replace `.{{reversingMethod}}().{{method}}()` with `.{{replacement}}()`."},languages:["js/js"]}},"unicorn/prefer-math-abs":{create:e=>{e.on("ConditionalExpression",t=>{let r=function(e,t){let r=function(e,t){if(!("BinaryExpression"!==e.type||!xJ.has(e.operator)||xZ(e.left,t)||xZ(e.right,t))){if(tu(e.right,0))return{value:e.left,operator:e.operator};if(tu(e.left,0))return{value:e.right,operator:xH[e.operator]}}}(e.test,t);if(!r)return;let{value:n,operator:o}=r,{consequent:a,alternate:i}=e;if(("<"===o||"<="===o)&&xQ(a,n)&&rf(i,n)||(">"===o||">="===o)&&rf(a,n)&&xQ(i,n))return n}(t,e);if(!r)return;let n=x3(r)?function*(n){yield sK(n,t,e),yield n.replaceText(t,`Math.abs(${ts(r,e)})`)}:void 0;return x2(t,e,n)}),e.on("LogicalExpression",t=>{let r=function(e,t){if("||"!==e.operator)return;let r=x0(e.left,t),n=x1(e.right,t);if(r&&n&&rf(r.value,n.value)&&xK[r.operator]===n.operator&&xQ(n.negativeThreshold,r.threshold))return{value:r.value,threshold:r.threshold,operator:r.operator};let o=x0(e.right,t),a=x1(e.left,t);if(o&&a&&rf(o.value,a.value)&&xK[o.operator]===a.operator&&xQ(a.negativeThreshold,o.threshold))return{value:o.value,threshold:o.threshold,operator:o.operator}}(t,e);if(!r)return;let{value:n,threshold:o,operator:a}=r,i=x3(n)&&x3(o)?function*(r){yield sK(r,t,e),yield r.replaceText(t,`Math.abs(${ts(n,e)}) ${a} ${ts(o,e)}`)}:void 0;return x2(t,e,i)})},meta:{type:"suggestion",docs:{description:"Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[xz]:"Prefer `Math.abs()` to simplify this expression.",[x_]:"Replace with `Math.abs()`."},languages:["js/js"]}},"unicorn/prefer-split-limit":{create:e=>{let{sourceCode:t}=e;e.on("MemberExpression",t=>{if(!t.computed||ns(t))return;let r=x9(t.object);if(!r)return;let n=x8(t.property,e);if(void 0!==n)return x6(t,r,n+1,e)}),e.on("CallExpression",t=>{if(!tP(t,{method:"at",argumentsLength:1}))return;let r=x9(t.callee.object);if(!r)return;let n=x8(t.arguments[0],e);if(void 0!==n)return x6(t,r,n+1,e)}),e.on("VariableDeclarator",t=>{if("ArrayPattern"===t.id.type)return x4(t.id,t.init,e)}),e.on("AssignmentExpression",t=>{if("ArrayPattern"===t.left.type&&iI(t))return x4(t.left,t.right,e)})},meta:{type:"suggestion",docs:{description:"Prefer `String#split()` with a limit.",recommended:"unopinionated"},fixable:"code",messages:{[x5]:"Prefer `String#split()` with a limit."},languages:["js/js"]}},"unicorn/prefer-queue-microtask":bt,"unicorn/prefer-string-pad-start-end":{create:e=>{e.on("BinaryExpression",t=>((e,t)=>{if("+"!==e.operator)return;let r=bd(e.left,t);if(r&&rf(e.right,r.targetNode)&&!bs(e.right,t)){let n=bp({targetNode:e.right,targetLengthNode:r.targetLengthNode,paddingNode:r.paddingNode});return bf({node:e,method:"padStart",replacement:n&&bm({method:"padStart",targetNode:e.right,...r},t),context:t,canFix:n})}let n=bd(e.right,t);if(n&&rf(e.left,n.targetNode)&&!bs(e.left,t)){let r=bp({targetNode:e.left,targetLengthNode:n.targetLengthNode,paddingNode:n.paddingNode});return bf({node:e,method:"padEnd",replacement:r&&bm({method:"padEnd",targetNode:e.left,...n},t),context:t,canFix:r})}})(t,e)),e.on("CallExpression",t=>((e,t)=>{if(!tP(e,{method:"slice",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||"BinaryExpression"!==e.callee.object.type||"+"!==e.callee.object.operator)return;let{object:r}=e.callee,[n,o]=e.arguments,a=bc(r.left,t),i=(e=>{if(e?.type==="UnaryExpression"&&"-"===e.operator)return e.argument})(n);if(1===e.arguments.length&&a&&i&&tm(a.widthNode)&&rf(a.widthNode,i)&&"Identifier"===r.right.type&&!bs(r.right,t)){let n=bu(a.paddingNode);return bg({node:e,method:"padStart",replacement:bm({method:"padStart",targetNode:r.right,targetLengthNode:a.widthNode,...a},t),context:t,canSuggest:n})}let s=bc(r.right,t);if(2===e.arguments.length&&s&&tm(n)&&0===n.value&&tm(s.widthNode)&&rf(s.widthNode,o)&&"Identifier"===r.left.type&&!bs(r.left,t)){let n=bu(s.paddingNode);return bg({node:e,method:"padEnd",replacement:bm({method:"padEnd",targetNode:r.left,targetLengthNode:s.widthNode,...s},t),context:t,canSuggest:n})}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `String#padStart()` and `String#padEnd()` over manual string padding.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[br]:"Prefer `String#{{method}}()` over manual string padding.",[bn]:"Replace with `String#{{method}}()`."},languages:["js/js"]}},"unicorn/require-css-escape":bS,"unicorn/require-passive-events":{create:e=>{e.on("CallExpression",t=>{if(!tP(t,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1}))return;let[r,n,o]=t.arguments;if(!tp(r)||!bC.has(r.value)||"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||!((e,t)=>{let r;if(r=t.sourceCode,"FunctionExpression"===e.type&&nI(r.getScope(e)).some(t=>((e,t)=>{let r=e.block;for(;r&&r!==t;){if("FunctionDeclaration"===r.type||"FunctionExpression"===r.type)return!1;r=r.parent}return r===t})(t,e)&&t.references.some(({identifier:e})=>"arguments"===e.name)))return!1;let[n]=e.params[0]?.name==="this"?e.params.slice(1):e.params;if(!n)return!0;if("Identifier"!==n.type)return!1;for(let{identifier:r}of t.sourceCode.getDeclaredVariables(e).find(e=>e.defs[0]?.name===n).references)if(!bD(r))return!1;return!0})(n,e))return;let a=((e,t,r)=>{if(!r){let r;return{fix:(r=t.arguments[1],t=>t.insertTextAfterRange(ti(r,e),", {passive: true}"))}}if(tc(r,!0)||tc(r,!1))return{fix:e=>e.replaceText(r,tc(r,!0)?"{capture: true, passive: true}":"{passive: true}")};if(tV(r)||tg(r))return{};if("ObjectExpression"!==r.type||r.properties.some(e=>"SpreadElement"===e.type||e.computed))return;let n=r.properties.findLast(e=>"Property"===e.type&&"passive"===("Identifier"===e.key.type?e.key.name:tp(e.key)?e.key.value:void 0));if(!n){var o;let t,n;return{fix:(o=e.sourceCode,t=r.properties.at(-1)??o.getFirstToken(r),n=o.getLastToken(r),o.getTokensBetween(t,n,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type))?void 0:t=>{let{sourceCode:n}=e;if(0===r.properties.length)return t.replaceText(r,"{passive: true}");let o=r.properties.at(-1);if(n.getLoc(r).start.line===n.getLoc(r).end.line)return t.insertTextAfter(o,", passive: true");let a=n.getTokenAfter(o),i=rW(o,e),s=rX(e);return","===a.value?t.insertTextAfter(a,`${s}${i}passive: true,`):t.insertTextAfter(o,`,${s}${i}passive: true`)}}}if(tc(n.value,!1))return{fix:e=>e.replaceText(n.value,"true")}})(e,t,o);if(a)return{node:r,messageId:bT,...a}})},meta:{type:"suggestion",docs:{description:"Require passive event listeners for high-frequency events.",recommended:"unopinionated"},fixable:"code",messages:{[bT]:"Use `{passive: true}` for this high-frequency event listener."},languages:["js/js"]}},"unicorn/class-reference-in-static-methods":bQ,"unicorn/consistent-optional-chaining":{create:e=>{e.on("LogicalExpression",t=>(function(e,t){let{left:r,operator:n,right:o}=e,a=b9(r),i=b9(o);if(!a||!i)return;let s=b8(a.object),l=b8(i.object);if(b6(s)&&b6(l)&&rf(s,l)){if("&&"===n&&i.optional)return{node:i,messageId:b0,...b4(i,t)&&{suggest:[{messageId:b2,fix:e=>ve(i,t,e)}]}};if("||"===n&&a.optional!==i.optional)return i.optional?{node:i,messageId:b0,...b4(i,t)&&{suggest:[{messageId:b2,fix:e=>ve(i,t,e)}]}}:{node:i,messageId:b1,...b4(i,t)&&{suggest:[{messageId:b3,fix:e=>b7({memberExpression:i,context:t,fixer:e,replacement:i.computed?"?.[":"?."})}]}}}})(t,e))},meta:{type:"suggestion",docs:{description:"Enforce consistent optional chaining for same-base member access.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[b0]:"Remove unnecessary optional chaining.",[b1]:"Use optional chaining consistently.",[b2]:"Remove optional chaining.",[b3]:"Use optional chaining."},languages:["js/js"]}},"unicorn/explicit-timer-delay":{create:e=>{let t=e.options[0],{sourceCode:r}=e;e.on("CallExpression",n=>{if(n.optional)return;let{isTimer:o,name:a}=((e,t)=>{let{callee:r}=e;if("Identifier"===r.type&&va.has(r.name)&&t.isGlobalReference(r))return{isTimer:!0,name:r.name};if("MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&va.has(r.property.name)){let{object:e}=r;if("Identifier"===e.type&&vi.has(e.name)&&t.isGlobalReference(e))return{isTimer:!0,name:r.property.name}}return{isTimer:!1}})(n,r);if(!o)return;let{arguments:i}=n,s=i.length>=2;if(t===vt&&!s){if(0===i.length)return;let[t]=i;if(1===i.length&&t?.type==="SpreadElement")return;return{node:n,messageId:vn,data:{name:a},fix:r=>r.insertTextAfterRange(ti(t,e),", 0")}}let[l,u]=i;if(t!==vr||2!==i.length||!vs(u))return;let p={node:u,messageId:vo,data:{name:a}},[,c]=ti(l,e),[,d]=ti(u,e);return ne(e,[c,d])||(p.fix=e=>e.removeRange([c,d])),p})},meta:{type:"suggestion",docs:{description:"Enforce or disallow explicit `delay` argument for `setTimeout()` and `setInterval()`.",recommended:"unopinionated"},fixable:"code",schema:[{enum:[vt,vr],description:"Whether to always require an explicit `delay` argument, or disallow an explicit `0` delay."}],defaultOptions:[vt],messages:{[vn]:"`{{name}}` should have an explicit delay argument.",[vo]:"`{{name}}` should not have an explicit delay of `0`."},languages:["js/js"]}},"unicorn/no-confusing-array-with":{create:e=>{e.on("CallExpression",t=>{var r,n;if(!tP(t,{method:"with",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let{object:o}=t.callee,[a]=t.arguments,i=(r=a,n=o,0>Math.trunc(i4(r))?vl:cG(r,n)?vu:void 0);if(!(!i||od(o,e)))return{node:t.callee.property,messageId:i}})},meta:{type:"suggestion",docs:{description:"Disallow confusing uses of `Array#with()`.",recommended:!0},schema:[],messages:{[vl]:"Avoid using a negative index with `Array#with()`.",[vu]:"Avoid using `.length` as the index in `Array#with()`."},languages:["js/js"]}},"unicorn/no-duplicate-loops":{create:e=>{e.on("ForOfStatement",t=>{let r=yR(t.right);if(tP(r,{methods:vc,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&!yP(r.callee.object,e))return{node:r.callee.property,messageId:vp,data:{loopKind:t.await?"for await…of":"for…of",method:r.callee.property.name}}})},meta:{type:"suggestion",docs:{description:"Disallow `.map()` and `.filter()` in `for…of` and `for await…of` loop headers.",recommended:!0},messages:{[vp]:"Do not use `.{{method}}()` directly in a `{{loopKind}}` loop header. It creates an intermediate array before the loop."},languages:["js/js"]}},"unicorn/no-declarations-before-early-exit":{create:e=>{let{sourceCode:t}=e,r=sc(e,t=>iT(t,e,r));e.onExit("Program",e=>vh(t,e.body,r)),e.onExit("BlockStatement",e=>vh(t,e.body,r))},meta:{type:"suggestion",docs:{description:"Disallow declarations before conditional early exits when they are only used after the exit.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[vd]:"Move this declaration after the early exit."},languages:["js/js"]}},"unicorn/no-optional-chaining-on-undeclared-variable":{create:e=>{let t=new s;e.on("ChainExpression",r=>{let n=function(e,t){let r=function(e){for(e=vv(e);"MemberExpression"===e.type;)e=vv(e.object);return"Identifier"===e.type?e:void 0}(function e(t){return"MemberExpression"===(t=vv(t)).type?e(t.object)??(t.optional?t.object:void 0):"CallExpression"===t.type?e(t.callee)??(t.optional?t.callee:void 0):void 0}(e.expression));if(r&&function(e,t){let r=t.sourceCode.getScope(e);for(;r;){let t=r.set.get(e.name);if(t&&(0===t.defs.length||t.defs.some(e=>!vb(e))))return!1;r=r.upper}return!0}(r,t))return r}(r,e);if(!(!n||t.has(n)))return t.add(n),{node:n,messageId:vx,data:{name:n.name}}})},meta:{type:"problem",docs:{description:"Disallow optional chaining on undeclared variables.",recommended:!0},schema:[],messages:{[vx]:"Optional chaining on undeclared variable `{{name}}` throws a ReferenceError."},languages:["js/js"]}},"unicorn/no-object-methods-with-collections":{create:e=>{e.on("CallExpression",t=>((e,t)=>{let{callee:r}=e;if(1!==e.arguments.length||e.optional||"MemberExpression"!==r.type||r.optional||r.computed||"Identifier"!==r.object.type||"Object"!==r.object.name||!rg(r.object,t)||"Identifier"!==r.property.type||!vT.has(r.property.name))return;let[n]=e.arguments,o=iK(n,t);if(!o)return;let a=r.property.name,i=`${se(n,t)}.${a}()`,s={node:r.property,messageId:vE,data:{method:a,type:o}};return 0===t.sourceCode.getCommentsInside(e).length&&(s.suggest=[{messageId:vS,data:{replacement:i},fix:t=>t.replaceText(e,`Array.from(${i})`)}]),s})(t,e))},meta:{type:"problem",docs:{description:"Disallow `Object` methods with `Map` or `Set`.",recommended:!0},hasSuggestions:!0,messages:{[vE]:"`Object.{{method}}()` does not return {{type}} contents.",[vS]:"Use `Array.from({{replacement}})`."},languages:["js/js"]}},"unicorn/no-subtraction-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{let n,o;if(!vA.has(r.operator))return;if(tu(r.right,0)&&vI(r.left))n=r.left,o=r.operator;else{if(!(tu(r.left,0)&&vI(r.right)))return;n=r.right,o=vw[r.operator]}let a={node:r,messageId:vC};if(t.getCommentsInside(r).length>0)return a;let{left:i,right:s}=n,l=`${ts(i,e)} ${o} ${ts(s,e)}`,u=e=>e.replaceText(r,l);return(vk.has(o)?oO(i,e)&&oO(s,e):vj(i,e)&&vj(s,e))?a.fix=u:a.suggest=[{messageId:vD,data:{replacement:l},fix:u}],a})},meta:{type:"suggestion",docs:{description:"Prefer comparing values directly over subtracting and comparing to `0`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[vC]:"Prefer comparing the values directly over comparing the difference with `0`.",[vD]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-unnecessary-global-this":{create:e=>{e.on("MemberExpression",t=>{var r,n,o;let a,i=vB(t.object),s=vL(t);if("Identifier"!==i.type||"globalThis"!==i.name||!rg(i,e)||ns(s)||nu(r=t)||("MemberExpression"===(r=vL(r)).parent.type||"CallExpression"===r.parent.type)&&r.parent.optional&&(r.parent.object===r||r.parent.callee===r)||"LogicalExpression"===(n=vL(n=t)).parent.type||function(e){let{parent:t}=e;if("BinaryExpression"!==t.type||!vM.has(t.operator))return!1;let r=vB(t.left===e?t.right:t.left);return"Literal"===r.type&&null===r.value||"Identifier"===r.type&&"undefined"===r.name}(n)||tQ(n)||tZ(n,e))return;let l=t.computed?tp(t.property)?t.property.value:"TemplateLiteral"===t.property.type&&0===t.property.expressions.length?t.property.quasis[0].value.cooked:void 0:t.property.name;if("string"!=typeof l||!(r1(l)&&(!vN.has(l)||"eval"===l||"arguments"===l))||"eval"===l&&vP(t)||(a=eD(e.sourceCode.getScope(t),l),a?.scope.type!=="global"||0!==a.defs.length))return;let u={node:t,messageId:vR,data:{name:l}};return vP(t)||"TaggedTemplateExpression"===(o=vL(o=t)).parent.type&&o.parent.tag===o||0!==e.sourceCode.getCommentsInside(t).length||(u.fix=e=>e.replaceText(t,l)),u})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `globalThis` references.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[vR]:"Use `{{name}}` directly instead of `globalThis.{{name}}`."},languages:["js/js"]}},"unicorn/no-unreadable-object-destructuring":{create:e=>{e.on("Property",t=>{if("ObjectPattern"===t.parent.type&&t.computed&&!(!function(e,t){let r;return!(rj(e,t)||"MemberExpression"===e.type&&!rg(e.object,t)&&rB(e,t))&&(void 0!==rN(e,t)||!!("MemberExpression"===(r="TaggedTemplateExpression"===e.type?e.tag:e).type&&!r.computed&&"Identifier"===r.object.type&&rg(r.object,t)&&"Identifier"===r.property.type&&vW.get(r.object.name)?.has(r.property.name))&&null!==eJ(e,t.sourceCode.getScope(e)))}(t.key,e)&&t.parent.properties.some(e=>"RestElement"===e.type)))return{node:t,messageId:v$}}),e.on("ArrayPattern",e=>{if(0!==vz(e))return{node:e,messageId:vO}}),e.on("ObjectPattern",e=>{if(3===vz(e))return{node:e,messageId:vU}}),e.on("MemberExpression",e=>{if(vV(e)?.type==="ObjectPattern")return{node:e,messageId:vq}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable object destructuring.",recommended:"unopinionated"},schema:[],messages:{[v$]:"Do not use computed keys in object destructuring.",[vO]:"Do not use array destructuring inside object destructuring.",[vU]:"Do not use object destructuring deeper than two levels.",[vq]:"Do not assign destructured values to object properties."},languages:["js/js"]}},"unicorn/no-useless-else":{create:e=>{let{sourceCode:t}=e,r=sc(e,t=>iT(t,e,r));e.onExit("IfStatement",n=>{if(!(n.alternate&&vJ.has(n.parent.type)&&r(n.consequent)))return;let o=t.getTokenBefore(n.alternate);return{node:n.alternate,loc:t.getLoc(o),messageId:v_,fix:function*(t){let{sourceCode:r}=e,{alternate:o,consequent:a}=n;if(nn(o)||"BlockStatement"===o.type&&((e,t)=>{let{sourceCode:r}=t;return r.getTokens(e).some(e=>("JSXText"!==e.type||"JSXText"!==r.getNodeByRangeIndex(r.getRange(e)[0]).type)&&r.getLoc(e).start.line!==r.getLoc(e).end.line)})(o,e)||!((e,t)=>{let{sourceCode:r}=t,{alternate:n,consequent:o}=e,a="BlockStatement"===n.type?r.getTokenAfter(r.getFirstToken(n)):r.getFirstToken(n),i=r.getLastToken(o);if("BlockStatement"!==o.type&&";"!==i.value&&(iB(i,t,a.value)||vK(a))||((e,t)=>{let r=t.getTokenAfter(e);if(r&&t.getLoc(e).end.line===t.getLoc(r).start.line)return!0;let n=t.getCommentsAfter(e)[0];return!!(n&&t.getLoc(e).end.line===t.getLoc(n).start.line)})(n,r))return!1;let s="BlockStatement"===n.type?r.getTokenBefore(r.getLastToken(n)):r.getLastToken(n),l=r.getTokenAfter(n);return!(s&&";"!==s.value&&l&&(iB(s,t,l.value)||vK(l)))})(n,e))return;let i=r.getRange(a),s=[i[1],r.getRange(o)[1]];if(!ne(e,[s[0],r.getRange(o)[0]])){let r;yield t.replaceTextRange(s,(r=function(e,t){let{sourceCode:r}=t,n=rY(e.parent,t);if("BlockStatement"!==e.type)return`${n}${r.getText(e)}`;let o=r.getFirstToken(e),a=r.getLastToken(e),i=r.getTokenAfter(o,{includeComments:!0}),s=rQ(r.text.slice(r.getRange(o)[1],r.getRange(a)[0]),i===a?"":rY(i,t),n).trim();return s?`${n}${s}`:""}(n.alternate,e))?`${rX(e)}${r}`:""),yield s$(t,i)}}}})},meta:{type:"suggestion",docs:{description:"Disallow `else` after a statement that exits.",recommended:!0},fixable:"code",messages:{[v_]:"Unexpected `else` after a statement that exits."},languages:["js/js"]}},"unicorn/no-useless-recursion":{create:e=>{let{sourceCode:t}=e;e.on("ReturnStatement",e=>{if(((e,t)=>{var r;let n,{argument:o}=e;if(o?.type!=="CallExpression"||o.optional||"Identifier"!==o.callee.type)return!1;let a=(e=>{for(;e;e=e.parent)if(tj(e))return e})(e);return!!(a?.id&&!a.generator&&!((e,t)=>{for(;e&&e!==t;e=e.parent)if("TryStatement"===e.type)return!0;return!1})(e,a)&&!((e,t)=>{for(;e&&e!==t;e=e.parent){if(vZ(e))return!0;if(e.parent?.type!=="BlockStatement")continue;let t=e.parent.body.indexOf(e);if(e.parent.body.slice(0,t).some(e=>vY(e)))return!0}return!1})(e,a)&&o.callee.name===a.id.name&&(r=o.callee,n=eD(t.getScope(r),r),n?.identifiers.includes(a.id)))})(e,t))return{node:e.argument.callee,messageId:vG}})},meta:{type:"suggestion",docs:{description:"Disallow simple recursive function calls that can be replaced with a loop.",recommended:!0},messages:{[vG]:"Use a loop instead of this recursive function call."},languages:["js/js"]}},"unicorn/prefer-add-event-listener-options":{create:e=>{e.on("CallExpression",e=>{if(!tP(e,{method:"addEventListener",argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let t=e.arguments[2];if(!tc(t))return;let r=`{capture: ${t.value}}`;return{node:t,messageId:vQ,data:{value:String(t.value),replacement:r},fix:e=>e.replaceText(t,r)}})},meta:{type:"suggestion",docs:{description:"Prefer an options object over a boolean in `.addEventListener()`.",recommended:"unopinionated"},fixable:"code",messages:{[vQ]:"Prefer `{{replacement}}` over `{{value}}`."},languages:["js/js"]}},"unicorn/prefer-direct-iteration":{create:e=>{e.on("CallExpression",t=>{if(!tP(t,{methods:["entries","keys","values"],argumentsLength:0,optionalCall:!1,optionalMember:!1})||!(e=>{let{parent:t}=e;if("ForOfStatement"===t.type&&t.right===e||"YieldExpression"===t.type&&t.delegate&&t.argument===e||"SpreadElement"===t.type&&t.argument===e&&(e=>{let{parent:t}=e;return v7.has(t.type)})(t))return!0;if("NewExpression"===t.type)return 1===t.arguments.length&&t.arguments[0]===e&&(tT(t,{names:v6,argumentsLength:1})||tT(t,{names:nM,argumentsLength:1}));if("CallExpression"===t.type)return t.arguments[0]===e&&(tP(t,{object:"Array",method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||Et(t,["from"])||tP(t,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||tP(t,{object:"Promise",methods:v4,argumentsLength:1,optionalCall:!1,optionalMember:!1}));return!1})(t))return;let r=t.callee.property.name;if(((e,t)=>{if(!t?.size)return!1;for(let r of t){let t=v9.get(r);if(!t?.includes(e))return!1}return!0})(r,Ei(t.callee.object,e)))return{node:t.callee.property,messageId:v0,data:{method:r},fix:((e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>sZ(r,e,t)})(t,e)}})},meta:{type:"suggestion",docs:{description:"Prefer direct iteration over default iterator method calls.",recommended:"unopinionated"},fixable:"code",messages:{[v0]:"Prefer direct iteration instead of `.{{method}}()`."},languages:["js/js"]}},"unicorn/prefer-number-is-safe-integer":{create:e=>{let{sourceCode:t}=e,r=(e,r)=>{let n,o={node:e,messageId:Eu};return n=t.getRange(r),t.getCommentsInside(e).some(e=>{let r=t.getRange(e);return r[0]<n[0]||r[1]>n[1]})||(o.suggest=[{messageId:Ep,fix:n=>{let o;return n.replaceText(e,`Number.isSafeInteger(${(o=t.getText(r),"SequenceExpression"===r.type?`(${o})`:o)})`)}}]),o};e.on("CallExpression",e=>{if(tP(e,{object:"Number",method:"isInteger",optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return{node:e.callee.property,messageId:Es,suggest:[{messageId:El,fix:t=>t.replaceText(e.callee.property,"isSafeInteger")}]};let n=(e=>{if(tP(e,{objects:Ec,methods:["isInteger","isSafeInteger"],argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1}))return e.arguments[0]})(e);if(n&&Em(e,t))return r(e,n)}),e.on("BinaryExpression",e=>{let n=(e=>{if("==="===e.operator){if(tu(e.right,0))return Ef(e.left);if(tu(e.left,0))return Ef(e.right)}})(e)??((e,t)=>{if("==="!==e.operator)return;let r=Eg(e.left,t);if(r&&rf(r,e.right))return r;let n=Eg(e.right,t);if(n&&rf(n,e.left))return n})(e,t);if(n&&Em(e,t))return r(e,n)})},meta:{type:"suggestion",docs:{description:"Prefer `Number.isSafeInteger()` over integer checks.",recommended:!0},hasSuggestions:!0,messages:{[Es]:"Prefer `Number.isSafeInteger()` over `Number.isInteger()`.",[El]:"Replace `Number.isInteger()` with `Number.isSafeInteger()`.",[Eu]:"Prefer `Number.isSafeInteger()` over this integer check.",[Ep]:"Replace this integer check with `Number.isSafeInteger()`."},languages:["js/js"]}},"unicorn/prefer-object-define-properties":{create:e=>{let{sourceCode:t}=e;e.on("ExpressionStatement",r=>{let n=Eh(r);if(!n)return;let a=Eh(sd(r,e,-1));if(a&&rf(a.arguments[0],n.arguments[0]))return;let i=[r],s=[n],l=sm(r,e);for(;;){let t=Eh(l);if(!t||!rf(n.arguments[0],t.arguments[0]))break;i.push(l),s.push(t),l=sm(l,e)}if(s.length<2)return;let u={node:n.callee.property,messageId:Ey},p=[t.getRange(i[0])[0],t.getRange(i.at(-1))[1]];return!function(e,t){let r=new o,n=[];for(let o of e){let e=o.arguments[1],a=Ex(e,t);if(void 0===a){if(n.some(t=>rf(t,e)))return!0;n.push(e);continue}if(r.has(a))return!0;r.add(a)}return!1}(s,t)&&!t.getAllComments().some(e=>{let[r,n]=t.getRange(e);return r>=p[0]&&n<=p[1]})&&s.every(e=>{let r;return r=e.arguments[2],!t.getTokens(r).some(e=>Eb.has(e.type)&&/\r\n|[\n\r\u{2028}\u{2029}]/u.test(e.value))})&&!((e,t)=>{let r=0,n=-1;for(let o of e){let e=Ex(o.arguments[1],t)??"";if("symbol"==typeof e){r=2;continue}if(!Ev(e)){if(r>1)return!0;r=1;continue}if(r>0||Number(e)<n)return!0;n=Number(e)}return!1})(s,t)&&(u.fix=function(e,t,r){let{sourceCode:n}=r,o=e[0],a=e.at(-1),i=rW(o,r),s=rK(r),l=rX(r),u=`${i}${s}`,p=n.getText(t[0].arguments[0]),c=t.map(e=>{let t=function(e,t){let r=t.getText(e);if("Literal"===e.type){if("string"==typeof e.value)return"__proto__"===e.value?`[${r}]`:r1(e.value)?e.value:r;if("number"==typeof e.value)return r}return`[${r}]`}(e.arguments[1],n),r=rQ(n.getText(e.arguments[2]),"",s);return`${u}${t}: ${r},`}).join(l);return e=>e.replaceTextRange([n.getRange(o)[0],n.getRange(a)[1]],`Object.defineProperties(${p}, {${l}${c}${l}${i}});`)}(i,s,e)),u})},meta:{type:"suggestion",docs:{description:"Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Ey]:"Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls."},languages:["js/js"]}},"unicorn/prefer-object-destructuring-defaults":{create:e=>{e.on("VariableDeclarator",t=>{let{id:n,init:a}=t;if(!("ObjectPattern"===n.type&&a?.type==="ObjectExpression"&&!r6(e,t)))return;let i=((e,t)=>{if(e.typeAnnotation)return;let r=[];for(let n of e.properties){if(!(ED(n)&&"Identifier"===n.value.type))return;let e=eK(n,t.sourceCode.getScope(n));if(ET.has(e))return;r.push({node:n,name:e})}return r})(n,e),s=((e,t)=>{let{properties:n}=e,o=n.at(-1);if(o?.type!=="SpreadElement"||e0(o.argument,t.sourceCode,EC))return;let a=new r;for(let e of n.slice(0,-1)){if(!ED(e)||e0(e.value,t.sourceCode,EC))return;let r=eK(e,t.sourceCode.getScope(e));if(a.has(r))return;a.set(r,e)}return{defaultProperties:a,spreadElement:o}})(a,e);if(!i||0===i.length||!s)return;let{defaultProperties:l,spreadElement:u}=s;if(i.length!==l.size)return;let p=new o(i.map(e=>e.node.value.name)),c=[];for(let t of i){let r=l.get(t.name);if(!r||Ew(r.value,p,e))return;c.push(EA(t,r,e))}return r4(e,{node:t,messageId:EE,suggest:[{messageId:ES,fix:r=>r.replaceText(t,`{${c.join(", ")}} = {${e.sourceCode.getText(u)}}`)}]})})},meta:{type:"suggestion",docs:{description:"Prefer object destructuring defaults over default object literals with spread.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[EE]:"Prefer object destructuring defaults over default object literals with spread.",[ES]:"Use object destructuring defaults."},languages:["js/js"]}},"unicorn/prefer-single-object-destructuring":{create:e=>{e.on("Program",t=>EL(e,t.body)),e.on(["BlockStatement","StaticBlock"],t=>EL(e,t.body)),e.on("SwitchCase",t=>EL(e,t.consequent))},meta:{type:"suggestion",docs:{description:"Prefer a single object destructuring declaration per local const source.",recommended:!0},fixable:"code",schema:[],messages:{[Ek]:"Prefer a single object destructuring declaration from `{{source}}`.",[EI]:"Prefer destructuring directly from the initializer of `{{source}}`."},languages:["js/js"]}},"unicorn/prefer-smaller-scope":{create:e=>{let{sourceCode:t}=e;e.on("VariableDeclaration",e=>(function(e,t){let r;if(!(e.parent&&("Program"===e.parent.type||"BlockStatement"===e.parent.type)&&("let"===e.kind||"const"===e.kind)&&!e.declare&&1===e.declarations.length&&"Identifier"===e.declarations[0].id.type))return;let[n]=e.declarations,[o]=t.getDeclaredVariables(n);if(o.eslintUsed||(r=n.id.name,"Program"===e.parent.type&&e.parent.body.some(e=>"ExportNamedDeclaration"===e.type&&!e.source&&e.specifiers.some(e=>e.local.name===r))))return;let a=o.references.filter(e=>!e.init);if(n.init)return function(e,t,r){let[n]=e.declarations,{init:o}=n;if(!("Literal"===o.type&&!o.regex)&&("TemplateLiteral"!==o.type||0!==o.expressions.length))return;let a=e.parent.body,i=a[a.indexOf(e)+1];if(i?.type!=="IfStatement"||0===r.length)return;let s=[i.consequent,i.alternate].find(e=>e?.type==="BlockStatement"&&r.every(t=>EM(t.identifier,e)));if(!s||E$(e.parent,t.visitorKeys))return;let l={node:n.id,messageId:EN,data:{name:n.id.name}},[u]=s.body;return n.id.typeAnnotation||t.getCommentsInside(e).length>0||EO(t,e,"before")||EO(t,e,"after")||EO(t,u,"before")||(l.fix=function*(r){let n=t.getFirstToken(s),[,o]=t.getRange(n),[a]=t.getRange(u),l=t.text.slice(o,a)||" ",p=t.getText(e),c=p.endsWith(";")?"":";",[d]=t.getRange(e),[m]=t.getRange(i);yield r.removeRange([d,m]),yield r.insertTextBefore(u,`${p}${c}${l}`)}),l}(e,t,a);if("let"!==e.kind)return;let i=a.filter(e=>e.isWrite());if(1!==i.length||a.every(e=>!e.isRead()))return;let s=function(e){let{identifier:t}=e,r=t.parent;if("AssignmentExpression"!==r.type||"="!==r.operator||r.left!==t||"ExpressionStatement"!==r.parent.type)return;let n=r.parent,o=n.parent;if("BlockStatement"===o.type)return{assignmentExpression:r,assignmentStatement:n,block:o}}(i[0]);if(!s)return;let{assignmentExpression:l,assignmentStatement:u,block:p}=s,[,c]=t.getRange(e),[d,m]=t.getRange(u);if(!EM(p,e.parent)||E$(e.parent,t.visitorKeys)||d<c||a.some(e=>!EM(e.identifier,p))||a.some(e=>e.isRead()&&t.getRange(e.identifier)[0]<m))return;let f={node:n.id,messageId:EN,data:{name:n.id.name}};return n.id.typeAnnotation||EU(t,l)&&"SequenceExpression"===l.right.type||t.getCommentsInside(e).length>0||t.getCommentsInside(u).length>0||EO(t,e,"before")||EO(t,e,"after")||EO(t,u,"before")||EO(t,u,"after")||(f.fix=function({sourceCode:e,declaration:t,assignmentExpression:r,assignmentStatement:n,name:o}){return function*(a){yield sQ(t,{sourceCode:e},a);let i=`const ${o} = `,{right:s}=r;if(EU(e,r))return void(yield a.replaceText(n,`${i}${ts(s,{sourceCode:e})};`));let[l]=e.getRange(r),[u]=ti(s,{sourceCode:e});yield a.replaceTextRange([l,u],i)}}({sourceCode:t,declaration:e,assignmentExpression:l,assignmentStatement:u,name:n.id.name})),f})(e,t))},meta:{type:"suggestion",docs:{description:"Prefer declaring variables in the smallest possible scope.",recommended:!0},fixable:"code",schema:[],messages:{[EN]:"Move `{{name}}` into the block where it is used."},languages:["js/js"]}},"unicorn/prefer-single-array-predicate":{create:e=>{e.on("LogicalExpression",t=>{if("LogicalExpression"===t.parent.type&&t.parent.operator===t.operator)return;let r=EV.get(t.operator);if(!r||r6(e,t))return;let n=(function e(t,r){return"LogicalExpression"!==t.type||t.operator!==r?[t]:[...e(t.left,r),...e(t.right,r)]})(t,t.operator).map(t=>(function(e,t,r){if(!tP(e,{method:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})||e.typeArguments||e.typeParameters)return;let n=function(e){if("ArrowFunctionExpression"===e.type&&!e.async&&!e.returnType&&!e.typeParameters&&1===e.params.length&&"Identifier"===e.params[0].type&&"BlockStatement"!==e.body.type)return{parameter:e.params[0],body:e.body}}(e.arguments[0]);if(!n)return;let{object:o}=e.callee;if(!ou(o,r)){var a;let t;return{node:e,object:o,callback:{...n,parameterText:(a=n.parameter,t=r.sourceCode.getText(a),a.typeAnnotation||a.optional?`(${t})`:t)}}}})(t,r,e));if(!(n.length<2||n.includes(void 0)||n.some(e=>{let t;return t=n[0],!rf(t.object,e.object)||t.callback.parameterText!==e.callback.parameterText})))return r4(e,{node:t,messageId:Eq,data:{method:r},suggest:[{messageId:EW,data:{method:r},fix:r=>r.replaceText(t,function(e,t,r){let{sourceCode:n}=r,[o]=e,{callback:a}=o,i=e.map(({callback:e})=>(function(e,t,r){var n,o;if(tl(e,r))return ts(e,r);let a=r.sourceCode.getText(e);return(n=e,o=t,"LogicalExpression"===n.type?n.operator!==o&&("||"!==o||"&&"!==n.operator):Ez.has(n.type))?`(${a})`:a})(e.body,t,r)).join(` ${t} `);return`${n.getText(o.node.callee)}(${a.parameterText} => ${i})`}(n,t.operator,e))}]})})},meta:{type:"suggestion",docs:{description:"Prefer a single `Array#some()` or `Array#every()` with a combined predicate.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[Eq]:"Prefer a single `Array#{{method}}()` with a combined predicate.",[EW]:"Merge predicates into one `Array#{{method}}()` call."},languages:["js/js"]}},"unicorn/prefer-url-href":{create:e=>{e.on("CallExpression",t=>{if(tP(t,{method:"toString",argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})&&"url"===ap(t.callee.object,e)){let r={node:t.callee.property,messageId:E_};return EJ(t,e)&&!tl(t.callee,e)&&ac(t.callee.object,e)&&(r.fix=r=>r.replaceTextRange([e.sourceCode.getRange(t.callee.property)[0],e.sourceCode.getRange(t)[1]],"href")),r}if(!(tS(t,{name:"String",argumentsLength:1,optional:!1},tb)&&rg(t.callee,e)))return;let[r]=t.arguments;if("url"!==ap(r,e))return;let n={node:t.callee,messageId:E_};return EJ(t,e)&&ac(r,e)&&(n.fix=n=>{let o;return n.replaceText(t,(o=`${se(r,e)}.href`,(iB(e.sourceCode.getTokenBefore(r.parent),e,o)?";":"")+o))}),n})},meta:{type:"suggestion",docs:{description:"Prefer `URL#href` over stringifying a `URL`.",recommended:"unopinionated"},fixable:"code",messages:{[E_]:"Prefer `URL#href` over stringifying a `URL`."},languages:["js/js"]}},"unicorn/require-proxy-trap-boolean-return":{create:e=>{let{sourceCode:t}=e,r=new i,n=[];function*a(e){if(!EY(e))return;let n=e.arguments[1];if("ObjectExpression"===n.type)for(let e of n.properties){let n=E3(e,t);if(!n)continue;let o=E5(n,t,r);o&&(yield o)}}e.on("onCodePathStart",(e,r)=>{let a,i,s;n.push((a=r.parent,i=a?.parent,s=i?.parent,a?.value===r&&i?.type==="ObjectExpression"&&s?.arguments?.[1]===i&&EY(s)&&E3(a,t))?new o:void 0)}),e.on("onCodePathEnd",()=>{n.pop()}),e.on("onCodePathSegmentStart",e=>{n.at(-1)?.add(e)}),e.on("onCodePathSegmentEnd",e=>{n.at(-1)?.delete(e)}),e.on("onUnreachableCodePathSegmentStart",e=>{n.at(-1)?.add(e)}),e.on("onUnreachableCodePathSegmentEnd",e=>{n.at(-1)?.delete(e)}),e.onExit("BlockStatement",t=>{let o=n.at(-1);if(!o||!(EG.has(t.parent?.type)&&t.parent.body===t))return;let a=[...o].every(e=>!e.reachable),i=iT(t,e,EX)||ip(t,e);r.set(t.parent,a||i)}),e.onExit("CallExpression",a),e.onExit("NewExpression",a)},meta:{type:"problem",docs:{description:"Require boolean-returning Proxy traps to return booleans.",recommended:"unopinionated"},fixable:"code",messages:{[EH]:"Proxy trap `{{name}}` should return a boolean."},languages:["js/js"]}},"unicorn/logical-assignment-operators":Se,"unicorn/no-useless-coercion":{create:e=>{let{sourceCode:t}=e,r=(r,n,o,a)=>({node:r,messageId:St,data:{description:o,type:a},*fix(o,{abort:a}){if(t.getCommentsInside(r).length>0)return a();yield sV(o,r,n,e)}});e.on("CallExpression",t=>{if(t.optional||"Identifier"!==t.callee.type||1!==t.arguments.length||"SpreadElement"===t.arguments[0].type)return;let{name:n}=t.callee,o=Sr.get(n);if(!o||!rg(t.callee,e))return;let[a]=t.arguments;if(o.isType(a,e))return r(t,a,`\`${n}()\``,o.type)}),e.on("UnaryExpression",t=>{if("+"===t.operator&&oO(t.argument,e))return r(t,t.argument,"`+`","number")}),e.on("BinaryExpression",t=>{let n;if("+"!==t.operator)return;let{left:o,right:a}=t;if(tu(a,"")&&oR(o,e))n=o;else{if(!(tu(o,"")&&oR(a,e)))return;n=a}return r(t,n,"Concatenation with `''`","string")}),e.on("CallExpression",t=>{let{callee:n}=t;if(!t.optional&&!(t.arguments.length>0)&&"MemberExpression"===n.type&&!n.optional&&!n.computed&&"Identifier"===n.property.type&&"toString"===n.property.name&&oR(n.object,e))return r(t,n.object,"`.toString()`","string")})},meta:{type:"suggestion",docs:{description:"Disallow useless type coercions of values that are already of the target type.",recommended:"unopinionated"},fixable:"code",messages:{[St]:"{{description}} is unnecessary because the value is already a {{type}}."},languages:["js/js"]}},"unicorn/no-useless-boolean-cast":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(!tP(r,{methods:So,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))return;let[n]=r.arguments;if(!tj(n))return;let o=function(e){if(!e.async&&!e.generator&&!e.returnType){if("ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type)return e.body;if("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type)return e.body.body[0].argument}}(n);if(!tX(o,e)||r6(e,o))return;let[a]=o.arguments;if(!(n.params[0]?.type==="Identifier"&&aE(n.params[0],a))&&!(function e(t){return(t=rx(t),t?.type==="ChainExpression")?nu(t):t?.type==="LogicalExpression"?"&&"===t.operator&&e(t.left)||e(t.right):t?.type==="ConditionalExpression"?e(t.consequent)||e(t.alternate):t?.type==="SequenceExpression"&&e(t.expressions.at(-1))}(a)||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let t=r.getTypeAtLocation(e);return(t.isUnion()?t.types:[t]).some(e=>"void"===e.intrinsicName||nO.has(e.intrinsicName))}catch{return!1}}(a,e)))return r4(e,{node:o,messageId:Sn,data:{method:r.callee.property.name},fix(e){let r,i=t.getText(a);return"ArrowFunctionExpression"===n.type&&n.body===o&&(r=i,"SequenceExpression"===a.type||r.trimStart().startsWith("{"))&&(i=`(${i})`),e.replaceText(o,i)}})})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Boolean()` casts in array predicate callbacks.",recommended:"unopinionated"},fixable:"code",messages:{[Sn]:"`Boolean()` is unnecessary in `Array#{{method}}()` callbacks."},languages:["js/js"]}},"unicorn/no-useless-continue":{create:e=>{e.on("ContinueStatement",t=>{if(!t.label&&(e=>{if("BlockStatement"!==e.parent.type)return!1;let t=e;for(;;){let{parent:e}=t;if("BlockStatement"===e.type){if(e.body.at(-1)!==t)return!1;t=e;continue}if("IfStatement"===e.type&&(e.consequent===t||e.alternate===t)){t=e;continue}return tF(e)&&e.body===t}})(t))return{node:t,messageId:Sa,fix:r=>sQ(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Disallow useless `continue` statements.",recommended:"unopinionated"},fixable:"code",messages:{[Sa]:"Unnecessary `continue` statement."},languages:["js/js"]}},"unicorn/no-useless-override":{create:e=>{let{sourceCode:t}=e;e.on("MethodDefinition",r=>{let n;if("method"!==r.kind||r.accessibility||r.optional||r.decorators?.length>0||r.value.params.some(e=>e.decorators?.length>0))return;let{value:o}=r;if("FunctionExpression"!==o.type||!o.body||o.generator||!r.parent.parent.superClass)return;let a=function(e,t){let r,n,o,{value:a}=e;if(1!==a.body.body.length)return;let[i]=a.body.body;if("ReturnStatement"===i.type?r=i.argument:"ExpressionStatement"===i.type&&(r=i.expression),r?.type!=="CallExpression"||r.optional)return;let{callee:s}=r;if("MemberExpression"!==s.type||s.optional||"Super"!==s.object.type)return;let l=t.getScope(r),u=eK(e,l);if("string"==typeof u&&eK(s,l)===u&&(n=r.arguments,o=a.params,n.length===o.length&&o.every((e,t)=>{let r=n[t];return"Identifier"===e.type?"Identifier"===r.type&&r.name===e.name:"RestElement"===e.type&&"Identifier"===e.argument.type&&"SpreadElement"===r.type&&"Identifier"===r.argument.type&&r.argument.name===e.argument.name})))return{callExpression:r,name:u,isReturned:"ReturnStatement"===i.type}}(r,t);if(!a)return;let{callExpression:i,name:s,isReturned:l}=a;if(n=t.getScope(r),!r.parent.body.some(e=>e!==r&&"MethodDefinition"===e.type&&"method"===e.kind&&e.static===r.static&&null===e.value.body&&eK(e,n)===s)){if(l){let t;if(o.async&&(void 0===(t=Sl(i,e))||!0!==ab(t.type,t.checker)))return}else{let t;if(o.async||!(void 0!==(t=Sl(i,e))&&Ss(t.type)))return}return{node:r.key,messageId:Si,data:{superCall:t.getText(i.callee)},*fix(n,{abort:o}){if(t.getCommentsInside(r).length>0)return o();yield s3(r,"",n,e)}}}})},meta:{type:"suggestion",docs:{description:"Disallow useless overrides of class methods.",recommended:"unopinionated"},fixable:"code",messages:{[Si]:"Useless override; this method only forwards to `{{superCall}}(…)`."},languages:["js/js"]}},"unicorn/prefer-has-check":{create:e=>{e.on("CallExpression",t=>((e,t)=>{if(!tP(e,{method:"get",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}))return;let r=(e=>{let t=(e=>{for(;SE.has(e.parent.type);)e=e.parent;return e})(e),{parent:r}=t;if(r?.type==="BinaryExpression"&&["!==","===","!=","=="].includes(r.operator)){if(r.left===t)return{node:r,operator:r.operator,value:r.right};if(r.right===t)return{node:r,operator:r.operator,value:r.left}}})(e);if(r){let n,o;if(r6(t,e))return;let a=((e,t,r)=>{let n=SP(e.callee.object,r);if(!n)return;let o="!="===t.operator||"=="===t.operator;if("null-sentinel"===n.kind)return o&&Sk(t.value,r)?{missingType:"undefined"}:{missingType:"null"};if("map"===n.kind){if(Sk(t.value,r)&&SW(e.callee.object,r,o?"not-nullish":"not-undefined"))return{missingType:"undefined"};if(tg(t.value)&&o&&SW(e.callee.object,r,"not-nullish"))return{missingType:"nullish"}}})(e,r,t);if(!a||(n=r.value,o=a.missingType,"undefined"===o?!Sk(n,t):!tg(n)))return;return r4(t,{node:e.callee.property,messageId:Su,fix:((e,t,r)=>{if(r.sourceCode.getCommentsInside(t.node).length>r.sourceCode.getCommentsInside(e).length)return;let n=`${(({operator:e})=>"!=="===e||"!="===e)(t)?"":"!"}${se(e.callee.object,r)}.has(${ts(e.arguments[0],r)})`,o=iB(r.sourceCode.getTokenBefore(t.node),r,n)?";":"";return e=>e.replaceText(t.node,o+n)})(e,r,t)},e)}if((tZ(e,t)||tQ(e))&&SP(e.callee.object,t)?.kind==="map"&&SW(e.callee.object,t,"truthy")){if(r6(t,e))return;return r4(t,{node:e.callee.property,messageId:Su,fix:t=>t.replaceText(e.callee.property,"has")},e)}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `.has()` when checking existence.",recommended:"unopinionated"},fixable:"code",messages:{[Su]:"Prefer `.has(…)` when checking existence."},languages:["js/js"]}},"unicorn/consistent-conditional-object-spread":{create:e=>{e.options[0]===Sz?e.on("LogicalExpression",t=>{if(SX(t)){if("&&"!==t.operator||SG(t.right)||SY(t.left,t.right,e.sourceCode))return;let r=S1(t.left,e.sourceCode);if(r&&!r.isTrueWhenNullish&&SY(r.reference,t.right,e.sourceCode))return;let n=S3(t.left,e),o=S3(t.right,e);return{node:t,messageId:S_,data:{expectedStyle:"ternary"},*fix(r,{abort:a}){if(e.sourceCode.getCommentsInside(t).length>0)return a();yield r.replaceText(t,`${n} ? ${o} : {}`)}}}}):(e.on("ConditionalExpression",t=>{if(SX(t))return function(e,t){let{test:r,consequent:n,alternate:o}=e,a=SG(o);if(a===SG(n))return;let i=a?n:o,s=S1(r,t.sourceCode),l=t.sourceCode.getCommentsInside(e).length>0;if((a?SY(r,i,t.sourceCode):"UnaryExpression"===r.type&&"!"===r.operator&&r.prefix&&SY(r.argument,i,t.sourceCode))||s&&!l&&(s.isTrueWhenNullish?!a:a)&&SY(s.reference,i,t.sourceCode))return;let u=a?S2(r,"left",t):function(e,t){if("UnaryExpression"===e.type&&"!"===e.operator&&e.prefix)return S2(e.argument,"left",t);let r=ts(e,t);return!tl(e,t)&&sn(e,"!")&&(r=`(${r})`),`!${r}`}(r,t),p=S2(i,"right",t);return{node:e,messageId:S_,data:{expectedStyle:"logical"},*fix(t,{abort:r}){if(l)return r();yield t.replaceText(e,`${u} && ${p}`)}}}(t,e)}),e.on("LogicalExpression",t=>{if(SX(t))return function*(e,t){if("&&"!==e.operator)return;let r=e.left;for(;"LogicalExpression"===r.type&&"&&"===r.operator;)yield S5(r.right,"right",t),r=r.left;yield S5(r,"left",t)}(t,e)}))},meta:{type:"suggestion",docs:{description:"Enforce consistent conditional object spread style.",recommended:!0},fixable:"code",schema:[{description:"The conditional object spread style to enforce.",enum:[SV,Sz]}],defaultOptions:[SV],messages:{[S_]:"Prefer {{expectedStyle}} conditional object spreads.",[SJ]:"Unnecessary boolean cast. A falsy value spreads nothing."},languages:["js/js"]}},"unicorn/no-array-concat-in-loop":{create:e=>{e.on("AssignmentExpression",t=>{let r=function(e,t){var r;if("="!==e.operator)return;let n="Identifier"===e.left.type?e.left:void 0,o=rx(e.right);if(!n||!tP(o,{method:"concat",minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1}))return;let a="Identifier"===(r=rx(r=o.callee.object)).type?r:void 0,i=S8(n,t);if(!a||!i||i!==S8(a,t)||!function(e){let[t]=e.defs;if(1!==e.defs.length||"global"===e.scope.type||"Variable"!==t.type||"Identifier"!==t.node.id.type||"let"!==t.parent.kind&&"var"!==t.parent.kind)return!1;let r=t.node.init&&rx(t.node.init);return!!(r&&tw(r))}(i))return;let s=function(e,t){for(let r of t.sourceCode.getAncestors(e).toReversed()){if(tj(r))return;if(tF(r))return r}}(e,t),[l]=i.defs;if(!(!s||function(e,t,r){let[n,o]=r.sourceCode.getRange(e),[a,i]=r.sourceCode.getRange(t);return n>=a&&o<=i}(l.node,s.body,t)))return{callExpression:o,property:o.callee.property}}(t,e);if(r)return{node:r.property,messageId:S9}})},meta:{type:"suggestion",docs:{description:"Disallow array accumulation with `Array#concat()` in loops.",recommended:!0},schema:[],messages:{[S9]:"Do not use `Array#concat()` to accumulate an array in a loop."},languages:["js/js"]}},"unicorn/no-array-front-mutation":{create:e=>{e.on("CallExpression",t=>{if(!tP(t,{methods:["shift","unshift"],optionalCall:!1,computed:!1}))return;let{object:r,property:n}=t.callee,{name:o}=n;if(!("unshift"===o&&tq(t.callee,S4)||od(r,e)))return{node:n,messageId:S6,data:{method:o}}})},meta:{type:"suggestion",docs:{description:"Disallow front-of-array mutation.",recommended:!1},schema:[],messages:{[S6]:"Avoid front-of-array mutation with `Array#{{method}}()`."},languages:["js/js"]}},"unicorn/no-array-sort-for-min-max":{create:e=>{e.on("MemberExpression",t=>{if(!t.computed||t.optional||!Tt(t.property)||ns(t)||("ForInStatement"===t.parent.type||"ForOfStatement"===t.parent.type)&&t.parent.left===t)return;let r=Tr(t.object,e);if(r)return Tn(t,r,"first",e)}),e.on("CallExpression",t=>{let r;if(!tP(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let[n]=t.arguments;if(Tt(n)?r="first":tM(n)&&(r="last"),!r||ns(t))return;let o=Tr(t.callee.object,e);if(o)return Tn(t,o,r,e)})},meta:{type:"suggestion",docs:{description:"Disallow sorting arrays to get the minimum or maximum value.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[S7]:"Use `Math.{{method}}()` instead of sorting to get the {{extreme}} value.",[Te]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-boolean-sort-comparator":{create:e=>{e.on("CallExpression",t=>{let r,n;if(r=t,n=e,!(tS(r,{minimumArguments:1},tb)&&"MemberExpression"===r.callee.type&&Ti.has(eK(r.callee,n.sourceCode.getScope(r.callee)))))return;let[o]=t.arguments;if("SpreadElement"===o.type)return;let a=((e,t)=>{let r=rx(e);if(tj(r)){let n=(e=>{if("BlockStatement"!==e.body.type)return e.body;if(1!==e.body.body.length)return;let[t]=e.body.body;if("ReturnStatement"===t.type)return t.argument})(r);if(!oY(r,t)&&!Tu(e,t))return;return{node:e,messageId:To,suggest:e===r?((e,t,r)=>{var n;if(!t||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type)||e.params.some(e=>e.typeAnnotation)||e.params.some(e=>e.optional)||e.typeParameters||e.returnType||r.sourceCode.getCommentsInside(e).length>0)return;let[o,a]=e.params;if(o.name===a.name)return;let i="BinaryExpression"===(n=rx(n=t)).type&&Ts.has(n.operator)?n:void 0;if(!i||rh(i.left)||rh(i.right)||!Tl(i.left,i.right,o,a))return;let[s,l]=">"===i.operator||">="===i.operator?[i.left,i.right]:[i.right,i.left],u=`(${o.name}, ${a.name}) => ${r.sourceCode.getText(s)} - ${r.sourceCode.getText(l)}`;return[{messageId:Ta,data:{replacement:u},fix:t=>t.replaceText(e,u)}]})(r,n,t):void 0}}if(o0(r,t)||function(e,t){if("Identifier"===e.type)return("Boolean"===e.name||oW.has(e.name))&&t.sourceCode.isGlobalReference(e);if("MemberExpression"!==e.type||e.optional||"Identifier"!==e.object.type||!t.sourceCode.isGlobalReference(e.object))return!1;let r=oV.get(e.object.name),n=eK(e,t.sourceCode.getScope(e));return!!r?.has(n)}(r,t)||Tu(e,t))return{node:e,messageId:To}})(o,e);if(!(!a||ou(t.callee.object,e)))return a})},meta:{type:"problem",docs:{description:"Disallow boolean-returning sort comparators.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[To]:"Do not return a boolean from a sort comparator.",[Ta]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-chained-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{if(!Tf.has(r.operator))return;let n=Tg(r.left)?r.left:r.right;if(!Tg(n))return;let o=n===r.left,a=o?r.right:r.left;if(Tm.has(r.operator)&&o2(a,e))return;let i={node:r,messageId:Tp},s=Td.has(n.operator)===Td.has(r.operator)&&!tc(r.right);if(o&&s&&!Tg(r.right)&&!Tg(n.left)&&((e,t)=>{if(tl(e,t))return!0;let{parent:r}=e;return"BinaryExpression"!==r.type&&("LogicalExpression"!==r.type||"??"!==r.operator)})(r,e)&&!e0(n.right,t)&&0===t.getCommentsInside(r).length){let o=`${t.getText(r.left)} && ${ts(n.right,e)} ${r.operator} ${ts(r.right,e)}`;i.suggest=[{messageId:Tc,data:{replacement:o},fix:e=>e.replaceText(r,o)}]}return i})},meta:{type:"problem",docs:{description:"Disallow chained comparisons such as `a < b < c`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[Tp]:"Comparison operators cannot be chained. The inner comparison evaluates to a boolean, which is then compared instead of the operands.",[Tc]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-constant-zero-expression":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{if(!(e=>{switch(e.operator){case"*":case"&":return tu(e.left,0)||tu(e.right,0);case"/":return tu(e.left,0);default:return!1}})(r))return;let n={node:r,messageId:Ty},o=rP(r,e);return o&&Object.is(o.value,0)&&0===t.getCommentsInside(r).length&&(n.suggest=[{messageId:Th,fix:e=>e.replaceText(r,"0")}]),n})},meta:{type:"problem",docs:{description:"Disallow arithmetic and bitwise operations that always evaluate to `0`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[Ty]:"This operation always evaluates to `0` (or `-0`/`NaN`), which is likely a mistake.",[Th]:"Replace this expression with `0`."},languages:["js/js"]}},"unicorn/no-duplicate-logical-operands":{create:e=>{e.on("LogicalExpression",t=>{let r,n;if("&&"!==t.operator&&"||"!==t.operator)return;let o="LogicalExpression"===t.left.type&&t.left.operator===t.operator?t.left.right:t.left;if((e=>{for(let t=e.parent;t;t=t.parent)if("WithStatement"===t.type)return!0;return!1})(t)||!TS(o)||!TS(t.right)||!cH(o,t.right))return;let a={node:t.right,messageId:Tx};if(r=t.left,!e.sourceCode.getCommentsInside(t).every(t=>((e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=ti(t,r);return n>=a&&o<=i})(t,r,e)))return a;let i=ts(t.left,e),s=e=>e.replaceText(t,i);return TE.has(o.type)&&(n=t.right,TE.has(n.type))?{...a,fix:s}:{...a,suggest:[{messageId:Tb,fix:s}]}})},meta:{type:"problem",docs:{description:"Disallow adjacent duplicate operands in logical expressions.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[Tx]:"This operand duplicates the left operand.",[Tb]:"Remove the duplicate operand."},languages:["js/js"]}},"unicorn/no-impossible-length-comparison":{create:e=>{e.on("BinaryExpression",t=>{let r,n,o;if(!Object.hasOwn(TC,t.operator))return;let a=(r=rx(t.left),n=rx(t.right),nd(r)?{memberExpression:r,operator:t.operator,value:TD(n,e)}:nd(n)?{memberExpression:n,operator:TC[t.operator],value:TD(r,e)}:void 0);if(!a)return;let{memberExpression:i}=a;if("ThisExpression"===(o=rx(i.object)).type||"Super"===o.type||nu(i.object)||function(e,t){let{sourceCode:r}=t,n=rN(e,t);if(n)return!Number.isSafeInteger(n.value)||n.value<0;let{object:o}=e;if("Identifier"!==o.type)return!1;let a=eD(t.sourceCode.getScope(o),o),i=a?.defs.length===1?a.defs[0]:void 0;if(i?.type!=="Variable"||i.node.init?.type!=="ObjectExpression")return!1;let s=eK(e,t.sourceCode.getScope(e));if(i.node.init.properties.some(e=>"Property"===e.type&&["get","set"].includes(e.kind)&&eK(e,t.sourceCode.getScope(e))===s))return!0;let l=a.references.filter(e=>!e.init),u=nT(e),p=!1,c=!1,d=!1;for(let n of l){let o=nT(n.identifier)!==u||nC(n.identifier,t);if(o||!(r.getRange(n.identifier)[0]>r.getRange(e)[0])){if(nA(n,s,t)){p=!0;continue}if(nw(n,s,t)){!o&&nS(n,s,t)?c=!0:p=!0;continue}if(nv(n,s,t)){if(o){p=!0;continue}d=!0;continue}if(!nk(n,s,t)){if(o){p=!0;continue}return!1}}}if(p)return!0;if(c)return!1;if(d)return!0;let m=rN(i.node.init,t)?.value;return!!(m&&(!Number.isSafeInteger(m[s])||m[s]<0))}(i,e)||function({node:e,lengthOrSizeNode:t}){let r=function(e){for(;tJ(e.parent)&&"&&"===e.parent.operator;)e=e.parent;return e}(e);return"LogicalExpression"===r.type&&"&&"===r.operator&&(function e(t){return[t.left,t.right].flatMap(r=>"LogicalExpression"===r.type&&r.operator===t.operator?e(r):[r])})(r).some(r=>r!==e&&tL(r,{computed:!1,optional:!1})&&"Identifier"===r.property.type&&np.has(r.property.name)&&rf(r.object,t.object))}({node:t,lengthOrSizeNode:i}))return;let s=function({operator:e,value:t}){if("number"==typeof t&&Number.isFinite(t))switch(e){case"<":return!(t<=0)&&void 0;case"<=":case"===":case"==":return!(t<0)&&void 0;case">":case"!==":case"!=":return t<0||void 0;case">=":return t<=0||void 0}}(a);if(void 0!==s)return{node:t,messageId:TT,data:{property:i.property.name,result:String(s)}}})},meta:{type:"problem",docs:{description:"Disallow impossible comparisons against `.length` or `.size`.",recommended:"unopinionated"},messages:{[TT]:"This comparison is always {{result}} because `.{{property}}` is always a non-negative integer."},languages:["js/js"]}},"unicorn/no-invalid-character-comparison":{create:e=>{e.on("BinaryExpression",t=>{if(TA.has(t.operator))for(let[r,n]of[[t.left,t.right],[t.right,t.left]]){let o=td(n);if(void 0!==o&&o.length>1&&Tk(r,e)){let e="!=="===t.operator||"!="===t.operator;return{node:t,messageId:Tw,data:{string:o,result:e?"true":"false"}}}}})},meta:{type:"problem",docs:{description:"Disallow comparing a single character from a string to a multi-character string.",recommended:"unopinionated"},schema:[],messages:{[Tw]:"A single character can never equal the multi-character string `{{string}}`, so this comparison is always {{result}}."},languages:["js/js"]}},"unicorn/no-loop-iterable-mutation":{create:e=>{let t=new s,r=sc(e);e.onExit("ForOfStatement",n=>{if(n.await)return;let o=TU(n.right,e);if(o)return function* e(t,r,n,o){if(TN.has(t.type))return;let a=n;if("ForOfStatement"===t.type&&!t.await){let e=TU(t.right,o);e&&Tz(e.reference,r.iterable,o)&&(a=TW(t,e))}if("CallExpression"===t.type){let e=function(e,t,r,n){if("MemberExpression"!==e.callee.type)return;let{addArgumentIdentifier:o,deleteArgumentIdentifier:a,iterable:i,reportedCallExpressions:s,setKeyIdentifier:l}=t,{object:u,property:p}=e.callee,c=eK(e.callee,n.sourceCode.getScope(e.callee));if(!(!TB[t.collectionKind??"unknown"].has(c)||!Tz(u,i,n)||"delete"===c&&T_(e,a,n)||TJ(e,{addArgumentIdentifier:o,setKeyIdentifier:l},c,n)&&!function e(t,r,n){let o=function(e){let t=e;for(;t.parent&&"BlockStatement"!==t.parent.type&&"SwitchCase"!==t.parent.type;)t=t.parent;if(t.parent)return{parent:t.parent,statement:t,statements:"SwitchCase"===t.parent.type?t.parent.consequent:t.parent.body}}(t);if(!o)return!1;let{statement:a,statements:i}=o,s=i.indexOf(a);return!!i.slice(0,s).some(e=>(function e(t,r,n){let o=function(e){if("ExpressionStatement"!==e.type)return;let t=rx(e.expression);return"CallExpression"===t.type?t:void 0}(t);if(o)return"MemberExpression"===o.callee.type&&"delete"===eK(o.callee,n.sourceCode.getScope(o.callee))&&Tz(o.callee.object,r.iterable,n)&&T_(o,r.deleteArgumentIdentifier,n);return"BlockStatement"===t.type?t.body.some(t=>e(t,r,n)):"IfStatement"===t.type?!r.branchAlwaysExits(t.consequent)&&e(t.consequent,r,n)||t.alternate&&!r.branchAlwaysExits(t.alternate)&&e(t.alternate,r,n):"SwitchStatement"===t.type&&t.cases.some((o,a)=>!function(e,t){for(let r of e.slice(t)){if(TH(r.consequent,e=>TK.has(e.type)))return!0;if(TH(r.consequent,e=>"BreakStatement"===e.type&&!e.label))break}return!1}(t.cases,a)&&o.consequent.some(t=>e(t,r,n)))})(e,r,n))||o.parent!==r.loopBody&&e(o.parent,r,n)}(e,t,n)||r&&TJ(e,r,c,n))&&!s.has(e))return s.add(e),{node:p,messageId:TI,data:{iterable:n.sourceCode.getText(i)}}}(t,r,n,o);e&&(yield e)}for(let n of t1(t,o.sourceCode.visitorKeys))yield*e(n,r,a,o)}(n.body,{branchAlwaysExits:r,...TW(n,o),reportedCallExpressions:t},void 0,e)})},meta:{type:"problem",docs:{description:"Disallow mutating a loop iterable during iteration.",recommended:!0},schema:[],messages:{[TI]:"Do not mutate `{{iterable}}` while iterating over it."},languages:["js/js"]}},"unicorn/no-selector-as-dom-name":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",function*(e){for(let{node:r,expectedPrefix:n}of(e=>{if(tP(e,{methods:TX})&&tL(e.callee.object,{property:"classList",computed:!1})&&!am(rx(e.callee.object.object))){let t=e.callee.property.name;return"add"===t||"remove"===t?T2(e.arguments,"."):"replace"===t?e.arguments[0]?.type==="SpreadElement"?[]:T2(e.arguments.slice(0,2),"."):T2(e.arguments.slice(0,1),".")}if(tP(e,{methods:["getElementById","getElementsByClassName"],argumentsLength:1})&&!am(rx(e.callee.object))){let t="getElementById"===e.callee.property.name?"#":".";return T2(e.arguments,t)}return[]})(e)){if("SpreadElement"===r.type)continue;let e=rx(r),o=T0(e);TQ(o)&&(yield T1(e,o,n,t))}})},meta:{type:"problem",docs:{description:"Disallow selector syntax in DOM names.",recommended:!0},fixable:"code",messages:{[TG]:"Do not use selector syntax in DOM names."},languages:["js/js"]}},"unicorn/no-useless-compound-assignment":{create:e=>{let{sourceCode:t}=e;e.on("AssignmentExpression",r=>{if(!T9.has(r.operator)||!tm(r.right)||r.right.value!==T9.get(r.operator))return;let n={operator:r.operator,value:r.right.raw},{parent:o}=r,a="ExpressionStatement"===o.type&&["Program","BlockStatement","StaticBlock","SwitchCase"].includes(o.parent.type);if(t.getCommentsInside(a?o:r).length>0)return{node:r,messageId:T3,data:n};if(a)return{node:r,messageId:T3,data:n,suggest:[{messageId:T5,fix:t=>sQ(o,e,t)}]};let i=t.getText(r.left);return{node:r,messageId:T3,data:n,suggest:[{messageId:T8,data:{left:i},fix:e=>e.replaceText(r,i)}]}})},meta:{type:"suggestion",docs:{description:"Disallow useless compound assignments such as `x += 0`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[T3]:"This compound assignment is useless as `{{operator}} {{value}}` does not change the value.",[T5]:"Remove the useless assignment.",[T8]:"Replace the useless assignment with `{{left}}`."},languages:["js/js"]}},"unicorn/no-useless-delete-check":{create:e=>{e.on("IfStatement",t=>{let r=function(e,t){if(e.alternate||"IfStatement"===e.parent.type&&e.parent.alternate===e)return;let r=(e=>{if("BlockStatement"===e.type){if(1!==e.body.length)return;e=e.body[0]}return"ExpressionStatement"===e.type?e.expression:void 0})(e.consequent);if(r)return"UnaryExpression"===r.type&&"delete"===r.operator?function(e,t,r){let n,{test:o}=e,{argument:a}=t;if("BinaryExpression"===o.type&&"in"===o.operator&&"MemberExpression"===a.type&&!a.optional&&rf(o.right,a.object)&&Cl(o.right,r)&&Cu(o.left,r)&&Cu(o.right,r)&&(!a.computed||Cu(a.property,r))){if(a.computed)n=((e,t,r)=>{if(rf(e,t))return!((e,t)=>{var r;let n;if(Cl(e,t)||Ci(rx(e),t))return!0;let o=na(rx(e),t);if(!o)return!1;let a=rx(o);return"NewExpression"===a.type||"CallExpression"===(r="ChainExpression"===(n=r=a).type?n.expression:n).type&&void 0===Cs(r,t)})(e,r);let n=Cs(e,r),o=Cs(t,r);return void 0!==n&&n===o})(o.left,a.property,r);else{let e=eK(a,r.sourceCode.getScope(a));n=null!==e&&e===Cs(o.left,r)}return n?{suggest:[{messageId:T4,fix:Cc(e,t,r)}]}:void 0}}(e,r,t):function(e,t,r){let{test:n}=e,o=rx(n),a=rx(t);if(Cp(o,"has")&&Cp(a,"delete")&&((e,t)=>{let r;if("Identifier"!==(e=rx(e)).type)return!1;let n=na(e,t);if(!n)return!1;let o=rx(n);return"NewExpression"===o.type&&(r=o.callee,"Identifier"===r.type&&Ce.has(r.name)&&t.sourceCode.isGlobalReference(r))})(o.callee.object,r)&&rf(o.callee.object,a.callee.object)&&rf(o.arguments[0],a.arguments[0])&&Cu(o.arguments[0],r))return{fix:Cc(e,t,r)}}(e,r,t)}(t,e);if(r)return{node:t.test,messageId:T6,fix:r.fix,suggest:r.suggest}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary existence checks before deletion.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[T6]:"The existence check before deletion is unnecessary.",[T4]:"Remove the existence check."},languages:["js/js"]}},"unicorn/no-useless-logical-operand":{create:e=>{e.on("LogicalExpression",t=>{if(!Cm.has(t.operator)||"LogicalExpression"===t.parent.type&&t.parent.operator===t.operator)return;let r=function(e,t){let r,n,{operator:o}=e,a=function e(t,r){return"LogicalExpression"===t.type&&t.operator===r?[...e(t.left,r),...e(t.right,r)]:[t]}(e,o),i=(r=Cf.get(o),tc(rx(a[0]),r)?a[0]:void 0);if(i)return{target:i,replacementOperands:[i]};let s=(n=Cm.get(o),a.filter((e,r)=>tc(rx(e),n)&&function(e,t,r){var n;if(t<e.length-1)return!0;let o=e.slice(0,-1);return tZ(n=e[t].parent,r)||tQ(n)||o.every(e=>o2(e,r))}(a,r,t)));if(0===s.length)return;let l=a.filter(e=>!s.includes(e));return{target:s[0],replacementOperands:0===l.length?[s.at(-1)]:l}}(t,e);if(!r)return;let{target:n,replacementOperands:o}=r;if(1===o.length&&tp(rx(o[0]))&&function(e){let{parent:t}=e;if("ExpressionStatement"!==t.type||t.expression!==e)return!1;let r=t.parent,n=r.parent;if("Program"!==r.type&&!("BlockStatement"===r.type&&tj(n)))return!1;let o=r.body.indexOf(t);return r.body.slice(0,o).every(e=>"string"==typeof e.directive)}(t))return;let a={node:n,messageId:Cd,data:{operator:t.operator}};return e.sourceCode.getCommentsInside(t).length>0||(1===o.length?a.fix=r=>sV(r,t,o[0],e):a.fix=r=>{var n;let a;return r.replaceText(t,(n=t.operator,a=o.map((t,r)=>{let o,a;return o=tl(t,e),a=ts(t,e),!o&&so(t,{operator:n,property:0===r?"left":"right"})&&(a=`(${a})`),0===r&&!o&&Cg.has(rx(t).type)&&(a=`(${a})`),a}).join(` ${n} `),iB(e.sourceCode.getTokenBefore(t),e,a)?`;${a}`:a))}),a})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary operands in logical expressions involving boolean literals.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Cd]:"Simplify this `{{operator}}` expression."},languages:["js/js"]}},"unicorn/prefer-boolean-return":{create:e=>{let{sourceCode:t}=e;function r(n,o,a,i=t.getRange(n)){let s;if(!o||!a||"ConditionalExpression"===n.test.type)return;let l=Cb(o),u=Cb(a);if(void 0===l||void 0===u||l===u)return;let p={node:n,messageId:Cy},c=!l,d=t.getCommentsInside(n).length>0||t.getCommentsInside(a).length>0||r7(e,a),m=!c&&!Cv(n.test,e)&&!!(s=eD(t.getScope(n),"Boolean"))&&0!==s.defs.length;return d||m?p:{...p,fix:t=>t.replaceTextRange(i,`return ${function(t,r){let n=ts(t,e);if(r)return sn(t,"!")?`!(${n})`:`!${n}`;if(Cv(t,e))return n;let o="SequenceExpression"===t.type?`(${n})`:n;return`Boolean(${o})`}(n.test,c)};`)}}e.on("IfStatement",n=>{if(!n.alternate){var o,a;let i,s=sm(n,e);if(!s||"ReturnStatement"!==s.type)return;let l=Cx(n.consequent),u=Cb(l);if(void 0!==u&&(o=n,a=u,i=sd(o,e,-1),i?.type==="IfStatement"&&!i.alternate&&Cb(Cx(i.consequent))===a))return;let p=r(n,l,s,[t.getRange(n)[0],t.getRange(s)[1]]);return p?.fix&&t.getTokensBetween(n,s,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type)?{node:n,messageId:Cy}:p}return r(n,Cx(n.consequent),Cx(n.alternate))})},meta:{type:"suggestion",docs:{description:"Prefer directly returning boolean expressions over `if` statements.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Cy]:"Return the boolean expression directly."},languages:["js/js"]}},"unicorn/prefer-flat-math-min-max":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{let n=(e=>{for(let t of CS)if(CT(e,t))return t})(r);if(!(!n||!r.arguments.some(e=>CT(e,n))||((e,t)=>{let{parent:r}=e;return CT(r,t)&&r.arguments.includes(e)})(r,n)))return{node:r,messageId:CE,data:{method:n},*fix(o,{abort:a}){if(t.getCommentsInside(r).length>0)return a();let i=t.getText(r.callee),s=CC(r,n).map(t=>ts(t,e)).join(", ");yield o.replaceText(r,`${i}(${s})`)}}})},meta:{type:"suggestion",docs:{description:"Prefer flat `Math.min()` and `Math.max()` calls over nested calls.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[CE]:"Prefer a flat `Math.{{method}}()` call instead of nested calls."},languages:["js/js"]}},"unicorn/prefer-hoisting-branch-code":{create:e=>{e.on("IfStatement",t=>(function*(e,t){if("IfStatement"===e.parent.type&&e.parent.alternate===e)return;let r=function(e){let t=[],r=e;for(;r?.type==="IfStatement";r=r.alternate)t.push(r.consequent);if(r)return t.push(r),t}(e);if(!r||r.some(e=>"BlockStatement"!==e.type))return;let{sourceCode:n}=t,{leading:o,trailing:a,minLength:i}=function(e,t){let r=Math.min(...e.map(e=>e.length)),n=0;for(;n<r&&e.every(r=>CR(r[n],e[0][n],t));)n++;let o=0;for(;n+o<r&&e.every(r=>CR(r.at(-1-o),e[0].at(-1-o),t));)o++;return{leading:n,trailing:o,minLength:r}}(r.map(e=>e.body),n);0===o&&0===a||!(o+a>=i)&&(o>0&&(yield CB({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!0},t)),a>0&&(yield CB({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!1},t)))})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer moving code shared by all branches of an `if` statement out of the branches.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[CD]:"These branches start with the same code. Move it before the `if` statement.",[Cw]:"These branches end with the same code. Move it after the `if` statement.",[CA]:"Move the shared code out of the branches."},languages:["js/js"]}},"unicorn/prefer-single-replace":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(void 0===C$(r))return;let n=r.arguments[1];if(!tp(n))return;let a=n.value;if(a.includes("$`")||a.includes("$'"))return;let i=e=>void 0!==C$(e)&&tp(e.arguments[1])&&e.arguments[1].value===a,{parent:s}=r;if("MemberExpression"===s.type&&s.object===r&&"CallExpression"===s.parent.type&&s.parent.callee===s&&i(s.parent))return;let l=[],u=r;for(;i(u);)l.push(C$(u)),u=u.callee.object;if(l.length<2)return;let p=u;l.reverse();let c=[...new o(l)];if(c.some(e=>a.includes(e)))return;let d={node:r,messageId:CN};if(0===t.getCommentsInside(r).length){let t=c.map((e,t)=>(function(e,t,r){if(CM.has(e))return CM.get(e);if("^"===e)return t?String.raw`\^`:"^";if("-"===e)return t||r?"-":String.raw`\-`;let n=e.codePointAt(0);return n<32||127===n?String.raw`\x${n.toString(16).toUpperCase().padStart(2,"0")}`:e})(e,0===t,t===c.length-1)).join(""),o=ts(p,e),a=ts(n,e);d.fix=e=>e.replaceText(r,`${o}.replaceAll(/[${t}]/g, ${a})`)}return d})},meta:{type:"suggestion",docs:{description:"Enforce combining multiple single-character replacements into a single `String#replaceAll()` with a regular expression.",recommended:"unopinionated"},fixable:"code",messages:{[CN]:"Combine these single-character replacements into a single `replaceAll()` with a regular expression."},languages:["js/js"]}},"unicorn/consistent-tuple-labels":{create:e=>{e.on("TSTupleType",e=>{let t=e.elementTypes;if(t.length<2)return;let r=t.filter(e=>"TSNamedTupleMember"!==e.type&&("TSRestType"!==e.type||"TSNamedTupleMember"!==e.typeAnnotation.type));if(0!==r.length&&r.length!==t.length)return r.map(e=>({node:e,messageId:CO}))})},meta:{type:"suggestion",docs:{description:"Enforce consistent labels on tuple type elements.",recommended:!0},messages:{[CO]:"This tuple element should have a label, just like the other elements."},languages:["js/js"]}},"unicorn/no-invalid-well-known-symbol-methods":{create:e=>{e.on("MethodDefinition",t=>CK(t,e)),e.on("Property",t=>CK(t,e)),e.on("PropertyDefinition",t=>CK(t,e))},meta:{type:"problem",docs:{description:"Disallow invalid implementations of well-known symbol methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[CU]:"`Symbol.dispose` must not return a Promise. Use `Symbol.asyncDispose` instead.",[Cq]:"`Symbol.dispose` must not be a generator. Use a normal method for synchronous disposal or `Symbol.asyncDispose` for asynchronous disposal.",[CW]:"`Symbol.iterator` must return a sync iterator. Use `Symbol.asyncIterator` for async iterators.",[CV]:"`Symbol.asyncIterator` must return an async iterator directly. Use an async generator or return the iterator synchronously.",[Cz]:"Use `Symbol.{{replacement}}` instead."},languages:["js/js"]}},"unicorn/no-late-event-control":{create:e=>{let{sourceCode:t}=e,r=xS(e);e.onExit("CallExpression",n=>{var o;let a=(e=>{let{callee:t}=e;if("MemberExpression"!==t.type)return;let r=eK(t);if(!CZ.has(r))return;let n=rx(t.object);if("Identifier"===n.type)return{event:n,method:r}})(n);if(!a)return;let{event:i,method:s}=a,l=eD(t.getScope(i),i),u=l?.defs.find(({type:e})=>"Parameter"===e);if(!u)return;let p=u.node;if(!(!oy(o=u.name,e)&&(xb.test(o.name)||og(o,e))))return;let c=xv(n)!==p,d=p.generator;if(!c&&!d&&!r.isFunctionSuspended(p)&&!r.isInsideSuspendingLoop(n,p))return;let m=CG;return c?m=CY:d&&(m=CX),{node:n,messageId:m,data:{name:i.name,method:s}}})},meta:{type:"problem",docs:{description:"Disallow event-control method calls after the synchronous event dispatch has finished.",recommended:!0},schema:[],messages:{[CG]:"`{{name}}.{{method}}()` has no effect after the handler suspends. Call it before `await` or `yield` while the event is still being dispatched.",[CX]:"`{{name}}.{{method}}()` is not called during event dispatch inside a generator function. Use a normal function handler instead.",[CY]:"`{{name}}.{{method}}()` may run after synchronous event dispatch has finished. Call it in the outer handler before deferring work."},languages:["js/js"]}},"unicorn/prefer-abort-signal-timeout":{create:e=>{e.on("VariableDeclarator",t=>((e,t)=>{var r;let n,o,{sourceCode:a}=t,i=e.parent,{id:s,init:l}=e;if("VariableDeclaration"!==i.type||"const"!==i.kind||1!==i.declarations.length||"Identifier"!==s.type||!(tT(l,{name:"AbortController",argumentsLength:0})&&rg(l.callee,t))||(n=eD(t.sourceCode.getScope(s),"AbortSignal"))&&0!==n.defs.length||r6(t,l)||s.typeAnnotation&&r6(t,s.typeAnnotation))return;let u=(e=>{let t=Array.isArray(e.parent.body)?e.parent.body:Array.isArray(e.parent.consequent)?e.parent.consequent:void 0;if(t)return t[t.indexOf(e)+1]})(i),p=((e,t)=>{if(e?.type==="ExpressionStatement"&&tS(e.expression,{name:"setTimeout",argumentsLength:2,optional:!1},tb)&&rg(e.expression.callee,t))return e.expression})(u,t);if(!p||((e,t,r)=>{let{sourceCode:n}=e,[,o]=n.getRange(t),[a]=n.getRange(r);return r6(e,[o,a])})(t,i,u)||r6(t,u)||r7(t,u,{ignoreDirectives:!0}))return;let c=((e,t)=>{let[r]=e.arguments,n=!r||"ArrowFunctionExpression"!==r.type&&"FunctionExpression"!==r.type||r.async||r.generator||r.params.length>0?void 0:"BlockStatement"!==r.body.type?r.body:1===r.body.body.length&&"ExpressionStatement"===r.body.body[0].type?r.body.body[0].expression:void 0;if(tS(n,{argumentsLength:0,optional:!1},tb)&&tL(n.callee,{property:"abort",computed:!1,optional:!1})&&"Identifier"===n.callee.object.type&&n.callee.object.name===t)return n.callee.object})(p,s.name);if(!c)return;let d=eD(a.getScope(s),s);if(eD(a.getScope(c),c)!==d)return;let m=((e,t,r)=>{let n=[];for(let o of e.references){let{identifier:e}=o;if(e===t||o.init)continue;if(o.isWrite())return;let a=C2(e,r);if(!a)return;n.push(a)}return n.length>0?n:void 0})(d,c,t);if(!m)return;let f=a.getRange(u),[,g]=p.arguments;if("SequenceExpression"===g.type||!((e,t)=>{let r=rN(e,t);if(!r&&rB(e,t)&&eJ(e,t.sourceCode.getScope(e)))return!1;if(!r)return!0;let{value:n}=r;return"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&n<=0x7fffffff})(g,t)||m.some(e=>{let r;return(r=t.sourceCode.getRange(e))[0]>=f[0]&&r[1]<=f[1]}))return;let y=(r=s.name,o=r,("abortController"===r?o="abortSignal":"controller"===r&&(o="signal"),o===r||C3(o,d,d.identifiers[0],t)||m.some(e=>C3(o,d,e,t)))?r:o),h=`AbortSignal.timeout(${a.getText(g)})`,x=r7(t,u),b=[a.getRange(i)[1],a.getRange(u)[1]],v=r4(t,{node:s,messageId:CQ,suggest:[{messageId:C0,*fix(e){if(yield e.replaceText(l,h),s.typeAnnotation&&(yield e.replaceText(s.typeAnnotation,": AbortSignal")),y!==s.name){let[t]=a.getRange(s);yield e.replaceTextRange([t,t+s.name.length],y)}for(let t of m)yield e.replaceText(t,y);yield sQ(u,t,e)}}]},b);for(let e of[l,s.typeAnnotation,x,...m].filter(Boolean))v=r4(t,v,e);return v})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[CQ]:"Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.",[C0]:"Replace with `AbortSignal.timeout()`."},languages:["js/js"]}},"unicorn/prefer-aggregate-error":{create:e=>{e.on("IfStatement",t=>{var r;let n,o="ThrowStatement"===(r=t.consequent).type?r:"BlockStatement"===r.type&&1===r.body.length&&"ThrowStatement"===r.body[0].type?r.body[0]:void 0;if(!o)return;let a=function(e,t){let r=e.argument;if(tT(r,{name:"Error",maximumArguments:2})&&rg(r.callee,t))return r}(o,e);if(!a)return;let i=function(e,t){let r=Dr(e.test).map(e=>(function(e,t){let r=De(e=rx(e),t);if(r)return r;if("BinaryExpression"!==e.type)return;let n=De(e.left,t);if(n&&Dt(e.operator,e.right,!0))return n;let o=De(e.right,t);if(o&&Dt(e.operator,e.left,!1))return o})(e,t)).filter(Boolean);if(1===r.length)return r[0]}(t,e);if(!i||(n=iP("AggregateError",e.sourceCode.getScope(a)))&&0!==n.defs.length)return;let{sourceCode:s}=e;return{node:a.callee,messageId:C5,fix:e.sourceCode.getCommentsInside(a).length>0?void 0:e=>{let t=[s.getText(i),...a.arguments.map(e=>s.getText(e))].join(", ");return e.replaceText(a,`new AggregateError(${t})`)}}})},meta:{type:"suggestion",docs:{description:"Prefer `AggregateError` when throwing collected errors.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[C5]:"Use `AggregateError` when throwing collected errors."},languages:["js/js"]}},"unicorn/prefer-observer-apis":{create:e=>{e.on("CallExpression",t=>{var r,n;let o;if(r=t,n=e,tP(r,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})?!!Dy(r.callee.object,n):!(tS(r,{name:"addEventListener",minimumArguments:2,maximumArguments:3,optional:!1},tb)&&rg(r.callee,n)))return;let[a,i]=t.arguments,s=td(o=rx(a))??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{var n=r.getTypeAtLocation(e);if(n.isStringLiteral?.())return n.value;return}catch{}})(o,e);if(!Do.has(s))return;let l=((e,t)=>{if(tj(e=rx(e)))return e;if("Identifier"!==e.type)return;let r=eD(t.sourceCode.getScope(e),e);if(!r||1!==r.defs.length)return;let[n]=r.defs;if("FunctionName"===n.type)return n.node;let o=n.node.init&&rx(n.node.init);if("Variable"===n.type&&"const"===n.parent.kind&&o&&tj(o))return o})(i,e);if(l&&DD(l.body,e))return{node:a,messageId:s}})},meta:{type:"suggestion",docs:{description:"Prefer observer APIs over resize and scroll listeners with layout reads.",recommended:!0},schema:[],messages:Dn,languages:["js/js"]}},"unicorn/prefer-set-methods":{create:e=>{e.on("NewExpression",t=>{let r=((e,t)=>{if(!DL(e,t)||r6(t,e))return;let[r]=e.arguments;if("ArrayExpression"===r.type&&r.elements.length>=2&&r.elements.every(e=>{let r;return D$(e,t)&&(r=e.argument,tT(r,{name:"Set",argumentsLength:0})&&rg(r.callee,t)||!e0(r,t.sourceCode,{considerGetters:!0}))}))return r4(t,{node:e,messageId:Dw,fix:n=>n.replaceText(e,DN(e,((e,t)=>{let[r,...n]=e.elements.map(e=>e.argument),o=se(r,t);for(let e of n)o+=`.union(${ts(e,t)})`;return o})(r,t),t))})})(t,e);if(r)return r;if(!DL(t,e))return;let[n]=t.arguments;return DV((e=>{for(;e?.type==="ParenthesizedExpression"||rh(e);)e=e.expression;return e})(n),t,e)}),e.on("CallExpression",t=>{let r=((e,t)=>{if(!tP(e,{methods:["every","some"],argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=DO(e.callee.object,t),[n]=e.arguments;if(!r||!DU(n,t))return;let o=DW(n.body,n.params[0],t);if(!o)return;let a=e.callee.property.name;return Dz(e,{set:r,otherSet:o.otherSet,method:DB[a][o.method],negated:"some"===a},t)})(t,e);return r||((e=>{let{parent:t}=e=DM(e);return(t?.type==="CallExpression"||t?.type==="NewExpression")&&(t.callee===e||t.arguments.includes(e))})(t)?void 0:DV(t,t,e))}),e.on("BinaryExpression",t=>((e,t)=>{let r="==="===e.operator||"!=="===e.operator,n=">"===e.operator&&tu(e.right,0)||"<"===e.operator&&tu(e.left,0);if(!r&&!n)return;let o=tu(e.right,0)?e.left:e.right;if(!tu(o===e.left?e.right:e.left,0)||!tL(o,{property:"size",optional:!1})||!tP(o.object,{methods:["intersection","difference"],argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let{callee:a}=o.object,[i]=o.object.arguments,s=a.object;if("Set"===iK(s,t)&&"Set"===iK(i,t))return Dz(e,{set:s,otherSet:i,method:"intersection"===a.property.name?"isDisjointFrom":"isSubsetOf",negated:"==="!==e.operator},t)})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `Set` methods for Set operations.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[Dw]:"Use `Set#union()` instead of spreading Sets into a new Set.",[DA]:"Use `Set#intersection()` instead of filtering by `Set#has()`.",[Dk]:"Use `Set#intersection()`.",[DI]:"Use `Set#difference()` instead of filtering by `Set#has()`.",[Dj]:"Use `Set#difference()`.",[DR]:"Use `Set#isSubsetOf()` to check whether a Set is a subset of another Set.",[DF]:"Use `Set#isDisjointFrom()` to check whether Sets have any elements in common."},languages:["js/js"]}},"unicorn/prefer-toggle-attribute":{create:e=>{let{sourceCode:t}=e;e.on(["IfStatement","ConditionalExpression"],r=>{let n=DX(r.consequent),o=DX(r.alternate);if(!((e,t,r)=>!!(e&&t&&("setAttribute"===e.method&&"removeAttribute"===t.method||"removeAttribute"===e.method&&"setAttribute"===t.method)&&DY(e,t)&&!nu(e.receiver)&&!nu(t.receiver)&&!DZ(e,r)&&!DZ(t,r)))(n,o,e))return;let a="setAttribute"===n.method?n:o,i=n===a,s=function e(t,r,n,o=!1){if("ChainExpression"===t.type)return e(t.expression,r,n,o);if("UnaryExpression"===t.type&&"!"===t.operator&&t.prefix)return e(t.argument,r,n,!o);let a=DG(t);if(a?.method==="hasAttribute"&&DY(a,r)&&!nu(a.receiver))return{isNegative:o,isKnownNonDom:DZ(a,n)}}(r.test,a,e);if(s?.isKnownNonDom)return;let l=s&&i===s.isNegative?"":DH(r.test,e,!i),u=a.hasEmptyAttributeValue||void 0!==td(a.attributeValue),p=!!l&&a.isOptional||!u,c=[a.receiver,a.attributeName];l&&c.push(r.test);let d=p||r9(e,r,c)?void 0:function*(n){let o=se(a.receiver,e),i=ts(a.attributeName,e),s=a.isOptional?"?":"",u="ConditionalExpression"===r.type,p=`${o}${s}.toggleAttribute(${i}${l?`, ${l}`:""})`;u||(p+=";"),iB(t.getTokenBefore(r),e,p)&&(p=`;${p}`),yield n.replaceText(r,p),u&&(yield sK(n,r,e))};return((e,t,{forceSuggestion:r=!1}={})=>{let n={node:e,messageId:D_};if(!t)return n;let o="IfStatement"!==e.type&&!(tk(e)||tk(e.parent));return r||o?n.suggest=[{messageId:DJ,fix:t}]:n.fix=t,n})(r,d,{forceSuggestion:!!l||!a.hasEmptyAttributeValue})})},meta:{type:"suggestion",docs:{description:"Prefer using `Element#toggleAttribute()` to toggle attributes.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[D_]:"Prefer using `Element#toggleAttribute()` to toggle attributes.",[DJ]:"Replace with `Element#toggleAttribute()`."},languages:["js/js"]}},"unicorn/prefer-url-search-parameters":{create:e=>{e.on("CallExpression",t=>{let r,n=((e,t)=>{if(!(tP(e,{object:"Object",method:"fromEntries",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})&&D3("Object",e,t)))return;let[r]=e.arguments,n=D9(r,t);if(!n)return;let o=D4(e,r,D6(n.query,t),t);return we({node:e,query:n.query,replacement:o,preservedNodes:[...D7(e,r,t),n.query]},t)})(t,e);if(n)return n;if((r=(e=>{let t=e,{parent:r}=e;for(;rh(r)&&r.expression===t;)t=r,r=r.parent;return r?.arguments?.[0]===t?r:void 0})(t))&&("CallExpression"===r.type&&1===r.arguments.length&&"MemberExpression"===r.callee.type&&"Identifier"===r.callee.object.type&&"Object"===r.callee.object.name&&((e,t,{computed:r})=>r?td(e)===t:"Identifier"===e.type&&e.name===t)(r.callee.property,"fromEntries",{computed:r.callee.computed})||tT(r,{names:["Map","URLSearchParams"],argumentsLength:1})))return;let o=D9(t,e);if(o)return we({node:t,query:o.query,replacement:D6(o.query,e)},e)}),e.on("NewExpression",t=>((e,t)=>{let r=tT(e,{name:"Map",argumentsLength:1})&&D3("Map",e,t);if(!r&&!tT(e,{name:"URLSearchParams",argumentsLength:1}))return;let[n]=e.arguments,o=D9(n,t);if(!o)return;let a=D8(o.query,t),i=D6(o.query,t),s=D4(e,n,r?i:a,t);return we({node:e,query:o.query,replacement:s,preservedNodes:[...D7(e,n,t),o.query]},t)})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `URLSearchParams` over manually splitting query strings.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[DQ]:"Prefer `URLSearchParams` over manually splitting query strings.",[D0]:"Use `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-unsafe-promise-all-settled-values":{create:e=>{let t=sc(e,r=>iT(r,e,t));e.onExit("CallExpression",r=>(function(e,t,r){if(!tP(e,{method:"then",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!ws(e.callee.object))return;let[n]=e.arguments;if(!wa(n)||0===n.params.length)return;let[o]=n.params,a=wb(o)&&eD(t.sourceCode.getScope(o),o);if(a)return function e(t,r,n,o){if(t=wi(t),!(!t?.type||wa(t))&&"ClassExpression"!==t.type&&"ClassDeclaration"!==t.type){if(tP(t,{method:"map",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})&&function e(t,r,n){return!!wR(t=wi(t),r,n)||wu(t)&&e(t.callee.object,r,n)}(t.callee.object,r,n)&&!wF(t.callee.object)){let e=wB(t,n,{knownPromiseSettledResultArray:!0,branchAlwaysExits:o});if(e)return e}for(let[a,i]of Object.entries(t))if(!("parent"===a||wj(t,a))&&i&&"object"==typeof i)for(let t of Array.isArray(i)?i:[i]){let a=e(t,r,n,o);if(a)return a}}}(n.body,a,t,r)})(r,e,t)??wB(r,e,{branchAlwaysExits:t}))},meta:{type:"problem",docs:{description:"Disallow reading `.value` from `Promise.allSettled()` results without a fulfilled status guard.",recommended:"unopinionated"},schema:[],messages:{[wt]:"Do not read `.value` from `Promise.allSettled()` results without checking that the result is fulfilled."},languages:["js/js"]}},"unicorn/prefer-abort-signal-any":{create:e=>{e.on("VariableDeclarator",t=>((e,t)=>{var r;let n,a,{sourceCode:i}=t,s=e.parent,{id:l,init:u}=e;if("VariableDeclaration"!==s.type||"const"!==s.kind||1!==s.declarations.length||"Identifier"!==l.type||!(tT(u,{name:"AbortController",argumentsLength:0})&&rg(u.callee,t))||(n=eD(t.sourceCode.getScope(l),"AbortSignal"))&&0!==n.defs.length||r6(t,u)||l.typeAnnotation&&r6(t,l.typeAnnotation))return;let p=((e,t,r)=>{var n;let a,i=wO(e);if(i?.type!=="ForOfStatement"||i.await||!Ae(i,r)||wU(r,e,i)||!w0(i.right,r)||wJ(i.right,r)||wG(i.right,t,r)||!w6(i.right,r)||!(!(a=wQ(i.right,r))||a.length>1&&a.every(e=>wY(e,r))))return;let s=(e=>{if("VariableDeclaration"!==e.type||"const"!==e.kind)return;let{id:t}=e.declarations[0];if("Identifier"===t.type)return t})(i.left);if(!s||!wX(s,r))return;let l=w7("ExpressionStatement"===(n=i.body).type?n:"BlockStatement"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type?n.body[0]:void 0);if(!l||!rf(rx(l.sourceSignal),s))return;let u=w4(l.call.arguments[1],t,s,r);if(u)return{abortReferences:new o([u]),replacement:`AbortSignal.any(${((e,t)=>{let r=t.sourceCode.getText(e);if(!w9(e,t))return r;let n=rx(e);if("ArrayExpression"===n.type)return t.sourceCode.getText(n);let o=n===e?r:`(${r})`;return`[...${o}]`})(i.right,r)})`,statements:[i]}})(s,l.name,t)??((e,t,r)=>{let n=[],a=[],i=new o,s=e,l=wO(e);for(;l;){let e=w7(l);if(!e||!Ae(l,r)||wU(r,s,l)||wG(e.sourceSignal,t,r)||!wY(e.sourceSignal,r))break;let o=w4(e.call.arguments[1],t,e.sourceSignal,r);if(!o)break;n.push(l),a.push(e.sourceSignal),i.add(o),s=l,l=wO(l)}if(!(n.length<2))return{abortReferences:i,replacement:`AbortSignal.any([${a.map(e=>r.sourceCode.getText(e)).join(", ")}])`,statements:n}})(s,l.name,t);if(!p)return;let c=eD(i.getScope(l),l);for(let e of p.abortReferences)if(eD(i.getScope(e),e)!==c)return;let d=((e,t,r)=>{let n=[];for(let o of e.references){let{identifier:e}=o;if(t.has(e)||o.init)continue;if(o.isWrite())return;let a=wW(e,r);if(!a)return;n.push(a)}return n.length>0?n:void 0})(c,p.abortReferences,t);if(!d)return;let m=(r=l.name,a=r,("abortController"===r?a="abortSignal":"controller"===r&&(a="signal"),a===r||At(a,c,c.identifiers[0],t)||d.some(e=>At(a,c,e,t)))?r:a),f=p.statements.at(-1),g=r7(t,f),y=[i.getRange(s)[1],i.getRange(f)[1]],h=r4(t,{node:l,messageId:wL,suggest:[{messageId:wN,*fix(e){if(yield e.replaceText(u,p.replacement),l.typeAnnotation&&(yield e.replaceText(l.typeAnnotation,": AbortSignal")),m!==l.name){let[t]=i.getRange(l);yield e.replaceTextRange([t,t+l.name.length],m)}for(let t of d)yield e.replaceText(t,m);yield((e,t,r)=>{if(1===e.length)return sQ(e[0],t,r);let{sourceCode:n}=t,{lines:o}=n,a=e[0],i=e.at(-1),s=n.getLoc(a).start,l=n.getLoc(i).end,u=o[s.line-1].slice(0,s.column),p=o[l.line-1].slice(l.column),{text:c}=n,[d]=n.getRange(a),[,m]=n.getRange(i);return/^\s*$/.test(u)&&/^\s*$/.test(p)&&(m+=p.length,"\r"===c[(d-=u.length)-2]&&"\n"===c[d-1]?d-=2:("\n"===c[d-1]||"\r"===c[d-1])&&d--),r.removeRange([d,m])})(p.statements,t,e)}}]},y);for(let e of[u,l.typeAnnotation,g,...d].filter(Boolean))h=r4(t,h,e);return h})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `AbortSignal.any()` over manually forwarding abort events between signals.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[wL]:"Prefer `AbortSignal.any()` over manually forwarding abort events between signals.",[wN]:"Replace with `AbortSignal.any()`."},languages:["js/js"]}},"unicorn/prefer-block-statement-over-iife":{create:e=>{let{sourceCode:t}=e,{visitorKeys:r}=t;e.on("ExpressionStatement",n=>{let o,a,{expression:i}=n;if("CallExpression"!==i.type||i.optional||i.arguments.length>0)return;let{callee:s}=i;if(!("FunctionExpression"!==s.type&&"ArrowFunctionExpression"!==s.type||s.id||s.async||s.generator||s.params.length>0||"BlockStatement"!==s.body.type||s.body.body.some(e=>tC(e))||Ai(s.body,r,e=>"ReturnStatement"===e.type||"VariableDeclaration"===e.type&&"var"===e.kind||"CallExpression"===e.type&&"Identifier"===e.callee.type&&"eval"===e.callee.name)||(o=s.body,"script"===t.ast.sourceType&&Ai(o,t.visitorKeys,e=>"FunctionDeclaration"===e.type))||(a=s.body,r6(e,e.sourceCode.getRange(n),[a]))||"FunctionExpression"===s.type&&Ai(s.body,r,An,Aa))){let r;return r4(e,{node:i,messageId:Ar,fix:(r=s.body,t=>t.replaceText(n,e.sourceCode.getText(r)))},t.getRange(n),[s.body])}})},meta:{type:"suggestion",docs:{description:"Prefer block statements over IIFEs used only for scoping.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Ar]:"Prefer a block statement over an IIFE used only for scoping."},languages:["js/js"]}},"unicorn/no-multiple-promise-resolver-calls":{create:e=>{let t,{sourceCode:n}=e,a=new i,l=(e,r)=>{if(t.hasResolverReferences){var n;t.currentSegments.add(e),(t.terminatedFinallyBlocks.has(r)||e.prevSegments.length>0&&e.prevSegments.every(e=>!e.reachable||t.terminatedSegments.has(e)))&&t.terminatedSegments.add(e),n=t,"CatchClause"===r.type&&n.catchClausesBySegment.set(e,r)}},u=e=>{t.hasResolverReferences&&t.currentSegments.delete(e)};e.on("onCodePathStart",(i,l)=>{let u=t,p=u&&Aj(i,l)&&u.currentSegments.size>0&&[...u.currentSegments].every(e=>u.terminatedSegments.has(e));t={upper:u,codePath:i,node:l,currentSegments:new o,eventsBySegment:new r,executors:new o,catchClausesBySegment:new r,ignoredLoopEdges:[],terminatedSegments:new s,terminatedFinallyBlocks:new s,hasResolverReferences:u?.hasResolverReferences??!1},p&&t.terminatedSegments.add(i.initialSegment),Ad(l,e)&&function(e,t,r){let n=!1;for(let o of e.params.slice(0,2)){let a="AssignmentPattern"===o.type?o.left:o;if("Identifier"!==a.type)continue;let i=eD(r.getScope(a),a);if(!(!i||Am(i,a)))for(let r of i.references)t.set(r.identifier,e),n=!0}return n}(l,a,n)&&(t.hasResolverReferences=!0)}),e.on("onCodePathEnd",()=>{let n,o=t;if(!o.hasResolverReferences){t=o.upper;return}let a="StaticBlock"===(n=o.node).type?n.body.at(-1):n,i="StaticBlock"===o.node.type?aH(o.node,e):a2(o.node,e),l=Aj(o.codePath,o.node)&&AS(o.node).catchClause&&a&&ip(a,e)&&iT(a,e,Au)&&!i,u=a&&(iT(a,e,Au)&&!l||"TryStatement"===a.type&&AI(a,e)||"StaticBlock"===o.node.type&&!l&&i);if(!function(e,t){if(0===e.executors.size)return;let n=Ay(e.codePath),o=new s;for(let a of e.executors){let i=function(e,t,n){let o,a=new r;do for(let r of(o=!1,n)){let n=function(e,t,r){for(let n of t)e=Ab(e,n,r);return e}(AT(r,a,e),e.eventsBySegment.get(r)??[],t);AE(n,a.get(r))||(a.set(r,n),o=!0)}while(o);return a}(e,a,n);for(let r of n){let n=AT(r,i,e);for(let i of e.eventsBySegment.get(r)??[])i.executor===a&&n.resolverCalled&&!o.has(i.node)&&(o.add(i.node),t.report({node:i.node,messageId:As})),n=Ab(n,i,a)}}}(o,e),o.upper&&Aj(o.codePath,o.node)&&(Ay(o.codePath).every(e=>o.terminatedSegments.has(e))||u))for(let e of o.upper.currentSegments)o.upper.terminatedSegments.add(e);t=o.upper}),e.onExit("IfStatement",r=>{let n;if(!t.hasResolverReferences)return;let o=rP(r.test,e);if(void 0!==o&&aM(r.test,e)&&(n=o.value?r.consequent:r.alternate),n&&function e(t){return"ReturnStatement"===t.type?!t.argument:"BlockStatement"===t.type&&1===t.body.length&&e(t.body[0])}(n))for(let e of t.currentSegments)e.reachable&&t.terminatedSegments.add(e)}),e.on("onCodePathSegmentStart",l),e.on("onUnreachableCodePathSegmentStart",l),e.on("onCodePathSegmentEnd",u),e.on("onUnreachableCodePathSegmentEnd",u),e.on("onCodePathSegmentLoop",(e,r,n)=>{!t.hasResolverReferences||(AC(n)||function(e){if("ContinueStatement"!==e.type)return!1;let t=e.label?.name,r=!1,n=e,{parent:o}=e;for(;;){if("TryStatement"===o.type&&o.finalizer&&(o.block===n||o.handler===n)&&(r=!0),t&&"LabeledStatement"===o.type&&o.label.name===t||!t&&tF(o))return r;n=o,{parent:o}=o}}(n))&&t.ignoredLoopEdges.push({previousSegment:e,segment:r})}),e.onExit(["Identifier","CallExpression","ImportExpression","MemberExpression","NewExpression","ThrowStatement","YieldExpression"],r=>{if(!t.hasResolverReferences)return;if(aG(r,e)){if(!AA(r,e)&&!function(e,t,r){let n=e,{parent:o}=e,a=!1;for(;;){if(tj(o))return!1;if("IfStatement"===o.type&&(o.consequent===n||o.alternate===n)?a||=!a$(o.test,t):("SequenceExpression"===o.type&&o.expressions[0]!==n||"LogicalExpression"===o.type&&o.right===n||"ConditionalExpression"===o.type&&o.test!==n)&&(a||=!a2(o,t)),"TryStatement"===o.type&&o.handler&&o.block===n)return a||!aH(o.block,t,!0,{isAdditionalStatementDefinitelyNotThrowing:e=>Ag(e,r)});n=o,{parent:o}=o}}(r,e,a)){let n=function(e,t){let r=e,{parent:n}=e;for(;n;){if(tj(n))return;if("TryStatement"===n.type&&n.finalizer&&(n.block===r||n.handler===r)&&AI(n,t))return n;r=n,{parent:n}=n}}(r,e);for(let o of(n&&t.terminatedFinallyBlocks.add(n.finalizer),function(e,t){let r=e,{parent:n}=e;for(;;){if("AssignmentPattern"===n.type)return n.right===r&&Ad(n.parent,t)&&!n.parent.params.slice(0,2).includes(n);if(!Ak(n,r,t))return!1;r=n,{parent:n}=n}}(r,e)&&t.terminatedSegments.add(t.codePath.initialSegment),t.currentSegments))t.terminatedSegments.add(o)}return}if("Identifier"===r.type&&(a.has(r)||!AD(r))||"ImportExpression"===r.type&&!AD(r))return;let n=Af(r,a),{catchClause:o,finallyBlocks:i}=n?{catchClause:void 0,finallyBlocks:function(e){let t=[],r=e,{parent:n}=e;for(;n&&!tj(n);)"TryStatement"===n.type&&n.finalizer===r&&t.push(n.finalizer),r=n,{parent:n}=n;return t}(r)}:AS(r);if((n||o)&&!(function(e,t){let r=e,{parent:n}=e;for(;n;){if(AC(n)&&("WhileStatement"===n.type&&n.body===r||"ForStatement"===n.type&&(n.body===r||n.update===r)||"IfStatement"===n.type&&n.consequent===r)||("ForOfStatement"===n.type||"ForInStatement"===n.type)&&n.body===r&&Aw(n.right,t))return!0;r=n,{parent:n}=n}return!1}(r,e)||n&&AA(r,e))){var s=t,l={catchClause:o,finallyBlocks:i,node:r,executor:n};for(let e of s.currentSegments){if(!e.reachable||s.terminatedSegments.has(e))continue;let t=s.eventsBySegment.get(e);t||(t=[],s.eventsBySegment.set(e,t)),t.push(l)}n&&t.executors.add(n)}}),e.onExit(["ArrayExpression","AssignmentExpression","ConditionalExpression","ImportExpression","LogicalExpression","ObjectExpression","SequenceExpression","TemplateLiteral","YieldExpression"],r=>{if(t.hasResolverReferences&&a2(r,e))for(let e of t.currentSegments)e.reachable&&t.terminatedSegments.add(e)})},meta:{type:"problem",docs:{description:"Disallow calling Promise executor resolver functions more than once on the same execution path.",recommended:"unopinionated"},messages:{[As]:"Promise executor resolver functions may be called multiple times on the same execution path."},languages:["js/js"]}},"unicorn/no-unnecessary-string-trim":{create:e=>{e.on("CallExpression",t=>{var r,n;let o;if(!tP(t,{methods:AF,maximumArguments:1,optionalCall:!1,optionalMember:!1}))return;let a=t.callee.object;if(!tP(a,{method:"trim",argumentsLength:0,optionalCall:!1,optionalMember:!1})||nu(t))return;let i=a.callee.object;if(((e,t)=>{if(e=rx(e),e=rx(na(e,t)??e),AL.has(e.type))return!0;let r=AN(e,t);return!!r&&"string"!=typeof r.value})(i,e)||oj(i,e)||tP(r=rx(r=i),{method:"string",argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})&&"Identifier"===r.callee.object.type&&(n=r.callee.object,o=eD(e.sourceCode.getScope(n),n),o?.defs.some(e=>{if("ImportBinding"!==e.type)return!1;let{node:t,parent:r}=e;return!iL(t)&&r.source?.value==="zod"&&("ImportNamespaceSpecifier"===t.type||"ImportSpecifier"===t.type&&("z"===t.imported.name||"z"===t.imported.value))})))return;let{property:s}=t.callee,{property:l}=a.callee,u=s.name,[p]=t.arguments;if(p){let t=((e,t)=>{let r=AN(e,t);if(!r)return;let{value:n}=r;return null===n||AB.has(typeof n)?String(n):void 0})(p,e);if(void 0===t||("startsWith"===u?t!==t.trimEnd():t!==t.trimStart()))return}let c="startsWith"===u?"trimStart":"trimEnd";return{node:l,messageId:AR,data:{method:u,replacement:c},fix:e=>e.replaceText(l,c)}})},meta:{type:"suggestion",docs:{description:"Disallow `String#trim()` before `String#startsWith()` or `String#endsWith()`.",recommended:"unopinionated"},fixable:"code",messages:{[AR]:"Prefer `String#{{replacement}}()` before `String#{{method}}()`."},languages:["js/js"]}},"unicorn/no-useless-re-export":{create:e=>{let{sourceCode:t}=e,r=[],n=[];e.on("ExportAllDeclaration",e=>{e.exported||r.push({node:e,request:A$(e,t)})}),e.on("ExportNamedDeclaration",e=>{e.source&&n.push(e)});let a=(e,n)=>{let o=AM(n.exported);if("default"===o)return;let a=AM(n.local),[i]=t.getRange(n.local),[s]=t.getRange(n.exported);if(a===o&&i!==s)return;let l="type"===n.exportKind||"type"===e.exportKind,u=A$(e,t);if(a===o&&r.some(e=>e.request===u&&"default"!==o&&("type"!==e.node.exportKind||l)))return{node:n,messageId:AP}};e.on("Program:exit",function*(){if(1===new o(r.map(e=>e.request)).size)for(let e of n)for(let t of e.specifiers){let r=a(e,t);r&&(yield r)}})},meta:{type:"suggestion",docs:{description:"Disallow redundant re-exports.",recommended:"unopinionated"},schema:[],messages:{[AP]:"This export is redundant because the same module is already exported with `export *`."},languages:["js/js"]}},"unicorn/iteration-fallback-style":{create:e=>{e.options[0]===AW?e.on("IfStatement",t=>((e,t)=>{let r=(e=>{let t=(e=>{if(e.alternate)return;let{consequent:t}=e;if("BlockStatement"===t.type){if(1!==t.body.length)return;return t.body[0]}return t})(e);if(!t||"ForInStatement"!==t.type&&"ForOfStatement"!==t.type)return;let r=rx(e.test),n="||";if(!cK(r)){if("BinaryExpression"!==r.type||"!="!==r.operator)return;let e=tg(r.left),t=e?r.right:r.left;if(!tg(e?r.left:r.right)||!cK(t))return;r=t,n="??"}let o=rx(A_(t));if(!(cX(r)||cX(o))&&cK(o)&&rf(r,o))return{loop:t,source:o,sourceNode:A_(t),operator:n}})(e);if(!r)return;let n=AJ(r.loop)?"object":"array",o={node:e.test,messageId:AU,data:{type:n}};return"ForOfStatement"===r.loop.type&&((e,t,r)=>{let{sourceCode:n}=r,{source:o}=t,{start:a}=n.getLoc(e);return!(n.getCommentsInside(e).length>0||no(e,r)||!cK(o)||o!==t.sourceNode||e0(o,n)||t.loop.await||"LabeledStatement"===e.parent.type||rW(e,r).length!==a.column)})(e,r,t)&&(o.fix=n=>{let{sourceCode:o}=t,{loop:a,sourceNode:i,operator:s}=r,[l]=o.getRange(a),[u,p]=o.getRange(i),c=o.getText(a),d=o.getText(i),m=AJ(a)?"{}":"[]",f=[c.slice(0,u-l),`${d} ${s} ${m}`,c.slice(p-l)].join(""),g=rW(e,t);return n.replaceText(e,rQ(f,rW(a,t),g))}),o})(t,e)):e.on(["ForInStatement","ForOfStatement"],t=>((e,t)=>{let r=((e,t)=>{let r=rx(e);if("LogicalExpression"!==r.type||"??"!==r.operator&&"||"!==r.operator)return;let n=rx(r.right);if(t(n))return{logicalExpression:r,fallback:n,source:r.left,operator:r.operator}})(A_(e),AJ(e)?tA:tw);if(!r)return;let{fallback:n}=r,o="ArrayExpression"===n.type?"array":"object",a={node:n,messageId:AO,data:{type:o}};return"ForOfStatement"===e.type&&((e,t,r)=>{let{sourceCode:n}=r,{logicalExpression:o,source:a}=t;return!e.await&&!(n.getCommentsInside(o).length>0||no(e,r)||rh(o.right)||!cK(a)||e0(a,n)||"LabeledStatement"===e.parent.type||"IfStatement"===e.parent.type)})(e,r,t)&&(a.fix=n=>{let{sourceCode:o}=t,{logicalExpression:a,source:i,operator:s}=r,[l]=o.getRange(e),[u,p]=o.getRange(a),c=o.getText(e),d=o.getText(i),m=[c.slice(0,u-l),d,c.slice(p-l)].join(""),f=rW(e,t),g=`${f}${rK(t)}`,y="??"===s?`(${d}) != null`:d,h=rX(t);return n.replaceText(e,`if (${y}) {${h}${g}${rQ(m,f,g)}${h}${f}}`)}),a})(t,e))},meta:{type:"suggestion",docs:{description:"Enforce a consistent style for optional loop sources.",recommended:!1},fixable:"code",schema:[{enum:[Aq,AW],description:"The preferred style for optional loop sources."}],defaultOptions:[Aq],messages:{[AO]:"Prefer an `if` guard over the empty {{type}} fallback.",[AU]:"Prefer an empty {{type}} fallback over the `if` guard."},languages:["js/js"]}},"unicorn/no-async-iterator-callback":{create:e=>{e.on("CallExpression",t=>{let{callee:r}=t,[n]=t.arguments;if("MemberExpression"!==r.type||!n||"SpreadElement"===n.type)return;let o=eK(r,e.sourceCode.getScope(t));if(AK.has(o)&&yP(r.object,e)&&(function(e,t){let r;if(AG(e=yR(e)))return!0;let n=(r=na(e,t),r?.parent.id.type==="Identifier"?yR(r):void 0);if(n&&AG(n))return!0;if("Identifier"!==e.type)return!1;let o=eD(t.sourceCode.getScope(e),e);if(!o||o.references.some(e=>e.isWrite()))return!1;let a=o.defs.filter(e=>"FunctionName"===e.type&&e.node.body);return 1===a.length&&AG(a[0].node)}(n,e)||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let t=r.program.getTypeChecker();return r.getTypeAtLocation(e).getCallSignatures().some(e=>{let r=t.getReturnTypeOfSignature(e),n=t.getBaseConstraintOfType(r)??r;return(n.isUnion()?n.types:[n]).some(e=>!0===ab(e,t))})}catch{return!1}}(n,e)))return{node:n,messageId:AH,data:{method:o}}})},meta:{type:"problem",docs:{description:"Disallow asynchronous callbacks in synchronous iterator helpers.",recommended:"unopinionated"},schema:[],messages:{[AH]:"Do not pass an asynchronous callback to `Iterator#{{method}}()`; returned promises are not awaited."},languages:["js/js"]}},"unicorn/no-unused-iterator-helper":{create:e=>{e.on("CallExpression",t=>{let r=(e=>{for(;rh(e.parent)||"AwaitExpression"===e.parent.type||"ParenthesizedExpression"===e.parent.type||"ChainExpression"===e.parent.type;)e=e.parent;let{parent:t}=e;if("ExpressionStatement"===t.type||"UnaryExpression"===t.type&&"void"===t.operator||"ForStatement"===t.type&&(t.init===e||t.update===e))return e})(t);if(!r||!yF(t,e))return;let n={node:t.callee.property,messageId:AX,data:{method:t.callee.property.name}};return((e,t)=>{if("map"!==e.callee.property.name||1!==e.arguments.length||"SpreadElement"===e.arguments[0].type||e.typeArguments||e.typeParameters)return!1;for(let r=e;r!==t.parent;r=r.parent)if(rh(r))return!1;return!0})(t,r)&&(n.suggest=[{messageId:AY,fix:e=>e.replaceText(t.callee.property,"forEach")}]),n})},meta:{type:"problem",docs:{description:"Disallow discarding lazy iterator helpers.",recommended:"unopinionated"},hasSuggestions:!0,schema:[],messages:{[AX]:"Consume the iterator returned by `.{{method}}(…)`; iterator helpers are lazy.",[AY]:"Use `.forEach()` to run the callback."},languages:["js/js"]}},"unicorn/no-useless-set-construction":{create:e=>{e.on("NewExpression",t=>{if(!tT(t,{name:"Set",argumentsLength:1})||!rg(t.callee,e)||t.typeArguments||t.typeParameters)return;let r=function(e,t){let[r]=e.arguments;if(A1(r,AQ)&&"Set"===iK(r.callee.object,t))return{replacement:r,method:r.callee.property.name};let{parent:n}=e;if(A1(n)&&n.arguments[0]===e&&"Set"===iK(n.callee.object,t)){let e=A2(r,t);if(e)return{replacement:e,method:n.callee.property.name}}if("MemberExpression"!==n.type||n.object!==e||!A1(n.parent)||n.parent.callee!==n)return;let o=A2(r,t),[a]=n.parent.arguments;if(o&&"Set"===iK(o,t)&&iK(a,t)&&!e0(a,t.sourceCode))return{replacement:o,method:n.property.name}}(t,e);if(r)return{node:t,messageId:AZ,data:{method:r.method},fix:function(e,t,r){let{sourceCode:n}=r,[o,a]=ti(t,r);if(n.getCommentsInside(e).some(e=>{let[t,r]=n.getRange(e);return t<o||r>a}))return;let i=ts(t,r),s="MemberExpression"===e.parent.type&&e.parent.object===e,l=e;for(;"MemberExpression"===l.parent.type&&l.parent.object===l||"TaggedTemplateExpression"===l.parent.type&&l.parent.tag===l||rh(l.parent);)l=l.parent;!tl(t,r)&&(s&&i7(t,r)||"NewExpression"===l.parent.type&&l.parent.callee===l)&&(i=`(${i})`);let u=e;for(;u.parent&&"ExpressionStatement"!==u.parent.type;)u=u.parent;return u.parent?.type==="ExpressionStatement"&&n.getFirstToken(u)===n.getFirstToken(e)&&iB(n.getTokenBefore(e),r,i)&&(i=`;${i}`),t=>t.replaceText(e,i)}(t,r.replacement,e)}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Set` construction around `Set` methods.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[AZ]:"This `Set` construction is unnecessary for `Set#{{method}}()`."},languages:["js/js"]}},"unicorn/no-using-resource-escape":{create:e=>{let{sourceCode:t}=e;function*r(e,r,n){let a=A8(e);for(let i of new o(r.flatMap(e=>[...function* e(t,r,n){if(t){if("Identifier"===(t=rx(t)).type){let e=A6(t,n);if(A4(e,r))return void(yield e);let o=function(e){let t=A9(e,["Variable","FunctionName"]);if(t){if("FunctionName"===t.type)return t.node;if("Variable"===t.type&&"const"===t.parent.kind&&"Identifier"===t.node.id.type){let e=rx(t.node.init);if(e&&tj(e))return e}}}(e);if(!o)return;t=o}if(tj(t))return void(yield*function*(e,t,r){if("FunctionDeclaration"===e.type){let t=r.getDeclaredVariables(e).find(t=>t.identifiers.includes(e.id));if(t?.references.some(e=>e.isWrite()))return}for(let n of r.getScope(e).through)!1!==n.isValueReference&&!function(e){for(let t=e;!tj(t.parent);t=t.parent){let{parent:e}=t;if("TSTypeQuery"===e.type||"JSXNamespacedName"===e.type||(A5.has(e.type)||!(e.decorators?.length>0)&&("TSAbstractAccessorProperty"===e.type||"TSAbstractPropertyDefinition"===e.type||"PropertyDefinition"===e.type&&!0===e.declare))&&e.key===t)return!0}return!1}(n.identifier)&&A4(n.resolved,t)&&(yield n.resolved)}(t,r,n));switch(t.type){case"ArrayExpression":for(let o of t.elements)yield*e(o,r,n);break;case"ObjectExpression":for(let o of t.properties)"Property"===o.type&&(yield*e(o.value,r,n));break;case"ConditionalExpression":{yield*e(t.consequent,r,n);let o=rx(t.test),a="Identifier"===o.type?A6(o,n):void 0;for(let o of e(t.alternate,r,n))o!==a&&(yield o);break}case"LogicalExpression":"&&"!==t.operator&&(yield*e(t.left,r,n)),yield*e(t.right,r,n);break;case"SequenceExpression":yield*e(t.expressions.at(-1),r,n)}}}(e,a,t)])))yield{node:e,messageId:A3,data:{name:i.name,action:n}}}e.on("ReturnStatement",e=>r(e,[e.argument],"return")),e.on(["ExportNamedDeclaration","ExportDefaultDeclaration","TSExportAssignment"],e=>r(e,function(e){if("TSExportAssignment"===e.type)return[e.expression];if(e.source||"type"===e.exportKind)return[];if("ExportDefaultDeclaration"===e.type)return[e.declaration];let{declaration:t}=e;return t?.kind==="const"?t.declarations.filter(e=>"Identifier"===e.id.type).map(e=>e.init):t&&tj(t)?[t]:e.specifiers.filter(e=>"type"!==e.exportKind).map(e=>e.local)}(e),"export"))},meta:{type:"problem",docs:{description:"Disallow returning or exporting resources declared with `using`, including through capturing functions.",recommended:"unopinionated"},schema:[],messages:{[A3]:"Do not {{action}} resource `{{name}}` or a value that contains or captures it. The resource is disposed when its owning scope exits."},languages:["js/js"]}},"unicorn/prefer-combined-guards":ks,"unicorn/prefer-temporal-conversion":{create:e=>{let{sourceCode:t}=e,r=r=>{let n;if("NewExpression"===r.type)n=r.callee;else{if(!tP(r,{methods:["from","fromEpochMilliseconds","fromEpochNanoseconds"],argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;n=r.callee.object}if(!tL(n,{object:"Temporal",computed:!1,optional:!1}))return;let a=n.property.name,i=kf.get(a);if(!i||0===r.arguments.length||r.arguments.some(e=>"SpreadElement"===e.type)||"Instant"===a&&1!==r.arguments.length||"Instant"!==a&&"CallExpression"===r.type&&"from"!==r.callee.property.name)return;let s=function(e,t,r,n){let[a]=e.arguments,i=rx(a),s="CallExpression"===e.type&&"from"===e.callee.property.name;if(s&&tP(i,{methods:["toString","toJSON"],argumentsLength:0,optionalCall:!1,optionalMember:!1}))return{source:i.callee.object,canAutofix:"Instant"!==t};if(s&&"ObjectExpression"!==i.type)return{source:a,canAutofix:!0};if("Instant"!==t)return function(e,t,r){let n,a=function(e,t){if("NewExpression"===e.type)return e.arguments.map((e,r)=>[t[r]??"calendar",e]);let r=rx(e.arguments[0]),n=[];for(let e of r.properties){if("Property"!==e.type||e.computed||e.method||"init"!==e.kind)return;n.push([e.key.name??e.key.value,e.value])}return n}(e,t);if(!a)return;let i=t.includes("year"),s="NewExpression"===e.type,l=a.some(([e])=>"calendar"===e),u=new o(t);for(let[e,t]of(i&&l&&u.add("calendar"),a)){if(!u.delete("monthCode"===e?"month":e)||!kd(t,"calendar"===e?"calendarId":e))return;let o=rx(t).object;if(e0(o,r.sourceCode)||n&&!rf(n,o))return;n??=o}if(!(u.size>0))return{source:n,canAutofix:!i||!s&&l}}(e,r,n);let l="CallExpression"===e.type&&"fromEpochMilliseconds"===e.callee.property.name;if(kd(a,l?"epochMilliseconds":"epochNanoseconds"))return{source:rx(a).object,canAutofix:!l}}(r,a,i.fields,e);if(!s||!i.isSource(s.source,e))return;let{source:l,canAutofix:u}=s,p=`to${a}`,c={node:r,messageId:kl,data:{method:p,target:a}};if(t.getCommentsInside(r).length>0)return c;let d=n=>{let o=`${se(l,e)}.${p}()`;return iB(t.getTokenBefore(r),e,o)&&(o=`;${o}`),n.replaceText(r,o)};return u?c.fix=d:c.suggest=[{messageId:ku,data:{method:p},fix:d}],c};e.on("CallExpression",r),e.on("NewExpression",r)},meta:{type:"suggestion",docs:{description:"Prefer direct Temporal conversion methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[kl]:"Prefer `.{{method}}()` when converting to `Temporal.{{target}}`.",[ku]:"Replace with `.{{method}}()`."},languages:["js/js"]}},"unicorn/prefer-iterator-helpers":{create:e=>{e.on("CallExpression",t=>((e,t)=>{if(!tP(e,{method:"slice",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1,computed:!1})||e.typeArguments||e.typeParameters)return;let r=e.callee.object,n=((e,t)=>{if(!("CallExpression"!==e.type||e.typeArguments||e.typeParameters||!tP(e,{method:"toArray",argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})||function e(t,r){return rh(t)||t?.type==="ChainExpression"?0===ta(t,r).length&&e(t.expression,r):!!nl(t)&&(!!t.optional||e("MemberExpression"===t.type?t.object:t.callee,r))}(e,t)))return e.callee.object})(r,t)??kE(r,t);if(!n||"Super"===n.type)return;let o=((e,t)=>{let r=e.arguments.map(e=>rP(e,t)?.value);if(r.some(e=>!(Number.isSafeInteger(e)&&e>=0)))return;let[n,o]=r;if(void 0!==o&&o<=n)return"take(0)";let a=[];return n>0&&a.push(`drop(${n})`),void 0!==o&&a.push(`take(${o-n})`),a.join(".")})(e,t);if(!o)return;let a=kS(e,n,{suffix:`.${o}.toArray()`,messageId:kx,data:{replacement:o}},t);return{node:e.callee.property,messageId:kh,data:{replacement:o},...a&&{suggest:[a]}}})(t,e)??((e,t)=>{var r,n;if(!(tP(e,{methods:kb,argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||tP(e,{method:kv,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1,computed:!1})))return;let o=e.callee.property.name;if(r=e.arguments[0],n=o===kv?3:2,"Identifier"===(r=yR(r)).type&&(r=((e,t)=>{let[r]=eD(t.sourceCode.getScope(e),e)?.defs??[];return r?.type==="FunctionName"?r.node:r?.type==="Variable"&&r.node.init?yR(r.node.init):void 0})(r,t)),!tI.includes(r?.type)||r.params.length>n||r.params.at(-1)?.type==="RestElement"||"ArrowFunctionExpression"!==r.type&&t.sourceCode.getTokens(r).some(e=>"Identifier"===e.type&&"arguments"===e.value))return;let a=e.callee.object,i=kE(a,t);if(!i)return;let s=kS(a,i,{messageId:ky,data:{method:o}},t);return{node:a,messageId:kg,data:{method:o},...s&&{suggest:[s]}}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer iterator helpers over temporary arrays from iterators.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[kg]:"Prefer `Iterator#{{method}}()` over materializing an array.",[ky]:"Use `Iterator#{{method}}()`.",[kh]:"Prefer `{{replacement}}` before materializing the iterator instead of slicing the array.",[kx]:"Use `{{replacement}}.toArray()`."},languages:["js/js"]}},"unicorn/prefer-iterator-zip":{create:e=>{let{sourceCode:t}=e;e.onExit("ForStatement",n=>{let a=function(e,t){let r=function(e,t){let{init:r,update:n}=e;if("BlockStatement"!==e.body.type||r?.type!=="VariableDeclaration"||"let"!==r.kind||r.declarations.length>2)return;let[o]=r.declarations;if("Identifier"!==o.id.type||!tu(o.init,0))return;let{name:a}=o.id;if(n?.type==="UpdateExpression"&&"++"===n.operator&&kD(n.argument,a)||n?.type==="AssignmentExpression"&&kD(n.left,a)&&("+="===n.operator&&tu(n.right,1)||"="===n.operator&&"BinaryExpression"===n.right.type&&"+"===n.right.operator&&kD(n.right.left,a)&&tu(n.right.right,1))){if(1===r.declarations.length){let r=function(e,t){let r=kI(kw(e,t));if(r)return r;let n=function e(t){return t?.type==="LogicalExpression"&&"&&"===t.operator?[...e(t.left),...e(t.right)]:[t]}(e);if(!(n.length<2))return kk(n.map(e=>kA(kw(e,t))))}(e.test,a);if(r)return{inputs:r};let n=sd(e,t,-1);if(n?.type!=="VariableDeclaration"||!["const","let"].includes(n.kind)||1!==n.declarations.length)return;return kj(e,a,{declarator:n.declarations[0],declarationToRemove:n},t.sourceCode)}return kj(e,a,{declarator:r.declarations[1]},t.sourceCode)}}(e,t);if(r&&r.inputs.every(e=>!ou(e,t)))return r}(n,e);if(!a)return;let{inputs:i,declarationToRemove:s}=a,[l]=t.getDeclaredVariables(n.init),u=new r(i.map(e=>[e.name,eD(t.getScope(e),e)])),p=t.getScope(n.body),c=nj(p),d=new r(i.map(e=>[e.name,new o]));for(let e of c){let{identifier:r,resolved:o}=e,a=o===l,i=u.has(r.name)&&o===u.get(r.name);if(!a&&!i)continue;let s=r.parent;if(function(e,t){for(let r=e.parent;r!==t;r=r.parent)if(tj(r)||"ClassDeclaration"===r.type||"ClassExpression"===r.type)return!0;return!1}(r,n.body)||"MemberExpression"!==s.type||!s.computed||s.optional||"Identifier"!==s.object.type||"Identifier"!==s.property.type||!u.has(s.object.name)||eD(t.getScope(s),s.object)!==u.get(s.object.name)||eD(t.getScope(s),s.property)!==l||!function(e){for(;rh(e.parent)||"TSInstantiationExpression"===e.parent.type;)e=e.parent;let{parent:t}=e;return!ns(e)&&("ForOfStatement"!==t.type&&"ForInStatement"!==t.type||t.left!==e)&&("CallExpression"!==t.type||t.callee!==e)&&("TaggedTemplateExpression"!==t.type||t.tag!==e)}(s))return;d.get(s.object.name).add(s)}if(d.values().some(e=>0===e.size))return;let m=t.getTokenBefore(n.body,eF),f=[t.getRange(n)[0],t.getRange(m)[1]],g=s&&[t.getRange(s)[0],t.getRange(n)[0]],y={loc:sp(f,e),messageId:kT};if(function(e,t){let{sourceCode:r}=e;return r.getAllComments().some(e=>{let[n,o]=r.getRange(e);return t.some(([e,t])=>n>=e&&o<=t)})}(e,[f,...d.values().flatMap(e=>e.values().map(e=>t.getRange(e))),...g?[g]:[]]))return y;let h=nI(p),x=new o(["Iterator"]),b=i.map(e=>{let t=rl(su(e.name)||"element",h,e=>!x.has(e));return x.add(t),t});return y.suggest=[{messageId:kC,*fix(e){for(let[r,n]of(g&&(yield e.removeRange(g)),yield e.replaceTextRange(f,`for (const [${b.join(", ")}] of Iterator.zip([${i.map(e=>e.name).join(", ")}]))`),i.entries()))for(let o of d.get(n.name)){let n=b[r],a=t.getTokenBefore(o);t.getRange(a)[1]===t.getRange(o)[0]&&("Identifier"===a.type||"Keyword"===a.type)&&(n=` ${n}`);let i=t.getTokenAfter(o);t.getRange(o)[1]===t.getRange(i)[0]&&("Identifier"===i.type||"Keyword"===i.type)&&(n+=" "),yield e.replaceText(o,n)}}}],y})},meta:{type:"suggestion",docs:{description:"Prefer `Iterator.zip()` over parallel-array indexing.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[kT]:"Use `Iterator.zip(…)` to iterate over these arrays together.",[kC]:"Use `Iterator.zip(…)`."},languages:["js/js"]}},"unicorn/prefer-uint8array-hex":{create:e=>{e.on(["CallExpression","NewExpression"],t=>{var r;let n,o=function(e){if(!kO(e,"join",1)||!kU(e.arguments[0],""))return;let t=rx(e.callee.object);if(kO(t,"from",2)&&"Array"===t.callee.object.name&&kX(t.arguments[1])||kO(t,"call",2)&&t_(t.callee.object,{property:"map"})&&kX(t.arguments[1]))return t.arguments[0];if(!kO(t,"map",1)||!kX(t.arguments[0]))return;let r=rx(t.callee.object);return"ArrayExpression"===r.type&&1===r.elements.length&&r.elements[0]?.type==="SpreadElement"?r.elements[0].argument:kO(r,"from",1)&&"Array"===r.callee.object.name?r.arguments[0]:void 0}(t);if(o&&"ChainExpression"!==rx(o).type){let r=kH(o,e);if(r!==nz)return kY(t,o,e,{autofix:r===nV})}if(kO(t,"toString",1)&&kq(t.arguments[0])){let r=t.callee.object,n=kJ(r,e);if(n===nz||"ChainExpression"===rx(r).type)return;return kO(r,"from",1)&&kW(r.callee.object,e)&&kH(r.arguments[0],e)===nV&&([r]=r.arguments),kY(t,r,e,{autofix:n===nV})}if(kO(t,"from",2)&&kq(t.arguments[1])&&kW(t.callee.object,e)&&(n=kH(r=t.arguments[0],e,k_))!==nV&&(n!==nz||oR(r,e)))return kY(t,t.arguments[0],e,{decoding:!0,canSuggest:!function(e){for(;rh(e.parent);)e=e.parent;return"MemberExpression"===e.parent.type&&e.parent.object===e}(t)});let a=function(e){let t,r;if(kO(e,"from",2)&&"Uint8Array"===e.callee.object.name)[t,r]=e.arguments;else{if(!(tT(e,{name:"Uint8Array",argumentsLength:1})||kO(e,"from",1)&&"Uint8Array"===e.callee.object.name))return;let n=rx(e.arguments[0]);if(!kO(n,"map",1))return;t=n.callee.object,[r]=n.arguments}if(!function(e){let t=kK(e);if(!t)return!1;let{parameter:r,expression:n}=t;return(tS(n,{name:"parseInt",argumentsLength:2,optional:!1},tb)||kO(n,"parseInt",2)&&"Number"===n.callee.object.name)&&"Identifier"===n.arguments[0].type&&n.arguments[0].name===r.name&&kU(n.arguments[1],16)}(r)||("LogicalExpression"===(t=rx(t)).type&&["??","||"].includes(t.operator)&&tw(t.right)&&(t=rx(t.left)),!kO(t,"match",1)))return;let{regex:n}=t.arguments[0];if(!(!n||!kN.has(n.pattern)||!n.flags.includes("g")||/[^gisuv]/v.test(n.flags)))return t.callee.object}(t);if(a&&"ChainExpression"!==rx(a).type)return kY(t,a,e,{decoding:!0})})},meta:{type:"suggestion",docs:{description:"Prefer `Uint8Array#toHex()` and `Uint8Array.fromHex()` over manual and Buffer hex conversions.",recommended:!1},fixable:"code",hasSuggestions:!0,schema:[],messages:{[kR]:"Prefer `{{replacement}}` over {{description}}.",[kF]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-incomplete-accessor-override":{create:e=>{let{sourceCode:t}=e;e.on(["ClassDeclaration","ClassExpression"],function*(e){if(!e.superClass||e.declare||e.decorators?.length>0)return;let r=[new o,new o];for(let n of e.body.body){if("MethodDefinition"!==n.type||!["get","set"].includes(n.kind)||!n.value.body)continue;let o=k2(n,t);if(o===kQ||void 0===o||k5(o,n.static))continue;let a=r[Number(n.static)];if(a.has(o)||k9(e,o,n.static,t)!==n.kind)continue;let i="get"===n.kind?"set":"get",s=k6(e,o,n.static,t);(s===i||"both"===s)&&(a.add(o),yield{node:n.key,messageId:kZ,data:{kind:n.kind,oppositeKind:i,name:o}})}})},meta:{type:"problem",docs:{description:"Disallow class accessors that hide an inherited getter or setter.",recommended:"unopinionated"},messages:{[kZ]:"This {{kind}}ter hides the inherited {{oppositeKind}}ter for `{{name}}`. Define both accessors in this class."},languages:["js/js"]}},"unicorn/no-invalid-temporal-arithmetic":{create:e=>{e.on("CallExpression",t=>{if(!tP(t)||t.arguments.some(e=>"SpreadElement"===e.type))return;let n=eK(t.callee);if("compare"===n&&Ic(t.callee.object,"Duration")){if(t.arguments.length<2)return;let r=Ig(t.arguments[2],void 0,e);if(!r||void 0!==Iv(r,"relativeTo"))return;let n=Ix(t.arguments[0],e),o=Ix(t.arguments[1],e);return!(!n||!o||n.includes(k4)||o.includes(k4))&&n.some((e,t)=>e!==o[t])&&(Ib(n)||Ib(o))?{node:r.get("relativeTo")?.node??t.callee.property,messageId:"relative-to",data:{method:"compare"}}:void 0}if(Ip.has(n)){for(let[o,a]of Id)if(Iu.get(o).has(n)&&a(t.callee.object,e))return function(e,t,n,o){if("add"===n||"subtract"===n)return function(e,t,r,n){if(0!==e.arguments.length){if("Instant"===t||"Duration"===t){let o=Ix(e.arguments[0],n),a="Duration"===t?Ix(e.callee.object,n):void 0,i=o?.slice(0,"Instant"===t?4:3).findIndex(e=>e!==k4&&0!==e)??-1;if(-1===i&&!Ib(a))return;let s=If(e.arguments[0])?.get(Ie[i])?.value??e.arguments[0],l={node:-1===i?e.callee.property:s,messageId:"Instant"===t?"instant-calendar-unit":"duration-calendar-unit",data:{method:r}},u="Instant"===t?function(e,t){let r=If(e=rx(e)),n=r?.get("days"),o=Iy(Im(n?.value,t));if(n&&1===e.properties.length&&o!==k4&&0!==o&&Number.isSafeInteger(24*o)&&!(t.sourceCode.getCommentsInside(n.value).length>0))return{messageId:"elapsed-days",*fix(e){n.shorthand?yield e.replaceText(n,`hours: ${24*o}`):(yield e.replaceText(n.key,"hours"),yield e.replaceText(n.value,String(24*o)))}}}(e.arguments[0],n):void 0;return u&&(l.suggest=[u]),l}if("PlainTime"===t)return;let o=Ig(e.arguments[1],void 0,n),a=o&&Iv(o,"overflow");if(void 0!==a&&a!==k4&&!["constrain","reject"].includes(String(a)))return{node:o.get("overflow").node,messageId:"invalid-option",data:{type:t,method:r,option:"overflow"}};if("PlainYearMonth"!==t)return;let i=Ix(e.arguments[0],n),s=i?.findIndex((e,t)=>t>=2&&e!==k4&&0!==e)??-1;return -1!==s?{node:If(e.arguments[0])?.get(Ie[s])?.value??e.arguments[0],messageId:"year-month-unit",data:{method:r}}:void 0}}(e,t,n,o);let a="since"===n||"until"===n,i="total"===n?"unit":"smallestUnit",s=Ig(e.arguments[+!!a],a?void 0:i,o);if(!s)return;let l="Duration"===t?Ix(e.callee.object,o):void 0,u={type:t,method:n,options:s,fields:l},p=ID(e,u);if(p?.messageId==="missing-unit"){let t=function(e,t){let{method:n,options:o}=t,a="total"===n?"unit":"smallestUnit",i="total"===n?"smallestUnit":"unit",s=o.get(i)?.property;if(!s||o.has(a))return;let l=new r(o);if(l.set(a,o.get(i)),!(Iv(l,a)===k4||void 0===Iv(l,a)||ID(e,{...t,options:l})))return{messageId:"correct-unit-key",data:{expected:a,actual:i},fix:e=>e.replaceText(s.key,s.shorthand?`${a}: ${i}`:a)}}(e,u);t&&(p.suggest=[t])}return p}(t,o,n,e)}})},meta:{type:"problem",docs:{description:"Disallow statically known invalid Temporal arithmetic.",recommended:"unopinionated"},hasSuggestions:!0,schema:[],messages:{"instant-calendar-unit":"`Temporal.Instant.{{method}}()` does not support nonzero years, months, weeks, or days. Use elapsed time units or calendar arithmetic on a `Temporal.ZonedDateTime`.","duration-calendar-unit":"`Temporal.Duration.{{method}}()` does not support nonzero years, months, or weeks. Use date arithmetic relative to a starting point.","year-month-unit":"`Temporal.PlainYearMonth.{{method}}()` does not support nonzero weeks, days, or time units. Use years or months, or date arithmetic on a `Temporal.PlainDate`.","relative-to":"`Temporal.Duration.{{method}}()` requires `relativeTo` for calendar units.","invalid-option":"Invalid `{{option}}` for `Temporal.{{type}}.{{method}}()`.","missing-unit":"`Temporal.{{type}}.{{method}}()` requires {{required}}.","unit-order":"`largestUnit` must be at least as large as `smallestUnit`.","invalid-increment":"Invalid `roundingIncrement` for `Temporal.{{type}}.{{method}}()` and the selected units.","correct-unit-key":"Use `{{expected}}` instead of `{{actual}}`.","elapsed-days":"Treat each day as 24 elapsed hours."},languages:["js/js"]}},"unicorn/no-invalid-url-protocol-comparison":{create:e=>{e.on("BinaryExpression",t=>{if(IA.has(t.operator)){if(II(t.left,e))return Ij(t.right,e);if(II(t.right,e))return Ij(t.left,e)}}),e.on("SwitchStatement",function*(t){if(!II(t.discriminant,e))return;let r=t.cases.map(({test:e})=>e&&Ik(e));for(let[n,o]of t.cases.entries()){if(!o.test)continue;let t=Ij(o.test,e);t&&(r.some((e,r)=>r!==n&&e===t.data.protocol)&&delete t.fix,yield t)}}),e.on("CallExpression",function*(t){let r;if(tP(t,{methods:["includes","indexOf","lastIndexOf"],minimumArguments:1,maximumArguments:2}))r=rx(t.callee.object);else if(tP(t,{method:"has",argumentsLength:1})){let e=rx(t.callee.object);tT(e,{name:"Set",argumentsLength:1})&&(r=rx(e.arguments[0]))}if(r?.type==="ArrayExpression"&&II(t.arguments[0],e))for(let t of r.elements){if(!t)continue;let r=Ij(t,e);r&&(yield r)}})},meta:{type:"problem",docs:{description:"Disallow invalid protocol strings in comparisons with `URL#protocol`.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Iw]:"`URL#protocol` values are lowercase and end with `:`. Compare with `{{protocol}}`."},languages:["js/js"]}},"unicorn/no-prevent-default-in-passive-listener":{create:e=>{let{sourceCode:t}=e,r=xS(e);e.onExit("CallExpression",e=>{let n=rx(e.callee);if("MemberExpression"!==n.type||"preventDefault"!==eK(n))return;let o=rx(n.object);if("Identifier"!==o.type)return;let a=xv(e);if(!a||a.generator||a.params[0]?.type!=="Identifier")return;let i=(e=>{let t=e;for(;rh(t.parent);)t=t.parent;let r=t.parent;if(!tS(r,{argumentsLength:3},tb)||r.arguments[1]!==t)return;let n=rx(r.callee);if(("Identifier"!==n.type||"addEventListener"!==n.name)&&("MemberExpression"!==n.type||"addEventListener"!==eK(n)))return;let o=rx(r.arguments[2]);if("ObjectExpression"!==o.type||o.properties.some(e=>"Property"!==e.type||e.computed))return;let a=o.properties.findLast(e=>"passive"===eK(e)),i=rx(a?.value);if(tc(i,!0))return i})(a);if(!i)return;let s=eD(t.getScope(o),o);if(!(!s?.defs.some(e=>"Parameter"===e.type&&e.name===a.params[0]&&e.node===a)||s.references.some(e=>e.isWrite())||r.isFunctionSuspended(a)||r.isInsideSuspendingLoop(e,a)))return{node:e,messageId:IR,suggest:[{messageId:IF,fix:e=>e.replaceText(i,"false")}]}})},meta:{type:"problem",docs:{description:"Disallow ineffective `preventDefault()` calls in passive event listeners.",recommended:"unopinionated"},hasSuggestions:!0,schema:[],messages:{[IR]:"`preventDefault()` has no effect in a passive event listener.",[IF]:"Change `passive` to `false` to allow event cancellation."},languages:["js/js"]}},"unicorn/no-invalid-boolean-attribute-value":{create:e=>{e.on("CallExpression",t=>{if(!tS(t,{argumentsLength:2},tb)||!tL(t.callee)||"setAttribute"!==I_(t.callee,e))return;let[r,n]=t.arguments,a=Iz(r,e);if(void 0===a)return;let i=IV(a);if(!Iq.has(i)&&!IW.has(i))return;let s=rP(n,e);if(!s||null!==s.value&&["object","function","symbol"].includes(typeof s.value))return;let l=IV(String(s.value));if(""===l||l===i)return;let u=function e(t,r,n=new o){if(["ChainExpression","TSNonNullExpression","TSSatisfiesExpression","ParenthesizedExpression"].includes(t.type))return e(t.expression,r,n);if("TSAsExpression"===t.type||"TSTypeAssertion"===t.type)return IK(t.typeAnnotation,r)??IG(t,r);if("Identifier"===t.type){let{variable:o,definition:a}=IJ(t,r);if(n.has(o))return;let i=IH(a);if(i){n.add(o);let t=e(i,r,n);if(n.delete(o),t&&("const"===a.parent.kind||0===t.size))return t}return IK(a?.name?.typeAnnotation,r)??IG(t,r)}if(tS(t,void 0,tb)&&tL(t.callee)){let e,n=I_(t.callee,r);if(!["createElement","createElementNS","querySelector"].includes(n))return IG(t,r);if(!function e(t,r,n=new o){if("Identifier"===t.type){if("document"===t.name&&rg(t,r))return!0;let{variable:o,definition:a}=IJ(t,r),i=a?.parent?.kind==="const"?IH(a):void 0;return!(!i||n.has(o))&&(n.add(o),e(i,r,n))}return tL(t,{optional:!1})&&"document"===I_(t,r)&&"Identifier"===t.object.type&&IP.has(t.object.name)&&rg(t.object,r)}(t.callee.object,r))return new o;if("createElement"===n&&1===t.arguments.length){let n=Iz(t.arguments[0],r);e=void 0===n?void 0:IV(n)}else if("createElementNS"===n&&2===t.arguments.length&&"http://www.w3.org/1999/xhtml"===Iz(t.arguments[0],r))e=Iz(t.arguments[1],r);else if("querySelector"===n&&1===t.arguments.length){let n=Iz(t.arguments[0],r);e=void 0===n?void 0:function(e){try{let t=E.parse(e,{context:"selectorList"}).children.toArray();if(1!==t.length)return;let r=t[0].children.toArray();if(r[0]?.type!=="TypeSelector"||r.slice(1).some(e=>"ClassSelector"!==e.type&&"IdSelector"!==e.type))return;let n=IV(E.ident.decode(r[0].name));return IM.has(n)?void 0:n}catch{}}(n)}let a=IO.get(e);return new o(a?[a]:[])}return IG(t,r)}(t.callee.object,e);if(!u?.size||!Iq.has(i)&&[...u].some(e=>!IW.get(i).includes(e)))return;let p={node:n,messageId:IB,data:{attribute:i}},c="false"===l,{sourceCode:d}=e,m=c?[sq(n,e)[0],d.getRange(d.getLastToken(t))[0]]:d.getRange(n);return r9(e,m)||c&&r9(e,t.callee.property)||(p.suggest=[{messageId:c?IL:IN,data:{attribute:i},*fix(r){c?(yield r.replaceText(t.callee.property,t.callee.computed?"'removeAttribute'":"removeAttribute"),yield sW(r,n,e)):yield r.replaceText(n,"''")}}]),p})},meta:{type:"problem",docs:{description:"Disallow invalid values for HTML boolean attributes.",recommended:"unopinionated"},hasSuggestions:!0,schema:[],messages:{[IB]:"Invalid value for boolean attribute `{{attribute}}`. Use an empty string or the attribute name; remove the attribute to represent false.",[IL]:"Remove the `{{attribute}}` attribute.",[IN]:"Set the `{{attribute}}` attribute to an empty string."},languages:["js/js"]}},"unicorn/no-invalid-dom-token":{create:e=>{e.on("CallExpression",function*(t){let r=I5(t.callee),n=I0.get(I8(r));if(void 0===n)return;let o=I5(r.object);if(IQ.has(I8(o))&&!am(I5(o.object))||e.sourceCode.parserServices?.program&&I3(r.object,e))for(let r of t.arguments.slice(0,n)){if("SpreadElement"===r.type){if(1/0!==n)break;continue}let t=rx(r),o=td(t)??rP(t,e)?.value,a="string"==typeof o?I1.test(o):"TemplateLiteral"===t.type&&t.quasis.some(({value:e})=>"string"==typeof e.cooked&&I1.test(e.cooked));if(""!==o&&!a)continue;let i={node:r,messageId:""===o?IX:IY};if(1/0===n&&a){let t=I9(r,e);t&&(i.suggest=[t])}yield i}})},meta:{type:"problem",docs:{description:"Disallow invalid DOM tokens.",recommended:"unopinionated"},hasSuggestions:!0,schema:[],messages:{[IX]:"DOM tokens must not be empty.",[IY]:"DOM tokens must not contain ASCII whitespace.",[IZ]:"Replace with separate tokens."},languages:["js/js"]}},"unicorn/require-text-decoder-streaming":{create:e=>{e.on("CallExpression",t=>{let r=jt(t);if(!tP(r,{method:"decode",minimumArguments:1,maximumArguments:2})||!function(e,t){if(!e)return!0;if("ObjectExpression"!==(e=je(e)).type){let r=rP(e,t);return void 0!==r&&(void 0===r.value||null===r.value)}if(e.properties.some(e=>"Property"!==e.type||"init"!==e.kind||e.method||null===eK(e)||"__proto__"===eK(e)))return!1;let r=e.properties.findLast(e=>"stream"===eK(e));if(!r)return!0;let n=rP(r.value,t);return void 0!==n&&!n.value}(t.arguments[1],e))return;let n=jn(t),o=jt(ji(r.callee.object,e));if(!n||!tT(o,{name:"TextDecoder"})||!function(e,t,r){if(tL(e=ji(e,r),{property:"value"}))return jl(e.object,t,r);let n=ja(e,r);if(!n)return!1;let{definition:o}=n,a=o.node;if("ForOfStatement"===t.type&&t.await&&a.parent===t.left&&a.id===o.name){let e=jt(ji(t.right,r));return tP(e,{method:"values",maximumArguments:1})&&(e=e.callee.object),js(e,r)}return"ObjectPattern"===a.id.type&&a.id.properties.some(e=>"Property"===e.type&&"value"===eK(e)&&e.value===o.name)&&jl(a.init,t,r)}(t.arguments[0],n,e))return;let a={node:r.callee.property,messageId:I6},i=function(e,t,r){var n;let o,a,i,s,l,{sourceCode:u}=r,p=jp(e.parent.parent);if(!p||p.right!==e||!ju(e,e.arguments.length)||!function(e,t,r){let n="BlockStatement"===e.body.type?e.body.body:[];if("ForOfStatement"===e.type)return e.await&&1===n.length&&n[0]===t&&ja(t.expression.right.arguments[0],r)?.definition.node.parent===e.left;if("WhileStatement"!==e.type||"Literal"!==e.test.type||!0!==e.test.value||3!==n.length||n[2]!==t)return!1;let[o,a]=n,i=ja(t.expression.right.arguments[0],r)?.definition.node;return i?.parent===o&&1===o.declarations.length&&"ObjectPattern"===i.id.type&&2===i.id.properties.length&&jl(i.init,e,r)&&function(e,t,r){if("IfStatement"!==e.type||e.alternate)return!1;let n=t.id.properties.find(e=>"Property"===e.type&&"done"===eK(e)),o=ja(e.test,r),{consequent:a}=e,i="BlockStatement"===a.type&&1===a.body.length?a.body[0]:a;return n?.value.type==="Identifier"&&o?.definition.name===n.value&&"BreakStatement"===i.type&&!i.label}(a,i,r)}(t,e.parent.parent,r)||!["BlockStatement","Program"].includes(t.parent.type)||!(!(n=e.arguments[1])||"ObjectExpression"===n.type&&(0===n.properties.length||1===n.properties.length&&"stream"===eK(n.properties[0])&&n.properties[0].value?.type==="Literal"&&!1===n.properties[0].value.value))||u.getCommentsInside(t).length>0||u.getCommentsAfter(t).some(e=>u.getLoc(e).start.line===u.getLoc(t).end.line))return;let c=(a=jp((o=t.parent.body)[o.indexOf(t)+1]))&&ju(a.right,0)&&jo(a.left,r)?.variable===jo(p.left,r)?.variable&&jo(a.right.callee.object,r)?.variable===jo(e.callee.object,r)?.variable?a:void 0;if(i=e.parent,s=jc(e.callee.object,t,r),l=jc(i.left,t,r),!(s?.definition.parent.kind==="const"&&tT(jt(s.definition.node.init),{name:"TextDecoder"})&&l?.definition.parent.kind==="let"&&l.definition.node.init?.type==="Literal"&&""===l.definition.node.init.value&&s.variable.references.every(t=>t.init||t.identifier===e.callee.object||t.identifier===c?.right.callee.object)&&l.variable.references.every(e=>!e.isWrite()||e.init||e.identifier===i.left||e.identifier===c?.left)))return;let d=e.arguments[1];return{messageId:I4,*fix(n){if(d?0===d.properties.length?yield n.insertTextAfter(u.getFirstToken(d),"stream: true"):yield n.replaceText(d.properties[0].value,"true"):yield sU(n,e,"{stream: true}",r),!c){let o=`${u.getText(p.left)} += ${u.getText(e.callee.object)}.decode();`;yield n.insertTextAfter(t,`${rX(r)}${rY(t,r)}${o}`)}}}}(t,n,e);return i&&(a.suggest=[i]),a})},meta:{type:"problem",docs:{description:"Require streaming decoding of fetch-body chunks with `TextDecoder`.",recommended:"unopinionated"},hasSuggestions:!0,schema:[],messages:{[I6]:"Decode fetch-body chunks with `{stream: true}` using the same decoder, then consume a final `decode()` flush, or use `TextDecoderStream`.",[I4]:"Enable streaming decoding and consume the final flush."},languages:["js/js"]}},"unicorn/prefer-literal-ascii":{create:e=>{e.on("StyleSheet",t=>{let{sourceCode:r}=e,{text:n}=r,o=[],a=[];for(let{index:e,type:i,start:s,end:l}of(E.tokenize(n,(e,t,r)=>{a.push({type:e,start:t,end:r})}),function*(e,t){let r=0;for(let[o,a]of e.entries()){var n;let{type:e,start:i,end:s}=a;if(r>0){e===E.tokenTypes.Function||e===E.tokenTypes.LeftParenthesis?r++:e===E.tokenTypes.RightParenthesis&&r--;continue}if(n=t.slice(i,s),e===E.tokenTypes.Function&&"url"===E.ident.decode(n.slice(0,-1)).toLowerCase()){r=1;continue}yield{index:o,...a}}}(a,n))){if(function(e,t,r){if(0!==t&&(2!==t||e[t].type!==E.tokenTypes.String))return!1;let n=e[0];return n?.type===E.tokenTypes.AtKeyword&&0===n.start&&"@charset"===E.ident.decode(r.slice(0,n.end))}(a,e,n))continue;let u=i===E.tokenTypes.String;if(!u&&!jg.has(i))continue;let p=n.slice(s,l),c=function(e,t){let r="";for(let n=0;n<e.length;n++){let o=e[n];if("\\"!==o){r+=o;continue}if("\\"===e[n+1]){r+="\\\\",n++;continue}jf.lastIndex=n;let a=jf.exec(e);if(!a){r+=o;continue}let i=Number.parseInt(a.groups.digits,16);if(!jy(i)){r+=o;continue}r+=jh(String.fromCodePoint(i),t),n=jf.lastIndex-1}return r}(p,u?p[0]:void 0);if(c!==p){if(u){if(E.string.decode(p)!==E.string.decode(c))continue}else{if(i===E.tokenTypes.Hash&&jx(c.slice(1))[0]?.type!==E.tokenTypes.Ident)continue;let t=a[e-1]?.start??s,r=a[e+1]?.end??l;if(!function(e,t){let r=jx(e),n=jx(t);return r.length===n.length&&r.every((e,t)=>e.type===n[t].type&&e.value===n[t].value)}(n.slice(t,r),n.slice(t,s)+c+n.slice(l,r))||i===E.tokenTypes.Dimension&&jb(p)!==jb(c))continue}o.push({node:t,messageId:jd,loc:{start:r.getLocFromIndex(s),end:r.getLocFromIndex(l)},fix:e=>e.replaceTextRange([s,l],c)})}}return o}),e.on("String",t=>{if("StyleSheet"===e.sourceCode.ast.type)return;let r=e.sourceCode.getText(t);return jv(t,r,r[0])}),e.on("Literal",e=>{if(tp(e)&&"JSXAttribute"!==e.parent.type)return jv(e,e.raw,e.raw[0])}),e.on("TemplateElement",t=>{if(!tW(t.parent))return jv(t,nL(t,e),"`",(r,n)=>s2(t,n.replaceAll(/(?<=(?:^|[^\\])(?:\\\\)*)(?<symbol>`|\$(?={))/g,String.raw`\$<symbol>`),e,r))})},meta:{type:"suggestion",docs:{description:"Prefer literal printable ASCII characters over escape sequences.",recommended:"unopinionated"},fixable:"code",messages:{[jd]:"Prefer literal printable ASCII characters over escape sequences."},languages:["js/js","css/css","json/json","json/jsonc","json/json5"]}},"unicorn/prefer-short-escape-sequences":{create:e=>{let{sourceCode:t}=e;e.on("String",e=>{let r=t.getText(e),[n,o]=t.getRange(e);return jw(e,r.slice(1,-1),{dialect:"json"},(e,t)=>e.replaceTextRange([n+1,o-1],t))}),e.on("Literal",e=>{if(!tp(e)||"JSXAttribute"===e.parent.type)return;let{raw:r}=e,[n,o]=t.getRange(e);return jw(e,r.slice(1,-1),{dialect:"javascript"},(e,t)=>e.replaceTextRange([n+1,o-1],t))}),e.on("TemplateElement",r=>{if(tW(r.parent))return;let n=t.getText(r);return jw(r,n.slice(1,r.tail?-1:-2),{dialect:"javascript"},(t,n)=>s2(r,n,e,t))}),e.on(["TOMLValue","TOMLQuoted"],e=>{if("string"!==e.kind||"basic"!==e.style)return;let r=t.getText(e),n=r.startsWith('"""')?3:1,[o,a]=t.getRange(e);return jw(e,r.slice(n,-n),{dialect:"toml"},(e,t)=>e.replaceTextRange([o+n,a-n],t))})},meta:{type:"suggestion",docs:{description:"Prefer shorter alternatives to Unicode escape sequences.",recommended:"unopinionated"},fixable:"code",messages:{[jE]:"Prefer shorter alternatives to Unicode escape sequences."},languages:["js/js","json/json","json/jsonc","json/json5","toml/toml"]}},"unicorn/prefer-escaped-irregular-whitespace":{create:e=>{let{sourceCode:t}=e;e.on("Literal",e=>{if(tp(e)){if("JSXAttribute"===e.parent.type)return;return jF(e,t.getText(e))}if(tf(e)){let{flags:r}=e.regex;return jF(e,t.getText(e),{shouldFix:r.includes("u")||r.includes("v")})}}),e.on("String",e=>jF(e,t.getText(e),{escapeCharacter:jR})),e.on(["TOMLValue","TOMLQuoted"],e=>{if("string"===e.kind&&"basic"===e.style)return jF(e,t.getText(e),{escapeCharacter:jR})}),e.on("TemplateElement",t=>{if(!tW(t.parent))return jF(t,nL(t,e),{fix:(r,n)=>s2(t,n,e,r)})})},meta:{type:"suggestion",docs:{description:"Prefer escape sequences for irregular whitespace characters.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[jA]:"Prefer escape sequences for irregular whitespace characters."},languages:["js/js","json/json","json/jsonc","json/json5","toml/toml"]}}}).map(([e,t])=>{let r;return[e,{meta:{schema:[],...t.meta,docs:{...t.meta.docs,url:(r=C.basename(e,".js"),`https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v77.0.0/docs/rules/${r}.md`)}},create:i1(t.create)}]})))};module.exports=jB;