UNPKG

v3-img-preview

Version:
2 lines (1 loc) 24.9 kB
import{isRef as e,toRefs as t,customRef as n,getCurrentScope as a,onScopeDispose as i,unref as o,computed as r,watch as l,ref as c,defineComponent as s,reactive as d,onMounted as v,nextTick as m,openBlock as g,createBlock as u,Transition as p,withCtx as h,createElementBlock as f,withDirectives as b,vShow as y,createElementVNode as w,normalizeStyle as x,withModifiers as z,createCommentVNode as _,pushScopeId as S,popScopeId as C,createApp as A}from"vue";const k="undefined"!=typeof window,M=()=>{};function O(e,t=200,n={}){return function(e,t){return function(...n){e((()=>t.apply(this,n)),{fn:t,thisArg:this,args:n})}}(function(e,t={}){let n,a;return i=>{const r=o(e),l=o(t.maxWait);if(n&&clearTimeout(n),r<=0||void 0!==l&&l<=0)return a&&(clearTimeout(a),a=null),i();l&&!a&&(a=setTimeout((()=>{n&&clearTimeout(n),a=null,i()}),l)),n=setTimeout((()=>{a&&clearTimeout(a),a=null,i()}),r)}}(t,n),e)}var I=Object.defineProperty,B=Object.defineProperties,E=Object.getOwnPropertyDescriptors,L=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,V=(e,t,n)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))j.call(t,n)&&V(e,n,t[n]);if(L)for(var n of L(t))T.call(t,n)&&V(e,n,t[n]);return e};const D=k?window:void 0;function R(...e){let t,n,r,c;if("string"==typeof e[0]?([n,r,c]=e,t=D):[t,n,r,c]=e,!t)return M;let s=M;const d=l((()=>function(e){var t;const n=o(e);return null!=(t=null==n?void 0:n.$el)?t:n}(t)),(e=>{s(),e&&(e.addEventListener(n,r,c),s=()=>{e.removeEventListener(n,r,c),s=M})}),{immediate:!0,flush:"post"}),v=()=>{d(),s()};var m;return m=v,a()&&i(m),v}function N(e,t,n={}){const{target:a=D,eventName:i="keydown",passive:o=!1}=n,r="function"==typeof(l=e)?l:"string"==typeof l?e=>e.key===l:Array.isArray(l)?e=>l.includes(e.key):l?()=>!0:()=>!1;var l;return R(a,i,(e=>{r(e)&&t(e)}),o)}const $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},W="__vueuse_ssr_handlers__";$[W]=$[W]||{},$[W];var H,Y,G=Object.defineProperty,q=Object.defineProperties,F=Object.getOwnPropertyDescriptors,Q=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,J=(e,t,n)=>t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function K(a,i={}){var l,s;const d=null!=(l=i.draggingElement)?l:D,v=c(null!=(s=i.initialValue)?s:{x:0,y:0}),m=c(),g=e=>!i.pointerTypes||i.pointerTypes.includes(e.pointerType),u=e=>{o(i.preventDefault)&&e.preventDefault(),o(i.stopPropagation)&&e.stopPropagation()},p=e=>{var t;g(e)&&m.value&&(v.value={x:e.pageX-m.value.x,y:e.pageY-m.value.y},null==(t=i.onMove)||t.call(i,v.value,e),u(e))},h=e=>{var t;g(e)&&m.value&&(m.value=void 0,null==(t=i.onEnd)||t.call(i,v.value,e),u(e))};return k&&(R(a,"pointerdown",(e=>{var t;if(!g(e))return;if(o(i.exact)&&e.target!==o(a))return;const n=o(a).getBoundingClientRect(),r={x:e.pageX-n.left,y:e.pageY-n.top};!1!==(null==(t=i.onStart)?void 0:t.call(i,r,e))&&(m.value=r,u(e))}),!0),R(d,"pointermove",p,!0),R(d,"pointerup",h,!0)),f=((e,t)=>{for(var n in t||(t={}))U.call(t,n)&&J(e,n,t[n]);if(Q)for(var n of Q(t))X.call(t,n)&&J(e,n,t[n]);return e})({},function(a){if(!e(a))return t(a);const i=Array.isArray(a.value)?new Array(a.value.length):{};for(const e in a.value)i[e]=n((()=>({get:()=>a.value[e],set(t){if(Array.isArray(a.value)){const n=[...a.value];n[e]=t,a.value=n}else a.value=(n=P({},a.value),B(n,E({[e]:t})));var n}})));return i}(v)),b={position:v,isDragging:r((()=>!!m.value)),style:r((()=>`left:${v.value.x}px;top:${v.value.y}px;`))},q(f,F(b));var f,b}k&&(null==window?void 0:window.navigator)&&(null==(H=null==window?void 0:window.navigator)?void 0:H.platform)&&/iP(ad|hone|od)/.test(null==(Y=null==window?void 0:window.navigator)?void 0:Y.platform);const Z=["a","s","d","w","q","e","A","S","D","W","Q","E","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Escape"," "];var ee=s({name:"V3ImgPreview",props:{showToolbar:{type:Boolean,default:!0},showArrowBtn:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},url:{type:String,default:void 0},escClose:{type:Boolean,default:!0},images:{type:Array,default:()=>[]},showCloseBtn:{type:Boolean,default:!0},index:{type:Number,default:0},on_unmount_v3_ima_preview_app:{type:Function}},setup(e,n){let{emit:a}=n;const i=c(null),o=c(null),{style:l}=K(o),s=d({visible:!0,imgState:"loading",src:"",imgIndex:e.index}),g=r((()=>{var t;return(null===(t=e.images)||void 0===t?void 0:t.length)>1&&e.showArrowBtn})),u=d({imgScale:1,imgRotate:0}),p=r((()=>{var t;return(null===(t=e.images)||void 0===t?void 0:t.length)>1})),h=O((t=>{if(!e.keyboard)return!1;t.preventDefault();const{key:n}=t;return["s","S","ArrowDown"].includes(n)?y(-.1,!1):["w","W","ArrowUp"].includes(n)?y(.1,!1):" "===n?f():"Escape"===n&&e.escClose?_():["E","e"].includes(n)?b(!0):["Q","q"].includes(n)?b(!1):["a","A","ArrowLeft"].includes(n)?S(!1):["d","D","ArrowRight"].includes(n)?S(!0):void 0}),200);N(Z,h);const f=()=>{u.imgScale=1,u.imgRotate=0,o.value.style.top="0",o.value.style.left="0"};function b(e){u.imgRotate+=90*(e?1:-1)}function y(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u.imgScale<=.2&&e<0||(t?u.imgScale=e:u.imgScale+=e)}function w(e){e.preventDefault(),y(e.deltaY<0?.05:-.05)}function x(e){s.imgState="loading",(e=>{const t=new Image;return t.src=e,new Promise(((n,a)=>{t.onload=()=>{n(e)},t.onerror=()=>{a(e)}}))})(e).then((()=>{s.imgState="success",s.src=e,f()})).catch((()=>{s.imgState="error"}))}function z(){m((()=>{R(i.value,"mousewheel",w,!1),f(),m((()=>void 0!==e.url?x(e.url):Array.isArray(e.images)&&e.images.length>0?x(e.images[s.imgIndex]):console.error("images is not Array or Array length is 0")))}))}function _(){var t;s.visible=!1,a("close"),null===(t=e.on_unmount_v3_ima_preview_app)||void 0===t||t.call(e)}function S(t){p.value&&(t?(s.imgIndex++,s.imgIndex>e.images.length-1&&(s.imgIndex=0)):(s.imgIndex--,s.imgIndex<0&&(s.imgIndex=e.images.length-1)),x(e.images[s.imgIndex]))}return v((()=>{window.__V3__IMG__PREVIEW__LOAD__ICON__SVG__||function(e){e.__V3__IMG__PREVIEW__LOAD__ICON__SVG__=!0;var t,n,a,i,o,r='<svg><symbol id="v3-img-close" viewBox="0 0 1045 1024"><path d="M282.517333 213.376l-45.354666 45.162667L489.472 512 237.162667 765.461333l45.354666 45.162667L534.613333 557.354667l252.096 253.269333 45.354667-45.162667-252.288-253.44 252.288-253.482666-45.354667-45.162667L534.613333 466.624l-252.096-253.226667z" ></path></symbol><symbol id="v3-img-img-error" viewBox="0 0 1024 1024"><path d="M704 328a72 72 0 1 0 144 0 72 72 0 1 0-144 0z" ></path><path d="M999.904 116.608a32 32 0 0 0-21.952-10.912L521.76 73.792a31.552 31.552 0 0 0-27.2 11.904l-92.192 114.848a32 32 0 0 0 0.672 40.896l146.144 169.952-147.456 194.656 36.48-173.376a32 32 0 0 0-11.136-31.424L235.616 245.504l79.616-125.696a32 32 0 0 0-29.28-49.024L45.76 87.552a32 32 0 0 0-29.696 34.176l55.808 798.016a32.064 32.064 0 0 0 34.304 29.696l176.512-13.184c17.632-1.312 30.848-16.672 29.504-34.272s-16.576-31.04-34.304-29.536L133.44 883.232l-6.432-92.512 125.312-12.576a32 32 0 0 0 28.672-35.04 32.16 32.16 0 0 0-35.04-28.672L122.56 726.848 82.144 149.184l145.152-10.144-60.96 96.224a32 32 0 0 0 6.848 41.952l198.4 161.344-58.752 279.296a30.912 30.912 0 0 0 0.736 14.752 31.68 31.68 0 0 0 1.408 11.04l51.52 154.56a31.968 31.968 0 0 0 27.456 21.76l523.104 47.552a32.064 32.064 0 0 0 34.848-29.632l55.776-798.048a32.064 32.064 0 0 0-7.776-23.232z m-98.912 630.848l-412.576-39.648a31.52 31.52 0 0 0-34.912 28.768 32 32 0 0 0 28.8 34.912l414.24 39.808-6.272 89.536-469.728-42.72-39.584-118.72 234.816-310.016a31.936 31.936 0 0 0-1.248-40.192L468.896 219.84l65.088-81.056 407.584 28.48-40.576 580.192z" ></path></symbol><symbol id="v3-img-loading" viewBox="0 0 1024 1024"><path d="M834.7648 736.3584a5.632 5.632 0 1 0 11.264 0 5.632 5.632 0 0 0-11.264 0z m-124.16 128.1024a11.1616 11.1616 0 1 0 22.3744 0 11.1616 11.1616 0 0 0-22.3744 0z m-167.3216 65.8944a16.7936 16.7936 0 1 0 33.6384 0 16.7936 16.7936 0 0 0-33.6384 0zM363.1616 921.6a22.3744 22.3744 0 1 0 44.7488 0 22.3744 22.3744 0 0 0-44.7488 0z m-159.744-82.0224a28.0064 28.0064 0 1 0 55.9616 0 28.0064 28.0064 0 0 0-56.0128 0zM92.672 700.16a33.6384 33.6384 0 1 0 67.2256 0 33.6384 33.6384 0 0 0-67.2256 0zM51.2 528.9984a39.168 39.168 0 1 0 78.336 0 39.168 39.168 0 0 0-78.336 0z m34.1504-170.0864a44.8 44.8 0 1 0 89.6 0 44.8 44.8 0 0 0-89.6 0zM187.904 221.7984a50.432 50.432 0 1 0 100.864 0 50.432 50.432 0 0 0-100.864 0zM338.432 143.36a55.9616 55.9616 0 1 0 111.9232 0 55.9616 55.9616 0 0 0-111.9744 0z m169.0112-4.9152a61.5936 61.5936 0 1 0 123.2384 0 61.5936 61.5936 0 0 0-123.2384 0z m154.7776 69.632a67.1744 67.1744 0 1 0 134.3488 0 67.1744 67.1744 0 0 0-134.3488 0z m110.0288 130.816a72.8064 72.8064 0 1 0 145.5616 0 72.8064 72.8064 0 0 0-145.5616 0z m43.7248 169.472a78.3872 78.3872 0 1 0 156.8256 0 78.3872 78.3872 0 0 0-156.8256 0z" fill="" ></path></symbol><symbol id="v3-img-right" viewBox="0 0 1024 1024"><path d="M884.808356 96.170317c0-17.780969-16.723893-32.209586-37.309744-32.209586-20.586874 0-37.310767 14.428617-37.310767 32.209586V927.20035c0 17.780969 16.723893 32.209586 37.310767 32.209586 20.585851 0 37.309744-14.428617 37.309744-32.209586V96.170317zM263.249101 159.859871c-27.619034-21.278629-50.027393-11.659551-50.027393 22.116717v659.490146c0 33.44881 22.481014 43.322691 50.027393 22.116716l407.352615-313.385476c27.65485-21.242813 27.618011-55.784514 0-76.989465L263.249101 159.859871z m449.327612 260.298398c60.265572 48.751331 60.301388 134.302799 0 183.090968L297.061185 939.297876c-70.976518 57.422827-158.459988-25.322735-158.459989-116.158556V200.267163c0-91.12644 87.445608-173.6172 158.459989-116.158557l415.515528 336.049663zM297.061185 84.10963" ></path></symbol><symbol id="v3-img-left" viewBox="0 0 1024 1024"><path d="M138.60222 96.170317V927.20035c0 17.780969 16.723893 32.209586 37.309744 32.209586 20.586874 0 37.310767-14.428617 37.310767-32.209586V96.170317c0-17.780969-16.723893-32.209586-37.310767-32.209586-20.585851 0-37.309744 14.428617-37.309744 32.209586z m621.560278 63.689554L352.80886 473.208509c-27.618011 21.205974-27.65485 55.747675 0 76.989465l407.353638 313.385476c27.54638 21.205974 50.027393 11.33107 50.027393-22.116716v-659.490146c-0.001023-33.776268-22.408359-43.395346-50.027393-22.116717z m-33.812084-75.750241c71.013357-57.459666 158.458965 25.032116 158.458965 116.157533v622.872157c0 90.835821-87.482447 173.581384-158.459988 116.158556L310.834886 603.249237c-60.301388-48.78817-60.265572-134.339638 0-183.090968L726.350414 84.10963z m0 0" ></path></symbol><symbol id="v3-img-zoom-out" viewBox="0 0 1024 1024"><path d="M919.264 905.984l-138.912-138.912C851.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 0.032-45.248zM128 480C128 285.92 285.92 128 480 128s352 157.92 352 352-157.92 352-352 352S128 674.08 128 480z" ></path><path d="M625.792 448H336a32 32 0 0 0 0 64h289.792a32 32 0 1 0 0-64z" ></path></symbol><symbol id="v3-img-zoom-big" viewBox="0 0 1024 1024"><path d="M919.264 905.984l-138.912-138.912C851.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 0.032-45.248zM128 480C128 285.92 285.92 128 480 128s352 157.92 352 352-157.92 352-352 352S128 674.08 128 480z" ></path><path d="M625.792 448H512v-112a32 32 0 0 0-64 0V448h-112a32 32 0 0 0 0 64H448v112a32 32 0 1 0 64 0V512h113.792a32 32 0 1 0 0-64z" ></path></symbol><symbol id="v3-img-rotate-left" viewBox="0 0 1024 1024"><path d="M884.565333 431.914667c-3.114667 36.266667-22.784 55.893333-59.008 59.008-35.2-3.114667-54.357333-22.741333-57.472-59.008 3.114667-35.157333 22.272-54.314667 57.472-57.429334 36.224 3.114667 55.893333 22.272 59.008 57.429334z m-97.834666 0c3.114667 24.874667 16.042667 38.826667 38.826666 41.941333 22.741333-2.048 35.712-16.042667 38.826667-41.941333-3.114667-24.832-16.085333-38.272-38.826667-40.362667-22.784 3.114667-35.712 16.597333-38.826666 40.362667z m-59.008 82.346666c-1.024 103.466667-34.688 156.245333-100.906667 158.293334-69.376-1.024-104.021333-53.76-104.021333-158.293334 0.981333-104.576 35.157333-158.421333 102.442666-161.536 67.285333 2.133333 101.461333 55.893333 102.485334 161.493334z m-169.216 0c0 89.002667 22.229333 132.992 66.730666 131.925334 44.501333 1.066667 66.773333-42.922667 66.773334-131.968 0-90.026667-22.784-134.528-68.309334-133.546667-42.453333 3.114667-64.213333 47.658667-65.194666 133.546667z m-184.746667 49.664c-58.026667-5.205333-89.6-39.338667-94.72-102.485333 4.096-67.285333 37.76-103.509333 100.906667-108.714667 72.448-0.981333 108.16 50.218667 107.093333 153.728 0 109.738667-37.76 165.12-113.322667 166.144-45.568-2.090667-74.538667-24.32-86.954666-66.773333l32.597333-10.88c7.253333 36.266667 26.453333 53.845333 57.472 52.821333 48.64-2.090667 73.472-45.056 74.538667-128.853333-15.530667 29.994667-41.429333 45.013333-77.653334 45.013333z m3.072-181.674666c-39.338667 3.114667-60.586667 28.458667-63.658667 76.074666 2.048 47.616 23.296 72.96 63.658667 76.074667 40.362667 0 65.194667-18.645333 74.538667-55.893333 0-65.194667-24.874667-97.28-74.538667-96.256z m135.594667 641.578666C230.186667 1023.829333 0.597333 794.24 0.597333 512v-0.981333h53.973334v0.981333c0 252.501333 205.354667 457.898667 457.813333 457.898667 252.501333 0 457.898667-205.397333 457.898667-457.898667 0-252.458667-205.397333-457.813333-457.856-457.813333A457.088 457.088 0 0 0 159.530667 220.586667l120.533333-0.938667h8.106667l-47.061334 47.786667-167.936 1.365333-1.109333-167.936 47.189333-47.872v131.626667A510.933333 510.933333 0 0 1 512.426667 0.128C794.624 0.128 1024.256 229.76 1024.256 512c0 282.282667-229.632 511.872-511.829333 511.872z" ></path></symbol><symbol id="v3-img-antetype" viewBox="0 0 1024 1024"><path d="M316 672h60c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8zM512 622c22.1 0 40-17.9 40-39 0-23.1-17.9-41-40-41s-40 17.9-40 41c0 21.1 17.9 39 40 39zM512 482c22.1 0 40-17.9 40-39 0-23.1-17.9-41-40-41s-40 17.9-40 41c0 21.1 17.9 39 40 39z" ></path><path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32z m-40 728H184V184h656v656z" ></path><path d="M648 672h60c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8z" ></path></symbol><symbol id="v3-img-rotate-right" viewBox="0 0 1024 1024"><path d="M375.381 562.517c-57.898-5.162-89.472-39.296-94.634-102.4 4.138-67.2 37.76-103.381 100.864-108.586 72.362-1.024 108.032 50.176 107.008 153.6 0 109.61-37.76 164.906-113.238 165.973-45.525-2.133-74.453-24.32-86.869-66.73l32.597-10.838c7.211 36.181 26.368 53.76 57.387 52.736 48.597-2.048 73.387-44.97 74.453-128.768-15.488 29.995-41.386 45.013-77.568 45.013z m3.115-181.504c-39.296 3.072-60.501 28.459-63.573 75.99 2.048 47.573 23.253 72.96 63.573 76.032 40.32 0 65.152-18.603 74.453-55.851 0-65.152-24.832-97.195-74.453-96.17z m145.835 131.84c0.981-104.448 35.114-158.208 102.4-161.322 67.157 2.09 101.29 55.85 102.357 161.322-1.067 103.424-34.688 156.16-100.821 158.251-69.334-1.067-103.936-53.76-103.936-158.25z m169.088 0c0-89.984-22.784-134.4-68.267-133.418-42.41 3.114-64.128 47.616-65.152 133.418 0 88.96 22.187 132.907 66.688 131.84 44.459 1.067 66.73-42.88 66.73-131.84z m75.989-82.218c3.115-35.158 22.23-54.272 57.387-57.387 36.181 3.115 55.893 22.23 58.965 57.387-3.115 36.224-22.784 55.893-58.965 58.965-35.158-3.115-54.272-22.741-57.387-58.965z m96.17 0c-3.071-24.832-16.042-38.23-38.783-40.32-22.742 3.114-35.67 16.554-38.784 40.32 3.114 24.832 16.042 38.826 38.826 41.898 22.699-2.048 35.67-16.042 38.742-41.898z m-354.175 592.64c-281.984 0-511.36-229.376-511.36-511.403C0 229.973 229.419 0.512 511.403 0.512c157.696 0 298.922 71.765 392.789 184.32V54.613l47.147 47.872-1.11 167.766-167.765-1.366-47.061-47.744h8.106l121.558 0.982a456.704 456.704 0 0 0-353.664-167.68c-252.246 0-457.43 205.226-457.43 457.429 0 252.288 205.184 457.515 457.43 457.515S968.875 764.16 968.875 511.872v-0.981h53.888v0.981c0 282.027-229.376 511.403-511.36 511.403z" ></path></symbol></svg>',l=(l=document.getElementsByTagName("script"))[l.length-1].getAttribute("data-injectcss");if(l&&!e.__iconfont__svg__cssinject__){e.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(e){console&&console.log(e)}}function c(){o||(o=!0,a())}t=function(){var e,t=document.createElement("div");t.innerHTML=r,r=null,(t=t.getElementsByTagName("svg")[0])&&(t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.width=0,t.style.height=0,t.style.overflow="hidden",t=t,(e=document.body).firstChild?function(e,t){t.parentNode.insertBefore(e,t)}(t,e.firstChild):e.appendChild(t))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(t,0):(n=function(){document.removeEventListener("DOMContentLoaded",n,!1),t()},document.addEventListener("DOMContentLoaded",n,!1)):document.attachEvent&&(a=t,i=e.document,o=!1,function e(){try{i.documentElement.doScroll("left")}catch(t){return void setTimeout(e,50)}c()}(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,c())})}("undefined"!=typeof window?window:global),z()})),Object.assign(Object.assign(Object.assign({vImagesWrap:i,imgContainer:o},t(s)),t(u)),{handleClose:_,toggleImg:S,initImgSize:f,dragStyle:l,handleScale:y,handleRotate:b,visibleArrowBtn:g,isMultiple:p})}});const te=e=>(S("data-v-15ccadb3"),e=e(),C(),e),ne={key:0,class:"v-images-wrap",ref:"vImagesWrap"},ae={class:"icon img-loading rotate-animation","aria-hidden":"true"},ie=[te((()=>w("use",{"xlink:href":"#v3-img-loading"},null,-1)))],oe=["src"],re=[te((()=>w("use",{"xlink:href":"#v3-img-img-error"},null,-1)))],le=[te((()=>w("use",{"xlink:href":"#v3-img-close"},null,-1)))],ce=[te((()=>w("svg",{class:"icon","aria-hidden":"true"},[w("use",{"xlink:href":"#v3-img-left"})],-1)))],se=[te((()=>w("svg",{class:"icon","aria-hidden":"true"},[w("use",{"xlink:href":"#v3-img-right"})],-1)))],de={key:3,class:"v3-img-preview-toolbar"},ve=[te((()=>w("use",{"xlink:href":"#v3-img-zoom-out"},null,-1)))],me=[te((()=>w("use",{"xlink:href":"#v3-img-zoom-big"},null,-1)))],ge=[te((()=>w("use",{"xlink:href":"#v3-img-antetype"},null,-1)))],ue=[te((()=>w("use",{"xlink:href":"#v3-img-rotate-left"},null,-1)))],pe=[te((()=>w("use",{"xlink:href":"#v3-img-rotate-right"},null,-1)))];!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&a.firstChild?a.insertBefore(i,a.firstChild):a.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".icon[data-v-15ccadb3] {\n width: 1em;\n height: 1em;\n vertical-align: -0.15em;\n fill: currentColor;\n overflow: hidden;\n}\n.v-images-wrap[data-v-15ccadb3] {\n z-index: 200;\n user-select: none;\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n overflow: hidden;\n background: rgba(0, 0, 0, 0.3);\n backdrop-filter: blur(3px);\n color: #fff;\n}\n.v-images-wrap[data-v-15ccadb3] .img-loading[data-v-15ccadb3],\n.v-images-wrap[data-v-15ccadb3] .img-content[data-v-15ccadb3] {\n font-size: 50px;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: auto;\n transition: all 0.2s;\n}\n.v-images-wrap[data-v-15ccadb3] .img-container[data-v-15ccadb3] {\n z-index: 201;\n position: absolute;\n height: 100vh;\n width: 100vw;\n top: 0;\n left: 0;\n text-align: center;\n}\n.v-images-wrap[data-v-15ccadb3] .img-container[data-v-15ccadb3] .img-content[data-v-15ccadb3] {\n max-width: 100%;\n max-height: 100%;\n}\n.v-images-wrap[data-v-15ccadb3] .img-container[data-v-15ccadb3] .img-error[data-v-15ccadb3] {\n font-size: 300px;\n color: #d8d8d8;\n}\n.v-images-wrap[data-v-15ccadb3] .rotate-animation[data-v-15ccadb3] {\n animation: rotate-15ccadb3 1.5s linear infinite;\n}\n.v-images-wrap[data-v-15ccadb3] .arrow[data-v-15ccadb3] {\n width: 42px;\n height: 42px;\n text-align: center;\n line-height: 42px;\n position: absolute;\n top: 50%;\n border-radius: 50%;\n transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n font-size: 24px;\n cursor: pointer;\n transition: all 0.2s;\n z-index: 280;\n background: rgba(0, 0, 0, 0.3);\n}\n.v-images-wrap[data-v-15ccadb3] .arrow[data-v-15ccadb3][data-v-15ccadb3]:hover {\n opacity: 0.8;\n transform: translateY(-50%) scale(1.2);\n}\n.v-images-wrap[data-v-15ccadb3] .arrow-left[data-v-15ccadb3] {\n left: 50px;\n}\n.v-images-wrap[data-v-15ccadb3] .arrow-right[data-v-15ccadb3] {\n right: 50px;\n}\n.v-images-wrap[data-v-15ccadb3] .close-btn[data-v-15ccadb3] {\n z-index: 205;\n position: absolute;\n right: 50px;\n top: 50px;\n width: 36px;\n height: 36px;\n font-size: 22px;\n line-height: 36px;\n text-align: center;\n border-radius: 50%;\n cursor: pointer;\n transition: all 0.2s;\n color: #e7e5e5;\n background: rgba(0, 0, 0, 0.3);\n}\n.v-images-wrap[data-v-15ccadb3] .close-btn[data-v-15ccadb3][data-v-15ccadb3]:hover {\n opacity: 0.8;\n transform: scale(1.2);\n}\n.v-images-wrap[data-v-15ccadb3] .v3-img-preview-toolbar[data-v-15ccadb3] {\n z-index: 205;\n position: absolute;\n bottom: 10%;\n font-size: 26px;\n width: 100%;\n display: flex;\n justify-content: center;\n cursor: pointer;\n}\n.v-images-wrap[data-v-15ccadb3] .v3-img-preview-toolbar[data-v-15ccadb3] section[data-v-15ccadb3] {\n height: 44px;\n bottom: 10%;\n padding: 0 22px;\n display: flex;\n align-items: center;\n border-radius: 22px;\n background: rgba(0, 0, 0, 0.3);\n color: #c3c3c3;\n}\n.v-images-wrap[data-v-15ccadb3] .v3-img-preview-toolbar[data-v-15ccadb3] section[data-v-15ccadb3] svg[data-v-15ccadb3] {\n box-sizing: content-box;\n padding: 0 10px;\n transition: all 0.2s;\n}\n.v-images-wrap[data-v-15ccadb3] .v3-img-preview-toolbar[data-v-15ccadb3] section[data-v-15ccadb3] svg[data-v-15ccadb3][data-v-15ccadb3]:hover {\n transform: scale(1.2);\n}\n@keyframes rotate-15ccadb3 {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n"),ee.render=function(e,t,n,a,i,o){return g(),u(p,{name:"fade"},{default:h((()=>[e.visible?(g(),f("div",ne,[b((g(),f("svg",ae,ie,512)),[[y,"loading"===e.imgState]]),w("div",{ref:"imgContainer",style:x(e.dragStyle),class:"img-container"},[b(w("img",{class:"img-content",onDragstart:t[0]||(t[0]=z((()=>{}),["prevent"])),src:e.src,style:x(`transform: scale(${e.imgScale}) rotate(${e.imgRotate}deg);`),alt:""},null,44,oe),[[y,"success"===e.imgState]]),b((g(),f("svg",{class:"icon img-content img-error",onDragstart:t[1]||(t[1]=z((()=>{}),["prevent"])),"aria-hidden":"true",style:x(`transform: scale(${e.imgScale}) rotate(${e.imgRotate}deg);`)},re,36)),[[y,"error"===e.imgState]])],4),e.showCloseBtn?(g(),f("svg",{key:0,class:"icon close-btn","aria-hidden":"true",onClick:t[2]||(t[2]=z((function(){return e.handleClose&&e.handleClose(...arguments)}),["stop"]))},le)):_("",!0),e.visibleArrowBtn?(g(),f("div",{key:1,class:"arrow arrow-left",onClick:t[3]||(t[3]=t=>e.toggleImg(!1))},ce)):_("",!0),e.visibleArrowBtn?(g(),f("div",{key:2,class:"arrow arrow-right",onClick:t[4]||(t[4]=t=>e.toggleImg(!0))},se)):_("",!0),e.showToolbar?(g(),f("div",de,[w("section",null,[(g(),f("svg",{class:"icon","aria-hidden":"true",onClick:t[5]||(t[5]=t=>e.handleScale(-.1,!1))},ve)),(g(),f("svg",{class:"icon","aria-hidden":"true",onClick:t[6]||(t[6]=t=>e.handleScale(.1,!1))},me)),(g(),f("svg",{class:"icon","aria-hidden":"true",onClick:t[7]||(t[7]=function(){return e.initImgSize&&e.initImgSize(...arguments)})},ge)),(g(),f("svg",{class:"icon","aria-hidden":"true",onClick:t[8]||(t[8]=t=>e.handleRotate(!1))},ue)),(g(),f("svg",{class:"icon","aria-hidden":"true",onClick:t[9]||(t[9]=t=>e.handleRotate(!0))},pe))])])):_("",!0)],512)):_("",!0)])),_:1})},ee.__scopeId="data-v-15ccadb3";let he={};const fe="v3-img-preview-container-id";let be={};function ye(e){if(be._instance)return!1;Array.isArray(e)&&(e={images:e}),"string"==typeof e&&(e={url:e}),e=Object.assign(Object.assign({},he),e);let t=document.getElementById(fe);return t||(t=document.createElement("div"),t.id=fe,document.body.appendChild(t)),be=A(ee,Object.assign(Object.assign({},e),{on_unmount_v3_ima_preview_app:()=>be.unmount()})),be.mount(t),be}var we=(()=>{const e=ee;return e.install=(e,t)=>{he=t,e.config.globalProperties.$v3ImgPreviewFn=ye},e})();export{we as default,ye as v3ImgPreviewFn};