source-map.min.js 19 KB

1
  1. function define(e,t,n){if(typeof e!="string")throw new TypeError("Expected string, got: "+e);arguments.length==2&&(n=t);if(e in define.modules)throw new Error("Module already defined: "+e);define.modules[e]=n}function Domain(){this.modules={},this._currentModule=null}define.modules={},function(){function e(e){var t=e.split("/"),n=1;while(n<t.length)t[n]===".."?t.splice(n-1,1):t[n]==="."?t.splice(n,1):n++;return t.join("/")}function t(e,t){return e=e.trim(),t=t.trim(),/^\//.test(t)?t:e.replace(/\/*$/,"/")+t}function n(e){var t=e.split("/");return t.pop(),t.join("/")}Domain.prototype.require=function(e,t){if(Array.isArray(e)){var n=e.map(function(e){return this.lookup(e)},this);return t&&t.apply(null,n),undefined}return this.lookup(e)},Domain.prototype.lookup=function(r){/^\./.test(r)&&(r=e(t(n(this._currentModule),r)));if(r in this.modules){var i=this.modules[r];return i}if(r in define.modules){var i=define.modules[r];if(typeof i=="function"){var s={},o=this._currentModule;this._currentModule=r,i(this.require.bind(this),s,{id:r,uri:""}),this._currentModule=o,i=s}return this.modules[r]=i,i}throw new Error("Module not defined: "+r)}}(),define.Domain=Domain,define.globalDomain=new Domain;var require=define.globalDomain.require.bind(define.globalDomain);define("source-map/source-map-generator",["require","exports","module","source-map/base64-vlq","source-map/util","source-map/array-set"],function(e,t,n){function o(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._sources=new s,this._names=new s,this._mappings=[],this._sourcesContents=null}var r=e("./base64-vlq"),i=e("./util"),s=e("./array-set").ArraySet;o.prototype._version=3,o.fromSourceMap=function(t){var n=t.sourceRoot,r=new o({file:t.file,sourceRoot:n});return t.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};e.source!=null&&(t.source=e.source,n!=null&&(t.source=i.relative(n,t.source)),t.original={line:e.originalLine,column:e.originalColumn},e.name!=null&&(t.name=e.name)),r.addMapping(t)}),t.sources.forEach(function(e){var n=t.sourceContentFor(e);n!=null&&r.setSourceContent(e,n)}),r},o.prototype.addMapping=function(t){var n=i.getArg(t,"generated"),r=i.getArg(t,"original",null),s=i.getArg(t,"source",null),o=i.getArg(t,"name",null);this._validateMapping(n,r,s,o),s!=null&&!this._sources.has(s)&&this._sources.add(s),o!=null&&!this._names.has(o)&&this._names.add(o),this._mappings.push({generatedLine:n.line,generatedColumn:n.column,originalLine:r!=null&&r.line,originalColumn:r!=null&&r.column,source:s,name:o})},o.prototype.setSourceContent=function(t,n){var r=t;this._sourceRoot!=null&&(r=i.relative(this._sourceRoot,r)),n!=null?(this._sourcesContents||(this._sourcesContents={}),this._sourcesContents[i.toSetString(r)]=n):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},o.prototype.applySourceMap=function(t,n,r){var o=n;if(n==null){if(t.file==null)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');o=t.file}var u=this._sourceRoot;u!=null&&(o=i.relative(u,o));var a=new s,f=new s;this._mappings.forEach(function(e){if(e.source===o&&e.originalLine!=null){var n=t.originalPositionFor({line:e.originalLine,column:e.originalColumn});n.source!=null&&(e.source=n.source,r!=null&&(e.source=i.join(r,e.source)),u!=null&&(e.source=i.relative(u,e.source)),e.originalLine=n.line,e.originalColumn=n.column,n.name!=null&&(e.name=n.name))}var s=e.source;s!=null&&!a.has(s)&&a.add(s);var l=e.name;l!=null&&!f.has(l)&&f.add(l)},this),this._sources=a,this._names=f,t.sources.forEach(function(e){var n=t.sourceContentFor(e);n!=null&&(r!=null&&(e=i.join(r,e)),u!=null&&(e=i.relative(u,e)),this.setSourceContent(e,n))},this)},o.prototype._validateMapping=function(t,n,r,i){if(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!n&&!r&&!i)return;if(t&&"line"in t&&"column"in t&&n&&"line"in n&&"column"in n&&t.line>0&&t.column>=0&&n.line>0&&n.column>=0&&r)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:r,original:n,name:i}))},o.prototype._serializeMappings=function(){var t=0,n=1,s=0,o=0,u=0,a=0,f="",l;this._mappings.sort(i.compareByGeneratedPositions);for(var c=0,h=this._mappings.length;c<h;c++){l=this._mappings[c];if(l.generatedLine!==n){t=0;while(l.generatedLine!==n)f+=";",n++}else if(c>0){if(!i.compareByGeneratedPositions(l,this._mappings[c-1]))continue;f+=","}f+=r.encode(l.generatedColumn-t),t=l.generatedColumn,l.source!=null&&(f+=r.encode(this._sources.indexOf(l.source)-a),a=this._sources.indexOf(l.source),f+=r.encode(l.originalLine-1-o),o=l.originalLine-1,f+=r.encode(l.originalColumn-s),s=l.originalColumn,l.name!=null&&(f+=r.encode(this._names.indexOf(l.name)-u),u=this._names.indexOf(l.name)))}return f},o.prototype._generateSourcesContent=function(t,n){return t.map(function(e){if(!this._sourcesContents)return null;n!=null&&(e=i.relative(n,e));var t=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,t)?this._sourcesContents[t]:null},this)},o.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t},o.prototype.toString=function(){return JSON.stringify(this)},t.SourceMapGenerator=o}),define("source-map/base64-vlq",["require","exports","module","source-map/base64"],function(e,t,n){function a(e){return e<0?(-e<<1)+1:(e<<1)+0}function f(e){var t=(e&1)===1,n=e>>1;return t?-n:n}var r=e("./base64"),i=5,s=1<<i,o=s-1,u=s;t.encode=function(t){var n="",s,f=a(t);do s=f&o,f>>>=i,f>0&&(s|=u),n+=r.encode(s);while(f>0);return n},t.decode=function(t,n){var s=0,a=t.length,l=0,c=0,h,p;do{if(s>=a)throw new Error("Expected more digits in base 64 VLQ value.");p=r.decode(t.charAt(s++)),h=!!(p&u),p&=o,l+=p<<c,c+=i}while(h);n.value=f(l),n.rest=t.slice(s)}}),define("source-map/base64",["require","exports","module"],function(e,t,n){var r={},i={};"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").forEach(function(e,t){r[e]=t,i[t]=e}),t.encode=function(t){if(t in i)return i[t];throw new TypeError("Must be between 0 and 63: "+t)},t.decode=function(t){if(t in r)return r[t];throw new TypeError("Not a valid base 64 digit: "+t)}}),define("source-map/util",["require","exports","module"],function(e,t,n){function r(e,t,n){if(t in e)return e[t];if(arguments.length===3)return n;throw new Error('"'+t+'" is a required argument.')}function o(e){var t=e.match(i);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function u(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function a(e){var t=e,n=o(e);if(n){if(!n.path)return e;t=n.path}var r=t.charAt(0)==="/",i=t.split(/\/+/);for(var s,a=0,f=i.length-1;f>=0;f--)s=i[f],s==="."?i.splice(f,1):s===".."?a++:a>0&&(s===""?(i.splice(f+1,a),a=0):(i.splice(f,2),a--));return t=i.join("/"),t===""&&(t=r?"/":"."),n?(n.path=t,u(n)):t}function f(e,t){e===""&&(e="."),t===""&&(t=".");var n=o(t),r=o(e);r&&(e=r.path||"/");if(n&&!n.scheme)return r&&(n.scheme=r.scheme),u(n);if(n||t.match(s))return t;if(r&&!r.host&&!r.path)return r.host=t,u(r);var i=t.charAt(0)==="/"?t:a(e.replace(/\/+$/,"")+"/"+t);return r?(r.path=i,u(r)):i}function l(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");var n=o(e);return t.charAt(0)=="/"&&n&&n.path=="/"?t.slice(1):t.indexOf(e+"/")===0?t.substr(e.length+1):t}function c(e){return"$"+e}function h(e){return e.substr(1)}function p(e,t){var n=e||"",r=t||"";return(n>r)-(n<r)}function d(e,t,n){var r;return r=p(e.source,t.source),r?r:(r=e.originalLine-t.originalLine,r?r:(r=e.originalColumn-t.originalColumn,r||n?r:(r=p(e.name,t.name),r?r:(r=e.generatedLine-t.generatedLine,r?r:e.generatedColumn-t.generatedColumn))))}function v(e,t,n){var r;return r=e.generatedLine-t.generatedLine,r?r:(r=e.generatedColumn-t.generatedColumn,r||n?r:(r=p(e.source,t.source),r?r:(r=e.originalLine-t.originalLine,r?r:(r=e.originalColumn-t.originalColumn,r?r:p(e.name,t.name)))))}t.getArg=r;var i=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,s=/^data:.+\,.+$/;t.urlParse=o,t.urlGenerate=u,t.normalize=a,t.join=f,t.relative=l,t.toSetString=c,t.fromSetString=h,t.compareByOriginalPositions=d,t.compareByGeneratedPositions=v}),define("source-map/array-set",["require","exports","module","source-map/util"],function(e,t,n){function i(){this._array=[],this._set={}}var r=e("./util");i.fromArray=function(t,n){var r=new i;for(var s=0,o=t.length;s<o;s++)r.add(t[s],n);return r},i.prototype.add=function(t,n){var i=this.has(t),s=this._array.length;(!i||n)&&this._array.push(t),i||(this._set[r.toSetString(t)]=s)},i.prototype.has=function(t){return Object.prototype.hasOwnProperty.call(this._set,r.toSetString(t))},i.prototype.indexOf=function(t){if(this.has(t))return this._set[r.toSetString(t)];throw new Error('"'+t+'" is not in the set.')},i.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)},i.prototype.toArray=function(){return this._array.slice()},t.ArraySet=i}),define("source-map/source-map-consumer",["require","exports","module","source-map/util","source-map/binary-search","source-map/array-set","source-map/base64-vlq"],function(e,t,n){function u(e){var t=e;typeof e=="string"&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var n=r.getArg(t,"version"),i=r.getArg(t,"sources"),o=r.getArg(t,"names",[]),u=r.getArg(t,"sourceRoot",null),a=r.getArg(t,"sourcesContent",null),f=r.getArg(t,"mappings"),l=r.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);this._names=s.fromArray(o,!0),this._sources=s.fromArray(i,!0),this.sourceRoot=u,this.sourcesContent=a,this._mappings=f,this.file=l}var r=e("./util"),i=e("./binary-search"),s=e("./array-set").ArraySet,o=e("./base64-vlq");u.fromSourceMap=function(t){var n=Object.create(u.prototype);return n._names=s.fromArray(t._names.toArray(),!0),n._sources=s.fromArray(t._sources.toArray(),!0),n.sourceRoot=t._sourceRoot,n.sourcesContent=t._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=t._file,n.__generatedMappings=t._mappings.slice().sort(r.compareByGeneratedPositions),n.__originalMappings=t._mappings.slice().sort(r.compareByOriginalPositions),n},u.prototype._version=3,Object.defineProperty(u.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return this.sourceRoot!=null?r.join(this.sourceRoot,e):e},this)}}),u.prototype.__generatedMappings=null,Object.defineProperty(u.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||(this.__generatedMappings=[],this.__originalMappings=[],this._parseMappings(this._mappings,this.sourceRoot)),this.__generatedMappings}}),u.prototype.__originalMappings=null,Object.defineProperty(u.prototype,"_originalMappings",{get:function(){return this.__originalMappings||(this.__generatedMappings=[],this.__originalMappings=[],this._parseMappings(this._mappings,this.sourceRoot)),this.__originalMappings}}),u.prototype._nextCharIsMappingSeparator=function(t){var n=t.charAt(0);return n===";"||n===","},u.prototype._parseMappings=function(t,n){var i=1,s=0,u=0,a=0,f=0,l=0,c=t,h={},p;while(c.length>0)if(c.charAt(0)===";")i++,c=c.slice(1),s=0;else if(c.charAt(0)===",")c=c.slice(1);else{p={},p.generatedLine=i,o.decode(c,h),p.generatedColumn=s+h.value,s=p.generatedColumn,c=h.rest;if(c.length>0&&!this._nextCharIsMappingSeparator(c)){o.decode(c,h),p.source=this._sources.at(f+h.value),f+=h.value,c=h.rest;if(c.length===0||this._nextCharIsMappingSeparator(c))throw new Error("Found a source, but no line and column");o.decode(c,h),p.originalLine=u+h.value,u=p.originalLine,p.originalLine+=1,c=h.rest;if(c.length===0||this._nextCharIsMappingSeparator(c))throw new Error("Found a source and line, but no column");o.decode(c,h),p.originalColumn=a+h.value,a=p.originalColumn,c=h.rest,c.length>0&&!this._nextCharIsMappingSeparator(c)&&(o.decode(c,h),p.name=this._names.at(l+h.value),l+=h.value,c=h.rest)}this.__generatedMappings.push(p),typeof p.originalLine=="number"&&this.__originalMappings.push(p)}this.__generatedMappings.sort(r.compareByGeneratedPositions),this.__originalMappings.sort(r.compareByOriginalPositions)},u.prototype._findMapping=function(t,n,r,s,o){if(t[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[r]);if(t[s]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[s]);return i.search(t,n,o)},u.prototype.originalPositionFor=function(t){var n={generatedLine:r.getArg(t,"line"),generatedColumn:r.getArg(t,"column")},i=this._findMapping(n,this._generatedMappings,"generatedLine","generatedColumn",r.compareByGeneratedPositions);if(i&&i.generatedLine===n.generatedLine){var s=r.getArg(i,"source",null);return s!=null&&this.sourceRoot!=null&&(s=r.join(this.sourceRoot,s)),{source:s,line:r.getArg(i,"originalLine",null),column:r.getArg(i,"originalColumn",null),name:r.getArg(i,"name",null)}}return{source:null,line:null,column:null,name:null}},u.prototype.sourceContentFor=function(t){if(!this.sourcesContent)return null;this.sourceRoot!=null&&(t=r.relative(this.sourceRoot,t));if(this._sources.has(t))return this.sourcesContent[this._sources.indexOf(t)];var n;if(this.sourceRoot!=null&&(n=r.urlParse(this.sourceRoot))){var i=t.replace(/^file:\/\//,"");if(n.scheme=="file"&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!n.path||n.path=="/")&&this._sources.has("/"+t))return this.sourcesContent[this._sources.indexOf("/"+t)]}throw new Error('"'+t+'" is not in the SourceMap.')},u.prototype.generatedPositionFor=function(t){var n={source:r.getArg(t,"source"),originalLine:r.getArg(t,"line"),originalColumn:r.getArg(t,"column")};this.sourceRoot!=null&&(n.source=r.relative(this.sourceRoot,n.source));var i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions);return i?{line:r.getArg(i,"generatedLine",null),column:r.getArg(i,"generatedColumn",null)}:{line:null,column:null}},u.GENERATED_ORDER=1,u.ORIGINAL_ORDER=2,u.prototype.eachMapping=function(t,n,i){var s=n||null,o=i||u.GENERATED_ORDER,a;switch(o){case u.GENERATED_ORDER:a=this._generatedMappings;break;case u.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var f=this.sourceRoot;a.map(function(e){var t=e.source;return t!=null&&f!=null&&(t=r.join(f,t)),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:e.name}}).forEach(t,s)},t.SourceMapConsumer=u}),define("source-map/binary-search",["require","exports","module"],function(e,t,n){function r(e,t,n,i,s){var o=Math.floor((t-e)/2)+e,u=s(n,i[o],!0);return u===0?i[o]:u>0?t-o>1?r(o,t,n,i,s):i[o]:o-e>1?r(e,o,n,i,s):e<0?null:i[e]}t.search=function(t,n,i){return n.length>0?r(-1,n.length,t,n,i):null}}),define("source-map/source-node",["require","exports","module","source-map/source-map-generator","source-map/util"],function(e,t,n){function u(e,t,n,r,i){this.children=[],this.sourceContents={},this.line=e==null?null:e,this.column=t==null?null:t,this.source=n==null?null:n,this.name=i==null?null:i,r!=null&&this.add(r)}var r=e("./source-map-generator").SourceMapGenerator,i=e("./util"),s=/(\r?\n)/,o=/\r\n|[\s\S]/g;u.fromStringWithSourceMap=function(t,n,r){function p(e,t){if(e===null||e.source===undefined)o.add(t);else{var n=r?i.join(r,e.source):e.source;o.add(new u(e.originalLine,e.originalColumn,n,t,e.name))}}var o=new u,a=t.split(s),f=function(){var e=a.shift(),t=a.shift()||"";return e+t},l=1,c=0,h=null;return n.eachMapping(function(e){if(h!==null){if(!(l<e.generatedLine)){var n=a[0],t=n.substr(0,e.generatedColumn-c);a[0]=n.substr(e.generatedColumn-c),c=e.generatedColumn,p(h,t),h=e;return}var t="";p(h,f()),l++,c=0}while(l<e.generatedLine)o.add(f()),l++;if(c<e.generatedColumn){var n=a[0];o.add(n.substr(0,e.generatedColumn)),a[0]=n.substr(e.generatedColumn),c=e.generatedColumn}h=e},this),a.length>0&&(h&&p(h,f()),o.add(a.join(""))),n.sources.forEach(function(e){var t=n.sourceContentFor(e);t!=null&&(r!=null&&(e=i.join(r,e)),o.setSourceContent(e,t))}),o},u.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(e){this.add(e)},this);else{if(!(t instanceof u||typeof t=="string"))throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);t&&this.children.push(t)}return this},u.prototype.prepend=function(t){if(Array.isArray(t))for(var n=t.length-1;n>=0;n--)this.prepend(t[n]);else{if(!(t instanceof u||typeof t=="string"))throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);this.children.unshift(t)}return this},u.prototype.walk=function(t){var n;for(var r=0,i=this.children.length;r<i;r++)n=this.children[r],n instanceof u?n.walk(t):n!==""&&t(n,{source:this.source,line:this.line,column:this.column,name:this.name})},u.prototype.join=function(t){var n,r,i=this.children.length;if(i>0){n=[];for(r=0;r<i-1;r++)n.push(this.children[r]),n.push(t);n.push(this.children[r]),this.children=n}return this},u.prototype.replaceRight=function(t,n){var r=this.children[this.children.length-1];return r instanceof u?r.replaceRight(t,n):typeof r=="string"?this.children[this.children.length-1]=r.replace(t,n):this.children.push("".replace(t,n)),this},u.prototype.setSourceContent=function(t,n){this.sourceContents[i.toSetString(t)]=n},u.prototype.walkSourceContents=function(t){for(var n=0,r=this.children.length;n<r;n++)this.children[n]instanceof u&&this.children[n].walkSourceContents(t);var s=Object.keys(this.sourceContents);for(var n=0,r=s.length;n<r;n++)t(i.fromSetString(s[n]),this.sourceContents[s[n]])},u.prototype.toString=function(){var t="";return this.walk(function(e){t+=e}),t},u.prototype.toStringWithSourceMap=function(t){var n={code:"",line:1,column:0},i=new r(t),u=!1,a=null,f=null,l=null,c=null;return this.walk(function(e,t){n.code+=e,t.source!==null&&t.line!==null&&t.column!==null?((a!==t.source||f!==t.line||l!==t.column||c!==t.name)&&i.addMapping({source:t.source,original:{line:t.line,column:t.column},generated:{line:n.line,column:n.column},name:t.name}),a=t.source,f=t.line,l=t.column,c=t.name,u=!0):u&&(i.addMapping({generated:{line:n.line,column:n.column}}),a=null,u=!1),e.match(o).forEach(function(e,r,o){s.test(e)?(n.line++,n.column=0,r+1===o.length?(a=null,u=!1):u&&i.addMapping({source:t.source,original:{line:t.line,column:t.column},generated:{line:n.line,column:n.column},name:t.name})):n.column+=e.length})}),this.walkSourceContents(function(e,t){i.setSourceContent(e,t)}),{code:n.code,map:i}},t.SourceNode=u}),this.sourceMap={SourceMapConsumer:require("source-map/source-map-consumer").SourceMapConsumer,SourceMapGenerator:require("source-map/source-map-generator").SourceMapGenerator,SourceNode:require("source-map/source-node").SourceNode}