"use strict";Object.defineProperty(exports, "__esModule", {value: true});




var _chunkD7SRJTRQcjs = require('./chunk-D7SRJTRQ.cjs');



var _chunkDFJNOFN2cjs = require('./chunk-DFJNOFN2.cjs');

// src/utilities/process-handler.ts
_chunkDFJNOFN2cjs.init_cjs_shims.call(void 0, );
var exitWithError = /* @__PURE__ */ _chunkDFJNOFN2cjs.__name.call(void 0, (config) => {
  _chunkD7SRJTRQcjs.writeFatal.call(void 0, "Exiting script with an error status...", config);
  process.exit(1);
}, "exitWithError");
var exitWithSuccess = /* @__PURE__ */ _chunkDFJNOFN2cjs.__name.call(void 0, (config) => {
  _chunkD7SRJTRQcjs.writeSuccess.call(void 0, "Script completed successfully. Exiting...", config);
  process.exit(0);
}, "exitWithSuccess");
var handleProcess = /* @__PURE__ */ _chunkDFJNOFN2cjs.__name.call(void 0, (config) => {
  _chunkD7SRJTRQcjs.writeTrace.call(void 0, `Using the following arguments to process the script: ${process.argv.join(", ")}`, config);
  process.on("unhandledRejection", (error) => {
    _chunkD7SRJTRQcjs.writeError.call(void 0, `An Unhandled Rejection occurred while running the program: ${error}`, config);
    exitWithError(config);
  });
  process.on("uncaughtException", (error) => {
    _chunkD7SRJTRQcjs.writeError.call(void 0, `An Uncaught Exception occurred while running the program: ${error.message} 
Stacktrace: ${error.stack}`, config);
    exitWithError(config);
  });
  process.on("SIGTERM", (signal) => {
    _chunkD7SRJTRQcjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
    exitWithError(config);
  });
  process.on("SIGINT", (signal) => {
    _chunkD7SRJTRQcjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
    exitWithError(config);
  });
  process.on("SIGHUP", (signal) => {
    _chunkD7SRJTRQcjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
    exitWithError(config);
  });
}, "handleProcess");





exports.exitWithError = exitWithError; exports.exitWithSuccess = exitWithSuccess; exports.handleProcess = handleProcess;
