UNPKG

dd-trace

Version:

Datadog APM tracing client for JavaScript

155 lines (148 loc) 254 kB
(()=>{var i={"./@apm-js-collab/code-transformer/index.js"(i,s,k){"use strict";i.exports=k("./@apm-js-collab/code-transformer/lib/index.js")},"./@apm-js-collab/code-transformer/lib/index.js"(i,s,k){"use strict";let{InstrumentationMatcher:S}=k("./@apm-js-collab/code-transformer/lib/matcher.js");i.exports={create:function(i,s){return new S(i,s)}}},"./@apm-js-collab/code-transformer/lib/matcher.js"(i,s,k){"use strict";let S=k("./semifies/index.js"),{Transformer:E}=k("./@apm-js-collab/code-transformer/lib/transformer.js");let InstrumentationMatcher=class InstrumentationMatcher{#e=[];#t=null;#r={};#n={};constructor(i,s){this.#e=i,this.#t=s||"diagnostics_channel"}free(){this.#r={}}addTransform(i,s){this.#n[i]=s}getTransformer(i,s,k){k=k.replace(/\\/g,"/");let w=`${i}/${k}@${s}`;if(this.#r[w])return this.#r[w];let C=this.#e.filter(({module:E})=>E.name===i&&E.filePath===k&&S(s,E.versionRange));if(0!==C.length)return this.#r[w]=new E(i,s,k,C,this.#t,this.#n),this.#r[w]}};i.exports={InstrumentationMatcher}},"./@apm-js-collab/code-transformer/lib/transformer.js"(i,s,k){"use strict";let S,E,w=k("./esquery/dist/esquery.min.js"),{parse:C}=k("./meriyah/dist/meriyah.cjs"),{generate:T}=k("./astring/dist/astring.js"),_=k("./@apm-js-collab/code-transformer/lib/transforms.js");let Transformer=class Transformer{#o=null;#a=null;#i=null;#e=[];#t=null;#n={};constructor(i,s,k,S,E,w={}){this.#o=i,this.#a=s,this.#i=k,this.#e=S,this.#t=E,this.#n=w}free(){}transform(i,s,_){let O;if(Buffer.isBuffer(i)&&(i=i.toString()),!i)return{code:i};let N={},D=0;for(let k of this.#e){let{astQuery:S,functionQuery:E={}}=k;if(!O){let k={loc:!0,ranges:!0,raw:!0,module:"esm"===s};try{O=C(i,k)}catch{O=C(i,{...k,module:!k.module})}"esm"===s&&(N=this.#s(O))}let T=this.#l(E,N),_=S||this.#c(T),q={...k,dcModule:this.#t,moduleType:s,moduleVersion:this.#a,functionQuery:T};q.operator=this.#u(q),w.traverse(O,w.parse(_),(...i)=>{D++,this.#p(q,...i)})}if(0===D&&this.#e.length>0){let i=this.#e.map(({functionQuery:i={}})=>{let s=this.#l(i,N),k=i.methodName||i.privateMethodName||i.functionName||i.expressionName||"constructor",S=i.className||i.functionName||i.expressionName,E=s.className||s.functionName||s.expressionName;return S&&S!==E?`${S} (local name: ${E})`:k});throw Error(`Failed to find injection points for: ${JSON.stringify(i)}`)}if(O){S??=k("./@apm-js-collab/code-transformer/node_modules/source-map/source-map.js").SourceMapConsumer,E??=k("./@apm-js-collab/code-transformer/node_modules/source-map/source-map.js").SourceMapGenerator;let i=`${this.#o}/${this.#i}`,s=new E(_?new S(_):{file:i});return{code:T(O,{sourceMap:s}),map:s.toString()}}return{code:i}}#p(i,...s){let k=this.#n[i.operator]??_[i.operator],{index:S=0}=i.functionQuery,[E]=s,w=E.init?.type||E.type;if("ClassDeclaration"===w||"ClassExpression"===w||"VariableDeclarator"!==E.type&&(i.functionIndex=++i.functionIndex||0,null===S||S===i.functionIndex))k(i,...s)}#u({transform:i,functionQuery:{kind:s}}){if(i)return i;switch(s){case"Async":return"tracePromise";case"Callback":return"traceCallback";default:return"traceSync"}}#s(i){let s={};for(let k of i.body)if("ExportNamedDeclaration"===k.type&&!k.source){for(let i of k.specifiers)if(i.exported&&i.local){let k=i.exported.name??i.exported.value,S=i.local.name??i.local.value;k&&S&&(s[k]=S)}}return s}#l(i,s){if(!i.isExportAlias)return i;let{functionName:k,expressionName:S,className:E}=i;return k&&s[k]?{...i,functionName:s[k]}:S&&s[S]?{...i,expressionName:s[S]}:E&&s[E]?{...i,className:s[E]}:i}#c(i){let{functionName:s,expressionName:k,className:S,objectName:E,propertyName:w}=i,C=i.privateMethodName?"PrivateIdentifier":"Identifier",T=[],_=i.methodName||i.privateMethodName;if(S?(_??="constructor",T.push(`[id.name="${S}"]`,`[id.name="${S}"] > ClassExpression`,`[id.name="${S}"] > ClassBody > [key.name="${_}"][key.type=${C}] > [async]`,`[id.name="${S}"] > ClassExpression > ClassBody > [key.name="${_}"][key.type=${C}] > [async]`)):_&&T.push(`ClassBody > [key.name="${_}"][key.type=${C}] > [async]`,`Property[key.name="${_}"][key.type=${C}] > [async]`),s?T.push(`FunctionDeclaration[id.name="${s}"][async]`):k&&T.push(`FunctionExpression[id.name="${k}"][async]`,`ArrowFunctionExpression[id.name="${k}"][async]`,`VariableDeclarator[id.name="${k}"] > FunctionExpression[async]`,`VariableDeclarator[id.name="${k}"] > ArrowFunctionExpression[async]`,`AssignmentExpression[left.property.name="${k}"] > FunctionExpression[async]`,`AssignmentExpression[left.property.name="${k}"] > ArrowFunctionExpression[async]`,`AssignmentExpression[left.name="${k}"] > FunctionExpression[async]`,`AssignmentExpression[left.name="${k}"] > ArrowFunctionExpression[async]`),E||w){if(!E||!w)throw Error(`functionQuery: 'objectName' and 'propertyName' must be used together (got objectName=${E}, propertyName=${w})`);let i="this"===E?"left.object.type=ThisExpression":`left.object.name="${E}"`;T.push(`AssignmentExpression[${i}][left.property.name="${w}"] > [async]`)}return T.join(", ")}};i.exports={Transformer}},"./@apm-js-collab/code-transformer/lib/transforms.js"(i,s,k){"use strict";let S=k("./esquery/dist/esquery.min.js"),{parse:E}=k("./meriyah/dist/meriyah.cjs"),tracingChannelPredicate=i=>i.declarations?.[0]?.id?.properties?.[0]?.value?.name==="tr_ch_apm_tracingChannel",w=/[^\w]/g,formatChannelVariable=i=>`tr_ch_apm$${i.replace(w,"_")}`,C=i.exports={tracingChannelImport({dcModule:i,moduleType:s},k){if(k.body.some(tracingChannelPredicate))return;let S={module:"esm"===s},w=k.body.findIndex(i=>"use strict"===i.directive),C="esm"===s?`import tr_ch_apm_dc from "${i}"`:`const tr_ch_apm_dc = require("${i}")`,T=`const tr_ch_apm_hasSubscribers = ch => ch.start.hasSubscribers || ch.end.hasSubscribers || ch.asyncStart.hasSubscribers || ch.asyncEnd.hasSubscribers || ch.error.hasSubscribers`;k.body.splice(w+1,0,E(C,S).body[0],E("const { tracingChannel: tr_ch_apm_tracingChannel } = tr_ch_apm_dc",S).body[0],E(T,S).body[0])},tracingChannelDeclaration(i,s){let{channelName:k,module:{name:S}}=i,w=formatChannelVariable(k);if(s.body.some(i=>i.declarations?.[0]?.id?.name===w))return;C.tracingChannelImport(i,s);let T=s.body.findIndex(tracingChannelPredicate),_=` const ${w} = tr_ch_apm_tracingChannel("orchestrion:${S}:${k}") `;s.body.splice(T+1,0,E(_).body[0])},traceCallback:traceAny,tracePromise:traceAny,traceSync:traceAny};function traceAny(i,s,k,S){let E=S[S.length-1];"ClassDeclaration"===s.type||"ClassExpression"===s.type?traceInstanceMethod(i,s,E):traceFunction(i,s,E)}function traceFunction(i,s,k){C.tracingChannelDeclaration(i,k);let{functionQuery:{methodName:S,privateMethodName:E,functionName:w,expressionName:T}}=i;s.body=wrap(i,{type:"constructor"!==S&&(S||E||w||T)?"FunctionExpression":"ArrowFunctionExpression",params:s.params,body:s.body,async:s.async,expression:!1,generator:s.generator},k),s.generator=!1,s.async=!1,wrapSuper(i,s)}function traceInstanceMethod(i,s,k){let{functionQuery:S,operator:w}=i,{methodName:T}=S;if(!T)return;let _=s.body;if(_.body.some(({key:i})=>i.name===T))return;let O=_.body.find(({kind:i})=>"constructor"===i);C.tracingChannelDeclaration(i,k),O||(O=E(s.superClass?"class A extends Object { constructor (...args) { super(...args) } }":"class A { constructor () {} }").body[0].body.body[0],_.body.unshift(O));let N=E(` const __apm$${T} = this["${T}"] this["${T}"] = function () {} `).body,D=N[1].expression.right;D.async="tracePromise"===w,D.body=wrap(i,{type:"Identifier",name:`__apm$${T}`},k),wrapSuper(i,D),O.value.body.body.push(...N)}function wrap(i,s,k){let w,{operator:C,moduleVersion:T}=i;"traceCallback"===C&&(w=wrapCallback(i,s)),"tracePromise"===C&&(w=wrapPromise(i,s,k)),"traceSync"===C&&(w=wrapSync(i,s,k));let _=w.body[0].body,O=E("ArrowFunctionExpression"===s.type?` const __apm$ctx = { arguments, moduleVersion: ${JSON.stringify(T)} }; const __apm$traced = () => { const __apm$wrapped = () => {}; return __apm$wrapped(...arguments); }; `:` const __apm$ctx = { arguments, self: this, moduleVersion: ${JSON.stringify(T)} }; const __apm$traced = () => { const __apm$wrapped = () => {}; return __apm$wrapped.apply(this, arguments); }; `).body;return _.body.unshift(...O),S.query(_,"[id.name=__apm$wrapped]")[0].init=s,_}function wrapSuper(i,s){let k=new Set;for(let i of(S.traverse(s.body,S.parse("[object.type=Super]"),(i,s)=>{let S,{name:w}=i.property;if(s.callee){let{expression:i}=E(`__apm$super['${w}'].call(this)`).body[0];s.callee=S=i.callee,s.arguments.unshift(...i.arguments)}else s.expression=S=E(`__apm$super['${w}']`).body[0];S.computed=s.callee.computed,S.optional=s.callee.optional,k.add(w)}),k)){let k=E(` class Wrapper { wrapper () { __apm$super['${i}'] = super['${i}'] } } `).body[0].body.body[0].value.body.body[0];s.body.body.unshift(k)}k.size>0&&s.body.body.unshift(E("const __apm$super = {}").body[0])}function wrapCallback(i,s){let{channelName:k,functionQuery:{callbackIndex:S=-1}}=i,w=formatChannelVariable(k);return E(` function wrapper () { const __apm$cb = Array.prototype.at.call(arguments, ${S}); if (!${w}.start.hasSubscribers) return __apm$traced(); function __apm$wrappedCb(err, res) { if (err) { __apm$ctx.error = err; ${w}.error.publish(__apm$ctx); } else { __apm$ctx.result = res; } ${w}.asyncStart.runStores(__apm$ctx, () => { try { if (__apm$cb) { return __apm$cb.apply(this, arguments); } } finally { ${w}.asyncEnd.publish(__apm$ctx); } }); } if (typeof __apm$cb !== 'function') { return __apm$traced(); } Array.prototype.splice.call(arguments, ${S}, 1, __apm$wrappedCb); return ${w}.start.runStores(__apm$ctx, () => { try { return __apm$traced(); } catch (err) { __apm$ctx.error = err; ${w}.error.publish(__apm$ctx); throw err; } finally { __apm$ctx.self ??= this; ${w}.end.publish(__apm$ctx); } }); } `)}function wrapPromise(i,s){let{channelName:k}=i,S=formatChannelVariable(k);return E(` function wrapper () { if (!tr_ch_apm_hasSubscribers(${S})) return __apm$traced(); return ${S}.start.runStores(__apm$ctx, () => { try { let promise = __apm$traced(); if (typeof promise?.then !== 'function') { __apm$ctx.result = promise; return promise; } // Mirror Node.js core diagnostics_channel behaviour: for native Promise // instances, chain normally (safe since there is no subclass API to // preserve). For Promise subclasses and other thenables, side-chain the // callbacks for event publishing and return the original so that any // subclass-specific methods (e.g. APIPromise.withResponse()) remain // accessible to the caller. if (promise instanceof Promise && promise.constructor === Promise) { return promise.then( result => { __apm$ctx.result = result; ${S}.asyncStart.publish(__apm$ctx); ${S}.asyncEnd.publish(__apm$ctx); return result; }, err => { __apm$ctx.error = err; ${S}.error.publish(__apm$ctx); ${S}.asyncStart.publish(__apm$ctx); ${S}.asyncEnd.publish(__apm$ctx); throw err; } ); } promise.then( result => { __apm$ctx.result = result; ${S}.asyncStart.publish(__apm$ctx); ${S}.asyncEnd.publish(__apm$ctx); }, err => { __apm$ctx.error = err; ${S}.error.publish(__apm$ctx); ${S}.asyncStart.publish(__apm$ctx); ${S}.asyncEnd.publish(__apm$ctx); } ); return promise; } catch (err) { __apm$ctx.error = err; ${S}.error.publish(__apm$ctx); throw err; } finally { __apm$ctx.self ??= this; ${S}.end.publish(__apm$ctx); } }); } `)}function wrapSync(i,s){let{channelName:k}=i,S=formatChannelVariable(k);return E(` function wrapper () { if (!tr_ch_apm_hasSubscribers(${S})) return __apm$traced(); return ${S}.start.runStores(__apm$ctx, () => { try { const result = __apm$traced(); __apm$ctx.result = result; return result; } catch (err) { __apm$ctx.error = err; ${S}.error.publish(__apm$ctx); throw err; } finally { __apm$ctx.self ??= this; ${S}.end.publish(__apm$ctx); } }); } `)}},"./@apm-js-collab/code-transformer/node_modules/source-map/lib/array-set.js"(i,s,k){var S=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/util.js"),E=Object.prototype.hasOwnProperty,w="u">typeof Map;function ArraySet(){this._array=[],this._set=w?new Map:Object.create(null)}ArraySet.fromArray=function(i,s){for(var k=new ArraySet,S=0,E=i.length;S<E;S++)k.add(i[S],s);return k},ArraySet.prototype.size=function(){return w?this._set.size:Object.getOwnPropertyNames(this._set).length},ArraySet.prototype.add=function(i,s){var k=w?i:S.toSetString(i),C=w?this.has(i):E.call(this._set,k),T=this._array.length;(!C||s)&&this._array.push(i),C||(w?this._set.set(i,T):this._set[k]=T)},ArraySet.prototype.has=function(i){if(w)return this._set.has(i);var s=S.toSetString(i);return E.call(this._set,s)},ArraySet.prototype.indexOf=function(i){if(w){var s=this._set.get(i);if(s>=0)return s}else{var k=S.toSetString(i);if(E.call(this._set,k))return this._set[k]}throw Error('"'+i+'" is not in the set.')},ArraySet.prototype.at=function(i){if(i>=0&&i<this._array.length)return this._array[i];throw Error("No element indexed by "+i)},ArraySet.prototype.toArray=function(){return this._array.slice()},s.ArraySet=ArraySet},"./@apm-js-collab/code-transformer/node_modules/source-map/lib/base64-vlq.js"(i,s,k){var S=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/base64.js");function toVLQSigned(i){return i<0?(-i<<1)+1:(i<<1)+0}function fromVLQSigned(i){var s=i>>1;return(1&i)==1?-s:s}s.encode=function(i){var s,k="",E=toVLQSigned(i);do s=31&E,(E>>>=5)>0&&(s|=32),k+=S.encode(s);while(E>0);return k},s.decode=function(i,s,k){var E,w,C=i.length,T=0,_=0;do{if(s>=C)throw Error("Expected more digits in base 64 VLQ value.");if(-1===(w=S.decode(i.charCodeAt(s++))))throw Error("Invalid base64 digit: "+i.charAt(s-1));E=!!(32&w),w&=31,T+=w<<_,_+=5}while(E);k.value=fromVLQSigned(T),k.rest=s}},"./@apm-js-collab/code-transformer/node_modules/source-map/lib/base64.js"(i,s){var k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");s.encode=function(i){if(0<=i&&i<k.length)return k[i];throw TypeError("Must be between 0 and 63: "+i)},s.decode=function(i){return 65<=i&&i<=90?i-65:97<=i&&i<=122?i-97+26:48<=i&&i<=57?i-48+52:43==i?62:47==i?63:-1}},"./@apm-js-collab/code-transformer/node_modules/source-map/lib/binary-search.js"(i,s){function recursiveSearch(i,k,S,E,w,C){var T=Math.floor((k-i)/2)+i,_=w(S,E[T],!0);return 0===_?T:_>0?k-T>1?recursiveSearch(T,k,S,E,w,C):C==s.LEAST_UPPER_BOUND?k<E.length?k:-1:T:T-i>1?recursiveSearch(i,T,S,E,w,C):C==s.LEAST_UPPER_BOUND?T:i<0?-1:i}s.GREATEST_LOWER_BOUND=1,s.LEAST_UPPER_BOUND=2,s.search=function(i,k,S,E){if(0===k.length)return -1;var w=recursiveSearch(-1,k.length,i,k,S,E||s.GREATEST_LOWER_BOUND);if(w<0)return -1;for(;w-1>=0&&0===S(k[w],k[w-1],!0);)--w;return w}},"./@apm-js-collab/code-transformer/node_modules/source-map/lib/mapping-list.js"(i,s,k){var S=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/util.js");function generatedPositionAfter(i,s){var k=i.generatedLine,E=s.generatedLine,w=i.generatedColumn,C=s.generatedColumn;return E>k||E==k&&C>=w||0>=S.compareByGeneratedPositionsInflated(i,s)}function MappingList(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function(i,s){this._array.forEach(i,s)},MappingList.prototype.add=function(i){generatedPositionAfter(this._last,i)?this._last=i:this._sorted=!1,this._array.push(i)},MappingList.prototype.toArray=function(){return this._sorted||(this._array.sort(S.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},s.MappingList=MappingList},"./@apm-js-collab/code-transformer/node_modules/source-map/lib/quick-sort.js"(i,s){function swap(i,s,k){var S=i[s];i[s]=i[k],i[k]=S}function randomIntInRange(i,s){return Math.round(i+Math.random()*(s-i))}function doQuickSort(i,s,k,S){if(k<S){var E=randomIntInRange(k,S),w=k-1;swap(i,E,S);for(var C=i[S],T=k;T<S;T++)0>=s(i[T],C)&&swap(i,w+=1,T);swap(i,w+1,T);var _=w+1;doQuickSort(i,s,k,_-1),doQuickSort(i,s,_+1,S)}}s.quickSort=function(i,s){doQuickSort(i,s,0,i.length-1)}},"./@apm-js-collab/code-transformer/node_modules/source-map/lib/source-map-consumer.js"(i,s,k){var S=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/util.js"),E=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/binary-search.js"),w=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/array-set.js").ArraySet,C=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/base64-vlq.js"),T=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/quick-sort.js").quickSort;function SourceMapConsumer(i,s){var k=i;return"string"==typeof i&&(k=S.parseSourceMapInput(i)),null!=k.sections?new IndexedSourceMapConsumer(k,s):new BasicSourceMapConsumer(k,s)}function BasicSourceMapConsumer(i,s){var k=i;"string"==typeof i&&(k=S.parseSourceMapInput(i));var E=S.getArg(k,"version"),C=S.getArg(k,"sources"),T=S.getArg(k,"names",[]),_=S.getArg(k,"sourceRoot",null),O=S.getArg(k,"sourcesContent",null),N=S.getArg(k,"mappings"),D=S.getArg(k,"file",null);if(E!=this._version)throw Error("Unsupported version: "+E);_&&(_=S.normalize(_)),C=C.map(String).map(S.normalize).map(function(i){return _&&S.isAbsolute(_)&&S.isAbsolute(i)?S.relative(_,i):i}),this._names=w.fromArray(T.map(String),!0),this._sources=w.fromArray(C,!0),this._absoluteSources=this._sources.toArray().map(function(i){return S.computeSourceURL(_,i,s)}),this.sourceRoot=_,this.sourcesContent=O,this._mappings=N,this._sourceMapURL=s,this.file=D}function Mapping(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function IndexedSourceMapConsumer(i,s){var k=i;"string"==typeof i&&(k=S.parseSourceMapInput(i));var E=S.getArg(k,"version"),C=S.getArg(k,"sections");if(E!=this._version)throw Error("Unsupported version: "+E);this._sources=new w,this._names=new w;var T={line:-1,column:0};this._sections=C.map(function(i){if(i.url)throw Error("Support for url field in sections not implemented.");var k=S.getArg(i,"offset"),E=S.getArg(k,"line"),w=S.getArg(k,"column");if(E<T.line||E===T.line&&w<T.column)throw Error("Section offsets must be ordered and non-overlapping.");return T=k,{generatedOffset:{generatedLine:E+1,generatedColumn:w+1},consumer:new SourceMapConsumer(S.getArg(i,"map"),s)}})}SourceMapConsumer.fromSourceMap=function(i,s){return BasicSourceMapConsumer.fromSourceMap(i,s)},SourceMapConsumer.prototype._version=3,SourceMapConsumer.prototype.__generatedMappings=null,Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),SourceMapConsumer.prototype.__originalMappings=null,Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),SourceMapConsumer.prototype._charIsMappingSeparator=function(i,s){var k=i.charAt(s);return";"===k||","===k},SourceMapConsumer.prototype._parseMappings=function(i,s){throw Error("Subclasses must implement _parseMappings")},SourceMapConsumer.GENERATED_ORDER=1,SourceMapConsumer.ORIGINAL_ORDER=2,SourceMapConsumer.GREATEST_LOWER_BOUND=1,SourceMapConsumer.LEAST_UPPER_BOUND=2,SourceMapConsumer.prototype.eachMapping=function(i,s,k){switch(k||SourceMapConsumer.GENERATED_ORDER){case SourceMapConsumer.GENERATED_ORDER:E=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:E=this._originalMappings;break;default:throw Error("Unknown order of iteration.")}var E,w=this.sourceRoot;E.map(function(i){var s=null===i.source?null:this._sources.at(i.source);return{source:s=S.computeSourceURL(w,s,this._sourceMapURL),generatedLine:i.generatedLine,generatedColumn:i.generatedColumn,originalLine:i.originalLine,originalColumn:i.originalColumn,name:null===i.name?null:this._names.at(i.name)}},this).forEach(i,s||null)},SourceMapConsumer.prototype.allGeneratedPositionsFor=function(i){var s=S.getArg(i,"line"),k={source:S.getArg(i,"source"),originalLine:s,originalColumn:S.getArg(i,"column",0)};if(k.source=this._findSourceIndex(k.source),k.source<0)return[];var w=[],C=this._findMapping(k,this._originalMappings,"originalLine","originalColumn",S.compareByOriginalPositions,E.LEAST_UPPER_BOUND);if(C>=0){var T=this._originalMappings[C];if(void 0===i.column)for(var _=T.originalLine;T&&T.originalLine===_;)w.push({line:S.getArg(T,"generatedLine",null),column:S.getArg(T,"generatedColumn",null),lastColumn:S.getArg(T,"lastGeneratedColumn",null)}),T=this._originalMappings[++C];else for(var O=T.originalColumn;T&&T.originalLine===s&&T.originalColumn==O;)w.push({line:S.getArg(T,"generatedLine",null),column:S.getArg(T,"generatedColumn",null),lastColumn:S.getArg(T,"lastGeneratedColumn",null)}),T=this._originalMappings[++C]}return w},s.SourceMapConsumer=SourceMapConsumer,BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype),BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer,BasicSourceMapConsumer.prototype._findSourceIndex=function(i){var s,k=i;if(null!=this.sourceRoot&&(k=S.relative(this.sourceRoot,k)),this._sources.has(k))return this._sources.indexOf(k);for(s=0;s<this._absoluteSources.length;++s)if(this._absoluteSources[s]==i)return s;return -1},BasicSourceMapConsumer.fromSourceMap=function(i,s){var k=Object.create(BasicSourceMapConsumer.prototype),E=k._names=w.fromArray(i._names.toArray(),!0),C=k._sources=w.fromArray(i._sources.toArray(),!0);k.sourceRoot=i._sourceRoot,k.sourcesContent=i._generateSourcesContent(k._sources.toArray(),k.sourceRoot),k.file=i._file,k._sourceMapURL=s,k._absoluteSources=k._sources.toArray().map(function(i){return S.computeSourceURL(k.sourceRoot,i,s)});for(var _=i._mappings.toArray().slice(),O=k.__generatedMappings=[],N=k.__originalMappings=[],D=0,q=_.length;D<q;D++){var j=_[D],R=new Mapping;R.generatedLine=j.generatedLine,R.generatedColumn=j.generatedColumn,j.source&&(R.source=C.indexOf(j.source),R.originalLine=j.originalLine,R.originalColumn=j.originalColumn,j.name&&(R.name=E.indexOf(j.name)),N.push(R)),O.push(R)}return T(k.__originalMappings,S.compareByOriginalPositions),k},BasicSourceMapConsumer.prototype._version=3,Object.defineProperty(BasicSourceMapConsumer.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),BasicSourceMapConsumer.prototype._parseMappings=function(i,s){for(var k,E,w,_,O,N=1,D=0,q=0,j=0,R=0,B=0,V=i.length,F=0,U={},$={},J=[],G=[];F<V;)if(";"===i.charAt(F))N++,F++,D=0;else if(","===i.charAt(F))F++;else{for((k=new Mapping).generatedLine=N,_=F;_<V&&!this._charIsMappingSeparator(i,_);_++);if(w=U[E=i.slice(F,_)])F+=E.length;else{for(w=[];F<_;)C.decode(i,F,$),O=$.value,F=$.rest,w.push(O);if(2===w.length)throw Error("Found a source, but no line and column");if(3===w.length)throw Error("Found a source and line, but no column");U[E]=w}k.generatedColumn=D+w[0],D=k.generatedColumn,w.length>1&&(k.source=R+w[1],R+=w[1],k.originalLine=q+w[2],q=k.originalLine,k.originalLine+=1,k.originalColumn=j+w[3],j=k.originalColumn,w.length>4&&(k.name=B+w[4],B+=w[4])),G.push(k),"number"==typeof k.originalLine&&J.push(k)}T(G,S.compareByGeneratedPositionsDeflated),this.__generatedMappings=G,T(J,S.compareByOriginalPositions),this.__originalMappings=J},BasicSourceMapConsumer.prototype._findMapping=function(i,s,k,S,w,C){if(i[k]<=0)throw TypeError("Line must be greater than or equal to 1, got "+i[k]);if(i[S]<0)throw TypeError("Column must be greater than or equal to 0, got "+i[S]);return E.search(i,s,w,C)},BasicSourceMapConsumer.prototype.computeColumnSpans=function(){for(var i=0;i<this._generatedMappings.length;++i){var s=this._generatedMappings[i];if(i+1<this._generatedMappings.length){var k=this._generatedMappings[i+1];if(s.generatedLine===k.generatedLine){s.lastGeneratedColumn=k.generatedColumn-1;continue}}s.lastGeneratedColumn=1/0}},BasicSourceMapConsumer.prototype.originalPositionFor=function(i){var s={generatedLine:S.getArg(i,"line"),generatedColumn:S.getArg(i,"column")},k=this._findMapping(s,this._generatedMappings,"generatedLine","generatedColumn",S.compareByGeneratedPositionsDeflated,S.getArg(i,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(k>=0){var E=this._generatedMappings[k];if(E.generatedLine===s.generatedLine){var w=S.getArg(E,"source",null);null!==w&&(w=this._sources.at(w),w=S.computeSourceURL(this.sourceRoot,w,this._sourceMapURL));var C=S.getArg(E,"name",null);return null!==C&&(C=this._names.at(C)),{source:w,line:S.getArg(E,"originalLine",null),column:S.getArg(E,"originalColumn",null),name:C}}}return{source:null,line:null,column:null,name:null}},BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(i){return null==i})},BasicSourceMapConsumer.prototype.sourceContentFor=function(i,s){if(!this.sourcesContent)return null;var k,E=this._findSourceIndex(i);if(E>=0)return this.sourcesContent[E];var w=i;if(null!=this.sourceRoot&&(w=S.relative(this.sourceRoot,w)),null!=this.sourceRoot&&(k=S.urlParse(this.sourceRoot))){var C=w.replace(/^file:\/\//,"");if("file"==k.scheme&&this._sources.has(C))return this.sourcesContent[this._sources.indexOf(C)];if((!k.path||"/"==k.path)&&this._sources.has("/"+w))return this.sourcesContent[this._sources.indexOf("/"+w)]}if(s)return null;throw Error('"'+w+'" is not in the SourceMap.')},BasicSourceMapConsumer.prototype.generatedPositionFor=function(i){var s=S.getArg(i,"source");if((s=this._findSourceIndex(s))<0)return{line:null,column:null,lastColumn:null};var k={source:s,originalLine:S.getArg(i,"line"),originalColumn:S.getArg(i,"column")},E=this._findMapping(k,this._originalMappings,"originalLine","originalColumn",S.compareByOriginalPositions,S.getArg(i,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(E>=0){var w=this._originalMappings[E];if(w.source===k.source)return{line:S.getArg(w,"generatedLine",null),column:S.getArg(w,"generatedColumn",null),lastColumn:S.getArg(w,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},IndexedSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype),IndexedSourceMapConsumer.prototype.constructor=SourceMapConsumer,IndexedSourceMapConsumer.prototype._version=3,Object.defineProperty(IndexedSourceMapConsumer.prototype,"sources",{get:function(){for(var i=[],s=0;s<this._sections.length;s++)for(var k=0;k<this._sections[s].consumer.sources.length;k++)i.push(this._sections[s].consumer.sources[k]);return i}}),IndexedSourceMapConsumer.prototype.originalPositionFor=function(i){var s={generatedLine:S.getArg(i,"line"),generatedColumn:S.getArg(i,"column")},k=E.search(s,this._sections,function(i,s){var k=i.generatedLine-s.generatedOffset.generatedLine;return k||i.generatedColumn-s.generatedOffset.generatedColumn}),w=this._sections[k];return w?w.consumer.originalPositionFor({line:s.generatedLine-(w.generatedOffset.generatedLine-1),column:s.generatedColumn-(w.generatedOffset.generatedLine===s.generatedLine?w.generatedOffset.generatedColumn-1:0),bias:i.bias}):{source:null,line:null,column:null,name:null}},IndexedSourceMapConsumer.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(i){return i.consumer.hasContentsOfAllSources()})},IndexedSourceMapConsumer.prototype.sourceContentFor=function(i,s){for(var k=0;k<this._sections.length;k++){var S=this._sections[k].consumer.sourceContentFor(i,!0);if(S)return S}if(s)return null;throw Error('"'+i+'" is not in the SourceMap.')},IndexedSourceMapConsumer.prototype.generatedPositionFor=function(i){for(var s=0;s<this._sections.length;s++){var k=this._sections[s];if(-1!==k.consumer._findSourceIndex(S.getArg(i,"source"))){var E=k.consumer.generatedPositionFor(i);if(E)return{line:E.line+(k.generatedOffset.generatedLine-1),column:E.column+(k.generatedOffset.generatedLine===E.line?k.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},IndexedSourceMapConsumer.prototype._parseMappings=function(i,s){this.__generatedMappings=[],this.__originalMappings=[];for(var k=0;k<this._sections.length;k++)for(var E=this._sections[k],w=E.consumer._generatedMappings,C=0;C<w.length;C++){var _=w[C],O=E.consumer._sources.at(_.source);O=S.computeSourceURL(E.consumer.sourceRoot,O,this._sourceMapURL),this._sources.add(O),O=this._sources.indexOf(O);var N=null;_.name&&(N=E.consumer._names.at(_.name),this._names.add(N),N=this._names.indexOf(N));var D={source:O,generatedLine:_.generatedLine+(E.generatedOffset.generatedLine-1),generatedColumn:_.generatedColumn+(E.generatedOffset.generatedLine===_.generatedLine?E.generatedOffset.generatedColumn-1:0),originalLine:_.originalLine,originalColumn:_.originalColumn,name:N};this.__generatedMappings.push(D),"number"==typeof D.originalLine&&this.__originalMappings.push(D)}T(this.__generatedMappings,S.compareByGeneratedPositionsDeflated),T(this.__originalMappings,S.compareByOriginalPositions)}},"./@apm-js-collab/code-transformer/node_modules/source-map/lib/source-map-generator.js"(i,s,k){var S=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/base64-vlq.js"),E=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/util.js"),w=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/array-set.js").ArraySet,C=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/mapping-list.js").MappingList;function SourceMapGenerator(i){i||(i={}),this._file=E.getArg(i,"file",null),this._sourceRoot=E.getArg(i,"sourceRoot",null),this._skipValidation=E.getArg(i,"skipValidation",!1),this._sources=new w,this._names=new w,this._mappings=new C,this._sourcesContents=null}SourceMapGenerator.prototype._version=3,SourceMapGenerator.fromSourceMap=function(i){var s=i.sourceRoot,k=new SourceMapGenerator({file:i.file,sourceRoot:s});return i.eachMapping(function(i){var S={generated:{line:i.generatedLine,column:i.generatedColumn}};null!=i.source&&(S.source=i.source,null!=s&&(S.source=E.relative(s,S.source)),S.original={line:i.originalLine,column:i.originalColumn},null!=i.name&&(S.name=i.name)),k.addMapping(S)}),i.sources.forEach(function(S){var w=S;null!==s&&(w=E.relative(s,S)),k._sources.has(w)||k._sources.add(w);var C=i.sourceContentFor(S);null!=C&&k.setSourceContent(S,C)}),k},SourceMapGenerator.prototype.addMapping=function(i){var s=E.getArg(i,"generated"),k=E.getArg(i,"original",null),S=E.getArg(i,"source",null),w=E.getArg(i,"name",null);this._skipValidation||this._validateMapping(s,k,S,w),null!=S&&(S=String(S),this._sources.has(S)||this._sources.add(S)),null!=w&&(w=String(w),this._names.has(w)||this._names.add(w)),this._mappings.add({generatedLine:s.line,generatedColumn:s.column,originalLine:null!=k&&k.line,originalColumn:null!=k&&k.column,source:S,name:w})},SourceMapGenerator.prototype.setSourceContent=function(i,s){var k=i;null!=this._sourceRoot&&(k=E.relative(this._sourceRoot,k)),null!=s?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[E.toSetString(k)]=s):this._sourcesContents&&(delete this._sourcesContents[E.toSetString(k)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},SourceMapGenerator.prototype.applySourceMap=function(i,s,k){var S=s;if(null==s){if(null==i.file)throw Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');S=i.file}var C=this._sourceRoot;null!=C&&(S=E.relative(C,S));var T=new w,_=new w;this._mappings.unsortedForEach(function(s){if(s.source===S&&null!=s.originalLine){var w=i.originalPositionFor({line:s.originalLine,column:s.originalColumn});null!=w.source&&(s.source=w.source,null!=k&&(s.source=E.join(k,s.source)),null!=C&&(s.source=E.relative(C,s.source)),s.originalLine=w.line,s.originalColumn=w.column,null!=w.name&&(s.name=w.name))}var O=s.source;null==O||T.has(O)||T.add(O);var N=s.name;null==N||_.has(N)||_.add(N)},this),this._sources=T,this._names=_,i.sources.forEach(function(s){var S=i.sourceContentFor(s);null!=S&&(null!=k&&(s=E.join(k,s)),null!=C&&(s=E.relative(C,s)),this.setSourceContent(s,S))},this)},SourceMapGenerator.prototype._validateMapping=function(i,s,k,S){if(s&&"number"!=typeof s.line&&"number"!=typeof s.column)throw Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!i||!("line"in i)||!("column"in i)||!(i.line>0)||!(i.column>=0)||s||k||S){if(!i||!("line"in i)||!("column"in i)||!s||!("line"in s)||!("column"in s)||!(i.line>0)||!(i.column>=0)||!(s.line>0)||!(s.column>=0)||!k)throw Error("Invalid mapping: "+JSON.stringify({generated:i,source:k,original:s,name:S}))}},SourceMapGenerator.prototype._serializeMappings=function(){for(var i,s,k,w,C=0,T=1,_=0,O=0,N=0,D=0,q="",j=this._mappings.toArray(),R=0,B=j.length;R<B;R++){if(s=j[R],i="",s.generatedLine!==T)for(C=0;s.generatedLine!==T;)i+=";",T++;else if(R>0){if(!E.compareByGeneratedPositionsInflated(s,j[R-1]))continue;i+=","}i+=S.encode(s.generatedColumn-C),C=s.generatedColumn,null!=s.source&&(w=this._sources.indexOf(s.source),i+=S.encode(w-D),D=w,i+=S.encode(s.originalLine-1-O),O=s.originalLine-1,i+=S.encode(s.originalColumn-_),_=s.originalColumn,null!=s.name&&(k=this._names.indexOf(s.name),i+=S.encode(k-N),N=k)),q+=i}return q},SourceMapGenerator.prototype._generateSourcesContent=function(i,s){return i.map(function(i){if(!this._sourcesContents)return null;null!=s&&(i=E.relative(s,i));var k=E.toSetString(i);return Object.prototype.hasOwnProperty.call(this._sourcesContents,k)?this._sourcesContents[k]:null},this)},SourceMapGenerator.prototype.toJSON=function(){var i={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(i.file=this._file),null!=this._sourceRoot&&(i.sourceRoot=this._sourceRoot),this._sourcesContents&&(i.sourcesContent=this._generateSourcesContent(i.sources,i.sourceRoot)),i},SourceMapGenerator.prototype.toString=function(){return JSON.stringify(this.toJSON())},s.SourceMapGenerator=SourceMapGenerator},"./@apm-js-collab/code-transformer/node_modules/source-map/lib/source-node.js"(i,s,k){var S=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator,E=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/util.js"),w=/(\r?\n)/,C="$$$isSourceNode$$$";function SourceNode(i,s,k,S,E){this.children=[],this.sourceContents={},this.line=null==i?null:i,this.column=null==s?null:s,this.source=null==k?null:k,this.name=null==E?null:E,this[C]=!0,null!=S&&this.add(S)}SourceNode.fromStringWithSourceMap=function(i,s,k){var S=new SourceNode,C=i.split(w),T=0,shiftNextLine=function(){return getNextLine()+(getNextLine()||"");function getNextLine(){return T<C.length?C[T++]:void 0}},_=1,O=0,N=null;return s.eachMapping(function(i){if(null!==N)if(_<i.generatedLine)addMappingWithCode(N,shiftNextLine()),_++,O=0;else{var s=C[T]||"",k=s.substr(0,i.generatedColumn-O);C[T]=s.substr(i.generatedColumn-O),O=i.generatedColumn,addMappingWithCode(N,k),N=i;return}for(;_<i.generatedLine;)S.add(shiftNextLine()),_++;if(O<i.generatedColumn){var s=C[T]||"";S.add(s.substr(0,i.generatedColumn)),C[T]=s.substr(i.generatedColumn),O=i.generatedColumn}N=i},this),T<C.length&&(N&&addMappingWithCode(N,shiftNextLine()),S.add(C.splice(T).join(""))),s.sources.forEach(function(i){var w=s.sourceContentFor(i);null!=w&&(null!=k&&(i=E.join(k,i)),S.setSourceContent(i,w))}),S;function addMappingWithCode(i,s){if(null===i||void 0===i.source)S.add(s);else{var w=k?E.join(k,i.source):i.source;S.add(new SourceNode(i.originalLine,i.originalColumn,w,s,i.name))}}},SourceNode.prototype.add=function(i){if(Array.isArray(i))i.forEach(function(i){this.add(i)},this);else if(i[C]||"string"==typeof i)i&&this.children.push(i);else throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+i);return this},SourceNode.prototype.prepend=function(i){if(Array.isArray(i))for(var s=i.length-1;s>=0;s--)this.prepend(i[s]);else if(i[C]||"string"==typeof i)this.children.unshift(i);else throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+i);return this},SourceNode.prototype.walk=function(i){for(var s,k=0,S=this.children.length;k<S;k++)(s=this.children[k])[C]?s.walk(i):""!==s&&i(s,{source:this.source,line:this.line,column:this.column,name:this.name})},SourceNode.prototype.join=function(i){var s,k,S=this.children.length;if(S>0){for(k=0,s=[];k<S-1;k++)s.push(this.children[k]),s.push(i);s.push(this.children[k]),this.children=s}return this},SourceNode.prototype.replaceRight=function(i,s){var k=this.children[this.children.length-1];return k[C]?k.replaceRight(i,s):"string"==typeof k?this.children[this.children.length-1]=k.replace(i,s):this.children.push("".replace(i,s)),this},SourceNode.prototype.setSourceContent=function(i,s){this.sourceContents[E.toSetString(i)]=s},SourceNode.prototype.walkSourceContents=function(i){for(var s=0,k=this.children.length;s<k;s++)this.children[s][C]&&this.children[s].walkSourceContents(i);for(var S=Object.keys(this.sourceContents),s=0,k=S.length;s<k;s++)i(E.fromSetString(S[s]),this.sourceContents[S[s]])},SourceNode.prototype.toString=function(){var i="";return this.walk(function(s){i+=s}),i},SourceNode.prototype.toStringWithSourceMap=function(i){var s={code:"",line:1,column:0},k=new S(i),E=!1,w=null,C=null,T=null,_=null;return this.walk(function(i,S){s.code+=i,null!==S.source&&null!==S.line&&null!==S.column?((w!==S.source||C!==S.line||T!==S.column||_!==S.name)&&k.addMapping({source:S.source,original:{line:S.line,column:S.column},generated:{line:s.line,column:s.column},name:S.name}),w=S.source,C=S.line,T=S.column,_=S.name,E=!0):E&&(k.addMapping({generated:{line:s.line,column:s.column}}),w=null,E=!1);for(var O=0,N=i.length;O<N;O++)10===i.charCodeAt(O)?(s.line++,s.column=0,O+1===N?(w=null,E=!1):E&&k.addMapping({source:S.source,original:{line:S.line,column:S.column},generated:{line:s.line,column:s.column},name:S.name})):s.column++}),this.walkSourceContents(function(i,s){k.setSourceContent(i,s)}),{code:s.code,map:k}}},"./@apm-js-collab/code-transformer/node_modules/source-map/lib/util.js"(i,s){s.getArg=function(i,s,k){if(s in i)return i[s];if(3==arguments.length)return k;throw Error('"'+s+'" is a required argument.')};var k=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,S=/^data:.+\,.+$/;function urlParse(i){var s=i.match(k);return s?{scheme:s[1],auth:s[2],host:s[3],port:s[4],path:s[5]}:null}function urlGenerate(i){var s="";return i.scheme&&(s+=i.scheme+":"),s+="//",i.auth&&(s+=i.auth+"@"),i.host&&(s+=i.host),i.port&&(s+=":"+i.port),i.path&&(s+=i.path),s}function normalize(i){var k=i,S=urlParse(i);if(S){if(!S.path)return i;k=S.path}for(var E,w=s.isAbsolute(k),C=k.split(/\/+/),T=0,_=C.length-1;_>=0;_--)"."===(E=C[_])?C.splice(_,1):".."===E?T++:T>0&&(""===E?(C.splice(_+1,T),T=0):(C.splice(_,2),T--));return(""===(k=C.join("/"))&&(k=w?"/":"."),S)?(S.path=k,urlGenerate(S)):k}function join(i,s){""===i&&(i="."),""===s&&(s=".");var k=urlParse(s),E=urlParse(i);if(E&&(i=E.path||"/"),k&&!k.scheme)return E&&(k.scheme=E.scheme),urlGenerate(k);if(k||s.match(S))return s;if(E&&!E.host&&!E.path)return E.host=s,urlGenerate(E);var w="/"===s.charAt(0)?s:normalize(i.replace(/\/+$/,"")+"/"+s);return E?(E.path=w,urlGenerate(E)):w}s.urlParse=urlParse,s.urlGenerate=urlGenerate,s.normalize=normalize,s.join=join,s.isAbsolute=function(i){return"/"===i.charAt(0)||k.test(i)},s.relative=function(i,s){""===i&&(i="."),i=i.replace(/\/$/,"");for(var k=0;0!==s.indexOf(i+"/");){var S=i.lastIndexOf("/");if(S<0||(i=i.slice(0,S)).match(/^([^\/]+:\/)?\/*$/))return s;++k}return Array(k+1).join("../")+s.substr(i.length+1)};var E=!("__proto__"in Object.create(null));function identity(i){return i}function toSetString(i){return isProtoString(i)?"$"+i:i}function fromSetString(i){return isProtoString(i)?i.slice(1):i}function isProtoString(i){if(!i)return!1;var s=i.length;if(s<9||95!==i.charCodeAt(s-1)||95!==i.charCodeAt(s-2)||111!==i.charCodeAt(s-3)||116!==i.charCodeAt(s-4)||111!==i.charCodeAt(s-5)||114!==i.charCodeAt(s-6)||112!==i.charCodeAt(s-7)||95!==i.charCodeAt(s-8)||95!==i.charCodeAt(s-9))return!1;for(var k=s-10;k>=0;k--)if(36!==i.charCodeAt(k))return!1;return!0}function strcmp(i,s){return i===s?0:null===i?1:null===s?-1:i>s?1:-1}s.toSetString=E?identity:toSetString,s.fromSetString=E?identity:fromSetString,s.compareByOriginalPositions=function(i,s,k){var S=strcmp(i.source,s.source);return 0!==S||0!=(S=i.originalLine-s.originalLine)||0!=(S=i.originalColumn-s.originalColumn)||k||0!=(S=i.generatedColumn-s.generatedColumn)||0!=(S=i.generatedLine-s.generatedLine)?S:strcmp(i.name,s.name)},s.compareByGeneratedPositionsDeflated=function(i,s,k){var S=i.generatedLine-s.generatedLine;return 0!==S||0!=(S=i.generatedColumn-s.generatedColumn)||k||0!==(S=strcmp(i.source,s.source))||0!=(S=i.originalLine-s.originalLine)||0!=(S=i.originalColumn-s.originalColumn)?S:strcmp(i.name,s.name)},s.compareByGeneratedPositionsInflated=function(i,s){var k=i.generatedLine-s.generatedLine;return 0!==k||0!=(k=i.generatedColumn-s.generatedColumn)||0!==(k=strcmp(i.source,s.source))||0!=(k=i.originalLine-s.originalLine)||0!=(k=i.originalColumn-s.originalColumn)?k:strcmp(i.name,s.name)},s.parseSourceMapInput=function(i){return JSON.parse(i.replace(/^\)]}'[^\n]*\n/,""))},s.computeSourceURL=function(i,s,k){if(s=s||"",i&&("/"!==i[i.length-1]&&"/"!==s[0]&&(i+="/"),s=i+s),k){var S=urlParse(k);if(!S)throw Error("sourceMapURL could not be parsed");if(S.path){var E=S.path.lastIndexOf("/");E>=0&&(S.path=S.path.substring(0,E+1))}s=join(urlGenerate(S),s)}return normalize(s)}},"./@apm-js-collab/code-transformer/node_modules/source-map/source-map.js"(i,s,k){s.SourceMapGenerator=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator,s.SourceMapConsumer=k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/source-map-consumer.js").SourceMapConsumer,k("./@apm-js-collab/code-transformer/node_modules/source-map/lib/source-node.js")},"./astring/dist/astring.js"(i,s){"use strict";function _classCallCheck(i,s){if(!(i instanceof s))throw TypeError("Cannot call a class as a function")}function _defineProperties(i,s){for(var k=0;k<s.length;k++){var S=s[k];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(i,S.key,S)}}function _createClass(i,s,k){return s&&_defineProperties(i.prototype,s),k&&_defineProperties(i,k),i}Object.defineProperty(s,"__esModule",{value:!0}),s.generate=generate,s.baseGenerator=s.GENERATOR=s.EXPRESSIONS_PRECEDENCE=s.NEEDS_PARENTHESES=void 0;var k,S,E,w,C,T,_=JSON.stringify;if(!String.prototype.repeat)throw Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!String.prototype.endsWith)throw Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");var O={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13};s.NEEDS_PARENTHESES=17;var N={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:17,ClassExpression:17,FunctionExpression:17,ObjectExpression:17,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function formatSequence(i,s){var k=i.generator;if(i.write("("),null!=s&&s.length>0){k[s[0].type](s[0],i);for(var S=s.length,E=1;E<S;E++){var w=s[E];i.write(", "),k[w.type](w,i)}}i.write(")")}function expressionNeedsParenthesis(i,s,k,S){var E=i.expressionsPrecedence[s.type];if(17===E)return!0;var w=i.expressionsPrecedence[k.type];return E!==w?!S&&15===E&&14===w&&"**"===k.operator||E<w:(13===E||14===E)&&("**"===s.operator&&"**"===k.operator?!S:13===E&&13===w&&("??"===s.operator||"??"===k.operator)||(S?O[s.operator]<=O[k.operator]:O[s.operator]<O[k.operator]))}function formatExpression(i,s,k,S){var E=i.generator;expressionNeedsParenthesis(i,s,k,S)?(i.write("("),E[s.type](s,i),i.write(")")):E[s.type](s,i)}function reindent(i,s,k,S){var E=s.split("\n"),w=E.length-1;if(i.write(E[0].trim()),w>0){i.write(S);for(var C=1;C<w;C++)i.write(k+E[C].trim()+S);i.write(k+E[w].trim())}}function formatComments(i,s,k,S){for(var E=s.length,w=0;w<E;w++){var C=s[w];i.write(k),"L"===C.type[0]?i.write("// "+C.value.trim()+"\n",C):(i.write("/*"),reindent(i,C.value,k,S),i.write("*/"+S))}}function hasCallExpression(i){for(var s=i;null!=s;){var k=s.type;if("C"===k[0]&&"a"===k[1])return!0;if("M"!==k[0]||"e"!==k[1]||"m"!==k[2])return!1;s=s.object}}function formatVariableDeclaration(i,s){var k=i.generator,S=s.declarations;i.write(s.kind+" ");var E=S.length;if(E>0){k.VariableDeclarator(S[0],i);for(var w=1;w<E;w++)i.write(", "),k.VariableDeclarator(S[w],i)}}s.EXPRESSIONS_PRECEDENCE=N;var D={Program:function(i,s){var k=s.indent.repeat(s.indentLevel),S=s.lineEnd,E=s.writeComments;E&&null!=i.comments&&formatComments(s,i.comments,k,S);for(var w=i.body,C=w.length,T=0;T<C;T++){var _=w[T];E&&null!=_.comments&&formatComments(s,_.comments,k,S),s.write(k),this[_.type](_,s),s.write(S)}E&&null!=i.trailingComments&&formatComments(s,i.trailingComments,k,S)},BlockStatement:T=function(i,s){var k=s.indent.repeat(s.indentLevel++),S=s.lineEnd,E=s.writeComments,w=k+s.indent;s.write("{");var C=i.body;if(null!=C&&C.length>0){s.write(S),E&&null!=i.comments&&formatComments(s,i.comments,w,S);for(var T=C.length,_=0;_<T;_++){var O=C[_];E&&null!=O.comments&&formatComments(s,O.comments,w,S),s.write(w),this[O.type](O,s),s.write(S)}s.write(k)}else E&&null!=i.comments&&(s.write(S),formatComments(s,i.comments,w,S),s.write(k));E&&null!=i.trailingComments&&formatComments(s,i.trailingComments,w,S),s.write("}"),s.indentLevel--},ClassBody:T,StaticBlock:function(i,s){s.write("static "),this.BlockStatement(i,s)},EmptyStatement:function(i,s){s.write(";")},ExpressionStatement:function(i,s){var k=s.expressionsPrecedence[i.expression.type];17===k||3===k&&"O"===i.expression.left.type[0]?(s.write("("),this[i.expression.type](i.expression,s),s.write(")")):this[i.expression.type](i.expression,s),s.write(";")},IfStatement:function(i,s){s.write("if ("),this[i.test.type](i.test,s),s.write(") "),this[i.consequent.type](i.consequent,s),null!=i.alternate&&(s.write(" else "),this[i.alternate.type](i.alternate,s))},LabeledStatement:function(i,s){this[i.label.type](i.label,s),s.write(": "),this[i.body.type](i.body,s)},BreakStatement:function(i,s){s.write("break"),null!=i.label&&(s.write(" "),this[i.label.type](i.label,s)),s.write(";")},ContinueStatement:function(i,s){s.write("continue"),null!=i.label&&(s.write(" "),this[i.label.type](i.label,s)),s.write(";")},WithStatement:function(i,s){s.write("with ("),this[i.object.type](i.object,s),s.write(") "),this[i.body.type](i.body,s)},SwitchStatement:function(i,s){var k=s.indent.repeat(s.indentLevel++),S=s.lineEnd,E=s.writeComments;s.indentLevel++;var w=k+s.indent,C=w+s.indent;s.write("switch ("),this[i.discriminant.type](i.discriminant,s),s.write(") {"+S);for(var T=i.cases,_=T.length,O=0;O<_;O++){var N=T[O];E&&null!=N.comments&&formatComments(s,N.comments,w,S),N.test?(s.write(w+"case "),this[N.test.type](N.test,s),s.write(":"+S)):s.write(w+"default:"+S);for(var D=N.consequent,q=D.length,j=0;j<q;j++){var R=D[j];E&&null!=R.comments&&formatComments(s,R.comments,C,S),s.write(C),this[R.type](R,s),s.write(S)}}s.indentLevel-=2,s.write(k+"}")},ReturnStatement:function(i,s){s.write("return"),i.argument&&(s.write(" "),this[i.argument.type](i.argument,s)),s.write(";")},ThrowStatement:function(i,s){s.write("throw "),this[i.argument.type](i.argument,s),s.write(";")},TryStatement:function(i,s){if(s.write("try "),this[i.block.type](i.block,s),i.handler){var k=i.handler;null==k.param?s.write(" catch "):(s.write(" catch ("),this[k.param.type](k.param,s),s.write(") ")),this[k.body.type](k.body,s)}i.finalizer&&(s.write(" finally "),this[i.finalizer.type](i.finalizer,s))},WhileStatement:function(i,s){s.write("while ("),this[i.test.type](i.test,s),s.write(") "),this[i.body.type](i.body,s)},DoWhileStatement:function(i,s){s.write("do "),this[i.body.type](i.body,s),s.write(" while ("),this[i.test.type](i.test,s),s.write(");")},ForStatement:function(i,s){if(s.write("for ("),null!=i.init){var k=i.init;"V"===k.type[0]?formatVariableDeclaration(s,k):this[k.type](k,s)}s.write(";