/*! NanoPop 1.3.0 MIT | https://github.com/Simonwep/nanopop */ let o=(()=>{class NanoPop{constructor(o,t,{positionFlipOrder:r=NanoPop.defaultPositionFlipOrder,variantFlipOrder:e=NanoPop.defaultVariantFlipOrder,container:n=document.documentElement.getBoundingClientRect(),forceApplyOnFailure:i=!1,margin:p=8,position:l="bottom-start"}={}){this.o={positionFlipOrder:r,variantFlipOrder:e,reference:o,popper:t,position:l,container:n,forceApplyOnFailure:i,margin:p}}update(o=this.o,t=!1){const{container:r,reference:e,popper:n,margin:i,position:p,forceApplyOnFailure:l,variantFlipOrder:s,positionFlipOrder:a}=this.o={...this.o,...o};n.style.left="0",n.style.top="0";const c=e.getBoundingClientRect(),f=n.getBoundingClientRect(),d={t:c.top-f.height-i,b:c.bottom+i,r:c.right+i,l:c.left-f.width-i},m={vm:-f.width/2+(c.left+c.width/2),vs:c.left,ve:c.left+c.width-f.width,hs:c.bottom-c.height,he:c.bottom-f.height,hm:c.bottom-c.height/2-f.height/2},[h,u="middle"]=p.split("-"),b=a[h],F=s[u],{top:O,left:v,bottom:N,right:P}=r;for(const o of b){const r="t"===o||"b"===o,e=d[o],[i,p]=r?["top","left"]:["left","top"],[l,s]=r?[f.height,f.width]:[f.width,f.height],[a,c]=r?[N,P]:[P,N],[h,u]=r?[O,v]:[v,O];if(t||!(ea))for(const l of F){const a=m[(r?"v":"h")+l];if(t||!(ac))return n.style[p]=a-f[p]+"px",n.style[i]=e-f[i]+"px",o+l}}return l?this.update(void 0,!0):null}}return NanoPop.version="1.3.0",NanoPop.defaultVariantFlipOrder={start:"sme",middle:"mse",end:"ems"},NanoPop.defaultPositionFlipOrder={top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},NanoPop})();export{o as NanoPop}; //# sourceMappingURL=nanopop.min.mjs.map