{"version":3,"file":"usePatchFloatingFocusGuards.mjs","names":[],"sources":["../../../src/popover/usePatchFloatingFocusGuards.ts"],"sourcesContent":["/*!\n *\n *  Copyright (c) \"Neo4j\"\n *  Neo4j Sweden AB [http://neo4j.com]\n *\n *  This file is part of Neo4j.\n *\n *  Neo4j is free software: you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation, either version 3 of the License, or\n *  (at your option) any later version.\n *\n *  This program is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useEffect } from 'react';\n\nexport function usePatchFloatingFocusGuards() {\n  useEffect(() => {\n    const patchGuards = () => {\n      const guards = document.querySelectorAll(\n        '[data-floating-ui-focus-guard]',\n      );\n      guards.forEach((el) => {\n        el.setAttribute('aria-hidden', 'true');\n        el.removeAttribute('role');\n      });\n    };\n\n    // Initial patch (in case it's already there)\n    patchGuards();\n\n    const observer = new MutationObserver(() => {\n      patchGuards();\n    });\n\n    observer.observe(document.body, {\n      childList: true,\n      subtree: true,\n    });\n\n    return () => {\n      observer.disconnect();\n    };\n  }, []);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,8BAA8B;CAC5C,gBAAgB;EACd,MAAM,oBAAoB;GAIxB,SAHwB,iBACtB,gCAEG,CAAC,CAAC,SAAS,OAAO;IACrB,GAAG,aAAa,eAAe,MAAM;IACrC,GAAG,gBAAgB,MAAM;GAC3B,CAAC;EACH;EAGA,YAAY;EAEZ,MAAM,WAAW,IAAI,uBAAuB;GAC1C,YAAY;EACd,CAAC;EAED,SAAS,QAAQ,SAAS,MAAM;GAC9B,WAAW;GACX,SAAS;EACX,CAAC;EAED,aAAa;GACX,SAAS,WAAW;EACtB;CACF,GAAG,CAAC,CAAC;AACP"}