{"ast":null,"code":"/**\n * @license Angular v18.0.1\n * (c) 2010-2024 Google LLC. https://angular.io/\n * License: MIT\n */\n\n/**\n * The jsaction attribute defines a mapping of a DOM event to a\n * generic event (aka jsaction), to which the actual event handlers\n * that implement the behavior of the application are bound. The\n * value is a semicolon separated list of colon separated pairs of\n * an optional DOM event name and a jsaction name. If the optional\n * DOM event name is omitted, 'click' is assumed. The jsaction names\n * are dot separated pairs of a namespace and a simple jsaction\n * name.\n *\n * See grammar in README.md for expected syntax in the attribute value.\n */\nconst JSACTION$1 = 'jsaction';\n/**\n * The oi attribute is a log impression tag for impression logging\n * and action tracking. For an element that carries a jsaction\n * attribute, the element is identified for the purpose of\n * impression logging and click tracking by the dot separated path\n * of all oi attributes in the chain of ancestors of the element.\n *\n * Used by ActionFlow.\n */\nconst OI$1 = 'oi';\n/**\n * The ved attribute is an encoded ClickTrackingCGI proto to track\n * visual elements.\n *\n * Used by ActionFlow.\n */\nconst VED = 'ved';\n/**\n * The vet attribute is the visual element type used to identify tracked\n * visual elements.\n */\nconst VET = 'vet';\n/**\n * Support for iteration on reprocessing.\n *\n * Used by ActionFlow.\n */\nconst JSINSTANCE = 'jsinstance';\n/**\n * All click jsactions that happen on the element that carries this\n * attribute or its descendants are automatically logged.\n * Impressions of jsactions on these elements are tracked too, if\n * requested by the impression() method of ActionFlow.\n *\n * Used by ActionFlow.\n */\nconst JSTRACK = 'jstrack';\nconst Attribute = {\n JSACTION: JSACTION$1,\n OI: OI$1,\n VED,\n VET,\n JSINSTANCE,\n JSTRACK\n};\nconst Char = {\n /**\n * The separator between the namespace and the action name in the\n * jsaction attribute value.\n */\n NAMESPACE_ACTION_SEPARATOR: '.',\n /**\n * The separator between the event name and action in the jsaction\n * attribute value.\n */\n EVENT_ACTION_SEPARATOR: ':',\n /**\n * The separator between the logged oi attribute values in the &oi=\n * URL parameter value.\n */\n OI_SEPARATOR: '.',\n /**\n * The separator between the key and the value pairs in the &cad=\n * URL parameter value.\n */\n CAD_KEY_VALUE_SEPARATOR: ':',\n /**\n * The separator between the key-value pairs in the &cad= URL\n * parameter value.\n */\n CAD_SEPARATOR: ','\n};\n\n/*\n * Names of events that are special to jsaction. These are not all\n * event types that are legal to use in either HTML or the addEvent()\n * API, but these are the ones that are treated specially. All other\n * DOM events can be used in either addEvent() or in the value of the\n * jsaction attribute. Beware of browser specific events or events\n * that don't bubble though: If they are not mentioned here, then\n * event contract doesn't work around their peculiarities.\n */\nconst EventType = {\n /**\n * Mouse middle click, introduced in Chrome 55 and not yet supported on\n * other browsers.\n */\n AUXCLICK: 'auxclick',\n /**\n * The change event fired by browsers when the `value` attribute of input,\n * select, and textarea elements are changed.\n */\n CHANGE: 'change',\n /**\n * The click event. In addEvent() refers to all click events, in the\n * jsaction attribute it refers to the unmodified click and Enter/Space\n * keypress events. In the latter case, a jsaction click will be triggered,\n * for accessibility reasons. See clickmod and clickonly, below.\n */\n CLICK: 'click',\n /**\n * Specifies the jsaction for a modified click event (i.e. a mouse\n * click with the modifier key Cmd/Ctrl pressed). This event isn't\n * separately enabled in addEvent(), because in the DOM, it's just a\n * click event.\n */\n CLICKMOD: 'clickmod',\n /**\n * Specifies the jsaction for a click-only event. Click-only doesn't take\n * into account the case where an element with focus receives an Enter/Space\n * keypress. This event isn't separately enabled in addEvent().\n */\n CLICKONLY: 'clickonly',\n /**\n * The dblclick event.\n */\n DBLCLICK: 'dblclick',\n /**\n * Focus doesn't bubble, but you can use it in addEvent() and\n * jsaction anyway. EventContract does the right thing under the\n * hood.\n */\n FOCUS: 'focus',\n /**\n * This event only exists in IE. For addEvent() and jsaction, use\n * focus instead; EventContract does the right thing even though\n * focus doesn't bubble.\n */\n FOCUSIN: 'focusin',\n /**\n * Analog to focus.\n */\n BLUR: 'blur',\n /**\n * Analog to focusin.\n */\n FOCUSOUT: 'focusout',\n /**\n * Submit doesn't bubble, so it cannot be used with event\n * contract. However, the browser helpfully fires a click event on\n * the submit button of a form (even if the form is not submitted by\n * a click on the submit button). So you should handle click on the\n * submit button instead.\n */\n SUBMIT: 'submit',\n /**\n * The keydown event. In addEvent() and non-click jsaction it represents the\n * regular DOM keydown event. It represents click actions in non-Gecko\n * browsers.\n */\n KEYDOWN: 'keydown',\n /**\n * The keypress event. In addEvent() and non-click jsaction it represents the\n * regular DOM keypress event. It represents click actions in Gecko browsers.\n */\n KEYPRESS: 'keypress',\n /**\n * The keyup event. In addEvent() and non-click jsaction it represents the\n * regular DOM keyup event. It represents click actions in non-Gecko\n * browsers.\n */\n KEYUP: 'keyup',\n /**\n * The mouseup event. Can either be used directly or used implicitly to\n * capture mouseup events. In addEvent(), it represents a regular DOM\n * mouseup event.\n */\n MOUSEUP: 'mouseup',\n /**\n * The mousedown event. Can either be used directly or used implicitly to\n * capture mouseenter events. In addEvent(), it represents a regular DOM\n * mouseover event.\n */\n MOUSEDOWN: 'mousedown',\n /**\n * The mouseover event. Can either be used directly or used implicitly to\n * capture mouseenter events. In addEvent(), it represents a regular DOM\n * mouseover event.\n */\n MOUSEOVER: 'mouseover',\n /**\n * The mouseout event. Can either be used directly or used implicitly to\n * capture mouseover events. In addEvent(), it represents a regular DOM\n * mouseout event.\n */\n MOUSEOUT: 'mouseout',\n /**\n * The mouseenter event. Does not bubble and fires individually on each\n * element being entered within a DOM tree.\n */\n MOUSEENTER: 'mouseenter',\n /**\n * The mouseleave event. Does not bubble and fires individually on each\n * element being entered within a DOM tree.\n */\n MOUSELEAVE: 'mouseleave',\n /**\n * The mousemove event.\n */\n MOUSEMOVE: 'mousemove',\n /**\n * The pointerup event. Can either be used directly or used implicitly to\n * capture pointerup events. In addEvent(), it represents a regular DOM\n * pointerup event.\n */\n POINTERUP: 'pointerup',\n /**\n * The pointerdown event. Can either be used directly or used implicitly to\n * capture pointerenter events. In addEvent(), it represents a regular DOM\n * mouseover event.\n */\n POINTERDOWN: 'pointerdown',\n /**\n * The pointerover event. Can either be used directly or used implicitly to\n * capture pointerenter events. In addEvent(), it represents a regular DOM\n * pointerover event.\n */\n POINTEROVER: 'pointerover',\n /**\n * The pointerout event. Can either be used directly or used implicitly to\n * capture pointerover events. In addEvent(), it represents a regular DOM\n * pointerout event.\n */\n POINTEROUT: 'pointerout',\n /**\n * The pointerenter event. Does not bubble and fires individually on each\n * element being entered within a DOM tree.\n */\n POINTERENTER: 'pointerenter',\n /**\n * The pointerleave event. Does not bubble and fires individually on each\n * element being entered within a DOM tree.\n */\n POINTERLEAVE: 'pointerleave',\n /**\n * The pointermove event.\n */\n POINTERMOVE: 'pointermove',\n /**\n * The pointercancel event.\n */\n POINTERCANCEL: 'pointercancel',\n /**\n * The gotpointercapture event is fired when\n * Element.setPointerCapture(pointerId) is called on a mouse input, or\n * implicitly when a touch input begins.\n */\n GOTPOINTERCAPTURE: 'gotpointercapture',\n /**\n * The lostpointercapture event is fired when\n * Element.releasePointerCapture(pointerId) is called, or implicitly after a\n * touch input ends.\n */\n LOSTPOINTERCAPTURE: 'lostpointercapture',\n /**\n * The error event. The error event doesn't bubble, but you can use it in\n * addEvent() and jsaction anyway. EventContract does the right thing under\n * the hood (except in IE8 which does not use error events).\n */\n ERROR: 'error',\n /**\n * The load event. The load event doesn't bubble, but you can use it in\n * addEvent() and jsaction anyway. EventContract does the right thing\n * under the hood.\n */\n LOAD: 'load',\n /**\n * The unload event.\n */\n UNLOAD: 'unload',\n /**\n * The touchstart event. Bubbles, will only ever fire in browsers with\n * touch support.\n */\n TOUCHSTART: 'touchstart',\n /**\n * The touchend event. Bubbles, will only ever fire in browsers with\n * touch support.\n */\n TOUCHEND: 'touchend',\n /**\n * The touchmove event. Bubbles, will only ever fire in browsers with\n * touch support.\n */\n TOUCHMOVE: 'touchmove',\n /**\n * The input event.\n */\n INPUT: 'input',\n /**\n * The scroll event.\n */\n SCROLL: 'scroll',\n /**\n * The toggle event. The toggle event doesn't bubble, but you can use it in\n * addEvent() and jsaction anyway. EventContract does the right thing\n * under the hood.\n */\n TOGGLE: 'toggle',\n /**\n * A custom event. The actual custom event type is declared as the 'type'\n * field in the event details. Supported in Firefox 6+, IE 9+, and all Chrome\n * versions.\n *\n * This is an internal name. Users should use jsaction's fireCustomEvent to\n * fire custom events instead of relying on this type to create them.\n */\n CUSTOM: '_custom'\n};\nconst NON_BUBBLING_MOUSE_EVENTS = [EventType.MOUSEENTER, EventType.MOUSELEAVE, 'pointerenter', 'pointerleave'];\n/**\n * Detects whether a given event type is supported by JSAction.\n */\nconst isSupportedEvent = eventType => SUPPORTED_EVENTS.includes(eventType);\nconst SUPPORTED_EVENTS = [EventType.CLICK, EventType.DBLCLICK, EventType.FOCUS, EventType.FOCUSIN, EventType.BLUR, EventType.ERROR, EventType.FOCUSOUT, EventType.KEYDOWN, EventType.KEYUP, EventType.KEYPRESS, EventType.LOAD, EventType.MOUSEOVER, EventType.MOUSEOUT, EventType.SUBMIT, EventType.TOGGLE, EventType.TOUCHSTART, EventType.TOUCHEND, EventType.TOUCHMOVE, 'touchcancel', 'auxclick', 'change', 'compositionstart', 'compositionupdate', 'compositionend', 'beforeinput', 'input', 'select', 'copy', 'cut', 'paste', 'mousedown', 'mouseup', 'wheel', 'contextmenu', 'dragover', 'dragenter', 'dragleave', 'drop', 'dragstart', 'dragend', 'pointerdown', 'pointermove', 'pointerup', 'pointercancel', 'pointerover', 'pointerout', 'gotpointercapture', 'lostpointercapture',\n// Video events.\n'ended', 'loadedmetadata',\n// Page visibility events.\n'pagehide', 'pageshow', 'visibilitychange',\n// Content visibility events.\n'beforematch'];\n/**\n *\n * Decides whether or not an event type is an event that only has a capture phase.\n *\n * @param eventType\n * @returns bool\n */\nconst isCaptureEvent = eventType => CAPTURE_EVENTS.indexOf(eventType) >= 0;\nconst CAPTURE_EVENTS = [EventType.FOCUS, EventType.BLUR, EventType.ERROR, EventType.LOAD, EventType.TOGGLE];\n\n/**\n * The parsed value of the jsaction attribute is stored in this\n * property on the DOM node. The parsed value is an Object. The\n * property names of the object are the events; the values are the\n * names of the actions. This property is attached even on nodes\n * that don't have a jsaction attribute as an optimization, because\n * property lookup is faster than attribute access.\n */\nconst JSACTION = '__jsaction';\n/** The value of the oi attribute as a property, for faster access. */\nconst OI = '__oi';\n/**\n * The owner property references an a logical owner for a DOM node. JSAction\n * will follow this reference instead of parentNode when traversing the DOM\n * to find jsaction attributes. This allows overlaying a logical structure\n * over a document where the DOM structure can't reflect that structure.\n */\nconst OWNER = '__owner';\n/** All properties that are used by jsaction. */\nconst Property = {\n JSACTION,\n OI,\n OWNER\n};\n\n/**\n * Map from jsaction annotation to a parsed map from event name to action name.\n */\nconst parseCache = {};\n/**\n * Reads the jsaction parser cache from the given DOM Element.\n *\n * @param element .\n * @return Map from event to qualified name of the jsaction bound to it.\n */\nfunction get(element) {\n // @ts-ignore\n return element[JSACTION];\n}\n/**\n * Writes the jsaction parser cache to the given DOM Element.\n *\n * @param element .\n * @param actionMap Map from event to qualified name of the jsaction bound to\n * it.\n */\nfunction set(element, actionMap) {\n // @ts-ignore\n element[JSACTION] = actionMap;\n}\n/**\n * Looks up the parsed action map from the source jsaction attribute value.\n *\n * @param text Unparsed jsaction attribute value.\n * @return Parsed jsaction attribute value, if already present in the cache.\n */\nfunction getParsed(text) {\n return parseCache[text];\n}\n/**\n * Inserts the parse result for the given source jsaction value into the cache.\n *\n * @param text Unparsed jsaction attribute value.\n * @param parsed Attribute value parsed into the action map.\n */\nfunction setParsed(text, parsed) {\n parseCache[text] = parsed;\n}\n/**\n * Clears the jsaction parser cache from the given DOM Element.\n *\n * @param element .\n */\nfunction clear(element) {\n if (JSACTION in element) {\n delete element[JSACTION];\n }\n}\n\n/** Added for readability when accessing stable property names. */\nfunction getEventType(eventInfo) {\n return eventInfo.eventType;\n}\n/** Added for readability when accessing stable property names. */\nfunction setEventType(eventInfo, eventType) {\n eventInfo.eventType = eventType;\n}\n/** Added for readability when accessing stable property names. */\nfunction getEvent(eventInfo) {\n return eventInfo.event;\n}\n/** Added for readability when accessing stable property names. */\nfunction setEvent(eventInfo, event) {\n eventInfo.event = event;\n}\n/** Added for readability when accessing stable property names. */\nfunction getTargetElement(eventInfo) {\n return eventInfo.targetElement;\n}\n/** Added for readability when accessing stable property names. */\nfunction setTargetElement(eventInfo, targetElement) {\n eventInfo.targetElement = targetElement;\n}\n/** Added for readability when accessing stable property names. */\nfunction getContainer(eventInfo) {\n return eventInfo.eic;\n}\n/** Added for readability when accessing stable property names. */\nfunction setContainer(eventInfo, container) {\n eventInfo.eic = container;\n}\n/** Added for readability when accessing stable property names. */\nfunction getTimestamp(eventInfo) {\n return eventInfo.timeStamp;\n}\n/** Added for readability when accessing stable property names. */\nfunction setTimestamp(eventInfo, timestamp) {\n eventInfo.timeStamp = timestamp;\n}\n/** Added for readability when accessing stable property names. */\nfunction getAction(eventInfo) {\n return eventInfo.eia;\n}\n/** Added for readability when accessing stable property names. */\nfunction setAction(eventInfo, actionName, actionElement) {\n eventInfo.eia = [actionName, actionElement];\n}\n/** Added for readability when accessing stable property names. */\nfunction unsetAction(eventInfo) {\n eventInfo.eia = undefined;\n}\n/** Added for readability when accessing stable property names. */\nfunction getActionName(actionInfo) {\n return actionInfo[0];\n}\n/** Added for readability when accessing stable property names. */\nfunction getActionElement(actionInfo) {\n return actionInfo[1];\n}\n/** Added for readability when accessing stable property names. */\nfunction getIsReplay(eventInfo) {\n return eventInfo.eirp;\n}\n/** Added for readability when accessing stable property names. */\nfunction setIsReplay(eventInfo, replay) {\n eventInfo.eirp = replay;\n}\n/** Added for readability when accessing stable property names. */\nfunction getA11yClickKey(eventInfo) {\n return eventInfo.eiack;\n}\n/** Added for readability when accessing stable property names. */\nfunction setA11yClickKey(eventInfo, a11yClickKey) {\n eventInfo.eiack = a11yClickKey;\n}\n/** Added for readability when accessing stable property names. */\nfunction getResolved(eventInfo) {\n return eventInfo.eir;\n}\n/** Added for readability when accessing stable property names. */\nfunction setResolved(eventInfo, resolved) {\n eventInfo.eir = resolved;\n}\n/** Clones an `EventInfo` */\nfunction cloneEventInfo(eventInfo) {\n return {\n eventType: eventInfo.eventType,\n event: eventInfo.event,\n targetElement: eventInfo.targetElement,\n eic: eventInfo.eic,\n eia: eventInfo.eia,\n timeStamp: eventInfo.timeStamp,\n eirp: eventInfo.eirp,\n eiack: eventInfo.eiack,\n eir: eventInfo.eir\n };\n}\n/**\n * Utility function for creating an `EventInfo`.\n *\n * This can be used from code-size sensitive compilation units, as taking\n * parameters vs. an `Object` literal reduces code size.\n */\nfunction createEventInfoFromParameters(eventType, event, targetElement, container, timestamp, action, isReplay, a11yClickKey) {\n return {\n eventType,\n event,\n targetElement,\n eic: container,\n timeStamp: timestamp,\n eia: action,\n eirp: isReplay,\n eiack: a11yClickKey\n };\n}\n/**\n * Utility function for creating an `EventInfo`.\n *\n * This should be used in compilation units that are less sensitive to code\n * size.\n */\nfunction createEventInfo({\n eventType,\n event,\n targetElement,\n container,\n timestamp,\n action,\n isReplay,\n a11yClickKey\n}) {\n return {\n eventType,\n event,\n targetElement,\n eic: container,\n timeStamp: timestamp,\n eia: action ? [action.name, action.element] : undefined,\n eirp: isReplay,\n eiack: a11yClickKey\n };\n}\n/**\n * Utility class around an `EventInfo`.\n *\n * This should be used in compilation units that are less sensitive to code\n * size.\n */\nclass EventInfoWrapper {\n constructor(eventInfo) {\n this.eventInfo = eventInfo;\n }\n getEventType() {\n return getEventType(this.eventInfo);\n }\n setEventType(eventType) {\n setEventType(this.eventInfo, eventType);\n }\n getEvent() {\n return getEvent(this.eventInfo);\n }\n setEvent(event) {\n setEvent(this.eventInfo, event);\n }\n getTargetElement() {\n return getTargetElement(this.eventInfo);\n }\n setTargetElement(targetElement) {\n setTargetElement(this.eventInfo, targetElement);\n }\n getContainer() {\n return getContainer(this.eventInfo);\n }\n setContainer(container) {\n setContainer(this.eventInfo, container);\n }\n getTimestamp() {\n return getTimestamp(this.eventInfo);\n }\n setTimestamp(timestamp) {\n setTimestamp(this.eventInfo, timestamp);\n }\n getAction() {\n const action = getAction(this.eventInfo);\n if (!action) return undefined;\n return {\n name: action[0],\n element: action[1]\n };\n }\n setAction(action) {\n if (!action) {\n unsetAction(this.eventInfo);\n return;\n }\n setAction(this.eventInfo, action.name, action.element);\n }\n getIsReplay() {\n return getIsReplay(this.eventInfo);\n }\n setIsReplay(replay) {\n setIsReplay(this.eventInfo, replay);\n }\n getResolved() {\n return getResolved(this.eventInfo);\n }\n setResolved(resolved) {\n setResolved(this.eventInfo, resolved);\n }\n clone() {\n return new EventInfoWrapper(cloneEventInfo(this.eventInfo));\n }\n}\n\n/**\n * Determines if one node is contained within another. Adapted from\n * {@see goog.dom.contains}.\n * @param node Node that should contain otherNode.\n * @param otherNode Node being contained.\n * @return True if otherNode is contained within node.\n */\nfunction contains(node, otherNode) {\n if (otherNode === null) {\n return false;\n }\n // We use browser specific methods for this if available since it is faster\n // that way.\n // IE DOM\n if ('contains' in node && otherNode.nodeType === 1) {\n return node.contains(otherNode);\n }\n // W3C DOM Level 3\n if ('compareDocumentPosition' in node) {\n return node === otherNode || Boolean(node.compareDocumentPosition(otherNode) & 16);\n }\n // W3C DOM Level 1\n while (otherNode && node !== otherNode) {\n otherNode = otherNode.parentNode;\n }\n return otherNode === node;\n}\n/**\n * Helper method for broadcastCustomEvent. Returns true if any member of\n * the set is an ancestor of element.\n */\nfunction hasAncestorInNodeList(element, nodeList) {\n for (let idx = 0; idx < nodeList.length; ++idx) {\n const member = nodeList[idx];\n if (member !== element && contains(member, element)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * If on a Macintosh with an extended keyboard, the Enter key located in the\n * numeric pad has a different ASCII code.\n */\nconst MAC_ENTER = 3;\n/** The Enter key. */\nconst ENTER = 13;\n/** The Space key. */\nconst SPACE = 32;\n/** Special keycodes used by jsaction for the generic click action. */\nconst KeyCode = {\n MAC_ENTER,\n ENTER,\n SPACE\n};\n\n/**\n * Gets a browser event type, if it would differ from the JSAction event type.\n */\nfunction getBrowserEventType(eventType) {\n // Mouseenter and mouseleave events are not handled directly because they\n // are not available everywhere. In browsers where they are available, they\n // don't bubble and aren't visible at the container boundary. Instead, we\n // synthesize the mouseenter and mouseleave events from mouseover and\n // mouseout events, respectively. Cf. eventcontract.js.\n if (eventType === EventType.MOUSEENTER) {\n return EventType.MOUSEOVER;\n } else if (eventType === EventType.MOUSELEAVE) {\n return EventType.MOUSEOUT;\n } else if (eventType === EventType.POINTERENTER) {\n return EventType.POINTEROVER;\n } else if (eventType === EventType.POINTERLEAVE) {\n return EventType.POINTEROUT;\n }\n return eventType;\n}\n/**\n * Registers the event handler function with the given DOM element for\n * the given event type.\n *\n * @param element The element.\n * @param eventType The event type.\n * @param handler The handler function to install.\n * @return Information needed to uninstall the event handler eventually.\n */\nfunction addEventListener(element, eventType, handler) {\n // All event handlers are registered in the bubbling\n // phase.\n //\n // All browsers support focus and blur, but these events only are propagated\n // in the capture phase. Very legacy browsers do not support focusin or\n // focusout.\n //\n // It would be a bad idea to register all event handlers in the\n // capture phase because then regular onclick handlers would not be\n // executed at all on events that trigger a jsaction. That's not\n // entirely what we want, at least for now.\n //\n // Error and load events (i.e. on images) do not bubble so they are also\n // handled in the capture phase.\n let capture = false;\n if (isCaptureEvent(eventType)) {\n capture = true;\n }\n element.addEventListener(eventType, handler, capture);\n return {\n eventType,\n handler,\n capture\n };\n}\n/**\n * Removes the event handler for the given event from the element.\n * the given event type.\n *\n * @param element The element.\n * @param info The information needed to deregister the handler, as returned by\n * addEventListener(), above.\n */\nfunction removeEventListener(element, info) {\n if (element.removeEventListener) {\n element.removeEventListener(info.eventType, info.handler, info.capture);\n // `detachEvent` is an old DOM API.\n // tslint:disable-next-line:no-any\n } else if (element.detachEvent) {\n // `detachEvent` is an old DOM API.\n // tslint:disable-next-line:no-any\n element.detachEvent(`on${info.eventType}`, info.handler);\n }\n}\n/**\n * Cancels propagation of an event.\n * @param e The event to cancel propagation for.\n */\nfunction stopPropagation(e) {\n e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;\n}\n/**\n * Prevents the default action of an event.\n * @param e The event to prevent the default action for.\n */\nfunction preventDefault(e) {\n e.preventDefault ? e.preventDefault() : e.returnValue = false;\n}\n/**\n * Gets the target Element of the event. In Firefox, a text node may appear as\n * the target of the event, in which case we return the parent element of the\n * text node.\n * @param e The event to get the target of.\n * @return The target element.\n */\nfunction getTarget(e) {\n let el = e.target;\n // In Firefox, the event may have a text node as its target. We always\n // want the parent Element the text node belongs to, however.\n if (!el.getAttribute && el.parentNode) {\n el = el.parentNode;\n }\n return el;\n}\n/**\n * Whether we are on a Mac. Not pulling in useragent just for this.\n */\nlet isMac = typeof navigator !== 'undefined' && /*#__PURE__*//Macintosh/.test(navigator.userAgent);\n/**\n * Determines and returns whether the given event (which is assumed to be a\n * click event) is a middle click.\n * NOTE: There is not a consistent way to identify middle click\n * http://www.unixpapa.com/js/mouse.html\n */\nfunction isMiddleClick(e) {\n return (\n // `which` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.which === 2 ||\n // `which` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.which == null &&\n // `button` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.button === 4 // middle click for IE\n );\n}\n/**\n * Determines and returns whether the given event (which is assumed\n * to be a click event) is modified. A middle click is considered a modified\n * click to retain the default browser action, which opens a link in a new tab.\n * @param e The event.\n * @return Whether the given event is modified.\n */\nfunction isModifiedClickEvent(e) {\n return (\n // `metaKey` is an old DOM API.\n // tslint:disable-next-line:no-any\n isMac && e.metaKey ||\n // `ctrlKey` is an old DOM API.\n // tslint:disable-next-line:no-any\n !isMac && e.ctrlKey || isMiddleClick(e) ||\n // `shiftKey` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.shiftKey\n );\n}\n/** Whether we are on WebKit (e.g., Chrome). */\nconst isWebKit = typeof navigator !== 'undefined' && ! /*#__PURE__*//Opera/.test(navigator.userAgent) && /*#__PURE__*//WebKit/.test(navigator.userAgent);\n/** Whether we are on IE. */\nconst isIe = typeof navigator !== 'undefined' && (/*#__PURE__*//MSIE/.test(navigator.userAgent) || /*#__PURE__*//Trident/.test(navigator.userAgent));\n/** Whether we are on Gecko (e.g., Firefox). */\nconst isGecko = typeof navigator !== 'undefined' && ! /*#__PURE__*//Opera|WebKit/.test(navigator.userAgent) && /*#__PURE__*//Gecko/.test(navigator.product);\n/**\n * Determines and returns whether the given element is a valid target for\n * keypress/keydown DOM events that act like regular DOM clicks.\n * @param el The element.\n * @return Whether the given element is a valid action key target.\n */\nfunction isValidActionKeyTarget(el) {\n if (!('getAttribute' in el)) {\n return false;\n }\n if (isTextControl(el)) {\n return false;\n }\n if (isNativelyActivatable(el)) {\n return false;\n }\n // `isContentEditable` is an old DOM API.\n // tslint:disable-next-line:no-any\n if (el.isContentEditable) {\n return false;\n }\n return true;\n}\n/**\n * Whether an event has a modifier key activated.\n * @param e The event.\n * @return True, if a modifier key is activated.\n */\nfunction hasModifierKey(e) {\n return (\n // `ctrlKey` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.ctrlKey ||\n // `shiftKey` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.shiftKey ||\n // `altKey` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.altKey ||\n // `metaKey` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.metaKey\n );\n}\n/**\n * Determines and returns whether the given event has a target that already\n * has event handlers attached because it is a native HTML control. Used to\n * determine if preventDefault should be called when isActionKeyEvent is true.\n * @param e The event.\n * @return If preventDefault should be called.\n */\nfunction shouldCallPreventDefaultOnNativeHtmlControl(e) {\n const el = getTarget(e);\n const tagName = el.tagName.toUpperCase();\n const role = (el.getAttribute('role') || '').toUpperCase();\n if (tagName === 'BUTTON' || role === 'BUTTON') {\n return true;\n }\n if (!isNativeHTMLControl(el)) {\n return false;\n }\n if (tagName === 'A') {\n return false;\n }\n /**\n * Fix for physical d-pads on feature phone platforms; the native event\n * (ie. isTrusted: true) needs to fire to show the OPTION list. See\n * b/135288469 for more info.\n */\n if (tagName === 'SELECT') {\n return false;\n }\n if (processSpace(el)) {\n return false;\n }\n if (isTextControl(el)) {\n return false;\n }\n return true;\n}\n/**\n * Determines and returns whether the given event acts like a regular DOM click,\n * and should be handled instead of the click. If this returns true, the caller\n * will call preventDefault() to prevent a possible duplicate event.\n * This is represented by a keypress (keydown on Gecko browsers) on Enter or\n * Space key.\n * @param e The event.\n * @return True, if the event emulates a DOM click.\n */\nfunction isActionKeyEvent(e) {\n let key =\n // `which` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.which ||\n // `keyCode` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.keyCode;\n if (!key && e.key) {\n key = ACTION_KEY_TO_KEYCODE[e.key];\n }\n if (isWebKit && key === KeyCode.MAC_ENTER) {\n key = KeyCode.ENTER;\n }\n if (key !== KeyCode.ENTER && key !== KeyCode.SPACE) {\n return false;\n }\n const el = getTarget(e);\n if (e.type !== EventType.KEYDOWN || !isValidActionKeyTarget(el) || hasModifierKey(e)) {\n return false;\n }\n // For , we must only handle the browser's native click\n // event, so that the browser can toggle the checkbox.\n if (processSpace(el) && key === KeyCode.SPACE) {\n return false;\n }\n // If this element is non-focusable, ignore stray keystrokes (b/18337209)\n // Sscreen readers can move without tab focus, so any tabIndex is focusable.\n // See B/21809604\n if (!isFocusable(el)) {\n return false;\n }\n const type = (el.getAttribute('role') || el.type || el.tagName).toUpperCase();\n const isSpecificTriggerKey = IDENTIFIER_TO_KEY_TRIGGER_MAPPING[type] % key === 0;\n const isDefaultTriggerKey = !(type in IDENTIFIER_TO_KEY_TRIGGER_MAPPING) && key === KeyCode.ENTER;\n const hasType = el.tagName.toUpperCase() !== 'INPUT' || !!el.type;\n return (isSpecificTriggerKey || isDefaultTriggerKey) && hasType;\n}\n/**\n * Checks whether a DOM element can receive keyboard focus.\n * This code is based on goog.dom.isFocusable, but simplified since we shouldn't\n * care about visibility if we're already handling a keyboard event.\n */\nfunction isFocusable(el) {\n return (el.tagName in NATIVELY_FOCUSABLE_ELEMENTS || hasSpecifiedTabIndex(el)) && !el.disabled;\n}\n/**\n * @param element Element to check.\n * @return Whether the element has a specified tab index.\n */\nfunction hasSpecifiedTabIndex(element) {\n // IE returns 0 for an unset tabIndex, so we must use getAttributeNode(),\n // which returns an object with a 'specified' property if tabIndex is\n // specified. This works on other browsers, too.\n const attrNode = element.getAttributeNode('tabindex'); // Must be lowercase!\n return attrNode != null && attrNode.specified;\n}\n/** Element tagnames that are focusable by default. */\nconst NATIVELY_FOCUSABLE_ELEMENTS = {\n 'A': 1,\n 'INPUT': 1,\n 'TEXTAREA': 1,\n 'SELECT': 1,\n 'BUTTON': 1\n};\n/** @return True, if the Space key was pressed. */\nfunction isSpaceKeyEvent(e) {\n const key =\n // `which` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.which ||\n // `keyCode` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.keyCode;\n const el = getTarget(e);\n const elementName = (el.type || el.tagName).toUpperCase();\n return key === KeyCode.SPACE && elementName !== 'CHECKBOX';\n}\n/**\n * Determines whether the event corresponds to a non-bubbling mouse\n * event type (mouseenter, mouseleave, pointerenter, and pointerleave).\n *\n * During mouseover (mouseenter) and pointerover (pointerenter), the\n * relatedTarget is the element being entered from. During mouseout (mouseleave)\n * and pointerout (pointerleave), the relatedTarget is the element being exited\n * to.\n *\n * In both cases, if relatedTarget is outside target, then the corresponding\n * special event has occurred, otherwise it hasn't.\n *\n * @param e The mouseover/mouseout event.\n * @param type The type of the mouse special event.\n * @param element The element on which the jsaction for the\n * mouseenter/mouseleave event is defined.\n * @return True if the event is a mouseenter/mouseleave event.\n */\nfunction isMouseSpecialEvent(e, type, element) {\n // `relatedTarget` is an old DOM API.\n // tslint:disable-next-line:no-any\n const related = e.relatedTarget;\n return (e.type === EventType.MOUSEOVER && type === EventType.MOUSEENTER || e.type === EventType.MOUSEOUT && type === EventType.MOUSELEAVE || e.type === EventType.POINTEROVER && type === EventType.POINTERENTER || e.type === EventType.POINTEROUT && type === EventType.POINTERLEAVE) && (!related || related !== element && !contains(element, related));\n}\n/**\n * Creates a new EventLike object for a mouseenter/mouseleave event that's\n * derived from the original corresponding mouseover/mouseout event.\n * @param e The event.\n * @param target The element on which the jsaction for the mouseenter/mouseleave\n * event is defined.\n * @return A modified event-like object copied from the event object passed into\n * this function.\n */\nfunction createMouseSpecialEvent(e, target) {\n // We have to create a copy of the event object because we need to mutate\n // its fields. We do this for the special mouse events because the event\n // target needs to be retargeted to the action element rather than the real\n // element (since we are simulating the special mouse events with mouseover/\n // mouseout).\n //\n // Since we're making a copy anyways, we might as well attempt to convert\n // this event into a pseudo-real mouseenter/mouseleave event by adjusting\n // its type.\n //\n // tslint:disable-next-line:no-any\n const copy = {};\n for (const property in e) {\n if (property === 'srcElement' || property === 'target') {\n continue;\n }\n const key = property;\n // Making a copy requires iterating through all properties of `Event`.\n // tslint:disable-next-line:no-dict-access-on-struct-type\n const value = e[key];\n if (typeof value === 'function') {\n continue;\n }\n // Value should be the expected type, but the value of `key` is not known\n // statically.\n // tslint:disable-next-line:no-any\n copy[key] = value;\n }\n if (e.type === EventType.MOUSEOVER) {\n copy['type'] = EventType.MOUSEENTER;\n } else if (e.type === EventType.MOUSEOUT) {\n copy['type'] = EventType.MOUSELEAVE;\n } else if (e.type === EventType.POINTEROVER) {\n copy['type'] = EventType.POINTERENTER;\n } else {\n copy['type'] = EventType.POINTERLEAVE;\n }\n copy['target'] = copy['srcElement'] = target;\n copy['bubbles'] = false;\n return copy;\n}\n/**\n * Returns touch data extracted from the touch event: clientX, clientY, screenX\n * and screenY. If the event has no touch information at all, the returned\n * value is null.\n *\n * The fields of this Object are unquoted.\n *\n * @param event A touch event.\n */\nfunction getTouchData(event) {\n const touch = event.changedTouches && event.changedTouches[0] || event.touches && event.touches[0];\n if (!touch) {\n return null;\n }\n return {\n clientX: touch.clientX,\n clientY: touch.clientY,\n screenX: touch.screenX,\n screenY: touch.screenY\n };\n}\n/**\n * Creates a new EventLike object for a \"click\" event that's derived from the\n * original corresponding \"touchend\" event for a fast-click implementation.\n *\n * It takes a touch event, adds common fields found in a click event and\n * changes the type to 'click', so that the resulting event looks more like\n * a real click event.\n *\n * @param event A touch event.\n * @return A modified event-like object copied from the event object passed into\n * this function.\n */\nfunction recreateTouchEventAsClick(event) {\n const click = {};\n click['originalEventType'] = event.type;\n click['type'] = EventType.CLICK;\n for (const property in event) {\n if (property === 'type' || property === 'srcElement') {\n continue;\n }\n const key = property;\n // Making a copy requires iterating through all properties of `TouchEvent`.\n // tslint:disable-next-line:no-dict-access-on-struct-type\n const value = event[key];\n if (typeof value === 'function') {\n continue;\n }\n // Value should be the expected type, but the value of `key` is not known\n // statically.\n // tslint:disable-next-line:no-any\n click[key] = value;\n }\n // Ensure that the event has the most recent timestamp. This timestamp\n // may be used in the future to validate or cancel subsequent click events.\n click['timeStamp'] = Date.now();\n // Emulate preventDefault and stopPropagation behavior\n click['defaultPrevented'] = false;\n click['preventDefault'] = syntheticPreventDefault;\n click['_propagationStopped'] = false;\n click['stopPropagation'] = syntheticStopPropagation;\n // Emulate click coordinates using touch info\n const touch = getTouchData(event);\n if (touch) {\n click['clientX'] = touch.clientX;\n click['clientY'] = touch.clientY;\n click['screenX'] = touch.screenX;\n click['screenY'] = touch.screenY;\n }\n return click;\n}\n/**\n * An implementation of \"preventDefault\" for a synthesized event. Simply\n * sets \"defaultPrevented\" property to true.\n */\nfunction syntheticPreventDefault() {\n this.defaultPrevented = true;\n}\n/**\n * An implementation of \"stopPropagation\" for a synthesized event. It simply\n * sets a synthetic non-standard \"_propagationStopped\" property to true.\n */\nfunction syntheticStopPropagation() {\n this._propagationStopped = true;\n}\n/**\n * Mapping of KeyboardEvent.key values to\n * KeyCode values.\n */\nconst ACTION_KEY_TO_KEYCODE = {\n 'Enter': KeyCode.ENTER,\n ' ': KeyCode.SPACE\n};\n/**\n * Mapping of HTML element identifiers (ARIA role, type, or tagName) to the\n * keys (enter and/or space) that should activate them. A value of zero means\n * that both should activate them.\n */\nconst IDENTIFIER_TO_KEY_TRIGGER_MAPPING = {\n 'A': KeyCode.ENTER,\n 'BUTTON': 0,\n 'CHECKBOX': KeyCode.SPACE,\n 'COMBOBOX': KeyCode.ENTER,\n 'FILE': 0,\n 'GRIDCELL': KeyCode.ENTER,\n 'LINK': KeyCode.ENTER,\n 'LISTBOX': KeyCode.ENTER,\n 'MENU': 0,\n 'MENUBAR': 0,\n 'MENUITEM': 0,\n 'MENUITEMCHECKBOX': 0,\n 'MENUITEMRADIO': 0,\n 'OPTION': 0,\n 'RADIO': KeyCode.SPACE,\n 'RADIOGROUP': KeyCode.SPACE,\n 'RESET': 0,\n 'SUBMIT': 0,\n 'SWITCH': KeyCode.SPACE,\n 'TAB': 0,\n 'TREE': KeyCode.ENTER,\n 'TREEITEM': KeyCode.ENTER\n};\n/**\n * Returns whether or not to process space based on the type of the element;\n * checks to make sure that type is not null.\n * @param element The element.\n * @return Whether or not to process space based on type.\n */\nfunction processSpace(element) {\n const type = (element.getAttribute('type') || element.tagName).toUpperCase();\n return type in PROCESS_SPACE;\n}\n/**\n * Returns whether or not the given element is a text control.\n * @param el The element.\n * @return Whether or not the given element is a text control.\n */\nfunction isTextControl(el) {\n const type = (el.getAttribute('type') || el.tagName).toUpperCase();\n return type in TEXT_CONTROLS;\n}\n/**\n * Returns if the given element is a native HTML control.\n * @param el The element.\n * @return If the given element is a native HTML control.\n */\nfunction isNativeHTMLControl(el) {\n return el.tagName.toUpperCase() in NATIVE_HTML_CONTROLS;\n}\n/**\n * Returns if the given element is natively activatable. Browsers emit click\n * events for natively activatable elements, even when activated via keyboard.\n * For these elements, we don't need to raise a11y click events.\n * @param el The element.\n * @return If the given element is a native HTML control.\n */\nfunction isNativelyActivatable(el) {\n return el.tagName.toUpperCase() === 'BUTTON' || !!el.type && el.type.toUpperCase() === 'FILE';\n}\n/**\n * HTML types (not ARIA roles) which will auto-trigger a click event for\n * the Space key, with side-effects. We will not call preventDefault if space is\n * pressed, nor will we raise a11y click events. For all other elements, we can\n * suppress the default event (which has no desired side-effects) and handle the\n * keydown ourselves.\n */\nconst PROCESS_SPACE = {\n 'CHECKBOX': true,\n 'FILE': true,\n 'OPTION': true,\n 'RADIO': true\n};\n/** TagNames and Input types for which to not process enter/space as click. */\nconst TEXT_CONTROLS = {\n 'COLOR': true,\n 'DATE': true,\n 'DATETIME': true,\n 'DATETIME-LOCAL': true,\n 'EMAIL': true,\n 'MONTH': true,\n 'NUMBER': true,\n 'PASSWORD': true,\n 'RANGE': true,\n 'SEARCH': true,\n 'TEL': true,\n 'TEXT': true,\n 'TEXTAREA': true,\n 'TIME': true,\n 'URL': true,\n 'WEEK': true\n};\n/** TagNames that are native HTML controls. */\nconst NATIVE_HTML_CONTROLS = {\n 'A': true,\n 'AREA': true,\n 'BUTTON': true,\n 'DIALOG': true,\n 'IMG': true,\n 'INPUT': true,\n 'LINK': true,\n 'MENU': true,\n 'OPTGROUP': true,\n 'OPTION': true,\n 'PROGRESS': true,\n 'SELECT': true,\n 'TEXTAREA': true\n};\n/** Exported for testing. */\nconst testing = {\n setIsMac(value) {\n isMac = value;\n }\n};\n\n/**\n * Since maps from event to action are immutable we can use a single map\n * to represent the empty map.\n */\nconst EMPTY_ACTION_MAP = {};\n/**\n * This regular expression matches a semicolon.\n */\nconst REGEXP_SEMICOLON = /\\s*;\\s*/;\n/** If no event type is defined, defaults to `click`. */\nconst DEFAULT_EVENT_TYPE = EventType.CLICK;\n/** Resolves actions for Events. */\nclass ActionResolver {\n constructor({\n syntheticMouseEventSupport = false\n } = {}) {\n this.a11yClickSupport = false;\n this.updateEventInfoForA11yClick = undefined;\n this.preventDefaultForA11yClick = undefined;\n this.populateClickOnlyAction = undefined;\n this.syntheticMouseEventSupport = syntheticMouseEventSupport;\n }\n resolveEventType(eventInfo) {\n // We distinguish modified and plain clicks in order to support the\n // default browser behavior of modified clicks on links; usually to\n // open the URL of the link in new tab or new window on ctrl/cmd\n // click. A DOM 'click' event is mapped to the jsaction 'click'\n // event iff there is no modifier present on the event. If there is\n // a modifier, it's mapped to 'clickmod' instead.\n //\n // It's allowed to omit the event in the jsaction attribute. In that\n // case, 'click' is assumed. Thus the following two are equivalent:\n //\n // \n // \n //\n // For unmodified clicks, EventContract invokes the jsaction\n // 'gna.fu'. For modified clicks, EventContract won't find a\n // suitable action and leave the event to be handled by the\n // browser.\n //\n // In order to also invoke a jsaction handler for a modifier click,\n // 'clickmod' needs to be used:\n //\n // \n //\n // EventContract invokes the jsaction 'gna.fu' for modified\n // clicks. Unmodified clicks are left to the browser.\n //\n // In order to set up the event contract to handle both clickonly and\n // clickmod, only addEvent(EventType.CLICK) is necessary.\n //\n // In order to set up the event contract to handle click,\n // addEvent() is necessary for CLICK, KEYDOWN, and KEYPRESS event types. If\n // a11y click support is enabled, addEvent() will set up the appropriate key\n // event handler automatically.\n if (getEventType(eventInfo) === EventType.CLICK && isModifiedClickEvent(getEvent(eventInfo))) {\n setEventType(eventInfo, EventType.CLICKMOD);\n } else if (this.a11yClickSupport) {\n this.updateEventInfoForA11yClick(eventInfo);\n }\n }\n resolveAction(eventInfo) {\n if (getResolved(eventInfo)) {\n return;\n }\n this.populateAction(eventInfo, getTargetElement(eventInfo));\n setResolved(eventInfo, true);\n }\n resolveParentAction(eventInfo) {\n const action = getAction(eventInfo);\n const actionElement = action && getActionElement(action);\n unsetAction(eventInfo);\n const parentNode = actionElement && this.getParentNode(actionElement);\n if (!parentNode) {\n return;\n }\n this.populateAction(eventInfo, parentNode);\n }\n /**\n * Searches for a jsaction that the DOM event maps to and creates an\n * object containing event information used for dispatching by\n * jsaction.Dispatcher. This method populates the `action` and `actionElement`\n * fields of the EventInfo object passed in by finding the first\n * jsaction attribute above the target Node of the event, and below\n * the container Node, that specifies a jsaction for the event\n * type. If no such jsaction is found, then action is undefined.\n *\n * @param eventInfo `EventInfo` to set `action` and `actionElement` if an\n * action is found on any `Element` in the path of the `Event`.\n */\n populateAction(eventInfo, currentTarget) {\n let actionElement = currentTarget;\n while (actionElement && actionElement !== getContainer(eventInfo)) {\n if (actionElement.nodeType === Node.ELEMENT_NODE) {\n this.populateActionOnElement(actionElement, eventInfo);\n }\n if (getAction(eventInfo)) {\n // An event is handled by at most one jsaction. Thus we stop at the\n // first matching jsaction specified in a jsaction attribute up the\n // ancestor chain of the event target node.\n break;\n }\n actionElement = this.getParentNode(actionElement);\n }\n const action = getAction(eventInfo);\n if (!action) {\n // No action found.\n return;\n }\n if (this.a11yClickSupport) {\n this.preventDefaultForA11yClick(eventInfo);\n }\n // We attempt to handle the mouseenter/mouseleave events here by\n // detecting whether the mouseover/mouseout events correspond to\n // entering/leaving an element.\n if (this.syntheticMouseEventSupport) {\n if (getEventType(eventInfo) === EventType.MOUSEENTER || getEventType(eventInfo) === EventType.MOUSELEAVE || getEventType(eventInfo) === EventType.POINTERENTER || getEventType(eventInfo) === EventType.POINTERLEAVE) {\n // We attempt to handle the mouseenter/mouseleave events here by\n // detecting whether the mouseover/mouseout events correspond to\n // entering/leaving an element.\n if (isMouseSpecialEvent(getEvent(eventInfo), getEventType(eventInfo), getActionElement(action))) {\n // If both mouseover/mouseout and mouseenter/mouseleave events are\n // enabled, two separate handlers for mouseover/mouseout are\n // registered. Both handlers will see the same event instance\n // so we create a copy to avoid interfering with the dispatching of\n // the mouseover/mouseout event.\n const copiedEvent = createMouseSpecialEvent(getEvent(eventInfo), getActionElement(action));\n setEvent(eventInfo, copiedEvent);\n // Since the mouseenter/mouseleave events do not bubble, the target\n // of the event is technically the `actionElement` (the node with the\n // `jsaction` attribute)\n setTargetElement(eventInfo, getActionElement(action));\n } else {\n unsetAction(eventInfo);\n }\n }\n }\n }\n /**\n * Walk to the parent node, unless the node has a different owner in\n * which case we walk to the owner. Attempt to walk to host of a\n * shadow root if needed.\n */\n getParentNode(element) {\n const owner = element[OWNER];\n if (owner) {\n return owner;\n }\n const parentNode = element.parentNode;\n if (parentNode?.nodeName === '#document-fragment') {\n return parentNode?.host ?? null;\n }\n return parentNode;\n }\n /**\n * Accesses the jsaction map on a node and retrieves the name of the\n * action the given event is mapped to, if any. It parses the\n * attribute value and stores it in a property on the node for\n * subsequent retrieval without re-parsing and re-accessing the\n * attribute.\n *\n * @param actionElement The DOM node to retrieve the jsaction map from.\n * @param eventInfo `EventInfo` to set `action` and `actionElement` if an\n * action is found on the `actionElement`.\n */\n populateActionOnElement(actionElement, eventInfo) {\n const actionMap = this.parseActions(actionElement);\n const actionName = actionMap[getEventType(eventInfo)];\n if (actionName !== undefined) {\n setAction(eventInfo, actionName, actionElement);\n }\n if (this.a11yClickSupport) {\n this.populateClickOnlyAction(actionElement, eventInfo, actionMap);\n }\n }\n /**\n * Parses and caches an element's jsaction element into a map.\n *\n * This is primarily for internal use.\n *\n * @param actionElement The DOM node to retrieve the jsaction map from.\n * @return Map from event to qualified name of the jsaction bound to it.\n */\n parseActions(actionElement) {\n let actionMap = get(actionElement);\n if (!actionMap) {\n const jsactionAttribute = actionElement.getAttribute(Attribute.JSACTION);\n if (!jsactionAttribute) {\n actionMap = EMPTY_ACTION_MAP;\n set(actionElement, actionMap);\n } else {\n actionMap = getParsed(jsactionAttribute);\n if (!actionMap) {\n actionMap = {};\n const values = jsactionAttribute.split(REGEXP_SEMICOLON);\n for (let idx = 0; idx < values.length; idx++) {\n const value = values[idx];\n if (!value) {\n continue;\n }\n const colon = value.indexOf(Char.EVENT_ACTION_SEPARATOR);\n const hasColon = colon !== -1;\n const type = hasColon ? value.substr(0, colon).trim() : DEFAULT_EVENT_TYPE;\n const action = hasColon ? value.substr(colon + 1).trim() : value;\n actionMap[type] = action;\n }\n setParsed(jsactionAttribute, actionMap);\n }\n set(actionElement, actionMap);\n }\n }\n return actionMap;\n }\n addA11yClickSupport(updateEventInfoForA11yClick, preventDefaultForA11yClick, populateClickOnlyAction) {\n this.a11yClickSupport = true;\n this.updateEventInfoForA11yClick = updateEventInfoForA11yClick;\n this.preventDefaultForA11yClick = preventDefaultForA11yClick;\n this.populateClickOnlyAction = populateClickOnlyAction;\n }\n}\n\n/**\n * @fileoverview An enum to control who can call certain jsaction APIs.\n */\nvar Restriction = /*#__PURE__*/function (Restriction) {\n Restriction[Restriction[\"I_AM_THE_JSACTION_FRAMEWORK\"] = 0] = \"I_AM_THE_JSACTION_FRAMEWORK\";\n return Restriction;\n}(Restriction || {});\n/**\n * Receives a DOM event, determines the jsaction associated with the source\n * element of the DOM event, and invokes the handler associated with the\n * jsaction.\n */\nclass Dispatcher {\n /**\n * Options are:\n * - `eventReplayer`: When the event contract dispatches replay events\n * to the Dispatcher, the Dispatcher collects them and in the next tick\n * dispatches them to the `eventReplayer`. Defaults to dispatching to `dispatchDelegate`.\n * @param dispatchDelegate A function that should handle dispatching an `EventInfoWrapper` to handlers.\n */\n constructor(dispatchDelegate, {\n actionResolver,\n eventReplayer\n } = {}) {\n this.dispatchDelegate = dispatchDelegate;\n /** Whether the event replay is scheduled. */\n this.eventReplayScheduled = false;\n /** The queue of events. */\n this.replayEventInfoWrappers = [];\n this.actionResolver = actionResolver;\n this.eventReplayer = eventReplayer;\n }\n /**\n * Receives an event or the event queue from the EventContract. The event\n * queue is copied and it attempts to replay.\n * If event info is passed in it looks for an action handler that can handle\n * the given event. If there is no handler registered queues the event and\n * checks if a loader is registered for the given namespace. If so, calls it.\n *\n * Alternatively, if in global dispatch mode, calls all registered global\n * handlers for the appropriate event type.\n *\n * The three functionalities of this call are deliberately not split into\n * three methods (and then declared as an abstract interface), because the\n * interface is used by EventContract, which lives in a different jsbinary.\n * Therefore the interface between the three is defined entirely in terms that\n * are invariant under jscompiler processing (Function and Array, as opposed\n * to a custom type with method names).\n *\n * @param eventInfo The info for the event that triggered this call or the\n * queue of events from EventContract.\n */\n dispatch(eventInfo) {\n const eventInfoWrapper = new EventInfoWrapper(eventInfo);\n this.actionResolver?.resolveEventType(eventInfo);\n this.actionResolver?.resolveAction(eventInfo);\n const action = eventInfoWrapper.getAction();\n if (action && shouldPreventDefaultBeforeDispatching(action.element, eventInfoWrapper)) {\n preventDefault(eventInfoWrapper.getEvent());\n }\n if (this.eventReplayer && eventInfoWrapper.getIsReplay()) {\n this.scheduleEventInfoWrapperReplay(eventInfoWrapper);\n return;\n }\n this.dispatchDelegate(eventInfoWrapper);\n }\n /**\n * Schedules an `EventInfoWrapper` for replay. The replaying will happen in its own\n * stack once the current flow cedes control. This is done to mimic\n * browser event handling.\n */\n scheduleEventInfoWrapperReplay(eventInfoWrapper) {\n this.replayEventInfoWrappers.push(eventInfoWrapper);\n if (this.eventReplayScheduled) {\n return;\n }\n this.eventReplayScheduled = true;\n Promise.resolve().then(() => {\n this.eventReplayScheduled = false;\n this.eventReplayer(this.replayEventInfoWrappers);\n });\n }\n}\n/**\n * Creates an `EventReplayer` that calls the `replay` function for every `eventInfoWrapper` in\n * the queue.\n */\nfunction createEventReplayer(replay) {\n return eventInfoWrappers => {\n for (const eventInfoWrapper of eventInfoWrappers) {\n replay(eventInfoWrapper);\n }\n };\n}\n/**\n * Returns true if the default action of this event should be prevented before\n * this event is dispatched.\n */\nfunction shouldPreventDefaultBeforeDispatching(actionElement, eventInfoWrapper) {\n // Prevent browser from following node links if a jsaction is present\n // and we are dispatching the action now. Note that the targetElement may be\n // a child of an anchor that has a jsaction attached. For that reason, we\n // need to check the actionElement rather than the targetElement.\n return actionElement.tagName === 'A' && eventInfoWrapper.getEventType() === EventType.CLICK || eventInfoWrapper.getEventType() === EventType.CLICKMOD;\n}\n/**\n * Registers deferred functionality for an EventContract and a Jsaction\n * Dispatcher.\n */\nfunction registerDispatcher$1(eventContract, dispatcher) {\n eventContract.ecrd(eventInfo => {\n dispatcher.dispatch(eventInfo);\n }, Restriction.I_AM_THE_JSACTION_FRAMEWORK);\n}\n\n/** An internal symbol used to indicate whether propagation should be stopped or not. */\nconst PROPAGATION_STOPPED_SYMBOL = /*#__PURE__*/Symbol.for('propagationStopped');\n/** Extra event phases beyond what the browser provides. */\nconst EventPhase = {\n REPLAY: 101\n};\nconst PREVENT_DEFAULT_ERROR_MESSAGE_DETAILS = ' Because event replay occurs after browser dispatch, `preventDefault` would have no ' + 'effect. You can check whether an event is being replayed by accessing the event phase: ' + '`event.eventPhase === EventPhase.REPLAY`.';\nconst PREVENT_DEFAULT_ERROR_MESSAGE = `\\`preventDefault\\` called during event replay.`;\nconst COMPOSED_PATH_ERROR_MESSAGE_DETAILS = () => ngDevMode ? ' Because event replay occurs after browser ' + 'dispatch, `composedPath()` will be empty. Iterate parent nodes from `event.target` or ' + '`event.currentTarget` if you need to check elements in the event path.' : '';\nconst COMPOSED_PATH_ERROR_MESSAGE = `\\`composedPath\\` called during event replay.`;\n/**\n * A dispatcher that uses browser-based `Event` semantics, for example bubbling, `stopPropagation`,\n * `currentTarget`, etc.\n */\nclass EventDispatcher {\n constructor(dispatchDelegate) {\n this.dispatchDelegate = dispatchDelegate;\n this.actionResolver = new ActionResolver();\n this.dispatcher = new Dispatcher(eventInfoWrapper => {\n this.dispatchToDelegate(eventInfoWrapper);\n }, {\n actionResolver: this.actionResolver\n });\n }\n /**\n * The entrypoint for the `EventContract` dispatch.\n */\n dispatch(eventInfo) {\n this.dispatcher.dispatch(eventInfo);\n }\n /** Internal method that does basic disaptching. */\n dispatchToDelegate(eventInfoWrapper) {\n if (eventInfoWrapper.getIsReplay()) {\n prepareEventForReplay(eventInfoWrapper);\n }\n prepareEventForBubbling(eventInfoWrapper);\n while (eventInfoWrapper.getAction()) {\n prepareEventForDispatch(eventInfoWrapper);\n this.dispatchDelegate(eventInfoWrapper.getEvent(), eventInfoWrapper.getAction().name);\n if (propagationStopped(eventInfoWrapper)) {\n return;\n }\n this.actionResolver.resolveParentAction(eventInfoWrapper.eventInfo);\n }\n }\n}\nfunction prepareEventForBubbling(eventInfoWrapper) {\n const event = eventInfoWrapper.getEvent();\n const stopPropagation = () => {\n event[PROPAGATION_STOPPED_SYMBOL] = true;\n };\n patchEventInstance(event, 'stopPropagation', stopPropagation);\n patchEventInstance(event, 'stopImmediatePropagation', stopPropagation);\n}\nfunction propagationStopped(eventInfoWrapper) {\n const event = eventInfoWrapper.getEvent();\n return !!event[PROPAGATION_STOPPED_SYMBOL];\n}\nfunction prepareEventForReplay(eventInfoWrapper) {\n const event = eventInfoWrapper.getEvent();\n const target = eventInfoWrapper.getTargetElement();\n patchEventInstance(event, 'target', target);\n patchEventInstance(event, 'eventPhase', EventPhase.REPLAY);\n patchEventInstance(event, 'preventDefault', () => {\n throw new Error(PREVENT_DEFAULT_ERROR_MESSAGE + (ngDevMode ? PREVENT_DEFAULT_ERROR_MESSAGE_DETAILS : ''));\n });\n patchEventInstance(event, 'composedPath', () => {\n throw new Error(COMPOSED_PATH_ERROR_MESSAGE + (ngDevMode ? COMPOSED_PATH_ERROR_MESSAGE_DETAILS : ''));\n });\n}\nfunction prepareEventForDispatch(eventInfoWrapper) {\n const event = eventInfoWrapper.getEvent();\n const currentTarget = eventInfoWrapper.getAction()?.element;\n if (currentTarget) {\n patchEventInstance(event, 'currentTarget', currentTarget, {\n // `currentTarget` is going to get reassigned every dispatch.\n configurable: true\n });\n }\n}\n/**\n * Patch `Event` instance during non-standard `Event` dispatch. This patches just the `Event`\n * instance that the browser created, it does not patch global properties or methods.\n *\n * This is necessary because dispatching an `Event` outside of browser dispatch results in\n * incorrect properties and methods that need to be polyfilled or do not work.\n *\n * JSAction dispatch adds two extra \"phases\" to event dispatch:\n * 1. Event delegation - the event is being dispatched by a delegating event handler on a container\n * (typically `window.document.documentElement`), to a delegated event handler on some child\n * element. Certain `Event` properties will be unintuitive, such as `currentTarget`, which would\n * be the container rather than the child element. Bubbling would also not work. In order to\n * emulate the browser, these properties and methods on the `Event` are patched.\n * 2. Event replay - the event is being dispatched by the framework once the handlers have been\n * loaded (during hydration, or late-loaded). Certain `Event` properties can be unset by the\n * browser because the `Event` is no longer actively being dispatched, such as `target`. Other\n * methods have no effect because the `Event` has already been dispatched, such as\n * `preventDefault`. Bubbling would also not work. These properties and methods are patched,\n * either to fill in information that the browser may have removed, or to throw errors in methods\n * that no longer behave as expected.\n */\nfunction patchEventInstance(event, property, value, {\n configurable = false\n} = {}) {\n Object.defineProperty(event, property, {\n value,\n configurable\n });\n}\n/**\n * Registers deferred functionality for an EventContract and a Jsaction\n * Dispatcher.\n */\nfunction registerDispatcher(eventContract, dispatcher) {\n eventContract.ecrd(eventInfo => {\n dispatcher.dispatch(eventInfo);\n }, Restriction.I_AM_THE_JSACTION_FRAMEWORK);\n}\n\n/**\n * Whether the user agent is running on iOS.\n */\nconst isIos = typeof navigator !== 'undefined' && /*#__PURE__*//iPhone|iPad|iPod/.test(navigator.userAgent);\n/**\n * A class representing a container node and all the event handlers\n * installed on it. Used so that handlers can be cleaned up if the\n * container is removed from the contract.\n */\nclass EventContractContainer {\n /**\n * @param element The container Element.\n */\n constructor(element) {\n this.element = element;\n /**\n * Array of event handlers and their corresponding event types that are\n * installed on this container.\n *\n */\n this.handlerInfos = [];\n }\n /**\n * Installs the provided installer on the element owned by this container,\n * and maintains a reference to resulting handler in order to remove it\n * later if desired.\n */\n addEventListener(eventType, getHandler) {\n // In iOS, event bubbling doesn't happen automatically in any DOM element,\n // unless it has an onclick attribute or DOM event handler attached to it.\n // This breaks JsAction in some cases. See \"Making Elements Clickable\"\n // section at http://goo.gl/2VoGnB.\n //\n // A workaround for this issue is to change the CSS cursor style to 'pointer'\n // for the container element, which magically turns on event bubbling. This\n // solution is described in the comments section at http://goo.gl/6pEO1z.\n //\n // We use a navigator.userAgent check here as this problem is present both\n // on Mobile Safari and thin WebKit wrappers, such as Chrome for iOS.\n if (isIos) {\n this.element.style.cursor = 'pointer';\n }\n this.handlerInfos.push(addEventListener(this.element, eventType, getHandler(this.element)));\n }\n /**\n * Removes all the handlers installed on this container.\n */\n cleanUp() {\n for (let i = 0; i < this.handlerInfos.length; i++) {\n removeEventListener(this.element, this.handlerInfos[i]);\n }\n this.handlerInfos = [];\n }\n}\n\n/**\n * Update `EventInfo` to be `eventType = 'click'` and sets `a11yClickKey` if it\n * is a a11y click.\n */\nfunction updateEventInfoForA11yClick(eventInfo) {\n if (!isActionKeyEvent(getEvent(eventInfo))) {\n return;\n }\n setA11yClickKey(eventInfo, true);\n // A 'click' triggered by a DOM keypress should be mapped to the 'click'\n // jsaction.\n setEventType(eventInfo, EventType.CLICK);\n}\n/**\n * Call `preventDefault` on an a11y click if it is space key or to prevent the\n * browser's default action for native HTML controls.\n */\nfunction preventDefaultForA11yClick(eventInfo) {\n if (!getA11yClickKey(eventInfo) || !isSpaceKeyEvent(getEvent(eventInfo)) && !shouldCallPreventDefaultOnNativeHtmlControl(getEvent(eventInfo))) {\n return;\n }\n preventDefault(getEvent(eventInfo));\n}\n/**\n * Sets the `action` to `clickonly` for a click event that is not an a11y click\n * and if there is not already a click action.\n */\nfunction populateClickOnlyAction(actionElement, eventInfo, actionMap) {\n if (\n // If there's already an action, don't attempt to set a CLICKONLY\n getAction(eventInfo) ||\n // Only attempt CLICKONLY if the type is CLICK\n getEventType(eventInfo) !== EventType.CLICK ||\n // a11y clicks are never CLICKONLY\n getA11yClickKey(eventInfo) || actionMap[EventType.CLICKONLY] === undefined) {\n return;\n }\n setEventType(eventInfo, EventType.CLICKONLY);\n setAction(eventInfo, actionMap[EventType.CLICKONLY], actionElement);\n}\n\n/**\n * @define Support for accessible click actions. This flag can be overridden in\n * a build rule.\n */\nconst A11Y_CLICK_SUPPORT = false;\n/**\n * @define Support for the non-bubbling mouseenter and mouseleave events. This\n * flag can be overridden in a build rule.\n */\nconst MOUSE_SPECIAL_SUPPORT = false;\n\n/**\n * @fileoverview Implements the local event handling contract. This\n * allows DOM objects in a container that enters into this contract to\n * define event handlers which are executed in a local context.\n *\n * One EventContract instance can manage the contract for multiple\n * containers, which are added using the addContainer() method.\n *\n * Events can be registered using the addEvent() method.\n *\n * A Dispatcher is added using the registerDispatcher() method. Until there is\n * a dispatcher, events are queued. The idea is that the EventContract\n * class is inlined in the HTML of the top level page and instantiated\n * right after the start of . The Dispatcher class is contained\n * in the external deferred js, and instantiated and registered with\n * EventContract when the external javascript in the page loads. The\n * external javascript will also register the jsaction handlers, which\n * then pick up the queued events at the time of registration.\n *\n * Since this class is meant to be inlined in the main page HTML, the\n * size of the binary compiled from this file MUST be kept as small as\n * possible and thus its dependencies to a minimum.\n */\n/**\n * EventContract intercepts events in the bubbling phase at the\n * boundary of a container element, and maps them to generic actions\n * which are specified using the custom jsaction attribute in\n * HTML. Behavior of the application is then specified in terms of\n * handler for such actions, cf. jsaction.Dispatcher in dispatcher.js.\n *\n * This has several benefits: (1) No DOM event handlers need to be\n * registered on the specific elements in the UI. (2) The set of\n * events that the application has to handle can be specified in terms\n * of the semantics of the application, rather than in terms of DOM\n * events. (3) Invocation of handlers can be delayed and handlers can\n * be delay loaded in a generic way.\n */\nlet EventContract = /*#__PURE__*/(() => {\n class EventContract {\n static {\n this.A11Y_CLICK_SUPPORT = A11Y_CLICK_SUPPORT;\n }\n static {\n this.MOUSE_SPECIAL_SUPPORT = MOUSE_SPECIAL_SUPPORT;\n }\n constructor(containerManager, useActionResolver = true) {\n this.useActionResolver = useActionResolver;\n /**\n * The DOM events which this contract covers. Used to prevent double\n * registration of event types. The value of the map is the\n * internally created DOM event handler function that handles the\n * DOM events. See addEvent().\n *\n */\n this.eventHandlers = {};\n this.browserEventTypeToExtraEventTypes = {};\n /**\n * The dispatcher function. Events are passed to this function for\n * handling once it was set using the registerDispatcher() method. This is\n * done because the function is passed from another jsbinary, so passing the\n * instance and invoking the method here would require to leave the method\n * unobfuscated.\n */\n this.dispatcher = null;\n /**\n * The list of suspended `EventInfo` that will be dispatched\n * as soon as the `Dispatcher` is registered.\n */\n this.queuedEventInfos = [];\n /** Whether to add an a11y click listener. */\n this.addA11yClickListener = false;\n this.containerManager = containerManager;\n if (this.useActionResolver) {\n this.actionResolver = new ActionResolver({\n syntheticMouseEventSupport: EventContract.MOUSE_SPECIAL_SUPPORT\n });\n }\n if (EventContract.A11Y_CLICK_SUPPORT) {\n // Add a11y click support to the `EventContract`.\n this.addA11yClickSupport();\n }\n }\n handleEvent(eventType, event, container) {\n const eventInfo = createEventInfoFromParameters(/* eventType= */eventType, /* event= */event, /* targetElement= */event.target, /* container= */container, /* timestamp= */Date.now());\n this.handleEventInfo(eventInfo);\n }\n /**\n * Handle an `EventInfo`.\n */\n handleEventInfo(eventInfo) {\n if (!this.dispatcher) {\n // All events are queued when the dispatcher isn't yet loaded.\n setIsReplay(eventInfo, true);\n this.queuedEventInfos?.push(eventInfo);\n return;\n }\n if (this.useActionResolver) {\n this.actionResolver.resolveEventType(eventInfo);\n this.actionResolver.resolveAction(eventInfo);\n }\n this.dispatcher(eventInfo);\n }\n /**\n * Enables jsaction handlers to be called for the event type given by\n * name.\n *\n * If the event is already registered, this does nothing.\n *\n * @param prefixedEventType If supplied, this event is used in\n * the actual browser event registration instead of the name that is\n * exposed to jsaction. Use this if you e.g. want users to be able\n * to subscribe to jsaction=\"transitionEnd:foo\" while the underlying\n * event is webkitTransitionEnd in one browser and mozTransitionEnd\n * in another.\n */\n addEvent(eventType, prefixedEventType) {\n if (eventType in this.eventHandlers || !this.containerManager) {\n return;\n }\n if (!EventContract.MOUSE_SPECIAL_SUPPORT && NON_BUBBLING_MOUSE_EVENTS.indexOf(eventType) >= 0) {\n return;\n }\n const eventHandler = (eventType, event, container) => {\n this.handleEvent(eventType, event, container);\n };\n // Store the callback to allow us to replay events.\n this.eventHandlers[eventType] = eventHandler;\n const browserEventType = getBrowserEventType(prefixedEventType || eventType);\n if (browserEventType !== eventType) {\n const eventTypes = this.browserEventTypeToExtraEventTypes[browserEventType] || [];\n eventTypes.push(eventType);\n this.browserEventTypeToExtraEventTypes[browserEventType] = eventTypes;\n }\n this.containerManager.addEventListener(browserEventType, element => {\n return event => {\n eventHandler(eventType, event, element);\n };\n });\n // Automatically install a keypress/keydown event handler if support for\n // accessible clicks is turned on.\n if (this.addA11yClickListener && eventType === EventType.CLICK) {\n this.addEvent(EventType.KEYDOWN);\n }\n }\n /**\n * Gets the queued early events and replay them using the appropriate handler\n * in the provided event contract. Once all the events are replayed, it cleans\n * up the early contract.\n */\n replayEarlyEvents(earlyJsactionContainer = window) {\n // Check if the early contract is present and prevent calling this function\n // more than once.\n const earlyJsactionData = earlyJsactionContainer._ejsa;\n if (!earlyJsactionData) {\n return;\n }\n // Replay the early contract events.\n const earlyEventInfos = earlyJsactionData.q;\n for (let idx = 0; idx < earlyEventInfos.length; idx++) {\n const earlyEventInfo = earlyEventInfos[idx];\n const eventTypes = this.getEventTypesForBrowserEventType(earlyEventInfo.eventType);\n for (let i = 0; i < eventTypes.length; i++) {\n const eventInfo = cloneEventInfo(earlyEventInfo);\n // EventInfo eventType maps to JSAction's internal event type,\n // rather than the browser event type.\n setEventType(eventInfo, eventTypes[i]);\n this.handleEventInfo(eventInfo);\n }\n }\n // Clean up the early contract.\n const earlyEventHandler = earlyJsactionData.h;\n removeEventListeners(earlyJsactionData.c, earlyJsactionData.et, earlyEventHandler);\n removeEventListeners(earlyJsactionData.c, earlyJsactionData.etc, earlyEventHandler, true);\n delete earlyJsactionContainer._ejsa;\n }\n /**\n * Returns all JSAction event types that have been registered for a given\n * browser event type.\n */\n getEventTypesForBrowserEventType(browserEventType) {\n const eventTypes = [];\n if (this.eventHandlers[browserEventType]) {\n eventTypes.push(browserEventType);\n }\n if (this.browserEventTypeToExtraEventTypes[browserEventType]) {\n eventTypes.push(...this.browserEventTypeToExtraEventTypes[browserEventType]);\n }\n return eventTypes;\n }\n /**\n * Returns the event handler function for a given event type.\n */\n handler(eventType) {\n return this.eventHandlers[eventType];\n }\n /**\n * Cleans up the event contract. This resets all of the `EventContract`'s\n * internal state. Users are responsible for not using this `EventContract`\n * after it has been cleaned up.\n */\n cleanUp() {\n this.containerManager.cleanUp();\n this.containerManager = null;\n this.eventHandlers = {};\n this.browserEventTypeToExtraEventTypes = {};\n this.dispatcher = null;\n this.queuedEventInfos = [];\n }\n /**\n * Register a dispatcher function. Event info of each event mapped to\n * a jsaction is passed for handling to this callback. The queued\n * events are passed as well to the dispatcher for later replaying\n * once the dispatcher is registered. Clears the event queue to null.\n *\n * @param dispatcher The dispatcher function.\n * @param restriction\n */\n registerDispatcher(dispatcher, restriction) {\n this.ecrd(dispatcher, restriction);\n }\n /**\n * Unrenamed alias for registerDispatcher. Necessary for any codebases that\n * split the `EventContract` and `Dispatcher` code into different compilation\n * units.\n */\n ecrd(dispatcher, restriction) {\n this.dispatcher = dispatcher;\n if (this.queuedEventInfos?.length) {\n for (let i = 0; i < this.queuedEventInfos.length; i++) {\n this.handleEventInfo(this.queuedEventInfos[i]);\n }\n this.queuedEventInfos = null;\n }\n }\n /**\n * Adds a11y click support to the given `EventContract`. Meant to be called in\n * the same compilation unit as the `EventContract`.\n */\n addA11yClickSupport() {\n this.addA11yClickSupportImpl(updateEventInfoForA11yClick, preventDefaultForA11yClick, populateClickOnlyAction);\n }\n /**\n * Enables a11y click support to be deferred. Meant to be called in the same\n * compilation unit as the `EventContract`.\n */\n exportAddA11yClickSupport() {\n this.addA11yClickListener = true;\n this.ecaacs = this.addA11yClickSupportImpl.bind(this);\n }\n /**\n * Unrenamed function that loads a11yClickSupport.\n */\n addA11yClickSupportImpl(updateEventInfoForA11yClick, preventDefaultForA11yClick, populateClickOnlyAction) {\n this.addA11yClickListener = true;\n if (this.useActionResolver) {\n this.actionResolver.addA11yClickSupport(updateEventInfoForA11yClick, preventDefaultForA11yClick, populateClickOnlyAction);\n }\n }\n }\n return EventContract;\n})();\nfunction removeEventListeners(container, eventTypes, earlyEventHandler, capture) {\n for (let idx = 0; idx < eventTypes.length; idx++) {\n container.removeEventListener(eventTypes[idx], earlyEventHandler, /* useCapture */capture);\n }\n}\n/**\n * Adds a11y click support to the given `EventContract`. Meant to be called\n * in a different compilation unit from the `EventContract`. The `EventContract`\n * must have called `exportAddA11yClickSupport` in its compilation unit for this\n * to have any effect.\n */\nfunction addDeferredA11yClickSupport(eventContract) {\n eventContract.ecaacs?.(updateEventInfoForA11yClick, preventDefaultForA11yClick, populateClickOnlyAction);\n}\n\n/**\n * EarlyEventContract intercepts events in the bubbling phase at the\n * boundary of the document body. This mapping will be passed to the\n * late-loaded EventContract.\n */\nclass EarlyEventContract {\n constructor(replaySink = window, container = window.document.documentElement) {\n this.replaySink = replaySink;\n this.container = container;\n replaySink._ejsa = {\n c: container,\n q: [],\n et: [],\n etc: [],\n h: event => {\n const eventInfo = createEventInfoFromParameters(event.type, event, event.target, container, Date.now());\n replaySink._ejsa.q.push(eventInfo);\n }\n };\n }\n /**\n * Installs a list of event types for container .\n */\n addEvents(types, capture) {\n const replaySink = this.replaySink._ejsa;\n for (let idx = 0; idx < types.length; idx++) {\n const eventType = types[idx];\n const eventTypes = capture ? replaySink.etc : replaySink.et;\n eventTypes.push(eventType);\n this.container.addEventListener(eventType, replaySink.h, capture);\n }\n }\n}\n\n/**\n * Provides a factory function for bootstrapping an event contract on a\n * specified object (by default, exposed on the `window`).\n * @param field The property on the object that the event contract will be placed on.\n * @param container The container that listens to events\n * @param appId A given identifier for an application. If there are multiple apps on the page\n * then this is how contracts can be initialized for each one.\n * @param eventTypes An array of event names that should be listened to.\n * @param captureEventTypes An array of event names that should be listened to with capture.\n * @param earlyJsactionTracker The object that should receive the event contract.\n */\nfunction bootstrapEarlyEventContract(field, container, appId, eventTypes, captureEventTypes, earlyJsactionTracker = window) {\n if (!earlyJsactionTracker[field]) {\n earlyJsactionTracker[field] = {};\n }\n earlyJsactionTracker[field][appId] = {};\n const eventContract = new EarlyEventContract(earlyJsactionTracker[field][appId], container);\n if (eventTypes) eventContract.addEvents(eventTypes);\n if (captureEventTypes) eventContract.addEvents(captureEventTypes, true);\n}\nexport { EventContract, EventContractContainer, EventDispatcher, EventInfoWrapper, EventPhase, bootstrapEarlyEventContract, isCaptureEvent, isSupportedEvent, registerDispatcher };","map":{"version":3,"names":["JSACTION$1","OI$1","VED","VET","JSINSTANCE","JSTRACK","Attribute","JSACTION","OI","Char","NAMESPACE_ACTION_SEPARATOR","EVENT_ACTION_SEPARATOR","OI_SEPARATOR","CAD_KEY_VALUE_SEPARATOR","CAD_SEPARATOR","EventType","AUXCLICK","CHANGE","CLICK","CLICKMOD","CLICKONLY","DBLCLICK","FOCUS","FOCUSIN","BLUR","FOCUSOUT","SUBMIT","KEYDOWN","KEYPRESS","KEYUP","MOUSEUP","MOUSEDOWN","MOUSEOVER","MOUSEOUT","MOUSEENTER","MOUSELEAVE","MOUSEMOVE","POINTERUP","POINTERDOWN","POINTEROVER","POINTEROUT","POINTERENTER","POINTERLEAVE","POINTERMOVE","POINTERCANCEL","GOTPOINTERCAPTURE","LOSTPOINTERCAPTURE","ERROR","LOAD","UNLOAD","TOUCHSTART","TOUCHEND","TOUCHMOVE","INPUT","SCROLL","TOGGLE","CUSTOM","NON_BUBBLING_MOUSE_EVENTS","isSupportedEvent","eventType","SUPPORTED_EVENTS","includes","isCaptureEvent","CAPTURE_EVENTS","indexOf","OWNER","Property","parseCache","get","element","set","actionMap","getParsed","text","setParsed","parsed","clear","getEventType","eventInfo","setEventType","getEvent","event","setEvent","getTargetElement","targetElement","setTargetElement","getContainer","eic","setContainer","container","getTimestamp","timeStamp","setTimestamp","timestamp","getAction","eia","setAction","actionName","actionElement","unsetAction","undefined","getActionName","actionInfo","getActionElement","getIsReplay","eirp","setIsReplay","replay","getA11yClickKey","eiack","setA11yClickKey","a11yClickKey","getResolved","eir","setResolved","resolved","cloneEventInfo","createEventInfoFromParameters","action","isReplay","createEventInfo","name","EventInfoWrapper","constructor","clone","contains","node","otherNode","nodeType","Boolean","compareDocumentPosition","parentNode","hasAncestorInNodeList","nodeList","idx","length","member","MAC_ENTER","ENTER","SPACE","KeyCode","getBrowserEventType","addEventListener","handler","capture","removeEventListener","info","detachEvent","stopPropagation","e","cancelBubble","preventDefault","returnValue","getTarget","el","target","getAttribute","isMac","navigator","test","userAgent","isMiddleClick","which","button","isModifiedClickEvent","metaKey","ctrlKey","shiftKey","isWebKit","isIe","isGecko","product","isValidActionKeyTarget","isTextControl","isNativelyActivatable","isContentEditable","hasModifierKey","altKey","shouldCallPreventDefaultOnNativeHtmlControl","tagName","toUpperCase","role","isNativeHTMLControl","processSpace","isActionKeyEvent","key","keyCode","ACTION_KEY_TO_KEYCODE","type","isFocusable","isSpecificTriggerKey","IDENTIFIER_TO_KEY_TRIGGER_MAPPING","isDefaultTriggerKey","hasType","NATIVELY_FOCUSABLE_ELEMENTS","hasSpecifiedTabIndex","disabled","attrNode","getAttributeNode","specified","isSpaceKeyEvent","elementName","isMouseSpecialEvent","related","relatedTarget","createMouseSpecialEvent","copy","property","value","getTouchData","touch","changedTouches","touches","clientX","clientY","screenX","screenY","recreateTouchEventAsClick","click","Date","now","syntheticPreventDefault","syntheticStopPropagation","defaultPrevented","_propagationStopped","PROCESS_SPACE","TEXT_CONTROLS","NATIVE_HTML_CONTROLS","testing","setIsMac","EMPTY_ACTION_MAP","REGEXP_SEMICOLON","DEFAULT_EVENT_TYPE","ActionResolver","syntheticMouseEventSupport","a11yClickSupport","updateEventInfoForA11yClick","preventDefaultForA11yClick","populateClickOnlyAction","resolveEventType","resolveAction","populateAction","resolveParentAction","getParentNode","currentTarget","Node","ELEMENT_NODE","populateActionOnElement","copiedEvent","owner","nodeName","host","parseActions","jsactionAttribute","values","split","colon","hasColon","substr","trim","addA11yClickSupport","Restriction","Dispatcher","dispatchDelegate","actionResolver","eventReplayer","eventReplayScheduled","replayEventInfoWrappers","dispatch","eventInfoWrapper","shouldPreventDefaultBeforeDispatching","scheduleEventInfoWrapperReplay","push","Promise","resolve","then","createEventReplayer","eventInfoWrappers","registerDispatcher$1","eventContract","dispatcher","ecrd","I_AM_THE_JSACTION_FRAMEWORK","PROPAGATION_STOPPED_SYMBOL","Symbol","for","EventPhase","REPLAY","PREVENT_DEFAULT_ERROR_MESSAGE_DETAILS","PREVENT_DEFAULT_ERROR_MESSAGE","COMPOSED_PATH_ERROR_MESSAGE_DETAILS","ngDevMode","COMPOSED_PATH_ERROR_MESSAGE","EventDispatcher","dispatchToDelegate","prepareEventForReplay","prepareEventForBubbling","prepareEventForDispatch","propagationStopped","patchEventInstance","Error","configurable","Object","defineProperty","registerDispatcher","isIos","EventContractContainer","handlerInfos","getHandler","style","cursor","cleanUp","i","A11Y_CLICK_SUPPORT","MOUSE_SPECIAL_SUPPORT","EventContract","containerManager","useActionResolver","eventHandlers","browserEventTypeToExtraEventTypes","queuedEventInfos","addA11yClickListener","handleEvent","handleEventInfo","addEvent","prefixedEventType","eventHandler","browserEventType","eventTypes","replayEarlyEvents","earlyJsactionContainer","window","earlyJsactionData","_ejsa","earlyEventInfos","q","earlyEventInfo","getEventTypesForBrowserEventType","earlyEventHandler","h","removeEventListeners","c","et","etc","restriction","addA11yClickSupportImpl","exportAddA11yClickSupport","ecaacs","bind","addDeferredA11yClickSupport","EarlyEventContract","replaySink","document","documentElement","addEvents","types","bootstrapEarlyEventContract","field","appId","captureEventTypes","earlyJsactionTracker"],"sources":["D:/Jess/agent/Kinetix/node_modules/@angular/core/fesm2022/primitives/event-dispatch.mjs"],"sourcesContent":["/**\n * @license Angular v18.0.1\n * (c) 2010-2024 Google LLC. https://angular.io/\n * License: MIT\n */\n\n/**\n * The jsaction attribute defines a mapping of a DOM event to a\n * generic event (aka jsaction), to which the actual event handlers\n * that implement the behavior of the application are bound. The\n * value is a semicolon separated list of colon separated pairs of\n * an optional DOM event name and a jsaction name. If the optional\n * DOM event name is omitted, 'click' is assumed. The jsaction names\n * are dot separated pairs of a namespace and a simple jsaction\n * name.\n *\n * See grammar in README.md for expected syntax in the attribute value.\n */\nconst JSACTION$1 = 'jsaction';\n/**\n * The oi attribute is a log impression tag for impression logging\n * and action tracking. For an element that carries a jsaction\n * attribute, the element is identified for the purpose of\n * impression logging and click tracking by the dot separated path\n * of all oi attributes in the chain of ancestors of the element.\n *\n * Used by ActionFlow.\n */\nconst OI$1 = 'oi';\n/**\n * The ved attribute is an encoded ClickTrackingCGI proto to track\n * visual elements.\n *\n * Used by ActionFlow.\n */\nconst VED = 'ved';\n/**\n * The vet attribute is the visual element type used to identify tracked\n * visual elements.\n */\nconst VET = 'vet';\n/**\n * Support for iteration on reprocessing.\n *\n * Used by ActionFlow.\n */\nconst JSINSTANCE = 'jsinstance';\n/**\n * All click jsactions that happen on the element that carries this\n * attribute or its descendants are automatically logged.\n * Impressions of jsactions on these elements are tracked too, if\n * requested by the impression() method of ActionFlow.\n *\n * Used by ActionFlow.\n */\nconst JSTRACK = 'jstrack';\nconst Attribute = { JSACTION: JSACTION$1, OI: OI$1, VED, VET, JSINSTANCE, JSTRACK };\n\nconst Char = {\n /**\n * The separator between the namespace and the action name in the\n * jsaction attribute value.\n */\n NAMESPACE_ACTION_SEPARATOR: '.',\n /**\n * The separator between the event name and action in the jsaction\n * attribute value.\n */\n EVENT_ACTION_SEPARATOR: ':',\n /**\n * The separator between the logged oi attribute values in the &oi=\n * URL parameter value.\n */\n OI_SEPARATOR: '.',\n /**\n * The separator between the key and the value pairs in the &cad=\n * URL parameter value.\n */\n CAD_KEY_VALUE_SEPARATOR: ':',\n /**\n * The separator between the key-value pairs in the &cad= URL\n * parameter value.\n */\n CAD_SEPARATOR: ',',\n};\n\n/*\n * Names of events that are special to jsaction. These are not all\n * event types that are legal to use in either HTML or the addEvent()\n * API, but these are the ones that are treated specially. All other\n * DOM events can be used in either addEvent() or in the value of the\n * jsaction attribute. Beware of browser specific events or events\n * that don't bubble though: If they are not mentioned here, then\n * event contract doesn't work around their peculiarities.\n */\nconst EventType = {\n /**\n * Mouse middle click, introduced in Chrome 55 and not yet supported on\n * other browsers.\n */\n AUXCLICK: 'auxclick',\n /**\n * The change event fired by browsers when the `value` attribute of input,\n * select, and textarea elements are changed.\n */\n CHANGE: 'change',\n /**\n * The click event. In addEvent() refers to all click events, in the\n * jsaction attribute it refers to the unmodified click and Enter/Space\n * keypress events. In the latter case, a jsaction click will be triggered,\n * for accessibility reasons. See clickmod and clickonly, below.\n */\n CLICK: 'click',\n /**\n * Specifies the jsaction for a modified click event (i.e. a mouse\n * click with the modifier key Cmd/Ctrl pressed). This event isn't\n * separately enabled in addEvent(), because in the DOM, it's just a\n * click event.\n */\n CLICKMOD: 'clickmod',\n /**\n * Specifies the jsaction for a click-only event. Click-only doesn't take\n * into account the case where an element with focus receives an Enter/Space\n * keypress. This event isn't separately enabled in addEvent().\n */\n CLICKONLY: 'clickonly',\n /**\n * The dblclick event.\n */\n DBLCLICK: 'dblclick',\n /**\n * Focus doesn't bubble, but you can use it in addEvent() and\n * jsaction anyway. EventContract does the right thing under the\n * hood.\n */\n FOCUS: 'focus',\n /**\n * This event only exists in IE. For addEvent() and jsaction, use\n * focus instead; EventContract does the right thing even though\n * focus doesn't bubble.\n */\n FOCUSIN: 'focusin',\n /**\n * Analog to focus.\n */\n BLUR: 'blur',\n /**\n * Analog to focusin.\n */\n FOCUSOUT: 'focusout',\n /**\n * Submit doesn't bubble, so it cannot be used with event\n * contract. However, the browser helpfully fires a click event on\n * the submit button of a form (even if the form is not submitted by\n * a click on the submit button). So you should handle click on the\n * submit button instead.\n */\n SUBMIT: 'submit',\n /**\n * The keydown event. In addEvent() and non-click jsaction it represents the\n * regular DOM keydown event. It represents click actions in non-Gecko\n * browsers.\n */\n KEYDOWN: 'keydown',\n /**\n * The keypress event. In addEvent() and non-click jsaction it represents the\n * regular DOM keypress event. It represents click actions in Gecko browsers.\n */\n KEYPRESS: 'keypress',\n /**\n * The keyup event. In addEvent() and non-click jsaction it represents the\n * regular DOM keyup event. It represents click actions in non-Gecko\n * browsers.\n */\n KEYUP: 'keyup',\n /**\n * The mouseup event. Can either be used directly or used implicitly to\n * capture mouseup events. In addEvent(), it represents a regular DOM\n * mouseup event.\n */\n MOUSEUP: 'mouseup',\n /**\n * The mousedown event. Can either be used directly or used implicitly to\n * capture mouseenter events. In addEvent(), it represents a regular DOM\n * mouseover event.\n */\n MOUSEDOWN: 'mousedown',\n /**\n * The mouseover event. Can either be used directly or used implicitly to\n * capture mouseenter events. In addEvent(), it represents a regular DOM\n * mouseover event.\n */\n MOUSEOVER: 'mouseover',\n /**\n * The mouseout event. Can either be used directly or used implicitly to\n * capture mouseover events. In addEvent(), it represents a regular DOM\n * mouseout event.\n */\n MOUSEOUT: 'mouseout',\n /**\n * The mouseenter event. Does not bubble and fires individually on each\n * element being entered within a DOM tree.\n */\n MOUSEENTER: 'mouseenter',\n /**\n * The mouseleave event. Does not bubble and fires individually on each\n * element being entered within a DOM tree.\n */\n MOUSELEAVE: 'mouseleave',\n /**\n * The mousemove event.\n */\n MOUSEMOVE: 'mousemove',\n /**\n * The pointerup event. Can either be used directly or used implicitly to\n * capture pointerup events. In addEvent(), it represents a regular DOM\n * pointerup event.\n */\n POINTERUP: 'pointerup',\n /**\n * The pointerdown event. Can either be used directly or used implicitly to\n * capture pointerenter events. In addEvent(), it represents a regular DOM\n * mouseover event.\n */\n POINTERDOWN: 'pointerdown',\n /**\n * The pointerover event. Can either be used directly or used implicitly to\n * capture pointerenter events. In addEvent(), it represents a regular DOM\n * pointerover event.\n */\n POINTEROVER: 'pointerover',\n /**\n * The pointerout event. Can either be used directly or used implicitly to\n * capture pointerover events. In addEvent(), it represents a regular DOM\n * pointerout event.\n */\n POINTEROUT: 'pointerout',\n /**\n * The pointerenter event. Does not bubble and fires individually on each\n * element being entered within a DOM tree.\n */\n POINTERENTER: 'pointerenter',\n /**\n * The pointerleave event. Does not bubble and fires individually on each\n * element being entered within a DOM tree.\n */\n POINTERLEAVE: 'pointerleave',\n /**\n * The pointermove event.\n */\n POINTERMOVE: 'pointermove',\n /**\n * The pointercancel event.\n */\n POINTERCANCEL: 'pointercancel',\n /**\n * The gotpointercapture event is fired when\n * Element.setPointerCapture(pointerId) is called on a mouse input, or\n * implicitly when a touch input begins.\n */\n GOTPOINTERCAPTURE: 'gotpointercapture',\n /**\n * The lostpointercapture event is fired when\n * Element.releasePointerCapture(pointerId) is called, or implicitly after a\n * touch input ends.\n */\n LOSTPOINTERCAPTURE: 'lostpointercapture',\n /**\n * The error event. The error event doesn't bubble, but you can use it in\n * addEvent() and jsaction anyway. EventContract does the right thing under\n * the hood (except in IE8 which does not use error events).\n */\n ERROR: 'error',\n /**\n * The load event. The load event doesn't bubble, but you can use it in\n * addEvent() and jsaction anyway. EventContract does the right thing\n * under the hood.\n */\n LOAD: 'load',\n /**\n * The unload event.\n */\n UNLOAD: 'unload',\n /**\n * The touchstart event. Bubbles, will only ever fire in browsers with\n * touch support.\n */\n TOUCHSTART: 'touchstart',\n /**\n * The touchend event. Bubbles, will only ever fire in browsers with\n * touch support.\n */\n TOUCHEND: 'touchend',\n /**\n * The touchmove event. Bubbles, will only ever fire in browsers with\n * touch support.\n */\n TOUCHMOVE: 'touchmove',\n /**\n * The input event.\n */\n INPUT: 'input',\n /**\n * The scroll event.\n */\n SCROLL: 'scroll',\n /**\n * The toggle event. The toggle event doesn't bubble, but you can use it in\n * addEvent() and jsaction anyway. EventContract does the right thing\n * under the hood.\n */\n TOGGLE: 'toggle',\n /**\n * A custom event. The actual custom event type is declared as the 'type'\n * field in the event details. Supported in Firefox 6+, IE 9+, and all Chrome\n * versions.\n *\n * This is an internal name. Users should use jsaction's fireCustomEvent to\n * fire custom events instead of relying on this type to create them.\n */\n CUSTOM: '_custom',\n};\nconst NON_BUBBLING_MOUSE_EVENTS = [\n EventType.MOUSEENTER,\n EventType.MOUSELEAVE,\n 'pointerenter',\n 'pointerleave',\n];\n/**\n * Detects whether a given event type is supported by JSAction.\n */\nconst isSupportedEvent = (eventType) => SUPPORTED_EVENTS.includes(eventType);\nconst SUPPORTED_EVENTS = [\n EventType.CLICK,\n EventType.DBLCLICK,\n EventType.FOCUS,\n EventType.FOCUSIN,\n EventType.BLUR,\n EventType.ERROR,\n EventType.FOCUSOUT,\n EventType.KEYDOWN,\n EventType.KEYUP,\n EventType.KEYPRESS,\n EventType.LOAD,\n EventType.MOUSEOVER,\n EventType.MOUSEOUT,\n EventType.SUBMIT,\n EventType.TOGGLE,\n EventType.TOUCHSTART,\n EventType.TOUCHEND,\n EventType.TOUCHMOVE,\n 'touchcancel',\n 'auxclick',\n 'change',\n 'compositionstart',\n 'compositionupdate',\n 'compositionend',\n 'beforeinput',\n 'input',\n 'select',\n 'copy',\n 'cut',\n 'paste',\n 'mousedown',\n 'mouseup',\n 'wheel',\n 'contextmenu',\n 'dragover',\n 'dragenter',\n 'dragleave',\n 'drop',\n 'dragstart',\n 'dragend',\n 'pointerdown',\n 'pointermove',\n 'pointerup',\n 'pointercancel',\n 'pointerover',\n 'pointerout',\n 'gotpointercapture',\n 'lostpointercapture',\n // Video events.\n 'ended',\n 'loadedmetadata',\n // Page visibility events.\n 'pagehide',\n 'pageshow',\n 'visibilitychange',\n // Content visibility events.\n 'beforematch',\n];\n/**\n *\n * Decides whether or not an event type is an event that only has a capture phase.\n *\n * @param eventType\n * @returns bool\n */\nconst isCaptureEvent = (eventType) => CAPTURE_EVENTS.indexOf(eventType) >= 0;\nconst CAPTURE_EVENTS = [\n EventType.FOCUS,\n EventType.BLUR,\n EventType.ERROR,\n EventType.LOAD,\n EventType.TOGGLE,\n];\n\n/**\n * The parsed value of the jsaction attribute is stored in this\n * property on the DOM node. The parsed value is an Object. The\n * property names of the object are the events; the values are the\n * names of the actions. This property is attached even on nodes\n * that don't have a jsaction attribute as an optimization, because\n * property lookup is faster than attribute access.\n */\nconst JSACTION = '__jsaction';\n/** The value of the oi attribute as a property, for faster access. */\nconst OI = '__oi';\n/**\n * The owner property references an a logical owner for a DOM node. JSAction\n * will follow this reference instead of parentNode when traversing the DOM\n * to find jsaction attributes. This allows overlaying a logical structure\n * over a document where the DOM structure can't reflect that structure.\n */\nconst OWNER = '__owner';\n/** All properties that are used by jsaction. */\nconst Property = {\n JSACTION,\n OI,\n OWNER,\n};\n\n/**\n * Map from jsaction annotation to a parsed map from event name to action name.\n */\nconst parseCache = {};\n/**\n * Reads the jsaction parser cache from the given DOM Element.\n *\n * @param element .\n * @return Map from event to qualified name of the jsaction bound to it.\n */\nfunction get(element) {\n // @ts-ignore\n return element[JSACTION];\n}\n/**\n * Writes the jsaction parser cache to the given DOM Element.\n *\n * @param element .\n * @param actionMap Map from event to qualified name of the jsaction bound to\n * it.\n */\nfunction set(element, actionMap) {\n // @ts-ignore\n element[JSACTION] = actionMap;\n}\n/**\n * Looks up the parsed action map from the source jsaction attribute value.\n *\n * @param text Unparsed jsaction attribute value.\n * @return Parsed jsaction attribute value, if already present in the cache.\n */\nfunction getParsed(text) {\n return parseCache[text];\n}\n/**\n * Inserts the parse result for the given source jsaction value into the cache.\n *\n * @param text Unparsed jsaction attribute value.\n * @param parsed Attribute value parsed into the action map.\n */\nfunction setParsed(text, parsed) {\n parseCache[text] = parsed;\n}\n/**\n * Clears the jsaction parser cache from the given DOM Element.\n *\n * @param element .\n */\nfunction clear(element) {\n if (JSACTION in element) {\n delete element[JSACTION];\n }\n}\n\n/** Added for readability when accessing stable property names. */\nfunction getEventType(eventInfo) {\n return eventInfo.eventType;\n}\n/** Added for readability when accessing stable property names. */\nfunction setEventType(eventInfo, eventType) {\n eventInfo.eventType = eventType;\n}\n/** Added for readability when accessing stable property names. */\nfunction getEvent(eventInfo) {\n return eventInfo.event;\n}\n/** Added for readability when accessing stable property names. */\nfunction setEvent(eventInfo, event) {\n eventInfo.event = event;\n}\n/** Added for readability when accessing stable property names. */\nfunction getTargetElement(eventInfo) {\n return eventInfo.targetElement;\n}\n/** Added for readability when accessing stable property names. */\nfunction setTargetElement(eventInfo, targetElement) {\n eventInfo.targetElement = targetElement;\n}\n/** Added for readability when accessing stable property names. */\nfunction getContainer(eventInfo) {\n return eventInfo.eic;\n}\n/** Added for readability when accessing stable property names. */\nfunction setContainer(eventInfo, container) {\n eventInfo.eic = container;\n}\n/** Added for readability when accessing stable property names. */\nfunction getTimestamp(eventInfo) {\n return eventInfo.timeStamp;\n}\n/** Added for readability when accessing stable property names. */\nfunction setTimestamp(eventInfo, timestamp) {\n eventInfo.timeStamp = timestamp;\n}\n/** Added for readability when accessing stable property names. */\nfunction getAction(eventInfo) {\n return eventInfo.eia;\n}\n/** Added for readability when accessing stable property names. */\nfunction setAction(eventInfo, actionName, actionElement) {\n eventInfo.eia = [actionName, actionElement];\n}\n/** Added for readability when accessing stable property names. */\nfunction unsetAction(eventInfo) {\n eventInfo.eia = undefined;\n}\n/** Added for readability when accessing stable property names. */\nfunction getActionName(actionInfo) {\n return actionInfo[0];\n}\n/** Added for readability when accessing stable property names. */\nfunction getActionElement(actionInfo) {\n return actionInfo[1];\n}\n/** Added for readability when accessing stable property names. */\nfunction getIsReplay(eventInfo) {\n return eventInfo.eirp;\n}\n/** Added for readability when accessing stable property names. */\nfunction setIsReplay(eventInfo, replay) {\n eventInfo.eirp = replay;\n}\n/** Added for readability when accessing stable property names. */\nfunction getA11yClickKey(eventInfo) {\n return eventInfo.eiack;\n}\n/** Added for readability when accessing stable property names. */\nfunction setA11yClickKey(eventInfo, a11yClickKey) {\n eventInfo.eiack = a11yClickKey;\n}\n/** Added for readability when accessing stable property names. */\nfunction getResolved(eventInfo) {\n return eventInfo.eir;\n}\n/** Added for readability when accessing stable property names. */\nfunction setResolved(eventInfo, resolved) {\n eventInfo.eir = resolved;\n}\n/** Clones an `EventInfo` */\nfunction cloneEventInfo(eventInfo) {\n return {\n eventType: eventInfo.eventType,\n event: eventInfo.event,\n targetElement: eventInfo.targetElement,\n eic: eventInfo.eic,\n eia: eventInfo.eia,\n timeStamp: eventInfo.timeStamp,\n eirp: eventInfo.eirp,\n eiack: eventInfo.eiack,\n eir: eventInfo.eir,\n };\n}\n/**\n * Utility function for creating an `EventInfo`.\n *\n * This can be used from code-size sensitive compilation units, as taking\n * parameters vs. an `Object` literal reduces code size.\n */\nfunction createEventInfoFromParameters(eventType, event, targetElement, container, timestamp, action, isReplay, a11yClickKey) {\n return {\n eventType,\n event,\n targetElement,\n eic: container,\n timeStamp: timestamp,\n eia: action,\n eirp: isReplay,\n eiack: a11yClickKey,\n };\n}\n/**\n * Utility function for creating an `EventInfo`.\n *\n * This should be used in compilation units that are less sensitive to code\n * size.\n */\nfunction createEventInfo({ eventType, event, targetElement, container, timestamp, action, isReplay, a11yClickKey, }) {\n return {\n eventType,\n event,\n targetElement,\n eic: container,\n timeStamp: timestamp,\n eia: action ? [action.name, action.element] : undefined,\n eirp: isReplay,\n eiack: a11yClickKey,\n };\n}\n/**\n * Utility class around an `EventInfo`.\n *\n * This should be used in compilation units that are less sensitive to code\n * size.\n */\nclass EventInfoWrapper {\n constructor(eventInfo) {\n this.eventInfo = eventInfo;\n }\n getEventType() {\n return getEventType(this.eventInfo);\n }\n setEventType(eventType) {\n setEventType(this.eventInfo, eventType);\n }\n getEvent() {\n return getEvent(this.eventInfo);\n }\n setEvent(event) {\n setEvent(this.eventInfo, event);\n }\n getTargetElement() {\n return getTargetElement(this.eventInfo);\n }\n setTargetElement(targetElement) {\n setTargetElement(this.eventInfo, targetElement);\n }\n getContainer() {\n return getContainer(this.eventInfo);\n }\n setContainer(container) {\n setContainer(this.eventInfo, container);\n }\n getTimestamp() {\n return getTimestamp(this.eventInfo);\n }\n setTimestamp(timestamp) {\n setTimestamp(this.eventInfo, timestamp);\n }\n getAction() {\n const action = getAction(this.eventInfo);\n if (!action)\n return undefined;\n return {\n name: action[0],\n element: action[1],\n };\n }\n setAction(action) {\n if (!action) {\n unsetAction(this.eventInfo);\n return;\n }\n setAction(this.eventInfo, action.name, action.element);\n }\n getIsReplay() {\n return getIsReplay(this.eventInfo);\n }\n setIsReplay(replay) {\n setIsReplay(this.eventInfo, replay);\n }\n getResolved() {\n return getResolved(this.eventInfo);\n }\n setResolved(resolved) {\n setResolved(this.eventInfo, resolved);\n }\n clone() {\n return new EventInfoWrapper(cloneEventInfo(this.eventInfo));\n }\n}\n\n/**\n * Determines if one node is contained within another. Adapted from\n * {@see goog.dom.contains}.\n * @param node Node that should contain otherNode.\n * @param otherNode Node being contained.\n * @return True if otherNode is contained within node.\n */\nfunction contains(node, otherNode) {\n if (otherNode === null) {\n return false;\n }\n // We use browser specific methods for this if available since it is faster\n // that way.\n // IE DOM\n if ('contains' in node && otherNode.nodeType === 1) {\n return node.contains(otherNode);\n }\n // W3C DOM Level 3\n if ('compareDocumentPosition' in node) {\n return node === otherNode || Boolean(node.compareDocumentPosition(otherNode) & 16);\n }\n // W3C DOM Level 1\n while (otherNode && node !== otherNode) {\n otherNode = otherNode.parentNode;\n }\n return otherNode === node;\n}\n/**\n * Helper method for broadcastCustomEvent. Returns true if any member of\n * the set is an ancestor of element.\n */\nfunction hasAncestorInNodeList(element, nodeList) {\n for (let idx = 0; idx < nodeList.length; ++idx) {\n const member = nodeList[idx];\n if (member !== element && contains(member, element)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * If on a Macintosh with an extended keyboard, the Enter key located in the\n * numeric pad has a different ASCII code.\n */\nconst MAC_ENTER = 3;\n/** The Enter key. */\nconst ENTER = 13;\n/** The Space key. */\nconst SPACE = 32;\n/** Special keycodes used by jsaction for the generic click action. */\nconst KeyCode = { MAC_ENTER, ENTER, SPACE };\n\n/**\n * Gets a browser event type, if it would differ from the JSAction event type.\n */\nfunction getBrowserEventType(eventType) {\n // Mouseenter and mouseleave events are not handled directly because they\n // are not available everywhere. In browsers where they are available, they\n // don't bubble and aren't visible at the container boundary. Instead, we\n // synthesize the mouseenter and mouseleave events from mouseover and\n // mouseout events, respectively. Cf. eventcontract.js.\n if (eventType === EventType.MOUSEENTER) {\n return EventType.MOUSEOVER;\n }\n else if (eventType === EventType.MOUSELEAVE) {\n return EventType.MOUSEOUT;\n }\n else if (eventType === EventType.POINTERENTER) {\n return EventType.POINTEROVER;\n }\n else if (eventType === EventType.POINTERLEAVE) {\n return EventType.POINTEROUT;\n }\n return eventType;\n}\n/**\n * Registers the event handler function with the given DOM element for\n * the given event type.\n *\n * @param element The element.\n * @param eventType The event type.\n * @param handler The handler function to install.\n * @return Information needed to uninstall the event handler eventually.\n */\nfunction addEventListener(element, eventType, handler) {\n // All event handlers are registered in the bubbling\n // phase.\n //\n // All browsers support focus and blur, but these events only are propagated\n // in the capture phase. Very legacy browsers do not support focusin or\n // focusout.\n //\n // It would be a bad idea to register all event handlers in the\n // capture phase because then regular onclick handlers would not be\n // executed at all on events that trigger a jsaction. That's not\n // entirely what we want, at least for now.\n //\n // Error and load events (i.e. on images) do not bubble so they are also\n // handled in the capture phase.\n let capture = false;\n if (isCaptureEvent(eventType)) {\n capture = true;\n }\n element.addEventListener(eventType, handler, capture);\n return { eventType, handler, capture };\n}\n/**\n * Removes the event handler for the given event from the element.\n * the given event type.\n *\n * @param element The element.\n * @param info The information needed to deregister the handler, as returned by\n * addEventListener(), above.\n */\nfunction removeEventListener(element, info) {\n if (element.removeEventListener) {\n element.removeEventListener(info.eventType, info.handler, info.capture);\n // `detachEvent` is an old DOM API.\n // tslint:disable-next-line:no-any\n }\n else if (element.detachEvent) {\n // `detachEvent` is an old DOM API.\n // tslint:disable-next-line:no-any\n element.detachEvent(`on${info.eventType}`, info.handler);\n }\n}\n/**\n * Cancels propagation of an event.\n * @param e The event to cancel propagation for.\n */\nfunction stopPropagation(e) {\n e.stopPropagation ? e.stopPropagation() : (e.cancelBubble = true);\n}\n/**\n * Prevents the default action of an event.\n * @param e The event to prevent the default action for.\n */\nfunction preventDefault(e) {\n e.preventDefault ? e.preventDefault() : (e.returnValue = false);\n}\n/**\n * Gets the target Element of the event. In Firefox, a text node may appear as\n * the target of the event, in which case we return the parent element of the\n * text node.\n * @param e The event to get the target of.\n * @return The target element.\n */\nfunction getTarget(e) {\n let el = e.target;\n // In Firefox, the event may have a text node as its target. We always\n // want the parent Element the text node belongs to, however.\n if (!el.getAttribute && el.parentNode) {\n el = el.parentNode;\n }\n return el;\n}\n/**\n * Whether we are on a Mac. Not pulling in useragent just for this.\n */\nlet isMac = typeof navigator !== 'undefined' && /Macintosh/.test(navigator.userAgent);\n/**\n * Determines and returns whether the given event (which is assumed to be a\n * click event) is a middle click.\n * NOTE: There is not a consistent way to identify middle click\n * http://www.unixpapa.com/js/mouse.html\n */\nfunction isMiddleClick(e) {\n return (\n // `which` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.which === 2 ||\n // `which` is an old DOM API.\n // tslint:disable-next-line:no-any\n (e.which == null &&\n // `button` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.button === 4) // middle click for IE\n );\n}\n/**\n * Determines and returns whether the given event (which is assumed\n * to be a click event) is modified. A middle click is considered a modified\n * click to retain the default browser action, which opens a link in a new tab.\n * @param e The event.\n * @return Whether the given event is modified.\n */\nfunction isModifiedClickEvent(e) {\n return (\n // `metaKey` is an old DOM API.\n // tslint:disable-next-line:no-any\n (isMac && e.metaKey) ||\n // `ctrlKey` is an old DOM API.\n // tslint:disable-next-line:no-any\n (!isMac && e.ctrlKey) ||\n isMiddleClick(e) ||\n // `shiftKey` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.shiftKey);\n}\n/** Whether we are on WebKit (e.g., Chrome). */\nconst isWebKit = typeof navigator !== 'undefined' &&\n !/Opera/.test(navigator.userAgent) &&\n /WebKit/.test(navigator.userAgent);\n/** Whether we are on IE. */\nconst isIe = typeof navigator !== 'undefined' &&\n (/MSIE/.test(navigator.userAgent) || /Trident/.test(navigator.userAgent));\n/** Whether we are on Gecko (e.g., Firefox). */\nconst isGecko = typeof navigator !== 'undefined' &&\n !/Opera|WebKit/.test(navigator.userAgent) &&\n /Gecko/.test(navigator.product);\n/**\n * Determines and returns whether the given element is a valid target for\n * keypress/keydown DOM events that act like regular DOM clicks.\n * @param el The element.\n * @return Whether the given element is a valid action key target.\n */\nfunction isValidActionKeyTarget(el) {\n if (!('getAttribute' in el)) {\n return false;\n }\n if (isTextControl(el)) {\n return false;\n }\n if (isNativelyActivatable(el)) {\n return false;\n }\n // `isContentEditable` is an old DOM API.\n // tslint:disable-next-line:no-any\n if (el.isContentEditable) {\n return false;\n }\n return true;\n}\n/**\n * Whether an event has a modifier key activated.\n * @param e The event.\n * @return True, if a modifier key is activated.\n */\nfunction hasModifierKey(e) {\n return (\n // `ctrlKey` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.ctrlKey ||\n // `shiftKey` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.shiftKey ||\n // `altKey` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.altKey ||\n // `metaKey` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.metaKey);\n}\n/**\n * Determines and returns whether the given event has a target that already\n * has event handlers attached because it is a native HTML control. Used to\n * determine if preventDefault should be called when isActionKeyEvent is true.\n * @param e The event.\n * @return If preventDefault should be called.\n */\nfunction shouldCallPreventDefaultOnNativeHtmlControl(e) {\n const el = getTarget(e);\n const tagName = el.tagName.toUpperCase();\n const role = (el.getAttribute('role') || '').toUpperCase();\n if (tagName === 'BUTTON' || role === 'BUTTON') {\n return true;\n }\n if (!isNativeHTMLControl(el)) {\n return false;\n }\n if (tagName === 'A') {\n return false;\n }\n /**\n * Fix for physical d-pads on feature phone platforms; the native event\n * (ie. isTrusted: true) needs to fire to show the OPTION list. See\n * b/135288469 for more info.\n */\n if (tagName === 'SELECT') {\n return false;\n }\n if (processSpace(el)) {\n return false;\n }\n if (isTextControl(el)) {\n return false;\n }\n return true;\n}\n/**\n * Determines and returns whether the given event acts like a regular DOM click,\n * and should be handled instead of the click. If this returns true, the caller\n * will call preventDefault() to prevent a possible duplicate event.\n * This is represented by a keypress (keydown on Gecko browsers) on Enter or\n * Space key.\n * @param e The event.\n * @return True, if the event emulates a DOM click.\n */\nfunction isActionKeyEvent(e) {\n let key = \n // `which` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.which ||\n // `keyCode` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.keyCode;\n if (!key && e.key) {\n key = ACTION_KEY_TO_KEYCODE[e.key];\n }\n if (isWebKit && key === KeyCode.MAC_ENTER) {\n key = KeyCode.ENTER;\n }\n if (key !== KeyCode.ENTER && key !== KeyCode.SPACE) {\n return false;\n }\n const el = getTarget(e);\n if (e.type !== EventType.KEYDOWN || !isValidActionKeyTarget(el) || hasModifierKey(e)) {\n return false;\n }\n // For , we must only handle the browser's native click\n // event, so that the browser can toggle the checkbox.\n if (processSpace(el) && key === KeyCode.SPACE) {\n return false;\n }\n // If this element is non-focusable, ignore stray keystrokes (b/18337209)\n // Sscreen readers can move without tab focus, so any tabIndex is focusable.\n // See B/21809604\n if (!isFocusable(el)) {\n return false;\n }\n const type = (el.getAttribute('role') ||\n el.type ||\n el.tagName).toUpperCase();\n const isSpecificTriggerKey = IDENTIFIER_TO_KEY_TRIGGER_MAPPING[type] % key === 0;\n const isDefaultTriggerKey = !(type in IDENTIFIER_TO_KEY_TRIGGER_MAPPING) && key === KeyCode.ENTER;\n const hasType = el.tagName.toUpperCase() !== 'INPUT' || !!el.type;\n return (isSpecificTriggerKey || isDefaultTriggerKey) && hasType;\n}\n/**\n * Checks whether a DOM element can receive keyboard focus.\n * This code is based on goog.dom.isFocusable, but simplified since we shouldn't\n * care about visibility if we're already handling a keyboard event.\n */\nfunction isFocusable(el) {\n return ((el.tagName in NATIVELY_FOCUSABLE_ELEMENTS || hasSpecifiedTabIndex(el)) &&\n !el.disabled);\n}\n/**\n * @param element Element to check.\n * @return Whether the element has a specified tab index.\n */\nfunction hasSpecifiedTabIndex(element) {\n // IE returns 0 for an unset tabIndex, so we must use getAttributeNode(),\n // which returns an object with a 'specified' property if tabIndex is\n // specified. This works on other browsers, too.\n const attrNode = element.getAttributeNode('tabindex'); // Must be lowercase!\n return attrNode != null && attrNode.specified;\n}\n/** Element tagnames that are focusable by default. */\nconst NATIVELY_FOCUSABLE_ELEMENTS = {\n 'A': 1,\n 'INPUT': 1,\n 'TEXTAREA': 1,\n 'SELECT': 1,\n 'BUTTON': 1,\n};\n/** @return True, if the Space key was pressed. */\nfunction isSpaceKeyEvent(e) {\n const key = \n // `which` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.which ||\n // `keyCode` is an old DOM API.\n // tslint:disable-next-line:no-any\n e.keyCode;\n const el = getTarget(e);\n const elementName = (el.type || el.tagName).toUpperCase();\n return key === KeyCode.SPACE && elementName !== 'CHECKBOX';\n}\n/**\n * Determines whether the event corresponds to a non-bubbling mouse\n * event type (mouseenter, mouseleave, pointerenter, and pointerleave).\n *\n * During mouseover (mouseenter) and pointerover (pointerenter), the\n * relatedTarget is the element being entered from. During mouseout (mouseleave)\n * and pointerout (pointerleave), the relatedTarget is the element being exited\n * to.\n *\n * In both cases, if relatedTarget is outside target, then the corresponding\n * special event has occurred, otherwise it hasn't.\n *\n * @param e The mouseover/mouseout event.\n * @param type The type of the mouse special event.\n * @param element The element on which the jsaction for the\n * mouseenter/mouseleave event is defined.\n * @return True if the event is a mouseenter/mouseleave event.\n */\nfunction isMouseSpecialEvent(e, type, element) {\n // `relatedTarget` is an old DOM API.\n // tslint:disable-next-line:no-any\n const related = e.relatedTarget;\n return (((e.type === EventType.MOUSEOVER && type === EventType.MOUSEENTER) ||\n (e.type === EventType.MOUSEOUT && type === EventType.MOUSELEAVE) ||\n (e.type === EventType.POINTEROVER && type === EventType.POINTERENTER) ||\n (e.type === EventType.POINTEROUT && type === EventType.POINTERLEAVE)) &&\n (!related || (related !== element && !contains(element, related))));\n}\n/**\n * Creates a new EventLike object for a mouseenter/mouseleave event that's\n * derived from the original corresponding mouseover/mouseout event.\n * @param e The event.\n * @param target The element on which the jsaction for the mouseenter/mouseleave\n * event is defined.\n * @return A modified event-like object copied from the event object passed into\n * this function.\n */\nfunction createMouseSpecialEvent(e, target) {\n // We have to create a copy of the event object because we need to mutate\n // its fields. We do this for the special mouse events because the event\n // target needs to be retargeted to the action element rather than the real\n // element (since we are simulating the special mouse events with mouseover/\n // mouseout).\n //\n // Since we're making a copy anyways, we might as well attempt to convert\n // this event into a pseudo-real mouseenter/mouseleave event by adjusting\n // its type.\n //\n // tslint:disable-next-line:no-any\n const copy = {};\n for (const property in e) {\n if (property === 'srcElement' || property === 'target') {\n continue;\n }\n const key = property;\n // Making a copy requires iterating through all properties of `Event`.\n // tslint:disable-next-line:no-dict-access-on-struct-type\n const value = e[key];\n if (typeof value === 'function') {\n continue;\n }\n // Value should be the expected type, but the value of `key` is not known\n // statically.\n // tslint:disable-next-line:no-any\n copy[key] = value;\n }\n if (e.type === EventType.MOUSEOVER) {\n copy['type'] = EventType.MOUSEENTER;\n }\n else if (e.type === EventType.MOUSEOUT) {\n copy['type'] = EventType.MOUSELEAVE;\n }\n else if (e.type === EventType.POINTEROVER) {\n copy['type'] = EventType.POINTERENTER;\n }\n else {\n copy['type'] = EventType.POINTERLEAVE;\n }\n copy['target'] = copy['srcElement'] = target;\n copy['bubbles'] = false;\n return copy;\n}\n/**\n * Returns touch data extracted from the touch event: clientX, clientY, screenX\n * and screenY. If the event has no touch information at all, the returned\n * value is null.\n *\n * The fields of this Object are unquoted.\n *\n * @param event A touch event.\n */\nfunction getTouchData(event) {\n const touch = (event.changedTouches && event.changedTouches[0]) || (event.touches && event.touches[0]);\n if (!touch) {\n return null;\n }\n return {\n clientX: touch.clientX,\n clientY: touch.clientY,\n screenX: touch.screenX,\n screenY: touch.screenY,\n };\n}\n/**\n * Creates a new EventLike object for a \"click\" event that's derived from the\n * original corresponding \"touchend\" event for a fast-click implementation.\n *\n * It takes a touch event, adds common fields found in a click event and\n * changes the type to 'click', so that the resulting event looks more like\n * a real click event.\n *\n * @param event A touch event.\n * @return A modified event-like object copied from the event object passed into\n * this function.\n */\nfunction recreateTouchEventAsClick(event) {\n const click = {};\n click['originalEventType'] = event.type;\n click['type'] = EventType.CLICK;\n for (const property in event) {\n if (property === 'type' || property === 'srcElement') {\n continue;\n }\n const key = property;\n // Making a copy requires iterating through all properties of `TouchEvent`.\n // tslint:disable-next-line:no-dict-access-on-struct-type\n const value = event[key];\n if (typeof value === 'function') {\n continue;\n }\n // Value should be the expected type, but the value of `key` is not known\n // statically.\n // tslint:disable-next-line:no-any\n click[key] = value;\n }\n // Ensure that the event has the most recent timestamp. This timestamp\n // may be used in the future to validate or cancel subsequent click events.\n click['timeStamp'] = Date.now();\n // Emulate preventDefault and stopPropagation behavior\n click['defaultPrevented'] = false;\n click['preventDefault'] = syntheticPreventDefault;\n click['_propagationStopped'] = false;\n click['stopPropagation'] = syntheticStopPropagation;\n // Emulate click coordinates using touch info\n const touch = getTouchData(event);\n if (touch) {\n click['clientX'] = touch.clientX;\n click['clientY'] = touch.clientY;\n click['screenX'] = touch.screenX;\n click['screenY'] = touch.screenY;\n }\n return click;\n}\n/**\n * An implementation of \"preventDefault\" for a synthesized event. Simply\n * sets \"defaultPrevented\" property to true.\n */\nfunction syntheticPreventDefault() {\n this.defaultPrevented = true;\n}\n/**\n * An implementation of \"stopPropagation\" for a synthesized event. It simply\n * sets a synthetic non-standard \"_propagationStopped\" property to true.\n */\nfunction syntheticStopPropagation() {\n this._propagationStopped = true;\n}\n/**\n * Mapping of KeyboardEvent.key values to\n * KeyCode values.\n */\nconst ACTION_KEY_TO_KEYCODE = {\n 'Enter': KeyCode.ENTER,\n ' ': KeyCode.SPACE,\n};\n/**\n * Mapping of HTML element identifiers (ARIA role, type, or tagName) to the\n * keys (enter and/or space) that should activate them. A value of zero means\n * that both should activate them.\n */\nconst IDENTIFIER_TO_KEY_TRIGGER_MAPPING = {\n 'A': KeyCode.ENTER,\n 'BUTTON': 0,\n 'CHECKBOX': KeyCode.SPACE,\n 'COMBOBOX': KeyCode.ENTER,\n 'FILE': 0,\n 'GRIDCELL': KeyCode.ENTER,\n 'LINK': KeyCode.ENTER,\n 'LISTBOX': KeyCode.ENTER,\n 'MENU': 0,\n 'MENUBAR': 0,\n 'MENUITEM': 0,\n 'MENUITEMCHECKBOX': 0,\n 'MENUITEMRADIO': 0,\n 'OPTION': 0,\n 'RADIO': KeyCode.SPACE,\n 'RADIOGROUP': KeyCode.SPACE,\n 'RESET': 0,\n 'SUBMIT': 0,\n 'SWITCH': KeyCode.SPACE,\n 'TAB': 0,\n 'TREE': KeyCode.ENTER,\n 'TREEITEM': KeyCode.ENTER,\n};\n/**\n * Returns whether or not to process space based on the type of the element;\n * checks to make sure that type is not null.\n * @param element The element.\n * @return Whether or not to process space based on type.\n */\nfunction processSpace(element) {\n const type = (element.getAttribute('type') || element.tagName).toUpperCase();\n return type in PROCESS_SPACE;\n}\n/**\n * Returns whether or not the given element is a text control.\n * @param el The element.\n * @return Whether or not the given element is a text control.\n */\nfunction isTextControl(el) {\n const type = (el.getAttribute('type') || el.tagName).toUpperCase();\n return type in TEXT_CONTROLS;\n}\n/**\n * Returns if the given element is a native HTML control.\n * @param el The element.\n * @return If the given element is a native HTML control.\n */\nfunction isNativeHTMLControl(el) {\n return el.tagName.toUpperCase() in NATIVE_HTML_CONTROLS;\n}\n/**\n * Returns if the given element is natively activatable. Browsers emit click\n * events for natively activatable elements, even when activated via keyboard.\n * For these elements, we don't need to raise a11y click events.\n * @param el The element.\n * @return If the given element is a native HTML control.\n */\nfunction isNativelyActivatable(el) {\n return (el.tagName.toUpperCase() === 'BUTTON' ||\n (!!el.type && el.type.toUpperCase() === 'FILE'));\n}\n/**\n * HTML types (not ARIA roles) which will auto-trigger a click event for\n * the Space key, with side-effects. We will not call preventDefault if space is\n * pressed, nor will we raise a11y click events. For all other elements, we can\n * suppress the default event (which has no desired side-effects) and handle the\n * keydown ourselves.\n */\nconst PROCESS_SPACE = {\n 'CHECKBOX': true,\n 'FILE': true,\n 'OPTION': true,\n 'RADIO': true,\n};\n/** TagNames and Input types for which to not process enter/space as click. */\nconst TEXT_CONTROLS = {\n 'COLOR': true,\n 'DATE': true,\n 'DATETIME': true,\n 'DATETIME-LOCAL': true,\n 'EMAIL': true,\n 'MONTH': true,\n 'NUMBER': true,\n 'PASSWORD': true,\n 'RANGE': true,\n 'SEARCH': true,\n 'TEL': true,\n 'TEXT': true,\n 'TEXTAREA': true,\n 'TIME': true,\n 'URL': true,\n 'WEEK': true,\n};\n/** TagNames that are native HTML controls. */\nconst NATIVE_HTML_CONTROLS = {\n 'A': true,\n 'AREA': true,\n 'BUTTON': true,\n 'DIALOG': true,\n 'IMG': true,\n 'INPUT': true,\n 'LINK': true,\n 'MENU': true,\n 'OPTGROUP': true,\n 'OPTION': true,\n 'PROGRESS': true,\n 'SELECT': true,\n 'TEXTAREA': true,\n};\n/** Exported for testing. */\nconst testing = {\n setIsMac(value) {\n isMac = value;\n },\n};\n\n/**\n * Since maps from event to action are immutable we can use a single map\n * to represent the empty map.\n */\nconst EMPTY_ACTION_MAP = {};\n/**\n * This regular expression matches a semicolon.\n */\nconst REGEXP_SEMICOLON = /\\s*;\\s*/;\n/** If no event type is defined, defaults to `click`. */\nconst DEFAULT_EVENT_TYPE = EventType.CLICK;\n/** Resolves actions for Events. */\nclass ActionResolver {\n constructor({ syntheticMouseEventSupport = false, } = {}) {\n this.a11yClickSupport = false;\n this.updateEventInfoForA11yClick = undefined;\n this.preventDefaultForA11yClick = undefined;\n this.populateClickOnlyAction = undefined;\n this.syntheticMouseEventSupport = syntheticMouseEventSupport;\n }\n resolveEventType(eventInfo) {\n // We distinguish modified and plain clicks in order to support the\n // default browser behavior of modified clicks on links; usually to\n // open the URL of the link in new tab or new window on ctrl/cmd\n // click. A DOM 'click' event is mapped to the jsaction 'click'\n // event iff there is no modifier present on the event. If there is\n // a modifier, it's mapped to 'clickmod' instead.\n //\n // It's allowed to omit the event in the jsaction attribute. In that\n // case, 'click' is assumed. Thus the following two are equivalent:\n //\n // \n // \n //\n // For unmodified clicks, EventContract invokes the jsaction\n // 'gna.fu'. For modified clicks, EventContract won't find a\n // suitable action and leave the event to be handled by the\n // browser.\n //\n // In order to also invoke a jsaction handler for a modifier click,\n // 'clickmod' needs to be used:\n //\n // \n //\n // EventContract invokes the jsaction 'gna.fu' for modified\n // clicks. Unmodified clicks are left to the browser.\n //\n // In order to set up the event contract to handle both clickonly and\n // clickmod, only addEvent(EventType.CLICK) is necessary.\n //\n // In order to set up the event contract to handle click,\n // addEvent() is necessary for CLICK, KEYDOWN, and KEYPRESS event types. If\n // a11y click support is enabled, addEvent() will set up the appropriate key\n // event handler automatically.\n if (getEventType(eventInfo) === EventType.CLICK &&\n isModifiedClickEvent(getEvent(eventInfo))) {\n setEventType(eventInfo, EventType.CLICKMOD);\n }\n else if (this.a11yClickSupport) {\n this.updateEventInfoForA11yClick(eventInfo);\n }\n }\n resolveAction(eventInfo) {\n if (getResolved(eventInfo)) {\n return;\n }\n this.populateAction(eventInfo, getTargetElement(eventInfo));\n setResolved(eventInfo, true);\n }\n resolveParentAction(eventInfo) {\n const action = getAction(eventInfo);\n const actionElement = action && getActionElement(action);\n unsetAction(eventInfo);\n const parentNode = actionElement && this.getParentNode(actionElement);\n if (!parentNode) {\n return;\n }\n this.populateAction(eventInfo, parentNode);\n }\n /**\n * Searches for a jsaction that the DOM event maps to and creates an\n * object containing event information used for dispatching by\n * jsaction.Dispatcher. This method populates the `action` and `actionElement`\n * fields of the EventInfo object passed in by finding the first\n * jsaction attribute above the target Node of the event, and below\n * the container Node, that specifies a jsaction for the event\n * type. If no such jsaction is found, then action is undefined.\n *\n * @param eventInfo `EventInfo` to set `action` and `actionElement` if an\n * action is found on any `Element` in the path of the `Event`.\n */\n populateAction(eventInfo, currentTarget) {\n let actionElement = currentTarget;\n while (actionElement && actionElement !== getContainer(eventInfo)) {\n if (actionElement.nodeType === Node.ELEMENT_NODE) {\n this.populateActionOnElement(actionElement, eventInfo);\n }\n if (getAction(eventInfo)) {\n // An event is handled by at most one jsaction. Thus we stop at the\n // first matching jsaction specified in a jsaction attribute up the\n // ancestor chain of the event target node.\n break;\n }\n actionElement = this.getParentNode(actionElement);\n }\n const action = getAction(eventInfo);\n if (!action) {\n // No action found.\n return;\n }\n if (this.a11yClickSupport) {\n this.preventDefaultForA11yClick(eventInfo);\n }\n // We attempt to handle the mouseenter/mouseleave events here by\n // detecting whether the mouseover/mouseout events correspond to\n // entering/leaving an element.\n if (this.syntheticMouseEventSupport) {\n if (getEventType(eventInfo) === EventType.MOUSEENTER ||\n getEventType(eventInfo) === EventType.MOUSELEAVE ||\n getEventType(eventInfo) === EventType.POINTERENTER ||\n getEventType(eventInfo) === EventType.POINTERLEAVE) {\n // We attempt to handle the mouseenter/mouseleave events here by\n // detecting whether the mouseover/mouseout events correspond to\n // entering/leaving an element.\n if (isMouseSpecialEvent(getEvent(eventInfo), getEventType(eventInfo), getActionElement(action))) {\n // If both mouseover/mouseout and mouseenter/mouseleave events are\n // enabled, two separate handlers for mouseover/mouseout are\n // registered. Both handlers will see the same event instance\n // so we create a copy to avoid interfering with the dispatching of\n // the mouseover/mouseout event.\n const copiedEvent = createMouseSpecialEvent(getEvent(eventInfo), getActionElement(action));\n setEvent(eventInfo, copiedEvent);\n // Since the mouseenter/mouseleave events do not bubble, the target\n // of the event is technically the `actionElement` (the node with the\n // `jsaction` attribute)\n setTargetElement(eventInfo, getActionElement(action));\n }\n else {\n unsetAction(eventInfo);\n }\n }\n }\n }\n /**\n * Walk to the parent node, unless the node has a different owner in\n * which case we walk to the owner. Attempt to walk to host of a\n * shadow root if needed.\n */\n getParentNode(element) {\n const owner = element[OWNER];\n if (owner) {\n return owner;\n }\n const parentNode = element.parentNode;\n if (parentNode?.nodeName === '#document-fragment') {\n return parentNode?.host ?? null;\n }\n return parentNode;\n }\n /**\n * Accesses the jsaction map on a node and retrieves the name of the\n * action the given event is mapped to, if any. It parses the\n * attribute value and stores it in a property on the node for\n * subsequent retrieval without re-parsing and re-accessing the\n * attribute.\n *\n * @param actionElement The DOM node to retrieve the jsaction map from.\n * @param eventInfo `EventInfo` to set `action` and `actionElement` if an\n * action is found on the `actionElement`.\n */\n populateActionOnElement(actionElement, eventInfo) {\n const actionMap = this.parseActions(actionElement);\n const actionName = actionMap[getEventType(eventInfo)];\n if (actionName !== undefined) {\n setAction(eventInfo, actionName, actionElement);\n }\n if (this.a11yClickSupport) {\n this.populateClickOnlyAction(actionElement, eventInfo, actionMap);\n }\n }\n /**\n * Parses and caches an element's jsaction element into a map.\n *\n * This is primarily for internal use.\n *\n * @param actionElement The DOM node to retrieve the jsaction map from.\n * @return Map from event to qualified name of the jsaction bound to it.\n */\n parseActions(actionElement) {\n let actionMap = get(actionElement);\n if (!actionMap) {\n const jsactionAttribute = actionElement.getAttribute(Attribute.JSACTION);\n if (!jsactionAttribute) {\n actionMap = EMPTY_ACTION_MAP;\n set(actionElement, actionMap);\n }\n else {\n actionMap = getParsed(jsactionAttribute);\n if (!actionMap) {\n actionMap = {};\n const values = jsactionAttribute.split(REGEXP_SEMICOLON);\n for (let idx = 0; idx < values.length; idx++) {\n const value = values[idx];\n if (!value) {\n continue;\n }\n const colon = value.indexOf(Char.EVENT_ACTION_SEPARATOR);\n const hasColon = colon !== -1;\n const type = hasColon ? value.substr(0, colon).trim() : DEFAULT_EVENT_TYPE;\n const action = hasColon ? value.substr(colon + 1).trim() : value;\n actionMap[type] = action;\n }\n setParsed(jsactionAttribute, actionMap);\n }\n set(actionElement, actionMap);\n }\n }\n return actionMap;\n }\n addA11yClickSupport(updateEventInfoForA11yClick, preventDefaultForA11yClick, populateClickOnlyAction) {\n this.a11yClickSupport = true;\n this.updateEventInfoForA11yClick = updateEventInfoForA11yClick;\n this.preventDefaultForA11yClick = preventDefaultForA11yClick;\n this.populateClickOnlyAction = populateClickOnlyAction;\n }\n}\n\n/**\n * @fileoverview An enum to control who can call certain jsaction APIs.\n */\nvar Restriction;\n(function (Restriction) {\n Restriction[Restriction[\"I_AM_THE_JSACTION_FRAMEWORK\"] = 0] = \"I_AM_THE_JSACTION_FRAMEWORK\";\n})(Restriction || (Restriction = {}));\n\n/**\n * Receives a DOM event, determines the jsaction associated with the source\n * element of the DOM event, and invokes the handler associated with the\n * jsaction.\n */\nclass Dispatcher {\n /**\n * Options are:\n * - `eventReplayer`: When the event contract dispatches replay events\n * to the Dispatcher, the Dispatcher collects them and in the next tick\n * dispatches them to the `eventReplayer`. Defaults to dispatching to `dispatchDelegate`.\n * @param dispatchDelegate A function that should handle dispatching an `EventInfoWrapper` to handlers.\n */\n constructor(dispatchDelegate, { actionResolver, eventReplayer, } = {}) {\n this.dispatchDelegate = dispatchDelegate;\n /** Whether the event replay is scheduled. */\n this.eventReplayScheduled = false;\n /** The queue of events. */\n this.replayEventInfoWrappers = [];\n this.actionResolver = actionResolver;\n this.eventReplayer = eventReplayer;\n }\n /**\n * Receives an event or the event queue from the EventContract. The event\n * queue is copied and it attempts to replay.\n * If event info is passed in it looks for an action handler that can handle\n * the given event. If there is no handler registered queues the event and\n * checks if a loader is registered for the given namespace. If so, calls it.\n *\n * Alternatively, if in global dispatch mode, calls all registered global\n * handlers for the appropriate event type.\n *\n * The three functionalities of this call are deliberately not split into\n * three methods (and then declared as an abstract interface), because the\n * interface is used by EventContract, which lives in a different jsbinary.\n * Therefore the interface between the three is defined entirely in terms that\n * are invariant under jscompiler processing (Function and Array, as opposed\n * to a custom type with method names).\n *\n * @param eventInfo The info for the event that triggered this call or the\n * queue of events from EventContract.\n */\n dispatch(eventInfo) {\n const eventInfoWrapper = new EventInfoWrapper(eventInfo);\n this.actionResolver?.resolveEventType(eventInfo);\n this.actionResolver?.resolveAction(eventInfo);\n const action = eventInfoWrapper.getAction();\n if (action && shouldPreventDefaultBeforeDispatching(action.element, eventInfoWrapper)) {\n preventDefault(eventInfoWrapper.getEvent());\n }\n if (this.eventReplayer && eventInfoWrapper.getIsReplay()) {\n this.scheduleEventInfoWrapperReplay(eventInfoWrapper);\n return;\n }\n this.dispatchDelegate(eventInfoWrapper);\n }\n /**\n * Schedules an `EventInfoWrapper` for replay. The replaying will happen in its own\n * stack once the current flow cedes control. This is done to mimic\n * browser event handling.\n */\n scheduleEventInfoWrapperReplay(eventInfoWrapper) {\n this.replayEventInfoWrappers.push(eventInfoWrapper);\n if (this.eventReplayScheduled) {\n return;\n }\n this.eventReplayScheduled = true;\n Promise.resolve().then(() => {\n this.eventReplayScheduled = false;\n this.eventReplayer(this.replayEventInfoWrappers);\n });\n }\n}\n/**\n * Creates an `EventReplayer` that calls the `replay` function for every `eventInfoWrapper` in\n * the queue.\n */\nfunction createEventReplayer(replay) {\n return (eventInfoWrappers) => {\n for (const eventInfoWrapper of eventInfoWrappers) {\n replay(eventInfoWrapper);\n }\n };\n}\n/**\n * Returns true if the default action of this event should be prevented before\n * this event is dispatched.\n */\nfunction shouldPreventDefaultBeforeDispatching(actionElement, eventInfoWrapper) {\n // Prevent browser from following node links if a jsaction is present\n // and we are dispatching the action now. Note that the targetElement may be\n // a child of an anchor that has a jsaction attached. For that reason, we\n // need to check the actionElement rather than the targetElement.\n return ((actionElement.tagName === 'A' && eventInfoWrapper.getEventType() === EventType.CLICK) ||\n eventInfoWrapper.getEventType() === EventType.CLICKMOD);\n}\n/**\n * Registers deferred functionality for an EventContract and a Jsaction\n * Dispatcher.\n */\nfunction registerDispatcher$1(eventContract, dispatcher) {\n eventContract.ecrd((eventInfo) => {\n dispatcher.dispatch(eventInfo);\n }, Restriction.I_AM_THE_JSACTION_FRAMEWORK);\n}\n\n/** An internal symbol used to indicate whether propagation should be stopped or not. */\nconst PROPAGATION_STOPPED_SYMBOL = Symbol.for('propagationStopped');\n/** Extra event phases beyond what the browser provides. */\nconst EventPhase = {\n REPLAY: 101,\n};\nconst PREVENT_DEFAULT_ERROR_MESSAGE_DETAILS = ' Because event replay occurs after browser dispatch, `preventDefault` would have no ' +\n 'effect. You can check whether an event is being replayed by accessing the event phase: ' +\n '`event.eventPhase === EventPhase.REPLAY`.';\nconst PREVENT_DEFAULT_ERROR_MESSAGE = `\\`preventDefault\\` called during event replay.`;\nconst COMPOSED_PATH_ERROR_MESSAGE_DETAILS = () => ngDevMode\n ? ' Because event replay occurs after browser ' +\n 'dispatch, `composedPath()` will be empty. Iterate parent nodes from `event.target` or ' +\n '`event.currentTarget` if you need to check elements in the event path.'\n : '';\nconst COMPOSED_PATH_ERROR_MESSAGE = `\\`composedPath\\` called during event replay.`;\n/**\n * A dispatcher that uses browser-based `Event` semantics, for example bubbling, `stopPropagation`,\n * `currentTarget`, etc.\n */\nclass EventDispatcher {\n constructor(dispatchDelegate) {\n this.dispatchDelegate = dispatchDelegate;\n this.actionResolver = new ActionResolver();\n this.dispatcher = new Dispatcher((eventInfoWrapper) => {\n this.dispatchToDelegate(eventInfoWrapper);\n }, {\n actionResolver: this.actionResolver,\n });\n }\n /**\n * The entrypoint for the `EventContract` dispatch.\n */\n dispatch(eventInfo) {\n this.dispatcher.dispatch(eventInfo);\n }\n /** Internal method that does basic disaptching. */\n dispatchToDelegate(eventInfoWrapper) {\n if (eventInfoWrapper.getIsReplay()) {\n prepareEventForReplay(eventInfoWrapper);\n }\n prepareEventForBubbling(eventInfoWrapper);\n while (eventInfoWrapper.getAction()) {\n prepareEventForDispatch(eventInfoWrapper);\n this.dispatchDelegate(eventInfoWrapper.getEvent(), eventInfoWrapper.getAction().name);\n if (propagationStopped(eventInfoWrapper)) {\n return;\n }\n this.actionResolver.resolveParentAction(eventInfoWrapper.eventInfo);\n }\n }\n}\nfunction prepareEventForBubbling(eventInfoWrapper) {\n const event = eventInfoWrapper.getEvent();\n const stopPropagation = () => {\n event[PROPAGATION_STOPPED_SYMBOL] = true;\n };\n patchEventInstance(event, 'stopPropagation', stopPropagation);\n patchEventInstance(event, 'stopImmediatePropagation', stopPropagation);\n}\nfunction propagationStopped(eventInfoWrapper) {\n const event = eventInfoWrapper.getEvent();\n return !!event[PROPAGATION_STOPPED_SYMBOL];\n}\nfunction prepareEventForReplay(eventInfoWrapper) {\n const event = eventInfoWrapper.getEvent();\n const target = eventInfoWrapper.getTargetElement();\n patchEventInstance(event, 'target', target);\n patchEventInstance(event, 'eventPhase', EventPhase.REPLAY);\n patchEventInstance(event, 'preventDefault', () => {\n throw new Error(PREVENT_DEFAULT_ERROR_MESSAGE + (ngDevMode ? PREVENT_DEFAULT_ERROR_MESSAGE_DETAILS : ''));\n });\n patchEventInstance(event, 'composedPath', () => {\n throw new Error(COMPOSED_PATH_ERROR_MESSAGE + (ngDevMode ? COMPOSED_PATH_ERROR_MESSAGE_DETAILS : ''));\n });\n}\nfunction prepareEventForDispatch(eventInfoWrapper) {\n const event = eventInfoWrapper.getEvent();\n const currentTarget = eventInfoWrapper.getAction()?.element;\n if (currentTarget) {\n patchEventInstance(event, 'currentTarget', currentTarget, {\n // `currentTarget` is going to get reassigned every dispatch.\n configurable: true,\n });\n }\n}\n/**\n * Patch `Event` instance during non-standard `Event` dispatch. This patches just the `Event`\n * instance that the browser created, it does not patch global properties or methods.\n *\n * This is necessary because dispatching an `Event` outside of browser dispatch results in\n * incorrect properties and methods that need to be polyfilled or do not work.\n *\n * JSAction dispatch adds two extra \"phases\" to event dispatch:\n * 1. Event delegation - the event is being dispatched by a delegating event handler on a container\n * (typically `window.document.documentElement`), to a delegated event handler on some child\n * element. Certain `Event` properties will be unintuitive, such as `currentTarget`, which would\n * be the container rather than the child element. Bubbling would also not work. In order to\n * emulate the browser, these properties and methods on the `Event` are patched.\n * 2. Event replay - the event is being dispatched by the framework once the handlers have been\n * loaded (during hydration, or late-loaded). Certain `Event` properties can be unset by the\n * browser because the `Event` is no longer actively being dispatched, such as `target`. Other\n * methods have no effect because the `Event` has already been dispatched, such as\n * `preventDefault`. Bubbling would also not work. These properties and methods are patched,\n * either to fill in information that the browser may have removed, or to throw errors in methods\n * that no longer behave as expected.\n */\nfunction patchEventInstance(event, property, value, { configurable = false } = {}) {\n Object.defineProperty(event, property, { value, configurable });\n}\n/**\n * Registers deferred functionality for an EventContract and a Jsaction\n * Dispatcher.\n */\nfunction registerDispatcher(eventContract, dispatcher) {\n eventContract.ecrd((eventInfo) => {\n dispatcher.dispatch(eventInfo);\n }, Restriction.I_AM_THE_JSACTION_FRAMEWORK);\n}\n\n/**\n * Whether the user agent is running on iOS.\n */\nconst isIos = typeof navigator !== 'undefined' && /iPhone|iPad|iPod/.test(navigator.userAgent);\n/**\n * A class representing a container node and all the event handlers\n * installed on it. Used so that handlers can be cleaned up if the\n * container is removed from the contract.\n */\nclass EventContractContainer {\n /**\n * @param element The container Element.\n */\n constructor(element) {\n this.element = element;\n /**\n * Array of event handlers and their corresponding event types that are\n * installed on this container.\n *\n */\n this.handlerInfos = [];\n }\n /**\n * Installs the provided installer on the element owned by this container,\n * and maintains a reference to resulting handler in order to remove it\n * later if desired.\n */\n addEventListener(eventType, getHandler) {\n // In iOS, event bubbling doesn't happen automatically in any DOM element,\n // unless it has an onclick attribute or DOM event handler attached to it.\n // This breaks JsAction in some cases. See \"Making Elements Clickable\"\n // section at http://goo.gl/2VoGnB.\n //\n // A workaround for this issue is to change the CSS cursor style to 'pointer'\n // for the container element, which magically turns on event bubbling. This\n // solution is described in the comments section at http://goo.gl/6pEO1z.\n //\n // We use a navigator.userAgent check here as this problem is present both\n // on Mobile Safari and thin WebKit wrappers, such as Chrome for iOS.\n if (isIos) {\n this.element.style.cursor = 'pointer';\n }\n this.handlerInfos.push(addEventListener(this.element, eventType, getHandler(this.element)));\n }\n /**\n * Removes all the handlers installed on this container.\n */\n cleanUp() {\n for (let i = 0; i < this.handlerInfos.length; i++) {\n removeEventListener(this.element, this.handlerInfos[i]);\n }\n this.handlerInfos = [];\n }\n}\n\n/**\n * Update `EventInfo` to be `eventType = 'click'` and sets `a11yClickKey` if it\n * is a a11y click.\n */\nfunction updateEventInfoForA11yClick(eventInfo) {\n if (!isActionKeyEvent(getEvent(eventInfo))) {\n return;\n }\n setA11yClickKey(eventInfo, true);\n // A 'click' triggered by a DOM keypress should be mapped to the 'click'\n // jsaction.\n setEventType(eventInfo, EventType.CLICK);\n}\n/**\n * Call `preventDefault` on an a11y click if it is space key or to prevent the\n * browser's default action for native HTML controls.\n */\nfunction preventDefaultForA11yClick(eventInfo) {\n if (!getA11yClickKey(eventInfo) ||\n (!isSpaceKeyEvent(getEvent(eventInfo)) &&\n !shouldCallPreventDefaultOnNativeHtmlControl(getEvent(eventInfo)))) {\n return;\n }\n preventDefault(getEvent(eventInfo));\n}\n/**\n * Sets the `action` to `clickonly` for a click event that is not an a11y click\n * and if there is not already a click action.\n */\nfunction populateClickOnlyAction(actionElement, eventInfo, actionMap) {\n if (\n // If there's already an action, don't attempt to set a CLICKONLY\n getAction(eventInfo) ||\n // Only attempt CLICKONLY if the type is CLICK\n getEventType(eventInfo) !== EventType.CLICK ||\n // a11y clicks are never CLICKONLY\n getA11yClickKey(eventInfo) ||\n actionMap[EventType.CLICKONLY] === undefined) {\n return;\n }\n setEventType(eventInfo, EventType.CLICKONLY);\n setAction(eventInfo, actionMap[EventType.CLICKONLY], actionElement);\n}\n\n/**\n * @define Support for accessible click actions. This flag can be overridden in\n * a build rule.\n */\nconst A11Y_CLICK_SUPPORT = false;\n/**\n * @define Support for the non-bubbling mouseenter and mouseleave events. This\n * flag can be overridden in a build rule.\n */\nconst MOUSE_SPECIAL_SUPPORT = false;\n\n/**\n * @fileoverview Implements the local event handling contract. This\n * allows DOM objects in a container that enters into this contract to\n * define event handlers which are executed in a local context.\n *\n * One EventContract instance can manage the contract for multiple\n * containers, which are added using the addContainer() method.\n *\n * Events can be registered using the addEvent() method.\n *\n * A Dispatcher is added using the registerDispatcher() method. Until there is\n * a dispatcher, events are queued. The idea is that the EventContract\n * class is inlined in the HTML of the top level page and instantiated\n * right after the start of . The Dispatcher class is contained\n * in the external deferred js, and instantiated and registered with\n * EventContract when the external javascript in the page loads. The\n * external javascript will also register the jsaction handlers, which\n * then pick up the queued events at the time of registration.\n *\n * Since this class is meant to be inlined in the main page HTML, the\n * size of the binary compiled from this file MUST be kept as small as\n * possible and thus its dependencies to a minimum.\n */\n/**\n * EventContract intercepts events in the bubbling phase at the\n * boundary of a container element, and maps them to generic actions\n * which are specified using the custom jsaction attribute in\n * HTML. Behavior of the application is then specified in terms of\n * handler for such actions, cf. jsaction.Dispatcher in dispatcher.js.\n *\n * This has several benefits: (1) No DOM event handlers need to be\n * registered on the specific elements in the UI. (2) The set of\n * events that the application has to handle can be specified in terms\n * of the semantics of the application, rather than in terms of DOM\n * events. (3) Invocation of handlers can be delayed and handlers can\n * be delay loaded in a generic way.\n */\nclass EventContract {\n static { this.A11Y_CLICK_SUPPORT = A11Y_CLICK_SUPPORT; }\n static { this.MOUSE_SPECIAL_SUPPORT = MOUSE_SPECIAL_SUPPORT; }\n constructor(containerManager, useActionResolver = true) {\n this.useActionResolver = useActionResolver;\n /**\n * The DOM events which this contract covers. Used to prevent double\n * registration of event types. The value of the map is the\n * internally created DOM event handler function that handles the\n * DOM events. See addEvent().\n *\n */\n this.eventHandlers = {};\n this.browserEventTypeToExtraEventTypes = {};\n /**\n * The dispatcher function. Events are passed to this function for\n * handling once it was set using the registerDispatcher() method. This is\n * done because the function is passed from another jsbinary, so passing the\n * instance and invoking the method here would require to leave the method\n * unobfuscated.\n */\n this.dispatcher = null;\n /**\n * The list of suspended `EventInfo` that will be dispatched\n * as soon as the `Dispatcher` is registered.\n */\n this.queuedEventInfos = [];\n /** Whether to add an a11y click listener. */\n this.addA11yClickListener = false;\n this.containerManager = containerManager;\n if (this.useActionResolver) {\n this.actionResolver = new ActionResolver({\n syntheticMouseEventSupport: EventContract.MOUSE_SPECIAL_SUPPORT,\n });\n }\n if (EventContract.A11Y_CLICK_SUPPORT) {\n // Add a11y click support to the `EventContract`.\n this.addA11yClickSupport();\n }\n }\n handleEvent(eventType, event, container) {\n const eventInfo = createEventInfoFromParameters(\n /* eventType= */ eventType, \n /* event= */ event, \n /* targetElement= */ event.target, \n /* container= */ container, \n /* timestamp= */ Date.now());\n this.handleEventInfo(eventInfo);\n }\n /**\n * Handle an `EventInfo`.\n */\n handleEventInfo(eventInfo) {\n if (!this.dispatcher) {\n // All events are queued when the dispatcher isn't yet loaded.\n setIsReplay(eventInfo, true);\n this.queuedEventInfos?.push(eventInfo);\n return;\n }\n if (this.useActionResolver) {\n this.actionResolver.resolveEventType(eventInfo);\n this.actionResolver.resolveAction(eventInfo);\n }\n this.dispatcher(eventInfo);\n }\n /**\n * Enables jsaction handlers to be called for the event type given by\n * name.\n *\n * If the event is already registered, this does nothing.\n *\n * @param prefixedEventType If supplied, this event is used in\n * the actual browser event registration instead of the name that is\n * exposed to jsaction. Use this if you e.g. want users to be able\n * to subscribe to jsaction=\"transitionEnd:foo\" while the underlying\n * event is webkitTransitionEnd in one browser and mozTransitionEnd\n * in another.\n */\n addEvent(eventType, prefixedEventType) {\n if (eventType in this.eventHandlers || !this.containerManager) {\n return;\n }\n if (!EventContract.MOUSE_SPECIAL_SUPPORT && NON_BUBBLING_MOUSE_EVENTS.indexOf(eventType) >= 0) {\n return;\n }\n const eventHandler = (eventType, event, container) => {\n this.handleEvent(eventType, event, container);\n };\n // Store the callback to allow us to replay events.\n this.eventHandlers[eventType] = eventHandler;\n const browserEventType = getBrowserEventType(prefixedEventType || eventType);\n if (browserEventType !== eventType) {\n const eventTypes = this.browserEventTypeToExtraEventTypes[browserEventType] || [];\n eventTypes.push(eventType);\n this.browserEventTypeToExtraEventTypes[browserEventType] = eventTypes;\n }\n this.containerManager.addEventListener(browserEventType, (element) => {\n return (event) => {\n eventHandler(eventType, event, element);\n };\n });\n // Automatically install a keypress/keydown event handler if support for\n // accessible clicks is turned on.\n if (this.addA11yClickListener && eventType === EventType.CLICK) {\n this.addEvent(EventType.KEYDOWN);\n }\n }\n /**\n * Gets the queued early events and replay them using the appropriate handler\n * in the provided event contract. Once all the events are replayed, it cleans\n * up the early contract.\n */\n replayEarlyEvents(earlyJsactionContainer = window) {\n // Check if the early contract is present and prevent calling this function\n // more than once.\n const earlyJsactionData = earlyJsactionContainer._ejsa;\n if (!earlyJsactionData) {\n return;\n }\n // Replay the early contract events.\n const earlyEventInfos = earlyJsactionData.q;\n for (let idx = 0; idx < earlyEventInfos.length; idx++) {\n const earlyEventInfo = earlyEventInfos[idx];\n const eventTypes = this.getEventTypesForBrowserEventType(earlyEventInfo.eventType);\n for (let i = 0; i < eventTypes.length; i++) {\n const eventInfo = cloneEventInfo(earlyEventInfo);\n // EventInfo eventType maps to JSAction's internal event type,\n // rather than the browser event type.\n setEventType(eventInfo, eventTypes[i]);\n this.handleEventInfo(eventInfo);\n }\n }\n // Clean up the early contract.\n const earlyEventHandler = earlyJsactionData.h;\n removeEventListeners(earlyJsactionData.c, earlyJsactionData.et, earlyEventHandler);\n removeEventListeners(earlyJsactionData.c, earlyJsactionData.etc, earlyEventHandler, true);\n delete earlyJsactionContainer._ejsa;\n }\n /**\n * Returns all JSAction event types that have been registered for a given\n * browser event type.\n */\n getEventTypesForBrowserEventType(browserEventType) {\n const eventTypes = [];\n if (this.eventHandlers[browserEventType]) {\n eventTypes.push(browserEventType);\n }\n if (this.browserEventTypeToExtraEventTypes[browserEventType]) {\n eventTypes.push(...this.browserEventTypeToExtraEventTypes[browserEventType]);\n }\n return eventTypes;\n }\n /**\n * Returns the event handler function for a given event type.\n */\n handler(eventType) {\n return this.eventHandlers[eventType];\n }\n /**\n * Cleans up the event contract. This resets all of the `EventContract`'s\n * internal state. Users are responsible for not using this `EventContract`\n * after it has been cleaned up.\n */\n cleanUp() {\n this.containerManager.cleanUp();\n this.containerManager = null;\n this.eventHandlers = {};\n this.browserEventTypeToExtraEventTypes = {};\n this.dispatcher = null;\n this.queuedEventInfos = [];\n }\n /**\n * Register a dispatcher function. Event info of each event mapped to\n * a jsaction is passed for handling to this callback. The queued\n * events are passed as well to the dispatcher for later replaying\n * once the dispatcher is registered. Clears the event queue to null.\n *\n * @param dispatcher The dispatcher function.\n * @param restriction\n */\n registerDispatcher(dispatcher, restriction) {\n this.ecrd(dispatcher, restriction);\n }\n /**\n * Unrenamed alias for registerDispatcher. Necessary for any codebases that\n * split the `EventContract` and `Dispatcher` code into different compilation\n * units.\n */\n ecrd(dispatcher, restriction) {\n this.dispatcher = dispatcher;\n if (this.queuedEventInfos?.length) {\n for (let i = 0; i < this.queuedEventInfos.length; i++) {\n this.handleEventInfo(this.queuedEventInfos[i]);\n }\n this.queuedEventInfos = null;\n }\n }\n /**\n * Adds a11y click support to the given `EventContract`. Meant to be called in\n * the same compilation unit as the `EventContract`.\n */\n addA11yClickSupport() {\n this.addA11yClickSupportImpl(updateEventInfoForA11yClick, preventDefaultForA11yClick, populateClickOnlyAction);\n }\n /**\n * Enables a11y click support to be deferred. Meant to be called in the same\n * compilation unit as the `EventContract`.\n */\n exportAddA11yClickSupport() {\n this.addA11yClickListener = true;\n this.ecaacs = this.addA11yClickSupportImpl.bind(this);\n }\n /**\n * Unrenamed function that loads a11yClickSupport.\n */\n addA11yClickSupportImpl(updateEventInfoForA11yClick, preventDefaultForA11yClick, populateClickOnlyAction) {\n this.addA11yClickListener = true;\n if (this.useActionResolver) {\n this.actionResolver.addA11yClickSupport(updateEventInfoForA11yClick, preventDefaultForA11yClick, populateClickOnlyAction);\n }\n }\n}\nfunction removeEventListeners(container, eventTypes, earlyEventHandler, capture) {\n for (let idx = 0; idx < eventTypes.length; idx++) {\n container.removeEventListener(eventTypes[idx], earlyEventHandler, /* useCapture */ capture);\n }\n}\n/**\n * Adds a11y click support to the given `EventContract`. Meant to be called\n * in a different compilation unit from the `EventContract`. The `EventContract`\n * must have called `exportAddA11yClickSupport` in its compilation unit for this\n * to have any effect.\n */\nfunction addDeferredA11yClickSupport(eventContract) {\n eventContract.ecaacs?.(updateEventInfoForA11yClick, preventDefaultForA11yClick, populateClickOnlyAction);\n}\n\n/**\n * EarlyEventContract intercepts events in the bubbling phase at the\n * boundary of the document body. This mapping will be passed to the\n * late-loaded EventContract.\n */\nclass EarlyEventContract {\n constructor(replaySink = window, container = window.document.documentElement) {\n this.replaySink = replaySink;\n this.container = container;\n replaySink._ejsa = {\n c: container,\n q: [],\n et: [],\n etc: [],\n h: (event) => {\n const eventInfo = createEventInfoFromParameters(event.type, event, event.target, container, Date.now());\n replaySink._ejsa.q.push(eventInfo);\n },\n };\n }\n /**\n * Installs a list of event types for container .\n */\n addEvents(types, capture) {\n const replaySink = this.replaySink._ejsa;\n for (let idx = 0; idx < types.length; idx++) {\n const eventType = types[idx];\n const eventTypes = capture ? replaySink.etc : replaySink.et;\n eventTypes.push(eventType);\n this.container.addEventListener(eventType, replaySink.h, capture);\n }\n }\n}\n\n/**\n * Provides a factory function for bootstrapping an event contract on a\n * specified object (by default, exposed on the `window`).\n * @param field The property on the object that the event contract will be placed on.\n * @param container The container that listens to events\n * @param appId A given identifier for an application. If there are multiple apps on the page\n * then this is how contracts can be initialized for each one.\n * @param eventTypes An array of event names that should be listened to.\n * @param captureEventTypes An array of event names that should be listened to with capture.\n * @param earlyJsactionTracker The object that should receive the event contract.\n */\nfunction bootstrapEarlyEventContract(field, container, appId, eventTypes, captureEventTypes, earlyJsactionTracker = window) {\n if (!earlyJsactionTracker[field]) {\n earlyJsactionTracker[field] = {};\n }\n earlyJsactionTracker[field][appId] = {};\n const eventContract = new EarlyEventContract(earlyJsactionTracker[field][appId], container);\n if (eventTypes)\n eventContract.addEvents(eventTypes);\n if (captureEventTypes)\n eventContract.addEvents(captureEventTypes, true);\n}\n\nexport { EventContract, EventContractContainer, EventDispatcher, EventInfoWrapper, EventPhase, bootstrapEarlyEventContract, isCaptureEvent, isSupportedEvent, registerDispatcher };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,UAAU;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,IAAI,GAAG,IAAI;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,GAAG,GAAG,KAAK;AACjB;AACA;AACA;AACA;AACA,MAAMC,GAAG,GAAG,KAAK;AACjB;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,YAAY;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,OAAO,GAAG,SAAS;AACzB,MAAMC,SAAS,GAAG;EAAEC,QAAQ,EAAEP,UAAU;EAAEQ,EAAE,EAAEP,IAAI;EAAEC,GAAG;EAAEC,GAAG;EAAEC,UAAU;EAAEC;AAAQ,CAAC;AAEnF,MAAMI,IAAI,GAAG;EACT;AACJ;AACA;AACA;EACIC,0BAA0B,EAAE,GAAG;EAC/B;AACJ;AACA;AACA;EACIC,sBAAsB,EAAE,GAAG;EAC3B;AACJ;AACA;AACA;EACIC,YAAY,EAAE,GAAG;EACjB;AACJ;AACA;AACA;EACIC,uBAAuB,EAAE,GAAG;EAC5B;AACJ;AACA;AACA;EACIC,aAAa,EAAE;AACnB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,SAAS,GAAG;EACd;AACJ;AACA;AACA;EACIC,QAAQ,EAAE,UAAU;EACpB;AACJ;AACA;AACA;EACIC,MAAM,EAAE,QAAQ;EAChB;AACJ;AACA;AACA;AACA;AACA;EACIC,KAAK,EAAE,OAAO;EACd;AACJ;AACA;AACA;AACA;AACA;EACIC,QAAQ,EAAE,UAAU;EACpB;AACJ;AACA;AACA;AACA;EACIC,SAAS,EAAE,WAAW;EACtB;AACJ;AACA;EACIC,QAAQ,EAAE,UAAU;EACpB;AACJ;AACA;AACA;AACA;EACIC,KAAK,EAAE,OAAO;EACd;AACJ;AACA;AACA;AACA;EACIC,OAAO,EAAE,SAAS;EAClB;AACJ;AACA;EACIC,IAAI,EAAE,MAAM;EACZ;AACJ;AACA;EACIC,QAAQ,EAAE,UAAU;EACpB;AACJ;AACA;AACA;AACA;AACA;AACA;EACIC,MAAM,EAAE,QAAQ;EAChB;AACJ;AACA;AACA;AACA;EACIC,OAAO,EAAE,SAAS;EAClB;AACJ;AACA;AACA;EACIC,QAAQ,EAAE,UAAU;EACpB;AACJ;AACA;AACA;AACA;EACIC,KAAK,EAAE,OAAO;EACd;AACJ;AACA;AACA;AACA;EACIC,OAAO,EAAE,SAAS;EAClB;AACJ;AACA;AACA;AACA;EACIC,SAAS,EAAE,WAAW;EACtB;AACJ;AACA;AACA;AACA;EACIC,SAAS,EAAE,WAAW;EACtB;AACJ;AACA;AACA;AACA;EACIC,QAAQ,EAAE,UAAU;EACpB;AACJ;AACA;AACA;EACIC,UAAU,EAAE,YAAY;EACxB;AACJ;AACA;AACA;EACIC,UAAU,EAAE,YAAY;EACxB;AACJ;AACA;EACIC,SAAS,EAAE,WAAW;EACtB;AACJ;AACA;AACA;AACA;EACIC,SAAS,EAAE,WAAW;EACtB;AACJ;AACA;AACA;AACA;EACIC,WAAW,EAAE,aAAa;EAC1B;AACJ;AACA;AACA;AACA;EACIC,WAAW,EAAE,aAAa;EAC1B;AACJ;AACA;AACA;AACA;EACIC,UAAU,EAAE,YAAY;EACxB;AACJ;AACA;AACA;EACIC,YAAY,EAAE,cA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