let t=1e3;const e={value:0};function a(){return++t}function o(){e.value++;if(e.value===1){document.body.style.overflow="hidden"}}function s(){e.value=Math.max(0,e.value-1);if(e.value===0){document.body.style.overflow=""}}function c(t,e,a,o="bottom",s=8){const{top:c,left:f,width:r,height:n}=t;const l=window.innerWidth;const p=window.innerHeight;let b;switch(o){case"top":b={top:c-a-s,left:f+r/2-e/2};break;case"top-start":b={top:c-a-s,left:f};break;case"top-end":b={top:c-a-s,left:f+r-e};break;case"bottom":b={top:c+n+s,left:f+r/2-e/2};break;case"bottom-start":b={top:c+n+s,left:f};break;case"bottom-end":b={top:c+n+s,left:f+r-e};break;case"left":b={top:c+n/2-a/2,left:f-e-s};break;case"left-start":b={top:c,left:f-e-s};break;case"left-end":b={top:c+n-a,left:f-e-s};break;case"right":b={top:c+n/2-a/2,left:f+r+s};break;case"right-start":b={top:c,left:f+r+s};break;case"right-end":b={top:c+n-a,left:f+r+s};break;default:b={top:c+n+s,left:f}}b.top=Math.max(4,Math.min(b.top,p-a-4));b.left=Math.max(4,Math.min(b.left,l-e-4));return b}export{c,a as g,o as l,s as u};
//# sourceMappingURL=p-ecce2b5e.js.map