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