"use strict";async function getCronJobManager(){if(!CronJobManager){const e=await Promise.resolve().then(()=>__importStar(require("./index")));CronJobManager=e.default}return CronJobManager}async function broadcastStatus(e,t,r={}){try{const r=await getCronJobManager();(await r.getInstance()).updateJobRunningStatus(e,t)}catch(t){console_1.logger.error("CRON",`Failed to update cron status for ${e}`,t)}Websocket_1.messageBroker.broadcastToRoute("/api/admin/system/cron",{type:"status",cronName:e,data:{status:t,...r},timestamp:new Date})}async function broadcastProgress(e,t){try{const r=await getCronJobManager();(await r.getInstance()).updateJobRunningStatus(e,"running",t)}catch(t){console_1.logger.error("CRON",`Failed to update cron progress for ${e}`,t)}Websocket_1.messageBroker.broadcastToRoute("/api/admin/system/cron",{type:"progress",cronName:e,data:{progress:t},timestamp:new Date})}function broadcastLog(e,t,r="info"){Websocket_1.messageBroker.broadcastToRoute("/api/admin/system/cron",{type:"log",cronName:e,data:{message:t,logType:r},timestamp:new Date})}var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}});Object.defineProperty(e,a,o)}:function(e,t,r,a){void 0===a&&(a=r);e[a]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(){var e=function(t){e=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t};return e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var a=e(t),o=0;o<a.length;o++)"default"!==a[o]&&__createBinding(r,t,a[o]);__setModuleDefault(r,t);return r}}();Object.defineProperty(exports,"__esModule",{value:!0});exports.broadcastStatus=broadcastStatus;exports.broadcastProgress=broadcastProgress;exports.broadcastLog=broadcastLog;const Websocket_1=require("@b/handler/Websocket"),console_1=require("@b/utils/console");let CronJobManager=null;