"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./domHelpers.mjs.js"),t=require("../../../@react-stately/flags/dist/import.mjs.js");exports.getActiveElement=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;var o;if(!t.shadowDOM())return e.activeElement;let r=e.activeElement;for(;r&&"shadowRoot"in r&&(null===(o=r.shadowRoot)||void 0===o?void 0:o.activeElement);)r=r.shadowRoot.activeElement;return r},exports.getEventTarget=function(e){return t.shadowDOM()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target},exports.nodeContains=function(o,r){if(!t.shadowDOM())return!(!r||!o)&&o.contains(r);if(!o||!r)return!1;let n=r;for(;null!==n;){if(n===o)return!0;n="SLOT"===n.tagName&&n.assignedSlot?n.assignedSlot.parentNode:e.isShadowRoot(n)?n.host:n.parentNode}return!1};
//# sourceMappingURL=DOMFunctions.mjs.js.map
