hud-sdk
Version:
Hud's Node SDK
2 lines • 42.8 kB
JavaScript
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(global,(()=>(()=>{"use strict";var e={523:e=>{e.exports=require("./logger")},692:(e,t)=>{var r,n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.EntityType=t.ArgumentTypes=t.ParameterTypes=void 0,function(e){e.Identifier="Identifier",e.RestElement="RestElement",e.ArrayPattern="ArrayPattern",e.AssignmentPattern="AssignmentPattern",e.ObjectPattern="ObjectPattern",e.ObjectProperty="ObjectProperty"}(r||(t.ParameterTypes=r={})),function(e){e.StringLiteral="StringLiteral",e.Identifier="Identifier",e.TemplateString="TemplateString"}(n||(t.ArgumentTypes=n={})),function(e){e.FunctionDeclaration="functionDeclaration",e.FunctionExpression="functionExpression",e.FunctionArrow="functionArrow",e.ClassMethod="classMethod",e.ObjectMethod="objectMethod",e.ClassPrivateMethod="classPrivateMethod",e.ClassDeclaration="classDeclaration",e.ClassExpression="classExpression",e.ObjectExpression="objectExpression",e.Program="program",e.ForLoop="forLoop",e.ForBlock="forBlock",e.ForTest="forTest",e.Block="block",e.While="while",e.DoWhile="doWhile",e.Do="Do",e.WhileTest="whileTest",e.Switch="switch",e.SwitchCase="switchCase",e.Catch="catch",e.With="with",e.If="if",e.IfTest="ifTest",e.IfConsequent="ifConsequent",e.IfAlternate="ifAlternate",e.TryCatch="tryCatch",e.Try="try",e.Finally="finally",e.Other="other",e.File="file"}(o||(t.EntityType=o={}))},949:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeLocation=t.resolveScopeSymbols=t.resolveSymbol=t.getLocationList=void 0;const o=r(1377),i=n(r(9023));function s(e,t){let r=t.name;const n=t.sourcemap_location_hints.map((t=>{const r=e({line:t.line,column:t.column});if(null===r.line||null===r.column)return{name:t.name,line:-1,column:-1,line_on_server:t.line_on_server,column_on_server:t.column_on_server};let n=r.name??t.name??void 0;return n?.startsWith("#")&&(n=n.slice(1)),{name:n,line:r.line,column:r.column,line_on_server:t.line_on_server,column_on_server:t.column_on_server,resolved:!0}}));return n.length>0&&n.every((e=>e.name))&&(t.format?Array.from(t.format.matchAll(/%s/g)).length!==n.length?o.worker_logger.warn("Format string does not match number of location hints",{format:t.format,locationHints:n}):r=i.default.format(t.format,...n.map((e=>e.name))):r=n.map((e=>e.name)).join(".")),{name:r,sourcemap_location_hints:n}}t.getLocationList=function(e,t){return e.loc?[{line:e.loc.start.line,column:e.loc.start.column,line_on_server:e.loc.start.line,column_on_server:e.loc.start.column,name:t}]:[]},t.resolveSymbol=s,t.resolveScopeSymbols=function(e,t){const{context:r}=t,n=r.symbol?s(e,r.symbol):void 0,o=s(e,t.symbol);return{...t,context:{...r,symbol:n},symbol:o}},t.getNodeLocation=function(e,t,r=void 0){const n=e.loc?.start,i=e.loc?.end;if(!n||!i)return o.worker_logger.info("Node without location",{filename:r,type:e.type}),{start:{source:null,line:-1,column:-1},end:{source:null,line:-1,column:-1}};const s=t({line:n.line,column:n.column}),a=t({line:i.line,column:i.column});return null!==s.line&&null!==s.column&&null!==a.line&&null!==a.column||(o.worker_logger.debug("Could not find location for function",{filename:r,type:e.type,locStart:n,locEnd:i}),s.line=-1,s.column=-1,a.line=-1,a.column=-1),{start:{source:s.source,line:s.line,column:s.column},end:{source:a.source,line:a.line,column:a.column}}}},1019:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(r(5809));o(r(5809),t),t.default=s.default},1377:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(523),t)},1513:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getEntityIdentity=t.getEntityType=void 0;const n=r(6346),o=r(692),i=r(1377);t.getEntityType=function(e){const{node:t}=e;return n.types.isFunctionDeclaration(t)?o.EntityType.FunctionDeclaration:n.types.isFunctionExpression(t)?o.EntityType.FunctionExpression:n.types.isArrowFunctionExpression(t)?o.EntityType.FunctionArrow:n.types.isObjectMethod(t)?o.EntityType.ObjectMethod:n.types.isStaticBlock(t)||n.types.isClassMethod(t)?o.EntityType.ClassMethod:n.types.isClassPrivateMethod(t)?o.EntityType.ClassPrivateMethod:n.types.isClassDeclaration(t)?o.EntityType.ClassDeclaration:n.types.isClassExpression(t)?o.EntityType.ClassExpression:n.types.isForInStatement(t)||n.types.isForOfStatement(t)||n.types.isForStatement(t)?o.EntityType.ForLoop:n.types.isBlockStatement(t)?function(e){const t=e.parentPath.node;if(!(n.types.isFunctionDeclaration(t)||n.types.isFunctionExpression(t)||n.types.isArrowFunctionExpression(t)||n.types.isClassMethod(t)||n.types.isObjectMethod(t)||n.types.isClassPrivateMethod(t)))if(n.types.isIfStatement(t)){if("consequent"===e.parentKey)return o.EntityType.IfConsequent;if("alternate"===e.parentKey)return o.EntityType.IfAlternate;if("test"===e.parentKey)return o.EntityType.IfTest}else{if(n.types.isBlockStatement(t)||n.types.isProgram(t))return o.EntityType.Block;if(n.types.isTryStatement(t)){if("block"===e.parentKey)return o.EntityType.Try;if("finalizer"===e.parentKey)return o.EntityType.Finally}else{if(n.types.isCatchClause(t))return;if(n.types.isWhileStatement(t))return"test"===e.parentKey?o.EntityType.WhileTest:o.EntityType.Do;if(n.types.isDoWhileStatement(t))return"test"===e.parentKey?o.EntityType.WhileTest:o.EntityType.Do;if(!(n.types.isForStatement(t)||n.types.isForInStatement(t)||n.types.isForOfStatement(t)))return;if("test"===e.parentKey)return o.EntityType.ForTest;if("body"===e.parentKey)return o.EntityType.ForBlock}}}(e):n.types.isProgram(t)?o.EntityType.Program:n.types.isDoWhileStatement(t)?o.EntityType.DoWhile:n.types.isWhileStatement(t)?o.EntityType.While:n.types.isCatchClause(t)?o.EntityType.Catch:n.types.isObjectExpression(t)?o.EntityType.ObjectExpression:n.types.isWithStatement(t)?o.EntityType.With:n.types.isSwitchStatement(t)?o.EntityType.Switch:n.types.isSwitchCase(t)?o.EntityType.SwitchCase:n.types.isTryStatement(t)?o.EntityType.TryCatch:n.types.isIfStatement(t)?o.EntityType.If:o.EntityType.Other},t.getEntityIdentity=function(e){return n.types.isFunctionDeclaration(e)?n.types.isIdentifier(e.id)?e.id:void i.worker_logger.info("Function declaration without an identifier"):n.types.isClassDeclaration(e)?n.types.isIdentifier(e.id)?e.id:void i.worker_logger.info("Class declaration without an identifier"):n.types.isFunctionExpression(e)||n.types.isClassExpression(e)?n.types.isIdentifier(e.id)?e.id:void 0:n.types.isClassMethod(e)?n.types.isIdentifier(e.key)?e.key:void i.worker_logger.info("Class method without an identifier"):n.types.isObjectMethod(e)?n.types.isIdentifier(e.key)?e.key:void i.worker_logger.info("Object method without an identifier"):n.types.isClassPrivateMethod(e)?n.types.isIdentifier(e.key.id)?e.key.id:void i.worker_logger.info("Class private method without an identifier"):void 0}},2676:(e,t)=>{let r;Object.defineProperty(t,"__esModule",{value:!0}),t.myRequire=void 0;try{r=require}catch(e){r=void 0}t.myRequire=r},2784:e=>{e.exports=require("../native/_index")},3118:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.getParameterInfo=void 0;const s=i(r(6346)),a=r(1377),l=r(692);function u(e,t=0){if(void 0!==e.loc&&null!==e.loc)return{line:e.loc.start.line,column:e.loc.start.column+t,line_on_server:e.loc.start.line,column_on_server:e.loc.start.column+t}}function c(e){return s.types.isIdentifier(e.argument)?{name:e.argument.name,type:l.ParameterTypes[e.type],sourcemap_location_hint:u(e,e.argument.name.length+3)}:(a.worker_logger.warn("Unsupported rest element",{type:e.argument.type}),{type:l.ParameterTypes[e.type],sourcemap_location_hint:u(e)})}function d(e){var t;if(e)switch(e?.type){case"Identifier":return{name:(t=e).name,type:l.ParameterTypes[t.type],sourcemap_location_hint:u(t,t.name.length)};case"AssignmentPattern":return function(e,t,r){return{type:l.ParameterTypes[e.type],sourcemap_location_hint:u(e),left:t,right:r}}(e,d(e.left),function(e){switch(e.type){case"StringLiteral":case"NumericLiteral":case"BooleanLiteral":case"BigIntLiteral":case"DecimalLiteral":return{type:e.type,value:e.value};case"RegExpLiteral":return{type:e.type,value:e.pattern}}return{type:e.type}}(e.right));case"ArrayPattern":return function(e,t){return{type:l.ParameterTypes[e.type],sourcemap_location_hint:u(e),elements:t}}(e,e.elements.map((e=>d(e))).filter((e=>void 0!==e)));case"RestElement":return c(e);case"ObjectPattern":{const t=[];return e.properties.forEach((e=>{if(s.types.isObjectProperty(e)){const r=s.types.isIdentifier(e.key)&&s.types.isIdentifier(e.value)||s.types.isAssignmentPattern(e.value)?void 0:d(e.key);t.push(function(e,t,r){return{type:l.ParameterTypes[e.type],sourcemap_location_hint:u(e),key:t,value:r}}(e,r,d(e.value)))}else s.types.isRestElement(e)&&t.push(c(e))})),function(e,t){return{type:l.ParameterTypes[e.type],sourcemap_location_hint:u(e),properties:t}}(e,t)}default:a.worker_logger.warn("Unsupported parameter type",{type:e.type})}}t.getParameterInfo=function(e,t){return e.node.params.map((e=>{try{return d(e)}catch(e){return}})).filter((e=>void 0!==e)).map((e=>{let r;if(void 0!==e.sourcemap_location_hint){const{name:n,line:o,column:i}=t({line:e.sourcemap_location_hint.line,column:e.sourcemap_location_hint.column}),s={line_on_server:e.sourcemap_location_hint.line_on_server,column_on_server:e.sourcemap_location_hint.column_on_server};null===o||null===i?(a.worker_logger.debug("Could not find location for parameter",{type:e.type}),r={name:n??void 0,line:-1,column:-1,...s}):r={name:n??void 0,line:o,column:i,...s}}return{...e,name:r?.name??e.name,type:e.type,sourcemap_location_hint:r??e.sourcemap_location_hint}}))}},3176:e=>{e.exports=require("buffer-crc32")},3645:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNamespaceScopeable=t.isHudScopeable=t.NamespaceScopeAlias=t.ScopableAlias=void 0;const n=r(6346);t.ScopableAlias="ArrowFunctionExpression|BlockStatement|CatchClause|ClassMethod|ClassPrivateMethod|DeclareModule|DoExpression|DoWhileStatement|ForInStatement|ForOfStatement|ForStatement|FunctionDeclaration|FunctionExpression|IfStatement|LabeledStatement|ObjectMethod|StaticBlock|SwitchCase|TSModuleBlock|TryStatement|WhileStatement|WithStatement|ClassDeclaration|ClassExpression|ObjectExpression|SwitchStatement",t.NamespaceScopeAlias="FunctionDeclaration|FunctionExpression|ArrowFunctionExpression|ObjectMethod|ClassMethod|ClassPrivateMethod|ClassDeclaration|ClassExpression|ObjectExpression",t.isHudScopeable=function(e){return n.types.isArrowFunctionExpression(e)||n.types.isBlockStatement(e)||n.types.isCatchClause(e)||n.types.isClassMethod(e)||n.types.isClassPrivateMethod(e)||n.types.isDeclareModule(e)||n.types.isDoExpression(e)||n.types.isDoWhileStatement(e)||n.types.isForInStatement(e)||n.types.isForOfStatement(e)||n.types.isForStatement(e)||n.types.isFunctionDeclaration(e)||n.types.isFunctionExpression(e)||n.types.isIfStatement(e)||n.types.isLabeledStatement(e)||n.types.isObjectMethod(e)||n.types.isProgram(e)||n.types.isStaticBlock(e)||n.types.isSwitchCase(e)||n.types.isTSModuleBlock(e)||n.types.isTryStatement(e)||n.types.isWhileStatement(e)||n.types.isWithStatement(e)||n.types.isClassDeclaration(e)||n.types.isClassExpression(e)||n.types.isObjectExpression(e)||n.types.isSwitchStatement(e)},t.isNamespaceScopeable=function(e){return n.types.isFunction(e)||n.types.isClass(e)||n.types.isObjectExpression(e)}},3830:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getHudAwaitSequenceElement=t.isHudAwaitSequence=void 0;const o=r(6346),i=r(9514),s=n(r(1019));t.isHudAwaitSequence=function(e){if(e.expressions.length<2)return!1;const t=e.expressions[e.expressions.length-1];return!!o.types.isIdentifier(t)&&!!t.name.startsWith(s.default.wrapVarPrefix)},t.getHudAwaitSequenceElement=function(e){const t=e.expressions[0];if(!o.types.isAssignmentExpression(t))throw new i.HudUnsupportedError("Expected assignment expression");const{left:r,right:n}=t;if(!o.types.isIdentifier(r)||!r.name.startsWith(s.default.wrapVarPrefix))throw new i.HudUnsupportedError("Expected identifier starting with "+s.default.wrapVarPrefix);return n}},3903:e=>{e.exports=require("uuid")},4634:e=>{e.exports=require("source-map")},5600:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.parseDeclarations=t.readFile=t.getRealPositionFunc=t.fixSourceMap=void 0;const a=s(r(9896)),l=r(4634),u=r(692),c=i(r(6346)),d=r(5913),p=s(r(6760)),m=s(r(1019)),f=r(3645),y=r(7892),h=r(1513),g=r(3118),E=r(949),_=r(1377),v=r(7022),b=r(3903),S=s(r(3176)),w=r(2784),C=r(2676),I={babelrc:!1,configFile:!1};function x(e){let t;return t="string"==typeof e?JSON.parse(e):e,t.sources=t.sources.map((e=>e.replace(/^webpack:\/\/(?:@[^/]+?[/])?[^/]+\//,""))),t}function k(e,t,r){return n=>{const o=e?.originalPositionFor({line:n.line,column:n.column})??{line:n.line,column:n.column,source:null,name:null},i=null!==o.line?o.line+(t||0):null,s=null!==o.column?o.column+(1===o.line&&r||0):null;return{...o,line:i,column:s}}}let T;t.fixSourceMap=x,t.getRealPositionFunc=k,t.readFile=async function(e,t,r){try{if(t&&r){const n=Buffer.alloc(r-t),o=await a.default.promises.open(e,"r");return await o.read(n,0,r-t,t),await o.close(),n.toString("utf-8")}return await a.default.promises.readFile(e,"utf-8")}catch(t){return void _.worker_logger.error("Failed to read file",{filename:e,msg:t instanceof Error?t.message:t})}},t.parseDeclarations=async function(e,t,r=null,n){const{filename:o,bundlerBuildId:i,bundlerBuildIdGenerated:s,lineOffset:a,columnOffset:D,file_path_checksum:H,file_checksum:F,functionIds:O,sourceCodeHash:P,moduleBase:M}=e;if(_.worker_logger.debug("Parsing code",{filename:o}),n)try{if(!T){const e=(0,C.myRequire)("ts-node");T=e.create({...n,transpileOnly:!0,typeCheck:!1})}const e=function(e,t,r){try{return r.compile(e,t)}catch(e){return void _.worker_logger.warn("ts file pass, but failed to compile with ts-node",{filename:t,error:e instanceof Error?e.message:void 0,stack:e instanceof Error?e.stack:void 0})}}(t,o,T);if(!e)return{declarations:[],blacklist:{file_path_checksum:H,file_checksum:F,uuids:O}};t=e}catch(e){return _.worker_logger.error("Failed to require and compile ts file",{filename:o,error:e instanceof Error?e.message:void 0,stack:e instanceof Error?e.stack:void 0}),{declarations:[],blacklist:{file_path_checksum:H,file_checksum:F,uuids:O}}}else if(o.endsWith(".ts")||o.endsWith(".mts"))return _.worker_logger.error("ts file pass, but not found ts-options"),{declarations:[],blacklist:{file_path_checksum:H,file_checksum:F,uuids:O}};const N=(0,S.default)(t).readUInt32BE();if(N!==F)return _.worker_logger.warn("File checksum mismatch",{filename:o,file_path_checksum:H,diskFileChecksum:N,file_checksum:F,functionIds:O}),{declarations:[],blacklist:{file_path_checksum:H,file_checksum:F,uuids:O}};const j=a?null:(0,w.getSourceMap)(o,t);let A,U;try{null!==j&&(U=(0,S.default)(j).readUInt32BE(),m.default.userConfig.disableSourceMapsResolution?.value||(A=JSON.parse(j)))}catch(e){_.worker_logger.error("Failed to parse source map",{filename:o,error:e instanceof Error?e.message:void 0,stack:e instanceof Error?e.stack:void 0})}const L=k(A?await new l.SourceMapConsumer(x(A)):void 0,a,D);_.worker_logger.debug("Parsing code",{filename:o});const K=[],B=await c.parseAsync(t,I);if(null===B)return _.worker_logger.warn("Failed parsing code to tree",{filename:o,file_path_checksum:H,diskFileChecksum:N,file_checksum:F,functionIds:O}),{declarations:[],blacklist:{file_path_checksum:H,file_checksum:F,uuids:O}};_.worker_logger.debug("Parsed code to tree",{filename:o});const R=[{type:u.EntityType.Program,symbol:{sourcemap_location_hints:[]},context:{},childrenCount:{},siblingIndex:0}],W=new Set;_.worker_logger.debug("Traversing declarations",{filename:o}),r?.postMessage("eventlooptime"),c.traverse(B,{[f.NamespaceScopeAlias]:{enter(e){const{node:r}=e;if(!(0,f.isNamespaceScopeable)(r))return;const n=R[R.length-1];let i=(0,y.getScope)(e);if(!i)return;i=(0,E.resolveScopeSymbols)(L,i);const s=n.childrenCount[i.type]||0,a={...i,childrenCount:{},siblingIndex:s};if(n.childrenCount[i.type]=s+1,R.push(a),W.add(r),e.isFunction()){const r=function(e,t,r,n,o,i,s){try{const l=e;let u=e.node.body.loc?.start?.index;if(void 0===u)throw new Error("Function node has no block start location");if(void 0===e.node.start||null===e.node.start||void 0===e.node.end||null===e.node.end)throw new Error("Function node has no start or end location");"ArrowFunctionExpression"===l.node.type&&l.node.body.extra?.parenthesized&&l.node.body.extra?.parenStart&&Number.isInteger(l.node.body.extra.parenStart)&&(u=l.node.body.extra.parenStart);const c=function(e,t,r,n){const o=n.slice(0,r),i=`${e}_${t}_${Buffer.byteLength(o,"utf8")}`;return(0,b.v5)(i,m.default.functionUuidNamespace).toString()}(t,r,u-(o-1),i),f=(a=i.slice(e.node.start,e.node.end),(0,S.default)(a).readUInt32BE().toString());if(!f)return void _.worker_logger.warn("Function hash not found",{functionID:c,filename:r});const y=l.node.async||!1,w=(0,E.getNodeLocation)(l.node,s),C=w.start.source??r,I=(0,h.getEntityType)(l),x=(0,d.getMethodKind)(l.node),k=(0,d.getContextualData)(l);k.symbol&&(k.symbol=(0,E.resolveSymbol)(s,k.symbol)),k.callback?.callee.symbol&&(k.callback.callee.symbol=(0,E.resolveSymbol)(s,k.callback.callee.symbol));const T=(0,g.getParameterInfo)(l,s),{siblingIndex:D,childrenCount:H}=n[n.length-1],F=n.slice(0,-1),O=(0,d.getFunctionIdentifier)(l),P=(0,E.resolveSymbol)(s,{name:O?.name,sourcemap_location_hints:O?(0,E.getLocationList)(O,O.name):(0,E.getLocationList)(l.node,void 0),format:O?"%s":void 0});return{module:p.default.parse(C).name,symbol:P,context:k,file:C,type:I,format:v.Format.cjs,parameters:T,async:y,start_line:w.start.line,end_line:w.end.line,start_column:w.start.column,source_code_hash:f,runtime_function_id:c,scope_chain:F,declarations_count:0,methodKind:x,siblingIndex:D,childrenCount:H,original_location:{file:r,start_line:e.node.loc?.start?.line,end_line:e.node.loc?.end?.line,start_column:e.node.loc?.start?.column,end_column:e.node.loc?.end?.column}}}catch(e){_.worker_logger.error("Failed to handle function",{filename:r,error:e instanceof Error?e.message:void 0,stack:e instanceof Error?e.stack:void 0})}var a}(e,P,o,R,M,t,L);r&&K.push(r)}},exit(e){W.has(e.node)&&(R.pop(),W.delete(e.node))}}}),_.worker_logger.debug("Traversed declarations",{filename:o});const q=new Set(K.map((e=>e.runtime_function_id))),$=[],Y=[];K.forEach((e=>{q.has(e.runtime_function_id)?$.push({...e,declarations_count:K.length,bundler_build_id:i,was_bundler_build_id_generated:s,has_input_map:void 0!==A,sourcemap_crc:U,file_path_checksum:H,file_checksum:F}):Y.push(e)})),Y.length>0&&_.worker_logger.warn("Function IDs mismatch, missing instrumentation",{filename:o,runtimeFunctionIds:O,missingInstrumentation:Y}),new Set(O).forEach((e=>{q.has(e)&&q.delete(e)}));const V=q.size>0;return V&&_.worker_logger.error("Function IDs mismatch, missing declerations",{filename:o,missingRuntimeFunctionIds:[...q]}),{declarations:$,blacklist:V?{file_path_checksum:H,file_checksum:F,uuids:[...q]}:void 0}}},5809:e=>{e.exports=require("./config")},5913:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.getMethodKind=t.getContextualData=t.getContextSymbol=t.getFunctionIdentifier=void 0;const s=r(6346),a=i(r(6346)),l=r(9514),u=r(692),c=r(1377),d=r(949),p=r(3830);function m(e,t){return{name:t,sourcemap_location_hints:(0,d.getLocationList)(e,t),format:"%s"}}function f(e){if(s.types.isIdentifier(e))return{name:e.name,sourcemap_location_hints:e.loc?[{name:e.name,line:e.loc.start.line,column:e.loc.start.column,line_on_server:e.loc.start.line,column_on_server:e.loc.start.column}]:[],format:"%s"};if(s.types.isMemberExpression(e)||s.types.isOptionalMemberExpression(e)){let t;t=s.types.isThisExpression(e.object)?{name:"this",sourcemap_location_hints:(0,d.getLocationList)(e.object,"this")}:f(e.object);const r=f(e.property),n=e.computed?t.name+"["+r.name+"]":t.name+"."+r.name,o=t.format??"%s",i=r.format??"%s",a=e.computed?`${o}[${i}]`:`${o}.${i}`;return{name:n,sourcemap_location_hints:[...t.sourcemap_location_hints,...r.sourcemap_location_hints],format:a}}if(s.types.isOptionalCallExpression(e)||s.types.isCallExpression(e))return f(e.callee);if(s.types.isSequenceExpression(e))return(0,p.isHudAwaitSequence)(e)?f((0,p.getHudAwaitSequenceElement)(e)):f(e.expressions[e.expressions.length-1]);if(s.types.isArrayExpression(e))return{name:"[]",sourcemap_location_hints:(0,d.getLocationList)(e,"[]"),format:"%s"};if(s.types.isObjectExpression(e))return{name:"{}",sourcemap_location_hints:(0,d.getLocationList)(e,"{}"),format:"%s"};if(s.types.isStringLiteral(e))return{name:`"${e.value}"`,sourcemap_location_hints:(0,d.getLocationList)(e,e.value),format:'"%s"'};throw new l.HudUnsupportedError("Unsupported left side of assignment - "+e.type+"loc - "+JSON.stringify(e.loc))}function y(e){const{node:t}=e;if(e.isExpression())try{return function(e){const{parent:t}=e;if(s.types.isVariableDeclarator(t)&&s.types.isIdentifier(t.id))return m(t,t.id.name);if(s.types.isObjectProperty(t)&&s.types.isIdentifier(t.key))return m(t,t.key.name);if(s.types.isClassProperty(t)&&s.types.isIdentifier(t.key))return m(t,t.key.name);if(s.types.isAssignmentExpression(t))return f(t.left);if(s.types.isAssignmentPattern(t))return f(t.left);throw new l.HudUnsupportedError(`Unsupported parent type - ${t.type} for me ${e.node.type}`)}(e)}catch(e){if(e instanceof l.HudUnsupportedError)return;throw e}c.worker_logger.debug("getContextSymbol; Unsupported node type",{type:t.type})}function h(e){const t=[];return e.arguments.forEach(((e,r)=>{let n,o;s.types.isStringLiteral(e)?(n=u.ArgumentTypes.StringLiteral,o=e.value):s.types.isTemplateLiteral(e)?(n=u.ArgumentTypes.TemplateString,o=function(e){let t="";const r=e.quasis,n=e.expressions;for(let e=0;e<r.length;e++)t+=r[e].value.cooked,e<n.length&&(t+=`\${${g(n[e])}}`);return t=`\`${t}\``,t}(e)):s.types.isIdentifier(e)&&(n=u.ArgumentTypes.Identifier,o=e.name),n&&o&&t.push({index:r,type:n,value:o})})),t}function g(e){if(s.types.isIdentifier(e))return e.name;if(s.types.isStringLiteral(e))return e.value;if(s.types.isCallExpression(e)||s.types.isOptionalCallExpression(e)){const t=e;if(s.types.isIdentifier(t.callee))return t.callee.name;if(s.types.isMemberExpression(t.callee)||s.types.isOptionalMemberExpression(t.callee)){let e="";const r=t.callee;if(s.types.isThisExpression(r.object)?e+="this.":s.types.isIdentifier(r.object)&&(e+=`${r.object.name}.`),""!==e&&s.types.isIdentifier(r.property))return e+=`${r.property.name}`,e}}return""}t.getFunctionIdentifier=function(e){const{node:t}=e;if(s.types.isFunctionDeclaration(t)||s.types.isFunctionExpression(t)){if(s.types.isIdentifier(t.id))return t.id}else if(s.types.isClassMethod(t)){if(s.types.isIdentifier(t.key))return t.key}else if(s.types.isClassPrivateMethod(t)){if(s.types.isIdentifier(t.key.id))return t.key.id}else if(s.types.isObjectMethod(t)&&s.types.isIdentifier(t.key))return t.key},t.getContextSymbol=y,t.getContextualData=function(e){let t,r=!1;return(e.isFunctionExpression()||e.isArrowFunctionExpression())&&(t=function(e){const t=e.parentPath;if(t.isCallExpression())for(const[r,n]of t.node.arguments.entries())if(n===e.node){const e=t.node.callee;let n;try{n=f(e)}catch(t){if(!(t instanceof l.HudUnsupportedError))throw t;c.worker_logger.debug("could not get callee symbol recursively",{error:t,type:e.type})}const o=h(t.node);return{callee:{symbol:n,argsCount:t.node.arguments.length,args:o},index:r}}}(e),r=function(e){const t=e.parentPath;return!!t.isCallExpression()&&t.node.callee===e.node}(e)),{symbol:y(e),callback:t,immediatelyInvoked:r}},t.getMethodKind=function(e){if(a.types.isClassMethod(e)||a.types.isObjectMethod(e)||a.types.isClassPrivateMethod(e))return e.kind}},6346:e=>{e.exports=require("@babel/core")},6760:e=>{e.exports=require("node:path")},7022:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.isSupportedFormat=t.Format=t.FUNCTION_DECLARATION_VERSION=void 0,t.FUNCTION_DECLARATION_VERSION="1.1.2",function(e){e.cjs="commonjs",e.esm="module",e.moduleTypescript="module-typescript",e.commonjsTypescript="commonjs-typescript"}(r||(t.Format=r={})),t.isSupportedFormat=function(e){return Object.values(r).includes(e)}},7892:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getScope=void 0;const n=r(1513),o=r(5913),i=r(949);t.getScope=function(e){const t=(0,n.getEntityType)(e);if(t){const r=(0,n.getEntityIdentity)(e.node),s=r?.name;return{type:t,context:(0,o.getContextualData)(e),symbol:{name:s,sourcemap_location_hints:r?(0,i.getLocationList)(r,s):(0,i.getLocationList)(e.node,void 0),format:r?"%s":void 0},methodKind:(0,o.getMethodKind)(e.node)}}}},8167:e=>{e.exports=require("worker_threads")},9023:e=>{e.exports=require("util")},9514:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getNetworkError=t.UserErrorLogs=t.setFirstError=t.getFirstError=t.isAbortError=t.HudFailExtractSqsQueueName=t.HudNoCallbackInSqsConsumerOn=t.HudNoEventTypeInSqsConsumerOn=t.HudNoQueueUrlInSqsConsumer=t.HudSqsError=t.HudExtensionNextFailedError=t.HudExtensionRegisterError=t.HudExtnensionError=t.HudBadLoggerError=t.HudInitNetworkError=t.HudTsNodeNotFoundButUsed=t.HudSessionThrottle=t.HudNoTranspileOnlyError=t.HudClientExceededMaxRetries=t.HudClientUnauthorizedError=t.HudTimeoutError=t.HudWorkloadCollectorError=t.HudAssert=t.HudUnsupportedError=t.HudEditError=t.HudWorkerError=t.HudClientError=t.HudInitError=t.HudError=void 0;const o=n(r(1019));class i extends Error{code=9e3;name=this.constructor.name;constructor(e){super(e)}}t.HudError=i;class s extends i{code=9001}t.HudInitError=s,t.HudClientError=class extends i{code=9002;originalAxiosErrorCode;constructor(e,t){super(e),this.originalAxiosErrorCode=t}},t.HudWorkerError=class extends i{code=9003};class a extends i{code=9004}t.HudEditError=a,t.HudUnsupportedError=class extends a{code=9005},t.HudAssert=class extends a{code=9006},t.HudWorkloadCollectorError=class extends i{code=9007},t.HudTimeoutError=class extends i{code=9008},t.HudClientUnauthorizedError=class extends i{code=9009},t.HudClientExceededMaxRetries=class extends i{code=9010},t.HudNoTranspileOnlyError=class extends i{code=9011},t.HudSessionThrottle=class extends s{code=9012},t.HudTsNodeNotFoundButUsed=class extends i{code=9013},t.HudInitNetworkError=class extends i{code=9014;originalAxiosErrorCode;constructor(e,t){super(e),this.originalAxiosErrorCode=t}},t.HudBadLoggerError=class extends i{code=9101};class l extends i{code=9200}t.HudExtnensionError=l,t.HudExtensionRegisterError=class extends l{code=9201},t.HudExtensionNextFailedError=class extends l{code=9202};class u extends i{code=9250}t.HudSqsError=u,t.HudNoQueueUrlInSqsConsumer=class extends u{code=9251},t.HudNoEventTypeInSqsConsumerOn=class extends u{code=9252},t.HudNoCallbackInSqsConsumerOn=class extends u{code=9253},t.HudFailExtractSqsQueueName=class extends u{code=9254},t.isAbortError=function(e){return e instanceof Error&&"AbortError"===e.name};let c=9999;t.getFirstError=function(){return c},t.setFirstError=function(e){e&&9999===c&&(c=e)},t.UserErrorLogs={HudServiceNotSet:()=>({level:"error",errCode:"E1001",moreInfo:!0,message:"Can't load Hud, HUD_SERVICE was not set. Please set service name using the environment variable HUD_SERVICE."}),HudServiceInvalid:()=>({level:"error",errCode:"E1002",moreInfo:!0,message:"Can't load Hud, HUD_SERVICE value has invalid service name. Please set service name using the environment variable HUD_SERVICE."}),HudApiKeyNotSet:()=>({level:"error",errCode:"E1004",moreInfo:!0,message:"Can't load Hud, HUD_KEY was not set. Please set API key using the environment variable HUD_KEY."}),HudApiKeyInvalid:()=>({level:"error",errCode:"E1005",moreInfo:!0,message:"Can't load Hud, HUD_KEY value has invalid API key. Please set a valid key in environment variable HUD_KEY."}),BothApiKeyAndServiceNotSet:()=>({level:"error",errCode:"E1007",moreInfo:!0,message:"Can't load Hud, HUD_KEY and HUD_SERVICE were not set. Please set API key using the environment variable HUD_KEY and service name using the environment variable HUD_SERVICE."}),InvalidTag:()=>({level:"warn",errCode:"E1008",moreInfo:!0,message:"HUD_TAGS should be of type Key-Value Object, defaulting to empty tags. Please set valid tags in environment variable HUD_TAGS."}),TagWithDots:()=>({level:"warn",errCode:"E1009",moreInfo:!0,message:"HUD_TAGS keys can't contain dots; they have been replaced with underscores."}),TagsInvalidJson:()=>({level:"warn",errCode:"E1010",moreInfo:!0,message:"Can't load Hud, HUD_TAGS is not a valid JSON, defaulting to empty tags. Please set valid tags in environment variable HUD_TAGS."}),ApiKeyDenied:e=>({level:"error",errCode:"E1011",moreInfo:!0,message:`Can't load Hud, the provided key is invalid. Please provide a valid HUD_KEY in your ${{ENV:"environment variable",CONFIG_FILE:"file",CONFIG_ENV:"HUD_CONFIG",INIT:"init function",SETUP:"setup function"}[e]}.`}),ShutdownGracefully:e=>({level:"error",errCode:`E${e}`,message:"SDK has initiated a graceful shutdown. Your application remains unaffected"}),UnsupportedNodeVersion:()=>({level:"error",errCode:"E1012",moreInfo:!0,message:"Can't load Hud due to an unsupported node version."}),UnsupportedSyntax:()=>({level:"error",errCode:"E1014",moreInfo:!0,message:"Can't load Hud due to an unsupported syntax version."}),UnsupportedLambdaMemory:()=>({level:"error",errCode:"E1015",moreInfo:!0,message:`Can't load Hud as lambda function memory size is less than ${o.default.lambdaMinimunMemory}MB.`}),JSONErrorInUserConfig:(e,t)=>({level:"error",errCode:"E1016",moreInfo:!0,message:`Can't load Hud, the config file contains an invalid JSON. Please set a valid json in Hud's config ${e}`+(t?`, Error: ${t}.`:".")}),ZodErrorInUserConfig:(e,t)=>({level:"error",errCode:"E1017",moreInfo:!0,message:`Can't load Hud, the config file contains an invalid value for field: ${t}. Please set a valid value for ${t} in the config ${e}.`}),ConfigInaccessible:e=>({level:"error",errCode:"E1018",moreInfo:!0,message:`Can't load Hud, the config file is inaccessible. Please make sure your node application has read permissions to the Hud config file, ${e}.`}),SetupCalledWithoutKey:()=>({level:"error",errCode:"E1019",moreInfo:!0,message:"API key not found or invalid. SDK has initiated a graceful shutdown. Your application remains unaffected."}),SetupCalledWithoutService:()=>({level:"error",errCode:"E1020",moreInfo:!0,message:"Service name parameter not found or invalid. SDK has initiated a graceful shutdown. Your application remains unaffected."}),HudEnableIsFalse:()=>({level:"warn",errCode:"E1021",moreInfo:!0,message:"HUD_ENABLE is set to false. SDK has initiated a graceful shutdown. Your application remains unaffected."}),InstrumentedFunctionCountExceeded:e=>({level:"error",errCode:"E1022",moreInfo:!0,message:`SDK limit of ${e} instrumented functions exceeded. SDK has initiated a graceful shutdown. Your application remains unaffected.`}),PodMemoryLimitTooLow:e=>({level:"error",errCode:"E1023",moreInfo:!0,message:`Insufficient memory available. Minimum required:(${e}MB). SDK has initiated a graceful shutdown. Your application remains unaffected.`}),DebuggerAttached:()=>({level:"error",errCode:"E1024",message:"Did not load as debugger is attached."}),InitSessionBeforeRegister:()=>({level:"error",errCode:"E1025",moreInfo:!0,message:"register() was not called, or called after initSession() - please call register() before initSession() and run again. Your application continues normally without Hud."}),RegisterMisplacedNoDeclarations:()=>({level:"warn",errCode:"E1026",moreInfo:!0,message:"Warning - No code has been mapped so far. This probably means register() was called too late — after your code was already loaded. Move it to the top of your entry file to enable proper mapping. Your application continues normally without Hud data."}),UnsupportedFrameworkVersion:e=>({level:"warn",errCode:"E1029",message:`Warning - Unsupported version of ${e} framework(s). This means Hud won't track your framework invocations. Your application continues normally, but with partial Hud data. See the compatibility matrix for details: https://docs.hud.io/docs/hud-sdk-compatibility-matrix-for-node#/`}),UninstrumentedFilesLogThresholdExceeded:e=>({level:"warn",errCode:"E1027",message:`Warning - ${e} of your code files were imported before register(). This means Hud won't track all of your functions. Please move register() call to an earlier location. To view the list of files use register({verbose: true}). Your application continues normally, but with partial Hud data.`,moreInfo:!0}),UninstrumentedFrameworks:e=>({level:"warn",errCode:"E1028",message:`Warning - The framework(s): ${e.map((e=>`"${e}"`)).join(", ")} was imported before register(). This means Hud won't track your framework invocations. Please move register() call to an earlier location. Your application continues normally, but with partial Hud data.`}),YesDeclarationsNoMetrics:()=>({level:"warn",errCode:"E1032",moreInfo:!0,message:"Warning - Code mapped successfully, but no function activity was tracked. Make sure your service is running and actively handling requests."}),HudEnableNotSet:e=>({level:"error",moreInfo:!0,message:`Did not load as HUD_ENABLE is ${void 0===e?"undefined":"set to a non-true value"}. Please set HUD_ENABLE=true to run Hud.`}),LambdaNotViaLayer:()=>({level:"error",errCode:"E1034",message:"Can't load Hud, lambda support is currently in beta. Contact Hud to get early access."}),RunningInBun:()=>({level:"error",errCode:"E1035",message:"Hud does not support Bun yet. The SDK has initiated a graceful shutdown. Your application remains unaffected. See the compatibility matrix for details: https://docs.hud.io/docs/hud-sdk-compatibility-matrix-for-node"}),RunningOnWindows:()=>({level:"error",errCode:"E1036",message:"Hud does not support Windows yet. The SDK has initiated a graceful shutdown. Your application remains unaffected. See the compatibility matrix for details: https://docs.hud.io/docs/hud-sdk-compatibility-matrix-for-node"}),UnsupportedNativeBuild:()=>({level:"error",errCode:"E1037",message:"Hud does not support this platform yet. The SDK has initiated a graceful shutdown. Your application remains unaffected. See the compatibility matrix for details: https://docs.hud.io/docs/hud-sdk-compatibility-matrix-for-node"}),TsNodeNotTranspileOnly:()=>({level:"error",errCode:"E1038",message:"detected ts-node is used without the transpileOnly flag, which is not supported yet. SDK has initiated a graceful shutdown. Your application remains unaffected.",moreInfo:!0}),TsNodeNotFoundEvenThoughRunWithTsNode:()=>({level:"error",errCode:"E1039",message:"'ts-node' was detected but could not be resolved by Hud. This may happen if 'ts-node' is installed globally. Try installing it locally in your project. The SDK has initiated a graceful shutdown. Your application remains unaffected.",moreInfo:!0}),InitFailedDueGenericNetworkError:()=>({level:"error",moreInfo:!0,errCode:"E1040",message:"A network error occurred during SDK initialization. Please check your internet connection and try again. SDK has initiated a graceful shutdown. Your application remains unaffected."}),InitFailedDueNetworkTimeout:()=>({level:"error",moreInfo:!0,errCode:"E1041",message:"The SDK failed to connect to Hud's backend due to a timeout during SDK initialization. Please verify your firewall settings to ensure outbound connections are allowed. SDK has initiated a graceful shutdown. Your application remains unaffected."}),InitFailedDueNetworkRST:()=>({level:"error",moreInfo:!0,errCode:"E1042",message:"The SDK connection to Hud's backend was reset unexpectedly (RST) during SDK initialization. Please check your firewall or network security settings. SDK has initiated a graceful shutdown. Your application remains unaffected."}),InitFailedDueSelfSignedCert:()=>({level:"error",moreInfo:!0,errCode:"E1043",message:"SSL certificate verification failed during SDK initialization. If your organization uses a self-signed certificate, set the NODE_EXTRA_CA_CERTS environment variable to the path of your CA certificate file. SDK has initiated a graceful shutdown. Your application remains unaffected."}),InitFailedDueDnsFailed:()=>({level:"error",moreInfo:!0,errCode:"E1044",message:"The SDK failed to resolve DNS when attempting to connect to Hud's backend during SDK initialization. If the problem persists, please contact support. SDK has initiated a graceful shutdown. Your application remains unaffected."}),InitFailedDueBackendError:()=>({level:"error",moreInfo:!0,errCode:"E1045",message:"Hud: The SDK was unable to complete initialization due to a temporary issue with Hud’s backend. SDK has initiated a graceful shutdown. Your application remains unaffected."}),InitTimeout:e=>({moreInfo:!0,level:"error",message:`SDK imported but not initialized. Please ensure to call '${e?"hud.initSession(KEY, SERVICE)":"hud.init()"}' to initialize the SDK.`}),EsbuildMissingKey:()=>({level:"error",errCode:"ES0001",moreInfo:!0,message:"missing HUD_KEY, skipping Hud plugin, your build is unaffected."}),EsbuildFailedProcessingFile:e=>({level:"error",errCode:"ES0002",moreInfo:!0,message:`failed processing file "${e}", reverting to original loader.`}),EsbuildFailedBundling:()=>({level:"error",errCode:"ES0003",moreInfo:!0,message:"encountered unexpected file bundling, build aborted."}),EsbuildFailedParsingSourcemap:()=>({level:"error",errCode:"ES0004",moreInfo:!0,message:"failed parsing source maps, skipping upload, Hud will run without source maps."}),EsbuildFailedUploadingSourcemap:e=>({level:"error",errCode:"ES0005",moreInfo:!0,message:`failed uploading source map: ${e}, Hud will run without source maps.`}),EsbuildFailedUploadingSourcemapUnauthorized:()=>({level:"error",errCode:"ES0006",moreInfo:!0,message:"failed uploading source map: unauthorized, Hud will run without source maps."}),EsbuildUnsupportedPlatform:()=>({level:"error",errCode:"ES0007",message:'Can\'t load Hud, as our esbuild plugin supports "node" mode only. Your app remains unaffected. For more information visit docs.hud.io/docs/support-matrix'})},t.getNetworkError=function(e){return{ECONNABORTED:t.UserErrorLogs.InitFailedDueNetworkTimeout(),ECONNREFUSED:t.UserErrorLogs.InitFailedDueNetworkRST(),ENOTFOUND:t.UserErrorLogs.InitFailedDueDnsFailed(),SELF_SIGNED_CERT_IN_CHAIN:t.UserErrorLogs.InitFailedDueSelfSignedCert(),ERR_BAD_RESPONSE:t.UserErrorLogs.InitFailedDueBackendError()}[e]??t.UserErrorLogs.InitFailedDueGenericNetworkError()}},9896:e=>{e.exports=require("fs")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0});const t=r(8167),o=r(5600),i=r(1377);let s;async function a(e){try{if("TsNodeConfig"===e.msg)return void(s=e.content.tsOptions);t.parentPort?.postMessage("eventlooptime");const r=e.content,{filename:n,indexOffset:i,indexOffsetEnd:a}=r,l=await(0,o.readFile)(n,i,a);if(!l)return;const u=await(0,o.parseDeclarations)(r,l,t.parentPort,s);t.parentPort?.postMessage(u)}catch(e){i.worker_logger.error("Error in declaration worker",{msg:e instanceof Error?e.message:void 0,stack:e instanceof Error?e.stack:void 0})}t.parentPort?.once("message",a)}t.isMainThread||(t.parentPort?.setMaxListeners(0),(async()=>{t.parentPort?.once("message",a)})())})(),n})()));
//# sourceMappingURL=declarationWorker.js.map