rollbar 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/rollbar.cjs +260 -3
  2. package/dist/rollbar.js +88 -2
  3. package/dist/rollbar.js.map +1 -1
  4. package/dist/rollbar.min.cjs +1 -1
  5. package/dist/rollbar.min.js +1 -1
  6. package/dist/rollbar.min.js.map +1 -1
  7. package/dist/rollbar.named-amd.js +88 -2
  8. package/dist/rollbar.named-amd.js.map +1 -1
  9. package/dist/rollbar.named-amd.min.js +1 -1
  10. package/dist/rollbar.named-amd.min.js.map +1 -1
  11. package/dist/rollbar.noconflict.umd.js +88 -2
  12. package/dist/rollbar.noconflict.umd.js.map +1 -1
  13. package/dist/rollbar.noconflict.umd.min.js +1 -1
  14. package/dist/rollbar.noconflict.umd.min.js.map +1 -1
  15. package/dist/rollbar.replay.js +88 -2
  16. package/dist/rollbar.replay.js.map +1 -1
  17. package/dist/rollbar.replay.min.js +1 -1
  18. package/dist/rollbar.replay.min.js.map +1 -1
  19. package/dist/rollbar.replay.noconflict.umd.js +88 -2
  20. package/dist/rollbar.replay.noconflict.umd.js.map +1 -1
  21. package/dist/rollbar.replay.noconflict.umd.min.js +1 -1
  22. package/dist/rollbar.replay.noconflict.umd.min.js.map +1 -1
  23. package/dist/rollbar.replay.umd.js +88 -2
  24. package/dist/rollbar.replay.umd.js.map +1 -1
  25. package/dist/rollbar.replay.umd.min.js +1 -1
  26. package/dist/rollbar.replay.umd.min.js.map +1 -1
  27. package/dist/rollbar.snippet.js +1 -1
  28. package/dist/rollbar.umd.js +88 -2
  29. package/dist/rollbar.umd.js.map +1 -1
  30. package/dist/rollbar.umd.min.js +1 -1
  31. package/dist/rollbar.umd.min.js.map +1 -1
  32. package/index.d.ts +15 -0
  33. package/package.json +2 -1
  34. package/src/browser/telemetry.js +25 -0
  35. package/src/defaults.js +1 -1
  36. package/src/rollbar.js +3 -1
  37. package/src/server/middleware/rollbarExpressMiddleware.js +63 -0
  38. package/src/server/rollbar.js +13 -0
  39. package/src/server/telemetry.js +120 -1
  40. package/src/utility.js +70 -0
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see rollbar.umd.min.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rollbar=e():t.rollbar=e()}(this,function(){return function(){"use strict";var t={d:function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{default:function(){return Yn}});var r={};function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t,e){return e===s(t)}function s(t){var e=i(t);return"object"!==e?e:t?t instanceof Error?"error":{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase():"null"}function u(t){return a(t,"function")}function l(t){return null!=t&&("object"==i(t)||"function"==typeof t)}function c(t,e){return null!=t&&(Object.hasOwn?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e))}function f(t){return Number.isFinite(t)}function p(t){return a(t,"error")||a(t,"exception")}function d(){return"********"}t.r(r),t.d(r,{parse:function(){return pn}});var h={debug:0,info:1,warning:2,error:3,critical:4};function y(t){var e=function(t){if(!a(t,"string"))return;for(var e=v,r=e.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=0,i=e.key.length;o<i;++o)n[e.key[o]]=r[o]||"";return n[e.q.name]={},n[e.key[12]].replace(e.q.parser,function(t,r,o){r&&(n[e.q.name][r]=o)}),n}(t);return e?(""===e.anchor&&(e.source=e.source.replace("#","")),t=e.source.replace("?"+e.query,"")):"(unknown)"}var v={strictMode:!1,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 m(t,e){if(!(e=e||t.protocol)&&t.port&&(80===t.port?e="http:":443===t.port&&(e="https:")),e=e||"https:",!t.hostname)return null;var r=e+"//"+t.hostname;return t.port&&(r=r+":"+t.port),t.path&&(r+=t.path),r}function b(t,e){var r,n;try{r=JSON.stringify(t)}catch(o){if(e&&u(e))try{r=e(t)}catch(t){n=t}else n=o}return{error:n,value:r}}function g(t){var e,r;try{e=JSON.parse(t)}catch(t){r=t}return{error:r,value:e}}function w(t,e,r,n,o,i,a,s){var u={url:e||"",line:r,column:n};u.func=s.guessFunctionName(u.url,u.line),u.context=s.gatherContext(u.url,u.line);var l="undefined"!=typeof document&&document&&document.location&&document.location.href,c="undefined"!=typeof window&&window&&window.navigator&&window.navigator.userAgent;return{mode:i,message:o?String(o):t||a,url:l,stack:[u],useragent:c}}function k(t,e){return function(r,n){try{e(r,n)}catch(e){t.error(e)}}}function S(t){return function t(e,r){var n,o,i,u={};try{for(o in e)(n=e[o])&&(a(n,"object")||a(n,"array"))?r.includes(n)?u[o]="Removed circular reference: "+s(n):((i=r.slice()).push(n),u[o]=t(n,i)):u[o]=n}catch(t){u="Failed cloning custom data: "+t.message}return u}(t,[t])}function _(t,e,r,n,o){for(var i,a,u,l,c,f,p=[],d=[],h=0,y=t.length;h<y;++h){var v=s(f=t[h]);switch(d.push(v),v){case"undefined":break;case"string":i?p.push(f):i=f;break;case"function":l=k(e,f);break;case"date":p.push(f);break;case"error":case"domexception":case"exception":a?p.push(f):a=f;break;case"object":case"array":if(f instanceof Error||"undefined"!=typeof DOMException&&f instanceof DOMException){a?p.push(f):a=f;break}if(n&&"object"===v&&!c){for(var m=0,b=n.length;m<b;++m)if(void 0!==f[n[m]]){c=f;break}if(c)break}u?p.push(f):u=f;break;default:if(f instanceof Error||"undefined"!=typeof DOMException&&f instanceof DOMException){a?p.push(f):a=f;break}p.push(f)}}u&&(u=S(u)),p.length>0&&(u||(u=S({})),u.extraArgs=S(p));var g,w={message:i,err:a,custom:u,timestamp:P(),callback:l,notifier:r,diagnostic:{},uuid:(g=P(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(g+16*Math.random())%16|0;return g=Math.floor(g/16),("x"===t?e:7&e|8).toString(16)}))};return w.data=w.data||{},function(t,e){e&&void 0!==e.level&&(t.level=e.level,delete e.level);e&&void 0!==e.skipFrames&&(t.skipFrames=e.skipFrames,delete e.skipFrames)}(w,u),n&&c&&(w.request=c),o&&(w.lambdaContext=o),w._originalArgs=t,w.diagnostic.original_arg_types=d,w}var O=["log","network","dom","navigation","error","manual"],x=["critical","error","warning","info","debug"];function E(t,e){var r,o=n(t);try{for(o.s();!(r=o.n()).done;){if(r.value===e)return!0}}catch(t){o.e(t)}finally{o.f()}return!1}function j(t,e){t.attributes=t.attributes||[];var r,o=n(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;void 0!==i.value&&t.attributes.push(i)}}catch(t){o.e(t)}finally{o.f()}}function I(t,e){if(t){var r=e.split("."),n=t;try{for(var o=0,i=r.length;o<i;++o)n=n[r[o]]}catch(t){n=void 0}return n}}function T(t,e,r){if(t){Object.setPrototypeOf(t,null);var n=e.split("."),o=n.length;if(!(o<1))if(1!==o)try{for(var i=t[n[0]]||{},a=i,s=1;s<o-1;++s)i[n[s]]=i[n[s]]||{},i=i[n[s]];i[n[o-1]]=r,t[n[0]]=a}catch(t){return}else t[n[0]]=r}}function P(){return Date.now?Date.now():Number(new Date)}function A(t,e,r,n){var o=R(t,e,r);return o=function(t,e){t.hostWhiteList&&!t.hostSafeList&&(t.hostSafeList=t.hostWhiteList,t.hostWhiteList=void 0,e&&e.log("hostWhiteList is deprecated. Use hostSafeList."));t.hostBlackList&&!t.hostBlockList&&(t.hostBlockList=t.hostBlackList,t.hostBlackList=void 0,e&&e.log("hostBlackList is deprecated. Use hostBlockList."));return t}(o,n),!e||e.overwriteScrubFields||e.scrubFields&&(o.scrubFields=(t.scrubFields||[]).concat(e.scrubFields)),o}function R(){function t(t){if(!t||"[object Object]"!==Object.prototype.toString.call(t))return!1;var e,r=c(t,"constructor"),n=t.constructor&&t.constructor.prototype&&c(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;for(e in t);return void 0===e||c(t,e)}var e,r,n,o,i,a=Object.create(null),s=null,u=arguments.length;for(e=0;e<u;e++)if(null!=(s=arguments[e]))for(i in s)r=a[i],a!==(n=s[i])&&(n&&t(n)?(o=r&&t(r)?r:{},a[i]=R(o,n)):void 0!==n&&(a[i]=n));return a}var C=function(t,e,r){var n,o,i,s,u=a(t,"object"),l=a(t,"array"),f=[];if(r=r||{obj:[],mapped:[]},u){if(s=r.obj.indexOf(t),u&&-1!==s)return r.mapped[s]||r.obj[s];r.obj.push(t),s=r.obj.length-1}if(u)for(n in t)c(t,n)&&f.push(n);else if(l)for(i=0;i<t.length;++i)f.push(i);var p=u?{}:[],d=!0;for(i=0;i<f.length;++i)o=t[n=f[i]],p[n]=e(n,o,r),d=d&&p[n]===t[n];return u&&!d&&(r.mapped[s]=p),d?t:p};function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||N(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=N(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function N(t,e){if(t){if("string"==typeof t)return D(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(t,e):void 0}}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function M(t,e){var r=e.split("."),n=r.length-1;try{var o,i=q(r.entries());try{for(i.s();!(o=i.n()).done;){var a=L(o.value,2),s=a[0],u=a[1];s<n?t=t[u]:t[u]=d()}}catch(t){i.e(t)}finally{i.f()}}catch(t){}}var U=function(t,e,r){if(e=e||[],r){var n,o=q(r);try{for(o.s();!(n=o.n()).done;){M(t,n.value)}}catch(t){o.e(t)}finally{o.f()}}var i=function(t){var e,r=[],n=q(t);try{for(n.s();!(e=n.n()).done;){var o="^\\[?(%5[bB])?"+e.value+"\\[?(%5[bB])?\\]?(%5[dD])?$";r.push(new RegExp(o,"i"))}}catch(t){n.e(t)}finally{n.f()}return r}(e),s=function(t){var e,r=[],n=q(t);try{for(n.s();!(e=n.n()).done;){var o="\\[?(%5[bB])?"+e.value+"\\[?(%5[bB])?\\]?(%5[dD])?";r.push(new RegExp("("+o+"=)([^&\\n]+)","igm"))}}catch(t){n.e(t)}finally{n.f()}return r}(e);function u(t,e){return e+"********"}return C(t,function t(e,r,n){var o=function(t,e){var r,n=q(i);try{for(n.s();!(r=n.n()).done;)if(r.value.test(t)){e=d();break}}catch(t){n.e(t)}finally{n.f()}return e}(e,r);return o===r?a(r,"object")||a(r,"array")?C(r,t,n):function(t){if(a(t,"string")){var e,r=q(s);try{for(r.s();!(e=r.n()).done;){var n=e.value;t=t.replace(n,u)}}catch(t){r.e(t)}finally{r.f()}}return t}(o):o})},H=["otelAttributes"];function F(t){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F(t)}function J(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function V(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?J(Object(r),!0).forEach(function(e){B(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function B(t,e,r){return(e=$(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function W(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$(n.key),n)}}function $(t){var e=function(t,e){if("object"!=F(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=F(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==F(e)?e:e+""}var G=100;function z(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}var X=function(){return t=function t(e,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.queue=[],this.options=R(e);var o=this.options.maxTelemetryEvents||G;this.maxQueueSize=Math.max(0,Math.min(o,G)),this.tracing=r,this.telemetrySpan=null===(n=this.tracing)||void 0===n?void 0:n.startSpan("rollbar-telemetry",{})},e=[{key:"configure",value:function(t){var e=this.options;this.options=R(e,t);var r=this.options.maxTelemetryEvents||G,n=Math.max(0,Math.min(r,G)),o=0;this.queue.length>n&&(o=this.queue.length-n),this.maxQueueSize=n,this.queue.splice(0,o)}},{key:"copyEvents",value:function(){var t=Array.prototype.slice.call(this.queue,0);if(u(this.options.filterTelemetry))try{for(var e=t.length;e--;)this.options.filterTelemetry(t[e])&&t.splice(e,1)}catch(t){this.options.filterTelemetry=null}return t=(t=t.filter(function(t){return"connectivity"!==t.type})).map(function(t){t.otelAttributes;var e=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,H);return e}),t}},{key:"exportTelemetrySpan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.telemetrySpan&&(this.telemetrySpan.end(t),this.telemetrySpan=this.tracing.startSpan("rollbar-telemetry",{}))}},{key:"capture",value:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a={level:Z(t,r),type:t,timestamp_ms:o||P(),body:e,source:"client"};n&&(a.uuid=n),i&&(a.otelAttributes=i);try{if(u(this.options.filterTelemetry)&&this.options.filterTelemetry(a))return!1}catch(t){this.options.filterTelemetry=null}return this.push(a),a}},{key:"captureEvent",value:function(t,e,r,n){return this.capture(t,e,r,n)}},{key:"captureError",value:function(t,e,r,n){var o,i=t.message||String(t),a={message:i};t.stack&&(a.stack=t.stack);var s={message:i,level:e,type:"error",uuid:r};return null===(o=this.telemetrySpan)||void 0===o||o.addEvent("rollbar-occurrence-event",s,z(n)),this.capture("error",a,e,r,n,s)}},{key:"captureLog",value:function(t,e,r,n){var o,i=r?"rollbar-occurrence-event":"rollbar-log-event",a=V({message:t,level:e},r?{type:"message",uuid:r}:{});return null===(o=this.telemetrySpan)||void 0===o||o.addEvent(i,a,z(n)),this.capture("log",{message:t},e,r,n,a)}},{key:"captureNetwork",value:function(t,e,r,n){var o,i,a;e=e||"xhr",t.subtype=t.subtype||e,n&&(t.request=n);var s=this.levelFromStatus(t.status_code),u=1e6*(t.end_time_ms||0),l={type:t.subtype,method:t.method,url:t.url,statusCode:t.status_code,"request.headers":JSON.stringify(t.request_headers||{}),"response.headers":JSON.stringify((null===(o=t.response)||void 0===o?void 0:o.headers)||{}),"response.timeUnixNano":u.toString()},c=t.request,f=null===(i=t.response)||void 0===i?void 0:i.body;return c&&(l["request.body"]=JSON.stringify(c)),f&&(l["response.body"]=JSON.stringify(f)),null===(a=this.telemetrySpan)||void 0===a||a.addEvent("rollbar-network-event",l,z(t.start_time_ms)),this.capture("network",t,s,r,t.start_time_ms,l)}},{key:"levelFromStatus",value:function(t){return t>=200&&t<400?"info":0===t||t>=400?"error":"info"}},{key:"captureDom",value:function(t,e,r,n,o){var i={subtype:t,element:e};return void 0!==r&&(i.value=r),void 0!==n&&(i.checked=n),this.capture("dom",i,"info",o)}},{key:"captureInput",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.value,a=t.timestamp,s="rollbar-input-event",u={type:s,subtype:r,element:o,value:i},l={type:r,isSynthetic:n,element:o,value:i,endTimeUnixNano:z(a)},c=this._getRepeatedEvent(s,l);return c?this._updateRepeatedEvent(c,l,a):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(s,l,z(a)),this.capture("dom",u,"info",null,a,l))}},{key:"captureClick",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.timestamp,a="rollbar-click-event",s={type:a,subtype:r,element:o},u={type:r,isSynthetic:n,element:o,endTimeUnixNano:z(i)},l=this._getRepeatedEvent(a,u);return l?this._updateRepeatedEvent(l,u,i):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,z(i)),this.capture("dom",s,"info",null,i,u))}},{key:"_getRepeatedEvent",value:function(t,e){var r=this._lastEvent(this.queue);if(r&&r.body.type===t&&r.otelAttributes.target===e.target)return r}},{key:"_updateRepeatedEvent",value:function(t,e,r){var n=Math.max(r-t.timestamp_ms,1);t.body.value=e.value,t.otelAttributes.value=e.value,t.otelAttributes.height=e.height,t.otelAttributes.width=e.width,t.otelAttributes.textZoomRatio=e.textZoomRatio,t.otelAttributes.endTimeUnixNano=z(r),t.otelAttributes.durationUnixNano=z(n),t.otelAttributes.count=(t.otelAttributes.count||1)+1,t.otelAttributes.rate=t.otelAttributes.count/(n/1e3)}},{key:"_lastEvent",value:function(t){return t.length>0?t[t.length-1]:null}},{key:"captureFocus",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.timestamp,a="rollbar-focus-event",s={type:a,subtype:r,element:o},u={type:r,isSynthetic:n,element:o};return null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,z(i)),this.capture("dom",s,"info",null,i,u)}},{key:"captureResize",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.width,i=t.height,a=t.textZoomRatio,s=t.timestamp,u="rollbar-resize-event",l={type:u,subtype:r,width:o,height:i,textZoomRatio:a},c={type:r,isSynthetic:n,width:o,height:i,textZoomRatio:a},f=this._getRepeatedEvent(u,c);return f?this._updateRepeatedEvent(f,c,s):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(u,c,z(s)),this.capture("dom",l,"info",null,s,c))}},{key:"captureDragDrop",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.dropEffect,a=t.effectAllowed,s=t.kinds,u=t.mediaTypes,l=t.timestamp,c="rollbar-dragdrop-event",f={type:c,subtype:r,isSynthetic:n},p={type:r,isSynthetic:n};return"dragstart"===r&&(f=V(V({},f),{},{element:o,dropEffect:i,effectAllowed:a}),p=V(V({},p),{},{element:o,dropEffect:i,effectAllowed:a})),"drop"===r&&(f=V(V({},f),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u}),p=V(V({},p),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u})),null===(e=this.telemetrySpan)||void 0===e||e.addEvent(c,p,z(l)),this.capture("dom",f,"info",null,l,p)}},{key:"captureNavigation",value:function(t,e,r,n){var o;return null===(o=this.telemetrySpan)||void 0===o||o.addEvent("rollbar-navigation-event",{"previous.url.full":t,"url.full":e},z(n)),this.capture("navigation",{from:t,to:e},"info",r,n)}},{key:"captureDomContentLoaded",value:function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())}},{key:"captureLoad",value:function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())}},{key:"captureConnectivityChange",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.timestamp,i="rollbar-connectivity-event",a={type:i,subtype:r},s={type:r,isSynthetic:n};return null===(e=this.telemetrySpan)||void 0===e||e.addEvent(i,s,z(o)),this.capture("connectivity",a,"info",null,o,s)}},{key:"_captureRollbarItem",value:function(t){if(this.options.includeItemsInTelemetry)return t.err?this.captureError(t.err,t.level,t.uuid,t.timestamp):t.message?this.captureLog(t.message,t.level,t.uuid,t.timestamp):t.custom?this.capture("log",t.custom,t.level,t.uuid,t.timestamp):void 0}},{key:"push",value:function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()}}],e&&W(t.prototype,e),r&&W(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Z(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}var Q=X;function K(t){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K(t)}function Y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,tt(n.key),n)}}function tt(t){var e=function(t,e){if("object"!=K(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=K(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==K(e)?e:e+""}var et=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._currentContext=e?new Map(e):new Map}return e=t,(r=[{key:"getValue",value:function(t){return this._currentContext.get(t)}},{key:"setValue",value:function(e,r){var n=new t(this._currentContext);return n._currentContext.set(e,r),n}},{key:"deleteValue",value:function(e){var r=new t(self._currentContext);return r._currentContext.delete(e),r}}])&&Y(e.prototype,r),n&&Y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}(),rt=new et;function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function ot(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,it(n.key),n)}}function it(t){var e=function(t,e){if("object"!=nt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==nt(e)?e:e+""}var at=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.currentContext=rt},e=[{key:"active",value:function(){return this.currentContext}},{key:"enterContext",value:function(t){var e=this.currentContext;return this.currentContext=t||rt,e}},{key:"exitContext",value:function(t){return this.currentContext=t,this.currentContext}},{key:"with",value:function(t,e,r){var n=this.enterContext(t);try{for(var o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];return e.call.apply(e,[r].concat(i))}finally{this.exitContext(n)}}}],e&&ot(t.prototype,e),r&&ot(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function st(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}function ut(t,e){return[t[0]+e[0]+Math.trunc((t[1]+e[1])/1e9),(t[1]+e[1])%1e9]}var lt={fromMillis:st,toMillis:function(t){return 1e3*t[0]+Math.round(t[1]/1e6)},toNanos:function(t){return 1e9*t[0]+t[1]},add:ut,now:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?ut(st(performance.timeOrigin),st(performance.now())):st(Date.now())},isHrTime:function(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}};function ct(t){return ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ct(t)}function ft(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||dt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pt(t){return function(t){if(Array.isArray(t))return ht(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||dt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dt(t,e){if(t){if("string"==typeof t)return ht(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ht(t,e):void 0}}function ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function yt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vt(n.key),n)}}function vt(t){var e=function(t,e){if("object"!=ct(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ct(e)?e:e+""}var mt=function(){return t=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=e,this.options=r},e=[{key:"export",value:function(t,e){bt.push.apply(bt,pt(t))}},{key:"toPayload",value:function(){var t=this,e=bt.slice();if(bt.length=0,!e||!e.length)return{resourceSpans:[]};var r,n=e[0]&&e[0].resource||{},o=new Map,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=dt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(e);try{for(i.s();!(r=i.n()).done;){var a=r.value,s=a.instrumentationScope?"".concat(a.instrumentationScope.name,":").concat(a.instrumentationScope.version):"default:1.0.0";o.has(s)||o.set(s,{scope:a.instrumentationScope||{name:"default",version:"1.0.0",attributes:[]},spans:[]}),o.get(s).spans.push(this._transformSpan(a))}}catch(t){i.e(t)}finally{i.f()}return{resourceSpans:[{resource:this._transformResource(n),scopeSpans:Array.from(o.values()).map(function(e){return{scope:t._transformInstrumentationScope(e.scope),spans:e.spans}})}]}}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.api.postSpans(t,e)}},{key:"_transformSpan",value:function(t){var e,r=this,n=function(t){return Object.entries(t||{}).map(function(t){var e=ft(t,2),n=e[0],o=e[1];return{key:n,value:r._transformAnyValue(o)}})};return{traceId:t.spanContext.traceId,spanId:t.spanContext.spanId,parentSpanId:t.parentSpanId||"",name:t.name,kind:t.kind||1,startTimeUnixNano:lt.toNanos(t.startTime),endTimeUnixNano:lt.toNanos(t.endTime),attributes:n(t.attributes),events:(e=t.events,(e||[]).map(function(t){return{timeUnixNano:lt.toNanos(t.time),name:t.name,attributes:n(t.attributes)}}))}}},{key:"_transformResource",value:function(t){var e=this,r=t.attributes||{};return{attributes:Object.entries(r).map(function(t){var r=ft(t,2),n=r[0],o=r[1];return{key:n,value:e._transformAnyValue(o)}})}}},{key:"_transformInstrumentationScope",value:function(t){var e=this;return{name:t.name||"",version:t.version||"",attributes:(t.attributes||[]).map(function(t){return{key:t.key,value:e._transformAnyValue(t.value)}})}}},{key:"_transformAnyValue",value:function(t){var e=this;if(null==t)return{stringValue:""};var r=ct(t);return"string"===r?{stringValue:t}:"number"===r?Number.isInteger(t)?{intValue:t.toString()}:{doubleValue:t}:"boolean"===r?{boolValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(function(t){return e._transformAnyValue(t)})}}:"object"===r?{kvlistValue:{values:Object.entries(t).map(function(t){var r=ft(t,2),n=r[0],o=r[1];return{key:n,value:e._transformAnyValue(o)}})}}:{stringValue:String(t)}}}],e&&yt(t.prototype,e),r&&yt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),bt=[];var gt={gen:function(){var t=new Uint8Array(arguments.length>0&&void 0!==arguments[0]?arguments[0]:16);return crypto.getRandomValues(t),Array.from(t,function(t){return t.toString(16).padStart(2,"0")}).join("")}};function wt(t){return wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wt(t)}function kt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function St(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?kt(Object(r),!0).forEach(function(e){Ot(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xt(n.key),n)}}function Ot(t,e,r){return(e=xt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xt(t){var e=function(t,e){if("object"!=wt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=wt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==wt(e)?e:e+""}var Et="RollbarSession",jt=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ot(this,"_attributes",void 0),this.options=r,this.tracing=e,this.window=e.window,this.session=null,this._attributes={}},e=[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.session||(this.getSession()||this.createSession(),this.initSessionAttributes(t)),this}},{key:"getSession",value:function(){try{var t=this.window.sessionStorage.getItem(Et);if(!t)return null;this.session=JSON.parse(t)}catch(t){return null}return this}},{key:"createSession",value:function(){return this.session={id:gt.gen(),createdAt:Date.now()},this.setSession(this.session)}},{key:"setSession",value:function(t){var e=JSON.stringify(t);try{this.window.sessionStorage.setItem(Et,e)}catch(t){return null}return this}},{key:"attributes",get:function(){return this._attributes}},{key:"setAttributes",value:function(t){return this._attributes=St(St({},this._attributes),t),this}},{key:"setUser",value:function(t){return this.setAttributes({"user.id":null==t?void 0:t.id,"user.email":null==t?void 0:t.email,"user.name":(null==t?void 0:t.name)||(null==t?void 0:t.username)}),this}},{key:"initSessionAttributes",value:function(t){var e,r,n;return this.setAttributes(St({"session.id":this.session.id,"browser.brands":null===(e=navigator.userAgentData)||void 0===e?void 0:e.brands,"browser.language":navigator.language,"browser.mobile":null===(r=navigator.userAgentData)||void 0===r?void 0:r.mobile,"browser.platform":null===(n=navigator.userAgentData)||void 0===n?void 0:n.platform,"client.address":"$remote_ip","rollbar.notifier.framework":"browser-js","user_agent.original":navigator.userAgent},t)),this}}],e&&_t(t.prototype,e),r&&_t(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),It=function(){},Tt={debug:0,info:1,warn:2,error:3,disable:4},Pt={error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return It("error",e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return It("warn",e)},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return It("info",e)},debug:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return It("debug",e)},log:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return It("info",e)},init:function(t){var e=t.logLevel;It=function(t,r){Tt[t]<Tt[e]||(r.unshift("Rollbar:"),console[t].apply(console,r))}}},At=Pt;function Rt(t){return Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rt(t)}function Ct(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Lt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Lt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function qt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Nt(n.key),n)}}function Nt(t){var e=function(t,e){if("object"!=Rt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Rt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Rt(e)?e:e+""}var Dt=function(){return t=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.exporter=e,this.options=r,this.pendingSpans=new Map,this.transforms=[this.userTransform.bind(this)]},e=[{key:"addTransform",value:function(t){this.transforms.unshift(t)}},{key:"userTransform",value:function(t){this.options.transformSpan&&this.options.transformSpan({span:t})}},{key:"applyTransforms",value:function(t){var e,r=Ct(this.transforms);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{n(t)}catch(t){At.error("Error running span transform callback",t)}}}catch(t){r.e(t)}finally{r.f()}}},{key:"onStart",value:function(t,e){this.pendingSpans.set(t.span.spanContext.spanId,t)}},{key:"onEnd",value:function(t){this.applyTransforms(t.span),this.exporter.export([t.export()]),this.pendingSpans.delete(t.span.spanContext.spanId)}}],e&&qt(t.prototype,e),r&&qt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Mt(t){return Mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mt(t)}function Ut(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ht(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ht(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ft(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Jt(n.key),n)}}function Jt(t){var e=function(t,e){if("object"!=Mt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Mt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Mt(e)?e:e+""}var Vt=function(){return t=function t(e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.usePerformance=e.usePerformance,this.initReadableSpan(e),this.spanProcessor=e.spanProcessor,this.spanProcessor.onStart(this,e.context),e.attributes&&this.setAttributes(e.attributes),this},e=[{key:"initReadableSpan",value:function(t){var e;this.span={name:t.name,kind:t.kind,spanContext:t.spanContext,parentSpanId:t.parentSpanId,startTime:t.startTime||lt.now(t.usePerformance),endTime:[0,0],status:{code:0,message:""},attributes:{"session.id":null===(e=t.session)||void 0===e?void 0:e.id},links:[],events:[],duration:0,ended:!1,resource:t.resource,instrumentationScope:t.scope,droppedAttributesCount:0,droppedEventsCount:0,droppedLinksCount:0}}},{key:"spanContext",value:function(){return this.span.spanContext}},{key:"spanId",get:function(){return this.span.spanContext.spanId}},{key:"traceId",get:function(){return this.span.spanContext.traceId}},{key:"setAttribute",value:function(t,e){return null==e||this.span.ended||0===t.length||(this.span.attributes[t]=e),this}},{key:"setAttributes",value:function(t){for(var e=0,r=Object.entries(t);e<r.length;e++){var n=Ut(r[e],2),o=n[0],i=n[1];this.setAttribute(o,i)}return this}},{key:"addEvent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return this.span.ended||this.span.events.push({name:t,attributes:e,time:r||lt.now(),droppedAttributesCount:0}),this}},{key:"isRecording",value:function(){return!1===this.span.ended}},{key:"end",value:function(t,e){t&&this.setAttributes(t),this.span.endTime=e||lt.now(this.usePerformance),this.span.ended=!0,this.spanProcessor.onEnd(this)}},{key:"export",value:function(){return this.span}}],e&&Ft(t.prototype,e),r&&Ft(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Bt(t){return Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bt(t)}function Wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function $t(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Wt(Object(r),!0).forEach(function(e){Gt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Gt(t,e,r){return(e=Xt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Xt(n.key),n)}}function Xt(t){var e=function(t,e){if("object"!=Bt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Bt(e)?e:e+""}var Zt=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.spanProcessor=r,this.tracing=e},e=[{key:"startSpan",value:function(t){var e,r,n,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tracing.contextManager.active(),u=this.tracing.getSpan(s),l=null==u?void 0:u.spanContext(),c=gt.gen(8),f=null;l?(o=l.traceId,f=l.traceState,i=l.spanId):o=gt.gen(16);var p={traceId:o,spanId:c,traceFlags:0,traceState:f},d={attributes:$t($t({},(null===(e=this.tracing.resource)||void 0===e?void 0:e.attributes)||{}),(null===(r=a.resource)||void 0===r?void 0:r.attributes)||{})};return new Vt({resource:d,scope:this.tracing.scope,session:null===(n=this.tracing.session)||void 0===n?void 0:n.session,context:s,spanContext:p,name:t,kind:0,parentSpanId:i,spanProcessor:this.spanProcessor,startTime:a.startTime,usePerformance:a.usePerformance})}}],e&&zt(t.prototype,e),r&&zt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Qt(t){return Qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qt(t)}function Kt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Yt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Kt(Object(r),!0).forEach(function(e){te(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Kt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function te(t,e,r){return(e=re(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,re(n.key),n)}}function re(t){var e=function(t,e){if("object"!=Qt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Qt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Qt(e)?e:e+""}var ne,oe=(ne="Rollbar Context Key SPAN",Symbol.for(ne)),ie=function(){return t=function t(e,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=r,this.options=n,this.window=e,this.window.sessionStorage&&(this.session=new jt(this,n)),this.createTracer()},e=[{key:"configure",value:function(t){this.options=t}},{key:"initSession",value:function(){this.session&&this.session.init()}},{key:"sessionId",get:function(){return this.session?this.session.session.id:null}},{key:"resource",get:function(){var t,e;return{attributes:Yt(Yt({},this.options.resource||{}),{},{"rollbar.environment":null!==(t=null===(e=this.options.payload)||void 0===e?void 0:e.environment)&&void 0!==t?t:this.options.environment})}}},{key:"scope",get:function(){return{name:"rollbar-browser-js",version:this.options.version}}},{key:"idGen",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return gt.gen(t)}},{key:"createTracer",value:function(){this.contextManager=new at,this.exporter=new mt(this.api,this.options),this.spanProcessor=new Dt(this.exporter,this.options.tracing),this.tracer=new Zt(this,this.spanProcessor)}},{key:"getTracer",value:function(){return this.tracer}},{key:"addSpanTransform",value:function(t){this.spanProcessor.addTransform(t)}},{key:"getSpan",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.contextManager.active()).getValue(oe)}},{key:"setSpan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.contextManager.active(),e=arguments.length>1?arguments[1]:void 0;return t.setValue(oe,e)}},{key:"startSpan",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.contextManager.active();return this.tracer.startSpan(t,e,r)}},{key:"with",value:function(t,e,r){for(var n,o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];return(n=this.contextManager).with.apply(n,[t,e,r].concat(i))}},{key:"withSpan",value:function(t,e,r,n){var o=this.startSpan(t,e);return this.with(this.setSpan(this.contextManager.active(),o),r,n,o)}}],e&&ee(t.prototype,e),r&&ee(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function ae(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||ue(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function se(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ue(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function ue(t,e){if(t){if("string"==typeof t)return le(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?le(t,e):void 0}}function le(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ce(t,e){return[t,b(t,e)]}function fe(t,e){var r=t.length;return r>2*e?t.slice(0,e).concat(t.slice(r-e)):t}function pe(t,e,r){r=void 0===r?30:r;var n,o=t.data.body;if(o.trace_chain){var i,a=se(o.trace_chain);try{for(a.s();!(i=a.n()).done;){var s=i.value;n=fe(n=s.frames,r),s.frames=n}}catch(t){a.e(t)}finally{a.f()}}else o.trace&&(n=fe(n=o.trace.frames,r),o.trace.frames=n);return[t,b(t,e)]}function de(t,e){return e&&e.length>t?e.slice(0,t-3).concat("..."):e}function he(t,e,r){return e=C(e,function e(r,n,o){switch(s(n)){case"string":return de(t,n);case"object":case"array":return C(n,e,o);default:return n}}),[e,b(e,r)]}function ye(t){return t.exception&&(delete t.exception.description,t.exception.message=de(255,t.exception.message)),t.frames=fe(t.frames,1),t}function ve(t,e){var r=t.data.body;if(r.trace_chain){var n,o=r.trace_chain,i=se(o.entries());try{for(i.s();!(n=i.n()).done;){var a=ae(n.value,2),s=a[0],u=a[1];o[s]=ye(u)}}catch(t){i.e(t)}finally{i.f()}}else r.trace&&(r.trace=ye(r.trace));return[t,b(t,e)]}function me(t,e){return function(t){for(var e=0,r=t.length,n=0;n<r;n++){var o=t.charCodeAt(n);o<128?e+=1:o<2048?e+=2:o<65536&&(e+=3)}return e}(t)>e}var be={truncate:function(t,e,r){r=void 0===r?524288:r;for(var n,o,i,a=[ce,pe,he.bind(null,1024),he.bind(null,512),he.bind(null,256),ve];n=a.shift();)if(t=(o=n(t,e))[0],(i=o[1]).error||!me(i.value,r))return i;return i},raw:ce,truncateFrames:pe,truncateStrings:he,maybeTruncateValue:de};function ge(t){if(!a(t.context,"string")){var e=b(t.context);e.error?t.context="Error: could not serialize 'context'":t.context=e.value||"",t.context.length>255&&(t.context=t.context.substr(0,255))}return{data:t}}function we(t,e,r){var n=e.hostname,o=e.protocol,i=e.port,a=e.path,s=e.search,u=t.timeout,l=function(t){var e="undefined"!=typeof window&&window||"undefined"!=typeof self&&self,r=t.defaultTransport||"xhr";void 0===e.fetch&&(r="xhr");void 0===e.XMLHttpRequest&&(r="fetch");return r}(t),c=t.proxy;if(t.endpoint){var f=r.parse(t.endpoint);n=f.hostname,o=f.protocol,i=f.port,a=f.pathname,s=f.search}return{timeout:u,hostname:n,protocol:o,port:i,path:a,search:s,proxy:c,transport:l}}function ke(t,e){var r=t.protocol||"https:",n=t.port||("http:"===r?80:"https:"===r?443:void 0),o=t.hostname,i=t.path,a=t.timeout,s=t.transport;return t.search&&(i+=t.search),t.proxy&&(i=r+"//"+o+i,o=t.proxy.host||t.proxy.hostname,n=t.proxy.port,r=t.proxy.protocol||r),{timeout:a,protocol:r,hostname:o,path:i,port:n,method:e,transport:s}}function Se(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _e(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Se(Object(r),!0).forEach(function(e){Oe(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Oe(t,e,r){return(e=Pe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xe(t){return xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(t)}function Ee(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,l=Object.create(u.prototype);return je(l,"_invoke",function(r,n,o){var i,s,u,l=0,c=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,s=0,u=t,p.n=r,a}};function d(r,n){for(s=r,u=n,e=0;!f&&l&&!o&&e<c.length;e++){var o,i=c[e],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,c,h){if(l>1)throw TypeError("Generator is already running");for(f&&1===c&&d(c,h),s=c,u=h;(e=s<2?t:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(l=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,s=1,u=e}finally{l=1}}return{value:e,done:f}}}(r,o,i),!0),l}var a={};function s(){}function u(){}function l(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(je(e={},n,function(){return this}),e),f=l.prototype=s.prototype=Object.create(c);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,je(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,je(f,"constructor",l),je(l,"constructor",u),u.displayName="GeneratorFunction",je(l,o,"GeneratorFunction"),je(f),je(f,o,"Generator"),je(f,n,function(){return this}),je(f,"toString",function(){return"[object Generator]"}),(Ee=function(){return{w:i,m:p}})()}function je(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}je=function(t,e,r,n){function i(e,r){je(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},je(t,e,r,n)}function Ie(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function Te(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Pe(n.key),n)}}function Pe(t){var e=function(t,e){if("object"!=xe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==xe(e)?e:e+""}var Ae={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443},Re={hostname:"api.rollbar.com",path:"/api/1/session/",search:null,version:"1",protocol:"https:",port:443},Ce=function(){return t=function t(e,r,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.transport=r,this.url=n,this.truncation=o,this.accessToken=e.accessToken,this.transportOptions=Le(e,n),this.OTLPTransportOptions=qe(e,n)},e=[{key:"_postPromise",value:function(t){var e=this,r=t.accessToken,n=t.options,o=t.payload,i=t.headers;return new Promise(function(t,a){e.transport.post({accessToken:r,options:n,payload:o,headers:i,callback:function(e,r){return e?a(e):t(r)}})})}},{key:"postItem",value:function(t,e){var r=this,n=ke(this.transportOptions,"POST"),o=ge(t);setTimeout(function(){r.transport.post({accessToken:r.accessToken,options:n,payload:o,callback:e})},0)}},{key:"postSpans",value:(n=Ee().m(function t(e){var r,n,o=arguments;return Ee().w(function(t){for(;;)if(0===t.n)return r=o.length>1&&void 0!==o[1]?o[1]:{},n=ke(this.OTLPTransportOptions,"POST"),t.a(2,this._postPromise({accessToken:this.accessToken,options:n,payload:e,headers:r}))},t,this)}),o=function(){var t=this,e=arguments;return new Promise(function(r,o){var i=n.apply(t,e);function a(t){Ie(i,r,o,a,s,"next",t)}function s(t){Ie(i,r,o,a,s,"throw",t)}a(void 0)})},function(t){return o.apply(this,arguments)})},{key:"buildJsonPayload",value:function(t,e){var r,n=ge(t);return(r=this.truncation?this.truncation.truncate(n):b(n)).error?(e&&e(r.error),null):r.value}},{key:"postJsonPayload",value:function(t,e){var r=ke(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,r,t,e)}},{key:"configure",value:function(t){var e=this.options;return this.options=R(e,t),this.transportOptions=Le(this.options,this.url),this.OTLPTransportOptions=qe(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this}}],e&&Te(t.prototype,e),r&&Te(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function Le(t,e){return we(t,Ae,e)}function qe(t,e){var r;return we(t=_e(_e({},t),{},{endpoint:null===(r=t.tracing)||void 0===r?void 0:r.endpoint}),Re,e)}var Ne=Ce,De="3.0.0",Me="api.rollbar.com/api/1/item/",Ue="debug",He="debug",Fe="error",Je=/(^|@)\S+:\d+/,Ve=/^\s*at .*(\S+:\d+|\(native\))/m,Be=/^(eval@)?(\[native code\])?$/;function We(t,e){if(void 0!==t.stacktrace||void 0!==t["opera#sourceloc"])return function(t,e){return!t.stacktrace||t.message.includes("\n")&&t.message.split("\n").length>t.stacktrace.split("\n").length?function(t,e){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),o=[],i=2,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push({file:s[2],line:+s[1],raw:n[i]})}return Ge(o,e)}(t):t.stack?function(t,e){var r=Ge(t.stack.split("\n").filter(function(t){return!!t.match(Je)&&!t.match(/^Error created at/)}),e);return r.map(function(t){var e,r=t.split("@"),n=$e(r.pop()),o=r.shift()||"",i=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return o.match(/\(([^)]*)\)/)&&(e=o.replace(/^[^(]+\(([^)]*)\)$/,"$1")),{function:i,args:void 0===e||"[arguments not available]"===e?void 0:e.split(","),file:n[0],line:n[1]?+n[1]:void 0,col:n[2]?+n[2]:void 0,raw:t}})}(t,e):function(t,e){for(var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),o=[],i=0,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push({function:s[3]||void 0,file:s[2],line:s[1]?+s[1]:void 0,raw:n[i]})}return Ge(o,e)}(t)}(t,e);if(t.stack&&t.stack.match(Ve))return function(t,e){return ze(t.stack,e)}(t,e);if(t.stack)return function(t,e){return Xe(t.stack,e)}(t,e);if(null!=e&&e.allowEmpty)return[];throw new Error("Cannot parse given Error object")}function $e(t){if(!t.includes(":"))return[t,void 0,void 0];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return[e[1],e[2]||void 0,e[3]||void 0]}function Ge(t,e){return e&&null!=e.slice?Array.isArray(e.slice)?t.slice(e.slice[0],e.slice[1]):t.slice(0,e.slice):t}function ze(t,e){return Ge(t.split("\n").filter(function(t){return!!t.match(Ve)}),e).map(function(t){t.includes("(eval ")&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),r=e.match(/ (\(.+\)$)/);e=r?e.replace(r[0],""):e;var n=$e(r?r[1]:e);return{function:r&&e||void 0,file:["eval","<anonymous>"].includes(n[0])?void 0:n[0],line:n[1]?+n[1]:void 0,col:n[2]?+n[2]:void 0,raw:t}})}function Xe(t,e){return Ge(t.split("\n").filter(function(t){return!t.match(Be)}),e).map(function(t){if(t.includes(" > eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),t.includes("@")||t.includes(":")){var e=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,r=t.match(e),n=r&&r[1]?r[1]:void 0,o=$e(t.replace(e,""));return{function:n,file:o[0],line:o[1]?+o[1]:void 0,col:o[2]?+o[2]:void 0,raw:t}}return{function:t}})}function Ze(t){return t.map(function(t){return{functionName:t.function,args:t.args,fileName:t.file,lineNumber:t.line,columnNumber:t.col,source:t.raw}})}var Qe=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function Ke(){return null}function Ye(t){var e={};return e._stackFrame=t,e.url=t.fileName,e.line=t.lineNumber,e.func=t.functionName,e.column=t.columnNumber,e.args=t.args,e.context=null,e}function tr(t,e){return{stack:function(){var r=[];e=e||0;try{r=function(t,e){return Ze(We(t,e))}(t)}catch(t){r=[]}for(var n=[],o=e;o<r.length;o++)n.push(new Ye(r[o]));return n}(),message:t.message,name:er(t),rawStack:t.stack,rawException:t}}function er(t){var e=t.name&&t.name.length&&t.name,r=t.constructor.name&&t.constructor.name.length&&t.constructor.name;return e&&r?"Error"===e?r:e:e||r}var rr={guessFunctionName:function(){return"?"},guessErrorClass:function(t){if(!t||!t.match)return["Unknown error. There was no error message to display.",""];var e=t.match(Qe),r="(unknown)";return e&&(r=e[e.length-1],t=(t=t.replace((e[e.length-2]||"")+r+":","")).replace(/(^[\s]+|[\s]+$)/g,"")),[r,t]},gatherContext:Ke,parse:function(t,e){var r=t;if(r.nested||r.cause){for(var n=[];r;)n.push(new tr(r,e)),r=r.nested||r.cause,e=0;return n[0].traceChain=n,n[0]}return new tr(r,e)},Stack:tr,Frame:Ye};function nr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return or(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?or(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function or(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ir(t,e){var r=t.level,n=h[r]||0,o=e.reportLevel;return!(n<(h[o]||0))}function ar(t,e,r){if(!t)return!r;var n,o,i=t.frames;if(!i||0===i.length)return!r;for(var s=e.length,u=i.length,l=0;l<u;l++){if(!a(n=i[l].filename,"string"))return!r;for(var c=0;c<s;c++)if(o=e[c],new RegExp(o).test(n))return!0}return!1}function sr(t,e,r,n){var o,i,a=!1;"blocklist"===r&&(a=!0);try{if(o=a?e.hostBlockList:e.hostSafeList,i=I(t,"body.trace_chain")||[I(t,"body.trace")],!o||0===o.length)return!a;if(0===i.length||!i[0])return!a;for(var s=i.length,u=0;u<s;u++)if(ar(i[u],o,a))return!0}catch(t){a?e.hostBlockList=null:e.hostSafeList=null;var l=a?"hostBlockList":"hostSafeList";return n.error("Error while reading your configuration's "+l+" option. Removing custom "+l+".",t),!a}return!1}function ur(t){return function(e,r){var n,o,i,a,s,u;try{if(!(i=r.ignoredMessages)||0===i.length)return!0;if(u=function(t){var e=t.body,r=[];if(e.trace_chain){var n,o=nr(e.trace_chain);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.push(I(i,"exception.message"))}}catch(t){o.e(t)}finally{o.f()}}e.trace&&r.push(I(e,"trace.exception.message"));e.message&&r.push(I(e,"message.body"));return r}(e),0===u.length)return!0;for(a=i.length,n=0;n<a;n++)for(s=new RegExp(i[n],"gi"),o=0;o<u.length;o++)if(s.test(u[o]))return!1}catch(e){r.ignoredMessages=null,t.error("Error while reading your configuration's ignoredMessages option. Removing custom ignoredMessages.")}return!0}}function lr(t){return lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lr(t)}function cr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fr(n.key),n)}}function fr(t){var e=function(t,e){if("object"!=lr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=lr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==lr(e)?e:e+""}var pr=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.queue=e,this.options=r,this.transforms=[],this.diagnostic={}},e=[{key:"configure",value:function(t){var e;null===(e=this.queue)||void 0===e||e.configure(t);var r=this.options;return this.options=R(r,t),this}},{key:"addTransform",value:function(t){return u(t)&&this.transforms.push(t),this}},{key:"log",value:function(t,e){var r=this;if(e=u(e)?e:function(){},!this.options.enabled)return e(new Error("Rollbar is not enabled"),null);this.queue.addPendingItem(t);var n=t.err;this._applyTransforms(t,function(o,i){if(o)return r.queue.removePendingItem(t),e(o,null);r.queue.addItem(i,e,n,t)})}},{key:"_applyTransforms",value:function(t,e){var r=-1,n=this.transforms.length,o=this.transforms,i=this.options,a=function(t,s){t?e(t,null):++r!==n?o[r](s,i,a):e(null,s)};a(null,t)}}],e&&cr(t.prototype,e),r&&cr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function dr(t){return dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dr(t)}function hr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,yr(n.key),n)}}function yr(t){var e=function(t,e){if("object"!=dr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=dr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==dr(e)?e:e+""}var vr,mr,br,gr=function(){function t(e,r,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.rateLimiter=e,this.api=r,this.logger=n,this.options=o,this.replay=i,this.predicates=[],this.pendingItems=[],this.pendingRequests=[],this.retryQueue=[],this.retryHandle=null,this.waitCallback=null,this.waitIntervalID=null}return e=t,r=[{key:"configure",value:function(t){var e;null===(e=this.api)||void 0===e||e.configure(t);var r=this.options;return this.options=R(r,t),this}},{key:"addPredicate",value:function(t){return u(t)&&this.predicates.push(t),this}},{key:"addPendingItem",value:function(t){this.pendingItems.push(t)}},{key:"removePendingItem",value:function(t){var e=this.pendingItems.indexOf(t);-1!==e&&this.pendingItems.splice(e,1)}},{key:"addItem",value:function(t,e,r,n){var o=this;e&&u(e)||(e=function(){});var i=t.data,a=this._applyPredicates(i);if(a.stop)return this.removePendingItem(n),void e(a.err);if(this._maybeLog(i,r),this.removePendingItem(n),this.options.transmit){this.replay&&i.body&&(t.replayId=this.replay.capture(null,i.uuid,{type:"occurrence",level:t.level}),t.replayId&&j(t.data,[{key:"replay_id",value:t.replayId}])),this.pendingRequests.push(i);try{this._makeApiRequest(i,function(r,n,a){o._dequeuePendingRequest(i),t.replayId&&o.replay.sendOrDiscardReplay(t.replayId,r,n,a),e(r,n)})}catch(r){var s;this._dequeuePendingRequest(i),t.replayId&&(null===(s=this.replay)||void 0===s||s.discard(t.replayId)),e(r)}}else e(new Error("Transmit disabled"))}},{key:"wait",value:function(t){var e=this;u(t)&&(this.waitCallback=t,this._maybeCallWait()||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitIntervalID=setInterval(function(){e._maybeCallWait()},500)))}},{key:"_applyPredicates",value:function(t){for(var e=null,r=0,n=this.predicates.length;r<n;r++)if(!(e=this.predicates[r](t,this.options))||void 0!==e.err)return{stop:!0,err:e.err};return{stop:!1,err:null}}},{key:"_makeApiRequest",value:function(t,e){var r=this,n=this.rateLimiter.shouldSend(t);n.shouldSend?this.api.postItem(t,function(n,o,i){n?r._maybeRetry(n,t,e):e(n,o,i)}):n.error?e(n.error):this.api.postItem(n.payload,e)}},{key:"_maybeRetry",value:function(e,r,n){var o=!1;if(this.options.retryInterval){for(var i=0,a=t.RETRIABLE_ERRORS.length;i<a;i++)if(e.code===t.RETRIABLE_ERRORS[i]){o=!0;break}o&&f(this.options.maxRetries)&&(r.retries=r.retries?r.retries+1:1,r.retries>this.options.maxRetries&&(o=!1))}o?this._retryApiRequest(r,n):n(e)}},{key:"_retryApiRequest",value:function(t,e){var r=this;this.retryQueue.push({item:t,callback:e}),this.retryHandle||(this.retryHandle=setInterval(function(){for(;r.retryQueue.length;){var t=r.retryQueue.shift();r._makeApiRequest(t.item,t.callback)}},this.options.retryInterval))}},{key:"_dequeuePendingRequest",value:function(t){var e=this.pendingRequests.indexOf(t);-1!==e&&(this.pendingRequests.splice(e,1),this._maybeCallWait())}},{key:"_maybeLog",value:function(t,e){if(this.logger&&this.options.verbose){var r=e||I(t,"body.trace.exception.message")||I(t,"body.trace_chain.0.exception.message");if(r)return void this.logger.error(r);(r=I(t,"body.message.body"))&&this.logger.log(r)}}},{key:"_maybeCallWait",value:function(){return!(!u(this.waitCallback)||0!==this.pendingItems.length||0!==this.pendingRequests.length||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitCallback(),0))}}],r&&hr(e.prototype,r),n&&hr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();vr=gr,br=["ECONNRESET","ENOTFOUND","ESOCKETTIMEDOUT","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH","EPIPE","EAI_AGAIN"],(mr=yr(mr="RETRIABLE_ERRORS"))in vr?Object.defineProperty(vr,mr,{value:br,enumerable:!0,configurable:!0,writable:!0}):vr[mr]=br;var wr=gr;function kr(t){return kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kr(t)}function Sr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_r(n.key),n)}}function _r(t){var e=function(t,e){if("object"!=kr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=kr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==kr(e)?e:e+""}var Or=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.startTime=Date.now(),this.counter=0,this.perMinCounter=0,this.platform=null,this.platformOptions={},this.configureGlobal(e)}return function(t,e,r){return e&&Sr(t.prototype,e),r&&Sr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"configureGlobal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.startTime,n=e.maxItems,o=e.itemsPerMinute;void 0!==r&&(t.globalSettings.startTime=r),void 0!==n&&(t.globalSettings.maxItems=n),void 0!==o&&(t.globalSettings.itemsPerMinute=o)}},{key:"shouldSend",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=r-this.startTime;(n<0||n>=6e4)&&(this.startTime=r,this.perMinCounter=0);var o=t.globalSettings.maxItems,i=t.globalSettings.itemsPerMinute;if(xr(e,o,this.counter))return Er(this.platform,this.platformOptions,"".concat(o," max items reached"),!1);if(xr(e,i,this.perMinCounter))return Er(this.platform,this.platformOptions,"".concat(i," items per minute reached"),!1);this.counter+=1,this.perMinCounter+=1;var a=!xr(e,o,this.counter),s=a,u=a&&!xr(e,i,this.perMinCounter);return Er(this.platform,this.platformOptions,null,u,o,i,s)}},{key:"setPlatformOptions",value:function(t,e){this.platform=t,this.platformOptions=e}}])}();function xr(t,e,r){return!t.ignoreRateLimit&&e>=1&&r>e}function Er(t,e,r,n,o,i,a){var s=null,u=r?new Error(r):null;return u||n||(s=function(t,e,r,n,o){var i=e.environment||e.payload&&e.payload.environment,a=o?"item per minute limit reached, ignoring errors until timeout":"maxItems has been hit, ignoring errors until reset.",s={body:{message:{body:a,extra:{maxItems:r,itemsPerMinute:n}}},language:"javascript",environment:i,notifier:{version:e.notifier&&e.notifier.version||e.version}};"browser"===t?(s.platform="browser",s.framework="browser-js",s.notifier.name="rollbar-browser-js"):"server"===t?(s.framework=e.framework||"node-js",s.notifier.name=e.notifier.name):"react-native"===t&&(s.framework=e.framework||"react-native",s.notifier.name=e.notifier.name);return s}(t,e,o,i,a)),{error:u,shouldSend:n,payload:s}}!function(t,e,r){(e=_r(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(Or,"globalSettings",{startTime:Date.now(),maxItems:void 0,itemsPerMinute:void 0});var jr=Or;function Ir(t,e,r,n,o,i,a){this.options=R(t),this.logger=r,Ir.rateLimiter.configureGlobal(this.options),Ir.rateLimiter.setPlatformOptions(a,this.options),this.api=e,this.queue=new wr(Ir.rateLimiter,e,r,this.options,i),this.tracing=o;var s=this.options.tracer||null;Pr(s)?(this.tracer=s,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier=new pr(this.queue,this.options),this.telemeter=n,Tr(t),this.lastError=null,this.lastErrorHash="none"}function Tr(t){t.stackTraceLimit&&(Error.stackTraceLimit=t.stackTraceLimit)}function Pr(t){if(!t)return!1;if(!t.scope||"function"!=typeof t.scope)return!1;var e=t.scope();return!(!e||!e.active||"function"!=typeof e.active)}Ir.rateLimiter=new jr({maxItems:0,itemsPerMinute:60}),Ir.prototype.global=function(t){return Ir.rateLimiter.configureGlobal(t),this},Ir.prototype.configure=function(t,e){var r=this.options,n={};e&&(n={payload:e}),this.options=R(r,t,n);var o=this.options.tracer||null;return Pr(o)?(this.tracer=o,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),Tr(t),this.global(this.options),Pr(t.tracer)&&(this.tracer=t.tracer),this},Ir.prototype.log=function(t){var e=this._defaultLogLevel();return this._log(e,t)},Ir.prototype.debug=function(t){this._log("debug",t)},Ir.prototype.info=function(t){this._log("info",t)},Ir.prototype.warn=function(t){this._log("warning",t)},Ir.prototype.warning=function(t){this._log("warning",t)},Ir.prototype.error=function(t){this._log("error",t)},Ir.prototype.critical=function(t){this._log("critical",t)},Ir.prototype.wait=function(t){this.queue.wait(t)},Ir.prototype.captureEvent=function(t,e,r){return this.telemeter&&this.telemeter.captureEvent(t,e,r)},Ir.prototype.captureDomContentLoaded=function(t){return this.telemeter&&this.telemeter.captureDomContentLoaded(t)},Ir.prototype.captureLoad=function(t){return this.telemeter&&this.telemeter.captureLoad(t)},Ir.prototype.buildJsonPayload=function(t){return this.api.buildJsonPayload(t)},Ir.prototype.sendJsonPayload=function(t){this.api.postJsonPayload(t)},Ir.prototype._log=function(t,e){var r;if(e.callback&&(r=e.callback,delete e.callback),this.options.ignoreDuplicateErrors&&this._sameAsLastError(e)){if(r){var n=new Error("ignored identical item");n.item=e,r(n)}}else try{e.level=e.level||t,this._addItemAttributes(e),this._addTracingInfo(e);var o=this.telemeter;o&&(o._captureRollbarItem(e),e.telemetryEvents=o.copyEvents()||[]),this.notifier.log(e,r)}catch(t){r&&r(t),this.logger.error(t)}},Ir.prototype._addItemAttributes=function(t){var e,r,n=null===(e=this.tracing)||void 0===e?void 0:e.getSpan(),o=[{key:"session_id",value:null===(r=this.tracing)||void 0===r?void 0:r.sessionId},{key:"span_id",value:null==n?void 0:n.spanId},{key:"trace_id",value:null==n?void 0:n.traceId}];t._isUncaught&&o.push({key:"is_uncaught",value:"true"}),j(t.data,o),null==n||n.addEvent("rollbar.occurrence",[{key:"rollbar.occurrence.uuid",value:t.uuid}])},Ir.prototype._defaultLogLevel=function(){return this.options.logLevel||"debug"},Ir.prototype._sameAsLastError=function(t){if(!t._isUncaught)return!1;var e=function(t){var e=t.message||"",r=(t.err||{}).stack||String(t.err);return e+"::"+r}(t);return this.lastErrorHash===e||(this.lastError=t.err,this.lastErrorHash=e,!1)},Ir.prototype._addTracingInfo=function(t){if(this.tracer){var e=this.tracer.scope().active();if(function(t){if(!t||!t.context||"function"!=typeof t.context)return!1;var e=t.context();if(!e||!e.toSpanId||!e.toTraceId||"function"!=typeof e.toSpanId||"function"!=typeof e.toTraceId)return!1;return!0}(e)){e.setTag("rollbar.error_uuid",t.uuid),e.setTag("rollbar.has_error",!0),e.setTag("error",!0),e.setTag("rollbar.item_url","https://rollbar.com/item/uuid/?uuid=".concat(t.uuid)),e.setTag("rollbar.occurrence_url","https://rollbar.com/occurrence/uuid/?uuid=".concat(t.uuid));var r=e.context().toSpanId(),n=e.context().toTraceId();t.custom?(t.custom.opentracing_span_id=r,t.custom.opentracing_trace_id=n):t.custom={opentracing_span_id:r,opentracing_trace_id:n}}}};var Ar=Ir;function Rr(t,e,r){t._isUncaught&&(t.data._isUncaught=!0),t._originalArgs&&(t.data._originalArgs=t._originalArgs),r(null,t)}function Cr(t,e,r){var n=e.payload||{};n.body&&delete n.body,t.data=R(t.data,n),r(null,t)}function Lr(t,e,r){t.telemetryEvents&&T(t,"data.body.telemetry",t.telemetryEvents),r(null,t)}function qr(t,e,r){if(t.message){var n="data.body.trace_chain.0",o=I(t,n);if(o||(o=I(t,n="data.body.trace")),o){if(!o.exception||!o.exception.description)return T(t,n+".exception.description",t.message),void r(null,t);T(t,n+".extra",R(I(t,n+".extra")||{},{message:t.message}))}r(null,t)}else r(null,t)}function Nr(t){return function(e,r,n){var o,i=R(e),s=null;try{u(r.transform)&&(s=r.transform(i.data,e))}catch(o){return r.transform=null,t.error("Error while calling custom transform() function. Removing custom transform().",o),void n(null,e)}l(o=s)&&a(o.then,"function")?s.then(function(t){t&&(i.data=t),n(null,i)},function(t){n(t,e)}):n(null,i)}}function Dr(t,e,r){if(!e.sendConfig)return r(null,t);var n=I(t,"data.custom")||{};n._rollbarConfig=e,t.data.custom=n,r(null,t)}function Mr(t,e){u(t[e])&&(t[e]=t[e].toString())}function Ur(t,e,r){var n=e._configuredOptions;Mr(n,"transform"),Mr(n,"checkIgnore"),Mr(n,"onSendCallback"),delete n.accessToken,t.data.notifier.configured_options=n,r(null,t)}function Hr(t,e,r){var n=R(t.notifier.client.notifier.diagnostic,t.diagnostic);if(I(t,"err._isAnonymous")&&(n.is_anonymous=!0),t._isUncaught&&(n.is_uncaught=t._isUncaught),t.err)try{n.raw_error={message:t.err.message,name:t.err.name,constructor_name:t.err.constructor&&t.err.constructor.name,filename:t.err.fileName,line:t.err.lineNumber,column:t.err.columnNumber,stack:t.err.stack}}catch(t){n.raw_error={failed:String(t)}}t.data.notifier.diagnostic=R(t.data.notifier.diagnostic,n),r(null,t)}function Fr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Jr=[].concat(function(t){return function(t){if(Array.isArray(t))return Fr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Fr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Fr(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(["pw","pass","passwd","password","secret","confirm_password","confirmPassword","password_confirmation","passwordConfirmation","access_token","accessToken","X-Rollbar-Access-Token","secret_key","secretKey","secretToken"]),["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"]),Vr={scrubFields:Jr};function Br(t,e){return!I(e,"plugins.jquery.ignoreAjaxErrors")||!I(t,"body.message.extra.isAjax")}function Wr(t,e,r){if(t.err&&"DOMException"===rr.Stack(t.err).name){var n=new Error;n.name=t.err.name,n.message=t.err.message,n.stack=t.err.stack,n.nested=t.err,t.err=n}r(null,t)}function $r(t,e,r){if(t.data=t.data||{},t.err)try{t.stackInfo=t.err._savedStackTrace||rr.parse(t.err,t.skipFrames),e.addErrorContext&&function(t){var e=[],r=t.err;e.push(r);for(;r.nested||r.cause;)r=r.nested||r.cause,e.push(r);!function(t,e){var r=t.data.custom||{},o=!1;try{var i,a=n(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;c(s,"rollbarContext")&&(r=R(r,S(s.rollbarContext)),o=!0)}}catch(t){a.e(t)}finally{a.f()}o&&(t.data.custom=r)}catch(e){t.diagnostic.error_context="Failed: "+e.message}}(t,e)}(t)}catch(e){At.error("Error while parsing the error object.",e);try{t.message=t.err.message||t.err.description||t.message||String(t.err)}catch(e){t.message=String(t.err)||String(e)}delete t.err}r(null,t)}function Gr(t,e,r){t.message||t.stackInfo||t.custom||r(new Error("No message, stack info, or custom data"),null),r(null,t)}function zr(t,e,r){var n=e.payload&&e.payload.environment||e.environment;t.data=R(t.data,{environment:n,level:t.level,endpoint:e.endpoint,platform:"browser",framework:"browser-js",language:"javascript",server:{},uuid:t.uuid,notifier:{name:"rollbar-browser-js",version:e.version},custom:t.custom}),r(null,t)}function Xr(t,e,r){t.stackInfo?t.stackInfo.traceChain?function(t,e,r){for(var n=t.stackInfo.traceChain,o=[],i=n.length,a=0;a<i;a++){var s=Kr(t,n[a],e);o.push(s)}T(t,"data.body",{trace_chain:o}),r(null,t)}(t,e,r):function(t,e,r){var n=Qr(t);if(n){T(t,"data.body",{trace:Kr(t,t.stackInfo,e)}),r(null,t)}else{var o=t.stackInfo,i=rr.guessErrorClass(o.message),a=Yr(o,i[0],e),s=i[1];t.message=a+": "+s,Zr(t,e,r)}}(t,e,r):Zr(t,e,r)}function Zr(t,e,r){var n=t.message,o=t.custom;n||(n="Item sent with null or missing arguments.");var i={body:n};o&&(i.extra=R(o)),T(t,"data.body",{message:i}),r(null,t)}function Qr(t){var e=((arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||t.stackInfo).stack;return e&&0===e.length&&t._unhandledStackInfo&&t._unhandledStackInfo.stack&&(e=t._unhandledStackInfo.stack),e}function Kr(t,e,r){var n=t&&t.data.description,o=t&&t.custom,i=Qr(t,e),a=rr.guessErrorClass(e.message),s={exception:{class:Yr(e,a[0],r),message:a[1]}};if(n&&(s.exception.description=n),i){var u,l,c,f,p,d,h,v;for(0===i.length&&(s.exception.stack=e.rawStack,s.exception.raw=String(e.rawException)),s.frames=[],h=0;h<i.length;++h)l={filename:(u=i[h]).url?y(u.url):"(unknown)",lineno:u.line||null,method:u.func&&"?"!==u.func?u.func:"[anonymous]",colno:u.column},r.sendFrameUrl&&(l.url=u.url),l.method&&l.method.endsWith&&l.method.endsWith("_rollbar_wrapped")||(c=f=p=null,(d=u.context?u.context.length:0)&&(v=Math.floor(d/2),f=u.context.slice(0,v),c=u.context[v],p=u.context.slice(v)),c&&(l.code=c),(f||p)&&(l.context={},f&&f.length&&(l.context.pre=f),p&&p.length&&(l.context.post=p)),u.args&&(l.args=u.args),s.frames.push(l));s.frames.reverse(),o&&(s.extra=R(o))}return s}function Yr(t,e,r){return t.name?t.name:r.guessErrorClass?e:"(unknown)"}function tn(t){return tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tn(t)}function en(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function rn(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=tn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=tn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==tn(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var nn=function(t){var e,r,n=t.accessToken,o=t.url,i=t.method,a=t.payload,s=t.headers,u=t.callback,l=t.timeout;f(l)&&(e=new AbortController,r=setTimeout(function(){e.abort()},l)),s=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?en(Object(r),!0).forEach(function(e){rn(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):en(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({"Content-Type":"application/json","X-Rollbar-Access-Token":n,signal:e&&e.signal},s),fetch(o,{method:i,headers:s,body:a}).then(function(t){r&&clearTimeout(r);var e=t.headers,n=o.endsWith("/api/1/item/")?{"Rollbar-Replay-Enabled":e.get("Rollbar-Replay-Enabled"),"Rollbar-Replay-RateLimit-Remaining":e.get("Rollbar-Replay-RateLimit-Remaining"),"Rollbar-Replay-RateLimit-Reset":e.get("Rollbar-Replay-RateLimit-Reset")}:{},i=t.json();u(null,i,n)}).catch(function(t){At.error(t.message),u(t)})};function on(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return an(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?an(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function an(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function sn(t,e){var r=new Error(t);return r.code=e||"ENOTFOUND",r}var un=function(t){var e,r=t.accessToken,n=t.url,o=t.method,i=t.payload,s=t.headers,u=t.callback,l=t.requestFactory,c=t.timeout;if(!(e=l?l():function(){var t,e,r=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],n=r.length;for(e=0;e<n;e++)try{t=r[e]();break}catch(t){}return t}()))return u(new Error("No way to send a request"));try{try{var p=function(){try{if(p&&4===e.readyState){p=void 0;var t=g(e.responseText);if(function(t){return t&&t.status&&200===t.status}(e)){var r=n.endsWith("/api/1/item/")?{"Rollbar-Replay-Enabled":e.getResponseHeader("Rollbar-Replay-Enabled"),"Rollbar-Replay-RateLimit-Remaining":e.getResponseHeader("Rollbar-Replay-RateLimit-Remaining"),"Rollbar-Replay-RateLimit-Reset":e.getResponseHeader("Rollbar-Replay-RateLimit-Reset")}:{};return void u(t.error,t.value,r)}if(function(t){return t&&a(t.status,"number")&&t.status>=400&&t.status<600}(e)){if(403===e.status){var o=t.value&&t.value.message;At.error(o)}u(new Error(String(e.status)))}else{u(sn("XHR response had no status code (likely connection failure)"))}}}catch(t){var i;i=t&&t.stack?t:new Error(t),u(i)}};if(e.open(o,n,!0),e.setRequestHeader){e.setRequestHeader("Content-Type","application/json"),e.setRequestHeader("X-Rollbar-Access-Token",r);for(var d=0,h=Object.entries(null!=s?s:{});d<h.length;d++){var y=on(h[d],2),v=y[0],m=y[1];e.setRequestHeader(v,m)}}f(c)&&(e.timeout=c),e.onreadystatechange=p,e.send(i)}catch(t){if("undefined"!=typeof XDomainRequest){if(!window||!window.location)return u(new Error("No window available during request, unknown environment"));"http:"===window.location.href.substring(0,5)&&"https"===n.substring(0,5)&&(n="http"+n.substring(5));var b=new XDomainRequest;b.onprogress=function(){},b.ontimeout=function(){u(sn("Request timed out","ETIMEDOUT"))},b.onerror=function(){u(new Error("Error during request"))},b.onload=function(){var t=g(b.responseText);u(t.error,t.value)},b.open(o,n,!0),b.send(i)}else u(new Error("Cannot find a method to transport a request"))}}catch(t){u(t)}};function ln(t){this.truncation=t}ln.prototype.get=function(t,e,r,n,o){n&&u(n)||(n=function(){}),function(t,e,r){(r=r||{}).access_token=t;var n,o=[];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&o.push([n,r[n]].join("="));var i="?"+o.sort().join("&");(e=e||{}).path=e.path||"";var a,s=e.path.indexOf("?"),u=e.path.indexOf("#");-1!==s&&(-1===u||u>s)?(a=e.path,e.path=a.substring(0,s)+i+"&"+a.substring(s+1)):-1!==u?(a=e.path,e.path=a.substring(0,u)+i+a.substring(u)):e.path=e.path+i}(t,e,r);var i=m(e);this._makeZoneRequest({accessToken:t,url:i,method:"GET",callback:n,requestFactory:o,timeout:e.timeout,transport:e.transport})},ln.prototype.post=function(t){var e,r=t.accessToken,n=t.options,o=t.payload,i=t.headers,a=t.callback,s=t.requestFactory;if(a&&u(a)||(a=function(){}),!o)return a(new Error("Cannot send empty request"));if((e=this.truncation&&o.body?this.truncation.truncate(o):b(o)).error)return a(e.error);var l=m(n);this._makeZoneRequest({accessToken:r,url:l,method:"POST",payload:e.value,headers:i,callback:a,requestFactory:s,timeout:n.timeout,transport:n.transport})},ln.prototype.postJsonPayload=function(t,e,r,n,o){n&&u(n)||(n=function(){});var i=m(e);this._makeZoneRequest({accessToken:t,url:i,method:"POST",payload:r,callback:n,requestFactory:o,timeout:e.timeout,transport:e.transport})},ln.prototype._makeZoneRequest=function(){var t=this,e="undefined"!=typeof window&&window||"undefined"!=typeof self&&self,r=e&&e.Zone&&e.Zone.root,n=Array.prototype.slice.call(arguments);r?r.run(function(){t._makeRequest.apply(void 0,n)}):this._makeRequest.apply(void 0,n)},ln.prototype._makeRequest=function(t){var e=t.payload,r=t.callback,n=t.transport;if("undefined"!=typeof RollbarProxy)return function(t,e){(new RollbarProxy).sendJsonPayload(t,function(t){},function(t){e(new Error(t))})}(e,r);"fetch"===n?nn(t):un(t)};var cn,fn=ln;function pn(t){var e,r,n={protocol:null,auth:null,host:null,path:null,hash:null,href:t,hostname:null,port:null,pathname:null,search:null,query:null};if(-1!==(e=t.indexOf("//"))?(n.protocol=t.substring(0,e),r=e+2):r=0,-1!==(e=t.indexOf("@",r))&&(n.auth=t.substring(r,e),r=e+1),-1===(e=t.indexOf("/",r))){if(-1===(e=t.indexOf("?",r)))return-1===(e=t.indexOf("#",r))?n.host=t.substring(r):(n.host=t.substring(r,e),n.hash=t.substring(e)),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),n;n.host=t.substring(r,e),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),r=e}else n.host=t.substring(r,e),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),r=e;if(-1===(e=t.indexOf("#",r))?n.path=t.substring(r):(n.path=t.substring(r,e),n.hash=t.substring(e)),n.path){var o=n.path.split("?");n.pathname=o[0],n.query=o[1],n.search=n.query?"?"+n.query:null}return n}function dn(t){return dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dn(t)}function hn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function yn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?hn(Object(r),!0).forEach(function(e){mn(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hn(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function vn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,bn(n.key),n)}}function mn(t,e,r){return(e=bn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bn(t){var e=function(t,e){if("object"!=dn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==dn(e)?e:e+""}var gn=null,wn=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),At.init({logLevel:e.logLevel||"error"}),this.options=A(Sn,e,null,At),this.options._configuredOptions=e,this.components=this.components||{};var o=this.components.telemeter,i=this.components.instrumenter;this.wrapGlobals=this.components.wrapGlobals,this.scrub=this.components.scrub;var a=this.components.truncation,s=this.components.tracing,l=this.components.replay,c=new fn(a),f=new Ne(this.options,c,r,a);if(s&&(this.tracing=new s(kn(),f,this.options),this.tracing.initSession()),o&&(this.telemeter=new o(this.options,this.tracing)),l&&"undefined"!=typeof window){var p=this.options.replay;this.replay=new l({tracing:this.tracing,telemeter:this.telemeter,options:p}),p.enabled&&p.autoStart&&this.replay.recorder.start()}this.client=n||new Ar(this.options,f,At,this.telemeter,this.tracing,this.replay,"browser");var d=kn(),h="undefined"!=typeof document&&document;this.isChrome=d.chrome&&d.chrome.runtime,this.anonymousErrorsPending=0,function(t,e,r){t.addTransform(Wr).addTransform($r).addTransform(Gr).addTransform(zr).addTransform(function(t){return function(e,r,n){var o={};t&&t.location&&(o.url=t.location.href,o.query_string=t.location.search);var i="$remote_ip";r.captureIp?!0!==r.captureIp&&(i+="_anonymize"):i=null,i&&(o.user_ip=i),Object.keys(o).length>0&&T(e,"data.request",o),n(null,e)}}(r)).addTransform(function(t){return function(e,r,n){if(!t)return n(null,e);var o=t.navigator||{},i=t.screen||{};T(e,"data.client",{runtime_ms:e.timestamp-t._rollbarStartTime,timestamp:Math.round(e.timestamp/1e3),javascript:{browser:o.userAgent,language:o.language,cookie_enabled:o.cookieEnabled,screen:{width:i.width,height:i.height}}}),n(null,e)}}(r)).addTransform(function(t){return function(e,r,n){if(!t||!t.navigator)return n(null,e);for(var o,i=[],a=t.navigator.plugins||[],s=0,u=a.length;s<u;++s)o=a[s],i.push({name:o.name,description:o.description});T(e,"data.client.javascript.plugins",i),n(null,e)}}(r)).addTransform(Xr).addTransform(qr).addTransform(Lr).addTransform(Dr).addTransform((n=e.scrub,function(t,e,r){if(n){var o=e.scrubFields||[],i=e.scrubPaths||[];t.data=n(t.data,o,i)}r(null,t)})).addTransform(Cr).addTransform(Nr(At)).addTransform(Ur).addTransform(Hr).addTransform(Rr);var n}(this.client.notifier,this,d),function(t){t.addPredicate(ir).addPredicate(Br).addPredicate(function(t){return function(e,r){var n=Boolean(e._isUncaught);delete e._isUncaught;var o=e._originalArgs;delete e._originalArgs;try{u(r.onSendCallback)&&r.onSendCallback(n,o,e)}catch(e){r.onSendCallback=null,t.error("Error while calling onSendCallback, removing",e)}try{if(u(r.checkIgnore)&&r.checkIgnore(n,o,e))return!1}catch(e){r.checkIgnore=null,t.error("Error while calling custom checkIgnore(), removing",e)}return!0}}(At)).addPredicate(function(t){return function(e,r){return!sr(e,r,"blocklist",t)}}(At)).addPredicate(function(t){return function(e,r){return sr(e,r,"safelist",t)}}(At)).addPredicate(ur(At))}(this.client.queue),this.setupUnhandledCapture(),i&&(this.instrumenter=new i(this.options,this.client.telemeter,this,d,h),this.instrumenter.instrument()),this.setSessionAttributesFromOptions(e),this.rollbar=this}return function(t,e,r){return e&&vn(t.prototype,e),r&&vn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"global",value:function(t){return this.client.global(t),this}},{key:"configure",value:function(t,e){var r,n,o;t.logLevel&&At.init({logLevel:t.logLevel}),this.setSessionAttributesFromOptions(t);var i=this.options,a={};return e&&(a={payload:e}),this.options=A(i,t,a,At),this.options._configuredOptions=A(i._configuredOptions,t,a),null===(r=this.tracing)||void 0===r||r.configure(this.options),null===(n=this.replay)||void 0===n||n.configure(this.options.replay),this.client.configure(this.options,e),null===(o=this.instrumenter)||void 0===o||o.configure(this.options),this.setupUnhandledCapture(),this}},{key:"lastError",value:function(){return this.client.lastError}},{key:"log",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.log(t),{uuid:e}}},{key:"debug",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.debug(t),{uuid:e}}},{key:"info",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.info(t),{uuid:e}}},{key:"warn",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warn(t),{uuid:e}}},{key:"warning",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warning(t),{uuid:e}}},{key:"error",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.error(t),{uuid:e}}},{key:"critical",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.critical(t),{uuid:e}}},{key:"buildJsonPayload",value:function(t){return this.client.buildJsonPayload(t)}},{key:"sendJsonPayload",value:function(t){return this.client.sendJsonPayload(t)}},{key:"triggerDirectReplay",value:function(t){return this.triggerReplay(yn({type:"direct"},t))}},{key:"triggerReplay",value:function(t){return this.replay?this.replay.triggerReplay(t):null}},{key:"setupUnhandledCapture",value:function(){var t=kn();this.unhandledExceptionsInitialized||(this.options.captureUncaught||this.options.handleUncaughtExceptions)&&(!function(t,e,r){if(t){var n;if("function"==typeof e._rollbarOldOnError)n=e._rollbarOldOnError;else if(t.onerror){for(n=t.onerror;n._rollbarOldOnError;)n=n._rollbarOldOnError;e._rollbarOldOnError=n}e.handleAnonymousErrors();var o=function(){var r=Array.prototype.slice.call(arguments,0);!function(t,e,r,n){t._rollbarWrappedError&&(n[4]||(n[4]=t._rollbarWrappedError),n[5]||(n[5]=t._rollbarWrappedError._rollbarContext),t._rollbarWrappedError=null);var o=e.handleUncaughtException.apply(e,n);r&&r.apply(t,n),"anonymous"===o&&(e.anonymousErrorsPending+=1)}(t,e,n,r)};r&&(o._rollbarOldOnError=n),t.onerror=o}}(t,this),this.wrapGlobals&&this.options.wrapGlobalEventHandlers&&this.wrapGlobals(t,this),this.unhandledExceptionsInitialized=!0),this.unhandledRejectionsInitialized||(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections)&&(!function(t,e,r){if(t){"function"==typeof t._rollbarURH&&t._rollbarURH.belongsToShim&&t.removeEventListener("unhandledrejection",t._rollbarURH);var n=function(t){var r,n,o;try{r=t.reason}catch(t){r=void 0}try{n=t.promise}catch(t){n="[unhandledrejection] error getting `promise` from event"}try{o=t.detail,!r&&o&&(r=o.reason,n=o.promise)}catch(t){}r||(r="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(r,n)};n.belongsToShim=r,t._rollbarURH=n,t.addEventListener("unhandledrejection",n)}}(t,this),this.unhandledRejectionsInitialized=!0)}},{key:"handleUncaughtException",value:function(t,e,r,n,o,i){if(this.options.captureUncaught||this.options.handleUncaughtExceptions){if(this.options.inspectAnonymousErrors&&this.isChrome&&null===o&&""===e)return"anonymous";var a,s=w(t,e,r,n,o,"onerror","uncaught exception",rr);p(o)?(a=this._createItem([t,o,i]))._unhandledStackInfo=s:p(e)?(a=this._createItem([t,e,i]))._unhandledStackInfo=s:(a=this._createItem([t,i])).stackInfo=s,a.level=this.options.uncaughtErrorLevel,a._isUncaught=!0,this.client.log(a)}}},{key:"handleAnonymousErrors",value:function(){var t=this;if(this.options.inspectAnonymousErrors&&this.isChrome){try{Error.prepareStackTrace=function(e,r){if(t.options.inspectAnonymousErrors&&t.anonymousErrorsPending){if(t.anonymousErrorsPending-=1,!e)return;e._isAnonymous=!0,t.handleUncaughtException(e.message,null,null,null,e)}return e.stack}}catch(t){this.options.inspectAnonymousErrors=!1,this.error("anonymous error handler failed",t)}}}},{key:"handleUnhandledRejection",value:function(t,e){if(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections){var r="unhandled rejection was null or undefined!";if(t)if(t.message)r=t.message;else{var n=b(t);n.value&&(r=n.value)}var o,i=t&&t._rollbarContext||e&&e._rollbarContext;p(t)?o=this._createItem([r,t,i]):(o=this._createItem([r,t,i])).stackInfo=w(r,"",0,0,null,"unhandledrejection","",rr),o.level=this.options.uncaughtErrorLevel,o._isUncaught=!0,o._originalArgs=o._originalArgs||[],o._originalArgs.push(e),this.client.log(o)}}},{key:"wrap",value:function(t,e,r){try{var n;if(n=u(e)?e:function(){return e||{}},!u(t))return t;if(t._isWrap)return t;if(!t._rollbar_wrapped)for(var o in t._rollbar_wrapped=function(){r&&u(r)&&r.apply(this,arguments);try{return t.apply(this,arguments)}catch(r){var e=r;throw e&&window._rollbarWrappedError!==e&&(a(e,"string")&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=t.toString(),window._rollbarWrappedError=e),e}},t._rollbar_wrapped._isWrap=!0,t)c(t,o)&&"_rollbar_wrapped"!==o&&(t._rollbar_wrapped[o]=t[o]);return t._rollbar_wrapped}catch(e){return t}}},{key:"captureEvent",value:function(){var t=function(t){for(var e,r,n,o,i=0,a=t.length;i<a;++i)switch(s(o=t[i])){case"string":!e&&E(O,o)?e=o:!n&&E(x,o)&&(n=o);break;case"object":r=o}return{type:e||"manual",metadata:r||{},level:n}}(arguments);return this.client.captureEvent(t.type,t.metadata,t.level)}},{key:"setSessionUser",value:function(t){var e;null!==(e=this.tracing)&&void 0!==e&&e.session&&this.tracing.session.setUser(t)}},{key:"setSessionAttributes",value:function(t){var e;null!==(e=this.tracing)&&void 0!==e&&e.session&&(t=yn({},t),this.tracing.session.setAttributes(t))}},{key:"setSessionAttributesFromOptions",value:function(t){var e,r,n,o,i,a=t.person||(null===(e=t.payload)||void 0===e?void 0:e.person);a&&this.setSessionUser(a);var s=(null===(r=t.client)||void 0===r||null===(r=r.javascript)||void 0===r?void 0:r.code_version)||t.codeVersion||t.code_version||(null===(n=t.payload)||void 0===n||null===(n=n.client)||void 0===n||null===(n=n.javascript)||void 0===n?void 0:n.code_version)||(null===(o=t.payload)||void 0===o?void 0:o.code_version)||(null===(i=t.payload)||void 0===i?void 0:i.codeVersion);this.setSessionAttributes({"rollbar.codeVersion":s,"rollbar.notifier.name":"rollbar-browser-js","rollbar.notifier.version":t.version})}},{key:"captureDomContentLoaded",value:function(t,e){return e||(e=new Date),this.client.captureDomContentLoaded(e)}},{key:"captureLoad",value:function(t,e){return e||(e=new Date),this.client.captureLoad(e)}},{key:"loadFull",value:function(){At.info("Unexpected Rollbar.loadFull() called on a Notifier instance. This can happen when Rollbar is loaded multiple times.")}},{key:"_createItem",value:function(t){return _(t,At,this)}}],[{key:"init",value:function(e,r){return gn?gn.global(e).configure(e):gn=new t(e,r)}},{key:"setComponents",value:function(e){t.prototype.components=e}},{key:"callInstance",value:function(t,e){if(gn)return gn[t].apply(gn,e);var r="Rollbar is not initialized";At.error(r);var n=function(t){for(var e=0,r=t.length;e<r;++e)if(u(t[e]))return t[e];return}(e);n&&n(new Error(r))}}])}();function kn(){return"undefined"!=typeof window&&window||"undefined"!=typeof self&&self}cn=wn,mn(wn,"global",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("global",e)}),mn(wn,"configure",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("configure",e)}),mn(wn,"lastError",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("lastError",e)}),mn(wn,"log",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("log",e)}),mn(wn,"debug",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("debug",e)}),mn(wn,"info",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("info",e)}),mn(wn,"warn",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("warn",e)}),mn(wn,"warning",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("warning",e)}),mn(wn,"error",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("error",e)}),mn(wn,"critical",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("critical",e)}),mn(wn,"buildJsonPayload",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("buildJsonPayload",e)}),mn(wn,"sendJsonPayload",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("sendJsonPayload",e)}),mn(wn,"wrap",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("wrap",e)}),mn(wn,"captureEvent",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("captureEvent",e)});var Sn={environment:"unknown",version:De,scrubFields:Vr.scrubFields,logLevel:Ue,reportLevel:He,uncaughtErrorLevel:Fe,endpoint:Me,verbose:!1,enabled:!0,transmit:!0,sendConfig:!1,includeItemsInTelemetry:!0,captureIp:!0,inspectAnonymousErrors:!0,ignoreDuplicateErrors:!0,wrapGlobalEventHandlers:!1,replay:{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}},tracing:{enabled:!1,endpoint:"api.rollbar.com/api/1/session/"}},_n=wn;function On(t){return"string"!=typeof t&&(t=String(t)),t.toLowerCase()}function xn(t){this.map={},t instanceof xn?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}xn.prototype.append=function(t,e){t=On(t),e=function(t){return"string"!=typeof t&&(t=String(t)),t}(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},xn.prototype.get=function(t){return t=On(t),this.has(t)?this.map[t]:null},xn.prototype.has=function(t){return c(this.map,On(t))},xn.prototype.forEach=function(t,e){for(var r in this.map)c(this.map,r)&&t.call(e,this.map[r],r,this)},xn.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),function(t){return{next:function(){var e=t.shift();return{done:void 0===e,value:e}}}}(t)};var En=function(t){return"undefined"==typeof Headers?new xn(t):new Headers(t)};var jn=function(t,e,r,n,o){var i=t[e];t[e]=r(i),n&&n[o].push([t,e,i])};function In(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Tn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Tn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Tn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Pn(t){return function(t){for(var e,r,n=[],o=0,i=t.length-1;i>=0;i--){if(e=An(t[i]),r=o+3*n.length+e.length,i<t.length-1&&r>=83){n.unshift("...");break}n.unshift(e),o+=e.length}return n.join(" > ")}(function(t){for(var e,r=[],n=0;t&&n<5&&(e=Rn(t))&&"html"!==e.tagName;n++)r.unshift(e),t=t.parentNode;return r}(t))}function An(t){if(!t||!t.tagName)return"";var e=[t.tagName];t.id&&e.push("#"+t.id),t.classes&&e.push("."+t.classes.join("."));var r,n=In(t.attributes);try{for(n.s();!(r=n.n()).done;){var o=r.value;e.push("["+o.key+'="'+o.value+'"]')}}catch(t){n.e(t)}finally{n.f()}return e.join("")}function Rn(t){if(!t||!t.tagName)return null;var e,r={};r.tagName=t.tagName.toLowerCase(),t.id&&(r.id=t.id),(e=t.className)&&"string"==typeof e&&(r.classes=e.split(/\s+/));r.attributes=[];for(var n=0,o=["type","name","title","alt"];n<o.length;n++){var i=o[n],a=t.getAttribute(i);a&&r.attributes.push({key:i,value:a})}return r}function Cn(t){return Cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cn(t)}function Ln(t){return function(t){if(Array.isArray(t))return Un(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Mn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Nn(n.key),n)}}function Nn(t){var e=function(t,e){if("object"!=Cn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Cn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Cn(e)?e:e+""}function Dn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Mn(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Mn(t,e){if(t){if("string"==typeof t)return Un(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Un(t,e):void 0}}function Un(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Hn={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 Fn(t,e){for(var r;t[e].length;)(r=t[e].shift())[0][r[1]]=r[2]}function Jn(t){var e,r=[],n=Dn(t);try{for(n.s();!(e=n.n()).done;){var o=e.value;r.push(new RegExp(o,"i"))}}catch(t){n.e(t)}finally{n.f()}return function(t){var e=function(t){if(!t||!t.attributes)return null;var e,r=Dn(t.attributes);try{for(r.s();!(e=r.n()).done;){var n=e.value;if("name"===n.key)return n.value}}catch(t){r.e(t)}finally{r.f()}return null}(t);if(!e)return!1;for(var n=0,o=r;n<o.length;n++){if(o[n].test(e))return!0}return!1}}var Vn=function(){return function(t,e,r){return e&&qn(t.prototype,e),r&&qn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(e,r,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){(e=Nn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(this,"deinstrumentConnectivity",function(){this.removeListeners("connectivity")}),this.options=e;var s=e.autoInstrument;!1===e.enabled||!1===s?this.autoInstrument={}:(a(s,"object")||(s=Hn),this.autoInstrument=R(Hn,s)),this.configureScrubbing(),this.telemeter=r,this.rollbar=n,this.diagnostic=n.client.notifier.diagnostic,this._window=o||{},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},[{key:"configureScrubbing",value:function(){var t,e,r,n,o,i,a,s,u,l,c=this.options;this.scrubTelemetryInputs=Boolean(null!==(t=c.scrubTelemetryInputs)&&void 0!==t?t:null===(e=c.replay)||void 0===e?void 0:e.maskAllInputs),this.telemetryScrubber=c.telemetryScrubber,this.defaultValueScrubber=Jn(c.scrubFields),this.maskInputFn=null===(r=c.replay)||void 0===r?void 0:r.maskInputFn,this.maskInputOptions=(null===(n=c.replay)||void 0===n?void 0:n.maskInputOptions)||{},this.scrubClasses=[null===(o=c.replay)||void 0===o?void 0:o.blockClass,null===(i=c.replay)||void 0===i?void 0:i.ignoreClass,null===(a=c.replay)||void 0===a?void 0:a.maskTextClass].filter(Boolean),this.scrubSelectors=[null===(s=c.replay)||void 0===s?void 0:s.blockSelector,null===(u=c.replay)||void 0===u?void 0:u.ignoreSelector,null===(l=c.replay)||void 0===l?void 0:l.maskTextSelector].filter(Boolean)}},{key:"configure",value:function(t){this.options=R(this.options,t);var e=t.autoInstrument,r=R(this.autoInstrument);!1===t.enabled||!1===e?this.autoInstrument={}:(a(e,"object")||(e=Hn),this.autoInstrument=R(Hn,e)),this.configureScrubbing(),this.instrument(r)}},{key:"instrument",value:function(t){!this.autoInstrument.network||t&&t.network?!this.autoInstrument.network&&t&&t.network&&this.deinstrumentNetwork():this.instrumentNetwork(),!this.autoInstrument.log||t&&t.log?!this.autoInstrument.log&&t&&t.log&&this.deinstrumentConsole():this.instrumentConsole(),!this.autoInstrument.dom||t&&t.dom?!this.autoInstrument.dom&&t&&t.dom&&this.deinstrumentDom():this.instrumentDom(),!this.autoInstrument.navigation||t&&t.navigation?!this.autoInstrument.navigation&&t&&t.navigation&&this.deinstrumentNavigation():this.instrumentNavigation(),!this.autoInstrument.connectivity||t&&t.connectivity?!this.autoInstrument.connectivity&&t&&t.connectivity&&this.deinstrumentConnectivity():this.instrumentConnectivity(),!this.autoInstrument.contentSecurityPolicy||t&&t.contentSecurityPolicy?!this.autoInstrument.contentSecurityPolicy&&t&&t.contentSecurityPolicy&&this.deinstrumentContentSecurityPolicy():this.instrumentContentSecurityPolicy()}},{key:"deinstrumentNetwork",value:function(){Fn(this.replacements,"network")}},{key:"instrumentNetwork",value:function(){var t=this;function e(e,r){e in r&&u(r[e])&&jn(r,e,function(e){return t.rollbar.wrap(e)})}if("XMLHttpRequest"in this._window){var r=this._window.XMLHttpRequest.prototype;jn(r,"open",function(t){return function(e,r){var n=Bn(r);return(a(r,"string")||n)&&(r=n?r.toString():r,this.__rollbar_xhr?(this.__rollbar_xhr.method=e,this.__rollbar_xhr.url=r,this.__rollbar_xhr.status_code=null,this.__rollbar_xhr.start_time_ms=P(),this.__rollbar_xhr.end_time_ms=null):this.__rollbar_xhr={method:e,url:r,status_code:null,start_time_ms:P(),end_time_ms:null}),t.apply(this,arguments)}},this.replacements,"network"),jn(r,"setRequestHeader",function(e){return function(r,n){return this.__rollbar_xhr||(this.__rollbar_xhr={}),a(r,"string")&&a(n,"string")&&(t.autoInstrument.networkRequestHeaders&&(this.__rollbar_xhr.request_headers||(this.__rollbar_xhr.request_headers={}),this.__rollbar_xhr.request_headers[r]=n),"content-type"===r.toLowerCase()&&(this.__rollbar_xhr.request_content_type=n)),e.apply(this,arguments)}},this.replacements,"network"),jn(r,"send",function(r){return function(n){var o=this;function i(){if(o.__rollbar_xhr&&(null===o.__rollbar_xhr.status_code&&(o.__rollbar_xhr.status_code=0,t.autoInstrument.networkRequestBody&&(o.__rollbar_xhr.request=n),o.__rollbar_event=t.captureNetwork(o.__rollbar_xhr,"xhr",void 0)),o.readyState<2&&(o.__rollbar_xhr.start_time_ms=P()),o.readyState>3)){var e=P();o.__rollbar_xhr.end_time_ms=e;var r=null;if(o.__rollbar_xhr.response_content_type=o.getResponseHeader("Content-Type"),t.autoInstrument.networkResponseHeaders){var i=t.autoInstrument.networkResponseHeaders;r={};try{var a;if(!0===i){var s=o.getAllResponseHeaders();if(s){var u,l,c,f=Dn(s.trim().split(/[\r\n]+/));try{for(f.s();!(c=f.n()).done;){a=(u=c.value.split(": ")).shift(),l=u.join(": "),r[a]=l}}catch(t){f.e(t)}finally{f.f()}}}else{var p,d=Dn(i);try{for(d.s();!(p=d.n()).done;){var h=p.value;r[h]=o.getResponseHeader(h)}}catch(t){d.e(t)}finally{d.f()}}}catch(t){}}var y=null;if(t.autoInstrument.networkResponseBody)try{y=o.responseText}catch(t){}var v=null;(y||r)&&(v={},y&&(t.isJsonContentType(o.__rollbar_xhr.response_content_type)?v.body=t.scrubJson(y):v.body=y),r&&(v.headers=r)),v&&(o.__rollbar_xhr.response=v);try{var m=o.status;m=1223===m?204:m,o.__rollbar_xhr.status_code=m,t.addOtelNetworkResponse(o.__rollbar_event,e,m),o.__rollbar_event.level=t.telemeter.levelFromStatus(m),t.errorOnHttpStatus(o.__rollbar_xhr)}catch(t){}}}return e("onload",o),e("onerror",o),e("onprogress",o),"onreadystatechange"in o&&u(o.onreadystatechange)?jn(o,"onreadystatechange",function(e){return t.rollbar.wrap(e,void 0,i)}):o.onreadystatechange=i,o.__rollbar_xhr&&t.trackHttpErrors()&&(o.__rollbar_xhr.stack=(new Error).stack),r.apply(this,arguments)}},this.replacements,"network")}"fetch"in this._window&&jn(this._window,"fetch",function(e){return function(r,n){var o,i=Array.prototype.slice.call(arguments),s=i[0],u="GET",l=Bn(s);a(s,"string")||l?o=l?s.toString():s:s&&(o=s.url,s.method&&(u=s.method)),i[1]&&i[1].method&&(u=i[1].method);var c={method:u,url:o,status_code:null,start_time_ms:P(),end_time_ms:null};if(i[1]&&i[1].headers){var f=En(i[1].headers);c.request_content_type=f.get("Content-Type"),t.autoInstrument.networkRequestHeaders&&(c.request_headers=t.fetchHeaders(f,t.autoInstrument.networkRequestHeaders))}t.autoInstrument.networkRequestBody&&(i[1]&&i[1].body?c.request=i[1].body:i[0]&&!a(i[0],"string")&&i[0].body&&(c.request=i[0].body));var p=t.captureNetwork(c,"fetch",void 0);return t.trackHttpErrors()&&(c.stack=(new Error).stack),e.apply(this,i).then(function(e){var r=P();c.end_time_ms=r,c.status_code=e.status,t.addOtelNetworkResponse(p,r,e.status),c.response_content_type=e.headers.get("Content-Type");var n=null;t.autoInstrument.networkResponseHeaders&&(n=t.fetchHeaders(e.headers,t.autoInstrument.networkResponseHeaders));var o=null;return t.autoInstrument.networkResponseBody&&"function"==typeof e.text&&(o=e.clone().text()),(n||o)&&(c.response={},o&&("function"==typeof o.then?o.then(function(e){e&&t.isJsonContentType(c.response_content_type)?c.response.body=t.scrubJson(e):c.response.body=e}):c.response.body=o),n&&(c.response.headers=n)),t.errorOnHttpStatus(c),e})}},this.replacements,"network")}},{key:"captureNetwork",value:function(t,e,r){return t.request&&this.isJsonContentType(t.request_content_type)&&(t.request=this.scrubJson(t.request)),this.telemeter.captureNetwork(t,e,r)}},{key:"isJsonContentType",value:function(t){return!!(t&&a(t,"string")&&t.toLowerCase().includes("json"))}},{key:"addOtelNetworkResponse",value:function(t,e,r){t.otelAttributes&&(t.otelAttributes["response.timeUnixNano"]=(1e6*e).toString(),t.otelAttributes.statusCode=r)}},{key:"scrubJson",value:function(t){return JSON.stringify(U(JSON.parse(t),this.options.scrubFields))}},{key:"fetchHeaders",value:function(t,e){var r={};try{if(!0===e){if("function"==typeof t.entries)for(var n=t.entries(),o=n.next();!o.done;)r[o.value[0]]=o.value[1],o=n.next()}else{var i,a=Dn(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;r[s]=t.get(s)}}catch(t){a.e(t)}finally{a.f()}}}catch(t){}return r}},{key:"trackHttpErrors",value:function(){return this.autoInstrument.networkErrorOnHttp5xx||this.autoInstrument.networkErrorOnHttp4xx||this.autoInstrument.networkErrorOnHttp0}},{key:"errorOnHttpStatus",value:function(t){var e=t.status_code;if(e>=500&&this.autoInstrument.networkErrorOnHttp5xx||e>=400&&this.autoInstrument.networkErrorOnHttp4xx||0===e&&this.autoInstrument.networkErrorOnHttp0){var r=new Error("HTTP request failed with Status "+e);r.stack=t.stack,this.rollbar.error(r,{skipFrames:1})}}},{key:"deinstrumentConsole",value:function(){for(var t;this.replacements.log.length;)t=this.replacements.log.shift(),this._window.console[t[0]]=t[1]}},{key:"instrumentConsole",value:function(){var t;if(null!==(t=this._window)&&void 0!==t&&null!==(t=t.console)&&void 0!==t&&t.log){var e=this,r=this._window.console;try{for(var n=0,o=["debug","info","warn","error","log"];n<o.length;n++){i(o[n])}}catch(t){this.diagnostic.instrumentConsole={error:t.message}}}function i(t){var n=r[t],o=r,i="warn"===t?"warning":t;r[t]=function(){var t=Array.prototype.slice.call(arguments),r=function(t){var e,r,n,o=[];for(e=0,r=t.length;e<r;++e){switch(s(n=t[e])){case"object":(n=(n=b(n)).error||n.value).length>500&&(n=n.substr(0,497)+"...");break;case"null":n="null";break;case"undefined":n="undefined";break;case"symbol":n=n.toString()}o.push(n)}return o.join(" ")}(t);e.telemeter.captureLog(r,i,null,P()),n&&Function.prototype.apply.call(n,o,t)},e.replacements.log.push([t,n])}}},{key:"deinstrumentDom",value:function(){this.removeListeners("dom")}},{key:"instrumentDom",value:function(){var t=this;this.addListener("dom",this._window,["click","dblclick","contextmenu"],function(e){return t.handleEvent("click",e)}),this.addListener("dom",this._window,["dragstart","dragend","dragenter","dragleave","drop"],function(e){return t.handleEvent("dragdrop",e)}),this.addListener("dom",this._window,["blur","focus"],function(e){return t.handleEvent("focus",e)}),this.addListener("dom",this._window,["submit","invalid"],function(e){return t.handleEvent("form",e)}),this.addListener("dom",this._window,["input","change"],function(e){return t.handleEvent("input",e)}),this.addListener("dom",this._window,["resize"],function(e){return t.handleEvent("resize",e)}),this.addListener("dom",this._document,["DOMContentLoaded"],function(e){return t.handleEvent("contentLoaded",e)})}},{key:"handleEvent",value:function(t,e){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,e)}catch(r){At.log("".concat(t," handler error"),e,r,r.stack)}}},{key:"handleContentLoaded",value:function(t){this.rollbar.triggerReplay({type:"navigation",path:new URL(this._location.href).pathname})}},{key:"handleClick",value:function(t){var e,r=null===(e=t.target)||void 0===e?void 0:e.tagName.toLowerCase();["input","select","textarea"].includes(r)||this.telemeter.captureClick({type:t.type,isSynthetic:!t.isTrusted,element:Pn(t.target),timestamp:P()})}},{key:"handleFocus",value:function(t){var e,r=t.type,n=null!==(e=t.target)&&void 0!==e&&e.window?"window":Pn(t.target);this.telemeter.captureFocus({type:r,isSynthetic:!t.isTrusted,element:n,timestamp:P()})}},{key:"handleForm",value:function(t){}},{key:"handleResize",value:function(t){var e=window.screen.width/window.innerWidth;this.telemeter.captureResize({type:t.type,isSynthetic:!t.isTrusted,width:window.innerWidth,height:window.innerHeight,textZoomRatio:e,timestamp:P()})}},{key:"handleDrag",value:function(t){var e,r,n,o,i,a,s=t.type;if("drop"===s){e=[],r=[];var u,l=Dn([].concat(Ln(t.dataTransfer.files),Ln(t.dataTransfer.items)));try{for(l.s();!(u=l.n()).done;){var c=u.value;c.kind&&c.type&&(e.push(c.kind),r.push(c.type))}}catch(t){l.e(t)}finally{l.f()}}["drop","dragstart"].includes(s)&&(n=null===(i=t.dataTransfer)||void 0===i?void 0:i.dropEffect,o=null===(a=t.dataTransfer)||void 0===a?void 0:a.effectAllowed);this.telemeter.captureDragDrop({type:s,isSynthetic:!t.isTrusted,element:Pn(t.target),dropEffect:n,effectAllowed:o,kinds:JSON.stringify(e),mediaTypes:JSON.stringify(r),timestamp:P()})}},{key:"scrubInputValue",value:function(t,e,r,n){var o="******";if("password"===n)return o;if(this.scrubTelemetryInputs)return o;var i=Rn(e);if(this.telemetryScrubber){if(this.telemetryScrubber(i))return o}else if(this.defaultValueScrubber(i))return o;return function(t,e,r){try{var n,o=In(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if("string"==typeof i){if(t.classList.contains(i))return!0}else{var a,s=In(t.classList);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(i.test(u))return!0}}catch(t){s.e(t)}finally{s.f()}}}}catch(t){o.e(t)}finally{o.f()}var l,c=In(r);try{for(c.s();!(l=c.n()).done;){var f=l.value;if(t.matches(f))return!0}}catch(t){c.e(t)}finally{c.f()}}catch(t){}return!1}(e,this.scrubClasses,this.scrubSelectors)?o:this.maskInputOptions[r.toLowerCase()]||this.maskInputOptions[n]?this.maskInputFn?this.maskInputFn(t,e):o:t}},{key:"handleInput",value:function(t){var e,r,n,o,i=t.type,a=null===(e=t.target)||void 0===e?void 0:e.tagName.toLowerCase(),s=null===(r=t.target)||void 0===r?void 0:r.value,u=(null===(n=t.target)||void 0===n||null===(n=n.attributes)||void 0===n||null===(n=n.type)||void 0===n?void 0:n.value)||(null===(o=t.target)||void 0===o?void 0:o.type);switch(void 0!==s&&(s=this.scrubInputValue(s,t.target,a,u)),i){case"input":if(["radio","checkbox"].includes(u))return;["select","textarea"].includes(a)&&(u=a);break;case"change":if(!["radio","checkbox"].includes(u))return;var l;if("checkbox"===u)s=null===(l=t.target)||void 0===l?void 0:l.checked}this.telemeter.captureInput({type:u,isSynthetic:!t.isTrusted,element:Pn(t.target),value:s,timestamp:P()})}},{key:"deinstrumentNavigation",value:function(){var t=this._window.chrome;!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState&&Fn(this.replacements,"navigation")}},{key:"instrumentNavigation",value:function(){var t=this._window.chrome;if(!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState){var e=this;jn(this._window,"onpopstate",function(t){return function(){var r=e._location.href;e.handleUrlChange(e._lastHref,r),t&&t.apply(this,arguments)}},this.replacements,"navigation"),jn(this._window.history,"pushState",function(t){return function(){var r=arguments.length>2?arguments[2]:void 0;return r&&e.handleUrlChange(e._lastHref,String(r)),t.apply(this,arguments)}},this.replacements,"navigation")}}},{key:"handleUrlChange",value:function(t,e){var r=pn(this._location.href),n=pn(e),o=pn(t);this._lastHref=e,r.protocol===n.protocol&&r.host===n.host&&(e=n.path+(n.hash||"")),r.protocol===o.protocol&&r.host===o.host&&(t=o.path+(o.hash||"")),this.telemeter.captureNavigation(t,e,null,P()),this.rollbar.triggerReplay({type:"navigation",path:e})}},{key:"instrumentConnectivity",value:function(){var t=this;this.addListener("connectivity",this._window,["online","offline"],function(e){return t.handleConnectivity(e)})}},{key:"handleConnectivity",value:function(t){var e=t.type;this.telemeter.captureConnectivityChange({type:e,isSynthetic:!t.isTrusted,timestamp:P()})}},{key:"handleCspEvent",value:function(t){var e="Security Policy Violation: blockedURI: "+t.blockedURI+", violatedDirective: "+t.violatedDirective+", effectiveDirective: "+t.effectiveDirective+", ";t.sourceFile&&(e+="location: "+t.sourceFile+", line: "+t.lineNumber+", col: "+t.columnNumber+", "),e+="originalPolicy: "+t.originalPolicy,this.telemeter.captureLog(e,"error",null,P()),this.handleCspError(e)}},{key:"handleCspError",value:function(t){this.autoInstrument.errorOnContentSecurityPolicy&&this.rollbar.error(t)}},{key:"deinstrumentContentSecurityPolicy",value:function(){this.removeListeners("contentsecuritypolicy")}},{key:"instrumentContentSecurityPolicy",value:function(){if("addEventListener"in this._document){var t=this.handleCspEvent.bind(this);this.addListener("contentsecuritypolicy",this._document,["securitypolicyviolation"],t)}}},{key:"addListener",value:function(t,e,r,n){var o=this;if(e.addEventListener){var i,a=Dn(r);try{var s=function(){var r=i.value,a={capture:!0,passive:!0};e.addEventListener(r,n,a,!0),o.eventRemovers[t].push(function(){e.removeEventListener(r,n,a)})};for(a.s();!(i=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}}}},{key:"removeListeners",value:function(t){for(;this.eventRemovers[t].length;)this.eventRemovers[t].shift()()}}])}();function Bn(t){return"undefined"!=typeof URL&&t instanceof URL}var Wn=Vn;function $n(t,e,r){if(c(e,"addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var o=function(e,r,o){n.call(this,e,t.wrap(r),o)};o._rollbarOldAdd=n,o.belongsToShim=r,e.addEventListener=o;for(var i=e.removeEventListener;i._rollbarOldRemove&&i.belongsToShim;)i=i._rollbarOldRemove;var a=function(t,e,r){i.call(this,t,e&&e._rollbar_wrapped||e,r)};a._rollbarOldRemove=i,a.belongsToShim=r,e.removeEventListener=a}}var Gn=function(t,e,r){if(t){var n,o,i="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(",");for(n=0;n<i.length;++n)t[o=i[n]]&&t[o].prototype&&$n(e,t[o].prototype,r)}};_n.setComponents({telemeter:Q,instrumenter:Wn,wrapGlobals:Gn,scrub:U,truncation:be,tracing:ie});var zn=_n,Xn="undefined"!=typeof window&&window._rollbarConfig,Zn=Xn&&Xn.globalAlias||"Rollbar",Qn="undefined"!=typeof window&&window[Zn]&&"function"==typeof window[Zn].shimId&&void 0!==window[Zn].shimId();if("undefined"==typeof window||window._rollbarStartTime||(window._rollbarStartTime=(new Date).getTime()),!Qn&&Xn){var Kn=new zn(Xn);window[Zn]=Kn}else"undefined"!=typeof window?(window.rollbar=zn,window._rollbarDidLoad=!0):"undefined"!=typeof self&&(self.rollbar=zn,self._rollbarDidLoad=!0);var Yn=zn;return e=e.default}()});
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rollbar=e():t.rollbar=e()}(this,function(){return function(){"use strict";var t={d:function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{default:function(){return eo}});var r={};function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t,e){return e===s(t)}function s(t){var e=i(t);return"object"!==e?e:t?t instanceof Error?"error":{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase():"null"}function u(t){return a(t,"function")}function l(t){return null!=t&&("object"==i(t)||"function"==typeof t)}function c(t,e){return null!=t&&(Object.hasOwn?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e))}function f(t){return Number.isFinite(t)}function p(t){return a(t,"error")||a(t,"exception")}function d(){return"********"}t.r(r),t.d(r,{parse:function(){return hn}});var h={debug:0,info:1,warning:2,error:3,critical:4};function y(t){var e=function(t){if(!a(t,"string"))return;for(var e=v,r=e.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=0,i=e.key.length;o<i;++o)n[e.key[o]]=r[o]||"";return n[e.q.name]={},n[e.key[12]].replace(e.q.parser,function(t,r,o){r&&(n[e.q.name][r]=o)}),n}(t);return e?(""===e.anchor&&(e.source=e.source.replace("#","")),t=e.source.replace("?"+e.query,"")):"(unknown)"}var v={strictMode:!1,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 m(t,e){if(!(e=e||t.protocol)&&t.port&&(80===t.port?e="http:":443===t.port&&(e="https:")),e=e||"https:",!t.hostname)return null;var r=e+"//"+t.hostname;return t.port&&(r=r+":"+t.port),t.path&&(r+=t.path),r}function b(t,e){var r,n;try{r=JSON.stringify(t)}catch(o){if(e&&u(e))try{r=e(t)}catch(t){n=t}else n=o}return{error:n,value:r}}function g(t){var e,r;try{e=JSON.parse(t)}catch(t){r=t}return{error:r,value:e}}function w(t,e,r,n,o,i,a,s){var u={url:e||"",line:r,column:n};u.func=s.guessFunctionName(u.url,u.line),u.context=s.gatherContext(u.url,u.line);var l="undefined"!=typeof document&&document&&document.location&&document.location.href,c="undefined"!=typeof window&&window&&window.navigator&&window.navigator.userAgent;return{mode:i,message:o?String(o):t||a,url:l,stack:[u],useragent:c}}function k(t,e){return function(r,n){try{e(r,n)}catch(e){t.error(e)}}}function S(t){return function t(e,r){var n,o,i,u={};try{for(o in e)(n=e[o])&&(a(n,"object")||a(n,"array"))?r.includes(n)?u[o]="Removed circular reference: "+s(n):((i=r.slice()).push(n),u[o]=t(n,i)):u[o]=n}catch(t){u="Failed cloning custom data: "+t.message}return u}(t,[t])}function _(t,e,r,n,o){for(var i,a,u,l,c,f,p=[],d=[],h=0,y=t.length;h<y;++h){var v=s(f=t[h]);switch(d.push(v),v){case"undefined":break;case"string":i?p.push(f):i=f;break;case"function":l=k(e,f);break;case"date":p.push(f);break;case"error":case"domexception":case"exception":a?p.push(f):a=f;break;case"object":case"array":if(f instanceof Error||"undefined"!=typeof DOMException&&f instanceof DOMException){a?p.push(f):a=f;break}if(n&&"object"===v&&!c){for(var m=0,b=n.length;m<b;++m)if(void 0!==f[n[m]]){c=f;break}if(c)break}u?p.push(f):u=f;break;default:if(f instanceof Error||"undefined"!=typeof DOMException&&f instanceof DOMException){a?p.push(f):a=f;break}p.push(f)}}u&&(u=S(u)),p.length>0&&(u||(u=S({})),u.extraArgs=S(p));var g,w={message:i,err:a,custom:u,timestamp:P(),callback:l,notifier:r,diagnostic:{},uuid:(g=P(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(g+16*Math.random())%16|0;return g=Math.floor(g/16),("x"===t?e:7&e|8).toString(16)}))};return w.data=w.data||{},function(t,e){e&&void 0!==e.level&&(t.level=e.level,delete e.level);e&&void 0!==e.skipFrames&&(t.skipFrames=e.skipFrames,delete e.skipFrames)}(w,u),n&&c&&(w.request=c),o&&(w.lambdaContext=o),w._originalArgs=t,w.diagnostic.original_arg_types=d,w}var O=["log","network","dom","navigation","error","manual"],x=["critical","error","warning","info","debug"];function E(t,e){var r,o=n(t);try{for(o.s();!(r=o.n()).done;){if(r.value===e)return!0}}catch(t){o.e(t)}finally{o.f()}return!1}function j(t,e){t.attributes=t.attributes||[];var r,o=n(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;void 0!==i.value&&t.attributes.push(i)}}catch(t){o.e(t)}finally{o.f()}}function I(t,e){if(t){var r=e.split("."),n=t;try{for(var o=0,i=r.length;o<i;++o)n=n[r[o]]}catch(t){n=void 0}return n}}function T(t,e,r){if(t){Object.setPrototypeOf(t,null);var n=e.split("."),o=n.length;if(!(o<1))if(1!==o)try{for(var i=t[n[0]]||{},a=i,s=1;s<o-1;++s)i[n[s]]=i[n[s]]||{},i=i[n[s]];i[n[o-1]]=r,t[n[0]]=a}catch(t){return}else t[n[0]]=r}}function P(){return Date.now?Date.now():Number(new Date)}function A(t,e,r,n){var o=R(t,e,r);return o=function(t,e){t.hostWhiteList&&!t.hostSafeList&&(t.hostSafeList=t.hostWhiteList,t.hostWhiteList=void 0,e&&e.log("hostWhiteList is deprecated. Use hostSafeList."));t.hostBlackList&&!t.hostBlockList&&(t.hostBlockList=t.hostBlackList,t.hostBlackList=void 0,e&&e.log("hostBlackList is deprecated. Use hostBlockList."));return t}(o,n),!e||e.overwriteScrubFields||e.scrubFields&&(o.scrubFields=(t.scrubFields||[]).concat(e.scrubFields)),o}function R(){function t(t){if(!t||"[object Object]"!==Object.prototype.toString.call(t))return!1;var e,r=c(t,"constructor"),n=t.constructor&&t.constructor.prototype&&c(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;for(e in t);return void 0===e||c(t,e)}var e,r,n,o,i,a=Object.create(null),s=null,u=arguments.length;for(e=0;e<u;e++)if(null!=(s=arguments[e]))for(i in s)r=a[i],a!==(n=s[i])&&(n&&t(n)?(o=r&&t(r)?r:{},a[i]=R(o,n)):void 0!==n&&(a[i]=n));return a}function C(t,e,r){var n;if(null==e||!e.sessionId||!r)return!1;var o=null==t||null===(n=t.tracing)||void 0===n?void 0:n.propagation,i=null==o?void 0:o.enabledHeaders;if(!Array.isArray(i)||!i.includes("baggage"))return!1;var s=null==o?void 0:o.enabledCorsUrls;return!(!Array.isArray(s)||0===s.length)&&s.some(function(t){return a(t,"string")?r===t:!!a(t,"regexp")&&t.test(r)})}function L(t,e){var r,n,o=t[1],i=null===(r=o)||void 0===r?void 0:r.headers,a=(n=t[0],"undefined"!=typeof Request&&n instanceof Request&&t[0].headers),s=i||a;if(s||(o||(t[1]=o={}),s=o.headers={}),s instanceof Headers)for(var u=0,c=Object.keys(e);u<c.length;u++){var f=c[u];s.append(f,e[f])}else if(l(s))for(var p=0,d=Object.keys(e);p<d.length;p++){var h=d[p];s[h]=e[h]}}var q=function(t,e,r){var n,o,i,s,u=a(t,"object"),l=a(t,"array"),f=[];if(r=r||{obj:[],mapped:[]},u){if(s=r.obj.indexOf(t),u&&-1!==s)return r.mapped[s]||r.obj[s];r.obj.push(t),s=r.obj.length-1}if(u)for(n in t)c(t,n)&&f.push(n);else if(l)for(i=0;i<t.length;++i)f.push(i);var p=u?{}:[],d=!0;for(i=0;i<f.length;++i)o=t[n=f[i]],p[n]=e(n,o,r),d=d&&p[n]===t[n];return u&&!d&&(r.mapped[s]=p),d?t:p};function N(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||M(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=M(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function M(t,e){if(t){if("string"==typeof t)return U(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(t,e):void 0}}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function H(t,e){var r=e.split("."),n=r.length-1;try{var o,i=D(r.entries());try{for(i.s();!(o=i.n()).done;){var a=N(o.value,2),s=a[0],u=a[1];s<n?t=t[u]:t[u]=d()}}catch(t){i.e(t)}finally{i.f()}}catch(t){}}var F=function(t,e,r){if(e=e||[],r){var n,o=D(r);try{for(o.s();!(n=o.n()).done;){H(t,n.value)}}catch(t){o.e(t)}finally{o.f()}}var i=function(t){var e,r=[],n=D(t);try{for(n.s();!(e=n.n()).done;){var o="^\\[?(%5[bB])?"+e.value+"\\[?(%5[bB])?\\]?(%5[dD])?$";r.push(new RegExp(o,"i"))}}catch(t){n.e(t)}finally{n.f()}return r}(e),s=function(t){var e,r=[],n=D(t);try{for(n.s();!(e=n.n()).done;){var o="\\[?(%5[bB])?"+e.value+"\\[?(%5[bB])?\\]?(%5[dD])?";r.push(new RegExp("("+o+"=)([^&\\n]+)","igm"))}}catch(t){n.e(t)}finally{n.f()}return r}(e);function u(t,e){return e+"********"}return q(t,function t(e,r,n){var o=function(t,e){var r,n=D(i);try{for(n.s();!(r=n.n()).done;)if(r.value.test(t)){e=d();break}}catch(t){n.e(t)}finally{n.f()}return e}(e,r);return o===r?a(r,"object")||a(r,"array")?q(r,t,n):function(t){if(a(t,"string")){var e,r=D(s);try{for(r.s();!(e=r.n()).done;){var n=e.value;t=t.replace(n,u)}}catch(t){r.e(t)}finally{r.f()}}return t}(o):o})},J=["otelAttributes"];function V(t){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V(t)}function B(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function W(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?B(Object(r),!0).forEach(function(e){$(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function $(t,e,r){return(e=z(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,z(n.key),n)}}function z(t){var e=function(t,e){if("object"!=V(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=V(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==V(e)?e:e+""}var X=100;function Z(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}var Q=function(){return t=function t(e,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.queue=[],this.options=R(e);var o=this.options.maxTelemetryEvents||X;this.maxQueueSize=Math.max(0,Math.min(o,X)),this.tracing=r,this.telemetrySpan=null===(n=this.tracing)||void 0===n?void 0:n.startSpan("rollbar-telemetry",{})},e=[{key:"configure",value:function(t){var e=this.options;this.options=R(e,t);var r=this.options.maxTelemetryEvents||X,n=Math.max(0,Math.min(r,X)),o=0;this.queue.length>n&&(o=this.queue.length-n),this.maxQueueSize=n,this.queue.splice(0,o)}},{key:"copyEvents",value:function(){var t=Array.prototype.slice.call(this.queue,0);if(u(this.options.filterTelemetry))try{for(var e=t.length;e--;)this.options.filterTelemetry(t[e])&&t.splice(e,1)}catch(t){this.options.filterTelemetry=null}return t=(t=t.filter(function(t){return"connectivity"!==t.type})).map(function(t){t.otelAttributes;var e=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,J);return e}),t}},{key:"exportTelemetrySpan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.telemetrySpan&&(this.telemetrySpan.end(t),this.telemetrySpan=this.tracing.startSpan("rollbar-telemetry",{}))}},{key:"capture",value:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a={level:K(t,r),type:t,timestamp_ms:o||P(),body:e,source:"client"};n&&(a.uuid=n),i&&(a.otelAttributes=i);try{if(u(this.options.filterTelemetry)&&this.options.filterTelemetry(a))return!1}catch(t){this.options.filterTelemetry=null}return this.push(a),a}},{key:"captureEvent",value:function(t,e,r,n){return this.capture(t,e,r,n)}},{key:"captureError",value:function(t,e,r,n){var o,i=t.message||String(t),a={message:i};t.stack&&(a.stack=t.stack);var s={message:i,level:e,type:"error",uuid:r};return null===(o=this.telemetrySpan)||void 0===o||o.addEvent("rollbar-occurrence-event",s,Z(n)),this.capture("error",a,e,r,n,s)}},{key:"captureLog",value:function(t,e,r,n){var o,i=r?"rollbar-occurrence-event":"rollbar-log-event",a=W({message:t,level:e},r?{type:"message",uuid:r}:{});return null===(o=this.telemetrySpan)||void 0===o||o.addEvent(i,a,Z(n)),this.capture("log",{message:t},e,r,n,a)}},{key:"captureNetwork",value:function(t,e,r,n){var o,i,a;e=e||"xhr",t.subtype=t.subtype||e,n&&(t.request=n);var s=this.levelFromStatus(t.status_code),u=1e6*(t.end_time_ms||0),l={type:t.subtype,method:t.method,url:t.url,statusCode:t.status_code,"request.headers":JSON.stringify(t.request_headers||{}),"response.headers":JSON.stringify((null===(o=t.response)||void 0===o?void 0:o.headers)||{}),"response.timeUnixNano":u.toString()},c=t.request,f=null===(i=t.response)||void 0===i?void 0:i.body;return c&&(l["request.body"]=JSON.stringify(c)),f&&(l["response.body"]=JSON.stringify(f)),null===(a=this.telemetrySpan)||void 0===a||a.addEvent("rollbar-network-event",l,Z(t.start_time_ms)),this.capture("network",t,s,r,t.start_time_ms,l)}},{key:"levelFromStatus",value:function(t){return t>=200&&t<400?"info":0===t||t>=400?"error":"info"}},{key:"captureDom",value:function(t,e,r,n,o){var i={subtype:t,element:e};return void 0!==r&&(i.value=r),void 0!==n&&(i.checked=n),this.capture("dom",i,"info",o)}},{key:"captureInput",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.value,a=t.timestamp,s="rollbar-input-event",u={type:s,subtype:r,element:o,value:i},l={type:r,isSynthetic:n,element:o,value:i,endTimeUnixNano:Z(a)},c=this._getRepeatedEvent(s,l);return c?this._updateRepeatedEvent(c,l,a):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(s,l,Z(a)),this.capture("dom",u,"info",null,a,l))}},{key:"captureClick",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.timestamp,a="rollbar-click-event",s={type:a,subtype:r,element:o},u={type:r,isSynthetic:n,element:o,endTimeUnixNano:Z(i)},l=this._getRepeatedEvent(a,u);return l?this._updateRepeatedEvent(l,u,i):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,Z(i)),this.capture("dom",s,"info",null,i,u))}},{key:"_getRepeatedEvent",value:function(t,e){var r=this._lastEvent(this.queue);if(r&&r.body.type===t&&r.otelAttributes.target===e.target)return r}},{key:"_updateRepeatedEvent",value:function(t,e,r){var n=Math.max(r-t.timestamp_ms,1);t.body.value=e.value,t.otelAttributes.value=e.value,t.otelAttributes.height=e.height,t.otelAttributes.width=e.width,t.otelAttributes.textZoomRatio=e.textZoomRatio,t.otelAttributes.endTimeUnixNano=Z(r),t.otelAttributes.durationUnixNano=Z(n),t.otelAttributes.count=(t.otelAttributes.count||1)+1,t.otelAttributes.rate=t.otelAttributes.count/(n/1e3)}},{key:"_lastEvent",value:function(t){return t.length>0?t[t.length-1]:null}},{key:"captureFocus",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.timestamp,a="rollbar-focus-event",s={type:a,subtype:r,element:o},u={type:r,isSynthetic:n,element:o};return null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,Z(i)),this.capture("dom",s,"info",null,i,u)}},{key:"captureResize",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.width,i=t.height,a=t.textZoomRatio,s=t.timestamp,u="rollbar-resize-event",l={type:u,subtype:r,width:o,height:i,textZoomRatio:a},c={type:r,isSynthetic:n,width:o,height:i,textZoomRatio:a},f=this._getRepeatedEvent(u,c);return f?this._updateRepeatedEvent(f,c,s):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(u,c,Z(s)),this.capture("dom",l,"info",null,s,c))}},{key:"captureDragDrop",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.dropEffect,a=t.effectAllowed,s=t.kinds,u=t.mediaTypes,l=t.timestamp,c="rollbar-dragdrop-event",f={type:c,subtype:r,isSynthetic:n},p={type:r,isSynthetic:n};return"dragstart"===r&&(f=W(W({},f),{},{element:o,dropEffect:i,effectAllowed:a}),p=W(W({},p),{},{element:o,dropEffect:i,effectAllowed:a})),"drop"===r&&(f=W(W({},f),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u}),p=W(W({},p),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u})),null===(e=this.telemetrySpan)||void 0===e||e.addEvent(c,p,Z(l)),this.capture("dom",f,"info",null,l,p)}},{key:"captureNavigation",value:function(t,e,r,n){var o;return null===(o=this.telemetrySpan)||void 0===o||o.addEvent("rollbar-navigation-event",{"previous.url.full":t,"url.full":e},Z(n)),this.capture("navigation",{from:t,to:e},"info",r,n)}},{key:"captureDomContentLoaded",value:function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())}},{key:"captureLoad",value:function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())}},{key:"captureConnectivityChange",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.timestamp,i="rollbar-connectivity-event",a={type:i,subtype:r},s={type:r,isSynthetic:n};return null===(e=this.telemetrySpan)||void 0===e||e.addEvent(i,s,Z(o)),this.capture("connectivity",a,"info",null,o,s)}},{key:"_captureRollbarItem",value:function(t){if(this.options.includeItemsInTelemetry)return t.err?this.captureError(t.err,t.level,t.uuid,t.timestamp):t.message?this.captureLog(t.message,t.level,t.uuid,t.timestamp):t.custom?this.capture("log",t.custom,t.level,t.uuid,t.timestamp):void 0}},{key:"push",value:function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()}}],e&&G(t.prototype,e),r&&G(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function K(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}var Y=Q;function tt(t){return tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tt(t)}function et(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rt(n.key),n)}}function rt(t){var e=function(t,e){if("object"!=tt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=tt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==tt(e)?e:e+""}var nt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._currentContext=e?new Map(e):new Map}return e=t,(r=[{key:"getValue",value:function(t){return this._currentContext.get(t)}},{key:"setValue",value:function(e,r){var n=new t(this._currentContext);return n._currentContext.set(e,r),n}},{key:"deleteValue",value:function(e){var r=new t(self._currentContext);return r._currentContext.delete(e),r}}])&&et(e.prototype,r),n&&et(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}(),ot=new nt;function it(t){return it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},it(t)}function at(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,st(n.key),n)}}function st(t){var e=function(t,e){if("object"!=it(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=it(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==it(e)?e:e+""}var ut=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.currentContext=ot},e=[{key:"active",value:function(){return this.currentContext}},{key:"enterContext",value:function(t){var e=this.currentContext;return this.currentContext=t||ot,e}},{key:"exitContext",value:function(t){return this.currentContext=t,this.currentContext}},{key:"with",value:function(t,e,r){var n=this.enterContext(t);try{for(var o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];return e.call.apply(e,[r].concat(i))}finally{this.exitContext(n)}}}],e&&at(t.prototype,e),r&&at(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function lt(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}function ct(t,e){return[t[0]+e[0]+Math.trunc((t[1]+e[1])/1e9),(t[1]+e[1])%1e9]}var ft={fromMillis:lt,toMillis:function(t){return 1e3*t[0]+Math.round(t[1]/1e6)},toNanos:function(t){return 1e9*t[0]+t[1]},add:ct,now:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?ct(lt(performance.timeOrigin),lt(performance.now())):lt(Date.now())},isHrTime:function(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}};function pt(t){return pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pt(t)}function dt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||yt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ht(t){return function(t){if(Array.isArray(t))return vt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||yt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yt(t,e){if(t){if("string"==typeof t)return vt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vt(t,e):void 0}}function vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function mt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,bt(n.key),n)}}function bt(t){var e=function(t,e){if("object"!=pt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=pt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==pt(e)?e:e+""}var gt=function(){return t=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=e,this.options=r},e=[{key:"export",value:function(t,e){wt.push.apply(wt,ht(t))}},{key:"toPayload",value:function(){var t=this,e=wt.slice();if(wt.length=0,!e||!e.length)return{resourceSpans:[]};var r,n=e[0]&&e[0].resource||{},o=new Map,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=yt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(e);try{for(i.s();!(r=i.n()).done;){var a=r.value,s=a.instrumentationScope?"".concat(a.instrumentationScope.name,":").concat(a.instrumentationScope.version):"default:1.0.0";o.has(s)||o.set(s,{scope:a.instrumentationScope||{name:"default",version:"1.0.0",attributes:[]},spans:[]}),o.get(s).spans.push(this._transformSpan(a))}}catch(t){i.e(t)}finally{i.f()}return{resourceSpans:[{resource:this._transformResource(n),scopeSpans:Array.from(o.values()).map(function(e){return{scope:t._transformInstrumentationScope(e.scope),spans:e.spans}})}]}}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.api.postSpans(t,e)}},{key:"_transformSpan",value:function(t){var e,r=this,n=function(t){return Object.entries(t||{}).map(function(t){var e=dt(t,2),n=e[0],o=e[1];return{key:n,value:r._transformAnyValue(o)}})};return{traceId:t.spanContext.traceId,spanId:t.spanContext.spanId,parentSpanId:t.parentSpanId||"",name:t.name,kind:t.kind||1,startTimeUnixNano:ft.toNanos(t.startTime),endTimeUnixNano:ft.toNanos(t.endTime),attributes:n(t.attributes),events:(e=t.events,(e||[]).map(function(t){return{timeUnixNano:ft.toNanos(t.time),name:t.name,attributes:n(t.attributes)}}))}}},{key:"_transformResource",value:function(t){var e=this,r=t.attributes||{};return{attributes:Object.entries(r).map(function(t){var r=dt(t,2),n=r[0],o=r[1];return{key:n,value:e._transformAnyValue(o)}})}}},{key:"_transformInstrumentationScope",value:function(t){var e=this;return{name:t.name||"",version:t.version||"",attributes:(t.attributes||[]).map(function(t){return{key:t.key,value:e._transformAnyValue(t.value)}})}}},{key:"_transformAnyValue",value:function(t){var e=this;if(null==t)return{stringValue:""};var r=pt(t);return"string"===r?{stringValue:t}:"number"===r?Number.isInteger(t)?{intValue:t.toString()}:{doubleValue:t}:"boolean"===r?{boolValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(function(t){return e._transformAnyValue(t)})}}:"object"===r?{kvlistValue:{values:Object.entries(t).map(function(t){var r=dt(t,2),n=r[0],o=r[1];return{key:n,value:e._transformAnyValue(o)}})}}:{stringValue:String(t)}}}],e&&mt(t.prototype,e),r&&mt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),wt=[];var kt={gen:function(){var t=new Uint8Array(arguments.length>0&&void 0!==arguments[0]?arguments[0]:16);return crypto.getRandomValues(t),Array.from(t,function(t){return t.toString(16).padStart(2,"0")}).join("")}};function St(t){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(t)}function _t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_t(Object(r),!0).forEach(function(e){Et(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function xt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jt(n.key),n)}}function Et(t,e,r){return(e=jt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jt(t){var e=function(t,e){if("object"!=St(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=St(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==St(e)?e:e+""}var It="RollbarSession",Tt=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Et(this,"_attributes",void 0),this.options=r,this.tracing=e,this.window=e.window,this.session=null,this._attributes={}},e=[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.session||(this.getSession()||this.createSession(),this.initSessionAttributes(t)),this}},{key:"getSession",value:function(){try{var t=this.window.sessionStorage.getItem(It);if(!t)return null;this.session=JSON.parse(t)}catch(t){return null}return this}},{key:"createSession",value:function(){return this.session={id:kt.gen(),createdAt:Date.now()},this.setSession(this.session)}},{key:"setSession",value:function(t){var e=JSON.stringify(t);try{this.window.sessionStorage.setItem(It,e)}catch(t){return null}return this}},{key:"attributes",get:function(){return this._attributes}},{key:"setAttributes",value:function(t){return this._attributes=Ot(Ot({},this._attributes),t),this}},{key:"setUser",value:function(t){return this.setAttributes({"user.id":null==t?void 0:t.id,"user.email":null==t?void 0:t.email,"user.name":(null==t?void 0:t.name)||(null==t?void 0:t.username)}),this}},{key:"initSessionAttributes",value:function(t){var e,r,n;return this.setAttributes(Ot({"session.id":this.session.id,"browser.brands":null===(e=navigator.userAgentData)||void 0===e?void 0:e.brands,"browser.language":navigator.language,"browser.mobile":null===(r=navigator.userAgentData)||void 0===r?void 0:r.mobile,"browser.platform":null===(n=navigator.userAgentData)||void 0===n?void 0:n.platform,"client.address":"$remote_ip","rollbar.notifier.framework":"browser-js","user_agent.original":navigator.userAgent},t)),this}}],e&&xt(t.prototype,e),r&&xt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),Pt=function(){},At={debug:0,info:1,warn:2,error:3,disable:4},Rt={error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Pt("error",e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Pt("warn",e)},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Pt("info",e)},debug:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Pt("debug",e)},log:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Pt("info",e)},init:function(t){var e=t.logLevel;Pt=function(t,r){At[t]<At[e]||(r.unshift("Rollbar:"),console[t].apply(console,r))}}},Ct=Rt;function Lt(t){return Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(t)}function qt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Nt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Nt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Dt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Mt(n.key),n)}}function Mt(t){var e=function(t,e){if("object"!=Lt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Lt(e)?e:e+""}var Ut=function(){return t=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.exporter=e,this.options=r,this.pendingSpans=new Map,this.transforms=[this.userTransform.bind(this)]},e=[{key:"addTransform",value:function(t){this.transforms.unshift(t)}},{key:"userTransform",value:function(t){this.options.transformSpan&&this.options.transformSpan({span:t})}},{key:"applyTransforms",value:function(t){var e,r=qt(this.transforms);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{n(t)}catch(t){Ct.error("Error running span transform callback",t)}}}catch(t){r.e(t)}finally{r.f()}}},{key:"onStart",value:function(t,e){this.pendingSpans.set(t.span.spanContext.spanId,t)}},{key:"onEnd",value:function(t){this.applyTransforms(t.span),this.exporter.export([t.export()]),this.pendingSpans.delete(t.span.spanContext.spanId)}}],e&&Dt(t.prototype,e),r&&Dt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Ht(t){return Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht(t)}function Ft(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Jt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Jt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Vt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Bt(n.key),n)}}function Bt(t){var e=function(t,e){if("object"!=Ht(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ht(e)?e:e+""}var Wt=function(){return t=function t(e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.usePerformance=e.usePerformance,this.initReadableSpan(e),this.spanProcessor=e.spanProcessor,this.spanProcessor.onStart(this,e.context),e.attributes&&this.setAttributes(e.attributes),this},e=[{key:"initReadableSpan",value:function(t){var e;this.span={name:t.name,kind:t.kind,spanContext:t.spanContext,parentSpanId:t.parentSpanId,startTime:t.startTime||ft.now(t.usePerformance),endTime:[0,0],status:{code:0,message:""},attributes:{"session.id":null===(e=t.session)||void 0===e?void 0:e.id},links:[],events:[],duration:0,ended:!1,resource:t.resource,instrumentationScope:t.scope,droppedAttributesCount:0,droppedEventsCount:0,droppedLinksCount:0}}},{key:"spanContext",value:function(){return this.span.spanContext}},{key:"spanId",get:function(){return this.span.spanContext.spanId}},{key:"traceId",get:function(){return this.span.spanContext.traceId}},{key:"setAttribute",value:function(t,e){return null==e||this.span.ended||0===t.length||(this.span.attributes[t]=e),this}},{key:"setAttributes",value:function(t){for(var e=0,r=Object.entries(t);e<r.length;e++){var n=Ft(r[e],2),o=n[0],i=n[1];this.setAttribute(o,i)}return this}},{key:"addEvent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return this.span.ended||this.span.events.push({name:t,attributes:e,time:r||ft.now(),droppedAttributesCount:0}),this}},{key:"isRecording",value:function(){return!1===this.span.ended}},{key:"end",value:function(t,e){t&&this.setAttributes(t),this.span.endTime=e||ft.now(this.usePerformance),this.span.ended=!0,this.spanProcessor.onEnd(this)}},{key:"export",value:function(){return this.span}}],e&&Vt(t.prototype,e),r&&Vt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function $t(t){return $t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t(t)}function Gt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function zt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Gt(Object(r),!0).forEach(function(e){Xt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Xt(t,e,r){return(e=Qt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qt(n.key),n)}}function Qt(t){var e=function(t,e){if("object"!=$t(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=$t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$t(e)?e:e+""}var Kt=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.spanProcessor=r,this.tracing=e},e=[{key:"startSpan",value:function(t){var e,r,n,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tracing.contextManager.active(),u=this.tracing.getSpan(s),l=null==u?void 0:u.spanContext(),c=kt.gen(8),f=null;l?(o=l.traceId,f=l.traceState,i=l.spanId):o=kt.gen(16);var p={traceId:o,spanId:c,traceFlags:0,traceState:f},d={attributes:zt(zt({},(null===(e=this.tracing.resource)||void 0===e?void 0:e.attributes)||{}),(null===(r=a.resource)||void 0===r?void 0:r.attributes)||{})};return new Wt({resource:d,scope:this.tracing.scope,session:null===(n=this.tracing.session)||void 0===n?void 0:n.session,context:s,spanContext:p,name:t,kind:0,parentSpanId:i,spanProcessor:this.spanProcessor,startTime:a.startTime,usePerformance:a.usePerformance})}}],e&&Zt(t.prototype,e),r&&Zt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Yt(t){return Yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yt(t)}function te(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ee(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?te(Object(r),!0).forEach(function(e){re(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):te(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function re(t,e,r){return(e=oe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ne(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,oe(n.key),n)}}function oe(t){var e=function(t,e){if("object"!=Yt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Yt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Yt(e)?e:e+""}var ie,ae=(ie="Rollbar Context Key SPAN",Symbol.for(ie)),se=function(){return t=function t(e,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=r,this.options=n,this.window=e,this.window.sessionStorage&&(this.session=new Tt(this,n)),this.createTracer()},e=[{key:"configure",value:function(t){this.options=t}},{key:"initSession",value:function(){this.session&&this.session.init()}},{key:"sessionId",get:function(){return this.session?this.session.session.id:null}},{key:"resource",get:function(){var t,e;return{attributes:ee(ee({},this.options.resource||{}),{},{"rollbar.environment":null!==(t=null===(e=this.options.payload)||void 0===e?void 0:e.environment)&&void 0!==t?t:this.options.environment})}}},{key:"scope",get:function(){return{name:"rollbar-browser-js",version:this.options.version}}},{key:"idGen",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return kt.gen(t)}},{key:"createTracer",value:function(){this.contextManager=new ut,this.exporter=new gt(this.api,this.options),this.spanProcessor=new Ut(this.exporter,this.options.tracing),this.tracer=new Kt(this,this.spanProcessor)}},{key:"getTracer",value:function(){return this.tracer}},{key:"addSpanTransform",value:function(t){this.spanProcessor.addTransform(t)}},{key:"getSpan",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.contextManager.active()).getValue(ae)}},{key:"setSpan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.contextManager.active(),e=arguments.length>1?arguments[1]:void 0;return t.setValue(ae,e)}},{key:"startSpan",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.contextManager.active();return this.tracer.startSpan(t,e,r)}},{key:"with",value:function(t,e,r){for(var n,o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];return(n=this.contextManager).with.apply(n,[t,e,r].concat(i))}},{key:"withSpan",value:function(t,e,r,n){var o=this.startSpan(t,e);return this.with(this.setSpan(this.contextManager.active(),o),r,n,o)}}],e&&ne(t.prototype,e),r&&ne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function ue(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||ce(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function le(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ce(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function ce(t,e){if(t){if("string"==typeof t)return fe(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fe(t,e):void 0}}function fe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function pe(t,e){return[t,b(t,e)]}function de(t,e){var r=t.length;return r>2*e?t.slice(0,e).concat(t.slice(r-e)):t}function he(t,e,r){r=void 0===r?30:r;var n,o=t.data.body;if(o.trace_chain){var i,a=le(o.trace_chain);try{for(a.s();!(i=a.n()).done;){var s=i.value;n=de(n=s.frames,r),s.frames=n}}catch(t){a.e(t)}finally{a.f()}}else o.trace&&(n=de(n=o.trace.frames,r),o.trace.frames=n);return[t,b(t,e)]}function ye(t,e){return e&&e.length>t?e.slice(0,t-3).concat("..."):e}function ve(t,e,r){return e=q(e,function e(r,n,o){switch(s(n)){case"string":return ye(t,n);case"object":case"array":return q(n,e,o);default:return n}}),[e,b(e,r)]}function me(t){return t.exception&&(delete t.exception.description,t.exception.message=ye(255,t.exception.message)),t.frames=de(t.frames,1),t}function be(t,e){var r=t.data.body;if(r.trace_chain){var n,o=r.trace_chain,i=le(o.entries());try{for(i.s();!(n=i.n()).done;){var a=ue(n.value,2),s=a[0],u=a[1];o[s]=me(u)}}catch(t){i.e(t)}finally{i.f()}}else r.trace&&(r.trace=me(r.trace));return[t,b(t,e)]}function ge(t,e){return function(t){for(var e=0,r=t.length,n=0;n<r;n++){var o=t.charCodeAt(n);o<128?e+=1:o<2048?e+=2:o<65536&&(e+=3)}return e}(t)>e}var we={truncate:function(t,e,r){r=void 0===r?524288:r;for(var n,o,i,a=[pe,he,ve.bind(null,1024),ve.bind(null,512),ve.bind(null,256),be];n=a.shift();)if(t=(o=n(t,e))[0],(i=o[1]).error||!ge(i.value,r))return i;return i},raw:pe,truncateFrames:he,truncateStrings:ve,maybeTruncateValue:ye};function ke(t){if(!a(t.context,"string")){var e=b(t.context);e.error?t.context="Error: could not serialize 'context'":t.context=e.value||"",t.context.length>255&&(t.context=t.context.substr(0,255))}return{data:t}}function Se(t,e,r){var n=e.hostname,o=e.protocol,i=e.port,a=e.path,s=e.search,u=t.timeout,l=function(t){var e="undefined"!=typeof window&&window||"undefined"!=typeof self&&self,r=t.defaultTransport||"xhr";void 0===e.fetch&&(r="xhr");void 0===e.XMLHttpRequest&&(r="fetch");return r}(t),c=t.proxy;if(t.endpoint){var f=r.parse(t.endpoint);n=f.hostname,o=f.protocol,i=f.port,a=f.pathname,s=f.search}return{timeout:u,hostname:n,protocol:o,port:i,path:a,search:s,proxy:c,transport:l}}function _e(t,e){var r=t.protocol||"https:",n=t.port||("http:"===r?80:"https:"===r?443:void 0),o=t.hostname,i=t.path,a=t.timeout,s=t.transport;return t.search&&(i+=t.search),t.proxy&&(i=r+"//"+o+i,o=t.proxy.host||t.proxy.hostname,n=t.proxy.port,r=t.proxy.protocol||r),{timeout:a,protocol:r,hostname:o,path:i,port:n,method:e,transport:s}}function Oe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function xe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Oe(Object(r),!0).forEach(function(e){Ee(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Oe(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ee(t,e,r){return(e=Re(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function je(t){return je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},je(t)}function Ie(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,l=Object.create(u.prototype);return Te(l,"_invoke",function(r,n,o){var i,s,u,l=0,c=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,s=0,u=t,p.n=r,a}};function d(r,n){for(s=r,u=n,e=0;!f&&l&&!o&&e<c.length;e++){var o,i=c[e],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,c,h){if(l>1)throw TypeError("Generator is already running");for(f&&1===c&&d(c,h),s=c,u=h;(e=s<2?t:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(l=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,s=1,u=e}finally{l=1}}return{value:e,done:f}}}(r,o,i),!0),l}var a={};function s(){}function u(){}function l(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(Te(e={},n,function(){return this}),e),f=l.prototype=s.prototype=Object.create(c);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,Te(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,Te(f,"constructor",l),Te(l,"constructor",u),u.displayName="GeneratorFunction",Te(l,o,"GeneratorFunction"),Te(f),Te(f,o,"Generator"),Te(f,n,function(){return this}),Te(f,"toString",function(){return"[object Generator]"}),(Ie=function(){return{w:i,m:p}})()}function Te(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Te=function(t,e,r,n){function i(e,r){Te(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},Te(t,e,r,n)}function Pe(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function Ae(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Re(n.key),n)}}function Re(t){var e=function(t,e){if("object"!=je(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=je(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==je(e)?e:e+""}var Ce={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443},Le={hostname:"api.rollbar.com",path:"/api/1/session/",search:null,version:"1",protocol:"https:",port:443},qe=function(){return t=function t(e,r,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.transport=r,this.url=n,this.truncation=o,this.accessToken=e.accessToken,this.transportOptions=Ne(e,n),this.OTLPTransportOptions=De(e,n)},e=[{key:"_postPromise",value:function(t){var e=this,r=t.accessToken,n=t.options,o=t.payload,i=t.headers;return new Promise(function(t,a){e.transport.post({accessToken:r,options:n,payload:o,headers:i,callback:function(e,r){return e?a(e):t(r)}})})}},{key:"postItem",value:function(t,e){var r=this,n=_e(this.transportOptions,"POST"),o=ke(t);setTimeout(function(){r.transport.post({accessToken:r.accessToken,options:n,payload:o,callback:e})},0)}},{key:"postSpans",value:(n=Ie().m(function t(e){var r,n,o=arguments;return Ie().w(function(t){for(;;)if(0===t.n)return r=o.length>1&&void 0!==o[1]?o[1]:{},n=_e(this.OTLPTransportOptions,"POST"),t.a(2,this._postPromise({accessToken:this.accessToken,options:n,payload:e,headers:r}))},t,this)}),o=function(){var t=this,e=arguments;return new Promise(function(r,o){var i=n.apply(t,e);function a(t){Pe(i,r,o,a,s,"next",t)}function s(t){Pe(i,r,o,a,s,"throw",t)}a(void 0)})},function(t){return o.apply(this,arguments)})},{key:"buildJsonPayload",value:function(t,e){var r,n=ke(t);return(r=this.truncation?this.truncation.truncate(n):b(n)).error?(e&&e(r.error),null):r.value}},{key:"postJsonPayload",value:function(t,e){var r=_e(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,r,t,e)}},{key:"configure",value:function(t){var e=this.options;return this.options=R(e,t),this.transportOptions=Ne(this.options,this.url),this.OTLPTransportOptions=De(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this}}],e&&Ae(t.prototype,e),r&&Ae(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function Ne(t,e){return Se(t,Ce,e)}function De(t,e){var r;return Se(t=xe(xe({},t),{},{endpoint:null===(r=t.tracing)||void 0===r?void 0:r.endpoint}),Le,e)}var Me=qe,Ue="3.1.0",He="api.rollbar.com/api/1/item/",Fe="debug",Je="debug",Ve="error",Be=/(^|@)\S+:\d+/,We=/^\s*at .*(\S+:\d+|\(native\))/m,$e=/^(eval@)?(\[native code\])?$/;function Ge(t,e){if(void 0!==t.stacktrace||void 0!==t["opera#sourceloc"])return function(t,e){return!t.stacktrace||t.message.includes("\n")&&t.message.split("\n").length>t.stacktrace.split("\n").length?function(t,e){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),o=[],i=2,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push({file:s[2],line:+s[1],raw:n[i]})}return Xe(o,e)}(t):t.stack?function(t,e){var r=Xe(t.stack.split("\n").filter(function(t){return!!t.match(Be)&&!t.match(/^Error created at/)}),e);return r.map(function(t){var e,r=t.split("@"),n=ze(r.pop()),o=r.shift()||"",i=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return o.match(/\(([^)]*)\)/)&&(e=o.replace(/^[^(]+\(([^)]*)\)$/,"$1")),{function:i,args:void 0===e||"[arguments not available]"===e?void 0:e.split(","),file:n[0],line:n[1]?+n[1]:void 0,col:n[2]?+n[2]:void 0,raw:t}})}(t,e):function(t,e){for(var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),o=[],i=0,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push({function:s[3]||void 0,file:s[2],line:s[1]?+s[1]:void 0,raw:n[i]})}return Xe(o,e)}(t)}(t,e);if(t.stack&&t.stack.match(We))return function(t,e){return Ze(t.stack,e)}(t,e);if(t.stack)return function(t,e){return Qe(t.stack,e)}(t,e);if(null!=e&&e.allowEmpty)return[];throw new Error("Cannot parse given Error object")}function ze(t){if(!t.includes(":"))return[t,void 0,void 0];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return[e[1],e[2]||void 0,e[3]||void 0]}function Xe(t,e){return e&&null!=e.slice?Array.isArray(e.slice)?t.slice(e.slice[0],e.slice[1]):t.slice(0,e.slice):t}function Ze(t,e){return Xe(t.split("\n").filter(function(t){return!!t.match(We)}),e).map(function(t){t.includes("(eval ")&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),r=e.match(/ (\(.+\)$)/);e=r?e.replace(r[0],""):e;var n=ze(r?r[1]:e);return{function:r&&e||void 0,file:["eval","<anonymous>"].includes(n[0])?void 0:n[0],line:n[1]?+n[1]:void 0,col:n[2]?+n[2]:void 0,raw:t}})}function Qe(t,e){return Xe(t.split("\n").filter(function(t){return!t.match($e)}),e).map(function(t){if(t.includes(" > eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),t.includes("@")||t.includes(":")){var e=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,r=t.match(e),n=r&&r[1]?r[1]:void 0,o=ze(t.replace(e,""));return{function:n,file:o[0],line:o[1]?+o[1]:void 0,col:o[2]?+o[2]:void 0,raw:t}}return{function:t}})}function Ke(t){return t.map(function(t){return{functionName:t.function,args:t.args,fileName:t.file,lineNumber:t.line,columnNumber:t.col,source:t.raw}})}var Ye=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function tr(){return null}function er(t){var e={};return e._stackFrame=t,e.url=t.fileName,e.line=t.lineNumber,e.func=t.functionName,e.column=t.columnNumber,e.args=t.args,e.context=null,e}function rr(t,e){return{stack:function(){var r=[];e=e||0;try{r=function(t,e){return Ke(Ge(t,e))}(t)}catch(t){r=[]}for(var n=[],o=e;o<r.length;o++)n.push(new er(r[o]));return n}(),message:t.message,name:nr(t),rawStack:t.stack,rawException:t}}function nr(t){var e=t.name&&t.name.length&&t.name,r=t.constructor.name&&t.constructor.name.length&&t.constructor.name;return e&&r?"Error"===e?r:e:e||r}var or={guessFunctionName:function(){return"?"},guessErrorClass:function(t){if(!t||!t.match)return["Unknown error. There was no error message to display.",""];var e=t.match(Ye),r="(unknown)";return e&&(r=e[e.length-1],t=(t=t.replace((e[e.length-2]||"")+r+":","")).replace(/(^[\s]+|[\s]+$)/g,"")),[r,t]},gatherContext:tr,parse:function(t,e){var r=t;if(r.nested||r.cause){for(var n=[];r;)n.push(new rr(r,e)),r=r.nested||r.cause,e=0;return n[0].traceChain=n,n[0]}return new rr(r,e)},Stack:rr,Frame:er};function ir(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ar(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ar(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function ar(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function sr(t,e){var r=t.level,n=h[r]||0,o=e.reportLevel;return!(n<(h[o]||0))}function ur(t,e,r){if(!t)return!r;var n,o,i=t.frames;if(!i||0===i.length)return!r;for(var s=e.length,u=i.length,l=0;l<u;l++){if(!a(n=i[l].filename,"string"))return!r;for(var c=0;c<s;c++)if(o=e[c],new RegExp(o).test(n))return!0}return!1}function lr(t,e,r,n){var o,i,a=!1;"blocklist"===r&&(a=!0);try{if(o=a?e.hostBlockList:e.hostSafeList,i=I(t,"body.trace_chain")||[I(t,"body.trace")],!o||0===o.length)return!a;if(0===i.length||!i[0])return!a;for(var s=i.length,u=0;u<s;u++)if(ur(i[u],o,a))return!0}catch(t){a?e.hostBlockList=null:e.hostSafeList=null;var l=a?"hostBlockList":"hostSafeList";return n.error("Error while reading your configuration's "+l+" option. Removing custom "+l+".",t),!a}return!1}function cr(t){return function(e,r){var n,o,i,a,s,u;try{if(!(i=r.ignoredMessages)||0===i.length)return!0;if(u=function(t){var e=t.body,r=[];if(e.trace_chain){var n,o=ir(e.trace_chain);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.push(I(i,"exception.message"))}}catch(t){o.e(t)}finally{o.f()}}e.trace&&r.push(I(e,"trace.exception.message"));e.message&&r.push(I(e,"message.body"));return r}(e),0===u.length)return!0;for(a=i.length,n=0;n<a;n++)for(s=new RegExp(i[n],"gi"),o=0;o<u.length;o++)if(s.test(u[o]))return!1}catch(e){r.ignoredMessages=null,t.error("Error while reading your configuration's ignoredMessages option. Removing custom ignoredMessages.")}return!0}}function fr(t){return fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fr(t)}function pr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dr(n.key),n)}}function dr(t){var e=function(t,e){if("object"!=fr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=fr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==fr(e)?e:e+""}var hr=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.queue=e,this.options=r,this.transforms=[],this.diagnostic={}},e=[{key:"configure",value:function(t){var e;null===(e=this.queue)||void 0===e||e.configure(t);var r=this.options;return this.options=R(r,t),this}},{key:"addTransform",value:function(t){return u(t)&&this.transforms.push(t),this}},{key:"log",value:function(t,e){var r=this;if(e=u(e)?e:function(){},!this.options.enabled)return e(new Error("Rollbar is not enabled"),null);this.queue.addPendingItem(t);var n=t.err;this._applyTransforms(t,function(o,i){if(o)return r.queue.removePendingItem(t),e(o,null);r.queue.addItem(i,e,n,t)})}},{key:"_applyTransforms",value:function(t,e){var r=-1,n=this.transforms.length,o=this.transforms,i=this.options,a=function(t,s){t?e(t,null):++r!==n?o[r](s,i,a):e(null,s)};a(null,t)}}],e&&pr(t.prototype,e),r&&pr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function yr(t){return yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yr(t)}function vr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mr(n.key),n)}}function mr(t){var e=function(t,e){if("object"!=yr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=yr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==yr(e)?e:e+""}var br,gr,wr,kr=function(){function t(e,r,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.rateLimiter=e,this.api=r,this.logger=n,this.options=o,this.replay=i,this.predicates=[],this.pendingItems=[],this.pendingRequests=[],this.retryQueue=[],this.retryHandle=null,this.waitCallback=null,this.waitIntervalID=null}return e=t,r=[{key:"configure",value:function(t){var e;null===(e=this.api)||void 0===e||e.configure(t);var r=this.options;return this.options=R(r,t),this}},{key:"addPredicate",value:function(t){return u(t)&&this.predicates.push(t),this}},{key:"addPendingItem",value:function(t){this.pendingItems.push(t)}},{key:"removePendingItem",value:function(t){var e=this.pendingItems.indexOf(t);-1!==e&&this.pendingItems.splice(e,1)}},{key:"addItem",value:function(t,e,r,n){var o=this;e&&u(e)||(e=function(){});var i=t.data,a=this._applyPredicates(i);if(a.stop)return this.removePendingItem(n),void e(a.err);if(this._maybeLog(i,r),this.removePendingItem(n),this.options.transmit){this.replay&&i.body&&(t.replayId=this.replay.capture(null,i.uuid,{type:"occurrence",level:t.level}),t.replayId&&j(t.data,[{key:"replay_id",value:t.replayId}])),this.pendingRequests.push(i);try{this._makeApiRequest(i,function(r,n,a){o._dequeuePendingRequest(i),t.replayId&&o.replay.sendOrDiscardReplay(t.replayId,r,n,a),e(r,n)})}catch(r){var s;this._dequeuePendingRequest(i),t.replayId&&(null===(s=this.replay)||void 0===s||s.discard(t.replayId)),e(r)}}else e(new Error("Transmit disabled"))}},{key:"wait",value:function(t){var e=this;u(t)&&(this.waitCallback=t,this._maybeCallWait()||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitIntervalID=setInterval(function(){e._maybeCallWait()},500)))}},{key:"_applyPredicates",value:function(t){for(var e=null,r=0,n=this.predicates.length;r<n;r++)if(!(e=this.predicates[r](t,this.options))||void 0!==e.err)return{stop:!0,err:e.err};return{stop:!1,err:null}}},{key:"_makeApiRequest",value:function(t,e){var r=this,n=this.rateLimiter.shouldSend(t);n.shouldSend?this.api.postItem(t,function(n,o,i){n?r._maybeRetry(n,t,e):e(n,o,i)}):n.error?e(n.error):this.api.postItem(n.payload,e)}},{key:"_maybeRetry",value:function(e,r,n){var o=!1;if(this.options.retryInterval){for(var i=0,a=t.RETRIABLE_ERRORS.length;i<a;i++)if(e.code===t.RETRIABLE_ERRORS[i]){o=!0;break}o&&f(this.options.maxRetries)&&(r.retries=r.retries?r.retries+1:1,r.retries>this.options.maxRetries&&(o=!1))}o?this._retryApiRequest(r,n):n(e)}},{key:"_retryApiRequest",value:function(t,e){var r=this;this.retryQueue.push({item:t,callback:e}),this.retryHandle||(this.retryHandle=setInterval(function(){for(;r.retryQueue.length;){var t=r.retryQueue.shift();r._makeApiRequest(t.item,t.callback)}},this.options.retryInterval))}},{key:"_dequeuePendingRequest",value:function(t){var e=this.pendingRequests.indexOf(t);-1!==e&&(this.pendingRequests.splice(e,1),this._maybeCallWait())}},{key:"_maybeLog",value:function(t,e){if(this.logger&&this.options.verbose){var r=e||I(t,"body.trace.exception.message")||I(t,"body.trace_chain.0.exception.message");if(r)return void this.logger.error(r);(r=I(t,"body.message.body"))&&this.logger.log(r)}}},{key:"_maybeCallWait",value:function(){return!(!u(this.waitCallback)||0!==this.pendingItems.length||0!==this.pendingRequests.length||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitCallback(),0))}}],r&&vr(e.prototype,r),n&&vr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();br=kr,wr=["ECONNRESET","ENOTFOUND","ESOCKETTIMEDOUT","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH","EPIPE","EAI_AGAIN"],(gr=mr(gr="RETRIABLE_ERRORS"))in br?Object.defineProperty(br,gr,{value:wr,enumerable:!0,configurable:!0,writable:!0}):br[gr]=wr;var Sr=kr;function _r(t){return _r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(t)}function Or(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xr(n.key),n)}}function xr(t){var e=function(t,e){if("object"!=_r(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=_r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==_r(e)?e:e+""}var Er=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.startTime=Date.now(),this.counter=0,this.perMinCounter=0,this.platform=null,this.platformOptions={},this.configureGlobal(e)}return function(t,e,r){return e&&Or(t.prototype,e),r&&Or(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"configureGlobal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.startTime,n=e.maxItems,o=e.itemsPerMinute;void 0!==r&&(t.globalSettings.startTime=r),void 0!==n&&(t.globalSettings.maxItems=n),void 0!==o&&(t.globalSettings.itemsPerMinute=o)}},{key:"shouldSend",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=r-this.startTime;(n<0||n>=6e4)&&(this.startTime=r,this.perMinCounter=0);var o=t.globalSettings.maxItems,i=t.globalSettings.itemsPerMinute;if(jr(e,o,this.counter))return Ir(this.platform,this.platformOptions,"".concat(o," max items reached"),!1);if(jr(e,i,this.perMinCounter))return Ir(this.platform,this.platformOptions,"".concat(i," items per minute reached"),!1);this.counter+=1,this.perMinCounter+=1;var a=!jr(e,o,this.counter),s=a,u=a&&!jr(e,i,this.perMinCounter);return Ir(this.platform,this.platformOptions,null,u,o,i,s)}},{key:"setPlatformOptions",value:function(t,e){this.platform=t,this.platformOptions=e}}])}();function jr(t,e,r){return!t.ignoreRateLimit&&e>=1&&r>e}function Ir(t,e,r,n,o,i,a){var s=null,u=r?new Error(r):null;return u||n||(s=function(t,e,r,n,o){var i=e.environment||e.payload&&e.payload.environment,a=o?"item per minute limit reached, ignoring errors until timeout":"maxItems has been hit, ignoring errors until reset.",s={body:{message:{body:a,extra:{maxItems:r,itemsPerMinute:n}}},language:"javascript",environment:i,notifier:{version:e.notifier&&e.notifier.version||e.version}};"browser"===t?(s.platform="browser",s.framework="browser-js",s.notifier.name="rollbar-browser-js"):"server"===t?(s.framework=e.framework||"node-js",s.notifier.name=e.notifier.name):"react-native"===t&&(s.framework=e.framework||"react-native",s.notifier.name=e.notifier.name);return s}(t,e,o,i,a)),{error:u,shouldSend:n,payload:s}}!function(t,e,r){(e=xr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(Er,"globalSettings",{startTime:Date.now(),maxItems:void 0,itemsPerMinute:void 0});var Tr=Er;function Pr(t,e,r,n,o,i,a){this.options=R(t),this.logger=r,Pr.rateLimiter.configureGlobal(this.options),Pr.rateLimiter.setPlatformOptions(a,this.options),this.api=e,this.queue=new Sr(Pr.rateLimiter,e,r,this.options,i),this.tracing=o;var s=this.options.tracer||null;Rr(s)?(this.tracer=s,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier=new hr(this.queue,this.options),this.telemeter=n,Ar(t),this.lastError=null,this.lastErrorHash="none"}function Ar(t){t.stackTraceLimit&&(Error.stackTraceLimit=t.stackTraceLimit)}function Rr(t){if(!t)return!1;if(!t.scope||"function"!=typeof t.scope)return!1;var e=t.scope();return!(!e||!e.active||"function"!=typeof e.active)}Pr.rateLimiter=new Tr({maxItems:0,itemsPerMinute:60}),Pr.prototype.global=function(t){return Pr.rateLimiter.configureGlobal(t),this},Pr.prototype.configure=function(t,e){var r=this.options,n={};e&&(n={payload:e}),this.options=R(r,t,n);var o=this.options.tracer||null;return Rr(o)?(this.tracer=o,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),Ar(t),this.global(this.options),Rr(t.tracer)&&(this.tracer=t.tracer),this},Pr.prototype.log=function(t){var e=this._defaultLogLevel();return this._log(e,t)},Pr.prototype.debug=function(t){this._log("debug",t)},Pr.prototype.info=function(t){this._log("info",t)},Pr.prototype.warn=function(t){this._log("warning",t)},Pr.prototype.warning=function(t){this._log("warning",t)},Pr.prototype.error=function(t){this._log("error",t)},Pr.prototype.critical=function(t){this._log("critical",t)},Pr.prototype.wait=function(t){this.queue.wait(t)},Pr.prototype.captureEvent=function(t,e,r){return this.telemeter&&this.telemeter.captureEvent(t,e,r)},Pr.prototype.captureDomContentLoaded=function(t){return this.telemeter&&this.telemeter.captureDomContentLoaded(t)},Pr.prototype.captureLoad=function(t){return this.telemeter&&this.telemeter.captureLoad(t)},Pr.prototype.buildJsonPayload=function(t){return this.api.buildJsonPayload(t)},Pr.prototype.sendJsonPayload=function(t){this.api.postJsonPayload(t)},Pr.prototype._log=function(t,e){var r;if(e.callback&&(r=e.callback,delete e.callback),this.options.ignoreDuplicateErrors&&this._sameAsLastError(e)){if(r){var n=new Error("ignored identical item");n.item=e,r(n)}}else try{e.level=e.level||t,this._addItemAttributes(e),this._addTracingInfo(e);var o=this.telemeter;o&&(o._captureRollbarItem(e),e.telemetryEvents=o.copyEvents()||[]),this.notifier.log(e,r)}catch(t){r&&r(t),this.logger.error(t)}},Pr.prototype._addItemAttributes=function(t){var e,r,n=null===(e=this.tracing)||void 0===e?void 0:e.getSpan(),o=[{key:"session_id",value:function(t){var e=t.asyncLocalStorage;if(!e||"function"!=typeof e.getStore)return null;var r=e.getStore();return(null==r?void 0:r.sessionId)||null}(this)||(null===(r=this.tracing)||void 0===r?void 0:r.sessionId)},{key:"span_id",value:null==n?void 0:n.spanId},{key:"trace_id",value:null==n?void 0:n.traceId}];t._isUncaught&&o.push({key:"is_uncaught",value:"true"}),j(t.data,o),null==n||n.addEvent("rollbar.occurrence",[{key:"rollbar.occurrence.uuid",value:t.uuid}])},Pr.prototype._defaultLogLevel=function(){return this.options.logLevel||"debug"},Pr.prototype._sameAsLastError=function(t){if(!t._isUncaught)return!1;var e=function(t){var e=t.message||"",r=(t.err||{}).stack||String(t.err);return e+"::"+r}(t);return this.lastErrorHash===e||(this.lastError=t.err,this.lastErrorHash=e,!1)},Pr.prototype._addTracingInfo=function(t){if(this.tracer){var e=this.tracer.scope().active();if(function(t){if(!t||!t.context||"function"!=typeof t.context)return!1;var e=t.context();if(!e||!e.toSpanId||!e.toTraceId||"function"!=typeof e.toSpanId||"function"!=typeof e.toTraceId)return!1;return!0}(e)){e.setTag("rollbar.error_uuid",t.uuid),e.setTag("rollbar.has_error",!0),e.setTag("error",!0),e.setTag("rollbar.item_url","https://rollbar.com/item/uuid/?uuid=".concat(t.uuid)),e.setTag("rollbar.occurrence_url","https://rollbar.com/occurrence/uuid/?uuid=".concat(t.uuid));var r=e.context().toSpanId(),n=e.context().toTraceId();t.custom?(t.custom.opentracing_span_id=r,t.custom.opentracing_trace_id=n):t.custom={opentracing_span_id:r,opentracing_trace_id:n}}}};var Cr=Pr;function Lr(t,e,r){t._isUncaught&&(t.data._isUncaught=!0),t._originalArgs&&(t.data._originalArgs=t._originalArgs),r(null,t)}function qr(t,e,r){var n=e.payload||{};n.body&&delete n.body,t.data=R(t.data,n),r(null,t)}function Nr(t,e,r){t.telemetryEvents&&T(t,"data.body.telemetry",t.telemetryEvents),r(null,t)}function Dr(t,e,r){if(t.message){var n="data.body.trace_chain.0",o=I(t,n);if(o||(o=I(t,n="data.body.trace")),o){if(!o.exception||!o.exception.description)return T(t,n+".exception.description",t.message),void r(null,t);T(t,n+".extra",R(I(t,n+".extra")||{},{message:t.message}))}r(null,t)}else r(null,t)}function Mr(t){return function(e,r,n){var o,i=R(e),s=null;try{u(r.transform)&&(s=r.transform(i.data,e))}catch(o){return r.transform=null,t.error("Error while calling custom transform() function. Removing custom transform().",o),void n(null,e)}l(o=s)&&a(o.then,"function")?s.then(function(t){t&&(i.data=t),n(null,i)},function(t){n(t,e)}):n(null,i)}}function Ur(t,e,r){if(!e.sendConfig)return r(null,t);var n=I(t,"data.custom")||{};n._rollbarConfig=e,t.data.custom=n,r(null,t)}function Hr(t,e){u(t[e])&&(t[e]=t[e].toString())}function Fr(t,e,r){var n=e._configuredOptions;Hr(n,"transform"),Hr(n,"checkIgnore"),Hr(n,"onSendCallback"),delete n.accessToken,t.data.notifier.configured_options=n,r(null,t)}function Jr(t,e,r){var n=R(t.notifier.client.notifier.diagnostic,t.diagnostic);if(I(t,"err._isAnonymous")&&(n.is_anonymous=!0),t._isUncaught&&(n.is_uncaught=t._isUncaught),t.err)try{n.raw_error={message:t.err.message,name:t.err.name,constructor_name:t.err.constructor&&t.err.constructor.name,filename:t.err.fileName,line:t.err.lineNumber,column:t.err.columnNumber,stack:t.err.stack}}catch(t){n.raw_error={failed:String(t)}}t.data.notifier.diagnostic=R(t.data.notifier.diagnostic,n),r(null,t)}function Vr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Br=[].concat(function(t){return function(t){if(Array.isArray(t))return Vr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Vr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Vr(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(["pw","pass","passwd","password","secret","confirm_password","confirmPassword","password_confirmation","passwordConfirmation","access_token","accessToken","X-Rollbar-Access-Token","secret_key","secretKey","secretToken"]),["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"]),Wr={scrubFields:Br};function $r(t,e){return!I(e,"plugins.jquery.ignoreAjaxErrors")||!I(t,"body.message.extra.isAjax")}function Gr(t,e,r){if(t.err&&"DOMException"===or.Stack(t.err).name){var n=new Error;n.name=t.err.name,n.message=t.err.message,n.stack=t.err.stack,n.nested=t.err,t.err=n}r(null,t)}function zr(t,e,r){if(t.data=t.data||{},t.err)try{t.stackInfo=t.err._savedStackTrace||or.parse(t.err,t.skipFrames),e.addErrorContext&&function(t){var e=[],r=t.err;e.push(r);for(;r.nested||r.cause;)r=r.nested||r.cause,e.push(r);!function(t,e){var r=t.data.custom||{},o=!1;try{var i,a=n(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;c(s,"rollbarContext")&&(r=R(r,S(s.rollbarContext)),o=!0)}}catch(t){a.e(t)}finally{a.f()}o&&(t.data.custom=r)}catch(e){t.diagnostic.error_context="Failed: "+e.message}}(t,e)}(t)}catch(e){Ct.error("Error while parsing the error object.",e);try{t.message=t.err.message||t.err.description||t.message||String(t.err)}catch(e){t.message=String(t.err)||String(e)}delete t.err}r(null,t)}function Xr(t,e,r){t.message||t.stackInfo||t.custom||r(new Error("No message, stack info, or custom data"),null),r(null,t)}function Zr(t,e,r){var n=e.payload&&e.payload.environment||e.environment;t.data=R(t.data,{environment:n,level:t.level,endpoint:e.endpoint,platform:"browser",framework:"browser-js",language:"javascript",server:{},uuid:t.uuid,notifier:{name:"rollbar-browser-js",version:e.version},custom:t.custom}),r(null,t)}function Qr(t,e,r){t.stackInfo?t.stackInfo.traceChain?function(t,e,r){for(var n=t.stackInfo.traceChain,o=[],i=n.length,a=0;a<i;a++){var s=tn(t,n[a],e);o.push(s)}T(t,"data.body",{trace_chain:o}),r(null,t)}(t,e,r):function(t,e,r){var n=Yr(t);if(n){T(t,"data.body",{trace:tn(t,t.stackInfo,e)}),r(null,t)}else{var o=t.stackInfo,i=or.guessErrorClass(o.message),a=en(o,i[0],e),s=i[1];t.message=a+": "+s,Kr(t,e,r)}}(t,e,r):Kr(t,e,r)}function Kr(t,e,r){var n=t.message,o=t.custom;n||(n="Item sent with null or missing arguments.");var i={body:n};o&&(i.extra=R(o)),T(t,"data.body",{message:i}),r(null,t)}function Yr(t){var e=((arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||t.stackInfo).stack;return e&&0===e.length&&t._unhandledStackInfo&&t._unhandledStackInfo.stack&&(e=t._unhandledStackInfo.stack),e}function tn(t,e,r){var n=t&&t.data.description,o=t&&t.custom,i=Yr(t,e),a=or.guessErrorClass(e.message),s={exception:{class:en(e,a[0],r),message:a[1]}};if(n&&(s.exception.description=n),i){var u,l,c,f,p,d,h,v;for(0===i.length&&(s.exception.stack=e.rawStack,s.exception.raw=String(e.rawException)),s.frames=[],h=0;h<i.length;++h)l={filename:(u=i[h]).url?y(u.url):"(unknown)",lineno:u.line||null,method:u.func&&"?"!==u.func?u.func:"[anonymous]",colno:u.column},r.sendFrameUrl&&(l.url=u.url),l.method&&l.method.endsWith&&l.method.endsWith("_rollbar_wrapped")||(c=f=p=null,(d=u.context?u.context.length:0)&&(v=Math.floor(d/2),f=u.context.slice(0,v),c=u.context[v],p=u.context.slice(v)),c&&(l.code=c),(f||p)&&(l.context={},f&&f.length&&(l.context.pre=f),p&&p.length&&(l.context.post=p)),u.args&&(l.args=u.args),s.frames.push(l));s.frames.reverse(),o&&(s.extra=R(o))}return s}function en(t,e,r){return t.name?t.name:r.guessErrorClass?e:"(unknown)"}function rn(t){return rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rn(t)}function nn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function on(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=rn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==rn(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var an=function(t){var e,r,n=t.accessToken,o=t.url,i=t.method,a=t.payload,s=t.headers,u=t.callback,l=t.timeout;f(l)&&(e=new AbortController,r=setTimeout(function(){e.abort()},l)),s=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?nn(Object(r),!0).forEach(function(e){on(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nn(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({"Content-Type":"application/json","X-Rollbar-Access-Token":n,signal:e&&e.signal},s),fetch(o,{method:i,headers:s,body:a}).then(function(t){r&&clearTimeout(r);var e=t.headers,n=o.endsWith("/api/1/item/")?{"Rollbar-Replay-Enabled":e.get("Rollbar-Replay-Enabled"),"Rollbar-Replay-RateLimit-Remaining":e.get("Rollbar-Replay-RateLimit-Remaining"),"Rollbar-Replay-RateLimit-Reset":e.get("Rollbar-Replay-RateLimit-Reset")}:{},i=t.json();u(null,i,n)}).catch(function(t){Ct.error(t.message),u(t)})};function sn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return un(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?un(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function un(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ln(t,e){var r=new Error(t);return r.code=e||"ENOTFOUND",r}var cn=function(t){var e,r=t.accessToken,n=t.url,o=t.method,i=t.payload,s=t.headers,u=t.callback,l=t.requestFactory,c=t.timeout;if(!(e=l?l():function(){var t,e,r=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],n=r.length;for(e=0;e<n;e++)try{t=r[e]();break}catch(t){}return t}()))return u(new Error("No way to send a request"));try{try{var p=function(){try{if(p&&4===e.readyState){p=void 0;var t=g(e.responseText);if(function(t){return t&&t.status&&200===t.status}(e)){var r=n.endsWith("/api/1/item/")?{"Rollbar-Replay-Enabled":e.getResponseHeader("Rollbar-Replay-Enabled"),"Rollbar-Replay-RateLimit-Remaining":e.getResponseHeader("Rollbar-Replay-RateLimit-Remaining"),"Rollbar-Replay-RateLimit-Reset":e.getResponseHeader("Rollbar-Replay-RateLimit-Reset")}:{};return void u(t.error,t.value,r)}if(function(t){return t&&a(t.status,"number")&&t.status>=400&&t.status<600}(e)){if(403===e.status){var o=t.value&&t.value.message;Ct.error(o)}u(new Error(String(e.status)))}else{u(ln("XHR response had no status code (likely connection failure)"))}}}catch(t){var i;i=t&&t.stack?t:new Error(t),u(i)}};if(e.open(o,n,!0),e.setRequestHeader){e.setRequestHeader("Content-Type","application/json"),e.setRequestHeader("X-Rollbar-Access-Token",r);for(var d=0,h=Object.entries(null!=s?s:{});d<h.length;d++){var y=sn(h[d],2),v=y[0],m=y[1];e.setRequestHeader(v,m)}}f(c)&&(e.timeout=c),e.onreadystatechange=p,e.send(i)}catch(t){if("undefined"!=typeof XDomainRequest){if(!window||!window.location)return u(new Error("No window available during request, unknown environment"));"http:"===window.location.href.substring(0,5)&&"https"===n.substring(0,5)&&(n="http"+n.substring(5));var b=new XDomainRequest;b.onprogress=function(){},b.ontimeout=function(){u(ln("Request timed out","ETIMEDOUT"))},b.onerror=function(){u(new Error("Error during request"))},b.onload=function(){var t=g(b.responseText);u(t.error,t.value)},b.open(o,n,!0),b.send(i)}else u(new Error("Cannot find a method to transport a request"))}}catch(t){u(t)}};function fn(t){this.truncation=t}fn.prototype.get=function(t,e,r,n,o){n&&u(n)||(n=function(){}),function(t,e,r){(r=r||{}).access_token=t;var n,o=[];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&o.push([n,r[n]].join("="));var i="?"+o.sort().join("&");(e=e||{}).path=e.path||"";var a,s=e.path.indexOf("?"),u=e.path.indexOf("#");-1!==s&&(-1===u||u>s)?(a=e.path,e.path=a.substring(0,s)+i+"&"+a.substring(s+1)):-1!==u?(a=e.path,e.path=a.substring(0,u)+i+a.substring(u)):e.path=e.path+i}(t,e,r);var i=m(e);this._makeZoneRequest({accessToken:t,url:i,method:"GET",callback:n,requestFactory:o,timeout:e.timeout,transport:e.transport})},fn.prototype.post=function(t){var e,r=t.accessToken,n=t.options,o=t.payload,i=t.headers,a=t.callback,s=t.requestFactory;if(a&&u(a)||(a=function(){}),!o)return a(new Error("Cannot send empty request"));if((e=this.truncation&&o.body?this.truncation.truncate(o):b(o)).error)return a(e.error);var l=m(n);this._makeZoneRequest({accessToken:r,url:l,method:"POST",payload:e.value,headers:i,callback:a,requestFactory:s,timeout:n.timeout,transport:n.transport})},fn.prototype.postJsonPayload=function(t,e,r,n,o){n&&u(n)||(n=function(){});var i=m(e);this._makeZoneRequest({accessToken:t,url:i,method:"POST",payload:r,callback:n,requestFactory:o,timeout:e.timeout,transport:e.transport})},fn.prototype._makeZoneRequest=function(){var t=this,e="undefined"!=typeof window&&window||"undefined"!=typeof self&&self,r=e&&e.Zone&&e.Zone.root,n=Array.prototype.slice.call(arguments);r?r.run(function(){t._makeRequest.apply(void 0,n)}):this._makeRequest.apply(void 0,n)},fn.prototype._makeRequest=function(t){var e=t.payload,r=t.callback,n=t.transport;if("undefined"!=typeof RollbarProxy)return function(t,e){(new RollbarProxy).sendJsonPayload(t,function(t){},function(t){e(new Error(t))})}(e,r);"fetch"===n?an(t):cn(t)};var pn,dn=fn;function hn(t){var e,r,n={protocol:null,auth:null,host:null,path:null,hash:null,href:t,hostname:null,port:null,pathname:null,search:null,query:null};if(-1!==(e=t.indexOf("//"))?(n.protocol=t.substring(0,e),r=e+2):r=0,-1!==(e=t.indexOf("@",r))&&(n.auth=t.substring(r,e),r=e+1),-1===(e=t.indexOf("/",r))){if(-1===(e=t.indexOf("?",r)))return-1===(e=t.indexOf("#",r))?n.host=t.substring(r):(n.host=t.substring(r,e),n.hash=t.substring(e)),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),n;n.host=t.substring(r,e),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),r=e}else n.host=t.substring(r,e),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),r=e;if(-1===(e=t.indexOf("#",r))?n.path=t.substring(r):(n.path=t.substring(r,e),n.hash=t.substring(e)),n.path){var o=n.path.split("?");n.pathname=o[0],n.query=o[1],n.search=n.query?"?"+n.query:null}return n}function yn(t){return yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yn(t)}function vn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function mn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?vn(Object(r),!0).forEach(function(e){gn(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vn(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function bn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wn(n.key),n)}}function gn(t,e,r){return(e=wn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wn(t){var e=function(t,e){if("object"!=yn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=yn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==yn(e)?e:e+""}var kn=null,Sn=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ct.init({logLevel:e.logLevel||"error"}),this.options=A(On,e,null,Ct),this.options._configuredOptions=e,this.components=this.components||{};var o=this.components.telemeter,i=this.components.instrumenter;this.wrapGlobals=this.components.wrapGlobals,this.scrub=this.components.scrub;var a=this.components.truncation,s=this.components.tracing,l=this.components.replay,c=new dn(a),f=new Me(this.options,c,r,a);if(s&&(this.tracing=new s(_n(),f,this.options),this.tracing.initSession()),o&&(this.telemeter=new o(this.options,this.tracing)),l&&"undefined"!=typeof window){var p=this.options.replay;this.replay=new l({tracing:this.tracing,telemeter:this.telemeter,options:p}),p.enabled&&p.autoStart&&this.replay.recorder.start()}this.client=n||new Cr(this.options,f,Ct,this.telemeter,this.tracing,this.replay,"browser");var d=_n(),h="undefined"!=typeof document&&document;this.isChrome=d.chrome&&d.chrome.runtime,this.anonymousErrorsPending=0,function(t,e,r){t.addTransform(Gr).addTransform(zr).addTransform(Xr).addTransform(Zr).addTransform(function(t){return function(e,r,n){var o={};t&&t.location&&(o.url=t.location.href,o.query_string=t.location.search);var i="$remote_ip";r.captureIp?!0!==r.captureIp&&(i+="_anonymize"):i=null,i&&(o.user_ip=i),Object.keys(o).length>0&&T(e,"data.request",o),n(null,e)}}(r)).addTransform(function(t){return function(e,r,n){if(!t)return n(null,e);var o=t.navigator||{},i=t.screen||{};T(e,"data.client",{runtime_ms:e.timestamp-t._rollbarStartTime,timestamp:Math.round(e.timestamp/1e3),javascript:{browser:o.userAgent,language:o.language,cookie_enabled:o.cookieEnabled,screen:{width:i.width,height:i.height}}}),n(null,e)}}(r)).addTransform(function(t){return function(e,r,n){if(!t||!t.navigator)return n(null,e);for(var o,i=[],a=t.navigator.plugins||[],s=0,u=a.length;s<u;++s)o=a[s],i.push({name:o.name,description:o.description});T(e,"data.client.javascript.plugins",i),n(null,e)}}(r)).addTransform(Qr).addTransform(Dr).addTransform(Nr).addTransform(Ur).addTransform((n=e.scrub,function(t,e,r){if(n){var o=e.scrubFields||[],i=e.scrubPaths||[];t.data=n(t.data,o,i)}r(null,t)})).addTransform(qr).addTransform(Mr(Ct)).addTransform(Fr).addTransform(Jr).addTransform(Lr);var n}(this.client.notifier,this,d),function(t){t.addPredicate(sr).addPredicate($r).addPredicate(function(t){return function(e,r){var n=Boolean(e._isUncaught);delete e._isUncaught;var o=e._originalArgs;delete e._originalArgs;try{u(r.onSendCallback)&&r.onSendCallback(n,o,e)}catch(e){r.onSendCallback=null,t.error("Error while calling onSendCallback, removing",e)}try{if(u(r.checkIgnore)&&r.checkIgnore(n,o,e))return!1}catch(e){r.checkIgnore=null,t.error("Error while calling custom checkIgnore(), removing",e)}return!0}}(Ct)).addPredicate(function(t){return function(e,r){return!lr(e,r,"blocklist",t)}}(Ct)).addPredicate(function(t){return function(e,r){return lr(e,r,"safelist",t)}}(Ct)).addPredicate(cr(Ct))}(this.client.queue),this.setupUnhandledCapture(),i&&(this.instrumenter=new i(this.options,this.client.telemeter,this,d,h),this.instrumenter.instrument()),this.setSessionAttributesFromOptions(e),this.rollbar=this}return function(t,e,r){return e&&bn(t.prototype,e),r&&bn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"global",value:function(t){return this.client.global(t),this}},{key:"configure",value:function(t,e){var r,n,o;t.logLevel&&Ct.init({logLevel:t.logLevel}),this.setSessionAttributesFromOptions(t);var i=this.options,a={};return e&&(a={payload:e}),this.options=A(i,t,a,Ct),this.options._configuredOptions=A(i._configuredOptions,t,a),null===(r=this.tracing)||void 0===r||r.configure(this.options),null===(n=this.replay)||void 0===n||n.configure(this.options.replay),this.client.configure(this.options,e),null===(o=this.instrumenter)||void 0===o||o.configure(this.options),this.setupUnhandledCapture(),this}},{key:"lastError",value:function(){return this.client.lastError}},{key:"log",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.log(t),{uuid:e}}},{key:"debug",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.debug(t),{uuid:e}}},{key:"info",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.info(t),{uuid:e}}},{key:"warn",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warn(t),{uuid:e}}},{key:"warning",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warning(t),{uuid:e}}},{key:"error",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.error(t),{uuid:e}}},{key:"critical",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.critical(t),{uuid:e}}},{key:"buildJsonPayload",value:function(t){return this.client.buildJsonPayload(t)}},{key:"sendJsonPayload",value:function(t){return this.client.sendJsonPayload(t)}},{key:"triggerDirectReplay",value:function(t){return this.triggerReplay(mn({type:"direct"},t))}},{key:"triggerReplay",value:function(t){return this.replay?this.replay.triggerReplay(t):null}},{key:"setupUnhandledCapture",value:function(){var t=_n();this.unhandledExceptionsInitialized||(this.options.captureUncaught||this.options.handleUncaughtExceptions)&&(!function(t,e,r){if(t){var n;if("function"==typeof e._rollbarOldOnError)n=e._rollbarOldOnError;else if(t.onerror){for(n=t.onerror;n._rollbarOldOnError;)n=n._rollbarOldOnError;e._rollbarOldOnError=n}e.handleAnonymousErrors();var o=function(){var r=Array.prototype.slice.call(arguments,0);!function(t,e,r,n){t._rollbarWrappedError&&(n[4]||(n[4]=t._rollbarWrappedError),n[5]||(n[5]=t._rollbarWrappedError._rollbarContext),t._rollbarWrappedError=null);var o=e.handleUncaughtException.apply(e,n);r&&r.apply(t,n),"anonymous"===o&&(e.anonymousErrorsPending+=1)}(t,e,n,r)};r&&(o._rollbarOldOnError=n),t.onerror=o}}(t,this),this.wrapGlobals&&this.options.wrapGlobalEventHandlers&&this.wrapGlobals(t,this),this.unhandledExceptionsInitialized=!0),this.unhandledRejectionsInitialized||(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections)&&(!function(t,e,r){if(t){"function"==typeof t._rollbarURH&&t._rollbarURH.belongsToShim&&t.removeEventListener("unhandledrejection",t._rollbarURH);var n=function(t){var r,n,o;try{r=t.reason}catch(t){r=void 0}try{n=t.promise}catch(t){n="[unhandledrejection] error getting `promise` from event"}try{o=t.detail,!r&&o&&(r=o.reason,n=o.promise)}catch(t){}r||(r="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(r,n)};n.belongsToShim=r,t._rollbarURH=n,t.addEventListener("unhandledrejection",n)}}(t,this),this.unhandledRejectionsInitialized=!0)}},{key:"handleUncaughtException",value:function(t,e,r,n,o,i){if(this.options.captureUncaught||this.options.handleUncaughtExceptions){if(this.options.inspectAnonymousErrors&&this.isChrome&&null===o&&""===e)return"anonymous";var a,s=w(t,e,r,n,o,"onerror","uncaught exception",or);p(o)?(a=this._createItem([t,o,i]))._unhandledStackInfo=s:p(e)?(a=this._createItem([t,e,i]))._unhandledStackInfo=s:(a=this._createItem([t,i])).stackInfo=s,a.level=this.options.uncaughtErrorLevel,a._isUncaught=!0,this.client.log(a)}}},{key:"handleAnonymousErrors",value:function(){var t=this;if(this.options.inspectAnonymousErrors&&this.isChrome){try{Error.prepareStackTrace=function(e,r){if(t.options.inspectAnonymousErrors&&t.anonymousErrorsPending){if(t.anonymousErrorsPending-=1,!e)return;e._isAnonymous=!0,t.handleUncaughtException(e.message,null,null,null,e)}return e.stack}}catch(t){this.options.inspectAnonymousErrors=!1,this.error("anonymous error handler failed",t)}}}},{key:"handleUnhandledRejection",value:function(t,e){if(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections){var r="unhandled rejection was null or undefined!";if(t)if(t.message)r=t.message;else{var n=b(t);n.value&&(r=n.value)}var o,i=t&&t._rollbarContext||e&&e._rollbarContext;p(t)?o=this._createItem([r,t,i]):(o=this._createItem([r,t,i])).stackInfo=w(r,"",0,0,null,"unhandledrejection","",or),o.level=this.options.uncaughtErrorLevel,o._isUncaught=!0,o._originalArgs=o._originalArgs||[],o._originalArgs.push(e),this.client.log(o)}}},{key:"wrap",value:function(t,e,r){try{var n;if(n=u(e)?e:function(){return e||{}},!u(t))return t;if(t._isWrap)return t;if(!t._rollbar_wrapped)for(var o in t._rollbar_wrapped=function(){r&&u(r)&&r.apply(this,arguments);try{return t.apply(this,arguments)}catch(r){var e=r;throw e&&window._rollbarWrappedError!==e&&(a(e,"string")&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=t.toString(),window._rollbarWrappedError=e),e}},t._rollbar_wrapped._isWrap=!0,t)c(t,o)&&"_rollbar_wrapped"!==o&&(t._rollbar_wrapped[o]=t[o]);return t._rollbar_wrapped}catch(e){return t}}},{key:"captureEvent",value:function(){var t=function(t){for(var e,r,n,o,i=0,a=t.length;i<a;++i)switch(s(o=t[i])){case"string":!e&&E(O,o)?e=o:!n&&E(x,o)&&(n=o);break;case"object":r=o}return{type:e||"manual",metadata:r||{},level:n}}(arguments);return this.client.captureEvent(t.type,t.metadata,t.level)}},{key:"setSessionUser",value:function(t){var e;null!==(e=this.tracing)&&void 0!==e&&e.session&&this.tracing.session.setUser(t)}},{key:"setSessionAttributes",value:function(t){var e;null!==(e=this.tracing)&&void 0!==e&&e.session&&(t=mn({},t),this.tracing.session.setAttributes(t))}},{key:"setSessionAttributesFromOptions",value:function(t){var e,r,n,o,i,a=t.person||(null===(e=t.payload)||void 0===e?void 0:e.person);a&&this.setSessionUser(a);var s=(null===(r=t.client)||void 0===r||null===(r=r.javascript)||void 0===r?void 0:r.code_version)||t.codeVersion||t.code_version||(null===(n=t.payload)||void 0===n||null===(n=n.client)||void 0===n||null===(n=n.javascript)||void 0===n?void 0:n.code_version)||(null===(o=t.payload)||void 0===o?void 0:o.code_version)||(null===(i=t.payload)||void 0===i?void 0:i.codeVersion);this.setSessionAttributes({"rollbar.codeVersion":s,"rollbar.notifier.name":"rollbar-browser-js","rollbar.notifier.version":t.version})}},{key:"captureDomContentLoaded",value:function(t,e){return e||(e=new Date),this.client.captureDomContentLoaded(e)}},{key:"captureLoad",value:function(t,e){return e||(e=new Date),this.client.captureLoad(e)}},{key:"loadFull",value:function(){Ct.info("Unexpected Rollbar.loadFull() called on a Notifier instance. This can happen when Rollbar is loaded multiple times.")}},{key:"_createItem",value:function(t){return _(t,Ct,this)}}],[{key:"init",value:function(e,r){return kn?kn.global(e).configure(e):kn=new t(e,r)}},{key:"setComponents",value:function(e){t.prototype.components=e}},{key:"callInstance",value:function(t,e){if(kn)return kn[t].apply(kn,e);var r="Rollbar is not initialized";Ct.error(r);var n=function(t){for(var e=0,r=t.length;e<r;++e)if(u(t[e]))return t[e];return}(e);n&&n(new Error(r))}}])}();function _n(){return"undefined"!=typeof window&&window||"undefined"!=typeof self&&self}pn=Sn,gn(Sn,"global",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pn.callInstance("global",e)}),gn(Sn,"configure",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pn.callInstance("configure",e)}),gn(Sn,"lastError",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pn.callInstance("lastError",e)}),gn(Sn,"log",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pn.callInstance("log",e)}),gn(Sn,"debug",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pn.callInstance("debug",e)}),gn(Sn,"info",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pn.callInstance("info",e)}),gn(Sn,"warn",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pn.callInstance("warn",e)}),gn(Sn,"warning",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pn.callInstance("warning",e)}),gn(Sn,"error",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pn.callInstance("error",e)}),gn(Sn,"critical",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pn.callInstance("critical",e)}),gn(Sn,"buildJsonPayload",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pn.callInstance("buildJsonPayload",e)}),gn(Sn,"sendJsonPayload",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pn.callInstance("sendJsonPayload",e)}),gn(Sn,"wrap",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pn.callInstance("wrap",e)}),gn(Sn,"captureEvent",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pn.callInstance("captureEvent",e)});var On={environment:"unknown",version:Ue,scrubFields:Wr.scrubFields,logLevel:Fe,reportLevel:Je,uncaughtErrorLevel:Ve,endpoint:He,verbose:!1,enabled:!0,transmit:!0,sendConfig:!1,includeItemsInTelemetry:!0,captureIp:!0,inspectAnonymousErrors:!0,ignoreDuplicateErrors:!0,wrapGlobalEventHandlers:!1,replay:{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}},tracing:{enabled:!1,endpoint:"api.rollbar.com/api/1/session/"}},xn=Sn;function En(t){return"string"!=typeof t&&(t=String(t)),t.toLowerCase()}function jn(t){this.map={},t instanceof jn?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}jn.prototype.append=function(t,e){t=En(t),e=function(t){return"string"!=typeof t&&(t=String(t)),t}(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},jn.prototype.get=function(t){return t=En(t),this.has(t)?this.map[t]:null},jn.prototype.has=function(t){return c(this.map,En(t))},jn.prototype.forEach=function(t,e){for(var r in this.map)c(this.map,r)&&t.call(e,this.map[r],r,this)},jn.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),function(t){return{next:function(){var e=t.shift();return{done:void 0===e,value:e}}}}(t)};var In=function(t){return"undefined"==typeof Headers?new jn(t):new Headers(t)};var Tn=function(t,e,r,n,o){var i=t[e];t[e]=r(i),n&&n[o].push([t,e,i])};function Pn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return An(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?An(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function An(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Rn(t){return function(t){for(var e,r,n=[],o=0,i=t.length-1;i>=0;i--){if(e=Cn(t[i]),r=o+3*n.length+e.length,i<t.length-1&&r>=83){n.unshift("...");break}n.unshift(e),o+=e.length}return n.join(" > ")}(function(t){for(var e,r=[],n=0;t&&n<5&&(e=Ln(t))&&"html"!==e.tagName;n++)r.unshift(e),t=t.parentNode;return r}(t))}function Cn(t){if(!t||!t.tagName)return"";var e=[t.tagName];t.id&&e.push("#"+t.id),t.classes&&e.push("."+t.classes.join("."));var r,n=Pn(t.attributes);try{for(n.s();!(r=n.n()).done;){var o=r.value;e.push("["+o.key+'="'+o.value+'"]')}}catch(t){n.e(t)}finally{n.f()}return e.join("")}function Ln(t){if(!t||!t.tagName)return null;var e,r={};r.tagName=t.tagName.toLowerCase(),t.id&&(r.id=t.id),(e=t.className)&&"string"==typeof e&&(r.classes=e.split(/\s+/));r.attributes=[];for(var n=0,o=["type","name","title","alt"];n<o.length;n++){var i=o[n],a=t.getAttribute(i);a&&r.attributes.push({key:i,value:a})}return r}function qn(t){return qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qn(t)}function Nn(t){return function(t){if(Array.isArray(t))return Fn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Hn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Mn(n.key),n)}}function Mn(t){var e=function(t,e){if("object"!=qn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=qn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==qn(e)?e:e+""}function Un(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Hn(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Hn(t,e){if(t){if("string"==typeof t)return Fn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Fn(t,e):void 0}}function Fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Jn={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 Vn(t,e){for(var r;t[e].length;)(r=t[e].shift())[0][r[1]]=r[2]}function Bn(t){var e,r=[],n=Un(t);try{for(n.s();!(e=n.n()).done;){var o=e.value;r.push(new RegExp(o,"i"))}}catch(t){n.e(t)}finally{n.f()}return function(t){var e=function(t){if(!t||!t.attributes)return null;var e,r=Un(t.attributes);try{for(r.s();!(e=r.n()).done;){var n=e.value;if("name"===n.key)return n.value}}catch(t){r.e(t)}finally{r.f()}return null}(t);if(!e)return!1;for(var n=0,o=r;n<o.length;n++){if(o[n].test(e))return!0}return!1}}var Wn=function(){return function(t,e,r){return e&&Dn(t.prototype,e),r&&Dn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(e,r,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){(e=Mn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(this,"deinstrumentConnectivity",function(){this.removeListeners("connectivity")}),this.options=e;var s=e.autoInstrument;!1===e.enabled||!1===s?this.autoInstrument={}:(a(s,"object")||(s=Jn),this.autoInstrument=R(Jn,s)),this.configureScrubbing(),this.telemeter=r,this.rollbar=n,this.diagnostic=n.client.notifier.diagnostic,this._window=o||{},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},[{key:"configureScrubbing",value:function(){var t,e,r,n,o,i,a,s,u,l,c=this.options;this.scrubTelemetryInputs=Boolean(null!==(t=c.scrubTelemetryInputs)&&void 0!==t?t:null===(e=c.replay)||void 0===e?void 0:e.maskAllInputs),this.telemetryScrubber=c.telemetryScrubber,this.defaultValueScrubber=Bn(c.scrubFields),this.maskInputFn=null===(r=c.replay)||void 0===r?void 0:r.maskInputFn,this.maskInputOptions=(null===(n=c.replay)||void 0===n?void 0:n.maskInputOptions)||{},this.scrubClasses=[null===(o=c.replay)||void 0===o?void 0:o.blockClass,null===(i=c.replay)||void 0===i?void 0:i.ignoreClass,null===(a=c.replay)||void 0===a?void 0:a.maskTextClass].filter(Boolean),this.scrubSelectors=[null===(s=c.replay)||void 0===s?void 0:s.blockSelector,null===(u=c.replay)||void 0===u?void 0:u.ignoreSelector,null===(l=c.replay)||void 0===l?void 0:l.maskTextSelector].filter(Boolean)}},{key:"configure",value:function(t){this.options=R(this.options,t);var e=t.autoInstrument,r=R(this.autoInstrument);!1===t.enabled||!1===e?this.autoInstrument={}:(a(e,"object")||(e=Jn),this.autoInstrument=R(Jn,e)),this.configureScrubbing(),this.instrument(r)}},{key:"instrument",value:function(t){!this.autoInstrument.network||t&&t.network?!this.autoInstrument.network&&t&&t.network&&this.deinstrumentNetwork():this.instrumentNetwork(),!this.autoInstrument.log||t&&t.log?!this.autoInstrument.log&&t&&t.log&&this.deinstrumentConsole():this.instrumentConsole(),!this.autoInstrument.dom||t&&t.dom?!this.autoInstrument.dom&&t&&t.dom&&this.deinstrumentDom():this.instrumentDom(),!this.autoInstrument.navigation||t&&t.navigation?!this.autoInstrument.navigation&&t&&t.navigation&&this.deinstrumentNavigation():this.instrumentNavigation(),!this.autoInstrument.connectivity||t&&t.connectivity?!this.autoInstrument.connectivity&&t&&t.connectivity&&this.deinstrumentConnectivity():this.instrumentConnectivity(),!this.autoInstrument.contentSecurityPolicy||t&&t.contentSecurityPolicy?!this.autoInstrument.contentSecurityPolicy&&t&&t.contentSecurityPolicy&&this.deinstrumentContentSecurityPolicy():this.instrumentContentSecurityPolicy()}},{key:"deinstrumentNetwork",value:function(){Vn(this.replacements,"network")}},{key:"instrumentNetwork",value:function(){var t=this;function e(e,r){e in r&&u(r[e])&&Tn(r,e,function(e){return t.rollbar.wrap(e)})}if("XMLHttpRequest"in this._window){var r=this._window.XMLHttpRequest.prototype;Tn(r,"open",function(t){return function(e,r){var n=$n(r);return(a(r,"string")||n)&&(r=n?r.toString():r,this.__rollbar_xhr?(this.__rollbar_xhr.method=e,this.__rollbar_xhr.url=r,this.__rollbar_xhr.status_code=null,this.__rollbar_xhr.start_time_ms=P(),this.__rollbar_xhr.end_time_ms=null):this.__rollbar_xhr={method:e,url:r,status_code:null,start_time_ms:P(),end_time_ms:null}),t.apply(this,arguments)}},this.replacements,"network"),Tn(r,"setRequestHeader",function(e){return function(r,n){return this.__rollbar_xhr||(this.__rollbar_xhr={}),a(r,"string")&&a(n,"string")&&(t.autoInstrument.networkRequestHeaders&&(this.__rollbar_xhr.request_headers||(this.__rollbar_xhr.request_headers={}),this.__rollbar_xhr.request_headers[r]=n),"content-type"===r.toLowerCase()&&(this.__rollbar_xhr.request_content_type=n)),e.apply(this,arguments)}},this.replacements,"network"),Tn(r,"send",function(r){return function(n){var o,i,a=this,s=null===(o=t.rollbar)||void 0===o?void 0:o.tracing;if(C(t.options,s,null===(i=a.__rollbar_xhr)||void 0===i?void 0:i.url))try{a.setRequestHeader("baggage","rollbar.session.id=".concat(s.sessionId))}catch(t){}function l(){if(a.__rollbar_xhr&&(null===a.__rollbar_xhr.status_code&&(a.__rollbar_xhr.status_code=0,t.autoInstrument.networkRequestBody&&(a.__rollbar_xhr.request=n),a.__rollbar_event=t.captureNetwork(a.__rollbar_xhr,"xhr",void 0)),a.readyState<2&&(a.__rollbar_xhr.start_time_ms=P()),a.readyState>3)){var e=P();a.__rollbar_xhr.end_time_ms=e;var r=null;if(a.__rollbar_xhr.response_content_type=a.getResponseHeader("Content-Type"),t.autoInstrument.networkResponseHeaders){var o=t.autoInstrument.networkResponseHeaders;r={};try{var i;if(!0===o){var s=a.getAllResponseHeaders();if(s){var u,l,c,f=Un(s.trim().split(/[\r\n]+/));try{for(f.s();!(c=f.n()).done;){i=(u=c.value.split(": ")).shift(),l=u.join(": "),r[i]=l}}catch(t){f.e(t)}finally{f.f()}}}else{var p,d=Un(o);try{for(d.s();!(p=d.n()).done;){var h=p.value;r[h]=a.getResponseHeader(h)}}catch(t){d.e(t)}finally{d.f()}}}catch(t){}}var y=null;if(t.autoInstrument.networkResponseBody)try{y=a.responseText}catch(t){}var v=null;(y||r)&&(v={},y&&(t.isJsonContentType(a.__rollbar_xhr.response_content_type)?v.body=t.scrubJson(y):v.body=y),r&&(v.headers=r)),v&&(a.__rollbar_xhr.response=v);try{var m=a.status;m=1223===m?204:m,a.__rollbar_xhr.status_code=m,t.addOtelNetworkResponse(a.__rollbar_event,e,m),a.__rollbar_event.level=t.telemeter.levelFromStatus(m),t.errorOnHttpStatus(a.__rollbar_xhr)}catch(t){}}}return e("onload",a),e("onerror",a),e("onprogress",a),"onreadystatechange"in a&&u(a.onreadystatechange)?Tn(a,"onreadystatechange",function(e){return t.rollbar.wrap(e,void 0,l)}):a.onreadystatechange=l,a.__rollbar_xhr&&t.trackHttpErrors()&&(a.__rollbar_xhr.stack=(new Error).stack),r.apply(this,arguments)}},this.replacements,"network")}"fetch"in this._window&&Tn(this._window,"fetch",function(e){return function(r,n){var o,i,s=Array.prototype.slice.call(arguments),u=s[0],l="GET",c=$n(u);a(u,"string")||c?i=c?u.toString():u:u&&(i=u.url,u.method&&(l=u.method)),s[1]&&s[1].method&&(l=s[1].method);var f=null===(o=t.rollbar)||void 0===o?void 0:o.tracing;C(t.options,f,i)&&L(s,{baggage:"rollbar.session.id=".concat(f.sessionId)});var p={method:l,url:i,status_code:null,start_time_ms:P(),end_time_ms:null};if(s[1]&&s[1].headers){var d=In(s[1].headers);p.request_content_type=d.get("Content-Type"),t.autoInstrument.networkRequestHeaders&&(p.request_headers=t.fetchHeaders(d,t.autoInstrument.networkRequestHeaders))}t.autoInstrument.networkRequestBody&&(s[1]&&s[1].body?p.request=s[1].body:s[0]&&!a(s[0],"string")&&s[0].body&&(p.request=s[0].body));var h=t.captureNetwork(p,"fetch",void 0);return t.trackHttpErrors()&&(p.stack=(new Error).stack),e.apply(this,s).then(function(e){var r=P();p.end_time_ms=r,p.status_code=e.status,t.addOtelNetworkResponse(h,r,e.status),p.response_content_type=e.headers.get("Content-Type");var n=null;t.autoInstrument.networkResponseHeaders&&(n=t.fetchHeaders(e.headers,t.autoInstrument.networkResponseHeaders));var o=null;return t.autoInstrument.networkResponseBody&&"function"==typeof e.text&&(o=e.clone().text()),(n||o)&&(p.response={},o&&("function"==typeof o.then?o.then(function(e){e&&t.isJsonContentType(p.response_content_type)?p.response.body=t.scrubJson(e):p.response.body=e}):p.response.body=o),n&&(p.response.headers=n)),t.errorOnHttpStatus(p),e})}},this.replacements,"network")}},{key:"captureNetwork",value:function(t,e,r){return t.request&&this.isJsonContentType(t.request_content_type)&&(t.request=this.scrubJson(t.request)),this.telemeter.captureNetwork(t,e,r)}},{key:"isJsonContentType",value:function(t){return!!(t&&a(t,"string")&&t.toLowerCase().includes("json"))}},{key:"addOtelNetworkResponse",value:function(t,e,r){t.otelAttributes&&(t.otelAttributes["response.timeUnixNano"]=(1e6*e).toString(),t.otelAttributes.statusCode=r)}},{key:"scrubJson",value:function(t){return JSON.stringify(F(JSON.parse(t),this.options.scrubFields))}},{key:"fetchHeaders",value:function(t,e){var r={};try{if(!0===e){if("function"==typeof t.entries)for(var n=t.entries(),o=n.next();!o.done;)r[o.value[0]]=o.value[1],o=n.next()}else{var i,a=Un(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;r[s]=t.get(s)}}catch(t){a.e(t)}finally{a.f()}}}catch(t){}return r}},{key:"trackHttpErrors",value:function(){return this.autoInstrument.networkErrorOnHttp5xx||this.autoInstrument.networkErrorOnHttp4xx||this.autoInstrument.networkErrorOnHttp0}},{key:"errorOnHttpStatus",value:function(t){var e=t.status_code;if(e>=500&&this.autoInstrument.networkErrorOnHttp5xx||e>=400&&this.autoInstrument.networkErrorOnHttp4xx||0===e&&this.autoInstrument.networkErrorOnHttp0){var r=new Error("HTTP request failed with Status "+e);r.stack=t.stack,this.rollbar.error(r,{skipFrames:1})}}},{key:"deinstrumentConsole",value:function(){for(var t;this.replacements.log.length;)t=this.replacements.log.shift(),this._window.console[t[0]]=t[1]}},{key:"instrumentConsole",value:function(){var t;if(null!==(t=this._window)&&void 0!==t&&null!==(t=t.console)&&void 0!==t&&t.log){var e=this,r=this._window.console;try{for(var n=0,o=["debug","info","warn","error","log"];n<o.length;n++){i(o[n])}}catch(t){this.diagnostic.instrumentConsole={error:t.message}}}function i(t){var n=r[t],o=r,i="warn"===t?"warning":t;r[t]=function(){var t=Array.prototype.slice.call(arguments),r=function(t){var e,r,n,o=[];for(e=0,r=t.length;e<r;++e){switch(s(n=t[e])){case"object":(n=(n=b(n)).error||n.value).length>500&&(n=n.substr(0,497)+"...");break;case"null":n="null";break;case"undefined":n="undefined";break;case"symbol":n=n.toString()}o.push(n)}return o.join(" ")}(t);e.telemeter.captureLog(r,i,null,P()),n&&Function.prototype.apply.call(n,o,t)},e.replacements.log.push([t,n])}}},{key:"deinstrumentDom",value:function(){this.removeListeners("dom")}},{key:"instrumentDom",value:function(){var t=this;this.addListener("dom",this._window,["click","dblclick","contextmenu"],function(e){return t.handleEvent("click",e)}),this.addListener("dom",this._window,["dragstart","dragend","dragenter","dragleave","drop"],function(e){return t.handleEvent("dragdrop",e)}),this.addListener("dom",this._window,["blur","focus"],function(e){return t.handleEvent("focus",e)}),this.addListener("dom",this._window,["submit","invalid"],function(e){return t.handleEvent("form",e)}),this.addListener("dom",this._window,["input","change"],function(e){return t.handleEvent("input",e)}),this.addListener("dom",this._window,["resize"],function(e){return t.handleEvent("resize",e)}),this.addListener("dom",this._document,["DOMContentLoaded"],function(e){return t.handleEvent("contentLoaded",e)})}},{key:"handleEvent",value:function(t,e){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,e)}catch(r){Ct.log("".concat(t," handler error"),e,r,r.stack)}}},{key:"handleContentLoaded",value:function(t){this.rollbar.triggerReplay({type:"navigation",path:new URL(this._location.href).pathname})}},{key:"handleClick",value:function(t){var e,r=null===(e=t.target)||void 0===e?void 0:e.tagName.toLowerCase();["input","select","textarea"].includes(r)||this.telemeter.captureClick({type:t.type,isSynthetic:!t.isTrusted,element:Rn(t.target),timestamp:P()})}},{key:"handleFocus",value:function(t){var e,r=t.type,n=null!==(e=t.target)&&void 0!==e&&e.window?"window":Rn(t.target);this.telemeter.captureFocus({type:r,isSynthetic:!t.isTrusted,element:n,timestamp:P()})}},{key:"handleForm",value:function(t){}},{key:"handleResize",value:function(t){var e=window.screen.width/window.innerWidth;this.telemeter.captureResize({type:t.type,isSynthetic:!t.isTrusted,width:window.innerWidth,height:window.innerHeight,textZoomRatio:e,timestamp:P()})}},{key:"handleDrag",value:function(t){var e,r,n,o,i,a,s=t.type;if("drop"===s){e=[],r=[];var u,l=Un([].concat(Nn(t.dataTransfer.files),Nn(t.dataTransfer.items)));try{for(l.s();!(u=l.n()).done;){var c=u.value;c.kind&&c.type&&(e.push(c.kind),r.push(c.type))}}catch(t){l.e(t)}finally{l.f()}}["drop","dragstart"].includes(s)&&(n=null===(i=t.dataTransfer)||void 0===i?void 0:i.dropEffect,o=null===(a=t.dataTransfer)||void 0===a?void 0:a.effectAllowed);this.telemeter.captureDragDrop({type:s,isSynthetic:!t.isTrusted,element:Rn(t.target),dropEffect:n,effectAllowed:o,kinds:JSON.stringify(e),mediaTypes:JSON.stringify(r),timestamp:P()})}},{key:"scrubInputValue",value:function(t,e,r,n){var o="******";if("password"===n)return o;if(this.scrubTelemetryInputs)return o;var i=Ln(e);if(this.telemetryScrubber){if(this.telemetryScrubber(i))return o}else if(this.defaultValueScrubber(i))return o;return function(t,e,r){try{var n,o=Pn(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if("string"==typeof i){if(t.classList.contains(i))return!0}else{var a,s=Pn(t.classList);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(i.test(u))return!0}}catch(t){s.e(t)}finally{s.f()}}}}catch(t){o.e(t)}finally{o.f()}var l,c=Pn(r);try{for(c.s();!(l=c.n()).done;){var f=l.value;if(t.matches(f))return!0}}catch(t){c.e(t)}finally{c.f()}}catch(t){}return!1}(e,this.scrubClasses,this.scrubSelectors)?o:this.maskInputOptions[r.toLowerCase()]||this.maskInputOptions[n]?this.maskInputFn?this.maskInputFn(t,e):o:t}},{key:"handleInput",value:function(t){var e,r,n,o,i=t.type,a=null===(e=t.target)||void 0===e?void 0:e.tagName.toLowerCase(),s=null===(r=t.target)||void 0===r?void 0:r.value,u=(null===(n=t.target)||void 0===n||null===(n=n.attributes)||void 0===n||null===(n=n.type)||void 0===n?void 0:n.value)||(null===(o=t.target)||void 0===o?void 0:o.type);switch(void 0!==s&&(s=this.scrubInputValue(s,t.target,a,u)),i){case"input":if(["radio","checkbox"].includes(u))return;["select","textarea"].includes(a)&&(u=a);break;case"change":if(!["radio","checkbox"].includes(u))return;var l;if("checkbox"===u)s=null===(l=t.target)||void 0===l?void 0:l.checked}this.telemeter.captureInput({type:u,isSynthetic:!t.isTrusted,element:Rn(t.target),value:s,timestamp:P()})}},{key:"deinstrumentNavigation",value:function(){var t=this._window.chrome;!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState&&Vn(this.replacements,"navigation")}},{key:"instrumentNavigation",value:function(){var t=this._window.chrome;if(!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState){var e=this;Tn(this._window,"onpopstate",function(t){return function(){var r=e._location.href;e.handleUrlChange(e._lastHref,r),t&&t.apply(this,arguments)}},this.replacements,"navigation"),Tn(this._window.history,"pushState",function(t){return function(){var r=arguments.length>2?arguments[2]:void 0;return r&&e.handleUrlChange(e._lastHref,String(r)),t.apply(this,arguments)}},this.replacements,"navigation")}}},{key:"handleUrlChange",value:function(t,e){var r=hn(this._location.href),n=hn(e),o=hn(t);this._lastHref=e,r.protocol===n.protocol&&r.host===n.host&&(e=n.path+(n.hash||"")),r.protocol===o.protocol&&r.host===o.host&&(t=o.path+(o.hash||"")),this.telemeter.captureNavigation(t,e,null,P()),this.rollbar.triggerReplay({type:"navigation",path:e})}},{key:"instrumentConnectivity",value:function(){var t=this;this.addListener("connectivity",this._window,["online","offline"],function(e){return t.handleConnectivity(e)})}},{key:"handleConnectivity",value:function(t){var e=t.type;this.telemeter.captureConnectivityChange({type:e,isSynthetic:!t.isTrusted,timestamp:P()})}},{key:"handleCspEvent",value:function(t){var e="Security Policy Violation: blockedURI: "+t.blockedURI+", violatedDirective: "+t.violatedDirective+", effectiveDirective: "+t.effectiveDirective+", ";t.sourceFile&&(e+="location: "+t.sourceFile+", line: "+t.lineNumber+", col: "+t.columnNumber+", "),e+="originalPolicy: "+t.originalPolicy,this.telemeter.captureLog(e,"error",null,P()),this.handleCspError(e)}},{key:"handleCspError",value:function(t){this.autoInstrument.errorOnContentSecurityPolicy&&this.rollbar.error(t)}},{key:"deinstrumentContentSecurityPolicy",value:function(){this.removeListeners("contentsecuritypolicy")}},{key:"instrumentContentSecurityPolicy",value:function(){if("addEventListener"in this._document){var t=this.handleCspEvent.bind(this);this.addListener("contentsecuritypolicy",this._document,["securitypolicyviolation"],t)}}},{key:"addListener",value:function(t,e,r,n){var o=this;if(e.addEventListener){var i,a=Un(r);try{var s=function(){var r=i.value,a={capture:!0,passive:!0};e.addEventListener(r,n,a,!0),o.eventRemovers[t].push(function(){e.removeEventListener(r,n,a)})};for(a.s();!(i=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}}}},{key:"removeListeners",value:function(t){for(;this.eventRemovers[t].length;)this.eventRemovers[t].shift()()}}])}();function $n(t){return"undefined"!=typeof URL&&t instanceof URL}var Gn=Wn;function zn(t,e,r){if(c(e,"addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var o=function(e,r,o){n.call(this,e,t.wrap(r),o)};o._rollbarOldAdd=n,o.belongsToShim=r,e.addEventListener=o;for(var i=e.removeEventListener;i._rollbarOldRemove&&i.belongsToShim;)i=i._rollbarOldRemove;var a=function(t,e,r){i.call(this,t,e&&e._rollbar_wrapped||e,r)};a._rollbarOldRemove=i,a.belongsToShim=r,e.removeEventListener=a}}var Xn=function(t,e,r){if(t){var n,o,i="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(",");for(n=0;n<i.length;++n)t[o=i[n]]&&t[o].prototype&&zn(e,t[o].prototype,r)}};xn.setComponents({telemeter:Y,instrumenter:Gn,wrapGlobals:Xn,scrub:F,truncation:we,tracing:se});var Zn=xn,Qn="undefined"!=typeof window&&window._rollbarConfig,Kn=Qn&&Qn.globalAlias||"Rollbar",Yn="undefined"!=typeof window&&window[Kn]&&"function"==typeof window[Kn].shimId&&void 0!==window[Kn].shimId();if("undefined"==typeof window||window._rollbarStartTime||(window._rollbarStartTime=(new Date).getTime()),!Yn&&Qn){var to=new Zn(Qn);window[Kn]=to}else"undefined"!=typeof window?(window.rollbar=Zn,window._rollbarDidLoad=!0):"undefined"!=typeof self&&(self.rollbar=Zn,self._rollbarDidLoad=!0);var eo=Zn;return e=e.default}()});
3
3
  //# sourceMappingURL=rollbar.umd.min.js.map