import{s as n}from"./index-BxIwIJfy.js";import{w as i,n as u,a as c}from"./vue-core-Di3IuVqe.js";function p(r){const t=c(null),a=()=>n.state.tabs.currentTabId===r.value;return i(()=>n.state.tabs.currentTabId,e=>{if(!t.value||e!==r.value)return;const s=t.value;t.value=null,u(()=>setTimeout(s,300))}),{focusApresInsertion:e=>{typeof e=="function"&&(a()?setTimeout(e,300):t.value=e)},ligneCibleOccupee:e=>!!e&&(String(e.code_art||"").trim()!==""||String(e.origine||"").trim()!==""||Number(e.nligne_origine)>0),ramenerDocumentDevant:async()=>{if(a())return;const e=n.state.tabs.tabs.find(s=>s.id===r.value);e&&n.dispatch("tabs/changerCurent",e),await u()}}}export{p as u};
