{"version":3,"names":["win","window","global","globalThis","XMLHttpRequest","globalObject","commonWindow","self","File","assignableWindow","type_utils_toString","Object","prototype","toString","isArray","Array","obj","call","isFunction","x","isUndefined","isString","isEmptyString","trim","length","isPrimitive","value","isBuiltin","candidate","className","isError","isInstanceOf","Error","isEvent","Event","base","_unused","parsedStackResults","lastPostHogChunkIds","lastNativeDebugIds","cachedFilenameChunkIds","getFilenameToChunkIdMap","stackParser","posthogChunkIds","_posthogChunkIds","nativeDebugIds","_debugIds","posthogKeys","keys","nativeKeys","matchesSnapshot","_objectSpread2","_parsedStackResults","addChunkIds","chunkIds","stackKey","chunkId","cachedFilename","parsedStack","i","filename","_parsedStack$i","snapshot","every","key","URL_SCHEME","APP_URL_SCHEMES","isAppFilename","scheme","exec","includes","toLowerCase","createFrame","platform","func","lineno","colno","frame","function","in_app","extractSafariExtensionDetails","isSafariExtension","indexOf","isSafariWebExtension","split","chromeRegexNoFnName","chromeRegex","chromeEvalRegex","chromeStackLineParser","line","noFnParts","col","parts","subMatch","geckoREgex","geckoEvalRegex","geckoStackLineParser","WEBPACK_ERROR_REGEXP","isSameFrame","a","b","module","collapseRepeatedCycle","frames","start","isCycle","offset","trimPartialCycle","cycle","copyEnd","partialLength","partialCycleLength","splice","innermostPartialCycleLength","partialStart","partialEnd","survivingFrameCount","cycles","innermostCycle","count","isSmallerRotation","best","left","right","ERROR_TYPES_PATTERN","severityLevels","extractExceptionKeysForMessage","err","maxLength","sort","serialized","slice","join","_createLogger","prefix","debugEnabled","logger","level","args","browserWindow","POSTHOG_DEBUG","console","_log","error","methodName","createLogger","additionalPrefix","options","errorPropertiesBuilder","constructor","coercers","modifiers","this","buildFromUnknown","input","hint","mechanism","handled","type","exceptionWithCause","buildCoercingContext","apply","parsingContext","buildParsingContext","exceptionWithStack","parseStacktrace","$exception_list","convertToExceptionList","$exception_level","modifyFrames","exceptionList","_asyncToGenerator","exc","stacktrace","applyModifiers","coerceFallback","ctx","stack","_ctx$syntheticExcepti","syntheticException","synthetic","cause","applyChunkIds","skipFirstLines","chunkIdMap","errors","_err$errors","map","child","chunk_id","applyCoercers","adapter","match","coerce","newFrames","modifier","append","exception","parentId","source","exceptionId","entryMechanism","exception_id","parent_id","currentException","push","_exception$errors","_hint$skipFirstLines","getAggregateErrors","getPrototypeOf","depth","_Object$getOwnPropert","getOwnPropertyDescriptor","name","_unused2","memberInspections","hasAggregate","seen","Set","wrappers","skipped","wrapperDepth","createContext","forward","nextInput","pop","isReference","has","add","_unused3","Number","isInteger","children","index","next","_unused4","context","_coerce","isDOMException","isDOMError","hasStack","getType","getValue","message","isCustomEventWrappingRejection","detail","reason","getUnhandledRejectionReason","String","_hasUsableMessage","exceptionLike","_this$_buildLocationS","_buildLocationStack","location","_location$lineno","_location$colno","getStack","replacementStack","getMessage","_ctx","evt","constructorName","errorProperty","getErrorPropertyFromObject","_this$getStack","isSeverityLevel","getObjectClassName","prop","hasOwnProperty","e","getInfos","groups","parsers","lines","endLine","Math","min","repeatedCycles","cleanedLine","test","replace","parser","previous","sections","innermostSection","trimmed","some","first","canonicalizeCycleRotation","localStack","from","reverse","arr","reverseAndStripFrames","createStackParser","safely","fn","fallback","safelyBuildAndCapture","captureFn","buildProperties","isReachableFunction","handler","markInstrumented","owner","__POSTHOG_INSTRUMENTED__","restore","original","_owner$key","wrapOnError","info","originalOnError","onerror","win$1","event","ErrorEvent","resolveOnErrorInput","_originalOnError","wrapUnhandledRejection","defaultReturnValue","originalOnUnhandledRejection","onunhandledrejection","win$2","ev","_originalOnUnhandledR","posthogErrorWrappingFunctions","wrapConsoleError","con","originalConsoleError","find","arg","__PosthogExtensions__","errorWrappingFunctions","extendPostHogWithExceptionAutocapture","instance","response","capture","autocaptureExceptions","errorsToIgnore","errors_to_ignore","reduce","rules","rule","RegExp","sendExceptionEvent","properties","_instance$capture","_noTruncate","_batchKey","_noHeatmaps","regex","extendPostHogWithExceptionAutoCapture"],"sources":["../../browser-common/dist/utils/globals.mjs","../src/utils/globals.ts","../../core/dist/utils/type-utils.mjs","../../core/dist/error-tracking/chunk-ids.mjs","../../core/dist/error-tracking/parsers/base.mjs","../../core/dist/error-tracking/parsers/safari.mjs","../../core/dist/error-tracking/parsers/chrome.mjs","../../core/dist/error-tracking/parsers/gecko.mjs","../../core/dist/error-tracking/parsers/index.mjs","../../core/dist/error-tracking/coercers/string-coercer.mjs","../../core/dist/error-tracking/types.mjs","../../core/dist/error-tracking/coercers/utils.mjs","../../browser-common/dist/utils/logger.mjs","../src/entrypoints/exception-autocapture.ts","../src/posthog-exceptions.ts","../../core/dist/error-tracking/error-properties-builder.mjs","../../core/dist/error-tracking/coercers/dom-exception-coercer.mjs","../../core/dist/error-tracking/coercers/promise-rejection-event.mjs","../../core/dist/error-tracking/coercers/error-event-coercer.mjs","../../core/dist/error-tracking/coercers/error-coercer.mjs","../../core/dist/error-tracking/coercers/event-coercer.mjs","../../core/dist/error-tracking/coercers/object-coercer.mjs","../../core/dist/error-tracking/coercers/primitive-coercer.mjs"],"sourcesContent":["const win = \"u\" > typeof window ? window : void 0;\nconst global = \"u\" > typeof globalThis ? globalThis : win;\nconst globals_navigator = global?.navigator;\nconst globals_document = global?.document;\nconst globals_location = global?.location;\nconst fetch = global?.fetch;\nconst XMLHttpRequest = global?.XMLHttpRequest && 'withCredentials' in new global.XMLHttpRequest() ? global.XMLHttpRequest : void 0;\nconst AbortController = global?.AbortController;\nconst CompressionStream = global?.CompressionStream;\nconst userAgent = globals_navigator?.userAgent;\nfunction isBrowserOnline() {\n    return !!(win && false !== win.navigator.onLine);\n}\nexport { AbortController, CompressionStream, XMLHttpRequest, fetch, globals_document as document, globals_location as location, globals_navigator as navigator, isBrowserOnline, userAgent, win as window };\n","import { window as commonWindow } from '@posthog/browser-common/utils/globals'\nimport type { Client } from '@posthog/browser-common'\nimport type { DeferredStylesheetStats, MutationCost, SnapshotCost } from '@posthog/rrweb-record'\nimport type { ErrorTracking } from '@posthog/core'\n\nimport type { PostHog } from '../posthog-core'\nimport type { BufferedConsoleEntry } from '../logs-types'\nimport type { SessionIdManager } from '../sessionid'\nimport type {\n    DeadClicksAutoCaptureConfig,\n    ExternalIntegrationKind,\n    Properties,\n    RemoteConfig,\n    SiteAppLoader,\n    SessionStartReason,\n} from '../types'\nimport type {\n    ConversationsRemoteConfig,\n    ConversationsTheme,\n    GetMessagesResponse,\n    GetTicketsOptions,\n    GetTicketsResponse,\n    MarkAsReadResponse,\n    RestoreFromTokenResponse,\n    RequestRestoreLinkResponse,\n    SendMessageResponse,\n    UserProvidedTraits,\n} from '../posthog-conversations-types'\n// only importing types here, so won't affect the bundle\n// oxlint-disable-next-line posthog-js/no-external-replay-imports\nimport type { SessionRecordingStatus, TriggerType } from '../extensions/replay/external/triggerMatching'\nimport type { TracingHeadersDistinctId, TracingHeadersHostnames } from '../extensions/tracing-headers-types'\nimport type { eventWithTime } from '../extensions/replay/types/rrweb-types'\n\n/*\n * Browser-v1's contract with its lazily loaded bundles and legacy window globals.\n * Generic environment access remains owned by browser-common.\n */\n\nexport type AssignableWindow = Window &\n    typeof globalThis & {\n        /*\n         * Main PostHog instance\n         */\n        posthog: any\n\n        /*\n         * This is our contract between (potentially) lazily loaded extensions and the SDK\n         */\n        __PosthogExtensions__?: PostHogExtensions\n\n        /**\n         * When loading remote config, we assign it to this global configuration\n         * for ease of sharing it with the rest of the SDK\n         */\n        _POSTHOG_REMOTE_CONFIG?: Record<\n            string,\n            {\n                config: RemoteConfig\n                siteApps: SiteAppLoader[]\n            }\n        >\n\n        /**\n         * If this is set on the window, our logger will log to the console\n         * for ease of debugging. Used for testing purposes only.\n         *\n         * @see {Config.DEBUG} from config.ts\n         */\n        POSTHOG_DEBUG: any\n\n        // Exposed by the browser\n        doNotTrack: any\n\n        // See entrypoints/customizations.full.ts\n        posthogCustomizations: any\n\n        /**\n         * This is a legacy way to expose these functions, but we still need to support it for backwards compatibility\n         * Can be removed once we drop support for 1.161.1\n         *\n         * See entrypoints/exception-autocapture.ts\n         *\n         * @deprecated use `__PosthogExtensions__.errorWrappingFunctions` instead\n         */\n        posthogErrorWrappingFunctions: any\n\n        /**\n         * Legacy exception autocapture entrypoint names used by posthog-js <= 1.141.0.\n         * Both spellings are required because those clients checked one and called the other.\n         *\n         * See entrypoints/exception-autocapture.ts\n         *\n         * @deprecated use `__PosthogExtensions__.errorWrappingFunctions` instead\n         */\n        extendPostHogWithExceptionAutoCapture: any\n        extendPostHogWithExceptionAutocapture: any\n\n        /**\n         * This is a legacy way to expose these functions, but we still need to support it for backwards compatibility\n         * Can be removed once we drop support for 1.161.1\n         *\n         * See entrypoints/posthog-recorder.ts\n         *\n         * @deprecated use `__PosthogExtensions__.rrweb` instead\n         */\n        rrweb: any\n\n        /**\n         * This is a legacy way to expose these functions, but we still need to support it for backwards compatibility\n         * Can be removed once we drop support for 1.161.1\n         *\n         * See entrypoints/posthog-recorder.ts\n         *\n         * @deprecated use `__PosthogExtensions__.rrwebConsoleRecord` instead\n         */\n        rrwebConsoleRecord: any\n\n        /**\n         * This is a legacy way to expose these functions, but we still need to support it for backwards compatibility\n         * Can be removed once we drop support for 1.161.1\n         *\n         * See entrypoints/posthog-recorder.ts\n         *\n         * @deprecated use `__PosthogExtensions__.getRecordNetworkPlugin` instead\n         */\n        getRecordNetworkPlugin: any\n\n        /**\n         * This is a legacy way to expose these functions, but we still need to support it for backwards compatibility\n         * Can be removed once we drop support for 1.161.1\n         *\n         * See entrypoints/web-vitals.ts\n         *\n         * @deprecated use `__PosthogExtensions__.postHogWebVitalsCallbacks` instead\n         */\n        postHogWebVitalsCallbacks: any\n\n        /**\n         * This is a legacy way to expose these functions, but we still need to support it for backwards compatibility\n         * Can be removed once we drop support for 1.161.1\n         *\n         * See entrypoints/tracing-headers.ts\n         *\n         * @deprecated use `__PosthogExtensions__.postHogTracingHeadersPatchFns` instead\n         */\n        postHogTracingHeadersPatchFns: any\n\n        /**\n         * This is a legacy way to expose these functions, but we still need to support it for backwards compatibility\n         * Can be removed once we drop support for 1.161.1\n         *\n         * See entrypoints/surveys.ts\n         *\n         * @deprecated use `__PosthogExtensions__.generateSurveys` instead\n         */\n        extendPostHogWithSurveys: any\n\n        /*\n         * These are used to handle our toolbar state.\n         * @see {Toolbar} from extensions/toolbar.ts\n         */\n        ph_load_toolbar: any\n        ph_load_editor: any\n        ph_toolbar_state: any\n    } & Record<`__$$ph_site_app_${string}`, any>\n\n/**\n * This is our contract between (potentially) lazily loaded extensions and the SDK\n * changes to this interface can be breaking changes for users of the SDK\n */\n\nexport type ExternalExtensionKind = 'intercom-integration' | 'crisp-chat-integration'\n\n/** Subset of the web-vitals library's `ReportOpts` passed to metric observers. */\nexport interface WebVitalsReportOpts {\n    reportAllChanges?: boolean\n    reportSoftNavs?: boolean\n}\n\n/**\n * Options only the attribution build understands, so they are passed to attributed\n * observers and never to the observers in the default bundle.\n */\nexport interface WebVitalsAttributionReportOpts extends WebVitalsReportOpts {\n    includeProcessedEventEntries?: boolean\n}\n\nexport type WebVitalsCallbackFlavor =\n    | 'web-vitals'\n    | 'web-vitals-with-attribution'\n    | 'web-vitals-soft-navs'\n    | 'web-vitals-with-attribution-soft-navs'\n\nexport type WebVitalsMetricCallbacks = {\n    onLCP: (onReport: (metric: any) => void, opts?: WebVitalsReportOpts) => void\n    onCLS: (onReport: (metric: any) => void, opts?: WebVitalsReportOpts) => void\n    onFCP: (onReport: (metric: any) => void, opts?: WebVitalsReportOpts) => void\n    onINP: (onReport: (metric: any) => void, opts?: WebVitalsReportOpts) => void\n}\n\nexport type WebVitalsCallbacks = WebVitalsMetricCallbacks & {\n    withoutAttribution?: WebVitalsMetricCallbacks\n}\n\nexport type PostHogExtensionKind =\n    | 'toolbar'\n    | 'exception-autocapture'\n    | 'web-vitals'\n    | 'web-vitals-with-attribution'\n    | 'web-vitals-soft-navs'\n    | 'web-vitals-with-attribution-soft-navs'\n    | 'recorder'\n    | 'lazy-recorder'\n    | 'tracing-headers'\n    | 'surveys'\n    | 'logs'\n    | 'conversations'\n    | 'product-tours'\n    | 'dead-clicks-autocapture'\n    | 'remote-config'\n    | ExternalExtensionKind\n\nexport interface LazyLoadedSessionRecordingInterface {\n    start: (startReason?: SessionStartReason) => void\n    stop: () => void\n    discard: (options?: { discardProducerEvents?: boolean }) => void\n    sessionId: string\n    status: SessionRecordingStatus\n    onRRwebEmit: (rawEvent: eventWithTime) => void\n    log: (message: string, level: 'log' | 'warn' | 'error') => void\n    sdkDebugProperties: Properties\n    overrideLinkedFlag: () => void\n    overrideSampling: () => void\n    overrideTrigger: (triggerType: TriggerType) => void\n    isStarted: boolean\n    tryAddCustomEvent(tag: string, payload: any): boolean\n    setDocumentWasEverVisible?: (documentWasEverVisible: boolean) => void\n    flushBeforeIdentityReset?: () => void\n}\n\nexport interface LazyLoadedDeadClicksAutocaptureInterface {\n    start: (observerTarget: Node) => void\n    stop: () => void\n}\n\nexport interface LazyLoadedConversationsInterface {\n    // Widget control\n    show: () => void\n    hide: () => void\n    open: () => void\n    close: () => void\n    isVisible: () => boolean\n    setTheme: (theme: ConversationsTheme) => void\n\n    // Lifecycle\n    reset: () => void\n\n    // Identity verification\n    setIdentity: () => void\n    clearIdentity: () => void\n\n    // API methods\n    sendMessage: (message: string, userTraits?: UserProvidedTraits, newTicket?: boolean) => Promise<SendMessageResponse>\n    getMessages: (ticketId?: string, after?: string) => Promise<GetMessagesResponse>\n    markAsRead: (ticketId?: string) => Promise<MarkAsReadResponse>\n    getTickets: (options?: GetTicketsOptions) => Promise<GetTicketsResponse>\n    requestRestoreLink: (email: string) => Promise<RequestRestoreLinkResponse>\n    restoreFromToken: (restoreToken: string) => Promise<RestoreFromTokenResponse>\n    restoreFromUrlToken: () => Promise<RestoreFromTokenResponse | null>\n    getCurrentTicketId: () => string | null\n    getWidgetSessionId: () => string\n}\n\ninterface PostHogExtensions {\n    loadExternalDependency?: (\n        posthog: PostHog,\n        kind: PostHogExtensionKind,\n        callback: (error?: string | Event, event?: Event) => void\n    ) => void\n\n    loadSiteApp?: (posthog: PostHog, appUrl: string, callback: (error?: string | Event, event?: Event) => void) => void\n\n    errorWrappingFunctions?: {\n        wrapOnError: (captureFn: (props: ErrorTracking.ErrorProperties) => void) => () => void\n        wrapUnhandledRejection: (captureFn: (props: ErrorTracking.ErrorProperties) => void) => () => void\n        wrapConsoleError: (captureFn: (props: ErrorTracking.ErrorProperties) => void) => () => void\n    }\n    rrweb?: {\n        record: any\n        version: string\n        wasMaxDepthReached?: () => boolean\n        resetMaxDepthState?: () => void\n        // see rrweb-snapshot/src/snapshot-cost.ts\n        getLastSnapshotCost?: () => SnapshotCost | null\n        getMutationCost?: () => MutationCost\n        getDeferredStylesheetStats?: () => DeferredStylesheetStats\n        getDiscardedDurationSamples?: () => number\n        // see rrweb/src/record/observer.ts\n        getObserverInitFailures?: () => string[] | undefined\n        resetSnapshotCostState?: () => void\n    }\n    rrwebPlugins?: { getRecordConsolePlugin: any; getRecordNetworkPlugin?: any }\n    generateSurveys?: (posthog: PostHog, isSurveysEnabled: boolean) => any | undefined\n    generateProductTours?: (posthog: PostHog, isEnabled: boolean) => any | undefined\n    logs?: {\n        initializeLogs?: (host: PostHog | Client) => (() => void) | undefined\n        replayConsoleBuffer?: (host: PostHog | Client, entries: BufferedConsoleEntry[]) => void\n    }\n    /** @deprecated Use `postHogWebVitalsCallbacksByFlavor` to select callbacks explicitly. */\n    postHogWebVitalsCallbacks?: WebVitalsCallbacks\n    postHogWebVitalsCallbacksByFlavor?: Partial<Record<WebVitalsCallbackFlavor, WebVitalsCallbacks>>\n    /**\n     * @deprecated\n     *\n     * this was introduced briefly, it is now always a no-op and only kept for backwards compatibility\n     */\n    loadWebVitalsCallbacks?: (useAttribution?: boolean) => PostHogExtensions['postHogWebVitalsCallbacks']\n    tracingHeadersPatchFns?: {\n        _patchFetch: (\n            hostnames: TracingHeadersHostnames,\n            distinctId: TracingHeadersDistinctId,\n            sessionManager?: SessionIdManager\n        ) => () => void\n        _patchXHR: (\n            hostnames: TracingHeadersHostnames,\n            distinctId: TracingHeadersDistinctId,\n            sessionManager?: SessionIdManager\n        ) => () => void\n    }\n    initDeadClicksAutocapture?: (\n        ph: PostHog,\n        config: DeadClicksAutoCaptureConfig\n    ) => LazyLoadedDeadClicksAutocaptureInterface\n    integrations?: {\n        [K in ExternalIntegrationKind]?: { start: (posthog: PostHog) => void; stop: () => void }\n    }\n    initSessionRecording?: (ph: PostHog, documentWasEverVisible?: boolean) => LazyLoadedSessionRecordingInterface\n    initConversations?: (config: ConversationsRemoteConfig, posthog: PostHog) => LazyLoadedConversationsInterface\n}\n\nconst globalObject: typeof globalThis | undefined = typeof globalThis !== 'undefined' ? globalThis : commonWindow\n\n// React Native polyfills retained for browser-v1 compatibility.\nif (globalObject && typeof self === 'undefined') {\n    ;(globalObject as any).self = globalObject\n}\nif (globalObject && typeof File === 'undefined') {\n    ;(globalObject as any).File = function () {}\n}\n\nexport {\n    AbortController,\n    CompressionStream,\n    document,\n    fetch,\n    isBrowserOnline,\n    location,\n    navigator,\n    userAgent,\n    window,\n    XMLHttpRequest,\n} from '@posthog/browser-common/utils/globals'\n\nexport const assignableWindow: AssignableWindow = commonWindow ?? ({} as any)\n","import { knownUnsafeEditableEvent, knownUnsafeEditableEventProperty } from \"../types.mjs\";\nimport { includes } from \"./string-utils.mjs\";\nconst nativeIsArray = Array.isArray;\nconst ObjProto = Object.prototype;\nconst type_utils_hasOwnProperty = ObjProto.hasOwnProperty;\nconst type_utils_toString = ObjProto.toString;\nconst isArray = nativeIsArray || function(obj) {\n    return '[object Array]' === type_utils_toString.call(obj);\n};\nconst isFunction = (x)=>'function' == typeof x;\nconst isNativeFunction = (x)=>isFunction(x) && -1 !== x.toString().indexOf('[native code]');\nconst isObject = (x)=>x === Object(x) && !isArray(x);\nconst isEmptyObject = (x)=>{\n    if (isObject(x)) {\n        for(const key in x)if (type_utils_hasOwnProperty.call(x, key)) return false;\n        return true;\n    }\n    return false;\n};\nconst isUndefined = (x)=>void 0 === x;\nconst isString = (x)=>'[object String]' == type_utils_toString.call(x);\nconst isEmptyString = (x)=>isString(x) && 0 === x.trim().length;\nconst isNull = (x)=>null === x;\nconst isNullish = (x)=>isUndefined(x) || isNull(x);\nconst isNumber = (x)=>'[object Number]' == type_utils_toString.call(x) && x === x;\nconst isPositiveNumber = (value)=>isNumber(value) && value > 0;\nconst isBoolean = (x)=>'[object Boolean]' === type_utils_toString.call(x);\nconst isFormData = (x)=>x instanceof FormData;\nconst isFile = (x)=>x instanceof File;\nconst isPlainError = (x)=>x instanceof Error;\nconst isKnownUnsafeEditableEvent = (x)=>includes(knownUnsafeEditableEvent, x);\nconst isKnownUnsafeEditableEventProperty = (x)=>includes(knownUnsafeEditableEventProperty, x);\nfunction isPrimitive(value) {\n    return null === value || 'object' != typeof value;\n}\nfunction isBuiltin(candidate, className) {\n    return Object.prototype.toString.call(candidate) === `[object ${className}]`;\n}\nfunction isError(candidate) {\n    switch(Object.prototype.toString.call(candidate)){\n        case '[object Error]':\n        case '[object Exception]':\n        case '[object DOMException]':\n        case '[object DOMError]':\n        case '[object WebAssembly.Exception]':\n            return true;\n        default:\n            return isInstanceOf(candidate, Error);\n    }\n}\nfunction isErrorEvent(event) {\n    return isBuiltin(event, 'ErrorEvent');\n}\nfunction isEvent(candidate) {\n    return \"u\" > typeof Event && isInstanceOf(candidate, Event);\n}\nfunction isPlainObject(candidate) {\n    return isBuiltin(candidate, 'Object');\n}\nfunction isInstanceOf(candidate, base) {\n    try {\n        return candidate instanceof base;\n    } catch  {\n        return false;\n    }\n}\nconst yesLikeValues = [\n    true,\n    'true',\n    1,\n    '1',\n    'yes'\n];\nconst isYesLike = (val)=>includes(yesLikeValues, val);\nconst noLikeValues = [\n    false,\n    'false',\n    0,\n    '0',\n    'no'\n];\nconst isNoLike = (val)=>includes(noLikeValues, val);\nexport { isArray, isBoolean, isBuiltin, isEmptyObject, isEmptyString, isError, isErrorEvent, isEvent, isFile, isFormData, isFunction, isKnownUnsafeEditableEvent, isKnownUnsafeEditableEventProperty, isNativeFunction, isNoLike, isNull, isNullish, isNumber, isObject, isPlainError, isPlainObject, isPositiveNumber, isPrimitive, isString, isUndefined, isYesLike, noLikeValues, type_utils_hasOwnProperty as hasOwnProperty, yesLikeValues };\n","let parsedStackResults;\nlet lastPostHogChunkIds;\nlet lastNativeDebugIds;\nlet cachedFilenameChunkIds;\nfunction getFilenameToChunkIdMap(stackParser) {\n    const posthogChunkIds = globalThis._posthogChunkIds;\n    const nativeDebugIds = globalThis._debugIds;\n    if (!posthogChunkIds && !nativeDebugIds) return;\n    const posthogKeys = posthogChunkIds ? Object.keys(posthogChunkIds) : [];\n    const nativeKeys = nativeDebugIds ? Object.keys(nativeDebugIds) : [];\n    if (cachedFilenameChunkIds && matchesSnapshot(posthogChunkIds, posthogKeys, lastPostHogChunkIds) && matchesSnapshot(nativeDebugIds, nativeKeys, lastNativeDebugIds)) return cachedFilenameChunkIds;\n    lastPostHogChunkIds = posthogChunkIds ? {\n        ...posthogChunkIds\n    } : void 0;\n    lastNativeDebugIds = nativeDebugIds ? {\n        ...nativeDebugIds\n    } : void 0;\n    cachedFilenameChunkIds = {};\n    parsedStackResults ??= {};\n    const addChunkIds = (keys, chunkIds)=>{\n        for (const stackKey of keys){\n            const chunkId = chunkIds[stackKey];\n            if (!chunkId) continue;\n            const cachedFilename = parsedStackResults?.[stackKey];\n            if (cachedFilename) {\n                cachedFilenameChunkIds[cachedFilename] = chunkId;\n                continue;\n            }\n            const parsedStack = stackParser(stackKey);\n            for(let i = parsedStack.length - 1; i >= 0; i--){\n                const filename = parsedStack[i]?.filename;\n                if (filename) {\n                    cachedFilenameChunkIds[filename] = chunkId;\n                    parsedStackResults[stackKey] = filename;\n                    break;\n                }\n            }\n        }\n    };\n    if (nativeDebugIds) addChunkIds(nativeKeys, nativeDebugIds);\n    if (posthogChunkIds) addChunkIds(posthogKeys, posthogChunkIds);\n    return cachedFilenameChunkIds;\n}\nfunction matchesSnapshot(chunkIds, keys, snapshot) {\n    if (!chunkIds || !snapshot) return chunkIds === snapshot;\n    return keys.length === Object.keys(snapshot).length && keys.every((key)=>chunkIds[key] === snapshot[key]);\n}\nexport { getFilenameToChunkIdMap };\n","import { isUndefined } from \"../../utils/index.mjs\";\nconst UNKNOWN_FUNCTION = '?';\nconst ANONYMOUS_FILENAME = '<anonymous>';\nconst URL_SCHEME = /^([a-z][a-z0-9.+-]+):/i;\nconst APP_URL_SCHEMES = [\n    'http',\n    'https',\n    'file',\n    'blob',\n    'app',\n    'capacitor',\n    'ionic',\n    'webpack',\n    'webpack-internal',\n    'ng'\n];\nfunction isAppFilename(filename) {\n    if (!filename || filename === ANONYMOUS_FILENAME) return false;\n    const scheme = URL_SCHEME.exec(filename);\n    return !scheme || APP_URL_SCHEMES.includes(scheme[1].toLowerCase());\n}\nfunction createFrame(platform, filename, func, lineno, colno) {\n    const frame = {\n        platform,\n        filename,\n        function: '<anonymous>' === func ? UNKNOWN_FUNCTION : func,\n        in_app: isAppFilename(filename)\n    };\n    if (!isUndefined(lineno)) frame.lineno = lineno;\n    if (!isUndefined(colno)) frame.colno = colno;\n    return frame;\n}\nexport { UNKNOWN_FUNCTION, createFrame };\n","import { UNKNOWN_FUNCTION } from \"./base.mjs\";\nconst extractSafariExtensionDetails = (func, filename)=>{\n    const isSafariExtension = -1 !== func.indexOf('safari-extension');\n    const isSafariWebExtension = -1 !== func.indexOf('safari-web-extension');\n    return isSafariExtension || isSafariWebExtension ? [\n        -1 !== func.indexOf('@') ? func.split('@')[0] : UNKNOWN_FUNCTION,\n        isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`\n    ] : [\n        func,\n        filename\n    ];\n};\nexport { extractSafariExtensionDetails };\n","import { UNKNOWN_FUNCTION, createFrame } from \"./base.mjs\";\nimport { extractSafariExtensionDetails } from \"./safari.mjs\";\nconst chromeRegexNoFnName = /^\\s*at (\\S+?)(?::(\\d+))(?::(\\d+))\\s*$/i;\nconst chromeRegex = /^\\s*at (?:(.+?\\)(?: \\[.+\\])?|.*?) ?\\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\\/)?.*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nconst chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\nconst chromeStackLineParser = (line, platform)=>{\n    const noFnParts = chromeRegexNoFnName.exec(line);\n    if (noFnParts) {\n        const [, filename, line, col] = noFnParts;\n        return createFrame(platform, filename, UNKNOWN_FUNCTION, +line, +col);\n    }\n    const parts = chromeRegex.exec(line);\n    if (parts) {\n        const isEval = parts[2] && 0 === parts[2].indexOf('eval');\n        if (isEval) {\n            const subMatch = chromeEvalRegex.exec(parts[2]);\n            if (subMatch) {\n                parts[2] = subMatch[1];\n                parts[3] = subMatch[2];\n                parts[4] = subMatch[3];\n            }\n        }\n        const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);\n        return createFrame(platform, filename, func, parts[3] ? +parts[3] : void 0, parts[4] ? +parts[4] : void 0);\n    }\n};\nexport { chromeStackLineParser };\n","import { UNKNOWN_FUNCTION, createFrame } from \"./base.mjs\";\nimport { extractSafariExtensionDetails } from \"./safari.mjs\";\nconst geckoREgex = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:[-a-z]+)?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\nconst geckoStackLineParser = (line, platform)=>{\n    const parts = geckoREgex.exec(line);\n    if (parts) {\n        const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n        if (isEval) {\n            const subMatch = geckoEvalRegex.exec(parts[3]);\n            if (subMatch) {\n                parts[1] = parts[1] || 'eval';\n                parts[3] = subMatch[1];\n                parts[4] = subMatch[2];\n                parts[5] = '';\n            }\n        }\n        let filename = parts[3];\n        let func = parts[1] || UNKNOWN_FUNCTION;\n        [func, filename] = extractSafariExtensionDetails(func, filename);\n        return createFrame(platform, filename, func, parts[4] ? +parts[4] : void 0, parts[5] ? +parts[5] : void 0);\n    }\n};\nexport { geckoStackLineParser };\n","import { UNKNOWN_FUNCTION } from \"./base.mjs\";\nimport { chromeStackLineParser } from \"./chrome.mjs\";\nimport { geckoStackLineParser } from \"./gecko.mjs\";\nconst WEBPACK_ERROR_REGEXP = /\\(error: (.*)\\)/;\nconst STACKTRACE_FRAME_LIMIT = 50;\nconst MAX_REPEATED_CYCLE_LENGTH = 10;\nconst STACKTRACE_LINE_LIMIT = 1000;\nfunction isSameFrame(a, b) {\n    return a.filename === b.filename && a.function === b.function && a.module === b.module && a.lineno === b.lineno && a.colno === b.colno;\n}\nfunction collapseRepeatedCycle(frames) {\n    for(let length = 1; length <= MAX_REPEATED_CYCLE_LENGTH; length++){\n        const start = frames.length - 2 * length;\n        if (start < 0) break;\n        let isCycle = true;\n        for(let offset = 0; offset < length; offset++){\n            const inner = frames[start + offset];\n            if (!isSameFrame(inner, frames[start + length + offset])) {\n                isCycle = false;\n                break;\n            }\n        }\n        if (isCycle) {\n            for(let offset = 0; offset < length; offset++)frames[start + offset] = frames[start + length + offset];\n            frames.length = start + length;\n            return {\n                start,\n                length\n            };\n        }\n    }\n}\nfunction trimPartialCycle(frames, cycle) {\n    const copyEnd = cycle.start + cycle.length;\n    const partialLength = partialCycleLength(frames, cycle);\n    if (partialLength) frames.splice(copyEnd + partialLength === frames.length ? copyEnd : cycle.start, partialLength);\n}\nfunction innermostPartialCycleLength(frames, cycle) {\n    let partialStart = cycle.start;\n    while(partialStart > 0 && isSameFrame(frames[partialStart - 1], frames[partialStart - 1 + cycle.length]))partialStart--;\n    return cycle.start - partialStart;\n}\nfunction partialCycleLength(frames, cycle) {\n    const copyEnd = cycle.start + cycle.length;\n    let partialEnd = copyEnd;\n    while(partialEnd < frames.length && isSameFrame(frames[partialEnd], frames[partialEnd - cycle.length]))partialEnd++;\n    return partialEnd - copyEnd;\n}\nfunction survivingFrameCount(frames, cycles) {\n    const innermostCycle = cycles[0];\n    let count = frames.length - (innermostCycle ? innermostPartialCycleLength(frames, innermostCycle) : 0);\n    for (const cycle of cycles)count -= partialCycleLength(frames, cycle);\n    return count;\n}\nfunction canonicalizeCycleRotation(frames) {\n    const keys = frames.map((frame)=>`${frame.function}|${frame.filename}|${frame.lineno}|${frame.colno}|${frame.module}`);\n    let first = 0;\n    for(let i = 1; i < keys.length; i++)if (isSmallerRotation(keys, i, first)) first = i;\n    frames.push(...frames.splice(0, first));\n}\nfunction isSmallerRotation(keys, candidate, best) {\n    for(let offset = 0; offset < keys.length; offset++){\n        const left = keys[(candidate + offset) % keys.length];\n        const right = keys[(best + offset) % keys.length];\n        if (left !== right) return left < right;\n    }\n    return false;\n}\nfunction reverseAndStripFrames(stack) {\n    if (!stack.length) return [];\n    const localStack = Array.from(stack);\n    localStack.reverse();\n    return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame)=>({\n            ...frame,\n            filename: frame.filename || getLastStackFrame(localStack).filename,\n            function: frame.function || UNKNOWN_FUNCTION\n        }));\n}\nfunction getLastStackFrame(arr) {\n    return arr[arr.length - 1] || {};\n}\nfunction createDefaultStackParser() {\n    return createStackParser(\"web:javascript\", chromeStackLineParser, geckoStackLineParser);\n}\nfunction createStackParser(platform, ...parsers) {\n    return (stack, skipFirstLines = 0)=>{\n        const frames = [];\n        const lines = stack.split('\\n');\n        const endLine = Math.min(lines.length, skipFirstLines + STACKTRACE_LINE_LIMIT);\n        const repeatedCycles = [];\n        for(let i = skipFirstLines; i < endLine; i++){\n            const line = lines[i];\n            if (line.length > 1024) continue;\n            const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;\n            if (!cleanedLine.match(/\\S*Error: /)) {\n                for (const parser of parsers){\n                    const frame = parser(cleanedLine, platform);\n                    if (frame) {\n                        frames.push(frame);\n                        const cycle = collapseRepeatedCycle(frames);\n                        if (cycle) {\n                            for(let i = repeatedCycles.length - 1; i >= 0; i--){\n                                const previous = repeatedCycles[i];\n                                if (previous.start + previous.length <= cycle.start) break;\n                                repeatedCycles.pop();\n                            }\n                            repeatedCycles.push(cycle);\n                        }\n                        break;\n                    }\n                }\n                if (survivingFrameCount(frames, repeatedCycles) >= STACKTRACE_FRAME_LIMIT) break;\n            }\n        }\n        const sections = [\n            ...repeatedCycles\n        ].sort((a, b)=>b.start - a.start);\n        const innermostSection = sections[sections.length - 1];\n        if (innermostSection) {\n            const trimmed = innermostPartialCycleLength(frames, innermostSection);\n            frames.splice(innermostSection.start - trimmed, trimmed);\n            for (const cycle of sections)cycle.start -= trimmed;\n        }\n        for (const cycle of sections)trimPartialCycle(frames, cycle);\n        if (repeatedCycles.some((cycle)=>0 === cycle.start && frames.length === cycle.length)) canonicalizeCycleRotation(frames);\n        return reverseAndStripFrames(frames);\n    };\n}\nexport { winjsStackLineParser } from \"./winjs.mjs\";\nexport { opera10StackLineParser, opera11StackLineParser } from \"./opera.mjs\";\nexport { nodeStackLineParser } from \"./node.mjs\";\nexport { chromeStackLineParser, createDefaultStackParser, createStackParser, geckoStackLineParser, reverseAndStripFrames };\n","const ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;\nclass StringCoercer {\n    match(input) {\n        return 'string' == typeof input;\n    }\n    coerce(input, ctx) {\n        const [type, value] = this.getInfos(input);\n        return {\n            type: type ?? 'Error',\n            value: value ?? input,\n            stack: ctx.syntheticException?.stack,\n            synthetic: true\n        };\n    }\n    getInfos(candidate) {\n        let type = 'Error';\n        let value = candidate;\n        const groups = candidate.match(ERROR_TYPES_PATTERN);\n        if (groups) {\n            type = groups[1];\n            value = groups[2];\n        }\n        return [\n            type,\n            value\n        ];\n    }\n}\nexport { StringCoercer };\n","const severityLevels = [\n    'fatal',\n    'error',\n    'warning',\n    'log',\n    'info',\n    'debug'\n];\nexport { severityLevels };\n","function truncate(str, max = 0) {\n    if ('string' != typeof str || 0 === max) return str;\n    return str.length <= max ? str : `${str.slice(0, max)}...`;\n}\nfunction extractExceptionKeysForMessage(err, maxLength = 40) {\n    const keys = Object.keys(err);\n    keys.sort();\n    if (!keys.length) return '[object has no keys]';\n    for(let i = keys.length; i > 0; i--){\n        const serialized = keys.slice(0, i).join(', ');\n        if (!(serialized.length > maxLength)) {\n            if (i === keys.length) return serialized;\n            return serialized.length <= maxLength ? serialized : `${serialized.slice(0, maxLength)}...`;\n        }\n    }\n    return '';\n}\nexport { extractExceptionKeysForMessage, truncate };\n","import config from \"../config.mjs\";\nimport { isUndefined } from \"@posthog/core\";\nconst _createLogger = (prefix, { debugEnabled } = {})=>{\n    const logger = {\n        _log: (level, ...args)=>{\n            let browserWindow;\n            try {\n                browserWindow = \"u\" < typeof window ? void 0 : window;\n            } catch  {\n                return;\n            }\n            if (browserWindow && (config.DEBUG || browserWindow.POSTHOG_DEBUG || debugEnabled) && !isUndefined(browserWindow.console) && browserWindow.console) {\n                const consoleLog = '__rrweb_original__' in browserWindow.console[level] ? browserWindow.console[level]['__rrweb_original__'] : browserWindow.console[level];\n                consoleLog(prefix, ...args);\n            }\n        },\n        debug: (...args)=>{\n            logger._log('debug', ...args);\n        },\n        info: (...args)=>{\n            logger._log('log', ...args);\n        },\n        warn: (...args)=>{\n            logger._log('warn', ...args);\n        },\n        error: (...args)=>{\n            logger._log('error', ...args);\n        },\n        critical: (...args)=>{\n            console.error(prefix, ...args);\n        },\n        uninitializedWarning: (methodName)=>{\n            logger.error(`You must initialize PostHog before calling ${methodName}`);\n        },\n        createLogger: (additionalPrefix, options)=>_createLogger(`${prefix} ${additionalPrefix}`, options)\n    };\n    return logger;\n};\nconst logger_logger = /* @__PURE__ */ _createLogger('[PostHog.js]');\nconst createLogger = (prefix, options)=>logger_logger.createLogger(prefix, options);\nexport { createLogger, logger_logger as logger };\n","import { window } from '@posthog/browser-common/utils/globals'\nimport { assignableWindow } from '../utils/globals'\nimport { ErrorEventArgs } from '../types'\nimport { createLogger } from '@posthog/browser-common/utils/logger'\nimport { isArray, isFunction, isNull, isString, type ErrorTracking } from '@posthog/core'\nimport { buildErrorPropertiesBuilder } from '../posthog-exceptions'\n\nconst logger = createLogger('[ExceptionAutocapture]')\nconst errorPropertiesBuilder = buildErrorPropertiesBuilder()\n\n// Exception autocapture must never throw into customer code. Do not log in the catch because\n// console.error may be instrumented and would re-enter exception autocapture.\nconst safely = <T>(fn: () => T, fallback: T): T => {\n    try {\n        return fn()\n    } catch {\n        return fallback\n    }\n}\n\nconst safelyBuildAndCapture = (\n    captureFn: (props: ErrorTracking.ErrorProperties) => void,\n    buildProperties: () => ErrorTracking.ErrorProperties\n): void => safely(() => captureFn(buildProperties()), undefined)\n\n// Firefox throws on every read, write and call that touches an object from another compartment or\n// from a destroyed document, such as a handler left behind by a removed or cross-origin iframe.\n// The handler is probed inside the guard and called outside it, so an unreachable handler is\n// skipped while errors from a reachable one still reach the page.\nconst isReachableFunction = (handler: unknown): handler is (...args: any[]) => any =>\n    safely(() => isFunction(handler) && isFunction(handler.call), false)\n\nconst markInstrumented = (owner: any, key: string): void =>\n    safely(() => {\n        owner[key].__POSTHOG_INSTRUMENTED__ = true\n    }, undefined)\n\n// The marker lives on the wrapper, so deleting it can throw on a frozen or unreachable handler.\n// It is guarded on its own so that failure cannot skip the restore, which is the functional half.\nconst restore = (owner: any, key: string, original: unknown): void => {\n    safely(() => {\n        delete owner[key]?.__POSTHOG_INSTRUMENTED__\n    }, undefined)\n    safely(() => {\n        owner[key] = original\n    }, undefined)\n}\n\n// `window.onerror` exposes the location positionally, so preserve it when there is no Error object.\nconst resolveOnErrorInput = ([event, source, lineno, colno, error]: ErrorEventArgs): unknown => {\n    if (error != null) {\n        return error\n    }\n    if (isString(event) && isString(source) && source.length > 0 && typeof ErrorEvent !== 'undefined') {\n        try {\n            return new ErrorEvent('error', { message: event, filename: source, lineno, colno })\n        } catch {\n            return event\n        }\n    }\n    return event\n}\n\nconst wrapOnError = (captureFn: (props: ErrorTracking.ErrorProperties) => void) => {\n    const win = window as any\n    if (!win) {\n        logger.info('window not available, cannot wrap onerror')\n    }\n    const originalOnError = safely(() => win.onerror, undefined)\n\n    win.onerror = function (...args: ErrorEventArgs): boolean {\n        safelyBuildAndCapture(captureFn, () =>\n            errorPropertiesBuilder.buildFromUnknown(resolveOnErrorInput(args), {\n                mechanism: { handled: false },\n            })\n        )\n        if (!isReachableFunction(originalOnError)) {\n            return false\n        }\n        return originalOnError(...args) ?? false\n    }\n    markInstrumented(win, 'onerror')\n\n    return () => restore(win, 'onerror', originalOnError)\n}\n\nconst wrapUnhandledRejection = (\n    captureFn: (props: ErrorTracking.ErrorProperties) => void,\n    defaultReturnValue = false\n) => {\n    const win = window as any\n    if (!win) {\n        logger.info('window not available, cannot wrap onUnhandledRejection')\n    }\n\n    const originalOnUnhandledRejection = safely(() => win.onunhandledrejection, undefined)\n\n    win.onunhandledrejection = function (ev: PromiseRejectionEvent): boolean {\n        safelyBuildAndCapture(captureFn, () =>\n            errorPropertiesBuilder.buildFromUnknown(ev, {\n                mechanism: { handled: false },\n            })\n        )\n        if (!isReachableFunction(originalOnUnhandledRejection)) {\n            return defaultReturnValue\n        }\n        return originalOnUnhandledRejection(ev) ?? false\n    }\n    markInstrumented(win, 'onunhandledrejection')\n\n    return () => restore(win, 'onunhandledrejection', originalOnUnhandledRejection)\n}\n\nconst wrapConsoleError = (captureFn: (props: ErrorTracking.ErrorProperties) => void) => {\n    const con = console as any\n    if (!con) {\n        logger.info('console not available, cannot wrap console.error')\n    }\n\n    const originalConsoleError = safely(() => con.error, undefined)\n\n    con.error = function (...args: any[]): void {\n        // Check before selecting an Error argument, which loses the diagnostic prefix.\n        // SDK loggers pass the prefix and diagnostic separately, including in older bundles.\n        const isInternalDiagnostic = safely(\n            () =>\n                args.length > 1 &&\n                isString(args[0]) &&\n                (/^\\[PostHog\\.js\\](?: |$)/.test(args[0]) || args[0] === 'rrweb logger error:'),\n            false\n        )\n        if (!isInternalDiagnostic) {\n            safelyBuildAndCapture(captureFn, () => {\n                let event\n                if (args.length == 1) {\n                    event = args[0]\n                } else {\n                    event = args.join(' ')\n                }\n                const error = args.find((arg) => arg instanceof Error)\n                return errorPropertiesBuilder.buildFromUnknown(error || event, {\n                    mechanism: { handled: true, type: 'onconsole' },\n                    syntheticException: new Error('PostHog syntheticException'),\n                    skipFirstLines: 2,\n                })\n            })\n        }\n        if (isReachableFunction(originalConsoleError)) {\n            originalConsoleError(...args)\n        }\n    }\n    markInstrumented(con, 'error')\n\n    return () => restore(con, 'error', originalConsoleError)\n}\n\nconst posthogErrorWrappingFunctions = {\n    wrapOnError,\n    wrapUnhandledRejection,\n    wrapConsoleError,\n}\n\nassignableWindow.__PosthogExtensions__ = assignableWindow.__PosthogExtensions__ || {}\nassignableWindow.__PosthogExtensions__.errorWrappingFunctions = posthogErrorWrappingFunctions\n\n// we used to put these on window, and now we put them on __PosthogExtensions__\n// but that means that old clients which lazily load this extension are looking in the wrong place\n// yuck,\n// so we also put them directly on the window\n// when 1.161.1 is the oldest version seen in production we can remove this\nassignableWindow.posthogErrorWrappingFunctions = posthogErrorWrappingFunctions\n\n// posthog-js <= 1.141.0 checked the first spelling after loading this bundle,\n// but called the second spelling. Keep both aliases because the unversioned\n// extension bundle can be loaded by those pinned clients.\ntype LegacyPostHogInstance = {\n    capture?: (event: string, properties: Record<string, any>, options?: Record<string, any>) => unknown\n}\ntype LegacyDecideResponse = {\n    autocaptureExceptions?: boolean | { errors_to_ignore?: string[] }\n}\nconst extendPostHogWithExceptionAutocapture = (instance?: LegacyPostHogInstance, response?: LegacyDecideResponse) => {\n    if (!isFunction(instance?.capture)) {\n        return\n    }\n\n    const autocaptureExceptions = response?.autocaptureExceptions\n    const errorsToIgnore =\n        !isNull(autocaptureExceptions) &&\n        typeof autocaptureExceptions === 'object' &&\n        isArray(autocaptureExceptions.errors_to_ignore)\n            ? autocaptureExceptions.errors_to_ignore.reduce<RegExp[]>((rules, rule) => {\n                  try {\n                      rules.push(new RegExp(rule))\n                  } catch (error) {\n                      logger.error('Ignoring invalid legacy exception exclusion rule', rule, error)\n                  }\n                  return rules\n              }, [])\n            : []\n\n    const sendExceptionEvent = (properties: ErrorTracking.ErrorProperties) => {\n        try {\n            instance.capture?.('$exception', properties as Record<string, any>, {\n                _noTruncate: true,\n                _batchKey: 'exceptionEvent',\n                _noHeatmaps: true,\n            })\n        } catch (error) {\n            logger.error('Failed to capture exception for a legacy client', error)\n        }\n    }\n\n    const captureException = (properties: ErrorTracking.ErrorProperties) => {\n        if (\n            errorsToIgnore.some((regex) =>\n                properties.$exception_list.some((exception) => regex.test(exception.value || ''))\n            )\n        ) {\n            return\n        }\n\n        sendExceptionEvent(properties)\n    }\n\n    wrapOnError(captureException)\n    wrapUnhandledRejection(sendExceptionEvent, true)\n}\n\nassignableWindow.extendPostHogWithExceptionAutoCapture = extendPostHogWithExceptionAutocapture\nassignableWindow.extendPostHogWithExceptionAutocapture = extendPostHogWithExceptionAutocapture\n\nexport default posthogErrorWrappingFunctions\n","import { ERROR_TRACKING_CAPTURE_EXTENSION_EXCEPTIONS, ERROR_TRACKING_SUPPRESSION_RULES } from './constants'\nimport { Extension } from './extensions/types'\nimport { PostHog } from './posthog-core'\nimport { CaptureResult, ErrorTrackingSuppressionRule, Properties, RemoteConfigResult } from './types'\nimport { createLogger } from '@posthog/browser-common/utils/logger'\nimport { propertyComparisons } from '@posthog/browser-common/utils/property-utils'\nimport { isString, isArray, isObject, ErrorTracking, isNullish } from '@posthog/core'\nimport { isStackOverflowError } from './utils/stack-overflow'\n\nconst logger = /* @__PURE__ */ createLogger('[Error tracking]')\n\n// Safari masks the URL of extension content scripts as `webkit-masked-url://hidden/`. It masks\n// some of the page's own scripts the same way, so a masked frame alone does not prove the\n// exception came from an extension (see _isExtensionException).\nconst MASKED_URL_PREFIX = 'webkit-masked-url:'\n\nconst MASKED_EXTENSION_EXCEPTION_VALUE = [\n    { value: 'isolatedAPI.contexts.topHostname', exact: false },\n    { value: 'No response from target', exact: true },\n]\n\n// Browser extensions serve their content scripts from these schemes. `safari-extension:` and\n// `safari-web-extension:` are synthesised by the stack parser (see extractSafariExtensionDetails)\n// rather than being real URLs, but they mark the frame just as definitively.\nconst EXTENSION_URL_PREFIXES = [\n    'chrome-extension://',\n    'moz-extension://',\n    'safari-extension:',\n    'safari-web-extension:',\n    MASKED_URL_PREFIX,\n]\n\n// Some mobile browsers inject their own user scripts into every page. These scripts read\n// browser-private globals, and when a script runs before its global exists it throws. The\n// browser attributes the injected script to the host document, so the frame filename is the\n// page URL and EXTENSION_URL_PREFIXES cannot catch it. We match the private global in the\n// exception value instead. No page or SDK code references these names.\nconst INJECTED_BROWSER_SCRIPT_GLOBALS = ['__firefox__', '__gCrWeb']\n\nexport function buildErrorPropertiesBuilder() {\n    return new ErrorTracking.ErrorPropertiesBuilder(\n        [\n            new ErrorTracking.DOMExceptionCoercer(),\n            new ErrorTracking.PromiseRejectionEventCoercer(),\n            new ErrorTracking.ErrorEventCoercer(),\n            new ErrorTracking.ErrorCoercer(),\n            new ErrorTracking.EventCoercer(),\n            new ErrorTracking.ObjectCoercer(),\n            new ErrorTracking.StringCoercer(),\n            new ErrorTracking.PrimitiveCoercer(),\n        ],\n        ErrorTracking.createDefaultStackParser()\n    )\n}\nexport class PostHogExceptions implements Extension {\n    private readonly _instance: PostHog\n    private _suppressionRules: ErrorTrackingSuppressionRule[] = []\n    private _errorPropertiesBuilder: ErrorTracking.ErrorPropertiesBuilder = buildErrorPropertiesBuilder()\n    private _exceptionStepsBuffer: ErrorTracking.ExceptionStepsBuffer\n    private _exceptionStepsConfig: ErrorTracking.ResolvedExceptionStepsConfig\n\n    constructor(instance: PostHog) {\n        this._instance = instance\n        this._suppressionRules = this._instance.persistence?.get_property(ERROR_TRACKING_SUPPRESSION_RULES) ?? []\n        this._exceptionStepsConfig = ErrorTracking.resolveExceptionStepsConfig(this._getExceptionStepsConfig())\n        this._exceptionStepsBuffer = new ErrorTracking.ExceptionStepsBuffer(this._exceptionStepsConfig)\n    }\n\n    onConfigChange() {\n        this._exceptionStepsConfig = ErrorTracking.resolveExceptionStepsConfig(this._getExceptionStepsConfig())\n        this._exceptionStepsBuffer.setConfig(this._exceptionStepsConfig)\n    }\n\n    onRemoteConfig(result: RemoteConfigResult) {\n        if (!result.ok) {\n            // Failure behaves like a response without an errorTracking key.\n            return\n        }\n\n        const response = result.config\n        if (!('errorTracking' in response)) {\n            return\n        }\n\n        const suppressionRules = response.errorTracking?.suppressionRules ?? []\n        const captureExtensionExceptions = response.errorTracking?.captureExtensionExceptions\n\n        // store this in-memory in case persistence is disabled\n        this._suppressionRules = suppressionRules\n\n        if (this._instance.persistence) {\n            this._instance.persistence.register({\n                [ERROR_TRACKING_SUPPRESSION_RULES]: this._suppressionRules,\n                [ERROR_TRACKING_CAPTURE_EXTENSION_EXCEPTIONS]: captureExtensionExceptions,\n            })\n        }\n    }\n\n    private get _captureExtensionExceptions() {\n        const enabled_server_side = !!this._instance.get_property(ERROR_TRACKING_CAPTURE_EXTENSION_EXCEPTIONS)\n        const enabled_client_side = this._instance.config.error_tracking.captureExtensionExceptions\n        return enabled_client_side ?? enabled_server_side ?? false\n    }\n\n    buildProperties(\n        input: unknown,\n        metadata?: { handled?: boolean; syntheticException?: Error }\n    ): ErrorTracking.ErrorProperties {\n        return this._errorPropertiesBuilder.buildFromUnknown(input, {\n            syntheticException: metadata?.syntheticException,\n            mechanism: {\n                handled: metadata?.handled,\n            },\n        })\n    }\n\n    addExceptionStep(message: string, properties?: Properties): void {\n        if (!this._exceptionStepsConfig.enabled) {\n            return\n        }\n\n        try {\n            if (!isString(message) || message.trim().length === 0) {\n                logger.warn('Ignoring exception step because message must be a non-empty string')\n                return\n            }\n\n            const userProperties = this._coerceExceptionStepProperties(properties)\n\n            const { sanitizedProperties, droppedKeys } = ErrorTracking.stripReservedExceptionStepFields(userProperties)\n\n            if (droppedKeys.length > 0) {\n                logger.warn('Ignoring reserved exception step fields', { droppedKeys })\n            }\n\n            this._exceptionStepsBuffer.add({\n                [ErrorTracking.EXCEPTION_STEP_INTERNAL_FIELDS.MESSAGE]: message,\n                [ErrorTracking.EXCEPTION_STEP_INTERNAL_FIELDS.TIMESTAMP]: new Date().toISOString(),\n                ...sanitizedProperties,\n            })\n        } catch (error) {\n            logger.error('Failed to add exception step. Ignoring breadcrumb.', error)\n        }\n    }\n\n    sendExceptionEvent(properties: Properties): CaptureResult | undefined {\n        try {\n            const exceptionList = properties.$exception_list\n\n            if (this._isExceptionList(exceptionList)) {\n                if (this._matchesSuppressionRule(exceptionList)) {\n                    this._addDroppedExceptionStep('Exception dropped: matched a suppression rule')\n                    logger.info('Skipping exception capture because a suppression rule matched')\n                    return\n                }\n\n                if (!this._captureExtensionExceptions && this._isExtensionException(exceptionList)) {\n                    this._addDroppedExceptionStep('Exception dropped: thrown by a browser extension')\n                    logger.info('Skipping exception capture because it was thrown by an extension')\n                    return\n                }\n\n                if (!this._captureExtensionExceptions && this._isInjectedBrowserScriptException(exceptionList)) {\n                    this._addDroppedExceptionStep('Exception dropped: thrown by an injected browser script')\n                    logger.info('Skipping exception capture because it was thrown by an injected browser script')\n                    return\n                }\n\n                if (\n                    !this._instance.config.error_tracking.__capturePostHogExceptions &&\n                    this._isPostHogException(exceptionList)\n                ) {\n                    this._addDroppedExceptionStep('Exception dropped: thrown by the PostHog SDK')\n                    logger.info('Skipping exception capture because it was thrown by the PostHog SDK')\n                    return\n                }\n            }\n\n            const propertiesForExceptionCapture =\n                this._exceptionStepsConfig.enabled && isNullish(properties.$exception_steps)\n                    ? this._addBufferedExceptionSteps(properties)\n                    : properties\n\n            const injectedReleaseId = ErrorTracking.getInjectedReleaseId()\n            if (injectedReleaseId) {\n                propertiesForExceptionCapture.$release_id = injectedReleaseId\n            }\n\n            try {\n                const result = this._instance.capture('$exception', propertiesForExceptionCapture, {\n                    _noTruncate: true,\n                    _batchKey: 'exceptionEvent',\n                    _originatedFromCaptureException: true,\n                })\n\n                if (result) {\n                    this._exceptionStepsBuffer.clear()\n                }\n\n                return result\n            } catch (error) {\n                if (!isStackOverflowError(error)) {\n                    logger.error('Failed to capture exception event. Dropping this exception.', error)\n                }\n                this._exceptionStepsBuffer.clear()\n                return\n            }\n        } catch (error) {\n            if (!isStackOverflowError(error)) {\n                logger.error('Failed to process exception event. Ignoring this exception.', error)\n            }\n            return\n        }\n    }\n\n    private _addBufferedExceptionSteps(properties: Properties): Properties {\n        try {\n            const exceptionSteps = this._exceptionStepsBuffer.getAttachable()\n\n            if (exceptionSteps.length === 0) {\n                return properties\n            }\n\n            return {\n                ...properties,\n                $exception_steps: exceptionSteps,\n            }\n        } catch (error) {\n            logger.error('Failed to read buffered exception steps. Capturing exception without steps.', error)\n            return properties\n        }\n    }\n\n    private _addDroppedExceptionStep(message: string): void {\n        if (this._exceptionStepsConfig.enabled) {\n            this._exceptionStepsBuffer.add({\n                [ErrorTracking.EXCEPTION_STEP_INTERNAL_FIELDS.MESSAGE]: message,\n                [ErrorTracking.EXCEPTION_STEP_INTERNAL_FIELDS.TIMESTAMP]: new Date().toISOString(),\n            })\n        }\n    }\n\n    private _coerceExceptionStepProperties(properties?: Properties): Record<string, unknown> {\n        if (!isObject(properties)) {\n            return {}\n        }\n\n        return { ...(properties as Record<string, unknown>) }\n    }\n\n    private _getExceptionStepsConfig(): ErrorTracking.ExceptionStepsConfig {\n        return this._instance.config.error_tracking?.exception_steps ?? {}\n    }\n\n    private _matchesSuppressionRule(exceptionList: ErrorTracking.ExceptionList): boolean {\n        if (exceptionList.length === 0) {\n            return false\n        }\n\n        try {\n            const exceptionValues = exceptionList.reduce(\n                (acc, { type, value }) => {\n                    if (isString(type) && type.length > 0) {\n                        acc['$exception_types'].push(type)\n                    }\n                    if (isString(value) && value.length > 0) {\n                        acc['$exception_values'].push(value)\n                    }\n                    return acc\n                },\n                {\n                    $exception_types: [] as string[],\n                    $exception_values: [] as string[],\n                }\n            )\n\n            return this._suppressionRules.some((rule) => {\n                const results = rule.values.map((v) => {\n                    const compare: ((targets: string[], values: string[]) => boolean) | undefined =\n                        propertyComparisons[v.operator]\n                    const values: string[] | undefined = exceptionValues[v.key]\n\n                    if (!compare || !values) {\n                        return false\n                    }\n\n                    const targets = isArray(v.value) ? v.value : [v.value]\n                    return targets.length > 0 ? compare(targets, values) : false\n                })\n                return rule.type === 'OR' ? results.some(Boolean) : results.every(Boolean)\n            })\n        } catch (error) {\n            // Suppression only ever filters what we capture, so failing to evaluate it must not cost\n            // us the exception. Letting this throw reaches the handler in sendExceptionEvent, which\n            // drops the event entirely.\n            logger.warn('Failed to evaluate suppression rules. Capturing the exception.', error)\n            return false\n        }\n    }\n\n    private _isExtensionException(exceptionList: ErrorTracking.ExceptionList): boolean {\n        const frames = exceptionList.flatMap((e) => e.stacktrace?.frames ?? [])\n        const extensionFrames = frames.filter(\n            ({ filename }) => !!filename && EXTENSION_URL_PREFIXES.some((prefix) => filename.startsWith(prefix))\n        )\n        if (extensionFrames.length === 0) {\n            return false\n        }\n\n        // Safari also masks blob, eval'd, and injected application code, so a masked URL alone does\n        // not prove the exception came from an extension. For an all-masked stack, require a known\n        // extension-only signature and no remaining page frame. Ignore masked frames when checking\n        // for page code because the Sentry integration may forward them with `in_app: true`.\n        const onlyMaskedExtensionFrames = extensionFrames.every(\n            ({ filename }) => !!filename && filename.startsWith(MASKED_URL_PREFIX)\n        )\n        if (onlyMaskedExtensionFrames) {\n            const hasKnownExtensionSignature = exceptionList.some(\n                ({ type, value }) =>\n                    type === 'NoResponse' ||\n                    (isString(value) &&\n                        MASKED_EXTENSION_EXCEPTION_VALUE.some(({ value: signature, exact }) =>\n                            exact ? value === signature : value.includes(signature)\n                        ))\n            )\n            return (\n                hasKnownExtensionSignature &&\n                !frames.some(({ in_app, filename }) => in_app && !filename?.startsWith(MASKED_URL_PREFIX))\n            )\n        }\n\n        return true\n    }\n\n    private _isInjectedBrowserScriptException(exceptionList: ErrorTracking.ExceptionList): boolean {\n        return exceptionList.some(({ value }) => {\n            return isString(value) && INJECTED_BROWSER_SCRIPT_GLOBALS.some((global) => value.includes(global))\n        })\n    }\n\n    private _isPostHogException(exceptionList: ErrorTracking.ExceptionList): boolean {\n        if (exceptionList.length > 0) {\n            const exception = exceptionList[0]\n            const frames = exception.stacktrace?.frames ?? []\n            const lastFrame = frames[frames.length - 1]\n            return lastFrame?.filename?.includes('posthog.com/static') ?? false\n        }\n\n        return false\n    }\n\n    private _isExceptionList(candidate: unknown): candidate is ErrorTracking.ExceptionList {\n        return !isNullish(candidate) && isArray(candidate)\n    }\n}\n","import { isArray, isError } from \"../utils/index.mjs\";\nimport { getFilenameToChunkIdMap } from \"./chunk-ids.mjs\";\nconst MAX_EXCEPTIONS = 50;\nconst MAX_AGGREGATE_MEMBER_INSPECTIONS = 1000;\nconst MAX_ERROR_PROTOTYPE_DEPTH = 100;\nconst MAX_WRAPPER_RECURSION = 4;\nclass ErrorPropertiesBuilder {\n    constructor(coercers, stackParser, modifiers = []){\n        this.coercers = coercers;\n        this.stackParser = stackParser;\n        this.modifiers = modifiers;\n    }\n    buildFromUnknown(input, hint = {}) {\n        const providedMechanism = hint && hint.mechanism;\n        const mechanism = providedMechanism || {\n            handled: true,\n            type: 'generic'\n        };\n        const coercingContext = this.buildCoercingContext(mechanism, hint, 0);\n        const exceptionWithCause = coercingContext.apply(input);\n        const parsingContext = this.buildParsingContext(hint);\n        const exceptionWithStack = this.parseStacktrace(exceptionWithCause, parsingContext);\n        const exceptionList = this.convertToExceptionList(exceptionWithStack, mechanism);\n        return {\n            $exception_list: exceptionList,\n            $exception_level: 'error'\n        };\n    }\n    async modifyFrames(exceptionList) {\n        for (const exc of exceptionList)if (exc.stacktrace && exc.stacktrace.frames && isArray(exc.stacktrace.frames)) exc.stacktrace.frames = await this.applyModifiers(exc.stacktrace.frames);\n        return exceptionList;\n    }\n    coerceFallback(ctx) {\n        return {\n            type: 'Error',\n            value: 'Unknown error',\n            stack: ctx.syntheticException?.stack,\n            synthetic: true\n        };\n    }\n    parseStacktrace(err, ctx) {\n        let cause;\n        if (null != err.cause) cause = this.parseStacktrace(err.cause, ctx);\n        let stack;\n        if ('' != err.stack && null != err.stack) try {\n            stack = this.applyChunkIds(this.stackParser(err.stack, err.synthetic ? ctx.skipFirstLines : 0), ctx.chunkIdMap);\n        } catch  {}\n        return {\n            ...err,\n            cause,\n            stack,\n            errors: err.errors?.map((child)=>this.parseStacktrace(child, ctx))\n        };\n    }\n    applyChunkIds(frames, chunkIdMap) {\n        return frames.map((frame)=>{\n            if (frame.filename && chunkIdMap) frame.chunk_id = chunkIdMap[frame.filename];\n            return frame;\n        });\n    }\n    applyCoercers(input, ctx) {\n        for (const adapter of this.coercers)if (adapter.match(input)) return adapter.coerce(input, ctx);\n        return this.coerceFallback(ctx);\n    }\n    async applyModifiers(frames) {\n        let newFrames = frames;\n        for (const modifier of this.modifiers)newFrames = await modifier(newFrames);\n        return newFrames;\n    }\n    convertToExceptionList(exceptionWithStack, mechanism) {\n        const exceptionList = [];\n        const append = (exception, parentId, source)=>{\n            const exceptionId = exceptionList.length;\n            const entryMechanism = void 0 === parentId ? {\n                type: 'string' == typeof mechanism.type && mechanism.type.length > 0 ? mechanism.type : 'generic',\n                ...'boolean' == typeof mechanism.handled ? {\n                    handled: mechanism.handled\n                } : void 0 === mechanism.handled ? {\n                    handled: true\n                } : {},\n                synthetic: 'boolean' == typeof mechanism.synthetic ? mechanism.synthetic : exception.synthetic,\n                exception_id: exceptionId\n            } : {\n                type: 'chained',\n                source,\n                synthetic: exception.synthetic,\n                exception_id: exceptionId,\n                parent_id: parentId\n            };\n            const currentException = {\n                type: exception.type,\n                value: exception.value,\n                mechanism: entryMechanism\n            };\n            if (exception.stack) currentException.stacktrace = {\n                type: 'raw',\n                frames: exception.stack\n            };\n            exceptionList.push(currentException);\n            if (exception.cause) append(exception.cause, exceptionId, 'cause');\n            for (const child of exception.errors ?? [])append(child, exceptionId, 'member');\n        };\n        append(exceptionWithStack);\n        return exceptionList;\n    }\n    buildParsingContext(hint) {\n        const context = {\n            chunkIdMap: getFilenameToChunkIdMap(this.stackParser),\n            skipFirstLines: hint.skipFirstLines ?? 1\n        };\n        return context;\n    }\n    getAggregateErrors(input) {\n        try {\n            if (isError(input)) {\n                let prototype = Object.getPrototypeOf(input);\n                for(let depth = 0; prototype && depth < MAX_ERROR_PROTOTYPE_DEPTH; depth++){\n                    const constructor = Object.getOwnPropertyDescriptor(prototype, 'constructor')?.value;\n                    if ('function' == typeof constructor && 'AggregateError' === constructor.name) {\n                        const errors = input.errors;\n                        return isArray(errors) ? errors : void 0;\n                    }\n                    prototype = Object.getPrototypeOf(prototype);\n                }\n            }\n        } catch  {}\n    }\n    buildCoercingContext(mechanism, hint, depth = 0) {\n        let count = 0;\n        let memberInspections = 0;\n        let hasAggregate = false;\n        const seen = new Set();\n        const wrappers = [];\n        const skipped = {};\n        const coerce = (input, depth, wrapperDepth = 0)=>{\n            const ctx = createContext(depth, wrapperDepth);\n            const forward = ctx.apply;\n            ctx.apply = (nextInput)=>{\n                wrappers.push(input);\n                try {\n                    return forward(nextInput);\n                } finally{\n                    wrappers.pop();\n                }\n            };\n            if (wrapperDepth > MAX_WRAPPER_RECURSION || wrapperDepth > 0 && -1 !== wrappers.indexOf(input)) return this.coerceFallback(ctx);\n            const isReference = 'object' == typeof input && null !== input || 'function' == typeof input;\n            if (0 === wrapperDepth && count >= MAX_EXCEPTIONS || isReference && seen.has(input)) return;\n            if (isReference) seen.add(input);\n            if (0 === wrapperDepth) count++;\n            const errors = this.getAggregateErrors(input);\n            hasAggregate ||= !!errors;\n            let exception;\n            try {\n                exception = this.applyCoercers(input, ctx);\n                if (!exception) throw skipped;\n            } catch (error) {\n                if (error === skipped) {\n                    if (0 === wrapperDepth) count--;\n                    return;\n                }\n                if (!hasAggregate) throw error;\n                exception = this.coerceFallback(ctx);\n            }\n            if (!errors || count >= MAX_EXCEPTIONS) return exception;\n            let length;\n            try {\n                length = errors.length;\n            } catch  {\n                return exception;\n            }\n            if (!Number.isInteger(length) || length < 0 || length > 0xffffffff) return exception;\n            const children = [];\n            for(let index = 0; count < MAX_EXCEPTIONS && memberInspections < MAX_AGGREGATE_MEMBER_INSPECTIONS && index < length; index++){\n                memberInspections++;\n                let child;\n                try {\n                    child = ctx.next(errors[index]);\n                } catch  {\n                    count++;\n                    child = this.coerceFallback(createContext(depth + 1));\n                }\n                if (child) children.push(child);\n            }\n            return {\n                ...exception,\n                errors: children\n            };\n        };\n        const createContext = (depth, wrapperDepth = 0)=>({\n                ...hint,\n                syntheticException: 0 == depth ? hint.syntheticException : void 0,\n                mechanism: 0 == depth ? mechanism : {},\n                apply: (input)=>{\n                    const exception = coerce(input, depth, wrapperDepth + 1);\n                    if (!exception) throw skipped;\n                    return exception;\n                },\n                next: (input)=>coerce(input, depth + 1)\n            });\n        const context = createContext(depth);\n        return {\n            ...context,\n            apply: (input)=>coerce(input, depth) ?? this.coerceFallback(context)\n        };\n    }\n}\nexport { ErrorPropertiesBuilder };\n","import { isBuiltin, isString } from \"../../utils/index.mjs\";\nclass DOMExceptionCoercer {\n    match(err) {\n        return this.isDOMException(err) || this.isDOMError(err);\n    }\n    coerce(err, ctx) {\n        const hasStack = isString(err.stack);\n        return {\n            type: this.getType(err),\n            value: this.getValue(err),\n            stack: hasStack ? err.stack : void 0,\n            cause: err.cause ? ctx.next(err.cause) : void 0,\n            synthetic: false\n        };\n    }\n    getType(candidate) {\n        return this.isDOMError(candidate) ? 'DOMError' : 'DOMException';\n    }\n    getValue(err) {\n        const name = err.name || (this.isDOMError(err) ? 'DOMError' : 'DOMException');\n        const message = err.message ? `${name}: ${err.message}` : name;\n        return message;\n    }\n    isDOMException(err) {\n        return isBuiltin(err, 'DOMException');\n    }\n    isDOMError(err) {\n        return isBuiltin(err, 'DOMError');\n    }\n}\nexport { DOMExceptionCoercer };\n","import { isBuiltin, isEvent, isPrimitive } from \"../../utils/index.mjs\";\nclass PromiseRejectionEventCoercer {\n    match(err) {\n        return isBuiltin(err, 'PromiseRejectionEvent') || this.isCustomEventWrappingRejection(err);\n    }\n    isCustomEventWrappingRejection(err) {\n        if (!isEvent(err)) return false;\n        try {\n            const detail = err.detail;\n            return null != detail && 'object' == typeof detail && 'reason' in detail;\n        } catch  {\n            return false;\n        }\n    }\n    coerce(err, ctx) {\n        const reason = this.getUnhandledRejectionReason(err);\n        if (isPrimitive(reason)) return {\n            type: 'UnhandledRejection',\n            value: `Non-Error promise rejection captured with value: ${String(reason)}`,\n            stack: ctx.syntheticException?.stack,\n            synthetic: true\n        };\n        return ctx.apply(reason);\n    }\n    getUnhandledRejectionReason(error) {\n        try {\n            if ('reason' in error) return error.reason;\n            if ('detail' in error && null != error.detail && 'object' == typeof error.detail && 'reason' in error.detail) return error.detail.reason;\n        } catch  {}\n        return error;\n    }\n}\nexport { PromiseRejectionEventCoercer };\n","import { isErrorEvent, isString } from \"../../utils/index.mjs\";\nclass ErrorEventCoercer {\n    match(err) {\n        if (!isErrorEvent(err)) return false;\n        const errorEvent = err;\n        return void 0 != errorEvent.error || this._hasUsableMessage(errorEvent);\n    }\n    coerce(err, ctx) {\n        if (void 0 != err.error) return ctx.apply(err.error);\n        const exceptionLike = ctx.apply(err.message);\n        return {\n            ...exceptionLike,\n            stack: this._buildLocationStack(err) ?? exceptionLike.stack,\n            synthetic: true\n        };\n    }\n    _hasUsableMessage(err) {\n        return isString(err.message) && err.message.length > 0;\n    }\n    _buildLocationStack(err) {\n        const location = err;\n        const lineno = location.lineno ?? 0;\n        const colno = location.colno ?? 0;\n        if (!isString(location.filename) || 0 === location.filename.length) return;\n        if (0 === lineno) return;\n        return `Error\\n    at ${location.filename}:${lineno}:${colno}`;\n    }\n}\nexport { ErrorEventCoercer };\n","import { isError } from \"../../utils/type-utils.mjs\";\nclass ErrorCoercer {\n    match(err) {\n        return isError(err);\n    }\n    coerce(err, ctx) {\n        const stack = this.getStack(err);\n        const replacementStack = void 0 === stack ? ctx.syntheticException?.stack : void 0;\n        const synthetic = !!replacementStack;\n        return {\n            type: this.getType(err),\n            value: this.getMessage(err, ctx),\n            stack: stack ?? replacementStack,\n            cause: err.cause ? ctx.next(err.cause) : void 0,\n            synthetic\n        };\n    }\n    getType(err) {\n        return err.name || err.constructor.name;\n    }\n    getMessage(err, _ctx) {\n        const message = err.message;\n        if (message.error && 'string' == typeof message.error.message) return String(message.error.message);\n        return String(message);\n    }\n    getStack(err) {\n        try {\n            const stacktrace = err.stacktrace;\n            if ('string' == typeof stacktrace && stacktrace.length > 0) return stacktrace;\n            const stack = err.stack;\n            return 'string' == typeof stack && stack.length > 0 ? stack : void 0;\n        } catch  {\n            return;\n        }\n    }\n}\nexport { ErrorCoercer };\n","import { isEvent } from \"../../utils/index.mjs\";\nimport { extractExceptionKeysForMessage } from \"./utils.mjs\";\nclass EventCoercer {\n    match(err) {\n        return isEvent(err);\n    }\n    coerce(evt, ctx) {\n        const constructorName = evt.constructor.name;\n        return {\n            type: constructorName,\n            value: `${constructorName} captured as exception with keys: ${extractExceptionKeysForMessage(evt)}`,\n            stack: ctx.syntheticException?.stack,\n            synthetic: true\n        };\n    }\n}\nexport { EventCoercer };\n","import { isEmptyString, isError, isEvent, isString } from \"../../utils/index.mjs\";\nimport { severityLevels } from \"../types.mjs\";\nimport { extractExceptionKeysForMessage } from \"./utils.mjs\";\nclass ObjectCoercer {\n    match(candidate) {\n        return 'object' == typeof candidate && null !== candidate;\n    }\n    coerce(candidate, ctx) {\n        const errorProperty = this.getErrorPropertyFromObject(candidate);\n        if (errorProperty) return ctx.apply(errorProperty);\n        return {\n            type: this.getType(candidate),\n            value: this.getValue(candidate),\n            stack: this.getStack(candidate) ?? ctx.syntheticException?.stack,\n            level: this.isSeverityLevel(candidate.level) ? candidate.level : 'error',\n            synthetic: true\n        };\n    }\n    getType(err) {\n        if (isEvent(err)) return err.constructor.name;\n        const name = 'name' in err ? err.name : void 0;\n        return isString(name) && !isEmptyString(name) ? name : 'Error';\n    }\n    getValue(err) {\n        if ('name' in err && 'string' == typeof err.name) {\n            let message = `'${err.name}' captured as exception`;\n            if ('message' in err && 'string' == typeof err.message) message += ` with message: '${err.message}'`;\n            return message;\n        }\n        if ('message' in err && 'string' == typeof err.message) return err.message;\n        const className = this.getObjectClassName(err);\n        const keys = extractExceptionKeysForMessage(err);\n        return `${className && 'Object' !== className ? `'${className}'` : 'Object'} captured as exception with keys: ${keys}`;\n    }\n    isSeverityLevel(x) {\n        return isString(x) && !isEmptyString(x) && severityLevels.indexOf(x) >= 0;\n    }\n    getStack(candidate) {\n        try {\n            if (isString(candidate.stacktrace) && candidate.stacktrace.length > 0) return candidate.stacktrace;\n            return isString(candidate.stack) && candidate.stack.length > 0 ? candidate.stack : void 0;\n        } catch  {\n            return;\n        }\n    }\n    getErrorPropertyFromObject(obj) {\n        for(const prop in obj)if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n            const value = obj[prop];\n            if (isError(value)) return value;\n        }\n    }\n    getObjectClassName(obj) {\n        try {\n            const prototype = Object.getPrototypeOf(obj);\n            return prototype ? prototype.constructor.name : void 0;\n        } catch (e) {\n            return;\n        }\n    }\n}\nexport { ObjectCoercer };\n","import { isPrimitive } from \"../../utils/index.mjs\";\nclass PrimitiveCoercer {\n    match(candidate) {\n        return isPrimitive(candidate);\n    }\n    coerce(value, ctx) {\n        return {\n            type: 'Error',\n            value: `Primitive value captured as exception: ${String(value)}`,\n            stack: ctx.syntheticException?.stack,\n            synthetic: true\n        };\n    }\n}\nexport { PrimitiveCoercer };\n"],"mappings":"YAAA,MAAMA,EAAM,WAAaC,OAASA,YAAc,EAC1CC,EAAS,WAAaC,WAAaA,WAAaH,EAKhDE,SAAiBA,EAAQE,gBAAuC,IAAIF,EAAOE,eC+UjF,MAAMC,EAAoE,oBAAfF,WAA6BA,WAAaG,EAGjGD,GAAgC,oBAATE,OACtBF,EAAsBE,KAAOF,GAE9BA,GAAgC,oBAATG,OACtBH,EAAsBG,KAAO,WAAa,GAgB/C,MAAaC,EAAqCH,UAAiB,CAAC,EC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