vendor: 4,105 bytes, lines 1-5
1/*! 2* tabbable 6.2.0 3* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE 4*/ 5var e=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],t=e.join(","),n="undefined"==typeof Element,o=n?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,r=!n&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},a=function e(t,n){var o;void 0===n&&(n=!0);var r=null==t||null===(o=t.getAttribute)||void 0===o?void 0:o.call(t,"inert");return""===r||"true"===r||n&&t&&e(t.parentNode)},i=function(e,n,r){if(a(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(t));return n&&o.call(e,t)&&i.unshift(e),i=i.filter(r)},u=function e(n,r,i){for(var u=[],c=Array.from(n);c.length;){var l=c.shift();if(!a(l,!1))if("SLOT"===l.tagName){var s=l.assignedElements(),d=e(s.length?s:l.children,!0,i);i.flatten?u.push.apply(u,d):u.push({scopeParent:l,candidates:d})}else{o.call(l,t)&&i.filter(l)&&(r||!n.includes(l))&&u.push(l);var f=l.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(l),v=!a(f,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(l));if(f&&v){var b=e(!0===f?l.children:f.children,!0,i);i.flatten?u.push.apply(u,b):u.push({scopeParent:l,candidates:b})}else c.unshift.apply(c,l.children)}}return u},c=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},l=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!c(e)?0:e.tabIndex},s=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},d=function(e){return"INPUT"===e.tagName},f=function(e){return function(e){return d(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||r(e),o=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var a=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!a||a===e}(e)},v=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},b=function(e,t){var n=t.displayCheck,a=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var i=o.call(e,"details>summary:first-of-type")?e.parentElement:e;if(o.call(i,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return v(e)}else{if("function"==typeof a){for(var u=e;e;){var c=e.parentElement,l=r(e);if(c&&!c.shadowRoot&&!0===a(c))return v(e);e=e.assignedSlot?e.assignedSlot:c||l===e.ownerDocument?c:l.host}e=u}if(function(e){var t,n,o,a,i=e&&r(e),u=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=u)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(u)||null!=e&&null!==(a=e.ownerDocument)&&void 0!==a&&a.contains(e));!c&&u;){var l,s,d;c=!(null===(s=u=null===(l=i=r(u))||void 0===l?void 0:l.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(u))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},p=function(e,t){return!(t.disabled||a(t)||function(e){return d(e)&&"hidden"===e.type}(t)||b(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}
vendor: 4,625 bytes, lines 5-10
5(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!o.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},h=function(e,t){return!(f(t)||l(t)<0||!p(e,t))},m=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},y=function e(t){var n=[],o=[];return t.forEach((function(t,r){var a=!!t.scopeParent,i=a?t.scopeParent:t,u=function(e,t){var n=l(e);return n<0&&t&&!c(e)?0:n}(i,a),s=a?e(t.candidates):i;0===u?a?n.push.apply(n,s):n.push(i):o.push({documentOrder:r,tabIndex:u,item:t,isScope:a,content:s})})),o.sort(s).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},w=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return!1!==o.call(e,t)&&h(n,e)},g=e.concat("iframe").join(","),N=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==o.call(e,g)&&p(t,e)}; 6/*! 7* focus-trap 7.6.4 8* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE 9*/ 10function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function S(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function P(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var T=function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n._setPausedState(!0)}var o=e.indexOf(t);-1===o||e.splice(o,1),e.push(t)},k=function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&!e[e.length-1]._isManuallyPaused()&&e[e.length-1]._setPausedState(!1)},R=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},D=function(e){return R(e)&&!e.shiftKey},I=function(e){return R(e)&&e.shiftKey},A=function(e){return setTimeout(e,0)},x=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return"function"==typeof e?e.apply(void 0,n):e},C=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},G=[],L=function(e,t){var n,o=(null==t?void 0:t.document)||document,r=(null==t?void 0:t.trapStack)||G,a=F({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:D,isKeyBackward:I},t),c={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:a[n||t]},d=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return c.containerGroups.findIndex((function(t){var o=t.container,r=t.tabbableNodes;return o.contains(e)||(null==n?void 0:n.includes(o))||r.find((function(t){return t===e}))}))},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.hasFallback,r=void 0!==n&&n,i=t.params,u=void 0===i?[]:i,c=a[e];if("function"==typeof c&&(c=c.apply(void 0,P(u))),!0===c&&(c=void 0),!c){
vendor: 4,499 bytes, line 10
10if(void 0===c||!1===c)return c;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var l=c;if("string"==typeof c){try{l=o.querySelector(c)}catch(s){throw new Error("`".concat(e,'` appears to be an invalid selector; error="').concat(s.message,'"'))}if(!l&&!r)throw new Error("`".concat(e,"` as selector refers to no known node"))}return l},v=function(){var e=f("initialFocus",{hasFallback:!0});if(!1===e)return!1;if(void 0===e||e&&!N(e,a.tabbableOptions))if(d(o.activeElement)>=0)e=o.activeElement;else{var t=c.tabbableGroups[0];e=t&&t.firstTabbableNode||f("fallbackFocus")}else null===e&&(e=f("fallbackFocus"));if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},b=function(){if(c.containerGroups=c.containers.map((function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?u([e],t.includeContainer,{filter:h.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:m}):i(e,t.includeContainer,h.bind(null,t)),y(n)}(e,a.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?u([e],t.includeContainer,{filter:p.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):i(e,t.includeContainer,p.bind(null,t))}(e,a.tabbableOptions),o=t.length>0?t[0]:void 0,r=t.length>0?t[t.length-1]:void 0,c=n.find((function(e){return w(e)})),s=n.slice().reverse().find((function(e){return w(e)})),d=!!t.find((function(e){return l(e)>0}));return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:d,firstTabbableNode:o,lastTabbableNode:r,firstDomTabbableNode:c,lastDomTabbableNode:s,nextTabbableNode:function(e){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t.indexOf(e);return r<0?o?n.slice(n.indexOf(e)+1).find((function(e){return w(e)})):n.slice(0,n.indexOf(e)).reverse().find((function(e){return w(e)})):t[r+(o?1:-1)]}}})),c.tabbableGroups=c.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),c.tabbableGroups.length<=0&&!f("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(c.containerGroups.find((function(e){return e.posTabIndexesFound}))&&c.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},g=function(e){var t=e.activeElement;if(t)return t.shadowRoot&&null!==t.shadowRoot.activeElement?g(t.shadowRoot):t},E=function(e){!1!==e&&e!==g(document)&&(e&&e.focus?(e.focus({preventScroll:!!a.preventScroll}),c.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):E(v()))},S=function(e){var t=f("setReturnFocus",{params:[e]});return t||!1!==t&&e},O=function(e){var t=e.target,n=e.event,o=e.isBackward,r=void 0!==o&&o;t=t||C(n),b();var i=null;if(c.tabbableGroups.length>0){var u=d(t,n),s=u>=0?c.containerGroups[u]:void 0;if(u<0)i=r?c.tabbableGroups[c.tabbableGroups.length-1].lastTabbableNode:c.tabbableGroups[0].firstTabbableNode;else if(r){var v=c.tabbableGroups.findIndex((function(e){var n=e.firstTabbableNode;return t===n}));if(v<0&&(s.container===t||N(t,a.tabbableOptions)&&!w(t,a.tabbableOptions)&&!s.nextTabbableNode(t,!1))&&(v=u),v>=0){var p=0===v?c.tabbableGroups.length-1:v-1,h=c.tabbableGroups[p];i=l(t)>=0?h.lastTabbableNode:h.lastDomTabbableNode}else R(n)||(i=s.nextTabbableNode(t,!1))}else{var m=c.tabbableGroups.findIndex((function(e){var n=e.lastTabbableNode;return t===n}));if(m<0&&(s.container===t||N(t,a.tabbableOptions)&&!w(t,a.tabbableOptions)&&!s.nextTabbableNode(t))&&(m=u),m>=0){var y=m===c.tabbableGroups.length-1?0:m+1,g=c.tabbableGroups[y];i=l(t)>=0?g.firstTabbableNode:g.firstDomTabbableNode}else R(n)||(i=s.nextTabbableNode(t))}}else i=f("fallbackFocus");return i},L=function(e){var t=C(e);d(t,e)>=0||(x(a.clickOutsideDeactivates,e)?n.deactivate({returnFocus:a.returnFocusOnDeactivate}):x(a.allowOutsideClick,e)||e.preventDefault())},j=function(e){var t=C(e),n=d(t,e)>=0;if(n||t instanceof Document)n&&(c.mostRecentlyFocusedNode=t);else{var o;e.stopImmediatePropagation();var r=!0;if(c.mostRecentlyFocusedNode)if(l(c.mostRecentlyFocusedNode)>0){var i=d(c.mostRecentlyFocusedNode),u=c.containerGroups[i].tabbableNodes;if(u.length>0){var s=u.findIndex((function(e){return e===c.mostRecentlyFocusedNode}));s>=0&&(a.isKeyForward(c.recentNavEvent)?s+1<u.length&&(o=u[s+1],r=!1):s-1>
10=0&&(o=u[s-1],r=!1))}}else c.containerGroups.some((function(e){return e.tabbableNodes.some((function(e){return l(e)>0}))}))||(r=!1);else r=!1;r&&(o=O({target:c.mostRecentlyFocusedNode,isBackward:a.isKeyBackward(c.recentNavEvent)})),E(o||(c.mostRecentlyFocusedNode||v()))}c.recentNavEvent=void 0},B=function(e){(a.isKeyForward(e)||a.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];c.recentNavEvent=e;var n=O({event:e,isBackward:t});n&&(R(e)&&e.preventDefault(),E(n))}(e,a.isKeyBackward(e))},K=function(e){var t;"Escape"!==(null==(t=e)?void 0:t.key)&&"Esc"!==(null==t?void 0:t.key)&&27!==(null==t?void 0:t.keyCode)||!1===x(a.escapeDeactivates,e)||(e.preventDefault(),n.deactivate())},M=function(e){var t=C(e);d(t,e)>=0||x(a.clickOutsideDeactivates,e)||x(a.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},U=function(){if(c.active)return T(r,n),c.delayInitialFocusTimer=a.delayInitialFocus?A((function(){E(v())})):E(v()),o.addEventListener("focusin",j,!0),o.addEventListener("mousedown",L,{capture:!0,passive:!1}),o.addEventListener("touchstart",L,{capture:!0,passive:!1}),o.addEventListener("click",M,{capture:!0,passive:!1}),o.addEventListener("keydown",B,{capture:!0,passive:!1}),o.addEventListener("keydown",K),n},_=function(){if(c.active)return o.removeEventListener("focusin",j,!0),o.removeEventListener("mousedown",L,!0),o.removeEventListener("touchstart",L,!0),o.removeEventListener("click",M,!0),o.removeEventListener("keydown",B,!0),o.removeEventListener("keydown",K),n},q="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver((function(e){e.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===c.mostRecentlyFocusedNode}))}))&&E(v())})):void 0,Y=function(){q&&(q.disconnect(),c.active&&!c.paused&&c.containers.map((function(e){q.observe(e,{subtree:!0,childList:!0})})))};return n={get active(){return c.active},get paused(){return c.paused},activate:function(e){if(c.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),r=s(e,"checkCanFocusTrap");r||b(),c.active=!0,c.paused=!1,c.nodeFocusedBeforeActivation=o.activeElement,null==t||t();var a=function(){r&&b(),U(),Y(),null==n||n()};return r?(r(c.containers.concat()).then(a,a),this):(a(),this)},deactivate:function(e){if(!c.active)return this;var t=F({onDeactivate:a.onDeactivate,onPostDeactivate:a.onPostDeactivate,checkCanReturnFocus:a.checkCanReturnFocus},e);clearTimeout(c.delayInitialFocusTimer),c.delayInitialFocusTimer=void 0,_(),c.active=!1,c.paused=!1,Y(),k(r,n);var o=s(t,"onDeactivate"),i=s(t,"onPostDeactivate"),u=s(t,"checkCanReturnFocus"),l=s(t,"returnFocus","returnFocusOnDeactivate");null==o||o();var d=function(){A((function(){l&&E(S(c.nodeFocusedBeforeActivation)),null==i||i()}))};return l&&u?(u(S(c.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){return c.active?(c.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return c.active?(c.manuallyPaused=!1,r[r.length-1]!==this?this:this._setPausedState(!1,e)):this}
10,updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return c.containers=t.map((function(e){return"string"==typeof e?o.querySelector(e):e})),c.active&&b(),Y(),this}},Object.defineProperties(n,{_isManuallyPaused:{value:function(){return c.manuallyPaused}},_setPausedState:{value:function(e,t){if(c.paused===e)return this;if(c.paused=e,e){var n=s(t,"onPause"),o=s(t,"onPostPause");null==n||n(),_(),Y(),null==o||o()}else{var r=s(t,"onUnpause"),a=s(t,"onPostUnpause");null==r||r(),b(),U(),Y(),null==a||a()}return this}}}),n.updateContainerElements(e),n};export{L as createFocusTrap};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.