try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`e4d9c3ce-8a33-46dc-9bea-aaffac5d14dc`,e._sentryDebugIdIdentifier=`sentry-dbid-e4d9c3ce-8a33-46dc-9bea-aaffac5d14dc`)}catch{}import"./rolldown-runtime-eb2nym32.js";import{es as e,is as t}from"./entry.client-dr7r6s9a.js";var n=`webos-virtual-keyboard-handler`,r=5,i=class{abortController;isListening=!1;start(){this.isListening||typeof document>`u`||typeof window>`u`||(window.webOSSystem?.setWindowProperty(`cloudgame_active`,`true`),this.abortController=new AbortController,document.addEventListener(`keyboardStateChange`,this.onKeyboardStateChange,{signal:this.abortController.signal}),this.isListening=!0)}destroy(){this.isListening&&=(this.abortController?.abort(),this.abortController=void 0,e.releasePollingMode(n),window.webOSSystem?.setWindowProperty(`cloudgame_active`,`true`),!1)}onKeyboardStateChange=()=>{globalThis.keyboardStateEvent&&globalThis.keyboardStateEvent.visibility?(e.requestPollingMode(n,`none`,r),window.webOSSystem?.setWindowProperty(`cloudgame_active`,`false`)):(e.releasePollingMode(n),window.webOSSystem?.setWindowProperty(`cloudgame_active`,`true`),t(`b`))}},a=class{abortController;isListening=!1;start(){this.isListening||typeof document>`u`||typeof window>`u`||(this.abortController=new AbortController,document.addEventListener(`wheel`,this.onWheel,{signal:this.abortController.signal,passive:!0}),this.isListening=!0)}destroy(){this.isListening&&=(this.abortController?.abort(),this.abortController=void 0,!1)}onWheel=e=>{window.scrollBy(e.deltaX,e.deltaY)}},o=class{virtualKeyboardHandler=new i;wheelHandler=new a;onAppStart(){this.virtualKeyboardHandler.start(),this.wheelHandler.start()}hasQuitSupport(){return typeof window<`u`&&typeof window.close==`function`}quitApp(){this.virtualKeyboardHandler.destroy(),this.wheelHandler.destroy(),typeof window<`u`&&typeof window.close==`function`&&window.close()}};export{o as WebOSApplicationLifecycleAdaptor};