mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
2 lines
3.0 KiB
JavaScript
2 lines
3.0 KiB
JavaScript
"use strict";(self.webpackChunkchainlist=self.webpackChunkchainlist||[]).push([[223],{8223:function(e,t,n){n.r(t),n.d(t,{renderImageToString:function(){return v},swapPlaceholderImage:function(){return h}});var o,r=n(15861),i=n(87757),a=n.n(i),c=n(93723),u=n(67294),l=n(97762),s=(n(74811),new WeakMap),d=navigator.connection||navigator.mozConnection||navigator.webkitConnection,g=["image","loading","isLoading","isLoaded","imgClassName","imgStyle","objectPosition","backgroundColor","objectFit"];function f(e,t){e.style.opacity="1",t&&(t.style.opacity="0")}function b(e,t,n,o,r,i){var a=e.querySelector("[data-main-image]"),c=e.querySelector("[data-placeholder-image]"),u=n.has(t);function l(e){var t=this;this.removeEventListener("load",l);var n=e.currentTarget,o=new Image;o.src=n.currentSrc,o.decode?o.decode().then((function(){f(t,c),null==r||r({wasCached:u})})).catch((function(e){f(t,c),null==i||i(e)})):(f(this,c),null==r||r({wasCached:u}))}return a.addEventListener("load",l),null==o||o({wasCached:u}),Array.from(a.parentElement.children).forEach((function(e){var t=e.getAttribute("data-src"),n=e.getAttribute("data-srcset");t&&(e.removeAttribute("data-src"),e.setAttribute("src",t)),n&&(e.removeAttribute("data-srcset"),e.setAttribute("srcset",n))})),n.add(t),a.complete&&l.call(a,{currentTarget:a}),function(){a&&a.removeEventListener("load",l)}}function h(e,t,i,u,l,g,f){if(!(0,c.h)()){var h,v,m,w=(j=function(){h=b(e,t,i,l,g,f)},"IntersectionObserver"in window?(o||(o=new IntersectionObserver((function(e){e.forEach((function(e){var t;e.isIntersecting&&(null==(t=s.get(e.target))||t(),s.delete(e.target))}))}),{rootMargin:"4g"!==(null==d?void 0:d.effectiveType)||null!=d&&d.saveData?"2500px":"1250px"})),function(e){return s.set(e,j),o.observe(e),function(){o&&e&&(s.delete(e),o.unobserve(e))}}):function(){return j(),function(){}}),p=w(e);return"objectFit"in document.documentElement.style||(e.dataset.objectFit=null!=(v=u.objectFit)?v:"cover",e.dataset.objectPosition=""+(null!=(m=u.objectPosition)?m:"50% 50%"),(y=(0,r.Z)(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0="objectFitPolyfill"in window,e.t0){e.next=4;break}return e.next=4,n.e(231).then(n.t.bind(n,27231,23));case 4:window.objectFitPolyfill(t);case 5:case"end":return e.stop()}}),e)}))),function(e){return y.apply(this,arguments)})(e)),function(){h&&h(),p()}}var y,j;return b(e,t,i,l,g,f)}function v(e){var t=e.image,n=e.loading,o=void 0===n?"lazy":n,r=e.isLoading,i=e.isLoaded,a=e.imgClassName,s=e.imgStyle,d=void 0===s?{}:s,f=e.objectPosition,b=e.backgroundColor,h=e.objectFit,v=void 0===h?"cover":h,m=(0,c._)(e,g),w=t.width,p=t.height,y=t.layout,j=t.images,k=t.placeholder,C=t.backgroundColor;return d=(0,c.a)({objectFit:v,objectPosition:f,backgroundColor:b},d),(0,l.renderToStaticMarkup)(u.createElement(c.L,{layout:y,width:w,height:p},u.createElement(c.P,(0,c.a)({},(0,c.g)(k,i,y,w,p,C,v,f))),u.createElement(c.M,(0,c.a)({},m,{width:w,height:p,className:a},(0,c.b)(r,i,j,o,d)))))}}}]);
|
|
//# sourceMappingURL=223-846a696ca68b440ba1b8.js.map
|