var Ht=(e,t,i)=>new Promise((n,r)=>{var a=u=>{try{s(i.next(u))}catch(l){r(l)}},o=u=>{try{s(i.throw(u))}catch(l){r(l)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((i=i.apply(e,t)).next())});import{J as Je,p as Qe,Q as ti,K as ei,b as ii,d as vt,h as ni,G as ri,ah as qt,ax as Ut,n as mt}from"./@vueup/vue-quill.21cd2cdd.js";/*! * Viewer.js v1.10.5 * https://fengyuanchen.github.io/viewerjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2022-04-05T08:21:02.491Z */function $t(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),i.push.apply(i,n)}return i}function Pt(e){for(var t=1;t
',Et=typeof window!="undefined"&&typeof window.document!="undefined",P=Et?window:{},B=Et&&P.document.documentElement?"ontouchstart"in P.document.documentElement:!1,Wt=Et?"PointerEvent"in P:!1,g="viewer",gt="move",Ve="switch",nt="zoom",ut="".concat(g,"-active"),ui="".concat(g,"-close"),pt="".concat(g,"-fade"),zt="".concat(g,"-fixed"),ci="".concat(g,"-fullscreen"),Zt="".concat(g,"-fullscreen-exit"),W="".concat(g,"-hide"),hi="".concat(g,"-hide-md-down"),fi="".concat(g,"-hide-sm-down"),di="".concat(g,"-hide-xs-down"),M="".concat(g,"-in"),at="".concat(g,"-invisible"),K="".concat(g,"-loading"),vi="".concat(g,"-move"),Gt="".concat(g,"-open"),H="".concat(g,"-show"),D="".concat(g,"-transition"),Z="click",jt="dblclick",Jt="dragstart",Qt="focusin",te="keydown",L="load",Y="error",mi=B?"touchend touchcancel":"mouseup",gi=B?"touchmove":"mousemove",pi=B?"touchstart":"mousedown",ee=Wt?"pointerdown":pi,ie=Wt?"pointermove":gi,ne=Wt?"pointerup pointercancel":mi,re="resize",j="transitionend",ae="wheel",oe="ready",se="show",le="shown",ue="hide",ce="hidden",he="view",ot="viewed",fe="move",de="moved",ve="rotate",me="rotated",ge="scale",pe="scaled",be="zoom",we="zoomed",ye="play",Ee="stop",yt="".concat(g,"Action"),Yt=/\s\s*/,ct=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function st(e){return typeof e=="string"}var bi=Number.isNaN||P.isNaN;function I(e){return typeof e=="number"&&!bi(e)}function U(e){return typeof e=="undefined"}function G(e){return Lt(e)==="object"&&e!==null}var wi=Object.prototype.hasOwnProperty;function rt(e){if(!G(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&wi.call(i,"isPrototypeOf")}catch(n){return!1}}function y(e){return typeof e=="function"}function T(e,t){if(e&&y(t))if(Array.isArray(e)||I(e.length)){var i=e.length,n;for(n=0;n1?i-1:0),r=1;r0&&n.forEach(function(a){G(a)&&Object.keys(a).forEach(function(o){t[o]=a[o]})}),t},yi=/^(?:width|height|left|top|marginLeft|marginTop)$/;function R(e,t){var i=e.style;T(t,function(n,r){yi.test(r)&&I(n)&&(n+="px"),i[r]=n})}function Ei(e){return st(e)?e.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">"):e}function q(e,t){return!e||!t?!1:e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function f(e,t){if(!(!e||!t)){if(I(e.length)){T(e,function(n){f(n,t)});return}if(e.classList){e.classList.add(t);return}var i=e.className.trim();i?i.indexOf(t)<0&&(e.className="".concat(i," ").concat(t)):e.className=t}}function w(e,t){if(!(!e||!t)){if(I(e.length)){T(e,function(i){w(i,t)});return}if(e.classList){e.classList.remove(t);return}e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,""))}}function lt(e,t,i){if(!!t){if(I(e.length)){T(e,function(n){lt(n,t,i)});return}i?f(e,t):w(e,t)}}var Ti=/([a-z\d])([A-Z])/g;function Xt(e){return e.replace(Ti,"$1-$2").toLowerCase()}function $(e,t){return G(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(Xt(t)))}function Rt(e,t,i){G(i)?e[t]=i:e.dataset?e.dataset[t]=i:e.setAttribute("data-".concat(Xt(t)),i)}var Me=function(){var e=!1;if(Et){var t=!1,i=function(){},n=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(a){t=a}});P.addEventListener("test",i,n),P.removeEventListener("test",i,n)}return e}();function E(e,t,i){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=i;t.trim().split(Yt).forEach(function(a){if(!Me){var o=e.listeners;o&&o[a]&&o[a][i]&&(r=o[a][i],delete o[a][i],Object.keys(o[a]).length===0&&delete o[a],Object.keys(o).length===0&&delete e.listeners)}e.removeEventListener(a,r,n)})}function d(e,t,i){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=i;t.trim().split(Yt).forEach(function(a){if(n.once&&!Me){var o=e.listeners,s=o===void 0?{}:o;r=function(){delete s[a][i],e.removeEventListener(a,r,n);for(var l=arguments.length,h=new Array(l),c=0;cs?_=s/b:p=u*b,p=Math.min(p*.9,c),_=Math.min(_*.9,m);var A=(s-p)/2,N=(u-_)/2,S={left:A,top:N,x:A,y:N,width:p,height:_,oldRatio:1,ratio:p/c,aspectRatio:b,naturalWidth:c,naturalHeight:m},v=k({},S);n.rotatable&&(S.rotate=l.rotate||0,v.rotate=0),n.scalable&&(S.scaleX=l.scaleX||1,S.scaleY=l.scaleY||1,v.scaleX=1,v.scaleY=1),i.imageData=S,i.initialImageData=v,t&&t()})},renderImage:function(t){var i=this,n=this.image,r=this.imageData;if(R(n,k({width:r.width,height:r.height,marginLeft:r.x,marginTop:r.y},bt(r))),t)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&q(n,D)){var a=function(){i.imageRendering=!1,t()};this.imageRendering={abort:function(){E(n,j,a)}},d(n,j,a,{once:!0})}else t()},resetImage:function(){if(this.viewing||this.viewed){var t=this.image;this.viewing&&this.viewing.abort(),t.parentNode.removeChild(t),this.image=null}}},Ii={bind:function(){var t=this.options,i=this.viewer,n=this.canvas,r=this.element.ownerDocument;d(i,Z,this.onClick=this.click.bind(this)),d(i,Jt,this.onDragStart=this.dragstart.bind(this)),d(n,ee,this.onPointerDown=this.pointerdown.bind(this)),d(r,ie,this.onPointerMove=this.pointermove.bind(this)),d(r,ne,this.onPointerUp=this.pointerup.bind(this)),d(r,te,this.onKeyDown=this.keydown.bind(this)),d(window,re,this.onResize=this.resize.bind(this)),t.zoomable&&t.zoomOnWheel&&d(i,ae,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleOnDblclick&&d(n,jt,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,i=this.viewer,n=this.canvas,r=this.element.ownerDocument;E(i,Z,this.onClick),E(i,Jt,this.onDragStart),E(n,ee,this.onPointerDown),E(r,ie,this.onPointerMove),E(r,ne,this.onPointerUp),E(r,te,this.onKeyDown),E(window,re,this.onResize),t.zoomable&&t.zoomOnWheel&&E(i,ae,this.onWheel,{passive:!1,capture:!0}),t.toggleOnDblclick&&E(n,jt,this.onDblclick)}},_i={click:function(t){var i=this.options,n=this.imageData,r=t.target,a=$(r,yt);switch(!a&&r.localName==="img"&&r.parentElement.localName==="li"&&(r=r.parentElement,a=$(r,yt)),B&&t.isTrusted&&r===this.canvas&&clearTimeout(this.clickCanvasTimeout),a){case"mix":this.played?this.stop():i.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.hide();break;case"view":this.view($(r,"index"));break;case"zoom-in":this.zoom(.1,!0);break;case"zoom-out":this.zoom(-.1,!0);break;case"one-to-one":this.toggle();break;case"reset":this.reset();break;case"prev":this.prev(i.loop);break;case"play":this.play(i.fullscreen);break;case"next":this.next(i.loop);break;case"rotate-left":this.rotate(-90);break;case"rotate-right":this.rotate(90);break;case"flip-horizontal":this.scaleX(-n.scaleX||-1);break;case"flip-vertical":this.scaleY(-n.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(t){t.preventDefault(),this.viewed&&t.target===this.image&&(B&&t.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(t.isTrusted?t:t.detail&&t.detail.originalEvent))},load:function(){var t=this;this.timeout&&(clearTimeout(this.timeout),this.timeout=!1);var i=this.element,n=this.options,r=this.image,a=this.index,o=this.viewerData;w(r,at),n.loading&&w(this.canvas,K),r.style.cssText="height:0;"+"margin-left:".concat(o.width/2,"px;")+"margin-top:".concat(o.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage(function(){lt(r,vi,n.movable),lt(r,D,n.transition),t.renderImage(function(){t.viewed=!0,t.viewing=!1,y(n.viewed)&&d(i,ot,n.viewed,{once:!0}),x(i,ot,{originalImage:t.images[a],index:a,image:r},{cancelable:!1})})})},loadImage:function(t){var i=t.target,n=i.parentNode,r=n.offsetWidth||30,a=n.offsetHeight||50,o=!!$(i,"filled");Fe(i,this.options,function(s,u){var l=s/u,h=r,c=a;a*l>r?o?h=a*l:c=r/l:o?c=r/l:h=a*l,R(i,k({width:h,height:c},bt({translateX:(r-h)/2,translateY:(a-c)/2})))})},keydown:function(t){var i=this.options;if(!!i.keyboard){var n=t.keyCode||t.which||t.charCode;switch(n){case 13:this.viewer.contains(t.target)&&this.click(t);break}if(!!this.fulled)switch(n){case 27:this.played?this.stop():i.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.prev(i.loop);break;case 38:t.preventDefault(),this.zoom(i.zoomRatio,!0);break;case 39:this.next(i.loop);break;case 40:t.preventDefault(),this.zoom(-i.zoomRatio,!0);break;case 48:case 49:t.ctrlKey&&(t.preventDefault(),this.toggle());break}}},dragstart:function(t){t.target.localName==="img"&&t.preventDefault()},pointerdown:function(t){var i=this.options,n=this.pointers,r=t.buttons,a=t.button;if(!(!this.viewed||this.showing||this.viewing||this.hiding||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(I(r)&&r!==1||I(a)&&a!==0||t.ctrlKey))){t.preventDefault(),t.changedTouches?T(t.changedTouches,function(s){n[s.identifier]=ft(s)}):n[t.pointerId||0]=ft(t);var o=i.movable?gt:!1;i.zoomOnTouch&&i.zoomable&&Object.keys(n).length>1?o=nt:i.slideOnTouch&&(t.pointerType==="touch"||t.type==="touchstart")&&this.isSwitchable()&&(o=Ve),i.transition&&(o===gt||o===nt)&&w(this.image,D),this.action=o}},pointermove:function(t){var i=this.pointers,n=this.action;!this.viewed||!n||(t.preventDefault(),t.changedTouches?T(t.changedTouches,function(r){k(i[r.identifier]||{},ft(r,!0))}):k(i[t.pointerId||0]||{},ft(t,!0)),this.change(t))},pointerup:function(t){var i=this,n=this.options,r=this.action,a=this.pointers,o;t.changedTouches?T(t.changedTouches,function(s){o=a[s.identifier],delete a[s.identifier]}):(o=a[t.pointerId||0],delete a[t.pointerId||0]),r&&(t.preventDefault(),n.transition&&(r===gt||r===nt)&&f(this.image,D),this.action=!1,B&&r!==nt&&o&&Date.now()-o.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),n.toggleOnDblclick&&this.viewed&&t.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){x(i.image,jt,{originalEvent:t})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){i.imageClicked=!1},500)):(this.imageClicked=!1,n.backdrop&&n.backdrop!=="static"&&t.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){x(i.canvas,Z,{originalEvent:t})},50)))))},resize:function(){var t=this;if(!(!this.isShown||this.hiding)&&(this.fulled&&(this.close(),this.initBody(),this.open()),this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){t.renderImage()}),this.played)){if(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)){this.stop();return}T(this.player.getElementsByTagName("img"),function(i){d(i,L,t.loadImage.bind(t),{once:!0}),x(i,L)})}},wheel:function(t){var i=this;if(!!this.viewed&&(t.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50);var n=Number(this.options.zoomRatio)||.1,r=1;t.deltaY?r=t.deltaY>0?1:-1:t.wheelDelta?r=-t.wheelDelta/120:t.detail&&(r=t.detail>0?1:-1),this.zoom(-r*n,!0,t)}}},Ni={show:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.element,n=this.options;if(n.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(t),this;if(y(n.show)&&d(i,se,n.show,{once:!0}),x(i,se)===!1||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var r=this.viewer;if(w(r,W),r.setAttribute("role","dialog"),r.setAttribute("aria-labelledby",this.title.id),r.setAttribute("aria-modal",!0),r.removeAttribute("aria-hidden"),n.transition&&!t){var a=this.shown.bind(this);this.transitioning={abort:function(){E(r,j,a),w(r,M)}},f(r,D),r.initialOffsetWidth=r.offsetWidth,d(r,j,a,{once:!0}),f(r,M)}else f(r,M),this.shown();return this},hide:function(){var t=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=this.element,r=this.options;if(r.inline||this.hiding||!(this.isShown||this.showing))return this;if(y(r.hide)&&d(n,ue,r.hide,{once:!0}),x(n,ue)===!1)return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var a=this.viewer,o=this.image,s=function(){w(a,M),t.hidden()};if(r.transition&&!i){var u=function h(c){c&&c.target===a&&(E(a,j,h),t.hidden())},l=function(){q(a,D)?(d(a,j,u),w(a,M)):s()};this.transitioning={abort:function(){t.viewed&&q(o,D)?E(o,j,l):q(a,D)&&E(a,j,u)}},this.viewed&&q(o,D)?(d(o,j,l,{once:!0}),this.zoomTo(0,!1,null,!0)):l()}else s();return this},view:function(){var t=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.initialViewIndex;if(i=Number(i)||0,this.hiding||this.played||i<0||i>=this.length||this.viewed&&i===this.index)return this;if(!this.isShown)return this.index=i,this.show();this.viewing&&this.viewing.abort();var n=this.element,r=this.options,a=this.title,o=this.canvas,s=this.items[i],u=s.querySelector("img"),l=$(u,"originalUrl"),h=u.getAttribute("alt"),c=document.createElement("img");if(T(r.inheritedAttributes,function(A){var N=u.getAttribute(A);N!==null&&c.setAttribute(A,N)}),c.src=l,c.alt=h,y(r.view)&&d(n,he,r.view,{once:!0}),x(n,he,{originalImage:this.images[i],index:i,image:c})===!1||!this.isShown||this.hiding||this.played)return this;var m=this.items[this.index];m&&(w(m,ut),m.removeAttribute("aria-selected")),f(s,ut),s.setAttribute("aria-selected",!0),r.focus&&s.focus(),this.image=c,this.viewed=!1,this.index=i,this.imageData={},f(c,at),r.loading&&f(o,K),o.innerHTML="",o.appendChild(c),this.renderList(),a.innerHTML="";var b=function(){var N=t.imageData,S=Array.isArray(r.title)?r.title[1]:r.title;a.innerHTML=Ei(y(S)?S.call(t,c,N):"".concat(h," (").concat(N.naturalWidth," \xD7 ").concat(N.naturalHeight,")"))},p,_;return d(n,ot,b,{once:!0}),this.viewing={abort:function(){E(n,ot,b),c.complete?t.imageRendering?t.imageRendering.abort():t.imageInitializing&&t.imageInitializing.abort():(c.src="",E(c,L,p),t.timeout&&clearTimeout(t.timeout))}},c.complete?this.load():(d(c,L,p=function(){E(c,Y,_),t.load()},{once:!0}),d(c,Y,_=function(){E(c,L,p),t.timeout&&(clearTimeout(t.timeout),t.timeout=!1),w(c,at),r.loading&&w(t.canvas,K)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){w(c,at),t.timeout=!1},1e3)),this},prev:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.index-1;return i<0&&(i=t?this.length-1:0),this.view(i),this},next:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.length-1,n=this.index+1;return n>i&&(n=t?0:i),this.view(n),this},move:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,n=this.imageData;return this.moveTo(U(t)?t:n.x+Number(t),U(i)?i:n.y+Number(i)),this},moveTo:function(t){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,a=this.element,o=this.options,s=this.imageData;if(t=Number(t),n=Number(n),this.viewed&&!this.played&&o.movable){var u=s.x,l=s.y,h=!1;if(I(t)?h=!0:t=u,I(n)?h=!0:n=l,h){if(y(o.move)&&d(a,fe,o.move,{once:!0}),x(a,fe,{x:t,y:n,oldX:u,oldY:l,originalEvent:r})===!1)return this;s.x=t,s.y=n,s.left=t,s.top=n,this.moving=!0,this.renderImage(function(){i.moving=!1,y(o.moved)&&d(a,de,o.moved,{once:!0}),x(a,de,{x:t,y:n,oldX:u,oldY:l,originalEvent:r},{cancelable:!1})})}}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t)),this},rotateTo:function(t){var i=this,n=this.element,r=this.options,a=this.imageData;if(t=Number(t),I(t)&&this.viewed&&!this.played&&r.rotatable){var o=a.rotate;if(y(r.rotate)&&d(n,ve,r.rotate,{once:!0}),x(n,ve,{degree:t,oldDegree:o})===!1)return this;a.rotate=t,this.rotating=!0,this.renderImage(function(){i.rotating=!1,y(r.rotated)&&d(n,me,r.rotated,{once:!0}),x(n,me,{degree:t,oldDegree:o},{cancelable:!1})})}return this},scaleX:function(t){return this.scale(t,this.imageData.scaleY),this},scaleY:function(t){return this.scale(this.imageData.scaleX,t),this},scale:function(t){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,r=this.element,a=this.options,o=this.imageData;if(t=Number(t),n=Number(n),this.viewed&&!this.played&&a.scalable){var s=o.scaleX,u=o.scaleY,l=!1;if(I(t)?l=!0:t=s,I(n)?l=!0:n=u,l){if(y(a.scale)&&d(r,ge,a.scale,{once:!0}),x(r,ge,{scaleX:t,scaleY:n,oldScaleX:s,oldScaleY:u})===!1)return this;o.scaleX=t,o.scaleY=n,this.scaling=!0,this.renderImage(function(){i.scaling=!1,y(a.scaled)&&d(r,pe,a.scaled,{once:!0}),x(r,pe,{scaleX:t,scaleY:n,oldScaleX:s,oldScaleY:u},{cancelable:!1})})}}return this},zoom:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=this.imageData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(r.width*t/r.naturalWidth,i,n),this},zoomTo:function(t){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=this.element,s=this.options,u=this.pointers,l=this.imageData,h=l.x,c=l.y,m=l.width,b=l.height,p=l.naturalWidth,_=l.naturalHeight;if(t=Math.max(0,t),I(t)&&this.viewed&&!this.played&&(a||s.zoomable)){if(!a){var A=Math.max(.01,s.minZoomRatio),N=Math.min(100,s.maxZoomRatio);t=Math.min(Math.max(t,A),N)}if(r)switch(r.type){case"wheel":s.zoomRatio>=.055&&t>.95&&t<1.05&&(t=1);break;case"pointermove":case"touchmove":case"mousemove":t>.99&&t<1.01&&(t=1);break}var S=p*t,v=_*t,C=S-m,z=v-b,V=l.ratio;if(y(s.zoom)&&d(o,be,s.zoom,{once:!0}),x(o,be,{ratio:t,oldRatio:V,originalEvent:r})===!1)return this;if(this.zooming=!0,r){var X=Oi(this.viewer),tt=u&&Object.keys(u).length>0?xi(u):{pageX:r.pageX,pageY:r.pageY};l.x-=C*((tt.pageX-X.left-h)/m),l.y-=z*((tt.pageY-X.top-c)/b)}else l.x-=C/2,l.y-=z/2;l.left=l.x,l.top=l.y,l.width=S,l.height=v,l.oldRatio=V,l.ratio=t,this.renderImage(function(){i.zooming=!1,y(s.zoomed)&&d(o,we,s.zoomed,{once:!0}),x(o,we,{ratio:t,oldRatio:V,originalEvent:r},{cancelable:!1})}),n&&this.tooltip()}return this},play:function(){var t=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.isShown||this.played)return this;var n=this.element,r=this.options;if(y(r.play)&&d(n,ye,r.play,{once:!0}),x(n,ye)===!1)return this;var a=this.player,o=this.loadImage.bind(this),s=[],u=0,l=0;if(this.played=!0,this.onLoadWhenPlay=o,i&&this.requestFullscreen(i),f(a,H),T(this.items,function(c,m){var b=c.querySelector("img"),p=document.createElement("img");p.src=$(b,"originalUrl"),p.alt=b.getAttribute("alt"),p.referrerPolicy=b.referrerPolicy,u+=1,f(p,pt),lt(p,D,r.transition),q(c,ut)&&(f(p,M),l=m),s.push(p),d(p,L,o,{once:!0}),a.appendChild(p)}),I(r.interval)&&r.interval>0){var h=function c(){t.playing=setTimeout(function(){w(s[l],M),l+=1,l=l1&&h()}return this},stop:function(){var t=this;if(!this.played)return this;var i=this.element,n=this.options;if(y(n.stop)&&d(i,Ee,n.stop,{once:!0}),x(i,Ee)===!1)return this;var r=this.player;return this.played=!1,clearTimeout(this.playing),T(r.getElementsByTagName("img"),function(a){E(a,L,t.onLoadWhenPlay)}),w(r,H),r.innerHTML="",this.exitFullscreen(),this},full:function(){var t=this,i=this.options,n=this.viewer,r=this.image,a=this.list;return!this.isShown||this.played||this.fulled||!i.inline?this:(this.fulled=!0,this.open(),f(this.button,Zt),i.transition&&(w(a,D),this.viewed&&w(r,D)),f(n,zt),n.setAttribute("role","dialog"),n.setAttribute("aria-labelledby",this.title.id),n.setAttribute("aria-modal",!0),n.removeAttribute("style"),R(n,{zIndex:i.zIndex}),i.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=k({},this.containerData),this.renderList(),this.viewed&&this.initImage(function(){t.renderImage(function(){i.transition&&setTimeout(function(){f(r,D),f(a,D)},0)})}),this)},exit:function(){var t=this,i=this.options,n=this.viewer,r=this.image,a=this.list;return!this.isShown||this.played||!this.fulled||!i.inline?this:(this.fulled=!1,this.close(),w(this.button,Zt),i.transition&&(w(a,D),this.viewed&&w(r,D)),i.focus&&this.clearEnforceFocus(),n.removeAttribute("role"),n.removeAttribute("aria-labelledby"),n.removeAttribute("aria-modal"),w(n,zt),R(n,{zIndex:i.zIndexInline}),this.viewerData=k({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){t.renderImage(function(){i.transition&&setTimeout(function(){f(r,D),f(a,D)},0)})}),this)},tooltip:function(){var t=this,i=this.options,n=this.tooltipBox,r=this.imageData;return!this.viewed||this.played||!i.tooltip?this:(n.textContent="".concat(Math.round(r.ratio*100),"%"),this.tooltipping?clearTimeout(this.tooltipping):i.transition?(this.fading&&x(n,j),f(n,H),f(n,pt),f(n,D),n.removeAttribute("aria-hidden"),n.initialOffsetWidth=n.offsetWidth,f(n,M)):(f(n,H),n.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){i.transition?(d(n,j,function(){w(n,H),w(n,pt),w(n,D),n.setAttribute("aria-hidden",!0),t.fading=!1},{once:!0}),w(n,M),t.fading=!0):(w(n,H),n.setAttribute("aria-hidden",!0)),t.tooltipping=!1},1e3),this)},toggle:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.imageData.ratio===1?this.zoomTo(this.imageData.oldRatio,!0,t):this.zoomTo(1,!0,t),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=k({},this.initialImageData),this.renderImage()),this},update:function(){var t=this,i=this.element,n=this.options,r=this.isImg;if(r&&!i.parentNode)return this.destroy();var a=[];if(T(r?[i]:i.querySelectorAll("img"),function(l){y(n.filter)?n.filter.call(t,l)&&a.push(l):t.getImageURL(l)&&a.push(l)}),!a.length)return this;if(this.images=a,this.length=a.length,this.ready){var o=[];if(T(this.items,function(l,h){var c=l.querySelector("img"),m=a[h];m&&c?(m.src!==c.src||m.alt!==c.alt)&&o.push(h):o.push(h)}),R(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var s=o.indexOf(this.index);if(s>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-s,this.length-1),0));else{var u=this.items[this.index];f(u,ut),u.setAttribute("aria-selected",!0)}}}else this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML="",this.title.innerHTML=""}else this.build();return this},destroy:function(){var t=this.element,i=this.options;return t[g]?(this.destroyed=!0,this.ready?(this.played&&this.stop(),i.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):i.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),i.inline||E(t,Z,this.onStart),t[g]=void 0,this):this}},Ci={getImageURL:function(t){var i=this.options.url;return st(i)?i=t.getAttribute(i):y(i)?i=i.call(this,t):i="",i},enforceFocus:function(){var t=this;this.clearEnforceFocus(),d(document,Qt,this.onFocusin=function(i){var n=t.viewer,r=i.target;if(!(r===document||r===n||n.contains(r))){for(;r;){if(r.getAttribute("tabindex")!==null||r.getAttribute("aria-modal")==="true")return;r=r.parentElement}n.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(E(document,Qt,this.onFocusin),this.onFocusin=null)},open:function(){var t=this.body;f(t,Gt),t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px")},close:function(){var t=this.body;w(t,Gt),t.style.paddingRight=this.initialBodyPaddingRight},shown:function(){var t=this.element,i=this.options,n=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,i.focus&&(n.focus(),this.enforceFocus()),y(i.shown)&&d(t,le,i.shown,{once:!0}),x(t,le)!==!1&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var t=this.element,i=this.options,n=this.viewer;i.fucus&&this.clearEnforceFocus(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.close(),this.unbind(),f(n,W),n.removeAttribute("role"),n.removeAttribute("aria-labelledby"),n.removeAttribute("aria-modal"),n.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.hiding=!1,this.destroyed||(y(i.hidden)&&d(t,ce,i.hidden,{once:!0}),x(t,ce,null,{cancelable:!1}))},requestFullscreen:function(t){var i=this.element.ownerDocument;if(this.fulled&&!(i.fullscreenElement||i.webkitFullscreenElement||i.mozFullScreenElement||i.msFullscreenElement)){var n=i.documentElement;n.requestFullscreen?rt(t)?n.requestFullscreen(t):n.requestFullscreen():n.webkitRequestFullscreen?n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):n.mozRequestFullScreen?n.mozRequestFullScreen():n.msRequestFullscreen&&n.msRequestFullscreen()}},exitFullscreen:function(){var t=this.element.ownerDocument;this.fulled&&(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement)&&(t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen())},change:function(t){var i=this.options,n=this.pointers,r=n[Object.keys(n)[0]];if(!!r){var a=r.endX-r.startX,o=r.endY-r.startY;switch(this.action){case gt:this.move(a,o,t);break;case nt:this.zoom(Di(n),!1,t);break;case Ve:{this.action="switched";var s=Math.abs(a);s>1&&s>Math.abs(o)&&(this.pointers={},a>1?this.prev(i.loop):a<-1&&this.next(i.loop));break}}T(n,function(u){u.startX=u.endX,u.startY=u.endY})}},isSwitchable:function(){var t=this.imageData,i=this.viewerData;return this.length>1&&t.x>=0&&t.y>=0&&t.width<=i.width&&t.height<=i.height}},ki=P.Viewer,Li=function(e){return function(){return e+=1,e}}(-1),J=function(){function e(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ai(this,e),!t||t.nodeType!==1)throw new Error("The first argument is required and must be an element.");this.element=t,this.options=k({},Kt,rt(i)&&i),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.id=Li(),this.init()}return oi(e,[{key:"init",value:function(){var i=this,n=this.element,r=this.options;if(!n[g]){n[g]=this,r.focus&&!r.keyboard&&(r.focus=!1);var a=n.localName==="img",o=[];if(T(a?[n]:n.querySelectorAll("img"),function(l){y(r.filter)?r.filter.call(i,l)&&o.push(l):i.getImageURL(l)&&o.push(l)}),this.isImg=a,this.length=o.length,this.images=o,this.initBody(),U(document.createElement(g).style.transition)&&(r.transition=!1),r.inline){var s=0,u=function(){if(s+=1,s===i.length){var h;i.initializing=!1,i.delaying={abort:function(){clearTimeout(h)}},h=setTimeout(function(){i.delaying=!1,i.build()},0)}};this.initializing={abort:function(){T(o,function(h){h.complete||(E(h,L,u),E(h,Y,u))})}},T(o,function(l){if(l.complete)u();else{var h,c;d(l,L,h=function(){E(l,Y,c),u()},{once:!0}),d(l,Y,c=function(){E(l,L,h),u()},{once:!0})}})}else d(n,Z,this.onStart=function(l){var h=l.target;h.localName==="img"&&(!y(r.filter)||r.filter.call(i,h))&&i.view(i.images.indexOf(h))})}}},{key:"build",value:function(){if(!this.ready){var i=this.element,n=this.options,r=i.parentNode,a=document.createElement("div");a.innerHTML=li;var o=a.querySelector(".".concat(g,"-container")),s=o.querySelector(".".concat(g,"-title")),u=o.querySelector(".".concat(g,"-toolbar")),l=o.querySelector(".".concat(g,"-navbar")),h=o.querySelector(".".concat(g,"-button")),c=o.querySelector(".".concat(g,"-canvas"));if(this.parent=r,this.viewer=o,this.title=s,this.toolbar=u,this.navbar=l,this.button=h,this.canvas=c,this.footer=o.querySelector(".".concat(g,"-footer")),this.tooltipBox=o.querySelector(".".concat(g,"-tooltip")),this.player=o.querySelector(".".concat(g,"-player")),this.list=o.querySelector(".".concat(g,"-list")),o.id="".concat(g).concat(this.id),s.id="".concat(g,"Title").concat(this.id),f(s,n.title?ht(Array.isArray(n.title)?n.title[0]:n.title):W),f(l,n.navbar?ht(n.navbar):W),lt(h,W,!n.button),n.keyboard&&h.setAttribute("tabindex",0),n.backdrop&&(f(o,"".concat(g,"-backdrop")),!n.inline&&n.backdrop!=="static"&&Rt(c,yt,"hide")),st(n.className)&&n.className&&n.className.split(Yt).forEach(function(v){f(o,v)}),n.toolbar){var m=document.createElement("ul"),b=rt(n.toolbar),p=ct.slice(0,3),_=ct.slice(7,9),A=ct.slice(9);b||f(u,ht(n.toolbar)),T(b?n.toolbar:ct,function(v,C){var z=b&&rt(v),V=b?Xt(C):v,X=z&&!U(v.show)?v.show:v;if(!(!X||!n.zoomable&&p.indexOf(V)!==-1||!n.rotatable&&_.indexOf(V)!==-1||!n.scalable&&A.indexOf(V)!==-1)){var tt=z&&!U(v.size)?v.size:v,Dt=z&&!U(v.click)?v.click:v,F=document.createElement("li");n.keyboard&&F.setAttribute("tabindex",0),F.setAttribute("role","button"),f(F,"".concat(g,"-").concat(V)),y(Dt)||Rt(F,yt,V),I(X)&&f(F,ht(X)),["small","large"].indexOf(tt)!==-1?f(F,"".concat(g,"-").concat(tt)):V==="play"&&f(F,"".concat(g,"-large")),y(Dt)&&d(F,Z,Dt),m.appendChild(F)}}),u.appendChild(m)}else f(u,W);if(!n.rotatable){var N=u.querySelectorAll('li[class*="rotate"]');f(N,at),T(N,function(v){u.appendChild(v)})}if(n.inline)f(h,ci),R(o,{zIndex:n.zIndexInline}),window.getComputedStyle(r).position==="static"&&R(r,{position:"relative"}),r.insertBefore(o,i.nextSibling);else{f(h,ui),f(o,zt),f(o,pt),f(o,W),R(o,{zIndex:n.zIndex});var S=n.container;st(S)&&(S=i.ownerDocument.querySelector(S)),S||(S=this.body),S.appendChild(o)}if(n.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,y(n.ready)&&d(i,oe,n.ready,{once:!0}),x(i,oe)===!1){this.ready=!1;return}this.ready&&n.inline&&this.view(this.index)}}}],[{key:"noConflict",value:function(){return window.Viewer=ki,e}},{key:"setDefaults",value:function(i){k(Kt,rt(i)&&i)}}]),e}();k(J.prototype,Ai,Ii,_i,Ni,Ci);/*! * v-viewer v3.0.10 * https://github.com/mirari/v-viewer#readme * * Copyright 2021 mirari * Released under the MIT license * * Date: 2021-09-21T05:13:15.278Z */var dt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Pe=function(e){return e},zi=function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)},Te=Math.max,ji=function(e,t,i){return t=Te(t===void 0?e.length-1:t,0),function(){for(var n=arguments,r=-1,a=Te(n.length-t,0),o=Array(a);++r0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(hn),vn=Pe,mn=ji,gn=dn,pn=function(e,t){return gn(mn(e,t,vn),e+"")},He=function(e,t){return e===t||e!=e&&t!=t},qe=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991},bn=Xe,wn=qe,Ue=function(e){return e!=null&&wn(e.length)&&!bn(e)},yn=/^(?:0|[1-9]\d*)$/,$e=function(e,t){var i=typeof e;return!!(t=t==null?9007199254740991:t)&&(i=="number"||i!="symbol"&&yn.test(e))&&e>-1&&e%1==0&&e2?t[2]:void 0;for(r&&or(t[0],t[1],r)&&(n=1);++i0}}),!0})();const hr=Object.prototype.propertyIsEnumerable,ze=Object.getOwnPropertySymbols;function wt(e){return typeof e=="function"||toString.call(e)==="[object Object]"}function fr(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"}function dr(e,...t){if(!wt(e))throw new TypeError("expected the first argument to be an object");if(t.length===0||typeof Symbol!="function"||typeof ze!="function")return e;for(const i of t){const n=ze(i);for(const r of n)hr.call(i,r)&&(e[r]=i[r])}return e}function Ze(e,...t){let i=0;var n;for((typeof(n=e)=="object"?n===null:typeof n!="function")&&(e=t[i++]),e||(e={});i{t=Ze(t,{inline:!1});const i=document.createElement("div"),n=qt("div",{style:{display:"none"},class:["__viewer-token"]},e.map(s=>qt("img",typeof s=="string"?{src:s}:s)));Ut(n,i);const r=i.firstElementChild;document.body.appendChild(r);const a=new J(r,t),o=a.destroy.bind(a);return a.destroy=function(){return o(),Ut(null,i),a},a.show(),r.addEventListener("hidden",function(){this.viewer===a&&a.destroy()}),a};var mr=Tt,gr=/\s/,pr=function(e){for(var t=e.length;t--&&gr.test(e.charAt(t)););return t},br=/^\s+/,wr=Ot,yr=St,Er=function(e){return e&&e.slice(0,pr(e)+1).replace(br,"")},je=Q,Tr=function(e){return typeof e=="symbol"||yr(e)&&wr(e)=="[object Symbol]"},Or=/^[-+]0x[0-9a-f]+$/i,Sr=/^0b[01]+$/i,Dr=/^0o[0-7]+$/i,xr=parseInt,Ar=Q,kt=function(){return mr.Date.now()},Re=function(e){if(typeof e=="number")return e;if(Tr(e))return NaN;if(je(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=je(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Er(e);var i=Sr.test(e);return i||Dr.test(e)?xr(e.slice(2),i?2:8):Or.test(e)?NaN:+e},Ir=Math.max,_r=Math.min,Nr=function(e,t,i){var n,r,a,o,s,u,l=0,h=!1,c=!1,m=!0;if(typeof e!="function")throw new TypeError("Expected a function");function b(v){var C=n,z=r;return n=r=void 0,l=v,o=e.apply(z,C)}function p(v){return l=v,s=setTimeout(A,t),h?b(v):o}function _(v){var C=v-u;return u===void 0||C>=t||C<0||c&&v-l>=a}function A(){var v=kt();if(_(v))return N(v);s=setTimeout(A,function(C){var z=t-(C-u);return c?_r(z,a-(C-l)):z}(v))}function N(v){return s=void 0,m&&n?b(v):(n=r=void 0,o)}function S(){var v=kt(),C=_(v);if(n=arguments,r=this,u=v,C){if(s===void 0)return p(u);if(c)return clearTimeout(s),s=setTimeout(A,t),b(u)}return s===void 0&&(s=setTimeout(A,t)),o}return t=Re(t)||0,Ar(i)&&(h=!!i.leading,a=(c="maxWait"in i)?Ir(Re(i.maxWait)||0,t):a,m="trailing"in i?!!i.trailing:m),S.cancel=function(){s!==void 0&&clearTimeout(s),l=0,n=u=r=s=void 0},S.flush=function(){return s===void 0?o:N(kt())},S};const Cr=({name:e="viewer",debug:t=!1}={})=>{function i(o,s,u=!1,l=!1){return Ht(this,null,function*(){yield mt(),l&&!function(h){const c=h.innerHTML.match(//g),m=c?c.join(""):void 0;return h.__viewerImageDiffCache===m?(a("Element change detected, but image(s) has not changed"),!1):(a("Image change detected"),h.__viewerImageDiffCache=m,!0)}(o)||(u||!o[`$${e}`]?(n(o),o[`$${e}`]=new J(o,s),a("Viewer created")):(o[`$${e}`].update(),a("Viewer updated")))})}function n(o){o[`$${e}`]&&(o[`$${e}`].destroy(),delete o[`$${e}`],a("Viewer destroyed"))}function r(o){o.__viewerMutationObserver&&(o.__viewerMutationObserver.disconnect(),delete o.__viewerMutationObserver,a("observer destroyed"))}function a(...o){t&&console.log(...o)}return{mounted(o,s,u){a("Viewer bind");const l=Nr(i,50);l(o,s.value),function(h,c,m,b){h.__viewerUnwatch=vt(()=>c.value,(p,_)=>{a("Change detected by watcher: ",c.value),b(h,p,!0,!1)},{deep:!0}),a("Watcher created, expression: ",c.value)}(o,s,0,l),s.modifiers.static||function(h,c,m,b){r(h);const p=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(!p)return void a("Observer not supported");const _=new p(A=>{A.forEach(N=>{a(`Viewer mutation:${N.type}`),m(h,c,b,!0)})});_.observe(h,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),h.__viewerMutationObserver=_,a("Observer created")}(o,s.value,l,s.modifiers.rebuild)},unmounted(o){a("Viewer unbind"),r(o),function(s){s.__viewerUnwatch&&(s.__viewerUnwatch(),delete s.__viewerUnwatch,a("Watcher destroyed"))}(o),n(o)}}};var Ge=Je({name:"Viewer",props:{images:{type:Array,default:()=>[]},rebuild:{type:Boolean,default:!1},trigger:{type:Object,default:null},options:{type:Object,default:()=>null}},emits:["inited"],setup(e,{emit:t}){let i;const n=ii();function r(){i=new J(n.value,e.options),t("inited",i)}function a(){i&&i.destroy()}function o(){a(),r()}function s(){i?(i.update(),t("inited",i)):r()}function u(){e.rebuild?o():s()}const l={deep:!0};return vt(()=>e.images,()=>mt(()=>u()),l),vt(()=>e.trigger,()=>mt(()=>u()),l),vt(()=>e.options,()=>mt(()=>o()),l),ni(()=>r()),ri(()=>a()),{root:n,createViewer:r,rebuildViewer:o,updateViewer:s,destroyViewer:a}}});const kr={ref:"root"};Ge.render=function(e,t,i,n,r,a){return Qe(),ti("div",kr,[ei(e.$slots,"default",{images:e.images,options:e.options})],512)};var jr={install(e,{name:t="viewer",debug:i=!1,defaultOptions:n}={}){n&&J.setDefaults(n),e.config.globalProperties[`$${t}Api`]=vr,e.component(t,ur(Ge,{name:t})),e.directive(t,Cr({name:t,debug:i}))},setDefaults(e){J.setDefaults(e)}};export{jr as t};