oxlint-plugin-react-doctor 0.9.19 → 0.9.20-dev.367ec1b

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.
@@ -1,5 +1,5 @@
1
- import*as e from"node:fs";import{readFileSync as t}from"node:fs";import*as n from"node:path";import{KEYS as r}from"eslint-visitor-keys";import{parseSync as i,rawTransferSupported as a,visitorKeys as o}from"oxc-parser";import{createHash as s,randomUUID as c}from"node:crypto";const l=[[`nextjs`,`Next.js`,`NEXT_PUBLIC_*`],[`vite`,`Vite`,`VITE_*`],[`tanstack-start`,`TanStack Start`,`VITE_*`],[`cra`,`Create React App`,`REACT_APP_*`],[`gatsby`,`Gatsby`,`GATSBY_*`]],u=e=>{for(let[t,n,r]of l)if(e(t))return`Move secrets to server-only code. In ${n}, only \`${r}\` env vars are exposed to the browser, and they must not contain secrets`},d=e=>e(`nextjs:static-export`)?`Avoid redirects inside useEffect — they flash the wrong page first. Use an event handler (e.g. onClick), or call redirect() from next/navigation during render (it prerenders a client-side redirect under output: "export"). Middleware and getServerSideProps redirects aren't available in a static export.`:void 0,f=[{key:`react-hooks-js/set-state-in-render`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/immutability`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/refs`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/purity`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/hooks`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/set-state-in-effect`,source:`react-compiler`,severity:`warn`},{key:`react-hooks-js/globals`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/error-boundaries`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/preserve-manual-memoization`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/unsupported-syntax`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/component-hook-factories`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/static-components`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/use-memo`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/void-use-memo`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/incompatible-library`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/todo`,source:`react-compiler`,severity:`error`}],p=Object.fromEntries(f.map(e=>[e.key,e.severity])),m=new Set(`width.height.min-width.max-width.min-height.max-height.top.right.bottom.left.padding.padding-top.padding-right.padding-bottom.padding-left.margin.margin-top.margin-right.margin-bottom.margin-left.border-width.border-top-width.border-right-width.border-bottom-width.border-left-width.line-height.column-width`.split(`.`)),h=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`,`borderWidth`,`fontSize`,`lineHeight`,`gap`]),g=new Set([`animate`,`initial`,`exit`,`whileHover`,`whileTap`,`whileFocus`,`whileDrag`,`whileInView`]),_=/blur\((\d+(?:\.\d+)?)px\)/,v=new Set([`requestAnimationFrame`,`setInterval`]),y=new Set([`framer-motion`,`motion`]),ee=new Set([`bounce`,`elastic`,`wobble`,`jiggle`,`spring`]),te={base:`3.0.0`,textLayoutGuard:`3.0.1`,aria:`6.2.0`,cursor:`6.7.0`,concurrent:`6.7.0`,renderToString:`6.8.0`,modernHooks:`7.0.0`,suspendTerminal:`7.1.0`},ne=[`ink-ctrl-c-handler-requires-exit-option`,`ink-newline-inside-text`,`ink-no-bare-process-exit`,`ink-no-direct-raw-mode`,`ink-no-dom-host-elements`,`ink-no-dom-router`,`ink-no-focus-in-render`,`ink-no-layout-inside-text`,`ink-no-live-hooks-in-render-to-string`,`ink-no-measure-element-in-render`,`ink-no-multiple-static`,`ink-no-raw-text`,`ink-no-repeated-render`,`ink-prefer-use-animation`,`ink-prefer-use-paste`,`ink-static-is-append-only`,`ink-static-requires-key`,`ink-suspense-requires-concurrent`,`ink-use-reactive-window-size`,`ink-use-string-width-for-cursor`,`ink-use-suspend-terminal`,`ink-valid-aria-semantics`],re=[`@react-router/dev`,`react-router-dom`,`react-router`],ie=[`Component`,`element`,`lazy`],ae=[`action`,`clientAction`,`clientLoader`,`loader`],oe=`react-router-csp-nonce-consistency.react-router-descendant-routes-require-splat.react-router-guard-aborted-handle-error.react-router-internal-route-anchor.react-router-loader-fetch-forwards-signal.react-router-loader-parallel-fetch.react-router-nested-route-requires-outlet.react-router-no-catch-middleware-next.react-router-no-client-module-in-server-render.react-router-no-duplicate-route-id.react-router-no-empty-leaf-route.react-router-no-invalid-absolute-child-path.react-router-no-invalid-lazy-route-properties.react-router-no-invalid-splat-path.react-router-no-loader-request-body.react-router-no-middleware-response-body-consumption.react-router-no-multiple-blockers.react-router-no-multiple-middleware-next.react-router-no-multiple-set-search-params-in-tick.react-router-no-navigate-in-render.react-router-no-nested-router.react-router-no-redirect-in-try-catch.react-router-no-route-module-environment-suffix.react-router-no-router-in-render.react-router-no-session-mutation-in-loader.react-router-no-static-cookie-expires.react-router-no-unsynchronized-search-params-mutation.react-router-no-use-loader-data-in-error-ui.react-router-prefer-route-lazy.react-router-require-root-error-boundary.react-router-resource-link-requires-reload.react-router-return-navigation-promise-in-transition.react-router-server-middleware-return-response.react-router-session-mutation-requires-commit.react-router-v8-no-meta-data-field.react-router-v8-no-react-router-dom-import.react-router-v8-no-removed-future-flags.react-router-valid-route-object`.split(`.`),se=new Set([`@react-router/cloudflare`,`@react-router/node`,`react-router/dom`,`react-router-dom`,`react-router`]),ce=new Set([`flash`,`set`,`unset`]),le=new Set([`createCookieSessionStorage`,`createFileSessionStorage`,`createMemorySessionStorage`,`createSessionStorage`,`createWorkersKVSessionStorage`]),ue=new Set([`createBrowserRouter`,`createHashRouter`,`createMemoryRouter`]),de=new Set([`append`,`delete`,`set`,`sort`]),fe=new Set([`caseSensitive`,`children`,`id`,`index`,`lazy`,`path`]),pe=new Set([`arrayBuffer`,`blob`,`bytes`,`formData`,`json`,`text`]),me=new Set([`unstable_previewServerPrerendering`,`v8_middleware`,`v8_passThroughRequests`,`v8_splitRouteModules`,`v8_trailingSlashAwareDataRequests`,`v8_viteEnvironmentApi`]),he=new Set([`BrowserRouter`,`HashRouter`,`MemoryRouter`,`Router`,`RouterProvider`]),ge=new Set([...ne,`client-passive-event-listeners`,`effect-needs-cleanup`,`effect-listener-cleanup-reference-mismatch`,`anchor-target-exists`,`exhaustive-deps`,`no-barrel-import`,`nextjs-async-dynamic-api-not-awaited`,`nextjs-missing-metadata`,`nextjs-no-img-element`,`nextjs-no-use-search-params-without-suspense`,`no-dynamic-import-path`,`no-full-lodash-import`,`no-hydration-branch-on-browser-global`,`no-img-without-dimensions`,`no-indeterminate-attribute`,`no-loading-flag-reset-outside-finally`,`no-locale-format-in-render`,`no-match-media-in-state-initializer`,`no-create-ref-in-function-component`,`no-reset-all-state-on-prop-change`,`no-side-effect-in-state-updater-function`,`no-adjust-state-on-prop-change`,`no-derived-state`,`no-derived-state-effect`,`no-event-handler`,`no-initialize-state`,`no-mutating-reducer-state`,`only-export-components`,`no-unguarded-browser-global-at-module-scope`,`no-unguarded-browser-global-in-render-or-hook-init`,`window-open-without-noopener`,`prefer-dynamic-import`,`rendering-hydration-mismatch-time`,`rendering-hydration-no-flicker`,`remotion-calculate-metadata-fetch-signal`,`remotion-deterministic-randomness`,`remotion-no-css-animation`,`remotion-no-css-transition`,`remotion-no-css-url-assets`,`remotion-no-native-media-elements`,`remotion-no-next-image`,`rerender-memo-with-default-value`,`rules-of-hooks`,`server-sequential-independent-await`,`rn-no-deprecated-modules`,`rn-no-legacy-shadow-styles`,`rn-no-raw-text`,`rn-prefer-expo-image`,`rn-style-prefer-boxshadow`,...oe]),b=(e,t)=>typeof e==`object`&&!!e&&e.type===t,_e=e=>{if(e.kind!==`import`)return null;let t=e.declarationNode.parent;return b(t,`ImportDeclaration`)?t:null},x=e=>{if(!b(e,`ImportSpecifier`))return;let t=e.imported;if(b(t,`Identifier`))return t.name;if(b(t,`Literal`)&&typeof t.value==`string`)return t.value},S=(e,t={})=>{if(!b(e,`Property`)&&!b(e,`MethodDefinition`)&&!b(e,`PropertyDefinition`)&&!b(e,`MemberExpression`))return null;let n=b(e,`MemberExpression`)?e.property:e.key;if(e.computed)return t.allowComputedString&&b(n,`Literal`)&&typeof n.value==`string`?n.value:t.allowComputedString&&t.stringifyNonStringLiterals&&b(n,`Literal`)?String(n.value):t.allowComputedString&&b(n,`TemplateLiteral`)&&n.expressions.length===0?n.quasis[0]?.value.cooked??n.quasis[0]?.value.raw??null:null;if(b(n,`Identifier`))return n.name;if(b(n,`Literal`)){if(typeof n.value==`string`)return n.value;if(t.stringifyNonStringLiterals)return String(n.value)}return null},C=e=>{let t=e.property;return!e.computed&&b(t,`Identifier`)?t.name:e.computed&&b(t,`Literal`)?typeof t.value==`string`?t.value:null:e.computed&&b(t,`TemplateLiteral`)&&t.expressions.length===0?t.quasis[0]?.value.cooked??t.quasis[0]?.value.raw??null:null},ve=new Set([`ParenthesizedExpression`,`TSAsExpression`,`TSSatisfiesExpression`,`TSTypeAssertion`,`TSNonNullExpression`,`TSInstantiationExpression`,`ChainExpression`]),w=e=>{let t=e;for(;;)switch(t.type){case`ParenthesizedExpression`:case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSTypeAssertion`:case`TSNonNullExpression`:case`TSInstantiationExpression`:case`ChainExpression`:if(!(`expression`in t)||!t.expression)return t;t=t.expression;break;default:return t}},ye=e=>{let t=_e(e);if(!t||typeof t.source.value!=`string`||t.importKind===`type`||b(e.declarationNode,`ImportSpecifier`)&&e.declarationNode.importKind===`type`)return null;if(b(e.declarationNode,`ImportNamespaceSpecifier`))return{source:t.source.value,importedName:null,isNamespace:!0};if(b(e.declarationNode,`ImportDefaultSpecifier`))return{source:t.source.value,importedName:`default`,isNamespace:!1};let n=x(e.declarationNode);return n?{source:t.source.value,importedName:n,isNamespace:!1}:null},be=(e,t,n)=>{let r=t.symbolFor(e);if(!r||n.has(r.id))return null;if(r.kind===`import`)return ye(r);if(r.kind!==`const`||!r.initializer)return null;if(n.add(r.id),b(r.declarationNode,`VariableDeclarator`)&&b(r.declarationNode.id,`ObjectPattern`)){let e=xe(r.initializer,t,n);if(!e||!e.isNamespace&&e.importedName!==`default`)return null;for(let t of r.declarationNode.id.properties){if(!b(t,`Property`)||(b(t.value,`AssignmentPattern`)?t.value.left:t.value)!==r.bindingIdentifier)continue;let n=S(t,{allowComputedString:!0});return n?{source:e.source,importedName:n,isNamespace:!1}:null}return null}return xe(r.initializer,t,n)},xe=(e,t,n=new Set)=>{let r=w(e);if(b(r,`Identifier`))return be(r,t,n);if(!b(r,`MemberExpression`))return null;let i=C(r);if(!i)return null;let a=xe(r.object,t,n);return!a||!a.isNamespace&&a.importedName!==`default`?null:{source:a.source,importedName:i,isNamespace:!1}};let T=null;const Se=e=>{T?.existencePaths.add(e)},E=e=>{T?.contentPaths.add(e)},Ce=()=>T!==null,we=e=>{let t=T,n={existencePaths:new Set,contentPaths:new Set};T=n;try{return{value:e(),trace:n}}finally{if(T=t,t!==null){for(let e of n.existencePaths)t.existencePaths.add(e);for(let e of n.contentPaths)t.contentPaths.add(e)}}},Te=e=>{if(T!==null){for(let t of e.existencePaths)T.existencePaths.add(t);for(let t of e.contentPaths)T.contentPaths.add(t)}},Ee=e=>we(e).trace,De=new Map,Oe=new Map;let ke=0;const Ae=()=>{De.clear(),Oe.clear(),ke+=1},je=()=>ke,Me=t=>{if(!t)return null;let r=n.dirname(t),i=De.get(r);if(i!==void 0){if(Ce()){let e=r;for(;Se(n.join(e,`package.json`)),e!==i;){let t=n.dirname(e);if(t===e)break;e=t}}return i}let a=r;for(;;){let t=n.join(a,`package.json`);Se(t);let i=!1;try{i=e.statSync(t,{throwIfNoEntry:!1})?.isFile()??!1}catch{i=!1}if(i)return De.set(r,a),a;let o=n.dirname(a);if(o===a)return De.set(r,null),null;a=o}},Ne=e=>{let t=Me(e);return t?Pe(t):null},Pe=t=>{let r=Oe.get(t);if(r!==void 0&&!Ce())return r;let i=n.join(t,`package.json`);if(E(i),r!==void 0)return r;let a=null;try{let t=JSON.parse(e.readFileSync(i,`utf-8`));typeof t==`object`&&t&&(a=t)}catch{a=null}return Oe.set(t,a),a},Fe=e=>{let t=e.match(/^(\d+)(?:\.(\d+))?(?:\.(\d+))?(-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/);return t?{major:Number(t[1]),minor:Number(t[2]??0),patch:Number(t[3]??0),isPrerelease:!!t[4]}:null},Ie=(e,t)=>e.major-t.major||e.minor-t.minor||e.patch-t.patch||Number(t.isPrerelease)-Number(e.isPrerelease),Le=new Map;let Re=je();const ze=e=>{if(typeof e!=`string`)return null;let t=e.trim();if(!t||/^(?:catalog|file|git|https?|link|npm|workspace):/.test(t)||/^(?:latest|next|\*)$/.test(t))return null;let n=[];for(let e of t.split(`||`)){let t=e.trim();if(/^<(?!=)/.test(t)||/^<=/.test(t))return null;let r=t.match(/\d+(?:\.\d+)?(?:\.\d+)?(?:-[0-9A-Za-z.-]+)?/)?.[0];if(!r)return null;let i=Fe(r);if(!i)return null;n.push(i)}return n.reduce((e,t)=>Ie(t,e)<0?t:e)},Be=(e,t)=>{let n=e.dependencies?.[t]??e.devDependencies?.[t]??e.peerDependencies?.[t]??e.optionalDependencies?.[t],r=ze(n);return r&&typeof n==`string`?{version:r,declaredRange:n}:null},Ve=(e,t)=>{let r=e;for(;;){let e=Pe(n.join(r,`node_modules`,t));if(e)return{didFindPackage:!0,version:typeof e.version==`string`?Fe(e.version):null};let i=n.dirname(r);if(i===r)return{didFindPackage:!1,version:null};r=i}},He=(e,t)=>{let n=Ve(e,t);if(n.didFindPackage)return n.version?{version:n.version,declaredRange:null}:null;let r=Pe(e);return r?Be(r,t):null},Ue=(e,t)=>{if(!e)return null;let r=Me(n.resolve(e));if(!r)return null;let i=je();i!==Re&&(Le.clear(),Re=i);let a=JSON.stringify([r,t]),o=Le.get(a);if(o)return Te(o.trace),o.version;let{value:s,trace:c}=we(()=>He(r,t));return Le.set(a,{version:s,trace:c}),s},We=new Set([`implements`,`returnType`,`superTypeArguments`,`superTypeParameters`,`typeAnnotation`,`typeArguments`,`typeParameters`]),Ge={...o,...r,ArrayPattern:[`decorators`,...r.ArrayPattern],AssignmentPattern:[`decorators`,...r.AssignmentPattern],ClassDeclaration:[`decorators`,...r.ClassDeclaration],ClassExpression:[`decorators`,...r.ClassExpression],Identifier:[`decorators`,...r.Identifier],MethodDefinition:[`decorators`,...r.MethodDefinition],ObjectPattern:[`decorators`,...r.ObjectPattern],PropertyDefinition:[`decorators`,...r.PropertyDefinition],RestElement:[`decorators`,...r.RestElement]},Ke=new Map,qe=e=>e.filter(e=>e!==`parent`&&!We.has(e)),Je=e=>{let t=Ke.get(e.type);if(t)return t;let n=Ge[e.type];if(!n)return qe(Object.keys(e));let r=qe(n);return Ke.set(e.type,r),r},D=e=>typeof e==`object`&&!!e&&typeof e.type==`string`,O=e=>e!=null&&(e.type===`ArrowFunctionExpression`||e.type===`FunctionExpression`||e.type===`FunctionDeclaration`),Ye=e=>e===`var`||e===`function`,Xe=e=>{let t=e;for(;t;){if(t.kind===`module`||t.kind===`function`||t.kind===`arrow-function`||t.kind===`method`)return t;t=t.parent}return e},Ze=(e,t,n,r)=>{let i={id:r.nextScopeId++,kind:e,node:t,parent:n,children:[],symbols:[],references:[],symbolsByName:new Map};return n&&n.children.push(i),i},Qe=(e,t,n)=>{let r=Ze(e,t,n.currentScope,n);return n.scopeStack.push(r),n.currentScope=r,n.ownScopeForNode.set(t,r),r},$e=e=>{e.scopeStack.pop();let t=e.scopeStack[e.scopeStack.length-1];if(!t)throw Error(`scope stack underflow`);e.currentScope=t},et=(e,t,n)=>{let r={id:t.nextSymbolId++,name:n.name,kind:n.kind,bindingIdentifier:n.bindingIdentifier,declarationNode:n.declarationNode,scope:e,initializer:n.initializer,references:[]};return e.symbols.push(r),e.symbolsByName.set(n.name,r),t.symbolByBindingIdentifier.set(n.bindingIdentifier,r),r},tt=(e,t,n,r,i,a)=>{if(b(e,`Identifier`)){et(n,r,{name:e.name,kind:i,bindingIdentifier:e,declarationNode:a,initializer:t});return}if(b(e,`ObjectPattern`)){for(let o of e.properties)if(b(o,`Property`)){let e=o.value;tt(e,b(e,`AssignmentPattern`)?e.right:t,n,r,i,a)}else b(o,`RestElement`)&&tt(o.argument,t,n,r,i,a);return}if(b(e,`ArrayPattern`)){for(let o of e.elements)o&&tt(o,b(o,`AssignmentPattern`)?o.right??null:t,n,r,i,a);return}if(b(e,`AssignmentPattern`)){tt(e.left,e.right??null,n,r,i,a);return}b(e,`RestElement`)&&tt(e.argument,null,n,r,i,a)},nt=(e,t,n)=>{let r={id:e.nextReferenceId++,identifier:t,resolvedSymbol:null,flag:n,scope:e.currentScope};e.currentScope.references.push(r),e.referenceByIdentifier.set(t,r)},rt=e=>e.parent?O(e.parent):!1,it=e=>e.parent!==null&&e.parent!==void 0&&e.parent.type===`CatchClause`,at=(e,t)=>{if(!b(e,`VariableDeclaration`))return;let n=e.kind===`var`?`var`:e.kind===`let`?`let`:e.kind===`const`?`const`:`using`,r=Ye(n)?Xe(t.currentScope):t.currentScope;for(let i of e.declarations){let e=i,a=i.init??null;tt(i.id,a,r,t,n,e)}},ot=(e,t)=>{b(e,`FunctionDeclaration`)&&e.id&&et(Xe(t.currentScope),t,{name:e.id.name,kind:`function`,bindingIdentifier:e.id,declarationNode:e,initializer:e})},st=(e,t)=>{b(e,`ClassDeclaration`)&&e.id&&et(t.currentScope,t,{name:e.id.name,kind:`class`,bindingIdentifier:e.id,declarationNode:e,initializer:e})},ct=(e,t)=>{if(!b(e,`ImportDeclaration`))return;let n=Xe(t.currentScope);for(let r of e.specifiers){let e=r.local;b(e,`Identifier`)&&et(n,t,{name:e.name,kind:`import`,bindingIdentifier:e,declarationNode:r,initializer:r})}},lt=(e,t)=>{if(e.type!==`TSImportEqualsDeclaration`&&e.type!==`TSEnumDeclaration`&&e.type!==`TSTypeAliasDeclaration`&&e.type!==`TSInterfaceDeclaration`&&e.type!==`TSModuleDeclaration`)return;let n=e.id;if(!n||!b(n,`Identifier`))return;let r=e.type===`TSImportEqualsDeclaration`?`ts-import-equals`:e.type===`TSEnumDeclaration`?`ts-enum`:e.type===`TSTypeAliasDeclaration`?`ts-type-alias`:e.type===`TSInterfaceDeclaration`?`ts-interface`:`ts-module`;et(Xe(t.currentScope),t,{name:n.name,kind:r,bindingIdentifier:n,declarationNode:e,initializer:null})},ut=(e,t,n)=>{for(let r of e)tt(r,null,t,n,`parameter`,r)},dt=e=>!(!b(e,`BlockStatement`)||rt(e)||it(e)||e.parent&&e.parent.type===`TSModuleDeclaration`),ft=e=>{let t=e.parent;if(!t)return!1;if(t.type===`JSXMemberExpression`)return t.object===e;if(t.type===`JSXNamespacedName`)return!1;let n=e.name.charCodeAt(0);return!(n>=97&&n<=122)},pt=e=>{let t=e.parent;if(!t)return!1;switch(t.type){case`MemberExpression`:return t.property===e&&!t.computed;case`Property`:return t.key===e&&!t.computed&&!t.shorthand;case`MethodDefinition`:case`PropertyDefinition`:return t.key===e&&!t.computed;case`JSXAttribute`:return t.name===e;case`ImportSpecifier`:return t.imported===e;case`ExportSpecifier`:return t.exported===e&&t.local!==t.exported;case`LabeledStatement`:case`BreakStatement`:case`ContinueStatement`:return t.label===e;default:return!1}},mt=e=>{let t=e.parent;if(!t)return`read`;switch(t.type){case`AssignmentExpression`:return t.left===e?t.operator===`=`?`write`:`read-write`:`read`;case`UpdateExpression`:return`read-write`;case`ForInStatement`:case`ForOfStatement`:return t.left===e?`write`:`read`;default:return`read`}},ht=(e,t)=>{t.nodeScope.set(e,t.currentScope)},gt=(e,t,n)=>{let r=Qe(e,t,n);return ht(t,n),r},_t=(e,t,n)=>{if(e.type===`AssignmentPattern`){_t(e.left,t,n);let r=e.right??null;r&&k(r,t,n);return}if(e.type===`ObjectPattern`){for(let r of e.properties){let e=r;if(e.type===`RestElement`){_t(e.argument,t,n);continue}if(e.type!==`Property`)continue;let i=e;i.computed&&k(i.key,t,n),_t(i.value,t,n)}return}if(e.type===`ArrayPattern`){for(let r of e.elements)r&&_t(r,t,n);return}e.type===`RestElement`&&_t(e.argument,t,n)},k=(e,t,n)=>{if(e.type===`ArrowFunctionExpression`||e.type===`FunctionExpression`||e.type===`FunctionDeclaration`){e.type===`FunctionDeclaration`&&e.id&&ot(e,t);let n=e.params??[],r=t.currentScope;for(let e of n)if(!(!(`decorators`in e)||!Array.isArray(e.decorators)))for(let n of e.decorators)D(n)&&k(n,t,r);ht(e,t);let i=Qe(e.type===`ArrowFunctionExpression`?`arrow-function`:`function`,e,t);(e.type===`FunctionExpression`||e.type===`FunctionDeclaration`)&&e.id&&et(i,t,{name:e.id.name,kind:`function`,bindingIdentifier:e.id,declarationNode:e,initializer:e}),ut(n,i,t);for(let e of n)_t(e,t,r);let a=e.body;a&&k(a,t,r),$e(t);return}if(e.type===`ClassDeclaration`||e.type===`ClassExpression`){if(e.type===`ClassDeclaration`&&e.id&&st(e,t),Array.isArray(e.decorators))for(let n of e.decorators)D(n)&&k(n,t,null);let n=gt(`class`,e,t);e.type===`ClassExpression`&&e.id&&et(n,t,{name:e.id.name,kind:`class`,bindingIdentifier:e.id,declarationNode:e,initializer:e}),e.superClass&&k(e.superClass,t,n),e.body&&k(e.body,t,n),$e(t);return}if(e.type===`CatchClause`){let n=gt(`catch`,e,t);e.param&&tt(e.param,null,n,t,`catch-clause-parameter`,e),e.body&&k(e.body,t,n),$e(t);return}if(e.type===`ForStatement`||e.type===`ForInStatement`||e.type===`ForOfStatement`){gt(`for`,e,t),vt(e,t),$e(t);return}if(e.type===`SwitchStatement`){let n=gt(`switch`,e,t);e.discriminant&&k(e.discriminant,t,n);for(let r of e.cases)k(r,t,n);$e(t);return}if(e.type===`TSModuleDeclaration`){let n=gt(`ts-module`,e,t);if(e.id&&b(e.id,`Identifier`)){let r=e.id;et(Xe(n.parent??t.currentScope),t,{name:r.name,kind:`ts-module`,bindingIdentifier:r,declarationNode:e,initializer:null})}e.body&&k(e.body,t,n),$e(t);return}if(e.type===`TSEnumDeclaration`){lt(e,t);let n=gt(`ts-enum`,e,t),r=e.members??[];for(let e of r)k(e,t,n);$e(t);return}if(e.type===`BlockStatement`&&dt(e)){let n=gt(`block`,e,t);for(let r of e.body)k(r,t,n);$e(t);return}switch(t.currentScope!==n&&ht(e,t),e.type){case`VariableDeclaration`:at(e,t);break;case`ImportDeclaration`:ct(e,t);break;case`TSImportEqualsDeclaration`:case`TSTypeAliasDeclaration`:case`TSInterfaceDeclaration`:lt(e,t);break}(e.type===`Identifier`||e.type===`JSXIdentifier`)&&!t.symbolByBindingIdentifier.has(e)&&!pt(e)&&(e.type===`JSXIdentifier`?ft(e)&&nt(t,e,mt(e)):nt(t,e,mt(e))),vt(e,t)},vt=(e,t)=>{let n=e,r=t.currentScope;for(let i of Je(e)){let e=n[i];if(Array.isArray(e))for(let n of e)D(n)&&k(n,t,r);else D(e)&&k(e,t,r)}},yt=e=>{let t=e=>{for(let t of e.references){let n=t.identifier.name;if(typeof n!=`string`)continue;let r=e;for(;r;){let e=r.symbolsByName.get(n);if(e){t.resolvedSymbol=e,e.references.push(t);break}r=r.parent}}for(let n of e.children)t(n)};t(e)},A=e=>{let t={id:0,kind:`module`,node:e,parent:null,children:[],symbols:[],references:[],symbolsByName:new Map},n={nextScopeId:1,nextSymbolId:0,nextReferenceId:0,currentScope:t,scopeStack:[t],rootScope:t,nodeScope:new WeakMap,ownScopeForNode:new WeakMap,symbolByBindingIdentifier:new WeakMap,referenceByIdentifier:new WeakMap};if(n.nodeScope.set(e,t),n.ownScopeForNode.set(e,t),e.type===`Program`)for(let r of e.body)k(r,n,t);else k(e,n,t);return yt(t),{rootScope:t,scopeFor:e=>{let r=e;for(;r;){let e=n.nodeScope.get(r);if(e)return e;r=r.parent??null}return t},ownScopeFor:e=>n.ownScopeForNode.get(e)??null,symbolFor:e=>{let t=n.referenceByIdentifier.get(e);return t?t.resolvedSymbol:n.symbolByBindingIdentifier.get(e)||null},referenceFor:e=>n.referenceByIdentifier.get(e)??null,isGlobalReference:e=>{let t=n.referenceByIdentifier.get(e);return t?t.resolvedSymbol===null:!1}}},bt=(e,t)=>{let n=e;for(;n;){if(n===t)return!0;n=n.parent}return!1},xt=1024,St=2e6,Ct=1e3,j=e=>{let t=e.parent;for(;t;){if(O(t))return t;t=t.parent??null}return null},wt=e=>b(e,`Identifier`)?e.name:b(e,`Literal`)&&typeof e.value==`string`?e.value:null,Tt=e=>{if(b(e,`ImportSpecifier`)){let t=e.imported;return b(t,`Identifier`)?t.name:b(t,`Literal`)&&typeof t.value==`string`?t.value:null}return b(e,`ImportDefaultSpecifier`)?`default`:null},Et=(e,t)=>{if(!b(e,`ExportNamedDeclaration`)||!e.source||e.exportKind===`type`)return null;let n=e.source.value;if(typeof n!=`string`)return null;for(let r of e.specifiers??[]){let e=Dt(r,t,n);if(e)return e}return null},Dt=(e,t,n)=>{if(!b(e,`ExportSpecifier`)||e.exportKind===`type`||wt(e.exported)!==t)return null;let r=wt(e.local);return r?{importedName:r,source:n}:null},Ot=(e,t)=>{if(!b(e,`ExportAllDeclaration`)||!e.source||e.exportKind===`type`||e.exported)return null;let n=e.source.value;return typeof n==`string`?{importedName:t,source:n}:null},kt=(e,t)=>{if(!b(e,`Program`))return[];let n=[];for(let r of e.body??[]){let e=Et(r,t);if(e)return[e];let i=Ot(r,t);i&&n.push(i)}return n},M=(e,t)=>{if(e){if(b(e,`Identifier`)){t.add(e.name);return}if(b(e,`AssignmentPattern`)){M(e.left,t);return}if(b(e,`RestElement`)){M(e.argument,t);return}if(b(e,`ArrayPattern`)){for(let n of e.elements??[])M(n,t);return}if(b(e,`ObjectPattern`))for(let n of e.properties??[]){if(b(n,`RestElement`)){M(n.argument,t);continue}b(n,`Property`)&&M(n.value,t)}}},At=(e,t,n)=>{if(e&&!b(e,`Identifier`)){if(b(e,`AssignmentPattern`)){N(e.right,t,n),At(e.left,t,n);return}if(b(e,`RestElement`)){At(e.argument,t,n);return}if(b(e,`ArrayPattern`)){for(let r of e.elements??[])At(r,t,n);return}if(b(e,`ObjectPattern`))for(let r of e.properties??[]){if(b(r,`RestElement`)){At(r.argument,t,n);continue}b(r,`Property`)&&(r.computed&&N(r.key,t,n),At(r.value,t,n))}}},jt=(e,t,n)=>{if(!b(e,`FunctionDeclaration`)&&!b(e,`FunctionExpression`)&&!b(e,`ArrowFunctionExpression`))return;let r=new Set(n);for(let t of e.params??[])M(t,r);for(let n of e.params??[])At(n,t,r);N(e.body,t,r)},N=(e,t,n)=>{if(!e)return;if(b(e,`Identifier`)){n.has(e.name)||t.add(e.name);return}if(b(e,`MemberExpression`)){N(e.object,t,n),e.computed&&N(e.property,t,n);return}if(b(e,`Property`)){e.computed&&N(e.key,t,n),N(e.value,t,n);return}if(b(e,`FunctionDeclaration`)||b(e,`FunctionExpression`)||b(e,`ArrowFunctionExpression`)){jt(e,t,n);return}if(b(e,`TSAsExpression`)||b(e,`TSSatisfiesExpression`)||b(e,`TSTypeAssertion`)||b(e,`TSNonNullExpression`)||b(e,`TSInstantiationExpression`)){N(e.expression,t,n);return}if(typeof e.type==`string`&&e.type.startsWith(`TS`))return;let r=e;for(let e of Object.keys(r)){if(e===`parent`||We.has(e))continue;let i=r[e];if(Array.isArray(i))for(let e of i)D(e)&&N(e,t,n);else D(i)&&N(i,t,n)}},Mt=(e,t)=>N(e,t,new Set),Nt=e=>{let t=[],n=new Set;if(b(e,`VariableDeclaration`))for(let r of e.declarations??[])b(r.init,`AwaitExpression`)&&(r.init.argument&&t.push(r.init.argument),M(r.id,n));else if(b(e,`ExpressionStatement`)){let r=e.expression;b(r,`AwaitExpression`)?r.argument&&t.push(r.argument):b(r,`AssignmentExpression`)&&b(r.right,`AwaitExpression`)&&(r.right.argument&&t.push(r.right.argument),b(r.left,`Identifier`)&&n.add(r.left.name))}else b(e,`ReturnStatement`)&&b(e.argument,`AwaitExpression`)?e.argument.argument&&t.push(e.argument.argument):b(e,`ForOfStatement`)&&e.await&&(e.right&&t.push(e.right),M(b(e.left,`VariableDeclaration`)?e.left.declarations?.[0]?.id??null:e.left,n));return t.length===0?null:{awaitedExpressions:t,boundNames:[...n]}},Pt=(e,t)=>{if(b(e,`VariableDeclaration`))for(let n of e.declarations??[])M(n.id,t)},Ft=(e,t,n)=>{let r=new Map,i=[];for(let a of e.body??[]){let e=Nt(a);if(!e){let e=new Set;if(Pt(a,e),e.size===0)continue;let t=new Set;Mt(a,t);let n=new Set;for(let e of t)for(let t of r.get(e)??[])n.add(t);if(n.size===0)continue;for(let t of e)r.set(t,n);continue}if(n&&!e.awaitedExpressions.every(e=>n(e))){r.clear(),i.length=0;continue}let o=new Set;for(let t of e.awaitedExpressions)Mt(t,o);let s=new Set;for(let e of o)for(let t of r.get(e)??[])s.add(t);if(i.filter((e,t)=>!s.has(t)).length+1>=t)return a;let c=i.length;i.push(s);let l=new Set(s);l.add(c);for(let t of e.boundNames)r.set(t,l)}return null},P=e=>{let t=e;for(;t.parent&&ve.has(t.parent.type);)t=t.parent;return t},It=e=>{if(b(e,`FunctionDeclaration`)&&b(e.id,`Identifier`))return e.id;let t=P(e),n=t.parent;return b(n,`VariableDeclarator`)&&n.init===t&&b(n.id,`Identifier`)?n.id:null},Lt=e=>{let t=P(e);return!!(t.parent&&b(t.parent,`AwaitExpression`)&&t.parent.argument===t)},F=(e,t,n=!1)=>{if(e.type!==`Identifier`&&e.type!==`JSXIdentifier`)return null;let r=null,i=t.symbolFor(e);for(;i?.kind===`const`;){if(!i.initializer||i.declarationNode.type!==`VariableDeclarator`)return null;if(i.declarationNode.id!==i.bindingIdentifier)return n?i:null;let e=w(i.initializer);if(e.type!==`Identifier`)return i;if(r?.has(i.id))return null;r||=new Set,r.add(i.id),i=t.symbolFor(e)}return i},Rt=(e,t)=>{if(!O(e)||e.async||!b(e.body,`BlockStatement`))return!1;let[n,r,i,a,o]=e.body.body.toReversed();if(!b(o,`VariableDeclaration`)||o.kind!==`const`||o.declarations.length!==1||!b(a,`IfStatement`)||a.alternate||!b(i,`VariableDeclaration`)||i.kind!==`const`||i.declarations.length!==1||!b(r,`ExpressionStatement`)||!b(n,`ReturnStatement`))return!1;let s=o.declarations[0],c=i.declarations[0];if(!s?.init||!c?.init||!n.argument)return!1;let l=w(s.init),u=w(r.expression);if(!b(l,`CallExpression`)||!b(u,`CallExpression`)||!b(l.callee,`MemberExpression`)||!b(u.callee,`MemberExpression`)||l.optional||u.optional||l.callee.optional||u.callee.optional||C(l.callee)!==`get`||C(u.callee)!==`set`||l.arguments.length!==1||u.arguments.length!==2)return!1;let d=F(l.callee.object,t);if(d?.kind!==`const`||!d.initializer||j(d.bindingIdentifier)||F(u.callee.object,t)!==d)return!1;let f=w(d.initializer);if(!b(f,`NewExpression`)||!b(f.callee,`Identifier`)||![`Map`,`WeakMap`].includes(f.callee.name)||!t.isGlobalReference(f.callee)||f.arguments.length!==0)return!1;let p=a.consequent;if(b(p,`BlockStatement`)){if(p.body.length!==1)return!1;p=p.body[0]}let m=t.symbolFor(s.id),h=t.symbolFor(c.id),g=l.arguments[0],_=u.arguments[0],v=u.arguments[1];if(!m||!h||!b(p,`ReturnStatement`)||!p.argument||!g||!_||!v||t.symbolFor(w(a.test))!==m||t.symbolFor(w(p.argument))!==m||t.symbolFor(w(v))!==h||t.symbolFor(w(n.argument))!==h)return!1;let y=F(w(g),t);if(!y||y.references.some(e=>e.flag!==`read`)||y.kind!==`parameter`||j(y.bindingIdentifier)!==e||F(w(_),t)!==y)return!1;let ee=l.callee.object,te=u.callee.object;return d.references.every(e=>e.flag===`read`&&(e.identifier===ee||e.identifier===te))},zt=e=>{let t=e;for(;t;){if(b(t,`Program`))return t;t=t.parent??null}return null},Bt=new WeakMap,Vt=(e,t)=>{t.push(...e.symbols);for(let n of e.children)Vt(n,t)},Ht=e=>{let t=new Map,n=[];Vt(e.rootScope,n);for(let r of n){let n=F(r.bindingIdentifier,e);if(!n)continue;let i=t.get(n.id)??[];i.push(r),t.set(n.id,i)}return t},Ut=(e,t)=>{let n=F(e,t);if(!n)return[];let r=Bt.get(t);return r||(r=Ht(t),Bt.set(t,r)),r.get(n.id)??[]},Wt=e=>{let t=e.expressions??[],n=e.quasis??[];if(t.length!==0||n.length!==1)return null;let r=n[0]?.value;return r?.cooked??r?.raw??null},I=(e,t,n={})=>{let r=S(e,{allowComputedString:!0,stringifyNonStringLiterals:n.stringifyNonStringLiterals});if(r!==null||!b(e,`Property`)&&!b(e,`MethodDefinition`)&&!b(e,`PropertyDefinition`)&&!b(e,`MemberExpression`)||!e.computed)return r;let i=w(b(e,`MemberExpression`)?e.property:e.key);if(!b(i,`Identifier`))return null;let a=F(i,t);if(a?.kind!==`const`||!a.initializer)return null;let o=w(a.initializer);return b(o,`Literal`)?typeof o.value==`string`?o.value:n.allowConstNumericLiteral&&typeof o.value==`number`?String(o.value):null:n.allowConstTemplateLiteral&&b(o,`TemplateLiteral`)?Wt(o):null},Gt=e=>{if(!O(e))return null;if(!b(e.body,`BlockStatement`))return e.body;if(e.body.body.length!==1)return null;let t=e.body.body[0];return b(t,`ReturnStatement`)&&t.argument?t.argument:null},Kt=new Set([`CatchClause`,`ConditionalExpression`,`DoWhileStatement`,`ForInStatement`,`ForOfStatement`,`ForStatement`,`IfStatement`,`LogicalExpression`,`SwitchCase`,`SwitchStatement`,`TryStatement`,`WhileStatement`]),qt=(e,t)=>{let n=e.parent??null;for(;n&&n!==t;){if(Kt.has(n.type))return!1;n=n.parent??null}return n===t},Jt=e=>j(e)??zt(e),Yt=e=>{let t=P(e),n=t.parent;return!!(n&&b(n,`VariableDeclarator`)&&n.init===t&&n.parent&&b(n.parent,`VariableDeclaration`)&&n.parent.kind===`const`)},Xt=e=>{let t=P(e),n=t.parent;return!!(n&&(b(n,`AssignmentExpression`)&&n.left===t||b(n,`UpdateExpression`)&&n.argument===t||b(n,`UnaryExpression`)&&n.operator===`delete`&&n.argument===t))},Zt=e=>{let t=P(e),n=t.parent;return n&&b(n,`MemberExpression`)&&w(n.object)===t?n:null},Qt=(e,t,n,r,i)=>{if(i<=0||!b(e,`ObjectExpression`))return null;for(let a of e.properties.toReversed()){if(!b(a,`Property`))return null;let e=I(a,n);if(e===null)return null;if(e===t)return a.kind===`init`?L(a.value,n,r,i-1):null}return null},$t=(e,t,n,r,i)=>{if(i<=0||!b(e,`ObjectExpression`))return[];let a=[],o=new Set;for(let s of e.properties){if(!b(s,`Property`))continue;let e=I(s,n),c=s.kind===`init`||s.kind===`get`?L(s.value,n,new Set(r),i-1):null;e===t?(a=c?[c]:[],o.clear(),c&&o.add(c)):e===null&&c&&!o.has(c)&&(a.push(c),o.add(c))}return a},en=(e,t,n,r,i)=>{if(i<=0||!b(e,`ClassDeclaration`)&&!b(e,`ClassExpression`))return null;for(let a of e.body.body.toReversed()){if(!b(a,`MethodDefinition`)&&!b(a,`PropertyDefinition`)||!a.static)continue;let e=I(a,n);if(e===null)return null;if(e===t)return b(a,`MethodDefinition`)&&a.kind!==`method`?null:a.value?L(a.value,n,r,i-1):null}return null},tn=(e,t,n,r,i)=>{if(i<=0||!b(e,`ClassDeclaration`)&&!b(e,`ClassExpression`))return[];let a=[],o=new Set;for(let s of e.body.body){if(!b(s,`MethodDefinition`)&&!b(s,`PropertyDefinition`)||!s.static)continue;let e=I(s,n),c=s.value&&(!b(s,`MethodDefinition`)||s.kind===`method`||s.kind===`get`)?L(s.value,n,new Set(r),i-1):null;e===t?(a=c?[c]:[],o.clear(),c&&o.add(c)):e===null&&c&&!o.has(c)&&(a.push(c),o.add(c))}return a},nn=(e,t,n,r,i,a,o,s)=>{let c=Jt(t);if(s<=0||!c||!b(e,`Identifier`))return{exactFunction:null,possibleFunctions:[]};let l=[];for(let r of Ut(e,a))for(let e of r.references){let r=e.identifier;if(r.range[0]>=t.range[0]||Yt(r))continue;let i=Zt(r);if(!i){Jt(r)===c&&l.push({assignedExpression:null,isDefinite:!1,offset:r.range[0]});continue}if(!Xt(i)||Jt(i)!==c)continue;let o=I(i,a),s=P(i).parent,u=s&&b(s,`AssignmentExpression`)&&s.operator===`=`?s.right:null;if(o===null){l.push({assignedExpression:u,isDefinite:!1,offset:i.range[0]});continue}if(o===n){if(!s||!b(s,`AssignmentExpression`)||s.operator!==`=`||!qt(i,c)){l.push({assignedExpression:u,isDefinite:!1,offset:i.range[0]});continue}l.push({assignedExpression:u,isDefinite:!0,offset:s.range[0]})}}l.sort((e,t)=>e.offset-t.offset);let u=r,d=i,f=new Set(i);for(let e of l){let t=e.assignedExpression?L(e.assignedExpression,a,new Set(o),s-1):null;if(e.isDefinite){u=t,d=t?[t]:[],f.clear(),t&&f.add(t);continue}u=null,t&&!f.has(t)&&(d.push(t),f.add(t))}return{exactFunction:u,possibleFunctions:d}},rn=(e,t,n,r)=>{if(r<=0||!b(e,`MemberExpression`))return{exactFunction:null,possibleFunctions:[]};let i=C(e);if(i===null)return{exactFunction:null,possibleFunctions:[]};let a=w(e.object);if(b(a,`ObjectExpression`))return{exactFunction:Qt(a,i,t,n,r),possibleFunctions:$t(a,i,t,n,r)};if(b(a,`ClassExpression`))return{exactFunction:en(a,i,t,n,r),possibleFunctions:tn(a,i,t,n,r)};if(!b(a,`Identifier`))return{exactFunction:null,possibleFunctions:[]};let o=F(a,t);if(!o||n.has(o.id))return{exactFunction:null,possibleFunctions:[]};n.add(o.id);let s=null,c=[];if(o.kind===`const`&&o.initializer){let e=w(o.initializer);s=Qt(e,i,t,n,r),c=$t(e,i,t,n,r)}else o.kind===`class`&&o.initializer&&(s=en(o.initializer,i,t,n,r),c=tn(o.initializer,i,t,n,r));return nn(a,e,i,s,c,t,n,r)},an=(e,t,n,r)=>{if(r<=0)return[];let i=w(e);if(b(i,`CallExpression`)){let e=w(i.callee);return b(e,`MemberExpression`)&&C(e)===`bind`?an(e.object,t,n,r-1):[]}if(b(i,`MemberExpression`)){let e=C(i);return e===`call`||e===`apply`?an(i.object,t,n,r-1):rn(i,t,n,r).possibleFunctions}let a=L(i,t,n,r);return a?[a]:[]},L=(e,t,n,r)=>{let i=w(e);if(O(i))return i;if(r<=0)return null;if(b(i,`CallExpression`)){let e=w(i.callee);if(b(e,`MemberExpression`)&&C(e)===`bind`)return L(e.object,t,n,r-1);if(!i.arguments.every(e=>b(e,`Literal`)))return null;let a=L(e,t,n,r-1);if(!O(a)||a.async||a.generator||!a.params.every(e=>b(e,`Identifier`)))return null;let o=Gt(a),s=o&&w(o);return O(s)?s:null}if(b(i,`MemberExpression`)){let e=C(i);return e===`call`||e===`apply`?L(i.object,t,n,r-1):rn(i,t,n,r).exactFunction}if(!b(i,`Identifier`))return null;let a=F(i,t);return!a||n.has(a.id)?null:(n.add(a.id),a.kind===`function`?!a.references.some(e=>e.flag!==`read`)&&O(a.declarationNode)?a.declarationNode:null:a.kind!==`const`||!a.initializer?null:L(a.initializer,t,n,r-1))},on=(e,t)=>L(e,t,new Set,15),sn=(e,t)=>an(e,t,new Set,15),cn=(e,t)=>{if(!b(e,`CallExpression`)||!b(e.callee,`MemberExpression`)||C(e.callee)!==`join`)return!1;let n=w(e.callee.object);for(let e=0;e<15;e++){if(b(n,`ArrayExpression`))return!0;if(b(n,`Identifier`)){let e=F(n,t);if(!e?.initializer||e.references.some(e=>e.flag!==`read`))return!1;n=w(e.initializer);continue}if(!b(n,`CallExpression`))return!1;let e=w(n.callee);if(b(e,`MemberExpression`)&&[`map`,`filter`,`slice`].includes(C(e)??``)){n=w(e.object);continue}let r=on(e,t);return!!(O(r)&&!r.async&&b(r.returnType,`TSTypeAnnotation`)&&b(r.returnType.typeAnnotation,`TSArrayType`))}return!1},ln=(e,t)=>{if(!b(e,`Program`))return null;let n=new Map,r=new Map,i=null,a=null,o=e=>{for(let t of e.declarations??[])b(t,`VariableDeclarator`)&&(!b(t.id,`Identifier`)||!t.init||n.set(t.id.name,w(t.init)))};for(let t of e.body??[]){if(b(t,`ImportDeclaration`)){if(t.importKind===`type`)continue;for(let e of t.specifiers??[])b(e,`ImportSpecifier`)&&e.importKind===`type`||(b(e,`ImportDefaultSpecifier`)||b(e,`ImportNamespaceSpecifier`)||b(e,`ImportSpecifier`))&&b(e.local,`Identifier`)&&n.set(e.local.name,e.local);continue}if(b(t,`VariableDeclaration`)){o(t);continue}if(b(t,`FunctionDeclaration`)&&t.id){n.set(t.id.name,t);continue}if(b(t,`ExportNamedDeclaration`)){if(t.exportKind===`type`)continue;let e=t.declaration;if(e&&b(e,`VariableDeclaration`)){o(e);for(let t of e.declarations??[])b(t,`VariableDeclarator`)&&b(t.id,`Identifier`)&&r.set(t.id.name,t.id.name)}else e&&b(e,`FunctionDeclaration`)&&e.id&&(n.set(e.id.name,e),r.set(e.id.name,e.id.name));if(t.source)continue;for(let e of t.specifiers??[]){if(!b(e,`ExportSpecifier`)||e.exportKind===`type`)continue;let t=b(e.local,`Identifier`)?e.local.name:null,n=null;b(e.exported,`Identifier`)?n=e.exported.name:b(e.exported,`Literal`)&&typeof e.exported.value==`string`&&(n=e.exported.value),t&&n&&r.set(n,t)}continue}if(!b(t,`ExportDefaultDeclaration`))continue;let e=t.declaration;e&&(b(e,`Identifier`)?a=e.name:((b(e,`FunctionDeclaration`)||b(e,`ClassDeclaration`))&&e.id&&n.set(e.id.name,e),i=w(e)))}if(t===`default`){if(i)return i;if(a){let e=n.get(a);if(e)return e}}let s=r.get(t);return s?n.get(s)??null:null},un=e=>{let t=(e,n)=>{let r=e;r.parent=n,r.range==null&&typeof r.start==`number`&&typeof r.end==`number`&&(r.range=[r.start,r.end]);let i=e;for(let n in i){if(n===`parent`||!Object.hasOwn(i,n))continue;let r=i[n];if(Array.isArray(r))for(let n=0;n<r.length;n+=1){let i=r[n];D(i)&&t(i,e)}else D(r)&&t(r,e)}};t(e,null)},dn={".ts":`ts`,".tsx":`tsx`,".js":`js`,".jsx":`jsx`,".mjs":`js`,".cjs":`js`,".mts":`ts`,".cts":`ts`},fn=e=>dn[n.extname(e).toLowerCase()]??`tsx`;let pn=process.platform!==`win32`&&a();const mn=(e,t)=>({astType:`ts`,lang:fn(e),experimentalRawTransfer:t}),hn=(e,t)=>{if(pn)try{return i(e,t,mn(e,!0))}catch{pn=!1}return i(e,t,mn(e,!1))},gn=({filename:e,sourceText:t,shouldAttachParentReferences:n=!0})=>{try{let r=hn(e,t);if(r.errors.some(e=>e.severity===`Error`))return null;let i=r.program;return n&&un(i),i}catch{return null}},_n=new Map,vn=(e,t)=>{if(_n.delete(e),_n.set(e,t),_n.size>256){let e=_n.keys().next().value;e!==void 0&&_n.delete(e)}},yn=t=>{t.endsWith(`.d.ts`)||t.endsWith(`.d.mts`)||t.endsWith(`.d.cts`)||E(t);let n;try{n=e.statSync(t,{throwIfNoEntry:!1})}catch{return null}if(!n?.isFile()||n.size>2e6)return null;let r=_n.get(t);if(r&&r.mtimeMs===n.mtimeMs&&r.size===n.size)return vn(t,r),r.program;if(t.endsWith(`.d.ts`)||t.endsWith(`.d.mts`)||t.endsWith(`.d.cts`))return vn(t,{mtimeMs:n.mtimeMs,size:n.size,program:null}),null;let i;try{i=e.readFileSync(t,`utf8`)}catch{return vn(t,{mtimeMs:n.mtimeMs,size:n.size,program:null}),null}let a=gn({filename:t,sourceText:i});return vn(t,{mtimeMs:n.mtimeMs,size:n.size,program:a}),a},bn=[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.mts`,`.cts`],xn=[`import`,`default`,`module`,`browser`,`require`],Sn=[`module`,`main`,`browser`],Cn={isDirectory:!0,isFile:!1},wn={isDirectory:!1,isFile:!0},Tn={isDirectory:!1,isFile:!1},En=new Map,Dn=new Map,On=t=>{Se(t);let n=En.get(t);if(n)return n;let r=Tn;try{let n=e.statSync(t,{throwIfNoEntry:!1});n?.isFile()?r=wn:n?.isDirectory()&&(r=Cn)}catch{return En.set(t,Tn),Tn}return En.set(t,r),r},kn=e=>On(e).isFile?e:null,An=e=>On(e).isDirectory?e:null,jn=e=>{let t=n.extname(e);if(!bn.includes(t))return bn.map(t=>`${e}${t}`);let r=e.slice(0,-t.length);return t===`.js`?[e,`${r}.ts`,`${r}.tsx`,`${r}.jsx`]:t===`.jsx`?[e,`${r}.tsx`]:t===`.mjs`?[e,`${r}.mts`]:t===`.cjs`?[e,`${r}.cts`]:[e]},Mn=e=>typeof e==`object`&&!!e,Nn=e=>{if(typeof e==`string`)return e;if(Array.isArray(e)){for(let t of e){let e=Nn(t);if(e)return e}return null}if(!Mn(e))return null;for(let t of xn){let n=Nn(e[t]);if(n)return n}return null},Pn=e=>{let t=e.exports;return t?Nn(t)||(Mn(t)?Nn(t[`.`]):null):null},Fn=t=>{E(t);let n=Dn.get(t);if(n!==void 0)return n;let r;try{r=JSON.parse(e.readFileSync(t,`utf8`))}catch{r=null}return Dn.set(t,r),r},In=e=>Rn(e)||Rn(n.join(e,`index`)),Ln=e=>{let t=An(e);if(!t)return null;let r=Fn(n.join(t,`package.json`));if(!r)return null;let i=Pn(r)??Sn.map(e=>r[e]).find(e=>typeof e==`string`);return i?In(n.resolve(t,i)):null},Rn=e=>{let t=kn(e);if(t)return t;for(let t of jn(e)){let e=kn(t);if(e)return e}return null},zn=e=>Rn(e)||Ln(e)||Rn(n.join(e,`index`)),Bn=(e,t)=>zn(n.resolve(n.dirname(e),t)),Vn=()=>{En.clear(),Dn.clear()},Hn=[`tsconfig.json`,`jsconfig.json`],Un=e=>typeof e==`object`&&!!e,Wn=e=>{let t=``,n=!1,r=!1,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=e[a+1];if(r){o===`
2
- `&&(r=!1,t+=o);continue}if(i){o===`*`&&s===`/`&&(i=!1,a++);continue}if(n){t+=o,o===`\\`?(t+=s??``,a++):o===`"`&&(n=!1);continue}if(o===`"`){n=!0,t+=o;continue}if(o===`/`&&s===`/`){r=!0,a++;continue}if(o===`/`&&s===`*`){i=!0,a++;continue}t+=o}return t.replace(/,(\s*[}\]])/g,`$1`)},Gn=(t,n)=>{E(t),n.push(t);let r;try{r=e.readFileSync(t,`utf8`)}catch{return null}try{let e=JSON.parse(Wn(r));return Un(e)?e:null}catch{return null}},Kn=(e,t)=>{let r=e.endsWith(`.json`)?e:`${e}.json`;return e.startsWith(`./`)||e.startsWith(`../`)?n.resolve(t,r):n.join(t,`node_modules`,r)},qn=e=>{let t=new Map;if(!Un(e))return t;for(let[n,r]of Object.entries(e)){if(!Array.isArray(r))continue;let e=r.filter(e=>typeof e==`string`);e.length>0&&t.set(n,e)}return t},Jn=(e,t,r)=>{let i=Gn(e,r);if(!i)return null;let a=n.dirname(e),o=Un(i.compilerOptions)?i.compilerOptions:{},s=typeof o.baseUrl==`string`?o.baseUrl:null,c=s!==null,l=s===null?a:n.resolve(a,s);if(Un(o.paths))return{baseAbsolutePath:l,hasExplicitBaseUrl:c,paths:qn(o.paths)};if(typeof i.extends==`string`&&t<8){let e=Kn(i.extends,a),n=e?Jn(e,t+1,r):null;if(n)return n}return c?{baseAbsolutePath:l,hasExplicitBaseUrl:c,paths:new Map}:null},Yn=new Map,Xn=new Map,Zn=t=>{E(t);let n;try{n=e.statSync(t,{throwIfNoEntry:!1})}catch{n=void 0}if(n===void 0)return{config:null,probedContentPaths:new Set([t])};let r=Yn.get(t);if(r&&r.mtimeMs===n.mtimeMs){for(let e of r.probedChainPaths)E(e);return{config:r.config,probedContentPaths:new Set(r.probedChainPaths)}}let i=[],a=Jn(t,0,i);return Yn.set(t,{mtimeMs:n.mtimeMs,config:a,probedChainPaths:i}),{config:a,probedContentPaths:new Set(i)}},Qn=(e,t,n)=>{let r=new Set(t.probedContentPaths),i=n;for(let n=e.length-1;n>=0;n--){let a=e[n];i++;for(let e of a.probedContentPaths)r.add(e);Xn.set(a.directory,{config:t.config,directoryCount:i,probedContentPaths:new Set(r)})}},$n=e=>{let t=Xn.get(e);if(t!==void 0){for(let e of t.probedContentPaths)E(e);return t.config}let r=[],i=e;for(let e=0;e<30;e++){let t=Xn.get(i),a=30-e;if(t!==void 0&&t.directoryCount<=a){for(let e of t.probedContentPaths)E(e);return Qn(r,t,t.directoryCount),t.config}let o=new Set;for(let e of Hn){let t=Zn(n.join(i,e));for(let e of t.probedContentPaths)o.add(e);if(t.config)return r.push({directory:i,probedContentPaths:o}),Qn(r,{config:t.config,probedContentPaths:new Set},0),t.config}r.push({directory:i,probedContentPaths:o});let s=n.dirname(i);if(s===i)return Qn(r,{config:null,probedContentPaths:new Set},0),null;i=s}let a=new Set;for(let e of r)for(let t of e.probedContentPaths)a.add(t);return Xn.set(e,{config:null,directoryCount:r.length,probedContentPaths:a}),null},er=(e,t)=>{let n=t.indexOf(`*`);if(n===-1)return e===t?``:null;let r=t.slice(0,n),i=t.slice(n+1);return e.length>=r.length+i.length&&e.startsWith(r)&&e.endsWith(i)?e.slice(r.length,e.length-i.length):null},tr=(e,t)=>{let r=$n(n.dirname(e));if(!r)return null;let i=null,a=``,o=-1;for(let e of r.paths.keys()){let n=er(t,e);if(n===null)continue;let r=e.indexOf(`*`),s=r===-1?e.length:r;s>o&&(i=e,a=n,o=s)}if(i)for(let e of r.paths.get(i)??[]){let t=e.replaceAll(`*`,a),i=zn(n.resolve(r.baseAbsolutePath,t));if(i)return i}return r.hasExplicitBaseUrl?zn(n.resolve(r.baseAbsolutePath,t)):null},nr=()=>{Yn.clear(),Xn.clear()},rr=(e,t)=>n.isAbsolute(t)?null:t.startsWith(`.`)?Bn(e,t):tr(e,t),ir=new Map,ar=()=>{ir.clear()},or=(e,t,n)=>{if(n.size>=4||n.has(e))return null;n.add(e);let r=yn(e);if(!r)return null;let i=ln(r,t);if(i)return{filePath:e,exportedNode:i,programNode:r};let a=new Map;for(let i of kt(r,t)){let t=rr(e,i.source);if(!t)continue;let r=or(t,i.importedName,new Set(n));r&&a.set(r.exportedNode,r)}return a.size===1?a.values().next().value??null:null},sr=(e,t,n)=>cr(e,t,n)?.functionNode??null,cr=(e,t,n)=>{let r=R(e,t,n);return!r||!O(r.exportedNode)?null:{filePath:r.filePath,functionNode:r.exportedNode,programNode:r.programNode}},R=(e,t,n)=>{if(!Ce()){let r=rr(e,t);return r?or(r,n,new Set):null}let r=`${e}\0${t}\0${n}`,i=ir.get(r);if(i!==void 0){for(let e of i.trace.contentPaths)E(e);for(let e of i.trace.existencePaths)Se(e);return i.result}let a=we(()=>{let r=rr(e,t);return r?or(r,n,new Set):null});return ir.set(r,{result:a.value,trace:a.trace}),a.value},lr=(e,t)=>{let n=e,r=Ge[e.type];if(r!==void 0){for(let e=r.length-1;e>=0;--e){let i=n[r[e]];if(Array.isArray(i))for(let e=i.length-1;e>=0;--e){let n=i[e];D(n)&&t.push(n)}else D(i)&&t.push(i)}return}let i=Object.keys(n);for(let e=i.length-1;e>=0;--e){let r=i[e];if(r===`parent`)continue;let a=n[r];if(Array.isArray(a))for(let e=a.length-1;e>=0;--e){let n=a[e];D(n)&&t.push(n)}else D(a)&&t.push(a)}},ur=(e,t)=>{let n=e,r=Ge[e.type];if(r!==void 0){for(let e=0;e<r.length;e+=1){let i=n[r[e]];if(Array.isArray(i))for(let e=0;e<i.length;e+=1){let n=i[e];D(n)&&t(n)}else D(i)&&t(i)}return}for(let e in n){if(e===`parent`||!Object.hasOwn(n,e))continue;let r=n[e];if(Array.isArray(r))for(let e=0;e<r.length;e+=1){let n=r[e];D(n)&&t(n)}else D(r)&&t(r)}},z=(e,t)=>{if(!e||typeof e!=`object`)return;let n=[e];for(;n.length>0;){let e=n.pop();e===void 0||t(e)===!1||lr(e,n)}},dr=new WeakMap,fr=new Set([`TSStringKeyword`,`TSNumberKeyword`,`TSBooleanKeyword`]),pr=new Set([`String`,`Number`,`Boolean`]),mr=(e,t,n)=>{let r=[],i=15,a=(e,t,n,o,s,c)=>{let l=e=>{let r=F(w(e),o);return!r||r.references.some(e=>e.flag!==`read`)?null:t.has(r.bindingIdentifier)?t.get(r.bindingIdentifier)??null:n&&j(r.bindingIdentifier)===n?null:r.bindingIdentifier};z(e,e=>{if(O(e)||b(e,`ClassDeclaration`)||b(e,`ClassExpression`))return!1;if(c&&b(e,`AwaitExpression`)&&!b(w(e.argument),`CallExpression`)&&r.push({binding:e,member:null,inputs:[],crossFile:!0}),!b(e,`CallExpression`))return;let n=w(e.callee);if(e.optional||b(n,`MemberExpression`)&&n.optional)return c&&r.push({binding:e,member:null,inputs:[],crossFile:!0}),!1;let u=e.arguments.map(l),d=b(n,`MemberExpression`)?w(n.object):n,f=F(d,o),p=b(n,`Identifier`)&&(f?.kind===`function`||O(f?.initializer))?on(n,o):null,m=o,h=s,g=c;if(f?.kind===`import`){let e=b(n,`MemberExpression`)?C(n):null,t=f.declarationNode,a=_e(f),o=null;if(b(t,`ImportNamespaceSpecifier`)?o=e:b(n,`Identifier`)&&(o=Tt(t)),s&&i>0&&o&&a&&a.importKind!==`type`&&(!b(t,`ImportSpecifier`)||t.importKind!==`type`)){i--;let e=cr(s,a.source.value,o);e&&(p=e.functionNode,m=dr.get(e.programNode)??A(e.programNode),dr.set(e.programNode,m),h=e.filePath,g=!0)}!p&&!c&&(b(n,`Identifier`)||e!==null)&&r.push({binding:f.bindingIdentifier,member:e,inputs:u})}else if(!c&&b(n,`MemberExpression`)&&C(n)===`get`&&f?.kind===`const`&&f.initializer){let e=w(f.initializer);if(b(e,`NewExpression`)&&b(e.callee,`Identifier`)&&(e.callee.name===`Map`||e.callee.name===`WeakMap`)&&o.isGlobalReference(e.callee)){let e=l(d);e&&r.push({binding:e,member:`get`,inputs:[u[0]??null]})}}if(g&&p){let t=It(p),n=t?m.symbolFor(t):null;if(n&&(n.kind!==`const`&&n.kind!==`function`||n.references.some(e=>e.flag!==`read`)))return r.push({binding:e,member:null,inputs:[],crossFile:!0}),!1}if(g&&p&&Rt(p,m))return r.push({binding:p,member:null,inputs:u,crossFile:!0}),!1;if(!O(p)||i<=0){c&&(i<=0||f?.kind===`import`||Lt(e)||b(e.parent,`ReturnStatement`)&&!cn(e,o)&&!(b(n,`Identifier`)&&pr.has(n.name)&&o.isGlobalReference(n))||b(n,`Identifier`)&&n.name===`fetch`&&o.isGlobalReference(n))&&r.push({binding:e,member:null,inputs:[],crossFile:!0});return}if(c&&!p.async&&!Lt(e)&&(!b(e.parent,`ReturnStatement`)||b(p.returnType,`TSTypeAnnotation`)&&fr.has(p.returnType.typeAnnotation.type)))return;i--;let _=new Map(t);for(let[e,t]of p.params.entries()){let n=m.symbolFor(t);n&&_.set(n.bindingIdentifier,u[e]??null)}a(p.body,_,p,m,h,g)})};for(let r of Nt(e)?.awaitedExpressions??[])a(r,new Map,null,t,n,!1);return r},hr=(e,t,n,r)=>{let i=mr(e,n,r);if(i.length===0)return!1;let a=mr(t,n,r),o=e=>i.some(t=>t.binding===e.binding&&t.member===e.member&&t.inputs.length>0&&t.inputs.length===e.inputs.length&&t.inputs.every((t,n)=>t!==null&&t===e.inputs[n]));return a.some(o)&&(!a.some(e=>e.crossFile)||a.every(o))},gr=`(?:tsx?|jsx?|mts|mjs)`,_r=RegExp(`/page\\.${gr}$`),vr=RegExp(`/(page|layout)\\.${gr}$`),yr=[`layout.tsx`,`layout.jsx`,`layout.ts`,`layout.js`,`layout.mts`,`layout.mjs`],br=[`metadata`,`generateMetadata`],xr=/\/(?:(?:\((?:dashboard|admin|settings|account|internal|manage|console|portal|auth|onboarding|app|ee|protected)\))|(?:dashboard|admin|settings|account|internal|manage|console|portal))\//i,Sr=new Set([`redirect`,`permanentRedirect`,`notFound`,`forbidden`,`unauthorized`]),Cr=new Set([`revalidateTag`,`revalidatePath`,`expireTag`,`expirePath`,`unstable_expireTag`,`unstable_expirePath`]),wr=/fonts\.googleapis\.com/,Tr=/polyfill\.io|polyfill\.min\.js|cdn\.polyfill/,Er=RegExp(`/route\\.${gr}$`),Dr=/\/(?:cron|jobs\/cron)(?:\/|$)/i,Or=new Set([`logout`,`log-out`,`signout`,`sign-out`,`unsubscribe`,`delete`,`remove`,`revoke`,`cancel`,`deactivate`]),kr=RegExp(`/(error|global-error)\\.${gr}$`),Ar=RegExp(`/global-error\\.${gr}$`),jr=new Set([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`OPTIONS`,`HEAD`]),Mr=/google-analytics\.com|googletagmanager\.com\/gtag/,Nr=RegExp(`/(opengraph-image|twitter-image)\\d*\\.${gr}$`),Pr=new Set([`expo`,`expo-router`,`@expo/cli`,`@expo/metro-config`,`@expo/metro-runtime`]),Fr=new Set([`react-native`,`react-native-tvos`,...Pr,`react-native-windows`,`react-native-macos`]),Ir=[`@react-native/`,`@react-native-`],Lr=e=>Pr.has(e),Rr=e=>{if(Fr.has(e))return!0;for(let t of Ir)if(e.startsWith(t))return!0;return!1},zr=new Set([`next`,`vite`,`react-scripts`,`gatsby`,`@remix-run/react`,`@remix-run/node`,`@docusaurus/core`,`@docusaurus/preset-classic`,`@storybook/react`,`@storybook/react-vite`,`@storybook/react-webpack5`,`@storybook/nextjs`,`@storybook/web-components`,`storybook`,`react-dom`,`@vitejs/plugin-react`,`@vitejs/plugin-react-swc`]),Br=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`],Vr=function*(e){for(let t of Br){let n=e[t];if(n)for(let e of Object.keys(n))yield e}},Hr=e=>{if(typeof e[`react-native`]==`string`)return!0;for(let t of Vr(e))if(Rr(t))return!0;return!1},Ur=e=>{for(let t of Vr(e))if(Lr(t))return!0;return!1},Wr=e=>{for(let t of Vr(e))if(zr.has(t))return!0;return!1},Gr=e=>Br.some(t=>{let n=e[t];return typeof n==`object`&&!!n&&Object.keys(n).length>0}),Kr=(e,t)=>Br.some(n=>{let r=e[n];return typeof r==`object`&&!!r&&Object.prototype.propertyIsEnumerable.call(r,t)}),qr=new WeakMap,Jr=e=>{let t=Ne(e);if(!t)return`unknown`;let n=qr.get(t);if(n!==void 0)return n;let r;return r=Ur(t)?`expo`:Hr(t)?`react-native`:Wr(t)?`web`:Gr(t)?`neutral`:`unknown`,qr.set(t,r),r},Yr=({absoluteFilePath:e,staticImports:t,program:n})=>{let r=new Set;if(z(n,e=>{if(e.type!==`JSXOpeningElement`)return;let t=e.name;if(t){if(t.type===`JSXIdentifier`){let e=t.name;typeof e==`string`&&r.add(e)}else if(t.type===`JSXMemberExpression`){let e=t.property;e?.type===`JSXIdentifier`&&typeof e.name==`string`&&r.add(e.name)}else if(t.type===`JSXNamespacedName`){let e=t.namespace;typeof e?.name==`string`&&r.add(e.name)}}}),r.size!==0)for(let n of t)for(let t of n.entries){let{importName:i}=t;if(i.kind===`NamespaceObject`||!r.has(t.localName.value))continue;let a=i.kind===`Default`?`default`:i.name;a&&sr(e,n.moduleRequest.value,a)}},Xr=e=>e.replace(/^type\s+/,``).trim(),Zr=(e,t)=>e.split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>{let n=t||e.startsWith(`type `),[r,i]=e.split(/\s+as\s+/),a=Xr(r??``);return{localName:a,exportedName:Xr(i??a),isTypeOnly:n}}),Qr=/\/\*[\s\S]*?\*\//g,$r=/^\s*\/\/.*$/gm,ei=e=>e.replace(Qr,``).replace($r,``),ti=/^\s*export\s+default\b/m,ni=/^\s*export\s+(?:declare\s+)?(?:(?:async\s+)?function|(?:abstract\s+)?class|const|let|var|enum|interface|type)\s+([\w$]+)/gm,ri=/^\s*export\s+(?:type\s+)?\{([\s\S]*?)\}(?:\s+from\s+["'][^"']+["'])?\s*;?\s*(?:(?:\/\/[^\n]*)?\s*)/gm,ii=e=>{let t=ei(e),n=new Set;ti.test(t)&&n.add(`default`);for(let e of t.matchAll(ni))e[1]&&n.add(e[1]);for(let e of t.matchAll(ri)){let t=e[1]??``;for(let e of Zr(t,!1))n.add(e.exportedName)}return n},ai=new Map,oi=(t,n)=>{E(t);try{let r=e.statSync(t,{throwIfNoEntry:!1});if(r===void 0)return!1;let i=ai.get(t);if(i&&i.mtimeMs===r.mtimeMs&&i.size===r.size)return i.exportedNames.has(n);let a=ii(e.readFileSync(t,`utf8`));return ai.set(t,{mtimeMs:r.mtimeMs,size:r.size,exportedNames:a}),a.has(n)}catch{return!1}},si=(e,t)=>{let r=e.replaceAll(`\\`,`/`),i=n.dirname(r);for(let e=0;e<30;e++){for(let e of yr){let a=n.join(i,e);if(a.replaceAll(`\\`,`/`)!==r&&t(a))return!0}let e=n.dirname(i);if(n.basename(i)===`app`&&n.basename(e)!==`app`||e===i)break;i=e}return!1},ci=e=>si(e,e=>br.some(t=>oi(e,t))),li=e=>b(e,`JSXIdentifier`)?e.name===`Suspense`:b(e,`JSXMemberExpression`)&&b(e.property,`JSXIdentifier`)&&e.property.name===`Suspense`,ui=e=>{let t=!1;return z(e,e=>{if(t)return!1;if(b(e,`JSXOpeningElement`)&&li(e.name)||b(e,`ImportDeclaration`)&&e.source?.value===`react`&&(e.specifiers??[]).some(e=>b(e,`ImportSpecifier`)&&x(e)===`Suspense`))return t=!0,!1}),t},di=e=>si(e,e=>{let t=yn(e);return!!(t&&ui(t))}),fi=e=>{if(b(e,`ImportDeclaration`)){if(e.importKind===`type`||e.specifiers.length>0&&e.specifiers.every(e=>b(e,`ImportSpecifier`)&&e.importKind===`type`))return null}else if(b(e,`ExportNamedDeclaration`)){if(e.exportKind===`type`||!e.source||e.specifiers.length>0&&e.specifiers.every(e=>b(e,`ExportSpecifier`)&&e.exportKind===`type`))return null}else if(b(e,`ExportAllDeclaration`)){if(e.exportKind===`type`)return null}else return null;return e.source&&typeof e.source.value==`string`?e.source.value:null},pi=/^index\.(?:[cm]?[jt]sx?|mjs)$/,mi=/^\s*import\s+(type\s+)?(?!["'])([^;]*?)\s+from\s+["']([^"']+)["']\s*;?\s*(?:(?:\/\/[^\n]*)?\s*)/gm,hi=/^\s*export\s+(type\s+)?(?:\*(?:\s+as\s+([\w$]+))?|\{([\s\S]*?)\})\s+from\s+["']([^"']+)["']\s*;?\s*(?:(?:\/\/[^\n]*)?\s*)/gm,gi=/^\s*export\s+(type\s+)?\{([\s\S]*?)\}\s*;?\s*(?:(?:\/\/[^\n]*)?\s*)/gm,_i=new Map,vi=e=>pi.test(n.basename(e)),yi=()=>({isBarrel:!1,exportsByName:new Map,starExportSources:[]}),bi=(e,t)=>{e.set(t.localName,{...t,didExport:!1})},xi=(e,t,n,r)=>{for(let i of Zr(e,n))bi(r,{localName:i.exportedName,importedName:i.localName,source:t,isTypeOnly:i.isTypeOnly})},Si=(e,t,n,r)=>{let i=e.trim(),a=i.match(/(?:^|,\s*)\*\s+as\s+([\w$]+)/);a?.[1]&&bi(r,{localName:a[1],importedName:`*`,source:t,isTypeOnly:n});let o=i.match(/\{([\s\S]*?)\}/);o?.[1]&&xi(o[1],t,n,r);let s=i.split(`,`)[0]?.trim();s&&!s.startsWith(`{`)&&!s.startsWith(`*`)&&bi(r,{localName:s,importedName:`default`,source:t,isTypeOnly:n})},Ci=(e,t,n,r)=>{let i=e.replace(mi,(e,n,r,i)=>(Si(r,i,!!n,t),``));return i=i.replace(hi,(e,t,i,a,o)=>{let s=!!t;if(i)return n.set(i,{exportedName:i,importedName:`*`,source:o,isTypeOnly:s}),``;if(a){for(let e of Zr(a,s))n.set(e.exportedName,{exportedName:e.exportedName,importedName:e.localName,source:o,isTypeOnly:e.isTypeOnly});return``}return r.push(o),``}),i=i.replace(gi,(e,r,i)=>{for(let a of Zr(i,!!r)){let r=t.get(a.localName);if(!r)return e;r.didExport=!0,n.set(a.exportedName,{exportedName:a.exportedName,importedName:r.importedName,source:r.source,isTypeOnly:a.isTypeOnly||r.isTypeOnly})}return``}),i},wi=e=>{for(let t of e.values())if(!t.isTypeOnly&&!t.didExport)return!0;return!1},Ti=e=>{let t=ei(e).trim();if(!t)return yi();let n=new Map,r=new Map,i=[];return Ci(t,n,r,i).trim()||wi(n)?yi():{isBarrel:r.size>0||i.length>0,exportsByName:r,starExportSources:i}},Ei=t=>{if(!vi(t))return yi();E(t);let n;try{n=e.statSync(t,{throwIfNoEntry:!1})??null}catch{n=null}let r=_i.get(t);if(r!==void 0&&n!==null&&r.mtimeMs===n.mtimeMs&&r.size===n.size)return r.moduleInfo;if(n===null)return yi();let i=yi();try{i=Ti(e.readFileSync(t,`utf8`))}catch{i=yi()}return _i.set(t,{mtimeMs:n.mtimeMs,size:n.size,moduleInfo:i}),i},Di=e=>Ei(e).isBarrel,Oi=n.join(`android`,`gradle.properties`),ki=/^\s*newArchEnabled\s*=\s*false\s*$/m,Ai=[`app.config.ts`,`app.config.js`,`app.config.cjs`,`app.config.mjs`],ji=[`app.config.json`,`app.json`],Mi=new WeakMap,Ni=e=>{E(n.join(e,Oi));for(let t of Ai)Se(n.join(e,t));for(let t of ji)E(n.join(e,t))},Pi=t=>{try{return e.readFileSync(t,`utf-8`)}catch{return null}},Fi=e=>{let t=e.dependencies?.[`react-native`]??e.devDependencies?.[`react-native`];return typeof t==`string`?t:null},Ii=e=>{let t=e.match(/(?:^|[^\d.])0\.(\d+)/);return t?Number.parseInt(t[1],10):null},Li=e=>{let t=Pi(n.join(e,Oi));return t!==null&&ki.test(t)},Ri=t=>{for(let r of Ai)if(e.existsSync(n.join(t,r)))return!1;for(let e of ji){let r=Pi(n.join(t,e));if(r===null)continue;let i;try{i=JSON.parse(r)}catch{continue}if(typeof i!=`object`||!i)continue;let a=Object.getOwnPropertyDescriptor(i,`expo`)?.value;if(!(typeof a!=`object`||!a)&&Object.getOwnPropertyDescriptor(a,`newArchEnabled`)?.value===!1)return!0}return!1},zi=(e,t)=>{let n=Fi(t);if(n!==null){let e=Ii(n);if(e!==null&&e<76)return!0}return Li(e)||Ri(e)},Bi=e=>{let t=Me(e);if(!t)return!1;let n=Ne(e);if(!n)return!1;Ni(t);let r=Mi.get(n);if(r!==void 0)return r;let i=zi(t,n);return Mi.set(n,i),i},Vi=e=>Ue(e,`ink`)?.version??null,Hi=(e,t)=>{let n=Vi(e),r=Fe(t);return!!(n&&r&&Ie(n,r)>=0)},Ui=new Set([`@monaco-editor/react`,`monaco-editor`,`recharts`,`@react-pdf/renderer`,`react-quill`,`@codemirror/view`,`@codemirror/state`,`chart.js`,`react-chartjs-2`,`@toast-ui/editor`,`draft-js`,`mermaid`]),Wi=new Set([`fetch`,`ky`,`got`,`wretch`,`ofetch`]),Gi=new Set([`axios`,`ky`,`got`,`ofetch`,`wretch`,`request`]),Ki=new Set([`create`,`insert`,`insertInto`,`update`,`upsert`,`delete`,`remove`,`destroy`,`set`,`append`]),qi=new Set([`POST`,`PUT`,`DELETE`,`PATCH`]),Ji=new Set([`Map`,`Set`,`WeakMap`,`WeakSet`,`Headers`,`URLSearchParams`,`FormData`,`Response`,`NextResponse`]),Yi=new Set([`Response`,`NextResponse`]),Xi=new Set([`json`,`redirect`,`next`,`rewrite`,`error`]),Zi=new Set([`wheel`,`mousewheel`,`touchstart`,`touchmove`]),Qi=new Set([`defer`,`async`]),$i=new Set([`text/javascript`,`application/javascript`,`module`]),ea=new Set([`setTimeout`,`setInterval`,`requestAnimationFrame`,`requestIdleCallback`,`queueMicrotask`]),ta=new Set([`setInterval`,`setTimeout`]),na=new Set([`clearInterval`,`clearTimeout`]),ra=new Set([`WebSocket`,`EventSource`,`BroadcastChannel`,`RTCPeerConnection`]),ia=new Set([`location`,`window`,`document`,`navigator`,`history`,`screen`,`performance`]),aa=new Set([`IntersectionObserver`,`MutationObserver`,`ResizeObserver`,`PerformanceObserver`]),oa=new Set([`blur`,`canPlayType`,`focus`,`getBoundingClientRect`,`getClientRects`,`measure`,`measureInWindow`,`measureLayout`,`scroll`,`scrollBy`,`scrollIntoView`,`scrollTo`,`select`,`setRangeText`,`setSelectionRange`]),sa=new Set([`localStorage`,`sessionStorage`]),ca=new Set([`index`,`idx`,`i`]),la=new Set([`react`,`react-dom`,`preact/compat`,`preact/hooks`,`@wordpress/element`]),ua=new Set([`next`,`next-themes`,`@remix-run/react`,`swr`,`zustand`,`jotai`,`recoil`,`wouter`,`framer-motion`,`@apollo/client`,`urql`,`usehooks-ts`]),da=new Set([`useState`,`useMemo`,`useRef`]),fa=new Set([`Click`,`Change`,`Input`,`Blur`,`Focus`]),pa=new Set([`Boolean`,`String`,`Number`,`Array`,`Object`,`parseInt`,`parseFloat`]),ma=/^set[A-Z]/,ha=/^render[A-Z]/,ga=/^[A-Z]/,_a=/^on[A-Z]/,va=/^use[A-Z]/,ya=/^(?:on|handle)[A-Z]/,ba=new Set([`useEffect`,`useLayoutEffect`]),xa=new Set([`useEffect`,`useLayoutEffect`,`useMemo`,`useCallback`]),Sa=new Set([`use`,`useState`,`useRef`,`useMemo`,`useCallback`,`useReducer`,`useContext`,`useEffect`,`useLayoutEffect`,`useInsertionEffect`,`useImperativeHandle`,`useSyncExternalStore`,`useDeferredValue`,`useTransition`,`useId`,`useDebugValue`]),Ca=new Set([`memo`,`forwardRef`,`React.memo`,`React.forwardRef`]),wa=new Set([`useMemo`,`useCallback`]),Ta=new Set([`memo`,`forwardRef`,`observer`,`lazy`]),Ea=new Set([`subscribe`,`addEventListener`,`addListener`,`on`,`watch`,`listen`,`sub`]),Da=new Set([`subscribe`,`sub`,`listen`]),Oa=new Set([`unsubscribe`,`removeEventListener`,`removeListener`,`off`,`unwatch`,`unlisten`,`unsub`,`abort`,`disconnect`,`unobserve`,`close`]),ka=new Set([`remove`,`cleanup`,`dispose`,`destroy`,`stop`,`teardown`]),Aa=new Set([...Oa,`cleanup`,`dispose`,`destroy`,`teardown`]),ja=new Set([...Ea,`connect`,`disconnect`,`open`,`close`,`fetch`,`post`,`put`,`patch`]),Ma=new Set([`get`,`head`,`options`,`delete`]),Na=new Set([...Wi,...ea]),Pa=new Set([...Wi,`post`,`put`,`patch`,`navigate`,`navigateTo`,`showNotification`,`toast`,`alert`,`confirm`,`logVisit`,`captureEvent`]),Fa=new Set([`post`,`put`,`patch`,`delete`,`navigate`,`capture`,`track`,`logEvent`]),Ia=new Set([`push`,`replace`]),La=new Set([`router`,`navigation`,`navigator`,`history`,`location`]),Ra=new Map([[`react_ujs`,new Set([`useContext`,`useContexts`])]]),za={},Ba=new WeakMap,Va=(e,t)=>typeof e==`string`?e===t:e.has(t),Ha=e=>{let t=Ba.get(e);if(t)return t;let n=e.declarationNode.parent,r=!!(e.kind===`import`&&n&&n.type===`ImportDeclaration`&&typeof n.source.value==`string`&&la.has(n.source.value)),i={importedName:r?x(e.declarationNode):void 0,isReactImport:r};return Ba.set(e,i),i},Ua=e=>Ha(e).isReactImport,Wa=(e,t,n,r)=>{if(e.type!==`Identifier`)return!1;let i=r?F(e,n):n.symbolFor(e);if(!i)return!1;let a=Ha(i);return!!(a.isReactImport&&a.importedName&&Va(t,a.importedName))},Ga=(e,t)=>{let n=F(e,t);if(!n)return!1;let r=Ha(n);return r.isReactImport?n.declarationNode.type===`ImportDefaultSpecifier`||n.declarationNode.type===`ImportNamespaceSpecifier`||r.importedName===`default`:!1},Ka=(e,t,n)=>e.type===`Identifier`?Ga(e,t)?!0:!!(n.allowGlobalReactNamespace&&e.name===`React`&&t.isGlobalReference(e)):!1,qa=(e,t,n,r)=>{let i=n.symbolFor(e);if(!i||i.kind!==`const`||!i.initializer||i.declarationNode.type!==`VariableDeclarator`)return!1;let a=i.declarationNode.id;if(a.type!==`ObjectPattern`)return!1;for(let e of a.properties){if(e.type!==`Property`||e.value!==i.bindingIdentifier)continue;let a=S(e);return!!(a&&Va(t,a)&&Ka(w(i.initializer),n,r))}return!1},Ja=(e,t,n,r=za)=>e.type===`CallExpression`?Ya(e.callee,t,n,r):!1,Ya=(e,t,n,r,i)=>{let a=w(e);if(r.resolveConditionalAliases&&a.type===`ConditionalExpression`)return Ya(a.consequent,t,n,r,new Set(i))&&Ya(a.alternate,t,n,r,new Set(i));if(a.type===`Identifier`){if(Wa(a,t,n,!!r.resolveNamedAliases)||r.resolveNamedAliases&&qa(a,t,n,r))return!0;if(r.resolveConditionalAliases){let e=n.symbolFor(a);if(e?.kind===`const`&&e.initializer&&!i?.has(e.id)){let a=i??new Set;return a.add(e.id),Ya(e.initializer,t,n,r,a)}}return!!(r.allowUnboundBareCalls&&Va(t,a.name)&&n.isGlobalReference(a))}return a.type!==`MemberExpression`||!Va(t,C(a)??``)?!1:Ka(w(a.object),n,r)},Xa=e=>e.includes(`\\`)?e.replaceAll(`\\`,`/`):e,Za=e=>{let t=new Set(e);if(t.size!==1)return null;let[n]=t;return n??null},Qa=(e,t,n,r)=>{let i=Bn(e,n);return i?$a(i,t,new Set(r))||(oi(i,t)?i:null):null},$a=(e,t,n=new Set)=>{if(n.has(e))return null;n.add(e);let r=Ei(e);if(!r.isBarrel)return null;let i=r.exportsByName.get(t);if(i){let t=Bn(e,i.source);return t?$a(t,i.importedName,n)??t:null}return t===`default`?null:Za(r.starExportSources.map(r=>Qa(e,t,r,n)).filter(e=>!!e))},eo=(e,t,n)=>{let r=R(e,t,n);return r?{filePath:r.filePath,node:r.exportedNode,programNode:r.programNode,kind:O(r.exportedNode)?`function`:`initializer`}:null},to=(e,t)=>{if(!b(e,`ArrowFunctionExpression`)&&!b(e,`FunctionExpression`)&&!b(e,`FunctionDeclaration`))return null;let n=e.params[0],r=b(n,`AssignmentPattern`)?n.left:n;if(b(r,`ObjectPattern`)){let e=r.properties.find(e=>b(e,`Property`)&&S(e,{allowComputedString:!0})===`children`);if(!e||!b(e,`Property`))return null;let n=b(e.value,`AssignmentPattern`)?e.value.left:e.value;if(!b(n,`Identifier`))return null;let i=t.symbolFor(n);return!i||i.references.length===0||i.references.some(e=>e.flag!==`read`)?null:i.references.map(e=>e.identifier)}if(!b(r,`Identifier`))return null;let i=t.symbolFor(r);if(!i||i.references.length===0)return null;let a=[];for(let e of i.references){if(e.flag!==`read`)return null;let t=[],n=P(e.identifier);for(;n.parent&&b(n.parent,`MemberExpression`)&&n.parent.object===n;){let e=C(n.parent);if(!e)return null;t.push(e),n=P(n.parent)}if(t[0]!==`children`){if(t.length===0)return null;continue}if(t.length!==1)return null;a.push(n)}return a.length>0?a:null},no=e=>{let t=new Map,n=e.body??[];for(let e of n){if(e.type!==`ImportDeclaration`||!(`source`in e)||!e.source)continue;let n=e.source.value;if(typeof n==`string`&&!(!(`specifiers`in e)||!Array.isArray(e.specifiers)))for(let r of e.specifiers){if(!(`local`in r)||!r.local)continue;let e=r.local;if(typeof e.name==`string`){if(r.type===`ImportDefaultSpecifier`)t.set(e.name,{source:n,imported:null,isDefault:!0,isNamespace:!1});else if(r.type===`ImportNamespaceSpecifier`)t.set(e.name,{source:n,imported:null,isDefault:!1,isNamespace:!0});else if(r.type===`ImportSpecifier`){let i=r.imported,a=i?.name??(typeof i?.value==`string`?i.value:null);t.set(e.name,{source:n,imported:a,isDefault:!1,isNamespace:!1})}}}}return t},ro=new WeakMap,io=e=>{let t=zt(e);if(!t)return null;let n=ro.get(t);return n||(n=no(t),ro.set(t,n)),n},ao=(e,t)=>{let n=io(e);if(!n)return!1;for(let e of n.values())if(t.includes(e.source))return!0;return!1},oo=(e,t,n)=>{let r=io(e);if(!r)return!1;let i=r.get(t);return i?i.source===n:!1},so=(e,t,n)=>{let r=io(e);if(!r)return!1;let i=r.get(t);return i?i.isNamespace&&i.source===n:!1},co=(e,t,n)=>{let r=io(e);if(!r)return!1;let i=r.get(t);return i?i.isDefault&&i.source===n:!1},lo=(e,t,n)=>{let r=io(e);if(!r)return null;let i=r.get(t);return!i||i.source!==n?null:i.imported},uo=(e,t)=>{let n=io(e);return n?n.get(t)?.source??null:null},fo=(e,t)=>{let n=io(e)?.get(t);return n?n.isNamespace?{source:n.source,exportedName:null,isNamespace:!0}:{source:n.source,exportedName:n.isDefault?`default`:n.imported,isNamespace:!1}:null},po=(e,t)=>{let n=e.parent;for(;n;){if(`typeParameters`in n){let e=n.typeParameters;if(e&&b(e,`TSTypeParameterDeclaration`)&&e.params.some(e=>b(e,`TSTypeParameter`)&&b(e.name,`Identifier`)&&e.name.name===t))return!0}n=n.parent}return!1},mo=e=>{if(!b(e,`Identifier`)||po(e,e.name))return!1;let t=fo(e,e.name);return!!(t&&t.source===`react`&&(t.isNamespace||t.exportedName===`default`))},ho=e=>{let t=zt(e);return!t||!b(t,`Program`)?!1:t.body.some(e=>b(e,`TSModuleDeclaration`)&&b(e.id,`Identifier`)&&e.id.name===`JSX`)},go=(e,t)=>{if(!b(e,`TSTypeReference`))return!1;let n=e.typeName;if(b(n,`Identifier`)){if(po(n,n.name))return!1;let e=lo(n,n.name,`react`);return e===`ReactElement`||t&&e===`ReactNode`}if(!b(n,`TSQualifiedName`)||!b(n.right,`Identifier`))return!1;if((n.right.name===`ReactElement`||t&&n.right.name===`ReactNode`)&&mo(n.left))return!0;if(n.right.name!==`Element`)return!1;if(b(n.left,`Identifier`)){if(n.left.name!==`JSX`)return!1;let e=fo(n.left,n.left.name);return e?e.source===`react`&&e.exportedName===`JSX`:!ho(n.left)}return b(n.left,`TSQualifiedName`)&&b(n.left.right,`Identifier`)&&n.left.right.name===`JSX`&&mo(n.left.left)},_o=(e,t)=>b(e,`TSUnionType`)?t?e.types.every(e=>b(e,`TSNullKeyword`)||b(e,`TSUndefinedKeyword`)||_o(e,t)):e.types.some(e=>_o(e,t)):go(e,t),vo=(e,t=!1)=>{let n=Reflect.get(e,`returnType`);return b(n,`TSTypeAnnotation`)?_o(n.typeAnnotation,t):!1},yo=e=>{let t=e,n=t.parent;for(;n&&w(n)===e;)t=n,n=t.parent;return n&&b(n,`AssignmentExpression`)&&n.operator===`=`&&n.left===t?n.right:null},bo=e=>{let t=e.range?.[0];return typeof t==`number`?t:null},xo=new Set([`let`,`var`]),So=new Set([`ConditionalExpression`,`LogicalExpression`]),Co=new WeakMap,wo=(e,t,n)=>{let r=e.parent??null;for(;r&&n.blockOf(r)===t;){if(So.has(r.type))return!0;r=r.parent??null}return!1},To=(e,t)=>e.size===t.size&&[...e].every(e=>t.has(e)),Eo=(e,t)=>{let n=new Set(e);for(let e of t)e.isConditionalWithinBlock||(n=new Set),n.add(e);return n},Do=(e,t,n)=>{let r=j(t);if(j(e.bindingIdentifier)!==r||!r)return[];let i=n.cfgFor(r);if(!i)return[];let a=i.blockOf(t);if(!a)return[];let o=bo(t),s=bo(e.bindingIdentifier);if(o===null||s===null)return[];let c=new Map,l=(e,t,n)=>{let r=i.blockOf(t);if(!r)return;let a=c.get(r)??[];a.push({expression:e,position:n,isConditionalWithinBlock:wo(t,r,i)}),c.set(r,a)};e.initializer&&l(e.initializer,e.bindingIdentifier,s);for(let t of e.references){let e=bo(t.identifier);if(t.flag===`read`||j(t.identifier)!==r||e===null||e>=o)continue;let n=yo(t.identifier);n&&l(n,t.identifier,e)}for(let e of c.values())e.sort((e,t)=>e.position-t.position);let u=new Map,d=new Map,f=new Set([i.entry]),p=[i.entry];for(;p.length>0;){let e=p.pop();if(!e)break;for(let t of e.successors)f.has(t.to)||(f.add(t.to),p.push(t.to))}if(!f.has(a))return[];let m=!0;for(;m;){m=!1;for(let e of i.blocks){if(!f.has(e))continue;let t=new Set;for(let n of e.predecessors)if(f.has(n.from))for(let e of d.get(n.from)??[])t.add(e);let n=Eo(t,c.get(e)??[]),r=u.get(e)??new Set,i=d.get(e)??new Set;(!To(t,r)||!To(n,i))&&(u.set(e,t),d.set(e,n),m=!0)}}let h=(c.get(a)??[]).filter(e=>e.position<o);return[...Eo(u.get(a)??new Set,h)].map(e=>e.expression)},Oo=(e,t,n)=>{if(!xo.has(e.kind))return e.initializer?[e.initializer]:[];if(!n)return[];let r=Co.get(n);r||(r=new WeakMap,Co.set(n,r));let i=r.get(e);i||(i=new WeakMap,r.set(e,i));let a=i.get(t);if(a)return a;let o=Do(e,t,n);return i.set(t,o),o},ko=e=>{if(!O(e)||!b(e.body,`BlockStatement`))return[];let t=[];return z(e.body,n=>{if(n!==e.body&&(O(n)||b(n,`ClassDeclaration`)||b(n,`ClassExpression`)))return!1;b(n,`ReturnStatement`)&&t.push(n)}),t},B=e=>{if(b(e,`ReturnStatement`)||b(e,`ThrowStatement`))return!0;if(b(e,`IfStatement`)){if(b(e.test,`Literal`)){let t=e.test.value?e.consequent:e.alternate;return t?B(t):!1}return!!(e.alternate&&B(e.consequent)&&B(e.alternate))}if(b(e,`TryStatement`))return e.finalizer&&B(e.finalizer)?!0:B(e.block)?e.handler?B(e.handler.body):!0:!1;if(b(e,`DoWhileStatement`))return B(e.body);if(b(e,`WhileStatement`)){let t=e.test;return!!(b(t,`Literal`)&&t.value&&B(e.body))}if(b(e,`ForStatement`)){let t=e.test;return!!((!t||b(t,`Literal`)&&t.value)&&B(e.body))}return b(e,`BlockStatement`)?e.body.some(e=>B(e)):!1},Ao=new Set([`let`,`var`]),jo=e=>!O(e)||!e.body?[]:b(e.body,`BlockStatement`)?ko(e).flatMap(e=>e.argument?[e.argument]:[]):[e.body],Mo=e=>{if(!O(e)||!b(e.body,`BlockStatement`))return!1;let t=!1;return z(e.body,n=>{if(t||n!==e.body&&O(n))return!1;b(n,`ReturnStatement`)&&!n.argument&&(t=!0)}),t},No=(e,t,n,r=`some`)=>{let i=new Set,a=new Set,o,s=e=>{if(a.has(e))return!1;a.add(e);try{let t=jo(e);return r===`every`&&O(e)&&b(e.body,`BlockStatement`)&&(!B(e.body)||Mo(e))?!1:t.length>0&&(r===`every`?t.every(o):t.some(o))}finally{a.delete(e)}};o=a=>{let l=w(a);if(i.has(l))return!1;i.add(l);try{if(t(l))return!0;if(b(l,`Identifier`)){let t=e.symbolFor(l);if(!t||t.kind!==`const`&&!Ao.has(t.kind))return!1;let i=Oo(t,l,n),a=e=>{let t=w(e);return!O(t)&&o(t)};return r===`every`?i.length>0&&i.every(a):i.some(a)}if(b(l,`CallExpression`)){if(l.arguments.length!==0||!b(l.callee,`Identifier`))return!1;let t=e.symbolFor(l.callee);if(!t||t.kind!==`const`&&t.kind!==`function`)return!1;let n=t.initializer?w(t.initializer):null,r=null;return O(n)?r=n:O(t.declarationNode)&&(r=t.declarationNode),!r||r.async||r.generator||r.params.length!==0?!1:s(r)}return b(l,`ConditionalExpression`)?c(l.consequent,l.alternate):b(l,`LogicalExpression`)?c(l.left,l.right):!1}finally{i.delete(l)}};let c=(e,t)=>{let n=[o(e),o(t)];return r===`every`?n.every(Boolean):n.some(Boolean)};return{expressionMatches:o,functionMatches:s}},Po=(e,t,n,r,i=`some`)=>No(t,n,r,i).functionMatches(e),Fo=(e,t,n,r,i)=>{let a=i.cfgFor(e),o=a?.blockOf(t);if(!a||!o)return!1;let s=new Set(ko(e).flatMap(e=>{if(!e.argument||!No(n,r,i,`every`).expressionMatches(e.argument))return[];let t=a.blockOf(e.argument);return t?[t]:[]}));if(s.size===0)return!1;let c=new Set([o]),l=[o];for(;l.length>0;){let e=l.pop();if(!e)break;if(!s.has(e))for(let t of e.successors){if(t.to===a.exit)return!1;c.has(t.to)||(c.add(t.to),l.push(t.to))}}return!0},Io=e=>b(e,`Program`)?e.range[1]:e.range[0],Lo=new WeakMap,Ro=new WeakMap,zo=(e,t)=>{let n=w(e);return b(n,`Identifier`)?t.symbolFor(n):null},Bo=(e,t)=>{let n=P(e),r=n.parent;return!r||!b(r,`AssignmentExpression`)||r.operator!==`=`||r.left!==n?null:zo(r.right,t)},Vo=e=>{let t=P(e),n=t.parent;return n&&b(n,`VariableDeclarator`)&&n.init===t&&(b(n.id,`Identifier`)||b(n.id,`ObjectPattern`))?!0:!!(n&&b(n,`AssignmentExpression`)&&n.operator===`=`&&n.right===t&&b(w(n.left),`Identifier`))},Ho=(e,t,n)=>{if(e.initializer&&b(e.declarationNode,`VariableDeclarator`)&&e.declarationNode.id===e.bindingIdentifier){let r=zo(e.initializer,n);if(r&&t.has(r.id))return!0}return e.references.some(e=>{let r=Bo(e.identifier,n);return!!(r&&t.has(r.id))})},Uo=(e,t)=>{let n=F(e,t);if(!n)return[];let r=Lo.get(t);r||(r=new Map,Lo.set(t,r));let i=r.get(n.id);if(i)return i;let a=[],o=[t.rootScope];for(;o.length>0;){let e=o.pop();e&&(a.push(...e.symbols),o.push(...e.children))}let s=new Set([n.id]),c=!0;for(;c;){c=!1;for(let e of a)s.has(e.id)||Ho(e,s,t)&&(s.add(e.id),c=!0)}let l=a.filter(e=>s.has(e.id));return r.set(n.id,l),l},Wo=e=>{let t=e;for(;t;){if(O(t)||b(t,`Program`))return t;t=t.parent??null}return null},Go=new WeakMap,Ko=(e,t)=>{let n=Go.get(t);if(!n){let r=new Map,i=new Map,a=zt(e);a&&z(a,e=>{if(!b(e,`CallExpression`))return;let n=w(e.callee),a=b(n,`Identifier`)?t.symbolFor(n):null,o=a?i.get(a.id):void 0;o===void 0&&(o=sn(e.callee,t),a&&i.set(a.id,o));for(let t of o){let n=r.get(t)??[];n.push(e),r.set(t,n)}}),n=r,Go.set(t,n)}return n.get(e)??[]},qo=new WeakMap,Jo=(e,t)=>{let n=qo.get(t);if(n===void 0){let e=null;z(t,n=>{b(n,`AwaitExpression`)&&j(n)===t&&(e===null||n.range[0]<e)&&(e=n.range[0])}),n=e,qo.set(t,n)}return n===null||e.range[0]<n},Yo=(e,t,n,r=new Set,i=null,a)=>{if(r.has(e)||!O(e)||e.generator||i!==null&&!qt(i,e)||i!==null&&a!==void 0&&!a(i)||i!==null&&e.async&&!Jo(i,e))return[];r.add(e);let o=Wo(t);return o?Ko(e,n).flatMap(e=>{let s=Wo(e);return!s||i!==null&&!qt(e,s)||i!==null&&a!==void 0&&!a(e)?[]:s===o?e.range[0]<Io(t)?[[e.range[0]]]:[]:O(s)?Yo(s,t,n,new Set(r),i===null?null:e,a).map(t=>[...t,e.range[0]]):[]}):[]},Xo=(e,t,n,r=new Set,i=null)=>Yo(e,t,n,r,i).length>0,Zo=e=>{let t=e.parent;return t?b(t,`AssignmentExpression`)?t.left===e:(b(t,`UpdateExpression`)||b(t,`UnaryExpression`)&&t.operator===`delete`)&&t.argument===e:!1},Qo=e=>{let t=e.parent;for(;t&&w(t)===e;)t=t.parent;return!t||!b(t,`MemberExpression`)||w(t.object)!==e||!Zo(t)?null:t},$o=(e,t,n)=>{let r=Qo(e);return r&&I(r,n)===t?r:null},es=(e,t,n,r)=>e.references.some(e=>{let i=$o(e.identifier,t,r);if(!i)return!1;let a=Wo(i),o=Wo(n);return!a||!o||!qt(i,a)?!1:a===o?i.range[0]<Io(n):O(a)&&Xo(a,n,r)}),ts=e=>{if(Vo(e))return!0;let t=P(e),n=t.parent;return!!(n&&b(n,`MemberExpression`)&&w(n.object)===t)},ns=e=>{if(Vo(e))return!0;let t=P(e),n=t.parent;if(!n||!b(n,`MemberExpression`)||w(n.object)!==t)return!1;let r=P(n),i=r.parent;return!(i&&b(i,`CallExpression`)&&i.callee===r)},rs=(e,t,n)=>b(e,`Identifier`)?Uo(e,n).some(e=>e.references.some(e=>{let r=Qo(e.identifier);if(!r)return!1;let i=I(r,n);return i===null||i===t})):!1,is=(e,t,n)=>{let r=Wo(e),i=Wo(t);return!r||!i?!0:r===i?e.range[0]<Io(t):O(r)?Xo(r,t,n):!0},as=(e,t,n,r)=>b(e,`Identifier`)?Uo(e,r).some(e=>e.references.some(e=>{let i=Qo(e.identifier);if(!i||!is(i,n,r))return!1;let a=I(i,r);return a===null||a===t})):!1,os=(e,t,n)=>{if(!b(e,`Identifier`))return!1;let r=F(e,n);if(!r)return!1;let i=Ro.get(n)??new Map;Ro.set(n,i);let a=i.get(r.id)??new Map;i.set(r.id,a);let o=a.get(t);if(o!==void 0)return o;let s=rs(e,t,n)||Uo(e,n).some(e=>e.references.some(e=>!ts(e.identifier)));return a.set(t,s),s},ss=(e,t,n,r)=>b(e,`Identifier`)?as(e,t,n,r)?!0:Uo(e,r).some(e=>e.references.some(e=>!ns(e.identifier)&&is(e.identifier,n,r))):!1,cs=(e,t)=>{let n=w(e);if(!b(n,`CallExpression`))return!1;let r=w(n.callee);if(!b(r,`MemberExpression`))return!1;let i=C(r);if(i===null)return!1;let a=w(r.object);return b(a,`Identifier`)&&rs(a,i,t)},ls=(e,t,n,r)=>b(e,`Identifier`)?Ut(e,r).some(e=>es(e,t,n,r)):!1,us=(e,t,n,r={})=>{let i=j(e);return i===j(t)?e.range[0]>=Io(t)||r.requireSynchronousWrite&&(!i||!qt(e,i)||r.isSynchronousNode!==void 0&&!r.isSynchronousNode(e))?[]:[[e.range[0]]]:i?r.requireSynchronousWrite?Yo(i,t,n,new Set,e,r.isSynchronousNode).map(t=>[...t,e.range[0]]):Yo(i,t,n).map(t=>[...t,e.range[0]]):r.requireSynchronousWrite?[]:[[-1/0,e.range[0]]]},ds=(e,t,n,r={})=>us(e,t,n,r).length>0,V=(e,t,n,r={})=>e.references.some(e=>e.flag===`read`?!1:ds(e.identifier,t,n,r)),fs=(e,t)=>{if(!b(e,`CallExpression`))return!1;let n=w(e.callee);if(b(n,`Identifier`)){let e=t.symbolFor(n);return!!(e&&!V(e,n,t))}if(!b(n,`MemberExpression`))return!1;let r=C(n),i=w(n.object);return!!(r&&b(i,`Identifier`)&&!ls(i,r,n,t))},ps=new Set([`FunctionDeclaration`,`FunctionExpression`,`ArrowFunctionExpression`,`ClassDeclaration`,`ClassExpression`]),ms={allowGlobalReactNamespace:!1,allowUnboundBareCalls:!1},hs=new Set([`lodash/sortBy`,`lodash/sortBy.js`,`lodash-es/sortBy`,`lodash-es/sortBy.js`]),gs=e=>b(e,`TSArrayType`)||b(e,`TSTupleType`)?!0:b(e,`TSTypeReference`)?b(e.typeName,`Identifier`)&&(e.typeName.name===`Array`||e.typeName.name===`ReadonlyArray`):!1,_s=e=>{if(!b(e,`Identifier`))return!1;let t=e.typeAnnotation;return!!(t&&b(t,`TSTypeAnnotation`)&&gs(t.typeAnnotation))},vs=(e,t)=>{if(!b(e,`CallExpression`))return!1;let n=w(e.callee);if(!b(n,`Identifier`))return!1;let r=t.symbolFor(n);if(!r||V(r,n,t)||!b(r.declarationNode,`ImportDefaultSpecifier`)&&!b(r.declarationNode,`ImportSpecifier`))return!1;let i=fo(n,n.name);return!i||i.isNamespace?!1:hs.has(i.source)&&i.exportedName===`default`?!0:(i.source===`lodash`||i.source===`lodash-es`)&&i.exportedName===`sortBy`},ys=(e,t,n,r=new Set)=>{let i=w(e);if(b(i,`ArrayExpression`)||vs(i,t))return!0;if(!b(i,`Identifier`))return!1;let a=t.symbolFor(i);return!a||r.has(a.id)||V(a,n,t)?!1:_s(a.bindingIdentifier)?!0:a.initializer?(r.add(a.id),ys(a.initializer,t,n,r)):!1},bs=(e,t)=>{if(!b(e,`CallExpression`))return!1;let n=w(e.callee);if(!b(n,`MemberExpression`)||C(n)!==`map`)return!1;let r=w(n.object);return ys(r,t,e)?!(b(r,`Identifier`)&&ls(r,`map`,e,t)):!1},xs=(e,t)=>{if(e.type!==`ArrowFunctionExpression`&&e.type!==`FunctionExpression`)return!1;let n=e.parent;if(b(n,`CallExpression`))return Ja(n,`useMemo`,t,{resolveNamedAliases:!0})&&fs(n,t)?n.arguments[0]===e:n.arguments.some(t=>t===e)&&bs(n,t);if(b(n,`Property`)&&n.kind===`init`&&n.value===e){let e=n.parent;if(!b(e,`ObjectExpression`))return!1;let r=e.parent;if(!b(r,`CallExpression`)||!r.arguments.some(t=>t===e)||!fs(r,t))return!1;let i=on(r.callee,t);return!!(i&&vo(i,!0))}return!1},Ss=(e,t)=>ps.has(e.type)&&!xs(e,t),Cs=(e,t)=>e.type===`JSXElement`||e.type===`JSXFragment`||Ja(e,`createElement`,t,ms)||ws(e,t),ws=(e,t)=>{if(!b(e,`CallExpression`))return!1;let n=w(e.callee);if(b(n,`Identifier`))return t.symbolFor(n)?.kind===`import`&&lo(n,n.name,`react-dom`)===`createPortal`;if(!b(n,`MemberExpression`)||n.computed||!b(n.object,`Identifier`)||!b(n.property,`Identifier`)||n.property.name!==`createPortal`)return!1;let r=t.symbolFor(n.object);return!r||r.kind!==`import`?!1:co(n.object,n.object.name,`react-dom`)||so(n.object,n.object.name,`react-dom`)},Ts=(e,t)=>{if(Ss(e,t))return!1;let n=!1;return z(e,r=>{if(n||r!==e&&Ss(r,t))return!1;if(Cs(r,t))return n=!0,!1}),n},Es=new WeakMap,Ds=(e,t,n)=>{let r=Es.get(e);if(r&&r.scopes===t&&r.controlFlow===n)return r.hasRenderOutput;let i=Po(e,t,e=>Ts(e,t),n);return Es.set(e,{scopes:t,controlFlow:n,hasRenderOutput:i}),i},Os=e=>b(e,`JSXIdentifier`)?e.name:b(e,`JSXNamespacedName`)?`${e.namespace.name}:${e.name.name}`:null,ks=new Set([`Component`,`PureComponent`]),As=(e,t,n,r)=>{let i=w(e);if(b(i,`MemberExpression`)){let e=C(i),n=w(i.object);return!!(e&&ks.has(e)&&b(n,`Identifier`)&&!ls(n,e,i,t)&&Ga(n,t))}if(b(i,`ClassExpression`))return js(i,t,n,r);if(!b(i,`Identifier`))return!1;let a=t.symbolFor(i);if(!a||r.has(a.id)||V(a,i,t))return!1;if(r.add(a.id),Ua(a)){let e=x(a.declarationNode);return!!(e&&ks.has(e))}return b(a.declarationNode,`ClassDeclaration`)||b(a.declarationNode,`ClassExpression`)?js(a.declarationNode,t,n,r):!!(a.kind===`const`&&a.initializer&&As(a.initializer,t,n,r))},js=(e,t,n=new Set,r=new Set)=>!b(e,`ClassDeclaration`)&&!b(e,`ClassExpression`)||n.has(e)||!e.superClass?!1:(n.add(e),As(e.superClass,t,n,r)),Ms=new Set([`FunctionDeclaration`,`FunctionExpression`,`ArrowFunctionExpression`,`MethodDefinition`,`Program`]),Ns=e=>{let t=e;for(;t;){if(Ms.has(t.type))return t;t=t.parent??null}return null},Ps=(e,t)=>{if(t!==`let`&&t!==`const`)return Ns(e);let n=e.parent;for(;n;){if(n.type===`BlockStatement`){let t=n.parent;return t&&(t.type===`FunctionDeclaration`||t.type===`FunctionExpression`||t.type===`ArrowFunctionExpression`||t.type===`MethodDefinition`)?Ns(e):n}if(Ms.has(n.type))return n;n=n.parent??null}return null},Fs=(e,t,n,r)=>{if(b(e,`Identifier`)){let i=r.get(e.name)??[];i.push({bindingIdentifier:e,initializer:t,scopeOwner:n}),r.set(e.name,i);return}if(b(e,`ObjectPattern`)){for(let t of e.properties)if(b(t,`Property`)){let e=t.value;Fs(e,b(e,`AssignmentPattern`)?e.right:null,n,r)}else b(t,`RestElement`)&&Fs(t.argument,null,n,r);return}if(b(e,`ArrayPattern`)){for(let t of e.elements)t&&Fs(t,b(t,`AssignmentPattern`)?t.right??null:null,n,r);return}if(b(e,`AssignmentPattern`)){Fs(e.left,e.right??null,n,r);return}b(e,`RestElement`)&&Fs(e.argument,null,n,r)},Is=e=>{let t=new Map;return z(e,e=>{switch(e.type){case`VariableDeclarator`:{let n=e.parent,r=Ps(e,n?.type===`VariableDeclaration`?n.kind:void 0);r&&Fs(e.id,e.init??null,r,t);break}case`FunctionDeclaration`:case`FunctionExpression`:case`ArrowFunctionExpression`:if(e.type!==`ArrowFunctionExpression`&&e.id){let n=e.parent?Ns(e.parent):null;if(n){let r=t.get(e.id.name)??[];r.push({bindingIdentifier:e.id,initializer:e,scopeOwner:n}),t.set(e.id.name,r)}}for(let n of e.params)Fs(n,null,e,t);break;case`ClassDeclaration`:case`ClassExpression`:{if(!e.id)break;let n=e.parent?Ns(e.parent):null;if(n){let r=t.get(e.id.name)??[];r.push({bindingIdentifier:e.id,initializer:e,scopeOwner:n}),t.set(e.id.name,r)}break}case`ImportDeclaration`:{let n=Ns(e);if(!n)break;for(let r of e.specifiers){let e=r.local;if(e&&b(e,`Identifier`)){let i=t.get(e.name)??[];i.push({bindingIdentifier:e,initializer:r,scopeOwner:n}),t.set(e.name,i)}}break}case`TSImportEqualsDeclaration`:case`TSEnumDeclaration`:case`TSModuleDeclaration`:{let n=e.id;if(n?.type===`Identifier`){let r=Ns(e);if(r){let e=t.get(n.name)??[];e.push({bindingIdentifier:n,initializer:null,scopeOwner:r}),t.set(n.name,e)}}break}}}),t},Ls=new WeakMap,Rs=new WeakMap,zs=e=>{let t=zt(e);if(!t)return null;let n=Ls.get(t);return n||(n=Is(t),Ls.set(t,n)),n},Bs=(e,t,n)=>{let r=zs(e);if(!r)return null;let i=r.get(t);if(!i||i.length===0)return null;let a=i[0];if(i.length===1&&a){let t=e;for(;t;){if(t===a.scopeOwner)return a;t=t.parent??null}return null}let o=e;for(;o;){let t=null;for(let r of i)if(r.scopeOwner===o){if(t===null){t=r;continue}if(n?.preferInitializerBeforeReference){let n=!!(r.initializer&&(b(r.initializer,`FunctionDeclaration`)||r.bindingIdentifier.range[0]<e.range[0]));if(n!==!!(t.initializer&&(b(t.initializer,`FunctionDeclaration`)||t.bindingIdentifier.range[0]<e.range[0]))){n&&(t=r);continue}}(r.initializer!==null||t.initializer===null)&&(t=r)}if(t)return t;o=o.parent??null}return null},Vs=(e,t,n)=>{let r=Rs.get(e),i;if(!r)i={},Rs.set(e,{primaryBindingName:t,primaryLookup:i});else if(r.primaryBindingName===t)i=r.primaryLookup;else{let e=r.additionalLookups;e||(e=new Map,r.additionalLookups=e);let n=e.get(t);n?i=n:(i={},e.set(t,i))}let a=n?.preferInitializerBeforeReference?`preferredResult`:`defaultResult`;if(a in i)return i[a]??null;let o=Bs(e,t,n);return i[a]=o,o},Hs=e=>ga.test(e),Us=e=>{let t=Vs(e,e.name);if(!t?.initializer)return null;let n=t.bindingIdentifier.parent;if(!n||!b(n,`VariableDeclarator`)||n.id!==t.bindingIdentifier)return null;let r=n.parent;if(!r||!b(r,`VariableDeclaration`)||r.kind!==`const`)return null;let i=w(t.initializer);return b(i,`Literal`)&&typeof i.value==`string`?i.value:null},Ws=e=>b(e,`JSXIdentifier`)?e.name:b(e,`JSXMemberExpression`)?`${Ws(e.object)}.${e.property.name}`:b(e,`JSXNamespacedName`)?`${e.namespace.name}:${e.name.name}`:``,Gs=e=>{let t=e.name;return b(t,`JSXIdentifier`)?Hs(t.name)?Us(t)??t.name:t.name:Ws(t)},Ks=(e,t)=>{if(!b(e.name,`JSXIdentifier`))return!1;let n=Gs(e);if(n[0]===n[0]?.toLowerCase())return!0;let r=new Set,i=e=>{let n=P(e);if(b(n,`Literal`))return typeof n.value==`string`;if(b(n,`Identifier`)||b(n,`JSXIdentifier`)){let e=t.symbolFor(n);if(!e||e.kind!==`const`||!e.initializer||r.has(e.id))return!1;r.add(e.id);let a=i(e.initializer);return r.delete(e.id),a}return b(n,`ConditionalExpression`)?i(n.consequent)&&i(n.alternate):!1};return i(e.name)},qs=(e,t,n=new Set)=>{if(!e)return null;let r=w(e);if(O(r))return r;if(b(r,`Identifier`)){let e=t.symbolFor(r);return!e||n.has(e.id)||!e.initializer||V(e,r,t)?null:(n.add(e.id),qs(e.initializer,t,n))}if(!b(r,`CallExpression`)||!Ja(r,`memo`,t,{resolveNamedAliases:!0})&&!Ja(r,`forwardRef`,t,{resolveNamedAliases:!0}))return null;let i=r.arguments[0];return!i||b(i,`SpreadElement`)?null:qs(i,t,n)},Js=(e,t)=>{let n=P(e);if(!O(n)||n.async||n.generator)return!1;let r=n.parent;if(!r||!b(r,`JSXExpressionContainer`))return!1;let i=r.parent;if(!i||!b(i,`JSXAttribute`)||Os(i.name)!==`ref`)return!1;let a=i.parent;return!!(a&&b(a,`JSXOpeningElement`)&&Ks(a,t))},Ys=(e,t)=>t.every((t,n)=>e[n]===t),Xs=e=>{let t=P(e);for(;t.parent&&b(t.parent,`MemberExpression`)&&t.parent.object===t;){if(!C(t.parent))return null;t=P(t.parent)}return t},Zs=(e,t,n,r)=>{if(t.length!==n.length+1||!Ys(t,n)||t[n.length]!==`current`)return!1;let i=Xs(e),a=i?.parent;if(!i||!a||!b(a,`AssignmentExpression`)||a.operator!==`=`||a.left!==i)return!1;let o=j(e);if(!o)return!1;if(Js(o,r))return!0;if(!O(o)||o.async||o.generator)return!1;let s=j(o);if(!s||!Js(s,r))return!1;let c=P(o),l=c.parent;return!!(b(l,`ReturnStatement`)&&l.argument===c&&j(l)===s||b(s,`ArrowFunctionExpression`)&&s.body===c)},Qs=(e,t)=>{if(!b(e,`JSXOpeningElement`))return!1;let n=e.name;if(b(n,`JSXIdentifier`)){if(!t)return n.name===`Fragment`;let e=F(n,t);return e?Ua(e)&&x(e.declarationNode)===`Fragment`:n.name===`Fragment`&&t.isGlobalReference(n)}return b(n,`JSXMemberExpression`)?!b(n.object,`JSXIdentifier`)||n.property.name!==`Fragment`?!1:t?Ga(n.object,t)?!0:n.object.name===`React`&&t.isGlobalReference(n.object):n.object.name===`React`:!1},$s=(e,t,n,r,i)=>{let a=P(e),o=a.parent;if(!o)return!1;if(b(o,`ReturnStatement`)&&o.argument===a)return j(o)===t;if(b(o,`ArrowFunctionExpression`)&&o.body===a)return o===t;if(b(o,`JSXFragment`)&&o.children.some(e=>e===a)||b(o,`JSXElement`)&&o.children.some(e=>e===a)&&(Ks(o.openingElement,n)||Qs(o.openingElement,n)||i.doesCustomElementRenderChildren?.(o.openingElement)))return $s(o,t,n,r,i);if(b(o,`JSXExpressionContainer`)&&o.expression===a&&o.parent&&(b(o.parent,`JSXFragment`)||b(o.parent,`JSXElement`)&&(Ks(o.parent.openingElement,n)||Qs(o.parent.openingElement,n)||i.doesCustomElementRenderChildren?.(o.parent.openingElement))))return $s(o.parent,t,n,r,i);if(b(o,`ConditionalExpression`)&&(o.consequent===a||o.alternate===a)||b(o,`LogicalExpression`)&&(o.left===a||o.right===a)||b(o,`ArrayExpression`)&&o.elements.some(e=>e===a))return $s(o,t,n,r,i);if(!b(o,`VariableDeclarator`)||o.init!==a||!b(o.id,`Identifier`))return!1;let s=n.symbolFor(o.id);if(!s||s.kind!==`const`||s.references.length===0||r.has(s.id))return!1;r.add(s.id);let c=s.references.every(e=>e.flag===`read`&&$s(e.identifier,t,n,r,i));return r.delete(s.id),c},ec=(e,t,n={})=>$s(e,j(e),t,new Set,n),tc=(e,t)=>t.every((t,n)=>e[n]===t),nc=(e,t)=>tc(e,t)||tc(t,e),rc=e=>O(e)&&b(e.body,`BlockStatement`)&&e.body.body.length===0,ic=(e,t,n)=>Ja(e,t,n,{resolveNamedAliases:!0}),ac=(e,t,n=new Set)=>b(e,`ObjectExpression`)?e.properties.every(e=>{if(b(e,`SpreadElement`)){let r=P(e.argument);if(b(r,`ObjectExpression`))return ac(r,t,n);if(!b(r,`Identifier`))return!1;let i=t.symbolFor(r);if(!i||i.kind!==`const`||n.has(i.id)||!b(i.initializer,`ObjectExpression`))return!1;n.add(i.id);let a=ac(i.initializer,t,n);return n.delete(i.id),a}return b(e,`Property`)?!O(e.value)||rc(e.value):!1}):!1,oc=e=>C(e)||(e.computed&&b(e.property,`Literal`)&&typeof e.property.value==`number`&&Number.isSafeInteger(e.property.value)&&e.property.value>=0?String(e.property.value):null),sc=e=>{let t=[],n=P(e);for(;n.parent&&b(n.parent,`MemberExpression`)&&n.parent.object===n;){let e=oc(n.parent);if(!e)return null;t.push(e),n=P(n.parent)}return{expression:n,propertyPath:t}},cc=(e,t,n)=>{let r=n.environmentsByProgram.get(e);if(r)return r;let i={filename:t,program:e,scopes:A(e)};return n.environmentsByProgram.set(e,i),i},lc=(e,t,n=new Set)=>{let r=P(e);if(b(r,`Identifier`)){let e=t.symbolFor(r);return!e||!e.initializer||n.has(e.id)||V(e,r,t)?!1:(n.add(e.id),lc(e.initializer,t,n))}if(!b(r,`CallExpression`))return!1;if(ic(r,`forwardRef`,t))return!0;if(!ic(r,`memo`,t))return!1;let i=r.arguments[0];return!i||b(i,`SpreadElement`)?!1:lc(i,t,n)},uc=(e,t)=>{let n=cc(e.programNode,e.filePath,t),r=qs(e.exportedNode,n.scopes);return r?{environment:n,functionNode:r,isForwardRef:lc(e.exportedNode,n.scopes)}:null},dc=(e,t,n)=>{if(!b(e,`Identifier`)&&!b(e,`JSXIdentifier`))return null;let r=t.scopes.symbolFor(e);if(r&&r.kind!==`import`){if(V(r,e,t.scopes))return null;let n=qs(r.initializer,t.scopes);return n?{environment:t,functionNode:n,isForwardRef:!!(r.initializer&&lc(r.initializer,t.scopes))}:null}let i=fo(e,e.name);if(!i||i.isNamespace||i.exportedName===null)return null;let a=R(t.filename,i.source,i.exportedName);return a?uc(a,n):null},fc=(e,t,n)=>{if(b(e,`JSXIdentifier`))return dc(e,t,n);if(!b(e,`JSXMemberExpression`)||!b(e.object,`JSXIdentifier`))return null;let r=fo(e.object,e.object.name);if(!r?.isNamespace)return null;let i=R(t.filename,r.source,e.property.name);return i?uc(i,n):null},pc=(e,t,n=new Set)=>{let r=P(e);if(b(r,`Identifier`)){let e=t.scopes.symbolFor(r);return!e||!e.initializer||n.has(e.id)||V(e,r,t.scopes)?!1:(n.add(e.id),pc(e.initializer,t,n))}return js(r,t.scopes)},mc=(e,t,n)=>{if(!b(e,`JSXIdentifier`))return!1;let r=t.scopes.symbolFor(e);if(r&&r.kind!==`import`)return V(r,e,t.scopes)?!1:!!(r.initializer&&pc(r.initializer,t));let i=fo(e,e.name);if(!i||i.isNamespace||i.exportedName===null)return!1;let a=R(t.filename,i.source,i.exportedName);if(!a)return!1;let o=cc(a.programNode,a.filePath,n);return pc(a.exportedNode,o)},hc=(e,t)=>{if(!e)return null;let n=P(e);return!b(n,`ClassDeclaration`)&&!b(n,`ClassExpression`)||!pc(n,t)?null:{classNode:n,environment:t}},gc=(e,t,n)=>{if(!b(e,`JSXIdentifier`))return null;let r=t.scopes.symbolFor(e);if(r&&r.kind!==`import`)return V(r,e,t.scopes)?null:hc(r.initializer,t);let i=fo(e,e.name);if(!i||i.isNamespace||i.exportedName===null)return null;let a=R(t.filename,i.source,i.exportedName);if(!a)return null;let o=cc(a.programNode,a.filePath,n);return hc(a.exportedNode,o)},_c=(e,t,n)=>{let r=[...t],i=P(e);for(;i.parent;){let e=i.parent;if(b(e,`ArrayExpression`)){if(e.elements.some(e=>e&&b(e,`SpreadElement`)))return null;let t=e.elements.findIndex(e=>e===i);if(t<0)return null;r.unshift(String(t)),i=P(e);continue}if(b(e,`Property`)&&e.value===i){let t=S(e,{allowComputedString:!0}),a=e.parent;if(!t||!a||!ac(a,n.scopes))return null;r.unshift(t),i=P(a);continue}if(b(e,`ConditionalExpression`)&&(e.consequent===i||e.alternate===i)||b(e,`LogicalExpression`)&&(e.left===i||e.right===i)){i=P(e);continue}if(b(e,`VariableDeclarator`)&&e.init===i&&b(e.id,`Identifier`)){let t=n.scopes.symbolFor(e.id);return!t||t.kind!==`const`?null:{environment:n,propertyPath:r,symbol:t}}if(b(e,`AssignmentExpression`)&&e.operator===`=`&&e.right===i&&b(e.left,`MemberExpression`)){let t=[],i=e.left;for(;b(i,`MemberExpression`);){let e=oc(i);if(!e)return null;t.unshift(e),i=P(i.object)}if(!b(i,`Identifier`))return null;let a=n.scopes.symbolFor(i);return!a||a.kind!==`const`?null:{environment:n,originWriteReference:i,propertyPath:[...t,...r],symbol:a}}return null}return null},vc=(e,t,n,r,i)=>{if(b(e,`AssignmentPattern`))return vc(e.left,t,n,r,i);if(b(e,`Identifier`)){let a=n.scopes.symbolFor(e);return!!(a&&Pc({environment:n,propertyPath:t,symbol:a},r,i-1))}if(!b(e,`ObjectPattern`)||t.length===0)return!1;let[a,...o]=t;for(let t of e.properties){if(!b(t,`Property`))continue;let e=S(t,{allowComputedString:!0});if(!e)return!1;if(e===a)return vc(t.value,o,n,r,i)}let s=e.properties.find(e=>b(e,`RestElement`));return s?vc(s.argument,t,n,r,i):!0},yc=(e,t)=>{let n=e.arguments[0];return!n||b(n,`SpreadElement`)?!1:ic(e,`createElement`,t.scopes)?b(n,`Literal`)&&typeof n.value==`string`:!ic(e,`cloneElement`,t.scopes)||!b(n,`JSXElement`)?!1:Ks(n.openingElement,t.scopes)},bc=(e,t,n,r,i)=>{if(t.length>0)return!1;let a=e.parent;if(!a||!b(a,`Property`)||a.value!==e||S(a,{allowComputedString:!0})!==`ref`)return!1;let o=a.parent;if(!o||!b(o,`ObjectExpression`))return!1;let s=o.parent;return!(!s||!b(s,`CallExpression`)||s.arguments[1]!==o||!yc(s,n)||!wc(s,n,r,i))},xc=(e,t,n,r,i)=>{if(i<=0||!O(e.functionNode)||e.functionNode.async||e.functionNode.generator)return!1;let a=e.functionNode.params[t];return!!(a&&vc(a,n,e.environment,r,i))},Sc=e=>{if(!b(e,`MemberExpression`)||C(e)!==`children`)return!1;let t=P(e.object);return!!(b(t,`MemberExpression`)&&C(t)===`props`&&b(P(t.object),`ThisExpression`))},Cc=(e,t)=>{if(!b(e,`JSXOpeningElement`)||!b(e.name,`JSXMemberExpression`)||e.name.property.name!==`Provider`||!b(e.name.object,`JSXIdentifier`))return!1;let n=t.scopes.symbolFor(e.name.object);return!!(n?.kind===`const`&&n.initializer&&b(n.initializer,`CallExpression`)&&ic(n.initializer,`createContext`,t.scopes))},wc=(e,t,n,r)=>ec(e,t.scopes,{doesCustomElementRenderChildren:e=>Dc(e,t,n,r-1)}),Tc=(e,t,n)=>{let{functionNode:r}=e;if(n<=0||t.activeRenderedChildrenComponents.has(r)||!b(r,`ArrowFunctionExpression`)&&!b(r,`FunctionExpression`)&&!b(r,`FunctionDeclaration`)||r.async||r.generator)return!1;let i=to(r,e.environment.scopes);if(!i)return!1;t.activeRenderedChildrenComponents.add(r);let a=i.every(r=>wc(r,e.environment,t,n));return t.activeRenderedChildrenComponents.delete(r),a},Ec=(e,t,n)=>{let{classNode:r,environment:i}=e;if(n<=0||t.activeRenderedChildrenComponents.has(r)||!b(r,`ClassDeclaration`)&&!b(r,`ClassExpression`))return!1;let a=r.body.body.find(e=>b(e,`MethodDefinition`)&&!e.computed&&b(e.key,`Identifier`)&&e.key.name===`render`);if(!a||!b(a,`MethodDefinition`))return!1;let o=[];if(z(r,e=>{Sc(e)&&o.push(e)}),o.length===0)return!1;t.activeRenderedChildrenComponents.add(r);let s=o.every(e=>j(e)===a.value&&wc(e,i,t,n));return t.activeRenderedChildrenComponents.delete(r),s},Dc=(e,t,n,r)=>{if(r<=0||!b(e,`JSXOpeningElement`))return!1;if(Cc(e,t))return!0;let i=fc(e.name,t,n);if(i)return Tc(i,n,r);let a=gc(e.name,t,n);return!!(a&&Ec(a,n,r))},Oc=(e,t,n,r,i)=>{let a=Os(e.name),o=e.parent;if(!a||!o||!b(o,`JSXOpeningElement`))return!1;let s=o.parent;if(!s||!b(s,`JSXElement`)||!wc(s,n,r,i))return!1;if(Ks(o,n.scopes))return a===`ref`&&t.length===0;if(b(o.name,`JSXIdentifier`)&&a===`ref`&&t.length===0&&mc(o.name,n,r))return!0;let c=fc(o.name,n,r);return c?a===`ref`&&c.isForwardRef?xc(c,1,t,r,i):xc(c,0,[a,...t],r,i):!1},kc=(e,t,n,r,i,a)=>{let o=e.arguments.findIndex(e=>e===t);if(o<0)return!1;if(o===0&&b(e.callee,`Identifier`)&&e.callee.name===`Boolean`&&r.scopes.isGlobalReference(e.callee))return!0;if(o===0&&ic(e,`useImperativeHandle`,r.scopes))return n.length===0;if(o===1&&n.length===1&&n[0]===`ref`&&yc(e,r)&&wc(e,r,i,a))return!0;let s=P(e.callee);if(O(s))return Ds(s,r.scopes)&&!wc(e,r,i,a)?!1:xc({environment:r,functionNode:s,isForwardRef:!1},o,n,i,a);if(!b(e.callee,`Identifier`))return!1;let c=dc(e.callee,r,i);return!!(c&&(!Ds(c.functionNode,c.environment.scopes)||wc(e,r,i,a))&&xc(c,o,n,i,a))},Ac=(e,t,n,r,i)=>{let a;if(t.length===1&&t[0]===`ref`)a=e.parent;else if(t.length===0){let t=e.parent;if(!t||!b(t,`Property`)||t.value!==e||S(t,{allowComputedString:!0})!==`ref`)return!1;a=t.parent?.parent}if(!a||!b(a,`JSXSpreadAttribute`))return!1;let o=a.parent;if(!o||!b(o,`JSXOpeningElement`))return!1;let s=o.parent;return!!(Ks(o,n.scopes)&&s&&b(s,`JSXElement`)&&wc(s,n,r,i))},jc=(e,t,n,r,i)=>{let a=P(e),o=a.parent;if(!o)return!1;if(b(o,`ExpressionStatement`)||b(o,`UnaryExpression`)&&o.operator===`void`&&o.argument===a)return!0;if(t.length===0&&b(o,`BinaryExpression`)&&(o.operator===`===`||o.operator===`!==`||o.operator===`==`||o.operator===`!=`)){let e=o.left===a?o.right:o.left;return!!(b(a,`Identifier`)&&b(e,`Identifier`)&&n.scopes.symbolFor(a)?.id===n.scopes.symbolFor(e)?.id)}if(Ac(a,t,n,r,i)||bc(a,t,n,r,i)||t.length>0&&(b(o,`LogicalExpression`)&&o.left===a||b(o,`ConditionalExpression`)&&o.test===a||b(o,`IfStatement`)&&o.test===a||b(o,`UnaryExpression`)&&o.operator===`!`&&o.argument===a))return!0;if(b(o,`JSXExpressionContainer`)&&o.expression===a){let e=o.parent;return!!(e&&b(e,`JSXAttribute`)&&Oc(e,t,n,r,i))}if(b(o,`CallExpression`))return kc(o,a,t,n,r,i);if(b(o,`VariableDeclarator`)&&o.init===a&&!b(o.id,`Identifier`))return vc(o.id,t,n,r,i);let s=_c(a,t,n);return!!(s&&Pc(s,r,i-1))},Mc=e=>{let t=e.parent;return t&&b(t,`VariableDeclarator`)&&t.init===e&&b(t.id,`Identifier`)?t.id:(b(e,`FunctionDeclaration`)||b(e,`FunctionExpression`))&&e.id?e.id:null},Nc=(e,t,n)=>{if(!e||!t||!O(e)||e.async||e.generator)return!1;let r=Mc(e);if(!r||((b(e,`FunctionDeclaration`)||b(e,`FunctionExpression`))&&e.id===r?j(e):j(r))!==t)return!1;let i=b(e,`FunctionDeclaration`)?n.ownScopeFor(t)?.symbolsByName.get(r.name):n.symbolFor(r);return!!(i&&i.references.length>0&&i.references.every(e=>{let r=P(e.identifier),i=r.parent;return!!(i&&b(i,`CallExpression`)&&i.callee===r&&j(i)===t&&ec(i,n))}))},Pc=(e,t,n)=>{if(n<=0)return!1;let r=`${e.environment.filename}:${e.symbol.id}:${e.propertyPath.join(`.`)}`;if(t.activePaths.has(r))return!1;t.activePaths.add(r);let i=j(e.symbol.bindingIdentifier),a=e.symbol.references.every(r=>{if(r.identifier===e.originWriteReference)return!0;let a=r.identifier.parent;if(a&&b(a,`Property`)&&!a.computed&&a.key===r.identifier&&a.value!==r.identifier)return!0;let o=sc(r.identifier);if(!o)return!1;if(!nc(o.propertyPath,e.propertyPath))return!0;let s=j(r.identifier);if(s!==i&&!Nc(s,i,e.environment.scopes))return!!Zs(r.identifier,o.propertyPath,e.propertyPath,e.environment.scopes);if(r.flag!==`read`)return!1;if(tc(o.propertyPath,e.propertyPath)){if(o.propertyPath.length>e.propertyPath.length){let t=o.expression.parent;return!!(o.propertyPath.length===e.propertyPath.length+1&&o.propertyPath[e.propertyPath.length]===`current`&&t&&b(t,`UnaryExpression`)&&t.operator===`void`&&t.argument===o.expression)}return jc(o.expression,[],e.environment,t,n)}return jc(o.expression,e.propertyPath.slice(o.propertyPath.length),e.environment,t,n)});return t.activePaths.delete(r),a},Fc=(e,t,n)=>{if(!t)return!1;let r=zt(e);if(!r)return!1;let i={filename:t,program:r,scopes:n},a={activePaths:new Set,activeRenderedChildrenComponents:new WeakSet,environmentsByProgram:new WeakMap([[r,i]])},o=_c(e,[],i);return o?Pc(o,a,12):jc(e,[],i,a,12)},Ic=e=>{let t=[];for(let n of e)for(let e of n.entries){if(e.importName.kind===`NamespaceObject`)continue;let r=e.importName.kind===`Default`?`default`:e.importName.name??null;r!==null&&t.push({source:n.moduleRequest.value,exportedName:r})}return t},Lc=({absoluteFilePath:e,staticImports:t})=>{let n=!1;for(let r of t){let t=r.moduleRequest.value;if(!t.startsWith(`.`))continue;let i=r.entries.filter(e=>!e.isType);if(i.length===0)continue;let a=Bn(e,t);if(!(!a||!Di(a))){n||(n=!0,Jr(e));for(let e of i){let t=e.importName.kind===`Default`?`default`:e.importName.name;t&&$a(a,t)}}}},Rc=({absoluteFilePath:e})=>{_r.test(e)&&(xr.test(e)||ci(e))},zc=({absoluteFilePath:e,staticImports:t})=>{if(vr.test(e)&&!di(e))for(let n of Ic(t))sr(e,n.source,n.exportedName)},H=({absoluteFilePath:e,staticImports:t})=>{Ne(e);for(let n of Ic(t))sr(e,n.source,n.exportedName)},Bc=({absoluteFilePath:e,getProgram:t})=>{let n=t();un(n);let r=A(n);z(n,t=>{if(!b(t,`CallExpression`))return;let n=xe(t.callee,r);!n?.importedName||!n.source.startsWith(`.`)||sr(e,n.source,n.importedName)})},Vc=({absoluteFilePath:e,staticImports:t})=>{for(let n of Ic(t))R(e,n.source,n.exportedName)},Hc=(e,t,n,r)=>{let i=n.get(t);if(!(i!==void 0&&i<=r)){n.set(t,r);for(let i of e.body??[]){let e=fi(i);if(!e)continue;let a=rr(t,e);if(!a||r>=8)continue;let o=r+1,s=n.get(a);if(s!==void 0&&s<=o)continue;let c=yn(a);if(!c){n.set(a,o);continue}Hc(c,a,n,o)}}},Uc=e=>{Vc(e);let t=e.getProgram(),n=!1;z(t,e=>{if(n)return!1;if(!b(e,`CallExpression`))return;let t=w(e.callee);if(!b(t,`MemberExpression`))return;let r=C(t);n=r===`add`||r===`set`}),n&&Hc(t,e.absoluteFilePath,new Map,0)},Wc=({absoluteFilePath:e,staticImports:t})=>{for(let n of Ic(t))eo(e,n.source,n.exportedName)},Gc=e=>{let t=[];for(let n of e.body??[]){if(n.type!==`ImportDeclaration`)continue;let e=n.source?.value;if(typeof e==`string`){for(let r of n.specifiers??[])if(r.type===`ImportDefaultSpecifier`)t.push({source:e,exportedName:`default`});else if(r.type===`ImportSpecifier`){let n=r.imported,i=null;typeof n?.name==`string`?i=n.name:typeof n?.value==`string`&&(i=n.value),i&&t.push({source:e,exportedName:i})}}}return t},Kc=({absoluteFilePath:e,staticImports:t},n,r=()=>!0,i=()=>!0)=>{let a=new Map,o=(e,t,n)=>{if(!((a.get(e)??-1)>=n)){a.set(e,n);for(let a of Gc(t)){let t=R(e,a.source,a.exportedName);!t||n===0||!r(t)||!i(t.filePath)||o(t.filePath,t.programNode,n-1)}}};for(let a of Ic(t)){let t=R(e,a.source,a.exportedName);!t||!r(t)||!i(t.filePath)||o(t.filePath,t.programNode,n)}},qc=e=>{let t=e.getProgram();un(t);let n=A(t);z(t,t=>{if(b(t,`BlockStatement`))for(let[r,i]of t.body.entries()){let a=t.body[r+1];!b(i,`VariableDeclaration`)||!b(a,`VariableDeclaration`)||hr(i,a,n,e.absoluteFilePath)}})},Jc=e=>{Kc(e,4),Vc(e),Ue(e.absoluteFilePath,`@xstate/react`)},Yc=({absoluteFilePath:e,sourceText:t,getProgram:n})=>{if(!t.includes(`createRef`)&&!t.includes(`\\u`))return;let r=n();un(r);let i=A(r);z(r,t=>{!b(t,`CallExpression`)||!Ja(t,`createRef`,i,{allowGlobalReactNamespace:!0,allowUnboundBareCalls:!0,resolveNamedAliases:!0})||Fc(t,e,i)})},Xc=({absoluteFilePath:e,sourceText:t,staticImports:n,getProgram:r})=>{let i=new Set,a=new Set;for(let e of n)if(e.moduleRequest.value===`react`)for(let t of e.entries){let{importName:e}=t;e.kind===`Name`&&e.name===`useReducer`?i.add(t.localName.value):(e.kind===`Default`||e.kind===`NamespaceObject`)&&a.add(t.localName.value)}if(!(i.size>0||a.size>0&&(t.includes(`useReducer`)||t.includes(`\\u`))))return;let o=r(),s=e=>{if(e?.type!==`Identifier`)return null;let{name:t}=e;return typeof t==`string`?t:null},c=e=>{let t=s(e);if(t!==null)return i.has(t);if(e.type!==`MemberExpression`)return!1;let n=e,r=s(n.object);return r!==null&&a.has(r)&&s(n.property)===`useReducer`},l=new Set;if(z(o,e=>{if(e.type!==`CallExpression`)return;let t=e;if(!t.callee||!c(t.callee))return;let n=t.arguments?.[0];if(!n)return;let r=s(w(n));r!==null&&l.add(r)}),l.size!==0)for(let t of n)for(let n of t.entries){if(n.importName.kind===`NamespaceObject`||!l.has(n.localName.value))continue;let r=n.importName.kind===`Default`?`default`:n.importName.name;r&&sr(e,t.moduleRequest.value,r)}},Zc=({absoluteFilePath:e,staticImports:t,getProgram:n})=>{Jr(e),Yr({absoluteFilePath:e,staticImports:t,program:n()})},U=({absoluteFilePath:e})=>{Jr(e)},Qc=e=>{U(e),Wc(e)},$c=e=>{U(e),Kc(e,1/0,e=>O(e.exportedNode),e=>!e.split(/[\\/]/).includes(`node_modules`))},el=({absoluteFilePath:e})=>{Bi(e)},tl=({absoluteFilePath:e})=>{Ue(e,`react-native`)},nl=({absoluteFilePath:e})=>{Vi(e)},rl=e=>{nl(e),Yr({absoluteFilePath:e.absoluteFilePath,staticImports:e.staticImports,program:e.getProgram()})},il=new Map([...ne.map(e=>[e,nl]),[`ink-no-raw-text`,rl],[`client-passive-event-listeners`,H],[`effect-needs-cleanup`,H],[`effect-listener-cleanup-reference-mismatch`,H],[`exhaustive-deps`,Jc],[`rules-of-hooks`,Bc],[`no-barrel-import`,Lc],[`nextjs-async-dynamic-api-not-awaited`,U],[`nextjs-missing-metadata`,Rc],[`nextjs-no-use-search-params-without-suspense`,zc],[`no-dynamic-import-path`,U],[`no-full-lodash-import`,U],[`no-hydration-branch-on-browser-global`,Qc],[`no-indeterminate-attribute`,U],[`no-locale-format-in-render`,U],[`no-match-media-in-state-initializer`,U],[`no-create-ref-in-function-component`,Yc],[`no-adjust-state-on-prop-change`,H],[`no-derived-state`,H],[`no-derived-state-effect`,H],[`no-event-handler`,H],[`no-initialize-state`,H],[`no-reset-all-state-on-prop-change`,H],[`no-mutating-reducer-state`,Xc],[`no-side-effect-in-state-updater-function`,Uc],[`no-unguarded-browser-global-at-module-scope`,Wc],[`no-unguarded-browser-global-in-render-or-hook-init`,$c],[`prefer-dynamic-import`,U],[`rendering-hydration-mismatch-time`,U],[`rendering-hydration-no-flicker`,H],[`rerender-memo-with-default-value`,Jc],[`server-sequential-independent-await`,qc],[`rn-no-deprecated-modules`,tl],[`rn-no-legacy-shadow-styles`,el],[`rn-no-raw-text`,Zc],[`rn-prefer-expo-image`,U],[`rn-style-prefer-boxshadow`,el],...oe.map(e=>[e,U])]),al=new Set([`anchor-target-exists`,`nextjs-no-img-element`,`no-img-without-dimensions`,`no-loading-flag-reset-outside-finally`,`only-export-components`,`remotion-calculate-metadata-fetch-signal`,`remotion-deterministic-randomness`,`remotion-no-css-animation`,`remotion-no-css-transition`,`remotion-no-css-url-assets`,`remotion-no-native-media-elements`,`remotion-no-next-image`,`window-open-without-noopener`]),ol=e=>{let t=new Set;for(let n of e.ruleIds){let e=il.get(n);if(!e)return null;t.add(e)}let n=Xa(e.absoluteFilePath),r,i;try{let t=hn(n,e.sourceText);if(t.errors.some(e=>e.severity===`Error`))return null;r=t.module.staticImports;let a;i=()=>(a??=t.program,a)}catch{return null}let a={absoluteFilePath:n,sourceText:e.sourceText,staticImports:r,getProgram:i};return Ee(()=>{for(let e of t)e(a)})},sl={},cl=(e,t,n)=>!e||e.length===0?!1:e.every(e=>b(e,t)&&e[n]===`type`),ll=e=>e.importKind===`type`||cl(e.specifiers,`ImportSpecifier`,`importKind`),ul=new Set([`solid-js`,`solid-js/web`,`solid-js/store`,`solid-js/h`,`solid-js/html`,`@builder.io/qwik`,`@builder.io/qwik-city`,`@builder.io/qwik-react`,`voby`,`vidode`]),dl=[`solid-js`,`@builder.io/qwik`],fl=[`react`,`react-dom`,`preact`],pl=new WeakMap,ml=new WeakMap,hl=(e,t)=>t.some(t=>e===t||e.startsWith(`${t}/`)),gl=e=>{let t=pl.get(e);if(t)return t;let n=!1,r=!1,i=!1,a=!1,o=!1,s=!1;for(let t of e.body){if(i||z(t,e=>{if(i)return!1;if(b(e,`JSXOpeningElement`)&&_l(e))return i=!0,!1;b(e,`JSXOpeningElement`)&&b(e.name,`JSXIdentifier`)&&/^[a-z]/.test(e.name.name)&&e.attributes.some(e=>b(e,`JSXAttribute`)&&Os(e.name)===`class`)&&(s=!0)}),!b(t,`ImportDeclaration`))continue;let e=t,c=e.source,l=c&&typeof c.value==`string`?c.value:null;if(l){if(l===`solid-js`)for(let t of e.specifiers){if(!b(t,`ImportSpecifier`)||e.importKind!==`type`&&t.importKind!==`type`)continue;let n=x(t);n===`Component`&&(a=!0),n===`JSX`&&(o=!0)}ll(e)||((ul.has(l)||hl(l,dl))&&(n=!0),hl(l,fl)&&(r=!0))}}let c={hasNonReactMarker:i||a||o&&s,hasNonReactRuntime:n,hasReactRuntime:r};return pl.set(e,c),c},_l=e=>{let t=ml.get(e);if(t!==void 0)return t;let n=!1;for(let t of e.attributes){if(!b(t,`JSXAttribute`))continue;let r=Os(t.name);if(r&&(r===`classList`&&b(t.value,`JSXExpressionContainer`)&&b(t.value.expression,`ObjectExpression`)||b(e.name,`JSXIdentifier`)&&/^[a-z]/.test(e.name.name)&&(r.startsWith(`class:`)||r.startsWith(`bind:`)||r.startsWith(`on:`)||r.startsWith(`oncapture:`)))){n=!0;break}}return ml.set(e,n),n},vl=new Set(`/playground/./playgrounds/./examples/./example/./demo/./demos/./sandbox/./sandboxes/./specs/./spec/./integration/./it/./perf/./scripts/./cli/./bin/./tooling/./tools/./codemods/./codemod/./migrations/./migration/./generators/./generator/./runbooks/./devtools/./internal-tools/./seeds/./seed/./dev-seeder/`.split(`.`)),yl=new Set,bl=[`/test/`,`/tests/`,`/testing/`,`/__tests__/`,`/__test__/`,`/__fixtures__/`,`/fixtures/`,`/__mocks__/`,`/mocks/`,`/testUtils/`,`/test-utils/`,`/test-stubs/`,`/testutils/`,`/cypress/`,`/playwright/`,`/.storybook/`,`/.dumi/`,`/stories/`,`/__stories__/`,...vl,`/e2e/`,`/e2e-tests/`,`/integration-tests/`,`/benchmarks/`,`/benchmark/`,`/__benchmarks__/`,`/perf-tests/`],xl=[`.test.`,`.spec.`,`.cy.`,`.stories.`,`.story.`,`.bench.`,`.benchmark.`,`.e2e.`,`.integration-spec.`,`.int-spec.`,`.mock.`,`.mocks.`,`.fixture.`],Sl=new Set(`setuptests.js,setuptests.ts,setuptests.jsx,setuptests.tsx,setupvitest.js,setupvitest.ts,setupvitest.jsx,setupvitest.tsx,setupjest.js,setupjest.ts,vitest.setup.js,vitest.setup.ts,vitest.setup.mjs,vitest.config.ts,vitest.config.js,vitest.config.mts,vitest.config.mjs,jest.setup.js,jest.setup.ts,jest.setup.jsx,jest.setup.tsx,jest.config.js,jest.config.ts,jest.config.mjs,playwright.config.ts,playwright.config.js,cypress.config.ts,cypress.config.js,karma.conf.js,karma.conf.ts,vite.config.ts,vite.config.js,vite.config.mts,vite.config.mjs,webpack.config.ts,webpack.config.js,webpack.config.mjs,rollup.config.ts,rollup.config.js,rollup.config.mjs,esbuild.config.ts,esbuild.config.js,esbuild.config.mjs,tsup.config.ts,tsup.config.js,tsup.config.mjs,rsbuild.config.ts,rsbuild.config.js,rspack.config.ts,rspack.config.js,next.config.ts,next.config.js,next.config.mjs,remix.config.js,remix.config.ts,astro.config.ts,astro.config.js,astro.config.mjs,tailwind.config.ts,tailwind.config.js,tailwind.config.mjs,postcss.config.ts,postcss.config.js,postcss.config.mjs,biome.config.ts,biome.config.js,drizzle.config.ts,drizzle.config.js,prisma.config.ts,prisma.config.js,knip.config.ts,knip.config.js,knip.config.mjs,lint-staged.config.js,lint-staged.config.mjs`.split(`,`)),Cl=[`/src/`,`/app/`,`/lib/`,`/components/`,`/pages/`,`/features/`,`/modules/`,`/packages/`,`/apps/`,`/frontend/`,`/client/`],wl=bl.filter(e=>e.startsWith(`/.`)),Tl=e=>{let t=-1;for(let n of Cl){let r=e.lastIndexOf(n);r>t&&(t=r)}return t<0?e:e.slice(t)};let El,Dl=!1,Ol,kl=!1;const Al=e=>e?e===El?Dl:(El=e,Dl=Nl(e),Dl):!1,jl=e=>{if(!e)return!1;if(e===Ol)return kl;Ol=e;let t=e.replaceAll(`\\`,`/`),n=t.startsWith(`/`)?t:`/${t}`;return kl=Nl(n,Cl.some(e=>n.includes(e))?vl:yl),kl},Ml=(e,t)=>e?Nl(e,t):!1,Nl=(e,t=yl)=>{let n=e.replaceAll(`\\`,`/`),r=n.lastIndexOf(`/`),i=r===-1?n:n.slice(r+1);if(Sl.has(i.toLowerCase()))return!0;for(let e of xl)if(i.includes(e))return!0;let a=n.startsWith(`/`)?n:`/${n}`;for(let e of wl)if(!t.has(e)&&a.includes(e))return!0;let o=Tl(n);for(let e of bl)if(!t.has(e)&&(e.startsWith(`/.`)?n:o).includes(e))return!0;return!1},Pl=(e,t=Al)=>n=>t(n.filename)?sl:e(n),Fl=e=>{let t=e?.[`react-doctor`];return typeof t!=`object`||!t||Array.isArray(t)?null:t},Il=(e,t)=>Object.getOwnPropertyDescriptor(e,t)?.value,Ll=(e,t)=>{let n=Fl(e);if(!n)return;let r=Il(n,t);return typeof r==`string`?r:void 0},Rl=(e,t)=>{let n=Fl(e);if(!n)return;let r=Il(n,t);return typeof r==`number`&&Number.isFinite(r)?r:void 0},zl=new WeakMap,Bl=(e,t)=>{let n=Il(e,t);if(Array.isArray(n))return n.filter(e=>typeof e==`string`&&e.length>0)},Vl=(e,t)=>{let n=Fl(e);if(!n)return;let r=zl.get(n);if(r||(r=new Map,zl.set(n,r)),r.has(t))return r.get(t);let i=Bl(n,t);return r.set(t,i),i},Hl=(e,t)=>Vl(e,t)??[],Ul=(e,t)=>Hl(e,`capabilities`).includes(t),Wl=(e,t)=>{let n=Fl(e);return!n||Il(n,`capabilities`)===void 0?!0:Ul(e,t)},Gl=(e,t,n)=>!t?.some(t=>!Wl(e,t))&&!n?.some(t=>Ul(e,t)),Kl=(e,t,n)=>r=>Gl(r.settings,t,n)?e(r):sl,ql=e=>(t=>{let n=e(t),r=!1,i=!1,a={};for(let e in n){if(!Object.hasOwn(n,e))continue;let t=n[e];if(typeof t!=`function`){a[e]=t;continue}let o=e.charAt(0);if(o<`A`||o>`Z`){a[e]=t;continue}if(e===`Program`){a.Program=e=>{let n=gl(e);i=n.hasReactRuntime,r=!n.hasReactRuntime&&(n.hasNonReactRuntime||n.hasNonReactMarker),!r&&t(e)};continue}if(e===`JSXOpeningElement`){a.JSXOpeningElement=e=>{!i&&!r&&_l(e)&&(r=!0),!r&&t(e)};continue}a[e]=e=>{r||t(e)}}return`Program`in a||(a.Program=e=>{let t=gl(e);i=t.hasReactRuntime,r=!t.hasReactRuntime&&(t.hasNonReactRuntime||t.hasNonReactMarker)}),a}),W=e=>{if(!(`create`in e))return{...e,create:()=>sl};let t=e.tags,n=e.create,r=t?.includes(`test-noise`)&&!t?.includes(`migration-hint`);return t?.includes(`react-jsx-only`)&&(n=ql(n)),r&&(n=Pl(n,jl)),(e.requires||e.disabledWhen)&&(n=Kl(n,e.requires,e.disabledWhen)),n===e.create?e:{...e,create:n}};let Jl;const Yl=e=>{let t=[0];for(let n=0;n<e.length;n+=1){let r=e[n];if(r===`\r`&&e[n+1]===`
1
+ import*as e from"node:fs";import{readFileSync as t}from"node:fs";import*as n from"node:path";import{KEYS as r}from"eslint-visitor-keys";import{parseSync as i,rawTransferSupported as a,visitorKeys as o}from"oxc-parser";import{createHash as s,randomUUID as c}from"node:crypto";const l=[[`nextjs`,`Next.js`,`NEXT_PUBLIC_*`],[`vite`,`Vite`,`VITE_*`],[`tanstack-start`,`TanStack Start`,`VITE_*`],[`cra`,`Create React App`,`REACT_APP_*`],[`gatsby`,`Gatsby`,`GATSBY_*`]],u=e=>{for(let[t,n,r]of l)if(e(t))return`Move secrets to server-only code. In ${n}, only \`${r}\` env vars are exposed to the browser, and they must not contain secrets`},d=e=>e(`nextjs:static-export`)?`Avoid redirects inside useEffect — they flash the wrong page first. Use an event handler (e.g. onClick), or call redirect() from next/navigation during render (it prerenders a client-side redirect under output: "export"). Middleware and getServerSideProps redirects aren't available in a static export.`:void 0,f=[{key:`react-hooks-js/set-state-in-render`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/immutability`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/refs`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/purity`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/hooks`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/set-state-in-effect`,source:`react-compiler`,severity:`warn`},{key:`react-hooks-js/globals`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/error-boundaries`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/preserve-manual-memoization`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/unsupported-syntax`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/component-hook-factories`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/static-components`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/use-memo`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/void-use-memo`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/incompatible-library`,source:`react-compiler`,severity:`error`},{key:`react-hooks-js/todo`,source:`react-compiler`,severity:`error`}],p=Object.fromEntries(f.map(e=>[e.key,e.severity])),m=new Set(`width.height.min-width.max-width.min-height.max-height.top.right.bottom.left.padding.padding-top.padding-right.padding-bottom.padding-left.margin.margin-top.margin-right.margin-bottom.margin-left.border-width.border-top-width.border-right-width.border-bottom-width.border-left-width.line-height.column-width`.split(`.`)),h=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`,`borderWidth`,`fontSize`,`lineHeight`,`gap`]),g=new Set([`animate`,`initial`,`exit`,`whileHover`,`whileTap`,`whileFocus`,`whileDrag`,`whileInView`]),_=/blur\((\d+(?:\.\d+)?)px\)/,v=new Set([`requestAnimationFrame`,`setInterval`]),y=new Set([`framer-motion`,`motion`]),ee=new Set([`bounce`,`elastic`,`wobble`,`jiggle`,`spring`]),te={base:`3.0.0`,textLayoutGuard:`3.0.1`,aria:`6.2.0`,cursor:`6.7.0`,concurrent:`6.7.0`,renderToString:`6.8.0`,modernHooks:`7.0.0`,suspendTerminal:`7.1.0`},ne=[`ink-ctrl-c-handler-requires-exit-option`,`ink-newline-inside-text`,`ink-no-bare-process-exit`,`ink-no-direct-raw-mode`,`ink-no-dom-host-elements`,`ink-no-dom-router`,`ink-no-focus-in-render`,`ink-no-layout-inside-text`,`ink-no-live-hooks-in-render-to-string`,`ink-no-measure-element-in-render`,`ink-no-multiple-static`,`ink-no-raw-text`,`ink-no-repeated-render`,`ink-prefer-use-animation`,`ink-prefer-use-paste`,`ink-static-is-append-only`,`ink-static-requires-key`,`ink-suspense-requires-concurrent`,`ink-use-reactive-window-size`,`ink-use-string-width-for-cursor`,`ink-use-suspend-terminal`,`ink-valid-aria-semantics`],re=[`@react-router/dev`,`react-router-dom`,`react-router`],ie=[`Component`,`element`,`lazy`],ae=[`action`,`clientAction`,`clientLoader`,`loader`],oe=`react-router-csp-nonce-consistency.react-router-descendant-routes-require-splat.react-router-guard-aborted-handle-error.react-router-internal-route-anchor.react-router-loader-fetch-forwards-signal.react-router-loader-parallel-fetch.react-router-nested-route-requires-outlet.react-router-no-catch-middleware-next.react-router-no-client-module-in-server-render.react-router-no-duplicate-route-id.react-router-no-empty-leaf-route.react-router-no-invalid-absolute-child-path.react-router-no-invalid-lazy-route-properties.react-router-no-invalid-splat-path.react-router-no-loader-request-body.react-router-no-middleware-response-body-consumption.react-router-no-multiple-blockers.react-router-no-multiple-middleware-next.react-router-no-multiple-set-search-params-in-tick.react-router-no-navigate-in-render.react-router-no-nested-router.react-router-no-redirect-in-try-catch.react-router-no-route-module-environment-suffix.react-router-no-router-in-render.react-router-no-session-mutation-in-loader.react-router-no-static-cookie-expires.react-router-no-unsynchronized-search-params-mutation.react-router-no-use-loader-data-in-error-ui.react-router-prefer-route-lazy.react-router-require-root-error-boundary.react-router-resource-link-requires-reload.react-router-return-navigation-promise-in-transition.react-router-server-middleware-return-response.react-router-session-mutation-requires-commit.react-router-v8-no-meta-data-field.react-router-v8-no-react-router-dom-import.react-router-v8-no-removed-future-flags.react-router-valid-route-object`.split(`.`),se=new Set([`@react-router/cloudflare`,`@react-router/node`,`react-router/dom`,`react-router-dom`,`react-router`]),ce=new Set([`flash`,`set`,`unset`]),le=new Set([`createCookieSessionStorage`,`createFileSessionStorage`,`createMemorySessionStorage`,`createSessionStorage`,`createWorkersKVSessionStorage`]),ue=new Set([`createBrowserRouter`,`createHashRouter`,`createMemoryRouter`]),de=new Set([`append`,`delete`,`set`,`sort`]),fe=new Set([`caseSensitive`,`children`,`id`,`index`,`lazy`,`path`]),pe=new Set([`arrayBuffer`,`blob`,`bytes`,`formData`,`json`,`text`]),me=new Set([`unstable_previewServerPrerendering`,`v8_middleware`,`v8_passThroughRequests`,`v8_splitRouteModules`,`v8_trailingSlashAwareDataRequests`,`v8_viteEnvironmentApi`]),he=new Set([`BrowserRouter`,`HashRouter`,`MemoryRouter`,`Router`,`RouterProvider`]),ge=new Set([...ne,`client-passive-event-listeners`,`effect-needs-cleanup`,`effect-listener-cleanup-reference-mismatch`,`anchor-target-exists`,`exhaustive-deps`,`no-barrel-import`,`nextjs-async-dynamic-api-not-awaited`,`nextjs-missing-metadata`,`nextjs-no-img-element`,`nextjs-no-use-search-params-without-suspense`,`no-dynamic-import-path`,`no-full-lodash-import`,`no-hydration-branch-on-browser-global`,`no-img-without-dimensions`,`no-indeterminate-attribute`,`no-loading-flag-reset-outside-finally`,`no-locale-format-in-render`,`no-match-media-in-state-initializer`,`no-create-ref-in-function-component`,`no-reset-all-state-on-prop-change`,`no-side-effect-in-state-updater-function`,`no-adjust-state-on-prop-change`,`no-set-state-after-await-in-effect`,`no-derived-state`,`no-derived-state-effect`,`no-event-handler`,`no-initialize-state`,`no-mutating-reducer-state`,`only-export-components`,`no-unguarded-browser-global-at-module-scope`,`no-unguarded-browser-global-in-render-or-hook-init`,`window-open-without-noopener`,`prefer-dynamic-import`,`rendering-hydration-mismatch-time`,`rendering-hydration-no-flicker`,`remotion-calculate-metadata-fetch-signal`,`remotion-deterministic-randomness`,`remotion-no-css-animation`,`remotion-no-css-transition`,`remotion-no-css-url-assets`,`remotion-no-native-media-elements`,`remotion-no-next-image`,`rerender-memo-with-default-value`,`rules-of-hooks`,`server-sequential-independent-await`,`rn-no-deprecated-modules`,`rn-no-legacy-shadow-styles`,`rn-no-raw-text`,`rn-prefer-expo-image`,`rn-style-prefer-boxshadow`,...oe]),b=(e,t)=>typeof e==`object`&&!!e&&e.type===t,_e=e=>{if(e.kind!==`import`)return null;let t=e.declarationNode.parent;return b(t,`ImportDeclaration`)?t:null},x=e=>{if(!b(e,`ImportSpecifier`))return;let t=e.imported;if(b(t,`Identifier`))return t.name;if(b(t,`Literal`)&&typeof t.value==`string`)return t.value},S=(e,t={})=>{if(!b(e,`Property`)&&!b(e,`MethodDefinition`)&&!b(e,`PropertyDefinition`)&&!b(e,`MemberExpression`))return null;let n=b(e,`MemberExpression`)?e.property:e.key;if(e.computed)return t.allowComputedString&&b(n,`Literal`)&&typeof n.value==`string`?n.value:t.allowComputedString&&t.stringifyNonStringLiterals&&b(n,`Literal`)?String(n.value):t.allowComputedString&&b(n,`TemplateLiteral`)&&n.expressions.length===0?n.quasis[0]?.value.cooked??n.quasis[0]?.value.raw??null:null;if(b(n,`Identifier`))return n.name;if(b(n,`Literal`)){if(typeof n.value==`string`)return n.value;if(t.stringifyNonStringLiterals)return String(n.value)}return null},C=e=>{let t=e.property;return!e.computed&&b(t,`Identifier`)?t.name:e.computed&&b(t,`Literal`)?typeof t.value==`string`?t.value:null:e.computed&&b(t,`TemplateLiteral`)&&t.expressions.length===0?t.quasis[0]?.value.cooked??t.quasis[0]?.value.raw??null:null},ve=new Set([`ParenthesizedExpression`,`TSAsExpression`,`TSSatisfiesExpression`,`TSTypeAssertion`,`TSNonNullExpression`,`TSInstantiationExpression`,`ChainExpression`]),w=e=>{let t=e;for(;;)switch(t.type){case`ParenthesizedExpression`:case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSTypeAssertion`:case`TSNonNullExpression`:case`TSInstantiationExpression`:case`ChainExpression`:if(!(`expression`in t)||!t.expression)return t;t=t.expression;break;default:return t}},ye=e=>{let t=_e(e);if(!t||typeof t.source.value!=`string`||t.importKind===`type`||b(e.declarationNode,`ImportSpecifier`)&&e.declarationNode.importKind===`type`)return null;if(b(e.declarationNode,`ImportNamespaceSpecifier`))return{source:t.source.value,importedName:null,isNamespace:!0};if(b(e.declarationNode,`ImportDefaultSpecifier`))return{source:t.source.value,importedName:`default`,isNamespace:!1};let n=x(e.declarationNode);return n?{source:t.source.value,importedName:n,isNamespace:!1}:null},be=(e,t,n)=>{let r=t.symbolFor(e);if(!r||n.has(r.id))return null;if(r.kind===`import`)return ye(r);if(r.kind!==`const`||!r.initializer)return null;if(n.add(r.id),b(r.declarationNode,`VariableDeclarator`)&&b(r.declarationNode.id,`ObjectPattern`)){let e=xe(r.initializer,t,n);if(!e||!e.isNamespace&&e.importedName!==`default`)return null;for(let t of r.declarationNode.id.properties){if(!b(t,`Property`)||(b(t.value,`AssignmentPattern`)?t.value.left:t.value)!==r.bindingIdentifier)continue;let n=S(t,{allowComputedString:!0});return n?{source:e.source,importedName:n,isNamespace:!1}:null}return null}return xe(r.initializer,t,n)},xe=(e,t,n=new Set)=>{let r=w(e);if(b(r,`Identifier`))return be(r,t,n);if(!b(r,`MemberExpression`))return null;let i=C(r);if(!i)return null;let a=xe(r.object,t,n);return!a||!a.isNamespace&&a.importedName!==`default`?null:{source:a.source,importedName:i,isNamespace:!1}};let T=null;const Se=e=>{T?.existencePaths.add(e)},E=e=>{T?.contentPaths.add(e)},Ce=()=>T!==null,we=e=>{let t=T,n={existencePaths:new Set,contentPaths:new Set};T=n;try{return{value:e(),trace:n}}finally{if(T=t,t!==null){for(let e of n.existencePaths)t.existencePaths.add(e);for(let e of n.contentPaths)t.contentPaths.add(e)}}},Te=e=>{if(T!==null){for(let t of e.existencePaths)T.existencePaths.add(t);for(let t of e.contentPaths)T.contentPaths.add(t)}},Ee=e=>we(e).trace,De=new Map,Oe=new Map;let ke=0;const Ae=()=>{De.clear(),Oe.clear(),ke+=1},je=()=>ke,Me=t=>{if(!t)return null;let r=n.dirname(t),i=De.get(r);if(i!==void 0){if(Ce()){let e=r;for(;Se(n.join(e,`package.json`)),e!==i;){let t=n.dirname(e);if(t===e)break;e=t}}return i}let a=r;for(;;){let t=n.join(a,`package.json`);Se(t);let i=!1;try{i=e.statSync(t,{throwIfNoEntry:!1})?.isFile()??!1}catch{i=!1}if(i)return De.set(r,a),a;let o=n.dirname(a);if(o===a)return De.set(r,null),null;a=o}},Ne=e=>{let t=Me(e);return t?Pe(t):null},Pe=t=>{let r=Oe.get(t);if(r!==void 0&&!Ce())return r;let i=n.join(t,`package.json`);if(E(i),r!==void 0)return r;let a=null;try{let t=JSON.parse(e.readFileSync(i,`utf-8`));typeof t==`object`&&t&&(a=t)}catch{a=null}return Oe.set(t,a),a},Fe=e=>{let t=e.match(/^(\d+)(?:\.(\d+))?(?:\.(\d+))?(-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/);return t?{major:Number(t[1]),minor:Number(t[2]??0),patch:Number(t[3]??0),isPrerelease:!!t[4]}:null},Ie=(e,t)=>e.major-t.major||e.minor-t.minor||e.patch-t.patch||Number(t.isPrerelease)-Number(e.isPrerelease),Le=new Map;let Re=je();const ze=e=>{if(typeof e!=`string`)return null;let t=e.trim();if(!t||/^(?:catalog|file|git|https?|link|npm|workspace):/.test(t)||/^(?:latest|next|\*)$/.test(t))return null;let n=[];for(let e of t.split(`||`)){let t=e.trim();if(/^<(?!=)/.test(t)||/^<=/.test(t))return null;let r=t.match(/\d+(?:\.\d+)?(?:\.\d+)?(?:-[0-9A-Za-z.-]+)?/)?.[0];if(!r)return null;let i=Fe(r);if(!i)return null;n.push(i)}return n.reduce((e,t)=>Ie(t,e)<0?t:e)},Be=(e,t)=>{let n=e.dependencies?.[t]??e.devDependencies?.[t]??e.peerDependencies?.[t]??e.optionalDependencies?.[t],r=ze(n);return r&&typeof n==`string`?{version:r,declaredRange:n}:null},Ve=(e,t)=>{let r=e;for(;;){let e=Pe(n.join(r,`node_modules`,t));if(e)return{didFindPackage:!0,version:typeof e.version==`string`?Fe(e.version):null};let i=n.dirname(r);if(i===r)return{didFindPackage:!1,version:null};r=i}},He=(e,t)=>{let n=Ve(e,t);if(n.didFindPackage)return n.version?{version:n.version,declaredRange:null}:null;let r=Pe(e);return r?Be(r,t):null},Ue=(e,t)=>{if(!e)return null;let r=Me(n.resolve(e));if(!r)return null;let i=je();i!==Re&&(Le.clear(),Re=i);let a=JSON.stringify([r,t]),o=Le.get(a);if(o)return Te(o.trace),o.version;let{value:s,trace:c}=we(()=>He(r,t));return Le.set(a,{version:s,trace:c}),s},We=new Set([`implements`,`returnType`,`superTypeArguments`,`superTypeParameters`,`typeAnnotation`,`typeArguments`,`typeParameters`]),Ge={...o,...r,ArrayPattern:[`decorators`,...r.ArrayPattern],AssignmentPattern:[`decorators`,...r.AssignmentPattern],ClassDeclaration:[`decorators`,...r.ClassDeclaration],ClassExpression:[`decorators`,...r.ClassExpression],Identifier:[`decorators`,...r.Identifier],MethodDefinition:[`decorators`,...r.MethodDefinition],ObjectPattern:[`decorators`,...r.ObjectPattern],PropertyDefinition:[`decorators`,...r.PropertyDefinition],RestElement:[`decorators`,...r.RestElement]},Ke=new Map,qe=e=>e.filter(e=>e!==`parent`&&!We.has(e)),Je=e=>{let t=Ke.get(e.type);if(t)return t;let n=Ge[e.type];if(!n)return qe(Object.keys(e));let r=qe(n);return Ke.set(e.type,r),r},D=e=>typeof e==`object`&&!!e&&typeof e.type==`string`,O=e=>e!=null&&(e.type===`ArrowFunctionExpression`||e.type===`FunctionExpression`||e.type===`FunctionDeclaration`),Ye=e=>e===`var`||e===`function`,Xe=e=>{let t=e;for(;t;){if(t.kind===`module`||t.kind===`function`||t.kind===`arrow-function`||t.kind===`method`)return t;t=t.parent}return e},Ze=(e,t,n,r)=>{let i={id:r.nextScopeId++,kind:e,node:t,parent:n,children:[],symbols:[],references:[],symbolsByName:new Map};return n&&n.children.push(i),i},Qe=(e,t,n)=>{let r=Ze(e,t,n.currentScope,n);return n.scopeStack.push(r),n.currentScope=r,n.ownScopeForNode.set(t,r),r},$e=e=>{e.scopeStack.pop();let t=e.scopeStack[e.scopeStack.length-1];if(!t)throw Error(`scope stack underflow`);e.currentScope=t},et=(e,t,n)=>{let r={id:t.nextSymbolId++,name:n.name,kind:n.kind,bindingIdentifier:n.bindingIdentifier,declarationNode:n.declarationNode,scope:e,initializer:n.initializer,references:[]};return e.symbols.push(r),e.symbolsByName.set(n.name,r),t.symbolByBindingIdentifier.set(n.bindingIdentifier,r),r},tt=(e,t,n,r,i,a)=>{if(b(e,`Identifier`)){et(n,r,{name:e.name,kind:i,bindingIdentifier:e,declarationNode:a,initializer:t});return}if(b(e,`ObjectPattern`)){for(let o of e.properties)if(b(o,`Property`)){let e=o.value;tt(e,b(e,`AssignmentPattern`)?e.right:t,n,r,i,a)}else b(o,`RestElement`)&&tt(o.argument,t,n,r,i,a);return}if(b(e,`ArrayPattern`)){for(let o of e.elements)o&&tt(o,b(o,`AssignmentPattern`)?o.right??null:t,n,r,i,a);return}if(b(e,`AssignmentPattern`)){tt(e.left,e.right??null,n,r,i,a);return}b(e,`RestElement`)&&tt(e.argument,null,n,r,i,a)},nt=(e,t,n)=>{let r={id:e.nextReferenceId++,identifier:t,resolvedSymbol:null,flag:n,scope:e.currentScope};e.currentScope.references.push(r),e.referenceByIdentifier.set(t,r)},rt=e=>e.parent?O(e.parent):!1,it=e=>e.parent!==null&&e.parent!==void 0&&e.parent.type===`CatchClause`,at=(e,t)=>{if(!b(e,`VariableDeclaration`))return;let n=e.kind===`var`?`var`:e.kind===`let`?`let`:e.kind===`const`?`const`:`using`,r=Ye(n)?Xe(t.currentScope):t.currentScope;for(let i of e.declarations){let e=i,a=i.init??null;tt(i.id,a,r,t,n,e)}},ot=(e,t)=>{b(e,`FunctionDeclaration`)&&e.id&&et(Xe(t.currentScope),t,{name:e.id.name,kind:`function`,bindingIdentifier:e.id,declarationNode:e,initializer:e})},st=(e,t)=>{b(e,`ClassDeclaration`)&&e.id&&et(t.currentScope,t,{name:e.id.name,kind:`class`,bindingIdentifier:e.id,declarationNode:e,initializer:e})},ct=(e,t)=>{if(!b(e,`ImportDeclaration`))return;let n=Xe(t.currentScope);for(let r of e.specifiers){let e=r.local;b(e,`Identifier`)&&et(n,t,{name:e.name,kind:`import`,bindingIdentifier:e,declarationNode:r,initializer:r})}},lt=(e,t)=>{if(e.type!==`TSImportEqualsDeclaration`&&e.type!==`TSEnumDeclaration`&&e.type!==`TSTypeAliasDeclaration`&&e.type!==`TSInterfaceDeclaration`&&e.type!==`TSModuleDeclaration`)return;let n=e.id;if(!n||!b(n,`Identifier`))return;let r=e.type===`TSImportEqualsDeclaration`?`ts-import-equals`:e.type===`TSEnumDeclaration`?`ts-enum`:e.type===`TSTypeAliasDeclaration`?`ts-type-alias`:e.type===`TSInterfaceDeclaration`?`ts-interface`:`ts-module`;et(Xe(t.currentScope),t,{name:n.name,kind:r,bindingIdentifier:n,declarationNode:e,initializer:null})},ut=(e,t,n)=>{for(let r of e)tt(r,null,t,n,`parameter`,r)},dt=e=>!(!b(e,`BlockStatement`)||rt(e)||it(e)||e.parent&&e.parent.type===`TSModuleDeclaration`),ft=e=>{let t=e.parent;if(!t)return!1;if(t.type===`JSXMemberExpression`)return t.object===e;if(t.type===`JSXNamespacedName`)return!1;let n=e.name.charCodeAt(0);return!(n>=97&&n<=122)},pt=e=>{let t=e.parent;if(!t)return!1;switch(t.type){case`MemberExpression`:return t.property===e&&!t.computed;case`Property`:return t.key===e&&!t.computed&&!t.shorthand;case`MethodDefinition`:case`PropertyDefinition`:return t.key===e&&!t.computed;case`JSXAttribute`:return t.name===e;case`ImportSpecifier`:return t.imported===e;case`ExportSpecifier`:return t.exported===e&&t.local!==t.exported;case`LabeledStatement`:case`BreakStatement`:case`ContinueStatement`:return t.label===e;default:return!1}},mt=e=>{let t=e.parent;if(!t)return`read`;switch(t.type){case`AssignmentExpression`:return t.left===e?t.operator===`=`?`write`:`read-write`:`read`;case`UpdateExpression`:return`read-write`;case`ForInStatement`:case`ForOfStatement`:return t.left===e?`write`:`read`;default:return`read`}},ht=(e,t)=>{t.nodeScope.set(e,t.currentScope)},gt=(e,t,n)=>{let r=Qe(e,t,n);return ht(t,n),r},_t=(e,t,n)=>{if(e.type===`AssignmentPattern`){_t(e.left,t,n);let r=e.right??null;r&&k(r,t,n);return}if(e.type===`ObjectPattern`){for(let r of e.properties){let e=r;if(e.type===`RestElement`){_t(e.argument,t,n);continue}if(e.type!==`Property`)continue;let i=e;i.computed&&k(i.key,t,n),_t(i.value,t,n)}return}if(e.type===`ArrayPattern`){for(let r of e.elements)r&&_t(r,t,n);return}e.type===`RestElement`&&_t(e.argument,t,n)},k=(e,t,n)=>{if(e.type===`ArrowFunctionExpression`||e.type===`FunctionExpression`||e.type===`FunctionDeclaration`){e.type===`FunctionDeclaration`&&e.id&&ot(e,t);let n=e.params??[],r=t.currentScope;for(let e of n)if(!(!(`decorators`in e)||!Array.isArray(e.decorators)))for(let n of e.decorators)D(n)&&k(n,t,r);ht(e,t);let i=Qe(e.type===`ArrowFunctionExpression`?`arrow-function`:`function`,e,t);(e.type===`FunctionExpression`||e.type===`FunctionDeclaration`)&&e.id&&et(i,t,{name:e.id.name,kind:`function`,bindingIdentifier:e.id,declarationNode:e,initializer:e}),ut(n,i,t);for(let e of n)_t(e,t,r);let a=e.body;a&&k(a,t,r),$e(t);return}if(e.type===`ClassDeclaration`||e.type===`ClassExpression`){if(e.type===`ClassDeclaration`&&e.id&&st(e,t),Array.isArray(e.decorators))for(let n of e.decorators)D(n)&&k(n,t,null);let n=gt(`class`,e,t);e.type===`ClassExpression`&&e.id&&et(n,t,{name:e.id.name,kind:`class`,bindingIdentifier:e.id,declarationNode:e,initializer:e}),e.superClass&&k(e.superClass,t,n),e.body&&k(e.body,t,n),$e(t);return}if(e.type===`CatchClause`){let n=gt(`catch`,e,t);e.param&&tt(e.param,null,n,t,`catch-clause-parameter`,e),e.body&&k(e.body,t,n),$e(t);return}if(e.type===`ForStatement`||e.type===`ForInStatement`||e.type===`ForOfStatement`){gt(`for`,e,t),vt(e,t),$e(t);return}if(e.type===`SwitchStatement`){let n=gt(`switch`,e,t);e.discriminant&&k(e.discriminant,t,n);for(let r of e.cases)k(r,t,n);$e(t);return}if(e.type===`TSModuleDeclaration`){let n=gt(`ts-module`,e,t);if(e.id&&b(e.id,`Identifier`)){let r=e.id;et(Xe(n.parent??t.currentScope),t,{name:r.name,kind:`ts-module`,bindingIdentifier:r,declarationNode:e,initializer:null})}e.body&&k(e.body,t,n),$e(t);return}if(e.type===`TSEnumDeclaration`){lt(e,t);let n=gt(`ts-enum`,e,t),r=e.members??[];for(let e of r)k(e,t,n);$e(t);return}if(e.type===`BlockStatement`&&dt(e)){let n=gt(`block`,e,t);for(let r of e.body)k(r,t,n);$e(t);return}switch(t.currentScope!==n&&ht(e,t),e.type){case`VariableDeclaration`:at(e,t);break;case`ImportDeclaration`:ct(e,t);break;case`TSImportEqualsDeclaration`:case`TSTypeAliasDeclaration`:case`TSInterfaceDeclaration`:lt(e,t);break}(e.type===`Identifier`||e.type===`JSXIdentifier`)&&!t.symbolByBindingIdentifier.has(e)&&!pt(e)&&(e.type===`JSXIdentifier`?ft(e)&&nt(t,e,mt(e)):nt(t,e,mt(e))),vt(e,t)},vt=(e,t)=>{let n=e,r=t.currentScope;for(let i of Je(e)){let e=n[i];if(Array.isArray(e))for(let n of e)D(n)&&k(n,t,r);else D(e)&&k(e,t,r)}},yt=e=>{let t=e=>{for(let t of e.references){let n=t.identifier.name;if(typeof n!=`string`)continue;let r=e;for(;r;){let e=r.symbolsByName.get(n);if(e){t.resolvedSymbol=e,e.references.push(t);break}r=r.parent}}for(let n of e.children)t(n)};t(e)},A=e=>{let t={id:0,kind:`module`,node:e,parent:null,children:[],symbols:[],references:[],symbolsByName:new Map},n={nextScopeId:1,nextSymbolId:0,nextReferenceId:0,currentScope:t,scopeStack:[t],rootScope:t,nodeScope:new WeakMap,ownScopeForNode:new WeakMap,symbolByBindingIdentifier:new WeakMap,referenceByIdentifier:new WeakMap};if(n.nodeScope.set(e,t),n.ownScopeForNode.set(e,t),e.type===`Program`)for(let r of e.body)k(r,n,t);else k(e,n,t);return yt(t),{rootScope:t,scopeFor:e=>{let r=e;for(;r;){let e=n.nodeScope.get(r);if(e)return e;r=r.parent??null}return t},ownScopeFor:e=>n.ownScopeForNode.get(e)??null,symbolFor:e=>{let t=n.referenceByIdentifier.get(e);return t?t.resolvedSymbol:n.symbolByBindingIdentifier.get(e)||null},referenceFor:e=>n.referenceByIdentifier.get(e)??null,isGlobalReference:e=>{let t=n.referenceByIdentifier.get(e);return t?t.resolvedSymbol===null:!1}}},bt=(e,t)=>{let n=e;for(;n;){if(n===t)return!0;n=n.parent}return!1},xt=1024,St=2e6,Ct=1e3,j=e=>{let t=e.parent;for(;t;){if(O(t))return t;t=t.parent??null}return null},wt=e=>b(e,`Identifier`)?e.name:b(e,`Literal`)&&typeof e.value==`string`?e.value:null,Tt=e=>{if(b(e,`ImportSpecifier`)){let t=e.imported;return b(t,`Identifier`)?t.name:b(t,`Literal`)&&typeof t.value==`string`?t.value:null}return b(e,`ImportDefaultSpecifier`)?`default`:null},Et=(e,t)=>{if(!b(e,`ExportNamedDeclaration`)||!e.source||e.exportKind===`type`)return null;let n=e.source.value;if(typeof n!=`string`)return null;for(let r of e.specifiers??[]){let e=Dt(r,t,n);if(e)return e}return null},Dt=(e,t,n)=>{if(!b(e,`ExportSpecifier`)||e.exportKind===`type`||wt(e.exported)!==t)return null;let r=wt(e.local);return r?{importedName:r,source:n}:null},Ot=(e,t)=>{if(!b(e,`ExportAllDeclaration`)||!e.source||e.exportKind===`type`||e.exported)return null;let n=e.source.value;return typeof n==`string`?{importedName:t,source:n}:null},kt=(e,t)=>{if(!b(e,`Program`))return[];let n=[];for(let r of e.body??[]){let e=Et(r,t);if(e)return[e];let i=Ot(r,t);i&&n.push(i)}return n},M=(e,t)=>{if(e){if(b(e,`Identifier`)){t.add(e.name);return}if(b(e,`AssignmentPattern`)){M(e.left,t);return}if(b(e,`RestElement`)){M(e.argument,t);return}if(b(e,`ArrayPattern`)){for(let n of e.elements??[])M(n,t);return}if(b(e,`ObjectPattern`))for(let n of e.properties??[]){if(b(n,`RestElement`)){M(n.argument,t);continue}b(n,`Property`)&&M(n.value,t)}}},At=(e,t,n)=>{if(e&&!b(e,`Identifier`)){if(b(e,`AssignmentPattern`)){N(e.right,t,n),At(e.left,t,n);return}if(b(e,`RestElement`)){At(e.argument,t,n);return}if(b(e,`ArrayPattern`)){for(let r of e.elements??[])At(r,t,n);return}if(b(e,`ObjectPattern`))for(let r of e.properties??[]){if(b(r,`RestElement`)){At(r.argument,t,n);continue}b(r,`Property`)&&(r.computed&&N(r.key,t,n),At(r.value,t,n))}}},jt=(e,t,n)=>{if(!b(e,`FunctionDeclaration`)&&!b(e,`FunctionExpression`)&&!b(e,`ArrowFunctionExpression`))return;let r=new Set(n);for(let t of e.params??[])M(t,r);for(let n of e.params??[])At(n,t,r);N(e.body,t,r)},N=(e,t,n)=>{if(!e)return;if(b(e,`Identifier`)){n.has(e.name)||t.add(e.name);return}if(b(e,`MemberExpression`)){N(e.object,t,n),e.computed&&N(e.property,t,n);return}if(b(e,`Property`)){e.computed&&N(e.key,t,n),N(e.value,t,n);return}if(b(e,`FunctionDeclaration`)||b(e,`FunctionExpression`)||b(e,`ArrowFunctionExpression`)){jt(e,t,n);return}if(b(e,`TSAsExpression`)||b(e,`TSSatisfiesExpression`)||b(e,`TSTypeAssertion`)||b(e,`TSNonNullExpression`)||b(e,`TSInstantiationExpression`)){N(e.expression,t,n);return}if(typeof e.type==`string`&&e.type.startsWith(`TS`))return;let r=e;for(let e of Object.keys(r)){if(e===`parent`||We.has(e))continue;let i=r[e];if(Array.isArray(i))for(let e of i)D(e)&&N(e,t,n);else D(i)&&N(i,t,n)}},Mt=(e,t)=>N(e,t,new Set),Nt=e=>{let t=[],n=new Set;if(b(e,`VariableDeclaration`))for(let r of e.declarations??[])b(r.init,`AwaitExpression`)&&(r.init.argument&&t.push(r.init.argument),M(r.id,n));else if(b(e,`ExpressionStatement`)){let r=e.expression;b(r,`AwaitExpression`)?r.argument&&t.push(r.argument):b(r,`AssignmentExpression`)&&b(r.right,`AwaitExpression`)&&(r.right.argument&&t.push(r.right.argument),b(r.left,`Identifier`)&&n.add(r.left.name))}else b(e,`ReturnStatement`)&&b(e.argument,`AwaitExpression`)?e.argument.argument&&t.push(e.argument.argument):b(e,`ForOfStatement`)&&e.await&&(e.right&&t.push(e.right),M(b(e.left,`VariableDeclaration`)?e.left.declarations?.[0]?.id??null:e.left,n));return t.length===0?null:{awaitedExpressions:t,boundNames:[...n]}},Pt=(e,t)=>{if(b(e,`VariableDeclaration`))for(let n of e.declarations??[])M(n.id,t)},Ft=(e,t,n)=>{let r=new Map,i=[];for(let a of e.body??[]){let e=Nt(a);if(!e){let e=new Set;if(Pt(a,e),e.size===0)continue;let t=new Set;Mt(a,t);let n=new Set;for(let e of t)for(let t of r.get(e)??[])n.add(t);if(n.size===0)continue;for(let t of e)r.set(t,n);continue}if(n&&!e.awaitedExpressions.every(e=>n(e))){r.clear(),i.length=0;continue}let o=new Set;for(let t of e.awaitedExpressions)Mt(t,o);let s=new Set;for(let e of o)for(let t of r.get(e)??[])s.add(t);if(i.filter((e,t)=>!s.has(t)).length+1>=t)return a;let c=i.length;i.push(s);let l=new Set(s);l.add(c);for(let t of e.boundNames)r.set(t,l)}return null},P=e=>{let t=e;for(;t.parent&&ve.has(t.parent.type);)t=t.parent;return t},It=e=>{if(b(e,`FunctionDeclaration`)&&b(e.id,`Identifier`))return e.id;let t=P(e),n=t.parent;return b(n,`VariableDeclarator`)&&n.init===t&&b(n.id,`Identifier`)?n.id:null},Lt=e=>{let t=P(e);return!!(t.parent&&b(t.parent,`AwaitExpression`)&&t.parent.argument===t)},F=(e,t,n=!1)=>{if(e.type!==`Identifier`&&e.type!==`JSXIdentifier`)return null;let r=null,i=t.symbolFor(e);for(;i?.kind===`const`;){if(!i.initializer||i.declarationNode.type!==`VariableDeclarator`)return null;if(i.declarationNode.id!==i.bindingIdentifier)return n?i:null;let e=w(i.initializer);if(e.type!==`Identifier`)return i;if(r?.has(i.id))return null;r||=new Set,r.add(i.id),i=t.symbolFor(e)}return i},Rt=(e,t)=>{if(!O(e)||e.async||!b(e.body,`BlockStatement`))return!1;let[n,r,i,a,o]=e.body.body.toReversed();if(!b(o,`VariableDeclaration`)||o.kind!==`const`||o.declarations.length!==1||!b(a,`IfStatement`)||a.alternate||!b(i,`VariableDeclaration`)||i.kind!==`const`||i.declarations.length!==1||!b(r,`ExpressionStatement`)||!b(n,`ReturnStatement`))return!1;let s=o.declarations[0],c=i.declarations[0];if(!s?.init||!c?.init||!n.argument)return!1;let l=w(s.init),u=w(r.expression);if(!b(l,`CallExpression`)||!b(u,`CallExpression`)||!b(l.callee,`MemberExpression`)||!b(u.callee,`MemberExpression`)||l.optional||u.optional||l.callee.optional||u.callee.optional||C(l.callee)!==`get`||C(u.callee)!==`set`||l.arguments.length!==1||u.arguments.length!==2)return!1;let d=F(l.callee.object,t);if(d?.kind!==`const`||!d.initializer||j(d.bindingIdentifier)||F(u.callee.object,t)!==d)return!1;let f=w(d.initializer);if(!b(f,`NewExpression`)||!b(f.callee,`Identifier`)||![`Map`,`WeakMap`].includes(f.callee.name)||!t.isGlobalReference(f.callee)||f.arguments.length!==0)return!1;let p=a.consequent;if(b(p,`BlockStatement`)){if(p.body.length!==1)return!1;p=p.body[0]}let m=t.symbolFor(s.id),h=t.symbolFor(c.id),g=l.arguments[0],_=u.arguments[0],v=u.arguments[1];if(!m||!h||!b(p,`ReturnStatement`)||!p.argument||!g||!_||!v||t.symbolFor(w(a.test))!==m||t.symbolFor(w(p.argument))!==m||t.symbolFor(w(v))!==h||t.symbolFor(w(n.argument))!==h)return!1;let y=F(w(g),t);if(!y||y.references.some(e=>e.flag!==`read`)||y.kind!==`parameter`||j(y.bindingIdentifier)!==e||F(w(_),t)!==y)return!1;let ee=l.callee.object,te=u.callee.object;return d.references.every(e=>e.flag===`read`&&(e.identifier===ee||e.identifier===te))},zt=e=>{let t=e;for(;t;){if(b(t,`Program`))return t;t=t.parent??null}return null},Bt=new WeakMap,Vt=(e,t)=>{t.push(...e.symbols);for(let n of e.children)Vt(n,t)},Ht=e=>{let t=new Map,n=[];Vt(e.rootScope,n);for(let r of n){let n=F(r.bindingIdentifier,e);if(!n)continue;let i=t.get(n.id)??[];i.push(r),t.set(n.id,i)}return t},Ut=(e,t)=>{let n=F(e,t);if(!n)return[];let r=Bt.get(t);return r||(r=Ht(t),Bt.set(t,r)),r.get(n.id)??[]},Wt=e=>{let t=e.expressions??[],n=e.quasis??[];if(t.length!==0||n.length!==1)return null;let r=n[0]?.value;return r?.cooked??r?.raw??null},I=(e,t,n={})=>{let r=S(e,{allowComputedString:!0,stringifyNonStringLiterals:n.stringifyNonStringLiterals});if(r!==null||!b(e,`Property`)&&!b(e,`MethodDefinition`)&&!b(e,`PropertyDefinition`)&&!b(e,`MemberExpression`)||!e.computed)return r;let i=w(b(e,`MemberExpression`)?e.property:e.key);if(!b(i,`Identifier`))return null;let a=F(i,t);if(a?.kind!==`const`||!a.initializer)return null;let o=w(a.initializer);return b(o,`Literal`)?typeof o.value==`string`?o.value:n.allowConstNumericLiteral&&typeof o.value==`number`?String(o.value):null:n.allowConstTemplateLiteral&&b(o,`TemplateLiteral`)?Wt(o):null},Gt=e=>{if(!O(e))return null;if(!b(e.body,`BlockStatement`))return e.body;if(e.body.body.length!==1)return null;let t=e.body.body[0];return b(t,`ReturnStatement`)&&t.argument?t.argument:null},Kt=new Set([`CatchClause`,`ConditionalExpression`,`DoWhileStatement`,`ForInStatement`,`ForOfStatement`,`ForStatement`,`IfStatement`,`LogicalExpression`,`SwitchCase`,`SwitchStatement`,`TryStatement`,`WhileStatement`]),qt=(e,t)=>{let n=e.parent??null;for(;n&&n!==t;){if(Kt.has(n.type))return!1;n=n.parent??null}return n===t},Jt=e=>j(e)??zt(e),Yt=e=>{let t=P(e),n=t.parent;return!!(n&&b(n,`VariableDeclarator`)&&n.init===t&&n.parent&&b(n.parent,`VariableDeclaration`)&&n.parent.kind===`const`)},Xt=e=>{let t=P(e),n=t.parent;return!!(n&&(b(n,`AssignmentExpression`)&&n.left===t||b(n,`UpdateExpression`)&&n.argument===t||b(n,`UnaryExpression`)&&n.operator===`delete`&&n.argument===t))},Zt=e=>{let t=P(e),n=t.parent;return n&&b(n,`MemberExpression`)&&w(n.object)===t?n:null},Qt=(e,t,n,r,i)=>{if(i<=0||!b(e,`ObjectExpression`))return null;for(let a of e.properties.toReversed()){if(!b(a,`Property`))return null;let e=I(a,n);if(e===null)return null;if(e===t)return a.kind===`init`?L(a.value,n,r,i-1):null}return null},$t=(e,t,n,r,i)=>{if(i<=0||!b(e,`ObjectExpression`))return[];let a=[],o=new Set;for(let s of e.properties){if(!b(s,`Property`))continue;let e=I(s,n),c=s.kind===`init`||s.kind===`get`?L(s.value,n,new Set(r),i-1):null;e===t?(a=c?[c]:[],o.clear(),c&&o.add(c)):e===null&&c&&!o.has(c)&&(a.push(c),o.add(c))}return a},en=(e,t,n,r,i)=>{if(i<=0||!b(e,`ClassDeclaration`)&&!b(e,`ClassExpression`))return null;for(let a of e.body.body.toReversed()){if(!b(a,`MethodDefinition`)&&!b(a,`PropertyDefinition`)||!a.static)continue;let e=I(a,n);if(e===null)return null;if(e===t)return b(a,`MethodDefinition`)&&a.kind!==`method`?null:a.value?L(a.value,n,r,i-1):null}return null},tn=(e,t,n,r,i)=>{if(i<=0||!b(e,`ClassDeclaration`)&&!b(e,`ClassExpression`))return[];let a=[],o=new Set;for(let s of e.body.body){if(!b(s,`MethodDefinition`)&&!b(s,`PropertyDefinition`)||!s.static)continue;let e=I(s,n),c=s.value&&(!b(s,`MethodDefinition`)||s.kind===`method`||s.kind===`get`)?L(s.value,n,new Set(r),i-1):null;e===t?(a=c?[c]:[],o.clear(),c&&o.add(c)):e===null&&c&&!o.has(c)&&(a.push(c),o.add(c))}return a},nn=(e,t,n,r,i,a,o,s)=>{let c=Jt(t);if(s<=0||!c||!b(e,`Identifier`))return{exactFunction:null,possibleFunctions:[]};let l=[];for(let r of Ut(e,a))for(let e of r.references){let r=e.identifier;if(r.range[0]>=t.range[0]||Yt(r))continue;let i=Zt(r);if(!i){Jt(r)===c&&l.push({assignedExpression:null,isDefinite:!1,offset:r.range[0]});continue}if(!Xt(i)||Jt(i)!==c)continue;let o=I(i,a),s=P(i).parent,u=s&&b(s,`AssignmentExpression`)&&s.operator===`=`?s.right:null;if(o===null){l.push({assignedExpression:u,isDefinite:!1,offset:i.range[0]});continue}if(o===n){if(!s||!b(s,`AssignmentExpression`)||s.operator!==`=`||!qt(i,c)){l.push({assignedExpression:u,isDefinite:!1,offset:i.range[0]});continue}l.push({assignedExpression:u,isDefinite:!0,offset:s.range[0]})}}l.sort((e,t)=>e.offset-t.offset);let u=r,d=i,f=new Set(i);for(let e of l){let t=e.assignedExpression?L(e.assignedExpression,a,new Set(o),s-1):null;if(e.isDefinite){u=t,d=t?[t]:[],f.clear(),t&&f.add(t);continue}u=null,t&&!f.has(t)&&(d.push(t),f.add(t))}return{exactFunction:u,possibleFunctions:d}},rn=(e,t,n,r)=>{if(r<=0||!b(e,`MemberExpression`))return{exactFunction:null,possibleFunctions:[]};let i=C(e);if(i===null)return{exactFunction:null,possibleFunctions:[]};let a=w(e.object);if(b(a,`ObjectExpression`))return{exactFunction:Qt(a,i,t,n,r),possibleFunctions:$t(a,i,t,n,r)};if(b(a,`ClassExpression`))return{exactFunction:en(a,i,t,n,r),possibleFunctions:tn(a,i,t,n,r)};if(!b(a,`Identifier`))return{exactFunction:null,possibleFunctions:[]};let o=F(a,t);if(!o||n.has(o.id))return{exactFunction:null,possibleFunctions:[]};n.add(o.id);let s=null,c=[];if(o.kind===`const`&&o.initializer){let e=w(o.initializer);s=Qt(e,i,t,n,r),c=$t(e,i,t,n,r)}else o.kind===`class`&&o.initializer&&(s=en(o.initializer,i,t,n,r),c=tn(o.initializer,i,t,n,r));return nn(a,e,i,s,c,t,n,r)},an=(e,t,n,r)=>{if(r<=0)return[];let i=w(e);if(b(i,`CallExpression`)){let e=w(i.callee);return b(e,`MemberExpression`)&&C(e)===`bind`?an(e.object,t,n,r-1):[]}if(b(i,`MemberExpression`)){let e=C(i);return e===`call`||e===`apply`?an(i.object,t,n,r-1):rn(i,t,n,r).possibleFunctions}let a=L(i,t,n,r);return a?[a]:[]},L=(e,t,n,r)=>{let i=w(e);if(O(i))return i;if(r<=0)return null;if(b(i,`CallExpression`)){let e=w(i.callee);if(b(e,`MemberExpression`)&&C(e)===`bind`)return L(e.object,t,n,r-1);if(!i.arguments.every(e=>b(e,`Literal`)))return null;let a=L(e,t,n,r-1);if(!O(a)||a.async||a.generator||!a.params.every(e=>b(e,`Identifier`)))return null;let o=Gt(a),s=o&&w(o);return O(s)?s:null}if(b(i,`MemberExpression`)){let e=C(i);return e===`call`||e===`apply`?L(i.object,t,n,r-1):rn(i,t,n,r).exactFunction}if(!b(i,`Identifier`))return null;let a=F(i,t);return!a||n.has(a.id)?null:(n.add(a.id),a.kind===`function`?!a.references.some(e=>e.flag!==`read`)&&O(a.declarationNode)?a.declarationNode:null:a.kind!==`const`||!a.initializer?null:L(a.initializer,t,n,r-1))},on=(e,t)=>L(e,t,new Set,15),sn=(e,t)=>an(e,t,new Set,15),cn=(e,t)=>{if(!b(e,`CallExpression`)||!b(e.callee,`MemberExpression`)||C(e.callee)!==`join`)return!1;let n=w(e.callee.object);for(let e=0;e<15;e++){if(b(n,`ArrayExpression`))return!0;if(b(n,`Identifier`)){let e=F(n,t);if(!e?.initializer||e.references.some(e=>e.flag!==`read`))return!1;n=w(e.initializer);continue}if(!b(n,`CallExpression`))return!1;let e=w(n.callee);if(b(e,`MemberExpression`)&&[`map`,`filter`,`slice`].includes(C(e)??``)){n=w(e.object);continue}let r=on(e,t);return!!(O(r)&&!r.async&&b(r.returnType,`TSTypeAnnotation`)&&b(r.returnType.typeAnnotation,`TSArrayType`))}return!1},ln=(e,t)=>{if(!b(e,`Program`))return null;let n=new Map,r=new Map,i=null,a=null,o=e=>{for(let t of e.declarations??[])b(t,`VariableDeclarator`)&&(!b(t.id,`Identifier`)||!t.init||n.set(t.id.name,w(t.init)))};for(let t of e.body??[]){if(b(t,`ImportDeclaration`)){if(t.importKind===`type`)continue;for(let e of t.specifiers??[])b(e,`ImportSpecifier`)&&e.importKind===`type`||(b(e,`ImportDefaultSpecifier`)||b(e,`ImportNamespaceSpecifier`)||b(e,`ImportSpecifier`))&&b(e.local,`Identifier`)&&n.set(e.local.name,e.local);continue}if(b(t,`VariableDeclaration`)){o(t);continue}if(b(t,`FunctionDeclaration`)&&t.id){n.set(t.id.name,t);continue}if(b(t,`ExportNamedDeclaration`)){if(t.exportKind===`type`)continue;let e=t.declaration;if(e&&b(e,`VariableDeclaration`)){o(e);for(let t of e.declarations??[])b(t,`VariableDeclarator`)&&b(t.id,`Identifier`)&&r.set(t.id.name,t.id.name)}else e&&b(e,`FunctionDeclaration`)&&e.id&&(n.set(e.id.name,e),r.set(e.id.name,e.id.name));if(t.source)continue;for(let e of t.specifiers??[]){if(!b(e,`ExportSpecifier`)||e.exportKind===`type`)continue;let t=b(e.local,`Identifier`)?e.local.name:null,n=null;b(e.exported,`Identifier`)?n=e.exported.name:b(e.exported,`Literal`)&&typeof e.exported.value==`string`&&(n=e.exported.value),t&&n&&r.set(n,t)}continue}if(!b(t,`ExportDefaultDeclaration`))continue;let e=t.declaration;e&&(b(e,`Identifier`)?a=e.name:((b(e,`FunctionDeclaration`)||b(e,`ClassDeclaration`))&&e.id&&n.set(e.id.name,e),i=w(e)))}if(t===`default`){if(i)return i;if(a){let e=n.get(a);if(e)return e}}let s=r.get(t);return s?n.get(s)??null:null},un=e=>{let t=(e,n)=>{let r=e;r.parent=n,r.range==null&&typeof r.start==`number`&&typeof r.end==`number`&&(r.range=[r.start,r.end]);let i=e;for(let n in i){if(n===`parent`||!Object.hasOwn(i,n))continue;let r=i[n];if(Array.isArray(r))for(let n=0;n<r.length;n+=1){let i=r[n];D(i)&&t(i,e)}else D(r)&&t(r,e)}};t(e,null)},dn={".ts":`ts`,".tsx":`tsx`,".js":`js`,".jsx":`jsx`,".mjs":`js`,".cjs":`js`,".mts":`ts`,".cts":`ts`},fn=e=>dn[n.extname(e).toLowerCase()]??`tsx`;let pn=process.platform!==`win32`&&a();const mn=(e,t)=>({astType:`ts`,lang:fn(e),experimentalRawTransfer:t}),hn=(e,t)=>{if(pn)try{return i(e,t,mn(e,!0))}catch{pn=!1}return i(e,t,mn(e,!1))},gn=({filename:e,sourceText:t,shouldAttachParentReferences:n=!0})=>{try{let r=hn(e,t);if(r.errors.some(e=>e.severity===`Error`))return null;let i=r.program;return n&&un(i),i}catch{return null}},_n=new Map,vn=(e,t)=>{if(_n.delete(e),_n.set(e,t),_n.size>256){let e=_n.keys().next().value;e!==void 0&&_n.delete(e)}},yn=t=>{t.endsWith(`.d.ts`)||t.endsWith(`.d.mts`)||t.endsWith(`.d.cts`)||E(t);let n;try{n=e.statSync(t,{throwIfNoEntry:!1})}catch{return null}if(!n?.isFile()||n.size>2e6)return null;let r=_n.get(t);if(r&&r.mtimeMs===n.mtimeMs&&r.size===n.size)return vn(t,r),r.program;if(t.endsWith(`.d.ts`)||t.endsWith(`.d.mts`)||t.endsWith(`.d.cts`))return vn(t,{mtimeMs:n.mtimeMs,size:n.size,program:null}),null;let i;try{i=e.readFileSync(t,`utf8`)}catch{return vn(t,{mtimeMs:n.mtimeMs,size:n.size,program:null}),null}let a=gn({filename:t,sourceText:i});return vn(t,{mtimeMs:n.mtimeMs,size:n.size,program:a}),a},bn=[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.mts`,`.cts`],xn=[`import`,`default`,`module`,`browser`,`require`],Sn=[`module`,`main`,`browser`],Cn={isDirectory:!0,isFile:!1},wn={isDirectory:!1,isFile:!0},Tn={isDirectory:!1,isFile:!1},En=new Map,Dn=new Map,On=t=>{Se(t);let n=En.get(t);if(n)return n;let r=Tn;try{let n=e.statSync(t,{throwIfNoEntry:!1});n?.isFile()?r=wn:n?.isDirectory()&&(r=Cn)}catch{return En.set(t,Tn),Tn}return En.set(t,r),r},kn=e=>On(e).isFile?e:null,An=e=>On(e).isDirectory?e:null,jn=e=>{let t=n.extname(e);if(!bn.includes(t))return bn.map(t=>`${e}${t}`);let r=e.slice(0,-t.length);return t===`.js`?[e,`${r}.ts`,`${r}.tsx`,`${r}.jsx`]:t===`.jsx`?[e,`${r}.tsx`]:t===`.mjs`?[e,`${r}.mts`]:t===`.cjs`?[e,`${r}.cts`]:[e]},Mn=e=>typeof e==`object`&&!!e,Nn=e=>{if(typeof e==`string`)return e;if(Array.isArray(e)){for(let t of e){let e=Nn(t);if(e)return e}return null}if(!Mn(e))return null;for(let t of xn){let n=Nn(e[t]);if(n)return n}return null},Pn=e=>{let t=e.exports;return t?Nn(t)||(Mn(t)?Nn(t[`.`]):null):null},Fn=t=>{E(t);let n=Dn.get(t);if(n!==void 0)return n;let r;try{r=JSON.parse(e.readFileSync(t,`utf8`))}catch{r=null}return Dn.set(t,r),r},In=e=>Rn(e)||Rn(n.join(e,`index`)),Ln=e=>{let t=An(e);if(!t)return null;let r=Fn(n.join(t,`package.json`));if(!r)return null;let i=Pn(r)??Sn.map(e=>r[e]).find(e=>typeof e==`string`);return i?In(n.resolve(t,i)):null},Rn=e=>{let t=kn(e);if(t)return t;for(let t of jn(e)){let e=kn(t);if(e)return e}return null},zn=e=>Rn(e)||Ln(e)||Rn(n.join(e,`index`)),Bn=(e,t)=>zn(n.resolve(n.dirname(e),t)),Vn=()=>{En.clear(),Dn.clear()},Hn=[`tsconfig.json`,`jsconfig.json`],Un=e=>typeof e==`object`&&!!e,Wn=e=>{let t=``,n=!1,r=!1,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=e[a+1];if(r){o===`
2
+ `&&(r=!1,t+=o);continue}if(i){o===`*`&&s===`/`&&(i=!1,a++);continue}if(n){t+=o,o===`\\`?(t+=s??``,a++):o===`"`&&(n=!1);continue}if(o===`"`){n=!0,t+=o;continue}if(o===`/`&&s===`/`){r=!0,a++;continue}if(o===`/`&&s===`*`){i=!0,a++;continue}t+=o}return t.replace(/,(\s*[}\]])/g,`$1`)},Gn=(t,n)=>{E(t),n.push(t);let r;try{r=e.readFileSync(t,`utf8`)}catch{return null}try{let e=JSON.parse(Wn(r));return Un(e)?e:null}catch{return null}},Kn=(e,t)=>{let r=e.endsWith(`.json`)?e:`${e}.json`;return e.startsWith(`./`)||e.startsWith(`../`)?n.resolve(t,r):n.join(t,`node_modules`,r)},qn=e=>{let t=new Map;if(!Un(e))return t;for(let[n,r]of Object.entries(e)){if(!Array.isArray(r))continue;let e=r.filter(e=>typeof e==`string`);e.length>0&&t.set(n,e)}return t},Jn=(e,t,r)=>{let i=Gn(e,r);if(!i)return null;let a=n.dirname(e),o=Un(i.compilerOptions)?i.compilerOptions:{},s=typeof o.baseUrl==`string`?o.baseUrl:null,c=s!==null,l=s===null?a:n.resolve(a,s);if(Un(o.paths))return{baseAbsolutePath:l,hasExplicitBaseUrl:c,paths:qn(o.paths)};if(typeof i.extends==`string`&&t<8){let e=Kn(i.extends,a),n=e?Jn(e,t+1,r):null;if(n)return n}return c?{baseAbsolutePath:l,hasExplicitBaseUrl:c,paths:new Map}:null},Yn=new Map,Xn=new Map,Zn=t=>{E(t);let n;try{n=e.statSync(t,{throwIfNoEntry:!1})}catch{n=void 0}if(n===void 0)return{config:null,probedContentPaths:new Set([t])};let r=Yn.get(t);if(r&&r.mtimeMs===n.mtimeMs){for(let e of r.probedChainPaths)E(e);return{config:r.config,probedContentPaths:new Set(r.probedChainPaths)}}let i=[],a=Jn(t,0,i);return Yn.set(t,{mtimeMs:n.mtimeMs,config:a,probedChainPaths:i}),{config:a,probedContentPaths:new Set(i)}},Qn=(e,t,n)=>{let r=new Set(t.probedContentPaths),i=n;for(let n=e.length-1;n>=0;n--){let a=e[n];i++;for(let e of a.probedContentPaths)r.add(e);Xn.set(a.directory,{config:t.config,directoryCount:i,probedContentPaths:new Set(r)})}},$n=e=>{let t=Xn.get(e);if(t!==void 0){for(let e of t.probedContentPaths)E(e);return t.config}let r=[],i=e;for(let e=0;e<30;e++){let t=Xn.get(i),a=30-e;if(t!==void 0&&t.directoryCount<=a){for(let e of t.probedContentPaths)E(e);return Qn(r,t,t.directoryCount),t.config}let o=new Set;for(let e of Hn){let t=Zn(n.join(i,e));for(let e of t.probedContentPaths)o.add(e);if(t.config)return r.push({directory:i,probedContentPaths:o}),Qn(r,{config:t.config,probedContentPaths:new Set},0),t.config}r.push({directory:i,probedContentPaths:o});let s=n.dirname(i);if(s===i)return Qn(r,{config:null,probedContentPaths:new Set},0),null;i=s}let a=new Set;for(let e of r)for(let t of e.probedContentPaths)a.add(t);return Xn.set(e,{config:null,directoryCount:r.length,probedContentPaths:a}),null},er=(e,t)=>{let n=t.indexOf(`*`);if(n===-1)return e===t?``:null;let r=t.slice(0,n),i=t.slice(n+1);return e.length>=r.length+i.length&&e.startsWith(r)&&e.endsWith(i)?e.slice(r.length,e.length-i.length):null},tr=(e,t)=>{let r=$n(n.dirname(e));if(!r)return null;let i=null,a=``,o=-1;for(let e of r.paths.keys()){let n=er(t,e);if(n===null)continue;let r=e.indexOf(`*`),s=r===-1?e.length:r;s>o&&(i=e,a=n,o=s)}if(i)for(let e of r.paths.get(i)??[]){let t=e.replaceAll(`*`,a),i=zn(n.resolve(r.baseAbsolutePath,t));if(i)return i}return r.hasExplicitBaseUrl?zn(n.resolve(r.baseAbsolutePath,t)):null},nr=()=>{Yn.clear(),Xn.clear()},rr=(e,t)=>n.isAbsolute(t)?null:t.startsWith(`.`)?Bn(e,t):tr(e,t),ir=new Map,ar=()=>{ir.clear()},or=(e,t,n)=>{if(n.size>=4||n.has(e))return null;n.add(e);let r=yn(e);if(!r)return null;let i=ln(r,t);if(i)return{filePath:e,exportedNode:i,programNode:r};let a=new Map;for(let i of kt(r,t)){let t=rr(e,i.source);if(!t)continue;let r=or(t,i.importedName,new Set(n));r&&a.set(r.exportedNode,r)}return a.size===1?a.values().next().value??null:null},sr=(e,t,n)=>cr(e,t,n)?.functionNode??null,cr=(e,t,n)=>{let r=R(e,t,n);return!r||!O(r.exportedNode)?null:{filePath:r.filePath,functionNode:r.exportedNode,programNode:r.programNode}},R=(e,t,n)=>{if(!Ce()){let r=rr(e,t);return r?or(r,n,new Set):null}let r=`${e}\0${t}\0${n}`,i=ir.get(r);if(i!==void 0){for(let e of i.trace.contentPaths)E(e);for(let e of i.trace.existencePaths)Se(e);return i.result}let a=we(()=>{let r=rr(e,t);return r?or(r,n,new Set):null});return ir.set(r,{result:a.value,trace:a.trace}),a.value},lr=(e,t)=>{let n=e,r=Ge[e.type];if(r!==void 0){for(let e=r.length-1;e>=0;--e){let i=n[r[e]];if(Array.isArray(i))for(let e=i.length-1;e>=0;--e){let n=i[e];D(n)&&t.push(n)}else D(i)&&t.push(i)}return}let i=Object.keys(n);for(let e=i.length-1;e>=0;--e){let r=i[e];if(r===`parent`)continue;let a=n[r];if(Array.isArray(a))for(let e=a.length-1;e>=0;--e){let n=a[e];D(n)&&t.push(n)}else D(a)&&t.push(a)}},ur=(e,t)=>{let n=e,r=Ge[e.type];if(r!==void 0){for(let e=0;e<r.length;e+=1){let i=n[r[e]];if(Array.isArray(i))for(let e=0;e<i.length;e+=1){let n=i[e];D(n)&&t(n)}else D(i)&&t(i)}return}for(let e in n){if(e===`parent`||!Object.hasOwn(n,e))continue;let r=n[e];if(Array.isArray(r))for(let e=0;e<r.length;e+=1){let n=r[e];D(n)&&t(n)}else D(r)&&t(r)}},z=(e,t)=>{if(!e||typeof e!=`object`)return;let n=[e];for(;n.length>0;){let e=n.pop();e===void 0||t(e)===!1||lr(e,n)}},dr=new WeakMap,fr=new Set([`TSStringKeyword`,`TSNumberKeyword`,`TSBooleanKeyword`]),pr=new Set([`String`,`Number`,`Boolean`]),mr=(e,t,n)=>{let r=[],i=15,a=(e,t,n,o,s,c)=>{let l=e=>{let r=F(w(e),o);return!r||r.references.some(e=>e.flag!==`read`)?null:t.has(r.bindingIdentifier)?t.get(r.bindingIdentifier)??null:n&&j(r.bindingIdentifier)===n?null:r.bindingIdentifier};z(e,e=>{if(O(e)||b(e,`ClassDeclaration`)||b(e,`ClassExpression`))return!1;if(c&&b(e,`AwaitExpression`)&&!b(w(e.argument),`CallExpression`)&&r.push({binding:e,member:null,inputs:[],crossFile:!0}),!b(e,`CallExpression`))return;let n=w(e.callee);if(e.optional||b(n,`MemberExpression`)&&n.optional)return c&&r.push({binding:e,member:null,inputs:[],crossFile:!0}),!1;let u=e.arguments.map(l),d=b(n,`MemberExpression`)?w(n.object):n,f=F(d,o),p=b(n,`Identifier`)&&(f?.kind===`function`||O(f?.initializer))?on(n,o):null,m=o,h=s,g=c;if(f?.kind===`import`){let e=b(n,`MemberExpression`)?C(n):null,t=f.declarationNode,a=_e(f),o=null;if(b(t,`ImportNamespaceSpecifier`)?o=e:b(n,`Identifier`)&&(o=Tt(t)),s&&i>0&&o&&a&&a.importKind!==`type`&&(!b(t,`ImportSpecifier`)||t.importKind!==`type`)){i--;let e=cr(s,a.source.value,o);e&&(p=e.functionNode,m=dr.get(e.programNode)??A(e.programNode),dr.set(e.programNode,m),h=e.filePath,g=!0)}!p&&!c&&(b(n,`Identifier`)||e!==null)&&r.push({binding:f.bindingIdentifier,member:e,inputs:u})}else if(!c&&b(n,`MemberExpression`)&&C(n)===`get`&&f?.kind===`const`&&f.initializer){let e=w(f.initializer);if(b(e,`NewExpression`)&&b(e.callee,`Identifier`)&&(e.callee.name===`Map`||e.callee.name===`WeakMap`)&&o.isGlobalReference(e.callee)){let e=l(d);e&&r.push({binding:e,member:`get`,inputs:[u[0]??null]})}}if(g&&p){let t=It(p),n=t?m.symbolFor(t):null;if(n&&(n.kind!==`const`&&n.kind!==`function`||n.references.some(e=>e.flag!==`read`)))return r.push({binding:e,member:null,inputs:[],crossFile:!0}),!1}if(g&&p&&Rt(p,m))return r.push({binding:p,member:null,inputs:u,crossFile:!0}),!1;if(!O(p)||i<=0){c&&(i<=0||f?.kind===`import`||Lt(e)||b(e.parent,`ReturnStatement`)&&!cn(e,o)&&!(b(n,`Identifier`)&&pr.has(n.name)&&o.isGlobalReference(n))||b(n,`Identifier`)&&n.name===`fetch`&&o.isGlobalReference(n))&&r.push({binding:e,member:null,inputs:[],crossFile:!0});return}if(c&&!p.async&&!Lt(e)&&(!b(e.parent,`ReturnStatement`)||b(p.returnType,`TSTypeAnnotation`)&&fr.has(p.returnType.typeAnnotation.type)))return;i--;let _=new Map(t);for(let[e,t]of p.params.entries()){let n=m.symbolFor(t);n&&_.set(n.bindingIdentifier,u[e]??null)}a(p.body,_,p,m,h,g)})};for(let r of Nt(e)?.awaitedExpressions??[])a(r,new Map,null,t,n,!1);return r},hr=(e,t,n,r)=>{let i=mr(e,n,r);if(i.length===0)return!1;let a=mr(t,n,r),o=e=>i.some(t=>t.binding===e.binding&&t.member===e.member&&t.inputs.length>0&&t.inputs.length===e.inputs.length&&t.inputs.every((t,n)=>t!==null&&t===e.inputs[n]));return a.some(o)&&(!a.some(e=>e.crossFile)||a.every(o))},gr=`(?:tsx?|jsx?|mts|mjs)`,_r=RegExp(`/page\\.${gr}$`),vr=RegExp(`/(page|layout)\\.${gr}$`),yr=[`layout.tsx`,`layout.jsx`,`layout.ts`,`layout.js`,`layout.mts`,`layout.mjs`],br=[`metadata`,`generateMetadata`],xr=/\/(?:(?:\((?:dashboard|admin|settings|account|internal|manage|console|portal|auth|onboarding|app|ee|protected)\))|(?:dashboard|admin|settings|account|internal|manage|console|portal))\//i,Sr=new Set([`redirect`,`permanentRedirect`,`notFound`,`forbidden`,`unauthorized`]),Cr=new Set([`revalidateTag`,`revalidatePath`,`expireTag`,`expirePath`,`unstable_expireTag`,`unstable_expirePath`]),wr=/fonts\.googleapis\.com/,Tr=/polyfill\.io|polyfill\.min\.js|cdn\.polyfill/,Er=RegExp(`/route\\.${gr}$`),Dr=/\/(?:cron|jobs\/cron)(?:\/|$)/i,Or=new Set([`logout`,`log-out`,`signout`,`sign-out`,`unsubscribe`,`delete`,`remove`,`revoke`,`cancel`,`deactivate`]),kr=RegExp(`/(error|global-error)\\.${gr}$`),Ar=RegExp(`/global-error\\.${gr}$`),jr=new Set([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`OPTIONS`,`HEAD`]),Mr=/google-analytics\.com|googletagmanager\.com\/gtag/,Nr=RegExp(`/(opengraph-image|twitter-image)\\d*\\.${gr}$`),Pr=new Set([`expo`,`expo-router`,`@expo/cli`,`@expo/metro-config`,`@expo/metro-runtime`]),Fr=new Set([`react-native`,`react-native-tvos`,...Pr,`react-native-windows`,`react-native-macos`]),Ir=[`@react-native/`,`@react-native-`],Lr=e=>Pr.has(e),Rr=e=>{if(Fr.has(e))return!0;for(let t of Ir)if(e.startsWith(t))return!0;return!1},zr=new Set([`next`,`vite`,`react-scripts`,`gatsby`,`@remix-run/react`,`@remix-run/node`,`@docusaurus/core`,`@docusaurus/preset-classic`,`@storybook/react`,`@storybook/react-vite`,`@storybook/react-webpack5`,`@storybook/nextjs`,`@storybook/web-components`,`storybook`,`react-dom`,`@vitejs/plugin-react`,`@vitejs/plugin-react-swc`]),Br=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`],Vr=function*(e){for(let t of Br){let n=e[t];if(n)for(let e of Object.keys(n))yield e}},Hr=e=>{if(typeof e[`react-native`]==`string`)return!0;for(let t of Vr(e))if(Rr(t))return!0;return!1},Ur=e=>{for(let t of Vr(e))if(Lr(t))return!0;return!1},Wr=e=>{for(let t of Vr(e))if(zr.has(t))return!0;return!1},Gr=e=>Br.some(t=>{let n=e[t];return typeof n==`object`&&!!n&&Object.keys(n).length>0}),Kr=(e,t)=>Br.some(n=>{let r=e[n];return typeof r==`object`&&!!r&&Object.prototype.propertyIsEnumerable.call(r,t)}),qr=new WeakMap,Jr=e=>{let t=Ne(e);if(!t)return`unknown`;let n=qr.get(t);if(n!==void 0)return n;let r;return r=Ur(t)?`expo`:Hr(t)?`react-native`:Wr(t)?`web`:Gr(t)?`neutral`:`unknown`,qr.set(t,r),r},Yr=({absoluteFilePath:e,staticImports:t,program:n})=>{let r=new Set;if(z(n,e=>{if(e.type!==`JSXOpeningElement`)return;let t=e.name;if(t){if(t.type===`JSXIdentifier`){let e=t.name;typeof e==`string`&&r.add(e)}else if(t.type===`JSXMemberExpression`){let e=t.property;e?.type===`JSXIdentifier`&&typeof e.name==`string`&&r.add(e.name)}else if(t.type===`JSXNamespacedName`){let e=t.namespace;typeof e?.name==`string`&&r.add(e.name)}}}),r.size!==0)for(let n of t)for(let t of n.entries){let{importName:i}=t;if(i.kind===`NamespaceObject`||!r.has(t.localName.value))continue;let a=i.kind===`Default`?`default`:i.name;a&&sr(e,n.moduleRequest.value,a)}},Xr=e=>e.replace(/^type\s+/,``).trim(),Zr=(e,t)=>e.split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>{let n=t||e.startsWith(`type `),[r,i]=e.split(/\s+as\s+/),a=Xr(r??``);return{localName:a,exportedName:Xr(i??a),isTypeOnly:n}}),Qr=/\/\*[\s\S]*?\*\//g,$r=/^\s*\/\/.*$/gm,ei=e=>e.replace(Qr,``).replace($r,``),ti=/^\s*export\s+default\b/m,ni=/^\s*export\s+(?:declare\s+)?(?:(?:async\s+)?function|(?:abstract\s+)?class|const|let|var|enum|interface|type)\s+([\w$]+)/gm,ri=/^\s*export\s+(?:type\s+)?\{([\s\S]*?)\}(?:\s+from\s+["'][^"']+["'])?\s*;?\s*(?:(?:\/\/[^\n]*)?\s*)/gm,ii=e=>{let t=ei(e),n=new Set;ti.test(t)&&n.add(`default`);for(let e of t.matchAll(ni))e[1]&&n.add(e[1]);for(let e of t.matchAll(ri)){let t=e[1]??``;for(let e of Zr(t,!1))n.add(e.exportedName)}return n},ai=new Map,oi=(t,n)=>{E(t);try{let r=e.statSync(t,{throwIfNoEntry:!1});if(r===void 0)return!1;let i=ai.get(t);if(i&&i.mtimeMs===r.mtimeMs&&i.size===r.size)return i.exportedNames.has(n);let a=ii(e.readFileSync(t,`utf8`));return ai.set(t,{mtimeMs:r.mtimeMs,size:r.size,exportedNames:a}),a.has(n)}catch{return!1}},si=(e,t)=>{let r=e.replaceAll(`\\`,`/`),i=n.dirname(r);for(let e=0;e<30;e++){for(let e of yr){let a=n.join(i,e);if(a.replaceAll(`\\`,`/`)!==r&&t(a))return!0}let e=n.dirname(i);if(n.basename(i)===`app`&&n.basename(e)!==`app`||e===i)break;i=e}return!1},ci=e=>si(e,e=>br.some(t=>oi(e,t))),li=e=>b(e,`JSXIdentifier`)?e.name===`Suspense`:b(e,`JSXMemberExpression`)&&b(e.property,`JSXIdentifier`)&&e.property.name===`Suspense`,ui=e=>{let t=!1;return z(e,e=>{if(t)return!1;if(b(e,`JSXOpeningElement`)&&li(e.name)||b(e,`ImportDeclaration`)&&e.source?.value===`react`&&(e.specifiers??[]).some(e=>b(e,`ImportSpecifier`)&&x(e)===`Suspense`))return t=!0,!1}),t},di=e=>si(e,e=>{let t=yn(e);return!!(t&&ui(t))}),fi=e=>{if(b(e,`ImportDeclaration`)){if(e.importKind===`type`||e.specifiers.length>0&&e.specifiers.every(e=>b(e,`ImportSpecifier`)&&e.importKind===`type`))return null}else if(b(e,`ExportNamedDeclaration`)){if(e.exportKind===`type`||!e.source||e.specifiers.length>0&&e.specifiers.every(e=>b(e,`ExportSpecifier`)&&e.exportKind===`type`))return null}else if(b(e,`ExportAllDeclaration`)){if(e.exportKind===`type`)return null}else return null;return e.source&&typeof e.source.value==`string`?e.source.value:null},pi=/^index\.(?:[cm]?[jt]sx?|mjs)$/,mi=/^\s*import\s+(type\s+)?(?!["'])([^;]*?)\s+from\s+["']([^"']+)["']\s*;?\s*(?:(?:\/\/[^\n]*)?\s*)/gm,hi=/^\s*export\s+(type\s+)?(?:\*(?:\s+as\s+([\w$]+))?|\{([\s\S]*?)\})\s+from\s+["']([^"']+)["']\s*;?\s*(?:(?:\/\/[^\n]*)?\s*)/gm,gi=/^\s*export\s+(type\s+)?\{([\s\S]*?)\}\s*;?\s*(?:(?:\/\/[^\n]*)?\s*)/gm,_i=new Map,vi=e=>pi.test(n.basename(e)),yi=()=>({isBarrel:!1,exportsByName:new Map,starExportSources:[]}),bi=(e,t)=>{e.set(t.localName,{...t,didExport:!1})},xi=(e,t,n,r)=>{for(let i of Zr(e,n))bi(r,{localName:i.exportedName,importedName:i.localName,source:t,isTypeOnly:i.isTypeOnly})},Si=(e,t,n,r)=>{let i=e.trim(),a=i.match(/(?:^|,\s*)\*\s+as\s+([\w$]+)/);a?.[1]&&bi(r,{localName:a[1],importedName:`*`,source:t,isTypeOnly:n});let o=i.match(/\{([\s\S]*?)\}/);o?.[1]&&xi(o[1],t,n,r);let s=i.split(`,`)[0]?.trim();s&&!s.startsWith(`{`)&&!s.startsWith(`*`)&&bi(r,{localName:s,importedName:`default`,source:t,isTypeOnly:n})},Ci=(e,t,n,r)=>{let i=e.replace(mi,(e,n,r,i)=>(Si(r,i,!!n,t),``));return i=i.replace(hi,(e,t,i,a,o)=>{let s=!!t;if(i)return n.set(i,{exportedName:i,importedName:`*`,source:o,isTypeOnly:s}),``;if(a){for(let e of Zr(a,s))n.set(e.exportedName,{exportedName:e.exportedName,importedName:e.localName,source:o,isTypeOnly:e.isTypeOnly});return``}return r.push(o),``}),i=i.replace(gi,(e,r,i)=>{for(let a of Zr(i,!!r)){let r=t.get(a.localName);if(!r)return e;r.didExport=!0,n.set(a.exportedName,{exportedName:a.exportedName,importedName:r.importedName,source:r.source,isTypeOnly:a.isTypeOnly||r.isTypeOnly})}return``}),i},wi=e=>{for(let t of e.values())if(!t.isTypeOnly&&!t.didExport)return!0;return!1},Ti=e=>{let t=ei(e).trim();if(!t)return yi();let n=new Map,r=new Map,i=[];return Ci(t,n,r,i).trim()||wi(n)?yi():{isBarrel:r.size>0||i.length>0,exportsByName:r,starExportSources:i}},Ei=t=>{if(!vi(t))return yi();E(t);let n;try{n=e.statSync(t,{throwIfNoEntry:!1})??null}catch{n=null}let r=_i.get(t);if(r!==void 0&&n!==null&&r.mtimeMs===n.mtimeMs&&r.size===n.size)return r.moduleInfo;if(n===null)return yi();let i=yi();try{i=Ti(e.readFileSync(t,`utf8`))}catch{i=yi()}return _i.set(t,{mtimeMs:n.mtimeMs,size:n.size,moduleInfo:i}),i},Di=e=>Ei(e).isBarrel,Oi=n.join(`android`,`gradle.properties`),ki=/^\s*newArchEnabled\s*=\s*false\s*$/m,Ai=[`app.config.ts`,`app.config.js`,`app.config.cjs`,`app.config.mjs`],ji=[`app.config.json`,`app.json`],Mi=new WeakMap,Ni=e=>{E(n.join(e,Oi));for(let t of Ai)Se(n.join(e,t));for(let t of ji)E(n.join(e,t))},Pi=t=>{try{return e.readFileSync(t,`utf-8`)}catch{return null}},Fi=e=>{let t=e.dependencies?.[`react-native`]??e.devDependencies?.[`react-native`];return typeof t==`string`?t:null},Ii=e=>{let t=e.match(/(?:^|[^\d.])0\.(\d+)/);return t?Number.parseInt(t[1],10):null},Li=e=>{let t=Pi(n.join(e,Oi));return t!==null&&ki.test(t)},Ri=t=>{for(let r of Ai)if(e.existsSync(n.join(t,r)))return!1;for(let e of ji){let r=Pi(n.join(t,e));if(r===null)continue;let i;try{i=JSON.parse(r)}catch{continue}if(typeof i!=`object`||!i)continue;let a=Object.getOwnPropertyDescriptor(i,`expo`)?.value;if(!(typeof a!=`object`||!a)&&Object.getOwnPropertyDescriptor(a,`newArchEnabled`)?.value===!1)return!0}return!1},zi=(e,t)=>{let n=Fi(t);if(n!==null){let e=Ii(n);if(e!==null&&e<76)return!0}return Li(e)||Ri(e)},Bi=e=>{let t=Me(e);if(!t)return!1;let n=Ne(e);if(!n)return!1;Ni(t);let r=Mi.get(n);if(r!==void 0)return r;let i=zi(t,n);return Mi.set(n,i),i},Vi=e=>Ue(e,`ink`)?.version??null,Hi=(e,t)=>{let n=Vi(e),r=Fe(t);return!!(n&&r&&Ie(n,r)>=0)},Ui=new Set([`@monaco-editor/react`,`monaco-editor`,`recharts`,`@react-pdf/renderer`,`react-quill`,`@codemirror/view`,`@codemirror/state`,`chart.js`,`react-chartjs-2`,`@toast-ui/editor`,`draft-js`,`mermaid`]),Wi=new Set([`fetch`,`ky`,`got`,`wretch`,`ofetch`]),Gi=new Set([`axios`,`ky`,`got`,`ofetch`,`wretch`,`request`]),Ki=new Set([`create`,`insert`,`insertInto`,`update`,`upsert`,`delete`,`remove`,`destroy`,`set`,`append`]),qi=new Set([`POST`,`PUT`,`DELETE`,`PATCH`]),Ji=new Set([`Map`,`Set`,`WeakMap`,`WeakSet`,`Headers`,`URLSearchParams`,`FormData`,`Response`,`NextResponse`]),Yi=new Set([`Response`,`NextResponse`]),Xi=new Set([`json`,`redirect`,`next`,`rewrite`,`error`]),Zi=new Set([`wheel`,`mousewheel`,`touchstart`,`touchmove`]),Qi=new Set([`defer`,`async`]),$i=new Set([`text/javascript`,`application/javascript`,`module`]),ea=new Set([`setTimeout`,`setInterval`,`requestAnimationFrame`,`requestIdleCallback`,`queueMicrotask`]),ta=new Set([`setInterval`,`setTimeout`]),na=new Set([`clearInterval`,`clearTimeout`]),ra=new Set([`WebSocket`,`EventSource`,`BroadcastChannel`,`RTCPeerConnection`]),ia=new Set([`location`,`window`,`document`,`navigator`,`history`,`screen`,`performance`]),aa=new Set([`IntersectionObserver`,`MutationObserver`,`ResizeObserver`,`PerformanceObserver`]),oa=new Set([`blur`,`canPlayType`,`focus`,`getBoundingClientRect`,`getClientRects`,`measure`,`measureInWindow`,`measureLayout`,`scroll`,`scrollBy`,`scrollIntoView`,`scrollTo`,`select`,`setRangeText`,`setSelectionRange`]),sa=new Set([`localStorage`,`sessionStorage`]),ca=new Set([`index`,`idx`,`i`]),la=new Set([`react`,`react-dom`,`preact/compat`,`preact/hooks`,`@wordpress/element`]),ua=new Set([`next`,`next-themes`,`@remix-run/react`,`swr`,`zustand`,`jotai`,`recoil`,`wouter`,`framer-motion`,`@apollo/client`,`urql`,`usehooks-ts`]),da=new Set([`useState`,`useMemo`,`useRef`]),fa=new Set([`Click`,`Change`,`Input`,`Blur`,`Focus`]),pa=new Set([`Boolean`,`String`,`Number`,`Array`,`Object`,`parseInt`,`parseFloat`]),ma=/^set[A-Z]/,ha=/^render[A-Z]/,ga=/^[A-Z]/,_a=/^on[A-Z]/,va=/^use[A-Z]/,ya=/^(?:on|handle)[A-Z]/,ba=new Set([`useEffect`,`useLayoutEffect`]),xa=new Set([`useEffect`,`useLayoutEffect`,`useMemo`,`useCallback`]),Sa=new Set([`use`,`useState`,`useRef`,`useMemo`,`useCallback`,`useReducer`,`useContext`,`useEffect`,`useLayoutEffect`,`useInsertionEffect`,`useImperativeHandle`,`useSyncExternalStore`,`useDeferredValue`,`useTransition`,`useId`,`useDebugValue`]),Ca=new Set([`memo`,`forwardRef`,`React.memo`,`React.forwardRef`]),wa=new Set([`useMemo`,`useCallback`]),Ta=new Set([`memo`,`forwardRef`,`observer`,`lazy`]),Ea=new Set([`subscribe`,`addEventListener`,`addListener`,`on`,`watch`,`listen`,`sub`]),Da=new Set([`subscribe`,`sub`,`listen`]),Oa=new Set([`unsubscribe`,`removeEventListener`,`removeListener`,`off`,`unwatch`,`unlisten`,`unsub`,`abort`,`disconnect`,`unobserve`,`close`]),ka=new Set([`remove`,`cleanup`,`dispose`,`destroy`,`stop`,`teardown`]),Aa=new Set([...Oa,`cleanup`,`dispose`,`destroy`,`teardown`]),ja=new Set([...Ea,`connect`,`disconnect`,`open`,`close`,`fetch`,`post`,`put`,`patch`]),Ma=new Set([`get`,`head`,`options`,`delete`]),Na=new Set([...Wi,...ea]),Pa=new Set([...Wi,`post`,`put`,`patch`,`navigate`,`navigateTo`,`showNotification`,`toast`,`alert`,`confirm`,`logVisit`,`captureEvent`]),Fa=new Set([`post`,`put`,`patch`,`delete`,`navigate`,`capture`,`track`,`logEvent`]),Ia=new Set([`push`,`replace`]),La=new Set([`router`,`navigation`,`navigator`,`history`,`location`]),Ra=new Map([[`react_ujs`,new Set([`useContext`,`useContexts`])]]),za={},Ba=new WeakMap,Va=(e,t)=>typeof e==`string`?e===t:e.has(t),Ha=e=>{let t=Ba.get(e);if(t)return t;let n=e.declarationNode.parent,r=!!(e.kind===`import`&&n&&n.type===`ImportDeclaration`&&typeof n.source.value==`string`&&la.has(n.source.value)),i={importedName:r?x(e.declarationNode):void 0,isReactImport:r};return Ba.set(e,i),i},Ua=e=>Ha(e).isReactImport,Wa=(e,t,n,r)=>{if(e.type!==`Identifier`)return!1;let i=r?F(e,n):n.symbolFor(e);if(!i)return!1;let a=Ha(i);return!!(a.isReactImport&&a.importedName&&Va(t,a.importedName))},Ga=(e,t)=>{let n=F(e,t);if(!n)return!1;let r=Ha(n);return r.isReactImport?n.declarationNode.type===`ImportDefaultSpecifier`||n.declarationNode.type===`ImportNamespaceSpecifier`||r.importedName===`default`:!1},Ka=(e,t,n)=>e.type===`Identifier`?Ga(e,t)?!0:!!(n.allowGlobalReactNamespace&&e.name===`React`&&t.isGlobalReference(e)):!1,qa=(e,t,n,r)=>{let i=n.symbolFor(e);if(!i||i.kind!==`const`||!i.initializer||i.declarationNode.type!==`VariableDeclarator`)return!1;let a=i.declarationNode.id;if(a.type!==`ObjectPattern`)return!1;for(let e of a.properties){if(e.type!==`Property`||e.value!==i.bindingIdentifier)continue;let a=S(e);return!!(a&&Va(t,a)&&Ka(w(i.initializer),n,r))}return!1},Ja=(e,t,n,r=za)=>e.type===`CallExpression`?Ya(e.callee,t,n,r):!1,Ya=(e,t,n,r,i)=>{let a=w(e);if(r.resolveConditionalAliases&&a.type===`ConditionalExpression`)return Ya(a.consequent,t,n,r,new Set(i))&&Ya(a.alternate,t,n,r,new Set(i));if(a.type===`Identifier`){if(Wa(a,t,n,!!r.resolveNamedAliases)||r.resolveNamedAliases&&qa(a,t,n,r))return!0;if(r.resolveConditionalAliases){let e=n.symbolFor(a);if(e?.kind===`const`&&e.initializer&&!i?.has(e.id)){let a=i??new Set;return a.add(e.id),Ya(e.initializer,t,n,r,a)}}return!!(r.allowUnboundBareCalls&&Va(t,a.name)&&n.isGlobalReference(a))}return a.type!==`MemberExpression`||!Va(t,C(a)??``)?!1:Ka(w(a.object),n,r)},Xa=e=>e.includes(`\\`)?e.replaceAll(`\\`,`/`):e,Za=e=>{let t=new Set(e);if(t.size!==1)return null;let[n]=t;return n??null},Qa=(e,t,n,r)=>{let i=Bn(e,n);return i?$a(i,t,new Set(r))||(oi(i,t)?i:null):null},$a=(e,t,n=new Set)=>{if(n.has(e))return null;n.add(e);let r=Ei(e);if(!r.isBarrel)return null;let i=r.exportsByName.get(t);if(i){let t=Bn(e,i.source);return t?$a(t,i.importedName,n)??t:null}return t===`default`?null:Za(r.starExportSources.map(r=>Qa(e,t,r,n)).filter(e=>!!e))},eo=(e,t,n)=>{let r=R(e,t,n);return r?{filePath:r.filePath,node:r.exportedNode,programNode:r.programNode,kind:O(r.exportedNode)?`function`:`initializer`}:null},to=(e,t)=>{if(!b(e,`ArrowFunctionExpression`)&&!b(e,`FunctionExpression`)&&!b(e,`FunctionDeclaration`))return null;let n=e.params[0],r=b(n,`AssignmentPattern`)?n.left:n;if(b(r,`ObjectPattern`)){let e=r.properties.find(e=>b(e,`Property`)&&S(e,{allowComputedString:!0})===`children`);if(!e||!b(e,`Property`))return null;let n=b(e.value,`AssignmentPattern`)?e.value.left:e.value;if(!b(n,`Identifier`))return null;let i=t.symbolFor(n);return!i||i.references.length===0||i.references.some(e=>e.flag!==`read`)?null:i.references.map(e=>e.identifier)}if(!b(r,`Identifier`))return null;let i=t.symbolFor(r);if(!i||i.references.length===0)return null;let a=[];for(let e of i.references){if(e.flag!==`read`)return null;let t=[],n=P(e.identifier);for(;n.parent&&b(n.parent,`MemberExpression`)&&n.parent.object===n;){let e=C(n.parent);if(!e)return null;t.push(e),n=P(n.parent)}if(t[0]!==`children`){if(t.length===0)return null;continue}if(t.length!==1)return null;a.push(n)}return a.length>0?a:null},no=e=>{let t=new Map,n=e.body??[];for(let e of n){if(e.type!==`ImportDeclaration`||!(`source`in e)||!e.source)continue;let n=e.source.value;if(typeof n==`string`&&!(!(`specifiers`in e)||!Array.isArray(e.specifiers)))for(let r of e.specifiers){if(!(`local`in r)||!r.local)continue;let e=r.local;if(typeof e.name==`string`){if(r.type===`ImportDefaultSpecifier`)t.set(e.name,{source:n,imported:null,isDefault:!0,isNamespace:!1});else if(r.type===`ImportNamespaceSpecifier`)t.set(e.name,{source:n,imported:null,isDefault:!1,isNamespace:!0});else if(r.type===`ImportSpecifier`){let i=r.imported,a=i?.name??(typeof i?.value==`string`?i.value:null);t.set(e.name,{source:n,imported:a,isDefault:!1,isNamespace:!1})}}}}return t},ro=new WeakMap,io=e=>{let t=zt(e);if(!t)return null;let n=ro.get(t);return n||(n=no(t),ro.set(t,n)),n},ao=(e,t)=>{let n=io(e);if(!n)return!1;for(let e of n.values())if(t.includes(e.source))return!0;return!1},oo=(e,t,n)=>{let r=io(e);if(!r)return!1;let i=r.get(t);return i?i.source===n:!1},so=(e,t,n)=>{let r=io(e);if(!r)return!1;let i=r.get(t);return i?i.isNamespace&&i.source===n:!1},co=(e,t,n)=>{let r=io(e);if(!r)return!1;let i=r.get(t);return i?i.isDefault&&i.source===n:!1},lo=(e,t,n)=>{let r=io(e);if(!r)return null;let i=r.get(t);return!i||i.source!==n?null:i.imported},uo=(e,t)=>{let n=io(e);return n?n.get(t)?.source??null:null},fo=(e,t)=>{let n=io(e)?.get(t);return n?n.isNamespace?{source:n.source,exportedName:null,isNamespace:!0}:{source:n.source,exportedName:n.isDefault?`default`:n.imported,isNamespace:!1}:null},po=(e,t)=>{let n=e.parent;for(;n;){if(`typeParameters`in n){let e=n.typeParameters;if(e&&b(e,`TSTypeParameterDeclaration`)&&e.params.some(e=>b(e,`TSTypeParameter`)&&b(e.name,`Identifier`)&&e.name.name===t))return!0}n=n.parent}return!1},mo=e=>{if(!b(e,`Identifier`)||po(e,e.name))return!1;let t=fo(e,e.name);return!!(t&&t.source===`react`&&(t.isNamespace||t.exportedName===`default`))},ho=e=>{let t=zt(e);return!t||!b(t,`Program`)?!1:t.body.some(e=>b(e,`TSModuleDeclaration`)&&b(e.id,`Identifier`)&&e.id.name===`JSX`)},go=(e,t)=>{if(!b(e,`TSTypeReference`))return!1;let n=e.typeName;if(b(n,`Identifier`)){if(po(n,n.name))return!1;let e=lo(n,n.name,`react`);return e===`ReactElement`||t&&e===`ReactNode`}if(!b(n,`TSQualifiedName`)||!b(n.right,`Identifier`))return!1;if((n.right.name===`ReactElement`||t&&n.right.name===`ReactNode`)&&mo(n.left))return!0;if(n.right.name!==`Element`)return!1;if(b(n.left,`Identifier`)){if(n.left.name!==`JSX`)return!1;let e=fo(n.left,n.left.name);return e?e.source===`react`&&e.exportedName===`JSX`:!ho(n.left)}return b(n.left,`TSQualifiedName`)&&b(n.left.right,`Identifier`)&&n.left.right.name===`JSX`&&mo(n.left.left)},_o=(e,t)=>b(e,`TSUnionType`)?t?e.types.every(e=>b(e,`TSNullKeyword`)||b(e,`TSUndefinedKeyword`)||_o(e,t)):e.types.some(e=>_o(e,t)):go(e,t),vo=(e,t=!1)=>{let n=Reflect.get(e,`returnType`);return b(n,`TSTypeAnnotation`)?_o(n.typeAnnotation,t):!1},yo=e=>{let t=e,n=t.parent;for(;n&&w(n)===e;)t=n,n=t.parent;return n&&b(n,`AssignmentExpression`)&&n.operator===`=`&&n.left===t?n.right:null},bo=e=>{let t=e.range?.[0];return typeof t==`number`?t:null},xo=new Set([`let`,`var`]),So=new Set([`ConditionalExpression`,`LogicalExpression`]),Co=new WeakMap,wo=(e,t,n)=>{let r=e.parent??null;for(;r&&n.blockOf(r)===t;){if(So.has(r.type))return!0;r=r.parent??null}return!1},To=(e,t)=>e.size===t.size&&[...e].every(e=>t.has(e)),Eo=(e,t)=>{let n=new Set(e);for(let e of t)e.isConditionalWithinBlock||(n=new Set),n.add(e);return n},Do=(e,t,n)=>{let r=j(t);if(j(e.bindingIdentifier)!==r||!r)return[];let i=n.cfgFor(r);if(!i)return[];let a=i.blockOf(t);if(!a)return[];let o=bo(t),s=bo(e.bindingIdentifier);if(o===null||s===null)return[];let c=new Map,l=(e,t,n)=>{let r=i.blockOf(t);if(!r)return;let a=c.get(r)??[];a.push({expression:e,position:n,isConditionalWithinBlock:wo(t,r,i)}),c.set(r,a)};e.initializer&&l(e.initializer,e.bindingIdentifier,s);for(let t of e.references){let e=bo(t.identifier);if(t.flag===`read`||j(t.identifier)!==r||e===null||e>=o)continue;let n=yo(t.identifier);n&&l(n,t.identifier,e)}for(let e of c.values())e.sort((e,t)=>e.position-t.position);let u=new Map,d=new Map,f=new Set([i.entry]),p=[i.entry];for(;p.length>0;){let e=p.pop();if(!e)break;for(let t of e.successors)f.has(t.to)||(f.add(t.to),p.push(t.to))}if(!f.has(a))return[];let m=!0;for(;m;){m=!1;for(let e of i.blocks){if(!f.has(e))continue;let t=new Set;for(let n of e.predecessors)if(f.has(n.from))for(let e of d.get(n.from)??[])t.add(e);let n=Eo(t,c.get(e)??[]),r=u.get(e)??new Set,i=d.get(e)??new Set;(!To(t,r)||!To(n,i))&&(u.set(e,t),d.set(e,n),m=!0)}}let h=(c.get(a)??[]).filter(e=>e.position<o);return[...Eo(u.get(a)??new Set,h)].map(e=>e.expression)},Oo=(e,t,n)=>{if(!xo.has(e.kind))return e.initializer?[e.initializer]:[];if(!n)return[];let r=Co.get(n);r||(r=new WeakMap,Co.set(n,r));let i=r.get(e);i||(i=new WeakMap,r.set(e,i));let a=i.get(t);if(a)return a;let o=Do(e,t,n);return i.set(t,o),o},ko=e=>{if(!O(e)||!b(e.body,`BlockStatement`))return[];let t=[];return z(e.body,n=>{if(n!==e.body&&(O(n)||b(n,`ClassDeclaration`)||b(n,`ClassExpression`)))return!1;b(n,`ReturnStatement`)&&t.push(n)}),t},B=e=>{if(b(e,`ReturnStatement`)||b(e,`ThrowStatement`))return!0;if(b(e,`IfStatement`)){if(b(e.test,`Literal`)){let t=e.test.value?e.consequent:e.alternate;return t?B(t):!1}return!!(e.alternate&&B(e.consequent)&&B(e.alternate))}if(b(e,`TryStatement`))return e.finalizer&&B(e.finalizer)?!0:B(e.block)?e.handler?B(e.handler.body):!0:!1;if(b(e,`DoWhileStatement`))return B(e.body);if(b(e,`WhileStatement`)){let t=e.test;return!!(b(t,`Literal`)&&t.value&&B(e.body))}if(b(e,`ForStatement`)){let t=e.test;return!!((!t||b(t,`Literal`)&&t.value)&&B(e.body))}return b(e,`BlockStatement`)?e.body.some(e=>B(e)):!1},Ao=new Set([`let`,`var`]),jo=e=>!O(e)||!e.body?[]:b(e.body,`BlockStatement`)?ko(e).flatMap(e=>e.argument?[e.argument]:[]):[e.body],Mo=e=>{if(!O(e)||!b(e.body,`BlockStatement`))return!1;let t=!1;return z(e.body,n=>{if(t||n!==e.body&&O(n))return!1;b(n,`ReturnStatement`)&&!n.argument&&(t=!0)}),t},No=(e,t,n,r=`some`)=>{let i=new Set,a=new Set,o,s=e=>{if(a.has(e))return!1;a.add(e);try{let t=jo(e);return r===`every`&&O(e)&&b(e.body,`BlockStatement`)&&(!B(e.body)||Mo(e))?!1:t.length>0&&(r===`every`?t.every(o):t.some(o))}finally{a.delete(e)}};o=a=>{let l=w(a);if(i.has(l))return!1;i.add(l);try{if(t(l))return!0;if(b(l,`Identifier`)){let t=e.symbolFor(l);if(!t||t.kind!==`const`&&!Ao.has(t.kind))return!1;let i=Oo(t,l,n),a=e=>{let t=w(e);return!O(t)&&o(t)};return r===`every`?i.length>0&&i.every(a):i.some(a)}if(b(l,`CallExpression`)){if(l.arguments.length!==0||!b(l.callee,`Identifier`))return!1;let t=e.symbolFor(l.callee);if(!t||t.kind!==`const`&&t.kind!==`function`)return!1;let n=t.initializer?w(t.initializer):null,r=null;return O(n)?r=n:O(t.declarationNode)&&(r=t.declarationNode),!r||r.async||r.generator||r.params.length!==0?!1:s(r)}return b(l,`ConditionalExpression`)?c(l.consequent,l.alternate):b(l,`LogicalExpression`)?c(l.left,l.right):!1}finally{i.delete(l)}};let c=(e,t)=>{let n=[o(e),o(t)];return r===`every`?n.every(Boolean):n.some(Boolean)};return{expressionMatches:o,functionMatches:s}},Po=(e,t,n,r,i=`some`)=>No(t,n,r,i).functionMatches(e),Fo=(e,t,n,r,i)=>{let a=i.cfgFor(e),o=a?.blockOf(t);if(!a||!o)return!1;let s=new Set(ko(e).flatMap(e=>{if(!e.argument||!No(n,r,i,`every`).expressionMatches(e.argument))return[];let t=a.blockOf(e.argument);return t?[t]:[]}));if(s.size===0)return!1;let c=new Set([o]),l=[o];for(;l.length>0;){let e=l.pop();if(!e)break;if(!s.has(e))for(let t of e.successors){if(t.to===a.exit)return!1;c.has(t.to)||(c.add(t.to),l.push(t.to))}}return!0},Io=e=>b(e,`Program`)?e.range[1]:e.range[0],Lo=new WeakMap,Ro=new WeakMap,zo=(e,t)=>{let n=w(e);return b(n,`Identifier`)?t.symbolFor(n):null},Bo=(e,t)=>{let n=P(e),r=n.parent;return!r||!b(r,`AssignmentExpression`)||r.operator!==`=`||r.left!==n?null:zo(r.right,t)},Vo=e=>{let t=P(e),n=t.parent;return n&&b(n,`VariableDeclarator`)&&n.init===t&&(b(n.id,`Identifier`)||b(n.id,`ObjectPattern`))?!0:!!(n&&b(n,`AssignmentExpression`)&&n.operator===`=`&&n.right===t&&b(w(n.left),`Identifier`))},Ho=(e,t,n)=>{if(e.initializer&&b(e.declarationNode,`VariableDeclarator`)&&e.declarationNode.id===e.bindingIdentifier){let r=zo(e.initializer,n);if(r&&t.has(r.id))return!0}return e.references.some(e=>{let r=Bo(e.identifier,n);return!!(r&&t.has(r.id))})},Uo=(e,t)=>{let n=F(e,t);if(!n)return[];let r=Lo.get(t);r||(r=new Map,Lo.set(t,r));let i=r.get(n.id);if(i)return i;let a=[],o=[t.rootScope];for(;o.length>0;){let e=o.pop();e&&(a.push(...e.symbols),o.push(...e.children))}let s=new Set([n.id]),c=!0;for(;c;){c=!1;for(let e of a)s.has(e.id)||Ho(e,s,t)&&(s.add(e.id),c=!0)}let l=a.filter(e=>s.has(e.id));return r.set(n.id,l),l},Wo=e=>{let t=e;for(;t;){if(O(t)||b(t,`Program`))return t;t=t.parent??null}return null},Go=new WeakMap,Ko=(e,t)=>{let n=Go.get(t);if(!n){let r=new Map,i=new Map,a=zt(e);a&&z(a,e=>{if(!b(e,`CallExpression`))return;let n=w(e.callee),a=b(n,`Identifier`)?t.symbolFor(n):null,o=a?i.get(a.id):void 0;o===void 0&&(o=sn(e.callee,t),a&&i.set(a.id,o));for(let t of o){let n=r.get(t)??[];n.push(e),r.set(t,n)}}),n=r,Go.set(t,n)}return n.get(e)??[]},qo=new WeakMap,Jo=(e,t)=>{let n=qo.get(t);if(n===void 0){let e=null;z(t,n=>{b(n,`AwaitExpression`)&&j(n)===t&&(e===null||n.range[0]<e)&&(e=n.range[0])}),n=e,qo.set(t,n)}return n===null||e.range[0]<n},Yo=(e,t,n,r=new Set,i=null,a)=>{if(r.has(e)||!O(e)||e.generator||i!==null&&!qt(i,e)||i!==null&&a!==void 0&&!a(i)||i!==null&&e.async&&!Jo(i,e))return[];r.add(e);let o=Wo(t);return o?Ko(e,n).flatMap(e=>{let s=Wo(e);return!s||i!==null&&!qt(e,s)||i!==null&&a!==void 0&&!a(e)?[]:s===o?e.range[0]<Io(t)?[[e.range[0]]]:[]:O(s)?Yo(s,t,n,new Set(r),i===null?null:e,a).map(t=>[...t,e.range[0]]):[]}):[]},Xo=(e,t,n,r=new Set,i=null)=>Yo(e,t,n,r,i).length>0,Zo=e=>{let t=e.parent;return t?b(t,`AssignmentExpression`)?t.left===e:(b(t,`UpdateExpression`)||b(t,`UnaryExpression`)&&t.operator===`delete`)&&t.argument===e:!1},Qo=e=>{let t=e.parent;for(;t&&w(t)===e;)t=t.parent;return!t||!b(t,`MemberExpression`)||w(t.object)!==e||!Zo(t)?null:t},$o=(e,t,n)=>{let r=Qo(e);return r&&I(r,n)===t?r:null},es=(e,t,n,r)=>e.references.some(e=>{let i=$o(e.identifier,t,r);if(!i)return!1;let a=Wo(i),o=Wo(n);return!a||!o||!qt(i,a)?!1:a===o?i.range[0]<Io(n):O(a)&&Xo(a,n,r)}),ts=e=>{if(Vo(e))return!0;let t=P(e),n=t.parent;return!!(n&&b(n,`MemberExpression`)&&w(n.object)===t)},ns=e=>{if(Vo(e))return!0;let t=P(e),n=t.parent;if(!n||!b(n,`MemberExpression`)||w(n.object)!==t)return!1;let r=P(n),i=r.parent;return!(i&&b(i,`CallExpression`)&&i.callee===r)},rs=(e,t,n)=>b(e,`Identifier`)?Uo(e,n).some(e=>e.references.some(e=>{let r=Qo(e.identifier);if(!r)return!1;let i=I(r,n);return i===null||i===t})):!1,is=(e,t,n)=>{let r=Wo(e),i=Wo(t);return!r||!i?!0:r===i?e.range[0]<Io(t):O(r)?Xo(r,t,n):!0},as=(e,t,n,r)=>b(e,`Identifier`)?Uo(e,r).some(e=>e.references.some(e=>{let i=Qo(e.identifier);if(!i||!is(i,n,r))return!1;let a=I(i,r);return a===null||a===t})):!1,os=(e,t,n)=>{if(!b(e,`Identifier`))return!1;let r=F(e,n);if(!r)return!1;let i=Ro.get(n)??new Map;Ro.set(n,i);let a=i.get(r.id)??new Map;i.set(r.id,a);let o=a.get(t);if(o!==void 0)return o;let s=rs(e,t,n)||Uo(e,n).some(e=>e.references.some(e=>!ts(e.identifier)));return a.set(t,s),s},ss=(e,t,n,r)=>b(e,`Identifier`)?as(e,t,n,r)?!0:Uo(e,r).some(e=>e.references.some(e=>!ns(e.identifier)&&is(e.identifier,n,r))):!1,cs=(e,t)=>{let n=w(e);if(!b(n,`CallExpression`))return!1;let r=w(n.callee);if(!b(r,`MemberExpression`))return!1;let i=C(r);if(i===null)return!1;let a=w(r.object);return b(a,`Identifier`)&&rs(a,i,t)},ls=(e,t,n,r)=>b(e,`Identifier`)?Ut(e,r).some(e=>es(e,t,n,r)):!1,us=(e,t,n,r={})=>{let i=j(e);return i===j(t)?e.range[0]>=Io(t)||r.requireSynchronousWrite&&(!i||!qt(e,i)||r.isSynchronousNode!==void 0&&!r.isSynchronousNode(e))?[]:[[e.range[0]]]:i?r.requireSynchronousWrite?Yo(i,t,n,new Set,e,r.isSynchronousNode).map(t=>[...t,e.range[0]]):Yo(i,t,n).map(t=>[...t,e.range[0]]):r.requireSynchronousWrite?[]:[[-1/0,e.range[0]]]},ds=(e,t,n,r={})=>us(e,t,n,r).length>0,V=(e,t,n,r={})=>e.references.some(e=>e.flag===`read`?!1:ds(e.identifier,t,n,r)),fs=(e,t)=>{if(!b(e,`CallExpression`))return!1;let n=w(e.callee);if(b(n,`Identifier`)){let e=t.symbolFor(n);return!!(e&&!V(e,n,t))}if(!b(n,`MemberExpression`))return!1;let r=C(n),i=w(n.object);return!!(r&&b(i,`Identifier`)&&!ls(i,r,n,t))},ps=new Set([`FunctionDeclaration`,`FunctionExpression`,`ArrowFunctionExpression`,`ClassDeclaration`,`ClassExpression`]),ms={allowGlobalReactNamespace:!1,allowUnboundBareCalls:!1},hs=new Set([`lodash/sortBy`,`lodash/sortBy.js`,`lodash-es/sortBy`,`lodash-es/sortBy.js`]),gs=e=>b(e,`TSArrayType`)||b(e,`TSTupleType`)?!0:b(e,`TSTypeReference`)?b(e.typeName,`Identifier`)&&(e.typeName.name===`Array`||e.typeName.name===`ReadonlyArray`):!1,_s=e=>{if(!b(e,`Identifier`))return!1;let t=e.typeAnnotation;return!!(t&&b(t,`TSTypeAnnotation`)&&gs(t.typeAnnotation))},vs=(e,t)=>{if(!b(e,`CallExpression`))return!1;let n=w(e.callee);if(!b(n,`Identifier`))return!1;let r=t.symbolFor(n);if(!r||V(r,n,t)||!b(r.declarationNode,`ImportDefaultSpecifier`)&&!b(r.declarationNode,`ImportSpecifier`))return!1;let i=fo(n,n.name);return!i||i.isNamespace?!1:hs.has(i.source)&&i.exportedName===`default`?!0:(i.source===`lodash`||i.source===`lodash-es`)&&i.exportedName===`sortBy`},ys=(e,t,n,r=new Set)=>{let i=w(e);if(b(i,`ArrayExpression`)||vs(i,t))return!0;if(!b(i,`Identifier`))return!1;let a=t.symbolFor(i);return!a||r.has(a.id)||V(a,n,t)?!1:_s(a.bindingIdentifier)?!0:a.initializer?(r.add(a.id),ys(a.initializer,t,n,r)):!1},bs=(e,t)=>{if(!b(e,`CallExpression`))return!1;let n=w(e.callee);if(!b(n,`MemberExpression`)||C(n)!==`map`)return!1;let r=w(n.object);return ys(r,t,e)?!(b(r,`Identifier`)&&ls(r,`map`,e,t)):!1},xs=(e,t)=>{if(e.type!==`ArrowFunctionExpression`&&e.type!==`FunctionExpression`)return!1;let n=e.parent;if(b(n,`CallExpression`))return Ja(n,`useMemo`,t,{resolveNamedAliases:!0})&&fs(n,t)?n.arguments[0]===e:n.arguments.some(t=>t===e)&&bs(n,t);if(b(n,`Property`)&&n.kind===`init`&&n.value===e){let e=n.parent;if(!b(e,`ObjectExpression`))return!1;let r=e.parent;if(!b(r,`CallExpression`)||!r.arguments.some(t=>t===e)||!fs(r,t))return!1;let i=on(r.callee,t);return!!(i&&vo(i,!0))}return!1},Ss=(e,t)=>ps.has(e.type)&&!xs(e,t),Cs=(e,t)=>e.type===`JSXElement`||e.type===`JSXFragment`||Ja(e,`createElement`,t,ms)||ws(e,t),ws=(e,t)=>{if(!b(e,`CallExpression`))return!1;let n=w(e.callee);if(b(n,`Identifier`))return t.symbolFor(n)?.kind===`import`&&lo(n,n.name,`react-dom`)===`createPortal`;if(!b(n,`MemberExpression`)||n.computed||!b(n.object,`Identifier`)||!b(n.property,`Identifier`)||n.property.name!==`createPortal`)return!1;let r=t.symbolFor(n.object);return!r||r.kind!==`import`?!1:co(n.object,n.object.name,`react-dom`)||so(n.object,n.object.name,`react-dom`)},Ts=(e,t)=>{if(Ss(e,t))return!1;let n=!1;return z(e,r=>{if(n||r!==e&&Ss(r,t))return!1;if(Cs(r,t))return n=!0,!1}),n},Es=new WeakMap,Ds=(e,t,n)=>{let r=Es.get(e);if(r&&r.scopes===t&&r.controlFlow===n)return r.hasRenderOutput;let i=Po(e,t,e=>Ts(e,t),n);return Es.set(e,{scopes:t,controlFlow:n,hasRenderOutput:i}),i},Os=e=>b(e,`JSXIdentifier`)?e.name:b(e,`JSXNamespacedName`)?`${e.namespace.name}:${e.name.name}`:null,ks=new Set([`Component`,`PureComponent`]),As=(e,t,n,r)=>{let i=w(e);if(b(i,`MemberExpression`)){let e=C(i),n=w(i.object);return!!(e&&ks.has(e)&&b(n,`Identifier`)&&!ls(n,e,i,t)&&Ga(n,t))}if(b(i,`ClassExpression`))return js(i,t,n,r);if(!b(i,`Identifier`))return!1;let a=t.symbolFor(i);if(!a||r.has(a.id)||V(a,i,t))return!1;if(r.add(a.id),Ua(a)){let e=x(a.declarationNode);return!!(e&&ks.has(e))}return b(a.declarationNode,`ClassDeclaration`)||b(a.declarationNode,`ClassExpression`)?js(a.declarationNode,t,n,r):!!(a.kind===`const`&&a.initializer&&As(a.initializer,t,n,r))},js=(e,t,n=new Set,r=new Set)=>!b(e,`ClassDeclaration`)&&!b(e,`ClassExpression`)||n.has(e)||!e.superClass?!1:(n.add(e),As(e.superClass,t,n,r)),Ms=new Set([`FunctionDeclaration`,`FunctionExpression`,`ArrowFunctionExpression`,`MethodDefinition`,`Program`]),Ns=e=>{let t=e;for(;t;){if(Ms.has(t.type))return t;t=t.parent??null}return null},Ps=(e,t)=>{if(t!==`let`&&t!==`const`)return Ns(e);let n=e.parent;for(;n;){if(n.type===`BlockStatement`){let t=n.parent;return t&&(t.type===`FunctionDeclaration`||t.type===`FunctionExpression`||t.type===`ArrowFunctionExpression`||t.type===`MethodDefinition`)?Ns(e):n}if(Ms.has(n.type))return n;n=n.parent??null}return null},Fs=(e,t,n,r)=>{if(b(e,`Identifier`)){let i=r.get(e.name)??[];i.push({bindingIdentifier:e,initializer:t,scopeOwner:n}),r.set(e.name,i);return}if(b(e,`ObjectPattern`)){for(let t of e.properties)if(b(t,`Property`)){let e=t.value;Fs(e,b(e,`AssignmentPattern`)?e.right:null,n,r)}else b(t,`RestElement`)&&Fs(t.argument,null,n,r);return}if(b(e,`ArrayPattern`)){for(let t of e.elements)t&&Fs(t,b(t,`AssignmentPattern`)?t.right??null:null,n,r);return}if(b(e,`AssignmentPattern`)){Fs(e.left,e.right??null,n,r);return}b(e,`RestElement`)&&Fs(e.argument,null,n,r)},Is=e=>{let t=new Map;return z(e,e=>{switch(e.type){case`VariableDeclarator`:{let n=e.parent,r=Ps(e,n?.type===`VariableDeclaration`?n.kind:void 0);r&&Fs(e.id,e.init??null,r,t);break}case`FunctionDeclaration`:case`FunctionExpression`:case`ArrowFunctionExpression`:if(e.type!==`ArrowFunctionExpression`&&e.id){let n=e.parent?Ns(e.parent):null;if(n){let r=t.get(e.id.name)??[];r.push({bindingIdentifier:e.id,initializer:e,scopeOwner:n}),t.set(e.id.name,r)}}for(let n of e.params)Fs(n,null,e,t);break;case`ClassDeclaration`:case`ClassExpression`:{if(!e.id)break;let n=e.parent?Ns(e.parent):null;if(n){let r=t.get(e.id.name)??[];r.push({bindingIdentifier:e.id,initializer:e,scopeOwner:n}),t.set(e.id.name,r)}break}case`ImportDeclaration`:{let n=Ns(e);if(!n)break;for(let r of e.specifiers){let e=r.local;if(e&&b(e,`Identifier`)){let i=t.get(e.name)??[];i.push({bindingIdentifier:e,initializer:r,scopeOwner:n}),t.set(e.name,i)}}break}case`TSImportEqualsDeclaration`:case`TSEnumDeclaration`:case`TSModuleDeclaration`:{let n=e.id;if(n?.type===`Identifier`){let r=Ns(e);if(r){let e=t.get(n.name)??[];e.push({bindingIdentifier:n,initializer:null,scopeOwner:r}),t.set(n.name,e)}}break}}}),t},Ls=new WeakMap,Rs=new WeakMap,zs=e=>{let t=zt(e);if(!t)return null;let n=Ls.get(t);return n||(n=Is(t),Ls.set(t,n)),n},Bs=(e,t,n)=>{let r=zs(e);if(!r)return null;let i=r.get(t);if(!i||i.length===0)return null;let a=i[0];if(i.length===1&&a){let t=e;for(;t;){if(t===a.scopeOwner)return a;t=t.parent??null}return null}let o=e;for(;o;){let t=null;for(let r of i)if(r.scopeOwner===o){if(t===null){t=r;continue}if(n?.preferInitializerBeforeReference){let n=!!(r.initializer&&(b(r.initializer,`FunctionDeclaration`)||r.bindingIdentifier.range[0]<e.range[0]));if(n!==!!(t.initializer&&(b(t.initializer,`FunctionDeclaration`)||t.bindingIdentifier.range[0]<e.range[0]))){n&&(t=r);continue}}(r.initializer!==null||t.initializer===null)&&(t=r)}if(t)return t;o=o.parent??null}return null},Vs=(e,t,n)=>{let r=Rs.get(e),i;if(!r)i={},Rs.set(e,{primaryBindingName:t,primaryLookup:i});else if(r.primaryBindingName===t)i=r.primaryLookup;else{let e=r.additionalLookups;e||(e=new Map,r.additionalLookups=e);let n=e.get(t);n?i=n:(i={},e.set(t,i))}let a=n?.preferInitializerBeforeReference?`preferredResult`:`defaultResult`;if(a in i)return i[a]??null;let o=Bs(e,t,n);return i[a]=o,o},Hs=e=>ga.test(e),Us=e=>{let t=Vs(e,e.name);if(!t?.initializer)return null;let n=t.bindingIdentifier.parent;if(!n||!b(n,`VariableDeclarator`)||n.id!==t.bindingIdentifier)return null;let r=n.parent;if(!r||!b(r,`VariableDeclaration`)||r.kind!==`const`)return null;let i=w(t.initializer);return b(i,`Literal`)&&typeof i.value==`string`?i.value:null},Ws=e=>b(e,`JSXIdentifier`)?e.name:b(e,`JSXMemberExpression`)?`${Ws(e.object)}.${e.property.name}`:b(e,`JSXNamespacedName`)?`${e.namespace.name}:${e.name.name}`:``,Gs=e=>{let t=e.name;return b(t,`JSXIdentifier`)?Hs(t.name)?Us(t)??t.name:t.name:Ws(t)},Ks=(e,t)=>{if(!b(e.name,`JSXIdentifier`))return!1;let n=Gs(e);if(n[0]===n[0]?.toLowerCase())return!0;let r=new Set,i=e=>{let n=P(e);if(b(n,`Literal`))return typeof n.value==`string`;if(b(n,`Identifier`)||b(n,`JSXIdentifier`)){let e=t.symbolFor(n);if(!e||e.kind!==`const`||!e.initializer||r.has(e.id))return!1;r.add(e.id);let a=i(e.initializer);return r.delete(e.id),a}return b(n,`ConditionalExpression`)?i(n.consequent)&&i(n.alternate):!1};return i(e.name)},qs=(e,t,n=new Set)=>{if(!e)return null;let r=w(e);if(O(r))return r;if(b(r,`Identifier`)){let e=t.symbolFor(r);return!e||n.has(e.id)||!e.initializer||V(e,r,t)?null:(n.add(e.id),qs(e.initializer,t,n))}if(!b(r,`CallExpression`)||!Ja(r,`memo`,t,{resolveNamedAliases:!0})&&!Ja(r,`forwardRef`,t,{resolveNamedAliases:!0}))return null;let i=r.arguments[0];return!i||b(i,`SpreadElement`)?null:qs(i,t,n)},Js=(e,t)=>{let n=P(e);if(!O(n)||n.async||n.generator)return!1;let r=n.parent;if(!r||!b(r,`JSXExpressionContainer`))return!1;let i=r.parent;if(!i||!b(i,`JSXAttribute`)||Os(i.name)!==`ref`)return!1;let a=i.parent;return!!(a&&b(a,`JSXOpeningElement`)&&Ks(a,t))},Ys=(e,t)=>t.every((t,n)=>e[n]===t),Xs=e=>{let t=P(e);for(;t.parent&&b(t.parent,`MemberExpression`)&&t.parent.object===t;){if(!C(t.parent))return null;t=P(t.parent)}return t},Zs=(e,t,n,r)=>{if(t.length!==n.length+1||!Ys(t,n)||t[n.length]!==`current`)return!1;let i=Xs(e),a=i?.parent;if(!i||!a||!b(a,`AssignmentExpression`)||a.operator!==`=`||a.left!==i)return!1;let o=j(e);if(!o)return!1;if(Js(o,r))return!0;if(!O(o)||o.async||o.generator)return!1;let s=j(o);if(!s||!Js(s,r))return!1;let c=P(o),l=c.parent;return!!(b(l,`ReturnStatement`)&&l.argument===c&&j(l)===s||b(s,`ArrowFunctionExpression`)&&s.body===c)},Qs=(e,t)=>{if(!b(e,`JSXOpeningElement`))return!1;let n=e.name;if(b(n,`JSXIdentifier`)){if(!t)return n.name===`Fragment`;let e=F(n,t);return e?Ua(e)&&x(e.declarationNode)===`Fragment`:n.name===`Fragment`&&t.isGlobalReference(n)}return b(n,`JSXMemberExpression`)?!b(n.object,`JSXIdentifier`)||n.property.name!==`Fragment`?!1:t?Ga(n.object,t)?!0:n.object.name===`React`&&t.isGlobalReference(n.object):n.object.name===`React`:!1},$s=(e,t,n,r,i)=>{let a=P(e),o=a.parent;if(!o)return!1;if(b(o,`ReturnStatement`)&&o.argument===a)return j(o)===t;if(b(o,`ArrowFunctionExpression`)&&o.body===a)return o===t;if(b(o,`JSXFragment`)&&o.children.some(e=>e===a)||b(o,`JSXElement`)&&o.children.some(e=>e===a)&&(Ks(o.openingElement,n)||Qs(o.openingElement,n)||i.doesCustomElementRenderChildren?.(o.openingElement)))return $s(o,t,n,r,i);if(b(o,`JSXExpressionContainer`)&&o.expression===a&&o.parent&&(b(o.parent,`JSXFragment`)||b(o.parent,`JSXElement`)&&(Ks(o.parent.openingElement,n)||Qs(o.parent.openingElement,n)||i.doesCustomElementRenderChildren?.(o.parent.openingElement))))return $s(o.parent,t,n,r,i);if(b(o,`ConditionalExpression`)&&(o.consequent===a||o.alternate===a)||b(o,`LogicalExpression`)&&(o.left===a||o.right===a)||b(o,`ArrayExpression`)&&o.elements.some(e=>e===a))return $s(o,t,n,r,i);if(!b(o,`VariableDeclarator`)||o.init!==a||!b(o.id,`Identifier`))return!1;let s=n.symbolFor(o.id);if(!s||s.kind!==`const`||s.references.length===0||r.has(s.id))return!1;r.add(s.id);let c=s.references.every(e=>e.flag===`read`&&$s(e.identifier,t,n,r,i));return r.delete(s.id),c},ec=(e,t,n={})=>$s(e,j(e),t,new Set,n),tc=(e,t)=>t.every((t,n)=>e[n]===t),nc=(e,t)=>tc(e,t)||tc(t,e),rc=e=>O(e)&&b(e.body,`BlockStatement`)&&e.body.body.length===0,ic=(e,t,n)=>Ja(e,t,n,{resolveNamedAliases:!0}),ac=(e,t,n=new Set)=>b(e,`ObjectExpression`)?e.properties.every(e=>{if(b(e,`SpreadElement`)){let r=P(e.argument);if(b(r,`ObjectExpression`))return ac(r,t,n);if(!b(r,`Identifier`))return!1;let i=t.symbolFor(r);if(!i||i.kind!==`const`||n.has(i.id)||!b(i.initializer,`ObjectExpression`))return!1;n.add(i.id);let a=ac(i.initializer,t,n);return n.delete(i.id),a}return b(e,`Property`)?!O(e.value)||rc(e.value):!1}):!1,oc=e=>C(e)||(e.computed&&b(e.property,`Literal`)&&typeof e.property.value==`number`&&Number.isSafeInteger(e.property.value)&&e.property.value>=0?String(e.property.value):null),sc=e=>{let t=[],n=P(e);for(;n.parent&&b(n.parent,`MemberExpression`)&&n.parent.object===n;){let e=oc(n.parent);if(!e)return null;t.push(e),n=P(n.parent)}return{expression:n,propertyPath:t}},cc=(e,t,n)=>{let r=n.environmentsByProgram.get(e);if(r)return r;let i={filename:t,program:e,scopes:A(e)};return n.environmentsByProgram.set(e,i),i},lc=(e,t,n=new Set)=>{let r=P(e);if(b(r,`Identifier`)){let e=t.symbolFor(r);return!e||!e.initializer||n.has(e.id)||V(e,r,t)?!1:(n.add(e.id),lc(e.initializer,t,n))}if(!b(r,`CallExpression`))return!1;if(ic(r,`forwardRef`,t))return!0;if(!ic(r,`memo`,t))return!1;let i=r.arguments[0];return!i||b(i,`SpreadElement`)?!1:lc(i,t,n)},uc=(e,t)=>{let n=cc(e.programNode,e.filePath,t),r=qs(e.exportedNode,n.scopes);return r?{environment:n,functionNode:r,isForwardRef:lc(e.exportedNode,n.scopes)}:null},dc=(e,t,n)=>{if(!b(e,`Identifier`)&&!b(e,`JSXIdentifier`))return null;let r=t.scopes.symbolFor(e);if(r&&r.kind!==`import`){if(V(r,e,t.scopes))return null;let n=qs(r.initializer,t.scopes);return n?{environment:t,functionNode:n,isForwardRef:!!(r.initializer&&lc(r.initializer,t.scopes))}:null}let i=fo(e,e.name);if(!i||i.isNamespace||i.exportedName===null)return null;let a=R(t.filename,i.source,i.exportedName);return a?uc(a,n):null},fc=(e,t,n)=>{if(b(e,`JSXIdentifier`))return dc(e,t,n);if(!b(e,`JSXMemberExpression`)||!b(e.object,`JSXIdentifier`))return null;let r=fo(e.object,e.object.name);if(!r?.isNamespace)return null;let i=R(t.filename,r.source,e.property.name);return i?uc(i,n):null},pc=(e,t,n=new Set)=>{let r=P(e);if(b(r,`Identifier`)){let e=t.scopes.symbolFor(r);return!e||!e.initializer||n.has(e.id)||V(e,r,t.scopes)?!1:(n.add(e.id),pc(e.initializer,t,n))}return js(r,t.scopes)},mc=(e,t,n)=>{if(!b(e,`JSXIdentifier`))return!1;let r=t.scopes.symbolFor(e);if(r&&r.kind!==`import`)return V(r,e,t.scopes)?!1:!!(r.initializer&&pc(r.initializer,t));let i=fo(e,e.name);if(!i||i.isNamespace||i.exportedName===null)return!1;let a=R(t.filename,i.source,i.exportedName);if(!a)return!1;let o=cc(a.programNode,a.filePath,n);return pc(a.exportedNode,o)},hc=(e,t)=>{if(!e)return null;let n=P(e);return!b(n,`ClassDeclaration`)&&!b(n,`ClassExpression`)||!pc(n,t)?null:{classNode:n,environment:t}},gc=(e,t,n)=>{if(!b(e,`JSXIdentifier`))return null;let r=t.scopes.symbolFor(e);if(r&&r.kind!==`import`)return V(r,e,t.scopes)?null:hc(r.initializer,t);let i=fo(e,e.name);if(!i||i.isNamespace||i.exportedName===null)return null;let a=R(t.filename,i.source,i.exportedName);if(!a)return null;let o=cc(a.programNode,a.filePath,n);return hc(a.exportedNode,o)},_c=(e,t,n)=>{let r=[...t],i=P(e);for(;i.parent;){let e=i.parent;if(b(e,`ArrayExpression`)){if(e.elements.some(e=>e&&b(e,`SpreadElement`)))return null;let t=e.elements.findIndex(e=>e===i);if(t<0)return null;r.unshift(String(t)),i=P(e);continue}if(b(e,`Property`)&&e.value===i){let t=S(e,{allowComputedString:!0}),a=e.parent;if(!t||!a||!ac(a,n.scopes))return null;r.unshift(t),i=P(a);continue}if(b(e,`ConditionalExpression`)&&(e.consequent===i||e.alternate===i)||b(e,`LogicalExpression`)&&(e.left===i||e.right===i)){i=P(e);continue}if(b(e,`VariableDeclarator`)&&e.init===i&&b(e.id,`Identifier`)){let t=n.scopes.symbolFor(e.id);return!t||t.kind!==`const`?null:{environment:n,propertyPath:r,symbol:t}}if(b(e,`AssignmentExpression`)&&e.operator===`=`&&e.right===i&&b(e.left,`MemberExpression`)){let t=[],i=e.left;for(;b(i,`MemberExpression`);){let e=oc(i);if(!e)return null;t.unshift(e),i=P(i.object)}if(!b(i,`Identifier`))return null;let a=n.scopes.symbolFor(i);return!a||a.kind!==`const`?null:{environment:n,originWriteReference:i,propertyPath:[...t,...r],symbol:a}}return null}return null},vc=(e,t,n,r,i)=>{if(b(e,`AssignmentPattern`))return vc(e.left,t,n,r,i);if(b(e,`Identifier`)){let a=n.scopes.symbolFor(e);return!!(a&&Pc({environment:n,propertyPath:t,symbol:a},r,i-1))}if(!b(e,`ObjectPattern`)||t.length===0)return!1;let[a,...o]=t;for(let t of e.properties){if(!b(t,`Property`))continue;let e=S(t,{allowComputedString:!0});if(!e)return!1;if(e===a)return vc(t.value,o,n,r,i)}let s=e.properties.find(e=>b(e,`RestElement`));return s?vc(s.argument,t,n,r,i):!0},yc=(e,t)=>{let n=e.arguments[0];return!n||b(n,`SpreadElement`)?!1:ic(e,`createElement`,t.scopes)?b(n,`Literal`)&&typeof n.value==`string`:!ic(e,`cloneElement`,t.scopes)||!b(n,`JSXElement`)?!1:Ks(n.openingElement,t.scopes)},bc=(e,t,n,r,i)=>{if(t.length>0)return!1;let a=e.parent;if(!a||!b(a,`Property`)||a.value!==e||S(a,{allowComputedString:!0})!==`ref`)return!1;let o=a.parent;if(!o||!b(o,`ObjectExpression`))return!1;let s=o.parent;return!(!s||!b(s,`CallExpression`)||s.arguments[1]!==o||!yc(s,n)||!wc(s,n,r,i))},xc=(e,t,n,r,i)=>{if(i<=0||!O(e.functionNode)||e.functionNode.async||e.functionNode.generator)return!1;let a=e.functionNode.params[t];return!!(a&&vc(a,n,e.environment,r,i))},Sc=e=>{if(!b(e,`MemberExpression`)||C(e)!==`children`)return!1;let t=P(e.object);return!!(b(t,`MemberExpression`)&&C(t)===`props`&&b(P(t.object),`ThisExpression`))},Cc=(e,t)=>{if(!b(e,`JSXOpeningElement`)||!b(e.name,`JSXMemberExpression`)||e.name.property.name!==`Provider`||!b(e.name.object,`JSXIdentifier`))return!1;let n=t.scopes.symbolFor(e.name.object);return!!(n?.kind===`const`&&n.initializer&&b(n.initializer,`CallExpression`)&&ic(n.initializer,`createContext`,t.scopes))},wc=(e,t,n,r)=>ec(e,t.scopes,{doesCustomElementRenderChildren:e=>Dc(e,t,n,r-1)}),Tc=(e,t,n)=>{let{functionNode:r}=e;if(n<=0||t.activeRenderedChildrenComponents.has(r)||!b(r,`ArrowFunctionExpression`)&&!b(r,`FunctionExpression`)&&!b(r,`FunctionDeclaration`)||r.async||r.generator)return!1;let i=to(r,e.environment.scopes);if(!i)return!1;t.activeRenderedChildrenComponents.add(r);let a=i.every(r=>wc(r,e.environment,t,n));return t.activeRenderedChildrenComponents.delete(r),a},Ec=(e,t,n)=>{let{classNode:r,environment:i}=e;if(n<=0||t.activeRenderedChildrenComponents.has(r)||!b(r,`ClassDeclaration`)&&!b(r,`ClassExpression`))return!1;let a=r.body.body.find(e=>b(e,`MethodDefinition`)&&!e.computed&&b(e.key,`Identifier`)&&e.key.name===`render`);if(!a||!b(a,`MethodDefinition`))return!1;let o=[];if(z(r,e=>{Sc(e)&&o.push(e)}),o.length===0)return!1;t.activeRenderedChildrenComponents.add(r);let s=o.every(e=>j(e)===a.value&&wc(e,i,t,n));return t.activeRenderedChildrenComponents.delete(r),s},Dc=(e,t,n,r)=>{if(r<=0||!b(e,`JSXOpeningElement`))return!1;if(Cc(e,t))return!0;let i=fc(e.name,t,n);if(i)return Tc(i,n,r);let a=gc(e.name,t,n);return!!(a&&Ec(a,n,r))},Oc=(e,t,n,r,i)=>{let a=Os(e.name),o=e.parent;if(!a||!o||!b(o,`JSXOpeningElement`))return!1;let s=o.parent;if(!s||!b(s,`JSXElement`)||!wc(s,n,r,i))return!1;if(Ks(o,n.scopes))return a===`ref`&&t.length===0;if(b(o.name,`JSXIdentifier`)&&a===`ref`&&t.length===0&&mc(o.name,n,r))return!0;let c=fc(o.name,n,r);return c?a===`ref`&&c.isForwardRef?xc(c,1,t,r,i):xc(c,0,[a,...t],r,i):!1},kc=(e,t,n,r,i,a)=>{let o=e.arguments.findIndex(e=>e===t);if(o<0)return!1;if(o===0&&b(e.callee,`Identifier`)&&e.callee.name===`Boolean`&&r.scopes.isGlobalReference(e.callee))return!0;if(o===0&&ic(e,`useImperativeHandle`,r.scopes))return n.length===0;if(o===1&&n.length===1&&n[0]===`ref`&&yc(e,r)&&wc(e,r,i,a))return!0;let s=P(e.callee);if(O(s))return Ds(s,r.scopes)&&!wc(e,r,i,a)?!1:xc({environment:r,functionNode:s,isForwardRef:!1},o,n,i,a);if(!b(e.callee,`Identifier`))return!1;let c=dc(e.callee,r,i);return!!(c&&(!Ds(c.functionNode,c.environment.scopes)||wc(e,r,i,a))&&xc(c,o,n,i,a))},Ac=(e,t,n,r,i)=>{let a;if(t.length===1&&t[0]===`ref`)a=e.parent;else if(t.length===0){let t=e.parent;if(!t||!b(t,`Property`)||t.value!==e||S(t,{allowComputedString:!0})!==`ref`)return!1;a=t.parent?.parent}if(!a||!b(a,`JSXSpreadAttribute`))return!1;let o=a.parent;if(!o||!b(o,`JSXOpeningElement`))return!1;let s=o.parent;return!!(Ks(o,n.scopes)&&s&&b(s,`JSXElement`)&&wc(s,n,r,i))},jc=(e,t,n,r,i)=>{let a=P(e),o=a.parent;if(!o)return!1;if(b(o,`ExpressionStatement`)||b(o,`UnaryExpression`)&&o.operator===`void`&&o.argument===a)return!0;if(t.length===0&&b(o,`BinaryExpression`)&&(o.operator===`===`||o.operator===`!==`||o.operator===`==`||o.operator===`!=`)){let e=o.left===a?o.right:o.left;return!!(b(a,`Identifier`)&&b(e,`Identifier`)&&n.scopes.symbolFor(a)?.id===n.scopes.symbolFor(e)?.id)}if(Ac(a,t,n,r,i)||bc(a,t,n,r,i)||t.length>0&&(b(o,`LogicalExpression`)&&o.left===a||b(o,`ConditionalExpression`)&&o.test===a||b(o,`IfStatement`)&&o.test===a||b(o,`UnaryExpression`)&&o.operator===`!`&&o.argument===a))return!0;if(b(o,`JSXExpressionContainer`)&&o.expression===a){let e=o.parent;return!!(e&&b(e,`JSXAttribute`)&&Oc(e,t,n,r,i))}if(b(o,`CallExpression`))return kc(o,a,t,n,r,i);if(b(o,`VariableDeclarator`)&&o.init===a&&!b(o.id,`Identifier`))return vc(o.id,t,n,r,i);let s=_c(a,t,n);return!!(s&&Pc(s,r,i-1))},Mc=e=>{let t=e.parent;return t&&b(t,`VariableDeclarator`)&&t.init===e&&b(t.id,`Identifier`)?t.id:(b(e,`FunctionDeclaration`)||b(e,`FunctionExpression`))&&e.id?e.id:null},Nc=(e,t,n)=>{if(!e||!t||!O(e)||e.async||e.generator)return!1;let r=Mc(e);if(!r||((b(e,`FunctionDeclaration`)||b(e,`FunctionExpression`))&&e.id===r?j(e):j(r))!==t)return!1;let i=b(e,`FunctionDeclaration`)?n.ownScopeFor(t)?.symbolsByName.get(r.name):n.symbolFor(r);return!!(i&&i.references.length>0&&i.references.every(e=>{let r=P(e.identifier),i=r.parent;return!!(i&&b(i,`CallExpression`)&&i.callee===r&&j(i)===t&&ec(i,n))}))},Pc=(e,t,n)=>{if(n<=0)return!1;let r=`${e.environment.filename}:${e.symbol.id}:${e.propertyPath.join(`.`)}`;if(t.activePaths.has(r))return!1;t.activePaths.add(r);let i=j(e.symbol.bindingIdentifier),a=e.symbol.references.every(r=>{if(r.identifier===e.originWriteReference)return!0;let a=r.identifier.parent;if(a&&b(a,`Property`)&&!a.computed&&a.key===r.identifier&&a.value!==r.identifier)return!0;let o=sc(r.identifier);if(!o)return!1;if(!nc(o.propertyPath,e.propertyPath))return!0;let s=j(r.identifier);if(s!==i&&!Nc(s,i,e.environment.scopes))return!!Zs(r.identifier,o.propertyPath,e.propertyPath,e.environment.scopes);if(r.flag!==`read`)return!1;if(tc(o.propertyPath,e.propertyPath)){if(o.propertyPath.length>e.propertyPath.length){let t=o.expression.parent;return!!(o.propertyPath.length===e.propertyPath.length+1&&o.propertyPath[e.propertyPath.length]===`current`&&t&&b(t,`UnaryExpression`)&&t.operator===`void`&&t.argument===o.expression)}return jc(o.expression,[],e.environment,t,n)}return jc(o.expression,e.propertyPath.slice(o.propertyPath.length),e.environment,t,n)});return t.activePaths.delete(r),a},Fc=(e,t,n)=>{if(!t)return!1;let r=zt(e);if(!r)return!1;let i={filename:t,program:r,scopes:n},a={activePaths:new Set,activeRenderedChildrenComponents:new WeakSet,environmentsByProgram:new WeakMap([[r,i]])},o=_c(e,[],i);return o?Pc(o,a,12):jc(e,[],i,a,12)},Ic=e=>{let t=[];for(let n of e)for(let e of n.entries){if(e.importName.kind===`NamespaceObject`)continue;let r=e.importName.kind===`Default`?`default`:e.importName.name??null;r!==null&&t.push({source:n.moduleRequest.value,exportedName:r})}return t},Lc=({absoluteFilePath:e,staticImports:t})=>{let n=!1;for(let r of t){let t=r.moduleRequest.value;if(!t.startsWith(`.`))continue;let i=r.entries.filter(e=>!e.isType);if(i.length===0)continue;let a=Bn(e,t);if(!(!a||!Di(a))){n||(n=!0,Jr(e));for(let e of i){let t=e.importName.kind===`Default`?`default`:e.importName.name;t&&$a(a,t)}}}},Rc=({absoluteFilePath:e})=>{_r.test(e)&&(xr.test(e)||ci(e))},zc=({absoluteFilePath:e,staticImports:t})=>{if(vr.test(e)&&!di(e))for(let n of Ic(t))sr(e,n.source,n.exportedName)},H=({absoluteFilePath:e,staticImports:t})=>{Ne(e);for(let n of Ic(t))sr(e,n.source,n.exportedName)},Bc=({absoluteFilePath:e,getProgram:t})=>{let n=t();un(n);let r=A(n);z(n,t=>{if(!b(t,`CallExpression`))return;let n=xe(t.callee,r);!n?.importedName||!n.source.startsWith(`.`)||sr(e,n.source,n.importedName)})},Vc=({absoluteFilePath:e,staticImports:t})=>{for(let n of Ic(t))R(e,n.source,n.exportedName)},Hc=(e,t,n,r)=>{let i=n.get(t);if(!(i!==void 0&&i<=r)){n.set(t,r);for(let i of e.body??[]){let e=fi(i);if(!e)continue;let a=rr(t,e);if(!a||r>=8)continue;let o=r+1,s=n.get(a);if(s!==void 0&&s<=o)continue;let c=yn(a);if(!c){n.set(a,o);continue}Hc(c,a,n,o)}}},Uc=e=>{Vc(e);let t=e.getProgram(),n=!1;z(t,e=>{if(n)return!1;if(!b(e,`CallExpression`))return;let t=w(e.callee);if(!b(t,`MemberExpression`))return;let r=C(t);n=r===`add`||r===`set`}),n&&Hc(t,e.absoluteFilePath,new Map,0)},Wc=({absoluteFilePath:e,staticImports:t})=>{for(let n of Ic(t))eo(e,n.source,n.exportedName)},Gc=e=>{let t=[];for(let n of e.body??[]){if(n.type!==`ImportDeclaration`)continue;let e=n.source?.value;if(typeof e==`string`){for(let r of n.specifiers??[])if(r.type===`ImportDefaultSpecifier`)t.push({source:e,exportedName:`default`});else if(r.type===`ImportSpecifier`){let n=r.imported,i=null;typeof n?.name==`string`?i=n.name:typeof n?.value==`string`&&(i=n.value),i&&t.push({source:e,exportedName:i})}}}return t},Kc=({absoluteFilePath:e,staticImports:t},n,r=()=>!0,i=()=>!0)=>{let a=new Map,o=(e,t,n)=>{if(!((a.get(e)??-1)>=n)){a.set(e,n);for(let a of Gc(t)){let t=R(e,a.source,a.exportedName);!t||n===0||!r(t)||!i(t.filePath)||o(t.filePath,t.programNode,n-1)}}};for(let a of Ic(t)){let t=R(e,a.source,a.exportedName);!t||!r(t)||!i(t.filePath)||o(t.filePath,t.programNode,n)}},qc=e=>{let t=e.getProgram();un(t);let n=A(t);z(t,t=>{if(b(t,`BlockStatement`))for(let[r,i]of t.body.entries()){let a=t.body[r+1];!b(i,`VariableDeclaration`)||!b(a,`VariableDeclaration`)||hr(i,a,n,e.absoluteFilePath)}})},Jc=e=>{Kc(e,4),Vc(e),Ue(e.absoluteFilePath,`@xstate/react`)},Yc=({absoluteFilePath:e,sourceText:t,getProgram:n})=>{if(!t.includes(`createRef`)&&!t.includes(`\\u`))return;let r=n();un(r);let i=A(r);z(r,t=>{!b(t,`CallExpression`)||!Ja(t,`createRef`,i,{allowGlobalReactNamespace:!0,allowUnboundBareCalls:!0,resolveNamedAliases:!0})||Fc(t,e,i)})},Xc=({absoluteFilePath:e,sourceText:t,staticImports:n,getProgram:r})=>{let i=new Set,a=new Set;for(let e of n)if(e.moduleRequest.value===`react`)for(let t of e.entries){let{importName:e}=t;e.kind===`Name`&&e.name===`useReducer`?i.add(t.localName.value):(e.kind===`Default`||e.kind===`NamespaceObject`)&&a.add(t.localName.value)}if(!(i.size>0||a.size>0&&(t.includes(`useReducer`)||t.includes(`\\u`))))return;let o=r(),s=e=>{if(e?.type!==`Identifier`)return null;let{name:t}=e;return typeof t==`string`?t:null},c=e=>{let t=s(e);if(t!==null)return i.has(t);if(e.type!==`MemberExpression`)return!1;let n=e,r=s(n.object);return r!==null&&a.has(r)&&s(n.property)===`useReducer`},l=new Set;if(z(o,e=>{if(e.type!==`CallExpression`)return;let t=e;if(!t.callee||!c(t.callee))return;let n=t.arguments?.[0];if(!n)return;let r=s(w(n));r!==null&&l.add(r)}),l.size!==0)for(let t of n)for(let n of t.entries){if(n.importName.kind===`NamespaceObject`||!l.has(n.localName.value))continue;let r=n.importName.kind===`Default`?`default`:n.importName.name;r&&sr(e,t.moduleRequest.value,r)}},Zc=({absoluteFilePath:e,staticImports:t,getProgram:n})=>{Jr(e),Yr({absoluteFilePath:e,staticImports:t,program:n()})},U=({absoluteFilePath:e})=>{Jr(e)},Qc=e=>{U(e),Wc(e)},$c=e=>{U(e),Kc(e,1/0,e=>O(e.exportedNode),e=>!e.split(/[\\/]/).includes(`node_modules`))},el=({absoluteFilePath:e})=>{Bi(e)},tl=({absoluteFilePath:e})=>{Ue(e,`react-native`)},nl=({absoluteFilePath:e})=>{Vi(e)},rl=e=>{nl(e),Yr({absoluteFilePath:e.absoluteFilePath,staticImports:e.staticImports,program:e.getProgram()})},il=new Map([...ne.map(e=>[e,nl]),[`ink-no-raw-text`,rl],[`client-passive-event-listeners`,H],[`effect-needs-cleanup`,H],[`effect-listener-cleanup-reference-mismatch`,H],[`exhaustive-deps`,Jc],[`rules-of-hooks`,Bc],[`no-barrel-import`,Lc],[`nextjs-async-dynamic-api-not-awaited`,U],[`nextjs-missing-metadata`,Rc],[`nextjs-no-use-search-params-without-suspense`,zc],[`no-dynamic-import-path`,U],[`no-full-lodash-import`,U],[`no-hydration-branch-on-browser-global`,Qc],[`no-indeterminate-attribute`,U],[`no-locale-format-in-render`,U],[`no-match-media-in-state-initializer`,U],[`no-create-ref-in-function-component`,Yc],[`no-adjust-state-on-prop-change`,H],[`no-set-state-after-await-in-effect`,H],[`no-derived-state`,H],[`no-derived-state-effect`,H],[`no-event-handler`,H],[`no-initialize-state`,H],[`no-reset-all-state-on-prop-change`,H],[`no-mutating-reducer-state`,Xc],[`no-side-effect-in-state-updater-function`,Uc],[`no-unguarded-browser-global-at-module-scope`,Wc],[`no-unguarded-browser-global-in-render-or-hook-init`,$c],[`prefer-dynamic-import`,U],[`rendering-hydration-mismatch-time`,U],[`rendering-hydration-no-flicker`,H],[`rerender-memo-with-default-value`,Jc],[`server-sequential-independent-await`,qc],[`rn-no-deprecated-modules`,tl],[`rn-no-legacy-shadow-styles`,el],[`rn-no-raw-text`,Zc],[`rn-prefer-expo-image`,U],[`rn-style-prefer-boxshadow`,el],...oe.map(e=>[e,U])]),al=new Set([`anchor-target-exists`,`nextjs-no-img-element`,`no-img-without-dimensions`,`no-loading-flag-reset-outside-finally`,`only-export-components`,`remotion-calculate-metadata-fetch-signal`,`remotion-deterministic-randomness`,`remotion-no-css-animation`,`remotion-no-css-transition`,`remotion-no-css-url-assets`,`remotion-no-native-media-elements`,`remotion-no-next-image`,`window-open-without-noopener`]),ol=e=>{let t=new Set;for(let n of e.ruleIds){let e=il.get(n);if(!e)return null;t.add(e)}let n=Xa(e.absoluteFilePath),r,i;try{let t=hn(n,e.sourceText);if(t.errors.some(e=>e.severity===`Error`))return null;r=t.module.staticImports;let a;i=()=>(a??=t.program,a)}catch{return null}let a={absoluteFilePath:n,sourceText:e.sourceText,staticImports:r,getProgram:i};return Ee(()=>{for(let e of t)e(a)})},sl={},cl=(e,t,n)=>!e||e.length===0?!1:e.every(e=>b(e,t)&&e[n]===`type`),ll=e=>e.importKind===`type`||cl(e.specifiers,`ImportSpecifier`,`importKind`),ul=new Set([`solid-js`,`solid-js/web`,`solid-js/store`,`solid-js/h`,`solid-js/html`,`@builder.io/qwik`,`@builder.io/qwik-city`,`@builder.io/qwik-react`,`voby`,`vidode`]),dl=[`solid-js`,`@builder.io/qwik`],fl=[`react`,`react-dom`,`preact`],pl=new WeakMap,ml=new WeakMap,hl=(e,t)=>t.some(t=>e===t||e.startsWith(`${t}/`)),gl=e=>{let t=pl.get(e);if(t)return t;let n=!1,r=!1,i=!1,a=!1,o=!1,s=!1;for(let t of e.body){if(i||z(t,e=>{if(i)return!1;if(b(e,`JSXOpeningElement`)&&_l(e))return i=!0,!1;b(e,`JSXOpeningElement`)&&b(e.name,`JSXIdentifier`)&&/^[a-z]/.test(e.name.name)&&e.attributes.some(e=>b(e,`JSXAttribute`)&&Os(e.name)===`class`)&&(s=!0)}),!b(t,`ImportDeclaration`))continue;let e=t,c=e.source,l=c&&typeof c.value==`string`?c.value:null;if(l){if(l===`solid-js`)for(let t of e.specifiers){if(!b(t,`ImportSpecifier`)||e.importKind!==`type`&&t.importKind!==`type`)continue;let n=x(t);n===`Component`&&(a=!0),n===`JSX`&&(o=!0)}ll(e)||((ul.has(l)||hl(l,dl))&&(n=!0),hl(l,fl)&&(r=!0))}}let c={hasNonReactMarker:i||a||o&&s,hasNonReactRuntime:n,hasReactRuntime:r};return pl.set(e,c),c},_l=e=>{let t=ml.get(e);if(t!==void 0)return t;let n=!1;for(let t of e.attributes){if(!b(t,`JSXAttribute`))continue;let r=Os(t.name);if(r&&(r===`classList`&&b(t.value,`JSXExpressionContainer`)&&b(t.value.expression,`ObjectExpression`)||b(e.name,`JSXIdentifier`)&&/^[a-z]/.test(e.name.name)&&(r.startsWith(`class:`)||r.startsWith(`bind:`)||r.startsWith(`on:`)||r.startsWith(`oncapture:`)))){n=!0;break}}return ml.set(e,n),n},vl=new Set(`/playground/./playgrounds/./examples/./example/./demo/./demos/./sandbox/./sandboxes/./specs/./spec/./integration/./it/./perf/./scripts/./cli/./bin/./tooling/./tools/./codemods/./codemod/./migrations/./migration/./generators/./generator/./runbooks/./devtools/./internal-tools/./seeds/./seed/./dev-seeder/`.split(`.`)),yl=new Set,bl=[`/test/`,`/tests/`,`/testing/`,`/__tests__/`,`/__test__/`,`/__fixtures__/`,`/fixtures/`,`/__mocks__/`,`/mocks/`,`/testUtils/`,`/test-utils/`,`/test-stubs/`,`/testutils/`,`/cypress/`,`/playwright/`,`/.storybook/`,`/.dumi/`,`/stories/`,`/__stories__/`,...vl,`/e2e/`,`/e2e-tests/`,`/integration-tests/`,`/benchmarks/`,`/benchmark/`,`/__benchmarks__/`,`/perf-tests/`],xl=[`.test.`,`.spec.`,`.cy.`,`.stories.`,`.story.`,`.bench.`,`.benchmark.`,`.e2e.`,`.integration-spec.`,`.int-spec.`,`.mock.`,`.mocks.`,`.fixture.`],Sl=new Set(`setuptests.js,setuptests.ts,setuptests.jsx,setuptests.tsx,setupvitest.js,setupvitest.ts,setupvitest.jsx,setupvitest.tsx,setupjest.js,setupjest.ts,vitest.setup.js,vitest.setup.ts,vitest.setup.mjs,vitest.config.ts,vitest.config.js,vitest.config.mts,vitest.config.mjs,jest.setup.js,jest.setup.ts,jest.setup.jsx,jest.setup.tsx,jest.config.js,jest.config.ts,jest.config.mjs,playwright.config.ts,playwright.config.js,cypress.config.ts,cypress.config.js,karma.conf.js,karma.conf.ts,vite.config.ts,vite.config.js,vite.config.mts,vite.config.mjs,webpack.config.ts,webpack.config.js,webpack.config.mjs,rollup.config.ts,rollup.config.js,rollup.config.mjs,esbuild.config.ts,esbuild.config.js,esbuild.config.mjs,tsup.config.ts,tsup.config.js,tsup.config.mjs,rsbuild.config.ts,rsbuild.config.js,rspack.config.ts,rspack.config.js,next.config.ts,next.config.js,next.config.mjs,remix.config.js,remix.config.ts,astro.config.ts,astro.config.js,astro.config.mjs,tailwind.config.ts,tailwind.config.js,tailwind.config.mjs,postcss.config.ts,postcss.config.js,postcss.config.mjs,biome.config.ts,biome.config.js,drizzle.config.ts,drizzle.config.js,prisma.config.ts,prisma.config.js,knip.config.ts,knip.config.js,knip.config.mjs,lint-staged.config.js,lint-staged.config.mjs`.split(`,`)),Cl=[`/src/`,`/app/`,`/lib/`,`/components/`,`/pages/`,`/features/`,`/modules/`,`/packages/`,`/apps/`,`/frontend/`,`/client/`],wl=bl.filter(e=>e.startsWith(`/.`)),Tl=e=>{let t=-1;for(let n of Cl){let r=e.lastIndexOf(n);r>t&&(t=r)}return t<0?e:e.slice(t)};let El,Dl=!1,Ol,kl=!1;const Al=e=>e?e===El?Dl:(El=e,Dl=Nl(e),Dl):!1,jl=e=>{if(!e)return!1;if(e===Ol)return kl;Ol=e;let t=e.replaceAll(`\\`,`/`),n=t.startsWith(`/`)?t:`/${t}`;return kl=Nl(n,Cl.some(e=>n.includes(e))?vl:yl),kl},Ml=(e,t)=>e?Nl(e,t):!1,Nl=(e,t=yl)=>{let n=e.replaceAll(`\\`,`/`),r=n.lastIndexOf(`/`),i=r===-1?n:n.slice(r+1);if(Sl.has(i.toLowerCase()))return!0;for(let e of xl)if(i.includes(e))return!0;let a=n.startsWith(`/`)?n:`/${n}`;for(let e of wl)if(!t.has(e)&&a.includes(e))return!0;let o=Tl(n);for(let e of bl)if(!t.has(e)&&(e.startsWith(`/.`)?n:o).includes(e))return!0;return!1},Pl=(e,t=Al)=>n=>t(n.filename)?sl:e(n),Fl=e=>{let t=e?.[`react-doctor`];return typeof t!=`object`||!t||Array.isArray(t)?null:t},Il=(e,t)=>Object.getOwnPropertyDescriptor(e,t)?.value,Ll=(e,t)=>{let n=Fl(e);if(!n)return;let r=Il(n,t);return typeof r==`string`?r:void 0},Rl=(e,t)=>{let n=Fl(e);if(!n)return;let r=Il(n,t);return typeof r==`number`&&Number.isFinite(r)?r:void 0},zl=new WeakMap,Bl=(e,t)=>{let n=Il(e,t);if(Array.isArray(n))return n.filter(e=>typeof e==`string`&&e.length>0)},Vl=(e,t)=>{let n=Fl(e);if(!n)return;let r=zl.get(n);if(r||(r=new Map,zl.set(n,r)),r.has(t))return r.get(t);let i=Bl(n,t);return r.set(t,i),i},Hl=(e,t)=>Vl(e,t)??[],Ul=(e,t)=>Hl(e,`capabilities`).includes(t),Wl=(e,t)=>{let n=Fl(e);return!n||Il(n,`capabilities`)===void 0?!0:Ul(e,t)},Gl=(e,t,n)=>!t?.some(t=>!Wl(e,t))&&!n?.some(t=>Ul(e,t)),Kl=(e,t,n)=>r=>Gl(r.settings,t,n)?e(r):sl,ql=e=>(t=>{let n=e(t),r=!1,i=!1,a={};for(let e in n){if(!Object.hasOwn(n,e))continue;let t=n[e];if(typeof t!=`function`){a[e]=t;continue}let o=e.charAt(0);if(o<`A`||o>`Z`){a[e]=t;continue}if(e===`Program`){a.Program=e=>{let n=gl(e);i=n.hasReactRuntime,r=!n.hasReactRuntime&&(n.hasNonReactRuntime||n.hasNonReactMarker),!r&&t(e)};continue}if(e===`JSXOpeningElement`){a.JSXOpeningElement=e=>{!i&&!r&&_l(e)&&(r=!0),!r&&t(e)};continue}a[e]=e=>{r||t(e)}}return`Program`in a||(a.Program=e=>{let t=gl(e);i=t.hasReactRuntime,r=!t.hasReactRuntime&&(t.hasNonReactRuntime||t.hasNonReactMarker)}),a}),W=e=>{if(!(`create`in e))return{...e,create:()=>sl};let t=e.tags,n=e.create,r=t?.includes(`test-noise`)&&!t?.includes(`migration-hint`);return t?.includes(`react-jsx-only`)&&(n=ql(n)),r&&(n=Pl(n,jl)),(e.requires||e.disabledWhen)&&(n=Kl(n,e.requires,e.disabledWhen)),n===e.create?e:{...e,create:n}};let Jl;const Yl=e=>{let t=[0];for(let n=0;n<e.length;n+=1){let r=e[n];if(r===`\r`&&e[n+1]===`
3
3
  `){n+=1,t.push(n+1);continue}(r===`\r`||r===`
4
4
  `||r===`\u2028`||r===`\u2029`)&&t.push(n+1)}return t},Xl=e=>{if(Jl?.content===e)return Jl.lineStartOffsets;let t=Yl(e);return Jl={content:e,lineStartOffsets:t},t},G=(e,t)=>{if(Number.isNaN(t)||t<0)return{line:1,column:1};let n=Xl(e),r=Math.min(Math.trunc(t),e.length),i=0,a=n.length-1;for(;i<a;){let e=i+a+1>>1;n[e]<=r?i=e:a=e-1}return{line:i+1,column:r-n[i]+1}},Zl=(e,t)=>G(e,e.search(t)),Ql=/\.(?:[cm]?[jt]sx?|json|jsonc|map|html?|mdx?|ya?ml|toml|sql|rules|env|txt|log|svg|xml|pem|key|crt|cert|pub|py|php)$/i,$l=/(?:^|\/)\.env(?:\.|$)/,eu=/\.(?:[cm]?[jt]sx?)$/i,tu=/\.(?:[cm]?[jt]sx?|py|php)$/i,nu=/\.(?:[cm]?[jt]sx?|py)$/i,ru=/(?:^|\/)(?:api|backend|server|servers|middleware|route|routes|functions|lambdas|workers)(?:\/|$)|(?:^|\/)[^/]+\.server\.[cm]?[jt]sx?$/i,iu=/(?:^|\/)(?:__fixtures__|__mocks__|__tests__|__integration__|fixtures|mocks|test|tests|testdata|test-data|e2e|playwright|cypress|specs?)(?:\/|$)|^(?:test|spec)-[^/]+\.[cm]?[jt]sx?$|\.(?:test|spec|e2e|e2e-spec|integration-test|fixture|fixtures|stories|story)\.[cm]?[jt]sx?$|(?:^|\/)(?:playwright|cypress|vitest|jest|karma)[^/]*\.conf(?:ig)?\.[cm]?[jt]s$|(?:^|\/)(?:test_[^/]+|[^/]+_test|conftest)\.py$|\.env\.[^/]*(?:test|e2e)[^/]*$/i,au=/(?:^|\/)(?:vite|next|nuxt|astro|remix|webpack|rollup|rspack|rsbuild|esbuild|tsup|metro|expo|babel|tailwind|postcss|svelte|farm|parcel|snowpack)[^/]*\.config\.[cm]?[jt]sx?$/i,ou=/(?:^|\/)scripts(?:\/|$)/i,su=/(?:^|\/)(?:examples?|tutorials?|demos?|samples?|playgrounds?)(?:\/|$)/i,cu=/(?:^|\/)(?:README|CHANGELOG|CONTRIBUTING|PUBLISHING|DOCS)\.mdx?$|\.mdx?$/i,lu=/(?:^|\/)(?:generated|__generated__|dist|build|coverage|out|storybook-static|vendor|vendors|third[-_]?party|libraries)(?:\/|$)|(?:^|\/)\.next\/|(?:^|\/)\.open-next\/|(?:^|\/)\.yarn\/|(?:^|\/)public\/(?:chunks?|assets?|build|dist|static)\/|(?:generated|\.gen)\.[cm]?[jt]sx?$|@\d+\.\d+\.\d+(?:[-.][\w.]+)?\.[cm]?js$|[.-]min\.[cm]?js$|\.asm\.js$|(?:^|\/)[\w-]+[.@-]\d+\.\d+\.\d+(?:[-.][\w.]+)?\//i,uu=/\.(iife|umd|global|min)\.js$/i,du=[/(?:^|\/)\.next\/static\//,/(?:^|\/)\.output\/public\//,/(?:^|\/)build\/static\//,/(?:^|\/)dist\/assets\//,/(?:^|\/)public\//,/(?:^|\/)out\//,/(?:^|\/)storybook-static\//],fu=/\b(?:exec|execSync|spawn|child_process|eval|new Function|vm\.run|readFile|writeFile|fs\.read|fs\.write|fetch|axios|http\.request|sandbox|runCode|executeCode)\b/,pu=new Set([`.next`,`.output`]),mu=e=>{let t=e.split(`/`);for(let e=0;e<t.length;e+=1)if(pu.has(t[e])&&(t[e]===`.next`&&t[e+1]===`dev`||t[e+1]===`server`&&e+2<t.length))return!0;return!1},hu=(e,t)=>mu(e)?!1:t||e.endsWith(`.map`)?!0:du.some(t=>t.test(e)),gu=e=>/(?:^|\/)(?:package\.json|Dockerfile|docker-compose\.ya?ml|\.github\/workflows\/[^/]+\.ya?ml|vercel\.json|next\.config\.[cm]?[jt]s|netlify\.toml)$/i.test(e),_u=new Map,vu=(e,t)=>{let n=_u.get(t);n||(n=new Map,_u.set(t,n));let r=n.get(e);if(r!==void 0)return r;let i=t.test(e)&&!iu.test(e)&&!ou.test(e)&&!cu.test(e)&&!lu.test(e);return n.set(e,i),i},K=e=>/\.d\.[cm]?[jt]s$/i.test(e)?!1:vu(e,eu),yu=/<script\b|on(?:load|error|click|mouseover)\s*=/i,bu=/dangerouslyAllowSVG\s*:\s*true/i,xu=/<(?:object|embed|iframe)\b[^>]+(?:data|src)=["'][^"']+\.svg(?:\?[^"']*)?["']/i,Su=W({id:`active-static-asset`,title:`Executable SVG exposure`,severity:`warn`,recommendation:"Prefer `<img>` for SVG images; if SVG must be served directly, use attachment disposition and a CSP that blocks scripts and objects.",scan:e=>{let t=[];if(e.relativePath.endsWith(`.svg`)&&hu(e.relativePath,e.isGeneratedBundle)){if(yu.test(e.content)){let n=Zl(e.content,yu);t.push({message:`A browser-reachable SVG contains script or event-handler code.`,line:n.line,column:n.column,severity:`error`,title:`Active SVG in public assets`,help:`Serve untrusted SVG as downloads, sanitize it, or isolate it on a cookieless asset origin with a restrictive CSP.`})}return t}if(!K(e.relativePath)&&!gu(e.relativePath))return t;let n=[bu,xu].find(t=>t.test(e.content));if(n!==void 0){let r=Zl(e.content,n);t.push({message:`The app enables or embeds SVG in an executable browser context.`,line:r.line,column:r.column})}return t}}),Cu=e=>/(?:^|\/)(?:firestore\.rules|storage\.rules|database\.rules\.json)$/.test(e),wu=/\s/,Tu=/[\p{ID_Continue}$]/u,Eu=/["'`/]/g,Du=/["'`/{}]/g,Ou=/["\\\n]/g,ku=/['\\\n]/g,Au=/[`\\$\n]/g,ju=new Set([`return`,`typeof`,`case`,`in`,`of`,`new`,`delete`,`void`,`instanceof`,`do`,`else`,`yield`,`await`,`throw`]),Mu=()=>{let e=[],t=[],n=-1,r=-1,i=()=>{n<0||(e.push(n),t.push(r),n=-1,r=-1)},a=(e,t)=>{if(e===r){r=t;return}if(e<r){r=Math.max(r,t);return}i(),n=e,r=t};return{blank:e=>a(e,e+1),blankSpan:a,isBlanked:i=>{if(i>=n&&i<r)return!0;for(let n=e.length-1;n>=0;--n)if(!(e[n]>i))return t[n]>i;return!1},apply:n=>{if(i(),e.length===0)return n;let r=[],a=0;for(let i=0;i<e.length;i+=1)r.push(n.slice(a,e[i]),` `.repeat(t[i]-e[i])),a=t[i];return r.push(n.slice(a)),r.join(``)}}},Nu=(e,t,n)=>{let r=n=>t.isBlanked(n)?` `:e[n],i=n-1;for(;i>=0&&wu.test(r(i));)--i;if(i<0)return!0;let a=r(i),o=i>0?r(i-1):``;if(Tu.test(a)){let t=i;for(;t>0&&Tu.test(r(t-1));)--t;return t>0&&r(t-1)===`.`?!1:ju.has(e.slice(t,i+1))}return a===`<`?!1:a===`>`?o===`=`:a===`+`||a===`-`?o!==a:a===`!`?!(Tu.test(o)||o===`)`||o===`]`):!(a===`)`||a===`]`||a===`}`||a===`"`||a===`'`||a==="`")},Pu=(e,t)=>{let n=t+1,r=!1;for(;n<e.length;){let t=e[n];if(t===`\\`){n+=2;continue}if(t===`
5
5
  `)return null;if(t===`[`)r=!0;else if(t===`]`)r=!1;else if(t===`/`&&!r)return e[n+1]===`/`?null:n+1;n+=1}return null},Fu=(e,t,n)=>{for(let r=t+1;r<e.length;r+=1){let t=e.charCodeAt(r);if(t===92){r+=1;continue}if(t===n)return!1;if(wu.test(e[r]))return!0}return!1},Iu=(e,t)=>{let n=e.length,r=Mu(),i=-1,a=!1,o=[],s=0,c=t=>{t>=n||e.charCodeAt(t)===10||r.blank(t)};for(;s<n;){if(i===-1){let t=o.length>0?Du:Eu;t.lastIndex=s;let n=t.exec(e);if(n===null)break;s=n.index}else{let t=i===34?Ou:i===39?ku:Au;t.lastIndex=s;let o=t.exec(e),c=o===null?n:o.index;if(a&&c>s&&r.blankSpan(s,c),s=c,o===null)break}let l=e.charCodeAt(s),u=e.charCodeAt(s+1);if(i!==-1){if(l===92){a&&(c(s),c(s+1)),s+=2;continue}if(l===10&&i!==96){i=-1,s+=1;continue}if(l===i){i=-1,s+=1;continue}if(t&&i===96&&l===36&&u===123){o.push(0),i=-1,s+=2;continue}a&&c(s),s+=1;continue}if(l===34||l===39){i=l,a=t&&Fu(e,s,l),s+=1;continue}if(l===96){i=96,a=t,s+=1;continue}if(l===47&&u===47){for(;s<n&&e.charCodeAt(s)!==10;)r.blank(s),s+=1;continue}if(l===47&&u===42){for(;s<n;){if(e.charCodeAt(s)===42&&e.charCodeAt(s+1)===47){r.blank(s),r.blank(s+1),s+=2;break}c(s),s+=1}continue}if(l===47){let n=Nu(e,r,s)?Pu(e,s):null;if(n!==null){if(t)for(let e=s+1;e<n-1;e+=1)c(e);s=n;continue}}if(o.length>0){let e=o.length-1;l===123?o[e]+=1:l===125&&(o[e]===0?(o.pop(),i=96,a=t):--o[e])}s+=1}return r.apply(e)},Lu=e=>e.includes(`//`)||e.includes(`/*`)?Iu(e,!1):e,Ru=e=>Iu(e,!0),zu=new WeakMap,Bu=new WeakMap,Vu=(e,t=!1)=>{if(!eu.test(e.relativePath)&&!Cu(e.relativePath))return e.content;let n=t?Bu:zu,r=n.get(e);if(r!==void 0)return r;let i=t?Ru(e.content):Lu(e.content);return n.set(e,i),i},q=({shouldScan:e,pattern:t,requireAll:n,suppressWhen:r,ignoreStringLiterals:i,message:a})=>o=>{if(!e(o))return[];let s=Vu(o,i);if(n!==void 0&&!n.every(e=>e.test(s)))return[];let c=-1;if(t instanceof RegExp)c=s.search(t);else for(let e=0;e<t.length&&(c=s.search(t[e]),!(c>=0));e+=1);if(c<0||r!==void 0&&r.test(s))return[];let{line:l,column:u}=G(s,c);return[{message:a,line:l,column:u}]},Hu=/\b(?:tool\s*\(\s*\{|createTool\s*\(|defineTool\s*\(|new\s+(?:DynamicTool|StructuredTool)\s*\()/,Uu=/\b(?:tool|createTool|defineTool|DynamicTool|StructuredTool)\b/,Wu=/(?:^|\/)(?:agents?|tools?|mcp)(?:\/|$)|(?:agent|tool|mcp)[^/]*\.[cm]?[jt]sx?$/i,Gu=W({id:`agent-tool-capability-risk`,defaultEnabled:!1,title:`Agent tool exposes dangerous capability`,severity:`warn`,recommendation:`Treat tool inputs as prompt-injection controlled. Validate arguments, scope permissions per call, and avoid exposing shell/file/network primitives directly to agents.`,scan:q({shouldScan:e=>K(e.relativePath)&&Wu.test(e.relativePath)&&Uu.test(e.content)&&fu.test(e.content),pattern:Hu,requireAll:[fu],ignoreStringLiterals:!0,message:`An agent-callable tool appears to expose network, filesystem, shell, or code-execution capability.`})}),Ku=W({id:`artifact-baas-authority-surface`,defaultEnabled:!1,title:`BaaS authority map shipped in browser artifact`,severity:`warn`,recommendation:`Client BaaS config is often public, but shipped collection names plus owner, role, tenant, or admin fields give attackers a precise authorization map. Verify rules/RLS enforce every boundary server-side.`,scan:q({shouldScan:e=>hu(e.relativePath,e.isGeneratedBundle),pattern:/\b(?:collection\s*\(\s*["'](?:boosts|sessions|sessions_admin|users|orgs|candidateJobs|conversations|documents|profiles)|from\s*\(\s*["'](?:users|profiles|documents|organizations|memberships)|creatorID|creatorId|providerId|ghostOrg|ownerId|orgId|tenantId|workspaceId|isAdmin|SuperAdmin)\b/i,requireAll:[/\b(?:initializeApp|firebase|firestore|getFirestore)\b[\s\S]{0,700}\b(?:apiKey|authDomain|projectId|databaseURL|storageBucket)\b|\b(?:apiKey|authDomain|projectId|databaseURL|storageBucket)\b[\s\S]{0,700}\b(?:firebase|firestore|getFirestore|initializeApp)\b|\bcreateClient\b[\s\S]{0,700}\b(?:supabase|SUPABASE_URL)\b|\b(?:supabase|SUPABASE_URL)\b[\s\S]{0,700}\bcreateClient\b/i],message:`A browser artifact exposes Firebase/Supabase config together with sensitive collections or authorization fields.`})}),qu=new Set([`auth`,`getSession`,`getServerSession`,`getUser`,`requireAuth`,`checkAuth`,`verifyAuth`,`authenticate`,`currentUser`,`getAuth`,`validateSession`]),Ju=/^auth(?:n|z|ed|enticate[ds]?|enticating|entication|orize[ds]?|orizing|orization|orizer)?$/,Yu=new Set([`signedin`,`loggedin`,`signin`]),Xu=new Set([`require`,`ensure`,`assert`,`verify`,`validate`,`check`,`protect`,`enforce`,`guard`,`gate`,`restrict`,`is`,`has`,`can`,`must`]),Zu=new Set([`get`,`fetch`,`load`,`read`,`resolve`,`retrieve`,`use`]),Qu=new Set([`current`,`my`,`own`]),$u=new Set([`session`,`sessions`,`login`,`admin`,`admins`,`superadmin`,`superuser`,`role`,`roles`,`permission`,`permissions`,`jwt`,`identity`,`principal`,`credential`,`credentials`]),ed=new Set([`user`,`users`,`account`,`accounts`,`token`,`tokens`,`access`,`me`,`viewer`,`caller`,`subject`,`scope`,`scopes`]),td=new Set([`getUser`]),nd=/(?:^|[._])(?:auth|authn|authz|clerk|session|jwt|firebase|supabase|nextauth|kinde|workos|stytch|descope|cognito|propelauth|lucia)/i,rd=[/^sk_live_/,/^sk_test_/,/^AKIA[0-9A-Z]{16}$/,/^ghp_[a-zA-Z0-9]{36}$/,/^gho_[a-zA-Z0-9]{36}$/,/^github_pat_/,/^glpat-/,/^xox[bporas]-/,/^sk-[a-zA-Z0-9]{32,}$/],id=[/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/,/\bAWS_SECRET_ACCESS_KEY\s*[:=]\s*["']?[A-Za-z0-9/+=]{35,}["']?/,/\bgithub_pat_[A-Za-z0-9_]{30,}\b/,/\bgh[pousr]_[A-Za-z0-9]{30,}\b/,/\bglpat-[A-Za-z0-9_-]{20,}\b/,/\bxox[baprs]-[A-Za-z0-9-]{20,}\b/,/\bsk_(?:live|test)_[A-Za-z0-9]{16,}\b/,/\brk_(?:live|test)_[A-Za-z0-9]{16,}\b/,/\bsk-[A-Za-z0-9_-]{32,}\b/,/\bsk-ant-api\d{2}-[A-Za-z0-9_-]{20,}\b/,/\blin_(?:api|oauth)_[A-Za-z0-9]{20,}\b/,/\bvercel_[A-Za-z0-9]{20,}\b/,/\bsntrys_[A-Za-z0-9_-]{20,}\b/,/\bkey-[a-f0-9]{32}\b/i,/\bnpm_[A-Za-z0-9]{30,}\b/,/\bSG\.[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\b/,/https:\/\/hooks\.slack\.com\/services\/T[A-Z0-9]+\/B[A-Z0-9]+\/[A-Za-z0-9]+/,/https:\/\/discord(?:app)?\.com\/api\/webhooks\/\d+\/[A-Za-z0-9_-]+/,/\bsb_secret_[A-Za-z0-9_]{20,}\b/,/\bservice_role\b/i,/"private_key"\s*:\s*"-----BEGIN PRIVATE KEY-----/,/-----BEGIN (?:RSA |EC |OPENSSH |DSA )?PRIVATE KEY-----/,/\b(?:postgres|mysql|mongodb(?:\+srv)?|redis):\/\/[^:\s/@]+:(?!(?:pass(?:word)?|my[a-z]*pass(?:word)?|mysecretpassword|myusername|postgres|mysql|redis|root|admin|minioadmin|secret|example|changeme|change_me|test|guest|placeholder|default|user(?:name)?|x{3,}|\*{2,}|\$\{[^}]*\}|\$[A-Z_]+|<[^>]*>|%[\w.]+%|\{\{[^}]*\}\})@)[^@\s/]+@(?!(?:localhost|127\.0\.0\.1|0\.0\.0\.0|host\.docker\.internal)(?:[:/\s]|$))[^\s:/@]*\./i],ad=/\beyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{16,}\b/,od=/\b(?:NEXT_PUBLIC|VITE|REACT_APP|EXPO_PUBLIC)_[A-Z0-9_]*(?:SECRET|TOKEN|PASSWORD|PRIVATE|DATABASE_URL|SERVICE_ROLE|AWS_ACCESS_KEY|AWS_SECRET)[A-Z0-9_]*\b/i,sd=/\b(?:process\s*\.\s*env|import\s*\.\s*meta\s*\.\s*env|window\.__[A-Z0-9_]*ENV[A-Z0-9_]*__|__[A-Z0-9_]*ENV[A-Z0-9_]*__)\b/,cd=/\b(?:(?:process|window)\s*(?:\/[*/]|<!--|-->|\.\s*(?:\/[*/]|<!--|-->))|import\s*(?:\/[*/]|<!--|-->|\.\s*(?:\/[*/]|<!--|-->|meta\s*(?:\/[*/]|<!--|-->|\.\s*(?:\/[*/]|<!--|-->)))))/,ld=/\b(?:DATABASE_URL|AWS_SECRET_ACCESS_KEY|AWS_ACCESS_KEY_ID|MAILGUN_API_KEY|SALESFORCE_CLIENT_SECRET|OKTA_CLIENT_SECRET|SESSION_SECRET|COOKIE_SECRET|PRIVATE_KEY|SERVICE_ROLE)\b/,ud=/(?:SENTRY_DSN|PUBLIC_KEY|(?:^|_)PUBLIC_TOKEN$|PUBLISHABLE|ANON_KEY|POSTHOG_(?:PROJECT_)?TOKEN|POSTHOG_KEY|TLDRAW_LICENSE_KEY|CLERK_PUBLISHABLE_KEY|ALGOLIA_SEARCH_KEY|GC_API_KEY|GOOGLE_MAPS_API_KEY|MAPBOX_TOKEN|MIXPANEL_TOKEN|FACEBOOK_CLIENT_TOKEN|(?:NEXT_PUBLIC|VITE|REACT_APP|EXPO_PUBLIC)_(?:DISABLE|ENABLE|ALLOW|REQUIRE)_)|(?:TOKEN|SECRET|PASSWORD|PRIVATE)_(?:KIND|TYPE|URL|URI|ENDPOINT|HEADER|NAME)$/i,dd=[/^appl_/,/^goog_/,/^amzn_/,/^strp_/,/^pk_(?:live|test)_/,/^sb_publishable_/,/^phc_/,/^public-token-(?:live|test)-/,/^pk\.eyJ/],fd=[/^[\s._\-*\u2022xX]{8,}$/,/(?:\.{3,}|\u2026|[*\u2022]{3,})/,/(?:^|[_\-\s])(?:your|redacted|masked|placeholder|replace[_\-\s]?me|changeme)(?:$|[_\-\s])/i,/<[^>]*(?:auth|credential|key|password|secret|token|your|redacted|placeholder|masked)[^>]*>/i,/\[[^\]]*(?:auth|credential|key|password|secret|token|your|redacted|placeholder|masked)[^\]]*\]/i,/\{[^}]*(?:auth|credential|key|password|secret|token|your|redacted|placeholder|masked)[^}]*\}/i],pd=[/(?:^|[_\-\s])(?:example|sample|dummy)(?:$|[_\-\s])/i],md=/(?:placeholder|example|sample|dummy|masked|redacted|mask)/i,hd=/(?:api_?key|secret|token|password|credential|auth(?!or(?!i[sz])))/i,gd=/(?:^|\/)[^/]+\.config\.[cm]?[jt]s$/,_d=/(?:^|\/)(?:\.[a-z-]+rc|[a-z-]+\.rc)\.[cm]?[jt]s$/,vd=/(?:^|\/)[^/]+\.(?:test|spec|stories|story|fixture|fixtures)\.[cm]?[jt]sx?$/,yd=/(?:^|\/)[^/]+\.server\.[cm]?[jt]sx?$/,bd=/(?:^|\/)(?:middleware|proxy|route)\.[cm]?[jt]sx?$/,xd=/(?:^|\/)pages\/api\/.+\.[cm]?[jt]sx?$/,Sd=/(?:^|\/)[^/]+\.(?:client|browser|web)\.[cm]?[jt]sx?$/,Cd=/(?:^|\/)(?:src\/)?(?:main|index|[Aa]pp|client)\.[cm]?[jt]sx?$/,wd=new Set([`backend`,`functions`,`lambdas`,`lambda`,`middleware`,`server`,`servers`]),Td=new Set([`api`,`backend`,`edge`,`function`,`functions`,`lambda`,`lambdas`,`server`,`servers`,`worker`,`workers`]),Ed=new Set([`__fixtures__`,`__mocks__`,`__tests__`,`fixtures`,`mocks`,`test`,`tests`]),Dd=new Set([`bin`,`config`,`configs`,`script`,`scripts`,`tooling`,`tools`]),Od=new Set([`components`,`features`,`hooks`,`pages`,`ui`,`views`,`widgets`]),kd=new Set(`alert.modal.label.text.title.name.id.url.path.route.page.param.field.column.header.placeholder.prefix.description.type.icon.class.style.variant.event.action.status.state.mode.flag.option.config.message.error.display.view.component.element.container.wrapper.button.link.input.select.dialog.menu.form.step.index.count.length.role.scope.context.provider.ref.handler.query.schema.constant`.split(`.`)),Ad=new Set([`start`,`end`]),J=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),jd=new RegExp(od.source,`gi`),Md=e=>{for(let t of e.matchAll(jd)){let e=t[0]??``;if(!ud.test(e))return new RegExp(J(e))}},Nd=e=>sd.test(e)&&ld.test(e),Pd=/\.(?:[cm]?[jt]sx?)$/i,Fd=/\/\/|\/\*|<!--/,Id=new Set([`\r`,`
@@ -25,4 +25,4 @@ import*as e from"node:fs";import{readFileSync as t}from"node:fs";import*as n fro
25
25
  `&&(t[r]=` `);n=o;continue}}if(r===`"`){for(n+=1;n<e.length;){if(e[n]===`"`){if(e[n+1]===`"`){n+=2;continue}n+=1;break}n+=1}continue}n+=1}return t.join(``)},Og=/disable\s+row\s+level\s+security/i,kg=/auth\.role\(\)\s*=\s*["']service_role["']/i,Ag=/create\s+policy/gi,jg=/;|create\s+policy/i,Mg=/\b(?:using|with\s+check)\s*\(\s*true\s*\)/i,Ng=/\bfor\s+select\b/i,Pg=/\bto\s+([\s\S]+?)(?=\s+(?:using|with\s+check|as|for)\b|;|$)/i,Fg=new Set([`service_role`,`postgres`,`supabase_admin`]),Ig=e=>{let t=Pg.exec(e);if(t===null)return!1;let n=t[1].split(`,`).map(e=>e.trim().replace(/["'`]/g,``).toLowerCase()).filter(Boolean);return n.length>0&&n.every(e=>Fg.has(e))},Lg=(e,t)=>kg.test(t)?!0:!Mg.test(e)||Ng.test(e)?!1:!Ig(e),Rg=W({id:`supabase-rls-policy-risk`,title:`Permissive Supabase RLS policy`,severity:`error`,recommendation:"Keep public-read policies explicit, but gate inserts, updates, deletes, and service-role bypasses behind `auth.uid()` plus trusted tenant membership.",scan:e=>{if(!Sg(e.relativePath))return[];let t=Dg(e.content),n=t.search(Og);Ag.lastIndex=0;for(let r=Ag.exec(t);r!==null;r=Ag.exec(t)){let i=r.index+r[0].length,a=t.slice(i).search(jg),o=a<0?t.length:i+a;if(Lg(t.slice(r.index,o),e.content.slice(r.index,o))){(n<0||r.index<n)&&(n=r.index);break}}if(n<0)return[];let{line:r,column:i}=G(t,n);return[{message:`Supabase policy SQL disables RLS, permits writes broadly, or references a service-role bypass.`,line:r,column:i}]}}),zg=/create\s+(?:unlogged\s+)?table\s+(?:if\s+not\s+exists\s+)?(?!["`]?(?:auth|storage|realtime|vault|extensions|graphql|graphql_public|pgbouncer|net|supabase_functions|supabase_migrations|cron|pgsodium|pgmq|information_schema|pg_catalog|pg_temp|private|internal)["`]?\s*\.)(?:["`]?public["`]?\s*\.\s*)?["`]?([A-Za-z_][\w$]*)["`]?(?:\s*\(|\s+as\b)/gi,Bg=/alter\s+table\s+(?:if\s+exists\s+)?(?:only\s+)?(?:["`]?public["`]?\s*\.\s*)?["`]?([A-Za-z_][\w$]*)["`]?\s+(?:force\s+)?enable\s+row\s+level\s+security/gi,Vg=/\benable\s+row\s+level\s+security\b/gi,Hg=e=>{let t=new Map,n=0;for(let r of e.matchAll(Bg)){let e=r[1];e!==void 0&&(n+=1,t.set(e.toLowerCase(),r.index))}return{lastEnableIndexByTable:t,staticEnableCount:n}},Ug=(e,t)=>(e.match(Vg)?.length??0)>t,Wg=W({id:`supabase-table-missing-rls`,title:`Supabase table created without Row Level Security`,severity:`error`,recommendation:"Enable RLS in the same migration (`alter table <name> enable row level security;`) and add `auth.uid()`-scoped policies for select/insert/update/delete. A public table without RLS is fully readable and writable with the public anon key.",scan:e=>{if(!xg(e.relativePath))return[];let t=Dg(e.content);if(!/create\s+(?:unlogged\s+)?table/i.test(t))return[];let n=[],{lastEnableIndexByTable:r,staticEnableCount:i}=Hg(t);if(Ug(t,i))return[];zg.lastIndex=0;for(let e=zg.exec(t);e!==null;e=zg.exec(t)){let i=e[1];if(i===void 0)continue;let a=r.get(i.toLowerCase());if(a!==void 0&&a>=e.index)continue;let o=G(t,e.index);n.push({message:`Supabase migration creates a public table but never enables Row Level Security, leaving every row exposed to the anon key.`,line:o.line,column:o.column})}return n}}),Gg=W({id:`svg-filter-clickjacking-risk`,title:`SVG-filtered iframe clickjacking primitive`,severity:`warn`,recommendation:"Avoid filtering cross-origin iframes. Use `frame-ancestors` on sensitive pages and keep SVG filters away from embedded privileged UI.",scan:q({shouldScan:e=>K(e.relativePath),pattern:/<iframe\b(?:=>|[^>]){0,300}\bfilter\s*:\s*["']?url\(#|filter\s*:\s*url\(#[\s\S]{0,700}<iframe\b|<fe(?:DisplacementMap|ColorMatrix|Composite|Tile|Morphology)\b[\s\S]{0,700}<iframe\b/i,message:`An iframe is rendered through an SVG/CSS filter, which can support advanced clickjacking or visual exfiltration tricks.`})}),Kg=e=>K(e)?ru.test(e)?!0:/(?:^|\/)(?:middleware|route)\.[cm]?[jt]sx?$/.test(e):!1,qg=W({id:`tenant-static-proxy-risk`,title:`Tenant-controlled static asset proxy`,severity:`warn`,recommendation:`Bind tenant identity to the trusted host or authenticated org, canonicalize after decoding, reject traversal, and never let one tenant choose another tenant's asset prefix.`,scan:q({shouldScan:e=>Kg(e.relativePath),pattern:/\b(?:fetch|path\.join|getObject\w*|GetObjectCommand|getSignedUrl|createReadStream)\s*\([^;]{0,200}(?:\$\{[^}]{0,100}\b(?:tenant|subdomain|workspace|hostPattern|(?<!\.)organization(?:Id|Slug)?)\b|\b(?:tenant|subdomain|workspace)(?:Id|Slug|Name)?\b\s*[,)+\].])/i,message:`Route code appears to compose tenant or subdomain input into a static/CDN/object-store fetch path.`})}),Jg=[/dangerouslySetInnerHTML\s*=\s*\{\{\s*__html\s*:[\s\S]{0,300}?\bJSON\.stringify\s*\(/gi,/<script\b[^>]*>(?:(?!<\/script>)[\s\S]){0,300}?\bJSON\.stringify\s*\(/gi],Yg=/\$\{|["'`]\s*\+\s*$/,Xg=/^\s*\{(?!\{)/,Zg=/"(?:[^"\\\n]|\\.)*"|'(?:[^'\\\n]|\\.)*'/g,Qg=/\b(?:true|false|null)\b|[\d.]+(?:e[+-]?\d+)?/gi,$g=e=>{if(e.includes("`")||e.includes("${"))return!1;let t=e.replace(Zg,``).replace(Qg,``);return!/[A-Za-z_$]/.test(t)},e_=/^[\s)]*\.replace\s*\([^)]*(?:\\u003[cC]|&lt;|<)/,t_=/^[\s)]*\.replaceAll\s*\(\s*["']<["']\s*,\s*["'](?:\\u003[cC]|&lt;)["']\s*\)/,n_=/(?:\b(?:escapeHtml|escapeJSON|escapeJson|htmlEscape|jsesc)|(?<![.\w])(?:serialize|serializeJavascript|devalue|uneval|superjson))\s*\(\s*$/i,r_=/\bJSON\.stringify\s*\($/i,i_=W({id:`unsafe-json-in-html`,title:`Unescaped JSON in HTML or script sink`,severity:`warn`,recommendation:'JSON.stringify does not HTML-escape, so a `<\/script>` (or `<`) in the data breaks out and becomes XSS. Use an HTML-safe serializer (serialize-javascript, devalue) or escape `<`, `>`, and `&`, or pass data via a JSON `<script type="application/json">` read with JSON.parse.',scan:e=>{if(!K(e.relativePath))return[];let t=Vu(e);if(!t.includes(`JSON.stringify`))return[];let n=[],r=new Set;for(let[e,i]of Jg.entries()){i.lastIndex=0;for(let a=i.exec(t);a!==null;a=i.exec(t)){let i=a[0].replace(r_,``);if(n_.test(i))continue;if(e===1){let e=t.indexOf(`>`,a.index),n=a[0].search(/\bJSON\.stringify\s*\($/i);if(e>=0&&n>=0){let r=t.slice(e+1,a.index+n);if(!Yg.test(r)||Xg.test(r))continue}}let o=a.index+a[0].length-1,s=yf(t,o);if(s>=0){let e=t.slice(s+1,s+1+160);if(e_.test(e)||t_.test(e)||$g(t.slice(o+1,s)))continue}if(r.has(a.index))continue;r.add(a.index);let c=G(t,a.index);n.push({message:"JSON.stringify is embedded in HTML/script markup without HTML-escaping; data containing `<\/script>` or `<` breaks out and becomes XSS.",line:c.line,column:c.column})}}return n}}),a_=/(?:(?<![.\w$])fetch|\baxios\.\s*(?:get|post|put|delete|head)|\bgot|\bgot\.\s*(?:get|post))\s*\(\s*([^,)]+)/,o_=/\b(?:url|targetUrl|callbackUrl|redirectUrl|webhookUrl|companyUrl|websiteUrl|domainUrl|imageUrl|fetchUrl|next|return_to|returnTo|destination|location)\b/i,s_=/\breq\.|\brequest\.(?:query|body|params|nextUrl)|\bsearchParams\b|\bparams\.|\bbody\.|\bquery\./,c_=/\bredirect\s*:\s*["'](?:manual|error)["']/,l_=/\b(params|body|query)\./g,u_=(e,t)=>RegExp(`(?:const|let|var)\\s+${e}\\s*(?::[^=;\\n]{0,80})?=\\s*new\\s+URLSearchParams\\b`).test(t),d_=(e,t)=>{let n=e.replace(l_,(e,n)=>u_(n,t)?``:e);return s_.test(n)},f_=(e,t)=>{if(d_(e,t))return!0;let n=/^[\w$]+$/.exec(e.trim());if(n===null)return!1;let r=RegExp(`(?:const|let|var)[^=;\\n]{0,80}\\b${n[0]}\\b[^=;\\n]{0,80}=([^;\\n]*)`,`g`);for(let e of t.matchAll(r)){let n=e[1]??``;if(/\breq\.|\brequest\.|\bsearchParams\b|\$_(?:GET|POST|REQUEST)/.test(n)||d_(n,t))return!0}return!1},p_=W({id:`untrusted-redirect-following`,title:`Server fetch follows redirects for caller-shaped URL`,severity:`warn`,recommendation:'Use `redirect: "manual"` or equivalent and re-validate every redirect target before following it to avoid SSRF redirect bypasses.',scan:e=>{if(!Kg(e.relativePath)||!a_.test(e.content))return[];let t=[],n=e.content.split(`
26
26
  `);for(let r=0;r<n.length;r+=1){let i=n[r]??``,a=i.match(a_),o=a?.[1]??``;if(!a||!o_.test(o)||!f_(o,e.content))continue;let s=n.slice(r,r+5).join(`
27
27
  `);c_.test(s)||t.push({message:`Server-side fetch code appears to follow redirects for a URL shaped like caller-controlled input.`,line:r+1,column:i.search(/\S/)+1})}return t}}),m_=W({id:`url-prefilled-privileged-action`,title:`URL pre-fills a privileged action`,severity:`warn`,recommendation:`Require server-side validation and explicit confirmation for URL-sourced invite, role, permission, redirect, or sharing parameters.`,scan:q({shouldScan:e=>wm(e.relativePath),pattern:/(?<!(?:safe|valid|sanitiz|relativ|allowlist|whitelist|parse|normaliz)[\w$]*\(\s*(?:new\s+)?(?:[\w$]+\s*\.\s*){0,4})\b(?:searchParams|useSearchParams\s*\(\s*\)|URLSearchParams\s*\([^)]{0,120}\))(?:[?!])?\.get(?:All)?\s*\(\s*["'](?:userstoinvite|role|permission|sharingaction|invite|admin|next|continue|returnTo|redirect_uri|callbackUrl)["']|\bsearchParams\.(?:userstoinvite|role|permission|sharingaction|invite|admin|returnTo|redirect_uri|callbackUrl)\b/i,message:`Client code reads sensitive action state from the URL, which can pre-fill invites, roles, redirects, or sharing flows with attacker values.`})}),h_=/(?:^|\/)[^/]*webhook[^/]*\/|(?:^|\/)[^/]*webhook[^/]*\.[cm]?[jt]s$|\bwebhook\b/i,g_=/\b(?:export\s+(?:async\s+)?function\s+POST|export\s+const\s+(?:POST|handler|webhook)|webhookHandler|webhookRoute)\b/i,__=RegExp(`verifySignature|verify.*signature|verify\\w*(?:Webhook|Auth)|constructEvent|createHmac|timingSafeEqual|svix|webhookSecret|stripe\\.webhooks|["'][\\w-]*signature["']|\\b[A-Za-z]{0,40}(?:verif|valid|check|assert|authenticat|compare|guard)[A-Za-z]{0,40}(?:secret|signature|hmac|webhook|digest)[A-Za-z]{0,40}\\s*\\(`,`i`),v_=/webhook[\s_-]?ur[il]\w*/gi,y_=/process\.env\.\w*WEBHOOK_URL|\b(?:send|post|dispatch|publish|notify)\w*Webhook/,b_=/\b(?:req|request)\b/,x_=/\/\/[^\n]*|\/\*[\s\S]*?\*\/|"(?:\\.|[^"\\\n])*"|'(?:\\.|[^'\\\n])*'|`(?:\\.|[^`\\])*`/g,S_=W({id:`webhook-signature-risk`,title:`Webhook handler lacks signature verification`,severity:`warn`,recommendation:`Verify provider signatures before parsing or acting on webhook bodies. Use provider SDK helpers or HMAC verification with timing-safe comparison.`,scan:q({shouldScan:e=>{if(!K(e.relativePath)||y_.test(e.content))return!1;let t=e.content.replace(x_,``).replace(v_,``);return h_.test(e.relativePath)||h_.test(t)},pattern:g_,requireAll:[b_],suppressWhen:__,message:`Webhook handler code does not show an obvious signature verification step.`})}),C_=/\.[cm]?[jt]sx?$/i,w_=/\.d\.[cm]?[jt]s$/i,T_=/\.mdx$/i,E_=/\.html?$/i,D_=new Set([`.angular`,`.astro`,`.cache`,`.contentlayer`,`.docusaurus`,`.expo`,`.git`,`.next`,`.nuxt`,`.output`,`.svelte-kit`,`.turbo`,`.vercel`,`build`,`coverage`,`dist`,`node_modules`,`out`,`storybook-static`]),O_=new WeakMap,k_=e=>{let t=O_.get(e);if(t)return t;let n=A(e);return O_.set(e,n),n},A_=t=>{let r=[],i=[],a=[t],o=!1;for(;a.length>0;){let t=a.pop();if(!t)continue;let s;try{s=e.readdirSync(t,{withFileTypes:!0})}catch{return null}for(let e of s){let s=n.join(t,e.name),c=D_.has(e.name)||e.name.startsWith(`.`)&&e.name!==`.dumi`&&e.name!==`.storybook`;if(!(e.isSymbolicLink()&&c)){if(e.isSymbolicLink())return null;if(e.isDirectory()){if(c)continue;a.push(s);continue}if(!(!e.isFile()||Al(s))){if(T_.test(e.name)){o=!0;continue}if(E_.test(e.name)){i.push(Xa(s));continue}C_.test(e.name)&&(w_.test(e.name)||r.push(Xa(s)))}}}}return{sourceFilePaths:r,htmlFilePaths:i,hasOpaqueMdxConsumerSurface:o}},j_=(t,n)=>{for(let r of t){let t;try{t=e.readFileSync(r,`utf8`)}catch{return!0}for(let e of n)if(t.includes(`"${e}"`)||t.includes(`'${e}'`))return!0}return!1},M_=e=>{if(b(e,`ImportDeclaration`))return ll(e)?null:typeof e.source.value==`string`?e.source.value:null;if(b(e,`ExportNamedDeclaration`))return e.exportKind===`type`||cl(e.specifiers,`ExportSpecifier`,`exportKind`)?null:e.source&&typeof e.source.value==`string`?e.source.value:null;if(b(e,`ExportAllDeclaration`))return e.exportKind===`type`?null:typeof e.source.value==`string`?e.source.value:null;if(b(e,`ImportExpression`))return b(e.source,`Literal`)&&typeof e.source.value==`string`?e.source.value:null;if(b(e,`CallExpression`)&&b(e.callee,`Identifier`)&&e.callee.name===`require`&&e.arguments.length===1){let t=e.arguments[0];return t&&b(t,`Literal`)&&typeof t.value==`string`?t.value:null}return null},N_=(e,t,n,r)=>{z(e.programNode,i=>{let a=M_(i);if(!a)return;let o=rr(e.filePath,a);if(!o){r.add(a);return}let s=Xa(o);n.set(i,s);let c=t.get(s)??new Set;c.add(e),t.set(s,c)})},P_=({rootDirectory:e,currentFilePath:t,currentProgramNode:n,currentScopes:r,requiredModuleSources:i=[],knownModuleSources:a})=>{if(i.length>0&&a!==void 0&&!i.some(e=>a.includes(e)))return null;let o=A_(e);if(!o||i.length>0&&a===void 0&&!j_(o.sourceFilePaths,i))return null;let s=new Map;for(let e of o.sourceFilePaths){if(e===t){s.set(e,{filePath:e,programNode:n,scopes:r});continue}let i=yn(e);if(!i||!b(i,`Program`))return null;s.set(e,{filePath:e,programNode:i,scopes:k_(i)})}let c=new Map,l=new WeakMap,u=new Set;for(let e of s.values())N_(e,c,l,u);return{modulesByFilePath:s,htmlFilePaths:o.htmlFilePaths,consumerModulesByFilePath:c,resolvedSourcePathByNode:l,unresolvedRuntimeSources:u,hasOpaqueMdxConsumerSurface:o.hasOpaqueMdxConsumerSurface}},F_=e=>{if(!e)return null;let t=w(e);return!b(t,`Literal`)||typeof t.value!=`boolean`?null:t.value},I_=(e,t,n={})=>{let r=n.maximumConstAliases===void 0?4:n.maximumConstAliases,i=n.shouldFoldStaticConditions??!1,a=n.shouldKeepKnownValues??!1,o=[],s=[{expression:e,remainingConstAliases:r,resolvingSymbols:new Set}];for(;s.length>0;){let e=s.pop();if(!e)continue;let n=w(e.expression);if(b(n,`Literal`)){if(typeof n.value!=`string`){if(a)continue;return null}o.push(n.value);continue}if(b(n,`TemplateLiteral`)){let e=Wt(n);if(e===null){if(a)continue;return null}o.push(e);continue}if(b(n,`ConditionalExpression`)){let t=i?F_(n.test):null;if(t!==null){s.push({expression:t?n.consequent:n.alternate,remainingConstAliases:e.remainingConstAliases,resolvingSymbols:e.resolvingSymbols});continue}s.push({expression:n.alternate,remainingConstAliases:e.remainingConstAliases,resolvingSymbols:new Set(e.resolvingSymbols)}),s.push({expression:n.consequent,remainingConstAliases:e.remainingConstAliases,resolvingSymbols:new Set(e.resolvingSymbols)});continue}if(a&&b(n,`LogicalExpression`)&&(n.operator===`??`||n.operator===`||`)){s.push({expression:n.right,remainingConstAliases:e.remainingConstAliases,resolvingSymbols:new Set(e.resolvingSymbols)}),s.push({expression:n.left,remainingConstAliases:e.remainingConstAliases,resolvingSymbols:new Set(e.resolvingSymbols)});continue}if(b(n,`Identifier`)){let r=t.referenceFor(n)?.resolvedSymbol;if(!r||r.kind!==`const`||!r.initializer||!b(r.declarationNode,`VariableDeclarator`)||r.declarationNode.id!==r.bindingIdentifier||e.remainingConstAliases===0||e.resolvingSymbols.has(r)){if(a)continue;return null}e.resolvingSymbols.add(r),s.push({expression:r.initializer,remainingConstAliases:e.remainingConstAliases===null?null:e.remainingConstAliases-1,resolvingSymbols:e.resolvingSymbols});continue}if(!a)return null}return o.length>0?o:null},L_=(e,t,n={})=>I_(e,t,n),R_=(e,t)=>I_(e,t,{shouldKeepKnownValues:!0}),z_=(e,t,n,r,i=!1)=>{let a=e.value;return a?b(a,`Literal`)?typeof a.value==`string`?[a.value]:null:b(a,`JSXExpressionContainer`)?L_(a.expression,t,{maximumConstAliases:n,shouldFoldStaticConditions:r,shouldKeepKnownValues:i}):null:null},B_=(e,t)=>z_(e,t,4,!1),V_=(e,t)=>z_(e,t,null,!0),H_=(e,t)=>z_(e,t,4,!1,!0),U_=(e,t)=>{let r=n.relative(t,e);return r===``||!r.startsWith(`..${n.sep}`)&&r!==`..`&&!n.isAbsolute(r)},W_={attribute:null,expression:null,isPresent:!1,isUnknown:!1},G_={attribute:null,expression:null,isPresent:!1,isUnknown:!0},K_=(e,t,n)=>{for(let r=e.properties.length-1;r>=0;--r){let i=e.properties[r];if(!i)return G_;if(b(i,`SpreadElement`)){if(!b(i.argument,`ObjectExpression`))return G_;let e=K_(i.argument,t,n);if(e.isPresent||e.isUnknown)return e;continue}if(!b(i,`Property`))return G_;let a=S(i,{allowComputedString:!0});if(!a)return G_;if((n?a:a.toLowerCase())===t)return{attribute:null,expression:i.value,isPresent:!0,isUnknown:!1}}return W_},q_=(e,t,n=!0)=>{let r=n?t:t.toLowerCase();for(let t=e.length-1;t>=0;--t){let i=e[t];if(!i)return G_;if(b(i,`JSXSpreadAttribute`)){if(!b(i.argument,`ObjectExpression`))return G_;let e=K_(i.argument,r,n);if(e.isPresent||e.isUnknown)return e;continue}if(!b(i,`JSXAttribute`))continue;let a=Os(i.name);if((n?a:a?.toLowerCase())===r)return{attribute:i,expression:null,isPresent:!0,isUnknown:!1}}return W_},J_=/(?<attributeName>[^\s"'<>/=]+)(?:\s*=\s*(?:"(?<doubleQuoted>[^"]*)"|'(?<singleQuoted>[^']*)'|(?<unquoted>[^\s"'=<>`]+)))?/g,Y_=/<!--[\s\S]*?-->|(?<skippedContentOpeningTag><(?<skippedContentTag>script|style|textarea|title|xmp|iframe|noembed|noframes|plaintext|template)\b(?:"[^"]*"|'[^']*'|[^'"<>])*?>)[\s\S]*?(?:<\/\k<skippedContentTag>\s*>|$)|(?<openingTag><[A-Za-z][\w:-]*(?:"[^"]*"|'[^']*'|[^'"<>])*>)/gi,X_=new Map,Z_=(e,t,n)=>{if(!e.isPresent)return;let r=e.attribute?H_(e.attribute,t):e.expression?R_(e.expression,t):null;for(let e of r??[]){let t=e?.trim();t&&n.add(t)}},Q_=(e,t,n)=>{for(let r of e.properties){if(b(r,`SpreadElement`)){b(r.argument,`ObjectExpression`)&&Q_(r.argument,t,n);continue}if(b(r,`Property`)&&S(r,{allowComputedString:!0})?.toLowerCase()===`id`)for(let e of R_(r.value,t)??[]){let t=e.trim();t&&n.add(t)}}},$_=e=>{let t=e.parent;for(b(t,`JSXElement`)&&t.openingElement===e&&(t=t.parent);t;){if(b(t,`JSXElement`)&&Gs(t.openingElement)===`template`)return!0;t=t.parent}return!1},ev=(e,t,n)=>{z(e,e=>{if(!b(e,`JSXOpeningElement`)||$_(e))return;let r=q_(e.attributes,`id`,!1);if(r.isUnknown){for(let r of e.attributes)Z_(q_([r],`id`,!1),t,n),b(r,`JSXSpreadAttribute`)&&b(r.argument,`ObjectExpression`)&&Q_(r.argument,t,n);return}Z_(r,t,n)})},tv=(e,t)=>{for(let n of e.matchAll(Y_)){let e=n.groups?.skippedContentOpeningTag??n.groups?.openingTag;if(e)for(let n of e.matchAll(J_)){if(n.groups?.attributeName?.toLowerCase()!==`id`)continue;let e=n.groups?.doubleQuoted??n.groups?.singleQuoted??n.groups?.unquoted??``;e.trim()&&t.add(e.trim())}}},nv=e=>{if(!n.isAbsolute(e.currentFilePath))return null;let t=e.configuredRootDirectory?Xa(e.configuredRootDirectory):null;return!t||!U_(e.currentFilePath,t)?null:t},rv=()=>{X_.clear()},iv=t=>{let n=new Set;ev(t.currentProgramNode,t.currentScopes,n);let r=nv(t);if(!r)return n;if(X_.has(r)){let e=X_.get(r);return e?new Set([...e,...n]):null}let i=P_({rootDirectory:r,currentFilePath:Xa(t.currentFilePath),currentProgramNode:t.currentProgramNode,currentScopes:t.currentScopes});if(!i)return X_.set(r,null),null;let a=new Set;for(let e of i.modulesByFilePath.values())ev(e.programNode,e.scopes,a);try{for(let t of i.htmlFilePaths)tv(e.readFileSync(t,`utf8`),a)}catch{return X_.set(r,null),null}return X_.set(r,a),new Set([...a,...n])},av=new Map,ov=()=>{av.clear()},sv=t=>{let n=av.get(t);if(n!==void 0)return n;let r;try{r=e.realpathSync(t)}catch{r=t}return av.set(t,r),r},cv=(e,t,n)=>{if(t===void 0||t.length===0)return!1;let r=Xa(sv(e)),i=Xa(t);if(n&&r===i)return!0;let a=i.endsWith(`/`)?i:`${i}/`;return r.startsWith(a)},lv=/webpackIgnore\s*:\s*true|@vite-ignore/,uv=new Map,dv=()=>{uv.clear()},fv=e=>{if(!e)return null;let n=uv.get(e);if(n!==void 0)return n===!1?null:n;let r=!1;try{let n=t(e,`utf8`);lv.test(n)&&(r=n)}catch{r=!1}return uv.set(e,r),r===!1?null:r},pv=()=>{dv(),ar(),Ae(),Vn(),ov(),rv(),nr()},mv=e=>Ql.test(e)||$l.test(e),hv=e=>{let t=uu.test(e);return dg(e)||Sg(e)||Cu(e)||gu(e)?{bucket:`priority`,isGeneratedBundleByName:t}:hu(e,t)?{bucket:`artifact`,isGeneratedBundleByName:t}:mv(e)?{bucket:`other`,isGeneratedBundleByName:t}:null},gv=(e,t)=>t||mv(e)||gu(e)||dg(e),_v=(t,r)=>{let i=null;try{e.mkdirSync(n.dirname(t),{recursive:!0}),i=`${t}.${process.pid}.${c()}.tmp`,e.writeFileSync(i,r),e.renameSync(i,t),i=null}catch{return}finally{if(i!==null)try{e.rmSync(i,{force:!0})}catch{}}},vv=t=>{let r=n.resolve(t.filename);try{r=e.realpathSync(r)}catch{r=n.normalize(r)}let i=[r,t.rule,t.offset,t.message],a=s(`sha256`).update(JSON.stringify(i)).digest(`hex`);return n.join(t.directory,`${encodeURIComponent(t.rule)}-${a}.json`)},yv=[`nextjs`,`astro`,`vite`,`cra`,`remix`,`gatsby`,`expo`,`react-native`,`tanstack-start`,`preact`,`unknown`];export{Uf as $,Tt as $i,Ua as $n,Bi as $r,Pl as $t,ug as A,ae as Aa,z as Ai,as as An,Ea as Ar,md as At,Eh as B,ee as Ba,qt as Bi,yo as Bn,sa as Br,_d as Bt,Wg as C,b as Ca,_r as Ci,V as Cn,ua as Cr,Cd as Ct,gg as D,fe as Da,jr as Di,os as Dn,ha as Dr,kd as Dt,_g as E,ue as Ea,Er as Ei,cs as En,la as Er,pd as Et,Ih as F,le as Fa,rr as Fi,Fo as Fn,aa as Fr,Td as Ft,Vm as G,f as Ga,F as Gi,lo as Gn,Gi as Gr,Su as Gt,Ch as H,m as Ha,I as Hi,po as Hn,ta as Hr,hd as Ht,Fh as I,me as Ia,Bn as Ii,B as In,ia as Ir,Ed as It,Dm as J,u as Ja,P as Ji,oo as Jn,Ki as Jr,Vl as Jt,Pm as K,p as Ka,Lt as Ki,ao as Kn,Ui as Kr,W as Kt,Nh as L,te as La,yn as Li,ko as Ln,Zi as Lr,vd as Lt,ag as M,se as Ma,sr as Mi,Io as Mn,ga as Mr,wd as Mt,tg as N,de as Na,cr as Ni,No as Nn,$i as Nr,bd as Nt,hg as O,re as Oa,hr as Oi,ss as On,ma as Or,xd as Ot,Wh as P,ce as Pa,R as Pi,Po as Pn,oa as Pr,yd as Pt,$f as Q,kt as Qi,Xa as Qn,Hi as Qr,Wl as Qt,Mh as R,v as Ra,ln as Ri,Oo as Rn,Qi as Rr,Dd as Rt,Gg as S,_e as Sa,Nr as Si,us as Sn,Ra as Sr,dd as St,bg as T,he as Ta,Tr as Ti,is as Tn,Ca as Tr,Od as Tt,bh as U,g as Ua,Wt as Ui,fo as Un,na as Ur,Ku as Ut,Th as V,h as Va,Gt as Vi,vo as Vn,ea as Vr,fd as Vt,lh as W,y as Wa,zt as Wi,uo as Wn,Wi as Wr,Gu as Wt,Cm as X,Mt as Xi,eo as Xn,Yi as Xr,Ll as Xt,Em as Y,Ft as Yi,so as Yn,Xi as Yr,Hl as Yt,ep as Z,M as Zi,$a as Zn,Ji as Zr,Ul as Zt,S_ as _,ve as _a,xr as _i,Os as _n,xa as _r,Yu as _t,gv as a,A as aa,Jr as ai,il as an,Da as ar,bf as at,i_ as b,S as ba,Sr as bi,xs as bn,wa as br,ed as bt,fv as c,D as ca,Fr as ci,Fc as cn,Ia as cr,lf as ct,q_ as d,Me as da,Cr as di,qs as dn,Ma as dr,Zd as dt,wt as ea,Ei as ei,Al as en,Ja as er,Ef as et,U_ as f,Ne as fa,Dr as fi,Ks as fn,Na as fr,Xu as ft,P_ as g,xe as ga,wr as gi,js as gn,ya as gr,Qu as gt,F_ as h,Se as ha,Mr as hi,Vs as hn,Oa as hr,nd as ht,hv as i,Ct as ia,ci as ii,sl as in,Aa as ir,X as it,sg as j,pe as ja,lr as ji,ls as jn,pa as jr,Ad as jt,pg as k,ie as ka,ur as ki,rs as kn,da as kr,rd as kt,cv as l,Ge as la,Ir as li,Qs as ln,Pa as lr,cf as lt,B_ as m,E as ma,Ar as mi,Hs as mn,fa as mr,Zu as mt,vv as n,St as na,di as ni,cl as nn,ka as nr,Tf as nt,pv as o,bt as oa,Gr as oi,al as on,Ta as or,vf as ot,V_ as p,Pe as pa,kr as pi,Gs as pn,ja as pr,qu as pt,Om as q,d as qa,It as qi,co as qn,qi as qr,Rl as qt,_v as r,xt as ra,ui as ri,ll as rn,Sa as rr,xf as rt,lv as s,O as sa,Kr as si,ol as sn,ba as sr,_f as st,yv as t,j as ta,fi as ti,Ml as tn,Ga as tr,Df as tt,iv as u,Ue as ua,Rr as ui,Js as un,Fa as ur,Qd as ut,m_ as v,w as va,br as vi,Ds as vn,va as vr,$u as vt,Rg as w,ge as wa,vr as wi,ds as wn,_a as wr,Sd as wt,qg as x,x as xa,gr as xi,fs as xn,La as xr,td as xt,p_ as y,C as ya,Or as yi,ws as yn,ca as yr,Ju as yt,jh as z,_ as za,on as zi,bo as zn,ra as zr,gd as zt};
28
- //# sourceMappingURL=capability-Cv2iyfc5.js.map
28
+ //# sourceMappingURL=capability-03XscVX8.js.map