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AY,MACZ,GAAiB,sBAEjB,YAAY,sBAAsB,IAElC,MAAM,IAAI,MAAM,mBAGpB,GAAwB,KAAK,GAAgB,EAAK,GAItD,CAYA,EAAe,QAAQ,UAAW,cAAe,CAC7C,GAAA,CAAI,GACA,KAAK,IAAuB,EACxB,OAAO,IACP,oBAAoB,KAE5B,EACA,GAAA,GACI,OAAO,KAAK,GAChB,EACA,cAAc,GAGlB","file":"/npm/@lwc/synthetic-shadow@9.1.0/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@lwc/synthetic-shadow@9.1.0/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * Copyright (c) 2026 Salesforce, Inc.\n */\nif (!globalThis.lwcRuntimeFlags) {\n  Object.defineProperty(globalThis, 'lwcRuntimeFlags', { value: Object.create(null) });\n}\nif (!lwcRuntimeFlags.ENABLE_FORCE_SHADOW_MIGRATE_MODE && !lwcRuntimeFlags.DISABLE_SYNTHETIC_SHADOW) {\n/**\n * Copyright (c) 2026 Salesforce, Inc.\n */\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n/**\n *\n * @param value\n * @param msg\n */\nfunction invariant(value, msg) {\n    if (!value) {\n        throw new Error(`Invariant Violation: ${msg}`);\n    }\n}\n/**\n *\n * @param value\n * @param msg\n */\nfunction isTrue$1(value, msg) {\n    if (!value) {\n        throw new Error(`Assert Violation: ${msg}`);\n    }\n}\n/**\n *\n * @param value\n * @param msg\n */\nfunction isFalse$1(value, msg) {\n    if (value) {\n        throw new Error(`Assert Violation: ${msg}`);\n    }\n}\n/**\n *\n * @param msg\n */\nfunction fail(msg) {\n    throw new Error(msg);\n}\n\nvar assert = /*#__PURE__*/Object.freeze({\n    __proto__: null,\n    fail: fail,\n    invariant: invariant,\n    isFalse: isFalse$1,\n    isTrue: isTrue$1\n});\n\n/*\n * Copyright (c) 2024, Salesforce, Inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst { \n/** Detached {@linkcode Object.assign}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign MDN Reference}. */\nassign, \n/** Detached {@linkcode Object.create}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create MDN Reference}. */\ncreate, \n/** Detached {@linkcode Object.defineProperties}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties MDN Reference}. */\ndefineProperties, \n/** Detached {@linkcode Object.defineProperty}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty MDN Reference}. */\ndefineProperty, \n/** Detached {@linkcode Object.getOwnPropertyDescriptor}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor MDN Reference}. */\ngetOwnPropertyDescriptor, \n/** Detached {@linkcode Object.getPrototypeOf}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf MDN Reference}. */\ngetPrototypeOf, \n/** Detached {@linkcode Object.hasOwnProperty}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty MDN Reference}. */\nhasOwnProperty, \n/** Detached {@linkcode Object.setPrototypeOf}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf MDN Reference}. */\nsetPrototypeOf, } = Object;\nconst { \n/** Detached {@linkcode Array.isArray}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray MDN Reference}. */\nisArray} = Array;\n// For some reason, JSDoc don't get picked up for multiple renamed destructured constants (even\n// though it works fine for one, e.g. isArray), so comments for these are added to the export\n// statement, rather than this declaration.\nconst { filter: ArrayFilter, find: ArrayFind, findIndex: ArrayFindIndex, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, push: ArrayPush, reduce: ArrayReduce, reverse: ArrayReverse, slice: ArraySlice, splice: ArraySplice, forEach, // Weird anomaly!\n } = Array.prototype;\n/**\n * Determines whether the argument is `undefined`.\n * @param obj Value to test\n * @returns `true` if the value is `undefined`.\n */\nfunction isUndefined(obj) {\n    return obj === undefined;\n}\n/**\n * Determines whether the argument is `null`.\n * @param obj Value to test\n * @returns `true` if the value is `null`.\n */\nfunction isNull(obj) {\n    return obj === null;\n}\n/**\n * Determines whether the argument is `true`.\n * @param obj Value to test\n * @returns `true` if the value is `true`.\n */\nfunction isTrue(obj) {\n    return obj === true;\n}\n/**\n * Determines whether the argument is `false`.\n * @param obj Value to test\n * @returns `true` if the value is `false`.\n */\nfunction isFalse(obj) {\n    return obj === false;\n}\n/**\n * Determines whether the argument is a function.\n * @param obj Value to test\n * @returns `true` if the value is a function.\n */\n// Replacing `Function` with a narrower type that works for all our use cases is tricky...\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nfunction isFunction(obj) {\n    return typeof obj === 'function';\n}\n/**\n * Determines whether the argument is an object or null.\n * @param obj Value to test\n * @returns `true` if the value is an object or null.\n */\nfunction isObject(obj) {\n    return typeof obj === 'object';\n}\nconst OtS = {}.toString;\n/**\n * Converts the argument to a string, safely accounting for objects with \"null\" prototype.\n * Note that `toString(null)` returns `\"[object Null]\"` rather than `\"null\"`.\n * @param obj Value to convert to a string.\n * @returns String representation of the value.\n */\nfunction toString(obj) {\n    if (obj?.toString) {\n        // Arrays might hold objects with \"null\" prototype So using\n        // Array.prototype.toString directly will cause an error Iterate through\n        // all the items and handle individually.\n        if (isArray(obj)) {\n            // This behavior is slightly different from Array#toString:\n            // 1. Array#toString calls `this.join`, rather than Array#join\n            // Ex: arr = []; arr.join = () => 1; arr.toString() === 1; toString(arr) === ''\n            // 2. Array#toString delegates to Object#toString if `this.join` is not a function\n            // Ex: arr = []; arr.join = 'no'; arr.toString() === '[object Array]; toString(arr) = ''\n            // 3. Array#toString converts null/undefined to ''\n            // Ex: arr = [null, undefined]; arr.toString() === ','; toString(arr) === '[object Null],undefined'\n            // 4. Array#toString converts recursive references to arrays to ''\n            // Ex: arr = [1]; arr.push(arr, 2); arr.toString() === '1,,2'; toString(arr) throws\n            // Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString\n            return ArrayJoin.call(ArrayMap.call(obj, toString), ',');\n        }\n        return obj.toString();\n    }\n    else if (typeof obj === 'object') {\n        // This catches null and returns \"[object Null]\". Weird, but kept for backwards compatibility.\n        return OtS.call(obj);\n    }\n    else {\n        return String(obj);\n    }\n}\n\n/*\n * Copyright (c) 2023, Salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst KEY__SHADOW_RESOLVER = '$shadowResolver$';\nconst KEY__SHADOW_RESOLVER_PRIVATE = '$$ShadowResolverKey$$';\nconst KEY__SHADOW_STATIC = '$shadowStaticNode$';\nconst KEY__SHADOW_STATIC_PRIVATE = '$shadowStaticNodeKey$';\nconst KEY__SHADOW_TOKEN = '$shadowToken$';\nconst KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';\n// TODO [#3733]: remove support for legacy scope tokens\nconst KEY__LEGACY_SHADOW_TOKEN = '$legacyShadowToken$';\nconst KEY__LEGACY_SHADOW_TOKEN_PRIVATE = '$$LegacyShadowTokenKey$$';\nconst KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';\nconst KEY__NATIVE_GET_ELEMENT_BY_ID = '$nativeGetElementById$';\nconst KEY__NATIVE_QUERY_SELECTOR_ALL = '$nativeQuerySelectorAll$';\n/** version: 9.1.0 */\n\n/**\n * Copyright (c) 2026 Salesforce, Inc.\n */\nif (!globalThis.lwcRuntimeFlags) {\n    Object.defineProperty(globalThis, 'lwcRuntimeFlags', { value: create(null) });\n}\n/** version: 9.1.0 */\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n// TODO [#2472]: Remove this workaround when appropriate.\n// eslint-disable-next-line @lwc/lwc-internal/no-global-node\nconst _Node = Node;\nconst nodePrototype = _Node.prototype;\nconst { DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_PRECEDING, DOCUMENT_POSITION_FOLLOWING, ELEMENT_NODE, TEXT_NODE, CDATA_SECTION_NODE, PROCESSING_INSTRUCTION_NODE, COMMENT_NODE} = _Node;\nconst { appendChild, cloneNode, compareDocumentPosition, contains, getRootNode: getRootNode$1, insertBefore, removeChild, replaceChild, hasChildNodes, } = nodePrototype;\nconst firstChildGetter = getOwnPropertyDescriptor(nodePrototype, 'firstChild').get;\nconst lastChildGetter = getOwnPropertyDescriptor(nodePrototype, 'lastChild').get;\nconst textContentGetter = getOwnPropertyDescriptor(nodePrototype, 'textContent').get;\nconst parentNodeGetter = getOwnPropertyDescriptor(nodePrototype, 'parentNode').get;\nconst ownerDocumentGetter = getOwnPropertyDescriptor(nodePrototype, 'ownerDocument').get;\nconst parentElementGetter = getOwnPropertyDescriptor(nodePrototype, 'parentElement').get;\nconst textContextSetter = getOwnPropertyDescriptor(nodePrototype, 'textContent').set;\nconst childNodesGetter = getOwnPropertyDescriptor(nodePrototype, 'childNodes').get;\nconst nextSiblingGetter = getOwnPropertyDescriptor(nodePrototype, 'nextSibling').get;\nconst isConnected = hasOwnProperty.call(nodePrototype, 'isConnected')\n    ? getOwnPropertyDescriptor(nodePrototype, 'isConnected').get\n    : function () {\n        const doc = ownerDocumentGetter.call(this);\n        // IE11\n        return (\n        // if doc is null, it means `this` is actually a document instance which\n        // is always connected\n        doc === null ||\n            (compareDocumentPosition.call(doc, this) & DOCUMENT_POSITION_CONTAINED_BY) !== 0);\n    };\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst { getAttribute, getBoundingClientRect, getElementsByTagName: getElementsByTagName$1, getElementsByTagNameNS: getElementsByTagNameNS$1, hasAttribute, querySelector, querySelectorAll: querySelectorAll$1, removeAttribute, setAttribute, } = Element.prototype;\nconst attachShadow$1 = hasOwnProperty.call(Element.prototype, 'attachShadow')\n    ? Element.prototype.attachShadow\n    : () => {\n        throw new TypeError('attachShadow() is not supported in current browser. Load the @lwc/synthetic-shadow polyfill and use Lightning Web Components');\n    };\nconst childElementCountGetter = getOwnPropertyDescriptor(Element.prototype, 'childElementCount').get;\nconst firstElementChildGetter = getOwnPropertyDescriptor(Element.prototype, 'firstElementChild').get;\nconst lastElementChildGetter = getOwnPropertyDescriptor(Element.prototype, 'lastElementChild').get;\nconst innerTextDescriptor = getOwnPropertyDescriptor(HTMLElement.prototype, 'innerText');\nconst innerTextGetter = innerTextDescriptor\n    ? innerTextDescriptor.get\n    : null;\nconst innerTextSetter = innerTextDescriptor\n    ? innerTextDescriptor.set\n    : null;\n// Note: Firefox does not have outerText, https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/outerText\nconst outerTextDescriptor = getOwnPropertyDescriptor(HTMLElement.prototype, 'outerText');\nconst outerTextGetter = outerTextDescriptor\n    ? outerTextDescriptor.get\n    : null;\nconst outerTextSetter = outerTextDescriptor\n    ? outerTextDescriptor.set\n    : null;\nconst innerHTMLDescriptor = getOwnPropertyDescriptor(Element.prototype, 'innerHTML');\nconst innerHTMLGetter = innerHTMLDescriptor.get;\nconst innerHTMLSetter = innerHTMLDescriptor.set;\nconst outerHTMLDescriptor = getOwnPropertyDescriptor(Element.prototype, 'outerHTML');\nconst outerHTMLGetter = outerHTMLDescriptor.get;\nconst outerHTMLSetter = outerHTMLDescriptor.set;\nconst tagNameGetter = getOwnPropertyDescriptor(Element.prototype, 'tagName').get;\nconst tabIndexDescriptor = getOwnPropertyDescriptor(HTMLElement.prototype, 'tabIndex');\nconst tabIndexGetter = tabIndexDescriptor.get;\nconst tabIndexSetter = tabIndexDescriptor.set;\nconst matches = Element.prototype.matches;\nconst childrenGetter = getOwnPropertyDescriptor(Element.prototype, 'children').get;\n// for IE11, access from HTMLElement\n// for all other browsers access the method from the parent Element interface\nconst { getElementsByClassName: getElementsByClassName$1 } = HTMLElement.prototype;\nconst shadowRootGetter = hasOwnProperty.call(Element.prototype, 'shadowRoot')\n    ? getOwnPropertyDescriptor(Element.prototype, 'shadowRoot').get\n    : () => null;\nconst assignedSlotGetter$1 = hasOwnProperty.call(Element.prototype, 'assignedSlot')\n    ? getOwnPropertyDescriptor(Element.prototype, 'assignedSlot').get\n    : () => null;\n\n/*\n * Copyright (c) 2023, Salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst assignedNodes = HTMLSlotElement.prototype.assignedNodes;\nconst assignedElements = HTMLSlotElement.prototype.assignedElements;\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst eventTargetGetter = getOwnPropertyDescriptor(Event.prototype, 'target').get;\nconst eventCurrentTargetGetter = getOwnPropertyDescriptor(Event.prototype, 'currentTarget').get;\nconst focusEventRelatedTargetGetter = getOwnPropertyDescriptor(FocusEvent.prototype, 'relatedTarget').get;\n// IE does not implement composedPath() but that's ok because we only use this instead of our\n// composedPath() polyfill when dealing with native shadow DOM components in mixed mode. Defaulting\n// to a NOOP just to be safe, even though this is almost guaranteed to be defined such a scenario.\nconst composedPath = hasOwnProperty.call(Event.prototype, 'composedPath')\n    ? Event.prototype.composedPath\n    : () => [];\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst DocumentPrototypeActiveElement = getOwnPropertyDescriptor(Document.prototype, 'activeElement').get;\nconst elementFromPoint = Document.prototype.elementFromPoint;\nconst elementsFromPoint = Document.prototype.elementsFromPoint;\n// defaultView can be null when a document has no browsing context. For example, the owner document\n// of a node in a template doesn't have a default view: https://jsfiddle.net/hv9z0q5a/\nconst defaultViewGetter = getOwnPropertyDescriptor(Document.prototype, 'defaultView').get;\nconst { querySelectorAll, getElementById, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, } = Document.prototype;\n// In Firefox v57 and lower, getElementsByName is defined on HTMLDocument.prototype\n// In all other browsers have the method on Document.prototype\nconst { getElementsByName } = HTMLDocument.prototype;\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst { addEventListener: windowAddEventListener, removeEventListener: windowRemoveEventListener} = window;\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n// There is code in the polyfills that requires access to the unpatched\n// Mutation Observer constructor, this the code for that.\n// Eventually, the polyfill should uses the patched version, and this file can be removed.\nconst MO = MutationObserver;\nconst MutationObserverObserve = MO.prototype.observe;\n\n/*\n * Copyright (c) 2023, Salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n// Capture the global `ShadowRoot` since synthetic shadow will override it later\nconst NativeShadowRoot = ShadowRoot;\nconst isInstanceOfNativeShadowRoot = (node) => node instanceof NativeShadowRoot;\n\n/*\n * Copyright (c) 2023, Salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst eventTargetPrototype = EventTarget.prototype;\nconst { addEventListener, dispatchEvent, removeEventListener } = eventTargetPrototype;\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n// Used as a back reference to identify the host element\nconst HostElementKey = '$$HostElementKey$$';\nconst ShadowedNodeKey = '$$ShadowedNodeKey$$';\nfunction fastDefineProperty(node, propName, config) {\n    const shadowedNode = node;\n    if (process.env.NODE_ENV !== 'production') {\n        // in dev, we are more restrictive\n        defineProperty(shadowedNode, propName, config);\n    }\n    else {\n        const { value } = config;\n        // in prod, we prioritize performance\n        shadowedNode[propName] = value;\n    }\n}\nfunction setNodeOwnerKey(node, value) {\n    fastDefineProperty(node, HostElementKey, { value, configurable: true });\n}\nfunction setNodeKey(node, value) {\n    fastDefineProperty(node, ShadowedNodeKey, { value });\n}\nfunction getNodeOwnerKey(node) {\n    return node[HostElementKey];\n}\nfunction getNodeNearestOwnerKey(node) {\n    let host = node;\n    let hostKey;\n    // search for the first element with owner identity\n    // in case of manually inserted elements and elements slotted from Light DOM\n    while (!isNull(host)) {\n        hostKey = getNodeOwnerKey(host);\n        if (!isUndefined(hostKey)) {\n            return hostKey;\n        }\n        host = parentNodeGetter.call(host);\n        // Elements slotted from top level light DOM into synthetic shadow\n        // reach the slot tag from the shadow element first\n        if (!isNull(host) && isSyntheticSlotElement(host)) {\n            return undefined;\n        }\n    }\n}\nfunction getNodeKey(node) {\n    return node[ShadowedNodeKey];\n}\n/**\n * This function does not traverse up for performance reasons, but is sufficient for most use\n * cases. If we need to traverse up and verify those nodes that don't have owner key, use\n * isNodeDeepShadowed instead.\n * @param node\n */\nfunction isNodeShadowed(node) {\n    return !isUndefined(getNodeOwnerKey(node));\n}\n\n/*\n * Copyright (c) 2024, Salesforce, Inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n// when finding a slot in the DOM, we can fold it if it is contained\n// inside another slot.\nfunction foldSlotElement(slot) {\n    let parent = parentElementGetter.call(slot);\n    while (!isNull(parent) && isSlotElement(parent)) {\n        slot = parent;\n        parent = parentElementGetter.call(slot);\n    }\n    return slot;\n}\nfunction isNodeSlotted(host, node) {\n    if (process.env.NODE_ENV !== 'production') {\n        if (!(host instanceof HTMLElement)) {\n            // eslint-disable-next-line no-console\n            console.error(`isNodeSlotted() should be called with a host as the first argument`);\n        }\n        if (!(node instanceof _Node)) {\n            // eslint-disable-next-line no-console\n            console.error(`isNodeSlotted() should be called with a node as the second argument`);\n        }\n        if (!(compareDocumentPosition.call(node, host) & DOCUMENT_POSITION_CONTAINS)) {\n            // eslint-disable-next-line no-console\n            console.error(`isNodeSlotted() should never be called with a node that is not a child node of the given host`);\n        }\n    }\n    const hostKey = getNodeKey(host);\n    // this routine assumes that the node is coming from a different shadow (it is not owned by the host)\n    // just in case the provided node is not an element\n    let currentElement = node instanceof Element ? node : parentElementGetter.call(node);\n    while (!isNull(currentElement) && currentElement !== host) {\n        const elmOwnerKey = getNodeNearestOwnerKey(currentElement);\n        const parent = parentElementGetter.call(currentElement);\n        if (elmOwnerKey === hostKey) {\n            // we have reached an element inside the host's template, and only if\n            // that element is an slot, then the node is considered slotted\n            return isSlotElement(currentElement);\n        }\n        else if (parent === host) {\n            return false;\n        }\n        else if (!isNull(parent) && getNodeNearestOwnerKey(parent) !== elmOwnerKey) {\n            // we are crossing a boundary of some sort since the elm and its parent\n            // have different owner key. for slotted elements, this is possible\n            // if the parent happens to be a slot.\n            if (isSlotElement(parent)) {\n                /*\n                 * the slot parent might be allocated inside another slot, think of:\n                 * <x-root> (<--- root element)\n                 *    <x-parent> (<--- own by x-root)\n                 *       <x-child> (<--- own by x-root)\n                 *           <slot> (<--- own by x-child)\n                 *               <slot> (<--- own by x-parent)\n                 *                  <div> (<--- own by x-root)\n                 *\n                 * while checking if x-parent has the div slotted, we need to traverse\n                 * up, but when finding the first slot, we skip that one in favor of the\n                 * most outer slot parent before jumping into its corresponding host.\n                 */\n                currentElement = getNodeOwner(foldSlotElement(parent));\n                if (!isNull(currentElement)) {\n                    if (currentElement === host) {\n                        // the slot element is a top level element inside the shadow\n                        // of a host that was allocated into host in question\n                        return true;\n                    }\n                    else if (getNodeNearestOwnerKey(currentElement) === hostKey) {\n                        // the slot element is an element inside the shadow\n                        // of a host that was allocated into host in question\n                        return true;\n                    }\n                }\n            }\n            else {\n                return false;\n            }\n        }\n        else {\n            currentElement = parent;\n        }\n    }\n    return false;\n}\nfunction getNodeOwner(node) {\n    if (!(node instanceof _Node)) {\n        return null;\n    }\n    const ownerKey = getNodeNearestOwnerKey(node);\n    if (isUndefined(ownerKey)) {\n        return null;\n    }\n    let nodeOwner = node;\n    // At this point, node is a valid node with owner identity, now we need to find the owner node\n    // search for a custom element with a VM that owns the first element with owner identity attached to it\n    while (!isNull(nodeOwner) && getNodeKey(nodeOwner) !== ownerKey) {\n        nodeOwner = parentNodeGetter.call(nodeOwner);\n    }\n    if (isNull(nodeOwner)) {\n        return null;\n    }\n    return nodeOwner;\n}\nfunction isSyntheticSlotElement(node) {\n    return isSlotElement(node) && isNodeShadowed(node);\n}\nfunction isSlotElement(node) {\n    return node instanceof HTMLSlotElement;\n}\nfunction isNodeOwnedBy(owner, node) {\n    if (process.env.NODE_ENV !== 'production') {\n        if (!(owner instanceof HTMLElement)) {\n            // eslint-disable-next-line no-console\n            console.error(`isNodeOwnedBy() should be called with an element as the first argument`);\n        }\n        if (!(node instanceof _Node)) {\n            // eslint-disable-next-line no-console\n            console.error(`isNodeOwnedBy() should be called with a node as the second argument`);\n        }\n        if (!(compareDocumentPosition.call(node, owner) & DOCUMENT_POSITION_CONTAINS)) {\n            // eslint-disable-next-line no-console\n            console.error(`isNodeOwnedBy() should never be called with a node that is not a child node of of the given owner`);\n        }\n    }\n    const ownerKey = getNodeNearestOwnerKey(node);\n    if (isUndefined(ownerKey)) {\n        // in case of root level light DOM element slotting into a synthetic shadow\n        const host = parentNodeGetter.call(node);\n        if (!isNull(host) && isSyntheticSlotElement(host)) {\n            return false;\n        }\n        // in case of manually inserted elements\n        return true;\n    }\n    return getNodeKey(owner) === ownerKey;\n}\nfunction shadowRootChildNodes(root) {\n    const elm = getHost(root);\n    return getAllMatches(elm, arrayFromCollection(childNodesGetter.call(elm)));\n}\nfunction getAllSlottedMatches(host, nodeList) {\n    const filteredAndPatched = [];\n    for (let i = 0, len = nodeList.length; i < len; i += 1) {\n        const node = nodeList[i];\n        if (!isNodeOwnedBy(host, node) && isNodeSlotted(host, node)) {\n            ArrayPush.call(filteredAndPatched, node);\n        }\n    }\n    return filteredAndPatched;\n}\nfunction getFirstSlottedMatch(host, nodeList) {\n    for (let i = 0, len = nodeList.length; i < len; i += 1) {\n        const node = nodeList[i];\n        if (!isNodeOwnedBy(host, node) && isNodeSlotted(host, node)) {\n            return node;\n        }\n    }\n    return null;\n}\nfunction getAllMatches(owner, nodeList) {\n    const filteredAndPatched = [];\n    for (let i = 0, len = nodeList.length; i < len; i += 1) {\n        const node = nodeList[i];\n        const isOwned = isNodeOwnedBy(owner, node);\n        if (isOwned) {\n            // Patch querySelector, querySelectorAll, etc\n            // if element is owned by VM\n            ArrayPush.call(filteredAndPatched, node);\n        }\n    }\n    return filteredAndPatched;\n}\nfunction getFirstMatch(owner, nodeList) {\n    for (let i = 0, len = nodeList.length; i < len; i += 1) {\n        if (isNodeOwnedBy(owner, nodeList[i])) {\n            return nodeList[i];\n        }\n    }\n    return null;\n}\nfunction shadowRootQuerySelector(root, selector) {\n    const elm = getHost(root);\n    const nodeList = arrayFromCollection(querySelectorAll$1.call(elm, selector));\n    return getFirstMatch(elm, nodeList);\n}\nfunction shadowRootQuerySelectorAll(root, selector) {\n    const elm = getHost(root);\n    const nodeList = querySelectorAll$1.call(elm, selector);\n    return getAllMatches(elm, arrayFromCollection(nodeList));\n}\nfunction getFilteredChildNodes(node) {\n    if (!isSyntheticShadowHost(node) && !isSlotElement(node)) {\n        // regular element - fast path\n        const children = childNodesGetter.call(node);\n        return arrayFromCollection(children);\n    }\n    if (isSyntheticShadowHost(node)) {\n        // we need to get only the nodes that were slotted\n        const slots = arrayFromCollection(querySelectorAll$1.call(node, 'slot'));\n        const resolver = getShadowRootResolver(getShadowRoot(node));\n        return ArrayReduce.call(slots, \n        // @ts-expect-error Array#reduce has a generic that gets lost in our retyped ArrayReduce\n        (seed, slot) => {\n            if (resolver === getShadowRootResolver(slot)) {\n                ArrayPush.apply(seed, getFilteredSlotAssignedNodes(slot));\n            }\n            return seed;\n        }, []);\n    }\n    else {\n        // slot element\n        const children = arrayFromCollection(childNodesGetter.call(node));\n        const resolver = getShadowRootResolver(node);\n        return ArrayFilter.call(children, (child) => resolver === getShadowRootResolver(child));\n    }\n}\nfunction getFilteredSlotAssignedNodes(slot) {\n    const owner = getNodeOwner(slot);\n    if (isNull(owner)) {\n        return [];\n    }\n    const childNodes = arrayFromCollection(childNodesGetter.call(slot));\n    return ArrayFilter.call(childNodes, (child) => !isNodeShadowed(child) || !isNodeOwnedBy(owner, child));\n}\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n// This code is inspired by Polymer ShadyDOM Polyfill\nfunction getInnerHTML(node) {\n    let s = '';\n    const childNodes = getFilteredChildNodes(node);\n    for (let i = 0, len = childNodes.length; i < len; i += 1) {\n        s += getOuterHTML(childNodes[i]);\n    }\n    return s;\n}\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n// This code is inspired by Polymer ShadyDOM Polyfill\n// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#escapingString\nconst escapeAttrRegExp = /[&\\u00A0\"]/g;\nconst escapeDataRegExp = /[&\\u00A0<>]/g;\nconst { replace, toLowerCase } = String.prototype;\nfunction escapeReplace(c) {\n    switch (c) {\n        case '&':\n            return '&amp;';\n        case '<':\n            return '&lt;';\n        case '>':\n            return '&gt;';\n        case '\"':\n            return '&quot;';\n        case '\\u00A0':\n            return '&nbsp;';\n        default:\n            return '';\n    }\n}\nfunction escapeAttr(s) {\n    return replace.call(s, escapeAttrRegExp, escapeReplace);\n}\nfunction escapeData(s) {\n    return replace.call(s, escapeDataRegExp, escapeReplace);\n}\n// http://www.whatwg.org/specs/web-apps/current-work/#void-elements\nconst voidElements = new Set([\n    'AREA',\n    'BASE',\n    'BR',\n    'COL',\n    'COMMAND',\n    'EMBED',\n    'HR',\n    'IMG',\n    'INPUT',\n    'KEYGEN',\n    'LINK',\n    'META',\n    'PARAM',\n    'SOURCE',\n    'TRACK',\n    'WBR',\n]);\nconst plaintextParents = new Set([\n    'STYLE',\n    'SCRIPT',\n    'XMP',\n    'IFRAME',\n    'NOEMBED',\n    'NOFRAMES',\n    'PLAINTEXT',\n    'NOSCRIPT',\n]);\nfunction getOuterHTML(node) {\n    switch (node.nodeType) {\n        case ELEMENT_NODE: {\n            const { attributes: attrs } = node;\n            const tagName = tagNameGetter.call(node);\n            let s = '<' + toLowerCase.call(tagName);\n            for (let i = 0, attr; (attr = attrs[i]); i++) {\n                s += ' ' + attr.name + '=\"' + escapeAttr(attr.value) + '\"';\n            }\n            s += '>';\n            if (voidElements.has(tagName)) {\n                return s;\n            }\n            return s + getInnerHTML(node) + '</' + toLowerCase.call(tagName) + '>';\n        }\n        case TEXT_NODE: {\n            const { data, parentNode } = node;\n            if (parentNode instanceof Element &&\n                plaintextParents.has(tagNameGetter.call(parentNode))) {\n                return data;\n            }\n            return escapeData(data);\n        }\n        case CDATA_SECTION_NODE: {\n            return `<!CDATA[[${node.data}]]>`;\n        }\n        case PROCESSING_INSTRUCTION_NODE: {\n            return `<?${node.target} ${node.data}?>`;\n        }\n        case COMMENT_NODE: {\n            return `<!--${node.data}-->`;\n        }\n        default: {\n            // intentionally ignoring unknown node types\n            // Note: since this routine is always invoked for childNodes\n            // we can safety ignore type 9, 10 and 99 (document, fragment and doctype)\n            return '';\n        }\n    }\n}\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n// This code is inspired by Polymer ShadyDOM Polyfill\nfunction getTextContent(node) {\n    switch (node.nodeType) {\n        case ELEMENT_NODE: {\n            const childNodes = getFilteredChildNodes(node);\n            let content = '';\n            for (let i = 0, len = childNodes.length; i < len; i += 1) {\n                const currentNode = childNodes[i];\n                if (currentNode.nodeType !== COMMENT_NODE) {\n                    content += getTextContent(currentNode);\n                }\n            }\n            return content;\n        }\n        default:\n            return node.nodeValue;\n    }\n}\n\n/*\n * Copyright (c) 2024, Salesforce, Inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst Items$1 = new WeakMap();\nfunction StaticNodeList() {\n    throw new TypeError('Illegal constructor');\n}\nStaticNodeList.prototype = create(NodeList.prototype, {\n    constructor: {\n        writable: true,\n        configurable: true,\n        value: StaticNodeList,\n    },\n    item: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(index) {\n            return this[index];\n        },\n    },\n    length: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return Items$1.get(this).length;\n        },\n    },\n    // Iterator protocol\n    forEach: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(cb, thisArg) {\n            forEach.call(Items$1.get(this), cb, thisArg);\n        },\n    },\n    entries: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value() {\n            return ArrayMap.call(Items$1.get(this), (v, i) => [i, v]);\n        },\n    },\n    keys: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value() {\n            return ArrayMap.call(Items$1.get(this), (_v, i) => i);\n        },\n    },\n    values: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value() {\n            return Items$1.get(this);\n        },\n    },\n    [Symbol.iterator]: {\n        writable: true,\n        configurable: true,\n        value() {\n            let nextIndex = 0;\n            return {\n                next: () => {\n                    const items = Items$1.get(this);\n                    return nextIndex < items.length\n                        ? {\n                            value: items[nextIndex++],\n                            done: false,\n                        }\n                        : {\n                            done: true,\n                        };\n                },\n            };\n        },\n    },\n    [Symbol.toStringTag]: {\n        configurable: true,\n        get() {\n            return 'NodeList';\n        },\n    },\n    // IE11 doesn't support Symbol.toStringTag, in which case we\n    // provide the regular toString method.\n    toString: {\n        writable: true,\n        configurable: true,\n        value() {\n            return '[object NodeList]';\n        },\n    },\n});\n// prototype inheritance dance\nsetPrototypeOf(StaticNodeList, NodeList);\nfunction createStaticNodeList(items) {\n    const nodeList = create(StaticNodeList.prototype);\n    Items$1.set(nodeList, items);\n    // setting static indexes\n    forEach.call(items, (item, index) => {\n        defineProperty(nodeList, index, {\n            value: item,\n            enumerable: true,\n            configurable: true,\n        });\n    });\n    return nodeList;\n}\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n// Walk up the DOM tree, collecting all shadow roots plus the document root\nfunction getAllRootNodes(node) {\n    const rootNodes = [];\n    let currentRootNode = node.getRootNode();\n    while (!isUndefined(currentRootNode)) {\n        rootNodes.push(currentRootNode);\n        currentRootNode = currentRootNode.host?.getRootNode();\n    }\n    return rootNodes;\n}\n// Keep searching up the host tree until we find an element that is within the immediate shadow root\nconst findAncestorHostInImmediateShadowRoot = (rootNode, targetRootNode) => {\n    let host;\n    while (!isUndefined((host = rootNode.host))) {\n        const thisRootNode = host.getRootNode();\n        if (thisRootNode === targetRootNode) {\n            return host;\n        }\n        rootNode = thisRootNode;\n    }\n};\nfunction fauxElementsFromPoint(context, doc, left, top) {\n    const elements = elementsFromPoint.call(doc, left, top);\n    const result = [];\n    const rootNodes = getAllRootNodes(context);\n    // Filter the elements array to only include those elements that are in this shadow root or in one of its\n    // ancestor roots. This matches Chrome and Safari's implementation (but not Firefox's, which only includes\n    // elements in the immediate shadow root: https://crbug.com/1207863#c4).\n    if (!isNull(elements)) {\n        // can be null in IE https://developer.mozilla.org/en-US/docs/Web/API/Document/elementsFromPoint#browser_compatibility\n        for (let i = 0; i < elements.length; i++) {\n            const element = elements[i];\n            if (isSyntheticSlotElement(element)) {\n                continue;\n            }\n            const elementRootNode = element.getRootNode();\n            if (ArrayIndexOf.call(rootNodes, elementRootNode) !== -1) {\n                ArrayPush.call(result, element);\n                continue;\n            }\n            // In cases where the host element is not visible but its shadow descendants are, then\n            // we may get the shadow descendant instead of the host element here. (The\n            // browser doesn't know the difference in synthetic shadow DOM.)\n            // In native shadow DOM, however, elementsFromPoint would return the host but not\n            // the child. So we need to detect if this shadow element's host is accessible from\n            // the context's shadow root. Note we also need to be careful not to add the host\n            // multiple times.\n            const ancestorHost = findAncestorHostInImmediateShadowRoot(elementRootNode, rootNodes[0]);\n            if (!isUndefined(ancestorHost) &&\n                ArrayIndexOf.call(elements, ancestorHost) === -1 &&\n                ArrayIndexOf.call(result, ancestorHost) === -1) {\n                ArrayPush.call(result, ancestorHost);\n            }\n        }\n    }\n    return result;\n}\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst Items = new WeakMap();\nfunction StaticHTMLCollection() {\n    throw new TypeError('Illegal constructor');\n}\nStaticHTMLCollection.prototype = create(HTMLCollection.prototype, {\n    constructor: {\n        writable: true,\n        configurable: true,\n        value: StaticHTMLCollection,\n    },\n    item: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(index) {\n            return this[index];\n        },\n    },\n    length: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return Items.get(this).length;\n        },\n    },\n    // https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem-key\n    namedItem: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(name) {\n            if (name === '') {\n                return null;\n            }\n            const items = Items.get(this);\n            for (let i = 0, len = items.length; i < len; i++) {\n                const item = items[len];\n                if (name === getAttribute.call(item, 'id') ||\n                    name === getAttribute.call(item, 'name')) {\n                    return item;\n                }\n            }\n            return null;\n        },\n    },\n    [Symbol.toStringTag]: {\n        configurable: true,\n        get() {\n            return 'HTMLCollection';\n        },\n    },\n    // IE11 doesn't support Symbol.toStringTag, in which case we\n    // provide the regular toString method.\n    toString: {\n        writable: true,\n        configurable: true,\n        value() {\n            return '[object HTMLCollection]';\n        },\n    },\n});\n// prototype inheritance dance\nsetPrototypeOf(StaticHTMLCollection, HTMLCollection);\nfunction createStaticHTMLCollection(items) {\n    const collection = create(StaticHTMLCollection.prototype);\n    Items.set(collection, items);\n    // setting static indexes\n    forEach.call(items, (item, index) => {\n        defineProperty(collection, index, {\n            value: item,\n            enumerable: true,\n            configurable: true,\n        });\n    });\n    return collection;\n}\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst getRootNode = getRootNode$1 ??\n    // Polyfill for older browsers where it's not defined\n    function () {\n        // eslint-disable-next-line @typescript-eslint/no-this-alias\n        let node = this;\n        let nodeParent = parentNodeGetter.call(node);\n        while (!isNull(nodeParent)) {\n            node = nodeParent;\n            nodeParent = parentElementGetter.call(node);\n        }\n        return node;\n    };\n/**\n * This method checks whether or not the content of the node is computed\n * based on the light-dom slotting mechanism. This applies to synthetic slot elements\n * and elements with shadow dom attached to them. It doesn't apply to native slot elements\n * because we don't want to patch the children getters for those elements.\n * @param node\n */\nfunction hasMountedChildren(node) {\n    return isSyntheticSlotElement(node) || isSyntheticShadowHost(node);\n}\nfunction getShadowParent(node, value) {\n    const owner = getNodeOwner(node);\n    if (value === owner) {\n        // walking up via parent chain might end up in the shadow root element\n        return getShadowRoot(owner);\n    }\n    else if (value instanceof Element) {\n        if (getNodeNearestOwnerKey(node) === getNodeNearestOwnerKey(value)) {\n            // the element and its parent node belong to the same shadow root\n            return value;\n        }\n        else if (!isNull(owner) && isSlotElement(value)) {\n            // slotted elements must be top level childNodes of the slot element\n            // where they slotted into, but its shadowed parent is always the\n            // owner of the slot.\n            const slotOwner = getNodeOwner(value);\n            if (!isNull(slotOwner) && isNodeOwnedBy(owner, slotOwner)) {\n                // it is a slotted element, and therefore its parent is always going to be the host of the slot\n                return slotOwner;\n            }\n        }\n    }\n    return null;\n}\nfunction hasChildNodesPatched() {\n    return getInternalChildNodes(this).length > 0;\n}\nfunction firstChildGetterPatched() {\n    const childNodes = getInternalChildNodes(this);\n    return childNodes[0] || null;\n}\nfunction lastChildGetterPatched() {\n    const childNodes = getInternalChildNodes(this);\n    return childNodes[childNodes.length - 1] || null;\n}\nfunction textContentGetterPatched() {\n    return getTextContent(this);\n}\nfunction textContentSetterPatched(value) {\n    textContextSetter.call(this, value);\n}\nfunction parentNodeGetterPatched() {\n    const value = parentNodeGetter.call(this);\n    if (isNull(value)) {\n        return value;\n    }\n    // TODO [#1635]: this needs optimization, maybe implementing it based on this.assignedSlot\n    return getShadowParent(this, value);\n}\nfunction parentElementGetterPatched() {\n    const value = parentNodeGetter.call(this);\n    if (isNull(value)) {\n        return null;\n    }\n    const parentNode = getShadowParent(this, value);\n    // it could be that the parentNode is the shadowRoot, in which case\n    // we need to return null.\n    // TODO [#1635]: this needs optimization, maybe implementing it based on this.assignedSlot\n    return parentNode instanceof Element ? parentNode : null;\n}\nfunction containsPatched$1(otherNode) {\n    if (otherNode == null || getNodeOwnerKey(this) !== getNodeOwnerKey(otherNode)) {\n        // it is from another shadow\n        return false;\n    }\n    return (compareDocumentPosition.call(this, otherNode) & DOCUMENT_POSITION_CONTAINED_BY) !== 0;\n}\nfunction cloneNodePatched(deep) {\n    const clone = cloneNode.call(this, false);\n    // Per spec, browsers only care about truthy values\n    // Not strict true or false\n    if (!deep) {\n        return clone;\n    }\n    const childNodes = getInternalChildNodes(this);\n    for (let i = 0, len = childNodes.length; i < len; i += 1) {\n        clone.appendChild(childNodes[i].cloneNode(true));\n    }\n    return clone;\n}\n/**\n * This method only applies to elements with a shadow or slots\n */\nfunction childNodesGetterPatched() {\n    if (isSyntheticShadowHost(this)) {\n        const owner = getNodeOwner(this);\n        const filteredChildNodes = getFilteredChildNodes(this);\n        // No need to filter by owner for non-shadowed nodes\n        const childNodes = isNull(owner)\n            ? filteredChildNodes\n            : getAllMatches(owner, filteredChildNodes);\n        return createStaticNodeList(childNodes);\n    }\n    // nothing to do here since this does not have a synthetic shadow attached to it\n    // TODO [#1636]: what about slot elements?\n    return childNodesGetter.call(this);\n}\n/**\n * Get the shadow root\n * getNodeOwner() returns the host element that owns the given node\n * Note: getNodeOwner() returns null when running in native-shadow mode.\n * Fallback to using the native getRootNode() to discover the root node.\n * This is because, it is not possible to inspect the node and decide if it is part\n * of a native shadow or the synthetic shadow.\n * @param node\n */\nfunction getNearestRoot(node) {\n    const ownerNode = getNodeOwner(node);\n    if (isNull(ownerNode)) {\n        // we hit a wall, either we are in native shadow mode or the node is not in lwc boundary.\n        return getRootNode.call(node);\n    }\n    return getShadowRoot(ownerNode);\n}\n/**\n * If looking for a root node beyond shadow root by calling `node.getRootNode({composed: true})`, use the original `Node.prototype.getRootNode` method\n * to return the root of the dom tree. In IE11 and Edge, Node.prototype.getRootNode is\n * [not supported](https://developer.mozilla.org/en-US/docs/Web/API/Node/getRootNode#Browser_compatibility). The root node is discovered by manually\n * climbing up the dom tree.\n *\n * If looking for a shadow root of a node by calling `node.getRootNode({composed: false})` or `node.getRootNode()`,\n *\n * 1. Try to identify the host element that owns the give node.\n * i. Identify the shadow tree that the node belongs to\n * ii. If the node belongs to a shadow tree created by engine, return the shadowRoot of the host element that owns the shadow tree\n * 2. The host identification logic returns null in two cases:\n * i. The node does not belong to a shadow tree created by engine\n * ii. The engine is running in native shadow dom mode\n * If so, use the original Node.prototype.getRootNode to fetch the root node(or manually climb up the dom tree where getRootNode() is unsupported)\n *\n * _Spec_: https://dom.spec.whatwg.org/#dom-node-getrootnode\n * @param options\n */\nfunction getRootNodePatched$3(options) {\n    return options?.composed ? getRootNode.call(this, options) : getNearestRoot(this);\n}\nfunction compareDocumentPositionPatched(otherNode) {\n    if (this === otherNode) {\n        return 0;\n    }\n    else if (getRootNodePatched$3.call(this) === otherNode) {\n        // \"this\" is in a shadow tree where the shadow root is the \"otherNode\".\n        return 10; // Node.DOCUMENT_POSITION_CONTAINS | Node.DOCUMENT_POSITION_PRECEDING\n    }\n    else if (getNodeOwnerKey(this) !== getNodeOwnerKey(otherNode)) {\n        // \"this\" and \"otherNode\" belongs to 2 different shadow tree.\n        return 35; // Node.DOCUMENT_POSITION_DISCONNECTED | Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC | Node.DOCUMENT_POSITION_PRECEDING\n    }\n    // Since \"this\" and \"otherNode\" are part of the same shadow tree we can safely rely to the native\n    // Node.compareDocumentPosition implementation.\n    return compareDocumentPosition.call(this, otherNode);\n}\n// Non-deep-traversing patches: this descriptor map includes all descriptors that\n// do not give access to nodes beyond the immediate children.\ndefineProperties(_Node.prototype, {\n    firstChild: {\n        get() {\n            if (hasMountedChildren(this)) {\n                return firstChildGetterPatched.call(this);\n            }\n            return firstChildGetter.call(this);\n        },\n        enumerable: true,\n        configurable: true,\n    },\n    lastChild: {\n        get() {\n            if (hasMountedChildren(this)) {\n                return lastChildGetterPatched.call(this);\n            }\n            return lastChildGetter.call(this);\n        },\n        enumerable: true,\n        configurable: true,\n    },\n    textContent: {\n        get() {\n            // Note: we deviate from native shadow here, but are not fixing\n            // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n            if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {\n                return textContentGetterPatched.call(this);\n            }\n            return textContentGetter.call(this);\n        },\n        set: textContentSetterPatched,\n        enumerable: true,\n        configurable: true,\n    },\n    parentNode: {\n        get() {\n            if (isNodeShadowed(this)) {\n                return parentNodeGetterPatched.call(this);\n            }\n            const parentNode = parentNodeGetter.call(this);\n            // Handle the case where a top level light DOM element is slotted into a synthetic\n            // shadow slot.\n            if (!isNull(parentNode) && isSyntheticSlotElement(parentNode)) {\n                return getNodeOwner(parentNode);\n            }\n            return parentNode;\n        },\n        enumerable: true,\n        configurable: true,\n    },\n    parentElement: {\n        get() {\n            if (isNodeShadowed(this)) {\n                return parentElementGetterPatched.call(this);\n            }\n            const parentElement = parentElementGetter.call(this);\n            // Handle the case where a top level light DOM element is slotted into a synthetic\n            // shadow slot.\n            if (!isNull(parentElement) && isSyntheticSlotElement(parentElement)) {\n                return getNodeOwner(parentElement);\n            }\n            return parentElement;\n        },\n        enumerable: true,\n        configurable: true,\n    },\n    childNodes: {\n        get() {\n            if (hasMountedChildren(this)) {\n                return childNodesGetterPatched.call(this);\n            }\n            return childNodesGetter.call(this);\n        },\n        enumerable: true,\n        configurable: true,\n    },\n    hasChildNodes: {\n        value() {\n            if (hasMountedChildren(this)) {\n                return hasChildNodesPatched.call(this);\n            }\n            return hasChildNodes.call(this);\n        },\n        enumerable: true,\n        writable: true,\n        configurable: true,\n    },\n    compareDocumentPosition: {\n        value(otherNode) {\n            // Note: we deviate from native shadow here, but are not fixing\n            // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n            if (isGlobalPatchingSkipped(this)) {\n                return compareDocumentPosition.call(this, otherNode);\n            }\n            return compareDocumentPositionPatched.call(this, otherNode);\n        },\n        enumerable: true,\n        writable: true,\n        configurable: true,\n    },\n    contains: {\n        value(otherNode) {\n            // 1. Node.prototype.contains() returns true if otherNode is an inclusive descendant\n            //    spec: https://dom.spec.whatwg.org/#dom-node-contains\n            // 2. This normalizes the behavior of this api across all browsers.\n            //    In IE11, a disconnected dom element without children invoking contains() on self, returns false\n            if (this === otherNode) {\n                return true;\n            }\n            // Note: we deviate from native shadow here, but are not fixing\n            // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n            if (otherNode == null) {\n                return false;\n            }\n            if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {\n                return containsPatched$1.call(this, otherNode);\n            }\n            return contains.call(this, otherNode);\n        },\n        enumerable: true,\n        writable: true,\n        configurable: true,\n    },\n    cloneNode: {\n        value(deep) {\n            // Note: we deviate from native shadow here, but are not fixing\n            // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n            if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {\n                return cloneNodePatched.call(this, deep);\n            }\n            return cloneNode.call(this, deep);\n        },\n        enumerable: true,\n        writable: true,\n        configurable: true,\n    },\n    getRootNode: {\n        value: getRootNodePatched$3,\n        enumerable: true,\n        configurable: true,\n        writable: true,\n    },\n    isConnected: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return isConnected.call(this);\n        },\n    },\n});\nconst getInternalChildNodes = function (node) {\n    return node.childNodes;\n};\n// IE11 extra patches for wrong prototypes\nif (hasOwnProperty.call(HTMLElement.prototype, 'contains')) {\n    defineProperty(HTMLElement.prototype, 'contains', getOwnPropertyDescriptor(_Node.prototype, 'contains'));\n}\nif (hasOwnProperty.call(HTMLElement.prototype, 'parentElement')) {\n    defineProperty(HTMLElement.prototype, 'parentElement', getOwnPropertyDescriptor(_Node.prototype, 'parentElement'));\n}\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst EventListenerMap = new WeakMap();\nconst ComposedPathMap = new WeakMap();\nfunction isEventListenerOrEventListenerObject$1(fnOrObj) {\n    return (isFunction(fnOrObj) ||\n        (isObject(fnOrObj) &&\n            !isNull(fnOrObj) &&\n            isFunction(fnOrObj.handleEvent)));\n}\nfunction shouldInvokeListener(event, target, currentTarget) {\n    // Subsequent logic assumes that `currentTarget` must be contained in the composed path for the listener to be\n    // invoked, but this is not always the case. `composedPath()` will sometimes return an empty array, even when the\n    // listener should be invoked (e.g., a disconnected instance of EventTarget, an instance of XMLHttpRequest, etc).\n    if (target === currentTarget) {\n        return true;\n    }\n    let composedPath = ComposedPathMap.get(event);\n    if (isUndefined(composedPath)) {\n        composedPath = event.composedPath();\n        ComposedPathMap.set(event, composedPath);\n    }\n    return composedPath.includes(currentTarget);\n}\nfunction getEventListenerWrapper(fnOrObj) {\n    if (!isEventListenerOrEventListenerObject$1(fnOrObj)) {\n        return fnOrObj;\n    }\n    let wrapperFn = EventListenerMap.get(fnOrObj);\n    if (isUndefined(wrapperFn)) {\n        wrapperFn = function (event) {\n            // This function is invoked from an event listener and currentTarget is always defined.\n            const currentTarget = eventCurrentTargetGetter.call(event);\n            if (process.env.NODE_ENV !== 'production') {\n                assert.invariant(isFalse(isSyntheticShadowHost(currentTarget)), 'This routine should not be used to wrap event listeners for host elements and shadow roots.');\n            }\n            const actualTarget = getActualTarget(event);\n            if (!shouldInvokeListener(event, actualTarget, currentTarget)) {\n                return;\n            }\n            return isFunction(fnOrObj)\n                ? fnOrObj.call(this, event)\n                : fnOrObj.handleEvent && fnOrObj.handleEvent(event);\n        };\n        EventListenerMap.set(fnOrObj, wrapperFn);\n    }\n    return wrapperFn;\n}\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst eventToContextMap = new WeakMap();\nfunction getEventHandler(listener) {\n    if (isFunction(listener)) {\n        return listener;\n    }\n    else {\n        return listener.handleEvent;\n    }\n}\nfunction isEventListenerOrEventListenerObject(listener) {\n    return isFunction(listener) || isFunction(listener?.handleEvent);\n}\nconst customElementToWrappedListeners = new WeakMap();\nfunction getEventMap(elm) {\n    let listenerInfo = customElementToWrappedListeners.get(elm);\n    if (isUndefined(listenerInfo)) {\n        listenerInfo = create(null);\n        customElementToWrappedListeners.set(elm, listenerInfo);\n    }\n    return listenerInfo;\n}\n/**\n * Events dispatched on shadow roots actually end up being dispatched on their hosts. This means that the event.target\n * property of events dispatched on shadow roots always resolve to their host. This function understands this\n * abstraction and properly returns a reference to the shadow root when appropriate.\n * @param event\n */\nfunction getActualTarget(event) {\n    return eventToShadowRootMap.get(event) ?? eventTargetGetter.call(event);\n}\nconst shadowRootEventListenerMap = new WeakMap();\nfunction getManagedShadowRootListener(listener) {\n    if (!isEventListenerOrEventListenerObject(listener)) {\n        throw new TypeError(); // avoiding problems with non-valid listeners\n    }\n    let managedListener = shadowRootEventListenerMap.get(listener);\n    if (isUndefined(managedListener)) {\n        managedListener = {\n            identity: listener,\n            placement: 1 /* EventListenerContext.SHADOW_ROOT_LISTENER */,\n            handleEvent(event) {\n                // currentTarget is always defined inside an event listener\n                let currentTarget = eventCurrentTargetGetter.call(event);\n                // If currentTarget is not an instance of a native shadow root then we're dealing with a\n                // host element whose synthetic shadow root must be accessed via getShadowRoot().\n                if (!isInstanceOfNativeShadowRoot(currentTarget)) {\n                    currentTarget = getShadowRoot(currentTarget);\n                }\n                const actualTarget = getActualTarget(event);\n                if (shouldInvokeListener(event, actualTarget, currentTarget)) {\n                    getEventHandler(listener).call(currentTarget, event);\n                }\n            },\n        };\n        shadowRootEventListenerMap.set(listener, managedListener);\n    }\n    return managedListener;\n}\nconst customElementEventListenerMap = new WeakMap();\nfunction getManagedCustomElementListener(listener) {\n    if (!isEventListenerOrEventListenerObject(listener)) {\n        throw new TypeError(); // avoiding problems with non-valid listeners\n    }\n    let managedListener = customElementEventListenerMap.get(listener);\n    if (isUndefined(managedListener)) {\n        managedListener = {\n            identity: listener,\n            placement: 0 /* EventListenerContext.CUSTOM_ELEMENT_LISTENER */,\n            handleEvent(event) {\n                // currentTarget is always defined inside an event listener\n                const currentTarget = eventCurrentTargetGetter.call(event);\n                const actualTarget = getActualTarget(event);\n                if (shouldInvokeListener(event, actualTarget, currentTarget)) {\n                    getEventHandler(listener).call(currentTarget, event);\n                }\n            },\n        };\n        customElementEventListenerMap.set(listener, managedListener);\n    }\n    return managedListener;\n}\nfunction indexOfManagedListener(listeners, listener) {\n    return ArrayFindIndex.call(listeners, (l) => l.identity === listener.identity);\n}\nfunction domListener(evt) {\n    let immediatePropagationStopped = false;\n    let propagationStopped = false;\n    const { type, stopImmediatePropagation, stopPropagation } = evt;\n    // currentTarget is always defined\n    const currentTarget = eventCurrentTargetGetter.call(evt);\n    const listenerMap = getEventMap(currentTarget);\n    const listeners = listenerMap[type]; // it must have listeners at this point\n    defineProperty(evt, 'stopImmediatePropagation', {\n        value() {\n            immediatePropagationStopped = true;\n            stopImmediatePropagation.call(evt);\n        },\n        writable: true,\n        enumerable: true,\n        configurable: true,\n    });\n    defineProperty(evt, 'stopPropagation', {\n        value() {\n            propagationStopped = true;\n            stopPropagation.call(evt);\n        },\n        writable: true,\n        enumerable: true,\n        configurable: true,\n    });\n    // in case a listener adds or removes other listeners during invocation\n    const bookkeeping = ArraySlice.call(listeners);\n    function invokeListenersByPlacement(placement) {\n        forEach.call(bookkeeping, (listener) => {\n            if (isFalse(immediatePropagationStopped) && listener.placement === placement) {\n                // making sure that the listener was not removed from the original listener queue\n                if (indexOfManagedListener(listeners, listener) !== -1) {\n                    // all handlers on the custom element should be called with undefined 'this'\n                    listener.handleEvent.call(undefined, evt);\n                }\n            }\n        });\n    }\n    eventToContextMap.set(evt, 1 /* EventListenerContext.SHADOW_ROOT_LISTENER */);\n    invokeListenersByPlacement(1 /* EventListenerContext.SHADOW_ROOT_LISTENER */);\n    if (isFalse(immediatePropagationStopped) && isFalse(propagationStopped)) {\n        // doing the second iteration only if the first one didn't interrupt the event propagation\n        eventToContextMap.set(evt, 0 /* EventListenerContext.CUSTOM_ELEMENT_LISTENER */);\n        invokeListenersByPlacement(0 /* EventListenerContext.CUSTOM_ELEMENT_LISTENER */);\n    }\n    eventToContextMap.set(evt, 2 /* EventListenerContext.UNKNOWN_LISTENER */);\n}\nfunction attachDOMListener(elm, type, managedListener) {\n    const listenerMap = getEventMap(elm);\n    let listeners = listenerMap[type];\n    if (isUndefined(listeners)) {\n        listeners = listenerMap[type] = [];\n    }\n    // Prevent identical listeners from subscribing to the same event type.\n    // TODO [#1824]: Options will also play a factor in deduping if we introduce options support\n    if (indexOfManagedListener(listeners, managedListener) !== -1) {\n        return;\n    }\n    // only add to DOM if there is no other listener on the same placement yet\n    if (listeners.length === 0) {\n        addEventListener.call(elm, type, domListener);\n    }\n    ArrayPush.call(listeners, managedListener);\n}\nfunction detachDOMListener(elm, type, managedListener) {\n    const listenerMap = getEventMap(elm);\n    let index;\n    let listeners;\n    if (!isUndefined((listeners = listenerMap[type])) &&\n        (index = indexOfManagedListener(listeners, managedListener)) !== -1) {\n        ArraySplice.call(listeners, index, 1);\n        // only remove from DOM if there is no other listener on the same placement\n        if (listeners.length === 0) {\n            removeEventListener.call(elm, type, domListener);\n        }\n    }\n}\nfunction addCustomElementEventListener(type, listener, _options) {\n    if (process.env.NODE_ENV !== 'production') {\n        if (!isEventListenerOrEventListenerObject(listener)) {\n            throw new TypeError(`Invalid second argument for Element.addEventListener() in ${toString(this)} for event \"${type}\". Expected EventListener or EventListenerObject but received ${toString(listener)}.`);\n        }\n    }\n    if (isEventListenerOrEventListenerObject(listener)) {\n        const managedListener = getManagedCustomElementListener(listener);\n        attachDOMListener(this, type, managedListener);\n    }\n}\nfunction removeCustomElementEventListener(type, listener, _options) {\n    if (isEventListenerOrEventListenerObject(listener)) {\n        const managedListener = getManagedCustomElementListener(listener);\n        detachDOMListener(this, type, managedListener);\n    }\n}\nfunction addShadowRootEventListener(sr, type, listener, _options) {\n    if (process.env.NODE_ENV !== 'production') {\n        if (!isEventListenerOrEventListenerObject(listener)) {\n            throw new TypeError(`Invalid second argument for ShadowRoot.addEventListener() in ${toString(sr)} for event \"${type}\". Expected EventListener or EventListenerObject but received ${toString(listener)}.`);\n        }\n    }\n    if (isEventListenerOrEventListenerObject(listener)) {\n        const elm = getHost(sr);\n        const managedListener = getManagedShadowRootListener(listener);\n        attachDOMListener(elm, type, managedListener);\n    }\n}\nfunction removeShadowRootEventListener(sr, type, listener, _options) {\n    if (isEventListenerOrEventListenerObject(listener)) {\n        const elm = getHost(sr);\n        const managedListener = getManagedShadowRootListener(listener);\n        detachDOMListener(elm, type, managedListener);\n    }\n}\n\n/*\n * Copyright (c) 2023, Salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst getRootNodePatched$2 = _Node.prototype.getRootNode;\nassert.isFalse(String(getRootNodePatched$2).includes('[native code]'), 'Node prototype must be patched before patching shadow root.');\nconst InternalSlot = new WeakMap();\nconst { createDocumentFragment } = document;\nfunction hasInternalSlot(root) {\n    return InternalSlot.has(root);\n}\nfunction getInternalSlot(root) {\n    const record = InternalSlot.get(root);\n    if (isUndefined(record)) {\n        throw new TypeError();\n    }\n    return record;\n}\ndefineProperty(_Node.prototype, KEY__SHADOW_RESOLVER, {\n    set(fn) {\n        if (isUndefined(fn))\n            return;\n        this[KEY__SHADOW_RESOLVER_PRIVATE] = fn;\n        // TODO [#1164]: temporary propagation of the key\n        setNodeOwnerKey(this, fn.nodeKey);\n    },\n    get() {\n        return this[KEY__SHADOW_RESOLVER_PRIVATE];\n    },\n    configurable: true,\n    enumerable: true,\n});\n// The isUndefined check is because two copies of synthetic shadow may be loaded on the same page, and this\n// would throw an error if we tried to redefine it. Plus the whole point is to expose the native method.\nif (isUndefined(globalThis[KEY__NATIVE_GET_ELEMENT_BY_ID])) {\n    defineProperty(globalThis, KEY__NATIVE_GET_ELEMENT_BY_ID, {\n        value: getElementById,\n        configurable: true,\n    });\n}\n// See note above.\nif (isUndefined(globalThis[KEY__NATIVE_QUERY_SELECTOR_ALL])) {\n    defineProperty(globalThis, KEY__NATIVE_QUERY_SELECTOR_ALL, {\n        value: querySelectorAll,\n        configurable: true,\n    });\n}\nfunction getShadowRootResolver(node) {\n    return node[KEY__SHADOW_RESOLVER];\n}\nfunction setShadowRootResolver(node, fn) {\n    node[KEY__SHADOW_RESOLVER] = fn;\n}\nfunction isDelegatingFocus(host) {\n    return getInternalSlot(host).delegatesFocus;\n}\nfunction getHost(root) {\n    return getInternalSlot(root).host;\n}\nfunction getShadowRoot(elm) {\n    return getInternalSlot(elm).shadowRoot;\n}\n// Intentionally adding `Node` here in addition to `Element` since this check is harmless for nodes\n// and we can avoid having to cast the type before calling this method in a few places.\nfunction isSyntheticShadowHost(node) {\n    const shadowRootRecord = InternalSlot.get(node);\n    return !isUndefined(shadowRootRecord) && node === shadowRootRecord.host;\n}\nfunction isSyntheticShadowRoot(node) {\n    const shadowRootRecord = InternalSlot.get(node);\n    return !isUndefined(shadowRootRecord) && node === shadowRootRecord.shadowRoot;\n}\nlet uid = 0;\nfunction attachShadow(elm, options) {\n    if (InternalSlot.has(elm)) {\n        throw new Error(`Failed to execute 'attachShadow' on 'Element': Shadow root cannot be created on a host which already hosts a shadow tree.`);\n    }\n    const { mode, delegatesFocus } = options;\n    // creating a real fragment for shadowRoot instance\n    const doc = getOwnerDocument(elm);\n    const sr = createDocumentFragment.call(doc);\n    // creating shadow internal record\n    const record = {\n        mode,\n        delegatesFocus: !!delegatesFocus,\n        host: elm,\n        shadowRoot: sr,\n    };\n    InternalSlot.set(sr, record);\n    InternalSlot.set(elm, record);\n    const shadowResolver = () => sr;\n    const x = (shadowResolver.nodeKey = uid++);\n    setNodeKey(elm, x);\n    setShadowRootResolver(sr, shadowResolver);\n    // correcting the proto chain\n    setPrototypeOf(sr, SyntheticShadowRoot.prototype);\n    return sr;\n}\n// Defined separately from others because it's used in `compareDocumentPosition`\nfunction containsPatched(otherNode) {\n    if (this === otherNode) {\n        return true;\n    }\n    const host = getHost(this);\n    // must be child of the host and owned by it.\n    return ((compareDocumentPosition.call(host, otherNode) & DOCUMENT_POSITION_CONTAINED_BY) !== 0 &&\n        isNodeOwnedBy(host, otherNode));\n}\nconst SyntheticShadowRootDescriptors = {\n    constructor: {\n        writable: true,\n        configurable: true,\n        value: SyntheticShadowRoot,\n    },\n    toString: {\n        writable: true,\n        configurable: true,\n        value() {\n            return `[object ShadowRoot]`;\n        },\n    },\n    synthetic: {\n        writable: false,\n        enumerable: false,\n        configurable: false,\n        value: true,\n    },\n};\nconst ShadowRootDescriptors = {\n    activeElement: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            const host = getHost(this);\n            const doc = getOwnerDocument(host);\n            const activeElement = DocumentPrototypeActiveElement.call(doc);\n            if (isNull(activeElement)) {\n                return activeElement;\n            }\n            if ((compareDocumentPosition.call(host, activeElement) &\n                DOCUMENT_POSITION_CONTAINED_BY) ===\n                0) {\n                return null;\n            }\n            // activeElement must be child of the host and owned by it\n            let node = activeElement;\n            while (!isNodeOwnedBy(host, node)) {\n                // parentElement is always an element because we are talking up the tree knowing\n                // that it is a child of the host.\n                node = parentElementGetter.call(node);\n            }\n            // If we have a slot element here that means that we were dealing\n            // with an element that was passed to one of our slots. In this\n            // case, activeElement returns null.\n            if (isSlotElement(node)) {\n                return null;\n            }\n            return node;\n        },\n    },\n    delegatesFocus: {\n        configurable: true,\n        get() {\n            return getInternalSlot(this).delegatesFocus;\n        },\n    },\n    elementFromPoint: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(left, top) {\n            const host = getHost(this);\n            const doc = getOwnerDocument(host);\n            return fauxElementFromPoint(this, doc, left, top);\n        },\n    },\n    elementsFromPoint: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(left, top) {\n            const host = getHost(this);\n            const doc = getOwnerDocument(host);\n            return fauxElementsFromPoint(this, doc, left, top);\n        },\n    },\n    getSelection: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value() {\n            throw new Error('Disallowed method \"getSelection\" on ShadowRoot.');\n        },\n    },\n    host: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return getHost(this);\n        },\n    },\n    mode: {\n        configurable: true,\n        get() {\n            return getInternalSlot(this).mode;\n        },\n    },\n    styleSheets: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            throw new Error();\n        },\n    },\n};\nconst eventToShadowRootMap = new WeakMap();\nconst NodePatchDescriptors = {\n    insertBefore: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(newChild, refChild) {\n            insertBefore.call(getHost(this), newChild, refChild);\n            return newChild;\n        },\n    },\n    removeChild: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(oldChild) {\n            removeChild.call(getHost(this), oldChild);\n            return oldChild;\n        },\n    },\n    appendChild: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(newChild) {\n            appendChild.call(getHost(this), newChild);\n            return newChild;\n        },\n    },\n    replaceChild: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(newChild, oldChild) {\n            replaceChild.call(getHost(this), newChild, oldChild);\n            return oldChild;\n        },\n    },\n    addEventListener: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(type, listener, options) {\n            addShadowRootEventListener(this, type, listener);\n        },\n    },\n    dispatchEvent: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(evt) {\n            eventToShadowRootMap.set(evt, this);\n            // Typescript does not like it when you treat the `arguments` object as an array\n            // @ts-expect-error type-mismatch\n            return dispatchEvent.apply(getHost(this), arguments);\n        },\n    },\n    removeEventListener: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(type, listener, options) {\n            removeShadowRootEventListener(this, type, listener);\n        },\n    },\n    baseURI: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return getHost(this).baseURI;\n        },\n    },\n    childNodes: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return createStaticNodeList(shadowRootChildNodes(this));\n        },\n    },\n    cloneNode: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value() {\n            throw new Error('Disallowed method \"cloneNode\" on ShadowRoot.');\n        },\n    },\n    compareDocumentPosition: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(otherNode) {\n            const host = getHost(this);\n            if (this === otherNode) {\n                // \"this\" and \"otherNode\" are the same shadow root.\n                return 0;\n            }\n            else if (containsPatched.call(this, otherNode)) {\n                // \"otherNode\" belongs to the shadow tree where \"this\" is the shadow root.\n                return 20; // Node.DOCUMENT_POSITION_CONTAINED_BY | Node.DOCUMENT_POSITION_FOLLOWING\n            }\n            else if (compareDocumentPosition.call(host, otherNode) & DOCUMENT_POSITION_CONTAINED_BY) {\n                // \"otherNode\" is in a different shadow tree contained by the shadow tree where \"this\" is the shadow root.\n                return 37; // Node.DOCUMENT_POSITION_DISCONNECTED | Node.DOCUMENT_POSITION_FOLLOWING | Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC\n            }\n            else {\n                // \"otherNode\" is in a different shadow tree that is not contained by the shadow tree where \"this\" is the shadow root.\n                return 35; // Node.DOCUMENT_POSITION_DISCONNECTED | Node.DOCUMENT_POSITION_PRECEDING | Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC\n            }\n        },\n    },\n    contains: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value: containsPatched,\n    },\n    firstChild: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            const childNodes = getInternalChildNodes(this);\n            return childNodes[0] || null;\n        },\n    },\n    lastChild: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            const childNodes = getInternalChildNodes(this);\n            return childNodes[childNodes.length - 1] || null;\n        },\n    },\n    hasChildNodes: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value() {\n            const childNodes = getInternalChildNodes(this);\n            return childNodes.length > 0;\n        },\n    },\n    isConnected: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return isConnected.call(getHost(this));\n        },\n    },\n    nextSibling: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return null;\n        },\n    },\n    previousSibling: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return null;\n        },\n    },\n    nodeName: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return '#document-fragment';\n        },\n    },\n    nodeType: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return 11; // Node.DOCUMENT_FRAGMENT_NODE\n        },\n    },\n    nodeValue: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return null;\n        },\n    },\n    ownerDocument: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return getHost(this).ownerDocument;\n        },\n    },\n    parentElement: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return null;\n        },\n    },\n    parentNode: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return null;\n        },\n    },\n    textContent: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            const childNodes = getInternalChildNodes(this);\n            let textContent = '';\n            for (let i = 0, len = childNodes.length; i < len; i += 1) {\n                const currentNode = childNodes[i];\n                if (currentNode.nodeType !== COMMENT_NODE) {\n                    textContent += getTextContent(currentNode);\n                }\n            }\n            return textContent;\n        },\n        set(v) {\n            const host = getHost(this);\n            textContextSetter.call(host, v);\n        },\n    },\n    // Since the synthetic shadow root is a detached DocumentFragment, short-circuit the getRootNode behavior\n    getRootNode: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(options) {\n            return isTrue(options?.composed)\n                ? getRootNodePatched$2.call(getHost(this), { composed: true })\n                : this;\n        },\n    },\n};\nconst ElementPatchDescriptors = {\n    innerHTML: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            const childNodes = getInternalChildNodes(this);\n            let innerHTML = '';\n            for (let i = 0, len = childNodes.length; i < len; i += 1) {\n                innerHTML += getOuterHTML(childNodes[i]);\n            }\n            return innerHTML;\n        },\n        set(v) {\n            const host = getHost(this);\n            innerHTMLSetter.call(host, v);\n        },\n    },\n};\nconst ParentNodePatchDescriptors = {\n    childElementCount: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return this.children.length;\n        },\n    },\n    children: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return createStaticHTMLCollection(ArrayFilter.call(shadowRootChildNodes(this), (elm) => elm instanceof Element));\n        },\n    },\n    firstElementChild: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            return this.children[0] || null;\n        },\n    },\n    lastElementChild: {\n        enumerable: true,\n        configurable: true,\n        get() {\n            const { children } = this;\n            return children.item(children.length - 1) || null;\n        },\n    },\n    getElementById: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value() {\n            throw new Error('Disallowed method \"getElementById\" on ShadowRoot.');\n        },\n    },\n    querySelector: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(selectors) {\n            return shadowRootQuerySelector(this, selectors);\n        },\n    },\n    querySelectorAll: {\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value(selectors) {\n            return createStaticNodeList(shadowRootQuerySelectorAll(this, selectors));\n        },\n    },\n};\nassign(SyntheticShadowRootDescriptors, NodePatchDescriptors, ParentNodePatchDescriptors, ElementPatchDescriptors, ShadowRootDescriptors);\nfunction SyntheticShadowRoot() {\n    throw new TypeError('Illegal constructor');\n}\nSyntheticShadowRoot.prototype = create(DocumentFragment.prototype, SyntheticShadowRootDescriptors);\n// `this.shadowRoot instanceof ShadowRoot` should evaluate to true even for synthetic shadow\ndefineProperty(SyntheticShadowRoot, Symbol.hasInstance, {\n    value: function (object) {\n        // Technically we should walk up the entire prototype chain, but with SyntheticShadowRoot\n        // it's reasonable to assume that no one is doing any deep subclasses here.\n        return (isObject(object) &&\n            !isNull(object) &&\n            (isInstanceOfNativeShadowRoot(object) ||\n                getPrototypeOf(object) === SyntheticShadowRoot.prototype));\n    },\n});\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nfunction isSyntheticOrNativeShadowRoot(node) {\n    return isSyntheticShadowRoot(node) || isInstanceOfNativeShadowRoot(node);\n}\n// Helpful for tests running with jsdom\nfunction getOwnerDocument(node) {\n    const doc = ownerDocumentGetter.call(node);\n    // if doc is null, it means `this` is actually a document instance\n    return doc === null ? node : doc;\n}\nfunction getOwnerWindow(node) {\n    const doc = getOwnerDocument(node);\n    const win = defaultViewGetter.call(doc);\n    if (win === null) {\n        // this method should never be called with a node that is not part\n        // of a qualifying connected node.\n        throw new TypeError();\n    }\n    return win;\n}\nlet skipGlobalPatching;\n// Note: we deviate from native shadow here, but are not fixing\n// due to backwards compat: https://github.com/salesforce/lwc/pull/3103\nfunction isGlobalPatchingSkipped(node) {\n    // we lazily compute this value instead of doing it during evaluation, this helps\n    // for apps that are setting this after the engine code is evaluated.\n    if (isUndefined(skipGlobalPatching)) {\n        const ownerDocument = getOwnerDocument(node);\n        skipGlobalPatching =\n            ownerDocument.body &&\n                getAttribute.call(ownerDocument.body, 'data-global-patching-bypass') ===\n                    'temporary-bypass';\n    }\n    return isTrue(skipGlobalPatching);\n}\nfunction arrayFromCollection(collection) {\n    const size = collection.length;\n    const cloned = [];\n    if (size > 0) {\n        for (let i = 0; i < size; i++) {\n            cloned[i] = collection[i];\n        }\n    }\n    return cloned;\n}\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nfunction pathComposer(startNode, composed) {\n    const composedPath = [];\n    let startRoot;\n    if (startNode instanceof Window) {\n        startRoot = startNode;\n    }\n    else if (startNode instanceof _Node) {\n        startRoot = startNode.getRootNode();\n    }\n    else {\n        return composedPath;\n    }\n    let current = startNode;\n    while (!isNull(current)) {\n        composedPath.push(current);\n        if (current instanceof Element || current instanceof Text) {\n            const assignedSlot = current.assignedSlot;\n            if (!isNull(assignedSlot)) {\n                current = assignedSlot;\n            }\n            else {\n                current = current.parentNode;\n            }\n        }\n        else if (isSyntheticOrNativeShadowRoot(current) && (composed || current !== startRoot)) {\n            current = current.host;\n        }\n        else if (current instanceof _Node) {\n            current = current.parentNode;\n        }\n        else {\n            // could be Window\n            current = null;\n        }\n    }\n    let doc;\n    if (startNode instanceof Window) {\n        doc = startNode.document;\n    }\n    else {\n        doc = getOwnerDocument(startNode);\n    }\n    // event composedPath includes window when startNode's ownerRoot is document\n    if (composedPath[composedPath.length - 1] === doc) {\n        composedPath.push(window);\n    }\n    return composedPath;\n}\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nfunction retarget(refNode, path) {\n    if (isNull(refNode)) {\n        return null;\n    }\n    // If ANCESTOR's root is not a shadow root or ANCESTOR's root is BASE's\n    // shadow-including inclusive ancestor, return ANCESTOR.\n    const refNodePath = pathComposer(refNode, true);\n    const p$ = path;\n    for (let i = 0, ancestor, lastRoot, root, rootIdx; i < p$.length; i++) {\n        ancestor = p$[i];\n        root = ancestor instanceof Window ? ancestor : ancestor.getRootNode();\n        // Retarget to ancestor if ancestor is not shadowed\n        if (!isSyntheticOrNativeShadowRoot(root)) {\n            return ancestor;\n        }\n        if (root !== lastRoot) {\n            rootIdx = refNodePath.indexOf(root);\n            lastRoot = root;\n        }\n        // Retarget to ancestor if ancestor is shadowed by refNode's shadow root\n        if (!isUndefined(rootIdx) && rootIdx > -1) {\n            return ancestor;\n        }\n    }\n    return null;\n}\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nfunction fauxElementFromPoint(context, doc, left, top) {\n    const element = elementFromPoint.call(doc, left, top);\n    if (isNull(element)) {\n        return element;\n    }\n    return retarget(context, pathComposer(element, true));\n}\n\n/*\n * Copyright (c) 2024, Salesforce, Inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nfunction elemFromPoint(left, top) {\n    return fauxElementFromPoint(this, this, left, top);\n}\nDocument.prototype.elementFromPoint = elemFromPoint;\nfunction elemsFromPoint(left, top) {\n    return fauxElementsFromPoint(this, this, left, top);\n}\nDocument.prototype.elementsFromPoint = elemsFromPoint;\n// Go until we reach to top of the LWC tree\ndefineProperty(Document.prototype, 'activeElement', {\n    get() {\n        let node = DocumentPrototypeActiveElement.call(this);\n        if (isNull(node)) {\n            return node;\n        }\n        while (!isUndefined(getNodeOwnerKey(node))) {\n            node = parentElementGetter.call(node);\n            if (isNull(node)) {\n                return null;\n            }\n        }\n        if (node.tagName === 'HTML') {\n            // IE 11. Active element should never be html element\n            node = this.body;\n        }\n        return node;\n    },\n    enumerable: true,\n    configurable: true,\n});\n// The following patched methods hide shadowed elements from global\n// traversing mechanisms. They are simplified for performance reasons to\n// filter by ownership and do not account for slotted elements. This\n// compromise is fine for our synthetic shadow dom because root elements\n// cannot have slotted elements.\n// Another compromise here is that all these traversing methods will return\n// static HTMLCollection or static NodeList. We decided that this compromise\n// is not a big problem considering the amount of code that is relying on\n// the liveliness of these results are rare.\ndefineProperty(Document.prototype, 'getElementById', {\n    value() {\n        const elm = getElementById.apply(this, ArraySlice.call(arguments));\n        if (isNull(elm)) {\n            return null;\n        }\n        // Note: we deviate from native shadow here, but are not fixing\n        // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n        return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm) ? elm : null;\n    },\n    writable: true,\n    enumerable: true,\n    configurable: true,\n});\ndefineProperty(Document.prototype, 'querySelector', {\n    value() {\n        const elements = arrayFromCollection(querySelectorAll.apply(this, ArraySlice.call(arguments)));\n        const filtered = ArrayFind.call(elements, \n        // Note: we deviate from native shadow here, but are not fixing\n        // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n        (elm) => isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm));\n        return !isUndefined(filtered) ? filtered : null;\n    },\n    writable: true,\n    enumerable: true,\n    configurable: true,\n});\ndefineProperty(Document.prototype, 'querySelectorAll', {\n    value() {\n        const elements = arrayFromCollection(querySelectorAll.apply(this, ArraySlice.call(arguments)));\n        const filtered = ArrayFilter.call(elements, \n        // Note: we deviate from native shadow here, but are not fixing\n        // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n        (elm) => isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm));\n        return createStaticNodeList(filtered);\n    },\n    writable: true,\n    enumerable: true,\n    configurable: true,\n});\ndefineProperty(Document.prototype, 'getElementsByClassName', {\n    value() {\n        const elements = arrayFromCollection(getElementsByClassName.apply(this, ArraySlice.call(arguments)));\n        const filtered = ArrayFilter.call(elements, \n        // Note: we deviate from native shadow here, but are not fixing\n        // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n        (elm) => isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm));\n        return createStaticHTMLCollection(filtered);\n    },\n    writable: true,\n    enumerable: true,\n    configurable: true,\n});\ndefineProperty(Document.prototype, 'getElementsByTagName', {\n    value() {\n        const elements = arrayFromCollection(getElementsByTagName.apply(this, ArraySlice.call(arguments)));\n        const filtered = ArrayFilter.call(elements, \n        // Note: we deviate from native shadow here, but are not fixing\n        // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n        (elm) => isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm));\n        return createStaticHTMLCollection(filtered);\n    },\n    writable: true,\n    enumerable: true,\n    configurable: true,\n});\ndefineProperty(Document.prototype, 'getElementsByTagNameNS', {\n    value() {\n        const elements = arrayFromCollection(getElementsByTagNameNS.apply(this, ArraySlice.call(arguments)));\n        const filtered = ArrayFilter.call(elements, \n        // Note: we deviate from native shadow here, but are not fixing\n        // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n        (elm) => isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm));\n        return createStaticHTMLCollection(filtered);\n    },\n    writable: true,\n    enumerable: true,\n    configurable: true,\n});\ndefineProperty(\n// In Firefox v57 and lower, getElementsByName is defined on HTMLDocument.prototype\ngetOwnPropertyDescriptor(HTMLDocument.prototype, 'getElementsByName')\n    ? HTMLDocument.prototype\n    : Document.prototype, 'getElementsByName', {\n    value() {\n        const elements = arrayFromCollection(getElementsByName.apply(this, ArraySlice.call(arguments)));\n        const filtered = ArrayFilter.call(elements, \n        // Note: we deviate from native shadow here, but are not fixing\n        // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n        (elm) => isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm));\n        return createStaticNodeList(filtered);\n    },\n    writable: true,\n    enumerable: true,\n    configurable: true,\n});\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nObject.defineProperty(window, 'ShadowRoot', {\n    value: SyntheticShadowRoot,\n    configurable: true,\n    writable: true,\n});\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst CustomEventConstructor = CustomEvent;\nfunction PatchedCustomEvent(type, eventInitDict) {\n    const event = new CustomEventConstructor(type, eventInitDict);\n    const isComposed = !!(eventInitDict && eventInitDict.composed);\n    Object.defineProperties(event, {\n        composed: {\n            get() {\n                return isComposed;\n            },\n            configurable: true,\n            enumerable: true,\n        },\n    });\n    return event;\n}\nPatchedCustomEvent.prototype = CustomEventConstructor.prototype;\nwindow.CustomEvent = PatchedCustomEvent;\n\n/*\n * Copyright (c) 2023, Salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n// Note that ClipboardEvent is undefined in Jest/jsdom\n// See: https://github.com/jsdom/jsdom/issues/1568\nif (typeof ClipboardEvent !== 'undefined') {\n    const isComposedType = assign(create(null), {\n        copy: 1,\n        cut: 1,\n        paste: 1,\n    });\n    // Patch the prototype to override the composed property on user-agent dispatched events\n    defineProperties(ClipboardEvent.prototype, {\n        composed: {\n            get() {\n                const { type } = this;\n                return isComposedType[type] === 1;\n            },\n            configurable: true,\n            enumerable: true,\n        },\n    });\n}\n\n/*\n * Copyright (c) 2024, Salesforce, Inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst OriginalMutationObserver = MutationObserver;\nconst { disconnect: originalDisconnect, observe: originalObserve, takeRecords: originalTakeRecords, } = OriginalMutationObserver.prototype;\n// Internal fields to maintain relationships\nconst wrapperLookupField = '$$lwcObserverCallbackWrapper$$';\nconst observerLookupField = '$$lwcNodeObservers$$';\nconst observerToNodesMap = new WeakMap();\nfunction getNodeObservers(node) {\n    return node[observerLookupField];\n}\nfunction setNodeObservers(node, observers) {\n    node[observerLookupField] = observers;\n}\n/**\n * Retarget the mutation record's target value to its shadowRoot\n * @param originalRecord\n */\nfunction retargetMutationRecord(originalRecord) {\n    const { addedNodes, removedNodes, target, type } = originalRecord;\n    const retargetedRecord = create(MutationRecord.prototype);\n    defineProperties(retargetedRecord, {\n        addedNodes: {\n            get() {\n                return addedNodes;\n            },\n            enumerable: true,\n            configurable: true,\n        },\n        removedNodes: {\n            get() {\n                return removedNodes;\n            },\n            enumerable: true,\n            configurable: true,\n        },\n        type: {\n            get() {\n                return type;\n            },\n            enumerable: true,\n            configurable: true,\n        },\n        target: {\n            get() {\n                return target.shadowRoot;\n            },\n            enumerable: true,\n            configurable: true,\n        },\n    });\n    return retargetedRecord;\n}\n/**\n * Utility to identify if a target node is being observed by the given observer\n * Start at the current node, if the observer is registered to observe the current node, the mutation qualifies\n * @param observer\n * @param target\n */\nfunction isQualifiedObserver(observer, target) {\n    let parentNode = target;\n    while (!isNull(parentNode)) {\n        const parentNodeObservers = getNodeObservers(parentNode);\n        if (!isUndefined(parentNodeObservers) &&\n            (parentNodeObservers[0] === observer || // perf optimization to check for the first item is a match\n                ArrayIndexOf.call(parentNodeObservers, observer) !== -1)) {\n            return true;\n        }\n        parentNode = parentNode.parentNode;\n    }\n    return false;\n}\n/**\n * This function provides a shadow dom compliant filtered view of mutation records for a given observer.\n *\n * The key logic here is to determine if a given observer has been registered to observe any nodes\n * between the target node of a mutation record to the target's root node.\n * This function also retargets records when mutations occur directly under the shadow root\n * @param mutations\n * @param observer\n */\nfunction filterMutationRecords(mutations, observer) {\n    const result = [];\n    for (const record of mutations) {\n        const { target, type } = record;\n        // If target is an lwc host,\n        // Determine if the mutations affected the host or the shadowRoot\n        // Mutations affecting host: changes to slot content\n        // Mutations affecting shadowRoot: changes to template content\n        if (type === 'childList' && !isUndefined(getNodeKey(target))) {\n            const { addedNodes } = record;\n            // In case of added nodes, we can climb up the tree and determine eligibility\n            if (addedNodes.length > 0) {\n                // Optimization: Peek in and test one node to decide if the MutationRecord qualifies\n                // The remaining nodes in this MutationRecord will have the same ownerKey\n                const sampleNode = addedNodes[0];\n                if (isQualifiedObserver(observer, sampleNode)) {\n                    // If the target was being observed, then return record as-is\n                    // this will be the case for slot content\n                    const nodeObservers = getNodeObservers(target);\n                    if (nodeObservers &&\n                        (nodeObservers[0] === observer ||\n                            ArrayIndexOf.call(nodeObservers, observer) !== -1)) {\n                        ArrayPush.call(result, record);\n                    }\n                    else {\n                        // else, must be observing the shadowRoot\n                        ArrayPush.call(result, retargetMutationRecord(record));\n                    }\n                }\n            }\n            else {\n                const { removedNodes } = record;\n                // In the case of removed nodes, climbing the tree is not an option as the nodes are disconnected\n                // We can only check if either the host or shadow root was observed and qualify the record\n                const shadowRoot = target.shadowRoot;\n                const sampleNode = removedNodes[0];\n                if (getNodeNearestOwnerKey(target) === getNodeNearestOwnerKey(sampleNode) && // trickery: sampleNode is slot content\n                    isQualifiedObserver(observer, target) // use target as a close enough reference to climb up\n                ) {\n                    ArrayPush.call(result, record);\n                }\n                else if (shadowRoot) {\n                    const shadowRootObservers = getNodeObservers(shadowRoot);\n                    if (shadowRootObservers &&\n                        (shadowRootObservers[0] === observer ||\n                            ArrayIndexOf.call(shadowRootObservers, observer) !== -1)) {\n                        ArrayPush.call(result, retargetMutationRecord(record));\n                    }\n                }\n            }\n        }\n        else {\n            // Mutation happened under a root node(shadow root or document) and the decision is straighforward\n            // Ascend the tree starting from target and check if observer is qualified\n            if (isQualifiedObserver(observer, target)) {\n                ArrayPush.call(result, record);\n            }\n        }\n    }\n    return result;\n}\nfunction getWrappedCallback(callback) {\n    let wrappedCallback = callback[wrapperLookupField];\n    if (isUndefined(wrappedCallback)) {\n        wrappedCallback = callback[wrapperLookupField] = (mutations, observer) => {\n            // Filter mutation records\n            const filteredRecords = filterMutationRecords(mutations, observer);\n            // If not records are eligible for the observer, do not invoke callback\n            if (filteredRecords.length === 0) {\n                return;\n            }\n            callback.call(observer, filteredRecords, observer);\n        };\n    }\n    return wrappedCallback;\n}\n/**\n * Patched MutationObserver constructor.\n * 1. Wrap the callback to filter out MutationRecords based on dom ownership\n * 2. Add a property field to track all observed targets of the observer instance\n * @param callback\n */\nfunction PatchedMutationObserver(callback) {\n    const wrappedCallback = getWrappedCallback(callback);\n    const observer = new OriginalMutationObserver(wrappedCallback);\n    return observer;\n}\nfunction patchedDisconnect() {\n    originalDisconnect.call(this);\n    // Clear the node to observer reference which is a strong references\n    const observedNodes = observerToNodesMap.get(this);\n    if (!isUndefined(observedNodes)) {\n        forEach.call(observedNodes, (observedNode) => {\n            const observers = observedNode[observerLookupField];\n            if (!isUndefined(observers)) {\n                const index = ArrayIndexOf.call(observers, this);\n                if (index !== -1) {\n                    ArraySplice.call(observers, index, 1);\n                }\n            }\n        });\n        observedNodes.length = 0;\n    }\n}\n/**\n * A single mutation observer can observe multiple nodes(target).\n * Maintain a list of all targets that the observer chooses to observe\n * @param target\n * @param options\n */\nfunction patchedObserve(target, options) {\n    let targetObservers = getNodeObservers(target);\n    // Maintain a list of all observers that want to observe a node\n    if (isUndefined(targetObservers)) {\n        targetObservers = [];\n        setNodeObservers(target, targetObservers);\n    }\n    // Same observer trying to observe the same node\n    if (ArrayIndexOf.call(targetObservers, this) === -1) {\n        ArrayPush.call(targetObservers, this);\n    } // else There is more bookkeeping to do here https://dom.spec.whatwg.org/#dom-mutationobserver-observe Step #7\n    // SyntheticShadowRoot instances are not actually a part of the DOM so observe the host instead.\n    if (isSyntheticShadowRoot(target)) {\n        target = target.host;\n    }\n    // maintain a list of all nodes observed by this observer\n    if (observerToNodesMap.has(this)) {\n        const observedNodes = observerToNodesMap.get(this);\n        if (ArrayIndexOf.call(observedNodes, target) === -1) {\n            ArrayPush.call(observedNodes, target);\n        }\n    }\n    else {\n        observerToNodesMap.set(this, [target]);\n    }\n    return originalObserve.call(this, target, options);\n}\n/**\n * Patch the takeRecords() api to filter MutationRecords based on the observed targets\n */\nfunction patchedTakeRecords() {\n    return filterMutationRecords(originalTakeRecords.call(this), this);\n}\nPatchedMutationObserver.prototype = OriginalMutationObserver.prototype;\nPatchedMutationObserver.prototype.disconnect = patchedDisconnect;\nPatchedMutationObserver.prototype.observe = patchedObserve;\nPatchedMutationObserver.prototype.takeRecords = patchedTakeRecords;\ndefineProperty(window, 'MutationObserver', {\n    value: PatchedMutationObserver,\n    configurable: true,\n    writable: true,\n});\n\n/*\n * Copyright (c) 2024, Salesforce, Inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst getRootNodePatched$1 = _Node.prototype.getRootNode;\nassert.isFalse(String(getRootNodePatched$1).includes('[native code]'), 'Node prototype must be patched before event target.');\nfunction patchedAddEventListener(type, listener, optionsOrCapture) {\n    if (isSyntheticShadowHost(this)) {\n        // Typescript does not like it when you treat the `arguments` object as an array\n        // @ts-expect-error type-mismatch\n        return addCustomElementEventListener.apply(this, arguments);\n    }\n    if (this instanceof _Node && isInstanceOfNativeShadowRoot(getRootNodePatched$1.call(this))) {\n        // Typescript does not like it when you treat the `arguments` object as an array\n        // @ts-expect-error type-mismatch\n        return addEventListener.apply(this, arguments);\n    }\n    if (arguments.length < 2) {\n        // Slow path, unlikely to be called frequently. We expect modern browsers to throw:\n        // https://googlechrome.github.io/samples/event-listeners-mandatory-arguments/\n        const args = ArraySlice.call(arguments);\n        if (args.length > 1) {\n            args[1] = getEventListenerWrapper(args[1]);\n        }\n        // Ignore types because we're passing through to native method\n        // @ts-expect-error type-mismatch\n        return addEventListener.apply(this, args);\n    }\n    // Fast path. This function is optimized to avoid ArraySlice because addEventListener is called\n    // very frequently, and it provides a measurable perf boost to avoid so much array cloning.\n    const wrappedListener = getEventListenerWrapper(listener);\n    // The third argument is optional, so passing in `undefined` for `optionsOrCapture` gives capture=false\n    return addEventListener.call(this, type, wrappedListener, optionsOrCapture);\n}\nfunction patchedRemoveEventListener(_type, _listener, _optionsOrCapture) {\n    if (isSyntheticShadowHost(this)) {\n        // Typescript does not like it when you treat the `arguments` object as an array\n        // @ts-expect-error type-mismatch\n        return removeCustomElementEventListener.apply(this, arguments);\n    }\n    const args = ArraySlice.call(arguments);\n    if (arguments.length > 1) {\n        args[1] = getEventListenerWrapper(args[1]);\n    }\n    // Ignore types because we're passing through to native method\n    // @ts-expect-error type-mismatch\n    removeEventListener.apply(this, args);\n    // Account for listeners that were added before this polyfill was applied\n    // Typescript does not like it when you treat the `arguments` object as an array\n    // @ts-expect-error type-mismatch\n    removeEventListener.apply(this, arguments);\n}\ndefineProperties(eventTargetPrototype, {\n    addEventListener: {\n        value: patchedAddEventListener,\n        enumerable: true,\n        writable: true,\n        configurable: true,\n    },\n    removeEventListener: {\n        value: patchedRemoveEventListener,\n        enumerable: true,\n        writable: true,\n        configurable: true,\n    },\n});\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nfunction patchedCurrentTargetGetter() {\n    const currentTarget = eventCurrentTargetGetter.call(this);\n    if (isNull(currentTarget)) {\n        return null;\n    }\n    if (eventToContextMap.get(this) === 1 /* EventListenerContext.SHADOW_ROOT_LISTENER */) {\n        return getShadowRoot(currentTarget);\n    }\n    return currentTarget;\n}\nfunction patchedTargetGetter() {\n    const originalTarget = eventTargetGetter.call(this);\n    if (!(originalTarget instanceof _Node)) {\n        return originalTarget;\n    }\n    const doc = getOwnerDocument(originalTarget);\n    const composedPath = pathComposer(originalTarget, this.composed);\n    const originalCurrentTarget = eventCurrentTargetGetter.call(this);\n    // Handle cases where the currentTarget is null (for async events), and when an event has been\n    // added to Window\n    if (!(originalCurrentTarget instanceof _Node)) {\n        // TODO [#1511]: Special escape hatch to support legacy behavior. Should be fixed.\n        // If the event's target is being accessed async and originalTarget is not a keyed element, do not retarget\n        if (isNull(originalCurrentTarget) && isUndefined(getNodeOwnerKey(originalTarget))) {\n            return originalTarget;\n        }\n        return retarget(doc, composedPath);\n    }\n    else if (originalCurrentTarget === doc || originalCurrentTarget === doc.body) {\n        if (isUndefined(getNodeOwnerKey(originalTarget))) {\n            return originalTarget;\n        }\n        return retarget(doc, composedPath);\n    }\n    let actualCurrentTarget = originalCurrentTarget;\n    let actualPath = composedPath;\n    // Address the possibility that `currentTarget` is a shadow root\n    if (isSyntheticShadowHost(originalCurrentTarget)) {\n        const context = eventToContextMap.get(this);\n        if (context === 1 /* EventListenerContext.SHADOW_ROOT_LISTENER */) {\n            actualCurrentTarget = getShadowRoot(originalCurrentTarget);\n        }\n    }\n    // Address the possibility that `target` is a shadow root\n    if (isSyntheticShadowHost(originalTarget) && eventToShadowRootMap.has(this)) {\n        actualPath = pathComposer(getShadowRoot(originalTarget), this.composed);\n    }\n    return retarget(actualCurrentTarget, actualPath);\n}\nfunction patchedComposedPathValue() {\n    const originalTarget = eventTargetGetter.call(this);\n    // Account for events with targets that are not instances of Node (e.g., when a readystatechange\n    // handler is listening on an instance of XMLHttpRequest).\n    if (!(originalTarget instanceof _Node)) {\n        return [];\n    }\n    // If the original target is inside a native shadow root, then just call the native\n    // composePath() method. The event is already retargeted and this causes our composedPath()\n    // polyfill to compute the wrong value. This is only an issue when you have a native web\n    // component inside an LWC component (see test in same commit) but this scenario is unlikely\n    // because we don't yet support that. Workaround specifically for W-9846457. Mixed mode solution\n    // will likely be more involved.\n    const hasShadowRoot = Boolean(originalTarget.shadowRoot);\n    const hasSyntheticShadowRootAttached = hasInternalSlot(originalTarget);\n    if (hasShadowRoot && !hasSyntheticShadowRootAttached) {\n        return composedPath.call(this);\n    }\n    const originalCurrentTarget = eventCurrentTargetGetter.call(this);\n    // If the event has completed propagation, the composedPath should be an empty array.\n    if (isNull(originalCurrentTarget)) {\n        return [];\n    }\n    // Address the possibility that `target` is a shadow root\n    let actualTarget = originalTarget;\n    if (isSyntheticShadowHost(originalTarget) && eventToShadowRootMap.has(this)) {\n        actualTarget = getShadowRoot(originalTarget);\n    }\n    return pathComposer(actualTarget, this.composed);\n}\ndefineProperties(Event.prototype, {\n    target: {\n        get: patchedTargetGetter,\n        enumerable: true,\n        configurable: true,\n    },\n    currentTarget: {\n        get: patchedCurrentTargetGetter,\n        enumerable: true,\n        configurable: true,\n    },\n    composedPath: {\n        value: patchedComposedPathValue,\n        writable: true,\n        enumerable: true,\n        configurable: true,\n    },\n    // Non-standard but widely supported for backwards-compatibility\n    srcElement: {\n        get: patchedTargetGetter,\n        enumerable: true,\n        configurable: true,\n    },\n    // Non-standard but implemented in Chrome and continues to exist for backwards-compatibility\n    // https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/dom/events/event.idl;l=58?q=event.idl&ss=chromium\n    path: {\n        get: patchedComposedPathValue,\n        enumerable: true,\n        configurable: true,\n    },\n});\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nfunction retargetRelatedTarget(Ctor) {\n    const relatedTargetGetter = getOwnPropertyDescriptor(Ctor.prototype, 'relatedTarget')\n        .get;\n    defineProperty(Ctor.prototype, 'relatedTarget', {\n        get() {\n            const relatedTarget = relatedTargetGetter.call(this);\n            if (isNull(relatedTarget)) {\n                return null;\n            }\n            if (!(relatedTarget instanceof _Node) || !isNodeShadowed(relatedTarget)) {\n                return relatedTarget;\n            }\n            let pointOfReference = eventCurrentTargetGetter.call(this);\n            if (isNull(pointOfReference)) {\n                pointOfReference = getOwnerDocument(relatedTarget);\n            }\n            return retarget(pointOfReference, pathComposer(relatedTarget, true));\n        },\n        enumerable: true,\n        configurable: true,\n    });\n}\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nretargetRelatedTarget(FocusEvent);\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nretargetRelatedTarget(MouseEvent);\n\n/*\n * Copyright (c) 2021, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst assignedSlotGetter = hasOwnProperty.call(Text.prototype, 'assignedSlot')\n    ? getOwnPropertyDescriptor(Text.prototype, 'assignedSlot').get\n    : () => null;\n\n/*\n * Copyright (c) 2024, Salesforce, Inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n// We can use a single observer without having to worry about leaking because\n// \"Registered observers in a node’s registered observer list have a weak\n// reference to the node.\"\n// https://dom.spec.whatwg.org/#garbage-collection\nlet observer;\nconst observerConfig = { childList: true };\nconst SlotChangeKey = new WeakMap();\nfunction initSlotObserver() {\n    return new MO((mutations) => {\n        const slots = [];\n        forEach.call(mutations, (mutation) => {\n            if (process.env.NODE_ENV !== 'production') {\n                assert.invariant(mutation.type === 'childList', `Invalid mutation type: ${mutation.type}. This mutation handler for slots should only handle \"childList\" mutations.`);\n            }\n            const { target: slot } = mutation;\n            if (ArrayIndexOf.call(slots, slot) === -1) {\n                ArrayPush.call(slots, slot);\n                dispatchEvent.call(slot, new CustomEvent('slotchange'));\n            }\n        });\n    });\n}\nfunction getFilteredSlotFlattenNodes(slot) {\n    const childNodes = arrayFromCollection(childNodesGetter.call(slot));\n    return ArrayReduce.call(childNodes, \n    // @ts-expect-error Array#reduce has a generic that is lost by our redefined ArrayReduce\n    (seed, child) => {\n        if (child instanceof Element && isSlotElement(child)) {\n            ArrayPush.apply(seed, getFilteredSlotFlattenNodes(child));\n        }\n        else {\n            ArrayPush.call(seed, child);\n        }\n        return seed;\n    }, []);\n}\nfunction assignedSlotGetterPatched() {\n    const parentNode = parentNodeGetter.call(this);\n    // use original assignedSlot if parent has a native shdow root\n    if (parentNode instanceof Element) {\n        const sr = shadowRootGetter.call(parentNode);\n        if (isInstanceOfNativeShadowRoot(sr)) {\n            if (this instanceof Text) {\n                return assignedSlotGetter.call(this);\n            }\n            return assignedSlotGetter$1.call(this);\n        }\n    }\n    /**\n     * The node is assigned to a slot if:\n     * - it has a parent and its parent is a slot element\n     * - and if the slot owner key is different than the node owner key.\n     * When the slot and the slotted node are 2 different shadow trees, the owner keys will be\n     * different. When the slot is in a shadow tree and the slotted content is a light DOM node,\n     * the light DOM node doesn't have an owner key and therefor the slot owner key will be\n     * different than the node owner key (always `undefined`).\n     */\n    if (!isNull(parentNode) &&\n        isSlotElement(parentNode) &&\n        getNodeOwnerKey(parentNode) !== getNodeOwnerKey(this)) {\n        return parentNode;\n    }\n    return null;\n}\ndefineProperties(HTMLSlotElement.prototype, {\n    addEventListener: {\n        value(type, listener, options) {\n            // super.addEventListener - but that doesn't work with typescript\n            HTMLElement.prototype.addEventListener.call(this, type, listener, options);\n            if (type === 'slotchange' && !SlotChangeKey.get(this)) {\n                SlotChangeKey.set(this, true);\n                if (!observer) {\n                    observer = initSlotObserver();\n                }\n                MutationObserverObserve.call(observer, this, observerConfig);\n            }\n        },\n        writable: true,\n        enumerable: true,\n        configurable: true,\n    },\n    assignedElements: {\n        value(options) {\n            if (isNodeShadowed(this)) {\n                const flatten = !isUndefined(options) && isTrue(options.flatten);\n                const nodes = flatten\n                    ? getFilteredSlotFlattenNodes(this)\n                    : getFilteredSlotAssignedNodes(this);\n                return ArrayFilter.call(nodes, (node) => node instanceof Element);\n            }\n            else {\n                return assignedElements.apply(this, ArraySlice.call(arguments));\n            }\n        },\n        writable: true,\n        enumerable: true,\n        configurable: true,\n    },\n    assignedNodes: {\n        value(options) {\n            if (isNodeShadowed(this)) {\n                const flatten = !isUndefined(options) && isTrue(options.flatten);\n                return flatten\n                    ? getFilteredSlotFlattenNodes(this)\n                    : getFilteredSlotAssignedNodes(this);\n            }\n            else {\n                return assignedNodes.apply(this, ArraySlice.call(arguments));\n            }\n        },\n        writable: true,\n        enumerable: true,\n        configurable: true,\n    },\n    name: {\n        get() {\n            const name = getAttribute.call(this, 'name');\n            return isNull(name) ? '' : name;\n        },\n        set(value) {\n            setAttribute.call(this, 'name', value);\n        },\n        enumerable: true,\n        configurable: true,\n    },\n    childNodes: {\n        get() {\n            if (isNodeShadowed(this)) {\n                const owner = getNodeOwner(this);\n                const childNodes = isNull(owner)\n                    ? []\n                    : getAllMatches(owner, getFilteredChildNodes(this));\n                return createStaticNodeList(childNodes);\n            }\n            return childNodesGetter.call(this);\n        },\n        enumerable: true,\n        configurable: true,\n    },\n});\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n// Non-deep-traversing patches: this descriptor map includes all descriptors that\n// do not five access to nodes beyond the immediate children.\ndefineProperties(Text.prototype, {\n    assignedSlot: {\n        get: assignedSlotGetterPatched,\n        enumerable: true,\n        configurable: true,\n    },\n});\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n/**\n * This methods filters out elements that are not in the same shadow root of context.\n * It does not enforce shadow dom semantics if $context is not managed by LWC\n * @param context\n * @param unfilteredNodes\n */\nfunction getNonPatchedFilteredArrayOfNodes(context, unfilteredNodes) {\n    let filtered;\n    const ownerKey = getNodeOwnerKey(context);\n    // a node inside a shadow.\n    if (!isUndefined(ownerKey)) {\n        if (isSyntheticShadowHost(context)) {\n            // element with shadowRoot attached\n            const owner = getNodeOwner(context);\n            if (isNull(owner)) {\n                filtered = [];\n            }\n            else if (getNodeKey(context)) {\n                // it is a custom element, and we should then filter by slotted elements\n                filtered = getAllSlottedMatches(context, unfilteredNodes);\n            }\n            else {\n                // regular element, we should then filter by ownership\n                filtered = getAllMatches(owner, unfilteredNodes);\n            }\n        }\n        else {\n            // context is handled by lwc, using getNodeNearestOwnerKey to include manually inserted elements in the same shadow.\n            filtered = ArrayFilter.call(unfilteredNodes, (elm) => getNodeNearestOwnerKey(elm) === ownerKey);\n        }\n    }\n    else if (context instanceof HTMLBodyElement) {\n        // `context` is document.body which is already patched.\n        filtered = ArrayFilter.call(unfilteredNodes, \n        // Note: we deviate from native shadow here, but are not fixing\n        // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n        (elm) => isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(context));\n    }\n    else {\n        // `context` is outside the lwc boundary, return unfiltered list.\n        filtered = ArraySlice.call(unfilteredNodes);\n    }\n    return filtered;\n}\n\n/*\n * Copyright (c) 2024, Salesforce, Inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nfunction innerHTMLGetterPatched() {\n    const childNodes = getInternalChildNodes(this);\n    let innerHTML = '';\n    for (let i = 0, len = childNodes.length; i < len; i += 1) {\n        innerHTML += getOuterHTML(childNodes[i]);\n    }\n    return innerHTML;\n}\nfunction outerHTMLGetterPatched() {\n    return getOuterHTML(this);\n}\nfunction attachShadowPatched(options) {\n    // To retain native behavior of the API, provide synthetic shadowRoot only when specified\n    if (options[KEY__SYNTHETIC_MODE]) {\n        return attachShadow(this, options);\n    }\n    return attachShadow$1.call(this, options);\n}\nfunction shadowRootGetterPatched() {\n    if (isSyntheticShadowHost(this)) {\n        const shadow = getShadowRoot(this);\n        if (shadow.mode === 'open') {\n            return shadow;\n        }\n    }\n    return shadowRootGetter.call(this);\n}\nfunction childrenGetterPatched() {\n    const owner = getNodeOwner(this);\n    const filteredChildNodes = getFilteredChildNodes(this);\n    // No need to filter by owner for non-shadowed nodes\n    const childNodes = isNull(owner)\n        ? filteredChildNodes\n        : getAllMatches(owner, filteredChildNodes);\n    return createStaticHTMLCollection(ArrayFilter.call(childNodes, (node) => node instanceof Element));\n}\nfunction childElementCountGetterPatched() {\n    return this.children.length;\n}\nfunction firstElementChildGetterPatched() {\n    return this.children[0] || null;\n}\nfunction lastElementChildGetterPatched() {\n    const { children } = this;\n    return children.item(children.length - 1) || null;\n}\n// Non-deep-traversing patches: this descriptor map includes all descriptors that\n// do not five access to nodes beyond the immediate children.\ndefineProperties(Element.prototype, {\n    innerHTML: {\n        get() {\n            // Note: we deviate from native shadow here, but are not fixing\n            // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n            if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {\n                return innerHTMLGetterPatched.call(this);\n            }\n            return innerHTMLGetter.call(this);\n        },\n        set(v) {\n            innerHTMLSetter.call(this, v);\n        },\n        enumerable: true,\n        configurable: true,\n    },\n    outerHTML: {\n        get() {\n            // Note: we deviate from native shadow here, but are not fixing\n            // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n            if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {\n                return outerHTMLGetterPatched.call(this);\n            }\n            return outerHTMLGetter.call(this);\n        },\n        set(v) {\n            outerHTMLSetter.call(this, v);\n        },\n        enumerable: true,\n        configurable: true,\n    },\n    attachShadow: {\n        value: attachShadowPatched,\n        enumerable: true,\n        writable: true,\n        configurable: true,\n    },\n    shadowRoot: {\n        get: shadowRootGetterPatched,\n        enumerable: true,\n        configurable: true,\n    },\n    // patched in HTMLElement if exists (IE11 is the one off here)\n    children: {\n        get() {\n            if (hasMountedChildren(this)) {\n                return childrenGetterPatched.call(this);\n            }\n            return childrenGetter.call(this);\n        },\n        enumerable: true,\n        configurable: true,\n    },\n    childElementCount: {\n        get() {\n            if (hasMountedChildren(this)) {\n                return childElementCountGetterPatched.call(this);\n            }\n            return childElementCountGetter.call(this);\n        },\n        enumerable: true,\n        configurable: true,\n    },\n    firstElementChild: {\n        get() {\n            if (hasMountedChildren(this)) {\n                return firstElementChildGetterPatched.call(this);\n            }\n            return firstElementChildGetter.call(this);\n        },\n        enumerable: true,\n        configurable: true,\n    },\n    lastElementChild: {\n        get() {\n            if (hasMountedChildren(this)) {\n                return lastElementChildGetterPatched.call(this);\n            }\n            return lastElementChildGetter.call(this);\n        },\n        enumerable: true,\n        configurable: true,\n    },\n    assignedSlot: {\n        get: assignedSlotGetterPatched,\n        enumerable: true,\n        configurable: true,\n    },\n});\n// IE11 extra patches for wrong prototypes\nif (hasOwnProperty.call(HTMLElement.prototype, 'innerHTML')) {\n    defineProperty(HTMLElement.prototype, 'innerHTML', getOwnPropertyDescriptor(Element.prototype, 'innerHTML'));\n}\nif (hasOwnProperty.call(HTMLElement.prototype, 'outerHTML')) {\n    defineProperty(HTMLElement.prototype, 'outerHTML', getOwnPropertyDescriptor(Element.prototype, 'outerHTML'));\n}\nif (hasOwnProperty.call(HTMLElement.prototype, 'children')) {\n    defineProperty(HTMLElement.prototype, 'children', getOwnPropertyDescriptor(Element.prototype, 'children'));\n}\n// Deep-traversing patches from this point on:\nfunction querySelectorPatched() {\n    const nodeList = arrayFromCollection(querySelectorAll$1.apply(this, ArraySlice.call(arguments)));\n    if (isSyntheticShadowHost(this)) {\n        // element with shadowRoot attached\n        const owner = getNodeOwner(this);\n        if (!isUndefined(getNodeKey(this))) {\n            // it is a custom element, and we should then filter by slotted elements\n            return getFirstSlottedMatch(this, nodeList);\n        }\n        else if (isNull(owner)) {\n            return null;\n        }\n        else {\n            // regular element, we should then filter by ownership\n            return getFirstMatch(owner, nodeList);\n        }\n    }\n    else if (isNodeShadowed(this)) {\n        // element inside a shadowRoot\n        const ownerKey = getNodeOwnerKey(this);\n        if (!isUndefined(ownerKey)) {\n            // `this` is handled by lwc, using getNodeNearestOwnerKey to include manually inserted elements in the same shadow.\n            const elm = ArrayFind.call(nodeList, (elm) => getNodeNearestOwnerKey(elm) === ownerKey);\n            return isUndefined(elm) ? null : elm;\n        }\n        else {\n            // Note: we deviate from native shadow here, but are not fixing\n            // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n            // `this` is a manually inserted element inside a shadowRoot, return the first element.\n            return nodeList.length === 0 ? null : nodeList[0];\n        }\n    }\n    else {\n        if (!(this instanceof HTMLBodyElement)) {\n            const elm = nodeList[0];\n            return isUndefined(elm) ? null : elm;\n        }\n        // element belonging to the document\n        const elm = ArrayFind.call(nodeList, (elm) => isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(this));\n        return isUndefined(elm) ? null : elm;\n    }\n}\nfunction getFilteredArrayOfNodes(context, unfilteredNodes) {\n    let filtered;\n    if (isSyntheticShadowHost(context)) {\n        // element with shadowRoot attached\n        const owner = getNodeOwner(context);\n        if (!isUndefined(getNodeKey(context))) {\n            // it is a custom element, and we should then filter by slotted elements\n            filtered = getAllSlottedMatches(context, unfilteredNodes);\n        }\n        else if (isNull(owner)) {\n            filtered = [];\n        }\n        else {\n            // regular element, we should then filter by ownership\n            filtered = getAllMatches(owner, unfilteredNodes);\n        }\n    }\n    else if (isNodeShadowed(context)) {\n        // element inside a shadowRoot\n        const ownerKey = getNodeOwnerKey(context);\n        if (!isUndefined(ownerKey)) {\n            // context is handled by lwc, using getNodeNearestOwnerKey to include manually inserted elements in the same shadow.\n            filtered = ArrayFilter.call(unfilteredNodes, (elm) => getNodeNearestOwnerKey(elm) === ownerKey);\n        }\n        else {\n            // Note: we deviate from native shadow here, but are not fixing\n            // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n            // context is manually inserted without lwc:dom-manual, return everything\n            filtered = ArraySlice.call(unfilteredNodes);\n        }\n    }\n    else {\n        if (context instanceof HTMLBodyElement) {\n            // `context` is document.body or element belonging to the document with the patch enabled\n            filtered = ArrayFilter.call(unfilteredNodes, (elm) => isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(context));\n        }\n        else {\n            // `context` is outside the lwc boundary and patch is not enabled.\n            filtered = ArraySlice.call(unfilteredNodes);\n        }\n    }\n    return filtered;\n}\n// The following patched methods hide shadowed elements from global\n// traversing mechanisms. They are simplified for performance reasons to\n// filter by ownership and do not account for slotted elements. This\n// compromise is fine for our synthetic shadow dom because root elements\n// cannot have slotted elements.\n// Another compromise here is that all these traversing methods will return\n// static HTMLCollection or static NodeList. We decided that this compromise\n// is not a big problem considering the amount of code that is relying on\n// the liveliness of these results are rare.\ndefineProperties(Element.prototype, {\n    querySelector: {\n        value: querySelectorPatched,\n        writable: true,\n        enumerable: true,\n        configurable: true,\n    },\n    querySelectorAll: {\n        value() {\n            const nodeList = arrayFromCollection(querySelectorAll$1.apply(this, ArraySlice.call(arguments)));\n            // Note: we deviate from native shadow here, but are not fixing\n            // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n            const filteredResults = getFilteredArrayOfNodes(this, nodeList);\n            return createStaticNodeList(filteredResults);\n        },\n        writable: true,\n        enumerable: true,\n        configurable: true,\n    },\n});\n// The following APIs are used directly by Jest internally so we avoid patching them during testing.\nif (process.env.NODE_ENV !== 'test') {\n    defineProperties(Element.prototype, {\n        getElementsByClassName: {\n            value() {\n                const elements = arrayFromCollection(getElementsByClassName$1.apply(this, ArraySlice.call(arguments)));\n                // Note: we deviate from native shadow here, but are not fixing\n                // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n                return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));\n            },\n            writable: true,\n            enumerable: true,\n            configurable: true,\n        },\n        getElementsByTagName: {\n            value() {\n                const elements = arrayFromCollection(getElementsByTagName$1.apply(this, ArraySlice.call(arguments)));\n                // Note: we deviate from native shadow here, but are not fixing\n                // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n                return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));\n            },\n            writable: true,\n            enumerable: true,\n            configurable: true,\n        },\n        getElementsByTagNameNS: {\n            value() {\n                const elements = arrayFromCollection(getElementsByTagNameNS$1.apply(this, ArraySlice.call(arguments)));\n                // Note: we deviate from native shadow here, but are not fixing\n                // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n                return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));\n            },\n            writable: true,\n            enumerable: true,\n            configurable: true,\n        },\n    });\n}\n// IE11 extra patches for wrong prototypes\nif (hasOwnProperty.call(HTMLElement.prototype, 'getElementsByClassName')) {\n    defineProperty(HTMLElement.prototype, 'getElementsByClassName', getOwnPropertyDescriptor(Element.prototype, 'getElementsByClassName'));\n}\n\n/*\n * Copyright (c) 2024, Salesforce, Inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst getRootNodePatched = _Node.prototype.getRootNode;\nassert.isFalse(String(getRootNodePatched).includes('[native code]'), 'Node prototype must be patched before patching focus.');\nconst FocusableSelector = `\n    [contenteditable],\n    [tabindex],\n    a[href],\n    area[href],\n    audio[controls],\n    button,\n    iframe,\n    input,\n    select,\n    textarea,\n    video[controls]\n`;\nconst formElementTagNames = new Set(['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA']);\nfunction filterSequentiallyFocusableElements(elements) {\n    return elements.filter((element) => {\n        if (hasAttribute.call(element, 'tabindex')) {\n            // Even though LWC only supports tabindex values of 0 or -1,\n            // passing through elements with tabindex=\"0\" is a tighter criteria\n            // than filtering out elements based on tabindex=\"-1\".\n            return getAttribute.call(element, 'tabindex') === '0';\n        }\n        if (formElementTagNames.has(tagNameGetter.call(element))) {\n            return !hasAttribute.call(element, 'disabled');\n        }\n        return true;\n    });\n}\nconst DidAddMouseEventListeners = new WeakMap();\n// Due to browser differences, it is impossible to know what is focusable until\n// we actually try to focus it. We need to refactor our focus delegation logic\n// to verify whether or not the target was actually focused instead of trying\n// to predict focusability like we do here.\nfunction isVisible(element) {\n    const { width, height } = getBoundingClientRect.call(element);\n    const noZeroSize = width > 0 || height > 0;\n    // The area element can be 0x0 and focusable. Hardcoding this is not ideal\n    // but it will minimize changes in the current behavior.\n    const isAreaElement = element.tagName === 'AREA';\n    return (noZeroSize || isAreaElement) && getComputedStyle(element).visibility !== 'hidden';\n}\n// This function based on https://allyjs.io/data-tables/focusable.html\n// It won't catch everything, but should be good enough\n// There are a lot of edge cases here that we can't realistically handle\n// Determines if a particular element is tabbable, as opposed to simply focusable\nfunction isTabbable(element) {\n    if (isSyntheticShadowHost(element) && isDelegatingFocus(element)) {\n        return false;\n    }\n    return matches.call(element, FocusableSelector) && isVisible(element);\n}\nfunction hostElementFocus() {\n    const _rootNode = getRootNodePatched.call(this);\n    if (_rootNode === this) {\n        // We invoke the focus() method even if the host is disconnected in order to eliminate\n        // observable differences for component authors between synthetic and native.\n        const focusable = querySelector.call(this, FocusableSelector);\n        if (!isNull(focusable)) {\n            // @ts-expect-error type-mismatch\n            focusable.focus.apply(focusable, arguments);\n        }\n        return;\n    }\n    // If the root node is not the host element then it's either the document or a shadow root.\n    const rootNode = _rootNode;\n    if (rootNode.activeElement === this) {\n        // The focused element should not change if the focus method is invoked\n        // on the shadow-including ancestor of the currently focused element.\n        return;\n    }\n    const focusables = arrayFromCollection(querySelectorAll$1.call(this, FocusableSelector));\n    let didFocus = false;\n    while (!didFocus && focusables.length !== 0) {\n        const focusable = focusables.shift();\n        // @ts-expect-error type-mismatch\n        focusable.focus.apply(focusable, arguments);\n        // Get the root node of the current focusable in case it was slotted.\n        const currentRootNode = focusable.getRootNode();\n        didFocus = currentRootNode.activeElement === focusable;\n    }\n}\nfunction getTabbableSegments(host) {\n    const doc = getOwnerDocument(host);\n    const all = filterSequentiallyFocusableElements(arrayFromCollection(querySelectorAll.call(doc, FocusableSelector)));\n    const inner = filterSequentiallyFocusableElements(arrayFromCollection(querySelectorAll$1.call(host, FocusableSelector)));\n    if (process.env.NODE_ENV !== 'production') {\n        assert.invariant(getAttribute.call(host, 'tabindex') === '-1' || isDelegatingFocus(host), `The focusin event is only relevant when the tabIndex property is -1 on the host.`);\n    }\n    const firstChild = inner[0];\n    const lastChild = inner[inner.length - 1];\n    const hostIndex = ArrayIndexOf.call(all, host);\n    // Host element can show up in our \"previous\" section if its tabindex is 0\n    // We want to filter that out here\n    const firstChildIndex = hostIndex > -1 ? hostIndex : ArrayIndexOf.call(all, firstChild);\n    // Account for an empty inner list\n    const lastChildIndex = inner.length === 0 ? firstChildIndex + 1 : ArrayIndexOf.call(all, lastChild) + 1;\n    const prev = ArraySlice.call(all, 0, firstChildIndex);\n    const next = ArraySlice.call(all, lastChildIndex);\n    return {\n        prev,\n        inner,\n        next,\n    };\n}\nfunction getActiveElement(host) {\n    const doc = getOwnerDocument(host);\n    const activeElement = DocumentPrototypeActiveElement.call(doc);\n    if (isNull(activeElement)) {\n        return activeElement;\n    }\n    // activeElement must be child of the host and owned by it\n    return (compareDocumentPosition.call(host, activeElement) & DOCUMENT_POSITION_CONTAINED_BY) !==\n        0\n        ? activeElement\n        : null;\n}\nfunction relatedTargetPosition(host, relatedTarget) {\n    // assert: target must be child of host\n    const pos = compareDocumentPosition.call(host, relatedTarget);\n    if (pos & DOCUMENT_POSITION_CONTAINED_BY) {\n        // focus remains inside the host\n        return 0;\n    }\n    else if (pos & DOCUMENT_POSITION_PRECEDING) {\n        // focus is coming from above\n        return 1;\n    }\n    else if (pos & DOCUMENT_POSITION_FOLLOWING) {\n        // focus is coming from below\n        return 2;\n    }\n    // we don't know what's going on.\n    return -1;\n}\nfunction muteEvent(event) {\n    event.preventDefault();\n    event.stopPropagation();\n}\nfunction muteFocusEventsDuringExecution(win, func) {\n    windowAddEventListener.call(win, 'focusin', muteEvent, true);\n    windowAddEventListener.call(win, 'focusout', muteEvent, true);\n    func();\n    windowRemoveEventListener.call(win, 'focusin', muteEvent, true);\n    windowRemoveEventListener.call(win, 'focusout', muteEvent, true);\n}\nfunction focusOnNextOrBlur(segment, target, relatedTarget) {\n    const win = getOwnerWindow(relatedTarget);\n    const next = getNextTabbable(segment, relatedTarget);\n    if (isNull(next)) {\n        // nothing to focus on, blur to invalidate the operation\n        muteFocusEventsDuringExecution(win, () => {\n            target.blur();\n        });\n    }\n    else {\n        muteFocusEventsDuringExecution(win, () => {\n            next.focus();\n        });\n    }\n}\nlet letBrowserHandleFocus = false;\nfunction disableKeyboardFocusNavigationRoutines() {\n    letBrowserHandleFocus = true;\n}\nfunction enableKeyboardFocusNavigationRoutines() {\n    letBrowserHandleFocus = false;\n}\nfunction isKeyboardFocusNavigationRoutineEnabled() {\n    return !letBrowserHandleFocus;\n}\nfunction skipHostHandler(event) {\n    if (letBrowserHandleFocus) {\n        return;\n    }\n    const host = eventCurrentTargetGetter.call(event);\n    const target = eventTargetGetter.call(event);\n    // If the host delegating focus with tabindex=0 is not the target, we know\n    // that the event was dispatched on a descendant node of the host. This\n    // means the focus is coming from below and we don't need to do anything.\n    if (host !== target) {\n        // Focus is coming from above\n        return;\n    }\n    const relatedTarget = focusEventRelatedTargetGetter.call(event);\n    if (isNull(relatedTarget)) {\n        // If relatedTarget is null, the user is most likely tabbing into the document from the\n        // browser chrome. We could probably deduce whether focus is coming in from the top or the\n        // bottom by comparing the position of the target to all tabbable elements. This is an edge\n        // case and only comes up if the custom element is the first or last tabbable element in the\n        // document.\n        return;\n    }\n    const segments = getTabbableSegments(host);\n    const position = relatedTargetPosition(host, relatedTarget);\n    if (position === 1) {\n        // Focus is coming from above\n        const findTabbableElms = isTabbableFrom.bind(null, host.getRootNode());\n        const first = ArrayFind.call(segments.inner, findTabbableElms);\n        if (!isUndefined(first)) {\n            const win = getOwnerWindow(first);\n            muteFocusEventsDuringExecution(win, () => {\n                first.focus();\n            });\n        }\n        else {\n            focusOnNextOrBlur(segments.next, target, relatedTarget);\n        }\n    }\n    else if (host === target) {\n        // Host is receiving focus from below, either from its shadow or from a sibling\n        focusOnNextOrBlur(ArrayReverse.call(segments.prev), target, relatedTarget);\n    }\n}\nfunction skipShadowHandler(event) {\n    if (letBrowserHandleFocus) {\n        return;\n    }\n    const relatedTarget = focusEventRelatedTargetGetter.call(event);\n    if (isNull(relatedTarget)) {\n        // If relatedTarget is null, the user is most likely tabbing into the document from the\n        // browser chrome. We could probably deduce whether focus is coming in from the top or the\n        // bottom by comparing the position of the target to all tabbable elements. This is an edge\n        // case and only comes up if the custom element is the first or last tabbable element in the\n        // document.\n        return;\n    }\n    const host = eventCurrentTargetGetter.call(event);\n    const segments = getTabbableSegments(host);\n    if (ArrayIndexOf.call(segments.inner, relatedTarget) !== -1) {\n        // If relatedTarget is contained by the host's subtree we can assume that the user is\n        // tabbing between elements inside of the shadow. Do nothing.\n        return;\n    }\n    const target = eventTargetGetter.call(event);\n    // Determine where the focus is coming from (Tab or Shift+Tab)\n    const position = relatedTargetPosition(host, relatedTarget);\n    if (position === 1) {\n        // Focus is coming from above\n        focusOnNextOrBlur(segments.next, target, relatedTarget);\n    }\n    if (position === 2) {\n        // Focus is coming from below\n        focusOnNextOrBlur(ArrayReverse.call(segments.prev), target, relatedTarget);\n    }\n}\n// Use this function to determine whether you can start from one root and end up\n// at another element via tabbing.\nfunction isTabbableFrom(fromRoot, toElm) {\n    if (!isTabbable(toElm)) {\n        return false;\n    }\n    const ownerDocument = getOwnerDocument(toElm);\n    let root = toElm.getRootNode();\n    while (root !== ownerDocument && root !== fromRoot) {\n        const sr = root;\n        const host = sr.host;\n        if (getAttribute.call(host, 'tabindex') === '-1') {\n            return false;\n        }\n        root = host && host.getRootNode();\n    }\n    return true;\n}\nfunction getNextTabbable(tabbables, relatedTarget) {\n    const len = tabbables.length;\n    if (len > 0) {\n        for (let i = 0; i < len; i += 1) {\n            const next = tabbables[i];\n            if (isTabbableFrom(relatedTarget.getRootNode(), next)) {\n                return next;\n            }\n        }\n    }\n    return null;\n}\n// Skips the host element\nfunction handleFocus(elm) {\n    if (process.env.NODE_ENV !== 'production') {\n        assert.invariant(isDelegatingFocus(elm), `Invalid attempt to handle focus event for ${toString(elm)}. ${toString(elm)} should have delegates focus true, but is not delegating focus`);\n    }\n    bindDocumentMousedownMouseupHandlers(elm);\n    // Unbind any focusin listeners we may have going on\n    ignoreFocusIn(elm);\n    addEventListener.call(elm, 'focusin', skipHostHandler, true);\n}\nfunction ignoreFocus(elm) {\n    removeEventListener.call(elm, 'focusin', skipHostHandler, true);\n}\nfunction bindDocumentMousedownMouseupHandlers(elm) {\n    const ownerDocument = getOwnerDocument(elm);\n    if (!DidAddMouseEventListeners.get(ownerDocument)) {\n        DidAddMouseEventListeners.set(ownerDocument, true);\n        addEventListener.call(ownerDocument, 'mousedown', disableKeyboardFocusNavigationRoutines, true);\n        addEventListener.call(ownerDocument, 'mouseup', () => {\n            // We schedule this as an async task in the mouseup handler (as\n            // opposed to the mousedown handler) because we want to guarantee\n            // that it will never run before the focusin handler:\n            //\n            // Click form element   | Click form element label\n            // ==================================================\n            // mousedown            | mousedown\n            // FOCUSIN              | mousedown-setTimeout\n            // mousedown-setTimeout | mouseup\n            // mouseup              | FOCUSIN\n            // mouseup-setTimeout   | mouseup-setTimeout\n            setTimeout(enableKeyboardFocusNavigationRoutines);\n        }, true);\n        // [W-7824445] If the element is draggable, the mousedown event is dispatched before the\n        // element is starting to be dragged, which disable the keyboard focus navigation routine.\n        // But by specification, the mouseup event is never dispatched once the element is dropped.\n        //\n        // For all draggable element, we need to add an event listener to re-enable the keyboard\n        // navigation routine after dragging starts.\n        addEventListener.call(ownerDocument, 'dragstart', enableKeyboardFocusNavigationRoutines, true);\n    }\n}\n// Skips the shadow tree\nfunction handleFocusIn(elm) {\n    if (process.env.NODE_ENV !== 'production') {\n        assert.invariant(tabIndexGetter.call(elm) === -1, `Invalid attempt to handle focus in  ${toString(elm)}. ${toString(elm)} should have tabIndex -1, but has tabIndex ${tabIndexGetter.call(elm)}`);\n    }\n    bindDocumentMousedownMouseupHandlers(elm);\n    // Unbind any focus listeners we may have going on\n    ignoreFocus(elm);\n    // This focusin listener is to catch focusin events from keyboard interactions\n    // A better solution would perhaps be to listen for keydown events, but\n    // the keydown event happens on whatever element already has focus (or no element\n    // at all in the case of the location bar. So, instead we have to assume that focusin\n    // without a mousedown means keyboard navigation\n    addEventListener.call(elm, 'focusin', skipShadowHandler, true);\n}\nfunction ignoreFocusIn(elm) {\n    removeEventListener.call(elm, 'focusin', skipShadowHandler, true);\n}\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst { blur, focus } = HTMLElement.prototype;\n/**\n * This method only applies to elements with a shadow attached to them\n */\nfunction tabIndexGetterPatched() {\n    if (isDelegatingFocus(this) && isFalse(hasAttribute.call(this, 'tabindex'))) {\n        // this covers the case where the default tabindex should be 0 because the\n        // custom element is delegating its focus\n        return 0;\n    }\n    return tabIndexGetter.call(this);\n}\n/**\n * This method only applies to elements with a shadow attached to them\n * @param value\n */\nfunction tabIndexSetterPatched(value) {\n    // This tabIndex setter might be confusing unless it is understood that HTML\n    // elements have default tabIndex property values. Natively focusable elements have\n    // a default tabIndex value of 0 and all other elements have a default tabIndex\n    // value of -1. For example, the tabIndex property value is -1 for both <x-foo> and\n    // <x-foo tabindex=\"-1\">, but our delegatesFocus polyfill should only kick in for\n    // the latter case when the value of the tabindex attribute is -1.\n    const delegatesFocus = isDelegatingFocus(this);\n    // Record the state of things before invoking component setter.\n    const prevValue = tabIndexGetter.call(this);\n    const prevHasAttr = hasAttribute.call(this, 'tabindex');\n    tabIndexSetter.call(this, value);\n    // Record the state of things after invoking component setter.\n    const currValue = tabIndexGetter.call(this);\n    const currHasAttr = hasAttribute.call(this, 'tabindex');\n    const didValueChange = prevValue !== currValue;\n    // If the tabindex attribute is initially rendered, we can assume that this setter has\n    // previously executed and a listener has been added. We must remove that listener if\n    // the tabIndex property value has changed or if the component no longer renders a\n    // tabindex attribute.\n    if (prevHasAttr && (didValueChange || isFalse(currHasAttr))) {\n        if (prevValue === -1) {\n            ignoreFocusIn(this);\n        }\n        if (prevValue === 0 && delegatesFocus) {\n            ignoreFocus(this);\n        }\n    }\n    // If a tabindex attribute was not rendered after invoking its setter, it means the\n    // component is taking control. Do nothing.\n    if (isFalse(currHasAttr)) {\n        return;\n    }\n    // If the tabindex attribute is initially rendered, we can assume that this setter has\n    // previously executed and a listener has been added. If the tabindex attribute is still\n    // rendered after invoking the setter AND the tabIndex property value has not changed,\n    // we don't need to do any work.\n    if (prevHasAttr && currHasAttr && isFalse(didValueChange)) {\n        return;\n    }\n    // At this point we know that a tabindex attribute was rendered after invoking the\n    // setter and that either:\n    // 1) This is the first time this setter is being invoked.\n    // 2) This is not the first time this setter is being invoked and the value is changing.\n    // We need to add the appropriate listeners in either case.\n    if (currValue === -1) {\n        // Add the magic to skip the shadow tree\n        handleFocusIn(this);\n    }\n    if (currValue === 0 && delegatesFocus) {\n        // Add the magic to skip the host element\n        handleFocus(this);\n    }\n}\n/**\n * This method only applies to elements with a shadow attached to them\n */\nfunction blurPatched() {\n    if (isDelegatingFocus(this)) {\n        const currentActiveElement = getActiveElement(this);\n        if (!isNull(currentActiveElement)) {\n            // if there is an active element, blur it (intentionally using the dot notation in case the user defines the blur routine)\n            currentActiveElement.blur();\n            return;\n        }\n    }\n    return blur.call(this);\n}\nfunction focusPatched() {\n    // Save enabled state\n    const originallyEnabled = isKeyboardFocusNavigationRoutineEnabled();\n    // Change state by disabling if originally enabled\n    if (originallyEnabled) {\n        disableKeyboardFocusNavigationRoutines();\n    }\n    if (isSyntheticShadowHost(this) && isDelegatingFocus(this)) {\n        hostElementFocus.call(this);\n        return;\n    }\n    // Typescript does not like it when you treat the `arguments` object as an array\n    // @ts-expect-error type-mismatch\n    focus.apply(this, arguments);\n    // Restore state by enabling if originally enabled\n    if (originallyEnabled) {\n        enableKeyboardFocusNavigationRoutines();\n    }\n}\n// Non-deep-traversing patches: this descriptor map includes all descriptors that\n// do not five access to nodes beyond the immediate children.\ndefineProperties(HTMLElement.prototype, {\n    tabIndex: {\n        get() {\n            if (isSyntheticShadowHost(this)) {\n                return tabIndexGetterPatched.call(this);\n            }\n            return tabIndexGetter.call(this);\n        },\n        set(v) {\n            if (isSyntheticShadowHost(this)) {\n                return tabIndexSetterPatched.call(this, v);\n            }\n            return tabIndexSetter.call(this, v);\n        },\n        enumerable: true,\n        configurable: true,\n    },\n    blur: {\n        value() {\n            if (isSyntheticShadowHost(this)) {\n                return blurPatched.call(this);\n            }\n            blur.call(this);\n        },\n        enumerable: true,\n        writable: true,\n        configurable: true,\n    },\n    focus: {\n        value() {\n            // Typescript does not like it when you treat the `arguments` object as an array\n            // @ts-expect-error type-mismatch\n            focusPatched.apply(this, arguments);\n        },\n        enumerable: true,\n        writable: true,\n        configurable: true,\n    },\n});\n// Note: In JSDOM innerText is not implemented: https://github.com/jsdom/jsdom/issues/1245\nif (innerTextGetter !== null && innerTextSetter !== null) {\n    defineProperty(HTMLElement.prototype, 'innerText', {\n        get() {\n            // Note: we deviate from native shadow here, but are not fixing\n            // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n            return innerTextGetter.call(this);\n        },\n        set(v) {\n            innerTextSetter.call(this, v);\n        },\n        enumerable: true,\n        configurable: true,\n    });\n}\n// Note: Firefox does not have outerText, https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/outerText\nif (outerTextGetter !== null && outerTextSetter !== null) {\n    // From https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/outerText :\n    // HTMLElement.outerText is a non-standard property. As a getter, it returns the same value as Node.innerText.\n    // As a setter, it removes the current node and replaces it with the given text.\n    defineProperty(HTMLElement.prototype, 'outerText', {\n        get() {\n            // Note: we deviate from native shadow here, but are not fixing\n            // due to backwards compat: https://github.com/salesforce/lwc/pull/3103\n            return outerTextGetter.call(this);\n        },\n        set(v) {\n            // Invoking the `outerText` setter on a host element should trigger its disconnection, but until we merge node reactions, it will not work.\n            // We could reimplement the outerText setter in JavaScript ([blink implementation](https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/html/html_element.cc;l=841-879;drc=6e8b402a6231405b753919029c9027404325ea00;bpv=0;bpt=1))\n            // but the benefits don't worth the efforts.\n            outerTextSetter.call(this, v);\n        },\n        enumerable: true,\n        configurable: true,\n    });\n}\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nfunction getShadowToken(node) {\n    return node[KEY__SHADOW_TOKEN];\n}\nfunction setShadowToken(node, shadowToken) {\n    node[KEY__SHADOW_TOKEN] = shadowToken;\n}\n/**\n * Patching Element.prototype.$shadowToken$ to mark elements a portal:\n * - we use a property to allow engines to set a custom attribute that should be\n * placed into the element to sandbox the css rules defined for the template.\n * - this custom attribute must be unique.\n */\ndefineProperty(Element.prototype, KEY__SHADOW_TOKEN, {\n    set(shadowToken) {\n        const oldShadowToken = this[KEY__SHADOW_TOKEN_PRIVATE];\n        if (!isUndefined(oldShadowToken) && oldShadowToken !== shadowToken) {\n            removeAttribute.call(this, oldShadowToken);\n        }\n        if (!isUndefined(shadowToken)) {\n            setAttribute.call(this, shadowToken, '');\n        }\n        this[KEY__SHADOW_TOKEN_PRIVATE] = shadowToken;\n    },\n    get() {\n        return this[KEY__SHADOW_TOKEN_PRIVATE];\n    },\n    configurable: true,\n});\nfunction recursivelySetShadowResolver(node, fn) {\n    node[KEY__SHADOW_RESOLVER] = fn;\n    // Recurse using firstChild/nextSibling because browsers use a linked list under the hood to\n    // represent the DOM, so childNodes/children would cause an unnecessary array allocation.\n    // https://viethung.space/blog/2020/09/01/Browser-from-Scratch-DOM-API/#Choosing-DOM-tree-data-structure\n    let child = firstChildGetter.call(node);\n    while (!isNull(child)) {\n        recursivelySetShadowResolver(child, fn);\n        child = nextSiblingGetter.call(child);\n    }\n}\ndefineProperty(Element.prototype, KEY__SHADOW_STATIC, {\n    set(v) {\n        // Marking an element as static will propagate the shadow resolver to the children.\n        if (v) {\n            const fn = this[KEY__SHADOW_RESOLVER];\n            recursivelySetShadowResolver(this, fn);\n        }\n        this[KEY__SHADOW_STATIC_PRIVATE] = v;\n    },\n    get() {\n        return this[KEY__SHADOW_STATIC_PRIVATE];\n    },\n    configurable: true,\n});\n\n/*\n * Copyright (c) 2023, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\n// TODO [#3733]: remove this entire file when we can remove legacy scope tokens\nfunction getLegacyShadowToken(node) {\n    return node[KEY__LEGACY_SHADOW_TOKEN];\n}\nfunction setLegacyShadowToken(node, shadowToken) {\n    node[KEY__LEGACY_SHADOW_TOKEN] = shadowToken;\n}\n/**\n * Patching Element.prototype.$legacyShadowToken$ to mark elements a portal:\n * Same as $shadowToken$ but for legacy CSS scope tokens.\n */\ndefineProperty(Element.prototype, KEY__LEGACY_SHADOW_TOKEN, {\n    set(shadowToken) {\n        const oldShadowToken = this[KEY__LEGACY_SHADOW_TOKEN_PRIVATE];\n        if (!isUndefined(oldShadowToken) && oldShadowToken !== shadowToken) {\n            removeAttribute.call(this, oldShadowToken);\n        }\n        if (!isUndefined(shadowToken)) {\n            setAttribute.call(this, shadowToken, '');\n        }\n        this[KEY__LEGACY_SHADOW_TOKEN_PRIVATE] = shadowToken;\n    },\n    get() {\n        return this[KEY__LEGACY_SHADOW_TOKEN_PRIVATE];\n    },\n    configurable: true,\n});\n\n/*\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: MIT\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n */\nconst DomManualPrivateKey = '$$DomManualKey$$';\n// Resolver function used when a node is removed from within a portal\nconst DocumentResolverFn = function () { };\n// We can use a single observer without having to worry about leaking because\n// \"Registered observers in a node’s registered observer list have a weak\n// reference to the node.\"\n// https://dom.spec.whatwg.org/#garbage-collection\nlet portalObserver;\nconst portalObserverConfig = {\n    childList: true,\n};\n// TODO [#3733]: remove support for legacy scope tokens\nfunction adoptChildNode(node, fn, shadowToken, legacyShadowToken) {\n    const previousNodeShadowResolver = getShadowRootResolver(node);\n    if (previousNodeShadowResolver === fn) {\n        return; // nothing to do here, it is already correctly patched\n    }\n    setShadowRootResolver(node, fn);\n    if (node instanceof Element) {\n        setShadowToken(node, shadowToken);\n        if (lwcRuntimeFlags.ENABLE_LEGACY_SCOPE_TOKENS) {\n            setLegacyShadowToken(node, legacyShadowToken);\n        }\n        if (isSyntheticShadowHost(node)) {\n            // Root LWC elements can't get content slotted into them, therefore we don't observe their children.\n            return;\n        }\n        if (isUndefined(previousNodeShadowResolver)) {\n            // we only care about Element without shadowResolver (no MO.observe has been called)\n            MutationObserverObserve.call(portalObserver, node, portalObserverConfig);\n        }\n        // recursively patching all children as well\n        const childNodes = childNodesGetter.call(node);\n        for (let i = 0, len = childNodes.length; i < len; i += 1) {\n            adoptChildNode(childNodes[i], fn, shadowToken, legacyShadowToken);\n        }\n    }\n}\nfunction initPortalObserver() {\n    return new MO((mutations) => {\n        forEach.call(mutations, (mutation) => {\n            /**\n             * This routine will process all nodes added or removed from elm (which is marked as a portal)\n             * When adding a node to the portal element, we should add the ownership.\n             * When removing a node from the portal element, this ownership should be removed.\n             *\n             * There is some special cases in which MutationObserver may call with stacked mutations (the same node\n             * will be in addedNodes and removedNodes) or with false positives (a node that is removed and re-appended\n             * in the same tick) for those cases, we cover by checking that the node is contained\n             * (or not in the case of removal) by the element.\n             */\n            const { target: elm, addedNodes, removedNodes } = mutation;\n            // the target of the mutation should always have a ShadowRootResolver attached to it\n            const fn = getShadowRootResolver(elm);\n            const shadowToken = getShadowToken(elm);\n            const legacyShadowToken = lwcRuntimeFlags.ENABLE_LEGACY_SCOPE_TOKENS\n                ? getLegacyShadowToken(elm)\n                : undefined;\n            // Process removals first to handle the case where an element is removed and reinserted\n            for (let i = 0, len = removedNodes.length; i < len; i += 1) {\n                const node = removedNodes[i];\n                if (!(compareDocumentPosition.call(elm, node) & _Node.DOCUMENT_POSITION_CONTAINED_BY)) {\n                    adoptChildNode(node, DocumentResolverFn, undefined, undefined);\n                }\n            }\n            for (let i = 0, len = addedNodes.length; i < len; i += 1) {\n                const node = addedNodes[i];\n                if (compareDocumentPosition.call(elm, node) & _Node.DOCUMENT_POSITION_CONTAINED_BY) {\n                    adoptChildNode(node, fn, shadowToken, legacyShadowToken);\n                }\n            }\n        });\n    });\n}\nfunction markElementAsPortal(elm) {\n    if (isUndefined(portalObserver)) {\n        portalObserver = initPortalObserver();\n    }\n    if (isUndefined(getShadowRootResolver(elm))) {\n        // only an element from a within a shadowRoot should be used here\n        throw new Error(`Invalid Element`);\n    }\n    // install mutation observer for portals\n    MutationObserverObserve.call(portalObserver, elm, portalObserverConfig);\n    // TODO [#1253]: optimization to synchronously adopt new child nodes added\n    // to this elm, we can do that by patching the most common operations\n    // on the node itself\n}\n/**\n * Patching Element.prototype.$domManual$ to mark elements as portal:\n * - we use a property to allow engines to signal that a particular element in\n * a shadow supports manual insertion of child nodes.\n * - this signal comes as a boolean value, and we use it to install the MO instance\n * onto the element, to propagate the $ownerKey$ and $shadowToken$ to all new\n * child nodes.\n * - at the moment, there is no way to undo this operation, once the element is\n * marked as $domManual$, setting it to false does nothing.\n */\n// TODO [#1306]: rename this to $observerConnection$\ndefineProperty(Element.prototype, '$domManual$', {\n    set(v) {\n        this[DomManualPrivateKey] = v;\n        if (isTrue(v)) {\n            markElementAsPortal(this);\n        }\n    },\n    get() {\n        return this[DomManualPrivateKey];\n    },\n    configurable: true,\n});\n/** version: 9.1.0 */\n}\n\n"]}