import { ab as f, ac as N, ad as v, _ as L } from "./template-rpthWlT9.js";
import { r as t, V as y, bk as P, __tla as __tla_0 } from "./index-9PRMimni.js";
import { v as g, __tla as __tla_1 } from "./schemas-DzvLPsci.js";
import { d as S } from "./illnessInjury-CN3bQPcI.js";
let q, V;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: e } = y(), l = P(), F = await N(), I = await f();
    V = function() {
        const s = [
            {
                field: "vesselId",
                component: "NSelect",
                label: e("crewTraining.vessel"),
                componentProps: {
                    placeholder: e("crewTraining.vessel"),
                    options: g,
                    filterable: !0,
                    clearable: !0,
                    labelField: l.getLocale === "en" ? "shipNameEn" : "shipName",
                    valueField: "id"
                }
            },
            {
                field: "crewName",
                component: "NInput",
                label: e("crewTraining.crewName"),
                componentProps: {
                    placeholder: e("crewTraining.crewName")
                }
            },
            {
                field: "status",
                component: "NSelect",
                label: e("crewTraining.status"),
                componentProps: {
                    placeholder: e("crewTraining.status"),
                    options: I,
                    filterable: !0,
                    clearable: !0,
                    labelField: l.getLocale === "en" ? "labelEn" : "label"
                }
            }
        ], o = [
            {
                field: "trainingResult",
                component: "NSelect",
                label: e("crewTraining.trainingResult"),
                labelWidth: 100,
                giProps: {
                    span: 13
                },
                componentProps: {
                    placeholder: e("crewTraining.trainingResult"),
                    options: F,
                    filterable: !0,
                    clearable: !0,
                    labelField: l.getLocale === "en" ? "labelEn" : "label"
                },
                rules: [
                    {
                        required: !0,
                        message: e("crewTraining.trainingResult"),
                        trigger: [
                            "blur",
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "remark",
                component: "NInput",
                label: e("interview.remark"),
                labelWidth: 100,
                giProps: {
                    span: 13
                },
                componentProps: {
                    type: "textarea",
                    autosize: {
                        minRows: 2,
                        maxRows: 3
                    },
                    placeholder: e("interview.remark")
                }
            }
        ];
        return {
            schemas: s,
            examineAndApproveSchema: o
        };
    };
    q = function(s, o, u, m) {
        const c = t(), p = t(), d = t(), b = t(), r = t(!1), w = t(), h = [
            {
                field: "proposedShipId",
                component: "NSelect",
                label: e("crew.crewList.vesselName"),
                labelWidth: 100,
                giProps: {
                    span: 3
                },
                componentProps: {
                    placeholder: e("crew.crewList.vesselName"),
                    options: g,
                    disabled: !0,
                    filterable: !0,
                    clearable: !0,
                    labelField: l.getLocale === "en" ? "shipNameEn" : "shipName",
                    valueField: "id",
                    async onUpdateValue (a) {
                        s(a);
                    }
                },
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: e("crew.crewList.vesselName"),
                        trigger: [
                            "blur",
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "type",
                component: "NSelect",
                label: e("crewTraining.trainingType"),
                labelWidth: 100,
                giProps: {
                    span: 3
                },
                componentProps: {
                    placeholder: e("crewTraining.trainingType"),
                    disabled: r,
                    options: c,
                    labelField: l.getLocale === "en" ? "labelEn" : "label",
                    async onUpdateValue (a) {
                        o(a);
                    }
                },
                rules: [
                    {
                        required: !0,
                        message: e("crewTraining.trainingType"),
                        trigger: [
                            "blur",
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "trainingLocation",
                component: "NInput",
                label: e("crewTraining.trainingLocation"),
                labelWidth: 100,
                giProps: {
                    span: 3
                },
                componentProps: {
                    disabled: r,
                    placeholder: e("crewTraining.trainingLocation")
                }
            },
            {
                field: "applyDutyId",
                component: "NSelect",
                label: e("crewTraining.rank"),
                labelWidth: 120,
                giProps: {
                    span: 3
                },
                componentProps: {
                    options: p,
                    filterable: !0,
                    disabled: r,
                    clearable: !0,
                    valueField: "id",
                    labelField: l.getLocale === "en" ? "shortNameEn" : "name",
                    async onUpdateValue (a) {
                        u(a);
                    }
                },
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: e("crewTraining.rank"),
                        trigger: [
                            "blur",
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "seafarerId",
                component: "NSelect",
                label: e("crewTraining.crewName"),
                labelWidth: 100,
                giProps: {
                    span: 3
                },
                componentProps: {
                    options: d,
                    disabled: r,
                    filterable: !0,
                    clearable: !0,
                    labelField: l.getLocale === "en" ? "crewNameEn" : "crewName",
                    valueField: "crewId",
                    placeholder: e("crewTraining.crewName"),
                    async onUpdateValue (a) {
                        m(a, d.value);
                    }
                },
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: e("crewTraining.crewName"),
                        trigger: [
                            "blur",
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "remark",
                component: "NInput",
                label: e("crewTraining.remark"),
                labelWidth: 100,
                giProps: {
                    span: 9
                },
                componentProps: {
                    disabled: r,
                    placeholder: e("crewTraining.remark")
                }
            }
        ];
        return {
            methods: {
                updateTypeList: async (a)=>{
                    const i = await v("Other Training");
                    a === 1 ? (c.value = i.filter((n)=>n.value?.startsWith("1")), p.value = [
                        {
                            shortNameEn: "Master",
                            name: "船长",
                            id: 16
                        },
                        {
                            shortNameEn: "C/E",
                            name: "轮机长",
                            id: 20
                        }
                    ]) : (c.value = i.filter((n)=>n.value?.startsWith("2")), p.value = await L());
                },
                updateCrewNameList: async (a, i, n)=>{
                    b.value = a, w.value = n;
                    const T = await S({
                        vesselId: a,
                        rankId: i,
                        trainingType: n
                    });
                    d.value = T;
                },
                updateReadOnly: (a)=>{
                    r.value = a;
                }
            },
            schemasOtherTrainingBase: h,
            schemasUpload: [
                {
                    field: "fileDtoList",
                    label: "",
                    slot: "attachment"
                }
            ]
        };
    };
    e("crew.crewList.vesselType"), e("crew.crewList.vesselType"), g, l.getLocale, e("mdm.mou.uploadFile");
});
export { q as o, V as s, __tla };
