@appsurify-testmap/rrdom 2.0.0-alpha.40 → 2.0.0-alpha.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/rrdom.cjs CHANGED
@@ -90,20 +90,27 @@ const interactiveEvents = [
90
90
  "touchcancel"
91
91
  ];
92
92
  const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
93
- const originalAddEventListener = EventTarget.prototype.addEventListener;
94
- EventTarget.prototype.addEventListener = function(type, listener, options) {
95
- originalAddEventListener.call(this, type, listener, options);
96
- if (this instanceof Element) {
97
- const eventType = type.toLowerCase();
98
- if (interactiveEvents.includes(eventType)) {
99
- interactiveElementsRegistry.add(this);
93
+ if (typeof Element !== "undefined" && typeof EventTarget !== "undefined") {
94
+ const originalAddEventListener = EventTarget.prototype.addEventListener;
95
+ EventTarget.prototype.addEventListener = function(type, listener, options) {
96
+ originalAddEventListener.call(this, type, listener, options);
97
+ if (this instanceof Element) {
98
+ const eventType = type.toLowerCase();
99
+ if (interactiveEvents.includes(eventType)) {
100
+ interactiveElementsRegistry.add(this);
101
+ }
100
102
  }
101
- }
102
- };
103
- const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
104
- EventTarget.prototype.removeEventListener = function(type, listener, options) {
105
- originalRemoveEventListener.call(this, type, listener, options);
106
- };
103
+ };
104
+ }
105
+ if (typeof Element !== "undefined" && typeof EventTarget !== "undefined") {
106
+ const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
107
+ EventTarget.prototype.removeEventListener = function(type, listener, options) {
108
+ originalRemoveEventListener.call(this, type, listener, options);
109
+ if (this instanceof Element) {
110
+ type.toLowerCase();
111
+ }
112
+ };
113
+ }
107
114
  function getDefaultExportFromCjs(x2) {
108
115
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
109
116
  }