mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
1 line
7.0 KiB
JSON
1 line
7.0 KiB
JSON
|
|
{"ast":null,"code":"import { supportsReportingObserver, getGlobalObject } from '@sentry/utils';\n\n/** Reporting API integration - https://w3c.github.io/reporting/ */\nclass ReportingObserver {\n /**\n * @inheritDoc\n */\n static __initStatic() {\n this.id = 'ReportingObserver';\n }\n\n /**\n * @inheritDoc\n */\n __init() {\n this.name = ReportingObserver.id;\n }\n\n /**\n * Returns current hub.\n */\n\n /**\n * @inheritDoc\n */\n constructor(_options = {\n types: ['crash', 'deprecation', 'intervention']\n }) {\n ;\n this._options = _options;\n ReportingObserver.prototype.__init.call(this);\n }\n\n /**\n * @inheritDoc\n */\n setupOnce(_, getCurrentHub) {\n if (!supportsReportingObserver()) {\n return;\n }\n this._getCurrentHub = getCurrentHub;\n var observer = new (getGlobalObject().ReportingObserver)(this.handler.bind(this), {\n buffered: true,\n types: this._options.types\n });\n observer.observe();\n }\n\n /**\n * @inheritDoc\n */\n handler(reports) {\n var hub = this._getCurrentHub && this._getCurrentHub();\n if (!hub || !hub.getIntegration(ReportingObserver)) {\n return;\n }\n for (var report of reports) {\n hub.withScope(scope => {\n scope.setExtra('url', report.url);\n var label = `ReportingObserver [${report.type}]`;\n let details = 'No details available';\n if (report.body) {\n // Object.keys doesn't work on ReportBody, as all properties are inheirted\n var plainBody = {};\n for (var prop in report.body) {\n plainBody[prop] = report.body[prop];\n }\n scope.setExtra('body', plainBody);\n if (report.type === 'crash') {\n var body = report.body;\n // A fancy way to create a message out of crashId OR reason OR both OR fallback\n details = [body.crashId || '', body.reason || ''].join(' ').trim() || details;\n } else {\n var body = report.body;\n details = body.message || details;\n }\n }\n hub.captureMessage(`${label}: ${details}`);\n });\n }\n }\n}\nReportingObserver.__initStatic();\nexport { ReportingObserver };","map":{"version":3,"names":["supportsReportingObserver","getGlobalObject","ReportingObserver","__initStatic","id","__init","name","constructor","_options","types","prototype","call","setupOnce","_","getCurrentHub","_getCurrentHub","observer","handler","bind","buffered","observe","reports","hub","getIntegration","report","withScope","scope","setExtra","url","label","type","details","body","plainBody","prop","crashId","reason","join","trim","message","captureMessage"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@sentry/integrations/esm/reportingobserver.js"],"sourcesContent":["import { supportsReportingObserver, getGlobalObject } from '@sentry/utils';\n\n/** Reporting API integration - https://w3c.github.io/reporting/ */\nclass ReportingObserver {\n /**\n * @inheritDoc\n */\n static __initStatic() {this.id = 'ReportingObserver';}\n\n /**\n * @inheritDoc\n */\n __init() {this.name = ReportingObserver.id;}\n\n /**\n * Returns current hub.\n */\n \n\n /**\n * @inheritDoc\n */\n constructor(\n _options\n\n = {\n types: ['crash', 'deprecation', 'intervention'],\n },\n ) {;this._options = _options;ReportingObserver.prototype.__init.call(this);}\n\n /**\n * @inheritDoc\n */\n setupOnce(_, getCurrentHub) {\n if (!supportsReportingObserver()) {\n return;\n }\n\n this._getCurrentHub = getCurrentHub;\n\n var observer = new (getGlobalObject().ReportingObserver)(this.handler.bind(this), {\n buffered: true,\n types: this._options.types,\n });\n\n observer.observe();\n }\n\n /**\n * @inheritDoc\n */\n handler(reports) {\n var hub = this._getCurrentHub && this._getCurrentHub();\n if (!hub || !hub.getIntegration(ReportingObserver)) {\n return;\n }\n for (var report of reports
|