@king-one/monitor 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cdn/index.umd.js +3 -3
- package/dist/es/src/core.mjs +8 -4
- package/dist/es/src/integrations/BrowserError.mjs +10 -8
- package/dist/es/src/integrations/VueError.mjs +12 -5
- package/dist/lib/src/core.js +8 -4
- package/dist/lib/src/integrations/BrowserError.js +10 -8
- package/dist/lib/src/integrations/VueError.js +12 -5
- package/dist/types/src/core.d.ts +1 -0
- package/dist/types/src/types.d.ts +51 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/cdn/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(M,O){typeof exports=="object"&&typeof module<"u"?O(exports):typeof define=="function"&&define.amd?define(["exports"],O):(M=typeof globalThis<"u"?globalThis:M||self,O(M.KingMonitor={}))})(this,function(M){"use strict";var Ue=Object.defineProperty;var Ve=(M,O,V)=>O in M?Ue(M,O,{enumerable:!0,configurable:!0,writable:!0,value:V}):M[O]=V;var G=(M,O,V)=>Ve(M,typeof O!="symbol"?O+"":O,V);class O{constructor(){G(this,"events",new Map)}on(e,r){this.events.has(e)||this.events.set(e,new Set),this.events.get(e).add(r)}off(e,r){const n=this.events.get(e);n&&(n.delete(r),n.size===0&&this.events.delete(e))}emit(e,...r){const n=this.events.get(e);n&&n.forEach(t=>{try{t(...r)}catch(i){console.error(`Error in event handler for ${e}:`,i)}})}clear(){this.events.clear()}getSubscriberCount(e){const r=this.events.get(e);return r?r.size:0}hasSubscribers(e){return this.getSubscriberCount(e)>0}}var V=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pe(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function Qe(o){return o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function We(o){return o&&Object.prototype.hasOwnProperty.call(o,"default")&&Object.keys(o).length===1?o.default:o}function qe(o){if(o.__esModule)return o;var e=o.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(o).forEach(function(n){var t=Object.getOwnPropertyDescriptor(o,n);Object.defineProperty(r,n,t.get?t:{enumerable:!0,get:function(){return o[n]}})}),r}var ne={},te={},J={},oe={},ve="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Je=oe.encode=function(o){if(0<=o&&o<ve.length)return ve[o];throw new TypeError("Must be between 0 and 63: "+o)},Ke=oe.decode=function(o){var e=65,r=90,n=97,t=122,i=48,s=57,f=43,a=47,h=26,d=52;return e<=o&&o<=r?o-e:n<=o&&o<=t?o-n+h:i<=o&&o<=s?o-i+d:o==f?62:o==a?63:-1},me=oe,ie=5,_e=1<<ie,Se=_e-1,ye=_e;function Ie(o){return o<0?(-o<<1)+1:(o<<1)+0}function Re(o){var e=(o&1)===1,r=o>>1;return e?-r:r}var Xe=J.encode=function(e){var r="",n,t=Ie(e);do n=t&Se,t>>>=ie,t>0&&(n|=ye),r+=me.encode(n);while(t>0);return r},Ze=J.decode=function(e,r,n){var t=e.length,i=0,s=0,f,a;do{if(r>=t)throw new Error("Expected more digits in base 64 VLQ value.");if(a=me.decode(e.charCodeAt(r++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));f=!!(a&ye),a&=Se,i=i+(a<<s),s+=ie}while(f);n.value=Re(i),n.rest=r},F={};(function(o){function e(u,l,p){if(l in u)return u[l];if(arguments.length===3)return p;throw new Error('"'+l+'" is a required argument.')}o.getArg=e;var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,n=/^data:.+\,.+$/;function t(u){var l=u.match(r);return l?{scheme:l[1],auth:l[2],host:l[3],port:l[4],path:l[5]}:null}o.urlParse=t;function i(u){var l="";return u.scheme&&(l+=u.scheme+":"),l+="//",u.auth&&(l+=u.auth+"@"),u.host&&(l+=u.host),u.port&&(l+=":"+u.port),u.path&&(l+=u.path),l}o.urlGenerate=i;var s=32;function f(u){var l=[];return function(p){for(var c=0;c<l.length;c++)if(l[c].input===p){var P=l[0];return l[0]=l[c],l[c]=P,l[0].result}var T=u(p);return l.unshift({input:p,result:T}),l.length>s&&l.pop(),T}}var a=f(function(l){var p=l,c=t(l);if(c){if(!c.path)return l;p=c.path}for(var P=o.isAbsolute(p),T=[],ee=0,b=0;;)if(ee=b,b=p.indexOf("/",ee),b===-1){T.push(p.slice(ee));break}else for(T.push(p.slice(ee,b));b<p.length&&p[b]==="/";)b++;for(var re,q=0,b=T.length-1;b>=0;b--)re=T[b],re==="."?T.splice(b,1):re===".."?q++:q>0&&(re===""?(T.splice(b+1,q),q=0):(T.splice(b,2),q--));return p=T.join("/"),p===""&&(p=P?"/":"."),c?(c.path=p,i(c)):p});o.normalize=a;function h(u,l){u===""&&(u="."),l===""&&(l=".");var p=t(l),c=t(u);if(c&&(u=c.path||"/"),p&&!p.scheme)return c&&(p.scheme=c.scheme),i(p);if(p||l.match(n))return l;if(c&&!c.host&&!c.path)return c.host=l,i(c);var P=l.charAt(0)==="/"?l:a(u.replace(/\/+$/,"")+"/"+l);return c?(c.path=P,i(c)):P}o.join=h,o.isAbsolute=function(u){return u.charAt(0)==="/"||r.test(u)};function d(u,l){u===""&&(u="."),u=u.replace(/\/$/,"");for(var p=0;l.indexOf(u+"/")!==0;){var c=u.lastIndexOf("/");if(c<0||(u=u.slice(0,c),u.match(/^([^\/]+:\/)?\/*$/)))return l;++p}return Array(p+1).join("../")+l.substr(u.length+1)}o.relative=d;var m=function(){var u=Object.create(null);return!("__proto__"in u)}();function v(u){return u}function _(u){return C(u)?"$"+u:u}o.toSetString=m?v:_;function y(u){return C(u)?u.slice(1):u}o.fromSetString=m?v:y;function C(u){if(!u)return!1;var l=u.length;if(l<9||u.charCodeAt(l-1)!==95||u.charCodeAt(l-2)!==95||u.charCodeAt(l-3)!==111||u.charCodeAt(l-4)!==116||u.charCodeAt(l-5)!==111||u.charCodeAt(l-6)!==114||u.charCodeAt(l-7)!==112||u.charCodeAt(l-8)!==95||u.charCodeAt(l-9)!==95)return!1;for(var p=l-10;p>=0;p--)if(u.charCodeAt(p)!==36)return!1;return!0}function ge(u,l,p){var c=R(u.source,l.source);return c!==0||(c=u.originalLine-l.originalLine,c!==0)||(c=u.originalColumn-l.originalColumn,c!==0||p)||(c=u.generatedColumn-l.generatedColumn,c!==0)||(c=u.generatedLine-l.generatedLine,c!==0)?c:R(u.name,l.name)}o.compareByOriginalPositions=ge;function L(u,l,p){var c;return c=u.originalLine-l.originalLine,c!==0||(c=u.originalColumn-l.originalColumn,c!==0||p)||(c=u.generatedColumn-l.generatedColumn,c!==0)||(c=u.generatedLine-l.generatedLine,c!==0)?c:R(u.name,l.name)}o.compareByOriginalPositionsNoSource=L;function D(u,l,p){var c=u.generatedLine-l.generatedLine;return c!==0||(c=u.generatedColumn-l.generatedColumn,c!==0||p)||(c=R(u.source,l.source),c!==0)||(c=u.originalLine-l.originalLine,c!==0)||(c=u.originalColumn-l.originalColumn,c!==0)?c:R(u.name,l.name)}o.compareByGeneratedPositionsDeflated=D;function H(u,l,p){var c=u.generatedColumn-l.generatedColumn;return c!==0||p||(c=R(u.source,l.source),c!==0)||(c=u.originalLine-l.originalLine,c!==0)||(c=u.originalColumn-l.originalColumn,c!==0)?c:R(u.name,l.name)}o.compareByGeneratedPositionsDeflatedNoLine=H;function R(u,l){return u===l?0:u===null?1:l===null?-1:u>l?1:-1}function B(u,l){var p=u.generatedLine-l.generatedLine;return p!==0||(p=u.generatedColumn-l.generatedColumn,p!==0)||(p=R(u.source,l.source),p!==0)||(p=u.originalLine-l.originalLine,p!==0)||(p=u.originalColumn-l.originalColumn,p!==0)?p:R(u.name,l.name)}o.compareByGeneratedPositionsInflated=B;function U(u){return JSON.parse(u.replace(/^\)]}'[^\n]*\n/,""))}o.parseSourceMapInput=U;function Be(u,l,p){if(l=l||"",u&&(u[u.length-1]!=="/"&&l[0]!=="/"&&(u+="/"),l=u+l),p){var c=t(p);if(!c)throw new Error("sourceMapURL could not be parsed");if(c.path){var P=c.path.lastIndexOf("/");P>=0&&(c.path=c.path.substring(0,P+1))}l=h(i(c),l)}return a(l)}o.computeSourceURL=Be})(F);const Ye=pe(F);var se={},ue=F,le=Object.prototype.hasOwnProperty,z=typeof Map<"u";function $(){this._array=[],this._set=z?new Map:Object.create(null)}$.fromArray=function(e,r){for(var n=new $,t=0,i=e.length;t<i;t++)n.add(e[t],r);return n},$.prototype.size=function(){return z?this._set.size:Object.getOwnPropertyNames(this._set).length},$.prototype.add=function(e,r){var n=z?e:ue.toSetString(e),t=z?this.has(e):le.call(this._set,n),i=this._array.length;(!t||r)&&this._array.push(e),t||(z?this._set.set(e,i):this._set[n]=i)},$.prototype.has=function(e){if(z)return this._set.has(e);var r=ue.toSetString(e);return le.call(this._set,r)},$.prototype.indexOf=function(e){if(z){var r=this._set.get(e);if(r>=0)return r}else{var n=ue.toSetString(e);if(le.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},$.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},$.prototype.toArray=function(){return this._array.slice()};var He=se.ArraySet=$,Ce={},we=F;function Ne(o,e){var r=o.generatedLine,n=e.generatedLine,t=o.generatedColumn,i=e.generatedColumn;return n>r||n==r&&i>=t||we.compareByGeneratedPositionsInflated(o,e)<=0}function K(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}K.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)},K.prototype.add=function(e){Ne(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},K.prototype.toArray=function(){return this._sorted||(this._array.sort(we.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};var er=Ce.MappingList=K,Q=J,w=F,X=se.ArraySet,Ge=Ce.MappingList;function N(o){o||(o={}),this._file=w.getArg(o,"file",null),this._sourceRoot=w.getArg(o,"sourceRoot",null),this._skipValidation=w.getArg(o,"skipValidation",!1),this._ignoreInvalidMapping=w.getArg(o,"ignoreInvalidMapping",!1),this._sources=new X,this._names=new X,this._mappings=new Ge,this._sourcesContents=null}N.prototype._version=3,N.fromSourceMap=function(e,r){var n=e.sourceRoot,t=new N(Object.assign(r||{},{file:e.file,sourceRoot:n}));return e.eachMapping(function(i){var s={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(s.source=i.source,n!=null&&(s.source=w.relative(n,s.source)),s.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(s.name=i.name)),t.addMapping(s)}),e.sources.forEach(function(i){var s=i;n!==null&&(s=w.relative(n,i)),t._sources.has(s)||t._sources.add(s);var f=e.sourceContentFor(i);f!=null&&t.setSourceContent(i,f)}),t},N.prototype.addMapping=function(e){var r=w.getArg(e,"generated"),n=w.getArg(e,"original",null),t=w.getArg(e,"source",null),i=w.getArg(e,"name",null);!this._skipValidation&&this._validateMapping(r,n,t,i)===!1||(t!=null&&(t=String(t),this._sources.has(t)||this._sources.add(t)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:t,name:i}))},N.prototype.setSourceContent=function(e,r){var n=e;this._sourceRoot!=null&&(n=w.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[w.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[w.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},N.prototype.applySourceMap=function(e,r,n){var t=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);t=e.file}var i=this._sourceRoot;i!=null&&(t=w.relative(i,t));var s=new X,f=new X;this._mappings.unsortedForEach(function(a){if(a.source===t&&a.originalLine!=null){var h=e.originalPositionFor({line:a.originalLine,column:a.originalColumn});h.source!=null&&(a.source=h.source,n!=null&&(a.source=w.join(n,a.source)),i!=null&&(a.source=w.relative(i,a.source)),a.originalLine=h.line,a.originalColumn=h.column,h.name!=null&&(a.name=h.name))}var d=a.source;d!=null&&!s.has(d)&&s.add(d);var m=a.name;m!=null&&!f.has(m)&&f.add(m)},this),this._sources=s,this._names=f,e.sources.forEach(function(a){var h=e.sourceContentFor(a);h!=null&&(n!=null&&(a=w.join(n,a)),i!=null&&(a=w.relative(i,a)),this.setSourceContent(a,h))},this)},N.prototype._validateMapping=function(e,r,n,t){if(r&&typeof r.line!="number"&&typeof r.column!="number"){var i="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(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(i),!1;throw new Error(i)}if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!t)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;var i="Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:t});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(i),!1;throw new Error(i)}},N.prototype._serializeMappings=function(){for(var e=0,r=1,n=0,t=0,i=0,s=0,f="",a,h,d,m,v=this._mappings.toArray(),_=0,y=v.length;_<y;_++){if(h=v[_],a="",h.generatedLine!==r)for(e=0;h.generatedLine!==r;)a+=";",r++;else if(_>0){if(!w.compareByGeneratedPositionsInflated(h,v[_-1]))continue;a+=","}a+=Q.encode(h.generatedColumn-e),e=h.generatedColumn,h.source!=null&&(m=this._sources.indexOf(h.source),a+=Q.encode(m-s),s=m,a+=Q.encode(h.originalLine-1-t),t=h.originalLine-1,a+=Q.encode(h.originalColumn-n),n=h.originalColumn,h.name!=null&&(d=this._names.indexOf(h.name),a+=Q.encode(d-i),i=d)),f+=a}return f},N.prototype._generateSourcesContent=function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=w.relative(r,n));var t=w.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,t)?this._sourcesContents[t]:null},this)},N.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},N.prototype.toString=function(){return JSON.stringify(this.toJSON())};var rr=te.SourceMapGenerator=N,Z={},ae={};(function(o){o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2;function e(r,n,t,i,s,f){var a=Math.floor((n-r)/2)+r,h=s(t,i[a],!0);return h===0?a:h>0?n-a>1?e(a,n,t,i,s,f):f==o.LEAST_UPPER_BOUND?n<i.length?n:-1:a:a-r>1?e(r,a,t,i,s,f):f==o.LEAST_UPPER_BOUND?a:r<0?-1:r}o.search=function(n,t,i,s){if(t.length===0)return-1;var f=e(-1,t.length,n,t,i,s||o.GREATEST_LOWER_BOUND);if(f<0)return-1;for(;f-1>=0&&i(t[f],t[f-1],!0)===0;)--f;return f}})(ae);const nr=pe(ae);var Ee={};function je(o){function e(t,i,s){var f=t[i];t[i]=t[s],t[s]=f}function r(t,i){return Math.round(t+Math.random()*(i-t))}function n(t,i,s,f){if(s<f){var a=r(s,f),h=s-1;e(t,a,f);for(var d=t[f],m=s;m<f;m++)i(t[m],d,!1)<=0&&(h+=1,e(t,h,m));e(t,h+1,m);var v=h+1;n(t,i,s,v-1),n(t,i,v+1,f)}}return n}function Te(o){let e=je.toString();return new Function(`return ${e}`)()(o)}let Me=new WeakMap;var tr=Ee.quickSort=function(o,e,r=0){let n=Me.get(e);n===void 0&&(n=Te(e),Me.set(e,n)),n(o,e,r,o.length-1)},g=F,ce=ae,k=se.ArraySet,$e=J,W=Ee.quickSort;function S(o,e){var r=o;return typeof o=="string"&&(r=g.parseSourceMapInput(o)),r.sections!=null?new j(r,e):new E(r,e)}S.fromSourceMap=function(o,e){return E.fromSourceMap(o,e)},S.prototype._version=3,S.prototype.__generatedMappings=null,Object.defineProperty(S.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),S.prototype.__originalMappings=null,Object.defineProperty(S.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),S.prototype._charIsMappingSeparator=function(e,r){var n=e.charAt(r);return n===";"||n===","},S.prototype._parseMappings=function(e,r){throw new Error("Subclasses must implement _parseMappings")},S.GENERATED_ORDER=1,S.ORIGINAL_ORDER=2,S.GREATEST_LOWER_BOUND=1,S.LEAST_UPPER_BOUND=2,S.prototype.eachMapping=function(e,r,n){var t=r||null,i=n||S.GENERATED_ORDER,s;switch(i){case S.GENERATED_ORDER:s=this._generatedMappings;break;case S.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var f=this.sourceRoot,a=e.bind(t),h=this._names,d=this._sources,m=this._sourceMapURL,v=0,_=s.length;v<_;v++){var y=s[v],C=y.source===null?null:d.at(y.source);C!==null&&(C=g.computeSourceURL(f,C,m)),a({source:C,generatedLine:y.generatedLine,generatedColumn:y.generatedColumn,originalLine:y.originalLine,originalColumn:y.originalColumn,name:y.name===null?null:h.at(y.name)})}},S.prototype.allGeneratedPositionsFor=function(e){var r=g.getArg(e,"line"),n={source:g.getArg(e,"source"),originalLine:r,originalColumn:g.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var t=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",g.compareByOriginalPositions,ce.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(e.column===void 0)for(var f=s.originalLine;s&&s.originalLine===f;)t.push({line:g.getArg(s,"generatedLine",null),column:g.getArg(s,"generatedColumn",null),lastColumn:g.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var a=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==a;)t.push({line:g.getArg(s,"generatedLine",null),column:g.getArg(s,"generatedColumn",null),lastColumn:g.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return t};var or=Z.SourceMapConsumer=S;function E(o,e){var r=o;typeof o=="string"&&(r=g.parseSourceMapInput(o));var n=g.getArg(r,"version"),t=g.getArg(r,"sources"),i=g.getArg(r,"names",[]),s=g.getArg(r,"sourceRoot",null),f=g.getArg(r,"sourcesContent",null),a=g.getArg(r,"mappings"),h=g.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=g.normalize(s)),t=t.map(String).map(g.normalize).map(function(d){return s&&g.isAbsolute(s)&&g.isAbsolute(d)?g.relative(s,d):d}),this._names=k.fromArray(i.map(String),!0),this._sources=k.fromArray(t,!0),this._absoluteSources=this._sources.toArray().map(function(d){return g.computeSourceURL(s,d,e)}),this.sourceRoot=s,this.sourcesContent=f,this._mappings=a,this._sourceMapURL=e,this.file=h}E.prototype=Object.create(S.prototype),E.prototype.consumer=S,E.prototype._findSourceIndex=function(o){var e=o;if(this.sourceRoot!=null&&(e=g.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==o)return r;return-1},E.fromSourceMap=function(e,r){var n=Object.create(E.prototype),t=n._names=k.fromArray(e._names.toArray(),!0),i=n._sources=k.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(_){return g.computeSourceURL(n.sourceRoot,_,r)});for(var s=e._mappings.toArray().slice(),f=n.__generatedMappings=[],a=n.__originalMappings=[],h=0,d=s.length;h<d;h++){var m=s[h],v=new Le;v.generatedLine=m.generatedLine,v.generatedColumn=m.generatedColumn,m.source&&(v.source=i.indexOf(m.source),v.originalLine=m.originalLine,v.originalColumn=m.originalColumn,m.name&&(v.name=t.indexOf(m.name)),a.push(v)),f.push(v)}return W(n.__originalMappings,g.compareByOriginalPositions),n},E.prototype._version=3,Object.defineProperty(E.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Le(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}const fe=g.compareByGeneratedPositionsDeflatedNoLine;function be(o,e){let r=o.length,n=o.length-e;if(!(n<=1))if(n==2){let t=o[e],i=o[e+1];fe(t,i)>0&&(o[e]=i,o[e+1]=t)}else if(n<20)for(let t=e;t<r;t++)for(let i=t;i>e;i--){let s=o[i-1],f=o[i];if(fe(s,f)<=0)break;o[i-1]=f,o[i]=s}else W(o,fe,e)}E.prototype._parseMappings=function(e,r){var n=1,t=0,i=0,s=0,f=0,a=0,h=e.length,d=0,m={},v={},_=[],y=[],C,ge,L,D,H;let R=0;for(;d<h;)if(e.charAt(d)===";")n++,d++,t=0,be(y,R),R=y.length;else if(e.charAt(d)===",")d++;else{for(C=new Le,C.generatedLine=n,D=d;D<h&&!this._charIsMappingSeparator(e,D);D++);for(ge=e.slice(d,D),L=[];d<D;)$e.decode(e,d,v),H=v.value,d=v.rest,L.push(H);if(L.length===2)throw new Error("Found a source, but no line and column");if(L.length===3)throw new Error("Found a source and line, but no column");if(C.generatedColumn=t+L[0],t=C.generatedColumn,L.length>1&&(C.source=f+L[1],f+=L[1],C.originalLine=i+L[2],i=C.originalLine,C.originalLine+=1,C.originalColumn=s+L[3],s=C.originalColumn,L.length>4&&(C.name=a+L[4],a+=L[4])),y.push(C),typeof C.originalLine=="number"){let U=C.source;for(;_.length<=U;)_.push(null);_[U]===null&&(_[U]=[]),_[U].push(C)}}be(y,R),this.__generatedMappings=y;for(var B=0;B<_.length;B++)_[B]!=null&&W(_[B],g.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(..._)},E.prototype._findMapping=function(e,r,n,t,i,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[t]);return ce.search(e,r,i,s)},E.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var r=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}},E.prototype.originalPositionFor=function(e){var r={generatedLine:g.getArg(e,"line"),generatedColumn:g.getArg(e,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",g.compareByGeneratedPositionsDeflated,g.getArg(e,"bias",S.GREATEST_LOWER_BOUND));if(n>=0){var t=this._generatedMappings[n];if(t.generatedLine===r.generatedLine){var i=g.getArg(t,"source",null);i!==null&&(i=this._sources.at(i),i=g.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=g.getArg(t,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:g.getArg(t,"originalLine",null),column:g.getArg(t,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},E.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},E.prototype.sourceContentFor=function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var t=e;this.sourceRoot!=null&&(t=g.relative(this.sourceRoot,t));var i;if(this.sourceRoot!=null&&(i=g.urlParse(this.sourceRoot))){var s=t.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!i.path||i.path=="/")&&this._sources.has("/"+t))return this.sourcesContent[this._sources.indexOf("/"+t)]}if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')},E.prototype.generatedPositionFor=function(e){var r=g.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:g.getArg(e,"line"),originalColumn:g.getArg(e,"column")},t=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",g.compareByOriginalPositions,g.getArg(e,"bias",S.GREATEST_LOWER_BOUND));if(t>=0){var i=this._originalMappings[t];if(i.source===n.source)return{line:g.getArg(i,"generatedLine",null),column:g.getArg(i,"generatedColumn",null),lastColumn:g.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};var ir=Z.BasicSourceMapConsumer=E;function j(o,e){var r=o;typeof o=="string"&&(r=g.parseSourceMapInput(o));var n=g.getArg(r,"version"),t=g.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new k,this._names=new k;var i={line:-1,column:0};this._sections=t.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var f=g.getArg(s,"offset"),a=g.getArg(f,"line"),h=g.getArg(f,"column");if(a<i.line||a===i.line&&h<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=f,{generatedOffset:{generatedLine:a+1,generatedColumn:h+1},consumer:new S(g.getArg(s,"map"),e)}})}j.prototype=Object.create(S.prototype),j.prototype.constructor=S,j.prototype._version=3,Object.defineProperty(j.prototype,"sources",{get:function(){for(var o=[],e=0;e<this._sections.length;e++)for(var r=0;r<this._sections[e].consumer.sources.length;r++)o.push(this._sections[e].consumer.sources[r]);return o}}),j.prototype.originalPositionFor=function(e){var r={generatedLine:g.getArg(e,"line"),generatedColumn:g.getArg(e,"column")},n=ce.search(r,this._sections,function(i,s){var f=i.generatedLine-s.generatedOffset.generatedLine;return f||i.generatedColumn-s.generatedOffset.generatedColumn}),t=this._sections[n];return t?t.consumer.originalPositionFor({line:r.generatedLine-(t.generatedOffset.generatedLine-1),column:r.generatedColumn-(t.generatedOffset.generatedLine===r.generatedLine?t.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},j.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},j.prototype.sourceContentFor=function(e,r){for(var n=0;n<this._sections.length;n++){var t=this._sections[n],i=t.consumer.sourceContentFor(e,!0);if(i||i==="")return i}if(r)return null;throw new Error('"'+e+'" is not in the SourceMap.')},j.prototype.generatedPositionFor=function(e){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(g.getArg(e,"source"))!==-1){var t=n.consumer.generatedPositionFor(e);if(t){var i={line:t.line+(n.generatedOffset.generatedLine-1),column:t.column+(n.generatedOffset.generatedLine===t.line?n.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}},j.prototype._parseMappings=function(e,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var t=this._sections[n],i=t.consumer._generatedMappings,s=0;s<i.length;s++){var f=i[s],a=t.consumer._sources.at(f.source);a!==null&&(a=g.computeSourceURL(t.consumer.sourceRoot,a,this._sourceMapURL)),this._sources.add(a),a=this._sources.indexOf(a);var h=null;f.name&&(h=t.consumer._names.at(f.name),this._names.add(h),h=this._names.indexOf(h));var d={source:a,generatedLine:f.generatedLine+(t.generatedOffset.generatedLine-1),generatedColumn:f.generatedColumn+(t.generatedOffset.generatedLine===f.generatedLine?t.generatedOffset.generatedColumn-1:0),originalLine:f.originalLine,originalColumn:f.originalColumn,name:h};this.__generatedMappings.push(d),typeof d.originalLine=="number"&&this.__originalMappings.push(d)}W(this.__generatedMappings,g.compareByGeneratedPositionsDeflated),W(this.__originalMappings,g.compareByOriginalPositions)};var sr=Z.IndexedSourceMapConsumer=j,Oe={},Pe=te.SourceMapGenerator,Y=F,De=/(\r?\n)/,Fe=10,x="$$$isSourceNode$$$";function A(o,e,r,n,t){this.children=[],this.sourceContents={},this.line=o??null,this.column=e??null,this.source=r??null,this.name=t??null,this[x]=!0,n!=null&&this.add(n)}A.fromStringWithSourceMap=function(e,r,n){var t=new A,i=e.split(De),s=0,f=function(){var v=y(),_=y()||"";return v+_;function y(){return s<i.length?i[s++]:void 0}},a=1,h=0,d=null;return r.eachMapping(function(v){if(d!==null)if(a<v.generatedLine)m(d,f()),a++,h=0;else{var _=i[s]||"",y=_.substr(0,v.generatedColumn-h);i[s]=_.substr(v.generatedColumn-h),h=v.generatedColumn,m(d,y),d=v;return}for(;a<v.generatedLine;)t.add(f()),a++;if(h<v.generatedColumn){var _=i[s]||"";t.add(_.substr(0,v.generatedColumn)),i[s]=_.substr(v.generatedColumn),h=v.generatedColumn}d=v},this),s<i.length&&(d&&m(d,f()),t.add(i.splice(s).join(""))),r.sources.forEach(function(v){var _=r.sourceContentFor(v);_!=null&&(n!=null&&(v=Y.join(n,v)),t.setSourceContent(v,_))}),t;function m(v,_){if(v===null||v.source===void 0)t.add(_);else{var y=n?Y.join(n,v.source):v.source;t.add(new A(v.originalLine,v.originalColumn,y,_,v.name))}}},A.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(r){this.add(r)},this);else if(e[x]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this},A.prototype.prepend=function(e){if(Array.isArray(e))for(var r=e.length-1;r>=0;r--)this.prepend(e[r]);else if(e[x]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this},A.prototype.walk=function(e){for(var r,n=0,t=this.children.length;n<t;n++)r=this.children[n],r[x]?r.walk(e):r!==""&&e(r,{source:this.source,line:this.line,column:this.column,name:this.name})},A.prototype.join=function(e){var r,n,t=this.children.length;if(t>0){for(r=[],n=0;n<t-1;n++)r.push(this.children[n]),r.push(e);r.push(this.children[n]),this.children=r}return this},A.prototype.replaceRight=function(e,r){var n=this.children[this.children.length-1];return n[x]?n.replaceRight(e,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,r):this.children.push("".replace(e,r)),this},A.prototype.setSourceContent=function(e,r){this.sourceContents[Y.toSetString(e)]=r},A.prototype.walkSourceContents=function(e){for(var r=0,n=this.children.length;r<n;r++)this.children[r][x]&&this.children[r].walkSourceContents(e);for(var t=Object.keys(this.sourceContents),r=0,n=t.length;r<n;r++)e(Y.fromSetString(t[r]),this.sourceContents[t[r]])},A.prototype.toString=function(){var e="";return this.walk(function(r){e+=r}),e},A.prototype.toStringWithSourceMap=function(e){var r={code:"",line:1,column:0},n=new Pe(e),t=!1,i=null,s=null,f=null,a=null;return this.walk(function(h,d){r.code+=h,d.source!==null&&d.line!==null&&d.column!==null?((i!==d.source||s!==d.line||f!==d.column||a!==d.name)&&n.addMapping({source:d.source,original:{line:d.line,column:d.column},generated:{line:r.line,column:r.column},name:d.name}),i=d.source,s=d.line,f=d.column,a=d.name,t=!0):t&&(n.addMapping({generated:{line:r.line,column:r.column}}),i=null,t=!1);for(var m=0,v=h.length;m<v;m++)h.charCodeAt(m)===Fe?(r.line++,r.column=0,m+1===v?(i=null,t=!1):t&&n.addMapping({source:d.source,original:{line:d.line,column:d.column},generated:{line:r.line,column:r.column},name:d.name})):r.column++}),this.walkSourceContents(function(h,d){n.setSourceContent(h,d)}),{code:r.code,map:n}};var ur=Oe.SourceNode=A,lr=ne.SourceMapGenerator=te.SourceMapGenerator,ze=ne.SourceMapConsumer=Z.SourceMapConsumer,ar=ne.SourceNode=Oe.SourceNode;class Ae{constructor(e){G(this,"options",null);e&&(this.options=e)}parseStackTrace(e){const n=e.split(`
|
|
2
|
-
`).find(h=>h.includes(".js:")||h.includes(".ts:"));if(!n)return null;const t=n.match(/(?:at(?:\s+\S.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF])|\s{2,})\()?([^\s(]+):(\d+):(\d+)/);if(!t)return null;const[i,s,f,a]=t;return{fileName:s,lineNumber:Number.parseInt(f,10),columnNumber:Number.parseInt(a,10)}}async fetchSourceMap(e){try{const r=`${e}.map`,n=await fetch(r);return n.ok?await n.json():null}catch(r){return console.error("获取 source map 失败:",r),null}}async getErrorSource(e){if(!(e!=null&&e.stack))return null;try{const r=this.parseStackTrace(e.stack);if(!r)return null;const n=await this.fetchSourceMap(r.fileName);if(!n)return r;const t=new
|
|
1
|
+
(function(M,O){typeof exports=="object"&&typeof module<"u"?O(exports):typeof define=="function"&&define.amd?define(["exports"],O):(M=typeof globalThis<"u"?globalThis:M||self,O(M.KingMonitor={}))})(this,function(M){"use strict";var Ue=Object.defineProperty;var Ve=(M,O,V)=>O in M?Ue(M,O,{enumerable:!0,configurable:!0,writable:!0,value:V}):M[O]=V;var G=(M,O,V)=>Ve(M,typeof O!="symbol"?O+"":O,V);class O{constructor(){G(this,"events",new Map)}on(e,r){this.events.has(e)||this.events.set(e,new Set),this.events.get(e).add(r)}off(e,r){const n=this.events.get(e);n&&(n.delete(r),n.size===0&&this.events.delete(e))}emit(e,...r){const n=this.events.get(e);n&&n.forEach(t=>{try{t(...r)}catch(i){console.error(`Error in event handler for ${e}:`,i)}})}clear(){this.events.clear()}getSubscriberCount(e){const r=this.events.get(e);return r?r.size:0}hasSubscribers(e){return this.getSubscriberCount(e)>0}}var V=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pe(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function Qe(o){return o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function We(o){return o&&Object.prototype.hasOwnProperty.call(o,"default")&&Object.keys(o).length===1?o.default:o}function qe(o){if(o.__esModule)return o;var e=o.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(o).forEach(function(n){var t=Object.getOwnPropertyDescriptor(o,n);Object.defineProperty(r,n,t.get?t:{enumerable:!0,get:function(){return o[n]}})}),r}var ne={},te={},J={},oe={},ve="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Je=oe.encode=function(o){if(0<=o&&o<ve.length)return ve[o];throw new TypeError("Must be between 0 and 63: "+o)},Ke=oe.decode=function(o){var e=65,r=90,n=97,t=122,i=48,s=57,f=43,a=47,h=26,d=52;return e<=o&&o<=r?o-e:n<=o&&o<=t?o-n+h:i<=o&&o<=s?o-i+d:o==f?62:o==a?63:-1},me=oe,ie=5,_e=1<<ie,Se=_e-1,ye=_e;function Ie(o){return o<0?(-o<<1)+1:(o<<1)+0}function Ne(o){var e=(o&1)===1,r=o>>1;return e?-r:r}var Xe=J.encode=function(e){var r="",n,t=Ie(e);do n=t&Se,t>>>=ie,t>0&&(n|=ye),r+=me.encode(n);while(t>0);return r},Ze=J.decode=function(e,r,n){var t=e.length,i=0,s=0,f,a;do{if(r>=t)throw new Error("Expected more digits in base 64 VLQ value.");if(a=me.decode(e.charCodeAt(r++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));f=!!(a&ye),a&=Se,i=i+(a<<s),s+=ie}while(f);n.value=Ne(i),n.rest=r},F={};(function(o){function e(u,l,p){if(l in u)return u[l];if(arguments.length===3)return p;throw new Error('"'+l+'" is a required argument.')}o.getArg=e;var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,n=/^data:.+\,.+$/;function t(u){var l=u.match(r);return l?{scheme:l[1],auth:l[2],host:l[3],port:l[4],path:l[5]}:null}o.urlParse=t;function i(u){var l="";return u.scheme&&(l+=u.scheme+":"),l+="//",u.auth&&(l+=u.auth+"@"),u.host&&(l+=u.host),u.port&&(l+=":"+u.port),u.path&&(l+=u.path),l}o.urlGenerate=i;var s=32;function f(u){var l=[];return function(p){for(var c=0;c<l.length;c++)if(l[c].input===p){var j=l[0];return l[0]=l[c],l[c]=j,l[0].result}var $=u(p);return l.unshift({input:p,result:$}),l.length>s&&l.pop(),$}}var a=f(function(l){var p=l,c=t(l);if(c){if(!c.path)return l;p=c.path}for(var j=o.isAbsolute(p),$=[],ee=0,b=0;;)if(ee=b,b=p.indexOf("/",ee),b===-1){$.push(p.slice(ee));break}else for($.push(p.slice(ee,b));b<p.length&&p[b]==="/";)b++;for(var re,q=0,b=$.length-1;b>=0;b--)re=$[b],re==="."?$.splice(b,1):re===".."?q++:q>0&&(re===""?($.splice(b+1,q),q=0):($.splice(b,2),q--));return p=$.join("/"),p===""&&(p=j?"/":"."),c?(c.path=p,i(c)):p});o.normalize=a;function h(u,l){u===""&&(u="."),l===""&&(l=".");var p=t(l),c=t(u);if(c&&(u=c.path||"/"),p&&!p.scheme)return c&&(p.scheme=c.scheme),i(p);if(p||l.match(n))return l;if(c&&!c.host&&!c.path)return c.host=l,i(c);var j=l.charAt(0)==="/"?l:a(u.replace(/\/+$/,"")+"/"+l);return c?(c.path=j,i(c)):j}o.join=h,o.isAbsolute=function(u){return u.charAt(0)==="/"||r.test(u)};function d(u,l){u===""&&(u="."),u=u.replace(/\/$/,"");for(var p=0;l.indexOf(u+"/")!==0;){var c=u.lastIndexOf("/");if(c<0||(u=u.slice(0,c),u.match(/^([^\/]+:\/)?\/*$/)))return l;++p}return Array(p+1).join("../")+l.substr(u.length+1)}o.relative=d;var m=function(){var u=Object.create(null);return!("__proto__"in u)}();function v(u){return u}function _(u){return C(u)?"$"+u:u}o.toSetString=m?v:_;function y(u){return C(u)?u.slice(1):u}o.fromSetString=m?v:y;function C(u){if(!u)return!1;var l=u.length;if(l<9||u.charCodeAt(l-1)!==95||u.charCodeAt(l-2)!==95||u.charCodeAt(l-3)!==111||u.charCodeAt(l-4)!==116||u.charCodeAt(l-5)!==111||u.charCodeAt(l-6)!==114||u.charCodeAt(l-7)!==112||u.charCodeAt(l-8)!==95||u.charCodeAt(l-9)!==95)return!1;for(var p=l-10;p>=0;p--)if(u.charCodeAt(p)!==36)return!1;return!0}function ge(u,l,p){var c=N(u.source,l.source);return c!==0||(c=u.originalLine-l.originalLine,c!==0)||(c=u.originalColumn-l.originalColumn,c!==0||p)||(c=u.generatedColumn-l.generatedColumn,c!==0)||(c=u.generatedLine-l.generatedLine,c!==0)?c:N(u.name,l.name)}o.compareByOriginalPositions=ge;function L(u,l,p){var c;return c=u.originalLine-l.originalLine,c!==0||(c=u.originalColumn-l.originalColumn,c!==0||p)||(c=u.generatedColumn-l.generatedColumn,c!==0)||(c=u.generatedLine-l.generatedLine,c!==0)?c:N(u.name,l.name)}o.compareByOriginalPositionsNoSource=L;function D(u,l,p){var c=u.generatedLine-l.generatedLine;return c!==0||(c=u.generatedColumn-l.generatedColumn,c!==0||p)||(c=N(u.source,l.source),c!==0)||(c=u.originalLine-l.originalLine,c!==0)||(c=u.originalColumn-l.originalColumn,c!==0)?c:N(u.name,l.name)}o.compareByGeneratedPositionsDeflated=D;function H(u,l,p){var c=u.generatedColumn-l.generatedColumn;return c!==0||p||(c=N(u.source,l.source),c!==0)||(c=u.originalLine-l.originalLine,c!==0)||(c=u.originalColumn-l.originalColumn,c!==0)?c:N(u.name,l.name)}o.compareByGeneratedPositionsDeflatedNoLine=H;function N(u,l){return u===l?0:u===null?1:l===null?-1:u>l?1:-1}function B(u,l){var p=u.generatedLine-l.generatedLine;return p!==0||(p=u.generatedColumn-l.generatedColumn,p!==0)||(p=N(u.source,l.source),p!==0)||(p=u.originalLine-l.originalLine,p!==0)||(p=u.originalColumn-l.originalColumn,p!==0)?p:N(u.name,l.name)}o.compareByGeneratedPositionsInflated=B;function U(u){return JSON.parse(u.replace(/^\)]}'[^\n]*\n/,""))}o.parseSourceMapInput=U;function Be(u,l,p){if(l=l||"",u&&(u[u.length-1]!=="/"&&l[0]!=="/"&&(u+="/"),l=u+l),p){var c=t(p);if(!c)throw new Error("sourceMapURL could not be parsed");if(c.path){var j=c.path.lastIndexOf("/");j>=0&&(c.path=c.path.substring(0,j+1))}l=h(i(c),l)}return a(l)}o.computeSourceURL=Be})(F);const Ye=pe(F);var se={},ue=F,le=Object.prototype.hasOwnProperty,k=typeof Map<"u";function P(){this._array=[],this._set=k?new Map:Object.create(null)}P.fromArray=function(e,r){for(var n=new P,t=0,i=e.length;t<i;t++)n.add(e[t],r);return n},P.prototype.size=function(){return k?this._set.size:Object.getOwnPropertyNames(this._set).length},P.prototype.add=function(e,r){var n=k?e:ue.toSetString(e),t=k?this.has(e):le.call(this._set,n),i=this._array.length;(!t||r)&&this._array.push(e),t||(k?this._set.set(e,i):this._set[n]=i)},P.prototype.has=function(e){if(k)return this._set.has(e);var r=ue.toSetString(e);return le.call(this._set,r)},P.prototype.indexOf=function(e){if(k){var r=this._set.get(e);if(r>=0)return r}else{var n=ue.toSetString(e);if(le.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},P.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},P.prototype.toArray=function(){return this._array.slice()};var He=se.ArraySet=P,Ce={},we=F;function Re(o,e){var r=o.generatedLine,n=e.generatedLine,t=o.generatedColumn,i=e.generatedColumn;return n>r||n==r&&i>=t||we.compareByGeneratedPositionsInflated(o,e)<=0}function K(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}K.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)},K.prototype.add=function(e){Re(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},K.prototype.toArray=function(){return this._sorted||(this._array.sort(we.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};var er=Ce.MappingList=K,Q=J,w=F,X=se.ArraySet,Ge=Ce.MappingList;function R(o){o||(o={}),this._file=w.getArg(o,"file",null),this._sourceRoot=w.getArg(o,"sourceRoot",null),this._skipValidation=w.getArg(o,"skipValidation",!1),this._ignoreInvalidMapping=w.getArg(o,"ignoreInvalidMapping",!1),this._sources=new X,this._names=new X,this._mappings=new Ge,this._sourcesContents=null}R.prototype._version=3,R.fromSourceMap=function(e,r){var n=e.sourceRoot,t=new R(Object.assign(r||{},{file:e.file,sourceRoot:n}));return e.eachMapping(function(i){var s={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(s.source=i.source,n!=null&&(s.source=w.relative(n,s.source)),s.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(s.name=i.name)),t.addMapping(s)}),e.sources.forEach(function(i){var s=i;n!==null&&(s=w.relative(n,i)),t._sources.has(s)||t._sources.add(s);var f=e.sourceContentFor(i);f!=null&&t.setSourceContent(i,f)}),t},R.prototype.addMapping=function(e){var r=w.getArg(e,"generated"),n=w.getArg(e,"original",null),t=w.getArg(e,"source",null),i=w.getArg(e,"name",null);!this._skipValidation&&this._validateMapping(r,n,t,i)===!1||(t!=null&&(t=String(t),this._sources.has(t)||this._sources.add(t)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:t,name:i}))},R.prototype.setSourceContent=function(e,r){var n=e;this._sourceRoot!=null&&(n=w.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[w.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[w.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},R.prototype.applySourceMap=function(e,r,n){var t=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);t=e.file}var i=this._sourceRoot;i!=null&&(t=w.relative(i,t));var s=new X,f=new X;this._mappings.unsortedForEach(function(a){if(a.source===t&&a.originalLine!=null){var h=e.originalPositionFor({line:a.originalLine,column:a.originalColumn});h.source!=null&&(a.source=h.source,n!=null&&(a.source=w.join(n,a.source)),i!=null&&(a.source=w.relative(i,a.source)),a.originalLine=h.line,a.originalColumn=h.column,h.name!=null&&(a.name=h.name))}var d=a.source;d!=null&&!s.has(d)&&s.add(d);var m=a.name;m!=null&&!f.has(m)&&f.add(m)},this),this._sources=s,this._names=f,e.sources.forEach(function(a){var h=e.sourceContentFor(a);h!=null&&(n!=null&&(a=w.join(n,a)),i!=null&&(a=w.relative(i,a)),this.setSourceContent(a,h))},this)},R.prototype._validateMapping=function(e,r,n,t){if(r&&typeof r.line!="number"&&typeof r.column!="number"){var i="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(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(i),!1;throw new Error(i)}if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!t)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;var i="Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:t});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(i),!1;throw new Error(i)}},R.prototype._serializeMappings=function(){for(var e=0,r=1,n=0,t=0,i=0,s=0,f="",a,h,d,m,v=this._mappings.toArray(),_=0,y=v.length;_<y;_++){if(h=v[_],a="",h.generatedLine!==r)for(e=0;h.generatedLine!==r;)a+=";",r++;else if(_>0){if(!w.compareByGeneratedPositionsInflated(h,v[_-1]))continue;a+=","}a+=Q.encode(h.generatedColumn-e),e=h.generatedColumn,h.source!=null&&(m=this._sources.indexOf(h.source),a+=Q.encode(m-s),s=m,a+=Q.encode(h.originalLine-1-t),t=h.originalLine-1,a+=Q.encode(h.originalColumn-n),n=h.originalColumn,h.name!=null&&(d=this._names.indexOf(h.name),a+=Q.encode(d-i),i=d)),f+=a}return f},R.prototype._generateSourcesContent=function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=w.relative(r,n));var t=w.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,t)?this._sourcesContents[t]:null},this)},R.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},R.prototype.toString=function(){return JSON.stringify(this.toJSON())};var rr=te.SourceMapGenerator=R,Z={},ae={};(function(o){o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2;function e(r,n,t,i,s,f){var a=Math.floor((n-r)/2)+r,h=s(t,i[a],!0);return h===0?a:h>0?n-a>1?e(a,n,t,i,s,f):f==o.LEAST_UPPER_BOUND?n<i.length?n:-1:a:a-r>1?e(r,a,t,i,s,f):f==o.LEAST_UPPER_BOUND?a:r<0?-1:r}o.search=function(n,t,i,s){if(t.length===0)return-1;var f=e(-1,t.length,n,t,i,s||o.GREATEST_LOWER_BOUND);if(f<0)return-1;for(;f-1>=0&&i(t[f],t[f-1],!0)===0;)--f;return f}})(ae);const nr=pe(ae);var Ee={};function Te(o){function e(t,i,s){var f=t[i];t[i]=t[s],t[s]=f}function r(t,i){return Math.round(t+Math.random()*(i-t))}function n(t,i,s,f){if(s<f){var a=r(s,f),h=s-1;e(t,a,f);for(var d=t[f],m=s;m<f;m++)i(t[m],d,!1)<=0&&(h+=1,e(t,h,m));e(t,h+1,m);var v=h+1;n(t,i,s,v-1),n(t,i,v+1,f)}}return n}function $e(o){let e=Te.toString();return new Function(`return ${e}`)()(o)}let Me=new WeakMap;var tr=Ee.quickSort=function(o,e,r=0){let n=Me.get(e);n===void 0&&(n=$e(e),Me.set(e,n)),n(o,e,r,o.length-1)},g=F,ce=ae,z=se.ArraySet,Pe=J,W=Ee.quickSort;function S(o,e){var r=o;return typeof o=="string"&&(r=g.parseSourceMapInput(o)),r.sections!=null?new T(r,e):new E(r,e)}S.fromSourceMap=function(o,e){return E.fromSourceMap(o,e)},S.prototype._version=3,S.prototype.__generatedMappings=null,Object.defineProperty(S.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),S.prototype.__originalMappings=null,Object.defineProperty(S.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),S.prototype._charIsMappingSeparator=function(e,r){var n=e.charAt(r);return n===";"||n===","},S.prototype._parseMappings=function(e,r){throw new Error("Subclasses must implement _parseMappings")},S.GENERATED_ORDER=1,S.ORIGINAL_ORDER=2,S.GREATEST_LOWER_BOUND=1,S.LEAST_UPPER_BOUND=2,S.prototype.eachMapping=function(e,r,n){var t=r||null,i=n||S.GENERATED_ORDER,s;switch(i){case S.GENERATED_ORDER:s=this._generatedMappings;break;case S.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var f=this.sourceRoot,a=e.bind(t),h=this._names,d=this._sources,m=this._sourceMapURL,v=0,_=s.length;v<_;v++){var y=s[v],C=y.source===null?null:d.at(y.source);C!==null&&(C=g.computeSourceURL(f,C,m)),a({source:C,generatedLine:y.generatedLine,generatedColumn:y.generatedColumn,originalLine:y.originalLine,originalColumn:y.originalColumn,name:y.name===null?null:h.at(y.name)})}},S.prototype.allGeneratedPositionsFor=function(e){var r=g.getArg(e,"line"),n={source:g.getArg(e,"source"),originalLine:r,originalColumn:g.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var t=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",g.compareByOriginalPositions,ce.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(e.column===void 0)for(var f=s.originalLine;s&&s.originalLine===f;)t.push({line:g.getArg(s,"generatedLine",null),column:g.getArg(s,"generatedColumn",null),lastColumn:g.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var a=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==a;)t.push({line:g.getArg(s,"generatedLine",null),column:g.getArg(s,"generatedColumn",null),lastColumn:g.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return t};var or=Z.SourceMapConsumer=S;function E(o,e){var r=o;typeof o=="string"&&(r=g.parseSourceMapInput(o));var n=g.getArg(r,"version"),t=g.getArg(r,"sources"),i=g.getArg(r,"names",[]),s=g.getArg(r,"sourceRoot",null),f=g.getArg(r,"sourcesContent",null),a=g.getArg(r,"mappings"),h=g.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=g.normalize(s)),t=t.map(String).map(g.normalize).map(function(d){return s&&g.isAbsolute(s)&&g.isAbsolute(d)?g.relative(s,d):d}),this._names=z.fromArray(i.map(String),!0),this._sources=z.fromArray(t,!0),this._absoluteSources=this._sources.toArray().map(function(d){return g.computeSourceURL(s,d,e)}),this.sourceRoot=s,this.sourcesContent=f,this._mappings=a,this._sourceMapURL=e,this.file=h}E.prototype=Object.create(S.prototype),E.prototype.consumer=S,E.prototype._findSourceIndex=function(o){var e=o;if(this.sourceRoot!=null&&(e=g.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==o)return r;return-1},E.fromSourceMap=function(e,r){var n=Object.create(E.prototype),t=n._names=z.fromArray(e._names.toArray(),!0),i=n._sources=z.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(_){return g.computeSourceURL(n.sourceRoot,_,r)});for(var s=e._mappings.toArray().slice(),f=n.__generatedMappings=[],a=n.__originalMappings=[],h=0,d=s.length;h<d;h++){var m=s[h],v=new Le;v.generatedLine=m.generatedLine,v.generatedColumn=m.generatedColumn,m.source&&(v.source=i.indexOf(m.source),v.originalLine=m.originalLine,v.originalColumn=m.originalColumn,m.name&&(v.name=t.indexOf(m.name)),a.push(v)),f.push(v)}return W(n.__originalMappings,g.compareByOriginalPositions),n},E.prototype._version=3,Object.defineProperty(E.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Le(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}const fe=g.compareByGeneratedPositionsDeflatedNoLine;function be(o,e){let r=o.length,n=o.length-e;if(!(n<=1))if(n==2){let t=o[e],i=o[e+1];fe(t,i)>0&&(o[e]=i,o[e+1]=t)}else if(n<20)for(let t=e;t<r;t++)for(let i=t;i>e;i--){let s=o[i-1],f=o[i];if(fe(s,f)<=0)break;o[i-1]=f,o[i]=s}else W(o,fe,e)}E.prototype._parseMappings=function(e,r){var n=1,t=0,i=0,s=0,f=0,a=0,h=e.length,d=0,m={},v={},_=[],y=[],C,ge,L,D,H;let N=0;for(;d<h;)if(e.charAt(d)===";")n++,d++,t=0,be(y,N),N=y.length;else if(e.charAt(d)===",")d++;else{for(C=new Le,C.generatedLine=n,D=d;D<h&&!this._charIsMappingSeparator(e,D);D++);for(ge=e.slice(d,D),L=[];d<D;)Pe.decode(e,d,v),H=v.value,d=v.rest,L.push(H);if(L.length===2)throw new Error("Found a source, but no line and column");if(L.length===3)throw new Error("Found a source and line, but no column");if(C.generatedColumn=t+L[0],t=C.generatedColumn,L.length>1&&(C.source=f+L[1],f+=L[1],C.originalLine=i+L[2],i=C.originalLine,C.originalLine+=1,C.originalColumn=s+L[3],s=C.originalColumn,L.length>4&&(C.name=a+L[4],a+=L[4])),y.push(C),typeof C.originalLine=="number"){let U=C.source;for(;_.length<=U;)_.push(null);_[U]===null&&(_[U]=[]),_[U].push(C)}}be(y,N),this.__generatedMappings=y;for(var B=0;B<_.length;B++)_[B]!=null&&W(_[B],g.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(..._)},E.prototype._findMapping=function(e,r,n,t,i,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[t]);return ce.search(e,r,i,s)},E.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var r=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}},E.prototype.originalPositionFor=function(e){var r={generatedLine:g.getArg(e,"line"),generatedColumn:g.getArg(e,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",g.compareByGeneratedPositionsDeflated,g.getArg(e,"bias",S.GREATEST_LOWER_BOUND));if(n>=0){var t=this._generatedMappings[n];if(t.generatedLine===r.generatedLine){var i=g.getArg(t,"source",null);i!==null&&(i=this._sources.at(i),i=g.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=g.getArg(t,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:g.getArg(t,"originalLine",null),column:g.getArg(t,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},E.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},E.prototype.sourceContentFor=function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var t=e;this.sourceRoot!=null&&(t=g.relative(this.sourceRoot,t));var i;if(this.sourceRoot!=null&&(i=g.urlParse(this.sourceRoot))){var s=t.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!i.path||i.path=="/")&&this._sources.has("/"+t))return this.sourcesContent[this._sources.indexOf("/"+t)]}if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')},E.prototype.generatedPositionFor=function(e){var r=g.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:g.getArg(e,"line"),originalColumn:g.getArg(e,"column")},t=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",g.compareByOriginalPositions,g.getArg(e,"bias",S.GREATEST_LOWER_BOUND));if(t>=0){var i=this._originalMappings[t];if(i.source===n.source)return{line:g.getArg(i,"generatedLine",null),column:g.getArg(i,"generatedColumn",null),lastColumn:g.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};var ir=Z.BasicSourceMapConsumer=E;function T(o,e){var r=o;typeof o=="string"&&(r=g.parseSourceMapInput(o));var n=g.getArg(r,"version"),t=g.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new z,this._names=new z;var i={line:-1,column:0};this._sections=t.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var f=g.getArg(s,"offset"),a=g.getArg(f,"line"),h=g.getArg(f,"column");if(a<i.line||a===i.line&&h<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=f,{generatedOffset:{generatedLine:a+1,generatedColumn:h+1},consumer:new S(g.getArg(s,"map"),e)}})}T.prototype=Object.create(S.prototype),T.prototype.constructor=S,T.prototype._version=3,Object.defineProperty(T.prototype,"sources",{get:function(){for(var o=[],e=0;e<this._sections.length;e++)for(var r=0;r<this._sections[e].consumer.sources.length;r++)o.push(this._sections[e].consumer.sources[r]);return o}}),T.prototype.originalPositionFor=function(e){var r={generatedLine:g.getArg(e,"line"),generatedColumn:g.getArg(e,"column")},n=ce.search(r,this._sections,function(i,s){var f=i.generatedLine-s.generatedOffset.generatedLine;return f||i.generatedColumn-s.generatedOffset.generatedColumn}),t=this._sections[n];return t?t.consumer.originalPositionFor({line:r.generatedLine-(t.generatedOffset.generatedLine-1),column:r.generatedColumn-(t.generatedOffset.generatedLine===r.generatedLine?t.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},T.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},T.prototype.sourceContentFor=function(e,r){for(var n=0;n<this._sections.length;n++){var t=this._sections[n],i=t.consumer.sourceContentFor(e,!0);if(i||i==="")return i}if(r)return null;throw new Error('"'+e+'" is not in the SourceMap.')},T.prototype.generatedPositionFor=function(e){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(g.getArg(e,"source"))!==-1){var t=n.consumer.generatedPositionFor(e);if(t){var i={line:t.line+(n.generatedOffset.generatedLine-1),column:t.column+(n.generatedOffset.generatedLine===t.line?n.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}},T.prototype._parseMappings=function(e,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var t=this._sections[n],i=t.consumer._generatedMappings,s=0;s<i.length;s++){var f=i[s],a=t.consumer._sources.at(f.source);a!==null&&(a=g.computeSourceURL(t.consumer.sourceRoot,a,this._sourceMapURL)),this._sources.add(a),a=this._sources.indexOf(a);var h=null;f.name&&(h=t.consumer._names.at(f.name),this._names.add(h),h=this._names.indexOf(h));var d={source:a,generatedLine:f.generatedLine+(t.generatedOffset.generatedLine-1),generatedColumn:f.generatedColumn+(t.generatedOffset.generatedLine===f.generatedLine?t.generatedOffset.generatedColumn-1:0),originalLine:f.originalLine,originalColumn:f.originalColumn,name:h};this.__generatedMappings.push(d),typeof d.originalLine=="number"&&this.__originalMappings.push(d)}W(this.__generatedMappings,g.compareByGeneratedPositionsDeflated),W(this.__originalMappings,g.compareByOriginalPositions)};var sr=Z.IndexedSourceMapConsumer=T,Oe={},je=te.SourceMapGenerator,Y=F,De=/(\r?\n)/,Fe=10,x="$$$isSourceNode$$$";function A(o,e,r,n,t){this.children=[],this.sourceContents={},this.line=o??null,this.column=e??null,this.source=r??null,this.name=t??null,this[x]=!0,n!=null&&this.add(n)}A.fromStringWithSourceMap=function(e,r,n){var t=new A,i=e.split(De),s=0,f=function(){var v=y(),_=y()||"";return v+_;function y(){return s<i.length?i[s++]:void 0}},a=1,h=0,d=null;return r.eachMapping(function(v){if(d!==null)if(a<v.generatedLine)m(d,f()),a++,h=0;else{var _=i[s]||"",y=_.substr(0,v.generatedColumn-h);i[s]=_.substr(v.generatedColumn-h),h=v.generatedColumn,m(d,y),d=v;return}for(;a<v.generatedLine;)t.add(f()),a++;if(h<v.generatedColumn){var _=i[s]||"";t.add(_.substr(0,v.generatedColumn)),i[s]=_.substr(v.generatedColumn),h=v.generatedColumn}d=v},this),s<i.length&&(d&&m(d,f()),t.add(i.splice(s).join(""))),r.sources.forEach(function(v){var _=r.sourceContentFor(v);_!=null&&(n!=null&&(v=Y.join(n,v)),t.setSourceContent(v,_))}),t;function m(v,_){if(v===null||v.source===void 0)t.add(_);else{var y=n?Y.join(n,v.source):v.source;t.add(new A(v.originalLine,v.originalColumn,y,_,v.name))}}},A.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(r){this.add(r)},this);else if(e[x]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this},A.prototype.prepend=function(e){if(Array.isArray(e))for(var r=e.length-1;r>=0;r--)this.prepend(e[r]);else if(e[x]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this},A.prototype.walk=function(e){for(var r,n=0,t=this.children.length;n<t;n++)r=this.children[n],r[x]?r.walk(e):r!==""&&e(r,{source:this.source,line:this.line,column:this.column,name:this.name})},A.prototype.join=function(e){var r,n,t=this.children.length;if(t>0){for(r=[],n=0;n<t-1;n++)r.push(this.children[n]),r.push(e);r.push(this.children[n]),this.children=r}return this},A.prototype.replaceRight=function(e,r){var n=this.children[this.children.length-1];return n[x]?n.replaceRight(e,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,r):this.children.push("".replace(e,r)),this},A.prototype.setSourceContent=function(e,r){this.sourceContents[Y.toSetString(e)]=r},A.prototype.walkSourceContents=function(e){for(var r=0,n=this.children.length;r<n;r++)this.children[r][x]&&this.children[r].walkSourceContents(e);for(var t=Object.keys(this.sourceContents),r=0,n=t.length;r<n;r++)e(Y.fromSetString(t[r]),this.sourceContents[t[r]])},A.prototype.toString=function(){var e="";return this.walk(function(r){e+=r}),e},A.prototype.toStringWithSourceMap=function(e){var r={code:"",line:1,column:0},n=new je(e),t=!1,i=null,s=null,f=null,a=null;return this.walk(function(h,d){r.code+=h,d.source!==null&&d.line!==null&&d.column!==null?((i!==d.source||s!==d.line||f!==d.column||a!==d.name)&&n.addMapping({source:d.source,original:{line:d.line,column:d.column},generated:{line:r.line,column:r.column},name:d.name}),i=d.source,s=d.line,f=d.column,a=d.name,t=!0):t&&(n.addMapping({generated:{line:r.line,column:r.column}}),i=null,t=!1);for(var m=0,v=h.length;m<v;m++)h.charCodeAt(m)===Fe?(r.line++,r.column=0,m+1===v?(i=null,t=!1):t&&n.addMapping({source:d.source,original:{line:d.line,column:d.column},generated:{line:r.line,column:r.column},name:d.name})):r.column++}),this.walkSourceContents(function(h,d){n.setSourceContent(h,d)}),{code:r.code,map:n}};var ur=Oe.SourceNode=A,lr=ne.SourceMapGenerator=te.SourceMapGenerator,ke=ne.SourceMapConsumer=Z.SourceMapConsumer,ar=ne.SourceNode=Oe.SourceNode;class Ae{constructor(e){G(this,"options",null);e&&(this.options=e)}parseStackTrace(e){const n=e.split(`
|
|
2
|
+
`).find(h=>h.includes(".js:")||h.includes(".ts:"));if(!n)return null;const t=n.match(/(?:at(?:\s+\S.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF])|\s{2,})\()?([^\s(]+):(\d+):(\d+)/);if(!t)return null;const[i,s,f,a]=t;return{fileName:s,lineNumber:Number.parseInt(f,10),columnNumber:Number.parseInt(a,10)}}async fetchSourceMap(e){try{const r=`${e}.map`,n=await fetch(r);return n.ok?await n.json():null}catch(r){return console.error("获取 source map 失败:",r),null}}async getErrorSource(e){if(!(e!=null&&e.stack))return null;try{const r=this.parseStackTrace(e.stack);if(!r)return null;const n=await this.fetchSourceMap(r.fileName);if(!n)return r;const t=new ke(n),i=t.originalPositionFor({line:r.lineNumber,column:r.columnNumber});if(!i.source)return r;const s=t.sourceContentFor(i.source),f=(s==null?void 0:s.split(`
|
|
3
3
|
`))||[],a=(i.line||1)-1,h=Math.max(0,a-5),d=Math.min(f.length-1,a+5),m=f.slice(h,d+1).join(`
|
|
4
|
-
`);return{fileName:i.source,lineNumber:i.line||0,columnNumber:i.column||0,sourceContent:m}}catch(r){return console.error("分析错误源码失败:",r),null}}}const I=class I{constructor(e){G(this,"options");G(this,"event");G(this,"source");G(this,"ERROR_REPORTED","error-reported");this.options=this.validateOptions(e),this.event=new O,this.source=new Ae,this.init(),e.integrations&&this.initIntegrations()}onErrorReported(e){this.event.on(this.ERROR_REPORTED,e)}initIntegrations(){var e;(e=this.options.integrations)==null||e.forEach(r=>{try{r.install(this)}catch(n){console.error(`Failed to initialize integration ${r.name}:`,n)}})}static getInstance(){if(!I.instance)throw new Error("ErrorMonitor未初始化,请先调用initialize方法");return I.instance}validateOptions(e){if(!e.url)throw new Error("上报地址url不能为空");if(!e.appId)throw new Error("应用标识appId不能为空");return{env:"
|
|
4
|
+
`);return{fileName:i.source,lineNumber:i.line||0,columnNumber:i.column||0,sourceContent:m}}catch(r){return console.error("分析错误源码失败:",r),null}}}const I=class I{constructor(e){G(this,"options");G(this,"event");G(this,"source");G(this,"ERROR_REPORTED","error-reported");this.options=this.validateOptions(e),this.event=new O,this.source=new Ae,this.init(),e.integrations&&this.initIntegrations()}onErrorReported(e){this.event.on(this.ERROR_REPORTED,e)}initIntegrations(){var e;(e=this.options.integrations)==null||e.forEach(r=>{try{r.install(this)}catch(n){console.error(`Failed to initialize integration ${r.name}:`,n)}})}static getInstance(){if(!I.instance)throw new Error("ErrorMonitor未初始化,请先调用initialize方法");return I.instance}validateOptions(e){if(!e.url)throw new Error("上报地址url不能为空");if(!e.appId)throw new Error("应用标识appId不能为空");return{env:"development",sampleRate:1,...e}}init(){this.onErrorReported(e=>{this.reportError(e)})}getClientInfo(){return{url:window.location.href,userAgent:navigator.userAgent,screenSize:`${window.screen.width}x${window.screen.height}`,timestamp:Date.now()}}report(e){if(Math.random()>(this.options.sampleRate||1))return;let r={...e,appId:this.options.appId,env:this.options.env};if(this.options.beforeSend){const n=this.options.beforeSend(r);if(!n)return;r=n}navigator.sendBeacon?navigator.sendBeacon(this.options.url,JSON.stringify(r)):fetch(this.options.url,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"},keepalive:!0}).catch(()=>{})}normalizeError(e){return this.isErrorInfo(e)?{...e,extraInfo:this.options.extraInfo,...this.getClientInfo()}:e instanceof Error?{type:e.name,message:e.message,stack:e.stack,extraInfo:this.options.extraInfo,...this.getClientInfo()}:{type:"Error",message:e,extraInfo:this.options.extraInfo,...this.getClientInfo()}}isErrorInfo(e){return typeof e=="object"&&e!==null&&"type"in e&&"message"in e}reportError(e){if(!I.instance)throw new Error("ErrorMonitor未初始化,请先调用initialize方法");const r=this.normalizeError(e);console.log("errorInfo",r),this.report(r)}static initialize(e){if(I.instance)throw new Error("ErrorMonitor已经初始化,请勿重复初始化");return I.instance=new I(e),I.instance}static destroy(){I.instance&&(I.instance=null)}static captureError(e){I.getInstance().reportError(e)}emitError(e){this.event.emit(this.ERROR_REPORTED,e)}async getErrorSource(e){return this.source.getErrorSource(e)}get env(){return this.options.env}};G(I,"instance",null);let he=I;class ze{constructor(e){G(this,"name","VueError");G(this,"app");this.app=e}install(e){e.env==="production"&&(this.app.config.errorHandler=async r=>{const n=await e.getErrorSource(r);console.log(n),e.emitError({type:r.name,message:r.message,stack:r.stack,source:n})})}}function de(){return{url:window.location.href,userAgent:navigator.userAgent,screenSize:`${window.screen.width}x${window.screen.height}`,timestamp:Date.now()}}class xe{constructor(){G(this,"name","BrowserError");G(this,"monitor",null)}install(e){this.monitor=e,window.addEventListener("error",r=>{this.handleJsError(r)},!0),window.addEventListener("unhandledrejection",r=>{this.handlePromiseError(r)}),window.addEventListener("error",r=>{r.target&&r.target.tagName&&this.handleResourceError(r)},!0)}handleJsError(e){var n,t;const r={type:(n=e.error)==null?void 0:n.name,message:e.message,source:{fileName:e.filename,lineNumber:e.lineno,columnNumber:e.colno},stack:(t=e.error)==null?void 0:t.stack,...de()};this.monitor&&this.monitor.emitError(r)}handlePromiseError(e){var n,t;const r={type:"NetworkError",message:((n=e.reason)==null?void 0:n.message)||"Promise Error",stack:(t=e.reason)==null?void 0:t.stack,...de()};this.monitor&&this.monitor.emitError(r)}handleResourceError(e){const r=e.target,n={type:"ResourceError",message:`资源加载失败: ${r.tagName} ${r.src||r.href}`,...de()};this.monitor&&this.monitor.emitError(n)}}M.BrowserError=xe,M.ErrorMonitor=he,M.SourceError=Ae,M.VueError=ze,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
package/dist/es/src/core.mjs
CHANGED
|
@@ -87,7 +87,7 @@ const _ErrorMonitor = class _ErrorMonitor {
|
|
|
87
87
|
throw new Error("应用标识appId不能为空");
|
|
88
88
|
}
|
|
89
89
|
return {
|
|
90
|
-
env: "
|
|
90
|
+
env: "development",
|
|
91
91
|
sampleRate: 1,
|
|
92
92
|
...options
|
|
93
93
|
};
|
|
@@ -156,12 +156,13 @@ const _ErrorMonitor = class _ErrorMonitor {
|
|
|
156
156
|
if (this.isErrorInfo(error)) {
|
|
157
157
|
return {
|
|
158
158
|
...error,
|
|
159
|
-
extraInfo: this.options.extraInfo
|
|
159
|
+
extraInfo: this.options.extraInfo,
|
|
160
|
+
...this.getClientInfo()
|
|
160
161
|
};
|
|
161
162
|
}
|
|
162
163
|
if (error instanceof Error) {
|
|
163
164
|
return {
|
|
164
|
-
type:
|
|
165
|
+
type: error.name,
|
|
165
166
|
message: error.message,
|
|
166
167
|
stack: error.stack,
|
|
167
168
|
extraInfo: this.options.extraInfo,
|
|
@@ -169,7 +170,7 @@ const _ErrorMonitor = class _ErrorMonitor {
|
|
|
169
170
|
};
|
|
170
171
|
}
|
|
171
172
|
return {
|
|
172
|
-
type: "
|
|
173
|
+
type: "Error",
|
|
173
174
|
message: error,
|
|
174
175
|
extraInfo: this.options.extraInfo,
|
|
175
176
|
...this.getClientInfo()
|
|
@@ -221,6 +222,9 @@ const _ErrorMonitor = class _ErrorMonitor {
|
|
|
221
222
|
async getErrorSource(error) {
|
|
222
223
|
return this.source.getErrorSource(error);
|
|
223
224
|
}
|
|
225
|
+
get env() {
|
|
226
|
+
return this.options.env;
|
|
227
|
+
}
|
|
224
228
|
};
|
|
225
229
|
__publicField(_ErrorMonitor, "instance", null);
|
|
226
230
|
let ErrorMonitor = _ErrorMonitor;
|
|
@@ -26,14 +26,16 @@ class BrowserError {
|
|
|
26
26
|
* @param event - 错误事件对象
|
|
27
27
|
*/
|
|
28
28
|
handleJsError(event) {
|
|
29
|
-
var _a;
|
|
29
|
+
var _a, _b;
|
|
30
30
|
const errorInfo = {
|
|
31
|
-
type:
|
|
31
|
+
type: (_a = event.error) == null ? void 0 : _a.name,
|
|
32
32
|
message: event.message,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
source: {
|
|
34
|
+
fileName: event.filename,
|
|
35
|
+
lineNumber: event.lineno,
|
|
36
|
+
columnNumber: event.colno
|
|
37
|
+
},
|
|
38
|
+
stack: (_b = event.error) == null ? void 0 : _b.stack,
|
|
37
39
|
...getClientInfo()
|
|
38
40
|
};
|
|
39
41
|
if (this.monitor)
|
|
@@ -46,7 +48,7 @@ class BrowserError {
|
|
|
46
48
|
handlePromiseError(event) {
|
|
47
49
|
var _a, _b;
|
|
48
50
|
const errorInfo = {
|
|
49
|
-
type: "
|
|
51
|
+
type: "NetworkError",
|
|
50
52
|
message: ((_a = event.reason) == null ? void 0 : _a.message) || "Promise Error",
|
|
51
53
|
stack: (_b = event.reason) == null ? void 0 : _b.stack,
|
|
52
54
|
...getClientInfo()
|
|
@@ -61,7 +63,7 @@ class BrowserError {
|
|
|
61
63
|
handleResourceError(event) {
|
|
62
64
|
const target = event.target;
|
|
63
65
|
const errorInfo = {
|
|
64
|
-
type: "
|
|
66
|
+
type: "ResourceError",
|
|
65
67
|
message: `资源加载失败: ${target.tagName} ${target.src || target.href}`,
|
|
66
68
|
...getClientInfo()
|
|
67
69
|
};
|
|
@@ -8,11 +8,18 @@ class VueError {
|
|
|
8
8
|
this.app = app;
|
|
9
9
|
}
|
|
10
10
|
install(monitor) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
if (monitor.env === "production") {
|
|
12
|
+
this.app.config.errorHandler = async (error) => {
|
|
13
|
+
const source = await monitor.getErrorSource(error);
|
|
14
|
+
console.log(source);
|
|
15
|
+
monitor.emitError({
|
|
16
|
+
type: error.name,
|
|
17
|
+
message: error.message,
|
|
18
|
+
stack: error.stack,
|
|
19
|
+
source
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
}
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
25
|
export {
|
package/dist/lib/src/core.js
CHANGED
|
@@ -89,7 +89,7 @@ const _ErrorMonitor = class _ErrorMonitor {
|
|
|
89
89
|
throw new Error("应用标识appId不能为空");
|
|
90
90
|
}
|
|
91
91
|
return {
|
|
92
|
-
env: "
|
|
92
|
+
env: "development",
|
|
93
93
|
sampleRate: 1,
|
|
94
94
|
...options
|
|
95
95
|
};
|
|
@@ -158,12 +158,13 @@ const _ErrorMonitor = class _ErrorMonitor {
|
|
|
158
158
|
if (this.isErrorInfo(error)) {
|
|
159
159
|
return {
|
|
160
160
|
...error,
|
|
161
|
-
extraInfo: this.options.extraInfo
|
|
161
|
+
extraInfo: this.options.extraInfo,
|
|
162
|
+
...this.getClientInfo()
|
|
162
163
|
};
|
|
163
164
|
}
|
|
164
165
|
if (error instanceof Error) {
|
|
165
166
|
return {
|
|
166
|
-
type:
|
|
167
|
+
type: error.name,
|
|
167
168
|
message: error.message,
|
|
168
169
|
stack: error.stack,
|
|
169
170
|
extraInfo: this.options.extraInfo,
|
|
@@ -171,7 +172,7 @@ const _ErrorMonitor = class _ErrorMonitor {
|
|
|
171
172
|
};
|
|
172
173
|
}
|
|
173
174
|
return {
|
|
174
|
-
type: "
|
|
175
|
+
type: "Error",
|
|
175
176
|
message: error,
|
|
176
177
|
extraInfo: this.options.extraInfo,
|
|
177
178
|
...this.getClientInfo()
|
|
@@ -223,6 +224,9 @@ const _ErrorMonitor = class _ErrorMonitor {
|
|
|
223
224
|
async getErrorSource(error) {
|
|
224
225
|
return this.source.getErrorSource(error);
|
|
225
226
|
}
|
|
227
|
+
get env() {
|
|
228
|
+
return this.options.env;
|
|
229
|
+
}
|
|
226
230
|
};
|
|
227
231
|
__publicField(_ErrorMonitor, "instance", null);
|
|
228
232
|
let ErrorMonitor = _ErrorMonitor;
|
|
@@ -28,14 +28,16 @@ class BrowserError {
|
|
|
28
28
|
* @param event - 错误事件对象
|
|
29
29
|
*/
|
|
30
30
|
handleJsError(event) {
|
|
31
|
-
var _a;
|
|
31
|
+
var _a, _b;
|
|
32
32
|
const errorInfo = {
|
|
33
|
-
type:
|
|
33
|
+
type: (_a = event.error) == null ? void 0 : _a.name,
|
|
34
34
|
message: event.message,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
source: {
|
|
36
|
+
fileName: event.filename,
|
|
37
|
+
lineNumber: event.lineno,
|
|
38
|
+
columnNumber: event.colno
|
|
39
|
+
},
|
|
40
|
+
stack: (_b = event.error) == null ? void 0 : _b.stack,
|
|
39
41
|
...utils.getClientInfo()
|
|
40
42
|
};
|
|
41
43
|
if (this.monitor)
|
|
@@ -48,7 +50,7 @@ class BrowserError {
|
|
|
48
50
|
handlePromiseError(event) {
|
|
49
51
|
var _a, _b;
|
|
50
52
|
const errorInfo = {
|
|
51
|
-
type: "
|
|
53
|
+
type: "NetworkError",
|
|
52
54
|
message: ((_a = event.reason) == null ? void 0 : _a.message) || "Promise Error",
|
|
53
55
|
stack: (_b = event.reason) == null ? void 0 : _b.stack,
|
|
54
56
|
...utils.getClientInfo()
|
|
@@ -63,7 +65,7 @@ class BrowserError {
|
|
|
63
65
|
handleResourceError(event) {
|
|
64
66
|
const target = event.target;
|
|
65
67
|
const errorInfo = {
|
|
66
|
-
type: "
|
|
68
|
+
type: "ResourceError",
|
|
67
69
|
message: `资源加载失败: ${target.tagName} ${target.src || target.href}`,
|
|
68
70
|
...utils.getClientInfo()
|
|
69
71
|
};
|
|
@@ -10,11 +10,18 @@ class VueError {
|
|
|
10
10
|
this.app = app;
|
|
11
11
|
}
|
|
12
12
|
install(monitor) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
if (monitor.env === "production") {
|
|
14
|
+
this.app.config.errorHandler = async (error) => {
|
|
15
|
+
const source = await monitor.getErrorSource(error);
|
|
16
|
+
console.log(source);
|
|
17
|
+
monitor.emitError({
|
|
18
|
+
type: error.name,
|
|
19
|
+
message: error.message,
|
|
20
|
+
stack: error.stack,
|
|
21
|
+
source
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
}
|
|
18
25
|
}
|
|
19
26
|
}
|
|
20
27
|
exports.VueError = VueError;
|
package/dist/types/src/core.d.ts
CHANGED
|
@@ -96,4 +96,5 @@ export declare class ErrorMonitor {
|
|
|
96
96
|
static captureError(error: ErrorInfo | Error | string): void;
|
|
97
97
|
emitError(error: ErrorInfo | Error | string): void;
|
|
98
98
|
getErrorSource(error: Error | null | undefined): Promise<ErrorSourceInfo | null>;
|
|
99
|
+
get env(): "production" | "development";
|
|
99
100
|
}
|
|
@@ -1,4 +1,52 @@
|
|
|
1
1
|
import { ErrorMonitor } from './core';
|
|
2
|
+
declare const FrontendErrorTypes: {
|
|
3
|
+
readonly Error: "基础错误类型";
|
|
4
|
+
readonly EvalError: "Eval函数执行错误";
|
|
5
|
+
readonly RangeError: "数值超出有效范围错误";
|
|
6
|
+
readonly ReferenceError: "无效引用错误";
|
|
7
|
+
readonly SyntaxError: "语法解析错误";
|
|
8
|
+
readonly TypeError: "变量或参数类型无效错误";
|
|
9
|
+
readonly URIError: "URI处理函数使用错误";
|
|
10
|
+
readonly AggregateError: "多个错误组合错误";
|
|
11
|
+
readonly NetworkError: "网络请求失败";
|
|
12
|
+
readonly TimeoutError: "请求超时错误";
|
|
13
|
+
readonly AbortError: "请求被中止错误";
|
|
14
|
+
readonly CORSError: "跨域资源共享错误";
|
|
15
|
+
readonly HTTPError: "HTTP协议错误";
|
|
16
|
+
readonly ReactError: "React框架相关错误";
|
|
17
|
+
readonly VueError: "Vue框架相关错误";
|
|
18
|
+
readonly AngularError: "Angular框架相关错误";
|
|
19
|
+
readonly StateError: "状态管理错误";
|
|
20
|
+
readonly PropsError: "组件属性错误";
|
|
21
|
+
readonly LifecycleError: "生命周期错误";
|
|
22
|
+
readonly DOMException: "DOM操作异常";
|
|
23
|
+
readonly DOMError: "DOM操作错误(已废弃)";
|
|
24
|
+
readonly ResourceError: "资源加载失败";
|
|
25
|
+
readonly ImageLoadError: "图片加载失败";
|
|
26
|
+
readonly ScriptLoadError: "脚本加载失败";
|
|
27
|
+
readonly StyleLoadError: "样式加载失败";
|
|
28
|
+
readonly FontLoadError: "字体加载失败";
|
|
29
|
+
readonly ValidationError: "数据验证失败";
|
|
30
|
+
readonly FormError: "表单处理错误";
|
|
31
|
+
readonly InputError: "输入数据错误";
|
|
32
|
+
readonly RoutingError: "路由处理错误";
|
|
33
|
+
readonly NavigationError: "导航错误";
|
|
34
|
+
readonly RouteNotFoundError: "路由未找到错误";
|
|
35
|
+
readonly AuthError: "认证错误";
|
|
36
|
+
readonly PermissionError: "权限不足错误";
|
|
37
|
+
readonly UnauthorizedError: "未授权访问错误";
|
|
38
|
+
readonly BusinessError: "业务逻辑错误";
|
|
39
|
+
readonly APIError: "API接口错误";
|
|
40
|
+
readonly ServiceError: "服务调用错误";
|
|
41
|
+
readonly StorageError: "本地存储错误";
|
|
42
|
+
readonly IndexedDBError: "IndexedDB操作错误";
|
|
43
|
+
readonly WebSocketError: "WebSocket连接错误";
|
|
44
|
+
readonly WorkerError: "Web Worker错误";
|
|
45
|
+
readonly PaymentError: "支付处理错误";
|
|
46
|
+
readonly MediaError: "媒体资源错误";
|
|
47
|
+
readonly UnknownError: "未知错误";
|
|
48
|
+
};
|
|
49
|
+
export type ErrorType = keyof typeof FrontendErrorTypes;
|
|
2
50
|
export interface Integration {
|
|
3
51
|
name: string;
|
|
4
52
|
install: (monitor: ErrorMonitor) => void;
|
|
@@ -15,11 +63,9 @@ export interface BreadcrumbItem {
|
|
|
15
63
|
timestamp: number;
|
|
16
64
|
}
|
|
17
65
|
export interface ErrorInfo extends Partial<ClientInfo> {
|
|
18
|
-
type:
|
|
66
|
+
type: ErrorType;
|
|
19
67
|
message: string;
|
|
20
|
-
|
|
21
|
-
lineno?: number;
|
|
22
|
-
colno?: number;
|
|
68
|
+
source?: ErrorSourceInfo;
|
|
23
69
|
stack?: string;
|
|
24
70
|
extraInfo?: Record<string, any>;
|
|
25
71
|
}
|
|
@@ -38,3 +84,4 @@ export interface ErrorSourceInfo {
|
|
|
38
84
|
columnNumber: number;
|
|
39
85
|
sourceContent?: string;
|
|
40
86
|
}
|
|
87
|
+
export {};
|