PageSourceSearch

https://1wazsi.life/resources/v1/app/assets/inert.esm-Csojlcgx.js

js 1wazsi.life collected 2026-10-04 13:13:16 UTC 8,707 bytes, 13 lines download raw bytes

vendor: 7,304 bytes, line 1
1import{al as M}from"./logger-BOxpBNGt.js";function k(_,v){for(var o=0;o<v.length;o++){const a=v[o];if(typeof a!="string"&&!Array.isArray(a)){for(const d in a)if(d!=="default"&&!(d in _)){const f=Object.getOwnPropertyDescriptor(a,d);f&&Object.defineProperty(_,d,f.get?f:{enumerable:!0,get:()=>a[d]})}}}return Object.freeze(Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}))}var N={},I;function T(){if(I)return N;I=1;var _=(function(){function o(a,d){for(var f=0;f<d.length;f++){var l=d[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(a,l.key,l)}}return function(a,d,f){return d&&o(a.prototype,d),f&&o(a,f),a}})();function v(o,a){if(!(o instanceof a))throw new TypeError("Cannot call a class as a function")}return(function(){if(typeof window>"u"||typeof Element>"u")return;var o=Array.prototype.slice,a=Element.prototype.matches||Element.prototype.msMatchesSelector,d=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","video","[contenteditable]"].join(","),f=(function(){function s(t,e){v(this,s),this._inertManager=e,this._rootElement=t,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}return _(s,[{key:"destructor",value:function(){this._observer.disconnect(),this._rootElement&&(this._savedAriaHidden!==null?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach(function(e){this._unmanageNode(e.node)},this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(e){var n=this;b(e,function(u){return n._visitNode(u)});var i=document.activeElement;if(!document.body.contains(e)){for(var r=e,h=void 0;r;){if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){h=r;break}r=r.parentNode}h&&(i=h.activeElement)}e.contains(i)&&(i.blur(),i===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(e){if(e.nodeType===Node.ELEMENT_NODE){var n=e;n!==this._rootElement&&n.hasAttribute("inert")&&this._adoptInertRoot(n),(a.call(n,d)||n.hasAttribute("tabindex"))&&this._manageNode(n)}}},{key:"_manageNode",value:function(e){var n=this._inertManager.register(e,this);this._managedNodes.add(n)}},{key:"_unmanageNode",value:function(e){var n=this._inertManager.deregister(e,this);n&&this._managedNodes.delete(n)}},{key:"_unmanageSubtree",value:function(e){var n=this;b(e,function(i){return n._unmanageNode(i)})}},{key:"_adoptInertRoot",value:function(e){var n=this._inertManager.getInertRoot(e);n||(this._inertManager.setInert(e,!0),n=this._inertManager.getInertRoot(e)),n.managedNodes.forEach(function(i){this._manageNode(i.node)},this)}},{key:"_onMutation",value:function(e,n){e.forEach(function(i){var r=i.target;if(i.type==="childList")o.call(i.addedNodes).forEach(function(u){this._makeSubtreeUnfocusable(u)},this),o.call(i.removedNodes).forEach(function(u){this._unmanageSubtree(u)},this);else if(i.type==="attributes"){if(i.attributeName==="tabindex")this._manageNode(r);else if(r!==this._rootElement&&i.attributeName==="inert"&&r.hasAttribute("inert")){this._adoptInertRoot(r);var h=this._inertManager.getInertRoot(r);this._managedNodes.forEach(function(u){r.contains(u.node)&&h._manageNode(u.node)})}}},this)}},{key:"managedNodes",get:function(){return new Set(this._managedNodes)}},{key:"hasSavedAriaHidden",get:function(){return this._savedAriaHidden!==null}},{key:"savedAriaHidden",set:function(e){this._savedAriaHidden=e},get:function(){return this._savedAriaHidden}}]),s})(),l=(function(){function s(t,e){v(this,s),this._node=t,this._overrodeFocusMethod=!1,this._inertRoots=new Set([e]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}return _(s,[{key:"destructor",value:function(){if(this._throwIfDestroyed(),this._node&&this._node.nodeType===Node.ELEMENT_NODE){var e=this._node;this._savedTabIndex!==null?e.setAttribute("tabindex",this._savedTabIndex):e.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete e.focus}this._node=null,this._inertRoots=null,this._destroyed=!0}},{key:"_throwIfDestroyed",value:function(){if(this.destroyed)throw new Error("Trying to access destroyed InertNode")}},{key:"ensureUntabbable",value:function(){if(this.node.nodeType===Node.ELEMENT_NODE){var e=this.node;if(a.call(e,d)){if(e.tabIndex===-1&&this.hasSavedTabIndex)return;e.hasAttribute("tabindex")&&(this._savedTabIndex=e.tabIndex),e.setAttribute("tabindex","-1"),e.nodeType===Node.ELEMENT_NODE&&(e.focus=function(){},this._overrodeFocusMethod=!0)}else e.hasAttribute("tabindex")&&(this._savedTabIndex=e.tabIndex,e.removeAttribute("tabindex"))}}},{key:"addInertRoot",value:function(e){this._throwIfDestroyed(),this._inertRoots.add(e)}},{key:"removeInertRoot",value:function(e){this._throwIfDestroyed(),this._inertRoots.delete(e),this._inertRoots.size===0&&this.destructor()}},{key:"destroyed",get:function(){return this._destroyed}},{key:"hasSavedTabIndex",get:function(){return this._savedTabIndex!==null}},{key:"node",get:function(){return this._throwIfDestroyed(),this._node}},{key:"savedTabIndex",set:function(e){this._throwIfDestroyed(),this._savedTabIndex=e},get:function(){return this._throwIfDestroyed(),this._savedTabIndex}}]),s})(),w=(function(){function s(t){if(v(this,s),!t)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=t,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),E(t.head||t.body||t.documentElement),t.readyState==="loading"?t.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}return _(s,[{key:"setInert",value:function(e,n){if(n){if(this._inertRoots.has(e))return;var i=new f(e,this);if(e.setAttribute("inert",""),this._inertRoots.set(e,i),!this._document.body.contains(e))for(var r=e.parentNode;r;)r.nodeType===11&&E(r),r=r.parentNode}else{if(!this._inertRoots.has(e))return;var h=this._inertRoots.get(e);h.destructor(),this._inertRoots.delete(e),e.removeAttribute("inert")}}},{key:"getInertRoot",value:function(e){return this._inertRoots.get(e)}},{key:"register",value:function(e,n){var i=this._managedNodes.get(e);return i!==void 0?i.addInertRoot(n):i=new l(e,n),this._managedNodes.set(e,i),i}},{key:"deregister",value:function(e,n){var i=this._managedNodes.get(e);return i?(i.removeInertRoot(n),i.destroyed&&this._managedNodes.delete(e),i):null}},{key:"_onDocumentLoaded",value:function(){var e=o.call(this._document.querySelectorAll("[inert]"));e.forEach(function(n){this.setInert(n,!0)},this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}},{key:"_watchForInert",value:function(e,n){var i=this;e.forEach(function(r){switch(r.type){case"childList":o.call(r.addedNodes).forEac
1h(function(c){if(c.nodeType===Node.ELEMENT_NODE){var m=o.call(c.querySelectorAll("[inert]"));a.call(c,"[inert]")&&m.unshift(c),m.forEach(function(g){this.setInert(g,!0)},i)}},i);break;case"attributes":if(r.attributeName!=="inert")return;var h=r.target,u=h.hasAttribute("inert");i.setInert(h,u);break}},this)}}]),s})();function b(s,t,e){if(s.nodeType==Node.ELEMENT_NODE){var n=s;t&&t(n);var i=n.shadowRoot;if(i){b(i,t);return}if(n.localName=="content"){for(var r=n,h=r.getDistributedNodes?r.getDistributedNodes():[],u=0;u<h.length;u++)b(h[u],t);return}if(n.localName=="slot"){for(var c=n,m=c.assignedNodes?c.assignedNodes({flatten:!0}):[],g=0;g<m.length;g++)b(m[g],t);return}}for(var y=s.firstChild;y!=null;)b(y,t),y=y.nextSibling}function E(s){if(!s.querySelector("style#inert-style, link#inert-style")){var t=document.createElement("style");t.setAttribute("id","inert-style"),t.textContent=`
2[inert] {
3  pointer-events: none;
4  cursor: default;
5}
6
7[inert], [inert] * {
8  -webkit-user-select: none;
9  -moz-user-select: none;
10  -ms-user-select: none;
11  user-select: none;
12}
13`,s.appendChild(t)}}if(!HTMLElement.prototype.hasOwnProperty("inert")){var A=new w(document);Object.defineProperty(HTMLElement.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(t){A.setInert(this,t)}})}})(),N}var p=T();const R=M(p),D=k({__proto__:null,default:R},[p]);export{D as i};

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.