import{top as t,left as e,bottom as o,right as r}from"../enums.js";import a from"../dom-utils/getOffsetParent.js";import s from"../dom-utils/getWindow.js";import i from"../dom-utils/getDocumentElement.js";import n from"../dom-utils/getComputedStyle.js";import p from"../utils/getBasePlacement.js";var l={top:"auto",right:"auto",bottom:"auto",left:"auto"};function m(n){var p,m=n.popper,c=n.popperRect,f=n.placement,d=n.offsets,u=n.position,g=n.gpuAcceleration,b=n.adaptive,h=function(t){var e=t.x,o=t.y,r=window.devicePixelRatio||1;return{x:Math.round(e*r)/r||0,y:Math.round(o*r)/r||0}}(d),j=h.x,O=h.y,v=d.hasOwnProperty("x"),y=d.hasOwnProperty("y"),w=e,x=t,S=window;if(b){var D=a(m);D===s(m)&&(D=i(m)),f===t&&(x=o,O-=D.clientHeight-c.height,O*=g?1:-1),f===e&&(w=r,j-=D.clientWidth-c.width,j*=g?1:-1)}var P,C=Object.assign({position:u},b&&l);return g?Object.assign(Object.assign({},C),{},((P={})[x]=y?"0":"",P[w]=v?"0":"",P.transform=(S.devicePixelRatio||1)<2?"translate("+j+"px, "+O+"px)":"translate3d("+j+"px, "+O+"px, 0)",P)):Object.assign(Object.assign({},C),{},((p={})[x]=y?O+"px":"",p[w]=v?j+"px":"",p.transform="",p))}var c={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,o=t.options,r=o.gpuAcceleration,a=void 0===r||r,s=o.adaptive,i=void 0===s||s;if("production"!==process.env.NODE_ENV){var l=n(e.elements.popper).transitionProperty||"";i&&["transform","top","right","bottom","left"].some((function(t){return l.indexOf(t)>=0}))&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',"\n\n",'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.","\n\n","We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var c={placement:p(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:a};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign(Object.assign({},e.styles.popper),m(Object.assign(Object.assign({},c),{},{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:i})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign(Object.assign({},e.styles.arrow),m(Object.assign(Object.assign({},c),{},{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1})))),e.attributes.popper=Object.assign(Object.assign({},e.attributes.popper),{},{"data-popper-placement":e.placement})},data:{}};export default c;export{m as mapToStyles};
//# sourceMappingURL=computeStyles.js.map
