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OA,EAAOt+C,aAChB,KACF,CAzCAi1D,GAAOqD","sources":["../node_modules/@sentry/replay/esm/index.js"],"sourcesContent":["import _asyncToGenerator from \"/home/deploy/dash/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport _inherits from \"/home/deploy/dash/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/inherits.js\";\nimport _createSuper from \"/home/deploy/dash/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/createSuper.js\";\nimport _wrapNativeSuper from \"/home/deploy/dash/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js\";\nimport _objectSpread from \"/home/deploy/dash/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";\nimport _slicedToArray from \"/home/deploy/dash/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport _toConsumableArray from \"/home/deploy/dash/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";\nimport _createForOfIteratorHelper from \"/home/deploy/dash/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js\";\nimport _classCallCheck from \"/home/deploy/dash/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/classCallCheck.js\";\nimport _createClass from \"/home/deploy/dash/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/createClass.js\";\nimport _regeneratorRuntime from \"/home/deploy/dash/node_modules/babel-preset-react-app/node_modules/@babel/runtime/regenerator/index.js\";\nimport { getCurrentHub, isSentryRequestUrl, addGlobalEventProcessor, prepareEvent, setContext, captureException } from '@sentry/core';\nimport { GLOBAL_OBJ, normalize, fill, htmlTreeAsString, browserPerformanceTimeOrigin, logger, uuid4, SENTRY_XHR_DATA_KEY, dropUndefinedKeys, stringMatchesSomePattern, addInstrumentationHandler, createEnvelope, createEventEnvelopeHeaders, getSdkMetadataForEnvelopeHeader, isBrowser } from '@sentry/utils';\nimport { addPerformanceInstrumentationHandler, addLcpInstrumentationHandler } from '@sentry-internal/tracing'; // exporting a separate copy of `WINDOW` rather than exporting the one from `@sentry/browser`\n// prevents the browser package from being bundled in the CDN bundle, and avoids a\n// circular dependency between the browser and replay packages should `@sentry/browser` import\n// from `@sentry/replay` in the future\n\nvar WINDOW = GLOBAL_OBJ;\nvar REPLAY_SESSION_KEY = 'sentryReplaySession';\nvar REPLAY_EVENT_NAME = 'replay_event';\nvar UNABLE_TO_SEND_REPLAY = 'Unable to send Replay'; // The idle limit for a session after which recording is paused.\n\nvar SESSION_IDLE_PAUSE_DURATION = 300000; // 5 minutes in ms\n// The idle limit for a session after which the session expires.\n\nvar SESSION_IDLE_EXPIRE_DURATION = 900000; // 15 minutes in ms\n\n/** Default flush delays */\n\nvar DEFAULT_FLUSH_MIN_DELAY = 5000; // XXX: Temp fix for our debounce logic where `maxWait` would never occur if it\n// was the same as `wait`\n\nvar DEFAULT_FLUSH_MAX_DELAY = 5500;\n/* How long to wait for error checkouts */\n\nvar BUFFER_CHECKOUT_TIME = 60000;\nvar RETRY_BASE_INTERVAL = 5000;\nvar RETRY_MAX_COUNT = 3;\n/* The max (uncompressed) size in bytes of a network body. Any body larger than this will be truncated. */\n\nvar NETWORK_BODY_MAX_SIZE = 150000;\n/* The max size of a single console arg that is captured. Any arg larger than this will be truncated. */\n\nvar CONSOLE_ARG_MAX_SIZE = 5000;\n/* Min. time to wait before we consider something a slow click. */\n\nvar SLOW_CLICK_THRESHOLD = 3000;\n/* For scroll actions after a click, we only look for a very short time period to detect programmatic scrolling. */\n\nvar SLOW_CLICK_SCROLL_TIMEOUT = 300;\n/** When encountering a total segment size exceeding this size, stop the replay (as we cannot properly ingest it). */\n\nvar REPLAY_MAX_EVENT_BUFFER_SIZE = 20000000; // ~20MB\n\n/** Replays must be min. 5s long before we send them. */\n\nvar MIN_REPLAY_DURATION = 4999;\n/* The max. allowed value that the minReplayDuration can be set to. */\n\nvar MIN_REPLAY_DURATION_LIMIT = 15000;\n/** The max. length of a replay. */\n\nvar MAX_REPLAY_DURATION = 3600000; // 60 minutes in ms;\n\nvar NodeType$1;\n\n(function (NodeType) {\n NodeType[NodeType[\"Document\"] = 0] = \"Document\";\n NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\n NodeType[NodeType[\"Element\"] = 2] = \"Element\";\n NodeType[NodeType[\"Text\"] = 3] = \"Text\";\n NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\n NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\n})(NodeType$1 || (NodeType$1 = {}));\n\nfunction isElement$1(n) {\n return n.nodeType === n.ELEMENT_NODE;\n}\n\nfunction isShadowRoot(n) {\n var host = n === null || n === void 0 ? void 0 : n.host;\n return Boolean((host === null || host === void 0 ? void 0 : host.shadowRoot) === n);\n}\n\nfunction isNativeShadowDom(shadowRoot) {\n return Object.prototype.toString.call(shadowRoot) === '[object ShadowRoot]';\n}\n\nfunction fixBrowserCompatibilityIssuesInCSS(cssText) {\n if (cssText.includes(' background-clip: text;') && !cssText.includes(' -webkit-background-clip: text;')) {\n cssText = cssText.replace(' background-clip: text;', ' -webkit-background-clip: text; background-clip: text;');\n }\n\n return cssText;\n}\n\nfunction escapeImportStatement(rule) {\n var cssText = rule.cssText;\n if (cssText.split('\"').length < 3) return cssText;\n var statement = ['@import', \"url(\".concat(JSON.stringify(rule.href), \")\")];\n\n if (rule.layerName === '') {\n statement.push(\"layer\");\n } else if (rule.layerName) {\n statement.push(\"layer(\".concat(rule.layerName, \")\"));\n }\n\n if (rule.supportsText) {\n statement.push(\"supports(\".concat(rule.supportsText, \")\"));\n }\n\n if (rule.media.length) {\n statement.push(rule.media.mediaText);\n }\n\n return statement.join(' ') + ';';\n}\n\nfunction stringifyStylesheet(s) {\n try {\n var rules = s.rules || s.cssRules;\n return rules ? fixBrowserCompatibilityIssuesInCSS(Array.from(rules, stringifyRule).join('')) : null;\n } catch (error) {\n return null;\n }\n}\n\nfunction stringifyRule(rule) {\n var importStringified;\n\n if (isCSSImportRule(rule)) {\n try {\n importStringified = stringifyStylesheet(rule.styleSheet) || escapeImportStatement(rule);\n } catch (error) {}\n } else if (isCSSStyleRule(rule) && rule.selectorText.includes(':')) {\n return fixSafariColons(rule.cssText);\n }\n\n return importStringified || rule.cssText;\n}\n\nfunction fixSafariColons(cssStringified) {\n var regex = /(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm;\n return cssStringified.replace(regex, '$1\\\\$2');\n}\n\nfunction isCSSImportRule(rule) {\n return 'styleSheet' in rule;\n}\n\nfunction isCSSStyleRule(rule) {\n return 'selectorText' in rule;\n}\n\nvar Mirror = /*#__PURE__*/function () {\n function Mirror() {\n _classCallCheck(this, Mirror);\n\n this.idNodeMap = new Map();\n this.nodeMetaMap = new WeakMap();\n }\n\n _createClass(Mirror, [{\n key: \"getId\",\n value: function getId(n) {\n var _a;\n\n if (!n) return -1;\n var id = (_a = this.getMeta(n)) === null || _a === void 0 ? void 0 : _a.id;\n return id !== null && id !== void 0 ? id : -1;\n }\n }, {\n key: \"getNode\",\n value: function getNode(id) {\n return this.idNodeMap.get(id) || null;\n }\n }, {\n key: \"getIds\",\n value: function getIds() {\n return Array.from(this.idNodeMap.keys());\n }\n }, {\n key: \"getMeta\",\n value: function getMeta(n) {\n return this.nodeMetaMap.get(n) || null;\n }\n }, {\n key: \"removeNodeFromMap\",\n value: function removeNodeFromMap(n) {\n var _this = this;\n\n var id = this.getId(n);\n this.idNodeMap.delete(id);\n\n if (n.childNodes) {\n n.childNodes.forEach(function (childNode) {\n return _this.removeNodeFromMap(childNode);\n });\n }\n }\n }, {\n key: \"has\",\n value: function has(id) {\n return this.idNodeMap.has(id);\n }\n }, {\n key: \"hasNode\",\n value: function hasNode(node) {\n return this.nodeMetaMap.has(node);\n }\n }, {\n key: \"add\",\n value: function add(n, meta) {\n var id = meta.id;\n this.idNodeMap.set(id, n);\n this.nodeMetaMap.set(n, meta);\n }\n }, {\n key: \"replace\",\n value: function replace(id, n) {\n var oldNode = this.getNode(id);\n\n if (oldNode) {\n var meta = this.nodeMetaMap.get(oldNode);\n if (meta) this.nodeMetaMap.set(n, meta);\n }\n\n this.idNodeMap.set(id, n);\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this.idNodeMap = new Map();\n this.nodeMetaMap = new WeakMap();\n }\n }]);\n\n return Mirror;\n}();\n\nfunction createMirror() {\n return new Mirror();\n}\n\nfunction shouldMaskInput(_ref) {\n var maskInputOptions = _ref.maskInputOptions,\n tagName = _ref.tagName,\n type = _ref.type;\n\n if (tagName === 'OPTION') {\n tagName = 'SELECT';\n }\n\n return Boolean(maskInputOptions[tagName.toLowerCase()] || type && maskInputOptions[type] || type === 'password' || tagName === 'INPUT' && !type && maskInputOptions['text']);\n}\n\nfunction maskInputValue(_ref2) {\n var isMasked = _ref2.isMasked,\n element = _ref2.element,\n value = _ref2.value,\n maskInputFn = _ref2.maskInputFn;\n var text = value || '';\n\n if (!isMasked) {\n return text;\n }\n\n if (maskInputFn) {\n text = maskInputFn(text, element);\n }\n\n return '*'.repeat(text.length);\n}\n\nfunction toLowerCase(str) {\n return str.toLowerCase();\n}\n\nfunction toUpperCase(str) {\n return str.toUpperCase();\n}\n\nvar ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';\n\nfunction is2DCanvasBlank(canvas) {\n var ctx = canvas.getContext('2d');\n if (!ctx) return true;\n var chunkSize = 50;\n\n for (var x = 0; x < canvas.width; x += chunkSize) {\n for (var y = 0; y < canvas.height; y += chunkSize) {\n var getImageData = ctx.getImageData;\n var originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData ? getImageData[ORIGINAL_ATTRIBUTE_NAME] : getImageData;\n var pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer);\n if (pixelBuffer.some(function (pixel) {\n return pixel !== 0;\n })) return false;\n }\n }\n\n return true;\n}\n\nfunction getInputType(element) {\n var type = element.type;\n return element.hasAttribute('data-rr-is-password') ? 'password' : type ? toLowerCase(type) : null;\n}\n\nfunction getInputValue(el, tagName, type) {\n if (tagName === 'INPUT' && (type === 'radio' || type === 'checkbox')) {\n return el.getAttribute('value') || '';\n }\n\n return el.value;\n}\n\nvar _id = 1;\nvar tagNameRegex = new RegExp('[^a-z0-9-_:]');\nvar IGNORED_NODE = -2;\n\nfunction genId() {\n return _id++;\n}\n\nfunction getValidTagName(element) {\n if (element instanceof HTMLFormElement) {\n return 'form';\n }\n\n var processedTagName = toLowerCase(element.tagName);\n\n if (tagNameRegex.test(processedTagName)) {\n return 'div';\n }\n\n return processedTagName;\n}\n\nfunction extractOrigin(url) {\n var origin = '';\n\n if (url.indexOf('//') > -1) {\n origin = url.split('/').slice(0, 3).join('/');\n } else {\n origin = url.split('/')[0];\n }\n\n origin = origin.split('?')[0];\n return origin;\n}\n\nvar canvasService;\nvar canvasCtx;\nvar URL_IN_CSS_REF = /url\\((?:(')([^']*)'|(\")(.*?)\"|([^)]*))\\)/gm;\nvar URL_PROTOCOL_MATCH = /^(?:[a-z+]+:)?\\/\\//i;\nvar URL_WWW_MATCH = /^www\\..*/i;\nvar DATA_URI = /^(data:)([^,]*),(.*)/i;\n\nfunction absoluteToStylesheet(cssText, href) {\n return (cssText || '').replace(URL_IN_CSS_REF, function (origin, quote1, path1, quote2, path2, path3) {\n var filePath = path1 || path2 || path3;\n var maybeQuote = quote1 || quote2 || '';\n\n if (!filePath) {\n return origin;\n }\n\n if (URL_PROTOCOL_MATCH.test(filePath) || URL_WWW_MATCH.test(filePath)) {\n return \"url(\".concat(maybeQuote).concat(filePath).concat(maybeQuote, \")\");\n }\n\n if (DATA_URI.test(filePath)) {\n return \"url(\".concat(maybeQuote).concat(filePath).concat(maybeQuote, \")\");\n }\n\n if (filePath[0] === '/') {\n return \"url(\".concat(maybeQuote).concat(extractOrigin(href) + filePath).concat(maybeQuote, \")\");\n }\n\n var stack = href.split('/');\n var parts = filePath.split('/');\n stack.pop();\n\n var _iterator = _createForOfIteratorHelper(parts),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var part = _step.value;\n\n if (part === '.') {\n continue;\n } else if (part === '..') {\n stack.pop();\n } else {\n stack.push(part);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return \"url(\".concat(maybeQuote).concat(stack.join('/')).concat(maybeQuote, \")\");\n });\n}\n\nvar SRCSET_NOT_SPACES = /^[^ \\t\\n\\r\\u000c]+/;\nvar SRCSET_COMMAS_OR_SPACES = /^[, \\t\\n\\r\\u000c]+/;\n\nfunction getAbsoluteSrcsetString(doc, attributeValue) {\n if (attributeValue.trim() === '') {\n return attributeValue;\n }\n\n var pos = 0;\n\n function collectCharacters(regEx) {\n var chars;\n var match = regEx.exec(attributeValue.substring(pos));\n\n if (match) {\n chars = match[0];\n pos += chars.length;\n return chars;\n }\n\n return '';\n }\n\n var output = [];\n\n while (true) {\n collectCharacters(SRCSET_COMMAS_OR_SPACES);\n\n if (pos >= attributeValue.length) {\n break;\n }\n\n var url = collectCharacters(SRCSET_NOT_SPACES);\n\n if (url.slice(-1) === ',') {\n url = absoluteToDoc(doc, url.substring(0, url.length - 1));\n output.push(url);\n } else {\n var descriptorsStr = '';\n url = absoluteToDoc(doc, url);\n var inParens = false;\n\n while (true) {\n var c = attributeValue.charAt(pos);\n\n if (c === '') {\n output.push((url + descriptorsStr).trim());\n break;\n } else if (!inParens) {\n if (c === ',') {\n pos += 1;\n output.push((url + descriptorsStr).trim());\n break;\n } else if (c === '(') {\n inParens = true;\n }\n } else {\n if (c === ')') {\n inParens = false;\n }\n }\n\n descriptorsStr += c;\n pos += 1;\n }\n }\n }\n\n return output.join(', ');\n}\n\nfunction absoluteToDoc(doc, attributeValue) {\n if (!attributeValue || attributeValue.trim() === '') {\n return attributeValue;\n }\n\n var a = doc.createElement('a');\n a.href = attributeValue;\n return a.href;\n}\n\nfunction isSVGElement(el) {\n return Boolean(el.tagName === 'svg' || el.ownerSVGElement);\n}\n\nfunction getHref() {\n var a = document.createElement('a');\n a.href = '';\n return a.href;\n}\n\nfunction transformAttribute(doc, tagName, name, value, element, maskAttributeFn) {\n if (!value) {\n return value;\n }\n\n if (name === 'src' || name === 'href' && !(tagName === 'use' && value[0] === '#')) {\n return absoluteToDoc(doc, value);\n } else if (name === 'xlink:href' && value[0] !== '#') {\n return absoluteToDoc(doc, value);\n } else if (name === 'background' && (tagName === 'table' || tagName === 'td' || tagName === 'th')) {\n return absoluteToDoc(doc, value);\n } else if (name === 'srcset') {\n return getAbsoluteSrcsetString(doc, value);\n } else if (name === 'style') {\n return absoluteToStylesheet(value, getHref());\n } else if (tagName === 'object' && name === 'data') {\n return absoluteToDoc(doc, value);\n }\n\n if (typeof maskAttributeFn === 'function') {\n return maskAttributeFn(name, value, element);\n }\n\n return value;\n}\n\nfunction ignoreAttribute(tagName, name, _value) {\n return (tagName === 'video' || tagName === 'audio') && name === 'autoplay';\n}\n\nfunction _isBlockedElement(element, blockClass, blockSelector, unblockSelector) {\n try {\n if (unblockSelector && element.matches(unblockSelector)) {\n return false;\n }\n\n if (typeof blockClass === 'string') {\n if (element.classList.contains(blockClass)) {\n return true;\n }\n } else {\n for (var eIndex = element.classList.length; eIndex--;) {\n var className = element.classList[eIndex];\n\n if (blockClass.test(className)) {\n return true;\n }\n }\n }\n\n if (blockSelector) {\n return element.matches(blockSelector);\n }\n } catch (e) {}\n\n return false;\n}\n\nfunction elementClassMatchesRegex(el, regex) {\n for (var eIndex = el.classList.length; eIndex--;) {\n var className = el.classList[eIndex];\n\n if (regex.test(className)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction distanceToMatch(node, matchPredicate) {\n var limit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity;\n var distance = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n if (!node) return -1;\n if (node.nodeType !== node.ELEMENT_NODE) return -1;\n if (distance > limit) return -1;\n if (matchPredicate(node)) return distance;\n return distanceToMatch(node.parentNode, matchPredicate, limit, distance + 1);\n}\n\nfunction createMatchPredicate(className, selector) {\n return function (node) {\n var el = node;\n if (el === null) return false;\n\n if (className) {\n if (typeof className === 'string') {\n if (el.matches(\".\".concat(className))) return true;\n } else if (elementClassMatchesRegex(el, className)) {\n return true;\n }\n }\n\n if (selector && el.matches(selector)) return true;\n return false;\n };\n}\n\nfunction needMaskingText(node, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText) {\n try {\n var el = node.nodeType === node.ELEMENT_NODE ? node : node.parentElement;\n if (el === null) return false;\n var maskDistance = -1;\n var unmaskDistance = -1;\n\n if (maskAllText) {\n unmaskDistance = distanceToMatch(el, createMatchPredicate(unmaskTextClass, unmaskTextSelector));\n\n if (unmaskDistance < 0) {\n return true;\n }\n\n maskDistance = distanceToMatch(el, createMatchPredicate(maskTextClass, maskTextSelector), unmaskDistance >= 0 ? unmaskDistance : Infinity);\n } else {\n maskDistance = distanceToMatch(el, createMatchPredicate(maskTextClass, maskTextSelector));\n\n if (maskDistance < 0) {\n return false;\n }\n\n unmaskDistance = distanceToMatch(el, createMatchPredicate(unmaskTextClass, unmaskTextSelector), maskDistance >= 0 ? maskDistance : Infinity);\n }\n\n return maskDistance >= 0 ? unmaskDistance >= 0 ? maskDistance <= unmaskDistance : true : unmaskDistance >= 0 ? false : !!maskAllText;\n } catch (e) {}\n\n return !!maskAllText;\n}\n\nfunction onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {\n var win = iframeEl.contentWindow;\n\n if (!win) {\n return;\n }\n\n var fired = false;\n var readyState;\n\n try {\n readyState = win.document.readyState;\n } catch (error) {\n return;\n }\n\n if (readyState !== 'complete') {\n var timer = setTimeout(function () {\n if (!fired) {\n listener();\n fired = true;\n }\n }, iframeLoadTimeout);\n iframeEl.addEventListener('load', function () {\n clearTimeout(timer);\n fired = true;\n listener();\n });\n return;\n }\n\n var blankUrl = 'about:blank';\n\n if (win.location.href !== blankUrl || iframeEl.src === blankUrl || iframeEl.src === '') {\n setTimeout(listener, 0);\n return iframeEl.addEventListener('load', listener);\n }\n\n iframeEl.addEventListener('load', listener);\n}\n\nfunction onceStylesheetLoaded(link, listener, styleSheetLoadTimeout) {\n var fired = false;\n var styleSheetLoaded;\n\n try {\n styleSheetLoaded = link.sheet;\n } catch (error) {\n return;\n }\n\n if (styleSheetLoaded) return;\n var timer = setTimeout(function () {\n if (!fired) {\n listener();\n fired = true;\n }\n }, styleSheetLoadTimeout);\n link.addEventListener('load', function () {\n clearTimeout(timer);\n fired = true;\n listener();\n });\n}\n\nfunction serializeNode(n, options) {\n var doc = options.doc,\n mirror = options.mirror,\n blockClass = options.blockClass,\n blockSelector = options.blockSelector,\n unblockSelector = options.unblockSelector,\n maskAllText = options.maskAllText,\n maskAttributeFn = options.maskAttributeFn,\n maskTextClass = options.maskTextClass,\n unmaskTextClass = options.unmaskTextClass,\n maskTextSelector = options.maskTextSelector,\n unmaskTextSelector = options.unmaskTextSelector,\n inlineStylesheet = options.inlineStylesheet,\n _options$maskInputOpt = options.maskInputOptions,\n maskInputOptions = _options$maskInputOpt === void 0 ? {} : _options$maskInputOpt,\n maskTextFn = options.maskTextFn,\n maskInputFn = options.maskInputFn,\n _options$dataURLOptio = options.dataURLOptions,\n dataURLOptions = _options$dataURLOptio === void 0 ? {} : _options$dataURLOptio,\n inlineImages = options.inlineImages,\n recordCanvas = options.recordCanvas,\n keepIframeSrcFn = options.keepIframeSrcFn,\n _options$newlyAddedEl = options.newlyAddedElement,\n newlyAddedElement = _options$newlyAddedEl === void 0 ? false : _options$newlyAddedEl;\n var rootId = getRootId(doc, mirror);\n\n switch (n.nodeType) {\n case n.DOCUMENT_NODE:\n if (n.compatMode !== 'CSS1Compat') {\n return {\n type: NodeType$1.Document,\n childNodes: [],\n compatMode: n.compatMode\n };\n } else {\n return {\n type: NodeType$1.Document,\n childNodes: []\n };\n }\n\n case n.DOCUMENT_TYPE_NODE:\n return {\n type: NodeType$1.DocumentType,\n name: n.name,\n publicId: n.publicId,\n systemId: n.systemId,\n rootId: rootId\n };\n\n case n.ELEMENT_NODE:\n return serializeElementNode(n, {\n doc: doc,\n blockClass: blockClass,\n blockSelector: blockSelector,\n unblockSelector: unblockSelector,\n inlineStylesheet: inlineStylesheet,\n maskAttributeFn: maskAttributeFn,\n maskInputOptions: maskInputOptions,\n maskInputFn: maskInputFn,\n dataURLOptions: dataURLOptions,\n inlineImages: inlineImages,\n recordCanvas: recordCanvas,\n keepIframeSrcFn: keepIframeSrcFn,\n newlyAddedElement: newlyAddedElement,\n rootId: rootId,\n maskAllText: maskAllText,\n maskTextClass: maskTextClass,\n unmaskTextClass: unmaskTextClass,\n maskTextSelector: maskTextSelector,\n unmaskTextSelector: unmaskTextSelector\n });\n\n case n.TEXT_NODE:\n return serializeTextNode(n, {\n maskAllText: maskAllText,\n maskTextClass: maskTextClass,\n unmaskTextClass: unmaskTextClass,\n maskTextSelector: maskTextSelector,\n unmaskTextSelector: unmaskTextSelector,\n maskTextFn: maskTextFn,\n maskInputOptions: maskInputOptions,\n maskInputFn: maskInputFn,\n rootId: rootId\n });\n\n case n.CDATA_SECTION_NODE:\n return {\n type: NodeType$1.CDATA,\n textContent: '',\n rootId: rootId\n };\n\n case n.COMMENT_NODE:\n return {\n type: NodeType$1.Comment,\n textContent: n.textContent || '',\n rootId: rootId\n };\n\n default:\n return false;\n }\n}\n\nfunction getRootId(doc, mirror) {\n if (!mirror.hasNode(doc)) return undefined;\n var docId = mirror.getId(doc);\n return docId === 1 ? undefined : docId;\n}\n\nfunction serializeTextNode(n, options) {\n var _a;\n\n var maskAllText = options.maskAllText,\n maskTextClass = options.maskTextClass,\n unmaskTextClass = options.unmaskTextClass,\n maskTextSelector = options.maskTextSelector,\n unmaskTextSelector = options.unmaskTextSelector,\n maskTextFn = options.maskTextFn,\n maskInputOptions = options.maskInputOptions,\n maskInputFn = options.maskInputFn,\n rootId = options.rootId;\n var parentTagName = n.parentNode && n.parentNode.tagName;\n var textContent = n.textContent;\n var isStyle = parentTagName === 'STYLE' ? true : undefined;\n var isScript = parentTagName === 'SCRIPT' ? true : undefined;\n var isTextarea = parentTagName === 'TEXTAREA' ? true : undefined;\n\n if (isStyle && textContent) {\n try {\n if (n.nextSibling || n.previousSibling) {} else if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {\n textContent = stringifyStylesheet(n.parentNode.sheet);\n }\n } catch (err) {\n console.warn(\"Cannot get CSS styles from text's parentNode. Error: \".concat(err), n);\n }\n\n textContent = absoluteToStylesheet(textContent, getHref());\n }\n\n if (isScript) {\n textContent = 'SCRIPT_PLACEHOLDER';\n }\n\n var forceMask = needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText);\n\n if (!isStyle && !isScript && !isTextarea && textContent && forceMask) {\n textContent = maskTextFn ? maskTextFn(textContent) : textContent.replace(/[\\S]/g, '*');\n }\n\n if (isTextarea && textContent && (maskInputOptions.textarea || forceMask)) {\n textContent = maskInputFn ? maskInputFn(textContent, n.parentNode) : textContent.replace(/[\\S]/g, '*');\n }\n\n if (parentTagName === 'OPTION' && textContent) {\n var isInputMasked = shouldMaskInput({\n type: null,\n tagName: parentTagName,\n maskInputOptions: maskInputOptions\n });\n textContent = maskInputValue({\n isMasked: needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, isInputMasked),\n element: n,\n value: textContent,\n maskInputFn: maskInputFn\n });\n }\n\n return {\n type: NodeType$1.Text,\n textContent: textContent || '',\n isStyle: isStyle,\n rootId: rootId\n };\n}\n\nfunction serializeElementNode(n, options) {\n var doc = options.doc,\n blockClass = options.blockClass,\n blockSelector = options.blockSelector,\n unblockSelector = options.unblockSelector,\n inlineStylesheet = options.inlineStylesheet,\n _options$maskInputOpt2 = options.maskInputOptions,\n maskInputOptions = _options$maskInputOpt2 === void 0 ? {} : _options$maskInputOpt2,\n maskAttributeFn = options.maskAttributeFn,\n maskInputFn = options.maskInputFn,\n _options$dataURLOptio2 = options.dataURLOptions,\n dataURLOptions = _options$dataURLOptio2 === void 0 ? {} : _options$dataURLOptio2,\n inlineImages = options.inlineImages,\n recordCanvas = options.recordCanvas,\n keepIframeSrcFn = options.keepIframeSrcFn,\n _options$newlyAddedEl2 = options.newlyAddedElement,\n newlyAddedElement = _options$newlyAddedEl2 === void 0 ? false : _options$newlyAddedEl2,\n rootId = options.rootId,\n maskAllText = options.maskAllText,\n maskTextClass = options.maskTextClass,\n unmaskTextClass = options.unmaskTextClass,\n maskTextSelector = options.maskTextSelector,\n unmaskTextSelector = options.unmaskTextSelector;\n\n var needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector);\n\n var tagName = getValidTagName(n);\n var attributes = {};\n var len = n.attributes.length;\n\n for (var _i = 0; _i < len; _i++) {\n var attr = n.attributes[_i];\n\n if (!ignoreAttribute(tagName, attr.name, attr.value)) {\n attributes[attr.name] = transformAttribute(doc, tagName, toLowerCase(attr.name), attr.value, n, maskAttributeFn);\n }\n }\n\n if (tagName === 'link' && inlineStylesheet) {\n var stylesheet = Array.from(doc.styleSheets).find(function (s) {\n return s.href === n.href;\n });\n var cssText = null;\n\n if (stylesheet) {\n cssText = stringifyStylesheet(stylesheet);\n }\n\n if (cssText) {\n delete attributes.rel;\n delete attributes.href;\n attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);\n }\n }\n\n if (tagName === 'style' && n.sheet && !(n.innerText || n.textContent || '').trim().length) {\n var _cssText = stringifyStylesheet(n.sheet);\n\n if (_cssText) {\n attributes._cssText = absoluteToStylesheet(_cssText, getHref());\n }\n }\n\n if (tagName === 'input' || tagName === 'textarea' || tagName === 'select' || tagName === 'option') {\n var el = n;\n var type = getInputType(el);\n var value = getInputValue(el, toUpperCase(tagName), type);\n var checked = el.checked;\n\n if (type !== 'submit' && type !== 'button' && value) {\n var forceMask = needMaskingText(el, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, shouldMaskInput({\n type: type,\n tagName: toUpperCase(tagName),\n maskInputOptions: maskInputOptions\n }));\n attributes.value = maskInputValue({\n isMasked: forceMask,\n element: el,\n value: value,\n maskInputFn: maskInputFn\n });\n }\n\n if (checked) {\n attributes.checked = checked;\n }\n }\n\n if (tagName === 'option') {\n if (n.selected && !maskInputOptions['select']) {\n attributes.selected = true;\n } else {\n delete attributes.selected;\n }\n }\n\n if (tagName === 'canvas' && recordCanvas) {\n if (n.__context === '2d') {\n if (!is2DCanvasBlank(n)) {\n attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n }\n } else if (!('__context' in n)) {\n var canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n var blankCanvas = document.createElement('canvas');\n blankCanvas.width = n.width;\n blankCanvas.height = n.height;\n var blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n\n if (canvasDataURL !== blankCanvasDataURL) {\n attributes.rr_dataURL = canvasDataURL;\n }\n }\n }\n\n if (tagName === 'img' && inlineImages) {\n if (!canvasService) {\n canvasService = doc.createElement('canvas');\n canvasCtx = canvasService.getContext('2d');\n }\n\n var image = n;\n var oldValue = image.crossOrigin;\n image.crossOrigin = 'anonymous';\n\n var recordInlineImage = function recordInlineImage() {\n image.removeEventListener('load', recordInlineImage);\n\n try {\n canvasService.width = image.naturalWidth;\n canvasService.height = image.naturalHeight;\n canvasCtx.drawImage(image, 0, 0);\n attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n } catch (err) {\n console.warn(\"Cannot inline img src=\".concat(image.currentSrc, \"! Error: \").concat(err));\n }\n\n oldValue ? attributes.crossOrigin = oldValue : image.removeAttribute('crossorigin');\n };\n\n if (image.complete && image.naturalWidth !== 0) recordInlineImage();else image.addEventListener('load', recordInlineImage);\n }\n\n if (tagName === 'audio' || tagName === 'video') {\n attributes.rr_mediaState = n.paused ? 'paused' : 'played';\n attributes.rr_mediaCurrentTime = n.currentTime;\n }\n\n if (!newlyAddedElement) {\n if (n.scrollLeft) {\n attributes.rr_scrollLeft = n.scrollLeft;\n }\n\n if (n.scrollTop) {\n attributes.rr_scrollTop = n.scrollTop;\n }\n }\n\n if (needBlock) {\n var _n$getBoundingClientR = n.getBoundingClientRect(),\n width = _n$getBoundingClientR.width,\n height = _n$getBoundingClientR.height;\n\n attributes = {\n class: attributes.class,\n rr_width: \"\".concat(width, \"px\"),\n rr_height: \"\".concat(height, \"px\")\n };\n }\n\n if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {\n if (!n.contentDocument) {\n attributes.rr_src = attributes.src;\n }\n\n delete attributes.src;\n }\n\n var isCustomElement;\n\n try {\n if (customElements.get(tagName)) isCustomElement = true;\n } catch (e) {}\n\n return {\n type: NodeType$1.Element,\n tagName: tagName,\n attributes: attributes,\n childNodes: [],\n isSVG: isSVGElement(n) || undefined,\n needBlock: needBlock,\n rootId: rootId,\n isCustom: isCustomElement\n };\n}\n\nfunction lowerIfExists(maybeAttr) {\n if (maybeAttr === undefined || maybeAttr === null) {\n return '';\n } else {\n return maybeAttr.toLowerCase();\n }\n}\n\nfunction slimDOMExcluded(sn, slimDOMOptions) {\n if (slimDOMOptions.comment && sn.type === NodeType$1.Comment) {\n return true;\n } else if (sn.type === NodeType$1.Element) {\n if (slimDOMOptions.script && (sn.tagName === 'script' || sn.tagName === 'link' && (sn.attributes.rel === 'preload' || sn.attributes.rel === 'modulepreload') && sn.attributes.as === 'script' || sn.tagName === 'link' && sn.attributes.rel === 'prefetch' && typeof sn.attributes.href === 'string' && sn.attributes.href.endsWith('.js'))) {\n return true;\n } else if (slimDOMOptions.headFavicon && (sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon' || sn.tagName === 'meta' && (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) || lowerIfExists(sn.attributes.name) === 'application-name' || lowerIfExists(sn.attributes.rel) === 'icon' || lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' || lowerIfExists(sn.attributes.rel) === 'shortcut icon'))) {\n return true;\n } else if (sn.tagName === 'meta') {\n if (slimDOMOptions.headMetaDescKeywords && lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {\n return true;\n } else if (slimDOMOptions.headMetaSocial && (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) || lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) || lowerIfExists(sn.attributes.name) === 'pinterest')) {\n return true;\n } else if (slimDOMOptions.headMetaRobots && (lowerIfExists(sn.attributes.name) === 'robots' || lowerIfExists(sn.attributes.name) === 'googlebot' || lowerIfExists(sn.attributes.name) === 'bingbot')) {\n return true;\n } else if (slimDOMOptions.headMetaHttpEquiv && sn.attributes['http-equiv'] !== undefined) {\n return true;\n } else if (slimDOMOptions.headMetaAuthorship && (lowerIfExists(sn.attributes.name) === 'author' || lowerIfExists(sn.attributes.name) === 'generator' || lowerIfExists(sn.attributes.name) === 'framework' || lowerIfExists(sn.attributes.name) === 'publisher' || lowerIfExists(sn.attributes.name) === 'progid' || lowerIfExists(sn.attributes.property).match(/^article:/) || lowerIfExists(sn.attributes.property).match(/^product:/))) {\n return true;\n } else if (slimDOMOptions.headMetaVerification && (lowerIfExists(sn.attributes.name) === 'google-site-verification' || lowerIfExists(sn.attributes.name) === 'yandex-verification' || lowerIfExists(sn.attributes.name) === 'csrf-token' || lowerIfExists(sn.attributes.name) === 'p:domain_verify' || lowerIfExists(sn.attributes.name) === 'verify-v1' || lowerIfExists(sn.attributes.name) === 'verification' || lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {\n return true;\n }\n }\n }\n\n return false;\n}\n\nfunction serializeNodeWithId(n, options) {\n var doc = options.doc,\n mirror = options.mirror,\n blockClass = options.blockClass,\n blockSelector = options.blockSelector,\n unblockSelector = options.unblockSelector,\n maskAllText = options.maskAllText,\n maskTextClass = options.maskTextClass,\n unmaskTextClass = options.unmaskTextClass,\n maskTextSelector = options.maskTextSelector,\n unmaskTextSelector = options.unmaskTextSelector,\n _options$skipChild = options.skipChild,\n skipChild = _options$skipChild === void 0 ? false : _options$skipChild,\n _options$inlineStyles = options.inlineStylesheet,\n inlineStylesheet = _options$inlineStyles === void 0 ? true : _options$inlineStyles,\n _options$maskInputOpt3 = options.maskInputOptions,\n maskInputOptions = _options$maskInputOpt3 === void 0 ? {} : _options$maskInputOpt3,\n maskAttributeFn = options.maskAttributeFn,\n maskTextFn = options.maskTextFn,\n maskInputFn = options.maskInputFn,\n slimDOMOptions = options.slimDOMOptions,\n _options$dataURLOptio3 = options.dataURLOptions,\n dataURLOptions = _options$dataURLOptio3 === void 0 ? {} : _options$dataURLOptio3,\n _options$inlineImages = options.inlineImages,\n inlineImages = _options$inlineImages === void 0 ? false : _options$inlineImages,\n _options$recordCanvas = options.recordCanvas,\n recordCanvas = _options$recordCanvas === void 0 ? false : _options$recordCanvas,\n onSerialize = options.onSerialize,\n onIframeLoad = options.onIframeLoad,\n _options$iframeLoadTi = options.iframeLoadTimeout,\n iframeLoadTimeout = _options$iframeLoadTi === void 0 ? 5000 : _options$iframeLoadTi,\n onStylesheetLoad = options.onStylesheetLoad,\n _options$stylesheetLo = options.stylesheetLoadTimeout,\n stylesheetLoadTimeout = _options$stylesheetLo === void 0 ? 5000 : _options$stylesheetLo,\n _options$keepIframeSr = options.keepIframeSrcFn,\n keepIframeSrcFn = _options$keepIframeSr === void 0 ? function () {\n return false;\n } : _options$keepIframeSr,\n _options$newlyAddedEl3 = options.newlyAddedElement,\n newlyAddedElement = _options$newlyAddedEl3 === void 0 ? false : _options$newlyAddedEl3;\n var _options$preserveWhit = options.preserveWhiteSpace,\n preserveWhiteSpace = _options$preserveWhit === void 0 ? true : _options$preserveWhit;\n\n var _serializedNode = serializeNode(n, {\n doc: doc,\n mirror: mirror,\n blockClass: blockClass,\n blockSelector: blockSelector,\n maskAllText: maskAllText,\n unblockSelector: unblockSelector,\n maskTextClass: maskTextClass,\n unmaskTextClass: unmaskTextClass,\n maskTextSelector: maskTextSelector,\n unmaskTextSelector: unmaskTextSelector,\n inlineStylesheet: inlineStylesheet,\n maskInputOptions: maskInputOptions,\n maskAttributeFn: maskAttributeFn,\n maskTextFn: maskTextFn,\n maskInputFn: maskInputFn,\n dataURLOptions: dataURLOptions,\n inlineImages: inlineImages,\n recordCanvas: recordCanvas,\n keepIframeSrcFn: keepIframeSrcFn,\n newlyAddedElement: newlyAddedElement\n });\n\n if (!_serializedNode) {\n console.warn(n, 'not serialized');\n return null;\n }\n\n var id;\n\n if (mirror.hasNode(n)) {\n id = mirror.getId(n);\n } else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType$1.Text && !_serializedNode.isStyle && !_serializedNode.textContent.replace(/^\\s+|\\s+$/gm, '').length) {\n id = IGNORED_NODE;\n } else {\n id = genId();\n }\n\n var serializedNode = Object.assign(_serializedNode, {\n id: id\n });\n mirror.add(n, serializedNode);\n\n if (id === IGNORED_NODE) {\n return null;\n }\n\n if (onSerialize) {\n onSerialize(n);\n }\n\n var recordChild = !skipChild;\n\n if (serializedNode.type === NodeType$1.Element) {\n recordChild = recordChild && !serializedNode.needBlock;\n delete serializedNode.needBlock;\n var shadowRoot = n.shadowRoot;\n if (shadowRoot && isNativeShadowDom(shadowRoot)) serializedNode.isShadowHost = true;\n }\n\n if ((serializedNode.type === NodeType$1.Document || serializedNode.type === NodeType$1.Element) && recordChild) {\n if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType$1.Element && serializedNode.tagName === 'head') {\n preserveWhiteSpace = false;\n }\n\n var bypassOptions = {\n doc: doc,\n mirror: mirror,\n blockClass: blockClass,\n blockSelector: blockSelector,\n maskAllText: maskAllText,\n unblockSelector: unblockSelector,\n maskTextClass: maskTextClass,\n unmaskTextClass: unmaskTextClass,\n maskTextSelector: maskTextSelector,\n unmaskTextSelector: unmaskTextSelector,\n skipChild: skipChild,\n inlineStylesheet: inlineStylesheet,\n maskInputOptions: maskInputOptions,\n maskAttributeFn: maskAttributeFn,\n maskTextFn: maskTextFn,\n maskInputFn: maskInputFn,\n slimDOMOptions: slimDOMOptions,\n dataURLOptions: dataURLOptions,\n inlineImages: inlineImages,\n recordCanvas: recordCanvas,\n preserveWhiteSpace: preserveWhiteSpace,\n onSerialize: onSerialize,\n onIframeLoad: onIframeLoad,\n iframeLoadTimeout: iframeLoadTimeout,\n onStylesheetLoad: onStylesheetLoad,\n stylesheetLoadTimeout: stylesheetLoadTimeout,\n keepIframeSrcFn: keepIframeSrcFn\n };\n\n for (var _i2 = 0, _Array$from = Array.from(n.childNodes); _i2 < _Array$from.length; _i2++) {\n var childN = _Array$from[_i2];\n var serializedChildNode = serializeNodeWithId(childN, bypassOptions);\n\n if (serializedChildNode) {\n serializedNode.childNodes.push(serializedChildNode);\n }\n }\n\n if (isElement$1(n) && n.shadowRoot) {\n for (var _i3 = 0, _Array$from2 = Array.from(n.shadowRoot.childNodes); _i3 < _Array$from2.length; _i3++) {\n var _childN = _Array$from2[_i3];\n\n var _serializedChildNode = serializeNodeWithId(_childN, bypassOptions);\n\n if (_serializedChildNode) {\n isNativeShadowDom(n.shadowRoot) && (_serializedChildNode.isShadow = true);\n serializedNode.childNodes.push(_serializedChildNode);\n }\n }\n }\n }\n\n if (n.parentNode && isShadowRoot(n.parentNode) && isNativeShadowDom(n.parentNode)) {\n serializedNode.isShadow = true;\n }\n\n if (serializedNode.type === NodeType$1.Element && serializedNode.tagName === 'iframe') {\n onceIframeLoaded(n, function () {\n var iframeDoc = n.contentDocument;\n\n if (iframeDoc && onIframeLoad) {\n var serializedIframeNode = serializeNodeWithId(iframeDoc, {\n doc: iframeDoc,\n mirror: mirror,\n blockClass: blockClass,\n blockSelector: blockSelector,\n unblockSelector: unblockSelector,\n maskAllText: maskAllText,\n maskTextClass: maskTextClass,\n unmaskTextClass: unmaskTextClass,\n maskTextSelector: maskTextSelector,\n unmaskTextSelector: unmaskTextSelector,\n skipChild: false,\n inlineStylesheet: inlineStylesheet,\n maskInputOptions: maskInputOptions,\n maskAttributeFn: maskAttributeFn,\n maskTextFn: maskTextFn,\n maskInputFn: maskInputFn,\n slimDOMOptions: slimDOMOptions,\n dataURLOptions: dataURLOptions,\n inlineImages: inlineImages,\n recordCanvas: recordCanvas,\n preserveWhiteSpace: preserveWhiteSpace,\n onSerialize: onSerialize,\n onIframeLoad: onIframeLoad,\n iframeLoadTimeout: iframeLoadTimeout,\n onStylesheetLoad: onStylesheetLoad,\n stylesheetLoadTimeout: stylesheetLoadTimeout,\n keepIframeSrcFn: keepIframeSrcFn\n });\n\n if (serializedIframeNode) {\n onIframeLoad(n, serializedIframeNode);\n }\n }\n }, iframeLoadTimeout);\n }\n\n if (serializedNode.type === NodeType$1.Element && serializedNode.tagName === 'link' && serializedNode.attributes.rel === 'stylesheet') {\n onceStylesheetLoaded(n, function () {\n if (onStylesheetLoad) {\n var serializedLinkNode = serializeNodeWithId(n, {\n doc: doc,\n mirror: mirror,\n blockClass: blockClass,\n blockSelector: blockSelector,\n unblockSelector: unblockSelector,\n maskAllText: maskAllText,\n maskTextClass: maskTextClass,\n unmaskTextClass: unmaskTextClass,\n maskTextSelector: maskTextSelector,\n unmaskTextSelector: unmaskTextSelector,\n skipChild: false,\n inlineStylesheet: inlineStylesheet,\n maskInputOptions: maskInputOptions,\n maskAttributeFn: maskAttributeFn,\n maskTextFn: maskTextFn,\n maskInputFn: maskInputFn,\n slimDOMOptions: slimDOMOptions,\n dataURLOptions: dataURLOptions,\n inlineImages: inlineImages,\n recordCanvas: recordCanvas,\n preserveWhiteSpace: preserveWhiteSpace,\n onSerialize: onSerialize,\n onIframeLoad: onIframeLoad,\n iframeLoadTimeout: iframeLoadTimeout,\n onStylesheetLoad: onStylesheetLoad,\n stylesheetLoadTimeout: stylesheetLoadTimeout,\n keepIframeSrcFn: keepIframeSrcFn\n });\n\n if (serializedLinkNode) {\n onStylesheetLoad(n, serializedLinkNode);\n }\n }\n }, stylesheetLoadTimeout);\n }\n\n return serializedNode;\n}\n\nfunction snapshot(n, options) {\n var _ref3 = options || {},\n _ref3$mirror = _ref3.mirror,\n mirror = _ref3$mirror === void 0 ? new Mirror() : _ref3$mirror,\n _ref3$blockClass = _ref3.blockClass,\n blockClass = _ref3$blockClass === void 0 ? 'rr-block' : _ref3$blockClass,\n _ref3$blockSelector = _ref3.blockSelector,\n blockSelector = _ref3$blockSelector === void 0 ? null : _ref3$blockSelector,\n _ref3$unblockSelector = _ref3.unblockSelector,\n unblockSelector = _ref3$unblockSelector === void 0 ? null : _ref3$unblockSelector,\n _ref3$maskAllText = _ref3.maskAllText,\n maskAllText = _ref3$maskAllText === void 0 ? false : _ref3$maskAllText,\n _ref3$maskTextClass = _ref3.maskTextClass,\n maskTextClass = _ref3$maskTextClass === void 0 ? 'rr-mask' : _ref3$maskTextClass,\n _ref3$unmaskTextClass = _ref3.unmaskTextClass,\n unmaskTextClass = _ref3$unmaskTextClass === void 0 ? null : _ref3$unmaskTextClass,\n _ref3$maskTextSelecto = _ref3.maskTextSelector,\n maskTextSelector = _ref3$maskTextSelecto === void 0 ? null : _ref3$maskTextSelecto,\n _ref3$unmaskTextSelec = _ref3.unmaskTextSelector,\n unmaskTextSelector = _ref3$unmaskTextSelec === void 0 ? null : _ref3$unmaskTextSelec,\n _ref3$inlineStyleshee = _ref3.inlineStylesheet,\n inlineStylesheet = _ref3$inlineStyleshee === void 0 ? true : _ref3$inlineStyleshee,\n _ref3$inlineImages = _ref3.inlineImages,\n inlineImages = _ref3$inlineImages === void 0 ? false : _ref3$inlineImages,\n _ref3$recordCanvas = _ref3.recordCanvas,\n recordCanvas = _ref3$recordCanvas === void 0 ? false : _ref3$recordCanvas,\n _ref3$maskAllInputs = _ref3.maskAllInputs,\n maskAllInputs = _ref3$maskAllInputs === void 0 ? false : _ref3$maskAllInputs,\n maskAttributeFn = _ref3.maskAttributeFn,\n maskTextFn = _ref3.maskTextFn,\n maskInputFn = _ref3.maskInputFn,\n _ref3$slimDOM = _ref3.slimDOM,\n slimDOM = _ref3$slimDOM === void 0 ? false : _ref3$slimDOM,\n dataURLOptions = _ref3.dataURLOptions,\n preserveWhiteSpace = _ref3.preserveWhiteSpace,\n onSerialize = _ref3.onSerialize,\n onIframeLoad = _ref3.onIframeLoad,\n iframeLoadTimeout = _ref3.iframeLoadTimeout,\n onStylesheetLoad = _ref3.onStylesheetLoad,\n stylesheetLoadTimeout = _ref3.stylesheetLoadTimeout,\n _ref3$keepIframeSrcFn = _ref3.keepIframeSrcFn,\n keepIframeSrcFn = _ref3$keepIframeSrcFn === void 0 ? function () {\n return false;\n } : _ref3$keepIframeSrcFn;\n\n var maskInputOptions = maskAllInputs === true ? {\n color: true,\n date: true,\n 'datetime-local': true,\n email: true,\n month: true,\n number: true,\n range: true,\n search: true,\n tel: true,\n text: true,\n time: true,\n url: true,\n week: true,\n textarea: true,\n select: true\n } : maskAllInputs === false ? {} : maskAllInputs;\n var slimDOMOptions = slimDOM === true || slimDOM === 'all' ? {\n script: true,\n comment: true,\n headFavicon: true,\n headWhitespace: true,\n headMetaDescKeywords: slimDOM === 'all',\n headMetaSocial: true,\n headMetaRobots: true,\n headMetaHttpEquiv: true,\n headMetaAuthorship: true,\n headMetaVerification: true\n } : slimDOM === false ? {} : slimDOM;\n return serializeNodeWithId(n, {\n doc: n,\n mirror: mirror,\n blockClass: blockClass,\n blockSelector: blockSelector,\n unblockSelector: unblockSelector,\n maskAllText: maskAllText,\n maskTextClass: maskTextClass,\n unmaskTextClass: unmaskTextClass,\n maskTextSelector: maskTextSelector,\n unmaskTextSelector: unmaskTextSelector,\n skipChild: false,\n inlineStylesheet: inlineStylesheet,\n maskInputOptions: maskInputOptions,\n maskAttributeFn: maskAttributeFn,\n maskTextFn: maskTextFn,\n maskInputFn: maskInputFn,\n slimDOMOptions: slimDOMOptions,\n dataURLOptions: dataURLOptions,\n inlineImages: inlineImages,\n recordCanvas: recordCanvas,\n preserveWhiteSpace: preserveWhiteSpace,\n onSerialize: onSerialize,\n onIframeLoad: onIframeLoad,\n iframeLoadTimeout: iframeLoadTimeout,\n onStylesheetLoad: onStylesheetLoad,\n stylesheetLoadTimeout: stylesheetLoadTimeout,\n keepIframeSrcFn: keepIframeSrcFn,\n newlyAddedElement: false\n });\n}\n\nfunction on(type, fn) {\n var target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document;\n var options = {\n capture: true,\n passive: true\n };\n target.addEventListener(type, fn, options);\n return function () {\n return target.removeEventListener(type, fn, options);\n };\n}\n\nvar DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' + '\\r\\n' + 'now you can use replayer.getMirror() to access the mirror instance of a replayer,' + '\\r\\n' + 'or you can use record.mirror to access the mirror instance during recording.';\nvar _mirror = {\n map: {},\n getId: function getId() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n return -1;\n },\n getNode: function getNode() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n return null;\n },\n removeNodeFromMap: function removeNodeFromMap() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n },\n has: function has() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n return false;\n },\n reset: function reset() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n }\n};\n\nif (typeof window !== 'undefined' && window.Proxy && window.Reflect) {\n _mirror = new Proxy(_mirror, {\n get: function get(target, prop, receiver) {\n if (prop === 'map') {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n }\n\n return Reflect.get(target, prop, receiver);\n }\n });\n}\n\nfunction throttle$1(func, wait) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var timeout = null;\n var previous = 0;\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var now = Date.now();\n\n if (!previous && options.leading === false) {\n previous = now;\n }\n\n var remaining = wait - (now - previous);\n var context = this;\n\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n\n previous = now;\n func.apply(context, args);\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(function () {\n previous = options.leading === false ? 0 : Date.now();\n timeout = null;\n func.apply(context, args);\n }, remaining);\n }\n };\n}\n\nfunction hookSetter(target, key, d, isRevoked) {\n var win = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : window;\n var original = win.Object.getOwnPropertyDescriptor(target, key);\n win.Object.defineProperty(target, key, isRevoked ? d : {\n set: function set(value) {\n var _this2 = this;\n\n setTimeout(function () {\n d.set.call(_this2, value);\n }, 0);\n\n if (original && original.set) {\n original.set.call(this, value);\n }\n }\n });\n return function () {\n return hookSetter(target, key, original || {}, true);\n };\n}\n\nfunction patch(source, name, replacement) {\n try {\n if (!(name in source)) {\n return function () {};\n }\n\n var original = source[name];\n var wrapped = replacement(original);\n\n if (typeof wrapped === 'function') {\n wrapped.prototype = wrapped.prototype || {};\n Object.defineProperties(wrapped, {\n __rrweb_original__: {\n enumerable: false,\n value: original\n }\n });\n }\n\n source[name] = wrapped;\n return function () {\n source[name] = original;\n };\n } catch (_a) {\n return function () {};\n }\n}\n\nvar nowTimestamp = Date.now;\n\nif (!/[1-9][0-9]{12}/.test(Date.now().toString())) {\n nowTimestamp = function nowTimestamp() {\n return new Date().getTime();\n };\n}\n\nfunction getWindowScroll(win) {\n var _a, _b, _c, _d, _e, _f;\n\n var doc = win.document;\n return {\n left: doc.scrollingElement ? doc.scrollingElement.scrollLeft : win.pageXOffset !== undefined ? win.pageXOffset : (doc === null || doc === void 0 ? void 0 : doc.documentElement.scrollLeft) || ((_b = (_a = doc === null || doc === void 0 ? void 0 : doc.body) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.scrollLeft) || ((_c = doc === null || doc === void 0 ? void 0 : doc.body) === null || _c === void 0 ? void 0 : _c.scrollLeft) || 0,\n top: doc.scrollingElement ? doc.scrollingElement.scrollTop : win.pageYOffset !== undefined ? win.pageYOffset : (doc === null || doc === void 0 ? void 0 : doc.documentElement.scrollTop) || ((_e = (_d = doc === null || doc === void 0 ? void 0 : doc.body) === null || _d === void 0 ? void 0 : _d.parentElement) === null || _e === void 0 ? void 0 : _e.scrollTop) || ((_f = doc === null || doc === void 0 ? void 0 : doc.body) === null || _f === void 0 ? void 0 : _f.scrollTop) || 0\n };\n}\n\nfunction getWindowHeight() {\n return window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body && document.body.clientHeight;\n}\n\nfunction getWindowWidth() {\n return window.innerWidth || document.documentElement && document.documentElement.clientWidth || document.body && document.body.clientWidth;\n}\n\nfunction isBlocked(node, blockClass, blockSelector, unblockSelector, checkAncestors) {\n if (!node) {\n return false;\n }\n\n var el = node.nodeType === node.ELEMENT_NODE ? node : node.parentElement;\n if (!el) return false;\n var blockedPredicate = createMatchPredicate(blockClass, blockSelector);\n\n if (!checkAncestors) {\n var isUnblocked = unblockSelector && el.matches(unblockSelector);\n return blockedPredicate(el) && !isUnblocked;\n }\n\n var blockDistance = distanceToMatch(el, blockedPredicate);\n var unblockDistance = -1;\n\n if (blockDistance < 0) {\n return false;\n }\n\n if (unblockSelector) {\n unblockDistance = distanceToMatch(el, createMatchPredicate(null, unblockSelector));\n }\n\n if (blockDistance > -1 && unblockDistance < 0) {\n return true;\n }\n\n return blockDistance < unblockDistance;\n}\n\nfunction isSerialized(n, mirror) {\n return mirror.getId(n) !== -1;\n}\n\nfunction isIgnored(n, mirror) {\n return mirror.getId(n) === IGNORED_NODE;\n}\n\nfunction isAncestorRemoved(target, mirror) {\n if (isShadowRoot(target)) {\n return false;\n }\n\n var id = mirror.getId(target);\n\n if (!mirror.has(id)) {\n return true;\n }\n\n if (target.parentNode && target.parentNode.nodeType === target.DOCUMENT_NODE) {\n return false;\n }\n\n if (!target.parentNode) {\n return true;\n }\n\n return isAncestorRemoved(target.parentNode, mirror);\n}\n\nfunction legacy_isTouchEvent(event) {\n return Boolean(event.changedTouches);\n}\n\nfunction polyfill() {\n var _this3 = this;\n\n var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;\n\n if ('NodeList' in win && !win.NodeList.prototype.forEach) {\n win.NodeList.prototype.forEach = Array.prototype.forEach;\n }\n\n if ('DOMTokenList' in win && !win.DOMTokenList.prototype.forEach) {\n win.DOMTokenList.prototype.forEach = Array.prototype.forEach;\n }\n\n if (!Node.prototype.contains) {\n Node.prototype.contains = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var node = args[0];\n\n if (!(0 in args)) {\n throw new TypeError('1 argument is required');\n }\n\n do {\n if (_this3 === node) {\n return true;\n }\n } while (node = node && node.parentNode);\n\n return false;\n };\n }\n}\n\nfunction isSerializedIframe(n, mirror) {\n return Boolean(n.nodeName === 'IFRAME' && mirror.getMeta(n));\n}\n\nfunction isSerializedStylesheet(n, mirror) {\n return Boolean(n.nodeName === 'LINK' && n.nodeType === n.ELEMENT_NODE && n.getAttribute && n.getAttribute('rel') === 'stylesheet' && mirror.getMeta(n));\n}\n\nfunction hasShadowRoot(n) {\n return Boolean(n === null || n === void 0 ? void 0 : n.shadowRoot);\n}\n\nvar StyleSheetMirror = /*#__PURE__*/function () {\n function StyleSheetMirror() {\n _classCallCheck(this, StyleSheetMirror);\n\n this.id = 1;\n this.styleIDMap = new WeakMap();\n this.idStyleMap = new Map();\n }\n\n _createClass(StyleSheetMirror, [{\n key: \"getId\",\n value: function getId(stylesheet) {\n var _a;\n\n return (_a = this.styleIDMap.get(stylesheet)) !== null && _a !== void 0 ? _a : -1;\n }\n }, {\n key: \"has\",\n value: function has(stylesheet) {\n return this.styleIDMap.has(stylesheet);\n }\n }, {\n key: \"add\",\n value: function add(stylesheet, id) {\n if (this.has(stylesheet)) return this.getId(stylesheet);\n var newId;\n\n if (id === undefined) {\n newId = this.id++;\n } else newId = id;\n\n this.styleIDMap.set(stylesheet, newId);\n this.idStyleMap.set(newId, stylesheet);\n return newId;\n }\n }, {\n key: \"getStyle\",\n value: function getStyle(id) {\n return this.idStyleMap.get(id) || null;\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this.styleIDMap = new WeakMap();\n this.idStyleMap = new Map();\n this.id = 1;\n }\n }, {\n key: \"generateId\",\n value: function generateId() {\n return this.id++;\n }\n }]);\n\n return StyleSheetMirror;\n}();\n\nfunction getShadowHost(n) {\n var _a, _b;\n\n var shadowHost = null;\n if (((_b = (_a = n.getRootNode) === null || _a === void 0 ? void 0 : _a.call(n)) === null || _b === void 0 ? void 0 : _b.nodeType) === Node.DOCUMENT_FRAGMENT_NODE && n.getRootNode().host) shadowHost = n.getRootNode().host;\n return shadowHost;\n}\n\nfunction getRootShadowHost(n) {\n var rootShadowHost = n;\n var shadowHost;\n\n while (shadowHost = getShadowHost(rootShadowHost)) {\n rootShadowHost = shadowHost;\n }\n\n return rootShadowHost;\n}\n\nfunction shadowHostInDom(n) {\n var doc = n.ownerDocument;\n if (!doc) return false;\n var shadowHost = getRootShadowHost(n);\n return doc.contains(shadowHost);\n}\n\nfunction inDom(n) {\n var doc = n.ownerDocument;\n if (!doc) return false;\n return doc.contains(n) || shadowHostInDom(n);\n}\n\nvar EventType = /* @__PURE__ */function (EventType2) {\n EventType2[EventType2[\"DomContentLoaded\"] = 0] = \"DomContentLoaded\";\n EventType2[EventType2[\"Load\"] = 1] = \"Load\";\n EventType2[EventType2[\"FullSnapshot\"] = 2] = \"FullSnapshot\";\n EventType2[EventType2[\"IncrementalSnapshot\"] = 3] = \"IncrementalSnapshot\";\n EventType2[EventType2[\"Meta\"] = 4] = \"Meta\";\n EventType2[EventType2[\"Custom\"] = 5] = \"Custom\";\n EventType2[EventType2[\"Plugin\"] = 6] = \"Plugin\";\n return EventType2;\n}(EventType || {});\n\nvar IncrementalSource = /* @__PURE__ */function (IncrementalSource2) {\n IncrementalSource2[IncrementalSource2[\"Mutation\"] = 0] = \"Mutation\";\n IncrementalSource2[IncrementalSource2[\"MouseMove\"] = 1] = \"MouseMove\";\n IncrementalSource2[IncrementalSource2[\"MouseInteraction\"] = 2] = \"MouseInteraction\";\n IncrementalSource2[IncrementalSource2[\"Scroll\"] = 3] = \"Scroll\";\n IncrementalSource2[IncrementalSource2[\"ViewportResize\"] = 4] = \"ViewportResize\";\n IncrementalSource2[IncrementalSource2[\"Input\"] = 5] = \"Input\";\n IncrementalSource2[IncrementalSource2[\"TouchMove\"] = 6] = \"TouchMove\";\n IncrementalSource2[IncrementalSource2[\"MediaInteraction\"] = 7] = \"MediaInteraction\";\n IncrementalSource2[IncrementalSource2[\"StyleSheetRule\"] = 8] = \"StyleSheetRule\";\n IncrementalSource2[IncrementalSource2[\"CanvasMutation\"] = 9] = \"CanvasMutation\";\n IncrementalSource2[IncrementalSource2[\"Font\"] = 10] = \"Font\";\n IncrementalSource2[IncrementalSource2[\"Log\"] = 11] = \"Log\";\n IncrementalSource2[IncrementalSource2[\"Drag\"] = 12] = \"Drag\";\n IncrementalSource2[IncrementalSource2[\"StyleDeclaration\"] = 13] = \"StyleDeclaration\";\n IncrementalSource2[IncrementalSource2[\"Selection\"] = 14] = \"Selection\";\n IncrementalSource2[IncrementalSource2[\"AdoptedStyleSheet\"] = 15] = \"AdoptedStyleSheet\";\n IncrementalSource2[IncrementalSource2[\"CustomElement\"] = 16] = \"CustomElement\";\n return IncrementalSource2;\n}(IncrementalSource || {});\n\nvar MouseInteractions = /* @__PURE__ */function (MouseInteractions2) {\n MouseInteractions2[MouseInteractions2[\"MouseUp\"] = 0] = \"MouseUp\";\n MouseInteractions2[MouseInteractions2[\"MouseDown\"] = 1] = \"MouseDown\";\n MouseInteractions2[MouseInteractions2[\"Click\"] = 2] = \"Click\";\n MouseInteractions2[MouseInteractions2[\"ContextMenu\"] = 3] = \"ContextMenu\";\n MouseInteractions2[MouseInteractions2[\"DblClick\"] = 4] = \"DblClick\";\n MouseInteractions2[MouseInteractions2[\"Focus\"] = 5] = \"Focus\";\n MouseInteractions2[MouseInteractions2[\"Blur\"] = 6] = \"Blur\";\n MouseInteractions2[MouseInteractions2[\"TouchStart\"] = 7] = \"TouchStart\";\n MouseInteractions2[MouseInteractions2[\"TouchMove_Departed\"] = 8] = \"TouchMove_Departed\";\n MouseInteractions2[MouseInteractions2[\"TouchEnd\"] = 9] = \"TouchEnd\";\n MouseInteractions2[MouseInteractions2[\"TouchCancel\"] = 10] = \"TouchCancel\";\n return MouseInteractions2;\n}(MouseInteractions || {});\n\nvar PointerTypes = /* @__PURE__ */function (PointerTypes2) {\n PointerTypes2[PointerTypes2[\"Mouse\"] = 0] = \"Mouse\";\n PointerTypes2[PointerTypes2[\"Pen\"] = 1] = \"Pen\";\n PointerTypes2[PointerTypes2[\"Touch\"] = 2] = \"Touch\";\n return PointerTypes2;\n}(PointerTypes || {});\n\nvar CanvasContext = /* @__PURE__ */function (CanvasContext2) {\n CanvasContext2[CanvasContext2[\"2D\"] = 0] = \"2D\";\n CanvasContext2[CanvasContext2[\"WebGL\"] = 1] = \"WebGL\";\n CanvasContext2[CanvasContext2[\"WebGL2\"] = 2] = \"WebGL2\";\n return CanvasContext2;\n}(CanvasContext || {});\n\nfunction isNodeInLinkedList(n) {\n return '__ln' in n;\n}\n\nvar DoubleLinkedList = /*#__PURE__*/function () {\n function DoubleLinkedList() {\n _classCallCheck(this, DoubleLinkedList);\n\n this.length = 0;\n this.head = null;\n this.tail = null;\n }\n\n _createClass(DoubleLinkedList, [{\n key: \"get\",\n value: function get(position) {\n if (position >= this.length) {\n throw new Error('Position outside of list range');\n }\n\n var current = this.head;\n\n for (var index = 0; index < position; index++) {\n current = (current === null || current === void 0 ? void 0 : current.next) || null;\n }\n\n return current;\n }\n }, {\n key: \"addNode\",\n value: function addNode(n) {\n var node = {\n value: n,\n previous: null,\n next: null\n };\n n.__ln = node;\n\n if (n.previousSibling && isNodeInLinkedList(n.previousSibling)) {\n var current = n.previousSibling.__ln.next;\n node.next = current;\n node.previous = n.previousSibling.__ln;\n n.previousSibling.__ln.next = node;\n\n if (current) {\n current.previous = node;\n }\n } else if (n.nextSibling && isNodeInLinkedList(n.nextSibling) && n.nextSibling.__ln.previous) {\n var _current = n.nextSibling.__ln.previous;\n node.previous = _current;\n node.next = n.nextSibling.__ln;\n n.nextSibling.__ln.previous = node;\n\n if (_current) {\n _current.next = node;\n }\n } else {\n if (this.head) {\n this.head.previous = node;\n }\n\n node.next = this.head;\n this.head = node;\n }\n\n if (node.next === null) {\n this.tail = node;\n }\n\n this.length++;\n }\n }, {\n key: \"removeNode\",\n value: function removeNode(n) {\n var current = n.__ln;\n\n if (!this.head) {\n return;\n }\n\n if (!current.previous) {\n this.head = current.next;\n\n if (this.head) {\n this.head.previous = null;\n } else {\n this.tail = null;\n }\n } else {\n current.previous.next = current.next;\n\n if (current.next) {\n current.next.previous = current.previous;\n } else {\n this.tail = current.previous;\n }\n }\n\n if (n.__ln) {\n delete n.__ln;\n }\n\n this.length--;\n }\n }]);\n\n return DoubleLinkedList;\n}();\n\nvar moveKey = function moveKey(id, parentId) {\n return \"\".concat(id, \"@\").concat(parentId);\n};\n\nvar MutationBuffer = /*#__PURE__*/function () {\n function MutationBuffer() {\n var _this4 = this;\n\n _classCallCheck(this, MutationBuffer);\n\n this.frozen = false;\n this.locked = false;\n this.texts = [];\n this.attributes = [];\n this.removes = [];\n this.mapRemoves = [];\n this.movedMap = {};\n this.addedSet = new Set();\n this.movedSet = new Set();\n this.droppedSet = new Set();\n\n this.processMutations = function (mutations) {\n mutations.forEach(_this4.processMutation);\n\n _this4.emit();\n };\n\n this.emit = function () {\n if (_this4.frozen || _this4.locked) {\n return;\n }\n\n var adds = [];\n var addedIds = new Set();\n var addList = new DoubleLinkedList();\n\n var getNextId = function getNextId(n) {\n var ns = n;\n var nextId = IGNORED_NODE;\n\n while (nextId === IGNORED_NODE) {\n ns = ns && ns.nextSibling;\n nextId = ns && _this4.mirror.getId(ns);\n }\n\n return nextId;\n };\n\n var pushAdd = function pushAdd(n) {\n if (!n.parentNode || !inDom(n)) {\n return;\n }\n\n var parentId = isShadowRoot(n.parentNode) ? _this4.mirror.getId(getShadowHost(n)) : _this4.mirror.getId(n.parentNode);\n var nextId = getNextId(n);\n\n if (parentId === -1 || nextId === -1) {\n return addList.addNode(n);\n }\n\n var sn = serializeNodeWithId(n, {\n doc: _this4.doc,\n mirror: _this4.mirror,\n blockClass: _this4.blockClass,\n blockSelector: _this4.blockSelector,\n maskAllText: _this4.maskAllText,\n unblockSelector: _this4.unblockSelector,\n maskTextClass: _this4.maskTextClass,\n unmaskTextClass: _this4.unmaskTextClass,\n maskTextSelector: _this4.maskTextSelector,\n unmaskTextSelector: _this4.unmaskTextSelector,\n skipChild: true,\n newlyAddedElement: true,\n inlineStylesheet: _this4.inlineStylesheet,\n maskInputOptions: _this4.maskInputOptions,\n maskAttributeFn: _this4.maskAttributeFn,\n maskTextFn: _this4.maskTextFn,\n maskInputFn: _this4.maskInputFn,\n slimDOMOptions: _this4.slimDOMOptions,\n dataURLOptions: _this4.dataURLOptions,\n recordCanvas: _this4.recordCanvas,\n inlineImages: _this4.inlineImages,\n onSerialize: function onSerialize(currentN) {\n if (isSerializedIframe(currentN, _this4.mirror)) {\n _this4.iframeManager.addIframe(currentN);\n }\n\n if (isSerializedStylesheet(currentN, _this4.mirror)) {\n _this4.stylesheetManager.trackLinkElement(currentN);\n }\n\n if (hasShadowRoot(n)) {\n _this4.shadowDomManager.addShadowRoot(n.shadowRoot, _this4.doc);\n }\n },\n onIframeLoad: function onIframeLoad(iframe, childSn) {\n _this4.iframeManager.attachIframe(iframe, childSn);\n\n _this4.shadowDomManager.observeAttachShadow(iframe);\n },\n onStylesheetLoad: function onStylesheetLoad(link, childSn) {\n _this4.stylesheetManager.attachLinkElement(link, childSn);\n }\n });\n\n if (sn) {\n adds.push({\n parentId: parentId,\n nextId: nextId,\n node: sn\n });\n addedIds.add(sn.id);\n }\n };\n\n while (_this4.mapRemoves.length) {\n _this4.mirror.removeNodeFromMap(_this4.mapRemoves.shift());\n }\n\n var _iterator2 = _createForOfIteratorHelper(_this4.movedSet),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var n = _step2.value;\n\n if (isParentRemoved(_this4.removes, n, _this4.mirror) && !_this4.movedSet.has(n.parentNode)) {\n continue;\n }\n\n pushAdd(n);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n var _iterator3 = _createForOfIteratorHelper(_this4.addedSet),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var _n = _step3.value;\n\n if (!isAncestorInSet(_this4.droppedSet, _n) && !isParentRemoved(_this4.removes, _n, _this4.mirror)) {\n pushAdd(_n);\n } else if (isAncestorInSet(_this4.movedSet, _n)) {\n pushAdd(_n);\n } else {\n _this4.droppedSet.add(_n);\n }\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n var candidate = null;\n\n while (addList.length) {\n var node = null;\n\n if (candidate) {\n var parentId = _this4.mirror.getId(candidate.value.parentNode);\n\n var nextId = getNextId(candidate.value);\n\n if (parentId !== -1 && nextId !== -1) {\n node = candidate;\n }\n }\n\n if (!node) {\n var tailNode = addList.tail;\n\n while (tailNode) {\n var _node = tailNode;\n tailNode = tailNode.previous;\n\n if (_node) {\n var _parentId = _this4.mirror.getId(_node.value.parentNode);\n\n var _nextId = getNextId(_node.value);\n\n if (_nextId === -1) continue;else if (_parentId !== -1) {\n node = _node;\n break;\n } else {\n var unhandledNode = _node.value;\n\n if (unhandledNode.parentNode && unhandledNode.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n var shadowHost = unhandledNode.parentNode.host;\n\n var _parentId2 = _this4.mirror.getId(shadowHost);\n\n if (_parentId2 !== -1) {\n node = _node;\n break;\n }\n }\n }\n }\n }\n }\n\n if (!node) {\n while (addList.head) {\n addList.removeNode(addList.head.value);\n }\n\n break;\n }\n\n candidate = node.previous;\n addList.removeNode(node.value);\n pushAdd(node.value);\n }\n\n var payload = {\n texts: _this4.texts.map(function (text) {\n return {\n id: _this4.mirror.getId(text.node),\n value: text.value\n };\n }).filter(function (text) {\n return !addedIds.has(text.id);\n }).filter(function (text) {\n return _this4.mirror.has(text.id);\n }),\n attributes: _this4.attributes.map(function (attribute) {\n var attributes = attribute.attributes;\n\n if (typeof attributes.style === 'string') {\n var diffAsStr = JSON.stringify(attribute.styleDiff);\n var unchangedAsStr = JSON.stringify(attribute._unchangedStyles);\n\n if (diffAsStr.length < attributes.style.length) {\n if ((diffAsStr + unchangedAsStr).split('var(').length === attributes.style.split('var(').length) {\n attributes.style = attribute.styleDiff;\n }\n }\n }\n\n return {\n id: _this4.mirror.getId(attribute.node),\n attributes: attributes\n };\n }).filter(function (attribute) {\n return !addedIds.has(attribute.id);\n }).filter(function (attribute) {\n return _this4.mirror.has(attribute.id);\n }),\n removes: _this4.removes,\n adds: adds\n };\n\n if (!payload.texts.length && !payload.attributes.length && !payload.removes.length && !payload.adds.length) {\n return;\n }\n\n _this4.texts = [];\n _this4.attributes = [];\n _this4.removes = [];\n _this4.addedSet = new Set();\n _this4.movedSet = new Set();\n _this4.droppedSet = new Set();\n _this4.movedMap = {};\n\n _this4.mutationCb(payload);\n };\n\n this.processMutation = function (m) {\n if (isIgnored(m.target, _this4.mirror)) {\n return;\n }\n\n var unattachedDoc;\n\n try {\n unattachedDoc = document.implementation.createHTMLDocument();\n } catch (e) {\n unattachedDoc = _this4.doc;\n }\n\n switch (m.type) {\n case 'characterData':\n {\n var value = m.target.textContent;\n\n if (!isBlocked(m.target, _this4.blockClass, _this4.blockSelector, _this4.unblockSelector, false) && value !== m.oldValue) {\n _this4.texts.push({\n value: needMaskingText(m.target, _this4.maskTextClass, _this4.maskTextSelector, _this4.unmaskTextClass, _this4.unmaskTextSelector, _this4.maskAllText) && value ? _this4.maskTextFn ? _this4.maskTextFn(value) : value.replace(/[\\S]/g, '*') : value,\n node: m.target\n });\n }\n\n break;\n }\n\n case 'attributes':\n {\n var target = m.target;\n var attributeName = m.attributeName;\n\n var _value2 = m.target.getAttribute(attributeName);\n\n if (attributeName === 'value') {\n var type = getInputType(target);\n var tagName = target.tagName;\n _value2 = getInputValue(target, tagName, type);\n var isInputMasked = shouldMaskInput({\n maskInputOptions: _this4.maskInputOptions,\n tagName: tagName,\n type: type\n });\n var forceMask = needMaskingText(m.target, _this4.maskTextClass, _this4.maskTextSelector, _this4.unmaskTextClass, _this4.unmaskTextSelector, isInputMasked);\n _value2 = maskInputValue({\n isMasked: forceMask,\n element: target,\n value: _value2,\n maskInputFn: _this4.maskInputFn\n });\n }\n\n if (isBlocked(m.target, _this4.blockClass, _this4.blockSelector, _this4.unblockSelector, false) || _value2 === m.oldValue) {\n return;\n }\n\n var item = _this4.attributes.find(function (a) {\n return a.node === m.target;\n });\n\n if (target.tagName === 'IFRAME' && attributeName === 'src' && !_this4.keepIframeSrcFn(_value2)) {\n if (!target.contentDocument) {\n attributeName = 'rr_src';\n } else {\n return;\n }\n }\n\n if (!item) {\n item = {\n node: m.target,\n attributes: {},\n styleDiff: {},\n _unchangedStyles: {}\n };\n\n _this4.attributes.push(item);\n }\n\n if (attributeName === 'type' && target.tagName === 'INPUT' && (m.oldValue || '').toLowerCase() === 'password') {\n target.setAttribute('data-rr-is-password', 'true');\n }\n\n if (!ignoreAttribute(target.tagName, attributeName)) {\n item.attributes[attributeName] = transformAttribute(_this4.doc, toLowerCase(target.tagName), toLowerCase(attributeName), _value2, target, _this4.maskAttributeFn);\n\n if (attributeName === 'style') {\n var old = unattachedDoc.createElement('span');\n\n if (m.oldValue) {\n old.setAttribute('style', m.oldValue);\n }\n\n for (var _i4 = 0, _Array$from3 = Array.from(target.style); _i4 < _Array$from3.length; _i4++) {\n var pname = _Array$from3[_i4];\n var newValue = target.style.getPropertyValue(pname);\n var newPriority = target.style.getPropertyPriority(pname);\n\n if (newValue !== old.style.getPropertyValue(pname) || newPriority !== old.style.getPropertyPriority(pname)) {\n if (newPriority === '') {\n item.styleDiff[pname] = newValue;\n } else {\n item.styleDiff[pname] = [newValue, newPriority];\n }\n } else {\n item._unchangedStyles[pname] = [newValue, newPriority];\n }\n }\n\n for (var _i5 = 0, _Array$from4 = Array.from(old.style); _i5 < _Array$from4.length; _i5++) {\n var _pname = _Array$from4[_i5];\n\n if (target.style.getPropertyValue(_pname) === '') {\n item.styleDiff[_pname] = false;\n }\n }\n }\n }\n\n break;\n }\n\n case 'childList':\n {\n if (isBlocked(m.target, _this4.blockClass, _this4.blockSelector, _this4.unblockSelector, true)) {\n return;\n }\n\n m.addedNodes.forEach(function (n) {\n return _this4.genAdds(n, m.target);\n });\n m.removedNodes.forEach(function (n) {\n var nodeId = _this4.mirror.getId(n);\n\n var parentId = isShadowRoot(m.target) ? _this4.mirror.getId(m.target.host) : _this4.mirror.getId(m.target);\n\n if (isBlocked(m.target, _this4.blockClass, _this4.blockSelector, _this4.unblockSelector, false) || isIgnored(n, _this4.mirror) || !isSerialized(n, _this4.mirror)) {\n return;\n }\n\n if (_this4.addedSet.has(n)) {\n deepDelete(_this4.addedSet, n);\n\n _this4.droppedSet.add(n);\n } else if (_this4.addedSet.has(m.target) && nodeId === -1) ;else if (isAncestorRemoved(m.target, _this4.mirror)) ;else if (_this4.movedSet.has(n) && _this4.movedMap[moveKey(nodeId, parentId)]) {\n deepDelete(_this4.movedSet, n);\n } else {\n _this4.removes.push({\n parentId: parentId,\n id: nodeId,\n isShadow: isShadowRoot(m.target) && isNativeShadowDom(m.target) ? true : undefined\n });\n }\n\n _this4.mapRemoves.push(n);\n });\n break;\n }\n }\n };\n\n this.genAdds = function (n, target) {\n if (_this4.processedNodeManager.inOtherBuffer(n, _this4)) return;\n if (_this4.addedSet.has(n) || _this4.movedSet.has(n)) return;\n\n if (_this4.mirror.hasNode(n)) {\n if (isIgnored(n, _this4.mirror)) {\n return;\n }\n\n _this4.movedSet.add(n);\n\n var targetId = null;\n\n if (target && _this4.mirror.hasNode(target)) {\n targetId = _this4.mirror.getId(target);\n }\n\n if (targetId && targetId !== -1) {\n _this4.movedMap[moveKey(_this4.mirror.getId(n), targetId)] = true;\n }\n } else {\n _this4.addedSet.add(n);\n\n _this4.droppedSet.delete(n);\n }\n\n if (!isBlocked(n, _this4.blockClass, _this4.blockSelector, _this4.unblockSelector, false)) {\n n.childNodes.forEach(function (childN) {\n return _this4.genAdds(childN);\n });\n\n if (hasShadowRoot(n)) {\n n.shadowRoot.childNodes.forEach(function (childN) {\n _this4.processedNodeManager.add(childN, _this4);\n\n _this4.genAdds(childN, n);\n });\n }\n }\n };\n }\n\n _createClass(MutationBuffer, [{\n key: \"init\",\n value: function init(options) {\n var _this5 = this;\n\n ['mutationCb', 'blockClass', 'blockSelector', 'unblockSelector', 'maskAllText', 'maskTextClass', 'unmaskTextClass', 'maskTextSelector', 'unmaskTextSelector', 'inlineStylesheet', 'maskInputOptions', 'maskAttributeFn', 'maskTextFn', 'maskInputFn', 'keepIframeSrcFn', 'recordCanvas', 'inlineImages', 'slimDOMOptions', 'dataURLOptions', 'doc', 'mirror', 'iframeManager', 'stylesheetManager', 'shadowDomManager', 'canvasManager', 'processedNodeManager'].forEach(function (key) {\n _this5[key] = options[key];\n });\n }\n }, {\n key: \"freeze\",\n value: function freeze() {\n this.frozen = true;\n this.canvasManager.freeze();\n }\n }, {\n key: \"unfreeze\",\n value: function unfreeze() {\n this.frozen = false;\n this.canvasManager.unfreeze();\n this.emit();\n }\n }, {\n key: \"isFrozen\",\n value: function isFrozen() {\n return this.frozen;\n }\n }, {\n key: \"lock\",\n value: function lock() {\n this.locked = true;\n this.canvasManager.lock();\n }\n }, {\n key: \"unlock\",\n value: function unlock() {\n this.locked = false;\n this.canvasManager.unlock();\n this.emit();\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this.shadowDomManager.reset();\n this.canvasManager.reset();\n }\n }]);\n\n return MutationBuffer;\n}();\n\nfunction deepDelete(addsSet, n) {\n addsSet.delete(n);\n n.childNodes.forEach(function (childN) {\n return deepDelete(addsSet, childN);\n });\n}\n\nfunction isParentRemoved(removes, n, mirror) {\n if (removes.length === 0) return false;\n return _isParentRemoved(removes, n, mirror);\n}\n\nfunction _isParentRemoved(removes, n, mirror) {\n var parentNode = n.parentNode;\n\n if (!parentNode) {\n return false;\n }\n\n var parentId = mirror.getId(parentNode);\n\n if (removes.some(function (r) {\n return r.id === parentId;\n })) {\n return true;\n }\n\n return _isParentRemoved(removes, parentNode, mirror);\n}\n\nfunction isAncestorInSet(set, n) {\n if (set.size === 0) return false;\n return _isAncestorInSet(set, n);\n}\n\nfunction _isAncestorInSet(set, n) {\n var parentNode = n.parentNode;\n\n if (!parentNode) {\n return false;\n }\n\n if (set.has(parentNode)) {\n return true;\n }\n\n return _isAncestorInSet(set, parentNode);\n}\n\nvar errorHandler;\n\nfunction registerErrorHandler(handler) {\n errorHandler = handler;\n}\n\nfunction unregisterErrorHandler() {\n errorHandler = undefined;\n}\n\nvar callbackWrapper = function callbackWrapper(cb) {\n if (!errorHandler) {\n return cb;\n }\n\n var rrwebWrapped = function rrwebWrapped() {\n try {\n return cb.apply(void 0, arguments);\n } catch (error) {\n if (errorHandler && errorHandler(error) === true) {\n return function () {};\n }\n\n throw error;\n }\n };\n\n return rrwebWrapped;\n};\n\nvar mutationBuffers = [];\n\nfunction getEventTarget(event) {\n try {\n if ('composedPath' in event) {\n var path = event.composedPath();\n\n if (path.length) {\n return path[0];\n }\n } else if ('path' in event && event.path.length) {\n return event.path[0];\n }\n } catch (_a) {}\n\n return event && event.target;\n}\n\nfunction initMutationObserver(options, rootEl) {\n var _a, _b;\n\n var mutationBuffer = new MutationBuffer();\n mutationBuffers.push(mutationBuffer);\n mutationBuffer.init(options);\n var mutationObserverCtor = window.MutationObserver || window.__rrMutationObserver;\n var angularZoneSymbol = (_b = (_a = window === null || window === void 0 ? void 0 : window.Zone) === null || _a === void 0 ? void 0 : _a.__symbol__) === null || _b === void 0 ? void 0 : _b.call(_a, 'MutationObserver');\n\n if (angularZoneSymbol && window[angularZoneSymbol]) {\n mutationObserverCtor = window[angularZoneSymbol];\n }\n\n var observer = new mutationObserverCtor(callbackWrapper(function (mutations) {\n if (options.onMutation && options.onMutation(mutations) === false) {\n return;\n }\n\n mutationBuffer.processMutations.bind(mutationBuffer)(mutations);\n }));\n observer.observe(rootEl, {\n attributes: true,\n attributeOldValue: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true\n });\n return observer;\n}\n\nfunction initMoveObserver(_ref4) {\n var mousemoveCb = _ref4.mousemoveCb,\n sampling = _ref4.sampling,\n doc = _ref4.doc,\n mirror = _ref4.mirror;\n\n if (sampling.mousemove === false) {\n return function () {};\n }\n\n var threshold = typeof sampling.mousemove === 'number' ? sampling.mousemove : 50;\n var callbackThreshold = typeof sampling.mousemoveCallback === 'number' ? sampling.mousemoveCallback : 500;\n var positions = [];\n var timeBaseline;\n var wrappedCb = throttle$1(callbackWrapper(function (source) {\n var totalOffset = Date.now() - timeBaseline;\n mousemoveCb(positions.map(function (p) {\n p.timeOffset -= totalOffset;\n return p;\n }), source);\n positions = [];\n timeBaseline = null;\n }), callbackThreshold);\n var updatePosition = callbackWrapper(throttle$1(callbackWrapper(function (evt) {\n var target = getEventTarget(evt);\n\n var _ref5 = legacy_isTouchEvent(evt) ? evt.changedTouches[0] : evt,\n clientX = _ref5.clientX,\n clientY = _ref5.clientY;\n\n if (!timeBaseline) {\n timeBaseline = nowTimestamp();\n }\n\n positions.push({\n x: clientX,\n y: clientY,\n id: mirror.getId(target),\n timeOffset: nowTimestamp() - timeBaseline\n });\n wrappedCb(typeof DragEvent !== 'undefined' && evt instanceof DragEvent ? IncrementalSource.Drag : evt instanceof MouseEvent ? IncrementalSource.MouseMove : IncrementalSource.TouchMove);\n }), threshold, {\n trailing: false\n }));\n var handlers = [on('mousemove', updatePosition, doc), on('touchmove', updatePosition, doc), on('drag', updatePosition, doc)];\n return callbackWrapper(function () {\n handlers.forEach(function (h) {\n return h();\n });\n });\n}\n\nfunction initMouseInteractionObserver(_ref6) {\n var mouseInteractionCb = _ref6.mouseInteractionCb,\n doc = _ref6.doc,\n mirror = _ref6.mirror,\n blockClass = _ref6.blockClass,\n blockSelector = _ref6.blockSelector,\n unblockSelector = _ref6.unblockSelector,\n sampling = _ref6.sampling;\n\n if (sampling.mouseInteraction === false) {\n return function () {};\n }\n\n var disableMap = sampling.mouseInteraction === true || sampling.mouseInteraction === undefined ? {} : sampling.mouseInteraction;\n var handlers = [];\n var currentPointerType = null;\n\n var getHandler = function getHandler(eventKey) {\n return function (event) {\n var target = getEventTarget(event);\n\n if (isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\n return;\n }\n\n var pointerType = null;\n var thisEventKey = eventKey;\n\n if ('pointerType' in event) {\n switch (event.pointerType) {\n case 'mouse':\n pointerType = PointerTypes.Mouse;\n break;\n\n case 'touch':\n pointerType = PointerTypes.Touch;\n break;\n\n case 'pen':\n pointerType = PointerTypes.Pen;\n break;\n }\n\n if (pointerType === PointerTypes.Touch) {\n if (MouseInteractions[eventKey] === MouseInteractions.MouseDown) {\n thisEventKey = 'TouchStart';\n } else if (MouseInteractions[eventKey] === MouseInteractions.MouseUp) {\n thisEventKey = 'TouchEnd';\n }\n } else if (pointerType === PointerTypes.Pen) ;\n } else if (legacy_isTouchEvent(event)) {\n pointerType = PointerTypes.Touch;\n }\n\n if (pointerType !== null) {\n currentPointerType = pointerType;\n\n if (thisEventKey.startsWith('Touch') && pointerType === PointerTypes.Touch || thisEventKey.startsWith('Mouse') && pointerType === PointerTypes.Mouse) {\n pointerType = null;\n }\n } else if (MouseInteractions[eventKey] === MouseInteractions.Click) {\n pointerType = currentPointerType;\n currentPointerType = null;\n }\n\n var e = legacy_isTouchEvent(event) ? event.changedTouches[0] : event;\n\n if (!e) {\n return;\n }\n\n var id = mirror.getId(target);\n var clientX = e.clientX,\n clientY = e.clientY;\n callbackWrapper(mouseInteractionCb)(Object.assign({\n type: MouseInteractions[thisEventKey],\n id: id,\n x: clientX,\n y: clientY\n }, pointerType !== null && {\n pointerType: pointerType\n }));\n };\n };\n\n Object.keys(MouseInteractions).filter(function (key) {\n return Number.isNaN(Number(key)) && !key.endsWith('_Departed') && disableMap[key] !== false;\n }).forEach(function (eventKey) {\n var eventName = toLowerCase(eventKey);\n var handler = getHandler(eventKey);\n\n if (window.PointerEvent) {\n switch (MouseInteractions[eventKey]) {\n case MouseInteractions.MouseDown:\n case MouseInteractions.MouseUp:\n eventName = eventName.replace('mouse', 'pointer');\n break;\n\n case MouseInteractions.TouchStart:\n case MouseInteractions.TouchEnd:\n return;\n }\n }\n\n handlers.push(on(eventName, handler, doc));\n });\n return callbackWrapper(function () {\n handlers.forEach(function (h) {\n return h();\n });\n });\n}\n\nfunction initScrollObserver(_ref7) {\n var scrollCb = _ref7.scrollCb,\n doc = _ref7.doc,\n mirror = _ref7.mirror,\n blockClass = _ref7.blockClass,\n blockSelector = _ref7.blockSelector,\n unblockSelector = _ref7.unblockSelector,\n sampling = _ref7.sampling;\n var updatePosition = callbackWrapper(throttle$1(callbackWrapper(function (evt) {\n var target = getEventTarget(evt);\n\n if (!target || isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\n return;\n }\n\n var id = mirror.getId(target);\n\n if (target === doc && doc.defaultView) {\n var scrollLeftTop = getWindowScroll(doc.defaultView);\n scrollCb({\n id: id,\n x: scrollLeftTop.left,\n y: scrollLeftTop.top\n });\n } else {\n scrollCb({\n id: id,\n x: target.scrollLeft,\n y: target.scrollTop\n });\n }\n }), sampling.scroll || 100));\n return on('scroll', updatePosition, doc);\n}\n\nfunction initViewportResizeObserver(_ref8, _ref9) {\n var viewportResizeCb = _ref8.viewportResizeCb;\n var win = _ref9.win;\n var lastH = -1;\n var lastW = -1;\n var updateDimension = callbackWrapper(throttle$1(callbackWrapper(function () {\n var height = getWindowHeight();\n var width = getWindowWidth();\n\n if (lastH !== height || lastW !== width) {\n viewportResizeCb({\n width: Number(width),\n height: Number(height)\n });\n lastH = height;\n lastW = width;\n }\n }), 200));\n return on('resize', updateDimension, win);\n}\n\nfunction wrapEventWithUserTriggeredFlag(v, enable) {\n var value = Object.assign({}, v);\n if (!enable) delete value.userTriggered;\n return value;\n}\n\nvar INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];\nvar lastInputValueMap = new WeakMap();\n\nfunction initInputObserver(_ref10) {\n var inputCb = _ref10.inputCb,\n doc = _ref10.doc,\n mirror = _ref10.mirror,\n blockClass = _ref10.blockClass,\n blockSelector = _ref10.blockSelector,\n unblockSelector = _ref10.unblockSelector,\n ignoreClass = _ref10.ignoreClass,\n ignoreSelector = _ref10.ignoreSelector,\n maskInputOptions = _ref10.maskInputOptions,\n maskInputFn = _ref10.maskInputFn,\n sampling = _ref10.sampling,\n userTriggeredOnInput = _ref10.userTriggeredOnInput,\n maskTextClass = _ref10.maskTextClass,\n unmaskTextClass = _ref10.unmaskTextClass,\n maskTextSelector = _ref10.maskTextSelector,\n unmaskTextSelector = _ref10.unmaskTextSelector;\n\n function eventHandler(event) {\n var target = getEventTarget(event);\n var userTriggered = event.isTrusted;\n var tagName = target && toUpperCase(target.tagName);\n if (tagName === 'OPTION') target = target.parentElement;\n\n if (!target || !tagName || INPUT_TAGS.indexOf(tagName) < 0 || isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\n return;\n }\n\n var el = target;\n\n if (el.classList.contains(ignoreClass) || ignoreSelector && el.matches(ignoreSelector)) {\n return;\n }\n\n var type = getInputType(target);\n var text = getInputValue(el, tagName, type);\n var isChecked = false;\n var isInputMasked = shouldMaskInput({\n maskInputOptions: maskInputOptions,\n tagName: tagName,\n type: type\n });\n var forceMask = needMaskingText(target, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, isInputMasked);\n\n if (type === 'radio' || type === 'checkbox') {\n isChecked = target.checked;\n }\n\n text = maskInputValue({\n isMasked: forceMask,\n element: target,\n value: text,\n maskInputFn: maskInputFn\n });\n cbWithDedup(target, callbackWrapper(wrapEventWithUserTriggeredFlag)({\n text: text,\n isChecked: isChecked,\n userTriggered: userTriggered\n }, userTriggeredOnInput));\n var name = target.name;\n\n if (type === 'radio' && name && isChecked) {\n doc.querySelectorAll(\"input[type=\\\"radio\\\"][name=\\\"\".concat(name, \"\\\"]\")).forEach(function (el) {\n if (el !== target) {\n var _text = maskInputValue({\n isMasked: forceMask,\n element: el,\n value: getInputValue(el, tagName, type),\n maskInputFn: maskInputFn\n });\n\n cbWithDedup(el, callbackWrapper(wrapEventWithUserTriggeredFlag)({\n text: _text,\n isChecked: !isChecked,\n userTriggered: false\n }, userTriggeredOnInput));\n }\n });\n }\n }\n\n function cbWithDedup(target, v) {\n var lastInputValue = lastInputValueMap.get(target);\n\n if (!lastInputValue || lastInputValue.text !== v.text || lastInputValue.isChecked !== v.isChecked) {\n lastInputValueMap.set(target, v);\n var id = mirror.getId(target);\n callbackWrapper(inputCb)(Object.assign(Object.assign({}, v), {\n id: id\n }));\n }\n }\n\n var events = sampling.input === 'last' ? ['change'] : ['input', 'change'];\n var handlers = events.map(function (eventName) {\n return on(eventName, callbackWrapper(eventHandler), doc);\n });\n var currentWindow = doc.defaultView;\n\n if (!currentWindow) {\n return function () {\n handlers.forEach(function (h) {\n return h();\n });\n };\n }\n\n var propertyDescriptor = currentWindow.Object.getOwnPropertyDescriptor(currentWindow.HTMLInputElement.prototype, 'value');\n var hookProperties = [[currentWindow.HTMLInputElement.prototype, 'value'], [currentWindow.HTMLInputElement.prototype, 'checked'], [currentWindow.HTMLSelectElement.prototype, 'value'], [currentWindow.HTMLTextAreaElement.prototype, 'value'], [currentWindow.HTMLSelectElement.prototype, 'selectedIndex'], [currentWindow.HTMLOptionElement.prototype, 'selected']];\n\n if (propertyDescriptor && propertyDescriptor.set) {\n handlers.push.apply(handlers, _toConsumableArray(hookProperties.map(function (p) {\n return hookSetter(p[0], p[1], {\n set: function set() {\n callbackWrapper(eventHandler)({\n target: this,\n isTrusted: false\n });\n }\n }, false, currentWindow);\n })));\n }\n\n return callbackWrapper(function () {\n handlers.forEach(function (h) {\n return h();\n });\n });\n}\n\nfunction getNestedCSSRulePositions(rule) {\n var positions = [];\n\n function recurse(childRule, pos) {\n if (hasNestedCSSRule('CSSGroupingRule') && childRule.parentRule instanceof CSSGroupingRule || hasNestedCSSRule('CSSMediaRule') && childRule.parentRule instanceof CSSMediaRule || hasNestedCSSRule('CSSSupportsRule') && childRule.parentRule instanceof CSSSupportsRule || hasNestedCSSRule('CSSConditionRule') && childRule.parentRule instanceof CSSConditionRule) {\n var rules = Array.from(childRule.parentRule.cssRules);\n var index = rules.indexOf(childRule);\n pos.unshift(index);\n } else if (childRule.parentStyleSheet) {\n var _rules = Array.from(childRule.parentStyleSheet.cssRules);\n\n var _index = _rules.indexOf(childRule);\n\n pos.unshift(_index);\n }\n\n return pos;\n }\n\n return recurse(rule, positions);\n}\n\nfunction getIdAndStyleId(sheet, mirror, styleMirror) {\n var id, styleId;\n if (!sheet) return {};\n if (sheet.ownerNode) id = mirror.getId(sheet.ownerNode);else styleId = styleMirror.getId(sheet);\n return {\n styleId: styleId,\n id: id\n };\n}\n\nfunction initStyleSheetObserver(_ref11, _ref12) {\n var styleSheetRuleCb = _ref11.styleSheetRuleCb,\n mirror = _ref11.mirror,\n stylesheetManager = _ref11.stylesheetManager;\n var win = _ref12.win;\n\n if (!win.CSSStyleSheet || !win.CSSStyleSheet.prototype) {\n return function () {};\n }\n\n var insertRule = win.CSSStyleSheet.prototype.insertRule;\n win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, {\n apply: callbackWrapper(function (target, thisArg, argumentsList) {\n var _argumentsList = _slicedToArray(argumentsList, 2),\n rule = _argumentsList[0],\n index = _argumentsList[1];\n\n var _getIdAndStyleId = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror),\n id = _getIdAndStyleId.id,\n styleId = _getIdAndStyleId.styleId;\n\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleSheetRuleCb({\n id: id,\n styleId: styleId,\n adds: [{\n rule: rule,\n index: index\n }]\n });\n }\n\n return target.apply(thisArg, argumentsList);\n })\n });\n var deleteRule = win.CSSStyleSheet.prototype.deleteRule;\n win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, {\n apply: callbackWrapper(function (target, thisArg, argumentsList) {\n var _argumentsList2 = _slicedToArray(argumentsList, 1),\n index = _argumentsList2[0];\n\n var _getIdAndStyleId2 = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror),\n id = _getIdAndStyleId2.id,\n styleId = _getIdAndStyleId2.styleId;\n\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleSheetRuleCb({\n id: id,\n styleId: styleId,\n removes: [{\n index: index\n }]\n });\n }\n\n return target.apply(thisArg, argumentsList);\n })\n });\n var replace;\n\n if (win.CSSStyleSheet.prototype.replace) {\n replace = win.CSSStyleSheet.prototype.replace;\n win.CSSStyleSheet.prototype.replace = new Proxy(replace, {\n apply: callbackWrapper(function (target, thisArg, argumentsList) {\n var _argumentsList3 = _slicedToArray(argumentsList, 1),\n text = _argumentsList3[0];\n\n var _getIdAndStyleId3 = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror),\n id = _getIdAndStyleId3.id,\n styleId = _getIdAndStyleId3.styleId;\n\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleSheetRuleCb({\n id: id,\n styleId: styleId,\n replace: text\n });\n }\n\n return target.apply(thisArg, argumentsList);\n })\n });\n }\n\n var replaceSync;\n\n if (win.CSSStyleSheet.prototype.replaceSync) {\n replaceSync = win.CSSStyleSheet.prototype.replaceSync;\n win.CSSStyleSheet.prototype.replaceSync = new Proxy(replaceSync, {\n apply: callbackWrapper(function (target, thisArg, argumentsList) {\n var _argumentsList4 = _slicedToArray(argumentsList, 1),\n text = _argumentsList4[0];\n\n var _getIdAndStyleId4 = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror),\n id = _getIdAndStyleId4.id,\n styleId = _getIdAndStyleId4.styleId;\n\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleSheetRuleCb({\n id: id,\n styleId: styleId,\n replaceSync: text\n });\n }\n\n return target.apply(thisArg, argumentsList);\n })\n });\n }\n\n var supportedNestedCSSRuleTypes = {};\n\n if (canMonkeyPatchNestedCSSRule('CSSGroupingRule')) {\n supportedNestedCSSRuleTypes.CSSGroupingRule = win.CSSGroupingRule;\n } else {\n if (canMonkeyPatchNestedCSSRule('CSSMediaRule')) {\n supportedNestedCSSRuleTypes.CSSMediaRule = win.CSSMediaRule;\n }\n\n if (canMonkeyPatchNestedCSSRule('CSSConditionRule')) {\n supportedNestedCSSRuleTypes.CSSConditionRule = win.CSSConditionRule;\n }\n\n if (canMonkeyPatchNestedCSSRule('CSSSupportsRule')) {\n supportedNestedCSSRuleTypes.CSSSupportsRule = win.CSSSupportsRule;\n }\n }\n\n var unmodifiedFunctions = {};\n Object.entries(supportedNestedCSSRuleTypes).forEach(function (_ref13) {\n var _ref14 = _slicedToArray(_ref13, 2),\n typeKey = _ref14[0],\n type = _ref14[1];\n\n unmodifiedFunctions[typeKey] = {\n insertRule: type.prototype.insertRule,\n deleteRule: type.prototype.deleteRule\n };\n type.prototype.insertRule = new Proxy(unmodifiedFunctions[typeKey].insertRule, {\n apply: callbackWrapper(function (target, thisArg, argumentsList) {\n var _argumentsList5 = _slicedToArray(argumentsList, 2),\n rule = _argumentsList5[0],\n index = _argumentsList5[1];\n\n var _getIdAndStyleId5 = getIdAndStyleId(thisArg.parentStyleSheet, mirror, stylesheetManager.styleMirror),\n id = _getIdAndStyleId5.id,\n styleId = _getIdAndStyleId5.styleId;\n\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleSheetRuleCb({\n id: id,\n styleId: styleId,\n adds: [{\n rule: rule,\n index: [].concat(_toConsumableArray(getNestedCSSRulePositions(thisArg)), [index || 0])\n }]\n });\n }\n\n return target.apply(thisArg, argumentsList);\n })\n });\n type.prototype.deleteRule = new Proxy(unmodifiedFunctions[typeKey].deleteRule, {\n apply: callbackWrapper(function (target, thisArg, argumentsList) {\n var _argumentsList6 = _slicedToArray(argumentsList, 1),\n index = _argumentsList6[0];\n\n var _getIdAndStyleId6 = getIdAndStyleId(thisArg.parentStyleSheet, mirror, stylesheetManager.styleMirror),\n id = _getIdAndStyleId6.id,\n styleId = _getIdAndStyleId6.styleId;\n\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleSheetRuleCb({\n id: id,\n styleId: styleId,\n removes: [{\n index: [].concat(_toConsumableArray(getNestedCSSRulePositions(thisArg)), [index])\n }]\n });\n }\n\n return target.apply(thisArg, argumentsList);\n })\n });\n });\n return callbackWrapper(function () {\n win.CSSStyleSheet.prototype.insertRule = insertRule;\n win.CSSStyleSheet.prototype.deleteRule = deleteRule;\n replace && (win.CSSStyleSheet.prototype.replace = replace);\n replaceSync && (win.CSSStyleSheet.prototype.replaceSync = replaceSync);\n Object.entries(supportedNestedCSSRuleTypes).forEach(function (_ref15) {\n var _ref16 = _slicedToArray(_ref15, 2),\n typeKey = _ref16[0],\n type = _ref16[1];\n\n type.prototype.insertRule = unmodifiedFunctions[typeKey].insertRule;\n type.prototype.deleteRule = unmodifiedFunctions[typeKey].deleteRule;\n });\n });\n}\n\nfunction initAdoptedStyleSheetObserver(_ref17, host) {\n var mirror = _ref17.mirror,\n stylesheetManager = _ref17.stylesheetManager;\n\n var _a, _b, _c;\n\n var hostId = null;\n if (host.nodeName === '#document') hostId = mirror.getId(host);else hostId = mirror.getId(host.host);\n var patchTarget = host.nodeName === '#document' ? (_a = host.defaultView) === null || _a === void 0 ? void 0 : _a.Document : (_c = (_b = host.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView) === null || _c === void 0 ? void 0 : _c.ShadowRoot;\n var originalPropertyDescriptor = (patchTarget === null || patchTarget === void 0 ? void 0 : patchTarget.prototype) ? Object.getOwnPropertyDescriptor(patchTarget === null || patchTarget === void 0 ? void 0 : patchTarget.prototype, 'adoptedStyleSheets') : undefined;\n if (hostId === null || hostId === -1 || !patchTarget || !originalPropertyDescriptor) return function () {};\n Object.defineProperty(host, 'adoptedStyleSheets', {\n configurable: originalPropertyDescriptor.configurable,\n enumerable: originalPropertyDescriptor.enumerable,\n get: function get() {\n var _a;\n\n return (_a = originalPropertyDescriptor.get) === null || _a === void 0 ? void 0 : _a.call(this);\n },\n set: function set(sheets) {\n var _a;\n\n var result = (_a = originalPropertyDescriptor.set) === null || _a === void 0 ? void 0 : _a.call(this, sheets);\n\n if (hostId !== null && hostId !== -1) {\n try {\n stylesheetManager.adoptStyleSheets(sheets, hostId);\n } catch (e) {}\n }\n\n return result;\n }\n });\n return callbackWrapper(function () {\n Object.defineProperty(host, 'adoptedStyleSheets', {\n configurable: originalPropertyDescriptor.configurable,\n enumerable: originalPropertyDescriptor.enumerable,\n get: originalPropertyDescriptor.get,\n set: originalPropertyDescriptor.set\n });\n });\n}\n\nfunction initStyleDeclarationObserver(_ref18, _ref19) {\n var styleDeclarationCb = _ref18.styleDeclarationCb,\n mirror = _ref18.mirror,\n ignoreCSSAttributes = _ref18.ignoreCSSAttributes,\n stylesheetManager = _ref18.stylesheetManager;\n var win = _ref19.win;\n var setProperty = win.CSSStyleDeclaration.prototype.setProperty;\n win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, {\n apply: callbackWrapper(function (target, thisArg, argumentsList) {\n var _a;\n\n var _argumentsList7 = _slicedToArray(argumentsList, 3),\n property = _argumentsList7[0],\n value = _argumentsList7[1],\n priority = _argumentsList7[2];\n\n if (ignoreCSSAttributes.has(property)) {\n return setProperty.apply(thisArg, [property, value, priority]);\n }\n\n var _getIdAndStyleId7 = getIdAndStyleId((_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet, mirror, stylesheetManager.styleMirror),\n id = _getIdAndStyleId7.id,\n styleId = _getIdAndStyleId7.styleId;\n\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleDeclarationCb({\n id: id,\n styleId: styleId,\n set: {\n property: property,\n value: value,\n priority: priority\n },\n index: getNestedCSSRulePositions(thisArg.parentRule)\n });\n }\n\n return target.apply(thisArg, argumentsList);\n })\n });\n var removeProperty = win.CSSStyleDeclaration.prototype.removeProperty;\n win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, {\n apply: callbackWrapper(function (target, thisArg, argumentsList) {\n var _a;\n\n var _argumentsList8 = _slicedToArray(argumentsList, 1),\n property = _argumentsList8[0];\n\n if (ignoreCSSAttributes.has(property)) {\n return removeProperty.apply(thisArg, [property]);\n }\n\n var _getIdAndStyleId8 = getIdAndStyleId((_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet, mirror, stylesheetManager.styleMirror),\n id = _getIdAndStyleId8.id,\n styleId = _getIdAndStyleId8.styleId;\n\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleDeclarationCb({\n id: id,\n styleId: styleId,\n remove: {\n property: property\n },\n index: getNestedCSSRulePositions(thisArg.parentRule)\n });\n }\n\n return target.apply(thisArg, argumentsList);\n })\n });\n return callbackWrapper(function () {\n win.CSSStyleDeclaration.prototype.setProperty = setProperty;\n win.CSSStyleDeclaration.prototype.removeProperty = removeProperty;\n });\n}\n\nfunction initMediaInteractionObserver(_ref20) {\n var mediaInteractionCb = _ref20.mediaInteractionCb,\n blockClass = _ref20.blockClass,\n blockSelector = _ref20.blockSelector,\n unblockSelector = _ref20.unblockSelector,\n mirror = _ref20.mirror,\n sampling = _ref20.sampling,\n doc = _ref20.doc;\n var handler = callbackWrapper(function (type) {\n return throttle$1(callbackWrapper(function (event) {\n var target = getEventTarget(event);\n\n if (!target || isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\n return;\n }\n\n var currentTime = target.currentTime,\n volume = target.volume,\n muted = target.muted,\n playbackRate = target.playbackRate;\n mediaInteractionCb({\n type: type,\n id: mirror.getId(target),\n currentTime: currentTime,\n volume: volume,\n muted: muted,\n playbackRate: playbackRate\n });\n }), sampling.media || 500);\n });\n var handlers = [on('play', handler(0), doc), on('pause', handler(1), doc), on('seeked', handler(2), doc), on('volumechange', handler(3), doc), on('ratechange', handler(4), doc)];\n return callbackWrapper(function () {\n handlers.forEach(function (h) {\n return h();\n });\n });\n}\n\nfunction initFontObserver(_ref21) {\n var fontCb = _ref21.fontCb,\n doc = _ref21.doc;\n var win = doc.defaultView;\n\n if (!win) {\n return function () {};\n }\n\n var handlers = [];\n var fontMap = new WeakMap();\n var originalFontFace = win.FontFace;\n\n win.FontFace = function FontFace(family, source, descriptors) {\n var fontFace = new originalFontFace(family, source, descriptors);\n fontMap.set(fontFace, {\n family: family,\n buffer: typeof source !== 'string',\n descriptors: descriptors,\n fontSource: typeof source === 'string' ? source : JSON.stringify(Array.from(new Uint8Array(source)))\n });\n return fontFace;\n };\n\n var restoreHandler = patch(doc.fonts, 'add', function (original) {\n return function (fontFace) {\n setTimeout(callbackWrapper(function () {\n var p = fontMap.get(fontFace);\n\n if (p) {\n fontCb(p);\n fontMap.delete(fontFace);\n }\n }), 0);\n return original.apply(this, [fontFace]);\n };\n });\n handlers.push(function () {\n win.FontFace = originalFontFace;\n });\n handlers.push(restoreHandler);\n return callbackWrapper(function () {\n handlers.forEach(function (h) {\n return h();\n });\n });\n}\n\nfunction initSelectionObserver(param) {\n var doc = param.doc,\n mirror = param.mirror,\n blockClass = param.blockClass,\n blockSelector = param.blockSelector,\n unblockSelector = param.unblockSelector,\n selectionCb = param.selectionCb;\n var collapsed = true;\n var updateSelection = callbackWrapper(function () {\n var selection = doc.getSelection();\n if (!selection || collapsed && (selection === null || selection === void 0 ? void 0 : selection.isCollapsed)) return;\n collapsed = selection.isCollapsed || false;\n var ranges = [];\n var count = selection.rangeCount || 0;\n\n for (var _i6 = 0; _i6 < count; _i6++) {\n var range = selection.getRangeAt(_i6);\n var startContainer = range.startContainer,\n startOffset = range.startOffset,\n endContainer = range.endContainer,\n endOffset = range.endOffset;\n var blocked = isBlocked(startContainer, blockClass, blockSelector, unblockSelector, true) || isBlocked(endContainer, blockClass, blockSelector, unblockSelector, true);\n if (blocked) continue;\n ranges.push({\n start: mirror.getId(startContainer),\n startOffset: startOffset,\n end: mirror.getId(endContainer),\n endOffset: endOffset\n });\n }\n\n selectionCb({\n ranges: ranges\n });\n });\n updateSelection();\n return on('selectionchange', updateSelection);\n}\n\nfunction initCustomElementObserver(_ref22) {\n var doc = _ref22.doc,\n customElementCb = _ref22.customElementCb;\n var win = doc.defaultView;\n\n if (!win || !win.customElements) {\n return function () {};\n }\n\n var restoreHandler = patch(win.customElements, 'define', function (original) {\n return function (name, constructor, options) {\n try {\n customElementCb({\n define: {\n name: name\n }\n });\n } catch (e) {}\n\n return original.apply(this, [name, constructor, options]);\n };\n });\n return restoreHandler;\n}\n\nfunction mergeHooks(o, hooks) {\n var mutationCb = o.mutationCb,\n mousemoveCb = o.mousemoveCb,\n mouseInteractionCb = o.mouseInteractionCb,\n scrollCb = o.scrollCb,\n viewportResizeCb = o.viewportResizeCb,\n inputCb = o.inputCb,\n mediaInteractionCb = o.mediaInteractionCb,\n styleSheetRuleCb = o.styleSheetRuleCb,\n styleDeclarationCb = o.styleDeclarationCb,\n canvasMutationCb = o.canvasMutationCb,\n fontCb = o.fontCb,\n selectionCb = o.selectionCb,\n customElementCb = o.customElementCb;\n\n o.mutationCb = function () {\n if (hooks.mutation) {\n hooks.mutation.apply(hooks, arguments);\n }\n\n mutationCb.apply(void 0, arguments);\n };\n\n o.mousemoveCb = function () {\n if (hooks.mousemove) {\n hooks.mousemove.apply(hooks, arguments);\n }\n\n mousemoveCb.apply(void 0, arguments);\n };\n\n o.mouseInteractionCb = function () {\n if (hooks.mouseInteraction) {\n hooks.mouseInteraction.apply(hooks, arguments);\n }\n\n mouseInteractionCb.apply(void 0, arguments);\n };\n\n o.scrollCb = function () {\n if (hooks.scroll) {\n hooks.scroll.apply(hooks, arguments);\n }\n\n scrollCb.apply(void 0, arguments);\n };\n\n o.viewportResizeCb = function () {\n if (hooks.viewportResize) {\n hooks.viewportResize.apply(hooks, arguments);\n }\n\n viewportResizeCb.apply(void 0, arguments);\n };\n\n o.inputCb = function () {\n if (hooks.input) {\n hooks.input.apply(hooks, arguments);\n }\n\n inputCb.apply(void 0, arguments);\n };\n\n o.mediaInteractionCb = function () {\n if (hooks.mediaInteaction) {\n hooks.mediaInteaction.apply(hooks, arguments);\n }\n\n mediaInteractionCb.apply(void 0, arguments);\n };\n\n o.styleSheetRuleCb = function () {\n if (hooks.styleSheetRule) {\n hooks.styleSheetRule.apply(hooks, arguments);\n }\n\n styleSheetRuleCb.apply(void 0, arguments);\n };\n\n o.styleDeclarationCb = function () {\n if (hooks.styleDeclaration) {\n hooks.styleDeclaration.apply(hooks, arguments);\n }\n\n styleDeclarationCb.apply(void 0, arguments);\n };\n\n o.canvasMutationCb = function () {\n if (hooks.canvasMutation) {\n hooks.canvasMutation.apply(hooks, arguments);\n }\n\n canvasMutationCb.apply(void 0, arguments);\n };\n\n o.fontCb = function () {\n if (hooks.font) {\n hooks.font.apply(hooks, arguments);\n }\n\n fontCb.apply(void 0, arguments);\n };\n\n o.selectionCb = function () {\n if (hooks.selection) {\n hooks.selection.apply(hooks, arguments);\n }\n\n selectionCb.apply(void 0, arguments);\n };\n\n o.customElementCb = function () {\n if (hooks.customElement) {\n hooks.customElement.apply(hooks, arguments);\n }\n\n customElementCb.apply(void 0, arguments);\n };\n}\n\nfunction initObservers(o) {\n var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var currentWindow = o.doc.defaultView;\n\n if (!currentWindow) {\n return function () {};\n }\n\n mergeHooks(o, hooks);\n var mutationObserver = initMutationObserver(o, o.doc);\n var mousemoveHandler = initMoveObserver(o);\n var mouseInteractionHandler = initMouseInteractionObserver(o);\n var scrollHandler = initScrollObserver(o);\n var viewportResizeHandler = initViewportResizeObserver(o, {\n win: currentWindow\n });\n var inputHandler = initInputObserver(o);\n var mediaInteractionHandler = initMediaInteractionObserver(o);\n var styleSheetObserver = initStyleSheetObserver(o, {\n win: currentWindow\n });\n var adoptedStyleSheetObserver = initAdoptedStyleSheetObserver(o, o.doc);\n var styleDeclarationObserver = initStyleDeclarationObserver(o, {\n win: currentWindow\n });\n var fontObserver = o.collectFonts ? initFontObserver(o) : function () {};\n var selectionObserver = initSelectionObserver(o);\n var customElementObserver = initCustomElementObserver(o);\n var pluginHandlers = [];\n\n var _iterator4 = _createForOfIteratorHelper(o.plugins),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var plugin = _step4.value;\n pluginHandlers.push(plugin.observer(plugin.callback, currentWindow, plugin.options));\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n\n return callbackWrapper(function () {\n mutationBuffers.forEach(function (b) {\n return b.reset();\n });\n mutationObserver.disconnect();\n mousemoveHandler();\n mouseInteractionHandler();\n scrollHandler();\n viewportResizeHandler();\n inputHandler();\n mediaInteractionHandler();\n styleSheetObserver();\n adoptedStyleSheetObserver();\n styleDeclarationObserver();\n fontObserver();\n selectionObserver();\n customElementObserver();\n pluginHandlers.forEach(function (h) {\n return h();\n });\n });\n}\n\nfunction hasNestedCSSRule(prop) {\n return typeof window[prop] !== 'undefined';\n}\n\nfunction canMonkeyPatchNestedCSSRule(prop) {\n return Boolean(typeof window[prop] !== 'undefined' && window[prop].prototype && 'insertRule' in window[prop].prototype && 'deleteRule' in window[prop].prototype);\n}\n\nvar CrossOriginIframeMirror = /*#__PURE__*/function () {\n function CrossOriginIframeMirror(generateIdFn) {\n _classCallCheck(this, CrossOriginIframeMirror);\n\n this.generateIdFn = generateIdFn;\n this.iframeIdToRemoteIdMap = new WeakMap();\n this.iframeRemoteIdToIdMap = new WeakMap();\n }\n\n _createClass(CrossOriginIframeMirror, [{\n key: \"getId\",\n value: function getId(iframe, remoteId, idToRemoteMap, remoteToIdMap) {\n var idToRemoteIdMap = idToRemoteMap || this.getIdToRemoteIdMap(iframe);\n var remoteIdToIdMap = remoteToIdMap || this.getRemoteIdToIdMap(iframe);\n var id = idToRemoteIdMap.get(remoteId);\n\n if (!id) {\n id = this.generateIdFn();\n idToRemoteIdMap.set(remoteId, id);\n remoteIdToIdMap.set(id, remoteId);\n }\n\n return id;\n }\n }, {\n key: \"getIds\",\n value: function getIds(iframe, remoteId) {\n var _this6 = this;\n\n var idToRemoteIdMap = this.getIdToRemoteIdMap(iframe);\n var remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\n return remoteId.map(function (id) {\n return _this6.getId(iframe, id, idToRemoteIdMap, remoteIdToIdMap);\n });\n }\n }, {\n key: \"getRemoteId\",\n value: function getRemoteId(iframe, id, map) {\n var remoteIdToIdMap = map || this.getRemoteIdToIdMap(iframe);\n if (typeof id !== 'number') return id;\n var remoteId = remoteIdToIdMap.get(id);\n if (!remoteId) return -1;\n return remoteId;\n }\n }, {\n key: \"getRemoteIds\",\n value: function getRemoteIds(iframe, ids) {\n var _this7 = this;\n\n var remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\n return ids.map(function (id) {\n return _this7.getRemoteId(iframe, id, remoteIdToIdMap);\n });\n }\n }, {\n key: \"reset\",\n value: function reset(iframe) {\n if (!iframe) {\n this.iframeIdToRemoteIdMap = new WeakMap();\n this.iframeRemoteIdToIdMap = new WeakMap();\n return;\n }\n\n this.iframeIdToRemoteIdMap.delete(iframe);\n this.iframeRemoteIdToIdMap.delete(iframe);\n }\n }, {\n key: \"getIdToRemoteIdMap\",\n value: function getIdToRemoteIdMap(iframe) {\n var idToRemoteIdMap = this.iframeIdToRemoteIdMap.get(iframe);\n\n if (!idToRemoteIdMap) {\n idToRemoteIdMap = new Map();\n this.iframeIdToRemoteIdMap.set(iframe, idToRemoteIdMap);\n }\n\n return idToRemoteIdMap;\n }\n }, {\n key: \"getRemoteIdToIdMap\",\n value: function getRemoteIdToIdMap(iframe) {\n var remoteIdToIdMap = this.iframeRemoteIdToIdMap.get(iframe);\n\n if (!remoteIdToIdMap) {\n remoteIdToIdMap = new Map();\n this.iframeRemoteIdToIdMap.set(iframe, remoteIdToIdMap);\n }\n\n return remoteIdToIdMap;\n }\n }]);\n\n return CrossOriginIframeMirror;\n}();\n\nvar IframeManagerNoop = /*#__PURE__*/function () {\n function IframeManagerNoop() {\n _classCallCheck(this, IframeManagerNoop);\n\n this.crossOriginIframeMirror = new CrossOriginIframeMirror(genId);\n this.crossOriginIframeRootIdMap = new WeakMap();\n }\n\n _createClass(IframeManagerNoop, [{\n key: \"addIframe\",\n value: function addIframe() {}\n }, {\n key: \"addLoadListener\",\n value: function addLoadListener() {}\n }, {\n key: \"attachIframe\",\n value: function attachIframe() {}\n }]);\n\n return IframeManagerNoop;\n}();\n\nvar IframeManager = /*#__PURE__*/function () {\n function IframeManager(options) {\n _classCallCheck(this, IframeManager);\n\n this.iframes = new WeakMap();\n this.crossOriginIframeMap = new WeakMap();\n this.crossOriginIframeMirror = new CrossOriginIframeMirror(genId);\n this.crossOriginIframeRootIdMap = new WeakMap();\n this.mutationCb = options.mutationCb;\n this.wrappedEmit = options.wrappedEmit;\n this.stylesheetManager = options.stylesheetManager;\n this.recordCrossOriginIframes = options.recordCrossOriginIframes;\n this.crossOriginIframeStyleMirror = new CrossOriginIframeMirror(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror));\n this.mirror = options.mirror;\n\n if (this.recordCrossOriginIframes) {\n window.addEventListener('message', this.handleMessage.bind(this));\n }\n }\n\n _createClass(IframeManager, [{\n key: \"addIframe\",\n value: function addIframe(iframeEl) {\n this.iframes.set(iframeEl, true);\n if (iframeEl.contentWindow) this.crossOriginIframeMap.set(iframeEl.contentWindow, iframeEl);\n }\n }, {\n key: \"addLoadListener\",\n value: function addLoadListener(cb) {\n this.loadListener = cb;\n }\n }, {\n key: \"attachIframe\",\n value: function attachIframe(iframeEl, childSn) {\n var _a;\n\n this.mutationCb({\n adds: [{\n parentId: this.mirror.getId(iframeEl),\n nextId: null,\n node: childSn\n }],\n removes: [],\n texts: [],\n attributes: [],\n isAttachIframe: true\n });\n (_a = this.loadListener) === null || _a === void 0 ? void 0 : _a.call(this, iframeEl);\n if (iframeEl.contentDocument && iframeEl.contentDocument.adoptedStyleSheets && iframeEl.contentDocument.adoptedStyleSheets.length > 0) this.stylesheetManager.adoptStyleSheets(iframeEl.contentDocument.adoptedStyleSheets, this.mirror.getId(iframeEl.contentDocument));\n }\n }, {\n key: \"handleMessage\",\n value: function handleMessage(message) {\n var crossOriginMessageEvent = message;\n if (crossOriginMessageEvent.data.type !== 'rrweb' || crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin) return;\n var iframeSourceWindow = message.source;\n if (!iframeSourceWindow) return;\n var iframeEl = this.crossOriginIframeMap.get(message.source);\n if (!iframeEl) return;\n var transformedEvent = this.transformCrossOriginEvent(iframeEl, crossOriginMessageEvent.data.event);\n if (transformedEvent) this.wrappedEmit(transformedEvent, crossOriginMessageEvent.data.isCheckout);\n }\n }, {\n key: \"transformCrossOriginEvent\",\n value: function transformCrossOriginEvent(iframeEl, e) {\n var _this8 = this;\n\n var _a;\n\n switch (e.type) {\n case EventType.FullSnapshot:\n {\n this.crossOriginIframeMirror.reset(iframeEl);\n this.crossOriginIframeStyleMirror.reset(iframeEl);\n this.replaceIdOnNode(e.data.node, iframeEl);\n var rootId = e.data.node.id;\n this.crossOriginIframeRootIdMap.set(iframeEl, rootId);\n this.patchRootIdOnNode(e.data.node, rootId);\n return {\n timestamp: e.timestamp,\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.Mutation,\n adds: [{\n parentId: this.mirror.getId(iframeEl),\n nextId: null,\n node: e.data.node\n }],\n removes: [],\n texts: [],\n attributes: [],\n isAttachIframe: true\n }\n };\n }\n\n case EventType.Meta:\n case EventType.Load:\n case EventType.DomContentLoaded:\n {\n return false;\n }\n\n case EventType.Plugin:\n {\n return e;\n }\n\n case EventType.Custom:\n {\n this.replaceIds(e.data.payload, iframeEl, ['id', 'parentId', 'previousId', 'nextId']);\n return e;\n }\n\n case EventType.IncrementalSnapshot:\n {\n switch (e.data.source) {\n case IncrementalSource.Mutation:\n {\n e.data.adds.forEach(function (n) {\n _this8.replaceIds(n, iframeEl, ['parentId', 'nextId', 'previousId']);\n\n _this8.replaceIdOnNode(n.node, iframeEl);\n\n var rootId = _this8.crossOriginIframeRootIdMap.get(iframeEl);\n\n rootId && _this8.patchRootIdOnNode(n.node, rootId);\n });\n e.data.removes.forEach(function (n) {\n _this8.replaceIds(n, iframeEl, ['parentId', 'id']);\n });\n e.data.attributes.forEach(function (n) {\n _this8.replaceIds(n, iframeEl, ['id']);\n });\n e.data.texts.forEach(function (n) {\n _this8.replaceIds(n, iframeEl, ['id']);\n });\n return e;\n }\n\n case IncrementalSource.Drag:\n case IncrementalSource.TouchMove:\n case IncrementalSource.MouseMove:\n {\n e.data.positions.forEach(function (p) {\n _this8.replaceIds(p, iframeEl, ['id']);\n });\n return e;\n }\n\n case IncrementalSource.ViewportResize:\n {\n return false;\n }\n\n case IncrementalSource.MediaInteraction:\n case IncrementalSource.MouseInteraction:\n case IncrementalSource.Scroll:\n case IncrementalSource.CanvasMutation:\n case IncrementalSource.Input:\n {\n this.replaceIds(e.data, iframeEl, ['id']);\n return e;\n }\n\n case IncrementalSource.StyleSheetRule:\n case IncrementalSource.StyleDeclaration:\n {\n this.replaceIds(e.data, iframeEl, ['id']);\n this.replaceStyleIds(e.data, iframeEl, ['styleId']);\n return e;\n }\n\n case IncrementalSource.Font:\n {\n return e;\n }\n\n case IncrementalSource.Selection:\n {\n e.data.ranges.forEach(function (range) {\n _this8.replaceIds(range, iframeEl, ['start', 'end']);\n });\n return e;\n }\n\n case IncrementalSource.AdoptedStyleSheet:\n {\n this.replaceIds(e.data, iframeEl, ['id']);\n this.replaceStyleIds(e.data, iframeEl, ['styleIds']);\n (_a = e.data.styles) === null || _a === void 0 ? void 0 : _a.forEach(function (style) {\n _this8.replaceStyleIds(style, iframeEl, ['styleId']);\n });\n return e;\n }\n }\n }\n }\n\n return false;\n }\n }, {\n key: \"replace\",\n value: function replace(iframeMirror, obj, iframeEl, keys) {\n var _iterator5 = _createForOfIteratorHelper(keys),\n _step5;\n\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var key = _step5.value;\n if (!Array.isArray(obj[key]) && typeof obj[key] !== 'number') continue;\n\n if (Array.isArray(obj[key])) {\n obj[key] = iframeMirror.getIds(iframeEl, obj[key]);\n } else {\n obj[key] = iframeMirror.getId(iframeEl, obj[key]);\n }\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n\n return obj;\n }\n }, {\n key: \"replaceIds\",\n value: function replaceIds(obj, iframeEl, keys) {\n return this.replace(this.crossOriginIframeMirror, obj, iframeEl, keys);\n }\n }, {\n key: \"replaceStyleIds\",\n value: function replaceStyleIds(obj, iframeEl, keys) {\n return this.replace(this.crossOriginIframeStyleMirror, obj, iframeEl, keys);\n }\n }, {\n key: \"replaceIdOnNode\",\n value: function replaceIdOnNode(node, iframeEl) {\n var _this9 = this;\n\n this.replaceIds(node, iframeEl, ['id', 'rootId']);\n\n if ('childNodes' in node) {\n node.childNodes.forEach(function (child) {\n _this9.replaceIdOnNode(child, iframeEl);\n });\n }\n }\n }, {\n key: \"patchRootIdOnNode\",\n value: function patchRootIdOnNode(node, rootId) {\n var _this10 = this;\n\n if (node.type !== NodeType$1.Document && !node.rootId) node.rootId = rootId;\n\n if ('childNodes' in node) {\n node.childNodes.forEach(function (child) {\n _this10.patchRootIdOnNode(child, rootId);\n });\n }\n }\n }]);\n\n return IframeManager;\n}();\n\nvar ShadowDomManagerNoop = /*#__PURE__*/function () {\n function ShadowDomManagerNoop() {\n _classCallCheck(this, ShadowDomManagerNoop);\n }\n\n _createClass(ShadowDomManagerNoop, [{\n key: \"init\",\n value: function init() {}\n }, {\n key: \"addShadowRoot\",\n value: function addShadowRoot() {}\n }, {\n key: \"observeAttachShadow\",\n value: function observeAttachShadow() {}\n }, {\n key: \"reset\",\n value: function reset() {}\n }]);\n\n return ShadowDomManagerNoop;\n}();\n\nvar ShadowDomManager = /*#__PURE__*/function () {\n function ShadowDomManager(options) {\n _classCallCheck(this, ShadowDomManager);\n\n this.shadowDoms = new WeakSet();\n this.restoreHandlers = [];\n this.mutationCb = options.mutationCb;\n this.scrollCb = options.scrollCb;\n this.bypassOptions = options.bypassOptions;\n this.mirror = options.mirror;\n this.init();\n }\n\n _createClass(ShadowDomManager, [{\n key: \"init\",\n value: function init() {\n this.reset();\n this.patchAttachShadow(Element, document);\n }\n }, {\n key: \"addShadowRoot\",\n value: function addShadowRoot(shadowRoot, doc) {\n var _this11 = this;\n\n if (!isNativeShadowDom(shadowRoot)) return;\n if (this.shadowDoms.has(shadowRoot)) return;\n this.shadowDoms.add(shadowRoot);\n var observer = initMutationObserver(Object.assign(Object.assign({}, this.bypassOptions), {\n doc: doc,\n mutationCb: this.mutationCb,\n mirror: this.mirror,\n shadowDomManager: this\n }), shadowRoot);\n this.restoreHandlers.push(function () {\n return observer.disconnect();\n });\n this.restoreHandlers.push(initScrollObserver(Object.assign(Object.assign({}, this.bypassOptions), {\n scrollCb: this.scrollCb,\n doc: shadowRoot,\n mirror: this.mirror\n })));\n setTimeout(function () {\n if (shadowRoot.adoptedStyleSheets && shadowRoot.adoptedStyleSheets.length > 0) _this11.bypassOptions.stylesheetManager.adoptStyleSheets(shadowRoot.adoptedStyleSheets, _this11.mirror.getId(shadowRoot.host));\n\n _this11.restoreHandlers.push(initAdoptedStyleSheetObserver({\n mirror: _this11.mirror,\n stylesheetManager: _this11.bypassOptions.stylesheetManager\n }, shadowRoot));\n }, 0);\n }\n }, {\n key: \"observeAttachShadow\",\n value: function observeAttachShadow(iframeElement) {\n if (!iframeElement.contentWindow || !iframeElement.contentDocument) return;\n this.patchAttachShadow(iframeElement.contentWindow.Element, iframeElement.contentDocument);\n }\n }, {\n key: \"patchAttachShadow\",\n value: function patchAttachShadow(element, doc) {\n var manager = this;\n this.restoreHandlers.push(patch(element.prototype, 'attachShadow', function (original) {\n return function (option) {\n var shadowRoot = original.call(this, option);\n if (this.shadowRoot && inDom(this)) manager.addShadowRoot(this.shadowRoot, doc);\n return shadowRoot;\n };\n }));\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this.restoreHandlers.forEach(function (handler) {\n try {\n handler();\n } catch (e) {}\n });\n this.restoreHandlers = [];\n this.shadowDoms = new WeakSet();\n }\n }]);\n\n return ShadowDomManager;\n}();\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n\n\nfunction __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}\n\nfunction __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}\n/*\n * base64-arraybuffer 1.0.1 \n * Copyright (c) 2021 Niklas von Hertzen \n * Released under MIT License\n */\n\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; // Use a lookup table to find the index.\n\nvar lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\n\nfor (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\n\nvar encode = function encode(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer),\n i,\n len = bytes.length,\n base64 = '';\n\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64 += chars[bytes[i + 2] & 63];\n }\n\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n\n return base64;\n};\n\nvar canvasVarMap = new Map();\n\nfunction variableListFor(ctx, ctor) {\n var contextMap = canvasVarMap.get(ctx);\n\n if (!contextMap) {\n contextMap = new Map();\n canvasVarMap.set(ctx, contextMap);\n }\n\n if (!contextMap.has(ctor)) {\n contextMap.set(ctor, []);\n }\n\n return contextMap.get(ctor);\n}\n\nvar saveWebGLVar = function saveWebGLVar(value, win, ctx) {\n if (!value || !(isInstanceOfWebGLObject(value, win) || typeof value === 'object')) return;\n var name = value.constructor.name;\n var list = variableListFor(ctx, name);\n var index = list.indexOf(value);\n\n if (index === -1) {\n index = list.length;\n list.push(value);\n }\n\n return index;\n};\n\nfunction serializeArg(value, win, ctx) {\n if (value instanceof Array) {\n return value.map(function (arg) {\n return serializeArg(arg, win, ctx);\n });\n } else if (value === null) {\n return value;\n } else if (value instanceof Float32Array || value instanceof Float64Array || value instanceof Int32Array || value instanceof Uint32Array || value instanceof Uint8Array || value instanceof Uint16Array || value instanceof Int16Array || value instanceof Int8Array || value instanceof Uint8ClampedArray) {\n var name = value.constructor.name;\n return {\n rr_type: name,\n args: [Object.values(value)]\n };\n } else if (value instanceof ArrayBuffer) {\n var _name = value.constructor.name;\n var base64 = encode(value);\n return {\n rr_type: _name,\n base64: base64\n };\n } else if (value instanceof DataView) {\n var _name2 = value.constructor.name;\n return {\n rr_type: _name2,\n args: [serializeArg(value.buffer, win, ctx), value.byteOffset, value.byteLength]\n };\n } else if (value instanceof HTMLImageElement) {\n var _name3 = value.constructor.name;\n var src = value.src;\n return {\n rr_type: _name3,\n src: src\n };\n } else if (value instanceof HTMLCanvasElement) {\n var _name4 = 'HTMLImageElement';\n\n var _src = value.toDataURL();\n\n return {\n rr_type: _name4,\n src: _src\n };\n } else if (value instanceof ImageData) {\n var _name5 = value.constructor.name;\n return {\n rr_type: _name5,\n args: [serializeArg(value.data, win, ctx), value.width, value.height]\n };\n } else if (isInstanceOfWebGLObject(value, win) || typeof value === 'object') {\n var _name6 = value.constructor.name;\n var index = saveWebGLVar(value, win, ctx);\n return {\n rr_type: _name6,\n index: index\n };\n }\n\n return value;\n}\n\nvar serializeArgs = function serializeArgs(args, win, ctx) {\n return _toConsumableArray(args).map(function (arg) {\n return serializeArg(arg, win, ctx);\n });\n};\n\nvar isInstanceOfWebGLObject = function isInstanceOfWebGLObject(value, win) {\n var webGLConstructorNames = ['WebGLActiveInfo', 'WebGLBuffer', 'WebGLFramebuffer', 'WebGLProgram', 'WebGLRenderbuffer', 'WebGLShader', 'WebGLShaderPrecisionFormat', 'WebGLTexture', 'WebGLUniformLocation', 'WebGLVertexArrayObject', 'WebGLVertexArrayObjectOES'];\n var supportedWebGLConstructorNames = webGLConstructorNames.filter(function (name) {\n return typeof win[name] === 'function';\n });\n return Boolean(supportedWebGLConstructorNames.find(function (name) {\n return value instanceof win[name];\n }));\n};\n\nfunction initCanvas2DMutationObserver(cb, win, blockClass, blockSelector, unblockSelector) {\n var handlers = [];\n var props2D = Object.getOwnPropertyNames(win.CanvasRenderingContext2D.prototype);\n\n var _iterator6 = _createForOfIteratorHelper(props2D),\n _step6;\n\n try {\n var _loop = function _loop() {\n var prop = _step6.value;\n\n try {\n if (typeof win.CanvasRenderingContext2D.prototype[prop] !== 'function') {\n return \"continue\";\n }\n\n var restoreHandler = patch(win.CanvasRenderingContext2D.prototype, prop, function (original) {\n return function () {\n var _this12 = this;\n\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n if (!isBlocked(this.canvas, blockClass, blockSelector, unblockSelector, true)) {\n setTimeout(function () {\n var recordArgs = serializeArgs([].concat(args), win, _this12);\n cb(_this12.canvas, {\n type: CanvasContext['2D'],\n property: prop,\n args: recordArgs\n });\n }, 0);\n }\n\n return original.apply(this, args);\n };\n });\n handlers.push(restoreHandler);\n } catch (_a) {\n var hookHandler = hookSetter(win.CanvasRenderingContext2D.prototype, prop, {\n set: function set(v) {\n cb(this.canvas, {\n type: CanvasContext['2D'],\n property: prop,\n args: [v],\n setter: true\n });\n }\n });\n handlers.push(hookHandler);\n }\n };\n\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var _ret = _loop();\n\n if (_ret === \"continue\") continue;\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n\n return function () {\n handlers.forEach(function (h) {\n return h();\n });\n };\n}\n\nfunction getNormalizedContextName(contextType) {\n return contextType === 'experimental-webgl' ? 'webgl' : contextType;\n}\n\nfunction initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector, setPreserveDrawingBufferToTrue) {\n var handlers = [];\n\n try {\n var restoreHandler = patch(win.HTMLCanvasElement.prototype, 'getContext', function (original) {\n return function (contextType) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n\n if (!isBlocked(this, blockClass, blockSelector, unblockSelector, true)) {\n var ctxName = getNormalizedContextName(contextType);\n if (!('__context' in this)) this.__context = ctxName;\n\n if (setPreserveDrawingBufferToTrue && ['webgl', 'webgl2'].includes(ctxName)) {\n if (args[0] && typeof args[0] === 'object') {\n var contextAttributes = args[0];\n\n if (!contextAttributes.preserveDrawingBuffer) {\n contextAttributes.preserveDrawingBuffer = true;\n }\n } else {\n args.splice(0, 1, {\n preserveDrawingBuffer: true\n });\n }\n }\n }\n\n return original.apply(this, [contextType].concat(args));\n };\n });\n handlers.push(restoreHandler);\n } catch (_a) {\n console.error('failed to patch HTMLCanvasElement.prototype.getContext');\n }\n\n return function () {\n handlers.forEach(function (h) {\n return h();\n });\n };\n}\n\nfunction patchGLPrototype(prototype, type, cb, blockClass, blockSelector, unblockSelector, mirror, win) {\n var handlers = [];\n var props = Object.getOwnPropertyNames(prototype);\n\n var _iterator7 = _createForOfIteratorHelper(props),\n _step7;\n\n try {\n var _loop2 = function _loop2() {\n var prop = _step7.value;\n\n if (['isContextLost', 'canvas', 'drawingBufferWidth', 'drawingBufferHeight'].includes(prop)) {\n return \"continue\";\n }\n\n try {\n if (typeof prototype[prop] !== 'function') {\n return \"continue\";\n }\n\n var restoreHandler = patch(prototype, prop, function (original) {\n return function () {\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n\n var result = original.apply(this, args);\n saveWebGLVar(result, win, this);\n\n if ('tagName' in this.canvas && !isBlocked(this.canvas, blockClass, blockSelector, unblockSelector, true)) {\n var recordArgs = serializeArgs([].concat(args), win, this);\n var mutation = {\n type: type,\n property: prop,\n args: recordArgs\n };\n cb(this.canvas, mutation);\n }\n\n return result;\n };\n });\n handlers.push(restoreHandler);\n } catch (_a) {\n var hookHandler = hookSetter(prototype, prop, {\n set: function set(v) {\n cb(this.canvas, {\n type: type,\n property: prop,\n args: [v],\n setter: true\n });\n }\n });\n handlers.push(hookHandler);\n }\n };\n\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var _ret2 = _loop2();\n\n if (_ret2 === \"continue\") continue;\n }\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n\n return handlers;\n}\n\nfunction initCanvasWebGLMutationObserver(cb, win, blockClass, blockSelector, unblockSelector, mirror) {\n var handlers = [];\n handlers.push.apply(handlers, _toConsumableArray(patchGLPrototype(win.WebGLRenderingContext.prototype, CanvasContext.WebGL, cb, blockClass, blockSelector, unblockSelector, mirror, win)));\n\n if (typeof win.WebGL2RenderingContext !== 'undefined') {\n handlers.push.apply(handlers, _toConsumableArray(patchGLPrototype(win.WebGL2RenderingContext.prototype, CanvasContext.WebGL2, cb, blockClass, blockSelector, unblockSelector, mirror, win)));\n }\n\n return function () {\n handlers.forEach(function (h) {\n return h();\n });\n };\n}\n\nfunction decodeBase64(base64, enableUnicode) {\n var binaryString = atob(base64);\n\n if (enableUnicode) {\n var binaryView = new Uint8Array(binaryString.length);\n\n for (var i = 0, n = binaryString.length; i < n; ++i) {\n binaryView[i] = binaryString.charCodeAt(i);\n }\n\n return String.fromCharCode.apply(null, new Uint16Array(binaryView.buffer));\n }\n\n return binaryString;\n}\n\nfunction createURL(base64, sourcemapArg, enableUnicodeArg) {\n var sourcemap = sourcemapArg === undefined ? null : sourcemapArg;\n var enableUnicode = enableUnicodeArg === undefined ? false : enableUnicodeArg;\n var source = decodeBase64(base64, enableUnicode);\n var start = source.indexOf('\\n', 10) + 1;\n var body = source.substring(start) + (sourcemap ? '\\/\\/# sourceMappingURL=' + sourcemap : '');\n var blob = new Blob([body], {\n type: 'application/javascript'\n });\n return URL.createObjectURL(blob);\n}\n\nfunction createBase64WorkerFactory(base64, sourcemapArg, enableUnicodeArg) {\n var url;\n return function WorkerFactory(options) {\n url = url || createURL(base64, sourcemapArg, enableUnicodeArg);\n return new Worker(url, options);\n };\n}\n\nvar WorkerFactory = createBase64WorkerFactory('Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTk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uQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=', null, false);\n\nvar CanvasManagerNoop = /*#__PURE__*/function () {\n function CanvasManagerNoop() {\n _classCallCheck(this, CanvasManagerNoop);\n }\n\n _createClass(CanvasManagerNoop, [{\n key: \"reset\",\n value: function reset() {}\n }, {\n key: \"freeze\",\n value: function freeze() {}\n }, {\n key: \"unfreeze\",\n value: function unfreeze() {}\n }, {\n key: \"lock\",\n value: function lock() {}\n }, {\n key: \"unlock\",\n value: function unlock() {}\n }]);\n\n return CanvasManagerNoop;\n}();\n\nvar CanvasManager = /*#__PURE__*/function () {\n function CanvasManager(options) {\n var _this13 = this;\n\n _classCallCheck(this, CanvasManager);\n\n this.pendingCanvasMutations = new Map();\n this.rafStamps = {\n latestId: 0,\n invokeId: null\n };\n this.frozen = false;\n this.locked = false;\n\n this.processMutation = function (target, mutation) {\n var newFrame = _this13.rafStamps.invokeId && _this13.rafStamps.latestId !== _this13.rafStamps.invokeId;\n if (newFrame || !_this13.rafStamps.invokeId) _this13.rafStamps.invokeId = _this13.rafStamps.latestId;\n\n if (!_this13.pendingCanvasMutations.has(target)) {\n _this13.pendingCanvasMutations.set(target, []);\n }\n\n _this13.pendingCanvasMutations.get(target).push(mutation);\n };\n\n var _options$sampling = options.sampling,\n sampling = _options$sampling === void 0 ? 'all' : _options$sampling,\n win = options.win,\n blockClass = options.blockClass,\n blockSelector = options.blockSelector,\n unblockSelector = options.unblockSelector,\n recordCanvas = options.recordCanvas,\n dataURLOptions = options.dataURLOptions;\n this.mutationCb = options.mutationCb;\n this.mirror = options.mirror;\n if (recordCanvas && sampling === 'all') this.initCanvasMutationObserver(win, blockClass, blockSelector, unblockSelector);\n if (recordCanvas && typeof sampling === 'number') this.initCanvasFPSObserver(sampling, win, blockClass, blockSelector, unblockSelector, {\n dataURLOptions: dataURLOptions\n });\n }\n\n _createClass(CanvasManager, [{\n key: \"reset\",\n value: function reset() {\n this.pendingCanvasMutations.clear();\n this.resetObservers && this.resetObservers();\n }\n }, {\n key: \"freeze\",\n value: function freeze() {\n this.frozen = true;\n }\n }, {\n key: \"unfreeze\",\n value: function unfreeze() {\n this.frozen = false;\n }\n }, {\n key: \"lock\",\n value: function lock() {\n this.locked = true;\n }\n }, {\n key: \"unlock\",\n value: function unlock() {\n this.locked = false;\n }\n }, {\n key: \"initCanvasFPSObserver\",\n value: function initCanvasFPSObserver(fps, win, blockClass, blockSelector, unblockSelector, options) {\n var _this14 = this;\n\n var canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector, true);\n var snapshotInProgressMap = new Map();\n var worker = new WorkerFactory();\n\n worker.onmessage = function (e) {\n var id = e.data.id;\n snapshotInProgressMap.set(id, false);\n if (!('base64' in e.data)) return;\n var _e$data = e.data,\n base64 = _e$data.base64,\n type = _e$data.type,\n width = _e$data.width,\n height = _e$data.height;\n\n _this14.mutationCb({\n id: id,\n type: CanvasContext['2D'],\n commands: [{\n property: 'clearRect',\n args: [0, 0, width, height]\n }, {\n property: 'drawImage',\n args: [{\n rr_type: 'ImageBitmap',\n args: [{\n rr_type: 'Blob',\n data: [{\n rr_type: 'ArrayBuffer',\n base64: base64\n }],\n type: type\n }]\n }, 0, 0]\n }]\n });\n };\n\n var timeBetweenSnapshots = 1000 / fps;\n var lastSnapshotTime = 0;\n var rafId;\n\n var getCanvas = function getCanvas() {\n var matchedCanvas = [];\n win.document.querySelectorAll('canvas').forEach(function (canvas) {\n if (!isBlocked(canvas, blockClass, blockSelector, unblockSelector, true)) {\n matchedCanvas.push(canvas);\n }\n });\n return matchedCanvas;\n };\n\n var takeCanvasSnapshots = function takeCanvasSnapshots(timestamp) {\n if (lastSnapshotTime && timestamp - lastSnapshotTime < timeBetweenSnapshots) {\n rafId = requestAnimationFrame(takeCanvasSnapshots);\n return;\n }\n\n lastSnapshotTime = timestamp;\n getCanvas().forEach(function (canvas) {\n return __awaiter(_this14, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {\n var _a, id, context, bitmap;\n\n return _regeneratorRuntime.wrap(function _callee$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n id = this.mirror.getId(canvas);\n\n if (!snapshotInProgressMap.get(id)) {\n _context2.next = 3;\n break;\n }\n\n return _context2.abrupt(\"return\");\n\n case 3:\n snapshotInProgressMap.set(id, true);\n\n if (['webgl', 'webgl2'].includes(canvas.__context)) {\n context = canvas.getContext(canvas.__context);\n\n if (((_a = context === null || context === void 0 ? void 0 : context.getContextAttributes()) === null || _a === void 0 ? void 0 : _a.preserveDrawingBuffer) === false) {\n context.clear(context.COLOR_BUFFER_BIT);\n }\n }\n\n _context2.next = 7;\n return createImageBitmap(canvas);\n\n case 7:\n bitmap = _context2.sent;\n worker.postMessage({\n id: id,\n bitmap: bitmap,\n width: canvas.width,\n height: canvas.height,\n dataURLOptions: options.dataURLOptions\n }, [bitmap]);\n\n case 9:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee, this);\n }));\n });\n rafId = requestAnimationFrame(takeCanvasSnapshots);\n };\n\n rafId = requestAnimationFrame(takeCanvasSnapshots);\n\n this.resetObservers = function () {\n canvasContextReset();\n cancelAnimationFrame(rafId);\n };\n }\n }, {\n key: \"initCanvasMutationObserver\",\n value: function initCanvasMutationObserver(win, blockClass, blockSelector, unblockSelector) {\n this.startRAFTimestamping();\n this.startPendingCanvasMutationFlusher();\n var canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector, false);\n var canvas2DReset = initCanvas2DMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector);\n var canvasWebGL1and2Reset = initCanvasWebGLMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector, this.mirror);\n\n this.resetObservers = function () {\n canvasContextReset();\n canvas2DReset();\n canvasWebGL1and2Reset();\n };\n }\n }, {\n key: \"startPendingCanvasMutationFlusher\",\n value: function startPendingCanvasMutationFlusher() {\n var _this15 = this;\n\n requestAnimationFrame(function () {\n return _this15.flushPendingCanvasMutations();\n });\n }\n }, {\n key: \"startRAFTimestamping\",\n value: function startRAFTimestamping() {\n var _this16 = this;\n\n var setLatestRAFTimestamp = function setLatestRAFTimestamp(timestamp) {\n _this16.rafStamps.latestId = timestamp;\n requestAnimationFrame(setLatestRAFTimestamp);\n };\n\n requestAnimationFrame(setLatestRAFTimestamp);\n }\n }, {\n key: \"flushPendingCanvasMutations\",\n value: function flushPendingCanvasMutations() {\n var _this17 = this;\n\n this.pendingCanvasMutations.forEach(function (values, canvas) {\n var id = _this17.mirror.getId(canvas);\n\n _this17.flushPendingCanvasMutationFor(canvas, id);\n });\n requestAnimationFrame(function () {\n return _this17.flushPendingCanvasMutations();\n });\n }\n }, {\n key: \"flushPendingCanvasMutationFor\",\n value: function flushPendingCanvasMutationFor(canvas, id) {\n if (this.frozen || this.locked) {\n return;\n }\n\n var valuesWithType = this.pendingCanvasMutations.get(canvas);\n if (!valuesWithType || id === -1) return;\n var values = valuesWithType.map(function (value) {\n var rest = __rest(value, [\"type\"]);\n\n return rest;\n });\n var type = valuesWithType[0].type;\n this.mutationCb({\n id: id,\n type: type,\n commands: values\n });\n this.pendingCanvasMutations.delete(canvas);\n }\n }]);\n\n return CanvasManager;\n}();\n\nvar StylesheetManager = /*#__PURE__*/function () {\n function StylesheetManager(options) {\n _classCallCheck(this, StylesheetManager);\n\n this.trackedLinkElements = new WeakSet();\n this.styleMirror = new StyleSheetMirror();\n this.mutationCb = options.mutationCb;\n this.adoptedStyleSheetCb = options.adoptedStyleSheetCb;\n }\n\n _createClass(StylesheetManager, [{\n key: \"attachLinkElement\",\n value: function attachLinkElement(linkEl, childSn) {\n if ('_cssText' in childSn.attributes) this.mutationCb({\n adds: [],\n removes: [],\n texts: [],\n attributes: [{\n id: childSn.id,\n attributes: childSn.attributes\n }]\n });\n this.trackLinkElement(linkEl);\n }\n }, {\n key: \"trackLinkElement\",\n value: function trackLinkElement(linkEl) {\n if (this.trackedLinkElements.has(linkEl)) return;\n this.trackedLinkElements.add(linkEl);\n this.trackStylesheetInLinkElement(linkEl);\n }\n }, {\n key: \"adoptStyleSheets\",\n value: function adoptStyleSheets(sheets, hostId) {\n if (sheets.length === 0) return;\n var adoptedStyleSheetData = {\n id: hostId,\n styleIds: []\n };\n var styles = [];\n\n var _iterator8 = _createForOfIteratorHelper(sheets),\n _step8;\n\n try {\n for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n var sheet = _step8.value;\n var styleId = void 0;\n\n if (!this.styleMirror.has(sheet)) {\n styleId = this.styleMirror.add(sheet);\n styles.push({\n styleId: styleId,\n rules: Array.from(sheet.rules || CSSRule, function (r, index) {\n return {\n rule: stringifyRule(r),\n index: index\n };\n })\n });\n } else styleId = this.styleMirror.getId(sheet);\n\n adoptedStyleSheetData.styleIds.push(styleId);\n }\n } catch (err) {\n _iterator8.e(err);\n } finally {\n _iterator8.f();\n }\n\n if (styles.length > 0) adoptedStyleSheetData.styles = styles;\n this.adoptedStyleSheetCb(adoptedStyleSheetData);\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this.styleMirror.reset();\n this.trackedLinkElements = new WeakSet();\n }\n }, {\n key: \"trackStylesheetInLinkElement\",\n value: function trackStylesheetInLinkElement(linkEl) {}\n }]);\n\n return StylesheetManager;\n}();\n\nvar ProcessedNodeManager = /*#__PURE__*/function () {\n function ProcessedNodeManager() {\n _classCallCheck(this, ProcessedNodeManager);\n\n this.nodeMap = new WeakMap();\n this.loop = true;\n this.periodicallyClear();\n }\n\n _createClass(ProcessedNodeManager, [{\n key: \"periodicallyClear\",\n value: function periodicallyClear() {\n var _this18 = this;\n\n requestAnimationFrame(function () {\n _this18.clear();\n\n if (_this18.loop) _this18.periodicallyClear();\n });\n }\n }, {\n key: \"inOtherBuffer\",\n value: function inOtherBuffer(node, thisBuffer) {\n var buffers = this.nodeMap.get(node);\n return buffers && Array.from(buffers).some(function (buffer) {\n return buffer !== thisBuffer;\n });\n }\n }, {\n key: \"add\",\n value: function add(node, buffer) {\n this.nodeMap.set(node, (this.nodeMap.get(node) || new Set()).add(buffer));\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.nodeMap = new WeakMap();\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.loop = false;\n }\n }]);\n\n return ProcessedNodeManager;\n}();\n\nfunction wrapEvent(e) {\n return Object.assign(Object.assign({}, e), {\n timestamp: nowTimestamp()\n });\n}\n\nvar wrappedEmit;\nvar takeFullSnapshot;\nvar canvasManager;\nvar recording = false;\nvar mirror = createMirror();\n\nfunction record() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var emit = options.emit,\n checkoutEveryNms = options.checkoutEveryNms,\n checkoutEveryNth = options.checkoutEveryNth,\n _options$blockClass = options.blockClass,\n blockClass = _options$blockClass === void 0 ? 'rr-block' : _options$blockClass,\n _options$blockSelecto = options.blockSelector,\n blockSelector = _options$blockSelecto === void 0 ? null : _options$blockSelecto,\n _options$unblockSelec = options.unblockSelector,\n unblockSelector = _options$unblockSelec === void 0 ? null : _options$unblockSelec,\n _options$ignoreClass = options.ignoreClass,\n ignoreClass = _options$ignoreClass === void 0 ? 'rr-ignore' : _options$ignoreClass,\n _options$ignoreSelect = options.ignoreSelector,\n ignoreSelector = _options$ignoreSelect === void 0 ? null : _options$ignoreSelect,\n _options$maskAllText = options.maskAllText,\n maskAllText = _options$maskAllText === void 0 ? false : _options$maskAllText,\n _options$maskTextClas = options.maskTextClass,\n maskTextClass = _options$maskTextClas === void 0 ? 'rr-mask' : _options$maskTextClas,\n _options$unmaskTextCl = options.unmaskTextClass,\n unmaskTextClass = _options$unmaskTextCl === void 0 ? null : _options$unmaskTextCl,\n _options$maskTextSele = options.maskTextSelector,\n maskTextSelector = _options$maskTextSele === void 0 ? null : _options$maskTextSele,\n _options$unmaskTextSe = options.unmaskTextSelector,\n unmaskTextSelector = _options$unmaskTextSe === void 0 ? null : _options$unmaskTextSe,\n _options$inlineStyles2 = options.inlineStylesheet,\n inlineStylesheet = _options$inlineStyles2 === void 0 ? true : _options$inlineStyles2,\n maskAllInputs = options.maskAllInputs,\n _maskInputOptions = options.maskInputOptions,\n _slimDOMOptions = options.slimDOMOptions,\n maskAttributeFn = options.maskAttributeFn,\n maskInputFn = options.maskInputFn,\n maskTextFn = options.maskTextFn,\n hooks = options.hooks,\n packFn = options.packFn,\n _options$sampling2 = options.sampling,\n sampling = _options$sampling2 === void 0 ? {} : _options$sampling2,\n _options$dataURLOptio4 = options.dataURLOptions,\n dataURLOptions = _options$dataURLOptio4 === void 0 ? {} : _options$dataURLOptio4,\n mousemoveWait = options.mousemoveWait,\n _options$recordCanvas2 = options.recordCanvas,\n recordCanvas = _options$recordCanvas2 === void 0 ? false : _options$recordCanvas2,\n _options$recordCrossO = options.recordCrossOriginIframes,\n recordCrossOriginIframes = _options$recordCrossO === void 0 ? false : _options$recordCrossO,\n _options$recordAfter = options.recordAfter,\n recordAfter = _options$recordAfter === void 0 ? options.recordAfter === 'DOMContentLoaded' ? options.recordAfter : 'load' : _options$recordAfter,\n _options$userTriggere = options.userTriggeredOnInput,\n userTriggeredOnInput = _options$userTriggere === void 0 ? false : _options$userTriggere,\n _options$collectFonts = options.collectFonts,\n collectFonts = _options$collectFonts === void 0 ? false : _options$collectFonts,\n _options$inlineImages2 = options.inlineImages,\n inlineImages = _options$inlineImages2 === void 0 ? false : _options$inlineImages2,\n plugins = options.plugins,\n _options$keepIframeSr2 = options.keepIframeSrcFn,\n keepIframeSrcFn = _options$keepIframeSr2 === void 0 ? function () {\n return false;\n } : _options$keepIframeSr2,\n _options$ignoreCSSAtt = options.ignoreCSSAttributes,\n ignoreCSSAttributes = _options$ignoreCSSAtt === void 0 ? new Set([]) : _options$ignoreCSSAtt,\n errorHandler = options.errorHandler,\n onMutation = options.onMutation;\n registerErrorHandler(errorHandler);\n var inEmittingFrame = recordCrossOriginIframes ? window.parent === window : true;\n var passEmitsToParent = false;\n\n if (!inEmittingFrame) {\n try {\n if (window.parent.document) {\n passEmitsToParent = false;\n }\n } catch (e) {\n passEmitsToParent = true;\n }\n }\n\n if (inEmittingFrame && !emit) {\n throw new Error('emit function is required');\n }\n\n if (mousemoveWait !== undefined && sampling.mousemove === undefined) {\n sampling.mousemove = mousemoveWait;\n }\n\n mirror.reset();\n var maskInputOptions = maskAllInputs === true ? {\n color: true,\n date: true,\n 'datetime-local': true,\n email: true,\n month: true,\n number: true,\n range: true,\n search: true,\n tel: true,\n text: true,\n time: true,\n url: true,\n week: true,\n textarea: true,\n select: true,\n radio: true,\n checkbox: true\n } : _maskInputOptions !== undefined ? _maskInputOptions : {};\n var slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === 'all' ? {\n script: true,\n comment: true,\n headFavicon: true,\n headWhitespace: true,\n headMetaSocial: true,\n headMetaRobots: true,\n headMetaHttpEquiv: true,\n headMetaVerification: true,\n headMetaAuthorship: _slimDOMOptions === 'all',\n headMetaDescKeywords: _slimDOMOptions === 'all'\n } : _slimDOMOptions ? _slimDOMOptions : {};\n polyfill();\n var lastFullSnapshotEvent;\n var incrementalSnapshotCount = 0;\n\n var eventProcessor = function eventProcessor(e) {\n var _iterator9 = _createForOfIteratorHelper(plugins || []),\n _step9;\n\n try {\n for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {\n var plugin = _step9.value;\n\n if (plugin.eventProcessor) {\n e = plugin.eventProcessor(e);\n }\n }\n } catch (err) {\n _iterator9.e(err);\n } finally {\n _iterator9.f();\n }\n\n if (packFn && !passEmitsToParent) {\n e = packFn(e);\n }\n\n return e;\n };\n\n wrappedEmit = function wrappedEmit(e, isCheckout) {\n var _a;\n\n if (((_a = mutationBuffers[0]) === null || _a === void 0 ? void 0 : _a.isFrozen()) && e.type !== EventType.FullSnapshot && !(e.type === EventType.IncrementalSnapshot && e.data.source === IncrementalSource.Mutation)) {\n mutationBuffers.forEach(function (buf) {\n return buf.unfreeze();\n });\n }\n\n if (inEmittingFrame) {\n emit === null || emit === void 0 ? void 0 : emit(eventProcessor(e), isCheckout);\n } else if (passEmitsToParent) {\n var message = {\n type: 'rrweb',\n event: eventProcessor(e),\n origin: window.location.origin,\n isCheckout: isCheckout\n };\n window.parent.postMessage(message, '*');\n }\n\n if (e.type === EventType.FullSnapshot) {\n lastFullSnapshotEvent = e;\n incrementalSnapshotCount = 0;\n } else if (e.type === EventType.IncrementalSnapshot) {\n if (e.data.source === IncrementalSource.Mutation && e.data.isAttachIframe) {\n return;\n }\n\n incrementalSnapshotCount++;\n var exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;\n var exceedTime = checkoutEveryNms && e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;\n\n if (exceedCount || exceedTime) {\n takeFullSnapshot(true);\n }\n }\n };\n\n var wrappedMutationEmit = function wrappedMutationEmit(m) {\n wrappedEmit(wrapEvent({\n type: EventType.IncrementalSnapshot,\n data: Object.assign({\n source: IncrementalSource.Mutation\n }, m)\n }));\n };\n\n var wrappedScrollEmit = function wrappedScrollEmit(p) {\n return wrappedEmit(wrapEvent({\n type: EventType.IncrementalSnapshot,\n data: Object.assign({\n source: IncrementalSource.Scroll\n }, p)\n }));\n };\n\n var wrappedCanvasMutationEmit = function wrappedCanvasMutationEmit(p) {\n return wrappedEmit(wrapEvent({\n type: EventType.IncrementalSnapshot,\n data: Object.assign({\n source: IncrementalSource.CanvasMutation\n }, p)\n }));\n };\n\n var wrappedAdoptedStyleSheetEmit = function wrappedAdoptedStyleSheetEmit(a) {\n return wrappedEmit(wrapEvent({\n type: EventType.IncrementalSnapshot,\n data: Object.assign({\n source: IncrementalSource.AdoptedStyleSheet\n }, a)\n }));\n };\n\n var stylesheetManager = new StylesheetManager({\n mutationCb: wrappedMutationEmit,\n adoptedStyleSheetCb: wrappedAdoptedStyleSheetEmit\n });\n var iframeManager = typeof __RRWEB_EXCLUDE_IFRAME__ === 'boolean' && __RRWEB_EXCLUDE_IFRAME__ ? new IframeManagerNoop() : new IframeManager({\n mirror: mirror,\n mutationCb: wrappedMutationEmit,\n stylesheetManager: stylesheetManager,\n recordCrossOriginIframes: recordCrossOriginIframes,\n wrappedEmit: wrappedEmit\n });\n\n var _iterator10 = _createForOfIteratorHelper(plugins || []),\n _step10;\n\n try {\n for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {\n var plugin = _step10.value;\n if (plugin.getMirror) plugin.getMirror({\n nodeMirror: mirror,\n crossOriginIframeMirror: iframeManager.crossOriginIframeMirror,\n crossOriginIframeStyleMirror: iframeManager.crossOriginIframeStyleMirror\n });\n }\n } catch (err) {\n _iterator10.e(err);\n } finally {\n _iterator10.f();\n }\n\n var processedNodeManager = new ProcessedNodeManager();\n canvasManager = typeof __RRWEB_EXCLUDE_CANVAS__ === 'boolean' && __RRWEB_EXCLUDE_CANVAS__ ? new CanvasManagerNoop() : new CanvasManager({\n recordCanvas: recordCanvas,\n mutationCb: wrappedCanvasMutationEmit,\n win: window,\n blockClass: blockClass,\n blockSelector: blockSelector,\n unblockSelector: unblockSelector,\n mirror: mirror,\n sampling: sampling.canvas,\n dataURLOptions: dataURLOptions\n });\n var shadowDomManager = typeof __RRWEB_EXCLUDE_SHADOW_DOM__ === 'boolean' && __RRWEB_EXCLUDE_SHADOW_DOM__ ? new ShadowDomManagerNoop() : new ShadowDomManager({\n mutationCb: wrappedMutationEmit,\n scrollCb: wrappedScrollEmit,\n bypassOptions: {\n onMutation: onMutation,\n blockClass: blockClass,\n blockSelector: blockSelector,\n unblockSelector: unblockSelector,\n maskAllText: maskAllText,\n maskTextClass: maskTextClass,\n unmaskTextClass: unmaskTextClass,\n maskTextSelector: maskTextSelector,\n unmaskTextSelector: unmaskTextSelector,\n inlineStylesheet: inlineStylesheet,\n maskInputOptions: maskInputOptions,\n dataURLOptions: dataURLOptions,\n maskAttributeFn: maskAttributeFn,\n maskTextFn: maskTextFn,\n maskInputFn: maskInputFn,\n recordCanvas: recordCanvas,\n inlineImages: inlineImages,\n sampling: sampling,\n slimDOMOptions: slimDOMOptions,\n iframeManager: iframeManager,\n stylesheetManager: stylesheetManager,\n canvasManager: canvasManager,\n keepIframeSrcFn: keepIframeSrcFn,\n processedNodeManager: processedNodeManager\n },\n mirror: mirror\n });\n\n takeFullSnapshot = function takeFullSnapshot() {\n var isCheckout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n wrappedEmit(wrapEvent({\n type: EventType.Meta,\n data: {\n href: window.location.href,\n width: getWindowWidth(),\n height: getWindowHeight()\n }\n }), isCheckout);\n stylesheetManager.reset();\n shadowDomManager.init();\n mutationBuffers.forEach(function (buf) {\n return buf.lock();\n });\n var node = snapshot(document, {\n mirror: mirror,\n blockClass: blockClass,\n blockSelector: blockSelector,\n unblockSelector: unblockSelector,\n maskAllText: maskAllText,\n maskTextClass: maskTextClass,\n unmaskTextClass: unmaskTextClass,\n maskTextSelector: maskTextSelector,\n unmaskTextSelector: unmaskTextSelector,\n inlineStylesheet: inlineStylesheet,\n maskAllInputs: maskInputOptions,\n maskAttributeFn: maskAttributeFn,\n maskInputFn: maskInputFn,\n maskTextFn: maskTextFn,\n slimDOM: slimDOMOptions,\n dataURLOptions: dataURLOptions,\n recordCanvas: recordCanvas,\n inlineImages: inlineImages,\n onSerialize: function onSerialize(n) {\n if (isSerializedIframe(n, mirror)) {\n iframeManager.addIframe(n);\n }\n\n if (isSerializedStylesheet(n, mirror)) {\n stylesheetManager.trackLinkElement(n);\n }\n\n if (hasShadowRoot(n)) {\n shadowDomManager.addShadowRoot(n.shadowRoot, document);\n }\n },\n onIframeLoad: function onIframeLoad(iframe, childSn) {\n iframeManager.attachIframe(iframe, childSn);\n shadowDomManager.observeAttachShadow(iframe);\n },\n onStylesheetLoad: function onStylesheetLoad(linkEl, childSn) {\n stylesheetManager.attachLinkElement(linkEl, childSn);\n },\n keepIframeSrcFn: keepIframeSrcFn\n });\n\n if (!node) {\n return console.warn('Failed to snapshot the document');\n }\n\n wrappedEmit(wrapEvent({\n type: EventType.FullSnapshot,\n data: {\n node: node,\n initialOffset: getWindowScroll(window)\n }\n }), isCheckout);\n mutationBuffers.forEach(function (buf) {\n return buf.unlock();\n });\n if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0) stylesheetManager.adoptStyleSheets(document.adoptedStyleSheets, mirror.getId(document));\n };\n\n try {\n var _handlers = [];\n\n var observe = function observe(doc) {\n var _a;\n\n return callbackWrapper(initObservers)({\n onMutation: onMutation,\n mutationCb: wrappedMutationEmit,\n mousemoveCb: function mousemoveCb(positions, source) {\n return wrappedEmit(wrapEvent({\n type: EventType.IncrementalSnapshot,\n data: {\n source: source,\n positions: positions\n }\n }));\n },\n mouseInteractionCb: function mouseInteractionCb(d) {\n return wrappedEmit(wrapEvent({\n type: EventType.IncrementalSnapshot,\n data: Object.assign({\n source: IncrementalSource.MouseInteraction\n }, d)\n }));\n },\n scrollCb: wrappedScrollEmit,\n viewportResizeCb: function viewportResizeCb(d) {\n return wrappedEmit(wrapEvent({\n type: EventType.IncrementalSnapshot,\n data: Object.assign({\n source: IncrementalSource.ViewportResize\n }, d)\n }));\n },\n inputCb: function inputCb(v) {\n return wrappedEmit(wrapEvent({\n type: EventType.IncrementalSnapshot,\n data: Object.assign({\n source: IncrementalSource.Input\n }, v)\n }));\n },\n mediaInteractionCb: function mediaInteractionCb(p) {\n return wrappedEmit(wrapEvent({\n type: EventType.IncrementalSnapshot,\n data: Object.assign({\n source: IncrementalSource.MediaInteraction\n }, p)\n }));\n },\n styleSheetRuleCb: function styleSheetRuleCb(r) {\n return wrappedEmit(wrapEvent({\n type: EventType.IncrementalSnapshot,\n data: Object.assign({\n source: IncrementalSource.StyleSheetRule\n }, r)\n }));\n },\n styleDeclarationCb: function styleDeclarationCb(r) {\n return wrappedEmit(wrapEvent({\n type: EventType.IncrementalSnapshot,\n data: Object.assign({\n source: IncrementalSource.StyleDeclaration\n }, r)\n }));\n },\n canvasMutationCb: wrappedCanvasMutationEmit,\n fontCb: function fontCb(p) {\n return wrappedEmit(wrapEvent({\n type: EventType.IncrementalSnapshot,\n data: Object.assign({\n source: IncrementalSource.Font\n }, p)\n }));\n },\n selectionCb: function selectionCb(p) {\n wrappedEmit(wrapEvent({\n type: EventType.IncrementalSnapshot,\n data: Object.assign({\n source: IncrementalSource.Selection\n }, p)\n }));\n },\n customElementCb: function customElementCb(c) {\n wrappedEmit(wrapEvent({\n type: EventType.IncrementalSnapshot,\n data: Object.assign({\n source: IncrementalSource.CustomElement\n }, c)\n }));\n },\n blockClass: blockClass,\n ignoreClass: ignoreClass,\n ignoreSelector: ignoreSelector,\n maskAllText: maskAllText,\n maskTextClass: maskTextClass,\n unmaskTextClass: unmaskTextClass,\n maskTextSelector: maskTextSelector,\n unmaskTextSelector: unmaskTextSelector,\n maskInputOptions: maskInputOptions,\n inlineStylesheet: inlineStylesheet,\n sampling: sampling,\n recordCanvas: recordCanvas,\n inlineImages: inlineImages,\n userTriggeredOnInput: userTriggeredOnInput,\n collectFonts: collectFonts,\n doc: doc,\n maskAttributeFn: maskAttributeFn,\n maskInputFn: maskInputFn,\n maskTextFn: maskTextFn,\n keepIframeSrcFn: keepIframeSrcFn,\n blockSelector: blockSelector,\n unblockSelector: unblockSelector,\n slimDOMOptions: slimDOMOptions,\n dataURLOptions: dataURLOptions,\n mirror: mirror,\n iframeManager: iframeManager,\n stylesheetManager: stylesheetManager,\n shadowDomManager: shadowDomManager,\n processedNodeManager: processedNodeManager,\n canvasManager: canvasManager,\n ignoreCSSAttributes: ignoreCSSAttributes,\n plugins: ((_a = plugins === null || plugins === void 0 ? void 0 : plugins.filter(function (p) {\n return p.observer;\n })) === null || _a === void 0 ? void 0 : _a.map(function (p) {\n return {\n observer: p.observer,\n options: p.options,\n callback: function callback(payload) {\n return wrappedEmit(wrapEvent({\n type: EventType.Plugin,\n data: {\n plugin: p.name,\n payload: payload\n }\n }));\n }\n };\n })) || []\n }, hooks);\n };\n\n iframeManager.addLoadListener(function (iframeEl) {\n try {\n _handlers.push(observe(iframeEl.contentDocument));\n } catch (error) {\n console.warn(error);\n }\n });\n\n var init = function init() {\n takeFullSnapshot();\n\n _handlers.push(observe(document));\n\n recording = true;\n };\n\n if (document.readyState === 'interactive' || document.readyState === 'complete') {\n init();\n } else {\n _handlers.push(on('DOMContentLoaded', function () {\n wrappedEmit(wrapEvent({\n type: EventType.DomContentLoaded,\n data: {}\n }));\n if (recordAfter === 'DOMContentLoaded') init();\n }));\n\n _handlers.push(on('load', function () {\n wrappedEmit(wrapEvent({\n type: EventType.Load,\n data: {}\n }));\n if (recordAfter === 'load') init();\n }, window));\n }\n\n return function () {\n _handlers.forEach(function (h) {\n return h();\n });\n\n processedNodeManager.destroy();\n recording = false;\n unregisterErrorHandler();\n };\n } catch (error) {\n console.warn(error);\n }\n}\n\nrecord.addCustomEvent = function (tag, payload) {\n if (!recording) {\n throw new Error('please add custom event after start recording');\n }\n\n wrappedEmit(wrapEvent({\n type: EventType.Custom,\n data: {\n tag: tag,\n payload: payload\n }\n }));\n};\n\nrecord.freezePage = function () {\n mutationBuffers.forEach(function (buf) {\n return buf.freeze();\n });\n};\n\nrecord.takeFullSnapshot = function (isCheckout) {\n if (!recording) {\n throw new Error('please take full snapshot after start recording');\n }\n\n takeFullSnapshot(isCheckout);\n};\n\nrecord.mirror = mirror;\n/**\n * Converts a timestamp to ms, if it was in s, or keeps it as ms.\n */\n\nfunction timestampToMs(timestamp) {\n var isMs = timestamp > 9999999999;\n return isMs ? timestamp : timestamp * 1000;\n}\n/**\n * Converts a timestamp to s, if it was in ms, or keeps it as s.\n */\n\n\nfunction timestampToS(timestamp) {\n var isMs = timestamp > 9999999999;\n return isMs ? timestamp / 1000 : timestamp;\n}\n/**\n * Add a breadcrumb event to replay.\n */\n\n\nfunction addBreadcrumbEvent(replay, breadcrumb) {\n if (breadcrumb.category === 'sentry.transaction') {\n return;\n }\n\n if (['ui.click', 'ui.input'].includes(breadcrumb.category)) {\n replay.triggerUserActivity();\n } else {\n replay.checkAndHandleExpiredSession();\n }\n\n replay.addUpdate(function () {\n void replay.throttledAddEvent({\n type: EventType.Custom,\n // TODO: We were converting from ms to seconds for breadcrumbs, spans,\n // but maybe we should just keep them as milliseconds\n timestamp: (breadcrumb.timestamp || 0) * 1000,\n data: {\n tag: 'breadcrumb',\n // normalize to max. 10 depth and 1_000 properties per object\n payload: normalize(breadcrumb, 10, 1000)\n }\n }); // Do not flush after console log messages\n\n return breadcrumb.category === 'console';\n });\n}\n\nvar INTERACTIVE_SELECTOR = 'button,a';\n/**\n * For clicks, we check if the target is inside of a button or link\n * If so, we use this as the target instead\n * This is useful because if you click on the image in ,\n * The target will be the image, not the button, which we don't want here\n */\n\nfunction getClickTargetNode(event) {\n var target = getTargetNode(event);\n\n if (!target || !(target instanceof Element)) {\n return target;\n }\n\n var closestInteractive = target.closest(INTERACTIVE_SELECTOR);\n return closestInteractive || target;\n}\n/** Get the event target node. */\n\n\nfunction getTargetNode(event) {\n if (isEventWithTarget(event)) {\n return event.target;\n }\n\n return event;\n}\n\nfunction isEventWithTarget(event) {\n return typeof event === 'object' && !!event && 'target' in event;\n}\n\nvar handlers;\n/**\n * Register a handler to be called when `window.open()` is called.\n * Returns a cleanup function.\n */\n\nfunction onWindowOpen(cb) {\n // Ensure to only register this once\n if (!handlers) {\n handlers = [];\n monkeyPatchWindowOpen();\n }\n\n handlers.push(cb);\n return function () {\n var pos = handlers ? handlers.indexOf(cb) : -1;\n\n if (pos > -1) {\n handlers.splice(pos, 1);\n }\n };\n}\n\nfunction monkeyPatchWindowOpen() {\n fill(WINDOW, 'open', function (originalWindowOpen) {\n return function () {\n if (handlers) {\n try {\n handlers.forEach(function (handler) {\n return handler();\n });\n } catch (e) {// ignore errors in here\n }\n }\n\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n return originalWindowOpen.apply(WINDOW, args);\n };\n });\n}\n/** Handle a click. */\n\n\nfunction handleClick(clickDetector, clickBreadcrumb, node) {\n clickDetector.handleClick(clickBreadcrumb, node);\n}\n/** A click detector class that can be used to detect slow or rage clicks on elements. */\n\n\nvar ClickDetector = /*#__PURE__*/function () {\n // protected for testing\n function ClickDetector(replay, slowClickConfig) {\n var _addBreadcrumbEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : addBreadcrumbEvent;\n\n _classCallCheck(this, ClickDetector);\n\n this._lastMutation = 0;\n this._lastScroll = 0;\n this._clicks = []; // We want everything in s, but options are in ms\n\n this._timeout = slowClickConfig.timeout / 1000;\n this._threshold = slowClickConfig.threshold / 1000;\n this._scollTimeout = slowClickConfig.scrollTimeout / 1000;\n this._replay = replay;\n this._ignoreSelector = slowClickConfig.ignoreSelector;\n this._addBreadcrumbEvent = _addBreadcrumbEvent;\n }\n /** Register click detection handlers on mutation or scroll. */\n\n\n _createClass(ClickDetector, [{\n key: \"addListeners\",\n value: function addListeners() {\n var _this19 = this;\n\n var mutationHandler = function mutationHandler() {\n _this19._lastMutation = nowInSeconds();\n };\n\n var scrollHandler = function scrollHandler() {\n _this19._lastScroll = nowInSeconds();\n };\n\n var cleanupWindowOpen = onWindowOpen(function () {\n // Treat window.open as mutation\n _this19._lastMutation = nowInSeconds();\n });\n\n var clickHandler = function clickHandler(event) {\n if (!event.target) {\n return;\n }\n\n var node = getClickTargetNode(event);\n\n if (node) {\n _this19._handleMultiClick(node);\n }\n };\n\n var obs = new MutationObserver(mutationHandler);\n obs.observe(WINDOW.document.documentElement, {\n attributes: true,\n characterData: true,\n childList: true,\n subtree: true\n });\n WINDOW.addEventListener('scroll', scrollHandler, {\n passive: true\n });\n WINDOW.addEventListener('click', clickHandler, {\n passive: true\n });\n\n this._teardown = function () {\n WINDOW.removeEventListener('scroll', scrollHandler);\n WINDOW.removeEventListener('click', clickHandler);\n cleanupWindowOpen();\n obs.disconnect();\n _this19._clicks = [];\n _this19._lastMutation = 0;\n _this19._lastScroll = 0;\n };\n }\n /** Clean up listeners. */\n\n }, {\n key: \"removeListeners\",\n value: function removeListeners() {\n if (this._teardown) {\n this._teardown();\n }\n\n if (this._checkClickTimeout) {\n clearTimeout(this._checkClickTimeout);\n }\n }\n /** Handle a click */\n\n }, {\n key: \"handleClick\",\n value: function handleClick(breadcrumb, node) {\n if (ignoreElement(node, this._ignoreSelector) || !isClickBreadcrumb(breadcrumb)) {\n return;\n }\n\n var newClick = {\n timestamp: timestampToS(breadcrumb.timestamp),\n clickBreadcrumb: breadcrumb,\n // Set this to 0 so we know it originates from the click breadcrumb\n clickCount: 0,\n node: node\n }; // If there was a click in the last 1s on the same element, ignore it - only keep a single reference per second\n\n if (this._clicks.some(function (click) {\n return click.node === newClick.node && Math.abs(click.timestamp - newClick.timestamp) < 1;\n })) {\n return;\n }\n\n this._clicks.push(newClick); // If this is the first new click, set a timeout to check for multi clicks\n\n\n if (this._clicks.length === 1) {\n this._scheduleCheckClicks();\n }\n }\n /** Count multiple clicks on elements. */\n\n }, {\n key: \"_handleMultiClick\",\n value: function _handleMultiClick(node) {\n this._getClicks(node).forEach(function (click) {\n click.clickCount++;\n });\n }\n /** Get all pending clicks for a given node. */\n\n }, {\n key: \"_getClicks\",\n value: function _getClicks(node) {\n return this._clicks.filter(function (click) {\n return click.node === node;\n });\n }\n /** Check the clicks that happened. */\n\n }, {\n key: \"_checkClicks\",\n value: function _checkClicks() {\n var _this20 = this;\n\n var timedOutClicks = [];\n var now = nowInSeconds();\n\n this._clicks.forEach(function (click) {\n if (!click.mutationAfter && _this20._lastMutation) {\n click.mutationAfter = click.timestamp <= _this20._lastMutation ? _this20._lastMutation - click.timestamp : undefined;\n }\n\n if (!click.scrollAfter && _this20._lastScroll) {\n click.scrollAfter = click.timestamp <= _this20._lastScroll ? _this20._lastScroll - click.timestamp : undefined;\n } // All of these are in seconds!\n\n\n if (click.timestamp + _this20._timeout <= now) {\n timedOutClicks.push(click);\n }\n }); // Remove \"old\" clicks\n\n\n for (var _i7 = 0, _timedOutClicks = timedOutClicks; _i7 < _timedOutClicks.length; _i7++) {\n var click = _timedOutClicks[_i7];\n\n var pos = this._clicks.indexOf(click);\n\n if (pos > -1) {\n this._generateBreadcrumbs(click);\n\n this._clicks.splice(pos, 1);\n }\n } // Trigger new check, unless no clicks left\n\n\n if (this._clicks.length) {\n this._scheduleCheckClicks();\n }\n }\n /** Generate matching breadcrumb(s) for the click. */\n\n }, {\n key: \"_generateBreadcrumbs\",\n value: function _generateBreadcrumbs(click) {\n var replay = this._replay;\n var hadScroll = click.scrollAfter && click.scrollAfter <= this._scollTimeout;\n var hadMutation = click.mutationAfter && click.mutationAfter <= this._threshold;\n var isSlowClick = !hadScroll && !hadMutation;\n var clickCount = click.clickCount,\n clickBreadcrumb = click.clickBreadcrumb; // Slow click\n\n if (isSlowClick) {\n // If `mutationAfter` is set, it means a mutation happened after the threshold, but before the timeout\n // If not, it means we just timed out without scroll & mutation\n var timeAfterClickMs = Math.min(click.mutationAfter || this._timeout, this._timeout) * 1000;\n var endReason = timeAfterClickMs < this._timeout * 1000 ? 'mutation' : 'timeout';\n var breadcrumb = {\n type: 'default',\n message: clickBreadcrumb.message,\n timestamp: clickBreadcrumb.timestamp,\n category: 'ui.slowClickDetected',\n data: _objectSpread(_objectSpread({}, clickBreadcrumb.data), {}, {\n url: WINDOW.location.href,\n route: replay.getCurrentRoute(),\n timeAfterClickMs: timeAfterClickMs,\n endReason: endReason,\n // If clickCount === 0, it means multiClick was not correctly captured here\n // - we still want to send 1 in this case\n clickCount: clickCount || 1\n })\n };\n\n this._addBreadcrumbEvent(replay, breadcrumb);\n\n return;\n } // Multi click\n\n\n if (clickCount > 1) {\n var _breadcrumb = {\n type: 'default',\n message: clickBreadcrumb.message,\n timestamp: clickBreadcrumb.timestamp,\n category: 'ui.multiClick',\n data: _objectSpread(_objectSpread({}, clickBreadcrumb.data), {}, {\n url: WINDOW.location.href,\n route: replay.getCurrentRoute(),\n clickCount: clickCount,\n metric: true\n })\n };\n\n this._addBreadcrumbEvent(replay, _breadcrumb);\n }\n }\n /** Schedule to check current clicks. */\n\n }, {\n key: \"_scheduleCheckClicks\",\n value: function _scheduleCheckClicks() {\n var _this21 = this;\n\n if (this._checkClickTimeout) {\n clearTimeout(this._checkClickTimeout);\n }\n\n this._checkClickTimeout = setTimeout(function () {\n return _this21._checkClicks();\n }, 1000);\n }\n }]);\n\n return ClickDetector;\n}();\n\nvar SLOW_CLICK_TAGS = ['A', 'BUTTON', 'INPUT'];\n/** exported for tests only */\n\nfunction ignoreElement(node, ignoreSelector) {\n if (!SLOW_CLICK_TAGS.includes(node.tagName)) {\n return true;\n } // If tag, we only want to consider input[type='submit'] & input[type='button']\n\n\n if (node.tagName === 'INPUT' && !['submit', 'button'].includes(node.getAttribute('type') || '')) {\n return true;\n } // If tag, detect special variants that may not lead to an action\n // If target !== _self, we may open the link somewhere else, which would lead to no action\n // Also, when downloading a file, we may not leave the page, but still not trigger an action\n\n\n if (node.tagName === 'A' && (node.hasAttribute('download') || node.hasAttribute('target') && node.getAttribute('target') !== '_self')) {\n return true;\n }\n\n if (ignoreSelector && node.matches(ignoreSelector)) {\n return true;\n }\n\n return false;\n}\n\nfunction isClickBreadcrumb(breadcrumb) {\n return !!(breadcrumb.data && typeof breadcrumb.data.nodeId === 'number' && breadcrumb.timestamp);\n} // This is good enough for us, and is easier to test/mock than `timestampInSeconds`\n\n\nfunction nowInSeconds() {\n return Date.now() / 1000;\n}\n/**\n * Create a breadcrumb for a replay.\n */\n\n\nfunction createBreadcrumb(breadcrumb) {\n return _objectSpread({\n timestamp: Date.now() / 1000,\n type: 'default'\n }, breadcrumb);\n}\n\nvar NodeType;\n\n(function (NodeType) {\n NodeType[NodeType[\"Document\"] = 0] = \"Document\";\n NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\n NodeType[NodeType[\"Element\"] = 2] = \"Element\";\n NodeType[NodeType[\"Text\"] = 3] = \"Text\";\n NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\n NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\n})(NodeType || (NodeType = {})); // Note that these are the serialized attributes and not attributes directly on\n// the DOM Node. Attributes we are interested in:\n\n\nvar ATTRIBUTES_TO_RECORD = new Set(['id', 'class', 'aria-label', 'role', 'name', 'alt', 'title', 'data-test-id', 'data-testid', 'disabled', 'aria-disabled']);\n/**\n * Inclusion list of attributes that we want to record from the DOM element\n */\n\nfunction getAttributesToRecord(attributes) {\n var obj = {};\n\n for (var key in attributes) {\n if (ATTRIBUTES_TO_RECORD.has(key)) {\n var normalizedKey = key;\n\n if (key === 'data-testid' || key === 'data-test-id') {\n normalizedKey = 'testId';\n }\n\n obj[normalizedKey] = attributes[key];\n }\n }\n\n return obj;\n}\n\nvar handleDomListener = function handleDomListener(replay) {\n return function (handlerData) {\n if (!replay.isEnabled()) {\n return;\n }\n\n var result = handleDom(handlerData);\n\n if (!result) {\n return;\n }\n\n var isClick = handlerData.name === 'click';\n var event = isClick && handlerData.event; // Ignore clicks if ctrl/alt/meta/shift keys are held down as they alter behavior of clicks (e.g. open in new tab)\n\n if (isClick && replay.clickDetector && event && !event.altKey && !event.metaKey && !event.ctrlKey && !event.shiftKey) {\n handleClick(replay.clickDetector, result, getClickTargetNode(handlerData.event));\n }\n\n addBreadcrumbEvent(replay, result);\n };\n};\n/** Get the base DOM breadcrumb. */\n\n\nfunction getBaseDomBreadcrumb(target, message) {\n var nodeId = record.mirror.getId(target);\n var node = nodeId && record.mirror.getNode(nodeId);\n var meta = node && record.mirror.getMeta(node);\n var element = meta && isElement(meta) ? meta : null;\n return {\n message: message,\n data: element ? {\n nodeId: nodeId,\n node: {\n id: nodeId,\n tagName: element.tagName,\n textContent: Array.from(element.childNodes).map(function (node) {\n return node.type === NodeType.Text && node.textContent;\n }).filter(Boolean) // filter out empty values\n .map(function (text) {\n return text.trim();\n }).join(''),\n attributes: getAttributesToRecord(element.attributes)\n }\n } : {}\n };\n}\n/**\n * An event handler to react to DOM events.\n * Exported for tests.\n */\n\n\nfunction handleDom(handlerData) {\n var _getDomTarget = getDomTarget(handlerData),\n target = _getDomTarget.target,\n message = _getDomTarget.message;\n\n return createBreadcrumb(_objectSpread({\n category: \"ui.\".concat(handlerData.name)\n }, getBaseDomBreadcrumb(target, message)));\n}\n\nfunction getDomTarget(handlerData) {\n var isClick = handlerData.name === 'click';\n var message;\n var target = null; // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n\n try {\n target = isClick ? getClickTargetNode(handlerData.event) : getTargetNode(handlerData.event);\n message = htmlTreeAsString(target, {\n maxStringLength: 200\n }) || '';\n } catch (e) {\n message = '';\n }\n\n return {\n target: target,\n message: message\n };\n}\n\nfunction isElement(node) {\n return node.type === NodeType.Element;\n}\n/** Handle keyboard events & create breadcrumbs. */\n\n\nfunction handleKeyboardEvent(replay, event) {\n if (!replay.isEnabled()) {\n return;\n } // Update user activity, but do not restart recording as it can create\n // noisy/low-value replays (e.g. user comes back from idle, hits alt-tab, new\n // session with a single \"keydown\" breadcrumb is created)\n\n\n replay.updateUserActivity();\n var breadcrumb = getKeyboardBreadcrumb(event);\n\n if (!breadcrumb) {\n return;\n }\n\n addBreadcrumbEvent(replay, breadcrumb);\n}\n/** exported only for tests */\n\n\nfunction getKeyboardBreadcrumb(event) {\n var metaKey = event.metaKey,\n shiftKey = event.shiftKey,\n ctrlKey = event.ctrlKey,\n altKey = event.altKey,\n key = event.key,\n target = event.target; // never capture for input fields\n\n if (!target || isInputElement(target) || !key) {\n return null;\n } // Note: We do not consider shift here, as that means \"uppercase\"\n\n\n var hasModifierKey = metaKey || ctrlKey || altKey;\n var isCharacterKey = key.length === 1; // other keys like Escape, Tab, etc have a longer length\n // Do not capture breadcrumb if only a word key is pressed\n // This could leak e.g. user input\n\n if (!hasModifierKey && isCharacterKey) {\n return null;\n }\n\n var message = htmlTreeAsString(target, {\n maxStringLength: 200\n }) || '';\n var baseBreadcrumb = getBaseDomBreadcrumb(target, message);\n return createBreadcrumb({\n category: 'ui.keyDown',\n message: message,\n data: _objectSpread(_objectSpread({}, baseBreadcrumb.data), {}, {\n metaKey: metaKey,\n shiftKey: shiftKey,\n ctrlKey: ctrlKey,\n altKey: altKey,\n key: key\n })\n });\n}\n\nfunction isInputElement(target) {\n return target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable;\n} // Map entryType -> function to normalize data for event\n\n\nvar ENTRY_TYPES = {\n // @ts-expect-error TODO: entry type does not fit the create* functions entry type\n resource: createResourceEntry,\n paint: createPaintEntry,\n // @ts-expect-error TODO: entry type does not fit the create* functions entry type\n navigation: createNavigationEntry\n};\n/**\n * Create replay performance entries from the browser performance entries.\n */\n\nfunction createPerformanceEntries(entries) {\n return entries.map(createPerformanceEntry).filter(Boolean);\n}\n\nfunction createPerformanceEntry(entry) {\n if (!ENTRY_TYPES[entry.entryType]) {\n return null;\n }\n\n return ENTRY_TYPES[entry.entryType](entry);\n}\n\nfunction getAbsoluteTime(time) {\n // browserPerformanceTimeOrigin can be undefined if `performance` or\n // `performance.now` doesn't exist, but this is already checked by this integration\n return ((browserPerformanceTimeOrigin || WINDOW.performance.timeOrigin) + time) / 1000;\n}\n\nfunction createPaintEntry(entry) {\n var duration = entry.duration,\n entryType = entry.entryType,\n name = entry.name,\n startTime = entry.startTime;\n var start = getAbsoluteTime(startTime);\n return {\n type: entryType,\n name: name,\n start: start,\n end: start + duration,\n data: undefined\n };\n}\n\nfunction createNavigationEntry(entry) {\n var entryType = entry.entryType,\n name = entry.name,\n decodedBodySize = entry.decodedBodySize,\n duration = entry.duration,\n domComplete = entry.domComplete,\n encodedBodySize = entry.encodedBodySize,\n domContentLoadedEventStart = entry.domContentLoadedEventStart,\n domContentLoadedEventEnd = entry.domContentLoadedEventEnd,\n domInteractive = entry.domInteractive,\n loadEventStart = entry.loadEventStart,\n loadEventEnd = entry.loadEventEnd,\n redirectCount = entry.redirectCount,\n startTime = entry.startTime,\n transferSize = entry.transferSize,\n type = entry.type; // Ignore entries with no duration, they do not seem to be useful and cause dupes\n\n if (duration === 0) {\n return null;\n }\n\n return {\n type: \"\".concat(entryType, \".\").concat(type),\n start: getAbsoluteTime(startTime),\n end: getAbsoluteTime(domComplete),\n name: name,\n data: {\n size: transferSize,\n decodedBodySize: decodedBodySize,\n encodedBodySize: encodedBodySize,\n duration: duration,\n domInteractive: domInteractive,\n domContentLoadedEventStart: domContentLoadedEventStart,\n domContentLoadedEventEnd: domContentLoadedEventEnd,\n loadEventStart: loadEventStart,\n loadEventEnd: loadEventEnd,\n domComplete: domComplete,\n redirectCount: redirectCount\n }\n };\n}\n\nfunction createResourceEntry(entry) {\n var entryType = entry.entryType,\n initiatorType = entry.initiatorType,\n name = entry.name,\n responseEnd = entry.responseEnd,\n startTime = entry.startTime,\n decodedBodySize = entry.decodedBodySize,\n encodedBodySize = entry.encodedBodySize,\n responseStatus = entry.responseStatus,\n transferSize = entry.transferSize; // Core SDK handles these\n\n if (['fetch', 'xmlhttprequest'].includes(initiatorType)) {\n return null;\n }\n\n return {\n type: \"\".concat(entryType, \".\").concat(initiatorType),\n start: getAbsoluteTime(startTime),\n end: getAbsoluteTime(responseEnd),\n name: name,\n data: {\n size: transferSize,\n statusCode: responseStatus,\n decodedBodySize: decodedBodySize,\n encodedBodySize: encodedBodySize\n }\n };\n}\n/**\n * Add a LCP event to the replay based on an LCP metric.\n */\n\n\nfunction getLargestContentfulPaint(metric) {\n var entries = metric.entries;\n var lastEntry = entries[entries.length - 1];\n var element = lastEntry ? lastEntry.element : undefined;\n var value = metric.value;\n var end = getAbsoluteTime(value);\n var data = {\n type: 'largest-contentful-paint',\n name: 'largest-contentful-paint',\n start: end,\n end: end,\n data: {\n value: value,\n size: value,\n nodeId: element ? record.mirror.getId(element) : undefined\n }\n };\n return data;\n}\n/**\n * Sets up a PerformanceObserver to listen to all performance entry types.\n * Returns a callback to stop observing.\n */\n\n\nfunction setupPerformanceObserver(replay) {\n function addPerformanceEntry(entry) {\n // It is possible for entries to come up multiple times\n if (!replay.performanceEntries.includes(entry)) {\n replay.performanceEntries.push(entry);\n }\n }\n\n function onEntries(_ref23) {\n var entries = _ref23.entries;\n entries.forEach(addPerformanceEntry);\n }\n\n var clearCallbacks = [];\n ['navigation', 'paint', 'resource'].forEach(function (type) {\n clearCallbacks.push(addPerformanceInstrumentationHandler(type, onEntries));\n });\n clearCallbacks.push(addLcpInstrumentationHandler(function (_ref24) {\n var metric = _ref24.metric;\n replay.replayPerformanceEntries.push(getLargestContentfulPaint(metric));\n })); // A callback to cleanup all handlers\n\n return function () {\n clearCallbacks.forEach(function (clearCallback) {\n return clearCallback();\n });\n };\n}\n\nvar r = \"var t={},e={};function a(t){let e=t.length;for(;--e>=0;)t[e]=0}const s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),r=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),n=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_=new Array(576);a(_);const l=new Array(60);a(l);const h=new Array(512);a(h);const o=new Array(256);a(o);const d=new Array(29);a(d);const u=new Array(30);function f(t,e,a,s,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=s,this.max_length=r,this.has_stree=t&&t.length}let c,p,g;function w(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}a(u);const m=t=>t<256?h[t]:h[256+(t>>>7)],b=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},y=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{y(t,a[2*e],a[2*e+1])},z=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},k=(t,e,a)=>{const s=new Array(16);let r,n,i=0;for(r=1;r<=15;r++)i=i+a[r-1]<<1,s[r]=i;for(n=0;n<=e;n++){let e=t[2*n+1];0!==e&&(t[2*n]=z(s[e]++,e))}},x=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},A=t=>{t.bi_valid>8?b(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},E=(t,e,a,s)=>{const r=2*e,n=2*a;return t[r]{const s=t.heap[a];let r=a<<1;for(;r<=t.heap_len&&(r{let n,i,_,l,h=0;if(0!==t.sym_next)do{n=255&t.pending_buf[t.sym_buf+h++],n+=(255&t.pending_buf[t.sym_buf+h++])<<8,i=t.pending_buf[t.sym_buf+h++],0===n?v(t,i,e):(_=o[i],v(t,_+256+1,e),l=s[_],0!==l&&(i-=d[_],y(t,i,l)),n--,_=m(n),v(t,_,a),l=r[_],0!==l&&(n-=u[_],y(t,n,l)))}while(h{const a=e.dyn_tree,s=e.stat_desc.static_tree,r=e.stat_desc.has_stree,n=e.stat_desc.elems;let i,_,l,h=-1;for(t.heap_len=0,t.heap_max=573,i=0;i>1;i>=1;i--)Z(t,a,i);l=n;do{i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Z(t,a,1),_=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=_,a[2*l]=a[2*i]+a[2*_],t.depth[l]=(t.depth[i]>=t.depth[_]?t.depth[i]:t.depth[_])+1,a[2*i+1]=a[2*_+1]=l,t.heap[1]=l++,Z(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,s=e.max_code,r=e.stat_desc.static_tree,n=e.stat_desc.has_stree,i=e.stat_desc.extra_bits,_=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,o,d,u,f,c,p=0;for(u=0;u<=15;u++)t.bl_count[u]=0;for(a[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)o=t.heap[h],u=a[2*a[2*o+1]+1]+1,u>l&&(u=l,p++),a[2*o+1]=u,o>s||(t.bl_count[u]++,f=0,o>=_&&(f=i[o-_]),c=a[2*o],t.opt_len+=c*(u+f),n&&(t.static_len+=c*(r[2*o+1]+f)));if(0!==p){do{for(u=l-1;0===t.bl_count[u];)u--;t.bl_count[u]--,t.bl_count[u+1]+=2,t.bl_count[l]--,p-=2}while(p>0);for(u=l;0!==u;u--)for(o=t.bl_count[u];0!==o;)d=t.heap[--h],d>s||(a[2*d+1]!==u&&(t.opt_len+=(u-a[2*d+1])*a[2*d],a[2*d+1]=u),o--)}})(t,e),k(a,h,t.bl_count)},R=(t,e,a)=>{let s,r,n=-1,i=e[1],_=0,l=7,h=4;for(0===i&&(l=138,h=3),e[2*(a+1)+1]=65535,s=0;s<=a;s++)r=i,i=e[2*(s+1)+1],++_{let s,r,n=-1,i=e[1],_=0,l=7,h=4;for(0===i&&(l=138,h=3),s=0;s<=a;s++)if(r=i,i=e[2*(s+1)+1],!(++_{y(t,0+(s?1:0),3),A(t),b(t,a),b(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a};e._tr_init=t=>{T||((()=>{let t,e,a,i,w;const m=new Array(16);for(a=0,i=0;i<28;i++)for(d[i]=a,t=0;t<1<>=7;i<30;i++)for(u[i]=w<<7,t=0;t<1<{let r,n,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),U(t,t.l_desc),U(t,t.d_desc),h=(t=>{let e;for(R(t,t.dyn_ltree,t.l_desc.max_code),R(t,t.dyn_dtree,t.d_desc.max_code),U(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),r=t.opt_len+3+7>>>3,n=t.static_len+3+7>>>3,n<=r&&(r=n)):r=n=a+5,a+4<=r&&-1!==e?F(t,e,a,s):4===t.strategy||n===r?(y(t,2+(s?1:0),3),S(t,_,l)):(y(t,4+(s?1:0),3),((t,e,a,s)=>{let r;for(y(t,e-257,5),y(t,a-1,5),y(t,s-4,4),r=0;r(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=a,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(o[a]+256+1)]++,t.dyn_dtree[2*m(e)]++),t.sym_next===t.sym_end),e._tr_align=t=>{y(t,2,3),v(t,256,_),(t=>{16===t.bi_valid?(b(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)};var O=(t,e,a,s)=>{let r=65535&t|0,n=t>>>16&65535|0,i=0;for(;0!==a;){i=a>2e3?2e3:a,a-=i;do{r=r+e[s++]|0,n=n+r|0}while(--i);r%=65521,n%=65521}return r|n<<16|0};const D=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var s=0;s<8;s++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var N=(t,e,a,s)=>{const r=D,n=s+a;t^=-1;for(let a=s;a>>8^r[255&(t^e[a])];return-1^t},C={2:\\\"need dictionary\\\",1:\\\"stream end\\\",0:\\\"\\\",\\\"-1\\\":\\\"file error\\\",\\\"-2\\\":\\\"stream error\\\",\\\"-3\\\":\\\"data error\\\",\\\"-4\\\":\\\"insufficient memory\\\",\\\"-5\\\":\\\"buffer error\\\",\\\"-6\\\":\\\"incompatible version\\\"},I={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:H,_tr_stored_block:B,_tr_flush_block:M,_tr_tally:P,_tr_align:Y}=e,K=O,j=N,G=C,{Z_NO_FLUSH:X,Z_PARTIAL_FLUSH:W,Z_FULL_FLUSH:q,Z_FINISH:J,Z_BLOCK:Q,Z_OK:V,Z_STREAM_END:$,Z_STREAM_ERROR:tt,Z_DATA_ERROR:et,Z_BUF_ERROR:at,Z_DEFAULT_COMPRESSION:st,Z_FILTERED:rt,Z_HUFFMAN_ONLY:nt,Z_RLE:it,Z_FIXED:_t,Z_DEFAULT_STRATEGY:lt,Z_UNKNOWN:ht,Z_DEFLATED:ot}=I,dt=(t,e)=>(t.msg=G[e],e),ut=t=>2*t-(t>4?9:0),ft=t=>{let e=t.length;for(;--e>=0;)t[e]=0},ct=t=>{let e,a,s,r=t.w_size;e=t.hash_size,s=e;do{a=t.head[--s],t.head[s]=a>=r?a-r:0}while(--e);e=r,s=e;do{a=t.prev[--s],t.prev[s]=a>=r?a-r:0}while(--e)};let pt=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},wt=(t,e)=>{M(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,gt(t.strm)},mt=(t,e)=>{t.pending_buf[t.pending++]=e},bt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},yt=(t,e,a,s)=>{let r=t.avail_in;return r>s&&(r=s),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=K(t.adler,e,r,a):2===t.state.wrap&&(t.adler=j(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},vt=(t,e)=>{let a,s,r=t.max_chain_length,n=t.strstart,i=t.prev_length,_=t.nice_match;const l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,h=t.window,o=t.w_mask,d=t.prev,u=t.strstart+258;let f=h[n+i-1],c=h[n+i];t.prev_length>=t.good_match&&(r>>=2),_>t.lookahead&&(_=t.lookahead);do{if(a=e,h[a+i]===c&&h[a+i-1]===f&&h[a]===h[n]&&h[++a]===h[n+1]){n+=2,a++;do{}while(h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&ni){if(t.match_start=e,i=s,s>=_)break;f=h[n+i-1],c=h[n+i]}}}while((e=d[e&o])>l&&0!=--r);return i<=t.lookahead?i:t.lookahead},zt=t=>{const e=t.w_size;let a,s,r;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)&&(t.window.set(t.window.subarray(e,e+e-s),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),ct(t),s+=e),0===t.strm.avail_in)break;if(a=yt(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=a,t.lookahead+t.insert>=3)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=pt(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=pt(t,t.ins_h,t.window[r+3-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},kt=(t,e)=>{let a,s,r,n=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,i=0,_=t.strm.avail_in;do{if(a=65535,r=t.bi_valid+42>>3,t.strm.avail_outs+t.strm.avail_in&&(a=s+t.strm.avail_in),a>r&&(a=r),a>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,gt(t.strm),s&&(s>a&&(s=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+s),t.strm.next_out),t.strm.next_out+=s,t.strm.avail_out-=s,t.strm.total_out+=s,t.block_start+=s,a-=s),a&&(yt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===i);return _-=t.strm.avail_in,_&&(_>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=_&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-_,t.strm.next_in),t.strstart),t.strstart+=_,t.insert+=_>t.w_size-t.insert?t.w_size-t.insert:_),t.block_start=t.strstart),t.high_waterr&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,r+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),r>t.strm.avail_in&&(r=t.strm.avail_in),r&&(yt(t.strm,t.window,t.strstart,r),t.strstart+=r,t.insert+=r>t.w_size-t.insert?t.w_size-t.insert:r),t.high_water>3,r=t.pending_buf_size-r>65535?65535:t.pending_buf_size-r,n=r>t.w_size?t.w_size:r,s=t.strstart-t.block_start,(s>=n||(s||e===J)&&e!==X&&0===t.strm.avail_in&&s<=r)&&(a=s>r?r:s,i=e===J&&0===t.strm.avail_in&&a===s?1:0,B(t,t.block_start,a,i),t.block_start+=a,gt(t.strm)),i?3:1)},xt=(t,e)=>{let a,s;for(;;){if(t.lookahead<262){if(zt(t),t.lookahead<262&&e===X)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=pt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-262&&(t.match_length=vt(t,a)),t.match_length>=3)if(s=P(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=pt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=pt(t,t.ins_h,t.window[t.strstart+1]);else s=P(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(s&&(wt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===J?(wt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(wt(t,!1),0===t.strm.avail_out)?1:2},At=(t,e)=>{let a,s,r;for(;;){if(t.lookahead<262){if(zt(t),t.lookahead<262&&e===X)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=pt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,s=P(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=pt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,s&&(wt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(s=P(t,0,t.window[t.strstart-1]),s&&wt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(s=P(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===J?(wt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(wt(t,!1),0===t.strm.avail_out)?1:2};function Et(t,e,a,s,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=s,this.func=r}const Zt=[new Et(0,0,0,0,kt),new Et(4,4,8,4,xt),new Et(4,5,16,8,xt),new Et(4,6,32,32,xt),new Et(4,4,16,16,At),new Et(8,16,32,32,At),new Et(8,16,128,128,At),new Et(8,32,128,256,At),new Et(32,128,258,1024,At),new Et(32,258,258,4096,At)];function St(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ot,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ft(this.dyn_ltree),ft(this.dyn_dtree),ft(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ft(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ft(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ut=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},Rt=t=>{if(Ut(t))return dt(t,tt);t.total_in=t.total_out=0,t.data_type=ht;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,H(e),V},Lt=t=>{const e=Rt(t);var a;return e===V&&((a=t.state).window_size=2*a.w_size,ft(a.head),a.max_lazy_match=Zt[a.level].max_lazy,a.good_match=Zt[a.level].good_length,a.nice_match=Zt[a.level].nice_length,a.max_chain_length=Zt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Tt=(t,e,a,s,r,n)=>{if(!t)return tt;let i=1;if(e===st&&(e=6),s<0?(i=0,s=-s):s>15&&(i=2,s-=16),r<1||r>9||a!==ot||s<8||s>15||e<0||e>9||n<0||n>_t||8===s&&1!==i)return dt(t,tt);8===s&&(s=9);const _=new St;return t.state=_,_.strm=t,_.status=42,_.wrap=i,_.gzhead=null,_.w_bits=s,_.w_size=1<<_.w_bits,_.w_mask=_.w_size-1,_.hash_bits=r+7,_.hash_size=1<<_.hash_bits,_.hash_mask=_.hash_size-1,_.hash_shift=~~((_.hash_bits+3-1)/3),_.window=new Uint8Array(2*_.w_size),_.head=new Uint16Array(_.hash_size),_.prev=new Uint16Array(_.w_size),_.lit_bufsize=1<Tt(t,e,ot,15,8,lt),t.deflateInit2=Tt,t.deflateReset=Lt,t.deflateResetKeep=Rt,t.deflateSetHeader=(t,e)=>Ut(t)||2!==t.state.wrap?tt:(t.state.gzhead=e,V),t.deflate=(t,e)=>{if(Ut(t)||e>Q||e<0)return t?dt(t,tt):tt;const a=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===a.status&&e!==J)return dt(t,0===t.avail_out?at:tt);const s=a.last_flush;if(a.last_flush=e,0!==a.pending){if(gt(t),0===t.avail_out)return a.last_flush=-1,V}else if(0===t.avail_in&&ut(e)<=ut(s)&&e!==J)return dt(t,at);if(666===a.status&&0!==t.avail_in)return dt(t,at);if(42===a.status&&0===a.wrap&&(a.status=113),42===a.status){let e=ot+(a.w_bits-8<<4)<<8,s=-1;if(s=a.strategy>=nt||a.level<2?0:a.level<6?1:6===a.level?2:3,e|=s<<6,0!==a.strstart&&(e|=32),e+=31-e%31,bt(a,e),0!==a.strstart&&(bt(a,t.adler>>>16),bt(a,65535&t.adler)),t.adler=1,a.status=113,gt(t),0!==a.pending)return a.last_flush=-1,V}if(57===a.status)if(t.adler=0,mt(a,31),mt(a,139),mt(a,8),a.gzhead)mt(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),mt(a,255&a.gzhead.time),mt(a,a.gzhead.time>>8&255),mt(a,a.gzhead.time>>16&255),mt(a,a.gzhead.time>>24&255),mt(a,9===a.level?2:a.strategy>=nt||a.level<2?4:0),mt(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(mt(a,255&a.gzhead.extra.length),mt(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=j(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(mt(a,0),mt(a,0),mt(a,0),mt(a,0),mt(a,0),mt(a,9===a.level?2:a.strategy>=nt||a.level<2?4:0),mt(a,3),a.status=113,gt(t),0!==a.pending)return a.last_flush=-1,V;if(69===a.status){if(a.gzhead.extra){let e=a.pending,s=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+s>a.pending_buf_size;){let r=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+r),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>e&&(t.adler=j(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex+=r,gt(t),0!==a.pending)return a.last_flush=-1,V;e=0,s-=r}let r=new Uint8Array(a.gzhead.extra);a.pending_buf.set(r.subarray(a.gzindex,a.gzindex+s),a.pending),a.pending+=s,a.gzhead.hcrc&&a.pending>e&&(t.adler=j(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let e,s=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>s&&(t.adler=j(t.adler,a.pending_buf,a.pending-s,s)),gt(t),0!==a.pending)return a.last_flush=-1,V;s=0}e=a.gzindexs&&(t.adler=j(t.adler,a.pending_buf,a.pending-s,s)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let e,s=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>s&&(t.adler=j(t.adler,a.pending_buf,a.pending-s,s)),gt(t),0!==a.pending)return a.last_flush=-1,V;s=0}e=a.gzindexs&&(t.adler=j(t.adler,a.pending_buf,a.pending-s,s))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(gt(t),0!==a.pending))return a.last_flush=-1,V;mt(a,255&t.adler),mt(a,t.adler>>8&255),t.adler=0}if(a.status=113,gt(t),0!==a.pending)return a.last_flush=-1,V}if(0!==t.avail_in||0!==a.lookahead||e!==X&&666!==a.status){let s=0===a.level?kt(a,e):a.strategy===nt?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(zt(t),0===t.lookahead)){if(e===X)return 1;break}if(t.match_length=0,a=P(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(wt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===J?(wt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(wt(t,!1),0===t.strm.avail_out)?1:2})(a,e):a.strategy===it?((t,e)=>{let a,s,r,n;const i=t.window;for(;;){if(t.lookahead<=258){if(zt(t),t.lookahead<=258&&e===X)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=t.strstart-1,s=i[r],s===i[++r]&&s===i[++r]&&s===i[++r])){n=t.strstart+258;do{}while(s===i[++r]&&s===i[++r]&&s===i[++r]&&s===i[++r]&&s===i[++r]&&s===i[++r]&&s===i[++r]&&s===i[++r]&&rt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=P(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=P(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(wt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===J?(wt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(wt(t,!1),0===t.strm.avail_out)?1:2})(a,e):Zt[a.level].func(a,e);if(3!==s&&4!==s||(a.status=666),1===s||3===s)return 0===t.avail_out&&(a.last_flush=-1),V;if(2===s&&(e===W?Y(a):e!==Q&&(B(a,0,0,!1),e===q&&(ft(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),gt(t),0===t.avail_out))return a.last_flush=-1,V}return e!==J?V:a.wrap<=0?$:(2===a.wrap?(mt(a,255&t.adler),mt(a,t.adler>>8&255),mt(a,t.adler>>16&255),mt(a,t.adler>>24&255),mt(a,255&t.total_in),mt(a,t.total_in>>8&255),mt(a,t.total_in>>16&255),mt(a,t.total_in>>24&255)):(bt(a,t.adler>>>16),bt(a,65535&t.adler)),gt(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?V:$)},t.deflateEnd=t=>{if(Ut(t))return tt;const e=t.state.status;return t.state=null,113===e?dt(t,et):V},t.deflateSetDictionary=(t,e)=>{let a=e.length;if(Ut(t))return tt;const s=t.state,r=s.wrap;if(2===r||1===r&&42!==s.status||s.lookahead)return tt;if(1===r&&(t.adler=K(t.adler,e,a,0)),s.wrap=0,a>=s.w_size){0===r&&(ft(s.head),s.strstart=0,s.block_start=0,s.insert=0);let t=new Uint8Array(s.w_size);t.set(e.subarray(a-s.w_size,a),0),e=t,a=s.w_size}const n=t.avail_in,i=t.next_in,_=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,zt(s);s.lookahead>=3;){let t=s.strstart,e=s.lookahead-2;do{s.ins_h=pt(s,s.ins_h,s.window[t+3-1]),s.prev[t&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=t,t++}while(--e);s.strstart=t,s.lookahead=2,zt(s)}return s.strstart+=s.lookahead,s.block_start=s.strstart,s.insert=s.lookahead,s.lookahead=0,s.match_length=s.prev_length=2,s.match_available=0,t.next_in=i,t.input=_,t.avail_in=n,s.wrap=r,V},t.deflateInfo=\\\"pako deflate (from Nodeca project)\\\";var Ft={};const Ot=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);Ft.assign=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if(\\\"object\\\"!=typeof a)throw new TypeError(a+\\\"must be non-object\\\");for(const e in a)Ot(a,e)&&(t[e]=a[e])}}return t},Ft.flattenChunks=t=>{let e=0;for(let a=0,s=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Ct[254]=Ct[254]=1,Dt.string2buf=t=>{if(\\\"function\\\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,s,r,n,i=t.length,_=0;for(r=0;r>>6,e[n++]=128|63&a):a<65536?(e[n++]=224|a>>>12,e[n++]=128|a>>>6&63,e[n++]=128|63&a):(e[n++]=240|a>>>18,e[n++]=128|a>>>12&63,e[n++]=128|a>>>6&63,e[n++]=128|63&a);return e};Dt.buf2string=(t,e)=>{const a=e||t.length;if(\\\"function\\\"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let s,r;const n=new Array(2*a);for(r=0,s=0;s4)n[r++]=65533,s+=i-1;else{for(e&=2===i?31:3===i?15:7;i>1&&s1?n[r++]=65533:e<65536?n[r++]=e:(e-=65536,n[r++]=55296|e>>10&1023,n[r++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Nt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a=\\\"\\\";for(let s=0;s{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Ct[t[a]]>e?a:e};const It=t,Ht=Ft,Bt=Dt,Mt=C,Pt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\\\"\\\",this.state=null,this.data_type=2,this.adler=0},Yt=Object.prototype.toString,{Z_NO_FLUSH:Kt,Z_SYNC_FLUSH:jt,Z_FULL_FLUSH:Gt,Z_FINISH:Xt,Z_OK:Wt,Z_STREAM_END:qt,Z_DEFAULT_COMPRESSION:Jt,Z_DEFAULT_STRATEGY:Qt,Z_DEFLATED:Vt}=I;function $t(t){this.options=Ht.assign({level:Jt,method:Vt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Qt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg=\\\"\\\",this.ended=!1,this.chunks=[],this.strm=new Pt,this.strm.avail_out=0;let a=It.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Wt)throw new Error(Mt[a]);if(e.header&&It.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t=\\\"string\\\"==typeof e.dictionary?Bt.string2buf(e.dictionary):\\\"[object ArrayBuffer]\\\"===Yt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=It.deflateSetDictionary(this.strm,t),a!==Wt)throw new Error(Mt[a]);this._dict_set=!0}}$t.prototype.push=function(t,e){const a=this.strm,s=this.options.chunkSize;let r,n;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Xt:Kt,\\\"string\\\"==typeof t?a.input=Bt.string2buf(t):\\\"[object ArrayBuffer]\\\"===Yt.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(s),a.next_out=0,a.avail_out=s),(n===jt||n===Gt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(r=It.deflate(a,n),r===qt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),r=It.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Wt;if(0!==a.avail_out){if(n>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},$t.prototype.onData=function(t){this.chunks.push(t)},$t.prototype.onEnd=function(t){t===Wt&&(this.result=Ht.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const te=$t,ee=function(t,e){const a=new $t(e);if(a.push(t,!0),a.err)throw a.msg||Mt[a.err];return a.result},ae=I;const se=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error(\\\"Adding invalid event\\\");const e=this._hasEvents?\\\",\\\":\\\"\\\";this.deflate.push(e+t,ae.Z_SYNC_FLUSH),this._hasEvents=!0}finish(){if(this.deflate.push(\\\"]\\\",ae.Z_FINISH),this.deflate.err)throw this.deflate.err;const t=this.deflate.result;return this._init(),t}_init(){this._hasEvents=!1,this.deflate=new te,this.deflate.push(\\\"[\\\",ae.Z_NO_FLUSH)}},re={clear:()=>{se.clear()},addEvent:t=>se.addEvent(t),finish:()=>se.finish(),compress:t=>function(t){return ee(t)}(t)};addEventListener(\\\"message\\\",(function(t){const e=t.data.method,a=t.data.id,s=t.data.arg;if(e in re&&\\\"function\\\"==typeof re[e])try{const t=re[e](s);postMessage({id:a,method:e,success:!0,response:t})}catch(t){postMessage({id:a,method:e,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:\\\"init\\\",success:!0,response:void 0});\";\n\nfunction e() {\n var e = new Blob([r]);\n return URL.createObjectURL(e);\n}\n/**\n * Log a message in debug mode, and add a breadcrumb when _experiment.traceInternals is enabled.\n */\n\n\nfunction logInfo(message, shouldAddBreadcrumb) {\n if (!(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {\n return;\n }\n\n logger.info(message);\n\n if (shouldAddBreadcrumb) {\n addBreadcrumb(message);\n }\n}\n/**\n * Log a message, and add a breadcrumb in the next tick.\n * This is necessary when the breadcrumb may be added before the replay is initialized.\n */\n\n\nfunction logInfoNextTick(message, shouldAddBreadcrumb) {\n if (!(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {\n return;\n }\n\n logger.info(message);\n\n if (shouldAddBreadcrumb) {\n // Wait a tick here to avoid race conditions for some initial logs\n // which may be added before replay is initialized\n setTimeout(function () {\n addBreadcrumb(message);\n }, 0);\n }\n}\n\nfunction addBreadcrumb(message) {\n var hub = getCurrentHub();\n hub.addBreadcrumb({\n category: 'console',\n data: {\n logger: 'replay'\n },\n level: 'info',\n message: message\n }, {\n level: 'info'\n });\n}\n/** This error indicates that the event buffer size exceeded the limit.. */\n\n\nvar EventBufferSizeExceededError = /*#__PURE__*/function (_Error) {\n _inherits(EventBufferSizeExceededError, _Error);\n\n var _super = _createSuper(EventBufferSizeExceededError);\n\n function EventBufferSizeExceededError() {\n _classCallCheck(this, EventBufferSizeExceededError);\n\n return _super.call(this, \"Event buffer exceeded maximum size of \".concat(REPLAY_MAX_EVENT_BUFFER_SIZE, \".\"));\n }\n\n return _createClass(EventBufferSizeExceededError);\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n/**\n * A basic event buffer that does not do any compression.\n * Used as fallback if the compression worker cannot be loaded or is disabled.\n */\n\n\nvar EventBufferArray = /*#__PURE__*/function () {\n /** All the events that are buffered to be sent. */\n\n /** @inheritdoc */\n function EventBufferArray() {\n _classCallCheck(this, EventBufferArray);\n\n this.events = [];\n this._totalSize = 0;\n this.hasCheckout = false;\n }\n /** @inheritdoc */\n\n\n _createClass(EventBufferArray, [{\n key: \"hasEvents\",\n get: function get() {\n return this.events.length > 0;\n }\n /** @inheritdoc */\n\n }, {\n key: \"type\",\n get: function get() {\n return 'sync';\n }\n /** @inheritdoc */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.events = [];\n }\n /** @inheritdoc */\n\n }, {\n key: \"addEvent\",\n value: function () {\n var _addEvent2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(event) {\n var eventSize;\n return _regeneratorRuntime.wrap(function _callee2$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n eventSize = JSON.stringify(event).length;\n this._totalSize += eventSize;\n\n if (!(this._totalSize > REPLAY_MAX_EVENT_BUFFER_SIZE)) {\n _context3.next = 4;\n break;\n }\n\n throw new EventBufferSizeExceededError();\n\n case 4:\n this.events.push(event);\n\n case 5:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function addEvent(_x) {\n return _addEvent2.apply(this, arguments);\n }\n\n return addEvent;\n }()\n /** @inheritdoc */\n\n }, {\n key: \"finish\",\n value: function finish() {\n var _this22 = this;\n\n return new Promise(function (resolve) {\n // Make a copy of the events array reference and immediately clear the\n // events member so that we do not lose new events while uploading\n // attachment.\n var eventsRet = _this22.events;\n\n _this22.clear();\n\n resolve(JSON.stringify(eventsRet));\n });\n }\n /** @inheritdoc */\n\n }, {\n key: \"clear\",\n value: function clear() {\n this.events = [];\n this._totalSize = 0;\n this.hasCheckout = false;\n }\n /** @inheritdoc */\n\n }, {\n key: \"getEarliestTimestamp\",\n value: function getEarliestTimestamp() {\n var timestamp = this.events.map(function (event) {\n return event.timestamp;\n }).sort()[0];\n\n if (!timestamp) {\n return null;\n }\n\n return timestampToMs(timestamp);\n }\n }]);\n\n return EventBufferArray;\n}();\n/**\n * Event buffer that uses a web worker to compress events.\n * Exported only for testing.\n */\n\n\nvar WorkerHandler = /*#__PURE__*/function () {\n function WorkerHandler(worker) {\n _classCallCheck(this, WorkerHandler);\n\n this._worker = worker;\n this._id = 0;\n }\n /**\n * Ensure the worker is ready (or not).\n * This will either resolve when the worker is ready, or reject if an error occured.\n */\n\n\n _createClass(WorkerHandler, [{\n key: \"ensureReady\",\n value: function ensureReady() {\n var _this23 = this;\n\n // Ensure we only check once\n if (this._ensureReadyPromise) {\n return this._ensureReadyPromise;\n }\n\n this._ensureReadyPromise = new Promise(function (resolve, reject) {\n _this23._worker.addEventListener('message', function (_ref25) {\n var data = _ref25.data;\n\n if (data.success) {\n resolve();\n } else {\n reject();\n }\n }, {\n once: true\n });\n\n _this23._worker.addEventListener('error', function (error) {\n reject(error);\n }, {\n once: true\n });\n });\n return this._ensureReadyPromise;\n }\n /**\n * Destroy the worker.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n logInfo('[Replay] Destroying compression worker');\n\n this._worker.terminate();\n }\n /**\n * Post message to worker and wait for response before resolving promise.\n */\n\n }, {\n key: \"postMessage\",\n value: function postMessage(method, arg) {\n var _this24 = this;\n\n var id = this._getAndIncrementId();\n\n return new Promise(function (resolve, reject) {\n var listener = function listener(_ref26) {\n var data = _ref26.data;\n var response = data;\n\n if (response.method !== method) {\n return;\n } // There can be multiple listeners for a single method, the id ensures\n // that the response matches the caller.\n\n\n if (response.id !== id) {\n return;\n } // At this point, we'll always want to remove listener regardless of result status\n\n\n _this24._worker.removeEventListener('message', listener);\n\n if (!response.success) {\n // TODO: Do some error handling, not sure what\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('[Replay]', response.response);\n reject(new Error('Error in compression worker'));\n return;\n }\n\n resolve(response.response);\n }; // Note: we can't use `once` option because it's possible it needs to\n // listen to multiple messages\n\n\n _this24._worker.addEventListener('message', listener);\n\n _this24._worker.postMessage({\n id: id,\n method: method,\n arg: arg\n });\n });\n }\n /** Get the current ID and increment it for the next call. */\n\n }, {\n key: \"_getAndIncrementId\",\n value: function _getAndIncrementId() {\n return this._id++;\n }\n }]);\n\n return WorkerHandler;\n}();\n/**\n * Event buffer that uses a web worker to compress events.\n * Exported only for testing.\n */\n\n\nvar EventBufferCompressionWorker = /*#__PURE__*/function () {\n /** @inheritdoc */\n function EventBufferCompressionWorker(worker) {\n _classCallCheck(this, EventBufferCompressionWorker);\n\n this._worker = new WorkerHandler(worker);\n this._earliestTimestamp = null;\n this._totalSize = 0;\n this.hasCheckout = false;\n }\n /** @inheritdoc */\n\n\n _createClass(EventBufferCompressionWorker, [{\n key: \"hasEvents\",\n get: function get() {\n return !!this._earliestTimestamp;\n }\n /** @inheritdoc */\n\n }, {\n key: \"type\",\n get: function get() {\n return 'worker';\n }\n /**\n * Ensure the worker is ready (or not).\n * This will either resolve when the worker is ready, or reject if an error occured.\n */\n\n }, {\n key: \"ensureReady\",\n value: function ensureReady() {\n return this._worker.ensureReady();\n }\n /**\n * Destroy the event buffer.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this._worker.destroy();\n }\n /**\n * Add an event to the event buffer.\n *\n * Returns true if event was successfuly received and processed by worker.\n */\n\n }, {\n key: \"addEvent\",\n value: function addEvent(event) {\n var timestamp = timestampToMs(event.timestamp);\n\n if (!this._earliestTimestamp || timestamp < this._earliestTimestamp) {\n this._earliestTimestamp = timestamp;\n }\n\n var data = JSON.stringify(event);\n this._totalSize += data.length;\n\n if (this._totalSize > REPLAY_MAX_EVENT_BUFFER_SIZE) {\n return Promise.reject(new EventBufferSizeExceededError());\n }\n\n return this._sendEventToWorker(data);\n }\n /**\n * Finish the event buffer and return the compressed data.\n */\n\n }, {\n key: \"finish\",\n value: function finish() {\n return this._finishRequest();\n }\n /** @inheritdoc */\n\n }, {\n key: \"clear\",\n value: function clear() {\n this._earliestTimestamp = null;\n this._totalSize = 0;\n this.hasCheckout = false; // We do not wait on this, as we assume the order of messages is consistent for the worker\n\n void this._worker.postMessage('clear');\n }\n /** @inheritdoc */\n\n }, {\n key: \"getEarliestTimestamp\",\n value: function getEarliestTimestamp() {\n return this._earliestTimestamp;\n }\n /**\n * Send the event to the worker.\n */\n\n }, {\n key: \"_sendEventToWorker\",\n value: function _sendEventToWorker(data) {\n return this._worker.postMessage('addEvent', data);\n }\n /**\n * Finish the request and return the compressed data from the worker.\n */\n\n }, {\n key: \"_finishRequest\",\n value: function () {\n var _finishRequest2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {\n var response;\n return _regeneratorRuntime.wrap(function _callee3$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return this._worker.postMessage('finish');\n\n case 2:\n response = _context4.sent;\n this._earliestTimestamp = null;\n this._totalSize = 0;\n return _context4.abrupt(\"return\", response);\n\n case 6:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function _finishRequest() {\n return _finishRequest2.apply(this, arguments);\n }\n\n return _finishRequest;\n }()\n }]);\n\n return EventBufferCompressionWorker;\n}();\n/**\n * This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.\n * This can happen e.g. if the worker cannot be loaded.\n * Exported only for testing.\n */\n\n\nvar EventBufferProxy = /*#__PURE__*/function () {\n function EventBufferProxy(worker) {\n _classCallCheck(this, EventBufferProxy);\n\n this._fallback = new EventBufferArray();\n this._compression = new EventBufferCompressionWorker(worker);\n this._used = this._fallback;\n this._ensureWorkerIsLoadedPromise = this._ensureWorkerIsLoaded();\n }\n /** @inheritdoc */\n\n\n _createClass(EventBufferProxy, [{\n key: \"type\",\n get: function get() {\n return this._used.type;\n }\n /** @inheritDoc */\n\n }, {\n key: \"hasEvents\",\n get: function get() {\n return this._used.hasEvents;\n }\n /** @inheritdoc */\n\n }, {\n key: \"hasCheckout\",\n get: function get() {\n return this._used.hasCheckout;\n }\n /** @inheritdoc */\n ,\n set: function set(value) {\n this._used.hasCheckout = value;\n }\n /** @inheritDoc */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this._fallback.destroy();\n\n this._compression.destroy();\n }\n /** @inheritdoc */\n\n }, {\n key: \"clear\",\n value: function clear() {\n return this._used.clear();\n }\n /** @inheritdoc */\n\n }, {\n key: \"getEarliestTimestamp\",\n value: function getEarliestTimestamp() {\n return this._used.getEarliestTimestamp();\n }\n /**\n * Add an event to the event buffer.\n *\n * Returns true if event was successfully added.\n */\n\n }, {\n key: \"addEvent\",\n value: function addEvent(event) {\n return this._used.addEvent(event);\n }\n /** @inheritDoc */\n\n }, {\n key: \"finish\",\n value: function () {\n var _finish = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {\n return _regeneratorRuntime.wrap(function _callee4$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n _context5.next = 2;\n return this.ensureWorkerIsLoaded();\n\n case 2:\n return _context5.abrupt(\"return\", this._used.finish());\n\n case 3:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee4, this);\n }));\n\n function finish() {\n return _finish.apply(this, arguments);\n }\n\n return finish;\n }()\n /** Ensure the worker has loaded. */\n\n }, {\n key: \"ensureWorkerIsLoaded\",\n value: function ensureWorkerIsLoaded() {\n return this._ensureWorkerIsLoadedPromise;\n }\n /** Actually check if the worker has been loaded. */\n\n }, {\n key: \"_ensureWorkerIsLoaded\",\n value: function () {\n var _ensureWorkerIsLoaded2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {\n return _regeneratorRuntime.wrap(function _callee5$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n _context6.prev = 0;\n _context6.next = 3;\n return this._compression.ensureReady();\n\n case 3:\n _context6.next = 9;\n break;\n\n case 5:\n _context6.prev = 5;\n _context6.t0 = _context6[\"catch\"](0);\n // If the worker fails to load, we fall back to the simple buffer.\n // Nothing more to do from our side here\n logInfo('[Replay] Failed to load the compression worker, falling back to simple buffer');\n return _context6.abrupt(\"return\");\n\n case 9:\n _context6.next = 11;\n return this._switchToCompressionWorker();\n\n case 11:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee5, this, [[0, 5]]);\n }));\n\n function _ensureWorkerIsLoaded() {\n return _ensureWorkerIsLoaded2.apply(this, arguments);\n }\n\n return _ensureWorkerIsLoaded;\n }()\n /** Switch the used buffer to the compression worker. */\n\n }, {\n key: \"_switchToCompressionWorker\",\n value: function () {\n var _switchToCompressionWorker2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {\n var _this$_fallback, events, hasCheckout, addEventPromises, _iterator11, _step11, event;\n\n return _regeneratorRuntime.wrap(function _callee6$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n _this$_fallback = this._fallback, events = _this$_fallback.events, hasCheckout = _this$_fallback.hasCheckout;\n addEventPromises = [];\n _iterator11 = _createForOfIteratorHelper(events);\n\n try {\n for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {\n event = _step11.value;\n addEventPromises.push(this._compression.addEvent(event));\n }\n } catch (err) {\n _iterator11.e(err);\n } finally {\n _iterator11.f();\n }\n\n this._compression.hasCheckout = hasCheckout; // We switch over to the new buffer immediately - any further events will be added\n // after the previously buffered ones\n\n this._used = this._compression; // Wait for original events to be re-added before resolving\n\n _context7.prev = 6;\n _context7.next = 9;\n return Promise.all(addEventPromises);\n\n case 9:\n _context7.next = 14;\n break;\n\n case 11:\n _context7.prev = 11;\n _context7.t0 = _context7[\"catch\"](6);\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('[Replay] Failed to add events when switching buffers.', _context7.t0);\n\n case 14:\n case \"end\":\n return _context7.stop();\n }\n }\n }, _callee6, this, [[6, 11]]);\n }));\n\n function _switchToCompressionWorker() {\n return _switchToCompressionWorker2.apply(this, arguments);\n }\n\n return _switchToCompressionWorker;\n }()\n }]);\n\n return EventBufferProxy;\n}();\n/**\n * Create an event buffer for replays.\n */\n\n\nfunction createEventBuffer(_ref27) {\n var useCompression = _ref27.useCompression,\n customWorkerUrl = _ref27.workerUrl;\n\n if (useCompression && // eslint-disable-next-line no-restricted-globals\n window.Worker) {\n var worker = _loadWorker(customWorkerUrl);\n\n if (worker) {\n return worker;\n }\n }\n\n logInfo('[Replay] Using simple buffer');\n return new EventBufferArray();\n}\n\nfunction _loadWorker(customWorkerUrl) {\n try {\n var workerUrl = customWorkerUrl || _getWorkerUrl();\n\n if (!workerUrl) {\n return;\n }\n\n logInfo(\"[Replay] Using compression worker\".concat(customWorkerUrl ? \" from \".concat(customWorkerUrl) : ''));\n var worker = new Worker(workerUrl);\n return new EventBufferProxy(worker);\n } catch (error) {\n logInfo('[Replay] Failed to create compression worker'); // Fall back to use simple event buffer array\n }\n}\n\nfunction _getWorkerUrl() {\n if (typeof __SENTRY_EXCLUDE_REPLAY_WORKER__ === 'undefined' || !__SENTRY_EXCLUDE_REPLAY_WORKER__) {\n return e();\n }\n\n return '';\n}\n/** If sessionStorage is available. */\n\n\nfunction hasSessionStorage() {\n try {\n // This can throw, e.g. when being accessed in a sandboxed iframe\n return 'sessionStorage' in WINDOW && !!WINDOW.sessionStorage;\n } catch (e) {\n return false;\n }\n}\n/**\n * Removes the session from Session Storage and unsets session in replay instance\n */\n\n\nfunction clearSession(replay) {\n deleteSession();\n replay.session = undefined;\n}\n/**\n * Deletes a session from storage\n */\n\n\nfunction deleteSession() {\n if (!hasSessionStorage()) {\n return;\n }\n\n try {\n WINDOW.sessionStorage.removeItem(REPLAY_SESSION_KEY);\n } catch (e) {// Ignore potential SecurityError exceptions\n }\n}\n/**\n * Given a sample rate, returns true if replay should be sampled.\n *\n * 1.0 = 100% sampling\n * 0.0 = 0% sampling\n */\n\n\nfunction isSampled(sampleRate) {\n if (sampleRate === undefined) {\n return false;\n } // Math.random() returns a number in range of 0 to 1 (inclusive of 0, but not 1)\n\n\n return Math.random() < sampleRate;\n}\n/**\n * Save a session to session storage.\n */\n\n\nfunction saveSession(session) {\n if (!hasSessionStorage()) {\n return;\n }\n\n try {\n WINDOW.sessionStorage.setItem(REPLAY_SESSION_KEY, JSON.stringify(session));\n } catch (e) {// Ignore potential SecurityError exceptions\n }\n}\n/**\n * Get a session with defaults & applied sampling.\n */\n\n\nfunction makeSession(session) {\n var now = Date.now();\n var id = session.id || uuid4(); // Note that this means we cannot set a started/lastActivity of `0`, but this should not be relevant outside of tests.\n\n var started = session.started || now;\n var lastActivity = session.lastActivity || now;\n var segmentId = session.segmentId || 0;\n var sampled = session.sampled;\n var previousSessionId = session.previousSessionId;\n return {\n id: id,\n started: started,\n lastActivity: lastActivity,\n segmentId: segmentId,\n sampled: sampled,\n previousSessionId: previousSessionId\n };\n}\n/**\n * Get the sampled status for a session based on sample rates & current sampled status.\n */\n\n\nfunction getSessionSampleType(sessionSampleRate, allowBuffering) {\n return isSampled(sessionSampleRate) ? 'session' : allowBuffering ? 'buffer' : false;\n}\n/**\n * Create a new session, which in its current implementation is a Sentry event\n * that all replays will be saved to as attachments. Currently, we only expect\n * one of these Sentry events per \"replay session\".\n */\n\n\nfunction createSession(_ref28) {\n var sessionSampleRate = _ref28.sessionSampleRate,\n allowBuffering = _ref28.allowBuffering,\n _ref28$stickySession = _ref28.stickySession,\n stickySession = _ref28$stickySession === void 0 ? false : _ref28$stickySession;\n\n var _ref29 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n previousSessionId = _ref29.previousSessionId;\n\n var sampled = getSessionSampleType(sessionSampleRate, allowBuffering);\n var session = makeSession({\n sampled: sampled,\n previousSessionId: previousSessionId\n });\n\n if (stickySession) {\n saveSession(session);\n }\n\n return session;\n}\n/**\n * Fetches a session from storage\n */\n\n\nfunction fetchSession(traceInternals) {\n if (!hasSessionStorage()) {\n return null;\n }\n\n try {\n // This can throw if cookies are disabled\n var sessionStringFromStorage = WINDOW.sessionStorage.getItem(REPLAY_SESSION_KEY);\n\n if (!sessionStringFromStorage) {\n return null;\n }\n\n var sessionObj = JSON.parse(sessionStringFromStorage);\n logInfoNextTick('[Replay] Loading existing session', traceInternals);\n return makeSession(sessionObj);\n } catch (e) {\n return null;\n }\n}\n/**\n * Given an initial timestamp and an expiry duration, checks to see if current\n * time should be considered as expired.\n */\n\n\nfunction isExpired(initialTime, expiry) {\n var targetTime = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : +new Date();\n\n // Always expired if < 0\n if (initialTime === null || expiry === undefined || expiry < 0) {\n return true;\n } // Never expires if == 0\n\n\n if (expiry === 0) {\n return false;\n }\n\n return initialTime + expiry <= targetTime;\n}\n/**\n * Checks to see if session is expired\n */\n\n\nfunction isSessionExpired(session, _ref30) {\n var maxReplayDuration = _ref30.maxReplayDuration,\n sessionIdleExpire = _ref30.sessionIdleExpire,\n _ref30$targetTime = _ref30.targetTime,\n targetTime = _ref30$targetTime === void 0 ? Date.now() : _ref30$targetTime;\n return (// First, check that maximum session length has not been exceeded\n isExpired(session.started, maxReplayDuration, targetTime) || // check that the idle timeout has not been exceeded (i.e. user has\n // performed an action within the last `sessionIdleExpire` ms)\n isExpired(session.lastActivity, sessionIdleExpire, targetTime)\n );\n}\n/** If the session should be refreshed or not. */\n\n\nfunction shouldRefreshSession(session, _ref31) {\n var sessionIdleExpire = _ref31.sessionIdleExpire,\n maxReplayDuration = _ref31.maxReplayDuration;\n\n // If not expired, all good, just keep the session\n if (!isSessionExpired(session, {\n sessionIdleExpire: sessionIdleExpire,\n maxReplayDuration: maxReplayDuration\n })) {\n return false;\n } // If we are buffering & haven't ever flushed yet, always continue\n\n\n if (session.sampled === 'buffer' && session.segmentId === 0) {\n return false;\n }\n\n return true;\n}\n/**\n * Get or create a session, when initializing the replay.\n * Returns a session that may be unsampled.\n */\n\n\nfunction loadOrCreateSession(_ref32, sessionOptions) {\n var traceInternals = _ref32.traceInternals,\n sessionIdleExpire = _ref32.sessionIdleExpire,\n maxReplayDuration = _ref32.maxReplayDuration,\n previousSessionId = _ref32.previousSessionId;\n var existingSession = sessionOptions.stickySession && fetchSession(traceInternals); // No session exists yet, just create a new one\n\n if (!existingSession) {\n logInfoNextTick('[Replay] Creating new session', traceInternals);\n return createSession(sessionOptions, {\n previousSessionId: previousSessionId\n });\n }\n\n if (!shouldRefreshSession(existingSession, {\n sessionIdleExpire: sessionIdleExpire,\n maxReplayDuration: maxReplayDuration\n })) {\n return existingSession;\n }\n\n logInfoNextTick('[Replay] Session in sessionStorage is expired, creating new one...');\n return createSession(sessionOptions, {\n previousSessionId: existingSession.id\n });\n}\n\nvar ReplayEventTypeCustom = 5;\n\nfunction isCustomEvent(event) {\n return event.type === EventType.Custom;\n}\n/**\n * Add an event to the event buffer.\n * In contrast to `addEvent`, this does not return a promise & does not wait for the adding of the event to succeed/fail.\n * Instead this returns `true` if we tried to add the event, else false.\n * It returns `false` e.g. if we are paused, disabled, or out of the max replay duration.\n *\n * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.\n */\n\n\nfunction addEventSync(replay, event, isCheckout) {\n if (!shouldAddEvent(replay, event)) {\n return false;\n }\n\n void _addEvent(replay, event, isCheckout);\n return true;\n}\n/**\n * Add an event to the event buffer.\n * Resolves to `null` if no event was added, else to `void`.\n *\n * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.\n */\n\n\nfunction addEvent(replay, event, isCheckout) {\n if (!shouldAddEvent(replay, event)) {\n return Promise.resolve(null);\n }\n\n return _addEvent(replay, event, isCheckout);\n}\n\nfunction _addEvent(_x2, _x3, _x4) {\n return _addEvent3.apply(this, arguments);\n}\n/** Exported only for tests. */\n\n\nfunction _addEvent3() {\n _addEvent3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(replay, event, isCheckout) {\n var replayOptions, eventAfterPossibleCallback, reason, client;\n return _regeneratorRuntime.wrap(function _callee12$(_context13) {\n while (1) {\n switch (_context13.prev = _context13.next) {\n case 0:\n if (replay.eventBuffer) {\n _context13.next = 2;\n break;\n }\n\n return _context13.abrupt(\"return\", null);\n\n case 2:\n _context13.prev = 2;\n\n if (isCheckout && replay.recordingMode === 'buffer') {\n replay.eventBuffer.clear();\n }\n\n if (isCheckout) {\n replay.eventBuffer.hasCheckout = true;\n }\n\n replayOptions = replay.getOptions();\n eventAfterPossibleCallback = maybeApplyCallback(event, replayOptions.beforeAddRecordingEvent);\n\n if (eventAfterPossibleCallback) {\n _context13.next = 9;\n break;\n }\n\n return _context13.abrupt(\"return\");\n\n case 9:\n _context13.next = 11;\n return replay.eventBuffer.addEvent(eventAfterPossibleCallback);\n\n case 11:\n return _context13.abrupt(\"return\", _context13.sent);\n\n case 14:\n _context13.prev = 14;\n _context13.t0 = _context13[\"catch\"](2);\n reason = _context13.t0 && _context13.t0 instanceof EventBufferSizeExceededError ? 'addEventSizeExceeded' : 'addEvent';\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(_context13.t0);\n _context13.next = 20;\n return replay.stop({\n reason: reason\n });\n\n case 20:\n client = getCurrentHub().getClient();\n\n if (client) {\n client.recordDroppedEvent('internal_sdk_error', 'replay');\n }\n\n case 22:\n case \"end\":\n return _context13.stop();\n }\n }\n }, _callee12, null, [[2, 14]]);\n }));\n return _addEvent3.apply(this, arguments);\n}\n\nfunction shouldAddEvent(replay, event) {\n if (!replay.eventBuffer || replay.isPaused() || !replay.isEnabled()) {\n return false;\n }\n\n var timestampInMs = timestampToMs(event.timestamp); // Throw out events that happen more than 5 minutes ago. This can happen if\n // page has been left open and idle for a long period of time and user\n // comes back to trigger a new session. The performance entries rely on\n // `performance.timeOrigin`, which is when the page first opened.\n\n if (timestampInMs + replay.timeouts.sessionIdlePause < Date.now()) {\n return false;\n } // Throw out events that are +60min from the initial timestamp\n\n\n if (timestampInMs > replay.getContext().initialTimestamp + replay.getOptions().maxReplayDuration) {\n logInfo(\"[Replay] Skipping event with timestamp \".concat(timestampInMs, \" because it is after maxReplayDuration\"), replay.getOptions()._experiments.traceInternals);\n return false;\n }\n\n return true;\n}\n\nfunction maybeApplyCallback(event, callback) {\n try {\n if (typeof callback === 'function' && isCustomEvent(event)) {\n return callback(event);\n }\n } catch (error) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...', error);\n return null;\n }\n\n return event;\n}\n/** If the event is an error event */\n\n\nfunction isErrorEvent(event) {\n return !event.type;\n}\n/** If the event is a transaction event */\n\n\nfunction isTransactionEvent(event) {\n return event.type === 'transaction';\n}\n/** If the event is an replay event */\n\n\nfunction isReplayEvent(event) {\n return event.type === 'replay_event';\n}\n/**\n * Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.\n */\n\n\nfunction handleAfterSendEvent(replay) {\n // Custom transports may still be returning `Promise`, which means we cannot expect the status code to be available there\n // TODO (v8): remove this check as it will no longer be necessary\n var enforceStatusCode = isBaseTransportSend();\n return function (event, sendResponse) {\n if (!replay.isEnabled() || !isErrorEvent(event) && !isTransactionEvent(event)) {\n return;\n }\n\n var statusCode = sendResponse && sendResponse.statusCode; // We only want to do stuff on successful error sending, otherwise you get error replays without errors attached\n // If not using the base transport, we allow `undefined` response (as a custom transport may not implement this correctly yet)\n // If we do use the base transport, we skip if we encountered an non-OK status code\n\n if (enforceStatusCode && (!statusCode || statusCode < 200 || statusCode >= 300)) {\n return;\n }\n\n if (isTransactionEvent(event)) {\n handleTransactionEvent(replay, event);\n return;\n }\n\n handleErrorEvent(replay, event);\n };\n}\n\nfunction handleTransactionEvent(replay, event) {\n var replayContext = replay.getContext(); // Collect traceIds in _context regardless of `recordingMode`\n // In error mode, _context gets cleared on every checkout\n // We limit to max. 100 transactions linked\n\n if (event.contexts && event.contexts.trace && event.contexts.trace.trace_id && replayContext.traceIds.size < 100) {\n replayContext.traceIds.add(event.contexts.trace.trace_id);\n }\n}\n\nfunction handleErrorEvent(replay, event) {\n var replayContext = replay.getContext(); // Add error to list of errorIds of replay. This is ok to do even if not\n // sampled because context will get reset at next checkout.\n // XXX: There is also a race condition where it's possible to capture an\n // error to Sentry before Replay SDK has loaded, but response returns after\n // it was loaded, and this gets called.\n // We limit to max. 100 errors linked\n\n if (event.event_id && replayContext.errorIds.size < 100) {\n replayContext.errorIds.add(event.event_id);\n } // If error event is tagged with replay id it means it was sampled (when in buffer mode)\n // Need to be very careful that this does not cause an infinite loop\n\n\n if (replay.recordingMode === 'buffer' && event.tags && event.tags.replayId) {\n setTimeout(function () {\n // Capture current event buffer as new replay\n void replay.sendBufferedReplayOrFlush();\n });\n }\n}\n\nfunction isBaseTransportSend() {\n var client = getCurrentHub().getClient();\n\n if (!client) {\n return false;\n }\n\n var transport = client.getTransport();\n\n if (!transport) {\n return false;\n }\n\n return transport.send.__sentry__baseTransport__ || false;\n}\n/**\n * Returns true if we think the given event is an error originating inside of rrweb.\n */\n\n\nfunction isRrwebError(event, hint) {\n if (event.type || !event.exception || !event.exception.values || !event.exception.values.length) {\n return false;\n } // @ts-expect-error this may be set by rrweb when it finds errors\n\n\n if (hint.originalException && hint.originalException.__rrweb__) {\n return true;\n }\n\n return false;\n}\n/**\n * Determine if event should be sampled (only applies in buffer mode).\n * When an event is captured by `hanldleGlobalEvent`, when in buffer mode\n * we determine if we want to sample the error or not.\n */\n\n\nfunction shouldSampleForBufferEvent(replay, event) {\n if (replay.recordingMode !== 'buffer') {\n return false;\n } // ignore this error because otherwise we could loop indefinitely with\n // trying to capture replay and failing\n\n\n if (event.message === UNABLE_TO_SEND_REPLAY) {\n return false;\n } // Require the event to be an error event & to have an exception\n\n\n if (!event.exception || event.type) {\n return false;\n }\n\n return isSampled(replay.getOptions().errorSampleRate);\n}\n/**\n * Returns a listener to be added to `addGlobalEventProcessor(listener)`.\n */\n\n\nfunction handleGlobalEventListener(replay) {\n var includeAfterSendEventHandling = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var afterSendHandler = includeAfterSendEventHandling ? handleAfterSendEvent(replay) : undefined;\n return Object.assign(function (event, hint) {\n // Do nothing if replay has been disabled\n if (!replay.isEnabled()) {\n return event;\n }\n\n if (isReplayEvent(event)) {\n // Replays have separate set of breadcrumbs, do not include breadcrumbs\n // from core SDK\n delete event.breadcrumbs;\n return event;\n } // We only want to handle errors & transactions, nothing else\n\n\n if (!isErrorEvent(event) && !isTransactionEvent(event)) {\n return event;\n } // Ensure we do not add replay_id if the session is expired\n\n\n var isSessionActive = replay.checkAndHandleExpiredSession();\n\n if (!isSessionActive) {\n return event;\n } // Unless `captureExceptions` is enabled, we want to ignore errors coming from rrweb\n // As there can be a bunch of stuff going wrong in internals there, that we don't want to bubble up to users\n\n\n if (isRrwebError(event, hint) && !replay.getOptions()._experiments.captureExceptions) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Replay] Ignoring error from rrweb internals', event);\n return null;\n } // When in buffer mode, we decide to sample here.\n // Later, in `handleAfterSendEvent`, if the replayId is set, we know that we sampled\n // And convert the buffer session to a full session\n\n\n var isErrorEventSampled = shouldSampleForBufferEvent(replay, event); // Tag errors if it has been sampled in buffer mode, or if it is session mode\n // Only tag transactions if in session mode\n\n var shouldTagReplayId = isErrorEventSampled || replay.recordingMode === 'session';\n\n if (shouldTagReplayId) {\n event.tags = _objectSpread(_objectSpread({}, event.tags), {}, {\n replayId: replay.getSessionId()\n });\n } // In cases where a custom client is used that does not support the new hooks (yet),\n // we manually call this hook method here\n\n\n if (afterSendHandler) {\n // Pretend the error had a 200 response so we always capture it\n afterSendHandler(event, {\n statusCode: 200\n });\n }\n\n return event;\n }, {\n id: 'Replay'\n });\n}\n/**\n * Create a \"span\" for each performance entry.\n */\n\n\nfunction createPerformanceSpans(replay, entries) {\n return entries.map(function (_ref33) {\n var type = _ref33.type,\n start = _ref33.start,\n end = _ref33.end,\n name = _ref33.name,\n data = _ref33.data;\n var response = replay.throttledAddEvent({\n type: EventType.Custom,\n timestamp: start,\n data: {\n tag: 'performanceSpan',\n payload: {\n op: type,\n description: name,\n startTimestamp: start,\n endTimestamp: end,\n data: data\n }\n }\n }); // If response is a string, it means its either THROTTLED or SKIPPED\n\n return typeof response === 'string' ? Promise.resolve(null) : response;\n });\n}\n\nfunction handleHistory(handlerData) {\n var from = handlerData.from,\n to = handlerData.to;\n var now = Date.now() / 1000;\n return {\n type: 'navigation.push',\n start: now,\n end: now,\n name: to,\n data: {\n previous: from\n }\n };\n}\n/**\n * Returns a listener to be added to `addInstrumentationHandler('history', listener)`.\n */\n\n\nfunction handleHistorySpanListener(replay) {\n return function (handlerData) {\n if (!replay.isEnabled()) {\n return;\n }\n\n var result = handleHistory(handlerData);\n\n if (result === null) {\n return;\n } // Need to collect visited URLs\n\n\n replay.getContext().urls.push(result.name);\n replay.triggerUserActivity();\n replay.addUpdate(function () {\n createPerformanceSpans(replay, [result]); // Returning false to flush\n\n return false;\n });\n };\n}\n/**\n * Check whether a given request URL should be filtered out. This is so we\n * don't log Sentry ingest requests.\n */\n\n\nfunction shouldFilterRequest(replay, url) {\n // If we enabled the `traceInternals` experiment, we want to trace everything\n if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && replay.getOptions()._experiments.traceInternals) {\n return false;\n }\n\n return isSentryRequestUrl(url, getCurrentHub());\n}\n/** Add a performance entry breadcrumb */\n\n\nfunction addNetworkBreadcrumb(replay, result) {\n if (!replay.isEnabled()) {\n return;\n }\n\n if (result === null) {\n return;\n }\n\n if (shouldFilterRequest(replay, result.name)) {\n return;\n }\n\n replay.addUpdate(function () {\n createPerformanceSpans(replay, [result]); // Returning true will cause `addUpdate` to not flush\n // We do not want network requests to cause a flush. This will prevent\n // recurring/polling requests from keeping the replay session alive.\n\n return true;\n });\n}\n/** only exported for tests */\n\n\nfunction handleFetch(handlerData) {\n var startTimestamp = handlerData.startTimestamp,\n endTimestamp = handlerData.endTimestamp,\n fetchData = handlerData.fetchData,\n response = handlerData.response;\n\n if (!endTimestamp) {\n return null;\n } // This is only used as a fallback, so we know the body sizes are never set here\n\n\n var method = fetchData.method,\n url = fetchData.url;\n return {\n type: 'resource.fetch',\n start: startTimestamp / 1000,\n end: endTimestamp / 1000,\n name: url,\n data: {\n method: method,\n statusCode: response ? response.status : undefined\n }\n };\n}\n/**\n * Returns a listener to be added to `addInstrumentationHandler('fetch', listener)`.\n */\n\n\nfunction handleFetchSpanListener(replay) {\n return function (handlerData) {\n if (!replay.isEnabled()) {\n return;\n }\n\n var result = handleFetch(handlerData);\n addNetworkBreadcrumb(replay, result);\n };\n}\n/** only exported for tests */\n\n\nfunction handleXhr(handlerData) {\n var startTimestamp = handlerData.startTimestamp,\n endTimestamp = handlerData.endTimestamp,\n xhr = handlerData.xhr;\n var sentryXhrData = xhr[SENTRY_XHR_DATA_KEY];\n\n if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n return null;\n } // This is only used as a fallback, so we know the body sizes are never set here\n\n\n var method = sentryXhrData.method,\n url = sentryXhrData.url,\n statusCode = sentryXhrData.status_code;\n\n if (url === undefined) {\n return null;\n }\n\n return {\n type: 'resource.xhr',\n name: url,\n start: startTimestamp / 1000,\n end: endTimestamp / 1000,\n data: {\n method: method,\n statusCode: statusCode\n }\n };\n}\n/**\n * Returns a listener to be added to `addInstrumentationHandler('xhr', listener)`.\n */\n\n\nfunction handleXhrSpanListener(replay) {\n return function (handlerData) {\n if (!replay.isEnabled()) {\n return;\n }\n\n var result = handleXhr(handlerData);\n addNetworkBreadcrumb(replay, result);\n };\n}\n\nvar OBJ = 10;\nvar OBJ_KEY = 11;\nvar OBJ_KEY_STR = 12;\nvar OBJ_VAL = 13;\nvar OBJ_VAL_STR = 14;\nvar OBJ_VAL_COMPLETED = 15;\nvar ARR = 20;\nvar ARR_VAL = 21;\nvar ARR_VAL_STR = 22;\nvar ARR_VAL_COMPLETED = 23;\nvar ALLOWED_PRIMITIVES = ['true', 'false', 'null'];\n/**\n * Complete an incomplete JSON string.\n * This will ensure that the last element always has a `\"~~\"` to indicate it was truncated.\n * For example, `[1,2,` will be completed to `[1,2,\"~~\"]`\n * and `{\"aa\":\"b` will be completed to `{\"aa\":\"b~~\"}`\n */\n\nfunction completeJson(incompleteJson, stack) {\n if (!stack.length) {\n return incompleteJson;\n }\n\n var json = incompleteJson; // Most checks are only needed for the last step in the stack\n\n var lastPos = stack.length - 1;\n var lastStep = stack[lastPos];\n json = _fixLastStep(json, lastStep); // Complete remaining steps - just add closing brackets\n\n for (var _i8 = lastPos; _i8 >= 0; _i8--) {\n var step = stack[_i8];\n\n switch (step) {\n case OBJ:\n json = \"\".concat(json, \"}\");\n break;\n\n case ARR:\n json = \"\".concat(json, \"]\");\n break;\n }\n }\n\n return json;\n}\n\nfunction _fixLastStep(json, lastStep) {\n switch (lastStep) {\n // Object cases\n case OBJ:\n return \"\".concat(json, \"\\\"~~\\\":\\\"~~\\\"\");\n\n case OBJ_KEY:\n return \"\".concat(json, \":\\\"~~\\\"\");\n\n case OBJ_KEY_STR:\n return \"\".concat(json, \"~~\\\":\\\"~~\\\"\");\n\n case OBJ_VAL:\n return _maybeFixIncompleteObjValue(json);\n\n case OBJ_VAL_STR:\n return \"\".concat(json, \"~~\\\"\");\n\n case OBJ_VAL_COMPLETED:\n return \"\".concat(json, \",\\\"~~\\\":\\\"~~\\\"\");\n // Array cases\n\n case ARR:\n return \"\".concat(json, \"\\\"~~\\\"\");\n\n case ARR_VAL:\n return _maybeFixIncompleteArrValue(json);\n\n case ARR_VAL_STR:\n return \"\".concat(json, \"~~\\\"\");\n\n case ARR_VAL_COMPLETED:\n return \"\".concat(json, \",\\\"~~\\\"\");\n }\n\n return json;\n}\n\nfunction _maybeFixIncompleteArrValue(json) {\n var pos = _findLastArrayDelimiter(json);\n\n if (pos > -1) {\n var part = json.slice(pos + 1);\n\n if (ALLOWED_PRIMITIVES.includes(part.trim())) {\n return \"\".concat(json, \",\\\"~~\\\"\");\n } // Everything else is replaced with `\"~~\"`\n\n\n return \"\".concat(json.slice(0, pos + 1), \"\\\"~~\\\"\");\n } // fallback, this shouldn't happen, to be save\n\n\n return json;\n}\n\nfunction _findLastArrayDelimiter(json) {\n for (var _i9 = json.length - 1; _i9 >= 0; _i9--) {\n var char = json[_i9];\n\n if (char === ',' || char === '[') {\n return _i9;\n }\n }\n\n return -1;\n}\n\nfunction _maybeFixIncompleteObjValue(json) {\n var startPos = json.lastIndexOf(':');\n var part = json.slice(startPos + 1);\n\n if (ALLOWED_PRIMITIVES.includes(part.trim())) {\n return \"\".concat(json, \",\\\"~~\\\":\\\"~~\\\"\");\n } // Everything else is replaced with `\"~~\"`\n // This also means we do not have incomplete numbers, e.g `[1` is replaced with `[\"~~\"]`\n\n\n return \"\".concat(json.slice(0, startPos + 1), \"\\\"~~\\\"\");\n}\n/**\n * Evaluate an (incomplete) JSON string.\n */\n\n\nfunction evaluateJson(json) {\n var stack = [];\n\n for (var pos = 0; pos < json.length; pos++) {\n _evaluateJsonPos(stack, json, pos);\n }\n\n return stack;\n}\n\nfunction _evaluateJsonPos(stack, json, pos) {\n var curStep = stack[stack.length - 1];\n var char = json[pos];\n var whitespaceRegex = /\\s/;\n\n if (whitespaceRegex.test(char)) {\n return;\n }\n\n if (char === '\"' && !_isEscaped(json, pos)) {\n _handleQuote(stack, curStep);\n\n return;\n }\n\n switch (char) {\n case '{':\n _handleObj(stack, curStep);\n\n break;\n\n case '[':\n _handleArr(stack, curStep);\n\n break;\n\n case ':':\n _handleColon(stack, curStep);\n\n break;\n\n case ',':\n _handleComma(stack, curStep);\n\n break;\n\n case '}':\n _handleObjClose(stack, curStep);\n\n break;\n\n case ']':\n _handleArrClose(stack, curStep);\n\n break;\n }\n}\n\nfunction _handleQuote(stack, curStep) {\n // End of obj value\n if (curStep === OBJ_VAL_STR) {\n stack.pop();\n stack.push(OBJ_VAL_COMPLETED);\n return;\n } // End of arr value\n\n\n if (curStep === ARR_VAL_STR) {\n stack.pop();\n stack.push(ARR_VAL_COMPLETED);\n return;\n } // Start of obj value\n\n\n if (curStep === OBJ_VAL) {\n stack.push(OBJ_VAL_STR);\n return;\n } // Start of arr value\n\n\n if (curStep === ARR_VAL) {\n stack.push(ARR_VAL_STR);\n return;\n } // Start of obj key\n\n\n if (curStep === OBJ) {\n stack.push(OBJ_KEY_STR);\n return;\n } // End of obj key\n\n\n if (curStep === OBJ_KEY_STR) {\n stack.pop();\n stack.push(OBJ_KEY);\n return;\n }\n}\n\nfunction _handleObj(stack, curStep) {\n // Initial object\n if (!curStep) {\n stack.push(OBJ);\n return;\n } // New object as obj value\n\n\n if (curStep === OBJ_VAL) {\n stack.push(OBJ);\n return;\n } // New object as array element\n\n\n if (curStep === ARR_VAL) {\n stack.push(OBJ);\n } // New object as first array element\n\n\n if (curStep === ARR) {\n stack.push(OBJ);\n return;\n }\n}\n\nfunction _handleArr(stack, curStep) {\n // Initial array\n if (!curStep) {\n stack.push(ARR);\n stack.push(ARR_VAL);\n return;\n } // New array as obj value\n\n\n if (curStep === OBJ_VAL) {\n stack.push(ARR);\n stack.push(ARR_VAL);\n return;\n } // New array as array element\n\n\n if (curStep === ARR_VAL) {\n stack.push(ARR);\n stack.push(ARR_VAL);\n } // New array as first array element\n\n\n if (curStep === ARR) {\n stack.push(ARR);\n stack.push(ARR_VAL);\n return;\n }\n}\n\nfunction _handleColon(stack, curStep) {\n if (curStep === OBJ_KEY) {\n stack.pop();\n stack.push(OBJ_VAL);\n }\n}\n\nfunction _handleComma(stack, curStep) {\n // Comma after obj value\n if (curStep === OBJ_VAL) {\n stack.pop();\n return;\n }\n\n if (curStep === OBJ_VAL_COMPLETED) {\n // Pop OBJ_VAL_COMPLETED & OBJ_VAL\n stack.pop();\n stack.pop();\n return;\n } // Comma after arr value\n\n\n if (curStep === ARR_VAL) {\n // do nothing - basically we'd pop ARR_VAL but add it right back\n return;\n }\n\n if (curStep === ARR_VAL_COMPLETED) {\n // Pop ARR_VAL_COMPLETED\n stack.pop(); // basically we'd pop ARR_VAL but add it right back\n\n return;\n }\n}\n\nfunction _handleObjClose(stack, curStep) {\n // Empty object {}\n if (curStep === OBJ) {\n stack.pop();\n } // Object with element\n\n\n if (curStep === OBJ_VAL) {\n // Pop OBJ_VAL, OBJ\n stack.pop();\n stack.pop();\n } // Obj with element\n\n\n if (curStep === OBJ_VAL_COMPLETED) {\n // Pop OBJ_VAL_COMPLETED, OBJ_VAL, OBJ\n stack.pop();\n stack.pop();\n stack.pop();\n } // if was obj value, complete it\n\n\n if (stack[stack.length - 1] === OBJ_VAL) {\n stack.push(OBJ_VAL_COMPLETED);\n } // if was arr value, complete it\n\n\n if (stack[stack.length - 1] === ARR_VAL) {\n stack.push(ARR_VAL_COMPLETED);\n }\n}\n\nfunction _handleArrClose(stack, curStep) {\n // Empty array []\n if (curStep === ARR) {\n stack.pop();\n } // Array with element\n\n\n if (curStep === ARR_VAL) {\n // Pop ARR_VAL, ARR\n stack.pop();\n stack.pop();\n } // Array with element\n\n\n if (curStep === ARR_VAL_COMPLETED) {\n // Pop ARR_VAL_COMPLETED, ARR_VAL, ARR\n stack.pop();\n stack.pop();\n stack.pop();\n } // if was obj value, complete it\n\n\n if (stack[stack.length - 1] === OBJ_VAL) {\n stack.push(OBJ_VAL_COMPLETED);\n } // if was arr value, complete it\n\n\n if (stack[stack.length - 1] === ARR_VAL) {\n stack.push(ARR_VAL_COMPLETED);\n }\n}\n\nfunction _isEscaped(str, pos) {\n var previousChar = str[pos - 1];\n return previousChar === '\\\\' && !_isEscaped(str, pos - 1);\n}\n/* eslint-disable max-lines */\n\n/**\n * Takes an incomplete JSON string, and returns a hopefully valid JSON string.\n * Note that this _can_ fail, so you should check the return value is valid JSON.\n */\n\n\nfunction fixJson(incompleteJson) {\n var stack = evaluateJson(incompleteJson);\n return completeJson(incompleteJson, stack);\n}\n/** Get the size of a body. */\n\n\nfunction getBodySize(body, textEncoder) {\n if (!body) {\n return undefined;\n }\n\n try {\n if (typeof body === 'string') {\n return textEncoder.encode(body).length;\n }\n\n if (body instanceof URLSearchParams) {\n return textEncoder.encode(body.toString()).length;\n }\n\n if (body instanceof FormData) {\n var formDataStr = _serializeFormData(body);\n\n return textEncoder.encode(formDataStr).length;\n }\n\n if (body instanceof Blob) {\n return body.size;\n }\n\n if (body instanceof ArrayBuffer) {\n return body.byteLength;\n } // Currently unhandled types: ArrayBufferView, ReadableStream\n\n } catch (e) {// just return undefined\n }\n\n return undefined;\n}\n/** Convert a Content-Length header to number/undefined. */\n\n\nfunction parseContentLengthHeader(header) {\n if (!header) {\n return undefined;\n }\n\n var size = parseInt(header, 10);\n return isNaN(size) ? undefined : size;\n}\n/** Get the string representation of a body. */\n\n\nfunction getBodyString(body) {\n if (typeof body === 'string') {\n return body;\n }\n\n if (body instanceof URLSearchParams) {\n return body.toString();\n }\n\n if (body instanceof FormData) {\n return _serializeFormData(body);\n }\n\n return undefined;\n}\n/** Convert ReplayNetworkRequestData to a PerformanceEntry. */\n\n\nfunction makeNetworkReplayBreadcrumb(type, data) {\n if (!data) {\n return null;\n }\n\n var startTimestamp = data.startTimestamp,\n endTimestamp = data.endTimestamp,\n url = data.url,\n method = data.method,\n statusCode = data.statusCode,\n request = data.request,\n response = data.response;\n var result = {\n type: type,\n start: startTimestamp / 1000,\n end: endTimestamp / 1000,\n name: url,\n data: dropUndefinedKeys({\n method: method,\n statusCode: statusCode,\n request: request,\n response: response\n })\n };\n return result;\n}\n/** Build the request or response part of a replay network breadcrumb that was skipped. */\n\n\nfunction buildSkippedNetworkRequestOrResponse(bodySize) {\n return {\n headers: {},\n size: bodySize,\n _meta: {\n warnings: ['URL_SKIPPED']\n }\n };\n}\n/** Build the request or response part of a replay network breadcrumb. */\n\n\nfunction buildNetworkRequestOrResponse(headers, bodySize, body) {\n if (!bodySize && Object.keys(headers).length === 0) {\n return undefined;\n }\n\n if (!bodySize) {\n return {\n headers: headers\n };\n }\n\n if (!body) {\n return {\n headers: headers,\n size: bodySize\n };\n }\n\n var info = {\n headers: headers,\n size: bodySize\n };\n\n var _normalizeNetworkBody = normalizeNetworkBody(body),\n normalizedBody = _normalizeNetworkBody.body,\n warnings = _normalizeNetworkBody.warnings;\n\n info.body = normalizedBody;\n\n if (warnings.length > 0) {\n info._meta = {\n warnings: warnings\n };\n }\n\n return info;\n}\n/** Filter a set of headers */\n\n\nfunction getAllowedHeaders(headers, allowedHeaders) {\n return Object.keys(headers).reduce(function (filteredHeaders, key) {\n var normalizedKey = key.toLowerCase(); // Avoid putting empty strings into the headers\n\n if (allowedHeaders.includes(normalizedKey) && headers[key]) {\n filteredHeaders[normalizedKey] = headers[key];\n }\n\n return filteredHeaders;\n }, {});\n}\n\nfunction _serializeFormData(formData) {\n // This is a bit simplified, but gives us a decent estimate\n // This converts e.g. { name: 'Anne Smith', age: 13 } to 'name=Anne+Smith&age=13'\n // @ts-expect-error passing FormData to URLSearchParams actually works\n return new URLSearchParams(formData).toString();\n}\n\nfunction normalizeNetworkBody(body) {\n if (!body || typeof body !== 'string') {\n return {\n body: body,\n warnings: []\n };\n }\n\n var exceedsSizeLimit = body.length > NETWORK_BODY_MAX_SIZE;\n\n if (_strIsProbablyJson(body)) {\n try {\n var json = exceedsSizeLimit ? fixJson(body.slice(0, NETWORK_BODY_MAX_SIZE)) : body;\n var normalizedBody = JSON.parse(json);\n return {\n body: normalizedBody,\n warnings: exceedsSizeLimit ? ['JSON_TRUNCATED'] : []\n };\n } catch (e3) {\n return {\n body: exceedsSizeLimit ? \"\".concat(body.slice(0, NETWORK_BODY_MAX_SIZE), \"\\u2026\") : body,\n warnings: exceedsSizeLimit ? ['INVALID_JSON', 'TEXT_TRUNCATED'] : ['INVALID_JSON']\n };\n }\n }\n\n return {\n body: exceedsSizeLimit ? \"\".concat(body.slice(0, NETWORK_BODY_MAX_SIZE), \"\\u2026\") : body,\n warnings: exceedsSizeLimit ? ['TEXT_TRUNCATED'] : []\n };\n}\n\nfunction _strIsProbablyJson(str) {\n var first = str[0];\n var last = str[str.length - 1]; // Simple check: If this does not start & end with {} or [], it's not JSON\n\n return first === '[' && last === ']' || first === '{' && last === '}';\n}\n/** Match an URL against a list of strings/Regex. */\n\n\nfunction urlMatches(url, urls) {\n var fullUrl = getFullUrl(url);\n return stringMatchesSomePattern(fullUrl, urls);\n}\n/** exported for tests */\n\n\nfunction getFullUrl(url) {\n var baseURI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : WINDOW.document.baseURI;\n\n // Short circuit for common cases:\n if (url.startsWith('http://') || url.startsWith('https://') || url.startsWith(WINDOW.location.origin)) {\n return url;\n }\n\n var fixedUrl = new URL(url, baseURI); // If these do not match, we are not dealing with a relative URL, so just return it\n\n if (fixedUrl.origin !== new URL(baseURI).origin) {\n return url;\n }\n\n var fullUrl = fixedUrl.href; // Remove trailing slashes, if they don't match the original URL\n\n if (!url.endsWith('/') && fullUrl.endsWith('/')) {\n return fullUrl.slice(0, -1);\n }\n\n return fullUrl;\n}\n/**\n * Capture a fetch breadcrumb to a replay.\n * This adds additional data (where approriate).\n */\n\n\nfunction captureFetchBreadcrumbToReplay(_x5, _x6, _x7) {\n return _captureFetchBreadcrumbToReplay.apply(this, arguments);\n}\n/**\n * Enrich a breadcrumb with additional data.\n * This has to be sync & mutate the given breadcrumb,\n * as the breadcrumb is afterwards consumed by other handlers.\n */\n\n\nfunction _captureFetchBreadcrumbToReplay() {\n _captureFetchBreadcrumbToReplay = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(breadcrumb, hint, options) {\n var data, result;\n return _regeneratorRuntime.wrap(function _callee13$(_context14) {\n while (1) {\n switch (_context14.prev = _context14.next) {\n case 0:\n _context14.prev = 0;\n _context14.next = 3;\n return _prepareFetchData(breadcrumb, hint, options);\n\n case 3:\n data = _context14.sent;\n // Create a replay performance entry from this breadcrumb\n result = makeNetworkReplayBreadcrumb('resource.fetch', data);\n addNetworkBreadcrumb(options.replay, result);\n _context14.next = 11;\n break;\n\n case 8:\n _context14.prev = 8;\n _context14.t0 = _context14[\"catch\"](0);\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('[Replay] Failed to capture fetch breadcrumb', _context14.t0);\n\n case 11:\n case \"end\":\n return _context14.stop();\n }\n }\n }, _callee13, null, [[0, 8]]);\n }));\n return _captureFetchBreadcrumbToReplay.apply(this, arguments);\n}\n\nfunction enrichFetchBreadcrumb(breadcrumb, hint, options) {\n var input = hint.input,\n response = hint.response;\n\n var body = _getFetchRequestArgBody(input);\n\n var reqSize = getBodySize(body, options.textEncoder);\n var resSize = response ? parseContentLengthHeader(response.headers.get('content-length')) : undefined;\n\n if (reqSize !== undefined) {\n breadcrumb.data.request_body_size = reqSize;\n }\n\n if (resSize !== undefined) {\n breadcrumb.data.response_body_size = resSize;\n }\n}\n\nfunction _prepareFetchData(_x8, _x9, _x10) {\n return _prepareFetchData2.apply(this, arguments);\n}\n\nfunction _prepareFetchData2() {\n _prepareFetchData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(breadcrumb, hint, options) {\n var startTimestamp, endTimestamp, _breadcrumb$data2, url, method, _breadcrumb$data2$sta, statusCode, requestBodySize, responseBodySize, captureDetails, request, response;\n\n return _regeneratorRuntime.wrap(function _callee14$(_context15) {\n while (1) {\n switch (_context15.prev = _context15.next) {\n case 0:\n startTimestamp = hint.startTimestamp, endTimestamp = hint.endTimestamp;\n _breadcrumb$data2 = breadcrumb.data, url = _breadcrumb$data2.url, method = _breadcrumb$data2.method, _breadcrumb$data2$sta = _breadcrumb$data2.status_code, statusCode = _breadcrumb$data2$sta === void 0 ? 0 : _breadcrumb$data2$sta, requestBodySize = _breadcrumb$data2.request_body_size, responseBodySize = _breadcrumb$data2.response_body_size;\n captureDetails = urlMatches(url, options.networkDetailAllowUrls) && !urlMatches(url, options.networkDetailDenyUrls);\n request = captureDetails ? _getRequestInfo(options, hint.input, requestBodySize) : buildSkippedNetworkRequestOrResponse(requestBodySize);\n _context15.next = 6;\n return _getResponseInfo(captureDetails, options, hint.response, responseBodySize);\n\n case 6:\n response = _context15.sent;\n return _context15.abrupt(\"return\", {\n startTimestamp: startTimestamp,\n endTimestamp: endTimestamp,\n url: url,\n method: method,\n statusCode: statusCode,\n request: request,\n response: response\n });\n\n case 8:\n case \"end\":\n return _context15.stop();\n }\n }\n }, _callee14);\n }));\n return _prepareFetchData2.apply(this, arguments);\n}\n\nfunction _getRequestInfo(_ref34, input, requestBodySize) {\n var networkCaptureBodies = _ref34.networkCaptureBodies,\n networkRequestHeaders = _ref34.networkRequestHeaders;\n var headers = getRequestHeaders(input, networkRequestHeaders);\n\n if (!networkCaptureBodies) {\n return buildNetworkRequestOrResponse(headers, requestBodySize, undefined);\n } // We only want to transmit string or string-like bodies\n\n\n var requestBody = _getFetchRequestArgBody(input);\n\n var bodyStr = getBodyString(requestBody);\n return buildNetworkRequestOrResponse(headers, requestBodySize, bodyStr);\n}\n\nfunction _getResponseInfo(_x11, _x12, _x13, _x14) {\n return _getResponseInfo2.apply(this, arguments);\n}\n\nfunction _getResponseInfo2() {\n _getResponseInfo2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(captureDetails, _ref35, response, responseBodySize) {\n var networkCaptureBodies, textEncoder, networkResponseHeaders, headers, res, bodyText, size;\n return _regeneratorRuntime.wrap(function _callee15$(_context16) {\n while (1) {\n switch (_context16.prev = _context16.next) {\n case 0:\n networkCaptureBodies = _ref35.networkCaptureBodies, textEncoder = _ref35.textEncoder, networkResponseHeaders = _ref35.networkResponseHeaders;\n\n if (!(!captureDetails && responseBodySize !== undefined)) {\n _context16.next = 3;\n break;\n }\n\n return _context16.abrupt(\"return\", buildSkippedNetworkRequestOrResponse(responseBodySize));\n\n case 3:\n headers = getAllHeaders(response.headers, networkResponseHeaders);\n\n if (!(!networkCaptureBodies && responseBodySize !== undefined)) {\n _context16.next = 6;\n break;\n }\n\n return _context16.abrupt(\"return\", buildNetworkRequestOrResponse(headers, responseBodySize, undefined));\n\n case 6:\n _context16.prev = 6;\n // We have to clone this, as the body can only be read once\n res = response.clone();\n _context16.next = 10;\n return _parseFetchBody(res);\n\n case 10:\n bodyText = _context16.sent;\n size = bodyText && bodyText.length && responseBodySize === undefined ? getBodySize(bodyText, textEncoder) : responseBodySize;\n\n if (captureDetails) {\n _context16.next = 14;\n break;\n }\n\n return _context16.abrupt(\"return\", buildSkippedNetworkRequestOrResponse(size));\n\n case 14:\n if (!networkCaptureBodies) {\n _context16.next = 16;\n break;\n }\n\n return _context16.abrupt(\"return\", buildNetworkRequestOrResponse(headers, size, bodyText));\n\n case 16:\n return _context16.abrupt(\"return\", buildNetworkRequestOrResponse(headers, size, undefined));\n\n case 19:\n _context16.prev = 19;\n _context16.t0 = _context16[\"catch\"](6);\n return _context16.abrupt(\"return\", buildNetworkRequestOrResponse(headers, responseBodySize, undefined));\n\n case 22:\n case \"end\":\n return _context16.stop();\n }\n }\n }, _callee15, null, [[6, 19]]);\n }));\n return _getResponseInfo2.apply(this, arguments);\n}\n\nfunction _parseFetchBody(_x15) {\n return _parseFetchBody2.apply(this, arguments);\n}\n\nfunction _parseFetchBody2() {\n _parseFetchBody2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(response) {\n return _regeneratorRuntime.wrap(function _callee16$(_context17) {\n while (1) {\n switch (_context17.prev = _context17.next) {\n case 0:\n _context17.prev = 0;\n _context17.next = 3;\n return response.text();\n\n case 3:\n return _context17.abrupt(\"return\", _context17.sent);\n\n case 6:\n _context17.prev = 6;\n _context17.t0 = _context17[\"catch\"](0);\n return _context17.abrupt(\"return\", undefined);\n\n case 9:\n case \"end\":\n return _context17.stop();\n }\n }\n }, _callee16, null, [[0, 6]]);\n }));\n return _parseFetchBody2.apply(this, arguments);\n}\n\nfunction _getFetchRequestArgBody() {\n var fetchArgs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n // We only support getting the body from the fetch options\n if (fetchArgs.length !== 2 || typeof fetchArgs[1] !== 'object') {\n return undefined;\n }\n\n return fetchArgs[1].body;\n}\n\nfunction getAllHeaders(headers, allowedHeaders) {\n var allHeaders = {};\n allowedHeaders.forEach(function (header) {\n if (headers.get(header)) {\n allHeaders[header] = headers.get(header);\n }\n });\n return allHeaders;\n}\n\nfunction getRequestHeaders(fetchArgs, allowedHeaders) {\n if (fetchArgs.length === 1 && typeof fetchArgs[0] !== 'string') {\n return getHeadersFromOptions(fetchArgs[0], allowedHeaders);\n }\n\n if (fetchArgs.length === 2) {\n return getHeadersFromOptions(fetchArgs[1], allowedHeaders);\n }\n\n return {};\n}\n\nfunction getHeadersFromOptions(input, allowedHeaders) {\n if (!input) {\n return {};\n }\n\n var headers = input.headers;\n\n if (!headers) {\n return {};\n }\n\n if (headers instanceof Headers) {\n return getAllHeaders(headers, allowedHeaders);\n } // We do not support this, as it is not really documented (anymore?)\n\n\n if (Array.isArray(headers)) {\n return {};\n }\n\n return getAllowedHeaders(headers, allowedHeaders);\n}\n/**\n * Capture an XHR breadcrumb to a replay.\n * This adds additional data (where approriate).\n */\n\n\nfunction captureXhrBreadcrumbToReplay(_x16, _x17, _x18) {\n return _captureXhrBreadcrumbToReplay.apply(this, arguments);\n}\n/**\n * Enrich a breadcrumb with additional data.\n * This has to be sync & mutate the given breadcrumb,\n * as the breadcrumb is afterwards consumed by other handlers.\n */\n\n\nfunction _captureXhrBreadcrumbToReplay() {\n _captureXhrBreadcrumbToReplay = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(breadcrumb, hint, options) {\n var data, result;\n return _regeneratorRuntime.wrap(function _callee17$(_context18) {\n while (1) {\n switch (_context18.prev = _context18.next) {\n case 0:\n try {\n data = _prepareXhrData(breadcrumb, hint, options); // Create a replay performance entry from this breadcrumb\n\n result = makeNetworkReplayBreadcrumb('resource.xhr', data);\n addNetworkBreadcrumb(options.replay, result);\n } catch (error) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('[Replay] Failed to capture xhr breadcrumb', error);\n }\n\n case 1:\n case \"end\":\n return _context18.stop();\n }\n }\n }, _callee17);\n }));\n return _captureXhrBreadcrumbToReplay.apply(this, arguments);\n}\n\nfunction enrichXhrBreadcrumb(breadcrumb, hint, options) {\n var xhr = hint.xhr,\n input = hint.input;\n var reqSize = getBodySize(input, options.textEncoder);\n var resSize = xhr.getResponseHeader('content-length') ? parseContentLengthHeader(xhr.getResponseHeader('content-length')) : getBodySize(xhr.response, options.textEncoder);\n\n if (reqSize !== undefined) {\n breadcrumb.data.request_body_size = reqSize;\n }\n\n if (resSize !== undefined) {\n breadcrumb.data.response_body_size = resSize;\n }\n}\n\nfunction _prepareXhrData(breadcrumb, hint, options) {\n var startTimestamp = hint.startTimestamp,\n endTimestamp = hint.endTimestamp,\n input = hint.input,\n xhr = hint.xhr;\n var _breadcrumb$data = breadcrumb.data,\n url = _breadcrumb$data.url,\n method = _breadcrumb$data.method,\n _breadcrumb$data$stat = _breadcrumb$data.status_code,\n statusCode = _breadcrumb$data$stat === void 0 ? 0 : _breadcrumb$data$stat,\n requestBodySize = _breadcrumb$data.request_body_size,\n responseBodySize = _breadcrumb$data.response_body_size;\n\n if (!url) {\n return null;\n }\n\n if (!urlMatches(url, options.networkDetailAllowUrls) || urlMatches(url, options.networkDetailDenyUrls)) {\n var _request = buildSkippedNetworkRequestOrResponse(requestBodySize);\n\n var _response = buildSkippedNetworkRequestOrResponse(responseBodySize);\n\n return {\n startTimestamp: startTimestamp,\n endTimestamp: endTimestamp,\n url: url,\n method: method,\n statusCode: statusCode,\n request: _request,\n response: _response\n };\n }\n\n var xhrInfo = xhr[SENTRY_XHR_DATA_KEY];\n var networkRequestHeaders = xhrInfo ? getAllowedHeaders(xhrInfo.request_headers, options.networkRequestHeaders) : {};\n var networkResponseHeaders = getAllowedHeaders(getResponseHeaders(xhr), options.networkResponseHeaders);\n var request = buildNetworkRequestOrResponse(networkRequestHeaders, requestBodySize, options.networkCaptureBodies ? getBodyString(input) : undefined);\n var response = buildNetworkRequestOrResponse(networkResponseHeaders, responseBodySize, options.networkCaptureBodies ? hint.xhr.responseText : undefined);\n return {\n startTimestamp: startTimestamp,\n endTimestamp: endTimestamp,\n url: url,\n method: method,\n statusCode: statusCode,\n request: request,\n response: response\n };\n}\n\nfunction getResponseHeaders(xhr) {\n var headers = xhr.getAllResponseHeaders();\n\n if (!headers) {\n return {};\n }\n\n return headers.split('\\r\\n').reduce(function (acc, line) {\n var _line$split = line.split(': '),\n _line$split2 = _slicedToArray(_line$split, 2),\n key = _line$split2[0],\n value = _line$split2[1];\n\n acc[key.toLowerCase()] = value;\n return acc;\n }, {});\n}\n/**\n * This method does two things:\n * - It enriches the regular XHR/fetch breadcrumbs with request/response size data\n * - It captures the XHR/fetch breadcrumbs to the replay\n * (enriching it with further data that is _not_ added to the regular breadcrumbs)\n */\n\n\nfunction handleNetworkBreadcrumbs(replay) {\n var client = getCurrentHub().getClient();\n\n try {\n var textEncoder = new TextEncoder();\n\n var _replay$getOptions = replay.getOptions(),\n networkDetailAllowUrls = _replay$getOptions.networkDetailAllowUrls,\n networkDetailDenyUrls = _replay$getOptions.networkDetailDenyUrls,\n networkCaptureBodies = _replay$getOptions.networkCaptureBodies,\n networkRequestHeaders = _replay$getOptions.networkRequestHeaders,\n networkResponseHeaders = _replay$getOptions.networkResponseHeaders;\n\n var options = {\n replay: replay,\n textEncoder: textEncoder,\n networkDetailAllowUrls: networkDetailAllowUrls,\n networkDetailDenyUrls: networkDetailDenyUrls,\n networkCaptureBodies: networkCaptureBodies,\n networkRequestHeaders: networkRequestHeaders,\n networkResponseHeaders: networkResponseHeaders\n };\n\n if (client && client.on) {\n client.on('beforeAddBreadcrumb', function (breadcrumb, hint) {\n return beforeAddNetworkBreadcrumb(options, breadcrumb, hint);\n });\n } else {\n // Fallback behavior\n addInstrumentationHandler('fetch', handleFetchSpanListener(replay));\n addInstrumentationHandler('xhr', handleXhrSpanListener(replay));\n }\n } catch (e2) {// Do nothing\n }\n}\n/** just exported for tests */\n\n\nfunction beforeAddNetworkBreadcrumb(options, breadcrumb, hint) {\n if (!breadcrumb.data) {\n return;\n }\n\n try {\n if (_isXhrBreadcrumb(breadcrumb) && _isXhrHint(hint)) {\n // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick\n // Because the hook runs synchronously, and the breadcrumb is afterwards passed on\n // So any async mutations to it will not be reflected in the final breadcrumb\n enrichXhrBreadcrumb(breadcrumb, hint, options);\n void captureXhrBreadcrumbToReplay(breadcrumb, hint, options);\n }\n\n if (_isFetchBreadcrumb(breadcrumb) && _isFetchHint(hint)) {\n // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick\n // Because the hook runs synchronously, and the breadcrumb is afterwards passed on\n // So any async mutations to it will not be reflected in the final breadcrumb\n enrichFetchBreadcrumb(breadcrumb, hint, options);\n void captureFetchBreadcrumbToReplay(breadcrumb, hint, options);\n }\n } catch (e) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Error when enriching network breadcrumb');\n }\n}\n\nfunction _isXhrBreadcrumb(breadcrumb) {\n return breadcrumb.category === 'xhr';\n}\n\nfunction _isFetchBreadcrumb(breadcrumb) {\n return breadcrumb.category === 'fetch';\n}\n\nfunction _isXhrHint(hint) {\n return hint && hint.xhr;\n}\n\nfunction _isFetchHint(hint) {\n return hint && hint.response;\n}\n\nvar _LAST_BREADCRUMB = null;\n\nfunction isBreadcrumbWithCategory(breadcrumb) {\n return !!breadcrumb.category;\n}\n\nvar handleScopeListener = function handleScopeListener(replay) {\n return function (scope) {\n if (!replay.isEnabled()) {\n return;\n }\n\n var result = handleScope(scope);\n\n if (!result) {\n return;\n }\n\n addBreadcrumbEvent(replay, result);\n };\n};\n/**\n * An event handler to handle scope changes.\n */\n\n\nfunction handleScope(scope) {\n // TODO (v8): Remove this guard. This was put in place because we introduced\n // Scope.getLastBreadcrumb mid-v7 which caused incompatibilities with older SDKs.\n // For now, we'll just return null if the method doesn't exist but we should eventually\n // get rid of this guard.\n var newBreadcrumb = scope.getLastBreadcrumb && scope.getLastBreadcrumb(); // Listener can be called when breadcrumbs have not changed, so we store the\n // reference to the last crumb and only return a crumb if it has changed\n\n if (_LAST_BREADCRUMB === newBreadcrumb || !newBreadcrumb) {\n return null;\n }\n\n _LAST_BREADCRUMB = newBreadcrumb;\n\n if (!isBreadcrumbWithCategory(newBreadcrumb) || ['fetch', 'xhr', 'sentry.event', 'sentry.transaction'].includes(newBreadcrumb.category) || newBreadcrumb.category.startsWith('ui.')) {\n return null;\n }\n\n if (newBreadcrumb.category === 'console') {\n return normalizeConsoleBreadcrumb(newBreadcrumb);\n }\n\n return createBreadcrumb(newBreadcrumb);\n}\n/** exported for tests only */\n\n\nfunction normalizeConsoleBreadcrumb(breadcrumb) {\n var args = breadcrumb.data && breadcrumb.data.arguments;\n\n if (!Array.isArray(args) || args.length === 0) {\n return createBreadcrumb(breadcrumb);\n }\n\n var isTruncated = false; // Avoid giant args captures\n\n var normalizedArgs = args.map(function (arg) {\n if (!arg) {\n return arg;\n }\n\n if (typeof arg === 'string') {\n if (arg.length > CONSOLE_ARG_MAX_SIZE) {\n isTruncated = true;\n return \"\".concat(arg.slice(0, CONSOLE_ARG_MAX_SIZE), \"\\u2026\");\n }\n\n return arg;\n }\n\n if (typeof arg === 'object') {\n try {\n var normalizedArg = normalize(arg, 7);\n var stringified = JSON.stringify(normalizedArg);\n\n if (stringified.length > CONSOLE_ARG_MAX_SIZE) {\n var fixedJson = fixJson(stringified.slice(0, CONSOLE_ARG_MAX_SIZE));\n var json = JSON.parse(fixedJson); // We only set this after JSON.parse() was successfull, so we know we didn't run into `catch`\n\n isTruncated = true;\n return json;\n }\n\n return normalizedArg;\n } catch (e) {// fall back to default\n }\n }\n\n return arg;\n });\n return createBreadcrumb(_objectSpread(_objectSpread({}, breadcrumb), {}, {\n data: _objectSpread(_objectSpread({}, breadcrumb.data), {}, {\n arguments: normalizedArgs\n }, isTruncated ? {\n _meta: {\n warnings: ['CONSOLE_ARG_TRUNCATED']\n }\n } : {})\n }));\n}\n/**\n * Add global listeners that cannot be removed.\n */\n\n\nfunction addGlobalListeners(replay) {\n // Listeners from core SDK //\n var scope = getCurrentHub().getScope();\n var client = getCurrentHub().getClient();\n scope.addScopeListener(handleScopeListener(replay));\n addInstrumentationHandler('dom', handleDomListener(replay));\n addInstrumentationHandler('history', handleHistorySpanListener(replay));\n handleNetworkBreadcrumbs(replay); // Tag all (non replay) events that get sent to Sentry with the current\n // replay ID so that we can reference them later in the UI\n\n var eventProcessor = handleGlobalEventListener(replay, !hasHooks(client));\n\n if (client && client.addEventProcessor) {\n client.addEventProcessor(eventProcessor);\n } else {\n addGlobalEventProcessor(eventProcessor);\n } // If a custom client has no hooks yet, we continue to use the \"old\" implementation\n\n\n if (hasHooks(client)) {\n client.on('afterSendEvent', handleAfterSendEvent(replay));\n client.on('createDsc', function (dsc) {\n var replayId = replay.getSessionId(); // We do not want to set the DSC when in buffer mode, as that means the replay has not been sent (yet)\n\n if (replayId && replay.isEnabled() && replay.recordingMode === 'session') {\n // Ensure to check that the session is still active - it could have expired in the meanwhile\n var isSessionActive = replay.checkAndHandleExpiredSession();\n\n if (isSessionActive) {\n dsc.replay_id = replayId;\n }\n }\n });\n client.on('startTransaction', function (transaction) {\n replay.lastTransaction = transaction;\n }); // We may be missing the initial startTransaction due to timing issues,\n // so we capture it on finish again.\n\n client.on('finishTransaction', function (transaction) {\n replay.lastTransaction = transaction;\n });\n }\n} // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction hasHooks(client) {\n return !!(client && client.on);\n}\n/**\n * Create a \"span\" for the total amount of memory being used by JS objects\n * (including v8 internal objects).\n */\n\n\nfunction addMemoryEntry(_x19) {\n return _addMemoryEntry.apply(this, arguments);\n}\n\nfunction _addMemoryEntry() {\n _addMemoryEntry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(replay) {\n return _regeneratorRuntime.wrap(function _callee18$(_context19) {\n while (1) {\n switch (_context19.prev = _context19.next) {\n case 0:\n _context19.prev = 0;\n return _context19.abrupt(\"return\", Promise.all(createPerformanceSpans(replay, [// @ts-expect-error memory doesn't exist on type Performance as the API is non-standard (we check that it exists above)\n createMemoryEntry(WINDOW.performance.memory)])));\n\n case 4:\n _context19.prev = 4;\n _context19.t0 = _context19[\"catch\"](0);\n return _context19.abrupt(\"return\", []);\n\n case 7:\n case \"end\":\n return _context19.stop();\n }\n }\n }, _callee18, null, [[0, 4]]);\n }));\n return _addMemoryEntry.apply(this, arguments);\n}\n\nfunction createMemoryEntry(memoryEntry) {\n var jsHeapSizeLimit = memoryEntry.jsHeapSizeLimit,\n totalJSHeapSize = memoryEntry.totalJSHeapSize,\n usedJSHeapSize = memoryEntry.usedJSHeapSize; // we don't want to use `getAbsoluteTime` because it adds the event time to the\n // time origin, so we get the current timestamp instead\n\n var time = Date.now() / 1000;\n return {\n type: 'memory',\n name: 'memory',\n start: time,\n end: time,\n data: {\n memory: {\n jsHeapSizeLimit: jsHeapSizeLimit,\n totalJSHeapSize: totalJSHeapSize,\n usedJSHeapSize: usedJSHeapSize\n }\n }\n };\n}\n/**\n * Heavily simplified debounce function based on lodash.debounce.\n *\n * This function takes a callback function (@param fun) and delays its invocation\n * by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,\n * which ensures that the callback is invoked at least once after the specified max. wait time.\n *\n * @param func the function whose invocation is to be debounced\n * @param wait the minimum time until the function is invoked after it was called once\n * @param options the options object, which can contain the `maxWait` property\n *\n * @returns the debounced version of the function, which needs to be called at least once to start the\n * debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc\n * was already invoked in the meantime, return @param func's return value.\n * The debounced function has two additional properties:\n * - `flush`: Invokes the debounced function immediately and returns its return value\n * - `cancel`: Cancels the debouncing process and resets the debouncing timer\n */\n\n\nfunction debounce(func, wait, options) {\n var callbackReturnValue;\n var timerId;\n var maxTimerId;\n var maxWait = options && options.maxWait ? Math.max(options.maxWait, wait) : 0;\n\n function invokeFunc() {\n cancelTimers();\n callbackReturnValue = func();\n return callbackReturnValue;\n }\n\n function cancelTimers() {\n timerId !== undefined && clearTimeout(timerId);\n maxTimerId !== undefined && clearTimeout(maxTimerId);\n timerId = maxTimerId = undefined;\n }\n\n function flush() {\n if (timerId !== undefined || maxTimerId !== undefined) {\n return invokeFunc();\n }\n\n return callbackReturnValue;\n }\n\n function debounced() {\n if (timerId) {\n clearTimeout(timerId);\n }\n\n timerId = setTimeout(invokeFunc, wait);\n\n if (maxWait && maxTimerId === undefined) {\n maxTimerId = setTimeout(invokeFunc, maxWait);\n }\n\n return callbackReturnValue;\n }\n\n debounced.cancel = cancelTimers;\n debounced.flush = flush;\n return debounced;\n}\n/**\n * Handler for recording events.\n *\n * Adds to event buffer, and has varying flushing behaviors if the event was a checkout.\n */\n\n\nfunction getHandleRecordingEmit(replay) {\n var hadFirstEvent = false;\n return function (event, _isCheckout) {\n // If this is false, it means session is expired, create and a new session and wait for checkout\n if (!replay.checkAndHandleExpiredSession()) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('[Replay] Received replay event after session expired.');\n return;\n } // `_isCheckout` is only set when the checkout is due to `checkoutEveryNms`\n // We also want to treat the first event as a checkout, so we handle this specifically here\n\n\n var isCheckout = _isCheckout || !hadFirstEvent;\n hadFirstEvent = true; // The handler returns `true` if we do not want to trigger debounced flush, `false` if we want to debounce flush.\n\n replay.addUpdate(function () {\n // The session is always started immediately on pageload/init, but for\n // error-only replays, it should reflect the most recent checkout\n // when an error occurs. Clear any state that happens before this current\n // checkout. This needs to happen before `addEvent()` which updates state\n // dependent on this reset.\n if (replay.recordingMode === 'buffer' && isCheckout) {\n replay.setInitialState();\n } // If the event is not added (e.g. due to being paused, disabled, or out of the max replay duration),\n // Skip all further steps\n\n\n if (!addEventSync(replay, event, isCheckout)) {\n // Return true to skip scheduling a debounced flush\n return true;\n } // Different behavior for full snapshots (type=2), ignore other event types\n // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16\n\n\n if (!isCheckout) {\n return false;\n } // Additionally, create a meta event that will capture certain SDK settings.\n // In order to handle buffer mode, this needs to either be done when we\n // receive checkout events or at flush time.\n //\n // `isCheckout` is always true, but want to be explicit that it should\n // only be added for checkouts\n\n\n addSettingsEvent(replay, isCheckout); // If there is a previousSessionId after a full snapshot occurs, then\n // the replay session was started due to session expiration. The new session\n // is started before triggering a new checkout and contains the id\n // of the previous session. Do not immediately flush in this case\n // to avoid capturing only the checkout and instead the replay will\n // be captured if they perform any follow-up actions.\n\n if (replay.session && replay.session.previousSessionId) {\n return true;\n } // When in buffer mode, make sure we adjust the session started date to the current earliest event of the buffer\n // this should usually be the timestamp of the checkout event, but to be safe...\n\n\n if (replay.recordingMode === 'buffer' && replay.session && replay.eventBuffer) {\n var earliestEvent = replay.eventBuffer.getEarliestTimestamp();\n\n if (earliestEvent) {\n logInfo(\"[Replay] Updating session start time to earliest event in buffer to \".concat(new Date(earliestEvent)), replay.getOptions()._experiments.traceInternals);\n replay.session.started = earliestEvent;\n\n if (replay.getOptions().stickySession) {\n saveSession(replay.session);\n }\n }\n }\n\n if (replay.recordingMode === 'session') {\n // If the full snapshot is due to an initial load, we will not have\n // a previous session ID. In this case, we want to buffer events\n // for a set amount of time before flushing. This can help avoid\n // capturing replays of users that immediately close the window.\n void replay.flush();\n }\n\n return true;\n });\n };\n}\n/**\n * Exported for tests\n */\n\n\nfunction createOptionsEvent(replay) {\n var options = replay.getOptions();\n return {\n type: EventType.Custom,\n timestamp: Date.now(),\n data: {\n tag: 'options',\n payload: {\n sessionSampleRate: options.sessionSampleRate,\n errorSampleRate: options.errorSampleRate,\n useCompressionOption: options.useCompression,\n blockAllMedia: options.blockAllMedia,\n maskAllText: options.maskAllText,\n maskAllInputs: options.maskAllInputs,\n useCompression: replay.eventBuffer ? replay.eventBuffer.type === 'worker' : false,\n networkDetailHasUrls: options.networkDetailAllowUrls.length > 0,\n networkCaptureBodies: options.networkCaptureBodies,\n networkRequestHasHeaders: options.networkRequestHeaders.length > 0,\n networkResponseHasHeaders: options.networkResponseHeaders.length > 0\n }\n }\n };\n}\n/**\n * Add a \"meta\" event that contains a simplified view on current configuration\n * options. This should only be included on the first segment of a recording.\n */\n\n\nfunction addSettingsEvent(replay, isCheckout) {\n // Only need to add this event when sending the first segment\n if (!isCheckout || !replay.session || replay.session.segmentId !== 0) {\n return;\n }\n\n addEventSync(replay, createOptionsEvent(replay), false);\n}\n/**\n * Create a replay envelope ready to be sent.\n * This includes both the replay event, as well as the recording data.\n */\n\n\nfunction createReplayEnvelope(replayEvent, recordingData, dsn, tunnel) {\n return createEnvelope(createEventEnvelopeHeaders(replayEvent, getSdkMetadataForEnvelopeHeader(replayEvent), tunnel, dsn), [[{\n type: 'replay_event'\n }, replayEvent], [{\n type: 'replay_recording',\n // If string then we need to encode to UTF8, otherwise will have\n // wrong size. TextEncoder has similar browser support to\n // MutationObserver, although it does not accept IE11.\n length: typeof recordingData === 'string' ? new TextEncoder().encode(recordingData).length : recordingData.length\n }, recordingData]]);\n}\n/**\n * Prepare the recording data ready to be sent.\n */\n\n\nfunction prepareRecordingData(_ref36) {\n var recordingData = _ref36.recordingData,\n headers = _ref36.headers;\n var payloadWithSequence; // XXX: newline is needed to separate sequence id from events\n\n var replayHeaders = \"\".concat(JSON.stringify(headers), \"\\n\");\n\n if (typeof recordingData === 'string') {\n payloadWithSequence = \"\".concat(replayHeaders).concat(recordingData);\n } else {\n var enc = new TextEncoder(); // XXX: newline is needed to separate sequence id from events\n\n var sequence = enc.encode(replayHeaders); // Merge the two Uint8Arrays\n\n payloadWithSequence = new Uint8Array(sequence.length + recordingData.length);\n payloadWithSequence.set(sequence);\n payloadWithSequence.set(recordingData, sequence.length);\n }\n\n return payloadWithSequence;\n}\n/**\n * Prepare a replay event & enrich it with the SDK metadata.\n */\n\n\nfunction prepareReplayEvent(_x20) {\n return _prepareReplayEvent.apply(this, arguments);\n}\n/**\n * Send replay attachment using `fetch()`\n */\n\n\nfunction _prepareReplayEvent() {\n _prepareReplayEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref37) {\n var client, scope, event_id, event, integrations, eventHint, preparedEvent, metadata, _ref47, name, version;\n\n return _regeneratorRuntime.wrap(function _callee19$(_context20) {\n while (1) {\n switch (_context20.prev = _context20.next) {\n case 0:\n client = _ref37.client, scope = _ref37.scope, event_id = _ref37.replayId, event = _ref37.event;\n integrations = typeof client._integrations === 'object' && client._integrations !== null && !Array.isArray(client._integrations) ? Object.keys(client._integrations) : undefined;\n eventHint = {\n event_id: event_id,\n integrations: integrations\n };\n\n if (client.emit) {\n client.emit('preprocessEvent', event, eventHint);\n }\n\n _context20.next = 6;\n return prepareEvent(client.getOptions(), event, eventHint, scope, client);\n\n case 6:\n preparedEvent = _context20.sent;\n\n if (preparedEvent) {\n _context20.next = 9;\n break;\n }\n\n return _context20.abrupt(\"return\", null);\n\n case 9:\n // This normally happens in browser client \"_prepareEvent\"\n // but since we do not use this private method from the client, but rather the plain import\n // we need to do this manually.\n preparedEvent.platform = preparedEvent.platform || 'javascript'; // extract the SDK name because `client._prepareEvent` doesn't add it to the event\n\n metadata = client.getSdkMetadata && client.getSdkMetadata();\n _ref47 = metadata && metadata.sdk || {}, name = _ref47.name, version = _ref47.version;\n preparedEvent.sdk = _objectSpread(_objectSpread({}, preparedEvent.sdk), {}, {\n name: name || 'sentry.javascript.unknown',\n version: version || '0.0.0'\n });\n return _context20.abrupt(\"return\", preparedEvent);\n\n case 14:\n case \"end\":\n return _context20.stop();\n }\n }\n }, _callee19);\n }));\n return _prepareReplayEvent.apply(this, arguments);\n}\n\nfunction sendReplayRequest(_x21) {\n return _sendReplayRequest.apply(this, arguments);\n}\n/**\n * This error indicates that the transport returned an invalid status code.\n */\n\n\nfunction _sendReplayRequest() {\n _sendReplayRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(_ref38) {\n var recordingData, replayId, segment_id, eventContext, timestamp, session, preparedRecordingData, urls, errorIds, traceIds, initialTimestamp, hub, client, scope, transport, dsn, baseEvent, replayEvent, envelope, response, error;\n return _regeneratorRuntime.wrap(function _callee20$(_context21) {\n while (1) {\n switch (_context21.prev = _context21.next) {\n case 0:\n recordingData = _ref38.recordingData, replayId = _ref38.replayId, segment_id = _ref38.segmentId, eventContext = _ref38.eventContext, timestamp = _ref38.timestamp, session = _ref38.session;\n preparedRecordingData = prepareRecordingData({\n recordingData: recordingData,\n headers: {\n segment_id: segment_id\n }\n });\n urls = eventContext.urls, errorIds = eventContext.errorIds, traceIds = eventContext.traceIds, initialTimestamp = eventContext.initialTimestamp;\n hub = getCurrentHub();\n client = hub.getClient();\n scope = hub.getScope();\n transport = client && client.getTransport();\n dsn = client && client.getDsn();\n\n if (!(!client || !transport || !dsn || !session.sampled)) {\n _context21.next = 10;\n break;\n }\n\n return _context21.abrupt(\"return\");\n\n case 10:\n baseEvent = {\n type: REPLAY_EVENT_NAME,\n replay_start_timestamp: initialTimestamp / 1000,\n timestamp: timestamp / 1000,\n error_ids: errorIds,\n trace_ids: traceIds,\n urls: urls,\n replay_id: replayId,\n segment_id: segment_id,\n replay_type: session.sampled\n };\n _context21.next = 13;\n return prepareReplayEvent({\n scope: scope,\n client: client,\n replayId: replayId,\n event: baseEvent\n });\n\n case 13:\n replayEvent = _context21.sent;\n\n if (replayEvent) {\n _context21.next = 18;\n break;\n }\n\n // Taken from baseclient's `_processEvent` method, where this is handled for errors/transactions\n client.recordDroppedEvent('event_processor', 'replay', baseEvent);\n logInfo('An event processor returned `null`, will not send event.');\n return _context21.abrupt(\"return\");\n\n case 18:\n /*\n For reference, the fully built event looks something like this:\n {\n \"type\": \"replay_event\",\n \"timestamp\": 1670837008.634,\n \"error_ids\": [\n \"errorId\"\n ],\n \"trace_ids\": [\n \"traceId\"\n ],\n \"urls\": [\n \"https://example.com\"\n ],\n \"replay_id\": \"eventId\",\n \"segment_id\": 3,\n \"replay_type\": \"error\",\n \"platform\": \"javascript\",\n \"event_id\": \"eventId\",\n \"environment\": \"production\",\n \"sdk\": {\n \"integrations\": [\n \"BrowserTracing\",\n \"Replay\"\n ],\n \"name\": \"sentry.javascript.browser\",\n \"version\": \"7.25.0\"\n },\n \"sdkProcessingMetadata\": {},\n \"contexts\": {\n },\n }\n */\n // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to\n // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may\n // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid\n // of this `delete`, lest we miss putting it back in the next time the property is in use.)\n delete replayEvent.sdkProcessingMetadata;\n envelope = createReplayEnvelope(replayEvent, preparedRecordingData, dsn, client.getOptions().tunnel);\n _context21.prev = 20;\n _context21.next = 23;\n return transport.send(envelope);\n\n case 23:\n response = _context21.sent;\n _context21.next = 31;\n break;\n\n case 26:\n _context21.prev = 26;\n _context21.t0 = _context21[\"catch\"](20);\n error = new Error(UNABLE_TO_SEND_REPLAY);\n\n try {\n // In case browsers don't allow this property to be writable\n // @ts-expect-error This needs lib es2022 and newer\n error.cause = _context21.t0;\n } catch (e) {// nothing to do\n }\n\n throw error;\n\n case 31:\n if (response) {\n _context21.next = 33;\n break;\n }\n\n return _context21.abrupt(\"return\", response);\n\n case 33:\n if (!(typeof response.statusCode === 'number' && (response.statusCode < 200 || response.statusCode >= 300))) {\n _context21.next = 35;\n break;\n }\n\n throw new TransportStatusCodeError(response.statusCode);\n\n case 35:\n return _context21.abrupt(\"return\", response);\n\n case 36:\n case \"end\":\n return _context21.stop();\n }\n }\n }, _callee20, null, [[20, 26]]);\n }));\n return _sendReplayRequest.apply(this, arguments);\n}\n\nvar TransportStatusCodeError = /*#__PURE__*/function (_Error2) {\n _inherits(TransportStatusCodeError, _Error2);\n\n var _super2 = _createSuper(TransportStatusCodeError);\n\n function TransportStatusCodeError(statusCode) {\n _classCallCheck(this, TransportStatusCodeError);\n\n return _super2.call(this, \"Transport returned status code \".concat(statusCode));\n }\n\n return _createClass(TransportStatusCodeError);\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n/**\n * Finalize and send the current replay event to Sentry\n */\n\n\nfunction sendReplay(_x22) {\n return _sendReplay.apply(this, arguments);\n}\n\nfunction _sendReplay() {\n _sendReplay = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(replayData) {\n var retryConfig,\n recordingData,\n options,\n error,\n _args22 = arguments;\n return _regeneratorRuntime.wrap(function _callee22$(_context23) {\n while (1) {\n switch (_context23.prev = _context23.next) {\n case 0:\n retryConfig = _args22.length > 1 && _args22[1] !== undefined ? _args22[1] : {\n count: 0,\n interval: RETRY_BASE_INTERVAL\n };\n recordingData = replayData.recordingData, options = replayData.options; // short circuit if there's no events to upload (this shouldn't happen as _runFlush makes this check)\n\n if (recordingData.length) {\n _context23.next = 4;\n break;\n }\n\n return _context23.abrupt(\"return\");\n\n case 4:\n _context23.prev = 4;\n _context23.next = 7;\n return sendReplayRequest(replayData);\n\n case 7:\n return _context23.abrupt(\"return\", true);\n\n case 10:\n _context23.prev = 10;\n _context23.t0 = _context23[\"catch\"](4);\n\n if (!(_context23.t0 instanceof TransportStatusCodeError)) {\n _context23.next = 14;\n break;\n }\n\n throw _context23.t0;\n\n case 14:\n // Capture error for every failed replay\n setContext('Replays', {\n _retryCount: retryConfig.count\n });\n\n if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && options._experiments && options._experiments.captureExceptions) {\n captureException(_context23.t0);\n } // If an error happened here, it's likely that uploading the attachment\n // failed, we'll can retry with the same events payload\n\n\n if (!(retryConfig.count >= RETRY_MAX_COUNT)) {\n _context23.next = 20;\n break;\n }\n\n error = new Error(\"\".concat(UNABLE_TO_SEND_REPLAY, \" - max retries exceeded\"));\n\n try {\n // In case browsers don't allow this property to be writable\n // @ts-expect-error This needs lib es2022 and newer\n error.cause = _context23.t0;\n } catch (e) {// nothing to do\n }\n\n throw error;\n\n case 20:\n // will retry in intervals of 5, 10, 30\n retryConfig.interval *= ++retryConfig.count;\n return _context23.abrupt(\"return\", new Promise(function (resolve, reject) {\n setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {\n return _regeneratorRuntime.wrap(function _callee21$(_context22) {\n while (1) {\n switch (_context22.prev = _context22.next) {\n case 0:\n _context22.prev = 0;\n _context22.next = 3;\n return sendReplay(replayData, retryConfig);\n\n case 3:\n resolve(true);\n _context22.next = 9;\n break;\n\n case 6:\n _context22.prev = 6;\n _context22.t0 = _context22[\"catch\"](0);\n reject(_context22.t0);\n\n case 9:\n case \"end\":\n return _context22.stop();\n }\n }\n }, _callee21, null, [[0, 6]]);\n })), retryConfig.interval);\n }));\n\n case 22:\n case \"end\":\n return _context23.stop();\n }\n }\n }, _callee22, null, [[4, 10]]);\n }));\n return _sendReplay.apply(this, arguments);\n}\n\nvar THROTTLED = '__THROTTLED';\nvar SKIPPED = '__SKIPPED';\n/**\n * Create a throttled function off a given function.\n * When calling the throttled function, it will call the original function only\n * if it hasn't been called more than `maxCount` times in the last `durationSeconds`.\n *\n * Returns `THROTTLED` if throttled for the first time, after that `SKIPPED`,\n * or else the return value of the original function.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nfunction throttle(fn, maxCount, durationSeconds) {\n var counter = new Map();\n\n var _cleanup = function _cleanup(now) {\n var threshold = now - durationSeconds;\n counter.forEach(function (_value, key) {\n if (key < threshold) {\n counter.delete(key);\n }\n });\n };\n\n var _getTotalCount = function _getTotalCount() {\n return _toConsumableArray(counter.values()).reduce(function (a, b) {\n return a + b;\n }, 0);\n };\n\n var isThrottled = false;\n return function () {\n // Date in second-precision, which we use as basis for the throttling\n var now = Math.floor(Date.now() / 1000); // First, make sure to delete any old entries\n\n _cleanup(now); // If already over limit, do nothing\n\n\n if (_getTotalCount() >= maxCount) {\n var wasThrottled = isThrottled;\n isThrottled = true;\n return wasThrottled ? SKIPPED : THROTTLED;\n }\n\n isThrottled = false;\n var count = counter.get(now) || 0;\n counter.set(now, count + 1);\n return fn.apply(void 0, arguments);\n };\n}\n/* eslint-disable max-lines */\n// TODO: We might want to split this file up\n\n/**\n * The main replay container class, which holds all the state and methods for recording and sending replays.\n */\n\n\nvar ReplayContainer = /*#__PURE__*/function () {\n /**\n * Recording can happen in one of three modes:\n * - session: Record the whole session, sending it continuously\n * - buffer: Always keep the last 60s of recording, requires:\n * - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs\n * - or calling `flush()` to send the replay\n */\n\n /**\n * The current or last active transcation.\n * This is only available when performance is enabled.\n */\n\n /**\n * These are here so we can overwrite them in tests etc.\n * @hidden\n */\n\n /**\n * Options to pass to `rrweb.record()`\n */\n\n /**\n * Timestamp of the last user activity. This lives across sessions.\n */\n\n /**\n * Is the integration currently active?\n */\n\n /**\n * Paused is a state where:\n * - DOM Recording is not listening at all\n * - Nothing will be added to event buffer (e.g. core SDK events)\n */\n\n /**\n * Have we attached listeners to the core SDK?\n * Note we have to track this as there is no way to remove instrumentation handlers.\n */\n\n /**\n * Function to stop recording\n */\n function ReplayContainer(_ref39) {\n var _this25 = this;\n\n var options = _ref39.options,\n recordingOptions = _ref39.recordingOptions;\n\n _classCallCheck(this, ReplayContainer);\n\n ReplayContainer.prototype.__init.call(this);\n\n ReplayContainer.prototype.__init2.call(this);\n\n ReplayContainer.prototype.__init3.call(this);\n\n ReplayContainer.prototype.__init4.call(this);\n\n ReplayContainer.prototype.__init5.call(this);\n\n ReplayContainer.prototype.__init6.call(this);\n\n this.eventBuffer = null;\n this.performanceEntries = [];\n this.replayPerformanceEntries = [];\n this.recordingMode = 'session';\n this.timeouts = {\n sessionIdlePause: SESSION_IDLE_PAUSE_DURATION,\n sessionIdleExpire: SESSION_IDLE_EXPIRE_DURATION\n };\n this._lastActivity = Date.now();\n this._isEnabled = false;\n this._isPaused = false;\n this._hasInitializedCoreListeners = false;\n this._context = {\n errorIds: new Set(),\n traceIds: new Set(),\n urls: [],\n initialTimestamp: Date.now(),\n initialUrl: ''\n };\n this._recordingOptions = recordingOptions;\n this._options = options;\n this._debouncedFlush = debounce(function () {\n return _this25._flush();\n }, this._options.flushMinDelay, {\n maxWait: this._options.flushMaxDelay\n });\n this._throttledAddEvent = throttle(function (event, isCheckout) {\n return addEvent(_this25, event, isCheckout);\n }, // Max 300 events...\n 300, // ... per 5s\n 5);\n\n var _this$getOptions = this.getOptions(),\n slowClickTimeout = _this$getOptions.slowClickTimeout,\n slowClickIgnoreSelectors = _this$getOptions.slowClickIgnoreSelectors;\n\n var slowClickConfig = slowClickTimeout ? {\n threshold: Math.min(SLOW_CLICK_THRESHOLD, slowClickTimeout),\n timeout: slowClickTimeout,\n scrollTimeout: SLOW_CLICK_SCROLL_TIMEOUT,\n ignoreSelector: slowClickIgnoreSelectors ? slowClickIgnoreSelectors.join(',') : ''\n } : undefined;\n\n if (slowClickConfig) {\n this.clickDetector = new ClickDetector(this, slowClickConfig);\n }\n }\n /** Get the event context. */\n\n\n _createClass(ReplayContainer, [{\n key: \"getContext\",\n value: function getContext() {\n return this._context;\n }\n /** If recording is currently enabled. */\n\n }, {\n key: \"isEnabled\",\n value: function isEnabled() {\n return this._isEnabled;\n }\n /** If recording is currently paused. */\n\n }, {\n key: \"isPaused\",\n value: function isPaused() {\n return this._isPaused;\n }\n /** Get the replay integration options. */\n\n }, {\n key: \"getOptions\",\n value: function getOptions() {\n return this._options;\n }\n /**\n * Initializes the plugin based on sampling configuration. Should not be\n * called outside of constructor.\n */\n\n }, {\n key: \"initializeSampling\",\n value: function initializeSampling(previousSessionId) {\n var _this$_options = this._options,\n errorSampleRate = _this$_options.errorSampleRate,\n sessionSampleRate = _this$_options.sessionSampleRate; // If neither sample rate is > 0, then do nothing - user will need to call one of\n // `start()` or `startBuffering` themselves.\n\n if (errorSampleRate <= 0 && sessionSampleRate <= 0) {\n return;\n } // Otherwise if there is _any_ sample rate set, try to load an existing\n // session, or create a new one.\n\n\n this._initializeSessionForSampling(previousSessionId);\n\n if (!this.session) {\n // This should not happen, something wrong has occurred\n this._handleException(new Error('Unable to initialize and create session'));\n\n return;\n }\n\n if (this.session.sampled === false) {\n // This should only occur if `errorSampleRate` is 0 and was unsampled for\n // session-based replay. In this case there is nothing to do.\n return;\n } // If segmentId > 0, it means we've previously already captured this session\n // In this case, we still want to continue in `session` recording mode\n\n\n this.recordingMode = this.session.sampled === 'buffer' && this.session.segmentId === 0 ? 'buffer' : 'session';\n logInfoNextTick(\"[Replay] Starting replay in \".concat(this.recordingMode, \" mode\"), this._options._experiments.traceInternals);\n\n this._initializeRecording();\n }\n /**\n * Start a replay regardless of sampling rate. Calling this will always\n * create a new session. Will throw an error if replay is already in progress.\n *\n * Creates or loads a session, attaches listeners to varying events (DOM,\n * _performanceObserver, Recording, Sentry SDK, etc)\n */\n\n }, {\n key: \"start\",\n value: function start() {\n if (this._isEnabled && this.recordingMode === 'session') {\n throw new Error('Replay recording is already in progress');\n }\n\n if (this._isEnabled && this.recordingMode === 'buffer') {\n throw new Error('Replay buffering is in progress, call `flush()` to save the replay');\n }\n\n logInfoNextTick('[Replay] Starting replay in session mode', this._options._experiments.traceInternals);\n var session = loadOrCreateSession({\n maxReplayDuration: this._options.maxReplayDuration,\n sessionIdleExpire: this.timeouts.sessionIdleExpire,\n traceInternals: this._options._experiments.traceInternals\n }, {\n stickySession: this._options.stickySession,\n // This is intentional: create a new session-based replay when calling `start()`\n sessionSampleRate: 1,\n allowBuffering: false\n });\n this.session = session;\n\n this._initializeRecording();\n }\n /**\n * Start replay buffering. Buffers until `flush()` is called or, if\n * `replaysOnErrorSampleRate` > 0, an error occurs.\n */\n\n }, {\n key: \"startBuffering\",\n value: function startBuffering() {\n if (this._isEnabled) {\n throw new Error('Replay recording is already in progress');\n }\n\n logInfoNextTick('[Replay] Starting replay in buffer mode', this._options._experiments.traceInternals);\n var session = loadOrCreateSession({\n sessionIdleExpire: this.timeouts.sessionIdleExpire,\n maxReplayDuration: this._options.maxReplayDuration,\n traceInternals: this._options._experiments.traceInternals\n }, {\n stickySession: this._options.stickySession,\n sessionSampleRate: 0,\n allowBuffering: true\n });\n this.session = session;\n this.recordingMode = 'buffer';\n\n this._initializeRecording();\n }\n /**\n * Start recording.\n *\n * Note that this will cause a new DOM checkout\n */\n\n }, {\n key: \"startRecording\",\n value: function startRecording() {\n try {\n this._stopRecording = record(_objectSpread(_objectSpread(_objectSpread({}, this._recordingOptions), this.recordingMode === 'buffer' && {\n checkoutEveryNms: BUFFER_CHECKOUT_TIME\n }), {}, {\n emit: getHandleRecordingEmit(this),\n onMutation: this._onMutationHandler\n }));\n } catch (err) {\n this._handleException(err);\n }\n }\n /**\n * Stops the recording, if it was running.\n *\n * Returns true if it was previously stopped, or is now stopped,\n * otherwise false.\n */\n\n }, {\n key: \"stopRecording\",\n value: function stopRecording() {\n try {\n if (this._stopRecording) {\n this._stopRecording();\n\n this._stopRecording = undefined;\n }\n\n return true;\n } catch (err) {\n this._handleException(err);\n\n return false;\n }\n }\n /**\n * Currently, this needs to be manually called (e.g. for tests). Sentry SDK\n * does not support a teardown\n */\n\n }, {\n key: \"stop\",\n value: function () {\n var _stop = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {\n var _ref40,\n _ref40$forceFlush,\n forceFlush,\n reason,\n _args7 = arguments;\n\n return _regeneratorRuntime.wrap(function _callee7$(_context8) {\n while (1) {\n switch (_context8.prev = _context8.next) {\n case 0:\n _ref40 = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {}, _ref40$forceFlush = _ref40.forceFlush, forceFlush = _ref40$forceFlush === void 0 ? false : _ref40$forceFlush, reason = _ref40.reason;\n\n if (this._isEnabled) {\n _context8.next = 3;\n break;\n }\n\n return _context8.abrupt(\"return\");\n\n case 3:\n // We can't move `_isEnabled` after awaiting a flush, otherwise we can\n // enter into an infinite loop when `stop()` is called while flushing.\n this._isEnabled = false;\n _context8.prev = 4;\n logInfo(\"[Replay] Stopping Replay\".concat(reason ? \" triggered by \".concat(reason) : ''), this._options._experiments.traceInternals);\n\n this._removeListeners();\n\n this.stopRecording();\n\n this._debouncedFlush.cancel(); // See comment above re: `_isEnabled`, we \"force\" a flush, ignoring the\n // `_isEnabled` state of the plugin since it was disabled above.\n\n\n if (!forceFlush) {\n _context8.next = 12;\n break;\n }\n\n _context8.next = 12;\n return this._flush({\n force: true\n });\n\n case 12:\n // After flush, destroy event buffer\n this.eventBuffer && this.eventBuffer.destroy();\n this.eventBuffer = null; // Clear session from session storage, note this means if a new session\n // is started after, it will not have `previousSessionId`\n\n clearSession(this);\n _context8.next = 20;\n break;\n\n case 17:\n _context8.prev = 17;\n _context8.t0 = _context8[\"catch\"](4);\n\n this._handleException(_context8.t0);\n\n case 20:\n case \"end\":\n return _context8.stop();\n }\n }\n }, _callee7, this, [[4, 17]]);\n }));\n\n function stop() {\n return _stop.apply(this, arguments);\n }\n\n return stop;\n }()\n /**\n * Pause some replay functionality. See comments for `_isPaused`.\n * This differs from stop as this only stops DOM recording, it is\n * not as thorough of a shutdown as `stop()`.\n */\n\n }, {\n key: \"pause\",\n value: function pause() {\n if (this._isPaused) {\n return;\n }\n\n this._isPaused = true;\n this.stopRecording();\n logInfo('[Replay] Pausing replay', this._options._experiments.traceInternals);\n }\n /**\n * Resumes recording, see notes for `pause().\n *\n * Note that calling `startRecording()` here will cause a\n * new DOM checkout.`\n */\n\n }, {\n key: \"resume\",\n value: function resume() {\n if (!this._isPaused || !this._checkSession()) {\n return;\n }\n\n this._isPaused = false;\n this.startRecording();\n logInfo('[Replay] Resuming replay', this._options._experiments.traceInternals);\n }\n /**\n * If not in \"session\" recording mode, flush event buffer which will create a new replay.\n * Unless `continueRecording` is false, the replay will continue to record and\n * behave as a \"session\"-based replay.\n *\n * Otherwise, queue up a flush.\n */\n\n }, {\n key: \"sendBufferedReplayOrFlush\",\n value: function () {\n var _sendBufferedReplayOrFlush = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {\n var _ref41,\n _ref41$continueRecord,\n continueRecording,\n activityTime,\n hasStoppedRecording,\n _args8 = arguments;\n\n return _regeneratorRuntime.wrap(function _callee8$(_context9) {\n while (1) {\n switch (_context9.prev = _context9.next) {\n case 0:\n _ref41 = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {}, _ref41$continueRecord = _ref41.continueRecording, continueRecording = _ref41$continueRecord === void 0 ? true : _ref41$continueRecord;\n\n if (!(this.recordingMode === 'session')) {\n _context9.next = 3;\n break;\n }\n\n return _context9.abrupt(\"return\", this.flushImmediate());\n\n case 3:\n activityTime = Date.now();\n logInfo('[Replay] Converting buffer to session', this._options._experiments.traceInternals); // Allow flush to complete before resuming as a session recording, otherwise\n // the checkout from `startRecording` may be included in the payload.\n // Prefer to keep the error replay as a separate (and smaller) segment\n // than the session replay.\n\n _context9.next = 7;\n return this.flushImmediate();\n\n case 7:\n hasStoppedRecording = this.stopRecording();\n\n if (!(!continueRecording || !hasStoppedRecording)) {\n _context9.next = 10;\n break;\n }\n\n return _context9.abrupt(\"return\");\n\n case 10:\n if (!(this.recordingMode === 'session')) {\n _context9.next = 12;\n break;\n }\n\n return _context9.abrupt(\"return\");\n\n case 12:\n // Re-start recording in session-mode\n this.recordingMode = 'session'; // Once this session ends, we do not want to refresh it\n\n if (this.session) {\n this._updateUserActivity(activityTime);\n\n this._updateSessionActivity(activityTime);\n\n this._maybeSaveSession();\n }\n\n this.startRecording();\n\n case 15:\n case \"end\":\n return _context9.stop();\n }\n }\n }, _callee8, this);\n }));\n\n function sendBufferedReplayOrFlush() {\n return _sendBufferedReplayOrFlush.apply(this, arguments);\n }\n\n return sendBufferedReplayOrFlush;\n }()\n /**\n * We want to batch uploads of replay events. Save events only if\n * `` milliseconds have elapsed since the last event\n * *OR* if `` milliseconds have elapsed.\n *\n * Accepts a callback to perform side-effects and returns true to stop batch\n * processing and hand back control to caller.\n */\n\n }, {\n key: \"addUpdate\",\n value: function addUpdate(cb) {\n // We need to always run `cb` (e.g. in the case of `this.recordingMode == 'buffer'`)\n var cbResult = cb(); // If this option is turned on then we will only want to call `flush`\n // explicitly\n\n if (this.recordingMode === 'buffer') {\n return;\n } // If callback is true, we do not want to continue with flushing -- the\n // caller will need to handle it.\n\n\n if (cbResult === true) {\n return;\n } // addUpdate is called quite frequently - use _debouncedFlush so that it\n // respects the flush delays and does not flush immediately\n\n\n this._debouncedFlush();\n }\n /**\n * Updates the user activity timestamp and resumes recording. This should be\n * called in an event handler for a user action that we consider as the user\n * being \"active\" (e.g. a mouse click).\n */\n\n }, {\n key: \"triggerUserActivity\",\n value: function triggerUserActivity() {\n this._updateUserActivity(); // This case means that recording was once stopped due to inactivity.\n // Ensure that recording is resumed.\n\n\n if (!this._stopRecording) {\n // Create a new session, otherwise when the user action is flushed, it\n // will get rejected due to an expired session.\n if (!this._checkSession()) {\n return;\n } // Note: This will cause a new DOM checkout\n\n\n this.resume();\n return;\n } // Otherwise... recording was never suspended, continue as normalish\n\n\n this.checkAndHandleExpiredSession();\n\n this._updateSessionActivity();\n }\n /**\n * Updates the user activity timestamp *without* resuming\n * recording. Some user events (e.g. keydown) can be create\n * low-value replays that only contain the keypress as a\n * breadcrumb. Instead this would require other events to\n * create a new replay after a session has expired.\n */\n\n }, {\n key: \"updateUserActivity\",\n value: function updateUserActivity() {\n this._updateUserActivity();\n\n this._updateSessionActivity();\n }\n /**\n * Only flush if `this.recordingMode === 'session'`\n */\n\n }, {\n key: \"conditionalFlush\",\n value: function conditionalFlush() {\n if (this.recordingMode === 'buffer') {\n return Promise.resolve();\n }\n\n return this.flushImmediate();\n }\n /**\n * Flush using debounce flush\n */\n\n }, {\n key: \"flush\",\n value: function flush() {\n return this._debouncedFlush();\n }\n /**\n * Always flush via `_debouncedFlush` so that we do not have flushes triggered\n * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be\n * cases of mulitple flushes happening closely together.\n */\n\n }, {\n key: \"flushImmediate\",\n value: function flushImmediate() {\n this._debouncedFlush(); // `.flush` is provided by the debounced function, analogously to lodash.debounce\n\n\n return this._debouncedFlush.flush();\n }\n /**\n * Cancels queued up flushes.\n */\n\n }, {\n key: \"cancelFlush\",\n value: function cancelFlush() {\n this._debouncedFlush.cancel();\n }\n /** Get the current sesion (=replay) ID */\n\n }, {\n key: \"getSessionId\",\n value: function getSessionId() {\n return this.session && this.session.id;\n }\n /**\n * Checks if recording should be stopped due to user inactivity. Otherwise\n * check if session is expired and create a new session if so. Triggers a new\n * full snapshot on new session.\n *\n * Returns true if session is not expired, false otherwise.\n * @hidden\n */\n\n }, {\n key: \"checkAndHandleExpiredSession\",\n value: function checkAndHandleExpiredSession() {\n // Prevent starting a new session if the last user activity is older than\n // SESSION_IDLE_PAUSE_DURATION. Otherwise non-user activity can trigger a new\n // session+recording. This creates noisy replays that do not have much\n // content in them.\n if (this._lastActivity && isExpired(this._lastActivity, this.timeouts.sessionIdlePause) && this.session && this.session.sampled === 'session') {\n // Pause recording only for session-based replays. Otherwise, resuming\n // will create a new replay and will conflict with users who only choose\n // to record error-based replays only. (e.g. the resumed replay will not\n // contain a reference to an error)\n this.pause();\n return;\n } // --- There is recent user activity --- //\n // This will create a new session if expired, based on expiry length\n\n\n if (!this._checkSession()) {\n // Check session handles the refreshing itself\n return false;\n }\n\n return true;\n }\n /**\n * Capture some initial state that can change throughout the lifespan of the\n * replay. This is required because otherwise they would be captured at the\n * first flush.\n */\n\n }, {\n key: \"setInitialState\",\n value: function setInitialState() {\n var urlPath = \"\".concat(WINDOW.location.pathname).concat(WINDOW.location.hash).concat(WINDOW.location.search);\n var url = \"\".concat(WINDOW.location.origin).concat(urlPath);\n this.performanceEntries = [];\n this.replayPerformanceEntries = []; // Reset _context as well\n\n this._clearContext();\n\n this._context.initialUrl = url;\n this._context.initialTimestamp = Date.now();\n\n this._context.urls.push(url);\n }\n /**\n * Add a breadcrumb event, that may be throttled.\n * If it was throttled, we add a custom breadcrumb to indicate that.\n */\n\n }, {\n key: \"throttledAddEvent\",\n value: function throttledAddEvent(event, isCheckout) {\n var _this26 = this;\n\n var res = this._throttledAddEvent(event, isCheckout); // If this is THROTTLED, it means we have throttled the event for the first time\n // In this case, we want to add a breadcrumb indicating that something was skipped\n\n\n if (res === THROTTLED) {\n var breadcrumb = createBreadcrumb({\n category: 'replay.throttled'\n });\n this.addUpdate(function () {\n // Return `false` if the event _was_ added, as that means we schedule a flush\n return !addEventSync(_this26, {\n type: ReplayEventTypeCustom,\n timestamp: breadcrumb.timestamp || 0,\n data: {\n tag: 'breadcrumb',\n payload: breadcrumb,\n metric: true\n }\n });\n });\n }\n\n return res;\n }\n /**\n * This will get the parametrized route name of the current page.\n * This is only available if performance is enabled, and if an instrumented router is used.\n */\n\n }, {\n key: \"getCurrentRoute\",\n value: function getCurrentRoute() {\n var lastTransaction = this.lastTransaction || getCurrentHub().getScope().getTransaction();\n\n if (!lastTransaction || !['route', 'custom'].includes(lastTransaction.metadata.source)) {\n return undefined;\n }\n\n return lastTransaction.name;\n }\n /**\n * Initialize and start all listeners to varying events (DOM,\n * Performance Observer, Recording, Sentry SDK, etc)\n */\n\n }, {\n key: \"_initializeRecording\",\n value: function _initializeRecording() {\n this.setInitialState(); // this method is generally called on page load or manually - in both cases\n // we should treat it as an activity\n\n this._updateSessionActivity();\n\n this.eventBuffer = createEventBuffer({\n useCompression: this._options.useCompression,\n workerUrl: this._options.workerUrl\n });\n\n this._removeListeners();\n\n this._addListeners(); // Need to set as enabled before we start recording, as `record()` can trigger a flush with a new checkout\n\n\n this._isEnabled = true;\n this._isPaused = false;\n this.startRecording();\n }\n /** A wrapper to conditionally capture exceptions. */\n\n }, {\n key: \"_handleException\",\n value: function _handleException(error) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('[Replay]', error);\n\n if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && this._options._experiments && this._options._experiments.captureExceptions) {\n captureException(error);\n }\n }\n /**\n * Loads (or refreshes) the current session.\n */\n\n }, {\n key: \"_initializeSessionForSampling\",\n value: function _initializeSessionForSampling(previousSessionId) {\n // Whenever there is _any_ error sample rate, we always allow buffering\n // Because we decide on sampling when an error occurs, we need to buffer at all times if sampling for errors\n var allowBuffering = this._options.errorSampleRate > 0;\n var session = loadOrCreateSession({\n sessionIdleExpire: this.timeouts.sessionIdleExpire,\n maxReplayDuration: this._options.maxReplayDuration,\n traceInternals: this._options._experiments.traceInternals,\n previousSessionId: previousSessionId\n }, {\n stickySession: this._options.stickySession,\n sessionSampleRate: this._options.sessionSampleRate,\n allowBuffering: allowBuffering\n });\n this.session = session;\n }\n /**\n * Checks and potentially refreshes the current session.\n * Returns false if session is not recorded.\n */\n\n }, {\n key: \"_checkSession\",\n value: function _checkSession() {\n // If there is no session yet, we do not want to refresh anything\n // This should generally not happen, but to be safe....\n if (!this.session) {\n return false;\n }\n\n var currentSession = this.session;\n\n if (shouldRefreshSession(currentSession, {\n sessionIdleExpire: this.timeouts.sessionIdleExpire,\n maxReplayDuration: this._options.maxReplayDuration\n })) {\n void this._refreshSession(currentSession);\n return false;\n }\n\n return true;\n }\n /**\n * Refresh a session with a new one.\n * This stops the current session (without forcing a flush, as that would never work since we are expired),\n * and then does a new sampling based on the refreshed session.\n */\n\n }, {\n key: \"_refreshSession\",\n value: function () {\n var _refreshSession2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(session) {\n return _regeneratorRuntime.wrap(function _callee9$(_context10) {\n while (1) {\n switch (_context10.prev = _context10.next) {\n case 0:\n if (this._isEnabled) {\n _context10.next = 2;\n break;\n }\n\n return _context10.abrupt(\"return\");\n\n case 2:\n _context10.next = 4;\n return this.stop({\n reason: 'refresh session'\n });\n\n case 4:\n this.initializeSampling(session.id);\n\n case 5:\n case \"end\":\n return _context10.stop();\n }\n }\n }, _callee9, this);\n }));\n\n function _refreshSession(_x23) {\n return _refreshSession2.apply(this, arguments);\n }\n\n return _refreshSession;\n }()\n /**\n * Adds listeners to record events for the replay\n */\n\n }, {\n key: \"_addListeners\",\n value: function _addListeners() {\n try {\n WINDOW.document.addEventListener('visibilitychange', this._handleVisibilityChange);\n WINDOW.addEventListener('blur', this._handleWindowBlur);\n WINDOW.addEventListener('focus', this._handleWindowFocus);\n WINDOW.addEventListener('keydown', this._handleKeyboardEvent);\n\n if (this.clickDetector) {\n this.clickDetector.addListeners();\n } // There is no way to remove these listeners, so ensure they are only added once\n\n\n if (!this._hasInitializedCoreListeners) {\n addGlobalListeners(this);\n this._hasInitializedCoreListeners = true;\n }\n } catch (err) {\n this._handleException(err);\n }\n\n this._performanceCleanupCallback = setupPerformanceObserver(this);\n }\n /**\n * Cleans up listeners that were created in `_addListeners`\n */\n\n }, {\n key: \"_removeListeners\",\n value: function _removeListeners() {\n try {\n WINDOW.document.removeEventListener('visibilitychange', this._handleVisibilityChange);\n WINDOW.removeEventListener('blur', this._handleWindowBlur);\n WINDOW.removeEventListener('focus', this._handleWindowFocus);\n WINDOW.removeEventListener('keydown', this._handleKeyboardEvent);\n\n if (this.clickDetector) {\n this.clickDetector.removeListeners();\n }\n\n if (this._performanceCleanupCallback) {\n this._performanceCleanupCallback();\n }\n } catch (err) {\n this._handleException(err);\n }\n }\n /**\n * Handle when visibility of the page content changes. Opening a new tab will\n * cause the state to change to hidden because of content of current page will\n * be hidden. Likewise, moving a different window to cover the contents of the\n * page will also trigger a change to a hidden state.\n */\n\n }, {\n key: \"__init\",\n value: function __init() {\n var _this27 = this;\n\n this._handleVisibilityChange = function () {\n if (WINDOW.document.visibilityState === 'visible') {\n _this27._doChangeToForegroundTasks();\n } else {\n _this27._doChangeToBackgroundTasks();\n }\n };\n }\n /**\n * Handle when page is blurred\n */\n\n }, {\n key: \"__init2\",\n value: function __init2() {\n var _this28 = this;\n\n this._handleWindowBlur = function () {\n var breadcrumb = createBreadcrumb({\n category: 'ui.blur'\n }); // Do not count blur as a user action -- it's part of the process of them\n // leaving the page\n\n _this28._doChangeToBackgroundTasks(breadcrumb);\n };\n }\n /**\n * Handle when page is focused\n */\n\n }, {\n key: \"__init3\",\n value: function __init3() {\n var _this29 = this;\n\n this._handleWindowFocus = function () {\n var breadcrumb = createBreadcrumb({\n category: 'ui.focus'\n }); // Do not count focus as a user action -- instead wait until they focus and\n // interactive with page\n\n _this29._doChangeToForegroundTasks(breadcrumb);\n };\n }\n /** Ensure page remains active when a key is pressed. */\n\n }, {\n key: \"__init4\",\n value: function __init4() {\n var _this30 = this;\n\n this._handleKeyboardEvent = function (event) {\n handleKeyboardEvent(_this30, event);\n };\n }\n /**\n * Tasks to run when we consider a page to be hidden (via blurring and/or visibility)\n */\n\n }, {\n key: \"_doChangeToBackgroundTasks\",\n value: function _doChangeToBackgroundTasks(breadcrumb) {\n if (!this.session) {\n return;\n }\n\n var expired = isSessionExpired(this.session, {\n maxReplayDuration: this._options.maxReplayDuration,\n sessionIdleExpire: this.timeouts.sessionIdleExpire\n });\n\n if (expired) {\n return;\n }\n\n if (breadcrumb) {\n this._createCustomBreadcrumb(breadcrumb);\n } // Send replay when the page/tab becomes hidden. There is no reason to send\n // replay if it becomes visible, since no actions we care about were done\n // while it was hidden\n\n\n void this.conditionalFlush();\n }\n /**\n * Tasks to run when we consider a page to be visible (via focus and/or visibility)\n */\n\n }, {\n key: \"_doChangeToForegroundTasks\",\n value: function _doChangeToForegroundTasks(breadcrumb) {\n if (!this.session) {\n return;\n }\n\n var isSessionActive = this.checkAndHandleExpiredSession();\n\n if (!isSessionActive) {\n // If the user has come back to the page within SESSION_IDLE_PAUSE_DURATION\n // ms, we will re-use the existing session, otherwise create a new\n // session\n logInfo('[Replay] Document has become active, but session has expired');\n return;\n }\n\n if (breadcrumb) {\n this._createCustomBreadcrumb(breadcrumb);\n }\n }\n /**\n * Update user activity (across session lifespans)\n */\n\n }, {\n key: \"_updateUserActivity\",\n value: function _updateUserActivity() {\n var _lastActivity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Date.now();\n\n this._lastActivity = _lastActivity;\n }\n /**\n * Updates the session's last activity timestamp\n */\n\n }, {\n key: \"_updateSessionActivity\",\n value: function _updateSessionActivity() {\n var _lastActivity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Date.now();\n\n if (this.session) {\n this.session.lastActivity = _lastActivity;\n\n this._maybeSaveSession();\n }\n }\n /**\n * Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb\n */\n\n }, {\n key: \"_createCustomBreadcrumb\",\n value: function _createCustomBreadcrumb(breadcrumb) {\n var _this31 = this;\n\n this.addUpdate(function () {\n void _this31.throttledAddEvent({\n type: EventType.Custom,\n timestamp: breadcrumb.timestamp || 0,\n data: {\n tag: 'breadcrumb',\n payload: breadcrumb\n }\n });\n });\n }\n /**\n * Observed performance events are added to `this.performanceEntries`. These\n * are included in the replay event before it is finished and sent to Sentry.\n */\n\n }, {\n key: \"_addPerformanceEntries\",\n value: function _addPerformanceEntries() {\n var performanceEntries = createPerformanceEntries(this.performanceEntries).concat(this.replayPerformanceEntries);\n this.performanceEntries = [];\n this.replayPerformanceEntries = [];\n return Promise.all(createPerformanceSpans(this, performanceEntries));\n }\n /**\n * Clear _context\n */\n\n }, {\n key: \"_clearContext\",\n value: function _clearContext() {\n // XXX: `initialTimestamp` and `initialUrl` do not get cleared\n this._context.errorIds.clear();\n\n this._context.traceIds.clear();\n\n this._context.urls = [];\n }\n /** Update the initial timestamp based on the buffer content. */\n\n }, {\n key: \"_updateInitialTimestampFromEventBuffer\",\n value: function _updateInitialTimestampFromEventBuffer() {\n var session = this.session,\n eventBuffer = this.eventBuffer;\n\n if (!session || !eventBuffer) {\n return;\n } // we only ever update this on the initial segment\n\n\n if (session.segmentId) {\n return;\n }\n\n var earliestEvent = eventBuffer.getEarliestTimestamp();\n\n if (earliestEvent && earliestEvent < this._context.initialTimestamp) {\n this._context.initialTimestamp = earliestEvent;\n }\n }\n /**\n * Return and clear _context\n */\n\n }, {\n key: \"_popEventContext\",\n value: function _popEventContext() {\n var _context = {\n initialTimestamp: this._context.initialTimestamp,\n initialUrl: this._context.initialUrl,\n errorIds: Array.from(this._context.errorIds),\n traceIds: Array.from(this._context.traceIds),\n urls: this._context.urls\n };\n\n this._clearContext();\n\n return _context;\n }\n /**\n * Flushes replay event buffer to Sentry.\n *\n * Performance events are only added right before flushing - this is\n * due to the buffered performance observer events.\n *\n * Should never be called directly, only by `flush`\n */\n\n }, {\n key: \"_runFlush\",\n value: function () {\n var _runFlush2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {\n var replayId, timestamp, eventContext, segmentId, recordingData, client;\n return _regeneratorRuntime.wrap(function _callee10$(_context11) {\n while (1) {\n switch (_context11.prev = _context11.next) {\n case 0:\n replayId = this.getSessionId();\n\n if (!(!this.session || !this.eventBuffer || !replayId)) {\n _context11.next = 4;\n break;\n }\n\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('[Replay] No session or eventBuffer found to flush.');\n return _context11.abrupt(\"return\");\n\n case 4:\n _context11.next = 6;\n return this._addPerformanceEntries();\n\n case 6:\n if (!(!this.eventBuffer || !this.eventBuffer.hasEvents)) {\n _context11.next = 8;\n break;\n }\n\n return _context11.abrupt(\"return\");\n\n case 8:\n _context11.next = 10;\n return addMemoryEntry(this);\n\n case 10:\n if (this.eventBuffer) {\n _context11.next = 12;\n break;\n }\n\n return _context11.abrupt(\"return\");\n\n case 12:\n if (!(replayId !== this.getSessionId())) {\n _context11.next = 14;\n break;\n }\n\n return _context11.abrupt(\"return\");\n\n case 14:\n _context11.prev = 14;\n\n // This uses the data from the eventBuffer, so we need to call this before `finish()\n this._updateInitialTimestampFromEventBuffer();\n\n timestamp = Date.now(); // Check total duration again, to avoid sending outdated stuff\n // We leave 30s wiggle room to accomodate late flushing etc.\n // This _could_ happen when the browser is suspended during flushing, in which case we just want to stop\n\n if (!(timestamp - this._context.initialTimestamp > this._options.maxReplayDuration + 30000)) {\n _context11.next = 19;\n break;\n }\n\n throw new Error('Session is too long, not sending replay');\n\n case 19:\n eventContext = this._popEventContext(); // Always increment segmentId regardless of outcome of sending replay\n\n segmentId = this.session.segmentId++;\n\n this._maybeSaveSession(); // Note this empties the event buffer regardless of outcome of sending replay\n\n\n _context11.next = 24;\n return this.eventBuffer.finish();\n\n case 24:\n recordingData = _context11.sent;\n _context11.next = 27;\n return sendReplay({\n replayId: replayId,\n recordingData: recordingData,\n segmentId: segmentId,\n eventContext: eventContext,\n session: this.session,\n options: this.getOptions(),\n timestamp: timestamp\n });\n\n case 27:\n _context11.next = 35;\n break;\n\n case 29:\n _context11.prev = 29;\n _context11.t0 = _context11[\"catch\"](14);\n\n this._handleException(_context11.t0); // This means we retried 3 times and all of them failed,\n // or we ran into a problem we don't want to retry, like rate limiting.\n // In this case, we want to completely stop the replay - otherwise, we may get inconsistent segments\n\n\n void this.stop({\n reason: 'sendReplay'\n });\n client = getCurrentHub().getClient();\n\n if (client) {\n client.recordDroppedEvent('send_error', 'replay');\n }\n\n case 35:\n case \"end\":\n return _context11.stop();\n }\n }\n }, _callee10, this, [[14, 29]]);\n }));\n\n function _runFlush() {\n return _runFlush2.apply(this, arguments);\n }\n\n return _runFlush;\n }()\n /**\n * Flush recording data to Sentry. Creates a lock so that only a single flush\n * can be active at a time. Do not call this directly.\n */\n\n }, {\n key: \"__init5\",\n value: function __init5() {\n var _this32 = this;\n\n this._flush = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {\n var _ref43,\n _ref43$force,\n force,\n start,\n now,\n duration,\n tooShort,\n tooLong,\n eventBuffer,\n _args11 = arguments;\n\n return _regeneratorRuntime.wrap(function _callee11$(_context12) {\n while (1) {\n switch (_context12.prev = _context12.next) {\n case 0:\n _ref43 = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {}, _ref43$force = _ref43.force, force = _ref43$force === void 0 ? false : _ref43$force;\n\n if (!(!_this32._isEnabled && !force)) {\n _context12.next = 3;\n break;\n }\n\n return _context12.abrupt(\"return\");\n\n case 3:\n if (_this32.checkAndHandleExpiredSession()) {\n _context12.next = 6;\n break;\n }\n\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('[Replay] Attempting to finish replay event after session expired.');\n return _context12.abrupt(\"return\");\n\n case 6:\n if (_this32.session) {\n _context12.next = 8;\n break;\n }\n\n return _context12.abrupt(\"return\");\n\n case 8:\n start = _this32.session.started;\n now = Date.now();\n duration = now - start; // A flush is about to happen, cancel any queued flushes\n\n _this32._debouncedFlush.cancel(); // If session is too short, or too long (allow some wiggle room over maxReplayDuration), do not send it\n // This _should_ not happen, but it may happen if flush is triggered due to a page activity change or similar\n\n\n tooShort = duration < _this32._options.minReplayDuration;\n tooLong = duration > _this32._options.maxReplayDuration + 5000;\n\n if (!(tooShort || tooLong)) {\n _context12.next = 18;\n break;\n }\n\n logInfo(\"[Replay] Session duration (\".concat(Math.floor(duration / 1000), \"s) is too \").concat(tooShort ? 'short' : 'long', \", not sending replay.\"), _this32._options._experiments.traceInternals);\n\n if (tooShort) {\n _this32._debouncedFlush();\n }\n\n return _context12.abrupt(\"return\");\n\n case 18:\n eventBuffer = _this32.eventBuffer;\n\n if (eventBuffer && _this32.session.segmentId === 0 && !eventBuffer.hasCheckout) {\n logInfo('[Replay] Flushing initial segment without checkout.', _this32._options._experiments.traceInternals); // TODO FN: Evaluate if we want to stop here, or remove this again?\n } // this._flushLock acts as a lock so that future calls to `_flush()`\n // will be blocked until this promise resolves\n\n\n if (_this32._flushLock) {\n _context12.next = 26;\n break;\n }\n\n _this32._flushLock = _this32._runFlush();\n _context12.next = 24;\n return _this32._flushLock;\n\n case 24:\n _this32._flushLock = undefined;\n return _context12.abrupt(\"return\");\n\n case 26:\n _context12.prev = 26;\n _context12.next = 29;\n return _this32._flushLock;\n\n case 29:\n _context12.next = 34;\n break;\n\n case 31:\n _context12.prev = 31;\n _context12.t0 = _context12[\"catch\"](26);\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(_context12.t0);\n\n case 34:\n _context12.prev = 34;\n\n _this32._debouncedFlush();\n\n return _context12.finish(34);\n\n case 37:\n case \"end\":\n return _context12.stop();\n }\n }\n }, _callee11, null, [[26, 31, 34, 37]]);\n }));\n }\n /** Save the session, if it is sticky */\n\n }, {\n key: \"_maybeSaveSession\",\n value: function _maybeSaveSession() {\n if (this.session && this._options.stickySession) {\n saveSession(this.session);\n }\n }\n /** Handler for rrweb.record.onMutation */\n\n }, {\n key: \"__init6\",\n value: function __init6() {\n var _this33 = this;\n\n this._onMutationHandler = function (mutations) {\n var count = mutations.length;\n var mutationLimit = _this33._options.mutationLimit;\n var mutationBreadcrumbLimit = _this33._options.mutationBreadcrumbLimit;\n var overMutationLimit = mutationLimit && count > mutationLimit; // Create a breadcrumb if a lot of mutations happen at the same time\n // We can show this in the UI as an information with potential performance improvements\n\n if (count > mutationBreadcrumbLimit || overMutationLimit) {\n var breadcrumb = createBreadcrumb({\n category: 'replay.mutations',\n data: {\n count: count,\n limit: overMutationLimit\n }\n });\n\n _this33._createCustomBreadcrumb(breadcrumb);\n } // Stop replay if over the mutation limit\n\n\n if (overMutationLimit) {\n void _this33.stop({\n reason: 'mutationLimit',\n forceFlush: _this33.recordingMode === 'session'\n });\n return false;\n } // `true` means we use the regular mutation handling by rrweb\n\n\n return true;\n };\n }\n }]);\n\n return ReplayContainer;\n}();\n\nfunction getOption(selectors, defaultSelectors, deprecatedClassOption, deprecatedSelectorOption) {\n var deprecatedSelectors = typeof deprecatedSelectorOption === 'string' ? deprecatedSelectorOption.split(',') : [];\n var allSelectors = [].concat(_toConsumableArray(selectors), _toConsumableArray(deprecatedSelectors), _toConsumableArray(defaultSelectors)); // @deprecated\n\n if (typeof deprecatedClassOption !== 'undefined') {\n // NOTE: No support for RegExp\n if (typeof deprecatedClassOption === 'string') {\n allSelectors.push(\".\".concat(deprecatedClassOption));\n } // eslint-disable-next-line no-console\n\n\n console.warn('[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.');\n }\n\n return allSelectors.join(',');\n}\n/**\n * Returns privacy related configuration for use in rrweb\n */\n\n\nfunction getPrivacyOptions(_ref44) {\n var mask = _ref44.mask,\n unmask = _ref44.unmask,\n block = _ref44.block,\n unblock = _ref44.unblock,\n ignore = _ref44.ignore,\n blockClass = _ref44.blockClass,\n blockSelector = _ref44.blockSelector,\n maskTextClass = _ref44.maskTextClass,\n maskTextSelector = _ref44.maskTextSelector,\n ignoreClass = _ref44.ignoreClass;\n var defaultBlockedElements = ['base[href=\"/\"]'];\n var maskSelector = getOption(mask, ['.sentry-mask', '[data-sentry-mask]'], maskTextClass, maskTextSelector);\n var unmaskSelector = getOption(unmask, ['.sentry-unmask', '[data-sentry-unmask]']);\n var options = {\n // We are making the decision to make text and input selectors the same\n maskTextSelector: maskSelector,\n unmaskTextSelector: unmaskSelector,\n blockSelector: getOption(block, ['.sentry-block', '[data-sentry-block]'].concat(defaultBlockedElements), blockClass, blockSelector),\n unblockSelector: getOption(unblock, ['.sentry-unblock', '[data-sentry-unblock]']),\n ignoreSelector: getOption(ignore, ['.sentry-ignore', '[data-sentry-ignore]', 'input[type=\"file\"]'], ignoreClass)\n };\n\n if (blockClass instanceof RegExp) {\n options.blockClass = blockClass;\n }\n\n if (maskTextClass instanceof RegExp) {\n options.maskTextClass = maskTextClass;\n }\n\n return options;\n}\n/**\n * Masks an attribute if necessary, otherwise return attribute value as-is.\n */\n\n\nfunction maskAttribute(_ref45) {\n var el = _ref45.el,\n key = _ref45.key,\n maskAttributes = _ref45.maskAttributes,\n maskAllText = _ref45.maskAllText,\n privacyOptions = _ref45.privacyOptions,\n value = _ref45.value;\n\n // We only mask attributes if `maskAllText` is true\n if (!maskAllText) {\n return value;\n } // unmaskTextSelector takes precendence\n\n\n if (privacyOptions.unmaskTextSelector && el.matches(privacyOptions.unmaskTextSelector)) {\n return value;\n }\n\n if (maskAttributes.includes(key) || // Need to mask `value` attribute for `` if it's a button-like\n // type\n key === 'value' && el.tagName === 'INPUT' && ['submit', 'button'].includes(el.getAttribute('type') || '')) {\n return value.replace(/[\\S]/g, '*');\n }\n\n return value;\n}\n\nvar MEDIA_SELECTORS = 'img,image,svg,video,object,picture,embed,map,audio,link[rel=\"icon\"],link[rel=\"apple-touch-icon\"]';\nvar DEFAULT_NETWORK_HEADERS = ['content-length', 'content-type', 'accept'];\nvar _initialized = false;\n/**\n * The main replay integration class, to be passed to `init({ integrations: [] })`.\n */\n\nvar Replay = /*#__PURE__*/function () {\n /**\n * @inheritDoc\n */\n\n /**\n * Options to pass to `rrweb.record()`\n */\n\n /**\n * Initial options passed to the replay integration, merged with default values.\n * Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they\n * can only be finally set when setupOnce() is called.\n *\n * @private\n */\n function Replay() {\n var _ref46 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref46$flushMinDelay = _ref46.flushMinDelay,\n flushMinDelay = _ref46$flushMinDelay === void 0 ? DEFAULT_FLUSH_MIN_DELAY : _ref46$flushMinDelay,\n _ref46$flushMaxDelay = _ref46.flushMaxDelay,\n flushMaxDelay = _ref46$flushMaxDelay === void 0 ? DEFAULT_FLUSH_MAX_DELAY : _ref46$flushMaxDelay,\n _ref46$minReplayDurat = _ref46.minReplayDuration,\n minReplayDuration = _ref46$minReplayDurat === void 0 ? MIN_REPLAY_DURATION : _ref46$minReplayDurat,\n _ref46$maxReplayDurat = _ref46.maxReplayDuration,\n maxReplayDuration = _ref46$maxReplayDurat === void 0 ? MAX_REPLAY_DURATION : _ref46$maxReplayDurat,\n _ref46$stickySession = _ref46.stickySession,\n stickySession = _ref46$stickySession === void 0 ? true : _ref46$stickySession,\n _ref46$useCompression = _ref46.useCompression,\n useCompression = _ref46$useCompression === void 0 ? true : _ref46$useCompression,\n workerUrl = _ref46.workerUrl,\n _ref46$_experiments = _ref46._experiments,\n _experiments = _ref46$_experiments === void 0 ? {} : _ref46$_experiments,\n sessionSampleRate = _ref46.sessionSampleRate,\n errorSampleRate = _ref46.errorSampleRate,\n _ref46$maskAllText = _ref46.maskAllText,\n maskAllText = _ref46$maskAllText === void 0 ? true : _ref46$maskAllText,\n _ref46$maskAllInputs = _ref46.maskAllInputs,\n maskAllInputs = _ref46$maskAllInputs === void 0 ? true : _ref46$maskAllInputs,\n _ref46$blockAllMedia = _ref46.blockAllMedia,\n blockAllMedia = _ref46$blockAllMedia === void 0 ? true : _ref46$blockAllMedia,\n _ref46$mutationBreadc = _ref46.mutationBreadcrumbLimit,\n mutationBreadcrumbLimit = _ref46$mutationBreadc === void 0 ? 750 : _ref46$mutationBreadc,\n _ref46$mutationLimit = _ref46.mutationLimit,\n mutationLimit = _ref46$mutationLimit === void 0 ? 10000 : _ref46$mutationLimit,\n _ref46$slowClickTimeo = _ref46.slowClickTimeout,\n slowClickTimeout = _ref46$slowClickTimeo === void 0 ? 7000 : _ref46$slowClickTimeo,\n _ref46$slowClickIgnor = _ref46.slowClickIgnoreSelectors,\n slowClickIgnoreSelectors = _ref46$slowClickIgnor === void 0 ? [] : _ref46$slowClickIgnor,\n _ref46$networkDetailA = _ref46.networkDetailAllowUrls,\n networkDetailAllowUrls = _ref46$networkDetailA === void 0 ? [] : _ref46$networkDetailA,\n _ref46$networkDetailD = _ref46.networkDetailDenyUrls,\n networkDetailDenyUrls = _ref46$networkDetailD === void 0 ? [] : _ref46$networkDetailD,\n _ref46$networkCapture = _ref46.networkCaptureBodies,\n networkCaptureBodies = _ref46$networkCapture === void 0 ? true : _ref46$networkCapture,\n _ref46$networkRequest = _ref46.networkRequestHeaders,\n networkRequestHeaders = _ref46$networkRequest === void 0 ? [] : _ref46$networkRequest,\n _ref46$networkRespons = _ref46.networkResponseHeaders,\n networkResponseHeaders = _ref46$networkRespons === void 0 ? [] : _ref46$networkRespons,\n _ref46$mask = _ref46.mask,\n mask = _ref46$mask === void 0 ? [] : _ref46$mask,\n _ref46$maskAttributes = _ref46.maskAttributes,\n maskAttributes = _ref46$maskAttributes === void 0 ? ['title', 'placeholder'] : _ref46$maskAttributes,\n _ref46$unmask = _ref46.unmask,\n unmask = _ref46$unmask === void 0 ? [] : _ref46$unmask,\n _ref46$block = _ref46.block,\n block = _ref46$block === void 0 ? [] : _ref46$block,\n _ref46$unblock = _ref46.unblock,\n unblock = _ref46$unblock === void 0 ? [] : _ref46$unblock,\n _ref46$ignore = _ref46.ignore,\n ignore = _ref46$ignore === void 0 ? [] : _ref46$ignore,\n maskFn = _ref46.maskFn,\n beforeAddRecordingEvent = _ref46.beforeAddRecordingEvent,\n blockClass = _ref46.blockClass,\n blockSelector = _ref46.blockSelector,\n maskInputOptions = _ref46.maskInputOptions,\n maskTextClass = _ref46.maskTextClass,\n maskTextSelector = _ref46.maskTextSelector,\n ignoreClass = _ref46.ignoreClass;\n\n _classCallCheck(this, Replay);\n\n this.name = Replay.id;\n var privacyOptions = getPrivacyOptions({\n mask: mask,\n unmask: unmask,\n block: block,\n unblock: unblock,\n ignore: ignore,\n blockClass: blockClass,\n blockSelector: blockSelector,\n maskTextClass: maskTextClass,\n maskTextSelector: maskTextSelector,\n ignoreClass: ignoreClass\n });\n this._recordingOptions = _objectSpread(_objectSpread({\n maskAllInputs: maskAllInputs,\n maskAllText: maskAllText,\n maskInputOptions: _objectSpread(_objectSpread({}, maskInputOptions || {}), {}, {\n password: true\n }),\n maskTextFn: maskFn,\n maskInputFn: maskFn,\n maskAttributeFn: function maskAttributeFn(key, value, el) {\n return maskAttribute({\n maskAttributes: maskAttributes,\n maskAllText: maskAllText,\n privacyOptions: privacyOptions,\n key: key,\n value: value,\n el: el\n });\n }\n }, privacyOptions), {}, {\n // Our defaults\n slimDOMOptions: 'all',\n inlineStylesheet: true,\n // Disable inline images as it will increase segment/replay size\n inlineImages: false,\n // collect fonts, but be aware that `sentry.io` needs to be an allowed\n // origin for playback\n collectFonts: true,\n errorHandler: function errorHandler(err) {\n try {\n err.__rrweb__ = true;\n } catch (error) {// ignore errors here\n // this can happen if the error is frozen or does not allow mutation for other reasons\n }\n }\n });\n this._initialOptions = {\n flushMinDelay: flushMinDelay,\n flushMaxDelay: flushMaxDelay,\n minReplayDuration: Math.min(minReplayDuration, MIN_REPLAY_DURATION_LIMIT),\n maxReplayDuration: Math.min(maxReplayDuration, MAX_REPLAY_DURATION),\n stickySession: stickySession,\n sessionSampleRate: sessionSampleRate,\n errorSampleRate: errorSampleRate,\n useCompression: useCompression,\n workerUrl: workerUrl,\n blockAllMedia: blockAllMedia,\n maskAllInputs: maskAllInputs,\n maskAllText: maskAllText,\n mutationBreadcrumbLimit: mutationBreadcrumbLimit,\n mutationLimit: mutationLimit,\n slowClickTimeout: slowClickTimeout,\n slowClickIgnoreSelectors: slowClickIgnoreSelectors,\n networkDetailAllowUrls: networkDetailAllowUrls,\n networkDetailDenyUrls: networkDetailDenyUrls,\n networkCaptureBodies: networkCaptureBodies,\n networkRequestHeaders: _getMergedNetworkHeaders(networkRequestHeaders),\n networkResponseHeaders: _getMergedNetworkHeaders(networkResponseHeaders),\n beforeAddRecordingEvent: beforeAddRecordingEvent,\n _experiments: _experiments\n };\n\n if (typeof sessionSampleRate === 'number') {\n // eslint-disable-next-line\n console.warn(\"[Replay] You are passing `sessionSampleRate` to the Replay integration.\\nThis option is deprecated and will be removed soon.\\nInstead, configure `replaysSessionSampleRate` directly in the SDK init options, e.g.:\\nSentry.init({ replaysSessionSampleRate: \".concat(sessionSampleRate, \" })\"));\n this._initialOptions.sessionSampleRate = sessionSampleRate;\n }\n\n if (typeof errorSampleRate === 'number') {\n // eslint-disable-next-line\n console.warn(\"[Replay] You are passing `errorSampleRate` to the Replay integration.\\nThis option is deprecated and will be removed soon.\\nInstead, configure `replaysOnErrorSampleRate` directly in the SDK init options, e.g.:\\nSentry.init({ replaysOnErrorSampleRate: \".concat(errorSampleRate, \" })\"));\n this._initialOptions.errorSampleRate = errorSampleRate;\n }\n\n if (this._initialOptions.blockAllMedia) {\n // `blockAllMedia` is a more user friendly option to configure blocking\n // embedded media elements\n this._recordingOptions.blockSelector = !this._recordingOptions.blockSelector ? MEDIA_SELECTORS : \"\".concat(this._recordingOptions.blockSelector, \",\").concat(MEDIA_SELECTORS);\n }\n\n if (this._isInitialized && isBrowser()) {\n throw new Error('Multiple Sentry Session Replay instances are not supported');\n }\n\n this._isInitialized = true;\n }\n /** If replay has already been initialized */\n\n\n _createClass(Replay, [{\n key: \"_isInitialized\",\n get: function get() {\n return _initialized;\n }\n /** Update _isInitialized */\n ,\n set: function set(value) {\n _initialized = value;\n }\n /**\n * Setup and initialize replay container\n */\n\n }, {\n key: \"setupOnce\",\n value: function setupOnce() {\n var _this34 = this;\n\n if (!isBrowser()) {\n return;\n }\n\n this._setup(); // Once upon a time, we tried to create a transaction in `setupOnce` and it would\n // potentially create a transaction before some native SDK integrations have run\n // and applied their own global event processor. An example is:\n // https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts\n //\n // So we call `this._initialize()` in next event loop as a workaround to wait for other\n // global event processors to finish. This is no longer needed, but keeping it\n // here to avoid any future issues.\n\n\n setTimeout(function () {\n return _this34._initialize();\n });\n }\n /**\n * Start a replay regardless of sampling rate. Calling this will always\n * create a new session. Will throw an error if replay is already in progress.\n *\n * Creates or loads a session, attaches listeners to varying events (DOM,\n * PerformanceObserver, Recording, Sentry SDK, etc)\n */\n\n }, {\n key: \"start\",\n value: function start() {\n if (!this._replay) {\n return;\n }\n\n this._replay.start();\n }\n /**\n * Start replay buffering. Buffers until `flush()` is called or, if\n * `replaysOnErrorSampleRate` > 0, until an error occurs.\n */\n\n }, {\n key: \"startBuffering\",\n value: function startBuffering() {\n if (!this._replay) {\n return;\n }\n\n this._replay.startBuffering();\n }\n /**\n * Currently, this needs to be manually called (e.g. for tests). Sentry SDK\n * does not support a teardown\n */\n\n }, {\n key: \"stop\",\n value: function stop() {\n if (!this._replay) {\n return Promise.resolve();\n }\n\n return this._replay.stop({\n forceFlush: this._replay.recordingMode === 'session'\n });\n }\n /**\n * If not in \"session\" recording mode, flush event buffer which will create a new replay.\n * Unless `continueRecording` is false, the replay will continue to record and\n * behave as a \"session\"-based replay.\n *\n * Otherwise, queue up a flush.\n */\n\n }, {\n key: \"flush\",\n value: function flush(options) {\n if (!this._replay || !this._replay.isEnabled()) {\n return Promise.resolve();\n }\n\n return this._replay.sendBufferedReplayOrFlush(options);\n }\n /**\n * Get the current session ID.\n */\n\n }, {\n key: \"getReplayId\",\n value: function getReplayId() {\n if (!this._replay || !this._replay.isEnabled()) {\n return;\n }\n\n return this._replay.getSessionId();\n }\n /**\n * Initializes replay.\n */\n\n }, {\n key: \"_initialize\",\n value: function _initialize() {\n if (!this._replay) {\n return;\n }\n\n this._replay.initializeSampling();\n }\n /** Setup the integration. */\n\n }, {\n key: \"_setup\",\n value: function _setup() {\n // Client is not available in constructor, so we need to wait until setupOnce\n var finalOptions = loadReplayOptionsFromClient(this._initialOptions);\n this._replay = new ReplayContainer({\n options: finalOptions,\n recordingOptions: this._recordingOptions\n });\n }\n }], [{\n key: \"__initStatic\",\n value:\n /**\n * @inheritDoc\n */\n function __initStatic() {\n this.id = 'Replay';\n }\n }]);\n\n return Replay;\n}();\n\nReplay.__initStatic();\n/** Parse Replay-related options from SDK options */\n\n\nfunction loadReplayOptionsFromClient(initialOptions) {\n var client = getCurrentHub().getClient();\n var opt = client && client.getOptions();\n\n var finalOptions = _objectSpread({\n sessionSampleRate: 0,\n errorSampleRate: 0\n }, dropUndefinedKeys(initialOptions));\n\n if (!opt) {\n // eslint-disable-next-line no-console\n console.warn('SDK client is not available.');\n return finalOptions;\n }\n\n if (initialOptions.sessionSampleRate == null && // TODO remove once deprecated rates are removed\n initialOptions.errorSampleRate == null && // TODO remove once deprecated rates are removed\n opt.replaysSessionSampleRate == null && opt.replaysOnErrorSampleRate == null) {\n // eslint-disable-next-line no-console\n console.warn('Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.');\n }\n\n if (typeof opt.replaysSessionSampleRate === 'number') {\n finalOptions.sessionSampleRate = opt.replaysSessionSampleRate;\n }\n\n if (typeof opt.replaysOnErrorSampleRate === 'number') {\n finalOptions.errorSampleRate = opt.replaysOnErrorSampleRate;\n }\n\n return finalOptions;\n}\n\nfunction _getMergedNetworkHeaders(headers) {\n return [].concat(DEFAULT_NETWORK_HEADERS, _toConsumableArray(headers.map(function (header) {\n return header.toLowerCase();\n })));\n}\n\nexport { Replay };"],"names":["NodeType$1","WINDOW","REPLAY_SESSION_KEY","REPLAY_EVENT_NAME","UNABLE_TO_SEND_REPLAY","RETRY_BASE_INTERVAL","RETRY_MAX_COUNT","NETWORK_BODY_MAX_SIZE","CONSOLE_ARG_MAX_SIZE","REPLAY_MAX_EVENT_BUFFER_SIZE","MAX_REPLAY_DURATION","isShadowRoot","n","host","Boolean","shadowRoot","isNativeShadowDom","Object","prototype","toString","call","stringifyStylesheet","s","rules","cssRules","cssText","Array","from","stringifyRule","join","includes","replace","error","rule","importStringified","isCSSImportRule","styleSheet","split","length","statement","concat","JSON","stringify","href","layerName","push","supportsText","media","mediaText","escapeImportStatement","isCSSStyleRule","selectorText","cssStringified","regex","fixSafariColons","NodeType","Mirror","this","idNodeMap","Map","nodeMetaMap","WeakMap","key","value","_a","id","getMeta","get","keys","_this","getId","delete","childNodes","forEach","childNode","removeNodeFromMap","has","node","meta","set","oldNode","getNode","shouldMaskInput","_ref","maskInputOptions","tagName","type","toLowerCase","maskInputValue","_ref2","isMasked","element","maskInputFn","text","repeat","str","toUpperCase","ORIGINAL_ATTRIBUTE_NAME","getInputType","hasAttribute","getInputValue","el","getAttribute","canvasService","canvasCtx","_id","tagNameRegex","RegExp","IGNORED_NODE","genId","URL_IN_CSS_REF","URL_PROTOCOL_MATCH","URL_WWW_MATCH","DATA_URI","absoluteToStylesheet","origin","quote1","path1","quote2","path2","path3","url","filePath","maybeQuote","test","indexOf","slice","stack","parts","pop","_step","_iterator","done","part","err","e","f","SRCSET_NOT_SPACES","SRCSET_COMMAS_OR_SPACES","absoluteToDoc","doc","attributeValue","trim","a","createElement","isSVGElement","ownerSVGElement","getHref","document","transformAttribute","name","maskAttributeFn","pos","collectCharacters","regEx","chars","match","exec","substring","output","descriptorsStr","inParens","c","charAt","getAbsoluteSrcsetString","ignoreAttribute","_value","distanceToMatch","matchPredicate","limit","arguments","undefined","Infinity","distance","nodeType","ELEMENT_NODE","parentNode","createMatchPredicate","className","selector","matches","eIndex","classList","elementClassMatchesRegex","needMaskingText","maskTextClass","maskTextSelector","unmaskTextClass","unmaskTextSelector","maskAllText","parentElement","maskDistance","unmaskDistance","serializeNode","options","mirror","blockClass","blockSelector","unblockSelector","inlineStylesheet","_options$maskInputOpt","maskTextFn","_options$dataURLOptio","dataURLOptions","inlineImages","recordCanvas","keepIframeSrcFn","_options$newlyAddedEl","newlyAddedElement","rootId","hasNode","docId","getRootId","DOCUMENT_NODE","compatMode","Document","DOCUMENT_TYPE_NODE","DocumentType","publicId","systemId","isCustomElement","_options$maskInputOpt2","_options$dataURLOptio2","_options$newlyAddedEl2","needBlock","contains","_isBlockedElement","HTMLFormElement","processedTagName","getValidTagName","attributes","len","_i","attr","stylesheet","styleSheets","find","rel","_cssText","sheet","innerText","textContent","checked","forceMask","selected","__context","canvas","ctx","getContext","x","width","y","height","getImageData","originalGetImageData","Uint32Array","Math","min","data","buffer","some","pixel","is2DCanvasBlank","rr_dataURL","toDataURL","quality","canvasDataURL","blankCanvas","image","oldValue","crossOrigin","recordInlineImage","removeEventListener","naturalWidth","naturalHeight","drawImage","console","warn","currentSrc","removeAttribute","complete","addEventListener","rr_mediaState","paused","rr_mediaCurrentTime","currentTime","scrollLeft","rr_scrollLeft","scrollTop","rr_scrollTop","_n$getBoundingClientR","getBoundingClientRect","class","rr_width","rr_height","src","contentDocument","rr_src","customElements","Element","isSVG","isCustom","serializeElementNode","TEXT_NODE","parentTagName","isStyle","isScript","isTextarea","nextSibling","previousSibling","textarea","Text","serializeTextNode","CDATA_SECTION_NODE","CDATA","COMMENT_NODE","Comment","lowerIfExists","maybeAttr","serializeNodeWithId","_options$skipChild","skipChild","_options$inlineStyles","_options$maskInputOpt3","slimDOMOptions","_options$dataURLOptio3","_options$inlineImages","_options$recordCanvas","onSerialize","onIframeLoad","_options$iframeLoadTi","iframeLoadTimeout","onStylesheetLoad","_options$stylesheetLo","stylesheetLoadTimeout","_options$keepIframeSr","_options$newlyAddedEl3","_options$preserveWhit","preserveWhiteSpace","_serializedNode","sn","comment","script","as","endsWith","headFavicon","headMetaDescKeywords","headMetaSocial","property","headMetaRobots","headMetaHttpEquiv","headMetaAuthorship","headMetaVerification","slimDOMExcluded","serializedNode","assign","add","recordChild","isShadowHost","headWhitespace","bypassOptions","_i2","_Array$from","serializedChildNode","isElement$1","_i3","_Array$from2","_serializedChildNode","isShadow","iframeEl","listener","win","contentWindow","readyState","fired","blankUrl","location","setTimeout","timer","clearTimeout","onceIframeLoaded","iframeDoc","serializedIframeNode","link","styleSheetLoadTimeout","styleSheetLoaded","onceStylesheetLoaded","serializedLinkNode","on","fn","target","capture","passive","DEPARTED_MIRROR_ACCESS_WARNING","_mirror","map","reset","throttle$1","func","wait","timeout","previous","_len","args","_key","now","Date","leading","remaining","context","apply","trailing","hookSetter","d","isRevoked","window","original","getOwnPropertyDescriptor","defineProperty","_this2","patch","source","replacement","wrapped","defineProperties","__rrweb_original__","enumerable","Proxy","Reflect","prop","receiver","nowTimestamp","getWindowScroll","_b","_c","_d","_e","_f","left","scrollingElement","pageXOffset","documentElement","body","top","pageYOffset","getWindowHeight","innerHeight","clientHeight","getWindowWidth","innerWidth","clientWidth","isBlocked","checkAncestors","blockedPredicate","isUnblocked","blockDistance","unblockDistance","isIgnored","isAncestorRemoved","legacy_isTouchEvent","event","changedTouches","isSerializedIframe","nodeName","isSerializedStylesheet","hasShadowRoot","getTime","StyleSheetMirror","styleIDMap","idStyleMap","newId","getShadowHost","shadowHost","getRootNode","Node","DOCUMENT_FRAGMENT_NODE","shadowHostInDom","ownerDocument","rootShadowHost","getRootShadowHost","inDom","EventType","EventType2","IncrementalSource","IncrementalSource2","MouseInteractions","MouseInteractions2","PointerTypes","PointerTypes2","CanvasContext","CanvasContext2","isNodeInLinkedList","errorHandler","DoubleLinkedList","head","tail","position","Error","current","index","next","__ln","_current","moveKey","parentId","MutationBuffer","_this4","frozen","locked","texts","removes","mapRemoves","movedMap","addedSet","Set","movedSet","droppedSet","processMutations","mutations","processMutation","emit","adds","addedIds","addList","getNextId","ns","nextId","pushAdd","addNode","currentN","iframeManager","addIframe","stylesheetManager","trackLinkElement","shadowDomManager","addShadowRoot","iframe","childSn","attachIframe","observeAttachShadow","attachLinkElement","shift","_step2","_iterator2","isParentRemoved","_step3","_iterator3","_n","isAncestorInSet","candidate","tailNode","_node","_parentId","unhandledNode","removeNode","payload","filter","attribute","style","diffAsStr","styleDiff","unchangedAsStr","_unchangedStyles","mutationCb","m","unattachedDoc","implementation","createHTMLDocument","attributeName","_value2","isInputMasked","item","setAttribute","old","_i4","_Array$from3","pname","newValue","getPropertyValue","newPriority","getPropertyPriority","_i5","_Array$from4","_pname","addedNodes","genAdds","removedNodes","nodeId","isSerialized","deepDelete","processedNodeManager","inOtherBuffer","targetId","childN","_this5","canvasManager","freeze","unfreeze","lock","unlock","addsSet","_isParentRemoved","r","size","_isAncestorInSet","registerErrorHandler","handler","unregisterErrorHandler","callbackWrapper","cb","mutationBuffers","getEventTarget","path","composedPath","initMutationObserver","rootEl","mutationBuffer","init","mutationObserverCtor","MutationObserver","__rrMutationObserver","angularZoneSymbol","Zone","__symbol__","observer","onMutation","bind","observe","attributeOldValue","characterData","characterDataOldValue","childList","subtree","initMouseInteractionObserver","_ref6","mouseInteractionCb","sampling","mouseInteraction","disableMap","handlers","currentPointerType","Number","isNaN","eventKey","eventName","pointerType","thisEventKey","Mouse","Touch","Pen","MouseDown","MouseUp","startsWith","Click","clientX","clientY","getHandler","PointerEvent","TouchStart","TouchEnd","h","initScrollObserver","_ref7","scrollCb","evt","defaultView","scrollLeftTop","scroll","wrapEventWithUserTriggeredFlag","v","enable","userTriggered","INPUT_TAGS","lastInputValueMap","getNestedCSSRulePositions","childRule","hasNestedCSSRule","parentRule","CSSGroupingRule","CSSMediaRule","CSSSupportsRule","CSSConditionRule","unshift","parentStyleSheet","_index","recurse","getIdAndStyleId","styleMirror","styleId","ownerNode","initAdoptedStyleSheetObserver","_ref17","hostId","patchTarget","ShadowRoot","originalPropertyDescriptor","configurable","sheets","result","adoptStyleSheets","initObservers","o","hooks","currentWindow","mousemoveCb","viewportResizeCb","inputCb","mediaInteractionCb","styleSheetRuleCb","styleDeclarationCb","canvasMutationCb","fontCb","selectionCb","customElementCb","mutation","mousemove","viewportResize","input","mediaInteaction","styleSheetRule","styleDeclaration","canvasMutation","font","selection","customElement","mergeHooks","_step4","mutationObserver","mousemoveHandler","_ref4","timeBaseline","threshold","callbackThreshold","mousemoveCallback","positions","wrappedCb","totalOffset","p","timeOffset","updatePosition","_ref5","DragEvent","Drag","MouseEvent","MouseMove","TouchMove","initMoveObserver","mouseInteractionHandler","scrollHandler","viewportResizeHandler","_ref8","_ref9","lastH","lastW","initViewportResizeObserver","inputHandler","_ref10","ignoreClass","ignoreSelector","userTriggeredOnInput","eventHandler","isTrusted","isChecked","cbWithDedup","querySelectorAll","_text","lastInputValue","propertyDescriptor","HTMLInputElement","hookProperties","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","initInputObserver","mediaInteractionHandler","_ref20","volume","muted","playbackRate","initMediaInteractionObserver","styleSheetObserver","_ref11","_ref12","CSSStyleSheet","insertRule","thisArg","argumentsList","_argumentsList","_getIdAndStyleId","replaceSync","deleteRule","_getIdAndStyleId2","_getIdAndStyleId3","_getIdAndStyleId4","supportedNestedCSSRuleTypes","canMonkeyPatchNestedCSSRule","unmodifiedFunctions","entries","_ref13","_ref14","typeKey","_argumentsList5","_getIdAndStyleId5","_getIdAndStyleId6","_ref15","_ref16","initStyleSheetObserver","adoptedStyleSheetObserver","styleDeclarationObserver","_ref18","_ref19","ignoreCSSAttributes","setProperty","CSSStyleDeclaration","_argumentsList7","priority","_getIdAndStyleId7","removeProperty","_getIdAndStyleId8","remove","initStyleDeclarationObserver","fontObserver","collectFonts","_ref21","fontMap","originalFontFace","FontFace","family","descriptors","fontFace","fontSource","Uint8Array","restoreHandler","fonts","initFontObserver","selectionObserver","param","collapsed","updateSelection","getSelection","isCollapsed","ranges","count","rangeCount","_i6","range","getRangeAt","startContainer","startOffset","endContainer","endOffset","start","end","initSelectionObserver","customElementObserver","_ref22","constructor","define","initCustomElementObserver","pluginHandlers","_iterator4","plugins","plugin","callback","b","disconnect","CrossOriginIframeMirror","generateIdFn","iframeIdToRemoteIdMap","iframeRemoteIdToIdMap","remoteId","idToRemoteMap","remoteToIdMap","idToRemoteIdMap","getIdToRemoteIdMap","remoteIdToIdMap","getRemoteIdToIdMap","_this6","ids","_this7","getRemoteId","IframeManagerNoop","crossOriginIframeMirror","crossOriginIframeRootIdMap","IframeManager","iframes","crossOriginIframeMap","wrappedEmit","recordCrossOriginIframes","crossOriginIframeStyleMirror","generateId","handleMessage","loadListener","isAttachIframe","adoptedStyleSheets","message","crossOriginMessageEvent","transformedEvent","transformCrossOriginEvent","isCheckout","_this8","FullSnapshot","replaceIdOnNode","patchRootIdOnNode","timestamp","IncrementalSnapshot","Mutation","Meta","Load","DomContentLoaded","Plugin","Custom","replaceIds","ViewportResize","MediaInteraction","MouseInteraction","Scroll","CanvasMutation","Input","StyleSheetRule","StyleDeclaration","replaceStyleIds","Font","Selection","AdoptedStyleSheet","styles","iframeMirror","obj","_step5","_iterator5","isArray","getIds","_this9","child","_this10","ShadowDomManagerNoop","ShadowDomManager","shadowDoms","WeakSet","restoreHandlers","patchAttachShadow","_this11","iframeElement","manager","option","__awaiter","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","rejected","then","lookup","i","charCodeAt","canvasVarMap","saveWebGLVar","isInstanceOfWebGLObject","list","ctor","contextMap","variableListFor","serializeArg","arg","Float32Array","Float64Array","Int32Array","Uint16Array","Int16Array","Int8Array","Uint8ClampedArray","rr_type","values","ArrayBuffer","_name","base64","arraybuffer","bytes","encode","DataView","byteOffset","byteLength","HTMLImageElement","HTMLCanvasElement","ImageData","serializeArgs","supportedWebGLConstructorNames","initCanvasContextObserver","setPreserveDrawingBufferToTrue","contextType","_len4","_key4","ctxName","getNormalizedContextName","contextAttributes","preserveDrawingBuffer","splice","patchGLPrototype","_step7","props","getOwnPropertyNames","_iterator7","_loop2","_len5","_key5","recordArgs","hookHandler","setter","createURL","sourcemapArg","enableUnicodeArg","sourcemap","enableUnicode","binaryString","atob","binaryView","String","fromCharCode","decodeBase64","blob","Blob","URL","createObjectURL","takeFullSnapshot","WorkerFactory","Worker","createBase64WorkerFactory","CanvasManagerNoop","CanvasManager","_this13","pendingCanvasMutations","rafStamps","latestId","invokeId","_options$sampling","initCanvasMutationObserver","initCanvasFPSObserver","clear","resetObservers","fps","_this14","canvasContextReset","snapshotInProgressMap","worker","onmessage","_e$data","commands","rafId","timeBetweenSnapshots","lastSnapshotTime","requestAnimationFrame","takeCanvasSnapshots","matchedCanvas","getCanvas","_callee","bitmap","_context2","prev","abrupt","getContextAttributes","COLOR_BUFFER_BIT","createImageBitmap","sent","postMessage","stop","cancelAnimationFrame","startRAFTimestamping","startPendingCanvasMutationFlusher","canvas2DReset","_step6","props2D","CanvasRenderingContext2D","_iterator6","_loop","_this12","_len3","_key3","initCanvas2DMutationObserver","canvasWebGL1and2Reset","WebGLRenderingContext","WebGL","WebGL2RenderingContext","WebGL2","initCanvasWebGLMutationObserver","_this15","flushPendingCanvasMutations","_this16","setLatestRAFTimestamp","_this17","flushPendingCanvasMutationFor","valuesWithType","rest","t","hasOwnProperty","getOwnPropertySymbols","propertyIsEnumerable","__rest","StylesheetManager","trackedLinkElements","adoptedStyleSheetCb","linkEl","trackStylesheetInLinkElement","_step8","adoptedStyleSheetData","styleIds","_iterator8","CSSRule","ProcessedNodeManager","nodeMap","loop","periodicallyClear","_this18","thisBuffer","buffers","wrapEvent","recording","record","checkoutEveryNms","checkoutEveryNth","_options$blockClass","_options$blockSelecto","_options$unblockSelec","_options$ignoreClass","_options$ignoreSelect","_options$maskAllText","_options$maskTextClas","_options$unmaskTextCl","_options$maskTextSele","_options$unmaskTextSe","_options$inlineStyles2","maskAllInputs","_maskInputOptions","_slimDOMOptions","packFn","_options$sampling2","_options$dataURLOptio4","mousemoveWait","_options$recordCanvas2","_options$recordCrossO","_options$recordAfter","recordAfter","_options$userTriggere","_options$collectFonts","_options$inlineImages2","_options$keepIframeSr2","_options$ignoreCSSAtt","inEmittingFrame","parent","passEmitsToParent","lastFullSnapshotEvent","color","date","email","month","number","search","tel","time","week","select","radio","checkbox","_this3","NodeList","DOMTokenList","_len2","_key2","TypeError","polyfill","incrementalSnapshotCount","eventProcessor","_step9","_iterator9","isFrozen","buf","exceedCount","exceedTime","_step10","wrappedMutationEmit","wrappedScrollEmit","wrappedCanvasMutationEmit","__RRWEB_EXCLUDE_IFRAME__","_iterator10","getMirror","nodeMirror","__RRWEB_EXCLUDE_CANVAS__","__RRWEB_EXCLUDE_SHADOW_DOM__","_ref3","_ref3$mirror","_ref3$blockClass","_ref3$blockSelector","_ref3$unblockSelector","_ref3$maskAllText","_ref3$maskTextClass","_ref3$unmaskTextClass","_ref3$maskTextSelecto","_ref3$unmaskTextSelec","_ref3$inlineStyleshee","_ref3$inlineImages","_ref3$recordCanvas","_ref3$maskAllInputs","_ref3$slimDOM","slimDOM","_ref3$keepIframeSrcFn","snapshot","initialOffset","_handlers","CustomElement","addLoadListener","destroy","timestampToMs","addBreadcrumbEvent","replay","breadcrumb","category","triggerUserActivity","checkAndHandleExpiredSession","addUpdate","throttledAddEvent","tag","addCustomEvent","freezePage","INTERACTIVE_SELECTOR","getClickTargetNode","getTargetNode","closest","isEventWithTarget","onWindowOpen","originalWindowOpen","_len6","_key6","ClickDetector","slowClickConfig","_addBreadcrumbEvent","_lastMutation","_lastScroll","_clicks","_timeout","_threshold","_scollTimeout","scrollTimeout","_replay","_ignoreSelector","_this19","nowInSeconds","cleanupWindowOpen","clickHandler","_handleMultiClick","obs","_teardown","_checkClickTimeout","SLOW_CLICK_TAGS","ignoreElement","isClickBreadcrumb","newClick","clickBreadcrumb","clickCount","click","abs","_scheduleCheckClicks","_getClicks","_this20","timedOutClicks","mutationAfter","scrollAfter","_i7","_timedOutClicks","_generateBreadcrumbs","hadScroll","hadMutation","isSlowClick","timeAfterClickMs","endReason","route","getCurrentRoute","_breadcrumb","metric","_this21","_checkClicks","createBreadcrumb","ATTRIBUTES_TO_RECORD","getAttributesToRecord","normalizedKey","handleDomListener","handlerData","isEnabled","_getDomTarget","isClick","maxStringLength","getDomTarget","getBaseDomBreadcrumb","handleDom","clickDetector","altKey","metaKey","ctrlKey","shiftKey","handleClick","isElement","handleKeyboardEvent","updateUserActivity","isContentEditable","isInputElement","hasModifierKey","isCharacterKey","baseBreadcrumb","getKeyboardBreadcrumb","ENTRY_TYPES","resource","entry","entryType","initiatorType","responseEnd","startTime","decodedBodySize","encodedBodySize","responseStatus","transferSize","getAbsoluteTime","statusCode","paint","duration","navigation","domComplete","domContentLoadedEventStart","domContentLoadedEventEnd","domInteractive","loadEventStart","loadEventEnd","redirectCount","createPerformanceEntry","performance","timeOrigin","setupPerformanceObserver","addPerformanceEntry","performanceEntries","onEntries","_ref23","clearCallbacks","_ref24","replayPerformanceEntries","lastEntry","getLargestContentfulPaint","clearCallback","logInfo","shouldAddBreadcrumb","__SENTRY_DEBUG__","info","addBreadcrumb","logInfoNextTick","logger","level","EventBufferSizeExceededError","_Error","_super","EventBufferArray","events","_totalSize","hasCheckout","_addEvent2","_callee2","eventSize","_context3","_x","_this22","eventsRet","sort","WorkerHandler","_worker","_this23","_ensureReadyPromise","_ref25","success","once","terminate","method","_this24","_getAndIncrementId","_ref26","response","EventBufferCompressionWorker","_earliestTimestamp","ensureReady","_sendEventToWorker","_finishRequest","_finishRequest2","_callee3","_context4","EventBufferProxy","_fallback","_compression","_used","_ensureWorkerIsLoadedPromise","_ensureWorkerIsLoaded","hasEvents","getEarliestTimestamp","addEvent","_finish","_callee4","_context5","ensureWorkerIsLoaded","finish","_ensureWorkerIsLoaded2","_callee5","_context6","t0","_switchToCompressionWorker","_switchToCompressionWorker2","_callee6","_this$_fallback","addEventPromises","_iterator11","_step11","_context7","all","createEventBuffer","_ref27","useCompression","customWorkerUrl","workerUrl","__SENTRY_EXCLUDE_REPLAY_WORKER__","_getWorkerUrl","_loadWorker","hasSessionStorage","sessionStorage","clearSession","removeItem","deleteSession","session","isSampled","sampleRate","random","saveSession","setItem","makeSession","started","lastActivity","segmentId","sampled","previousSessionId","createSession","_ref28","sessionSampleRate","allowBuffering","_ref28$stickySession","stickySession","getSessionSampleType","isExpired","initialTime","expiry","targetTime","isSessionExpired","_ref30","maxReplayDuration","sessionIdleExpire","_ref30$targetTime","shouldRefreshSession","_ref31","loadOrCreateSession","_ref32","sessionOptions","traceInternals","existingSession","sessionStringFromStorage","getItem","sessionObj","parse","fetchSession","addEventSync","shouldAddEvent","_addEvent","_x2","_x3","_x4","_addEvent3","_callee12","replayOptions","eventAfterPossibleCallback","reason","client","_context13","eventBuffer","recordingMode","getOptions","maybeApplyCallback","beforeAddRecordingEvent","getClient","recordDroppedEvent","isPaused","timestampInMs","timeouts","sessionIdlePause","initialTimestamp","_experiments","isCustomEvent","isErrorEvent","isTransactionEvent","handleAfterSendEvent","enforceStatusCode","transport","getTransport","send","__sentry__baseTransport__","isBaseTransportSend","sendResponse","replayContext","contexts","trace","trace_id","traceIds","handleTransactionEvent","event_id","errorIds","tags","replayId","sendBufferedReplayOrFlush","handleErrorEvent","handleGlobalEventListener","afterSendHandler","hint","isReplayEvent","breadcrumbs","exception","originalException","__rrweb__","isRrwebError","captureExceptions","log","isErrorEventSampled","errorSampleRate","shouldSampleForBufferEvent","getSessionId","createPerformanceSpans","_ref33","op","description","startTimestamp","endTimestamp","handleHistorySpanListener","to","handleHistory","urls","addNetworkBreadcrumb","shouldFilterRequest","handleXhrSpanListener","sentryXhrData","xhr","status_code","handleXhr","OBJ","OBJ_KEY","OBJ_KEY_STR","OBJ_VAL","OBJ_VAL_STR","OBJ_VAL_COMPLETED","ARR","ARR_VAL","ARR_VAL_STR","ARR_VAL_COMPLETED","ALLOWED_PRIMITIVES","completeJson","incompleteJson","json","lastPos","lastStep","startPos","lastIndexOf","_maybeFixIncompleteObjValue","_i9","char","_findLastArrayDelimiter","_maybeFixIncompleteArrValue","_fixLastStep","_i8","_evaluateJsonPos","curStep","_isEscaped","_handleObj","_handleArr","_handleColon","_handleComma","_handleObjClose","_handleArrClose","_handleQuote","fixJson","evaluateJson","getBodySize","textEncoder","URLSearchParams","FormData","formDataStr","_serializeFormData","parseContentLengthHeader","header","parseInt","getBodyString","makeNetworkReplayBreadcrumb","request","buildSkippedNetworkRequestOrResponse","bodySize","headers","_meta","warnings","buildNetworkRequestOrResponse","_normalizeNetworkBody","exceedsSizeLimit","first","last","_strIsProbablyJson","e3","normalizeNetworkBody","normalizedBody","getAllowedHeaders","allowedHeaders","reduce","filteredHeaders","formData","urlMatches","fullUrl","baseURI","fixedUrl","getFullUrl","_captureFetchBreadcrumbToReplay","_callee13","_context14","_prepareFetchData","_x8","_x9","_x10","_prepareFetchData2","_callee14","_breadcrumb$data2","_breadcrumb$data2$sta","requestBodySize","responseBodySize","captureDetails","_context15","request_body_size","response_body_size","networkDetailAllowUrls","networkDetailDenyUrls","_getRequestInfo","_getResponseInfo","_ref34","networkCaptureBodies","fetchArgs","getHeadersFromOptions","getRequestHeaders","networkRequestHeaders","_getFetchRequestArgBody","_x11","_x12","_x13","_x14","_getResponseInfo2","_callee15","_ref35","networkResponseHeaders","res","bodyText","_context16","getAllHeaders","clone","_parseFetchBody","_x15","_parseFetchBody2","_callee16","_context17","allHeaders","Headers","_captureXhrBreadcrumbToReplay","_callee17","_context18","_prepareXhrData","_breadcrumb$data","_breadcrumb$data$stat","xhrInfo","request_headers","getAllResponseHeaders","acc","line","_line$split","_line$split2","getResponseHeaders","responseText","handleNetworkBreadcrumbs","TextEncoder","_replay$getOptions","_isXhrBreadcrumb","_isXhrHint","reqSize","resSize","getResponseHeader","enrichXhrBreadcrumb","_x16","_x17","_x18","captureXhrBreadcrumbToReplay","_isFetchBreadcrumb","_isFetchHint","enrichFetchBreadcrumb","_x5","_x6","_x7","captureFetchBreadcrumbToReplay","beforeAddNetworkBreadcrumb","fetchData","status","handleFetch","handleFetchSpanListener","e2","_LAST_BREADCRUMB","handleScopeListener","scope","newBreadcrumb","getLastBreadcrumb","isBreadcrumbWithCategory","isTruncated","normalizedArgs","normalizedArg","stringified","fixedJson","normalizeConsoleBreadcrumb","handleScope","hasHooks","addMemoryEntry","_x19","_addMemoryEntry","_callee18","_context19","createMemoryEntry","memory","memoryEntry","jsHeapSizeLimit","totalJSHeapSize","usedJSHeapSize","getHandleRecordingEmit","hadFirstEvent","_isCheckout","setInitialState","useCompressionOption","blockAllMedia","networkDetailHasUrls","networkRequestHasHeaders","networkResponseHasHeaders","createOptionsEvent","addSettingsEvent","earliestEvent","flush","createReplayEnvelope","replayEvent","recordingData","dsn","tunnel","prepareRecordingData","_ref36","payloadWithSequence","replayHeaders","sequence","prepareReplayEvent","_x20","_prepareReplayEvent","_callee19","_ref37","integrations","eventHint","preparedEvent","metadata","_ref47","version","_context20","_integrations","platform","getSdkMetadata","sdk","sendReplayRequest","_x21","_sendReplayRequest","_callee20","_ref38","segment_id","eventContext","preparedRecordingData","hub","baseEvent","envelope","_context21","getScope","getDsn","replay_start_timestamp","error_ids","trace_ids","replay_id","replay_type","sdkProcessingMetadata","cause","TransportStatusCodeError","_Error2","_super2","sendReplay","_x22","_sendReplay","_callee22","replayData","retryConfig","_args22","_context23","interval","_retryCount","_callee21","_context22","THROTTLED","throttle","maxCount","durationSeconds","counter","isThrottled","floor","_cleanup","wasThrottled","ReplayContainer","_ref39","_this25","recordingOptions","__init","__init2","__init3","__init4","__init5","__init6","_lastActivity","_isEnabled","_isPaused","_hasInitializedCoreListeners","_context","initialUrl","_recordingOptions","_options","_debouncedFlush","callbackReturnValue","timerId","maxTimerId","maxWait","max","invokeFunc","cancelTimers","debounced","cancel","debounce","_flush","flushMinDelay","flushMaxDelay","_throttledAddEvent","_this$getOptions","slowClickTimeout","slowClickIgnoreSelectors","_this$_options","_initializeSessionForSampling","_initializeRecording","_handleException","_stopRecording","_onMutationHandler","_stop","_callee7","_ref40","_ref40$forceFlush","forceFlush","_args7","_context8","_removeListeners","stopRecording","force","_checkSession","startRecording","_sendBufferedReplayOrFlush","_callee8","_ref41$continueRecord","continueRecording","activityTime","hasStoppedRecording","_args8","_context9","flushImmediate","_updateUserActivity","_updateSessionActivity","_maybeSaveSession","cbResult","resume","pause","urlPath","pathname","hash","_clearContext","_this26","lastTransaction","getTransaction","_addListeners","currentSession","_refreshSession","_refreshSession2","_callee9","_context10","initializeSampling","_x23","_handleVisibilityChange","_handleWindowBlur","_handleWindowFocus","_handleKeyboardEvent","addListeners","addScopeListener","addEventProcessor","dsc","transaction","addGlobalListeners","_performanceCleanupCallback","removeListeners","_this27","visibilityState","_doChangeToForegroundTasks","_doChangeToBackgroundTasks","_this28","_this29","_this30","_createCustomBreadcrumb","conditionalFlush","_this31","_runFlush2","_callee10","_context11","_addPerformanceEntries","_updateInitialTimestampFromEventBuffer","_popEventContext","_this32","_callee11","_ref43$force","tooShort","tooLong","_args11","_context12","minReplayDuration","_flushLock","_runFlush","_this33","mutationLimit","overMutationLimit","mutationBreadcrumbLimit","getOption","selectors","defaultSelectors","deprecatedClassOption","deprecatedSelectorOption","deprecatedSelectors","allSelectors","MEDIA_SELECTORS","DEFAULT_NETWORK_HEADERS","_initialized","Replay","_ref46","_ref46$flushMinDelay","_ref46$flushMaxDelay","_ref46$minReplayDurat","_ref46$maxReplayDurat","_ref46$stickySession","_ref46$useCompression","_ref46$_experiments","_ref46$maskAllText","_ref46$maskAllInputs","_ref46$blockAllMedia","_ref46$mutationBreadc","_ref46$mutationLimit","_ref46$slowClickTimeo","_ref46$slowClickIgnor","_ref46$networkDetailA","_ref46$networkDetailD","_ref46$networkCapture","_ref46$networkRequest","_ref46$networkRespons","_ref46$mask","mask","_ref46$maskAttributes","maskAttributes","_ref46$unmask","unmask","_ref46$block","block","_ref46$unblock","unblock","_ref46$ignore","ignore","maskFn","privacyOptions","_ref44","getPrivacyOptions","password","_ref45","maskAttribute","_initialOptions","_getMergedNetworkHeaders","_isInitialized","_this34","_setup","_initialize","startBuffering","finalOptions","initialOptions","opt","replaysSessionSampleRate","replaysOnErrorSampleRate","loadReplayOptionsFromClient","__initStatic"],"sourceRoot":""}