import { d as $, gF as x, gG as y, a4 as b, ay as B, ac as F, l as s, c as P, o as R, w as n, j as p, W as w, X as D, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as C } from "./BasicForm-dL_oCSPM.js";
import { c as G, __tla as __tla_1 } from "./schemas-C0ECnkWr.js";
import { u as j } from "./useForm-CKmgcynv.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./SingleImageUpload-CNx4b9eC.js";
import "./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";
import "./componentSetting-DVhNDBTO.js";
import "./ImageUpload-DUsnro3W.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";
import "./tabsView-BXskTdVh.js";
import "./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";
import "./propTypes-CebMRUpe.js";
import "./BasicSelect-C_uwzMkE.js";
import "./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";
import "./dictionary-BRse4lkf.js";
import "./index-DkvzUEqh.js";
import "./index-kKnqLkWM.js";
import "./AutoComplete-Dv1Bqed4.js";
import "./TreeSelect-BZh2DeCh.js";
import "./template-rpthWlT9.js";
import "./planner-BebmniHR.js";
import "./usePageCache-DluHn7Yy.js";
let to;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    to = $({
        __name: "ShipReferencePhotos",
        props: x({
            tabReadonly: {
                type: Boolean
            }
        }, {
            formData: {
                type: Object,
                default: ()=>({})
            },
            formDataModifiers: {}
        }),
        emits: [
            "update:formData"
        ],
        setup (m) {
            const c = m, a = y(m, "formData"), i = b(()=>c.tabReadonly), { photoSchemas: l, photoField: u } = G({
                photoReadonly: i,
                handleChangeValue: f
            }), [_, { setFieldsValue: h }] = j({
                schemas: l,
                labelWidth: "auto",
                layout: "horizontal",
                collapsed: !0,
                gridProps: {
                    cols: 5,
                    xGap: 15
                },
                showActionButtonGroup: !1
            });
            B(()=>a, ()=>{
                F(()=>{
                    d();
                });
            }, {
                immediate: !0,
                deep: !0
            });
            async function d() {
                const e = {};
                u.forEach((t)=>{
                    const r = t === "ship_other" ? 20 : 2;
                    e[`${t}_Photo`] = [];
                    for(let o = 1; o <= r; o++)s(a)[`${t}_${o}`] && e[`${t}_Photo`].push({
                        code: s(a)[`${t}_${o}`],
                        url: s(a)[`${t}_${o}_Photo`]
                    });
                }), h(e);
            }
            function f(e, t) {
                const r = t === "ship_other" ? 20 : 2;
                for(let o = 1; o <= r; o++)a.value[`${t}_${o}`] = e[o - 1] ? e[o - 1].code : "", a.value[`${t}_${o}_Photo`] = e[o - 1] ? e[o - 1].url : "";
            }
            return (e, t)=>{
                const r = C, o = w, g = D;
                return R(), P(g, null, {
                    default: n(()=>[
                            p(o, {
                                bordered: !1,
                                segmented: {
                                    content: !0
                                },
                                class: "proCard",
                                size: "small",
                                style: {
                                    "max-height": "650px",
                                    overflow: "auto"
                                }
                            }, {
                                default: n(()=>[
                                        p(r, {
                                            onRegister: s(_),
                                            "label-placement": "top"
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            })
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { to as default, __tla };
