import { m as l } from "./memoize-C3Z21RQJ.js";
import { b6 as c, e as p } from "./template-rpthWlT9.js";
import { r as i, bi as u, gI as o, bk as b, __tla as __tla_0 } from "./index-9PRMimni.js";
import { g as a } from "./equipmentMainLibrary-bJTzj5mC.js";
let j, C, r, q, s, N, v, _, h, S;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    let m;
    r = i(!1);
    s = i([]);
    m = l(async (e)=>{
        try {
            r.value = !0;
            const t = await c(e);
            return o(t, (n)=>({
                    label: n.productName,
                    value: n.equipmentId,
                    raw: n
                }));
        } catch (t) {
            return console.error("Error fetching equipment:", t), [];
        } finally{
            r.value = !1;
        }
    }, (e)=>JSON.stringify(e));
    async function y(e) {
        if (!e?.productName || !e?.productName?.length) {
            s.value = [];
            return;
        }
        const t = await m({
            ...e
        });
        s.value = t;
    }
    let f, O;
    q = u(y, 500);
    v = b();
    f = await a("pms_frequency");
    h = o(f, (e)=>({
            label: e.label,
            labelEn: e.labelEn,
            value: +e.value,
            raw: e
        }));
    O = await p({
        roleType: 2,
        roleCategory: 1
    });
    j = o(O, (e)=>({
            label: e.name,
            labelEn: e.shortNameEn,
            value: e.id,
            raw: e
        }));
    N = await a("pms_job_priority");
    C = await a("job_cycling_pattern");
    S = [
        {
            label: "是",
            labelEn: "YES",
            value: !0
        },
        {
            label: "否",
            labelEn: "NO",
            value: !1
        }
    ];
    _ = function(e) {
        if (!e?.newPlan) return {};
        const { newPlan: t } = e;
        return {
            ...t,
            cyclingPattern: t.cyclingPattern ? t.cyclingPattern + "" : null,
            jobPriority: t.jobPriority ? t.jobPriority + "" : null
        };
    };
});
export { j as P, C as a, r as b, q as d, s as e, N as j, v as l, _ as s, h as t, S as y, __tla };
