!function(){"use strict";function t(t,i){var s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!s){if(Array.isArray(t)||(s=function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var s=Object.prototype.toString.call(t).slice(8,-1);"Object"===s&&t.constructor&&(s=t.constructor.name);if("Map"===s||"Set"===s)return Array.from(t);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return e(t,i)}(t))||i&&t&&"number"==typeof t.length){s&&(t=s);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,l=!1;return{s:function(){s=s.call(t)},n:function(){var t=s.next();return o=t.done,t},e:function(t){l=!0,a=t},f:function(){try{o||null==s.return||s.return()}finally{if(l)throw a}}}}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=new Array(e);i\n\t\t\t\t\t\t').concat(i.props.computed_width," x ").concat(i.props.computed_height,'px\n\t\t\t\t\t\t\n\t\t\t\t\t\t').concat(i.props.real_width," × ").concat(i.props.real_height,'px\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
').concat(r,"
\n\t\t\t\t"),document.getElementById("smush-image-bar-items-"+t).appendChild(n)}))},toggleDivs:function(){var t=this;["bigger","smaller"].forEach((function(e){var i=document.getElementById("smush-image-bar-items-"+e);0===t.images[e].length?i.style.display="none":i.style.display="block"}))},highlightImage:function(t){this.removeSelection();var e=document.getElementsByClassName(t.currentTarget.dataset.image);void 0!==e[0]&&(t.currentTarget.classList.toggle("show-description"),e[0].scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),e[0].style.opacity="0.5",setTimeout((function(){e[0].style.opacity="1"}),1e3))},handleToggleClick:function(){this.bar.classList.toggle("closed"),this.toggle.classList.toggle("closed"),this.removeSelection()},removeSelection:function(){var t=document.getElementsByClassName("show-description");t.length>0&&Array.from(t).forEach((function(t){return t.classList.remove("show-description")}))},detectImages:function(){var e,i=t(document.getElementsByTagName("img"));try{for(i.s();!(e=i.n()).done;){var s=e.value;if(!this.shouldSkipImage(s)){var n={real_width:s.clientWidth,real_height:s.clientHeight,computed_width:s.naturalWidth,computed_height:s.naturalHeight,bigger_width:1.5*s.clientWidths.naturalWidth,smaller_height:s.clientHeight>s.naturalHeight};if(n.bigger_width||n.bigger_height||n.smaller_width||n.smaller_height){var r=n.bigger_width||n.bigger_height?"bigger":"smaller",a="smush-image-"+(this.images[r].length+1);this.images[r].push({src:s,props:n,class:a}),s.classList.add("smush-detected-img"),s.classList.add(a)}}}}catch(t){i.e(t)}finally{i.f()}},refresh:function(){for(var t in this.images.bigger)this.images.bigger.hasOwnProperty(t)&&(this.images.bigger[t].src.classList.remove("smush-detected-img"),this.images.bigger[t].src.classList.remove("smush-image-"+ ++t));for(var e in this.images.smaller)this.images.smaller.hasOwnProperty(e)&&(this.images.smaller[e].src.classList.remove("smush-detected-img"),this.images.smaller[e].src.classList.remove("smush-image-"+ ++e));this.images={bigger:[],smaller:[]};for(var i=document.getElementsByClassName("smush-resize-box");i.length>0;)i[0].remove();this.process()}},window.addEventListener("DOMContentLoaded",(function(){return i.init()})),window.addEventListener("lazyloaded",(function(){return i.refresh()}))}(); //# sourceMappingURL=smush-rd.min.js.map