filesbox/web/dist/design/designstatic/common/js/sentry.js

8 lines
50 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
/*! @sentry/browser 5.5.0 (994247d6) | https://github.com/getsentry/sentry-javascript */var Sentry=function(f){var St=function(e,t){return(St=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])})(e,t)};function Y(e,t){function n(){this.constructor=e}St(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var xt,F,M,g=function(){return(g=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function wt(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function x(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(wt(arguments[t]));return e}(function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Debug=2]="Debug",e[e.Verbose=3]="Verbose"})(xt||(xt={})),(F=f.Severity||(f.Severity={})).Fatal="fatal",F.Error="error",F.Warning="warning",F.Log="log",F.Info="info",F.Debug="debug",F.Critical="critical",function(e){e.fromString=function(t){switch(t){case"debug":return e.Debug;case"info":return e.Info;case"warn":case"warning":return e.Warning;case"error":return e.Error;case"fatal":return e.Fatal;case"critical":return e.Critical;case"log":default:return e.Log}}}(f.Severity||(f.Severity={})),(M=f.Status||(f.Status={})).Unknown="unknown",M.Skipped="skipped",M.Success="success",M.RateLimit="rate_limit",M.Invalid="invalid",M.Failed="failed",function(e){e.fromHttpCode=function(t){return t>=200&&t<300?e.Success:t===429?e.RateLimit:t>=400&&t<500?e.Invalid:t>=500?e.Failed:e.Unknown}}(f.Status||(f.Status={}));var ie=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){return e.__proto__=t,e}:function(e,t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n]);return e}),C=function(e){function t(n){var r=this.constructor,o=e.call(this,n)||this;return o.message=n,o.name=r.prototype.constructor.name,ie(o,r.prototype),o}return Y(t,e),t}(Error);function nt(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}}function rt(e){return Object.prototype.toString.call(e)==="[object ErrorEvent]"}function kt(e){return Object.prototype.toString.call(e)==="[object DOMError]"}function X(e){return Object.prototype.toString.call(e)==="[object String]"}function ot(e){return e===null||typeof e!="object"&&typeof e!="function"}function Ot(e){return Object.prototype.toString.call(e)==="[object Object]"}function it(e){return Boolean(e&&e.then&&typeof e.then=="function")}var se={};function b(){return Object.prototype.toString.call(typeof process!="undefined"?process:0)==="[object process]"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:se}function B(){var e=b(),t=e.crypto||e.msCrypto;if(t!==void 0&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(o){for(var i=o.toString(16);i.length<4;)i="0"+i;return i};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(o){var i=16*Math.random()|0;return(o==="x"?i:3&i|8).toString(16)})}function st(e){if(!e)return{};var t=e.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}function U(e){if(e.message)return e.message;if(e.exception&&e.exception.values&&e.exception.values[0]){var t=e.exception.values[0];return t.type&&t.value?t.type+": "+t.value:t.type||t.value||e.event_id||"<unknown>"}return e.event_id||"<unknown>"}function V(e){var t=b();if(!("console"in t))return e();var n=t.console,r={};["debug","info","warn","error","log","assert"].forEach(function(i){i
Event: `+U(t)),!0):this.wn(t,n)?(y.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+U(t)),!0):this.gn(t,n)?(y.warn("Event dropped due to being matched by `blacklistUrls` option.\nEvent: "+U(t)+`.
Url: `+this.En(t)),!0):!this.xn(t,n)&&(y.warn("Event dropped due to not being matched by `whitelistUrls` option.\nEvent: "+U(t)+`.
Url: `+this.En(t)),!0)},e.prototype.bn=function(t,n){if(n===void 0&&(n={}),!n.ignoreInternal)return!1;try{return t.exception.values[0].type==="SentryError"}catch(r){return!1}},e.prototype.wn=function(t,n){return n===void 0&&(n={}),!(!n.ignoreErrors||!n.ignoreErrors.length)&&this.jn(t).some(function(r){return n.ignoreErrors.some(function(o){return ut(r,o)})})},e.prototype.gn=function(t,n){if(n===void 0&&(n={}),!n.blacklistUrls||!n.blacklistUrls.length)return!1;var r=this.En(t);return!!r&&n.blacklistUrls.some(function(o){return ut(r,o)})},e.prototype.xn=function(t,n){if(n===void 0&&(n={}),!n.whitelistUrls||!n.whitelistUrls.length)return!0;var r=this.En(t);return!r||n.whitelistUrls.some(function(o){return ut(r,o)})},e.prototype.mn=function(t){return t===void 0&&(t={}),{blacklistUrls:x(this.in.blacklistUrls||[],t.blacklistUrls||[]),ignoreErrors:x(this.in.ignoreErrors||[],t.ignoreErrors||[],_e),ignoreInternal:this.in.ignoreInternal===void 0||this.in.ignoreInternal,whitelistUrls:x(this.in.whitelistUrls||[],t.whitelistUrls||[])}},e.prototype.jn=function(t){if(t.message)return[t.message];if(t.exception)try{var n=t.exception.values[0],r=n.type,o=n.value;return[""+o,r+": "+o]}catch(i){return y.error("Cannot extract message for event "+U(t)),[]}return[]},e.prototype.En=function(t){try{if(t.stacktrace){var n=t.stacktrace.frames;return n[n.length-1].filename}if(t.exception){var r=t.exception.values[0].stacktrace.frames;return r[r.length-1].filename}return null}catch(o){return y.error("Cannot extract url for event "+U(t)),null}},e.id="InboundFilters",e}(),Ee=Object.freeze({FunctionToString:Ht,InboundFilters:qt}),q=b(),k={_n:!1,Sn:!1,On:!1,kn:!1},I="?",be=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function Wt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Yt(){return typeof document=="undefined"||document.location==null?"":document.location.href}k._n=function(){var e,t,n=[],r=null,o=null;function i(c,l,h){var d=null;if(!l||k.Sn){for(var v in n)if(Wt(n,v))try{n[v](c,l,h)}catch(m){d=m}if(d)throw d}}function s(c,l,h,d,v){var m=null;if(v=rt(v)?v.error:v,c=rt(c)?c.message:c,o)k.On.Tn(o,l,h,c),u();else if(v&&nt(v))(m=k.On(v)).mechanism="onerror",i(m,!0,v);else{var O,T={url:l,line:h,column:d},j=c;if({}.toString.call(c)==="[object String]"){var bt=c.match(be);bt&&(O=bt[1],j=bt[2])}T.func=I,T.context=null,i(m={name:O,message:j,mode:"onerror",mechanism:"onerror",stack:[g({},T,{url:T.url||Yt()})]},!0,null)}return!!e&&e.apply(this,arguments)}function a(c){var l=c&&(c.detail?c.detail.reason:c.reason)||c,h=k.On(l);h.mechanism="onunhandledrejection",h.message||(h.message=JSON.stringify(w(l))),i(h,!0,l)}function u(){var c=o,l=r;o=null,r=null,i(c,!1,l)}function p(c){if(o){if(r===c)return;u()}var l=k.On(c);throw o=l,r=c,setTimeout(function(){r===c&&u()},l.incomplete?2e3:0),c}return p.Rn=function(c){n.push(c)},p.Dn=function(){t!==!0&&(e=q.onerror,q.onerror=s,t=!0)},p.In=function(){q.onunhandledrejection=a},p}(),k.On=function(){function e(o){if(!o||!o.stack)return null;for(var i,s,a,u=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,p=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,c=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,l=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,h=/\((\S*)(?::(\d+))(?::(\d+))\)/,d=o.stack.split(`
`),v=[],m=/^(.*) is undefined$/.exec(o.message),O=0,T=d.length;O<T;++O){if(s=u.exec(d[O])){var j=s[2]&&s[2].indexOf("native")===0;s[2]&&s[2].indexOf("eval")===0&&(i=h.exec(s[2]))&&(s[2]=i[1],s[3]=i[2],s[4]=i[3]),a={url:s[2],func:s[1]||I,args:j?[s[2]]:[],line:s[3]?+s[3]:null,column:s[4]?+s[4]:null}}else if(s=c.exec(d[O]))a={url:s[2],func:s[1]||I,args:[],line:+s[3],column:s[4]?+s[4]:null};else{if(!(s=p.exec(d[O])))continue;s[3]&&s[3].indexOf(" > eval")>-1&&(i=l.exec(s[3]))?(s[1]=s[1]||"eval",s[3]=i[1],s[4]=i[2],s[5]=""):O!==0||s[5]||o.columnNumber===void 0||(v[0].column=o.columnNumber+1),a={url:s[3],func:s[1]||I,args:s[2]?s[2].split(","):[],line:s[4]?+s[4]:null,column:s[5]?+s[5]:null}}!a.func&&a.line&&(a.func=I),a.context=null,v.push(a)}return v.length?(v[0]&&v[0].line&&!v[0].column&&m&&(v[0].column=null),{mode:"stack",name:o.name,message:o.message,stack:v}):null}function t(o,i,s,a){var u={url:i,line:s};if(u.url&&u.line){if(o.incomplete=!1,u.func||(u.func=I),u.context||(u.context=null),/ '([^']+)' /.exec(a)&&(u.column=null),o.stack.length>0&&o.stack[0].url===u.url){if(o.stack[0].line===u.line)return!1;if(!o.stack[0].line&&o.stack[0].func===u.func)return o.stack[0].line=u.line,o.stack[0].context=u.context,!1}return o.stack.unshift(u),o.partial=!0,!0}return o.incomplete=!0,!1}function n(o,i){for(var s,a,u=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,p=[],c={},l=!1,h=n.caller;h&&!l;h=h.caller)if(h!==W&&h!==k._n){if(a={url:null,func:I,args:[],line:null,column:null},h.name?a.func=h.name:(s=u.exec(h.toString()))&&(a.func=s[1]),a.func===void 0)try{a.func=s.input.substring(0,s.input.indexOf("{"))}catch(v){}c[""+h]?l=!0:c[""+h]=!0,p.push(a)}i&&p.splice(0,i);var d={mode:"callers",name:o.name,message:o.message,stack:p};return t(d,o.sourceURL||o.fileName,o.line||o.lineNumber,o.message||o.description),d}function r(o,i){var s=null;i=i==null?0:+i;try{if(s=function(a){var u=a.stacktrace;if(u){for(var p,c=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,l=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,h=u.split(`
`),d=[],v=0;v<h.length;v+=2){var m=null;(p=c.exec(h[v]))?m={url:p[2],line:+p[1],column:null,func:p[3],args:[]}:(p=l.exec(h[v]))&&(m={url:p[6],line:+p[1],column:+p[2],func:p[3]||p[4],args:p[5]?p[5].split(","):[]}),m&&(!m.func&&m.line&&(m.func=I),m.line&&(m.context=null),m.context||(m.context=[h[v+1]]),d.push(m))}return d.length?{mode:"stacktrace",name:a.name,message:a.message,stack:d}:null}}(o))return s}catch(a){}try{if(s=e(o))return s}catch(a){}try{if(s=function(a){var u=a.message.split(`
`);if(u.length<4)return null;var p,c=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,l=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,h=/^\s*Line (\d+) of function script\s*$/i,d=[],v=q&&q.document&&q.document.getElementsByTagName("script"),m=[];for(var O in v)Wt(v,O)&&!v[O].src&&m.push(v[O]);for(var T=2;T<u.length;T+=2){var j=null;(p=c.exec(u[T]))?j={url:p[2],func:p[3],args:[],line:+p[1],column:null}:(p=l.exec(u[T]))?j={url:p[3],func:p[4],args:[],line:+p[1],column:null}:(p=h.exec(u[T]))&&(j={url:Yt().replace(/#.*$/,""),func:"",args:[],line:p[1],column:null}),j&&(j.func||(j.func=I),j.context=[u[T+1]],d.push(j))}return d.length?{mode:"multiline",name:a.name,message:u[0],stack:d}:null}(o))return s}catch(a){}try{if(s=n(o,i+1))return s}catch(a){}return{original:o,name:o.name,message:o.message,mode:"failed"}}return r.Tn=t,r.Cn=e,r}(),k.Sn=!0,k.kn=11;var Se=k._n.Rn,xe=k._n.Dn,we=k._n.In,W=k.On,ke=50;function $t(e){var t=ft(e.stack),n={type:e.name,value:e.message};return t&&t.length&&(n.stacktrace={frames:t}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function ht(e){return{exception:{values:[$t(e)]}}}function ft(e){if(!e||!e.length)return[];var t=e,n=t[0].func||"",r=t[t.length-1].func||"";return(n.includes("captureMessage")||n.includes("captureException"))&&(t=t.slice(1)),r.includes("sentryWrapped")&&(t=t.slice(0,-1)),t.map(function(o){return{colno:o.column,filename:o.url||t[0].url,function:o.func||"?",in_app:!0,lineno:o.line}}).slice(0,ke).reverse()}var G,Jt,dt=function(){function e(t){this.options=t,this.h=new pe(30),this.url=new Z(this.options.dsn).getStoreEndpointWithUrlEncodedAuth()}return e.prototype.sendEvent=function(t){throw new C("Transport Class has to implement `sendEvent` method")},e.prototype.close=function(t){return this.h.drain(t)},e}(),Oe=b(),Gt=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Y(t,e),t.prototype.sendEvent=function(n){var r={body:JSON.stringify(n),method:"POST",referrerPolicy:he()?"origin":""};return this.h.add(Oe.fetch(this.url,r).then(function(o){return{status:f.Status.fromHttpCode(o.status)}}))},t}(dt),Xt=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Y(t,e),t.prototype.sendEvent=function(n){var r=this;return this.h.add(new Promise(function(o,i){var s=new XMLHttpRequest;s.onreadystatechange=function(){s.readyState===4&&(s.status===200&&o({status:f.Status.fromHttpCode(s.status)}),i(s))},s.open("POST",r.url),s.send(JSON.stringify(n))}))},t}(dt),Te=Object.freeze({BaseTransport:dt,FetchTransport:Gt,XHRTransport:Xt}),je=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Y(t,e),t.prototype.pn=function(){if(!this.in.dsn)return e.prototype.pn.call(this);var n=g({},this.in.transportOptions,{dsn:this.in.dsn});return this.in.transport?new this.in.transport(n):ct()?new Gt(n):new Xt(n)},t.prototype.eventFromException=function(n,r){var o,i,s=this;if(rt(n)&&n.error)return n=n.error,o=ht(W(n)),R.resolve(this.Nn(o,r));if(kt(n)||(i=n,Object.prototype.toString.call(i)==="[object DOMException]")){var a=n,u=a.name||(kt(a)?"DOMError":"DOMException"),p=a.message?u+": "+a.message:u;return this.eventFromMessage(p,f.Severity.Error,r).then(function(l){return $(l,p),R.resolve(s.Nn(l,r))})}if(nt(n))return o=ht(W(n)),R.resolve(this.Nn(o,r));if(Ot(n)&&r&&r.syntheticException)return $(o=function(l,h){var d=Object.keys(l).sort(),v={extra:{__serialized__:Tt(l)},message:"Non-Error exception captured with keys: "+le(d)};if(h){var m=ft(W(h).stack);v.stacktrace={frames:m}}return v}(n,r.syntheticException),"Custom Object",void 0,{handled:!0,synthetic:!0,type:"generic"}),o.level=f.Severity.Error,R.resolve(this.Nn(o,r));var c=n;return this.eventFromMessage(c,void 0,r).then(function(l){return $(l,""+c,void 0,{handled:!0,synthetic:!0,type:"generic"}),l.level=f.Severity.Error,R.resolve(s.Nn(l,r))})},t.prototype.Nn=function(n,r){return g({},n,{event_id:r&&r.event_id})},t.prototype.eventFromMessage=function(n,r,o){r===void 0&&(r=