{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@sentry/utils/esm/misc.js","webpack:///./node_modules/@sentry/utils/esm/browser.js","webpack:///./node_modules/@sentry/tracing/esm/integrations/postgres.js","webpack:///./node_modules/@sentry/tracing/esm/integrations/mysql.js","webpack:///./node_modules/@sentry/tracing/esm/integrations/mongo.js","webpack:///./node_modules/@sentry/utils/esm/memo.js","webpack:///./node_modules/@sentry/core/esm/integrations/functiontostring.js","webpack:///./node_modules/@sentry/utils/esm/syncpromise.js","webpack:///./node_modules/@sentry/types/esm/session.js","webpack:///./node_modules/@sentry/hub/esm/scope.js","webpack:///./node_modules/@sentry/hub/esm/session.js","webpack:///./node_modules/@sentry/hub/esm/hub.js","webpack:///./node_modules/@sentry/core/esm/integrations/inboundfilters.js","webpack:///./node_modules/@sentry/utils/esm/supports.js","webpack:///./node_modules/@sentry/utils/esm/instrument.js","webpack:///./node_modules/@sentry/utils/esm/polyfill.js","webpack:///./node_modules/@sentry/utils/esm/error.js","webpack:///./node_modules/@sentry/utils/esm/dsn.js","webpack:///./node_modules/@sentry/core/esm/integration.js","webpack:///./node_modules/@sentry/core/esm/baseclient.js","webpack:///./node_modules/@sentry/types/esm/status.js","webpack:///./node_modules/@sentry/core/esm/transports/noop.js","webpack:///./node_modules/@sentry/types/esm/severity.js","webpack:///./node_modules/@sentry/core/esm/basebackend.js","webpack:///./node_modules/@sentry/browser/esm/tracekit.js","webpack:///./node_modules/@sentry/browser/esm/parsers.js","webpack:///./node_modules/@sentry/browser/esm/eventbuilder.js","webpack:///./node_modules/@sentry/core/esm/request.js","webpack:///./node_modules/@sentry/core/esm/api.js","webpack:///./node_modules/@sentry/utils/esm/promisebuffer.js","webpack:///./node_modules/@sentry/browser/esm/transports/base.js","webpack:///./node_modules/@sentry/browser/esm/transports/fetch.js","webpack:///./node_modules/@sentry/browser/esm/transports/xhr.js","webpack:///./node_modules/@sentry/browser/esm/backend.js","webpack:///./node_modules/@sentry/minimal/esm/index.js","webpack:///./node_modules/@sentry/browser/esm/helpers.js","webpack:///./node_modules/@sentry/types/esm/transaction.js","webpack:///./node_modules/@sentry/tracing/esm/spanstatus.js","webpack:///./node_modules/@sentry/browser/esm/integrations/breadcrumbs.js","webpack:///./node_modules/@sentry/browser/esm/client.js","webpack:///./node_modules/@sentry/browser/esm/integrations/trycatch.js","webpack:///./node_modules/@sentry/browser/esm/integrations/globalhandlers.js","webpack:///./node_modules/@sentry/browser/esm/integrations/linkederrors.js","webpack:///./node_modules/@sentry/browser/esm/integrations/useragent.js","webpack:///./node_modules/@sentry/browser/esm/sdk.js","webpack:///./node_modules/@sentry/tracing/esm/utils.js","webpack:///./node_modules/@sentry/tracing/esm/errors.js","webpack:///./node_modules/@sentry/tracing/esm/span.js","webpack:///./node_modules/@sentry/tracing/esm/transaction.js","webpack:///./node_modules/@sentry/tracing/esm/idletransaction.js","webpack:///./node_modules/@sentry/tracing/esm/hubextensions.js","webpack:///./node_modules/@sentry/tracing/esm/browser/backgroundtab.js","webpack:///./node_modules/@sentry/tracing/esm/browser/web-vitals/lib/bindReporter.js","webpack:///./node_modules/@sentry/tracing/esm/browser/web-vitals/lib/getFirstHidden.js","webpack:///./node_modules/@sentry/tracing/esm/browser/web-vitals/lib/whenInput.js","webpack:///./node_modules/@sentry/tracing/esm/browser/web-vitals/lib/initMetric.js","webpack:///./node_modules/@sentry/tracing/esm/browser/web-vitals/lib/generateUniqueID.js","webpack:///./node_modules/@sentry/tracing/esm/browser/web-vitals/lib/observe.js","webpack:///./node_modules/@sentry/tracing/esm/browser/web-vitals/lib/onHidden.js","webpack:///./node_modules/@sentry/tracing/esm/browser/web-vitals/getLCP.js","webpack:///./node_modules/@sentry/tracing/esm/browser/web-vitals/getTTFB.js","webpack:///./node_modules/@sentry/tracing/esm/browser/metrics.js","webpack:///./node_modules/@sentry/tracing/esm/browser/web-vitals/getCLS.js","webpack:///./node_modules/@sentry/tracing/esm/browser/web-vitals/getFID.js","webpack:///./node_modules/@sentry/tracing/esm/browser/request.js","webpack:///./node_modules/@sentry/tracing/esm/browser/router.js","webpack:///./node_modules/@sentry/tracing/esm/browser/browsertracing.js","webpack:///./node_modules/@sentry/tracing/esm/integrations/express.js","webpack:///./node_modules/@sentry/tracing/esm/index.js","webpack:///./node_modules/@sentry/core/esm/version.js","webpack:///./node_modules/@sentry/core/esm/sdk.js","webpack:///./app/javascript/packs/error_tracking.js","webpack:///./node_modules/@sentry/utils/esm/time.js","webpack:///./node_modules/@sentry/utils/esm/object.js","webpack:///(webpack)/buildin/harmony-module.js","webpack:///./node_modules/@sentry/utils/esm/node.js","webpack:///./node_modules/@sentry/utils/esm/logger.js","webpack:///./node_modules/@sentry/utils/esm/string.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/@sentry/utils/esm/stacktrace.js","webpack:///./node_modules/process/browser.js","webpack:///./node_modules/@sentry/utils/esm/is.js","webpack:///./node_modules/tslib/tslib.es6.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","fallbackGlobalObject","getGlobalObject","global","window","self","uuid4","crypto","msCrypto","getRandomValues","arr","Uint16Array","pad","num","v","toString","length","replace","Math","random","parseUrl","url","match","query","fragment","host","path","protocol","relative","getEventDescription","event","message","exception","values","type","event_id","consoleSandbox","callback","originalConsole","console","wrappedLevels","forEach","level","__sentry_original__","result","keys","addExceptionTypeValue","addExceptionMechanism","mechanism","_oO","getLocationHref","document","location","href","oO","parseRetryAfterHeader","now","header","headerDelay","parseInt","isNaN","headerDate","Date","parse","htmlTreeAsString","elem","currentElem","out","height","len","sepLength","nextStr","_htmlElementAsString","push","parentNode","reverse","join","el","className","classes","attr","tagName","toLowerCase","id","split","allowedAttrs","getAttribute","Postgres","this","setupOnce","_","getCurrentHub","client","Client","e","error","orig","config","_a","_b","span","getScope","getSpan","startChild","description","text","op","err","finish","then","res","Mysql","connection","options","sql","fields","OPERATIONS","OPERATION_SIGNATURES","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","dropIndex","find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexExists","insertMany","insertOne","mapReduce","rename","replaceOne","updateMany","updateOne","Mongo","_operations","Array","isArray","operations","_describeOperations","describeOperations","_useMongoose","useMongoose","collection","moduleName","Collection","_instrumentOperations","_this","operation","_patchOperation","getSpanContext","_getSpanContextFromOperationArguments","_c","_d","args","_i","arguments","lastArg","scope","parentSpan","span_1","maybePromise","apply","slice","data","collectionName","dbName","namespace","spanContext","signature","shouldDescribe","includes","map","reduce","JSON","stringify","Memo","_hasWeakSet","WeakSet","_inner","memoize","obj","has","add","unmemoize","splice","originalFunctionToString","States","FunctionToString","Function","context","SessionStatus","SyncPromise","executor","_state","PENDING","_handlers","_resolve","_setResult","RESOLVED","_reject","reason","REJECTED","state","is","_value","_executeHandlers","_attachHandler","handler","concat","cachedHandlers","done","onfulfilled","onrejected","resolve","reject","all","counter","resolvedCollection","item","index","TypeError","_onfulfilled","_onrejected","val","onfinally","isRejected","Scope","_notifyingListeners","_scopeListeners","_eventProcessors","_breadcrumbs","_user","_tags","_extra","_contexts","clone","newScope","_level","_span","_session","_transactionName","_fingerprint","addScopeListener","addEventProcessor","setUser","user","update","_notifyScopeListeners","getUser","setTags","tags","setTag","setExtras","extras","setExtra","extra","setFingerprint","fingerprint","setLevel","setTransactionName","setTransaction","setContext","setSpan","getTransaction","transaction","spanRecorder","spans","setSession","session","getSession","captureContext","updatedScope","contexts","clear","undefined","addBreadcrumb","breadcrumb","maxBreadcrumbs","mergedBreadcrumb","timestamp","clearBreadcrumbs","applyToEvent","hint","trace","getTraceContext","transactionName","_applyFingerprint","breadcrumbs","_notifyEventProcessors","getGlobalEventProcessors","processors","processor","_final","__SENTRY__","globalEventProcessors","addGlobalEventProcessor","Session","errors","sid","started","duration","status","Ok","init","ip_address","ipAddress","did","email","username","release","environment","userAgent","close","Exited","toJSON","toISOString","attrs","user_agent","Hub","_version","_stack","getStackTop","bindClient","isOlderThan","version","setupIntegrations","pushScope","getStack","getClient","popScope","pop","withScope","captureException","eventId","_lastEventId","finalHint","syntheticException","Error","originalException","_invokeClient","captureMessage","captureEvent","lastEventId","getOptions","beforeBreadcrumb","finalBreadcrumb","min","configureScope","run","oldHub","makeMain","getIntegration","integration","logger","warn","startSpan","_callExtensionMethod","startTransaction","customSamplingContext","traceHeaders","captureSession","endSession","_sendSessionUpdate","_e","startSession","currentSession","method","carrier","getMainCarrier","sentry","extensions","hub","registry","getHubFromCarrier","setHubOnCarrier","hasHubOnCarrier","activeDomain","domain","active","registryHubTopStack","_Oo","getHubFromActiveDomain","DEFAULT_IGNORE_ERRORS","InboundFilters","_options","clientOptions","_mergeOptions","_shouldDropEvent","_isSentryError","_isIgnoredError","_isDeniedUrl","_getEventFilterUrl","_isAllowedUrl","ignoreInternal","ignoreErrors","_getPossibleEventMessages","some","pattern","denyUrls","allowUrls","whitelistUrls","blacklistUrls","stacktrace","frames_1","frames","filename","frames_2","supportsFetch","Headers","Request","Response","isNativeFetch","func","test","supportsReferrerPolicy","referrerPolicy","lastHref","handlers","instrumented","instrument","originalConsoleLevel","triggerHandlers","instrumentConsole","triggerDOMHandler","globalDOMEventHandler","makeDOMEventHandler","addEventListener","target","proto","originalAddEventListener","listener","handlers_1","__sentry_instrumentation_handlers__","handlerForType","refCount","originalRemoveEventListener","handlers_2","instrumentDOM","requestKeys","requestValues","xhrproto","XMLHttpRequest","originalOpen","xhr","__sentry_xhr__","toUpperCase","__sentry_own_request__","onreadystatechangeHandler","readyState","status_code","requestPos","indexOf","args_1","body","endTimestamp","startTimestamp","onreadystatechange","original","readyStateArgs","originalSend","instrumentXHR","fetch","doc","createElement","sandbox","hidden","head","appendChild","contentWindow","removeChild","supportsNativeFetch","originalFetch","handlerData","fetchData","getFetchMethod","getFetchUrl","response","instrumentFetch","chrome","isChromePackagedApp","app","runtime","hasHistoryApi","history","pushState","replaceState","oldOnPopState","onpopstate","historyReplacementFunction","originalHistoryFunction","from","to","String","instrumentHistory","_oldOnErrorHandler","onerror","msg","line","column","_oldOnUnhandledRejectionHandler","onunhandledrejection","addInstrumentationHandler","e_1","next","e_1_1","fetchArgs","debounceTimerID","lastCapturedEvent","globalListener","isContentEditable","shouldSkipDOMEvent","previous","current","shouldShortcircuitPreviousDebounce","clearTimeout","setTimeout","setPrototypeOf","__proto__","prop","_super","SentryError","_newTarget","constructor","DSN_REGEX","Dsn","_fromString","_fromComponents","_validate","withPassword","pass","port","projectId","publicKey","str","exec","projectMatch","components","component","ERROR_MESSAGE","installedIntegrations","integrations","defaultIntegrations","userIntegrations","userIntegrationsNames_1","pickedIntegrationsNames_1","defaultIntegration","userIntegration","integrationsNames","getIntegrationsToSetup","log","setupIntegration","Status","BaseClient","backendClass","_integrations","_processing","_backend","dsn","_dsn","_process","_getBackend","eventFromException","_captureEvent","promisedEvent","eventFromMessage","_sendSession","getDsn","flush","timeout","_isClientProcessing","ready","getTransport","transportFlushed","enabled","_isEnabled","_updateSessionFromEvent","crashed","errored","exceptions","exceptions_1","exceptions_1_1","handled","headers","request","Crashed","Number","sendSession","ticked","interval","setInterval","clearInterval","_prepareEvent","normalizeDepth","prepared","_applyClientOptions","_applyIntegrationsMetadata","finalScope","evt","_normalizeEvent","depth","normalized","b","dist","maxValueLength","sdkInfo","sdk","integrationsArray","_sendEvent","sendEvent","_processEvent","finalEvent","beforeSend","sampleRate","isTransaction","__sentry__","beforeSendResult","processedEvent","promise","fromHttpCode","code","Success","RateLimit","Invalid","Failed","Unknown","Severity","NoopTransport","Skipped","BaseBackend","_transport","_setupTransport","_exception","_hint","_message","fromString","Debug","Info","Warning","Fatal","Critical","Log","gecko","winjs","geckoEval","chromeEval","reactMinifiedRegexp","computeStackTrace","ex","stack","popSize","framesToPop","parts","opera10Regex","opera11Regex","lines","element","extractMessage","computeStackTraceFromStacktraceProp","popFrames","submatch","isNative","substr","columnNumber","computeStackTraceFromStackProp","failed","exceptionFromStacktrace","prepareFramesForEvent","eventFromStacktrace","localStack","firstFrameFunction","lastFrameFunction","frame","colno","in_app","lineno","eventFromUnknownInput","domException","name_1","eventFromString","rejection","__serialized__","eventFromPlainObject","synthetic","input","attachStacktrace","getSdkMetadataForEnvelopeHeader","api","metadata","enhanceEventWithSdkInfo","packages","sessionToSentryRequest","sent_at","getEnvelopeEndpointWithUrlEncodedAuth","eventToSentryRequest","eventType","useEnvelope","debug_meta","transactionSampling","samplingMethod","rate","req","getStoreEndpointWithUrlEncodedAuth","envelope","sample_rates","API","_dsnObject","getBaseApiEndpoint","getStoreEndpoint","_getIngestEndpoint","_encodedAuth","_getEnvelopeEndpoint","getStoreEndpointPath","getRequestHeaders","clientName","clientVersion","getReportDialogEndpoint","dialogOptions","endpoint","encodedOptions","encodeURIComponent","auth","sentry_key","sentry_version","PromiseBuffer","_limit","_buffer","isReady","task","remove","drain","capturedSetTimeout","BaseTransport","_rateLimits","_api","_metadata","_handleResponse","requestType","_handleRateLimit","_disabledUntil","category","_isRateLimited","e_2","rlHeader","raHeader","trim","parameters","delay","_f","e_2_1","FetchTransport","_sendRequest","sentryRequest","originalPayload","Promise","fetchParameters","assign","XHRTransport","getResponseHeader","open","setRequestHeader","send","BrowserBackend","transportOptions","transport","callOnHub","ignoreOnError","shouldIgnoreOnError","ignoreNextOnError","wrap","fn","before","__sentry_wrapped__","sentryWrapped","wrappedArguments","arg","handleEvent","defineProperties","getOwnPropertyDescriptor","configurable","injectReportDialog","script","async","src","onLoad","onload","TransactionSamplingMethod","SpanStatus","Breadcrumbs","dom","addSentryBreadcrumb","_consoleBreadcrumb","_domBreadcrumb","_xhrBreadcrumb","_fetchBreadcrumb","_historyBreadcrumb","parsedLoc","parsedFrom","parsedTo","BrowserClient","showReportDialog","platform","DEFAULT_EVENT_TARGET","TryCatch","eventTarget","requestAnimationFrame","_wrapTimeFunction","_wrapRAF","_wrapXHR","_wrapEventTarget","originalCallback","eventName","wrappedEventHandler","originalEventHandler","xmlHttpRequestProps","wrapOptions","GlobalHandlers","_onErrorHandlerInstalled","_onUnhandledRejectionHandlerInstalled","stackTraceLimit","_installGlobalOnErrorHandler","_installGlobalOnUnhandledRejectionHandler","currentHub","hasIntegration","isFailedOwnDelivery","_eventFromIncompleteOnError","_enhanceEventWithInitialFrame","detail","_eventFromRejectionWithPrimitive","groups","LinkedErrors","_key","limit","_handler","linkedErrors","_walkErrorTree","UserAgent","navigator","referrer","Referer","httpStatus","Unauthenticated","PermissionDenied","NotFound","AlreadyExists","FailedPrecondition","ResourceExhausted","InvalidArgument","Unimplemented","Unavailable","DeadlineExceeded","InternalError","UnknownError","TRACEPARENT_REGEXP","RegExp","hasTracingEnabled","getActiveTransaction","msToSec","time","errorCallback","activeTransaction","setStatus","SpanRecorder","maxlen","_maxlen","Transaction","transactionContext","_measurements","_hub","_trimEnd","trimEnd","setName","initSpanRecorder","setMeasurements","measurements","setMetadata","newMetadata","sampled","finishedSpans","filter","prev","start_timestamp","toContext","updateWithContext","Span","traceId","spanId","substring","parentSpanId","child","childSpan","setData","setHttpStatus","spanStatus","isSuccess","toTraceparent","sampledString","parent_span_id","span_id","trace_id","IdleTransactionSpanRecorder","_pushActivity","_popActivity","transactionSpanId","IdleTransaction","_idleHub","_idleTimeout","_onScope","activities","_heartbeatTimer","_heartbeatCounter","_finished","_beforeFinishCallbacks","clearActiveTransaction","_initTimeout","Cancelled","keepSpan","registerBeforeFinishCallback","_pingHeartbeat","end_1","_beat","heartbeatString","_prevHeartbeatString","_typeof","iterator","sample","samplingContext","Explicit","tracesSampler","Sampler","parentSampled","Inheritance","tracesSampleRate","Rate","isValidSampleRate","_startTransaction","_experiments","maxSpans","firstHiddenTime","inputPromise","bindReporter","metric","po","observeAllUpdates","prevValue","isFinal","disconnect","visibilityState","delta","entries","floor","observe","PerformanceObserver","supportedEntryTypes","getEntries","buffered","isUnloading","listenersAdded","onPageHide","persisted","onHidden","cb","once","timeStamp","capture","Infinity","onReport","reportAllChanges","report","firstHidden","entryHandler","entry","startTime","onFinal","takeRecords","passive","navigationEntry","performance","getEntriesByType","timing","entryType","max","navigationStart","getNavigationEntryFromPerformanceTiming","responseStart","MetricsInstrumentation","_performanceCursor","mark","_trackCLS","_trackLCP","_trackFID","_trackTTFB","addPerformanceEntries","entryScriptSrc","entryScriptStartTimestamp","tracingInitMarkStartTime","timeOrigin","scripts","dataset","addPerformanceNavigationTiming","_startChild","requestStart","responseEnd","addRequest","addNavigationSpans","measureStartTimestamp","measureEndTimestamp","addMeasureSpans","shouldRecord","resourceName","origin","initiatorType","transferSize","encodedBodySize","decodedBodySize","addResourceSpans","_trackNavigator","timeOrigin_1","oldValue","measurementTimestamp","normalizedValue","abs","hadRecentInput","effectiveType","isMeasurementValue","rtt","downlink","deviceMemory","hardwareConcurrency","processingStart","perfMetrics","onFirstInputDelay","cancelable","requestTime","eventEnd","end","start","ctx","isFinite","defaultRequestInstrumentationOptions","traceFetch","traceXHR","tracingOrigins","registerRequestInstrumentation","shouldCreateSpanForRequest","urlMap","defaultShouldCreateSpan","origins","shouldCreateSpan","currentClientOptions","__span","append","fetchCallback","__sentry_xhr_span_id__","xhrCallback","DEFAULT_BROWSER_TRACING_OPTIONS","idleTimeout","markBackgroundTransactions","maxTransactionDuration","routingInstrumentation","startTransactionOnPageLoad","startTransactionOnLocationChange","startingUrl","pathname","BrowserTracing","_metrics","_emitOptionsWarning","_getCurrentHub","_createRouteTransaction","beforeNavigate","parentContextFromHeader","metaName","querySelector","traceparent","matches","extractTraceparentData","getHeaderContext","expandedContext","modifiedContext","finalContext","idleTransaction","onScope","startIdleTransaction","maxDuration","diff","adjustTransactionDuration","secToMs","Express","_router","router","_methods","methods","wrapMiddlewareArgs","patchMiddleware","instrumentMiddlewares","arity","__sentry_transaction","a","Integrations","window_1","SENTRY_RELEASE","autoSessionTracking","clientClass","debug","enable","initAndBind","startSessionTracking","Sentry","dateTimestampSource","nowSeconds","platformPerformance","getNodePerformance","getBrowserPerformance","timestampSource","dateTimestampInSeconds","timestampWithMs","browserPerformanceTimeOrigin","fill","source","replacementFactory","wrapped","urlEncode","getWalkSource","event_1","currentTarget","CustomEvent","jsonSize","encodeURI","utf8Length","normalizeToSize","maxSize","serialized","normalize","normalizeValue","_events","walk","memo","serializeValue","acc","innerKey","extractExceptionKeysForMessage","maxLength","sort","includedKeys","dropUndefinedKeys","rv","originalModule","webpackPolyfill","children","isNodeEnv","process","dynamicRequire","mod","require","PREFIX","Logger","_enabled","disable","truncate","snipLine","newLine","ll","safeJoin","delimiter","output","isMatchingPattern","g","getFunctionName","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","marker","runClearTimeout","Item","array","noop","nextTick","title","browser","env","argv","versions","on","addListener","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","isError","wat","isInstanceOf","isErrorEvent","isDOMError","isDOMException","isString","isPrimitive","isPlainObject","isEvent","Event","isElement","Element","isRegExp","isThenable","Boolean","isSyntheticEvent","base","_extendStatics","__extends","__","_assign","__rest","getOwnPropertySymbols","propertyIsEnumerable","__values","__read","ar","__spread"],"mappings":";aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC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B,OAAQ/C,IAClI6H,EAAE2W,QAAQ1c,EAAE9B,IAAM,GAAKU,OAAOkB,UAAUqtC,qBAAqB9uC,KAAK4B,EAAGD,EAAE9B,MAAKkB,EAAEY,EAAE9B,IAAM+B,EAAED,EAAE9B,KAEhG,OAAOkB,EAyKF,SAASguC,EAASzuC,GACvB,IAAIsB,EAAsB,oBAAXhB,QAAyBA,OAAOi7B,SAC3C57B,EAAI2B,GAAKtB,EAAEsB,GACX/B,EAAI,EACR,GAAII,EAAG,OAAOA,EAAED,KAAKM,GACrB,GAAIA,GAAyB,kBAAbA,EAAEsC,OAAqB,MAAO,CAC5C6e,KAAM,WAEJ,OADInhB,GAAKT,GAAKS,EAAEsC,SAAQtC,OAAI,GACrB,CACLQ,MAAOR,GAAKA,EAAET,KACduP,MAAO9O,KAIb,MAAM,IAAIwP,UAAUlO,EAAI,0BAA4B,mCAE/C,SAASotC,EAAO1uC,EAAGgB,GACxB,IAAIrB,EAAsB,oBAAXW,QAAyBN,EAAEM,OAAOi7B,UACjD,IAAK57B,EAAG,OAAOK,EACf,IACIK,EAEA+G,EAHA7H,EAAII,EAAED,KAAKM,GAEX2uC,EAAK,GAGT,IACE,WAAc,IAAN3tC,GAAgBA,KAAM,MAAQX,EAAId,EAAE4hB,QAAQrS,MAClD6/B,EAAG5oC,KAAK1F,EAAEG,OAEZ,MAAO6G,GACPD,EAAI,CACFC,MAAOA,GAET,QACA,IACMhH,IAAMA,EAAEyO,OAASnP,EAAIJ,EAAU,SAAII,EAAED,KAAKH,GAC9C,QACA,GAAI6H,EAAG,MAAMA,EAAEC,OAInB,OAAOsnC,EAEF,SAASC,IACd,IAAK,IAAID,EAAK,GAAIpvC,EAAI,EAAGA,EAAIgM,UAAUjJ,OAAQ/C,IAC7CovC,EAAKA,EAAG//B,OAAO8/B,EAAOnjC,UAAUhM,KAGlC,OAAOovC","file":"js/error_tracking-750b31a70ac900bdc23f.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1285);\n","import { isNodeEnv } from './node';\nimport { snipLine } from './string';\nvar fallbackGlobalObject = {};\n/**\n * Safely get global scope object\n *\n * @returns Global scope object\n */\n\nexport function getGlobalObject() {\n return isNodeEnv() ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : fallbackGlobalObject;\n}\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\n\nexport function uuid4() {\n var global = getGlobalObject();\n var crypto = global.crypto || global.msCrypto;\n\n if (!(crypto === void 0) && crypto.getRandomValues) {\n // Use window.crypto API if available\n var arr = new Uint16Array(8);\n crypto.getRandomValues(arr); // set 4 in byte 7\n // eslint-disable-next-line no-bitwise\n\n arr[3] = arr[3] & 0xfff | 0x4000; // set 2 most significant bits of byte 9 to '10'\n // eslint-disable-next-line no-bitwise\n\n arr[4] = arr[4] & 0x3fff | 0x8000;\n\n var pad = function pad(num) {\n var v = num.toString(16);\n\n while (v.length < 4) {\n v = \"0\" + v;\n }\n\n return v;\n };\n\n return pad(arr[0]) + pad(arr[1]) + pad(arr[2]) + pad(arr[3]) + pad(arr[4]) + pad(arr[5]) + pad(arr[6]) + pad(arr[7]);\n } // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n\n\n return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n // eslint-disable-next-line no-bitwise\n var r = Math.random() * 16 | 0; // eslint-disable-next-line no-bitwise\n\n var v = c === 'x' ? r : r & 0x3 | 0x8;\n return v.toString(16);\n });\n}\n/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\n\nexport function parseUrl(url) {\n if (!url) {\n return {};\n }\n\n var match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n if (!match) {\n return {};\n } // coerce to undefined values to empty string so we don't get 'undefined'\n\n\n var query = match[6] || '';\n var fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n relative: match[5] + query + fragment\n };\n}\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\n\nexport function getEventDescription(event) {\n if (event.message) {\n return event.message;\n }\n\n if (event.exception && event.exception.values && event.exception.values[0]) {\n var exception = event.exception.values[0];\n\n if (exception.type && exception.value) {\n return exception.type + \": \" + exception.value;\n }\n\n return exception.type || exception.value || event.event_id || '';\n }\n\n return event.event_id || '';\n}\n/** JSDoc */\n\nexport function consoleSandbox(callback) {\n var global = getGlobalObject();\n var levels = ['debug', 'info', 'warn', 'error', 'log', 'assert'];\n\n if (!('console' in global)) {\n return callback();\n } // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\n\n var originalConsole = global.console;\n var wrappedLevels = {}; // Restore all wrapped console methods\n\n levels.forEach(function (level) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (level in global.console && originalConsole[level].__sentry_original__) {\n wrappedLevels[level] = originalConsole[level];\n originalConsole[level] = originalConsole[level].__sentry_original__;\n }\n }); // Perform callback manipulations\n\n var result = callback(); // Revert restoration to wrapped state\n\n Object.keys(wrappedLevels).forEach(function (level) {\n originalConsole[level] = wrappedLevels[level];\n });\n return result;\n}\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\n\nexport function addExceptionTypeValue(event, value, type) {\n event.exception = event.exception || {};\n event.exception.values = event.exception.values || [];\n event.exception.values[0] = event.exception.values[0] || {};\n event.exception.values[0].value = event.exception.values[0].value || value || '';\n event.exception.values[0].type = event.exception.values[0].type || type || 'Error';\n}\n/**\n * Adds exception mechanism to a given event.\n * @param event The event to modify.\n * @param mechanism Mechanism of the mechanism.\n * @hidden\n */\n\nexport function addExceptionMechanism(event, mechanism) {\n if (mechanism === void 0) {\n mechanism = {};\n } // TODO: Use real type with `keyof Mechanism` thingy and maybe make it better?\n\n\n try {\n // @ts-ignore Type 'Mechanism | {}' is not assignable to type 'Mechanism | undefined'\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values[0].mechanism = event.exception.values[0].mechanism || {};\n Object.keys(mechanism).forEach(function (key) {\n // @ts-ignore Mechanism has no index signature\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values[0].mechanism[key] = mechanism[key];\n });\n } catch (_oO) {// no-empty\n }\n}\n/**\n * A safe form of location.href\n */\n\nexport function getLocationHref() {\n try {\n return document.location.href;\n } catch (oO) {\n return '';\n }\n} // https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n\nvar SEMVER_REGEXP = /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\n\nexport function parseSemver(input) {\n var match = input.match(SEMVER_REGEXP) || [];\n var major = parseInt(match[1], 10);\n var minor = parseInt(match[2], 10);\n var patch = parseInt(match[3], 10);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4]\n };\n}\nvar defaultRetryAfter = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param now current unix timestamp\n * @param header string representation of 'Retry-After' header\n */\n\nexport function parseRetryAfterHeader(now, header) {\n if (!header) {\n return defaultRetryAfter;\n }\n\n var headerDelay = parseInt(\"\" + header, 10);\n\n if (!isNaN(headerDelay)) {\n return headerDelay * 1000;\n }\n\n var headerDate = Date.parse(\"\" + header);\n\n if (!isNaN(headerDate)) {\n return headerDate - now;\n }\n\n return defaultRetryAfter;\n}\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\n\nexport function addContextToFrame(lines, frame, linesOfContext) {\n if (linesOfContext === void 0) {\n linesOfContext = 5;\n }\n\n var lineno = frame.lineno || 0;\n var maxLines = lines.length;\n var sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0);\n frame.pre_context = lines.slice(Math.max(0, sourceLine - linesOfContext), sourceLine).map(function (line) {\n return snipLine(line, 0);\n });\n frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n frame.post_context = lines.slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext).map(function (line) {\n return snipLine(line, 0);\n });\n}\n/**\n * Strip the query string and fragment off of a given URL or path (if present)\n *\n * @param urlPath Full URL or path, including possible query string and/or fragment\n * @returns URL or path without query string or fragment\n */\n\nexport function stripUrlQueryAndFragment(urlPath) {\n // eslint-disable-next-line no-useless-escape\n return urlPath.split(/[\\?#]/, 1)[0];\n}","import { isString } from './is';\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\n\nexport function htmlTreeAsString(elem) {\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n var currentElem = elem;\n var MAX_TRAVERSE_HEIGHT = 5;\n var MAX_OUTPUT_LEN = 80;\n var out = [];\n var height = 0;\n var len = 0;\n var separator = ' > ';\n var sepLength = separator.length;\n var nextStr = void 0; // eslint-disable-next-line no-plusplus\n\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem); // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds MAX_OUTPUT_LEN\n // (ignore this limit if we are on the first iteration)\n\n if (nextStr === 'html' || height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN) {\n break;\n }\n\n out.push(nextStr);\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch (_oO) {\n return '';\n }\n}\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\n\nfunction _htmlElementAsString(el) {\n var elem = el;\n var out = [];\n var className;\n var classes;\n var key;\n var attr;\n var i;\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n out.push(elem.tagName.toLowerCase());\n\n if (elem.id) {\n out.push(\"#\" + elem.id);\n } // eslint-disable-next-line prefer-const\n\n\n className = elem.className;\n\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n\n for (i = 0; i < classes.length; i++) {\n out.push(\".\" + classes[i]);\n }\n }\n\n var allowedAttrs = ['type', 'name', 'title', 'alt'];\n\n for (i = 0; i < allowedAttrs.length; i++) {\n key = allowedAttrs[i];\n attr = elem.getAttribute(key);\n\n if (attr) {\n out.push(\"[\" + key + \"=\\\"\" + attr + \"\\\"]\");\n }\n }\n\n return out.join('');\n}","import { dynamicRequire, fill, logger } from '@sentry/utils';\n/** Tracing integration for node-postgres package */\n\nvar Postgres =\n/** @class */\nfunction () {\n function Postgres() {\n /**\n * @inheritDoc\n */\n this.name = Postgres.id;\n }\n /**\n * @inheritDoc\n */\n\n\n Postgres.prototype.setupOnce = function (_, getCurrentHub) {\n var client;\n\n try {\n var pgModule = dynamicRequire(module, 'pg');\n client = pgModule.Client;\n } catch (e) {\n logger.error('Postgres Integration was unable to require `pg` package.');\n return;\n }\n /**\n * function (query, callback) => void\n * function (query, params, callback) => void\n * function (query) => Promise\n * function (query, params) => Promise\n */\n\n\n fill(client.prototype, 'query', function (orig) {\n return function (config, values, callback) {\n var _a, _b;\n\n var scope = getCurrentHub().getScope();\n var parentSpan = (_a = scope) === null || _a === void 0 ? void 0 : _a.getSpan();\n var span = (_b = parentSpan) === null || _b === void 0 ? void 0 : _b.startChild({\n description: typeof config === 'string' ? config : config.text,\n op: \"db\"\n });\n\n if (typeof callback === 'function') {\n return orig.call(this, config, values, function (err, result) {\n var _a;\n\n (_a = span) === null || _a === void 0 ? void 0 : _a.finish();\n callback(err, result);\n });\n }\n\n if (typeof values === 'function') {\n return orig.call(this, config, function (err, result) {\n var _a;\n\n (_a = span) === null || _a === void 0 ? void 0 : _a.finish();\n values(err, result);\n });\n }\n\n return orig.call(this, config, values).then(function (res) {\n var _a;\n\n (_a = span) === null || _a === void 0 ? void 0 : _a.finish();\n return res;\n });\n };\n });\n };\n /**\n * @inheritDoc\n */\n\n\n Postgres.id = 'Postgres';\n return Postgres;\n}();\n\nexport { Postgres };","import { dynamicRequire, fill, logger } from '@sentry/utils';\n/** Tracing integration for node-mysql package */\n\nvar Mysql =\n/** @class */\nfunction () {\n function Mysql() {\n /**\n * @inheritDoc\n */\n this.name = Mysql.id;\n }\n /**\n * @inheritDoc\n */\n\n\n Mysql.prototype.setupOnce = function (_, getCurrentHub) {\n var connection;\n\n try {\n // Unfortunatelly mysql is using some custom loading system and `Connection` is not exported directly.\n connection = dynamicRequire(module, 'mysql/lib/Connection.js');\n } catch (e) {\n logger.error('Mysql Integration was unable to require `mysql` package.');\n return;\n } // The original function will have one of these signatures:\n // function (callback) => void\n // function (options, callback) => void\n // function (options, values, callback) => void\n\n\n fill(connection.prototype, 'query', function (orig) {\n return function (options, values, callback) {\n var _a, _b;\n\n var scope = getCurrentHub().getScope();\n var parentSpan = (_a = scope) === null || _a === void 0 ? void 0 : _a.getSpan();\n var span = (_b = parentSpan) === null || _b === void 0 ? void 0 : _b.startChild({\n description: typeof options === 'string' ? options : options.sql,\n op: \"db\"\n });\n\n if (typeof callback === 'function') {\n return orig.call(this, options, values, function (err, result, fields) {\n var _a;\n\n (_a = span) === null || _a === void 0 ? void 0 : _a.finish();\n callback(err, result, fields);\n });\n }\n\n if (typeof values === 'function') {\n return orig.call(this, options, function (err, result, fields) {\n var _a;\n\n (_a = span) === null || _a === void 0 ? void 0 : _a.finish();\n values(err, result, fields);\n });\n }\n\n return orig.call(this, options, values, callback);\n };\n });\n };\n /**\n * @inheritDoc\n */\n\n\n Mysql.id = 'Mysql';\n return Mysql;\n}();\n\nexport { Mysql };","import { __read, __spread } from \"tslib\";\nimport { dynamicRequire, fill, isThenable, logger } from '@sentry/utils';\nvar OPERATIONS = ['aggregate', 'bulkWrite', 'countDocuments', 'createIndex', 'createIndexes', 'deleteMany', 'deleteOne', 'distinct', 'drop', 'dropIndex', 'dropIndexes', 'estimatedDocumentCount', 'find', 'findOne', 'findOneAndDelete', 'findOneAndReplace', 'findOneAndUpdate', 'indexes', 'indexExists', 'indexInformation', 'initializeOrderedBulkOp', 'insertMany', 'insertOne', 'isCapped', 'mapReduce', 'options', 'parallelCollectionScan', 'rename', 'replaceOne', 'stats', 'updateMany', 'updateOne']; // All of the operations above take `options` and `callback` as their final parameters, but some of them\n// take additional parameters as well. For those operations, this is a map of\n// { : [] }, as a way to know what to call the operation's\n// positional arguments when we add them to the span's `data` object later\n\nvar OPERATION_SIGNATURES = {\n // aggregate intentionally not included because `pipeline` arguments are too complex to serialize well\n // see https://github.com/getsentry/sentry-javascript/pull/3102\n bulkWrite: ['operations'],\n countDocuments: ['query'],\n createIndex: ['fieldOrSpec'],\n createIndexes: ['indexSpecs'],\n deleteMany: ['filter'],\n deleteOne: ['filter'],\n distinct: ['key', 'query'],\n dropIndex: ['indexName'],\n find: ['query'],\n findOne: ['query'],\n findOneAndDelete: ['filter'],\n findOneAndReplace: ['filter', 'replacement'],\n findOneAndUpdate: ['filter', 'update'],\n indexExists: ['indexes'],\n insertMany: ['docs'],\n insertOne: ['doc'],\n mapReduce: ['map', 'reduce'],\n rename: ['newName'],\n replaceOne: ['filter', 'doc'],\n updateMany: ['filter', 'update'],\n updateOne: ['filter', 'update']\n};\n/** Tracing integration for mongo package */\n\nvar Mongo =\n/** @class */\nfunction () {\n /**\n * @inheritDoc\n */\n function Mongo(options) {\n if (options === void 0) {\n options = {};\n }\n /**\n * @inheritDoc\n */\n\n\n this.name = Mongo.id;\n this._operations = Array.isArray(options.operations) ? options.operations : OPERATIONS;\n this._describeOperations = 'describeOperations' in options ? options.describeOperations : true;\n this._useMongoose = !!options.useMongoose;\n }\n /**\n * @inheritDoc\n */\n\n\n Mongo.prototype.setupOnce = function (_, getCurrentHub) {\n var collection;\n var moduleName = this._useMongoose ? 'mongoose' : 'mongodb';\n\n try {\n var mongodbModule = dynamicRequire(module, moduleName);\n collection = mongodbModule.Collection;\n } catch (e) {\n logger.error(\"Mongo Integration was unable to require `\" + moduleName + \"` package.\");\n return;\n }\n\n this._instrumentOperations(collection, this._operations, getCurrentHub);\n };\n /**\n * Patches original collection methods\n */\n\n\n Mongo.prototype._instrumentOperations = function (collection, operations, getCurrentHub) {\n var _this = this;\n\n operations.forEach(function (operation) {\n return _this._patchOperation(collection, operation, getCurrentHub);\n });\n };\n /**\n * Patches original collection to utilize our tracing functionality\n */\n\n\n Mongo.prototype._patchOperation = function (collection, operation, getCurrentHub) {\n if (!(operation in collection.prototype)) return;\n\n var getSpanContext = this._getSpanContextFromOperationArguments.bind(this);\n\n fill(collection.prototype, operation, function (orig) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var _a, _b, _c, _d;\n\n var lastArg = args[args.length - 1];\n var scope = getCurrentHub().getScope();\n var parentSpan = (_a = scope) === null || _a === void 0 ? void 0 : _a.getSpan(); // Check if the operation was passed a callback. (mapReduce requires a different check, as\n // its (non-callback) arguments can also be functions.)\n\n if (typeof lastArg !== 'function' || operation === 'mapReduce' && args.length === 2) {\n var span_1 = (_b = parentSpan) === null || _b === void 0 ? void 0 : _b.startChild(getSpanContext(this, operation, args));\n var maybePromise = orig.call.apply(orig, __spread([this], args));\n\n if (isThenable(maybePromise)) {\n return maybePromise.then(function (res) {\n var _a;\n\n (_a = span_1) === null || _a === void 0 ? void 0 : _a.finish();\n return res;\n });\n } else {\n (_c = span_1) === null || _c === void 0 ? void 0 : _c.finish();\n return maybePromise;\n }\n }\n\n var span = (_d = parentSpan) === null || _d === void 0 ? void 0 : _d.startChild(getSpanContext(this, operation, args.slice(0, -1)));\n return orig.call.apply(orig, __spread([this], args.slice(0, -1), [function (err, result) {\n var _a;\n\n (_a = span) === null || _a === void 0 ? void 0 : _a.finish();\n lastArg(err, result);\n }]));\n };\n });\n };\n /**\n * Form a SpanContext based on the user input to a given operation.\n */\n\n\n Mongo.prototype._getSpanContextFromOperationArguments = function (collection, operation, args) {\n var data = {\n collectionName: collection.collectionName,\n dbName: collection.dbName,\n namespace: collection.namespace\n };\n var spanContext = {\n op: \"db\",\n description: operation,\n data: data\n }; // If the operation takes no arguments besides `options` and `callback`, or if argument\n // collection is disabled for this operation, just return early.\n\n var signature = OPERATION_SIGNATURES[operation];\n var shouldDescribe = Array.isArray(this._describeOperations) ? this._describeOperations.includes(operation) : this._describeOperations;\n\n if (!signature || !shouldDescribe) {\n return spanContext;\n }\n\n try {\n // Special case for `mapReduce`, as the only one accepting functions as arguments.\n if (operation === 'mapReduce') {\n var _a = __read(args, 2),\n map = _a[0],\n reduce = _a[1];\n\n data[signature[0]] = typeof map === 'string' ? map : map.name || '';\n data[signature[1]] = typeof reduce === 'string' ? reduce : reduce.name || '';\n } else {\n for (var i = 0; i < signature.length; i++) {\n data[signature[i]] = JSON.stringify(args[i]);\n }\n }\n } catch (_oO) {// no-empty\n }\n\n return spanContext;\n };\n /**\n * @inheritDoc\n */\n\n\n Mongo.id = 'Mongo';\n return Mongo;\n}();\n\nexport { Mongo };","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\n/**\n * Memo class used for decycle json objects. Uses WeakSet if available otherwise array.\n */\nvar Memo =\n/** @class */\nfunction () {\n function Memo() {\n this._hasWeakSet = typeof WeakSet === 'function';\n this._inner = this._hasWeakSet ? new WeakSet() : [];\n }\n /**\n * Sets obj to remember.\n * @param obj Object to remember\n */\n\n\n Memo.prototype.memoize = function (obj) {\n if (this._hasWeakSet) {\n if (this._inner.has(obj)) {\n return true;\n }\n\n this._inner.add(obj);\n\n return false;\n } // eslint-disable-next-line @typescript-eslint/prefer-for-of\n\n\n for (var i = 0; i < this._inner.length; i++) {\n var value = this._inner[i];\n\n if (value === obj) {\n return true;\n }\n }\n\n this._inner.push(obj);\n\n return false;\n };\n /**\n * Removes object from internal storage.\n * @param obj Object to forget\n */\n\n\n Memo.prototype.unmemoize = function (obj) {\n if (this._hasWeakSet) {\n this._inner[\"delete\"](obj);\n } else {\n for (var i = 0; i < this._inner.length; i++) {\n if (this._inner[i] === obj) {\n this._inner.splice(i, 1);\n\n break;\n }\n }\n }\n };\n\n return Memo;\n}();\n\nexport { Memo };","var originalFunctionToString;\n/** Patch toString calls to return proper name for wrapped functions */\n\nvar FunctionToString =\n/** @class */\nfunction () {\n function FunctionToString() {\n /**\n * @inheritDoc\n */\n this.name = FunctionToString.id;\n }\n /**\n * @inheritDoc\n */\n\n\n FunctionToString.prototype.setupOnce = function () {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n originalFunctionToString = Function.prototype.toString; // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n Function.prototype.toString = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var context = this.__sentry_original__ || this;\n return originalFunctionToString.apply(context, args);\n };\n };\n /**\n * @inheritDoc\n */\n\n\n FunctionToString.id = 'FunctionToString';\n return FunctionToString;\n}();\n\nexport { FunctionToString };","/* eslint-disable @typescript-eslint/explicit-function-return-type */\n\n/* eslint-disable @typescript-eslint/typedef */\n\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isThenable } from './is';\n/** SyncPromise internal states */\n\nvar States;\n\n(function (States) {\n /** Pending */\n States[\"PENDING\"] = \"PENDING\";\n /** Resolved / OK */\n\n States[\"RESOLVED\"] = \"RESOLVED\";\n /** Rejected / Error */\n\n States[\"REJECTED\"] = \"REJECTED\";\n})(States || (States = {}));\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\n\n\nvar SyncPromise =\n/** @class */\nfunction () {\n function SyncPromise(executor) {\n var _this = this;\n\n this._state = States.PENDING;\n this._handlers = [];\n /** JSDoc */\n\n this._resolve = function (value) {\n _this._setResult(States.RESOLVED, value);\n };\n /** JSDoc */\n\n\n this._reject = function (reason) {\n _this._setResult(States.REJECTED, reason);\n };\n /** JSDoc */\n\n\n this._setResult = function (state, value) {\n if (_this._state !== States.PENDING) {\n return;\n }\n\n if (isThenable(value)) {\n value.then(_this._resolve, _this._reject);\n return;\n }\n\n _this._state = state;\n _this._value = value;\n\n _this._executeHandlers();\n }; // TODO: FIXME\n\n /** JSDoc */\n\n\n this._attachHandler = function (handler) {\n _this._handlers = _this._handlers.concat(handler);\n\n _this._executeHandlers();\n };\n /** JSDoc */\n\n\n this._executeHandlers = function () {\n if (_this._state === States.PENDING) {\n return;\n }\n\n var cachedHandlers = _this._handlers.slice();\n\n _this._handlers = [];\n cachedHandlers.forEach(function (handler) {\n if (handler.done) {\n return;\n }\n\n if (_this._state === States.RESOLVED) {\n if (handler.onfulfilled) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n handler.onfulfilled(_this._value);\n }\n }\n\n if (_this._state === States.REJECTED) {\n if (handler.onrejected) {\n handler.onrejected(_this._value);\n }\n }\n\n handler.done = true;\n });\n };\n\n try {\n executor(this._resolve, this._reject);\n } catch (e) {\n this._reject(e);\n }\n }\n /** JSDoc */\n\n\n SyncPromise.resolve = function (value) {\n return new SyncPromise(function (resolve) {\n resolve(value);\n });\n };\n /** JSDoc */\n\n\n SyncPromise.reject = function (reason) {\n return new SyncPromise(function (_, reject) {\n reject(reason);\n });\n };\n /** JSDoc */\n\n\n SyncPromise.all = function (collection) {\n return new SyncPromise(function (resolve, reject) {\n if (!Array.isArray(collection)) {\n reject(new TypeError(\"Promise.all requires an array as input.\"));\n return;\n }\n\n if (collection.length === 0) {\n resolve([]);\n return;\n }\n\n var counter = collection.length;\n var resolvedCollection = [];\n collection.forEach(function (item, index) {\n SyncPromise.resolve(item).then(function (value) {\n resolvedCollection[index] = value;\n counter -= 1;\n\n if (counter !== 0) {\n return;\n }\n\n resolve(resolvedCollection);\n }).then(null, reject);\n });\n });\n };\n /** JSDoc */\n\n\n SyncPromise.prototype.then = function (_onfulfilled, _onrejected) {\n var _this = this;\n\n return new SyncPromise(function (resolve, reject) {\n _this._attachHandler({\n done: false,\n onfulfilled: function onfulfilled(result) {\n if (!_onfulfilled) {\n // TODO: ¯\\_(ツ)_/¯\n // TODO: FIXME\n resolve(result);\n return;\n }\n\n try {\n resolve(_onfulfilled(result));\n return;\n } catch (e) {\n reject(e);\n return;\n }\n },\n onrejected: function onrejected(reason) {\n if (!_onrejected) {\n reject(reason);\n return;\n }\n\n try {\n resolve(_onrejected(reason));\n return;\n } catch (e) {\n reject(e);\n return;\n }\n }\n });\n });\n };\n /** JSDoc */\n\n\n SyncPromise.prototype[\"catch\"] = function (onrejected) {\n return this.then(function (val) {\n return val;\n }, onrejected);\n };\n /** JSDoc */\n\n\n SyncPromise.prototype[\"finally\"] = function (onfinally) {\n var _this = this;\n\n return new SyncPromise(function (resolve, reject) {\n var val;\n var isRejected;\n return _this.then(function (value) {\n isRejected = false;\n val = value;\n\n if (onfinally) {\n onfinally();\n }\n }, function (reason) {\n isRejected = true;\n val = reason;\n\n if (onfinally) {\n onfinally();\n }\n }).then(function () {\n if (isRejected) {\n reject(val);\n return;\n }\n\n resolve(val);\n });\n });\n };\n /** JSDoc */\n\n\n SyncPromise.prototype.toString = function () {\n return '[object SyncPromise]';\n };\n\n return SyncPromise;\n}();\n\nexport { SyncPromise };","/**\n * Session Status\n */\nexport var SessionStatus;\n\n(function (SessionStatus) {\n /** JSDoc */\n SessionStatus[\"Ok\"] = \"ok\";\n /** JSDoc */\n\n SessionStatus[\"Exited\"] = \"exited\";\n /** JSDoc */\n\n SessionStatus[\"Crashed\"] = \"crashed\";\n /** JSDoc */\n\n SessionStatus[\"Abnormal\"] = \"abnormal\";\n})(SessionStatus || (SessionStatus = {}));","import { __assign, __read, __spread } from \"tslib\";\nimport { dateTimestampInSeconds, getGlobalObject, isPlainObject, isThenable, SyncPromise } from '@sentry/utils';\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\n\nvar Scope =\n/** @class */\nfunction () {\n function Scope() {\n /** Flag if notifiying is happening. */\n this._notifyingListeners = false;\n /** Callback for client to receive scope changes. */\n\n this._scopeListeners = [];\n /** Callback list that will be called after {@link applyToEvent}. */\n\n this._eventProcessors = [];\n /** Array of breadcrumbs. */\n\n this._breadcrumbs = [];\n /** User */\n\n this._user = {};\n /** Tags */\n\n this._tags = {};\n /** Extra */\n\n this._extra = {};\n /** Contexts */\n\n this._contexts = {};\n }\n /**\n * Inherit values from the parent scope.\n * @param scope to clone.\n */\n\n\n Scope.clone = function (scope) {\n var newScope = new Scope();\n\n if (scope) {\n newScope._breadcrumbs = __spread(scope._breadcrumbs);\n newScope._tags = __assign({}, scope._tags);\n newScope._extra = __assign({}, scope._extra);\n newScope._contexts = __assign({}, scope._contexts);\n newScope._user = scope._user;\n newScope._level = scope._level;\n newScope._span = scope._span;\n newScope._session = scope._session;\n newScope._transactionName = scope._transactionName;\n newScope._fingerprint = scope._fingerprint;\n newScope._eventProcessors = __spread(scope._eventProcessors);\n }\n\n return newScope;\n };\n /**\n * Add internal on change listener. Used for sub SDKs that need to store the scope.\n * @hidden\n */\n\n\n Scope.prototype.addScopeListener = function (callback) {\n this._scopeListeners.push(callback);\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.addEventProcessor = function (callback) {\n this._eventProcessors.push(callback);\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setUser = function (user) {\n this._user = user || {};\n\n if (this._session) {\n this._session.update({\n user: user\n });\n }\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.getUser = function () {\n return this._user;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setTags = function (tags) {\n this._tags = __assign(__assign({}, this._tags), tags);\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setTag = function (key, value) {\n var _a;\n\n this._tags = __assign(__assign({}, this._tags), (_a = {}, _a[key] = value, _a));\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setExtras = function (extras) {\n this._extra = __assign(__assign({}, this._extra), extras);\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setExtra = function (key, extra) {\n var _a;\n\n this._extra = __assign(__assign({}, this._extra), (_a = {}, _a[key] = extra, _a));\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setFingerprint = function (fingerprint) {\n this._fingerprint = fingerprint;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setLevel = function (level) {\n this._level = level;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setTransactionName = function (name) {\n this._transactionName = name;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * Can be removed in major version.\n * @deprecated in favor of {@link this.setTransactionName}\n */\n\n\n Scope.prototype.setTransaction = function (name) {\n return this.setTransactionName(name);\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setContext = function (key, context) {\n var _a;\n\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts = __assign(__assign({}, this._contexts), (_a = {}, _a[key] = context, _a));\n }\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setSpan = function (span) {\n this._span = span;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.getSpan = function () {\n return this._span;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.getTransaction = function () {\n var _a, _b, _c, _d; // often, this span will be a transaction, but it's not guaranteed to be\n\n\n var span = this.getSpan(); // try it the new way first\n\n if ((_a = span) === null || _a === void 0 ? void 0 : _a.transaction) {\n return (_b = span) === null || _b === void 0 ? void 0 : _b.transaction;\n } // fallback to the old way (known bug: this only finds transactions with sampled = true)\n\n\n if ((_d = (_c = span) === null || _c === void 0 ? void 0 : _c.spanRecorder) === null || _d === void 0 ? void 0 : _d.spans[0]) {\n return span.spanRecorder.spans[0];\n } // neither way found a transaction\n\n\n return undefined;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setSession = function (session) {\n if (!session) {\n delete this._session;\n } else {\n this._session = session;\n }\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.getSession = function () {\n return this._session;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.update = function (captureContext) {\n if (!captureContext) {\n return this;\n }\n\n if (typeof captureContext === 'function') {\n var updatedScope = captureContext(this);\n return updatedScope instanceof Scope ? updatedScope : this;\n }\n\n if (captureContext instanceof Scope) {\n this._tags = __assign(__assign({}, this._tags), captureContext._tags);\n this._extra = __assign(__assign({}, this._extra), captureContext._extra);\n this._contexts = __assign(__assign({}, this._contexts), captureContext._contexts);\n\n if (captureContext._user && Object.keys(captureContext._user).length) {\n this._user = captureContext._user;\n }\n\n if (captureContext._level) {\n this._level = captureContext._level;\n }\n\n if (captureContext._fingerprint) {\n this._fingerprint = captureContext._fingerprint;\n }\n } else if (isPlainObject(captureContext)) {\n // eslint-disable-next-line no-param-reassign\n captureContext = captureContext;\n this._tags = __assign(__assign({}, this._tags), captureContext.tags);\n this._extra = __assign(__assign({}, this._extra), captureContext.extra);\n this._contexts = __assign(__assign({}, this._contexts), captureContext.contexts);\n\n if (captureContext.user) {\n this._user = captureContext.user;\n }\n\n if (captureContext.level) {\n this._level = captureContext.level;\n }\n\n if (captureContext.fingerprint) {\n this._fingerprint = captureContext.fingerprint;\n }\n }\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.clear = function () {\n this._breadcrumbs = [];\n this._tags = {};\n this._extra = {};\n this._user = {};\n this._contexts = {};\n this._level = undefined;\n this._transactionName = undefined;\n this._fingerprint = undefined;\n this._span = undefined;\n this._session = undefined;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.addBreadcrumb = function (breadcrumb, maxBreadcrumbs) {\n var mergedBreadcrumb = __assign({\n timestamp: dateTimestampInSeconds()\n }, breadcrumb);\n\n this._breadcrumbs = maxBreadcrumbs !== undefined && maxBreadcrumbs >= 0 ? __spread(this._breadcrumbs, [mergedBreadcrumb]).slice(-maxBreadcrumbs) : __spread(this._breadcrumbs, [mergedBreadcrumb]);\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.clearBreadcrumbs = function () {\n this._breadcrumbs = [];\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * Applies the current context and fingerprint to the event.\n * Note that breadcrumbs will be added by the client.\n * Also if the event has already breadcrumbs on it, we do not merge them.\n * @param event Event\n * @param hint May contain additional informartion about the original exception.\n * @hidden\n */\n\n\n Scope.prototype.applyToEvent = function (event, hint) {\n var _a;\n\n if (this._extra && Object.keys(this._extra).length) {\n event.extra = __assign(__assign({}, this._extra), event.extra);\n }\n\n if (this._tags && Object.keys(this._tags).length) {\n event.tags = __assign(__assign({}, this._tags), event.tags);\n }\n\n if (this._user && Object.keys(this._user).length) {\n event.user = __assign(__assign({}, this._user), event.user);\n }\n\n if (this._contexts && Object.keys(this._contexts).length) {\n event.contexts = __assign(__assign({}, this._contexts), event.contexts);\n }\n\n if (this._level) {\n event.level = this._level;\n }\n\n if (this._transactionName) {\n event.transaction = this._transactionName;\n } // We want to set the trace context for normal events only if there isn't already\n // a trace context on the event. There is a product feature in place where we link\n // errors with transaction and it relys on that.\n\n\n if (this._span) {\n event.contexts = __assign({\n trace: this._span.getTraceContext()\n }, event.contexts);\n var transactionName = (_a = this._span.transaction) === null || _a === void 0 ? void 0 : _a.name;\n\n if (transactionName) {\n event.tags = __assign({\n transaction: transactionName\n }, event.tags);\n }\n }\n\n this._applyFingerprint(event);\n\n event.breadcrumbs = __spread(event.breadcrumbs || [], this._breadcrumbs);\n event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined;\n return this._notifyEventProcessors(__spread(getGlobalEventProcessors(), this._eventProcessors), event, hint);\n };\n /**\n * This will be called after {@link applyToEvent} is finished.\n */\n\n\n Scope.prototype._notifyEventProcessors = function (processors, event, hint, index) {\n var _this = this;\n\n if (index === void 0) {\n index = 0;\n }\n\n return new SyncPromise(function (resolve, reject) {\n var processor = processors[index];\n\n if (event === null || typeof processor !== 'function') {\n resolve(event);\n } else {\n var result = processor(__assign({}, event), hint);\n\n if (isThenable(result)) {\n result.then(function (_final) {\n return _this._notifyEventProcessors(processors, _final, hint, index + 1).then(resolve);\n }).then(null, reject);\n } else {\n _this._notifyEventProcessors(processors, result, hint, index + 1).then(resolve).then(null, reject);\n }\n }\n });\n };\n /**\n * This will be called on every set call.\n */\n\n\n Scope.prototype._notifyScopeListeners = function () {\n var _this = this; // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n\n\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n\n this._scopeListeners.forEach(function (callback) {\n callback(_this);\n });\n\n this._notifyingListeners = false;\n }\n };\n /**\n * Applies fingerprint from the scope to the event if there's one,\n * uses message if there's one instead or get rid of empty fingerprint\n */\n\n\n Scope.prototype._applyFingerprint = function (event) {\n // Make sure it's an array first and we actually have something in place\n event.fingerprint = event.fingerprint ? Array.isArray(event.fingerprint) ? event.fingerprint : [event.fingerprint] : []; // If we have something on the scope, then merge it with event\n\n if (this._fingerprint) {\n event.fingerprint = event.fingerprint.concat(this._fingerprint);\n } // If we have no data at all, remove empty array default\n\n\n if (event.fingerprint && !event.fingerprint.length) {\n delete event.fingerprint;\n }\n };\n\n return Scope;\n}();\n\nexport { Scope };\n/**\n * Retruns the global event processors.\n */\n\nfunction getGlobalEventProcessors() {\n /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */\n var global = getGlobalObject();\n global.__SENTRY__ = global.__SENTRY__ || {};\n global.__SENTRY__.globalEventProcessors = global.__SENTRY__.globalEventProcessors || [];\n return global.__SENTRY__.globalEventProcessors;\n /* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */\n}\n/**\n * Add a EventProcessor to be kept globally.\n * @param callback EventProcessor to add\n */\n\n\nexport function addGlobalEventProcessor(callback) {\n getGlobalEventProcessors().push(callback);\n}","import { SessionStatus } from '@sentry/types';\nimport { dropUndefinedKeys, uuid4 } from '@sentry/utils';\n/**\n * @inheritdoc\n */\n\nvar Session =\n/** @class */\nfunction () {\n function Session(context) {\n this.errors = 0;\n this.sid = uuid4();\n this.timestamp = Date.now();\n this.started = Date.now();\n this.duration = 0;\n this.status = SessionStatus.Ok;\n this.init = true;\n\n if (context) {\n this.update(context);\n }\n }\n /** JSDoc */\n // eslint-disable-next-line complexity\n\n\n Session.prototype.update = function (context) {\n if (context === void 0) {\n context = {};\n }\n\n if (context.user) {\n if (context.user.ip_address) {\n this.ipAddress = context.user.ip_address;\n }\n\n if (!context.did) {\n this.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n this.timestamp = context.timestamp || Date.now();\n\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n this.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n\n if (context.init !== undefined) {\n this.init = context.init;\n }\n\n if (context.did) {\n this.did = \"\" + context.did;\n }\n\n if (typeof context.started === 'number') {\n this.started = context.started;\n }\n\n if (typeof context.duration === 'number') {\n this.duration = context.duration;\n } else {\n this.duration = this.timestamp - this.started;\n }\n\n if (context.release) {\n this.release = context.release;\n }\n\n if (context.environment) {\n this.environment = context.environment;\n }\n\n if (context.ipAddress) {\n this.ipAddress = context.ipAddress;\n }\n\n if (context.userAgent) {\n this.userAgent = context.userAgent;\n }\n\n if (typeof context.errors === 'number') {\n this.errors = context.errors;\n }\n\n if (context.status) {\n this.status = context.status;\n }\n };\n /** JSDoc */\n\n\n Session.prototype.close = function (status) {\n if (status) {\n this.update({\n status: status\n });\n } else if (this.status === SessionStatus.Ok) {\n this.update({\n status: SessionStatus.Exited\n });\n } else {\n this.update();\n }\n };\n /** JSDoc */\n\n\n Session.prototype.toJSON = function () {\n return dropUndefinedKeys({\n sid: \"\" + this.sid,\n init: this.init,\n started: new Date(this.started).toISOString(),\n timestamp: new Date(this.timestamp).toISOString(),\n status: this.status,\n errors: this.errors,\n did: typeof this.did === 'number' || typeof this.did === 'string' ? \"\" + this.did : undefined,\n duration: this.duration,\n attrs: dropUndefinedKeys({\n release: this.release,\n environment: this.environment,\n ip_address: this.ipAddress,\n user_agent: this.userAgent\n })\n });\n };\n\n return Session;\n}();\n\nexport { Session };","import { __assign, __read, __spread } from \"tslib\";\n/* eslint-disable max-lines */\n\nimport { SessionStatus } from '@sentry/types';\nimport { consoleSandbox, dateTimestampInSeconds, getGlobalObject, isNodeEnv, logger, uuid4 } from '@sentry/utils';\nimport { Scope } from './scope';\nimport { Session } from './session';\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be increased when the global interface\n * changes and new methods are introduced.\n *\n * @hidden\n */\n\nexport var API_VERSION = 3;\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\n\nvar DEFAULT_BREADCRUMBS = 100;\n/**\n * Absolute maximum number of breadcrumbs added to an event. The\n * `maxBreadcrumbs` option cannot be higher than this value.\n */\n\nvar MAX_BREADCRUMBS = 100;\n/**\n * @inheritDoc\n */\n\nvar Hub =\n/** @class */\nfunction () {\n /**\n * Creates a new instance of the hub, will push one {@link Layer} into the\n * internal stack on creation.\n *\n * @param client bound to the hub.\n * @param scope bound to the hub.\n * @param version number, higher number means higher priority.\n */\n function Hub(client, scope, _version) {\n if (scope === void 0) {\n scope = new Scope();\n }\n\n if (_version === void 0) {\n _version = API_VERSION;\n }\n\n this._version = _version;\n /** Is a {@link Layer}[] containing the client and scope */\n\n this._stack = [{}];\n this.getStackTop().scope = scope;\n this.bindClient(client);\n }\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.isOlderThan = function (version) {\n return this._version < version;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.bindClient = function (client) {\n var top = this.getStackTop();\n top.client = client;\n\n if (client && client.setupIntegrations) {\n client.setupIntegrations();\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.pushScope = function () {\n // We want to clone the content of prev scope\n var scope = Scope.clone(this.getScope());\n this.getStack().push({\n client: this.getClient(),\n scope: scope\n });\n return scope;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.popScope = function () {\n if (this.getStack().length <= 1) return false;\n return !!this.getStack().pop();\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.withScope = function (callback) {\n var scope = this.pushScope();\n\n try {\n callback(scope);\n } finally {\n this.popScope();\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.getClient = function () {\n return this.getStackTop().client;\n };\n /** Returns the scope of the top stack. */\n\n\n Hub.prototype.getScope = function () {\n return this.getStackTop().scope;\n };\n /** Returns the scope stack for domains or the process. */\n\n\n Hub.prototype.getStack = function () {\n return this._stack;\n };\n /** Returns the topmost scope layer in the order domain > local > process. */\n\n\n Hub.prototype.getStackTop = function () {\n return this._stack[this._stack.length - 1];\n };\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n\n Hub.prototype.captureException = function (exception, hint) {\n var eventId = this._lastEventId = uuid4();\n var finalHint = hint; // If there's no explicit hint provided, mimick the same thing that would happen\n // in the minimal itself to create a consistent behavior.\n // We don't do this in the client, as it's the lowest level API, and doing this,\n // would prevent user from having full control over direct calls.\n\n if (!hint) {\n var syntheticException = void 0;\n\n try {\n throw new Error('Sentry syntheticException');\n } catch (exception) {\n syntheticException = exception;\n }\n\n finalHint = {\n originalException: exception,\n syntheticException: syntheticException\n };\n }\n\n this._invokeClient('captureException', exception, __assign(__assign({}, finalHint), {\n event_id: eventId\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.captureMessage = function (message, level, hint) {\n var eventId = this._lastEventId = uuid4();\n var finalHint = hint; // If there's no explicit hint provided, mimick the same thing that would happen\n // in the minimal itself to create a consistent behavior.\n // We don't do this in the client, as it's the lowest level API, and doing this,\n // would prevent user from having full control over direct calls.\n\n if (!hint) {\n var syntheticException = void 0;\n\n try {\n throw new Error(message);\n } catch (exception) {\n syntheticException = exception;\n }\n\n finalHint = {\n originalException: message,\n syntheticException: syntheticException\n };\n }\n\n this._invokeClient('captureMessage', message, level, __assign(__assign({}, finalHint), {\n event_id: eventId\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.captureEvent = function (event, hint) {\n var eventId = this._lastEventId = uuid4();\n\n this._invokeClient('captureEvent', event, __assign(__assign({}, hint), {\n event_id: eventId\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.lastEventId = function () {\n return this._lastEventId;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.addBreadcrumb = function (breadcrumb, hint) {\n var _a = this.getStackTop(),\n scope = _a.scope,\n client = _a.client;\n\n if (!scope || !client) return; // eslint-disable-next-line @typescript-eslint/unbound-method\n\n var _b = client.getOptions && client.getOptions() || {},\n _c = _b.beforeBreadcrumb,\n beforeBreadcrumb = _c === void 0 ? null : _c,\n _d = _b.maxBreadcrumbs,\n maxBreadcrumbs = _d === void 0 ? DEFAULT_BREADCRUMBS : _d;\n\n if (maxBreadcrumbs <= 0) return;\n var timestamp = dateTimestampInSeconds();\n\n var mergedBreadcrumb = __assign({\n timestamp: timestamp\n }, breadcrumb);\n\n var finalBreadcrumb = beforeBreadcrumb ? consoleSandbox(function () {\n return beforeBreadcrumb(mergedBreadcrumb, hint);\n }) : mergedBreadcrumb;\n if (finalBreadcrumb === null) return;\n scope.addBreadcrumb(finalBreadcrumb, Math.min(maxBreadcrumbs, MAX_BREADCRUMBS));\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setUser = function (user) {\n var scope = this.getScope();\n if (scope) scope.setUser(user);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setTags = function (tags) {\n var scope = this.getScope();\n if (scope) scope.setTags(tags);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setExtras = function (extras) {\n var scope = this.getScope();\n if (scope) scope.setExtras(extras);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setTag = function (key, value) {\n var scope = this.getScope();\n if (scope) scope.setTag(key, value);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setExtra = function (key, extra) {\n var scope = this.getScope();\n if (scope) scope.setExtra(key, extra);\n };\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n Hub.prototype.setContext = function (name, context) {\n var scope = this.getScope();\n if (scope) scope.setContext(name, context);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.configureScope = function (callback) {\n var _a = this.getStackTop(),\n scope = _a.scope,\n client = _a.client;\n\n if (scope && client) {\n callback(scope);\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.run = function (callback) {\n var oldHub = makeMain(this);\n\n try {\n callback(this);\n } finally {\n makeMain(oldHub);\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.getIntegration = function (integration) {\n var client = this.getClient();\n if (!client) return null;\n\n try {\n return client.getIntegration(integration);\n } catch (_oO) {\n logger.warn(\"Cannot retrieve integration \" + integration.id + \" from the current Hub\");\n return null;\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.startSpan = function (context) {\n return this._callExtensionMethod('startSpan', context);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.startTransaction = function (context, customSamplingContext) {\n return this._callExtensionMethod('startTransaction', context, customSamplingContext);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.traceHeaders = function () {\n return this._callExtensionMethod('traceHeaders');\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.captureSession = function (endSession) {\n if (endSession === void 0) {\n endSession = false;\n } // both send the update and pull the session from the scope\n\n\n if (endSession) {\n return this.endSession();\n } // only send the update\n\n\n this._sendSessionUpdate();\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.endSession = function () {\n var _a, _b, _c, _d, _e;\n\n (_c = (_b = (_a = this.getStackTop()) === null || _a === void 0 ? void 0 : _a.scope) === null || _b === void 0 ? void 0 : _b.getSession()) === null || _c === void 0 ? void 0 : _c.close();\n\n this._sendSessionUpdate(); // the session is over; take it off of the scope\n\n\n (_e = (_d = this.getStackTop()) === null || _d === void 0 ? void 0 : _d.scope) === null || _e === void 0 ? void 0 : _e.setSession();\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.startSession = function (context) {\n var _a = this.getStackTop(),\n scope = _a.scope,\n client = _a.client;\n\n var _b = client && client.getOptions() || {},\n release = _b.release,\n environment = _b.environment;\n\n var session = new Session(__assign(__assign({\n release: release,\n environment: environment\n }, scope && {\n user: scope.getUser()\n }), context));\n\n if (scope) {\n // End existing session if there's one\n var currentSession = scope.getSession && scope.getSession();\n\n if (currentSession && currentSession.status === SessionStatus.Ok) {\n currentSession.update({\n status: SessionStatus.Exited\n });\n }\n\n this.endSession(); // Afterwards we set the new session on the scope\n\n scope.setSession(session);\n }\n\n return session;\n };\n /**\n * Sends the current Session on the scope\n */\n\n\n Hub.prototype._sendSessionUpdate = function () {\n var _a = this.getStackTop(),\n scope = _a.scope,\n client = _a.client;\n\n if (!scope) return;\n var session = scope.getSession && scope.getSession();\n\n if (session) {\n if (client && client.captureSession) {\n client.captureSession(session);\n }\n }\n };\n /**\n * Internal helper function to call a method on the top client if it exists.\n *\n * @param method The method to call on the client.\n * @param args Arguments to pass to the client function.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n Hub.prototype._invokeClient = function (method) {\n var _a;\n\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n var _b = this.getStackTop(),\n scope = _b.scope,\n client = _b.client;\n\n if (client && client[method]) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n (_a = client)[method].apply(_a, __spread(args, [scope]));\n }\n };\n /**\n * Calls global extension method and binding current instance to the function call\n */\n // @ts-ignore Function lacks ending return statement and return type does not include 'undefined'. ts(2366)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n Hub.prototype._callExtensionMethod = function (method) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n var carrier = getMainCarrier();\n var sentry = carrier.__SENTRY__;\n\n if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n return sentry.extensions[method].apply(this, args);\n }\n\n logger.warn(\"Extension method \" + method + \" couldn't be found, doing nothing.\");\n };\n\n return Hub;\n}();\n\nexport { Hub };\n/** Returns the global shim registry. */\n\nexport function getMainCarrier() {\n var carrier = getGlobalObject();\n carrier.__SENTRY__ = carrier.__SENTRY__ || {\n extensions: {},\n hub: undefined\n };\n return carrier;\n}\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n */\n\nexport function makeMain(hub) {\n var registry = getMainCarrier();\n var oldHub = getHubFromCarrier(registry);\n setHubOnCarrier(registry, hub);\n return oldHub;\n}\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n */\n\nexport function getCurrentHub() {\n // Get main carrier (global for every environment)\n var registry = getMainCarrier(); // If there's no hub, or its an old API, assign a new one\n\n if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {\n setHubOnCarrier(registry, new Hub());\n } // Prefer domains over global if they are there (applicable only to Node environment)\n\n\n if (isNodeEnv()) {\n return getHubFromActiveDomain(registry);\n } // Return hub that lives on a global object\n\n\n return getHubFromCarrier(registry);\n}\n/**\n * Returns the active domain, if one exists\n * @deprecated No longer used; remove in v7\n * @returns The domain, or undefined if there is no active domain\n */\n// eslint-disable-next-line deprecation/deprecation\n\nexport function getActiveDomain() {\n logger.warn('Function `getActiveDomain` is deprecated and will be removed in a future version.');\n\n var sentry = getMainCarrier().__SENTRY__;\n\n return sentry && sentry.extensions && sentry.extensions.domain && sentry.extensions.domain.active;\n}\n/**\n * Try to read the hub from an active domain, and fallback to the registry if one doesn't exist\n * @returns discovered hub\n */\n\nfunction getHubFromActiveDomain(registry) {\n var _a, _b, _c;\n\n try {\n var activeDomain = (_c = (_b = (_a = getMainCarrier().__SENTRY__) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b.domain) === null || _c === void 0 ? void 0 : _c.active; // If there's no active domain, just return global hub\n\n if (!activeDomain) {\n return getHubFromCarrier(registry);\n } // If there's no hub on current domain, or it's an old API, assign a new one\n\n\n if (!hasHubOnCarrier(activeDomain) || getHubFromCarrier(activeDomain).isOlderThan(API_VERSION)) {\n var registryHubTopStack = getHubFromCarrier(registry).getStackTop();\n setHubOnCarrier(activeDomain, new Hub(registryHubTopStack.client, Scope.clone(registryHubTopStack.scope)));\n } // Return hub that lives on a domain\n\n\n return getHubFromCarrier(activeDomain);\n } catch (_Oo) {\n // Return hub that lives on a global object\n return getHubFromCarrier(registry);\n }\n}\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\n\n\nfunction hasHubOnCarrier(carrier) {\n return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);\n}\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\n\n\nexport function getHubFromCarrier(carrier) {\n if (carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub) return carrier.__SENTRY__.hub;\n carrier.__SENTRY__ = carrier.__SENTRY__ || {};\n carrier.__SENTRY__.hub = new Hub();\n return carrier.__SENTRY__.hub;\n}\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n * @returns A boolean indicating success or failure\n */\n\nexport function setHubOnCarrier(carrier, hub) {\n if (!carrier) return false;\n carrier.__SENTRY__ = carrier.__SENTRY__ || {};\n carrier.__SENTRY__.hub = hub;\n return true;\n}","import { __read, __spread } from \"tslib\";\nimport { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub';\nimport { getEventDescription, isMatchingPattern, logger } from '@sentry/utils'; // \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\n\nvar DEFAULT_IGNORE_ERRORS = [/^Script error\\.?$/, /^Javascript error: Script error\\.? on line 0$/];\n/** Inbound filters configurable by the user */\n\nvar InboundFilters =\n/** @class */\nfunction () {\n function InboundFilters(_options) {\n if (_options === void 0) {\n _options = {};\n }\n\n this._options = _options;\n /**\n * @inheritDoc\n */\n\n this.name = InboundFilters.id;\n }\n /**\n * @inheritDoc\n */\n\n\n InboundFilters.prototype.setupOnce = function () {\n addGlobalEventProcessor(function (event) {\n var hub = getCurrentHub();\n\n if (!hub) {\n return event;\n }\n\n var self = hub.getIntegration(InboundFilters);\n\n if (self) {\n var client = hub.getClient();\n var clientOptions = client ? client.getOptions() : {};\n\n var options = self._mergeOptions(clientOptions);\n\n if (self._shouldDropEvent(event, options)) {\n return null;\n }\n }\n\n return event;\n });\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._shouldDropEvent = function (event, options) {\n if (this._isSentryError(event, options)) {\n logger.warn(\"Event dropped due to being internal Sentry Error.\\nEvent: \" + getEventDescription(event));\n return true;\n }\n\n if (this._isIgnoredError(event, options)) {\n logger.warn(\"Event dropped due to being matched by `ignoreErrors` option.\\nEvent: \" + getEventDescription(event));\n return true;\n }\n\n if (this._isDeniedUrl(event, options)) {\n logger.warn(\"Event dropped due to being matched by `denyUrls` option.\\nEvent: \" + getEventDescription(event) + \".\\nUrl: \" + this._getEventFilterUrl(event));\n return true;\n }\n\n if (!this._isAllowedUrl(event, options)) {\n logger.warn(\"Event dropped due to not being matched by `allowUrls` option.\\nEvent: \" + getEventDescription(event) + \".\\nUrl: \" + this._getEventFilterUrl(event));\n return true;\n }\n\n return false;\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._isSentryError = function (event, options) {\n if (!options.ignoreInternal) {\n return false;\n }\n\n try {\n return event && event.exception && event.exception.values && event.exception.values[0] && event.exception.values[0].type === 'SentryError' || false;\n } catch (_oO) {\n return false;\n }\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._isIgnoredError = function (event, options) {\n if (!options.ignoreErrors || !options.ignoreErrors.length) {\n return false;\n }\n\n return this._getPossibleEventMessages(event).some(function (message) {\n // Not sure why TypeScript complains here...\n return options.ignoreErrors.some(function (pattern) {\n return isMatchingPattern(message, pattern);\n });\n });\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._isDeniedUrl = function (event, options) {\n // TODO: Use Glob instead?\n if (!options.denyUrls || !options.denyUrls.length) {\n return false;\n }\n\n var url = this._getEventFilterUrl(event);\n\n return !url ? false : options.denyUrls.some(function (pattern) {\n return isMatchingPattern(url, pattern);\n });\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._isAllowedUrl = function (event, options) {\n // TODO: Use Glob instead?\n if (!options.allowUrls || !options.allowUrls.length) {\n return true;\n }\n\n var url = this._getEventFilterUrl(event);\n\n return !url ? true : options.allowUrls.some(function (pattern) {\n return isMatchingPattern(url, pattern);\n });\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._mergeOptions = function (clientOptions) {\n if (clientOptions === void 0) {\n clientOptions = {};\n }\n\n return {\n allowUrls: __spread(this._options.whitelistUrls || [], this._options.allowUrls || [], clientOptions.whitelistUrls || [], clientOptions.allowUrls || []),\n denyUrls: __spread(this._options.blacklistUrls || [], this._options.denyUrls || [], clientOptions.blacklistUrls || [], clientOptions.denyUrls || []),\n ignoreErrors: __spread(this._options.ignoreErrors || [], clientOptions.ignoreErrors || [], DEFAULT_IGNORE_ERRORS),\n ignoreInternal: typeof this._options.ignoreInternal !== 'undefined' ? this._options.ignoreInternal : true\n };\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._getPossibleEventMessages = function (event) {\n if (event.message) {\n return [event.message];\n }\n\n if (event.exception) {\n try {\n var _a = event.exception.values && event.exception.values[0] || {},\n _b = _a.type,\n type = _b === void 0 ? '' : _b,\n _c = _a.value,\n value = _c === void 0 ? '' : _c;\n\n return [\"\" + value, type + \": \" + value];\n } catch (oO) {\n logger.error(\"Cannot extract message for event \" + getEventDescription(event));\n return [];\n }\n }\n\n return [];\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._getEventFilterUrl = function (event) {\n try {\n if (event.stacktrace) {\n var frames_1 = event.stacktrace.frames;\n return frames_1 && frames_1[frames_1.length - 1].filename || null;\n }\n\n if (event.exception) {\n var frames_2 = event.exception.values && event.exception.values[0].stacktrace && event.exception.values[0].stacktrace.frames;\n return frames_2 && frames_2[frames_2.length - 1].filename || null;\n }\n\n return null;\n } catch (oO) {\n logger.error(\"Cannot extract url for event \" + getEventDescription(event));\n return null;\n }\n };\n /**\n * @inheritDoc\n */\n\n\n InboundFilters.id = 'InboundFilters';\n return InboundFilters;\n}();\n\nexport { InboundFilters };","import { logger } from './logger';\nimport { getGlobalObject } from './misc';\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsErrorEvent() {\n try {\n new ErrorEvent('');\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsDOMError() {\n try {\n // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n // 1 argument required, but only 0 present.\n // @ts-ignore It really needs 1 argument, not 0.\n new DOMError('');\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsDOMException() {\n try {\n new DOMException('');\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsFetch() {\n if (!('fetch' in getGlobalObject())) {\n return false;\n }\n\n try {\n new Headers();\n new Request('');\n new Response();\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * isNativeFetch checks if the given function is a native implementation of fetch()\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\n\nfunction isNativeFetch(func) {\n return func && /^function fetch\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\n\n\nexport function supportsNativeFetch() {\n if (!supportsFetch()) {\n return false;\n }\n\n var global = getGlobalObject(); // Fast path to avoid DOM I/O\n // eslint-disable-next-line @typescript-eslint/unbound-method\n\n if (isNativeFetch(global.fetch)) {\n return true;\n } // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n // so create a \"pure\" iframe to see if that has native fetch\n\n\n var result = false;\n var doc = global.document; // eslint-disable-next-line deprecation/deprecation\n\n if (doc && typeof doc.createElement === \"function\") {\n try {\n var sandbox = doc.createElement('iframe');\n sandbox.hidden = true;\n doc.head.appendChild(sandbox);\n\n if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n result = isNativeFetch(sandbox.contentWindow.fetch);\n }\n\n doc.head.removeChild(sandbox);\n } catch (err) {\n logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n }\n }\n\n return result;\n}\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsReportingObserver() {\n return 'ReportingObserver' in getGlobalObject();\n}\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsReferrerPolicy() {\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default\n // https://caniuse.com/#feat=referrer-policy\n // It doesn't. And it throw exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n if (!supportsFetch()) {\n return false;\n }\n\n try {\n new Request('_', {\n referrerPolicy: 'origin'\n });\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsHistory() {\n // NOTE: in Chrome App environment, touching history.pushState, *even inside\n // a try/catch block*, will cause Chrome to output an error to console.error\n // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n var global = getGlobalObject();\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n var chrome = global.chrome;\n var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\n var hasHistoryApi = 'history' in global && !!global.history.pushState && !!global.history.replaceState;\n return !isChromePackagedApp && hasHistoryApi;\n}","import { __assign, __values } from \"tslib\";\nimport { isInstanceOf, isString } from './is';\nimport { logger } from './logger';\nimport { getGlobalObject } from './misc';\nimport { fill } from './object';\nimport { getFunctionName } from './stacktrace';\nimport { supportsHistory, supportsNativeFetch } from './supports';\nvar global = getGlobalObject();\n/**\n * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc.\n * - Console API\n * - Fetch API\n * - XHR API\n * - History API\n * - DOM API (click/typing)\n * - Error API\n * - UnhandledRejection API\n */\n\nvar handlers = {};\nvar instrumented = {};\n/** Instruments given API */\n\nfunction instrument(type) {\n if (instrumented[type]) {\n return;\n }\n\n instrumented[type] = true;\n\n switch (type) {\n case 'console':\n instrumentConsole();\n break;\n\n case 'dom':\n instrumentDOM();\n break;\n\n case 'xhr':\n instrumentXHR();\n break;\n\n case 'fetch':\n instrumentFetch();\n break;\n\n case 'history':\n instrumentHistory();\n break;\n\n case 'error':\n instrumentError();\n break;\n\n case 'unhandledrejection':\n instrumentUnhandledRejection();\n break;\n\n default:\n logger.warn('unknown instrumentation type:', type);\n }\n}\n/**\n * Add handler that will be called when given type of instrumentation triggers.\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\n\n\nexport function addInstrumentationHandler(handler) {\n if (!handler || typeof handler.type !== 'string' || typeof handler.callback !== 'function') {\n return;\n }\n\n handlers[handler.type] = handlers[handler.type] || [];\n handlers[handler.type].push(handler.callback);\n instrument(handler.type);\n}\n/** JSDoc */\n\nfunction triggerHandlers(type, data) {\n var e_1, _a;\n\n if (!type || !handlers[type]) {\n return;\n }\n\n try {\n for (var _b = __values(handlers[type] || []), _c = _b.next(); !_c.done; _c = _b.next()) {\n var handler = _c.value;\n\n try {\n handler(data);\n } catch (e) {\n logger.error(\"Error while triggering instrumentation handler.\\nType: \" + type + \"\\nName: \" + getFunctionName(handler) + \"\\nError: \" + e);\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b[\"return\"])) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n}\n/** JSDoc */\n\n\nfunction instrumentConsole() {\n if (!('console' in global)) {\n return;\n }\n\n ['debug', 'info', 'warn', 'error', 'log', 'assert'].forEach(function (level) {\n if (!(level in global.console)) {\n return;\n }\n\n fill(global.console, level, function (originalConsoleLevel) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n triggerHandlers('console', {\n args: args,\n level: level\n }); // this fails for some browsers. :(\n\n if (originalConsoleLevel) {\n Function.prototype.apply.call(originalConsoleLevel, global.console, args);\n }\n };\n });\n });\n}\n/** JSDoc */\n\n\nfunction instrumentFetch() {\n if (!supportsNativeFetch()) {\n return;\n }\n\n fill(global, 'fetch', function (originalFetch) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var handlerData = {\n args: args,\n fetchData: {\n method: getFetchMethod(args),\n url: getFetchUrl(args)\n },\n startTimestamp: Date.now()\n };\n triggerHandlers('fetch', __assign({}, handlerData)); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\n return originalFetch.apply(global, args).then(function (response) {\n triggerHandlers('fetch', __assign(__assign({}, handlerData), {\n endTimestamp: Date.now(),\n response: response\n }));\n return response;\n }, function (error) {\n triggerHandlers('fetch', __assign(__assign({}, handlerData), {\n endTimestamp: Date.now(),\n error: error\n })); // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n // it means the sentry.javascript SDK caught an error invoking your application code.\n // This is expected behavior and NOT indicative of a bug with sentry.javascript.\n\n throw error;\n });\n };\n });\n}\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/** Extract `method` from fetch call arguments */\n\n\nfunction getFetchMethod(fetchArgs) {\n if (fetchArgs === void 0) {\n fetchArgs = [];\n }\n\n if ('Request' in global && isInstanceOf(fetchArgs[0], Request) && fetchArgs[0].method) {\n return String(fetchArgs[0].method).toUpperCase();\n }\n\n if (fetchArgs[1] && fetchArgs[1].method) {\n return String(fetchArgs[1].method).toUpperCase();\n }\n\n return 'GET';\n}\n/** Extract `url` from fetch call arguments */\n\n\nfunction getFetchUrl(fetchArgs) {\n if (fetchArgs === void 0) {\n fetchArgs = [];\n }\n\n if (typeof fetchArgs[0] === 'string') {\n return fetchArgs[0];\n }\n\n if ('Request' in global && isInstanceOf(fetchArgs[0], Request)) {\n return fetchArgs[0].url;\n }\n\n return String(fetchArgs[0]);\n}\n/* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\n/** JSDoc */\n\n\nfunction instrumentXHR() {\n if (!('XMLHttpRequest' in global)) {\n return;\n } // Poor man's implementation of ES6 `Map`, tracking and keeping in sync key and value separately.\n\n\n var requestKeys = [];\n var requestValues = [];\n var xhrproto = XMLHttpRequest.prototype;\n fill(xhrproto, 'open', function (originalOpen) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n } // eslint-disable-next-line @typescript-eslint/no-this-alias\n\n\n var xhr = this;\n var url = args[1];\n xhr.__sentry_xhr__ = {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n method: isString(args[0]) ? args[0].toUpperCase() : args[0],\n url: args[1]\n }; // if Sentry key appears in URL, don't capture it as a request\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\n if (isString(url) && xhr.__sentry_xhr__.method === 'POST' && url.match(/sentry_key/)) {\n xhr.__sentry_own_request__ = true;\n }\n\n var onreadystatechangeHandler = function onreadystatechangeHandler() {\n if (xhr.readyState === 4) {\n try {\n // touching statusCode in some platforms throws\n // an exception\n if (xhr.__sentry_xhr__) {\n xhr.__sentry_xhr__.status_code = xhr.status;\n }\n } catch (e) {\n /* do nothing */\n }\n\n try {\n var requestPos = requestKeys.indexOf(xhr);\n\n if (requestPos !== -1) {\n // Make sure to pop both key and value to keep it in sync.\n requestKeys.splice(requestPos);\n var args_1 = requestValues.splice(requestPos)[0];\n\n if (xhr.__sentry_xhr__ && args_1[0] !== undefined) {\n xhr.__sentry_xhr__.body = args_1[0];\n }\n }\n } catch (e) {\n /* do nothing */\n }\n\n triggerHandlers('xhr', {\n args: args,\n endTimestamp: Date.now(),\n startTimestamp: Date.now(),\n xhr: xhr\n });\n }\n };\n\n if ('onreadystatechange' in xhr && typeof xhr.onreadystatechange === 'function') {\n fill(xhr, 'onreadystatechange', function (original) {\n return function () {\n var readyStateArgs = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n readyStateArgs[_i] = arguments[_i];\n }\n\n onreadystatechangeHandler();\n return original.apply(xhr, readyStateArgs);\n };\n });\n } else {\n xhr.addEventListener('readystatechange', onreadystatechangeHandler);\n }\n\n return originalOpen.apply(xhr, args);\n };\n });\n fill(xhrproto, 'send', function (originalSend) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n requestKeys.push(this);\n requestValues.push(args);\n triggerHandlers('xhr', {\n args: args,\n startTimestamp: Date.now(),\n xhr: this\n });\n return originalSend.apply(this, args);\n };\n });\n}\n\nvar lastHref;\n/** JSDoc */\n\nfunction instrumentHistory() {\n if (!supportsHistory()) {\n return;\n }\n\n var oldOnPopState = global.onpopstate;\n\n global.onpopstate = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var to = global.location.href; // keep track of the current URL state, as we always receive only the updated state\n\n var from = lastHref;\n lastHref = to;\n triggerHandlers('history', {\n from: from,\n to: to\n });\n\n if (oldOnPopState) {\n return oldOnPopState.apply(this, args);\n }\n };\n /** @hidden */\n\n\n function historyReplacementFunction(originalHistoryFunction) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var url = args.length > 2 ? args[2] : undefined;\n\n if (url) {\n // coerce to string (this is what pushState does)\n var from = lastHref;\n var to = String(url); // keep track of the current URL state, as we always receive only the updated state\n\n lastHref = to;\n triggerHandlers('history', {\n from: from,\n to: to\n });\n }\n\n return originalHistoryFunction.apply(this, args);\n };\n }\n\n fill(global.history, 'pushState', historyReplacementFunction);\n fill(global.history, 'replaceState', historyReplacementFunction);\n}\n\nvar debounceDuration = 1000;\nvar debounceTimerID;\nvar lastCapturedEvent;\n/**\n * Decide whether the current event should finish the debounce of previously captured one.\n * @param previous previously captured event\n * @param current event to be captured\n */\n\nfunction shouldShortcircuitPreviousDebounce(previous, current) {\n // If there was no previous event, it should always be swapped for the new one.\n if (!previous) {\n return true;\n } // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.\n\n\n if (previous.type !== current.type) {\n return true;\n }\n\n try {\n // If both events have the same type, it's still possible that actions were performed on different targets.\n // e.g. 2 clicks on different buttons.\n if (previous.target !== current.target) {\n return true;\n }\n } catch (e) {// just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n } // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_\n // to which an event listener was attached), we treat them as the same action, as we want to capture\n // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.\n\n\n return false;\n}\n/**\n * Decide whether an event should be captured.\n * @param event event to be captured\n */\n\n\nfunction shouldSkipDOMEvent(event) {\n // We are only interested in filtering `keypress` events for now.\n if (event.type !== 'keypress') {\n return false;\n }\n\n try {\n var target = event.target;\n\n if (!target || !target.tagName) {\n return true;\n } // Only consider keypress events on actual input elements. This will disregard keypresses targeting body\n // e.g.tabbing through elements, hotkeys, etc.\n\n\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n return false;\n }\n } catch (e) {// just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n }\n\n return true;\n}\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n * @param handler function that will be triggered\n * @param globalListener indicates whether event was captured by the global event listener\n * @returns wrapped breadcrumb events handler\n * @hidden\n */\n\n\nfunction makeDOMEventHandler(handler, globalListener) {\n if (globalListener === void 0) {\n globalListener = false;\n }\n\n return function (event) {\n // It's possible this handler might trigger multiple times for the same\n // event (e.g. event propagation through node ancestors).\n // Ignore if we've already captured that event.\n if (!event || lastCapturedEvent === event) {\n return;\n } // We always want to skip _some_ events.\n\n\n if (shouldSkipDOMEvent(event)) {\n return;\n }\n\n var name = event.type === 'keypress' ? 'input' : event.type; // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons.\n\n if (debounceTimerID === undefined) {\n handler({\n event: event,\n name: name,\n global: globalListener\n });\n lastCapturedEvent = event;\n } // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one.\n // If that's the case, emit the previous event and store locally the newly-captured DOM event.\n else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) {\n handler({\n event: event,\n name: name,\n global: globalListener\n });\n lastCapturedEvent = event;\n } // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.\n\n\n clearTimeout(debounceTimerID);\n debounceTimerID = global.setTimeout(function () {\n debounceTimerID = undefined;\n }, debounceDuration);\n };\n}\n/** JSDoc */\n\n\nfunction instrumentDOM() {\n if (!('document' in global)) {\n return;\n } // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom\n // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before\n // we instrument `addEventListener` so that we don't end up attaching this handler twice.\n\n\n var triggerDOMHandler = triggerHandlers.bind(null, 'dom');\n var globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);\n global.document.addEventListener('click', globalDOMEventHandler, false);\n global.document.addEventListener('keypress', globalDOMEventHandler, false); // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled\n // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That\n // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler\n // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still\n // guaranteed to fire at least once.)\n\n ['EventTarget', 'Node'].forEach(function (target) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n var proto = global[target] && global[target].prototype; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (originalAddEventListener) {\n return function (type, listener, options) {\n if (type === 'click' || type == 'keypress') {\n try {\n var el = this;\n var handlers_1 = el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {};\n var handlerForType = handlers_1[type] = handlers_1[type] || {\n refCount: 0\n };\n\n if (!handlerForType.handler) {\n var handler = makeDOMEventHandler(triggerDOMHandler);\n handlerForType.handler = handler;\n originalAddEventListener.call(this, type, handler, options);\n }\n\n handlerForType.refCount += 1;\n } catch (e) {// Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalAddEventListener.call(this, type, listener, options);\n };\n });\n fill(proto, 'removeEventListener', function (originalRemoveEventListener) {\n return function (type, listener, options) {\n if (type === 'click' || type == 'keypress') {\n try {\n var el = this;\n var handlers_2 = el.__sentry_instrumentation_handlers__ || {};\n var handlerForType = handlers_2[type];\n\n if (handlerForType) {\n handlerForType.refCount -= 1; // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.\n\n if (handlerForType.refCount <= 0) {\n originalRemoveEventListener.call(this, type, handlerForType.handler, options);\n handlerForType.handler = undefined;\n delete handlers_2[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n } // If there are no longer any custom handlers of any type on this element, cleanup everything.\n\n\n if (Object.keys(handlers_2).length === 0) {\n delete el.__sentry_instrumentation_handlers__;\n }\n }\n } catch (e) {// Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalRemoveEventListener.call(this, type, listener, options);\n };\n });\n });\n}\n\nvar _oldOnErrorHandler = null;\n/** JSDoc */\n\nfunction instrumentError() {\n _oldOnErrorHandler = global.onerror;\n\n global.onerror = function (msg, url, line, column, error) {\n triggerHandlers('error', {\n column: column,\n error: error,\n line: line,\n msg: msg,\n url: url\n });\n\n if (_oldOnErrorHandler) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnErrorHandler.apply(this, arguments);\n }\n\n return false;\n };\n}\n\nvar _oldOnUnhandledRejectionHandler = null;\n/** JSDoc */\n\nfunction instrumentUnhandledRejection() {\n _oldOnUnhandledRejectionHandler = global.onunhandledrejection;\n\n global.onunhandledrejection = function (e) {\n triggerHandlers('unhandledrejection', e);\n\n if (_oldOnUnhandledRejectionHandler) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n }\n\n return true;\n };\n}","export var setPrototypeOf = Object.setPrototypeOf || ({\n __proto__: []\n} instanceof Array ? setProtoOf : mixinProperties);\n/**\n * setPrototypeOf polyfill using __proto__\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\n\nfunction setProtoOf(obj, proto) {\n // @ts-ignore __proto__ does not exist on obj\n obj.__proto__ = proto;\n return obj;\n}\n/**\n * setPrototypeOf polyfill using mixin\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\n\n\nfunction mixinProperties(obj, proto) {\n for (var prop in proto) {\n // eslint-disable-next-line no-prototype-builtins\n if (!obj.hasOwnProperty(prop)) {\n // @ts-ignore typescript complains about indexing so we remove\n obj[prop] = proto[prop];\n }\n }\n\n return obj;\n}","import { __extends } from \"tslib\";\nimport { setPrototypeOf } from './polyfill';\n/** An error emitted by Sentry SDKs and related utilities. */\n\nvar SentryError =\n/** @class */\nfunction (_super) {\n __extends(SentryError, _super);\n\n function SentryError(message) {\n var _newTarget = this.constructor;\n\n var _this = _super.call(this, message) || this;\n\n _this.message = message;\n _this.name = _newTarget.prototype.constructor.name;\n setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n\n return SentryError;\n}(Error);\n\nexport { SentryError };","import { __read } from \"tslib\";\nimport { SentryError } from './error';\n/** Regular expression used to parse a Dsn. */\n\nvar DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+))?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n/** Error message */\n\nvar ERROR_MESSAGE = 'Invalid Dsn';\n/** The Sentry Dsn, identifying a Sentry instance and project. */\n\nvar Dsn =\n/** @class */\nfunction () {\n /** Creates a new Dsn component */\n function Dsn(from) {\n if (typeof from === 'string') {\n this._fromString(from);\n } else {\n this._fromComponents(from);\n }\n\n this._validate();\n }\n /**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\n\n\n Dsn.prototype.toString = function (withPassword) {\n if (withPassword === void 0) {\n withPassword = false;\n }\n\n var _a = this,\n host = _a.host,\n path = _a.path,\n pass = _a.pass,\n port = _a.port,\n projectId = _a.projectId,\n protocol = _a.protocol,\n publicKey = _a.publicKey;\n\n return protocol + \"://\" + publicKey + (withPassword && pass ? \":\" + pass : '') + (\"@\" + host + (port ? \":\" + port : '') + \"/\" + (path ? path + \"/\" : path) + projectId);\n };\n /** Parses a string into this Dsn. */\n\n\n Dsn.prototype._fromString = function (str) {\n var match = DSN_REGEX.exec(str);\n\n if (!match) {\n throw new SentryError(ERROR_MESSAGE);\n }\n\n var _a = __read(match.slice(1), 6),\n protocol = _a[0],\n publicKey = _a[1],\n _b = _a[2],\n pass = _b === void 0 ? '' : _b,\n host = _a[3],\n _c = _a[4],\n port = _c === void 0 ? '' : _c,\n lastPath = _a[5];\n\n var path = '';\n var projectId = lastPath;\n var split = projectId.split('/');\n\n if (split.length > 1) {\n path = split.slice(0, -1).join('/');\n projectId = split.pop();\n }\n\n if (projectId) {\n var projectMatch = projectId.match(/^\\d+/);\n\n if (projectMatch) {\n projectId = projectMatch[0];\n }\n }\n\n this._fromComponents({\n host: host,\n pass: pass,\n path: path,\n projectId: projectId,\n port: port,\n protocol: protocol,\n publicKey: publicKey\n });\n };\n /** Maps Dsn components into this instance. */\n\n\n Dsn.prototype._fromComponents = function (components) {\n // TODO this is for backwards compatibility, and can be removed in a future version\n if ('user' in components && !('publicKey' in components)) {\n components.publicKey = components.user;\n }\n\n this.user = components.publicKey || '';\n this.protocol = components.protocol;\n this.publicKey = components.publicKey || '';\n this.pass = components.pass || '';\n this.host = components.host;\n this.port = components.port || '';\n this.path = components.path || '';\n this.projectId = components.projectId;\n };\n /** Validates this Dsn and throws on error. */\n\n\n Dsn.prototype._validate = function () {\n var _this = this;\n\n ['protocol', 'publicKey', 'host', 'projectId'].forEach(function (component) {\n if (!_this[component]) {\n throw new SentryError(ERROR_MESSAGE + \": \" + component + \" missing\");\n }\n });\n\n if (!this.projectId.match(/^\\d+$/)) {\n throw new SentryError(ERROR_MESSAGE + \": Invalid projectId \" + this.projectId);\n }\n\n if (this.protocol !== 'http' && this.protocol !== 'https') {\n throw new SentryError(ERROR_MESSAGE + \": Invalid protocol \" + this.protocol);\n }\n\n if (this.port && isNaN(parseInt(this.port, 10))) {\n throw new SentryError(ERROR_MESSAGE + \": Invalid port \" + this.port);\n }\n };\n\n return Dsn;\n}();\n\nexport { Dsn };","import { __read, __spread } from \"tslib\";\nimport { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub';\nimport { logger } from '@sentry/utils';\nexport var installedIntegrations = [];\n/** Gets integration to install */\n\nexport function getIntegrationsToSetup(options) {\n var defaultIntegrations = options.defaultIntegrations && __spread(options.defaultIntegrations) || [];\n var userIntegrations = options.integrations;\n var integrations = [];\n\n if (Array.isArray(userIntegrations)) {\n var userIntegrationsNames_1 = userIntegrations.map(function (i) {\n return i.name;\n });\n var pickedIntegrationsNames_1 = []; // Leave only unique default integrations, that were not overridden with provided user integrations\n\n defaultIntegrations.forEach(function (defaultIntegration) {\n if (userIntegrationsNames_1.indexOf(defaultIntegration.name) === -1 && pickedIntegrationsNames_1.indexOf(defaultIntegration.name) === -1) {\n integrations.push(defaultIntegration);\n pickedIntegrationsNames_1.push(defaultIntegration.name);\n }\n }); // Don't add same user integration twice\n\n userIntegrations.forEach(function (userIntegration) {\n if (pickedIntegrationsNames_1.indexOf(userIntegration.name) === -1) {\n integrations.push(userIntegration);\n pickedIntegrationsNames_1.push(userIntegration.name);\n }\n });\n } else if (typeof userIntegrations === 'function') {\n integrations = userIntegrations(defaultIntegrations);\n integrations = Array.isArray(integrations) ? integrations : [integrations];\n } else {\n integrations = __spread(defaultIntegrations);\n } // Make sure that if present, `Debug` integration will always run last\n\n\n var integrationsNames = integrations.map(function (i) {\n return i.name;\n });\n var alwaysLastToRun = 'Debug';\n\n if (integrationsNames.indexOf(alwaysLastToRun) !== -1) {\n integrations.push.apply(integrations, __spread(integrations.splice(integrationsNames.indexOf(alwaysLastToRun), 1)));\n }\n\n return integrations;\n}\n/** Setup given integration */\n\nexport function setupIntegration(integration) {\n if (installedIntegrations.indexOf(integration.name) !== -1) {\n return;\n }\n\n integration.setupOnce(addGlobalEventProcessor, getCurrentHub);\n installedIntegrations.push(integration.name);\n logger.log(\"Integration installed: \" + integration.name);\n}\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\n\nexport function setupIntegrations(options) {\n var integrations = {};\n getIntegrationsToSetup(options).forEach(function (integration) {\n integrations[integration.name] = integration;\n setupIntegration(integration);\n });\n return integrations;\n}","import { __assign, __values } from \"tslib\";\n/* eslint-disable max-lines */\n\nimport { Scope } from '@sentry/hub';\nimport { SessionStatus } from '@sentry/types';\nimport { dateTimestampInSeconds, Dsn, isPrimitive, isThenable, logger, normalize, SentryError, SyncPromise, truncate, uuid4 } from '@sentry/utils';\nimport { setupIntegrations } from './integration';\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding backend constructor and options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}. Also, the Backend instance is available via\n * {@link Client.getBackend}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event via the backend, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient {\n * public constructor(options: NodeOptions) {\n * super(NodeBackend, options);\n * }\n *\n * // ...\n * }\n */\n\nvar BaseClient =\n/** @class */\nfunction () {\n /**\n * Initializes this client instance.\n *\n * @param backendClass A constructor function to create the backend.\n * @param options Options for the client.\n */\n function BaseClient(backendClass, options) {\n /** Array of used integrations. */\n this._integrations = {};\n /** Number of call being processed */\n\n this._processing = 0;\n this._backend = new backendClass(options);\n this._options = options;\n\n if (options.dsn) {\n this._dsn = new Dsn(options.dsn);\n }\n }\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n\n BaseClient.prototype.captureException = function (exception, hint, scope) {\n var _this = this;\n\n var eventId = hint && hint.event_id;\n\n this._process(this._getBackend().eventFromException(exception, hint).then(function (event) {\n return _this._captureEvent(event, hint, scope);\n }).then(function (result) {\n eventId = result;\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.captureMessage = function (message, level, hint, scope) {\n var _this = this;\n\n var eventId = hint && hint.event_id;\n var promisedEvent = isPrimitive(message) ? this._getBackend().eventFromMessage(String(message), level, hint) : this._getBackend().eventFromException(message, hint);\n\n this._process(promisedEvent.then(function (event) {\n return _this._captureEvent(event, hint, scope);\n }).then(function (result) {\n eventId = result;\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.captureEvent = function (event, hint, scope) {\n var eventId = hint && hint.event_id;\n\n this._process(this._captureEvent(event, hint, scope).then(function (result) {\n eventId = result;\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.captureSession = function (session) {\n if (!session.release) {\n logger.warn('Discarded session because of missing release');\n } else {\n this._sendSession(session); // After sending, we set init false to inidcate it's not the first occurence\n\n\n session.update({\n init: false\n });\n }\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.getDsn = function () {\n return this._dsn;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.getOptions = function () {\n return this._options;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.flush = function (timeout) {\n var _this = this;\n\n return this._isClientProcessing(timeout).then(function (ready) {\n return _this._getBackend().getTransport().close(timeout).then(function (transportFlushed) {\n return ready && transportFlushed;\n });\n });\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.close = function (timeout) {\n var _this = this;\n\n return this.flush(timeout).then(function (result) {\n _this.getOptions().enabled = false;\n return result;\n });\n };\n /**\n * Sets up the integrations\n */\n\n\n BaseClient.prototype.setupIntegrations = function () {\n if (this._isEnabled()) {\n this._integrations = setupIntegrations(this._options);\n }\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.getIntegration = function (integration) {\n try {\n return this._integrations[integration.id] || null;\n } catch (_oO) {\n logger.warn(\"Cannot retrieve integration \" + integration.id + \" from the current Client\");\n return null;\n }\n };\n /** Updates existing session based on the provided event */\n\n\n BaseClient.prototype._updateSessionFromEvent = function (session, event) {\n var e_1, _a;\n\n var crashed = false;\n var errored = false;\n var userAgent;\n var exceptions = event.exception && event.exception.values;\n\n if (exceptions) {\n errored = true;\n\n try {\n for (var exceptions_1 = __values(exceptions), exceptions_1_1 = exceptions_1.next(); !exceptions_1_1.done; exceptions_1_1 = exceptions_1.next()) {\n var ex = exceptions_1_1.value;\n var mechanism = ex.mechanism;\n\n if (mechanism && mechanism.handled === false) {\n crashed = true;\n break;\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (exceptions_1_1 && !exceptions_1_1.done && (_a = exceptions_1[\"return\"])) _a.call(exceptions_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n }\n\n var user = event.user;\n\n if (!session.userAgent) {\n var headers = event.request ? event.request.headers : {};\n\n for (var key in headers) {\n if (key.toLowerCase() === 'user-agent') {\n userAgent = headers[key];\n break;\n }\n }\n }\n\n session.update(__assign(__assign({}, crashed && {\n status: SessionStatus.Crashed\n }), {\n user: user,\n userAgent: userAgent,\n errors: session.errors + Number(errored || crashed)\n }));\n this.captureSession(session);\n };\n /** Deliver captured session to Sentry */\n\n\n BaseClient.prototype._sendSession = function (session) {\n this._getBackend().sendSession(session);\n };\n /** Waits for the client to be done with processing. */\n\n\n BaseClient.prototype._isClientProcessing = function (timeout) {\n var _this = this;\n\n return new SyncPromise(function (resolve) {\n var ticked = 0;\n var tick = 1;\n var interval = setInterval(function () {\n if (_this._processing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n };\n /** Returns the current backend. */\n\n\n BaseClient.prototype._getBackend = function () {\n return this._backend;\n };\n /** Determines whether this SDK is enabled and a valid Dsn is present. */\n\n\n BaseClient.prototype._isEnabled = function () {\n return this.getOptions().enabled !== false && this._dsn !== undefined;\n };\n /**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n */\n\n\n BaseClient.prototype._prepareEvent = function (event, scope, hint) {\n var _this = this;\n\n var _a = this.getOptions().normalizeDepth,\n normalizeDepth = _a === void 0 ? 3 : _a;\n\n var prepared = __assign(__assign({}, event), {\n event_id: event.event_id || (hint && hint.event_id ? hint.event_id : uuid4()),\n timestamp: event.timestamp || dateTimestampInSeconds()\n });\n\n this._applyClientOptions(prepared);\n\n this._applyIntegrationsMetadata(prepared); // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n\n\n var finalScope = scope;\n\n if (hint && hint.captureContext) {\n finalScope = Scope.clone(finalScope).update(hint.captureContext);\n } // We prepare the result here with a resolved Event.\n\n\n var result = SyncPromise.resolve(prepared); // This should be the last thing called, since we want that\n // {@link Hub.addEventProcessor} gets the finished prepared event.\n\n if (finalScope) {\n // In case we have a hub we reassign it.\n result = finalScope.applyToEvent(prepared, hint);\n }\n\n return result.then(function (evt) {\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return _this._normalizeEvent(evt, normalizeDepth);\n }\n\n return evt;\n });\n };\n /**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\n\n\n BaseClient.prototype._normalizeEvent = function (event, depth) {\n if (!event) {\n return null;\n }\n\n var normalized = __assign(__assign(__assign(__assign(__assign({}, event), event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(function (b) {\n return __assign(__assign({}, b), b.data && {\n data: normalize(b.data, depth)\n });\n })\n }), event.user && {\n user: normalize(event.user, depth)\n }), event.contexts && {\n contexts: normalize(event.contexts, depth)\n }), event.extra && {\n extra: normalize(event.extra, depth)\n }); // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n\n\n if (event.contexts && event.contexts.trace) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n normalized.contexts.trace = event.contexts.trace;\n }\n\n return normalized;\n };\n /**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\n\n\n BaseClient.prototype._applyClientOptions = function (event) {\n var options = this.getOptions();\n var environment = options.environment,\n release = options.release,\n dist = options.dist,\n _a = options.maxValueLength,\n maxValueLength = _a === void 0 ? 250 : _a;\n\n if (!('environment' in event)) {\n event.environment = 'environment' in options ? environment : 'production';\n }\n\n if (event.release === undefined && release !== undefined) {\n event.release = release;\n }\n\n if (event.dist === undefined && dist !== undefined) {\n event.dist = dist;\n }\n\n if (event.message) {\n event.message = truncate(event.message, maxValueLength);\n }\n\n var exception = event.exception && event.exception.values && event.exception.values[0];\n\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n var request = event.request;\n\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n };\n /**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\n\n\n BaseClient.prototype._applyIntegrationsMetadata = function (event) {\n var sdkInfo = event.sdk;\n var integrationsArray = Object.keys(this._integrations);\n\n if (sdkInfo && integrationsArray.length > 0) {\n sdkInfo.integrations = integrationsArray;\n }\n };\n /**\n * Tells the backend to send this event\n * @param event The Sentry event to send\n */\n\n\n BaseClient.prototype._sendEvent = function (event) {\n this._getBackend().sendEvent(event);\n };\n /**\n * Processes the event and logs an error in case of rejection\n * @param event\n * @param hint\n * @param scope\n */\n\n\n BaseClient.prototype._captureEvent = function (event, hint, scope) {\n return this._processEvent(event, hint, scope).then(function (finalEvent) {\n return finalEvent.event_id;\n }, function (reason) {\n logger.error(reason);\n return undefined;\n });\n };\n /**\n * Processes an event (either error or message) and sends it to Sentry.\n *\n * This also adds breadcrumbs and context information to the event. However,\n * platform specific meta data (such as the User's IP address) must be added\n * by the SDK implementor.\n *\n *\n * @param event The event to send to Sentry.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n */\n\n\n BaseClient.prototype._processEvent = function (event, hint, scope) {\n var _this = this; // eslint-disable-next-line @typescript-eslint/unbound-method\n\n\n var _a = this.getOptions(),\n beforeSend = _a.beforeSend,\n sampleRate = _a.sampleRate;\n\n if (!this._isEnabled()) {\n return SyncPromise.reject(new SentryError('SDK not enabled, will not send event.'));\n }\n\n var isTransaction = event.type === 'transaction'; // 1.0 === 100% events are sent\n // 0.0 === 0% events are sent\n // Sampling for transaction happens somewhere else\n\n if (!isTransaction && typeof sampleRate === 'number' && Math.random() > sampleRate) {\n return SyncPromise.reject(new SentryError(\"Discarding event because it's not included in the random sample (sampling rate = \" + sampleRate + \")\"));\n }\n\n return this._prepareEvent(event, scope, hint).then(function (prepared) {\n if (prepared === null) {\n throw new SentryError('An event processor returned null, will not send event.');\n }\n\n var isInternalException = hint && hint.data && hint.data.__sentry__ === true;\n\n if (isInternalException || isTransaction || !beforeSend) {\n return prepared;\n }\n\n var beforeSendResult = beforeSend(prepared, hint);\n\n if (typeof beforeSendResult === 'undefined') {\n throw new SentryError('`beforeSend` method has to return `null` or a valid event.');\n } else if (isThenable(beforeSendResult)) {\n return beforeSendResult.then(function (event) {\n return event;\n }, function (e) {\n throw new SentryError(\"beforeSend rejected with \" + e);\n });\n }\n\n return beforeSendResult;\n }).then(function (processedEvent) {\n if (processedEvent === null) {\n throw new SentryError('`beforeSend` returned `null`, will not send event.');\n }\n\n var session = scope && scope.getSession && scope.getSession();\n\n if (!isTransaction && session) {\n _this._updateSessionFromEvent(session, processedEvent);\n }\n\n _this._sendEvent(processedEvent);\n\n return processedEvent;\n }).then(null, function (reason) {\n if (reason instanceof SentryError) {\n throw reason;\n }\n\n _this.captureException(reason, {\n data: {\n __sentry__: true\n },\n originalException: reason\n });\n\n throw new SentryError(\"Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: \" + reason);\n });\n };\n /**\n * Occupies the client with processing and event\n */\n\n\n BaseClient.prototype._process = function (promise) {\n var _this = this;\n\n this._processing += 1;\n promise.then(function (value) {\n _this._processing -= 1;\n return value;\n }, function (reason) {\n _this._processing -= 1;\n return reason;\n });\n };\n\n return BaseClient;\n}();\n\nexport { BaseClient };","/** The status of an event. */\n// eslint-disable-next-line import/export\nexport var Status;\n\n(function (Status) {\n /** The status could not be determined. */\n Status[\"Unknown\"] = \"unknown\";\n /** The event was skipped due to configuration or callbacks. */\n\n Status[\"Skipped\"] = \"skipped\";\n /** The event was sent to Sentry successfully. */\n\n Status[\"Success\"] = \"success\";\n /** The client is currently rate limited and will try again later. */\n\n Status[\"RateLimit\"] = \"rate_limit\";\n /** The event could not be processed. */\n\n Status[\"Invalid\"] = \"invalid\";\n /** A server-side error ocurred during submission. */\n\n Status[\"Failed\"] = \"failed\";\n})(Status || (Status = {})); // eslint-disable-next-line @typescript-eslint/no-namespace, import/export\n\n\n(function (Status) {\n /**\n * Converts a HTTP status code into a {@link Status}.\n *\n * @param code The HTTP response status code.\n * @returns The send status or {@link Status.Unknown}.\n */\n function fromHttpCode(code) {\n if (code >= 200 && code < 300) {\n return Status.Success;\n }\n\n if (code === 429) {\n return Status.RateLimit;\n }\n\n if (code >= 400 && code < 500) {\n return Status.Invalid;\n }\n\n if (code >= 500) {\n return Status.Failed;\n }\n\n return Status.Unknown;\n }\n\n Status.fromHttpCode = fromHttpCode;\n})(Status || (Status = {}));","import { Status } from '@sentry/types';\nimport { SyncPromise } from '@sentry/utils';\n/** Noop transport */\n\nvar NoopTransport =\n/** @class */\nfunction () {\n function NoopTransport() {}\n /**\n * @inheritDoc\n */\n\n\n NoopTransport.prototype.sendEvent = function (_) {\n return SyncPromise.resolve({\n reason: \"NoopTransport: Event has been skipped because no Dsn is configured.\",\n status: Status.Skipped\n });\n };\n /**\n * @inheritDoc\n */\n\n\n NoopTransport.prototype.close = function (_) {\n return SyncPromise.resolve(true);\n };\n\n return NoopTransport;\n}();\n\nexport { NoopTransport };","/** JSDoc */\n// eslint-disable-next-line import/export\nexport var Severity;\n\n(function (Severity) {\n /** JSDoc */\n Severity[\"Fatal\"] = \"fatal\";\n /** JSDoc */\n\n Severity[\"Error\"] = \"error\";\n /** JSDoc */\n\n Severity[\"Warning\"] = \"warning\";\n /** JSDoc */\n\n Severity[\"Log\"] = \"log\";\n /** JSDoc */\n\n Severity[\"Info\"] = \"info\";\n /** JSDoc */\n\n Severity[\"Debug\"] = \"debug\";\n /** JSDoc */\n\n Severity[\"Critical\"] = \"critical\";\n})(Severity || (Severity = {})); // eslint-disable-next-line @typescript-eslint/no-namespace, import/export\n\n\n(function (Severity) {\n /**\n * Converts a string-based level into a {@link Severity}.\n *\n * @param level string representation of Severity\n * @returns Severity\n */\n function fromString(level) {\n switch (level) {\n case 'debug':\n return Severity.Debug;\n\n case 'info':\n return Severity.Info;\n\n case 'warn':\n case 'warning':\n return Severity.Warning;\n\n case 'error':\n return Severity.Error;\n\n case 'fatal':\n return Severity.Fatal;\n\n case 'critical':\n return Severity.Critical;\n\n case 'log':\n default:\n return Severity.Log;\n }\n }\n\n Severity.fromString = fromString;\n})(Severity || (Severity = {}));","import { logger, SentryError } from '@sentry/utils';\nimport { NoopTransport } from './transports/noop';\n/**\n * This is the base implemention of a Backend.\n * @hidden\n */\n\nvar BaseBackend =\n/** @class */\nfunction () {\n /** Creates a new backend instance. */\n function BaseBackend(options) {\n this._options = options;\n\n if (!this._options.dsn) {\n logger.warn('No DSN provided, backend will not do anything.');\n }\n\n this._transport = this._setupTransport();\n }\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n\n BaseBackend.prototype.eventFromException = function (_exception, _hint) {\n throw new SentryError('Backend has to implement `eventFromException` method');\n };\n /**\n * @inheritDoc\n */\n\n\n BaseBackend.prototype.eventFromMessage = function (_message, _level, _hint) {\n throw new SentryError('Backend has to implement `eventFromMessage` method');\n };\n /**\n * @inheritDoc\n */\n\n\n BaseBackend.prototype.sendEvent = function (event) {\n this._transport.sendEvent(event).then(null, function (reason) {\n logger.error(\"Error while sending event: \" + reason);\n });\n };\n /**\n * @inheritDoc\n */\n\n\n BaseBackend.prototype.sendSession = function (session) {\n if (!this._transport.sendSession) {\n logger.warn(\"Dropping session because custom transport doesn't implement sendSession\");\n return;\n }\n\n this._transport.sendSession(session).then(null, function (reason) {\n logger.error(\"Error while sending session: \" + reason);\n });\n };\n /**\n * @inheritDoc\n */\n\n\n BaseBackend.prototype.getTransport = function () {\n return this._transport;\n };\n /**\n * Sets up the transport so it can be used later to send requests.\n */\n\n\n BaseBackend.prototype._setupTransport = function () {\n return new NoopTransport();\n };\n\n return BaseBackend;\n}();\n\nexport { BaseBackend };","/**\n * This was originally forked from https://github.com/occ/TraceKit, but has since been\n * largely modified and is now maintained as part of Sentry JS SDK.\n */\nimport { __assign } from \"tslib\"; // global reference to slice\n\nvar UNKNOWN_FUNCTION = '?'; // Chromium based browsers: Chrome, Brave, new Opera, new Edge\n\nvar chrome = /^\\s*at (?:(.*?) ?\\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[-a-z]+:|.*bundle|\\/).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i; // gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\n\nvar gecko = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nvar winjs = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\nvar geckoEval = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\nvar chromeEval = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/; // Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\n\nvar reactMinifiedRegexp = /Minified React error #\\d+;/i;\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\nexport function computeStackTrace(ex) {\n var stack = null;\n var popSize = 0;\n\n if (ex) {\n if (typeof ex.framesToPop === 'number') {\n popSize = ex.framesToPop;\n } else if (reactMinifiedRegexp.test(ex.message)) {\n popSize = 1;\n }\n }\n\n try {\n // This must be tried first because Opera 10 *destroys*\n // its stacktrace property if you try to access the stack\n // property first!!\n stack = computeStackTraceFromStacktraceProp(ex);\n\n if (stack) {\n return popFrames(stack, popSize);\n }\n } catch (e) {// no-empty\n }\n\n try {\n stack = computeStackTraceFromStackProp(ex);\n\n if (stack) {\n return popFrames(stack, popSize);\n }\n } catch (e) {// no-empty\n }\n\n return {\n message: extractMessage(ex),\n name: ex && ex.name,\n stack: [],\n failed: true\n };\n}\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, complexity\n\nfunction computeStackTraceFromStackProp(ex) {\n if (!ex || !ex.stack) {\n return null;\n }\n\n var stack = [];\n var lines = ex.stack.split('\\n');\n var isEval;\n var submatch;\n var parts;\n var element;\n\n for (var i = 0; i < lines.length; ++i) {\n if (parts = chrome.exec(lines[i])) {\n var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n\n isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n if (isEval && (submatch = chromeEval.exec(parts[2]))) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n\n parts[3] = submatch[2]; // line\n\n parts[4] = submatch[3]; // column\n }\n\n element = {\n // working with the regexp above is super painful. it is quite a hack, but just stripping the `address at `\n // prefix here seems like the quickest solution for now.\n url: parts[2] && parts[2].indexOf('address at ') === 0 ? parts[2].substr('address at '.length) : parts[2],\n func: parts[1] || UNKNOWN_FUNCTION,\n args: isNative ? [parts[2]] : [],\n line: parts[3] ? +parts[3] : null,\n column: parts[4] ? +parts[4] : null\n };\n } else if (parts = winjs.exec(lines[i])) {\n element = {\n url: parts[2],\n func: parts[1] || UNKNOWN_FUNCTION,\n args: [],\n line: +parts[3],\n column: parts[4] ? +parts[4] : null\n };\n } else if (parts = gecko.exec(lines[i])) {\n isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n\n if (isEval && (submatch = geckoEval.exec(parts[3]))) {\n // throw out eval line/column and use top-most line number\n parts[1] = parts[1] || \"eval\";\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = ''; // no column when eval\n } else if (i === 0 && !parts[5] && ex.columnNumber !== void 0) {\n // FireFox uses this awesome columnNumber property for its top frame\n // Also note, Firefox's column number is 0-based and everything else expects 1-based,\n // so adding 1\n // NOTE: this hack doesn't work if top-most frame is eval\n stack[0].column = ex.columnNumber + 1;\n }\n\n element = {\n url: parts[3],\n func: parts[1] || UNKNOWN_FUNCTION,\n args: parts[2] ? parts[2].split(',') : [],\n line: parts[4] ? +parts[4] : null,\n column: parts[5] ? +parts[5] : null\n };\n } else {\n continue;\n }\n\n if (!element.func && element.line) {\n element.func = UNKNOWN_FUNCTION;\n }\n\n stack.push(element);\n }\n\n if (!stack.length) {\n return null;\n }\n\n return {\n message: extractMessage(ex),\n name: ex.name,\n stack: stack\n };\n}\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction computeStackTraceFromStacktraceProp(ex) {\n if (!ex || !ex.stacktrace) {\n return null;\n } // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n\n\n var stacktrace = ex.stacktrace;\n var opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n var opera11Regex = / line (\\d+), column (\\d+)\\s*(?:in (?:]+)>|([^)]+))\\((.*)\\))? in (.*):\\s*$/i;\n var lines = stacktrace.split('\\n');\n var stack = [];\n var parts;\n\n for (var line = 0; line < lines.length; line += 2) {\n var element = null;\n\n if (parts = opera10Regex.exec(lines[line])) {\n element = {\n url: parts[2],\n func: parts[3],\n args: [],\n line: +parts[1],\n column: null\n };\n } else if (parts = opera11Regex.exec(lines[line])) {\n element = {\n url: parts[6],\n func: parts[3] || parts[4],\n args: parts[5] ? parts[5].split(',') : [],\n line: +parts[1],\n column: +parts[2]\n };\n }\n\n if (element) {\n if (!element.func && element.line) {\n element.func = UNKNOWN_FUNCTION;\n }\n\n stack.push(element);\n }\n }\n\n if (!stack.length) {\n return null;\n }\n\n return {\n message: extractMessage(ex),\n name: ex.name,\n stack: stack\n };\n}\n/** Remove N number of frames from the stack */\n\n\nfunction popFrames(stacktrace, popSize) {\n try {\n return __assign(__assign({}, stacktrace), {\n stack: stacktrace.stack.slice(popSize)\n });\n } catch (e) {\n return stacktrace;\n }\n}\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction extractMessage(ex) {\n var message = ex && ex.message;\n\n if (!message) {\n return 'No error message';\n }\n\n if (message.error && typeof message.error.message === 'string') {\n return message.error.message;\n }\n\n return message;\n}","import { extractExceptionKeysForMessage, isEvent, normalizeToSize } from '@sentry/utils';\nimport { computeStackTrace } from './tracekit';\nvar STACKTRACE_LIMIT = 50;\n/**\n * This function creates an exception from an TraceKitStackTrace\n * @param stacktrace TraceKitStackTrace that will be converted to an exception\n * @hidden\n */\n\nexport function exceptionFromStacktrace(stacktrace) {\n var frames = prepareFramesForEvent(stacktrace.stack);\n var exception = {\n type: stacktrace.name,\n value: stacktrace.message\n };\n\n if (frames && frames.length) {\n exception.stacktrace = {\n frames: frames\n };\n }\n\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n/**\n * @hidden\n */\n\nexport function eventFromPlainObject(exception, syntheticException, rejection) {\n var event = {\n exception: {\n values: [{\n type: isEvent(exception) ? exception.constructor.name : rejection ? 'UnhandledRejection' : 'Error',\n value: \"Non-Error \" + (rejection ? 'promise rejection' : 'exception') + \" captured with keys: \" + extractExceptionKeysForMessage(exception)\n }]\n },\n extra: {\n __serialized__: normalizeToSize(exception)\n }\n };\n\n if (syntheticException) {\n var stacktrace = computeStackTrace(syntheticException);\n var frames_1 = prepareFramesForEvent(stacktrace.stack);\n event.stacktrace = {\n frames: frames_1\n };\n }\n\n return event;\n}\n/**\n * @hidden\n */\n\nexport function eventFromStacktrace(stacktrace) {\n var exception = exceptionFromStacktrace(stacktrace);\n return {\n exception: {\n values: [exception]\n }\n };\n}\n/**\n * @hidden\n */\n\nexport function prepareFramesForEvent(stack) {\n if (!stack || !stack.length) {\n return [];\n }\n\n var localStack = stack;\n var firstFrameFunction = localStack[0].func || '';\n var lastFrameFunction = localStack[localStack.length - 1].func || ''; // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n\n if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) {\n localStack = localStack.slice(1);\n } // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n\n\n if (lastFrameFunction.indexOf('sentryWrapped') !== -1) {\n localStack = localStack.slice(0, -1);\n } // The frame where the crash happened, should be the last entry in the array\n\n\n return localStack.slice(0, STACKTRACE_LIMIT).map(function (frame) {\n return {\n colno: frame.column === null ? undefined : frame.column,\n filename: frame.url || localStack[0].url,\n \"function\": frame.func || '?',\n in_app: true,\n lineno: frame.line === null ? undefined : frame.line\n };\n }).reverse();\n}","import { __assign } from \"tslib\";\nimport { Severity } from '@sentry/types';\nimport { addExceptionMechanism, addExceptionTypeValue, isDOMError, isDOMException, isError, isErrorEvent, isEvent, isPlainObject, SyncPromise } from '@sentry/utils';\nimport { eventFromPlainObject, eventFromStacktrace, prepareFramesForEvent } from './parsers';\nimport { computeStackTrace } from './tracekit';\n/**\n * Builds and Event from a Exception\n * @hidden\n */\n\nexport function eventFromException(options, exception, hint) {\n var syntheticException = hint && hint.syntheticException || undefined;\n var event = eventFromUnknownInput(exception, syntheticException, {\n attachStacktrace: options.attachStacktrace\n });\n addExceptionMechanism(event, {\n handled: true,\n type: 'generic'\n });\n event.level = Severity.Error;\n\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n\n return SyncPromise.resolve(event);\n}\n/**\n * Builds and Event from a Message\n * @hidden\n */\n\nexport function eventFromMessage(options, message, level, hint) {\n if (level === void 0) {\n level = Severity.Info;\n }\n\n var syntheticException = hint && hint.syntheticException || undefined;\n var event = eventFromString(message, syntheticException, {\n attachStacktrace: options.attachStacktrace\n });\n event.level = level;\n\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n\n return SyncPromise.resolve(event);\n}\n/**\n * @hidden\n */\n\nexport function eventFromUnknownInput(exception, syntheticException, options) {\n if (options === void 0) {\n options = {};\n }\n\n var event;\n\n if (isErrorEvent(exception) && exception.error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n var errorEvent = exception; // eslint-disable-next-line no-param-reassign\n\n exception = errorEvent.error;\n event = eventFromStacktrace(computeStackTrace(exception));\n return event;\n }\n\n if (isDOMError(exception) || isDOMException(exception)) {\n // If it is a DOMError or DOMException (which are legacy APIs, but still supported in some browsers)\n // then we just extract the name, code, and message, as they don't provide anything else\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n var domException = exception;\n var name_1 = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n var message = domException.message ? name_1 + \": \" + domException.message : name_1;\n event = eventFromString(message, syntheticException, options);\n addExceptionTypeValue(event, message);\n\n if ('code' in domException) {\n event.tags = __assign(__assign({}, event.tags), {\n 'DOMException.code': \"\" + domException.code\n });\n }\n\n return event;\n }\n\n if (isError(exception)) {\n // we have a real Error object, do nothing\n event = eventFromStacktrace(computeStackTrace(exception));\n return event;\n }\n\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it is plain Object or Event, serialize it manually and extract options\n // This will allow us to group events based on top-level keys\n // which is much better than creating new group when any key/value change\n var objectException = exception;\n event = eventFromPlainObject(objectException, syntheticException, options.rejection);\n addExceptionMechanism(event, {\n synthetic: true\n });\n return event;\n } // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n\n\n event = eventFromString(exception, syntheticException, options);\n addExceptionTypeValue(event, \"\" + exception, undefined);\n addExceptionMechanism(event, {\n synthetic: true\n });\n return event;\n}\n/**\n * @hidden\n */\n\nexport function eventFromString(input, syntheticException, options) {\n if (options === void 0) {\n options = {};\n }\n\n var event = {\n message: input\n };\n\n if (options.attachStacktrace && syntheticException) {\n var stacktrace = computeStackTrace(syntheticException);\n var frames_1 = prepareFramesForEvent(stacktrace.stack);\n event.stacktrace = {\n frames: frames_1\n };\n }\n\n return event;\n}","import { __assign, __read, __rest, __spread } from \"tslib\";\n/** Extract sdk info from from the API metadata */\n\nfunction getSdkMetadataForEnvelopeHeader(api) {\n if (!api.metadata || !api.metadata.sdk) {\n return;\n }\n\n var _a = api.metadata.sdk,\n name = _a.name,\n version = _a.version;\n return {\n name: name,\n version: version\n };\n}\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\n\n\nfunction enhanceEventWithSdkInfo(event, sdkInfo) {\n if (!sdkInfo) {\n return event;\n }\n\n event.sdk = event.sdk || {\n name: sdkInfo.name,\n version: sdkInfo.version\n };\n event.sdk.name = event.sdk.name || sdkInfo.name;\n event.sdk.version = event.sdk.version || sdkInfo.version;\n event.sdk.integrations = __spread(event.sdk.integrations || [], sdkInfo.integrations || []);\n event.sdk.packages = __spread(event.sdk.packages || [], sdkInfo.packages || []);\n return event;\n}\n/** Creates a SentryRequest from an event. */\n\n\nexport function sessionToSentryRequest(session, api) {\n var sdkInfo = getSdkMetadataForEnvelopeHeader(api);\n var envelopeHeaders = JSON.stringify(__assign({\n sent_at: new Date().toISOString()\n }, sdkInfo && {\n sdk: sdkInfo\n }));\n var itemHeaders = JSON.stringify({\n type: 'session'\n });\n return {\n body: envelopeHeaders + \"\\n\" + itemHeaders + \"\\n\" + JSON.stringify(session),\n type: 'session',\n url: api.getEnvelopeEndpointWithUrlEncodedAuth()\n };\n}\n/** Creates a SentryRequest from an event. */\n\nexport function eventToSentryRequest(event, api) {\n var sdkInfo = getSdkMetadataForEnvelopeHeader(api);\n var eventType = event.type || 'event';\n var useEnvelope = eventType === 'transaction';\n\n var _a = event.debug_meta || {},\n transactionSampling = _a.transactionSampling,\n metadata = __rest(_a, [\"transactionSampling\"]);\n\n var _b = transactionSampling || {},\n samplingMethod = _b.method,\n sampleRate = _b.rate;\n\n if (Object.keys(metadata).length === 0) {\n delete event.debug_meta;\n } else {\n event.debug_meta = metadata;\n }\n\n var req = {\n body: JSON.stringify(sdkInfo ? enhanceEventWithSdkInfo(event, api.metadata.sdk) : event),\n type: eventType,\n url: useEnvelope ? api.getEnvelopeEndpointWithUrlEncodedAuth() : api.getStoreEndpointWithUrlEncodedAuth()\n }; // https://develop.sentry.dev/sdk/envelopes/\n // Since we don't need to manipulate envelopes nor store them, there is no\n // exported concept of an Envelope with operations including serialization and\n // deserialization. Instead, we only implement a minimal subset of the spec to\n // serialize events inline here.\n\n if (useEnvelope) {\n var envelopeHeaders = JSON.stringify(__assign({\n event_id: event.event_id,\n sent_at: new Date().toISOString()\n }, sdkInfo && {\n sdk: sdkInfo\n }));\n var itemHeaders = JSON.stringify({\n type: event.type,\n // TODO: Right now, sampleRate may or may not be defined (it won't be in the cases of inheritance and\n // explicitly-set sampling decisions). Are we good with that?\n sample_rates: [{\n id: samplingMethod,\n rate: sampleRate\n }]\n }); // The trailing newline is optional. We intentionally don't send it to avoid\n // sending unnecessary bytes.\n //\n // const envelope = `${envelopeHeaders}\\n${itemHeaders}\\n${req.body}\\n`;\n\n var envelope = envelopeHeaders + \"\\n\" + itemHeaders + \"\\n\" + req.body;\n req.body = envelope;\n }\n\n return req;\n}","import { Dsn, urlEncode } from '@sentry/utils';\nvar SENTRY_API_VERSION = '7';\n/**\n * Helper class to provide urls, headers and metadata that can be used to form\n * different types of requests to Sentry endpoints.\n * Supports both envelopes and regular event requests.\n **/\n\nvar API =\n/** @class */\nfunction () {\n /** Create a new instance of API */\n function API(dsn, metadata) {\n if (metadata === void 0) {\n metadata = {};\n }\n\n this.dsn = dsn;\n this._dsnObject = new Dsn(dsn);\n this.metadata = metadata;\n }\n /** Returns the Dsn object. */\n\n\n API.prototype.getDsn = function () {\n return this._dsnObject;\n };\n /** Returns the prefix to construct Sentry ingestion API endpoints. */\n\n\n API.prototype.getBaseApiEndpoint = function () {\n var dsn = this._dsnObject;\n var protocol = dsn.protocol ? dsn.protocol + \":\" : '';\n var port = dsn.port ? \":\" + dsn.port : '';\n return protocol + \"//\" + dsn.host + port + (dsn.path ? \"/\" + dsn.path : '') + \"/api/\";\n };\n /** Returns the store endpoint URL. */\n\n\n API.prototype.getStoreEndpoint = function () {\n return this._getIngestEndpoint('store');\n };\n /**\n * Returns the store endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\n\n\n API.prototype.getStoreEndpointWithUrlEncodedAuth = function () {\n return this.getStoreEndpoint() + \"?\" + this._encodedAuth();\n };\n /**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\n\n\n API.prototype.getEnvelopeEndpointWithUrlEncodedAuth = function () {\n return this._getEnvelopeEndpoint() + \"?\" + this._encodedAuth();\n };\n /** Returns only the path component for the store endpoint. */\n\n\n API.prototype.getStoreEndpointPath = function () {\n var dsn = this._dsnObject;\n return (dsn.path ? \"/\" + dsn.path : '') + \"/api/\" + dsn.projectId + \"/store/\";\n };\n /**\n * Returns an object that can be used in request headers.\n * This is needed for node and the old /store endpoint in sentry\n */\n\n\n API.prototype.getRequestHeaders = function (clientName, clientVersion) {\n // CHANGE THIS to use metadata but keep clientName and clientVersion compatible\n var dsn = this._dsnObject;\n var header = [\"Sentry sentry_version=\" + SENTRY_API_VERSION];\n header.push(\"sentry_client=\" + clientName + \"/\" + clientVersion);\n header.push(\"sentry_key=\" + dsn.publicKey);\n\n if (dsn.pass) {\n header.push(\"sentry_secret=\" + dsn.pass);\n }\n\n return {\n 'Content-Type': 'application/json',\n 'X-Sentry-Auth': header.join(', ')\n };\n };\n /** Returns the url to the report dialog endpoint. */\n\n\n API.prototype.getReportDialogEndpoint = function (dialogOptions) {\n if (dialogOptions === void 0) {\n dialogOptions = {};\n }\n\n var dsn = this._dsnObject;\n var endpoint = this.getBaseApiEndpoint() + \"embed/error-page/\";\n var encodedOptions = [];\n encodedOptions.push(\"dsn=\" + dsn.toString());\n\n for (var key in dialogOptions) {\n if (key === 'dsn') {\n continue;\n }\n\n if (key === 'user') {\n if (!dialogOptions.user) {\n continue;\n }\n\n if (dialogOptions.user.name) {\n encodedOptions.push(\"name=\" + encodeURIComponent(dialogOptions.user.name));\n }\n\n if (dialogOptions.user.email) {\n encodedOptions.push(\"email=\" + encodeURIComponent(dialogOptions.user.email));\n }\n } else {\n encodedOptions.push(encodeURIComponent(key) + \"=\" + encodeURIComponent(dialogOptions[key]));\n }\n }\n\n if (encodedOptions.length) {\n return endpoint + \"?\" + encodedOptions.join('&');\n }\n\n return endpoint;\n };\n /** Returns the envelope endpoint URL. */\n\n\n API.prototype._getEnvelopeEndpoint = function () {\n return this._getIngestEndpoint('envelope');\n };\n /** Returns the ingest API endpoint for target. */\n\n\n API.prototype._getIngestEndpoint = function (target) {\n var base = this.getBaseApiEndpoint();\n var dsn = this._dsnObject;\n return \"\" + base + dsn.projectId + \"/\" + target + \"/\";\n };\n /** Returns a URL-encoded string with auth config suitable for a query string. */\n\n\n API.prototype._encodedAuth = function () {\n var dsn = this._dsnObject;\n var auth = {\n // We send only the minimum set of required information. See\n // https://github.com/getsentry/sentry-javascript/issues/2572.\n sentry_key: dsn.publicKey,\n sentry_version: SENTRY_API_VERSION\n };\n return urlEncode(auth);\n };\n\n return API;\n}();\n\nexport { API };","import { SentryError } from './error';\nimport { SyncPromise } from './syncpromise';\n/** A simple queue that holds promises. */\n\nvar PromiseBuffer =\n/** @class */\nfunction () {\n function PromiseBuffer(_limit) {\n this._limit = _limit;\n /** Internal set of queued Promises */\n\n this._buffer = [];\n }\n /**\n * Says if the buffer is ready to take more requests\n */\n\n\n PromiseBuffer.prototype.isReady = function () {\n return this._limit === undefined || this.length() < this._limit;\n };\n /**\n * Add a promise to the queue.\n *\n * @param task Can be any PromiseLike\n * @returns The original promise.\n */\n\n\n PromiseBuffer.prototype.add = function (task) {\n var _this = this;\n\n if (!this.isReady()) {\n return SyncPromise.reject(new SentryError('Not adding Promise due to buffer limit reached.'));\n }\n\n if (this._buffer.indexOf(task) === -1) {\n this._buffer.push(task);\n }\n\n task.then(function () {\n return _this.remove(task);\n }).then(null, function () {\n return _this.remove(task).then(null, function () {// We have to add this catch here otherwise we have an unhandledPromiseRejection\n // because it's a new Promise chain.\n });\n });\n return task;\n };\n /**\n * Remove a promise to the queue.\n *\n * @param task Can be any PromiseLike\n * @returns Removed promise.\n */\n\n\n PromiseBuffer.prototype.remove = function (task) {\n var removedTask = this._buffer.splice(this._buffer.indexOf(task), 1)[0];\n\n return removedTask;\n };\n /**\n * This function returns the number of unresolved promises in the queue.\n */\n\n\n PromiseBuffer.prototype.length = function () {\n return this._buffer.length;\n };\n /**\n * This will drain the whole queue, returns true if queue is empty or drained.\n * If timeout is provided and the queue takes longer to drain, the promise still resolves but with false.\n *\n * @param timeout Number in ms to wait until it resolves with false.\n */\n\n\n PromiseBuffer.prototype.drain = function (timeout) {\n var _this = this;\n\n return new SyncPromise(function (resolve) {\n var capturedSetTimeout = setTimeout(function () {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n SyncPromise.all(_this._buffer).then(function () {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n }).then(null, function () {\n resolve(true);\n });\n });\n };\n\n return PromiseBuffer;\n}();\n\nexport { PromiseBuffer };","import { __values } from \"tslib\";\nimport { API } from '@sentry/core';\nimport { Status } from '@sentry/types';\nimport { logger, parseRetryAfterHeader, PromiseBuffer, SentryError } from '@sentry/utils';\n/** Base Transport class implementation */\n\nvar BaseTransport =\n/** @class */\nfunction () {\n function BaseTransport(options) {\n this.options = options;\n /** A simple buffer holding all requests. */\n\n this._buffer = new PromiseBuffer(30);\n /** Locks transport after receiving rate limits in a response */\n\n this._rateLimits = {};\n this._api = new API(options.dsn, options._metadata); // eslint-disable-next-line deprecation/deprecation\n\n this.url = this._api.getStoreEndpointWithUrlEncodedAuth();\n }\n /**\n * @inheritDoc\n */\n\n\n BaseTransport.prototype.sendEvent = function (_) {\n throw new SentryError('Transport Class has to implement `sendEvent` method');\n };\n /**\n * @inheritDoc\n */\n\n\n BaseTransport.prototype.close = function (timeout) {\n return this._buffer.drain(timeout);\n };\n /**\n * Handle Sentry repsonse for promise-based transports.\n */\n\n\n BaseTransport.prototype._handleResponse = function (_a) {\n var requestType = _a.requestType,\n response = _a.response,\n headers = _a.headers,\n resolve = _a.resolve,\n reject = _a.reject;\n var status = Status.fromHttpCode(response.status);\n /**\n * \"The name is case-insensitive.\"\n * https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n */\n\n var limited = this._handleRateLimit(headers);\n\n if (limited) logger.warn(\"Too many requests, backing off until: \" + this._disabledUntil(requestType));\n\n if (status === Status.Success) {\n resolve({\n status: status\n });\n return;\n }\n\n reject(response);\n };\n /**\n * Gets the time that given category is disabled until for rate limiting\n */\n\n\n BaseTransport.prototype._disabledUntil = function (category) {\n return this._rateLimits[category] || this._rateLimits.all;\n };\n /**\n * Checks if a category is rate limited\n */\n\n\n BaseTransport.prototype._isRateLimited = function (category) {\n return this._disabledUntil(category) > new Date(Date.now());\n };\n /**\n * Sets internal _rateLimits from incoming headers. Returns true if headers contains a non-empty rate limiting header.\n */\n\n\n BaseTransport.prototype._handleRateLimit = function (headers) {\n var e_1, _a, e_2, _b;\n\n var now = Date.now();\n var rlHeader = headers['x-sentry-rate-limits'];\n var raHeader = headers['retry-after'];\n\n if (rlHeader) {\n try {\n // rate limit headers are of the form\n //
,
,..\n // where each
is of the form\n // : : : \n // where\n // is a delay in ms\n // is the event type(s) (error, transaction, etc) being rate limited and is of the form\n // ;;...\n // is what's being limited (org, project, or key) - ignored by SDK\n // is an arbitrary string like \"org_quota\" - ignored by SDK\n for (var _c = __values(rlHeader.trim().split(',')), _d = _c.next(); !_d.done; _d = _c.next()) {\n var limit = _d.value;\n var parameters = limit.split(':', 2);\n var headerDelay = parseInt(parameters[0], 10);\n var delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n\n try {\n for (var _e = (e_2 = void 0, __values(parameters[1].split(';'))), _f = _e.next(); !_f.done; _f = _e.next()) {\n var category = _f.value;\n this._rateLimits[category || 'all'] = new Date(now + delay);\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_b = _e[\"return\"])) _b.call(_e);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_a = _c[\"return\"])) _a.call(_c);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return true;\n } else if (raHeader) {\n this._rateLimits.all = new Date(now + parseRetryAfterHeader(now, raHeader));\n return true;\n }\n\n return false;\n };\n\n return BaseTransport;\n}();\n\nexport { BaseTransport };","import { __extends } from \"tslib\";\nimport { eventToSentryRequest, sessionToSentryRequest } from '@sentry/core';\nimport { getGlobalObject, supportsReferrerPolicy, SyncPromise } from '@sentry/utils';\nimport { BaseTransport } from './base';\nvar global = getGlobalObject();\n/** `fetch` based transport */\n\nvar FetchTransport =\n/** @class */\nfunction (_super) {\n __extends(FetchTransport, _super);\n\n function FetchTransport() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @inheritDoc\n */\n\n\n FetchTransport.prototype.sendEvent = function (event) {\n return this._sendRequest(eventToSentryRequest(event, this._api), event);\n };\n /**\n * @inheritDoc\n */\n\n\n FetchTransport.prototype.sendSession = function (session) {\n return this._sendRequest(sessionToSentryRequest(session, this._api), session);\n };\n /**\n * @param sentryRequest Prepared SentryRequest to be delivered\n * @param originalPayload Original payload used to create SentryRequest\n */\n\n\n FetchTransport.prototype._sendRequest = function (sentryRequest, originalPayload) {\n var _this = this;\n\n if (this._isRateLimited(sentryRequest.type)) {\n return Promise.reject({\n event: originalPayload,\n type: sentryRequest.type,\n reason: \"Transport locked till \" + this._disabledUntil(sentryRequest.type) + \" due to too many requests.\",\n status: 429\n });\n }\n\n var options = {\n body: sentryRequest.body,\n method: 'POST',\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default\n // https://caniuse.com/#feat=referrer-policy\n // It doesn't. And it throw exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n referrerPolicy: supportsReferrerPolicy() ? 'origin' : ''\n };\n\n if (this.options.fetchParameters !== undefined) {\n Object.assign(options, this.options.fetchParameters);\n }\n\n if (this.options.headers !== undefined) {\n options.headers = this.options.headers;\n }\n\n return this._buffer.add(new SyncPromise(function (resolve, reject) {\n global.fetch(sentryRequest.url, options).then(function (response) {\n var headers = {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After')\n };\n\n _this._handleResponse({\n requestType: sentryRequest.type,\n response: response,\n headers: headers,\n resolve: resolve,\n reject: reject\n });\n })[\"catch\"](reject);\n }));\n };\n\n return FetchTransport;\n}(BaseTransport);\n\nexport { FetchTransport };","import { __extends } from \"tslib\";\nimport { eventToSentryRequest, sessionToSentryRequest } from '@sentry/core';\nimport { SyncPromise } from '@sentry/utils';\nimport { BaseTransport } from './base';\n/** `XHR` based transport */\n\nvar XHRTransport =\n/** @class */\nfunction (_super) {\n __extends(XHRTransport, _super);\n\n function XHRTransport() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @inheritDoc\n */\n\n\n XHRTransport.prototype.sendEvent = function (event) {\n return this._sendRequest(eventToSentryRequest(event, this._api), event);\n };\n /**\n * @inheritDoc\n */\n\n\n XHRTransport.prototype.sendSession = function (session) {\n return this._sendRequest(sessionToSentryRequest(session, this._api), session);\n };\n /**\n * @param sentryRequest Prepared SentryRequest to be delivered\n * @param originalPayload Original payload used to create SentryRequest\n */\n\n\n XHRTransport.prototype._sendRequest = function (sentryRequest, originalPayload) {\n var _this = this;\n\n if (this._isRateLimited(sentryRequest.type)) {\n return Promise.reject({\n event: originalPayload,\n type: sentryRequest.type,\n reason: \"Transport locked till \" + this._disabledUntil(sentryRequest.type) + \" due to too many requests.\",\n status: 429\n });\n }\n\n return this._buffer.add(new SyncPromise(function (resolve, reject) {\n var request = new XMLHttpRequest();\n\n request.onreadystatechange = function () {\n if (request.readyState === 4) {\n var headers = {\n 'x-sentry-rate-limits': request.getResponseHeader('X-Sentry-Rate-Limits'),\n 'retry-after': request.getResponseHeader('Retry-After')\n };\n\n _this._handleResponse({\n requestType: sentryRequest.type,\n response: request,\n headers: headers,\n resolve: resolve,\n reject: reject\n });\n }\n };\n\n request.open('POST', sentryRequest.url);\n\n for (var header in _this.options.headers) {\n if (_this.options.headers.hasOwnProperty(header)) {\n request.setRequestHeader(header, _this.options.headers[header]);\n }\n }\n\n request.send(sentryRequest.body);\n }));\n };\n\n return XHRTransport;\n}(BaseTransport);\n\nexport { XHRTransport };","import { __assign, __extends } from \"tslib\";\nimport { BaseBackend } from '@sentry/core';\nimport { Severity } from '@sentry/types';\nimport { supportsFetch } from '@sentry/utils';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { FetchTransport, XHRTransport } from './transports';\n/**\n * The Sentry Browser SDK Backend.\n * @hidden\n */\n\nvar BrowserBackend =\n/** @class */\nfunction (_super) {\n __extends(BrowserBackend, _super);\n\n function BrowserBackend() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @inheritDoc\n */\n\n\n BrowserBackend.prototype.eventFromException = function (exception, hint) {\n return eventFromException(this._options, exception, hint);\n };\n /**\n * @inheritDoc\n */\n\n\n BrowserBackend.prototype.eventFromMessage = function (message, level, hint) {\n if (level === void 0) {\n level = Severity.Info;\n }\n\n return eventFromMessage(this._options, message, level, hint);\n };\n /**\n * @inheritDoc\n */\n\n\n BrowserBackend.prototype._setupTransport = function () {\n if (!this._options.dsn) {\n // We return the noop transport here in case there is no Dsn.\n return _super.prototype._setupTransport.call(this);\n }\n\n var transportOptions = __assign(__assign({}, this._options.transportOptions), {\n dsn: this._options.dsn,\n _metadata: this._options._metadata\n });\n\n if (this._options.transport) {\n return new this._options.transport(transportOptions);\n }\n\n if (supportsFetch()) {\n return new FetchTransport(transportOptions);\n }\n\n return new XHRTransport(transportOptions);\n };\n\n return BrowserBackend;\n}(BaseBackend);\n\nexport { BrowserBackend };","import { __assign, __read, __spread } from \"tslib\";\nimport { getCurrentHub } from '@sentry/hub';\n/**\n * This calls a function on the current hub.\n * @param method function to call on hub.\n * @param args to pass to function.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nfunction callOnHub(method) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n var hub = getCurrentHub();\n\n if (hub && hub[method]) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return hub[method].apply(hub, __spread(args));\n }\n\n throw new Error(\"No hub defined or \" + method + \" was not found on the hub, please open a bug report.\");\n}\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception An exception-like object.\n * @returns The generated eventId.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n\nexport function captureException(exception, captureContext) {\n var syntheticException;\n\n try {\n throw new Error('Sentry syntheticException');\n } catch (exception) {\n syntheticException = exception;\n }\n\n return callOnHub('captureException', exception, {\n captureContext: captureContext,\n originalException: exception,\n syntheticException: syntheticException\n });\n}\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param message The message to send to Sentry.\n * @param level Define the level of the message.\n * @returns The generated eventId.\n */\n\nexport function captureMessage(message, captureContext) {\n var syntheticException;\n\n try {\n throw new Error(message);\n } catch (exception) {\n syntheticException = exception;\n } // This is necessary to provide explicit scopes upgrade, without changing the original\n // arity of the `captureMessage(message, level)` method.\n\n\n var level = typeof captureContext === 'string' ? captureContext : undefined;\n var context = typeof captureContext !== 'string' ? {\n captureContext: captureContext\n } : undefined;\n return callOnHub('captureMessage', message, level, __assign({\n originalException: message,\n syntheticException: syntheticException\n }, context));\n}\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param event The event to send to Sentry.\n * @returns The generated eventId.\n */\n\nexport function captureEvent(event) {\n return callOnHub('captureEvent', event);\n}\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n */\n\nexport function configureScope(callback) {\n callOnHub('configureScope', callback);\n}\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\n\nexport function addBreadcrumb(breadcrumb) {\n callOnHub('addBreadcrumb', breadcrumb);\n}\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nexport function setContext(name, context) {\n callOnHub('setContext', name, context);\n}\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\n\nexport function setExtras(extras) {\n callOnHub('setExtras', extras);\n}\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\n\nexport function setTags(tags) {\n callOnHub('setTags', tags);\n}\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\n\nexport function setExtra(key, extra) {\n callOnHub('setExtra', key, extra);\n}\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\n\nexport function setTag(key, value) {\n callOnHub('setTag', key, value);\n}\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\n\nexport function setUser(user) {\n callOnHub('setUser', user);\n}\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\n\nexport function withScope(callback) {\n callOnHub('withScope', callback);\n}\n/**\n * Calls a function on the latest client. Use this with caution, it's meant as\n * in \"internal\" helper so we don't need to expose every possible function in\n * the shim. It is not guaranteed that the client actually implements the\n * function.\n *\n * @param method The method to call on the client/client.\n * @param args Arguments to pass to the client/fontend.\n * @hidden\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nexport function _callOnClient(method) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n callOnHub.apply(void 0, __spread(['_invokeClient', method], args));\n}\n/**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n */\n\nexport function startTransaction(context, customSamplingContext) {\n return callOnHub('startTransaction', __assign({}, context), customSamplingContext);\n}","import { __assign } from \"tslib\";\nimport { API, captureException, withScope } from '@sentry/core';\nimport { addExceptionMechanism, addExceptionTypeValue, logger } from '@sentry/utils';\nvar ignoreOnError = 0;\n/**\n * @hidden\n */\n\nexport function shouldIgnoreOnError() {\n return ignoreOnError > 0;\n}\n/**\n * @hidden\n */\n\nexport function ignoreNextOnError() {\n // onerror should trigger before setTimeout\n ignoreOnError += 1;\n setTimeout(function () {\n ignoreOnError -= 1;\n });\n}\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap.\n * @returns The wrapped function.\n * @hidden\n */\n\nexport function wrap(fn, options, before) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof fn !== 'function') {\n return fn;\n }\n\n try {\n // We don't wanna wrap it twice\n if (fn.__sentry__) {\n return fn;\n } // If this has already been wrapped in the past, return that wrapped function\n\n\n if (fn.__sentry_wrapped__) {\n return fn.__sentry_wrapped__;\n }\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n /* eslint-disable prefer-rest-params */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n var sentryWrapped = function sentryWrapped() {\n var args = Array.prototype.slice.call(arguments);\n\n try {\n if (before && typeof before === 'function') {\n before.apply(this, arguments);\n } // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n\n\n var wrappedArguments = args.map(function (arg) {\n return wrap(arg, options);\n });\n\n if (fn.handleEvent) {\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return fn.handleEvent.apply(this, wrappedArguments);\n } // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n\n\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n withScope(function (scope) {\n scope.addEventProcessor(function (event) {\n var processedEvent = __assign({}, event);\n\n if (options.mechanism) {\n addExceptionTypeValue(processedEvent, undefined, undefined);\n addExceptionMechanism(processedEvent, options.mechanism);\n }\n\n processedEvent.extra = __assign(__assign({}, processedEvent.extra), {\n arguments: args\n });\n return processedEvent;\n });\n captureException(ex);\n });\n throw ex;\n }\n };\n /* eslint-enable prefer-rest-params */\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n\n\n try {\n for (var property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property] = fn[property];\n }\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n\n fn.prototype = fn.prototype || {};\n sentryWrapped.prototype = fn.prototype;\n Object.defineProperty(fn, '__sentry_wrapped__', {\n enumerable: false,\n value: sentryWrapped\n }); // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n\n Object.defineProperties(sentryWrapped, {\n __sentry__: {\n enumerable: false,\n value: true\n },\n __sentry_original__: {\n enumerable: false,\n value: fn\n }\n }); // Restore original function name (not all browsers allow that)\n\n try {\n var descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name');\n\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get: function get() {\n return fn.name;\n }\n });\n } // eslint-disable-next-line no-empty\n\n } catch (_oO) {}\n\n return sentryWrapped;\n}\n/**\n * Injects the Report Dialog script\n * @hidden\n */\n\nexport function injectReportDialog(options) {\n if (options === void 0) {\n options = {};\n }\n\n if (!options.eventId) {\n logger.error(\"Missing eventId option in showReportDialog call\");\n return;\n }\n\n if (!options.dsn) {\n logger.error(\"Missing dsn option in showReportDialog call\");\n return;\n }\n\n var script = document.createElement('script');\n script.async = true;\n script.src = new API(options.dsn).getReportDialogEndpoint(options);\n\n if (options.onLoad) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n script.onload = options.onLoad;\n }\n\n (document.head || document.body).appendChild(script);\n}","export var TransactionSamplingMethod;\n\n(function (TransactionSamplingMethod) {\n TransactionSamplingMethod[\"Explicit\"] = \"explicitly_set\";\n TransactionSamplingMethod[\"Sampler\"] = \"client_sampler\";\n TransactionSamplingMethod[\"Rate\"] = \"client_rate\";\n TransactionSamplingMethod[\"Inheritance\"] = \"inheritance\";\n})(TransactionSamplingMethod || (TransactionSamplingMethod = {}));","/** The status of an Span. */\n// eslint-disable-next-line import/export\nexport var SpanStatus;\n\n(function (SpanStatus) {\n /** The operation completed successfully. */\n SpanStatus[\"Ok\"] = \"ok\";\n /** Deadline expired before operation could complete. */\n\n SpanStatus[\"DeadlineExceeded\"] = \"deadline_exceeded\";\n /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\n\n SpanStatus[\"Unauthenticated\"] = \"unauthenticated\";\n /** 403 Forbidden */\n\n SpanStatus[\"PermissionDenied\"] = \"permission_denied\";\n /** 404 Not Found. Some requested entity (file or directory) was not found. */\n\n SpanStatus[\"NotFound\"] = \"not_found\";\n /** 429 Too Many Requests */\n\n SpanStatus[\"ResourceExhausted\"] = \"resource_exhausted\";\n /** Client specified an invalid argument. 4xx. */\n\n SpanStatus[\"InvalidArgument\"] = \"invalid_argument\";\n /** 501 Not Implemented */\n\n SpanStatus[\"Unimplemented\"] = \"unimplemented\";\n /** 503 Service Unavailable */\n\n SpanStatus[\"Unavailable\"] = \"unavailable\";\n /** Other/generic 5xx. */\n\n SpanStatus[\"InternalError\"] = \"internal_error\";\n /** Unknown. Any non-standard HTTP status code. */\n\n SpanStatus[\"UnknownError\"] = \"unknown_error\";\n /** The operation was cancelled (typically by the user). */\n\n SpanStatus[\"Cancelled\"] = \"cancelled\";\n /** Already exists (409) */\n\n SpanStatus[\"AlreadyExists\"] = \"already_exists\";\n /** Operation was rejected because the system is not in a state required for the operation's */\n\n SpanStatus[\"FailedPrecondition\"] = \"failed_precondition\";\n /** The operation was aborted, typically due to a concurrency issue. */\n\n SpanStatus[\"Aborted\"] = \"aborted\";\n /** Operation was attempted past the valid range. */\n\n SpanStatus[\"OutOfRange\"] = \"out_of_range\";\n /** Unrecoverable data loss or corruption */\n\n SpanStatus[\"DataLoss\"] = \"data_loss\";\n})(SpanStatus || (SpanStatus = {})); // eslint-disable-next-line @typescript-eslint/no-namespace, import/export\n\n\n(function (SpanStatus) {\n /**\n * Converts a HTTP status code into a {@link SpanStatus}.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or {@link SpanStatus.UnknownError}.\n */\n function fromHttpCode(httpStatus) {\n if (httpStatus < 400) {\n return SpanStatus.Ok;\n }\n\n if (httpStatus >= 400 && httpStatus < 500) {\n switch (httpStatus) {\n case 401:\n return SpanStatus.Unauthenticated;\n\n case 403:\n return SpanStatus.PermissionDenied;\n\n case 404:\n return SpanStatus.NotFound;\n\n case 409:\n return SpanStatus.AlreadyExists;\n\n case 413:\n return SpanStatus.FailedPrecondition;\n\n case 429:\n return SpanStatus.ResourceExhausted;\n\n default:\n return SpanStatus.InvalidArgument;\n }\n }\n\n if (httpStatus >= 500 && httpStatus < 600) {\n switch (httpStatus) {\n case 501:\n return SpanStatus.Unimplemented;\n\n case 503:\n return SpanStatus.Unavailable;\n\n case 504:\n return SpanStatus.DeadlineExceeded;\n\n default:\n return SpanStatus.InternalError;\n }\n }\n\n return SpanStatus.UnknownError;\n }\n\n SpanStatus.fromHttpCode = fromHttpCode;\n})(SpanStatus || (SpanStatus = {}));","import { __assign, __read, __spread } from \"tslib\";\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/* eslint-disable max-lines */\n\nimport { getCurrentHub } from '@sentry/core';\nimport { Severity } from '@sentry/types';\nimport { addInstrumentationHandler, getEventDescription, getGlobalObject, htmlTreeAsString, parseUrl, safeJoin } from '@sentry/utils';\n/**\n * Default Breadcrumbs instrumentations\n * TODO: Deprecated - with v6, this will be renamed to `Instrument`\n */\n\nvar Breadcrumbs =\n/** @class */\nfunction () {\n /**\n * @inheritDoc\n */\n function Breadcrumbs(options) {\n /**\n * @inheritDoc\n */\n this.name = Breadcrumbs.id;\n this._options = __assign({\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: true,\n xhr: true\n }, options);\n }\n /**\n * Create a breadcrumb of `sentry` from the events themselves\n */\n\n\n Breadcrumbs.prototype.addSentryBreadcrumb = function (event) {\n if (!this._options.sentry) {\n return;\n }\n\n getCurrentHub().addBreadcrumb({\n category: \"sentry.\" + (event.type === 'transaction' ? 'transaction' : 'event'),\n event_id: event.event_id,\n level: event.level,\n message: getEventDescription(event)\n }, {\n event: event\n });\n };\n /**\n * Instrument browser built-ins w/ breadcrumb capturing\n * - Console API\n * - DOM API (click/typing)\n * - XMLHttpRequest API\n * - Fetch API\n * - History API\n */\n\n\n Breadcrumbs.prototype.setupOnce = function () {\n var _this = this;\n\n if (this._options.console) {\n addInstrumentationHandler({\n callback: function callback() {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n _this._consoleBreadcrumb.apply(_this, __spread(args));\n },\n type: 'console'\n });\n }\n\n if (this._options.dom) {\n addInstrumentationHandler({\n callback: function callback() {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n _this._domBreadcrumb.apply(_this, __spread(args));\n },\n type: 'dom'\n });\n }\n\n if (this._options.xhr) {\n addInstrumentationHandler({\n callback: function callback() {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n _this._xhrBreadcrumb.apply(_this, __spread(args));\n },\n type: 'xhr'\n });\n }\n\n if (this._options.fetch) {\n addInstrumentationHandler({\n callback: function callback() {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n _this._fetchBreadcrumb.apply(_this, __spread(args));\n },\n type: 'fetch'\n });\n }\n\n if (this._options.history) {\n addInstrumentationHandler({\n callback: function callback() {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n _this._historyBreadcrumb.apply(_this, __spread(args));\n },\n type: 'history'\n });\n }\n };\n /**\n * Creates breadcrumbs from console API calls\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n Breadcrumbs.prototype._consoleBreadcrumb = function (handlerData) {\n var breadcrumb = {\n category: 'console',\n data: {\n arguments: handlerData.args,\n logger: 'console'\n },\n level: Severity.fromString(handlerData.level),\n message: safeJoin(handlerData.args, ' ')\n };\n\n if (handlerData.level === 'assert') {\n if (handlerData.args[0] === false) {\n breadcrumb.message = \"Assertion failed: \" + (safeJoin(handlerData.args.slice(1), ' ') || 'console.assert');\n breadcrumb.data.arguments = handlerData.args.slice(1);\n } else {\n // Don't capture a breadcrumb for passed assertions\n return;\n }\n }\n\n getCurrentHub().addBreadcrumb(breadcrumb, {\n input: handlerData.args,\n level: handlerData.level\n });\n };\n /**\n * Creates breadcrumbs from DOM API calls\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n Breadcrumbs.prototype._domBreadcrumb = function (handlerData) {\n var target; // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n\n try {\n target = handlerData.event.target ? htmlTreeAsString(handlerData.event.target) : htmlTreeAsString(handlerData.event);\n } catch (e) {\n target = '';\n }\n\n if (target.length === 0) {\n return;\n }\n\n getCurrentHub().addBreadcrumb({\n category: \"ui.\" + handlerData.name,\n message: target\n }, {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global\n });\n };\n /**\n * Creates breadcrumbs from XHR API calls\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n Breadcrumbs.prototype._xhrBreadcrumb = function (handlerData) {\n if (handlerData.endTimestamp) {\n // We only capture complete, non-sentry requests\n if (handlerData.xhr.__sentry_own_request__) {\n return;\n }\n\n var _a = handlerData.xhr.__sentry_xhr__ || {},\n method = _a.method,\n url = _a.url,\n status_code = _a.status_code,\n body = _a.body;\n\n getCurrentHub().addBreadcrumb({\n category: 'xhr',\n data: {\n method: method,\n url: url,\n status_code: status_code\n },\n type: 'http'\n }, {\n xhr: handlerData.xhr,\n input: body\n });\n return;\n }\n };\n /**\n * Creates breadcrumbs from fetch API calls\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n Breadcrumbs.prototype._fetchBreadcrumb = function (handlerData) {\n // We only capture complete fetch requests\n if (!handlerData.endTimestamp) {\n return;\n }\n\n if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n return;\n }\n\n if (handlerData.error) {\n getCurrentHub().addBreadcrumb({\n category: 'fetch',\n data: handlerData.fetchData,\n level: Severity.Error,\n type: 'http'\n }, {\n data: handlerData.error,\n input: handlerData.args\n });\n } else {\n getCurrentHub().addBreadcrumb({\n category: 'fetch',\n data: __assign(__assign({}, handlerData.fetchData), {\n status_code: handlerData.response.status\n }),\n type: 'http'\n }, {\n input: handlerData.args,\n response: handlerData.response\n });\n }\n };\n /**\n * Creates breadcrumbs from history API calls\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n Breadcrumbs.prototype._historyBreadcrumb = function (handlerData) {\n var global = getGlobalObject();\n var from = handlerData.from;\n var to = handlerData.to;\n var parsedLoc = parseUrl(global.location.href);\n var parsedFrom = parseUrl(from);\n var parsedTo = parseUrl(to); // Initial pushState doesn't provide `from` information\n\n if (!parsedFrom.path) {\n parsedFrom = parsedLoc;\n } // Use only the path component of the URL if the URL matches the current\n // document (almost all the time when using pushState)\n\n\n if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n to = parsedTo.relative;\n }\n\n if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n from = parsedFrom.relative;\n }\n\n getCurrentHub().addBreadcrumb({\n category: 'navigation',\n data: {\n from: from,\n to: to\n }\n });\n };\n /**\n * @inheritDoc\n */\n\n\n Breadcrumbs.id = 'Breadcrumbs';\n return Breadcrumbs;\n}();\n\nexport { Breadcrumbs };","import { __assign, __extends } from \"tslib\";\nimport { BaseClient } from '@sentry/core';\nimport { getGlobalObject, logger } from '@sentry/utils';\nimport { BrowserBackend } from './backend';\nimport { injectReportDialog } from './helpers';\nimport { Breadcrumbs } from './integrations';\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\n\nvar BrowserClient =\n/** @class */\nfunction (_super) {\n __extends(BrowserClient, _super);\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n\n\n function BrowserClient(options) {\n if (options === void 0) {\n options = {};\n }\n\n return _super.call(this, BrowserBackend, options) || this;\n }\n /**\n * Show a report dialog to the user to send feedback to a specific event.\n *\n * @param options Set individual options for the dialog\n */\n\n\n BrowserClient.prototype.showReportDialog = function (options) {\n if (options === void 0) {\n options = {};\n } // doesn't work without a document (React Native)\n\n\n var document = getGlobalObject().document;\n\n if (!document) {\n return;\n }\n\n if (!this._isEnabled()) {\n logger.error('Trying to call showReportDialog with Sentry Client disabled');\n return;\n }\n\n injectReportDialog(__assign(__assign({}, options), {\n dsn: options.dsn || this.getDsn()\n }));\n };\n /**\n * @inheritDoc\n */\n\n\n BrowserClient.prototype._prepareEvent = function (event, scope, hint) {\n event.platform = event.platform || 'javascript';\n return _super.prototype._prepareEvent.call(this, event, scope, hint);\n };\n /**\n * @inheritDoc\n */\n\n\n BrowserClient.prototype._sendEvent = function (event) {\n var integration = this.getIntegration(Breadcrumbs);\n\n if (integration) {\n integration.addSentryBreadcrumb(event);\n }\n\n _super.prototype._sendEvent.call(this, event);\n };\n\n return BrowserClient;\n}(BaseClient);\n\nexport { BrowserClient };","import { __assign } from \"tslib\";\nimport { fill, getFunctionName, getGlobalObject } from '@sentry/utils';\nimport { wrap } from '../helpers';\nvar DEFAULT_EVENT_TARGET = ['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'];\n/** Wrap timer functions and event targets to catch errors and provide better meta data */\n\nvar TryCatch =\n/** @class */\nfunction () {\n /**\n * @inheritDoc\n */\n function TryCatch(options) {\n /**\n * @inheritDoc\n */\n this.name = TryCatch.id;\n this._options = __assign({\n XMLHttpRequest: true,\n eventTarget: true,\n requestAnimationFrame: true,\n setInterval: true,\n setTimeout: true\n }, options);\n }\n /**\n * Wrap timer functions and event targets to catch errors\n * and provide better metadata.\n */\n\n\n TryCatch.prototype.setupOnce = function () {\n var global = getGlobalObject();\n\n if (this._options.setTimeout) {\n fill(global, 'setTimeout', this._wrapTimeFunction.bind(this));\n }\n\n if (this._options.setInterval) {\n fill(global, 'setInterval', this._wrapTimeFunction.bind(this));\n }\n\n if (this._options.requestAnimationFrame) {\n fill(global, 'requestAnimationFrame', this._wrapRAF.bind(this));\n }\n\n if (this._options.XMLHttpRequest && 'XMLHttpRequest' in global) {\n fill(XMLHttpRequest.prototype, 'send', this._wrapXHR.bind(this));\n }\n\n if (this._options.eventTarget) {\n var eventTarget = Array.isArray(this._options.eventTarget) ? this._options.eventTarget : DEFAULT_EVENT_TARGET;\n eventTarget.forEach(this._wrapEventTarget.bind(this));\n }\n };\n /** JSDoc */\n\n\n TryCatch.prototype._wrapTimeFunction = function (original) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var originalCallback = args[0];\n args[0] = wrap(originalCallback, {\n mechanism: {\n data: {\n \"function\": getFunctionName(original)\n },\n handled: true,\n type: 'instrument'\n }\n });\n return original.apply(this, args);\n };\n };\n /** JSDoc */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n TryCatch.prototype._wrapRAF = function (original) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (callback) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return original.call(this, wrap(callback, {\n mechanism: {\n data: {\n \"function\": 'requestAnimationFrame',\n handler: getFunctionName(original)\n },\n handled: true,\n type: 'instrument'\n }\n }));\n };\n };\n /** JSDoc */\n\n\n TryCatch.prototype._wrapEventTarget = function (target) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var global = getGlobalObject(); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\n var proto = global[target] && global[target].prototype; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (original) {\n return function (eventName, fn, options) {\n try {\n if (typeof fn.handleEvent === 'function') {\n fn.handleEvent = wrap(fn.handleEvent.bind(fn), {\n mechanism: {\n data: {\n \"function\": 'handleEvent',\n handler: getFunctionName(fn),\n target: target\n },\n handled: true,\n type: 'instrument'\n }\n });\n }\n } catch (err) {// can sometimes get 'Permission denied to access property \"handle Event'\n }\n\n return original.call(this, eventName, // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrap(fn, {\n mechanism: {\n data: {\n \"function\": 'addEventListener',\n handler: getFunctionName(fn),\n target: target\n },\n handled: true,\n type: 'instrument'\n }\n }), options);\n };\n });\n fill(proto, 'removeEventListener', function (originalRemoveEventListener) {\n return function (eventName, fn, options) {\n var _a;\n /**\n * There are 2 possible scenarios here:\n *\n * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n * as a pass-through, and call original `removeEventListener` with it.\n *\n * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n *\n * When someone adds a handler prior to initialization, and then do it again, but after,\n * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n * to get rid of the initial handler and it'd stick there forever.\n */\n\n\n var wrappedEventHandler = fn;\n\n try {\n var originalEventHandler = (_a = wrappedEventHandler) === null || _a === void 0 ? void 0 : _a.__sentry_wrapped__;\n\n if (originalEventHandler) {\n originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n }\n } catch (e) {// ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n }\n\n return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);\n };\n });\n };\n /** JSDoc */\n\n\n TryCatch.prototype._wrapXHR = function (originalSend) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n } // eslint-disable-next-line @typescript-eslint/no-this-alias\n\n\n var xhr = this;\n var xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n xmlHttpRequestProps.forEach(function (prop) {\n if (prop in xhr && typeof xhr[prop] === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fill(xhr, prop, function (original) {\n var wrapOptions = {\n mechanism: {\n data: {\n \"function\": prop,\n handler: getFunctionName(original)\n },\n handled: true,\n type: 'instrument'\n }\n }; // If Instrument integration has been called before TryCatch, get the name of original function\n\n if (original.__sentry_original__) {\n wrapOptions.mechanism.data.handler = getFunctionName(original.__sentry_original__);\n } // Otherwise wrap directly\n\n\n return wrap(original, wrapOptions);\n });\n }\n });\n return originalSend.apply(this, args);\n };\n };\n /**\n * @inheritDoc\n */\n\n\n TryCatch.id = 'TryCatch';\n return TryCatch;\n}();\n\nexport { TryCatch };","import { __assign } from \"tslib\";\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\nimport { getCurrentHub } from '@sentry/core';\nimport { Severity } from '@sentry/types';\nimport { addExceptionMechanism, addInstrumentationHandler, getLocationHref, isErrorEvent, isPrimitive, isString, logger } from '@sentry/utils';\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { shouldIgnoreOnError } from '../helpers';\n/** Global handlers */\n\nvar GlobalHandlers =\n/** @class */\nfunction () {\n /** JSDoc */\n function GlobalHandlers(options) {\n /**\n * @inheritDoc\n */\n this.name = GlobalHandlers.id;\n /** JSDoc */\n\n this._onErrorHandlerInstalled = false;\n /** JSDoc */\n\n this._onUnhandledRejectionHandlerInstalled = false;\n this._options = __assign({\n onerror: true,\n onunhandledrejection: true\n }, options);\n }\n /**\n * @inheritDoc\n */\n\n\n GlobalHandlers.prototype.setupOnce = function () {\n Error.stackTraceLimit = 50;\n\n if (this._options.onerror) {\n logger.log('Global Handler attached: onerror');\n\n this._installGlobalOnErrorHandler();\n }\n\n if (this._options.onunhandledrejection) {\n logger.log('Global Handler attached: onunhandledrejection');\n\n this._installGlobalOnUnhandledRejectionHandler();\n }\n };\n /** JSDoc */\n\n\n GlobalHandlers.prototype._installGlobalOnErrorHandler = function () {\n var _this = this;\n\n if (this._onErrorHandlerInstalled) {\n return;\n }\n\n addInstrumentationHandler({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n callback: function callback(data) {\n var error = data.error;\n var currentHub = getCurrentHub();\n var hasIntegration = currentHub.getIntegration(GlobalHandlers);\n var isFailedOwnDelivery = error && error.__sentry_own_request__ === true;\n\n if (!hasIntegration || shouldIgnoreOnError() || isFailedOwnDelivery) {\n return;\n }\n\n var client = currentHub.getClient();\n var event = isPrimitive(error) ? _this._eventFromIncompleteOnError(data.msg, data.url, data.line, data.column) : _this._enhanceEventWithInitialFrame(eventFromUnknownInput(error, undefined, {\n attachStacktrace: client && client.getOptions().attachStacktrace,\n rejection: false\n }), data.url, data.line, data.column);\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror'\n });\n currentHub.captureEvent(event, {\n originalException: error\n });\n },\n type: 'error'\n });\n this._onErrorHandlerInstalled = true;\n };\n /** JSDoc */\n\n\n GlobalHandlers.prototype._installGlobalOnUnhandledRejectionHandler = function () {\n var _this = this;\n\n if (this._onUnhandledRejectionHandlerInstalled) {\n return;\n }\n\n addInstrumentationHandler({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n callback: function callback(e) {\n var error = e; // dig the object of the rejection out of known event types\n\n try {\n // PromiseRejectionEvents store the object of the rejection under 'reason'\n // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n if ('reason' in e) {\n error = e.reason;\n } // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n // https://github.com/getsentry/sentry-javascript/issues/2380\n else if ('detail' in e && 'reason' in e.detail) {\n error = e.detail.reason;\n }\n } catch (_oO) {// no-empty\n }\n\n var currentHub = getCurrentHub();\n var hasIntegration = currentHub.getIntegration(GlobalHandlers);\n var isFailedOwnDelivery = error && error.__sentry_own_request__ === true;\n\n if (!hasIntegration || shouldIgnoreOnError() || isFailedOwnDelivery) {\n return true;\n }\n\n var client = currentHub.getClient();\n var event = isPrimitive(error) ? _this._eventFromRejectionWithPrimitive(error) : eventFromUnknownInput(error, undefined, {\n attachStacktrace: client && client.getOptions().attachStacktrace,\n rejection: true\n });\n event.level = Severity.Error;\n addExceptionMechanism(event, {\n handled: false,\n type: 'onunhandledrejection'\n });\n currentHub.captureEvent(event, {\n originalException: error\n });\n return;\n },\n type: 'unhandledrejection'\n });\n this._onUnhandledRejectionHandlerInstalled = true;\n };\n /**\n * This function creates a stack from an old, error-less onerror handler.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n GlobalHandlers.prototype._eventFromIncompleteOnError = function (msg, url, line, column) {\n var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i; // If 'message' is ErrorEvent, get real message from inside\n\n var message = isErrorEvent(msg) ? msg.message : msg;\n var name;\n\n if (isString(message)) {\n var groups = message.match(ERROR_TYPES_RE);\n\n if (groups) {\n name = groups[1];\n message = groups[2];\n }\n }\n\n var event = {\n exception: {\n values: [{\n type: name || 'Error',\n value: message\n }]\n }\n };\n return this._enhanceEventWithInitialFrame(event, url, line, column);\n };\n /**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\n\n\n GlobalHandlers.prototype._eventFromRejectionWithPrimitive = function (reason) {\n return {\n exception: {\n values: [{\n type: 'UnhandledRejection',\n // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n value: \"Non-Error promise rejection captured with value: \" + String(reason)\n }]\n }\n };\n };\n /** JSDoc */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n GlobalHandlers.prototype._enhanceEventWithInitialFrame = function (event, url, line, column) {\n event.exception = event.exception || {};\n event.exception.values = event.exception.values || [];\n event.exception.values[0] = event.exception.values[0] || {};\n event.exception.values[0].stacktrace = event.exception.values[0].stacktrace || {};\n event.exception.values[0].stacktrace.frames = event.exception.values[0].stacktrace.frames || [];\n var colno = isNaN(parseInt(column, 10)) ? undefined : column;\n var lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n var filename = isString(url) && url.length > 0 ? url : getLocationHref();\n\n if (event.exception.values[0].stacktrace.frames.length === 0) {\n event.exception.values[0].stacktrace.frames.push({\n colno: colno,\n filename: filename,\n \"function\": '?',\n in_app: true,\n lineno: lineno\n });\n }\n\n return event;\n };\n /**\n * @inheritDoc\n */\n\n\n GlobalHandlers.id = 'GlobalHandlers';\n return GlobalHandlers;\n}();\n\nexport { GlobalHandlers };","import { __read, __spread } from \"tslib\";\nimport { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { isInstanceOf } from '@sentry/utils';\nimport { exceptionFromStacktrace } from '../parsers';\nimport { computeStackTrace } from '../tracekit';\nvar DEFAULT_KEY = 'cause';\nvar DEFAULT_LIMIT = 5;\n/** Adds SDK info to an event. */\n\nvar LinkedErrors =\n/** @class */\nfunction () {\n /**\n * @inheritDoc\n */\n function LinkedErrors(options) {\n if (options === void 0) {\n options = {};\n }\n /**\n * @inheritDoc\n */\n\n\n this.name = LinkedErrors.id;\n this._key = options.key || DEFAULT_KEY;\n this._limit = options.limit || DEFAULT_LIMIT;\n }\n /**\n * @inheritDoc\n */\n\n\n LinkedErrors.prototype.setupOnce = function () {\n addGlobalEventProcessor(function (event, hint) {\n var self = getCurrentHub().getIntegration(LinkedErrors);\n\n if (self) {\n return self._handler(event, hint);\n }\n\n return event;\n });\n };\n /**\n * @inheritDoc\n */\n\n\n LinkedErrors.prototype._handler = function (event, hint) {\n if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return event;\n }\n\n var linkedErrors = this._walkErrorTree(hint.originalException, this._key);\n\n event.exception.values = __spread(linkedErrors, event.exception.values);\n return event;\n };\n /**\n * @inheritDoc\n */\n\n\n LinkedErrors.prototype._walkErrorTree = function (error, key, stack) {\n if (stack === void 0) {\n stack = [];\n }\n\n if (!isInstanceOf(error[key], Error) || stack.length + 1 >= this._limit) {\n return stack;\n }\n\n var stacktrace = computeStackTrace(error[key]);\n var exception = exceptionFromStacktrace(stacktrace);\n return this._walkErrorTree(error[key], key, __spread([exception], stack));\n };\n /**\n * @inheritDoc\n */\n\n\n LinkedErrors.id = 'LinkedErrors';\n return LinkedErrors;\n}();\n\nexport { LinkedErrors };","import { __assign } from \"tslib\";\nimport { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { getGlobalObject } from '@sentry/utils';\nvar global = getGlobalObject();\n/** UserAgent */\n\nvar UserAgent =\n/** @class */\nfunction () {\n function UserAgent() {\n /**\n * @inheritDoc\n */\n this.name = UserAgent.id;\n }\n /**\n * @inheritDoc\n */\n\n\n UserAgent.prototype.setupOnce = function () {\n addGlobalEventProcessor(function (event) {\n var _a, _b, _c;\n\n if (getCurrentHub().getIntegration(UserAgent)) {\n // if none of the information we want exists, don't bother\n if (!global.navigator && !global.location && !global.document) {\n return event;\n } // grab as much info as exists and add it to the event\n\n\n var url = ((_a = event.request) === null || _a === void 0 ? void 0 : _a.url) || ((_b = global.location) === null || _b === void 0 ? void 0 : _b.href);\n var referrer = (global.document || {}).referrer;\n var userAgent = (global.navigator || {}).userAgent;\n\n var headers = __assign(__assign(__assign({}, (_c = event.request) === null || _c === void 0 ? void 0 : _c.headers), referrer && {\n Referer: referrer\n }), userAgent && {\n 'User-Agent': userAgent\n });\n\n var request = __assign(__assign({}, url && {\n url: url\n }), {\n headers: headers\n });\n\n return __assign(__assign({}, event), {\n request: request\n });\n }\n\n return event;\n });\n };\n /**\n * @inheritDoc\n */\n\n\n UserAgent.id = 'UserAgent';\n return UserAgent;\n}();\n\nexport { UserAgent };","import { getCurrentHub, initAndBind, Integrations as CoreIntegrations, SDK_VERSION } from '@sentry/core';\nimport { addInstrumentationHandler, getGlobalObject, logger, SyncPromise } from '@sentry/utils';\nimport { BrowserClient } from './client';\nimport { wrap as internalWrap } from './helpers';\nimport { Breadcrumbs, GlobalHandlers, LinkedErrors, TryCatch, UserAgent } from './integrations';\nexport var defaultIntegrations = [new CoreIntegrations.InboundFilters(), new CoreIntegrations.FunctionToString(), new TryCatch(), new Breadcrumbs(), new GlobalHandlers(), new LinkedErrors(), new UserAgent()];\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n * dsn: '__DSN__',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { configureScope } from '@sentry/browser';\n * configureScope((scope: Scope) => {\n * scope.setExtra({ battery: 0.7 });\n * scope.setTag({ user_mode: 'admin' });\n * scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n * message: 'My Breadcrumb',\n * // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n * message: 'Manual',\n * stacktrace: [\n * // ...\n * ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\n\nexport function init(options) {\n if (options === void 0) {\n options = {};\n }\n\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = defaultIntegrations;\n }\n\n if (options.release === undefined) {\n var window_1 = getGlobalObject(); // This supports the variable that sentry-webpack-plugin injects\n\n if (window_1.SENTRY_RELEASE && window_1.SENTRY_RELEASE.id) {\n options.release = window_1.SENTRY_RELEASE.id;\n }\n }\n\n if (options.autoSessionTracking === undefined) {\n options.autoSessionTracking = true;\n }\n\n options._metadata = options._metadata || {};\n options._metadata.sdk = {\n name: 'sentry.javascript.browser',\n packages: [{\n name: 'npm:@sentry/browser',\n version: SDK_VERSION\n }],\n version: SDK_VERSION\n };\n initAndBind(BrowserClient, options);\n\n if (options.autoSessionTracking) {\n startSessionTracking();\n }\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 global scope.\n */\n\nexport function showReportDialog(options) {\n if (options === void 0) {\n options = {};\n }\n\n if (!options.eventId) {\n options.eventId = getCurrentHub().lastEventId();\n }\n\n var client = getCurrentHub().getClient();\n\n if (client) {\n client.showReportDialog(options);\n }\n}\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\n\nexport function lastEventId() {\n return getCurrentHub().lastEventId();\n}\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\n\nexport function forceLoad() {// Noop\n}\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\n\nexport function onLoad(callback) {\n callback();\n}\n/**\n * A promise that resolves when all current events have been sent.\n * If you provide a timeout and the queue takes longer to drain the promise returns false.\n *\n * @param timeout Maximum time in ms the client should wait.\n */\n\nexport function flush(timeout) {\n var client = getCurrentHub().getClient();\n\n if (client) {\n return client.flush(timeout);\n }\n\n return SyncPromise.reject(false);\n}\n/**\n * A promise that resolves when all current events have been sent.\n * If you provide a timeout and the queue takes longer to drain the promise returns false.\n *\n * @param timeout Maximum time in ms the client should wait.\n */\n\nexport function close(timeout) {\n var client = getCurrentHub().getClient();\n\n if (client) {\n return client.close(timeout);\n }\n\n return SyncPromise.reject(false);\n}\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nexport function wrap(fn) {\n return internalWrap(fn)();\n}\n/**\n * Enable automatic Session Tracking for the initial page load.\n */\n\nfunction startSessionTracking() {\n var window = getGlobalObject();\n var document = window.document;\n\n if (typeof document === 'undefined') {\n logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n return;\n }\n\n var hub = getCurrentHub();\n hub.startSession();\n hub.captureSession(); // We want to create a session for every navigation as well\n\n addInstrumentationHandler({\n callback: function callback() {\n hub.startSession();\n hub.captureSession();\n },\n type: 'history'\n });\n}","import { getCurrentHub } from '@sentry/hub';\nexport var TRACEPARENT_REGEXP = new RegExp('^[ \\\\t]*' + // whitespace\n'([0-9a-f]{32})?' + // trace_id\n'-?([0-9a-f]{16})?' + // span_id\n'-?([01])?' + // sampled\n'[ \\\\t]*$');\n/**\n * Determines if tracing is currently enabled.\n *\n * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.\n */\n\nexport function hasTracingEnabled(options) {\n return 'tracesSampleRate' in options || 'tracesSampler' in options;\n}\n/**\n * Extract transaction context data from a `sentry-trace` header.\n *\n * @param traceparent Traceparent string\n *\n * @returns Object containing data from the header, or undefined if traceparent string is malformed\n */\n\nexport function extractTraceparentData(traceparent) {\n var matches = traceparent.match(TRACEPARENT_REGEXP);\n\n if (matches) {\n var parentSampled = void 0;\n\n if (matches[3] === '1') {\n parentSampled = true;\n } else if (matches[3] === '0') {\n parentSampled = false;\n }\n\n return {\n traceId: matches[1],\n parentSampled: parentSampled,\n parentSpanId: matches[2]\n };\n }\n\n return undefined;\n}\n/** Grabs active transaction off scope, if any */\n\nexport function getActiveTransaction(hub) {\n if (hub === void 0) {\n hub = getCurrentHub();\n }\n\n var _a, _b;\n\n return (_b = (_a = hub) === null || _a === void 0 ? void 0 : _a.getScope()) === null || _b === void 0 ? void 0 : _b.getTransaction();\n}\n/**\n * Converts from milliseconds to seconds\n * @param time time in ms\n */\n\nexport function msToSec(time) {\n return time / 1000;\n}\n/**\n * Converts from seconds to milliseconds\n * @param time time in seconds\n */\n\nexport function secToMs(time) {\n return time * 1000;\n} // so it can be used in manual instrumentation without necessitating a hard dependency on @sentry/utils\n\nexport { stripUrlQueryAndFragment } from '@sentry/utils';","import { addInstrumentationHandler, logger } from '@sentry/utils';\nimport { SpanStatus } from './spanstatus';\nimport { getActiveTransaction } from './utils';\n/**\n * Configures global error listeners\n */\n\nexport function registerErrorInstrumentation() {\n addInstrumentationHandler({\n callback: errorCallback,\n type: 'error'\n });\n addInstrumentationHandler({\n callback: errorCallback,\n type: 'unhandledrejection'\n });\n}\n/**\n * If an error or unhandled promise occurs, we mark the active transaction as failed\n */\n\nfunction errorCallback() {\n var activeTransaction = getActiveTransaction();\n\n if (activeTransaction) {\n logger.log(\"[Tracing] Transaction: \" + SpanStatus.InternalError + \" -> Global error occured\");\n activeTransaction.setStatus(SpanStatus.InternalError);\n }\n}","import { __assign } from \"tslib\";\nimport { dropUndefinedKeys, timestampWithMs, uuid4 } from '@sentry/utils';\nimport { SpanStatus } from './spanstatus';\n/**\n * Keeps track of finished spans for a given transaction\n * @internal\n * @hideconstructor\n * @hidden\n */\n\nvar SpanRecorder =\n/** @class */\nfunction () {\n function SpanRecorder(maxlen) {\n if (maxlen === void 0) {\n maxlen = 1000;\n }\n\n this.spans = [];\n this._maxlen = maxlen;\n }\n /**\n * This is just so that we don't run out of memory while recording a lot\n * of spans. At some point we just stop and flush out the start of the\n * trace tree (i.e.the first n spans with the smallest\n * start_timestamp).\n */\n\n\n SpanRecorder.prototype.add = function (span) {\n if (this.spans.length > this._maxlen) {\n span.spanRecorder = undefined;\n } else {\n this.spans.push(span);\n }\n };\n\n return SpanRecorder;\n}();\n\nexport { SpanRecorder };\n/**\n * Span contains all data about a span\n */\n\nvar Span =\n/** @class */\nfunction () {\n /**\n * You should never call the constructor manually, always use `Sentry.startTransaction()`\n * or call `startChild()` on an existing span.\n * @internal\n * @hideconstructor\n * @hidden\n */\n function Span(spanContext) {\n /**\n * @inheritDoc\n */\n this.traceId = uuid4();\n /**\n * @inheritDoc\n */\n\n this.spanId = uuid4().substring(16);\n /**\n * Timestamp in seconds when the span was created.\n */\n\n this.startTimestamp = timestampWithMs();\n /**\n * @inheritDoc\n */\n\n this.tags = {};\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n this.data = {};\n\n if (!spanContext) {\n return this;\n }\n\n if (spanContext.traceId) {\n this.traceId = spanContext.traceId;\n }\n\n if (spanContext.spanId) {\n this.spanId = spanContext.spanId;\n }\n\n if (spanContext.parentSpanId) {\n this.parentSpanId = spanContext.parentSpanId;\n } // We want to include booleans as well here\n\n\n if ('sampled' in spanContext) {\n this.sampled = spanContext.sampled;\n }\n\n if (spanContext.op) {\n this.op = spanContext.op;\n }\n\n if (spanContext.description) {\n this.description = spanContext.description;\n }\n\n if (spanContext.data) {\n this.data = spanContext.data;\n }\n\n if (spanContext.tags) {\n this.tags = spanContext.tags;\n }\n\n if (spanContext.status) {\n this.status = spanContext.status;\n }\n\n if (spanContext.startTimestamp) {\n this.startTimestamp = spanContext.startTimestamp;\n }\n\n if (spanContext.endTimestamp) {\n this.endTimestamp = spanContext.endTimestamp;\n }\n }\n /**\n * @inheritDoc\n * @deprecated\n */\n\n\n Span.prototype.child = function (spanContext) {\n return this.startChild(spanContext);\n };\n /**\n * @inheritDoc\n */\n\n\n Span.prototype.startChild = function (spanContext) {\n var childSpan = new Span(__assign(__assign({}, spanContext), {\n parentSpanId: this.spanId,\n sampled: this.sampled,\n traceId: this.traceId\n }));\n childSpan.spanRecorder = this.spanRecorder;\n\n if (childSpan.spanRecorder) {\n childSpan.spanRecorder.add(childSpan);\n }\n\n childSpan.transaction = this.transaction;\n return childSpan;\n };\n /**\n * @inheritDoc\n */\n\n\n Span.prototype.setTag = function (key, value) {\n var _a;\n\n this.tags = __assign(__assign({}, this.tags), (_a = {}, _a[key] = value, _a));\n return this;\n };\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n\n Span.prototype.setData = function (key, value) {\n var _a;\n\n this.data = __assign(__assign({}, this.data), (_a = {}, _a[key] = value, _a));\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Span.prototype.setStatus = function (value) {\n this.status = value;\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Span.prototype.setHttpStatus = function (httpStatus) {\n this.setTag('http.status_code', String(httpStatus));\n var spanStatus = SpanStatus.fromHttpCode(httpStatus);\n\n if (spanStatus !== SpanStatus.UnknownError) {\n this.setStatus(spanStatus);\n }\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Span.prototype.isSuccess = function () {\n return this.status === SpanStatus.Ok;\n };\n /**\n * @inheritDoc\n */\n\n\n Span.prototype.finish = function (endTimestamp) {\n this.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : timestampWithMs();\n };\n /**\n * @inheritDoc\n */\n\n\n Span.prototype.toTraceparent = function () {\n var sampledString = '';\n\n if (this.sampled !== undefined) {\n sampledString = this.sampled ? '-1' : '-0';\n }\n\n return this.traceId + \"-\" + this.spanId + sampledString;\n };\n /**\n * @inheritDoc\n */\n\n\n Span.prototype.toContext = function () {\n return dropUndefinedKeys({\n data: this.data,\n description: this.description,\n endTimestamp: this.endTimestamp,\n op: this.op,\n parentSpanId: this.parentSpanId,\n sampled: this.sampled,\n spanId: this.spanId,\n startTimestamp: this.startTimestamp,\n status: this.status,\n tags: this.tags,\n traceId: this.traceId\n });\n };\n /**\n * @inheritDoc\n */\n\n\n Span.prototype.updateWithContext = function (spanContext) {\n var _a, _b, _c, _d, _e;\n\n this.data = (_a = spanContext.data, _a !== null && _a !== void 0 ? _a : {});\n this.description = spanContext.description;\n this.endTimestamp = spanContext.endTimestamp;\n this.op = spanContext.op;\n this.parentSpanId = spanContext.parentSpanId;\n this.sampled = spanContext.sampled;\n this.spanId = (_b = spanContext.spanId, _b !== null && _b !== void 0 ? _b : this.spanId);\n this.startTimestamp = (_c = spanContext.startTimestamp, _c !== null && _c !== void 0 ? _c : this.startTimestamp);\n this.status = spanContext.status;\n this.tags = (_d = spanContext.tags, _d !== null && _d !== void 0 ? _d : {});\n this.traceId = (_e = spanContext.traceId, _e !== null && _e !== void 0 ? _e : this.traceId);\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Span.prototype.getTraceContext = function () {\n return dropUndefinedKeys({\n data: Object.keys(this.data).length > 0 ? this.data : undefined,\n description: this.description,\n op: this.op,\n parent_span_id: this.parentSpanId,\n span_id: this.spanId,\n status: this.status,\n tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n trace_id: this.traceId\n });\n };\n /**\n * @inheritDoc\n */\n\n\n Span.prototype.toJSON = function () {\n return dropUndefinedKeys({\n data: Object.keys(this.data).length > 0 ? this.data : undefined,\n description: this.description,\n op: this.op,\n parent_span_id: this.parentSpanId,\n span_id: this.spanId,\n start_timestamp: this.startTimestamp,\n status: this.status,\n tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n timestamp: this.endTimestamp,\n trace_id: this.traceId\n });\n };\n\n return Span;\n}();\n\nexport { Span };","import { __assign, __extends } from \"tslib\";\nimport { getCurrentHub, Hub } from '@sentry/hub';\nimport { dropUndefinedKeys, isInstanceOf, logger } from '@sentry/utils';\nimport { Span as SpanClass, SpanRecorder } from './span';\n/** JSDoc */\n\nvar Transaction =\n/** @class */\nfunction (_super) {\n __extends(Transaction, _super);\n /**\n * This constructor should never be called manually. Those instrumenting tracing should use\n * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`.\n * @internal\n * @hideconstructor\n * @hidden\n */\n\n\n function Transaction(transactionContext, hub) {\n var _this = _super.call(this, transactionContext) || this;\n\n _this._metadata = {};\n _this._measurements = {};\n /**\n * The reference to the current hub.\n */\n\n _this._hub = getCurrentHub();\n\n if (isInstanceOf(hub, Hub)) {\n _this._hub = hub;\n }\n\n _this.name = transactionContext.name || '';\n _this._trimEnd = transactionContext.trimEnd; // this is because transactions are also spans, and spans have a transaction pointer\n\n _this.transaction = _this;\n return _this;\n }\n /**\n * JSDoc\n */\n\n\n Transaction.prototype.setName = function (name) {\n this.name = name;\n };\n /**\n * Attaches SpanRecorder to the span itself\n * @param maxlen maximum number of spans that can be recorded\n */\n\n\n Transaction.prototype.initSpanRecorder = function (maxlen) {\n if (maxlen === void 0) {\n maxlen = 1000;\n }\n\n if (!this.spanRecorder) {\n this.spanRecorder = new SpanRecorder(maxlen);\n }\n\n this.spanRecorder.add(this);\n };\n /**\n * Set observed measurements for this transaction.\n * @hidden\n */\n\n\n Transaction.prototype.setMeasurements = function (measurements) {\n this._measurements = __assign({}, measurements);\n };\n /**\n * Set metadata for this transaction.\n * @hidden\n */\n\n\n Transaction.prototype.setMetadata = function (newMetadata) {\n this._metadata = __assign(__assign({}, this._metadata), newMetadata);\n };\n /**\n * @inheritDoc\n */\n\n\n Transaction.prototype.finish = function (endTimestamp) {\n var _this = this; // This transaction is already finished, so we should not flush it again.\n\n\n if (this.endTimestamp !== undefined) {\n return undefined;\n }\n\n if (!this.name) {\n logger.warn('Transaction has no name, falling back to ``.');\n this.name = '';\n } // just sets the end timestamp\n\n\n _super.prototype.finish.call(this, endTimestamp);\n\n if (this.sampled !== true) {\n // At this point if `sampled !== true` we want to discard the transaction.\n logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.');\n return undefined;\n }\n\n var finishedSpans = this.spanRecorder ? this.spanRecorder.spans.filter(function (s) {\n return s !== _this && s.endTimestamp;\n }) : [];\n\n if (this._trimEnd && finishedSpans.length > 0) {\n this.endTimestamp = finishedSpans.reduce(function (prev, current) {\n if (prev.endTimestamp && current.endTimestamp) {\n return prev.endTimestamp > current.endTimestamp ? prev : current;\n }\n\n return prev;\n }).endTimestamp;\n }\n\n var transaction = {\n contexts: {\n trace: this.getTraceContext()\n },\n spans: finishedSpans,\n start_timestamp: this.startTimestamp,\n tags: this.tags,\n timestamp: this.endTimestamp,\n transaction: this.name,\n type: 'transaction',\n debug_meta: this._metadata\n };\n var hasMeasurements = Object.keys(this._measurements).length > 0;\n\n if (hasMeasurements) {\n logger.log('[Measurements] Adding measurements to transaction', JSON.stringify(this._measurements, undefined, 2));\n transaction.measurements = this._measurements;\n }\n\n return this._hub.captureEvent(transaction);\n };\n /**\n * @inheritDoc\n */\n\n\n Transaction.prototype.toContext = function () {\n var spanContext = _super.prototype.toContext.call(this);\n\n return dropUndefinedKeys(__assign(__assign({}, spanContext), {\n name: this.name,\n trimEnd: this._trimEnd\n }));\n };\n /**\n * @inheritDoc\n */\n\n\n Transaction.prototype.updateWithContext = function (transactionContext) {\n var _a;\n\n _super.prototype.updateWithContext.call(this, transactionContext);\n\n this.name = (_a = transactionContext.name, _a !== null && _a !== void 0 ? _a : '');\n this._trimEnd = transactionContext.trimEnd;\n return this;\n };\n\n return Transaction;\n}(SpanClass);\n\nexport { Transaction };","import { __extends, __values } from \"tslib\";\nimport { logger, timestampWithMs } from '@sentry/utils';\nimport { SpanRecorder } from './span';\nimport { SpanStatus } from './spanstatus';\nimport { Transaction } from './transaction';\nexport var DEFAULT_IDLE_TIMEOUT = 1000;\n/**\n * @inheritDoc\n */\n\nvar IdleTransactionSpanRecorder =\n/** @class */\nfunction (_super) {\n __extends(IdleTransactionSpanRecorder, _super);\n\n function IdleTransactionSpanRecorder(_pushActivity, _popActivity, transactionSpanId, maxlen) {\n if (transactionSpanId === void 0) {\n transactionSpanId = '';\n }\n\n var _this = _super.call(this, maxlen) || this;\n\n _this._pushActivity = _pushActivity;\n _this._popActivity = _popActivity;\n _this.transactionSpanId = transactionSpanId;\n return _this;\n }\n /**\n * @inheritDoc\n */\n\n\n IdleTransactionSpanRecorder.prototype.add = function (span) {\n var _this = this; // We should make sure we do not push and pop activities for\n // the transaction that this span recorder belongs to.\n\n\n if (span.spanId !== this.transactionSpanId) {\n // We patch span.finish() to pop an activity after setting an endTimestamp.\n span.finish = function (endTimestamp) {\n span.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : timestampWithMs();\n\n _this._popActivity(span.spanId);\n }; // We should only push new activities if the span does not have an end timestamp.\n\n\n if (span.endTimestamp === undefined) {\n this._pushActivity(span.spanId);\n }\n }\n\n _super.prototype.add.call(this, span);\n };\n\n return IdleTransactionSpanRecorder;\n}(SpanRecorder);\n\nexport { IdleTransactionSpanRecorder };\n/**\n * An IdleTransaction is a transaction that automatically finishes. It does this by tracking child spans as activities.\n * You can have multiple IdleTransactions active, but if the `onScope` option is specified, the idle transaction will\n * put itself on the scope on creation.\n */\n\nvar IdleTransaction =\n/** @class */\nfunction (_super) {\n __extends(IdleTransaction, _super);\n\n function IdleTransaction(transactionContext, _idleHub, // The time to wait in ms until the idle transaction will be finished. Default: 1000\n _idleTimeout, // If an idle transaction should be put itself on and off the scope automatically.\n _onScope) {\n if (_idleTimeout === void 0) {\n _idleTimeout = DEFAULT_IDLE_TIMEOUT;\n }\n\n if (_onScope === void 0) {\n _onScope = false;\n }\n\n var _this = _super.call(this, transactionContext, _idleHub) || this;\n\n _this._idleHub = _idleHub;\n _this._idleTimeout = _idleTimeout;\n _this._onScope = _onScope; // Activities store a list of active spans\n\n _this.activities = {}; // Stores reference to the timeout that calls _beat().\n\n _this._heartbeatTimer = 0; // Amount of times heartbeat has counted. Will cause transaction to finish after 3 beats.\n\n _this._heartbeatCounter = 0; // We should not use heartbeat if we finished a transaction\n\n _this._finished = false;\n _this._beforeFinishCallbacks = [];\n\n if (_idleHub && _onScope) {\n // There should only be one active transaction on the scope\n clearActiveTransaction(_idleHub); // We set the transaction here on the scope so error events pick up the trace\n // context and attach it to the error.\n\n logger.log(\"Setting idle transaction on scope. Span ID: \" + _this.spanId);\n\n _idleHub.configureScope(function (scope) {\n return scope.setSpan(_this);\n });\n }\n\n _this._initTimeout = setTimeout(function () {\n if (!_this._finished) {\n _this.finish();\n }\n }, _this._idleTimeout);\n return _this;\n }\n /** {@inheritDoc} */\n\n\n IdleTransaction.prototype.finish = function (endTimestamp) {\n var e_1, _a;\n\n var _this = this;\n\n if (endTimestamp === void 0) {\n endTimestamp = timestampWithMs();\n }\n\n this._finished = true;\n this.activities = {};\n\n if (this.spanRecorder) {\n logger.log('[Tracing] finishing IdleTransaction', new Date(endTimestamp * 1000).toISOString(), this.op);\n\n try {\n for (var _b = __values(this._beforeFinishCallbacks), _c = _b.next(); !_c.done; _c = _b.next()) {\n var callback = _c.value;\n callback(this, endTimestamp);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b[\"return\"])) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n this.spanRecorder.spans = this.spanRecorder.spans.filter(function (span) {\n // If we are dealing with the transaction itself, we just return it\n if (span.spanId === _this.spanId) {\n return true;\n } // We cancel all pending spans with status \"cancelled\" to indicate the idle transaction was finished early\n\n\n if (!span.endTimestamp) {\n span.endTimestamp = endTimestamp;\n span.setStatus(SpanStatus.Cancelled);\n logger.log('[Tracing] cancelling span since transaction ended early', JSON.stringify(span, undefined, 2));\n }\n\n var keepSpan = span.startTimestamp < endTimestamp;\n\n if (!keepSpan) {\n logger.log('[Tracing] discarding Span since it happened after Transaction was finished', JSON.stringify(span, undefined, 2));\n }\n\n return keepSpan;\n });\n logger.log('[Tracing] flushing IdleTransaction');\n } else {\n logger.log('[Tracing] No active IdleTransaction');\n } // this._onScope is true if the transaction was previously on the scope.\n\n\n if (this._onScope) {\n clearActiveTransaction(this._idleHub);\n }\n\n return _super.prototype.finish.call(this, endTimestamp);\n };\n /**\n * Register a callback function that gets excecuted before the transaction finishes.\n * Useful for cleanup or if you want to add any additional spans based on current context.\n *\n * This is exposed because users have no other way of running something before an idle transaction\n * finishes.\n */\n\n\n IdleTransaction.prototype.registerBeforeFinishCallback = function (callback) {\n this._beforeFinishCallbacks.push(callback);\n };\n /**\n * @inheritDoc\n */\n\n\n IdleTransaction.prototype.initSpanRecorder = function (maxlen) {\n var _this = this;\n\n if (!this.spanRecorder) {\n var pushActivity = function pushActivity(id) {\n if (_this._finished) {\n return;\n }\n\n _this._pushActivity(id);\n };\n\n var popActivity = function popActivity(id) {\n if (_this._finished) {\n return;\n }\n\n _this._popActivity(id);\n };\n\n this.spanRecorder = new IdleTransactionSpanRecorder(pushActivity, popActivity, this.spanId, maxlen); // Start heartbeat so that transactions do not run forever.\n\n logger.log('Starting heartbeat');\n\n this._pingHeartbeat();\n }\n\n this.spanRecorder.add(this);\n };\n /**\n * Start tracking a specific activity.\n * @param spanId The span id that represents the activity\n */\n\n\n IdleTransaction.prototype._pushActivity = function (spanId) {\n if (this._initTimeout) {\n clearTimeout(this._initTimeout);\n this._initTimeout = undefined;\n }\n\n logger.log(\"[Tracing] pushActivity: \" + spanId);\n this.activities[spanId] = true;\n logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n };\n /**\n * Remove an activity from usage\n * @param spanId The span id that represents the activity\n */\n\n\n IdleTransaction.prototype._popActivity = function (spanId) {\n var _this = this;\n\n if (this.activities[spanId]) {\n logger.log(\"[Tracing] popActivity \" + spanId); // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\n delete this.activities[spanId];\n logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n }\n\n if (Object.keys(this.activities).length === 0) {\n var timeout = this._idleTimeout; // We need to add the timeout here to have the real endtimestamp of the transaction\n // Remember timestampWithMs is in seconds, timeout is in ms\n\n var end_1 = timestampWithMs() + timeout / 1000;\n setTimeout(function () {\n if (!_this._finished) {\n _this.finish(end_1);\n }\n }, timeout);\n }\n };\n /**\n * Checks when entries of this.activities are not changing for 3 beats.\n * If this occurs we finish the transaction.\n */\n\n\n IdleTransaction.prototype._beat = function () {\n clearTimeout(this._heartbeatTimer); // We should not be running heartbeat if the idle transaction is finished.\n\n if (this._finished) {\n return;\n }\n\n var keys = Object.keys(this.activities);\n var heartbeatString = keys.length ? keys.reduce(function (prev, current) {\n return prev + current;\n }) : '';\n\n if (heartbeatString === this._prevHeartbeatString) {\n this._heartbeatCounter += 1;\n } else {\n this._heartbeatCounter = 1;\n }\n\n this._prevHeartbeatString = heartbeatString;\n\n if (this._heartbeatCounter >= 3) {\n logger.log(\"[Tracing] Transaction finished because of no change for 3 heart beats\");\n this.setStatus(SpanStatus.DeadlineExceeded);\n this.setTag('heartbeat', 'failed');\n this.finish();\n } else {\n this._pingHeartbeat();\n }\n };\n /**\n * Pings the heartbeat\n */\n\n\n IdleTransaction.prototype._pingHeartbeat = function () {\n var _this = this;\n\n logger.log(\"pinging Heartbeat -> current counter: \" + this._heartbeatCounter);\n this._heartbeatTimer = setTimeout(function () {\n _this._beat();\n }, 5000);\n };\n\n return IdleTransaction;\n}(Transaction);\n\nexport { IdleTransaction };\n/**\n * Reset active transaction on scope\n */\n\nfunction clearActiveTransaction(hub) {\n if (hub) {\n var scope = hub.getScope();\n\n if (scope) {\n var transaction = scope.getTransaction();\n\n if (transaction) {\n scope.setSpan(undefined);\n }\n }\n }\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { __assign } from \"tslib\";\nimport { getMainCarrier } from '@sentry/hub';\nimport { TransactionSamplingMethod } from '@sentry/types';\nimport { logger } from '@sentry/utils';\nimport { registerErrorInstrumentation } from './errors';\nimport { IdleTransaction } from './idletransaction';\nimport { Transaction } from './transaction';\nimport { hasTracingEnabled } from './utils';\n/** Returns all trace headers that are currently on the top scope. */\n\nfunction traceHeaders() {\n var scope = this.getScope();\n\n if (scope) {\n var span = scope.getSpan();\n\n if (span) {\n return {\n 'sentry-trace': span.toTraceparent()\n };\n }\n }\n\n return {};\n}\n/**\n * Makes a sampling decision for the given transaction and stores it on the transaction.\n *\n * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be\n * sent to Sentry.\n *\n * @param hub: The hub off of which to read config options\n * @param transaction: The transaction needing a sampling decision\n * @param samplingContext: Default and user-provided data which may be used to help make the decision\n *\n * @returns The given transaction with its `sampled` value set\n */\n\n\nfunction sample(transaction, options, samplingContext) {\n // nothing to do if tracing is not enabled\n if (!hasTracingEnabled(options)) {\n transaction.sampled = false;\n return transaction;\n } // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that\n\n\n if (transaction.sampled !== undefined) {\n transaction.setMetadata({\n transactionSampling: {\n method: TransactionSamplingMethod.Explicit\n }\n });\n return transaction;\n } // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` were defined, so one of these should\n // work; prefer the hook if so\n\n\n var sampleRate;\n\n if (typeof options.tracesSampler === 'function') {\n sampleRate = options.tracesSampler(samplingContext);\n transaction.setMetadata({\n transactionSampling: {\n method: TransactionSamplingMethod.Sampler,\n // cast to number in case it's a boolean\n rate: Number(sampleRate)\n }\n });\n } else if (samplingContext.parentSampled !== undefined) {\n sampleRate = samplingContext.parentSampled;\n transaction.setMetadata({\n transactionSampling: {\n method: TransactionSamplingMethod.Inheritance\n }\n });\n } else {\n sampleRate = options.tracesSampleRate;\n transaction.setMetadata({\n transactionSampling: {\n method: TransactionSamplingMethod.Rate,\n // cast to number in case it's a boolean\n rate: Number(sampleRate)\n }\n });\n } // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n // only valid values are booleans or numbers between 0 and 1.)\n\n\n if (!isValidSampleRate(sampleRate)) {\n logger.warn(\"[Tracing] Discarding transaction because of invalid sample rate.\");\n transaction.sampled = false;\n return transaction;\n } // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped\n\n\n if (!sampleRate) {\n logger.log(\"[Tracing] Discarding transaction because \" + (typeof options.tracesSampler === 'function' ? 'tracesSampler returned 0 or false' : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'));\n transaction.sampled = false;\n return transaction;\n } // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n\n\n transaction.sampled = Math.random() < sampleRate; // if we're not going to keep it, we're done\n\n if (!transaction.sampled) {\n logger.log(\"[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = \" + Number(sampleRate) + \")\");\n return transaction;\n }\n\n logger.log(\"[Tracing] starting \" + transaction.op + \" transaction - \" + transaction.name);\n return transaction;\n}\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\n\n\nfunction isValidSampleRate(rate) {\n // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {\n logger.warn(\"[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got \" + JSON.stringify(rate) + \" of type \" + JSON.stringify(_typeof(rate)) + \".\");\n return false;\n } // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n\n\n if (rate < 0 || rate > 1) {\n logger.warn(\"[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got \" + rate + \".\");\n return false;\n }\n\n return true;\n}\n/**\n * Creates a new transaction and adds a sampling decision if it doesn't yet have one.\n *\n * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if\n * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an\n * \"extension method.\"\n *\n * @param this: The Hub starting the transaction\n * @param transactionContext: Data used to configure the transaction\n * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any)\n *\n * @returns The new transaction\n *\n * @see {@link Hub.startTransaction}\n */\n\n\nfunction _startTransaction(transactionContext, customSamplingContext) {\n var _a, _b;\n\n var options = ((_a = this.getClient()) === null || _a === void 0 ? void 0 : _a.getOptions()) || {};\n var transaction = new Transaction(transactionContext, this);\n transaction = sample(transaction, options, __assign({\n parentSampled: transactionContext.parentSampled,\n transactionContext: transactionContext\n }, customSamplingContext));\n\n if (transaction.sampled) {\n transaction.initSpanRecorder((_b = options._experiments) === null || _b === void 0 ? void 0 : _b.maxSpans);\n }\n\n return transaction;\n}\n/**\n * Create new idle transaction.\n */\n\n\nexport function startIdleTransaction(hub, transactionContext, idleTimeout, onScope, customSamplingContext) {\n var _a, _b;\n\n var options = ((_a = hub.getClient()) === null || _a === void 0 ? void 0 : _a.getOptions()) || {};\n var transaction = new IdleTransaction(transactionContext, hub, idleTimeout, onScope);\n transaction = sample(transaction, options, __assign({\n parentSampled: transactionContext.parentSampled,\n transactionContext: transactionContext\n }, customSamplingContext));\n\n if (transaction.sampled) {\n transaction.initSpanRecorder((_b = options._experiments) === null || _b === void 0 ? void 0 : _b.maxSpans);\n }\n\n return transaction;\n}\n/**\n * @private\n */\n\nexport function _addTracingExtensions() {\n var carrier = getMainCarrier();\n\n if (carrier.__SENTRY__) {\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n\n if (!carrier.__SENTRY__.extensions.startTransaction) {\n carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n }\n\n if (!carrier.__SENTRY__.extensions.traceHeaders) {\n carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n }\n }\n}\n/**\n * This patches the global object and injects the Tracing extensions methods\n */\n\nexport function addExtensionMethods() {\n _addTracingExtensions(); // If an error happens globally, we should make sure transaction status is set to error.\n\n\n registerErrorInstrumentation();\n}","import { getGlobalObject, logger } from '@sentry/utils';\nimport { SpanStatus } from '../spanstatus';\nimport { getActiveTransaction } from '../utils';\nvar global = getGlobalObject();\n/**\n * Add a listener that cancels and finishes a transaction when the global\n * document is hidden.\n */\n\nexport function registerBackgroundTabDetection() {\n if (global && global.document) {\n global.document.addEventListener('visibilitychange', function () {\n var activeTransaction = getActiveTransaction();\n\n if (global.document.hidden && activeTransaction) {\n logger.log(\"[Tracing] Transaction: \" + SpanStatus.Cancelled + \" -> since tab moved to the background, op: \" + activeTransaction.op); // We should not set status if it is already set, this prevent important statuses like\n // error or data loss from being overwritten on transaction.\n\n if (!activeTransaction.status) {\n activeTransaction.setStatus(SpanStatus.Cancelled);\n }\n\n activeTransaction.setTag('visibilitychange', 'document.hidden');\n activeTransaction.finish();\n }\n });\n } else {\n logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n }\n}","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport var bindReporter = function bindReporter(callback, metric, po, observeAllUpdates) {\n var prevValue;\n return function () {\n if (po && metric.isFinal) {\n po.disconnect();\n }\n\n if (metric.value >= 0) {\n if (observeAllUpdates || metric.isFinal || document.visibilityState === 'hidden') {\n metric.delta = metric.value - (prevValue || 0); // Report the metric if there's a non-zero delta, if the metric is\n // final, or if no previous value exists (which can happen in the case\n // of the document becoming hidden when the metric value is 0).\n // See: https://github.com/GoogleChrome/web-vitals/issues/14\n\n if (metric.delta || metric.isFinal || prevValue === undefined) {\n callback(metric);\n prevValue = metric.value;\n }\n }\n }\n };\n};","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { onHidden } from './onHidden';\nvar firstHiddenTime;\nexport var getFirstHidden = function getFirstHidden() {\n if (firstHiddenTime === undefined) {\n // If the document is hidden when this code runs, assume it was hidden\n // since navigation start. This isn't a perfect heuristic, but it's the\n // best we can do until an API is available to support querying past\n // visibilityState.\n firstHiddenTime = document.visibilityState === 'hidden' ? 0 : Infinity; // Update the time if/when the document becomes hidden.\n\n onHidden(function (_a) {\n var timeStamp = _a.timeStamp;\n return firstHiddenTime = timeStamp;\n }, true);\n }\n\n return {\n get timeStamp() {\n return firstHiddenTime;\n }\n\n };\n};","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar inputPromise;\nexport var whenInput = function whenInput() {\n if (!inputPromise) {\n inputPromise = new Promise(function (r) {\n return ['scroll', 'keydown', 'pointerdown'].map(function (type) {\n addEventListener(type, r, {\n once: true,\n passive: true,\n capture: true\n });\n });\n });\n }\n\n return inputPromise;\n};","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { generateUniqueID } from './generateUniqueID';\nexport var initMetric = function initMetric(name, value) {\n if (value === void 0) {\n value = -1;\n }\n\n return {\n name: name,\n value: value,\n delta: 0,\n entries: [],\n id: generateUniqueID(),\n isFinal: false\n };\n};","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Performantly generate a unique, 27-char string by combining the current\n * timestamp with a 13-digit random number.\n * @return {string}\n */\nexport var generateUniqueID = function generateUniqueID() {\n return Date.now() + \"-\" + (Math.floor(Math.random() * (9e12 - 1)) + 1e12);\n};","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Takes a performance entry type and a callback function, and creates a\n * `PerformanceObserver` instance that will observe the specified entry type\n * with buffering enabled and call the callback _for each entry_.\n *\n * This function also feature-detects entry support and wraps the logic in a\n * try/catch to avoid errors in unsupporting browsers.\n */\nexport var observe = function observe(type, callback) {\n try {\n if (PerformanceObserver.supportedEntryTypes.includes(type)) {\n var po = new PerformanceObserver(function (l) {\n return l.getEntries().map(callback);\n });\n po.observe({\n type: type,\n buffered: true\n });\n return po;\n }\n } catch (e) {// Do nothing.\n }\n\n return;\n};","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar isUnloading = false;\nvar listenersAdded = false;\n\nvar onPageHide = function onPageHide(event) {\n isUnloading = !event.persisted;\n};\n\nvar addListeners = function addListeners() {\n addEventListener('pagehide', onPageHide); // `beforeunload` is needed to fix this bug:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=987409\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n\n addEventListener('beforeunload', function () {});\n};\n\nexport var onHidden = function onHidden(cb, once) {\n if (once === void 0) {\n once = false;\n }\n\n if (!listenersAdded) {\n addListeners();\n listenersAdded = true;\n }\n\n addEventListener('visibilitychange', function (_a) {\n var timeStamp = _a.timeStamp;\n\n if (document.visibilityState === 'hidden') {\n cb({\n timeStamp: timeStamp,\n isUnloading: isUnloading\n });\n }\n }, {\n capture: true,\n once: once\n });\n};","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { bindReporter } from './lib/bindReporter';\nimport { getFirstHidden } from './lib/getFirstHidden';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport { whenInput } from './lib/whenInput';\nexport var getLCP = function getLCP(onReport, reportAllChanges) {\n if (reportAllChanges === void 0) {\n reportAllChanges = false;\n }\n\n var metric = initMetric('LCP');\n var firstHidden = getFirstHidden();\n var report;\n\n var entryHandler = function entryHandler(entry) {\n // The startTime attribute returns the value of the renderTime if it is not 0,\n // and the value of the loadTime otherwise.\n var value = entry.startTime; // If the page was hidden prior to paint time of the entry,\n // ignore it and mark the metric as final, otherwise add the entry.\n\n if (value < firstHidden.timeStamp) {\n metric.value = value;\n metric.entries.push(entry);\n } else {\n metric.isFinal = true;\n }\n\n report();\n };\n\n var po = observe('largest-contentful-paint', entryHandler);\n\n if (po) {\n report = bindReporter(onReport, metric, po, reportAllChanges);\n\n var onFinal = function onFinal() {\n if (!metric.isFinal) {\n po.takeRecords().map(entryHandler);\n metric.isFinal = true;\n report();\n }\n };\n\n void whenInput().then(onFinal);\n onHidden(onFinal, true);\n }\n};","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getGlobalObject } from '@sentry/utils';\nimport { initMetric } from './lib/initMetric';\nvar global = getGlobalObject();\n\nvar afterLoad = function afterLoad(callback) {\n if (document.readyState === 'complete') {\n // Queue a task so the callback runs after `loadEventEnd`.\n setTimeout(callback, 0);\n } else {\n // Use `pageshow` so the callback runs after `loadEventEnd`.\n addEventListener('pageshow', callback);\n }\n};\n\nvar getNavigationEntryFromPerformanceTiming = function getNavigationEntryFromPerformanceTiming() {\n // Really annoying that TypeScript errors when using `PerformanceTiming`.\n // eslint-disable-next-line deprecation/deprecation\n var timing = global.performance.timing;\n var navigationEntry = {\n entryType: 'navigation',\n startTime: 0\n };\n\n for (var key in timing) {\n if (key !== 'navigationStart' && key !== 'toJSON') {\n navigationEntry[key] = Math.max(timing[key] - timing.navigationStart, 0);\n }\n }\n\n return navigationEntry;\n};\n\nexport var getTTFB = function getTTFB(onReport) {\n var metric = initMetric('TTFB');\n afterLoad(function () {\n try {\n // Use the NavigationTiming L2 entry if available.\n var navigationEntry = global.performance.getEntriesByType('navigation')[0] || getNavigationEntryFromPerformanceTiming();\n metric.value = metric.delta = navigationEntry.responseStart;\n metric.entries = [navigationEntry];\n onReport(metric);\n } catch (error) {// Do nothing.\n }\n });\n};","import { __assign, __rest } from \"tslib\";\nimport { browserPerformanceTimeOrigin, getGlobalObject, logger } from '@sentry/utils';\nimport { msToSec } from '../utils';\nimport { getCLS } from './web-vitals/getCLS';\nimport { getFID } from './web-vitals/getFID';\nimport { getLCP } from './web-vitals/getLCP';\nimport { getTTFB } from './web-vitals/getTTFB';\nimport { getFirstHidden } from './web-vitals/lib/getFirstHidden';\nvar global = getGlobalObject();\n/** Class tracking metrics */\n\nvar MetricsInstrumentation =\n/** @class */\nfunction () {\n function MetricsInstrumentation() {\n this._measurements = {};\n this._performanceCursor = 0;\n\n if (global && global.performance) {\n if (global.performance.mark) {\n global.performance.mark('sentry-tracing-init');\n }\n\n this._trackCLS();\n\n this._trackLCP();\n\n this._trackFID();\n\n this._trackTTFB();\n }\n }\n /** Add performance related spans to a transaction */\n\n\n MetricsInstrumentation.prototype.addPerformanceEntries = function (transaction) {\n var _this = this;\n\n if (!global || !global.performance || !global.performance.getEntries || !browserPerformanceTimeOrigin) {\n // Gatekeeper if performance API not available\n return;\n }\n\n logger.log('[Tracing] Adding & adjusting spans using Performance API');\n var timeOrigin = msToSec(browserPerformanceTimeOrigin);\n var entryScriptSrc;\n\n if (global.document) {\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (var i = 0; i < document.scripts.length; i++) {\n // We go through all scripts on the page and look for 'data-entry'\n // We remember the name and measure the time between this script finished loading and\n // our mark 'sentry-tracing-init'\n if (document.scripts[i].dataset.entry === 'true') {\n entryScriptSrc = document.scripts[i].src;\n break;\n }\n }\n }\n\n var entryScriptStartTimestamp;\n var tracingInitMarkStartTime;\n global.performance.getEntries().slice(this._performanceCursor).forEach(function (entry) {\n var startTime = msToSec(entry.startTime);\n var duration = msToSec(entry.duration);\n\n if (transaction.op === 'navigation' && timeOrigin + startTime < transaction.startTimestamp) {\n return;\n }\n\n switch (entry.entryType) {\n case 'navigation':\n addNavigationSpans(transaction, entry, timeOrigin);\n break;\n\n case 'mark':\n case 'paint':\n case 'measure':\n {\n var startTimestamp = addMeasureSpans(transaction, entry, startTime, duration, timeOrigin);\n\n if (tracingInitMarkStartTime === undefined && entry.name === 'sentry-tracing-init') {\n tracingInitMarkStartTime = startTimestamp;\n } // capture web vitals\n\n\n var firstHidden = getFirstHidden(); // Only report if the page wasn't hidden prior to the web vital.\n\n var shouldRecord = entry.startTime < firstHidden.timeStamp;\n\n if (entry.name === 'first-paint' && shouldRecord) {\n logger.log('[Measurements] Adding FP');\n _this._measurements['fp'] = {\n value: entry.startTime\n };\n _this._measurements['mark.fp'] = {\n value: startTimestamp\n };\n }\n\n if (entry.name === 'first-contentful-paint' && shouldRecord) {\n logger.log('[Measurements] Adding FCP');\n _this._measurements['fcp'] = {\n value: entry.startTime\n };\n _this._measurements['mark.fcp'] = {\n value: startTimestamp\n };\n }\n\n break;\n }\n\n case 'resource':\n {\n var resourceName = entry.name.replace(window.location.origin, '');\n var endTimestamp = addResourceSpans(transaction, entry, resourceName, startTime, duration, timeOrigin); // We remember the entry script end time to calculate the difference to the first init mark\n\n if (entryScriptStartTimestamp === undefined && (entryScriptSrc || '').indexOf(resourceName) > -1) {\n entryScriptStartTimestamp = endTimestamp;\n }\n\n break;\n }\n\n default: // Ignore other entry types.\n\n }\n });\n\n if (entryScriptStartTimestamp !== undefined && tracingInitMarkStartTime !== undefined) {\n _startChild(transaction, {\n description: 'evaluation',\n endTimestamp: tracingInitMarkStartTime,\n op: 'script',\n startTimestamp: entryScriptStartTimestamp\n });\n }\n\n this._performanceCursor = Math.max(performance.getEntries().length - 1, 0);\n\n this._trackNavigator(transaction); // Measurements are only available for pageload transactions\n\n\n if (transaction.op === 'pageload') {\n // normalize applicable web vital values to be relative to transaction.startTimestamp\n var timeOrigin_1 = msToSec(browserPerformanceTimeOrigin);\n ['fcp', 'fp', 'lcp', 'ttfb'].forEach(function (name) {\n if (!_this._measurements[name] || timeOrigin_1 >= transaction.startTimestamp) {\n return;\n } // The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin.\n // Unfortunately, timeOrigin is not captured within the transaction span data, so these web vitals will need\n // to be adjusted to be relative to transaction.startTimestamp.\n\n\n var oldValue = _this._measurements[name].value;\n var measurementTimestamp = timeOrigin_1 + msToSec(oldValue); // normalizedValue should be in milliseconds\n\n var normalizedValue = Math.abs((measurementTimestamp - transaction.startTimestamp) * 1000);\n var delta = normalizedValue - oldValue;\n logger.log(\"[Measurements] Normalized \" + name + \" from \" + oldValue + \" to \" + normalizedValue + \" (\" + delta + \")\");\n _this._measurements[name].value = normalizedValue;\n });\n\n if (this._measurements['mark.fid'] && this._measurements['fid']) {\n // create span for FID\n _startChild(transaction, {\n description: 'first input delay',\n endTimestamp: this._measurements['mark.fid'].value + msToSec(this._measurements['fid'].value),\n op: 'web.vitals',\n startTimestamp: this._measurements['mark.fid'].value\n });\n }\n\n transaction.setMeasurements(this._measurements);\n }\n };\n /** Starts tracking the Cumulative Layout Shift on the current page. */\n\n\n MetricsInstrumentation.prototype._trackCLS = function () {\n var _this = this;\n\n getCLS(function (metric) {\n var entry = metric.entries.pop();\n\n if (!entry) {\n return;\n }\n\n logger.log('[Measurements] Adding CLS');\n _this._measurements['cls'] = {\n value: metric.value\n };\n });\n };\n /**\n * Capture the information of the user agent.\n */\n\n\n MetricsInstrumentation.prototype._trackNavigator = function (transaction) {\n var navigator = global.navigator;\n\n if (!navigator) {\n return;\n } // track network connectivity\n\n\n var connection = navigator.connection;\n\n if (connection) {\n if (connection.effectiveType) {\n transaction.setTag('effectiveConnectionType', connection.effectiveType);\n }\n\n if (connection.type) {\n transaction.setTag('connectionType', connection.type);\n }\n\n if (isMeasurementValue(connection.rtt)) {\n this._measurements['connection.rtt'] = {\n value: connection.rtt\n };\n }\n\n if (isMeasurementValue(connection.downlink)) {\n this._measurements['connection.downlink'] = {\n value: connection.downlink\n };\n }\n }\n\n if (isMeasurementValue(navigator.deviceMemory)) {\n transaction.setTag('deviceMemory', String(navigator.deviceMemory));\n }\n\n if (isMeasurementValue(navigator.hardwareConcurrency)) {\n transaction.setTag('hardwareConcurrency', String(navigator.hardwareConcurrency));\n }\n };\n /** Starts tracking the Largest Contentful Paint on the current page. */\n\n\n MetricsInstrumentation.prototype._trackLCP = function () {\n var _this = this;\n\n getLCP(function (metric) {\n var entry = metric.entries.pop();\n\n if (!entry) {\n return;\n }\n\n var timeOrigin = msToSec(performance.timeOrigin);\n var startTime = msToSec(entry.startTime);\n logger.log('[Measurements] Adding LCP');\n _this._measurements['lcp'] = {\n value: metric.value\n };\n _this._measurements['mark.lcp'] = {\n value: timeOrigin + startTime\n };\n });\n };\n /** Starts tracking the First Input Delay on the current page. */\n\n\n MetricsInstrumentation.prototype._trackFID = function () {\n var _this = this;\n\n getFID(function (metric) {\n var entry = metric.entries.pop();\n\n if (!entry) {\n return;\n }\n\n var timeOrigin = msToSec(performance.timeOrigin);\n var startTime = msToSec(entry.startTime);\n logger.log('[Measurements] Adding FID');\n _this._measurements['fid'] = {\n value: metric.value\n };\n _this._measurements['mark.fid'] = {\n value: timeOrigin + startTime\n };\n });\n };\n /** Starts tracking the Time to First Byte on the current page. */\n\n\n MetricsInstrumentation.prototype._trackTTFB = function () {\n var _this = this;\n\n getTTFB(function (metric) {\n var _a;\n\n var entry = metric.entries.pop();\n\n if (!entry) {\n return;\n }\n\n logger.log('[Measurements] Adding TTFB');\n _this._measurements['ttfb'] = {\n value: metric.value\n }; // Capture the time spent making the request and receiving the first byte of the response\n\n var requestTime = metric.value - (_a = metric.entries[0], _a !== null && _a !== void 0 ? _a : entry).requestStart;\n _this._measurements['ttfb.requestTime'] = {\n value: requestTime\n };\n });\n };\n\n return MetricsInstrumentation;\n}();\n\nexport { MetricsInstrumentation };\n/** Instrument navigation entries */\n\nfunction addNavigationSpans(transaction, entry, timeOrigin) {\n addPerformanceNavigationTiming(transaction, entry, 'unloadEvent', timeOrigin);\n addPerformanceNavigationTiming(transaction, entry, 'redirect', timeOrigin);\n addPerformanceNavigationTiming(transaction, entry, 'domContentLoadedEvent', timeOrigin);\n addPerformanceNavigationTiming(transaction, entry, 'loadEvent', timeOrigin);\n addPerformanceNavigationTiming(transaction, entry, 'connect', timeOrigin);\n addPerformanceNavigationTiming(transaction, entry, 'secureConnection', timeOrigin, 'connectEnd');\n addPerformanceNavigationTiming(transaction, entry, 'fetch', timeOrigin, 'domainLookupStart');\n addPerformanceNavigationTiming(transaction, entry, 'domainLookup', timeOrigin);\n addRequest(transaction, entry, timeOrigin);\n}\n/** Create measure related spans */\n\n\nfunction addMeasureSpans(transaction, entry, startTime, duration, timeOrigin) {\n var measureStartTimestamp = timeOrigin + startTime;\n var measureEndTimestamp = measureStartTimestamp + duration;\n\n _startChild(transaction, {\n description: entry.name,\n endTimestamp: measureEndTimestamp,\n op: entry.entryType,\n startTimestamp: measureStartTimestamp\n });\n\n return measureStartTimestamp;\n}\n/** Create resource-related spans */\n\n\nexport function addResourceSpans(transaction, entry, resourceName, startTime, duration, timeOrigin) {\n // we already instrument based on fetch and xhr, so we don't need to\n // duplicate spans here.\n if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {\n return undefined;\n }\n\n var data = {};\n\n if ('transferSize' in entry) {\n data['Transfer Size'] = entry.transferSize;\n }\n\n if ('encodedBodySize' in entry) {\n data['Encoded Body Size'] = entry.encodedBodySize;\n }\n\n if ('decodedBodySize' in entry) {\n data['Decoded Body Size'] = entry.decodedBodySize;\n }\n\n var startTimestamp = timeOrigin + startTime;\n var endTimestamp = startTimestamp + duration;\n\n _startChild(transaction, {\n description: resourceName,\n endTimestamp: endTimestamp,\n op: entry.initiatorType ? \"resource.\" + entry.initiatorType : 'resource',\n startTimestamp: startTimestamp,\n data: data\n });\n\n return endTimestamp;\n}\n/** Create performance navigation related spans */\n\nfunction addPerformanceNavigationTiming(transaction, entry, event, timeOrigin, eventEnd) {\n var end = eventEnd ? entry[eventEnd] : entry[event + \"End\"];\n var start = entry[event + \"Start\"];\n\n if (!start || !end) {\n return;\n }\n\n _startChild(transaction, {\n op: 'browser',\n description: event,\n startTimestamp: timeOrigin + msToSec(start),\n endTimestamp: timeOrigin + msToSec(end)\n });\n}\n/** Create request and response related spans */\n\n\nfunction addRequest(transaction, entry, timeOrigin) {\n _startChild(transaction, {\n op: 'browser',\n description: 'request',\n startTimestamp: timeOrigin + msToSec(entry.requestStart),\n endTimestamp: timeOrigin + msToSec(entry.responseEnd)\n });\n\n _startChild(transaction, {\n op: 'browser',\n description: 'response',\n startTimestamp: timeOrigin + msToSec(entry.responseStart),\n endTimestamp: timeOrigin + msToSec(entry.responseEnd)\n });\n}\n/**\n * Helper function to start child on transactions. This function will make sure that the transaction will\n * use the start timestamp of the created child span if it is earlier than the transactions actual\n * start timestamp.\n */\n\n\nexport function _startChild(transaction, _a) {\n var startTimestamp = _a.startTimestamp,\n ctx = __rest(_a, [\"startTimestamp\"]);\n\n if (startTimestamp && transaction.startTimestamp > startTimestamp) {\n transaction.startTimestamp = startTimestamp;\n }\n\n return transaction.startChild(__assign({\n startTimestamp: startTimestamp\n }, ctx));\n}\n/**\n * Checks if a given value is a valid measurement value.\n */\n\nfunction isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n}","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { bindReporter } from './lib/bindReporter';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nexport var getCLS = function getCLS(onReport, reportAllChanges) {\n if (reportAllChanges === void 0) {\n reportAllChanges = false;\n }\n\n var metric = initMetric('CLS', 0);\n var report;\n\n var entryHandler = function entryHandler(entry) {\n // Only count layout shifts without recent user input.\n if (!entry.hadRecentInput) {\n metric.value += entry.value;\n metric.entries.push(entry);\n report();\n }\n };\n\n var po = observe('layout-shift', entryHandler);\n\n if (po) {\n report = bindReporter(onReport, metric, po, reportAllChanges);\n onHidden(function (_a) {\n var isUnloading = _a.isUnloading;\n po.takeRecords().map(entryHandler);\n\n if (isUnloading) {\n metric.isFinal = true;\n }\n\n report();\n });\n }\n};","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { bindReporter } from './lib/bindReporter';\nimport { getFirstHidden } from './lib/getFirstHidden';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nexport var getFID = function getFID(onReport) {\n var metric = initMetric('FID');\n var firstHidden = getFirstHidden();\n\n var entryHandler = function entryHandler(entry) {\n // Only report if the page wasn't hidden prior to the first input.\n if (entry.startTime < firstHidden.timeStamp) {\n metric.value = entry.processingStart - entry.startTime;\n metric.entries.push(entry);\n metric.isFinal = true;\n report();\n }\n };\n\n var po = observe('first-input', entryHandler);\n var report = bindReporter(onReport, metric, po);\n\n if (po) {\n onHidden(function () {\n po.takeRecords().map(entryHandler);\n po.disconnect();\n }, true);\n } else {\n if (window.perfMetrics && window.perfMetrics.onFirstInputDelay) {\n window.perfMetrics.onFirstInputDelay(function (value, event) {\n // Only report if the page wasn't hidden prior to the first input.\n if (event.timeStamp < firstHidden.timeStamp) {\n metric.value = value;\n metric.isFinal = true;\n metric.entries = [{\n entryType: 'first-input',\n name: event.type,\n target: event.target,\n cancelable: event.cancelable,\n startTime: event.timeStamp,\n processingStart: event.timeStamp + value\n }];\n report();\n }\n });\n }\n }\n};","import { __assign, __read, __spread } from \"tslib\";\nimport { getCurrentHub } from '@sentry/hub';\nimport { addInstrumentationHandler, isInstanceOf, isMatchingPattern } from '@sentry/utils';\nimport { getActiveTransaction, hasTracingEnabled } from '../utils';\nexport var DEFAULT_TRACING_ORIGINS = ['localhost', /^\\//];\nexport var defaultRequestInstrumentationOptions = {\n traceFetch: true,\n traceXHR: true,\n tracingOrigins: DEFAULT_TRACING_ORIGINS\n};\n/** Registers span creators for xhr and fetch requests */\n\nexport function registerRequestInstrumentation(_options) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n var _a = __assign(__assign({}, defaultRequestInstrumentationOptions), _options),\n traceFetch = _a.traceFetch,\n traceXHR = _a.traceXHR,\n tracingOrigins = _a.tracingOrigins,\n shouldCreateSpanForRequest = _a.shouldCreateSpanForRequest; // We should cache url -> decision so that we don't have to compute\n // regexp everytime we create a request.\n\n\n var urlMap = {};\n\n var defaultShouldCreateSpan = function defaultShouldCreateSpan(url) {\n if (urlMap[url]) {\n return urlMap[url];\n }\n\n var origins = tracingOrigins;\n urlMap[url] = origins.some(function (origin) {\n return isMatchingPattern(url, origin);\n }) && !isMatchingPattern(url, 'sentry_key');\n return urlMap[url];\n }; // We want that our users don't have to re-implement shouldCreateSpanForRequest themselves\n // That's why we filter out already unwanted Spans from tracingOrigins\n\n\n var shouldCreateSpan = defaultShouldCreateSpan;\n\n if (typeof shouldCreateSpanForRequest === 'function') {\n shouldCreateSpan = function shouldCreateSpan(url) {\n return defaultShouldCreateSpan(url) && shouldCreateSpanForRequest(url);\n };\n }\n\n var spans = {};\n\n if (traceFetch) {\n addInstrumentationHandler({\n callback: function callback(handlerData) {\n fetchCallback(handlerData, shouldCreateSpan, spans);\n },\n type: 'fetch'\n });\n }\n\n if (traceXHR) {\n addInstrumentationHandler({\n callback: function callback(handlerData) {\n xhrCallback(handlerData, shouldCreateSpan, spans);\n },\n type: 'xhr'\n });\n }\n}\n/**\n * Create and track fetch request spans\n */\n\nexport function fetchCallback(handlerData, shouldCreateSpan, spans) {\n var _a;\n\n var currentClientOptions = (_a = getCurrentHub().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();\n\n if (!(currentClientOptions && hasTracingEnabled(currentClientOptions)) || !(handlerData.fetchData && shouldCreateSpan(handlerData.fetchData.url))) {\n return;\n }\n\n if (handlerData.endTimestamp && handlerData.fetchData.__span) {\n var span = spans[handlerData.fetchData.__span];\n\n if (span) {\n var response = handlerData.response;\n\n if (response) {\n // TODO (kmclb) remove this once types PR goes through\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n span.setHttpStatus(response.status);\n }\n\n span.finish(); // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\n delete spans[handlerData.fetchData.__span];\n }\n\n return;\n }\n\n var activeTransaction = getActiveTransaction();\n\n if (activeTransaction) {\n var span = activeTransaction.startChild({\n data: __assign(__assign({}, handlerData.fetchData), {\n type: 'fetch'\n }),\n description: handlerData.fetchData.method + \" \" + handlerData.fetchData.url,\n op: 'http'\n });\n handlerData.fetchData.__span = span.spanId;\n spans[span.spanId] = span;\n var request = handlerData.args[0] = handlerData.args[0]; // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n var options = handlerData.args[1] = handlerData.args[1] || {};\n var headers = options.headers;\n\n if (isInstanceOf(request, Request)) {\n headers = request.headers;\n }\n\n if (headers) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (typeof headers.append === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n headers.append('sentry-trace', span.toTraceparent());\n } else if (Array.isArray(headers)) {\n headers = __spread(headers, [['sentry-trace', span.toTraceparent()]]);\n } else {\n headers = __assign(__assign({}, headers), {\n 'sentry-trace': span.toTraceparent()\n });\n }\n } else {\n headers = {\n 'sentry-trace': span.toTraceparent()\n };\n }\n\n options.headers = headers;\n }\n}\n/**\n * Create and track xhr request spans\n */\n\nexport function xhrCallback(handlerData, shouldCreateSpan, spans) {\n var _a;\n\n var currentClientOptions = (_a = getCurrentHub().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();\n\n if (!(currentClientOptions && hasTracingEnabled(currentClientOptions)) || !(handlerData.xhr && handlerData.xhr.__sentry_xhr__ && shouldCreateSpan(handlerData.xhr.__sentry_xhr__.url)) || handlerData.xhr.__sentry_own_request__) {\n return;\n }\n\n var xhr = handlerData.xhr.__sentry_xhr__; // check first if the request has finished and is tracked by an existing span which should now end\n\n if (handlerData.endTimestamp && handlerData.xhr.__sentry_xhr_span_id__) {\n var span = spans[handlerData.xhr.__sentry_xhr_span_id__];\n\n if (span) {\n span.setHttpStatus(xhr.status_code);\n span.finish(); // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\n delete spans[handlerData.xhr.__sentry_xhr_span_id__];\n }\n\n return;\n } // if not, create a new span to track it\n\n\n var activeTransaction = getActiveTransaction();\n\n if (activeTransaction) {\n var span = activeTransaction.startChild({\n data: __assign(__assign({}, xhr.data), {\n type: 'xhr',\n method: xhr.method,\n url: xhr.url\n }),\n description: xhr.method + \" \" + xhr.url,\n op: 'http'\n });\n handlerData.xhr.__sentry_xhr_span_id__ = span.spanId;\n spans[handlerData.xhr.__sentry_xhr_span_id__] = span;\n\n if (handlerData.xhr.setRequestHeader) {\n try {\n handlerData.xhr.setRequestHeader('sentry-trace', span.toTraceparent());\n } catch (_) {// Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.\n }\n }\n }\n}","import { addInstrumentationHandler, getGlobalObject, logger } from '@sentry/utils';\nvar global = getGlobalObject();\n/**\n * Default function implementing pageload and navigation transactions\n */\n\nexport function defaultRoutingInstrumentation(startTransaction, startTransactionOnPageLoad, startTransactionOnLocationChange) {\n if (startTransactionOnPageLoad === void 0) {\n startTransactionOnPageLoad = true;\n }\n\n if (startTransactionOnLocationChange === void 0) {\n startTransactionOnLocationChange = true;\n }\n\n if (!global || !global.location) {\n logger.warn('Could not initialize routing instrumentation due to invalid location');\n return;\n }\n\n var startingUrl = global.location.href;\n var activeTransaction;\n\n if (startTransactionOnPageLoad) {\n activeTransaction = startTransaction({\n name: global.location.pathname,\n op: 'pageload'\n });\n }\n\n if (startTransactionOnLocationChange) {\n addInstrumentationHandler({\n callback: function callback(_a) {\n var to = _a.to,\n from = _a.from;\n /**\n * This early return is there to account for some cases where a navigation transaction starts right after\n * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't\n * create an uneccessary navigation transaction.\n *\n * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also\n * only be caused in certain development environments where the usage of a hot module reloader is causing\n * errors.\n */\n\n if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) {\n startingUrl = undefined;\n return;\n }\n\n if (from !== to) {\n startingUrl = undefined;\n\n if (activeTransaction) {\n logger.log(\"[Tracing] Finishing current transaction with op: \" + activeTransaction.op); // If there's an open transaction on the scope, we need to finish it before creating an new one.\n\n activeTransaction.finish();\n }\n\n activeTransaction = startTransaction({\n name: global.location.pathname,\n op: 'navigation'\n });\n }\n },\n type: 'history'\n });\n }\n}","import { __assign } from \"tslib\";\nimport { getGlobalObject, logger } from '@sentry/utils';\nimport { startIdleTransaction } from '../hubextensions';\nimport { DEFAULT_IDLE_TIMEOUT } from '../idletransaction';\nimport { SpanStatus } from '../spanstatus';\nimport { extractTraceparentData, secToMs } from '../utils';\nimport { registerBackgroundTabDetection } from './backgroundtab';\nimport { MetricsInstrumentation } from './metrics';\nimport { defaultRequestInstrumentationOptions, registerRequestInstrumentation } from './request';\nimport { defaultRoutingInstrumentation } from './router';\nexport var DEFAULT_MAX_TRANSACTION_DURATION_SECONDS = 600;\n\nvar DEFAULT_BROWSER_TRACING_OPTIONS = __assign({\n idleTimeout: DEFAULT_IDLE_TIMEOUT,\n markBackgroundTransactions: true,\n maxTransactionDuration: DEFAULT_MAX_TRANSACTION_DURATION_SECONDS,\n routingInstrumentation: defaultRoutingInstrumentation,\n startTransactionOnLocationChange: true,\n startTransactionOnPageLoad: true\n}, defaultRequestInstrumentationOptions);\n/**\n * The Browser Tracing integration automatically instruments browser pageload/navigation\n * actions as transactions, and captures requests, metrics and errors as spans.\n *\n * The integration can be configured with a variety of options, and can be extended to use\n * any routing library. This integration uses {@see IdleTransaction} to create transactions.\n */\n\n\nvar BrowserTracing =\n/** @class */\nfunction () {\n function BrowserTracing(_options) {\n /**\n * @inheritDoc\n */\n this.name = BrowserTracing.id;\n this._metrics = new MetricsInstrumentation();\n this._emitOptionsWarning = false;\n var tracingOrigins = defaultRequestInstrumentationOptions.tracingOrigins; // NOTE: Logger doesn't work in constructors, as it's initialized after integrations instances\n\n if (_options && _options.tracingOrigins && Array.isArray(_options.tracingOrigins) && _options.tracingOrigins.length !== 0) {\n tracingOrigins = _options.tracingOrigins;\n } else {\n this._emitOptionsWarning = true;\n }\n\n this.options = __assign(__assign(__assign({}, DEFAULT_BROWSER_TRACING_OPTIONS), _options), {\n tracingOrigins: tracingOrigins\n });\n }\n /**\n * @inheritDoc\n */\n\n\n BrowserTracing.prototype.setupOnce = function (_, getCurrentHub) {\n var _this = this;\n\n this._getCurrentHub = getCurrentHub;\n\n if (this._emitOptionsWarning) {\n logger.warn('[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace.');\n logger.warn(\"[Tracing] We added a reasonable default for you: \" + defaultRequestInstrumentationOptions.tracingOrigins);\n } // eslint-disable-next-line @typescript-eslint/unbound-method\n\n\n var _a = this.options,\n routingInstrumentation = _a.routingInstrumentation,\n startTransactionOnLocationChange = _a.startTransactionOnLocationChange,\n startTransactionOnPageLoad = _a.startTransactionOnPageLoad,\n markBackgroundTransactions = _a.markBackgroundTransactions,\n traceFetch = _a.traceFetch,\n traceXHR = _a.traceXHR,\n tracingOrigins = _a.tracingOrigins,\n shouldCreateSpanForRequest = _a.shouldCreateSpanForRequest;\n routingInstrumentation(function (context) {\n return _this._createRouteTransaction(context);\n }, startTransactionOnPageLoad, startTransactionOnLocationChange);\n\n if (markBackgroundTransactions) {\n registerBackgroundTabDetection();\n }\n\n registerRequestInstrumentation({\n traceFetch: traceFetch,\n traceXHR: traceXHR,\n tracingOrigins: tracingOrigins,\n shouldCreateSpanForRequest: shouldCreateSpanForRequest\n });\n };\n /** Create routing idle transaction. */\n\n\n BrowserTracing.prototype._createRouteTransaction = function (context) {\n var _this = this;\n\n if (!this._getCurrentHub) {\n logger.warn(\"[Tracing] Did not create \" + context.op + \" transaction because _getCurrentHub is invalid.\");\n return undefined;\n } // eslint-disable-next-line @typescript-eslint/unbound-method\n\n\n var _a = this.options,\n beforeNavigate = _a.beforeNavigate,\n idleTimeout = _a.idleTimeout,\n maxTransactionDuration = _a.maxTransactionDuration;\n var parentContextFromHeader = context.op === 'pageload' ? getHeaderContext() : undefined;\n\n var expandedContext = __assign(__assign(__assign({}, context), parentContextFromHeader), {\n trimEnd: true\n });\n\n var modifiedContext = typeof beforeNavigate === 'function' ? beforeNavigate(expandedContext) : expandedContext; // For backwards compatibility reasons, beforeNavigate can return undefined to \"drop\" the transaction (prevent it\n // from being sent to Sentry).\n\n var finalContext = modifiedContext === undefined ? __assign(__assign({}, expandedContext), {\n sampled: false\n }) : modifiedContext;\n\n if (finalContext.sampled === false) {\n logger.log(\"[Tracing] Will not send \" + finalContext.op + \" transaction because of beforeNavigate.\");\n }\n\n logger.log(\"[Tracing] Starting \" + finalContext.op + \" transaction on scope\");\n\n var hub = this._getCurrentHub();\n\n var location = getGlobalObject().location;\n var idleTransaction = startIdleTransaction(hub, finalContext, idleTimeout, true, {\n location: location\n });\n idleTransaction.registerBeforeFinishCallback(function (transaction, endTimestamp) {\n _this._metrics.addPerformanceEntries(transaction);\n\n adjustTransactionDuration(secToMs(maxTransactionDuration), transaction, endTimestamp);\n });\n return idleTransaction;\n };\n /**\n * @inheritDoc\n */\n\n\n BrowserTracing.id = 'BrowserTracing';\n return BrowserTracing;\n}();\n\nexport { BrowserTracing };\n/**\n * Gets transaction context from a sentry-trace meta.\n *\n * @returns Transaction context data from the header or undefined if there's no header or the header is malformed\n */\n\nexport function getHeaderContext() {\n var header = getMetaContent('sentry-trace');\n\n if (header) {\n return extractTraceparentData(header);\n }\n\n return undefined;\n}\n/** Returns the value of a meta tag */\n\nexport function getMetaContent(metaName) {\n var el = document.querySelector(\"meta[name=\" + metaName + \"]\");\n return el ? el.getAttribute('content') : null;\n}\n/** Adjusts transaction value based on max transaction duration */\n\nfunction adjustTransactionDuration(maxDuration, transaction, endTimestamp) {\n var diff = endTimestamp - transaction.startTimestamp;\n var isOutdatedTransaction = endTimestamp && (diff > maxDuration || diff < 0);\n\n if (isOutdatedTransaction) {\n transaction.setStatus(SpanStatus.DeadlineExceeded);\n transaction.setTag('maxTransactionDurationExceeded', 'true');\n }\n}","import { __read, __spread } from \"tslib\";\nimport { logger } from '@sentry/utils';\n/**\n * Express integration\n *\n * Provides an request and error handler for Express framework as well as tracing capabilities\n */\n\nvar Express =\n/** @class */\nfunction () {\n /**\n * @inheritDoc\n */\n function Express(options) {\n if (options === void 0) {\n options = {};\n }\n /**\n * @inheritDoc\n */\n\n\n this.name = Express.id;\n this._router = options.router || options.app;\n this._methods = (Array.isArray(options.methods) ? options.methods : []).concat('use');\n }\n /**\n * @inheritDoc\n */\n\n\n Express.prototype.setupOnce = function () {\n if (!this._router) {\n logger.error('ExpressIntegration is missing an Express instance');\n return;\n }\n\n instrumentMiddlewares(this._router, this._methods);\n };\n /**\n * @inheritDoc\n */\n\n\n Express.id = 'Express';\n return Express;\n}();\n\nexport { Express };\n/**\n * Wraps original middleware function in a tracing call, which stores the info about the call as a span,\n * and finishes it once the middleware is done invoking.\n *\n * Express middlewares have 3 various forms, thus we have to take care of all of them:\n * // sync\n * app.use(function (req, res) { ... })\n * // async\n * app.use(function (req, res, next) { ... })\n * // error handler\n * app.use(function (err, req, res, next) { ... })\n *\n * They all internally delegate to the `router[method]` of the given application instance.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any\n\nfunction wrap(fn, method) {\n var arity = fn.length;\n\n switch (arity) {\n case 2:\n {\n return function (req, res) {\n var transaction = res.__sentry_transaction;\n\n if (transaction) {\n var span_1 = transaction.startChild({\n description: fn.name,\n op: \"middleware.\" + method\n });\n res.once('finish', function () {\n span_1.finish();\n });\n }\n\n return fn.call(this, req, res);\n };\n }\n\n case 3:\n {\n return function (req, res, next) {\n var _a;\n\n var transaction = res.__sentry_transaction;\n var span = (_a = transaction) === null || _a === void 0 ? void 0 : _a.startChild({\n description: fn.name,\n op: \"middleware.\" + method\n });\n fn.call(this, req, res, function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var _a;\n\n (_a = span) === null || _a === void 0 ? void 0 : _a.finish();\n next.call.apply(next, __spread([this], args));\n });\n };\n }\n\n case 4:\n {\n return function (err, req, res, next) {\n var _a;\n\n var transaction = res.__sentry_transaction;\n var span = (_a = transaction) === null || _a === void 0 ? void 0 : _a.startChild({\n description: fn.name,\n op: \"middleware.\" + method\n });\n fn.call(this, err, req, res, function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var _a;\n\n (_a = span) === null || _a === void 0 ? void 0 : _a.finish();\n next.call.apply(next, __spread([this], args));\n });\n };\n }\n\n default:\n {\n throw new Error(\"Express middleware takes 2-4 arguments. Got: \" + arity);\n }\n }\n}\n/**\n * Takes all the function arguments passed to the original `app` or `router` method, eg. `app.use` or `router.use`\n * and wraps every function, as well as array of functions with a call to our `wrap` method.\n * We have to take care of the arrays as well as iterate over all of the arguments,\n * as `app.use` can accept middlewares in few various forms.\n *\n * app.use([], )\n * app.use([], , ...)\n * app.use([], ...[])\n */\n\n\nfunction wrapMiddlewareArgs(args, method) {\n return args.map(function (arg) {\n if (typeof arg === 'function') {\n return wrap(arg, method);\n }\n\n if (Array.isArray(arg)) {\n return arg.map(function (a) {\n if (typeof a === 'function') {\n return wrap(a, method);\n }\n\n return a;\n });\n }\n\n return arg;\n });\n}\n/**\n * Patches original router to utilize our tracing functionality\n */\n\n\nfunction patchMiddleware(router, method) {\n var originalCallback = router[method];\n\n router[method] = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n return originalCallback.call.apply(originalCallback, __spread([this], wrapMiddlewareArgs(args, method)));\n };\n\n return router;\n}\n/**\n * Patches original router methods\n */\n\n\nfunction instrumentMiddlewares(router, methods) {\n if (methods === void 0) {\n methods = [];\n }\n\n methods.forEach(function (method) {\n return patchMiddleware(router, method);\n });\n}","import { __assign } from \"tslib\";\nimport { BrowserTracing } from './browser';\nimport { addExtensionMethods } from './hubextensions';\nimport * as TracingIntegrations from './integrations';\n\nvar Integrations = __assign(__assign({}, TracingIntegrations), {\n BrowserTracing: BrowserTracing\n});\n\nexport { Integrations };\nexport { Span } from './span';\nexport { Transaction } from './transaction';\nexport { registerRequestInstrumentation, defaultRequestInstrumentationOptions } from './browser';\nexport { SpanStatus } from './spanstatus';\nexport { IdleTransaction } from './idletransaction';\nexport { startIdleTransaction } from './hubextensions'; // We are patching the global object with our hub extension methods\n\naddExtensionMethods();\nexport { addExtensionMethods };\nexport { extractTraceparentData, getActiveTransaction, hasTracingEnabled, stripUrlQueryAndFragment, TRACEPARENT_REGEXP } from './utils';","export var SDK_VERSION = '6.2.0';","import { getCurrentHub } from '@sentry/hub';\nimport { logger } from '@sentry/utils';\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\n\nexport function initAndBind(clientClass, options) {\n if (options.debug === true) {\n logger.enable();\n }\n\n var hub = getCurrentHub();\n var client = new clientClass(options);\n hub.bindClient(client);\n}","import * as Sentry from '@sentry/browser'\nimport { Integrations } from '@sentry/tracing'\n\nSentry.init({\n dsn:\n 'https://45fe916995804ce2b6335f6e833751ed@o524538.ingest.sentry.io/5644583',\n integrations: [new Integrations.BrowserTracing()],\n tracesSampleRate: 0.01,\n})\n\nSentry.setTag('client_side', 'true')\n","import { getGlobalObject } from './misc';\nimport { dynamicRequire, isNodeEnv } from './node';\n/**\n * A TimestampSource implementation for environments that do not support the Performance Web API natively.\n *\n * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier\n * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It\n * is more obvious to explain \"why does my span have negative duration\" than \"why my spans have zero duration\".\n */\n\nvar dateTimestampSource = {\n nowSeconds: function nowSeconds() {\n return Date.now() / 1000;\n }\n};\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\n\nfunction getBrowserPerformance() {\n var performance = getGlobalObject().performance;\n\n if (!performance || !performance.now) {\n return undefined;\n } // Replace performance.timeOrigin with our own timeOrigin based on Date.now().\n //\n // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +\n // performance.now() gives a date arbitrarily in the past.\n //\n // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is\n // undefined.\n //\n // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to\n // interact with data coming out of performance entries.\n //\n // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that\n // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes\n // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have\n // observed skews that can be as long as days, weeks or months.\n //\n // See https://github.com/getsentry/sentry-javascript/issues/2590.\n //\n // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload\n // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation\n // transactions of long-lived web pages.\n\n\n var timeOrigin = Date.now() - performance.now();\n return {\n now: function now() {\n return performance.now();\n },\n timeOrigin: timeOrigin\n };\n}\n/**\n * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't\n * implement the API.\n */\n\n\nfunction getNodePerformance() {\n try {\n var perfHooks = dynamicRequire(module, 'perf_hooks');\n return perfHooks.performance;\n } catch (_) {\n return undefined;\n }\n}\n/**\n * The Performance API implementation for the current platform, if available.\n */\n\n\nvar platformPerformance = isNodeEnv() ? getNodePerformance() : getBrowserPerformance();\nvar timestampSource = platformPerformance === undefined ? dateTimestampSource : {\n nowSeconds: function nowSeconds() {\n return (platformPerformance.timeOrigin + platformPerformance.now()) / 1000;\n }\n};\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n */\n\nexport var dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource);\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * See `usingPerformanceAPI` to test whether the Performance API is used.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\n\nexport var timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource); // Re-exported with an old name for backwards-compatibility.\n\nexport var timestampWithMs = timestampInSeconds;\n/**\n * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps.\n */\n\nexport var usingPerformanceAPI = platformPerformance !== undefined;\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\n\nexport var browserPerformanceTimeOrigin = function () {\n var performance = getGlobalObject().performance;\n\n if (!performance) {\n return undefined;\n }\n\n if (performance.timeOrigin) {\n return performance.timeOrigin;\n } // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n // Date API.\n // eslint-disable-next-line deprecation/deprecation\n\n\n return performance.timing && performance.timing.navigationStart || Date.now();\n}();","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { __values } from \"tslib\";\nimport { htmlTreeAsString } from './browser';\nimport { isElement, isError, isEvent, isInstanceOf, isPlainObject, isPrimitive, isSyntheticEvent } from './is';\nimport { Memo } from './memo';\nimport { getFunctionName } from './stacktrace';\nimport { truncate } from './string';\n/**\n * Wrap a given object method with a higher-order function\n *\n * @param source An object that contains a method to be wrapped.\n * @param name A name of method to be wrapped.\n * @param replacementFactory A function that should be used to wrap a given method, returning the wrapped method which\n * will be substituted in for `source[name]`.\n * @returns void\n */\n\nexport function fill(source, name, replacementFactory) {\n if (!(name in source)) {\n return;\n }\n\n var original = source[name];\n var wrapped = replacementFactory(original); // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n\n if (typeof wrapped === 'function') {\n try {\n wrapped.prototype = wrapped.prototype || {};\n Object.defineProperties(wrapped, {\n __sentry_original__: {\n enumerable: false,\n value: original\n }\n });\n } catch (_Oo) {// This can throw if multiple fill happens on a global object like XMLHttpRequest\n // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n }\n }\n\n source[name] = wrapped;\n}\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\n\nexport function urlEncode(object) {\n return Object.keys(object).map(function (key) {\n return encodeURIComponent(key) + \"=\" + encodeURIComponent(object[key]);\n }).join('&');\n}\n/**\n * Transforms any object into an object literal with all its attributes\n * attached to it.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n */\n\nfunction getWalkSource(value) {\n if (isError(value)) {\n var error = value;\n var err = {\n message: error.message,\n name: error.name,\n stack: error.stack\n };\n\n for (var i in error) {\n if (Object.prototype.hasOwnProperty.call(error, i)) {\n err[i] = error[i];\n }\n }\n\n return err;\n }\n\n if (isEvent(value)) {\n var event_1 = value;\n var source = {};\n source.type = event_1.type; // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n\n try {\n source.target = isElement(event_1.target) ? htmlTreeAsString(event_1.target) : Object.prototype.toString.call(event_1.target);\n } catch (_oO) {\n source.target = '';\n }\n\n try {\n source.currentTarget = isElement(event_1.currentTarget) ? htmlTreeAsString(event_1.currentTarget) : Object.prototype.toString.call(event_1.currentTarget);\n } catch (_oO) {\n source.currentTarget = '';\n }\n\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n source.detail = event_1.detail;\n }\n\n for (var i in event_1) {\n if (Object.prototype.hasOwnProperty.call(event_1, i)) {\n source[i] = event_1;\n }\n }\n\n return source;\n }\n\n return value;\n}\n/** Calculates bytes size of input string */\n\n\nfunction utf8Length(value) {\n // eslint-disable-next-line no-bitwise\n return ~-encodeURI(value).split(/%..|./).length;\n}\n/** Calculates bytes size of input object */\n\n\nfunction jsonSize(value) {\n return utf8Length(JSON.stringify(value));\n}\n/** JSDoc */\n\n\nexport function normalizeToSize(object, // Default Node.js REPL depth\ndepth, // 100kB, as 200kB is max payload size, so half sounds reasonable\nmaxSize) {\n if (depth === void 0) {\n depth = 3;\n }\n\n if (maxSize === void 0) {\n maxSize = 100 * 1024;\n }\n\n var serialized = normalize(object, depth);\n\n if (jsonSize(serialized) > maxSize) {\n return normalizeToSize(object, depth - 1, maxSize);\n }\n\n return serialized;\n}\n/**\n * Transform any non-primitive, BigInt, or Symbol-type value into a string. Acts as a no-op on strings, numbers,\n * booleans, null, and undefined.\n *\n * @param value The value to stringify\n * @returns For non-primitive, BigInt, and Symbol-type values, a string denoting the value's type, type and value, or\n * type and `description` property, respectively. For non-BigInt, non-Symbol primitives, returns the original value,\n * unchanged.\n */\n\nfunction serializeValue(value) {\n var type = Object.prototype.toString.call(value); // Node.js REPL notation\n\n if (typeof value === 'string') {\n return value;\n }\n\n if (type === '[object Object]') {\n return '[Object]';\n }\n\n if (type === '[object Array]') {\n return '[Array]';\n }\n\n var normalized = normalizeValue(value);\n return isPrimitive(normalized) ? normalized : type;\n}\n/**\n * normalizeValue()\n *\n * Takes unserializable input and make it serializable friendly\n *\n * - translates undefined/NaN values to \"[undefined]\"/\"[NaN]\" respectively,\n * - serializes Error objects\n * - filter global objects\n */\n\n\nfunction normalizeValue(value, key) {\n if (key === 'domain' && value && _typeof(value) === 'object' && value._events) {\n return '[Domain]';\n }\n\n if (key === 'domainEmitter') {\n return '[DomainEmitter]';\n }\n\n if (typeof global !== 'undefined' && value === global) {\n return '[Global]';\n }\n\n if (typeof window !== 'undefined' && value === window) {\n return '[Window]';\n }\n\n if (typeof document !== 'undefined' && value === document) {\n return '[Document]';\n } // React's SyntheticEvent thingy\n\n\n if (isSyntheticEvent(value)) {\n return '[SyntheticEvent]';\n }\n\n if (typeof value === 'number' && value !== value) {\n return '[NaN]';\n }\n\n if (value === void 0) {\n return '[undefined]';\n }\n\n if (typeof value === 'function') {\n return \"[Function: \" + getFunctionName(value) + \"]\";\n } // symbols and bigints are considered primitives by TS, but aren't natively JSON-serilaizable\n\n\n if (_typeof(value) === 'symbol') {\n return \"[\" + String(value) + \"]\";\n }\n\n if (typeof value === 'bigint') {\n return \"[BigInt: \" + String(value) + \"]\";\n }\n\n return value;\n}\n/**\n * Walks an object to perform a normalization on it\n *\n * @param key of object that's walked in current iteration\n * @param value object to be walked\n * @param depth Optional number indicating how deep should walking be performed\n * @param memo Optional Memo class handling decycling\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\n\nexport function walk(key, value, depth, memo) {\n if (depth === void 0) {\n depth = +Infinity;\n }\n\n if (memo === void 0) {\n memo = new Memo();\n } // If we reach the maximum depth, serialize whatever has left\n\n\n if (depth === 0) {\n return serializeValue(value);\n }\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n // If value implements `toJSON` method, call it and return early\n\n\n if (value !== null && value !== undefined && typeof value.toJSON === 'function') {\n return value.toJSON();\n }\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n // If normalized value is a primitive, there are no branches left to walk, so we can just bail out, as theres no point in going down that branch any further\n\n\n var normalized = normalizeValue(value, key);\n\n if (isPrimitive(normalized)) {\n return normalized;\n } // Create source that we will use for next itterations, either objectified error object (Error type with extracted keys:value pairs) or the input itself\n\n\n var source = getWalkSource(value); // Create an accumulator that will act as a parent for all future itterations of that branch\n\n var acc = Array.isArray(value) ? [] : {}; // If we already walked that branch, bail out, as it's circular reference\n\n if (memo.memoize(value)) {\n return '[Circular ~]';\n } // Walk all keys of the source\n\n\n for (var innerKey in source) {\n // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n if (!Object.prototype.hasOwnProperty.call(source, innerKey)) {\n continue;\n } // Recursively walk through all the child nodes\n\n\n acc[innerKey] = walk(innerKey, source[innerKey], depth - 1, memo);\n } // Once walked through all the branches, remove the parent from memo storage\n\n\n memo.unmemoize(value); // Return accumulated values\n\n return acc;\n}\n/**\n * normalize()\n *\n * - Creates a copy to prevent original input mutation\n * - Skip non-enumerablers\n * - Calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializeable values (undefined/NaN/Functions) to serializable format\n * - Translates known global objects/Classes to a string representations\n * - Takes care of Error objects serialization\n * - Optionally limit depth of final output\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\nexport function normalize(input, depth) {\n try {\n return JSON.parse(JSON.stringify(input, function (key, value) {\n return walk(key, value, depth);\n }));\n } catch (_oO) {\n return '**non-serializable**';\n }\n}\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\nexport function extractExceptionKeysForMessage(exception, maxLength) {\n if (maxLength === void 0) {\n maxLength = 40;\n }\n\n var keys = Object.keys(getWalkSource(exception));\n keys.sort();\n\n if (!keys.length) {\n return '[object has no keys]';\n }\n\n if (keys[0].length >= maxLength) {\n return truncate(keys[0], maxLength);\n }\n\n for (var includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n var serialized = keys.slice(0, includedKeys).join(', ');\n\n if (serialized.length > maxLength) {\n continue;\n }\n\n if (includedKeys === keys.length) {\n return serialized;\n }\n\n return truncate(serialized, maxLength);\n }\n\n return '';\n}\n/**\n * Given any object, return the new object with removed keys that value was `undefined`.\n * Works recursively on objects and arrays.\n */\n\nexport function dropUndefinedKeys(val) {\n var e_1, _a;\n\n if (isPlainObject(val)) {\n var obj = val;\n var rv = {};\n\n try {\n for (var _b = __values(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n\n if (typeof obj[key] !== 'undefined') {\n rv[key] = dropUndefinedKeys(obj[key]);\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b[\"return\"])) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return rv;\n }\n\n if (Array.isArray(val)) {\n return val.map(dropUndefinedKeys);\n }\n\n return val;\n}","module.exports = function (originalModule) {\n if (!originalModule.webpackPolyfill) {\n var module = Object.create(originalModule); // module.parent = undefined by default\n\n if (!module.children) module.children = [];\n Object.defineProperty(module, \"loaded\", {\n enumerable: true,\n get: function get() {\n return module.l;\n }\n });\n Object.defineProperty(module, \"id\", {\n enumerable: true,\n get: function get() {\n return module.i;\n }\n });\n Object.defineProperty(module, \"exports\", {\n enumerable: true\n });\n module.webpackPolyfill = 1;\n }\n\n return module;\n};","/**\n * Checks whether we're in the Node.js or Browser environment\n *\n * @returns Answer to given question\n */\nexport function isNodeEnv() {\n return Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';\n}\n/**\n * Requires a module which is protected against bundler minification.\n *\n * @param request The module path to resolve\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\nexport function dynamicRequire(mod, request) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return mod.require(request);\n}","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { consoleSandbox, getGlobalObject } from './misc'; // TODO: Implement different loggers for different environments\n\nvar global = getGlobalObject();\n/** Prefix for logging strings */\n\nvar PREFIX = 'Sentry Logger ';\n/** JSDoc */\n\nvar Logger =\n/** @class */\nfunction () {\n /** JSDoc */\n function Logger() {\n this._enabled = false;\n }\n /** JSDoc */\n\n\n Logger.prototype.disable = function () {\n this._enabled = false;\n };\n /** JSDoc */\n\n\n Logger.prototype.enable = function () {\n this._enabled = true;\n };\n /** JSDoc */\n\n\n Logger.prototype.log = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (!this._enabled) {\n return;\n }\n\n consoleSandbox(function () {\n global.console.log(PREFIX + \"[Log]: \" + args.join(' '));\n });\n };\n /** JSDoc */\n\n\n Logger.prototype.warn = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (!this._enabled) {\n return;\n }\n\n consoleSandbox(function () {\n global.console.warn(PREFIX + \"[Warn]: \" + args.join(' '));\n });\n };\n /** JSDoc */\n\n\n Logger.prototype.error = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (!this._enabled) {\n return;\n }\n\n consoleSandbox(function () {\n global.console.error(PREFIX + \"[Error]: \" + args.join(' '));\n });\n };\n\n return Logger;\n}(); // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used\n\n\nglobal.__SENTRY__ = global.__SENTRY__ || {};\nvar logger = global.__SENTRY__.logger || (global.__SENTRY__.logger = new Logger());\nexport { logger };","import { isRegExp, isString } from './is';\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\n */\n\nexport function truncate(str, max) {\n if (max === void 0) {\n max = 0;\n }\n\n if (typeof str !== 'string' || max === 0) {\n return str;\n }\n\n return str.length <= max ? str : str.substr(0, max) + \"...\";\n}\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\n\nexport function snipLine(line, colno) {\n var newLine = line;\n var ll = newLine.length;\n\n if (ll <= 150) {\n return newLine;\n }\n\n if (colno > ll) {\n // eslint-disable-next-line no-param-reassign\n colno = ll;\n }\n\n var start = Math.max(colno - 60, 0);\n\n if (start < 5) {\n start = 0;\n }\n\n var end = Math.min(start + 140, ll);\n\n if (end > ll - 5) {\n end = ll;\n }\n\n if (end === ll) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n\n if (start > 0) {\n newLine = \"'{snip} \" + newLine;\n }\n\n if (end < ll) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nexport function safeJoin(input, delimiter) {\n if (!Array.isArray(input)) {\n return '';\n }\n\n var output = []; // eslint-disable-next-line @typescript-eslint/prefer-for-of\n\n for (var i = 0; i < input.length; i++) {\n var value = input[i];\n\n try {\n output.push(String(value));\n } catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n/**\n * Checks if the value matches a regex or includes the string\n * @param value The string value to be checked against\n * @param pattern Either a regex or a string that must be contained in value\n */\n\nexport function isMatchingPattern(value, pattern) {\n if (!isString(value)) {\n return false;\n }\n\n if (isRegExp(pattern)) {\n return pattern.test(value);\n }\n\n if (typeof pattern === 'string') {\n return value.indexOf(pattern) !== -1;\n }\n\n return false;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar g; // This works in non-strict mode\n\ng = function () {\n return this;\n}();\n\ntry {\n // This works if eval is allowed (see CSP)\n g = g || new Function(\"return this\")();\n} catch (e) {\n // This works if the window reference is available\n if ((typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === \"object\") g = window;\n} // g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\n\nmodule.exports = g;","var defaultFunctionName = '';\n/**\n * Safely extract function name from itself\n */\n\nexport function getFunctionName(fn) {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}","// shim for using process in browser\nvar process = module.exports = {}; // cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\n\nfunction defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined');\n}\n\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n})();\n\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n } // if setTimeout wasn't available but was latter defined\n\n\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n}\n\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n } // if clearTimeout wasn't available but was latter defined\n\n\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n}\n\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n\n draining = false;\n\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n var len = queue.length;\n\n while (len) {\n currentQueue = queue;\n queue = [];\n\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n\n queueIndex = -1;\n len = queue.length;\n }\n\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n\n queue.push(new Item(fun, args));\n\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n}; // v8 likes predictible objects\n\n\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\n\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\n\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) {\n return [];\n};\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () {\n return '/';\n};\n\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\n\nprocess.umask = function () {\n return 0;\n};","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isError(wat) {\n switch (Object.prototype.toString.call(wat)) {\n case '[object Error]':\n return true;\n\n case '[object Exception]':\n return true;\n\n case '[object DOMException]':\n return true;\n\n default:\n return isInstanceOf(wat, Error);\n }\n}\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isErrorEvent(wat) {\n return Object.prototype.toString.call(wat) === '[object ErrorEvent]';\n}\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isDOMError(wat) {\n return Object.prototype.toString.call(wat) === '[object DOMError]';\n}\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isDOMException(wat) {\n return Object.prototype.toString.call(wat) === '[object DOMException]';\n}\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isString(wat) {\n return Object.prototype.toString.call(wat) === '[object String]';\n}\n/**\n * Checks whether given value's is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isPrimitive(wat) {\n return wat === null || _typeof(wat) !== 'object' && typeof wat !== 'function';\n}\n/**\n * Checks whether given value's type is an object literal\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isPlainObject(wat) {\n return Object.prototype.toString.call(wat) === '[object Object]';\n}\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isEvent(wat) {\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isElement(wat) {\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isRegExp(wat) {\n return Object.prototype.toString.call(wat) === '[object RegExp]';\n}\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\n\nexport function isThenable(wat) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isSyntheticEvent(wat) {\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\n\nexport function isInstanceOf(wat, base) {\n try {\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\n\n/* global Reflect, Promise */\nvar _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (b.hasOwnProperty(p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nvar _assign = function __assign() {\n _assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return _assign.apply(this, arguments);\n};\n\nexport { _assign as __assign };\nexport function __rest(s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n}\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if ((typeof Reflect === \"undefined\" ? \"undefined\" : _typeof(Reflect)) === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {\n if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n }\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\nexport function __param(paramIndex, decorator) {\n return function (target, key) {\n decorator(target, key, paramIndex);\n };\n}\nexport function __metadata(metadataKey, metadataValue) {\n if ((typeof Reflect === \"undefined\" ? \"undefined\" : _typeof(Reflect)) === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\nexport function __generator(thisArg, body) {\n var _ = {\n label: 0,\n sent: function sent() {\n if (t[0] & 1) throw t[1];\n return t[1];\n },\n trys: [],\n ops: []\n },\n f,\n y,\n t,\n g;\n return g = {\n next: verb(0),\n \"throw\": verb(1),\n \"return\": verb(2)\n }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () {\n return this;\n }), g;\n\n function verb(n) {\n return function (v) {\n return step([n, v]);\n };\n }\n\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n\n while (_) {\n try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n\n case 4:\n _.label++;\n return {\n value: op[1],\n done: false\n };\n\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n\n case 7:\n op = _.ops.pop();\n\n _.trys.pop();\n\n continue;\n\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n\n if (t && _.label < t[2]) {\n _.label = t[2];\n\n _.ops.push(op);\n\n break;\n }\n\n if (t[2]) _.ops.pop();\n\n _.trys.pop();\n\n continue;\n }\n\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n }\n\n if (op[0] & 5) throw op[1];\n return {\n value: op[0] ? op[1] : void 0,\n done: true\n };\n }\n}\nexport function __createBinding(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}\nexport function __exportStar(m, exports) {\n for (var p in m) {\n if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\n }\n}\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator,\n m = s && o[s],\n i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function next() {\n if (o && i >= o.length) o = void 0;\n return {\n value: o && o[i++],\n done: !o\n };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o),\n r,\n ar = [],\n e;\n\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {\n ar.push(r.value);\n }\n } catch (error) {\n e = {\n error: error\n };\n } finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n\n return ar;\n}\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++) {\n ar = ar.concat(__read(arguments[i]));\n }\n\n return ar;\n}\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) {\n s += arguments[i].length;\n }\n\n for (var r = Array(s), k = 0, i = 0; i < il; i++) {\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {\n r[k] = a[j];\n }\n }\n\n return r;\n}\n;\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []),\n i,\n q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i;\n\n function verb(n) {\n if (g[n]) i[n] = function (v) {\n return new Promise(function (a, b) {\n q.push([n, v, a, b]) > 1 || resume(n, v);\n });\n };\n }\n\n function resume(n, v) {\n try {\n step(g[n](v));\n } catch (e) {\n settle(q[0][3], e);\n }\n }\n\n function step(r) {\n r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);\n }\n\n function fulfill(value) {\n resume(\"next\", value);\n }\n\n function reject(value) {\n resume(\"throw\", value);\n }\n\n function settle(f, v) {\n if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);\n }\n}\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) {\n throw e;\n }), verb(\"return\"), i[Symbol.iterator] = function () {\n return this;\n }, i;\n\n function verb(n, f) {\n i[n] = o[n] ? function (v) {\n return (p = !p) ? {\n value: __await(o[n](v)),\n done: n === \"return\"\n } : f ? f(v) : v;\n } : f;\n }\n}\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator],\n i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i);\n\n function verb(n) {\n i[n] = o[n] && function (v) {\n return new Promise(function (resolve, reject) {\n v = o[n](v), settle(resolve, reject, v.done, v.value);\n });\n };\n }\n\n function settle(resolve, reject, d, v) {\n Promise.resolve(v).then(function (v) {\n resolve({\n value: v,\n done: d\n });\n }, reject);\n }\n}\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) {\n Object.defineProperty(cooked, \"raw\", {\n value: raw\n });\n } else {\n cooked.raw = raw;\n }\n\n return cooked;\n}\n;\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) {\n if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n }\n result[\"default\"] = mod;\n return result;\n}\nexport function __importDefault(mod) {\n return mod && mod.__esModule ? mod : {\n \"default\": mod\n };\n}\nexport function __classPrivateFieldGet(receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n\n return privateMap.get(receiver);\n}\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n\n privateMap.set(receiver, value);\n return value;\n}"],"sourceRoot":""}