Module 812901

1,590 characters · in 4ee042754f3ce057.js
Dependencies
Lazily required by (0)none
Requires (0)none
Lazily requires (0)none
Source Raw
function(e,t,i){i.d(t,{A:()=>s,G:()=>c});var n,s=((n={}).Backstage="backstage",n.WithinAppContent="within-app-content",n.AboveAppContent="above-app-content",n);let l={backstage:0,"within-app-content":1,"above-app-content":1002};class r{_pool=null;setPool(e){this._pool=e}get pool(){if(null==this._pool)throw Error("FramePlacementStrategy: pool accessed before setPool");return this._pool}}class a extends r{placed=new Map;rafHandle=null;initialize(e){e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.pointerEvents="none",e.style.display="none",this.pool.appendChild(e)}place(e,t,i){this.placed.set(e,{target:t,level:i}),this.position(e,t,i),this.ensureTicking()}unplace(e){this.placed.delete(e),e.style.display="none"}ensureTicking(){null==this.rafHandle&&(this.rafHandle=requestAnimationFrame(this.tick))}position(e,t,i){let n=t.getBoundingClientRect();e.style.display="block",e.style.zIndex=String(l[i]),e.style.transform=`translate(${n.left}px, ${n.top}px)`,e.style.width=`${n.width}px`,e.style.height=`${n.height}px`}tick=()=>{for(let[e,{target:t,level:i}]of this.placed)this.position(e,t,i);this.rafHandle=this.placed.size>0?requestAnimationFrame(this.tick):null}}class o extends r{initialize(e){e.style.width="100%",e.style.height="100%",e.style.pointerEvents="none",e.style.display="none",this.pool.appendChild(e)}place(e,t,i){e.parentElement!==t&&t.moveBefore(e,null),e.style.display="block"}unplace(e){e.parentElement!==this.pool&&this.pool.moveBefore(e,null),e.style.display="none"}}function c(){return"function"==typeof Element.prototype.moveBefore?new o:new a}}