import { defineComponent as m, computed as n, createElementBlock as s, openBlock as t, normalizeClass as f, createCommentVNode as o, createElementVNode as l, normalizeStyle as p, toDisplayString as c, unref as d, createBlock as v, Fragment as _, createTextVNode as y } from "vue";
/* empty css                      */
import h from "../PlIcon24/PlIcon24.vue.js";
import { getErrorMessage as k } from "../../helpers/error.js";
const x = {
  key: 0,
  class: "progress-cell__infinity-loader"
}, S = { class: "progress-cell__body" }, w = { class: "progress-cell__stage text-s" }, B = { class: "progress-cell__percentage text-s d-flex align-center justify-end" }, V = /* @__PURE__ */ m({
  __name: "PlProgressCell",
  props: {
    stage: { default: "not_started" },
    step: { default: "" },
    progressString: { default: "" },
    progress: { default: void 0 },
    error: { default: void 0 }
  },
  setup(e) {
    const r = e, g = n(() => r.stage !== "not_started"), u = n(() => r.stage === "done" ? 100 : Math.min(100, r.progress || 0)), a = n(() => r.progress === void 0 && r.stage !== "done" && r.stage !== "not_started" && !r.error);
    return (C, i) => (t(), s("div", {
      class: f({ "progress-cell": !0, "progress-cell__white-bg": g.value, error: e.error, "not-started": r.stage === "not_started" })
    }, [
      a.value ? (t(), s("div", x, [...i[0] || (i[0] = [
        l("div", { class: "progress-cell__infinity-gradient" }, null, -1)
      ])])) : o("", !0),
      !a.value && !e.error ? (t(), s("div", {
        key: 1,
        class: "progress-cell__indicator",
        style: p({ width: u.value + "%" })
      }, null, 4)) : o("", !0),
      l("div", S, [
        l("div", w, c(e.error ? d(k)(e.error) : e.step), 1),
        l("div", B, [
          e.error ? (t(), v(d(h), {
            key: 0,
            name: "error"
          })) : o("", !0),
          e.error ? o("", !0) : (t(), s(_, { key: 1 }, [
            y(c(e.progressString), 1)
          ], 64))
        ])
      ])
    ], 2));
  }
});
export {
  V as default
};
//# sourceMappingURL=PlProgressCell.vue.js.map
