/*! * Viewer.js v1.10.4 * https://fengyuanchen.github.io/viewerjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2022-02-13T08:40:00.127Z */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Viewer=e()}(this,function(){"use strict";function e(e,t){var i,n=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)),n}function l(n){for(var t=1;t=this.length||this.viewed&&t===this.index)return this;if(!this.isShown)return this.index=t,this.show();this.viewing&&this.viewing.abort();var e=this.element,n=this.options,l=this.title,o=this.canvas,s=this.items[t],a=s.querySelector("img"),r=pt(a,"originalUrl"),c=a.getAttribute("alt"),h=document.createElement("img");if(z(n.inheritedAttributes,function(t){var e=a.getAttribute(t);null!==e&&h.setAttribute(t,e)}),h.src=r,h.alt=c,k(n.view)&&T(e,"view",n.view,{once:!0}),!1===D(e,"view",{originalImage:this.images[t],index:t,image:h})||!this.isShown||this.hiding||this.played)return this;function u(){var t=i.imageData,e=Array.isArray(n.title)?n.title[1]:n.title;l.innerHTML=ot(e=k(e)?e.call(i,h,t):"".concat(c," (").concat(t.naturalWidth," × ").concat(t.naturalHeight,")"))?e.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">"):e}var d,m,r=this.items[this.index];r&&(v(r,b),r.removeAttribute("aria-selected")),f(s,b),s.setAttribute("aria-selected",!0),n.focus&&s.focus(),this.image=h,this.viewed=!1,this.index=t,this.imageData={},f(h,R),n.loading&&f(o,F),o.innerHTML="",o.appendChild(h),this.renderList(),l.innerHTML="";return T(e,Q,u,{once:!0}),this.viewing={abort:function(){p(e,Q,u),h.complete?i.imageRendering?i.imageRendering.abort():i.imageInitializing&&i.imageInitializing.abort():(h.src="",p(h,H,d),i.timeout&&clearTimeout(i.timeout))}},h.complete?this.load():(T(h,H,d=function(){p(h,B,m),i.load()},{once:!0}),T(h,B,m=function(){p(h,H,d),i.timeout&&(clearTimeout(i.timeout),i.timeout=!1),v(h,R),n.loading&&v(i.canvas,F)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){v(h,R),i.timeout=!1},1e3)),this},prev:function(){var t=this.index-1;return t<0&&(t=0Math.abs(r)&&(this.pointers={},1
',h=(i=h.querySelector(".".concat(g,"-container"))).querySelector(".".concat(g,"-title")),n=i.querySelector(".".concat(g,"-toolbar")),l=i.querySelector(".".concat(g,"-navbar")),o=i.querySelector(".".concat(g,"-button")),a=i.querySelector(".".concat(g,"-canvas")),this.parent=e,this.viewer=i,this.title=h,this.toolbar=n,this.navbar=l,this.button=o,this.canvas=a,this.footer=i.querySelector(".".concat(g,"-footer")),this.tooltipBox=i.querySelector(".".concat(g,"-tooltip")),this.player=i.querySelector(".".concat(g,"-player")),this.list=i.querySelector(".".concat(g,"-list")),i.id="".concat(g).concat(this.id),h.id="".concat(g,"Title").concat(this.id),f(h,s.title?Dt(Array.isArray(s.title)?s.title[0]:s.title):A),f(l,s.navbar?Dt(s.navbar):A),gt(o,A,!s.button),s.keyboard&&o.setAttribute("tabindex",0),s.backdrop&&(f(i,"".concat(g,"-backdrop")),s.inline||"static"===s.backdrop||bt(a,et,"hide")),ot(s.className)&&s.className&&s.className.split(it).forEach(function(t){f(i,t)}),s.toolbar?(c=document.createElement("ul"),r=lt(s.toolbar),u=nt.slice(0,3),d=nt.slice(7,9),m=nt.slice(9),r||f(n,Dt(s.toolbar)),z(r?s.toolbar:nt,function(t,e){var i,n=r&<(t),e=r?vt(e):t,o=n&&!at(t.show)?t.show:t;!o||!s.zoomable&&-1!==u.indexOf(e)||!s.rotatable&&-1!==d.indexOf(e)||!s.scalable&&-1!==m.indexOf(e)||(i=n&&!at(t.size)?t.size:t,n=n&&!at(t.click)?t.click:t,t=document.createElement("li"),s.keyboard&&t.setAttribute("tabindex",0),t.setAttribute("role","button"),f(t,"".concat(g,"-").concat(e)),k(n)||bt(t,et,e),x(o)&&f(t,Dt(o)),-1!==["small","large"].indexOf(i)?f(t,"".concat(g,"-").concat(i)):"play"===e&&f(t,"".concat(g,"-large")),k(n)&&T(t,M,n),c.appendChild(t))}),n.appendChild(c)):f(n,A),s.rotatable||(f(h=n.querySelectorAll('li[class*="rotate"]'),R),z(h,function(t){n.appendChild(t)})),s.inline?(f(o,I),dt(i,{zIndex:s.zIndexInline}),"static"===window.getComputedStyle(e).position&&dt(e,{position:"relative"}),e.insertBefore(i,t.nextSibling)):(f(o,w),f(i,E),f(i,y),f(i,A),dt(i,{zIndex:s.zIndex}),(l=(l=ot(l=s.container)?t.ownerDocument.querySelector(l):l)||this.body).appendChild(i)),s.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,k(s.ready)&&T(t,G,s.ready,{once:!0}),!1!==D(t,G)?this.ready&&s.inline&&this.view(this.index):this.ready=!1)}}])&&n(t.prototype,e),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),o}();return ct(o.prototype,r,t,At,St,Ot),o});