/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@gdyfe/reporter@1.2.14/esm/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import*as Sentry from"@sentry/browser";import ReporterBasic from"./basic";class Reporter extends ReporterBasic{constructor(e){const n={dsn:"",version:"1.0.0",env:"",appid:"",uin:0,name:"",isAjax:!0,isError:!0,isCookies:!0,timeOut:300,filterUrls:[],apiRules:[],usedCookies:[]};Object.assign(n,e),n.filterUrls=n.filterUrls.concat(["/sockjs-node/info","arms-retcode.aliyuncs.com","aliyuncs.com","ynuf.aliapp.org","sentry.guangdianyun.tv"]),n.apiRules=n.apiRules.concat([{url:"guangdianyun.tv",rules:[{name:"code",permission:[200]},{name:"data",permission:[]},{name:"errorCode",permission:[0]},{name:"errorMessage",permission:[]}]}]),n.usedCookies=n.usedCookies.concat(["CONSOLE_TOKEN_GDY"]),super(n),this.options=n,console.log(this.options);let t="";switch(this.options.env){case"TEST":t="development";break;case"PRE":t="preview";break;default:t="production"}Sentry.init({dsn:this.options.dsn,release:this.options.version,environment:t}),Sentry.setUser({AppId:this.options.appid,Uin:this.options.uin,Name:this.options.name,Environment:t}),Sentry.setTag("Uin",String(this.options.uin)),Sentry.setTag("Appid",this.options.appid)}static getInstance(e){return this.singleInstance||(this.singleInstance=new Reporter(e)),this.singleInstance}init(e){const n={dsn:"",version:"1.0.0",env:""};Object.assign(n,e);let t="";switch(n.env){case"TEST":t="development";break;case"PRE":t="preview";break;default:t="production"}Sentry.init({dsn:String(n.dsn),release:n.version,environment:t})}setUser(e,n,t="",r=""){let s="";switch(r){case"TEST":s="development";break;case"PRE":s="preview";break;default:s="production"}Sentry.setUser({AppId:e,Uin:n,Name:t,Environment:s})}api(e,n,t,r={}){Sentry.configureScope((function(t){t.setTag("appid",e),t.setTag("uin",String(n))})),Sentry.setTag("Uin",String(n)),Sentry.setTag("Appid",e),Sentry.setExtra("data",r),Sentry.captureException(new Error(`API 手动捕捉 ${t}`))}info(e,n,t="Info",r={}){Sentry.configureScope((function(t){t.setTag("appid",e),t.setTag("uin",String(n))})),Sentry.setTag("Uin",String(n)),Sentry.setTag("Appid",e),Sentry.setExtra("data",r),Sentry.captureMessage(t)}error(e,n,t="New Error",r={}){Sentry.configureScope((function(t){t.setTag("appid",e),t.setTag("uin",String(n))})),Sentry.setTag("Uin",String(n)),Sentry.setTag("Appid",e),Sentry.setExtra("data",r),Sentry.captureException(new Error(t))}}Reporter.singleInstance=null;const reporter=e=>Reporter.getInstance(e);export default reporter;
//# sourceMappingURL=/sm/95bcaf681b3549b2f457879f518c590a4f22c2389f6f3531a44eb692e5c1e694.map