-
Notifications
You must be signed in to change notification settings - Fork 1
/
min.js
1 lines (1 loc) · 3.72 KB
/
min.js
1
!function(){"use strict";function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function o(t,e,n){return(o=p()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&l(o,n.prototype),o}).apply(null,arguments)}function f(t){var r="function"==typeof Map?new Map:void 0;return(f=function(t){if(null===t||(e=t,-1===Function.toString.call(e).indexOf("[native code]")))return t;var e;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,n)}function n(){return o(t,arguments,u(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),l(n,t)})(t)}function s(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}var a,d,h,g,n,y,m,t=window,e=t.customElements,v=t.getComputedStyle,r=t.IntersectionObserver,b="with-preview";e.get(b)||(m=a=function(t){t.src=t.src.replace(/\.preview(\.jpe?g(?:\?.*)?)$/,"$1")},r&&(d={once:!0},h=function(t){var e=t.target;e.addEventListener("transitionend",n,d),e.style.opacity=1},g=function(t){var e,n,r,o=t.target,i=o.parentElement;i.tagName.toLowerCase()===b&&(n=(e=v(o)).width,r=e.height,i.style.cssText+=";width:"+n+";height:"+r,y.observe(o.nextSibling))},n=function(t){var e=t.target,n=e.parentElement;n.parentElement.replaceChild(e,n)},y=new r(function(t){for(var e=0,n=t.length;e<n;e++){var r=t[e],o=r.isIntersecting,i=r.target;o&&(y.unobserve(i),i.addEventListener("load",h,d),a(i))}},{threshold:.2}),m=function(t){var e,n,r,o,i,a,c,u,l;t.dataset.preview||(t.dataset.preview=1,n=(e=v(t)).marginTop,r=e.marginRight,o=e.marginBottom,i=e.marginLeft,a=t.height,c=t.parentElement,u=document.createElement(b),l=t.cloneNode(!0),u.style.cssText=";margin-top:"+n+";margin-right:"+r+";margin-bottom:"+o+";margin-left:"+i,c.replaceChild(u,t),u.appendChild(t),u.appendChild(l),a?g({target:t}):t.addEventListener("load",g,d))},function(t){for(var e="string"==typeof t?[t]:[t[0]],n=1,r=arguments.length;n<r;n++)e.push(arguments[n],t[n]);var o=document.createElement("style");o.type="text/css",o.appendChild(document.createTextNode(e.join(""))),document.head.appendChild(o)}(b+"{position:relative;display:inline-block;padding:0;}"+b+">img{position:absolute;top:0;left:0;margin:0;}"+b+">img:last-child{opacity:0;transition:opacity 1s ease-in;will-change:opacity;}")),e.define(b,function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(a,f(HTMLImageElement));var n,r,t,e,o,i=(n=a,r=p(),function(){var t,e=u(n);return s(this,r?(t=u(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))});function a(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(e=[{key:"connectedCallback",value:function(){m(this)}}])&&c(t.prototype,e),o&&c(t,o),a}(),{extends:"img"}))}();