"use strict";(()=>{var m=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(r,c)=>(typeof require<"u"?require:r)[c]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var p=m("worker_threads");var g=m("./vendor/acorn.js"),f=m("./vendor/acorn-loose.js");var d={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportExpression:["source"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},h=Object.keys(d);for(let t of h)Object.freeze(d[t]);Object.freeze(d);var u=d;var N={ecmaVersion:"latest",locations:!0,allowAwaitOutsideFunction:!0,allowImportExportEverywhere:!0,allowReserved:!0,allowReturnOutsideFunction:!0};var b=(t,r=!1)=>(r?g.parse:f.parse)(t,N);var E=(t,r)=>{y(t,r)};var y=(t,r,c)=>{if(!t)return;let n=r.enter(t,c);if(n===0)return 0;if(n&&typeof n=="object")return n;if(n===1)return;let i=u[t.type];if(i)for(let o of i){let a=t[o];if(a instanceof Array)for(let[e,l]of a.entries()){let s=y(l,r,t);if(s===0)return 0;s&&typeof s=="object"&&(a[e]=s.replace)}else if(a){let e=y(a,r,t);if(e===0)return 0;e&&typeof e=="object"&&(t[o]=e.replace)}}r.leave?.(t)};function F(t,r){let c=b(t),n=(e,{loc:l}=e,{loc:s}=e)=>{if(!l||!s)throw new Error("should include locations");let x=r(l,s);if(o.length>0){let S=o[o.length-1];S.scopeNode.children??=[],S.scopeNode.children.push(x)}o.push({node:e,scopeNode:x})},i=new Set,o=[],a;return E(c,{enter:e=>{switch(e.type){case"FunctionDeclaration":case"ArrowFunctionExpression":n(e,e.params[0]||e.body,e.body),i.add(e.body);break;case"Program":n(e),a=o[0].scopeNode;break;case"ForStatement":case"ForOfStatement":case"ForInStatement":n(e),i.add(e.body);break;case"BlockStatement":i.has(e)||n(e);break}},leave:e=>{e===o[o.length-1].node&&o.pop()}}),a}p.isMainThread||p.parentPort?.postMessage(F(p.workerData,(t,r)=>({start:t.start,end:r.end})));})();
//# sourceMappingURL=renameWorker.js.map
