import{f as a}from"./Caret.eeb84d06.js";import{n as o}from"./vueComponentNormalizer.67c9b86e.js";var i=function(){var t=this,n=t.$createElement,e=t._self._c||n;return t.canShow?e("img",{attrs:{src:t.src}}):t._e()},c=[];const u={props:{src:String,tag:{type:String,default(){return"img"}},debounce:{type:Boolean,default(){return!0}}},data(){return{canShow:!1,images:{}}},watch:{src(){if(this.debounce){a(this.maybeShowImage,50);return}this.maybeShowImage()},canShow(t){this.$emit("can-show",t)},images:{handler:function(){this.$emit("images",this.images)},deep:!0}},methods:{async maybeShowImage(){if(this.canShow=!1,!this.src)return;if(this.images[this.src]){this.canShow=!0;return}const t=new Image;t.onload=await(()=>{this.canShow=!0;let n=0;const e=t.width,s=t.height;e&&s&&(n=e/s),!this.images[this.src]&&this.$set(this.images,this.src,{image:t,ratio:n,vertical:e>s})}),t.onerror=await(()=>{this.canShow=!1}),t.src=this.src}},mounted(){this.maybeShowImage()}},r={};var h=o(u,i,c,!1,l,null,null,null);function l(t){for(let n in r)this[n]=r[n]}const f=function(){return h.exports}();export{f as B};
