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,GAAQL,EAAWK,GAC/BM,EAAaF,GAAWC,EAW5B,GATIN,GAAMJ,EAAWI,GAEnBI,EAAYD,EACHA,EAAQthB,SAEjBuhB,EAAUvY,MACVuY,EAAYA,EAAUrgB,OAAOogB,KAG1BC,EAAUvhB,OAAQ,MAAO,IAG9B,GAAIuhB,EAAUvhB,OAAQ,CACpB,IAAI2hB,EAAOJ,EAAUA,EAAUvhB,OAAS,GACxCqhB,EAA4B,MAATM,GAAyB,OAATA,GAA0B,KAATA,CACtD,MACEN,GAAmB,EAIrB,IADA,IAAIO,EAAK,EACAxX,EAAImX,EAAUvhB,OAAQoK,GAAK,EAAGA,IAAK,CAC1C,IAAI7D,EAAOgb,EAAUnX,GAER,MAAT7D,EACF2a,EAAUK,EAAWnX,GACH,OAAT7D,GACT2a,EAAUK,EAAWnX,GACrBwX,KACSA,IACTV,EAAUK,EAAWnX,GACrBwX,IAEJ,CAEA,IAAKF,EAAY,KAAOE,IAAMA,EAAIL,EAAUM,QAAQ,OAGlDH,GACiB,KAAjBH,EAAU,IACRA,EAAU,IAAOR,EAAWQ,EAAU,KAExCA,EAAUM,QAAQ,IAEpB,IAAIriB,EAAS+hB,EAAU3f,KAAK,KAI5B,OAFIyf,GAA0C,MAAtB7hB,EAAO0J,QAAQ,KAAY1J,GAAU,KAEtDA,CACT,sCCrEER,EAAOC,QAAU,EAAjBD","sources":["../node_modules/sanitize-html/index.js","../node_modules/resize-observer-polyfill/dist/ResizeObserver.global.js","../node_modules/scheduler/cjs/scheduler.production.min.js","../node_modules/reselect/src/utils.ts","../node_modules/reselect/src/autotrackMemoize/proxy.ts","../node_modules/reselect/src/weakMapMemoize.ts","../node_modules/reselect/src/createSelectorCreator.ts","../node_modules/reselect/src/createStructuredSelector.ts","../node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js","../node_modules/sanitize-html/node_modules/deepmerge/dist/cjs.js","../node_modules/resolve-pathname/esm/resolve-pathname.js","../node_modules/scheduler/index.js"],"sourcesContent":["const htmlparser = require('htmlparser2');\nconst escapeStringRegexp = require('escape-string-regexp');\nconst { isPlainObject } = require('is-plain-object');\nconst deepmerge = require('deepmerge');\nconst parseSrcset = require('parse-srcset');\nconst { parse: postcssParse } = require('postcss');\n// Tags that can conceivably represent stand-alone media.\nconst mediaTags = [\n 'img', 'audio', 'video', 'picture', 'svg',\n 'object', 'map', 'iframe', 'embed'\n];\n// Tags that are inherently vulnerable to being used in XSS attacks.\nconst vulnerableTags = [ 'script', 'style' ];\n\nfunction each(obj, cb) {\n if (obj) {\n Object.keys(obj).forEach(function (key) {\n cb(obj[key], key);\n });\n }\n}\n\n// Avoid false positives with .__proto__, .hasOwnProperty, etc.\nfunction has(obj, key) {\n return ({}).hasOwnProperty.call(obj, key);\n}\n\n// Returns those elements of `a` for which `cb(a)` returns truthy\nfunction filter(a, cb) {\n const n = [];\n each(a, function(v) {\n if (cb(v)) {\n n.push(v);\n }\n });\n return n;\n}\n\nfunction isEmptyObject(obj) {\n for (const key in obj) {\n if (has(obj, key)) {\n return false;\n }\n }\n return true;\n}\n\nfunction stringifySrcset(parsedSrcset) {\n return parsedSrcset.map(function(part) {\n if (!part.url) {\n throw new Error('URL missing');\n }\n\n return (\n part.url +\n (part.w ? ` ${part.w}w` : '') +\n (part.h ? ` ${part.h}h` : '') +\n (part.d ? ` ${part.d}x` : '')\n );\n }).join(', ');\n}\n\nmodule.exports = sanitizeHtml;\n\n// A valid attribute name.\n// We use a tolerant definition based on the set of strings defined by\n// html.spec.whatwg.org/multipage/parsing.html#before-attribute-name-state\n// and html.spec.whatwg.org/multipage/parsing.html#attribute-name-state .\n// The characters accepted are ones which can be appended to the attribute\n// name buffer without triggering a parse error:\n// * unexpected-equals-sign-before-attribute-name\n// * unexpected-null-character\n// * unexpected-character-in-attribute-name\n// We exclude the empty string because it's impossible to get to the after\n// attribute name state with an empty attribute name buffer.\nconst VALID_HTML_ATTRIBUTE_NAME = /^[^\\0\\t\\n\\f\\r /<=>]+$/;\n\n// Ignore the _recursing flag; it's there for recursive\n// invocation as a guard against this exploit:\n// https://github.com/fb55/htmlparser2/issues/105\n\nfunction sanitizeHtml(html, options, _recursing) {\n if (html == null) {\n return '';\n }\n if (typeof html === 'number') {\n html = html.toString();\n }\n\n let result = '';\n // Used for hot swapping the result variable with an empty string in order to \"capture\" the text written to it.\n let tempResult = '';\n\n function Frame(tag, attribs) {\n const that = this;\n this.tag = tag;\n this.attribs = attribs || {};\n this.tagPosition = result.length;\n this.text = ''; // Node inner text\n this.mediaChildren = [];\n\n this.updateParentNodeText = function() {\n if (stack.length) {\n const parentFrame = stack[stack.length - 1];\n parentFrame.text += that.text;\n }\n };\n\n this.updateParentNodeMediaChildren = function() {\n if (stack.length && mediaTags.includes(this.tag)) {\n const parentFrame = stack[stack.length - 1];\n parentFrame.mediaChildren.push(this.tag);\n }\n };\n }\n\n options = Object.assign({}, sanitizeHtml.defaults, options);\n options.parser = Object.assign({}, htmlParserDefaults, options.parser);\n\n const tagAllowed = function (name) {\n return options.allowedTags === false || (options.allowedTags || []).indexOf(name) > -1;\n };\n\n // vulnerableTags\n vulnerableTags.forEach(function (tag) {\n if (tagAllowed(tag) && !options.allowVulnerableTags) {\n console.warn(`\\n\\n⚠️ Your \\`allowedTags\\` option includes, \\`${tag}\\`, which is inherently\\nvulnerable to XSS attacks. Please remove it from \\`allowedTags\\`.\\nOr, to disable this warning, add the \\`allowVulnerableTags\\` option\\nand ensure you are accounting for this risk.\\n\\n`);\n }\n });\n\n // Tags that contain something other than HTML, or where discarding\n // the text when the tag is disallowed makes sense for other reasons.\n // If we are not allowing these tags, we should drop their content too.\n // For other tags you would drop the tag but keep its content.\n const nonTextTagsArray = options.nonTextTags || [\n 'script',\n 'style',\n 'textarea',\n 'option'\n ];\n let allowedAttributesMap;\n let allowedAttributesGlobMap;\n if (options.allowedAttributes) {\n allowedAttributesMap = {};\n allowedAttributesGlobMap = {};\n each(options.allowedAttributes, function(attributes, tag) {\n allowedAttributesMap[tag] = [];\n const globRegex = [];\n attributes.forEach(function(obj) {\n if (typeof obj === 'string' && obj.indexOf('*') >= 0) {\n globRegex.push(escapeStringRegexp(obj).replace(/\\\\\\*/g, '.*'));\n } else {\n allowedAttributesMap[tag].push(obj);\n }\n });\n if (globRegex.length) {\n allowedAttributesGlobMap[tag] = new RegExp('^(' + globRegex.join('|') + ')$');\n }\n });\n }\n const allowedClassesMap = {};\n const allowedClassesGlobMap = {};\n const allowedClassesRegexMap = {};\n each(options.allowedClasses, function(classes, tag) {\n // Implicitly allows the class attribute\n if (allowedAttributesMap) {\n if (!has(allowedAttributesMap, tag)) {\n allowedAttributesMap[tag] = [];\n }\n allowedAttributesMap[tag].push('class');\n }\n\n allowedClassesMap[tag] = classes;\n\n if (Array.isArray(classes)) {\n const globRegex = [];\n allowedClassesMap[tag] = [];\n allowedClassesRegexMap[tag] = [];\n classes.forEach(function(obj) {\n if (typeof obj === 'string' && obj.indexOf('*') >= 0) {\n globRegex.push(escapeStringRegexp(obj).replace(/\\\\\\*/g, '.*'));\n } else if (obj instanceof RegExp) {\n allowedClassesRegexMap[tag].push(obj);\n } else {\n allowedClassesMap[tag].push(obj);\n }\n });\n if (globRegex.length) {\n allowedClassesGlobMap[tag] = new RegExp('^(' + globRegex.join('|') + ')$');\n }\n }\n });\n\n const transformTagsMap = {};\n let transformTagsAll;\n each(options.transformTags, function(transform, tag) {\n let transFun;\n if (typeof transform === 'function') {\n transFun = transform;\n } else if (typeof transform === 'string') {\n transFun = sanitizeHtml.simpleTransform(transform);\n }\n if (tag === '*') {\n transformTagsAll = transFun;\n } else {\n transformTagsMap[tag] = transFun;\n }\n });\n\n let depth;\n let stack;\n let skipMap;\n let transformMap;\n let skipText;\n let skipTextDepth;\n let addedText = false;\n\n initializeState();\n\n const parser = new htmlparser.Parser({\n onopentag: function(name, attribs) {\n // If `enforceHtmlBoundary` is `true` and this has found the opening\n // `html` tag, reset the state.\n if (options.enforceHtmlBoundary && name === 'html') {\n initializeState();\n }\n\n if (skipText) {\n skipTextDepth++;\n return;\n }\n const frame = new Frame(name, attribs);\n stack.push(frame);\n\n let skip = false;\n const hasText = !!frame.text;\n let transformedTag;\n if (has(transformTagsMap, name)) {\n transformedTag = transformTagsMap[name](name, attribs);\n\n frame.attribs = attribs = transformedTag.attribs;\n\n if (transformedTag.text !== undefined) {\n frame.innerText = transformedTag.text;\n }\n\n if (name !== transformedTag.tagName) {\n frame.name = name = transformedTag.tagName;\n transformMap[depth] = transformedTag.tagName;\n }\n }\n if (transformTagsAll) {\n transformedTag = transformTagsAll(name, attribs);\n\n frame.attribs = attribs = transformedTag.attribs;\n if (name !== transformedTag.tagName) {\n frame.name = name = transformedTag.tagName;\n transformMap[depth] = transformedTag.tagName;\n }\n }\n\n if (!tagAllowed(name) || (options.disallowedTagsMode === 'recursiveEscape' && !isEmptyObject(skipMap)) || (options.nestingLimit != null && depth >= options.nestingLimit)) {\n skip = true;\n skipMap[depth] = true;\n if (options.disallowedTagsMode === 'discard') {\n if (nonTextTagsArray.indexOf(name) !== -1) {\n skipText = true;\n skipTextDepth = 1;\n }\n }\n skipMap[depth] = true;\n }\n depth++;\n if (skip) {\n if (options.disallowedTagsMode === 'discard') {\n // We want the contents but not this tag\n return;\n }\n tempResult = result;\n result = '';\n }\n result += '<' + name;\n\n if (name === 'script') {\n if (options.allowedScriptHostnames || options.allowedScriptDomains) {\n frame.innerText = '';\n }\n }\n\n if (!allowedAttributesMap || has(allowedAttributesMap, name) || allowedAttributesMap['*']) {\n each(attribs, function(value, a) {\n if (!VALID_HTML_ATTRIBUTE_NAME.test(a)) {\n // This prevents part of an attribute name in the output from being\n // interpreted as the end of an attribute, or end of a tag.\n delete frame.attribs[a];\n return;\n }\n // If the value is empty, check if the attribute is in the allowedEmptyAttributes array.\n // If it is not in the allowedEmptyAttributes array, and it is a known non-boolean attribute, delete it\n // List taken from https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n if (value === '' && (!options.allowedEmptyAttributes.includes(a)) &&\n (options.nonBooleanAttributes.includes(a) || options.nonBooleanAttributes.includes('*'))) {\n delete frame.attribs[a];\n return;\n }\n // check allowedAttributesMap for the element and attribute and modify the value\n // as necessary if there are specific values defined.\n let passedAllowedAttributesMapCheck = false;\n if (!allowedAttributesMap ||\n (has(allowedAttributesMap, name) && allowedAttributesMap[name].indexOf(a) !== -1) ||\n (allowedAttributesMap['*'] && allowedAttributesMap['*'].indexOf(a) !== -1) ||\n (has(allowedAttributesGlobMap, name) && allowedAttributesGlobMap[name].test(a)) ||\n (allowedAttributesGlobMap['*'] && allowedAttributesGlobMap['*'].test(a))) {\n passedAllowedAttributesMapCheck = true;\n } else if (allowedAttributesMap && allowedAttributesMap[name]) {\n for (const o of allowedAttributesMap[name]) {\n if (isPlainObject(o) && o.name && (o.name === a)) {\n passedAllowedAttributesMapCheck = true;\n let newValue = '';\n if (o.multiple === true) {\n // verify the values that are allowed\n const splitStrArray = value.split(' ');\n for (const s of splitStrArray) {\n if (o.values.indexOf(s) !== -1) {\n if (newValue === '') {\n newValue = s;\n } else {\n newValue += ' ' + s;\n }\n }\n }\n } else if (o.values.indexOf(value) >= 0) {\n // verified an allowed value matches the entire attribute value\n newValue = value;\n }\n value = newValue;\n }\n }\n }\n if (passedAllowedAttributesMapCheck) {\n if (options.allowedSchemesAppliedToAttributes.indexOf(a) !== -1) {\n if (naughtyHref(name, value)) {\n delete frame.attribs[a];\n return;\n }\n }\n\n if (name === 'script' && a === 'src') {\n\n let allowed = true;\n\n try {\n const parsed = parseUrl(value);\n\n if (options.allowedScriptHostnames || options.allowedScriptDomains) {\n const allowedHostname = (options.allowedScriptHostnames || []).find(function (hostname) {\n return hostname === parsed.url.hostname;\n });\n const allowedDomain = (options.allowedScriptDomains || []).find(function(domain) {\n return parsed.url.hostname === domain || parsed.url.hostname.endsWith(`.${domain}`);\n });\n allowed = allowedHostname || allowedDomain;\n }\n } catch (e) {\n allowed = false;\n }\n\n if (!allowed) {\n delete frame.attribs[a];\n return;\n }\n }\n\n if (name === 'iframe' && a === 'src') {\n let allowed = true;\n try {\n const parsed = parseUrl(value);\n\n if (parsed.isRelativeUrl) {\n // default value of allowIframeRelativeUrls is true\n // unless allowedIframeHostnames or allowedIframeDomains specified\n allowed = has(options, 'allowIframeRelativeUrls')\n ? options.allowIframeRelativeUrls\n : (!options.allowedIframeHostnames && !options.allowedIframeDomains);\n } else if (options.allowedIframeHostnames || options.allowedIframeDomains) {\n const allowedHostname = (options.allowedIframeHostnames || []).find(function (hostname) {\n return hostname === parsed.url.hostname;\n });\n const allowedDomain = (options.allowedIframeDomains || []).find(function(domain) {\n return parsed.url.hostname === domain || parsed.url.hostname.endsWith(`.${domain}`);\n });\n allowed = allowedHostname || allowedDomain;\n }\n } catch (e) {\n // Unparseable iframe src\n allowed = false;\n }\n if (!allowed) {\n delete frame.attribs[a];\n return;\n }\n }\n if (a === 'srcset') {\n try {\n let parsed = parseSrcset(value);\n parsed.forEach(function(value) {\n if (naughtyHref('srcset', value.url)) {\n value.evil = true;\n }\n });\n parsed = filter(parsed, function(v) {\n return !v.evil;\n });\n if (!parsed.length) {\n delete frame.attribs[a];\n return;\n } else {\n value = stringifySrcset(filter(parsed, function(v) {\n return !v.evil;\n }));\n frame.attribs[a] = value;\n }\n } catch (e) {\n // Unparseable srcset\n delete frame.attribs[a];\n return;\n }\n }\n if (a === 'class') {\n const allowedSpecificClasses = allowedClassesMap[name];\n const allowedWildcardClasses = allowedClassesMap['*'];\n const allowedSpecificClassesGlob = allowedClassesGlobMap[name];\n const allowedSpecificClassesRegex = allowedClassesRegexMap[name];\n const allowedWildcardClassesGlob = allowedClassesGlobMap['*'];\n const allowedClassesGlobs = [\n allowedSpecificClassesGlob,\n allowedWildcardClassesGlob\n ]\n .concat(allowedSpecificClassesRegex)\n .filter(function (t) {\n return t;\n });\n if (allowedSpecificClasses && allowedWildcardClasses) {\n value = filterClasses(value, deepmerge(allowedSpecificClasses, allowedWildcardClasses), allowedClassesGlobs);\n } else {\n value = filterClasses(value, allowedSpecificClasses || allowedWildcardClasses, allowedClassesGlobs);\n }\n if (!value.length) {\n delete frame.attribs[a];\n return;\n }\n }\n if (a === 'style') {\n if (options.parseStyleAttributes) {\n try {\n const abstractSyntaxTree = postcssParse(name + ' {' + value + '}', { map: false });\n const filteredAST = filterCss(abstractSyntaxTree, options.allowedStyles);\n\n value = stringifyStyleAttributes(filteredAST);\n\n if (value.length === 0) {\n delete frame.attribs[a];\n return;\n }\n } catch (e) {\n if (typeof window !== 'undefined') {\n console.warn('Failed to parse \"' + name + ' {' + value + '}' + '\", If you\\'re running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547');\n }\n delete frame.attribs[a];\n return;\n }\n } else if (options.allowedStyles) {\n throw new Error('allowedStyles option cannot be used together with parseStyleAttributes: false.');\n }\n }\n result += ' ' + a;\n if (value && value.length) {\n result += '=\"' + escapeHtml(value, true) + '\"';\n } else if (options.allowedEmptyAttributes.includes(a)) {\n result += '=\"\"';\n }\n } else {\n delete frame.attribs[a];\n }\n });\n }\n if (options.selfClosing.indexOf(name) !== -1) {\n result += ' />';\n } else {\n result += '>';\n if (frame.innerText && !hasText && !options.textFilter) {\n result += escapeHtml(frame.innerText);\n addedText = true;\n }\n }\n if (skip) {\n result = tempResult + escapeHtml(result);\n tempResult = '';\n }\n },\n ontext: function(text) {\n if (skipText) {\n return;\n }\n const lastFrame = stack[stack.length - 1];\n let tag;\n\n if (lastFrame) {\n tag = lastFrame.tag;\n // If inner text was set by transform function then let's use it\n text = lastFrame.innerText !== undefined ? lastFrame.innerText : text;\n }\n\n if (options.disallowedTagsMode === 'discard' && ((tag === 'script') || (tag === 'style'))) {\n // htmlparser2 gives us these as-is. Escaping them ruins the content. Allowing\n // script tags is, by definition, game over for XSS protection, so if that's\n // your concern, don't allow them. The same is essentially true for style tags\n // which have their own collection of XSS vectors.\n result += text;\n } else {\n const escaped = escapeHtml(text, false);\n if (options.textFilter && !addedText) {\n result += options.textFilter(escaped, tag);\n } else if (!addedText) {\n result += escaped;\n }\n }\n if (stack.length) {\n const frame = stack[stack.length - 1];\n frame.text += text;\n }\n },\n onclosetag: function(name, isImplied) {\n\n if (skipText) {\n skipTextDepth--;\n if (!skipTextDepth) {\n skipText = false;\n } else {\n return;\n }\n }\n\n const frame = stack.pop();\n if (!frame) {\n // Do not crash on bad markup\n return;\n }\n\n if (frame.tag !== name) {\n // Another case of bad markup.\n // Push to stack, so that it will be used in future closing tags.\n stack.push(frame);\n return;\n }\n\n skipText = options.enforceHtmlBoundary ? name === 'html' : false;\n depth--;\n const skip = skipMap[depth];\n if (skip) {\n delete skipMap[depth];\n if (options.disallowedTagsMode === 'discard') {\n frame.updateParentNodeText();\n return;\n }\n tempResult = result;\n result = '';\n }\n\n if (transformMap[depth]) {\n name = transformMap[depth];\n delete transformMap[depth];\n }\n\n if (options.exclusiveFilter && options.exclusiveFilter(frame)) {\n result = result.substr(0, frame.tagPosition);\n return;\n }\n\n frame.updateParentNodeMediaChildren();\n frame.updateParentNodeText();\n\n if (\n // Already output />\n options.selfClosing.indexOf(name) !== -1 ||\n // Escaped tag, closing tag is implied\n (isImplied && !tagAllowed(name) && [ 'escape', 'recursiveEscape' ].indexOf(options.disallowedTagsMode) >= 0)\n ) {\n if (skip) {\n result = tempResult;\n tempResult = '';\n }\n return;\n }\n\n result += '';\n if (skip) {\n result = tempResult + escapeHtml(result);\n tempResult = '';\n }\n addedText = false;\n }\n }, options.parser);\n parser.write(html);\n parser.end();\n\n return result;\n\n function initializeState() {\n result = '';\n depth = 0;\n stack = [];\n skipMap = {};\n transformMap = {};\n skipText = false;\n skipTextDepth = 0;\n }\n\n function escapeHtml(s, quote) {\n if (typeof (s) !== 'string') {\n s = s + '';\n }\n if (options.parser.decodeEntities) {\n s = s.replace(/&/g, '&').replace(//g, '>');\n if (quote) {\n s = s.replace(/\"/g, '"');\n }\n }\n // TODO: this is inadequate because it will pass `&0;`. This approach\n // will not work, each & must be considered with regard to whether it\n // is followed by a 100% syntactically valid entity or not, and escaped\n // if it is not. If this bothers you, don't set parser.decodeEntities\n // to false. (The default is true.)\n s = s.replace(/&(?![a-zA-Z0-9#]{1,20};)/g, '&') // Match ampersands not part of existing HTML entity\n .replace(//g, '>');\n if (quote) {\n s = s.replace(/\"/g, '"');\n }\n return s;\n }\n\n function naughtyHref(name, href) {\n // Browsers ignore character codes of 32 (space) and below in a surprising\n // number of situations. Start reading here:\n // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Embedded_tab\n // eslint-disable-next-line no-control-regex\n href = href.replace(/[\\x00-\\x20]+/g, '');\n // Clobber any comments in URLs, which the browser might\n // interpret inside an XML data island, allowing\n // a javascript: URL to be snuck through\n while (true) {\n const firstIndex = href.indexOf('', firstIndex + 4);\n if (lastIndex === -1) {\n break;\n }\n href = href.substring(0, firstIndex) + href.substring(lastIndex + 3);\n }\n // Case insensitive so we don't get faked out by JAVASCRIPT #1\n // Allow more characters after the first so we don't get faked\n // out by certain schemes browsers accept\n const matches = href.match(/^([a-zA-Z][a-zA-Z0-9.\\-+]*):/);\n if (!matches) {\n // Protocol-relative URL starting with any combination of '/' and '\\'\n if (href.match(/^[/\\\\]{2}/)) {\n return !options.allowProtocolRelative;\n }\n\n // No scheme\n return false;\n }\n const scheme = matches[1].toLowerCase();\n\n if (has(options.allowedSchemesByTag, name)) {\n return options.allowedSchemesByTag[name].indexOf(scheme) === -1;\n }\n\n return !options.allowedSchemes || options.allowedSchemes.indexOf(scheme) === -1;\n }\n\n function parseUrl(value) {\n value = value.replace(/^(\\w+:)?\\s*[\\\\/]\\s*[\\\\/]/, '$1//');\n if (value.startsWith('relative:')) {\n // An attempt to exploit our workaround for base URLs being\n // mandatory for relative URL validation in the WHATWG\n // URL parser, reject it\n throw new Error('relative: exploit attempt');\n }\n // naughtyHref is in charge of whether protocol relative URLs\n // are cool. Here we are concerned just with allowed hostnames and\n // whether to allow relative URLs.\n //\n // Build a placeholder \"base URL\" against which any reasonable\n // relative URL may be parsed successfully\n let base = 'relative://relative-site';\n for (let i = 0; (i < 100); i++) {\n base += `/${i}`;\n }\n\n const parsed = new URL(value, base);\n\n const isRelativeUrl = parsed && parsed.hostname === 'relative-site' && parsed.protocol === 'relative:';\n return {\n isRelativeUrl,\n url: parsed\n };\n }\n /**\n * Filters user input css properties by allowlisted regex attributes.\n * Modifies the abstractSyntaxTree object.\n *\n * @param {object} abstractSyntaxTree - Object representation of CSS attributes.\n * @property {array[Declaration]} abstractSyntaxTree.nodes[0] - Each object cointains prop and value key, i.e { prop: 'color', value: 'red' }.\n * @param {object} allowedStyles - Keys are properties (i.e color), value is list of permitted regex rules (i.e /green/i).\n * @return {object} - The modified tree.\n */\n function filterCss(abstractSyntaxTree, allowedStyles) {\n if (!allowedStyles) {\n return abstractSyntaxTree;\n }\n\n const astRules = abstractSyntaxTree.nodes[0];\n let selectedRule;\n\n // Merge global and tag-specific styles into new AST.\n if (allowedStyles[astRules.selector] && allowedStyles['*']) {\n selectedRule = deepmerge(\n allowedStyles[astRules.selector],\n allowedStyles['*']\n );\n } else {\n selectedRule = allowedStyles[astRules.selector] || allowedStyles['*'];\n }\n\n if (selectedRule) {\n abstractSyntaxTree.nodes[0].nodes = astRules.nodes.reduce(filterDeclarations(selectedRule), []);\n }\n\n return abstractSyntaxTree;\n }\n\n /**\n * Extracts the style attributes from an AbstractSyntaxTree and formats those\n * values in the inline style attribute format.\n *\n * @param {AbstractSyntaxTree} filteredAST\n * @return {string} - Example: \"color:yellow;text-align:center !important;font-family:helvetica;\"\n */\n function stringifyStyleAttributes(filteredAST) {\n return filteredAST.nodes[0].nodes\n .reduce(function(extractedAttributes, attrObject) {\n extractedAttributes.push(\n `${attrObject.prop}:${attrObject.value}${attrObject.important ? ' !important' : ''}`\n );\n return extractedAttributes;\n }, [])\n .join(';');\n }\n\n /**\n * Filters the existing attributes for the given property. Discards any attributes\n * which don't match the allowlist.\n *\n * @param {object} selectedRule - Example: { color: red, font-family: helvetica }\n * @param {array} allowedDeclarationsList - List of declarations which pass the allowlist.\n * @param {object} attributeObject - Object representing the current css property.\n * @property {string} attributeObject.type - Typically 'declaration'.\n * @property {string} attributeObject.prop - The CSS property, i.e 'color'.\n * @property {string} attributeObject.value - The corresponding value to the css property, i.e 'red'.\n * @return {function} - When used in Array.reduce, will return an array of Declaration objects\n */\n function filterDeclarations(selectedRule) {\n return function (allowedDeclarationsList, attributeObject) {\n // If this property is allowlisted...\n if (has(selectedRule, attributeObject.prop)) {\n const matchesRegex = selectedRule[attributeObject.prop].some(function(regularExpression) {\n return regularExpression.test(attributeObject.value);\n });\n\n if (matchesRegex) {\n allowedDeclarationsList.push(attributeObject);\n }\n }\n return allowedDeclarationsList;\n };\n }\n\n function filterClasses(classes, allowed, allowedGlobs) {\n if (!allowed) {\n // The class attribute is allowed without filtering on this tag\n return classes;\n }\n classes = classes.split(/\\s+/);\n return classes.filter(function(clss) {\n return allowed.indexOf(clss) !== -1 || allowedGlobs.some(function(glob) {\n return glob.test(clss);\n });\n }).join(' ');\n }\n}\n\n// Defaults are accessible to you so that you can use them as a starting point\n// programmatically if you wish\n\nconst htmlParserDefaults = {\n decodeEntities: true\n};\nsanitizeHtml.defaults = {\n allowedTags: [\n // Sections derived from MDN element categories and limited to the more\n // benign categories.\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element\n // Content sectioning\n 'address', 'article', 'aside', 'footer', 'header',\n 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hgroup',\n 'main', 'nav', 'section',\n // Text content\n 'blockquote', 'dd', 'div', 'dl', 'dt', 'figcaption', 'figure',\n 'hr', 'li', 'main', 'ol', 'p', 'pre', 'ul',\n // Inline text semantics\n 'a', 'abbr', 'b', 'bdi', 'bdo', 'br', 'cite', 'code', 'data', 'dfn',\n 'em', 'i', 'kbd', 'mark', 'q',\n 'rb', 'rp', 'rt', 'rtc', 'ruby',\n 's', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'time', 'u', 'var', 'wbr',\n // Table content\n 'caption', 'col', 'colgroup', 'table', 'tbody', 'td', 'tfoot', 'th',\n 'thead', 'tr'\n ],\n // Tags that cannot be boolean\n nonBooleanAttributes: [\n 'abbr', 'accept', 'accept-charset', 'accesskey', 'action',\n 'allow', 'alt', 'as', 'autocapitalize', 'autocomplete',\n 'blocking', 'charset', 'cite', 'class', 'color', 'cols',\n 'colspan', 'content', 'contenteditable', 'coords', 'crossorigin',\n 'data', 'datetime', 'decoding', 'dir', 'dirname', 'download',\n 'draggable', 'enctype', 'enterkeyhint', 'fetchpriority', 'for',\n 'form', 'formaction', 'formenctype', 'formmethod', 'formtarget',\n 'headers', 'height', 'hidden', 'high', 'href', 'hreflang',\n 'http-equiv', 'id', 'imagesizes', 'imagesrcset', 'inputmode',\n 'integrity', 'is', 'itemid', 'itemprop', 'itemref', 'itemtype',\n 'kind', 'label', 'lang', 'list', 'loading', 'low', 'max',\n 'maxlength', 'media', 'method', 'min', 'minlength', 'name',\n 'nonce', 'optimum', 'pattern', 'ping', 'placeholder', 'popover',\n 'popovertarget', 'popovertargetaction', 'poster', 'preload',\n 'referrerpolicy', 'rel', 'rows', 'rowspan', 'sandbox', 'scope',\n 'shape', 'size', 'sizes', 'slot', 'span', 'spellcheck', 'src',\n 'srcdoc', 'srclang', 'srcset', 'start', 'step', 'style',\n 'tabindex', 'target', 'title', 'translate', 'type', 'usemap',\n 'value', 'width', 'wrap',\n // Event handlers\n 'onauxclick', 'onafterprint', 'onbeforematch', 'onbeforeprint',\n 'onbeforeunload', 'onbeforetoggle', 'onblur', 'oncancel',\n 'oncanplay', 'oncanplaythrough', 'onchange', 'onclick', 'onclose',\n 'oncontextlost', 'oncontextmenu', 'oncontextrestored', 'oncopy',\n 'oncuechange', 'oncut', 'ondblclick', 'ondrag', 'ondragend',\n 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart',\n 'ondrop', 'ondurationchange', 'onemptied', 'onended',\n 'onerror', 'onfocus', 'onformdata', 'onhashchange', 'oninput',\n 'oninvalid', 'onkeydown', 'onkeypress', 'onkeyup',\n 'onlanguagechange', 'onload', 'onloadeddata', 'onloadedmetadata',\n 'onloadstart', 'onmessage', 'onmessageerror', 'onmousedown',\n 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout',\n 'onmouseover', 'onmouseup', 'onoffline', 'ononline', 'onpagehide',\n 'onpageshow', 'onpaste', 'onpause', 'onplay', 'onplaying',\n 'onpopstate', 'onprogress', 'onratechange', 'onreset', 'onresize',\n 'onrejectionhandled', 'onscroll', 'onscrollend',\n 'onsecuritypolicyviolation', 'onseeked', 'onseeking', 'onselect',\n 'onslotchange', 'onstalled', 'onstorage', 'onsubmit', 'onsuspend',\n 'ontimeupdate', 'ontoggle', 'onunhandledrejection', 'onunload',\n 'onvolumechange', 'onwaiting', 'onwheel'\n ],\n disallowedTagsMode: 'discard',\n allowedAttributes: {\n a: [ 'href', 'name', 'target' ],\n // We don't currently allow img itself by default, but\n // these attributes would make sense if we did.\n img: [ 'src', 'srcset', 'alt', 'title', 'width', 'height', 'loading' ]\n },\n allowedEmptyAttributes: [\n 'alt'\n ],\n // Lots of these won't come up by default because we don't allow them\n selfClosing: [ 'img', 'br', 'hr', 'area', 'base', 'basefont', 'input', 'link', 'meta' ],\n // URL schemes we permit\n allowedSchemes: [ 'http', 'https', 'ftp', 'mailto', 'tel' ],\n allowedSchemesByTag: {},\n allowedSchemesAppliedToAttributes: [ 'href', 'src', 'cite' ],\n allowProtocolRelative: true,\n enforceHtmlBoundary: false,\n parseStyleAttributes: true\n};\n\nsanitizeHtml.simpleTransform = function(newTagName, newAttribs, merge) {\n merge = (merge === undefined) ? true : merge;\n newAttribs = newAttribs || {};\n\n return function(tagName, attribs) {\n let attrib;\n if (merge) {\n for (attrib in newAttribs) {\n attribs[attrib] = newAttribs[attrib];\n }\n } else {\n attribs = newAttribs;\n }\n\n return {\n tagName: newTagName,\n attribs: attribs\n };\n };\n};\n","(function (global, factory) {\r\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\r\n typeof define === 'function' && define.amd ? define(factory) :\r\n (global.ResizeObserver = factory());\r\n}(this, (function () { 'use strict';\r\n\r\n/**\r\n * A collection of shims that provide minimal functionality of the ES6 collections.\r\n *\r\n * These implementations are not meant to be used outside of the ResizeObserver\r\n * modules as they cover only a limited range of use cases.\r\n */\r\n/* eslint-disable require-jsdoc, valid-jsdoc */\r\nvar MapShim = (function () {\r\n if (typeof Map !== 'undefined') {\r\n return Map;\r\n }\r\n\r\n /**\r\n * Returns index in provided array that matches the specified key.\r\n *\r\n * @param {Array} arr\r\n * @param {*} key\r\n * @returns {number}\r\n */\r\n function getIndex(arr, key) {\r\n var result = -1;\r\n\r\n arr.some(function (entry, index) {\r\n if (entry[0] === key) {\r\n result = index;\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n });\r\n\r\n return result;\r\n }\r\n\r\n return (function () {\r\n function anonymous() {\r\n this.__entries__ = [];\r\n }\r\n\r\n var prototypeAccessors = { size: { configurable: true } };\r\n\r\n /**\r\n * @returns {boolean}\r\n */\r\n prototypeAccessors.size.get = function () {\r\n return this.__entries__.length;\r\n };\r\n\r\n /**\r\n * @param {*} key\r\n * @returns {*}\r\n */\r\n anonymous.prototype.get = function (key) {\r\n var index = getIndex(this.__entries__, key);\r\n var entry = this.__entries__[index];\r\n\r\n return entry && entry[1];\r\n };\r\n\r\n /**\r\n * @param {*} key\r\n * @param {*} value\r\n * @returns {void}\r\n */\r\n anonymous.prototype.set = function (key, value) {\r\n var index = getIndex(this.__entries__, key);\r\n\r\n if (~index) {\r\n this.__entries__[index][1] = value;\r\n } else {\r\n this.__entries__.push([key, value]);\r\n }\r\n };\r\n\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n anonymous.prototype.delete = function (key) {\r\n var entries = this.__entries__;\r\n var index = getIndex(entries, key);\r\n\r\n if (~index) {\r\n entries.splice(index, 1);\r\n }\r\n };\r\n\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n anonymous.prototype.has = function (key) {\r\n return !!~getIndex(this.__entries__, key);\r\n };\r\n\r\n /**\r\n * @returns {void}\r\n */\r\n anonymous.prototype.clear = function () {\r\n this.__entries__.splice(0);\r\n };\r\n\r\n /**\r\n * @param {Function} callback\r\n * @param {*} [ctx=null]\r\n * @returns {void}\r\n */\r\n anonymous.prototype.forEach = function (callback, ctx) {\r\n var this$1 = this;\r\n if ( ctx === void 0 ) ctx = null;\r\n\r\n for (var i = 0, list = this$1.__entries__; i < list.length; i += 1) {\r\n var entry = list[i];\r\n\r\n callback.call(ctx, entry[1], entry[0]);\r\n }\r\n };\r\n\r\n Object.defineProperties( anonymous.prototype, prototypeAccessors );\r\n\r\n return anonymous;\r\n }());\r\n})();\r\n\r\n/**\r\n * Detects whether window and document objects are available in current environment.\r\n */\r\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;\r\n\r\n// Returns global object of a current environment.\r\nvar global$1 = (function () {\r\n if (typeof global !== 'undefined' && global.Math === Math) {\r\n return global;\r\n }\r\n\r\n if (typeof self !== 'undefined' && self.Math === Math) {\r\n return self;\r\n }\r\n\r\n if (typeof window !== 'undefined' && window.Math === Math) {\r\n return window;\r\n }\r\n\r\n // eslint-disable-next-line no-new-func\r\n return Function('return this')();\r\n})();\r\n\r\n/**\r\n * A shim for the requestAnimationFrame which falls back to the setTimeout if\r\n * first one is not supported.\r\n *\r\n * @returns {number} Requests' identifier.\r\n */\r\nvar requestAnimationFrame$1 = (function () {\r\n if (typeof requestAnimationFrame === 'function') {\r\n // It's required to use a bounded function because IE sometimes throws\r\n // an \"Invalid calling object\" error if rAF is invoked without the global\r\n // object on the left hand side.\r\n return requestAnimationFrame.bind(global$1);\r\n }\r\n\r\n return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };\r\n})();\r\n\r\n// Defines minimum timeout before adding a trailing call.\r\nvar trailingTimeout = 2;\r\n\r\n/**\r\n * Creates a wrapper function which ensures that provided callback will be\r\n * invoked only once during the specified delay period.\r\n *\r\n * @param {Function} callback - Function to be invoked after the delay period.\r\n * @param {number} delay - Delay after which to invoke callback.\r\n * @returns {Function}\r\n */\r\nvar throttle = function (callback, delay) {\r\n var leadingCall = false,\r\n trailingCall = false,\r\n lastCallTime = 0;\r\n\r\n /**\r\n * Invokes the original callback function and schedules new invocation if\r\n * the \"proxy\" was called during current request.\r\n *\r\n * @returns {void}\r\n */\r\n function resolvePending() {\r\n if (leadingCall) {\r\n leadingCall = false;\r\n\r\n callback();\r\n }\r\n\r\n if (trailingCall) {\r\n proxy();\r\n }\r\n }\r\n\r\n /**\r\n * Callback invoked after the specified delay. It will further postpone\r\n * invocation of the original function delegating it to the\r\n * requestAnimationFrame.\r\n *\r\n * @returns {void}\r\n */\r\n function timeoutCallback() {\r\n requestAnimationFrame$1(resolvePending);\r\n }\r\n\r\n /**\r\n * Schedules invocation of the original function.\r\n *\r\n * @returns {void}\r\n */\r\n function proxy() {\r\n var timeStamp = Date.now();\r\n\r\n if (leadingCall) {\r\n // Reject immediately following calls.\r\n if (timeStamp - lastCallTime < trailingTimeout) {\r\n return;\r\n }\r\n\r\n // Schedule new call to be in invoked when the pending one is resolved.\r\n // This is important for \"transitions\" which never actually start\r\n // immediately so there is a chance that we might miss one if change\r\n // happens amids the pending invocation.\r\n trailingCall = true;\r\n } else {\r\n leadingCall = true;\r\n trailingCall = false;\r\n\r\n setTimeout(timeoutCallback, delay);\r\n }\r\n\r\n lastCallTime = timeStamp;\r\n }\r\n\r\n return proxy;\r\n};\r\n\r\n// Minimum delay before invoking the update of observers.\r\nvar REFRESH_DELAY = 20;\r\n\r\n// A list of substrings of CSS properties used to find transition events that\r\n// might affect dimensions of observed elements.\r\nvar transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];\r\n\r\n// Check if MutationObserver is available.\r\nvar mutationObserverSupported = typeof MutationObserver !== 'undefined';\r\n\r\n/**\r\n * Singleton controller class which handles updates of ResizeObserver instances.\r\n */\r\nvar ResizeObserverController = function() {\r\n this.connected_ = false;\r\n this.mutationEventsAdded_ = false;\r\n this.mutationsObserver_ = null;\r\n this.observers_ = [];\r\n\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n};\r\n\r\n/**\r\n * Adds observer to observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be added.\r\n * @returns {void}\r\n */\r\n\r\n\r\n/**\r\n * Holds reference to the controller's instance.\r\n *\r\n * @private {ResizeObserverController}\r\n */\r\n\r\n\r\n/**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n\r\n/**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\nResizeObserverController.prototype.addObserver = function (observer) {\r\n if (!~this.observers_.indexOf(observer)) {\r\n this.observers_.push(observer);\r\n }\r\n\r\n // Add listeners if they haven't been added yet.\r\n if (!this.connected_) {\r\n this.connect_();\r\n }\r\n};\r\n\r\n/**\r\n * Removes observer from observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be removed.\r\n * @returns {void}\r\n */\r\nResizeObserverController.prototype.removeObserver = function (observer) {\r\n var observers = this.observers_;\r\n var index = observers.indexOf(observer);\r\n\r\n // Remove observer if it's present in registry.\r\n if (~index) {\r\n observers.splice(index, 1);\r\n }\r\n\r\n // Remove listeners if controller has no connected observers.\r\n if (!observers.length && this.connected_) {\r\n this.disconnect_();\r\n }\r\n};\r\n\r\n/**\r\n * Invokes the update of observers. It will continue running updates insofar\r\n * it detects changes.\r\n *\r\n * @returns {void}\r\n */\r\nResizeObserverController.prototype.refresh = function () {\r\n var changesDetected = this.updateObservers_();\r\n\r\n // Continue running updates if changes have been detected as there might\r\n // be future ones caused by CSS transitions.\r\n if (changesDetected) {\r\n this.refresh();\r\n }\r\n};\r\n\r\n/**\r\n * Updates every observer from observers list and notifies them of queued\r\n * entries.\r\n *\r\n * @private\r\n * @returns {boolean} Returns \"true\" if any observer has detected changes in\r\n * dimensions of it's elements.\r\n */\r\nResizeObserverController.prototype.updateObservers_ = function () {\r\n // Collect observers that have active observations.\r\n var activeObservers = this.observers_.filter(function (observer) {\r\n return observer.gatherActive(), observer.hasActive();\r\n });\r\n\r\n // Deliver notifications in a separate cycle in order to avoid any\r\n // collisions between observers, e.g. when multiple instances of\r\n // ResizeObserver are tracking the same element and the callback of one\r\n // of them changes content dimensions of the observed target. Sometimes\r\n // this may result in notifications being blocked for the rest of observers.\r\n activeObservers.forEach(function (observer) { return observer.broadcastActive(); });\r\n\r\n return activeObservers.length > 0;\r\n};\r\n\r\n/**\r\n * Initializes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\nResizeObserverController.prototype.connect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already added.\r\n if (!isBrowser || this.connected_) {\r\n return;\r\n }\r\n\r\n // Subscription to the \"Transitionend\" event is used as a workaround for\r\n // delayed transitions. This way it's possible to capture at least the\r\n // final state of an element.\r\n document.addEventListener('transitionend', this.onTransitionEnd_);\r\n\r\n window.addEventListener('resize', this.refresh);\r\n\r\n if (mutationObserverSupported) {\r\n this.mutationsObserver_ = new MutationObserver(this.refresh);\r\n\r\n this.mutationsObserver_.observe(document, {\r\n attributes: true,\r\n childList: true,\r\n characterData: true,\r\n subtree: true\r\n });\r\n } else {\r\n document.addEventListener('DOMSubtreeModified', this.refresh);\r\n\r\n this.mutationEventsAdded_ = true;\r\n }\r\n\r\n this.connected_ = true;\r\n};\r\n\r\n/**\r\n * Removes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\nResizeObserverController.prototype.disconnect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already removed.\r\n if (!isBrowser || !this.connected_) {\r\n return;\r\n }\r\n\r\n document.removeEventListener('transitionend', this.onTransitionEnd_);\r\n window.removeEventListener('resize', this.refresh);\r\n\r\n if (this.mutationsObserver_) {\r\n this.mutationsObserver_.disconnect();\r\n }\r\n\r\n if (this.mutationEventsAdded_) {\r\n document.removeEventListener('DOMSubtreeModified', this.refresh);\r\n }\r\n\r\n this.mutationsObserver_ = null;\r\n this.mutationEventsAdded_ = false;\r\n this.connected_ = false;\r\n};\r\n\r\n/**\r\n * \"Transitionend\" event handler.\r\n *\r\n * @private\r\n * @param {TransitionEvent} event\r\n * @returns {void}\r\n */\r\nResizeObserverController.prototype.onTransitionEnd_ = function (ref) {\r\n var propertyName = ref.propertyName; if ( propertyName === void 0 ) propertyName = '';\r\n\r\n // Detect whether transition may affect dimensions of an element.\r\n var isReflowProperty = transitionKeys.some(function (key) {\r\n return !!~propertyName.indexOf(key);\r\n });\r\n\r\n if (isReflowProperty) {\r\n this.refresh();\r\n }\r\n};\r\n\r\n/**\r\n * Returns instance of the ResizeObserverController.\r\n *\r\n * @returns {ResizeObserverController}\r\n */\r\nResizeObserverController.getInstance = function () {\r\n if (!this.instance_) {\r\n this.instance_ = new ResizeObserverController();\r\n }\r\n\r\n return this.instance_;\r\n};\r\n\r\nResizeObserverController.instance_ = null;\r\n\r\n/**\r\n * Defines non-writable/enumerable properties of the provided target object.\r\n *\r\n * @param {Object} target - Object for which to define properties.\r\n * @param {Object} props - Properties to be defined.\r\n * @returns {Object} Target object.\r\n */\r\nvar defineConfigurable = (function (target, props) {\r\n for (var i = 0, list = Object.keys(props); i < list.length; i += 1) {\r\n var key = list[i];\r\n\r\n Object.defineProperty(target, key, {\r\n value: props[key],\r\n enumerable: false,\r\n writable: false,\r\n configurable: true\r\n });\r\n }\r\n\r\n return target;\r\n});\r\n\r\n/**\r\n * Returns the global object associated with provided element.\r\n *\r\n * @param {Object} target\r\n * @returns {Object}\r\n */\r\nvar getWindowOf = (function (target) {\r\n // Assume that the element is an instance of Node, which means that it\r\n // has the \"ownerDocument\" property from which we can retrieve a\r\n // corresponding global object.\r\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;\r\n\r\n // Return the local global object if it's not possible extract one from\r\n // provided element.\r\n return ownerGlobal || global$1;\r\n});\r\n\r\n// Placeholder of an empty content rectangle.\r\nvar emptyRect = createRectInit(0, 0, 0, 0);\r\n\r\n/**\r\n * Converts provided string to a number.\r\n *\r\n * @param {number|string} value\r\n * @returns {number}\r\n */\r\nfunction toFloat(value) {\r\n return parseFloat(value) || 0;\r\n}\r\n\r\n/**\r\n * Extracts borders size from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @param {...string} positions - Borders positions (top, right, ...)\r\n * @returns {number}\r\n */\r\nfunction getBordersSize(styles) {\r\n var positions = [], len = arguments.length - 1;\r\n while ( len-- > 0 ) positions[ len ] = arguments[ len + 1 ];\r\n\r\n return positions.reduce(function (size, position) {\r\n var value = styles['border-' + position + '-width'];\r\n\r\n return size + toFloat(value);\r\n }, 0);\r\n}\r\n\r\n/**\r\n * Extracts paddings sizes from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @returns {Object} Paddings box.\r\n */\r\nfunction getPaddings(styles) {\r\n var positions = ['top', 'right', 'bottom', 'left'];\r\n var paddings = {};\r\n\r\n for (var i = 0, list = positions; i < list.length; i += 1) {\r\n var position = list[i];\r\n\r\n var value = styles['padding-' + position];\r\n\r\n paddings[position] = toFloat(value);\r\n }\r\n\r\n return paddings;\r\n}\r\n\r\n/**\r\n * Calculates content rectangle of provided SVG element.\r\n *\r\n * @param {SVGGraphicsElement} target - Element content rectangle of which needs\r\n * to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getSVGContentRect(target) {\r\n var bbox = target.getBBox();\r\n\r\n return createRectInit(0, 0, bbox.width, bbox.height);\r\n}\r\n\r\n/**\r\n * Calculates content rectangle of provided HTMLElement.\r\n *\r\n * @param {HTMLElement} target - Element for which to calculate the content rectangle.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getHTMLElementContentRect(target) {\r\n // Client width & height properties can't be\r\n // used exclusively as they provide rounded values.\r\n var clientWidth = target.clientWidth;\r\n var clientHeight = target.clientHeight;\r\n\r\n // By this condition we can catch all non-replaced inline, hidden and\r\n // detached elements. Though elements with width & height properties less\r\n // than 0.5 will be discarded as well.\r\n //\r\n // Without it we would need to implement separate methods for each of\r\n // those cases and it's not possible to perform a precise and performance\r\n // effective test for hidden elements. E.g. even jQuery's ':visible' filter\r\n // gives wrong results for elements with width & height less than 0.5.\r\n if (!clientWidth && !clientHeight) {\r\n return emptyRect;\r\n }\r\n\r\n var styles = getWindowOf(target).getComputedStyle(target);\r\n var paddings = getPaddings(styles);\r\n var horizPad = paddings.left + paddings.right;\r\n var vertPad = paddings.top + paddings.bottom;\r\n\r\n // Computed styles of width & height are being used because they are the\r\n // only dimensions available to JS that contain non-rounded values. It could\r\n // be possible to utilize the getBoundingClientRect if only it's data wasn't\r\n // affected by CSS transformations let alone paddings, borders and scroll bars.\r\n var width = toFloat(styles.width),\r\n height = toFloat(styles.height);\r\n\r\n // Width & height include paddings and borders when the 'border-box' box\r\n // model is applied (except for IE).\r\n if (styles.boxSizing === 'border-box') {\r\n // Following conditions are required to handle Internet Explorer which\r\n // doesn't include paddings and borders to computed CSS dimensions.\r\n //\r\n // We can say that if CSS dimensions + paddings are equal to the \"client\"\r\n // properties then it's either IE, and thus we don't need to subtract\r\n // anything, or an element merely doesn't have paddings/borders styles.\r\n if (Math.round(width + horizPad) !== clientWidth) {\r\n width -= getBordersSize(styles, 'left', 'right') + horizPad;\r\n }\r\n\r\n if (Math.round(height + vertPad) !== clientHeight) {\r\n height -= getBordersSize(styles, 'top', 'bottom') + vertPad;\r\n }\r\n }\r\n\r\n // Following steps can't be applied to the document's root element as its\r\n // client[Width/Height] properties represent viewport area of the window.\r\n // Besides, it's as well not necessary as the itself neither has\r\n // rendered scroll bars nor it can be clipped.\r\n if (!isDocumentElement(target)) {\r\n // In some browsers (only in Firefox, actually) CSS width & height\r\n // include scroll bars size which can be removed at this step as scroll\r\n // bars are the only difference between rounded dimensions + paddings\r\n // and \"client\" properties, though that is not always true in Chrome.\r\n var vertScrollbar = Math.round(width + horizPad) - clientWidth;\r\n var horizScrollbar = Math.round(height + vertPad) - clientHeight;\r\n\r\n // Chrome has a rather weird rounding of \"client\" properties.\r\n // E.g. for an element with content width of 314.2px it sometimes gives\r\n // the client width of 315px and for the width of 314.7px it may give\r\n // 314px. And it doesn't happen all the time. So just ignore this delta\r\n // as a non-relevant.\r\n if (Math.abs(vertScrollbar) !== 1) {\r\n width -= vertScrollbar;\r\n }\r\n\r\n if (Math.abs(horizScrollbar) !== 1) {\r\n height -= horizScrollbar;\r\n }\r\n }\r\n\r\n return createRectInit(paddings.left, paddings.top, width, height);\r\n}\r\n\r\n/**\r\n * Checks whether provided element is an instance of the SVGGraphicsElement.\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nvar isSVGGraphicsElement = (function () {\r\n // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement\r\n // interface.\r\n if (typeof SVGGraphicsElement !== 'undefined') {\r\n return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };\r\n }\r\n\r\n // If it's so, then check that element is at least an instance of the\r\n // SVGElement and that it has the \"getBBox\" method.\r\n // eslint-disable-next-line no-extra-parens\r\n return function (target) { return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === 'function'; };\r\n})();\r\n\r\n/**\r\n * Checks whether provided element is a document element ().\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nfunction isDocumentElement(target) {\r\n return target === getWindowOf(target).document.documentElement;\r\n}\r\n\r\n/**\r\n * Calculates an appropriate content rectangle for provided html or svg element.\r\n *\r\n * @param {Element} target - Element content rectangle of which needs to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getContentRect(target) {\r\n if (!isBrowser) {\r\n return emptyRect;\r\n }\r\n\r\n if (isSVGGraphicsElement(target)) {\r\n return getSVGContentRect(target);\r\n }\r\n\r\n return getHTMLElementContentRect(target);\r\n}\r\n\r\n/**\r\n * Creates rectangle with an interface of the DOMRectReadOnly.\r\n * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly\r\n *\r\n * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.\r\n * @returns {DOMRectReadOnly}\r\n */\r\nfunction createReadOnlyRect(ref) {\r\n var x = ref.x;\r\n var y = ref.y;\r\n var width = ref.width;\r\n var height = ref.height;\r\n\r\n // If DOMRectReadOnly is available use it as a prototype for the rectangle.\r\n var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;\r\n var rect = Object.create(Constr.prototype);\r\n\r\n // Rectangle's properties are not writable and non-enumerable.\r\n defineConfigurable(rect, {\r\n x: x, y: y, width: width, height: height,\r\n top: y,\r\n right: x + width,\r\n bottom: height + y,\r\n left: x\r\n });\r\n\r\n return rect;\r\n}\r\n\r\n/**\r\n * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.\r\n * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit\r\n *\r\n * @param {number} x - X coordinate.\r\n * @param {number} y - Y coordinate.\r\n * @param {number} width - Rectangle's width.\r\n * @param {number} height - Rectangle's height.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction createRectInit(x, y, width, height) {\r\n return { x: x, y: y, width: width, height: height };\r\n}\r\n\r\n/**\r\n * Class that is responsible for computations of the content rectangle of\r\n * provided DOM element and for keeping track of it's changes.\r\n */\r\nvar ResizeObservation = function(target) {\r\n this.broadcastWidth = 0;\r\n this.broadcastHeight = 0;\r\n this.contentRect_ = createRectInit(0, 0, 0, 0);\r\n\r\n this.target = target;\r\n};\r\n\r\n/**\r\n * Updates content rectangle and tells whether it's width or height properties\r\n * have changed since the last broadcast.\r\n *\r\n * @returns {boolean}\r\n */\r\n\r\n\r\n/**\r\n * Reference to the last observed content rectangle.\r\n *\r\n * @private {DOMRectInit}\r\n */\r\n\r\n\r\n/**\r\n * Broadcasted width of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\nResizeObservation.prototype.isActive = function () {\r\n var rect = getContentRect(this.target);\r\n\r\n this.contentRect_ = rect;\r\n\r\n return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;\r\n};\r\n\r\n/**\r\n * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data\r\n * from the corresponding properties of the last observed content rectangle.\r\n *\r\n * @returns {DOMRectInit} Last observed content rectangle.\r\n */\r\nResizeObservation.prototype.broadcastRect = function () {\r\n var rect = this.contentRect_;\r\n\r\n this.broadcastWidth = rect.width;\r\n this.broadcastHeight = rect.height;\r\n\r\n return rect;\r\n};\r\n\r\nvar ResizeObserverEntry = function(target, rectInit) {\r\n var contentRect = createReadOnlyRect(rectInit);\r\n\r\n // According to the specification following properties are not writable\r\n // and are also not enumerable in the native implementation.\r\n //\r\n // Property accessors are not being used as they'd require to define a\r\n // private WeakMap storage which may cause memory leaks in browsers that\r\n // don't support this type of collections.\r\n defineConfigurable(this, { target: target, contentRect: contentRect });\r\n};\r\n\r\nvar ResizeObserverSPI = function(callback, controller, callbackCtx) {\r\n this.activeObservations_ = [];\r\n this.observations_ = new MapShim();\r\n\r\n if (typeof callback !== 'function') {\r\n throw new TypeError('The callback provided as parameter 1 is not a function.');\r\n }\r\n\r\n this.callback_ = callback;\r\n this.controller_ = controller;\r\n this.callbackCtx_ = callbackCtx;\r\n};\r\n\r\n/**\r\n * Starts observing provided element.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n * @returns {void}\r\n */\r\n\r\n\r\n/**\r\n * Registry of the ResizeObservation instances.\r\n *\r\n * @private {Map}\r\n */\r\n\r\n\r\n/**\r\n * Public ResizeObserver instance which will be passed to the callback\r\n * function and used as a value of it's \"this\" binding.\r\n *\r\n * @private {ResizeObserver}\r\n */\r\n\r\n/**\r\n * Collection of resize observations that have detected changes in dimensions\r\n * of elements.\r\n *\r\n * @private {Array}\r\n */\r\nResizeObserverSPI.prototype.observe = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n\r\n var observations = this.observations_;\r\n\r\n // Do nothing if element is already being observed.\r\n if (observations.has(target)) {\r\n return;\r\n }\r\n\r\n observations.set(target, new ResizeObservation(target));\r\n\r\n this.controller_.addObserver(this);\r\n\r\n // Force the update of observations.\r\n this.controller_.refresh();\r\n};\r\n\r\n/**\r\n * Stops observing provided element.\r\n *\r\n * @param {Element} target - Element to stop observing.\r\n * @returns {void}\r\n */\r\nResizeObserverSPI.prototype.unobserve = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n\r\n var observations = this.observations_;\r\n\r\n // Do nothing if element is not being observed.\r\n if (!observations.has(target)) {\r\n return;\r\n }\r\n\r\n observations.delete(target);\r\n\r\n if (!observations.size) {\r\n this.controller_.removeObserver(this);\r\n }\r\n};\r\n\r\n/**\r\n * Stops observing all elements.\r\n *\r\n * @returns {void}\r\n */\r\nResizeObserverSPI.prototype.disconnect = function () {\r\n this.clearActive();\r\n this.observations_.clear();\r\n this.controller_.removeObserver(this);\r\n};\r\n\r\n/**\r\n * Collects observation instances the associated element of which has changed\r\n * it's content rectangle.\r\n *\r\n * @returns {void}\r\n */\r\nResizeObserverSPI.prototype.gatherActive = function () {\r\n var this$1 = this;\r\n\r\n this.clearActive();\r\n\r\n this.observations_.forEach(function (observation) {\r\n if (observation.isActive()) {\r\n this$1.activeObservations_.push(observation);\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Invokes initial callback function with a list of ResizeObserverEntry\r\n * instances collected from active resize observations.\r\n *\r\n * @returns {void}\r\n */\r\nResizeObserverSPI.prototype.broadcastActive = function () {\r\n // Do nothing if observer doesn't have active observations.\r\n if (!this.hasActive()) {\r\n return;\r\n }\r\n\r\n var ctx = this.callbackCtx_;\r\n\r\n // Create ResizeObserverEntry instance for every active observation.\r\n var entries = this.activeObservations_.map(function (observation) {\r\n return new ResizeObserverEntry(observation.target, observation.broadcastRect());\r\n });\r\n\r\n this.callback_.call(ctx, entries, ctx);\r\n this.clearActive();\r\n};\r\n\r\n/**\r\n * Clears the collection of active observations.\r\n *\r\n * @returns {void}\r\n */\r\nResizeObserverSPI.prototype.clearActive = function () {\r\n this.activeObservations_.splice(0);\r\n};\r\n\r\n/**\r\n * Tells whether observer has active observations.\r\n *\r\n * @returns {boolean}\r\n */\r\nResizeObserverSPI.prototype.hasActive = function () {\r\n return this.activeObservations_.length > 0;\r\n};\r\n\r\n// Registry of internal observers. If WeakMap is not available use current shim\r\n// for the Map collection as it has all required methods and because WeakMap\r\n// can't be fully polyfilled anyway.\r\nvar observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();\r\n\r\n/**\r\n * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation\r\n * exposing only those methods and properties that are defined in the spec.\r\n */\r\nvar ResizeObserver = function(callback) {\r\n if (!(this instanceof ResizeObserver)) {\r\n throw new TypeError('Cannot call a class as a function.');\r\n }\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n\r\n var controller = ResizeObserverController.getInstance();\r\n var observer = new ResizeObserverSPI(callback, controller, this);\r\n\r\n observers.set(this, observer);\r\n};\r\n\r\n// Expose public methods of ResizeObserver.\r\n['observe', 'unobserve', 'disconnect'].forEach(function (method) {\r\n ResizeObserver.prototype[method] = function () {\r\n return (ref = observers.get(this))[method].apply(ref, arguments);\r\n var ref;\r\n };\r\n});\r\n\r\nvar index = (function () {\r\n // Export existing implementation if available.\r\n if (typeof global$1.ResizeObserver !== 'undefined') {\r\n return global$1.ResizeObserver;\r\n }\r\n\r\n global$1.ResizeObserver = ResizeObserver;\r\n\r\n return ResizeObserver;\r\n})();\r\n\r\nreturn index;\r\n\r\n})));\r\n","/**\n * @license React\n * scheduler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';function f(a,b){var c=a.length;a.push(b);a:for(;0>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","import { runIdentityFunctionCheck } from './devModeChecks/identityFunctionCheck'\nimport { runInputStabilityCheck } from './devModeChecks/inputStabilityCheck'\nimport { globalDevModeChecks } from './devModeChecks/setGlobalDevModeChecks'\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport type {\n DevModeChecks,\n Selector,\n SelectorArray,\n DevModeChecksExecutionInfo\n} from './types'\n\nexport const NOT_FOUND = 'NOT_FOUND'\nexport type NOT_FOUND_TYPE = typeof NOT_FOUND\n\n/**\n * Assert that the provided value is a function. If the assertion fails,\n * a `TypeError` is thrown with an optional custom error message.\n *\n * @param func - The value to be checked.\n * @param errorMessage - An optional custom error message to use if the assertion fails.\n * @throws A `TypeError` if the assertion fails.\n */\nexport function assertIsFunction(\n func: unknown,\n errorMessage = `expected a function, instead received ${typeof func}`\n): asserts func is FunctionType {\n if (typeof func !== 'function') {\n throw new TypeError(errorMessage)\n }\n}\n\n/**\n * Assert that the provided value is an object. If the assertion fails,\n * a `TypeError` is thrown with an optional custom error message.\n *\n * @param object - The value to be checked.\n * @param errorMessage - An optional custom error message to use if the assertion fails.\n * @throws A `TypeError` if the assertion fails.\n */\nexport function assertIsObject>(\n object: unknown,\n errorMessage = `expected an object, instead received ${typeof object}`\n): asserts object is ObjectType {\n if (typeof object !== 'object') {\n throw new TypeError(errorMessage)\n }\n}\n\n/**\n * Assert that the provided array is an array of functions. If the assertion fails,\n * a `TypeError` is thrown with an optional custom error message.\n *\n * @param array - The array to be checked.\n * @param errorMessage - An optional custom error message to use if the assertion fails.\n * @throws A `TypeError` if the assertion fails.\n */\nexport function assertIsArrayOfFunctions(\n array: unknown[],\n errorMessage = `expected all items to be functions, instead received the following types: `\n): asserts array is FunctionType[] {\n if (\n !array.every((item): item is FunctionType => typeof item === 'function')\n ) {\n const itemTypes = array\n .map(item =>\n typeof item === 'function'\n ? `function ${item.name || 'unnamed'}()`\n : typeof item\n )\n .join(', ')\n throw new TypeError(`${errorMessage}[${itemTypes}]`)\n }\n}\n\n/**\n * Ensure that the input is an array. If it's already an array, it's returned as is.\n * If it's not an array, it will be wrapped in a new array.\n *\n * @param item - The item to be checked.\n * @returns An array containing the input item. If the input is already an array, it's returned without modification.\n */\nexport const ensureIsArray = (item: unknown) => {\n return Array.isArray(item) ? item : [item]\n}\n\n/**\n * Extracts the \"dependencies\" / \"input selectors\" from the arguments of `createSelector`.\n *\n * @param createSelectorArgs - Arguments passed to `createSelector` as an array.\n * @returns An array of \"input selectors\" / \"dependencies\".\n * @throws A `TypeError` if any of the input selectors is not function.\n */\nexport function getDependencies(createSelectorArgs: unknown[]) {\n const dependencies = Array.isArray(createSelectorArgs[0])\n ? createSelectorArgs[0]\n : createSelectorArgs\n\n assertIsArrayOfFunctions(\n dependencies,\n `createSelector expects all input-selectors to be functions, but received the following types: `\n )\n\n return dependencies as SelectorArray\n}\n\n/**\n * Runs each input selector and returns their collective results as an array.\n *\n * @param dependencies - An array of \"dependencies\" or \"input selectors\".\n * @param inputSelectorArgs - An array of arguments being passed to the input selectors.\n * @returns An array of input selector results.\n */\nexport function collectInputSelectorResults(\n dependencies: SelectorArray,\n inputSelectorArgs: unknown[] | IArguments\n) {\n const inputSelectorResults = []\n const { length } = dependencies\n for (let i = 0; i < length; i++) {\n // @ts-ignore\n // apply arguments instead of spreading and mutate a local list of params for performance.\n inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs))\n }\n return inputSelectorResults\n}\n\n/**\n * Retrieves execution information for development mode checks.\n *\n * @param devModeChecks - Custom Settings for development mode checks. These settings will override the global defaults.\n * @param firstRun - Indicates whether it is the first time the selector has run.\n * @returns An object containing the execution information for each development mode check.\n */\nexport const getDevModeChecksExecutionInfo = (\n firstRun: boolean,\n devModeChecks: Partial\n) => {\n const { identityFunctionCheck, inputStabilityCheck } = {\n ...globalDevModeChecks,\n ...devModeChecks\n }\n return {\n identityFunctionCheck: {\n shouldRun:\n identityFunctionCheck === 'always' ||\n (identityFunctionCheck === 'once' && firstRun),\n run: runIdentityFunctionCheck\n },\n inputStabilityCheck: {\n shouldRun:\n inputStabilityCheck === 'always' ||\n (inputStabilityCheck === 'once' && firstRun),\n run: runInputStabilityCheck\n }\n } satisfies DevModeChecksExecutionInfo\n}\n","// Original source:\n// - https://github.com/simonihmig/tracked-redux/blob/master/packages/tracked-redux/src/-private/proxy.ts\n\nimport type { Node, Tag } from './tracking'\nimport {\n consumeCollection,\n consumeTag,\n createTag,\n dirtyCollection,\n dirtyTag\n} from './tracking'\n\nexport const REDUX_PROXY_LABEL = Symbol()\n\nlet nextId = 0\n\nconst proto = Object.getPrototypeOf({})\n\nclass ObjectTreeNode> implements Node {\n proxy: T = new Proxy(this, objectProxyHandler) as unknown as T\n tag = createTag()\n tags = {} as Record\n children = {} as Record\n collectionTag = null\n id = nextId++\n\n constructor(public value: T) {\n this.value = value\n this.tag.value = value\n }\n}\n\nconst objectProxyHandler = {\n get(node: Node, key: string | symbol): unknown {\n function calculateResult() {\n const { value } = node\n\n const childValue = Reflect.get(value, key)\n\n if (typeof key === 'symbol') {\n return childValue\n }\n\n if (key in proto) {\n return childValue\n }\n\n if (typeof childValue === 'object' && childValue !== null) {\n let childNode = node.children[key]\n\n if (childNode === undefined) {\n childNode = node.children[key] = createNode(childValue)\n }\n\n if (childNode.tag) {\n consumeTag(childNode.tag)\n }\n\n return childNode.proxy\n } else {\n let tag = node.tags[key]\n\n if (tag === undefined) {\n tag = node.tags[key] = createTag()\n tag.value = childValue\n }\n\n consumeTag(tag)\n\n return childValue\n }\n }\n const res = calculateResult()\n return res\n },\n\n ownKeys(node: Node): ArrayLike {\n consumeCollection(node)\n return Reflect.ownKeys(node.value)\n },\n\n getOwnPropertyDescriptor(\n node: Node,\n prop: string | symbol\n ): PropertyDescriptor | undefined {\n return Reflect.getOwnPropertyDescriptor(node.value, prop)\n },\n\n has(node: Node, prop: string | symbol): boolean {\n return Reflect.has(node.value, prop)\n }\n}\n\nclass ArrayTreeNode> implements Node {\n proxy: T = new Proxy([this], arrayProxyHandler) as unknown as T\n tag = createTag()\n tags = {}\n children = {}\n collectionTag = null\n id = nextId++\n\n constructor(public value: T) {\n this.value = value\n this.tag.value = value\n }\n}\n\nconst arrayProxyHandler = {\n get([node]: [Node], key: string | symbol): unknown {\n if (key === 'length') {\n consumeCollection(node)\n }\n\n return objectProxyHandler.get(node, key)\n },\n\n ownKeys([node]: [Node]): ArrayLike {\n return objectProxyHandler.ownKeys(node)\n },\n\n getOwnPropertyDescriptor(\n [node]: [Node],\n prop: string | symbol\n ): PropertyDescriptor | undefined {\n return objectProxyHandler.getOwnPropertyDescriptor(node, prop)\n },\n\n has([node]: [Node], prop: string | symbol): boolean {\n return objectProxyHandler.has(node, prop)\n }\n}\n\nexport function createNode | Record>(\n value: T\n): Node {\n if (Array.isArray(value)) {\n return new ArrayTreeNode(value)\n }\n\n return new ObjectTreeNode(value) as Node\n}\n\nconst keysMap = new WeakMap<\n Array | Record,\n Set\n>()\n\nexport function updateNode | Record>(\n node: Node,\n newValue: T\n): void {\n const { value, tags, children } = node\n\n node.value = newValue\n\n if (\n Array.isArray(value) &&\n Array.isArray(newValue) &&\n value.length !== newValue.length\n ) {\n dirtyCollection(node)\n } else {\n if (value !== newValue) {\n let oldKeysSize = 0\n let newKeysSize = 0\n let anyKeysAdded = false\n\n for (const _key in value) {\n oldKeysSize++\n }\n\n for (const key in newValue) {\n newKeysSize++\n if (!(key in value)) {\n anyKeysAdded = true\n break\n }\n }\n\n const isDifferent = anyKeysAdded || oldKeysSize !== newKeysSize\n\n if (isDifferent) {\n dirtyCollection(node)\n }\n }\n }\n\n for (const key in tags) {\n const childValue = (value as Record)[key]\n const newChildValue = (newValue as Record)[key]\n\n if (childValue !== newChildValue) {\n dirtyCollection(node)\n dirtyTag(tags[key], newChildValue)\n }\n\n if (typeof newChildValue === 'object' && newChildValue !== null) {\n delete tags[key]\n }\n }\n\n for (const key in children) {\n const childNode = children[key]\n const newChildValue = (newValue as Record)[key]\n\n const childValue = childNode.value\n\n if (childValue === newChildValue) {\n continue\n } else if (typeof newChildValue === 'object' && newChildValue !== null) {\n updateNode(childNode, newChildValue as Record)\n } else {\n deleteNode(childNode)\n delete children[key]\n }\n }\n}\n\nfunction deleteNode(node: Node): void {\n if (node.tag) {\n dirtyTag(node.tag, null)\n }\n dirtyCollection(node)\n for (const key in node.tags) {\n dirtyTag(node.tags[key], null)\n }\n for (const key in node.children) {\n deleteNode(node.children[key])\n }\n}\n","// Original source:\n// - https://github.com/facebook/react/blob/0b974418c9a56f6c560298560265dcf4b65784bc/packages/react/src/ReactCache.js\n\nimport type {\n AnyFunction,\n DefaultMemoizeFields,\n EqualityFn,\n Simplify\n} from './types'\n\nclass StrongRef {\n constructor(private value: T) {}\n deref() {\n return this.value\n }\n}\n\nconst Ref =\n typeof WeakRef !== 'undefined'\n ? WeakRef\n : (StrongRef as unknown as typeof WeakRef)\n\nconst UNTERMINATED = 0\nconst TERMINATED = 1\n\ninterface UnterminatedCacheNode {\n /**\n * Status, represents whether the cached computation returned a value or threw an error.\n */\n s: 0\n /**\n * Value, either the cached result or an error, depending on status.\n */\n v: void\n /**\n * Object cache, a `WeakMap` where non-primitive arguments are stored.\n */\n o: null | WeakMap>\n /**\n * Primitive cache, a regular Map where primitive arguments are stored.\n */\n p: null | Map>\n}\n\ninterface TerminatedCacheNode {\n /**\n * Status, represents whether the cached computation returned a value or threw an error.\n */\n s: 1\n /**\n * Value, either the cached result or an error, depending on status.\n */\n v: T\n /**\n * Object cache, a `WeakMap` where non-primitive arguments are stored.\n */\n o: null | WeakMap>\n /**\n * Primitive cache, a regular `Map` where primitive arguments are stored.\n */\n p: null | Map>\n}\n\ntype CacheNode = TerminatedCacheNode | UnterminatedCacheNode\n\nfunction createCacheNode(): CacheNode {\n return {\n s: UNTERMINATED,\n v: undefined,\n o: null,\n p: null\n }\n}\n\n/**\n * Configuration options for a memoization function utilizing `WeakMap` for\n * its caching mechanism.\n *\n * @template Result - The type of the return value of the memoized function.\n *\n * @since 5.0.0\n * @public\n */\nexport interface WeakMapMemoizeOptions {\n /**\n * If provided, used to compare a newly generated output value against previous values in the cache.\n * If a match is found, the old value is returned. This addresses the common\n * ```ts\n * todos.map(todo => todo.id)\n * ```\n * use case, where an update to another field in the original data causes a recalculation\n * due to changed references, but the output is still effectively the same.\n *\n * @since 5.0.0\n */\n resultEqualityCheck?: EqualityFn\n}\n\n/**\n * Creates a tree of `WeakMap`-based cache nodes based on the identity of the\n * arguments it's been called with (in this case, the extracted values from your input selectors).\n * This allows `weakMapMemoize` to have an effectively infinite cache size.\n * Cache results will be kept in memory as long as references to the arguments still exist,\n * and then cleared out as the arguments are garbage-collected.\n *\n * __Design Tradeoffs for `weakMapMemoize`:__\n * - Pros:\n * - It has an effectively infinite cache size, but you have no control over\n * how long values are kept in cache as it's based on garbage collection and `WeakMap`s.\n * - Cons:\n * - There's currently no way to alter the argument comparisons.\n * They're based on strict reference equality.\n * - It's roughly the same speed as `lruMemoize`, although likely a fraction slower.\n *\n * __Use Cases for `weakMapMemoize`:__\n * - This memoizer is likely best used for cases where you need to call the\n * same selector instance with many different arguments, such as a single\n * selector instance that is used in a list item component and called with\n * item IDs like:\n * ```ts\n * useSelector(state => selectSomeData(state, props.category))\n * ```\n * @param func - The function to be memoized.\n * @returns A memoized function with a `.clearCache()` method attached.\n *\n * @example\n * Using `createSelector`\n * ```ts\n * import { createSelector, weakMapMemoize } from 'reselect'\n *\n * interface RootState {\n * items: { id: number; category: string; name: string }[]\n * }\n *\n * const selectItemsByCategory = createSelector(\n * [\n * (state: RootState) => state.items,\n * (state: RootState, category: string) => category\n * ],\n * (items, category) => items.filter(item => item.category === category),\n * {\n * memoize: weakMapMemoize,\n * argsMemoize: weakMapMemoize\n * }\n * )\n * ```\n *\n * @example\n * Using `createSelectorCreator`\n * ```ts\n * import { createSelectorCreator, weakMapMemoize } from 'reselect'\n *\n * const createSelectorWeakMap = createSelectorCreator({ memoize: weakMapMemoize, argsMemoize: weakMapMemoize })\n *\n * const selectItemsByCategory = createSelectorWeakMap(\n * [\n * (state: RootState) => state.items,\n * (state: RootState, category: string) => category\n * ],\n * (items, category) => items.filter(item => item.category === category)\n * )\n * ```\n *\n * @template Func - The type of the function that is memoized.\n *\n * @see {@link https://reselect.js.org/api/weakMapMemoize `weakMapMemoize`}\n *\n * @since 5.0.0\n * @public\n * @experimental\n */\nexport function weakMapMemoize(\n func: Func,\n options: WeakMapMemoizeOptions> = {}\n) {\n let fnNode = createCacheNode()\n const { resultEqualityCheck } = options\n\n let lastResult: WeakRef | undefined\n\n let resultsCount = 0\n\n function memoized() {\n let cacheNode = fnNode\n const { length } = arguments\n for (let i = 0, l = length; i < l; i++) {\n const arg = arguments[i]\n if (\n typeof arg === 'function' ||\n (typeof arg === 'object' && arg !== null)\n ) {\n // Objects go into a WeakMap\n let objectCache = cacheNode.o\n if (objectCache === null) {\n cacheNode.o = objectCache = new WeakMap()\n }\n const objectNode = objectCache.get(arg)\n if (objectNode === undefined) {\n cacheNode = createCacheNode()\n objectCache.set(arg, cacheNode)\n } else {\n cacheNode = objectNode\n }\n } else {\n // Primitives go into a regular Map\n let primitiveCache = cacheNode.p\n if (primitiveCache === null) {\n cacheNode.p = primitiveCache = new Map()\n }\n const primitiveNode = primitiveCache.get(arg)\n if (primitiveNode === undefined) {\n cacheNode = createCacheNode()\n primitiveCache.set(arg, cacheNode)\n } else {\n cacheNode = primitiveNode\n }\n }\n }\n\n const terminatedNode = cacheNode as unknown as TerminatedCacheNode\n\n let result\n\n if (cacheNode.s === TERMINATED) {\n result = cacheNode.v\n } else {\n // Allow errors to propagate\n result = func.apply(null, arguments as unknown as any[])\n resultsCount++\n }\n\n terminatedNode.s = TERMINATED\n\n if (resultEqualityCheck) {\n const lastResultValue = lastResult?.deref?.() ?? lastResult\n if (\n lastResultValue != null &&\n resultEqualityCheck(lastResultValue as ReturnType, result)\n ) {\n result = lastResultValue\n resultsCount !== 0 && resultsCount--\n }\n\n const needsWeakRef =\n (typeof result === 'object' && result !== null) ||\n typeof result === 'function'\n lastResult = needsWeakRef ? new Ref(result) : result\n }\n terminatedNode.v = result\n return result\n }\n\n memoized.clearCache = () => {\n fnNode = createCacheNode()\n memoized.resetResultsCount()\n }\n\n memoized.resultsCount = () => resultsCount\n\n memoized.resetResultsCount = () => {\n resultsCount = 0\n }\n\n return memoized as Func & Simplify\n}\n","import { weakMapMemoize } from './weakMapMemoize'\n\nimport type {\n Combiner,\n CreateSelectorOptions,\n DropFirstParameter,\n ExtractMemoizerFields,\n GetParamsFromSelectors,\n GetStateFromSelectors,\n InterruptRecursion,\n OutputSelector,\n Selector,\n SelectorArray,\n SetRequired,\n Simplify,\n UnknownMemoizer\n} from './types'\n\nimport {\n assertIsFunction,\n collectInputSelectorResults,\n ensureIsArray,\n getDependencies,\n getDevModeChecksExecutionInfo\n} from './utils'\n\n/**\n * An instance of `createSelector`, customized with a given memoize implementation.\n *\n * @template MemoizeFunction - The type of the memoize function that is used to memoize the `resultFunc` inside `createSelector` (e.g., `lruMemoize` or `weakMapMemoize`).\n * @template ArgsMemoizeFunction - The type of the optional memoize function that is used to memoize the arguments passed into the output selector generated by `createSelector` (e.g., `lruMemoize` or `weakMapMemoize`). If none is explicitly provided, `weakMapMemoize` will be used.\n * @template StateType - The type of state that the selectors created with this selector creator will operate on.\n *\n * @public\n */\nexport interface CreateSelectorFunction<\n MemoizeFunction extends UnknownMemoizer = typeof weakMapMemoize,\n ArgsMemoizeFunction extends UnknownMemoizer = typeof weakMapMemoize,\n StateType = any\n> {\n /**\n * Creates a memoized selector function.\n *\n * @param createSelectorArgs - An arbitrary number of input selectors as separate inline arguments and a `combiner` function.\n * @returns A memoized output selector.\n *\n * @template InputSelectors - The type of the input selectors as an array.\n * @template Result - The return type of the `combiner` as well as the output selector.\n * @template OverrideMemoizeFunction - The type of the optional `memoize` function that could be passed into the options object to override the original `memoize` function that was initially passed into `createSelectorCreator`.\n * @template OverrideArgsMemoizeFunction - The type of the optional `argsMemoize` function that could be passed into the options object to override the original `argsMemoize` function that was initially passed into `createSelectorCreator`.\n *\n * @see {@link https://reselect.js.org/api/createselector `createSelector`}\n */\n , Result>(\n ...createSelectorArgs: [\n ...inputSelectors: InputSelectors,\n combiner: Combiner\n ]\n ): OutputSelector<\n InputSelectors,\n Result,\n MemoizeFunction,\n ArgsMemoizeFunction\n > &\n InterruptRecursion\n\n /**\n * Creates a memoized selector function.\n *\n * @param createSelectorArgs - An arbitrary number of input selectors as separate inline arguments, a `combiner` function and an `options` object.\n * @returns A memoized output selector.\n *\n * @template InputSelectors - The type of the input selectors as an array.\n * @template Result - The return type of the `combiner` as well as the output selector.\n * @template OverrideMemoizeFunction - The type of the optional `memoize` function that could be passed into the options object to override the original `memoize` function that was initially passed into `createSelectorCreator`.\n * @template OverrideArgsMemoizeFunction - The type of the optional `argsMemoize` function that could be passed into the options object to override the original `argsMemoize` function that was initially passed into `createSelectorCreator`.\n *\n * @see {@link https://reselect.js.org/api/createselector `createSelector`}\n */\n <\n InputSelectors extends SelectorArray,\n Result,\n OverrideMemoizeFunction extends UnknownMemoizer = MemoizeFunction,\n OverrideArgsMemoizeFunction extends UnknownMemoizer = ArgsMemoizeFunction\n >(\n ...createSelectorArgs: [\n ...inputSelectors: InputSelectors,\n combiner: Combiner,\n createSelectorOptions: Simplify<\n CreateSelectorOptions<\n MemoizeFunction,\n ArgsMemoizeFunction,\n OverrideMemoizeFunction,\n OverrideArgsMemoizeFunction\n >\n >\n ]\n ): OutputSelector<\n InputSelectors,\n Result,\n OverrideMemoizeFunction,\n OverrideArgsMemoizeFunction\n > &\n InterruptRecursion\n\n /**\n * Creates a memoized selector function.\n *\n * @param inputSelectors - An array of input selectors.\n * @param combiner - A function that Combines the input selectors and returns an output selector. Otherwise known as the result function.\n * @param createSelectorOptions - An optional options object that allows for further customization per selector.\n * @returns A memoized output selector.\n *\n * @template InputSelectors - The type of the input selectors array.\n * @template Result - The return type of the `combiner` as well as the output selector.\n * @template OverrideMemoizeFunction - The type of the optional `memoize` function that could be passed into the options object to override the original `memoize` function that was initially passed into `createSelectorCreator`.\n * @template OverrideArgsMemoizeFunction - The type of the optional `argsMemoize` function that could be passed into the options object to override the original `argsMemoize` function that was initially passed into `createSelectorCreator`.\n *\n * @see {@link https://reselect.js.org/api/createselector `createSelector`}\n */\n <\n InputSelectors extends SelectorArray,\n Result,\n OverrideMemoizeFunction extends UnknownMemoizer = MemoizeFunction,\n OverrideArgsMemoizeFunction extends UnknownMemoizer = ArgsMemoizeFunction\n >(\n inputSelectors: [...InputSelectors],\n combiner: Combiner,\n createSelectorOptions?: Simplify<\n CreateSelectorOptions<\n MemoizeFunction,\n ArgsMemoizeFunction,\n OverrideMemoizeFunction,\n OverrideArgsMemoizeFunction\n >\n >\n ): OutputSelector<\n InputSelectors,\n Result,\n OverrideMemoizeFunction,\n OverrideArgsMemoizeFunction\n > &\n InterruptRecursion\n\n /**\n * Creates a \"pre-typed\" version of {@linkcode createSelector createSelector}\n * where the `state` type is predefined.\n *\n * This allows you to set the `state` type once, eliminating the need to\n * specify it with every {@linkcode createSelector createSelector} call.\n *\n * @returns A pre-typed `createSelector` with the state type already defined.\n *\n * @example\n * ```ts\n * import { createSelector } from 'reselect'\n *\n * export interface RootState {\n * todos: { id: number; completed: boolean }[]\n * alerts: { id: number; read: boolean }[]\n * }\n *\n * export const createAppSelector = createSelector.withTypes()\n *\n * const selectTodoIds = createAppSelector(\n * [\n * // Type of `state` is set to `RootState`, no need to manually set the type\n * state => state.todos\n * ],\n * todos => todos.map(({ id }) => id)\n * )\n * ```\n * @template OverrideStateType - The specific type of state used by all selectors created with this selector creator.\n *\n * @see {@link https://reselect.js.org/api/createselector#defining-a-pre-typed-createselector `createSelector.withTypes`}\n *\n * @since 5.1.0\n */\n withTypes: () => CreateSelectorFunction<\n MemoizeFunction,\n ArgsMemoizeFunction,\n OverrideStateType\n >\n}\n\n/**\n * Creates a selector creator function with the specified memoization function\n * and options for customizing memoization behavior.\n *\n * @param options - An options object containing the `memoize` function responsible for memoizing the `resultFunc` inside `createSelector` (e.g., `lruMemoize` or `weakMapMemoize`). It also provides additional options for customizing memoization. While the `memoize` property is mandatory, the rest are optional.\n * @returns A customized `createSelector` function.\n *\n * @example\n * ```ts\n * const customCreateSelector = createSelectorCreator({\n * memoize: customMemoize, // Function to be used to memoize `resultFunc`\n * memoizeOptions: [memoizeOption1, memoizeOption2], // Options passed to `customMemoize` as the second argument onwards\n * argsMemoize: customArgsMemoize, // Function to be used to memoize the selector's arguments\n * argsMemoizeOptions: [argsMemoizeOption1, argsMemoizeOption2] // Options passed to `customArgsMemoize` as the second argument onwards\n * })\n *\n * const customSelector = customCreateSelector(\n * [inputSelector1, inputSelector2],\n * resultFunc // `resultFunc` will be passed as the first argument to `customMemoize`\n * )\n *\n * customSelector(\n * ...selectorArgs // Will be memoized by `customArgsMemoize`\n * )\n * ```\n *\n * @template MemoizeFunction - The type of the memoize function that is used to memoize the `resultFunc` inside `createSelector` (e.g., `lruMemoize` or `weakMapMemoize`).\n * @template ArgsMemoizeFunction - The type of the optional memoize function that is used to memoize the arguments passed into the output selector generated by `createSelector` (e.g., `lruMemoize` or `weakMapMemoize`). If none is explicitly provided, `weakMapMemoize` will be used.\n *\n * @see {@link https://reselect.js.org/api/createSelectorCreator#using-options-since-500 `createSelectorCreator`}\n *\n * @since 5.0.0\n * @public\n */\nexport function createSelectorCreator<\n MemoizeFunction extends UnknownMemoizer,\n ArgsMemoizeFunction extends UnknownMemoizer = typeof weakMapMemoize\n>(\n options: Simplify<\n SetRequired<\n CreateSelectorOptions<\n typeof weakMapMemoize,\n typeof weakMapMemoize,\n MemoizeFunction,\n ArgsMemoizeFunction\n >,\n 'memoize'\n >\n >\n): CreateSelectorFunction\n\n/**\n * Creates a selector creator function with the specified memoization function\n * and options for customizing memoization behavior.\n *\n * @param memoize - The `memoize` function responsible for memoizing the `resultFunc` inside `createSelector` (e.g., `lruMemoize` or `weakMapMemoize`).\n * @param memoizeOptionsFromArgs - Optional configuration options for the memoization function. These options are then passed to the memoize function as the second argument onwards.\n * @returns A customized `createSelector` function.\n *\n * @example\n * ```ts\n * const customCreateSelector = createSelectorCreator(customMemoize, // Function to be used to memoize `resultFunc`\n * option1, // Will be passed as second argument to `customMemoize`\n * option2, // Will be passed as third argument to `customMemoize`\n * option3 // Will be passed as fourth argument to `customMemoize`\n * )\n *\n * const customSelector = customCreateSelector(\n * [inputSelector1, inputSelector2],\n * resultFunc // `resultFunc` will be passed as the first argument to `customMemoize`\n * )\n * ```\n *\n * @template MemoizeFunction - The type of the memoize function that is used to memoize the `resultFunc` inside `createSelector` (e.g., `lruMemoize` or `weakMapMemoize`).\n *\n * @see {@link https://reselect.js.org/api/createSelectorCreator#using-memoize-and-memoizeoptions `createSelectorCreator`}\n *\n * @public\n */\nexport function createSelectorCreator(\n memoize: MemoizeFunction,\n ...memoizeOptionsFromArgs: DropFirstParameter\n): CreateSelectorFunction\n\n/**\n * Creates a selector creator function with the specified memoization\n * function and options for customizing memoization behavior.\n *\n * @param memoizeOrOptions - Either A `memoize` function or an `options` object containing the `memoize` function.\n * @param memoizeOptionsFromArgs - Optional configuration options for the memoization function. These options are then passed to the memoize function as the second argument onwards.\n * @returns A customized `createSelector` function.\n *\n * @template MemoizeFunction - The type of the memoize function that is used to memoize the `resultFunc` inside `createSelector` (e.g., `lruMemoize` or `weakMapMemoize`).\n * @template ArgsMemoizeFunction - The type of the optional memoize function that is used to memoize the arguments passed into the output selector generated by `createSelector` (e.g., `lruMemoize` or `weakMapMemoize`). If none is explicitly provided, `weakMapMemoize` will be used.\n * @template MemoizeOrOptions - The type of the first argument. It can either be a `memoize` function or an `options` object containing the `memoize` function.\n */\nexport function createSelectorCreator<\n MemoizeFunction extends UnknownMemoizer,\n ArgsMemoizeFunction extends UnknownMemoizer,\n MemoizeOrOptions extends\n | MemoizeFunction\n | SetRequired<\n CreateSelectorOptions,\n 'memoize'\n >\n>(\n memoizeOrOptions: MemoizeOrOptions,\n ...memoizeOptionsFromArgs: MemoizeOrOptions extends SetRequired<\n CreateSelectorOptions,\n 'memoize'\n >\n ? never\n : DropFirstParameter\n) {\n /** options initially passed into `createSelectorCreator`. */\n const createSelectorCreatorOptions: SetRequired<\n CreateSelectorOptions,\n 'memoize'\n > = typeof memoizeOrOptions === 'function'\n ? {\n memoize: memoizeOrOptions as MemoizeFunction,\n memoizeOptions: memoizeOptionsFromArgs\n }\n : memoizeOrOptions\n\n const createSelector = <\n InputSelectors extends SelectorArray,\n Result,\n OverrideMemoizeFunction extends UnknownMemoizer = MemoizeFunction,\n OverrideArgsMemoizeFunction extends UnknownMemoizer = ArgsMemoizeFunction\n >(\n ...createSelectorArgs: [\n ...inputSelectors: [...InputSelectors],\n combiner: Combiner,\n createSelectorOptions?: CreateSelectorOptions<\n MemoizeFunction,\n ArgsMemoizeFunction,\n OverrideMemoizeFunction,\n OverrideArgsMemoizeFunction\n >\n ]\n ) => {\n let recomputations = 0\n let dependencyRecomputations = 0\n let lastResult: Result\n\n // Due to the intricacies of rest params, we can't do an optional arg after `...createSelectorArgs`.\n // So, start by declaring the default value here.\n // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.)\n let directlyPassedOptions: CreateSelectorOptions<\n MemoizeFunction,\n ArgsMemoizeFunction,\n OverrideMemoizeFunction,\n OverrideArgsMemoizeFunction\n > = {}\n\n // Normally, the result func or \"combiner\" is the last arg\n let resultFunc = createSelectorArgs.pop() as\n | Combiner\n | CreateSelectorOptions<\n MemoizeFunction,\n ArgsMemoizeFunction,\n OverrideMemoizeFunction,\n OverrideArgsMemoizeFunction\n >\n\n // If the result func is actually an _object_, assume it's our options object\n if (typeof resultFunc === 'object') {\n directlyPassedOptions = resultFunc\n // and pop the real result func off\n resultFunc = createSelectorArgs.pop() as Combiner\n }\n\n assertIsFunction(\n resultFunc,\n `createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]`\n )\n\n // Determine which set of options we're using. Prefer options passed directly,\n // but fall back to options given to `createSelectorCreator`.\n const combinedOptions = {\n ...createSelectorCreatorOptions,\n ...directlyPassedOptions\n }\n\n const {\n memoize,\n memoizeOptions = [],\n argsMemoize = weakMapMemoize,\n argsMemoizeOptions = [],\n devModeChecks = {}\n } = combinedOptions\n\n // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer\n // is an array. In most libs I've looked at, it's an equality function or options object.\n // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full\n // user-provided array of options. Otherwise, it must be just the _first_ arg, and so\n // we wrap it in an array so we can apply it.\n const finalMemoizeOptions = ensureIsArray(memoizeOptions)\n const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions)\n const dependencies = getDependencies(createSelectorArgs) as InputSelectors\n\n const memoizedResultFunc = memoize(function recomputationWrapper() {\n recomputations++\n // apply arguments instead of spreading for performance.\n // @ts-ignore\n return (resultFunc as Combiner).apply(\n null,\n arguments\n )\n }, ...finalMemoizeOptions) as Combiner &\n ExtractMemoizerFields\n\n let firstRun = true\n\n // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.\n const selector = argsMemoize(function dependenciesChecker() {\n dependencyRecomputations++\n /** Return values of input selectors which the `resultFunc` takes as arguments. */\n const inputSelectorResults = collectInputSelectorResults(\n dependencies,\n arguments\n )\n\n // apply arguments instead of spreading for performance.\n // @ts-ignore\n lastResult = memoizedResultFunc.apply(null, inputSelectorResults)\n\n if (process.env.NODE_ENV !== 'production') {\n const { identityFunctionCheck, inputStabilityCheck } =\n getDevModeChecksExecutionInfo(firstRun, devModeChecks)\n if (identityFunctionCheck.shouldRun) {\n identityFunctionCheck.run(\n resultFunc as Combiner,\n inputSelectorResults,\n lastResult\n )\n }\n\n if (inputStabilityCheck.shouldRun) {\n // make a second copy of the params, to check if we got the same results\n const inputSelectorResultsCopy = collectInputSelectorResults(\n dependencies,\n arguments\n )\n\n inputStabilityCheck.run(\n { inputSelectorResults, inputSelectorResultsCopy },\n { memoize, memoizeOptions: finalMemoizeOptions },\n arguments\n )\n }\n\n if (firstRun) firstRun = false\n }\n\n return lastResult\n }, ...finalArgsMemoizeOptions) as unknown as Selector<\n GetStateFromSelectors,\n Result,\n GetParamsFromSelectors\n > &\n ExtractMemoizerFields\n\n return Object.assign(selector, {\n resultFunc,\n memoizedResultFunc,\n dependencies,\n dependencyRecomputations: () => dependencyRecomputations,\n resetDependencyRecomputations: () => {\n dependencyRecomputations = 0\n },\n lastResult: () => lastResult,\n recomputations: () => recomputations,\n resetRecomputations: () => {\n recomputations = 0\n },\n memoize,\n argsMemoize\n }) as OutputSelector<\n InputSelectors,\n Result,\n OverrideMemoizeFunction,\n OverrideArgsMemoizeFunction\n >\n }\n\n Object.assign(createSelector, {\n withTypes: () => createSelector\n })\n\n return createSelector as CreateSelectorFunction<\n MemoizeFunction,\n ArgsMemoizeFunction\n >\n}\n\n/**\n * Accepts one or more \"input selectors\" (either as separate arguments or a single array),\n * a single \"result function\" / \"combiner\", and an optional options object, and\n * generates a memoized selector function.\n *\n * @see {@link https://reselect.js.org/api/createSelector `createSelector`}\n *\n * @public\n */\nexport const createSelector =\n /* #__PURE__ */ createSelectorCreator(weakMapMemoize)\n","import { createSelector } from './createSelectorCreator'\n\nimport type { CreateSelectorFunction } from './createSelectorCreator'\nimport type {\n InterruptRecursion,\n ObjectValuesToTuple,\n OutputSelector,\n Selector,\n Simplify,\n UnknownMemoizer\n} from './types'\nimport { assertIsObject } from './utils'\nimport type { weakMapMemoize } from './weakMapMemoize'\n\n/**\n * Represents a mapping of selectors to their return types.\n *\n * @template TObject - An object type where each property is a selector function.\n *\n * @public\n */\nexport type SelectorResultsMap = {\n [Key in keyof TObject]: ReturnType\n}\n\n/**\n * Represents a mapping of selectors for each key in a given root state.\n *\n * This type is a utility that takes a root state object type and\n * generates a corresponding set of selectors. Each selector is associated\n * with a key in the root state, allowing for the selection\n * of specific parts of the state.\n *\n * @template RootState - The type of the root state object.\n *\n * @since 5.0.0\n * @public\n */\nexport type RootStateSelectors = {\n [Key in keyof RootState]: Selector\n}\n\n/**\n * @deprecated Please use {@linkcode StructuredSelectorCreator.withTypes createStructuredSelector.withTypes()} instead. This type will be removed in the future.\n * @template RootState - The type of the root state object.\n *\n * @since 5.0.0\n * @public\n */\nexport type TypedStructuredSelectorCreator =\n /**\n * A convenience function that simplifies returning an object\n * made up of selector results.\n *\n * @param inputSelectorsObject - A key value pair consisting of input selectors.\n * @param selectorCreator - A custom selector creator function. It defaults to `createSelector`.\n * @returns A memoized structured selector.\n *\n * @example\n * Modern Use Case\n * ```ts\n * import { createSelector, createStructuredSelector } from 'reselect'\n *\n * interface RootState {\n * todos: {\n * id: number\n * completed: boolean\n * title: string\n * description: string\n * }[]\n * alerts: { id: number; read: boolean }[]\n * }\n *\n * // This:\n * const structuredSelector = createStructuredSelector(\n * {\n * todos: (state: RootState) => state.todos,\n * alerts: (state: RootState) => state.alerts,\n * todoById: (state: RootState, id: number) => state.todos[id]\n * },\n * createSelector\n * )\n *\n * // Is essentially the same as this:\n * const selector = createSelector(\n * [\n * (state: RootState) => state.todos,\n * (state: RootState) => state.alerts,\n * (state: RootState, id: number) => state.todos[id]\n * ],\n * (todos, alerts, todoById) => {\n * return {\n * todos,\n * alerts,\n * todoById\n * }\n * }\n * )\n * ```\n *\n * @example\n * In your component:\n * ```tsx\n * import type { RootState } from 'createStructuredSelector/modernUseCase'\n * import { structuredSelector } from 'createStructuredSelector/modernUseCase'\n * import type { FC } from 'react'\n * import { useSelector } from 'react-redux'\n *\n * interface Props {\n * id: number\n * }\n *\n * const MyComponent: FC = ({ id }) => {\n * const { todos, alerts, todoById } = useSelector((state: RootState) =>\n * structuredSelector(state, id)\n * )\n *\n * return (\n *
\n * Next to do is:\n *

