!function(){"use strict";function e(e){var t;e.doneEach(function(e){t&&t.detach(),t=i("img:not(.emoji):not([data-no-zoom])")})}var t=Object.assign||function(e){for(var t,o=1;ox.scrollOffset&&z(150)}},k=function(e){i.includes(e.keyCode||e.which)&&z()},C=function(){var e=Math.min;if(O.template){var t=window.innerWidth,o=window.innerHeight,n=t-2*x.margin,i=o-2*x.margin,r=O.zoomedHd||O.template,d=r.naturalWidth,a=void 0===d?n:d,m=r.naturalHeight,c=void 0===m?i:m,l=r.getBoundingClientRect(),s=l.top,u=l.left,p=l.width,f=l.height,v=e(a,n)/p,h=e(c,i)/f,g=e(v,h)||1,y=((n-p)/2-u+x.margin)/g,z=((i-f)/2-s+x.margin)/g,E="scale("+g+") translate3d("+y+"px, "+z+"px, 0)";O.zoomed.style.transform=E,O.zoomedHd&&(O.zoomedHd.style.transform=E)}},x={margin:s,background:p,scrollOffset:v,metaClick:void 0===h||h};e instanceof Object&&t(x,e);var T=function(e){try{return Array.isArray(e)?e.filter(r):a(e)?[].concat(o(e)).filter(r):m(e)?[e].filter(r):"string"==typeof e?[].concat(o(document.querySelectorAll(e))).filter(r):[].concat(o(document.querySelectorAll(n.map(function(e){return e.toLowerCase()}).join(",")))).filter(d)}catch(e){throw new TypeError("The provided selector is invalid.\nExpects a CSS selector, a Node element, a NodeList, an HTMLCollection or an array.\nSee: https://github.com/francoischalifour/medium-zoom")}}(e),A=function(e){var t=document.createElement("div");return t.classList.add("medium-zoom-overlay"),t.style.backgroundColor=e,t}(x.background),O={template:null,zoomed:null,zoomedHd:null},N=0,S=!1;return T.forEach(function(e){e.classList.add("medium-zoom-image"),e.addEventListener("click",w)}),A.addEventListener("click",z),document.addEventListener("scroll",H),document.addEventListener("keyup",k),window.addEventListener("resize",z),{show:E,hide:z,toggle:E,update:function(){var e=0