"use strict";(self.webpackChunkdevelop=self.webpackChunkdevelop||[]).push([[507],{3207:function(t,e,i){function n(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return i.forEach((function(e){return Object.keys(e).forEach((function(i){return t[i]=e[i]}))})),t}i.r(e),i.d(e,{default:function(){return u}});var s={position:"relative",overflow:"hidden"},o={position:"absolute",top:"0",right:"0",bottom:"0",left:"0"},r={minHeight:"100%",minWidth:"100%"},a={height:"100%",width:"100%",border:"none",opacity:0,zIndex:-1,pointerEvents:"none"},h={debounceTime:17,updateOnWindowResize:!0,updateOnContainerResize:!1,containerPosition:"relative"},c=function(){function t(t,e){var i,a,c,u=this;void 0===e&&(e={}),this.imageNode=t,this.listening=!1,this.setFocus=function(t){u.focus=t,u.img.setAttribute("data-focus-x",t.x.toString()),u.img.setAttribute("data-focus-y",t.y.toString()),u.applyShift()},this.applyShift=function(){var t=u.img,e=t.naturalWidth,i=t.naturalHeight,n=u.container.getBoundingClientRect(),s=n.width,o=n.height,r="0",a="0";if(!(s>0&&o>0&&e>0&&i>0))return!1;var h=e/s,c=i/o;u.img.style.maxHeight=null,u.img.style.maxWidth=null,e>s&&i>o&&(u.img.style[h>c?"maxHeight":"maxWidth"]="100%"),h>c?r=u.calcShift(c,s,e,u.focus.x)+"%":h<c&&(a=u.calcShift(h,o,i,u.focus.y,!0)+"%"),u.img.style.top=a,u.img.style.left=r},this.options=n(h,e),this.img=t,this.container=t.parentElement,this.img.__focused_image_instance__&&(this.img.__focused_image_instance__.stopListening(),this.img.removeEventListener("load",this.applyShift)),this.img.__focused_image_instance__=this,this.img.addEventListener("load",this.applyShift),n(this.container.style,s),this.container.style.position=this.options.containerPosition,n(this.img.style,r,o),this.debounceApplyShift=(i=this.applyShift,a=this.options.debounceTime,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];clearTimeout(c),c=setTimeout((function(){return i.apply(void 0,e)}),a)}),this.focus=this.options.focus?this.options.focus:{x:parseFloat(this.img.getAttribute("data-focus-x"))||0,y:parseFloat(this.img.getAttribute("data-focus-y"))||0},this.startListening(),this.setFocus(this.focus)}var e=t.prototype;return e.startListening=function(){var t=this;if(!this.listening&&(this.listening=!0,this.options.updateOnWindowResize&&window.addEventListener("resize",this.debounceApplyShift),this.options.updateOnContainerResize)){var e=document.createElement("object");n(e.style,a,o),e.addEventListener("load",(function(i){return e.contentDocument.defaultView.addEventListener("resize",(function(){return t.debounceApplyShift()}))})),e.type="text/html",e.setAttribute("aria-hidden","true"),e.tabIndex=-1,this.container.appendChild(e),e.data="about:blank",this.resizeListenerObject=e}},e.stopListening=function(){this.listening&&(this.listening=!1,window.removeEventListener("resize",this.debounceApplyShift),this.resizeListenerObject&&this.resizeListenerObject.contentDocument&&(this.resizeListenerObject.contentDocument.defaultView.removeEventListener("resize",this.debounceApplyShift),this.container.removeChild(this.resizeListenerObject),this.resizeListenerObject=null))},e.calcShift=function(t,e,i,n,s){var o=Math.floor(e/2),r=(n+1)/2,a=Math.floor(i/t),h=Math.floor(r*a);s&&(h=a-h);var c=h-o,u=a-h,l=e-o;return u<l&&(c-=l-u),c<0&&(c=0),-100*c/e},t}(),u=function(t){t.style.visibility="visible",new c(t)}}}]);