import{a6 as x,bD as C,bA as E}from"./index-BKKvzUDD.js";const s=new Map;if(E){let e;document.addEventListener("mousedown",t=>e=t),document.addEventListener("mouseup",t=>{if(e){for(const n of s.values())for(const{documentHandler:a}of n)a(t,e);e=void 0}})}function l(e,t){let n=[];return x(t.arg)?n=t.arg:C(t.arg)&&n.push(t.arg),function(a,o){const c=t.instance.popperRef,r=a.target,d=o==null?void 0:o.target,i=!t||!t.instance,f=!r||!d,p=e.contains(r)||e.contains(d),h=e===r,g=n.length&&n.some(u=>u==null?void 0:u.contains(r))||n.length&&n.includes(d),v=c&&(c.contains(r)||c.contains(d));i||f||p||h||g||v||t.value(a,o)}}const m={beforeMount(e,t){s.has(e)||s.set(e,[]),s.get(e).push({documentHandler:l(e,t),bindingFn:t.value})},updated(e,t){s.has(e)||s.set(e,[]);const n=s.get(e),a=n.findIndex(c=>c.bindingFn===t.oldValue),o={documentHandler:l(e,t),bindingFn:t.value};a>=0?n.splice(a,1,o):n.push(o)},unmounted(e){s.delete(e)}};export{m as C};
