import{o as e,t}from"./vue.runtime.esm-BkFIT5TI.js";import{l as n,n as r}from"./_plugin-vue2_normalizer-agX0mVFg.js";import{t as i}from"./socketActions-DG9KytWP.js";e();var a=class extends t{get moonrakerServiceName(){return this.$typedState.server.system_info?.instance_ids?.moonraker||`moonraker`}get klipperServiceName(){return this.$typedState.server.system_info?.instance_ids?.klipper||`klipper`}async _klipperReset(){await this.$typedDispatch(`resetKlippy`)}hostReboot(){i.machineReboot()}hostShutdown(){i.machineShutdown()}async serviceRestartKlipper(){this.serviceRestartByName(this.klipperServiceName)}serviceRestartMoonraker(){this.serviceRestartByName(this.moonrakerServiceName)}async serviceRestartByName(e){e===this.moonrakerServiceName?i.serverRestart():(e===this.klipperServiceName&&await this._klipperReset(),i.machineServicesRestart(e))}async serviceStartByName(e){i.machineServicesStart(e)}async serviceStopByName(e){if(e===this.moonrakerServiceName)throw Error(`Stopping the moonraker service is not supported`);e===this.klipperServiceName&&await this._klipperReset(),i.machineServicesStop(e)}async restartKlippy(){await this._klipperReset(),i.printerRestart()}async firmwareRestartKlippy(){await this._klipperReset(),i.printerFirmwareRestart()}};a=r([n],a);var o=a;export{o as t};