PageSourceSearch

https://medon.lv/assets/rollbar-xPQm0oLP.js

js medon.lv collected 2026-10-02 21:01:21 UTC 82,977 bytes, 9 lines download raw bytes

1import{g as Qt}from"./AppConfig-Bc40pARW.js";function g(e,t){return t===U(e)}function U(e){var t=typeof e;return t!=="object"?t:e?e instanceof Error?"error":{}.toString.call(e).match(/\s([a-zA-Z]+)/)[1].toLowerCase():"null"}function y(e){return g(e,"function")}function Nt(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function T(e,t){return e==null?!1:Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function ht(e){return Number.isFinite(e)}function et(e){return g(e,"error")||g(e,"exception")}function Yt(e){return Nt(e)&&g(e.then,"function")}function te(){return typeof window<"u"}function ee(e){return typeof Request<"u"&&e instanceof Request}function ut(){return"********"}function re(){var e=x(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var n=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(r==="x"?n:n&7|8).toString(16)});return t}var yt={debug:0,info:1,warning:2,error:3,critical:4};function ne(e){var t=ie(e);return t?(t.anchor===""&&(t.source=t.source.replace("#","")),e=t.source.replace("?"+t.query,""),e):"(unknown)"}var se={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:/?#]*)(?::(\d*))?))?((((?:[^?#/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@/]*@)([^:/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#/]*\.[^?#/.]+(?:[?#]|$)))*\/?)?([^?#/]*))(?:\?([^#]*))?(?:#(.*))?)/}};function ie(e){if(g(e,"string")){for(var t=se,r=t.parser.loose.exec(e),n={},s=0,i=t.key.length;s<i;++s)n[t.key[s]]=r[s]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(o,a,u){a&&(n[t.q.name][a]=u)}),n}}function oe(e,t,r){r=r||{},r.access_token=e;var n=[],s;for(s in r)Object.prototype.hasOwnProperty.call(r,s)&&n.push([s,r[s]].join("="));var i="?"+n.sort().join("&");t=t||{},t.path=t.path||"";var o=t.path.indexOf("?"),a=t.path.indexOf("#"),u;o!==-1&&(a===-1||a>o)?(u=t.path,t.path=u.substring(0,o)+i+"&"+u.substring(o+1)):a!==-1?(u=t.path,t.path=u.substring(0,a)+i+u.substring(a)):t.path=t.path+i}function dt(e,t){if(t=t||e.protocol,!t&&e.port&&(e.port===80?t="http:":e.port===443&&(t="https:")),t=t||"https:",!e.hostname)return null;var r=t+"//"+e.hostname;return e.port&&(r=r+":"+e.port),e.path&&(r=r+e.path),r}function O(e,t){var r,n;try{r=JSON.stringify(e)}catch(s){if(t&&y(t))try{r=t(e)}catch(i){n=i}else n=s}return{error:n,value:r}}function ae(e){for(var t=0,r=e.length,n=0;n<r;n++){var s=e.charCodeAt(n);s<128?t=t+1:s<2048?t=t+2:s<65536&&(t=t+3)}return t}function vt(e){var t,r;try{t=JSON.parse(e)}catch(n){r=n}return{error:r,value:t}}function bt(e,t,r,n,s,i,o,a){var u={url:t||"",line:r,column:n};u.func=a.guessFunctionName(u.url,u.line),u.context=a.gatherContext(u.url,u.line);var c=typeof document<"u"&&document&&document.location&&document.location.href,l=typeof window<"u"&&window&&window.navigator&&window.navigator.userAgent;return{mode:i,message:s?String(s):e||o,url:c,stack:[u],useragent:l}}function ue(e,t){return function(r,n){try{t(r,n)}catch(s){e.error(s)}}}function X(e){var t=[e];function r(n,s){var i,o,a,u={};try{for(o in n){if(i=n[o],i&&(g(i,"object")||g(i,"array"))){s.includes(i)?u[o]="Removed circular reference: "+U(i):(a=s.slice(),a.push(i),u[o]=r(i,a));continue}u[o]=i}}catch(c){u="Failed cloning custom data: "+c.message}return u}return r(e,t)}function ce(e,t,r,n,s){for(var i,o,a,u,c,l=[],f={},h=[],d=0,p=e.length;d<p;++d){c=e[d];var b=U(c);switch(h.push(b),b){case"undefined":break;case"string":i?l.push(c):i=c;break;case"function":u=ue(t,c);break;case"date":l.push(c);break;case"error":case"domexception":case"exception":o?l.push(c):o=c;break;case"object":case"array":if(c instanceof Error||typeof DOMException<"u"&&c instanceof DOMException){o?l.push(c):o=c;break}a?l.push(c):a=c;break;default:if(c instanceof Error||typeof DOMException<"u"&&c instanceof DOMException){o?l.push(c):o=c;break}l.push(c)}}a&&(a=X(a)),l.length>0&&(a||(a=X({})),a.extraArgs=X(l));var _={message:i,err:o,custom:a,timestamp:x(),callback:u,notifier:r,diagnostic:f,uuid:re(
1)};return _.data=_.data||{},le(_,a),_._originalArgs=e,_.diagnostic.original_arg_types=h,_}function le(e,t){t&&t.level!==void 0&&(e.level=t.level,delete t.level),t&&t.skipFrames!==void 0&&(e.skipFrames=t.skipFrames,delete t.skipFrames)}function fe(e,t){var r=e.data.custom||{},n=!1;try{for(const s of t)T(s,"rollbarContext")&&(r=v(r,X(s.rollbarContext)),n=!0);n&&(e.data.custom=r)}catch(s){e.diagnostic.error_context="Failed: "+s.message}}var he=["log","network","dom","navigation","error","manual"],de=["critical","error","warning","info","debug"];function _t(e,t){for(const r of e)if(r===t)return!0;return!1}function pe(e){for(var t,r,n,s,i=0,o=e.length;i<o;++i){s=e[i];var a=U(s);switch(a){case"string":!t&&_t(he,s)?t=s:!n&&_t(de,s)&&(n=s);break;case"object":r=s;break}}var u={type:t||"manual",metadata:r||{},level:n};return u}function qt(e,t){e.attributes=e.attributes||[];for(const r of t)r.value!==void 0&&e.attributes.push(r)}function I(e,t){if(e){var r=t.split("."),n=e;try{for(var s=0,i=r.length;s<i;++s)n=n[r[s]]}catch{n=void 0}return n}}function R(e,t,r){if(e){Object.setPrototypeOf(e,null);var n=t.split("."),s=n.length;if(!(s<1)){if(s===1){e[n[0]]=r;return}try{for(var i=e[n[0]]||{},o=i,a=1;a<s-1;++a)i[n[a]]=i[n[a]]||{},i=i[n[a]];i[n[s-1]]=r,e[n[0]]=o}catch{return}}}}function ge(e){var t,r,n,s=[];for(t=0,r=e.length;t<r;++t){switch(n=e[t],U(n)){case"object":n=O(n),n=n.error||n.value,n.length>500&&(n=n.substr(0,497)+"...");break;case"null":n="null";break;case"undefined":n="undefined";break;case"symbol":n=n.toString();break}s.push(n)}return s.join(" ")}function x(){return Date.now?Date.now():Number(new Date)}function rt(e,t,r,n){var s=v(e,t,r);return s=me(s,n),!t||t.overwriteScrubFields||t.scrubFields&&(s.scrubFields=(e.scrubFields||[]).concat(t.scrubFields)),s}function me(e,t){return e.hostWhiteList&&!e.hostSafeList&&(e.hostSafeList=e.hostWhiteList,e.hostWhiteList=void 0,t&&t.log("hostWhiteList is deprecated. Use hostSafeList.")),e.hostBlackList&&!e.hostBlockList&&(e.hostBlockList=e.hostBlackList,e.hostBlackList=void 0,t&&t.log("hostBlackList is deprecated. Use hostBlockList.")),e}function v(){function e(c){if(!c||Object.prototype.toString.call(c)!=="[object Object]")return!1;var l=T(c,"constructor"),f=c.constructor&&c.constructor.prototype&&T(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!l&&!f)return!1;var h;for(h in c);return typeof h>"u"||T(c,h)}var t,r,n,s,i,o=Object.create(null),a=null,u=arguments.length;for(t=0;t<u;t++)if(a=arguments[t],a!=null)for(i in a)r=o[i],n=a[i],o!==n&&(n&&e(n)?(s=r&&e(r)?r:{},o[i]=v(s,n)):typeof n<"u"&&(o[i]=n));return o}function wt(e,t,r){if(!t?.sessionId||!r)return!1;const n=e?.tracing?.propagation,s=n?.enabledHeaders;if(!Array.isArray(s)||!s.includes("baggage"))return!1;const i=n?.enabledCorsUrls;return!Array.isArray(i)||i.length===0?!1:i.some(o=>g(o,"string")?r===o:g(o,"regexp")?o.test(r):!1)}function ye(e,t){let r=e[1];const n=r?.headers,s=ee(e[0])&&e[0].headers;let i=n||s;if(i||(r||(e[1]=r={}),i=r.headers={}),i instanceof Headers)for(const o of Object.keys(t))i.append(o,t[o]);else if(Nt(i))for(const o of Object.keys(t))i[o]=t[o]}function ve(e){const t=e.asyncLocalStorage;return!t||typeof t.getStore!="function"?null:t.getStore()?.sessionId||null}function Z(e,t,r){var n,s,i,o=g(e,"object"),a=g(e,"array"),u=[],c;if(r=r||{obj:[],mapped:[]},o){if(c=r.obj.indexOf(e),o&&c!==-1)return r.mapped[c]||r.obj[c];r.obj.push(e),c=r.obj.length-1}if(o)for(n in e)T(e,n)&&u.push(n);else if(a)for(i=0;i<e.length;++i)u.push(i);var l=o?{}:[],f=!0;for(i=0;i<u.length;++i)n=u[i],s=e[n],l[n]=t(n,s,r),f=f&&l[n]===e[n];return o&&!f&&(r.mapped[c]=l),f?e:l}function Ht(e,t,r){if(t=t||[],r)for(const c of r)be(e,c);var n=_e(t),s=we(t);function i(c,l){return l+ut()}function o(c){if(g(c,"string"))for(const l of s)c=c.replace(l,i);return c}function a(c,l){for(const f of n)if(f.test(c)){l=ut();break}return l}function u(c,l,f){var h=a(c,l);return h===l?g(l,"object")||g(l,"array")?Z(l,u,f):o(h):h}return Z(e,u)}function be(e,t){var r=t.split("."),n=r.length-1;try{for(const[s,i]of r.entries())s<n?e=e[i]:e[i]=ut()}catch{}}function _e(e){var t=[];
1for(const n of e){var r="^\\[?(%5[bB])?"+n+"\\[?(%5[bB])?\\]?(%5[dD])?$";t.push(new RegExp(r,"i"))}return t}function we(e){var t=[];for(const n of e){var r="\\[?(%5[bB])?"+n+"\\[?(%5[bB])?\\]?(%5[dD])?";t.push(new RegExp("("+r+"=)([^&\\n]+)","igm"))}return t}const V=100;function k(e){return[Math.trunc(e/1e3),Math.round(e%1e3*1e6)]}class xe{constructor(t,r){this.queue=[],this.options=v(t);var n=this.options.maxTelemetryEvents||V;this.maxQueueSize=Math.max(0,Math.min(n,V)),this.tracing=r,this.telemetrySpan=this.tracing?.startSpan("rollbar-telemetry",{})}configure(t){var r=this.options;this.options=v(r,t);var n=this.options.maxTelemetryEvents||V,s=Math.max(0,Math.min(n,V)),i=0;this.queue.length>s&&(i=this.queue.length-s),this.maxQueueSize=s,this.queue.splice(0,i)}copyEvents(){var t=Array.prototype.slice.call(this.queue,0);if(y(this.options.filterTelemetry))try{for(var r=t.length;r--;)this.options.filterTelemetry(t[r])&&t.splice(r,1)}catch{this.options.filterTelemetry=null}return t=t.filter(n=>n.type!=="connectivity"),t=t.map(({otelAttributes:n,...s})=>s),t}exportTelemetrySpan(t={}){this.telemetrySpan&&(this.telemetrySpan.end(t),this.telemetrySpan=this.tracing.startSpan("rollbar-telemetry",{}))}capture(t,r,n,s,i=null,o=null){var a={level:Se(t,n),type:t,timestamp_ms:i||x(),body:r,source:"client"};s&&(a.uuid=s),o&&(a.otelAttributes=o);try{if(y(this.options.filterTelemetry)&&this.options.filterTelemetry(a))return!1}catch{this.options.filterTelemetry=null}return this.push(a),a}captureEvent(t,r,n,s){return this.capture(t,r,n,s)}captureError(t,r,n,s){const i=t.message||String(t);var o={message:i};t.stack&&(o.stack=t.stack);const a={message:i,level:r,type:"error",uuid:n};return this.telemetrySpan?.addEvent("rollbar-occurrence-event",a,k(s)),this.capture("error",o,r,n,s,a)}captureLog(t,r,n,s){const i=n?"rollbar-occurrence-event":"rollbar-log-event",o={message:t,level:r,...n?{type:"message",uuid:n}:{}};return this.telemetrySpan?.addEvent(i,o,k(s)),this.capture("log",{message:t},r,n,s,o)}captureNetwork(t,r,n,s){r=r||"xhr",t.subtype=t.subtype||r,s&&(t.request=s);const i=this.levelFromStatus(t.status_code),o=(t.end_time_ms||0)*1e6,a={type:t.subtype,method:t.method,url:t.url,statusCode:t.status_code,"request.headers":JSON.stringify(t.request_headers||{}),"response.headers":JSON.stringify(t.response?.headers||{}),"response.timeUnixNano":o.toString()},u=t.request,c=t.response?.body;return u&&(a["request.body"]=JSON.stringify(u)),c&&(a["response.body"]=JSON.stringify(c)),this.telemetrySpan?.addEvent("rollbar-network-event",a,k(t.start_time_ms)),this.capture("network",t,i,n,t.start_time_ms,a)}levelFromStatus(t){return t>=200&&t<400?"info":t===0||t>=400?"error":"info"}captureDom(t,r,n,s,i){var o={subtype:t,element:r};return n!==void 0&&(o.value=n),s!==void 0&&(o.checked=s),this.capture("dom",o,"info",i)}captureInput({type:t,isSynthetic:r,element:n,value:s,timestamp:i}){const o="rollbar-input-event",a={type:o,subtype:t,element:n,value:s},u={type:t,isSynthetic:r,element:n,value:s,endTimeUnixNano:k(i)},c=this._getRepeatedEvent(o,u);return c?this._updateRepeatedEvent(c,u,i):(this.telemetrySpan?.addEvent(o,u,k(i)),this.capture("dom",a,"info",null,i,u))}captureClick({type:t,isSynthetic:r,element:n,timestamp:s}){const i="rollbar-click-event",o={type:i,subtype:t,element:n},a={type:t,isSynthetic:r,element:n,endTimeUnixNano:k(s)},u=this._getRepeatedEvent(i,a);return u?this._updateRepeatedEvent(u,a,s):(this.telemetrySpan?.addEvent(i,a,k(s)),this.capture("dom",o,"info",null,s,a))}_getRepeatedEvent(t,r){const n=this._lastEvent(this.queue);if(n&&n.body.type===t&&n.otelAttributes.target===r.target)return n}_updateRepeatedEvent(t,r,n){const s=Math.max(n-t.timestamp_ms,1);t.body.value=r.value,t.otelAttributes.value=r.value,t.otelAttributes.height=r.height,t.otelAttributes.width=r.width,t.otelAttributes.textZoomRatio=r.textZoomRatio,t.otelAttributes.endTimeUnixNano=k(n),t.otelAttributes.durationUnixNano=k(s),t.otelAttributes.count=(t.otelAttributes.count||1)+1,t.otelAttributes.rate=t.otelAttributes.count/(s/1e3)}_lastEvent(t){return t.length>0?t[t.length-1]:null}captureFocus({type:t,isSynthetic:r,element:n,timestamp:s}){const i="rollbar-focus-event",o={type:i,subtype:t,element:n},a={type:t,isSynthetic:r,element:n};return this.telemetrySpan?.addEvent(i,a,k(s)),this.capture("dom",o,"info",null,s,a)}captureResize({type:t,isSynthetic:r,width:n,height:s,textZoomRatio:i,timestamp:o}){const a="rollbar-resize-event",u={type:a,subtype:t,width:n,height:s,textZoomRatio:i},c={type:t,isSynthetic:r,width:n,height:s,textZoomRatio:i},l=this._getRepeatedEvent(a,c);return l?this._updateRepeatedEvent(l,c,o):(this.telemetrySpan?.addEvent(a,c,k(o)),this.capture("dom",u,"info",
1null,o,c))}captureDragDrop({type:t,isSynthetic:r,element:n,dropEffect:s,effectAllowed:i,kinds:o,mediaTypes:a,timestamp:u}){const c="rollbar-dragdrop-event";let l={type:c,subtype:t,isSynthetic:r},f={type:t,isSynthetic:r};return t==="dragstart"&&(l={...l,element:n,dropEffect:s,effectAllowed:i},f={...f,element:n,dropEffect:s,effectAllowed:i}),t==="drop"&&(l={...l,element:n,dropEffect:s,effectAllowed:i,kinds:o,mediaTypes:a},f={...f,element:n,dropEffect:s,effectAllowed:i,kinds:o,mediaTypes:a}),this.telemetrySpan?.addEvent(c,f,k(u)),this.capture("dom",l,"info",null,u,f)}captureNavigation(t,r,n,s){return this.telemetrySpan?.addEvent("rollbar-navigation-event",{"previous.url.full":t,"url.full":r},k(s)),this.capture("navigation",{from:t,to:r},"info",n,s)}captureDomContentLoaded(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())}captureLoad(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())}captureConnectivityChange({type:t,isSynthetic:r,timestamp:n}){const s="rollbar-connectivity-event",i={type:s,subtype:t},o={type:t,isSynthetic:r};return this.telemetrySpan?.addEvent(s,o,k(n)),this.capture("connectivity",i,"info",null,n,o)}_captureRollbarItem(t){if(this.options.includeItemsInTelemetry){if(t.err)return this.captureError(t.err,t.level,t.uuid,t.timestamp);if(t.message)return this.captureLog(t.message,t.level,t.uuid,t.timestamp);if(t.custom)return this.capture("log",t.custom,t.level,t.uuid,t.timestamp)}}push(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()}}function Se(e,t){if(t)return t;var r={error:"error",manual:"info"};return r[e]||"info"}class Q{constructor(t){this._currentContext=t?new Map(t):new Map}getValue(t){return this._currentContext.get(t)}setValue(t,r){const n=new Q(this._currentContext);return n._currentContext.set(t,r),n}deleteValue(t){const r=new Q(self._currentContext);return r._currentContext.delete(t),r}}const xt=new Q;class Ee{constructor(){this.currentContext=xt}active(){return this.currentContext}enterContext(t){const r=this.currentContext;return this.currentContext=t||xt,r}exitContext(t){return this.currentContext=t,this.currentContext}with(t,r,n,...s){const i=this.enterContext(t);try{return r.call(n,...s)}finally{this.exitContext(i)}}}function Ie(e){return Symbol.for(e)}function z(e){return[Math.trunc(e/1e3),Math.round(e%1e3*1e6)]}function ke(e){return e[0]*1e3+Math.round(e[1]/1e6)}function Te(e){return e[0]*1e9+e[1]}function Mt(e,t){return[e[0]+t[0]+Math.trunc((e[1]+t[1])/1e9),(e[1]+t[1])%1e9]}function Re(e=!1){return e?Mt(z(performance.timeOrigin),z(performance.now())):z(Date.now())}function Oe(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}const H={fromMillis:z,toMillis:ke,toNanos:Te,add:Mt,now:Re,isHrTime:Oe};class Ce{constructor(t,r={}){this.api=t,this.options=r}export(t,r){nt.push(...t)}toPayload(){const t=nt.slice();if(nt.length=0,!t||!t.length)return{resourceSpans:[]};const r=t[0]&&t[0].resource||{},n=new Map;for(const s of t){const i=s.instrumentationScope?`${s.instrumentationScope.name}:${s.instrumentationScope.version}`:"default:1.0.0";n.has(i)||n.set(i,{scope:s.instrumentationScope||{name:"default",version:"1.0.0",attributes:[]},spans:[]}),n.get(i).spans.push(this._transformSpan(s))}return{resourceSpans:[{resource:this._transformResource(r),scopeSpans:Array.from(n.values()).map(s=>({scope:this._transformInstrumentationScope(s.scope),spans:s.spans}))}]}}post(t,r={}){return this.api.postSpans(t,r)}_transformSpan(t){const r=s=>Object.entries(s||{}).map(([i,o])=>({key:i,value:this._transformAnyValue(o)})),n=s=>(s||[]).map(i=>({timeUnixNano:H.toNanos(i.time),name:i.name,attributes:r(i.attributes)}));return{traceId:t.spanContext.traceId,spanId:t.spanContext.spanId,parentSpanId:t.parentSpanId||"",name:t.name,kind:t.kind||1,startTimeUnixNano:H.toNanos(t.startTime),endTimeUnixNano:H.toNanos(t.endTime),attributes:r(t.attributes),events:n(t.events)}}_transformResource(t){const r=t.attributes||{};return{attributes:Object.entries(r).map(([s,i])=>({key:s,value:this._transformAnyValue(i)}))}}_transformInstrumentationScope(t){return{name:t.name||"",version:t.version||"",attributes:(t.attributes||[]).map(r=>({key:r.key,value:this._transformAnyValue(r.value)}))}}_transformAnyValue(t){if(t==null)return{stringValue:""};const r=typeof t;return r==="string"?{stringValue:t}:r==="number"?Number.isInteger(t)?{intValue:t.toString()}:{doubleValue:t}:r==="boolean"?{boolValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(n=>this._transformAnyValue(n))}}:r==="object"?{kvlistValue:{values:Object.entries(t).map(([n,s])=>({key:n,value:this._transformAnyValue(s)}))}}:{stringValue:String(t)}}}const nt=[];function Le(e=16){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}const Y={gen:Le},St="RollbarSession";class Ae{_attributes;constructor(t,r){this.options=r,this.tracing=t,this.window=t.window,this.session=null,this._attributes={}}init(t={}){return this.session?this:(this.getSession()||this.createSession(),this.initSessionAttributes(t),this)}getSession(){try{const t=this.window.sessionStorage.getItem(St);if(!t)return null;this.session=JSON.parse(t)}catch{return null}return this}createSession(){return this.session={id:Y.gen(),createdAt:Date.now()},this.setSession(this.session)}setSession(t){const r=JSON.stringify(t);try{this.window.sessionStorage.setItem(St,r)}catch{return null}return this}get attributes(){return this._attributes}setAttributes(t){return this._attributes={...this._attributes,...t},this}setUser(t){return this.setAttributes({"user.id":t?.id,"user.email":t?.email,"user.name":t?.name||t?.username}),this}initSessionAttributes(t){return this.setAttributes({"session.id":this.session.id,"browser.brands":navigator.userAgentData?.brands,"browser.language":navigator.language,"browser.mobile":navigator.userAgentData?.mobile,"browser.platform":navigator.userAgentData?.platform,"client.address":"$remote_ip","rollbar.notifier.framework":"browser-js","user_agent.original":navigator.userAgent,...t}),this}}let q=()=>{};const Et={debug:0,info:1,warn:2,error:3,disable:4},S={error:(...e)=>q("error",e),warn:(...e)=>q("warn",e),info:(...e)=>q("info",e),debug:(...e)=>q("debug",e),log:(...e)=>q("info",e),init:({logLevel:e})=>{q=function(t,r){Et[t]<Et[e]||(r.unshift("Rollbar:"),console[t].apply(console,r))}}};class Pe{constructor(t,r={}){this.exporter=t,this.options=r,this.pendingSpans=new Map,this.transforms=[this.userTransform.bind(this)]}addTransform(t){this.transforms.unshift(t)}userTransform(t){this.options.transformSpan&&this.options.transformSpan({span:t})}applyTransforms(t){for(const r of this.transforms)try{r(t)}catch(n){S.error("Error running span transform callback",n)}}onStart(t,r){this.pendingSpans.set(t.span.spanContext.spanId,t)}onEnd(t){this.applyTransforms(t.span),this.exporter.export([t.export()]),this.pendingSpans.delete(t.span.spanContext.spanId)}}class Ne{constructor(t){return this.usePerformance=t.usePerformance,this.initReadableSpan(t),this.spanProcessor=t.spanProcessor,this.spanProcessor.onStart(this,t.context),t.attributes&&this.setAttributes(t.attributes),this}initReadableSpan(t){this.span={name:t.name,kind:t.kind,spanContext:t.spanContext,parentSpanId:t.parentSpanId,startTime:t.startTime||H.now(t.usePerformance),endTime:[0,0],status:{code:0,message:""},attributes:{"session.id":t.session?.id},links:[],events:[],duration:0,ended:!1,resource:t.resource,instrumentationScope:t.scope,droppedAttributesCount:0,droppedEventsCount:0,droppedLinksCount:0}}spanContext(){return this.span.spanContext}get spanId(){return this.span.spanContext.spanId}get traceId(){return this.span.spanContext.traceId}setAttribute(t,r){return r==null||this.span.ended?this:t.length===0?this:(this.span.attributes[t]=r,this)}setAttributes(t){for(const[r,n]of Object.entries(t))this.setAttribute(r,n);return this}addEvent(t,r={},n){return this.span.ended?this:(this.span.events.push({name:t,attributes:r,time:n||H.now(),droppedAttributesCount:0}),this)}isRecording(){return this.span.ended===!1}
1end(t,r){t&&this.setAttributes(t),this.span.endTime=r||H.now(this.usePerformance),this.span.ended=!0,this.spanProcessor.onEnd(this)}export(){return this.span}}class qe{constructor(t,r){this.spanProcessor=r,this.tracing=t}startSpan(t,r={},n=this.tracing.contextManager.active()){const i=this.tracing.getSpan(n)?.spanContext(),o=Y.gen(8);let a,u=0,c=null,l;i?(a=i.traceId,c=i.traceState,l=i.spanId):a=Y.gen(16);const f=0,h={traceId:a,spanId:o,traceFlags:u,traceState:c},d={attributes:{...this.tracing.resource?.attributes||{},...r.resource?.attributes||{}}};return new Ne({resource:d,scope:this.tracing.scope,session:this.tracing.session?.session,context:n,spanContext:h,name:t,kind:f,parentSpanId:l,spanProcessor:this.spanProcessor,startTime:r.startTime,usePerformance:r.usePerformance})}}const It=Ie("Rollbar Context Key SPAN");class He{constructor(t,r,n){this.api=r,this.options=n,this.window=t,this.window.sessionStorage&&(this.session=new Ae(this,n)),this.createTracer()}configure(t){this.options=t}initSession(){this.session&&this.session.init()}get sessionId(){return this.session?this.session.session.id:null}get resource(){return{attributes:{...this.options.resource||{},"rollbar.environment":this.options.payload?.environment??this.options.environment}}}get scope(){return{name:"rollbar-browser-js",version:this.options.version}}idGen(t=16){return Y.gen(t)}createTracer(){this.contextManager=new Ee,this.exporter=new Ce(this.api,this.options),this.spanProcessor=new Pe(this.exporter,this.options.tracing),this.tracer=new qe(this,this.spanProcessor)}getTracer(){return this.tracer}addSpanTransform(t){this.spanProcessor.addTransform(t)}getSpan(t=this.contextManager.active()){return t.getValue(It)}setSpan(t=this.contextManager.active(),r){return t.setValue(It,r)}startSpan(t,r={},n=this.contextManager.active()){return this.tracer.startSpan(t,r,n)}with(t,r,n,...s){return this.contextManager.with(t,r,n,...s)}withSpan(t,r,n,s){const i=this.startSpan(t,r);return this.with(this.setSpan(this.contextManager.active(),i),n,s,i)}}function Ut(e,t){return[e,O(e,t)]}function ct(e,t){var r=e.length;return r>t*2?e.slice(0,t).concat(e.slice(r-t)):e}function jt(e,t,r){r=typeof r>"u"?30:r;var n=e.data.body,s;if(n.trace_chain){var i=n.trace_chain;for(const o of i)s=o.frames,s=ct(s,r),o.frames=s}else n.trace&&(s=n.trace.frames,s=ct(s,r),n.trace.frames=s);return[e,O(e,t)]}function pt(e,t){return t&&(t.length>e?t.slice(0,e-3).concat("..."):t)}function G(e,t,r){function n(s,i,o){switch(U(i)){case"string":return pt(e,i);case"object":case"array":return Z(i,n,o);default:return i}}return t=Z(t,n),[t,O(t,r)]}function kt(e){return e.exception&&(delete e.exception.description,e.exception.message=pt(255,e.exception.message)),e.frames=ct(e.frames,1),e}function Me(e,t){var r=e.data.body;if(r.trace_chain){var n=r.trace_chain;for(const[s,i]of n.entries())n[s]=kt(i)}else r.trace&&(r.trace=kt(r.trace));return[e,O(e,t)]}function Ue(e,t){return ae(e)>t}function je(e,t,r){r=typeof r>"u"?512*1024:r;for(var n=[Ut,jt,G.bind(null,1024),G.bind(null,512),G.bind(null,256),Me],s,i,o;s=n.shift();)if(i=s(e,t),e=i[0],o=i[1],o.error||!Ue(o.value,r))return o;return o}const De={truncate:je,raw:Ut,truncateFrames:jt,truncateStrings:G,maybeTruncateValue:pt};function Tt(e){if(!g(e.context,"string")){var t=O(e.context);t.error?e.context="Error: could not serialize 'context'":e.context=t.value||"",e.context.length>255&&(e.context=e.context.substr(0,255))}return{data:e}}function Dt(e,t,r){var n=t.hostname,s=t.protocol,i=t.port,o=t.path,a=t.search,u=e.timeout,c=Fe(e),l=e.proxy;if(e.endpoint){var f=r.parse(e.endpoint);n=f.hostname,s=f.protocol,i=f.port,o=f.pathname,a=f.search}return{timeout:u,hostname:n,protocol:s,port:i,path:o,search:a,proxy:l,transport:c}}function Fe(e){var t=typeof window<"u"&&window||typeof self<"u"&&self,r=e.defaultTransport||"xhr";return typeof t.fetch>"u"&&(r="xhr"),typeof t.XMLHttpRequest>"u"&&(r="fetch"),r}function st(e,t){var r=e.protocol||"https:",n=e.port||(r==="http:"?80:r==="https:"?443:void 0),s=e.hostname,i=e.path,o=e.timeout,a=e.transport;return e.search&&(i=i+e.search),e.proxy&&(i=r+"//"+s+i,s=e.proxy.host||e.proxy.hostname,n=e.proxy.port,r=e.proxy.protocol||r),{timeout:o,protocol:r,hostname:s,path:i,port:n,method:t,transport:a}}const Ve={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,protocol:"https:",port:443},Be={hostname:"api.rollbar.com",path:"/api/1/session/",search:null,protocol:"https:",port:443};class Je{constructor(t,r,n,s){this.options=t,this.transport=r,this.url=n,this.truncation=s,this.accessToken=t.accessToken,this.transportOptions=Rt(t,n),this.OTLPTransportOptions=Ot(t,n)}_postPromise({accessToken:t,options:r,payload:n,headers:s}){return new Promise((i,o)=>{this.transport.post({accessToken:t,options:r,payload:n,headers:s,callback:(a,u)=>a?o(a):i(u)})})}postItem(t,r){const n=st(this.transportOptions,"POST"),s=Tt(t);setTimeout(()=>{this.transport.post({accessToken:this.accessToken,options:n,payload:s,callback:r})},0)}async postSpans(t,r={}){const n=st(this.OTLPTransportOptions,"POST");return this._postPromise({accessToken:this.accessToken,options:n,payload:t,headers:r})}buildJsonPayload(t,r){const n=Tt(t);let s;return this.truncation?s=this.truncation.truncate(n):s=O(n),s.error?(r&&r(s.error),null):s.value}postJsonPayload(t,r){const n=st(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,n,t,r)}configure(t){const r=this.options;return this.options=v(r,t),this.transportOptions=Rt(this.options,this.url),this.OTLPTransportOptions=Ot(this.options,this.url),this.options.accessToken!==void 0&&(this.accessToken=this.options.accessToken),this}}function Rt(e,t){return Dt(e,Ve,t)}function Ot(e,t){return e={...e,endpoint:e.tracing?.endpoint},Dt(e,Be,t)}const We="3.1.0",$e="api.rollbar.com/api/1/item/",Xe="debug",ze="debug",Ge="error",Ke=["pw","pass","passwd","password","secret","confirm_password","confirmPassword","password_confirmation","passwordConfirmation","access_token","accessToken","X-Rollbar-Access-Token","secret_key","secretKey","secretToken"],D={version:We,endpoint:$e,logLevel:Xe,reportLevel:ze,uncaughtErrorLevel:Ge},Ze=/(^|@)\S+:\d+/,Ft=/^\s*at .*(\S+:\d+|\(native\))/m,Qe=/^(eval@)?(\[native code\])?$/;function Ye(e,t){if(typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u")return sr(e);if(e.stack&&e.stack.match(Ft))return tr(e);if(e.stack)return rr(e);throw new Error("Cannot parse given Error object")}function gt(e){if(!e.includes(":"))return[e,void 0,void 0];const r=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[r[1],r[2]||void 0,r[3]||void 0]}function F(e,t){return e}function tr(e,t){return er(e.stack)}function er(e,t){return F(e.split(`
2`).filter(n=>!!n.match(Ft))).map(n=>{n.includes("(eval ")&&(n=n.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let s=n.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,"");const i=s.match(/ (\(.+\)$)/);s=i?s.replace(i[0],""):s;const o=gt(i?i[1]:s),a=i&&s||void 0,u=["eval","<anonymous>"].includes(o[0])?void 0:o[0];return{function:a,file:u,line:o[1]?+o[1]:void 0,col:o[2]?+o[2]:void 0,raw:n}})}function rr(e,t){return nr(e.stack)}function nr(e,t){return F(e.split(`
3`).filter(n=>!n.match(Qe))).map(n=>{if(n.includes(" > eval")&&(n=n.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!n.includes("@")&&!n.includes(":"))return{function:n};
3{const s=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,i=n.match(s),o=i&&i[1]?i[1]:void 0,a=gt(n.replace(s,""));return{function:o,file:a[0],line:a[1]?+a[1]:void 0,col:a[2]?+a[2]:void 0,raw:n}}})}function sr(e,t){return!e.stacktrace||e.message.includes(`
4`)&&e.message.split(`
5`).length>e.stacktrace.split(`
6`).length?ir(e):e.stack?ar(e):or(e)}function ir(e,t){const r=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split(`
7`),s=[];for(let i=2,o=n.length;i<o;i+=2){const a=r.exec(n[i]);a&&s.push({file:a[2],line:+a[1],raw:n[i]})}return F(s)}function or(e,t){const r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split(`
8`),s=[];for(let i=0,o=n.length;i<o;i+=2){const a=r.exec(n[i]);a&&s.push({function:a[3]||void 0,file:a[2],line:a[1]?+a[1]:void 0,raw:n[i]})}return F(s)}function ar(e,t){return F(e.stack.split(`
9`).filter(n=>!!n.match(Ze)&&!n.match(/^Error created at/))).map(n=>{const s=n.split("@"),i=gt(s.pop()),o=s.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;let u;o.match(/\(([^)]*)\)/)&&(u=o.replace(/^[^(]+\(([^)]*)\)$/,"$1"));const c=u===void 0||u==="[arguments not available]"?void 0:u.split(",");return{function:a,args:c,file:i[0],line:i[1]?+i[1]:void 0,col:i[2]?+i[2]:void 0,raw:n}})}function ur(e){return e.map(t=>({functionName:t.function,args:t.args,fileName:t.file,lineNumber:t.line,columnNumber:t.col,source:t.raw}))}function cr(e,t){return ur(Ye(e))}var lr="?",fr=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function hr(){return lr}function Vt(){return null}function Bt(e){var t={};return t._stackFrame=e,t.url=e.fileName,t.line=e.lineNumber,t.func=e.functionName,t.column=e.columnNumber,t.args=e.args,t.context=Vt(),t}function lt(e,t){function r(){var n=[];t=t||0;try{n=cr(e)}catch{n=[]}for(var s=[],i=t;i<n.length;i++)s.push(new Bt(n[i]));return s}return{stack:r(),message:e.message,name:gr(e),rawStack:e.stack,rawException:e}}function dr(e,t){var r=e;if(r.nested||r.cause){for(var n=[];r;)n.push(new lt(r,t)),r=r.nested||r.cause,t=0;return n[0].traceChain=n,n[0]}else return new lt(r,t)}function pr(e){if(!e||!e.match)return["Unknown error. There was no error message to display.",""];var t=e.match(fr),r="(unknown)";return t&&(r=t[t.length-1],e=e.replace((t[t.length-2]||"")+r+":",""),e=e.replace(/(^[\s]+|[\s]+$)/g,"")),[r,e]}function gr(e){var t=e.name&&e.name.length&&e.name,r=e.constructor.name&&e.constructor.name.length&&e.constructor.name;return!t||!r?t||r:t==="Error"?r:t}const M={guessFunctionName:hr,guessErrorClass:pr,gatherContext:Vt,parse:dr,Stack:lt,Frame:Bt};function mr(e,t){var r=e.level,n=yt[r]||0,s=t.reportLevel,i=yt[s]||0;return!(n<i)}function yr(e){return function(t,r){var n=!!t._isUncaught;delete t._isUncaught;var s=t._originalArgs;delete t._originalArgs;try{y(r.onSendCallback)&&r.onSendCallback(n,s,t)}catch(i){r.onSendCallback=null,e.error("Error while calling onSendCallback, removing",i)}try{if(y(r.checkIgnore)&&r.checkIgnore(n,s,t))return!1}catch(i){r.checkIgnore=null,e.error("Error while calling custom checkIgnore(), removing",i)}return!0}}function vr(e){return function(t,r){return!Jt(t,r,"blocklist",e)}}function br(e){return function(t,r){return Jt(t,r,"safelist",e)}}function _r(e,t,r){if(!e)return!r;var n=e.frames;if(!n||n.length===0)return!r;for(var s,i,o,a,u=t.length,c=n.length,l=0;l<c;l++){if(s=n[l],i=s.filename,!g(i,"string"))return!r;for(var f=0;f<u;f++)if(o=t[f],a=new RegExp(o),a.test(i))return!0}return!1}function Jt(e,t,r,n){var s=!1;r==="blocklist"&&(s=!0);var i,o;try{if(i=s?t.hostBlockList:t.hostSafeList,o=I(e,"body.trace_chain")||[I(e,"body.trace")],!i||i.length===0||o.length===0||!o[0])return!s;for(var a=o.length,u=0;u<a;u++)if(_r(o[u],i,s))return!0}catch(l){s?t.hostBlockList=null:t.hostSafeList=null;var c=s?"hostBlockList":"hostSafeList";return n.error("Error while reading your configuration's "+c+" option. Removing custom "+c+".",l),!s}return!1}function wr(e){return function(t,r){var n,s,i,o,a,u,c;try{if(a=!1,i=r.ignoredMessages,!i||i.length===0||(c=xr(t),c.length===0))return!0;for(o=i.length,n=0;n<o;n++)for(u=new RegExp(i[n],"gi"),s=0;s<c.length;
9s++)if(a=u.test(c[s]),a)return!1}catch{r.ignoredMessages=null,e.error("Error while reading your configuration's ignoredMessages option. Removing custom ignoredMessages.")}return!0}}function xr(e){var t=e.body,r=[];if(t.trace_chain){var n=t.trace_chain;for(const s of n)r.push(I(s,"exception.message"))}return t.trace&&r.push(I(t,"trace.exception.message")),t.message&&r.push(I(t,"message.body")),r}class Sr{constructor(t,r){this.queue=t,this.options=r,this.transforms=[],this.diagnostic={}}configure(t){this.queue?.configure(t);const r=this.options;return this.options=v(r,t),this}addTransform(t){return y(t)&&this.transforms.push(t),this}log(t,r){if(r=y(r)?r:()=>{},!this.options.enabled)return r(new Error("Rollbar is not enabled"),null);this.queue.addPendingItem(t);const n=t.err;this._applyTransforms(t,(s,i)=>{if(s)return this.queue.removePendingItem(t),r(s,null);this.queue.addItem(i,r,n,t)})}_applyTransforms(t,r){let n=-1;const s=this.transforms.length,i=this.transforms,o=this.options,a=(u,c)=>{if(u){r(u,null);return}if(n++,n===s){r(null,c);return}i[n](c,o,a)};a(null,t)}}class tt{constructor(t,r,n,s,i){this.rateLimiter=t,this.api=r,this.logger=n,this.options=s,this.replay=i,this.predicates=[],this.pendingItems=[],this.pendingRequests=[],this.retryQueue=[],this.retryHandle=null,this.waitCallback=null,this.waitIntervalID=null}configure(t){this.api?.configure(t);const r=this.options;return this.options=v(r,t),this}addPredicate(t){return y(t)&&this.predicates.push(t),this}addPendingItem(t){this.pendingItems.push(t)}removePendingItem(t){const r=this.pendingItems.indexOf(t);r!==-1&&this.pendingItems.splice(r,1)}addItem(t,r,n,s){(!r||!y(r))&&(r=function(){});const i=t.data,o=this._applyPredicates(i);if(o.stop){this.removePendingItem(s),r(o.err);return}if(this._maybeLog(i,n),this.removePendingItem(s),!this.options.transmit){r(new Error("Transmit disabled"));return}this.replay&&i.body&&(t.replayId=this.replay.capture(null,i.uuid,{type:"occurrence",level:t.level}),t.replayId&&qt(t.data,[{key:"replay_id",value:t.replayId}])),this.pendingRequests.push(i);try{this._makeApiRequest(i,(a,u,c)=>{this._dequeuePendingRequest(i),t.replayId&&this.replay.sendOrDiscardReplay(t.replayId,a,u,c),r(a,u)})}catch(a){this._dequeuePendingRequest(i),t.replayId&&this.replay?.discard(t.replayId),r(a)}}wait(t){y(t)&&(this.waitCallback=t,!this._maybeCallWait()&&(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitIntervalID=setInterval(()=>{this._maybeCallWait()},500)))}_applyPredicates(t){let r=null;for(let n=0,s=this.predicates.length;n<s;n++)if(r=this.predicates[n](t,this.options),!r||r.err!==void 0)return{stop:!0,err:r.err};return{stop:!1,err:null}}
9_makeApiRequest(t,r){const n=this.rateLimiter.shouldSend(t);n.shouldSend?this.api.postItem(t,(s,i,o)=>{s?this._maybeRetry(s,t,r):r(s,i,o)}):n.error?r(n.error):this.api.postItem(n.payload,r)}static RETRIABLE_ERRORS=["ECONNRESET","ENOTFOUND","ESOCKETTIMEDOUT","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH","EPIPE","EAI_AGAIN"];_maybeRetry(t,r,n){let s=!1;if(this.options.retryInterval){for(let i=0,o=tt.RETRIABLE_ERRORS.length;i<o;i++)if(t.code===tt.RETRIABLE_ERRORS[i]){s=!0;break}s&&ht(this.options.maxRetries)&&(r.retries=r.retries?r.retries+1:1,r.retries>this.options.maxRetries&&(s=!1))}s?this._retryApiRequest(r,n):n(t)}_retryApiRequest(t,r){this.retryQueue.push({item:t,callback:r}),this.retryHandle||(this.retryHandle=setInterval(()=>{for(;this.retryQueue.length;){const n=this.retryQueue.shift();this._makeApiRequest(n.item,n.callback)}},this.options.retryInterval))}_dequeuePendingRequest(t){const r=this.pendingRequests.indexOf(t);r!==-1&&(this.pendingRequests.splice(r,1),this._maybeCallWait())}_maybeLog(t,r){if(this.logger&&this.options.verbose){let n=r||I(t,"body.trace.exception.message")||I(t,"body.trace_chain.0.exception.message");if(n){this.logger.error(n);return}n=I(t,"body.message.body"),n&&this.logger.log(n)}}_maybeCallWait(){return y(this.waitCallback)&&this.pendingItems.length===0&&this.pendingRequests.length===0?(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitCallback(),!0):!1}}class A{static globalSettings={startTime:Date.now(),maxItems:void 0,itemsPerMinute:void 0};constructor(t={}){this.startTime=Date.now(),this.counter=0,this.perMinCounter=0,this.platform=null,this.platformOptions={},this.configureGlobal(t)}configureGlobal(t={}){const{startTime:r,maxItems:n,itemsPerMinute:s}=t;r!==void 0&&(A.globalSettings.startTime=r),n!==void 0&&(A.globalSettings.maxItems=n),s!==void 0&&(A.globalSettings.itemsPerMinute=s)}shouldSend(t,r=Date.now()){const n=r-this.startTime;(n<0||n>=6e4)&&(this.startTime=r,this.perMinCounter=0);const s=A.globalSettings.maxItems,i=A.globalSettings.itemsPerMinute;if(B(t,s,this.counter))return it(this.platform,this.platformOptions,`${s} max items reached`,!1);if(B(t,i,this.perMinCounter))return it(this.platform,this.platformOptions,`${i} items per minute reached`,!1);this.counter+=1,this.perMinCounter+=1;const o=!B(t,s,this.counter),a=o,u=o&&!B(t,i,this.perMinCounter);return it(this.platform,this.platformOptions,null,u,s,i,a)}setPlatformOptions(t,r){this.platform=t,this.platformOptions=r}}function B(e,t,r){return!e.ignoreRateLimit&&t>=1&&r>t}function it(e,t,r,n,s,i,o){let a=null;const u=r?new Error(r):null;
9return!u&&!n&&(a=Er(e,t,s,i,o)),{error:u,shouldSend:n,payload:a}}function Er(e,t,r,n,s){const i=t.environment||t.payload&&t.payload.environment,a={body:{message:{body:s?"item per minute limit reached, ignoring errors until timeout":"maxItems has been hit, ignoring errors until reset.",extra:{maxItems:r,itemsPerMinute:n}}},language:"javascript",environment:i,notifier:{version:t.notifier&&t.notifier.version||t.version}};return e==="browser"?(a.platform="browser",a.framework="browser-js",a.notifier.name="rollbar-browser-js"):e==="server"?(a.framework=t.framework||"node-js",a.notifier.name=t.notifier.name):e==="react-native"&&(a.framework=t.framework||"react-native",a.notifier.name=t.notifier.name),a}function m(e,t,r,n,s,i,o){this.options=v(e),this.logger=r,m.rateLimiter.configureGlobal(this.options),m.rateLimiter.setPlatformOptions(o,this.options),this.api=t,this.queue=new tt(m.rateLimiter,t,r,this.options,i),this.tracing=s;var a=this.options.tracer||null;ft(a)?(this.tracer=a,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier=new Sr(this.queue,this.options),this.telemeter=n,Wt(e),this.lastError=null,this.lastErrorHash="none"}var Ir={maxItems:0,itemsPerMinute:60};m.rateLimiter=new A(Ir);m.prototype.global=function(e){return m.rateLimiter.configureGlobal(e),this};m.prototype.configure=function(e,t){var r=this.options,n={};t&&(n={payload:t}),this.options=v(r,e,n);var s=this.options.tracer||null;return ft(s)?(this.tracer=s,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier&&this.notifier.configure(this.options),this.telemeter&&this.telemeter.configure(this.options),Wt(e),this.global(this.options),ft(e.tracer)&&(this.tracer=e.tracer),this};m.prototype.log=function(e){var t=this._defaultLogLevel();return this._log(t,e)};m.prototype.debug=function(e){this._log("debug",e)};m.prototype.info=function(e){this._log("info",e)};m.prototype.warn=function(e){this._log("warning",e)};m.prototype.warning=function(e){this._log("warning",e)};m.prototype.error=function(e){this._log("error",e)};m.prototype.critical=function(e){this._log("critical",e)};m.prototype.wait=function(e){this.queue.wait(e)};m.prototype.captureEvent=function(e,t,r){return this.telemeter&&this.telemeter.captureEvent(e,t,r)};m.prototype.captureDomContentLoaded=function(e){return this.telemeter&&this.telemeter.captureDomContentLoaded(e)};m.prototype.captureLoad=function(e){return this.telemeter&&this.telemeter.captureLoad(e)};m.prototype.buildJsonPayload=function(e){return this.api.buildJsonPayload(e)};m.prototype.sendJsonPayload=function(e){this.api.postJsonPayload(e)};m.prototype._log=function(e,t){var r;if(t.callback&&(r=t.callback,delete t.callback),this.options.ignoreDuplicateErrors&&this._sameAsLastError(t)){if(r){var n=new Error("ignored identical item");n.item=t,r(n)}return}try{t.level=t.level||e,this._addItemAttributes(t),this._addTracingInfo(t);const s=this.telemeter;s&&(s._captureRollbarItem(t),t.telemetryEvents=s.copyEvents()||[]),this.notifier.log(t,r)}catch(s){r&&r(s),this.logger.error(s)}};m.prototype._addItemAttributes=function(e){const t=this.tracing?.getSpan(),s=[{key:"session_id",value:ve(this)||this.tracing?.sessionId},{key:"span_id",value:t?.spanId},{key:"trace_id",value:t?.traceId}];e._isUncaught&&s.push({key:"is_uncaught",value:"true"}),qt(e.data,s),t?.addEvent("rollbar.occurrence",[{key:"rollbar.occurrence.uuid",value:e.uuid}])};m.prototype._defaultLogLevel=function(){return this.options.logLevel||"debug"};m.prototype._sameAsLastError=function(e){if(!e._isUncaught)return!1;var t=kr(e);return this.lastErrorHash===t?!0:(this.lastError=e.err,this.lastErrorHash=t,!1)};m.prototype._addTracingInfo=function(e){if(this.tracer){var t=this.tracer.scope().active();if(Tr(t)){t.setTag("rollbar.error_uuid",e.uuid),t.setTag("rollbar.has_error",!0),t.setTag("error",!0),t.setTag("rollbar.item_url",`https://rollbar.com/item/uuid/?uuid=${e.uuid}`),t.setTag("rollbar.occurrence_url",`https://rollbar.com/occurrence/uuid/?uuid=${e.uuid}`);var r=t.context().toSpanId(),n=t.context().toTraceId();e.custom?(e.custom.opentracing_span_id=r,e.custom.opentracing_trace_id=n):e.custom={opentracing_span_id:r,opentracing_trace_id:n}}}};function kr(e){var t=e.message||"",r=(e.err||{}).stack||String(e.err);return t+"::"+r}function Wt(e){e.stackTraceLimit&&(Error.stackTraceLimit=e.stackTraceLimit)}function ft(e){if(!e||!e.scope||typeof e.scope!="function")return!1;var t=e.scope();return!(!t||!t.active||typeof t.active!="function")}function Tr(e){if(!e||!e.context||typeof e.context!="function")return!1;var t=e.context();return!(!t||!t.toSpanId||!t.toTraceId||typeof t.toSpanId!="function"||typeof t.toTraceId!="function")}const Rr={enabled:!1,endpoint:"api.rollbar.com/api/1/session/"};function Or(e,t,r){e._isUncaught&&(e.data._isUncaught=!0),e._originalArgs&&(e.data._originalArgs=e._originalArgs),r(null,e)}function Cr(e,t,r){var n=t.payload||{};n.body&&delete n.body,e.data=v(e.data,n),r(null,e)}function Lr(e,t,r){e.telemetryEvents&&R(e,"data.body.telemetry",e.telemetryEvents),r(null,e)}function Ar(e,t,r){if(!e.message){r(null,e);return}
9var n="data.body.trace_chain.0",s=I(e,n);if(s||(n="data.body.trace",s=I(e,n)),s){if(!(s.exception&&s.exception.description)){R(e,n+".exception.description",e.message),r(null,e);return}var i=I(e,n+".extra")||{},o=v(i,{message:e.message});R(e,n+".extra",o)}r(null,e)}function Pr(e){return function(t,r,n){var s=v(t),i=null;try{y(r.transform)&&(i=r.transform(s.data,t))}catch(o){r.transform=null,e.error("Error while calling custom transform() function. Removing custom transform().",o),n(null,t);return}Yt(i)?i.then(function(o){o&&(s.data=o),n(null,s)},function(o){n(o,t)}):n(null,s)}}function Nr(e,t,r){if(!t.sendConfig)return r(null,e);var n="_rollbarConfig",s=I(e,"data.custom")||{};s[n]=t,e.data.custom=s,r(null,e)}function ot(e,t){y(e[t])&&(e[t]=e[t].toString())}function qr(e,t,r){var n=t._configuredOptions;ot(n,"transform"),ot(n,"checkIgnore"),ot(n,"onSendCallback"),delete n.accessToken,e.data.notifier.configured_options=n,r(null,e)}function Hr(e,t,r){var n=v(e.notifier.client.notifier.diagnostic,e.diagnostic);if(I(e,"err._isAnonymous")&&(n.is_anonymous=!0),e._isUncaught&&(n.is_uncaught=e._isUncaught),e.err)try{n.raw_error={message:e.err.message,name:e.err.name,constructor_name:e.err.constructor&&e.err.constructor.name,filename:e.err.fileName,line:e.err.lineNumber,column:e.err.columnNumber,stack:e.err.stack}}catch(s){n.raw_error={failed:String(s)}}e.data.notifier.diagnostic=v(e.data.notifier.diagnostic,n),r(null,e)}const Mr=[...Ke,"cc-number","card number","cardnumber","cardnum","ccnum","ccnumber","cc num","creditcardnumber","credit card number","newcreditcardnumber","new credit card","creditcardno","credit card no","card#","card #","cc-csc","cvc","cvc2","cvv2","ccv2","security code","card verification","name on credit card","name on card","nameoncard","cardholder","card holder","name des karteninhabers","ccname","card type","cardtype","cc type","cctype","payment type","expiration date","expirationdate","expdate","cc-exp","ccmonth","ccyear"],Ur={scrubFields:Mr};function jr(e,t,r){if(e){var n;if(typeof t._rollbarOldOnError=="function")n=t._rollbarOldOnError;else if(e.onerror){for(n=e.onerror;n._rollbarOldOnError;)n=n._rollbarOldOnError;t._rollbarOldOnError=n}t.handleAnonymousErrors();var s=function(){var i=Array.prototype.slice.call(arguments,0);Dr(e,t,n,i)};e.onerror=s}}function Dr(e,t,r,n){e._rollbarWrappedError&&(n[4]||(n[4]=e._rollbarWrappedError),n[5]||(n[5]=e._rollbarWrappedError._rollbarContext),e._rollbarWrappedError=null);var s=t.handleUncaughtException.apply(t,n);r&&r.apply(e,n),s==="anonymous"&&(t.anonymousErrorsPending+=1)}function Fr(e,t,r){if(e){typeof e._rollbarURH=="function"&&e._rollbarURH.belongsToShim&&e.removeEventListener("unhandledrejection",e._rollbarURH);var n=function(s){var i,o,a;try{i=s.reason}catch{i=void 0}try{o=s.promise}catch{o="[unhandledrejection] error getting `promise` from event"}try{a=s.detail,!i&&a&&(i=a.reason,o=a.promise)}catch{}i||(i="[unhandledrejection] error getting `reason` from event"),t&&t.handleUnhandledRejection&&t.handleUnhandledRejection(i,o)};n.belongsToShim=r,e._rollbarURH=n,e.addEventListener("unhandledrejection",n)}}function Vr(e,t){return I(t,"plugins.jquery.ignoreAjaxErrors")?!I(e,"body.message.extra.isAjax"):!0}const Br={enabled:!1,autoStart:!0,triggerDefaults:{samplingRatio:1,preDuration:300,postDuration:5},triggers:[{type:"occurrence",level:["error","critical"]}],debug:{logErrors:!0,logEmits:!1},inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,maskInputOptions:{password:!0,email:!1,tel:!1,text:!1,color:!1,date:!1,"datetime-local":!1,month:!1,number:!1,range:!1,search:!1,time:!1,url:!1,week:!1},maskAllInputs:!1,blockClass:"rb-block",maskTextClass:"rb-mask",ignoreClass:"rb-ignore",slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}};function Jr(e,t,r){if(e.err&&M.Stack(e.err).name==="DOMException"){var n=new Error;n.name=e.err.name,n.message=e.err.message,n.stack=e.err.stack,n.nested=e.err,e.err=n}r(null,e)}function Wr(e,t,r){if(e.data=e.data||{},e.err)try{e.stackInfo=e.err._savedStackTrace||M.parse(e.err,e.skipFrames),t.addErrorContext&&$r(e)}catch(n){S.error("Error while parsing the error object.",n);try{e.message=e.err.message||e.err.description||e.message||String(e.err)}
9catch(s){e.message=String(e.err)||String(s)}delete e.err}r(null,e)}function $r(e){var t=[],r=e.err;for(t.push(r);r.nested||r.cause;)r=r.nested||r.cause,t.push(r);fe(e,t)}function Xr(e,t,r){!e.message&&!e.stackInfo&&!e.custom&&r(new Error("No message, stack info, or custom data"),null),r(null,e)}function zr(e,t,r){var n=t.payload&&t.payload.environment||t.environment;e.data=v(e.data,{environment:n,level:e.level,endpoint:t.endpoint,platform:"browser",framework:"browser-js",language:"javascript",server:{},uuid:e.uuid,notifier:{name:"rollbar-browser-js",version:t.version},custom:e.custom}),r(null,e)}function Gr(e){return function(t,r,n){var s={};e&&e.location&&(s.url=e.location.href,s.query_string=e.location.search);var i="$remote_ip";r.captureIp?r.captureIp!==!0&&(i+="_anonymize"):i=null,i&&(s.user_ip=i),Object.keys(s).length>0&&R(t,"data.request",s),n(null,t)}}function Kr(e){return function(t,r,n){if(!e)return n(null,t);var s=e.navigator||{},i=e.screen||{};R(t,"data.client",{runtime_ms:t.timestamp-e._rollbarStartTime,timestamp:Math.round(t.timestamp/1e3),javascript:{browser:s.userAgent,language:s.language,cookie_enabled:s.cookieEnabled,screen:{width:i.width,height:i.height}}}),n(null,t)}}function Zr(e){return function(t,r,n){if(!e||!e.navigator)return n(null,t);for(var s=[],i=e.navigator.plugins||[],o,a=0,u=i.length;a<u;++a)o=i[a],s.push({name:o.name,description:o.description});R(t,"data.client.javascript.plugins",s),n(null,t)}}function Qr(e,t,r){e.stackInfo?e.stackInfo.traceChain?Yr(e,t,r):tn(e,t,r):$t(e,t,r)}function $t(e,t,r){var n=e.message,s=e.custom;n||(n="Item sent with null or missing arguments.");var i={body:n};s&&(i.extra=v(s)),R(e,"data.body",{message:i}),r(null,e)}function Xt(e,t=null){let r=(t||e.stackInfo).stack;return r&&r.length===0&&e._unhandledStackInfo&&e._unhandledStackInfo.stack&&(r=e._unhandledStackInfo.stack),r}function Yr(e,t,r){for(var n=e.stackInfo.traceChain,s=[],i=n.length,o=0;o<i;o++){var a=zt(e,n[o],t);s.push(a)}R(e,"data.body",{trace_chain:s}),r(null,e)}function tn(e,t,r){var n=Xt(e);if(n){var s=zt(e,e.stackInfo,t);R(e,"data.body",{trace:s}),r(null,e)}else{var i=e.stackInfo,o=M.guessErrorClass(i.message),a=Gt(i,o[0],t),u=o[1];e.message=a+": "+u,$t(e,t,r)}}function zt(e,t,r){var n=e&&e.data.description,s=e&&e.custom,i=Xt(e,t),o=M.guessErrorClass(t.message),a=Gt(t,o[0],r),u=o[1],c={exception:{class:a,message:u}};if(n&&(c.exception.description=n),i){i.length===0&&(c.exception.stack=t.rawStack,c.exception.raw=String(t.rawException));var l,f,h,d,p,b,_,E;for(c.frames=[],_=0;_<i.length;++_)l=i[_],f={filename:l.url?ne(l.url):"(unknown)",lineno:l.line||null,method:!l.func||l.func==="?"?"[anonymous]":l.func,colno:l.column},r.sendFrameUrl&&(f.url=l.url),!(f.method&&f.method.endsWith&&f.method.endsWith("_rollbar_wrapped"))&&(h=d=p=null,b=l.context?l.context.length:0,b&&(E=Math.floor(b/2),d=l.context.slice(0,E),h=l.context[E],p=l.context.slice(E)),h&&(f.code=h),(d||p)&&(f.context={},d&&d.length&&(f.context.pre=d),p&&p.length&&(f.context.post=p)),l.args&&(f.args=l.args),c.frames.push(f));c.frames.reverse(),s&&(c.extra=v(s))}return c}function Gt(e,t,r){return e.name?e.name:r.guessErrorClass?t:"(unknown)"}function en(e){return function(t,r,n){if(e){var s=r.scrubFields||[],i=r.scrubPaths||[];t.data=e(t.data,s,i)}n(null,t)}}function rn({accessToken:e,url:t,method:r,payload:n,headers:s,callback:i,timeout:o}){var a,u;ht(o)&&(a=new AbortController,u=setTimeout(function(){a.abort()},o)),s={"Content-Type":"application/json","X-Rollbar-Access-Token":e,signal:a&&a.signal,...s},fetch(t,{method:r,headers:s,body:n}).then(function(c){u&&clearTimeout(u);const l=c.headers,h=t.endsWith("/api/1/item/")?{"Rollbar-Replay-Enabled":l.get("Rollbar-Replay-Enabled"),"Rollbar-Replay-RateLimit-Remaining":l.get("Rollbar-Replay-RateLimit-Remaining"),"Rollbar-Replay-RateLimit-Reset":l.get("Rollbar-Replay-RateLimit-Reset")}:{},d=c.json();i(null,d,h)}).catch(function(c){S.error(c.message),i(c)})}function nn({accessToken:e,url:t,method:r,payload:n,headers:s,callback:i,requestFactory:o,timeout:a}){var u;if(o?u=o():u=sn(),!u)return i(new Error("No way to send a request"));try{try{var c=function(){try{if(c&&u.readyState===4){c=void 0;var f=vt(u.responseText);if(on(u)){const _=t.endsWith("/api/1/item/")?{"Rollbar-Replay-Enabled":u.getResponseHeader("Rollbar-Replay-Enabled"),"Rollbar-Replay-RateLimit-Remaining":u.getResponseHeader("Rollbar-Replay-RateLimit-Remaining"),"Rollbar-Replay-RateLimit-Reset":u.getResponseHeader("Rollbar-Replay-RateLimit-Reset")}:{};i(f.error,f.value,_);return}else if(an(u)){if(u.status===403){var h=f.value&&f.value.message;S.error(h)}i(new Error(String(u.status)))}else{var d="XHR response had no status code (likely connection failure)";i(Ct(d))}}}catch(b){var p;b&&b.stack?p=b:p=new Error(b),i(p)}};if(u.open(r,t,!0),u.setRequestHeader){u.setRequestHeader("Content-Type","application/json"),u.setRequestHeader("X-Rollbar-Access-Token",e);for(const[f,h]of Object.entries(s??{}))u.setRequestHeader(f,h)}ht(a)&&(u.timeout=a),u.onreadystatechange=c,u.send(n)}catch{if(typeof XDomainRequest<"u"){if(!window||!window.location)return i(new Error("No window available during request, unknown environment"));window.location.href.substring(0,5)==="http:"&&t.substring(0,5)==="https"&&(t="http"+t.substring(5));var l=new XDomainRequest;l.onprogress=()=>{},l.ontimeout=function(){var h="Request timed out",d="ETIMEDOUT";i(Ct(h,d))},l.onerror=function(){i(new Error("Error during request"))},l.onload=function(){var h=vt(l.responseText);i(h.error,h.value)},l.open(r,t,!0),l.send(n)}else i(new Error("Cannot find a method to transport a request"))}}catch(f){i(f)}}function sn(){var e=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],t,r,n=e.length;for(r=0;r<n;r++)try{t=e[r]();break}catch{}return t}function on(e){return e&&e.status&&e.status===200}function an(e){return e&&g(e.status,"number")&&e.status>=400&&e.status<600}function Ct(e,t){var r=new Error(e);return r.code=t||"ENOTFOUND",r}function j(e){this.truncation=e}j.prototype.get=function(e,t,r,n,s){(!n||!y(n))&&(n=()=>{}),oe(e,t,r);var i="GET",o=dt(t);
9this._makeZoneRequest({accessToken:e,url:o,method:i,callback:n,requestFactory:s,timeout:t.timeout,transport:t.transport})};j.prototype.post=function({accessToken:e,options:t,payload:r,headers:n,callback:s,requestFactory:i}){if((!s||!y(s))&&(s=()=>{}),!r)return s(new Error("Cannot send empty request"));var o;if(this.truncation&&r.body?o=this.truncation.truncate(r):o=O(r),o.error)return s(o.error);var a="POST",u=dt(t);this._makeZoneRequest({accessToken:e,url:u,method:a,payload:o.value,headers:n,callback:s,requestFactory:i,timeout:t.timeout,transport:t.transport})};j.prototype.postJsonPayload=function(e,t,r,n,s){(!n||!y(n))&&(n=()=>{});var i="POST",o=dt(t);this._makeZoneRequest({accessToken:e,url:o,method:i,payload:r,callback:n,requestFactory:s,timeout:t.timeout,transport:t.transport})};j.prototype._makeZoneRequest=function(){var e=typeof window<"u"&&window||typeof self<"u"&&self,t=e&&e.Zone&&e.Zone.root,r=Array.prototype.slice.call(arguments);t?t.run(()=>{this._makeRequest.apply(void 0,r)}):this._makeRequest.apply(void 0,r)};j.prototype._makeRequest=function(e){const{payload:t,callback:r,transport:n}=e;if(typeof RollbarProxy<"u")return un(t,r);n==="fetch"?rn(e):nn(e)};function un(e,t){var r=new RollbarProxy;r.sendJsonPayload(e,function(n){},function(n){t(new Error(n))})}function K(e){var t={protocol:null,auth:null,host:null,path:null,hash:null,href:e,hostname:null,port:null,pathname:null,search:null,query:null},r,n;if(r=e.indexOf("//"),r!==-1?(t.protocol=e.substring(0,r),n=r+2):n=0,r=e.indexOf("@",n),r!==-1&&(t.auth=e.substring(n,r),n=r+1),r=e.indexOf("/",n),r===-1){if(r=e.indexOf("?",n),r===-1)return r=e.indexOf("#",n),r===-1?t.host=e.substring(n):(t.host=e.substring(n,r),t.hash=e.substring(r)),t.hostname=t.host.split(":")[0],t.port=t.host.split(":")[1],t.port&&(t.port=parseInt(t.port,10)),t;t.host=e.substring(n,r),t.hostname=t.host.split(":")[0],t.port=t.host.split(":")[1],t.port&&(t.port=parseInt(t.port,10)),n=r}else t.host=e.substring(n,r),t.hostname=t.host.split(":")[0],t.port=t.host.split(":")[1],t.port&&(t.port=parseInt(t.port,10)),n=r;if(r=e.indexOf("#",n),r===-1?t.path=e.substring(n):(t.path=e.substring(n,r),t.hash=e.substring(r)),t.path){var s=t.path.split("?");t.pathname=s[0],t.query=s[1],t.search=t.query?"?"+t.query:null}return t}const cn=Object.freeze(Object.defineProperty({__proto__:null,parse:K},Symbol.toStringTag,{value:"Module"}));let L=null;class w{constructor(t,r){S.init({logLevel:t.logLevel||"error"}),this.options=rt(dn,t,null,S),this.options._configuredOptions=t,this.components=this.components||{};const n=this.components.telemeter,s=this.components.instrumenter;this.wrapGlobals=this.components.wrapGlobals,this.scrub=this.components.scrub;const i=this.components.truncation,o=this.components.tracing,a=this.components.replay,u=new j(i),c=new Je(this.options,u,cn,i);if(o&&(this.tracing=new o(at(),c,this.options),this.tracing.initSession()),n&&(this.telemeter=new n(this.options,this.tracing)),a&&te()){const h=this.options.replay;this.replay=new a({tracing:this.tracing,telemeter:this.telemeter,options:h}),h.enabled&&h.autoStart&&this.replay.recorder.start()}this.client=r||new m(this.options,c,S,this.telemeter,this.tracing,this.replay,"browser");var l=at(),f=typeof document<"u"&&document;this.isChrome=l.chrome&&l.chrome.runtime,this.anonymousErrorsPending=0,ln(this.client.notifier,this,l),fn(this.client.queue),this.setupUnhandledCapture(),s&&(this.instrumenter=new s(this.options,this.client.telemeter,this,l,f),this.instrumenter.instrument()),this.setSessionAttributesFromOptions(t),this.rollbar=this}static init(t,r){return L?L.global(t).configure(t):(L=new w(t,r),L)}static setComponents(t){w.prototype.components=t}global(t){return this.client.global(t),this}configure(t,r){t.logLevel&&S.init({logLevel:t.logLevel}),this.setSessionAttributesFromOptions(t);var n=this.options,s={};return r&&(s={payload:r}),this.options=rt(n,t,s,S),this.options._configuredOptions=rt(n._configuredOptions,t,s),this.tracing?.configure(this.options),this.replay?.configure(this.options.replay),this.client.configure(this.options,r),this.instrumenter?.configure(this.options),this.setupUnhandledCapture(),this}lastError(){return this.client.lastError}log(){var t=this._createItem(arguments),r=t.uuid;return this.client.log(t),{uuid:r}}debug(){var t=this._createItem(arguments),r=t.uuid;return this.client.debug(t),{uuid:r}}info(){var t=this._createItem(arguments),r=t.uuid;return this.client.info(t),{uuid:r}}warn(){var t=this._createItem(arguments),r=t.uuid;return this.client.warn(t),{uuid:r}}warning(){var t=this._createItem(arguments),r=t.uuid;return this.client.warning(t),{uuid:r}}error(){var t=this._createItem(arguments),r=t.uuid;return this.client.error(t),{uuid:r}}critical(){var t=this._createItem(arguments),r=t.uuid;return this.client.critical(t),{uuid:r}}buildJsonPayload(t){return this.client.buildJsonPayload(t)}sendJsonPayload(t){return this.client.sendJsonPayload(t)}triggerDirectReplay(t){return this.triggerReplay({type:"direct",...t})}triggerReplay(t){return this.replay?this.replay.triggerReplay(t):null}setupUnhandledCapture(){var t=at();this.unhandledExceptionsInitialized||(this.options.captureUncaught||this.options.handleUncaughtExceptions)&&(jr(t,this),this.wrapGlobals&&this.options.wrapGlobalEventHandlers&&this.wrapGlobals(t,this),this.unhandledExceptionsInitialized=!0),this.unhandledRejectionsInitialized||(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections)&&(Fr(t,this),this.unhandledRejectionsInitialized=!0)}handleUncaughtException(t,r,n,s,i,o){if(!(!this.options.captureUncaught&&!this.options.handleUncaughtExceptions)){if(this.options.inspectAnonymousErrors&&this.isChrome&&i===null&&r==="")return"anonymous";var a,u=bt(t,r,n,s,i,"onerror","uncaught exception",M);et(i)?(a=this._createItem([t,i,o]),a._unhandledStackInfo=u):et(r)?(a=this._createItem([t,r,o]),a._unhandledStackInfo=u):(a=this._createItem([t,o]),a.stackInfo=u),a.level=this.options.uncaughtErrorLevel,a._isUncaught=!0,this.client.log(a)}}handleAnonymousErrors(){if(!this.options.inspectAnonymousErrors||!this.isChrome)return;const t=(r,n)=>{if(this.options.inspectAnonymousErrors&&this.anonymousErrorsPending){if(this.anonymousErrorsPending-=1,!r)return;r._isAnonymous=!0,this.handleUncaughtException(r.message,null,null,null,r)}return r.stack};try{Error.prepareStackTrace=t}catch(r){this.options.inspectAnonymousErrors=!1,this.error("anonymous error handler failed",r)}}handleUnhandledRejection(t,r){if(!(!this.options.captureUnhandledRejections&&!this.options.handleUnhandledRejections)){var n="unhandled rejection was null or undefined!";if(t)if(t.message)n=t.message;else{var s=O(t);s.value&&(n=s.value)}var i=t&&t._rollbarContext||r&&r._rollbarContext,o;et(t)?o=this._createItem([n,t,i]):(o=this._createItem([n,t,i]),o.stackInfo=bt(n,"",0,0,null,"unhandledrejection","",M)),o.level=this.options.uncaughtErrorLevel,o._isUncaught=!0,o._originalArgs=o._originalArgs||[],o._originalArgs.push(r),this.client.log(o)}}wrap(t,r,n){try{var s;if(y(r)?s=r:s=function(){return r||{}},!y(t)||t._isWrap)return t;if(!t._rollbar_wrapped){t._rollbar_wrapped=function(){n&&y(n)&&n.apply(this,arguments);try{return t.apply(this,arguments)}catch(a){var o=a;throw o&&window._rollbarWrappedError!==o&&(g(o,"string")&&(o=new String(o)),o._rollbarContext=s()||{},o._rollbarContext._wrappedSource=t.toString(),window._rollbarWrappedError=o),o}},t._rollbar_wrapped._isWrap=!0;for(var i in t)T(t,i)&&i!=="_rollbar_wrapped"&&(t._rollbar_wrapped[i]=t[i])}return t._rollbar_wrapped}catch{return t}}captureEvent(){var t=pe(arguments);return this.client.captureEvent(t.type,t.metadata,t.level)}setSessionUser(t){this.tracing?.session&&this.tracing.session.setUser(t)}setSessionAttributes(t){this.tracing?.session&&(t={...t},this.tracing.session.setAttributes(t))}setSessionAttributesFromOptions(t){const r=t.person||t.payload?.person;r&&this.setSessionUser(r);const n=t.client?.javascript?.code_version||t.codeVersion||t.code_version||t.payload?.client?.javascript?.code_version||t.payload?.code_version||t.payload?.codeVersion;this.setSessionAttributes({"rollbar.codeVersion":n,"rollbar.notifier.name":"rollbar-browser-js","rollbar.notifier.version":t.version})}captureDomContentLoaded(t,r){return r||(r=new Date),this.client.captureDomContentLoaded(r)}captureLoad(t,r){return r||(r=new Date),this.client.captureLoad(r)}loadFull(){S.info("Unexpected Rollbar.loadFull() called on a Notifier instance. This can happen when Rollbar is loaded multiple times.")}_createItem(t){return ce(t,S,this)}static callInstance(t,r){if(!L){const n="Rollbar is not initialized";S.error(n);const s=hn(r);s&&s(new Error(n));return}return L[t].apply(L,r)}static global=(...t)=>w.callInstance("global",t);static configure=(...t)=>w.callInstance("configure",t);static lastError=(...t)=>w.callInstance("lastError",t);static log=(...t)=>w.callInstance("log",t);static debug=(...t)=>w.callInstance("debug",t);static info=(...t)=>w.callInstance("info",t);static warn=(...t)=>w.callInstance("warn",t);static warning=(...t)=>w.callInstance("warning",t);
9static error=(...t)=>w.callInstance("error",t);static critical=(...t)=>w.callInstance("critical",t);static buildJsonPayload=(...t)=>w.callInstance("buildJsonPayload",t);static sendJsonPayload=(...t)=>w.callInstance("sendJsonPayload",t);static wrap=(...t)=>w.callInstance("wrap",t);static captureEvent=(...t)=>w.callInstance("captureEvent",t)}function ln(e,t,r){e.addTransform(Jr).addTransform(Wr).addTransform(Xr).addTransform(zr).addTransform(Gr(r)).addTransform(Kr(r)).addTransform(Zr(r)).addTransform(Qr).addTransform(Ar).addTransform(Lr).addTransform(Nr).addTransform(en(t.scrub)).addTransform(Cr).addTransform(Pr(S)).addTransform(qr).addTransform(Hr).addTransform(Or)}function fn(e){e.addPredicate(mr).addPredicate(Vr).addPredicate(yr(S)).addPredicate(vr(S)).addPredicate(br(S)).addPredicate(wr(S))}function hn(e){for(var t=0,r=e.length;t<r;++t)if(y(e[t]))return e[t]}function at(){return typeof window<"u"&&window||typeof self<"u"&&self}const dn={environment:"unknown",version:D.version,scrubFields:Ur.scrubFields,logLevel:D.logLevel,reportLevel:D.reportLevel,uncaughtErrorLevel:D.uncaughtErrorLevel,endpoint:D.endpoint,verbose:!1,enabled:!0,transmit:!0,sendConfig:!1,includeItemsInTelemetry:!0,captureIp:!0,inspectAnonymousErrors:!0,ignoreDuplicateErrors:!0,wrapGlobalEventHandlers:!1,replay:Br,tracing:Rr};function pn(e){return typeof Headers>"u"?new P(e):new Headers(e)}function mt(e){return typeof e!="string"&&(e=String(e)),e.toLowerCase()}function gn(e){return typeof e!="string"&&(e=String(e)),e}function mn(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return t}function P(e){this.map={},e instanceof P?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}P.prototype.append=function(e,t){e=mt(e),t=gn(t);var r=this.map[e];this.map[e]=r?r+", "+t:t};P.prototype.get=function(e){return e=mt(e),this.has(e)?this.map[e]:null};P.prototype.has=function(e){return T(this.map,mt(e))};P.prototype.forEach=function(e,t){for(var r in this.map)T(this.map,r)&&e.call(t,this.map[r],r,this)};P.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),mn(e)};function C(e,t,r,n,s){var i=e[t];e[t]=r(i),n&&n[s].push([e,t,i])}function yn(e){for(var t=5,r=[],n,s=0;e&&s<t&&(n=Kt(e),!(!n||n.tagName==="html"));s++)r.unshift(n),e=e.parentNode;return r}function vn(e){for(var t=80,r=" > ",n=r.length,s=[],i=0,o,a,u=e.length-1;u>=0;u--){if(o=bn(e[u]),a=i+s.length*n+o.length,u<e.length-1&&a>=t+3){s.unshift("...");break}s.unshift(o),i+=o.length}return s.join(r)}function J(e){return vn(yn(e))}function bn(e){if(!e||!e.tagName)return"";var t=[e.tagName];e.id&&t.push("#"+e.id),e.classes&&t.push("."+e.classes.join("."));for(const r of e.attributes)t.push("["+r.key+'="'+r.value+'"]');return t.join("")}function Kt(e){if(!e||!e.tagName)return null;var t={},r;t.tagName=e.tagName.toLowerCase(),e.id&&(t.id=e.id),r=e.className,r&&typeof r=="string"&&(t.classes=r.split(/\s+/));var n=["type","name","title","alt"];t.attributes=[];for(const s of n){const i=e.getAttribute(s);i&&t.attributes.push({key:s,value:i})}return t}function _n(e,t,r){try{for(const n of t)if(typeof n=="string"){if(e.classList.contains(n))return!0}else for(const s of e.classList)if(n.test(s))return!0;for(const n of r)if(e.matches(n))return!0}catch{}return!1}const W={network:!0,networkResponseHeaders:!1,networkResponseBody:!1,networkRequestHeaders:!1,networkRequestBody:!1,networkErrorOnHttp5xx:!1,networkErrorOnHttp4xx:!1,networkErrorOnHttp0:!1,log:!0,dom:!0,navigation:!0,connectivity:!0,contentSecurityPolicy:!0,errorOnContentSecurityPolicy:!1};function Lt(e,t){let r;for(;e[t].length;)r=e[t].shift(),r[0][r[1]]=r[2]}function wn(e){if(!e||!e.attributes)return null;const t=e.attributes;for(const r of t)if(r.key==="name")return r.value;return null}function xn(e){const t=[];for(const r of e)t.push(new RegExp(r,"i"));return function(r){const n=wn(r);if(!n)return!1;for(const s of t)if(s.test(n))return!0;return!1}}class Sn{constructor(t,r,n,s,i){this.options=t;let o=t.autoInstrument;t.enabled===!1||o===!1?this.autoInstrument={}:(g(o,"object")||(o=W),this.autoInstrument=v(W,o)),this.configureScrubbing(),this.telemeter=r,this.rollbar=n,this.diagnostic=n.client.notifier.diagnostic,this._window=s||{},this._document=i||{},this.replacements={network:[],log:[],navigation:[],connectivity:[]},this.eventRemovers={dom:[],connectivity:[],contentsecuritypolicy:[]},this._location=this._window.location,this._lastHref=this._location&&this._location.href}configureScrubbing(){const t=this.options;this.scrubTelemetryInputs=!!(t.scrubTelemetryInputs??t.replay?.maskAllInputs),this.telemetryScrubber=t.telemetryScrubber,this.defaultValueScrubber=xn(t.scrubFields),this.maskInputFn=t.replay?.maskInputFn,this.maskInputOptions=t.replay?.maskInputOptions||{},this.scrubClasses=[t.replay?.blockClass,t.replay?.ignoreClass,t.replay?.maskTextClass].filter(
9Boolean),this.scrubSelectors=[t.replay?.blockSelector,t.replay?.ignoreSelector,t.replay?.maskTextSelector].filter(Boolean)}configure(t){this.options=v(this.options,t);let r=t.autoInstrument;const n=v(this.autoInstrument);t.enabled===!1||r===!1?this.autoInstrument={}:(g(r,"object")||(r=W),this.autoInstrument=v(W,r)),this.configureScrubbing(),this.instrument(n)}instrument(t){this.autoInstrument.network&&!(t&&t.network)?this.instrumentNetwork():!this.autoInstrument.network&&t&&t.network&&this.deinstrumentNetwork(),this.autoInstrument.log&&!(t&&t.log)?this.instrumentConsole():!this.autoInstrument.log&&t&&t.log&&this.deinstrumentConsole(),this.autoInstrument.dom&&!(t&&t.dom)?this.instrumentDom():!this.autoInstrument.dom&&t&&t.dom&&this.deinstrumentDom(),this.autoInstrument.navigation&&!(t&&t.navigation)?this.instrumentNavigation():!this.autoInstrument.navigation&&t&&t.navigation&&this.deinstrumentNavigation(),this.autoInstrument.connectivity&&!(t&&t.connectivity)?this.instrumentConnectivity():!this.autoInstrument.connectivity&&t&&t.connectivity&&this.deinstrumentConnectivity(),this.autoInstrument.contentSecurityPolicy&&!(t&&t.contentSecurityPolicy)?this.instrumentContentSecurityPolicy():!this.autoInstrument.contentSecurityPolicy&&t&&t.contentSecurityPolicy&&this.deinstrumentContentSecurityPolicy()}deinstrumentNetwork(){Lt(this.replacements,"network")}instrumentNetwork(){const t=this;function r(n,s){n in s&&y(s[n])&&C(s,n,function(i){return t.rollbar.wrap(i)})}if("XMLHttpRequest"in this._window){const n=this._window.XMLHttpRequest.prototype;C(n,"open",function(s){return function(i,o){const a=At(o);return(g(o,"string")||a)&&(o=a?o.toString():o,this.__rollbar_xhr?(this.__rollbar_xhr.method=i,this.__rollbar_xhr.url=o,this.__rollbar_xhr.status_code=null,this.__rollbar_xhr.start_time_ms=x(),this.__rollbar_xhr.end_time_ms=null):this.__rollbar_xhr={method:i,url:o,status_code:null,start_time_ms:x(),end_time_ms:null}),s.apply(this,arguments)}},this.replacements,"network"),C(n,"setRequestHeader",function(s){return function(i,o){return this.__rollbar_xhr||(this.__rollbar_xhr={}),g(i,"string")&&g(o,"string")&&(t.autoInstrument.networkRequestHeaders&&(this.__rollbar_xhr.request_headers||(this.__rollbar_xhr.request_headers={}),this.__rollbar_xhr.request_headers[i]=o),i.toLowerCase()==="content-type"&&(this.__rollbar_xhr.request_content_type=o)),s.apply(this,arguments)}},this.replacements,"network"),C(n,"send",function(s){return function(i){const o=this,a=t.rollbar?.tracing;if(wt(t.options,a,o.__rollbar_xhr?.url))try{o.setRequestHeader("baggage",`rollbar.session.id=${a.sessionId}`)}catch{}function u(){if(o.__rollbar_xhr&&(o.__rollbar_xhr.status_code===null&&(o.__rollbar_xhr.status_code=0,t.autoInstrument.networkRequestBody&&(o.__rollbar_xhr.request=i),o.__rollbar_event=t.captureNetwork(o.__rollbar_xhr,"xhr",void 0)),o.readyState<2&&(o.__rollbar_xhr.start_time_ms=x()),o.readyState>3)){const c=x();o.__rollbar_xhr.end_time_ms=c;let l=null;if(o.__rollbar_xhr.response_content_type=o.getResponseHeader("Content-Type"),t.autoInstrument.networkResponseHeaders){const d=t.autoInstrument.networkResponseHeaders;l={};try{let p;if(d===!0){const b=o.getAllResponseHeaders();if(b){const _=b.trim().split(/[\r\n]+/);let E,N;for(const Zt of _)E=Zt.split(": "),p=E.shift(),N=E.join(": "),l[p]=N}}else for(const b of d)l[b]=o.getResponseHeader(b)}catch{}}let f=null;if(t.autoInstrument.networkResponseBody)try{f=o.responseText}catch{}let h=null;(f||l)&&(h={},f&&(t.isJsonContentType(o.__rollbar_xhr.response_content_type)?h.body=t.scrubJson(f):h.body=f),l&&(h.headers=l)),h&&(o.__rollbar_xhr.response=h);try{let d=o.status;d=d===1223?204:d,o.__rollbar_xhr.status_code=d,t.addOtelNetworkResponse(o.__rollbar_event,c,d),o.__rollbar_event.level=t.telemeter.levelFromStatus(d),t.errorOnHttpStatus(o.__rollbar_xhr)}catch{}}}return r("onload",o),r("onerror",o),r("onprogress",o),"onreadystatechange"in o&&y(o.onreadystatechange)?C(o,"onreadystatechange",function(c){return t.rollbar.wrap(c,void 0,u)}):o.onreadystatechange=u,o.__rollbar_xhr&&t.trackHttpErrors()&&(o.__rollbar_xhr.stack=new Error().stack),s.apply(this,arguments)}},this.replacements,"network")}"fetch"in this._window&&C(this._window,"fetch",function(n){return function(s,i){const o=[...arguments],a=o[0];let u="GET",c;
9const l=At(a);g(a,"string")||l?c=l?a.toString():a:a&&(c=a.url,a.method&&(u=a.method)),o[1]&&o[1].method&&(u=o[1].method);const f=t.rollbar?.tracing;if(wt(t.options,f,c)){const p={baggage:`rollbar.session.id=${f.sessionId}`};ye(o,p)}const h={method:u,url:c,status_code:null,start_time_ms:x(),end_time_ms:null};if(o[1]&&o[1].headers){const p=pn(o[1].headers);h.request_content_type=p.get("Content-Type"),t.autoInstrument.networkRequestHeaders&&(h.request_headers=t.fetchHeaders(p,t.autoInstrument.networkRequestHeaders))}t.autoInstrument.networkRequestBody&&(o[1]&&o[1].body?h.request=o[1].body:o[0]&&!g(o[0],"string")&&o[0].body&&(h.request=o[0].body));const d=t.captureNetwork(h,"fetch",void 0);return t.trackHttpErrors()&&(h.stack=new Error().stack),n.apply(this,o).then(function(p){const b=x();h.end_time_ms=b,h.status_code=p.status,t.addOtelNetworkResponse(d,b,p.status),h.response_content_type=p.headers.get("Content-Type");let _=null;t.autoInstrument.networkResponseHeaders&&(_=t.fetchHeaders(p.headers,t.autoInstrument.networkResponseHeaders));let E=null;return t.autoInstrument.networkResponseBody&&typeof p.text=="function"&&(E=p.clone().text()),(_||E)&&(h.response={},E&&(typeof E.then=="function"?E.then(function(N){N&&t.isJsonContentType(h.response_content_type)?h.response.body=t.scrubJson(N):h.response.body=N}):h.response.body=E),_&&(h.response.headers=_)),t.errorOnHttpStatus(h),p})}},this.replacements,"network")}captureNetwork(t,r,n){return t.request&&this.isJsonContentType(t.request_content_type)&&(t.request=this.scrubJson(t.request)),this.telemeter.captureNetwork(t,r,n)}isJsonContentType(t){return!!(t&&g(t,"string")&&t.toLowerCase().includes("json"))}addOtelNetworkResponse(t,r,n){t.otelAttributes&&(t.otelAttributes["response.timeUnixNano"]=(r*1e6).toString(),t.otelAttributes.statusCode=n)}scrubJson(t){return JSON.stringify(Ht(JSON.parse(t),this.options.scrubFields))}fetchHeaders(t,r){const n={};try{if(r===!0){if(typeof t.entries=="function"){const s=t.entries();let i=s.next();for(;!i.done;)n[i.value[0]]=i.value[1],i=s.next()}}else for(const s of r)n[s]=t.get(s)}catch{}return n}trackHttpErrors(){return this.autoInstrument.networkErrorOnHttp5xx||this.autoInstrument.networkErrorOnHttp4xx||this.autoInstrument.networkErrorOnHttp0}errorOnHttpStatus(t){const r=t.status_code;if(r>=500&&this.autoInstrument.networkErrorOnHttp5xx||r>=400&&this.autoInstrument.networkErrorOnHttp4xx||r===0&&this.autoInstrument.networkErrorOnHttp0){const n=new Error("HTTP request failed with Status "+r);n.stack=t.stack,this.rollbar.error(n,{skipFrames:1})}}deinstrumentConsole(){let t;for(;this.replacements.log.length;)t=this.replacements.log.shift(),this._window.console[t[0]]=t[1]}instrumentConsole(){if(!this._window?.console?.log)return;const t=this,r=this._window.console;function n(i){const o=r[i],a=r,u=i==="warn"?"warning":i;r[i]=function(){const c=Array.prototype.slice.call(arguments),l=ge(c);t.telemeter.captureLog(l,u,null,x()),o&&Function.prototype.apply.call(o,a,c)},t.replacements.log.push([i,o])}const s=["debug","info","warn","error","log"];try{for(const i of s)n(i)}catch(i){this.diagnostic.instrumentConsole={error:i.message}}}deinstrumentDom(){this.removeListeners("dom")}instrumentDom(){this.addListener("dom",this._window,["click","dblclick","contextmenu"],t=>this.handleEvent("click",t)),this.addListener("dom",this._window,["dragstart","dragend","dragenter","dragleave","drop"],t=>this.handleEvent("dragdrop",t)),this.addListener("dom",this._window,["blur","focus"],t=>this.handleEvent("focus",t)),this.addListener("dom",this._window,["submit","invalid"],t=>this.handleEvent("form",t)),this.addListener("dom",this._window,["input","change"],t=>this.handleEvent("input",t)),this.addListener("dom",this._window,["resize"],t=>this.handleEvent("resize",t)),this.addListener("dom",this._document,["DOMContentLoaded"],t=>this.handleEvent("contentLoaded",t))}handleEvent(t,r){try{return{click:this.handleClick,dragdrop:this.handleDrag,focus:this.handleFocus,form:this.handleForm,input:this.handleInput,resize:this.handleResize,contentLoaded:this.handleContentLoaded}[t].call(this,r)}catch(n){S.log(`${t} handler error`,r,n,n.stack)}}handleContentLoaded(t){this.rollbar.triggerReplay({type:"navigation",path:new URL(this._location.href).pathname})}handleClick(t){const r=t.target?.tagName.toLowerCase();["input","select","textarea"].includes(r)||this.telemeter.captureClick({type:t.type,isSynthetic:!t.isTrusted,element:J(t.target),timestamp:x()})}handleFocus(t){const r=t.type,n=t.target?.window?"window":J(t.target);this.telemeter.captureFocus({type:r,isSynthetic:!t.isTrusted,element:n,timestamp:x()})}handleForm(t){}handleResize(t){const r=window.screen.width/window.innerWidth;this.telemeter.captureResize({type:t.type,isSynthetic:!t.isTrusted,width:window.innerWidth,height:window.innerHeight,textZoomRatio:r,timestamp:x()})}handleDrag(t){const r=t.type;let n,s,i,o;if(r==="drop"){n=[],s=[];const a=[...t.dataTransfer.files,...t.dataTransfer.items];for(const u of a)u.kind&&u.type&&(n.push(u.kind),s.push(u.type))}["drop","dragstart"].includes(r)&&(i=t.dataTransfer?.dropEffect,o=t.dataTransfer?.effectAllowed),this.telemeter.captureDragDrop({type:r,isSynthetic:!t.isTrusted,element:J(t.target),dropEffect:i,effectAllowed:o,kinds:JSON.stringify(n),mediaTypes:JSON.stringify(s),timestamp:x()})}scrubInputValue(t,r,n,s){const i="******";if(s==="password"||this.scrubTelemetryInputs)return i;{const o=Kt(r);if(this.telemetryScrubber){if(this.telemetryScrubber(o))return i}else if(this.defaultValueScrubber(o))return i}return _n(r,this.scrubClasses,this.scrubSelectors)?i:this.maskInputOptions[n.toLowerCase()]||this.maskInputOptions[s]?this.maskInputFn?this.maskInputFn(t,r):i:t}handleInput(t){const r=t.type,n=t.target?.tagName.toLowerCase();let s=t.target?.value,i=t.target?.attributes?.type?.value||t.target?.type;
9switch(s!==void 0&&(s=this.scrubInputValue(s,t.target,n,i)),r){case"input":if(["radio","checkbox"].includes(i))return;["select","textarea"].includes(n)&&(i=n);break;case"change":if(!["radio","checkbox"].includes(i))return;i==="checkbox"&&(s=t.target?.checked);break}this.telemeter.captureInput({type:i,isSynthetic:!t.isTrusted,element:J(t.target),value:s,timestamp:x()})}deinstrumentNavigation(){const t=this._window.chrome;!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState&&Lt(this.replacements,"navigation")}instrumentNavigation(){const t=this._window.chrome;if(!(!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState))return;const s=this;C(this._window,"onpopstate",function(i){return function(){const o=s._location.href;s.handleUrlChange(s._lastHref,o),i&&i.apply(this,arguments)}},this.replacements,"navigation"),C(this._window.history,"pushState",function(i){return function(){const o=arguments.length>2?arguments[2]:void 0;return o&&s.handleUrlChange(s._lastHref,String(o)),i.apply(this,arguments)}},this.replacements,"navigation")}handleUrlChange(t,r){const n=K(this._location.href),s=K(r),i=K(t);this._lastHref=r,n.protocol===s.protocol&&n.host===s.host&&(r=s.path+(s.hash||"")),n.protocol===i.protocol&&n.host===i.host&&(t=i.path+(i.hash||"")),this.telemeter.captureNavigation(t,r,null,x()),this.rollbar.triggerReplay({type:"navigation",path:r})}deinstrumentConnectivity=function(){this.removeListeners("connectivity")};instrumentConnectivity(){const t=this;this.addListener("connectivity",this._window,["online","offline"],r=>t.handleConnectivity(r))}handleConnectivity(t){const r=t.type;this.telemeter.captureConnectivityChange({type:r,isSynthetic:!t.isTrusted,timestamp:x()})}handleCspEvent(t){let r="Security Policy Violation: blockedURI: "+t.blockedURI+", violatedDirective: "+t.violatedDirective+", effectiveDirective: "+t.effectiveDirective+", ";t.sourceFile&&(r+="location: "+t.sourceFile+", line: "+t.lineNumber+", col: "+t.columnNumber+", "),r+="originalPolicy: "+t.originalPolicy,this.telemeter.captureLog(r,"error",null,x()),this.handleCspError(r)}handleCspError(t){this.autoInstrument.errorOnContentSecurityPolicy&&this.rollbar.error(t)}deinstrumentContentSecurityPolicy(){this.removeListeners("contentsecuritypolicy")}instrumentContentSecurityPolicy(){if(!("addEventListener"in this._document))return;const t=this.handleCspEvent.bind(this);this.addListener("contentsecuritypolicy",this._document,["securitypolicyviolation"],t)}addListener(t,r,n,s){if(r.addEventListener)for(const i of n){const o={capture:!0,passive:!0};r.addEventListener(i,s,o,!0),this.eventRemovers[t].push(function(){r.removeEventListener(i,s,o)})}}removeListeners(t){let r;for(;this.eventRemovers[t].length;)r=this.eventRemovers[t].shift(),r()}}function At(e){return typeof URL<"u"&&e instanceof URL}function En(e,t,r){if(e){var n="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),s,i;for(s=0;s<n.length;++s)i=n[s],e[i]&&e[i].prototype&&In(t,e[i].prototype,r)}}function In(e,t,r){if(T(t,"addEventListener")){for(var n=t.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var s=function(a,u,c){n.call(this,a,e.wrap(u),c)};s._rollbarOldAdd=n,s.belongsToShim=r,t.addEventListener=s;for(var i=t.removeEventListener;i._rollbarOldRemove&&i.belongsToShim;)i=i._rollbarOldRemove;var o=function(a,u,c){i.call(this,a,u&&u._rollbar_wrapped||u,c)};o._rollbarOldRemove=i,o.belongsToShim=r,t.removeEventListener=o}}w.setComponents({telemeter:xe,instrumenter:Sn,wrapGlobals:En,scrub:Ht,truncation:De,tracing:He});const kn=/^(?:(?:chrome|moz|safari|safari-web)-extension|webkit-masked-url):\/\//;function Tn(e){return(e.body?.trace_chain??(e.body?.trace?[e.body.trace]:[])).some(r=>{const n=r.frames?.at(-1)?.filename;return n!==void 0&&kn.test(n)})}let $=null,Pt=!1;const Rn=["Failed to connect to MetaMask","MetaMask"];function On(e){return Array.from(e).some(t=>{const r=typeof t=="string"?t:t instanceof Error?t.message:"";return Rn.some(n=>r.includes(n))})}function Ln(){if(Pt||(Pt=!0,typeof window>"u"))return $;const{accessToken:e,environment:t}=Qt().rollbar;return e&&($=new w({accessToken:e,environment:t,captureUncaught:!0,captureUnhandledRejections:!0,checkIgnore:(r,n,s)=>On(n)||Tn(s),payload:{client:{javascript:{code_version:"c1c7486a6",source_map_enabled:!0,guess_uncaught_frames:!0}}}})),$}export{Ln as c};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.