export class EmulationManager{constructor(e){this._emulatingMobile=!1,this._hasTouch=!1,this._client=e}async emulateViewport(e){const i=e.isMobile||!1,t=e.width,a=e.height,s=e.deviceScaleFactor||1,n=e.isLandscape?{angle:90,type:"landscapePrimary"}:{angle:0,type:"portraitPrimary"},l=e.hasTouch||!1;await Promise.all([this._client.send("Emulation.setDeviceMetricsOverride",{mobile:i,width:t,height:a,deviceScaleFactor:s,screenOrientation:n}),this._client.send("Emulation.setTouchEmulationEnabled",{enabled:l})]);const c=this._emulatingMobile!==i||this._hasTouch!==l;return this._emulatingMobile=i,this._hasTouch=l,c}}