import { ref as x, defineComponent as Q, computed as h, resolveComponent as U, openBlock as d, createElementBlock as _, createVNode as g, withModifiers as se, withCtx as $, createElementVNode as t, toDisplayString as a, unref as r, Fragment as O, createTextVNode as H, createCommentVNode as L, createBlock as M, renderList as ne, normalizeClass as E, normalizeStyle as ae, Teleport as X } from "vue";
import { u as le, _ as re } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-sUxHOj47.js";
import { m as ie, u as J, a as Z } from "./app-Bpb4394e.js";
import { useSnackbar as q, useBreakpoints as ce } from "@feedmepos/ui-library";
import { _ as ue } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-j3aDZ2cT.js";
import { useCoreStore as ee, useI18n as te } from "@feedmepos/mf-common";
import { b as Y } from "./date2-DpnYOzUg.js";
import { d as j } from "./number-BVg7EKPV.js";
import { F as de } from "./FmAdminBadge-DjnBAgyv.js";
import { P as me, J as fe } from "./app-DiX-EfV6.js";
const oe = ie((D, C) => {
  const i = J(), v = ee();
  return {
    async getLatestCostForAllSkus(o) {
      var m;
      const f = ((m = v.currentBusiness.value) == null ? void 0 : m._id) ?? "", c = `${D.inventoryBackendUrl}/${f}/api/unit-cost-history?locationId=${encodeURIComponent(o)}`;
      return await C.get(c);
    },
    async recalculate(o) {
      var m;
      const f = ((m = v.currentBusiness.value) == null ? void 0 : m._id) ?? "", c = `${D.inventoryBackendUrl}/${f}/api/unit-cost-history/recalculate`;
      return await C.post(c, o);
    },
    async getJobStatus(o) {
      var m;
      const f = ((m = v.currentBusiness.value) == null ? void 0 : m._id) ?? "", c = `${D.inventoryBackendUrl}/${f}/api/unit-cost-history/jobs/${o}`;
      return await C.get(c);
    },
    async listRecentRecalculationRequests() {
      var m, B;
      const o = (m = i._currentLocation) == null ? void 0 : m.dbName;
      if (!o) return [];
      const f = ((B = v.currentBusiness.value) == null ? void 0 : B._id) ?? "", c = `${D.inventoryBackendUrl}/${f}/api/unit-cost-history/recalculation-requests?location=${encodeURIComponent(o)}`;
      return await C.get(c);
    }
  };
});
function ye() {
  const D = oe(), C = J(), i = x([]), v = x(!1);
  async function o() {
    if (!C._currentLocation)
      return [];
    v.value = !0;
    try {
      const f = C.currentLocation.doc._id, c = await D.getLatestCostForAllSkus(f);
      return i.value = c, c;
    } finally {
      v.value = !1;
    }
  }
  return {
    historyData: i,
    isLoading: v,
    fetchHistory: o
  };
}
const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col gap-16" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, be = { class: "flex flex-col gap-8" }, _e = { class: "fm-typo-en-body-md-600" }, he = { class: "flex flex-col gap-8" }, xe = { class: "fm-typo-en-body-md-600" }, Ce = {
  key: 0,
  class: "text-red-500 text-sm mt-2"
}, ke = { class: "fm-typo-en-body-sm-400" }, Se = {
  key: 1,
  class: "flex flex-col gap-8"
}, we = { class: "fm-typo-en-body-md-600" }, De = { class: "flex flex-col gap-8 max-h-[300px] overflow-y-auto" }, Ae = { class: "flex items-center justify-between" }, $e = { class: "fm-typo-en-body-sm-600" }, Ie = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Re = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Fe = {
  key: 0,
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
}, Le = {
  key: 1,
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
}, Ue = {
  key: 2,
  class: "fm-typo-en-body-xs-400 text-fm-color-system-error-500"
}, Be = {
  key: 0,
  class: "flex gap-8 ml-auto"
}, Ne = {
  key: 1,
  class: "flex gap-8 ml-auto"
}, Ve = /* @__PURE__ */ Q({
  __name: "UnitCostRecalculationDialog",
  emits: ["submitted"],
  setup(D, { expose: C, emit: i }) {
    const v = i, { t: o } = te(), f = oe(), c = q(), m = ee(), B = J(), k = x(!1), s = x(""), n = x(""), b = x(!1), I = x([]), V = x(!1), A = h(() => {
      if (!s.value || !n.value) return "";
      const y = new Date(s.value).getTime();
      return new Date(n.value).getTime() <= y ? o("inventory.unitCost.recalculation.error.endDateBeforeStart") : "";
    }), R = h(() => !!s.value && !!n.value && !A.value), S = h(() => I.value.some(
      (y) => !y.completedAt && !y.failedReason
    ));
    async function T() {
      k.value = !0, await K();
      const y = /* @__PURE__ */ new Date();
      n.value = y.toISOString().split("T")[0];
      const u = new Date(y.getFullYear(), 0, 1);
      s.value = u.toISOString().split("T")[0];
    }
    function P() {
      k.value = !1;
    }
    C({
      open: T,
      close: P
    });
    async function K() {
      V.value = !0;
      try {
        const y = await f.listRecentRecalculationRequests();
        I.value = y;
      } catch (y) {
        console.error("Error fetching recalculation requests:", y);
      } finally {
        V.value = !1;
      }
    }
    async function W() {
      var y, u;
      if (R.value) {
        b.value = !0;
        try {
          const w = ((y = m.currentBusiness.value) == null ? void 0 : y._id) ?? "", N = ((u = B._currentLocation) == null ? void 0 : u.dbName) ?? "";
          if (!w)
            throw new Error("No active business selected");
          if (!N)
            throw new Error("No active location selected");
          await f.recalculate({
            businessId: w,
            locationId: N,
            startDate: s.value,
            endDate: n.value
          }), c.open({
            title: o("common.success"),
            message: o("inventory.unitCost.recalculation.successMessage"),
            type: "success"
          }), await K(), k.value = !1, v("submitted");
        } catch (w) {
          console.error("Error scheduling recalculation:", w), c.open({
            title: o("common.error"),
            message: o("inventory.unitCost.recalculation.errorMessage"),
            type: "error"
          });
        } finally {
          b.value = !1;
        }
      }
    }
    return (y, u) => {
      const w = U("FmButton"), N = U("FmDatePicker"), G = U("FmAlert"), l = U("FmDialog");
      return d(), _("div", null, [
        g(w, {
          "prepend-icon": "info",
          variant: "tertiary",
          onClick: se(T, ["stop"])
        }),
        g(l, {
          modelValue: k.value,
          "onUpdate:modelValue": u[4] || (u[4] = (e) => k.value = e),
          "close-button": "",
          dismissAway: "",
          "max-width": "600px"
        }, {
          "dialog-header": $(() => [
            t("div", pe, a(r(o)("inventory.unitCost.recalculation.title")), 1)
          ]),
          "dialog-footer": $(() => [
            S.value ? (d(), _("div", Ne, [
              g(w, {
                variant: "tertiary",
                onClick: u[3] || (u[3] = (e) => k.value = !1),
                label: r(o)("common.close")
              }, null, 8, ["label"])
            ])) : (d(), _("div", Be, [
              g(w, {
                variant: "tertiary",
                onClick: u[2] || (u[2] = (e) => k.value = !1),
                disabled: b.value,
                label: r(o)("common.cancel")
              }, null, 8, ["disabled", "label"]),
              g(w, {
                variant: "primary",
                onClick: W,
                disabled: !R.value || b.value,
                loading: b.value,
                label: r(o)("inventory.unitCost.recalculation.schedule")
              }, null, 8, ["disabled", "loading", "label"])
            ]))
          ]),
          default: $(() => [
            t("div", ve, [
              t("div", ge, a(r(o)("inventory.unitCost.recalculation.description")), 1),
              S.value ? L("", !0) : (d(), _(O, { key: 0 }, [
                t("div", be, [
                  t("p", _e, [
                    H(a(r(o)("inventory.unitCost.recalculation.startDate")) + " ", 1),
                    u[5] || (u[5] = t("span", { class: "text-fm-color-system-error-300" }, "*", -1))
                  ]),
                  g(N, {
                    modelValue: s.value,
                    "onUpdate:modelValue": u[0] || (u[0] = (e) => s.value = e),
                    placeholder: r(o)("inventory.unitCost.recalculation.selectStartDate"),
                    disabled: b.value
                  }, null, 8, ["modelValue", "placeholder", "disabled"])
                ]),
                t("div", he, [
                  t("p", xe, [
                    H(a(r(o)("inventory.unitCost.recalculation.endDate")) + " ", 1),
                    u[6] || (u[6] = t("span", { class: "text-fm-color-system-error-300" }, "*", -1))
                  ]),
                  g(N, {
                    modelValue: n.value,
                    "onUpdate:modelValue": u[1] || (u[1] = (e) => n.value = e),
                    placeholder: r(o)("inventory.unitCost.recalculation.selectEndDate"),
                    disabled: !s.value || b.value,
                    min: s.value
                  }, null, 8, ["modelValue", "placeholder", "disabled", "min"]),
                  A.value ? (d(), _("div", Ce, a(A.value), 1)) : L("", !0)
                ]),
                s.value && n.value && !A.value ? (d(), M(G, {
                  key: 0,
                  type: "info"
                }, {
                  default: $(() => [
                    t("div", ke, a(r(o)("inventory.unitCost.recalculation.info")), 1)
                  ]),
                  _: 1
                })) : L("", !0)
              ], 64)),
              I.value.length > 0 ? (d(), _("div", Se, [
                t("p", we, a(r(o)("inventory.unitCost.recalculation.recentRequests")), 1),
                t("div", De, [
                  (d(!0), _(O, null, ne(I.value, (e) => (d(), _("div", {
                    key: e._id,
                    class: "p-12 border border-fm-color-border-primary rounded-8 flex flex-col gap-4"
                  }, [
                    t("div", Ae, [
                      t("div", $e, a(r(o)("inventory.unitCost.recalculation.requestedAt")) + ": " + a(new Date(e.createdAt).toLocaleString()), 1),
                      t("div", {
                        class: E(["fm-typo-en-body-xs-600 px-8 py-4 rounded-4", {
                          "bg-fm-color-system-error-100 text-fm-color-system-error-500": e.failedReason,
                          "bg-fm-color-system-success-100 text-fm-color-system-success-500": e.completedAt,
                          "bg-fm-color-system-info-100 text-fm-color-system-info-500": !e.failedReason && !e.completedAt
                        }])
                      }, a(e.failedReason ? r(o)("inventory.unitCost.recalculation.status.failed") : e.completedAt ? r(o)("inventory.unitCost.recalculation.status.completed") : r(o)("inventory.unitCost.recalculation.status.inProgress")), 3)
                    ]),
                    t("div", Ie, a(r(o)("inventory.unitCost.recalculation.from")) + ": " + a(new Date(e.recalculateStartDate).toLocaleDateString()), 1),
                    t("div", Re, a(r(o)("inventory.unitCost.recalculation.to")) + ": " + a(new Date(e.recalculateEndDate).toLocaleDateString()), 1),
                    e.createdBy ? (d(), _("div", Fe, a(r(o)("inventory.unitCost.recalculation.requestedBy")) + ": " + a(e.createdBy.name || e.createdBy._id), 1)) : L("", !0),
                    e.completedAt ? (d(), _("div", Le, a(r(o)("inventory.unitCost.recalculation.completedAt")) + ": " + a(new Date(e.completedAt).toLocaleString()), 1)) : L("", !0),
                    e.failedReason ? (d(), _("div", Ue, a(e.failedReason), 1)) : L("", !0)
                  ]))), 128))
                ])
              ])) : L("", !0)
            ])
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]);
    };
  }
}), Te = {
  key: 0,
  class: "flex flex-col gap-24"
}, Me = { class: "flex flex-col gap-8" }, ze = { class: "flex flex-col gap-5" }, He = { class: "flex flex-col gap-4" }, Ee = { class: "fm-typo-en-body-lg-600 flex gap-2" }, Pe = { class: "flex flex-col gap-4" }, Ke = { class: "fm-typo-en-body-lg-600 flex gap-2" }, Oe = { class: "flex flex-col gap-4" }, Ye = { class: "fm-typo-en-body-lg-600 flex gap-2" }, je = { class: "flex flex-col gap-4" }, Je = { class: "fm-typo-en-body-lg-600" }, We = { class: "flex flex-col gap-4" }, Ge = { class: "fm-typo-en-body-lg-600" }, Qe = { class: "flex flex-col gap-4" }, Xe = { class: "fm-typo-en-body-lg-600" }, Ze = { class: "flex flex-col gap-4" }, qe = { class: "fm-typo-en-body-lg-600" }, et = { class: "flex flex-col gap-8" }, tt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary whitespace-pre-wrap" }, ot = { class: "flex gap-4" }, st = /* @__PURE__ */ Q({
  __name: "UnitCostDetailsSideSheet",
  props: {
    record: {}
  },
  setup(D, { expose: C }) {
    const i = D, v = Z(), o = x(!1), f = h(() => {
      var s;
      return (s = i.record) != null && s.skuId ? v.skus.find((n) => n._id === i.record.skuId) : null;
    }), c = h(() => {
      if (!i.record || !i.record.previousCost) return null;
      const s = i.record.previousCost.amount, b = i.record.cost.amount - s;
      return {
        amount: Math.abs(b),
        precision: i.record.cost.precision,
        currency: i.record.cost.currency,
        isIncrease: b > 0
      };
    }), m = h(() => i.record ? {
      default: "Default",
      weightedAverage: "Weighted Average (WAVG)",
      netsuite: "NetSuite",
      "netsuite-average": "NetSuite Average"
    }[i.record.mechanism] || i.record.mechanism : "");
    h(() => {
      var s;
      return !((s = i.record) != null && s.meta) || i.record.mechanism !== "netsuite" ? null : i.record.meta;
    });
    function B() {
      o.value = !0;
    }
    function k() {
      o.value = !1;
    }
    return C({
      open: B,
      close: k
    }), (s, n) => {
      const b = U("FmMenuDivider"), I = U("FmCard"), V = U("FmButton"), A = U("FmSideSheet");
      return d(), M(A, {
        "model-value": o.value,
        "onUpdate:modelValue": n[0] || (n[0] = (R) => o.value = R),
        header: "Unit Cost History Details",
        "close-button": "",
        "dismiss-away": "",
        "max-width": 500
      }, {
        "side-sheet-footer": $(() => [
          t("div", ot, [
            g(V, {
              variant: "tertiary",
              onClick: k,
              label: "Close"
            })
          ])
        ]),
        default: $(() => [
          s.record ? (d(), _("div", Te, [
            g(I, {
              variant: "outlined",
              class: "flex flex-col gap-8 px-12 py-16"
            }, {
              default: $(() => {
                var R, S;
                return [
                  n[8] || (n[8] = t("div", { class: "flex justify-between" }, [
                    t("div", { class: "fm-typo-en-body-lg-600" }, "Details")
                  ], -1)),
                  g(b),
                  t("div", Me, [
                    t("div", ze, [
                      t("div", He, [
                        n[1] || (n[1] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Ingredient Code", -1)),
                        t("div", Ee, a((R = f.value) == null ? void 0 : R.code), 1)
                      ]),
                      t("div", Pe, [
                        n[2] || (n[2] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Ingredient Name", -1)),
                        t("div", Ke, a((S = f.value) == null ? void 0 : S.name), 1)
                      ]),
                      t("div", Oe, [
                        n[3] || (n[3] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "New Cost", -1)),
                        t("div", Ye, [
                          H(a(r(j)(s.record.cost, !0, s.record.cost.precision)) + " ", 1),
                          c.value ? (d(), _("div", {
                            key: 0,
                            class: E(["fm-typo-en-body-md-600 flex items-center gap-4", {
                              "text-fm-color-system-success-500": c.value.isIncrease,
                              "text-fm-color-system-error-500": !c.value.isIncrease
                            }])
                          }, [
                            t("span", {
                              class: E({
                                "text-red-500": c.value.isIncrease,
                                "text-green-600": !c.value.isIncrease
                              })
                            }, a(c.value.isIncrease ? "↑" : "↓"), 3),
                            t("span", {
                              class: E({
                                "text-red-500": c.value.isIncrease,
                                "text-green-600": !c.value.isIncrease
                              })
                            }, a(c.value.isIncrease ? "Increase" : "Decrease"), 3)
                          ], 2)) : L("", !0)
                        ])
                      ]),
                      t("div", je, [
                        n[4] || (n[4] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Previous Cost", -1)),
                        t("div", Je, a(s.record.previousCost ? r(j)(
                          s.record.previousCost,
                          !0,
                          s.record.previousCost.precision
                        ) : "-"), 1)
                      ]),
                      t("div", We, [
                        n[5] || (n[5] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Mechanism", -1)),
                        t("div", Ge, a(m.value), 1)
                      ]),
                      t("div", Qe, [
                        n[6] || (n[6] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Snapshot At", -1)),
                        t("div", Xe, a(r(Y)(new Date(s.record.snapshotAt))) + " " + a(new Date(s.record.snapshotAt).toLocaleTimeString()), 1)
                      ]),
                      t("div", Ze, [
                        n[7] || (n[7] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Updated At", -1)),
                        t("div", qe, [
                          s.record.updatedAt ? (d(), _(O, { key: 0 }, [
                            H(a(r(Y)(new Date(s.record.updatedAt))) + " " + a(new Date(s.record.updatedAt).toLocaleTimeString()), 1)
                          ], 64)) : (d(), _(O, { key: 1 }, [
                            H("-")
                          ], 64))
                        ])
                      ])
                    ])
                  ])
                ];
              }),
              _: 1
            }),
            g(de, null, {
              default: $(() => [
                g(I, {
                  variant: "outlined",
                  class: "flex flex-col gap-8 px-12 py-16"
                }, {
                  default: $(() => [
                    n[9] || (n[9] = t("div", { class: "flex justify-between" }, [
                      t("div", { class: "fm-typo-en-body-lg-600" }, "Raw data")
                    ], -1)),
                    g(b),
                    t("div", et, [
                      t("pre", tt, a(JSON.stringify(s.record, null, 2)) + `
`, 1)
                    ])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ])) : L("", !0)
        ]),
        _: 1
      }, 8, ["model-value"]);
    };
  }
}), yt = /* @__PURE__ */ Q({
  __name: "UnitCostHistoryView",
  setup(D) {
    const { t: C } = te(), i = J(), v = Z(), o = q(), f = le(), { breakpoints: c } = ce(), m = h(() => c.value.xs || c.value.sm), B = h(() => m.value ? 10 : 20), k = x(), s = x(), n = x(null), { historyData: b, isLoading: I, fetchHistory: V } = ye(), A = x(""), R = h(() => [
      {
        type: "string",
        key: "skuCode",
        entity: "sku",
        values: v.skus.map((e) => e.code)
      },
      {
        type: "string",
        key: "skuName",
        entity: "sku",
        values: v.skus.map((e) => e.name)
      },
      {
        type: "string",
        key: "mechanism",
        entity: "sku",
        values: ["weightedAverage", "netsuite", "netsuite-average"]
      }
    ]), S = x(null);
    i.watchLocation(T);
    async function T() {
      if (i._currentLocation)
        try {
          await V();
        } catch (l) {
          o.open({
            title: "Error",
            message: "Failed to fetch unit cost history. Please try again.",
            type: "error"
          }), console.error("Error fetching unit cost history:", l);
        }
    }
    const P = h(() => {
      const l = /* @__PURE__ */ new Map();
      for (const e of v.skus)
        l.set(e._id, e);
      return l;
    }), K = h(() => {
      let l = b.value;
      if (S.value) {
        const e = me.build(S.value);
        l = l.filter((p) => {
          const F = P.value.get(p.skuId);
          return fe(
            {
              skuCode: (F == null ? void 0 : F.code) ?? p.skuId,
              skuName: (F == null ? void 0 : F.name) ?? p.skuId,
              mechanism: p.mechanism
            },
            e
          );
        });
      }
      return l.map((e) => {
        const p = P.value.get(e.skuId);
        return {
          ...e,
          skuCode: (p == null ? void 0 : p.code) ?? e.skuId,
          skuName: (p == null ? void 0 : p.name) ?? "Unknown SKU"
        };
      });
    }), W = h(() => [
      {
        accessorKey: "snapshotAt",
        header: () => "Snapshot At",
        cell: (l) => {
          const e = new Date(l.row.original.snapshotAt);
          return Y(e) + " " + e.toLocaleTimeString();
        },
        enableSorting: !0,
        size: 180
      },
      {
        accessorKey: "skuCode",
        header: () => "SKU Code",
        enableSorting: !0,
        size: 150
      },
      {
        accessorKey: "skuName",
        header: () => "SKU Name",
        enableSorting: !0,
        size: "auto"
      },
      {
        accessorKey: "previousCost",
        header: () => "Previous Cost",
        cell: (l) => {
          const e = l.row.original.previousCost;
          return e ? j(e, !1, e.precision) : "-";
        },
        enableSorting: !1,
        size: 150
      },
      {
        accessorKey: "cost",
        header: () => "Current Cost",
        cell: (l) => {
          const e = l.row.original.cost;
          return e ? j(e, !1, e.precision) : "-";
        },
        enableSorting: !1,
        size: 150
      },
      {
        accessorKey: "mechanism",
        header: () => "Mechanism",
        cell: (l) => {
          const e = l.row.original.mechanism;
          return {
            default: "Default",
            weightedAverage: "Weighted Average",
            netsuite: "NetSuite",
            "netsuite-average": "NetSuite Average"
          }[e] ?? e;
        },
        enableSorting: !0,
        size: 150
      },
      {
        accessorKey: "updatedAt",
        header: () => "Updated At",
        cell: (l) => {
          const e = l.row.original.updatedAt;
          if (!e) return "-";
          const p = new Date(e);
          return Y(p) + " " + p.toLocaleTimeString();
        },
        enableSorting: !0,
        size: 180
      }
    ]), y = h(() => [
      {
        label: "Recalculate Cost History",
        value: "recalculate",
        isPrimary: !0,
        prependIcon: "calculate",
        isAdminOnly: !0
      },
      {
        label: C("inventory.common.refresh"),
        value: "refresh"
      }
    ]);
    function u() {
      var l;
      (l = k.value) == null || l.open();
    }
    function w() {
      T();
    }
    function N(l) {
      var e;
      n.value = l, (e = s.value) == null || e.open();
    }
    function G(l) {
      switch (l) {
        case "recalculate":
          return u();
        case "refresh":
          return T();
      }
    }
    return (l, e) => {
      const p = U("FmTable");
      return d(), M(re, {
        title: "Unit Cost History",
        actions: y.value,
        "onClick:action": G
      }, {
        default: $(() => {
          var F;
          return [
            t("div", {
              class: E([
                "flex flex-col gap-8 max-h-full",
                {
                  "p-0": m.value,
                  "px-24": !m.value
                }
              ])
            }, [
              g(ue, {
                searchable: "",
                "change-location": "",
                search: A.value,
                "onUpdate:search": e[0] || (e[0] = (z) => A.value = z),
                filterable: "",
                "filter-attributes": R.value,
                filter: S.value,
                "onUpdate:filter": e[1] || (e[1] = (z) => S.value = z)
              }, null, 8, ["search", "filter-attributes", "filter"]),
              (d(), M(p, {
                key: `${(F = r(i)._currentLocation) == null ? void 0 : F.dbName}-${JSON.stringify(S.value)}`,
                style: ae(r(f).tableHeight),
                "column-defs": W.value,
                "row-data": K.value,
                "search-value": A.value,
                loading: r(I) || !r(i)._currentLocation,
                "page-size": B.value,
                onRowClick: e[2] || (e[2] = (z) => N(z.original))
              }, null, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
            ], 2),
            (d(), M(X, { to: "body" }, [
              g(Ve, {
                ref_key: "recalculationDialogRef",
                ref: k,
                onSubmitted: w
              }, null, 512)
            ])),
            (d(), M(X, { to: "body" }, [
              g(st, {
                ref_key: "detailsSideSheetRef",
                ref: s,
                record: n.value
              }, null, 8, ["record"])
            ]))
          ];
        }),
        _: 1
      }, 8, ["actions"]);
    };
  }
});
export {
  yt as default
};
