import{_ as i}from"./RecursiveComponent-DseVbEDa.js";import{u as d}from"./postings-CAwWnBGE.js";import{u}from"./invoices-DSyOyjgA.js";import{x as _,d as p,r as v,H as f,aw as I,U as h,c as y,o as w,a as S,b}from"./index-CmCGXBst.js";import{_ as x}from"./_plugin-vue_export-helper-DlAUqK2U.js";const B={class:"tw-overflow-y-auto tw-mt-6 md:tw-mt-0 modal__body"},D={class:"html__container",id:"html-container"},M={__name:"ModalWindowInvoiceDocument",props:{data:{type:Object,default:()=>{}}},setup(s){const e=s,o=_("emitter");d();const c=u(),r=p(),a=v(null);let n=null;async function l(){(await c.fetchInvoice(e.data.ID)).data.StatusID==="Payed"&&(o.emit("close-modal"),r.push("/Invoices"))}return f(()=>{a.value=e.data.html;const t=document.querySelector(".modal__close-modal-button");t&&(t.style.display="none"),n=setInterval(l,I)}),h(()=>{o.emit("close-modal"),clearInterval(n)}),(t,N)=>{const m=i;return w(),y("div",B,[S("div",D,[b(m,{data:a.value},null,8,["data"])])])}}},U=x(M,[["__scopeId","data-v-746ce5d6"]]);export{U as default};
