text: /*!
   *   TypeScript Image Zoomer
   *   By Paweł Galias pawgalias@gmail.com
   *   Copyright (c)
   * 
   *   Version: 0.1.0
   *   Last update: 18 Feb 2017
   * 
   *   Usage:
   *   iv.init(query, options);
   * 
   *   Available options:
   *   @param {string} overlayColor - background-color of image overlay (default: #444)
   *   @param {string} easing - Image zooming css-valid easing function (default: linear)
   * 
   *   Every img tag can contain a data-iv-caption attribute with string value which is a caption of image and its displaying after zoom.
   * 
   *   Changelog:
   *   0.1.0
   *     + pre release
   */
  !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("iv",[],e):"object"==typeof exports?exports.iv=e():t.iv=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){n(15),t.exports=n(40)},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,e,n){t.exports=!n(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on  "+t);return t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(26),o=n(31);t.exports=n(3)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(19);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(9),o=n(6);t.exports=function(t){return r(o(t))}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){"use strict";function n(t){return document.getElementById(t)}function r(t){return document.getElementsByClassName(t)[0]}function o(t){return document.getElementsByTagName(t)[0]}function i(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=document),e?n.querySelectorAll(t):n.querySelector(t)}function c(t){return Array.prototype.slice.call(t)}e.byId=n,e.byClass=r,e.byTag=o,e.byQuery=i,e.convertNodeToArray=c},function(t,e,n){"use strict";function r(t){var e=t.offsetLeft-t.scrollLeft+t.clientLeft,n=t.offsetTop-t.scrollTop+t.clientTop;return{x:e,y:n}}function o(t){var e=t.offsetWidth,n=t.offsetHeight;return{x:e,y:n}}function i(){var t=window,e=document.documentElement,n=f.byTag("body"),r=t.innerWidth||e.clientWidth||n.clientWidth,o=t.innerHeight||e.clientHeight||n.clientHeight;return{x:r,y:o}}function c(){var t=window,e=document.documentElement,n=(t.pageXOffset||e.scrollLeft)-(e.clientLeft||0)||0,r=(t.pageYOffset||e.scrollTop)-(e.clientTop||0)||0;return{x:n,y:r}}function u(t,e){Object.assign(t.style,e)}function a(t){t.removeAttribute("style")}function s(t,e,n,r){void 0===r&&(r=!1),t.addEventListener?t.addEventListener(e,n,r):t.attachEvent&&t.attachEvent("on"+e,n)}var f=n(13);e.elementPosition=r,e.elementSizes=o,e.documentSize=i,e.scrollPosition=c,e.assignStyles=u,e.removeStyles=a,e.eventHandler=s},function(t,e,n){n(39),t.exports=n(2).Object.assign},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(5);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(11),o=n(36),i=n(35);t.exports=function(t){return function(e,n,c){var u,a=r(e),s=o(a.length),f=i(c,s);if(t&&n!=n){for(;s>f;)if(u=a[f++],u!=u)return!0}else for(;s>f;f++)if((t||f in a)&&a[f]===n)return t||f||0;return!t&&-1}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(16);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(5),o=n(1).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(1),o=n(2),i=n(8),c=n(32),u=n(20),a="prototype",s=function(t,e,n){var f,l,p,v,d=t&s.F,m=t&s.G,y=t&s.S,h=t&s.P,g=t&s.B,x=m?r:y?r[e]||(r[e]={}):(r[e]||{})[a],b=m?o:o[e]||(o[e]={}),O=b[a]||(b[a]={});m&&(n=e);for(f in n)l=!d&&x&&void 0!==x[f],p=(l?x:n)[f],v=g&&l?u(p,r):h&&"function"==typeof p?u(Function.call,p):p,x&&c(x,f,p,t&s.U),b[f]!=p&&i(b,f,v),h&&O[f]!=p&&(O[f]=p)};r.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e,n){t.exports=!n(3)&&!n(4)(function(){return 7!=Object.defineProperty(n(21)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";var r=n(29),o=n(27),i=n(30),c=n(37),u=n(9),a=Object.assign;t.exports=!a||n(4)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=a({},t)[n]||Object.keys(a({},e)).join("")!=r})?function(t,e){for(var n=c(t),a=arguments.length,s=1,f=o.f,l=i.f;a>s;)for(var p,v=u(arguments[s++]),d=f?r(v).concat(f(v)):r(v),m=d.length,y=0;m>y;)l.call(v,p=d[y++])&&(n[p]=v[p]);return n}:a},function(t,e,n){var r=n(17),o=n(24),i=n(38),c=Object.defineProperty;e.f=n(3)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(7),o=n(11),i=n(18)(!1),c=n(33)("IE_PROTO");t.exports=function(t,e){var n,u=o(t),a=0,s=[];for(n in u)n!=c&&r(u,n)&&s.push(n);for(;e.length>a;)r(u,n=e[a++])&&(~i(s,n)||s.push(n));return s}},function(t,e,n){var r=n(28),o=n(22);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(1),o=n(8),i=n(7),c=n(12)("src"),u="toString",a=Function[u],s=(""+a).split(u);n(2).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,u){var a="function"==typeof n;a&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(a&&(i(n,c)||o(n,c,t[e]?""+t[e]:s.join(String(e)))),t===r?t[e]=n:u?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,u,function(){return"function"==typeof this&&this[c]||a.call(this)})},function(t,e,n){var r=n(34)("keys"),o=n(12);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(1),o="__core-js_shared__",i=r[o]||(r[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e,n){var r=n(10),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e)}},function(t,e,n){var r=n(10),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(6);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(5);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(23);r(r.S+r.F,"Object",{assign:n(25)})},function(t,e,n){"use strict";function r(t,e){s=new f.default(t,e),l.eventHandler(window,"scroll",i),l.eventHandler(window,"touchstart",c),l.eventHandler(window,"keyup",a)}function o(){s.closeCurrent()}function i(){p===-1&&(p=window.pageYOffset),Math.abs(p-window.pageYOffset)>=40&&o()}function c(t){var e=t.touches[0];null!=e&&(v=e.pageY,l.eventHandler(t.target,"touchmove",u))}function u(t){var e=t.touches[0];null!=e&&Math.abs(e.pageY-v)>10&&(o(),t.target.removeEventListener("touchmove",u))}function a(t){var e=[27,38,40],n=t.which||t.keyCode;e.indexOf(n)>-1&&o()}var s,f=n(42),l=n(14),p=-1,v=-1;e.init=r,e.closeCurrent=o},function(t,e){"use strict";var n=function(){function t(t){this.element=t,this.zoomed=!1}return Object.defineProperty(t.prototype,"zoom",{get:function(){return this.zoomed},set:function(t){this.zoomed=t},enumerable:!0,configurable:!0}),t.prototype.calculateSizes=function(){var t=this.element.naturalWidth,e=this.element.naturalHeight,n=this.element.width,r=this.element.height;return{x:n,y:r,nx:t,ny:e}},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,n){"use strict";var r=n(43),o=n(13),i=n(44),c=n(14),u=n(41),a=function(){function t(e,n){void 0===n&&(n={});var r=this;this.overlayEvent=function(){r.zoomOut(r.current)},this.elements=[],this.options=Object.assign({},t.defaults,n),this.zoomed=!1;var i=o.convertNodeToArray(o.byQuery(e,!0));i.forEach(function(t){return r.elements.push(new u.default(t))}),this.elements.forEach(function(t){"IMG"!==t.element.tagName&&"img"!==t.element.tagName||c.eventHandler(t.element,"click",function(){return r.clickHandler(t)})})}return t.prototype.zoomIn=function(t){var e=this.calculateTranslate(),n=e.tx,r=e.ty,u=e.tz,a="translate3d("+n+"px, "+r+"px, "+u+"px)",s="scale("+this.calculateScale()+")";c.assignStyles(t.element,{position:"relative",transform:a+" "+s,transitionTimingFunction:this.options.easing,zIndex:666}),i.insertInto({content:'<div class="iv-overlay"><p class="iv-caption">Caption</p></div>',element:!1,parent:document.body,place:"f"});var f=o.byQuery("div.iv-overlay");c.eventHandler(f,"click",this.overlayEvent),c.assignStyles(f,{backgroundColor:this.options.overlayColor,zIndex:600});var l=t.element.getAttribute("data-iv-caption");l&&setTimeout(function(){var t=o.byQuery("p.iv-caption");t.innerText=l,c.assignStyles(t,{transform:"translate3d(0,0,0)"})},50),this.zoomed=!0,t.zoom=!t.zoom},t.prototype.zoomOut=function(t){c.assignStyles(t.element,{position:"static",transform:"translate3d(0,0,0) scale(1)",zIndex:1});var e=o.byQuery("div.iv-overlay");e.removeEventListener("click",this.overlayEvent),r.removeElement(e),this.zoomed=!1,t.zoom=!t.zoom},t.prototype.closeCurrent=function(){this.zoomed&&this.zoomOut(this.current)},t.prototype.clickHandler=function(t){var e=t;this.currentImg=this.elements.indexOf(e);var n=this.elements[this.currentImg].calculateSizes(),r=n.x,o=n.nx,i=n.y,c=n.ny;r<o&&i<c&&(e.zoom?this.zoomOut(e):this.zoomIn(e))},t.prototype.calculateScale=function(){var t=this.elements[this.currentImg],e=t.calculateSizes(),n=e.nx,r=e.ny,o=t.calculateSizes().x,i=c.documentSize(),u=i.x,a=i.y,s=n/r,f=u/a,l=n/o;return n<u&&r<a?l:s<f?a/r*l:u/n*l},t.prototype.calculateTranslate=function(){var t=this.elements[this.currentImg].element,e=c.elementPosition(t),n=e.x,r=e.y,o=c.elementSizes(t),i=o.x,u=o.y,a=c.scrollPosition().y,s=c.documentSize(),f=s.x,l=s.y,p=f/2-i/2-n,v=a+l/2-(r+u/2),d=0;return{tx:p,ty:v,tz:d}},Object.defineProperty(t.prototype,"current",{get:function(){return this.elements[this.currentImg]},enumerable:!0,configurable:!0}),t}();a.defaults={easing:"linear",onDisable:function(){return 0},onExpand:function(){return 0},onInit:function(){return 0},overlayColor:"#444",scrollable:!0},Object.defineProperty(e,"__esModule",{value:!0}),e.default=a},function(t,e){"use strict";function n(t){return document.createElement(t)}function r(t){document.body.removeChild(t)}e.createElement=n,e.removeElement=r},function(t,e){"use strict";function n(t){var e=t.content,n=t.element,o=t.parent,i=t.place,c=r(i);n?o.insertAdjacentElement(c,e):o.insertAdjacentHTML(c,e)}function r(t){var e={a:"afterend",b:"beforebegin",f:"afterbegin",l:"beforeend"};return e[t]}e.insertInto=n}])});