v3-img-preview
Version:
1 lines • 27.8 kB
JavaScript
var V3ImgPreview=function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function n(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var a,r,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(o.push(a.value),!t||o.length!==t);i=!0);}catch(e){c=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw r}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e,t)||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 o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}const i="undefined"!=typeof window,c=()=>{};function l(t,n=200,a={}){return function(e,t){return function(...n){e((()=>t.apply(this,n)),{fn:t,thisArg:this,args:n})}}(function(t,n={}){let a,r;return o=>{const i=e.unref(t),c=e.unref(n.maxWait);if(a&&clearTimeout(a),i<=0||void 0!==c&&c<=0)return r&&(clearTimeout(r),r=null),o();c&&!r&&(r=setTimeout((()=>{a&&clearTimeout(a),r=null,o()}),c)),a=setTimeout((()=>{r&&clearTimeout(r),r=null,o()}),i)}}(n,a),t)}var d=Object.defineProperty,s=Object.defineProperties,u=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,g=(e,t,n)=>t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,f=(e,t)=>{for(var n in t||(t={}))v.call(t,n)&&g(e,n,t[n]);if(m)for(var n of m(t))p.call(t,n)&&g(e,n,t[n]);return e};const h=i?window:void 0;function b(...t){let n,a,r,o;if("string"==typeof t[0]?([a,r,o]=t,n=h):[n,a,r,o]=t,!n)return c;let i=c;const l=e.watch((()=>function(t){var n;const a=e.unref(t);return null!=(n=null==a?void 0:a.$el)?n:a}(n)),(e=>{i(),e&&(e.addEventListener(a,r,o),i=()=>{e.removeEventListener(a,r,o),i=c})}),{immediate:!0,flush:"post"}),d=()=>{l(),i()};var s;return s=d,e.getCurrentScope()&&e.onScopeDispose(s),d}function y(e,t,n={}){const{target:a=h,eventName:r="keydown",passive:o=!1}=n,i="function"==typeof(c=e)?c:"string"==typeof c?e=>e.key===c:Array.isArray(c)?e=>c.includes(e.key):c?()=>!0:()=>!1;var c;return b(a,r,(e=>{i(e)&&t(e)}),o)}const w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},x="__vueuse_ssr_handlers__";w[x]=w[x]||{},w[x];var z,_,k=Object.defineProperty,E=Object.defineProperties,S=Object.getOwnPropertyDescriptors,B=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,A=(e,t,n)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function V(t,n={}){var a,r;const o=null!=(a=n.draggingElement)?a:h,c=e.ref(null!=(r=n.initialValue)?r:{x:0,y:0}),l=e.ref(),d=e=>!n.pointerTypes||n.pointerTypes.includes(e.pointerType),m=t=>{e.unref(n.preventDefault)&&t.preventDefault(),e.unref(n.stopPropagation)&&t.stopPropagation()},v=e=>{var t;d(e)&&l.value&&(c.value={x:e.pageX-l.value.x,y:e.pageY-l.value.y},null==(t=n.onMove)||t.call(n,c.value,e),m(e))},p=e=>{var t;d(e)&&l.value&&(l.value=void 0,null==(t=n.onEnd)||t.call(n,c.value,e),m(e))};return i&&(b(t,"pointerdown",(a=>{var r;if(!d(a))return;if(e.unref(n.exact)&&a.target!==e.unref(t))return;const o=e.unref(t).getBoundingClientRect(),i={x:a.pageX-o.left,y:a.pageY-o.top};!1!==(null==(r=n.onStart)?void 0:r.call(n,i,a))&&(l.value=i,m(a))}),!0),b(o,"pointermove",v,!0),b(o,"pointerup",p,!0)),g=((e,t)=>{for(var n in t||(t={}))C.call(t,n)&&A(e,n,t[n]);if(B)for(var n of B(t))O.call(t,n)&&A(e,n,t[n]);return e})({},function(t){if(!e.isRef(t))return e.toRefs(t);const n=Array.isArray(t.value)?new Array(t.value.length):{};for(const a in t.value)n[a]=e.customRef((()=>({get:()=>t.value[a],set(e){if(Array.isArray(t.value)){const n=[...t.value];n[a]=e,t.value=n}else t.value=(n=f({},t.value),s(n,u({[a]:e})));var n}})));return n}(c)),y={position:c,isDragging:e.computed((()=>!!l.value)),style:e.computed((()=>`left:${c.value.x}px;top:${c.value.y}px;`))},E(g,S(y));var g,y}i&&(null==window?void 0:window.navigator)&&(null==(z=null==window?void 0:window.navigator)?void 0:z.platform)&&/iP(ad|hone|od)/.test(null==(_=null==window?void 0:window.navigator)?void 0:_.platform);var M=["a","s","d","w","q","e","A","S","D","W","Q","E","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Escape"," "],I=e.defineComponent({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:function(){return[]}},showCloseBtn:{type:Boolean,default:!0},index:{type:Number,default:0},on_unmount_v3_ima_preview_app:{type:Function}},setup:function(t,a){var r=a.emit,o=e.ref(null),i=e.ref(null),c=V(i).style,d=e.reactive({visible:!0,imgState:"loading",src:"",imgIndex:t.index}),s=e.computed((function(){var e;return(null===(e=t.images)||void 0===e?void 0:e.length)>1&&t.showArrowBtn})),u=e.reactive({imgScale:1,imgRotate:0}),m=e.computed((function(){var e;return(null===(e=t.images)||void 0===e?void 0:e.length)>1})),v=l((function(e){if(!t.keyboard)return!1;e.preventDefault();var n=e.key;return["s","S","ArrowDown"].includes(n)?f(-.1,!1):["w","W","ArrowUp"].includes(n)?f(.1,!1):" "===n?p():"Escape"===n&&t.escClose?z():["E","e"].includes(n)?g(!0):["Q","q"].includes(n)?g(!1):["a","A","ArrowLeft"].includes(n)?_(!1):["d","D","ArrowRight"].includes(n)?_(!0):void 0}),200);y(M,v);var p=function(){u.imgScale=1,u.imgRotate=0,i.value.style.top="0",i.value.style.left="0"};function g(e){u.imgRotate+=90*(e?1:-1)}function f(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u.imgScale<=.2&&e<0||(t?u.imgScale=e:u.imgScale+=e)}function h(e){e.preventDefault(),f(e.deltaY<0?.05:-.05)}function w(e){d.imgState="loading",function(e){var t=new Image;return t.src=e,new Promise((function(n,a){t.onload=function(){n(e)},t.onerror=function(){a(e)}}))}(e).then((function(){d.imgState="success",d.src=e,p()})).catch((function(){d.imgState="error"}))}function x(){e.nextTick((function(){b(o.value,"mousewheel",h,!1),p(),e.nextTick((function(){return void 0!==t.url?w(t.url):Array.isArray(t.images)&&t.images.length>0?w(t.images[d.imgIndex]):console.error("images is not Array or Array length is 0")}))}))}function z(){var e;d.visible=!1,r("close"),null===(e=t.on_unmount_v3_ima_preview_app)||void 0===e||e.call(t)}function _(e){m.value&&(e?(d.imgIndex++,d.imgIndex>t.images.length-1&&(d.imgIndex=0)):(d.imgIndex--,d.imgIndex<0&&(d.imgIndex=t.images.length-1)),w(t.images[d.imgIndex]))}return e.onMounted((function(){window.__V3__IMG__PREVIEW__LOAD__ICON__SVG__||function(e){e.__V3__IMG__PREVIEW__LOAD__ICON__SVG__=!0;var t,n,a,r,o,i='<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>',c=(c=document.getElementsByTagName("script"))[c.length-1].getAttribute("data-injectcss");if(c&&!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 l(){o||(o=!0,a())}t=function(){var e,t=document.createElement("div");t.innerHTML=i,i=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,r=e.document,o=!1,function e(){try{r.documentElement.doScroll("left")}catch(t){return void setTimeout(e,50)}l()}(),r.onreadystatechange=function(){"complete"==r.readyState&&(r.onreadystatechange=null,l())})}("undefined"!=typeof window?window:global),x()})),n(n(n({vImagesWrap:o,imgContainer:i},e.toRefs(d)),e.toRefs(u)),{},{handleClose:z,toggleImg:_,initImgSize:p,dragStyle:c,handleScale:f,handleRotate:g,visibleArrowBtn:s,isMultiple:m})}}),j=function(t){return e.pushScopeId("data-v-15ccadb3"),t=t(),e.popScopeId(),t},P={key:0,class:"v-images-wrap",ref:"vImagesWrap"},N={class:"icon img-loading rotate-animation","aria-hidden":"true"},L=[j((function(){return e.createElementVNode("use",{"xlink:href":"#v3-img-loading"},null,-1)}))],D=["src"],T=[j((function(){return e.createElementVNode("use",{"xlink:href":"#v3-img-img-error"},null,-1)}))],R=[j((function(){return e.createElementVNode("use",{"xlink:href":"#v3-img-close"},null,-1)}))],W=[j((function(){return e.createElementVNode("svg",{class:"icon","aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":"#v3-img-left"})],-1)}))],H=[j((function(){return e.createElementVNode("svg",{class:"icon","aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":"#v3-img-right"})],-1)}))],Y={key:3,class:"v3-img-preview-toolbar"},$=[j((function(){return e.createElementVNode("use",{"xlink:href":"#v3-img-zoom-out"},null,-1)}))],G=[j((function(){return e.createElementVNode("use",{"xlink:href":"#v3-img-zoom-big"},null,-1)}))],F=[j((function(){return e.createElementVNode("use",{"xlink:href":"#v3-img-antetype"},null,-1)}))],U=[j((function(){return e.createElementVNode("use",{"xlink:href":"#v3-img-rotate-left"},null,-1)}))],q=[j((function(){return e.createElementVNode("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],r=document.createElement("style");r.type="text/css","top"===n&&a.firstChild?a.insertBefore(r,a.firstChild):a.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.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"),I.render=function(t,n,a,r,o,i){return e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx((function(){return[t.visible?(e.openBlock(),e.createElementBlock("div",P,[e.withDirectives((e.openBlock(),e.createElementBlock("svg",N,L,512)),[[e.vShow,"loading"===t.imgState]]),e.createElementVNode("div",{ref:"imgContainer",style:e.normalizeStyle(t.dragStyle),class:"img-container"},[e.withDirectives(e.createElementVNode("img",{class:"img-content",onDragstart:n[0]||(n[0]=e.withModifiers((function(){}),["prevent"])),src:t.src,style:e.normalizeStyle("transform: scale(".concat(t.imgScale,") rotate(").concat(t.imgRotate,"deg);")),alt:""},null,44,D),[[e.vShow,"success"===t.imgState]]),e.withDirectives((e.openBlock(),e.createElementBlock("svg",{class:"icon img-content img-error",onDragstart:n[1]||(n[1]=e.withModifiers((function(){}),["prevent"])),"aria-hidden":"true",style:e.normalizeStyle("transform: scale(".concat(t.imgScale,") rotate(").concat(t.imgRotate,"deg);"))},T,36)),[[e.vShow,"error"===t.imgState]])],4),t.showCloseBtn?(e.openBlock(),e.createElementBlock("svg",{key:0,class:"icon close-btn","aria-hidden":"true",onClick:n[2]||(n[2]=e.withModifiers((function(){return t.handleClose&&t.handleClose.apply(t,arguments)}),["stop"]))},R)):e.createCommentVNode("",!0),t.visibleArrowBtn?(e.openBlock(),e.createElementBlock("div",{key:1,class:"arrow arrow-left",onClick:n[3]||(n[3]=function(e){return t.toggleImg(!1)})},W)):e.createCommentVNode("",!0),t.visibleArrowBtn?(e.openBlock(),e.createElementBlock("div",{key:2,class:"arrow arrow-right",onClick:n[4]||(n[4]=function(e){return t.toggleImg(!0)})},H)):e.createCommentVNode("",!0),t.showToolbar?(e.openBlock(),e.createElementBlock("div",Y,[e.createElementVNode("section",null,[(e.openBlock(),e.createElementBlock("svg",{class:"icon","aria-hidden":"true",onClick:n[5]||(n[5]=function(e){return t.handleScale(-.1,!1)})},$)),(e.openBlock(),e.createElementBlock("svg",{class:"icon","aria-hidden":"true",onClick:n[6]||(n[6]=function(e){return t.handleScale(.1,!1)})},G)),(e.openBlock(),e.createElementBlock("svg",{class:"icon","aria-hidden":"true",onClick:n[7]||(n[7]=function(){return t.initImgSize&&t.initImgSize.apply(t,arguments)})},F)),(e.openBlock(),e.createElementBlock("svg",{class:"icon","aria-hidden":"true",onClick:n[8]||(n[8]=function(e){return t.handleRotate(!1)})},U)),(e.openBlock(),e.createElementBlock("svg",{class:"icon","aria-hidden":"true",onClick:n[9]||(n[9]=function(e){return t.handleRotate(!0)})},q))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)]})),_:1})},I.__scopeId="data-v-15ccadb3";var Q={},X="v3-img-preview-container-id",J={};function K(t){if(J._instance)return!1;Array.isArray(t)&&(t={images:t}),"string"==typeof t&&(t={url:t}),t=n(n({},Q),t);var a=document.getElementById(X);return a||((a=document.createElement("div")).id=X,document.body.appendChild(a)),(J=e.createApp(I,n(n({},t),{},{on_unmount_v3_ima_preview_app:function(){return J.unmount()}}))).mount(a),J}var Z=function(){var e=I;return e.install=function(e,t){Q=t,e.config.globalProperties.$v3ImgPreviewFn=K},e}(),ee=Object.freeze({__proto__:null,v3ImgPreviewFn:K,default:Z});return Object.entries(ee).forEach((function(e){var t=r(e,2),n=t[0],a=t[1];"default"!==n&&(Z[n]=a)})),Z}(Vue);