Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
1 line
3.5 KiB
Plaintext
1 line
3.5 KiB
Plaintext
{"version":3,"file":"report-dialog.js","sources":["../../../../src/report-dialog.ts"],"sourcesContent":["import type { ReportDialogOptions } from '@sentry/core';\nimport { debug, getClient, getCurrentScope, getReportDialogEndpoint, lastEventId } from '@sentry/core';\nimport { DEBUG_BUILD } from './debug-build';\nimport { WINDOW } from './helpers';\n\n/**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the current scope.\n */\nexport function showReportDialog(options: ReportDialogOptions = {}): void {\n const optionalDocument = WINDOW.document as Document | undefined;\n const injectionPoint = optionalDocument?.head || optionalDocument?.body;\n\n // doesn't work without a document (React Native)\n if (!injectionPoint) {\n DEBUG_BUILD && debug.error('[showReportDialog] Global document not defined');\n return;\n }\n\n const scope = getCurrentScope();\n const client = getClient();\n const dsn = client?.getDsn();\n\n if (!dsn) {\n DEBUG_BUILD && debug.error('[showReportDialog] DSN not configured');\n return;\n }\n\n const mergedOptions = {\n ...options,\n user: {\n ...scope.getUser(),\n ...options.user,\n },\n eventId: options.eventId || lastEventId(),\n };\n\n const script = WINDOW.document.createElement('script');\n script.async = true;\n script.crossOrigin = 'anonymous';\n script.src = getReportDialogEndpoint(dsn, mergedOptions);\n\n const { onLoad, onClose } = mergedOptions;\n\n if (onLoad) {\n script.onload = onLoad;\n }\n\n if (onClose) {\n const reportDialogClosedMessageHandler = (event: MessageEvent): void => {\n if (event.data === '__sentry_reportdialog_closed__') {\n try {\n onClose();\n } finally {\n WINDOW.removeEventListener('message', reportDialogClosedMessageHandler);\n }\n }\n };\n WINDOW.addEventListener('message', reportDialogClosedMessageHandler);\n }\n\n injectionPoint.appendChild(script);\n}\n"],"names":["WINDOW","DEBUG_BUILD","debug","getCurrentScope","getClient","lastEventId","getReportDialogEndpoint"],"mappings":";;;;;;AAKA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,OAAO,GAAwB,EAAE,EAAQ;AAC1E,EAAE,MAAM,gBAAA,GAAmBA,cAAM,CAAC,QAAA;AAClC,EAAE,MAAM,iBAAiB,gBAAgB,EAAE,IAAA,IAAQ,gBAAgB,EAAE,IAAI;;AAEzE;AACA,EAAE,IAAI,CAAC,cAAc,EAAE;AACvB,IAAIC,0BAAeC,UAAK,CAAC,KAAK,CAAC,gDAAgD,CAAC;AAChF,IAAI;AACJ,EAAE;;AAEF,EAAE,MAAM,KAAA,GAAQC,oBAAe,EAAE;AACjC,EAAE,MAAM,MAAA,GAASC,cAAS,EAAE;AAC5B,EAAE,MAAM,GAAA,GAAM,MAAM,EAAE,MAAM,EAAE;;AAE9B,EAAE,IAAI,CAAC,GAAG,EAAE;AACZ,IAAIH,0BAAeC,UAAK,CAAC,KAAK,CAAC,uCAAuC,CAAC;AACvE,IAAI;AACJ,EAAE;;AAEF,EAAE,MAAM,gBAAgB;AACxB,IAAI,GAAG,OAAO;AACd,IAAI,IAAI,EAAE;AACV,MAAM,GAAG,KAAK,CAAC,OAAO,EAAE;AACxB,MAAM,GAAG,OAAO,CAAC,IAAI;AACrB,KAAK;AACL,IAAI,OAAO,EAAE,OAAO,CAAC,WAAWG,gBAAW,EAAE;AAC7C,GAAG;;AAEH,EAAE,MAAM,MAAA,GAASL,cAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC;AACxD,EAAE,MAAM,CAAC,KAAA,GAAQ,IAAI;AACrB,EAAE,MAAM,CAAC,WAAA,GAAc,WAAW;AAClC,EAAE,MAAM,CAAC,GAAA,GAAMM,4BAAuB,CAAC,GAAG,EAAE,aAAa,CAAC;;AAE1D,EAAE,MAAM,EA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