import{_ as p}from"./ButtonDefault-CzWpVlv6.js";import{_ as f}from"./IconHelp-wlsb2dRe.js";import{u as v}from"./global-BK91p1BE.js";import{_ as C}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as b,l as I,D,o as S,c as g,b as r,a as d}from"./index-Bb2UEb_P.js";const k={class:"modal__body"},y={__name:"ModalWindowDeleteContract",props:{data:{type:Object,default:()=>{}}},emits:["modalClose"],setup(c,{emit:i}){const a=c,_=i,n=v(),o=b(!1);function s(){o.value=!0,n.deleteItem({TableID:"Contracts",RowsIDs:a.data?.contractID}).then(({result:t})=>{t==="SUCCESS"&&n.deleteItem({TableID:"Profiles",RowsIDs:a.data?.id}).then(({result:e})=>{e==="SUCCESS"&&_("modalClose")}),o.value=!1})}const l=t=>{t.key==="Enter"&&s()};return I(()=>{document.addEventListener("keyup",l)}),D(()=>{document.removeEventListener("keyup",l)}),(t,e)=>{const m=f,u=p;return S(),g("div",k,[r(m,{class:"modal__alert-icon tw-size-6"}),e[1]||(e[1]=d("div",{class:"modal__info"},[d("div",{class:"modal__alert-title"},"Вы действительно хотите удалить договор?")],-1)),r(u,{class:"modal__alert-button",onClick:e[0]||(e[0]=E=>s()),label:"УДАЛИТЬ","is-loading":o.value},null,8,["is-loading"])])}}},U=C(y,[["__scopeId","data-v-012cc473"]]);export{U as default};
