"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[1567],{21567(e,n,s){s.d(n,{check:()=>d});var a=s(55962);class t extends a.Resource{constructor(e){super(e.rid),this.available=!0,this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body,this.rawJson=e.rawJson}async download(e,n){o(n);const s=new a.Channel;e&&(s.onmessage=e);const t=await(0,a.invoke)("plugin:updater|download",{onEvent:s,rid:this.rid,...n});this.downloadedBytes=new a.Resource(t)}async install(){if(!this.downloadedBytes)throw new Error("Update.install called before Update.download");await(0,a.invoke)("plugin:updater|install",{updateRid:this.rid,bytesRid:this.downloadedBytes.rid}),this.downloadedBytes=void 0}async downloadAndInstall(e,n){o(n);const s=new a.Channel;e&&(s.onmessage=e),await(0,a.invoke)("plugin:updater|download_and_install",{onEvent:s,rid:this.rid,...n})}async close(){await(this.downloadedBytes?.close()),await super.close()}}async function d(e){o(e);const n=await(0,a.invoke)("plugin:updater|check",{...e});return n?new t(n):null}function o(e){e?.headers&&(e.headers=Array.from(new Headers(e.headers).entries()))}}}]);
//# sourceMappingURL=1567.2ddb639c8805c7e90576.js.map