UNPKG

@tindtechnologies/universalviewer

Version:

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

1 lines 107 kB
import{b as k,c as b}from"./chunk-YAXTLTJC.js";var H=k(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});var tt;(function(o){o.BOOKMARKING="oa:bookmarking",o.CLASSIFYING="oa:classifying",o.COMMENTING="oa:commenting",o.DESCRIBING="oa:describing",o.EDITING="oa:editing",o.HIGHLIGHTING="oa:highlighting",o.IDENTIFYING="oa:identifying",o.LINKING="oa:linking",o.MODERATING="oa:moderating",o.PAINTING="sc:painting",o.QUESTIONING="oa:questioning",o.REPLYING="oa:replying",o.TAGGING="oa:tagging",o.TRANSCRIBING="oad:transcribing"})(tt=C.AnnotationMotivation||(C.AnnotationMotivation={}));var et;(function(o){o.AUTO_ADVANCE="auto-advance",o.CONTINUOUS="continuous",o.FACING_PAGES="facing-pages",o.HIDDEN="hidden",o.INDIVIDUALS="individuals",o.MULTI_PART="multi-part",o.NO_NAV="no-nav",o.NON_PAGED="non-paged",o.PAGED="paged",o.REPEAT="repeat",o.SEQUENCE="sequence",o.THUMBNAIL_NAV="thumbnail-nav",o.TOGETHER="together",o.UNORDERED="unordered"})(et=C.Behavior||(C.Behavior={}));var nt;(function(o){o.CANVAS="canvas",o.CHOICE="choice",o.OA_CHOICE="oa:choice",o.CONTENT_AS_TEXT="contentastext",o.DATASET="dataset",o.DOCUMENT="document",o.IMAGE="image",o.MODEL="model",o.MOVING_IMAGE="movingimage",o.PDF="pdf",o.PHYSICAL_OBJECT="physicalobject",o.SOUND="sound",o.TEXT="text",o.TEXTUALBODY="textualbody",o.VIDEO="video"})(nt=C.ExternalResourceType||(C.ExternalResourceType={}));var it;(function(o){o.ANNOTATION="annotation",o.CANVAS="canvas",o.COLLECTION="collection",o.MANIFEST="manifest",o.RANGE="range",o.SEQUENCE="sequence"})(it=C.IIIFResourceType||(C.IIIFResourceType={}));var rt;(function(o){o.AUDIO_MP4="audio/mp4",o.CORTO="application/corto",o.DICOM="application/dicom",o.DRACO="application/draco",o.EPUB="application/epub+zip",o.GIRDER="image/vnd.kitware.girder",o.GLB="model/gltf-binary",o.GLTF="model/gltf+json",o.IIIF_PRESENTATION_2='application/ld+json;profile="http://iiif.io/api/presentation/2/context.json"',o.IIIF_PRESENTATION_3='application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"',o.JPG="image/jpeg",o.M3U8="application/vnd.apple.mpegurl",o.MP3="audio/mp3",o.MPEG_DASH="application/dash+xml",o.OBJ="text/plain",o.OPF="application/oebps-package+xml",o.PDF="application/pdf",o.PLY="application/ply",o.THREEJS="application/vnd.threejs+json",o.USDZ="model/vnd.usd+zip",o.VIDEO_MP4="video/mp4",o.WAV="audio/wav",o.WEBM="video/webm"})(rt=C.MediaType||(C.MediaType={}));var ot;(function(o){o.DOC="application/msword",o.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",o.PDF="application/pdf"})(ot=C.RenderingFormat||(C.RenderingFormat={}));var at;(function(o){o.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",o.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",o.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",o.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",o.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",o.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",o.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",o.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",o.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",o.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",o.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",o.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",o.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",o.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",o.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",o.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",o.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",o.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",o.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",o.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",o.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",o.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",o.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",o.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",o.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",o.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",o.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",o.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",o.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",o.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",o.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",o.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",o.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",o.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",o.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",o.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",o.SEARCH_0="http://iiif.io/api/search/0/search",o.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",o.SEARCH_1="http://iiif.io/api/search/1/search",o.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",o.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",o.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",o.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",o.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",o.DOWNLOAD_EXTENSIONS="http://universalviewer.io/download-extensions-profile",o.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",o.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"})(at=C.ServiceProfile||(C.ServiceProfile={}));var st;(function(o){o.IMAGE_SERVICE_2="ImageService2",o.IMAGE_SERVICE_3="ImageService3"})(st=C.ServiceType||(C.ServiceType={}));var ut;(function(o){o.BOTTOM_TO_TOP="bottom-to-top",o.LEFT_TO_RIGHT="left-to-right",o.RIGHT_TO_LEFT="right-to-left",o.TOP_TO_BOTTOM="top-to-bottom"})(ut=C.ViewingDirection||(C.ViewingDirection={}));var lt;(function(o){o.CONTINUOUS="continuous",o.INDIVIDUALS="individuals",o.NON_PAGED="non-paged",o.PAGED="paged",o.TOP="top"})(lt=C.ViewingHint||(C.ViewingHint={}))});var G=k((x,q)=>{(function(o,e){typeof x=="object"&&typeof q=="object"?q.exports=e():typeof define=="function"&&define.amd?define("manifesto",[],e):typeof x=="object"?x.manifesto=e():o.manifesto=e()})(typeof self!="undefined"?self:x,function(){return function(o){var e={};function r(n){if(e[n])return e[n].exports;var c=e[n]={i:n,l:!1,exports:{}};return o[n].call(c.exports,c,c.exports,r),c.l=!0,c.exports}return r.m=o,r.c=e,r.d=function(n,c,l){r.o(n,c)||Object.defineProperty(n,c,{enumerable:!0,get:l})},r.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.t=function(n,c){if(1&c&&(n=r(n)),8&c||4&c&&typeof n=="object"&&n&&n.__esModule)return n;var l=Object.create(null);if(r.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:n}),2&c&&typeof n!="string")for(var s in n)r.d(l,s,function(p){return n[p]}.bind(null,s));return l},r.n=function(n){var c=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(c,"a",c),c},r.o=function(n,c){return Object.prototype.hasOwnProperty.call(n,c)},r.p="",r(r.s=7)}([function(o,e,r){"use strict";function n(c){for(var l in c)e.hasOwnProperty(l)||(e[l]=c[l])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(9)),n(r(10)),n(r(11)),n(r(12)),n(r(13)),n(r(14)),n(r(15)),n(r(16)),n(r(17)),n(r(31)),n(r(32)),n(r(33)),n(r(34)),n(r(35)),n(r(38)),n(r(39)),n(r(40)),n(r(41)),n(r(42)),n(r(43)),n(r(44)),n(r(45)),n(r(46)),n(r(47)),n(r(48)),n(r(49)),n(r(50)),n(r(3))},function(o,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(n){n.BOOKMARKING="oa:bookmarking",n.CLASSIFYING="oa:classifying",n.COMMENTING="oa:commenting",n.DESCRIBING="oa:describing",n.EDITING="oa:editing",n.HIGHLIGHTING="oa:highlighting",n.IDENTIFYING="oa:identifying",n.LINKING="oa:linking",n.MODERATING="oa:moderating",n.PAINTING="sc:painting",n.QUESTIONING="oa:questioning",n.REPLYING="oa:replying",n.TAGGING="oa:tagging",n.TRANSCRIBING="oad:transcribing"}(e.AnnotationMotivation||(e.AnnotationMotivation={})),function(n){n.AUTO_ADVANCE="auto-advance",n.CONTINUOUS="continuous",n.FACING_PAGES="facing-pages",n.HIDDEN="hidden",n.INDIVIDUALS="individuals",n.MULTI_PART="multi-part",n.NO_NAV="no-nav",n.NON_PAGED="non-paged",n.PAGED="paged",n.REPEAT="repeat",n.SEQUENCE="sequence",n.THUMBNAIL_NAV="thumbnail-nav",n.TOGETHER="together",n.UNORDERED="unordered"}(e.Behavior||(e.Behavior={})),function(n){n.CANVAS="canvas",n.CHOICE="choice",n.OA_CHOICE="oa:choice",n.CONTENT_AS_TEXT="contentastext",n.DATASET="dataset",n.DOCUMENT="document",n.IMAGE="image",n.MODEL="model",n.MOVING_IMAGE="movingimage",n.PDF="pdf",n.PHYSICAL_OBJECT="physicalobject",n.SOUND="sound",n.TEXT="text",n.TEXTUALBODY="textualbody",n.VIDEO="video"}(e.ExternalResourceType||(e.ExternalResourceType={})),function(n){n.ANNOTATION="annotation",n.CANVAS="canvas",n.COLLECTION="collection",n.MANIFEST="manifest",n.RANGE="range",n.SEQUENCE="sequence"}(e.IIIFResourceType||(e.IIIFResourceType={})),function(n){n.AUDIO_MP4="audio/mp4",n.CORTO="application/corto",n.DICOM="application/dicom",n.DRACO="application/draco",n.EPUB="application/epub+zip",n.GIRDER="image/vnd.kitware.girder",n.GLB="model/gltf-binary",n.GLTF="model/gltf+json",n.IIIF_PRESENTATION_2='application/ld+json;profile="http://iiif.io/api/presentation/2/context.json"',n.IIIF_PRESENTATION_3='application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"',n.JPG="image/jpeg",n.M3U8="application/vnd.apple.mpegurl",n.MP3="audio/mp3",n.MPEG_DASH="application/dash+xml",n.OBJ="text/plain",n.OPF="application/oebps-package+xml",n.PDF="application/pdf",n.PLY="application/ply",n.THREEJS="application/vnd.threejs+json",n.USDZ="model/vnd.usd+zip",n.VIDEO_MP4="video/mp4",n.WAV="audio/wav",n.WEBM="video/webm"}(e.MediaType||(e.MediaType={})),function(n){n.DOC="application/msword",n.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",n.PDF="application/pdf"}(e.RenderingFormat||(e.RenderingFormat={})),function(n){n.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",n.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",n.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",n.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",n.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",n.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",n.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",n.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",n.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",n.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",n.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",n.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",n.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",n.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",n.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",n.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",n.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",n.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",n.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",n.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",n.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",n.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",n.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",n.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",n.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",n.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",n.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",n.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",n.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",n.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",n.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",n.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",n.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",n.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",n.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",n.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",n.SEARCH_0="http://iiif.io/api/search/0/search",n.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",n.SEARCH_1="http://iiif.io/api/search/1/search",n.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",n.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",n.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",n.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",n.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",n.DOWNLOAD_EXTENSIONS="http://universalviewer.io/download-extensions-profile",n.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",n.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"}(e.ServiceProfile||(e.ServiceProfile={})),function(n){n.IMAGE_SERVICE_2="ImageService2",n.IMAGE_SERVICE_3="ImageService3"}(e.ServiceType||(e.ServiceType={})),function(n){n.BOTTOM_TO_TOP="bottom-to-top",n.LEFT_TO_RIGHT="left-to-right",n.RIGHT_TO_LEFT="right-to-left",n.TOP_TO_BOTTOM="top-to-bottom"}(e.ViewingDirection||(e.ViewingDirection={})),function(n){n.CONTINUOUS="continuous",n.INDIVIDUALS="individuals",n.NON_PAGED="non-paged",n.PAGED="paged",n.TOP="top"}(e.ViewingHint||(e.ViewingHint={}))},function(o,e,r){var n=r(21).Symbol;o.exports=n},function(o,e,r){"use strict";var n=this&&this.__awaiter||function(i,t,a,u){return new(a||(a=Promise))(function(f,g){function _(y){try{E(u.next(y))}catch(d){g(d)}}function v(y){try{E(u.throw(y))}catch(d){g(d)}}function E(y){var d;y.done?f(y.value):(d=y.value,d instanceof a?d:new a(function(T){T(d)})).then(_,v)}E((u=u.apply(i,t||[])).next())})},c=this&&this.__generator||function(i,t){var a,u,f,g,_={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return g={next:v(0),throw:v(1),return:v(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function v(E){return function(y){return function(d){if(a)throw new TypeError("Generator is already executing.");for(;_;)try{if(a=1,u&&(f=2&d[0]?u.return:d[0]?u.throw||((f=u.return)&&f.call(u),0):u.next)&&!(f=f.call(u,d[1])).done)return f;switch(u=0,f&&(d=[2&d[0],f.value]),d[0]){case 0:case 1:f=d;break;case 4:return _.label++,{value:d[1],done:!1};case 5:_.label++,u=d[1],d=[0];continue;case 7:d=_.ops.pop(),_.trys.pop();continue;default:if(!(f=(f=_.trys).length>0&&f[f.length-1])&&(d[0]===6||d[0]===2)){_=0;continue}if(d[0]===3&&(!f||d[1]>f[0]&&d[1]<f[3])){_.label=d[1];break}if(d[0]===6&&_.label<f[1]){_.label=f[1],f=d;break}if(f&&_.label<f[2]){_.label=f[2],_.ops.push(d);break}f[2]&&_.ops.pop(),_.trys.pop();continue}d=t.call(i,_)}catch(T){d=[6,T],u=0}finally{a=f=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([E,y])}}};Object.defineProperty(e,"__esModule",{value:!0});var l=r(0),s=r(1),p=r(36);r(37);var h=function(){function i(){}return i.getMediaType=function(t){return(t=(t=t.toLowerCase()).split(";")[0]).trim()},i.getImageQuality=function(t){return t===s.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||t===s.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||t===s.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||t===s.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||t===s.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||t===s.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||t===s.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||t===s.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||t===s.ServiceProfile.IMAGE_1_LEVEL_1||t===s.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||t===s.ServiceProfile.IMAGE_1_LEVEL_2||t===s.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2?"native":"default"},i.getInexactLocale=function(t){return t.indexOf("-")!==-1?t.substr(0,t.indexOf("-")):t},i.getLocalisedValue=function(t,a){if(!Array.isArray(t))return t;for(var u=0;u<t.length;u++){var f=t[u];if(a===f["@language"])return f["@value"]}var g=a.substr(0,a.indexOf("-"));for(u=0;u<t.length;u++){var _=t[u];if(_["@language"]===g)return _["@value"]}return null},i.generateTreeNodeIds=function(t,a){var u;a===void 0&&(a=0),u=t.parentNode?t.parentNode.id+"-"+a:"0",t.id=u;for(var f=0;f<t.nodes.length;f++){var g=t.nodes[f];i.generateTreeNodeIds(g,f)}},i.normaliseType=function(t){return(t=(t||"").toLowerCase()).indexOf(":")!==-1?t.split(":")[1]:t},i.normaliseUrl=function(t){return(t=t.substr(t.indexOf("://"))).indexOf("#")!==-1&&(t=t.split("#")[0]),t},i.normalisedUrlsMatch=function(t,a){return i.normaliseUrl(t)===i.normaliseUrl(a)},i.isImageProfile=function(t){return!!(i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_LEVEL_0)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_LEVEL_1)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_LEVEL_2)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_2_LEVEL_0)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_2_LEVEL_1)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_2_LEVEL_2)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},i.isImageServiceType=function(t){return t!==null&&t.toLowerCase()===s.ServiceType.IMAGE_SERVICE_2.toLowerCase()||t===s.ServiceType.IMAGE_SERVICE_3.toLowerCase()},i.isLevel0ImageProfile=function(t){return!!(i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_LEVEL_0)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_2_LEVEL_0)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0))},i.isLevel1ImageProfile=function(t){return!!(i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_LEVEL_1)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_2_LEVEL_1)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1))},i.isLevel2ImageProfile=function(t){return!!(i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_LEVEL_2)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_2_LEVEL_2)||i.normalisedUrlsMatch(t,s.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},i.parseManifest=function(t,a){return l.Deserialiser.parse(t,a)},i.checkStatus=function(t){if(t.ok)return t;var a=new Error(t.statusText);return a.response=t,Promise.reject(a)},i.loadManifest=function(t){return new Promise(function(a,u){fetch(t).then(i.checkStatus).then(function(f){return f.json()}).then(function(f){a(f)}).catch(function(f){u()})})},i.loadExternalResourcesAuth1=function(t,a,u,f,g,_,v,E){return new Promise(function(y,d){var T=t.map(function(I){return i.loadExternalResourceAuth1(I,a,u,f,g,_,v,E)});Promise.all(T).then(function(){y(t)}).catch(function(I){d(I)})})},i.loadExternalResourceAuth1=function(t,a,u,f,g,_,v,E){return n(this,void 0,void 0,function(){var y;return c(this,function(d){switch(d.label){case 0:return[4,f(t)];case 1:return(y=d.sent())?[4,t.getData(y)]:[3,6];case 2:return d.sent(),t.status!==p.OK?[3,3]:[2,t];case 3:return[4,i.doAuthChain(t,a,u,g,_,v,E)];case 4:d.sent(),d.label=5;case 5:if(t.status===p.OK||t.status===p.MOVED_TEMPORARILY)return[2,t];throw i.createAuthorizationFailedError();case 6:return[4,t.getData()];case 7:return d.sent(),t.status!==p.MOVED_TEMPORARILY&&t.status!==p.UNAUTHORIZED?[3,9]:[4,i.doAuthChain(t,a,u,g,_,v,E)];case 8:d.sent(),d.label=9;case 9:if(t.status===p.OK||t.status===p.MOVED_TEMPORARILY)return[2,t];throw i.createAuthorizationFailedError()}})})},i.doAuthChain=function(t,a,u,f,g,_,v){return n(this,void 0,void 0,function(){var E,y,d,T,I,m,A,M;return c(this,function(R){switch(R.label){case 0:return t.isAccessControlled()?((E=t.externalService)&&(E.options=t.options),(y=t.kioskService)&&(y.options=t.options),(d=t.clickThroughService)&&(d.options=t.options),(T=t.loginService)&&(T.options=t.options),t.isResponseHandled||t.status!==p.MOVED_TEMPORARILY?[3,2]:[4,_(t)]):[2,t];case 1:return R.sent(),[2,t];case 2:return I=null,m=null,(I=E)?(m=I,[4,i.attemptResourceWithToken(t,u,I)]):[3,4];case 3:return R.sent(),[2,t];case 4:return(I=y)?(m=I,(A=a(I))?[4,f(A)]:[3,7]):[3,7];case 5:return R.sent(),[4,i.attemptResourceWithToken(t,u,I)];case 6:return R.sent(),[2,t];case 7:return(I=d)?(m=I,[4,g(t,I)]):[3,11];case 8:return(M=R.sent())?[4,f(M)]:[3,11];case 9:return R.sent(),[4,i.attemptResourceWithToken(t,u,I)];case 10:return R.sent(),[2,t];case 11:return(I=T)?(m=I,[4,g(t,I)]):[3,15];case 12:return(M=R.sent())?[4,f(M)]:[3,15];case 13:return R.sent(),[4,i.attemptResourceWithToken(t,u,I)];case 14:return R.sent(),[2,t];case 15:return m&&v(t,m),[2]}})})},i.attemptResourceWithToken=function(t,a,u){return n(this,void 0,void 0,function(){var f,g;return c(this,function(_){switch(_.label){case 0:return(f=u.getService(s.ServiceProfile.AUTH_1_TOKEN))?[4,a(t,f)]:[3,3];case 1:return(g=_.sent())&&g.accessToken?[4,t.getData(g)]:[3,3];case 2:return _.sent(),[2,t];case 3:return[2]}})})},i.loadExternalResourcesAuth09=function(t,a,u,f,g,_,v,E,y,d){return new Promise(function(T,I){var m=t.map(function(A){return i.loadExternalResourceAuth09(A,a,u,f,g,_,v,E,y,d)});Promise.all(m).then(function(){T(t)}).catch(function(A){I(A)})})},i.loadExternalResourceAuth09=function(t,a,u,f,g,_,v,E,y,d){return new Promise(function(T,I){d&&d.pessimisticAccessControl?t.getData().then(function(){t.isAccessControlled()?t.clickThroughService?(T(u(t)),T(f(t))):g(t).then(function(){_(t,!0).then(function(m){t.getData(m).then(function(){T(y(t))}).catch(function(A){I(i.createInternalServerError(A))})}).catch(function(m){I(i.createInternalServerError(m))})}).catch(function(m){I(i.createInternalServerError(m))}):T(t)}).catch(function(m){I(i.createInternalServerError(m))}):E(t,a).then(function(m){m?t.getData(m).then(function(){t.status===p.OK?T(y(t)):i.authorize(t,a,u,f,g,_,v,E).then(function(){T(y(t))}).catch(function(A){I(i.createAuthorizationFailedError())})}).catch(function(A){I(i.createAuthorizationFailedError())}):i.authorize(t,a,u,f,g,_,v,E).then(function(){T(y(t))}).catch(function(A){I(i.createAuthorizationFailedError())})}).catch(function(m){I(i.createAuthorizationFailedError())})})},i.createError=function(t,a){var u=new Error;return u.message=a,u.name=String(t),u},i.createAuthorizationFailedError=function(){return i.createError(l.StatusCode.AUTHORIZATION_FAILED,"Authorization failed")},i.createRestrictedError=function(){return i.createError(l.StatusCode.RESTRICTED,"Restricted")},i.createInternalServerError=function(t){return i.createError(l.StatusCode.INTERNAL_SERVER_ERROR,t)},i.authorize=function(t,a,u,f,g,_,v,E){return new Promise(function(y,d){t.getData().then(function(){t.isAccessControlled()?E(t,a).then(function(T){T?t.getData(T).then(function(){t.status===p.OK?y(t):i.showAuthInteraction(t,a,u,f,g,_,v,y,d)}).catch(function(I){d(i.createInternalServerError(I))}):_(t,!1).then(function(I){I?v(t,I,a).then(function(){t.getData(I).then(function(){t.status===p.OK?y(t):i.showAuthInteraction(t,a,u,f,g,_,v,y,d)}).catch(function(m){d(i.createInternalServerError(m))})}).catch(function(m){d(i.createInternalServerError(m))}):i.showAuthInteraction(t,a,u,f,g,_,v,y,d)})}).catch(function(T){d(i.createInternalServerError(T))}):y(t)})})},i.showAuthInteraction=function(t,a,u,f,g,_,v,E,y){t.status!==p.MOVED_TEMPORARILY||t.isResponseHandled?t.clickThroughService&&!t.isResponseHandled?u(t).then(function(){_(t,!0).then(function(d){v(t,d,a).then(function(){t.getData(d).then(function(){E(t)}).catch(function(T){y(i.createInternalServerError(T))})}).catch(function(T){y(i.createInternalServerError(T))})}).catch(function(d){y(i.createInternalServerError(d))})}):g(t).then(function(){_(t,!0).then(function(d){v(t,d,a).then(function(){t.getData(d).then(function(){E(t)}).catch(function(T){y(i.createInternalServerError(T))})}).catch(function(T){y(i.createInternalServerError(T))})}).catch(function(d){y(i.createInternalServerError(d))})}):E(t)},i.getService=function(t,a){for(var u=this.getServices(t),f=0;f<u.length;f++){var g=u[f];if(g.getProfile()===a)return g}return null},i.getResourceById=function(t,a){return i.traverseAndFind(t.__jsonld,"@id",a)},i.traverseAndFind=function(t,a,u){if(t.hasOwnProperty(a)&&t[a]===u)return t;for(var f=0;f<Object.keys(t).length;f++)if(typeof t[Object.keys(t)[f]]=="object"){var g=i.traverseAndFind(t[Object.keys(t)[f]],a,u);if(g!=null)return g}},i.getServices=function(t,a){var u=a===void 0?{}:a,f=u.onlyService,g=f!==void 0&&f,_=u.onlyServices,v=_!==void 0&&_,E=u.skipParentResources,y=[];!(E!==void 0&&E)&&t&&t.options&&t.options.resource&&t.options.resource!==t&&y.push.apply(y,i.getServices(t.options.resource,{onlyServices:!0}));var d=v?[]:(t.__jsonld||t).service||[];if(Array.isArray(d)||(d=[d]),g||d.push.apply(d,(t.__jsonld||t).services||[]),d.length===0)return y;for(var T=0;T<d.length;T++){var I=d[T];if(typeof I=="string"){var m=this.getResourceById(t.options.resource,I);m&&y.push(new l.Service(m.__jsonld||m,t.options))}else y.push(new l.Service(I,t.options))}return y},i.getTemporalComponent=function(t){var a=/t=([^&]+)/g.exec(t),u=null;return a&&a[1]&&(u=a[1].split(",")),u},i}();e.Utils=h},function(o,e,r){var n=r(19),c=r(20);o.exports=function l(s,p,h,i,t){var a=-1,u=s.length;for(h||(h=c),t||(t=[]);++a<u;){var f=s[a];p>0&&h(f)?p>1?l(f,p-1,h,i,t):n(t,f):i||(t[t.length]=f)}return t}},function(o,e){o.exports=function(r){return r!=null&&typeof r=="object"}},function(o,e,r){"use strict";r.r(e),e.default=function(n,c){return c=c||{},new Promise(function(l,s){var p=new XMLHttpRequest,h=[],i=[],t={},a=function(){return{ok:(p.status/100|0)==2,statusText:p.statusText,status:p.status,url:p.responseURL,text:function(){return Promise.resolve(p.responseText)},json:function(){return Promise.resolve(JSON.parse(p.responseText))},blob:function(){return Promise.resolve(new Blob([p.response]))},clone:a,headers:{keys:function(){return h},entries:function(){return i},get:function(f){return t[f.toLowerCase()]},has:function(f){return f.toLowerCase()in t}}}};for(var u in p.open(c.method||"get",n,!0),p.onload=function(){p.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(f,g,_){h.push(g=g.toLowerCase()),i.push([g,_]),t[g]=t[g]?t[g]+","+_:_}),l(a())},p.onerror=s,p.withCredentials=c.credentials=="include",c.headers)p.setRequestHeader(u,c.headers[u]);p.send(c.body||null)})}},function(o,e,r){o.exports=r(8)},function(o,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(c){for(var l in c)e.hasOwnProperty(l)||(e[l]=c[l])}(r(0));var n=r(3);e.loadManifest=function(c){return n.Utils.loadManifest(c)},e.parseManifest=function(c,l){return n.Utils.parseManifest(c,l)}},function(o,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function c(l){this.__jsonld=l,this.context=this.getProperty("context"),this.id=this.getProperty("id")}return c.prototype.getProperty=function(l){var s=null;return this.__jsonld&&((s=this.__jsonld[l])||(s=this.__jsonld["@"+l])),s},c}();e.JSONLDResource=n},function(o,e,r){"use strict";var n,c=this&&this.__extends||(n=function(h,i){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var u in a)a.hasOwnProperty(u)&&(t[u]=a[u])})(h,i)},function(h,i){function t(){this.constructor=h}n(h,i),h.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)});Object.defineProperty(e,"__esModule",{value:!0});var l=r(0),s=r(1),p=function(h){function i(t,a){var u=h.call(this,t)||this;return u.options=a,u}return c(i,h),i.prototype.getIIIFResourceType=function(){return l.Utils.normaliseType(this.getProperty("type"))},i.prototype.getLabel=function(){var t=this.getProperty("label");return t?l.PropertyValue.parse(t,this.options.locale):new l.PropertyValue([],this.options.locale)},i.prototype.getDefaultLabel=function(){return this.getLabel().getValue(this.options.locale)},i.prototype.getMetadata=function(){var t=this.getProperty("metadata"),a=[];if(!t)return a;for(var u=0;u<t.length;u++){var f=t[u],g=new l.LabelValuePair(this.options.locale);g.parse(f),a.push(g)}return a},i.prototype.getRendering=function(t){for(var a=this.getRenderings(),u=0;u<a.length;u++){var f=a[u];if(f.getFormat()===t)return f}return null},i.prototype.getRenderings=function(){var t,a=[];if(!(t=this.__jsonld?this.__jsonld.rendering:this.rendering))return a;Array.isArray(t)||(t=[t]);for(var u=0;u<t.length;u++){var f=t[u];a.push(new l.Rendering(f,this.options))}return a},i.prototype.getRequiredStatement=function(){var t=null,a=this.getProperty("requiredStatement");return a&&(t=new l.LabelValuePair(this.options.locale)).parse(a),t},i.prototype.getService=function(t){return l.Utils.getService(this,t)},i.prototype.getServices=function(){return l.Utils.getServices(this)},i.prototype.getThumbnail=function(){var t=this.getProperty("thumbnail");return Array.isArray(t)&&(t=t[0]),t?new l.Thumbnail(t,this.options):null},i.prototype.isAnnotation=function(){return this.getIIIFResourceType()===s.IIIFResourceType.ANNOTATION},i.prototype.isCanvas=function(){return this.getIIIFResourceType()===s.IIIFResourceType.CANVAS},i.prototype.isCollection=function(){return this.getIIIFResourceType()===s.IIIFResourceType.COLLECTION},i.prototype.isManifest=function(){return this.getIIIFResourceType()===s.IIIFResourceType.MANIFEST},i.prototype.isRange=function(){return this.getIIIFResourceType()===s.IIIFResourceType.RANGE},i.prototype.isSequence=function(){return this.getIIIFResourceType()===s.IIIFResourceType.SEQUENCE},i}(l.JSONLDResource);e.ManifestResource=p},function(o,e,r){"use strict";var n,c=this&&this.__extends||(n=function(p,h){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(var a in t)t.hasOwnProperty(a)&&(i[a]=t[a])})(p,h)},function(p,h){function i(){this.constructor=p}n(p,h),p.prototype=h===null?Object.create(h):(i.prototype=h.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var l=r(0),s=function(p){function h(i,t){return p.call(this,i,t)||this}return c(h,p),h.prototype.getFormat=function(){var i=this.getProperty("format");return i?i.toLowerCase():null},h.prototype.getResources=function(){var i=[];if(!this.__jsonld.resources)return i;for(var t=0;t<this.__jsonld.resources.length;t++){var a=this.__jsonld.resources[t],u=new l.Annotation(a,this.options);i.push(u)}return i},h.prototype.getType=function(){var i=this.getProperty("type");return i?l.Utils.normaliseType(i):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}(l.ManifestResource);e.Resource=s},function(o,e,r){"use strict";var n,c=this&&this.__extends||(n=function(h,i){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var u in a)a.hasOwnProperty(u)&&(t[u]=a[u])})(h,i)},function(h,i){function t(){this.constructor=h}n(h,i),h.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)});Object.defineProperty(e,"__esModule",{value:!0});var l=r(0),s=r(1),p=function(h){function i(t,a){var u=h.call(this,t,a)||this;u.index=-1,u.isLoaded=!1;var f={defaultLabel:"-",locale:"en-GB",resource:u,pessimisticAccessControl:!1};return u.options=Object.assign(f,a),u}return c(i,h),i.prototype.getAttribution=function(){var t=this.getProperty("attribution");return t?l.PropertyValue.parse(t,this.options.locale):new l.PropertyValue([],this.options.locale)},i.prototype.getDescription=function(){var t=this.getProperty("description");return t?l.PropertyValue.parse(t,this.options.locale):new l.PropertyValue([],this.options.locale)},i.prototype.getHomepage=function(){var t=this.getProperty("homepage");return t?typeof t=="string"?t:(Array.isArray(t)&&t.length&&(t=t[0]),t["@id"]||t.id):null},i.prototype.getIIIFResourceType=function(){return l.Utils.normaliseType(this.getProperty("type"))},i.prototype.getLogo=function(){var t=this.getProperty("logo");if(!t){var a=this.getProperty("provider");if(!a)return null;t=a.logo}return t?typeof t=="string"?t:(Array.isArray(t)&&t.length&&(t=t[0]),t["@id"]||t.id):null},i.prototype.getLicense=function(){return l.Utils.getLocalisedValue(this.getProperty("license"),this.options.locale)},i.prototype.getNavDate=function(){return new Date(this.getProperty("navDate"))},i.prototype.getRelated=function(){return this.getProperty("related")},i.prototype.getSeeAlso=function(){return this.getProperty("seeAlso")},i.prototype.getTrackingLabel=function(){var t=this.getService(s.ServiceProfile.TRACKING_EXTENSIONS);return t?t.getProperty("trackingLabel"):""},i.prototype.getDefaultTree=function(){return this.defaultTree=new l.TreeNode("root"),this.defaultTree.data=this,this.defaultTree},i.prototype.getRequiredStatement=function(){var t=null,a=this.getProperty("requiredStatement");if(a)(t=new l.LabelValuePair(this.options.locale)).parse(a);else{var u=this.getAttribution();u&&((t=new l.LabelValuePair(this.options.locale)).value=u)}return t},i.prototype.isCollection=function(){return this.getIIIFResourceType()===s.IIIFResourceType.COLLECTION},i.prototype.isManifest=function(){return this.getIIIFResourceType()===s.IIIFResourceType.MANIFEST},i.prototype.load=function(){var t=this;return new Promise(function(a){if(t.isLoaded)a(t);else{var u=t.options;u.navDate=t.getNavDate();var f=t.__jsonld.id;f||(f=t.__jsonld["@id"]),l.Utils.loadManifest(f).then(function(g){t.parentLabel=t.getLabel().getValue(u.locale);var _=l.Deserialiser.parse(g,u);(t=Object.assign(t,_)).index=u.index,a(t)})}})},i}(l.ManifestResource);e.IIIFResource=p},function(o,e,r){"use strict";var n,c=this&&this.__extends||(n=function(p,h){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(var a in t)t.hasOwnProperty(a)&&(i[a]=t[a])})(p,h)},function(p,h){function i(){this.constructor=p}n(p,h),p.prototype=h===null?Object.create(h):(i.prototype=h.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var l=r(0),s=function(p){function h(i,t){return p.call(this,i,t)||this}return c(h,p),h.prototype.getBody=function(){var i=[],t=this.getProperty("body");if(t)if(Array.isArray(t))for(var a=0;a<t.length;a++)if((g=t[a]).items)for(var u=0;u<g.items.length;u++){var f=g.items[u];i.push(new l.AnnotationBody(f,this.options))}else i.push(new l.AnnotationBody(g,this.options));else if(t.items)for(a=0;a<t.items.length;a++){var g=t.items[a];i.push(new l.AnnotationBody(g,this.options))}else i.push(new l.AnnotationBody(t,this.options));return i},h.prototype.getMotivation=function(){var i=this.getProperty("motivation");return i||null},h.prototype.getOn=function(){return this.getProperty("on")},h.prototype.getTarget=function(){return this.getProperty("target")},h.prototype.getResource=function(){return new l.Resource(this.getProperty("resource"),this.options)},h}(l.ManifestResource);e.Annotation=s},function(o,e,r){"use strict";var n,c=this&&this.__extends||(n=function(p,h){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(var a in t)t.hasOwnProperty(a)&&(i[a]=t[a])})(p,h)},function(p,h){function i(){this.constructor=p}n(p,h),p.prototype=h===null?Object.create(h):(i.prototype=h.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var l=r(0),s=function(p){function h(i,t){return p.call(this,i,t)||this}return c(h,p),h.prototype.getFormat=function(){var i=this.getProperty("format");return i?l.Utils.getMediaType(i):null},h.prototype.getType=function(){return this.getProperty("type")?l.Utils.normaliseType(this.getProperty("type")):null},h.prototype.getWidth=function(){return this.getProperty("width")},h.prototype.getHeight=function(){return this.getProperty("height")},h}(l.ManifestResource);e.AnnotationBody=s},function(o,e,r){"use strict";var n,c=this&&this.__extends||(n=function(p,h){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(var a in t)t.hasOwnProperty(a)&&(i[a]=t[a])})(p,h)},function(p,h){function i(){this.constructor=p}n(p,h),p.prototype=h===null?Object.create(h):(i.prototype=h.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var l=r(0),s=function(p){function h(i,t,a){var u=p.call(this,t)||this;return u.label=i,u.options=a,u}return c(h,p),h.prototype.getIIIFResourceType=function(){return l.Utils.normaliseType(this.getProperty("type"))},h.prototype.getLabel=function(){return this.label},h.prototype.getResources=function(){var i=this;return this.getProperty("resources").map(function(t){return new l.Annotation(t,i.options)})},h.prototype.load=function(){var i=this;return new Promise(function(t,a){if(i.isLoaded)t(i);else{var u=i.__jsonld.id;u||(u=i.__jsonld["@id"]),l.Utils.loadManifest(u).then(function(f){i.__jsonld=f,i.context=i.getProperty("context"),i.id=i.getProperty("id"),i.isLoaded=!0,t(i)}).catch(a)}})},h}(l.JSONLDResource);e.AnnotationList=s},function(o,e,r){"use strict";var n,c=this&&this.__extends||(n=function(s,p){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,i){h.__proto__=i}||function(h,i){for(var t in i)i.hasOwnProperty(t)&&(h[t]=i[t])})(s,p)},function(s,p){function h(){this.constructor=s}n(s,p),s.prototype=p===null?Object.create(p):(h.prototype=p.prototype,new h)});Object.defineProperty(e,"__esModule",{value:!0});var l=function(s){function p(h,i){return s.call(this,h,i)||this}return c(p,s),p.prototype.getItems=function(){return this.getProperty("items")},p}(r(0).ManifestResource);e.AnnotationPage=l},function(o,e,r){"use strict";var n,c=this&&this.__extends||(n=function(a,u){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var _ in g)g.hasOwnProperty(_)&&(f[_]=g[_])})(a,u)},function(a,u){function f(){this.constructor=a}n(a,u),a.prototype=u===null?Object.create(u):(f.prototype=u.prototype,new f)}),l=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0});var s=r(1),p=r(0),h=l(r(18)),i=l(r(30)),t=function(a){function u(f,g){return a.call(this,f,g)||this}return c(u,a),u.prototype.getCanonicalImageUri=function(f){var g,_=null,v="default",E=f;if(this.externalResource&&this.externalResource.data&&this.externalResource.data["@id"])_=this.externalResource.data["@id"],E||(E=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)&&(v="native");else{var y=void 0;if((y=this.getImages())&&y.length){var d=y[0].getResource(),T=d.getServices();if(E||(E=d.getWidth()),I=T?T.find(function(M){return p.Utils.isImageProfile(M.getProfile())||p.Utils.isImageServiceType(M.getIIIFResourceType())}):null)_=I.id,v=p.Utils.getImageQuality(I.getProfile());else if(E===d.getWidth())return d.id}if((y=this.getContent())&&y.length){var I,m=y[0].getBody()[0];if(T=m.getServices(),E||(E=m.getWidth()),I=T?T.find(function(M){return p.Utils.isImageServiceType(M.getIIIFResourceType())}):null)_=I.id,v=p.Utils.getImageQuality(I.getProfile());else if(E===m.getWidth())return m.id}if(!_){var A=this.getProperty("thumbnail");if(A){if(typeof A=="string")return A;if(A["@id"])return A["@id"];if(A.length)return A[0].id}}}return g=E+",",_&&_.endsWith("/")&&(_=_.substr(0,_.length-1)),[_,"full",g,0,v+".jpg"].join("/")},u.prototype.getMaxDimensions=function(){var f,g=null;return this.externalResource&&this.externalResource.data&&this.externalResource.data.profile&&(f=this.externalResource.data.profile,Array.isArray(f)&&(f=f.filter(function(_){return _.maxWidth})[0])&&(g=new p.Size(f.maxWidth,f.maxHeight?f.maxHeight:f.maxWidth))),g},u.prototype.getContent=function(){var f=[],g=this.__jsonld.items||this.__jsonld.content;if(!g)return f;var _=null;if(g.length&&(_=new p.AnnotationPage(g[0],this.options)),!_)return f;for(var v=_.getItems(),E=0;E<v.length;E++){var y=v[E],d=new p.Annotation(y,this.options);f.push(d)}return f},u.prototype.getDuration=function(){return this.getProperty("duration")},u.prototype.getImages=function(){var f=[];if(!this.__jsonld.images)return f;for(var g=0;g<this.__jsonld.images.length;g++){var _=this.__jsonld.images[g],v=new p.Annotation(_,this.options);f.push(v)}return f},u.prototype.getIndex=function(){return this.getProperty("index")},u.prototype.getOtherContent=function(){var f=this,g=Array.isArray(this.getProperty("otherContent"))?this.getProperty("otherContent"):[this.getProperty("otherContent")],_=g.filter(function(v){return v&&(E=v["@type"],y="sc:AnnotationList",typeof E=="string"&&typeof y=="string"&&E.toLowerCase()==E.toLowerCase());var E,y}).map(function(v,E){return new p.AnnotationList(v.label||"Annotation list "+E,v,f.options)}).map(function(v){return v.load()});return Promise.all(_)},u.prototype.getWidth=function(){return this.getProperty("width")},u.prototype.getHeight=function(){return this.getProperty("height")},u.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},Object.defineProperty(u.prototype,"imageResources",{get:function(){var f=this,g=i.default([this.getImages().map(function(_){return _.getResource()}),this.getContent().map(function(_){return _.getBody()})]);return h.default(g.map(function(_){switch(_.getProperty("type").toLowerCase()){case s.ExternalResourceType.CHOICE:case s.ExternalResourceType.OA_CHOICE:return new u({images:h.default([_.getProperty("default"),_.getProperty("item")]).map(function(v){return{resource:v}})},f.options).getImages().map(function(v){return v.getResource()});default:return _}}))},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"resourceAnnotations",{get:function(){return i.default([this.getImages(),this.getContent()])},enumerable:!0,configurable:!0}),u.prototype.resourceAnnotation=function(f){return this.resourceAnnotations.find(function(g){return g.getResource().id===f||h.default(new Array(g.getBody())).some(function(_){return _.id===f})})},u.prototype.onFragment=function(f){var g=this.resourceAnnotation(f);if(g){var _=g.getProperty("on"),v=g.getProperty("target");if(_&&v){var E=(_||v).match(/xywh=(.*)$/);if(E)return E[1].split(",").map(function(y){return parseInt(y,10)})}}},Object.defineProperty(u.prototype,"iiifImageResources",{get:function(){return this.imageResources.filter(function(f){return f&&f.getServices()[0]&&f.getServices()[0].id})},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"imageServiceIds",{get:function(){return this.iiifImageResources.map(function(f){return f.getServices()[0].id})},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"aspectRatio",{get:function(){return this.getWidth()/this.getHeight()},enumerable:!0,configurable:!0}),u}(p.Resource);e.Canvas=t},function(o,e,r){var n=r(4);o.exports=function(c){return(c==null?0:c.length)?n(c,1):[]}},function(o,e){o.exports=function(r,n){for(var c=-1,l=n.length,s=r.length;++c<l;)r[s+c]=n[c];return r}},function(o,e,r){var n=r(2),c=r(24),l=r(29),s=n?n.isConcatSpreadable:void 0;o.exports=function(p){return l(p)||c(p)||!!(s&&p&&p[s])}},function(o,e,r){var n=r(22),c=typeof self=="object"&&self&&self.Object===Object&&self,l=n||c||Function("return this")();o.exports=l},function(o,e,r){(function(n){var c=typeof n=="object"&&n&&n.Object===Object&&n;o.exports=c}).call(this,r(23))},function(o,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch{typeof window=="object"&&(r=window)}o.exports=r},function(o,e,r){var n=r(25),c=r(5),l=Object.prototype,s=l.hasOwnProperty,p=l.propertyIsEnumerable,h=n(function(){return arguments}())?n:function(i){return c(i)&&s.call(i,"callee")&&!p.call(i,"callee")};o.exports=h},function(o,e,r){var n=r(26),c=r(5),l="[object Arguments]";o.exports=function(s){return c(s)&&n(s)==l}},function(o,e,r){var n=r(2),c=r(27),l=r(28),s="[object Null]",p="[object Undefined]",h=n?n.toStringTag:void 0;o.exports=function(i){return i==null?i===void 0?p:s:h&&h in Object(i)?c(i):l(i)}},function(o,e,r){var n=r(2),c=Object.prototype,l=c.hasOwnProperty,s=c.toString,p=n?n.toStringTag:void 0;o.exports=function(h){var i=l.call(h,p),t=h[p];try{h[p]=void 0;var a=!0}catch{}var u=s.call(h);return a&&(i?h[p]=t:delete h[p]),u}},function(o,e){var r=Object.prototype.toString;o.exports=function(n){return r.call(n)}},function(o,e){var r=Array.isArray;o.exports=r},function(o,e,r){var n=r(4),c=1/0;o.exports=function(l){return(l==null?0:l.length)?n(l,c):[]}},function(o,e,r){"use strict";var n,c=this&&this.__extends||(n=function(h,i){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var u in a)a.hasOwnProperty(u)&&(t[u]=a[u])})(h,i)},function(h,i){function t(){this.constructor=h}n(h,i),h.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)});Object.defineProperty(e,"__esModule",{value:!0});var l=r(1),s=r(0),p=function(h){function i(t,a){var u=h.call(this,t,a)||this;return u.items=[],u._collections=null,u._manifests=null,t.__collection=u,u}return c(i,h),i.prototype.getCollections=function(){return this._collections?this._collections:this._collections=this.items.filter(function(t){return t.isCollection()})},i.prototype.getManifests=function(){return this._manifests?this._manifests:this._manifests=this.items.filter(function(t){return t.isManifest()})},i.prototype.getCollectionByIndex=function(t){for(var a,u=this.getCollections(),f=0;f<u.length;f++){var g=u[f];g.index===t&&(a=g)}if(a)return a.options.index=t,a.load();throw new Error("Collection index not found")},i.prototype.getManifestByIndex=function(t){for(var a,u=this.getManifests(),f=0;f<u.length;f++){var g=u[f];g.index===t&&(a=g)}if(a)return a.options.index=t,a.load();throw new Error("Manifest index not found")},i.prototype.getTotalCollections=function(){return this.getCollections().length},i.prototype.getTotalManifests=function(){return this.getManifests().length},i.prototype.getTotalItems=function(){return this.items.length},i.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")?this.getProperty("viewingDirection"):l.ViewingDirection.LEFT_TO_RIGHT},i.prototype.getBehavior=function(){var t=this.getProperty("behavior");return Array.isArray(t)&&(t=t[0]),t||null},i.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},i.prototype.getDefaultTree=function(){return h.prototype.getDefaultTree.call(this),this.defaultTree.data.type=s.Utils.normaliseType(s.TreeNodeType.COLLECTION),this._parseManifests(this),this._parseCollections(this),s.Utils.generateTreeNodeIds(this.defaultTree),this.defaultTree},i.prototype._parseManifests=function(t){if(t.getManifests()&&t.getManifests().length)for(var a=0;a<t.getManifests().length;a++){var u=t.getManifests()[a],f=u.getDefaultTree();f.label=u.parentLabel||u.getLabel().getValue(this.options.locale)||"manifest "+(a+1),f.navDate=u.getNavDate(),f.data.id=u.id,f.data.type=s.Utils.normaliseType(s.TreeNodeTy