1 |
- !function(){function r(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,n){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var o,t,i,a,l=[],u=!0,c=!1;try{if(i=(e=e.call(r)).next,0===n){if(Object(e)!==e)return;u=!1}else for(;!(u=(o=i.call(e)).done)&&(l.push(o.value),l.length!==n);u=!0);}catch(f){c=!0,t=f}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw t}}return l}}(r,e)||function(r,e){if(!r)return;if("string"==typeof r)return n(r,e);var o=Object.prototype.toString.call(r).slice(8,-1);"Object"===o&&r.constructor&&(o=r.constructor.name);if("Map"===o||"Set"===o)return Array.from(r);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(r,e)}(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(r,n){(null==n||n>r.length)&&(n=r.length);for(var e=0,o=new Array(n);e<n;e++)o[e]=r[e];return o}System.register(["./index-legacy-64376843.js"],(function(n,e){"use strict";var o,t,i,a,l,u,c,f,s,d,v,g,y,h,m,b,p,w,S,j,z;return{setters:[function(r){o=r.j,t=r.d,i=r.i,a=r.b7,l=r.E,u=r.G,c=r.ay,f=r.w,s=r.z,d=r.l,v=r.o,g=r.y,y=r.g,h=r.t,m=r.v,b=r.n,p=r.az,w=r.b8,S=r.m,j=r.I,z=r.D}],execute:function(){var e=r(o("image"),2),I=e[0],x=e[1],A={src:String,alt:String,fit:String,position:String,round:Boolean,block:Boolean,width:h,height:h,radius:h,lazyLoad:Boolean,iconSize:h,showError:m,errorIcon:b("photo-fail"),iconPrefix:String,showLoading:m,loadingIcon:b("photo")},E=t({name:I,props:A,emits:["load","error"],setup:function(r,n){var e=n.emit,o=n.slots,t=i(!1),h=i(!0),m=i(),b=a().proxy.$Lazyload,z=l((function(){var n={width:u(r.width),height:u(r.height)};return c(r.radius)&&(n.overflow="hidden",n.borderRadius=u(r.radius)),n}));f((function(){return r.src}),(function(){t.value=!1,h.value=!0}));var I=function(r){h.value&&(h.value=!1,e("load",r))},A=function(){var r=new Event("load");Object.defineProperty(r,"target",{value:m.value,enumerable:!0}),I(r)},E=function(r){t.value=!0,h.value=!1,e("error",r)},L=function(n,e,o){return o?o():y(j,{name:n,size:r.iconSize,class:e,classPrefix:r.iconPrefix},null)},$=function(){if(!t.value&&r.src){var n={alt:r.alt,class:x("img"),style:{objectFit:r.fit,objectPosition:r.position}};return r.lazyLoad?p(y("img",S({ref:m},n),null),[[w("lazy"),r.src]]):y("img",S({ref:m,src:r.src,onLoad:I,onError:E},n),null)}},O=function(r){var n=r.el,e=function(){n===m.value&&h.value&&A()};m.value?e():g(e)},P=function(r){r.el!==m.value||t.value||E()};return b&&s&&(b.$on("loaded",O),b.$on("error",P),d((function(){b.$off("loaded",O),b.$off("error",P)}))),v((function(){g((function(){var r;(null==(r=m.value)?void 0:r.complete)&&A()}))})),function(){var n;return y("div",{class:x({round:r.round,block:r.block}),style:z.value},[$(),h.value&&r.showLoading?y("div",{class:x("loading")},[L(r.loadingIcon,x("loading-icon"),o.loading)]):t.value&&r.showError?y("div",{class:x("error")},[L(r.errorIcon,x("error-icon"),o.error)]):void 0,null==(n=o.default)?void 0:n.call(o)])}}});n("I",z(E))}}}))}();
|