text: !function(e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():window.smoothImageZoom=e()}(function(){"use strict";function r(e){var o,t,n,i,r,c,a;!e&&this.classList.contains("zoomed")?(this.classList.remove("zoomed"),this.style.transform="",document.querySelector(".full-screen-image-backdrop").classList.remove("zoomed"),m(),s()):(e?o=this._originalImageCordinates:(o=h(this),this._originalImageCordinates=o),t=window.innerHeight/window.innerWidth,n=o.height/o.width<t?window.innerWidth/o.width:window.innerHeight/o.height,i=o.left+o.width/2,r=o.top+o.height/2,c=(window.innerWidth/2-i)/n,a=(window.innerHeight/2-r)/n,this.style.transform="scale("+n+") translate("+c+"px,"+a+"px) ",this.classList.add("zoomed"),document.querySelector(".full-screen-image-backdrop").classList.add("zoomed"),d(),l())}var t,n,i,e=!1,d=function(){document.addEventListener("scroll",o),document.addEventListener("keyup",a),document.querySelector(".full-screen-image-backdrop").addEventListener("click",c)},m=function(){document.removeEventListener("scroll",o),document.removeEventListener("keyup",a),document.querySelector(".full-screen-image-backdrop").removeEventListener("click",c)},l=function(){window.addEventListener("resize",u)},s=function(){window.removeEventListener("resize",u)},o=function(){document.querySelector(".zoomable-image.zoomed")&&!e&&r.call(document.querySelector(".zoomable-image.zoomed"))},c=function(){document.querySelector(".zoomable-image.zoomed")&&r.call(document.querySelector(".zoomable-image.zoomed"))},a=function(e){"Escape"===e.key&&document.querySelector(".zoomable-image.zoomed")&&r.call(document.querySelector(".zoomable-image.zoomed"))},u=function(){e=!0,g()},g=(t=function(){document.querySelector(".zoomable-image.zoomed")&&(r.call(document.querySelector(".zoomable-image.zoomed"),!0),e=!1)},n=100,function(){var e=this,o=arguments;clearTimeout(i),i=setTimeout(function(){t.apply(e,o)},n)}),h=function(e){var o=e.getBoundingClientRect();return{top:o.top,right:o.right,bottom:o.bottom,left:o.left,width:o.width,height:o.height,x:o.x,y:o.y}};return{init:function(){var e,o,t,n,i;document.addEventListener("click",function(e){e&&e.target&&e.target.className&&e.target.className.includes("zoomable-image")&&r.call(e.target)}),e=[".zoomable-image { max-width: 100%; height: auto; transition: transform 0.3s; cursor: zoom-in; }",".zoomable-image.zoomed { z-index: 100; position: relative; cursor: zoom-out;}",".full-screen-image-backdrop.zoomed { position: fixed; top: 0; right: 0; left: 0; bottom: 0; z-index: 50; background-color: rgba(255, 255, 255, 0.95); }"].join(" "),o=document.head||document.getElementsByTagName("head")[0],t=document.body||document.getElementsByTagName("body")[0],n=document.createElement("style"),i=document.createElement("div"),n.type="text/css",n.appendChild(document.createTextNode(e)),i.className="full-screen-image-backdrop",o.appendChild(n),t.appendChild(i)}}});