{todoById.title}

\n *

Description: {todoById.description}

\n *
    \n *

    All other to dos:

    \n * {todos.map(todo => (\n *
  • {todo.title}
  • \n * ))}\n *
\n *
\n * )\n * }\n * ```\n *\n * @example\n * Simple Use Case\n * ```ts\n * const selectA = state => state.a\n * const selectB = state => state.b\n *\n * // The result function in the following selector\n * // is simply building an object from the input selectors\n * const structuredSelector = createSelector(selectA, selectB, (a, b) => ({\n * a,\n * b\n * }))\n *\n * const result = structuredSelector({ a: 1, b: 2 }) // will produce { x: 1, y: 2 }\n * ```\n *\n * @template InputSelectorsObject - The shape of the input selectors object.\n * @template MemoizeFunction - The type of the memoize function that is used to create the structured selector. It defaults to `weakMapMemoize`.\n * @template ArgsMemoizeFunction - The type of the of the memoize function that is used to memoize the arguments passed into the generated structured selector. It defaults to `weakMapMemoize`.\n *\n * @see {@link https://reselect.js.org/api/createStructuredSelector `createStructuredSelector`}\n */\n <\n InputSelectorsObject extends RootStateSelectors = RootStateSelectors,\n MemoizeFunction extends UnknownMemoizer = typeof weakMapMemoize,\n ArgsMemoizeFunction extends UnknownMemoizer = typeof weakMapMemoize\n >(\n inputSelectorsObject: InputSelectorsObject,\n selectorCreator?: CreateSelectorFunction<\n MemoizeFunction,\n ArgsMemoizeFunction\n >\n ) => OutputSelector<\n ObjectValuesToTuple,\n Simplify>,\n MemoizeFunction,\n ArgsMemoizeFunction\n > &\n InterruptRecursion\n\n/**\n * Represents an object where each property is a selector function.\n *\n * @template StateType - The type of state that all the selectors operate on.\n *\n * @public\n */\nexport type SelectorsObject = Record<\n string,\n Selector\n>\n\n/**\n * It provides a way to create structured selectors.\n * The structured selector can take multiple input selectors\n * and map their output to an object with specific keys.\n *\n * @template StateType - The type of state that the structured selectors created with this structured selector creator will operate on.\n *\n * @see {@link https://reselect.js.org/api/createStructuredSelector `createStructuredSelector`}\n *\n * @public\n */\nexport interface StructuredSelectorCreator {\n /**\n * A convenience function that simplifies returning an object\n * made up of selector results.\n *\n * @param inputSelectorsObject - A key value pair consisting of input selectors.\n * @param selectorCreator - A custom selector creator function. It defaults to `createSelector`.\n * @returns A memoized structured selector.\n *\n * @example\n * Modern Use Case\n * ```ts\n * import { createSelector, createStructuredSelector } from 'reselect'\n *\n * interface RootState {\n * todos: {\n * id: number\n * completed: boolean\n * title: string\n * description: string\n * }[]\n * alerts: { id: number; read: boolean }[]\n * }\n *\n * // This:\n * const structuredSelector = createStructuredSelector(\n * {\n * todos: (state: RootState) => state.todos,\n * alerts: (state: RootState) => state.alerts,\n * todoById: (state: RootState, id: number) => state.todos[id]\n * },\n * createSelector\n * )\n *\n * // Is essentially the same as this:\n * const selector = createSelector(\n * [\n * (state: RootState) => state.todos,\n * (state: RootState) => state.alerts,\n * (state: RootState, id: number) => state.todos[id]\n * ],\n * (todos, alerts, todoById) => {\n * return {\n * todos,\n * alerts,\n * todoById\n * }\n * }\n * )\n * ```\n *\n * @example\n * In your component:\n * ```tsx\n * import type { RootState } from 'createStructuredSelector/modernUseCase'\n * import { structuredSelector } from 'createStructuredSelector/modernUseCase'\n * import type { FC } from 'react'\n * import { useSelector } from 'react-redux'\n *\n * interface Props {\n * id: number\n * }\n *\n * const MyComponent: FC = ({ id }) => {\n * const { todos, alerts, todoById } = useSelector((state: RootState) =>\n * structuredSelector(state, id)\n * )\n *\n * return (\n *
\n * Next to do is:\n *

