Files
doneit-web/.angular/cache/14.2.12/babel-webpack/e9c27696b818a059d9e2f4aee14f953a.json
T
Eudes Inácio 53b71ea16f its working
2023-06-30 09:54:21 +01:00

1 line
9.9 KiB
JSON

{"ast":null,"code":"import { getGlobalObject, isNativeFetch, logger, supportsFetch } from '@sentry/utils';\nvar global = getGlobalObject();\nlet cachedFetchImpl;\n\n/**\n * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.\n * Whenever someone wraps the Fetch API and returns the wrong promise chain,\n * this chain becomes orphaned and there is no possible way to capture it's rejections\n * other than allowing it bubble up to this very handler. eg.\n *\n * var f = window.fetch;\n * window.fetch = function () {\n * var p = f.apply(this, arguments);\n *\n * p.then(function() {\n * console.log('hi.');\n * });\n *\n * return p;\n * }\n *\n * `p.then(function () { ... })` is producing a completely separate promise chain,\n * however, what's returned is `p` - the result of original `fetch` call.\n *\n * This mean, that whenever we use the Fetch API to send our own requests, _and_\n * some ad-blocker blocks it, this orphaned chain will _always_ reject,\n * effectively causing another event to be captured.\n * This makes a whole process become an infinite loop, which we need to somehow\n * deal with, and break it in one way or another.\n *\n * To deal with this issue, we are making sure that we _always_ use the real\n * browser Fetch API, instead of relying on what `window.fetch` exposes.\n * The only downside to this would be missing our own requests as breadcrumbs,\n * but because we are already not doing this, it should be just fine.\n *\n * Possible failed fetch error messages per-browser:\n *\n * Chrome: Failed to fetch\n * Edge: Failed to Fetch\n * Firefox: NetworkError when attempting to fetch resource\n * Safari: resource blocked by content blocker\n */\nfunction getNativeFetchImplementation() {\n if (cachedFetchImpl) {\n return cachedFetchImpl;\n }\n\n // Fast path to avoid DOM I/O\n if (isNativeFetch(global.fetch)) {\n return cachedFetchImpl = global.fetch.bind(global);\n }\n var document = global.document;\n let fetchImpl = global.fetch;\n if (document && typeof document.createElement === 'function') {\n try {\n var sandbox = document.createElement('iframe');\n sandbox.hidden = true;\n document.head.appendChild(sandbox);\n var contentWindow = sandbox.contentWindow;\n if (contentWindow && contentWindow.fetch) {\n fetchImpl = contentWindow.fetch;\n }\n document.head.removeChild(sandbox);\n } catch (e) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);\n }\n }\n return cachedFetchImpl = fetchImpl.bind(global);\n}\n\n/**\n * Sends sdk client report using sendBeacon or fetch as a fallback if available\n *\n * @param url report endpoint\n * @param body report payload\n */\nfunction sendReport(url, body) {\n var isRealNavigator = Object.prototype.toString.call(global && global.navigator) === '[object Navigator]';\n var hasSendBeacon = isRealNavigator && typeof global.navigator.sendBeacon === 'function';\n if (hasSendBeacon) {\n // Prevent illegal invocations - https://xgwang.me/posts/you-may-not-know-beacon/#it-may-throw-error%2C-be-sure-to-catch\n var sendBeacon = global.navigator.sendBeacon.bind(global.navigator);\n sendBeacon(url, body);\n } else if (supportsFetch()) {\n var fetch = getNativeFetchImplementation();\n fetch(url, {\n body,\n method: 'POST',\n credentials: 'omit',\n keepalive: true\n }).then(null, error => {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(error);\n });\n }\n}\nexport { getNativeFetchImplementation, sendReport };","map":{"version":3,"names":["getGlobalObject","isNativeFetch","logger","supportsFetch","global","cachedFetchImpl","getNativeFetchImplementation","fetch","bind","document","fetchImpl","createElement","sandbox","hidden","head","appendChild","contentWindow","removeChild","e","__SENTRY_DEBUG__","warn","sendReport","url","body","isRealNavigator","Object","prototype","toString","call","navigator","hasSendBeacon","sendBeacon","method","credentials","keepalive","then","error"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@sentry/browser/esm/transports/utils.js"],"sourcesContent":["import { getGlobalObject, isNativeFetch, logger, supportsFetch } from '@sentry/utils';\n\nvar global = getGlobalObject();\nlet cachedFetchImpl;\n\n/**\n * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.\n * Whenever someone wraps the Fetch API and returns the wrong promise chain,\n * this chain becomes orphaned and there is no possible way to capture it's rejections\n * other than allowing it bubble up to this very handler. eg.\n *\n * var f = window.fetch;\n * window.fetch = function () {\n * var p = f.apply(this, arguments);\n *\n * p.then(function() {\n * console.log('hi.');\n * });\n *\n * return p;\n * }\n *\n * `p.then(function () { ... })` is producing a completely separate promise chain,\n * however, what's returned is `p` - the result of original `fetch` call.\n *\n * This mean, that whenever we use the Fetch API to send our own requests, _and_\n * some ad-blocker blocks it, this orphaned chain will _always_ reject,\n * effectively causing another event to be captured.\n * This makes a whole process become an infinite loop, which we need to somehow\n * deal with, and break it in one way or another.\n *\n * To deal with this issue, we are making sure that we _always_ use the real\n * browser Fetch API, instead of relying on what `window.fetch` exposes.\n * The only downside to this would be missing our own requests as breadcrumbs,\n * but because we are already not doing this, it should be just fine.\n *\n * Possible failed fetch error messages per-browser:\n *\n * Chrome: Failed to fetch\n * Edge: Failed to Fetch\n * Firefox: NetworkError when attempting to fetch resource\n * Safari: resource blocked by content blocker\n */\nfunction getNativeFetchImplementation() {\n if (cachedFetchImpl) {\n return cachedFetchImpl;\n }\n\n // Fast path to avoid DOM I/O\n if (isNativeFetch(global.fetch)) {\n return (cachedFetchImpl = global.fetch.bind(global));\n }\n\n var document = global.document;\n let fetchImpl = global.fetch;\n if (document && typeof document.createElement === 'function') {\n try {\n var sandbox = document.createElement('iframe');\n sandbox.hidden = true;\n document.head.appendChild(sandbox);\n var contentWindow = sandbox.contentWindow;\n if (contentWindow && contentWindow.fetch) {\n fetchImpl = contentWindow.fetch;\n }\n document.head.removeChild(sandbox);\n } catch (e) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);\n }\n }\n\n return (cachedFetchImpl = fetchImpl.bind(global));\n }\n\n/**\n * Sends sdk client report using sendBeacon or fetch as a fallback if available\n *\n * @param url report endpoint\n * @param body report payload\n */\nfunction sendReport(url, body) {\n var isRealNavigator = Object.prototype.toString.call(global && global.navigator) === '[object Navigator]';\n var hasSendBeacon = isRealNavigator && typeof global.navigator.sendBeacon === 'function';\n\n if (hasSendBeacon) {\n // Prevent illegal invocations - https://xgwang.me/posts/you-may-not-know-beacon/#it-may-throw-error%2C-be-sure-to-catch\n var sendBeacon = global.navigator.sendBeacon.bind(global.navigator);\n sendBeacon(url, body);\n } else if (supportsFetch()) {\n var fetch = getNativeFetchImplementation();\n fetch(url, {\n body,\n method: 'POST',\n credentials: 'omit',\n keepalive: true,\n }).then(null, error => {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(error);\n });\n }\n}\n\nexport { getNativeFetchImplementation, sendReport };\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,aAAa,EAAEC,MAAM,EAAEC,aAAa,QAAQ,eAAe;AAErF,IAAIC,MAAM,GAAGJ,eAAe,CAAC,CAAC;AAC9B,IAAIK,eAAe;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,4BAA4BA,CAAA,EAAG;EACtC,IAAID,eAAe,EAAE;IACnB,OAAOA,eAAe;EACxB;;EAEA;EACA,IAAIJ,aAAa,CAACG,MAAM,CAACG,KAAK,CAAC,EAAE;IAC/B,OAAQF,eAAe,GAAGD,MAAM,CAACG,KAAK,CAACC,IAAI,CAACJ,MAAM,CAAC;EACrD;EAEA,IAAIK,QAAQ,GAAGL,MAAM,CAACK,QAAQ;EAC9B,IAAIC,SAAS,GAAGN,MAAM,CAACG,KAAK;EAC1B,IAAIE,QAAQ,IAAI,OAAOA,QAAQ,CAACE,aAAa,KAAK,UAAU,EAAE;IAC9D,IAAI;MACF,IAAIC,OAAO,GAAGH,QAAQ,CAACE,aAAa,CAAC,QAAQ,CAAC;MAC9CC,OAA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