(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.hImagePerview={},r.Vue))})(this,function(r,e){"use strict";const k={xmlns:"http://www.w3.org/2000/svg",class:"icon",viewBox:"0 0 1024 1024"},V=[e.createElementVNode("path",{fill:"currentColor",d:"M723.8 1023H304.6c-75.9 0-137.6-61.7-137.6-137.6v-528c0-21 17-38 38-38s38 17 38 38v528c0 34 27.6 61.6 61.6 61.6h419.2c34 0 61.6-27.6 61.6-61.6v-528c0-21 17-38 38-38s38 17 38 38v528c0 75.9-61.8 137.6-137.6 137.6zm195.3-742H104c-21 0-38-17-38-38s17-38 38-38h815.1c21 0 38 17 38 38s-17 38-38 38z"},null,-1),e.createElementVNode("path",{fill:"currentColor",d:"M405 820c-21 0-38-17-38-38V492c0-21 17-38 38-38s38 17 38 38v290c0 21-17 38-38 38zm214.2 1c-21 0-38-17-38-38V493c0-21 17-38 38-38s38 17 38 38v290c0 21-17 38-38 38zm-332-545.1h-.4c-21-.2-37.8-17.4-37.6-38.4l1.1-92c.1-76 64.3-137.7 143.3-137.7h241c79 0 143.3 61.9 143.3 137.9v.4l-1.1 92.2c-.2 20.8-17.2 37.6-38 37.6h-.4c-21-.2-37.8-17.4-37.6-38.4l1.1-92c-.1-34-30.3-61.7-67.3-61.7h-241c-37.1 0-67.3 27.8-67.3 61.9v.4l-1.1 92.2c-.2 20.9-17.2 37.6-38 37.6z"},null,-1)];function B(n,o){return e.openBlock(),e.createElementBlock("svg",k,V)}const E={render:B},M={xmlns:"http://www.w3.org/2000/svg",class:"icon",viewBox:"0 0 1024 1024"},x=[e.createElementVNode("path",{fill:"currentColor",d:"M512 736a224 224 0 1 1 0-448 224 224 0 0 1 0 448zm0-64a160 160 0 1 0 0-320 160 160 0 0 0 0 320z"},null,-1),e.createElementVNode("path",{fill:"currentColor",d:"M512 864C323.232 864 154.144 751.264 5.44 529.856a32 32 0 0 1 0-35.712C154.144 272.704 323.2 160 512 160c188.768 0 357.856 112.736 506.56 334.144a32 32 0 0 1 0 35.712C869.856 751.296 700.8 864 512 864zm0-64c159.84 0 306.72-94.784 441.248-288C818.72 318.784 671.84 224 512 224c-159.84 0-306.72 94.784-441.248 288C205.28 705.216 352.16 800 512 800z"},null,-1)];function z(n,o){return e.openBlock(),e.createElementBlock("svg",M,x)}const N={render:z},v={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",class:"icon",viewBox:"0 0 1024 1024"},y=[e.createElementVNode("path",{fill:"currentColor",d:"M693.312 336H202.656A106.656 106.656 0 0 0 96 442.656v330.688A106.656 106.656 0 0 0 202.656 880h490.656A106.656 106.656 0 0 0 800 773.344V442.656A106.656 106.656 0 0 0 693.312 336zm-490.656 64h490.656C716.896 400 736 419.104 736 442.656v330.688C736 796.896 716.896 816 693.312 816H202.656A42.656 42.656 0 0 1 160 773.344V442.656C160 419.104 179.104 400 202.656 400z"},null,-1),e.createElementVNode("path",{fill:"currentColor",d:"M926.4 418.912c-64-191.2-200.128-284.256-401.216-274.176a32 32 0 0 0-27.552 45.152l4.928 8.64 47.968 79.68c16.064 26.72 54.4 16.64 59.232-12.864l9.088-52.672c118.176 18.208 198.08 89.504 243.36 216.416l3.52 10.144a32 32 0 0 0 60.672-20.32z"},null,-1)];function P(n,o){return e.openBlock(),e.createElementBlock("svg",v,y)}const S={render:P},D={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",class:"icon",viewBox:"0 0 1024 1024"},A=[e.createElementVNode("path",{fill:"currentColor",d:"M821.344 336H330.656A106.656 106.656 0 0 0 224 442.656v330.688A106.656 106.656 0 0 0 330.656 880h490.688A106.656 106.656 0 0 0 928 773.344V442.656A106.656 106.656 0 0 0 821.344 336zm-490.688 64h490.688C844.896 400 864 419.104 864 442.656v330.688C864 796.896 844.896 816 821.344 816H330.656A42.656 42.656 0 0 1 288 773.344V442.656C288 419.104 307.104 400 330.656 400z"},null,-1),e.createElementVNode("path",{fill:"currentColor",d:"M97.664 418.912c64-191.2 200.128-284.256 401.216-274.176a32 32 0 0 1 27.552 45.152l-4.928 8.64-47.968 79.68c-16.064 26.72-54.4 16.64-59.2-12.864l-9.12-52.672c-118.176 18.208-198.08 89.504-243.36 216.416l-3.52 10.144a32 32 0 0 1-60.672-20.32z"},null,-1)];function L(n,o){return e.openBlock(),e.createElementBlock("svg",D,A)}const I={render:L},O={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",class:"icon",viewBox:"0 0 1024 1024"},H=[e.createElementVNode("path",{fill:"currentColor",d:"M919.264 905.984 780.352 767.072C851.808 692.32 896 591.328 896 480c0-229.376-186.624-416-416-416S64 250.624 64 480s186.624 416 416 416c95.008 0 182.432-32.384 252.544-86.208l141.44 141.44a31.904 31.904 0 0 0 45.248 0 32 32 0 0 0 .032-45.248zM128 480c0-194.08 157.92-352 352-352s352 157.92 352 352-157.92 352-352 352-352-157.92-352-352z"},null,-1),e.createElementVNode("path",{fill:"currentColor",d:"M625.792 448H512V336a32 32 0 0 0-64 0v112H336a32 32 0 0 0 0 64h112v112a32 32 0 1 0 64 0V512h113.792a32 32 0 1 0 0-64z"},null,-1)];function b(n,o){return e.openBlock(),e.createElementBlock("svg",O,H)}const T={render:b},R={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",class:"icon",viewBox:"0 0 1024 1024"},Z=[e.createElementVNode("path",{fill:"currentColor",d:"M919.264 905.984 780.352 767.072C851.808 692.32 896 591.328 896 480c0-229.376-186.624-416-416-416S64 250.624 64 480s186.624 416 416 416c95.008 0 182.432-32.384 252.544-86.208l141.44 141.44a31.904 31.904 0 0 0 45.248 0 32 32 0 0 0 .032-45.248zM128 480c0-194.08 157.92-352 352-352s352 157.92 352 352-157.92 352-352 352-352-157.92-352-352z"},null,-1),e.createElementVNode("path",{fill:"currentColor",d:"M625.792 448H336a32 32 0 0 0 0 64h289.792a32 32 0 1 0 0-64z"},null,-1)];function U(n,o){return e.openBlock(),e.createElementBlock("svg",R,Z)}const j={render:U},F={xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",class:"icon",viewBox:"0 0 1024 1024"},q=[e.createElementVNode("path",{fill:"currentColor",d:"m576 512 277.333 277.333-64 64L512 576 234.667 853.333l-64-64L448 512 170.667 234.667l64-64L512 448l277.333-277.333 64 64L576 512z"},null,-1)];function W(n,o){return e.openBlock(),e.createElementBlock("svg",F,q)}const X={render:W},Y={xmlns:"http://www.w3.org/2000/svg",class:"icon",viewBox:"0 0 1024 1024"},G=[e.createElementVNode("path",{fill:"#fff",d:"M463.715 108.182h96.433V680.13h-96.433zM167.836 819.385h688.26v96.433h-688.26z"},null,-1),e.createElementVNode("path",{fill:"#fff",d:"m750.51 384.409 68.188 68.188L512 759.294l-68.188-68.188z"},null,-1),e.createElementVNode("path",{fill:"currentColor",d:"m580.193 691.115-68.188 68.188-306.697-306.697 68.188-68.188z"},null,-1)];function J(n,o){return e.openBlock(),e.createElementBlock("svg",Y,G)}const K={render:J},Q=["src"],ee={class:e.normalizeClass({Toolbar:!0})},te=["src"],oe={class:"tools"},a=1.5,$=2,p=.5,ne=e.defineComponent({__name:"imagePerview",props:{url:{default:""},isDownload:{type:Boolean,default:!0},isDelete:{type:Boolean,default:!0}},emits:["remove","download"],setup(n,{emit:o}){const d=n,{isDownload:m,url:i,isDelete:ce}=e.toRefs(d),f=e.ref(!1),_=e.ref(0),l=e.ref(1),w=e.ref(0),re=e.ref();e.watchEffect(()=>{w.value=f.value?1:0});const ie=()=>{document.addEventListener("mousewheel",h,{passive:!1}),document.addEventListener("DOMMouseScroll",h,{passive:!1}),f.value=!0},h=s=>{const{deltaY:t}=s,c=Math.max(-1,Math.min(1,t));l.value=c<0?Math.min(l.value*a,$):Math.max(l.value/a,p)},u=s=>{switch(s){case"BlowUp":l.value<$&&(l.value*=a);break;case"minification":l.value>p&&(l.value/=a);break}},C=()=>{document.removeEventListener("mousewheel",h),document.removeEventListener("DOMMouseScroll",h),f.value=!1,l.value=1,_.value=0,w.value=0},ae=s=>{o("download",s)},de=s=>{o("remove",s)};return(s,t)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps(s.$attrs,{ref_key:"imagePreview",ref:re,class:"image-preview"}),[e.unref(i)?(e.openBlock(),e.createElementBlock("img",{key:0,class:"image",src:e.unref(i)},null,8,Q)):e.createCommentVNode("",!0),e.createElementVNode("div",ee,[e.createVNode(e.unref(N),{class:"iconStyle",onClick:ie}),e.unref(m)?(e.openBlock(),e.createBlock(e.unref(K),{key:0,class:"iconStyle",onClick:t[0]||(t[0]=c=>ae(e.unref(i)))})):e.createCommentVNode("",!0),e.unref(ce)?(e.openBlock(),e.createBlock(e.unref(E),{key:1,class:"DeleteStyle",onClick:t[1]||(t[1]=c=>de(e.unref(i)))})):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"fullscreen-overlay",onClick:t[7]||(t[7]=e.withModifiers(c=>C(),["self"])),style:e.normalizeStyle({transform:`scale(${w.value})`,"transform-origin":"center center",transition:"0.3s"})},[e.createElementVNode("img",{class:"Preview",src:e.unref(i),style:e.normalizeStyle({transform:`rotate(${_.value}deg) scale(${l.value})`,transition:"0.3s"})},null,12,te),e.createElementVNode("div",oe,[e.createVNode(e.unref(S),{class:"toolsIcon",onClick:t[2]||(t[2]=c=>_.value-=90)}),e.createVNode(e.unref(I),{class:"toolsIcon",onClick:t[3]||(t[3]=c=>_.value+=90)}),e.createVNode(e.unref(T),{class:"toolsIcon",onClick:t[4]||(t[4]=c=>u("BlowUp"))}),e.createVNode(e.unref(j),{class:"toolsIcon",onClick:t[5]||(t[5]=c=>u("minification"))}),e.createVNode(e.unref(X),{class:"toolsIcon",onClick:t[6]||(t[6]=c=>C())})])],4)],16))}}),ze="",g=((n,o)=>{const d=n.__vccOpts||n;for(const[m,i]of o)d[m]=i;return d})(ne,[["__scopeId","data-v-204c3d98"]]),le=[g],se={install:n=>{le.forEach(o=>n.component((o._name,o)))}};r.default=se,r.imagePerview=g,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});