Skip to Content

JavaScript File

URL: https://static.parastorage.com/unpkg/focus-within-polyfill@5.0.9/dist/focus-within-polyfill.js
HTTP Status: 200 OK
MIME Type: application/javascript
Last Modified: Fri, 21 Jun 2024 06:06:01 GMT
Download Time: Less than a second
Cookies: None
Size: 2 KB
HTTP Headers:  20 headers
Links In:  1 pages
OK Issues: No issues found

1'use strict';(function(){(function(){function e(a){for(var b=[];a=a.parentNode||a.host||a.defaultView;)b.push(a);return b}

2function f(a){return function(b){var c="undefined"!==typeof b.getAttribute?b.getAttribute("class")||"":void 0;"undefined"!==typeof c&&-1===c.indexOf(a)&&b.setAttribute("class",c.concat(" ",a).trim())}

3}

4function g(a){return function(b){var c="undefined"!==typeof b.getAttribute?b.getAttribute("class")||"":void 0;if(c){var d=c.indexOf(a);0<=d&&(0===d||0<=h.indexOf(c.charAt(d-1)))&&

5(c=c.replace(a,"").trim(),""===c?b.removeAttribute("class"):b.setAttribute("class",c))}

6}

7}

8function k(){var a=function(b){function a(){d=!1;"blur"===b.type&&Array.prototype.slice.call(e(b.target)).forEach(g("focus-within"));"focus"===b.type&&Array.prototype.slice.call(e(b.target)).forEach(f("focus-within"))}

9if(!d){window.requestAnimationFrame(a);var d=!0}

10}

11;document.addEventListener("focus",a,!0);document.addEventListener("blur",a,!0);f("js-focus-within")(document.body);return!0}

12var h=["\n","\t"," ",

13"\r"];try{return"undefined"!==typeof window&&!document.querySelector(":focus-within")}

14catch(a){return k()}

15}

16)()}

17)()

18//# sourceMappingURL=focus-within-polyfill.js.map