import { _ as y } from "./loadernew-ac153a51.mjs";
import { d as g, ag as b, r as a, U as h, V as k, o as n, c, a as e, x as w, t as l, i as x, f as E, F as Y, k as M, A as m, _ as D } from "./main-e6123302.mjs";
import { c as S } from "./delphi_utils-fd314b4b.mjs";
const B = {
  key: 0,
  class: "flex h-screen flex-col"
}, V = { class: "flex" }, q = {
  key: 0,
  class: "genpact-blue-box mt-14 flex flex-1 overflow-hidden"
}, C = { class: "mx-auto md:w-11/12 lg:w-11/12 overflow-y-auto" }, N = { class: "bot-start bg-gray-100 min-h-screen px-4 py-6 md:px-8 md:py-12 lg:px-8 lg:py-12" }, P = { class: "bot-inner" }, A = { class: "bot-body" }, F = { class: "mt-4 w-full" }, H = { class: "text-left text-3xl text-background-secondary" }, L = { class: "mt-4 w-full" }, R = { class: "text-left text-background-secondary" }, T = { class: "mt-4 w-full" }, j = { class: "text-left text-background-secondary" }, G = { class: "mt-4 w-full" }, I = { class: "text-left text-background-secondary" }, O = { class: "mt-4 w-full" }, U = { class: "text-left text-background-secondary" }, $ = { class: "mt-4 w-full" }, z = { class: "text-left text-background-secondary" }, J = {
  key: 1,
  class: "flex h-screen flex-col"
}, K = {
  key: 1,
  class: "h-min-screen flex flex-col justify-center text-center"
}, Q = /* @__PURE__ */ g({
  __name: "PromptExecutionStatus",
  setup(W) {
    const i = b(), u = a(), o = a(), r = a(!1), _ = a(""), d = a(!1), f = a(), v = async () => {
      try {
        const { data: t } = await M(`/delphi/prompt/execution/status/${u.value}`);
        if (t && t.is_access_not_allowed) {
          d.value = !1, f.value = t.message;
          return;
        }
        o.value = t && t.data ? t.data : [], _.value = t && t.executed_by ? t.executed_by : "", r.value = !0;
      } catch (t) {
        r.value = !0, console.log("Error in fetching all prompts", { message: t.message });
      }
    };
    return h(async () => {
      u.value = i.query && i.query.execution_id ? i.query.execution_id : null, d.value = await S(), d.value && await v();
    }), (t, s) => {
      const p = k("DelphiHeader");
      return r.value ? (n(), c(Y, { key: 0 }, [
        d.value ? (n(), c("div", B, [
          e("nav", V, [
            w(p)
          ]),
          o.value ? (n(), c("section", q, [
            e("div", C, [
              e("div", N, [
                e("div", P, [
                  e("div", A, [
                    e("div", F, [
                      e("div", H, l(o.value.prompt_name), 1)
                    ]),
                    e("div", L, [
                      s[0] || (s[0] = e("div", { class: "text-left font-bold text-background-secondary" }, "Start Time", -1)),
                      e("div", R, l(o.value.start_time ? x(m)(o.value.start_time).format("MMM Do YYYY, h:mm a") : ""), 1)
                    ]),
                    e("div", T, [
                      s[1] || (s[1] = e("div", { class: "text-left font-bold text-background-secondary" }, "End Time", -1)),
                      e("div", j, l(o.value.end_time ? x(m)(o.value.end_time).format("MMM Do YYYY, h:mm a") : ""), 1)
                    ]),
                    e("div", G, [
                      s[2] || (s[2] = e("div", { class: "text-left font-bold text-background-secondary" }, "Status", -1)),
                      e("div", I, l(o.value.execution_status), 1)
                    ]),
                    e("div", O, [
                      s[3] || (s[3] = e("div", { class: "text-left font-bold text-background-secondary" }, "Executed By", -1)),
                      e("div", U, l(_.value), 1)
                    ]),
                    e("div", $, [
                      s[4] || (s[4] = e("div", { class: "text-left font-bold text-background-secondary" }, "Execution Output", -1)),
                      e("div", z, l(o.value.execution_ouput), 1)
                    ])
                  ])
                ])
              ])
            ])
          ])) : E("", !0)
        ])) : (n(), c("div", J, "You don't have access"))
      ], 64)) : (n(), c("div", K, s[5] || (s[5] = [
        e("img", {
          class: "loadercss mx-auto mb-8 mt-3% block",
          src: y,
          alt: "Loader Gif"
        }, null, -1),
        e("p", { class: "loadertextcss ext-genpact-darkest-blue mx-auto mb-10 px-4 leading-normal" }, "Loading...", -1)
      ])));
    };
  }
});
const te = /* @__PURE__ */ D(Q, [["__scopeId", "data-v-d176aa83"]]);
export {
  te as default
};
