(function (global) {
  const app = (global.EpicrisisApp = global.EpicrisisApp || {});

  function init() {
    if (!document.body.classList.contains("epicrisis-page")) return;
    app.subviews.init();
    app.utils.localizeMachineDates();
    app.scrollTop.init();
    app.selection.hidratarDraftPdfInicial();
    app.selection.inicializarSeleccionPDF();
    app.draft.instalarPersistenciaDraft();
    app.preparation.init();
    app.factura.init();
    app.soat.initForm();
    app.qxAgent.ejecutarAgenteHallazgosQx();
  }

  document.addEventListener("DOMContentLoaded", init);
})(globalThis);
