UNPKG

@tindtechnologies/universalviewer

Version:

The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎

2 lines 160 kB
import{a as Qt,c as At,e as Rt,f as Mt,g as wt}from"./chunk-UYLDA6E6.js";import{a as yt,b as R,d as Y,g as St,j as ft,k as Ot,l as D,m as lt,n as Lt,o as G,p as b}from"./chunk-2YE6NNA6.js";import{b as V,e as F,g as w}from"./chunk-R6HAKAEO.js";import{b as jt,c as et}from"./chunk-YAXTLTJC.js";var Vt=jt((at,Tt)=>{(function(o,i){typeof at=="object"&&typeof Tt=="object"?Tt.exports=i():typeof define=="function"&&define.amd?define("IIIFMetadataComponent",[],i):typeof at=="object"?at.IIIFMetadataComponent=i():o.IIIFMetadataComponent=i()})(typeof self!="undefined"?self:at,function(){return function(o){var i={};function l(u){if(i[u])return i[u].exports;var c=i[u]={i:u,l:!1,exports:{}};return o[u].call(c.exports,c,c.exports,l),c.l=!0,c.exports}return l.m=o,l.c=i,l.d=function(u,c,p){l.o(u,c)||Object.defineProperty(u,c,{enumerable:!0,get:p})},l.r=function(u){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},l.t=function(u,c){if(1&c&&(u=l(u)),8&c||4&c&&typeof u=="object"&&u&&u.__esModule)return u;var p=Object.create(null);if(l.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:u}),2&c&&typeof u!="string")for(var s in u)l.d(p,s,function(v){return u[v]}.bind(null,s));return p},l.n=function(u){var c=u&&u.__esModule?function(){return u.default}:function(){return u};return l.d(c,"a",c),c},l.o=function(u,c){return Object.prototype.hasOwnProperty.call(u,c)},l.p="",l(l.s=0)}([function(o,i,l){o.exports=l(1)},function(o,i,l){"use strict";var u,c=this&&this.__extends||(u=function(h,e){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(h,e)},function(h,e){function t(){this.constructor=h}u(h,e),h.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)});Object.defineProperty(i,"__esModule",{value:!0});var p,s=l(2),v=l(3),m=l(4);(function(h){h.LINES="lines",h.CHARS="chars"})(p=i.LimitType||(i.LimitType={}));var a=function(h){function e(t){var n=h.call(this,t)||this;return n._data=n.data(),n._data=n.options.data,n._init(),n._resize(),n}return c(e,h),e.prototype._init=function(){return h.prototype._init.call(this),this._$element=$(this.el),this._$metadataGroupTemplate=$('<div class="group"> <div class="header"></div> <div class="items"></div> </div>'),this._$metadataItemTemplate=$('<div class="item"> <div class="label"></div> <div class="values"></div> </div>'),this._$metadataItemValueTemplate=$('<div class="value"></div>'),this._$metadataItemURIValueTemplate=$('<a class="value" href="" target="_blank"></a>'),this._$copyTextTemplate=$('<div class="copyText" alt="'+this.options.data.content.copyToClipboard+'" title="'+this.options.data.content.copyToClipboard+'"> <div class="copiedText">'+this.options.data.content.copiedToClipboard+" </div> </div>"),this._$metadataGroups=$('<div class="groups"></div>'),this._$element.append(this._$metadataGroups),this._$noData=$('<div class="noData">'+this.options.data.content.noData+"</div>"),this._$element.append(this._$noData),!0},e.prototype.data=function(){return{aggregateValues:"",canvases:null,canvasDisplayOrder:"",metadataGroupOrder:"",canvasExclude:"",canvasLabels:"",content:{attribution:"Attribution",canvasHeader:"About the canvas",copiedToClipboard:"Copied to clipboard",copyToClipboard:"Copy to clipboard",description:"Description",imageHeader:"About the image",less:"less",license:"License",logo:"Logo",manifestHeader:"About the item",more:"more",noData:"No data to display",rangeHeader:"About the range",sequenceHeader:"About the sequence"},copiedMessageDuration:2e3,copyToClipboardEnabled:!1,helper:null,licenseFormatter:null,limit:4,limitType:p.LINES,limitToRange:!1,manifestDisplayOrder:"",manifestExclude:"",range:null,rtlLanguageCodes:"ar, ara, dv, div, he, heb, ur, urd",sanitizer:function(t){return t},showAllLanguages:!1}},e.prototype._getManifestGroup=function(){return this._metadataGroups.filter(function(t){return t.resource.isManifest()})[0]},e.prototype._getCanvasGroups=function(){return this._metadataGroups.filter(function(t){return t.resource.isCanvas()})},e.prototype.set=function(t){var n=this;if(this._data=Object.assign(this._data,t),this._data&&this._data.helper){var r,d={canvases:this._data.canvases,licenseFormatter:this._data.licenseFormatter,range:this._data.range};if(this._metadataGroups=this._data.helper.getMetadata(d),this._data.manifestDisplayOrder&&((r=this._getManifestGroup()).items=this._sortItems(r.items,this._readCSV(this._data.manifestDisplayOrder))),this._data.canvasDisplayOrder&&this._getCanvasGroups().forEach(function(x,y){x.items=n._sortItems(x.items,n._readCSV(n._data.canvasDisplayOrder))}),this._data.metadataGroupOrder&&(this._metadataGroups=this._sortGroups(this._metadataGroups,this._readCSV(this._data.metadataGroupOrder))),this._data.canvasLabels&&this._label(this._getCanvasGroups(),this._readCSV(this._data.canvasLabels,!1)),this._data.manifestExclude&&((r=this._getManifestGroup()).items=this._exclude(r.items,this._readCSV(this._data.manifestExclude))),this._data.canvasExclude&&this._getCanvasGroups().forEach(function(x,y){x.items=n._exclude(x.items,n._readCSV(n._data.canvasExclude))}),this._data.limitToRange){var E=[];this._metadataGroups.forEach(function(x,y){x.resource.isRange()&&E.push(x)}),E.length&&(this._metadataGroups=E)}this._render()}},e.prototype._sortItems=function(t,n){var r=this,d=[],E=t.slice(0);return n.forEach(function(x,y){var L=E.filter(function(T){return r._normalise(T.getLabel())===x})[0];if(L){d.push(L);var S=E.indexOf(L);S>-1&&E.splice(S,1)}}),E.forEach(function(x,y){d.push(x)}),d},e.prototype._sortGroups=function(t,n){var r=[],d=t.slice(0);return n.forEach(function(E,x){var y=d.filter(function(S){return S.resource.getIIIFResourceType().toLowerCase()==E.toLowerCase()})[0];if(y){r.push(y);var L=d.indexOf(y);L>-1&&d.splice(L,1)}}),r},e.prototype._label=function(t,n){t.forEach(function(r,d){r.label=n[d]})},e.prototype._exclude=function(t,n){var r=this;return n.forEach(function(d,E){var x=t.filter(function(L){return r._normalise(L.getLabel())===d})[0];if(x){var y=t.indexOf(x);y>-1&&t.splice(y,1)}}),t},e.prototype._normalise=function(t){return t?t.toLowerCase().replace(/ /g,""):null},e.prototype._render=function(){var t=this;this._metadataGroups.length?(this._$noData.hide(),this._$metadataGroups.empty(),this._metadataGroups.forEach(function(n,r){var d=t._buildMetadataGroup(n);t._$metadataGroups.append(d);var E=d.find(".value");t._data.limit&&t._data.content&&(t._data.limitType===p.LINES?E.toggleExpandTextByLines(t._data.limit,t._data.content.less,t._data.content.more,function(){}):t._data.limitType===p.CHARS&&E.ellipsisHtmlFixed(t._data.limit,function(){}))})):this._$noData.show()},e.prototype._buildMetadataGroup=function(t){var n=this._$metadataGroupTemplate.clone(),r=n.find(">.header");if(this._data.content){if(t.resource.isManifest()&&this._data.content.manifestHeader)(E=this._sanitize(this._data.content.manifestHeader))&&r.html(E);else if(t.resource.isSequence()&&this._data.content.sequenceHeader)(E=this._sanitize(this._data.content.sequenceHeader))&&r.html(E);else if(t.resource.isRange()&&this._data.content.rangeHeader)(E=this._sanitize(this._data.content.rangeHeader))&&r.html(E);else if(t.resource.isCanvas()&&(t.label||this._data.content.canvasHeader)){var d=t.label||this._data.content.canvasHeader;r.html(this._sanitize(d))}else if(t.resource.isAnnotation()&&this._data.content.imageHeader){var E;(E=this._sanitize(this._data.content.imageHeader))&&r.html(E)}}r.text()||r.hide();for(var x=n.find(".items"),y=0;y<t.items.length;y++){var L=t.items[y],S=this._buildMetadataItem(L);x.append(S)}return n},e.prototype._buildMetadataItem=function(t){var n,r=this._$metadataItemTemplate.clone(),d=r.find(".label"),E=r.find(".values"),x=t.getLabel(),y=x,L=new RegExp("/w+:(/?/?)[^s]+/gm","i");if(this._data.content&&y&&t.isRootLevel)switch(y.toLowerCase()){case"attribution":y=this._data.content.attribution;break;case"description":y=this._data.content.description;break;case"license":y=this._data.content.license;break;case"logo":y=this._data.content.logo}if(y=this._sanitize(y),d.html(y),this._addReadingDirection(d,this._getLabelLocale(t)),r.addClass(m.Strings.toCssClass(y)),x&&x.toLowerCase()==="license"&&L.exec(t.value[0].value)!==null)n=this._buildMetadataItemURIValue(t.value[0].value),E.append(n);else if(this._data.showAllLanguages&&t.value&&t.value.length>1)for(var S=0;S<t.value.length;S++){var T=t.value[S];n=this._buildMetadataItemValue(T.value,T.locale),E.append(n)}else{var I=this._getValueLocale(t),g=!1;for(S=0;S<t.value.length;S++){var T=t.value[S];I.toLowerCase()===T.locale.toLowerCase()&&(g=!0,n=this._buildMetadataItemValue(T.value,T.locale),E.append(n))}g||(T=t.value[0])&&(n=this._buildMetadataItemValue(T.value,T.locale),E.append(n))}this._data.copyToClipboardEnabled&&m.Clipboard.supportsCopy()&&d.text()&&this._addCopyButton(r,d,E);var _=this;return r.on("click","a.iiif-viewer-link",function(C){C.preventDefault();var O=$(C.target),A=O.attr("data-uv-navigate")||O.prop("href");_.fire(f.IIIF_VIEWER_LINK_CLICKED,A)}),r.on("click","[data-uv-navigate]",function(C){C.preventDefault();var O=$(C.target).attr("data-uv-navigate")||null;O&&_.fire(f.IIIF_VIEWER_LINK_CLICKED,O)}),r},e.prototype._getLabelLocale=function(t){if(!this._data||!this._data.helper)return"";var n=this._data.helper.options.locale;if(t.label.length){var r=t.label[0].locale;if(r.toLowerCase()!==n.toLowerCase())return r}return n},e.prototype._getValueLocale=function(t){return this._data&&this._data.helper?this._data.helper.options.locale:""},e.prototype._buildMetadataItemValue=function(t,n){t=(t=this._sanitize(t)).replace(` `,"<br>");var r=this._$metadataItemValueTemplate.clone();return r.html(t),r.find("a").each(function(){var d=$(this);d.hasClass("iiif-viewer-link")||d.prop("target","_blank")}),n&&this._addReadingDirection(r,n),r},e.prototype._buildMetadataItemURIValue=function(t){t=this._sanitize(t);var n=this._$metadataItemURIValueTemplate.clone();return n.prop("href",t),n.text(t),n},e.prototype._addReadingDirection=function(t,n){n=s.Utils.getInexactLocale(n),this._readCSV(this._data.rtlLanguageCodes).filter(function(r){return r===n}).length>0&&(t.prop("dir","rtl"),t.addClass("rtl"))},e.prototype._addCopyButton=function(t,n,r){var d=this._$copyTextTemplate.clone(),E=d.children();n.append(d),m.Device.isTouch()?d.show():(t.on("mouseenter",function(){d.show()}),t.on("mouseleave",function(){d.hide()}),d.on("mouseleave",function(){E.hide()}));var x=this,y=r.text();d.on("click",function(L){x._copyItemValues(d,y)})},e.prototype._copyItemValues=function(t,n){m.Clipboard.copy(n);var r=t.find(".copiedText");r.show(),setTimeout(function(){r.hide()},this._data.copiedMessageDuration)},e.prototype._readCSV=function(t,n){n===void 0&&(n=!0);var r=[];if(t&&(r=t.split(","),n))for(var d=0;d<r.length;d++)r[d]=this._normalise(r[d]);return r},e.prototype._sanitize=function(t){return this._data.sanitizer?this._data.sanitizer(t):null},e.prototype._resize=function(){},e}(v.BaseComponent);i.MetadataComponent=a;var f=function(){function h(){}return h.IIIF_VIEWER_LINK_CLICKED="iiifViewerLinkClicked",h}();i.Events=f},function(o,i,l){o.exports=function(u){var c={};function p(s){if(c[s])return c[s].exports;var v=c[s]={i:s,l:!1,exports:{}};return u[s].call(v.exports,v,v.exports,p),v.l=!0,v.exports}return p.m=u,p.c=c,p.d=function(s,v,m){p.o(s,v)||Object.defineProperty(s,v,{enumerable:!0,get:m})},p.r=function(s){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},p.t=function(s,v){if(1&v&&(s=p(s)),8&v||4&v&&typeof s=="object"&&s&&s.__esModule)return s;var m=Object.create(null);if(p.r(m),Object.defineProperty(m,"default",{enumerable:!0,value:s}),2&v&&typeof s!="string")for(var a in s)p.d(m,a,function(f){return s[f]}.bind(null,a));return m},p.n=function(s){var v=s&&s.__esModule?function(){return s.default}:function(){return s};return p.d(v,"a",v),v},p.o=function(s,v){return Object.prototype.hasOwnProperty.call(s,v)},p.p="",p(p.s=4)}([function(u,c,p){"use strict";function s(v){for(var m in v)c.hasOwnProperty(m)||(c[m]=v[m])}Object.defineProperty(c,"__esModule",{value:!0}),s(p(6)),s(p(7)),s(p(8)),s(p(9)),s(p(10)),s(p(11)),s(p(12)),s(p(13)),s(p(14)),s(p(15)),s(p(16)),s(p(17)),s(p(18)),s(p(19)),s(p(20)),s(p(21)),s(p(22)),s(p(23)),s(p(24)),s(p(25)),s(p(26)),s(p(27)),s(p(28)),s(p(29)),s(p(30)),s(p(31)),s(p(32)),s(p(2))},function(u,c,p){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),function(s){s.BOOKMARKING="oa:bookmarking",s.CLASSIFYING="oa:classifying",s.COMMENTING="oa:commenting",s.DESCRIBING="oa:describing",s.EDITING="oa:editing",s.HIGHLIGHTING="oa:highlighting",s.IDENTIFYING="oa:identifying",s.LINKING="oa:linking",s.MODERATING="oa:moderating",s.PAINTING="sc:painting",s.QUESTIONING="oa:questioning",s.REPLYING="oa:replying",s.TAGGING="oa:tagging",s.TRANSCRIBING="oad:transcribing"}(c.AnnotationMotivation||(c.AnnotationMotivation={})),function(s){s.AUTO_ADVANCE="auto-advance",s.CONTINUOUS="continuous",s.FACING_PAGES="facing-pages",s.HIDDEN="hidden",s.INDIVIDUALS="individuals",s.MULTI_PART="multi-part",s.NO_NAV="no-nav",s.NON_PAGED="non-paged",s.PAGED="paged",s.REPEAT="repeat",s.SEQUENCE="sequence",s.THUMBNAIL_NAV="thumbnail-nav",s.TOGETHER="together",s.UNORDERED="unordered"}(c.Behavior||(c.Behavior={})),function(s){s.CANVAS="canvas",s.CHOICE="choice",s.CONTENT_AS_TEXT="contentastext",s.DOCUMENT="document",s.IMAGE="image",s.MOVING_IMAGE="movingimage",s.PDF="pdf",s.PHYSICAL_OBJECT="physicalobject",s.SOUND="sound",s.TEXTUALBODY="textualbody",s.VIDEO="video"}(c.ExternalResourceType||(c.ExternalResourceType={})),function(s){s.ANNOTATION="annotation",s.CANVAS="canvas",s.COLLECTION="collection",s.MANIFEST="manifest",s.RANGE="range",s.SEQUENCE="sequence"}(c.IIIFResourceType||(c.IIIFResourceType={})),function(s){s.AUDIO_MP4="audio/mp4",s.CORTO="application/corto",s.DRACO="application/draco",s.GLTF="model/gltf+json",s.JPG="image/jpeg",s.M3U8="application/vnd.apple.mpegurl",s.MP3="audio/mp3",s.MPEG_DASH="application/dash+xml",s.OBJ="text/plain",s.PDF="application/pdf",s.PLY="application/ply",s.THREEJS="application/vnd.threejs+json",s.VIDEO_MP4="video/mp4",s.WEBM="video/webm"}(c.MediaType||(c.MediaType={})),function(s){s.DOC="application/msword",s.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",s.PDF="application/pdf"}(c.RenderingFormat||(c.RenderingFormat={})),function(s){s.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",s.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",s.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",s.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",s.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",s.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",s.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",s.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",s.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",s.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",s.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",s.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",s.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",s.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",s.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",s.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",s.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",s.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",s.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",s.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",s.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",s.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",s.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",s.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",s.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",s.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",s.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",s.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",s.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",s.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",s.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",s.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",s.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",s.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",s.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",s.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",s.SEARCH_0="http://iiif.io/api/search/0/search",s.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",s.SEARCH_1="http://iiif.io/api/search/1/search",s.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",s.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",s.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",s.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",s.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",s.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",s.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"}(c.ServiceProfile||(c.ServiceProfile={})),function(s){s.BOTTOM_TO_TOP="bottom-to-top",s.LEFT_TO_RIGHT="left-to-right",s.RIGHT_TO_LEFT="right-to-left",s.TOP_TO_BOTTOM="top-to-bottom"}(c.ViewingDirection||(c.ViewingDirection={})),function(s){s.CONTINUOUS="continuous",s.INDIVIDUALS="individuals",s.NON_PAGED="non-paged",s.PAGED="paged",s.TOP="top"}(c.ViewingHint||(c.ViewingHint={}))},function(u,c,p){"use strict";var s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(d,E){function x(S){try{L(r.next(S))}catch(T){E(T)}}function y(S){try{L(r.throw(S))}catch(T){E(T)}}function L(S){var T;S.done?d(S.value):(T=S.value,T instanceof n?T:new n(function(I){I(T)})).then(x,y)}L((r=r.apply(e,t||[])).next())})},v=this&&this.__generator||function(e,t){var n,r,d,E,x={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return E={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function y(L){return function(S){return function(T){if(n)throw new TypeError("Generator is already executing.");for(;x;)try{if(n=1,r&&(d=2&T[0]?r.return:T[0]?r.throw||((d=r.return)&&d.call(r),0):r.next)&&!(d=d.call(r,T[1])).done)return d;switch(r=0,d&&(T=[2&T[0],d.value]),T[0]){case 0:case 1:d=T;break;case 4:return x.label++,{value:T[1],done:!1};case 5:x.label++,r=T[1],T=[0];continue;case 7:T=x.ops.pop(),x.trys.pop();continue;default:if(!(d=(d=x.trys).length>0&&d[d.length-1])&&(T[0]===6||T[0]===2)){x=0;continue}if(T[0]===3&&(!d||T[1]>d[0]&&T[1]<d[3])){x.label=T[1];break}if(T[0]===6&&x.label<d[1]){x.label=d[1],d=T;break}if(d&&x.label<d[2]){x.label=d[2],x.ops.push(T);break}d[2]&&x.ops.pop(),x.trys.pop();continue}T=t.call(e,x)}catch(I){T=[6,I],r=0}finally{n=d=0}if(5&T[0])throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}([L,S])}}};Object.defineProperty(c,"__esModule",{value:!0});var m=p(0),a=p(1),f=p(33);p(34);var h=function(){function e(){}return e.getMediaType=function(t){return(t=(t=t.toLowerCase()).split(";")[0]).trim()},e.getImageQuality=function(t){return t===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||t===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||t===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||t===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||t===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||t===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||t===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||t===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||t===a.ServiceProfile.IMAGE_1_LEVEL_1||t===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||t===a.ServiceProfile.IMAGE_1_LEVEL_2||t===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2?"native":"default"},e.getInexactLocale=function(t){return t.indexOf("-")!==-1?t.substr(0,t.indexOf("-")):t},e.getLocalisedValue=function(t,n){if(!Array.isArray(t))return t;for(var r=0;r<t.length;r++){var d=t[r];if(n===d["@language"])return d["@value"]}var E=n.substr(0,n.indexOf("-"));for(r=0;r<t.length;r++){var x=t[r];if(x["@language"]===E)return x["@value"]}return null},e.generateTreeNodeIds=function(t,n){var r;n===void 0&&(n=0),r=t.parentNode?t.parentNode.id+"-"+n:"0",t.id=r;for(var d=0;d<t.nodes.length;d++){var E=t.nodes[d];e.generateTreeNodeIds(E,d)}},e.normaliseType=function(t){return(t=t.toLowerCase()).indexOf(":")!==-1?t.split(":")[1]:t},e.normaliseUrl=function(t){return(t=t.substr(t.indexOf("://"))).indexOf("#")!==-1&&(t=t.split("#")[0]),t},e.normalisedUrlsMatch=function(t,n){return e.normaliseUrl(t)===e.normaliseUrl(n)},e.isImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.isLevel0ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0))},e.isLevel1ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1))},e.isLevel2ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.parseManifest=function(t,n){return m.Deserialiser.parse(t,n)},e.checkStatus=function(t){if(t.ok)return t;var n=new Error(t.statusText);return n.response=t,Promise.reject(n)},e.loadManifest=function(t){return new Promise(function(n){fetch(t).then(e.checkStatus).then(function(r){return r.json()}).then(function(r){n(r)})})},e.loadExternalResourcesAuth1=function(t,n,r,d,E,x,y,L){return new Promise(function(S,T){var I=t.map(function(g){return e.loadExternalResourceAuth1(g,n,r,d,E,x,y,L)});Promise.all(I).then(function(){S(t)}).catch(function(g){T(g)})})},e.loadExternalResourceAuth1=function(t,n,r,d,E,x,y,L){return s(this,void 0,void 0,function(){var S;return v(this,function(T){switch(T.label){case 0:return[4,d(t)];case 1:return(S=T.sent())?[4,t.getData(S)]:[3,6];case 2:return T.sent(),t.status!==f.OK?[3,3]:[2,t];case 3:return[4,e.doAuthChain(t,n,r,E,x,y,L)];case 4:T.sent(),T.label=5;case 5:if(t.status===f.OK||t.status===f.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError();case 6:return[4,t.getData()];case 7:return T.sent(),t.status!==f.MOVED_TEMPORARILY&&t.status!==f.UNAUTHORIZED?[3,9]:[4,e.doAuthChain(t,n,r,E,x,y,L)];case 8:T.sent(),T.label=9;case 9:if(t.status===f.OK||t.status===f.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError()}})})},e.doAuthChain=function(t,n,r,d,E,x,y){return s(this,void 0,void 0,function(){var L,S,T,I,g,_,C,O;return v(this,function(A){switch(A.label){case 0:return t.isAccessControlled()?((L=t.externalService)&&(L.options=t.options),(S=t.kioskService)&&(S.options=t.options),(T=t.clickThroughService)&&(T.options=t.options),(I=t.loginService)&&(I.options=t.options),t.isResponseHandled||t.status!==f.MOVED_TEMPORARILY?[3,2]:[4,x(t)]):[2,t];case 1:return A.sent(),[2,t];case 2:return g=null,_=null,(g=L)?(_=g,[4,e.attemptResourceWithToken(t,r,g)]):[3,4];case 3:return A.sent(),[2,t];case 4:return(g=S)?(_=g,(C=n(g))?[4,d(C)]:[3,7]):[3,7];case 5:return A.sent(),[4,e.attemptResourceWithToken(t,r,g)];case 6:return A.sent(),[2,t];case 7:return(g=T)?(_=g,[4,E(t,g)]):[3,11];case 8:return(O=A.sent())?[4,d(O)]:[3,11];case 9:return A.sent(),[4,e.attemptResourceWithToken(t,r,g)];case 10:return A.sent(),[2,t];case 11:return(g=I)?(_=g,[4,E(t,g)]):[3,15];case 12:return(O=A.sent())?[4,d(O)]:[3,15];case 13:return A.sent(),[4,e.attemptResourceWithToken(t,r,g)];case 14:return A.sent(),[2,t];case 15:return _&&y(t,_),[2]}})})},e.attemptResourceWithToken=function(t,n,r){return s(this,void 0,void 0,function(){var d,E;return v(this,function(x){switch(x.label){case 0:return(d=r.getService(a.ServiceProfile.AUTH_1_TOKEN))?[4,n(t,d)]:[3,3];case 1:return(E=x.sent())&&E.accessToken?[4,t.getData(E)]:[3,3];case 2:return x.sent(),[2,t];case 3:return[2]}})})},e.loadExternalResourcesAuth09=function(t,n,r,d,E,x,y,L,S,T){return new Promise(function(I,g){var _=t.map(function(C){return e.loadExternalResourceAuth09(C,n,r,d,E,x,y,L,S,T)});Promise.all(_).then(function(){I(t)}).catch(function(C){g(C)})})},e.loadExternalResourceAuth09=function(t,n,r,d,E,x,y,L,S,T){return new Promise(function(I,g){T&&T.pessimisticAccessControl?t.getData().then(function(){t.isAccessControlled()?t.clickThroughService?(I(r(t)),I(d(t))):E(t).then(function(){x(t,!0).then(function(_){t.getData(_).then(function(){I(S(t))}).catch(function(C){g(e.createInternalServerError(C))})}).catch(function(_){g(e.createInternalServerError(_))})}).catch(function(_){g(e.createInternalServerError(_))}):I(t)}).catch(function(_){g(e.createInternalServerError(_))}):L(t,n).then(function(_){_?t.getData(_).then(function(){t.status===f.OK?I(S(t)):e.authorize(t,n,r,d,E,x,y,L).then(function(){I(S(t))}).catch(function(C){g(e.createAuthorizationFailedError())})}).catch(function(C){g(e.createAuthorizationFailedError())}):e.authorize(t,n,r,d,E,x,y,L).then(function(){I(S(t))}).catch(function(C){g(e.createAuthorizationFailedError())})}).catch(function(_){g(e.createAuthorizationFailedError())})})},e.createError=function(t,n){var r=new Error;return r.message=n,r.name=String(t),r},e.createAuthorizationFailedError=function(){return e.createError(m.StatusCode.AUTHORIZATION_FAILED,"Authorization failed")},e.createRestrictedError=function(){return e.createError(m.StatusCode.RESTRICTED,"Restricted")},e.createInternalServerError=function(t){return e.createError(m.StatusCode.INTERNAL_SERVER_ERROR,t)},e.authorize=function(t,n,r,d,E,x,y,L){return new Promise(function(S,T){t.getData().then(function(){t.isAccessControlled()?L(t,n).then(function(I){I?t.getData(I).then(function(){t.status===f.OK?S(t):e.showAuthInteraction(t,n,r,d,E,x,y,S,T)}).catch(function(g){T(e.createInternalServerError(g))}):x(t,!1).then(function(g){g?y(t,g,n).then(function(){t.getData(g).then(function(){t.status===f.OK?S(t):e.showAuthInteraction(t,n,r,d,E,x,y,S,T)}).catch(function(_){T(e.createInternalServerError(_))})}).catch(function(_){T(e.createInternalServerError(_))}):e.showAuthInteraction(t,n,r,d,E,x,y,S,T)})}).catch(function(I){T(e.createInternalServerError(I))}):S(t)})})},e.showAuthInteraction=function(t,n,r,d,E,x,y,L,S){t.status!==f.MOVED_TEMPORARILY||t.isResponseHandled?t.clickThroughService&&!t.isResponseHandled?r(t).then(function(){x(t,!0).then(function(T){y(t,T,n).then(function(){t.getData(T).then(function(){L(t)}).catch(function(I){S(e.createInternalServerError(I))})}).catch(function(I){S(e.createInternalServerError(I))})}).catch(function(T){S(e.createInternalServerError(T))})}):E(t).then(function(){x(t,!0).then(function(T){y(t,T,n).then(function(){t.getData(T).then(function(){L(t)}).catch(function(I){S(e.createInternalServerError(I))})}).catch(function(I){S(e.createInternalServerError(I))})}).catch(function(T){S(e.createInternalServerError(T))})}):L(t)},e.getService=function(t,n){for(var r=this.getServices(t),d=0;d<r.length;d++){var E=r[d];if(E.getProfile()===n)return E}return null},e.getResourceById=function(t,n){return e.traverseAndFind(t.__jsonld,"@id",n)},e.traverseAndFind=function(t,n,r){if(t.hasOwnProperty(n)&&t[n]===r)return t;for(var d=0;d<Object.keys(t).length;d++)if(typeof t[Object.keys(t)[d]]=="object"){var E=e.traverseAndFind(t[Object.keys(t)[d]],n,r);if(E!=null)return E}},e.getServices=function(t){var n,r=[];if(!(n=t.__jsonld?t.__jsonld.service:t.service))return r;Array.isArray(n)||(n=[n]);for(var d=0;d<n.length;d++){var E=n[d];if(typeof E=="string"){var x=this.getResourceById(t.options.resource,E);x&&r.push(new m.Service(x.__jsonld||x,t.options))}else r.push(new m.Service(E,t.options))}return r},e.getTemporalComponent=function(t){var n=/t=([^&]+)/g.exec(t),r=null;return n&&n[1]&&(r=n[1].split(",")),r},e}();c.Utils=h},function(u,c,p){"use strict";p.r(c),c.default=function(s,v){return v=v||{},new Promise(function(m,a){var f=new XMLHttpRequest,h=[],e=[],t={},n=function(){return{ok:(f.status/100|0)==2,statusText:f.statusText,status:f.status,url:f.responseURL,text:function(){return Promise.resolve(f.responseText)},json:function(){return Promise.resolve(JSON.parse(f.responseText))},blob:function(){return Promise.resolve(new Blob([f.response]))},clone:n,headers:{keys:function(){return h},entries:function(){return e},get:function(d){return t[d.toLowerCase()]},has:function(d){return d.toLowerCase()in t}}}};for(var r in f.open(v.method||"get",s,!0),f.onload=function(){f.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(d,E,x){h.push(E=E.toLowerCase()),e.push([E,x]),t[E]=t[E]?t[E]+","+x:x}),m(n())},f.onerror=a,f.withCredentials=v.credentials=="include",v.headers)f.setRequestHeader(r,v.headers[r]);f.send(v.body||null)})}},function(u,c,p){u.exports=p(5)},function(u,c,p){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),function(v){for(var m in v)c.hasOwnProperty(m)||(c[m]=v[m])}(p(0));var s=p(2);c.loadManifest=function(v){return s.Utils.loadManifest(v)},c.parseManifest=function(v,m){return s.Utils.parseManifest(v,m)}},function(u,c,p){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var s=function(){function v(m){this.__jsonld=m,this.context=this.getProperty("context"),this.id=this.getProperty("id")}return v.prototype.getProperty=function(m){var a=null;return this.__jsonld&&((a=this.__jsonld[m])||(a=this.__jsonld["@"+m])),a},v}();c.JSONLDResource=s},function(u,c,p){"use strict";var s,v=this&&this.__extends||(s=function(h,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(h,e)},function(h,e){function t(){this.constructor=h}s(h,e),h.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)});Object.defineProperty(c,"__esModule",{value:!0});var m=p(0),a=p(1),f=function(h){function e(t,n){var r=h.call(this,t)||this;return r.options=n,r}return v(e,h),e.prototype.getIIIFResourceType=function(){return m.Utils.normaliseType(this.getProperty("type"))},e.prototype.getLabel=function(){var t=this.getProperty("label");return t?m.LanguageMap.parse(t,this.options.locale):[]},e.prototype.getDefaultLabel=function(){return m.LanguageMap.getValue(this.getLabel())},e.prototype.getMetadata=function(){var t=this.getProperty("metadata"),n=[];if(!t)return n;for(var r=0;r<t.length;r++){var d=t[r],E=new m.LabelValuePair(this.options.locale);E.parse(d),n.push(E)}return n},e.prototype.getRendering=function(t){for(var n=this.getRenderings(),r=0;r<n.length;r++){var d=n[r];if(d.getFormat()===t)return d}return null},e.prototype.getRenderings=function(){var t,n=[];if(!(t=this.__jsonld?this.__jsonld.rendering:this.rendering))return n;Array.isArray(t)||(t=[t]);for(var r=0;r<t.length;r++){var d=t[r];n.push(new m.Rendering(d,this.options))}return n},e.prototype.getService=function(t){return m.Utils.getService(this,t)},e.prototype.getServices=function(){return m.Utils.getServices(this)},e.prototype.getThumbnail=function(){var t=this.getProperty("thumbnail");return Array.isArray(t)&&(t=t[0]),t?new m.Thumbnail(t,this.options):null},e.prototype.isAnnotation=function(){return this.getIIIFResourceType()===a.IIIFResourceType.ANNOTATION},e.prototype.isCanvas=function(){return this.getIIIFResourceType()===a.IIIFResourceType.CANVAS},e.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},e.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},e.prototype.isRange=function(){return this.getIIIFResourceType()===a.IIIFResourceType.RANGE},e.prototype.isSequence=function(){return this.getIIIFResourceType()===a.IIIFResourceType.SEQUENCE},e}(m.JSONLDResource);c.ManifestResource=f},function(u,c,p){"use strict";var s,v=this&&this.__extends||(s=function(f,h){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(f,h)},function(f,h){function e(){this.constructor=f}s(f,h),f.prototype=h===null?Object.create(h):(e.prototype=h.prototype,new e)});Object.defineProperty(c,"__esModule",{value:!0});var m=p(0),a=function(f){function h(e,t){return f.call(this,e,t)||this}return v(h,f),h.prototype.getFormat=function(){var e=this.getProperty("format");return e?e.toLowerCase():null},h.prototype.getResources=function(){var e=[];if(!this.__jsonld.resources)return e;for(var t=0;t<this.__jsonld.resources.length;t++){var n=this.__jsonld.resources[t],r=new m.Annotation(n,this.options);e.push(r)}return e},h.prototype.getType=function(){var e=this.getProperty("type");return e?m.Utils.normaliseType(e):null},h.prototype.getWidth=function(){return this.getProperty("width")},h.prototype.getHeight=function(){return this.getProperty("height")},h.prototype.getMaxWidth=function(){return this.getProperty("maxWidth")},h.prototype.getMaxHeight=function(){return this.getProperty("maxHeight")?null:this.getMaxWidth()},h}(m.ManifestResource);c.Resource=a},function(u,c,p){"use strict";var s,v=this&&this.__extends||(s=function(h,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(h,e)},function(h,e){function t(){this.constructor=h}s(h,e),h.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)});Object.defineProperty(c,"__esModule",{value:!0});var m=p(0),a=p(1),f=function(h){function e(t,n){var r=h.call(this,t,n)||this;r.index=-1,r.isLoaded=!1;var d={defaultLabel:"-",locale:"en-GB",resource:r,pessimisticAccessControl:!1};return r.options=Object.assign(d,n),r}return v(e,h),e.prototype.getAttribution=function(){var t=this.getProperty("attribution");return t?m.LanguageMap.parse(t,this.options.locale):[]},e.prototype.getDescription=function(){var t=this.getProperty("description");return t?m.LanguageMap.parse(t,this.options.locale):[]},e.prototype.getIIIFResourceType=function(){return m.Utils.normaliseType(this.getProperty("type"))},e.prototype.getLogo=function(){var t=this.getProperty("logo");return t?typeof t=="string"?t:(Array.isArray(t)&&t.length&&(t=t[0]),t["@id"]||t.id):null},e.prototype.getLicense=function(){return m.Utils.getLocalisedValue(this.getProperty("license"),this.options.locale)},e.prototype.getNavDate=function(){return new Date(this.getProperty("navDate"))},e.prototype.getRelated=function(){return this.getProperty("related")},e.prototype.getSeeAlso=function(){return this.getProperty("seeAlso")},e.prototype.getTrackingLabel=function(){var t=this.getService(a.ServiceProfile.TRACKING_EXTENSIONS);return t?t.getProperty("trackingLabel"):""},e.prototype.getDefaultTree=function(){return this.defaultTree=new m.TreeNode("root"),this.defaultTree.data=this,this.defaultTree},e.prototype.getRequiredStatement=function(){var t=null,n=this.getProperty("requiredStatement");if(n)(t=new m.LabelValuePair(this.options.locale)).parse(n);else{var r=this.getAttribution();r&&((t=new m.LabelValuePair(this.options.locale)).value=r)}return t},e.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},e.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},e.prototype.load=function(){var t=this;return new Promise(function(n){if(t.isLoaded)n(t);else{var r=t.options;r.navDate=t.getNavDate();var d=t.__jsonld.id;d||(d=t.__jsonld["@id"]),m.Utils.loadManifest(d).then(function(E){t.parentLabel=m.LanguageMap.getValue(t.getLabel(),r.locale);var x=m.Deserialiser.parse(E,r);(t=Object.assign(t,x)).index=r.index,n(t)})}})},e}(m.ManifestResource);c.IIIFResource=f},function(u,c,p){"use strict";var s,v=this&&this.__extends||(s=function(f,h){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(f,h)},function(f,h){function e(){this.constructor=f}s(f,h),f.prototype=h===null?Object.create(h):(e.prototype=h.prototype,new e)});Object.defineProperty(c,"__esModule",{value:!0});var m=p(0),a=function(f){function h(e,t){return f.call(this,e,t)||this}return v(h,f),h.prototype.getBody=function(){var e=[],t=this.getProperty("body");if(t)if(Array.isArray(t))for(var n=0;n<t.length;n++)if((E=t[n]).items)for(var r=0;r<E.items.length;r++){var d=E.items[r];e.push(new m.AnnotationBody(d,this.options))}else e.push(new m.AnnotationBody(E,this.options));else if(t.items)for(n=0;n<t.items.length;n++){var E=t.items[n];e.push(new m.AnnotationBody(E,this.options))}else e.push(new m.AnnotationBody(t,this.options));return e},h.prototype.getMotivation=function(){return this.getProperty("motivation")||null},h.prototype.getOn=function(){return this.getProperty("on")},h.prototype.getTarget=function(){return this.getProperty("target")},h.prototype.getResource=function(){return new m.Resource(this.getProperty("resource"),this.options)},h}(m.ManifestResource);c.Annotation=a},function(u,c,p){"use strict";var s,v=this&&this.__extends||(s=function(f,h){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(f,h)},function(f,h){function e(){this.constructor=f}s(f,h),f.prototype=h===null?Object.create(h):(e.prototype=h.prototype,new e)});Object.defineProperty(c,"__esModule",{value:!0});var m=p(0),a=function(f){function h(e,t){return f.call(this,e,t)||this}return v(h,f),h.prototype.getFormat=function(){var e=this.getProperty("format");return e?m.Utils.getMediaType(e):null},h.prototype.getType=function(){return this.getProperty("type")?m.Utils.normaliseType(this.getProperty("type")):null},h.prototype.getWidth=function(){return this.getProperty("width")},h.prototype.getHeight=function(){return this.getProperty("height")},h}(m.ManifestResource);c.AnnotationBody=a},function(u,c,p){"use strict";var s,v=this&&this.__extends||(s=function(f,h){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(f,h)},function(f,h){function e(){this.constructor=f}s(f,h),f.prototype=h===null?Object.create(h):(e.prototype=h.prototype,new e)});Object.defineProperty(c,"__esModule",{value:!0});var m=p(0),a=function(f){function h(e,t,n){var r=f.call(this,t)||this;return r.label=e,r.options=n,r}return v(h,f),h.prototype.getIIIFResourceType=function(){return m.Utils.normaliseType(this.getProperty("type"))},h.prototype.getLabel=function(){return this.label},h.prototype.getResources=function(){var e=this;return this.getProperty("resources").map(function(t){return new m.Annotation(t,e.options)})},h.prototype.load=function(){var e=this;return new Promise(function(t,n){if(e.isLoaded)t(e);else{var r=e.__jsonld.id;r||(r=e.__jsonld["@id"]),m.Utils.loadManifest(r).then(function(d){e.__jsonld=d,e.context=e.getProperty("context"),e.id=e.getProperty("id"),e.isLoaded=!0,t(e)}).catch(n)}})},h}(m.JSONLDResource);c.AnnotationList=a},function(u,c,p){"use strict";var s,v=this&&this.__extends||(s=function(a,f){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,e){h.__proto__=e}||function(h,e){for(var t in e)e.hasOwnProperty(t)&&(h[t]=e[t])})(a,f)},function(a,f){function h(){this.constructor=a}s(a,f),a.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)});Object.defineProperty(c,"__esModule",{value:!0});var m=function(a){function f(h,e){return a.call(this,h,e)||this}return v(f,a),f.prototype.getItems=function(){return this.getProperty("items")},f}(p(0).ManifestResource);c.AnnotationPage=m},function(u,c,p){"use strict";var s,v=this&&this.__extends||(s=function(f,h){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(f,h)},function(f,h){function e(){this.constructor=f}s(f,h),f.prototype=h===null?Object.create(h):(e.prototype=h.prototype,new e)});Object.defineProperty(c,"__esModule",{value:!0});var m=p(0),a=function(f){function h(e,t){return f.call(this,e,t)||this}return v(h,f),h.prototype.getCanonicalImageUri=function(e){var t,n=null,r="default",d=e;if(this.externalResource&&this.externalResource.data&&this.externalResource.data["@id"])n=this.externalResource.data["@id"],d||(d=this.externalResource.data.width),this.externalResource.data["@context"]&&(this.externalResource.data["@context"].indexOf("/1.0/context.json")>-1||this.externalResource.data["@context"].indexOf("/1.1/context.json")>-1||this.externalResource.data["@context"].indexOf("/1/context.json")>-1)&&(r="native");else{var E=this.getImages();if(E&&E.length){var x=E[0].getResource(),y=x.getServices();if(d||(d=x.getWidth()),y.length){var L=y[0];n=L.id,r=m.Utils.getImageQuality(L.getProfile())}else if(d===x.getWidth())return x.id}if(!n){var S=this.getProperty("thumbnail");if(S){if(typeof S=="string")return S;if(S["@id"])return S["@id"];if(S.length)return S[0].id}}}return t=d+",",n&&n.endsWith("/")&&(n=n.substr(0,n.length-1)),[n,"full",t,0,r+".jpg"].join("/")},h.prototype.getMaxDimensions=function(){var e,t=null;return this.externalResource&&this.externalResource.data&&this.externalResource.data.profile&&(e=this.externalResource.data.profile,Array.isArray(e)&&(e=e.filter(function(n){return n.maxWidth})[0])&&(t=new m.Size(e.maxWidth,e.maxHeight?e.maxHeight:e.maxWidth))),t},h.prototype.getContent=function(){var e=[],t=this.__jsonld.items||this.__jsonld.content;if(!t)return e;var n=null;if(t.length&&(n=new m.AnnotationPage(t[0],this.options)),!n)return e;for(var r=n.getItems(),d=0;d<r.length;d++){var E=r[d],x=new m.Annotation(E,this.options);e.push(x)}return e},h.prototype.getDuration=function(){return this.getProperty("duration")},h.prototype.getImages=function(){var e=[];if(!this.__jsonld.images)return e;for(var t=0;t<this.__jsonld.images.length;t++){var n=this.__jsonld.images[t],r=new m.Annotation(n,this.options);e.push(r)}return e},h.prototype.getIndex=function(){return this.getProperty("index")},h.prototype.getOtherContent=function(){var e=this,t=(Array.isArray(this.getProperty("otherContent"))?this.getProperty("otherContent"):[this.getProperty("otherContent")]).filter(function(n){return n&&typeof(r=n["@type"])=="string"&&r.toLowerCase()==r.toLowerCase();var r}).map(function(n,r){return new m.AnnotationList(n.label||"Annotation list "+r,n,e.options)}).map(function(n){return n.load()});return Promise.all(t)},h.prototype.getWidth=function(){return this.getProperty("width")},h.prototype.getHeight=function(){return this.getProperty("height")},h}(m.Resource);c.Canvas=a},function(u,c,p){"use strict";var s,v=this&&this.__extends||(s=function(h,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(h,e)},function(h,e){function t(){this.constructor=h}s(h,e),h.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)});Object.defineProperty(c,"__esModule",{value:!0});var m=p(1),a=p(0),f=function(h){function e(t,n){var r=h.call(this,t,n)||this;return r.items=[],r._collections=null,r._manifests=null,t.__collection=r,r}return v(e,h),e.prototype.getCollections=function(){return this._collections?this._collections:this._collections=this.items.filter(function(t){return t.isCollection()})},e.prototype.getManifests=function(){return this._manifests?this._manifests:this._manifests=this.items.filter(function(t){return t.isManifest()})},e.prototype.getCollectionByIndex=function(t){for(var n,r=this.getCollections(),d=0;d<r.length;d++){var E=r[d];E.index===t&&(n=E)}if(n)return n.options.index=t,n.load();throw new Error("Collection index not found")},e.prototype.getManifestByIndex=function(t){for(var n,r=this.getManifests(),d=0;d<r.length;d++){var E=r[d];E.index===t&&(n=E)}if(n)return n.options.index=t,n.load();throw new Error("Manifest index not found")},e.prototype.getTotalCollections=function(){return this.getCollections().length},e.prototype.getTotalManifests=function(){return this.getManifests().length},e.prototype.getTotalItems=function(){return this.items.length},e.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")?this.getProperty("viewingDirection"):m.ViewingDirection.LEFT_TO_RIGHT},e.prototype.getDefaultTree=function(){return h.prototype.getDefaultTree.call(this),this.defaultTree.data.type=a.Utils.normaliseType(a.TreeNodeType.COLLECTION),this._parseManifests(this),this._parseCollections(this),a.Utils.generateTreeNodeIds(this.defaultTree),this.defaultTree},e.prototype._parseManifests=function(t){if(t.getManifests()&&t.getManifests().length)for(var n=0;n<t.getManifests().length;n++){var r=t.getManifests()[n],d=r.getDefaultTree();d.label=r.parentLabel||a.LanguageMap.getValue(r.getLabel(),this.options.locale)||"manifest "+(n+1),d.navDate=r.getNavDate(),d.data.id=r.id,d.data.type=a.Utils.normaliseType(a.TreeNodeType.MANIFEST),t.defaultTree.addNode(d)}},e.prototype._parseCollections=function(t){if(t.getCollections()&&t.getCollections().length)for(var n=0;n<t.getCollections().length;n++){var r=t.getCollections()[n],d=r.getDefaultTree();d.label=r.parentLabel||a.LanguageMap.getValue(r.getLabel(),this.options.locale)||"collection "+(n+1),d.navDate=r.getNavDate(),d.data.id=r.id,d.data.type=a.Utils.normaliseType(a.TreeNodeType.COLLECTION),t.defaultTree.addNode(d)}},e}(a.IIIFResource);c.Collection=f},function(u,c,p){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var s=function(){function v(m,a){this.start=m,this.end=a}return v.prototype.getLength=function(){return this.end-this.start},v}();c.Duration=s},function(u,c,p){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var s=p(0),v=function(){function m(a){this.defaultLocale=a}return m.prototype.parse=function(a){this.resource=a,this.label=s.LanguageMap.parse(this.resource.label,this.defaultLocale),this.value=s.LanguageMap.parse(this.resource.value,this.defaultLocale)},m.prototype.getLabel=function(){return this.label?s.LanguageMap.getValue(this.label,this.defaultLocale):null},m.prototype.setLabel=function(a){var f=this;if(this.label&&this.label.length){var h=this.label.filter(function(e){return e.locale===f.defaultLocale||e.locale===s.Utils.getInexactLocale(f.defaultLocale)})[0];h&&(h.value=a)}},m.prototype.getValue=function(){if(this.value){var a=this.defaultLocale;return this.label&&this.label.length&&this.label[0].locale&&(a=this.label[0].locale),s.LanguageMap.getValue(this.value,a)}return null},m.prototype.setValue=function(a){var f=this;if(this.value&&this.value.length){var h=this.va