{todoById.title}

\n *

Description: {todoById.description}

\n *
    \n *

    All other to dos:

    \n * {todos.map(todo => (\n *
  • {todo.title}
  • \n * ))}\n *
\n *
\n * )\n * }\n * ```\n *\n * @example\n * Simple Use Case\n * ```ts\n * const selectA = state => state.a\n * const selectB = state => state.b\n *\n * // The result function in the following selector\n * // is simply building an object from the input selectors\n * const structuredSelector = createSelector(selectA, selectB, (a, b) => ({\n * a,\n * b\n * }))\n *\n * const result = structuredSelector({ a: 1, b: 2 }) // will produce { x: 1, y: 2 }\n * ```\n *\n * @template InputSelectorsObject - The shape of the input selectors object.\n * @template MemoizeFunction - The type of the memoize function that is used to create the structured selector. It defaults to `weakMapMemoize`.\n * @template ArgsMemoizeFunction - The type of the of the memoize function that is used to memoize the arguments passed into the generated structured selector. It defaults to `weakMapMemoize`.\n *\n * @see {@link https://reselect.js.org/api/createStructuredSelector `createStructuredSelector`}\n */\n <\n InputSelectorsObject extends SelectorsObject,\n MemoizeFunction extends UnknownMemoizer = typeof weakMapMemoize,\n ArgsMemoizeFunction extends UnknownMemoizer = typeof weakMapMemoize\n >(\n inputSelectorsObject: InputSelectorsObject,\n selectorCreator?: CreateSelectorFunction<\n MemoizeFunction,\n ArgsMemoizeFunction\n >\n ): OutputSelector<\n ObjectValuesToTuple,\n Simplify>,\n MemoizeFunction,\n ArgsMemoizeFunction\n > &\n InterruptRecursion\n\n /**\n * Creates a \"pre-typed\" version of\n * {@linkcode createStructuredSelector createStructuredSelector}\n * where the `state` type is predefined.\n *\n * This allows you to set the `state` type once, eliminating the need to\n * specify it with every\n * {@linkcode createStructuredSelector createStructuredSelector} call.\n *\n * @returns A pre-typed `createStructuredSelector` with the state type already defined.\n *\n * @example\n * ```ts\n * import { createStructuredSelector } from 'reselect'\n *\n * export interface RootState {\n * todos: { id: number; completed: boolean }[]\n * alerts: { id: number; read: boolean }[]\n * }\n *\n * export const createStructuredAppSelector =\n * createStructuredSelector.withTypes()\n *\n * const structuredAppSelector = createStructuredAppSelector({\n * // Type of `state` is set to `RootState`, no need to manually set the type\n * todos: state => state.todos,\n * alerts: state => state.alerts,\n * todoById: (state, id: number) => state.todos[id]\n * })\n *\n * ```\n * @template OverrideStateType - The specific type of state used by all structured selectors created with this structured selector creator.\n *\n * @see {@link https://reselect.js.org/api/createstructuredselector#defining-a-pre-typed-createstructuredselector `createSelector.withTypes`}\n *\n * @since 5.1.0\n */\n withTypes: <\n OverrideStateType extends StateType\n >() => StructuredSelectorCreator\n}\n\n/**\n * A convenience function that simplifies returning an object\n * made up of selector results.\n *\n * @param inputSelectorsObject - A key value pair consisting of input selectors.\n * @param selectorCreator - A custom selector creator function. It defaults to `createSelector`.\n * @returns A memoized structured selector.\n *\n * @example\n * Modern Use Case\n * ```ts\n * import { createSelector, createStructuredSelector } from 'reselect'\n *\n * interface RootState {\n * todos: {\n * id: number\n * completed: boolean\n * title: string\n * description: string\n * }[]\n * alerts: { id: number; read: boolean }[]\n * }\n *\n * // This:\n * const structuredSelector = createStructuredSelector(\n * {\n * todos: (state: RootState) => state.todos,\n * alerts: (state: RootState) => state.alerts,\n * todoById: (state: RootState, id: number) => state.todos[id]\n * },\n * createSelector\n * )\n *\n * // Is essentially the same as this:\n * const selector = createSelector(\n * [\n * (state: RootState) => state.todos,\n * (state: RootState) => state.alerts,\n * (state: RootState, id: number) => state.todos[id]\n * ],\n * (todos, alerts, todoById) => {\n * return {\n * todos,\n * alerts,\n * todoById\n * }\n * }\n * )\n * ```\n *\n * @see {@link https://reselect.js.org/api/createStructuredSelector `createStructuredSelector`}\n *\n * @public\n */\nexport const createStructuredSelector: StructuredSelectorCreator =\n Object.assign(\n <\n InputSelectorsObject extends SelectorsObject,\n MemoizeFunction extends UnknownMemoizer = typeof weakMapMemoize,\n ArgsMemoizeFunction extends UnknownMemoizer = typeof weakMapMemoize\n >(\n inputSelectorsObject: InputSelectorsObject,\n selectorCreator: CreateSelectorFunction<\n MemoizeFunction,\n ArgsMemoizeFunction\n > = createSelector as CreateSelectorFunction<\n MemoizeFunction,\n ArgsMemoizeFunction\n >\n ) => {\n assertIsObject(\n inputSelectorsObject,\n 'createStructuredSelector expects first argument to be an object ' +\n `where each property is a selector, instead received a ${typeof inputSelectorsObject}`\n )\n const inputSelectorKeys = Object.keys(inputSelectorsObject)\n const dependencies = inputSelectorKeys.map(\n key => inputSelectorsObject[key]\n )\n const structuredSelector = selectorCreator(\n dependencies,\n (...inputSelectorResults: any[]) => {\n return inputSelectorResults.reduce((composition, value, index) => {\n composition[inputSelectorKeys[index]] = value\n return composition\n }, {})\n }\n )\n return structuredSelector\n },\n { withTypes: () => createStructuredSelector }\n ) as StructuredSelectorCreator\n","/**\r\n * A collection of shims that provide minimal functionality of the ES6 collections.\r\n *\r\n * These implementations are not meant to be used outside of the ResizeObserver\r\n * modules as they cover only a limited range of use cases.\r\n */\r\n/* eslint-disable require-jsdoc, valid-jsdoc */\r\nvar MapShim = (function () {\r\n if (typeof Map !== 'undefined') {\r\n return Map;\r\n }\r\n /**\r\n * Returns index in provided array that matches the specified key.\r\n *\r\n * @param {Array} arr\r\n * @param {*} key\r\n * @returns {number}\r\n */\r\n function getIndex(arr, key) {\r\n var result = -1;\r\n arr.some(function (entry, index) {\r\n if (entry[0] === key) {\r\n result = index;\r\n return true;\r\n }\r\n return false;\r\n });\r\n return result;\r\n }\r\n return /** @class */ (function () {\r\n function class_1() {\r\n this.__entries__ = [];\r\n }\r\n Object.defineProperty(class_1.prototype, \"size\", {\r\n /**\r\n * @returns {boolean}\r\n */\r\n get: function () {\r\n return this.__entries__.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @param {*} key\r\n * @returns {*}\r\n */\r\n class_1.prototype.get = function (key) {\r\n var index = getIndex(this.__entries__, key);\r\n var entry = this.__entries__[index];\r\n return entry && entry[1];\r\n };\r\n /**\r\n * @param {*} key\r\n * @param {*} value\r\n * @returns {void}\r\n */\r\n class_1.prototype.set = function (key, value) {\r\n var index = getIndex(this.__entries__, key);\r\n if (~index) {\r\n this.__entries__[index][1] = value;\r\n }\r\n else {\r\n this.__entries__.push([key, value]);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.delete = function (key) {\r\n var entries = this.__entries__;\r\n var index = getIndex(entries, key);\r\n if (~index) {\r\n entries.splice(index, 1);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.has = function (key) {\r\n return !!~getIndex(this.__entries__, key);\r\n };\r\n /**\r\n * @returns {void}\r\n */\r\n class_1.prototype.clear = function () {\r\n this.__entries__.splice(0);\r\n };\r\n /**\r\n * @param {Function} callback\r\n * @param {*} [ctx=null]\r\n * @returns {void}\r\n */\r\n class_1.prototype.forEach = function (callback, ctx) {\r\n if (ctx === void 0) { ctx = null; }\r\n for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {\r\n var entry = _a[_i];\r\n callback.call(ctx, entry[1], entry[0]);\r\n }\r\n };\r\n return class_1;\r\n }());\r\n})();\n\n/**\r\n * Detects whether window and document objects are available in current environment.\r\n */\r\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;\n\n// Returns global object of a current environment.\r\nvar global$1 = (function () {\r\n if (typeof global !== 'undefined' && global.Math === Math) {\r\n return global;\r\n }\r\n if (typeof self !== 'undefined' && self.Math === Math) {\r\n return self;\r\n }\r\n if (typeof window !== 'undefined' && window.Math === Math) {\r\n return window;\r\n }\r\n // eslint-disable-next-line no-new-func\r\n return Function('return this')();\r\n})();\n\n/**\r\n * A shim for the requestAnimationFrame which falls back to the setTimeout if\r\n * first one is not supported.\r\n *\r\n * @returns {number} Requests' identifier.\r\n */\r\nvar requestAnimationFrame$1 = (function () {\r\n if (typeof requestAnimationFrame === 'function') {\r\n // It's required to use a bounded function because IE sometimes throws\r\n // an \"Invalid calling object\" error if rAF is invoked without the global\r\n // object on the left hand side.\r\n return requestAnimationFrame.bind(global$1);\r\n }\r\n return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };\r\n})();\n\n// Defines minimum timeout before adding a trailing call.\r\nvar trailingTimeout = 2;\r\n/**\r\n * Creates a wrapper function which ensures that provided callback will be\r\n * invoked only once during the specified delay period.\r\n *\r\n * @param {Function} callback - Function to be invoked after the delay period.\r\n * @param {number} delay - Delay after which to invoke callback.\r\n * @returns {Function}\r\n */\r\nfunction throttle (callback, delay) {\r\n var leadingCall = false, trailingCall = false, lastCallTime = 0;\r\n /**\r\n * Invokes the original callback function and schedules new invocation if\r\n * the \"proxy\" was called during current request.\r\n *\r\n * @returns {void}\r\n */\r\n function resolvePending() {\r\n if (leadingCall) {\r\n leadingCall = false;\r\n callback();\r\n }\r\n if (trailingCall) {\r\n proxy();\r\n }\r\n }\r\n /**\r\n * Callback invoked after the specified delay. It will further postpone\r\n * invocation of the original function delegating it to the\r\n * requestAnimationFrame.\r\n *\r\n * @returns {void}\r\n */\r\n function timeoutCallback() {\r\n requestAnimationFrame$1(resolvePending);\r\n }\r\n /**\r\n * Schedules invocation of the original function.\r\n *\r\n * @returns {void}\r\n */\r\n function proxy() {\r\n var timeStamp = Date.now();\r\n if (leadingCall) {\r\n // Reject immediately following calls.\r\n if (timeStamp - lastCallTime < trailingTimeout) {\r\n return;\r\n }\r\n // Schedule new call to be in invoked when the pending one is resolved.\r\n // This is important for \"transitions\" which never actually start\r\n // immediately so there is a chance that we might miss one if change\r\n // happens amids the pending invocation.\r\n trailingCall = true;\r\n }\r\n else {\r\n leadingCall = true;\r\n trailingCall = false;\r\n setTimeout(timeoutCallback, delay);\r\n }\r\n lastCallTime = timeStamp;\r\n }\r\n return proxy;\r\n}\n\n// Minimum delay before invoking the update of observers.\r\nvar REFRESH_DELAY = 20;\r\n// A list of substrings of CSS properties used to find transition events that\r\n// might affect dimensions of observed elements.\r\nvar transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];\r\n// Check if MutationObserver is available.\r\nvar mutationObserverSupported = typeof MutationObserver !== 'undefined';\r\n/**\r\n * Singleton controller class which handles updates of ResizeObserver instances.\r\n */\r\nvar ResizeObserverController = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserverController.\r\n *\r\n * @private\r\n */\r\n function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }\r\n /**\r\n * Adds observer to observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be added.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.addObserver = function (observer) {\r\n if (!~this.observers_.indexOf(observer)) {\r\n this.observers_.push(observer);\r\n }\r\n // Add listeners if they haven't been added yet.\r\n if (!this.connected_) {\r\n this.connect_();\r\n }\r\n };\r\n /**\r\n * Removes observer from observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be removed.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.removeObserver = function (observer) {\r\n var observers = this.observers_;\r\n var index = observers.indexOf(observer);\r\n // Remove observer if it's present in registry.\r\n if (~index) {\r\n observers.splice(index, 1);\r\n }\r\n // Remove listeners if controller has no connected observers.\r\n if (!observers.length && this.connected_) {\r\n this.disconnect_();\r\n }\r\n };\r\n /**\r\n * Invokes the update of observers. It will continue running updates insofar\r\n * it detects changes.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.refresh = function () {\r\n var changesDetected = this.updateObservers_();\r\n // Continue running updates if changes have been detected as there might\r\n // be future ones caused by CSS transitions.\r\n if (changesDetected) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Updates every observer from observers list and notifies them of queued\r\n * entries.\r\n *\r\n * @private\r\n * @returns {boolean} Returns \"true\" if any observer has detected changes in\r\n * dimensions of it's elements.\r\n */\r\n ResizeObserverController.prototype.updateObservers_ = function () {\r\n // Collect observers that have active observations.\r\n var activeObservers = this.observers_.filter(function (observer) {\r\n return observer.gatherActive(), observer.hasActive();\r\n });\r\n // Deliver notifications in a separate cycle in order to avoid any\r\n // collisions between observers, e.g. when multiple instances of\r\n // ResizeObserver are tracking the same element and the callback of one\r\n // of them changes content dimensions of the observed target. Sometimes\r\n // this may result in notifications being blocked for the rest of observers.\r\n activeObservers.forEach(function (observer) { return observer.broadcastActive(); });\r\n return activeObservers.length > 0;\r\n };\r\n /**\r\n * Initializes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.connect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already added.\r\n if (!isBrowser || this.connected_) {\r\n return;\r\n }\r\n // Subscription to the \"Transitionend\" event is used as a workaround for\r\n // delayed transitions. This way it's possible to capture at least the\r\n // final state of an element.\r\n document.addEventListener('transitionend', this.onTransitionEnd_);\r\n window.addEventListener('resize', this.refresh);\r\n if (mutationObserverSupported) {\r\n this.mutationsObserver_ = new MutationObserver(this.refresh);\r\n this.mutationsObserver_.observe(document, {\r\n attributes: true,\r\n childList: true,\r\n characterData: true,\r\n subtree: true\r\n });\r\n }\r\n else {\r\n document.addEventListener('DOMSubtreeModified', this.refresh);\r\n this.mutationEventsAdded_ = true;\r\n }\r\n this.connected_ = true;\r\n };\r\n /**\r\n * Removes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.disconnect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already removed.\r\n if (!isBrowser || !this.connected_) {\r\n return;\r\n }\r\n document.removeEventListener('transitionend', this.onTransitionEnd_);\r\n window.removeEventListener('resize', this.refresh);\r\n if (this.mutationsObserver_) {\r\n this.mutationsObserver_.disconnect();\r\n }\r\n if (this.mutationEventsAdded_) {\r\n document.removeEventListener('DOMSubtreeModified', this.refresh);\r\n }\r\n this.mutationsObserver_ = null;\r\n this.mutationEventsAdded_ = false;\r\n this.connected_ = false;\r\n };\r\n /**\r\n * \"Transitionend\" event handler.\r\n *\r\n * @private\r\n * @param {TransitionEvent} event\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {\r\n var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;\r\n // Detect whether transition may affect dimensions of an element.\r\n var isReflowProperty = transitionKeys.some(function (key) {\r\n return !!~propertyName.indexOf(key);\r\n });\r\n if (isReflowProperty) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Returns instance of the ResizeObserverController.\r\n *\r\n * @returns {ResizeObserverController}\r\n */\r\n ResizeObserverController.getInstance = function () {\r\n if (!this.instance_) {\r\n this.instance_ = new ResizeObserverController();\r\n }\r\n return this.instance_;\r\n };\r\n /**\r\n * Holds reference to the controller's instance.\r\n *\r\n * @private {ResizeObserverController}\r\n */\r\n ResizeObserverController.instance_ = null;\r\n return ResizeObserverController;\r\n}());\n\n/**\r\n * Defines non-writable/enumerable properties of the provided target object.\r\n *\r\n * @param {Object} target - Object for which to define properties.\r\n * @param {Object} props - Properties to be defined.\r\n * @returns {Object} Target object.\r\n */\r\nvar defineConfigurable = (function (target, props) {\r\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n Object.defineProperty(target, key, {\r\n value: props[key],\r\n enumerable: false,\r\n writable: false,\r\n configurable: true\r\n });\r\n }\r\n return target;\r\n});\n\n/**\r\n * Returns the global object associated with provided element.\r\n *\r\n * @param {Object} target\r\n * @returns {Object}\r\n */\r\nvar getWindowOf = (function (target) {\r\n // Assume that the element is an instance of Node, which means that it\r\n // has the \"ownerDocument\" property from which we can retrieve a\r\n // corresponding global object.\r\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;\r\n // Return the local global object if it's not possible extract one from\r\n // provided element.\r\n return ownerGlobal || global$1;\r\n});\n\n// Placeholder of an empty content rectangle.\r\nvar emptyRect = createRectInit(0, 0, 0, 0);\r\n/**\r\n * Converts provided string to a number.\r\n *\r\n * @param {number|string} value\r\n * @returns {number}\r\n */\r\nfunction toFloat(value) {\r\n return parseFloat(value) || 0;\r\n}\r\n/**\r\n * Extracts borders size from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @param {...string} positions - Borders positions (top, right, ...)\r\n * @returns {number}\r\n */\r\nfunction getBordersSize(styles) {\r\n var positions = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n positions[_i - 1] = arguments[_i];\r\n }\r\n return positions.reduce(function (size, position) {\r\n var value = styles['border-' + position + '-width'];\r\n return size + toFloat(value);\r\n }, 0);\r\n}\r\n/**\r\n * Extracts paddings sizes from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @returns {Object} Paddings box.\r\n */\r\nfunction getPaddings(styles) {\r\n var positions = ['top', 'right', 'bottom', 'left'];\r\n var paddings = {};\r\n for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\r\n var position = positions_1[_i];\r\n var value = styles['padding-' + position];\r\n paddings[position] = toFloat(value);\r\n }\r\n return paddings;\r\n}\r\n/**\r\n * Calculates content rectangle of provided SVG element.\r\n *\r\n * @param {SVGGraphicsElement} target - Element content rectangle of which needs\r\n * to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getSVGContentRect(target) {\r\n var bbox = target.getBBox();\r\n return createRectInit(0, 0, bbox.width, bbox.height);\r\n}\r\n/**\r\n * Calculates content rectangle of provided HTMLElement.\r\n *\r\n * @param {HTMLElement} target - Element for which to calculate the content rectangle.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getHTMLElementContentRect(target) {\r\n // Client width & height properties can't be\r\n // used exclusively as they provide rounded values.\r\n var clientWidth = target.clientWidth, clientHeight = target.clientHeight;\r\n // By this condition we can catch all non-replaced inline, hidden and\r\n // detached elements. Though elements with width & height properties less\r\n // than 0.5 will be discarded as well.\r\n //\r\n // Without it we would need to implement separate methods for each of\r\n // those cases and it's not possible to perform a precise and performance\r\n // effective test for hidden elements. E.g. even jQuery's ':visible' filter\r\n // gives wrong results for elements with width & height less than 0.5.\r\n if (!clientWidth && !clientHeight) {\r\n return emptyRect;\r\n }\r\n var styles = getWindowOf(target).getComputedStyle(target);\r\n var paddings = getPaddings(styles);\r\n var horizPad = paddings.left + paddings.right;\r\n var vertPad = paddings.top + paddings.bottom;\r\n // Computed styles of width & height are being used because they are the\r\n // only dimensions available to JS that contain non-rounded values. It could\r\n // be possible to utilize the getBoundingClientRect if only it's data wasn't\r\n // affected by CSS transformations let alone paddings, borders and scroll bars.\r\n var width = toFloat(styles.width), height = toFloat(styles.height);\r\n // Width & height include paddings and borders when the 'border-box' box\r\n // model is applied (except for IE).\r\n if (styles.boxSizing === 'border-box') {\r\n // Following conditions are required to handle Internet Explorer which\r\n // doesn't include paddings and borders to computed CSS dimensions.\r\n //\r\n // We can say that if CSS dimensions + paddings are equal to the \"client\"\r\n // properties then it's either IE, and thus we don't need to subtract\r\n // anything, or an element merely doesn't have paddings/borders styles.\r\n if (Math.round(width + horizPad) !== clientWidth) {\r\n width -= getBordersSize(styles, 'left', 'right') + horizPad;\r\n }\r\n if (Math.round(height + vertPad) !== clientHeight) {\r\n height -= getBordersSize(styles, 'top', 'bottom') + vertPad;\r\n }\r\n }\r\n // Following steps can't be applied to the document's root element as its\r\n // client[Width/Height] properties represent viewport area of the window.\r\n // Besides, it's as well not necessary as the itself neither has\r\n // rendered scroll bars nor it can be clipped.\r\n if (!isDocumentElement(target)) {\r\n // In some browsers (only in Firefox, actually) CSS width & height\r\n // include scroll bars size which can be removed at this step as scroll\r\n // bars are the only difference between rounded dimensions + paddings\r\n // and \"client\" properties, though that is not always true in Chrome.\r\n var vertScrollbar = Math.round(width + horizPad) - clientWidth;\r\n var horizScrollbar = Math.round(height + vertPad) - clientHeight;\r\n // Chrome has a rather weird rounding of \"client\" properties.\r\n // E.g. for an element with content width of 314.2px it sometimes gives\r\n // the client width of 315px and for the width of 314.7px it may give\r\n // 314px. And it doesn't happen all the time. So just ignore this delta\r\n // as a non-relevant.\r\n if (Math.abs(vertScrollbar) !== 1) {\r\n width -= vertScrollbar;\r\n }\r\n if (Math.abs(horizScrollbar) !== 1) {\r\n height -= horizScrollbar;\r\n }\r\n }\r\n return createRectInit(paddings.left, paddings.top, width, height);\r\n}\r\n/**\r\n * Checks whether provided element is an instance of the SVGGraphicsElement.\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nvar isSVGGraphicsElement = (function () {\r\n // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement\r\n // interface.\r\n if (typeof SVGGraphicsElement !== 'undefined') {\r\n return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };\r\n }\r\n // If it's so, then check that element is at least an instance of the\r\n // SVGElement and that it has the \"getBBox\" method.\r\n // eslint-disable-next-line no-extra-parens\r\n return function (target) { return (target instanceof getWindowOf(target).SVGElement &&\r\n typeof target.getBBox === 'function'); };\r\n})();\r\n/**\r\n * Checks whether provided element is a document element ().\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nfunction isDocumentElement(target) {\r\n return target === getWindowOf(target).document.documentElement;\r\n}\r\n/**\r\n * Calculates an appropriate content rectangle for provided html or svg element.\r\n *\r\n * @param {Element} target - Element content rectangle of which needs to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getContentRect(target) {\r\n if (!isBrowser) {\r\n return emptyRect;\r\n }\r\n if (isSVGGraphicsElement(target)) {\r\n return getSVGContentRect(target);\r\n }\r\n return getHTMLElementContentRect(target);\r\n}\r\n/**\r\n * Creates rectangle with an interface of the DOMRectReadOnly.\r\n * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly\r\n *\r\n * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.\r\n * @returns {DOMRectReadOnly}\r\n */\r\nfunction createReadOnlyRect(_a) {\r\n var x = _a.x, y = _a.y, width = _a.width, height = _a.height;\r\n // If DOMRectReadOnly is available use it as a prototype for the rectangle.\r\n var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;\r\n var rect = Object.create(Constr.prototype);\r\n // Rectangle's properties are not writable and non-enumerable.\r\n defineConfigurable(rect, {\r\n x: x, y: y, width: width, height: height,\r\n top: y,\r\n right: x + width,\r\n bottom: height + y,\r\n left: x\r\n });\r\n return rect;\r\n}\r\n/**\r\n * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.\r\n * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit\r\n *\r\n * @param {number} x - X coordinate.\r\n * @param {number} y - Y coordinate.\r\n * @param {number} width - Rectangle's width.\r\n * @param {number} height - Rectangle's height.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction createRectInit(x, y, width, height) {\r\n return { x: x, y: y, width: width, height: height };\r\n}\n\n/**\r\n * Class that is responsible for computations of the content rectangle of\r\n * provided DOM element and for keeping track of it's changes.\r\n */\r\nvar ResizeObservation = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObservation.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n */\r\n function ResizeObservation(target) {\r\n /**\r\n * Broadcasted width of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastWidth = 0;\r\n /**\r\n * Broadcasted height of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastHeight = 0;\r\n /**\r\n * Reference to the last observed content rectangle.\r\n *\r\n * @private {DOMRectInit}\r\n */\r\n this.contentRect_ = createRectInit(0, 0, 0, 0);\r\n this.target = target;\r\n }\r\n /**\r\n * Updates content rectangle and tells whether it's width or height properties\r\n * have changed since the last broadcast.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObservation.prototype.isActive = function () {\r\n var rect = getContentRect(this.target);\r\n this.contentRect_ = rect;\r\n return (rect.width !== this.broadcastWidth ||\r\n rect.height !== this.broadcastHeight);\r\n };\r\n /**\r\n * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data\r\n * from the corresponding properties of the last observed content rectangle.\r\n *\r\n * @returns {DOMRectInit} Last observed content rectangle.\r\n */\r\n ResizeObservation.prototype.broadcastRect = function () {\r\n var rect = this.contentRect_;\r\n this.broadcastWidth = rect.width;\r\n this.broadcastHeight = rect.height;\r\n return rect;\r\n };\r\n return ResizeObservation;\r\n}());\n\nvar ResizeObserverEntry = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObserverEntry.\r\n *\r\n * @param {Element} target - Element that is being observed.\r\n * @param {DOMRectInit} rectInit - Data of the element's content rectangle.\r\n */\r\n function ResizeObserverEntry(target, rectInit) {\r\n var contentRect = createReadOnlyRect(rectInit);\r\n // According to the specification following properties are not writable\r\n // and are also not enumerable in the native implementation.\r\n //\r\n // Property accessors are not being used as they'd require to define a\r\n // private WeakMap storage which may cause memory leaks in browsers that\r\n // don't support this type of collections.\r\n defineConfigurable(this, { target: target, contentRect: contentRect });\r\n }\r\n return ResizeObserverEntry;\r\n}());\n\nvar ResizeObserverSPI = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback function that is invoked\r\n * when one of the observed elements changes it's content dimensions.\r\n * @param {ResizeObserverController} controller - Controller instance which\r\n * is responsible for the updates of observer.\r\n * @param {ResizeObserver} callbackCtx - Reference to the public\r\n * ResizeObserver instance which will be passed to callback function.\r\n */\r\n function ResizeObserverSPI(callback, controller, callbackCtx) {\r\n /**\r\n * Collection of resize observations that have detected changes in dimensions\r\n * of elements.\r\n *\r\n * @private {Array}\r\n */\r\n this.activeObservations_ = [];\r\n /**\r\n * Registry of the ResizeObservation instances.\r\n *\r\n * @private {Map}\r\n */\r\n this.observations_ = new MapShim();\r\n if (typeof callback !== 'function') {\r\n throw new TypeError('The callback provided as parameter 1 is not a function.');\r\n }\r\n this.callback_ = callback;\r\n this.controller_ = controller;\r\n this.callbackCtx_ = callbackCtx;\r\n }\r\n /**\r\n * Starts observing provided element.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.observe = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is already being observed.\r\n if (observations.has(target)) {\r\n return;\r\n }\r\n observations.set(target, new ResizeObservation(target));\r\n this.controller_.addObserver(this);\r\n // Force the update of observations.\r\n this.controller_.refresh();\r\n };\r\n /**\r\n * Stops observing provided element.\r\n *\r\n * @param {Element} target - Element to stop observing.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.unobserve = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is not being observed.\r\n if (!observations.has(target)) {\r\n return;\r\n }\r\n observations.delete(target);\r\n if (!observations.size) {\r\n this.controller_.removeObserver(this);\r\n }\r\n };\r\n /**\r\n * Stops observing all elements.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.disconnect = function () {\r\n this.clearActive();\r\n this.observations_.clear();\r\n this.controller_.removeObserver(this);\r\n };\r\n /**\r\n * Collects observation instances the associated element of which has changed\r\n * it's content rectangle.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.gatherActive = function () {\r\n var _this = this;\r\n this.clearActive();\r\n this.observations_.forEach(function (observation) {\r\n if (observation.isActive()) {\r\n _this.activeObservations_.push(observation);\r\n }\r\n });\r\n };\r\n /**\r\n * Invokes initial callback function with a list of ResizeObserverEntry\r\n * instances collected from active resize observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.broadcastActive = function () {\r\n // Do nothing if observer doesn't have active observations.\r\n if (!this.hasActive()) {\r\n return;\r\n }\r\n var ctx = this.callbackCtx_;\r\n // Create ResizeObserverEntry instance for every active observation.\r\n var entries = this.activeObservations_.map(function (observation) {\r\n return new ResizeObserverEntry(observation.target, observation.broadcastRect());\r\n });\r\n this.callback_.call(ctx, entries, ctx);\r\n this.clearActive();\r\n };\r\n /**\r\n * Clears the collection of active observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.clearActive = function () {\r\n this.activeObservations_.splice(0);\r\n };\r\n /**\r\n * Tells whether observer has active observations.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObserverSPI.prototype.hasActive = function () {\r\n return this.activeObservations_.length > 0;\r\n };\r\n return ResizeObserverSPI;\r\n}());\n\n// Registry of internal observers. If WeakMap is not available use current shim\r\n// for the Map collection as it has all required methods and because WeakMap\r\n// can't be fully polyfilled anyway.\r\nvar observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();\r\n/**\r\n * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation\r\n * exposing only those methods and properties that are defined in the spec.\r\n */\r\nvar ResizeObserver = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback that is invoked when\r\n * dimensions of the observed elements change.\r\n */\r\n function ResizeObserver(callback) {\r\n if (!(this instanceof ResizeObserver)) {\r\n throw new TypeError('Cannot call a class as a function.');\r\n }\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n var controller = ResizeObserverController.getInstance();\r\n var observer = new ResizeObserverSPI(callback, controller, this);\r\n observers.set(this, observer);\r\n }\r\n return ResizeObserver;\r\n}());\r\n// Expose public methods of ResizeObserver.\r\n[\r\n 'observe',\r\n 'unobserve',\r\n 'disconnect'\r\n].forEach(function (method) {\r\n ResizeObserver.prototype[method] = function () {\r\n var _a;\r\n return (_a = observers.get(this))[method].apply(_a, arguments);\r\n };\r\n});\n\nvar index = (function () {\r\n // Export existing implementation if available.\r\n if (typeof global$1.ResizeObserver !== 'undefined') {\r\n return global$1.ResizeObserver;\r\n }\r\n return ResizeObserver;\r\n})();\n\nexport default index;\n","'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n","function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n"],"names":["htmlparser","require","escapeStringRegexp","isPlainObject","deepmerge","parseSrcset","postcssParse","parse","mediaTags","vulnerableTags","each","obj","cb","Object","keys","forEach","key","has","hasOwnProperty","call","filter","a","n","v","push","module","exports","sanitizeHtml","VALID_HTML_ATTRIBUTE_NAME","html","options","_recursing","toString","result","tempResult","Frame","tag","attribs","that","this","tagPosition","length","text","mediaChildren","updateParentNodeText","stack","updateParentNodeMediaChildren","includes","assign","defaults","parser","htmlParserDefaults","tagAllowed","name","allowedTags","indexOf","allowVulnerableTags","console","warn","concat","allowedAttributesMap","allowedAttributesGlobMap","nonTextTagsArray","nonTextTags","allowedAttributes","attributes","globRegex","replace","RegExp","join","allowedClassesMap","allowedClassesGlobMap","allowedClassesRegexMap","allowedClasses","classes","Array","isArray","transformTagsAll","depth","skipMap","transformMap","skipText","skipTextDepth","transformTagsMap","transformTags","transform","transFun","simpleTransform","addedText","initializeState","Parser","onopentag","enforceHtmlBoundary","frame","transformedTag","skip","hasText","undefined","innerText","tagName","disallowedTagsMode","isEmptyObject","nestingLimit","allowedScriptHostnames","allowedScriptDomains","value","test","allowedEmptyAttributes","nonBooleanAttributes","passedAllowedAttributesMapCheck","_step","_iterator","_createForOfIteratorHelper","s","done","o","newValue","multiple","_step2","splitStrArray","split","_iterator2","values","err","e","f","allowedSchemesAppliedToAttributes","naughtyHref","allowed","parsed","parseUrl","allowedHostname","find","hostname","url","allowedDomain","domain","endsWith","isRelativeUrl","allowIframeRelativeUrls","allowedIframeHostnames","allowedIframeDomains","evil","map","part","Error","w","h","d","allowedSpecificClasses","allowedWildcardClasses","allowedSpecificClassesGlob","allowedSpecificClassesRegex","allowedClassesGlobs","t","filterClasses","parseStyleAttributes","filteredAST","abstractSyntaxTree","allowedStyles","selectedRule","astRules","nodes","selector","reduce","allowedDeclarationsList","attributeObject","prop","some","regularExpression","filterDeclarations","filterCss","extractedAttributes","attrObject","important","stringifyStyleAttributes","window","escapeHtml","selfClosing","textFilter","ontext","lastFrame","escaped","onclosetag","isImplied","pop","exclusiveFilter","substr","write","end","quote","decodeEntities","href","firstIndex","lastIndex","substring","matches","match","allowProtocolRelative","scheme","toLowerCase","allowedSchemesByTag","allowedSchemes","startsWith","base","i","URL","protocol","allowedGlobs","clss","glob","img","newTagName","newAttribs","merge","attrib","MapShim","Map","getIndex","arr","entry","index","anonymous","__entries__","prototypeAccessors","size","configurable","get","prototype","set","delete","entries","splice","clear","callback","ctx","list","defineProperties","isBrowser","document","global$1","global","Math","self","Function","requestAnimationFrame$1","requestAnimationFrame","bind","setTimeout","Date","now","trailingTimeout","throttle","delay","leadingCall","trailingCall","lastCallTime","resolvePending","proxy","timeoutCallback","timeStamp","REFRESH_DELAY","transitionKeys","mutationObserverSupported","MutationObserver","ResizeObserverController","connected_","mutationEventsAdded_","mutationsObserver_","observers_","onTransitionEnd_","refresh","addObserver","observer","connect_","removeObserver","observers","disconnect_","updateObservers_","activeObservers","gatherActive","hasActive","broadcastActive","addEventListener","observe","childList","characterData","subtree","removeEventListener","disconnect","ref","propertyName","getInstance","instance_","defineConfigurable","target","props","defineProperty","enumerable","writable","getWindowOf","ownerDocument","defaultView","emptyRect","createRectInit","toFloat","parseFloat","getBordersSize","styles","positions","len","arguments","position","getPaddings","paddings","getSVGContentRect","bbox","getBBox","width","height","getHTMLElementContentRect","clientWidth","clientHeight","getComputedStyle","horizPad","left","right","vertPad","top","bottom","boxSizing","round","isDocumentElement","vertScrollbar","horizScrollbar","abs","isSVGGraphicsElement","SVGGraphicsElement","SVGElement","documentElement","getContentRect","createReadOnlyRect","x","y","Constr","DOMRectReadOnly","rect","create","ResizeObservation","broadcastWidth","broadcastHeight","contentRect_","isActive","broadcastRect","ResizeObserverEntry","rectInit","contentRect","ResizeObserverSPI","controller","callbackCtx","activeObservations_","observations_","TypeError","callback_","controller_","callbackCtx_","Element","observations","unobserve","clearActive","this$1","observation","WeakMap","ResizeObserver","method","apply","factory","b","c","g","k","m","C","sortIndex","id","performance","l","unstable_now","p","q","r","u","z","A","B","D","E","clearTimeout","F","setImmediate","G","startTime","expirationTime","H","I","J","K","L","M","priorityLevel","navigator","scheduling","isInputPending","S","N","O","P","Q","R","MessageChannel","T","U","port2","port1","onmessage","postMessage","unstable_IdlePriority","unstable_ImmediatePriority","unstable_LowPriority","unstable_NormalPriority","unstable_Profiling","unstable_UserBlockingPriority","unstable_cancelCallback","unstable_continueExecution","unstable_forceFrameRate","error","floor","unstable_getCurrentPriorityLevel","unstable_getFirstCallbackNode","unstable_next","unstable_pauseExecution","unstable_requestPaint","unstable_runWithPriority","unstable_scheduleCallback","unstable_shouldYield","unstable_wrapCallback","assertIsFunction","func","errorMessage","ensureIsArray","item","getDependencies","createSelectorArgs","dependencies","array","every","itemTypes","assertIsArrayOfFunctions","Symbol","getPrototypeOf","Ref","WeakRef","_createClass","StrongRef","_classCallCheck","weakMapMemoize","lastResult","fnNode","resultEqualityCheck","resultsCount","memoized","cacheNode","arg","objectCache","objectNode","primitiveCache","primitiveNode","terminatedNode","_lastResult$deref","_lastResult","_lastResult$deref2","lastResultValue","deref","clearCache","resetResultsCount","createSelectorCreator","memoizeOrOptions","_len","memoizeOptionsFromArgs","_key5","createSelectorCreatorOptions","memoize","memoizeOptions","createSelector2","_len2","_key6","recomputations","dependencyRecomputations","directlyPassedOptions","resultFunc","combinedOptions","_objectSpread","_combinedOptions$memo","_combinedOptions$args","argsMemoize","_combinedOptions$args2","argsMemoizeOptions","finalMemoizeOptions","devModeChecks","finalArgsMemoizeOptions","memoizedResultFunc","_toConsumableArray","inputSelectorResults","inputSelectorArgs","collectInputSelectorResults","resetDependencyRecomputations","resetRecomputations","withTypes","createSelector","createStructuredSelector","inputSelectorsObject","selectorCreator","object","assertIsObject","inputSelectorKeys","structuredSelector","_len3","_key7","composition","class_1","_i","_a","_b","positions_1","_this","isMergeableObject","isNonNullObject","stringValue","$$typeof","REACT_ELEMENT_TYPE","isReactElement","isSpecial","for","cloneUnlessOtherwiseSpecified","clone","val","defaultArrayMerge","source","element","getKeys","getOwnPropertySymbols","symbol","propertyIsEnumerable","getEnumerableOwnPropertySymbols","propertyIsOnObject","property","_","mergeObject","destination","propertyIsUnsafe","customMerge","getMergeFunction","arrayMerge","sourceIsArray","all","prev","next","deepmerge_1","isAbsolute","pathname","charAt","spliceOne","to","from","hasTrailingSlash","toParts","fromParts","isToAbs","isFromAbs","mustEndAbs","last","up","unshift"],"sourceRoot":""}