var Common;!function(e){!function(e){"use strict";class r{static calculateMappings(a){var t=[];if(!a||3!==a.version||!a.mappings||"string"!=typeof a.mappings||!a.sources||0===a.sources.length)return null;var n=a.sources.length,i=new e.SourcemapMapping,c=0,o=a.mappings;if(0===o.length){var s=new e.SourcemapMapping;t.push(s)}for(var l=0,m=0,u=o.length;m<u;)if(o.charAt(m)===r.ScopeOrLineDelimiter){c++;m++;i.generatedColumn=0}else if(o.charAt(m)===r.SegmentDelimiter)m++;else{(s=new e.SourcemapMapping).generatedLine=c;var p=e.Base64VLQFormat.decode(o,m);s.generatedColumn=i.generatedColumn+p.value;i.generatedColumn=s.generatedColumn;if((m+=p.charsRead)<u&&o.charAt(m)!==r.ScopeOrLineDelimiter&&o.charAt(m)!==r.SegmentDelimiter){if((l+=(p=e.Base64VLQFormat.decode(o,m)).value)>n)return null;m+=p.charsRead}s.file=l;if(m<u&&o.charAt(m)!==r.ScopeOrLineDelimiter&&o.charAt(m)!==r.SegmentDelimiter){p=e.Base64VLQFormat.decode(o,m);s.sourceLine=p.value+i.sourceLine;i.sourceLine=s.sourceLine;m+=p.charsRead}if(m<u&&o.charAt(m)!==r.ScopeOrLineDelimiter&&o.charAt(m)!==r.SegmentDelimiter){p=e.Base64VLQFormat.decode(o,m);s.sourceColumn=p.value+i.sourceColumn;i.sourceColumn=s.sourceColumn;m+=p.charsRead}m<u&&o.charAt(m)!==r.ScopeOrLineDelimiter&&o.charAt(m)!==r.SegmentDelimiter&&(m+=(p=e.Base64VLQFormat.decode(o,m)).charsRead);t.push(s)}return t}static calculateScopeSegments(a){if(a&&3===a.version&&"string"==typeof a.x_ms_scopes&&0!==a.x_ms_scopes.length){for(var t,n=a.x_ms_scopes,i=0,c=n.length,o=[],s=0,l=0;i<c;){var m=e.Base64VLQFormat.decode(n,i);if(!m)return;i+=m.charsRead;var u=e.Base64VLQFormat.decode(n,i);if(!u)return;i+=u.charsRead;var p=new e.SourceScopeSegment(s+m.value,l+u.value);s=p.line;l=p.column;var g=n.charAt(i++);if(g===r.StartScopeSegmentDelimiter){t=new e.SourceScope(p,t);o.push(t)}else{if(g!==r.EndScopeSegmentDelimiter)return;if(!t||!t.startSegment||t.endSegment)return;t.endSegment=p;t=t.parentScope}}if(!t)return o}}static calculateLocalsMapping(a,t){if(a&&3===a.version&&a.names&&0!==a.names.length&&"string"==typeof a.x_ms_locals&&0!==a.x_ms_scopes.length&&t&&0!==t.length)for(var n=a.names,i=a.x_ms_locals,c=(i.length,0),o=t[c],s=0,l=i.length,m=0;s<l;){var u=e.Base64VLQFormat.decode(i,s);if(!u)return;s+=u.charsRead;var p=e.Base64VLQFormat.decode(i,s);if(p){o.localsMap[n[m+=u.value]]=n[m+=p.value];s+=p.charsRead}else o.localsMap[n[m+=u.value]]=null;if(s>=l)break;var g=i.charAt(s++);if(g===r.ScopeOrLineDelimiter)o=t[++c];else if(g!==r.SegmentDelimiter)return}}static parseMapContent(e){var r=null;try{if(")]}'"===e.substr(0,4)){var a=e.indexOf("\n");a>=0&&(e=e.slice(a+1))}r=JSON.parse(e)}catch(e){}return r}}r.StartScopeSegmentDelimiter=">";r.EndScopeSegmentDelimiter="<";r.SegmentDelimiter=",";r.ScopeOrLineDelimiter=";";e.SourcemapParser=r}(e.FormatService||(e.FormatService={}))}(Common||(Common={}));
