import*as e from"utils";var t={d:(e,n)=>{for(var s in n)t.o(n,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:n[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},n={};t.d(n,{A:()=>i,T:()=>o});const s=(e=>{var n={};return t.d(n,e),n})({executeScripts:()=>e.executeScripts,getElementIterator:()=>e.getElementIterator});class a{constructor(e,t=null){this.callbackHandler=t?t.bind(this):e=>e(),this.callbacks=[],this.observer=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&this.observed.forEach(((t,n)=>{t[0]===e.target&&(this.observer.unobserve(e.target),this.observed.splice(n,1),t[1]())}))}))}),{rootMargin:"200px 0px 200px 0px"}),this.observed=[],this.callbacks=e}async run(){void 0!==this.callbacks&&void 0!==this.callbacks.length&&this.callbacks.forEach((e=>this.callbackHandler(e)))}async observe(e,t){const n=document.getElementById(e);n&&(this.observed.push([n,t]),this.observer.observe(n))}async push(e){this.callbackHandler(e)}}async function o(){document.addEventListener("keydown",(e=>{"Tab"===e.key&&document.addEventListener("keyup",(e=>{const t=e.target,n=t.tagName.toLowerCase();var s,a;("a"===n||(s=t,"button"===(a=n)||"input"===a&&["submit","reset","button"].indexOf(s.type)>-1))&&(document.documentElement.classList.remove("using-pointer"),document.documentElement.classList.add("using-keyboard"))}),{once:!0})}),{passive:!0}),document.addEventListener("pointerup",(()=>{document.documentElement.classList.add("using-pointer"),document.documentElement.classList.remove("using-keyboard")}),{passive:!0}),window.pixel3AsyncStack=new a(window.pixel3AsyncStack||[]),document.addEventListener("a11y.toggletabindex",(e=>{"function"==typeof window.pixel3A11y?.toggleTabIndex&&window.pixel3A11y.toggleTabIndex((0,s.getElementIterator)(e.detail.disable??[]),(0,s.getElementIterator)(e.detail.enable??[]))})),await window.pixel3AsyncStack.run()}const i=async function(e,t=!1){console.warn("runCoreApplication is deprecated, not much happening here, if you need to execute script nodes, use utils instead"),t&&await(0,s.executeScripts)(e),e.dispatchEvent(new CustomEvent("customReady",{bubbles:!0,cancelable:!1}))};var c=n.A,r=n.T;export{c as default,r as init};
//# sourceMappingURL=core.mjs.map