!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b13c64a9-d353-3110-ba9e-2bec9537fada")}catch(e){}}(); define(["require","exports","./e_core_exception","./c_pap-events_browse_view_folder_picker","./c_flux_action_type","./c_api_v2_routes_team_provider","./c_react-use_misc_util","./c_sentry_core_exports","./c_lodash-es_lodash"],(function(e,t,n,r,o,i,s,a,c){"use strict";const l=[{pattern:/(?(?:(?:https|http)+:\/\/)?(?:[a-zA-Z0-9-_]+\.)*(?:(dropbox|dropboxusercontent))\.com(?:\/\w+)(?:\/(?:fi|fo))?)\/.*/,replacer:(e,t)=>`${t}/[[FilePath]]`}],u=/((https|http):\/\/)?([a-zA-Z0-9-_]+\.)*dropboxstatic.com/,d=e=>!(e.startsWith("browser-id:")||e.startsWith("edison_atlasservlet:")||e.startsWith("edison_page_name:")),p=["maf_region","path_trail"];function f(e){const t={};for(const n of e)t[n.pagelet_name]=n;return t}function h(e){for(const{pattern:t,replacer:n}of l)if(e.filename){if(e.filename.match(u))return e;e.filename=e.filename.replace(t,n)}return e}function g(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:250,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;if(!(i.exception&&i.exception.values&&s&&a.isInstanceOf(s.originalException,Error)))return;const c=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;var l,u;c&&(i.exception.values=(l=m(e,t,o,s.originalException,r,i.exception.values,c,0),u=n,l.map((e=>(e.value&&(e.value=a.truncate(e.value,u)),e)))))}function m(e,t,n,r,o,i,s,c){if(i.length>=n+1)return i;let l=[...i];if(a.isInstanceOf(r[o],Error)){_(s,c);const i=e(t,r[o]),a=l.length;v(i,o,a,c),l=m(e,t,n,r[o],o,[i,...l],i,a)}return Array.isArray(r.errors)&&r.errors.forEach(((r,i)=>{if(a.isInstanceOf(r,Error)){_(s,c);const a=e(t,r),u=l.length;v(a,`errors[${i}]`,u,c),l=m(e,t,n,r,o,[a,...l],a,u)}})),l}function _(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=s._objectSpread2(s._objectSpread2(s._objectSpread2({},e.mechanism),"AggregateError"===e.type&&{is_exception_group:!0}),{},{exception_id:t})}function v(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=s._objectSpread2(s._objectSpread2({},e.mechanism),{},{type:"chained",source:t,exception_id:n,parent_id:r})}const y=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function E(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{host:n,path:r,pass:o,port:i,projectId:s,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${s}`}function S(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function b(e){const t="string"==typeof e?function(e){const t=y.exec(e);if(!t)return void a.consoleSandbox((()=>{console.error(`Invalid Sentry Dsn: ${e}`)}));const[n,r,o="",i="",s="",c=""]=t.slice(1);let l="",u=c;const d=u.split("/");if(d.length>1&&(l=d.slice(0,-1).join("/"),u=d.pop()),u){const e=u.match(/^\d+/);e&&(u=e[0])}return S({host:i,pass:o,path:l,projectId:u,port:s,protocol:n,publicKey:r})}(e):S(e);if(t&&function(e){if(!a.DEBUG_BUILD)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find((t=>!e[t]&&(a.logger.error(`Invalid Sentry Dsn: ${t} missing`),!0)))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(a.logger.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(a.logger.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(a.logger.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}class w extends Error{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"warn";super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}const x={},D={};function O(e,t){x[e]=x[e]||[],x[e].push(t)}function k(e,t){D[e]||(t(),D[e]=!0)}function I(e,t){const n=e&&x[e];if(n)for(const r of n)try{r(t)}catch(t){a.DEBUG_BUILD&&a.logger.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${a.getFunctionName(r)}\nError:`,t)}}function $(){"console"in a.GLOBAL_OBJ&&a.CONSOLE_LEVELS.forEach((function(e){e in a.GLOBAL_OBJ.console&&a.fill(a.GLOBAL_OBJ.console,e,(function(t){return a.originalConsoleMethods[e]=t,function(){for(var t=arguments.length,n=new Array(t),r=0;rfunction(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t&&!function(){if("string"==typeof EdgeRuntime)return!0;if(!j())return!1;if(B(L.fetch))return!0;let e=!1;const t=L.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=B(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){a.DEBUG_BUILD&&a.logger.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e}())return;a.fill(a.GLOBAL_OBJ,"fetch",(function(t){return function(){for(var n=arguments.length,r=new Array(n),o=0;o(e?e(t):I("fetch",s._objectSpread2(s._objectSpread2({},l),{},{endTimestamp:1e3*a.timestampInSeconds(),response:t})),t)),(e=>{throw I("fetch",s._objectSpread2(s._objectSpread2({},l),{},{endTimestamp:1e3*a.timestampInSeconds(),error:e})),a.isError(e)&&void 0===e.stack&&(e.stack=u,a.addNonEnumerableProperty(e,"framesToPop",1)),e}))}}))}(void 0,t)))}function U(e,t){return!!e&&"object"==typeof e&&!!e[t]}function N(e){return"string"==typeof e?e:e?U(e,"url")?e.url:e.toString?e.toString():"":""}let P=null;function A(){P=a.GLOBAL_OBJ.onerror,a.GLOBAL_OBJ.onerror=function(e,t,n,r,o){return I("error",{column:r,error:o,line:n,msg:e,url:t}),!(!P||P.__SENTRY_LOADER__)&&P.apply(this,arguments)},a.GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__=!0}let R=null;function C(){R=a.GLOBAL_OBJ.onunhandledrejection,a.GLOBAL_OBJ.onunhandledrejection=function(e){return I("unhandledrejection",e),!(R&&!R.__SENTRY_LOADER__)||R.apply(this,arguments)},a.GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const G=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function M(){let e="",t=!1;for(let n=arguments.length-1;n>=-1&&!t;n--){const r=n>=0?n<0||arguments.length<=n?void 0:arguments[n]:"/";r&&(e=`${r}/${e}`,t="/"===r.charAt(0))}return e=function(e,t){let n=0;for(let t=e.length-1;t>=0;t--){const r=e[t];"."===r?e.splice(t,1):".."===r?(e.splice(t,1),n++):n&&(e.splice(t,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}(e.split("/").filter((e=>!!e)),!t).join("/"),(t?"/":"")+e||"."}function F(e){let t=0;for(;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}function J(e,t){let n=function(e){const t=e.length>1024?`${e.slice(-1024)}`:e,n=G.exec(t);return n?n.slice(1):[]}(e)[2]||"";return t&&n.slice(-1*t.length)===t&&(n=n.slice(0,n.length-t.length)),n}function q(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]||Promise.resolve(void 0)}return{$:t,add:function(r){if(!(void 0===e||t.lengthn(o))).then(null,(()=>n(o).then(null,(()=>{})))),o},drain:function(e){return new a.SyncPromise(((n,r)=>{let o=t.length;if(!o)return n(!0);const i=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{a.resolvedSyncPromise(e).then((()=>{--o||(clearTimeout(i),n(!0))}),r)}))}))}}}function W(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const z=["fatal","error","warning","log","info","debug"];function K(e){return"warn"===e?"warning":z.includes(e)?e:"log"}function Y(e){return[e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]]}function H(e,t){const[n,r]=e;return[n,[...r,t]]}function V(e,t){const n=e[1];for(const e of n){if(t(e,e[0].type))return!0}return!1}function X(e){return a.GLOBAL_OBJ.__SENTRY__&&a.GLOBAL_OBJ.__SENTRY__.encodePolyfill?a.GLOBAL_OBJ.__SENTRY__.encodePolyfill(e):(new TextEncoder).encode(e)}function Z(e){const[t,n]=e;let r=JSON.stringify(t);function o(e){"string"==typeof r?r="string"==typeof e?r+e:[X(r),e]:r.push("string"==typeof e?X(e):e)}for(const e of n){const[t,n]=e;if(o(`\n${JSON.stringify(t)}\n`),"string"==typeof n||n instanceof Uint8Array)o(n);else{let e;try{e=JSON.stringify(n)}catch(t){e=JSON.stringify(a.normalize(n))}o(e)}}return"string"==typeof r?r:function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(r)}function Q(e){const t="string"==typeof e.data?X(e.data):e.data;return[a.dropUndefinedKeys({type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),t]}const ee={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function te(e){return ee[e]}function ne(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}const re=6e4;function oe(e,t){let{statusCode:n,headers:r}=t,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();const i=s._objectSpread2({},e),a=r&&r["x-sentry-rate-limits"],c=r&&r["retry-after"];if(a)for(const e of a.trim().split(",")){const[t,n,,,r]=e.split(":",5),s=parseInt(t,10),a=1e3*(isNaN(s)?60:s);if(n)for(const e of n.split(";"))"metric_bucket"===e&&r&&!r.split(";").includes("custom")||(i[e]=o+a);else i.all=o+a}else c?i.all=o+function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?re:r-t}(c,o):429===n&&(i.all=o+6e4);return i}const ie=a.GLOBAL_OBJ;function se(e,t,n,r){const o=ne(n),i=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);const c=function(e,t,n,r){const o=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return s._objectSpread2(s._objectSpread2(s._objectSpread2({event_id:e.event_id,sent_at:(new Date).toISOString()},t&&{sdk:t}),!!n&&r&&{dsn:E(r)}),o&&{trace:a.dropUndefinedKeys(s._objectSpread2({},o))})}(e,o,r,t);delete e.sdkProcessingMetadata;return Y(c,[[{type:i},e]])}const ae="7";function ce(e,t,n){return t||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){return a.urlEncode(s._objectSpread2({sentry_key:e.publicKey,sentry_version:ae},t&&{sentry_client:`${t.name}/${t.version}`}))}(e,n)}`}const le=[];function ue(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;t.forEach((e=>{e.isDefaultInstance=!0})),r=Array.isArray(n)?[...t,...n]:"function"==typeof n?a.arrayify(n(t)):t;const o=function(e){const t={};return e.forEach((e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)})),Object.values(t)}(r),i=o.findIndex((e=>"Debug"===e.name));if(i>-1){const[e]=o.splice(i,1);o.push(e)}return o}function de(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function pe(e,t,n){if(n[t.name])a.DEBUG_BUILD$1&&a.logger.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,-1===le.indexOf(t.name)&&"function"==typeof t.setupOnce&&(t.setupOnce(),le.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",((t,r)=>n(t,r,e)))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign(((t,r)=>n(t,r,e)),{id:t.name});e.addEventProcessor(r)}a.DEBUG_BUILD$1&&a.logger.log(`Integration installed: ${t.name}`)}}const fe="Not capturing exception because it's already been captured.";class he{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=b(e.dsn):a.DEBUG_BUILD$1&&a.logger.warn("No DSN provided, client will not send events."),this._dsn){const t=ce(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport(s._objectSpread2(s._objectSpread2({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{},{url:t}))}}captureException(e,t,n){const r=a.uuid4();if(a.checkOrSetAlreadyCaught(e))return a.DEBUG_BUILD$1&&a.logger.log(fe),r;const o=s._objectSpread2({event_id:r},t);return this._process(this.eventFromException(e,o).then((e=>this._captureEvent(e,o,n)))),o.event_id}captureMessage(e,t,n,r){const o=s._objectSpread2({event_id:a.uuid4()},n),i=a.isParameterizedString(e)?e:String(e),c=a.isPrimitive(e)?this.eventFromMessage(i,t,o):this.eventFromException(e,o);return this._process(c.then((e=>this._captureEvent(e,o,r)))),o.event_id}captureEvent(e,t,n){const r=a.uuid4();if(t&&t.originalException&&a.checkOrSetAlreadyCaught(t.originalException))return a.DEBUG_BUILD$1&&a.logger.log(fe),r;const o=s._objectSpread2({event_id:r},t),i=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,o,i||n)),o.event_id}captureSession(e){"string"!=typeof e.release?a.DEBUG_BUILD$1&&a.logger.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),a.updateSession(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?(this.emit("flush"),this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e))))):a.resolvedSyncPromise(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,this.emit("close"),e)))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some((e=>{let{name:t}=e;return t.startsWith("Spotlight")})))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];pe(this,e,this._integrations),t||de(this,[e])}sendEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.emit("beforeSendEvent",e,t);let n=se(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=H(n,Q(e));const r=this.sendEnvelope(n);r&&r.then((t=>this.emit("afterSendEvent",e,t)),null)}sendSession(e){const t=function(e,t,n,r){const o=ne(n);return Y(s._objectSpread2(s._objectSpread2({sent_at:(new Date).toISOString()},o&&{sdk:o}),!!r&&t&&{dsn:E(t)}),["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const r="number"==typeof n?n:1,o=`${e}:${t}`;a.DEBUG_BUILD$1&&a.logger.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(e,t){const n=this._hooks[e]=this._hooks[e]||[];return n.push(t),()=>{const e=n.indexOf(t);e>-1&&n.splice(e,1)}}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;re(...n)))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,(e=>(a.DEBUG_BUILD$1&&a.logger.error("Error while sending event:",e),e))):(a.DEBUG_BUILD$1&&a.logger.error("Transport disabled"),a.resolvedSyncPromise({}))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach((t=>{t&&pe(e,t,n)})),n}(this,e),de(this,e)}_updateSessionFromEvent(e,t){let n=!1,r=!1;const o=t.exception&&t.exception.values;if(o){r=!0;for(const e of o){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const i="ok"===e.status;(i&&0===e.errors||i&&n)&&(a.updateSession(e,s._objectSpread2(s._objectSpread2({},n&&{status:"crashed"}),{},{errors:e.errors||Number(r||n)})),this.captureSession(e))}_isClientDoneProcessing(e){return new a.SyncPromise((t=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.getIsolationScope();const o=this.getOptions(),i=Object.keys(this._integrations);return!t.integrations&&i.length>0&&(t.integrations=i),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),a.prepareEvent(o,e,t,n,this,r).then((e=>{if(null===e)return e;const t=s._objectSpread2(s._objectSpread2({},r.getPropagationContext()),n?n.getPropagationContext():void 0);if(!(e.contexts&&e.contexts.trace)&&t){const{traceId:n,spanId:r,parentSpanId:o,dsc:i}=t;e.contexts=s._objectSpread2({trace:a.dropUndefinedKeys({trace_id:n,span_id:r,parent_span_id:o})},e.contexts);const c=i||a.getDynamicSamplingContextFromClient(n,this);e.sdkProcessingMetadata=s._objectSpread2({dynamicSamplingContext:c},e.sdkProcessingMetadata)}return e}))}_captureEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return this._processEvent(e,t,n).then((e=>e.event_id),(e=>{if(a.DEBUG_BUILD$1){const t=e;"log"===t.logLevel?a.logger.log(t.message):a.logger.warn(t)}}))}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:o}=r,i=me(e),c=ge(e),l=e.type||"error",u=`before send for type \`${l}\``,d=void 0===o?void 0:function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;if(!("number"!=typeof t||isNaN(t)||t<0||t>1))return t;a.DEBUG_BUILD$1&&a.logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`)}(o);if(c&&"number"==typeof d&&Math.random()>d)return this.recordDroppedEvent("sample_rate","error",e),a.rejectedSyncPromise(new w(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"));const p="replay_event"===l?"replay":l,f=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,n,f).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",p,e),new w("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;const o=function(e,t,n,r){const{beforeSend:o,beforeSendTransaction:i,beforeSendSpan:a}=t;if(ge(n)&&o)return o(n,r);if(me(n)){if(n.spans&&a){const t=[];for(const r of n.spans){const n=a(r);n?t.push(n):e.recordDroppedEvent("before_send","span")}n.spans=t}if(i){if(n.spans){const e=n.spans.length;n.sdkProcessingMetadata=s._objectSpread2(s._objectSpread2({},n.sdkProcessingMetadata),{},{spanCountBeforeProcessing:e})}return i(n,r)}}return n}(this,r,n,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(a.isThenable(e))return e.then((e=>{if(!a.isPlainObject(e)&&null!==e)throw new w(n);return e}),(e=>{throw new w(`${t} rejected with ${e}`)}));if(!a.isPlainObject(e)&&null!==e)throw new w(n);return e}(o,u)})).then((r=>{if(null===r){if(this.recordDroppedEvent("before_send",p,e),i){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw new w(`${u} returned \`null\`, will not send event.`,"log")}const o=n&&n.getSession();if(!i&&o&&this._updateSessionFromEvent(o,r),i){const e=(r.sdkProcessingMetadata&&r.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(r.spans?r.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const a=r.transaction_info;if(i&&a&&r.transaction!==e.transaction){const e="custom";r.transaction_info=s._objectSpread2(s._objectSpread2({},a),{},{source:e})}return this.sendEvent(r,t),r})).then(null,(e=>{if(e instanceof w)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new w(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){this._numProcessing++,e.then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e)))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map((e=>{let[t,n]=e;const[r,o]=t.split(":");return{reason:r,category:o,quantity:n}}))}_flushOutcomes(){a.DEBUG_BUILD$1&&a.logger.log("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(a.DEBUG_BUILD$1&&a.logger.log("No outcomes to send"));if(!this._dsn)return void(a.DEBUG_BUILD$1&&a.logger.log("No dsn provided, will not send outcomes"));a.DEBUG_BUILD$1&&a.logger.log("Sending outcomes:",e);const t=(n=e,Y((r=this._options.tunnel&&E(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:o||a.dateTimestampInSeconds(),discarded_events:n}]]));var n,r,o;this.sendEnvelope(t)}}function ge(e){return void 0===e.type}function me(e){return"transaction"===e.type}function _e(e,t){!0===t.debug&&(a.DEBUG_BUILD$1?a.logger.enable():a.consoleSandbox((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})));a.getCurrentScope().update(t.initialScope);const n=new e(t);return function(e){a.getCurrentScope().setClient(e)}(n),n.init(),n}const ve=64;function ye(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:q(e.bufferSize||ve),r={};return{send:function(o){const i=[];if(V(o,((t,n)=>{const o=te(n);if(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,o)){const r=Ee(t,n);e.recordDroppedEvent("ratelimit_backoff",o,r)}else i.push(t)})),0===i.length)return a.resolvedSyncPromise({});const s=Y(o[0],i),c=t=>{V(s,((n,r)=>{const o=Ee(n,r);e.recordDroppedEvent(t,te(r),o)}))};return n.add((()=>t({body:Z(s)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&a.DEBUG_BUILD$1&&a.logger.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=oe(r,e),e)),(e=>{throw c("network_error"),e})))).then((e=>e),(e=>{if(e instanceof w)return a.DEBUG_BUILD$1&&a.logger.error("Skipped sending event because buffer is full."),c("queue_overflow"),a.resolvedSyncPromise({});throw e}))},flush:e=>n.drain(e)}}function Ee(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}const Se=100;function be(e,t){const n=a.getClient(),r=a.getIsolationScope();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:i=Se}=n.getOptions();if(i<=0)return;const c=a.dateTimestampInSeconds(),l=s._objectSpread2({timestamp:c},e),u=o?a.consoleSandbox((()=>o(l,t))):l;null!==u&&(n.emit&&n.emit("beforeAddBreadcrumb",u,t),r.addBreadcrumb(u,i))}let we;const xe=new WeakMap,De=()=>({name:"FunctionToString",setupOnce(){we=Function.prototype.toString;try{Function.prototype.toString=function(){const e=a.getOriginalFunction(this),t=xe.has(a.getClient())&&void 0!==e?e:this;for(var n=arguments.length,r=new Array(n),o=0;o0&&void 0!==arguments[0]?arguments[0]:{};return{name:"InboundFilters",processEvent(t,n,r){const o=r.getOptions(),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Oe],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,o);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return a.DEBUG_BUILD$1&&a.logger.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${a.getEventDescription(e)}`),!0;if(function(e,t){if(e.type||!t||!t.length)return!1;return function(e){const t=[];e.message&&t.push(e.message);let n;try{n=e.exception.values[e.exception.values.length-1]}catch(e){}n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`));return t}(e).some((e=>a.stringMatchesSomePattern(e,t)))}(e,t.ignoreErrors))return a.DEBUG_BUILD$1&&a.logger.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${a.getEventDescription(e)}`),!0;if(function(e){if(e.type)return!1;if(!e.exception||!e.exception.values||0===e.exception.values.length)return!1;return!e.message&&!e.exception.values.some((e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(e))return a.DEBUG_BUILD$1&&a.logger.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${a.getEventDescription(e)}`),!0;if(function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&a.stringMatchesSomePattern(n,t)}(e,t.ignoreTransactions))return a.DEBUG_BUILD$1&&a.logger.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${a.getEventDescription(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;const n=Ie(e);return!!n&&a.stringMatchesSomePattern(n,t)}(e,t.denyUrls))return a.DEBUG_BUILD$1&&a.logger.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${a.getEventDescription(e)}.\nUrl: ${Ie(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;const n=Ie(e);return!n||a.stringMatchesSomePattern(n,t)}(e,t.allowUrls))return a.DEBUG_BUILD$1&&a.logger.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${a.getEventDescription(e)}.\nUrl: ${Ie(e)}`),!0;return!1}(t,i)?null:t}}};function Ie(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&""!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch(t){return a.DEBUG_BUILD$1&&a.logger.error(`Cannot extract url for event ${a.getEventDescription(e)}`),null}}const $e=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(e,t){if(!t)return!1;if(function(e,t){const n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!je(e,t))return!1;if(!Le(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){const n=Be(t),r=Be(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!je(e,t))return!1;if(!Le(e,t))return!1;return!0}(e,t))return!0;return!1}(t,e))return a.DEBUG_BUILD$1&&a.logger.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){}return e=t}}};function Le(e,t){let n=a.getFramesFromEvent(e),r=a.getFramesFromEvent(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:{};const t=e.root,n=e.prefix||"app:///",r="window"in a.GLOBAL_OBJ&&void 0!==a.GLOBAL_OBJ.window,o=e.iteratee||function(e){let{isBrowser:t,root:n,prefix:r}=e;return e=>{if(!e.filename)return e;const o=/^[a-zA-Z]:\\/.test(e.filename)||e.filename.includes("\\")&&!e.filename.includes("/"),i=/^\//.test(e.filename);if(t){if(n){const t=e.filename;0===t.indexOf(n)&&(e.filename=t.replace(n,r))}}else if(o||i){const t=o?e.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):e.filename,i=n?function(e,t){e=M(e).slice(1),t=M(t).slice(1);const n=F(e.split("/")),r=F(t.split("/")),o=Math.min(n.length,r.length);let i=o;for(let e=0;e{return s._objectSpread2(s._objectSpread2({},e),e.stacktrace&&{stacktrace:(t=e.stacktrace,s._objectSpread2(s._objectSpread2({},t),{},{frames:t&&t.frames&&t.frames.map((e=>o(e)))}))});var t}))})})}catch(t){return e}}(t)),t}}};const Ue=a.GLOBAL_OBJ;let Ne=0;function Pe(){return Ne>0}function Ae(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(a.getOriginalFunction(e))return e}catch(t){return e}const r=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);const o=r.map((e=>Ae(e,t)));return e.apply(this,o)}catch(e){throw Ne++,setTimeout((()=>{Ne--})),a.withScope((n=>{n.addEventProcessor((e=>(t.mechanism&&(a.addExceptionTypeValue(e,void 0,void 0),a.addExceptionMechanism(e,t.mechanism)),e.extra=s._objectSpread2(s._objectSpread2({},e.extra),{},{arguments:r}),e))),a.captureException(e)})),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch(e){}a.markFunctionWrapped(r,e),a.addNonEnumerableProperty(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch(e){}return r}const Re="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function Ce(e,t){const n=Fe(e,t),r={type:t&&t.name,value:qe(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Ge(e,t,n,r){const o=a.getClient(),i=o&&o.getOptions().normalizeDepth,s=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}return}(t),c={__serialized__:a.normalizeToSize(t,i)};if(s)return{exception:{values:[Ce(e,s)]},extra:c};const l={exception:{values:[{type:a.isEvent(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Ke(t,{isUnhandledRejection:r})}]},extra:c};if(n){const t=Fe(e,n);t.length&&(l.exception.values[0].stacktrace={frames:t})}return l}function Me(e,t){return{exception:{values:[Ce(e,t)]}}}function Fe(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e&&Je.test(e.message))return 1;return 0}(t),o=function(e){if("number"==typeof e.framesToPop)return e.framesToPop;return 0}(t);try{return e(n,r,o)}catch(e){}return[]}const Je=/Minified React error #\d+;/i;function qe(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function We(e,t,n,r,o){let i;if(a.isErrorEvent(t)&&t.error){return Me(e,t.error)}if(a.isDOMError(t)||a.isDOMException(t)){const o=t;if("stack"in t)i=Me(e,t);else{const t=o.name||(a.isDOMError(o)?"DOMError":"DOMException"),s=o.message?`${t}: ${o.message}`:t;i=ze(e,s,n,r),a.addExceptionTypeValue(i,s)}return"code"in o&&(i.tags=s._objectSpread2(s._objectSpread2({},i.tags),{},{"DOMException.code":`${o.code}`})),i}if(a.isError(t))return Me(e,t);if(a.isPlainObject(t)||a.isEvent(t)){return i=Ge(e,t,n,o),a.addExceptionMechanism(i,{synthetic:!0}),i}return i=ze(e,t,n,r),a.addExceptionTypeValue(i,`${t}`,void 0),a.addExceptionMechanism(i,{synthetic:!0}),i}function ze(e,t,n,r){const o={};if(r&&n){const r=Fe(e,n);r.length&&(o.exception={values:[{value:t,stacktrace:{frames:r}}]})}if(a.isParameterizedString(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return o.logentry={message:e,params:n},o}return o.message=t,o}function Ke(e,t){let{isUnhandledRejection:n}=t;const r=a.extractExceptionKeysForMessage(e),o=n?"promise rejection":"exception";if(a.isErrorEvent(e))return`Event \`ErrorEvent\` captured as ${o} with message \`${e.message}\``;if(a.isEvent(e)){return`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){}}(e)}\` (type=${e.type}) captured as ${o}`}return`Object captured as ${o} with keys: ${r}`}class Ye extends he{constructor(e){const t=s._objectSpread2({parentSpanIsAlwaysRootSpan:!0},e);!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[t],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"npm";const o=e._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${t}`,packages:n.map((e=>({name:`${r}:@sentry/${e}`,version:a.SDK_VERSION}))),version:a.SDK_VERSION}),e._metadata=o}(t,"browser",["browser"],Ue.SENTRY_SDK_SOURCE||"npm"),super(t),t.sendClientReports&&Ue.document&&Ue.document.addEventListener("visibilitychange",(()=>{"hidden"===Ue.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return function(e,t,n,r){const o=We(e,t,n&&n.syntheticException||void 0,r);return a.addExceptionMechanism(o),o.level="error",n&&n.event_id&&(o.event_id=n.event_id),a.resolvedSyncPromise(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",n=arguments.length>2?arguments[2]:void 0;return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;const i=ze(e,t,r&&r.syntheticException||void 0,o);return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),a.resolvedSyncPromise(i)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(Re&&a.logger.warn("SDK not enabled, will not capture user feedback."));const t=function(e,t){let{metadata:n,tunnel:r,dsn:o}=t;const i=s._objectSpread2(s._objectSpread2({event_id:e.event_id,sent_at:(new Date).toISOString()},n&&n.sdk&&{sdk:{name:n.sdk.name,version:n.sdk.version}}),!!r&&!!o&&{dsn:E(o)}),a=function(e){return[{type:"user_report"},e]}(e);return Y(i,[a])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}}const He="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Ve=a.GLOBAL_OBJ,Xe=1e3;let Ze,Qe,et,tt;function nt(){if(!Ve.document)return;const e=I.bind(null,"dom"),t=rt(e,!0);Ve.document.addEventListener("click",t,!1),Ve.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=Ve[t]&&Ve[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(a.fill(n,"addEventListener",(function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{const r=this,i=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},s=i[n]=i[n]||{refCount:0};if(!s.handler){const r=rt(e);s.handler=r,t.call(this,n,r,o)}s.refCount++}catch(e){}return t.call(this,n,r,o)}})),a.fill(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this,o=n.__sentry_instrumentation_handlers__||{},i=o[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete o[t]),0===Object.keys(o).length&&delete n.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}})))}))}function rt(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch(e){return null}}(n);if(function(e,t){return"keypress"===e&&(!t||!t.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;a.addNonEnumerableProperty(n,"_sentryCaptured",!0),r&&!r._sentryId&&a.addNonEnumerableProperty(r,"_sentryId",a.uuid4());const o="keypress"===n.type?"input":n.type;if(!function(e){if(e.type!==Qe)return!1;try{if(!e.target||e.target._sentryId!==et)return!1}catch(e){}return!0}(n)){e({event:n,name:o,global:t}),Qe=n.type,et=r?r._sentryId:void 0}clearTimeout(Ze),Ze=Ve.setTimeout((()=>{et=void 0,Qe=void 0}),Xe)}}function ot(e){const t="history";O(t,e),k(t,it)}function it(){if(!function(){const e=ie.chrome,t=e&&e.app&&e.app.runtime,n="history"in ie&&!!ie.history.pushState&&!!ie.history.replaceState;return!t&&n}())return;const e=Ve.onpopstate;function t(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r2?n[2]:void 0;if(o){const e=tt,t=String(o);tt=t;I("history",{from:e,to:t})}return e.apply(this,n)}}Ve.onpopstate=function(){const t=Ve.location.href,n=tt;tt=t;if(I("history",{from:n,to:t}),e)try{for(var r=arguments.length,o=new Array(r),i=0;i{const e=this[ct];if(e&&4===this.readyState){try{e.status_code=this.status}catch(e){}I("xhr",{endTimestamp:1e3*a.timestampInSeconds(),startTimestamp:t,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?a.fill(this,"onreadystatechange",(function(e){return function(){c();for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:function(e){const t=st[e];if(t)return t;let n=Ve[e];if(B(n))return st[e]=n.bind(Ve);const r=Ve.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const o=t.contentWindow;o&&o[e]&&(n=o[e]),r.head.removeChild(t)}catch(t){He&&a.logger.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n?st[e]=n.bind(Ve):n}("fetch"),n=0,r=0;return ye(e,(function(o){const i=o.body.length;n+=i,r++;const c=s._objectSpread2({body:o.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15},e.fetchOptions);if(!t)return at("fetch"),a.rejectedSyncPromise("No fetch implementation available");try{return t(e.url,c).then((e=>(n-=i,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}catch(e){return at("fetch"),n-=i,r--,a.rejectedSyncPromise(e)}}))}function dt(e,t,n,r){const o={filename:e,function:""===t?a.UNKNOWN_FUNCTION:t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),o}const pt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ft=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ht=/\((\S*)(?::(\d+))(?::(\d+))\)/,gt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,mt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,_t=[[30,e=>{const t=pt.exec(e);if(t){const[,e,n,r]=t;return dt(e,a.UNKNOWN_FUNCTION,+n,+r)}const n=ft.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=ht.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=yt(n[1]||a.UNKNOWN_FUNCTION,n[2]);return dt(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=gt.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=mt.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||a.UNKNOWN_FUNCTION;return[n,e]=yt(n,e),dt(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]],vt=a.createStackParser(..._t),yt=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:a.UNKNOWN_FUNCTION,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Et=1024,St=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=s._objectSpread2({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e);return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){const t="console";O(t,e),k(t,$)}(function(e){return function(t){if(a.getClient()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:K(t.level),message:a.safeJoin(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${a.safeJoin(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}be(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(a.getClient()!==e)return;let r,o,i="object"==typeof t?t.serializeAttribute:void 0,s="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;s&&s>Et&&(Re&&a.logger.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${s} was configured. Sentry will use 1024 instead.`),s=Et),"string"==typeof i&&(i=[i]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=a.htmlTreeAsString(t,{keyAttrs:i,maxStringLength:s}),o=a.getComponentName(t)}catch(e){r=""}if(0===r.length)return;const c={category:`ui.${n.name}`,message:r};o&&(c.data={"ui.component_name":o}),be(c,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),O("dom",n),k("dom",nt)),t.xhr&&function(e){O("xhr",e),k("xhr",lt)}(function(e){return function(t){if(a.getClient()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,o=t.xhr[ct];if(!n||!r||!o)return;const{method:i,url:s,status_code:c,body:l}=o;be({category:"xhr",data:{method:i,url:s,status_code:c},type:"http"},{xhr:t.xhr,input:l,startTimestamp:n,endTimestamp:r})}}(e)),t.fetch&&T(function(e){return function(t){if(a.getClient()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){be({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:n,endTimestamp:r})}else{const e=t.response;be({category:"fetch",data:s._objectSpread2(s._objectSpread2({},t.fetchData),{},{status_code:e&&e.status}),type:"http"},{input:t.args,response:e,startTimestamp:n,endTimestamp:r})}}}(e)),t.history&&ot(function(e){return function(t){if(a.getClient()!==e)return;let n=t.from,r=t.to;const o=W(Ue.location.href);let i=n?W(n):void 0;const s=W(r);i&&i.path||(i=o),o.protocol===s.protocol&&o.host===s.host&&(r=s.relative),o.protocol===i.protocol&&o.host===i.host&&(n=i.relative),be({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){a.getClient()===e&&be({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:a.getEventDescription(t)},{event:t})}}(e))}}};const bt=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],wt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=s._objectSpread2({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e);return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&a.fill(Ue,"setTimeout",xt),t.setInterval&&a.fill(Ue,"setInterval",xt),t.requestAnimationFrame&&a.fill(Ue,"requestAnimationFrame",Dt),t.XMLHttpRequest&&"XMLHttpRequest"in Ue&&a.fill(XMLHttpRequest.prototype,"send",Ot);const e=t.eventTarget;if(e){(Array.isArray(e)?e:bt).forEach(kt)}}}};function xt(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r{e in t&&"function"==typeof t[e]&&a.fill(t,e,(function(t){const n={mechanism:{data:{function:e,handler:a.getFunctionName(t)},handled:!1,type:"instrument"}},r=a.getOriginalFunction(t);return r&&(n.mechanism.data.handler=a.getFunctionName(r)),Ae(t,n)}))}));for(var n=arguments.length,r=new Array(n),o=0;o0&&void 0!==arguments[0]?arguments[0]:{};const t=s._objectSpread2({onerror:!0,onunhandledrejection:!0},e);return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(!function(e){!function(e){const t="error";O(t,e),k(t,A)}((t=>{const{stackParser:n,attachStacktrace:r}=Lt();if(a.getClient()!==e||Pe())return;const{msg:o,url:i,line:s,column:c,error:l}=t,u=function(e,t,n,r){const o=e.exception=e.exception||{},i=o.values=o.values||[],s=i[0]=i[0]||{},c=s.stacktrace=s.stacktrace||{},l=c.frames=c.frames||[],u=isNaN(parseInt(r,10))?void 0:r,d=isNaN(parseInt(n,10))?void 0:n,p=a.isString(t)&&t.length>0?t:a.getLocationHref();0===l.length&&l.push({colno:u,filename:p,function:a.UNKNOWN_FUNCTION,in_app:!0,lineno:d});return e}(We(n,l||o,void 0,r,!1),i,s,c);u.level="error",a.captureEvent(u,{originalException:l,mechanism:{handled:!1,type:"onerror"}})}))}(e),$t("onerror")),t.onunhandledrejection&&(!function(e){!function(e){const t="unhandledrejection";O(t,e),k(t,C)}((t=>{const{stackParser:n,attachStacktrace:r}=Lt();if(a.getClient()!==e||Pe())return;const o=function(e){if(a.isPrimitive(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}(t),i=a.isPrimitive(o)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:We(n,o,void 0,r,!0);i.level="error",a.captureEvent(i,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}(e),$t("onunhandledrejection"))}}};function $t(e){Re&&a.logger.log(`Global Handler attached: ${e}`)}function Lt(){const e=a.getClient();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const jt=()=>({name:"HttpContext",preprocessEvent(e){if(!Ue.navigator&&!Ue.location&&!Ue.document)return;const t=e.request&&e.request.url||Ue.location&&Ue.location.href,{referrer:n}=Ue.document||{},{userAgent:r}=Ue.navigator||{},o=s._objectSpread2(s._objectSpread2(s._objectSpread2({},e.request&&e.request.headers),n&&{Referer:n}),r&&{"User-Agent":r}),i=s._objectSpread2(s._objectSpread2(s._objectSpread2({},e.request),t&&{url:t}),{},{headers:o});e.request=i}}),Bt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,o){const i=o.getOptions();g(Ce,i.stackParser,i.maxValueLength,n,t,e,r)}}};function Tt(){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={defaultIntegrations:[ke(),De(),wt(),St(),It(),Bt(),$e(),jt()],release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:Ue.SENTRY_RELEASE&&Ue.SENTRY_RELEASE.id?Ue.SENTRY_RELEASE.id:void 0,autoSessionTracking:!0,sendClientReports:!0};return null==e.defaultIntegrations&&delete e.defaultIntegrations,s._objectSpread2(s._objectSpread2({},t),e)}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});if(function(){const e=void 0!==Ue.window&&Ue;if(!e)return!1;const t=e[e.chrome?"chrome":"browser"],n=t&&t.runtime&&t.runtime.id,r=Ue.location&&Ue.location.href||"",o=!!n&&Ue===Ue.top&&["chrome-extension:","moz-extension:","ms-browser-extension:","safari-web-extension:"].some((e=>r.startsWith(`${e}//`))),i=void 0!==e.nw;return!!n&&!o&&!i}())return void a.consoleSandbox((()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}));Re&&(j()||a.logger.warn("No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill."));const t=s._objectSpread2(s._objectSpread2({},e),{},{stackParser:a.stackParserFromStackParserOptions(e.stackParser||vt),integrations:ue(e),transport:e.transport||ut}),n=_e(Ye,t);return e.autoSessionTracking&&function(){if(void 0===Ue.document)return void(Re&&a.logger.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));a.startSession({ignoreDuration:!0}),a.captureSession(),ot((e=>{let{from:t,to:n}=e;void 0!==t&&t!==n&&(a.startSession({ignoreDuration:!0}),a.captureSession())}))}(),n}let Ut=null;async function Nt(){var e,t,n;if(Ut)return Ut;const r=await i.getFenixWindow();if(null==r)return Ut={},Ut;const o=null!==(n=await(null===(t=null===(e=null==r?void 0:r.controller)||void 0===e?void 0:e.getExceptionTags)||void 0===t?void 0:t.call(e)))&&void 0!==n?n:{};return Ut=o,o}var Pt;!function(e){e.Reported="reported",e.ForceReported="force",e.Duplicate="duplicate",e.DroppedDueToVolumeLimit="dropped_volume_limit",e.DroppedDueToResizeObserverLoop="dropped_resize_observer_loop",e.DroppedDueToCrossOriginScriptError="dropped_cross_origin_script_error",e.DroppedTrackAsMetric="dropped_track_as_metric"}(Pt||(Pt={}));let At=100,Rt=.1;const Ct={fatal:"fatal",uncaught:"error",critical:"error",operational:"warning","non-critical":"warning","user-error":"info"},Gt="js_exception";async function Mt(t,n,r){try{const{getMetricsReporter:i}=await new Promise((function(t,n){e(["./c_src_sink_index"],t,n)})).then((function(e){return e.index_esnext})),s={which:t,severity:n||"undefined",page_name:o.getPageName(),yaps_project:o.getYapsProject(),yaps_deployment:o.getYapsDeployment(),atlasservlet:o.getAtlasservlet(),is_edison:o.isServedByEdisonWebServer().toString()};r&&(s.drop_group=r);const a=i().createCounter({ns:Gt,name:"count"},s);a.increment(),a.record()}catch(e){}}let Ft=0;let Jt=!1,qt=0;function Wt(e,t){var n;return"fatal"===e.level&&((null===(n=e.exception)||void 0===n?void 0:n.values)||[]).forEach((e=>{e.mechanism&&(e.mechanism.handled=!1)})),e}async function zt(e){var t;if(Jt)return;const{dsn:n,release:r,environment:o}=e,i=[St(),De(),jt(),Te({iteratee:h})];(null==e?void 0:e.disableDedupeIntegration)||i.push($e());const s={defaultIntegrations:!1,integrations:i,dsn:n,beforeSend:Wt,normalizeDepth:5};r&&(s.release=r),o&&(s.environment=o),Tt(s),Jt=!0;const c=a.getGlobalScope(),{userId:l}=e,u=String((null===(t=null==e?void 0:e.tags)||void 0===t?void 0:t.browser_id)||"undefined_browser_id"),d=l&&"0"!==l?l:`logged_out_user:${u}`;c.setUser({id:d}),e.tags&&c.setTags(e.tags);const p=await Nt();p&&c.setTags(p)}async function Kt({err:e,sentryOptions:t}){o.isUserAgentNotSupported()?console.log("Browser is not supported, skipping Sentry reporting"):(Jt||await zt(t),a.withScope((function(t){try{const n=e.severity||"undefined_severity";t.setTag("exclog_severity",n);const o=e.severity&&Ct[e.severity]?Ct[e.severity]:"warning";t.setLevel(o),t.setTag("online_status",navigator.onLine);const{tags:i,contexts:s}=function(e,t){const n={},o={};for(const[e,r]of Object.entries(t))if("dws_page_info"!==e)if("pagelet_info"!==e)"component_stack"!==e?"privacy_consent"!==e?void 0!==r&&(null!==r&&"object"==typeof r?o[e]=r:n[e]=r):o.privacy_consent={consentCookie:t.privacy_consent}:o.react={componentStack:t.component_stack};else{const e=f((null==t?void 0:t.pagelet_info)||[]);o.pagelets=e}else{const e=r;n.dws_page_name=e.dws_page_name,o.dws_page_info=e}e.filter(d).forEach((e=>{if(p.some((t=>e.startsWith(t+":")))){const t=e.indexOf(":");n[e.substring(0,t)]=e.substring(t+1)}else n[e]=!0}));const i=r.resolveRouteName();return i&&(n.react_router_product_name=i),{tags:n,contexts:o}}(e.tags||[],e.excExtra||{});t.setTags(i);for(const[e,n]of Object.entries(s))t.setContext(e,{...n});a.captureException(e)}catch(e){console.error("Error reporting to Sentry:",e)}})))}t._testOnlySetExceptionsLimits=function(e,t){At=e,Rt=t},t.initSentry=zt,t.sendExceptionReport=function(e,t){return window.EDISON_LOCALMODE?Promise.resolve():e.reported?Mt(Pt.Duplicate,e.severity):["ResizeObserver loop limit exceeded","ResizeObserver loop completed with undelivered notifications"].some((t=>e.message.startsWith(t)))?(e.severity="non-critical",Mt(Pt.DroppedDueToResizeObserverLoop,e.severity)):e.trackAsMetric?Mt(Pt.DroppedTrackAsMetric,e.severity,e.trackAsMetric):!e.force&&Ft>=At&&Math.random()>Rt?Mt(Pt.DroppedDueToVolumeLimit,e.severity):"Script error."===e.message?Mt(Pt.DroppedDueToCrossOriginScriptError,e.severity):(e.severity||(e.severity=n.SEVERITY.UNCAUGHT,e.tags=e.tags||[],e.tags.push("undefined_severity")),e.tags=n.collectExceptionTags(e),e.excExtra=n.collectExceptionExtra(e),r=e.excExtra,Ft+=1,r.exception_number=Ft,window.DB_FRAME_BUST&&(e.severity=n.SEVERITY.USER_ERROR),t&&t.dsn&&Kt({sentryOptions:t,err:e}),e.reported=!0,e.force?Mt(Pt.ForceReported,e.severity):Mt(Pt.Reported,e.severity));var r},t.sendSentryCspViolation=async function(e,t){!o.isUserAgentNotSupported()&&(null==t?void 0:t.dsn)&&(null==t?void 0:t.enableCspReporting)&&(Jt||await zt(t),qt>=5||qt>=2&&Math.random()>=.5||(qt+=1,a.withScope((function(t){try{t.setLevel("report"===e.disposition?"warning":"error"),t.setTag("logger","csp"),t.setTag("blocked-uri",e.blockedURI),t.setTag("effective-directive",e.effectiveDirective),t.setTag("csp-exception-number",qt),t.setFingerprint(["csp",e.blockedURI,e.effectiveDirective]);const n=function(e){const t={};return e.split(";").map((e=>e.trim())).forEach((e=>{const[n,r]=e.split(" ",2);t[n]=r})),t}(e.originalPolicy);t.setContext("CSP",{"Blocked URI":e.blockedURI,"Column Number":e.columnNumber,Disposition:e.disposition,"Document URI":e.documentURI,"Effective Directive":e.effectiveDirective,"Line Number":e.lineNumber,"Original Policy":n,Referrer:e.referrer,Sample:e.sample,"Source File":e.sourceFile,"Status Code":e.statusCode,"Violated Directive":e.violatedDirective}),a.captureMessage(`Blocked '${e.blockedURI}' on ${e.documentURI}`)}catch(e){console.error("Error reporting CSP violation to Sentry:",e)}}))))},t.sentryBeforeSend=Wt})); //# sourceMappingURL=e_core_exception_reporter.js-vflqSHJ98.map //# debugId=b13c64a9-d353-3110-ba9e-2bec9537fada