"use strict";var common=require("./common.js");const handleMouseMove=(e,t)=>{let o=t?.hoverEffect==="zoom"&&t?.zoomType==="default",r=t?.hoverEffect==="zoom"&&t?.zoomType==="glasses",l=t?.hoverEffect==="other",i=t?.hoverEffect!=="none";if(!i)return;let s=e.currentTarget.querySelector("img"),n=e.currentTarget.querySelector("img.hover-image"),c=e.currentTarget.querySelector(".room-len"),y=s?.getBoundingClientRect(),h=s?.clientWidth||0,a=s?.clientHeight||0,f=common.convertUnitToNumber(t?.zoom,0),p=!f||f<100?1:f/100||1,u=(h||1)*(t?.hoverEffect==="other"?1:p),m=(a||1)*(t?.hoverEffect==="other"?1:p),g=e.clientX-y?.x,d=e.clientY-y?.y;l&&displayOtherImage({featureImageHoverDom:n}),o&&e.clientX>=y?.x&&e.clientX<=y.right&&e.clientY>=y?.y&&e.clientY<=y.bottom&&displayZoomImage({featureImageDom:s,featureImageHoverDom:n,zoomSize:u,zoomSizeHeight:m,slideWidth:h,imageOffsetX:g,imageOffsetY:d,isEnableShowOtherImage:l}),r&&displayZoomLen({zoomLens:c,zoomSize:u,zoomValue:p,imagePosition:y,slideWidth:h,slideHeight:a,imageOffsetX:g,imageOffsetY:d})},displayOtherImage=({featureImageHoverDom:e})=>{e&&(e.style.opacity="1",e.style.top="0px",e.style.left="0px",e.style.width="100%",e.style.height="100%")},displayZoomLen=({zoomLens:e,zoomSize:t,zoomValue:o,slideWidth:r,slideHeight:l,imageOffsetX:i,imageOffsetY:s})=>{if(!e)return;e.style.opacity="1";let n=e.offsetWidth/2,c=e.offsetHeight/2,y=l||1;i>r-n/o&&(i=r-n/o),i<n/o&&(i=n/o),s>y-c/o&&(s=y-c/o),s<c/o&&(s=c/o),e.style.top=s-c+"px",e.style.left=i-n+"px",e.style.backgroundSize=t+"px "+y*o+"px",e.style.backgroundPosition=`-${i*o-n}px -${s*o-c}px`},displayZoomImage=({featureImageDom:e,featureImageHoverDom:t,zoomSize:o,zoomSizeHeight:r,slideWidth:l,imageOffsetX:i,imageOffsetY:s,isEnableShowOtherImage:n=!1})=>{if(!t)return;t.style.width=`${o}px`,n||(t.style.height=`${r}px`),t.style.opacity="1";let c=i/e?.offsetWidth,y=s/e?.offsetHeight;t.style.top=(e?.offsetHeight-t.offsetHeight)*y+"px",t.style.left=(l-o)*c+"px"},handleMouseOut=e=>{let t=e.currentTarget.querySelector("img.hover-image"),o=e.currentTarget.querySelector(".room-len");t&&(t.style.opacity="0"),o&&(o.style.opacity="0")};exports.handleMouseMove=handleMouseMove,exports.handleMouseOut=handleMouseOut;
