@teipublisher/pb-components 2.8.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +1 -0
- package/css/tify/tify.css +6 -0
- package/dist/demo/demos.json +3 -0
- package/dist/demo/pb-tify.html +25 -0
- package/dist/jinn-codemirror-13c59456.js +1 -0
- package/dist/pb-code-editor.js +1 -1
- package/dist/pb-components-bundle.js +4 -4
- package/dist/pb-elements.json +105 -2
- package/dist/pb-odd-editor.js +1 -1
- package/dist/pb-tify.js +27 -0
- package/i18n/common/cs.json +4 -1
- package/package.json +3 -2
- package/pb-elements.json +105 -2
- package/src/authority/anton.js +2 -1
- package/src/pb-facs-link.js +2 -1
- package/src/pb-tify.js +113 -0
- package/dist/jinn-codemirror-9718e0e0.js +0 -1
package/dist/pb-tify.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{p as e,L as t,w as i,r as n}from"./pb-mixin-ea2e9070.js";
|
|
2
|
+
/*!
|
|
3
|
+
* TIFY v0.28.1
|
|
4
|
+
* (c) 2017-2022 Göttingen State and University Library (https://www.sub.uni-goettingen.de/en/)
|
|
5
|
+
* AGPL-3.0
|
|
6
|
+
* https://tify.rocks/
|
|
7
|
+
*/function r(e){if(!document.querySelector("link#pb-tify")){const t=document.createElement("link");t.type="text/css",t.rel="stylesheet",t.id="pb-tify",t.href=n(e)+"/tify.css",document.head.appendChild(t)}}!function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}({0:function(e,t,i){e.exports=i("56d7")},"00ee":function(e,t,i){var n={};n[i("b622")("toStringTag")]="z",e.exports="[object z]"===String(n)},"06cf":function(e,t,i){var n=i("83ab"),r=i("c65b"),o=i("d1e7"),s=i("5c6c"),a=i("fc6a"),l=i("a04b"),c=i("1a2d"),u=i("0cfb"),h=Object.getOwnPropertyDescriptor;t.f=n?h:function(e,t){if(e=a(e),t=l(t),u)try{return h(e,t)}catch(e){}if(c(e,t))return s(!r(o.f,e,t),e[t])}},"07d2":function(e,t,i){var n;!function(r){if("function"!=typeof o){var o=function(e){return e};o.nonNative=!0}const s=o("plaintext"),a=o("html"),l=o("comment"),c=/<(\w*)>/g,u=/<\/?([^\s\/>]+)/;function h(e,t,i){return f(e=e||"",p(t=t||[],i=i||""))}function d(e,t){let i=p(e=e||[],t=t||"");return function(e){return f(e||"",i)}}function p(e,t){return{allowable_tags:e=g(e),tag_replacement:t,state:s,tag_buffer:"",depth:0,in_quote_char:""}}function f(e,t){if("string"!=typeof e)throw new TypeError("'html' parameter must be a string");let i=t.allowable_tags,n=t.tag_replacement,r=t.state,o=t.tag_buffer,c=t.depth,u=t.in_quote_char,h="";for(let t=0,d=e.length;t<d;t++){let d=e[t];if(r===s)switch(d){case"<":r=a,o+=d;break;default:h+=d}else if(r===a)switch(d){case"<":if(u)break;c++;break;case">":if(u)break;if(c){c--;break}u="",r=s,o+=">",i.has(v(o))?h+=o:h+=n,o="";break;case'"':case"'":u=d===u?"":u||d,o+=d;break;case"-":"<!-"===o&&(r=l),o+=d;break;case" ":case"\n":if("<"===o){r=s,h+="< ",o="";break}o+=d;break;default:o+=d}else if(r===l)switch(d){case">":"--"==o.slice(-2)&&(r=s),o="";break;default:o+=d}}return t.state=r,t.tag_buffer=o,t.depth=c,t.in_quote_char=u,h}function g(e){let t=new Set;if("string"==typeof e){let i;for(;i=c.exec(e);)t.add(i[1])}else o.nonNative||"function"!=typeof e[o.iterator]?"function"==typeof e.forEach&&e.forEach(t.add,t):t=new Set(e);return t}function v(e){let t=u.exec(e);return t?t[1].toLowerCase():null}h.init_streaming_mode=d,void 0===(n=function(){return h}.call(t,i,t,e))||(e.exports=n)}()},"07fa":function(e,t,i){var n=i("50c4");e.exports=function(e){return n(e.length)}},"0a06":function(e,t,i){var n=i("c532"),r=i("30b5"),o=i("f6b4"),s=i("5270"),a=i("4a7b"),l=i("83b9"),c=i("848b"),u=c.validators;function h(e){this.defaults=e,this.interceptors={request:new o,response:new o}}h.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var i=t.transitional;void 0!==i&&c.assertOptions(i,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(r=r&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var o,l=[];if(this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)})),!r){var h=[s,void 0];for(Array.prototype.unshift.apply(h,n),h=h.concat(l),o=Promise.resolve(t);h.length;)o=o.then(h.shift(),h.shift());return o}for(var d=t;n.length;){var p=n.shift(),f=n.shift();try{d=p(d)}catch(e){f(e);break}}try{o=s(d)}catch(e){return Promise.reject(e)}for(;l.length;)o=o.then(l.shift(),l.shift());return o},h.prototype.getUri=function(e){e=a(this.defaults,e);var t=l(e.baseURL,e.url);return r(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],(function(e){h.prototype[e]=function(t,i){return this.request(a(i||{},{method:e,url:t,data:(i||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){function t(t){return function(i,n,r){return this.request(a(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}h.prototype[e]=t(),h.prototype[e+"Form"]=t(!0)})),e.exports=h},"0cfb":function(e,t,i){var n=i("83ab"),r=i("d039"),o=i("cc12");e.exports=!n&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},"0d51":function(e,t){var i=String;e.exports=function(e){try{return i(e)}catch(e){return"Object"}}},"0df6":function(e,t,i){e.exports=function(e){return function(t){return e.apply(null,t)}}},"13d2":function(e,t,i){var n=i("d039"),r=i("1626"),o=i("1a2d"),s=i("83ab"),a=i("5e77").CONFIGURABLE,l=i("8925"),c=i("69f3"),u=c.enforce,h=c.get,d=Object.defineProperty,p=s&&!n((function(){return 8!==d((function(){}),"length",{value:8}).length})),f=String(String).split("String"),g=e.exports=function(e,t,i){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!o(e,"name")||a&&e.name!==t)&&(s?d(e,"name",{value:t,configurable:!0}):e.name=t),p&&i&&o(i,"arity")&&e.length!==i.arity&&d(e,"length",{value:i.arity});try{i&&o(i,"constructor")&&i.constructor?s&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=u(e);return o(n,"source")||(n.source=f.join("string"==typeof t?t:"")),e};Function.prototype.toString=g((function(){return r(this)&&h(this).source||l(this)}),"toString")},1626:function(e,t){e.exports=function(e){return"function"==typeof e}},"1a2d":function(e,t,i){var n=i("e330"),r=i("7b0b"),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(r(e),t)}},"1b80":function(e,t){e.exports={computed:{customPageViewActive(){if(!this.$root.options.pages)return!1;const{pages:e}=this.$root.options;return e.length>2||2===e.length&&(e[0]%2>0||e[1]!==e[0]+1)&&e[1]>0},isFirstPage(){return this.$root.options.pages[0]<2},isLastPage(){const{pages:e}=this.$root.options,t=this.$root.pageCount;return e[0]>=t||e[e.length-1]>=t}},methods:{goToFirstPage(){this.$root.setPage(1)},goToNextPage(){const{pages:e}=this.$root.options;let t=e[0]+1;e.length>1&&t%2>0&&t<this.$root.pageCount&&(t+=1),this.$root.setPage(t)},goToLastPage(){this.$root.setPage(this.$root.pageCount)},goToPreviousPage(){const{pages:e}=this.$root.options;let t=e[0]-1;e.length>1&&t%2>0&&t>0&&(t-=1),this.$root.setPage(t)}}}},"1d2b":function(e,t,i){e.exports=function(e,t){return function(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];return e.apply(t,i)}}},"1d80":function(e,t){var i=TypeError;e.exports=function(e){if(null==e)throw i("Can't call method on "+e);return e}},"1fb5":function(e,t,i){t.byteLength=u,t.toByteArray=d,t.fromByteArray=g;for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a<l;++a)n[a]=s[a],r[s.charCodeAt(a)]=a;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function u(e){var t=c(e),i=t[0],n=t[1];return 3*(i+n)/4-n}function h(e,t,i){return 3*(t+i)/4-i}function d(e){var t,i,n=c(e),s=n[0],a=n[1],l=new o(h(e,s,a)),u=0,d=a>0?s-4:s;for(i=0;i<d;i+=4)t=r[e.charCodeAt(i)]<<18|r[e.charCodeAt(i+1)]<<12|r[e.charCodeAt(i+2)]<<6|r[e.charCodeAt(i+3)],l[u++]=t>>16&255,l[u++]=t>>8&255,l[u++]=255&t;return 2===a&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,l[u++]=255&t),1===a&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t),l}function p(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function f(e,t,i){for(var n,r=[],o=t;o<i;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),r.push(p(n));return r.join("")}function g(e){for(var t,i=e.length,r=i%3,o=[],s=16383,a=0,l=i-r;a<l;a+=s)o.push(f(e,a,a+s>l?l:a+s));return 1===r?(t=e[i-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},"23cb":function(e,t,i){var n=i("5926"),r=Math.max,o=Math.min;e.exports=function(e,t){var i=n(e);return i<0?r(i+t,0):o(i,t)}},"23e7":function(e,t,i){var n=i("da84"),r=i("06cf").f,o=i("9112"),s=i("cb2d"),a=i("6374"),l=i("e893"),c=i("94ca");e.exports=function(e,t){var i,u,h,d,p,f=e.target,g=e.global,v=e.stat;if(i=g?n:v?n[f]||a(f,{}):(n[f]||{}).prototype)for(u in t){if(d=t[u],e.dontCallGetSet?h=(p=r(i,u))&&p.value:h=i[u],!c(g?u:f+(v?".":"#")+u,e.forced)&&void 0!==h){if(typeof d==typeof h)continue;l(d,h)}(e.sham||h&&h.sham)&&o(d,"sham",!0),s(i,u,d,e)}}},"241c":function(e,t,i){var n=i("ca84"),r=i("7839").concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,r)}},"2b0e":function(e,t,i){(function(e){i.d(t,"a",(function(){return Gn}));
|
|
8
|
+
/*!
|
|
9
|
+
* Vue.js v2.7.13
|
|
10
|
+
* (c) 2014-2022 Evan You
|
|
11
|
+
* Released under the MIT License.
|
|
12
|
+
*/
|
|
13
|
+
var n=Object.freeze({}),r=Array.isArray;function o(e){return null==e}function s(e){return null!=e}function a(e){return!0===e}function l(e){return!1===e}function c(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function u(e){return"function"==typeof e}function h(e){return null!==e&&"object"==typeof e}var d=Object.prototype.toString;function p(e){return"[object Object]"===d.call(e)}function f(e){return"[object RegExp]"===d.call(e)}function g(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function v(e){return s(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function m(e){return null==e?"":Array.isArray(e)||p(e)&&e.toString===d?JSON.stringify(e,null,2):String(e)}function y(e){var t=parseFloat(e);return isNaN(t)?e:t}function w(e,t){for(var i=Object.create(null),n=e.split(","),r=0;r<n.length;r++)i[n[r]]=!0;return t?function(e){return i[e.toLowerCase()]}:function(e){return i[e]}}w("slot,component",!0);var x=w("key,ref,slot,slot-scope,is");function b(e,t){var i=e.length;if(i){if(t===e[i-1])return void(e.length=i-1);var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var _=Object.prototype.hasOwnProperty;function T(e,t){return _.call(e,t)}function S(e){var t=Object.create(null);return function(i){return t[i]||(t[i]=e(i))}}var E=/-(\w)/g,P=S((function(e){return e.replace(E,(function(e,t){return t?t.toUpperCase():""}))})),C=S((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),R=/\B([A-Z])/g,k=S((function(e){return e.replace(R,"-$1").toLowerCase()}));function O(e,t){function i(i){var n=arguments.length;return n?n>1?e.apply(t,arguments):e.call(t,i):e.call(t)}return i._length=e.length,i}function I(e,t){return e.bind(t)}var D=Function.prototype.bind?I:O;function A(e,t){t=t||0;for(var i=e.length-t,n=new Array(i);i--;)n[i]=e[i+t];return n}function L(e,t){for(var i in t)e[i]=t[i];return e}function H(e){for(var t={},i=0;i<e.length;i++)e[i]&&L(t,e[i]);return t}function M(e,t,i){}var B=function(e,t,i){return!1},$=function(e){return e};function F(e,t){if(e===t)return!0;var i=h(e),n=h(t);if(!i||!n)return!i&&!n&&String(e)===String(t);try{var r=Array.isArray(e),o=Array.isArray(t);if(r&&o)return e.length===t.length&&e.every((function(e,i){return F(e,t[i])}));if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(r||o)return!1;var s=Object.keys(e),a=Object.keys(t);return s.length===a.length&&s.every((function(i){return F(e[i],t[i])}))}catch(e){return!1}}function N(e,t){for(var i=0;i<e.length;i++)if(F(e[i],t))return i;return-1}function z(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}function V(e,t){return e===t?0===e&&1/e!=1/t:e==e||t==t}var j="data-server-rendered",U=["component","directive","filter"],W=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch","renderTracked","renderTriggered"],G={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:B,isReservedAttr:B,isUnknownElement:B,getTagNamespace:M,parsePlatformTagName:$,mustUseProp:B,async:!0,_lifecycleHooks:W};function q(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function Z(e,t,i,n){Object.defineProperty(e,t,{value:i,enumerable:!!n,writable:!0,configurable:!0})}var X=new RegExp("[^".concat(/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/.source,".$_\\d]"));function Y(e){if(!X.test(e)){var t=e.split(".");return function(e){for(var i=0;i<t.length;i++){if(!e)return;e=e[t[i]]}return e}}}var K="__proto__"in{},Q="undefined"!=typeof window,J=Q&&window.navigator.userAgent.toLowerCase(),ee=J&&/msie|trident/.test(J),te=J&&J.indexOf("msie 9.0")>0,ie=J&&J.indexOf("edge/")>0;J&&J.indexOf("android");var ne=J&&/iphone|ipad|ipod|ios/.test(J);J&&/chrome\/\d+/.test(J),J&&/phantomjs/.test(J);var re,oe=J&&J.match(/firefox\/(\d+)/),se={}.watch,ae=!1;if(Q)try{var le={};Object.defineProperty(le,"passive",{get:function(){ae=!0}}),window.addEventListener("test-passive",null,le)}catch(e){}var ce=function(){return void 0===re&&(re=!Q&&void 0!==e&&e.process&&"server"===e.process.env.VUE_ENV),re},ue=Q&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function he(e){return"function"==typeof e&&/native code/.test(e.toString())}var de,pe="undefined"!=typeof Symbol&&he(Symbol)&&"undefined"!=typeof Reflect&&he(Reflect.ownKeys);de="undefined"!=typeof Set&&he(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var fe=null;function ge(e){void 0===e&&(e=null),e||fe&&fe._scope.off(),fe=e,e&&e._scope.on()}var ve=function(){function e(e,t,i,n,r,o,s,a){this.tag=e,this.data=t,this.children=i,this.text=n,this.elm=r,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=s,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(e.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),e}(),me=function(e){void 0===e&&(e="");var t=new ve;return t.text=e,t.isComment=!0,t};function ye(e){return new ve(void 0,void 0,void 0,String(e))}function we(e){var t=new ve(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var xe=0,be=[],_e=function(){for(var e=0;e<be.length;e++){var t=be[e];t.subs=t.subs.filter((function(e){return e})),t._pending=!1}be.length=0},Te=function(){function e(){this._pending=!1,this.id=xe++,this.subs=[]}return e.prototype.addSub=function(e){this.subs.push(e)},e.prototype.removeSub=function(e){this.subs[this.subs.indexOf(e)]=null,this._pending||(this._pending=!0,be.push(this))},e.prototype.depend=function(t){e.target&&e.target.addDep(this)},e.prototype.notify=function(e){for(var t=this.subs.filter((function(e){return e})),i=0,n=t.length;i<n;i++){t[i].update()}},e}();Te.target=null;var Se=[];function Ee(e){Se.push(e),Te.target=e}function Pe(){Se.pop(),Te.target=Se[Se.length-1]}var Ce=Array.prototype,Re=Object.create(Ce);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(e){var t=Ce[e];Z(Re,e,(function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var r,o=t.apply(this,i),s=this.__ob__;switch(e){case"push":case"unshift":r=i;break;case"splice":r=i.slice(2)}return r&&s.observeArray(r),s.dep.notify(),o}))}));var ke=new WeakMap;function Oe(e){return Ie(e,!0),Z(e,"__v_isShallow",!0),e}function Ie(e,t){De(e)||Ne(e,t,ce())}function De(e){return!(!e||!e.__v_isReadonly)}var Ae=Object.getOwnPropertyNames(Re),Le={},He=!0;function Me(e){He=e}var Be,$e={notify:M,depend:M,addSub:M,removeSub:M},Fe=function(){function e(e,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=!1),this.value=e,this.shallow=t,this.mock=i,this.dep=i?$e:new Te,this.vmCount=0,Z(e,"__ob__",this),r(e)){if(!i)if(K)e.__proto__=Re;else for(var n=0,o=Ae.length;n<o;n++){var s=Ae[n];Z(e,s,Re[s])}t||this.observeArray(e)}else{var a=Object.keys(e);for(n=0;n<a.length;n++)ze(e,s=a[n],Le,void 0,t,i)}}return e.prototype.observeArray=function(e){for(var t=0,i=e.length;t<i;t++)Ne(e[t],!1,this.mock)},e}();function Ne(e,t,i){return e&&T(e,"__ob__")&&e.__ob__ instanceof Fe?e.__ob__:!He||!i&&ce()||!r(e)&&!p(e)||!Object.isExtensible(e)||e.__v_skip||ke.has(e)||We(e)||e instanceof ve?void 0:new Fe(e,t,i)}function ze(e,t,i,n,o,s){var a=new Te,l=Object.getOwnPropertyDescriptor(e,t);if(!l||!1!==l.configurable){var c=l&&l.get,u=l&&l.set;c&&!u||i!==Le&&2!==arguments.length||(i=e[t]);var h=!o&&Ne(i,!1,s);return Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=c?c.call(e):i;return Te.target&&(a.depend(),h&&(h.dep.depend(),r(t)&&Ue(t))),We(t)&&!o?t.value:t},set:function(t){var n=c?c.call(e):i;if(V(n,t)){if(u)u.call(e,t);else{if(c)return;if(!o&&We(n)&&!We(t))return void(n.value=t);i=t}h=!o&&Ne(t,!1,s),a.notify()}}}),a}}function Ve(e,t,i){if(!De(e)){var n=e.__ob__;return r(e)&&g(t)?(e.length=Math.max(e.length,t),e.splice(t,1,i),n&&!n.shallow&&n.mock&&Ne(i,!1,!0),i):t in e&&!(t in Object.prototype)?(e[t]=i,i):e._isVue||n&&n.vmCount?i:n?(ze(n.value,t,i,void 0,n.shallow,n.mock),n.dep.notify(),i):(e[t]=i,i)}}function je(e,t){if(r(e)&&g(t))e.splice(t,1);else{var i=e.__ob__;e._isVue||i&&i.vmCount||De(e)||T(e,t)&&(delete e[t],i&&i.dep.notify())}}function Ue(e){for(var t=void 0,i=0,n=e.length;i<n;i++)(t=e[i])&&t.__ob__&&t.__ob__.dep.depend(),r(t)&&Ue(t)}function We(e){return!(!e||!0!==e.__v_isRef)}function Ge(e,t,i){Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:function(){var e=t[i];if(We(e))return e.value;var n=e&&e.__ob__;return n&&n.dep.depend(),e},set:function(e){var n=t[i];We(n)&&!We(e)?n.value=e:t[i]=e}})}var qe=function(){function e(e){void 0===e&&(e=!1),this.detached=e,this.active=!0,this.effects=[],this.cleanups=[],this.parent=Be,!e&&Be&&(this.index=(Be.scopes||(Be.scopes=[])).push(this)-1)}return e.prototype.run=function(e){if(this.active){var t=Be;try{return Be=this,e()}finally{Be=t}}},e.prototype.on=function(){Be=this},e.prototype.off=function(){Be=this.parent},e.prototype.stop=function(e){if(this.active){var t=void 0,i=void 0;for(t=0,i=this.effects.length;t<i;t++)this.effects[t].teardown();for(t=0,i=this.cleanups.length;t<i;t++)this.cleanups[t]();if(this.scopes)for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].stop(!0);if(!this.detached&&this.parent&&!e){var n=this.parent.scopes.pop();n&&n!==this&&(this.parent.scopes[this.index]=n,n.index=this.index)}this.parent=void 0,this.active=!1}},e}();function Ze(e,t){void 0===t&&(t=Be),t&&t.active&&t.effects.push(e)}function Xe(e){var t=e._provided,i=e.$parent&&e.$parent._provided;return i===t?e._provided=Object.create(i):t}var Ye=S((function(e){var t="&"===e.charAt(0),i="~"===(e=t?e.slice(1):e).charAt(0),n="!"===(e=i?e.slice(1):e).charAt(0);return{name:e=n?e.slice(1):e,once:i,capture:n,passive:t}}));function Ke(e,t){function i(){var e=i.fns;if(!r(e))return qt(e,null,arguments,t,"v-on handler");for(var n=e.slice(),o=0;o<n.length;o++)qt(n[o],null,arguments,t,"v-on handler")}return i.fns=e,i}function Qe(e,t,i,n,r,s){var l,c,u,h;for(l in e)c=e[l],u=t[l],h=Ye(l),o(c)||(o(u)?(o(c.fns)&&(c=e[l]=Ke(c,s)),a(h.once)&&(c=e[l]=r(h.name,c,h.capture)),i(h.name,c,h.capture,h.passive,h.params)):c!==u&&(u.fns=c,e[l]=u));for(l in t)o(e[l])&&n((h=Ye(l)).name,t[l],h.capture)}function Je(e,t,i){var n;e instanceof ve&&(e=e.data.hook||(e.data.hook={}));var r=e[t];function l(){i.apply(this,arguments),b(n.fns,l)}o(r)?n=Ke([l]):s(r.fns)&&a(r.merged)?(n=r).fns.push(l):n=Ke([r,l]),n.merged=!0,e[t]=n}function et(e,t,i){var n=t.options.props;if(!o(n)){var r={},a=e.attrs,l=e.props;if(s(a)||s(l))for(var c in n){var u=k(c);tt(r,l,c,u,!0)||tt(r,a,c,u,!1)}return r}}function tt(e,t,i,n,r){if(s(t)){if(T(t,i))return e[i]=t[i],r||delete t[i],!0;if(T(t,n))return e[i]=t[n],r||delete t[n],!0}return!1}function it(e){for(var t=0;t<e.length;t++)if(r(e[t]))return Array.prototype.concat.apply([],e);return e}function nt(e){return c(e)?[ye(e)]:r(e)?ot(e):void 0}function rt(e){return s(e)&&s(e.text)&&l(e.isComment)}function ot(e,t){var i,n,l,u,h=[];for(i=0;i<e.length;i++)o(n=e[i])||"boolean"==typeof n||(u=h[l=h.length-1],r(n)?n.length>0&&(rt((n=ot(n,"".concat(t||"","_").concat(i)))[0])&&rt(u)&&(h[l]=ye(u.text+n[0].text),n.shift()),h.push.apply(h,n)):c(n)?rt(u)?h[l]=ye(u.text+n):""!==n&&h.push(ye(n)):rt(n)&&rt(u)?h[l]=ye(u.text+n.text):(a(e._isVList)&&s(n.tag)&&o(n.key)&&s(t)&&(n.key="__vlist".concat(t,"_").concat(i,"__")),h.push(n)));return h}function st(e,t){var i,n,o,a,l=null;if(r(e)||"string"==typeof e)for(l=new Array(e.length),i=0,n=e.length;i<n;i++)l[i]=t(e[i],i);else if("number"==typeof e)for(l=new Array(e),i=0;i<e;i++)l[i]=t(i+1,i);else if(h(e))if(pe&&e[Symbol.iterator]){l=[];for(var c=e[Symbol.iterator](),u=c.next();!u.done;)l.push(t(u.value,l.length)),u=c.next()}else for(o=Object.keys(e),l=new Array(o.length),i=0,n=o.length;i<n;i++)a=o[i],l[i]=t(e[a],a,i);return s(l)||(l=[]),l._isVList=!0,l}function at(e,t,i,n){var r,o=this.$scopedSlots[e];o?(i=i||{},n&&(i=L(L({},n),i)),r=o(i)||(u(t)?t():t)):r=this.$slots[e]||(u(t)?t():t);var s=i&&i.slot;return s?this.$createElement("template",{slot:s},r):r}function lt(e){return wn(this.$options,"filters",e)||$}function ct(e,t){return r(e)?-1===e.indexOf(t):e!==t}function ut(e,t,i,n,r){var o=G.keyCodes[t]||i;return r&&n&&!G.keyCodes[t]?ct(r,n):o?ct(o,e):n?k(n)!==t:void 0===e}function ht(e,t,i,n,o){if(i&&h(i)){r(i)&&(i=H(i));var s=void 0,a=function(r){if("class"===r||"style"===r||x(r))s=e;else{var a=e.attrs&&e.attrs.type;s=n||G.mustUseProp(t,a,r)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var l=P(r),c=k(r);l in s||c in s||(s[r]=i[r],!o)||((e.on||(e.on={}))["update:".concat(r)]=function(e){i[r]=e})};for(var l in i)a(l)}return e}function dt(e,t){var i=this._staticTrees||(this._staticTrees=[]),n=i[e];return n&&!t||ft(n=i[e]=this.$options.staticRenderFns[e].call(this._renderProxy,this._c,this),"__static__".concat(e),!1),n}function pt(e,t,i){return ft(e,"__once__".concat(t).concat(i?"_".concat(i):""),!0),e}function ft(e,t,i){if(r(e))for(var n=0;n<e.length;n++)e[n]&&"string"!=typeof e[n]&>(e[n],"".concat(t,"_").concat(n),i);else gt(e,t,i)}function gt(e,t,i){e.isStatic=!0,e.key=t,e.isOnce=i}function vt(e,t){if(t&&p(t)){var i=e.on=e.on?L({},e.on):{};for(var n in t){var r=i[n],o=t[n];i[n]=r?[].concat(r,o):o}}return e}function mt(e,t,i,n){t=t||{$stable:!i};for(var o=0;o<e.length;o++){var s=e[o];r(s)?mt(s,t,i):s&&(s.proxy&&(s.fn.proxy=!0),t[s.key]=s.fn)}return n&&(t.$key=n),t}function yt(e,t){for(var i=0;i<t.length;i+=2){var n=t[i];"string"==typeof n&&n&&(e[t[i]]=t[i+1])}return e}function wt(e,t){return"string"==typeof e?t+e:e}function xt(e){e._o=pt,e._n=y,e._s=m,e._l=st,e._t=at,e._q=F,e._i=N,e._m=dt,e._f=lt,e._k=ut,e._b=ht,e._v=ye,e._e=me,e._u=mt,e._g=vt,e._d=yt,e._p=wt}function bt(e,t){if(!e||!e.length)return{};for(var i={},n=0,r=e.length;n<r;n++){var o=e[n],s=o.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,o.context!==t&&o.fnContext!==t||!s||null==s.slot)(i.default||(i.default=[])).push(o);else{var a=s.slot,l=i[a]||(i[a]=[]);"template"===o.tag?l.push.apply(l,o.children||[]):l.push(o)}}for(var c in i)i[c].every(_t)&&delete i[c];return i}function _t(e){return e.isComment&&!e.asyncFactory||" "===e.text}function Tt(e){return e.isComment&&e.asyncFactory}function St(e,t,i,r){var o,s=Object.keys(i).length>0,a=t?!!t.$stable:!s,l=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==n&&l===r.$key&&!s&&!r.$hasNormal)return r;for(var c in o={},t)t[c]&&"$"!==c[0]&&(o[c]=Et(e,i,c,t[c]))}else o={};for(var u in i)u in o||(o[u]=Pt(i,u));return t&&Object.isExtensible(t)&&(t._normalized=o),Z(o,"$stable",a),Z(o,"$key",l),Z(o,"$hasNormal",s),o}function Et(e,t,i,n){var o=function(){var t=fe;ge(e);var i=arguments.length?n.apply(null,arguments):n({}),o=(i=i&&"object"==typeof i&&!r(i)?[i]:nt(i))&&i[0];return ge(t),i&&(!o||1===i.length&&o.isComment&&!Tt(o))?void 0:i};return n.proxy&&Object.defineProperty(t,i,{get:o,enumerable:!0,configurable:!0}),o}function Pt(e,t){return function(){return e[t]}}function Ct(e){var t=e.$options,i=t.setup;if(i){var n=e._setupContext=Rt(e);ge(e),Ee();var r=qt(i,null,[e._props||Oe({}),n],e,"setup");if(Pe(),ge(),u(r))t.render=r;else if(h(r))if(e._setupState=r,r.__sfc){var o=e._setupProxy={};for(var s in r)"__sfc"!==s&&Ge(o,r,s)}else for(var s in r)q(s)||Ge(e,r,s)}}function Rt(e){return{get attrs(){if(!e._attrsProxy){var t=e._attrsProxy={};Z(t,"_v_attr_proxy",!0),kt(t,e.$attrs,n,e,"$attrs")}return e._attrsProxy},get listeners(){e._listenersProxy||kt(e._listenersProxy={},e.$listeners,n,e,"$listeners");return e._listenersProxy},get slots(){return It(e)},emit:D(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(i){return Ge(e,t,i)}))}}}function kt(e,t,i,n,r){var o=!1;for(var s in t)s in e?t[s]!==i[s]&&(o=!0):(o=!0,Ot(e,s,n,r));for(var s in e)s in t||(o=!0,delete e[s]);return o}function Ot(e,t,i,n){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){return i[n][t]}})}function It(e){return e._slotsProxy||Dt(e._slotsProxy={},e.$scopedSlots),e._slotsProxy}function Dt(e,t){for(var i in t)e[i]=t[i];for(var i in e)i in t||delete e[i]}function At(e){e._vnode=null,e._staticTrees=null;var t=e.$options,i=e.$vnode=t._parentVnode,r=i&&i.context;e.$slots=bt(t._renderChildren,r),e.$scopedSlots=i?St(e.$parent,i.data.scopedSlots,e.$slots):n,e._c=function(t,i,n,r){return Vt(e,t,i,n,r,!1)},e.$createElement=function(t,i,n,r){return Vt(e,t,i,n,r,!0)};var o=i&&i.data;ze(e,"$attrs",o&&o.attrs||n,null,!0),ze(e,"$listeners",t._parentListeners||n,null,!0)}var Lt=null;function Ht(e){xt(e.prototype),e.prototype.$nextTick=function(e){return oi(e,this)},e.prototype._render=function(){var e,t=this,i=t.$options,n=i.render,o=i._parentVnode;o&&t._isMounted&&(t.$scopedSlots=St(t.$parent,o.data.scopedSlots,t.$slots,t.$scopedSlots),t._slotsProxy&&Dt(t._slotsProxy,t.$scopedSlots)),t.$vnode=o;try{ge(t),Lt=t,e=n.call(t._renderProxy,t.$createElement)}catch(i){Gt(i,t,"render"),e=t._vnode}finally{Lt=null,ge()}return r(e)&&1===e.length&&(e=e[0]),e instanceof ve||(e=me()),e.parent=o,e}}function Mt(e,t){return(e.__esModule||pe&&"Module"===e[Symbol.toStringTag])&&(e=e.default),h(e)?t.extend(e):e}function Bt(e,t,i,n,r){var o=me();return o.asyncFactory=e,o.asyncMeta={data:t,context:i,children:n,tag:r},o}function $t(e,t){if(a(e.error)&&s(e.errorComp))return e.errorComp;if(s(e.resolved))return e.resolved;var i=Lt;if(i&&s(e.owners)&&-1===e.owners.indexOf(i)&&e.owners.push(i),a(e.loading)&&s(e.loadingComp))return e.loadingComp;if(i&&!s(e.owners)){var n=e.owners=[i],r=!0,l=null,c=null;i.$on("hook:destroyed",(function(){return b(n,i)}));var u=function(e){for(var t=0,i=n.length;t<i;t++)n[t].$forceUpdate();e&&(n.length=0,null!==l&&(clearTimeout(l),l=null),null!==c&&(clearTimeout(c),c=null))},d=z((function(i){e.resolved=Mt(i,t),r?n.length=0:u(!0)})),p=z((function(t){s(e.errorComp)&&(e.error=!0,u(!0))})),f=e(d,p);return h(f)&&(v(f)?o(e.resolved)&&f.then(d,p):v(f.component)&&(f.component.then(d,p),s(f.error)&&(e.errorComp=Mt(f.error,t)),s(f.loading)&&(e.loadingComp=Mt(f.loading,t),0===f.delay?e.loading=!0:l=setTimeout((function(){l=null,o(e.resolved)&&o(e.error)&&(e.loading=!0,u(!1))}),f.delay||200)),s(f.timeout)&&(c=setTimeout((function(){c=null,o(e.resolved)&&p(null)}),f.timeout)))),r=!1,e.loading?e.loadingComp:e.resolved}}function Ft(e){if(r(e))for(var t=0;t<e.length;t++){var i=e[t];if(s(i)&&(s(i.componentOptions)||Tt(i)))return i}}var Nt=1,zt=2;function Vt(e,t,i,n,o,s){return(r(i)||c(i))&&(o=n,n=i,i=void 0),a(s)&&(o=zt),jt(e,t,i,n,o)}function jt(e,t,i,n,o){if(s(i)&&s(i.__ob__))return me();if(s(i)&&s(i.is)&&(t=i.is),!t)return me();var a,l;if(r(n)&&u(n[0])&&((i=i||{}).scopedSlots={default:n[0]},n.length=0),o===zt?n=nt(n):o===Nt&&(n=it(n)),"string"==typeof t){var c=void 0;l=e.$vnode&&e.$vnode.ns||G.getTagNamespace(t),a=G.isReservedTag(t)?new ve(G.parsePlatformTagName(t),i,n,void 0,void 0,e):i&&i.pre||!s(c=wn(e.$options,"components",t))?new ve(t,i,n,void 0,void 0,e):tn(c,i,e,n,t)}else a=tn(t,i,e,n);return r(a)?a:s(a)?(s(l)&&Ut(a,l),s(i)&&Wt(i),a):me()}function Ut(e,t,i){if(e.ns=t,"foreignObject"===e.tag&&(t=void 0,i=!0),s(e.children))for(var n=0,r=e.children.length;n<r;n++){var l=e.children[n];s(l.tag)&&(o(l.ns)||a(i)&&"svg"!==l.tag)&&Ut(l,t,i)}}function Wt(e){h(e.style)&&li(e.style),h(e.class)&&li(e.class)}function Gt(e,t,i){Ee();try{if(t)for(var n=t;n=n.$parent;){var r=n.$options.errorCaptured;if(r)for(var o=0;o<r.length;o++)try{if(!1===r[o].call(n,e,t,i))return}catch(e){Zt(e,n,"errorCaptured hook")}}Zt(e,t,i)}finally{Pe()}}function qt(e,t,i,n,r){var o;try{(o=i?e.apply(t,i):e.call(t))&&!o._isVue&&v(o)&&!o._handled&&(o.catch((function(e){return Gt(e,n,r+" (Promise/async)")})),o._handled=!0)}catch(e){Gt(e,n,r)}return o}function Zt(e,t,i){if(G.errorHandler)try{return G.errorHandler.call(null,e,t,i)}catch(t){t!==e&&Xt(t)}Xt(e)}function Xt(e,t,i){if(!Q||"undefined"==typeof console)throw e;console.error(e)}var Yt,Kt=!1,Qt=[],Jt=!1;function ei(){Jt=!1;var e=Qt.slice(0);Qt.length=0;for(var t=0;t<e.length;t++)e[t]()}if("undefined"!=typeof Promise&&he(Promise)){var ti=Promise.resolve();Yt=function(){ti.then(ei),ne&&setTimeout(M)},Kt=!0}else if(ee||"undefined"==typeof MutationObserver||!he(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())Yt="undefined"!=typeof setImmediate&&he(setImmediate)?function(){setImmediate(ei)}:function(){setTimeout(ei,0)};else{var ii=1,ni=new MutationObserver(ei),ri=document.createTextNode(String(ii));ni.observe(ri,{characterData:!0}),Yt=function(){ii=(ii+1)%2,ri.data=String(ii)},Kt=!0}function oi(e,t){var i;if(Qt.push((function(){if(e)try{e.call(t)}catch(e){Gt(e,t,"nextTick")}else i&&i(t)})),Jt||(Jt=!0,Yt()),!e&&"undefined"!=typeof Promise)return new Promise((function(e){i=e}))}var si="2.7.13",ai=new de;function li(e){return ci(e,ai),ai.clear(),e}function ci(e,t){var i,n,o=r(e);if(!(!o&&!h(e)||e.__v_skip||Object.isFrozen(e)||e instanceof ve)){if(e.__ob__){var s=e.__ob__.dep.id;if(t.has(s))return;t.add(s)}if(o)for(i=e.length;i--;)ci(e[i],t);else if(We(e))ci(e.value,t);else for(i=(n=Object.keys(e)).length;i--;)ci(e[n[i]],t)}}var ui,hi=0,di=function(){function e(e,t,i,n,r){Ze(this,Be&&!Be._vm?Be:e?e._scope:void 0),(this.vm=e)&&r&&(e._watcher=this),n?(this.deep=!!n.deep,this.user=!!n.user,this.lazy=!!n.lazy,this.sync=!!n.sync,this.before=n.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=i,this.id=++hi,this.active=!0,this.post=!1,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new de,this.newDepIds=new de,this.expression="",u(t)?this.getter=t:(this.getter=Y(t),this.getter||(this.getter=M)),this.value=this.lazy?void 0:this.get()}return e.prototype.get=function(){var e;Ee(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;Gt(e,t,'getter for watcher "'.concat(this.expression,'"'))}finally{this.deep&&li(e),Pe(),this.cleanupDeps()}return e},e.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},e.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var i=this.depIds;this.depIds=this.newDepIds,this.newDepIds=i,this.newDepIds.clear(),i=this.deps,this.deps=this.newDeps,this.newDeps=i,this.newDeps.length=0},e.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():Ui(this)},e.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||h(e)||this.deep){var t=this.value;if(this.value=e,this.user){var i='callback for watcher "'.concat(this.expression,'"');qt(this.cb,this.vm,[e,t],this.vm,i)}else this.cb.call(this.vm,e,t)}}},e.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},e.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},e.prototype.teardown=function(){if(this.vm&&!this.vm._isBeingDestroyed&&b(this.vm._scope.effects,this),this.active){for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1,this.onStop&&this.onStop()}},e}();function pi(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&mi(e,t)}function fi(e,t){ui.$on(e,t)}function gi(e,t){ui.$off(e,t)}function vi(e,t){var i=ui;return function n(){null!==t.apply(null,arguments)&&i.$off(e,n)}}function mi(e,t,i){ui=e,Qe(t,i||{},fi,gi,vi,e),ui=void 0}function yi(e){var t=/^hook:/;e.prototype.$on=function(e,i){var n=this;if(r(e))for(var o=0,s=e.length;o<s;o++)n.$on(e[o],i);else(n._events[e]||(n._events[e]=[])).push(i),t.test(e)&&(n._hasHookEvent=!0);return n},e.prototype.$once=function(e,t){var i=this;function n(){i.$off(e,n),t.apply(i,arguments)}return n.fn=t,i.$on(e,n),i},e.prototype.$off=function(e,t){var i=this;if(!arguments.length)return i._events=Object.create(null),i;if(r(e)){for(var n=0,o=e.length;n<o;n++)i.$off(e[n],t);return i}var s,a=i._events[e];if(!a)return i;if(!t)return i._events[e]=null,i;for(var l=a.length;l--;)if((s=a[l])===t||s.fn===t){a.splice(l,1);break}return i},e.prototype.$emit=function(e){var t=this,i=t._events[e];if(i){i=i.length>1?A(i):i;for(var n=A(arguments,1),r='event handler for "'.concat(e,'"'),o=0,s=i.length;o<s;o++)qt(i[o],t,n,t,r)}return t}}var wi=null;function xi(e){var t=wi;return wi=e,function(){wi=t}}function bi(e){var t=e.$options,i=t.parent;if(i&&!t.abstract){for(;i.$options.abstract&&i.$parent;)i=i.$parent;i.$children.push(e)}e.$parent=i,e.$root=i?i.$root:e,e.$children=[],e.$refs={},e._provided=i?i._provided:Object.create(null),e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}function _i(e){e.prototype._update=function(e,t){var i=this,n=i.$el,r=i._vnode,o=xi(i);i._vnode=e,i.$el=r?i.__patch__(r,e):i.__patch__(i.$el,e,t,!1),o(),n&&(n.__vue__=null),i.$el&&(i.$el.__vue__=i);for(var s=i;s&&s.$vnode&&s.$parent&&s.$vnode===s.$parent._vnode;)s.$parent.$el=s.$el,s=s.$parent},e.prototype.$forceUpdate=function(){var e=this;e._watcher&&e._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){Ri(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||b(t.$children,e),e._scope.stop(),e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),Ri(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}function Ti(e,t,i){var n;e.$el=t,e.$options.render||(e.$options.render=me),Ri(e,"beforeMount"),n=function(){e._update(e._render(),i)},new di(e,n,M,{before:function(){e._isMounted&&!e._isDestroyed&&Ri(e,"beforeUpdate")}},!0),i=!1;var r=e._preWatchers;if(r)for(var o=0;o<r.length;o++)r[o].run();return null==e.$vnode&&(e._isMounted=!0,Ri(e,"mounted")),e}function Si(e,t,i,r,o){var s=r.data.scopedSlots,a=e.$scopedSlots,l=!!(s&&!s.$stable||a!==n&&!a.$stable||s&&e.$scopedSlots.$key!==s.$key||!s&&e.$scopedSlots.$key),c=!!(o||e.$options._renderChildren||l),u=e.$vnode;e.$options._parentVnode=r,e.$vnode=r,e._vnode&&(e._vnode.parent=r),e.$options._renderChildren=o;var h=r.data.attrs||n;e._attrsProxy&&kt(e._attrsProxy,h,u.data&&u.data.attrs||n,e,"$attrs")&&(c=!0),e.$attrs=h,i=i||n;var d=e.$options._parentListeners;if(e._listenersProxy&&kt(e._listenersProxy,i,d||n,e,"$listeners"),e.$listeners=e.$options._parentListeners=i,mi(e,i,d),t&&e.$options.props){Me(!1);for(var p=e._props,f=e.$options._propKeys||[],g=0;g<f.length;g++){var v=f[g],m=e.$options.props;p[v]=xn(v,m,t,e)}Me(!0),e.$options.propsData=t}c&&(e.$slots=bt(o,r.context),e.$forceUpdate())}function Ei(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function Pi(e,t){if(t){if(e._directInactive=!1,Ei(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var i=0;i<e.$children.length;i++)Pi(e.$children[i]);Ri(e,"activated")}}function Ci(e,t){if(!(t&&(e._directInactive=!0,Ei(e))||e._inactive)){e._inactive=!0;for(var i=0;i<e.$children.length;i++)Ci(e.$children[i]);Ri(e,"deactivated")}}function Ri(e,t,i,n){void 0===n&&(n=!0),Ee();var r=fe;n&&ge(e);var o=e.$options[t],s="".concat(t," hook");if(o)for(var a=0,l=o.length;a<l;a++)qt(o[a],e,i||null,e,s);e._hasHookEvent&&e.$emit("hook:"+t),n&&ge(r),Pe()}var ki=[],Oi=[],Ii={},Di=!1,Ai=!1,Li=0;function Hi(){Li=ki.length=Oi.length=0,Ii={},Di=Ai=!1}var Mi=0,Bi=Date.now;if(Q&&!ee){var $i=window.performance;$i&&"function"==typeof $i.now&&Bi()>document.createEvent("Event").timeStamp&&(Bi=function(){return $i.now()})}var Fi=function(e,t){if(e.post){if(!t.post)return 1}else if(t.post)return-1;return e.id-t.id};function Ni(){var e,t;for(Mi=Bi(),Ai=!0,ki.sort(Fi),Li=0;Li<ki.length;Li++)(e=ki[Li]).before&&e.before(),t=e.id,Ii[t]=null,e.run();var i=Oi.slice(),n=ki.slice();Hi(),ji(i),zi(n),_e(),ue&&G.devtools&&ue.emit("flush")}function zi(e){for(var t=e.length;t--;){var i=e[t],n=i.vm;n&&n._watcher===i&&n._isMounted&&!n._isDestroyed&&Ri(n,"updated")}}function Vi(e){e._inactive=!1,Oi.push(e)}function ji(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,Pi(e[t],!0)}function Ui(e){var t=e.id;if(null==Ii[t]&&(e!==Te.target||!e.noRecurse)){if(Ii[t]=!0,Ai){for(var i=ki.length-1;i>Li&&ki[i].id>e.id;)i--;ki.splice(i+1,0,e)}else ki.push(e);Di||(Di=!0,oi(Ni))}}function Wi(e){var t=e.$options.provide;if(t){var i=u(t)?t.call(e):t;if(!h(i))return;for(var n=Xe(e),r=pe?Reflect.ownKeys(i):Object.keys(i),o=0;o<r.length;o++){var s=r[o];Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))}}}function Gi(e){var t=qi(e.$options.inject,e);t&&(Me(!1),Object.keys(t).forEach((function(i){ze(e,i,t[i])})),Me(!0))}function qi(e,t){if(e){for(var i=Object.create(null),n=pe?Reflect.ownKeys(e):Object.keys(e),r=0;r<n.length;r++){var o=n[r];if("__ob__"!==o){var s=e[o].from;if(s in t._provided)i[o]=t._provided[s];else if("default"in e[o]){var a=e[o].default;i[o]=u(a)?a.call(t):a}}}return i}}function Zi(e,t,i,o,s){var l,c=this,u=s.options;T(o,"_uid")?(l=Object.create(o))._original=o:(l=o,o=o._original);var h=a(u._compiled),d=!h;this.data=e,this.props=t,this.children=i,this.parent=o,this.listeners=e.on||n,this.injections=qi(u.inject,o),this.slots=function(){return c.$slots||St(o,e.scopedSlots,c.$slots=bt(i,o)),c.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return St(o,e.scopedSlots,this.slots())}}),h&&(this.$options=u,this.$slots=this.slots(),this.$scopedSlots=St(o,e.scopedSlots,this.$slots)),u._scopeId?this._c=function(e,t,i,n){var s=Vt(l,e,t,i,n,d);return s&&!r(s)&&(s.fnScopeId=u._scopeId,s.fnContext=o),s}:this._c=function(e,t,i,n){return Vt(l,e,t,i,n,d)}}function Xi(e,t,i,o,a){var l=e.options,c={},u=l.props;if(s(u))for(var h in u)c[h]=xn(h,u,t||n);else s(i.attrs)&&Ki(c,i.attrs),s(i.props)&&Ki(c,i.props);var d=new Zi(i,c,a,o,e),p=l.render.call(null,d._c,d);if(p instanceof ve)return Yi(p,i,d.parent,l);if(r(p)){for(var f=nt(p)||[],g=new Array(f.length),v=0;v<f.length;v++)g[v]=Yi(f[v],i,d.parent,l);return g}}function Yi(e,t,i,n,r){var o=we(e);return o.fnContext=i,o.fnOptions=n,t.slot&&((o.data||(o.data={})).slot=t.slot),o}function Ki(e,t){for(var i in t)e[P(i)]=t[i]}function Qi(e){return e.name||e.__name||e._componentTag}xt(Zi.prototype);var Ji={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var i=e;Ji.prepatch(i,i)}else{(e.componentInstance=nn(e,wi)).$mount(t?e.elm:void 0,t)}},prepatch:function(e,t){var i=t.componentOptions;Si(t.componentInstance=e.componentInstance,i.propsData,i.listeners,t,i.children)},insert:function(e){var t=e.context,i=e.componentInstance;i._isMounted||(i._isMounted=!0,Ri(i,"mounted")),e.data.keepAlive&&(t._isMounted?Vi(i):Pi(i,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?Ci(t,!0):t.$destroy())}},en=Object.keys(Ji);function tn(e,t,i,n,r){if(!o(e)){var l=i.$options._base;if(h(e)&&(e=l.extend(e)),"function"==typeof e){var c;if(o(e.cid)&&void 0===(e=$t(c=e,l)))return Bt(c,t,i,n,r);t=t||{},Un(e),s(t.model)&&sn(e.options,t);var u=et(t,e);if(a(e.options.functional))return Xi(e,u,t,i,n);var d=t.on;if(t.on=t.nativeOn,a(e.options.abstract)){var p=t.slot;t={},p&&(t.slot=p)}rn(t);var f=Qi(e.options)||r;return new ve("vue-component-".concat(e.cid).concat(f?"-".concat(f):""),t,void 0,void 0,void 0,i,{Ctor:e,propsData:u,listeners:d,tag:r,children:n},c)}}}function nn(e,t){var i={_isComponent:!0,_parentVnode:e,parent:t},n=e.data.inlineTemplate;return s(n)&&(i.render=n.render,i.staticRenderFns=n.staticRenderFns),new e.componentOptions.Ctor(i)}function rn(e){for(var t=e.hook||(e.hook={}),i=0;i<en.length;i++){var n=en[i],r=t[n],o=Ji[n];r===o||r&&r._merged||(t[n]=r?on(o,r):o)}}function on(e,t){var i=function(i,n){e(i,n),t(i,n)};return i._merged=!0,i}function sn(e,t){var i=e.model&&e.model.prop||"value",n=e.model&&e.model.event||"input";(t.attrs||(t.attrs={}))[i]=t.model.value;var o=t.on||(t.on={}),a=o[n],l=t.model.callback;s(a)?(r(a)?-1===a.indexOf(l):a!==l)&&(o[n]=[l].concat(a)):o[n]=l}var an=M,ln=G.optionMergeStrategies;function cn(e,t){if(!t)return e;for(var i,n,r,o=pe?Reflect.ownKeys(t):Object.keys(t),s=0;s<o.length;s++)"__ob__"!==(i=o[s])&&(n=e[i],r=t[i],T(e,i)?n!==r&&p(n)&&p(r)&&cn(n,r):Ve(e,i,r));return e}function un(e,t,i){return i?function(){var n=u(t)?t.call(i,i):t,r=u(e)?e.call(i,i):e;return n?cn(n,r):r}:t?e?function(){return cn(u(t)?t.call(this,this):t,u(e)?e.call(this,this):e)}:t:e}function hn(e,t){var i=t?e?e.concat(t):r(t)?t:[t]:e;return i?dn(i):i}function dn(e){for(var t=[],i=0;i<e.length;i++)-1===t.indexOf(e[i])&&t.push(e[i]);return t}function pn(e,t,i,n){var r=Object.create(e||null);return t?L(r,t):r}ln.data=function(e,t,i){return i?un(e,t,i):t&&"function"!=typeof t?e:un(e,t)},W.forEach((function(e){ln[e]=hn})),U.forEach((function(e){ln[e+"s"]=pn})),ln.watch=function(e,t,i,n){if(e===se&&(e=void 0),t===se&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var o={};for(var s in L(o,e),t){var a=o[s],l=t[s];a&&!r(a)&&(a=[a]),o[s]=a?a.concat(l):r(l)?l:[l]}return o},ln.props=ln.methods=ln.inject=ln.computed=function(e,t,i,n){if(!e)return t;var r=Object.create(null);return L(r,e),t&&L(r,t),r},ln.provide=un;var fn=function(e,t){return void 0===t?e:t};function gn(e,t){var i=e.props;if(i){var n,o,s={};if(r(i))for(n=i.length;n--;)"string"==typeof(o=i[n])&&(s[P(o)]={type:null});else if(p(i))for(var a in i)o=i[a],s[P(a)]=p(o)?o:{type:o};e.props=s}}function vn(e,t){var i=e.inject;if(i){var n=e.inject={};if(r(i))for(var o=0;o<i.length;o++)n[i[o]]={from:i[o]};else if(p(i))for(var s in i){var a=i[s];n[s]=p(a)?L({from:s},a):{from:a}}}}function mn(e){var t=e.directives;if(t)for(var i in t){var n=t[i];u(n)&&(t[i]={bind:n,update:n})}}function yn(e,t,i){if(u(t)&&(t=t.options),gn(t),vn(t),mn(t),!t._base&&(t.extends&&(e=yn(e,t.extends,i)),t.mixins))for(var n=0,r=t.mixins.length;n<r;n++)e=yn(e,t.mixins[n],i);var o,s={};for(o in e)a(o);for(o in t)T(e,o)||a(o);function a(n){var r=ln[n]||fn;s[n]=r(e[n],t[n],i,n)}return s}function wn(e,t,i,n){if("string"==typeof i){var r=e[t];if(T(r,i))return r[i];var o=P(i);if(T(r,o))return r[o];var s=C(o);return T(r,s)?r[s]:r[i]||r[o]||r[s]}}function xn(e,t,i,n){var r=t[e],o=!T(i,e),s=i[e],a=En(Boolean,r.type);if(a>-1)if(o&&!T(r,"default"))s=!1;else if(""===s||s===k(e)){var l=En(String,r.type);(l<0||a<l)&&(s=!0)}if(void 0===s){s=bn(n,r,e);var c=He;Me(!0),Ne(s),Me(c)}return s}function bn(e,t,i){if(T(t,"default")){var n=t.default;return e&&e.$options.propsData&&void 0===e.$options.propsData[i]&&void 0!==e._props[i]?e._props[i]:u(n)&&"Function"!==Tn(t.type)?n.call(e):n}}var _n=/^\s*function (\w+)/;function Tn(e){var t=e&&e.toString().match(_n);return t?t[1]:""}function Sn(e,t){return Tn(e)===Tn(t)}function En(e,t){if(!r(t))return Sn(t,e)?0:-1;for(var i=0,n=t.length;i<n;i++)if(Sn(t[i],e))return i;return-1}var Pn={enumerable:!0,configurable:!0,get:M,set:M};function Cn(e,t,i){Pn.get=function(){return this[t][i]},Pn.set=function(e){this[t][i]=e},Object.defineProperty(e,i,Pn)}function Rn(e){var t=e.$options;if(t.props&&kn(e,t.props),Ct(e),t.methods&&Bn(e,t.methods),t.data)On(e);else{var i=Ne(e._data={});i&&i.vmCount++}t.computed&&An(e,t.computed),t.watch&&t.watch!==se&&$n(e,t.watch)}function kn(e,t){var i=e.$options.propsData||{},n=e._props=Oe({}),r=e.$options._propKeys=[];!e.$parent||Me(!1);var o=function(o){r.push(o);var s=xn(o,t,i,e);ze(n,o,s),o in e||Cn(e,"_props",o)};for(var s in t)o(s);Me(!0)}function On(e){var t=e.$options.data;p(t=e._data=u(t)?In(t,e):t||{})||(t={});for(var i=Object.keys(t),n=e.$options.props,r=(e.$options.methods,i.length);r--;){var o=i[r];n&&T(n,o)||q(o)||Cn(e,"_data",o)}var s=Ne(t);s&&s.vmCount++}function In(e,t){Ee();try{return e.call(t,t)}catch(e){return Gt(e,t,"data()"),{}}finally{Pe()}}var Dn={lazy:!0};function An(e,t){var i=e._computedWatchers=Object.create(null),n=ce();for(var r in t){var o=t[r],s=u(o)?o:o.get;n||(i[r]=new di(e,s||M,M,Dn)),r in e||Ln(e,r,o)}}function Ln(e,t,i){var n=!ce();u(i)?(Pn.get=n?Hn(t):Mn(i),Pn.set=M):(Pn.get=i.get?n&&!1!==i.cache?Hn(t):Mn(i.get):M,Pn.set=i.set||M),Object.defineProperty(e,t,Pn)}function Hn(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),Te.target&&t.depend(),t.value}}function Mn(e){return function(){return e.call(this,this)}}function Bn(e,t){for(var i in e.$options.props,t)e[i]="function"!=typeof t[i]?M:D(t[i],e)}function $n(e,t){for(var i in t){var n=t[i];if(r(n))for(var o=0;o<n.length;o++)Fn(e,i,n[o]);else Fn(e,i,n)}}function Fn(e,t,i,n){return p(i)&&(n=i,i=i.handler),"string"==typeof i&&(i=e[i]),e.$watch(t,i,n)}function Nn(e){var t={get:function(){return this._data}},i={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",i),e.prototype.$set=Ve,e.prototype.$delete=je,e.prototype.$watch=function(e,t,i){var n=this;if(p(t))return Fn(n,e,t,i);(i=i||{}).user=!0;var r=new di(n,e,t,i);if(i.immediate){var o='callback for immediate watcher "'.concat(r.expression,'"');Ee(),qt(t,n,[r.value],n,o),Pe()}return function(){r.teardown()}}}var zn=0;function Vn(e){e.prototype._init=function(e){var t=this;t._uid=zn++,t._isVue=!0,t.__v_skip=!0,t._scope=new qe(!0),t._scope._vm=!0,e&&e._isComponent?jn(t,e):t.$options=yn(Un(t.constructor),e||{},t),t._renderProxy=t,t._self=t,bi(t),pi(t),At(t),Ri(t,"beforeCreate",void 0,!1),Gi(t),Rn(t),Wi(t),Ri(t,"created"),t.$options.el&&t.$mount(t.$options.el)}}function jn(e,t){var i=e.$options=Object.create(e.constructor.options),n=t._parentVnode;i.parent=t.parent,i._parentVnode=n;var r=n.componentOptions;i.propsData=r.propsData,i._parentListeners=r.listeners,i._renderChildren=r.children,i._componentTag=r.tag,t.render&&(i.render=t.render,i.staticRenderFns=t.staticRenderFns)}function Un(e){var t=e.options;if(e.super){var i=Un(e.super);if(i!==e.superOptions){e.superOptions=i;var n=Wn(e);n&&L(e.extendOptions,n),(t=e.options=yn(i,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function Wn(e){var t,i=e.options,n=e.sealedOptions;for(var r in i)i[r]!==n[r]&&(t||(t={}),t[r]=i[r]);return t}function Gn(e){this._init(e)}function qn(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var i=A(arguments,1);return i.unshift(this),u(e.install)?e.install.apply(e,i):u(e)&&e.apply(null,i),t.push(e),this}}function Zn(e){e.mixin=function(e){return this.options=yn(this.options,e),this}}function Xn(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var i=this,n=i.cid,r=e._Ctor||(e._Ctor={});if(r[n])return r[n];var o=Qi(e)||Qi(i.options),s=function(e){this._init(e)};return s.prototype=Object.create(i.prototype),s.prototype.constructor=s,s.cid=t++,s.options=yn(i.options,e),s.super=i,s.options.props&&Yn(s),s.options.computed&&Kn(s),s.extend=i.extend,s.mixin=i.mixin,s.use=i.use,U.forEach((function(e){s[e]=i[e]})),o&&(s.options.components[o]=s),s.superOptions=i.options,s.extendOptions=e,s.sealedOptions=L({},s.options),r[n]=s,s}}function Yn(e){var t=e.options.props;for(var i in t)Cn(e.prototype,"_props",i)}function Kn(e){var t=e.options.computed;for(var i in t)Ln(e.prototype,i,t[i])}function Qn(e){U.forEach((function(t){e[t]=function(e,i){return i?("component"===t&&p(i)&&(i.name=i.name||e,i=this.options._base.extend(i)),"directive"===t&&u(i)&&(i={bind:i,update:i}),this.options[t+"s"][e]=i,i):this.options[t+"s"][e]}}))}function Jn(e){return e&&(Qi(e.Ctor.options)||e.tag)}function er(e,t){return r(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!f(e)&&e.test(t)}function tr(e,t){var i=e.cache,n=e.keys,r=e._vnode;for(var o in i){var s=i[o];if(s){var a=s.name;a&&!t(a)&&ir(i,o,n,r)}}}function ir(e,t,i,n){var r=e[t];!r||n&&r.tag===n.tag||r.componentInstance.$destroy(),e[t]=null,b(i,t)}Vn(Gn),Nn(Gn),yi(Gn),_i(Gn),Ht(Gn);var nr=[String,RegExp,Array],rr={KeepAlive:{name:"keep-alive",abstract:!0,props:{include:nr,exclude:nr,max:[String,Number]},methods:{cacheVNode:function(){var e=this,t=e.cache,i=e.keys,n=e.vnodeToCache,r=e.keyToCache;if(n){var o=n.tag,s=n.componentInstance,a=n.componentOptions;t[r]={name:Jn(a),tag:o,componentInstance:s},i.push(r),this.max&&i.length>parseInt(this.max)&&ir(t,i[0],i,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)ir(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){tr(e,(function(e){return er(t,e)}))})),this.$watch("exclude",(function(t){tr(e,(function(e){return!er(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Ft(e),i=t&&t.componentOptions;if(i){var n=Jn(i),r=this,o=r.include,s=r.exclude;if(o&&(!n||!er(o,n))||s&&n&&er(s,n))return t;var a=this,l=a.cache,c=a.keys,u=null==t.key?i.Ctor.cid+(i.tag?"::".concat(i.tag):""):t.key;l[u]?(t.componentInstance=l[u].componentInstance,b(c,u),c.push(u)):(this.vnodeToCache=t,this.keyToCache=u),t.data.keepAlive=!0}return t||e&&e[0]}}};function or(e){var t={get:function(){return G}};Object.defineProperty(e,"config",t),e.util={warn:an,extend:L,mergeOptions:yn,defineReactive:ze},e.set=Ve,e.delete=je,e.nextTick=oi,e.observable=function(e){return Ne(e),e},e.options=Object.create(null),U.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,L(e.options.components,rr),qn(e),Zn(e),Xn(e),Qn(e)}or(Gn),Object.defineProperty(Gn.prototype,"$isServer",{get:ce}),Object.defineProperty(Gn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Gn,"FunctionalRenderContext",{value:Zi}),Gn.version=si;var sr=w("style,class"),ar=w("input,textarea,option,select,progress"),lr=function(e,t,i){return"value"===i&&ar(e)&&"button"!==t||"selected"===i&&"option"===e||"checked"===i&&"input"===e||"muted"===i&&"video"===e},cr=w("contenteditable,draggable,spellcheck"),ur=w("events,caret,typing,plaintext-only"),hr=function(e,t){return vr(t)||"false"===t?"false":"contenteditable"===e&&ur(t)?t:"true"},dr=w("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),pr="http://www.w3.org/1999/xlink",fr=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},gr=function(e){return fr(e)?e.slice(6,e.length):""},vr=function(e){return null==e||!1===e};function mr(e){for(var t=e.data,i=e,n=e;s(n.componentInstance);)(n=n.componentInstance._vnode)&&n.data&&(t=yr(n.data,t));for(;s(i=i.parent);)i&&i.data&&(t=yr(t,i.data));return wr(t.staticClass,t.class)}function yr(e,t){return{staticClass:xr(e.staticClass,t.staticClass),class:s(e.class)?[e.class,t.class]:t.class}}function wr(e,t){return s(e)||s(t)?xr(e,br(t)):""}function xr(e,t){return e?t?e+" "+t:e:t||""}function br(e){return Array.isArray(e)?_r(e):h(e)?Tr(e):"string"==typeof e?e:""}function _r(e){for(var t,i="",n=0,r=e.length;n<r;n++)s(t=br(e[n]))&&""!==t&&(i&&(i+=" "),i+=t);return i}function Tr(e){var t="";for(var i in e)e[i]&&(t&&(t+=" "),t+=i);return t}var Sr={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Er=w("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Pr=w("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Cr=function(e){return Er(e)||Pr(e)};function Rr(e){return Pr(e)?"svg":"math"===e?"math":void 0}var kr=Object.create(null);function Or(e){if(!Q)return!0;if(Cr(e))return!1;if(e=e.toLowerCase(),null!=kr[e])return kr[e];var t=document.createElement(e);return e.indexOf("-")>-1?kr[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:kr[e]=/HTMLUnknownElement/.test(t.toString())}var Ir=w("text,number,password,search,email,tel,url");function Dr(e){return"string"==typeof e?document.querySelector(e)||document.createElement("div"):e}function Ar(e,t){var i=document.createElement(e);return"select"!==e||t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&i.setAttribute("multiple","multiple"),i}function Lr(e,t){return document.createElementNS(Sr[e],t)}function Hr(e){return document.createTextNode(e)}function Mr(e){return document.createComment(e)}function Br(e,t,i){e.insertBefore(t,i)}function $r(e,t){e.removeChild(t)}function Fr(e,t){e.appendChild(t)}function Nr(e){return e.parentNode}function zr(e){return e.nextSibling}function Vr(e){return e.tagName}function jr(e,t){e.textContent=t}function Ur(e,t){e.setAttribute(t,"")}var Wr=Object.freeze({__proto__:null,createElement:Ar,createElementNS:Lr,createTextNode:Hr,createComment:Mr,insertBefore:Br,removeChild:$r,appendChild:Fr,parentNode:Nr,nextSibling:zr,tagName:Vr,setTextContent:jr,setStyleScope:Ur}),Gr={create:function(e,t){qr(t)},update:function(e,t){e.data.ref!==t.data.ref&&(qr(e,!0),qr(t))},destroy:function(e){qr(e,!0)}};function qr(e,t){var i=e.data.ref;if(s(i)){var n=e.context,o=e.componentInstance||e.elm,a=t?null:o,l=t?void 0:o;if(u(i))qt(i,n,[a],n,"template ref function");else{var c=e.data.refInFor,h="string"==typeof i||"number"==typeof i,d=We(i),p=n.$refs;if(h||d)if(c){var f=h?p[i]:i.value;t?r(f)&&b(f,o):r(f)?f.includes(o)||f.push(o):h?(p[i]=[o],Zr(n,i,p[i])):i.value=[o]}else if(h){if(t&&p[i]!==o)return;p[i]=l,Zr(n,i,a)}else if(d){if(t&&i.value!==o)return;i.value=a}}}}function Zr(e,t,i){var n=e._setupState;n&&T(n,t)&&(We(n[t])?n[t].value=i:n[t]=i)}var Xr=new ve("",{},[]),Yr=["create","activate","update","remove","destroy"];function Kr(e,t){return e.key===t.key&&e.asyncFactory===t.asyncFactory&&(e.tag===t.tag&&e.isComment===t.isComment&&s(e.data)===s(t.data)&&Qr(e,t)||a(e.isAsyncPlaceholder)&&o(t.asyncFactory.error))}function Qr(e,t){if("input"!==e.tag)return!0;var i,n=s(i=e.data)&&s(i=i.attrs)&&i.type,r=s(i=t.data)&&s(i=i.attrs)&&i.type;return n===r||Ir(n)&&Ir(r)}function Jr(e,t,i){var n,r,o={};for(n=t;n<=i;++n)s(r=e[n].key)&&(o[r]=n);return o}function eo(e){var t,i,n={},l=e.modules,u=e.nodeOps;for(t=0;t<Yr.length;++t)for(n[Yr[t]]=[],i=0;i<l.length;++i)s(l[i][Yr[t]])&&n[Yr[t]].push(l[i][Yr[t]]);function h(e){return new ve(u.tagName(e).toLowerCase(),{},[],void 0,e)}function d(e,t){function i(){0==--i.listeners&&p(e)}return i.listeners=t,i}function p(e){var t=u.parentNode(e);s(t)&&u.removeChild(t,e)}function f(e,t,i,n,r,o,l){if(s(e.elm)&&s(o)&&(e=o[l]=we(e)),e.isRootInsert=!r,!g(e,t,i,n)){var c=e.data,h=e.children,d=e.tag;s(d)?(e.elm=e.ns?u.createElementNS(e.ns,d):u.createElement(d,e),T(e),x(e,h,t),s(c)&&_(e,t),y(i,e.elm,n)):a(e.isComment)?(e.elm=u.createComment(e.text),y(i,e.elm,n)):(e.elm=u.createTextNode(e.text),y(i,e.elm,n))}}function g(e,t,i,n){var r=e.data;if(s(r)){var o=s(e.componentInstance)&&r.keepAlive;if(s(r=r.hook)&&s(r=r.init)&&r(e,!1),s(e.componentInstance))return v(e,t),y(i,e.elm,n),a(o)&&m(e,t,i,n),!0}}function v(e,t){s(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,b(e)?(_(e,t),T(e)):(qr(e),t.push(e))}function m(e,t,i,r){for(var o,a=e;a.componentInstance;)if(s(o=(a=a.componentInstance._vnode).data)&&s(o=o.transition)){for(o=0;o<n.activate.length;++o)n.activate[o](Xr,a);t.push(a);break}y(i,e.elm,r)}function y(e,t,i){s(e)&&(s(i)?u.parentNode(i)===e&&u.insertBefore(e,t,i):u.appendChild(e,t))}function x(e,t,i){if(r(t))for(var n=0;n<t.length;++n)f(t[n],i,e.elm,null,!0,t,n);else c(e.text)&&u.appendChild(e.elm,u.createTextNode(String(e.text)))}function b(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return s(e.tag)}function _(e,i){for(var r=0;r<n.create.length;++r)n.create[r](Xr,e);s(t=e.data.hook)&&(s(t.create)&&t.create(Xr,e),s(t.insert)&&i.push(e))}function T(e){var t;if(s(t=e.fnScopeId))u.setStyleScope(e.elm,t);else for(var i=e;i;)s(t=i.context)&&s(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t),i=i.parent;s(t=wi)&&t!==e.context&&t!==e.fnContext&&s(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t)}function S(e,t,i,n,r,o){for(;n<=r;++n)f(i[n],o,e,t,!1,i,n)}function E(e){var t,i,r=e.data;if(s(r))for(s(t=r.hook)&&s(t=t.destroy)&&t(e),t=0;t<n.destroy.length;++t)n.destroy[t](e);if(s(t=e.children))for(i=0;i<e.children.length;++i)E(e.children[i])}function P(e,t,i){for(;t<=i;++t){var n=e[t];s(n)&&(s(n.tag)?(C(n),E(n)):p(n.elm))}}function C(e,t){if(s(t)||s(e.data)){var i,r=n.remove.length+1;for(s(t)?t.listeners+=r:t=d(e.elm,r),s(i=e.componentInstance)&&s(i=i._vnode)&&s(i.data)&&C(i,t),i=0;i<n.remove.length;++i)n.remove[i](e,t);s(i=e.data.hook)&&s(i=i.remove)?i(e,t):t()}else p(e.elm)}function R(e,t,i,n,r){for(var a,l,c,h=0,d=0,p=t.length-1,g=t[0],v=t[p],m=i.length-1,y=i[0],w=i[m],x=!r;h<=p&&d<=m;)o(g)?g=t[++h]:o(v)?v=t[--p]:Kr(g,y)?(O(g,y,n,i,d),g=t[++h],y=i[++d]):Kr(v,w)?(O(v,w,n,i,m),v=t[--p],w=i[--m]):Kr(g,w)?(O(g,w,n,i,m),x&&u.insertBefore(e,g.elm,u.nextSibling(v.elm)),g=t[++h],w=i[--m]):Kr(v,y)?(O(v,y,n,i,d),x&&u.insertBefore(e,v.elm,g.elm),v=t[--p],y=i[++d]):(o(a)&&(a=Jr(t,h,p)),o(l=s(y.key)?a[y.key]:k(y,t,h,p))?f(y,n,e,g.elm,!1,i,d):Kr(c=t[l],y)?(O(c,y,n,i,d),t[l]=void 0,x&&u.insertBefore(e,c.elm,g.elm)):f(y,n,e,g.elm,!1,i,d),y=i[++d]);h>p?S(e,o(i[m+1])?null:i[m+1].elm,i,d,m,n):d>m&&P(t,h,p)}function k(e,t,i,n){for(var r=i;r<n;r++){var o=t[r];if(s(o)&&Kr(e,o))return r}}function O(e,t,i,r,l,c){if(e!==t){s(t.elm)&&s(r)&&(t=r[l]=we(t));var h=t.elm=e.elm;if(a(e.isAsyncPlaceholder))s(t.asyncFactory.resolved)?A(e.elm,t,i):t.isAsyncPlaceholder=!0;else if(a(t.isStatic)&&a(e.isStatic)&&t.key===e.key&&(a(t.isCloned)||a(t.isOnce)))t.componentInstance=e.componentInstance;else{var d,p=t.data;s(p)&&s(d=p.hook)&&s(d=d.prepatch)&&d(e,t);var f=e.children,g=t.children;if(s(p)&&b(t)){for(d=0;d<n.update.length;++d)n.update[d](e,t);s(d=p.hook)&&s(d=d.update)&&d(e,t)}o(t.text)?s(f)&&s(g)?f!==g&&R(h,f,g,i,c):s(g)?(s(e.text)&&u.setTextContent(h,""),S(h,null,g,0,g.length-1,i)):s(f)?P(f,0,f.length-1):s(e.text)&&u.setTextContent(h,""):e.text!==t.text&&u.setTextContent(h,t.text),s(p)&&s(d=p.hook)&&s(d=d.postpatch)&&d(e,t)}}}function I(e,t,i){if(a(i)&&s(e.parent))e.parent.data.pendingInsert=t;else for(var n=0;n<t.length;++n)t[n].data.hook.insert(t[n])}var D=w("attrs,class,staticClass,staticStyle,key");function A(e,t,i,n){var r,o=t.tag,l=t.data,c=t.children;if(n=n||l&&l.pre,t.elm=e,a(t.isComment)&&s(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(s(l)&&(s(r=l.hook)&&s(r=r.init)&&r(t,!0),s(r=t.componentInstance)))return v(t,i),!0;if(s(o)){if(s(c))if(e.hasChildNodes())if(s(r=l)&&s(r=r.domProps)&&s(r=r.innerHTML)){if(r!==e.innerHTML)return!1}else{for(var u=!0,h=e.firstChild,d=0;d<c.length;d++){if(!h||!A(h,c[d],i,n)){u=!1;break}h=h.nextSibling}if(!u||h)return!1}else x(t,c,i);if(s(l)){var p=!1;for(var f in l)if(!D(f)){p=!0,_(t,i);break}!p&&l.class&&li(l.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,t,i,r){if(!o(t)){var l=!1,c=[];if(o(e))l=!0,f(t,c);else{var d=s(e.nodeType);if(!d&&Kr(e,t))O(e,t,c,null,null,r);else{if(d){if(1===e.nodeType&&e.hasAttribute(j)&&(e.removeAttribute(j),i=!0),a(i)&&A(e,t,c))return I(t,c,!0),e;e=h(e)}var p=e.elm,g=u.parentNode(p);if(f(t,c,p._leaveCb?null:g,u.nextSibling(p)),s(t.parent))for(var v=t.parent,m=b(t);v;){for(var y=0;y<n.destroy.length;++y)n.destroy[y](v);if(v.elm=t.elm,m){for(var w=0;w<n.create.length;++w)n.create[w](Xr,v);var x=v.data.hook.insert;if(x.merged)for(var _=1;_<x.fns.length;_++)x.fns[_]()}else qr(v);v=v.parent}s(g)?P([e],0,0):s(e.tag)&&E(e)}}return I(t,c,l),t.elm}s(e)&&E(e)}}var to={create:io,update:io,destroy:function(e){io(e,Xr)}};function io(e,t){(e.data.directives||t.data.directives)&&no(e,t)}function no(e,t){var i,n,r,o=e===Xr,s=t===Xr,a=oo(e.data.directives,e.context),l=oo(t.data.directives,t.context),c=[],u=[];for(i in l)n=a[i],r=l[i],n?(r.oldValue=n.value,r.oldArg=n.arg,ao(r,"update",t,e),r.def&&r.def.componentUpdated&&u.push(r)):(ao(r,"bind",t,e),r.def&&r.def.inserted&&c.push(r));if(c.length){var h=function(){for(var i=0;i<c.length;i++)ao(c[i],"inserted",t,e)};o?Je(t,"insert",h):h()}if(u.length&&Je(t,"postpatch",(function(){for(var i=0;i<u.length;i++)ao(u[i],"componentUpdated",t,e)})),!o)for(i in a)l[i]||ao(a[i],"unbind",e,e,s)}var ro=Object.create(null);function oo(e,t){var i,n,r=Object.create(null);if(!e)return r;for(i=0;i<e.length;i++){if((n=e[i]).modifiers||(n.modifiers=ro),r[so(n)]=n,t._setupState&&t._setupState.__sfc){var o=n.def||wn(t,"_setupState","v-"+n.name);n.def="function"==typeof o?{bind:o,update:o}:o}n.def=n.def||wn(t.$options,"directives",n.name)}return r}function so(e){return e.rawName||"".concat(e.name,".").concat(Object.keys(e.modifiers||{}).join("."))}function ao(e,t,i,n,r){var o=e.def&&e.def[t];if(o)try{o(i.elm,e,i,n,r)}catch(n){Gt(n,i.context,"directive ".concat(e.name," ").concat(t," hook"))}}var lo=[Gr,to];function co(e,t){var i=t.componentOptions;if(!(s(i)&&!1===i.Ctor.options.inheritAttrs||o(e.data.attrs)&&o(t.data.attrs))){var n,r,l=t.elm,c=e.data.attrs||{},u=t.data.attrs||{};for(n in(s(u.__ob__)||a(u._v_attr_proxy))&&(u=t.data.attrs=L({},u)),u)r=u[n],c[n]!==r&&uo(l,n,r,t.data.pre);for(n in(ee||ie)&&u.value!==c.value&&uo(l,"value",u.value),c)o(u[n])&&(fr(n)?l.removeAttributeNS(pr,gr(n)):cr(n)||l.removeAttribute(n))}}function uo(e,t,i,n){n||e.tagName.indexOf("-")>-1?ho(e,t,i):dr(t)?vr(i)?e.removeAttribute(t):(i="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,i)):cr(t)?e.setAttribute(t,hr(t,i)):fr(t)?vr(i)?e.removeAttributeNS(pr,gr(t)):e.setAttributeNS(pr,t,i):ho(e,t,i)}function ho(e,t,i){if(vr(i))e.removeAttribute(t);else{if(ee&&!te&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==i&&!e.__ieph){var n=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",n)};e.addEventListener("input",n),e.__ieph=!0}e.setAttribute(t,i)}}var po={create:co,update:co};function fo(e,t){var i=t.elm,n=t.data,r=e.data;if(!(o(n.staticClass)&&o(n.class)&&(o(r)||o(r.staticClass)&&o(r.class)))){var a=mr(t),l=i._transitionClasses;s(l)&&(a=xr(a,br(l))),a!==i._prevClass&&(i.setAttribute("class",a),i._prevClass=a)}}var go,vo={create:fo,update:fo},mo="__r",yo="__c";function wo(e){if(s(e[mo])){var t=ee?"change":"input";e[t]=[].concat(e[mo],e[t]||[]),delete e[mo]}s(e[yo])&&(e.change=[].concat(e[yo],e.change||[]),delete e[yo])}function xo(e,t,i){var n=go;return function r(){null!==t.apply(null,arguments)&&To(e,r,i,n)}}var bo=Kt&&!(oe&&Number(oe[1])<=53);function _o(e,t,i,n){if(bo){var r=Mi,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=r||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}go.addEventListener(e,t,ae?{capture:i,passive:n}:i)}function To(e,t,i,n){(n||go).removeEventListener(e,t._wrapper||t,i)}function So(e,t){if(!o(e.data.on)||!o(t.data.on)){var i=t.data.on||{},n=e.data.on||{};go=t.elm||e.elm,wo(i),Qe(i,n,_o,To,xo,t.context),go=void 0}}var Eo,Po={create:So,update:So,destroy:function(e){return So(e,Xr)}};function Co(e,t){if(!o(e.data.domProps)||!o(t.data.domProps)){var i,n,r=t.elm,l=e.data.domProps||{},c=t.data.domProps||{};for(i in(s(c.__ob__)||a(c._v_attr_proxy))&&(c=t.data.domProps=L({},c)),l)i in c||(r[i]="");for(i in c){if(n=c[i],"textContent"===i||"innerHTML"===i){if(t.children&&(t.children.length=0),n===l[i])continue;1===r.childNodes.length&&r.removeChild(r.childNodes[0])}if("value"===i&&"PROGRESS"!==r.tagName){r._value=n;var u=o(n)?"":String(n);Ro(r,u)&&(r.value=u)}else if("innerHTML"===i&&Pr(r.tagName)&&o(r.innerHTML)){(Eo=Eo||document.createElement("div")).innerHTML="<svg>".concat(n,"</svg>");for(var h=Eo.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;h.firstChild;)r.appendChild(h.firstChild)}else if(n!==l[i])try{r[i]=n}catch(e){}}}}function Ro(e,t){return!e.composing&&("OPTION"===e.tagName||ko(e,t)||Oo(e,t))}function ko(e,t){var i=!0;try{i=document.activeElement!==e}catch(e){}return i&&e.value!==t}function Oo(e,t){var i=e.value,n=e._vModifiers;if(s(n)){if(n.number)return y(i)!==y(t);if(n.trim)return i.trim()!==t.trim()}return i!==t}var Io={create:Co,update:Co},Do=S((function(e){var t={},i=/;(?![^(]*\))/g,n=/:(.+)/;return e.split(i).forEach((function(e){if(e){var i=e.split(n);i.length>1&&(t[i[0].trim()]=i[1].trim())}})),t}));function Ao(e){var t=Lo(e.style);return e.staticStyle?L(e.staticStyle,t):t}function Lo(e){return Array.isArray(e)?H(e):"string"==typeof e?Do(e):e}function Ho(e,t){var i,n={};if(t)for(var r=e;r.componentInstance;)(r=r.componentInstance._vnode)&&r.data&&(i=Ao(r.data))&&L(n,i);(i=Ao(e.data))&&L(n,i);for(var o=e;o=o.parent;)o.data&&(i=Ao(o.data))&&L(n,i);return n}var Mo,Bo=/^--/,$o=/\s*!important$/,Fo=function(e,t,i){if(Bo.test(t))e.style.setProperty(t,i);else if($o.test(i))e.style.setProperty(k(t),i.replace($o,""),"important");else{var n=zo(t);if(Array.isArray(i))for(var r=0,o=i.length;r<o;r++)e.style[n]=i[r];else e.style[n]=i}},No=["Webkit","Moz","ms"],zo=S((function(e){if(Mo=Mo||document.createElement("div").style,"filter"!==(e=P(e))&&e in Mo)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),i=0;i<No.length;i++){var n=No[i]+t;if(n in Mo)return n}}));function Vo(e,t){var i=t.data,n=e.data;if(!(o(i.staticStyle)&&o(i.style)&&o(n.staticStyle)&&o(n.style))){var r,a,l=t.elm,c=n.staticStyle,u=n.normalizedStyle||n.style||{},h=c||u,d=Lo(t.data.style)||{};t.data.normalizedStyle=s(d.__ob__)?L({},d):d;var p=Ho(t,!0);for(a in h)o(p[a])&&Fo(l,a,"");for(a in p)(r=p[a])!==h[a]&&Fo(l,a,null==r?"":r)}}var jo={create:Vo,update:Vo},Uo=/\s+/;function Wo(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Uo).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var i=" ".concat(e.getAttribute("class")||""," ");i.indexOf(" "+t+" ")<0&&e.setAttribute("class",(i+t).trim())}}function Go(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Uo).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var i=" ".concat(e.getAttribute("class")||""," "),n=" "+t+" ";i.indexOf(n)>=0;)i=i.replace(n," ");(i=i.trim())?e.setAttribute("class",i):e.removeAttribute("class")}}function qo(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&L(t,Zo(e.name||"v")),L(t,e),t}return"string"==typeof e?Zo(e):void 0}}var Zo=S((function(e){return{enterClass:"".concat(e,"-enter"),enterToClass:"".concat(e,"-enter-to"),enterActiveClass:"".concat(e,"-enter-active"),leaveClass:"".concat(e,"-leave"),leaveToClass:"".concat(e,"-leave-to"),leaveActiveClass:"".concat(e,"-leave-active")}})),Xo=Q&&!te,Yo="transition",Ko="animation",Qo="transition",Jo="transitionend",es="animation",ts="animationend";Xo&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Qo="WebkitTransition",Jo="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(es="WebkitAnimation",ts="webkitAnimationEnd"));var is=Q?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function ns(e){is((function(){is(e)}))}function rs(e,t){var i=e._transitionClasses||(e._transitionClasses=[]);i.indexOf(t)<0&&(i.push(t),Wo(e,t))}function os(e,t){e._transitionClasses&&b(e._transitionClasses,t),Go(e,t)}function ss(e,t,i){var n=ls(e,t),r=n.type,o=n.timeout,s=n.propCount;if(!r)return i();var a=r===Yo?Jo:ts,l=0,c=function(){e.removeEventListener(a,u),i()},u=function(t){t.target===e&&++l>=s&&c()};setTimeout((function(){l<s&&c()}),o+1),e.addEventListener(a,u)}var as=/\b(transform|all)(,|$)/;function ls(e,t){var i,n=window.getComputedStyle(e),r=(n[Qo+"Delay"]||"").split(", "),o=(n[Qo+"Duration"]||"").split(", "),s=cs(r,o),a=(n[es+"Delay"]||"").split(", "),l=(n[es+"Duration"]||"").split(", "),c=cs(a,l),u=0,h=0;return t===Yo?s>0&&(i=Yo,u=s,h=o.length):t===Ko?c>0&&(i=Ko,u=c,h=l.length):h=(i=(u=Math.max(s,c))>0?s>c?Yo:Ko:null)?i===Yo?o.length:l.length:0,{type:i,timeout:u,propCount:h,hasTransform:i===Yo&&as.test(n[Qo+"Property"])}}function cs(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map((function(t,i){return us(t)+us(e[i])})))}function us(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function hs(e,t){var i=e.elm;s(i._leaveCb)&&(i._leaveCb.cancelled=!0,i._leaveCb());var n=qo(e.data.transition);if(!o(n)&&!s(i._enterCb)&&1===i.nodeType){for(var r=n.css,a=n.type,l=n.enterClass,c=n.enterToClass,d=n.enterActiveClass,p=n.appearClass,f=n.appearToClass,g=n.appearActiveClass,v=n.beforeEnter,m=n.enter,w=n.afterEnter,x=n.enterCancelled,b=n.beforeAppear,_=n.appear,T=n.afterAppear,S=n.appearCancelled,E=n.duration,P=wi,C=wi.$vnode;C&&C.parent;)P=C.context,C=C.parent;var R=!P._isMounted||!e.isRootInsert;if(!R||_||""===_){var k=R&&p?p:l,O=R&&g?g:d,I=R&&f?f:c,D=R&&b||v,A=R&&u(_)?_:m,L=R&&T||w,H=R&&S||x,M=y(h(E)?E.enter:E),B=!1!==r&&!te,$=fs(A),F=i._enterCb=z((function(){B&&(os(i,I),os(i,O)),F.cancelled?(B&&os(i,k),H&&H(i)):L&&L(i),i._enterCb=null}));e.data.show||Je(e,"insert",(function(){var t=i.parentNode,n=t&&t._pending&&t._pending[e.key];n&&n.tag===e.tag&&n.elm._leaveCb&&n.elm._leaveCb(),A&&A(i,F)})),D&&D(i),B&&(rs(i,k),rs(i,O),ns((function(){os(i,k),F.cancelled||(rs(i,I),$||(ps(M)?setTimeout(F,M):ss(i,a,F)))}))),e.data.show&&(t&&t(),A&&A(i,F)),B||$||F()}}}function ds(e,t){var i=e.elm;s(i._enterCb)&&(i._enterCb.cancelled=!0,i._enterCb());var n=qo(e.data.transition);if(o(n)||1!==i.nodeType)return t();if(!s(i._leaveCb)){var r=n.css,a=n.type,l=n.leaveClass,c=n.leaveToClass,u=n.leaveActiveClass,d=n.beforeLeave,p=n.leave,f=n.afterLeave,g=n.leaveCancelled,v=n.delayLeave,m=n.duration,w=!1!==r&&!te,x=fs(p),b=y(h(m)?m.leave:m),_=i._leaveCb=z((function(){i.parentNode&&i.parentNode._pending&&(i.parentNode._pending[e.key]=null),w&&(os(i,c),os(i,u)),_.cancelled?(w&&os(i,l),g&&g(i)):(t(),f&&f(i)),i._leaveCb=null}));v?v(T):T()}function T(){_.cancelled||(!e.data.show&&i.parentNode&&((i.parentNode._pending||(i.parentNode._pending={}))[e.key]=e),d&&d(i),w&&(rs(i,l),rs(i,u),ns((function(){os(i,l),_.cancelled||(rs(i,c),x||(ps(b)?setTimeout(_,b):ss(i,a,_)))}))),p&&p(i,_),w||x||_())}}function ps(e){return"number"==typeof e&&!isNaN(e)}function fs(e){if(o(e))return!1;var t=e.fns;return s(t)?fs(Array.isArray(t)?t[0]:t):(e._length||e.length)>1}function gs(e,t){!0!==t.data.show&&hs(t)}var vs=eo({nodeOps:Wr,modules:[po,vo,Po,Io,jo,Q?{create:gs,activate:gs,remove:function(e,t){!0!==e.data.show?ds(e,t):t()}}:{}].concat(lo)});te&&document.addEventListener("selectionchange",(function(){var e=document.activeElement;e&&e.vmodel&&Ss(e,"input")}));var ms={inserted:function(e,t,i,n){"select"===i.tag?(n.elm&&!n.elm._vOptions?Je(i,"postpatch",(function(){ms.componentUpdated(e,t,i)})):ys(e,t,i.context),e._vOptions=[].map.call(e.options,bs)):("textarea"===i.tag||Ir(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",_s),e.addEventListener("compositionend",Ts),e.addEventListener("change",Ts),te&&(e.vmodel=!0)))},componentUpdated:function(e,t,i){if("select"===i.tag){ys(e,t,i.context);var n=e._vOptions,r=e._vOptions=[].map.call(e.options,bs);if(r.some((function(e,t){return!F(e,n[t])})))(e.multiple?t.value.some((function(e){return xs(e,r)})):t.value!==t.oldValue&&xs(t.value,r))&&Ss(e,"change")}}};function ys(e,t,i){ws(e,t),(ee||ie)&&setTimeout((function(){ws(e,t)}),0)}function ws(e,t,i){var n=t.value,r=e.multiple;if(!r||Array.isArray(n)){for(var o,s,a=0,l=e.options.length;a<l;a++)if(s=e.options[a],r)o=N(n,bs(s))>-1,s.selected!==o&&(s.selected=o);else if(F(bs(s),n))return void(e.selectedIndex!==a&&(e.selectedIndex=a));r||(e.selectedIndex=-1)}}function xs(e,t){return t.every((function(t){return!F(t,e)}))}function bs(e){return"_value"in e?e._value:e.value}function _s(e){e.target.composing=!0}function Ts(e){e.target.composing&&(e.target.composing=!1,Ss(e.target,"input"))}function Ss(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!0,!0),e.dispatchEvent(i)}function Es(e){return!e.componentInstance||e.data&&e.data.transition?e:Es(e.componentInstance._vnode)}var Ps={model:ms,show:{bind:function(e,t,i){var n=t.value,r=(i=Es(i)).data&&i.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;n&&r?(i.data.show=!0,hs(i,(function(){e.style.display=o}))):e.style.display=n?o:"none"},update:function(e,t,i){var n=t.value;!n!=!t.oldValue&&((i=Es(i)).data&&i.data.transition?(i.data.show=!0,n?hs(i,(function(){e.style.display=e.__vOriginalDisplay})):ds(i,(function(){e.style.display="none"}))):e.style.display=n?e.__vOriginalDisplay:"none")},unbind:function(e,t,i,n,r){r||(e.style.display=e.__vOriginalDisplay)}}},Cs={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Rs(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Rs(Ft(t.children)):e}function ks(e){var t={},i=e.$options;for(var n in i.propsData)t[n]=e[n];var r=i._parentListeners;for(var n in r)t[P(n)]=r[n];return t}function Os(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function Is(e){for(;e=e.parent;)if(e.data.transition)return!0}function Ds(e,t){return t.key===e.key&&t.tag===e.tag}var As=function(e){return e.tag||Tt(e)},Ls=function(e){return"show"===e.name},Hs={name:"transition",props:Cs,abstract:!0,render:function(e){var t=this,i=this.$slots.default;if(i&&(i=i.filter(As)).length){var n=this.mode,r=i[0];if(Is(this.$vnode))return r;var o=Rs(r);if(!o)return r;if(this._leaving)return Os(e,r);var s="__transition-".concat(this._uid,"-");o.key=null==o.key?o.isComment?s+"comment":s+o.tag:c(o.key)?0===String(o.key).indexOf(s)?o.key:s+o.key:o.key;var a=(o.data||(o.data={})).transition=ks(this),l=this._vnode,u=Rs(l);if(o.data.directives&&o.data.directives.some(Ls)&&(o.data.show=!0),u&&u.data&&!Ds(o,u)&&!Tt(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var h=u.data.transition=L({},a);if("out-in"===n)return this._leaving=!0,Je(h,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),Os(e,r);if("in-out"===n){if(Tt(o))return l;var d,p=function(){d()};Je(a,"afterEnter",p),Je(a,"enterCancelled",p),Je(h,"delayLeave",(function(e){d=e}))}}return r}}},Ms=L({tag:String,moveClass:String},Cs);function Bs(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function $s(e){e.data.newPos=e.elm.getBoundingClientRect()}function Fs(e){var t=e.data.pos,i=e.data.newPos,n=t.left-i.left,r=t.top-i.top;if(n||r){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate(".concat(n,"px,").concat(r,"px)"),o.transitionDuration="0s"}}delete Ms.mode;var Ns={Transition:Hs,TransitionGroup:{props:Ms,beforeMount:function(){var e=this,t=this._update;this._update=function(i,n){var r=xi(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,r(),t.call(e,i,n)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",i=Object.create(null),n=this.prevChildren=this.children,r=this.$slots.default||[],o=this.children=[],s=ks(this),a=0;a<r.length;a++){var l=r[a];l.tag&&null!=l.key&&0!==String(l.key).indexOf("__vlist")&&(o.push(l),i[l.key]=l,(l.data||(l.data={})).transition=s)}if(n){var c=[],u=[];for(a=0;a<n.length;a++)(l=n[a]).data.transition=s,l.data.pos=l.elm.getBoundingClientRect(),i[l.key]?c.push(l):u.push(l);this.kept=e(t,null,c),this.removed=u}return e(t,null,o)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(Bs),e.forEach($s),e.forEach(Fs),this._reflow=document.body.offsetHeight,e.forEach((function(e){if(e.data.moved){var i=e.elm,n=i.style;rs(i,t),n.transform=n.WebkitTransform=n.transitionDuration="",i.addEventListener(Jo,i._moveCb=function e(n){n&&n.target!==i||n&&!/transform$/.test(n.propertyName)||(i.removeEventListener(Jo,e),i._moveCb=null,os(i,t))})}})))},methods:{hasMove:function(e,t){if(!Xo)return!1;if(this._hasMove)return this._hasMove;var i=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach((function(e){Go(i,e)})),Wo(i,t),i.style.display="none",this.$el.appendChild(i);var n=ls(i);return this.$el.removeChild(i),this._hasMove=n.hasTransform}}}};Gn.config.mustUseProp=lr,Gn.config.isReservedTag=Cr,Gn.config.isReservedAttr=sr,Gn.config.getTagNamespace=Rr,Gn.config.isUnknownElement=Or,L(Gn.options.directives,Ps),L(Gn.options.components,Ns),Gn.prototype.__patch__=Q?vs:M,Gn.prototype.$mount=function(e,t){return Ti(this,e=e&&Q?Dr(e):void 0,t)},Q&&setTimeout((function(){G.devtools&&ue&&ue.emit("init",Gn)}),0)}).call(this,i("c8ba"))},"2ba4":function(e,t,i){var n=i("40d5"),r=Function.prototype,o=r.apply,s=r.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(o):function(){return s.apply(o,arguments)})},"2d00":function(e,t,i){var n,r,o=i("da84"),s=i("342f"),a=o.process,l=o.Deno,c=a&&a.versions||l&&l.version,u=c&&c.v8;u&&(r=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&s&&((!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&((n=s.match(/Chrome\/(\d+)/))&&(r=+n[1]))),e.exports=r},"2d00b":function(e,t,i){i("f675")},"2e67":function(e,t,i){e.exports=function(e){return!(!e||!e.__CANCEL__)}},"30b5":function(e,t,i){var n=i("c532");function r(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,i){if(!t)return e;var o;if(i)o=i(t);else if(n.isURLSearchParams(t))o=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(r(t)+"="+r(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},"32be":function(e,t){e.exports={methods:{preventKeyboardEvent:e=>!!(e.altKey||e.ctrlKey||e.metaKey)||!(!["INPUT","SELECT","TEXTAREA"].includes(e.target.nodeName)||"range"===e.target.type)}}},"342f":function(e,t,i){var n=i("d066");e.exports=n("navigator","userAgent")||""},3934:function(e,t,i){var n=i("c532");e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function r(e){var n=e;return t&&(i.setAttribute("href",n),n=i.href),i.setAttribute("href",n),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return e=r(window.location.href),function(t){var i=n.isString(t)?r(t):t;return i.protocol===e.protocol&&i.host===e.host}}():function(){return!0}},"3a9b":function(e,t,i){var n=i("e330");e.exports=n({}.isPrototypeOf)},"3bbe":function(e,t,i){var n=i("1626"),r=String,o=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw o("Can't set "+r(e)+" as a prototype")}},"40d5":function(e,t,i){var n=i("d039");e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},4362:function(e,t,i){t.nextTick=function(e){var t=Array.prototype.slice.call(arguments);t.shift(),setTimeout((function(){e.apply(null,t)}),0)},t.platform=t.arch=t.execPath=t.title="browser",t.pid=1,t.browser=!0,t.env={},t.argv=[],t.binding=function(e){throw new Error("No such module. (Possibly not yet loaded)")},function(){var e,n="/";t.cwd=function(){return n},t.chdir=function(t){e||(e=i("df7c")),n=e.resolve(t,n)}}(),t.exit=t.kill=t.umask=t.dlopen=t.uptime=t.memoryUsage=t.uvCounters=function(){},t.features={}},"44ad":function(e,t,i){var n=i("e330"),r=i("d039"),o=i("c6b6"),s=Object,a=n("".split);e.exports=r((function(){return!s("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?a(e,""):s(e)}:s},4581:function(e,t){e.exports=null},"467f":function(e,t,i){var n=i("7917");e.exports=function(e,t,i){var r=i.config.validateStatus;i.status&&r&&!r(i.status)?t(new n("Request failed with status code "+i.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):e(i)}},"485a":function(e,t,i){var n=i("c65b"),r=i("1626"),o=i("861d"),s=TypeError;e.exports=function(e,t){var i,a;if("string"===t&&r(i=e.toString)&&!o(a=n(i,e)))return a;if(r(i=e.valueOf)&&!o(a=n(i,e)))return a;if("string"!==t&&r(i=e.toString)&&!o(a=n(i,e)))return a;throw s("Can't convert object to primitive value")}},4930:function(e,t,i){var n=i("2d00"),r=i("d039");e.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},"4a7b":function(e,t,i){var n=i("c532");e.exports=function(e,t){t=t||{};var i={};function r(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function o(i){return n.isUndefined(t[i])?n.isUndefined(e[i])?void 0:r(void 0,e[i]):r(e[i],t[i])}function s(e){if(!n.isUndefined(t[e]))return r(void 0,t[e])}function a(i){return n.isUndefined(t[i])?n.isUndefined(e[i])?void 0:r(void 0,e[i]):r(void 0,t[i])}function l(i){return i in t?r(e[i],t[i]):i in e?r(void 0,e[i]):void 0}var c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||o,r=t(e);n.isUndefined(r)&&t!==l||(i[e]=r)})),i}},"4c3d":function(e,t,i){(function(t){var n=i("c532"),r=i("c8af"),o=i("7917"),s=i("cafa"),a=i("e467"),l={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function u(){var e;return("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(e=i("b50d")),e}function h(e,t,i){if(n.isString(e))try{return(t||JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(i||JSON.stringify)(e)}var d={transitional:s,adapter:u(),transformRequest:[function(e,t){if(r(t,"Accept"),r(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e))return e;if(n.isArrayBufferView(e))return e.buffer;if(n.isURLSearchParams(e))return c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var i,o=n.isObject(e),s=t&&t["Content-Type"];if((i=n.isFileList(e))||o&&"multipart/form-data"===s){var l=this.env&&this.env.FormData;return a(i?{"files[]":e}:e,l&&new l)}return o||"application/json"===s?(c(t,"application/json"),h(e)):e}],transformResponse:[function(e){var t=this.transitional||d.transitional,i=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,s=!i&&"json"===this.responseType;if(s||r&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw o.from(e,o.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:i("4581")},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){d.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){d.headers[e]=n.merge(l)})),e.exports=d}).call(this,i("4362"))},"4ce8":function(e,t){e.exports=function(e,t){var i="function"==typeof e.exports?e.exports.extendOptions:e.options;for(var n in"function"==typeof e.exports&&(i.components=e.exports.options.components),i.components=i.components||{},t)i.components[n]=i.components[n]||t[n]}},"4d64":function(e,t,i){var n=i("fc6a"),r=i("23cb"),o=i("07fa"),s=function(e){return function(t,i,s){var a,l=n(t),c=o(l),u=r(s,c);if(e&&i!=i){for(;c>u;)if((a=l[u++])!=a)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===i)return e||u||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},"50c4":function(e,t,i){var n=i("5926"),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},5270:function(e,t,i){var n=i("c532"),r=i("c401"),o=i("2e67"),s=i("4c3d"),a=i("fb60");function l(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a}e.exports=function(e){return l(e),e.headers=e.headers||{},e.data=r.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return l(e),t.data=r.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(l(e),t&&t.response&&(t.response.data=r.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},5692:function(e,t,i){var n=i("c430"),r=i("c6cd");(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.24.1",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE",source:"https://github.com/zloirock/core-js"})},"56d7":function(e,t,i){i.r(t),i("d9e2");var n=i("2b0e"),r=i("bc3a"),o=i.n(r),s=function(){var e=this,t=e._self._c;return t("article",{staticClass:"tify",attrs:{tabindex:"-1"}},[e.$root.ready&&(e.$root.collection||e.$root.manifest)?t("app-header",{attrs:{fulltextEnabled:e.hasOtherContent,tocEnabled:e.hasToc}}):e._e(),e.$root.ready?t("div",{staticClass:"tify-main"},[e.$root.manifest?[t("view-scan",{attrs:{id:e.$root.getId("scan")}}),e.hasOtherContent?t("view-fulltext",{directives:[{name:"show",rawName:"v-show",value:"fulltext"===e.$root.options.view,expression:"$root.options.view === 'fulltext'"}],attrs:{id:e.$root.getId("fulltext")}}):e._e(),t("view-thumbnails",{directives:[{name:"show",rawName:"v-show",value:"thumbnails"===e.$root.options.view,expression:"$root.options.view === 'thumbnails'"}],attrs:{id:e.$root.getId("thumbnails")}}),e.hasToc?t("view-toc",{directives:[{name:"show",rawName:"v-show",value:"toc"===e.$root.options.view,expression:"$root.options.view === 'toc'"}],attrs:{id:e.$root.getId("toc")}}):e._e(),t("view-export",{directives:[{name:"show",rawName:"v-show",value:"export"===e.$root.options.view,expression:"$root.options.view === 'export'"}],attrs:{id:e.$root.getId("export")}})]:e._e(),e.$root.collection||e.$root.manifest?t("view-info",{directives:[{name:"show",rawName:"v-show",value:"info"===e.$root.options.view,expression:"$root.options.view === 'info'"}],attrs:{id:e.$root.getId("info")}}):e._e(),e.$root.collection?t("view-collection",{directives:[{name:"show",rawName:"v-show",value:"collection"===e.$root.options.view,expression:"$root.options.view === 'collection'"}],attrs:{id:e.$root.getId("collection")}}):e._e(),t("view-help",{directives:[{name:"show",rawName:"v-show",value:"help"===e.$root.options.view,expression:"$root.options.view === 'help'"}],attrs:{id:e.$root.getId("help")}})],2):e._e(),e.$root.loading?t("div",{staticClass:"tify-loading",attrs:{"aria-label":e.$root.translation?e.$root.translate("Loading"):"Loading"}}):e._e(),e.$root.error?t("div",{staticClass:"tify-error"},[t("button",{staticClass:"tify-error-close",on:{click:function(t){e.$root.error=""}}},[t("icon-close")],1),t("span",[e._v(e._s(e.$root.error))])]):e._e()],1)},a=[],l=function(){var e=this,t=e._self._c;return t("header",{staticClass:"tify-header"},[t("div",{staticClass:"tify-header-column -title"},[t("h1",{staticClass:"tify-header-title",attrs:{title:e.title}},[e._v(" "+e._s(e.title)+" ")])]),e.$root.manifest?t("div",{staticClass:"tify-header-column -pagination"},[t("div",{staticClass:"tify-header-button-group -page-select"},[t("page-select"),t("button",{staticClass:"tify-header-button",class:{"-active":e.$root.options.pages.length>1},attrs:{title:e.$root.translate("Toggle double-page")},on:{click:e.toggleDoublePage}},[e.customPageViewActive?t("icon-view-module"):t("icon-book-open-blank-variant")],1)],1),t("div",{staticClass:"tify-header-button-group -pagination"},[t("button",{staticClass:"tify-header-button",attrs:{disabled:e.customPageViewActive||e.isFirstPage,title:e.$root.translate("First page")},on:{click:e.goToFirstPage}},[t("icon-page-first")],1),e.structures&&e.structures.length?t("button",{staticClass:"tify-header-button",attrs:{disabled:e.customPageViewActive||e.isFirstPage,title:e.$root.translate("Previous section")},on:{click:e.goToPreviousSection}},[t("icon-skip-previous")],1):e._e(),t("button",{staticClass:"tify-header-button",attrs:{disabled:e.customPageViewActive||e.isFirstPage,title:e.$root.translate("Previous page")},on:{click:e.goToPreviousPage}},[t("icon-chevron-left")],1),t("button",{staticClass:"tify-header-button",attrs:{disabled:e.customPageViewActive||e.isLastPage,title:e.$root.translate("Next page")},on:{click:e.goToNextPage}},[t("icon-chevron-right")],1),e.structures&&e.structures.length?t("button",{staticClass:"tify-header-button",attrs:{disabled:e.customPageViewActive||e.isLastSection,title:e.$root.translate("Next section")},on:{click:e.goToNextSection}},[t("icon-skip-next")],1):e._e(),t("button",{staticClass:"tify-header-button",attrs:{disabled:e.customPageViewActive||e.isLastPage,title:e.$root.translate("Last page")},on:{click:e.goToLastPage}},[t("icon-page-last")],1)])]):e._e(),t("div",{staticClass:"tify-header-column -toggle"},[t("div",{ref:"switchViewSmall",staticClass:"tify-header-button-group -toggle"},[t("button",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeControlsPopup,expression:"closeControlsPopup"}],staticClass:"tify-header-button",attrs:{"aria-controls":e.$root.getId("controls"),"aria-expanded":e.controlsVisible?"true":"false","aria-label":e.$root.translate("View"),title:e.$root.translate("View")},on:{click:e.toggleControlsPopup}},[t("icon-dots-grid")],1)])]),t("div",{staticClass:"tify-header-column -controls",class:{"-visible":e.controlsVisible},attrs:{id:e.$root.getId("controls")}},[t("div",{staticClass:"tify-header-button-group -view"},[e.$root.manifest?t("button",{staticClass:"tify-header-button -scan",class:{"-active":"scan"===e.$root.options.view},attrs:{"aria-controls":e.$root.getId("scan"),"aria-expanded":"scan"===e.$root.options.view?"true":"false"},on:{click:function(t){return e.toggleView("scan")}}},[t("icon-image"),e._v(" "+e._s(e.$root.translate("Scan"))+" ")],1):e._e(),e.fulltextEnabled?t("button",{staticClass:"tify-header-button",class:{"-active":"fulltext"===e.$root.options.view},attrs:{"aria-controls":e.$root.getId("fulltext"),"aria-expanded":"fulltext"===e.$root.options.view?"true":"false"},on:{click:function(t){return e.toggleView("fulltext")}}},[t("icon-text-long"),e._v(" "+e._s(e.$root.translate("Fulltext"))+" ")],1):e._e(),e.$root.manifest?t("button",{staticClass:"tify-header-button",class:{"-active":"thumbnails"===e.$root.options.view},attrs:{"aria-controls":e.$root.getId("thumbnails"),"aria-expanded":"thumbnails"===e.$root.options.view?"true":"false"},on:{click:function(t){return e.toggleView("thumbnails")}}},[t("icon-view-module"),e._v(" "+e._s(e.$root.translate("Pages"))+" ")],1):e._e(),e.tocEnabled?t("button",{staticClass:"tify-header-button",class:{"-active":"toc"===e.$root.options.view},attrs:{"aria-controls":e.$root.getId("toc"),"aria-expanded":"toc"===e.$root.options.view?"true":"false"},on:{click:function(t){return e.toggleView("toc")}}},[t("icon-table-of-contents"),e._v(" "+e._s(e.$root.translate("Contents"))+" ")],1):e._e(),t("button",{staticClass:"tify-header-button",class:{"-active":"info"===e.$root.options.view},attrs:{"aria-controls":e.$root.getId("info"),"aria-expanded":"info"===e.$root.options.view?"true":"false"},on:{click:function(t){return e.toggleView("info")}}},[t("icon-information-variant"),e._v(" "+e._s(e.$root.translate("Info"))+" ")],1),e.$root.manifest?t("button",{staticClass:"tify-header-button",class:{"-active":"export"===e.$root.options.view},attrs:{"aria-controls":e.$root.getId("export"),"aria-expanded":"export"===e.$root.options.view?"true":"false"},on:{click:function(t){return e.toggleView("export")}}},[t("icon-download-outline"),e._v(" "+e._s(e.$root.translate("Export"))+" ")],1):e._e(),e.$root.collection?t("button",{staticClass:"tify-header-button",class:{"-active":"collection"===e.$root.options.view},attrs:{"aria-controls":e.$root.getId("collection"),"aria-expanded":"collection"===e.$root.options?"true":"false"},on:{click:function(t){return e.toggleView("collection")}}},[t("icon-list-box-outline"),e._v(" "+e._s(e.$root.translate("Collection"))+" ")],1):e._e()]),e.fullscreenSupported?t("div",{staticClass:"tify-header-button-group -view"},[t("button",{staticClass:"tify-header-button -icon-only",class:{"-active":"help"===e.$root.options.view},attrs:{"aria-controls":e.$root.getId("help"),"aria-expanded":"help"===e.$root.options.view?"true":"false",title:e.$root.translate("Help")},on:{click:function(t){return e.toggleView("help")}}},[t("icon-help-circle-outline"),e._v(" "+e._s(e.$root.translate("Help"))+" ")],1),e.fullscreenActive?t("button",{staticClass:"tify-header-button -icon-only",attrs:{title:e.$root.translate("Exit fullscreen")},on:{click:e.toggleFullscreen}},[t("icon-fullscreen-exit"),e._v(" "+e._s(e.$root.translate("Exit fullscreen"))+" ")],1):t("button",{staticClass:"tify-header-button -icon-only",attrs:{title:e.$root.translate("Fullscreen")},on:{click:e.toggleFullscreen}},[t("icon-fullscreen"),e._v(" "+e._s(e.$root.translate("Fullscreen"))+" ")],1)]):e._e(),e.$root.manifest?t("div",{staticClass:"tify-header-button-group -popup"},[t("button",{staticClass:"tify-header-button",attrs:{disabled:e.customPageViewActive||e.isFirstPage,title:e.$root.translate("First page")},on:{click:e.goToFirstPage}},[t("icon-page-first")],1),e.structures&&e.structures.length?t("button",{staticClass:"tify-header-button",attrs:{disabled:e.customPageViewActive||e.isFirstPage,title:e.$root.translate("Previous section")},on:{click:e.goToPreviousSection}},[t("icon-skip-previous")],1):e._e(),t("button",{staticClass:"tify-header-button",attrs:{disabled:e.customPageViewActive||e.isFirstPage,title:e.$root.translate("Previous page")},on:{click:e.goToPreviousPage}},[t("icon-chevron-left")],1),t("button",{staticClass:"tify-header-button",attrs:{disabled:e.customPageViewActive||e.isLastPage,title:e.$root.translate("Next page")},on:{click:e.goToNextPage}},[t("icon-chevron-right")],1),e.structures&&e.structures.length?t("button",{staticClass:"tify-header-button",attrs:{disabled:e.customPageViewActive||e.isLastSection,title:e.$root.translate("Next section")},on:{click:e.goToNextSection}},[t("icon-skip-next")],1):e._e(),t("button",{staticClass:"tify-header-button",attrs:{disabled:e.customPageViewActive||e.isLastPage,title:e.$root.translate("Last page")},on:{click:e.goToLastPage}},[t("icon-page-last")],1)]):e._e()])])},c=[],u=function(){var e=this,t=e._self._c;return t("div",{staticClass:"tify-page-select"},[t("button",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeDropdown,expression:"closeDropdown"}],staticClass:"tify-page-select-button",attrs:{title:e.currentPageTitleAttr,"aria-label":e.$root.translate("Current page"),"aria-controls":e.$root.getId("dropdown"),"aria-expanded":e.isOpen?"true":"false"},on:{click:e.toggleDropdown}},[e._v(" "+e._s(e.currentPageLabel)+" ")]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.isOpen,expression:"isOpen"}],key:"dropdown",staticClass:"tify-page-select-dropdown",attrs:{id:e.$root.getId("dropdown")},on:{click:function(e){e.stopPropagation()}}},[t("div",{staticClass:"tify-page-select-filter"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.filter,expression:"filter"}],ref:"search",staticClass:"tify-page-select-input",attrs:{"aria-label":e.$root.translate("Filter pages"),type:"text"},domProps:{value:e.filter},on:{keyup:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.filteredCanvases[e.highlightIndex]&&e.setPage(e.filteredCanvases[e.highlightIndex].page)},keydown:[function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.preventDefault(),e.filter?e.filter="":e.closeDropdown()},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),e.onKeyUpArrow())},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),e.onKeyDownArrow())}],input:function(t){t.target.composing||(e.filter=t.target.value)}}})]),t("ol",{ref:"list",staticClass:"tify-page-select-list"},e._l(e.filteredCanvases,(function(i,n){return t("li",{key:n,class:{"-current":e.$root.options.pages.indexOf(i.page)>-1,"-highlighted":e.highlightIndex===n}},[t("a",{attrs:{href:"javascript:;"},on:{click:function(t){return e.setPage(i.page)}}},[e._v(" "+e._s(e.$root.getPageLabel(i.page,e.$root.convertValueToArray(i.label)[0]))+" ")])])})),0)])])},h=[],d=i("32be"),p=i.n(d);function f(e,t,i,n,r,o,s,a){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),s?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):r&&(l=a?function(){r.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:r),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}var g=f({mixins:[p.a],data:()=>({filter:"",filteredCanvases:[],highlightIndex:0,isOpen:!1}),computed:{currentPageLabel(){const e=this.$root.options.pages[0]||1,t=this.$root.options.pages[0]?this.$root.options.pages[0]-1:0,i=this.$root.convertValueToArray(this.$root.canvases[t].label)[0];return this.$root.getPageLabel(e,i)},currentPageTitleAttr(){const{pages:e}=this.$root.options,t=0===e[0]&&e.length>1?1:e[0];return`${this.$root.translate("Physical page")}: ${t}\n${this.$root.translate("Logical page")}: ${this.$root.convertValueToArray(this.$root.canvases[t-1].label)[0]}`}},watch:{filter(){this.updateFilteredCanvases(),this.$nextTick(()=>this.updateScroll())},isOpen(){this.isOpen&&(this.filter="",this.highlightIndex=this.$root.options.pages[0]-1)}},methods:{closeDropdown(){this.isOpen=!1},onKeydown(e){this.preventKeyboardEvent(e)||("Escape"!==e.key?"x"===e.key&&(this.toggleDropdown(),e.preventDefault()):this.closeDropdown())},onKeyDownArrow(){this.highlightIndex<this.filteredCanvases.length-1&&(this.highlightIndex+=1,this.updateScroll())},onKeyUpArrow(){this.highlightIndex>0&&(this.highlightIndex-=1,this.updateScroll())},setPage(e){this.closeDropdown(),this.$root.setPage(e),this.$root.isMobile()&&this.$root.updateOptions({view:"scan"})},toggleDropdown(){this.isOpen=!this.isOpen,this.isOpen&&this.$nextTick(()=>{this.$refs.search.focus(),this.updateScroll()})},updateFilteredCanvases(){const e=[],t=this.filter.toLowerCase();let i=-1;this.$root.canvases.forEach((n,r)=>{const o=this.$root.convertValueToArray(n.label)[0].toLowerCase().indexOf(t)>-1,s=(r+1).toFixed().indexOf(t)>-1;if(o||s){const t=n;t.page=r+1,t.page===this.$root.options.pages[0]&&(i=e.length),e.push(t)}}),this.highlightIndex=i<0?0:i,this.filteredCanvases=e},updateScroll(){const{list:e}=this.$refs;if(e&&e.children[this.highlightIndex]){const{offsetTop:t}=e.children[this.highlightIndex];e.scrollTop=t-(e.offsetHeight/2-e.children[0].offsetHeight)}}},mounted(){this.updateFilteredCanvases(),this.$root.$el.addEventListener("keydown",this.onKeydown)},beforeDestroy(){this.$root.$el.removeEventListener("keydown",this.onKeydown)}},u,h,!1,null,null,null).exports,v=i("1b80"),m=i.n(v),y={components:{PageSelect:g},mixins:[p.a,m.a],props:["fulltextEnabled","tocEnabled"],data(){return{controlsVisible:!1,fullscreenActive:!1,screen:this.$root.$el.parentNode}},computed:{fullscreenSupported:()=>null===document.fullscreenElement||null===document.msFullscreenElement||null===document.webkitFullscreenElement,isLastSection(){const{pages:e}=this.$root.options,t=e.length-1;return(e[t]?e[t]:e[t-1])>=this.sections[this.sections.length-1].firstPage},sections(){const e=[];return this.structures?(this.structures.forEach(t=>{if(!t.canvases)return void e.push({firstPage:1,lastPage:this.$root.pageCount});const i=t.canvases[0],n=this.$root.canvases.findIndex(e=>e["@id"]===i)+1,r=t.canvases[t.canvases.length-1],o=this.$root.canvases.findIndex(e=>e["@id"]===r)+1;e.push({firstPage:n,lastPage:o})}),e):e},structures(){return this.$root.manifest?this.$root.manifest.structures:[]},title(){return this.$root.convertValueToArray((this.$root.manifest||this.$root.collection||{}).label).join(String.fromCharCode(160)+"· ").trim().replace(/(\S{1,10})\s+(\S{1,10})$/,`$1${String.fromCharCode(160)}$2`)}},methods:{closeControlsPopup(){this.controlsVisible=!1},detectFullscreen:()=>{let e;switch(null){case document.msFullscreenElement:e=document.msFullscreenElement;break;case document.webkitFullscreenElement:e=document.webkitFullscreenElement;break;case document.fullscreenElement:e=document.fullscreenElement;break;default:e=!1}return e},goToNextSection(){const{pages:e}=this.$root.options,t=e.length-1,i=e[t]?e[t]:e[t-1];let n=0;for(;i>=this.sections[n].firstPage||i&&i>=this.sections[n].firstPage;)n+=1;this.$root.setPage(this.sections[n].firstPage)},goToPreviousSection(){const{pages:e}=this.$root.options,t=e[0]?e[0]:e[1];let i=this.sections.length-1;for(;t<=this.sections[i].firstPage||t&&t<=this.sections[i].firstPage;)i-=1;this.$root.setPage(this.sections[i].firstPage)},onKeyDown(e){if(this.preventKeyboardEvent(e))return;if("Escape"===e.key)return void(this.controlsVisible=!1);switch(e.key){case"Backspace":this.$refs.switchViewSmall.offsetParent&&this.toggleView("scan");break;case"1":this.$root.manifest&&this.fulltextEnabled&&this.toggleView("fulltext");break;case"2":this.$root.manifest&&this.toggleView("thumbnails");break;case"3":this.$root.manifest&&this.tocEnabled&&this.toggleView("toc");break;case"4":this.toggleView("info");break;case"5":this.$root.manifest&&this.toggleView("export");break;case"6":this.$root.collection&&this.toggleView("collection");break;case"7":this.toggleView("help");break;case"b":this.$root.manifest&&this.toggleDoublePage();break;case"f":this.toggleFullscreen()}if(!this.$root.manifest||this.customPageViewActive)return;const{pages:t}=this.$root.options;switch(e.key){case"q":case",":t[0]>1&&this.goToPreviousPage();break;case"e":case".":this.isLastPage||this.goToNextPage();break;case"Q":t[0]>1&&this.goToFirstPage();break;case"E":this.isLastPage||this.goToLastPage()}},setView(e){this.$root.updateOptions({view:e})},toggleControlsPopup(){this.controlsVisible=!this.controlsVisible},toggleDoublePage(e){const{pages:t}=this.$root.options;let i;if(t.length>1&&!0!==e||!1===e)i=[t[0]<1?1:t[0]];else if(t[0]<2)i=[0,1];else if(t[0]%2>0)i=[t[0]-1,t[0]];else{const e=t[0]<this.$root.pageCount?t[0]+1:0;i=[t[0],e]}return this.$root.updateOptions({pages:i}),i},toggleFullscreen(e){return this.fullscreenActive&&!0!==e||!1===e?(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen(),!1):(this.screen.requestFullscreen?this.screen.requestFullscreen():this.screen.mozRequestFullScreen?this.screen.mozRequestFullScreen():this.screen.webkitRequestFullscreen?this.screen.webkitRequestFullscreen():this.screen.msRequestFullscreen&&this.screen.msRequestFullscreen(),!0)},toggleFullscreenActive(){this.fullscreenActive=!this.fullscreenActive},toggleView(e){const t=e===this.$root.options.view&&this.$root.manifest&&!this.$root.isMobile()?"":e;return this.$root.updateOptions({view:t}),t}},created(){this.$root.expose(this.setView),this.$root.expose(this.toggleDoublePage),this.$root.expose(this.toggleFullscreen)},mounted(){this.$root.$el.addEventListener("keydown",this.onKeyDown);["","moz","ms","webkit"].forEach(e=>{document.addEventListener(e+"fullscreenchange",this.toggleFullscreenActive)})},beforeDestroy(){this.$root.$el.removeEventListener("keydown",this.onKeyDown)}},w=i("4ce8"),x=i.n(w),b=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M21,5C19.89,4.65 18.67,4.5 17.5,4.5C15.55,4.5 13.45,4.9 12,6C10.55,4.9 8.45,4.5 6.5,4.5C4.55,4.5 2.45,4.9 1,6V20.65C1,20.9 1.25,21.15 1.5,21.15C1.6,21.15 1.65,21.1 1.75,21.1C3.1,20.45 5.05,20 6.5,20C8.45,20 10.55,20.4 12,21.5C13.35,20.65 15.8,20 17.5,20C19.15,20 20.85,20.3 22.25,21.05C22.35,21.1 22.4,21.1 22.5,21.1C22.75,21.1 23,20.85 23,20.6V6C22.4,5.55 21.75,5.25 21,5M21,18.5C19.9,18.15 18.7,18 17.5,18C15.8,18 13.35,18.65 12,19.5V8C13.35,7.15 15.8,6.5 17.5,6.5C18.7,6.5 19.9,6.65 21,7V18.5Z"}})])}),[],!1,null,null,null).exports,_=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z"}})])}),[],!1,null,null,null).exports,T=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}})])}),[],!1,null,null,null).exports,S=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12 16C13.1 16 14 16.9 14 18S13.1 20 12 20 10 19.1 10 18 10.9 16 12 16M12 10C13.1 10 14 10.9 14 12S13.1 14 12 14 10 13.1 10 12 10.9 10 12 10M12 4C13.1 4 14 4.9 14 6S13.1 8 12 8 10 7.1 10 6 10.9 4 12 4M6 16C7.1 16 8 16.9 8 18S7.1 20 6 20 4 19.1 4 18 4.9 16 6 16M6 10C7.1 10 8 10.9 8 12S7.1 14 6 14 4 13.1 4 12 4.9 10 6 10M6 4C7.1 4 8 4.9 8 6S7.1 8 6 8 4 7.1 4 6 4.9 4 6 4M18 16C19.1 16 20 16.9 20 18S19.1 20 18 20 16 19.1 16 18 16.9 16 18 16M18 10C19.1 10 20 10.9 20 12S19.1 14 18 14 16 13.1 16 12 16.9 10 18 10M18 4C19.1 4 20 4.9 20 6S19.1 8 18 8 16 7.1 16 6 16.9 4 18 4Z"}})])}),[],!1,null,null,null).exports,E=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M13,5V11H14.17L12,13.17L9.83,11H11V5H13M15,3H9V9H5L12,16L19,9H15V3M19,18H5V20H19V18Z"}})])}),[],!1,null,null,null).exports,P=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z"}})])}),[],!1,null,null,null).exports,C=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M14,14H19V16H16V19H14V14M5,14H10V19H8V16H5V14M8,5H10V10H5V8H8V5M19,8V10H14V5H16V8H19Z"}})])}),[],!1,null,null,null).exports,R=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z"}})])}),[],!1,null,null,null).exports,k=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z"}})])}),[],!1,null,null,null).exports,O=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M13.5,4A1.5,1.5 0 0,0 12,5.5A1.5,1.5 0 0,0 13.5,7A1.5,1.5 0 0,0 15,5.5A1.5,1.5 0 0,0 13.5,4M13.14,8.77C11.95,8.87 8.7,11.46 8.7,11.46C8.5,11.61 8.56,11.6 8.72,11.88C8.88,12.15 8.86,12.17 9.05,12.04C9.25,11.91 9.58,11.7 10.13,11.36C12.25,10 10.47,13.14 9.56,18.43C9.2,21.05 11.56,19.7 12.17,19.3C12.77,18.91 14.38,17.8 14.54,17.69C14.76,17.54 14.6,17.42 14.43,17.17C14.31,17 14.19,17.12 14.19,17.12C13.54,17.55 12.35,18.45 12.19,17.88C12,17.31 13.22,13.4 13.89,10.71C14,10.07 14.3,8.67 13.14,8.77Z"}})])}),[],!1,null,null,null).exports,I=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z"}})])}),[],!1,null,null,null).exports,D=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M18.41,16.59L13.82,12L18.41,7.41L17,6L11,12L17,18L18.41,16.59M6,6H8V18H6V6Z"}})])}),[],!1,null,null,null).exports,A=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M5.59,7.41L10.18,12L5.59,16.59L7,18L13,12L7,6L5.59,7.41M16,6H18V18H16V6Z"}})])}),[],!1,null,null,null).exports,L=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M16,18H18V6H16M6,18L14.5,12L6,6V18Z"}})])}),[],!1,null,null,null).exports,H=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M6,18V6H8V18H6M9.5,12L18,6V18L9.5,12Z"}})])}),[],!1,null,null,null).exports,M=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M3,9H17V7H3V9M3,13H17V11H3V13M3,17H17V15H3V17M19,17H21V15H19V17M19,7V9H21V7H19M19,13H21V11H19V13Z"}})])}),[],!1,null,null,null).exports,B=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M4,5H20V7H4V5M4,9H20V11H4V9M4,13H20V15H4V13M4,17H14V19H4V17Z"}})])}),[],!1,null,null,null).exports,$=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M16,5V11H21V5M10,11H15V5H10M16,18H21V12H16M10,18H15V12H10M4,18H9V12H4M4,11H9V5H4V11Z"}})])}),[],!1,null,null,null).exports,F=f(y,l,c,!1,null,null,null),N=F.exports;x()(F,{IconBookOpenBlankVariant:b,IconChevronLeft:_,IconChevronRight:T,IconDotsGrid:S,IconDownloadOutline:E,IconFullscreen:P,IconFullscreenExit:C,IconHelpCircleOutline:R,IconImage:k,IconInformationVariant:O,IconListBoxOutline:I,IconPageFirst:D,IconPageLast:A,IconSkipNext:L,IconSkipPrevious:H,IconTableOfContents:M,IconTextLong:B,IconViewModule:$});var z=function(){var e=this,t=e._self._c;return t("section",{staticClass:"tify-collection",attrs:{tabindex:"0"}},[t("h2",{staticClass:"tify-sr-only"},[e._v(e._s(e.$root.translate("Collection")))]),e.items.length>5?t("p",{staticClass:"tify-collection-controls"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.filter,expression:"filter"}],staticClass:"tify-collection-filter",attrs:{"aria-label":e.$root.translate("Filter collection"),placeholder:e.$root.translate("Filter collection"),type:"text"},domProps:{value:e.filter},on:{keydown:[function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.preventDefault(),e.filter?e.filter="":t.target.blur()},function(e){e.stopPropagation()}],input:function(t){t.target.composing||(e.filter=t.target.value)}}}),t("button",{staticClass:"tify-collection-reset",attrs:{disabled:!e.filter},on:{click:function(t){e.filter=""}}},[e._v(" "+e._s(e.$root.translate("Reset"))+" ")])]):e._e(),e.filteredItems.length?t("ol",{staticClass:"tify-collection-list"},e._l(e.filteredItems,(function(e){return t("collection-node",{key:e["@id"],attrs:{item:e}})})),1):t("p",{staticClass:"tify-collection-no-results"},[e._v(" "+e._s(e.$root.translate("No results"))+" ")])])},V=[],j=function(){var e=this,t=e._self._c;return t("li",{staticClass:"tify-collection-item",class:{"-current":e.$root.manifest&&e.$root.manifest["@id"]===e.item["@id"]}},["sc:Collection"===e.item["@type"]?t("button",{staticClass:"tify-collection-link -has-children",attrs:{"aria-controls":e.id,"aria-expanded":e.expanded?"true":"false"},on:{click:function(t){return e.toggleChildren()}}},[e.expanded?[t("icon-minus"),t("span",{staticClass:"tify-sr-only"},[e._v(e._s(e.$root.translate("Collapse")))])]:[t("icon-plus"),t("span",{staticClass:"tify-sr-only"},[e._v(e._s(e.$root.translate("Expand")))])],e._v(" "+e._s(e.label)+" ")],2):t("a",{staticClass:"tify-collection-link",attrs:{href:"javascript:;"},on:{click:function(t){return e.$root.loadManifest(e.item["@id"],{expectedType:e.item["@type"],reset:!0})}}},[e._v(" "+e._s(e.label)+" ")]),e.expanded?[e.expanded?t("ol",{staticClass:"tify-collection-list",attrs:{id:e.id}},e._l(e.children,(function(e){return t("collection-node",{key:e["@id"],attrs:{item:e}})})),1):!1===e.children?t("p",{staticClass:"tify-collection-error"},[e._v(" "+e._s(e.$root.translate("Could not load child manifest"))+" ")]):e._e()]:e._e()],2)},U=[],W={name:"collection-node",props:["item"],data(){return{children:null,expanded:!1,id:this.$root.getId("collection-node-"+Math.floor(1e12*Math.random()))}},computed:{label(){return this.item?this.$root.convertValueToArray(this.item.label).join(String.fromCharCode(160)+"· "):""}},methods:{toggleChildren(){if(this.expanded)this.expanded=!1;else{if(!this.children)return this.item.children?(this.children=this.item.children,void(this.expanded=!0)):void this.$http.get(this.item["@id"]).then(e=>{const t=e.data;this.children=t.manifests||t.collections||[],this.expanded=!0},e=>{const t=e.response&&(e.response.statusText||e.response.data)||e.message;this.$root.error="Error loading IIIF manifest: "+t,this.children=!1});this.expanded=!0}}}},G=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M19,13H5V11H19V13Z"}})])}),[],!1,null,null,null).exports,q=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"}})])}),[],!1,null,null,null).exports,Z=f(W,j,U,!1,null,null,null),X=Z.exports;x()(Z,{IconMinus:G,IconPlus:q});var Y=f({components:{CollectionNode:X},data:()=>({filter:""}),computed:{filteredItems(){const e=this.filter.trim().toLowerCase().split(/\s+/);return this.items.filter(t=>{const i=t.label.toLowerCase();return e.every(e=>i.includes(e))})},items(){return this.$root.collection.manifests&&this.$root.collection.collections?[{"@id":"tify-collection-manifests","@type":"sc:Collection",label:this.$root.translate("Documents"),children:this.$root.collection.manifests},{"@id":"tify-collection-collections","@type":"sc:Collection",label:this.$root.translate("Collections"),children:this.$root.collection.collections}]:this.$root.collection.manifests||this.$root.collection.collections}}},z,V,!1,null,null,null).exports,K=function(){var e=this,t=e._self._c;return t("section",{staticClass:"tify-export",attrs:{tabindex:"0"}},[t("h2",{staticClass:"tify-sr-only"},[e._v(e._s(e.$root.translate("Export")))]),t("div",{staticClass:"tify-export-section -links"},[t("h3",[e._v(e._s(e.$root.translate("Download Individual Images")))]),t("ul",e._l(e.pages,(function(i){return t("li",{key:i},[t("a",{attrs:{href:e.imageUrls[i],download:i+".jpg"}},[e._v(" "+e._s(e.$root.translate("Page"))+" "+e._s(e.$root.getPageLabel(i,e.$root.convertValueToArray(e.$root.canvases[i-1].label)[0]))+" ")])])})),0)]),this.$root.manifest.rendering?t("div",{staticClass:"tify-export-section -renderings"},[t("h3",[e._v(e._s(e.$root.translate("Renderings")))]),t("ul",e._l(e.renderings,(function(i){return t("li",{key:i["@id"]},[t("a",{attrs:{href:i["@id"]}},[e._v(e._s(i.label))])])})),0),e.hasElementPdfLinks?t("div",{staticClass:"tify-export-container"},[t("button",{staticClass:"tify-export-toggle",class:{"-close":e.perElementPdfLinksVisible},attrs:{"aria-controls":e.$root.getId("export-pdf-list"),"aria-expanded":e.perElementPdfLinksVisible?"true":"false"},on:{click:function(t){e.perElementPdfLinksVisible=!e.perElementPdfLinksVisible}}},[e.perElementPdfLinksVisible?[t("icon-close"),t("span",{staticClass:"tify-sr-only"},[e._v(e._s(e.$root.translate("Close PDF list")))])]:[e._v(" "+e._s(e.$root.translate("PDFs for each element"))+" ")]],2),e.perElementPdfLinksVisible?t("div",{staticClass:"tify-export-toc",attrs:{id:e.$root.getId("export-pdf-list")}},[t("h4",[e._v(e._s(e.$root.translate("PDFs for each element")))]),t("toc-list",{ref:"children",attrs:{purpose:"pdf",level:0,structures:e.structures}})],1):e._e()]):e._e()]):e._e(),e.literatureItems.length?t("div",{staticClass:"tify-export-section -literature"},[t("h3",[e._v(e._s(e.$root.translate("Literature Management")))]),t("ul",e._l(e.literatureItems,(function(i){return t("li",{key:i["@id"]},[t("a",{attrs:{href:i["@id"],download:""}},[e._v(" "+e._s(i.label)+" ")])])})),0)]):e._e(),t("div",{staticClass:"tify-export-section -other"},[t("h3",[e._v(e._s(e.$root.translate("Other Formats")))]),t("ul",[e.$root.options.childManifestUrl?t("li",[t("a",{attrs:{href:e.$root.options.childManifestUrl,download:"manifest.json"}},[e._v(" "+e._s(e.$root.translate("IIIF manifest (current document)"))+" ")])]):e._e(),t("li",[t("a",{attrs:{href:e.$root.options.manifestUrl,download:"manifest.json"}},[e._v(" "+e._s(e.$root.translate(e.$root.collection?"IIIF manifest (collection)":"IIIF manifest"))+" ")])]),e._l(e.otherItems,(function(i){return t("li",{key:i["@id"]},[t("a",{attrs:{href:i["@id"],download:""}},[e._v(" "+e._s(i.label||i["@id"])+" ")])])}))],2)])])},Q=[],J=f({name:"toc-list",props:["level","structures","parentStructure","purpose"],data(){return{expandedStructures:[],id:this.$root.getId("toc-list-"+Math.floor(1e12*Math.random()))}},methods:{checkIfPagesInStructure(e){const{pages:t}=this.$root.options;return t.some(t=>t>=e.firstPage&&t<=e.lastPage)},setPage(e){this.$root.setPage(e),this.$root.isMobile()&&this.$root.updateOptions({view:"scan"})},toggleAllChildren(e=null){if(this.$refs.children){for(let t=this.structures.length-1;t>=0;t-=1)this.toggleChildren(t,e);this.$refs.children.forEach(t=>{t.toggleAllChildren(e)})}},toggleChildren(e,t=null){if(!this.structures[e].childStructures)return;(null!==t?t:!this.expandedStructures[e])?this.$set(this.expandedStructures,e,!0):this.$set(this.expandedStructures,e,!1)}}},(function(){var e=this,t=e._self._c;return t("ul",{staticClass:"tify-toc-list"},e._l(e.structures,(function(i,n){return t("li",{key:n,staticClass:"tify-toc-structure",class:{"-current":e.checkIfPagesInStructure(i),"-expanded":e.expandedStructures[n]},attrs:{"data-level":e.level}},[i.childStructures?t("button",{staticClass:"tify-toc-toggle",attrs:{title:e.$root.translate(e.expandedStructures[n]?"Collapse":"Expand"),"aria-controls":`${e.id}-${n}`,"aria-expanded":e.expandedStructures[n]?"true":"false"},on:{click:function(t){return e.toggleChildren(n)}}},[e.expandedStructures[n]?[t("icon-minus")]:[t("icon-plus")]],2):e._e(),"pdf"===e.purpose?t("a",{staticClass:"tify-toc-link",attrs:{download:"",href:e.$root.convertValueToArray(i.rendering)[0]["@id"]}},[e._v(" "+e._s(i.label)+" ("+e._s(i.pageCount)+" "+e._s(e.$root.translate(1===i.pageCount?"page":"pages"))+") ")]):t("a",{staticClass:"tify-toc-link -dots",attrs:{href:"javascript:;"},on:{click:function(t){return e.setPage(i.firstPage)}}},[t("span",{staticClass:"tify-toc-label"},[e._v(e._s(i.label))]),t("span",{staticClass:"tify-toc-page"},[e._v(e._s(i.pageLabel))])]),i.childStructures?t("toc-list",{directives:[{name:"show",rawName:"v-show",value:e.expandedStructures[n],expression:"expandedStructures[index]"}],ref:"children",refInFor:!0,attrs:{id:`${e.id}-${n}`,level:e.level+1,parentStructure:i,purpose:e.purpose,structures:i.childStructures}}):e._e()],1)})),0)}),[],!1,null,null,null),ee=J.exports;x()(J,{IconMinus:G,IconPlus:q});var te={computed:{currentStructure(){if(!this.$root.manifest||!Array.isArray(this.$root.manifest.structures))return!1;const e=[];this.$root.options.pages.forEach(t=>{t&&e.push(this.$root.canvases[t-1]["@id"])});const{length:t}=this.$root.manifest.structures;let i,n;for(let r=0;r<t;r+=1){const t=this.$root.manifest.structures[r],{canvases:o}=t;if(o&&o.some(t=>e.indexOf(t)>-1)&&t.firstPage&&t.lastPage){const e=t.lastPage-t.firstPage;if((e<n||!n)&&(i=r,n=e,0===n))break}}return"number"==typeof i&&i>=0&&this.$root.manifest.structures[i]},currentStructureLabel(){const{label:e}=this.currentStructure;return e},currentStructureMetadata(){const{metadata:e}=this.currentStructure;return e},structures(){if(!this.$root.manifest.structures)return[];const e=[],t=[],{length:i}=this.$root.manifest.structures;for(let n=0;n<i;n+=1){const i=this.$root.manifest.structures[n];if("top"!==i.viewingHint){if(i.label?i.label=this.$root.convertValueToArray(i.label)[0].trim():i.label="—",i.canvases){const e=i.canvases[0];i.firstPage=this.$root.canvases.findIndex(t=>t["@id"]===e)+1;const t=i.canvases[i.canvases.length-1];i.lastPage=this.$root.canvases.findIndex(e=>e["@id"]===t)+1;const n=this.$root.canvases[i.firstPage-1];if(!n)continue;i.pageLabel=n.label}else this.$root.canvases[0]&&(i.firstPage=1,i.lastPage=this.$root.pageCount,i.pageLabel=this.$root.canvases[0].label);i.pageCount=i.lastPage-i.firstPage+1,i.within&&t.push(i),e.push(i)}}const n=t.length;for(let r=0;r<i;r+=1){const i=[];for(let o=0;o<n;o+=1){const n=t[o];n.within===e[r]["@id"]&&i.push(n)}i.length&&(e[r].childStructures=i.sort((e,t)=>e.firstPage-t.firstPage))}return e.filter(e=>!e.within).sort((e,t)=>e.firstPage-t.firstPage)}}};const ie=[{label:"BibTex",profile:"http://www.bibtex.org/Format/",type:"literature"},{label:"EndNote",profile:"http://endnote.com/",type:"literature"},{label:"RIS",profile:"http://referencemanager.com/sites/rm/files/m/direct_export_ris.pdf",type:"literature"},{label:"METS",profile:"http://www.loc.gov/standards/mets/profile_docs/mets.profile.v2-0.xsd",type:"other"},{label:"MODS",format:"application/mods+xml",type:"other"}];var ne={components:{TocList:ee},mixins:[te],data:()=>({literatureItems:[],otherItems:[],perElementPdfLinksVisible:!1}),computed:{pages(){return this.$root.options.pages.filter(e=>e>0)},hasElementPdfLinks(){const{manifest:e}=this.$root;if(!Array.isArray(e.structures)||!e.structures[0]||!e.structures[0].rendering)return!1;return this.$root.convertValueToArray(e.structures[0].rendering).some(e=>e.format&&"application/pdf"===e.format)},imageUrls(){const e={};return this.$root.options.pages.forEach(t=>{if(!t)return;const{resource:i}=this.$root.canvases[t-1].images[0];if(i.service){const n="http://iiif.io/api/image/2/context.json"===i.service["@context"]?"default":"native",r=i.service["@id"];e[t]=`${r}${"/"===r.slice(-1)?"":"/"}full/full/0/${n}.jpg`}else e[t]=i["@id"]}),e},renderings(){return this.$root.convertValueToArray(this.$root.manifest.rendering)}},created(){const{seeAlso:e}=this.$root.manifest;if(!e)return;JSON.parse(JSON.stringify(Array.isArray(e)?e:[e])).forEach(e=>{const t="object"==typeof e?e:{"@id":e};let i=!1;ie.some(n=>{const r=e.format&&n.format===e.format,o=e.profile&&n.profile===e.profile;return!(!r&&!o||(t.label=n.label,"literature"===n.type&&(i=!0),0))}),i?this.literatureItems.push(t):this.otherItems.push(t)})}},re=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"}})])}),[],!1,null,null,null).exports,oe=f(ne,K,Q,!1,null,null,null),se=oe.exports;function ae(e,t=["https:","http:"]){let i;try{i=new URL(e)}catch{return!1}return t.includes(i.protocol)}x()(oe,{IconClose:re});var le=f({data:()=>({fulltextAvailable:!1,fulltexts:[]}),watch:{"$root.options.pages":function(){this.loadFulltexts()}},methods:{loadFulltexts(){this.fulltextAvailable=!1,this.fulltexts=[],this.$root.options.pages.forEach(e=>{if(e<1||this.fulltexts[e])return;const t=this.$root.canvases[e-1];if(!("otherContent"in t))return;const i=t.otherContent[0]["@id"];this.$http.get(i).then(t=>{const{resources:i}=t.data;Array.isArray(i)&&i.forEach((t,i)=>{const n=t.resource;if(n&&n.chars){const t=this.$root.filterHtml(n.chars);t&&(this.fulltextAvailable=!0),this.fulltexts[e]||this.$set(this.fulltexts,e,[]),this.$set(this.fulltexts[e],i,t)}else n["@id"]&&this.loadRemoteFulltext(e,i,n["@id"])})},e=>{const t=e.response?e.response.statusText:e.message;console.warn("Could not load annotations: "+t)})})},loadRemoteFulltext(e,t,i){ae(i)&&this.$http.get(i).then(i=>{const n=this.$root.filterHtml(i.data);n&&(this.fulltextAvailable=!0),this.$set(this.fulltexts[e],t,n)},e=>{const t=e.response?e.response.statusText:e.message;console.warn("Could not load fulltext: "+t)})}},mounted(){this.loadFulltexts()},computed:{pages(){return this.$root.options.pages.filter(e=>!!e)}}},(function(){var e=this,t=e._self._c;return t("section",{staticClass:"tify-fulltext",attrs:{tabindex:"0"}},[t("h2",{staticClass:"tify-sr-only"},[e._v(e._s(e.$root.translate("Fulltext")))]),e.fulltextAvailable?t("div",{staticClass:"tify-fulltext-texts"},e._l(e.pages,(function(i){return t("div",{key:i,staticClass:"tify-fulltext-page"},[t("h3",[e._v(" "+e._s(e.$root.translate("Page"))+" "+e._s(e.$root.getPageLabel(i,e.$root.canvases[i-1].label))+" ")]),e._l(e.fulltexts[i],(function(n,r){return t("div",{key:`${i}-${r}`,staticClass:"tify-fulltext-text",domProps:{innerHTML:e._s(n)}})}))],2)})),0):t("div",{staticClass:"tify-fulltext-none"},[e._v(" "+e._s(e.$root.translate("Fulltext not available for this page"))+" ")])])}),[],!1,null,null,null).exports,ce=f({computed:{copyrightHtml(){const e='Copyright © 2017–2022 <a href="https://www.uni-goettingen.de/en/">Göttingen University</a> / <a href="https://www.sub.uni-goettingen.de/en/">Göttingen State and University Library</a>';return this.$root.translate("$copyright",e)},env:()=>Object({NODE_ENV:"production",VUE_APP_VERSION:"0.28.1",VUE_APP_LICENSE:"AGPL-3.0",VUE_APP_BUGS_URL:"https://github.com/tify-iiif-viewer/tify/issues",VUE_APP_CONTRIBUTORS_URL:"https://github.com/tify-iiif-viewer/tify/blob/main/CONTRIBUTORS.md",VUE_APP_DOCS_URL:"https://github.com/tify-iiif-viewer/tify/blob/v0.28.1/doc",VUE_APP_DOCS_LANGUAGES:"de,en",VUE_APP_REPOSITORY_URL:"https://github.com/tify-iiif-viewer/tify",BASE_URL:""}),infoHtml(){const e='TIFY is a slim and mobile-friendly IIIF document viewer, released under the <a href="https://www.gnu.org/licenses/agpl-3.0.html.en">GNU Affero General Public License 3.0</a>.';return this.$root.translate("$info",e)},userGuideUrl(){return`https://github.com/tify-iiif-viewer/tify/blob/v0.28.1/doc/user-guide.${"de,en".split(",").includes(this.$root.options.language)?this.$root.options.language:"en"}.md`}}},(function(){var e=this,t=e._self._c;return t("section",{staticClass:"tify-help",attrs:{tabindex:"0"}},[t("h2",{staticClass:"tify-sr-only"},[e._v(e._s(e.$root.translate("Help")))]),t("h3",[e._v(e._s(e.$root.translate("About TIFY")))]),t("p",{domProps:{innerHTML:e._s(e.infoHtml)}}),t("ul",[t("li",[t("a",{attrs:{href:e.userGuideUrl}},[e._v(e._s(e.$root.translate("User guide")))])]),t("li",[t("a",{attrs:{href:e.env.VUE_APP_REPOSITORY_URL}},[e._v(e._s(e.$root.translate("Source code")))])]),t("li",[t("a",{attrs:{href:e.env.VUE_APP_CONTRIBUTORS_URL}},[e._v(e._s(e.$root.translate("Contributors")))])]),t("li",[t("a",{attrs:{href:e.env.VUE_APP_BUGS_URL}},[e._v(e._s(e.$root.translate("Report a bug")))])])]),t("footer",{staticClass:"tify-help-footer"},[t("p",[e._v(" "+e._s(e.$root.translate("Version"))+" "),t("b",[e._v(e._s(e.env.VUE_APP_VERSION))]),e._v(" · "),t("span",{domProps:{innerHTML:e._s(e.copyrightHtml)}})])])])}),[],!1,null,null,null).exports,ue=function(){var e=this,t=e._self._c;return t("section",{staticClass:"tify-info",attrs:{tabindex:"0"}},[t("h2",{staticClass:"tify-sr-only"},[e._v(e._s(e.$root.translate("Info")))]),e.$root.collection&&e.$root.manifest?t("div",{staticClass:"tify-info-header"},[t("button",{staticClass:"tify-info-button",class:{"-active":!e.collectionDataShown},on:{click:function(t){e.collectionDataShown=!1}}},[e._v(" "+e._s(e.$root.translate("Document"))+" ")]),e.$root.collection&&e.$root.manifest?t("button",{staticClass:"tify-info-button",class:{"-active":e.collectionDataShown},on:{click:function(t){e.collectionDataShown=!0}}},[e._v(" "+e._s(e.$root.translate("Collection"))+" ")]):e._e()]):e._e(),e.manifest.label?t("div",{staticClass:"tify-info-section -title"},[t("h3",{staticClass:"tify-info-heading"},[e._v(e._s(e.$root.translate("Title")))]),e._l(e.$root.convertValueToArray(e.manifest.label),(function(i){return t("div",{key:i},[e._v(" "+e._s(i)+" ")])}))],2):e._e(),e.manifest.metadata&&e.manifest.metadata.length?t("div",{staticClass:"tify-info-section -metadata"},[t("h3",[e._v(e._s(e.$root.translate("Metadata")))]),"info"===e.$root.options.view?t("metadata-list",{attrs:{metadata:e.manifest.metadata}}):e._e()],1):e._e(),e.manifest.structures&&(e.currentStructureLabel||e.currentStructureMetadata)?t("div",{staticClass:"tify-info-section -metadata -structure"},[t("h3",[e._v(" "+e._s(e.$root.translate("Current Element"))+" ")]),e.currentStructureLabel?t("p",{staticClass:"tify-info-structure"},[e._v(" "+e._s(e.currentStructureLabel)+" ")]):e._e(),"info"===e.$root.options.view&&e.currentStructureMetadata?t("metadata-list",{staticClass:"tify-info-section -metadata",attrs:{metadata:e.currentStructureMetadata}}):e._e()],1):e._e(),e.manifest.description?t("div",{staticClass:"tify-info-section -description"},[t("h3",[e._v(e._s(e.$root.translate("Description")))]),e._l(e.$root.convertValueToArray(e.manifest.description),(function(i,n){return t("div",{key:n,domProps:{innerHTML:e._s(i)}})}))],2):e._e(),e.license.length?t("div",{staticClass:"tify-info-section -license"},[t("h3",[e._v(e._s(e.$root.translate("License")))]),e._l(e.license,(function(i,n){return t("div",{key:n},["string"==typeof i?[e.isValidUrl(i)?t("a",{attrs:{href:i}},[e._v(" "+e._s(i)+" ")]):[e._v(" "+e._s(i)+" ")]]:[e.isValidUrl(i["@id"])?t("a",{attrs:{href:i["@id"]}},[e._v(" "+e._s(i.label||i["@id"])+" ")]):[e._v(" "+e._s(i.label||i["@id"])+" ")]]],2)}))],2):e._e(),e.related.length?t("div",{staticClass:"tify-info-section -related"},[t("h3",[e._v(e._s(e.$root.translate("Related Resources")))]),e._l(e.related,(function(i,n){return t("div",{key:n},["string"==typeof i?t("a",{attrs:{href:i}},[e._v(" "+e._s(i)+" ")]):t("a",{attrs:{href:i["@id"]}},[e._v(" "+e._s(i.label||i["@id"])+" ")])])}))],2):e._e(),e.manifest.attribution?t("div",{staticClass:"tify-info-section -attribution"},[t("h3",[e._v(e._s(e.$root.translate("Provided by")))]),e._l(e.$root.convertValueToArray(e.manifest.attribution),(function(i,n){return t("div",{key:n,domProps:{innerHTML:e._s(i)}})}))],2):e._e(),e.manifest.logo?t("div",{staticClass:"tify-info-section -logo"},[e.logoId&&e.manifest.logo.service&&e.manifest.logo.service["@id"]?t("a",{attrs:{href:e.manifest.logo.service["@id"]}},[t("img",{staticClass:"tify-info-logo",attrs:{src:e.logoId,alt:e.$root.translate("Logo")}})]):t("img",{staticClass:"tify-info-logo",attrs:{src:e.logoId,alt:e.$root.translate("Logo")}})]):e._e()])},he=[],de=function(){var e=this,t=e._self._c;return t("div",{staticClass:"tify-info-metadata"},e._l(e.metadata,(function(i,n){return t("div",{key:n},[t("h4",e._l(e.$root.convertValueToArray(i.label),(function(i,n){return t("div",{key:n},[e._v(" "+e._s(e.cleanLabel(i))+" ")])})),0),t("div",{ref:"contents",refInFor:!0,staticClass:"tify-info-content",class:{"-collapsed":e.infoItems[n]&&e.infoItems[n].collapsed}},[t("div",{staticClass:"tify-info-value"},[e._l(e.$root.convertValueToArray(i.value),(function(i){return[e.isValidUrl(i)?t("div",{key:"url-"+i},[t("a",{attrs:{href:i}},[e._v(e._s(i))])]):t("div",{key:"html-"+i,domProps:{innerHTML:e._s(i)}})]}))],2),e.infoItems[n]&&e.infoItems[n].exceedsHeight?t("button",{staticClass:"tify-info-toggle",on:{click:function(t){e.infoItems[n].collapsed=!e.infoItems[n].collapsed}}},[e.infoItems[n].collapsed?[t("icon-chevron-down"),e._v(" "+e._s(e.$root.translate("Expand"))+" ")]:[t("icon-chevron-up"),e._v(" "+e._s(e.$root.translate("Collapse"))+" ")]],2):e._e()])])})),0)},pe=[],fe={props:["metadata"],data:()=>({infoItems:[]}),watch:{metadata(){this.updateInfoItems()}},mounted(){this.updateInfoItems()},methods:{cleanLabel(e){const t=e.replace("_"," ");return t.charAt(0).toUpperCase()+t.substr(1)},isValidUrl:ae,updateInfoItems(){this.$nextTick(()=>{this.$refs.contents&&this.$refs.contents.forEach((e,t)=>{const i=e.offsetHeight;this.$set(this.infoItems,t,{collapsed:!0,exceedsHeight:!0}),this.$nextTick(()=>{const n=e.offsetHeight,r=i>=n;this.$set(this.infoItems,t,{collapsed:r,exceedsHeight:r})})})})}}},ge=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"}})])}),[],!1,null,null,null).exports,ve=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z"}})])}),[],!1,null,null,null).exports,me=f(fe,de,pe,!1,null,null,null),ye=me.exports;x()(me,{IconChevronDown:ge,IconChevronUp:ve});var we=f({components:{MetadataList:ye},mixins:[te],data:()=>({collectionDataShown:!1}),computed:{collection(){return this.$root.collection},license(){return this.manifest.license?this.$root.convertValueToArray(this.manifest.license):[]},logoId(){return this.manifest.logo["@id"]||this.manifest.logo},manifest(){return this.collectionDataShown?this.$root.collection:this.$root.manifest||this.$root.collection},related(){return this.manifest.related?this.$root.convertValueToArray(this.manifest.related):[]}},methods:{isValidUrl:ae}},ue,he,!1,null,null,null).exports,xe=function(){var e=this,t=e._self._c;return t("section",{staticClass:"tify-scan"},[t("h2",{staticClass:"tify-sr-only"},[e._v(e._s(e.$root.translate("Scan")))]),e.customPageViewActive||e.isFirstPage?e._e():t("button",{staticClass:"tify-scan-page-button -previous",attrs:{title:e.$root.translate("Previous page")},on:{click:e.goToPreviousPage}},[t("icon-chevron-left")],1),e.customPageViewActive||e.isLastPage?e._e():t("button",{staticClass:"tify-scan-page-button -next",attrs:{title:e.$root.translate("Next page")},on:{click:e.goToNextPage}},[t("icon-chevron-right")],1),e.viewer?t("div",{staticClass:"tify-scan-buttons"},[t("button",{staticClass:"tify-scan-button",attrs:{disabled:e.isMaxZoom,title:e.$root.translate("Zoom in")},on:{click:e.zoomIn}},[t("icon-magnify-plus")],1),t("button",{staticClass:"tify-scan-button",attrs:{disabled:e.isReset,title:e.$root.translate("Reset")},on:{click:function(t){return e.resetScan(!!t.shiftKey)}}},[t("icon-aspect-ratio")],1),t("button",{staticClass:"tify-scan-button",attrs:{disabled:e.isMinZoom,title:e.$root.translate("Zoom out")},on:{click:e.zoomOut}},[t("icon-magnify-minus")],1),t("button",{staticClass:"tify-scan-button",class:{"-active":e.$root.options.rotation},attrs:{title:e.$root.translate("Rotate")},on:{click:function(t){return e.rotateRight(t)}}},[t("icon-rotate-right")],1),t("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeFilters,expression:"closeFilters"}],staticClass:"tify-scan-filters",class:{"-open":e.filtersVisible}},[t("button",{staticClass:"tify-scan-button",class:{"-active":e.filtersActive},attrs:{title:e.$root.translate("Toggle image filters"),"aria-controls":e.$root.getId("filters"),"aria-expanded":e.filtersVisible?"true":"false"},on:{click:function(t){e.filtersVisible=!e.filtersVisible}}},[t("icon-tune")],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.filtersVisible,expression:"filtersVisible"}],staticClass:"tify-scan-filters-popup",attrs:{id:e.$root.getId("filters")}},[t("h3",{staticClass:"tify-sr-only"},[e._v(e._s(e.$root.translate("Image filters")))]),t("p",[t("label",[t("icon-white-balance-sunny"),e._v(" "+e._s(e.$root.translate("Brightness"))+" "),t("b",[e._v(e._s(Math.round(100*(e.$root.options.filters.brightness||1)))+" %")]),t("input",{ref:"firstSlider",staticClass:"tify-scan-range",attrs:{max:"2",min:".5",step:".01",type:"range"},domProps:{value:e.$root.options.filters.brightness||1},on:{input:function(t){return e.setFilter("brightness",t)}}})],1)]),t("p",[t("label",[t("icon-brightness-6"),e._v(" "+e._s(e.$root.translate("Contrast"))+" "),t("b",[e._v(e._s(Math.round(100*(e.$root.options.filters.contrast||1)))+" %")]),t("input",{staticClass:"tify-scan-range",attrs:{max:"2",min:".5",step:".01",type:"range"},domProps:{value:e.$root.options.filters.contrast||1},on:{input:function(t){return e.setFilter("contrast",t)}}})],1)]),t("p",[t("label",[t("icon-palette"),e._v(" "+e._s(e.$root.translate("Saturation"))+" "),t("b",[e._v(e._s(Math.round(100*e.saturation))+" %")]),t("input",{staticClass:"tify-scan-range",attrs:{max:"3",min:"0",step:".01",type:"range"},domProps:{value:e.saturation},on:{input:function(t){return e.setFilter("saturate",t)}}})],1)]),t("p",[t("button",{staticClass:"tify-scan-reset",attrs:{disabled:!e.filtersActive},on:{click:e.resetFilters}},[t("icon-backup-restore"),e._v(" "+e._s(e.$root.translate("Reset"))+" ")],1)])])])]):e._e(),t("div",{ref:"image",staticClass:"tify-scan-image"})])},be=[],_e=i("aa78"),Te=i.n(_e);const Se=.01;var Ee={mixins:[p.a,m.a],data:()=>({filtersVisible:!1,loadingTimeout:null,tileSources:{},viewer:null,zoomFactor:1.5}),computed:{filtersActive(){return Object.keys(this.$root.options.filters).length>0},isMinZoom(){return!this.viewer||this.viewer.viewport.getZoom()<=this.viewer.viewport.getMinZoom()},isMaxZoom(){return!this.viewer||this.viewer.viewport.getZoom()>=this.viewer.viewport.getMaxZoom()},isReset(){const e=this.viewer.viewport.getHomeBounds(),t=this.viewer.viewport.getBounds();return Math.abs(e.height-t.height)<1e-9&&Math.abs(e.width-t.width)<1e-9&&Math.abs(e.x-t.x)<1e-9&&Math.abs(e.y-t.y)<1e-9},saturation(){const e=this.$parent.$parent.options.filters.saturate;return"number"==typeof e?e:1}},watch:{"$root.options.pages":function(e,t){const i=e.length!==t.length;this.loadImageInfo(i)}},methods:{closeFilters(){this.filtersVisible=!1},initViewer(e){const{options:t}=this.$root,i=[];let n,r=0,o=0;if(t.pages.forEach((e,t)=>{let s=1;e<1?(s=0,n=t>0?this.$root.pageCount:1):n=e;const a=this.tileSources[n];if(!a)return;r||(r=a.width);const l=a.width/r;i.push({opacity:s,tileSource:a,width:l,x:o}),o+=l+Se}),this.viewer)return this.viewer.addOnceHandler("open",()=>{if(this.isReset||e)this.resetScan();else{if(this.viewer.viewport.applyConstraints(!0),!this.$root.options.optionsResetOnPageChange)return;this.$root.options.optionsResetOnPageChange.forEach(e=>{if("filters"===e)this.resetFilters();else if("pan"===e){const e=this.viewer.viewport.getBounds();if(e.x<=0&&e.y<=0)return;const i=t.pages[0]?0:1;this.viewer.viewport.panTo({x:e.x>0?e.width/2+i:t.pan.x,y:e.y>0?e.height/2:t.pan.y}),this.$root.updateOptions({pan:{}})}else"rotation"===e?(this.viewer.viewport.setRotation(0),this.$root.updateOptions({rotation:null})):"zoom"===e&&(this.viewer.viewport.goHome(),this.$root.updateOptions({zoom:null}))})}}),void this.viewer.open(i);this.viewer=Te()(Object.assign({animationTime:.4,element:this.$refs.image,immediateRender:!0,preload:!this.$root.isMobile(),preserveImageSizeOnResize:!0,preserveViewport:!0,showNavigationControl:!1,showZoomControl:!1,tileSources:i,visibilityRatio:.2},this.$root.options.viewer)),this.viewer.innerTracker.keyHandler=null,this.viewer.gestureSettingsMouse.clickToZoom=!1,this.viewer.addHandler("animation-finish",()=>{if(this.isReset)return void this.removeScanOptions();const e=this.viewer.viewport.getCenter();this.$root.updateOptions({pan:{x:Math.round(1e3*e.x)/1e3,y:Math.round(1e3*e.y)/1e3},zoom:Math.round(1e3*this.viewer.viewport.getZoom())/1e3})}),this.viewer.addHandler("canvas-click",()=>{document.body.click()}),this.viewer.addHandler("open",()=>{this.startLoadingWatch(),void 0!==t.pan.x||void 0!==t.pan.y||t.zoom?(void 0===t.pan.x&&void 0===t.pan.y||this.viewer.viewport.panTo({x:t.pan.x,y:t.pan.y},!0),t.zoom&&this.viewer.viewport.zoomTo(t.zoom,null,!0)):this.viewer.viewport.goHome(),null!==t.rotation&&this.viewer.viewport.setRotation(t.rotation)}),this.viewer.addHandler("tile-load-failed",e=>{this.$root.error="Error loading image: "+e.message}),this.$root.expose(this.resetScan),this.$root.expose(this.viewer,"viewer")},loadImageInfo(e=!1){this.stopLoadingWatch();const t=[];this.$root.options.pages.forEach(e=>{if(e<1||this.tileSources[e])return;const{resource:i}=this.$root.canvases[e-1].images[0];if(i.service){const n=i.service["@id"],r=`${n}${"/"===n.slice(-1)?"":"/"}info.json`;t.push(this.$http.get(r).then(t=>Object.assign(Object.assign({},t),{},{page:e}),t=>{let i;t.response&&t.response.statusText?i=t.response.statusText:t.message&&(i=t.message),this.$root.error=`Error loading info file for page ${e}${i?": "+i:""}`}))}else this.tileSources[e]={type:"image",url:i["@id"],width:i.width,height:i.height}}),t.length?Promise.all(t).then(t=>{t.forEach(e=>{e&&(this.tileSources[e.page]=e.data)}),this.initViewer(e)}):this.initViewer(e)},onKeydown(e){"Escape"===e.key&&(this.filtersVisible=!1);[45,48,96].indexOf(e.keyCode)>-1&&(e.shiftKey?this.resetScan(e):this.viewer.viewport.goHome())},onKeypress(e){if(!this.preventKeyboardEvent(e))switch(e.key){case"r":case"R":this.rotateRight(e);break;case"i":this.filtersVisible=!this.filtersVisible,this.filtersVisible&&this.$nextTick(()=>{this.$refs.firstSlider.focus()});break;case"I":this.resetFilters();break;case"+":case"=":case"W":this.viewer.viewport.zoomBy(1.1),this.viewer.viewport.applyConstraints();break;case"-":case"_":case"S":this.viewer.viewport.zoomBy(.9),this.viewer.viewport.applyConstraints();break;case"w":this.viewer.innerTracker.keyDownHandler({keyCode:38});break;case"s":this.viewer.innerTracker.keyDownHandler({keyCode:40});break;case"a":this.viewer.innerTracker.keyDownHandler({keyCode:37});break;case"d":this.viewer.innerTracker.keyDownHandler({keyCode:39})}},removeScanOptions(){this.$root.updateOptions({pan:{},zoom:null})},resetFilters(){this.$refs.image.style.cssText="",this.$root.updateOptions({filters:{}})},resetScan(e){e&&(this.viewer.viewport.setRotation(0),this.$root.updateOptions({rotation:null}),this.filtersActive&&this.resetFilters()),this.viewer.viewport.goHome(),this.removeScanOptions()},rotateRight(e){const{viewport:t}=this.viewer,i=e&&e.shiftKey?0:(t.getRotation()+90)%360;t.setRotation(i),this.$root.updateOptions({rotation:i||null})},setFilter(e,t){const i=t.target.valueAsNumber;1===i?this.$delete(this.$root.options.filters,e):this.$set(this.$root.options.filters,e,i),this.$root.updateOptions({filters:this.$root.options.filters}),this.updateFilterStyle()},startLoadingWatch(){let e=0;for(let t=this.viewer.world.getItemCount()-1;t>=0;t-=1){const i=this.viewer.world.getItemAt(t);i&&i._tilesLoading&&(e=1)}this.$root.loading=e,this.loadingTimeout=setTimeout(this.startLoadingWatch,200)},stopLoadingWatch(){clearTimeout(this.loadingTimeout)},updateFilterStyle(){if(!this.filtersActive)return;const e=[];Object.keys(this.$root.options.filters).forEach(t=>{e.push(`${t}(${this.$root.options.filters[t]})`)});const{image:t}=this.$refs,i=e.join(" ");t.style.cssText="filter: "+i},zoomIn(){this.viewer.viewport.zoomBy(this.zoomFactor)},zoomOut(){this.viewer.viewport.zoomBy(1/this.zoomFactor)}},mounted(){this.loadImageInfo(),this.updateFilterStyle(),this.$root.$el.addEventListener("keydown",this.onKeydown),this.$root.$el.addEventListener("keypress",this.onKeypress)},beforeDestroy(){this.viewer&&this.viewer.destroy(),this.$root.$el.removeEventListener("keydown",this.onKeydown),this.$root.$el.removeEventListener("keypress",this.onKeypress)}},Pe=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M19,12H17V15H14V17H19V12M7,9H10V7H5V12H7V9M21,3H3A2,2 0 0,0 1,5V19A2,2 0 0,0 3,21H21A2,2 0 0,0 23,19V5A2,2 0 0,0 21,3M21,19H3V5H21V19Z"}})])}),[],!1,null,null,null).exports,Ce=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12,3A9,9 0 0,0 3,12H0L4,16L8,12H5A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19C10.5,19 9.09,18.5 7.94,17.7L6.5,19.14C8.04,20.3 9.94,21 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M14,12A2,2 0 0,0 12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12Z"}})])}),[],!1,null,null,null).exports,Re=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12,18V6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z"}})])}),[],!1,null,null,null).exports,ke=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M9,2A7,7 0 0,1 16,9C16,10.57 15.5,12 14.61,13.19L15.41,14H16L22,20L20,22L14,16V15.41L13.19,14.61C12,15.5 10.57,16 9,16A7,7 0 0,1 2,9A7,7 0 0,1 9,2M5,8V10H13V8H5Z"}})])}),[],!1,null,null,null).exports,Oe=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M9,2A7,7 0 0,1 16,9C16,10.57 15.5,12 14.61,13.19L15.41,14H16L22,20L20,22L14,16V15.41L13.19,14.61C12,15.5 10.57,16 9,16A7,7 0 0,1 2,9A7,7 0 0,1 9,2M8,5V8H5V10H8V13H10V10H13V8H10V5H8Z"}})])}),[],!1,null,null,null).exports,Ie=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z"}})])}),[],!1,null,null,null).exports,De=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z"}})])}),[],!1,null,null,null).exports,Ae=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M3,17V19H9V17H3M3,5V7H13V5H3M13,21V19H21V17H13V15H11V21H13M7,9V11H3V13H7V15H9V9H7M21,13V11H11V13H21M15,9H17V7H21V5H17V3H15V9Z"}})])}),[],!1,null,null,null).exports,Le=f({},(function(){var e=this._self._c;return e("svg",{staticClass:"tify-icon",attrs:{viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M3.55 19.09L4.96 20.5L6.76 18.71L5.34 17.29M12 6C8.69 6 6 8.69 6 12S8.69 18 12 18 18 15.31 18 12C18 8.68 15.31 6 12 6M20 13H23V11H20M17.24 18.71L19.04 20.5L20.45 19.09L18.66 17.29M20.45 5L19.04 3.6L17.24 5.39L18.66 6.81M13 1H11V4H13M6.76 5.39L4.96 3.6L3.55 5L5.34 6.81L6.76 5.39M1 13H4V11H1M13 20H11V23H13"}})])}),[],!1,null,null,null).exports,He=f(Ee,xe,be,!1,null,null,null),Me=He.exports;x()(He,{IconAspectRatio:Pe,IconBackupRestore:Ce,IconBrightness6:Re,IconChevronLeft:_,IconChevronRight:T,IconMagnifyMinus:ke,IconMagnifyPlus:Oe,IconPalette:Ie,IconRotateRight:De,IconTune:Ae,IconWhiteBalanceSunny:Le});var Be=function(){var e=this,t=e._self._c;return t("section",{staticClass:"tify-thumbnails",attrs:{tabindex:"0"},on:{scroll:e.redrawThumbnails}},[t("h2",{staticClass:"tify-sr-only"},[e._v(e._s(e.$root.translate("Pages")))]),t("div",{ref:"container",staticClass:"tify-thumbnails-list"},e._l(e.items,(function(i){return t("a",{key:i.page,staticClass:"tify-thumbnails-item",class:{"-current":e.$root.options.pages.indexOf(i.page)>-1},attrs:{href:"javascript:;"},on:{click:function(t){return t.preventDefault(),e.setPageAndSwitchView(i.page,t.ctrlKey)},touchstart:function(t){return e.touchStartTogglePage(i.page)},touchend:e.touchEnd}},[t("img",{attrs:{alt:"",src:i.imgUrl}}),t("span",{staticClass:"tify-thumbnails-page"},[e._v(" "+e._s(e.$root.getPageLabel(i.page,i.label))+" ")])])})),0)])},$e=[],Fe=i("6015"),Ne=i.n(Fe);const ze=750;var Ve=f({mixins:[Ne.a],data:()=>({isInited:!1,itemHeight:0,itemVMargin:0,items:[{label:""}],itemsPerRow:0,knownImages:[],lastScrollTop:0,resizeTimeout:null,style:{},thumbnailWidth:0,touchTimeout:null}),watch:{"$root.options.pages":function(e){this.$nextTick(()=>{const t=".tify-thumbnails-item.-current";e.length>2||e.length>1&&e[1]!==e[0]+1||(this.$refs.container.querySelector(t)?this.updateScrollPos(t):this.scrollToCurrentPage())})},"$root.options.view":function(e){"thumbnails"===e&&this.init()}},methods:{init(){this.updateDimensions(),this.scrollToCurrentPage(!1),this.isInited||(window.addEventListener("resize",this.onResize),this.isInited=!0)},onResize(){clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{"thumbnails"===this.$root.options.view&&this.updateDimensions()},200)},updateDimensions(){const e=this.$refs.container.querySelector(".tify-thumbnails-item"),t=e.currentStyle||window.getComputedStyle(e),i=parseInt(t.marginTop,10)+parseFloat(t.marginBottom,10);this.itemHeight=e.offsetHeight+i,this.itemVerticalMargin=i;const n=parseInt(t.marginLeft,10)+parseFloat(t.marginRight,10),r=e.offsetWidth+n;this.thumbnailWidth=e.offsetWidth,this.itemsPerRow=Math.floor(this.$refs.container.clientWidth/r);const o=Math.ceil(this.$root.canvases.length/this.itemsPerRow)*this.itemHeight;this.$refs.container.style.height=o+"px",this.redrawThumbnails(),this.scrollToCurrentPage(!1)},redrawThumbnails(){const e=this.$el.scrollTop,t=Math.floor(e/this.itemHeight)*this.itemsPerRow+1,i=Math.ceil(this.$el.offsetHeight/this.itemHeight)*this.itemsPerRow,n=t+this.itemsPerRow+i,r=Math.min(this.$root.canvases.length,n),o=[];for(let e=t-1;e<r;e+=1){const{resource:t}=this.$root.canvases[e].images[0];if(t.service){const i="http://iiif.io/api/image/2/context.json"===t.service["@context"]?"default":"native",n=t.service["@id"];o.push({label:this.$root.convertValueToArray(this.$root.canvases[e].label)[0],imgUrl:`${n}${"/"===n.slice(-1)?"":"/"}full/${this.thumbnailWidth},/0/${i}.jpg`,page:e+1})}else o.push({label:this.$root.convertValueToArray(this.$root.canvases[e].label)[0],imgUrl:t["@id"],page:e+1})}this.items=o,this.$nextTick(()=>{const e=Math.floor(t/this.itemsPerRow);this.$refs.container.style.paddingTop=e*this.itemHeight+"px"})},scrollToCurrentPage(e=!0){const t=Math.floor((this.$root.options.pages[0]-1)/this.itemsPerRow)*this.itemHeight+(this.itemVMargin-50);e?this.scrollTo(this.$el,t):this.$el.scrollTop=t},setPageAndSwitchView(e,t=!1){if(t){const t=this.$root.options.pages.slice(0),i=t.indexOf(e);return i<0?(t.push(e),t.sort((e,t)=>e-t),0===t[0]&&t.shift()):t.length>1&&t.splice(i,1),void this.$root.updateOptions({pages:t})}this.$root.setPage(e),this.$root.isMobile()&&this.$root.updateOptions({view:"scan"})},touchStartTogglePage(e){this.lastScrollTop=this.$el.scrollTop,this.touchTimeout=setTimeout(()=>{this.$el.scrollTop===this.lastScrollTop&&this.setPageAndSwitchView(e,!0)},ze)},touchEnd(){clearTimeout(this.touchTimeout)}},mounted(){this.style.flex=this.$el.style.flex,"thumbnails"===this.$root.options.view&&this.init()},beforeDestroy(){window.removeEventListener("resize",this.onResize)}},Be,$e,!1,null,null,null).exports,je=function(){var e=this,t=e._self._c;return t("section",{staticClass:"tify-toc",attrs:{tabindex:"0"}},[t("h2",{staticClass:"tify-sr-only"},[e._v(e._s(e.$root.translate("Table of Contents")))]),e.hasChildStructures?t("div",{staticClass:"tify-toc-header"},[t("button",{staticClass:"tify-toc-toggle-all",on:{click:function(t){return e.$refs.children.toggleAllChildren(!0)}}},[e._v(" "+e._s(e.$root.translate("Expand all"))+" ")]),t("button",{staticClass:"tify-toc-toggle-all",on:{click:function(t){return e.$refs.children.toggleAllChildren(!1)}}},[e._v(" "+e._s(e.$root.translate("Collapse all"))+" ")])]):e._e(),e.isInited?t("toc-list",{ref:"children",attrs:{level:0,structures:e.structures}}):e._e()],1)},Ue=[];const We=".tify-toc-structure.-current";var Ge={components:{AppHeader:N,ViewCollection:Y,ViewExport:se,ViewFulltext:le,ViewHelp:ce,ViewInfo:we,ViewScan:Me,ViewThumbnails:Ve,ViewToc:f({mixins:[Ne.a,te],components:{TocList:ee},data:()=>({isInited:!1}),computed:{hasChildStructures(){return this.structures.some(e=>e.childStructures)}},methods:{init(){this.isInited=!0,this.$nextTick(()=>this.updateScrollPos(We,!1))}},watch:{"$root.options.pages":function(){this.$nextTick(()=>this.updateScrollPos(We))},"$root.options.view":function(e){"toc"===e&&this.init()}},mounted(){"toc"===this.$root.options.view&&this.init()}},je,Ue,!1,null,null,null).exports},computed:{hasOtherContent(){return this.$root.manifest&&this.$root.canvases.some(e=>"otherContent"in e)},hasToc(){return this.$root.manifest&&this.$root.manifest.structures&&this.$root.manifest.structures.length}},beforeDestroy(){window.removeEventListener("popstate",this.$root.updateOptionsFromUrlQuery)}},qe=(i("2d00b"),f(Ge,s,a,!1,null,null,null)),Ze=qe.exports;x()(qe,{IconClose:re});var Xe=i("07d2"),Ye=i.n(Xe),Ke={methods:{convertValueToArray(e){if(!(e instanceof Array)){if("object"==typeof e){if(e["@value"])return[this.filterHtml(e["@value"])];if(e["@id"]){const t=this.filterHtml(e["@id"]);return[{"@id":t,label:e.label?this.filterHtml(e.label):t}]}return["(Invalid value)"]}return[this.filterHtml(e)]}const t=[],i={};e.forEach(e=>{"string"==typeof e||e["@id"]&&e.label?t.push(e):e&&"object"!=typeof e?t.push(this.filterHtml(e)):e["@language"]&&e["@value"]&&(i.fallback||(i.fallback=e["@value"]),0===e["@language"].indexOf("en")?i.en=e["@value"]:e["@language"]===this.options.language&&(i.preferred=e["@value"]))});const n=i.preferred||i.en||i.fallback||null;return n&&t.push(this.filterHtml(n)),t},filterHtml(e){const t=["a","b","br","i","img","p","span"],i={a:["href"],img:["alt","src"]};let n=Ye()(e,t);const r=/<(\w+)((\s+.+?(\s*=\s*(?:".*?"|'.*?'|.*?|[\^'">\s]+))?)+\s*|\s*)>/g;return n=n.replace(r,(e,t,n)=>{if(!n)return`<${t}>`;const r=/(?:([^\s]+)=(?:"(.*?)"|'(.*?)'))|([^\s]+)/g,o=[];return n.replace(r,(e,n)=>{e!==n&&i[t]&&i[t].indexOf(n)>-1&&o.push(e)}),o.length>0?`<${t} ${o.join(" ")}>`:`<${t}>`}),n},loadManifest(e,t={}){let i,n;const r=new Promise((e,t)=>{i=e,n=t});return this.$http.get(e).then(async o=>{if(t.expectedType&&o.data["@type"]!==t.expectedType)return this.error=`Expected manifest of type ${t.expectedType}, but got ${o.data["@type"]}`,n(this.error),r;if(this.manifest=null,await this.$nextTick(),"sc:Manifest"===o.data["@type"])return this.manifest=o.data,this.updateOptionsFromUrlQuery(),window.addEventListener("popstate",this.updateOptionsFromUrlQuery),t.reset&&this.updateOptions({childManifestUrl:e,pages:[this.getStartPage()],pan:{},rotation:null,view:this.isMobile()?"scan":"collection",zoom:null}),i(),r;if("sc:Collection"===o.data["@type"]){this.collection=o.data;const e=new URLSearchParams(window.location.search);let t={};try{t=JSON.parse(e.get(this.options.urlQueryKey))||{}}catch{}let n="";if(this.options.urlQueryParams.includes("childManifestUrl")&&t.childManifestUrl?n=t.childManifestUrl:this.collection.manifests&&this.options.childManifestAutoloaded&&(n=this.collection.manifests[0]["@id"]),n)await this.loadManifest(n,{expectedType:"sc:Manifest"}),this.updateOptions({childManifestUrl:n});else{const e=t.view||this.options.view;this.updateOptions({view:["collection","help","info"].includes(e)?e:"collection"})}return i(),r}return this.error="Please provide a valid IIIF Presentation API 2.x manifest",n(this.error),r},e=>{const t=e.response&&(e.response.statusText||e.response.data)||e.message;return this.error="Error loading IIIF manifest: "+t,n(this.error),r})}}},Qe={data:()=>({urlUpdateTimeout:null}),mounted(){this.expose(this.setPage)},beforeDestroy(){clearTimeout(this.urlUpdateTimeout)},methods:{getStartPage(){const{startCanvas:e}=this.manifest.sequences[0],t=this.canvases.findIndex(t=>t["@id"]===e);return t>=0?t+1:1},isValidPagesArray(e){if(!Array.isArray(e))return!1;if(new Set(e).size!==e.length)return!1;for(let t=0,i=e.length;t<i;t+=1)if(!Number.isInteger(e[t])||t>0&&e[t]>0&&e[t]<=e[t-1]||e[t]<0||e[t]>this.pageCount)return!1;return!0},setPage(e){let t=e;if(Array.isArray(e)||(t=[e]),!this.isValidPagesArray(t))throw new RangeError("Invalid pages");if(1===t.length&&this.options.pages&&this.options.pages[0]%2<1&&(this.options.pages[1]===this.options.pages[0]+1||0===this.options.pages[1])){const e=t[0]%2>0?t[0]-1:t[0];t=[e,e===this.pageCount?0:e+1]}return this.updateOptions({pages:t}),t},updateOptions(e){Object.assign(this.options,e),window.history&&this.$root.options.urlQueryKey&&(clearTimeout(this.urlUpdateTimeout),this.urlUpdateTimeout=setTimeout(()=>{const t={};this.options.urlQueryParams.forEach(e=>{const i=this.options[e];null===i||"pages"===e&&i.length<2&&i[0]<2||"object"==typeof i&&!Object.keys(i).length?delete t[e]:t[e]=this.options[e]});const i=new URL(window.location);i.searchParams.set(this.$root.options.urlQueryKey,JSON.stringify(t)),e.pages?(this.error="",window.history.pushState({},"",i)):window.history.replaceState({},"",i)},100))},updateOptionsFromUrlQuery(){let e={};try{const t=new URLSearchParams(window.location.search);e=JSON.parse(t.get(this.$root.options.urlQueryKey))||{}}catch{}""===e.view&&this.$root.isMobile()&&(e.view="scan"),e.pages&&!this.isValidPagesArray(e.pages)&&(this.$root.error="Invalid pages, reset to start page",e.pages=null),this.options.childManifestUrl=e.childManifestUrl||this.options.childManifestUrl,this.options.filters=e.filters||this.options.filters,this.options.pages=e.pages||this.options.pages||[this.getStartPage()],this.options.pan=e.panX||e.panY?{x:e.panX,y:e.panY}:e.pan||this.options.pan,this.options.rotation=parseInt(e.rotation,10)||this.options.rotation,this.options.view=e.view||""===e.view?e.view:this.options.view,this.options.zoom=parseFloat(e.zoom)||this.options.zoom}}},Je={methods:{isMobile(){return this.$root.$el.offsetWidth<this.$root.$data.options.breakpoints.medium},updateBreakpoint(){Object.keys(this.options.breakpoints).forEach(e=>{this.$el.clientWidth<=this.options.breakpoints[e]?this.$el.classList.add("-"+e):this.$el.classList.remove("-"+e)}),this.$el.clientHeight<520?this.$el.classList.add("-short"):this.$el.classList.remove("-short")}},mounted(){this.updateBreakpoint(),window.addEventListener("resize",this.updateBreakpoint)},beforeDestroy(){window.removeEventListener("resize",this.updateBreakpoint)}};n.a.directive("click-outside",{bind(e,t,i){e.event=n=>{e===n.target||e.contains(n.target)||i.context[t.expression](n)},document.body.addEventListener("click",e.event)},unbind(e){document.body.removeEventListener("click",e.event)}}),n.a.prototype.$http=o.a,window.Tify=function(e={}){const t={breakpoints:{tiny:359,small:719,medium:959,large:1199},childManifestAutoloaded:!0,childManifestUrl:null,container:null,filters:{},language:"en",manifestUrl:null,optionsResetOnPageChange:["pan"],pageLabelFormat:"P : L",pages:null,pan:{},rotation:null,translationsDirUrl:null,urlQueryKey:null,urlQueryParams:["childManifestUrl","filters","pages","pan","rotation","view","zoom"],view:"",viewer:{},zoom:null};if(this.options=Object.assign(Object.assign({},t),e),!this.options.translationsDirUrl){const e=[...document.getElementsByTagName("script")].find(e=>e.src.includes("/tify"));if(e){const{src:t}=e;this.options.translationsDirUrl=t.substring(0,t.lastIndexOf("/"))+"/translations"}}let i=null;this.ready=new Promise((e,t)=>{i={resolve:e,reject:t}});const r=this;this.app=new n.a({render:e=>e(Ze),data:()=>({api:{},collection:null,error:"",id:"tify-"+Math.floor(Math.random()*Date.now()),loading:0,manifest:null,options:r.options,ready:!1,readyPromise:i,translation:null}),mixins:[Ke,Qe,Je],computed:{canvases(){return this.manifest?this.manifest.sequences[0].canvases:[]},pageCount(){return this.canvases.length}},created(){this.expose(this.setLanguage)},mounted(){this.$http.interceptors.request.use(e=>(this.loading+=1,e)),this.$http.interceptors.response.use(e=>(this.loading>0&&(this.loading-=1),e),e=>(this.loading=0,Promise.reject(e))),this.options.manifestUrl?Promise.all([this.loadManifest(this.options.manifestUrl),this.setLanguage(this.options.language)]).then(()=>{this.$nextTick(()=>{this.ready=!0,this.readyPromise.resolve()})},e=>{this.readyPromise.reject(e)}):this.error='Missing option "manifestUrl"'},methods:{expose(e,t){r[t||e.name.replace("bound ","")]=e},getId(e){return this.id+(e?"-"+e:"")},getPageLabel(e,t){return this.options.pageLabelFormat.replace("P",e).replace("L",t)},setLanguage(e){let t,i;const n=new Promise((e,n)=>{t=e,i=n});if("en"===e)return this.options.language="en",this.translation=null,t(e),n;null===this.options.translationsDirUrl&&i(new Error("Could not determine translationsDirUrl"));const r=`${this.options.translationsDirUrl}/${e}.json`;return this.$http.get(r).then(i=>{this.options.language=e,this.translation=i.data,t(e)},t=>{const n=t.response?t.response.statusText:t.message;this.error=`Error loading translation for "${e}": ${n}`,i(new Error(this.error))}),n},translate(e,t){return this.translation&&this.translation[e]?this.translation[e]:t||e}}});let o=!1;this.mount=e=>{if(o)throw new Error("TIFY is already mounted");const t="string"==typeof e?document.querySelector(e):e;if(!t)throw new Error("Container element not found");"static"===window.getComputedStyle(t).position&&(t.style.position="relative");const i=document.createElement("div");t.innerHTML="",t.appendChild(i),this.app.$mount(i),o=!0},this.destroy=()=>{this.app.$destroy()},this.options.container&&this.mount(this.options.container)},t.default=window.Tify},"56ef":function(e,t,i){var n=i("d066"),r=i("e330"),o=i("241c"),s=i("7418"),a=i("825a"),l=r([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(a(e)),i=s.f;return i?l(t,i(e)):t}},"577e":function(e,t,i){var n=i("f5df"),r=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return r(e)}},5926:function(e,t,i){var n=i("b42e");e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},"59ed":function(e,t,i){var n=i("1626"),r=i("0d51"),o=TypeError;e.exports=function(e){if(n(e))return e;throw o(r(e)+" is not a function")}},"5c6c":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"5cce":function(e,t){e.exports={version:"0.27.2"}},"5e77":function(e,t,i){var n=i("83ab"),r=i("1a2d"),o=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,a=r(o,"name"),l=a&&"something"===function(){}.name,c=a&&(!n||n&&s(o,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},"5f02":function(e,t,i){var n=i("c532");e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},6015:function(e,t){e.exports={methods:{scrollTo(e,t,i=120){const n=e,r=!0===i?120:i;if(!r||r<0)return void(n.scrollTop=t);const o=(t-e.scrollTop)/r/.1;setTimeout(()=>{n.scrollTop+=o,n.scrollTop!==t&&this.scrollTo(n,t,r-10)},10)},updateScrollPos(e,t=!0){const i=this.$el.querySelectorAll(e);if(!i.length)return;let n=i[0];const r=i[i.length-1];Array.prototype.forEach.call(i,e=>{e.dataset.level>n.dataset.level&&(n=e)});const o=this.$el.getBoundingClientRect(),s=n.getBoundingClientRect(),a=r.getBoundingClientRect();if(s.top<o.top){const e=s.top-o.top+this.$el.scrollTop;this.scrollTo(this.$el,e-50,t)}else if(a.bottom>o.bottom){const e=a.bottom-o.bottom+this.$el.scrollTop;this.scrollTo(this.$el,e+50,t)}}}}},6374:function(e,t,i){var n=i("da84"),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},"69f3":function(e,t,i){var n,r,o,s=i("7f9a"),a=i("da84"),l=i("e330"),c=i("861d"),u=i("9112"),h=i("1a2d"),d=i("c6cd"),p=i("f772"),f=i("d012"),g="Object already initialized",v=a.TypeError,m=a.WeakMap,y=function(e){return o(e)?r(e):n(e,{})},w=function(e){return function(t){var i;if(!c(t)||(i=r(t)).type!==e)throw v("Incompatible receiver, "+e+" required");return i}};if(s||d.state){var x=d.state||(d.state=new m),b=l(x.get),_=l(x.has),T=l(x.set);n=function(e,t){if(_(x,e))throw new v(g);return t.facade=e,T(x,e,t),t},r=function(e){return b(x,e)||{}},o=function(e){return _(x,e)}}else{var S=p("state");f[S]=!0,n=function(e,t){if(h(e,S))throw new v(g);return t.facade=e,u(e,S,t),t},r=function(e){return h(e,S)?e[S]:{}},o=function(e){return h(e,S)}}e.exports={set:n,get:r,has:o,enforce:y,getterFor:w}},7156:function(e,t,i){var n=i("1626"),r=i("861d"),o=i("d2bb");e.exports=function(e,t,i){var s,a;return o&&n(s=t.constructor)&&s!==i&&r(a=s.prototype)&&a!==i.prototype&&o(e,a),e}},7418:function(e,t){t.f=Object.getOwnPropertySymbols},7839:function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},7917:function(e,t,i){var n=i("c532");function r(e,t,i,n,r){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),n&&(this.request=n),r&&(this.response=r)}n.inherits(r,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var o=r.prototype,s={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){s[e]={value:e}})),Object.defineProperties(r,s),Object.defineProperty(o,"isAxiosError",{value:!0}),r.from=function(e,t,i,s,a,l){var c=Object.create(o);return n.toFlatObject(e,c,(function(e){return e!==Error.prototype})),r.call(c,e.message,t,i,s,a),c.name=e.name,l&&Object.assign(c,l),c},e.exports=r},"7aac":function(e,t,i){var n=i("c532");e.exports=n.isStandardBrowserEnv()?{write:function(e,t,i,r,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(i)&&a.push("expires="+new Date(i).toGMTString()),n.isString(r)&&a.push("path="+r),n.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},"7b0b":function(e,t,i){var n=i("1d80"),r=Object;e.exports=function(e){return r(n(e))}},"7f9a":function(e,t,i){var n=i("da84"),r=i("1626"),o=i("8925"),s=n.WeakMap;e.exports=r(s)&&/native code/.test(o(s))},"825a":function(e,t,i){var n=i("861d"),r=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw o(r(e)+" is not an object")}},"83ab":function(e,t,i){var n=i("d039");e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"83b9":function(e,t,i){var n=i("d925"),r=i("e683");e.exports=function(e,t){return e&&!n(t)?r(e,t):t}},"848b":function(e,t,i){var n=i("5cce").version,r=i("7917"),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}}));var s={};function a(e,t,i){if("object"!=typeof e)throw new r("options must be an object",r.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var s=n[o],a=t[s];if(a){var l=e[s],c=void 0===l||a(l,s,e);if(!0!==c)throw new r("option "+s+" must be "+c,r.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new r("Unknown option "+s,r.ERR_BAD_OPTION)}}o.transitional=function(e,t,i){function o(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(i?". "+i:"")}return function(i,n,a){if(!1===e)throw new r(o(n," has been removed"+(t?" in "+t:"")),r.ERR_DEPRECATED);return t&&!s[n]&&(s[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(i,n,a)}},e.exports={assertOptions:a,validators:o}},"861d":function(e,t,i){var n=i("1626");e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},8925:function(e,t,i){var n=i("e330"),r=i("1626"),o=i("c6cd"),s=n(Function.toString);r(o.inspectSource)||(o.inspectSource=function(e){return s(e)}),e.exports=o.inspectSource},"8df4":function(e,t,i){var n=i("fb60");function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var i=this;this.promise.then((function(e){if(i._listeners){var t,n=i._listeners.length;for(t=0;t<n;t++)i._listeners[t](e);i._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){i.subscribe(e),t=e})).then(e);return n.cancel=function(){i.unsubscribe(t)},n},e((function(e){i.reason||(i.reason=new n(e),t(i.reason))}))}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},r.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},r.source=function(){var e;return{token:new r((function(t){e=t})),cancel:e}},e.exports=r},"90e3":function(e,t,i){var n=i("e330"),r=0,o=Math.random(),s=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++r+o,36)}},9112:function(e,t,i){var n=i("83ab"),r=i("9bf2"),o=i("5c6c");e.exports=n?function(e,t,i){return r.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},9152:function(e,t){
|
|
14
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
15
|
+
t.read=function(e,t,i,n,r){var o,s,a=8*r-n-1,l=(1<<a)-1,c=l>>1,u=-7,h=i?r-1:0,d=i?-1:1,p=e[t+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+e[t+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,i,n,r,o){var s,a,l,c=8*o-r-1,u=(1<<c)-1,h=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,f=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*l-1)*Math.pow(2,r),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;e[i+p]=255&a,p+=f,a/=256,r-=8);for(s=s<<r|a,c+=r;c>0;e[i+p]=255&s,p+=f,s/=256,c-=8);e[i+p-f]|=128*g}},"94ca":function(e,t,i){var n=i("d039"),r=i("1626"),o=/#|\.prototype\./,s=function(e,t){var i=l[a(e)];return i==u||i!=c&&(r(t)?n(t):!!t)},a=s.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=s.data={},c=s.NATIVE="N",u=s.POLYFILL="P";e.exports=s},"9bf2":function(e,t,i){var n=i("83ab"),r=i("0cfb"),o=i("aed9"),s=i("825a"),a=i("a04b"),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h="enumerable",d="configurable",p="writable";t.f=n?o?function(e,t,i){if(s(e),t=a(t),s(i),"function"==typeof e&&"prototype"===t&&"value"in i&&p in i&&!i[p]){var n=u(e,t);n&&n[p]&&(e[t]=i.value,i={configurable:d in i?i[d]:n[d],enumerable:h in i?i[h]:n[h],writable:!1})}return c(e,t,i)}:c:function(e,t,i){if(s(e),t=a(t),s(i),r)try{return c(e,t,i)}catch(e){}if("get"in i||"set"in i)throw l("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},a04b:function(e,t,i){var n=i("c04e"),r=i("d9b5");e.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}},aa78:function(e,t,i){var n,r,o;//! openseadragon 3.0.0
|
|
16
|
+
//! Built on 2021-12-15
|
|
17
|
+
//! Git commit: v3.0.0-0-3eded36
|
|
18
|
+
//! http://openseadragon.github.io
|
|
19
|
+
//! License: http://openseadragon.github.io/license/
|
|
20
|
+
function s(e){return new s.Viewer(e)}(function(e){e.version={versionStr:"3.0.0",major:parseInt("3",10),minor:parseInt("0",10),revision:parseInt("0",10)};var t={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"},i=Object.prototype.toString,n=Object.prototype.hasOwnProperty;e.isFunction=function(t){return"function"===e.type(t)},e.isArray=Array.isArray||function(t){return"array"===e.type(t)},e.isWindow=function(e){return e&&"object"==typeof e&&"setInterval"in e},e.type=function(e){return null==e?String(e):t[i.call(e)]||"object"},e.isPlainObject=function(t){if(!t||"object"!==s.type(t)||t.nodeType||e.isWindow(t))return!1;if(t.constructor&&!n.call(t,"constructor")&&!n.call(t.constructor.prototype,"isPrototypeOf"))return!1;var i;for(var r in t)i=r;return void 0===i||n.call(t,i)},e.isEmptyObject=function(e){for(var t in e)return!1;return!0},e.freezeObject=function(t){return Object.freeze?e.freezeObject=Object.freeze:e.freezeObject=function(e){return e},e.freezeObject(t)},e.supportsCanvas=function(){var t=document.createElement("canvas");return!(!e.isFunction(t.getContext)||!t.getContext("2d"))}(),e.isCanvasTainted=function(e){var t=!1;try{e.getContext("2d").getImageData(0,0,1,1)}catch(e){t=!0}return t},e.supportsAddEventListener=!(!document.documentElement.addEventListener||!document.addEventListener),e.supportsRemoveEventListener=!(!document.documentElement.removeEventListener||!document.removeEventListener),e.supportsEventListenerOptions=function(){var t=0;if(e.supportsAddEventListener)try{var i={get capture(){return t++,!1},get once(){return t++,!1},get passive(){return t++,!1}};window.addEventListener("test",null,i),window.removeEventListener("test",null,i)}catch(e){t=0}return t>=3}(),e.getCurrentPixelDensityRatio=function(){if(e.supportsCanvas){var t=document.createElement("canvas").getContext("2d"),i=window.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return Math.max(i,1)/n}return 1},e.pixelDensityRatio=e.getCurrentPixelDensityRatio()})(s),function(e){e.extend=function(){var e,t,i,n,r,o,a=arguments[0]||{},l=arguments.length,c=!1,u=1;for("boolean"==typeof a&&(c=a,a=arguments[1]||{},u=2),"object"==typeof a||s.isFunction(a)||(a={}),l===u&&(a=this,--u);u<l;u++)if(null!==(e=arguments[u])||void 0!==e)for(t in e)i=a[t],a!==(n=e[t])&&(c&&n&&(s.isPlainObject(n)||(r=s.isArray(n)))?(r?(r=!1,o=i&&s.isArray(i)?i:[]):o=i&&s.isPlainObject(i)?i:{},a[t]=s.extend(c,o,n)):void 0!==n&&(a[t]=n));return a};var t=function(){if("object"!=typeof navigator)return!1;var e=navigator.userAgent;return"string"==typeof e&&(-1!==e.indexOf("iPhone")||-1!==e.indexOf("iPad")||-1!==e.indexOf("iPod"))};e.extend(e,{DEFAULT_SETTINGS:{xmlPath:null,tileSources:null,tileHost:null,initialPage:0,crossOriginPolicy:!1,ajaxWithCredentials:!1,loadTilesWithAjax:!1,ajaxHeaders:{},panHorizontal:!0,panVertical:!0,constrainDuringPan:!1,wrapHorizontal:!1,wrapVertical:!1,visibilityRatio:.5,minPixelRatio:.5,defaultZoomLevel:0,minZoomLevel:null,maxZoomLevel:null,homeFillsViewer:!1,clickTimeThreshold:300,clickDistThreshold:5,dblClickTimeThreshold:300,dblClickDistThreshold:20,springStiffness:6.5,animationTime:1.2,gestureSettingsMouse:{dragToPan:!0,scrollToZoom:!0,clickToZoom:!0,dblClickToZoom:!1,pinchToZoom:!1,zoomToRefPoint:!0,flickEnabled:!1,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsTouch:{dragToPan:!0,scrollToZoom:!1,clickToZoom:!1,dblClickToZoom:!0,pinchToZoom:!0,zoomToRefPoint:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsPen:{dragToPan:!0,scrollToZoom:!1,clickToZoom:!0,dblClickToZoom:!1,pinchToZoom:!1,zoomToRefPoint:!0,flickEnabled:!1,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsUnknown:{dragToPan:!0,scrollToZoom:!1,clickToZoom:!1,dblClickToZoom:!0,pinchToZoom:!0,zoomToRefPoint:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},zoomPerClick:2,zoomPerScroll:1.2,zoomPerSecond:1,blendTime:0,alwaysBlend:!1,autoHideControls:!0,immediateRender:!1,minZoomImageRatio:.9,maxZoomPixelRatio:1.1,smoothTileEdgesMinZoom:1.1,iOSDevice:t(),pixelsPerWheelLine:40,pixelsPerArrowPress:40,autoResize:!0,preserveImageSizeOnResize:!1,minScrollDeltaTime:50,rotationIncrement:90,showSequenceControl:!0,sequenceControlAnchor:null,preserveViewport:!1,preserveOverlays:!1,navPrevNextWrap:!1,showNavigationControl:!0,navigationControlAnchor:null,showZoomControl:!0,showHomeControl:!0,showFullPageControl:!0,showRotationControl:!1,showFlipControl:!1,controlsFadeDelay:2e3,controlsFadeLength:1500,mouseNavEnabled:!0,showNavigator:!1,navigatorId:null,navigatorPosition:null,navigatorSizeRatio:.2,navigatorMaintainSizeRatio:!1,navigatorTop:null,navigatorLeft:null,navigatorHeight:null,navigatorWidth:null,navigatorAutoResize:!0,navigatorAutoFade:!0,navigatorRotate:!0,navigatorBackground:"#000",navigatorOpacity:.8,navigatorBorderColor:"#555",navigatorDisplayRegionColor:"#900",degrees:0,flipped:!1,opacity:1,preload:!1,compositeOperation:null,imageSmoothingEnabled:!0,placeholderFillStyle:null,showReferenceStrip:!1,referenceStripScroll:"horizontal",referenceStripElement:null,referenceStripHeight:null,referenceStripWidth:null,referenceStripPosition:"BOTTOM_LEFT",referenceStripSizeRatio:.2,collectionRows:3,collectionColumns:0,collectionLayout:"horizontal",collectionMode:!1,collectionTileSize:800,collectionTileMargin:80,imageLoaderLimit:0,maxImageCacheCount:200,timeout:3e4,useCanvas:!0,prefixUrl:"/images/",navImages:{zoomIn:{REST:"zoomin_rest.png",GROUP:"zoomin_grouphover.png",HOVER:"zoomin_hover.png",DOWN:"zoomin_pressed.png"},zoomOut:{REST:"zoomout_rest.png",GROUP:"zoomout_grouphover.png",HOVER:"zoomout_hover.png",DOWN:"zoomout_pressed.png"},home:{REST:"home_rest.png",GROUP:"home_grouphover.png",HOVER:"home_hover.png",DOWN:"home_pressed.png"},fullpage:{REST:"fullpage_rest.png",GROUP:"fullpage_grouphover.png",HOVER:"fullpage_hover.png",DOWN:"fullpage_pressed.png"},rotateleft:{REST:"rotateleft_rest.png",GROUP:"rotateleft_grouphover.png",HOVER:"rotateleft_hover.png",DOWN:"rotateleft_pressed.png"},rotateright:{REST:"rotateright_rest.png",GROUP:"rotateright_grouphover.png",HOVER:"rotateright_hover.png",DOWN:"rotateright_pressed.png"},flip:{REST:"flip_rest.png",GROUP:"flip_grouphover.png",HOVER:"flip_hover.png",DOWN:"flip_pressed.png"},previous:{REST:"previous_rest.png",GROUP:"previous_grouphover.png",HOVER:"previous_hover.png",DOWN:"previous_pressed.png"},next:{REST:"next_rest.png",GROUP:"next_grouphover.png",HOVER:"next_hover.png",DOWN:"next_pressed.png"}},debugMode:!1,debugGridColor:["#437AB2","#1B9E77","#D95F02","#7570B3","#E7298A","#66A61E","#E6AB02","#A6761D","#666666"]},SIGNAL:"----seadragon----",delegate:function(e,t){return function(){var i=arguments;return void 0===i&&(i=[]),t.apply(e,i)}},BROWSERS:{UNKNOWN:0,IE:1,FIREFOX:2,SAFARI:3,CHROME:4,OPERA:5,EDGE:6,CHROMEEDGE:7},_viewers:new Map,getViewer:function(t){return e._viewers.get(this.getElement(t))},getElement:function(e){return"string"==typeof e&&(e=document.getElementById(e)),e},getElementPosition:function(t){var i,n,r=new e.Point;for(n=o(t=e.getElement(t),i="fixed"===e.getElementStyle(t).position);n;)r.x+=t.offsetLeft,r.y+=t.offsetTop,i&&(r=r.plus(e.getPageScroll())),n=o(t=n,i="fixed"===e.getElementStyle(t).position);return r},getElementOffset:function(t){var i,n,r=(t=e.getElement(t))&&t.ownerDocument,o={top:0,left:0};return r?(i=r.documentElement,void 0!==t.getBoundingClientRect&&(o=t.getBoundingClientRect()),n=r===r.window?r:9===r.nodeType&&(r.defaultView||r.parentWindow),new e.Point(o.left+(n.pageXOffset||i.scrollLeft)-(i.clientLeft||0),o.top+(n.pageYOffset||i.scrollTop)-(i.clientTop||0))):new e.Point},getElementSize:function(t){return t=e.getElement(t),new e.Point(t.clientWidth,t.clientHeight)},getElementStyle:document.documentElement.currentStyle?function(t){return(t=e.getElement(t)).currentStyle}:function(t){return t=e.getElement(t),window.getComputedStyle(t,"")},getCssPropertyWithVendorPrefix:function(t){var i={};return e.getCssPropertyWithVendorPrefix=function(t){if(void 0!==i[t])return i[t];var n=document.createElement("div").style,r=null;if(void 0!==n[t])r=t;else for(var o=["Webkit","Moz","MS","O","webkit","moz","ms","o"],s=e.capitalizeFirstLetter(t),a=0;a<o.length;a++){var l=o[a]+s;if(void 0!==n[l]){r=l;break}}return i[t]=r,r},e.getCssPropertyWithVendorPrefix(t)},capitalizeFirstLetter:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},positiveModulo:function(e,t){var i=e%t;return i<0&&(i+=t),i},pointInElement:function(t,i){t=e.getElement(t);var n=e.getElementOffset(t),r=e.getElementSize(t);return i.x>=n.x&&i.x<n.x+r.x&&i.y<n.y+r.y&&i.y>=n.y},getMousePosition:function(t){if("number"==typeof t.pageX)e.getMousePosition=function(t){var i=new e.Point;return i.x=t.pageX,i.y=t.pageY,i};else{if("number"!=typeof t.clientX)throw new Error("Unknown event mouse position, no known technique.");e.getMousePosition=function(t){var i=new e.Point;return i.x=t.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,i.y=t.clientY+document.body.scrollTop+document.documentElement.scrollTop,i}}return e.getMousePosition(t)},getPageScroll:function(){var t=document.documentElement||{},i=document.body||{};if("number"==typeof window.pageXOffset)e.getPageScroll=function(){return new e.Point(window.pageXOffset,window.pageYOffset)};else if(i.scrollLeft||i.scrollTop)e.getPageScroll=function(){return new e.Point(document.body.scrollLeft,document.body.scrollTop)};else{if(!t.scrollLeft&&!t.scrollTop)return new e.Point(0,0);e.getPageScroll=function(){return new e.Point(document.documentElement.scrollLeft,document.documentElement.scrollTop)}}return e.getPageScroll()},setPageScroll:function(t){if(void 0!==window.scrollTo)e.setPageScroll=function(e){window.scrollTo(e.x,e.y)};else{var i=e.getPageScroll();if(i.x===t.x&&i.y===t.y)return;document.body.scrollLeft=t.x,document.body.scrollTop=t.y;var n=e.getPageScroll();if(n.x!==i.x&&n.y!==i.y)return void(e.setPageScroll=function(e){document.body.scrollLeft=e.x,document.body.scrollTop=e.y});if(document.documentElement.scrollLeft=t.x,document.documentElement.scrollTop=t.y,(n=e.getPageScroll()).x!==i.x&&n.y!==i.y)return void(e.setPageScroll=function(e){document.documentElement.scrollLeft=e.x,document.documentElement.scrollTop=e.y});e.setPageScroll=function(e){}}e.setPageScroll(t)},getWindowSize:function(){var t=document.documentElement||{},i=document.body||{};if("number"==typeof window.innerWidth)e.getWindowSize=function(){return new e.Point(window.innerWidth,window.innerHeight)};else if(t.clientWidth||t.clientHeight)e.getWindowSize=function(){return new e.Point(document.documentElement.clientWidth,document.documentElement.clientHeight)};else{if(!i.clientWidth&&!i.clientHeight)throw new Error("Unknown window size, no known technique.");e.getWindowSize=function(){return new e.Point(document.body.clientWidth,document.body.clientHeight)}}return e.getWindowSize()},makeCenteredNode:function(t){t=e.getElement(t);var i=[e.makeNeutralElement("div"),e.makeNeutralElement("div"),e.makeNeutralElement("div")];return e.extend(i[0].style,{display:"table",height:"100%",width:"100%"}),e.extend(i[1].style,{display:"table-row"}),e.extend(i[2].style,{display:"table-cell",verticalAlign:"middle",textAlign:"center"}),i[0].appendChild(i[1]),i[1].appendChild(i[2]),i[2].appendChild(t),i[0]},makeNeutralElement:function(e){var t=document.createElement(e),i=t.style;return i.background="transparent none",i.border="none",i.margin="0px",i.padding="0px",i.position="static",t},now:function(){return Date.now?e.now=Date.now:e.now=function(){return(new Date).getTime()},e.now()},makeTransparentImage:function(t){var i=e.makeNeutralElement("img");return i.src=t,i},setElementOpacity:function(t,i,n){var r;t=e.getElement(t),n&&!e.Browser.alpha&&(i=Math.round(i)),e.Browser.opacity?t.style.opacity=i<1?i:"":i<1?(r="alpha(opacity="+Math.round(100*i)+")",t.style.filter=r):t.style.filter=""},setElementTouchActionNone:function(t){void 0!==(t=e.getElement(t)).style.touchAction?t.style.touchAction="none":void 0!==t.style.msTouchAction&&(t.style.msTouchAction="none")},setElementPointerEvents:function(t,i){void 0!==(t=e.getElement(t)).style.pointerEvents&&(t.style.pointerEvents=i)},setElementPointerEventsNone:function(t){e.setElementPointerEvents(t,"none")},addClass:function(t,i){(t=e.getElement(t)).className?-1===(" "+t.className+" ").indexOf(" "+i+" ")&&(t.className+=" "+i):t.className=i},indexOf:function(e,t,i){return Array.prototype.indexOf?this.indexOf=function(e,t,i){return e.indexOf(t,i)}:this.indexOf=function(e,t,i){var n,r,o=i||0;if(!e)throw new TypeError;if(0===(r=e.length)||o>=r)return-1;for(o<0&&(o=r-Math.abs(o)),n=o;n<r;n++)if(e[n]===t)return n;return-1},this.indexOf(e,t,i)},removeClass:function(t,i){var n,r,o=[];for(n=(t=e.getElement(t)).className.split(/\s+/),r=0;r<n.length;r++)n[r]&&n[r]!==i&&o.push(n[r]);t.className=o.join(" ")},normalizeEventListenerOptions:function(t){return void 0!==t?"boolean"==typeof t?e.supportsEventListenerOptions?{capture:t}:t:e.supportsEventListenerOptions?t:void 0!==t.capture&&t.capture:!!e.supportsEventListenerOptions&&{capture:!1}},addEvent:function(){if(e.supportsAddEventListener)return function(t,i,n,r){r=e.normalizeEventListenerOptions(r),(t=e.getElement(t)).addEventListener(i,n,r)};if(document.documentElement.attachEvent&&document.attachEvent)return function(t,i,n){(t=e.getElement(t)).attachEvent("on"+i,n)};throw new Error("No known event model.")}(),removeEvent:function(){if(e.supportsRemoveEventListener)return function(t,i,n,r){r=e.normalizeEventListenerOptions(r),(t=e.getElement(t)).removeEventListener(i,n,r)};if(document.documentElement.detachEvent&&document.detachEvent)return function(t,i,n){(t=e.getElement(t)).detachEvent("on"+i,n)};throw new Error("No known event model.")}(),cancelEvent:function(e){e.preventDefault()},eventIsCanceled:function(e){return e.defaultPrevented},stopEvent:function(e){e.stopPropagation()},createCallback:function(e,t){var i,n=[];for(i=2;i<arguments.length;i++)n.push(arguments[i]);return function(){var i,r=n.concat([]);for(i=0;i<arguments.length;i++)r.push(arguments[i]);return t.apply(e,r)}},getUrlParameter:function(e){return r[e]||null},getUrlProtocol:function(e){var t=e.match(/^([a-z]+:)\/\//i);return null===t?window.location.protocol:t[1].toLowerCase()},createAjaxRequest:function(t){var i;try{i=!!new ActiveXObject("Microsoft.XMLHTTP")}catch(e){i=!1}if(i)window.XMLHttpRequest?e.createAjaxRequest=function(e){return e?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest}:e.createAjaxRequest=function(){return new ActiveXObject("Microsoft.XMLHTTP")};else{if(!window.XMLHttpRequest)throw new Error("Browser doesn't support XMLHttpRequest.");e.createAjaxRequest=function(){return new XMLHttpRequest}}return e.createAjaxRequest(t)},makeAjaxRequest:function(t,i,n){var r,o,s;e.isPlainObject(t)&&(i=t.success,n=t.error,r=t.withCredentials,o=t.headers,s=t.responseType||null,t=t.url);var a=e.getUrlProtocol(t),l=e.createAjaxRequest("file:"===a);if(!e.isFunction(i))throw new Error("makeAjaxRequest requires a success callback");l.onreadystatechange=function(){4===l.readyState&&(l.onreadystatechange=function(){},l.status>=200&&l.status<300||0===l.status&&"http:"!==a&&"https:"!==a?i(l):(e.console.log("AJAX request returned %d: %s",l.status,t),e.isFunction(n)&&n(l)))};try{if(l.open("GET",t,!0),s&&(l.responseType=s),o)for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&o[c]&&l.setRequestHeader(c,o[c]);r&&(l.withCredentials=!0),l.send(null)}catch(t){e.console.log("%s while making AJAX request: %s",t.name,t.message),l.onreadystatechange=function(){},e.isFunction(n)&&n(l,t)}return l},jsonp:function(t){var i,n=t.url,r=document.head||document.getElementsByTagName("head")[0]||document.documentElement,o=t.callbackName||"openseadragon"+e.now(),s=window[o],a="$1"+o+"$2",l=t.param||"callback",c=t.callback;n=n.replace(/(=)\?(&|$)|\?\?/i,a),n+=(/\?/.test(n)?"&":"?")+l+"="+o,window[o]=function(t){if(s)window[o]=s;else try{delete window[o]}catch(e){}c&&e.isFunction(c)&&c(t)},i=document.createElement("script"),void 0===t.async&&!1===t.async||(i.async="async"),t.scriptCharset&&(i.charset=t.scriptCharset),i.src=n,i.onload=i.onreadystatechange=function(e,t){(t||!i.readyState||/loaded|complete/.test(i.readyState))&&(i.onload=i.onreadystatechange=null,r&&i.parentNode&&r.removeChild(i),i=void 0)},r.insertBefore(i,r.firstChild)},createFromDZI:function(){throw"OpenSeadragon.createFromDZI is deprecated, use Viewer.open."},parseXml:function(t){if(window.DOMParser)e.parseXml=function(e){return(new DOMParser).parseFromString(e,"text/xml")};else{if(!window.ActiveXObject)throw new Error("Browser doesn't support XML DOM.");e.parseXml=function(e){var t=null;return(t=new ActiveXObject("Microsoft.XMLDOM")).async=!1,t.loadXML(e),t}}return e.parseXml(t)},parseJSON:function(t){return e.parseJSON=window.JSON.parse,e.parseJSON(t)},imageFormatSupported:function(e){return!!n[(e=e||"").toLowerCase()]},setImageFormatsSupported:function(t){e.extend(n,t)}});var i=function(e){};e.console=window.console||{log:i,debug:i,info:i,warn:i,error:i,assert:i},e.Browser={vendor:e.BROWSERS.UNKNOWN,version:0,alpha:!0};var n={bmp:!1,jpeg:!0,jpg:!0,png:!0,tif:!1,wdp:!1},r={};function o(e,t){return t&&e!==document.body?document.body:e.offsetParent}(function(){var t=navigator.appVersion,i=navigator.userAgent;switch(navigator.appName){case"Microsoft Internet Explorer":window.attachEvent&&window.ActiveXObject&&(e.Browser.vendor=e.BROWSERS.IE,e.Browser.version=parseFloat(i.substring(i.indexOf("MSIE")+5,i.indexOf(";",i.indexOf("MSIE")))));break;case"Netscape":window.addEventListener&&(i.indexOf("Edge")>=0?(e.Browser.vendor=e.BROWSERS.EDGE,e.Browser.version=parseFloat(i.substring(i.indexOf("Edge")+5))):i.indexOf("Edg")>=0?(e.Browser.vendor=e.BROWSERS.CHROMEEDGE,e.Browser.version=parseFloat(i.substring(i.indexOf("Edg")+4))):i.indexOf("Firefox")>=0?(e.Browser.vendor=e.BROWSERS.FIREFOX,e.Browser.version=parseFloat(i.substring(i.indexOf("Firefox")+8))):i.indexOf("Safari")>=0?(e.Browser.vendor=i.indexOf("Chrome")>=0?e.BROWSERS.CHROME:e.BROWSERS.SAFARI,e.Browser.version=parseFloat(i.substring(i.substring(0,i.indexOf("Safari")).lastIndexOf("/")+1,i.indexOf("Safari")))):null!==new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(i)&&(e.Browser.vendor=e.BROWSERS.IE,e.Browser.version=parseFloat(RegExp.$1)));break;case"Opera":e.Browser.vendor=e.BROWSERS.OPERA,e.Browser.version=parseFloat(t)}var n,o,s,a=window.location.search.substring(1).split("&");for(s=0;s<a.length;s++)if((o=(n=a[s]).indexOf("="))>0){var l=n.substring(0,o),c=n.substring(o+1);try{r[l]=decodeURIComponent(c)}catch(t){e.console.error("Ignoring malformed URL parameter: %s=%s",l,c)}}e.Browser.alpha=!(e.Browser.vendor===e.BROWSERS.CHROME&&e.Browser.version<2),e.Browser.opacity=!0,e.Browser.vendor===e.BROWSERS.IE&&e.Browser.version<11&&e.console.error("Internet Explorer versions < 11 are not supported by OpenSeadragon")})(),function(t){var i=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame,n=t.cancelAnimationFrame||t.mozCancelAnimationFrame||t.webkitCancelAnimationFrame||t.msCancelAnimationFrame;if(i&&n)e.requestAnimationFrame=function(){return i.apply(t,arguments)},e.cancelAnimationFrame=function(){return n.apply(t,arguments)};else{var r,o=[],s=[],a=0;e.requestAnimationFrame=function(t){return o.push([++a,t]),r||(r=setInterval((function(){if(o.length){var t=e.now(),i=s;for(s=o,o=i;s.length;)s.shift()[1](t)}else clearInterval(r),r=void 0}),20)),a},e.cancelAnimationFrame=function(e){var t,i;for(t=0,i=o.length;t<i;t+=1)if(o[t][0]===e)return void o.splice(t,1);for(t=0,i=s.length;t<i;t+=1)if(s[t][0]===e)return void s.splice(t,1)}}}(window)}(s),function(i,s){r=[],void 0===(o="function"==typeof(n=s)?n.apply(t,r):n)||(e.exports=o)}(0,(function(){return s})),function(e){var t={supportsFullScreen:!1,isFullScreen:function(){return!1},getFullScreenElement:function(){return null},requestFullScreen:function(){},exitFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",fullScreenErrorEventName:""};document.exitFullscreen?(t.supportsFullScreen=!0,t.getFullScreenElement=function(){return document.fullscreenElement},t.requestFullScreen=function(e){return e.requestFullscreen()},t.exitFullScreen=function(){document.exitFullscreen()},t.fullScreenEventName="fullscreenchange",t.fullScreenErrorEventName="fullscreenerror"):document.msExitFullscreen?(t.supportsFullScreen=!0,t.getFullScreenElement=function(){return document.msFullscreenElement},t.requestFullScreen=function(e){return e.msRequestFullscreen()},t.exitFullScreen=function(){document.msExitFullscreen()},t.fullScreenEventName="MSFullscreenChange",t.fullScreenErrorEventName="MSFullscreenError"):document.webkitExitFullscreen?(t.supportsFullScreen=!0,t.getFullScreenElement=function(){return document.webkitFullscreenElement},t.requestFullScreen=function(e){return e.webkitRequestFullscreen()},t.exitFullScreen=function(){document.webkitExitFullscreen()},t.fullScreenEventName="webkitfullscreenchange",t.fullScreenErrorEventName="webkitfullscreenerror"):document.webkitCancelFullScreen?(t.supportsFullScreen=!0,t.getFullScreenElement=function(){return document.webkitCurrentFullScreenElement},t.requestFullScreen=function(e){return e.webkitRequestFullScreen()},t.exitFullScreen=function(){document.webkitCancelFullScreen()},t.fullScreenEventName="webkitfullscreenchange",t.fullScreenErrorEventName="webkitfullscreenerror"):document.mozCancelFullScreen&&(t.supportsFullScreen=!0,t.getFullScreenElement=function(){return document.mozFullScreenElement},t.requestFullScreen=function(e){return e.mozRequestFullScreen()},t.exitFullScreen=function(){document.mozCancelFullScreen()},t.fullScreenEventName="mozfullscreenchange",t.fullScreenErrorEventName="mozfullscreenerror"),t.isFullScreen=function(){return null!==t.getFullScreenElement()},t.cancelFullScreen=function(){e.console.error("cancelFullScreen is deprecated. Use exitFullScreen instead."),t.exitFullScreen()},e.extend(e,t)}(s),function(e){e.EventSource=function(){this.events={}},e.EventSource.prototype={addOnceHandler:function(e,t,i,n){var r=this;n=n||1;var o=0,s=function(i){++o===n&&r.removeHandler(e,s),t(i)};this.addHandler(e,s,i)},addHandler:function(t,i,n){var r=this.events[t];r||(this.events[t]=r=[]),i&&e.isFunction(i)&&(r[r.length]={handler:i,userData:n||null})},removeHandler:function(t,i){var n,r=this.events[t],o=[];if(r&&e.isArray(r)){for(n=0;n<r.length;n++)r[n].handler!==i&&o.push(r[n]);this.events[t]=o}},removeAllHandlers:function(e){if(e)this.events[e]=[];else for(var t in this.events)this.events[t]=[]},getHandler:function(e){var t=this.events[e];return t&&t.length?(t=1===t.length?[t[0]]:Array.apply(null,t),function(e,i){var n,r=t.length;for(n=0;n<r;n++)t[n]&&(i.eventSource=e,i.userData=t[n].userData,t[n].handler(i))}):null},raiseEvent:function(e,t){var i=this.getHandler(e);i&&(t||(t={}),i(this,t))}}}(s),function(e){var t=[],i={};e.MouseTracker=function(n){t.push(this);var r=arguments;e.isPlainObject(n)||(n={element:r[0],clickTimeThreshold:r[1],clickDistThreshold:r[2]}),this.hash=Math.random(),this.element=e.getElement(n.element),this.clickTimeThreshold=n.clickTimeThreshold||e.DEFAULT_SETTINGS.clickTimeThreshold,this.clickDistThreshold=n.clickDistThreshold||e.DEFAULT_SETTINGS.clickDistThreshold,this.dblClickTimeThreshold=n.dblClickTimeThreshold||e.DEFAULT_SETTINGS.dblClickTimeThreshold,this.dblClickDistThreshold=n.dblClickDistThreshold||e.DEFAULT_SETTINGS.dblClickDistThreshold,this.userData=n.userData||null,this.stopDelay=n.stopDelay||50,this.preProcessEventHandler=n.preProcessEventHandler||null,this.contextMenuHandler=n.contextMenuHandler||null,this.enterHandler=n.enterHandler||null,this.leaveHandler=n.leaveHandler||null,this.exitHandler=n.exitHandler||null,this.overHandler=n.overHandler||null,this.outHandler=n.outHandler||null,this.pressHandler=n.pressHandler||null,this.nonPrimaryPressHandler=n.nonPrimaryPressHandler||null,this.releaseHandler=n.releaseHandler||null,this.nonPrimaryReleaseHandler=n.nonPrimaryReleaseHandler||null,this.moveHandler=n.moveHandler||null,this.scrollHandler=n.scrollHandler||null,this.clickHandler=n.clickHandler||null,this.dblClickHandler=n.dblClickHandler||null,this.dragHandler=n.dragHandler||null,this.dragEndHandler=n.dragEndHandler||null,this.pinchHandler=n.pinchHandler||null,this.stopHandler=n.stopHandler||null,this.keyDownHandler=n.keyDownHandler||null,this.keyUpHandler=n.keyUpHandler||null,this.keyHandler=n.keyHandler||null,this.focusHandler=n.focusHandler||null,this.blurHandler=n.blurHandler||null;var o=this;i[this.hash]={click:function(e){y(o,e)},dblclick:function(e){w(o,e)},keydown:function(e){x(o,e)},keyup:function(e){b(o,e)},keypress:function(e){_(o,e)},focus:function(e){T(o,e)},blur:function(e){S(o,e)},contextmenu:function(e){E(o,e)},wheel:function(e){P(o,e)},mousewheel:function(e){C(o,e)},DOMMouseScroll:function(e){C(o,e)},MozMousePixelScroll:function(e){C(o,e)},losecapture:function(e){k(o,e)},mouseenter:function(e){$(o,e)},mouseleave:function(e){F(o,e)},mouseover:function(e){N(o,e)},mouseout:function(e){z(o,e)},mousedown:function(e){V(o,e)},mouseup:function(e){j(o,e)},mousemove:function(e){G(o,e)},touchstart:function(e){O(o,e)},touchend:function(e){I(o,e)},touchmove:function(e){D(o,e)},touchcancel:function(e){A(o,e)},gesturestart:function(e){L(o,e)},gesturechange:function(e){H(o,e)},gotpointercapture:function(e){M(o,e)},lostpointercapture:function(e){B(o,e)},pointerenter:function(e){$(o,e)},pointerleave:function(e){F(o,e)},pointerover:function(e){N(o,e)},pointerout:function(e){z(o,e)},pointerdown:function(e){V(o,e)},pointerup:function(e){j(o,e)},pointermove:function(e){G(o,e)},pointercancel:function(e){X(o,e)},pointerupcaptured:function(e){U(o,e)},pointermovecaptured:function(e){q(o,e)},tracking:!1,activePointersLists:[],lastClickPos:null,dblClickTimeOut:null,pinchGPoints:[],lastPinchDist:0,currentPinchDist:0,lastPinchCenter:null,currentPinchCenter:null,sentDragEvent:!1},this.hasGestureHandlers=!!(this.pressHandler||this.nonPrimaryPressHandler||this.releaseHandler||this.nonPrimaryReleaseHandler||this.clickHandler||this.dblClickHandler||this.dragHandler||this.dragEndHandler||this.pinchHandler),this.hasScrollHandler=!!this.scrollHandler,e.MouseTracker.havePointerEvents&&e.setElementPointerEvents(this.element,"auto"),this.exitHandler&&e.console.error("MouseTracker.exitHandler is deprecated. Use MouseTracker.leaveHandler instead."),n.startDisabled||this.setTracking(!0)},e.MouseTracker.prototype={destroy:function(){var e;for(a(this),this.element=null,e=0;e<t.length;e++)if(t[e]===this){t.splice(e,1);break}i[this.hash]=null,delete i[this.hash]},isTracking:function(){return i[this.hash].tracking},setTracking:function(e){return e?s(this):a(this),this},getActivePointersListByType:function(t){var n,r,o=i[this.hash],s=o.activePointersLists.length;for(n=0;n<s;n++)if(o.activePointersLists[n].type===t)return o.activePointersLists[n];return r=new e.MouseTracker.GesturePointList(t),o.activePointersLists.push(r),r},getActivePointerCount:function(){var e,t=i[this.hash],n=t.activePointersLists.length,r=0;for(e=0;e<n;e++)r+=t.activePointersLists[e].getLength();return r},preProcessEventHandler:function(){},contextMenuHandler:function(){},enterHandler:function(){},leaveHandler:function(){},exitHandler:function(){},overHandler:function(){},outHandler:function(){},pressHandler:function(){},nonPrimaryPressHandler:function(){},releaseHandler:function(){},nonPrimaryReleaseHandler:function(){},moveHandler:function(){},scrollHandler:function(){},clickHandler:function(){},dblClickHandler:function(){},dragHandler:function(){},dragEndHandler:function(){},pinchHandler:function(){},stopHandler:function(){},keyDownHandler:function(){},keyUpHandler:function(){},keyHandler:function(){},focusHandler:function(){},blurHandler:function(){}};var n=function(){try{return window.self!==window.top}catch(e){return!0}}();function r(e){try{return e.addEventListener&&e.removeEventListener}catch(e){return!1}}function o(e){var t,n,r,o,s,a=i[e.hash],l=a.activePointersLists.length;for(t=0;t<l;t++)if((r=a.activePointersLists[t]).getLength()>0){for(s=[],o=r.asArray(),n=0;n<o.length;n++)s.push(o[n]);for(n=0;n<s.length;n++)K(e,r,s[n])}for(t=0;t<l;t++)a.activePointersLists.pop();a.sentDragEvent=!1}function s(t){var n,r,s=i[t.hash];if(!s.tracking){for(r=0;r<e.MouseTracker.subscribeEvents.length;r++)n=e.MouseTracker.subscribeEvents[r],e.addEvent(t.element,n,s[n],n===e.MouseTracker.wheelEventName&&{passive:!1,capture:!1});o(t),s.tracking=!0}}function a(t){var n,r,s=i[t.hash];if(s.tracking){for(r=0;r<e.MouseTracker.subscribeEvents.length;r++)n=e.MouseTracker.subscribeEvents[r],e.removeEvent(t.element,n,s[n],!1);o(t),s.tracking=!1}}function l(e,t){var n=i[e.hash];if("pointerevent"===t)return{upName:"pointerup",upHandler:n.pointerupcaptured,moveName:"pointermove",moveHandler:n.pointermovecaptured};if("mouse"===t)return{upName:"pointerup",upHandler:n.pointerupcaptured,moveName:"pointermove",moveHandler:n.pointermovecaptured};if("touch"===t)return{upName:"touchend",upHandler:n.touchendcaptured,moveName:"touchmove",moveHandler:n.touchmovecaptured};throw new Error("MouseTracker.getCaptureEventParams: Unknown pointer type.")}function c(t,i){var o;if(e.MouseTracker.havePointerCapture)if(e.MouseTracker.havePointerEvents)try{t.element.setPointerCapture(i.id)}catch(t){return void e.console.warn("setPointerCapture() called on invalid pointer ID")}else t.element.setCapture(!0);else o=l(t,e.MouseTracker.havePointerEvents?"pointerevent":i.type),n&&r(window.top)&&e.addEvent(window.top,o.upName,o.upHandler,!0),e.addEvent(e.MouseTracker.captureElement,o.upName,o.upHandler,!0),e.addEvent(e.MouseTracker.captureElement,o.moveName,o.moveHandler,!0);ee(t,i,!0)}function u(t,i){var o,s;if(e.MouseTracker.havePointerCapture)if(e.MouseTracker.havePointerEvents){if(!(s=t.getActivePointersListByType(i.type).getById(i.id))||!s.captured)return;try{t.element.releasePointerCapture(i.id)}catch(e){}}else t.element.releaseCapture();else o=l(t,e.MouseTracker.havePointerEvents?"pointerevent":i.type),n&&r(window.top)&&e.removeEvent(window.top,o.upName,o.upHandler,!0),e.removeEvent(e.MouseTracker.captureElement,o.moveName,o.moveHandler,!0),e.removeEvent(e.MouseTracker.captureElement,o.upName,o.upHandler,!0);ee(t,i,!1)}function h(t){return e.MouseTracker.havePointerEvents?t.pointerId:e.MouseTracker.mousePointerId}function d(t){return e.MouseTracker.havePointerEvents?t.pointerType||(e.Browser.vendor===e.BROWSERS.IE?"mouse":""):"mouse"}function p(t){return!e.MouseTracker.havePointerEvents||t.isPrimary}function f(t){return e.getMousePosition(t)}function g(e,t){return v(f(e),t)}function v(t,i){var n=e.getElementOffset(i);return t.minus(n)}function m(t,i){return new e.Point((t.x+i.x)/2,(t.y+i.y)/2)}function y(t,i){var n={originalEvent:i,eventType:"click",pointerType:"mouse",isEmulated:!1};J(t,n),n.preventDefault&&!n.defaultPrevented&&e.cancelEvent(i),n.stopPropagation&&e.stopEvent(i)}function w(t,i){var n={originalEvent:i,eventType:"dblclick",pointerType:"mouse",isEmulated:!1};J(t,n),n.preventDefault&&!n.defaultPrevented&&e.cancelEvent(i),n.stopPropagation&&e.stopEvent(i)}function x(t,i){var n=null,r={originalEvent:i,eventType:"keydown",pointerType:"",isEmulated:!1};J(t,r),!t.keyDownHandler||r.preventGesture||r.defaultPrevented||(n={eventSource:t,keyCode:i.keyCode?i.keyCode:i.charCode,ctrl:i.ctrlKey,shift:i.shiftKey,alt:i.altKey,meta:i.metaKey,originalEvent:i,preventDefault:r.preventDefault||r.defaultPrevented,userData:t.userData},t.keyDownHandler(n)),(n&&n.preventDefault||r.preventDefault&&!r.defaultPrevented)&&e.cancelEvent(i),r.stopPropagation&&e.stopEvent(i)}function b(t,i){var n=null,r={originalEvent:i,eventType:"keyup",pointerType:"",isEmulated:!1};J(t,r),!t.keyUpHandler||r.preventGesture||r.defaultPrevented||(n={eventSource:t,keyCode:i.keyCode?i.keyCode:i.charCode,ctrl:i.ctrlKey,shift:i.shiftKey,alt:i.altKey,meta:i.metaKey,originalEvent:i,preventDefault:r.preventDefault||r.defaultPrevented,userData:t.userData},t.keyUpHandler(n)),(n&&n.preventDefault||r.preventDefault&&!r.defaultPrevented)&&e.cancelEvent(i),r.stopPropagation&&e.stopEvent(i)}function _(t,i){var n=null,r={originalEvent:i,eventType:"keypress",pointerType:"",isEmulated:!1};J(t,r),!t.keyHandler||r.preventGesture||r.defaultPrevented||(n={eventSource:t,keyCode:i.keyCode?i.keyCode:i.charCode,ctrl:i.ctrlKey,shift:i.shiftKey,alt:i.altKey,meta:i.metaKey,originalEvent:i,preventDefault:r.preventDefault||r.defaultPrevented,userData:t.userData},t.keyHandler(n)),(n&&n.preventDefault||r.preventDefault&&!r.defaultPrevented)&&e.cancelEvent(i),r.stopPropagation&&e.stopEvent(i)}function T(e,t){var i={originalEvent:t,eventType:"focus",pointerType:"",isEmulated:!1};J(e,i),e.focusHandler&&!i.preventGesture&&e.focusHandler({eventSource:e,originalEvent:t,userData:e.userData})}function S(e,t){var i={originalEvent:t,eventType:"blur",pointerType:"",isEmulated:!1};J(e,i),e.blurHandler&&!i.preventGesture&&e.blurHandler({eventSource:e,originalEvent:t,userData:e.userData})}function E(t,i){var n=null,r={originalEvent:i,eventType:"contextmenu",pointerType:"mouse",isEmulated:!1};J(t,r),!t.contextMenuHandler||r.preventGesture||r.defaultPrevented||(n={eventSource:t,position:v(f(i),t.element),originalEvent:r.originalEvent,preventDefault:r.preventDefault||r.defaultPrevented,userData:t.userData},t.contextMenuHandler(n)),(n&&n.preventDefault||r.preventDefault&&!r.defaultPrevented)&&e.cancelEvent(i),r.stopPropagation&&e.stopEvent(i)}function P(e,t){R(e,t,t)}function C(t,i){var n={target:i.target||i.srcElement,type:"wheel",shiftKey:i.shiftKey||!1,clientX:i.clientX,clientY:i.clientY,pageX:i.pageX?i.pageX:i.clientX,pageY:i.pageY?i.pageY:i.clientY,deltaMode:"MozMousePixelScroll"===i.type?0:1,deltaX:0,deltaZ:0};"mousewheel"===e.MouseTracker.wheelEventName?n.deltaY=-i.wheelDelta/e.DEFAULT_SETTINGS.pixelsPerWheelLine:n.deltaY=i.detail,R(t,n,i)}function R(t,i,n){var r,o=0,s=null;o=i.deltaY<0?1:-1,J(t,r={originalEvent:i,eventType:"wheel",pointerType:"mouse",isEmulated:i!==n}),!t.scrollHandler||r.preventGesture||r.defaultPrevented||(s={eventSource:t,pointerType:"mouse",position:g(i,t.element),scroll:o,shift:i.shiftKey,isTouchEvent:!1,originalEvent:n,preventDefault:r.preventDefault||r.defaultPrevented,userData:t.userData},t.scrollHandler(s)),r.stopPropagation&&e.stopEvent(n),(s&&s.preventDefault||r.preventDefault&&!r.defaultPrevented)&&e.cancelEvent(n)}function k(t,i){var n={id:e.MouseTracker.mousePointerId,type:"mouse"},r={originalEvent:i,eventType:"lostpointercapture",pointerType:"mouse",isEmulated:!1};J(t,r),i.target===t.element&&ee(t,n,!1),r.stopPropagation&&e.stopEvent(i)}function O(t,i){var n,r,o,s=i.changedTouches.length,a=t.getActivePointersListByType("touch");n=e.now(),a.getLength()>i.touches.length-s&&e.console.warn("Tracked touch contact count doesn't match event.touches.length");var l={originalEvent:i,eventType:"pointerdown",pointerType:"touch",isEmulated:!1};for(J(t,l),r=0;r<s;r++)te(t,l,o={id:i.changedTouches[r].identifier,type:"touch",isPrimary:0===a.getLength(),currentPos:f(i.changedTouches[r]),currentTime:n}),oe(t,l,o,0),ee(t,o,!0);l.preventDefault&&!l.defaultPrevented&&e.cancelEvent(i),l.stopPropagation&&e.stopEvent(i)}function I(t,i){var n,r,o,s=i.changedTouches.length;n=e.now();var a={originalEvent:i,eventType:"pointerup",pointerType:"touch",isEmulated:!1};for(J(t,a),r=0;r<s;r++)se(t,a,o={id:i.changedTouches[r].identifier,type:"touch",currentPos:f(i.changedTouches[r]),currentTime:n},0),ee(t,o,!1),ie(t,a,o);a.preventDefault&&!a.defaultPrevented&&e.cancelEvent(i),a.stopPropagation&&e.stopEvent(i)}function D(t,i){var n,r,o=i.changedTouches.length;n=e.now();var s={originalEvent:i,eventType:"pointermove",pointerType:"touch",isEmulated:!1};for(J(t,s),r=0;r<o;r++)ae(t,s,{id:i.changedTouches[r].identifier,type:"touch",currentPos:f(i.changedTouches[r]),currentTime:n});s.preventDefault&&!s.defaultPrevented&&e.cancelEvent(i),s.stopPropagation&&e.stopEvent(i)}function A(t,i){var n,r=i.changedTouches.length,o={originalEvent:i,eventType:"pointercancel",pointerType:"touch",isEmulated:!1};for(J(t,o),n=0;n<r;n++)le(t,o,{id:i.changedTouches[n].identifier,type:"touch"});o.stopPropagation&&e.stopEvent(i)}function L(t,i){return e.eventIsCanceled(i)||i.preventDefault(),!1}function H(t,i){return e.eventIsCanceled(i)||i.preventDefault(),!1}function M(t,i){var n={originalEvent:i,eventType:"gotpointercapture",pointerType:d(i),isEmulated:!1};J(t,n),i.target===t.element&&ee(t,{id:i.pointerId,type:d(i)},!0),n.stopPropagation&&e.stopEvent(i)}function B(t,i){var n={originalEvent:i,eventType:"lostpointercapture",pointerType:d(i),isEmulated:!1};J(t,n),i.target===t.element&&ee(t,{id:i.pointerId,type:d(i)},!1),n.stopPropagation&&e.stopEvent(i)}function $(t,i){var n={id:h(i),type:d(i),isPrimary:p(i),currentPos:f(i),currentTime:e.now()},r={originalEvent:i,eventType:"pointerenter",pointerType:n.type,isEmulated:!1};J(t,r),te(t,r,n)}function F(t,i){var n={id:h(i),type:d(i),isPrimary:p(i),currentPos:f(i),currentTime:e.now()},r={originalEvent:i,eventType:"pointerleave",pointerType:n.type,isEmulated:!1};J(t,r),ie(t,r,n)}function N(t,i){var n={id:h(i),type:d(i),isPrimary:p(i),currentPos:f(i),currentTime:e.now()},r={originalEvent:i,eventType:"pointerover",pointerType:n.type,isEmulated:!1};J(t,r),ne(t,r,n),r.preventDefault&&!r.defaultPrevented&&e.cancelEvent(i),r.stopPropagation&&e.stopEvent(i)}function z(t,i){var n={id:h(i),type:d(i),isPrimary:p(i),currentPos:f(i),currentTime:e.now()},r={originalEvent:i,eventType:"pointerout",pointerType:n.type,isEmulated:!1};J(t,r),re(t,r,n),r.preventDefault&&!r.defaultPrevented&&e.cancelEvent(i),r.stopPropagation&&e.stopEvent(i)}function V(t,i){var n={id:h(i),type:d(i),isPrimary:p(i),currentPos:f(i),currentTime:e.now()},r=e.MouseTracker.havePointerEvents&&"touch"===n.type&&e.Browser.vendor!==e.BROWSERS.IE,o={originalEvent:i,eventType:"pointerdown",pointerType:n.type,isEmulated:!1};J(t,o),oe(t,o,n,i.button),o.preventDefault&&!o.defaultPrevented&&e.cancelEvent(i),o.stopPropagation&&e.stopEvent(i),o.shouldCapture&&(r?ee(t,n,!0):c(t,n))}function j(e,t){W(e,t)}function U(t,i){t.getActivePointersListByType(d(i)).getById(i.pointerId)&&W(t,i),e.stopEvent(i)}function W(t,i){var n,r={originalEvent:i,eventType:"pointerup",pointerType:(n={id:h(i),type:d(i),isPrimary:p(i),currentPos:f(i),currentTime:e.now()}).type,isEmulated:!1};J(t,r),se(t,r,n,i.button),r.preventDefault&&!r.defaultPrevented&&e.cancelEvent(i),r.stopPropagation&&e.stopEvent(i),r.shouldReleaseCapture&&(i.target===t.element?u(t,n):ee(t,n,!1))}function G(e,t){Z(e,t)}function q(t,i){t.getActivePointersListByType(d(i)).getById(i.pointerId)&&Z(t,i),e.stopEvent(i)}function Z(t,i){var n={id:h(i),type:d(i),isPrimary:p(i),currentPos:f(i),currentTime:e.now()},r={originalEvent:i,eventType:"pointermove",pointerType:n.type,isEmulated:!1};J(t,r),ae(t,r,n),r.preventDefault&&!r.defaultPrevented&&e.cancelEvent(i),r.stopPropagation&&e.stopEvent(i)}function X(t,i){var n={id:i.pointerId,type:d(i)},r={originalEvent:i,eventType:"pointercancel",pointerType:n.type,isEmulated:!1};J(t,r),le(t,r,n),r.stopPropagation&&e.stopEvent(i)}function Y(e,t){return t.speed=0,t.direction=0,t.contactPos=t.currentPos,t.contactTime=t.currentTime,t.lastPos=t.currentPos,t.lastTime=t.currentTime,e.add(t)}function K(t,i,n){var r,o=i.getById(n.id);return o?(o.captured&&(e.console.warn("stopTrackingPointer() called on captured pointer"),u(t,o)),("mouse"===i.type||"pen"===i.type)&&i.contacts>0&&i.removeContact(),r=i.removeById(n.id)):r=i.getLength(),r}function Q(e,t){switch(t.eventType){case"pointermove":t.isStoppable=!0,t.isCancelable=!0,t.preventDefault=!1,t.preventGesture=!e.hasGestureHandlers,t.stopPropagation=!1;break;case"pointerover":case"pointerout":case"contextmenu":case"keydown":case"keyup":case"keypress":t.isStoppable=!0,t.isCancelable=!0,t.preventDefault=!1,t.preventGesture=!1,t.stopPropagation=!1;break;case"pointerdown":case"pointerup":t.isStoppable=!0,t.isCancelable=!0,t.preventDefault=!1,t.preventGesture=!e.hasGestureHandlers,t.stopPropagation=!1;break;case"wheel":t.isStoppable=!0,t.isCancelable=!0,t.preventDefault=!1,t.preventGesture=!e.hasScrollHandler,t.stopPropagation=!1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":t.isStoppable=!0,t.isCancelable=!1,t.preventDefault=!1,t.preventGesture=!1,t.stopPropagation=!1;break;case"click":t.isStoppable=!0,t.isCancelable=!0,t.preventDefault=!!e.clickHandler,t.preventGesture=!1,t.stopPropagation=!1;break;case"dblclick":t.isStoppable=!0,t.isCancelable=!0,t.preventDefault=!!e.dblClickHandler,t.preventGesture=!1,t.stopPropagation=!1;break;case"focus":case"blur":case"pointerenter":case"pointerleave":default:t.isStoppable=!1,t.isCancelable=!1,t.preventDefault=!1,t.preventGesture=!1,t.stopPropagation=!1}}function J(t,i){i.eventSource=t,i.eventPhase=i.originalEvent&&void 0!==i.originalEvent.eventPhase?i.originalEvent.eventPhase:0,i.defaultPrevented=e.eventIsCanceled(i.originalEvent),i.shouldCapture=!1,i.shouldReleaseCapture=!1,i.userData=t.userData,Q(t,i),t.preProcessEventHandler&&t.preProcessEventHandler(i)}function ee(t,i,n){var r=t.getActivePointersListByType(i.type),o=r.getById(i.id);o?n&&!o.captured?(o.captured=!0,r.captureCount++):!n&&o.captured&&(o.captured=!1,r.captureCount--,r.captureCount<0&&(r.captureCount=0,e.console.warn("updatePointerCaptured() - pointsList.captureCount went negative"))):e.console.warn("updatePointerCaptured() called on untracked pointer")}function te(e,t,i){var n,r=e.getActivePointersListByType(i.type);(n=r.getById(i.id))?(n.insideElement=!0,n.lastPos=n.currentPos,n.lastTime=n.currentTime,n.currentPos=i.currentPos,n.currentTime=i.currentTime,i=n):(i.captured=!1,i.insideElementPressed=!1,i.insideElement=!0,Y(r,i)),e.enterHandler&&e.enterHandler({eventSource:e,pointerType:i.type,position:v(i.currentPos,e.element),buttons:r.buttons,pointers:e.getActivePointerCount(),insideElementPressed:i.insideElementPressed,buttonDownAny:0!==r.buttons,isTouchEvent:"touch"===i.type,originalEvent:t.originalEvent,userData:e.userData})}function ie(e,t,i){var n,r,o=e.getActivePointersListByType(i.type);(n=o.getById(i.id))?(n.captured?(n.insideElement=!1,n.lastPos=n.currentPos,n.lastTime=n.currentTime,n.currentPos=i.currentPos,n.currentTime=i.currentTime):K(e,o,n),i=n):(i.captured=!1,i.insideElementPressed=!1),(e.leaveHandler||e.exitHandler)&&(r={eventSource:e,pointerType:i.type,position:i.currentPos&&v(i.currentPos,e.element),buttons:o.buttons,pointers:e.getActivePointerCount(),insideElementPressed:i.insideElementPressed,buttonDownAny:0!==o.buttons,isTouchEvent:"touch"===i.type,originalEvent:t.originalEvent,userData:e.userData},e.leaveHandler&&e.leaveHandler(r),e.exitHandler&&e.exitHandler(r))}function ne(e,t,i){var n,r;(r=(n=e.getActivePointersListByType(i.type)).getById(i.id))?i=r:(i.captured=!1,i.insideElementPressed=!1),e.overHandler&&e.overHandler({eventSource:e,pointerType:i.type,position:v(i.currentPos,e.element),buttons:n.buttons,pointers:e.getActivePointerCount(),insideElementPressed:i.insideElementPressed,buttonDownAny:0!==n.buttons,isTouchEvent:"touch"===i.type,originalEvent:t.originalEvent,userData:e.userData})}function re(e,t,i){var n,r;(r=(n=e.getActivePointersListByType(i.type)).getById(i.id))?i=r:(i.captured=!1,i.insideElementPressed=!1),e.outHandler&&e.outHandler({eventSource:e,pointerType:i.type,position:i.currentPos&&v(i.currentPos,e.element),buttons:n.buttons,pointers:e.getActivePointerCount(),insideElementPressed:i.insideElementPressed,buttonDownAny:0!==n.buttons,isTouchEvent:"touch"===i.type,originalEvent:t.originalEvent,userData:e.userData})}function oe(t,n,r,o){var s,a=i[t.hash],l=t.getActivePointersListByType(r.type);return void 0!==n.originalEvent.buttons?l.buttons=n.originalEvent.buttons:0===o?l.buttons|=1:1===o?l.buttons|=4:2===o?l.buttons|=2:3===o?l.buttons|=8:4===o?l.buttons|=16:5===o&&(l.buttons|=32),0!==o?(n.shouldCapture=!1,n.shouldReleaseCapture=!1,void(!t.nonPrimaryPressHandler||n.preventGesture||n.defaultPrevented||(n.preventDefault=!0,t.nonPrimaryPressHandler({eventSource:t,pointerType:r.type,position:v(r.currentPos,t.element),button:o,buttons:l.buttons,isTouchEvent:"touch"===r.type,originalEvent:n.originalEvent,userData:t.userData})))):(s=l.getById(r.id))?(s.insideElementPressed=!0,s.insideElement=!0,s.originalTarget=n.originalEvent.target,s.contactPos=r.currentPos,s.contactTime=r.currentTime,s.lastPos=s.currentPos,s.lastTime=s.currentTime,s.currentPos=r.currentPos,s.currentTime=r.currentTime,r=s,l.addContact(),void(n.preventGesture||n.defaultPrevented?(n.shouldCapture=!1,n.shouldReleaseCapture=!1):(n.shouldCapture=!0,n.shouldReleaseCapture=!1,n.preventDefault=!0,(t.dragHandler||t.dragEndHandler||t.pinchHandler)&&e.MouseTracker.gesturePointVelocityTracker.addPoint(t,r),1===l.contacts?t.pressHandler&&!n.preventGesture&&t.pressHandler({eventSource:t,pointerType:r.type,position:v(r.contactPos,t.element),buttons:l.buttons,isTouchEvent:"touch"===r.type,originalEvent:n.originalEvent,userData:t.userData}):2===l.contacts&&t.pinchHandler&&"touch"===r.type&&(a.pinchGPoints=l.asArray(),a.lastPinchDist=a.currentPinchDist=a.pinchGPoints[0].currentPos.distanceTo(a.pinchGPoints[1].currentPos),a.lastPinchCenter=a.currentPinchCenter=m(a.pinchGPoints[0].currentPos,a.pinchGPoints[1].currentPos))))):(e.console.warn("pointerdown event on untracked pointer"),r.captured=!1,r.insideElementPressed=!0,r.insideElement=!0,r.originalTarget=n.originalEvent.target,void Y(l,r))}function se(t,n,r,o){var s,a,l,c,u=i[t.hash],h=t.getActivePointersListByType(r.type),d=!1;if(void 0!==n.originalEvent.buttons?h.buttons=n.originalEvent.buttons:0===o?h.buttons^=-2:1===o?h.buttons^=-5:2===o?h.buttons^=-3:3===o?h.buttons^=-9:4===o?h.buttons^=-17:5===o&&(h.buttons^=-33),n.shouldCapture=!1,0!==o)return n.shouldReleaseCapture=!1,void(!t.nonPrimaryReleaseHandler||n.preventGesture||n.defaultPrevented||(n.preventDefault=!0,t.nonPrimaryReleaseHandler({eventSource:t,pointerType:r.type,position:v(r.currentPos,t.element),button:o,buttons:h.buttons,isTouchEvent:"touch"===r.type,originalEvent:n.originalEvent,userData:t.userData})));(l=h.getById(r.id))?(h.removeContact(),l.captured&&(d=!0),l.lastPos=l.currentPos,l.lastTime=l.currentTime,l.currentPos=r.currentPos,l.currentTime=r.currentTime,l.insideElement||K(t,h,l),s=l.currentPos,a=l.currentTime):(e.console.warn("updatePointerUp(): pointerup on untracked gPoint"),r.captured=!1,r.insideElementPressed=!1,r.insideElement=!0,Y(h,r),l=r),n.preventGesture||n.defaultPrevented||(d?(n.shouldReleaseCapture=!0,n.preventDefault=!0,(t.dragHandler||t.dragEndHandler||t.pinchHandler)&&e.MouseTracker.gesturePointVelocityTracker.removePoint(t,l),0===h.contacts?(t.releaseHandler&&t.releaseHandler({eventSource:t,pointerType:l.type,position:v(s,t.element),buttons:h.buttons,insideElementPressed:l.insideElementPressed,insideElementReleased:l.insideElement,isTouchEvent:"touch"===l.type,originalEvent:n.originalEvent,userData:t.userData}),t.dragEndHandler&&u.sentDragEvent&&t.dragEndHandler({eventSource:t,pointerType:l.type,position:v(l.currentPos,t.element),speed:l.speed,direction:l.direction,shift:n.originalEvent.shiftKey,isTouchEvent:"touch"===l.type,originalEvent:n.originalEvent,userData:t.userData}),u.sentDragEvent=!1,(t.clickHandler||t.dblClickHandler)&&l.insideElement&&(c=a-l.contactTime<=t.clickTimeThreshold&&l.contactPos.distanceTo(s)<=t.clickDistThreshold,t.clickHandler&&t.clickHandler({eventSource:t,pointerType:l.type,position:v(l.currentPos,t.element),quick:c,shift:n.originalEvent.shiftKey,isTouchEvent:"touch"===l.type,originalEvent:n.originalEvent,originalTarget:l.originalTarget,userData:t.userData}),t.dblClickHandler&&c&&(h.clicks++,1===h.clicks?(u.lastClickPos=s,u.dblClickTimeOut=setTimeout((function(){h.clicks=0}),t.dblClickTimeThreshold)):2===h.clicks&&(clearTimeout(u.dblClickTimeOut),h.clicks=0,u.lastClickPos.distanceTo(s)<=t.dblClickDistThreshold&&t.dblClickHandler({eventSource:t,pointerType:l.type,position:v(l.currentPos,t.element),shift:n.originalEvent.shiftKey,isTouchEvent:"touch"===l.type,originalEvent:n.originalEvent,userData:t.userData}),u.lastClickPos=null)))):2===h.contacts&&t.pinchHandler&&"touch"===l.type&&(u.pinchGPoints=h.asArray(),u.lastPinchDist=u.currentPinchDist=u.pinchGPoints[0].currentPos.distanceTo(u.pinchGPoints[1].currentPos),u.lastPinchCenter=u.currentPinchCenter=m(u.pinchGPoints[0].currentPos,u.pinchGPoints[1].currentPos))):(n.shouldReleaseCapture=!1,t.releaseHandler&&(t.releaseHandler({eventSource:t,pointerType:l.type,position:v(s,t.element),buttons:h.buttons,insideElementPressed:l.insideElementPressed,insideElementReleased:l.insideElement,isTouchEvent:"touch"===l.type,originalEvent:n.originalEvent,userData:t.userData}),n.preventDefault=!0)))}function ae(e,t,n){var r,o,s,a=i[e.hash],l=e.getActivePointersListByType(n.type);void 0!==t.originalEvent.buttons&&(l.buttons=t.originalEvent.buttons),(r=l.getById(n.id))&&(r.lastPos=r.currentPos,r.lastTime=r.currentTime,r.currentPos=n.currentPos,r.currentTime=n.currentTime,t.shouldCapture=!1,t.shouldReleaseCapture=!1,e.stopHandler&&"mouse"===n.type&&(clearTimeout(e.stopTimeOut),e.stopTimeOut=setTimeout((function(){ce(e,t.originalEvent,n.type)}),e.stopDelay)),0===l.contacts?e.moveHandler&&e.moveHandler({eventSource:e,pointerType:n.type,position:v(n.currentPos,e.element),buttons:l.buttons,isTouchEvent:"touch"===n.type,originalEvent:t.originalEvent,userData:e.userData}):1===l.contacts?(e.moveHandler&&(r=l.asArray()[0],e.moveHandler({eventSource:e,pointerType:r.type,position:v(r.currentPos,e.element),buttons:l.buttons,isTouchEvent:"touch"===r.type,originalEvent:t.originalEvent,userData:e.userData})),!e.dragHandler||t.preventGesture||t.defaultPrevented||(s=(r=l.asArray()[0]).currentPos.minus(r.lastPos),e.dragHandler({eventSource:e,pointerType:r.type,position:v(r.currentPos,e.element),buttons:l.buttons,delta:s,speed:r.speed,direction:r.direction,shift:t.originalEvent.shiftKey,isTouchEvent:"touch"===r.type,originalEvent:t.originalEvent,userData:e.userData}),t.preventDefault=!0,a.sentDragEvent=!0)):2===l.contacts&&(e.moveHandler&&(o=l.asArray(),e.moveHandler({eventSource:e,pointerType:o[0].type,position:v(m(o[0].currentPos,o[1].currentPos),e.element),buttons:l.buttons,isTouchEvent:"touch"===o[0].type,originalEvent:t.originalEvent,userData:e.userData})),!e.pinchHandler||"touch"!==n.type||t.preventGesture||t.defaultPrevented||(s=a.pinchGPoints[0].currentPos.distanceTo(a.pinchGPoints[1].currentPos))!==a.currentPinchDist&&(a.lastPinchDist=a.currentPinchDist,a.currentPinchDist=s,a.lastPinchCenter=a.currentPinchCenter,a.currentPinchCenter=m(a.pinchGPoints[0].currentPos,a.pinchGPoints[1].currentPos),e.pinchHandler({eventSource:e,pointerType:"touch",gesturePoints:a.pinchGPoints,lastCenter:v(a.lastPinchCenter,e.element),center:v(a.currentPinchCenter,e.element),lastDistance:a.lastPinchDist,distance:a.currentPinchDist,shift:t.originalEvent.shiftKey,originalEvent:t.originalEvent,userData:e.userData}),t.preventDefault=!0)))}function le(e,t,i){var n,r=e.getActivePointersListByType(i.type);(n=r.getById(i.id))&&K(e,r,n)}function ce(e,t,i){e.stopHandler&&e.stopHandler({eventSource:e,pointerType:i,position:g(t,e.element),buttons:e.getActivePointersListByType(i).buttons,isTouchEvent:"touch"===i,originalEvent:t,userData:e.userData})}e.MouseTracker.gesturePointVelocityTracker=function(){var t=[],i=0,n=0,r=function(e,t){return e.hash.toString()+t.type+t.id.toString()},o=function(){var i,r,o,s,a,l,c=t.length,u=e.now();for(s=u-n,n=u,i=0;i<c;i++)(o=(r=t[i]).gPoint).direction=Math.atan2(o.currentPos.y-r.lastPos.y,o.currentPos.x-r.lastPos.x),a=r.lastPos.distanceTo(o.currentPos),r.lastPos=o.currentPos,l=1e3*a/(s+1),o.speed=.75*l+.25*o.speed};return{addPoint:function(s,a){var l=r(s,a);t.push({guid:l,gPoint:a,lastPos:a.currentPos}),1===t.length&&(n=e.now(),i=window.setInterval(o,50))},removePoint:function(e,n){var o,s=r(e,n),a=t.length;for(o=0;o<a;o++)if(t[o].guid===s){t.splice(o,1),0===--a&&window.clearInterval(i);break}}}}(),e.MouseTracker.captureElement=document,e.MouseTracker.wheelEventName=e.Browser.vendor===e.BROWSERS.IE&&e.Browser.version>8||"onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",e.MouseTracker.subscribeEvents=["click","dblclick","keydown","keyup","keypress","focus","blur","contextmenu",e.MouseTracker.wheelEventName],"DOMMouseScroll"===e.MouseTracker.wheelEventName&&e.MouseTracker.subscribeEvents.push("MozMousePixelScroll"),window.PointerEvent?(e.MouseTracker.havePointerEvents=!0,e.MouseTracker.subscribeEvents.push("pointerenter","pointerleave","pointerover","pointerout","pointerdown","pointerup","pointermove","pointercancel"),e.MouseTracker.havePointerCapture=function(){var t=document.createElement("div");return e.isFunction(t.setPointerCapture)&&e.isFunction(t.releasePointerCapture)}(),e.MouseTracker.havePointerCapture&&e.MouseTracker.subscribeEvents.push("gotpointercapture","lostpointercapture")):(e.MouseTracker.havePointerEvents=!1,e.MouseTracker.subscribeEvents.push("mouseenter","mouseleave","mouseover","mouseout","mousedown","mouseup","mousemove"),e.MouseTracker.mousePointerId="legacy-mouse",e.MouseTracker.havePointerCapture=function(){var t=document.createElement("div");return e.isFunction(t.setCapture)&&e.isFunction(t.releaseCapture)}(),e.MouseTracker.havePointerCapture&&e.MouseTracker.subscribeEvents.push("losecapture"),"ontouchstart"in window&&e.MouseTracker.subscribeEvents.push("touchstart","touchend","touchmove","touchcancel"),"ongesturestart"in window&&e.MouseTracker.subscribeEvents.push("gesturestart","gesturechange")),e.MouseTracker.GesturePointList=function(e){this._gPoints=[],this.type=e,this.buttons=0,this.contacts=0,this.clicks=0,this.captureCount=0},e.MouseTracker.GesturePointList.prototype={getLength:function(){return this._gPoints.length},asArray:function(){return this._gPoints},add:function(e){return this._gPoints.push(e)},removeById:function(e){var t,i=this._gPoints.length;for(t=0;t<i;t++)if(this._gPoints[t].id===e){this._gPoints.splice(t,1);break}return this._gPoints.length},getByIndex:function(e){return e<this._gPoints.length?this._gPoints[e]:null},getById:function(e){var t,i=this._gPoints.length;for(t=0;t<i;t++)if(this._gPoints[t].id===e)return this._gPoints[t];return null},getPrimary:function(e){var t,i=this._gPoints.length;for(t=0;t<i;t++)if(this._gPoints[t].isPrimary)return this._gPoints[t];return null},addContact:function(){++this.contacts,this.contacts>1&&("mouse"===this.type||"pen"===this.type)&&(e.console.warn("GesturePointList.addContact() Implausible contacts value"),this.contacts=1)},removeContact:function(){--this.contacts,this.contacts<0&&(e.console.warn("GesturePointList.removeContact() Implausible contacts value"),this.contacts=0)}}}(s),function(e){e.ControlAnchor={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_RIGHT:3,BOTTOM_LEFT:4,ABSOLUTE:5},e.Control=function(t,i,n){var r=t.parentNode;"number"==typeof i&&(e.console.error("Passing an anchor directly into the OpenSeadragon.Control constructor is deprecated; please use an options object instead. Support for this deprecated variant is scheduled for removal in December 2013"),i={anchor:i}),i.attachToViewer=void 0===i.attachToViewer||i.attachToViewer,this.autoFade=void 0===i.autoFade||i.autoFade,this.element=t,this.anchor=i.anchor,this.container=n,this.anchor===e.ControlAnchor.ABSOLUTE?(this.wrapper=e.makeNeutralElement("div"),this.wrapper.style.position="absolute",this.wrapper.style.top="number"==typeof i.top?i.top+"px":i.top,this.wrapper.style.left="number"==typeof i.left?i.left+"px":i.left,this.wrapper.style.height="number"==typeof i.height?i.height+"px":i.height,this.wrapper.style.width="number"==typeof i.width?i.width+"px":i.width,this.wrapper.style.margin="0px",this.wrapper.style.padding="0px",this.element.style.position="relative",this.element.style.top="0px",this.element.style.left="0px",this.element.style.height="100%",this.element.style.width="100%"):(this.wrapper=e.makeNeutralElement("div"),this.wrapper.style.display="inline-block",this.anchor===e.ControlAnchor.NONE&&(this.wrapper.style.width=this.wrapper.style.height="100%")),this.wrapper.appendChild(this.element),i.attachToViewer?this.anchor===e.ControlAnchor.TOP_RIGHT||this.anchor===e.ControlAnchor.BOTTOM_RIGHT?this.container.insertBefore(this.wrapper,this.container.firstChild):this.container.appendChild(this.wrapper):r.appendChild(this.wrapper)},e.Control.prototype={destroy:function(){this.wrapper.removeChild(this.element),this.anchor!==e.ControlAnchor.NONE&&this.container.removeChild(this.wrapper)},isVisible:function(){return"none"!==this.wrapper.style.display},setVisible:function(t){this.wrapper.style.display=t?this.anchor===e.ControlAnchor.ABSOLUTE?"block":"inline-block":"none"},setOpacity:function(t){this.element[e.SIGNAL]&&e.Browser.vendor===e.BROWSERS.IE?e.setElementOpacity(this.element,t,!0):e.setElementOpacity(this.wrapper,t,!0)}}}(s),function(e){function t(e,t){var i,n=e.controls;for(i=n.length-1;i>=0;i--)if(n[i].element===t)return i;return-1}e.ControlDock=function(t){var i,n,r=["topleft","topright","bottomright","bottomleft"];for(e.extend(!0,this,{id:"controldock-"+e.now()+"-"+Math.floor(1e6*Math.random()),container:e.makeNeutralElement("div"),controls:[]},t),this.container.onsubmit=function(){return!1},this.element&&(this.element=e.getElement(this.element),this.element.appendChild(this.container),this.element.style.position="relative",this.container.style.width="100%",this.container.style.height="100%"),n=0;n<r.length;n++)i=r[n],this.controls[i]=e.makeNeutralElement("div"),this.controls[i].style.position="absolute",i.match("left")&&(this.controls[i].style.left="0px"),i.match("right")&&(this.controls[i].style.right="0px"),i.match("top")&&(this.controls[i].style.top="0px"),i.match("bottom")&&(this.controls[i].style.bottom="0px");this.container.appendChild(this.controls.topleft),this.container.appendChild(this.controls.topright),this.container.appendChild(this.controls.bottomright),this.container.appendChild(this.controls.bottomleft)},e.ControlDock.prototype={addControl:function(i,n){var r=null;if(!(t(this,i=e.getElement(i))>=0)){switch(n.anchor){case e.ControlAnchor.TOP_RIGHT:r=this.controls.topright,i.style.position="relative",i.style.paddingRight="0px",i.style.paddingTop="0px";break;case e.ControlAnchor.BOTTOM_RIGHT:r=this.controls.bottomright,i.style.position="relative",i.style.paddingRight="0px",i.style.paddingBottom="0px";break;case e.ControlAnchor.BOTTOM_LEFT:r=this.controls.bottomleft,i.style.position="relative",i.style.paddingLeft="0px",i.style.paddingBottom="0px";break;case e.ControlAnchor.TOP_LEFT:r=this.controls.topleft,i.style.position="relative",i.style.paddingLeft="0px",i.style.paddingTop="0px";break;case e.ControlAnchor.ABSOLUTE:r=this.container,i.style.margin="0px",i.style.padding="0px";break;default:case e.ControlAnchor.NONE:r=this.container,i.style.margin="0px",i.style.padding="0px"}this.controls.push(new e.Control(i,n,r)),i.style.display="inline-block"}},removeControl:function(i){var n=t(this,i=e.getElement(i));return n>=0&&(this.controls[n].destroy(),this.controls.splice(n,1)),this},clearControls:function(){for(;this.controls.length>0;)this.controls.pop().destroy();return this},areControlsEnabled:function(){var e;for(e=this.controls.length-1;e>=0;e--)if(this.controls[e].isVisible())return!0;return!1},setControlsEnabled:function(e){var t;for(t=this.controls.length-1;t>=0;t--)this.controls[t].setVisible(e);return this}}}(s),function(e){e.Placement=e.freezeObject({CENTER:0,TOP_LEFT:1,TOP:2,TOP_RIGHT:3,RIGHT:4,BOTTOM_RIGHT:5,BOTTOM:6,BOTTOM_LEFT:7,LEFT:8,properties:{0:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1},1:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},2:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},3:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!0,isVerticallyCentered:!1,isBottom:!1},4:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!0,isBottom:!1},5:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!1,isBottom:!0},6:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},7:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},8:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1}}})}(s),function(e){var t={},i=1;function n(t){return t=e.getElement(t),new e.Point(0===t.clientWidth?1:t.clientWidth,0===t.clientHeight?1:t.clientHeight)}function r(t,i,n,r,o){var s=t;if("string"===e.type(i))if(i.match(/^\s*<.*>\s*$/))i=e.parseXml(i);else if(i.match(/^\s*[{[].*[}\]]\s*$/))try{var a=e.parseJSON(i);i=a}catch(e){}function l(e,t){e.ready?r(e):(e.addHandler("ready",(function(){r(e)})),e.addHandler("open-failed",(function(e){o({message:e.message,source:t})})))}setTimeout((function(){if("string"===e.type(i))(i=new e.TileSource({url:i,crossOriginPolicy:void 0!==n.crossOriginPolicy?n.crossOriginPolicy:t.crossOriginPolicy,ajaxWithCredentials:t.ajaxWithCredentials,ajaxHeaders:n.ajaxHeaders?n.ajaxHeaders:t.ajaxHeaders,useCanvas:t.useCanvas,success:function(e){r(e.tileSource)}})).addHandler("open-failed",(function(e){o(e)}));else if(e.isPlainObject(i)||i.nodeType)if(void 0!==i.crossOriginPolicy||void 0===n.crossOriginPolicy&&void 0===t.crossOriginPolicy||(i.crossOriginPolicy=void 0!==n.crossOriginPolicy?n.crossOriginPolicy:t.crossOriginPolicy),void 0===i.ajaxWithCredentials&&(i.ajaxWithCredentials=t.ajaxWithCredentials),void 0===i.useCanvas&&(i.useCanvas=t.useCanvas),e.isFunction(i.getTileUrl)){var a=new e.TileSource(i);a.getTileUrl=i.getTileUrl,r(a)}else{var c=e.TileSource.determineType(s,i);if(!c)return void o({message:"Unable to load TileSource",source:i});var u=c.prototype.configure.apply(s,[i]);l(new c(u),i)}else l(i,i)}))}function o(t,i){if(i instanceof e.Overlay)return i;var n=null;if(i.element)n=e.getElement(i.element);else{var r=i.id?i.id:"openseadragon-overlay-"+Math.floor(1e7*Math.random());(n=e.getElement(i.id))||((n=document.createElement("a")).href="#/overlay/"+r),n.id=r,e.addClass(n,i.className?i.className:"openseadragon-overlay")}var o=i.location,s=i.width,a=i.height;if(!o){var l=i.x,c=i.y;if(void 0!==i.px){var u=t.viewport.imageToViewportRectangle(new e.Rect(i.px,i.py,s||0,a||0));l=u.x,c=u.y,s=void 0!==s?u.width:void 0,a=void 0!==a?u.height:void 0}o=new e.Point(l,c)}var h=i.placement;return h&&"string"===e.type(h)&&(h=e.Placement[i.placement.toUpperCase()]),new e.Overlay({element:n,location:o,placement:h,onDraw:i.onDraw,checkResize:i.checkResize,width:s,height:a,rotationMode:i.rotationMode})}function s(e,t){var i;for(i=e.length-1;i>=0;i--)if(e[i].element===t)return i;return-1}function a(t,i){return e.requestAnimationFrame((function(){i(t)}))}function l(t){e.requestAnimationFrame((function(){u(t)}))}function c(t){t.autoHideControls&&(t.controlsShouldFade=!0,t.controlsFadeBeginTime=e.now()+t.controlsFadeDelay,window.setTimeout((function(){l(t)}),t.controlsFadeDelay))}function u(t){var i,n;if(t.controlsShouldFade){for(i=1-(e.now()-t.controlsFadeBeginTime)/t.controlsFadeLength,i=Math.min(1,i),i=Math.max(0,i),n=t.controls.length-1;n>=0;n--)t.controls[n].autoFade&&t.controls[n].setOpacity(i);i>0&&l(t)}}function h(e){var t;for(e.controlsShouldFade=!1,t=e.controls.length-1;t>=0;t--)e.controls[t].setOpacity(1)}function d(){h(this)}function p(){c(this)}function f(e){var t={tracker:e.eventSource,position:e.position,originalEvent:e.originalEvent,preventDefault:e.preventDefault};this.raiseEvent("canvas-contextmenu",t),e.preventDefault=t.preventDefault}function g(t){var i={originalEvent:t.originalEvent,preventDefaultAction:!1,preventVerticalPan:t.preventVerticalPan,preventHorizontalPan:t.preventHorizontalPan};if(this.raiseEvent("canvas-key",i),i.preventDefaultAction||t.ctrl||t.alt||t.meta)t.preventDefault=!1;else switch(t.keyCode){case 38:i.preventVerticalPan||(t.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,-this.pixelsPerArrowPress))),this.viewport.applyConstraints()),t.preventDefault=!0;break;case 40:i.preventVerticalPan||(t.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,this.pixelsPerArrowPress))),this.viewport.applyConstraints()),t.preventDefault=!0;break;case 37:i.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(-this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),t.preventDefault=!0;break;case 39:i.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),t.preventDefault=!0;break;default:t.preventDefault=!1}}function v(t){var i={originalEvent:t.originalEvent,preventDefaultAction:!1,preventVerticalPan:t.preventVerticalPan,preventHorizontalPan:t.preventHorizontalPan};if(this.raiseEvent("canvas-key",i),i.preventDefaultAction||t.ctrl||t.alt||t.meta)t.preventDefault=!1;else switch(t.keyCode){case 43:case 61:this.viewport.zoomBy(1.1),this.viewport.applyConstraints(),t.preventDefault=!0;break;case 45:this.viewport.zoomBy(.9),this.viewport.applyConstraints(),t.preventDefault=!0;break;case 48:this.viewport.goHome(),this.viewport.applyConstraints(),t.preventDefault=!0;break;case 119:case 87:i.preventVerticalPan||(t.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,-40))),this.viewport.applyConstraints()),t.preventDefault=!0;break;case 115:case 83:i.preventVerticalPan||(t.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,40))),this.viewport.applyConstraints()),t.preventDefault=!0;break;case 97:i.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(-40,0))),this.viewport.applyConstraints()),t.preventDefault=!0;break;case 100:i.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(40,0))),this.viewport.applyConstraints()),t.preventDefault=!0;break;case 114:this.viewport.flipped?this.viewport.setRotation(e.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)):this.viewport.setRotation(e.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)),this.viewport.applyConstraints(),t.preventDefault=!0;break;case 82:this.viewport.flipped?this.viewport.setRotation(e.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)):this.viewport.setRotation(e.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)),this.viewport.applyConstraints(),t.preventDefault=!0;break;case 102:this.viewport.toggleFlip(),t.preventDefault=!0;break;case 106:this.goToPreviousPage();break;case 107:this.goToNextPage();break;default:t.preventDefault=!1}}function m(e){var t;document.activeElement===this.canvas||this.canvas.focus(),this.viewport.flipped&&(e.position.x=this.viewport.getContainerSize().x-e.position.x);var i={tracker:e.eventSource,position:e.position,quick:e.quick,shift:e.shift,originalEvent:e.originalEvent,originalTarget:e.originalTarget,preventDefaultAction:!1};this.raiseEvent("canvas-click",i),!i.preventDefaultAction&&this.viewport&&e.quick&&((t=this.gestureSettingsByDeviceType(e.pointerType)).clickToZoom&&(this.viewport.zoomBy(e.shift?1/this.zoomPerClick:this.zoomPerClick,t.zoomToRefPoint?this.viewport.pointFromPixel(e.position,!0):null),this.viewport.applyConstraints()))}function y(e){var t,i={tracker:e.eventSource,position:e.position,shift:e.shift,originalEvent:e.originalEvent,preventDefaultAction:!1};this.raiseEvent("canvas-double-click",i),!i.preventDefaultAction&&this.viewport&&((t=this.gestureSettingsByDeviceType(e.pointerType)).dblClickToZoom&&(this.viewport.zoomBy(e.shift?1/this.zoomPerClick:this.zoomPerClick,t.zoomToRefPoint?this.viewport.pointFromPixel(e.position,!0):null),this.viewport.applyConstraints()))}function w(e){var t,i={tracker:e.eventSource,pointerType:e.pointerType,position:e.position,delta:e.delta,speed:e.speed,direction:e.direction,shift:e.shift,originalEvent:e.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag",i),(t=this.gestureSettingsByDeviceType(e.pointerType)).dragToPan&&!i.preventDefaultAction&&this.viewport){if(this.panHorizontal||(e.delta.x=0),this.panVertical||(e.delta.y=0),this.viewport.flipped&&(e.delta.x=-e.delta.x),this.constrainDuringPan){var n=this.viewport.deltaPointsFromPixels(e.delta.negate());this.viewport.centerSpringX.target.value+=n.x,this.viewport.centerSpringY.target.value+=n.y;var r=this.viewport.getBounds(),o=this.viewport.getConstrainedBounds();this.viewport.centerSpringX.target.value-=n.x,this.viewport.centerSpringY.target.value-=n.y,r.x!==o.x&&(e.delta.x=0),r.y!==o.y&&(e.delta.y=0)}this.viewport.panBy(this.viewport.deltaPointsFromPixels(e.delta.negate()),t.flickEnabled&&!this.constrainDuringPan)}}function x(t){var i={tracker:t.eventSource,pointerType:t.pointerType,position:t.position,speed:t.speed,direction:t.direction,shift:t.shift,originalEvent:t.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag-end",i),!i.preventDefaultAction&&this.viewport){var n=this.gestureSettingsByDeviceType(t.pointerType);if(n.flickEnabled&&t.speed>=n.flickMinSpeed){var r=0;this.panHorizontal&&(r=n.flickMomentum*t.speed*Math.cos(t.direction));var o=0;this.panVertical&&(o=n.flickMomentum*t.speed*Math.sin(t.direction));var s=this.viewport.pixelFromPoint(this.viewport.getCenter(!0)),a=this.viewport.pointFromPixel(new e.Point(s.x-r,s.y-o));this.viewport.panTo(a,!1)}this.viewport.applyConstraints()}}function b(e){this.raiseEvent("canvas-enter",{tracker:e.eventSource,pointerType:e.pointerType,position:e.position,buttons:e.buttons,pointers:e.pointers,insideElementPressed:e.insideElementPressed,buttonDownAny:e.buttonDownAny,originalEvent:e.originalEvent})}function _(e){this.raiseEvent("canvas-exit",{tracker:e.eventSource,pointerType:e.pointerType,position:e.position,buttons:e.buttons,pointers:e.pointers,insideElementPressed:e.insideElementPressed,buttonDownAny:e.buttonDownAny,originalEvent:e.originalEvent})}function T(e){this.raiseEvent("canvas-press",{tracker:e.eventSource,pointerType:e.pointerType,position:e.position,insideElementPressed:e.insideElementPressed,insideElementReleased:e.insideElementReleased,originalEvent:e.originalEvent})}function S(e){this.raiseEvent("canvas-release",{tracker:e.eventSource,pointerType:e.pointerType,position:e.position,insideElementPressed:e.insideElementPressed,insideElementReleased:e.insideElementReleased,originalEvent:e.originalEvent})}function E(e){this.raiseEvent("canvas-nonprimary-press",{tracker:e.eventSource,position:e.position,pointerType:e.pointerType,button:e.button,buttons:e.buttons,originalEvent:e.originalEvent})}function P(e){this.raiseEvent("canvas-nonprimary-release",{tracker:e.eventSource,position:e.position,pointerType:e.pointerType,button:e.button,buttons:e.buttons,originalEvent:e.originalEvent})}function C(e){var t,i,n,r={tracker:e.eventSource,pointerType:e.pointerType,gesturePoints:e.gesturePoints,lastCenter:e.lastCenter,center:e.center,lastDistance:e.lastDistance,distance:e.distance,shift:e.shift,originalEvent:e.originalEvent,preventDefaultPanAction:!1,preventDefaultZoomAction:!1,preventDefaultRotateAction:!1};if(this.raiseEvent("canvas-pinch",r),this.viewport&&(!(t=this.gestureSettingsByDeviceType(e.pointerType)).pinchToZoom||r.preventDefaultPanAction&&r.preventDefaultZoomAction||(i=this.viewport.pointFromPixel(e.center,!0),r.preventDefaultZoomAction||this.viewport.zoomBy(e.distance/e.lastDistance,i,!0),t.zoomToRefPoint&&!r.preventDefaultPanAction&&(n=this.viewport.pointFromPixel(e.lastCenter,!0).minus(i),this.panHorizontal||(n.x=0),this.panVertical||(n.y=0),this.viewport.panBy(n,!0)),this.viewport.applyConstraints()),t.pinchRotate&&!r.preventDefaultRotateAction)){var o=Math.atan2(e.gesturePoints[0].currentPos.y-e.gesturePoints[1].currentPos.y,e.gesturePoints[0].currentPos.x-e.gesturePoints[1].currentPos.x),s=Math.atan2(e.gesturePoints[0].lastPos.y-e.gesturePoints[1].lastPos.y,e.gesturePoints[0].lastPos.x-e.gesturePoints[1].lastPos.x);this.viewport.setRotation(this.viewport.getRotation()+(o-s)*(180/Math.PI))}}function R(t){var i,n,r,o;(o=e.now())-this._lastScrollTime>this.minScrollDeltaTime?(this._lastScrollTime=o,i={tracker:t.eventSource,position:t.position,scroll:t.scroll,shift:t.shift,originalEvent:t.originalEvent,preventDefaultAction:!1,preventDefault:!0},this.raiseEvent("canvas-scroll",i),!i.preventDefaultAction&&this.viewport&&(this.viewport.flipped&&(t.position.x=this.viewport.getContainerSize().x-t.position.x),(n=this.gestureSettingsByDeviceType(t.pointerType)).scrollToZoom&&(r=Math.pow(this.zoomPerScroll,t.scroll),this.viewport.zoomBy(r,n.zoomToRefPoint?this.viewport.pointFromPixel(t.position,!0):null),this.viewport.applyConstraints())),t.preventDefault=i.preventDefault):t.preventDefault=!0}function k(e){t[this.hash].mouseInside=!0,h(this),this.raiseEvent("container-enter",{tracker:e.eventSource,pointerType:e.pointerType,position:e.position,buttons:e.buttons,pointers:e.pointers,insideElementPressed:e.insideElementPressed,buttonDownAny:e.buttonDownAny,originalEvent:e.originalEvent})}function O(e){e.pointers<1&&(t[this.hash].mouseInside=!1,t[this.hash].animating||c(this)),this.raiseEvent("container-exit",{tracker:e.eventSource,pointerType:e.pointerType,position:e.position,buttons:e.buttons,pointers:e.pointers,insideElementPressed:e.insideElementPressed,buttonDownAny:e.buttonDownAny,originalEvent:e.originalEvent})}function I(e){D(e),e.isOpen()?e._updateRequestId=a(e,I):e._updateRequestId=!1}function D(e){if(!e._opening&&t[e.hash]){if(e.autoResize){var i=n(e.container),r=t[e.hash].prevContainerSize;if(!i.equals(r)){var o=e.viewport;if(e.preserveImageSizeOnResize){var s=r.x/i.x,a=o.getZoom()*s,l=o.getCenter();o.resize(i,!1),o.zoomTo(a,null,!0),o.panTo(l,!0)}else{var u=o.getBounds();o.resize(i,!0),o.fitBoundsWithConstraints(u,!0)}t[e.hash].prevContainerSize=i,t[e.hash].forceRedraw=!0}}var d=e.viewport.update(),p=e.world.update()||d;d&&e.raiseEvent("viewport-change"),e.referenceStrip&&(p=e.referenceStrip.update(e.viewport)||p),!t[e.hash].animating&&p&&(e.raiseEvent("animation-start"),h(e)),(p||t[e.hash].forceRedraw||e.world.needsDraw())&&(A(e),e._drawOverlays(),e.navigator&&e.navigator.update(e.viewport),t[e.hash].forceRedraw=!1,p&&e.raiseEvent("animation")),t[e.hash].animating&&!p&&(e.raiseEvent("animation-finish"),t[e.hash].mouseInside||c(e)),t[e.hash].animating=p}}function A(e){e.imageLoader.clear(),e.drawer.clear(),e.world.draw(),e.raiseEvent("update-viewport",{})}function L(e,t){return e?e+t:t}function H(){t[this.hash].lastZoomTime=e.now(),t[this.hash].zoomFactor=this.zoomPerSecond,t[this.hash].zooming=!0,$(this)}function M(){t[this.hash].lastZoomTime=e.now(),t[this.hash].zoomFactor=1/this.zoomPerSecond,t[this.hash].zooming=!0,$(this)}function B(){t[this.hash].zooming=!1}function $(t){e.requestAnimationFrame(e.delegate(t,F))}function F(){var i,n,r;t[this.hash].zooming&&this.viewport&&(n=(i=e.now())-t[this.hash].lastZoomTime,r=Math.pow(t[this.hash].zoomFactor,n/1e3),this.viewport.zoomBy(r),this.viewport.applyConstraints(),t[this.hash].lastZoomTime=i,$(this))}function N(){this.viewport&&(t[this.hash].zooming=!1,this.viewport.zoomBy(this.zoomPerClick/1),this.viewport.applyConstraints())}function z(){this.viewport&&(t[this.hash].zooming=!1,this.viewport.zoomBy(1/this.zoomPerClick),this.viewport.applyConstraints())}function V(){this.buttonGroup&&(this.buttonGroup.emulateEnter(),this.buttonGroup.emulateLeave())}function j(){this.viewport&&this.viewport.goHome()}function U(){this.isFullPage()&&!e.isFullScreen()?this.setFullPage(!1):this.setFullScreen(!this.isFullPage()),this.buttonGroup&&this.buttonGroup.emulateLeave(),this.fullPageButton.element.focus(),this.viewport&&this.viewport.applyConstraints()}function W(){if(this.viewport){var t=this.viewport.getRotation();t=this.viewport.flipped?e.positiveModulo(t+this.rotationIncrement,360):e.positiveModulo(t-this.rotationIncrement,360),this.viewport.setRotation(t)}}function G(){if(this.viewport){var t=this.viewport.getRotation();t=this.viewport.flipped?e.positiveModulo(t-this.rotationIncrement,360):e.positiveModulo(t+this.rotationIncrement,360),this.viewport.setRotation(t)}}function q(){this.viewport.toggleFlip()}e.Viewer=function(r){var o,s=arguments,l=this;if(e.isPlainObject(r)||(r={id:s[0],xmlPath:s.length>1?s[1]:void 0,prefixUrl:s.length>2?s[2]:void 0,controls:s.length>3?s[3]:void 0,overlays:s.length>4?s[4]:void 0}),r.config&&(e.extend(!0,r,r.config),delete r.config),e.extend(!0,this,{id:r.id,hash:r.hash||i++,initialPage:0,element:null,container:null,canvas:null,overlays:[],overlaysContainer:null,previousBody:[],customControls:[],source:null,drawer:null,world:null,viewport:null,navigator:null,collectionViewport:null,collectionDrawer:null,navImages:null,buttons:null,profiler:null},e.DEFAULT_SETTINGS,r),void 0===this.hash)throw new Error("A hash must be defined, either by specifying options.id or options.hash.");for(void 0!==t[this.hash]&&e.console.warn("Hash "+this.hash+" has already been used."),t[this.hash]={fsBoundsDelta:new e.Point(1,1),prevContainerSize:null,animating:!1,forceRedraw:!1,mouseInside:!1,group:null,zooming:!1,zoomFactor:null,lastZoomTime:null,fullPage:!1,onfullscreenchange:null},this._sequenceIndex=0,this._firstOpen=!0,this._updateRequestId=null,this._loadQueue=[],this.currentOverlays=[],this._updatePixelDensityRatioBind=null,this._lastScrollTime=e.now(),e.EventSource.call(this),this.addHandler("open-failed",(function(t){var i=e.getString("Errors.OpenFailed",t.eventSource,t.message);l._showMessage(i)})),e.ControlDock.call(this,r),this.xmlPath&&(this.tileSources=[this.xmlPath]),this.element=this.element||document.getElementById(this.id),this.canvas=e.makeNeutralElement("div"),this.canvas.className="openseadragon-canvas",function(e){e.width="100%",e.height="100%",e.overflow="hidden",e.position="absolute",e.top="0px",e.left="0px"}(this.canvas.style),e.setElementTouchActionNone(this.canvas),""!==r.tabIndex&&(this.canvas.tabIndex=void 0===r.tabIndex?0:r.tabIndex),this.container.className="openseadragon-container",function(e){e.width="100%",e.height="100%",e.position="relative",e.overflow="hidden",e.left="0px",e.top="0px",e.textAlign="left"}(this.container.style),e.setElementTouchActionNone(this.container),this.container.insertBefore(this.canvas,this.container.firstChild),this.element.appendChild(this.container),this.bodyWidth=document.body.style.width,this.bodyHeight=document.body.style.height,this.bodyOverflow=document.body.style.overflow,this.docOverflow=document.documentElement.style.overflow,this.innerTracker=new e.MouseTracker({userData:"Viewer.innerTracker",element:this.canvas,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,contextMenuHandler:e.delegate(this,f),keyDownHandler:e.delegate(this,g),keyHandler:e.delegate(this,v),clickHandler:e.delegate(this,m),dblClickHandler:e.delegate(this,y),dragHandler:e.delegate(this,w),dragEndHandler:e.delegate(this,x),enterHandler:e.delegate(this,b),leaveHandler:e.delegate(this,_),pressHandler:e.delegate(this,T),releaseHandler:e.delegate(this,S),nonPrimaryPressHandler:e.delegate(this,E),nonPrimaryReleaseHandler:e.delegate(this,P),scrollHandler:e.delegate(this,R),pinchHandler:e.delegate(this,C)}),this.outerTracker=new e.MouseTracker({userData:"Viewer.outerTracker",element:this.container,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,enterHandler:e.delegate(this,k),leaveHandler:e.delegate(this,O)}),this.toolbar&&(this.toolbar=new e.ControlDock({element:this.toolbar})),this.bindStandardControls(),t[this.hash].prevContainerSize=n(this.container),this.world=new e.World({viewer:this}),this.world.addHandler("add-item",(function(e){l.source=l.world.getItemAt(0).source,t[l.hash].forceRedraw=!0,l._updateRequestId||(l._updateRequestId=a(l,I))})),this.world.addHandler("remove-item",(function(e){l.world.getItemCount()?l.source=l.world.getItemAt(0).source:l.source=null,t[l.hash].forceRedraw=!0})),this.world.addHandler("metrics-change",(function(e){l.viewport&&l.viewport._setContentBounds(l.world.getHomeBounds(),l.world.getContentFactor())})),this.world.addHandler("item-index-change",(function(e){l.source=l.world.getItemAt(0).source})),this.viewport=new e.Viewport({containerSize:t[this.hash].prevContainerSize,springStiffness:this.springStiffness,animationTime:this.animationTime,minZoomImageRatio:this.minZoomImageRatio,maxZoomPixelRatio:this.maxZoomPixelRatio,visibilityRatio:this.visibilityRatio,wrapHorizontal:this.wrapHorizontal,wrapVertical:this.wrapVertical,defaultZoomLevel:this.defaultZoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,viewer:this,degrees:this.degrees,flipped:this.flipped,navigatorRotate:this.navigatorRotate,homeFillsViewer:this.homeFillsViewer,margins:this.viewportMargins}),this.viewport._setContentBounds(this.world.getHomeBounds(),this.world.getContentFactor()),this.imageLoader=new e.ImageLoader({jobLimit:this.imageLoaderLimit,timeout:r.timeout}),this.tileCache=new e.TileCache({maxImageCacheCount:this.maxImageCacheCount}),this.drawer=new e.Drawer({viewer:this,viewport:this.viewport,element:this.canvas,debugGridColor:this.debugGridColor}),this.overlaysContainer=e.makeNeutralElement("div"),this.canvas.appendChild(this.overlaysContainer),this.drawer.canRotate()||(this.rotateLeft&&(o=this.buttonGroup.buttons.indexOf(this.rotateLeft),this.buttonGroup.buttons.splice(o,1),this.buttonGroup.element.removeChild(this.rotateLeft.element)),this.rotateRight&&(o=this.buttonGroup.buttons.indexOf(this.rotateRight),this.buttonGroup.buttons.splice(o,1),this.buttonGroup.element.removeChild(this.rotateRight.element))),this._addUpdatePixelDensityRatioEvent(),this.showNavigator&&(this.navigator=new e.Navigator({id:this.navigatorId,position:this.navigatorPosition,sizeRatio:this.navigatorSizeRatio,maintainSizeRatio:this.navigatorMaintainSizeRatio,top:this.navigatorTop,left:this.navigatorLeft,width:this.navigatorWidth,height:this.navigatorHeight,autoResize:this.navigatorAutoResize,autoFade:this.navigatorAutoFade,prefixUrl:this.prefixUrl,viewer:this,navigatorRotate:this.navigatorRotate,background:this.navigatorBackground,opacity:this.navigatorOpacity,borderColor:this.navigatorBorderColor,displayRegionColor:this.navigatorDisplayRegionColor,crossOriginPolicy:this.crossOriginPolicy})),this.sequenceMode&&this.bindSequenceControls(),this.tileSources&&this.open(this.tileSources),o=0;o<this.customControls.length;o++)this.addControl(this.customControls[o].id,{anchor:this.customControls[o].anchor});e.requestAnimationFrame((function(){c(l)})),void 0===this.imageSmoothingEnabled||this.imageSmoothingEnabled||this.drawer.setImageSmoothingEnabled(this.imageSmoothingEnabled),e._viewers.set(this.element,this)},e.extend(e.Viewer.prototype,e.EventSource.prototype,e.ControlDock.prototype,{isOpen:function(){return!!this.world.getItemCount()},openDzi:function(t){return e.console.error("[Viewer.openDzi] this function is deprecated; use Viewer.open() instead."),this.open(t)},openTileSource:function(t){return e.console.error("[Viewer.openTileSource] this function is deprecated; use Viewer.open() instead."),this.open(t)},open:function(t,i){var n=this;if(this.close(),!t)return this;if(this.sequenceMode&&e.isArray(t))return this.referenceStrip&&(this.referenceStrip.destroy(),this.referenceStrip=null),void 0===i||isNaN(i)||(this.initialPage=i),this.tileSources=t,this._sequenceIndex=Math.max(0,Math.min(this.tileSources.length-1,this.initialPage)),this.tileSources.length&&(this.open(this.tileSources[this._sequenceIndex]),this.showReferenceStrip&&this.addReferenceStrip()),this._updateSequenceButtons(this._sequenceIndex),this;if(e.isArray(t)||(t=[t]),!t.length)return this;this._opening=!0;for(var r,s=t.length,a=0,l=0,c=function(){if(a+l===s)if(a){!n._firstOpen&&n.preserveViewport||(n.viewport.goHome(!0),n.viewport.update()),n._firstOpen=!1;var e=t[0];if(e.tileSource&&(e=e.tileSource),n.overlays&&!n.preserveOverlays)for(var i=0;i<n.overlays.length;i++)n.currentOverlays[i]=o(n,n.overlays[i]);n._drawOverlays(),n._opening=!1,n.raiseEvent("open",{source:e})}else n._opening=!1,n.raiseEvent("open-failed",r)},u=function(t){e.isPlainObject(t)&&t.tileSource||(t={tileSource:t}),void 0!==t.index&&(e.console.error("[Viewer.open] setting indexes here is not supported; use addTiledImage instead"),delete t.index),void 0===t.collectionImmediately&&(t.collectionImmediately=!0);var i=t.success;t.success=function(e){if(a++,t.tileSource.overlays)for(var r=0;r<t.tileSource.overlays.length;r++)n.addOverlay(t.tileSource.overlays[r]);i&&i(e),c()};var o=t.error;t.error=function(e){l++,r||(r=e),o&&o(e),c()},n.addTiledImage(t)},h=0;h<t.length;h++)u(t[h]);return this},close:function(){return t[this.hash]?(this._opening=!1,this.navigator&&this.navigator.close(),this.preserveOverlays||(this.clearOverlays(),this.overlaysContainer.innerHTML=""),t[this.hash].animating=!1,this.world.removeAll(),this.imageLoader.clear(),this.raiseEvent("close"),this):this},destroy:function(){if(t[this.hash]){if(this._removeUpdatePixelDensityRatioEvent(),this.close(),this.clearOverlays(),this.overlaysContainer.innerHTML="",this.referenceStrip&&(this.referenceStrip.destroy(),this.referenceStrip=null),null!==this._updateRequestId&&(e.cancelAnimationFrame(this._updateRequestId),this._updateRequestId=null),this.drawer&&this.drawer.destroy(),this.navigator&&(this.navigator.destroy(),t[this.navigator.hash]=null,delete t[this.navigator.hash],this.navigator=null),this.removeAllHandlers(),this.buttonGroup)this.buttonGroup.destroy();else if(this.customButtons)for(;this.customButtons.length;)this.customButtons.pop().destroy();if(this.paging&&this.paging.destroy(),this.element)for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.container.onsubmit=null,this.clearControls(),this.innerTracker&&this.innerTracker.destroy(),this.outerTracker&&this.outerTracker.destroy(),t[this.hash]=null,delete t[this.hash],this.canvas=null,this.container=null,e._viewers.delete(this.element),this.element=null}},isMouseNavEnabled:function(){return this.innerTracker.isTracking()},setMouseNavEnabled:function(e){return this.innerTracker.setTracking(e),this.outerTracker.setTracking(e),this.raiseEvent("mouse-enabled",{enabled:e}),this},areControlsEnabled:function(){var e,t=this.controls.length;for(e=0;e<this.controls.length;e++)t=t&&this.controls[e].isVisible();return t},setControlsEnabled:function(e){return e?h(this):c(this),this.raiseEvent("controls-enabled",{enabled:e}),this},setDebugMode:function(e){for(var t=0;t<this.world.getItemCount();t++)this.world.getItemAt(t).debugMode=e;this.debugMode=e,this.forceRedraw()},isFullPage:function(){return t[this.hash].fullPage},setFullPage:function(i){var n,r,o=document.body,s=o.style,a=document.documentElement.style,l=this;if(i===this.isFullPage())return this;var c={fullPage:i,preventDefaultAction:!1};if(this.raiseEvent("pre-full-page",c),c.preventDefaultAction)return this;if(i){for(this.elementSize=e.getElementSize(this.element),this.pageScroll=e.getPageScroll(),this.elementMargin=this.element.style.margin,this.element.style.margin="0",this.elementPadding=this.element.style.padding,this.element.style.padding="0",this.bodyMargin=s.margin,this.docMargin=a.margin,s.margin="0",a.margin="0",this.bodyPadding=s.padding,this.docPadding=a.padding,s.padding="0",a.padding="0",this.bodyWidth=s.width,this.docWidth=a.width,s.width="100%",a.width="100%",this.bodyHeight=s.height,this.docHeight=a.height,s.height="100%",a.height="100%",this.bodyDisplay=s.display,s.display="block",this.previousBody=[],t[this.hash].prevElementParent=this.element.parentNode,t[this.hash].prevNextSibling=this.element.nextSibling,t[this.hash].prevElementWidth=this.element.style.width,t[this.hash].prevElementHeight=this.element.style.height,n=o.childNodes.length,r=0;r<n;r++)this.previousBody.push(o.childNodes[0]),o.removeChild(o.childNodes[0]);this.toolbar&&this.toolbar.element&&(this.toolbar.parentNode=this.toolbar.element.parentNode,this.toolbar.nextSibling=this.toolbar.element.nextSibling,o.appendChild(this.toolbar.element),e.addClass(this.toolbar.element,"fullpage")),e.addClass(this.element,"fullpage"),o.appendChild(this.element),this.element.style.height=e.getWindowSize().y+"px",this.element.style.width=e.getWindowSize().x+"px",this.toolbar&&this.toolbar.element&&(this.element.style.height=e.getElementSize(this.element).y-e.getElementSize(this.toolbar.element).y+"px"),t[this.hash].fullPage=!0,e.delegate(this,k)({})}else{for(this.element.style.margin=this.elementMargin,this.element.style.padding=this.elementPadding,s.margin=this.bodyMargin,a.margin=this.docMargin,s.padding=this.bodyPadding,a.padding=this.docPadding,s.width=this.bodyWidth,a.width=this.docWidth,s.height=this.bodyHeight,a.height=this.docHeight,s.display=this.bodyDisplay,o.removeChild(this.element),n=this.previousBody.length,r=0;r<n;r++)o.appendChild(this.previousBody.shift());e.removeClass(this.element,"fullpage"),t[this.hash].prevElementParent.insertBefore(this.element,t[this.hash].prevNextSibling),this.toolbar&&this.toolbar.element&&(o.removeChild(this.toolbar.element),e.removeClass(this.toolbar.element,"fullpage"),this.toolbar.parentNode.insertBefore(this.toolbar.element,this.toolbar.nextSibling),delete this.toolbar.parentNode,delete this.toolbar.nextSibling),this.element.style.width=t[this.hash].prevElementWidth,this.element.style.height=t[this.hash].prevElementHeight;var u=0,h=function(){e.setPageScroll(l.pageScroll);var t=e.getPageScroll();++u<10&&(t.x!==l.pageScroll.x||t.y!==l.pageScroll.y)&&e.requestAnimationFrame(h)};e.requestAnimationFrame(h),t[this.hash].fullPage=!1,e.delegate(this,O)({})}return this.navigator&&this.viewport&&this.navigator.update(this.viewport),this.raiseEvent("full-page",{fullPage:i}),this},setFullScreen:function(t){var i=this;if(!e.supportsFullScreen)return this.setFullPage(t);if(e.isFullScreen()===t)return this;var n={fullScreen:t,preventDefaultAction:!1};if(this.raiseEvent("pre-full-screen",n),n.preventDefaultAction)return this;if(t){if(this.setFullPage(!0),!this.isFullPage())return this;this.fullPageStyleWidth=this.element.style.width,this.fullPageStyleHeight=this.element.style.height,this.element.style.width="100%",this.element.style.height="100%";var r=function(){var t=e.isFullScreen();t||(e.removeEvent(document,e.fullScreenEventName,r),e.removeEvent(document,e.fullScreenErrorEventName,r),i.setFullPage(!1),i.isFullPage()&&(i.element.style.width=i.fullPageStyleWidth,i.element.style.height=i.fullPageStyleHeight)),i.navigator&&i.viewport&&setTimeout((function(){i.navigator.update(i.viewport)})),i.raiseEvent("full-screen",{fullScreen:t})};e.addEvent(document,e.fullScreenEventName,r),e.addEvent(document,e.fullScreenErrorEventName,r),e.requestFullScreen(document.body)}else e.exitFullScreen();return this},isVisible:function(){return"hidden"!==this.container.style.visibility},setVisible:function(e){return this.container.style.visibility=e?"":"hidden",this.raiseEvent("visible",{visible:e}),this},addTiledImage:function(t){e.console.assert(t,"[Viewer.addTiledImage] options is required"),e.console.assert(t.tileSource,"[Viewer.addTiledImage] options.tileSource is required"),e.console.assert(!t.replace||t.index>-1&&t.index<this.world.getItemCount(),"[Viewer.addTiledImage] if options.replace is used, options.index must be a valid index in Viewer.world");var i=this;t.replace&&(t.replaceItem=i.world.getItemAt(t.index)),this._hideMessage(),void 0===t.placeholderFillStyle&&(t.placeholderFillStyle=this.placeholderFillStyle),void 0===t.opacity&&(t.opacity=this.opacity),void 0===t.preload&&(t.preload=this.preload),void 0===t.compositeOperation&&(t.compositeOperation=this.compositeOperation),void 0===t.crossOriginPolicy&&(t.crossOriginPolicy=void 0!==t.tileSource.crossOriginPolicy?t.tileSource.crossOriginPolicy:this.crossOriginPolicy),void 0===t.ajaxWithCredentials&&(t.ajaxWithCredentials=this.ajaxWithCredentials),void 0===t.loadTilesWithAjax&&(t.loadTilesWithAjax=this.loadTilesWithAjax),void 0===t.ajaxHeaders||null===t.ajaxHeaders?t.ajaxHeaders=this.ajaxHeaders:e.isPlainObject(t.ajaxHeaders)&&e.isPlainObject(this.ajaxHeaders)&&(t.ajaxHeaders=e.extend({},this.ajaxHeaders,t.ajaxHeaders));var n={options:t};function o(e){for(var r=0;r<i._loadQueue.length;r++)if(i._loadQueue[r]===n){i._loadQueue.splice(r,1);break}0===i._loadQueue.length&&s(n),i.raiseEvent("add-item-failed",e),t.error&&t.error(e)}function s(e){i.collectionMode&&(i.world.arrange({immediately:e.options.collectionImmediately,rows:i.collectionRows,columns:i.collectionColumns,layout:i.collectionLayout,tileSize:i.collectionTileSize,tileMargin:i.collectionTileMargin}),i.world.setAutoRefigureSizes(!0))}function a(){for(var t,n,r;i._loadQueue.length&&(t=i._loadQueue[0]).tileSource;){if(i._loadQueue.splice(0,1),t.options.replace){var o=i.world.getIndexOfItem(t.options.replaceItem);-1!==o&&(t.options.index=o),i.world.removeItem(t.options.replaceItem)}n=new e.TiledImage({viewer:i,source:t.tileSource,viewport:i.viewport,drawer:i.drawer,tileCache:i.tileCache,imageLoader:i.imageLoader,x:t.options.x,y:t.options.y,width:t.options.width,height:t.options.height,fitBounds:t.options.fitBounds,fitBoundsPlacement:t.options.fitBoundsPlacement,clip:t.options.clip,placeholderFillStyle:t.options.placeholderFillStyle,opacity:t.options.opacity,preload:t.options.preload,degrees:t.options.degrees,flipped:t.options.flipped,compositeOperation:t.options.compositeOperation,springStiffness:i.springStiffness,animationTime:i.animationTime,minZoomImageRatio:i.minZoomImageRatio,wrapHorizontal:i.wrapHorizontal,wrapVertical:i.wrapVertical,immediateRender:i.immediateRender,blendTime:i.blendTime,alwaysBlend:i.alwaysBlend,minPixelRatio:i.minPixelRatio,smoothTileEdgesMinZoom:i.smoothTileEdgesMinZoom,iOSDevice:i.iOSDevice,crossOriginPolicy:t.options.crossOriginPolicy,ajaxWithCredentials:t.options.ajaxWithCredentials,loadTilesWithAjax:t.options.loadTilesWithAjax,ajaxHeaders:t.options.ajaxHeaders,debugMode:i.debugMode}),i.collectionMode&&i.world.setAutoRefigureSizes(!1),i.navigator&&(r=e.extend({},t.options,{replace:!1,originalTiledImage:n,tileSource:t.tileSource}),i.navigator.addTiledImage(r)),i.world.addItem(n,{index:t.options.index}),0===i._loadQueue.length&&s(t),1!==i.world.getItemCount()||i.preserveViewport||i.viewport.goHome(!0),t.options.success&&t.options.success({item:n})}}e.isArray(t.tileSource)?setTimeout((function(){o({message:"[Viewer.addTiledImage] Sequences can not be added; add them one at a time instead.",source:t.tileSource,options:t})})):(this._loadQueue.push(n),r(this,t.tileSource,t,(function(e){n.tileSource=e,a()}),(function(e){e.options=t,o(e),a()})))},addSimpleImage:function(t){e.console.assert(t,"[Viewer.addSimpleImage] options is required"),e.console.assert(t.url,"[Viewer.addSimpleImage] options.url is required");var i=e.extend({},t,{tileSource:{type:"image",url:t.url}});delete i.url,this.addTiledImage(i)},addLayer:function(t){var i=this;e.console.error("[Viewer.addLayer] this function is deprecated; use Viewer.addTiledImage() instead.");var n=e.extend({},t,{success:function(e){i.raiseEvent("add-layer",{options:t,drawer:e.item})},error:function(e){i.raiseEvent("add-layer-failed",e)}});return this.addTiledImage(n),this},getLayerAtLevel:function(t){return e.console.error("[Viewer.getLayerAtLevel] this function is deprecated; use World.getItemAt() instead."),this.world.getItemAt(t)},getLevelOfLayer:function(t){return e.console.error("[Viewer.getLevelOfLayer] this function is deprecated; use World.getIndexOfItem() instead."),this.world.getIndexOfItem(t)},getLayersCount:function(){return e.console.error("[Viewer.getLayersCount] this function is deprecated; use World.getItemCount() instead."),this.world.getItemCount()},setLayerLevel:function(t,i){return e.console.error("[Viewer.setLayerLevel] this function is deprecated; use World.setItemIndex() instead."),this.world.setItemIndex(t,i)},removeLayer:function(t){return e.console.error("[Viewer.removeLayer] this function is deprecated; use World.removeItem() instead."),this.world.removeItem(t)},forceRedraw:function(){return t[this.hash].forceRedraw=!0,this},bindSequenceControls:function(){var t=e.delegate(this,d),i=e.delegate(this,p),n=e.delegate(this,this.goToNextPage),r=e.delegate(this,this.goToPreviousPage),o=this.navImages,s=!0;return this.showSequenceControl&&((this.previousButton||this.nextButton)&&(s=!1),this.previousButton=new e.Button({element:this.previousButton?e.getElement(this.previousButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.PreviousPage"),srcRest:L(this.prefixUrl,o.previous.REST),srcGroup:L(this.prefixUrl,o.previous.GROUP),srcHover:L(this.prefixUrl,o.previous.HOVER),srcDown:L(this.prefixUrl,o.previous.DOWN),onRelease:r,onFocus:t,onBlur:i}),this.nextButton=new e.Button({element:this.nextButton?e.getElement(this.nextButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.NextPage"),srcRest:L(this.prefixUrl,o.next.REST),srcGroup:L(this.prefixUrl,o.next.GROUP),srcHover:L(this.prefixUrl,o.next.HOVER),srcDown:L(this.prefixUrl,o.next.DOWN),onRelease:n,onFocus:t,onBlur:i}),this.navPrevNextWrap||this.previousButton.disable(),this.tileSources&&this.tileSources.length||this.nextButton.disable(),s&&(this.paging=new e.ButtonGroup({buttons:[this.previousButton,this.nextButton],clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold}),this.pagingControl=this.paging.element,this.toolbar?this.toolbar.addControl(this.pagingControl,{anchor:e.ControlAnchor.BOTTOM_RIGHT}):this.addControl(this.pagingControl,{anchor:this.sequenceControlAnchor||e.ControlAnchor.TOP_LEFT}))),this},bindStandardControls:function(){var t=e.delegate(this,H),i=e.delegate(this,B),n=e.delegate(this,N),r=e.delegate(this,M),o=e.delegate(this,z),s=e.delegate(this,j),a=e.delegate(this,U),l=e.delegate(this,W),c=e.delegate(this,G),u=e.delegate(this,q),h=e.delegate(this,d),f=e.delegate(this,p),g=this.navImages,v=[],m=!0;return this.showNavigationControl&&((this.zoomInButton||this.zoomOutButton||this.homeButton||this.fullPageButton||this.rotateLeftButton||this.rotateRightButton||this.flipButton)&&(m=!1),this.showZoomControl&&(v.push(this.zoomInButton=new e.Button({element:this.zoomInButton?e.getElement(this.zoomInButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.ZoomIn"),srcRest:L(this.prefixUrl,g.zoomIn.REST),srcGroup:L(this.prefixUrl,g.zoomIn.GROUP),srcHover:L(this.prefixUrl,g.zoomIn.HOVER),srcDown:L(this.prefixUrl,g.zoomIn.DOWN),onPress:t,onRelease:i,onClick:n,onEnter:t,onExit:i,onFocus:h,onBlur:f})),v.push(this.zoomOutButton=new e.Button({element:this.zoomOutButton?e.getElement(this.zoomOutButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.ZoomOut"),srcRest:L(this.prefixUrl,g.zoomOut.REST),srcGroup:L(this.prefixUrl,g.zoomOut.GROUP),srcHover:L(this.prefixUrl,g.zoomOut.HOVER),srcDown:L(this.prefixUrl,g.zoomOut.DOWN),onPress:r,onRelease:i,onClick:o,onEnter:r,onExit:i,onFocus:h,onBlur:f}))),this.showHomeControl&&v.push(this.homeButton=new e.Button({element:this.homeButton?e.getElement(this.homeButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.Home"),srcRest:L(this.prefixUrl,g.home.REST),srcGroup:L(this.prefixUrl,g.home.GROUP),srcHover:L(this.prefixUrl,g.home.HOVER),srcDown:L(this.prefixUrl,g.home.DOWN),onRelease:s,onFocus:h,onBlur:f})),this.showFullPageControl&&v.push(this.fullPageButton=new e.Button({element:this.fullPageButton?e.getElement(this.fullPageButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.FullPage"),srcRest:L(this.prefixUrl,g.fullpage.REST),srcGroup:L(this.prefixUrl,g.fullpage.GROUP),srcHover:L(this.prefixUrl,g.fullpage.HOVER),srcDown:L(this.prefixUrl,g.fullpage.DOWN),onRelease:a,onFocus:h,onBlur:f})),this.showRotationControl&&(v.push(this.rotateLeftButton=new e.Button({element:this.rotateLeftButton?e.getElement(this.rotateLeftButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.RotateLeft"),srcRest:L(this.prefixUrl,g.rotateleft.REST),srcGroup:L(this.prefixUrl,g.rotateleft.GROUP),srcHover:L(this.prefixUrl,g.rotateleft.HOVER),srcDown:L(this.prefixUrl,g.rotateleft.DOWN),onRelease:l,onFocus:h,onBlur:f})),v.push(this.rotateRightButton=new e.Button({element:this.rotateRightButton?e.getElement(this.rotateRightButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.RotateRight"),srcRest:L(this.prefixUrl,g.rotateright.REST),srcGroup:L(this.prefixUrl,g.rotateright.GROUP),srcHover:L(this.prefixUrl,g.rotateright.HOVER),srcDown:L(this.prefixUrl,g.rotateright.DOWN),onRelease:c,onFocus:h,onBlur:f}))),this.showFlipControl&&v.push(this.flipButton=new e.Button({element:this.flipButton?e.getElement(this.flipButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:e.getString("Tooltips.Flip"),srcRest:L(this.prefixUrl,g.flip.REST),srcGroup:L(this.prefixUrl,g.flip.GROUP),srcHover:L(this.prefixUrl,g.flip.HOVER),srcDown:L(this.prefixUrl,g.flip.DOWN),onRelease:u,onFocus:h,onBlur:f})),m?(this.buttonGroup=new e.ButtonGroup({buttons:v,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold}),this.navControl=this.buttonGroup.element,this.addHandler("open",e.delegate(this,V)),this.toolbar?this.toolbar.addControl(this.navControl,{anchor:this.navigationControlAnchor||e.ControlAnchor.TOP_LEFT}):this.addControl(this.navControl,{anchor:this.navigationControlAnchor||e.ControlAnchor.TOP_LEFT})):this.customButtons=v),this},currentPage:function(){return this._sequenceIndex},goToPage:function(e){return this.tileSources&&e>=0&&e<this.tileSources.length&&(this._sequenceIndex=e,this._updateSequenceButtons(e),this.open(this.tileSources[e]),this.referenceStrip&&this.referenceStrip.setFocus(e),this.raiseEvent("page",{page:e})),this},addOverlay:function(t,i,n,r){var a;if(a=e.isPlainObject(t)?t:{element:t,location:i,placement:n,onDraw:r},t=e.getElement(a.element),s(this.currentOverlays,t)>=0)return this;var l=o(this,a);return this.currentOverlays.push(l),l.drawHTML(this.overlaysContainer,this.viewport),this.raiseEvent("add-overlay",{element:t,location:a.location,placement:a.placement}),this},updateOverlay:function(i,n,r){var o;return i=e.getElement(i),(o=s(this.currentOverlays,i))>=0&&(this.currentOverlays[o].update(n,r),t[this.hash].forceRedraw=!0,this.raiseEvent("update-overlay",{element:i,location:n,placement:r})),this},removeOverlay:function(i){var n;return i=e.getElement(i),(n=s(this.currentOverlays,i))>=0&&(this.currentOverlays[n].destroy(),this.currentOverlays.splice(n,1),t[this.hash].forceRedraw=!0,this.raiseEvent("remove-overlay",{element:i})),this},clearOverlays:function(){for(;this.currentOverlays.length>0;)this.currentOverlays.pop().destroy();return t[this.hash].forceRedraw=!0,this.raiseEvent("clear-overlay",{}),this},getOverlayById:function(t){var i;return t=e.getElement(t),(i=s(this.currentOverlays,t))>=0?this.currentOverlays[i]:null},_updateSequenceButtons:function(e){this.nextButton&&(this.tileSources&&this.tileSources.length-1!==e?this.nextButton.enable():this.navPrevNextWrap||this.nextButton.disable()),this.previousButton&&(e>0?this.previousButton.enable():this.navPrevNextWrap||this.previousButton.disable())},_showMessage:function(t){this._hideMessage();var i=e.makeNeutralElement("div");i.appendChild(document.createTextNode(t)),this.messageDiv=e.makeCenteredNode(i),e.addClass(this.messageDiv,"openseadragon-message"),this.container.appendChild(this.messageDiv)},_hideMessage:function(){var e=this.messageDiv;e&&(e.parentNode.removeChild(e),delete this.messageDiv)},gestureSettingsByDeviceType:function(e){switch(e){case"mouse":return this.gestureSettingsMouse;case"touch":return this.gestureSettingsTouch;case"pen":return this.gestureSettingsPen;default:return this.gestureSettingsUnknown}},_drawOverlays:function(){var e,t=this.currentOverlays.length;for(e=0;e<t;e++)this.currentOverlays[e].drawHTML(this.overlaysContainer,this.viewport)},_cancelPendingImages:function(){this._loadQueue=[]},removeReferenceStrip:function(){this.showReferenceStrip=!1,this.referenceStrip&&(this.referenceStrip.destroy(),this.referenceStrip=null)},addReferenceStrip:function(){if(this.showReferenceStrip=!0,this.sequenceMode){if(this.referenceStrip)return;this.tileSources.length&&this.tileSources.length>1&&(this.referenceStrip=new e.ReferenceStrip({id:this.referenceStripElement,position:this.referenceStripPosition,sizeRatio:this.referenceStripSizeRatio,scroll:this.referenceStripScroll,height:this.referenceStripHeight,width:this.referenceStripWidth,tileSources:this.tileSources,prefixUrl:this.prefixUrl,useCanvas:this.useCanvas,viewer:this}),this.referenceStrip.setFocus(this._sequenceIndex))}else e.console.warn('Attempting to display a reference strip while "sequenceMode" is off.')},_addUpdatePixelDensityRatioEvent:function(){this._updatePixelDensityRatioBind=this._updatePixelDensityRatio.bind(this),e.addEvent(window,"resize",this._updatePixelDensityRatioBind)},_removeUpdatePixelDensityRatioEvent:function(){e.removeEvent(window,"resize",this._updatePixelDensityRatioBind)},_updatePixelDensityRatio:function(){var t=e.pixelDensityRatio,i=e.getCurrentPixelDensityRatio();t!==i&&(e.pixelDensityRatio=i,this.world.resetItems(),this.forceRedraw())},goToPreviousPage:function(){var e=this._sequenceIndex-1;this.navPrevNextWrap&&e<0&&(e+=this.tileSources.length),this.goToPage(e)},goToNextPage:function(){var e=this._sequenceIndex+1;this.navPrevNextWrap&&e>=this.tileSources.length&&(e=0),this.goToPage(e)}})}(s),function(e){function t(e){var t={tracker:e.eventSource,position:e.position,quick:e.quick,shift:e.shift,originalEvent:e.originalEvent,preventDefaultAction:!1};if(this.viewer.raiseEvent("navigator-click",t),!t.preventDefaultAction&&e.quick&&this.viewer.viewport&&(this.panVertical||this.panHorizontal)){this.viewer.viewport.flipped&&(e.position.x=this.viewport.getContainerSize().x-e.position.x);var i=this.viewport.pointFromPixel(e.position);this.panVertical?this.panHorizontal||(i.x=this.viewer.viewport.getCenter(!0).x):i.y=this.viewer.viewport.getCenter(!0).y,this.viewer.viewport.panTo(i),this.viewer.viewport.applyConstraints()}}function i(e){var t={tracker:e.eventSource,position:e.position,delta:e.delta,speed:e.speed,direction:e.direction,shift:e.shift,originalEvent:e.originalEvent,preventDefaultAction:!1};this.viewer.raiseEvent("navigator-drag",t),!t.preventDefaultAction&&this.viewer.viewport&&(this.panHorizontal||(e.delta.x=0),this.panVertical||(e.delta.y=0),this.viewer.viewport.flipped&&(e.delta.x=-e.delta.x),this.viewer.viewport.panBy(this.viewport.deltaPointsFromPixels(e.delta)),this.viewer.constrainDuringPan&&this.viewer.viewport.applyConstraints())}function n(e){e.insideElementPressed&&this.viewer.viewport&&this.viewer.viewport.applyConstraints()}function r(e){var t={tracker:e.eventSource,position:e.position,scroll:e.scroll,shift:e.shift,originalEvent:e.originalEvent,preventDefault:e.preventDefault};this.viewer.raiseEvent("navigator-scroll",t),e.preventDefault=t.preventDefault}function o(e,t){s(e,"rotate("+t+"deg)")}function s(e,t){e.style.webkitTransform=t,e.style.mozTransform=t,e.style.msTransform=t,e.style.oTransform=t,e.style.transform=t}e.Navigator=function(s){var a,l,c=s.viewer,u=this;function h(e){o(u.displayRegionContainer,e),o(u.displayRegion,-e),u.viewport.setRotation(e)}(s.id?(this.element=document.getElementById(s.id),s.controlOptions={anchor:e.ControlAnchor.NONE,attachToViewer:!1,autoFade:!1}):(s.id="navigator-"+e.now(),this.element=e.makeNeutralElement("div"),s.controlOptions={anchor:e.ControlAnchor.TOP_RIGHT,attachToViewer:!0,autoFade:s.autoFade},s.position&&("BOTTOM_RIGHT"===s.position?s.controlOptions.anchor=e.ControlAnchor.BOTTOM_RIGHT:"BOTTOM_LEFT"===s.position?s.controlOptions.anchor=e.ControlAnchor.BOTTOM_LEFT:"TOP_RIGHT"===s.position?s.controlOptions.anchor=e.ControlAnchor.TOP_RIGHT:"TOP_LEFT"===s.position?s.controlOptions.anchor=e.ControlAnchor.TOP_LEFT:"ABSOLUTE"===s.position&&(s.controlOptions.anchor=e.ControlAnchor.ABSOLUTE,s.controlOptions.top=s.top,s.controlOptions.left=s.left,s.controlOptions.height=s.height,s.controlOptions.width=s.width))),this.element.id=s.id,this.element.className+=" navigator",(s=e.extend(!0,{sizeRatio:e.DEFAULT_SETTINGS.navigatorSizeRatio},s,{element:this.element,tabIndex:-1,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:0,autoResize:s.autoResize,minZoomImageRatio:1,background:s.background,opacity:s.opacity,borderColor:s.borderColor,displayRegionColor:s.displayRegionColor})).minPixelRatio=this.minPixelRatio=c.minPixelRatio,e.setElementTouchActionNone(this.element),this.borderWidth=2,this.fudge=new e.Point(1,1),this.totalBorderWidths=new e.Point(2*this.borderWidth,2*this.borderWidth).minus(this.fudge),s.controlOptions.anchor!==e.ControlAnchor.NONE&&function(e,t){e.margin="0px",e.border=t+"px solid "+s.borderColor,e.padding="0px",e.background=s.background,e.opacity=s.opacity,e.overflow="hidden"}(this.element.style,this.borderWidth),this.displayRegion=e.makeNeutralElement("div"),this.displayRegion.id=this.element.id+"-displayregion",this.displayRegion.className="displayregion",function(e,t){e.position="relative",e.top="0px",e.left="0px",e.fontSize="0px",e.overflow="hidden",e.border=t+"px solid "+s.displayRegionColor,e.margin="0px",e.padding="0px",e.background="transparent",e.float="left",e.cssFloat="left",e.styleFloat="left",e.zIndex=999999999,e.cursor="default"}(this.displayRegion.style,this.borderWidth),e.setElementPointerEventsNone(this.displayRegion),e.setElementTouchActionNone(this.displayRegion),this.displayRegionContainer=e.makeNeutralElement("div"),this.displayRegionContainer.id=this.element.id+"-displayregioncontainer",this.displayRegionContainer.className="displayregioncontainer",this.displayRegionContainer.style.width="100%",this.displayRegionContainer.style.height="100%",e.setElementPointerEventsNone(this.displayRegionContainer),e.setElementTouchActionNone(this.displayRegionContainer),c.addControl(this.element,s.controlOptions),this._resizeWithViewer=s.controlOptions.anchor!==e.ControlAnchor.ABSOLUTE&&s.controlOptions.anchor!==e.ControlAnchor.NONE,s.width&&s.height?(this.setWidth(s.width),this.setHeight(s.height)):this._resizeWithViewer&&(a=e.getElementSize(c.element),this.element.style.height=Math.round(a.y*s.sizeRatio)+"px",this.element.style.width=Math.round(a.x*s.sizeRatio)+"px",this.oldViewerSize=a,l=e.getElementSize(this.element),this.elementArea=l.x*l.y),this.oldContainerSize=new e.Point(0,0),e.Viewer.apply(this,[s]),this.displayRegionContainer.appendChild(this.displayRegion),this.element.getElementsByTagName("div")[0].appendChild(this.displayRegionContainer),s.navigatorRotate)&&(h(s.viewer.viewport?s.viewer.viewport.getRotation():s.viewer.degrees||0),s.viewer.addHandler("rotate",(function(e){h(e.degrees)})));this.innerTracker.destroy(),this.innerTracker=new e.MouseTracker({userData:"Navigator.innerTracker",element:this.element,dragHandler:e.delegate(this,i),clickHandler:e.delegate(this,t),releaseHandler:e.delegate(this,n),scrollHandler:e.delegate(this,r),preProcessEventHandler:function(e){"wheel"===e.eventType&&(e.preventDefault=!0)}}),this.outerTracker.userData="Navigator.outerTracker",e.setElementPointerEventsNone(this.canvas),e.setElementPointerEventsNone(this.container),this.addHandler("reset-size",(function(){u.viewport&&u.viewport.goHome(!0)})),c.world.addHandler("item-index-change",(function(e){window.setTimeout((function(){var t=u.world.getItemAt(e.previousIndex);u.world.setItemIndex(t,e.newIndex)}),1)})),c.world.addHandler("remove-item",(function(e){var t=e.item,i=u._getMatchingItem(t);i&&u.world.removeItem(i)})),this.update(c.viewport)},e.extend(e.Navigator.prototype,e.EventSource.prototype,e.Viewer.prototype,{updateSize:function(){if(this.viewport){var t=new e.Point(0===this.container.clientWidth?1:this.container.clientWidth,0===this.container.clientHeight?1:this.container.clientHeight);t.equals(this.oldContainerSize)||(this.viewport.resize(t,!0),this.viewport.goHome(!0),this.oldContainerSize=t,this.drawer.clear(),this.world.draw())}},setWidth:function(e){this.width=e,this.element.style.width="number"==typeof e?e+"px":e,this._resizeWithViewer=!1},setHeight:function(e){this.height=e,this.element.style.height="number"==typeof e?e+"px":e,this._resizeWithViewer=!1},setFlip:function(e){return this.viewport.setFlip(e),this.setDisplayTransform(this.viewer.viewport.getFlip()?"scale(-1,1)":"scale(1,1)"),this},setDisplayTransform:function(e){s(this.displayRegion,e),s(this.canvas,e),s(this.element,e)},update:function(t){var i,n,r,o,s,a;if(i=e.getElementSize(this.viewer.element),this._resizeWithViewer&&i.x&&i.y&&!i.equals(this.oldViewerSize)&&(this.oldViewerSize=i,this.maintainSizeRatio||!this.elementArea?(n=i.x*this.sizeRatio,r=i.y*this.sizeRatio):(n=Math.sqrt(this.elementArea*(i.x/i.y)),r=this.elementArea/n),this.element.style.width=Math.round(n)+"px",this.element.style.height=Math.round(r)+"px",this.elementArea||(this.elementArea=n*r),this.updateSize()),t&&this.viewport){o=t.getBoundsNoRotate(!0),s=this.viewport.pixelFromPointNoRotate(o.getTopLeft(),!1),a=this.viewport.pixelFromPointNoRotate(o.getBottomRight(),!1).minus(this.totalBorderWidths);var l=this.displayRegion.style;l.display=this.world.getItemCount()?"block":"none",l.top=Math.round(s.y)+"px",l.left=Math.round(s.x)+"px";var c=Math.abs(s.x-a.x),u=Math.abs(s.y-a.y);l.width=Math.round(Math.max(c,0))+"px",l.height=Math.round(Math.max(u,0))+"px"}},addTiledImage:function(t){var i=this,n=t.originalTiledImage;delete t.original;var r=e.extend({},t,{success:function(e){var t=e.item;function r(){i._matchBounds(t,n)}function o(){i._matchOpacity(t,n)}function s(){i._matchCompositeOperation(t,n)}t._originalForNavigator=n,i._matchBounds(t,n,!0),i._matchOpacity(t,n),i._matchCompositeOperation(t,n),n.addHandler("bounds-change",r),n.addHandler("clip-change",r),n.addHandler("opacity-change",o),n.addHandler("composite-operation-change",s)}});return e.Viewer.prototype.addTiledImage.apply(this,[r])},destroy:function(){return e.Viewer.prototype.destroy.apply(this)},_getMatchingItem:function(e){for(var t,i=this.world.getItemCount(),n=0;n<i;n++)if((t=this.world.getItemAt(n))._originalForNavigator===e)return t;return null},_matchBounds:function(e,t,i){var n=t.getBoundsNoRotate();e.setPosition(n.getTopLeft(),i),e.setWidth(n.width,i),e.setRotation(t.getRotation(),i),e.setClip(t.getClip()),e.setFlip(t.getFlip())},_matchOpacity:function(e,t){e.setOpacity(t.opacity)},_matchCompositeOperation:function(e,t){e.setCompositeOperation(t.compositeOperation)}})}(s),function(e){var t={Errors:{Dzc:"Sorry, we don't support Deep Zoom Collections!",Dzi:"Hmm, this doesn't appear to be a valid Deep Zoom Image.",Xml:"Hmm, this doesn't appear to be a valid Deep Zoom Image.",ImageFormat:"Sorry, we don't support {0}-based Deep Zoom Images.",Security:"It looks like a security restriction stopped us from loading this Deep Zoom Image.",Status:"This space unintentionally left blank ({0} {1}).",OpenFailed:"Unable to open {0}: {1}"},Tooltips:{FullPage:"Toggle full page",Home:"Go home",ZoomIn:"Zoom in",ZoomOut:"Zoom out",NextPage:"Next page",PreviousPage:"Previous page",RotateLeft:"Rotate left",RotateRight:"Rotate right",Flip:"Flip Horizontally"}};e.extend(e,{getString:function(i){var n,r=i.split("."),o=null,s=arguments,a=t;for(n=0;n<r.length-1;n++)a=a[r[n]]||{};return"string"!=typeof(o=a[r[n]])&&(e.console.log("Untranslated source string:",i),o=""),o.replace(/\{\d+\}/g,(function(e){var t=parseInt(e.match(/\d+/),10)+1;return t<s.length?s[t]:""}))},setString:function(e,i){var n,r=e.split("."),o=t;for(n=0;n<r.length-1;n++)o[r[n]]||(o[r[n]]={}),o=o[r[n]];o[r[n]]=i}})}(s),function(e){e.Point=function(e,t){this.x="number"==typeof e?e:0,this.y="number"==typeof t?t:0},e.Point.prototype={clone:function(){return new e.Point(this.x,this.y)},plus:function(t){return new e.Point(this.x+t.x,this.y+t.y)},minus:function(t){return new e.Point(this.x-t.x,this.y-t.y)},times:function(t){return new e.Point(this.x*t,this.y*t)},divide:function(t){return new e.Point(this.x/t,this.y/t)},negate:function(){return new e.Point(-this.x,-this.y)},distanceTo:function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))},squaredDistanceTo:function(e){return Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2)},apply:function(t){return new e.Point(t(this.x),t(this.y))},equals:function(t){return t instanceof e.Point&&this.x===t.x&&this.y===t.y},rotate:function(t,i){var n,r;if(i=i||new e.Point(0,0),t%90==0){switch(e.positiveModulo(t,360)){case 0:n=1,r=0;break;case 90:n=0,r=1;break;case 180:n=-1,r=0;break;case 270:n=0,r=-1}}else{var o=t*Math.PI/180;n=Math.cos(o),r=Math.sin(o)}var s=n*(this.x-i.x)-r*(this.y-i.y)+i.x,a=r*(this.x-i.x)+n*(this.y-i.y)+i.y;return new e.Point(s,a)},toString:function(){return"("+Math.round(100*this.x)/100+","+Math.round(100*this.y)/100+")"}}}(s),function(e){function t(t){var i,n,r=t.responseText,o=t.status;if(!t)throw new Error(e.getString("Errors.Security"));if(200!==t.status&&0!==t.status)throw i=404===(o=t.status)?"Not Found":t.statusText,new Error(e.getString("Errors.Status",o,i));if(r.match(/\s*<.*/))try{n=t.responseXML&&t.responseXML.documentElement?t.responseXML:e.parseXml(r)}catch(e){n=t.responseText}else if(r.match(/\s*[{[].*/))try{n=e.parseJSON(r)}catch(e){n=r}else n=r;return n}e.TileSource=function(t,i,n,r,o,s){var a,l,c=this,u=arguments;if(a=e.isPlainObject(t)?t:{width:u[0],height:u[1],tileSize:u[2],tileOverlap:u[3],minLevel:u[4],maxLevel:u[5]},e.EventSource.call(this),e.extend(!0,this,a),!this.success)for(l=0;l<arguments.length;l++)if(e.isFunction(arguments[l])){this.success=arguments[l];break}this.success&&this.addHandler("ready",(function(e){c.success(e)})),"string"===e.type(arguments[0])&&(this.url=arguments[0]),this.url?(this.aspectRatio=1,this.dimensions=new e.Point(10,10),this._tileWidth=0,this._tileHeight=0,this.tileOverlap=0,this.minLevel=0,this.maxLevel=0,this.ready=!1,this.getImageInfo(this.url)):(this.ready=!0,this.aspectRatio=a.width&&a.height?a.width/a.height:1,this.dimensions=new e.Point(a.width,a.height),this.tileSize?(this._tileWidth=this._tileHeight=this.tileSize,delete this.tileSize):(this.tileWidth?(this._tileWidth=this.tileWidth,delete this.tileWidth):this._tileWidth=0,this.tileHeight?(this._tileHeight=this.tileHeight,delete this.tileHeight):this._tileHeight=0),this.tileOverlap=a.tileOverlap?a.tileOverlap:0,this.minLevel=a.minLevel?a.minLevel:0,this.maxLevel=void 0!==a.maxLevel&&null!==a.maxLevel?a.maxLevel:a.width&&a.height?Math.ceil(Math.log(Math.max(a.width,a.height))/Math.log(2)):0,this.success&&e.isFunction(this.success)&&this.success(this))},e.TileSource.prototype={getTileSize:function(t){return e.console.error("[TileSource.getTileSize] is deprecated. Use TileSource.getTileWidth() and TileSource.getTileHeight() instead"),this._tileWidth},getTileWidth:function(e){return this._tileWidth?this._tileWidth:this.getTileSize(e)},getTileHeight:function(e){return this._tileHeight?this._tileHeight:this.getTileSize(e)},setMaxLevel:function(e){this.maxLevel=e,this._memoizeLevelScale()},getLevelScale:function(e){return this._memoizeLevelScale(),this.getLevelScale(e)},_memoizeLevelScale:function(){var e,t={};for(e=0;e<=this.maxLevel;e++)t[e]=1/Math.pow(2,this.maxLevel-e);this.getLevelScale=function(e){return t[e]}},getNumTiles:function(t){var i=this.getLevelScale(t),n=Math.ceil(i*this.dimensions.x/this.getTileWidth(t)),r=Math.ceil(i*this.dimensions.y/this.getTileHeight(t));return new e.Point(n,r)},getPixelRatio:function(t){var i=this.dimensions.times(this.getLevelScale(t)),n=1/i.x*e.pixelDensityRatio,r=1/i.y*e.pixelDensityRatio;return new e.Point(n,r)},getClosestLevel:function(){var e,t;for(e=this.minLevel+1;e<=this.maxLevel&&!((t=this.getNumTiles(e)).x>1||t.y>1);e++);return e-1},getTileAtPoint:function(t,i){var n=i.x>=0&&i.x<=1&&i.y>=0&&i.y<=1/this.aspectRatio;e.console.assert(n,"[TileSource.getTileAtPoint] must be called with a valid point.");var r=this.dimensions.x*this.getLevelScale(t),o=i.x*r,s=i.y*r,a=Math.floor(o/this.getTileWidth(t)),l=Math.floor(s/this.getTileHeight(t));i.x>=1&&(a=this.getNumTiles(t).x-1);var c=1e-15;return i.y>=1/this.aspectRatio-c&&(l=this.getNumTiles(t).y-1),new e.Point(a,l)},getTileBounds:function(t,i,n,r){var o=this.dimensions.times(this.getLevelScale(t)),s=this.getTileWidth(t),a=this.getTileHeight(t),l=0===i?0:s*i-this.tileOverlap,c=0===n?0:a*n-this.tileOverlap,u=s+(0===i?1:2)*this.tileOverlap,h=a+(0===n?1:2)*this.tileOverlap,d=1/o.x;return u=Math.min(u,o.x-l),h=Math.min(h,o.y-c),r?new e.Rect(0,0,u,h):new e.Rect(l*d,c*d,u*d,h*d)},getImageInfo:function(i){var n,r,o,s,a,l,c,u=this;i&&((c=(l=(a=i.split("/"))[a.length-1]).lastIndexOf("."))>-1&&(a[a.length-1]=l.slice(0,c))),r=function(t){"string"==typeof t&&(t=e.parseXml(t));var n=e.TileSource.determineType(u,t,i);n?(void 0===(s=n.prototype.configure.apply(u,[t,i])).ajaxWithCredentials&&(s.ajaxWithCredentials=u.ajaxWithCredentials),o=new n(s),u.ready=!0,u.raiseEvent("ready",{tileSource:o})):u.raiseEvent("open-failed",{message:"Unable to load TileSource",source:i})},i.match(/\.js$/)?(n=i.split("/").pop().replace(".js",""),e.jsonp({url:i,async:!1,callbackName:n,callback:r})):e.makeAjaxRequest({url:i,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,success:function(e){var i=t(e);r(i)},error:function(e,t){var n;try{n="HTTP "+e.status+" attempting to load TileSource"}catch(e){n=(void 0!==t&&t.toString?t.toString():"Unknown error")+" attempting to load TileSource"}u.raiseEvent("open-failed",{message:n,source:i})}})},supports:function(e,t){return!1},configure:function(e,t){throw new Error("Method not implemented.")},getTileUrl:function(e,t,i){throw new Error("Method not implemented.")},getTileAjaxHeaders:function(e,t,i){return{}},tileExists:function(e,t,i){var n=this.getNumTiles(e);return e>=this.minLevel&&e<=this.maxLevel&&t>=0&&i>=0&&t<n.x&&i<n.y}},e.extend(!0,e.TileSource.prototype,e.EventSource.prototype),e.TileSource.determineType=function(t,i,n){var r;for(r in s)if(r.match(/.+TileSource$/)&&e.isFunction(s[r])&&e.isFunction(s[r].prototype.supports)&&s[r].prototype.supports.call(t,i,n))return s[r];return e.console.error("No TileSource was able to open %s %s",n,i),null}}(s),function(e){function t(t,n){if(!n||!n.documentElement)throw new Error(e.getString("Errors.Xml"));var r,o,s,a,l,c=n.documentElement,u=c.localName||c.tagName,h=n.documentElement.namespaceURI,d=null,p=[];if("Image"===u)try{if(void 0===(a=c.getElementsByTagName("Size")[0])&&(a=c.getElementsByTagNameNS(h,"Size")[0]),d={Image:{xmlns:"http://schemas.microsoft.com/deepzoom/2008",Url:c.getAttribute("Url"),Format:c.getAttribute("Format"),DisplayRect:null,Overlap:parseInt(c.getAttribute("Overlap"),10),TileSize:parseInt(c.getAttribute("TileSize"),10),Size:{Height:parseInt(a.getAttribute("Height"),10),Width:parseInt(a.getAttribute("Width"),10)}}},!e.imageFormatSupported(d.Image.Format))throw new Error(e.getString("Errors.ImageFormat",d.Image.Format.toUpperCase()));for(void 0===(r=c.getElementsByTagName("DisplayRect"))&&(r=c.getElementsByTagNameNS(h,"DisplayRect")[0]),l=0;l<r.length;l++)void 0===(s=(o=r[l]).getElementsByTagName("Rect")[0])&&(s=o.getElementsByTagNameNS(h,"Rect")[0]),p.push({Rect:{X:parseInt(s.getAttribute("X"),10),Y:parseInt(s.getAttribute("Y"),10),Width:parseInt(s.getAttribute("Width"),10),Height:parseInt(s.getAttribute("Height"),10),MinLevel:parseInt(o.getAttribute("MinLevel"),10),MaxLevel:parseInt(o.getAttribute("MaxLevel"),10)}});return p.length&&(d.Image.DisplayRect=p),i(t,d)}catch(t){throw t instanceof Error?t:new Error(e.getString("Errors.Dzi"))}else{if("Collection"===u)throw new Error(e.getString("Errors.Dzc"));if("Error"===u){var f=c.getElementsByTagName("Message")[0].firstChild.nodeValue;throw new Error(f)}}throw new Error(e.getString("Errors.Dzi"))}function i(t,i){var n,r,o=i.Image,s=o.Url,a=o.Format,l=o.Size,c=o.DisplayRect||[],u=parseInt(l.Width,10),h=parseInt(l.Height,10),d=parseInt(o.TileSize,10),p=parseInt(o.Overlap,10),f=[];for(r=0;r<c.length;r++)n=c[r].Rect,f.push(new e.DisplayRect(parseInt(n.X,10),parseInt(n.Y,10),parseInt(n.Width,10),parseInt(n.Height,10),parseInt(n.MinLevel,10),parseInt(n.MaxLevel,10)));return e.extend(!0,{width:u,height:h,tileSize:d,tileOverlap:p,minLevel:null,maxLevel:null,tilesUrl:s,fileFormat:a,displayRects:f},i)}e.DziTileSource=function(t,i,n,r,o,s,a,l,c){var u,h,d,p;if(p=e.isPlainObject(t)?t:{width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4],fileFormat:arguments[5],displayRects:arguments[6],minLevel:arguments[7],maxLevel:arguments[8]},this._levelRects={},this.tilesUrl=p.tilesUrl,this.fileFormat=p.fileFormat,this.displayRects=p.displayRects,this.displayRects)for(u=this.displayRects.length-1;u>=0;u--)for(d=(h=this.displayRects[u]).minLevel;d<=h.maxLevel;d++)this._levelRects[d]||(this._levelRects[d]=[]),this._levelRects[d].push(h);e.TileSource.apply(this,[p])},e.extend(e.DziTileSource.prototype,e.TileSource.prototype,{supports:function(e,t){var i;return e.Image?i=e.Image.xmlns:e.documentElement&&("Image"!==e.documentElement.localName&&"Image"!==e.documentElement.tagName||(i=e.documentElement.namespaceURI)),-1!==(i=(i||"").toLowerCase()).indexOf("schemas.microsoft.com/deepzoom/2008")||-1!==i.indexOf("schemas.microsoft.com/deepzoom/2009")},configure:function(n,r){var o;return o=e.isPlainObject(n)?i(this,n):t(this,n),r&&!o.tilesUrl&&(o.tilesUrl=r.replace(/([^/]+?)(\.(dzi|xml|js)?(\?[^/]*)?)?\/?$/,"$1_files/"),-1!==r.search(/\.(dzi|xml|js)\?/)?o.queryParams=r.match(/\?.*/):o.queryParams=""),o},getTileUrl:function(e,t,i){return[this.tilesUrl,e,"/",t,"_",i,".",this.fileFormat,this.queryParams].join("")},tileExists:function(e,t,i){var n,r,o,s,a,l,c,u=this._levelRects[e];if(this.minLevel&&e<this.minLevel||this.maxLevel&&e>this.maxLevel)return!1;if(!u||!u.length)return!0;for(c=u.length-1;c>=0;c--)if(!(e<(n=u[c]).minLevel||e>n.maxLevel)&&(r=this.getLevelScale(e),o=n.x*r,s=n.y*r,a=o+n.width*r,l=s+n.height*r,o=Math.floor(o/this._tileWidth),s=Math.floor(s/this._tileWidth),a=Math.ceil(a/this._tileWidth),l=Math.ceil(l/this._tileWidth),o<=t&&t<a&&s<=i&&i<l))return!0;return!1}})}(s),function(e){function t(e){var t=["http://library.stanford.edu/iiif/image-api/compliance.html#level0","http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0","http://iiif.io/api/image/2/level0.json","level0","https://iiif.io/api/image/3/level0.json"],i=Array.isArray(e.profile)?e.profile[0]:e.profile,n=-1!==t.indexOf(i),r=!1;return 2===e.version&&e.profile.length>1&&e.profile[1].supports&&(r=-1!==e.profile[1].supports.indexOf("sizeByW")),3===e.version&&e.extraFeatures&&(r=-1!==e.extraFeatures.indexOf("sizeByWh")),!n||r}function i(e){for(var t=[],i=0;i<e.sizes.length;i++)t.push({url:e["@id"]+"/full/"+e.sizes[i].width+","+(3===e.version?e.sizes[i].height:"")+"/0/default."+e.tileFormat,width:e.sizes[i].width,height:e.sizes[i].height});return t.sort((function(e,t){return e.width-t.width}))}function n(t){if(!t||!t.documentElement)throw new Error(e.getString("Errors.Xml"));var i=t.documentElement,n=null;if("info"===i.tagName)try{return r(i,n={}),n}catch(t){throw t instanceof Error?t:new Error(e.getString("Errors.IIIF"))}throw new Error(e.getString("Errors.IIIF"))}function r(t,i,n){var o,s;if(3===t.nodeType&&n)(s=t.nodeValue.trim()).match(/^\d*$/)&&(s=Number(s)),i[n]?(e.isArray(i[n])||(i[n]=[i[n]]),i[n].push(s)):i[n]=s;else if(1===t.nodeType)for(o=0;o<t.childNodes.length;o++)r(t.childNodes[o],i,t.nodeName)}e.IIIFTileSource=function(n){if(e.extend(!0,this,n),!(this.height&&this.width&&this["@id"]))throw new Error("IIIF required parameters not provided.");if(n.tileSizePerScaleFactor={},this.tileFormat=this.tileFormat||"jpg",this.version=n.version,this.tile_width&&this.tile_height)n.tileWidth=this.tile_width,n.tileHeight=this.tile_height;else if(this.tile_width)n.tileSize=this.tile_width;else if(this.tile_height)n.tileSize=this.tile_height;else if(this.tiles)if(1===this.tiles.length)n.tileWidth=this.tiles[0].width,n.tileHeight=this.tiles[0].height||this.tiles[0].width,this.scale_factors=this.tiles[0].scaleFactors;else{this.scale_factors=[];for(var r=0;r<this.tiles.length;r++)for(var o=0;o<this.tiles[r].scaleFactors.length;o++){var s=this.tiles[r].scaleFactors[o];this.scale_factors.push(s),n.tileSizePerScaleFactor[s]={width:this.tiles[r].width,height:this.tiles[r].height||this.tiles[r].width}}}else if(t(n)){for(var a=Math.min(this.height,this.width),l=[256,512,1024],c=[],u=0;u<l.length;u++)l[u]<=a&&c.push(l[u]);c.length>0?n.tileSize=Math.max.apply(null,c):n.tileSize=a}else this.sizes&&this.sizes.length>0?(this.emulateLegacyImagePyramid=!0,n.levels=i(this),e.extend(!0,n,{width:n.levels[n.levels.length-1].width,height:n.levels[n.levels.length-1].height,tileSize:Math.max(n.height,n.width),tileOverlap:0,minLevel:0,maxLevel:n.levels.length-1}),this.levels=n.levels):e.console.error("Nothing in the info.json to construct image pyramids from");if(!n.maxLevel&&!this.emulateLegacyImagePyramid)if(this.scale_factors){var h=Math.max.apply(null,this.scale_factors);n.maxLevel=Math.round(Math.log(h)*Math.LOG2E)}else n.maxLevel=Number(Math.ceil(Math.log(Math.max(this.width,this.height),2)));e.TileSource.apply(this,[n])},e.extend(e.IIIFTileSource.prototype,e.TileSource.prototype,{supports:function(e,t){return!!(e.protocol&&"http://iiif.io/api/image"===e.protocol||e["@context"]&&("http://library.stanford.edu/iiif/image-api/1.1/context.json"===e["@context"]||"http://iiif.io/api/image/1/context.json"===e["@context"])||e.profile&&0===e.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html")||e.identifier&&e.width&&e.height||e.documentElement&&"info"===e.documentElement.tagName&&"http://library.stanford.edu/iiif/image-api/ns/"===e.documentElement.namespaceURI)},configure:function(t,i){if(e.isPlainObject(t)){if(t["@context"]){var r=t["@context"];if(Array.isArray(r))for(var o=0;o<r.length;o++)if("string"==typeof r[o]&&(/^http:\/\/iiif\.io\/api\/image\/[1-3]\/context\.json$/.test(r[o])||"http://library.stanford.edu/iiif/image-api/1.1/context.json"===r[o])){r=r[o];break}switch(r){case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":t.version=1;break;case"http://iiif.io/api/image/2/context.json":t.version=2;break;case"http://iiif.io/api/image/3/context.json":t.version=3;break;default:e.console.error("Data has a @context property which contains no known IIIF context URI.")}}else t["@context"]="http://iiif.io/api/image/1.0/context.json",t["@id"]=i.replace("/info.json",""),t.version=1;if(!t["@id"]&&t.id&&(t["@id"]=t.id),t.preferredFormats)for(var a=0;a<t.preferredFormats.length;a++)if(s.imageFormatSupported(t.preferredFormats[a])){t.tileFormat=t.preferredFormats[a];break}return t}var l=n(t);return l["@context"]="http://iiif.io/api/image/1.0/context.json",l["@id"]=i.replace("/info.xml",""),l.version=1,l},getTileWidth:function(t){if(this.emulateLegacyImagePyramid)return e.TileSource.prototype.getTileWidth.call(this,t);var i=Math.pow(2,this.maxLevel-t);return this.tileSizePerScaleFactor&&this.tileSizePerScaleFactor[i]?this.tileSizePerScaleFactor[i].width:this._tileWidth},getTileHeight:function(t){if(this.emulateLegacyImagePyramid)return e.TileSource.prototype.getTileHeight.call(this,t);var i=Math.pow(2,this.maxLevel-t);return this.tileSizePerScaleFactor&&this.tileSizePerScaleFactor[i]?this.tileSizePerScaleFactor[i].height:this._tileHeight},getLevelScale:function(t){if(this.emulateLegacyImagePyramid){var i=NaN;return this.levels.length>0&&t>=this.minLevel&&t<=this.maxLevel&&(i=this.levels[t].width/this.levels[this.maxLevel].width),i}return e.TileSource.prototype.getLevelScale.call(this,t)},getNumTiles:function(t){return this.emulateLegacyImagePyramid?this.getLevelScale(t)?new e.Point(1,1):new e.Point(0,0):e.TileSource.prototype.getNumTiles.call(this,t)},getTileAtPoint:function(t,i){return this.emulateLegacyImagePyramid?new e.Point(0,0):e.TileSource.prototype.getTileAtPoint.call(this,t,i)},getTileUrl:function(e,t,i){if(this.emulateLegacyImagePyramid){var n=null;return this.levels.length>0&&e>=this.minLevel&&e<=this.maxLevel&&(n=this.levels[e].url),n}var r,o,s,a,l,c,u,h,d,p,f,g,v,m="0",y=Math.pow(.5,this.maxLevel-e),w=Math.ceil(this.width*y),x=Math.ceil(this.height*y);return r=this.getTileWidth(e),o=this.getTileHeight(e),s=Math.ceil(r/y),a=Math.ceil(o/y),v=1===this.version?"native."+this.tileFormat:"default."+this.tileFormat,w<r&&x<o?(p=2===this.version&&w===this.width?"full":3===this.version&&w===this.width&&x===this.height?"max":3===this.version?w+","+x:w+",",l="full"):(c=t*s,u=i*a,h=Math.min(s,this.width-c),d=Math.min(a,this.height-u),l=0===t&&0===i&&h===this.width&&d===this.height?"full":[c,u,h,d].join(","),f=Math.ceil(h*y),g=Math.ceil(d*y),p=2===this.version&&f===this.width?"full":3===this.version&&f===this.width&&g===this.height?"max":3===this.version?f+","+g:f+","),[this["@id"],l,p,m,v].join("/")},__testonly__:{canBeTiled:t,constructLevels:i}})}(s),function(e){e.OsmTileSource=function(t,i,n,r,o){var s;(s=e.isPlainObject(t)?t:{width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4]}).width&&s.height||(s.width=65572864,s.height=65572864),s.tileSize||(s.tileSize=256,s.tileOverlap=0),s.tilesUrl||(s.tilesUrl="http://tile.openstreetmap.org/"),s.minLevel=8,e.TileSource.apply(this,[s])},e.extend(e.OsmTileSource.prototype,e.TileSource.prototype,{supports:function(e,t){return e.type&&"openstreetmaps"===e.type},configure:function(e,t){return e},getTileUrl:function(e,t,i){return this.tilesUrl+(e-8)+"/"+t+"/"+i+".png"}})}(s),function(e){e.TmsTileSource=function(t,i,n,r,o){var s;s=e.isPlainObject(t)?t:{width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4]};var a,l=256*Math.ceil(s.width/256),c=256*Math.ceil(s.height/256);a=l>c?l/256:c/256,s.maxLevel=Math.ceil(Math.log(a)/Math.log(2))-1,s.tileSize=256,s.width=l,s.height=c,e.TileSource.apply(this,[s])},e.extend(e.TmsTileSource.prototype,e.TileSource.prototype,{supports:function(e,t){return e.type&&"tiledmapservice"===e.type},configure:function(e,t){return e},getTileUrl:function(e,t,i){var n=this.getNumTiles(e).y-1;return this.tilesUrl+e+"/"+t+"/"+(n-i)+".png"}})}(s),function(e){e.ZoomifyTileSource=function(e){void 0===e.tileSize&&(e.tileSize=256),void 0===e.fileFormat&&(e.fileFormat="jpg",this.fileFormat=e.fileFormat);var t={x:e.width,y:e.height};for(e.imageSizes=[{x:e.width,y:e.height}],e.gridSize=[this._getGridSize(e.width,e.height,e.tileSize)];parseInt(t.x,10)>e.tileSize||parseInt(t.y,10)>e.tileSize;)t.x=Math.floor(t.x/2),t.y=Math.floor(t.y/2),e.imageSizes.push({x:t.x,y:t.y}),e.gridSize.push(this._getGridSize(t.x,t.y,e.tileSize));e.imageSizes.reverse(),e.gridSize.reverse(),e.minLevel=0,e.maxLevel=e.gridSize.length-1,s.TileSource.apply(this,[e])},e.extend(e.ZoomifyTileSource.prototype,e.TileSource.prototype,{_getGridSize:function(e,t,i){return{x:Math.ceil(e/i),y:Math.ceil(t/i)}},_calculateAbsoluteTileNumber:function(e,t,i){for(var n=0,r={},o=0;o<e;o++)n+=(r=this.gridSize[o]).x*r.y;return n+=(r=this.gridSize[e]).x*i+t},supports:function(e,t){return e.type&&"zoomifytileservice"===e.type},configure:function(e,t){return e},getTileUrl:function(e,t,i){var n=0,r=this._calculateAbsoluteTileNumber(e,t,i);return n=Math.floor(r/256),this.tilesUrl+"TileGroup"+n+"/"+e+"-"+t+"-"+i+"."+this.fileFormat}})}(s),function(e){function t(t){var i,n,r=[];for(n=0;n<t.length;n++)(i=t[n]).height&&i.width&&i.url?r.push({url:i.url,width:Number(i.width),height:Number(i.height)}):e.console.error("Unsupported image format: %s",i.url?i.url:"<no URL>");return r.sort((function(e,t){return e.height-t.height}))}function i(t,i){if(!i||!i.documentElement)throw new Error(e.getString("Errors.Xml"));var r,o,s=i.documentElement,a=s.tagName,l=null,c=[];if("image"===a)try{for(l={type:s.getAttribute("type"),levels:[]},c=s.getElementsByTagName("level"),o=0;o<c.length;o++)r=c[o],l.levels.push({url:r.getAttribute("url"),width:parseInt(r.getAttribute("width"),10),height:parseInt(r.getAttribute("height"),10)});return n(t,l)}catch(e){throw e instanceof Error?e:new Error("Unknown error parsing Legacy Image Pyramid XML.")}else{if("collection"===a)throw new Error("Legacy Image Pyramid Collections not yet supported.");if("error"===a)throw new Error("Error: "+i)}throw new Error("Unknown element "+a)}function n(e,t){return t.levels}e.LegacyTileSource=function(i){var n,r,o;e.isArray(i)&&(n={type:"legacy-image-pyramid",levels:i}),n.levels=t(n.levels),n.levels.length>0?(r=n.levels[n.levels.length-1].width,o=n.levels[n.levels.length-1].height):(r=0,o=0,e.console.error("No supported image formats found")),e.extend(!0,n,{width:r,height:o,tileSize:Math.max(o,r),tileOverlap:0,minLevel:0,maxLevel:n.levels.length>0?n.levels.length-1:0}),e.TileSource.apply(this,[n]),this.levels=n.levels},e.extend(e.LegacyTileSource.prototype,e.TileSource.prototype,{supports:function(e,t){return e.type&&"legacy-image-pyramid"===e.type||e.documentElement&&"legacy-image-pyramid"===e.documentElement.getAttribute("type")},configure:function(t,r){return e.isPlainObject(t)?n(this,t):i(this,t)},getLevelScale:function(e){var t=NaN;return this.levels.length>0&&e>=this.minLevel&&e<=this.maxLevel&&(t=this.levels[e].width/this.levels[this.maxLevel].width),t},getNumTiles:function(t){return this.getLevelScale(t)?new e.Point(1,1):new e.Point(0,0)},getTileUrl:function(e,t,i){var n=null;return this.levels.length>0&&e>=this.minLevel&&e<=this.maxLevel&&(n=this.levels[e].url),n}})}(s),function(e){e.ImageTileSource=function(t){t=e.extend({buildPyramid:!0,crossOriginPolicy:!1,ajaxWithCredentials:!1,useCanvas:!0},t),e.TileSource.apply(this,[t])},e.extend(e.ImageTileSource.prototype,e.TileSource.prototype,{supports:function(e,t){return e.type&&"image"===e.type},configure:function(e,t){return e},getImageInfo:function(t){var i=this._image=new Image,n=this;this.crossOriginPolicy&&(i.crossOrigin=this.crossOriginPolicy),this.ajaxWithCredentials&&(i.useCredentials=this.ajaxWithCredentials),e.addEvent(i,"load",(function(){n.width=i.naturalWidth,n.height=i.naturalHeight,n.aspectRatio=n.width/n.height,n.dimensions=new e.Point(n.width,n.height),n._tileWidth=n.width,n._tileHeight=n.height,n.tileOverlap=0,n.minLevel=0,n.levels=n._buildLevels(),n.maxLevel=n.levels.length-1,n.ready=!0,n.raiseEvent("ready",{tileSource:n})})),e.addEvent(i,"error",(function(){n.raiseEvent("open-failed",{message:"Error loading image at "+t,source:t})})),i.src=t},getLevelScale:function(e){var t=NaN;return e>=this.minLevel&&e<=this.maxLevel&&(t=this.levels[e].width/this.levels[this.maxLevel].width),t},getNumTiles:function(t){return this.getLevelScale(t)?new e.Point(1,1):new e.Point(0,0)},getTileUrl:function(e,t,i){var n=null;return e>=this.minLevel&&e<=this.maxLevel&&(n=this.levels[e].url),n},getContext2D:function(e,t,i){var n=null;return e>=this.minLevel&&e<=this.maxLevel&&(n=this.levels[e].context2D),n},destroy:function(){this._freeupCanvasMemory()},_buildLevels:function(){var t=[{url:this._image.src,width:this._image.naturalWidth,height:this._image.naturalHeight}];if(!this.buildPyramid||!e.supportsCanvas||!this.useCanvas)return delete this._image,t;var i=this._image.naturalWidth,n=this._image.naturalHeight,r=document.createElement("canvas"),o=r.getContext("2d");if(r.width=i,r.height=n,o.drawImage(this._image,0,0,i,n),t[0].context2D=o,delete this._image,e.isCanvasTainted(r))return t;for(;i>=2&&n>=2;){i=Math.floor(i/2),n=Math.floor(n/2);var s=document.createElement("canvas"),a=s.getContext("2d");s.width=i,s.height=n,a.drawImage(r,0,0,i,n),t.splice(0,0,{context2D:a,width:i,height:n}),r=s,o=a}return t},_freeupCanvasMemory:function(){for(var e=0;e<this.levels.length;e++)this.levels[e].context2D.canvas.height=0,this.levels[e].context2D.canvas.width=0}})}(s),function(e){e.TileSourceCollection=function(t,i,n,r){e.console.error("TileSourceCollection is deprecated; use World instead")}}(s),function(e){function t(t){e.requestAnimationFrame((function(){i(t)}))}function i(i){var n;i.shouldFade&&(n=1-(e.now()-i.fadeBeginTime)/i.fadeLength,n=Math.min(1,n),n=Math.max(0,n),i.imgGroup&&e.setElementOpacity(i.imgGroup,n,!0),n>0&&t(i))}function n(i){i.shouldFade=!0,i.fadeBeginTime=e.now()+i.fadeDelay,window.setTimeout((function(){t(i)}),i.fadeDelay)}function r(t){t.shouldFade=!1,t.imgGroup&&e.setElementOpacity(t.imgGroup,1,!0)}function o(t,i){t.element.disabled||(i>=e.ButtonState.GROUP&&t.currentState===e.ButtonState.REST&&(r(t),t.currentState=e.ButtonState.GROUP),i>=e.ButtonState.HOVER&&t.currentState===e.ButtonState.GROUP&&(t.imgHover&&(t.imgHover.style.visibility=""),t.currentState=e.ButtonState.HOVER),i>=e.ButtonState.DOWN&&t.currentState===e.ButtonState.HOVER&&(t.imgDown&&(t.imgDown.style.visibility=""),t.currentState=e.ButtonState.DOWN))}function s(t,i){t.element.disabled||(i<=e.ButtonState.HOVER&&t.currentState===e.ButtonState.DOWN&&(t.imgDown&&(t.imgDown.style.visibility="hidden"),t.currentState=e.ButtonState.HOVER),i<=e.ButtonState.GROUP&&t.currentState===e.ButtonState.HOVER&&(t.imgHover&&(t.imgHover.style.visibility="hidden"),t.currentState=e.ButtonState.GROUP),i<=e.ButtonState.REST&&t.currentState===e.ButtonState.GROUP&&(n(t),t.currentState=e.ButtonState.REST))}e.ButtonState={REST:0,GROUP:1,HOVER:2,DOWN:3},e.Button=function(t){var i=this;e.EventSource.call(this),e.extend(!0,this,{tooltip:null,srcRest:null,srcGroup:null,srcHover:null,srcDown:null,clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:e.DEFAULT_SETTINGS.clickDistThreshold,fadeDelay:0,fadeLength:2e3,onPress:null,onRelease:null,onClick:null,onEnter:null,onExit:null,onFocus:null,onBlur:null,userData:null},t),this.element=t.element||e.makeNeutralElement("div"),t.element||(this.imgRest=e.makeTransparentImage(this.srcRest),this.imgGroup=e.makeTransparentImage(this.srcGroup),this.imgHover=e.makeTransparentImage(this.srcHover),this.imgDown=e.makeTransparentImage(this.srcDown),this.imgRest.alt=this.imgGroup.alt=this.imgHover.alt=this.imgDown.alt=this.tooltip,e.setElementPointerEventsNone(this.imgRest),e.setElementPointerEventsNone(this.imgGroup),e.setElementPointerEventsNone(this.imgHover),e.setElementPointerEventsNone(this.imgDown),this.element.style.position="relative",e.setElementTouchActionNone(this.element),this.imgGroup.style.position=this.imgHover.style.position=this.imgDown.style.position="absolute",this.imgGroup.style.top=this.imgHover.style.top=this.imgDown.style.top="0px",this.imgGroup.style.left=this.imgHover.style.left=this.imgDown.style.left="0px",this.imgHover.style.visibility=this.imgDown.style.visibility="hidden",e.Browser.vendor===e.BROWSERS.FIREFOX&&e.Browser.version<3&&(this.imgGroup.style.top=this.imgHover.style.top=this.imgDown.style.top=""),this.element.appendChild(this.imgRest),this.element.appendChild(this.imgGroup),this.element.appendChild(this.imgHover),this.element.appendChild(this.imgDown)),this.addHandler("press",this.onPress),this.addHandler("release",this.onRelease),this.addHandler("click",this.onClick),this.addHandler("enter",this.onEnter),this.addHandler("exit",this.onExit),this.addHandler("focus",this.onFocus),this.addHandler("blur",this.onBlur),this.currentState=e.ButtonState.GROUP,this.fadeBeginTime=null,this.shouldFade=!1,this.element.style.display="inline-block",this.element.style.position="relative",this.element.title=this.tooltip,this.tracker=new e.MouseTracker({userData:"Button.tracker",element:this.element,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,enterHandler:function(t){t.insideElementPressed?(o(i,e.ButtonState.DOWN),i.raiseEvent("enter",{originalEvent:t.originalEvent})):t.buttonDownAny||o(i,e.ButtonState.HOVER)},focusHandler:function(e){i.tracker.enterHandler(e),i.raiseEvent("focus",{originalEvent:e.originalEvent})},leaveHandler:function(t){s(i,e.ButtonState.GROUP),t.insideElementPressed&&i.raiseEvent("exit",{originalEvent:t.originalEvent})},blurHandler:function(e){i.tracker.leaveHandler(e),i.raiseEvent("blur",{originalEvent:e.originalEvent})},pressHandler:function(t){o(i,e.ButtonState.DOWN),i.raiseEvent("press",{originalEvent:t.originalEvent})},releaseHandler:function(t){t.insideElementPressed&&t.insideElementReleased?(s(i,e.ButtonState.HOVER),i.raiseEvent("release",{originalEvent:t.originalEvent})):t.insideElementPressed?s(i,e.ButtonState.GROUP):o(i,e.ButtonState.HOVER)},clickHandler:function(e){e.quick&&i.raiseEvent("click",{originalEvent:e.originalEvent})},keyHandler:function(e){13===e.keyCode?(i.raiseEvent("click",{originalEvent:e.originalEvent}),i.raiseEvent("release",{originalEvent:e.originalEvent}),e.preventDefault=!0):e.preventDefault=!1}}),s(this,e.ButtonState.REST)},e.extend(e.Button.prototype,e.EventSource.prototype,{notifyGroupEnter:function(){o(this,e.ButtonState.GROUP)},notifyGroupExit:function(){s(this,e.ButtonState.REST)},disable:function(){this.notifyGroupExit(),this.element.disabled=!0,e.setElementOpacity(this.element,.2,!0)},enable:function(){this.element.disabled=!1,e.setElementOpacity(this.element,1,!0),this.notifyGroupEnter()},destroy:function(){this.imgRest&&(this.element.removeChild(this.imgRest),this.imgRest=null),this.imgGroup&&(this.element.removeChild(this.imgGroup),this.imgGroup=null),this.imgHover&&(this.element.removeChild(this.imgHover),this.imgHover=null),this.imgDown&&(this.element.removeChild(this.imgDown),this.imgDown=null),this.removeAllHandlers(),this.tracker.destroy(),this.element=null}})}(s),function(e){e.ButtonGroup=function(t){e.extend(!0,this,{buttons:[],clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:e.DEFAULT_SETTINGS.clickDistThreshold,labelText:""},t);var i,n=this.buttons.concat([]),r=this;if(this.element=t.element||e.makeNeutralElement("div"),!t.group)for(this.element.style.display="inline-block",i=0;i<n.length;i++)this.element.appendChild(n[i].element);e.setElementTouchActionNone(this.element),this.tracker=new e.MouseTracker({userData:"ButtonGroup.tracker",element:this.element,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,enterHandler:function(e){var t;for(t=0;t<r.buttons.length;t++)r.buttons[t].notifyGroupEnter()},leaveHandler:function(e){var t;if(!e.insideElementPressed)for(t=0;t<r.buttons.length;t++)r.buttons[t].notifyGroupExit()}})},e.ButtonGroup.prototype={emulateEnter:function(){this.tracker.enterHandler({eventSource:this.tracker})},emulateLeave:function(){this.tracker.leaveHandler({eventSource:this.tracker})},destroy:function(){for(;this.buttons.length;){var e=this.buttons.pop();this.element.removeChild(e.element),e.destroy()}this.tracker.destroy(),this.element=null}}}(s),function(e){e.Rect=function(t,i,n,r,o){var s,a;this.x="number"==typeof t?t:0,this.y="number"==typeof i?i:0,this.width="number"==typeof n?n:0,this.height="number"==typeof r?r:0,this.degrees="number"==typeof o?o:0,this.degrees=e.positiveModulo(this.degrees,360),this.degrees>=270?(s=this.getTopRight(),this.x=s.x,this.y=s.y,a=this.height,this.height=this.width,this.width=a,this.degrees-=270):this.degrees>=180?(s=this.getBottomRight(),this.x=s.x,this.y=s.y,this.degrees-=180):this.degrees>=90&&(s=this.getBottomLeft(),this.x=s.x,this.y=s.y,a=this.height,this.height=this.width,this.width=a,this.degrees-=90)},e.Rect.fromSummits=function(t,i,n){var r=t.distanceTo(i),o=t.distanceTo(n),s=i.minus(t),a=Math.atan(s.y/s.x);return s.x<0?a+=Math.PI:s.y<0&&(a+=2*Math.PI),new e.Rect(t.x,t.y,r,o,a/Math.PI*180)},e.Rect.prototype={clone:function(){return new e.Rect(this.x,this.y,this.width,this.height,this.degrees)},getAspectRatio:function(){return this.width/this.height},getTopLeft:function(){return new e.Point(this.x,this.y)},getBottomRight:function(){return new e.Point(this.x+this.width,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getTopRight:function(){return new e.Point(this.x+this.width,this.y).rotate(this.degrees,this.getTopLeft())},getBottomLeft:function(){return new e.Point(this.x,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getCenter:function(){return new e.Point(this.x+this.width/2,this.y+this.height/2).rotate(this.degrees,this.getTopLeft())},getSize:function(){return new e.Point(this.width,this.height)},equals:function(t){return t instanceof e.Rect&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height&&this.degrees===t.degrees},times:function(t){return new e.Rect(this.x*t,this.y*t,this.width*t,this.height*t,this.degrees)},translate:function(t){return new e.Rect(this.x+t.x,this.y+t.y,this.width,this.height,this.degrees)},union:function(t){var i=this.getBoundingBox(),n=t.getBoundingBox(),r=Math.min(i.x,n.x),o=Math.min(i.y,n.y),s=Math.max(i.x+i.width,n.x+n.width),a=Math.max(i.y+i.height,n.y+n.height);return new e.Rect(r,o,s-r,a-o)},intersection:function(t){var i=1e-10,n=[],r=this.getTopLeft();t.containsPoint(r,i)&&n.push(r);var o=this.getTopRight();t.containsPoint(o,i)&&n.push(o);var s=this.getBottomLeft();t.containsPoint(s,i)&&n.push(s);var a=this.getBottomRight();t.containsPoint(a,i)&&n.push(a);var l=t.getTopLeft();this.containsPoint(l,i)&&n.push(l);var c=t.getTopRight();this.containsPoint(c,i)&&n.push(c);var u=t.getBottomLeft();this.containsPoint(u,i)&&n.push(u);var h=t.getBottomRight();this.containsPoint(h,i)&&n.push(h);for(var d=this._getSegments(),p=t._getSegments(),f=0;f<d.length;f++)for(var g=d[f],v=0;v<p.length;v++){var m=p[v],y=w(g[0],g[1],m[0],m[1]);y&&n.push(y)}function w(t,n,r,o){var s=n.minus(t),a=o.minus(r),l=-a.x*s.y+s.x*a.y;if(0===l)return null;var c=(s.x*(t.y-r.y)-s.y*(t.x-r.x))/l,u=(a.x*(t.y-r.y)-a.y*(t.x-r.x))/l;return-i<=c&&c<=1-i&&-i<=u&&u<=1-i?new e.Point(t.x+u*s.x,t.y+u*s.y):null}if(0===n.length)return null;for(var x=n[0].x,b=n[0].x,_=n[0].y,T=n[0].y,S=1;S<n.length;S++){var E=n[S];E.x<x&&(x=E.x),E.x>b&&(b=E.x),E.y<_&&(_=E.y),E.y>T&&(T=E.y)}return new e.Rect(x,_,b-x,T-_)},_getSegments:function(){var e=this.getTopLeft(),t=this.getTopRight(),i=this.getBottomLeft(),n=this.getBottomRight();return[[e,t],[t,n],[n,i],[i,e]]},rotate:function(t,i){if(0===(t=e.positiveModulo(t,360)))return this.clone();i=i||this.getCenter();var n=this.getTopLeft().rotate(t,i),r=this.getTopRight().rotate(t,i).minus(n);r=r.apply((function(e){var t=1e-15;return Math.abs(e)<t?0:e}));var o=Math.atan(r.y/r.x);return r.x<0?o+=Math.PI:r.y<0&&(o+=2*Math.PI),new e.Rect(n.x,n.y,this.width,this.height,o/Math.PI*180)},getBoundingBox:function(){if(0===this.degrees)return this.clone();var t=this.getTopLeft(),i=this.getTopRight(),n=this.getBottomLeft(),r=this.getBottomRight(),o=Math.min(t.x,i.x,n.x,r.x),s=Math.max(t.x,i.x,n.x,r.x),a=Math.min(t.y,i.y,n.y,r.y),l=Math.max(t.y,i.y,n.y,r.y);return new e.Rect(o,a,s-o,l-a)},getIntegerBoundingBox:function(){var t=this.getBoundingBox(),i=Math.floor(t.x),n=Math.floor(t.y),r=Math.ceil(t.width+t.x-i),o=Math.ceil(t.height+t.y-n);return new e.Rect(i,n,r,o)},containsPoint:function(e,t){t=t||0;var i=this.getTopLeft(),n=this.getTopRight(),r=this.getBottomLeft(),o=n.minus(i),s=r.minus(i);return(e.x-i.x)*o.x+(e.y-i.y)*o.y>=-t&&(e.x-n.x)*o.x+(e.y-n.y)*o.y<=t&&(e.x-i.x)*s.x+(e.y-i.y)*s.y>=-t&&(e.x-r.x)*s.x+(e.y-r.y)*s.y<=t},toString:function(){return"["+Math.round(100*this.x)/100+", "+Math.round(100*this.y)/100+", "+Math.round(100*this.width)/100+"x"+Math.round(100*this.height)/100+", "+Math.round(100*this.degrees)/100+"deg]"}}}(s),function(e){var t={};function i(e){var t;e.quick&&(t="horizontal"===this.scroll?Math.floor(e.position.x/this.panelWidth):Math.floor(e.position.y/this.panelHeight),this.viewer.goToPage(t)),this.element.focus()}function n(t){if(this.dragging=!0,this.element){var i=Number(this.element.style.marginLeft.replace("px","")),n=Number(this.element.style.marginTop.replace("px","")),r=Number(this.element.style.width.replace("px","")),s=Number(this.element.style.height.replace("px","")),a=e.getElementSize(this.viewer.canvas);"horizontal"===this.scroll?-t.delta.x>0?i>-(r-a.x)&&(this.element.style.marginLeft=i+2*t.delta.x+"px",o(this,a.x,i+2*t.delta.x)):-t.delta.x<0&&i<0&&(this.element.style.marginLeft=i+2*t.delta.x+"px",o(this,a.x,i+2*t.delta.x)):-t.delta.y>0?n>-(s-a.y)&&(this.element.style.marginTop=n+2*t.delta.y+"px",o(this,a.y,n+2*t.delta.y)):-t.delta.y<0&&n<0&&(this.element.style.marginTop=n+2*t.delta.y+"px",o(this,a.y,n+2*t.delta.y))}}function r(t){if(this.element){var i=Number(this.element.style.marginLeft.replace("px","")),n=Number(this.element.style.marginTop.replace("px","")),r=Number(this.element.style.width.replace("px","")),s=Number(this.element.style.height.replace("px","")),a=e.getElementSize(this.viewer.canvas);"horizontal"===this.scroll?t.scroll>0?i>-(r-a.x)&&(this.element.style.marginLeft=i-60*t.scroll+"px",o(this,a.x,i-60*t.scroll)):t.scroll<0&&i<0&&(this.element.style.marginLeft=i-60*t.scroll+"px",o(this,a.x,i-60*t.scroll)):t.scroll<0?n>a.y-s&&(this.element.style.marginTop=n+60*t.scroll+"px",o(this,a.y,n+60*t.scroll)):t.scroll>0&&n<0&&(this.element.style.marginTop=n+60*t.scroll+"px",o(this,a.y,n+60*t.scroll)),t.preventDefault=!0}}function o(t,i,n){var r,o,s,a,l,c;for(r="horizontal"===t.scroll?t.panelWidth:t.panelHeight,o=Math.ceil(i/r)+5,l=o=(o=(s=Math.ceil((Math.abs(n)+i)/r)+1)-o)<0?0:o;l<s&&l<t.panels.length;l++)if(!(c=t.panels[l]).activePanel){var u,h=t.viewer.tileSources[l];u=h.referenceStripThumbnailUrl?{type:"image",url:h.referenceStripThumbnailUrl}:h,a=new e.Viewer({id:c.id,tileSources:[u],element:c,navigatorSizeRatio:t.sizeRatio,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:0,loadTilesWithAjax:t.viewer.loadTilesWithAjax,ajaxHeaders:t.viewer.ajaxHeaders,useCanvas:t.useCanvas}),e.setElementPointerEventsNone(a.canvas),e.setElementPointerEventsNone(a.container),a.innerTracker.setTracking(!1),a.outerTracker.setTracking(!1),t.miniViewers[c.id]=a,c.activePanel=!0}}function s(e){var t=e.eventSource.element;"horizontal"===this.scroll?t.style.marginBottom="0px":t.style.marginLeft="0px"}function a(t){var i=t.eventSource.element;"horizontal"===this.scroll?i.style.marginBottom="-"+e.getElementSize(i).y/2+"px":i.style.marginLeft="-"+e.getElementSize(i).x/2+"px"}function l(e){if(e.ctrl||e.alt||e.meta)e.preventDefault=!1;else switch(e.keyCode){case 38:r.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),e.preventDefault=!0;break;case 40:case 37:r.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),e.preventDefault=!0;break;case 39:r.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),e.preventDefault=!0;break;default:e.preventDefault=!1}}function c(e){if(e.ctrl||e.alt||e.meta)e.preventDefault=!1;else switch(e.keyCode){case 61:r.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),e.preventDefault=!0;break;case 45:r.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),e.preventDefault=!0;break;case 48:case 119:case 87:r.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),e.preventDefault=!0;break;case 115:case 83:case 97:r.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),e.preventDefault=!0;break;case 100:r.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),e.preventDefault=!0;break;default:e.preventDefault=!1}}e.ReferenceStrip=function(u){var h,d,p,f=this,g=u.viewer,v=e.getElementSize(g.element);for(u.id||(u.id="referencestrip-"+e.now(),this.element=e.makeNeutralElement("div"),this.element.id=u.id,this.element.className="referencestrip"),u=e.extend(!0,{sizeRatio:e.DEFAULT_SETTINGS.referenceStripSizeRatio,position:e.DEFAULT_SETTINGS.referenceStripPosition,scroll:e.DEFAULT_SETTINGS.referenceStripScroll,clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold},u,{element:this.element}),e.extend(this,u),t[this.id]={animating:!1},this.minPixelRatio=this.viewer.minPixelRatio,this.element.tabIndex=0,(d=this.element.style).marginTop="0px",d.marginRight="0px",d.marginBottom="0px",d.marginLeft="0px",d.left="0px",d.bottom="0px",d.border="0px",d.background="#000",d.position="relative",e.setElementTouchActionNone(this.element),e.setElementOpacity(this.element,.8),this.viewer=g,this.tracker=new e.MouseTracker({userData:"ReferenceStrip.tracker",element:this.element,clickHandler:e.delegate(this,i),dragHandler:e.delegate(this,n),scrollHandler:e.delegate(this,r),enterHandler:e.delegate(this,s),leaveHandler:e.delegate(this,a),keyDownHandler:e.delegate(this,l),keyHandler:e.delegate(this,c),preProcessEventHandler:function(e){"wheel"===e.eventType&&(e.preventDefault=!0)}}),u.width&&u.height?(this.element.style.width=u.width+"px",this.element.style.height=u.height+"px",g.addControl(this.element,{anchor:e.ControlAnchor.BOTTOM_LEFT})):"horizontal"===u.scroll?(this.element.style.width=v.x*u.sizeRatio*g.tileSources.length+12*g.tileSources.length+"px",this.element.style.height=v.y*u.sizeRatio+"px",g.addControl(this.element,{anchor:e.ControlAnchor.BOTTOM_LEFT})):(this.element.style.height=v.y*u.sizeRatio*g.tileSources.length+12*g.tileSources.length+"px",this.element.style.width=v.x*u.sizeRatio+"px",g.addControl(this.element,{anchor:e.ControlAnchor.TOP_LEFT})),this.panelWidth=v.x*this.sizeRatio+8,this.panelHeight=v.y*this.sizeRatio+8,this.panels=[],this.miniViewers={},p=0;p<g.tileSources.length;p++)(h=e.makeNeutralElement("div")).id=this.element.id+"-"+p,h.style.width=f.panelWidth+"px",h.style.height=f.panelHeight+"px",h.style.display="inline",h.style.float="left",h.style.cssFloat="left",h.style.styleFloat="left",h.style.padding="2px",e.setElementTouchActionNone(h),e.setElementPointerEventsNone(h),this.element.appendChild(h),h.activePanel=!1,this.panels.push(h);o(this,"vertical"===this.scroll?v.y:v.x,0),this.setFocus(0)},e.ReferenceStrip.prototype={setFocus:function(t){var i,n=this.element.querySelector("#"+this.element.id+"-"+t),r=e.getElementSize(this.viewer.canvas),a=Number(this.element.style.width.replace("px","")),l=Number(this.element.style.height.replace("px","")),c=-Number(this.element.style.marginLeft.replace("px","")),u=-Number(this.element.style.marginTop.replace("px",""));this.currentSelected!==n&&(this.currentSelected&&(this.currentSelected.style.background="#000"),this.currentSelected=n,this.currentSelected.style.background="#999","horizontal"===this.scroll?(i=Number(t)*(this.panelWidth+3))>c+r.x-this.panelWidth?(i=Math.min(i,a-r.x),this.element.style.marginLeft=-i+"px",o(this,r.x,-i)):i<c&&(i=Math.max(0,i-r.x/2),this.element.style.marginLeft=-i+"px",o(this,r.x,-i)):(i=Number(t)*(this.panelHeight+3))>u+r.y-this.panelHeight?(i=Math.min(i,l-r.y),this.element.style.marginTop=-i+"px",o(this,r.y,-i)):i<u&&(i=Math.max(0,i-r.y/2),this.element.style.marginTop=-i+"px",o(this,r.y,-i)),this.currentPage=t,s.call(this,{eventSource:this.tracker}))},update:function(){return!!t[this.id].animating&&(e.console.log("image reference strip update"),!0)},destroy:function(){if(this.miniViewers)for(var e in this.miniViewers)this.miniViewers[e].destroy();this.tracker.destroy(),this.element&&this.viewer.removeControl(this.element)}}}(s),function(e){e.DisplayRect=function(t,i,n,r,o,s){e.Rect.apply(this,[t,i,n,r]),this.minLevel=o,this.maxLevel=s},e.extend(e.DisplayRect.prototype,e.Rect.prototype)}(s),function(e){function t(e,t){return(1-Math.exp(e*-t))/(1-Math.exp(-e))}e.Spring=function(t){var i=arguments;"object"!=typeof t&&(t={initial:i.length&&"number"==typeof i[0]?i[0]:void 0,springStiffness:i.length>1?i[1].springStiffness:5,animationTime:i.length>1?i[1].animationTime:1.5}),e.console.assert("number"==typeof t.springStiffness&&0!==t.springStiffness,"[OpenSeadragon.Spring] options.springStiffness must be a non-zero number"),e.console.assert("number"==typeof t.animationTime&&t.animationTime>=0,"[OpenSeadragon.Spring] options.animationTime must be a number greater than or equal to 0"),t.exponential&&(this._exponential=!0,delete t.exponential),e.extend(!0,this,t),this.current={value:"number"==typeof this.initial?this.initial:this._exponential?0:1,time:e.now()},e.console.assert(!this._exponential||0!==this.current.value,"[OpenSeadragon.Spring] value must be non-zero for exponential springs"),this.start={value:this.current.value,time:this.current.time},this.target={value:this.current.value,time:this.current.time},this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},e.Spring.prototype={resetTo:function(t){e.console.assert(!this._exponential||0!==t,"[OpenSeadragon.Spring.resetTo] target must be non-zero for exponential springs"),this.start.value=this.target.value=this.current.value=t,this.start.time=this.target.time=this.current.time=e.now(),this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},springTo:function(t){e.console.assert(!this._exponential||0!==t,"[OpenSeadragon.Spring.springTo] target must be non-zero for exponential springs"),this.start.value=this.current.value,this.start.time=this.current.time,this.target.value=t,this.target.time=this.start.time+1e3*this.animationTime,this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},shiftBy:function(t){this.start.value+=t,this.target.value+=t,this._exponential&&(e.console.assert(0!==this.target.value&&0!==this.start.value,"[OpenSeadragon.Spring.shiftBy] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},setExponential:function(t){this._exponential=t,this._exponential&&(e.console.assert(0!==this.current.value&&0!==this.target.value&&0!==this.start.value,"[OpenSeadragon.Spring.setExponential] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},update:function(){var i,n;this.current.time=e.now(),this._exponential?(i=this.start._logValue,n=this.target._logValue):(i=this.start.value,n=this.target.value);var r=this.current.time>=this.target.time?n:i+(n-i)*t(this.springStiffness,(this.current.time-this.start.time)/(this.target.time-this.start.time)),o=this.current.value;return this._exponential?this.current.value=Math.exp(r):this.current.value=r,o!==this.current.value},isAtTargetValue:function(){return this.current.value===this.target.value}}}(s),function(e){function t(t){e.extend(!0,this,{timeout:e.DEFAULT_SETTINGS.timeout,jobId:null},t),this.image=null}function i(e,t,i){e.jobsInProgress--,(!e.jobLimit||e.jobsInProgress<e.jobLimit)&&e.jobQueue.length>0&&(e.jobQueue.shift().start(),e.jobsInProgress++),i(t.image,t.errorMsg,t.request)}t.prototype={errorMsg:null,start:function(){var t=this,i=this.abort;this.image=new Image,this.image.onload=function(){t.finish(!0)},this.image.onabort=this.image.onerror=function(){t.errorMsg="Image load aborted",t.finish(!1)},this.jobId=window.setTimeout((function(){t.errorMsg="Image load exceeded timeout ("+t.timeout+" ms)",t.finish(!1)}),this.timeout),this.loadWithAjax?(this.request=e.makeAjaxRequest({url:this.src,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,responseType:"arraybuffer",success:function(e){var i;try{i=new window.Blob([e.response])}catch(t){var n=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if("TypeError"===t.name&&n){var r=new n;r.append(e.response),i=r.getBlob()}}0===i.size&&(t.errorMsg="Empty image response.",t.finish(!1));var o=(window.URL||window.webkitURL).createObjectURL(i);t.image.src=o},error:function(e){t.errorMsg="Image load aborted - XHR error",t.finish(!1)}}),this.abort=function(){t.request.abort(),"function"==typeof i&&i()}):(!1!==this.crossOriginPolicy&&(this.image.crossOrigin=this.crossOriginPolicy),this.image.src=this.src)},finish:function(e){this.image.onload=this.image.onerror=this.image.onabort=null,e||(this.image=null),this.jobId&&window.clearTimeout(this.jobId),this.callback(this)}},e.ImageLoader=function(t){e.extend(!0,this,{jobLimit:e.DEFAULT_SETTINGS.imageLoaderLimit,timeout:e.DEFAULT_SETTINGS.timeout,jobQueue:[],jobsInProgress:0},t)},e.ImageLoader.prototype={addJob:function(e){var n=this,r=function(t){i(n,t,e.callback)},o=new t({src:e.src,loadWithAjax:e.loadWithAjax,ajaxHeaders:e.loadWithAjax?e.ajaxHeaders:null,crossOriginPolicy:e.crossOriginPolicy,ajaxWithCredentials:e.ajaxWithCredentials,callback:r,abort:e.abort,timeout:this.timeout});!this.jobLimit||this.jobsInProgress<this.jobLimit?(o.start(),this.jobsInProgress++):this.jobQueue.push(o)},clear:function(){for(var e=0;e<this.jobQueue.length;e++){var t=this.jobQueue[e];"function"==typeof t.abort&&t.abort()}this.jobQueue=[]}}}(s),function(e){e.Tile=function(e,t,i,n,r,o,s,a,l,c){this.level=e,this.x=t,this.y=i,this.bounds=n,this.sourceBounds=c,this.exists=r,this.url=o,this.context2D=s,this.loadWithAjax=a,this.ajaxHeaders=l,this.ajaxHeaders?this.cacheKey=this.url+"+"+JSON.stringify(this.ajaxHeaders):this.cacheKey=this.url,this.loaded=!1,this.loading=!1,this.element=null,this.imgElement=null,this.image=null,this.style=null,this.position=null,this.size=null,this.flipped=!1,this.blendStart=null,this.opacity=null,this.squaredDistance=null,this.visibility=null,this.beingDrawn=!1,this.lastTouchTime=0,this.isRightMost=!1,this.isBottomMost=!1},e.Tile.prototype={toString:function(){return this.level+"/"+this.x+"_"+this.y},_hasTransparencyChannel:function(){return!!this.context2D||this.url.match(".png")},drawHTML:function(t){this.cacheImageRecord?this.loaded?(this.element||(this.element=e.makeNeutralElement("div"),this.imgElement=this.cacheImageRecord.getImage().cloneNode(),this.imgElement.style.msInterpolationMode="nearest-neighbor",this.imgElement.style.width="100%",this.imgElement.style.height="100%",this.style=this.element.style,this.style.position="absolute"),this.element.parentNode!==t&&t.appendChild(this.element),this.imgElement.parentNode!==this.element&&this.element.appendChild(this.imgElement),this.style.top=this.position.y+"px",this.style.left=this.position.x+"px",this.style.height=this.size.y+"px",this.style.width=this.size.x+"px",this.flipped&&(this.style.transform="scaleX(-1)"),e.setElementOpacity(this.element,this.opacity)):e.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString()):e.console.warn("[Tile.drawHTML] attempting to draw tile %s when it's not cached",this.toString())},drawCanvas:function(t,i,n,r){var o,s,a,l=this.position.times(e.pixelDensityRatio),c=this.size.times(e.pixelDensityRatio);this.context2D||this.cacheImageRecord?(o=this.context2D||this.cacheImageRecord.getRenderedContext(),this.loaded&&o?(t.save(),t.globalAlpha=this.opacity,"number"==typeof n&&1!==n&&(l=l.times(n),c=c.times(n)),r instanceof e.Point&&(l=l.plus(r)),1===t.globalAlpha&&this._hasTransparencyChannel()&&t.clearRect(l.x,l.y,c.x,c.y),i({context:t,tile:this,rendered:o}),this.sourceBounds?(s=Math.min(this.sourceBounds.width,o.canvas.width),a=Math.min(this.sourceBounds.height,o.canvas.height)):(s=o.canvas.width,a=o.canvas.height),t.translate(l.x+c.x/2,0),this.flipped&&t.scale(-1,1),t.drawImage(o.canvas,0,0,s,a,-c.x/2,l.y,c.x,c.y),t.restore()):e.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString())):e.console.warn("[Tile.drawCanvas] attempting to draw tile %s when it's not cached",this.toString())},getScaleForEdgeSmoothing:function(){var t;if(this.cacheImageRecord)t=this.cacheImageRecord.getRenderedContext();else{if(!this.context2D)return e.console.warn("[Tile.drawCanvas] attempting to get tile scale %s when tile's not cached",this.toString()),1;t=this.context2D}return t.canvas.width/(this.size.x*e.pixelDensityRatio)},getTranslationForEdgeSmoothing:function(t,i,n){var r=Math.max(1,Math.ceil((n.x-i.x)/2)),o=Math.max(1,Math.ceil((n.y-i.y)/2));return new e.Point(r,o).minus(this.position.times(e.pixelDensityRatio).times(t||1).apply((function(e){return e%1})))},unload:function(){this.imgElement&&this.imgElement.parentNode&&this.imgElement.parentNode.removeChild(this.imgElement),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.imgElement=null,this.loaded=!1,this.loading=!1}}}(s),function(e){e.OverlayPlacement=e.Placement,e.OverlayRotationMode=e.freezeObject({NO_ROTATION:1,EXACT:2,BOUNDING_BOX:3}),e.Overlay=function(t,i,n){var r;r=e.isPlainObject(t)?t:{element:t,location:i,placement:n},this.element=r.element,this.style=r.element.style,this._init(r)},e.Overlay.prototype={_init:function(t){this.location=t.location,this.placement=void 0===t.placement?e.Placement.TOP_LEFT:t.placement,this.onDraw=t.onDraw,this.checkResize=void 0===t.checkResize||t.checkResize,this.width=void 0===t.width?null:t.width,this.height=void 0===t.height?null:t.height,this.rotationMode=t.rotationMode||e.OverlayRotationMode.EXACT,this.location instanceof e.Rect&&(this.width=this.location.width,this.height=this.location.height,this.location=this.location.getTopLeft(),this.placement=e.Placement.TOP_LEFT),this.scales=null!==this.width&&null!==this.height,this.bounds=new e.Rect(this.location.x,this.location.y,this.width,this.height),this.position=this.location},adjust:function(t,i){var n=e.Placement.properties[this.placement];n&&(n.isHorizontallyCentered?t.x-=i.x/2:n.isRight&&(t.x-=i.x),n.isVerticallyCentered?t.y-=i.y/2:n.isBottom&&(t.y-=i.y))},destroy:function(){var t=this.element,i=this.style;t.parentNode&&(t.parentNode.removeChild(t),t.prevElementParent&&(i.display="none",document.body.appendChild(t))),this.onDraw=null,i.top="",i.left="",i.position="",null!==this.width&&(i.width=""),null!==this.height&&(i.height="");var n=e.getCssPropertyWithVendorPrefix("transformOrigin"),r=e.getCssPropertyWithVendorPrefix("transform");n&&r&&(i[n]="",i[r]="")},drawHTML:function(t,i){var n=this.element;n.parentNode!==t&&(n.prevElementParent=n.parentNode,n.prevNextSibling=n.nextSibling,t.appendChild(n),this.style.position="absolute",this.size=e.getElementSize(n));var r=this._getOverlayPositionAndSize(i),o=r.position,s=this.size=r.size,a=r.rotate;if(this.onDraw)this.onDraw(o,s,this.element);else{var l=this.style;l.left=o.x+"px",l.top=o.y+"px",null!==this.width&&(l.width=s.x+"px"),null!==this.height&&(l.height=s.y+"px");var c=e.getCssPropertyWithVendorPrefix("transformOrigin"),u=e.getCssPropertyWithVendorPrefix("transform");c&&u&&(a?(l[c]=this._getTransformOrigin(),l[u]="rotate("+a+"deg)"):(l[c]="",l[u]="")),l.display="block"}},_getOverlayPositionAndSize:function(t){var i=t.pixelFromPoint(this.location,!0),n=this._getSizeInPixels(t);this.adjust(i,n);var r=0;if(t.degrees&&this.rotationMode!==e.OverlayRotationMode.NO_ROTATION)if(this.rotationMode===e.OverlayRotationMode.BOUNDING_BOX&&null!==this.width&&null!==this.height){var o=new e.Rect(i.x,i.y,n.x,n.y),s=this._getBoundingBox(o,t.degrees);i=s.getTopLeft(),n=s.getSize()}else r=t.degrees;return{position:i,size:n,rotate:r}},_getSizeInPixels:function(t){var i=this.size.x,n=this.size.y;if(null!==this.width||null!==this.height){var r=t.deltaPixelsFromPointsNoRotate(new e.Point(this.width||0,this.height||0),!0);null!==this.width&&(i=r.x),null!==this.height&&(n=r.y)}if(this.checkResize&&(null===this.width||null===this.height)){var o=this.size=e.getElementSize(this.element);null===this.width&&(i=o.x),null===this.height&&(n=o.y)}return new e.Point(i,n)},_getBoundingBox:function(e,t){var i=this._getPlacementPoint(e);return e.rotate(t,i).getBoundingBox()},_getPlacementPoint:function(t){var i=new e.Point(t.x,t.y),n=e.Placement.properties[this.placement];return n&&(n.isHorizontallyCentered?i.x+=t.width/2:n.isRight&&(i.x+=t.width),n.isVerticallyCentered?i.y+=t.height/2:n.isBottom&&(i.y+=t.height)),i},_getTransformOrigin:function(){var t="",i=e.Placement.properties[this.placement];return i?(i.isLeft?t="left":i.isRight&&(t="right"),i.isTop?t+=" top":i.isBottom&&(t+=" bottom"),t):t},update:function(t,i){var n=e.isPlainObject(t)?t:{location:t,placement:i};this._init({location:n.location||this.location,placement:void 0!==n.placement?n.placement:this.placement,onDraw:n.onDraw||this.onDraw,checkResize:n.checkResize||this.checkResize,width:void 0!==n.width?n.width:this.width,height:void 0!==n.height?n.height:this.height,rotationMode:n.rotationMode||this.rotationMode})},getBounds:function(t){e.console.assert(t,"A viewport must now be passed to Overlay.getBounds.");var i=this.width,n=this.height;if(null===i||null===n){var r=t.deltaPointsFromPixelsNoRotate(this.size,!0);null===i&&(i=r.x),null===n&&(n=r.y)}var o=this.location.clone();return this.adjust(o,new e.Point(i,n)),this._adjustBoundsForRotation(t,new e.Rect(o.x,o.y,i,n))},_adjustBoundsForRotation:function(t,i){if(!t||0===t.degrees||this.rotationMode===e.OverlayRotationMode.EXACT)return i;if(this.rotationMode===e.OverlayRotationMode.BOUNDING_BOX){if(null===this.width||null===this.height)return i;var n=this._getOverlayPositionAndSize(t);return t.viewerElementToViewportRectangle(new e.Rect(n.position.x,n.position.y,n.size.x,n.size.y))}return i.rotate(-t.degrees,this._getPlacementPoint(i))}}}(s),function(e){e.Drawer=function(t){e.console.assert(t.viewer,"[Drawer] options.viewer is required");var i=arguments;if(e.isPlainObject(t)||(t={source:i[0],viewport:i[1],element:i[2]}),e.console.assert(t.viewport,"[Drawer] options.viewport is required"),e.console.assert(t.element,"[Drawer] options.element is required"),t.source&&e.console.error("[Drawer] options.source is no longer accepted; use TiledImage instead"),this.viewer=t.viewer,this.viewport=t.viewport,this.debugGridColor="string"==typeof t.debugGridColor?[t.debugGridColor]:t.debugGridColor||e.DEFAULT_SETTINGS.debugGridColor,t.opacity&&e.console.error("[Drawer] options.opacity is no longer accepted; set the opacity on the TiledImage instead"),this.useCanvas=e.supportsCanvas&&(!this.viewer||this.viewer.useCanvas),this.container=e.getElement(t.element),this.canvas=e.makeNeutralElement(this.useCanvas?"canvas":"div"),this.context=this.useCanvas?this.canvas.getContext("2d"):null,this.sketchCanvas=null,this.sketchContext=null,this.element=this.container,this.container.dir="ltr",this.useCanvas){var n=this._calculateCanvasSize();this.canvas.width=n.x,this.canvas.height=n.y}this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.position="absolute",e.setElementOpacity(this.canvas,this.opacity,!0),e.setElementPointerEventsNone(this.canvas),e.setElementTouchActionNone(this.canvas),this.container.style.textAlign="left",this.container.appendChild(this.canvas),this._imageSmoothingEnabled=!0},e.Drawer.prototype={addOverlay:function(t,i,n,r){return e.console.error("drawer.addOverlay is deprecated. Use viewer.addOverlay instead."),this.viewer.addOverlay(t,i,n,r),this},updateOverlay:function(t,i,n){return e.console.error("drawer.updateOverlay is deprecated. Use viewer.updateOverlay instead."),this.viewer.updateOverlay(t,i,n),this},removeOverlay:function(t){return e.console.error("drawer.removeOverlay is deprecated. Use viewer.removeOverlay instead."),this.viewer.removeOverlay(t),this},clearOverlays:function(){return e.console.error("drawer.clearOverlays is deprecated. Use viewer.clearOverlays instead."),this.viewer.clearOverlays(),this},viewportCoordToDrawerCoord:function(t){var i=this.viewport.pixelFromPointNoRotate(t,!0);return new e.Point(i.x*e.pixelDensityRatio,i.y*e.pixelDensityRatio)},clipWithPolygons:function(e,t){if(this.useCanvas){var i=this._getContext(t);i.beginPath(),e.forEach((function(e){e.forEach((function(e,t){i[0===t?"moveTo":"lineTo"](e.x,e.y)}))})),i.clip()}},setOpacity:function(t){e.console.error("drawer.setOpacity is deprecated. Use tiledImage.setOpacity instead.");for(var i=this.viewer.world,n=0;n<i.getItemCount();n++)i.getItemAt(n).setOpacity(t);return this},getOpacity:function(){e.console.error("drawer.getOpacity is deprecated. Use tiledImage.getOpacity instead.");for(var t=this.viewer.world,i=0,n=0;n<t.getItemCount();n++){var r=t.getItemAt(n).getOpacity();r>i&&(i=r)}return i},needsUpdate:function(){return e.console.error("[Drawer.needsUpdate] this function is deprecated. Use World.needsDraw instead."),this.viewer.world.needsDraw()},numTilesLoaded:function(){return e.console.error("[Drawer.numTilesLoaded] this function is deprecated. Use TileCache.numTilesLoaded instead."),this.viewer.tileCache.numTilesLoaded()},reset:function(){return e.console.error("[Drawer.reset] this function is deprecated. Use World.resetItems instead."),this.viewer.world.resetItems(),this},update:function(){return e.console.error("[Drawer.update] this function is deprecated. Use Drawer.clear and World.draw instead."),this.clear(),this.viewer.world.draw(),this},canRotate:function(){return this.useCanvas},destroy:function(){this.canvas.width=1,this.canvas.height=1,this.sketchCanvas=null,this.sketchContext=null},clear:function(){if(this.canvas.innerHTML="",this.useCanvas){var e=this._calculateCanvasSize();if((this.canvas.width!==e.x||this.canvas.height!==e.y)&&(this.canvas.width=e.x,this.canvas.height=e.y,this._updateImageSmoothingEnabled(this.context),null!==this.sketchCanvas)){var t=this._calculateSketchCanvasSize();this.sketchCanvas.width=t.x,this.sketchCanvas.height=t.y,this._updateImageSmoothingEnabled(this.sketchContext)}this._clear()}},_clear:function(e,t){if(this.useCanvas){var i=this._getContext(e);if(t)i.clearRect(t.x,t.y,t.width,t.height);else{var n=i.canvas;i.clearRect(0,0,n.width,n.height)}}},viewportToDrawerRectangle:function(t){var i=this.viewport.pixelFromPointNoRotate(t.getTopLeft(),!0),n=this.viewport.deltaPixelsFromPointsNoRotate(t.getSize(),!0);return new e.Rect(i.x*e.pixelDensityRatio,i.y*e.pixelDensityRatio,n.x*e.pixelDensityRatio,n.y*e.pixelDensityRatio)},drawTile:function(t,i,n,r,o){if(e.console.assert(t,"[Drawer.drawTile] tile is required"),e.console.assert(i,"[Drawer.drawTile] drawingHandler is required"),this.useCanvas){var s=this._getContext(n);r=r||1,t.drawCanvas(s,i,r,o)}else t.drawHTML(this.canvas)},_getContext:function(e){var t=this.context;if(e){if(null===this.sketchCanvas){this.sketchCanvas=document.createElement("canvas");var i=this._calculateSketchCanvasSize();if(this.sketchCanvas.width=i.x,this.sketchCanvas.height=i.y,this.sketchContext=this.sketchCanvas.getContext("2d"),0===this.viewport.getRotation()){var n=this;this.viewer.addHandler("rotate",(function e(){if(0!==n.viewport.getRotation()){n.viewer.removeHandler("rotate",e);var t=n._calculateSketchCanvasSize();n.sketchCanvas.width=t.x,n.sketchCanvas.height=t.y}}))}this._updateImageSmoothingEnabled(this.sketchContext)}t=this.sketchContext}return t},saveContext:function(e){this.useCanvas&&this._getContext(e).save()},restoreContext:function(e){this.useCanvas&&this._getContext(e).restore()},setClip:function(e,t){if(this.useCanvas){var i=this._getContext(t);i.beginPath(),i.rect(e.x,e.y,e.width,e.height),i.clip()}},drawRectangle:function(e,t,i){if(this.useCanvas){var n=this._getContext(i);n.save(),n.fillStyle=t,n.fillRect(e.x,e.y,e.width,e.height),n.restore()}},blendSketch:function(t,i,n,r){var o=t;if(e.isPlainObject(o)||(o={opacity:t,scale:i,translate:n,compositeOperation:r}),this.useCanvas&&this.sketchCanvas){t=o.opacity,r=o.compositeOperation;var s=o.bounds;if(this.context.save(),this.context.globalAlpha=t,r&&(this.context.globalCompositeOperation=r),s)s.x<0&&(s.width+=s.x,s.x=0),s.x+s.width>this.canvas.width&&(s.width=this.canvas.width-s.x),s.y<0&&(s.height+=s.y,s.y=0),s.y+s.height>this.canvas.height&&(s.height=this.canvas.height-s.y),this.context.drawImage(this.sketchCanvas,s.x,s.y,s.width,s.height,s.x,s.y,s.width,s.height);else{i=o.scale||1;var a=(n=o.translate)instanceof e.Point?n:new e.Point(0,0),l=0,c=0;if(n){var u=this.sketchCanvas.width-this.canvas.width,h=this.sketchCanvas.height-this.canvas.height;l=Math.round(u/2),c=Math.round(h/2)}this.context.drawImage(this.sketchCanvas,a.x-l*i,a.y-c*i,(this.canvas.width+2*l)*i,(this.canvas.height+2*c)*i,-l,-c,this.canvas.width+2*l,this.canvas.height+2*c)}this.context.restore()}},drawDebugInfo:function(t,i,n,r){if(this.useCanvas){var o=this.viewer.world.getIndexOfItem(r)%this.debugGridColor.length,s=this.context;s.save(),s.lineWidth=2*e.pixelDensityRatio,s.font="small-caps bold "+13*e.pixelDensityRatio+"px arial",s.strokeStyle=this.debugGridColor[o],s.fillStyle=this.debugGridColor[o],0!==this.viewport.degrees&&this._offsetForRotation({degrees:this.viewport.degrees}),r.getRotation(!0)%360!=0&&this._offsetForRotation({degrees:r.getRotation(!0),point:r.viewport.pixelFromPointNoRotate(r._getRotationPoint(!0),!0)}),0===r.viewport.degrees&&r.getRotation(!0)%360==0&&r._drawer.viewer.viewport.getFlip()&&r._drawer._flip(),s.strokeRect(t.position.x*e.pixelDensityRatio,t.position.y*e.pixelDensityRatio,t.size.x*e.pixelDensityRatio,t.size.y*e.pixelDensityRatio);var a=(t.position.x+t.size.x/2)*e.pixelDensityRatio,l=(t.position.y+t.size.y/2)*e.pixelDensityRatio;s.translate(a,l),s.rotate(Math.PI/180*-this.viewport.degrees),s.translate(-a,-l),0===t.x&&0===t.y&&(s.fillText("Zoom: "+this.viewport.getZoom(),t.position.x*e.pixelDensityRatio,(t.position.y-30)*e.pixelDensityRatio),s.fillText("Pan: "+this.viewport.getBounds().toString(),t.position.x*e.pixelDensityRatio,(t.position.y-20)*e.pixelDensityRatio)),s.fillText("Level: "+t.level,(t.position.x+10)*e.pixelDensityRatio,(t.position.y+20)*e.pixelDensityRatio),s.fillText("Column: "+t.x,(t.position.x+10)*e.pixelDensityRatio,(t.position.y+30)*e.pixelDensityRatio),s.fillText("Row: "+t.y,(t.position.x+10)*e.pixelDensityRatio,(t.position.y+40)*e.pixelDensityRatio),s.fillText("Order: "+n+" of "+i,(t.position.x+10)*e.pixelDensityRatio,(t.position.y+50)*e.pixelDensityRatio),s.fillText("Size: "+t.size.toString(),(t.position.x+10)*e.pixelDensityRatio,(t.position.y+60)*e.pixelDensityRatio),s.fillText("Position: "+t.position.toString(),(t.position.x+10)*e.pixelDensityRatio,(t.position.y+70)*e.pixelDensityRatio),0!==this.viewport.degrees&&this._restoreRotationChanges(),r.getRotation(!0)%360!=0&&this._restoreRotationChanges(),0===r.viewport.degrees&&r.getRotation(!0)%360==0&&r._drawer.viewer.viewport.getFlip()&&r._drawer._flip(),s.restore()}},debugRect:function(t){if(this.useCanvas){var i=this.context;i.save(),i.lineWidth=2*e.pixelDensityRatio,i.strokeStyle=this.debugGridColor[0],i.fillStyle=this.debugGridColor[0],i.strokeRect(t.x*e.pixelDensityRatio,t.y*e.pixelDensityRatio,t.width*e.pixelDensityRatio,t.height*e.pixelDensityRatio),i.restore()}},setImageSmoothingEnabled:function(e){this.useCanvas&&(this._imageSmoothingEnabled=e,this._updateImageSmoothingEnabled(this.context),this.viewer.forceRedraw())},_updateImageSmoothingEnabled:function(e){e.msImageSmoothingEnabled=this._imageSmoothingEnabled,e.imageSmoothingEnabled=this._imageSmoothingEnabled},getCanvasSize:function(t){var i=this._getContext(t).canvas;return new e.Point(i.width,i.height)},getCanvasCenter:function(){return new e.Point(this.canvas.width/2,this.canvas.height/2)},_offsetForRotation:function(t){var i=t.point?t.point.times(e.pixelDensityRatio):this.getCanvasCenter(),n=this._getContext(t.useSketch);n.save(),n.translate(i.x,i.y),this.viewer.viewport.flipped?(n.rotate(Math.PI/180*-t.degrees),n.scale(-1,1)):n.rotate(Math.PI/180*t.degrees),n.translate(-i.x,-i.y)},_flip:function(t){var i=(t=t||{}).point?t.point.times(e.pixelDensityRatio):this.getCanvasCenter(),n=this._getContext(t.useSketch);n.translate(i.x,0),n.scale(-1,1),n.translate(-i.x,0)},_restoreRotationChanges:function(e){this._getContext(e).restore()},_calculateCanvasSize:function(){var t=e.pixelDensityRatio,i=this.viewport.getContainerSize();return{x:Math.round(i.x*t),y:Math.round(i.y*t)}},_calculateSketchCanvasSize:function(){var e=this._calculateCanvasSize();if(0===this.viewport.getRotation())return e;var t=Math.ceil(Math.sqrt(e.x*e.x+e.y*e.y));return{x:t,y:t}}}}(s),function(e){e.Viewport=function(t){var i=arguments;i.length&&i[0]instanceof e.Point&&(t={containerSize:i[0],contentSize:i[1],config:i[2]}),t.config&&(e.extend(!0,t,t.config),delete t.config),this._margins=e.extend({left:0,top:0,right:0,bottom:0},t.margins||{}),delete t.margins,e.extend(!0,this,{containerSize:null,contentSize:null,zoomPoint:null,viewer:null,springStiffness:e.DEFAULT_SETTINGS.springStiffness,animationTime:e.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:e.DEFAULT_SETTINGS.minZoomImageRatio,maxZoomPixelRatio:e.DEFAULT_SETTINGS.maxZoomPixelRatio,visibilityRatio:e.DEFAULT_SETTINGS.visibilityRatio,wrapHorizontal:e.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:e.DEFAULT_SETTINGS.wrapVertical,defaultZoomLevel:e.DEFAULT_SETTINGS.defaultZoomLevel,minZoomLevel:e.DEFAULT_SETTINGS.minZoomLevel,maxZoomLevel:e.DEFAULT_SETTINGS.maxZoomLevel,degrees:e.DEFAULT_SETTINGS.degrees,flipped:e.DEFAULT_SETTINGS.flipped,homeFillsViewer:e.DEFAULT_SETTINGS.homeFillsViewer},t),this._updateContainerInnerSize(),this.centerSpringX=new e.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.centerSpringY=new e.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.zoomSpring=new e.Spring({exponential:!0,initial:1,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._setContentBounds(new e.Rect(0,0,1,1),1),this.goHome(!0),this.update()},e.Viewport.prototype={resetContentSize:function(t){return e.console.assert(t,"[Viewport.resetContentSize] contentSize is required"),e.console.assert(t instanceof e.Point,"[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point"),e.console.assert(t.x>0,"[Viewport.resetContentSize] contentSize.x must be greater than 0"),e.console.assert(t.y>0,"[Viewport.resetContentSize] contentSize.y must be greater than 0"),this._setContentBounds(new e.Rect(0,0,1,t.y/t.x),t.x),this},setHomeBounds:function(t,i){e.console.error("[Viewport.setHomeBounds] this function is deprecated; The content bounds should not be set manually."),this._setContentBounds(t,i)},_setContentBounds:function(t,i){e.console.assert(t,"[Viewport._setContentBounds] bounds is required"),e.console.assert(t instanceof e.Rect,"[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect"),e.console.assert(t.width>0,"[Viewport._setContentBounds] bounds.width must be greater than 0"),e.console.assert(t.height>0,"[Viewport._setContentBounds] bounds.height must be greater than 0"),this._contentBoundsNoRotate=t.clone(),this._contentSizeNoRotate=this._contentBoundsNoRotate.getSize().times(i),this._contentBounds=t.rotate(this.degrees).getBoundingBox(),this._contentSize=this._contentBounds.getSize().times(i),this._contentAspectRatio=this._contentSize.x/this._contentSize.y,this.viewer&&this.viewer.raiseEvent("reset-size",{contentSize:this._contentSizeNoRotate.clone(),contentFactor:i,homeBounds:this._contentBoundsNoRotate.clone(),contentBounds:this._contentBounds.clone()})},getHomeZoom:function(){if(this.defaultZoomLevel)return this.defaultZoomLevel;var e=this._contentAspectRatio/this.getAspectRatio();return(this.homeFillsViewer?e>=1?e:1:e>=1?1:e)/this._contentBounds.width},getHomeBounds:function(){return this.getHomeBoundsNoRotate().rotate(-this.getRotation())},getHomeBoundsNoRotate:function(){var t=this._contentBounds.getCenter(),i=1/this.getHomeZoom(),n=i/this.getAspectRatio();return new e.Rect(t.x-i/2,t.y-n/2,i,n)},goHome:function(e){return this.viewer&&this.viewer.raiseEvent("home",{immediately:e}),this.fitBounds(this.getHomeBounds(),e)},getMinZoom:function(){var e=this.getHomeZoom();return this.minZoomLevel?this.minZoomLevel:this.minZoomImageRatio*e},getMaxZoom:function(){var e=this.maxZoomLevel;return e||(e=this._contentSize.x*this.maxZoomPixelRatio/this._containerInnerSize.x,e/=this._contentBounds.width),Math.max(e,this.getHomeZoom())},getAspectRatio:function(){return this._containerInnerSize.x/this._containerInnerSize.y},getContainerSize:function(){return new e.Point(this.containerSize.x,this.containerSize.y)},getMargins:function(){return e.extend({},this._margins)},setMargins:function(t){e.console.assert("object"===e.type(t),"[Viewport.setMargins] margins must be an object"),this._margins=e.extend({left:0,top:0,right:0,bottom:0},t),this._updateContainerInnerSize(),this.viewer&&this.viewer.forceRedraw()},getBounds:function(e){return this.getBoundsNoRotate(e).rotate(-this.getRotation())},getBoundsNoRotate:function(t){var i=this.getCenter(t),n=1/this.getZoom(t),r=n/this.getAspectRatio();return new e.Rect(i.x-n/2,i.y-r/2,n,r)},getBoundsWithMargins:function(e){return this.getBoundsNoRotateWithMargins(e).rotate(-this.getRotation(),this.getCenter(e))},getBoundsNoRotateWithMargins:function(e){var t=this.getBoundsNoRotate(e),i=this._containerInnerSize.x*this.getZoom(e);return t.x-=this._margins.left/i,t.y-=this._margins.top/i,t.width+=(this._margins.left+this._margins.right)/i,t.height+=(this._margins.top+this._margins.bottom)/i,t},getCenter:function(t){var i,n,r,o,s,a,l=new e.Point(this.centerSpringX.current.value,this.centerSpringY.current.value),c=new e.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return t?l:this.zoomPoint?(i=this.pixelFromPoint(this.zoomPoint,!0),o=(r=1/(n=this.getZoom()))/this.getAspectRatio(),s=new e.Rect(l.x-r/2,l.y-o/2,r,o),a=this._pixelFromPoint(this.zoomPoint,s).minus(i).divide(this._containerInnerSize.x*n),c.plus(a)):c},getZoom:function(e){return e?this.zoomSpring.current.value:this.zoomSpring.target.value},_applyZoomConstraints:function(e){return Math.max(Math.min(e,this.getMaxZoom()),this.getMinZoom())},_applyBoundaryConstraints:function(t){var i=new e.Rect(t.x,t.y,t.width,t.height);if(this.wrapHorizontal);else{var n=this.visibilityRatio*i.width,r=i.x+i.width,o=this._contentBoundsNoRotate.x+this._contentBoundsNoRotate.width,s=this._contentBoundsNoRotate.x-r+n,a=o-i.x-n;n>this._contentBoundsNoRotate.width?i.x+=(s+a)/2:a<0?i.x+=a:s>0&&(i.x+=s)}if(this.wrapVertical);else{var l=this.visibilityRatio*i.height,c=i.y+i.height,u=this._contentBoundsNoRotate.y+this._contentBoundsNoRotate.height,h=this._contentBoundsNoRotate.y-c+l,d=u-i.y-l;l>this._contentBoundsNoRotate.height?i.y+=(h+d)/2:d<0?i.y+=d:h>0&&(i.y+=h)}return i},_raiseConstraintsEvent:function(e){this.viewer&&this.viewer.raiseEvent("constrain",{immediately:e})},applyConstraints:function(e){var t=this.getZoom(),i=this._applyZoomConstraints(t);t!==i&&this.zoomTo(i,this.zoomPoint,e);var n=this.getBoundsNoRotate(),r=this._applyBoundaryConstraints(n);return this._raiseConstraintsEvent(e),(n.x!==r.x||n.y!==r.y||e)&&this.fitBounds(r.rotate(-this.getRotation()),e),this},ensureVisible:function(e){return this.applyConstraints(e)},_fitBounds:function(t,i){var n=(i=i||{}).immediately||!1,r=i.constraints||!1,o=this.getAspectRatio(),s=t.getCenter(),a=new e.Rect(t.x,t.y,t.width,t.height,t.degrees+this.getRotation()).getBoundingBox();a.getAspectRatio()>=o?a.height=a.width/o:a.width=a.height*o,a.x=s.x-a.width/2,a.y=s.y-a.height/2;var l=1/a.width;if(r){var c=a.getAspectRatio(),u=this._applyZoomConstraints(l);l!==u&&(l=u,a.width=1/l,a.x=s.x-a.width/2,a.height=a.width/c,a.y=s.y-a.height/2),s=(a=this._applyBoundaryConstraints(a)).getCenter(),this._raiseConstraintsEvent(n)}if(n)return this.panTo(s,!0),this.zoomTo(l,null,!0);this.panTo(this.getCenter(!0),!0),this.zoomTo(this.getZoom(!0),null,!0);var h=this.getBounds(),d=this.getZoom();if(0===d||Math.abs(l/d-1)<1e-8)return this.zoomTo(l,!0),this.panTo(s,n);var p=(a=a.rotate(-this.getRotation())).getTopLeft().times(l).minus(h.getTopLeft().times(d)).divide(l-d);return this.zoomTo(l,p,n)},fitBounds:function(e,t){return this._fitBounds(e,{immediately:t,constraints:!1})},fitBoundsWithConstraints:function(e,t){return this._fitBounds(e,{immediately:t,constraints:!0})},fitVertically:function(t){var i=new e.Rect(this._contentBounds.x+this._contentBounds.width/2,this._contentBounds.y,0,this._contentBounds.height);return this.fitBounds(i,t)},fitHorizontally:function(t){var i=new e.Rect(this._contentBounds.x,this._contentBounds.y+this._contentBounds.height/2,this._contentBounds.width,0);return this.fitBounds(i,t)},getConstrainedBounds:function(e){var t;return t=this.getBounds(e),this._applyBoundaryConstraints(t)},panBy:function(t,i){var n=new e.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return this.panTo(n.plus(t),i)},panTo:function(e,t){return t?(this.centerSpringX.resetTo(e.x),this.centerSpringY.resetTo(e.y)):(this.centerSpringX.springTo(e.x),this.centerSpringY.springTo(e.y)),this.viewer&&this.viewer.raiseEvent("pan",{center:e,immediately:t}),this},zoomBy:function(e,t,i){return this.zoomTo(this.zoomSpring.target.value*e,t,i)},zoomTo:function(t,i,n){var r=this;return this.zoomPoint=i instanceof e.Point&&!isNaN(i.x)&&!isNaN(i.y)?i:null,n?this._adjustCenterSpringsForZoomPoint((function(){r.zoomSpring.resetTo(t)})):this.zoomSpring.springTo(t),this.viewer&&this.viewer.raiseEvent("zoom",{zoom:t,refPoint:i,immediately:n}),this},setRotation:function(t){return this.viewer&&this.viewer.drawer.canRotate()?(this.degrees=e.positiveModulo(t,360),this._setContentBounds(this.viewer.world.getHomeBounds(),this.viewer.world.getContentFactor()),this.viewer.forceRedraw(),this.viewer.raiseEvent("rotate",{degrees:t}),this):this},getRotation:function(){return this.degrees},resize:function(e,t){var i,n=this.getBoundsNoRotate(),r=n;return this.containerSize.x=e.x,this.containerSize.y=e.y,this._updateContainerInnerSize(),t&&(i=e.x/this.containerSize.x,r.width=n.width*i,r.height=r.width/this.getAspectRatio()),this.viewer&&this.viewer.raiseEvent("resize",{newContainerSize:e,maintain:t}),this.fitBounds(r,!0)},_updateContainerInnerSize:function(){this._containerInnerSize=new e.Point(Math.max(1,this.containerSize.x-(this._margins.left+this._margins.right)),Math.max(1,this.containerSize.y-(this._margins.top+this._margins.bottom)))},update:function(){var e=this;this._adjustCenterSpringsForZoomPoint((function(){e.zoomSpring.update()})),this.centerSpringX.update(),this.centerSpringY.update();var t=this.centerSpringX.current.value!==this._oldCenterX||this.centerSpringY.current.value!==this._oldCenterY||this.zoomSpring.current.value!==this._oldZoom;return this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,t},_adjustCenterSpringsForZoomPoint:function(e){if(this.zoomPoint){var t=this.pixelFromPoint(this.zoomPoint,!0);e();var i=this.pixelFromPoint(this.zoomPoint,!0).minus(t),n=this.deltaPointsFromPixels(i,!0);this.centerSpringX.shiftBy(n.x),this.centerSpringY.shiftBy(n.y),this.zoomSpring.isAtTargetValue()&&(this.zoomPoint=null)}else e()},deltaPixelsFromPointsNoRotate:function(e,t){return e.times(this._containerInnerSize.x*this.getZoom(t))},deltaPixelsFromPoints:function(e,t){return this.deltaPixelsFromPointsNoRotate(e.rotate(this.getRotation()),t)},deltaPointsFromPixelsNoRotate:function(e,t){return e.divide(this._containerInnerSize.x*this.getZoom(t))},deltaPointsFromPixels:function(e,t){return this.deltaPointsFromPixelsNoRotate(e,t).rotate(-this.getRotation())},pixelFromPointNoRotate:function(e,t){return this._pixelFromPointNoRotate(e,this.getBoundsNoRotate(t))},pixelFromPoint:function(e,t){return this._pixelFromPoint(e,this.getBoundsNoRotate(t))},_pixelFromPointNoRotate:function(t,i){return t.minus(i.getTopLeft()).times(this._containerInnerSize.x/i.width).plus(new e.Point(this._margins.left,this._margins.top))},_pixelFromPoint:function(e,t){return this._pixelFromPointNoRotate(e.rotate(this.getRotation(),this.getCenter(!0)),t)},pointFromPixelNoRotate:function(t,i){var n=this.getBoundsNoRotate(i);return t.minus(new e.Point(this._margins.left,this._margins.top)).divide(this._containerInnerSize.x/n.width).plus(n.getTopLeft())},pointFromPixel:function(e,t){return this.pointFromPixelNoRotate(e,t).rotate(-this.getRotation(),this.getCenter(!0))},_viewportToImageDelta:function(t,i){var n=this._contentBoundsNoRotate.width;return new e.Point(t*this._contentSizeNoRotate.x/n,i*this._contentSizeNoRotate.x/n)},viewportToImageCoordinates:function(t,i){if(t instanceof e.Point)return this.viewportToImageCoordinates(t.x,t.y);if(this.viewer){var n=this.viewer.world.getItemCount();if(n>1)e.console.error("[Viewport.viewportToImageCoordinates] is not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.");else if(1===n){return this.viewer.world.getItemAt(0).viewportToImageCoordinates(t,i,!0)}}return this._viewportToImageDelta(t-this._contentBoundsNoRotate.x,i-this._contentBoundsNoRotate.y)},_imageToViewportDelta:function(t,i){var n=this._contentBoundsNoRotate.width;return new e.Point(t/this._contentSizeNoRotate.x*n,i/this._contentSizeNoRotate.x*n)},imageToViewportCoordinates:function(t,i){if(t instanceof e.Point)return this.imageToViewportCoordinates(t.x,t.y);if(this.viewer){var n=this.viewer.world.getItemCount();if(n>1)e.console.error("[Viewport.imageToViewportCoordinates] is not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.");else if(1===n){return this.viewer.world.getItemAt(0).imageToViewportCoordinates(t,i,!0)}}var r=this._imageToViewportDelta(t,i);return r.x+=this._contentBoundsNoRotate.x,r.y+=this._contentBoundsNoRotate.y,r},imageToViewportRectangle:function(t,i,n,r){var o=t;if(o instanceof e.Rect||(o=new e.Rect(t,i,n,r)),this.viewer){var s=this.viewer.world.getItemCount();if(s>1)e.console.error("[Viewport.imageToViewportRectangle] is not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.");else if(1===s){return this.viewer.world.getItemAt(0).imageToViewportRectangle(t,i,n,r,!0)}}var a=this.imageToViewportCoordinates(o.x,o.y),l=this._imageToViewportDelta(o.width,o.height);return new e.Rect(a.x,a.y,l.x,l.y,o.degrees)},viewportToImageRectangle:function(t,i,n,r){var o=t;if(o instanceof e.Rect||(o=new e.Rect(t,i,n,r)),this.viewer){var s=this.viewer.world.getItemCount();if(s>1)e.console.error("[Viewport.viewportToImageRectangle] is not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.");else if(1===s){return this.viewer.world.getItemAt(0).viewportToImageRectangle(t,i,n,r,!0)}}var a=this.viewportToImageCoordinates(o.x,o.y),l=this._viewportToImageDelta(o.width,o.height);return new e.Rect(a.x,a.y,l.x,l.y,o.degrees)},viewerElementToImageCoordinates:function(e){var t=this.pointFromPixel(e,!0);return this.viewportToImageCoordinates(t)},imageToViewerElementCoordinates:function(e){var t=this.imageToViewportCoordinates(e);return this.pixelFromPoint(t,!0)},windowToImageCoordinates:function(t){e.console.assert(this.viewer,"[Viewport.windowToImageCoordinates] the viewport must have a viewer.");var i=t.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(i)},imageToWindowCoordinates:function(t){return e.console.assert(this.viewer,"[Viewport.imageToWindowCoordinates] the viewport must have a viewer."),this.imageToViewerElementCoordinates(t).plus(e.getElementPosition(this.viewer.element))},viewerElementToViewportCoordinates:function(e){return this.pointFromPixel(e,!0)},viewportToViewerElementCoordinates:function(e){return this.pixelFromPoint(e,!0)},viewerElementToViewportRectangle:function(t){return e.Rect.fromSummits(this.pointFromPixel(t.getTopLeft(),!0),this.pointFromPixel(t.getTopRight(),!0),this.pointFromPixel(t.getBottomLeft(),!0))},viewportToViewerElementRectangle:function(t){return e.Rect.fromSummits(this.pixelFromPoint(t.getTopLeft(),!0),this.pixelFromPoint(t.getTopRight(),!0),this.pixelFromPoint(t.getBottomLeft(),!0))},windowToViewportCoordinates:function(t){e.console.assert(this.viewer,"[Viewport.windowToViewportCoordinates] the viewport must have a viewer.");var i=t.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToViewportCoordinates(i)},viewportToWindowCoordinates:function(t){return e.console.assert(this.viewer,"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer."),this.viewportToViewerElementCoordinates(t).plus(e.getElementPosition(this.viewer.element))},viewportToImageZoom:function(t){if(this.viewer){var i=this.viewer.world.getItemCount();if(i>1)e.console.error("[Viewport.viewportToImageZoom] is not accurate with multi-image.");else if(1===i){return this.viewer.world.getItemAt(0).viewportToImageZoom(t)}}var n=this._contentSizeNoRotate.x;return t*(this._containerInnerSize.x/n*this._contentBoundsNoRotate.width)},imageToViewportZoom:function(t){if(this.viewer){var i=this.viewer.world.getItemCount();if(i>1)e.console.error("[Viewport.imageToViewportZoom] is not accurate with multi-image.");else if(1===i){return this.viewer.world.getItemAt(0).imageToViewportZoom(t)}}return t*(this._contentSizeNoRotate.x/this._containerInnerSize.x/this._contentBoundsNoRotate.width)},toggleFlip:function(){return this.setFlip(!this.getFlip()),this},getFlip:function(){return this.flipped},setFlip:function(e){return this.flipped===e||(this.flipped=e,this.viewer.navigator&&this.viewer.navigator.setFlip(this.getFlip()),this.viewer.forceRedraw(),this.viewer.raiseEvent("flip",{flipped:e})),this}}}(s),function(e){function t(e,t,n,r,o,s,a,l,c){var u=a.getBoundingBox().getTopLeft(),h=a.getBoundingBox().getBottomRight();e.viewer&&e.viewer.raiseEvent("update-level",{tiledImage:e,havedrawn:t,level:r,opacity:o,visibility:s,drawArea:a,topleft:u,bottomright:h,currenttime:l,best:c}),p(e.coverage,r),p(e.loadingCoverage,r);var d=e._getCornerTiles(r,u,h),f=d.topLeft,g=d.bottomRight,v=e.source.getNumTiles(r),m=e.viewport.pixelFromPoint(e.viewport.getCenter());e.getFlip()&&(g.x+=1,e.wrapHorizontal||(g.x=Math.min(g.x,v.x-1)));for(var y=f.x;y<=g.x;y++)for(var w=f.y;w<=g.y;w++){var x;if(e.getFlip()){var b=(v.x+y%v.x)%v.x;x=y+v.x-b-b-1}else x=y;null!==a.intersection(e.getTileBounds(r,x,w))&&(c=i(e,n,t,x,w,r,o,s,m,v,l,c))}return c}function i(e,t,i,r,o,s,u,p,g,v,m,y){var w=n(r,o,s,e,e.source,e.tilesMatrix,m,v,e._worldWidthCurrent,e._worldHeightCurrent),x=i;e.viewer&&e.viewer.raiseEvent("update-tile",{tiledImage:e,tile:w}),d(e.coverage,s,r,o,!1);var b=w.loaded||w.loading||h(e.loadingCoverage,s,r,o);if(d(e.loadingCoverage,s,r,o,b),!w.exists)return y;if(t&&!x&&(h(e.coverage,s,r,o)?d(e.coverage,s,r,o,!0):x=!0),!x)return y;if(l(w,e.source.tileOverlap,e.viewport,g,p,e),!w.loaded)if(w.context2D)a(e,w);else{var _=e._tileCache.getImageRecord(w.cacheKey);if(_)a(e,w,_.getImage())}w.loaded?c(e,w,r,o,s,u,m)&&(e._needsDraw=!0):w.loading?e._tilesLoading++:b||(y=f(y,w));return y}function n(t,i,n,r,o,s,a,l,c,u){var h,d,p,f,g,v,m,y,w;return s[n]||(s[n]={}),s[n][t]||(s[n][t]={}),s[n][t][i]&&!s[n][t][i].flipped==!r.flipped||(h=(l.x+t%l.x)%l.x,d=(l.y+i%l.y)%l.y,p=r.getTileBounds(n,t,i),f=o.getTileBounds(n,h,d,!0),g=o.tileExists(n,h,d),v=o.getTileUrl(n,h,d),r.loadTilesWithAjax?(m=o.getTileAjaxHeaders(n,h,d),e.isPlainObject(r.ajaxHeaders)&&(m=e.extend({},r.ajaxHeaders,m))):m=null,y=o.getContext2D?o.getContext2D(n,h,d):void 0,w=new e.Tile(n,t,i,p,g,v,y,r.loadTilesWithAjax,m,f),r.getFlip()?0===h&&(w.isRightMost=!0):h===l.x-1&&(w.isRightMost=!0),d===l.y-1&&(w.isBottomMost=!0),w.flipped=r.flipped,s[n][t][i]=w),(w=s[n][t][i]).lastTouchTime=a,w}function r(e,t,i){t.loading=!0,e._imageLoader.addJob({src:t.url,loadWithAjax:t.loadWithAjax,ajaxHeaders:t.ajaxHeaders,crossOriginPolicy:e.crossOriginPolicy,ajaxWithCredentials:e.ajaxWithCredentials,callback:function(n,r,s){o(e,t,i,n,r,s)},abort:function(){t.loading=!1}})}function o(t,i,n,r,o,s){if(!r)return e.console.log("Tile %s failed to load: %s - error: %s",i,i.url,o),t.viewer.raiseEvent("tile-load-failed",{tile:i,tiledImage:t,time:n,message:o,tileRequest:s}),i.loading=!1,void(i.exists=!1);if(n<t.lastResetTime)return e.console.log("Ignoring tile %s loaded before reset: %s",i,i.url),void(i.loading=!1);var l=function(){var e=t.source.getClosestLevel();a(t,i,r,e,s)};t._midDraw?window.setTimeout(l,1):l()}function a(e,t,i,n,r){var o=0;function s(){return o++,a}function a(){0===--o&&(t.loading=!1,t.loaded=!0,t.context2D||e._tileCache.cacheTile({image:i,tile:t,cutoff:n,tiledImage:e}),e._needsDraw=!0)}e.viewer.raiseEvent("tile-loaded",{tile:t,tiledImage:e,tileRequest:r,image:i,getCompletionCallback:s}),s()()}function l(t,i,n,r,o,s){var a=t.bounds.getTopLeft();a.x*=s._scaleSpring.current.value,a.y*=s._scaleSpring.current.value,a.x+=s._xSpring.current.value,a.y+=s._ySpring.current.value;var l=t.bounds.getSize();l.x*=s._scaleSpring.current.value,l.y*=s._scaleSpring.current.value;var c=n.pixelFromPointNoRotate(a,!0),u=n.pixelFromPointNoRotate(a,!1),h=n.deltaPixelsFromPointsNoRotate(l,!0),d=n.deltaPixelsFromPointsNoRotate(l,!1),p=u.plus(d.divide(2)),f=r.squaredDistanceTo(p);i||(h=h.plus(new e.Point(1,1))),t.isRightMost&&s.wrapHorizontal&&(h.x+=.75),t.isBottomMost&&s.wrapVertical&&(h.y+=.75),t.position=c,t.size=h,t.squaredDistance=f,t.visibility=o}function c(e,t,i,n,r,o,s){var a,l,c=1e3*e.blendTime;if(t.blendStart||(t.blendStart=s),a=s-t.blendStart,l=c?Math.min(1,a/c):1,e.alwaysBlend&&(l*=o),t.opacity=l,e.lastDrawn.push(t),1===l)d(e.coverage,r,i,n,!0),e._hasOpaqueTile=!0;else if(a<c)return!0;return!1}function u(e,t,i,n){var r,o,s,a;if(!e[t])return!1;if(void 0===i||void 0===n){for(s in r=e[t])if(Object.prototype.hasOwnProperty.call(r,s))for(a in o=r[s])if(Object.prototype.hasOwnProperty.call(o,a)&&!o[a])return!1;return!0}return void 0===e[t][i]||void 0===e[t][i][n]||!0===e[t][i][n]}function h(e,t,i,n){return void 0===i||void 0===n?u(e,t+1):u(e,t+1,2*i,2*n)&&u(e,t+1,2*i,2*n+1)&&u(e,t+1,2*i+1,2*n)&&u(e,t+1,2*i+1,2*n+1)}function d(t,i,n,r,o){t[i]?(t[i][n]||(t[i][n]={}),t[i][n][r]=o):e.console.warn("Setting coverage for a tile before its level's coverage has been reset: %s",i)}function p(e,t){e[t]={}}function f(e,t){return e?t.visibility>e.visibility||t.visibility===e.visibility&&t.squaredDistance<e.squaredDistance?t:e:t}function g(t,i){if(0!==t.opacity&&(0!==i.length||t.placeholderFillStyle)){var n,r,o,s=i[0];s&&(n=t.opacity<1||t.compositeOperation&&"source-over"!==t.compositeOperation||!t._isBottomItem()&&s._hasTransparencyChannel());var a,l=t.viewport.getZoom(!0),c=t.viewportToImageZoom(l);i.length>1&&c>t.smoothTileEdgesMinZoom&&!t.iOSDevice&&t.getRotation(!0)%360==0&&e.supportsCanvas&&(n=!0,r=s.getScaleForEdgeSmoothing(),o=s.getTranslationForEdgeSmoothing(r,t._drawer.getCanvasSize(!1),t._drawer.getCanvasSize(!0))),n&&(r||(a=t.viewport.viewportToViewerElementRectangle(t.getClippedBounds(!0)).getIntegerBoundingBox(),t._drawer.viewer.viewport.getFlip()&&(0===t.viewport.degrees&&t.getRotation(!0)%360==0||(a.x=t._drawer.viewer.container.clientWidth-(a.x+a.width))),a=a.times(e.pixelDensityRatio)),t._drawer._clear(!0,a)),r||(0!==t.viewport.degrees&&t._drawer._offsetForRotation({degrees:t.viewport.degrees,useSketch:n}),t.getRotation(!0)%360!=0&&t._drawer._offsetForRotation({degrees:t.getRotation(!0),point:t.viewport.pixelFromPointNoRotate(t._getRotationPoint(!0),!0),useSketch:n}),0===t.viewport.degrees&&t.getRotation(!0)%360==0&&t._drawer.viewer.viewport.getFlip()&&t._drawer._flip());var u=!1;if(t._clip){t._drawer.saveContext(n);var h=t.imageToViewportRectangle(t._clip,!0);h=h.rotate(-t.getRotation(!0),t._getRotationPoint(!0));var d=t._drawer.viewportToDrawerRectangle(h);r&&(d=d.times(r)),o&&(d=d.translate(o)),t._drawer.setClip(d,n),u=!0}if(t._croppingPolygons){t._drawer.saveContext(n);try{var p=t._croppingPolygons.map((function(e){return e.map((function(e){var i=t.imageToViewportCoordinates(e.x,e.y,!0).rotate(-t.getRotation(!0),t._getRotationPoint(!0)),n=t._drawer.viewportCoordToDrawerCoord(i);return r&&(n=n.times(r)),n}))}));t._drawer.clipWithPolygons(p,n)}catch(t){e.console.error(t)}u=!0}if(t.placeholderFillStyle&&!1===t._hasOpaqueTile){var f=t._drawer.viewportToDrawerRectangle(t.getBounds(!0));r&&(f=f.times(r)),o&&(f=f.translate(o));var g=null;g="function"==typeof t.placeholderFillStyle?t.placeholderFillStyle(t,t._drawer.context):t.placeholderFillStyle,t._drawer.drawRectangle(f,g,n)}for(var m=i.length-1;m>=0;m--)s=i[m],t._drawer.drawTile(s,t._drawingHandler,n,r,o),s.beingDrawn=!0,t.viewer&&t.viewer.raiseEvent("tile-drawn",{tiledImage:t,tile:s});u&&t._drawer.restoreContext(n),r||(t.getRotation(!0)%360!=0&&t._drawer._restoreRotationChanges(n),0!==t.viewport.degrees&&t._drawer._restoreRotationChanges(n)),n&&(r&&(0!==t.viewport.degrees&&t._drawer._offsetForRotation({degrees:t.viewport.degrees,useSketch:!1}),t.getRotation(!0)%360!=0&&t._drawer._offsetForRotation({degrees:t.getRotation(!0),point:t.viewport.pixelFromPointNoRotate(t._getRotationPoint(!0),!0),useSketch:!1})),t._drawer.blendSketch({opacity:t.opacity,scale:r,translate:o,compositeOperation:t.compositeOperation,bounds:a}),r&&(t.getRotation(!0)%360!=0&&t._drawer._restoreRotationChanges(!1),0!==t.viewport.degrees&&t._drawer._restoreRotationChanges(!1))),r||0===t.viewport.degrees&&t.getRotation(!0)%360==0&&t._drawer.viewer.viewport.getFlip()&&t._drawer._flip(),v(t,i)}}function v(t,i){if(t.debugMode)for(var n=i.length-1;n>=0;n--){var r=i[n];try{t._drawer.drawDebugInfo(r,i.length,n,t)}catch(t){e.console.error(t)}}}e.TiledImage=function(t){var i=this;e.console.assert(t.tileCache,"[TiledImage] options.tileCache is required"),e.console.assert(t.drawer,"[TiledImage] options.drawer is required"),e.console.assert(t.viewer,"[TiledImage] options.viewer is required"),e.console.assert(t.imageLoader,"[TiledImage] options.imageLoader is required"),e.console.assert(t.source,"[TiledImage] options.source is required"),e.console.assert(!t.clip||t.clip instanceof e.Rect,"[TiledImage] options.clip must be an OpenSeadragon.Rect if present"),e.EventSource.call(this),this._tileCache=t.tileCache,delete t.tileCache,this._drawer=t.drawer,delete t.drawer,this._imageLoader=t.imageLoader,delete t.imageLoader,t.clip instanceof e.Rect&&(this._clip=t.clip.clone()),delete t.clip;var n=t.x||0;delete t.x;var r=t.y||0;delete t.y,this.normHeight=t.source.dimensions.y/t.source.dimensions.x,this.contentAspectX=t.source.dimensions.x/t.source.dimensions.y;var o=1;t.width?(o=t.width,delete t.width,t.height&&(e.console.error("specifying both width and height to a tiledImage is not supported"),delete t.height)):t.height&&(o=t.height/this.normHeight,delete t.height);var a=t.fitBounds;delete t.fitBounds;var l=t.fitBoundsPlacement||s.Placement.CENTER;delete t.fitBoundsPlacement;var c=t.degrees||0;delete t.degrees,e.extend(!0,this,{viewer:null,tilesMatrix:{},coverage:{},loadingCoverage:{},lastDrawn:[],lastResetTime:0,_midDraw:!1,_needsDraw:!0,_hasOpaqueTile:!1,_tilesLoading:0,springStiffness:e.DEFAULT_SETTINGS.springStiffness,animationTime:e.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:e.DEFAULT_SETTINGS.minZoomImageRatio,wrapHorizontal:e.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:e.DEFAULT_SETTINGS.wrapVertical,immediateRender:e.DEFAULT_SETTINGS.immediateRender,blendTime:e.DEFAULT_SETTINGS.blendTime,alwaysBlend:e.DEFAULT_SETTINGS.alwaysBlend,minPixelRatio:e.DEFAULT_SETTINGS.minPixelRatio,smoothTileEdgesMinZoom:e.DEFAULT_SETTINGS.smoothTileEdgesMinZoom,iOSDevice:e.DEFAULT_SETTINGS.iOSDevice,debugMode:e.DEFAULT_SETTINGS.debugMode,crossOriginPolicy:e.DEFAULT_SETTINGS.crossOriginPolicy,ajaxWithCredentials:e.DEFAULT_SETTINGS.ajaxWithCredentials,placeholderFillStyle:e.DEFAULT_SETTINGS.placeholderFillStyle,opacity:e.DEFAULT_SETTINGS.opacity,preload:e.DEFAULT_SETTINGS.preload,compositeOperation:e.DEFAULT_SETTINGS.compositeOperation},t),this._preload=this.preload,delete this.preload,this._fullyLoaded=!1,this._xSpring=new e.Spring({initial:n,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._ySpring=new e.Spring({initial:r,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._scaleSpring=new e.Spring({initial:o,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._degreesSpring=new e.Spring({initial:c,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._updateForScale(),a&&this.fitBounds(a,l,!0),this._drawingHandler=function(t){i.viewer.raiseEvent("tile-drawing",e.extend({tiledImage:i},t))}},e.extend(e.TiledImage.prototype,e.EventSource.prototype,{needsDraw:function(){return this._needsDraw},getFullyLoaded:function(){return this._fullyLoaded},_setFullyLoaded:function(e){e!==this._fullyLoaded&&(this._fullyLoaded=e,this.raiseEvent("fully-loaded-change",{fullyLoaded:this._fullyLoaded}))},reset:function(){this._tileCache.clearTilesFor(this),this.lastResetTime=e.now(),this._needsDraw=!0},update:function(){var e=this._xSpring.update(),t=this._ySpring.update(),i=this._scaleSpring.update(),n=this._degreesSpring.update();return!!(e||t||i||n)&&(this._updateForScale(),this._needsDraw=!0,!0)},draw:function(){0!==this.opacity||this._preload?(this._midDraw=!0,this._updateViewport(),this._midDraw=!1):this._needsDraw=!1},destroy:function(){this.reset(),this.source.destroy&&this.source.destroy()},getBounds:function(e){return this.getBoundsNoRotate(e).rotate(this.getRotation(e),this._getRotationPoint(e))},getBoundsNoRotate:function(t){return t?new e.Rect(this._xSpring.current.value,this._ySpring.current.value,this._worldWidthCurrent,this._worldHeightCurrent):new e.Rect(this._xSpring.target.value,this._ySpring.target.value,this._worldWidthTarget,this._worldHeightTarget)},getWorldBounds:function(){return e.console.error("[TiledImage.getWorldBounds] is deprecated; use TiledImage.getBounds instead"),this.getBounds()},getClippedBounds:function(t){var i=this.getBoundsNoRotate(t);if(this._clip){var n=(t?this._worldWidthCurrent:this._worldWidthTarget)/this.source.dimensions.x,r=this._clip.times(n);i=new e.Rect(i.x+r.x,i.y+r.y,r.width,r.height)}return i.rotate(this.getRotation(t),this._getRotationPoint(t))},getTileBounds:function(e,t,i){var n=this.source.getNumTiles(e),r=(n.x+t%n.x)%n.x,o=(n.y+i%n.y)%n.y,s=this.source.getTileBounds(e,r,o);return this.getFlip()&&(s.x=1-s.x-s.width),s.x+=(t-r)/n.x,s.y+=this._worldHeightCurrent/this._worldWidthCurrent*((i-o)/n.y),s},getContentSize:function(){return new e.Point(this.source.dimensions.x,this.source.dimensions.y)},getSizeInWindowCoordinates:function(){var t=this.imageToWindowCoordinates(new e.Point(0,0)),i=this.imageToWindowCoordinates(this.getContentSize());return new e.Point(i.x-t.x,i.y-t.y)},_viewportToImageDelta:function(t,i,n){var r=n?this._scaleSpring.current.value:this._scaleSpring.target.value;return new e.Point(t*(this.source.dimensions.x/r),i*(this.source.dimensions.y*this.contentAspectX/r))},viewportToImageCoordinates:function(t,i,n){var r;return t instanceof e.Point?(n=i,r=t):r=new e.Point(t,i),r=r.rotate(-this.getRotation(n),this._getRotationPoint(n)),n?this._viewportToImageDelta(r.x-this._xSpring.current.value,r.y-this._ySpring.current.value):this._viewportToImageDelta(r.x-this._xSpring.target.value,r.y-this._ySpring.target.value)},_imageToViewportDelta:function(t,i,n){var r=n?this._scaleSpring.current.value:this._scaleSpring.target.value;return new e.Point(t/this.source.dimensions.x*r,i/this.source.dimensions.y/this.contentAspectX*r)},imageToViewportCoordinates:function(t,i,n){t instanceof e.Point&&(n=i,i=t.y,t=t.x);var r=this._imageToViewportDelta(t,i);return n?(r.x+=this._xSpring.current.value,r.y+=this._ySpring.current.value):(r.x+=this._xSpring.target.value,r.y+=this._ySpring.target.value),r.rotate(this.getRotation(n),this._getRotationPoint(n))},imageToViewportRectangle:function(t,i,n,r,o){var s=t;s instanceof e.Rect?o=i:s=new e.Rect(t,i,n,r);var a=this.imageToViewportCoordinates(s.getTopLeft(),o),l=this._imageToViewportDelta(s.width,s.height,o);return new e.Rect(a.x,a.y,l.x,l.y,s.degrees+this.getRotation(o))},viewportToImageRectangle:function(t,i,n,r,o){var s=t;t instanceof e.Rect?o=i:s=new e.Rect(t,i,n,r);var a=this.viewportToImageCoordinates(s.getTopLeft(),o),l=this._viewportToImageDelta(s.width,s.height,o);return new e.Rect(a.x,a.y,l.x,l.y,s.degrees-this.getRotation(o))},viewerElementToImageCoordinates:function(e){var t=this.viewport.pointFromPixel(e,!0);return this.viewportToImageCoordinates(t)},imageToViewerElementCoordinates:function(e){var t=this.imageToViewportCoordinates(e);return this.viewport.pixelFromPoint(t,!0)},windowToImageCoordinates:function(e){var t=e.minus(s.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(t)},imageToWindowCoordinates:function(e){return this.imageToViewerElementCoordinates(e).plus(s.getElementPosition(this.viewer.element))},_viewportToTiledImageRectangle:function(t){var i=this._scaleSpring.current.value;return t=t.rotate(-this.getRotation(!0),this._getRotationPoint(!0)),new e.Rect((t.x-this._xSpring.current.value)/i,(t.y-this._ySpring.current.value)/i,t.width/i,t.height/i,t.degrees)},viewportToImageZoom:function(e){return this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x*e},imageToViewportZoom:function(e){return e/(this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x)},setPosition:function(e,t){var i=this._xSpring.target.value===e.x&&this._ySpring.target.value===e.y;if(t){if(i&&this._xSpring.current.value===e.x&&this._ySpring.current.value===e.y)return;this._xSpring.resetTo(e.x),this._ySpring.resetTo(e.y),this._needsDraw=!0}else{if(i)return;this._xSpring.springTo(e.x),this._ySpring.springTo(e.y),this._needsDraw=!0}i||this._raiseBoundsChange()},setWidth:function(e,t){this._setScale(e,t)},setHeight:function(e,t){this._setScale(e/this.normHeight,t)},setCroppingPolygons:function(t){var i=function(t){return t instanceof e.Point||"number"==typeof t.x&&"number"==typeof t.y},n=function(e){return e.map((function(e){try{if(i(e))return{x:e.x,y:e.y};throw new Error}catch(e){throw new Error("A Provided cropping polygon point is not supported")}}))};try{if(!e.isArray(t))throw new Error("Provided cropping polygon is not an array");this._croppingPolygons=t.map((function(e){return n(e)}))}catch(t){e.console.error("[TiledImage.setCroppingPolygons] Cropping polygon format not supported"),e.console.error(t),this._croppingPolygons=null}},resetCroppingPolygons:function(){this._croppingPolygons=null},fitBounds:function(t,i,n){i=i||e.Placement.CENTER;var r=e.Placement.properties[i],o=this.contentAspectX,s=0,a=0,l=1,c=1;if(this._clip&&(o=this._clip.getAspectRatio(),l=this._clip.width/this.source.dimensions.x,c=this._clip.height/this.source.dimensions.y,t.getAspectRatio()>o?(s=this._clip.x/this._clip.height*t.height,a=this._clip.y/this._clip.height*t.height):(s=this._clip.x/this._clip.width*t.width,a=this._clip.y/this._clip.width*t.width)),t.getAspectRatio()>o){var u=t.height/c,h=0;r.isHorizontallyCentered?h=(t.width-t.height*o)/2:r.isRight&&(h=t.width-t.height*o),this.setPosition(new e.Point(t.x-s+h,t.y-a),n),this.setHeight(u,n)}else{var d=t.width/l,p=0;r.isVerticallyCentered?p=(t.height-t.width/o)/2:r.isBottom&&(p=t.height-t.width/o),this.setPosition(new e.Point(t.x-s,t.y-a+p),n),this.setWidth(d,n)}},getClip:function(){return this._clip?this._clip.clone():null},setClip:function(t){e.console.assert(!t||t instanceof e.Rect,"[TiledImage.setClip] newClip must be an OpenSeadragon.Rect or null"),t instanceof e.Rect?this._clip=t.clone():this._clip=null,this._needsDraw=!0,this.raiseEvent("clip-change")},getFlip:function(){return!!this.flipped},setFlip:function(e){this.flipped=!!e,this._needsDraw=!0,this._raiseBoundsChange()},getOpacity:function(){return this.opacity},setOpacity:function(e){e!==this.opacity&&(this.opacity=e,this._needsDraw=!0,this.raiseEvent("opacity-change",{opacity:this.opacity}))},getPreload:function(){return this._preload},setPreload:function(e){this._preload=!!e,this._needsDraw=!0},getRotation:function(e){return e?this._degreesSpring.current.value:this._degreesSpring.target.value},setRotation:function(e,t){this._degreesSpring.target.value===e&&this._degreesSpring.isAtTargetValue()||(t?this._degreesSpring.resetTo(e):this._degreesSpring.springTo(e),this._needsDraw=!0,this._raiseBoundsChange())},_getRotationPoint:function(e){return this.getBoundsNoRotate(e).getCenter()},getCompositeOperation:function(){return this.compositeOperation},setCompositeOperation:function(e){e!==this.compositeOperation&&(this.compositeOperation=e,this._needsDraw=!0,this.raiseEvent("composite-operation-change",{compositeOperation:this.compositeOperation}))},_setScale:function(e,t){var i=this._scaleSpring.target.value===e;if(t){if(i&&this._scaleSpring.current.value===e)return;this._scaleSpring.resetTo(e),this._updateForScale(),this._needsDraw=!0}else{if(i)return;this._scaleSpring.springTo(e),this._updateForScale(),this._needsDraw=!0}i||this._raiseBoundsChange()},_updateForScale:function(){this._worldWidthTarget=this._scaleSpring.target.value,this._worldHeightTarget=this.normHeight*this._scaleSpring.target.value,this._worldWidthCurrent=this._scaleSpring.current.value,this._worldHeightCurrent=this.normHeight*this._scaleSpring.current.value},_raiseBoundsChange:function(){this.raiseEvent("bounds-change")},_isBottomItem:function(){return this.viewer.world.getItemAt(0)===this},_getLevelsInterval:function(){var e=Math.max(this.source.minLevel,Math.floor(Math.log(this.minZoomImageRatio)/Math.log(2))),t=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(0),!0).x*this._scaleSpring.current.value,i=Math.min(Math.abs(this.source.maxLevel),Math.abs(Math.floor(Math.log(t/this.minPixelRatio)/Math.log(2))));return i=Math.max(i,this.source.minLevel||0),{lowestLevel:e=Math.min(e,i),highestLevel:i}},_updateViewport:function(){for(this._needsDraw=!1,this._tilesLoading=0,this.loadingCoverage={};this.lastDrawn.length>0;){this.lastDrawn.pop().beingDrawn=!1}var i=this.viewport,n=this._viewportToTiledImageRectangle(i.getBoundsWithMargins(!0));if(!this.wrapHorizontal&&!this.wrapVertical){var o=this._viewportToTiledImageRectangle(this.getClippedBounds(!0));if(null===(n=n.intersection(o)))return}for(var s=this._getLevelsInterval(),a=s.lowestLevel,l=s.highestLevel,c=null,h=!1,d=e.now(),p=l;p>=a;p--){var f=!1,v=i.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(p),!0).x*this._scaleSpring.current.value;if(p===a||!h&&v>=this.minPixelRatio)f=!0,h=!0;else if(!h)continue;var m=i.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(p),!1).x*this._scaleSpring.current.value,y=i.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(Math.max(this.source.getClosestLevel(),0)),!1).x*this._scaleSpring.current.value,w=this.immediateRender?1:y;if(c=t(this,h,f,p,Math.min(1,(v-.5)/.5),w/Math.abs(w-m),n,d,c),u(this.coverage,p))break}g(this,this.lastDrawn),c&&!c.context2D?(r(this,c,d),this._needsDraw=!0,this._setFullyLoaded(!1)):this._setFullyLoaded(0===this._tilesLoading)},_getCornerTiles:function(t,i,n){var r,o,s,a;this.wrapHorizontal?(r=e.positiveModulo(i.x,1),o=e.positiveModulo(n.x,1)):(r=Math.max(0,i.x),o=Math.min(1,n.x));var l=1/this.source.aspectRatio;this.wrapVertical?(s=e.positiveModulo(i.y,l),a=e.positiveModulo(n.y,l)):(s=Math.max(0,i.y),a=Math.min(l,n.y));var c=this.source.getTileAtPoint(t,new e.Point(r,s)),u=this.source.getTileAtPoint(t,new e.Point(o,a)),h=this.source.getNumTiles(t);return this.wrapHorizontal&&(c.x+=h.x*Math.floor(i.x),u.x+=h.x*Math.floor(n.x)),this.wrapVertical&&(c.y+=h.y*Math.floor(i.y/l),u.y+=h.y*Math.floor(n.y/l)),{topLeft:c,bottomRight:u}}})}(s),function(e){var t=function(t){e.console.assert(t,"[TileCache.cacheTile] options is required"),e.console.assert(t.tile,"[TileCache.cacheTile] options.tile is required"),e.console.assert(t.tiledImage,"[TileCache.cacheTile] options.tiledImage is required"),this.tile=t.tile,this.tiledImage=t.tiledImage},i=function(t){e.console.assert(t,"[ImageRecord] options is required"),e.console.assert(t.image,"[ImageRecord] options.image is required"),this._image=t.image,this._tiles=[]};i.prototype={destroy:function(){this._image=null,this._renderedContext=null,this._tiles=null},getImage:function(){return this._image},getRenderedContext:function(){if(!this._renderedContext){var e=document.createElement("canvas");e.width=this._image.width,e.height=this._image.height,this._renderedContext=e.getContext("2d"),this._renderedContext.drawImage(this._image,0,0),this._image=null}return this._renderedContext},setRenderedContext:function(t){e.console.error("ImageRecord.setRenderedContext is deprecated. The rendered context should be created by the ImageRecord itself when calling ImageRecord.getRenderedContext."),this._renderedContext=t},addTile:function(t){e.console.assert(t,"[ImageRecord.addTile] tile is required"),this._tiles.push(t)},removeTile:function(t){for(var i=0;i<this._tiles.length;i++)if(this._tiles[i]===t)return void this._tiles.splice(i,1);e.console.warn("[ImageRecord.removeTile] trying to remove unknown tile",t)},getTileCount:function(){return this._tiles.length}},e.TileCache=function(t){t=t||{},this._maxImageCacheCount=t.maxImageCacheCount||e.DEFAULT_SETTINGS.maxImageCacheCount,this._tilesLoaded=[],this._imagesLoaded=[],this._imagesLoadedCount=0},e.TileCache.prototype={numTilesLoaded:function(){return this._tilesLoaded.length},cacheTile:function(n){e.console.assert(n,"[TileCache.cacheTile] options is required"),e.console.assert(n.tile,"[TileCache.cacheTile] options.tile is required"),e.console.assert(n.tile.cacheKey,"[TileCache.cacheTile] options.tile.cacheKey is required"),e.console.assert(n.tiledImage,"[TileCache.cacheTile] options.tiledImage is required");var r=n.cutoff||0,o=this._tilesLoaded.length,s=this._imagesLoaded[n.tile.cacheKey];if(s||(e.console.assert(n.image,"[TileCache.cacheTile] options.image is required to create an ImageRecord"),s=this._imagesLoaded[n.tile.cacheKey]=new i({image:n.image}),this._imagesLoadedCount++),s.addTile(n.tile),n.tile.cacheImageRecord=s,this._imagesLoadedCount>this._maxImageCacheCount){for(var a,l,c,u,h,d,p=null,f=-1,g=null,v=this._tilesLoaded.length-1;v>=0;v--)(a=(d=this._tilesLoaded[v]).tile).level<=r||a.beingDrawn||(p?(u=a.lastTouchTime,l=p.lastTouchTime,h=a.level,c=p.level,(u<l||u===l&&h>c)&&(p=a,f=v,g=d)):(p=a,f=v,g=d));p&&f>=0&&(this._unloadTile(g),o=f)}this._tilesLoaded[o]=new t({tile:n.tile,tiledImage:n.tiledImage})},clearTilesFor:function(t){var i;e.console.assert(t,"[TileCache.clearTilesFor] tiledImage is required");for(var n=0;n<this._tilesLoaded.length;++n)(i=this._tilesLoaded[n]).tiledImage===t&&(this._unloadTile(i),this._tilesLoaded.splice(n,1),n--)},getImageRecord:function(t){return e.console.assert(t,"[TileCache.getImageRecord] cacheKey is required"),this._imagesLoaded[t]},_unloadTile:function(t){e.console.assert(t,"[TileCache._unloadTile] tileRecord is required");var i=t.tile,n=t.tiledImage;i.unload(),i.cacheImageRecord=null;var r=this._imagesLoaded[i.cacheKey];r.removeTile(i),r.getTileCount()||(r.destroy(),delete this._imagesLoaded[i.cacheKey],this._imagesLoadedCount--),n.viewer.raiseEvent("tile-unloaded",{tile:i,tiledImage:n})}}}(s),function(e){e.World=function(t){var i=this;e.console.assert(t.viewer,"[World] options.viewer is required"),e.EventSource.call(this),this.viewer=t.viewer,this._items=[],this._needsDraw=!1,this._autoRefigureSizes=!0,this._needsSizesFigured=!1,this._delegatedFigureSizes=function(e){i._autoRefigureSizes?i._figureSizes():i._needsSizesFigured=!0},this._figureSizes()},e.extend(e.World.prototype,e.EventSource.prototype,{addItem:function(t,i){if(e.console.assert(t,"[World.addItem] item is required"),e.console.assert(t instanceof e.TiledImage,"[World.addItem] only TiledImages supported at this time"),void 0!==(i=i||{}).index){var n=Math.max(0,Math.min(this._items.length,i.index));this._items.splice(n,0,t)}else this._items.push(t);this._autoRefigureSizes?this._figureSizes():this._needsSizesFigured=!0,this._needsDraw=!0,t.addHandler("bounds-change",this._delegatedFigureSizes),t.addHandler("clip-change",this._delegatedFigureSizes),this.raiseEvent("add-item",{item:t})},getItemAt:function(t){return e.console.assert(void 0!==t,"[World.getItemAt] index is required"),this._items[t]},getIndexOfItem:function(t){return e.console.assert(t,"[World.getIndexOfItem] item is required"),e.indexOf(this._items,t)},getItemCount:function(){return this._items.length},setItemIndex:function(t,i){e.console.assert(t,"[World.setItemIndex] item is required"),e.console.assert(void 0!==i,"[World.setItemIndex] index is required");var n=this.getIndexOfItem(t);if(i>=this._items.length)throw new Error("Index bigger than number of layers.");i!==n&&-1!==n&&(this._items.splice(n,1),this._items.splice(i,0,t),this._needsDraw=!0,this.raiseEvent("item-index-change",{item:t,previousIndex:n,newIndex:i}))},removeItem:function(t){e.console.assert(t,"[World.removeItem] item is required");var i=e.indexOf(this._items,t);-1!==i&&(t.removeHandler("bounds-change",this._delegatedFigureSizes),t.removeHandler("clip-change",this._delegatedFigureSizes),t.destroy(),this._items.splice(i,1),this._figureSizes(),this._needsDraw=!0,this._raiseRemoveItem(t))},removeAll:function(){var e,t;for(this.viewer._cancelPendingImages(),t=0;t<this._items.length;t++)(e=this._items[t]).removeHandler("bounds-change",this._delegatedFigureSizes),e.removeHandler("clip-change",this._delegatedFigureSizes),e.destroy();var i=this._items;for(this._items=[],this._figureSizes(),this._needsDraw=!0,t=0;t<i.length;t++)e=i[t],this._raiseRemoveItem(e)},resetItems:function(){for(var e=0;e<this._items.length;e++)this._items[e].reset()},update:function(){for(var e=!1,t=0;t<this._items.length;t++)e=this._items[t].update()||e;return e},draw:function(){for(var e=0;e<this._items.length;e++)this._items[e].draw();this._needsDraw=!1},needsDraw:function(){for(var e=0;e<this._items.length;e++)if(this._items[e].needsDraw())return!0;return this._needsDraw},getHomeBounds:function(){return this._homeBounds.clone()},getContentFactor:function(){return this._contentFactor},setAutoRefigureSizes:function(e){this._autoRefigureSizes=e,e&this._needsSizesFigured&&(this._figureSizes(),this._needsSizesFigured=!1)},arrange:function(t){var i,n=(t=t||{}).immediately||!1,r=t.layout||e.DEFAULT_SETTINGS.collectionLayout,o=t.rows||e.DEFAULT_SETTINGS.collectionRows,s=t.columns||e.DEFAULT_SETTINGS.collectionColumns,a=t.tileSize||e.DEFAULT_SETTINGS.collectionTileSize,l=a+(t.tileMargin||e.DEFAULT_SETTINGS.collectionTileMargin);i=!t.rows&&s?s:Math.ceil(this._items.length/o);var c,u,h,d,p,f=0,g=0;this.setAutoRefigureSizes(!1);for(var v=0;v<this._items.length;v++)v&&v%i==0&&("horizontal"===r?(g+=l,f=0):(f+=l,g=0)),d=(h=(u=(c=this._items[v]).getBounds()).width>u.height?a:a*(u.width/u.height))*(u.height/u.width),p=new e.Point(f+(a-h)/2,g+(a-d)/2),c.setPosition(p,n),c.setWidth(h,n),"horizontal"===r?f+=l:g+=l;this.setAutoRefigureSizes(!0)},_figureSizes:function(){var t=this._homeBounds?this._homeBounds.clone():null,i=this._contentSize?this._contentSize.clone():null,n=this._contentFactor||0;if(this._items.length){var r=this._items[0],o=r.getBounds();this._contentFactor=r.getContentSize().x/o.width;for(var s=r.getClippedBounds().getBoundingBox(),a=s.x,l=s.y,c=s.x+s.width,u=s.y+s.height,h=1;h<this._items.length;h++)o=(r=this._items[h]).getBounds(),this._contentFactor=Math.max(this._contentFactor,r.getContentSize().x/o.width),s=r.getClippedBounds().getBoundingBox(),a=Math.min(a,s.x),l=Math.min(l,s.y),c=Math.max(c,s.x+s.width),u=Math.max(u,s.y+s.height);this._homeBounds=new e.Rect(a,l,c-a,u-l),this._contentSize=new e.Point(this._homeBounds.width*this._contentFactor,this._homeBounds.height*this._contentFactor)}else this._homeBounds=new e.Rect(0,0,1,1),this._contentSize=new e.Point(1,1),this._contentFactor=1;this._contentFactor===n&&this._homeBounds.equals(t)&&this._contentSize.equals(i)||this.raiseEvent("metrics-change",{})},_raiseRemoveItem:function(e){this.raiseEvent("remove-item",{item:e})}})}(s)},ab36:function(e,t,i){var n=i("861d"),r=i("9112");e.exports=function(e,t){n(t)&&"cause"in t&&r(e,"cause",t.cause)}},aeb0:function(e,t,i){var n=i("9bf2").f;e.exports=function(e,t,i){i in e||n(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})}},aed9:function(e,t,i){var n=i("83ab"),r=i("d039");e.exports=n&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},b42e:function(e,t){var i=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var t=+e;return(t>0?n:i)(t)}},b50d:function(e,t,i){var n=i("c532"),r=i("467f"),o=i("7aac"),s=i("30b5"),a=i("83b9"),l=i("c345"),c=i("3934"),u=i("cafa"),h=i("7917"),d=i("fb60"),p=i("b68a");e.exports=function(e){return new Promise((function(t,i){var f,g=e.data,v=e.headers,m=e.responseType;function y(){e.cancelToken&&e.cancelToken.unsubscribe(f),e.signal&&e.signal.removeEventListener("abort",f)}n.isFormData(g)&&n.isStandardBrowserEnv()&&delete v["Content-Type"];var w=new XMLHttpRequest;if(e.auth){var x=e.auth.username||"",b=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";v.Authorization="Basic "+btoa(x+":"+b)}var _=a(e.baseURL,e.url);function T(){if(w){var n="getAllResponseHeaders"in w?l(w.getAllResponseHeaders()):null,o={data:m&&"text"!==m&&"json"!==m?w.response:w.responseText,status:w.status,statusText:w.statusText,headers:n,config:e,request:w};r((function(e){t(e),y()}),(function(e){i(e),y()}),o),w=null}}if(w.open(e.method.toUpperCase(),s(_,e.params,e.paramsSerializer),!0),w.timeout=e.timeout,"onloadend"in w?w.onloadend=T:w.onreadystatechange=function(){w&&4===w.readyState&&(0!==w.status||w.responseURL&&0===w.responseURL.indexOf("file:"))&&setTimeout(T)},w.onabort=function(){w&&(i(new h("Request aborted",h.ECONNABORTED,e,w)),w=null)},w.onerror=function(){i(new h("Network Error",h.ERR_NETWORK,e,w,w)),w=null},w.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||u;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),i(new h(t,n.clarifyTimeoutError?h.ETIMEDOUT:h.ECONNABORTED,e,w)),w=null},n.isStandardBrowserEnv()){var S=(e.withCredentials||c(_))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;S&&(v[e.xsrfHeaderName]=S)}"setRequestHeader"in w&&n.forEach(v,(function(e,t){void 0===g&&"content-type"===t.toLowerCase()?delete v[t]:w.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(w.withCredentials=!!e.withCredentials),m&&"json"!==m&&(w.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&w.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&w.upload&&w.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(f=function(e){w&&(i(!e||e&&e.type?new d:e),w.abort(),w=null)},e.cancelToken&&e.cancelToken.subscribe(f),e.signal&&(e.signal.aborted?f():e.signal.addEventListener("abort",f))),g||(g=null);var E=p(_);E&&-1===["http","https","file"].indexOf(E)?i(new h("Unsupported protocol "+E+":",h.ERR_BAD_REQUEST,e)):w.send(g)}))}},b622:function(e,t,i){var n=i("da84"),r=i("5692"),o=i("1a2d"),s=i("90e3"),a=i("4930"),l=i("fdbf"),c=r("wks"),u=n.Symbol,h=u&&u.for,d=l?u:u&&u.withoutSetter||s;e.exports=function(e){if(!o(c,e)||!a&&"string"!=typeof c[e]){var t="Symbol."+e;a&&o(u,e)?c[e]=u[e]:c[e]=l&&h?h(t):d(t)}return c[e]}},b639:function(e,t,i){(function(e){
|
|
21
|
+
/*!
|
|
22
|
+
* The buffer module from node.js, for the browser.
|
|
23
|
+
*
|
|
24
|
+
* @author Feross Aboukhadijeh <http://feross.org>
|
|
25
|
+
* @license MIT
|
|
26
|
+
*/
|
|
27
|
+
var n=i("1fb5"),r=i("9152"),o=i("e3db");function s(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,i){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return u(this,e,t,i)}function u(e,t,i,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?v(e,t,i,n):"string"==typeof t?f(e,t,i):m(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t,i,n){return h(t),t<=0?l(e,t):void 0!==i?"string"==typeof n?l(e,t).fill(i,n):l(e,t).fill(i):l(e,t)}function p(e,t){if(h(t),e=l(e,t<0?0:0|y(t)),!c.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function f(e,t,i){if("string"==typeof i&&""!==i||(i="utf8"),!c.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|x(t,i),r=(e=l(e,n)).write(t,i);return r!==n&&(e=e.slice(0,r)),e}function g(e,t){var i=t.length<0?0:0|y(t.length);e=l(e,i);for(var n=0;n<i;n+=1)e[n]=255&t[n];return e}function v(e,t,i,n){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===i&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,i):new Uint8Array(t,i,n),c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=g(e,t),e}function m(e,t){if(c.isBuffer(t)){var i=0|y(t.length);return 0===(e=l(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||te(t.length)?l(e,0):g(e,t);if("Buffer"===t.type&&o(t.data))return g(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function y(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function w(e){return+e!=e&&(e=0),c.alloc(+e)}function x(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return J(e).length;default:if(n)return Y(e).length;t=(""+t).toLowerCase(),n=!0}}function b(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,i);case"utf8":case"utf-8":return D(this,t,i);case"ascii":return H(this,t,i);case"latin1":case"binary":return M(this,t,i);case"base64":return I(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function _(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function T(e,t,i,n,r){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:S(e,t,i,n,r);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):S(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function S(e,t,i,n,r){var o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,i/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(r){var u=-1;for(o=i;o<a;o++)if(c(e,o)===c(t,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===l)return u*s}else-1!==u&&(o-=o-u),u=-1}else for(i+l>a&&(i=a-l),o=i;o>=0;o--){for(var h=!0,d=0;d<l;d++)if(c(e,o+d)!==c(t,d)){h=!1;break}if(h)return o}return-1}function E(e,t,i,n){i=Number(i)||0;var r=e.length-i;n?(n=Number(n))>r&&(n=r):n=r;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[i+s]=a}return s}function P(e,t,i,n){return ee(Y(t,e.length-i),e,i,n)}function C(e,t,i,n){return ee(K(t),e,i,n)}function R(e,t,i,n){return C(e,t,i,n)}function k(e,t,i,n){return ee(J(t),e,i,n)}function O(e,t,i,n){return ee(Q(t,e.length-i),e,i,n)}function I(e,t,i){return 0===t&&i===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,i))}function D(e,t,i){i=Math.min(e.length,i);for(var n=[],r=t;r<i;){var o,s,a,l,c=e[r],u=null,h=c>239?4:c>223?3:c>191?2:1;if(r+h<=i)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(o=e[r+1]))&&((l=(31&c)<<6|63&o)>127&&(u=l));break;case 3:o=e[r+1],s=e[r+2],128==(192&o)&&128==(192&s)&&((l=(15&c)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(u=l));break;case 4:o=e[r+1],s=e[r+2],a=e[r+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((l=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(u=l))}null===u?(u=65533,h=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),r+=h}return L(n)}t.Buffer=c,t.SlowBuffer=w,t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:s(),t.kMaxLength=a(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,i){return u(null,e,t,i)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,i){return d(null,e,t,i)},c.allocUnsafe=function(e){return p(null,e)},c.allocUnsafeSlow=function(e){return p(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,r=0,o=Math.min(i,n);r<o;++r)if(e[r]!==t[r]){i=e[r],n=t[r];break}return i<n?-1:n<i?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=c.allocUnsafe(t),r=0;for(i=0;i<e.length;++i){var s=e[i];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,r),r+=s.length}return n},c.byteLength=x,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)_(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)_(this,t,t+3),_(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)_(this,t,t+7),_(this,t+1,t+6),_(this,t+2,t+5),_(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?D(this,0,e):b.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,t,i,n,r){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return-1;if(t>=i)return 1;if(this===e)return 0;for(var o=(r>>>=0)-(n>>>=0),s=(i>>>=0)-(t>>>=0),a=Math.min(o,s),l=this.slice(n,r),u=e.slice(t,i),h=0;h<a;++h)if(l[h]!==u[h]){o=l[h],s=u[h];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},c.prototype.indexOf=function(e,t,i){return T(this,e,t,i,!0)},c.prototype.lastIndexOf=function(e,t,i){return T(this,e,t,i,!1)},c.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-t;if((void 0===i||i>r)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return E(this,e,t,i);case"utf8":case"utf-8":return P(this,e,t,i);case"ascii":return C(this,e,t,i);case"latin1":case"binary":return R(this,e,t,i);case"base64":return k(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function L(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);for(var i="",n=0;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=A));return i}function H(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(127&e[r]);return n}function M(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}function B(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var r="",o=t;o<i;++o)r+=X(e[o]);return r}function $(e,t,i){for(var n=e.slice(t,i),r="",o=0;o<n.length;o+=2)r+=String.fromCharCode(n[o]+256*n[o+1]);return r}function F(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,i,n,r,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function z(e,t,i,n){t<0&&(t=65535+t+1);for(var r=0,o=Math.min(e.length-i,2);r<o;++r)e[i+r]=(t&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function V(e,t,i,n){t<0&&(t=4294967295+t+1);for(var r=0,o=Math.min(e.length-i,4);r<o;++r)e[i+r]=t>>>8*(n?r:3-r)&255}function j(e,t,i,n,r,o){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function U(e,t,i,n,o){return o||j(e,t,i,4),r.write(e,t,i,n,23,4),i+4}function W(e,t,i,n,o){return o||j(e,t,i,8),r.write(e,t,i,n,52,8),i+8}c.prototype.slice=function(e,t){var i,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=c.prototype;else{var r=t-e;i=new c(r,void 0);for(var o=0;o<r;++o)i[o]=this[o+e]}return i},c.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||F(e,t,this.length);for(var n=this[e],r=1,o=0;++o<t&&(r*=256);)n+=this[e+o]*r;return n},c.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||F(e,t,this.length);for(var n=this[e+--t],r=1;t>0&&(r*=256);)n+=this[e+--t]*r;return n},c.prototype.readUInt8=function(e,t){return t||F(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||F(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||F(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||F(e,t,this.length);for(var n=this[e],r=1,o=0;++o<t&&(r*=256);)n+=this[e+o]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||F(e,t,this.length);for(var n=t,r=1,o=this[e+--n];n>0&&(r*=256);)o+=this[e+--n]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||F(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},c.prototype.readInt16BE=function(e,t){t||F(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},c.prototype.readInt32LE=function(e,t){return t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||F(e,4,this.length),r.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||F(e,4,this.length),r.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||F(e,8,this.length),r.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||F(e,8,this.length),r.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,i,n){(e=+e,t|=0,i|=0,n)||N(this,e,t,i,Math.pow(2,8*i)-1,0);var r=1,o=0;for(this[t]=255&e;++o<i&&(r*=256);)this[t+o]=e/r&255;return t+i},c.prototype.writeUIntBE=function(e,t,i,n){(e=+e,t|=0,i|=0,n)||N(this,e,t,i,Math.pow(2,8*i)-1,0);var r=i-1,o=1;for(this[t+r]=255&e;--r>=0&&(o*=256);)this[t+r]=e/o&255;return t+i},c.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||N(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||N(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||N(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||N(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):V(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||N(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):V(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);N(this,e,t,i,r-1,-r)}var o=0,s=1,a=0;for(this[t]=255&e;++o<i&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+i},c.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);N(this,e,t,i,r-1,-r)}var o=i-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+i},c.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||N(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||N(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||N(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||N(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):V(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):V(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,i){return U(this,e,t,!0,i)},c.prototype.writeFloatBE=function(e,t,i){return U(this,e,t,!1,i)},c.prototype.writeDoubleLE=function(e,t,i){return W(this,e,t,!0,i)},c.prototype.writeDoubleBE=function(e,t,i){return W(this,e,t,!1,i)},c.prototype.copy=function(e,t,i,n){if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var r,o=n-i;if(this===e&&i<t&&t<n)for(r=o-1;r>=0;--r)e[r+t]=this[r+i];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(r=0;r<o;++r)e[r+t]=this[r+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+o),t);return o},c.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var o;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(o=t;o<i;++o)this[o]=e;else{var s=c.isBuffer(e)?e:Y(new c(e,n).toString()),a=s.length;for(o=0;o<i-t;++o)this[o+t]=s[o%a]}return this};var G=/[^+\/0-9A-Za-z-_]/g;function q(e){if((e=Z(e).replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function Z(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function X(e){return e<16?"0"+e.toString(16):e.toString(16)}function Y(e,t){var i;t=t||1/0;for(var n=e.length,r=null,o=[],s=0;s<n;++s){if((i=e.charCodeAt(s))>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function K(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}function Q(e,t){for(var i,n,r,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(i=e.charCodeAt(s))>>8,r=i%256,o.push(r),o.push(n);return o}function J(e){return n.toByteArray(q(e))}function ee(e,t,i,n){for(var r=0;r<n&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}function te(e){return e!=e}}).call(this,i("c8ba"))},b68a:function(e,t,i){e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},b980:function(e,t,i){var n=i("d039"),r=i("5c6c");e.exports=!n((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",r(1,7)),7!==e.stack)}))},bc3a:function(e,t,i){e.exports=i("cee4")},c04e:function(e,t,i){var n=i("c65b"),r=i("861d"),o=i("d9b5"),s=i("dc4a"),a=i("485a"),l=i("b622"),c=TypeError,u=l("toPrimitive");e.exports=function(e,t){if(!r(e)||o(e))return e;var i,l=s(e,u);if(l){if(void 0===t&&(t="default"),i=n(l,e,t),!r(i)||o(i))return i;throw c("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},c345:function(e,t,i){var n=i("c532"),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,i,o,s={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),i=n.trim(e.substr(o+1)),t){if(s[t]&&r.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([i]):s[t]?s[t]+", "+i:i}})),s):s}},c401:function(e,t,i){var n=i("c532"),r=i("4c3d");e.exports=function(e,t,i){var o=this||r;return n.forEach(i,(function(i){e=i.call(o,e,t)})),e}},c430:function(e,t){e.exports=!1},c532:function(e,t,i){var n=i("1d2b"),r=Object.prototype.toString,o=function(e){return function(t){var i=r.call(t);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())}}(Object.create(null));function s(e){return e=e.toLowerCase(),function(t){return o(t)===e}}function a(e){return Array.isArray(e)}function l(e){return void 0===e}function c(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var u=s("ArrayBuffer");function h(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&u(e.buffer)}function d(e){return"string"==typeof e}function p(e){return"number"==typeof e}function f(e){return null!==e&&"object"==typeof e}function g(e){if("object"!==o(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var v=s("Date"),m=s("File"),y=s("Blob"),w=s("FileList");function x(e){return"[object Function]"===r.call(e)}function b(e){return f(e)&&x(e.pipe)}function _(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||r.call(e)===t||x(e.toString)&&e.toString()===t)}var T=s("URLSearchParams");function S(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function E(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document}function P(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),a(e))for(var i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(null,e[r],r,e)}function C(){var e={};function t(t,i){g(e[i])&&g(t)?e[i]=C(e[i],t):g(t)?e[i]=C({},t):a(t)?e[i]=t.slice():e[i]=t}for(var i=0,n=arguments.length;i<n;i++)P(arguments[i],t);return e}function R(e,t,i){return P(t,(function(t,r){e[r]=i&&"function"==typeof t?n(t,i):t})),e}function k(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}function O(e,t,i,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,i&&Object.assign(e.prototype,i)}function I(e,t,i){var n,r,o,s={};t=t||{};do{for(r=(n=Object.getOwnPropertyNames(e)).length;r-- >0;)s[o=n[r]]||(t[o]=e[o],s[o]=!0);e=Object.getPrototypeOf(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype);return t}function D(e,t,i){e=String(e),(void 0===i||i>e.length)&&(i=e.length),i-=t.length;var n=e.indexOf(t,i);return-1!==n&&n===i}function A(e){if(!e)return null;var t=e.length;if(l(t))return null;for(var i=new Array(t);t-- >0;)i[t]=e[t];return i}var L=function(e){return function(t){return e&&t instanceof e}}("undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array));e.exports={isArray:a,isArrayBuffer:u,isBuffer:c,isFormData:_,isArrayBufferView:h,isString:d,isNumber:p,isObject:f,isPlainObject:g,isUndefined:l,isDate:v,isFile:m,isBlob:y,isFunction:x,isStream:b,isURLSearchParams:T,isStandardBrowserEnv:E,forEach:P,merge:C,extend:R,trim:S,stripBOM:k,inherits:O,toFlatObject:I,kindOf:o,kindOfTest:s,endsWith:D,toArray:A,isTypedArray:L,isFileList:w}},c65b:function(e,t,i){var n=i("40d5"),r=Function.prototype.call;e.exports=n?r.bind(r):function(){return r.apply(r,arguments)}},c6b6:function(e,t,i){var n=i("e330"),r=n({}.toString),o=n("".slice);e.exports=function(e){return o(r(e),8,-1)}},c6cd:function(e,t,i){var n=i("da84"),r=i("6374"),o="__core-js_shared__",s=n[o]||r(o,{});e.exports=s},c770:function(e,t,i){var n=i("e330"),r=Error,o=n("".replace),s=String(r("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,l=a.test(s);e.exports=function(e,t){if(l&&"string"==typeof e&&!r.prepareStackTrace)for(;t--;)e=o(e,a,"");return e}},c8af:function(e,t,i){var n=i("c532");e.exports=function(e,t){n.forEach(e,(function(i,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=i,delete e[n])}))}},c8ba:function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},ca84:function(e,t,i){var n=i("e330"),r=i("1a2d"),o=i("fc6a"),s=i("4d64").indexOf,a=i("d012"),l=n([].push);e.exports=function(e,t){var i,n=o(e),c=0,u=[];for(i in n)!r(a,i)&&r(n,i)&&l(u,i);for(;t.length>c;)r(n,i=t[c++])&&(~s(u,i)||l(u,i));return u}},cafa:function(e,t,i){e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},cb2d:function(e,t,i){var n=i("1626"),r=i("9bf2"),o=i("13d2"),s=i("6374");e.exports=function(e,t,i,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:t;if(n(i)&&o(i,c,a),a.global)l?e[t]=i:s(t,i);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=i:r.f(e,t,{value:i,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},cc12:function(e,t,i){var n=i("da84"),r=i("861d"),o=n.document,s=r(o)&&r(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},cee4:function(e,t,i){var n=i("c532"),r=i("1d2b"),o=i("0a06"),s=i("4a7b");function a(e){var t=new o(e),i=r(o.prototype.request,t);return n.extend(i,o.prototype,t),n.extend(i,t),i.create=function(t){return a(s(e,t))},i}var l=a(i("4c3d"));l.Axios=o,l.CanceledError=i("fb60"),l.CancelToken=i("8df4"),l.isCancel=i("2e67"),l.VERSION=i("5cce").version,l.toFormData=i("e467"),l.AxiosError=i("7917"),l.Cancel=l.CanceledError,l.all=function(e){return Promise.all(e)},l.spread=i("0df6"),l.isAxiosError=i("5f02"),e.exports=l,e.exports.default=l},d012:function(e,t){e.exports={}},d039:function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},d066:function(e,t,i){var n=i("da84"),r=i("1626"),o=function(e){return r(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(n[e]):n[e]&&n[e][t]}},d1e7:function(e,t,i){var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},d2bb:function(e,t,i){var n=i("e330"),r=i("825a"),o=i("3bbe");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return r(i),o(n),t?e(i,n):i.__proto__=n,i}}():void 0)},d925:function(e,t,i){e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},d9b5:function(e,t,i){var n=i("d066"),r=i("1626"),o=i("3a9b"),s=i("fdbf"),a=Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return r(t)&&o(t.prototype,a(e))}},d9e2:function(e,t,i){var n=i("23e7"),r=i("da84"),o=i("2ba4"),s=i("e5cb"),a="WebAssembly",l=r[a],c=7!==Error("e",{cause:7}).cause,u=function(e,t){var i={};i[e]=s(e,t,c),n({global:!0,constructor:!0,arity:1,forced:c},i)},h=function(e,t){if(l&&l[e]){var i={};i[e]=s(a+"."+e,t,c),n({target:a,stat:!0,constructor:!0,arity:1,forced:c},i)}};u("Error",(function(e){return function(t){return o(e,this,arguments)}})),u("EvalError",(function(e){return function(t){return o(e,this,arguments)}})),u("RangeError",(function(e){return function(t){return o(e,this,arguments)}})),u("ReferenceError",(function(e){return function(t){return o(e,this,arguments)}})),u("SyntaxError",(function(e){return function(t){return o(e,this,arguments)}})),u("TypeError",(function(e){return function(t){return o(e,this,arguments)}})),u("URIError",(function(e){return function(t){return o(e,this,arguments)}})),h("CompileError",(function(e){return function(t){return o(e,this,arguments)}})),h("LinkError",(function(e){return function(t){return o(e,this,arguments)}})),h("RuntimeError",(function(e){return function(t){return o(e,this,arguments)}}))},da84:function(e,t,i){(function(t){var i=function(e){return e&&e.Math==Math&&e};e.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,i("c8ba"))},dc4a:function(e,t,i){var n=i("59ed");e.exports=function(e,t){var i=e[t];return null==i?void 0:n(i)}},df7c:function(e,t,i){(function(e){function i(e,t){for(var i=0,n=e.length-1;n>=0;n--){var r=e[n];"."===r?e.splice(n,1):".."===r?(e.splice(n,1),i++):i&&(e.splice(n,1),i--)}if(t)for(;i--;i)e.unshift("..");return e}function n(e){"string"!=typeof e&&(e+="");var t,i=0,n=-1,r=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!r){i=t+1;break}}else-1===n&&(r=!1,n=t+1);return-1===n?"":e.slice(i,n)}function r(e,t){if(e.filter)return e.filter(t);for(var i=[],n=0;n<e.length;n++)t(e[n],n,e)&&i.push(e[n]);return i}t.resolve=function(){for(var t="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var s=o>=0?arguments[o]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(t=s+"/"+t,n="/"===s.charAt(0))}return(n?"/":"")+(t=i(r(t.split("/"),(function(e){return!!e})),!n).join("/"))||"."},t.normalize=function(e){var n=t.isAbsolute(e),s="/"===o(e,-1);return(e=i(r(e.split("/"),(function(e){return!!e})),!n).join("/"))||n||(e="."),e&&s&&(e+="/"),(n?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,i){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var i=e.length-1;i>=0&&""===e[i];i--);return t>i?[]:e.slice(t,i-t+1)}e=t.resolve(e).substr(1),i=t.resolve(i).substr(1);for(var r=n(e.split("/")),o=n(i.split("/")),s=Math.min(r.length,o.length),a=s,l=0;l<s;l++)if(r[l]!==o[l]){a=l;break}var c=[];for(l=a;l<r.length;l++)c.push("..");return(c=c.concat(o.slice(a))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),i=47===t,n=-1,r=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!r){n=o;break}}else r=!1;return-1===n?i?"/":".":i&&1===n?"/":e.slice(0,n)},t.basename=function(e,t){var i=n(e);return t&&i.substr(-1*t.length)===t&&(i=i.substr(0,i.length-t.length)),i},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,i=0,n=-1,r=!0,o=0,s=e.length-1;s>=0;--s){var a=e.charCodeAt(s);if(47!==a)-1===n&&(r=!1,n=s+1),46===a?-1===t?t=s:1!==o&&(o=1):-1!==t&&(o=-1);else if(!r){i=s+1;break}}return-1===t||-1===n||0===o||1===o&&t===n-1&&t===i+1?"":e.slice(t,n)};var o="b"==="ab".substr(-1)?function(e,t,i){return e.substr(t,i)}:function(e,t,i){return t<0&&(t=e.length+t),e.substr(t,i)}}).call(this,i("4362"))},e330:function(e,t,i){var n=i("40d5"),r=Function.prototype,o=r.bind,s=r.call,a=n&&o.bind(s,s);e.exports=n?function(e){return e&&a(e)}:function(e){return e&&function(){return s.apply(e,arguments)}}},e391:function(e,t,i){var n=i("577e");e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},e3db:function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},e467:function(e,t,i){(function(t){var n=i("c532");function r(e,i){i=i||new FormData;var r=[];function o(e){return null===e?"":n.isDate(e)?e.toISOString():n.isArrayBuffer(e)||n.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):t.from(e):e}function s(e,t){if(n.isPlainObject(e)||n.isArray(e)){if(-1!==r.indexOf(e))throw Error("Circular reference detected in "+t);r.push(e),n.forEach(e,(function(e,r){if(!n.isUndefined(e)){var a,l=t?t+"."+r:r;if(e&&!t&&"object"==typeof e)if(n.endsWith(r,"{}"))e=JSON.stringify(e);else if(n.endsWith(r,"[]")&&(a=n.toArray(e)))return void a.forEach((function(e){!n.isUndefined(e)&&i.append(l,o(e))}));s(e,l)}})),r.pop()}else i.append(t,o(e))}return s(e),i}e.exports=r}).call(this,i("b639").Buffer)},e5cb:function(e,t,i){var n=i("d066"),r=i("1a2d"),o=i("9112"),s=i("3a9b"),a=i("d2bb"),l=i("e893"),c=i("aeb0"),u=i("7156"),h=i("e391"),d=i("ab36"),p=i("c770"),f=i("b980"),g=i("83ab"),v=i("c430");e.exports=function(e,t,i,m){var y="stackTraceLimit",w=m?2:1,x=e.split("."),b=x[x.length-1],_=n.apply(null,x);if(_){var T=_.prototype;if(!v&&r(T,"cause")&&delete T.cause,!i)return _;var S=n("Error"),E=t((function(e,t){var i=h(m?t:e,void 0),n=m?new _(e):new _;return void 0!==i&&o(n,"message",i),f&&o(n,"stack",p(n.stack,2)),this&&s(T,this)&&u(n,this,E),arguments.length>w&&d(n,arguments[w]),n}));if(E.prototype=T,"Error"!==b?a?a(E,S):l(E,S,{name:!0}):g&&y in _&&(c(E,_,y),c(E,_,"prepareStackTrace")),l(E,_),!v)try{T.name!==b&&o(T,"name",b),T.constructor=E}catch(e){}return E}}},e683:function(e,t,i){e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},e893:function(e,t,i){var n=i("1a2d"),r=i("56ef"),o=i("06cf"),s=i("9bf2");e.exports=function(e,t,i){for(var a=r(t),l=s.f,c=o.f,u=0;u<a.length;u++){var h=a[u];n(e,h)||i&&n(i,h)||l(e,h,c(t,h))}}},f5df:function(e,t,i){var n=i("00ee"),r=i("1626"),o=i("c6b6"),s=i("b622")("toStringTag"),a=Object,l="Arguments"==o(function(){return arguments}()),c=function(e,t){try{return e[t]}catch(e){}};e.exports=n?o:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=c(t=a(e),s))?i:l?o(t):"Object"==(n=o(t))&&r(t.callee)?"Arguments":n}},f675:function(e,t,i){},f6b4:function(e,t,i){var n=i("c532");function r(){this.handlers=[]}r.prototype.use=function(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=r},f772:function(e,t,i){var n=i("5692"),r=i("90e3"),o=n("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},fb60:function(e,t,i){var n=i("7917");function r(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}i("c532").inherits(r,n,{__CANCEL__:!0}),e.exports=r},fc6a:function(e,t,i){var n=i("44ad"),r=i("1d80");e.exports=function(e){return n(r(e))}},fdbf:function(e,t,i){var n=i("4930");e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}});class o extends(e(t)){static get properties(){return Object.assign({manifest:{type:String}},super.properties)}constructor(){super(),this.cssPath="../css/tify",this._initialPages=null}async connectedCallback(){super.connectedCallback(),r(this.cssPath),this.subscribeTo("pb-load-facsimile",e=>{e.detail&&e.detail.order&&this._tify&&(this._setPage?this._setPage(parseInt(e.detail.order,10)):this._initialPages=parseInt(e.detail.order,10))})}firstUpdated(){super.firstUpdated(),i("pb-page-ready",()=>{this._tify=new Tify({manifestUrl:this.toAbsoluteURL(this.manifest,this.getEndpoint())}),this._tify.ready.then(()=>{this.signalReady(),this._tify.setPage(this._initialPages);const{app:e}=this._tify;this._setPage=e.setPage,e.setPage=t=>{const i=Array.isArray(t)?t[0]:t,n=e.$root.canvases[i-1];this._switchPage(n),this._setPage(t)}});const e=document.createElement("div");e.style.height="100%",e.style.width="100%",this.appendChild(e),this._tify.mount(e)})}_switchPage(e){const t=e["https://teipublisher.com/page"];t&&(console.log("<pb-tify> page changed, emitting refresh with params %o",t),this.emitTo("pb-refresh",t))}createRenderRoot(){return this}}customElements.define("pb-tify",o);export{o as PbTify};
|