import"./nestable2-CeBHq76U-v4.7.11.js";window.admin.removeSubmitButtonOffsetOn("#image");$("#type").on("change",e=>{$(".link-field").addClass("hide"),$(`.${e.currentTarget.value}-field`).removeClass("hide")});$(".dd").nestable({maxDepth:15});$(".dd").on("change",()=>{axios.put("/menus/items/order",$(".dd").nestable("serialize")[0],{headers:{"Content-Type":"application/json; charset=utf-8"}}).then(()=>{success(trans("menu::messages.menu_items_order_updated"))}).catch(e=>{e(e.response.data.message)})});let t,a=$("#confirmation-modal");$(".delete-menu-item").on("click",e=>{t=$(e.currentTarget).closest(".dd-item").data("id"),a.modal("show")});a.find("form").on("submit",e=>{e.preventDefault(),a.modal("hide"),axios.delete(`/menus/items/${t}`).then(()=>{success(trans("menu::messages.menu_item_deleted")),$(`.dd-item[data-id="${t}"]`).fadeOut()}).catch(s=>{s(s.response.data.message)})});
